Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9987020ybi; Wed, 24 Jul 2019 13:36:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrzTG/rlQTFMIL7Gzw9LHnB6GEVeN+XTokJ9utGMplzdS1tgUfFAaFOzqosdvBD6SQbpXX X-Received: by 2002:a17:902:8490:: with SMTP id c16mr89324074plo.1.1564000584875; Wed, 24 Jul 2019 13:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000584; cv=none; d=google.com; s=arc-20160816; b=pj5p4JWJNYclFIfth1C/YkYbz1IOKeIobrOfqHf6Q7mR6kxC54X7Hs7eifjPNfg+cp M9NhYCOilT5l/+57P6CdStwlxukeJ/Uu9RejJ3fLDDOY8xvNOqUmTexA3GBE0PO4w1Ip gYZz5+QCMSpWiPQwKp9Av2E2XU+EBdxaqhYbJtjMqr7TKimgrOrheXBI8P7zDL69ycfF 9QMMN1Tnca9sttJIH7Kn6wcYEcC/VotU8vnf8+QqBa19FWyc4qhuTdzoENsg0H61G9RC D3UCewKbHnXGZq50c2MMsMbNfNiSUMv6hqi9lrz5VOLP0dCs+UENW6VuJOi3YJsY6k2R xvGA== 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=6jOYHRptgx1w/IOQRKfjETtBjRSrhfLe3fzDOxhPgcI=; b=gAwn0tm4E4ESSYGdnue+a16Q8iyZT6cS4CcACXKbmXW/FcShS5a6Uo/QGAY4ERkGwl bJRz+0NuRm90S028od7cp61B0wp9LGCgmdAUd33KIznk4QuSUomlTVFTDRsJfXNksMFI PC6dL1F70OTzn7rsSF0t3TrOpfqi83nnCkcLT7HTVs0u4L4JedKvRiootpmU141yBjst KZWHKt666YiMs6HaLmuHlKGhGSBC9MyQrotzL0d95BKi5j6kKwLrv5YJzSZTxAQSOyjo wpvPdxnhVUKoWdatWlY3emv/djhVFIgLvWUowEvCRPue5tsCJFw1ODr+vtDH4sAVCj2J 0idw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ra8zpzPK; 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 l67si15166484plb.370.2019.07.24.13.36.10; Wed, 24 Jul 2019 13:36:24 -0700 (PDT) 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=ra8zpzPK; 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 S1726769AbfGXT0i (ORCPT + 99 others); Wed, 24 Jul 2019 15:26:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:43564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728452AbfGXT01 (ORCPT ); Wed, 24 Jul 2019 15:26:27 -0400 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 827DA20659; Wed, 24 Jul 2019 19:26:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996387; bh=CURt+DNmqAriFInCae09vldP6AQePfsWc1X55YjCn6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ra8zpzPKHu9IeoJS+ErcyPEEgYCoMO7MHnw5vx2vRemYHZYWq1v9sr2k6jnwXUaAt YWuJBZyzyOfMMcEc2IodAqvogHgdmQjwVucOfopcKPNYbDfLlIrukH3XseSX8zNbQk zdrAwReuFnYC/MmBG+QoewIZsvTw/womk5Od54zs= 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 5.2 038/413] signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig Date: Wed, 24 Jul 2019 21:15:29 +0200 Message-Id: <20190724191738.345725184@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 [ 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 8dd6637a3cbb..714a359c7c8d 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2631,7 +2631,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