Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp482743ybl; Tue, 28 Jan 2020 06:39:15 -0800 (PST) X-Google-Smtp-Source: APXvYqwoq6BJHx3mpACYUCMr/5mrHfijx4o4U3EnkbZhWX3bALpdtFJyGSTErCnQSP909dNZrSg2 X-Received: by 2002:aca:4f8e:: with SMTP id d136mr2915155oib.61.1580222355000; Tue, 28 Jan 2020 06:39:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222354; cv=none; d=google.com; s=arc-20160816; b=D9q0eAMOPJSW3yq6cc0YDva3LEWNVMGxC80sCkHv8CgkWV/328RUvMxkRo002CNEW4 vEr1Tuacw9nSSOy0ApDwwB4CygGxdyiQ4SSXHV+5W3fKSSaqN6NaPlwYcAh5OSoObjIB 6xqGhCdFhXsSnkPX+dfI7+BmQuBYwjq2zBZJEizKvhajihQbO0k7e7kcGgeMRo4sSOK4 uuuNfYyiKh+KosZoYsMYyxXRYSpkJhpnBjYTxjWIpM7W+UiSm6gHO0xUV8VgouI5nYFP dDipZksOYUPhmOxIAfr8/oJ/gI8zix1hI3C66XdkiNla75bZBLRa7ifcQT/a1GG/OT6t WK5A== 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=uR25WQdyiVpHwB6Olhrwy594IL4L0tBMFXxupQOdc8k=; b=mxBM0gde35d8KsyEUNfI4SzsjX+z1EudOmmPS8Tu+zHqrtxtOZ+GLp2PuO/5elPuHF 1xgS8TrqlkIeGGDp24TJnbnI0F+YuWkwPz0/cw0nUN74Iy7SfADomymm8BCmljdo/uSH AUGNgF2GMCImT8/yR/NGtrFq87mg0wK8qunvwng+jet05E6D9IbFkjvMsq6/+iv0eqFz +rwiPYbg9ny02PbNfS7QIrZdWm0XnwlNOP3V7Ajkiqf1Rk5nW5Ep9JI1on4KI+7A3OJv wz0m3WtntPJb1voXgaeVzFGsiZCmPLGgFB6TOAcYMoVnAHfrdSnqdaIIcGCNIusKKy1X XSwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IYp9rjws; 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 u18si5333027oif.66.2020.01.28.06.39.03; Tue, 28 Jan 2020 06:39:14 -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=IYp9rjws; 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 S1730813AbgA1OgR (ORCPT + 99 others); Tue, 28 Jan 2020 09:36:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:47638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730974AbgA1OWB (ORCPT ); Tue, 28 Jan 2020 09:22:01 -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 46EAE24681; Tue, 28 Jan 2020 14:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221320; bh=j9S2qKhSSPN/dmy7/aYyfA0uPKzh15mX4b57tjNIpXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IYp9rjws9d8ml+AXkj6TfIekJoEVejsFuttX880/HnkgZG6yLWB83nDRjKPZT3tJ1 vFZOzXwAmGM1cMaAv7VUqumEbCsgGLbxkeW9UuOG8jYcWgrtnEsVvvg/R/sHFuNdMl tyWFkTc3vigvppmZnqgt84Fyu99e5H+XImFYday8= 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.9 150/271] signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig Date: Tue, 28 Jan 2020 15:04:59 +0100 Message-Id: <20200128135903.724858235@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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 e43ba6db2bdd6..110febd697379 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