<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/selftests/seccomp, branch v5.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-06-29T02:49:37Z</updated>
<entry>
<title>Merge tag 'seccomp-v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux</title>
<updated>2021-06-29T02:49:37Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-06-29T02:49:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=616ea5cc4a7b058f8c27e37b9a597d8704c49130'/>
<id>urn:sha1:616ea5cc4a7b058f8c27e37b9a597d8704c49130</id>
<content type='text'>
Pull seccomp updates from Kees Cook:

 - Add "atomic addfd + send reply" mode to SECCOMP_USER_NOTIF to better
   handle EINTR races visible to seccomp monitors. (Rodrigo Campos,
   Sargun Dhillon)

 - Improve seccomp selftests for readability in CI systems. (Kees Cook)

* tag 'seccomp-v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  selftests/seccomp: Avoid using "sysctl" for report
  selftests/seccomp: Flush benchmark output
  selftests/seccomp: More closely track fds being assigned
  selftests/seccomp: Add test for atomic addfd+send
  seccomp: Support atomic "addfd + send reply"
</content>
</entry>
<entry>
<title>selftests/seccomp: Avoid using "sysctl" for report</title>
<updated>2021-06-28T19:49:52Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2021-06-17T23:18:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9a03abc16c77062c73972df08206f1031862d9b4'/>
<id>urn:sha1:9a03abc16c77062c73972df08206f1031862d9b4</id>
<content type='text'>
Instead of depending on "sysctl" being installed, just use "grep -H" for
sysctl status reporting. Additionally report kernel version for easier
comparisons.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>selftests/seccomp: Flush benchmark output</title>
<updated>2021-06-28T19:49:52Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2021-05-27T02:46:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=62ddb91b7771626658c382c2b849a058f1586123'/>
<id>urn:sha1:62ddb91b7771626658c382c2b849a058f1586123</id>
<content type='text'>
When running the seccomp benchmark under a test runner, it wouldn't
provide any feedback on progress. Set stdout unbuffered.

Suggested-by: Will Drewry &lt;wad@chromium.org&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>selftests/seccomp: More closely track fds being assigned</title>
<updated>2021-06-28T19:49:52Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2021-05-27T02:49:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=93e720d710dfe689099c23bb91414303cf715d27'/>
<id>urn:sha1:93e720d710dfe689099c23bb91414303cf715d27</id>
<content type='text'>
Since the open fds might not always start at "4" (especially when
running under kselftest, etc), start counting from the first assigned
fd, rather than using the more permissive EXPECT_GE(fd, 0).

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/lkml/20210527032948.3730953-1-keescook@chromium.org
Reviewed-by: Rodrigo Campos &lt;rodrigo@kinvolk.io&gt;
Acked-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
</content>
</entry>
<entry>
<title>selftests/seccomp: Add test for atomic addfd+send</title>
<updated>2021-06-28T19:49:52Z</updated>
<author>
<name>Rodrigo Campos</name>
<email>rodrigo@kinvolk.io</email>
</author>
<published>2021-05-17T19:39:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e540ad97e73cefb41e93d0c06d0fe6a8620a77e0'/>
<id>urn:sha1:e540ad97e73cefb41e93d0c06d0fe6a8620a77e0</id>
<content type='text'>
This just adds a test to verify that when using the new introduced flag
to ADDFD, a valid fd is added and returned as the syscall result.

Signed-off-by: Rodrigo Campos &lt;rodrigo@kinvolk.io&gt;
Signed-off-by: Sargun Dhillon &lt;sargun@sargun.me&gt;
Acked-by: Tycho Andersen &lt;tycho@tycho.pizza&gt;
Acked-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20210517193908.3113-5-sargun@sargun.me
</content>
</entry>
<entry>
<title>powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls</title>
<updated>2021-05-20T14:58:03Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2021-05-20T11:19:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5665bc35c1ed917ac8fd06cb651317bb47a65b10'/>
<id>urn:sha1:5665bc35c1ed917ac8fd06cb651317bb47a65b10</id>
<content type='text'>
The sc and scv 0 system calls have different ABI conventions, and
ptracers need to know which system call type is being used if they want
to look at the syscall registers.

Document that pt_regs.trap can be used for this, and fix one in-tree user
to work with scv 0 syscalls.

