Skip to content

Commit

Permalink
datapath: compat: Fix compilation issue with grsecurity patch
Browse files Browse the repository at this point in the history
Grsecurity patch enables GCC's constify plugin so that it will
automatically constify a class of type that contains only function
pointers.  However, if the type is also specified by __read_mostly, it
will put the constify object into the read_mostly section that results
in compilation error.  This patch works around the compilation issue by
disabling __ready_mostly when grsecurity patch is applied.

Tested with 4.14.33 kernel with grsecurity patch.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
  • Loading branch information
YiHungWei authored and blp committed Oct 15, 2018
1 parent e670355 commit 1556fcc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions datapath/compat.h
Expand Up @@ -28,6 +28,13 @@
#include <net/netfilter/ipv6/nf_defrag_ipv6.h>
#include <net/netfilter/nf_conntrack_count.h>

/* Fix grsecurity patch compilation issue. */
#ifdef CONSTIFY_PLUGIN
#include <linux/cache.h>
#undef __read_mostly
#define __read_mostly
#endif

/* Even though vanilla 3.10 kernel has grp->id, RHEL 7 kernel is missing
* this field. */
#ifdef HAVE_GENL_MULTICAST_GROUP_WITH_ID
Expand Down

0 comments on commit 1556fcc

Please sign in to comment.