Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp51839ybh; Sat, 11 Jul 2020 21:46:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4v9KYYIRE8gie3cR76W5O1qxOgr7QvkoxvQG338gqhaPcpYhCTCAS6vBuhDFbWskXyU1k X-Received: by 2002:aa7:d7cf:: with SMTP id e15mr86074281eds.236.1594529191368; Sat, 11 Jul 2020 21:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594529191; cv=none; d=google.com; s=arc-20160816; b=x/xFleaq2H0WtI3eS9Ne9xq4O4mEievImJR/LC8UfSdknM3USAsZeeTXuHEeCFVWUt WRS8DFbuWK+FRkrwtdyxH4+4XKGvLTEm7eaHukKwGNLChOhrp934wpKYw8MJU4K7HVsE m/W+YGDOpNhhzQdn4XBOhEgz8mcSJE0Z6MlcMNfzKowdTXGFAy70cxRYh3f+ALURjKPf s9Bgq2uTMCjLy7sL1lgVOkzvhSqLq+kyZb6SZpZ+lpszysSs8gpHTXdVoKR+0FXacSGI TnJrbCXQ7S6L1yW69uBrPD+7+0VA1Z2UhY4c6m6i7nzwkNu7dYsTYcWIZvv8EsGuoRke nZ+Q== 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 :message-id:date:subject:cc:to:from; bh=qlDaHXIw7zlAhTiiuzv7IEM5LYRbR5qWIpXdo1LbPzQ=; b=ME8DGh0G467YpL/ukxBeqjgRoEdOQko5dH++PIINg0vW+sm1NZMrFoV0ngPrqfLZ6X b/3ZKCoR5LSbNJYT+rZyQxLZ9NLNHMjQGopT97O0PNjnzbEAb0pYLUbHf4/3hqTU8re+ ntXSyQN/8Cy5S/nBpX+Cu8/QT+BsVoK9NzLuxrFu2B1g+vbdybuWvYRz2ogxow959FG9 Qef0caEqw5JCPvbhi6Lak/TlLq5vPhEnZxyEKPXpCEBkjuQhH0gVY8SH2RVKAH2u8890 4OrCQHVAVcA65NIys28joEedPdFlvP3GX1l7FgJOiHEvzTwc9QfPATAmfdXYNBPau1sM ZIDQ== 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 g22si7311266edm.294.2020.07.11.21.46.08; Sat, 11 Jul 2020 21:46: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 S1728298AbgGLEp3 (ORCPT + 99 others); Sun, 12 Jul 2020 00:45:29 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:55404 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbgGLEp2 (ORCPT ); Sun, 12 Jul 2020 00:45:28 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id C7A3527DF85 From: Gabriel Krisman Bertazi To: tglx@linutronix.de Cc: 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, Gabriel Krisman Bertazi Subject: [PATCH v3 0/2] Syscall user redirection Date: Sun, 12 Jul 2020 00:45:14 -0400 Message-Id: <20200712044516.2347844-1-krisman@collabora.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This is the v3 of the syscall user redirection patch, applying the suggestions from Matthew and Kees. In particular, it modifies the ABI to allow passing a range of allowed addresses and introduces kselftests for the feature. RFC/v1: https://lkml.org/lkml/2020/7/8/96 v2: https://lkml.org/lkml/2020/7/9/17 Gabriel Krisman Bertazi (2): kernel: Implement selective syscall userspace redirection selftests: Add kselftest for syscall user dispatch arch/Kconfig | 20 ++ arch/x86/Kconfig | 1 + arch/x86/entry/common.c | 5 + arch/x86/include/asm/thread_info.h | 4 +- arch/x86/kernel/signal_compat.c | 2 +- fs/exec.c | 2 + include/linux/sched.h | 3 + include/linux/syscall_user_dispatch.h | 50 ++++ include/uapi/asm-generic/siginfo.h | 3 +- include/uapi/linux/prctl.h | 5 + kernel/Makefile | 1 + kernel/fork.c | 1 + kernel/sys.c | 5 + kernel/syscall_user_dispatch.c | 92 +++++++ tools/testing/selftests/Makefile | 1 + .../syscall_user_dispatch/.gitignore | 1 + .../selftests/syscall_user_dispatch/Makefile | 5 + .../selftests/syscall_user_dispatch/config | 1 + .../syscall_user_dispatch.c | 259 ++++++++++++++++++ 19 files changed, 458 insertions(+), 3 deletions(-) create mode 100644 include/linux/syscall_user_dispatch.h create mode 100644 kernel/syscall_user_dispatch.c create mode 100644 tools/testing/selftests/syscall_user_dispatch/.gitignore create mode 100644 tools/testing/selftests/syscall_user_dispatch/Makefile create mode 100644 tools/testing/selftests/syscall_user_dispatch/config create mode 100644 tools/testing/selftests/syscall_user_dispatch/syscall_user_dispatch.c -- 2.27.0