Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp490972ybl; Tue, 28 Jan 2020 06:47:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxZem3vXzlnN2VYHUQIlYyS/RwxjUyicYMVp5VwqMy06Pc/G00HWu9SCtx62OvxpNA7rwnW X-Received: by 2002:a05:6830:1e2b:: with SMTP id t11mr17303668otr.81.1580222844573; Tue, 28 Jan 2020 06:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222844; cv=none; d=google.com; s=arc-20160816; b=GvVqtl5amh2AHAi/6+xmputIzL0mb1JQaw/4Fc2cMJlElRDfvXn9qRlgYalvzh+zyZ N9eyBEuK+ZthqswFMDhXWrkH8IMafA6il1ld/n+bxIFoFxVXmWSDQ8kwYYT7TQVKyCm1 kSIt0al8ORHQOul0jBrpMnx+RfGRvd5gU99V34zW4tMECUT/38rYhsV4Vp0MWGcpCNVa Bchkg4jFSIYkhHK0hb4xxvCd1VahkS4f1rweXtNVktS6/qu2DOs5S9i4B0Jse2gRHgMz 7bb6Yn93AUbv35qkI5VZlp344tnuRzVscSFw2h757to0SmCv9gjB3zTe2+LzXoPou6oV bQYw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CK7YRkbv5lAnffo+sSKfAInXyk4rzbr7XLho+k/Uk68=; b=g1weIrW65cYqMchFT/BMun8phbtjOi/S3QPnitU/8kmLFvFf7AeBiaFjMjhaw/n3Ka I2MjbgJJko9RIhXrV4Glijntorfs4sAQivAadBGq+pP0h4xGbEkLQddR8dgQUivzjQBG 3at7Xx1UKUnop3TEqB4hpCCRPSDFpe1UTEnJ0PWVJVR1mxmqXHxAkC5mOGKypwuja5O/ dnKxz1qzCOH05ducrEJ6a+Ey26WeQ102a0H5hGm9uZkvRyEc8wvk1zfVLBGE9E74zqh1 57vsOGqmVjTO5BhholtjRH3g8p9LZf7BP4mTBmtKb9DkxlikcjnsxPx49+s8FsRvPDIN ImEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J4CIeOYL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d26si1125188otc.6.2020.01.28.06.47.12; Tue, 28 Jan 2020 06:47:24 -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=J4CIeOYL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728279AbgA1OLK (ORCPT + 99 others); Tue, 28 Jan 2020 09:11:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:60190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727209AbgA1OLH (ORCPT ); Tue, 28 Jan 2020 09:11:07 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 71F5224685; Tue, 28 Jan 2020 14:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220666; bh=PnT+a4d/aKzbMVQyBqlysgV2ccLUscDE6NdCsVM8Paw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J4CIeOYL2jI+e0dMvpFDbDaZpE4cl7v9skLokaUxjtMZqA8H7KqwFiueOYRggdwHY fVc813mcAEooyNRncHb4VCwnBTdMBi0bWO4yltWWYMrszoWBqlzPCx4/hadSdbsKxP 4ypD7+PYk9Fukqp6ObFXXMrNJdhz2bpeu+IOnnlY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Namjae Jeon , Jeff Layton , Steve French , "Eric W. Biederman" , Sasha Levin Subject: [PATCH 4.4 098/183] signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig Date: Tue, 28 Jan 2020 15:05:17 +0100 Message-Id: <20200128135839.851494074@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135829.486060649@linuxfoundation.org> References: <20200128135829.486060649@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 63108343124af..b608ce741444f 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2246,7 +2246,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