mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-02 01:06:46 +09:00
x25: Prevent skb overreads when checking call user data
commit 7f81e25bef upstream.
x25_find_listener does not check that the amount of call user data given
in the skb is big enough in per-socket comparisons, hence buffer
overreads may occur. Fix this by adding a check.
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Andrew Hendry <andrew.hendry@gmail.com>
Acked-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6b2f66dc9c
commit
4ea7f3aa5d
@@ -295,7 +295,8 @@ static struct sock *x25_find_listener(struct x25_address *addr,
|
||||
* Found a listening socket, now check the incoming
|
||||
* call user data vs this sockets call user data
|
||||
*/
|
||||
if(skb->len > 0 && x25_sk(s)->cudmatchlength > 0) {
|
||||
if (x25_sk(s)->cudmatchlength > 0 &&
|
||||
skb->len >= x25_sk(s)->cudmatchlength) {
|
||||
if((memcmp(x25_sk(s)->calluserdata.cuddata,
|
||||
skb->data,
|
||||
x25_sk(s)->cudmatchlength)) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user