android_kernel_motorola_sm6225/net/netlabel
Paul Moore 04f81f0154 cipso: don't use IPCB() to locate the CIPSO IP option
Using the IPCB() macro to get the IPv4 options is convenient, but
unfortunately NetLabel often needs to examine the CIPSO option outside
of the scope of the IP layer in the stack.  While historically IPCB()
worked above the IP layer, due to the inclusion of the inet_skb_param
struct at the head of the {tcp,udp}_skb_cb structs, recent commit
971f10ec ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
reordered the tcp_skb_cb struct and invalidated this IPCB() trick.

This patch fixes the problem by creating a new function,
cipso_v4_optptr(), which locates the CIPSO option inside the IP header
without calling IPCB().  Unfortunately, this isn't as fast as a simple
lookup so some additional tweaks were made to limit the use of this
new function.

Cc: <stable@vger.kernel.org> # 3.18
Reported-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Tested-by: Casey Schaufler <casey@schaufler-ca.com>
2015-02-11 14:46:37 -05:00
..
Kconfig
Makefile doc: Update the email address for Paul Moore in various source files 2011-08-01 17:58:33 -07:00
netlabel_addrlist.c netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_addrlist.h netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_cipso_v4.c netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_cipso_v4.h netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_domainhash.c netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_domainhash.h netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_kapi.c cipso: don't use IPCB() to locate the CIPSO IP option 2015-02-11 14:46:37 -05:00
netlabel_mgmt.c netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_mgmt.h netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_unlabeled.c netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_unlabeled.h netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
netlabel_user.c netlabel: directly return netlbl_unlabel_genl_init() 2014-10-08 16:08:04 -04:00
netlabel_user.h netlabel: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00