From nobody Fri Jun 17 19:38:32 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9ECED85B3F9; Fri, 17 Jun 2022 19:38:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPq8n2xcFz3QMY; Fri, 17 Jun 2022 19:38:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C3ryI7DwnTXrVUJlIQGo9jQdkUfiGiPIKgCt2/wFKDc=; b=xJl8jWXr9WNoPUI0MfwHghu4U+OOZT41pjRbZoSgxPmV+cSza89xnFcgXSAhBZzbCISCL3 dnw9uAO4Q/O7KMcPZrh1lqksEHkDB6GyVPkvM5rnUXA4PJf71qs0HNkeOvDL9X3bnAIm4k KDAIRRz3bLOMzWVUlz3od4Z87/zCpBE4pwJfcUVbwFdL3KxUPNToGYY+423ZvSCAwsz4u3 fba+F+doZnjR0p1Kdzx/s+VOa6rwVPsO1jv/i7LCSNtLZhFy3VyXc+N7pi1cjYiaA+vLpU LykvzViDISLIiHTTbAzp5buUnfafw8fdyFyrJ1VAUdxDL4GNEthsN7lnwh6z/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6FBD25C49; Fri, 17 Jun 2022 19:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJcW5R014827; Fri, 17 Jun 2022 19:38:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJcWD7014826; Fri, 17 Jun 2022 19:38:32 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:38:32 GMT Message-Id: <202206171938.25HJcWD7014826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: d005a6f2c808 - stable/13 - linux: Provide dummy seccomp(2) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d005a6f2c8082fc4065a79f2890a564464186b5a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C3ryI7DwnTXrVUJlIQGo9jQdkUfiGiPIKgCt2/wFKDc=; b=PYlNb4ytMquiYYVjCdHH7gd6Al8TCo6uZCHyNWDDW/GT18me2vtlGvD1WqaWnRD2896YW1 gaD7g2F+46PBKTOKCdioM0FzgFQ37yISmz0itVtZBOX1MrBIOLNemT8ABm8/dNwQlmIZaA e9+xOriCZJZT3Js/WCdGNjUTscrwIF5pZxTw7SaNkr0QZx1mzLqcrBPfssczubBKQf0035 7t0GCYdMWoHLwKO0ENPGsXY2cAROfzqlHUW8vTs6YlfNXCD91TXqYpdz1YGyY2Gdy35kv0 8KVVAWXJiRPmsqm4lP6Pf23SgE79+V/YeKyvmbQN4/96NtUePUn++yKmQ+o+wA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494716; a=rsa-sha256; cv=none; b=LW+kw/JsNa41MnmHphS3Mj1Yk6XXclOIhWkbPgw3XmbGhRx/vpqc1Ii9y2OWIlRrc6BioX 5A/k+9++2XKgLMis/CfCgiWqc0aHhI+eYBvjFWvO/2fvWdRjiUU82c3Yyv7r8v1D6GFhie ls+I2+WOLvPPRB21O4L/dl8P07ZD7U62LJg/XG98bubeaPczRqFMU3t8/1t90sEO1H0xr2 5g8dilntngCJt6Lt4s/Sb99o14xIxsLyh7OS//LKMKjdxUUK+VkdXDTM5/bRvpptrjbP8w ayPAuxUuTBWKctOAlD8MrXcFXnW328wPaXLmUUBnHflrmsrusiE1MzuiPzK99w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d005a6f2c8082fc4065a79f2890a564464186b5a commit d005a6f2c8082fc4065a79f2890a564464186b5a Author: Edward Tomasz Napierala AuthorDate: 2022-01-28 10:55:11 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:40 +0000 linux: Provide dummy seccomp(2) Don't emit messages; this isn't any different from a Linux kernel built without OPTIONS_SECCOMP, so the userspace already needs to know how to deal with it. This is also similar with how we handle seccomp in linux_prctl(). Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D33808 (cherry picked from commit 99454d3e98ff205881aa7abef39234c9afc7600c) --- sys/compat/linux/linux_dummy.c | 2 -- sys/compat/linux/linux_misc.c | 16 ++++++++++++++++ sys/compat/linux/linux_misc.h | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index 91a56616fc10..e254bf94c026 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -112,8 +112,6 @@ DUMMY(kcmp); DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* Linux 3.17: */ -DUMMY(seccomp); /* Linux 3.18: */ DUMMY(bpf); /* Linux 3.19: */ diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index aa18c222ac82..324708e9e3c7 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -2889,3 +2889,19 @@ linux_poll(struct thread *td, struct linux_poll_args *args) tsp, NULL, 0)); } #endif /* __i386__ || __amd64__ */ + +int +linux_seccomp(struct thread *td, struct linux_seccomp_args *args) +{ + + switch (args->op) { + case LINUX_SECCOMP_GET_ACTION_AVAIL: + return (EOPNOTSUPP); + default: + /* + * Ignore unknown operations, just like Linux kernel built + * without CONFIG_SECCOMP. + */ + return (EINVAL); + } +} diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index 3bfc9843cda2..9a7cf89466a2 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -153,6 +153,9 @@ extern int stclohz; /* Linux syslog flags */ #define LINUX_SYSLOG_ACTION_READ_ALL 3 +/* Linux seccomp flags */ +#define LINUX_SECCOMP_GET_ACTION_AVAIL 2 + #if defined(__aarch64__) || (defined(__amd64__) && !defined(COMPAT_LINUX32)) int linux_ptrace_status(struct thread *td, int pid, int status); #endif