Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3855766pxu; Wed, 9 Dec 2020 02:16:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5sGpihualBHdeUUA9+WH8hn7NGJxHg8pyBX/TQFuWr1ShkAbK4GM6URj/Y6KvU2pyPYLo X-Received: by 2002:a17:906:174f:: with SMTP id d15mr1415581eje.15.1607508985311; Wed, 09 Dec 2020 02:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607508985; cv=none; d=google.com; s=arc-20160816; b=JbDi6YZebIeunDaCR70xXRAtUH1DrwUxecBrVkdoiWg2QAbVFCpmWSvdWZlfrWwXNV hsI2a/2DlH97ekrLO2kk0JE6lucUKUxbQsfdfRggskglzBepoh28PAubLxcTdNewKmFT Pqjw7QrzwHw/1emnyWbo2/K8MjOAC9Ha+79PEP3Ml5pjSGvC2Dkr06mgn2Ox/xWDT01x 1W6EynzP9qzU/QlFXtTZHWHoZ8AWw2o6LWXN2yWtB8ga48x/EjpxmXjKojddxLUmUjyY 9fHp3qGbVddMvfbA04kiYYFcbNc89tjam6YoJpkLghVicNnPj72yf1WeZ11nGknPZmyF 2Arg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lp/BX/zYvTTJSC9VfCvCXfJRULVfbr1TBpetvpV+Cfo=; b=wrmECNbxpumY9/LpZg4PZmrKaD2AVScvVxDlhT4f29W7Wjtukp4sWjBB5hQn55IBy+ Tkeca2B8Xb0SqK5GMoeI8UoHkfr7kmbOvx6TLrtTRZMYejuc61EPJBK+ajEv42O0nTIs 8ZJtjKEz9sFYT3Cb+QS7u/Z3ksiOFoxG8LnlxPgiJTmIzeb5g/jtR3KOkGzLmtIE1A9I v+lJYOvVGsTEdvtE1fN41Rl8G8RQRmADyGIeiMoMXUSh44IcGQ23siWZ0XcrwA8yedPr C4EeVhPFTVtcqycoXd4abbbq6MNu3p12mYRUvNX9QeLvBJDjujtLJLHj8YHZq2Ls9vQr hhGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=CDXncT75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si559545edu.550.2020.12.09.02.16.02; Wed, 09 Dec 2020 02:16:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=CDXncT75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729767AbgLIKMG (ORCPT + 99 others); Wed, 9 Dec 2020 05:12:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:54144 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729628AbgLIKMD (ORCPT ); Wed, 9 Dec 2020 05:12:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1607508676; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=lp/BX/zYvTTJSC9VfCvCXfJRULVfbr1TBpetvpV+Cfo=; b=CDXncT75s8PkuuzKBjWJ+/rdiXZ+WdhzCg1/7T/SWjXNpddihYd5xSJe/k16ukZGzghXAm oQ5wTadzIhPc0MvnfNb9/0We/IXiQU3HkCllxc5/dTlKxjXA97f89OJGtaIHvVw/Sf4Cfm cO4sAMeS2KWjwBa/YpnQ4QkFWy+NO7Y= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AC6CFAC94; Wed, 9 Dec 2020 10:11:16 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH] xen/xenbus: make xs_talkv() interruptible for SIGKILL Date: Wed, 9 Dec 2020 11:11:14 +0100 Message-Id: <20201209101114.31522-1-jgross@suse.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case a process waits for any Xenstore action in the xenbus driver it should be interruptible via SIGKILL. Signed-off-by: Juergen Gross --- drivers/xen/xenbus/xenbus_xs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 3a06eb699f33..1f4d3593e89e 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -205,8 +205,15 @@ static bool test_reply(struct xb_req_data *req) static void *read_reply(struct xb_req_data *req) { + int ret; + do { - wait_event(req->wq, test_reply(req)); + ret = wait_event_interruptible(req->wq, test_reply(req)); + + if (ret == -ERESTARTSYS && fatal_signal_pending(current)) { + req->msg.type = XS_ERROR; + return ERR_PTR(-EINTR); + } if (!xenbus_ok()) /* -- 2.26.2