Date: Tue, 22 Jan 2019 02:04:37 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343294 - stable/11/sys/compat/linux Message-ID: <201901220204.x0M24bCC054088@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Jan 22 02:04:37 2019 New Revision: 343294 URL: https://svnweb.freebsd.org/changeset/base/343294 Log: MFC r342864: Specify the correct option level when emulating SO_PEERCRED. PR: 234722 Modified: stable/11/sys/compat/linux/linux_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_socket.c ============================================================================== --- stable/11/sys/compat/linux/linux_socket.c Tue Jan 22 02:02:12 2019 (r343293) +++ stable/11/sys/compat/linux/linux_socket.c Tue Jan 22 02:04:37 2019 (r343294) @@ -1635,6 +1635,11 @@ linux_getsockopt(struct thread *td, struct linux_getso case LOCAL_PEERCRED: if (args->optlen < sizeof(lxu)) return (EINVAL); + /* + * LOCAL_PEERCRED is not served at the SOL_SOCKET level, + * but by the Unix socket's level 0. + */ + bsd_args.level = 0; xulen = sizeof(xu); error = kern_getsockopt(td, args->s, bsd_args.level, name, &xu, UIO_SYSSPACE, &xulen);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901220204.x0M24bCC054088>