From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gnuweeb.org (Postfix) with ESMTPS id 54E667E257 for ; Fri, 5 Aug 2022 19:31:32 +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=dOwh0pyK; 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=1659727892; x=1691263892; h=date:from:to:cc:subject:message-id:mime-version; bh=nFLmjPErjkQhIl8QDldI2o5FUsN5xd7bCexbmDipSwM=; b=dOwh0pyKtc2yiVzqmdb4L9uGK943GdRIfUO2GmtVVwIvOuszw4cLfpAb ohGzVElVgcndLvcDNqOlTS+uEB6F4WIPWavCStsJj7ohMNIrL9Iy2mNOb tRu66xgrhXPslcwoTwlsYs8/qgHvgCdslfQciiYYF4TxEfhPuwVCHSqk8 dbVgvLdDsx61GJaxGeZAeQhNql34cC/j3x+CR3o/C0vUf4LBlotLTCYwO ybXsaYwMmMRjQjJl56wSCSPh/qfo/N4L4wLVU/0VCqst4HFx2t79yYJ6J sWVdO4nFi+Lr/LhmrPzyuzn3QCUgdDmgMQ9IEV3g97Y4ncoi71WQmV+VN A==; X-IronPort-AV: E=McAfee;i="6400,9594,10430"; a="376568266" X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="376568266" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2022 12:31:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="693099785" Received: from lkp-server01.sh.intel.com (HELO e0eace57cfef) ([10.239.97.150]) by FMSMGA003.fm.intel.com with ESMTP; 05 Aug 2022 12:31:30 -0700 Received: from kbuild by e0eace57cfef with local (Exim 4.96) (envelope-from ) id 1oK32g-000JfW-04; Fri, 05 Aug 2022 19:31:30 +0000 Date: Sat, 6 Aug 2022 03:30:49 +0800 From: kernel test robot To: Ammar Faizi , GNU/Weeb Mailing List Cc: kbuild-all@lists.01.org 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: <202208060357.ggXKhqGj-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android-4.14-stable head: c529afa15a69594211793a68cb70c873508061df commit: 5179a6a673e1bff5b9823b1317c59127bacd4641 [642/9999] UPSTREAM: bpf: permit multiple bpf attachments for a single perf event config: i386-randconfig-s001 (https://download.01.org/0day-ci/archive/20220806/202208060357.ggXKhqGj-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-39-gce1a6720-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 mkdir build_dir && cp config build_dir/.config make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash fs/crypto/ kernel/bpf/ If you fix the issue, kindly add following tag where applicable 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 https://01.org/lkp