As noted by Roel Bouwman Linux allows a large buffer size than the

struct ucred size. Fix this.

PR:		102956
Reported by:	Roel Bouwman <roel at qsp nl>
MFC after:	1 week
This commit is contained in:
Dmitry Chagin 2017-03-18 18:31:04 +00:00
parent dd92181f60
commit cd92d27e16

View File

@ -1619,7 +1619,7 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args)
sizeof(linux_tv)));
/* NOTREACHED */
case LOCAL_PEERCRED:
if (args->optlen != sizeof(lxu))
if (args->optlen < sizeof(lxu))
return (EINVAL);
xulen = sizeof(xu);
error = kern_getsockopt(td, args->s, bsd_args.level,