Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp366090pxa; Tue, 4 Aug 2020 07:30:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXZAnjQw64boB81cZvF8G5A2zIVFmKcHxxVa+H4KTKPf4VyZo/DRhbRXaT9myxjPnNRdGI X-Received: by 2002:aa7:c544:: with SMTP id s4mr577077edr.51.1596551450414; Tue, 04 Aug 2020 07:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596551450; cv=none; d=google.com; s=arc-20160816; b=PH+3vEl968bMGbpM0lMlvVkr0DzEXaEC8LGw7l/XE0zpjE2wUed0GUc/4hta6P4Xdz +yhumBv3v+WHndjchpJ+oFYK4fh7z+3ddkBIMnsLhWC3bt6I4y+BLYN5zlrjTYWFTTYZ LE2/LgCmcjGGyFgIetJxScttWUOarKxbS51wGTglxjqmvmzeID4lDMdf/+v6Wu+taqEL e/5RvOXe4t0RmrS2Kz2X0WRzGTbuZx+kz4YML0+rp+Oqfe75xECbqlxjQi3rar3uqHYY jxBj7Yq+PnerbP0Uf1GVnT24anyILTWMypKGmYM0WlmToc6juulYzXKkoFISG4s/bAxH 7NtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from; bh=0pCPuDPmMsFXL7qIO/ATZbdCWuANn7jPHKotkWjMQCI=; b=QPGX/hZRnGhdnHUJmi074c/MFiugM6wqwqY/xfziBz4Zk/GdJ8sRgqJXLS5riNWlUx XE51fGyUZn42vNQpfpG4ewhJY1r+qqoJ2kqfp9HvFltUWpzvMg2vj9Nrs0fmc1nMs1Ne JdvJYLXQh0f7XMhPbAQ8VfAuIJcX921c6jEl2ZJWmIsAZSTwyOd2y7Cfm/+YE1iCVRqj lI0gZpvtclp0mFFUxoxBQnzljv8tM8PcdAtZTBn7E199JwQG0rUEU5xYqLW41s+6W9lC Uc5YU6zglQjaO83/RaTHJ492/qxqZYIyAyvFNERZboxROn5DNxgCzGYT5TpvCUUMzhD4 hrZA== 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 dm21si7625793edb.602.2020.08.04.07.30.13; Tue, 04 Aug 2020 07:30:50 -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 S1729204AbgHDO1G (ORCPT + 99 others); Tue, 4 Aug 2020 10:27:06 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:33090 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728909AbgHDO1B (ORCPT ); Tue, 4 Aug 2020 10:27:01 -0400 Received: from localhost (unknown [IPv6:2610:98:8005::7c0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: krisman) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 90031298801; Tue, 4 Aug 2020 15:26:59 +0100 (BST) From: Gabriel Krisman Bertazi To: Pavel Machek Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, kernel@collabora.com, willy@infradead.org, luto@kernel.org, gofmanp@gmail.com, keescook@chromium.org, linux-kselftest@vger.kernel.org, shuah@kernel.org Subject: Re: [PATCH v4 0/2] Syscall User Redirection Organization: Collabora References: <20200716193141.4068476-1-krisman@collabora.com> <20200802120115.GC1289@bug> Date: Tue, 04 Aug 2020 10:26:56 -0400 In-Reply-To: <20200802120115.GC1289@bug> (Pavel Machek's message of "Sun, 2 Aug 2020 14:01:15 +0200") Message-ID: <87h7tiebbj.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pavel Machek writes: > Hi! > >> This is v4 of Syscall User Redirection. The implementation itself is >> not modified from v3, it only applies the latest round of reviews to the >> selftests. >> >> __NR_syscalls is not really exported in header files other than >> asm-generic for every architecture, so it felt safer to optionally >> expose it with a fallback to a high value. >> >> Also, I didn't expose tests for PR_GET as that is not currently >> implemented. If possible, I'd have it supported by a future patchset, >> since it is not immediately necessary to support this feature. >> >> Finally, one question: Which tree would this go through? > > Should it come with Documentation? Hi, Thanks for the review. I will prepare it for the next iteration. > How does it interact with ptrace, seccomp and similar? That is a very good question. Regarding seccomp, this must take precedence, since the use case is emulation (it can be invoked with a different ABI) such that seccomp filtering by syscall number doesn't make sense in the first place. In addition, either the syscall is dispatched back to userspace, in which case there is no resource for seccomp to protect, or the syscall will be executed, and seccomp will execute next. Regarding ptrace, I experimented with before and after, and while the same ABI argument applies, I felt it was easier to debug if I let ptrace happen for syscalls that are dispatched back to userspace. In addition, doing it after ptrace makes the code in syscall_exit_work slightly simpler, since it doesn't require special handling for this feature. For PTRACE_SYSEMU in particular, either placing this before or after is a bit odd. I don't think there is a right answer for this one, but I don't see anyone wanting to use these features at the same time. I think as long as it is documented behavior, it should be fine either way. -- Gabriel Krisman Bertazi