Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af94bf6d authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller
Browse files

ixgbe: Fix use after free on module remove



While testing the TCP changes I had to fix an issue in order to be able to
load and unload the module.

The recent patch that added thermal sensor support added a use after free
bug on module unload with an 82598 adapter in the system.  To resolve the
issue I have updated the code so that when we free the info_kobj we set it
back to NULL.

I suspect there are likely other bugs present, but I will leave that for
another patch that can undergo more testing.

I am submitting this directly to net-next since this fixes a fairly serious
bug that will lock up the ixgbe module until the system is rebooted.

Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34a802a5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -185,8 +185,10 @@ static void ixgbe_sysfs_del_adapter(struct ixgbe_adapter *adapter)
		hwmon_device_unregister(adapter->ixgbe_hwmon_buff.device);
#endif /* CONFIG_IXGBE_HWMON */

	if (adapter->info_kobj != NULL)
	if (adapter->info_kobj != NULL) {
		kobject_put(adapter->info_kobj);
		adapter->info_kobj = NULL;
	}
}

/* called from ixgbe_main.c */