projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9939a46
)
netlink: Do not subscribe to non-existent groups
author
Dmitry Safonov
<
[email protected]
>
Fri, 27 Jul 2018 15:54:44 +0000
(16:54 +0100)
committer
David S. Miller
<
[email protected]
>
Sun, 29 Jul 2018 19:50:19 +0000
(12:50 -0700)
Make ABI more strict about subscribing to group > ngroups.
Code doesn't check for that and it looks bogus.
(one can subscribe to non-existing group)
Still, it's possible to bind() to all possible groups with (-1)
Cc: "David S. Miller" <
[email protected]
>
Cc: Herbert Xu <
[email protected]
>
Cc: Steffen Klassert <
[email protected]
>
Cc:
[email protected]
Signed-off-by: Dmitry Safonov <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/netlink/af_netlink.c
patch
|
blob
|
history
diff --git
a/net/netlink/af_netlink.c
b/net/netlink/af_netlink.c
index 393573a99a5a34d3ebaad3a71b36293b6c2fb19f..ac805caed2e2c50efc732c2faeddc52c06f0ef48 100644
(file)
--- a/
net/netlink/af_netlink.c
+++ b/
net/netlink/af_netlink.c
@@
-1008,6
+1008,7
@@
static int netlink_bind(struct socket *sock, struct sockaddr *addr,
if (err)
return err;
}
+ groups &= (1UL << nlk->ngroups) - 1;
bound = nlk->bound;
if (bound) {