From 0d1d26db42b5d206ebb75cc6dc93507f4e5b6a8a Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 13 Aug 2013 18:02:48 -0700 Subject: [PATCH] datapath: Fix RHEL compat for netdev_rx_handler_register Andrei Andone reported an oops on CentOS 6.4 when adding a device to an ovs instance. The problem is easy to reproduce and generates the following stack trace: kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle kernel paging request at ffff88033afa49c0 IP: [] 0xffff88033afa49c0 ... Call Trace: [] ? __netif_receive_skb+0x60a/0x750 [] ? enqueue_task+0x66/0x80 [] netif_receive_skb+0x58/0x60 [] napi_skb_finish+0x50/0x70 [] napi_gro_receive+0x39/0x50 [] igb_poll+0x7ec/0xc70 [igb] [] ? cpu_quiet_msk+0xc1/0x130 ... As you can see, we jumped to data rather than code. This is caused by a mistake in the compat code for netdev_rx_handler_register which sets the handler to rx_handler_data rather than rx_handler. This was introduced by commit "3e35fe3 datapath: rhel: Move RHEL OVS hook registration to netdev_rx_handler_register() backport". Reported-by: Andrei Andone Signed-off-by: Chris Wright Cc: Thomas Graf Cc: Pravin Shelar Acked-by: Kyle Mestery Reviewed-by: Thomas Graf Signed-off-by: Pravin B Shelar --- datapath/linux/compat/include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index f62bd6de0..2ceff22b3 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -98,7 +98,7 @@ static inline int netdev_rx_handler_register(struct net_device *dev, #ifdef HAVE_RHEL_OVS_HOOK rcu_assign_pointer(dev->ax25_ptr, rx_handler_data); nr_bridges++; - rcu_assign_pointer(openvswitch_handle_frame_hook, rx_handler_data); + rcu_assign_pointer(openvswitch_handle_frame_hook, rx_handler); #else if (dev->br_port) return -EBUSY; -- 2.43.0