forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
netdev: Always clear struct ifreq before ioctl.
It's not nice to send random stack memory to a kernel over ioctl: Uninitialized bytes in ioctl_common_pre at offset 20 inside [0x7fff8899f3c0, 40) WARNING: MemorySanitizer: use-of-uninitialized-value 0 0x1180b7f in af_inet_ioctl lib/socket-util-unix.c:417:15 1 0x1180ffd in af_inet_ifreq_ioctl lib/socket-util-unix.c:428:13 2 0x11e4fd5 in netdev_linux_set_mtu lib/netdev-linux.c:2005:13 3 0xba250b in netdev_set_mtu lib/netdev.c:1132:30 4 0x59a19f in update_mtu_ofproto ofproto/ofproto.c:3042:18 5 0x596947 in update_mtu ofproto/ofproto.c:3024:5 6 0x5976d6 in ofport_install ofproto/ofproto.c:2617:5 7 0x572e96 in update_port ofproto/ofproto.c:2893:21 8 0x57636b in ofproto_port_add ofproto/ofproto.c:2208:17 9 0x4f9e0b in iface_do_create vswitchd/bridge.c:2203:13 10 0x4f7f43 in iface_create vswitchd/bridge.c:2246:13 11 0x4f7a63 in bridge_add_ports__ vswitchd/bridge.c:1225:21 12 0x4d8ea4 in bridge_add_ports vswitchd/bridge.c:1241:5 13 0x4cce3a in bridge_reconfigure vswitchd/bridge.c:952:9 14 0x4ca156 in bridge_run vswitchd/bridge.c:3439:9 15 0x5278e7 in main vswitchd/ovs-vswitchd.c:137:9 16 0x7f9def in __libc_start_call_main 17 0x7f9def in __libc_start_main@GLIBC_2.2.5 18 0x432b14 in _start (vswitchd/ovs-vswitchd+0x432b14) We do already initialize this structure for a few ioctls, let's do that for all of them. Signed-off-by: Ilya Maximets <[email protected]>
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters