linux(4): Limit user-supplied sockaddr length in recvfrom().
Differential Revision: https://reviews.freebsd.org/D34726
This commit is contained in:
parent
68bfaefb3d
commit
bb0f644cd6
@ -1272,6 +1272,7 @@ linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
|
||||
return (error);
|
||||
if (fromlen < 0)
|
||||
return (EINVAL);
|
||||
fromlen = min(fromlen, SOCK_MAXADDRLEN);
|
||||
sa = malloc(fromlen, M_SONAME, M_WAITOK);
|
||||
} else {
|
||||
fromlen = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user