]>
Commit | Line | Data |
---|---|---|
2c643bb0 GKH |
1 | From foo@baz Wed Aug 1 08:19:32 CEST 2018 |
2 | From: Dmitry Safonov <dima@arista.com> | |
3 | Date: Fri, 27 Jul 2018 16:54:44 +0100 | |
4 | Subject: netlink: Do not subscribe to non-existent groups | |
5 | ||
6 | From: Dmitry Safonov <dima@arista.com> | |
7 | ||
8 | [ Upstream commit 7acf9d4237c46894e0fa0492dd96314a41742e84 ] | |
9 | ||
10 | Make ABI more strict about subscribing to group > ngroups. | |
11 | Code doesn't check for that and it looks bogus. | |
12 | (one can subscribe to non-existing group) | |
13 | Still, it's possible to bind() to all possible groups with (-1) | |
14 | ||
15 | Cc: "David S. Miller" <davem@davemloft.net> | |
16 | Cc: Herbert Xu <herbert@gondor.apana.org.au> | |
17 | Cc: Steffen Klassert <steffen.klassert@secunet.com> | |
18 | Cc: netdev@vger.kernel.org | |
19 | Signed-off-by: Dmitry Safonov <dima@arista.com> | |
20 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
21 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
22 | --- | |
23 | net/netlink/af_netlink.c | 1 + | |
24 | 1 file changed, 1 insertion(+) | |
25 | ||
26 | --- a/net/netlink/af_netlink.c | |
27 | +++ b/net/netlink/af_netlink.c | |
28 | @@ -976,6 +976,7 @@ static int netlink_bind(struct socket *s | |
29 | if (err) | |
30 | return err; | |
31 | } | |
32 | + groups &= (1UL << nlk->ngroups) - 1; | |
33 | ||
34 | bound = nlk->bound; | |
35 | if (bound) { |