Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp514632ybv; Wed, 5 Feb 2020 09:27:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzDL9z8W/BZgF6bQihf2blBxcRotzykL9HdEhIFOu0H5EXrglFbKgRaSiPL0N5ofozbwFkz X-Received: by 2002:a05:6830:18ec:: with SMTP id d12mr21551922otf.152.1580923652389; Wed, 05 Feb 2020 09:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580923652; cv=none; d=google.com; s=arc-20160816; b=nx0IWKBHqHjtDq0wBLyRVzfMnpaRitBwTQy0SrJp8pGlWbtt9Ld+5oag05DUPWWO+w eYJw0YtTf6YV1KykllZIglr3qsWZ1+GkKI2z7WZfiIhNzBFxcxNucoKJJ+TAhZ/Zo/xj 6yeaBj0uVn7wongdGSgs/2V9EWdzpquEjFMDNkSpDBwp7rLveQV37GAjfU0iLb2Sl++D RYUcl7U1FyOMaXPuNIbeE6Ua0IdzsraGCDbRVfkgGmnWAXDFwojsTp7XoS255KHQDMHv ABGViJR0T89f+olUxoL/mXOY83bxT7fiZ/E8hauWHB0kRqpmAsMSv3142wmn9MIgXnK3 3y2Q== 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=O6f8gSgy3dUNcsUeRgZv0meSXKvjWlJqGpm0K3VBOCs=; b=GjNzU7NvBQtnCm/MsMsoBrGY9GYbT2VgujgPqC8bkbrlKjeVi94VPBOHD/BmprZvpq vKiSP5zAZ0dLqtk4cNHRIJV5obdYLROCf70rBzERNsM5CCg3oz/ADw3LYiy5KxIJK+8/ PLNMpuIrSzXPGAnAKde4xw+6+R7R6FBwnYVux7A82dzgc6Op1lhY2sj+FRyO8xDrdAIR 7va0O2wCUbRufF7JkS2L3nRGBjb4+V16o5jC2zJi+3oR0nNKUs1UanKeHzDC0H6jcftt NX/2ytKDiqsoNhD022WUml+2FkLCyj/Sj+rqtfW+e8s2wvxhmVvMD8n5rCf+J0Tg5E9o 1dtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pqmHy6Fl; 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 x84si429182oia.27.2020.02.05.09.27.20; Wed, 05 Feb 2020 09:27:32 -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=pqmHy6Fl; 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 S1727518AbgBERYs (ORCPT + 99 others); Wed, 5 Feb 2020 12:24:48 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:52664 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727305AbgBERYs (ORCPT ); Wed, 5 Feb 2020 12:24:48 -0500 Received: by mail-pj1-f65.google.com with SMTP id ep11so1256848pjb.2 for ; Wed, 05 Feb 2020 09:24:47 -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=O6f8gSgy3dUNcsUeRgZv0meSXKvjWlJqGpm0K3VBOCs=; b=pqmHy6FlDFSnQTIoMyzxnCIO3vTFZBIJD8KS7Z+9fLKfInJEp4+siGb96YZdi2U/vq gpiTIcphcC5tJSNHywZtP46vitKr8JYlaNWJ+5mLDRVSs8rPMPp9HCd80OUajqkZjXoU tpz6igUy92z8T7nMp/mMC+LvlqhQH0pIdYrctucWZBrqgxUWcyRGfj+3oNNyjIA6Nwrn 6Q6NM6A53DtEBINqLyR/FdVA0ub5Hvb8ArLEu98csLwjFBC0Fvy3goCT4AMlAMRfBstr viyAPXhdj3bu2kYouTvGwfut6IFdzzoUMjNl6YfyBeMOR7MWyCmHTHNyUWXScbQ9f8Sq 0RnQ== 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=O6f8gSgy3dUNcsUeRgZv0meSXKvjWlJqGpm0K3VBOCs=; b=WgfdX4LlQ2tZ+hjlheJcof46MbGxIQ63ZeczVAnh3roNq+sJyznrADwBWBIFLkx1l7 QN7uCUi7XB+wYZbSXQigHc17iCAOGFgSm8lMZ3R7mhFD+/y11LBcXuDQVzlrkjOXu3u+ ooKqAiTIzD9soCwtu8x5YZeg3tf5uHJyr8kjCbtFdkcOEbY45CavRHGijRhMNdl52c8z 8hUzQbmtHkPxpO4Bqe4VKlapucjqrkl587WGpN0D2x71b5jIaWFzRcee2uDNwCgBqL9Y iQ3NltUkObtZ0YtcjP4dQgge2LABzxUK2LUAyY0YP6LJkWVAWo/KSS1YXMSWXfmSSEqG 8YyA== X-Gm-Message-State: APjAAAXjtdBQfTn5X4A3whG9l1k8t8y216EOlxDv8mNyeDaf3WVx5arv Gg0OHc5edXRwKyw3WQg//w== X-Received: by 2002:a17:90a:7303:: with SMTP id m3mr6915519pjk.62.1580923486794; Wed, 05 Feb 2020 09:24:46 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:542:9945:9d58:40ca:c55a:7c02]) by smtp.gmail.com with ESMTPSA id w11sm106767pfn.4.2020.02.05.09.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 09:24:46 -0800 (PST) From: madhuparnabhowmik10@gmail.com To: ebiederm@xmission.com, oleg@redhat.com, christian.brauner@ubuntu.com, guro@fb.com, tj@kernel.org Cc: linux-kernel@vger.kernel.org, paulmck@kernel.org, joel@joelfernandes.org, linux-kernel-mentees@lists.linuxfoundation.org, frextrite@gmail.com, Madhuparna Bhowmik Subject: [PATCH] signal.c: Fix sparse warnings Date: Wed, 5 Feb 2020 22:54:37 +0530 Message-Id: <20200205172437.10113-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 This patch fixes the following two sparse warnings caused due to accessing RCU protected pointer tsk->parent without rcu primitives. kernel/signal.c:1948:65: warning: incorrect type in argument 1 (different address spaces) kernel/signal.c:1948:65: expected struct task_struct *tsk kernel/signal.c:1948:65: got struct task_struct [noderef] *parent kernel/signal.c:1949:40: warning: incorrect type in argument 1 (different address spaces) kernel/signal.c:1949:40: expected void const volatile *p kernel/signal.c:1949:40: got struct cred const [noderef] *[noderef] * kernel/signal.c:1949:40: warning: incorrect type in argument 1 (different address spaces) kernel/signal.c:1949:40: expected void const volatile *p kernel/signal.c:1949:40: got struct cred const [noderef] *[noderef] * Signed-off-by: Madhuparna Bhowmik --- kernel/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index 9ad8dea93dbb..8227058ea8c4 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1945,8 +1945,8 @@ bool do_notify_parent(struct task_struct *tsk, int sig) * correct to rely on this */ rcu_read_lock(); - info.si_pid = task_pid_nr_ns(tsk, task_active_pid_ns(tsk->parent)); - info.si_uid = from_kuid_munged(task_cred_xxx(tsk->parent, user_ns), + info.si_pid = task_pid_nr_ns(tsk, task_active_pid_ns(rcu_dereference(tsk->parent))); + info.si_uid = from_kuid_munged(task_cred_xxx(rcu_dereference(tsk->parent), user_ns), task_uid(tsk)); rcu_read_unlock(); -- 2.17.1