Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/net Pull up following revision(s) (requested by maxv ...



details:   https://anonhg.NetBSD.org/src/rev/506533cff0cf
branches:  netbsd-8
changeset: 852479:506533cff0cf
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Aug 04 11:19:03 2019 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1323):

        sys/net/bpf.c: revision 1.229

Fix info leak: use kmem_zalloc, because we align the buffers, and the
otherwise uninitialized padding bytes get copied to userland in bpf_read().

diffstat:

 sys/net/bpf.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 4548e0f21490 -r 506533cff0cf sys/net/bpf.c
--- a/sys/net/bpf.c     Sun Aug 04 11:16:26 2019 +0000
+++ b/sys/net/bpf.c     Sun Aug 04 11:19:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.216.6.6 2018/05/15 13:48:37 martin Exp $     */
+/*     $NetBSD: bpf.c,v 1.216.6.7 2019/08/04 11:19:03 martin Exp $     */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.216.6.6 2018/05/15 13:48:37 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.216.6.7 2019/08/04 11:19:03 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -1969,10 +1969,10 @@
 bpf_allocbufs(struct bpf_d *d)
 {
 
-       d->bd_fbuf = kmem_alloc(d->bd_bufsize, KM_NOSLEEP);
+       d->bd_fbuf = kmem_zalloc(d->bd_bufsize, KM_NOSLEEP);
        if (!d->bd_fbuf)
                return (ENOBUFS);
-       d->bd_sbuf = kmem_alloc(d->bd_bufsize, KM_NOSLEEP);
+       d->bd_sbuf = kmem_zalloc(d->bd_bufsize, KM_NOSLEEP);
        if (!d->bd_sbuf) {
                kmem_free(d->bd_fbuf, d->bd_bufsize);
                return (ENOBUFS);



Home | Main Index | Thread Index | Old Index