From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 903B1344036; Tue, 27 Jan 2026 10:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.96.220.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769510551; cv=none; b=HtYuDZwNQlQY3FdOQKHVnQH7aPEWsC2CDribEtIDB+XEAePHruSvYKLY/RJWAh97QB/G481zscZ2iEV5fNvs3CajOCY3DP6TYd2iKtic/frmtDhiWDo0tkpq7hwREVzC9WlZKFmy+3+G+IRpIYIH2mCJ2lEZnMV+/s7QAatqYK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769510551; c=relaxed/simple; bh=Y3UUNaU3Fue3USygMdt+ESWBFocqEj0mJcLF+FJd+DE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iheoI9VumNFmY6VoqfeBV9KWWWcD6Ho8aOLWgNcBVXAqulfTnM5dQdoVrxjnOmfSj4kc7TzZD1aclWC7ynBPx3IcpaFrMlO7VtYdED3cn9NVkTJoutiR2WUKodC8hQA0RJW3IU0IGW7r6Re/t6H1g6Xip2pN0MTBL7tPkGg7vIY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b=0GRb/Cvq; arc=none smtp.client-ip=62.96.220.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b="0GRb/Cvq" Received: from localhost (localhost [127.0.0.1]) by mx1.secunet.com (Postfix) with ESMTP id AD0DE200AC; Tue, 27 Jan 2026 11:42:23 +0100 (CET) X-Virus-Scanned: by secunet Received: from mx1.secunet.com ([127.0.0.1]) by localhost (mx1.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eEMX2gdmEEeh; Tue, 27 Jan 2026 11:42:23 +0100 (CET) Received: from EXCH-02.secunet.de (rl2.secunet.de [10.32.0.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.secunet.com (Postfix) with ESMTPS id F20A62006C; Tue, 27 Jan 2026 11:42:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com F20A62006C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1769510543; bh=8f3zjACTFNAde3SBMeXL7CRmkIHL60J2ki/tBhZ4sh0=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=0GRb/CvqjHS3ZFZV6ik3e8/XXeD+phT9x1l2eJ0r0YX0w2MTwBbexMwS7XlfmHuPg 3D4V2imlakqvHUqYMesOYQHteFcFIfj7zc0dTHOqr8x+LNf9j9HdXUFQtPodsV++k0 bk/5vD4XuJjG2RkXdKptBRthkNKDBQpxIof/XNbxmxJWDKe8NPVMJ6x49p8Ct0esz0 6+tBpxzxxbkRl6P4EwDhJeSb39DyciXufQ3nYzvpDv9z0t/H3HgvdYgxkgy9Yc1HT9 BQnsvhDEcCIR9apDFZ30js9hjRyR5IvTaxPXAgY56K0ReyeyU4H/Gh25N7W4Ck3gqB 5r/srr0u35PGQ== Received: from moon.secunet.de (172.18.149.1) by EXCH-02.secunet.de (10.32.0.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Tue, 27 Jan 2026 11:42:21 +0100 From: Antony Antony To: Antony Antony , Steffen Klassert , Herbert Xu , CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Chiachang Wang , Yan Yan , , Simon Horman , Subject: [PATCH ipsec-next v5 1/8] xfrm: add missing __rcu annotation to nlsk Date: Tue, 27 Jan 2026 11:42:01 +0100 Message-ID: <9e8623132cb8001bce5bdf97e0c4591101b6dff9.1769509131.git.antony.antony@secunet.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EXCH-03.secunet.de (10.32.0.183) To EXCH-02.secunet.de (10.32.0.172) The nlsk field in struct netns_xfrm is RCU-protected, as seen by the use of rcu_assign_pointer() and RCU_INIT_POINTER() when updating it. However, the field lacks the __rcu annotation, and most read-side accesses don't use rcu_dereference(). Add the missing __rcu annotation and convert all read-side accesses to use rcu_dereference() for correctness and to silence sparse warnings. Sparse warning reported by NIPA allmodconfig test when modifying net/xfrm/xfrm_user.c. The warning is a pre-existing issue in xfrm_nlmsg_multicast(). This series added a new call to this function and NIPA testing reported a new warning was added by this series. To reproduce (requires sparse): make C=2 net/xfrm/ net/xfrm/xfrm_user.c:1574:29: error: incompatible types in comparison expression (different address spaces): net/xfrm/xfrm_user.c:1574:29: struct sock [noderef] __rcu * net/xfrm/xfrm_user.c:1574:29: struct sock * Signed-off-by: Antony Antony --- v3->v4: added this patch --- include/net/netns/xfrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 23dd647fe024..ed8eee81bbb0 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h @@ -59,7 +59,7 @@ struct netns_xfrm { struct list_head inexact_bins; - struct sock *nlsk; + struct sock __rcu *nlsk; struct sock *nlsk_stash; u32 sysctl_aevent_etime; -- 2.39.5