Fixes: 7fa95f9adaee ("powerpc/64s: system call support for scv/rfscv instructions")
Cc: stable@vger.kernel.org # v5.9+
Reported-by: "Dmitry V. Levin" &lt;ldv@altlinux.org&gt;
Suggested-by: "Dmitry V. Levin" &lt;ldv@altlinux.org&gt;
Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20210520111931.2597127-1-npiggin@gmail.com
</content>
</entry>
<entry>
<title>Merge tag 'topic/kcmp-kconfig-2021-02-22' of git://anongit.freedesktop.org/drm/drm</title>
<updated>2021-02-23T01:15:30Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-02-23T01:15:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b5f9254e4f4375ac845cb17f1732037dd8adeeb'/>
<id>urn:sha1:4b5f9254e4f4375ac845cb17f1732037dd8adeeb</id>
<content type='text'>
Pull kcmp kconfig update from Daniel Vetter:
 "Make the kcmp syscall available independently of checkpoint/restore.

  drm userspaces uses this, systemd uses this, so makes sense to pull it
  out from the checkpoint-restore bundle.

  Kees reviewed this from security pov and is happy with the final
  version"

Link: https://lwn.net/Articles/845448/

* tag 'topic/kcmp-kconfig-2021-02-22' of git://anongit.freedesktop.org/drm/drm:
  kcmp: Support selection of SYS_kcmp without CHECKPOINT_RESTORE
</content>
</entry>
<entry>
<title>kcmp: Support selection of SYS_kcmp without CHECKPOINT_RESTORE</title>
<updated>2021-02-16T08:59:41Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2021-02-05T22:00:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bfe3911a91047557eb0e620f95a370aee6a248c7'/>
<id>urn:sha1:bfe3911a91047557eb0e620f95a370aee6a248c7</id>
<content type='text'>
Userspace has discovered the functionality offered by SYS_kcmp and has
started to depend upon it. In particular, Mesa uses SYS_kcmp for
os_same_file_description() in order to identify when two fd (e.g. device
or dmabuf) point to the same struct file. Since they depend on it for
core functionality, lift SYS_kcmp out of the non-default
CONFIG_CHECKPOINT_RESTORE into the selectable syscall category.

Rasmus Villemoes also pointed out that systemd uses SYS_kcmp to
deduplicate the per-service file descriptor store.

Note that some distributions such as Ubuntu are already enabling
CHECKPOINT_RESTORE in their configs and so, by extension, SYS_kcmp.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/3046
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Will Drewry &lt;wad@chromium.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Dave Airlie &lt;airlied@gmail.com&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Cc: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Cc: Cyrill Gorcunov &lt;gorcunov@gmail.com&gt;
Cc: stable@vger.kernel.org
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt; # DRM depends on kcmp
Acked-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt; # systemd uses kcmp
Reviewed-by: Cyrill Gorcunov &lt;gorcunov@gmail.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210205220012.1983-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>selftests/seccomp: Accept any valid fd in user_notification_addfd</title>
<updated>2021-02-10T00:39:01Z</updated>
<author>
<name>Seth Forshee</name>
<email>seth.forshee@canonical.com</email>
</author>
<published>2021-01-28T16:17:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e0c0840a46db9d50ba7391082d665d74f320c39f'/>
<id>urn:sha1:e0c0840a46db9d50ba7391082d665d74f320c39f</id>
<content type='text'>
This test expects fds to have specific values, which works fine
when the test is run standalone. However, the kselftest runner
consumes a couple of extra fds for redirection when running
tests, so the test fails when run via kselftest.

Change the test to pass on any valid fd number.

Signed-off-by: Seth Forshee &lt;seth.forshee@canonical.com&gt;
Acked-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/seccomp: Update kernel config</title>
<updated>2020-12-02T19:20:54Z</updated>
<author>
<name>Mickaël Salaün</name>
<email>mic@linux.microsoft.com</email>
</author>
<published>2020-12-02T16:26:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c07343abd8932200a45ff7b10950e71081e9e77'/>
<id>urn:sha1:2c07343abd8932200a45ff7b10950e71081e9e77</id>
<content type='text'>
seccomp_bpf.c uses unshare(CLONE_NEWPID), which requires CONFIG_PID_NS
to be set.

Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace")
Signed-off-by: Mickaël Salaün &lt;mic@linux.microsoft.com&gt;
Acked-by: Tycho Andersen &lt;tycho@tycho.pizza&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20201202162643.249276-1-mic@digikod.net
</content>
</entry>
</feed>
