Thread (17 messages) flat view 17 messages, 3 authors, 2017-03-07

Re: [PATCH net 1/7] bnx2x: prevent crash when accessing PTP with interface down

From: Michal Schmidt <hidden>
Date: 2017-03-06 14:47:14

Dne 5.3.2017 v 10:43 Mintz, Yuval napsal(a):
quoted
It is possible to crash the kernel by accessing a PTP device while its
associated bnx2x interface is down. Before the interface is brought up, the
timecounter is not initialized, so accessing it results in NULL dereference.

Fix it by checking if the interface is up.

Use -ENETDOWN as the error code when the interface is down.
 -EFAULT in bnx2x_ptp_adjfreq() did not seem right.

Tested using phc_ctl get/set/adj/freq commands.

Signed-off-by: Michal Schmidt <redacted>
While I have no objections to the patch contents, does it even make
sense to try adjusting frequencies on a DOWNed interface?
Wouldn't it make more sense checking this in the calling context
Instead?
The caller does not know. A PTP device is not necessarily associated 
with a net device.

Michal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help