+13
−8
Loading
Exact UNIX diag lookups hold a reference to the socket, but not to u->path. Meanwhile, unix_release_sock() clears u->path under unix_state_lock() and drops the path reference after unlocking. Read the inode and device numbers for UNIX_DIAG_VFS while holding unix_state_lock(), then emit the netlink attribute after dropping the lock. This keeps the VFS data stable while the reply is being built. Fixes: 5f7b0569 ("unix_diag: Unix inode info NLA") Reported-by:Yifan Wu <yifanwucs@gmail.com> Reported-by:
Juefei Pu <tomapufckgml@gmail.com> Co-developed-by:
Yuan Tan <yuantan098@gmail.com> Signed-off-by:
Yuan Tan <yuantan098@gmail.com> Suggested-by:
Xin Liu <bird@lzu.edu.cn> Tested-by:
Ren Wei <enjou1224z@gmail.com> Signed-off-by:
Jiexun Wang <wangjiexun2025@gmail.com> Signed-off-by:
Ren Wei <n05ec@lzu.edu.cn> Reviewed-by:
Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260407080015.1744197-1-n05ec@lzu.edu.cn Signed-off-by:
Jakub Kicinski <kuba@kernel.org>