[PATCH net] net/x25: inherit the listening socket's security label on accept

sashiko-bot at kernel.org sashiko-bot at kernel.org
Mon Nov 23 00:38:47 UTC 2026


> From: Suyuan Wang <stevewong at hust.edu.cn>
> 
> x25_make_new() creates the socket that accept() returns by copying
> fields from the listening socket, but it never clones the listening
> socket's LSM security state -- there is no security_sk_clone(osk, sk).
> The accepted socket therefore keeps the security state that was newly
> allocated for it in x25_alloc_socket(), instead of inheriting the
> listening socket's security state.
> 
> Other accept paths (bluetooth, tipc, vsock, iucv) call
> security_sk_clone() for this. Do the same for X.25.
> 
> Found with a static analysis tool and checked by hand.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable at vger.kernel.org
> Co-developed-by: Kaixuan Li <kaixuan.li at ntu.edu.sg>
> Signed-off-by: Kaixuan Li <kaixuan.li at ntu.edu.sg>
> Signed-off-by: Suyuan Wang <stevewong at hust.edu.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123-x25-v1-1-4432d3892f8b@gmail.com?part=1



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