Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by maxv...
details: https://anonhg.NetBSD.org/src/rev/26a947447349
branches: netbsd-8
changeset: 445771:26a947447349
user: martin <martin%NetBSD.org@localhost>
date: Mon Nov 12 08:56:15 2018 +0000
description:
Pull up following revision(s) (requested by maxv in ticket #1088):
sys/kern/kern_proc.c: revision 1.219 (via patch)
Fix buffer overflow, which can lead to severe information leak. Detected
by kASan.
diffstat:
sys/kern/kern_proc.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 249570b4a29b -r 26a947447349 sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c Mon Nov 12 08:50:18 2018 +0000
+++ b/sys/kern/kern_proc.c Mon Nov 12 08:56:15 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_proc.c,v 1.206.6.4 2018/04/16 13:31:33 martin Exp $ */
+/* $NetBSD: kern_proc.c,v 1.206.6.5 2018/11/12 08:56:15 martin Exp $ */
/*-
* Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.206.6.4 2018/04/16 13:31:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.206.6.5 2018/11/12 08:56:15 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_kstack.h"
@@ -2461,7 +2461,8 @@
len = strlen(path) + 1;
if (oldp != NULL) {
- error = sysctl_copyout(l, path, oldp, *oldlenp);
+ size_t copylen = min(len, *oldlenp);
+ error = sysctl_copyout(l, path, oldp, copylen);
if (error == 0 && *oldlenp < len)
error = ENOSPC;
}
Home |
Main Index |
Thread Index |
Old Index