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>
#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