]> git.baikalelectronics.ru Git - kernel.git/commit
ila: Fix crash caused by rhashtable changes
authorTom Herbert <tom@herbertland.com>
Tue, 1 Nov 2016 21:55:25 +0000 (14:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Nov 2016 19:26:02 +0000 (15:26 -0400)
commitda716dcc2db825804061755b0fe0490813f0f722
tree66dee3e9b86d122e3eb0fd40a86e885974b4004e
parent88c715e9db58677e67737c08026c788a0ac6f5d5
ila: Fix crash caused by rhashtable changes

commit 4e629a1d07431 ("rhashtable: Add rhlist interface")
added a field to rhashtable_iter so that length became 56 bytes
and would exceed the size of args in netlink_callback (which is
48 bytes). The netlink diag dump function already has been
allocating a iter structure and storing the pointed to that
in the args of netlink_callback. ila_xlat also uses
rhahstable_iter but is still putting that directly in
the arg block. Now since rhashtable_iter size is increased
we are overwriting beyond the structure. The next field
happens to be cb_mutex pointer in netlink_sock and hence the crash.

Fix is to alloc the rhashtable_iter and save it as pointer
in arg.

Tested:

  modprobe ila
  ./ip ila add loc 3333:0:0:0 loc_match 2222:0:0:1,
  ./ip ila list  # NO crash now

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ila/ila_xlat.c