svn commit: r364694 - stable/12/sys/compat/linux

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Aug 24 15:49:38 UTC 2020


Author: trasz
Date: Mon Aug 24 15:49:37 2020
New Revision: 364694
URL: https://svnweb.freebsd.org/changeset/base/364694

Log:
  MFC r347537 by dchagin:
  
  Linuxulator getpeername() returns EINVAL in case then namelen less then 0.

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	Mon Aug 24 15:45:42 2020	(r364693)
+++ stable/12/sys/compat/linux/linux_socket.c	Mon Aug 24 15:49:37 2020	(r364694)
@@ -729,6 +729,8 @@ linux_getpeername(struct thread *td, struct linux_getp
 	error = copyin(PTRIN(args->namelen), &len, sizeof(len));
 	if (error != 0)
 		return (error);
+	if (len < 0)
+		return (EINVAL);
 
 	error = kern_getpeername(td, args->s, &sa, &len);
 	if (error != 0)


More information about the svn-src-stable-12 mailing list