Module Name:    src
Committed By:   riastradh
Date:           Fri Aug 12 19:13:36 UTC 2022

Modified Files:
        src/sys/dev/usb: if_rum.c

Log Message:
rum(4): Avoid uninitialized garbage in failed register read.

Reported-by: syzbot+f2cba71b1b1bc9102...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=7a01863d0fe34a4946516388c436991ba2beaa63


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_rum.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_rum.c
diff -u src/sys/dev/usb/if_rum.c:1.69 src/sys/dev/usb/if_rum.c:1.70
--- src/sys/dev/usb/if_rum.c:1.69	Sun Mar 15 23:04:50 2020
+++ src/sys/dev/usb/if_rum.c	Fri Aug 12 19:13:36 2022
@@ -1,5 +1,5 @@
 /*	$OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $	*/
-/*	$NetBSD: if_rum.c,v 1.69 2020/03/15 23:04:50 thorpej Exp $	*/
+/*	$NetBSD: if_rum.c,v 1.70 2022/08/12 19:13:36 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini <damien.bergam...@free.fr>
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.69 2020/03/15 23:04:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.70 2022/08/12 19:13:36 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1407,6 +1407,7 @@ rum_eeprom_read(struct rum_softc *sc, ui
 	if (error != 0) {
 		printf("%s: could not read EEPROM: %s\n",
 		    device_xname(sc->sc_dev), usbd_errstr(error));
+		memset(buf, 0, len);
 	}
 }
 
@@ -1436,6 +1437,7 @@ rum_read_multi(struct rum_softc *sc, uin
 	if (error != 0) {
 		printf("%s: could not multi read MAC register: %s\n",
 		    device_xname(sc->sc_dev), usbd_errstr(error));
+		memset(buf, 0, len);
 	}
 }
 

Reply via email to