[PATCH 2/2] landlock: replace __sk_common struct sock field accesses

Matthieu Buffet matthieu at buffet.re
Tue Jun 9 21:15:11 UTC 2026


Use the proper macro to access __sk_common.skc_family like everywhere
else.

Signed-off-by: Matthieu Buffet <matthieu at buffet.re>
---
 security/landlock/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/landlock/net.c b/security/landlock/net.c
index 111e58fd9325..fc2acf8bd898 100644
--- a/security/landlock/net.c
+++ b/security/landlock/net.c
@@ -71,7 +71,7 @@ static int current_check_access_socket(struct socket *const sock,
 	 * The socket is not locked, so sk_family can change concurrently
 	 * due to e.g. setsockopt(IPV6_ADDRFORM).
 	 */
-	sock_family = READ_ONCE(sock->sk->__sk_common.skc_family);
+	sock_family = READ_ONCE(sock->sk->sk_family);
 
 	switch (address->sa_family) {
 	case AF_UNSPEC:
-- 
2.47.3




More information about the Linux-security-module-archive mailing list