Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp833532pxv; Thu, 1 Jul 2021 10:13:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIQMiK64X2dqtXvXW3k4AMab2m18fSEJOLsGoRJ1MRlk5LkD/zBMFrYldliWDC4WwoPg7x X-Received: by 2002:a50:85cc:: with SMTP id q12mr1199348edh.182.1625159611227; Thu, 01 Jul 2021 10:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625159611; cv=none; d=google.com; s=arc-20160816; b=V6S8Btg0JRQG77XBXVjZ1phUTsJacvAt7J+bqbgH3Aslocd0Fy3nrO61/b1FJ3Yl7I RWAK8om2u7YqIFswEmqHm3oc1BVZDtUmXnvnNqM06HcXFLgIvkXCk1lmTf0v7IVk6pxg oG5UtWlnjttL5P8cTOqRh4Wax1Mp4i0Fgr/smewKeTDlgTciEQaeLfCzfJTnjyCU+e6e 6xyFcXHqA9L74tX+g8JubjXdCaRWpfnp1cWT3Zm9mv4yiM9wbqD/N2f8YHypft0RXw62 b8kXkPbyEqZwMPZxkVzYigPpKQlN8t5vU3UODbrMsr8KWokQAvkwdy/Xl04e2X0Ho5Wa IPNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=Sl4RZsmb7RwsCLgKF2mzOPDt4/hlkZ0YS+ek17pp5Lw=; b=vxgvmGBlvLXK7ipAYeWvlXWda7NNRzhYQ+72hCCEzgbkCs+C95GROpzOG0D0mZlGtq nX0IQpc5UJV69VZlR9m6O/XScUuiG9BB2xWrmiae+B/evzfX1uxWmSjmxSGaukDmiLjs yRHE7VXrcuZDgt0hkKLJHB/MklzJk5lxls28MSYqfreCPUYyirC+gIi5kOq5B0JMcFjN wdGnxb6x/5/xy1KkJmWqJz0gJEAb+NMiGhH8Z6mc+veEV9oruIoRvaba6vRGJoTgECb3 TQclweRh9uIApbChwNDRk1qp7gNpH0Ld4j3h9RBIqF7pNcVvigN27aZPVJmil/XDPbXw XTeQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id os28si518885ejb.357.2021.07.01.10.13.07; Thu, 01 Jul 2021 10:13:31 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232081AbhGARMA (ORCPT + 99 others); Thu, 1 Jul 2021 13:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbhGARMA (ORCPT ); Thu, 1 Jul 2021 13:12:00 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67F8BC061762; Thu, 1 Jul 2021 10:09:29 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 32F041F445DA From: Gabriel Krisman Bertazi To: ebiederm@xmission.com (Eric W. Biederman) Cc: luto@kernel.org, tglx@linutronix.de, keescook@chromium.org, gofmanp@gmail.com, christian.brauner@ubuntu.com, peterz@infradead.org, willy@infradead.org, shuah@kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-kselftest@vger.kernel.org, x86@kernel.org, kernel@collabora.com Subject: Re: [PATCH v8 3/7] kernel: Implement selective syscall userspace redirection Organization: Collabora References: <20201127193238.821364-1-krisman@collabora.com> <20201127193238.821364-4-krisman@collabora.com> <8735szowmu.fsf@disp2133> Date: Thu, 01 Jul 2021 13:09:21 -0400 In-Reply-To: <8735szowmu.fsf@disp2133> (Eric W. Biederman's message of "Wed, 30 Jun 2021 16:44:41 -0500") Message-ID: <87mtr6gdvi.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ebiederm@xmission.com (Eric W. Biederman) writes: > Why does do_syscal_user_dispatch call do_exit(SIGSEGV) and > do_exit(SIGSYS) instead of force_sig(SIGSEGV) and force_sig(SIGSYS)? > > Looking at the code these cases are not expected to happen, so I would > be surprised if userspace depends on any particular behaviour on the > failure path so I think we can change this. Hi Eric, There is not really a good reason, and the use case that originated the feature doesn't rely on it. Unless I'm missing yet another problem and others correct me, I think it makes sense to change it as you described. > Is using do_exit in this way something you copied from seccomp? I'm not sure, its been a while, but I think it might be just that. The first prototype of SUD was implemented as a seccomp mode. > The reason I am asking is that by using do_exit you deprive userspace > of the change to catch the signal handler and try and fix things. > > Also by using do_exit only a single thread of a multi-thread application > is terminated which seems wrong. > > I am asking because I am going through the callers of do_exit so I can > refactor things and clean things up and this use just looks wrong. Thanks, -- Gabriel Krisman Bertazi