mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
pppoe: check sockaddr length in pppoe_connect()
[ Upstream commita49e2f5d5f] We must validate sockaddr_len, otherwise userspace can pass fewer data than we expect and we end up accessing invalid data. Fixes:224cf5ad14("ppp: Move the PPP drivers") Reported-by: syzbot+4f03bdf92fdf9ef5ddab@syzkaller.appspotmail.com Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
183f20fb01
commit
dedf29a064
|
|
@ -638,6 +638,10 @@ static int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr,
|
|||
lock_sock(sk);
|
||||
|
||||
error = -EINVAL;
|
||||
|
||||
if (sockaddr_len != sizeof(struct sockaddr_pppox))
|
||||
goto end;
|
||||
|
||||
if (sp->sa_protocol != PX_PROTO_OE)
|
||||
goto end;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user