[Intel-wired-lan] [PATCH] ixgbe: pci_set_drvdata must be called before register_netdev

Tantilov, Emil S emil.s.tantilov at intel.com
Mon Jun 5 17:34:18 UTC 2017


>-----Original Message-----
>From: Jeff Mahoney [mailto:jeffm at suse.com]
>Sent: Saturday, June 03, 2017 3:01 PM
>To: Kirsher, Jeffrey T <jeffrey.t.kirsher at intel.com>; intel-wired-lan at lists.osuosl.org
>Cc: Tantilov, Emil S <emil.s.tantilov at intel.com>
>Subject: [PATCH] ixgbe: pci_set_drvdata must be called before register_netdev
>
>We call pci_set_drvdata immediately after calling register_netdev,
>which leaves a window where tasks writing to the sriov_numvfs sysfs
>attribute can sneak in and crash the kernel.  register_netdev cleans
>up after itself so placing pci_set_drvdata immediately before it
>should preserve the intent of commit 0fb6a55cc31f (ixgbe: fix crash
>on rmmod after probe fail).

This change should be OK for ixgbe, although there is an effort to avoid
the race between setting SRIOV and the probe in drivers by using the driver
lock: http://marc.info/?l=linux-kernel&m=149549349112592

Thanks,
Emil



More information about the Intel-wired-lan mailing list