From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QwagV-0006go-Mg for garchives@archives.gentoo.org; Thu, 25 Aug 2011 14:13:32 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0D4FE21C255; Thu, 25 Aug 2011 14:13:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7274321C255 for ; Thu, 25 Aug 2011 14:13:23 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BE7111B400F for ; Thu, 25 Aug 2011 14:13:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 23A8E80040 for ; Thu, 25 Aug 2011 14:13:22 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <6c09e551b5af7bf993e2c192a5df4613fb93d1b9.blueness@gentoo> Subject: [gentoo-commits] proj/hardened-patchset:master commit in: 3.0.3/, 2.6.32/ X-VCS-Repository: proj/hardened-patchset X-VCS-Files: 2.6.32/0000_README 2.6.32/4420_grsecurity-2.2.2-2.6.32.45-201108232250.patch 2.6.32/4420_grsecurity-2.2.2-2.6.32.45-201108241901.patch 3.0.3/0000_README 3.0.3/4420_grsecurity-2.2.2-3.0.3-201108232250.patch 3.0.3/4420_grsecurity-2.2.2-3.0.3-201108241901.patch X-VCS-Directories: 3.0.3/ 2.6.32/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 6c09e551b5af7bf993e2c192a5df4613fb93d1b9 Date: Thu, 25 Aug 2011 14:13:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 1ba358f688d12325c6515355cc7219c3 commit: 6c09e551b5af7bf993e2c192a5df4613fb93d1b9 Author: Anthony G. Basile gentoo org> AuthorDate: Thu Aug 25 14:13:05 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Thu Aug 25 14:13:05 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/hardened-patc= hset.git;a=3Dcommit;h=3D6c09e551 Grsec/PaX: 2.2.2-2.6.32.45-201108241901 + 2.2.2-3.0.3-201108241901 --- 2.6.32/0000_README | 2 +- ..._grsecurity-2.2.2-2.6.32.45-201108241901.patch} | 112 ++++++-- 3.0.3/0000_README | 2 +- ...4420_grsecurity-2.2.2-3.0.3-201108241901.patch} | 280 ++++++++++++++= ++++-- 4 files changed, 348 insertions(+), 48 deletions(-) diff --git a/2.6.32/0000_README b/2.6.32/0000_README index cc96783..7e4facf 100644 --- a/2.6.32/0000_README +++ b/2.6.32/0000_README @@ -11,7 +11,7 @@ Patch: 1044_linux-2.6.32.45.patch From: http://www.kernel.org Desc: Linux 2.6.39.45 =20 -Patch: 4420_grsecurity-2.2.2-2.6.32.45-201108232250.patch +Patch: 4420_grsecurity-2.2.2-2.6.32.45-201108241901.patch From: http://www.grsecurity.net Desc: hardened-sources base patch from upstream grsecurity =20 diff --git a/2.6.32/4420_grsecurity-2.2.2-2.6.32.45-201108232250.patch b/= 2.6.32/4420_grsecurity-2.2.2-2.6.32.45-201108241901.patch similarity index 99% rename from 2.6.32/4420_grsecurity-2.2.2-2.6.32.45-201108232250.patch rename to 2.6.32/4420_grsecurity-2.2.2-2.6.32.45-201108241901.patch index 39b00d8..04d05d6 100644 --- a/2.6.32/4420_grsecurity-2.2.2-2.6.32.45-201108232250.patch +++ b/2.6.32/4420_grsecurity-2.2.2-2.6.32.45-201108241901.patch @@ -15648,6 +15648,17 @@ diff -urNp linux-2.6.32.45/arch/x86/kernel/kprob= es.c linux-2.6.32.45/arch/x86/ke return ret; =20 switch (val) { +diff -urNp linux-2.6.32.45/arch/x86/kernel/kvm.c linux-2.6.32.45/arch/x8= 6/kernel/kvm.c +--- linux-2.6.32.45/arch/x86/kernel/kvm.c 2011-03-27 14:31:47.000000000 = -0400 ++++ linux-2.6.32.45/arch/x86/kernel/kvm.c 2011-08-24 18:35:52.000000000 = -0400 +@@ -216,6 +216,7 @@ static void __init paravirt_ops_setup(vo + pv_mmu_ops.set_pud =3D kvm_set_pud; + #if PAGETABLE_LEVELS =3D=3D 4 + pv_mmu_ops.set_pgd =3D kvm_set_pgd; ++ pv_mmu_ops.set_pgd_batched =3D kvm_set_pgd; + #endif + #endif + pv_mmu_ops.flush_tlb_user =3D kvm_flush_tlb; diff -urNp linux-2.6.32.45/arch/x86/kernel/ldt.c linux-2.6.32.45/arch/x8= 6/kernel/ldt.c --- linux-2.6.32.45/arch/x86/kernel/ldt.c 2011-03-27 14:31:47.000000000 = -0400 +++ linux-2.6.32.45/arch/x86/kernel/ldt.c 2011-04-17 15:56:46.000000000 = -0400 @@ -23921,7 +23932,7 @@ diff -urNp linux-2.6.32.45/arch/x86/xen/enlighten= .c linux-2.6.32.45/arch/x86/xen pgd =3D (pgd_t *)xen_start_info->pt_base; diff -urNp linux-2.6.32.45/arch/x86/xen/mmu.c linux-2.6.32.45/arch/x86/x= en/mmu.c --- linux-2.6.32.45/arch/x86/xen/mmu.c 2011-07-13 17:23:04.000000000 -04= 00 -+++ linux-2.6.32.45/arch/x86/xen/mmu.c 2011-07-13 17:23:18.000000000 -04= 00 ++++ linux-2.6.32.45/arch/x86/xen/mmu.c 2011-08-24 18:35:52.000000000 -04= 00 @@ -1719,6 +1719,8 @@ __init pgd_t *xen_setup_kernel_pagetable convert_pfn_mfn(init_level4_pgt); convert_pfn_mfn(level3_ident_pgt); @@ -23942,6 +23953,22 @@ diff -urNp linux-2.6.32.45/arch/x86/xen/mmu.c li= nux-2.6.32.45/arch/x86/xen/mmu.c set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO); set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO); =20 +@@ -1860,6 +1865,7 @@ static __init void xen_post_allocator_in + pv_mmu_ops.set_pud =3D xen_set_pud; + #if PAGETABLE_LEVELS =3D=3D 4 + pv_mmu_ops.set_pgd =3D xen_set_pgd; ++ pv_mmu_ops.set_pgd_batched =3D xen_set_pgd; + #endif +=20 + /* This will work as long as patching hasn't happened yet +@@ -1946,6 +1952,7 @@ static const struct pv_mmu_ops xen_mmu_o + .pud_val =3D PV_CALLEE_SAVE(xen_pud_val), + .make_pud =3D PV_CALLEE_SAVE(xen_make_pud), + .set_pgd =3D xen_set_pgd_hyper, ++ .set_pgd_batched =3D xen_set_pgd_hyper, +=20 + .alloc_pud =3D xen_alloc_pmd_init, + .release_pud =3D xen_release_pmd_init, diff -urNp linux-2.6.32.45/arch/x86/xen/smp.c linux-2.6.32.45/arch/x86/x= en/smp.c --- linux-2.6.32.45/arch/x86/xen/smp.c 2011-03-27 14:31:47.000000000 -04= 00 +++ linux-2.6.32.45/arch/x86/xen/smp.c 2011-05-11 18:25:15.000000000 -04= 00 @@ -66730,7 +66757,7 @@ diff -urNp linux-2.6.32.45/localversion-grsec lin= ux-2.6.32.45/localversion-grsec +-grsec diff -urNp linux-2.6.32.45/Makefile linux-2.6.32.45/Makefile --- linux-2.6.32.45/Makefile 2011-08-16 20:37:25.000000000 -0400 -+++ linux-2.6.32.45/Makefile 2011-08-23 21:19:01.000000000 -0400 ++++ linux-2.6.32.45/Makefile 2011-08-24 18:35:52.000000000 -0400 @@ -221,8 +221,9 @@ CONFIG_SHELL :=3D $(shell if [ -x "$$BASH" =20 HOSTCC =3D gcc @@ -66778,7 +66805,7 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32.= 45/Makefile include/linux/version.h headers_% \ kernelrelease kernelversion =20 -@@ -526,6 +530,25 @@ else +@@ -526,6 +530,24 @@ else KBUILD_CFLAGS +=3D -O2 endif =20 @@ -66787,7 +66814,6 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32.= 45/Makefile +ifdef CONFIG_PAX_MEMORY_STACKLEAK +STACKLEAK_PLUGIN :=3D -fplugin=3D$(objtree)/tools/gcc/stackleak_plugin.= so -fplugin-arg-stackleak_plugin-track-lowest-sp=3D100 +endif -+KBUILD_CFLAGS +=3D $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) +export CONSTIFY_PLUGIN STACKLEAK_PLUGIN +gcc-plugins: + $(Q)$(MAKE) $(build)=3Dtools/gcc @@ -66804,7 +66830,7 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32.= 45/Makefile include $(srctree)/arch/$(SRCARCH)/Makefile =20 ifneq ($(CONFIG_FRAME_WARN),0) -@@ -644,7 +667,7 @@ export mod_strip_cmd +@@ -644,7 +666,7 @@ export mod_strip_cmd =20 =20 ifeq ($(KBUILD_EXTMOD),) @@ -66813,6 +66839,14 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32= .45/Makefile =20 vmlinux-dirs :=3D $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ +@@ -840,6 +862,7 @@ define rule_vmlinux-modpost + endef +=20 + # vmlinux image - including updated kernel symbols ++vmlinux: KBUILD_CFLAGS +=3D $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) + vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o $(kal= lsyms.o) FORCE + ifdef CONFIG_HEADERS_CHECK + $(Q)$(MAKE) -f $(srctree)/Makefile headers_check @@ -970,7 +993,7 @@ ifneq ($(KBUILD_SRC),) endif =20 @@ -66822,7 +66856,15 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32= .45/Makefile =20 prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ include/asm include/config/auto.conf -@@ -1198,7 +1221,7 @@ MRPROPER_FILES +=3D .config .config.old in +@@ -1124,6 +1147,7 @@ all: modules + # using awk while concatenating to the final file. +=20 + PHONY +=3D modules ++modules: KBUILD_CFLAGS +=3D $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) + modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) + $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=3D$(objtree)/%/modules.order) = > $(objtree)/modules.order + @$(kecho) ' Building modules, stage 2.'; +@@ -1198,7 +1222,7 @@ MRPROPER_FILES +=3D .config .config.old in include/linux/autoconf.h include/linux/version.h = \ include/linux/utsrelease.h = \ include/linux/bounds.h include/asm*/asm-offsets.h = \ @@ -66831,7 +66873,7 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32.= 45/Makefile =20 # clean - Delete most, but leave enough to build external modules # -@@ -1242,7 +1265,7 @@ distclean: mrproper +@@ -1242,7 +1266,7 @@ distclean: mrproper @find $(srctree) $(RCS_FIND_IGNORE) \ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ @@ -66840,7 +66882,7 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32.= 45/Makefile -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ -type f -print | xargs rm -f =20 -@@ -1289,6 +1312,7 @@ help: +@@ -1289,6 +1313,7 @@ help: @echo ' modules_prepare - Set up for building external modules' @echo ' tags/TAGS - Generate tags file for editors' @echo ' cscope - Generate cscope index' @@ -66848,7 +66890,7 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32.= 45/Makefile @echo ' kernelrelease - Output the release version string' @echo ' kernelversion - Output the version stored in Makefile' @echo ' headers_install - Install sanitised kernel headers to INSTAL= L_HDR_PATH'; \ -@@ -1421,7 +1445,7 @@ clean: $(clean-dirs) +@@ -1421,7 +1446,7 @@ clean: $(clean-dirs) $(call cmd,rmdirs) $(call cmd,rmfiles) @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ @@ -66857,7 +66899,7 @@ diff -urNp linux-2.6.32.45/Makefile linux-2.6.32.= 45/Makefile -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ -o -name '*.gcno' \) -type f -print | xargs rm -f =20 -@@ -1445,7 +1469,7 @@ endif # KBUILD_EXTMOD +@@ -1445,7 +1470,7 @@ endif # KBUILD_EXTMOD quiet_cmd_tags =3D GEN $@ cmd_tags =3D $(CONFIG_SHELL) $(srctree)/scripts/tags.sh $@ =20 @@ -71867,6 +71909,27 @@ diff -urNp linux-2.6.32.45/net/ipv6/inet6_hashta= bles.c linux-2.6.32.45/net/ipv6/ const unsigned short hnum, const struct in6_addr *daddr, const int dif) +diff -urNp linux-2.6.32.45/net/ipv6/ip6_tunnel.c linux-2.6.32.45/net/ipv= 6/ip6_tunnel.c +--- linux-2.6.32.45/net/ipv6/ip6_tunnel.c 2011-08-09 18:35:30.000000000 = -0400 ++++ linux-2.6.32.45/net/ipv6/ip6_tunnel.c 2011-08-24 18:52:25.000000000 = -0400 +@@ -1466,7 +1466,7 @@ static int __init ip6_tunnel_init(void) + { + int err; +=20 +- err =3D register_pernet_device(&ip6_tnl_net_ops); ++ err =3D register_pernet_gen_device(&ip6_tnl_net_id, &ip6_tnl_net_ops); + if (err < 0) + goto out_pernet; +=20 +@@ -1487,7 +1487,7 @@ static int __init ip6_tunnel_init(void) + out_ip6ip6: + xfrm6_tunnel_deregister(&ip4ip6_handler, AF_INET); + out_ip4ip6: +- unregister_pernet_device(&ip6_tnl_net_ops); ++ unregister_pernet_gen_device(ip6_tnl_net_id, &ip6_tnl_net_ops); + out_pernet: + return err; + } diff -urNp linux-2.6.32.45/net/ipv6/ipv6_sockglue.c linux-2.6.32.45/net/= ipv6/ipv6_sockglue.c --- linux-2.6.32.45/net/ipv6/ipv6_sockglue.c 2011-03-27 14:31:47.0000000= 00 -0400 +++ linux-2.6.32.45/net/ipv6/ipv6_sockglue.c 2011-05-16 21:46:57.0000000= 00 -0400 @@ -76073,8 +76136,8 @@ diff -urNp linux-2.6.32.45/sound/usb/usbaudio.c l= inux-2.6.32.45/sound/usb/usbaud } diff -urNp linux-2.6.32.45/tools/gcc/constify_plugin.c linux-2.6.32.45/t= ools/gcc/constify_plugin.c --- linux-2.6.32.45/tools/gcc/constify_plugin.c 1969-12-31 19:00:00.0000= 00000 -0500 -+++ linux-2.6.32.45/tools/gcc/constify_plugin.c 2011-08-23 22:33:42.0000= 00000 -0400 -@@ -0,0 +1,258 @@ ++++ linux-2.6.32.45/tools/gcc/constify_plugin.c 2011-08-24 18:36:35.0000= 00000 -0400 +@@ -0,0 +1,259 @@ +/* + * Copyright 2011 by Emese Revfy + * Licensed under the GPL v2, or (at your option) v3 @@ -76099,26 +76162,30 @@ diff -urNp linux-2.6.32.45/tools/gcc/constify_p= lugin.c linux-2.6.32.45/tools/gcc +#include "function.h" +#include "tree-flow.h" +#include "plugin.h" ++//#include "c-tree.h" ++ ++#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1 (TYPE) + +int plugin_is_GPL_compatible; + +static struct plugin_info const_plugin_info =3D { -+ .version =3D "20110817", ++ .version =3D "20110824", + .help =3D "no-constify\tturn off constification\n", +}; + +static bool walk_struct(tree node); + -+static void deconstify_node(tree node) ++static void deconstify_node(tree type) +{ + tree field; + -+ for (field =3D TYPE_FIELDS(node); field; field =3D TREE_CHAIN(field)) = { ++ C_TYPE_FIELDS_READONLY(type) =3D 0; ++ for (field =3D TYPE_FIELDS(type); field; field =3D TREE_CHAIN(field)) = { + enum tree_code code =3D TREE_CODE(TREE_TYPE(field)); + if (code =3D=3D RECORD_TYPE || code =3D=3D UNION_TYPE) + deconstify_node(TREE_TYPE(field)); + TREE_READONLY(field) =3D 0; -+ TREE_READONLY(TREE_TYPE(field)) =3D 0; ++ TYPE_READONLY(TREE_TYPE(field)) =3D 0; + } +} + @@ -76157,7 +76224,7 @@ diff -urNp linux-2.6.32.45/tools/gcc/constify_plu= gin.c linux-2.6.32.45/tools/gcc + return NULL_TREE; + } + -+ if (TREE_CODE(*node) =3D=3D TYPE_DECL && !TREE_READONLY(type)) { ++ if (TREE_CODE(*node) =3D=3D TYPE_DECL && !TYPE_READONLY(type)) { + error("%qE attribute used on type that is not constified", name); + return NULL_TREE; + } @@ -76234,9 +76301,6 @@ diff -urNp linux-2.6.32.45/tools/gcc/constify_plu= gin.c linux-2.6.32.45/tools/gcc + if (TREE_READONLY(node)) + return; + -+ if (TYPE_FIELDS(node) =3D=3D NULL_TREE) -+ return; -+ + if (walk_struct(node)) + constify_node(node); +} @@ -76266,10 +76330,10 @@ diff -urNp linux-2.6.32.45/tools/gcc/constify_p= lugin.c linux-2.6.32.45/tools/gcc + tree var; + referenced_var_iterator rvi; + -+#if __GNUC_MINOR__ >=3D 6 -+ FOR_EACH_REFERENCED_VAR(cfun, var, rvi) { -+#else ++#if __GNUC__ =3D=3D 4 && __GNUC_MINOR__ =3D=3D 5 + FOR_EACH_REFERENCED_VAR(var, rvi) { ++#else ++ FOR_EACH_REFERENCED_VAR(cfun, var, rvi) { +#endif + tree type =3D TREE_TYPE(var); + @@ -76279,7 +76343,7 @@ diff -urNp linux-2.6.32.45/tools/gcc/constify_plu= gin.c linux-2.6.32.45/tools/gcc + if (TREE_CODE(type) !=3D RECORD_TYPE && TREE_CODE(type) !=3D UNION_TY= PE) + continue; + -+ if (!TREE_READONLY(type)) ++ if (!TYPE_READONLY(type)) + continue; + +// if (lookup_attribute("no_const", DECL_ATTRIBUTES(var))) diff --git a/3.0.3/0000_README b/3.0.3/0000_README index 9c49f62..de82649 100644 --- a/3.0.3/0000_README +++ b/3.0.3/0000_README @@ -3,7 +3,7 @@ README =20 Individual Patch Descriptions: ------------------------------------------------------------------------= ----- -Patch: 4420_grsecurity-2.2.2-3.0.3-201108232250.patch +Patch: 4420_grsecurity-2.2.2-3.0.3-201108241901.patch From: http://www.grsecurity.net Desc: hardened-sources base patch from upstream grsecurity =20 diff --git a/3.0.3/4420_grsecurity-2.2.2-3.0.3-201108232250.patch b/3.0.3= /4420_grsecurity-2.2.2-3.0.3-201108241901.patch similarity index 99% rename from 3.0.3/4420_grsecurity-2.2.2-3.0.3-201108232250.patch rename to 3.0.3/4420_grsecurity-2.2.2-3.0.3-201108241901.patch index ea2c3ff..a30bf0f 100644 --- a/3.0.3/4420_grsecurity-2.2.2-3.0.3-201108232250.patch +++ b/3.0.3/4420_grsecurity-2.2.2-3.0.3-201108241901.patch @@ -13561,6 +13561,17 @@ diff -urNp linux-3.0.3/arch/x86/kernel/kprobes.c= linux-3.0.3/arch/x86/kernel/kpr RELATIVE_ADDR_SIZE); =20 insn_buf[0] =3D RELATIVEJUMP_OPCODE; +diff -urNp linux-3.0.3/arch/x86/kernel/kvm.c linux-3.0.3/arch/x86/kernel= /kvm.c +--- linux-3.0.3/arch/x86/kernel/kvm.c 2011-07-21 22:17:23.000000000 -040= 0 ++++ linux-3.0.3/arch/x86/kernel/kvm.c 2011-08-24 18:10:12.000000000 -040= 0 +@@ -426,6 +426,7 @@ static void __init paravirt_ops_setup(vo + pv_mmu_ops.set_pud =3D kvm_set_pud; + #if PAGETABLE_LEVELS =3D=3D 4 + pv_mmu_ops.set_pgd =3D kvm_set_pgd; ++ pv_mmu_ops.set_pgd_batched =3D kvm_set_pgd; + #endif + #endif + pv_mmu_ops.flush_tlb_user =3D kvm_flush_tlb; diff -urNp linux-3.0.3/arch/x86/kernel/ldt.c linux-3.0.3/arch/x86/kernel= /ldt.c --- linux-3.0.3/arch/x86/kernel/ldt.c 2011-07-21 22:17:23.000000000 -040= 0 +++ linux-3.0.3/arch/x86/kernel/ldt.c 2011-08-23 21:47:55.000000000 -040= 0 @@ -21380,7 +21391,7 @@ diff -urNp linux-3.0.3/arch/x86/xen/enlighten.c l= inux-3.0.3/arch/x86/xen/enlight #ifdef CONFIG_ACPI_NUMA diff -urNp linux-3.0.3/arch/x86/xen/mmu.c linux-3.0.3/arch/x86/xen/mmu.c --- linux-3.0.3/arch/x86/xen/mmu.c 2011-07-21 22:17:23.000000000 -0400 -+++ linux-3.0.3/arch/x86/xen/mmu.c 2011-08-23 21:47:55.000000000 -0400 ++++ linux-3.0.3/arch/x86/xen/mmu.c 2011-08-24 18:10:12.000000000 -0400 @@ -1679,6 +1679,8 @@ pgd_t * __init xen_setup_kernel_pagetabl convert_pfn_mfn(init_level4_pgt); convert_pfn_mfn(level3_ident_pgt); @@ -21401,6 +21412,22 @@ diff -urNp linux-3.0.3/arch/x86/xen/mmu.c linux-= 3.0.3/arch/x86/xen/mmu.c set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO); set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO); =20 +@@ -1909,6 +1914,7 @@ static void __init xen_post_allocator_in + pv_mmu_ops.set_pud =3D xen_set_pud; + #if PAGETABLE_LEVELS =3D=3D 4 + pv_mmu_ops.set_pgd =3D xen_set_pgd; ++ pv_mmu_ops.set_pgd_batched =3D xen_set_pgd; + #endif +=20 + /* This will work as long as patching hasn't happened yet +@@ -1990,6 +1996,7 @@ static const struct pv_mmu_ops xen_mmu_o + .pud_val =3D PV_CALLEE_SAVE(xen_pud_val), + .make_pud =3D PV_CALLEE_SAVE(xen_make_pud), + .set_pgd =3D xen_set_pgd_hyper, ++ .set_pgd_batched =3D xen_set_pgd_hyper, +=20 + .alloc_pud =3D xen_alloc_pmd_init, + .release_pud =3D xen_release_pmd_init, diff -urNp linux-3.0.3/arch/x86/xen/smp.c linux-3.0.3/arch/x86/xen/smp.c --- linux-3.0.3/arch/x86/xen/smp.c 2011-07-21 22:17:23.000000000 -0400 +++ linux-3.0.3/arch/x86/xen/smp.c 2011-08-23 21:47:55.000000000 -0400 @@ -21829,6 +21856,58 @@ diff -urNp linux-3.0.3/drivers/acpi/apei/cper.c = linux-3.0.3/drivers/acpi/apei/cp } EXPORT_SYMBOL_GPL(cper_next_record_id); =20 +diff -urNp linux-3.0.3/drivers/acpi/ec_sys.c linux-3.0.3/drivers/acpi/ec= _sys.c +--- linux-3.0.3/drivers/acpi/ec_sys.c 2011-07-21 22:17:23.000000000 -040= 0 ++++ linux-3.0.3/drivers/acpi/ec_sys.c 2011-08-24 19:06:55.000000000 -040= 0 +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + #include "internal.h" +=20 + MODULE_AUTHOR("Thomas Renninger "); +@@ -39,7 +40,7 @@ static ssize_t acpi_ec_read_io(struct fi + * struct acpi_ec *ec =3D ((struct seq_file *)f->private_data)->privat= e; + */ + unsigned int size =3D EC_SPACE_SIZE; +- u8 *data =3D (u8 *) buf; ++ u8 data; + loff_t init_off =3D *off; + int err =3D 0; +=20 +@@ -52,9 +53,11 @@ static ssize_t acpi_ec_read_io(struct fi + size =3D count; +=20 + while (size) { +- err =3D ec_read(*off, &data[*off - init_off]); ++ err =3D ec_read(*off, &data); + if (err) + return err; ++ if (put_user(data, &buf[*off - init_off])) ++ return -EFAULT; + *off +=3D 1; + size--; + } +@@ -70,7 +73,6 @@ static ssize_t acpi_ec_write_io(struct f +=20 + unsigned int size =3D count; + loff_t init_off =3D *off; +- u8 *data =3D (u8 *) buf; + int err =3D 0; +=20 + if (*off >=3D EC_SPACE_SIZE) +@@ -81,7 +83,9 @@ static ssize_t acpi_ec_write_io(struct f + } +=20 + while (size) { +- u8 byte_write =3D data[*off - init_off]; ++ u8 byte_write; ++ if (get_user(byte_write, &buf[*off - init_off])) ++ return -EFAULT; + err =3D ec_write(*off, byte_write); + if (err) + return err; diff -urNp linux-3.0.3/drivers/acpi/proc.c linux-3.0.3/drivers/acpi/proc= .c --- linux-3.0.3/drivers/acpi/proc.c 2011-07-21 22:17:23.000000000 -0400 +++ linux-3.0.3/drivers/acpi/proc.c 2011-08-23 21:47:55.000000000 -0400 @@ -27197,6 +27276,48 @@ diff -urNp linux-3.0.3/drivers/media/dvb/dvb-cor= e/dvb_ca_en50221.c linux-3.0.3/d dprintk("%s\n", __func__); =20 /* Incoming packet has a 2 byte header. hdr[0] =3D slot_id, hdr[1] =3D= connection_id */ +diff -urNp linux-3.0.3/drivers/media/dvb/dvb-core/dvb_demux.h linux-3.0.= 3/drivers/media/dvb/dvb-core/dvb_demux.h +--- linux-3.0.3/drivers/media/dvb/dvb-core/dvb_demux.h 2011-07-21 22:17:= 23.000000000 -0400 ++++ linux-3.0.3/drivers/media/dvb/dvb-core/dvb_demux.h 2011-08-24 18:24:= 40.000000000 -0400 +@@ -68,12 +68,12 @@ struct dvb_demux_feed { + union { + struct dmx_ts_feed ts; + struct dmx_section_feed sec; +- } feed; ++ } __no_const feed; +=20 + union { + dmx_ts_cb ts; + dmx_section_cb sec; +- } cb; ++ } __no_const cb; +=20 + struct dvb_demux *demux; + void *priv; +diff -urNp linux-3.0.3/drivers/media/dvb/dvb-core/dvbdev.c linux-3.0.3/d= rivers/media/dvb/dvb-core/dvbdev.c +--- linux-3.0.3/drivers/media/dvb/dvb-core/dvbdev.c 2011-07-21 22:17:23.= 000000000 -0400 ++++ linux-3.0.3/drivers/media/dvb/dvb-core/dvbdev.c 2011-08-24 18:24:19.= 000000000 -0400 +@@ -192,7 +192,7 @@ int dvb_register_device(struct dvb_adapt + const struct dvb_device *template, void *priv, int type) + { + struct dvb_device *dvbdev; +- struct file_operations *dvbdevfops; ++ file_operations_no_const *dvbdevfops; + struct device *clsdev; + int minor; + int id; +diff -urNp linux-3.0.3/drivers/media/dvb/dvb-usb/cxusb.c linux-3.0.3/dri= vers/media/dvb/dvb-usb/cxusb.c +--- linux-3.0.3/drivers/media/dvb/dvb-usb/cxusb.c 2011-07-21 22:17:23.00= 0000000 -0400 ++++ linux-3.0.3/drivers/media/dvb/dvb-usb/cxusb.c 2011-08-24 18:26:33.00= 0000000 -0400 +@@ -1059,7 +1059,7 @@ static struct dib0070_config dib7070p_di + struct dib0700_adapter_state { + int (*set_param_save) (struct dvb_frontend *, + struct dvb_frontend_parameters *); +-}; ++} __no_const; +=20 + static int dib7070_set_param_override(struct dvb_frontend *fe, + struct dvb_frontend_parameters *fep) diff -urNp linux-3.0.3/drivers/media/dvb/dvb-usb/dib0700_core.c linux-3.= 0.3/drivers/media/dvb/dvb-usb/dib0700_core.c --- linux-3.0.3/drivers/media/dvb/dvb-usb/dib0700_core.c 2011-07-21 22:1= 7:23.000000000 -0400 +++ linux-3.0.3/drivers/media/dvb/dvb-usb/dib0700_core.c 2011-08-23 21:4= 8:14.000000000 -0400 @@ -27209,6 +27330,30 @@ diff -urNp linux-3.0.3/drivers/media/dvb/dvb-usb= /dib0700_core.c linux-3.0.3/driv while ((ret =3D dvb_usb_get_hexline(fw, &hx, &pos)) > 0) { deb_fwdata("writing to address 0x%08x (buffer: 0x%02x %02x)\n", hx.addr, hx.len, hx.chk); +diff -urNp linux-3.0.3/drivers/media/dvb/dvb-usb/dibusb.h linux-3.0.3/dr= ivers/media/dvb/dvb-usb/dibusb.h +--- linux-3.0.3/drivers/media/dvb/dvb-usb/dibusb.h 2011-07-21 22:17:23.0= 00000000 -0400 ++++ linux-3.0.3/drivers/media/dvb/dvb-usb/dibusb.h 2011-08-24 18:27:27.0= 00000000 -0400 +@@ -97,7 +97,7 @@ + #define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x02 +=20 + struct dibusb_state { +- struct dib_fe_xfer_ops ops; ++ dib_fe_xfer_ops_no_const ops; + int mt2060_present; + u8 tuner_addr; + }; +diff -urNp linux-3.0.3/drivers/media/dvb/dvb-usb/dw2102.c linux-3.0.3/dr= ivers/media/dvb/dvb-usb/dw2102.c +--- linux-3.0.3/drivers/media/dvb/dvb-usb/dw2102.c 2011-07-21 22:17:23.0= 00000000 -0400 ++++ linux-3.0.3/drivers/media/dvb/dvb-usb/dw2102.c 2011-08-24 18:27:45.0= 00000000 -0400 +@@ -95,7 +95,7 @@ struct su3000_state { +=20 + struct s6x0_state { + int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v); +-}; ++} __no_const; +=20 + /* debug */ + static int dvb_usb_dw2102_debug; diff -urNp linux-3.0.3/drivers/media/dvb/dvb-usb/lmedm04.c linux-3.0.3/d= rivers/media/dvb/dvb-usb/lmedm04.c --- linux-3.0.3/drivers/media/dvb/dvb-usb/lmedm04.c 2011-07-21 22:17:23.= 000000000 -0400 +++ linux-3.0.3/drivers/media/dvb/dvb-usb/lmedm04.c 2011-08-23 21:48:14.= 000000000 -0400 @@ -27229,6 +27374,34 @@ diff -urNp linux-3.0.3/drivers/media/dvb/dvb-usb= /lmedm04.c linux-3.0.3/drivers/m data[0] =3D 0x0a; len_in =3D 1; info("FRM Firmware Cold Reset"); +diff -urNp linux-3.0.3/drivers/media/dvb/frontends/dib3000.h linux-3.0.3= /drivers/media/dvb/frontends/dib3000.h +--- linux-3.0.3/drivers/media/dvb/frontends/dib3000.h 2011-07-21 22:17:2= 3.000000000 -0400 ++++ linux-3.0.3/drivers/media/dvb/frontends/dib3000.h 2011-08-24 18:28:1= 8.000000000 -0400 +@@ -40,10 +40,11 @@ struct dib_fe_xfer_ops + int (*pid_ctrl)(struct dvb_frontend *fe, int index, int pid, int onoff= ); + int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl= ); + }; ++typedef struct dib_fe_xfer_ops __no_const dib_fe_xfer_ops_no_const; +=20 + #if defined(CONFIG_DVB_DIB3000MB) || (defined(CONFIG_DVB_DIB3000MB_MODU= LE) && defined(MODULE)) + extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_confi= g* config, +- struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); ++ struct i2c_adapter* i2c, dib_fe_xfer_ops_no_const *xfer_ops); + #else + static inline struct dvb_frontend* dib3000mb_attach(const struct dib300= 0_config* config, + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops) +diff -urNp linux-3.0.3/drivers/media/dvb/frontends/dib3000mb.c linux-3.0= .3/drivers/media/dvb/frontends/dib3000mb.c +--- linux-3.0.3/drivers/media/dvb/frontends/dib3000mb.c 2011-07-21 22:17= :23.000000000 -0400 ++++ linux-3.0.3/drivers/media/dvb/frontends/dib3000mb.c 2011-08-24 18:28= :42.000000000 -0400 +@@ -756,7 +756,7 @@ static int dib3000mb_tuner_pass_ctrl(str + static struct dvb_frontend_ops dib3000mb_ops; +=20 + struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* conf= ig, +- struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops) ++ struct i2c_adapter* i2c, dib_fe_xfer_ops_no_const *xfer_ops) + { + struct dib3000_state* state =3D NULL; +=20 diff -urNp linux-3.0.3/drivers/media/dvb/frontends/mb86a16.c linux-3.0.3= /drivers/media/dvb/frontends/mb86a16.c --- linux-3.0.3/drivers/media/dvb/frontends/mb86a16.c 2011-07-21 22:17:2= 3.000000000 -0400 +++ linux-3.0.3/drivers/media/dvb/frontends/mb86a16.c 2011-08-23 21:48:1= 4.000000000 -0400 @@ -27322,6 +27495,18 @@ diff -urNp linux-3.0.3/drivers/media/video/saa71= 64/saa7164-cmd.c linux-3.0.3/dri while (loop) { =20 struct tmComResInfo tRsp =3D { 0, 0, 0, 0, 0, 0 }; +diff -urNp linux-3.0.3/drivers/media/video/timblogiw.c linux-3.0.3/drive= rs/media/video/timblogiw.c +--- linux-3.0.3/drivers/media/video/timblogiw.c 2011-07-21 22:17:23.0000= 00000 -0400 ++++ linux-3.0.3/drivers/media/video/timblogiw.c 2011-08-24 18:29:20.0000= 00000 -0400 +@@ -745,7 +745,7 @@ static int timblogiw_mmap(struct file *f +=20 + /* Platform device functions */ +=20 +-static __devinitconst struct v4l2_ioctl_ops timblogiw_ioctl_ops =3D { ++static __devinitconst v4l2_ioctl_ops_no_const timblogiw_ioctl_ops =3D { + .vidioc_querycap =3D timblogiw_querycap, + .vidioc_enum_fmt_vid_cap =3D timblogiw_enum_fmt, + .vidioc_g_fmt_vid_cap =3D timblogiw_g_fmt, diff -urNp linux-3.0.3/drivers/media/video/usbvision/usbvision-core.c li= nux-3.0.3/drivers/media/video/usbvision/usbvision-core.c --- linux-3.0.3/drivers/media/video/usbvision/usbvision-core.c 2011-07-2= 1 22:17:23.000000000 -0400 +++ linux-3.0.3/drivers/media/video/usbvision/usbvision-core.c 2011-08-2= 3 21:48:14.000000000 -0400 @@ -32024,7 +32209,7 @@ diff -urNp linux-3.0.3/drivers/staging/rtl8712/rt= l871x_io.h linux-3.0.3/drivers/ struct list_head list; diff -urNp linux-3.0.3/drivers/staging/sbe-2t3e3/netdev.c linux-3.0.3/dr= ivers/staging/sbe-2t3e3/netdev.c --- linux-3.0.3/drivers/staging/sbe-2t3e3/netdev.c 2011-07-21 22:17:23.0= 00000000 -0400 -+++ linux-3.0.3/drivers/staging/sbe-2t3e3/netdev.c 2011-08-23 21:48:14.0= 00000000 -0400 ++++ linux-3.0.3/drivers/staging/sbe-2t3e3/netdev.c 2011-08-24 18:21:41.0= 00000000 -0400 @@ -51,7 +51,7 @@ int t3e3_ioctl(struct net_device *dev, s t3e3_if_config(sc, cmd_2t3e3, (char *)¶m, &resp, &rlen); =20 @@ -51686,6 +51871,18 @@ diff -urNp linux-3.0.3/include/linux/fs.h linux-= 3.0.3/include/linux/fs.h =20 #define IPERM_FLAG_RCU 0x0001 =20 +diff -urNp linux-3.0.3/include/linux/fsnotify.h linux-3.0.3/include/linu= x/fsnotify.h +--- linux-3.0.3/include/linux/fsnotify.h 2011-07-21 22:17:23.000000000 -= 0400 ++++ linux-3.0.3/include/linux/fsnotify.h 2011-08-24 18:10:29.000000000 -= 0400 +@@ -314,7 +314,7 @@ static inline void fsnotify_change(struc + */ + static inline const unsigned char *fsnotify_oldname_init(const unsigned= char *name) + { +- return kstrdup(name, GFP_KERNEL); ++ return (const unsigned char *)kstrdup((const char *)name, GFP_KERNEL); + } +=20 + /* diff -urNp linux-3.0.3/include/linux/fs_struct.h linux-3.0.3/include/lin= ux/fs_struct.h --- linux-3.0.3/include/linux/fs_struct.h 2011-07-21 22:17:23.000000000 = -0400 +++ linux-3.0.3/include/linux/fs_struct.h 2011-08-23 21:47:56.000000000 = -0400 @@ -54639,6 +54836,29 @@ diff -urNp linux-3.0.3/include/linux/vmstat.h li= nux-3.0.3/include/linux/vmstat.h } =20 static inline void __dec_zone_page_state(struct page *page, +diff -urNp linux-3.0.3/include/media/saa7146_vv.h linux-3.0.3/include/me= dia/saa7146_vv.h +--- linux-3.0.3/include/media/saa7146_vv.h 2011-07-21 22:17:23.000000000= -0400 ++++ linux-3.0.3/include/media/saa7146_vv.h 2011-08-24 18:26:09.000000000= -0400 +@@ -163,7 +163,7 @@ struct saa7146_ext_vv + int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); +=20 + /* the extension can override this */ +- struct v4l2_ioctl_ops ops; ++ v4l2_ioctl_ops_no_const ops; + /* pointer to the saa7146 core ops */ + const struct v4l2_ioctl_ops *core_ops; +=20 +diff -urNp linux-3.0.3/include/media/v4l2-ioctl.h linux-3.0.3/include/me= dia/v4l2-ioctl.h +--- linux-3.0.3/include/media/v4l2-ioctl.h 2011-07-21 22:17:23.000000000= -0400 ++++ linux-3.0.3/include/media/v4l2-ioctl.h 2011-08-24 18:25:45.000000000= -0400 +@@ -272,6 +272,7 @@ struct v4l2_ioctl_ops { + long (*vidioc_default) (struct file *file, void *fh, + bool valid_prio, int cmd, void *arg); + }; ++typedef struct v4l2_ioctl_ops __no_const v4l2_ioctl_ops_no_const; +=20 +=20 + /* v4l debugging and diagnostics */ diff -urNp linux-3.0.3/include/net/caif/cfctrl.h linux-3.0.3/include/net= /caif/cfctrl.h --- linux-3.0.3/include/net/caif/cfctrl.h 2011-07-21 22:17:23.000000000 = -0400 +++ linux-3.0.3/include/net/caif/cfctrl.h 2011-08-23 21:47:56.000000000 = -0400 @@ -60155,7 +60375,7 @@ diff -urNp linux-3.0.3/localversion-grsec linux-3= .0.3/localversion-grsec +-grsec diff -urNp linux-3.0.3/Makefile linux-3.0.3/Makefile --- linux-3.0.3/Makefile 2011-08-23 21:44:40.000000000 -0400 -+++ linux-3.0.3/Makefile 2011-08-23 22:01:23.000000000 -0400 ++++ linux-3.0.3/Makefile 2011-08-24 18:10:12.000000000 -0400 @@ -245,8 +245,9 @@ CONFIG_SHELL :=3D $(shell if [ -x "$$BASH" =20 HOSTCC =3D gcc @@ -60195,7 +60415,7 @@ diff -urNp linux-3.0.3/Makefile linux-3.0.3/Makef= ile =20 # To avoid any implicit rule to kick in, define an empty command. scripts/basic/%: scripts_basic ; -@@ -564,6 +568,25 @@ else +@@ -564,6 +568,24 @@ else KBUILD_CFLAGS +=3D -O2 endif =20 @@ -60204,7 +60424,6 @@ diff -urNp linux-3.0.3/Makefile linux-3.0.3/Makef= ile +ifdef CONFIG_PAX_MEMORY_STACKLEAK +STACKLEAK_PLUGIN :=3D -fplugin=3D$(objtree)/tools/gcc/stackleak_plugin.= so -fplugin-arg-stackleak_plugin-track-lowest-sp=3D100 +endif -+KBUILD_CFLAGS +=3D $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) +export CONSTIFY_PLUGIN STACKLEAK_PLUGIN +gcc-plugins: + $(Q)$(MAKE) $(build)=3Dtools/gcc @@ -60221,7 +60440,7 @@ diff -urNp linux-3.0.3/Makefile linux-3.0.3/Makef= ile include $(srctree)/arch/$(SRCARCH)/Makefile =20 ifneq ($(CONFIG_FRAME_WARN),0) -@@ -708,7 +731,7 @@ export mod_strip_cmd +@@ -708,7 +730,7 @@ export mod_strip_cmd =20 =20 ifeq ($(KBUILD_EXTMOD),) @@ -60230,6 +60449,14 @@ diff -urNp linux-3.0.3/Makefile linux-3.0.3/Make= file =20 vmlinux-dirs :=3D $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ +@@ -907,6 +929,7 @@ define rule_vmlinux-modpost + endef +=20 + # vmlinux image - including updated kernel symbols ++vmlinux: KBUILD_CFLAGS +=3D $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) + vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o $(kal= lsyms.o) FORCE + ifdef CONFIG_HEADERS_CHECK + $(Q)$(MAKE) -f $(srctree)/Makefile headers_check @@ -973,7 +996,7 @@ ifneq ($(KBUILD_SRC),) endif =20 @@ -60239,7 +60466,15 @@ diff -urNp linux-3.0.3/Makefile linux-3.0.3/Make= file =20 prepare1: prepare2 include/linux/version.h include/generated/utsrelease= .h \ include/config/auto.conf -@@ -1198,7 +1221,7 @@ distclean: mrproper +@@ -1087,6 +1110,7 @@ all: modules + # using awk while concatenating to the final file. +=20 + PHONY +=3D modules ++modules: KBUILD_CFLAGS +=3D $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) + modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builti= n + $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=3D$(objtree)/%/modules.order) = > $(objtree)/modules.order + @$(kecho) ' Building modules, stage 2.'; +@@ -1198,7 +1222,7 @@ distclean: mrproper @find $(srctree) $(RCS_FIND_IGNORE) \ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ @@ -60248,7 +60483,7 @@ diff -urNp linux-3.0.3/Makefile linux-3.0.3/Makef= ile -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ -type f -print | xargs rm -f =20 -@@ -1404,7 +1427,7 @@ clean: $(clean-dirs) +@@ -1404,7 +1428,7 @@ clean: $(clean-dirs) $(call cmd,rmdirs) $(call cmd,rmfiles) @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ @@ -69347,8 +69582,8 @@ diff -urNp linux-3.0.3/sound/usb/card.h linux-3.0= .3/sound/usb/card.h struct snd_usb_stream { diff -urNp linux-3.0.3/tools/gcc/constify_plugin.c linux-3.0.3/tools/gcc= /constify_plugin.c --- linux-3.0.3/tools/gcc/constify_plugin.c 1969-12-31 19:00:00.00000000= 0 -0500 -+++ linux-3.0.3/tools/gcc/constify_plugin.c 2011-08-23 22:35:28.00000000= 0 -0400 -@@ -0,0 +1,258 @@ ++++ linux-3.0.3/tools/gcc/constify_plugin.c 2011-08-24 18:13:06.00000000= 0 -0400 +@@ -0,0 +1,259 @@ +/* + * Copyright 2011 by Emese Revfy + * Licensed under the GPL v2, or (at your option) v3 @@ -69373,26 +69608,30 @@ diff -urNp linux-3.0.3/tools/gcc/constify_plugi= n.c linux-3.0.3/tools/gcc/constif +#include "function.h" +#include "tree-flow.h" +#include "plugin.h" ++//#include "c-tree.h" ++ ++#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1 (TYPE) + +int plugin_is_GPL_compatible; + +static struct plugin_info const_plugin_info =3D { -+ .version =3D "20110817", ++ .version =3D "20110824", + .help =3D "no-constify\tturn off constification\n", +}; + +static bool walk_struct(tree node); + -+static void deconstify_node(tree node) ++static void deconstify_node(tree type) +{ + tree field; + -+ for (field =3D TYPE_FIELDS(node); field; field =3D TREE_CHAIN(field)) = { ++ C_TYPE_FIELDS_READONLY(type) =3D 0; ++ for (field =3D TYPE_FIELDS(type); field; field =3D TREE_CHAIN(field)) = { + enum tree_code code =3D TREE_CODE(TREE_TYPE(field)); + if (code =3D=3D RECORD_TYPE || code =3D=3D UNION_TYPE) + deconstify_node(TREE_TYPE(field)); + TREE_READONLY(field) =3D 0; -+ TREE_READONLY(TREE_TYPE(field)) =3D 0; ++ TYPE_READONLY(TREE_TYPE(field)) =3D 0; + } +} + @@ -69431,7 +69670,7 @@ diff -urNp linux-3.0.3/tools/gcc/constify_plugin.= c linux-3.0.3/tools/gcc/constif + return NULL_TREE; + } + -+ if (TREE_CODE(*node) =3D=3D TYPE_DECL && !TREE_READONLY(type)) { ++ if (TREE_CODE(*node) =3D=3D TYPE_DECL && !TYPE_READONLY(type)) { + error("%qE attribute used on type that is not constified", name); + return NULL_TREE; + } @@ -69508,9 +69747,6 @@ diff -urNp linux-3.0.3/tools/gcc/constify_plugin.= c linux-3.0.3/tools/gcc/constif + if (TREE_READONLY(node)) + return; + -+ if (TYPE_FIELDS(node) =3D=3D NULL_TREE) -+ return; -+ + if (walk_struct(node)) + constify_node(node); +} @@ -69540,10 +69776,10 @@ diff -urNp linux-3.0.3/tools/gcc/constify_plugi= n.c linux-3.0.3/tools/gcc/constif + tree var; + referenced_var_iterator rvi; + -+#if __GNUC_MINOR__ >=3D 6 -+ FOR_EACH_REFERENCED_VAR(cfun, var, rvi) { -+#else ++#if __GNUC__ =3D=3D 4 && __GNUC_MINOR__ =3D=3D 5 + FOR_EACH_REFERENCED_VAR(var, rvi) { ++#else ++ FOR_EACH_REFERENCED_VAR(cfun, var, rvi) { +#endif + tree type =3D TREE_TYPE(var); + @@ -69553,7 +69789,7 @@ diff -urNp linux-3.0.3/tools/gcc/constify_plugin.= c linux-3.0.3/tools/gcc/constif + if (TREE_CODE(type) !=3D RECORD_TYPE && TREE_CODE(type) !=3D UNION_TY= PE) + continue; + -+ if (!TREE_READONLY(type)) ++ if (!TYPE_READONLY(type)) + continue; + +// if (lookup_attribute("no_const", DECL_ATTRIBUTES(var)))