Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2020 15:49:37 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@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: r364694 - stable/12/sys/compat/linux
Message-ID:  <202008241549.07OFnbQ8049205@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008241549.07OFnbQ8049205>