Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Apr 2022 20:33:40 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 673bce11cedd - main - linux(4): Copyout actual size of addr to the user space in accept().
Message-ID:  <202204112033.23BKXea0083129@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=673bce11cedde3cc33c154d2b8e2d41139dcef72

commit 673bce11cedde3cc33c154d2b8e2d41139dcef72
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-04-11 20:33:27 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-04-11 20:33:27 +0000

    linux(4): Copyout actual size of addr to the user space in accept().
    
    Differential Revision:  https://reviews.freebsd.org/D34727
---
 sys/compat/linux/linux_socket.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 622e25651dbb..d7e17596fde1 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -1046,11 +1046,9 @@ linux_accept_common(struct thread *td, int s, l_uintptr_t addr,
 
 	if (len != 0) {
 		error = linux_copyout_sockaddr(sa, PTRIN(addr), len);
-
-		/*
-		 * XXX: We should also copyout the len, shouldn't we?
-		 */
-
+		if (error == 0)
+			error = copyout(&len, PTRIN(namelen),
+			    sizeof(len));
 		if (error != 0) {
 			fdclose(td, fp, td->td_retval[0]);
 			td->td_retval[0] = 0;



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