diff options
| author | martin <martin@NetBSD.org> | 2022-08-03 10:55:44 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2022-08-03 10:55:44 +0000 |
| commit | c302d5ea31d36c462babff41e49adeb9467d8bf5 (patch) | |
| tree | 3f1ed5c84ac7373dd74031c330cb11e0e2d9c8e1 /sys/dev/pci/if_iwi.c | |
| parent | 01daf6f09b8fa9da82ea275389bd9e5530120e85 (diff) | |
Pull up following revision(s) (requested by riastradh in ticket #1485):
sys/dev/pci/if_iwi.c: revision 1.117
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.401
sys/dev/scsipi/ses.c: revision 1.52
sys/dev/isa/mcd.c: revision 1.121
sys/dev: Memset zero before copyout.
Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks;
the raidframe(4) change probably doesn't (but doesn't hurt).
Diffstat (limited to 'sys/dev/pci/if_iwi.c')
| -rw-r--r-- | sys/dev/pci/if_iwi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 48ca69a0bc9..5e80119e68a 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_iwi.c,v 1.111 2019/02/03 03:19:27 mrg Exp $ */ +/* $NetBSD: if_iwi.c,v 1.111.4.1 2022/08/03 10:55:44 martin Exp $ */ /* $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $ */ /*- @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.111 2019/02/03 03:19:27 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.111.4.1 2022/08/03 10:55:44 martin Exp $"); /*- * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver @@ -1875,8 +1875,9 @@ iwi_get_table0(struct iwi_softc *sc, uint32_t *tbl) { uint32_t size, buf[128]; + memset(buf, 0, sizeof buf); + if (!(sc->flags & IWI_FLAG_FW_INITED)) { - memset(buf, 0, sizeof buf); return copyout(buf, tbl, sizeof buf); } |
