]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
landlock: Change landlock_add_rule(2) argument check ordering
authorMickaël Salaün <mic@digikod.net>
Fri, 6 May 2022 16:08:18 +0000 (18:08 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:25:18 +0000 (09:25 +0200)
commit56d546e618eb9fa23a721a7707dc98ec06ee47a1
tree52ab5be1715c27613bb8a30d4b75e9de5306ebf4
parent6f68eab4dadf28b80db4c07901aab38b7b7e9f3c
landlock: Change landlock_add_rule(2) argument check ordering

BugLink: https://bugs.launchpad.net/bugs/1981864
commit 589172e5636c4d16c40b90e87543d43defe2d968 upstream.

This makes more sense to first check the ruleset FD and then the rule
attribute.  It will be useful to factor out code for other rule types.

Add inval_add_rule_arguments tests, extension of empty_path_beneath_attr
tests, to also check error ordering for landlock_add_rule(2).

Link: https://lore.kernel.org/r/20220506160820.524344-9-mic@digikod.net
Cc: stable@vger.kernel.org
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
security/landlock/syscalls.c
tools/testing/selftests/landlock/base_test.c