summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-02-26 11:55:44 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2025-02-26 11:55:44 -0800
commitc0d35086a21b8d5536da5029fd76b9aeecf3217d (patch)
treeaffdb5d5bc1a3d09950c12d4c69895db036a54d1 /security
parentd62fdaf51b115f851dd151f7af054535890b5a0d (diff)
parent78332fdb956f18accfbca5993b10c5ed69f00a2c (diff)
downloadlinux-c0d35086a21b8d5536da5029fd76b9aeecf3217d.tar.gz
linux-c0d35086a21b8d5536da5029fd76b9aeecf3217d.tar.bz2
linux-c0d35086a21b8d5536da5029fd76b9aeecf3217d.zip
Merge tag 'landlock-6.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux
Pull landlock fixes from Mickaël Salaün: "Fixes to TCP socket identification, documentation, and tests" * tag 'landlock-6.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux: selftests/landlock: Add binaries to .gitignore selftests/landlock: Test that MPTCP actions are not restricted selftests/landlock: Test TCP accesses with protocol=IPPROTO_TCP landlock: Fix non-TCP sockets restriction landlock: Minor typo and grammar fixes in IPC scoping documentation landlock: Fix grammar error selftests/landlock: Enable the new CONFIG_AF_UNIX_OOB
Diffstat (limited to 'security')
-rw-r--r--security/landlock/net.c3
-rw-r--r--security/landlock/ruleset.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/security/landlock/net.c b/security/landlock/net.c
index d5dcc4407a19..104b6c01fe50 100644
--- a/security/landlock/net.c
+++ b/security/landlock/net.c
@@ -63,8 +63,7 @@ static int current_check_access_socket(struct socket *const sock,
if (WARN_ON_ONCE(dom->num_layers < 1))
return -EACCES;
- /* Checks if it's a (potential) TCP socket. */
- if (sock->type != SOCK_STREAM)
+ if (!sk_is_tcp(sock->sk))
return 0;
/* Checks for minimal header length to safely read sa_family. */
diff --git a/security/landlock/ruleset.c b/security/landlock/ruleset.c
index 241ce44375b6..bff4e40a3093 100644
--- a/security/landlock/ruleset.c
+++ b/security/landlock/ruleset.c
@@ -124,7 +124,7 @@ create_rule(const struct landlock_id id,
return ERR_PTR(-ENOMEM);
RB_CLEAR_NODE(&new_rule->node);
if (is_object_pointer(id.type)) {
- /* This should be catched by insert_rule(). */
+ /* This should have been caught by insert_rule(). */
WARN_ON_ONCE(!id.key.object);
landlock_get_object(id.key.object);
}