Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8290401ybl; Thu, 16 Jan 2020 14:02:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwnCXcAF9RrVpfL/VhFI5BfPBBqYyb2ISNdwvev86cczlzvNrULOoVgDmKRVqT2fJNzR2ow X-Received: by 2002:aca:d502:: with SMTP id m2mr1009721oig.41.1579212141371; Thu, 16 Jan 2020 14:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579212141; cv=none; d=google.com; s=arc-20160816; b=iA09dLxeJIfmKu3n1LE42fUHYr8J37eiEcTelWWvt4R+c4mvjUAYTaMV40io254/0x ZqBtXAO45cVwCKk2bonqqdshiEbciAQZWaA2+oLrtOi1y4UTT6U7+A7yR7SSvaYfr5ee VLNZlYrooPwIZQx+PfSqPGQFbmPwk5XVGtIoxG+f6wr38Ugwpp6s06URQAkHynbm65uF PUWeVGueVAj1ocrj0yReDJPQA/Unrzf0JLSiFjLAGvZB0K2LuGswcRCyrUKSxovJGKHe gszdkRl7YN9SQyhWm2WsqA+WcdOjcsk5cYpOE0EDTr/SYb/lNOXXDw3YqVhU+Wz5H4zt MmZQ== 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=eNQ5BvOrrEixds4bsrWOPC8exjHXhmBOEHJNlUoviwU=; b=Wx8zkiqrzmw9RdB/CIZpAJR83lO8ZildV3HZrRwZlFdnibOpM4lVtuKipyn3/CtdEY ayyabvwpiDaTrdhf7YKthlYy57zEdQ5qCSqOdmf44S6B7Nvl/MxJ/+1ZfIhXjTGemHG5 6Ka/lCr1YgPJqHeQyFWuio7JftlBX1B3JZLW5rtmuKXxdmkHtfjJSByvPzrb9CfVDmXH Kfayp1Ea+HfxOj05x7w4Dv9Pn9wHxyhpDn87LRO7uDA6PuC9JME9U9s1ylb1M7t3L9dv 1YpFqc7WHQUvbDM1SZw1NbTpuJt6R4lJPO6fEkEsPgkCdvi3CZs5S/CfYh9rW5bodPdT NXAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NTPUtDN3; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si13384392otq.262.2020.01.16.14.02.08; Thu, 16 Jan 2020 14:02:21 -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=@kernel.org header.s=default header.b=NTPUtDN3; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393597AbgAPRkN (ORCPT + 99 others); Thu, 16 Jan 2020 12:40:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:55522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393455AbgAPRjS (ORCPT ); Thu, 16 Jan 2020 12:39:18 -0500 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 7FCF8246D3; Thu, 16 Jan 2020 17:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579196357; bh=9mwGrx6aEgxNRi/HJ+0HH6YChaUmnqQW3NP2bo8ezdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NTPUtDN3ntsnHm0vAwQCMFCH1duUlvPBF/lvgp5LnrbPzr98dKb8yWWLhkktl04Xn uKb0QYhc06M9UGpQU/syMyUWyfaR+HOhC6zkDins2psvMo3wNfBgkjQUlJjBCzOhjy 0JcUmnf8LbfS6oXlma3ZuJb7TWoesEyNql1Cyvnw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Eric W. Biederman" , Namjae Jeon , Jeff Layton , Steve French , Sasha Levin , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH AUTOSEL 4.9 149/251] signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig Date: Thu, 16 Jan 2020 12:34:58 -0500 Message-Id: <20200116173641.22137-109-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116173641.22137-1-sashal@kernel.org> References: <20200116173641.22137-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: "Eric W. Biederman" [ Upstream commit 72abe3bcf0911d69b46c1e8bdb5612675e0ac42c ] The locking in force_sig_info is not prepared to deal with a task that exits or execs (as sighand may change). The is not a locking problem in force_sig as force_sig is only built to handle synchronous exceptions. Further the function force_sig_info changes the signal state if the signal is ignored, or blocked or if SIGNAL_UNKILLABLE will prevent the delivery of the signal. The signal SIGKILL can not be ignored and can not be blocked and SIGNAL_UNKILLABLE won't prevent it from being delivered. So using force_sig rather than send_sig for SIGKILL is confusing and pointless. Because it won't impact the sending of the signal and and because using force_sig is wrong, replace force_sig with send_sig. Cc: Namjae Jeon Cc: Jeff Layton Cc: Steve French Fixes: a5c3e1c725af ("Revert "cifs: No need to send SIGKILL to demux_thread during umount"") Fixes: e7ddee9037e7 ("cifs: disable sharing session and tcon and add new TCP sharing code") Signed-off-by: "Eric W. Biederman" Signed-off-by: Sasha Levin --- fs/cifs/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index e43ba6db2bdd..110febd69737 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2221,7 +2221,7 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect) task = xchg(&server->tsk, NULL); if (task) - force_sig(SIGKILL, task); + send_sig(SIGKILL, task, 1); } static struct TCP_Server_Info * -- 2.20.1