Skip to contentSkip to conversation

Landlock updates for v6.12

GIT PULL Merged Mickaël Salaün 2 participants 2 messages Sep 23, 2024 – Sep 24, 2024 Security (LSM)

lore
Share & tools
lore
#0 lore raw

Hi Linus,

This PR brings signal and abstract UNIX socket control to Landlock, contributed by Tahera Fahimi during her Outreachy internship [1]. These features are useful to better isolate processes.

Please pull these changes for v6.12-rc1. These commits merge cleanly with your master branch. The kernel code has been tested in the latest linux-next releases for a few weeks, but I rebased it on your master branch last week because of VFS and LSM tree dependencies.

We can now scope a Landlock domain thanks to a new "scoped" field that can deny interactions with resources outside of this domain. The LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET flag denies connections to an abstract UNIX socket created outside of the current scoped domain [2], and the LANDLOCK_SCOPE_SIGNAL flag denies sending a signal to processes outside of the current scoped domain [3]. These restrictions also apply to nested domains according to their scope. The related changes will also be useful to support other kind of IPC isolations.

Test coverage for security/landlock is 92.2% of 1046 lines according to gcc/gcov-14, and it was 91.7% of 961 lines before this series.

Regards,
Mickaël

--
The following changes since commit a430d95c5efa2b545d26a094eb5f624e36732af0:

Merge tag 'lsm-pr-20240911' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm (2024-09-16 18:19:47 +0200)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/mic/linux.git tags/landlock-6.12-rc1

for you to fetch changes up to 1ca980815e1f284dddcb5e678c91bbd3e3f3a6a6:

landlock: Document LANDLOCK_SCOPE_SIGNAL (2024-09-16 23:50:55 +0200)

----------------------------------------------------------------
Landlock updates for v6.12-rc1

----------------------------------------------------------------
Tahera Fahimi (14):
landlock: Add abstract UNIX socket scoping selftests/landlock: Test handling of unknown scope selftests/landlock: Test abstract UNIX socket scoping selftests/landlock: Test UNIX sockets with any address formats selftests/landlock: Test connected and unconnected datagram UNIX socket selftests/landlock: Test inherited restriction of abstract UNIX socket samples/landlock: Add support for abstract UNIX socket scoping
landlock: Document LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET
landlock: Add signal scoping
selftests/landlock: Test signal scoping
selftests/landlock: Test signal scoping for threads selftests/landlock: Test signal created by out-of-bound message samples/landlock: Add support for signal scoping
landlock: Document LANDLOCK_SCOPE_SIGNAL

 Documentation/userspace-api/landlock.rst           |   58 +-
 include/uapi/linux/landlock.h                      |   30 +
 samples/landlock/sandboxer.c                       |   73 +-
 security/landlock/cred.h                           |    2 +-
 security/landlock/fs.c                             |   25 +
 security/landlock/fs.h                             |    7 +
 security/landlock/limits.h                         |    3 +
 security/landlock/ruleset.c                        |    7 +-
 security/landlock/ruleset.h                        |   24 +-
 security/landlock/syscalls.c                       |   17 +-
 security/landlock/task.c                           |  193 ++++
 tools/testing/selftests/landlock/base_test.c       |    2 +-
 tools/testing/selftests/landlock/common.h          |   39 +
 tools/testing/selftests/landlock/fs_test.c         |    1 -
 tools/testing/selftests/landlock/net_test.c        |   31 +-
 .../selftests/landlock/scoped_abstract_unix_test.c | 1041 ++++++++++++++++++++
 .../selftests/landlock/scoped_base_variants.h      |  156 +++
 tools/testing/selftests/landlock/scoped_common.h   |   28 +
 .../landlock/scoped_multiple_domain_variants.h     |  152 +++
 .../selftests/landlock/scoped_signal_test.c        |  484 +++++++++
 tools/testing/selftests/landlock/scoped_test.c     |   33 +
 21 files changed, 2359 insertions(+), 47 deletions(-)
 create mode 100644 tools/testing/selftests/landlock/scoped_abstract_unix_test.c
 create mode 100644 tools/testing/selftests/landlock/scoped_base_variants.h
 create mode 100644 tools/testing/selftests/landlock/scoped_common.h
 create mode 100644 tools/testing/selftests/landlock/scoped_multiple_domain_variants.h
 create mode 100644 tools/testing/selftests/landlock/scoped_signal_test.c
 create mode 100644 tools/testing/selftests/landlock/scoped_test.c
merge bot Merged
#1 lore raw
The pull request you sent on Mon, 23 Sep 2024 20:42:51 +0200:

The pull request you sent on Mon, 23 Sep 2024 20:42:51 +0200:

Quoted 1 line

https://git.kernel.org/pub/scm/linux/kernel/git/mic/linux.git tags/landlock-6.12-rc1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/e1b061b444fb01c237838f0d8238653afe6a8094

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html