From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.14 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796101073; b=rqk4eUWMU1JslQ4mSnj9lmaqpIOYj6iPsf8FFALjHTCFD1PqkwwSRUAoI+3UERD2bKcH NcK8QgazQSEnwSFc5gF2Py9kmRvkLmgoilm9DQdNgS2WcAxPDuau/lNgePKqS2UnxJ3W3 XuOU8I+bFwRb2mb5NOhhd/0mb1eRF4FxXbgW9J7IlwVoAd97jznSwwjO4cNeHl1qQFUN8 mfRByGAwieQh0NQXYDLmHPc0dh0tQfQkmyCtPdcBnLkqcNF5fB4BFJFIzHVDvkNLKC+E6 fFgyxvcKhIStTOJxCsqcVOCLl1XsRN6LU71RtkAwevbM7cs+Dy0ql5SLjTClGwLHGXA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796101073; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Date:From:To: Cc:Subject:Message-ID:User-Agent; bh=ObrXL44zfFs0gRgRqIjFENMHBB40PYgFFds0OGXgcbA=; b=oRSUKZzPG2N3SWicMDCNsQB1roN9zeQG1BMid1rmJTMte2ggyDuY4lF4IzyPTSCGX6Pq /ECplXpJRBkk2u1r0owVJM+Xc6Tw7J7dwgA9F0c8Dnvj8lThwDwpGqO0VAkTEtHFlyG49 yhHMVl3HSuZSVlZ0uCXZz0SMI9uhA8GVbxKrSNwqwBrb7FOGJF66ARf6ICTb2NZhNJf8/ HN03va+Ok0w48kt9RZHHmM+5JT3IjjSPpk9022XaCWz8iG0NiPprEbsciYmDRIwwTgh+h mn4WPEtLky9+zrtAhqVruWKIHC4T6W1lm8/tLWvjdNv9cSmTUv1ceSzFLQJ4VRi1RSw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ZE3WVBTC; arc=none smtp.remote-ip=198.175.65.14 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D57E606A320 for ; Tue, 1 Dec 2026 04:57:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5D57E606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ZE3WVBTC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796101073; x=1827637073; h=date:from:to:cc:subject:message-id; bh=ObrXL44zfFs0gRgRqIjFENMHBB40PYgFFds0OGXgcbA=; b=ZE3WVBTCo5MVMXvOOypg45o80uk55SazSMc7USWxlPQvO9CNXLTtcRM8 WEGuTIJkqWBGm6jMZ530gZV8uH66kwZLC4To05CW2ZuR7KFaIm9dpPquX naUNVjBfmsHQ6+7JFSOnckzq48F2KmFoOeDBjDAEyxno5/7kXCuwDz79u SIo0BWAayCeiKYNuyno73UJrD1ZtiVbOHOuoqIpvNjoWrtte8CUUKz6HB uoj0emaIE+7G7RZYjblYFwm+sC4wnJcM6VLBn9rU8RaRYPqxepJuggLdq Y7yk5gW8PzLAoeaeplWesqp3hjo587TEl8o5xscs0az7Jq2j5A9GMigVi A==; X-CSE-ConnectionGUID: K0twhkQNS8qevC5v96ksuQ== X-CSE-MsgGUID: tPaCVGMmTzyC9wskTajZuA== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4868361" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4868361" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 20:57:52 -0800 X-CSE-ConnectionGUID: GJYr9OEdSa+G8hjc/ikN3A== X-CSE-MsgGUID: gj8tr67MQOyd4scpHmnc7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="13126864" Received: from igk-lkp-server01.igk.intel.com (HELO 146cf1e082f1) ([10.211.93.152]) by orviesa006.jf.intel.com with ESMTP; 30 Nov 2026 20:57:51 -0800 Received: from kbuild by 146cf1e082f1 with local (Exim 4.98.2) (envelope-from ) id 1xYFw4-000000001Za-30jd; Tue, 01 Dec 2026 04:57:48 +0000 Date: Tue, 01 Dec 2026 05:57:23 +0100 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com Subject: security/apparmor/af_unix.c:764:50: sparse: warning: incorrect type in argument 1 (different address spaces) Message-ID: <20261201054651.Cbj4629p-lkp@intel.com> User-Agent: s-nail v14.9.25 X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list :::::: :::::: Manual check reason: "low confidence static check warning: security/apparmor/af_unix.c:764:50: sparse: warning: incorrect type in argument 1 (different address spaces)" :::::: BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: linux-kernel@vger.kernel.org TO: John Johansen tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 19cc08c1a6a650f8e54c0461ff198be6448f425d commit: 4483efe4f21510b30c24bc97d9fd0e8feab94125 apparmor: fix shadowing of plabel that prevents cache from being updated date: 6 months ago :::::: branch date: 8 hours ago :::::: commit date: 6 months ago config: x86_64-randconfig-2300-20261130 (https://download.01.org/0day-ci/archive/20261201/20261201054651.Cbj4629p-lkp@intel.com/config) compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1) sparse: v0.6.5-rc1-94-g0d159c10 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261201/20261201054651.Cbj4629p-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Fixes: 4483efe4f215 ("apparmor: fix shadowing of plabel that prevents cache from being updated") | Reported-by: kernel test robot | Closes: https://lore.kernel.org/r/20261201054651.Cbj4629p-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> security/apparmor/af_unix.c:764:50: sparse: warning: incorrect type in argument 1 (different address spaces) security/apparmor/af_unix.c:764:50: sparse: expected struct aa_label *l security/apparmor/af_unix.c:764:50: sparse: got struct aa_label [noderef] __rcu *label vim +764 security/apparmor/af_unix.c 88fec3526e84123 John Johansen 2025-06-19 705 bc6e5f6933b8e7b John Johansen 2025-04-01 706 /* This fn is only checked if something has changed in the security bc6e5f6933b8e7b John Johansen 2025-04-01 707 * boundaries. Otherwise cached info off file is sufficient bc6e5f6933b8e7b John Johansen 2025-04-01 708 */ c05e705812d179f John Johansen 2022-09-07 709 int aa_unix_file_perm(const struct cred *subj_cred, struct aa_label *label, c05e705812d179f John Johansen 2022-09-07 710 const char *op, u32 request, struct file *file) c05e705812d179f John Johansen 2022-09-07 711 { c05e705812d179f John Johansen 2022-09-07 712 struct socket *sock = (struct socket *) file->private_data; bc6e5f6933b8e7b John Johansen 2025-04-01 713 struct sockaddr_un *addr, *peer_addr; bc6e5f6933b8e7b John Johansen 2025-04-01 714 int addrlen, peer_addrlen; 88fec3526e84123 John Johansen 2025-06-19 715 struct aa_label *plabel = NULL; c05e705812d179f John Johansen 2022-09-07 716 struct sock *peer_sk = NULL; c05e705812d179f John Johansen 2022-09-07 717 u32 sk_req = request & ~NET_PEER_MASK; bc6e5f6933b8e7b John Johansen 2025-04-01 718 struct path path; c05e705812d179f John Johansen 2022-09-07 719 bool is_sk_fs; c05e705812d179f John Johansen 2022-09-07 720 int error = 0; c05e705812d179f John Johansen 2022-09-07 721 c05e705812d179f John Johansen 2022-09-07 722 AA_BUG(!label); c05e705812d179f John Johansen 2022-09-07 723 AA_BUG(!sock); c05e705812d179f John Johansen 2022-09-07 724 AA_BUG(!sock->sk); c05e705812d179f John Johansen 2022-09-07 725 AA_BUG(sock->sk->sk_family != PF_UNIX); c05e705812d179f John Johansen 2022-09-07 726 bc6e5f6933b8e7b John Johansen 2025-04-01 727 /* investigate only using lock via unix_peer_get() bc6e5f6933b8e7b John Johansen 2025-04-01 728 * addr only needs the memory barrier, but need to investigate bc6e5f6933b8e7b John Johansen 2025-04-01 729 * path bc6e5f6933b8e7b John Johansen 2025-04-01 730 */ c05e705812d179f John Johansen 2022-09-07 731 unix_state_lock(sock->sk); c05e705812d179f John Johansen 2022-09-07 732 peer_sk = unix_peer(sock->sk); c05e705812d179f John Johansen 2022-09-07 733 if (peer_sk) c05e705812d179f John Johansen 2022-09-07 734 sock_hold(peer_sk); c05e705812d179f John Johansen 2022-09-07 735 c05e705812d179f John Johansen 2022-09-07 736 is_sk_fs = is_unix_fs(sock->sk); bc6e5f6933b8e7b John Johansen 2025-04-01 737 addr = aa_sunaddr(unix_sk(sock->sk), &addrlen); bc6e5f6933b8e7b John Johansen 2025-04-01 738 path = unix_sk(sock->sk)->path; bc6e5f6933b8e7b John Johansen 2025-04-01 739 unix_state_unlock(sock->sk); bc6e5f6933b8e7b John Johansen 2025-04-01 740 c05e705812d179f John Johansen 2022-09-07 741 if (is_sk_fs && peer_sk) c05e705812d179f John Johansen 2022-09-07 742 sk_req = request; bc6e5f6933b8e7b John Johansen 2025-04-01 743 if (sk_req) { bc6e5f6933b8e7b John Johansen 2025-04-01 744 error = aa_unix_label_sk_perm(subj_cred, label, op, 6456ccbd2ff7281 John Johansen 2025-06-04 745 sk_req, sock->sk, 6456ccbd2ff7281 John Johansen 2025-06-04 746 is_sk_fs ? &path : NULL); bc6e5f6933b8e7b John Johansen 2025-04-01 747 } c05e705812d179f John Johansen 2022-09-07 748 if (!peer_sk) bc6e5f6933b8e7b John Johansen 2025-04-01 749 goto out; bc6e5f6933b8e7b John Johansen 2025-04-01 750 bc6e5f6933b8e7b John Johansen 2025-04-01 751 peer_addr = aa_sunaddr(unix_sk(peer_sk), &peer_addrlen); bc6e5f6933b8e7b John Johansen 2025-04-01 752 bc6e5f6933b8e7b John Johansen 2025-04-01 753 struct path peer_path; c05e705812d179f John Johansen 2022-09-07 754 bc6e5f6933b8e7b John Johansen 2025-04-01 755 peer_path = unix_sk(peer_sk)->path; c05e705812d179f John Johansen 2022-09-07 756 if (!is_sk_fs && is_unix_fs(peer_sk)) { c05e705812d179f John Johansen 2022-09-07 757 last_error(error, c05e705812d179f John Johansen 2022-09-07 758 unix_fs_perm(op, request, subj_cred, label, 6456ccbd2ff7281 John Johansen 2025-06-04 759 is_unix_fs(peer_sk) ? &peer_path : NULL)); c05e705812d179f John Johansen 2022-09-07 760 } else if (!is_sk_fs) { c05e705812d179f John Johansen 2022-09-07 761 struct aa_sk_ctx *pctx = aa_sock(peer_sk); c05e705812d179f John Johansen 2022-09-07 762 88fec3526e84123 John Johansen 2025-06-19 763 rcu_read_lock(); 4483efe4f21510b John Johansen 2025-10-22 @764 plabel = aa_get_newest_label(pctx->label); 88fec3526e84123 John Johansen 2025-06-19 765 rcu_read_unlock(); bc6e5f6933b8e7b John Johansen 2025-04-01 766 /* no fs check of aa_unix_peer_perm because conditions above bc6e5f6933b8e7b John Johansen 2025-04-01 767 * ensure they will never be done bc6e5f6933b8e7b John Johansen 2025-04-01 768 */ c05e705812d179f John Johansen 2022-09-07 769 last_error(error, bc6e5f6933b8e7b John Johansen 2025-04-01 770 xcheck(unix_peer_perm(subj_cred, label, op, bc6e5f6933b8e7b John Johansen 2025-04-01 771 MAY_READ | MAY_WRITE, sock->sk, 6456ccbd2ff7281 John Johansen 2025-06-04 772 is_sk_fs ? &path : NULL, bc6e5f6933b8e7b John Johansen 2025-04-01 773 peer_addr, peer_addrlen, 6456ccbd2ff7281 John Johansen 2025-06-04 774 is_unix_fs(peer_sk) ? 6456ccbd2ff7281 John Johansen 2025-06-04 775 &peer_path : NULL, 88fec3526e84123 John Johansen 2025-06-19 776 plabel), 88fec3526e84123 John Johansen 2025-06-19 777 unix_peer_perm(file->f_cred, plabel, op, bc6e5f6933b8e7b John Johansen 2025-04-01 778 MAY_READ | MAY_WRITE, peer_sk, 6456ccbd2ff7281 John Johansen 2025-06-04 779 is_unix_fs(peer_sk) ? 6456ccbd2ff7281 John Johansen 2025-06-04 780 &peer_path : NULL, 6456ccbd2ff7281 John Johansen 2025-06-04 781 addr, addrlen, 6456ccbd2ff7281 John Johansen 2025-06-04 782 is_sk_fs ? &path : NULL, 6456ccbd2ff7281 John Johansen 2025-06-04 783 label))); 88fec3526e84123 John Johansen 2025-06-19 784 if (!error && !__aa_subj_label_is_cached(plabel, label)) 88fec3526e84123 John Johansen 2025-06-19 785 update_peer_ctx(peer_sk, pctx, label); c05e705812d179f John Johansen 2022-09-07 786 } c05e705812d179f John Johansen 2022-09-07 787 sock_put(peer_sk); c05e705812d179f John Johansen 2022-09-07 788 bc6e5f6933b8e7b John Johansen 2025-04-01 789 out: bc6e5f6933b8e7b John Johansen 2025-04-01 790 88fec3526e84123 John Johansen 2025-06-19 791 /* update peer cache to latest successful perm check */ 88fec3526e84123 John Johansen 2025-06-19 792 if (error == 0) 88fec3526e84123 John Johansen 2025-06-19 793 update_sk_ctx(sock->sk, label, plabel); 88fec3526e84123 John Johansen 2025-06-19 794 aa_put_label(plabel); 88fec3526e84123 John Johansen 2025-06-19 795 c05e705812d179f John Johansen 2022-09-07 796 return error; c05e705812d179f John Johansen 2022-09-07 797 } 88fec3526e84123 John Johansen 2025-06-19 798 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki