Mailinglist Archive: opensuse-bugs (6095 mails)

< Previous Next >
[Bug 1075876] Kernel Oops, null pointer dereference in timecounter_read
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Mon, 16 Apr 2018 06:44:55 +0000
  • Message-id: <bug-1075876-21960-dV53w4NICk@http.bugzilla.suse.com/>
http://bugzilla.suse.com/show_bug.cgi?id=1075876
http://bugzilla.suse.com/show_bug.cgi?id=1075876#c6

--- Comment #6 from Takashi Iwai <tiwai@xxxxxxxx> ---
Sorry, I've overlooked the last update since I was on vacation.

So the crash comes at timercounter_read(), and it's likely an uninitialized
timecounter struct. Maybe e1000e_phc_gettime() gets called before
e1000e_phc_settime()? As far as I read the code, the driver initializes the
adapter->tc only at *_settime().

If my guess is correct, the fix would be to initialize adapter->tc at the
beginning, e.g.

diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c
b/drivers/net/ethernet/int\
el/e1000e/ptp.c
--- a/drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/drivers/net/ethernet/intel/e1000e/ptp.c
@@ -324,6 +324,8 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)
e1000e_phc_getcrosststamp;
#endif/*CONFIG_E1000E_HWTS*/

+ timecounter_init(&adapter->tc, &adapter->cc, 0);
+
INIT_DELAYED_WORK(&adapter->systim_overflow_work,
e1000e_systim_overflow_work);

--
You are receiving this mail because:
You are on the CC list for the bug.
< Previous Next >