]> git.baikalelectronics.ru Git - kernel.git/commit
net-packet: fix null pointer exception in rollover mode
authorWillem de Bruijn <willemb@google.com>
Sun, 17 May 2015 23:44:02 +0000 (19:44 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 May 2015 02:41:38 +0000 (22:41 -0400)
commit3de4d8e95c8f89098214c0e8380b1b11b114ac5b
treea6e18702deaeda1c0158a0f75962665c44b4694e
parent8849bf8d9868b6b9d2337f96acc6fe16028e17ba
net-packet: fix null pointer exception in rollover mode

Rollover can be enabled as flag or mode. Allocate state in both cases.
This solves a NULL pointer exception in fanout_demux_rollover on
referencing po->rollover if using mode rollover.

Also make sure that in rollover mode each silo is tried (contrary
to rollover flag, where the main socket is excluded after an initial
try_self).

Tested:
  Passes tools/testing/net/psock_fanout.c, which tests both modes and
  flag. My previous tests were limited to bench_rollover, which only
  stresses the flag. The test now completes safely. it still gives an
  error for mode rollover, because it does not expect the new headroom
  (ROOM_NORMAL) requirement. I will send a separate patch to the test.

Fixes: 882930f9ab57 ("packet: rollover prepare: per-socket state")
Signed-off-by: Willem de Bruijn <willemb@google.com>
----

I should have run this test and caught this before submission, of
course. Apologies for the oversight.
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c