提交 ee1bd483 编写于 作者: D Dmitry Yakunin 提交者: David S. Miller

inet_diag: bc: read cgroup id only for full sockets

Fix bug introduced by commit b1f3e43d ("inet_diag: add support for
cgroup filter").
Signed-off-by: NDmitry Yakunin <zeil@yandex-team.ru>
Reported-by: syzbot+ee80f840d9bf6893223b@syzkaller.appspotmail.com
Reported-by: syzbot+13bef047dbfffa5cd1af@syzkaller.appspotmail.com
Fixes: b1f3e43d ("inet_diag: add support for cgroup filter")
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f166f890
......@@ -746,7 +746,8 @@ int inet_diag_bc_sk(const struct nlattr *bc, struct sock *sk)
else
entry.mark = 0;
#ifdef CONFIG_SOCK_CGROUP_DATA
entry.cgroup_id = cgroup_id(sock_cgroup_ptr(&sk->sk_cgrp_data));
entry.cgroup_id = sk_fullsock(sk) ?
cgroup_id(sock_cgroup_ptr(&sk->sk_cgrp_data)) : 0;
#endif
return inet_diag_bc_run(bc, &entry);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册