]> git.baikalelectronics.ru Git - kernel.git/commit
net: use skb_to_full_sk() in skb_update_prio()
authorEric Dumazet <edumazet@google.com>
Wed, 14 Mar 2018 16:04:16 +0000 (09:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Mar 2018 16:53:23 +0000 (12:53 -0400)
commit644f90306700e75ba4e77a45990c9e84079d7dcd
treec3f83c7300f9f8fe9612bf790efbfe150345ae88
parent0b7ef83ace25ba6303c04d01e13302a7405dd17b
net: use skb_to_full_sk() in skb_update_prio()

Andrei Vagin reported a KASAN: slab-out-of-bounds error in
skb_update_prio()

Since SYNACK might be attached to a request socket, we need to
get back to the listener socket.
Since this listener is manipulated without locks, add const
qualifiers to sock_cgroup_prioidx() so that the const can also
be used in skb_update_prio()

Also add the const qualifier to sock_cgroup_classid() for consistency.

Fixes: 4b6a53b8f218 ("tcp: attach SYNACK messages to request sockets instead of listener")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/cgroup-defs.h
net/core/dev.c