All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] inet_diag: bc: read cgroup id only for full sockets
@ 2020-05-02 15:34 Dmitry Yakunin
  2020-05-02 23:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Yakunin @ 2020-05-02 15:34 UTC (permalink / raw)
  To: davem, netdev

Fix bug introduced by commit b1f3e43dbfac ("inet_diag: add support for
cgroup filter").

Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
Reported-by: syzbot+ee80f840d9bf6893223b@syzkaller.appspotmail.com
Reported-by: syzbot+13bef047dbfffa5cd1af@syzkaller.appspotmail.com
Fixes: b1f3e43dbfac ("inet_diag: add support for cgroup filter")
---
 net/ipv4/inet_diag.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 0034092..125f4f8 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] inet_diag: bc: read cgroup id only for full sockets
  2020-05-02 15:34 [PATCH net-next] inet_diag: bc: read cgroup id only for full sockets Dmitry Yakunin
@ 2020-05-02 23:43 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-02 23:43 UTC (permalink / raw)
  To: zeil; +Cc: netdev

From: Dmitry Yakunin <zeil@yandex-team.ru>
Date: Sat,  2 May 2020 18:34:42 +0300

> Fix bug introduced by commit b1f3e43dbfac ("inet_diag: add support for
> cgroup filter").
> 
> Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
> Reported-by: syzbot+ee80f840d9bf6893223b@syzkaller.appspotmail.com
> Reported-by: syzbot+13bef047dbfffa5cd1af@syzkaller.appspotmail.com
> Fixes: b1f3e43dbfac ("inet_diag: add support for cgroup filter")

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-02 23:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02 15:34 [PATCH net-next] inet_diag: bc: read cgroup id only for full sockets Dmitry Yakunin
2020-05-02 23:43 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.