Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys Apply patch, requested by maxv in ticket #1142:
details: https://anonhg.NetBSD.org/src/rev/b5a9536033ff
branches: netbsd-8
changeset: 446924:b5a9536033ff
user: martin <martin%NetBSD.org@localhost>
date: Tue Dec 25 11:19:52 2018 +0000
description:
Apply patch, requested by maxv in ticket #1142:
Similar to:
sys/uvm/uvm_swap.c: revision 1.178
Fix kernel info leak in swapctl(2).
Possible info leak: [len=1056, leaked=931]
#0 0xffffffff80bad351 in kleak_copyout
#1 0xffffffff80b2cf64 in uvm_swap_stats.part.1
#2 0xffffffff80b2d38d in uvm_swap_stats
#3 0xffffffff80b2d43c in sys_swapctl
#4 0xffffffff80259b82 in syscall
diffstat:
sys/compat/netbsd32/netbsd32_netbsd.c | 6 +++---
sys/uvm/uvm_swap.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diffs (54 lines):
diff -r fe338868940f -r b5a9536033ff sys/compat/netbsd32/netbsd32_netbsd.c
--- a/sys/compat/netbsd32/netbsd32_netbsd.c Thu Dec 20 11:35:32 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c Tue Dec 25 11:19:52 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_netbsd.c,v 1.206 2017/04/29 01:15:40 christos Exp $ */
+/* $NetBSD: netbsd32_netbsd.c,v 1.206.2.1 2018/12/25 11:19:52 martin Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.206 2017/04/29 01:15:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.206.2.1 2018/12/25 11:19:52 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@@ -1770,7 +1770,7 @@
}
ksep_len = sizeof(*ksep) * count;
- ksep = kmem_alloc(ksep_len, KM_SLEEP);
+ ksep = kmem_zalloc(ksep_len, KM_SLEEP);
usep32 = (struct netbsd32_swapent *)SCARG(uap, arg);
uvm_swap_stats(SWAP_STATS, ksep, count, retval);
diff -r fe338868940f -r b5a9536033ff sys/uvm/uvm_swap.c
--- a/sys/uvm/uvm_swap.c Thu Dec 20 11:35:32 2018 +0000
+++ b/sys/uvm/uvm_swap.c Tue Dec 25 11:19:52 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_swap.c,v 1.174.10.1 2017/11/02 21:29:53 snj Exp $ */
+/* $NetBSD: uvm_swap.c,v 1.174.10.2 2018/12/25 11:19:52 martin Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.174.10.1 2017/11/02 21:29:53 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.174.10.2 2018/12/25 11:19:52 martin Exp $");
#include "opt_uvmhist.h"
#include "opt_compat_netbsd.h"
@@ -525,7 +525,7 @@
else
#endif
len = sizeof(struct swapent) * misc;
- sep = (struct swapent *)kmem_alloc(len, KM_SLEEP);
+ sep = (struct swapent *)kmem_zalloc(len, KM_SLEEP);
uvm_swap_stats(SCARG(uap, cmd), sep, misc, retval);
error = copyout(sep, SCARG(uap, arg), len);
Home |
Main Index |
Thread Index |
Old Index