Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2019 02:02:12 +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-12@freebsd.org
Subject:   svn commit: r343293 - stable/12/sys/compat/linux
Message-ID:  <201901220202.x0M22C4W053085@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Jan 22 02:02:12 2019
New Revision: 343293
URL: https://svnweb.freebsd.org/changeset/base/343293

Log:
  MFC r342864:
  Specify the correct option level when emulating SO_PEERCRED.
  
  PR:	234722

Modified:
  stable/12/sys/compat/linux/linux_socket.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_socket.c
==============================================================================
--- stable/12/sys/compat/linux/linux_socket.c	Tue Jan 22 01:44:47 2019	(r343292)
+++ stable/12/sys/compat/linux/linux_socket.c	Tue Jan 22 02:02:12 2019	(r343293)
@@ -1632,6 +1632,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?201901220202.x0M22C4W053085>