Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-0]: src/sys/compat/netbsd32 Pull up following revision(s) (requ...
details: https://anonhg.NetBSD.org/src/rev/b78be5560995
branches: netbsd-7-0
changeset: 446056:b78be5560995
user: martin <martin%NetBSD.org@localhost>
date: Wed Nov 21 14:13:47 2018 +0000
description:
Pull up following revision(s) (requested by maxv in ticket #1652):
sys/compat/netbsd32/netbsd32_socket.c: revision 1.48 (via patch)
Fix inverted logic, which leads to buffer overflow. Detected by kASan.
diffstat:
sys/compat/netbsd32/netbsd32_socket.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r decba64945d0 -r b78be5560995 sys/compat/netbsd32/netbsd32_socket.c
--- a/sys/compat/netbsd32/netbsd32_socket.c Wed Nov 21 12:15:40 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_socket.c Wed Nov 21 14:13:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_socket.c,v 1.41.14.1 2015/08/08 15:41:54 martin Exp $ */
+/* $NetBSD: netbsd32_socket.c,v 1.41.14.1.2.1 2018/11/21 14:13:47 martin Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.41.14.1 2015/08/08 15:41:54 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.41.14.1.2.1 2018/11/21 14:13:47 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -99,7 +99,7 @@
}
ktrkuser("msgcontrol", cmsg, cmsg->cmsg_len);
- error = copyout(&cmsg32, *q, MAX(i, sizeof(cmsg32)));
+ error = copyout(&cmsg32, *q, MIN(i, sizeof(cmsg32)));
if (error)
return (error);
if (i > CMSG32_LEN(0)) {
Home |
Main Index |
Thread Index |
Old Index