From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D2C3C76186 for ; Wed, 24 Jul 2019 20:02:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33BA521880 for ; Wed, 24 Jul 2019 20:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998535; bh=rFF7XLxEoWfRp9DoB9Bl0qmn4VdihdrtYl4R9FnNMSc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Qcb0pTPfIEdA5RlYC/ykGEkAV2+MMPqZKugwvt+tCR7z0tmxN/fiCKIZC0GtxdMoX e3maV9JkyDfouX9uyttWSKYjPQk/kOFgE5qPG0QTCOp3lyt42kJcu38El64K+tyL9q B1XdZh01LW042Wcx3J1467labiRBjvVblOyuaM2M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405465AbfGXUCN (ORCPT ); Wed, 24 Jul 2019 16:02:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:51656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405457AbfGXUCL (ORCPT ); Wed, 24 Jul 2019 16:02:11 -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 75DD62147A; Wed, 24 Jul 2019 20:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998531; bh=rFF7XLxEoWfRp9DoB9Bl0qmn4VdihdrtYl4R9FnNMSc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pNZd83ZoFwGk0HVVh8WgRZfSSBjdKEIAVnUOsbhXW6zHi5RCukkKzWSxCgr+U/PgO N12z0W21hwWShQ7Kh/t8CW25vGE0gB2G0gm3XrJfRnJaNI4qr1u5nZxZPbh8zjRJeR sD9aK1kYa7jKt25tpI7yDUuwLgRc42XEjxVMJJdA= 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.19 026/271] signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig Date: Wed, 24 Jul 2019 21:18:15 +0200 Message-Id: <20190724191657.444120528@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 f31339db45fd..82b3af47bce3 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2428,7 +2428,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