Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1863966lql; Wed, 13 Mar 2024 10:08:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQTqVhNC+gd+OOi6Qt+ZUT24pyAVZqEru86+ol7y0k1JvO4h9dJqZfirkIYcKAu2pC+AlPLe9iCQwck0asRx6Fp/jj3OoBuATlwtjxaQ== X-Google-Smtp-Source: AGHT+IG/YYZYDCxcnfO3fIvQ9oVVI+qIkMzxHswp8wbjt+hdKo9TWJONplbTo8KfAK9cJpU2lDo2 X-Received: by 2002:a05:620a:57d9:b0:788:6375:4577 with SMTP id wl25-20020a05620a57d900b0078863754577mr454942qkn.65.1710349718444; Wed, 13 Mar 2024 10:08:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710349718; cv=pass; d=google.com; s=arc-20160816; b=fJHr80QSlzo3DeyPtm1EKC+xMVo8i3CzM56AYkFjnfbTQ7+VtXYZK1DcP+m8EF3iDm fnNXX/axRkZsLSBb+lCWAoBwOQbaYzLO6smksKNIxhEseP+RQf4PjGr/VJ9g1OF/uSCM JjoGOQSQyVwZEfp8clLX8WzkG8le/DoINiU31cGGrpGylJy2QJLX4pZ/0dnyqCcu3zkd WwhZiY5d3j6c7QLDFYdiAH08wj7r2wA0boMx27w29zc5dhwSRbks9Uav1zKXAYY+Pot8 gd7TV3rHTQtNVB+W/HokrnqmoQO/WsdgpASXf1+HHE/SDOrNj0TG2IMOFXEIc7igjkHk EPNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=aGobuYqDxHZ1Xwc1r2y+/zyg7fIQRTVZl6O0L69vNew=; fh=UDybChT8th3KBBN/dtQlnvIe4LqqY5GN+FXyISH2BnE=; b=qCRinA8ge4ttqEsdiNSj7u4vCfHvy34Qus9ld1ziIZmZEmW1YzcQA1jdeMNn2LdovR uLZqDzNhloTfBGWDcpCNSCmQUVeDGS+geHLdL0L+adPO6xACSWR3J77w0MwW/GBujyVx x73sycSbz+S/8gZwytcOskMNbLm3QyMXEvBbMoIvtnwE17extP2cKRjv1HJYh8AgY9Bq 66qYtub/6OnuAd/Qu7JqYK8I29tWx+vwTiZJN54xJfH+eHTmzxDrA+iZGd8gcxXDCCGT 4Y9owRNJ8oHTQf3ocrRSdGj5E02zuTUCeCv6JSvy7GL4RjYU/EnLOdLDrJW6yyAOGyLQ YPxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tRjqIb3N; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101888-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101888-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o15-20020a05620a110f00b007884d2c266dsi9641334qkk.114.2024.03.13.10.08.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:08:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101888-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tRjqIb3N; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101888-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101888-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2E6B21C216C4 for ; Wed, 13 Mar 2024 17:08:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D22A97BB19; Wed, 13 Mar 2024 16:40:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tRjqIb3N" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F00F77B3F9; Wed, 13 Mar 2024 16:40:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348024; cv=none; b=Ho6UkXRPSHZc/Dfhjmts6YQE8qI0nK7dDmwAvzjJQgFu6FbkBJkve7EHKJQgSMo0TtXyW3ilh2prICRjvH7ydv9iXWMSYkCLUSQr//ihikbdJB6sU0s/T1sD7kJ/k2HG8kdY3kGC7ndSqjP0a/F3fJ+cKwM34owC26By4reMjmQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348024; c=relaxed/simple; bh=zoz/s8A/E4JPfDEwpZXOOhtjTptdKp3RunG4UOVpAz4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sYLI4jnt5Mcv4yXteTu3sM4iyLBzOBMI2O26lbbQPctedJENk7BGJ9DY6v72oLSOMSYdMpnNjqiN/wUlWvT9j4n19ef+gWYDZtBM6hpF5472O9lHMzxhIISqPcDx95PJw0LPIZVh8xj2Ahg8VrdsNsOoLkqMQbi6ah4OY4eoDds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tRjqIb3N; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAEF1C433C7; Wed, 13 Mar 2024 16:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348023; bh=zoz/s8A/E4JPfDEwpZXOOhtjTptdKp3RunG4UOVpAz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tRjqIb3NSnx3ckIE12N9WnO+x2tfxDIvm+/rK3n2DTYEysgWviAv4DH5bzOBABlZ3 WIEerCNEy4L8p0koin2g1kSHLz4uC6KDYikx+1h77tJKsACexyI8lwbBeU8uzvEjk2 ISnY79sZifOwc/+0WYJzUr1l0SZpS1ADho3PoYGi1UouxNxrDxrUJO5v2Y4vZch7Sc zESFzAfdWBiCcFFdKXTCRCpztH03WZrRCM5+SRYZ53A+O6mKGlC2SHtEK5rdTlabBA GgR9nUaeMy4i5Ug55Mt+kc8Jusi1FQtZCavPuPP8u1hRdpeWhJxPhQKmlKz7QH4adI Upt6sJbaeImXQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Xing , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 20/71] netrom: Fix a data-race around sysctl_netrom_obsolescence_count_initialiser Date: Wed, 13 Mar 2024 12:39:06 -0400 Message-ID: <20240313163957.615276-21-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163957.615276-1-sashal@kernel.org> References: <20240313163957.615276-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.82-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.1.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.1.82-rc1 X-KernelTest-Deadline: 2024-03-15T16:39+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jason Xing [ Upstream commit cfd9f4a740f772298308b2e6070d2c744fb5cf79 ] We need to protect the reader reading the sysctl value because the value can be changed concurrently. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jason Xing Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/netrom/nr_route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index 6f709fdffc11f..b8ddd8048f352 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c @@ -766,7 +766,7 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25) if (ax25 != NULL) { ret = nr_add_node(nr_src, "", &ax25->dest_addr, ax25->digipeat, ax25->ax25_dev->dev, 0, - sysctl_netrom_obsolescence_count_initialiser); + READ_ONCE(sysctl_netrom_obsolescence_count_initialiser)); if (ret) return ret; } -- 2.43.0