Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a49e2f5d authored by Guillaume Nault's avatar Guillaume Nault Committed by David S. Miller
Browse files

pppoe: check sockaddr length in pppoe_connect()



We must validate sockaddr_len, otherwise userspace can pass fewer data
than we expect and we end up accessing invalid data.

Fixes: 224cf5ad ("ppp: Move the PPP drivers")
Reported-by: default avatar <syzbot+4f03bdf92fdf9ef5ddab@syzkaller.appspotmail.com>
Signed-off-by: default avatarGuillaume Nault <g.nault@alphalink.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb1c28c0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -620,6 +620,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;