Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp567670ybz; Fri, 24 Apr 2020 05:34:56 -0700 (PDT) X-Google-Smtp-Source: APiQypKFL1RgMO8YjJK5KOUJZQsoMSnzqfGCAu9IF9s3tm568LuKxvQh8wyiHi+vJBqIdipy0lCg X-Received: by 2002:aa7:cd59:: with SMTP id v25mr6354314edw.135.1587731696826; Fri, 24 Apr 2020 05:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587731696; cv=none; d=google.com; s=arc-20160816; b=ZOyzc+tW31dzNd7+jWwUaYBZzggwmN8loZHMbFNpmdraszbbPiREmjgvXKi3sH0FCZ H/wDLjPR2DN8IlIX5Yvgt9HNHbNC08cdwf6VUknJ3RmJQi2Zk1wYJ0t4UP/zq+3T6tuR cw+d2Y4TuwaFHigQcUPcpqfVcsNF7PGcVna6ly7VquH8VqnWcvWoWB1k5+90EBlBvDlF RH5uTh0nzKCXmXyYDLrR8o3YGBbACweElmQiU9sxgxKyOr1fzEfFa7dTUbcb/dBAGOTc L6Ih2t2kt+29Ntgb6XsqT1GitWf9IWPxuvQ8qaRO04Kc3Wg925cxtmSNPeNaCP69p2S0 IHNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VwGYt4aQkbnApjhXbhNDI/oJg5zM8nqEX9E9nOojbrw=; b=WIGcLOO9ijc3Wfspy4xQzKtcCyi7oOD1C4VEusFYtCtJh5xJL6/wp/Sf8YNJY7ODaN SJLjOuWhCWAP3P2RL0JMbx/NmcV7qybCLoDtEeXTQSq3OP7E+GZcM7HZ5rNIGzeHumfX W33iKuGtw7MdPw+dbMF1Khp/79QSqNMTL+1238dAiihU2rznd1wHKfxsWsqrjIyuD9SQ y46SrQWSbooJV7zF3+XbYGCkkJkeSCs2qLM5Edz+oRTdu7CreVTCpdA2ztg3qu58Z2qO 6t8KGx3m6ehQmv/hhNqwDPq+509CZSPcaMwk6kCwBkfKnQDIb96IquRPlFbDZMbgiEuw LNig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="BhKe/5yr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s27si2887804eja.411.2020.04.24.05.34.33; Fri, 24 Apr 2020 05:34:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="BhKe/5yr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728508AbgDXMdH (ORCPT + 99 others); Fri, 24 Apr 2020 08:33:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:51860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726667AbgDXMWm (ORCPT ); Fri, 24 Apr 2020 08:22:42 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BADDA21473; Fri, 24 Apr 2020 12:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587730962; bh=r+58TxfbjRQyFo/V85lt/JewdVBQUjmHSiSk+/05HgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BhKe/5yr6A7/7f2lLwqAGaiFSysKwQqm4h2woVPSYE+Ktnj3z0+zPPteMzCPm++yS ht2oQf4zHEv3+Cs/rXLLdJ4U+ocNUKocROFgsCM64dRcbS3MmslfOzQKmQEp2bEd7N lH6Ap94w73zZj7E2A9zGBzj9GYHRoZG+Fxp5h3QQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zhiqiang Liu , Christian Brauner , Sasha Levin Subject: [PATCH AUTOSEL 5.6 04/38] signal: check sig before setting info in kill_pid_usb_asyncio Date: Fri, 24 Apr 2020 08:22:02 -0400 Message-Id: <20200424122237.9831-4-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424122237.9831-1-sashal@kernel.org> References: <20200424122237.9831-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhiqiang Liu [ Upstream commit eaec2b0bd30690575c581eebffae64bfb7f684ac ] In kill_pid_usb_asyncio, if signal is not valid, we do not need to set info struct. Signed-off-by: Zhiqiang Liu Acked-by: Christian Brauner Link: https://lore.kernel.org/r/f525fd08-1cf7-fb09-d20c-4359145eb940@huawei.com Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin --- kernel/signal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index e58a6c619824f..3f94894d1253d 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1510,15 +1510,15 @@ int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, unsigned long flags; int ret = -EINVAL; + if (!valid_signal(sig)) + return ret; + clear_siginfo(&info); info.si_signo = sig; info.si_errno = errno; info.si_code = SI_ASYNCIO; *((sigval_t *)&info.si_pid) = addr; - if (!valid_signal(sig)) - return ret; - rcu_read_lock(); p = pid_task(pid, PIDTYPE_PID); if (!p) { -- 2.20.1