Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3764560ybl; Mon, 27 Jan 2020 09:59:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzVlDn6lY/IZobFx8lyqI7aF4mrQtPJ/8fUDs+djPNd2M2btsLSvGqngJmqXCdY7/TT17ha X-Received: by 2002:aca:3542:: with SMTP id c63mr163471oia.135.1580147982118; Mon, 27 Jan 2020 09:59:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580147982; cv=none; d=google.com; s=arc-20160816; b=AK8yYKu5qziRq6R/O3hRPz5QDurrYIYBF+2LkCcT76K8n7/VuLD/PUUviIq5rkoyF/ Zjn2+z3YwMQzlhqXfotMt2jd5EUhVHrWqLYjhsZMdrZRBCVdV0XLYjCz2D/orkhU2A3T 9UqGF9HqBGX6bd6r4xm/YiEqBF5e4tLatsGL2yBRU7hEyWtfFUBONuX7I51W1Hbtt4O2 N4agnU81BVA6bWDGeNUBtJ/89xO8MUuULa3reBTIrbkpyR8FepvyTYY+0sc/kI88Dd5r P2+PaL7fSb7/AvbLrkPFHjcL1bAdFtyO6O0OmUs6ocWWHZiBGEAr+/64BtCTblqTIBkO uJxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Qg7kiRaR41z6aa68lIG2PQR4oukAllwNZH6einOS8mI=; b=kOsovggNCUjOWnPBeeAuzrQWedIHmeI3oAW7m8m0kh6Mbtc4EuSRYGQe35XVdyDL3B Y4g3iiot5wkTn/Hl+Wt1WKyG5KSM7Pi30DWZpk86ppBegYaFaz/qHNTF9Zfp7Y6Xg4CN u5y0Zr0ycInGO/j6VBDOV68DcAfP+SB6pkjUJWOX8ksCOp7eIB1MM0ecaWvNTOgscGDq 02USeg4+pYRMzbVVanFMii4c5FiW5qLEgt1e1BciUMTZPeK1WKfujRzkulhi3UpR7bgU kRVE/pVzqvG/SYtbtT0rofI5hBLQIlk/AwQlWxBIGjIonMKkzw1hHRJb30JdVx8uVJ7E 0++Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Nq9XQhmU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w131si2887173oie.47.2020.01.27.09.59.29; Mon, 27 Jan 2020 09:59:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Nq9XQhmU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726036AbgA0R6e (ORCPT + 99 others); Mon, 27 Jan 2020 12:58:34 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:38732 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbgA0R6d (ORCPT ); Mon, 27 Jan 2020 12:58:33 -0500 Received: by mail-pj1-f65.google.com with SMTP id m4so3411851pjv.3; Mon, 27 Jan 2020 09:58:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Qg7kiRaR41z6aa68lIG2PQR4oukAllwNZH6einOS8mI=; b=Nq9XQhmUJms+NO7UG2IViWd5kF7jDA+JS49Yr/3QjX8BWU4h2w4ZW2jF+Yc9amkOxX udNY1Q3IIgy23BA6cG1up1SZcCXryo5xHMROf7o/W3534hsBYQLrGVCrh2Q4JYDsXIut MbPWA0RVUFL7K7h3yu198EGM4yE8tPX02HLL9tSQOsE4hBSNoqr3xvzHdZhgz7tbWeuE s2cP+ue78lRB4FHk9rDAb+DqVg0fak80fK0KSeA11364Gteb1np3YXXNwQagB0YRho8H 3ATqOu3VR0W7B6z4h1V4JcXuhpKic1ra/ALBC56LZTTAOaRmE8GfiV1+120Ww8cG6cui 4RvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Qg7kiRaR41z6aa68lIG2PQR4oukAllwNZH6einOS8mI=; b=g8K90iUKUBAhGNddk0CtHpV6hIqHh+JuMR4rAAgH8DQHi+9I4B4B4TfACM9Z0t1WPf HMz0JPpL9tJtsbH+2glVrO92iL16cd5oTwOB4E3DuDAc7jO9ZhVuoPos+Th/1ZjjEpEL fUBzEJkcRLRMNQT+d/oPpIe7xyHSxYpsxtGLeEd77IqthSCQ1o/g83XKCGf+tCWjg1Js FnNTm76qFWf0uZq++koSCYgRBRg1hYmST4DtG7+RpyC9vcd3sIumWxdKaXUuUDeJqFlT tf3LK/KCDGKj6PYmAmIj4CWW/VRsTKXAcAhwEwXdeQ6hYe2v3Ye0HMXcb+tQfgcbu5cU AQTA== X-Gm-Message-State: APjAAAX7UnhMswviByR7R1Dw1QPrdxoUrmeuVEnarRu/FWEwVZK7N3+6 VC6KWIPaGYMbG0ue1GZ5tg== X-Received: by 2002:a17:90a:c389:: with SMTP id h9mr253929pjt.128.1580147913366; Mon, 27 Jan 2020 09:58:33 -0800 (PST) Received: from localhost.localdomain ([2402:3a80:1ee2:faa0:c576:b7c8:dab8:85b]) by smtp.gmail.com with ESMTPSA id q25sm16482430pfg.41.2020.01.27.09.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 09:58:32 -0800 (PST) From: madhuparnabhowmik10@gmail.com To: oleg@redhat.com, christian.brauner@ubuntu.com, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, paulmck@kernel.org, joel@joelfernandes.org, frextrite@gmail.com, rcu@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Madhuparna Bhowmik Subject: [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer() Date: Mon, 27 Jan 2020 23:28:21 +0530 Message-Id: <20200127175821.10833-1-madhuparnabhowmik10@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Madhuparna Bhowmik Use RCU_INIT_POINTER() instead of rcu_access_pointer() in copy_sighand(). Suggested-by: Oleg Nesterov Signed-off-by: Madhuparna Bhowmik --- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/fork.c b/kernel/fork.c index 2508a4f238a3..42b71d4a50cb 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk) return 0; } sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL); - rcu_assign_pointer(tsk->sighand, sig); + RCU_INIT_POINTER(tsk->sighand, sig); if (!sig) return -ENOMEM; -- 2.17.1