From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gnuweeb.org (Postfix) with ESMTPS id 022B37E69F for ; Fri, 4 Mar 2022 05:41:55 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=QUHj3Vdg; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646372516; x=1677908516; h=date:from:to:cc:subject:message-id:mime-version; bh=Q0ZPTvvoQq5YmgFEKWDeKblCeuQlWe7QCuhOqxpmCXU=; b=QUHj3Vdgrrj4ul4nVegqPN9Sy6DU5JcJkRddFnmp60jRrldmDd2JV7Gq GVih27/UqbaUfuM+qHH0GX6vjRHISOPnBmk98ZCKWMXHA4JSsMApvhME/ PLaUWfP7zZ6KKBCi7SxWn67IBqXeEMp2TPzlcIJ+0MLbnZfvq3NKosgBZ G5ywvUbzKHSrbRiIsL4M0os1fJuSUlYHbl7ckd8MAFhuf831jKzaJ4yuZ Ped0SciwU3H4s+r9CjOdSqDSpCKASq4+ync9hJ2ok4lohanlxmG5Hm8s1 22TPUR1TdtqWOm0j9O0bQyLoAyx4H82gazIcZN1obhOqSMfBgcwsboWBp w==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="233860793" X-IronPort-AV: E=Sophos;i="5.90,154,1643702400"; d="scan'208";a="233860793" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 21:41:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,154,1643702400"; d="scan'208";a="494224856" Received: from lkp-server01.sh.intel.com (HELO ccb16ba0ecc3) ([10.239.97.150]) by orsmga003.jf.intel.com with ESMTP; 03 Mar 2022 21:41:42 -0800 Received: from kbuild by ccb16ba0ecc3 with local (Exim 4.92) (envelope-from ) id 1nQ0hC-0001LG-2K; Fri, 04 Mar 2022 05:41:42 +0000 Date: Fri, 4 Mar 2022 13:41:38 +0800 From: kernel test robot To: Yonghong Song Cc: kbuild-all@lists.01.org, GNU/Weeb Mailing List , linux-kernel@vger.kernel.org, Connor O'Brien Subject: [ammarfaizi2-block:google/android/kernel/common/android-4.14-stable 642/9999] kernel/bpf/core.c:1532:34: sparse: sparse: incorrect type in initializer (different address spaces) Message-ID: <202203041333.HKzojjDs-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android-4.14-stable head: 4ab5bac1598e3ed91a6267f6cada336467312112 commit: 5179a6a673e1bff5b9823b1317c59127bacd4641 [642/9999] UPSTREAM: bpf: permit multiple bpf attachments for a single perf event config: i386-randconfig-s001-20211101 (https://download.01.org/0day-ci/archive/20220304/202203041333.HKzojjDs-lkp@intel.com/config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-dirty # https://github.com/ammarfaizi2/linux-block/commit/5179a6a673e1bff5b9823b1317c59127bacd4641 git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android-4.14-stable git checkout 5179a6a673e1bff5b9823b1317c59127bacd4641 # save the config file to linux build tree mkdir build_dir make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/virtio/ kernel/bpf/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) kernel/bpf/core.c:1095:43: sparse: sparse: arithmetics on pointers to functions kernel/bpf/core.c:1514:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected struct bpf_prog_array [noderef] * @@ got void * @@ kernel/bpf/core.c:1514:31: sparse: expected struct bpf_prog_array [noderef] * kernel/bpf/core.c:1514:31: sparse: got void * kernel/bpf/core.c:1518:17: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected struct bpf_prog_array [noderef] * @@ got struct bpf_prog_array * @@ kernel/bpf/core.c:1518:17: sparse: expected struct bpf_prog_array [noderef] * kernel/bpf/core.c:1518:17: sparse: got struct bpf_prog_array * kernel/bpf/core.c:1526:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct callback_head *head @@ got struct callback_head [noderef] * @@ kernel/bpf/core.c:1526:9: sparse: expected struct callback_head *head kernel/bpf/core.c:1526:9: sparse: got struct callback_head [noderef] * >> kernel/bpf/core.c:1532:34: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct bpf_prog **prog @@ got struct bpf_prog *[noderef] * @@ kernel/bpf/core.c:1532:34: sparse: expected struct bpf_prog **prog kernel/bpf/core.c:1532:34: sparse: got struct bpf_prog *[noderef] * >> kernel/bpf/core.c:1555:31: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bpf_prog **existing_prog @@ got struct bpf_prog *[noderef] * @@ kernel/bpf/core.c:1555:31: sparse: expected struct bpf_prog **existing_prog kernel/bpf/core.c:1555:31: sparse: got struct bpf_prog *[noderef] * >> kernel/bpf/core.c:1577:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bpf_prog_array *array @@ got struct bpf_prog_array [noderef] * @@ kernel/bpf/core.c:1577:15: sparse: expected struct bpf_prog_array *array kernel/bpf/core.c:1577:15: sparse: got struct bpf_prog_array [noderef] * >> kernel/bpf/core.c:1583:31: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bpf_prog **[assigned] existing_prog @@ got struct bpf_prog *[noderef] * @@ kernel/bpf/core.c:1583:31: sparse: expected struct bpf_prog **[assigned] existing_prog kernel/bpf/core.c:1583:31: sparse: got struct bpf_prog *[noderef] * kernel/bpf/core.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/bpf.h, ...): include/trace/events/bpf.h:56:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/bpf.h:92:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/bpf.h:117:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/bpf.h:188:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/bpf.h:228:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/bpf.h:282:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/bpf.h:312:1: sparse: sparse: Using plain integer as NULL pointer kernel/bpf/core.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/xdp.h, ...): include/trace/events/xdp.h:28:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/xdp.h:53:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/xdp.h:111:1: sparse: sparse: Using plain integer as NULL pointer include/trace/events/xdp.h:126:1: sparse: sparse: Using plain integer as NULL pointer vim +1532 kernel/bpf/core.c 1528 1529 void bpf_prog_array_delete_safe(struct bpf_prog_array __rcu *progs, 1530 struct bpf_prog *old_prog) 1531 { > 1532 struct bpf_prog **prog = progs->progs; 1533 1534 for (; *prog; prog++) 1535 if (*prog == old_prog) { 1536 WRITE_ONCE(*prog, &dummy_bpf_prog.prog); 1537 break; 1538 } 1539 } 1540 1541 int bpf_prog_array_copy(struct bpf_prog_array __rcu *old_array, 1542 struct bpf_prog *exclude_prog, 1543 struct bpf_prog *include_prog, 1544 struct bpf_prog_array **new_array) 1545 { 1546 int new_prog_cnt, carry_prog_cnt = 0; 1547 struct bpf_prog **existing_prog; 1548 struct bpf_prog_array *array; 1549 int new_prog_idx = 0; 1550 1551 /* Figure out how many existing progs we need to carry over to 1552 * the new array. 1553 */ 1554 if (old_array) { > 1555 existing_prog = old_array->progs; 1556 for (; *existing_prog; existing_prog++) { 1557 if (*existing_prog != exclude_prog && 1558 *existing_prog != &dummy_bpf_prog.prog) 1559 carry_prog_cnt++; 1560 if (*existing_prog == include_prog) 1561 return -EEXIST; 1562 } 1563 } 1564 1565 /* How many progs (not NULL) will be in the new array? */ 1566 new_prog_cnt = carry_prog_cnt; 1567 if (include_prog) 1568 new_prog_cnt += 1; 1569 1570 /* Do we have any prog (not NULL) in the new array? */ 1571 if (!new_prog_cnt) { 1572 *new_array = NULL; 1573 return 0; 1574 } 1575 1576 /* +1 as the end of prog_array is marked with NULL */ > 1577 array = bpf_prog_array_alloc(new_prog_cnt + 1, GFP_KERNEL); 1578 if (!array) 1579 return -ENOMEM; 1580 1581 /* Fill in the new prog array */ 1582 if (carry_prog_cnt) { > 1583 existing_prog = old_array->progs; 1584 for (; *existing_prog; existing_prog++) 1585 if (*existing_prog != exclude_prog && 1586 *existing_prog != &dummy_bpf_prog.prog) 1587 array->progs[new_prog_idx++] = *existing_prog; 1588 } 1589 if (include_prog) 1590 array->progs[new_prog_idx++] = include_prog; 1591 array->progs[new_prog_idx] = NULL; 1592 *new_array = array; 1593 return 0; 1594 } 1595 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org