diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2013-05-27 14:03:28 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2013-05-27 14:04:04 +0000 |
commit | 81511f0ba37ce2350895f62edc74f8e22d791f7d (patch) | |
tree | 4d4240715ebbd8ac2a9ba8591cfdffca4cf901b4 /testing/linux-virt-grsec | |
parent | c1b55ddf8c79b08cda22887d69add81167b9114a (diff) | |
download | aports-81511f0ba37ce2350895f62edc74f8e22d791f7d.tar.bz2 aports-81511f0ba37ce2350895f62edc74f8e22d791f7d.tar.xz |
testing/linux-virt-grsec: upgrade to 3.9.3
Diffstat (limited to 'testing/linux-virt-grsec')
-rw-r--r-- | testing/linux-virt-grsec/0004-arp-flush-arp-cache-on-device-change.patch | 29 | ||||
-rw-r--r-- | testing/linux-virt-grsec/APKBUILD | 65 | ||||
-rw-r--r-- | testing/linux-virt-grsec/RFC-net-ipv4-Use-next-hop-exceptions-also-for-input-routes.patch | 178 | ||||
-rw-r--r-- | testing/linux-virt-grsec/grsecurity-2.9.1-3.9.3-201305201732.patch (renamed from testing/linux-virt-grsec/grsecurity-2.9.1-3.4.11-1.patch) | 51628 | ||||
-rw-r--r-- | testing/linux-virt-grsec/ipsec-xfrm-properly-handle-invalid-states-as-an-error.patch | 44 | ||||
-rw-r--r-- | testing/linux-virt-grsec/ipv4-remove-output-route-check-in-ipv4_mtu.patch | 38 | ||||
-rw-r--r-- | testing/linux-virt-grsec/kernelconfig.x86 | 594 | ||||
-rw-r--r-- | testing/linux-virt-grsec/kernelconfig.x86_64 | 676 | ||||
-rw-r--r-- | testing/linux-virt-grsec/leds-leds-gpio-reserve-gpio-before-using-it.patch | 114 | ||||
-rw-r--r-- | testing/linux-virt-grsec/pax-out-of-tree-workaround.patch | 18 | ||||
-rw-r--r-- | testing/linux-virt-grsec/v2-net-next-arp-flush-arp-cache-on-IFF_NOARP-change.patch | 89 | ||||
-rw-r--r-- | testing/linux-virt-grsec/xen-xsave.patch | 10 |
12 files changed, 34982 insertions, 18501 deletions
diff --git a/testing/linux-virt-grsec/0004-arp-flush-arp-cache-on-device-change.patch b/testing/linux-virt-grsec/0004-arp-flush-arp-cache-on-device-change.patch deleted file mode 100644 index 85161ea3a3..0000000000 --- a/testing/linux-virt-grsec/0004-arp-flush-arp-cache-on-device-change.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8a0e3ea4924059a7268446177d6869e3399adbb2 Mon Sep 17 00:00:00 2001 -From: Timo Teras <timo.teras@iki.fi> -Date: Mon, 12 Apr 2010 13:46:45 +0000 -Subject: [PATCH 04/18] arp: flush arp cache on device change - -If IFF_NOARP is changed, we must flush the arp cache. - -Signed-off-by: Timo Teras <timo.teras@iki.fi> ---- - net/ipv4/arp.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c -index 4e80f33..580bfc3 100644 ---- a/net/ipv4/arp.c -+++ b/net/ipv4/arp.c -@@ -1200,6 +1200,9 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event, vo - neigh_changeaddr(&arp_tbl, dev); - rt_cache_flush(dev_net(dev), 0); - break; -+ case NETDEV_CHANGE: -+ neigh_changeaddr(&arp_tbl, dev); -+ break; - default: - break; - } --- -1.7.0.2 - diff --git a/testing/linux-virt-grsec/APKBUILD b/testing/linux-virt-grsec/APKBUILD index a7870849e8..eaa7819fdc 100644 --- a/testing/linux-virt-grsec/APKBUILD +++ b/testing/linux-virt-grsec/APKBUILD @@ -2,29 +2,36 @@ _flavor=grsec pkgname=linux-virt-${_flavor} -pkgver=3.4.11 -_kernver=3.4 -pkgrel=0 +pkgver=3.9.3 +case $pkgver in +*.*.*) _kernver=${pkgver%.*};; +*.*) _kernver=${pkgver};; +esac +pkgrel=2 pkgdesc="Linux kernel with grsecurity" url=http://grsecurity.net depends="mkinitfs linux-firmware" -makedepends="perl installkernel bash gmp-dev xz" +makedepends="perl installkernel bash gmp-dev bc" options="!strip" _config=${config:-kernelconfig.${CARCH}} install= source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz http://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$pkgver.xz - grsecurity-2.9.1-$pkgver-1.patch - xen-xsave.patch + grsecurity-2.9.1-3.9.3-201305201732.patch + + v2-net-next-arp-flush-arp-cache-on-IFF_NOARP-change.patch + leds-leds-gpio-reserve-gpio-before-using-it.patch + ipsec-xfrm-properly-handle-invalid-states-as-an-error.patch + RFC-net-ipv4-Use-next-hop-exceptions-also-for-input-routes.patch kernelconfig.x86 kernelconfig.x86_64 " subpackages="$pkgname-dev" -arch="x86 x86_64" +arch="x86 x86_64 arm" license="GPL-2" -_abi_release=${pkgver}-${_flavor} +_abi_release=${pkgver}-${pkgrel}-${_flavor} prepare() { local _patch_failed= @@ -53,6 +60,8 @@ prepare() { return 1 fi + echo "-$pkgrel" > localversion-alpine + mkdir -p "$srcdir"/build cp "$srcdir"/$_config "$srcdir"/build/.config || return 1 make -C "$srcdir"/linux-$_kernver O="$srcdir"/build HOSTCC="${CC:-gcc}" \ @@ -70,14 +79,14 @@ build() { cd "$srcdir"/build export GCC_SPECS=/usr/share/gcc/hardenednopie.specs make CC="${CC:-gcc}" \ - KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine Virt" \ + KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" \ || return 1 } package() { cd "$srcdir"/build - mkdir -p "$pkgdir"/boot "$pkgdir"/lib/modules "$pkgdir"/lib/firmware - make -j1 modules_install install \ + mkdir -p "$pkgdir"/boot "$pkgdir"/lib/modules + make -j1 modules_install firmware_install install \ INSTALL_MOD_PATH="$pkgdir" \ INSTALL_PATH="$pkgdir"/boot \ || return 1 @@ -99,6 +108,7 @@ dev() { # build a tiny kernel module # pkgdesc="Headers and script for third party modules for grsec kernel" + depends="gmp-dev bash" local dir="$subpkgdir"/usr/src/linux-headers-${_abi_release} # first we import config, run prepare to set up for building @@ -136,9 +146,30 @@ dev() { "$subpkgdir"/lib/modules/${_abi_release}/build } -md5sums="967f72983655e2479f951195953e8480 linux-3.4.tar.xz -2149df47fc96fec05787bf0197fb7b16 patch-3.4.11.xz -261e513021d40a01ebd18947fde0ab1d grsecurity-2.9.1-3.4.11-1.patch -0d095dbf194d5609ad260ecd3f0ab15d xen-xsave.patch -edf0b2f99cb5391e424bd7edf6f88c6c kernelconfig.x86 -32cbb968820788def5fd2677b61351c1 kernelconfig.x86_64" +md5sums="4348c9b6b2eb3144d601e87c19d5d909 linux-3.9.tar.xz +71b31e29e0cb437a27017c781293b6f4 patch-3.9.3.xz +e881cf0db639205660f237ceea58f708 grsecurity-2.9.1-3.9.3-201305201732.patch +699e92148cc9a55b6fc4d7d81e476717 v2-net-next-arp-flush-arp-cache-on-IFF_NOARP-change.patch +83db7136608d8101ae130728539dc376 leds-leds-gpio-reserve-gpio-before-using-it.patch +ac9a50bdbe91ba6e5205e83f7e734ff5 ipsec-xfrm-properly-handle-invalid-states-as-an-error.patch +12d3647755bebcd3b114f50de2729455 RFC-net-ipv4-Use-next-hop-exceptions-also-for-input-routes.patch +3535e1fae00b47adb72ac827177bc00a kernelconfig.x86 +88e0a6f7eb9f94aae0c171f18443d472 kernelconfig.x86_64" +sha256sums="60bc3e64ee5dc778de2cd7cd7640abf518a4c9d4f31b8ed624e16fad53f54541 linux-3.9.tar.xz +248ab5f9a42b72e5c3d961520a5fff609a625bbf570ad45d7ae97009525b94d7 patch-3.9.3.xz +c1b4310085ff07200131dc841a0a22f84a7f166c3b25464e27dd2694584bc72c grsecurity-2.9.1-3.9.3-201305201732.patch +8e2f41605937eecd47cefe62daefd372dbf1e63cf956ab3ced3213ac2b508ee3 v2-net-next-arp-flush-arp-cache-on-IFF_NOARP-change.patch +13676bc5610a8d03e788ac76734babd1338b023bb39559452ee54652b046e6f4 leds-leds-gpio-reserve-gpio-before-using-it.patch +ab0dcb52342990ad05af5ce21acd1e95fb65cc7e76ec98e45c7ece7433bc9f23 ipsec-xfrm-properly-handle-invalid-states-as-an-error.patch +667babfafe4dc3449cd04853f532712188af557cbac41c461cf8236c4238f5a3 RFC-net-ipv4-Use-next-hop-exceptions-also-for-input-routes.patch +8cbd999cdc0bfd069799c912a01009e9b7fad3845e93f21caff136117eb20601 kernelconfig.x86 +57a96741a6b0dd9dd84a22edcab3dbf2de25d3e04d4c0ac371426f651dfed143 kernelconfig.x86_64" +sha512sums="77fa521f42380409f8ab400c26f7b00e225cb075ef40834bb263325cfdcc3e65aef8511ec2fc2b50bbf4f50e226fb5ab07d7a479aaf09162adbbf318325d0790 linux-3.9.tar.xz +ae2bca3f0d274281d7ae88bb835d129a036350dfd3e9e941d7a0175194b2cbccffb5f8b5a20e5a7498cb5a097c6376d8cb1032ea048051b08ec0dd05309c09eb patch-3.9.3.xz +d6aa751d1fac8c4d758f9479bc6b08f70d8725c6c74b63446def044f42260a8beb1f540ae4473ec57f42538513d3ccb42de41c8cc721b9b85d8cfbaef7ab85d5 grsecurity-2.9.1-3.9.3-201305201732.patch +772c847cd74b12ed22266042c0902d8a3cf09c897b6e1c01148dfcd2f01aed331f292e82c34bb718090dc0898e1ef364196272bff885a32378f7fbc8bfc06a9b v2-net-next-arp-flush-arp-cache-on-IFF_NOARP-change.patch +10d2cf4fb308d1bc8cb5b9df3f9a6d7b9cef453244673bcbe66bd9b64af410a498e203d4dfa51f53461362ad981736eadc46537616b2c0514f57f4d8864c830d leds-leds-gpio-reserve-gpio-before-using-it.patch +769291e92f2f5ae5375d98b80bf8790b089c87437f1660cf8d5e9d45d7221280b6824bcb1d2564cbe12310a88df48443c56ecc9ce5468858829088221aa80327 ipsec-xfrm-properly-handle-invalid-states-as-an-error.patch +d35c939967d5696e477e2c5181f96e9cb92e1db88477576615f36209d276e0a2a866111d43e4abe076c455e32b063d6a97d42e5bc9ca04702d78b13826bf3afb RFC-net-ipv4-Use-next-hop-exceptions-also-for-input-routes.patch +b5ad33fa224aefb905101ecead598a08307a88829070b677e46ca6151b46fcabbea6193b09b686b6ff9ce95642c887052500bec4b3fcabb84d4429403ff1fd5a kernelconfig.x86 +3bac8f7734d2c54a3996ccaf463620ff037ec1935bf7206dd697a5703258d9d5db119367885dcdd3f3a67417f2ff588796525795a91ca9311d8fa3b8d02ffd2c kernelconfig.x86_64" diff --git a/testing/linux-virt-grsec/RFC-net-ipv4-Use-next-hop-exceptions-also-for-input-routes.patch b/testing/linux-virt-grsec/RFC-net-ipv4-Use-next-hop-exceptions-also-for-input-routes.patch new file mode 100644 index 0000000000..2310927e81 --- /dev/null +++ b/testing/linux-virt-grsec/RFC-net-ipv4-Use-next-hop-exceptions-also-for-input-routes.patch @@ -0,0 +1,178 @@ +From patchwork Thu May 23 13:15:46 2013 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: [RFC] net/ipv4: Use next hop exceptions also for input routes +Date: Thu, 23 May 2013 03:15:46 -0000 +From: =?utf-8?q?Timo_Ter=C3=A4s?= <timo.teras@iki.fi> +X-Patchwork-Id: 245949 +Message-Id: <1369314946-12692-1-git-send-email-timo.teras@iki.fi> +To: netdev@vger.kernel.org +Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> + +Commit d2d68ba9 (ipv4: Cache input routes in fib_info nexthops) +assmued that "locally destined, and routed packets, never trigger +PMTU events or redirects that will be processed by us". + +However, it seems that tunnel devices do trigger PMTU events in certain +cases. At least ip_gre, ip6_gre, sit, and ipip do use the inner flow's +skb_dst(skb)->ops->update_pmtu to propage mtu information from the +outer flows. These can cause the inner flow mtu to be decreased. If +next hop exceptions are not consulted for pmtu, IP fragmentation will +not be done properly for these routes. + +It also seems that we really need to have the PMTU information always +for netfilter TCPMSS' clamp-to-pmtu feature to work properly. + +So for the time being, cache separate copies of input routes for +each next hop exception. + +Signed-off-by: Timo Teräs <timo.teras@iki.fi> + +--- +I had ideas to make optimizations where pmtu information would not +be needed. This includes: +- Target devices with IFF_XMIT_DST_RELEASE set (practically all devices + except tunnels). If skb_dst() is early freed the target device cannot + generate PMTU events +- Add flag for input route generation if pmtu info is needed for + fragmentation. Basically a flag saying if DF bit was set in ip_hdr. + +However, TCPMSS clamp-to-pmtu prevents both optimizations. + +I'm not yet all familiar with the recent changes in routing caching, +so there might be caveats that I missed. Basic testing shows this fixes +the fragmentation issues I'm seeing, and I have not yet found any ill +side effects either. + + include/net/ip_fib.h | 3 ++- + net/ipv4/fib_semantics.c | 3 ++- + net/ipv4/route.c | 41 +++++++++++++++++++++++++++++++---------- + 3 files changed, 35 insertions(+), 12 deletions(-) + +diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h +index e49db91..20529a6 100644 +--- a/include/net/ip_fib.h ++++ b/include/net/ip_fib.h +@@ -55,7 +55,8 @@ struct fib_nh_exception { + u32 fnhe_pmtu; + __be32 fnhe_gw; + unsigned long fnhe_expires; +- struct rtable __rcu *fnhe_rth; ++ struct rtable __rcu *fnhe_rth_input; ++ struct rtable __rcu *fnhe_rth_output; + unsigned long fnhe_stamp; + }; + +diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c +index 8f6cb7a..d5dbca5 100644 +--- a/net/ipv4/fib_semantics.c ++++ b/net/ipv4/fib_semantics.c +@@ -169,7 +169,8 @@ static void free_nh_exceptions(struct fib_nh *nh) + + next = rcu_dereference_protected(fnhe->fnhe_next, 1); + +- rt_fibinfo_free(&fnhe->fnhe_rth); ++ rt_fibinfo_free(&fnhe->fnhe_rth_input); ++ rt_fibinfo_free(&fnhe->fnhe_rth_output); + + kfree(fnhe); + +diff --git a/net/ipv4/route.c b/net/ipv4/route.c +index 550781a..073df96 100644 +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -576,9 +576,14 @@ static struct fib_nh_exception *fnhe_oldest(struct fnhe_hash_bucket *hash) + if (time_before(fnhe->fnhe_stamp, oldest->fnhe_stamp)) + oldest = fnhe; + } +- orig = rcu_dereference(oldest->fnhe_rth); ++ orig = rcu_dereference(oldest->fnhe_rth_input); + if (orig) { +- RCU_INIT_POINTER(oldest->fnhe_rth, NULL); ++ RCU_INIT_POINTER(oldest->fnhe_rth_input, NULL); ++ rt_free(orig); ++ } ++ orig = rcu_dereference(oldest->fnhe_rth_output); ++ if (orig) { ++ RCU_INIT_POINTER(oldest->fnhe_rth_output, NULL); + rt_free(orig); + } + return oldest; +@@ -1209,7 +1214,15 @@ static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe, + spin_lock_bh(&fnhe_lock); + + if (daddr == fnhe->fnhe_daddr) { +- struct rtable *orig = rcu_dereference(fnhe->fnhe_rth); ++ struct rtable __rcu **porig; ++ struct rtable *orig; ++ ++ if (rt_is_input_route(rt)) ++ porig = &fnhe->fnhe_rth_input; ++ else ++ porig = &fnhe->fnhe_rth_output; ++ ++ orig = rcu_dereference(*porig); + if (orig && rt_is_expired(orig)) { + fnhe->fnhe_gw = 0; + fnhe->fnhe_pmtu = 0; +@@ -1231,12 +1244,14 @@ static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe, + } else if (!rt->rt_gateway) + rt->rt_gateway = daddr; + +- rcu_assign_pointer(fnhe->fnhe_rth, rt); +- if (orig) +- rt_free(orig); ++ if (!(rt->dst.flags & DST_NOCACHE)) { ++ rcu_assign_pointer(*porig, rt); ++ if (orig) ++ rt_free(orig); ++ ret = true; ++ } + + fnhe->fnhe_stamp = jiffies; +- ret = true; + } + spin_unlock_bh(&fnhe_lock); + +@@ -1468,6 +1483,7 @@ static int __mkroute_input(struct sk_buff *skb, + struct in_device *in_dev, + __be32 daddr, __be32 saddr, u32 tos) + { ++ struct fib_nh_exception *fnhe; + struct rtable *rth; + int err; + struct in_device *out_dev; +@@ -1514,8 +1530,13 @@ static int __mkroute_input(struct sk_buff *skb, + } + } + ++ fnhe = find_exception(&FIB_RES_NH(*res), daddr); + if (do_cache) { +- rth = rcu_dereference(FIB_RES_NH(*res).nh_rth_input); ++ if (fnhe != NULL) ++ rth = rcu_dereference(fnhe->fnhe_rth_input); ++ else ++ rth = rcu_dereference(FIB_RES_NH(*res).nh_rth_input); ++ + if (rt_cache_valid(rth)) { + skb_dst_set_noref(skb, &rth->dst); + goto out; +@@ -1543,7 +1564,7 @@ static int __mkroute_input(struct sk_buff *skb, + rth->dst.input = ip_forward; + rth->dst.output = ip_output; + +- rt_set_nexthop(rth, daddr, res, NULL, res->fi, res->type, itag); ++ rt_set_nexthop(rth, daddr, res, fnhe, res->fi, res->type, itag); + skb_dst_set(skb, &rth->dst); + out: + err = 0; +@@ -1858,7 +1879,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res, + + fnhe = find_exception(nh, fl4->daddr); + if (fnhe) +- prth = &fnhe->fnhe_rth; ++ prth = &fnhe->fnhe_rth_output; + else { + if (unlikely(fl4->flowi4_flags & + FLOWI_FLAG_KNOWN_NH && diff --git a/testing/linux-virt-grsec/grsecurity-2.9.1-3.4.11-1.patch b/testing/linux-virt-grsec/grsecurity-2.9.1-3.9.3-201305201732.patch index cb22897ebc..b6dd68f753 100644 --- a/testing/linux-virt-grsec/grsecurity-2.9.1-3.4.11-1.patch +++ b/testing/linux-virt-grsec/grsecurity-2.9.1-3.9.3-201305201732.patch @@ -1,5 +1,5 @@ diff --git a/Documentation/dontdiff b/Documentation/dontdiff -index b4a898f..781c7ad 100644 +index b89a739..b47493f 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff @@ -2,9 +2,11 @@ @@ -110,7 +110,7 @@ index b4a898f..781c7ad 100644 hpet_example hugepage-mmap hugepage-shm -@@ -145,7 +163,7 @@ int32.c +@@ -145,14 +163,14 @@ int32.c int4.c int8.c kallsyms @@ -119,8 +119,7 @@ index b4a898f..781c7ad 100644 keywords.c ksym.c* ksym.h* -@@ -153,7 +171,7 @@ kxgettext - lkc_defs.h + kxgettext lex.c lex.*.c -linux @@ -128,10 +127,10 @@ index b4a898f..781c7ad 100644 logo_*.c logo_*_clut224.c logo_*_mono.c -@@ -164,14 +182,15 @@ machtypes.h +@@ -162,14 +180,15 @@ mach-types.h + machtypes.h map map_hugetlb - maui_boot.h -media mconf +mdp @@ -145,15 +144,16 @@ index b4a898f..781c7ad 100644 mkprep mkregtable mktables -@@ -188,6 +207,7 @@ oui.c* +@@ -185,6 +204,8 @@ oui.c* page-types parse.c parse.h +parse-events* ++pasyms.h patches* pca200e.bin pca200e_ecd.bin2 -@@ -197,6 +217,7 @@ perf-archive +@@ -194,6 +215,7 @@ perf-archive piggyback piggy.gzip piggy.S @@ -161,25 +161,31 @@ index b4a898f..781c7ad 100644 pnmtologo ppc_defs.h* pss_boot.h -@@ -207,6 +228,7 @@ r300_reg_safe.h +@@ -203,7 +225,10 @@ r200_reg_safe.h + r300_reg_safe.h r420_reg_safe.h r600_reg_safe.h ++realmode.lds ++realmode.relocs recordmcount +regdb.c relocs rlim_names.h rn50_reg_safe.h -@@ -216,7 +238,9 @@ series +@@ -213,8 +238,12 @@ series setup setup.bin setup.elf ++signing_key* +size_overflow_hash.h sImage +slabinfo sm_tbl* ++sortextable split-include syscalltab.h -@@ -227,6 +251,7 @@ tftpboot.img + tables.c +@@ -224,6 +253,7 @@ tftpboot.img timeconst.h times.h* trix_boot.h @@ -187,7 +193,7 @@ index b4a898f..781c7ad 100644 utsrelease.h* vdso-syms.lds vdso.lds -@@ -238,13 +263,17 @@ vdso32.lds +@@ -235,13 +265,17 @@ vdso32.lds vdso32.so.dbg vdso64.lds vdso64.so.dbg @@ -205,7 +211,7 @@ index b4a898f..781c7ad 100644 vmlinuz voffset.h vsyscall.lds -@@ -252,9 +281,11 @@ vsyscall_32.lds +@@ -249,9 +283,12 @@ vsyscall_32.lds wanxlfw.inc uImage unifdef @@ -213,15 +219,27 @@ index b4a898f..781c7ad 100644 wakeup.bin wakeup.elf wakeup.lds ++x509* zImage* zconf.hash.c +zconf.lex.c zoffset.h diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index c1601e5..08557ce 100644 +index 8ccbf27..afffeb4 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -2021,6 +2021,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. +@@ -948,6 +948,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. + Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0. + Default: 1024 + ++ grsec_proc_gid= [GRKERNSEC_PROC_USERGROUP] Chooses GID to ++ ignore grsecurity's /proc restrictions ++ ++ + hashdist= [KNL,NUMA] Large hashes allocated during boot + are distributed across NUMA nodes. Defaults on + for 64-bit NUMA, off otherwise. +@@ -2147,6 +2151,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted. the specified number of seconds. This is to be used if your oopses keep scrolling off the screen. @@ -232,59 +250,31 @@ index c1601e5..08557ce 100644 + + pax_softmode= 0/1 to disable/enable PaX softmode on boot already. + ++ pax_extra_latent_entropy ++ Enable a very simple form of latent entropy extraction ++ from the first 4GB of memory as the bootmem allocator ++ passes the memory pages to the buddy allocator. ++ pcbit= [HW,ISDN] pcd. [PARIDE] -diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt -index 88fd7f5..b318a78 100644 ---- a/Documentation/sysctl/fs.txt -+++ b/Documentation/sysctl/fs.txt -@@ -163,16 +163,22 @@ This value can be used to query and set the core dump mode for setuid - or otherwise protected/tainted binaries. The modes are - - 0 - (default) - traditional behaviour. Any process which has changed -- privilege levels or is execute only will not be dumped -+ privilege levels or is execute only will not be dumped. - 1 - (debug) - all processes dump core when possible. The core dump is - owned by the current user and no security is applied. This is - intended for system debugging situations only. Ptrace is unchecked. -+ This is insecure as it allows regular users to examine the memory -+ contents of privileged processes. - 2 - (suidsafe) - any binary which normally would not be dumped is dumped -- readable by root only. This allows the end user to remove -- such a dump but not access it directly. For security reasons -- core dumps in this mode will not overwrite one another or -- other files. This mode is appropriate when administrators are -- attempting to debug problems in a normal environment. -+ anyway, but only if the "core_pattern" kernel sysctl is set to -+ either a pipe handler or a fully qualified path. (For more details -+ on this limitation, see CVE-2006-2451.) This mode is appropriate -+ when administrators are attempting to debug problems in a normal -+ environment, and either have a core dump pipe handler that knows -+ to treat privileged core dumps with care, or specific directory -+ defined for catching core dumps. If a core dump happens without -+ a pipe handler or fully qualifid path, a message will be emitted -+ to syslog warning about the lack of a correct setting. - - ============================================================== - diff --git a/Makefile b/Makefile -index 22345c0..33cbc29 100644 +index 01003d4..da43c4a 100644 --- a/Makefile +++ b/Makefile -@@ -245,8 +245,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ +@@ -241,8 +241,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ HOSTCC = gcc HOSTCXX = g++ -HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -HOSTCXXFLAGS = -O2 +HOSTCFLAGS = -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wno-unused-parameter -Wno-missing-field-initializers -O2 -fomit-frame-pointer -fno-delete-null-pointer-checks -+HOSTCLFAGS += $(call cc-option, -Wno-empty-body) ++HOSTCFLAGS += $(call cc-option, -Wno-empty-body) +HOSTCXXFLAGS = -O2 -Wall -W -fno-delete-null-pointer-checks # Decide whether to build built-in, modular, or both. # Normally, just do built-in. -@@ -407,8 +408,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exc +@@ -414,8 +415,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ # Rules shared between *config targets and build targets # Basic helpers built in scripts/ @@ -295,18 +285,20 @@ index 22345c0..33cbc29 100644 $(Q)$(MAKE) $(build)=scripts/basic $(Q)rm -f .tmp_quiet_recordmcount -@@ -564,6 +565,60 @@ else +@@ -576,6 +577,65 @@ else KBUILD_CFLAGS += -O2 endif +ifndef DISABLE_PAX_PLUGINS ++ifeq ($(call cc-ifversion, -ge, 0408, y), y) ++PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCXX)" "$(HOSTCXX)" "$(CC)") ++else +PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(HOSTCXX)" "$(CC)") ++endif +ifneq ($(PLUGINCC),) -+ifndef DISABLE_PAX_CONSTIFY_PLUGIN -+ifndef CONFIG_UML ++ifdef CONFIG_PAX_CONSTIFY_PLUGIN +CONSTIFY_PLUGIN_CFLAGS := -fplugin=$(objtree)/tools/gcc/constify_plugin.so -DCONSTIFY_PLUGIN +endif -+endif +ifdef CONFIG_PAX_MEMORY_STACKLEAK +STACKLEAK_PLUGIN_CFLAGS := -fplugin=$(objtree)/tools/gcc/stackleak_plugin.so -DSTACKLEAK_PLUGIN +STACKLEAK_PLUGIN_CFLAGS += -fplugin-arg-stackleak_plugin-track-lowest-sp=100 @@ -331,11 +323,14 @@ index 22345c0..33cbc29 100644 +ifdef CONFIG_PAX_LATENT_ENTROPY +LATENT_ENTROPY_PLUGIN_CFLAGS := -fplugin=$(objtree)/tools/gcc/latent_entropy_plugin.so -DLATENT_ENTROPY_PLUGIN +endif ++ifdef CONFIG_PAX_MEMORY_STRUCTLEAK ++STRUCTLEAK_PLUGIN_CFLAGS := -fplugin=$(objtree)/tools/gcc/structleak_plugin.so -DSTRUCTLEAK_PLUGIN ++endif +GCC_PLUGINS_CFLAGS := $(CONSTIFY_PLUGIN_CFLAGS) $(STACKLEAK_PLUGIN_CFLAGS) $(KALLOCSTAT_PLUGIN_CFLAGS) +GCC_PLUGINS_CFLAGS += $(KERNEXEC_PLUGIN_CFLAGS) $(CHECKER_PLUGIN_CFLAGS) $(COLORIZE_PLUGIN_CFLAGS) -+GCC_PLUGINS_CFLAGS += $(SIZE_OVERFLOW_PLUGIN_CFLAGS) $(LATENT_ENTROPY_PLUGIN_CFLAGS) ++GCC_PLUGINS_CFLAGS += $(SIZE_OVERFLOW_PLUGIN_CFLAGS) $(LATENT_ENTROPY_PLUGIN_CFLAGS) $(STRUCTLEAK_PLUGIN_CFLAGS) +GCC_PLUGINS_AFLAGS := $(KERNEXEC_PLUGIN_AFLAGS) -+export PLUGINCC CONSTIFY_PLUGIN ++export PLUGINCC GCC_PLUGINS_CFLAGS GCC_PLUGINS_AFLAGS CONSTIFY_PLUGIN +ifeq ($(KBUILD_EXTMOD),) +gcc-plugins: + $(Q)$(MAKE) $(build)=tools/gcc @@ -349,14 +344,14 @@ index 22345c0..33cbc29 100644 +else + $(Q)echo "warning, your gcc version does not support plugins, you should upgrade it to gcc 4.5 at least" +endif -+ $(Q)echo "PAX_MEMORY_STACKLEAK and other features will be less secure" ++ $(Q)echo "PAX_MEMORY_STACKLEAK, constification, PAX_LATENT_ENTROPY and other features will be less secure. PAX_SIZE_OVERFLOW will not be active." +endif +endif + include $(srctree)/arch/$(SRCARCH)/Makefile - ifneq ($(CONFIG_FRAME_WARN),0) -@@ -708,7 +763,7 @@ export mod_strip_cmd + ifdef CONFIG_READABLE_ASM +@@ -733,7 +793,7 @@ export mod_sign_cmd ifeq ($(KBUILD_EXTMOD),) @@ -365,16 +360,16 @@ index 22345c0..33cbc29 100644 vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ -@@ -932,6 +987,8 @@ vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE +@@ -780,6 +840,8 @@ endif # The actual objects are generated when descending, # make sure no implicit rule kicks in -+$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) -+$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS) - $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; ++$(filter-out $(init-y),$(vmlinux-deps)): KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) ++$(filter-out $(init-y),$(vmlinux-deps)): KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS) + $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; # Handle descending into subdirectories listed in $(vmlinux-dirs) -@@ -941,7 +998,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; +@@ -789,7 +851,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; # Error messages still appears in the original language PHONY += $(vmlinux-dirs) @@ -383,7 +378,7 @@ index 22345c0..33cbc29 100644 $(Q)$(MAKE) $(build)=$@ # Store (new) KERNELRELASE string in include/config/kernel.release -@@ -985,6 +1042,7 @@ prepare0: archprepare FORCE +@@ -833,6 +895,7 @@ prepare0: archprepare FORCE $(Q)$(MAKE) $(build)=. # All the preparing.. @@ -391,7 +386,7 @@ index 22345c0..33cbc29 100644 prepare: prepare0 # Generate some files -@@ -1092,6 +1150,8 @@ all: modules +@@ -940,6 +1003,8 @@ all: modules # using awk while concatenating to the final file. PHONY += modules @@ -400,7 +395,7 @@ index 22345c0..33cbc29 100644 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order @$(kecho) ' Building modules, stage 2.'; -@@ -1107,7 +1167,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) +@@ -955,7 +1020,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) # Target to prepare building external modules PHONY += modules_prepare @@ -409,16 +404,16 @@ index 22345c0..33cbc29 100644 # Target to install modules PHONY += modules_install -@@ -1166,7 +1226,7 @@ CLEAN_FILES += vmlinux System.map \ - MRPROPER_DIRS += include/config usr/include include/generated \ - arch/*/include/generated - MRPROPER_FILES += .config .config.old .version .old_version \ -- include/linux/version.h \ -+ include/linux/version.h tools/gcc/size_overflow_hash.h\ - Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS +@@ -1021,7 +1086,7 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ + Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ + signing_key.priv signing_key.x509 x509.genkey \ + extra_certificates signing_key.x509.keyid \ +- signing_key.x509.signer ++ signing_key.x509.signer tools/gcc/size_overflow_hash.h # clean - Delete most, but leave enough to build external modules -@@ -1204,6 +1264,7 @@ distclean: mrproper + # +@@ -1061,6 +1126,7 @@ distclean: mrproper \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '.*.rej' \ @@ -426,7 +421,7 @@ index 22345c0..33cbc29 100644 -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ -type f -print | xargs rm -f -@@ -1364,6 +1425,8 @@ PHONY += $(module-dirs) modules +@@ -1221,6 +1287,8 @@ PHONY += $(module-dirs) modules $(module-dirs): crmodverdir $(objtree)/Module.symvers $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) @@ -435,7 +430,7 @@ index 22345c0..33cbc29 100644 modules: $(module-dirs) @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1490,17 +1553,21 @@ else +@@ -1357,17 +1425,21 @@ else target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) endif @@ -461,7 +456,7 @@ index 22345c0..33cbc29 100644 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.symtypes: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -@@ -1510,11 +1577,15 @@ endif +@@ -1377,11 +1449,15 @@ endif $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) @@ -480,7 +475,7 @@ index 22345c0..33cbc29 100644 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) $(@:.ko=.o) diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h -index 3bb7ffe..347a54c 100644 +index c2cbe4f..f7264b4 100644 --- a/arch/alpha/include/asm/atomic.h +++ b/arch/alpha/include/asm/atomic.h @@ -250,6 +250,16 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) @@ -597,19 +592,32 @@ index 2fd00b7..cfd5069 100644 for (i = 0; i < n; i++) { diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c -index 49ee319..9ee7d14 100644 +index b9e37ad..44c24e7 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c -@@ -1146,7 +1146,7 @@ arch_get_unmapped_area_1(unsigned long addr, unsigned long len, - /* At this point: (!vma || addr < vma->vm_end). */ - if (limit - len < addr) - return -ENOMEM; -- if (!vma || addr + len <= vma->vm_start) -+ if (check_heap_stack_gap(vma, addr, len)) - return addr; - addr = vma->vm_end; - vma = vma->vm_next; -@@ -1182,6 +1182,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, +@@ -1297,10 +1297,11 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p) + generic version except that we know how to honor ADDR_LIMIT_32BIT. */ + + static unsigned long +-arch_get_unmapped_area_1(unsigned long addr, unsigned long len, +- unsigned long limit) ++arch_get_unmapped_area_1(struct file *filp, unsigned long addr, unsigned long len, ++ unsigned long limit, unsigned long flags) + { + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(current->mm, filp, flags); + + info.flags = 0; + info.length = len; +@@ -1308,6 +1309,7 @@ arch_get_unmapped_area_1(unsigned long addr, unsigned long len, + info.high_limit = limit; + info.align_mask = 0; + info.align_offset = 0; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); + } + +@@ -1340,20 +1342,24 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, merely specific addresses, but regions of memory -- perhaps this feature should be incorporated into all ports? */ @@ -618,21 +626,28 @@ index 49ee319..9ee7d14 100644 +#endif + if (addr) { - addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit); +- addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit); ++ addr = arch_get_unmapped_area_1 (filp, PAGE_ALIGN(addr), len, limit, flags); if (addr != (unsigned long) -ENOMEM) -@@ -1189,8 +1193,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, + return addr; } /* Next, try allocating at TASK_UNMAPPED_BASE. */ - addr = arch_get_unmapped_area_1 (PAGE_ALIGN(TASK_UNMAPPED_BASE), - len, limit); -+ addr = arch_get_unmapped_area_1 (PAGE_ALIGN(current->mm->mmap_base), len, limit); ++ addr = arch_get_unmapped_area_1 (filp, PAGE_ALIGN(current->mm->mmap_base), len, limit, flags); + if (addr != (unsigned long) -ENOMEM) return addr; + /* Finally, try allocating in low memory. */ +- addr = arch_get_unmapped_area_1 (PAGE_SIZE, len, limit); ++ addr = arch_get_unmapped_area_1 (filp, PAGE_SIZE, len, limit, flags); + + return addr; + } diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c -index 5eecab1..609abc0 100644 +index 0c4132d..88f0d53 100644 --- a/arch/alpha/mm/fault.c +++ b/arch/alpha/mm/fault.c @@ -53,6 +53,124 @@ __load_new_mm_context(struct mm_struct *next_mm) @@ -760,7 +775,7 @@ index 5eecab1..609abc0 100644 /* * This routine handles page faults. It determines the address, -@@ -130,8 +248,29 @@ do_page_fault(unsigned long address, unsigned long mmcsr, +@@ -133,8 +251,29 @@ retry: good_area: si_code = SEGV_ACCERR; if (cause < 0) { @@ -791,8 +806,21 @@ index 5eecab1..609abc0 100644 } else if (!cause) { /* Allow reads even for write-only mappings */ if (!(vma->vm_flags & (VM_READ | VM_WRITE))) +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index 1cacda4..2cef624 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -1850,7 +1850,7 @@ config ALIGNMENT_TRAP + + config UACCESS_WITH_MEMCPY + bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()" +- depends on MMU ++ depends on MMU && !PAX_MEMORY_UDEREF + default y if CPU_FEROCEON + help + Implement faster copy_to_user and clear_user methods for CPU diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h -index 68374ba..b095124 100644 +index c79f61f..9ac0642 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h @@ -17,17 +17,35 @@ @@ -1097,8 +1125,8 @@ index 68374ba..b095124 100644 + #define ATOMIC64_INIT(i) { (i) } - static inline u64 atomic64_read(atomic64_t *v) -@@ -256,6 +451,19 @@ static inline u64 atomic64_read(atomic64_t *v) + static inline u64 atomic64_read(const atomic64_t *v) +@@ -256,6 +451,19 @@ static inline u64 atomic64_read(const atomic64_t *v) return result; } @@ -1180,11 +1208,13 @@ index 68374ba..b095124 100644 static inline u64 atomic64_add_return(u64 i, atomic64_t *v) { +- u64 result; +- unsigned long tmp; + u64 result, tmp; -+ -+ smp_mb(); -+ -+ __asm__ __volatile__("@ atomic64_add_return\n" + + smp_mb(); + + __asm__ __volatile__("@ atomic64_add_return\n" +"1: ldrexd %1, %H1, [%3]\n" +" adds %0, %1, %4\n" +" adcs %H0, %H1, %H4\n" @@ -1217,21 +1247,19 @@ index 68374ba..b095124 100644 + +static inline u64 atomic64_add_return_unchecked(u64 i, atomic64_unchecked_t *v) +{ - u64 result; - unsigned long tmp; - - smp_mb(); - -- __asm__ __volatile__("@ atomic64_add_return\n" ++ u64 result; ++ unsigned long tmp; ++ ++ smp_mb(); ++ + __asm__ __volatile__("@ atomic64_add_return_unchecked\n" "1: ldrexd %0, %H0, [%3]\n" " adds %0, %0, %4\n" " adc %H0, %H0, %H4\n" -@@ -318,23 +607,34 @@ static inline void atomic64_sub(u64 i, atomic64_t *v) +@@ -318,6 +607,36 @@ static inline void atomic64_sub(u64 i, atomic64_t *v) __asm__ __volatile__("@ atomic64_sub\n" "1: ldrexd %0, %H0, [%3]\n" " subs %0, %0, %4\n" --" sbc %H0, %H0, %H4\n" +" sbcs %H0, %H0, %H4\n" + +#ifdef CONFIG_PAX_REFCOUNT @@ -1240,46 +1268,45 @@ index 68374ba..b095124 100644 +"3:\n" +#endif + - " strexd %1, %0, %H0, [%3]\n" - " teq %1, #0\n" - " bne 1b" ++" strexd %1, %0, %H0, [%3]\n" ++" teq %1, #0\n" ++" bne 1b" + +#ifdef CONFIG_PAX_REFCOUNT +"\n4:\n" + _ASM_EXTABLE(2b, 4b) +#endif + - : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) - : "r" (&v->counter), "r" (i) - : "cc"); - } - --static inline u64 atomic64_sub_return(u64 i, atomic64_t *v) -+static inline void atomic64_sub_unchecked(u64 i, atomic64_unchecked_t *v) - { - u64 result; - unsigned long tmp; - -- smp_mb(); -- -- __asm__ __volatile__("@ atomic64_sub_return\n" -+ __asm__ __volatile__("@ atomic64_sub_unchecked\n" - "1: ldrexd %0, %H0, [%3]\n" - " subs %0, %0, %4\n" - " sbc %H0, %H0, %H4\n" -@@ -344,6 +644,39 @@ static inline u64 atomic64_sub_return(u64 i, atomic64_t *v) - : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) - : "r" (&v->counter), "r" (i) - : "cc"); ++ : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) ++ : "r" (&v->counter), "r" (i) ++ : "cc"); +} + -+static inline u64 atomic64_sub_return(u64 i, atomic64_t *v) ++static inline void atomic64_sub_unchecked(u64 i, atomic64_unchecked_t *v) +{ -+ u64 result, tmp; -+ -+ smp_mb(); ++ u64 result; ++ unsigned long tmp; + -+ __asm__ __volatile__("@ atomic64_sub_return\n" ++ __asm__ __volatile__("@ atomic64_sub_unchecked\n" ++"1: ldrexd %0, %H0, [%3]\n" ++" subs %0, %0, %4\n" + " sbc %H0, %H0, %H4\n" + " strexd %1, %0, %H0, [%3]\n" + " teq %1, #0\n" +@@ -329,18 +648,32 @@ static inline void atomic64_sub(u64 i, atomic64_t *v) + + static inline u64 atomic64_sub_return(u64 i, atomic64_t *v) + { +- u64 result; +- unsigned long tmp; ++ u64 result, tmp; + + smp_mb(); + + __asm__ __volatile__("@ atomic64_sub_return\n" +-"1: ldrexd %0, %H0, [%3]\n" +-" subs %0, %0, %4\n" +-" sbc %H0, %H0, %H4\n" +"1: ldrexd %1, %H1, [%3]\n" +" subs %0, %1, %4\n" +" sbcs %H0, %H1, %H4\n" @@ -1292,21 +1319,18 @@ index 68374ba..b095124 100644 +"3:\n" +#endif + -+" strexd %1, %0, %H0, [%3]\n" -+" teq %1, #0\n" -+" bne 1b" + " strexd %1, %0, %H0, [%3]\n" + " teq %1, #0\n" + " bne 1b" + +#ifdef CONFIG_PAX_REFCOUNT +"\n4:\n" + _ASM_EXTABLE(2b, 4b) +#endif + -+ : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) -+ : "r" (&v->counter), "r" (i) -+ : "cc"); - - smp_mb(); - + : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) + : "r" (&v->counter), "r" (i) + : "cc"); @@ -374,6 +707,30 @@ static inline u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old, u64 new) return oldval; } @@ -1424,7 +1448,7 @@ index 68374ba..b095124 100644 #define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0) #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1LL, 0LL) diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h -index 75fe66b..2255c86 100644 +index 75fe66b..ba3dee4 100644 --- a/arch/arm/include/asm/cache.h +++ b/arch/arm/include/asm/cache.h @@ -4,8 +4,10 @@ @@ -1439,11 +1463,18 @@ index 75fe66b..2255c86 100644 /* * Memory returned by kmalloc() may be used for DMA, so we must make +@@ -24,5 +26,6 @@ + #endif + + #define __read_mostly __attribute__((__section__(".data..read_mostly"))) ++#define __read_only __attribute__ ((__section__(".data..read_only"))) + + #endif diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h -index 42dec04..adcf84a 100644 +index e1489c5..d418304 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h -@@ -108,7 +108,7 @@ struct cpu_cache_fns { +@@ -116,7 +116,7 @@ struct cpu_cache_fns { void (*dma_unmap_area)(const void *, size_t, int); void (*dma_flush_range)(const void *, const void *); @@ -1452,8 +1483,33 @@ index 42dec04..adcf84a 100644 /* * Select the calling method +diff --git a/arch/arm/include/asm/checksum.h b/arch/arm/include/asm/checksum.h +index 6dcc164..b14d917 100644 +--- a/arch/arm/include/asm/checksum.h ++++ b/arch/arm/include/asm/checksum.h +@@ -37,7 +37,19 @@ __wsum + csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); + + __wsum +-csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr); ++__csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr); ++ ++static inline __wsum ++csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr) ++{ ++ __wsum ret; ++ pax_open_userland(); ++ ret = __csum_partial_copy_from_user(src, dst, len, sum, err_ptr); ++ pax_close_userland(); ++ return ret; ++} ++ ++ + + /* + * Fold a partial checksum without adding pseudo headers diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h -index d41d7cb..9bea5e0 100644 +index 4f009c1..466c59b 100644 --- a/arch/arm/include/asm/cmpxchg.h +++ b/arch/arm/include/asm/cmpxchg.h @@ -102,6 +102,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size @@ -1465,6 +1521,67 @@ index d41d7cb..9bea5e0 100644 #include <asm-generic/cmpxchg-local.h> +diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h +index 6ddbe44..b5e38b1 100644 +--- a/arch/arm/include/asm/domain.h ++++ b/arch/arm/include/asm/domain.h +@@ -48,18 +48,37 @@ + * Domain types + */ + #define DOMAIN_NOACCESS 0 +-#define DOMAIN_CLIENT 1 + #ifdef CONFIG_CPU_USE_DOMAINS ++#define DOMAIN_USERCLIENT 1 ++#define DOMAIN_KERNELCLIENT 1 + #define DOMAIN_MANAGER 3 ++#define DOMAIN_VECTORS DOMAIN_USER + #else ++ ++#ifdef CONFIG_PAX_KERNEXEC + #define DOMAIN_MANAGER 1 ++#define DOMAIN_KERNEXEC 3 ++#else ++#define DOMAIN_MANAGER 1 ++#endif ++ ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++#define DOMAIN_USERCLIENT 0 ++#define DOMAIN_UDEREF 1 ++#define DOMAIN_VECTORS DOMAIN_KERNEL ++#else ++#define DOMAIN_USERCLIENT 1 ++#define DOMAIN_VECTORS DOMAIN_USER ++#endif ++#define DOMAIN_KERNELCLIENT 1 ++ + #endif + + #define domain_val(dom,type) ((type) << (2*(dom))) + + #ifndef __ASSEMBLY__ + +-#ifdef CONFIG_CPU_USE_DOMAINS ++#if defined(CONFIG_CPU_USE_DOMAINS) || defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) + static inline void set_domain(unsigned val) + { + asm volatile( +@@ -68,15 +87,7 @@ static inline void set_domain(unsigned val) + isb(); + } + +-#define modify_domain(dom,type) \ +- do { \ +- struct thread_info *thread = current_thread_info(); \ +- unsigned int domain = thread->cpu_domain; \ +- domain &= ~domain_val(dom, DOMAIN_MANAGER); \ +- thread->cpu_domain = domain | domain_val(dom, type); \ +- set_domain(thread->cpu_domain); \ +- } while (0) +- ++extern void modify_domain(unsigned int dom, unsigned int type); + #else + static inline void set_domain(unsigned val) { } + static inline void modify_domain(unsigned dom, unsigned type) { } diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h index 38050b1..9d90e8b 100644 --- a/arch/arm/include/asm/elf.h @@ -1494,20 +1611,126 @@ index 38050b1..9d90e8b 100644 -#define arch_randomize_brk arch_randomize_brk - #endif +diff --git a/arch/arm/include/asm/fncpy.h b/arch/arm/include/asm/fncpy.h +index de53547..52b9a28 100644 +--- a/arch/arm/include/asm/fncpy.h ++++ b/arch/arm/include/asm/fncpy.h +@@ -81,7 +81,9 @@ + BUG_ON((uintptr_t)(dest_buf) & (FNCPY_ALIGN - 1) || \ + (__funcp_address & ~(uintptr_t)1 & (FNCPY_ALIGN - 1))); \ + \ ++ pax_open_kernel(); \ + memcpy(dest_buf, (void const *)(__funcp_address & ~1), size); \ ++ pax_close_kernel(); \ + flush_icache_range((unsigned long)(dest_buf), \ + (unsigned long)(dest_buf) + (size)); \ + \ +diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h +index e42cf59..7b94b8f 100644 +--- a/arch/arm/include/asm/futex.h ++++ b/arch/arm/include/asm/futex.h +@@ -50,6 +50,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) + return -EFAULT; + ++ pax_open_userland(); ++ + smp_mb(); + __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" + "1: ldrex %1, [%4]\n" +@@ -65,6 +67,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, + : "cc", "memory"); + smp_mb(); + ++ pax_close_userland(); ++ + *uval = val; + return ret; + } +@@ -95,6 +99,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) + return -EFAULT; + ++ pax_open_userland(); ++ + __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" + "1: " TUSER(ldr) " %1, [%4]\n" + " teq %1, %2\n" +@@ -105,6 +111,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, + : "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT) + : "cc", "memory"); + ++ pax_close_userland(); ++ + *uval = val; + return ret; + } +@@ -127,6 +135,7 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) + return -EFAULT; + + pagefault_disable(); /* implies preempt_disable() */ ++ pax_open_userland(); + + switch (op) { + case FUTEX_OP_SET: +@@ -148,6 +157,7 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) + ret = -ENOSYS; + } + ++ pax_close_userland(); + pagefault_enable(); /* subsumes preempt_enable() */ + + if (!ret) { diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h -index e51b1e8..32a3113 100644 +index 83eb2f7..ed77159 100644 --- a/arch/arm/include/asm/kmap_types.h +++ b/arch/arm/include/asm/kmap_types.h -@@ -21,6 +21,7 @@ enum km_type { - KM_L1_CACHE, - KM_L2_CACHE, - KM_KDB, -+ KM_CLEARPAGE, - KM_TYPE_NR - }; +@@ -4,6 +4,6 @@ + /* + * This is the "bare minimum". AIO seems to require this. + */ +-#define KM_TYPE_NR 16 ++#define KM_TYPE_NR 17 + #endif +diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h +index 9e614a1..3302cca 100644 +--- a/arch/arm/include/asm/mach/dma.h ++++ b/arch/arm/include/asm/mach/dma.h +@@ -22,7 +22,7 @@ struct dma_ops { + int (*residue)(unsigned int, dma_t *); /* optional */ + int (*setspeed)(unsigned int, dma_t *, int); /* optional */ + const char *type; +-}; ++} __do_const; + + struct dma_struct { + void *addr; /* single DMA address */ +diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h +index 2fe141f..192dc01 100644 +--- a/arch/arm/include/asm/mach/map.h ++++ b/arch/arm/include/asm/mach/map.h +@@ -27,13 +27,16 @@ struct map_desc { + #define MT_MINICLEAN 6 + #define MT_LOW_VECTORS 7 + #define MT_HIGH_VECTORS 8 +-#define MT_MEMORY 9 ++#define MT_MEMORY_RWX 9 + #define MT_ROM 10 +-#define MT_MEMORY_NONCACHED 11 ++#define MT_MEMORY_NONCACHED_RX 11 + #define MT_MEMORY_DTCM 12 + #define MT_MEMORY_ITCM 13 + #define MT_MEMORY_SO 14 + #define MT_MEMORY_DMA_READY 15 ++#define MT_MEMORY_RW 16 ++#define MT_MEMORY_RX 17 ++#define MT_MEMORY_NONCACHED_RW 18 + + #ifdef CONFIG_MMU + extern void iotable_init(struct map_desc *, int); diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h -index 53426c6..c7baff3 100644 +index 12f71a1..04e063c 100644 --- a/arch/arm/include/asm/outercache.h +++ b/arch/arm/include/asm/outercache.h @@ -35,7 +35,7 @@ struct outer_cache_fns { @@ -1520,10 +1743,10 @@ index 53426c6..c7baff3 100644 #ifdef CONFIG_OUTER_CACHE diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h -index 5838361..da6e813 100644 +index 812a494..71fc0b6 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h -@@ -123,7 +123,7 @@ struct cpu_user_fns { +@@ -114,7 +114,7 @@ struct cpu_user_fns { void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr); void (*cpu_copy_user_highpage)(struct page *to, struct page *from, unsigned long vaddr, struct vm_area_struct *vma); @@ -1533,10 +1756,18 @@ index 5838361..da6e813 100644 #ifdef MULTI_USER extern struct cpu_user_fns cpu_user; diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h -index 943504f..bf8d667 100644 +index 943504f..c37a730 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h -@@ -43,6 +43,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) +@@ -17,6 +17,7 @@ + #include <asm/processor.h> + #include <asm/cacheflush.h> + #include <asm/tlbflush.h> ++#include <asm/system_info.h> + + #define check_pgt_cache() do { } while (0) + +@@ -43,6 +44,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) set_pud(pud, __pud(__pa(pmd) | PMD_TYPE_TABLE)); } @@ -1548,7 +1779,7 @@ index 943504f..bf8d667 100644 #else /* !CONFIG_ARM_LPAE */ /* -@@ -51,6 +56,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) +@@ -51,6 +57,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) #define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) #define pmd_free(mm, pmd) do { } while (0) #define pud_populate(mm,pmd,pte) BUG() @@ -1556,50 +1787,429 @@ index 943504f..bf8d667 100644 #endif /* CONFIG_ARM_LPAE */ +@@ -126,6 +133,19 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte) + __free_page(pte); + } + ++static inline void __section_update(pmd_t *pmdp, unsigned long addr, pmdval_t prot) ++{ ++#ifdef CONFIG_ARM_LPAE ++ pmdp[0] = __pmd(pmd_val(pmdp[0]) | prot); ++#else ++ if (addr & SECTION_SIZE) ++ pmdp[1] = __pmd(pmd_val(pmdp[1]) | prot); ++ else ++ pmdp[0] = __pmd(pmd_val(pmdp[0]) | prot); ++#endif ++ flush_pmd_entry(pmdp); ++} ++ + static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte, + pmdval_t prot) + { +@@ -155,7 +175,7 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) + static inline void + pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep) + { +- __pmd_populate(pmdp, page_to_phys(ptep), _PAGE_USER_TABLE); ++ __pmd_populate(pmdp, page_to_phys(ptep), _PAGE_USER_TABLE | __supported_pmd_mask); + } + #define pmd_pgtable(pmd) pmd_page(pmd) + +diff --git a/arch/arm/include/asm/pgtable-2level-hwdef.h b/arch/arm/include/asm/pgtable-2level-hwdef.h +index 5cfba15..f415e1a 100644 +--- a/arch/arm/include/asm/pgtable-2level-hwdef.h ++++ b/arch/arm/include/asm/pgtable-2level-hwdef.h +@@ -20,12 +20,15 @@ + #define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0) + #define PMD_TYPE_TABLE (_AT(pmdval_t, 1) << 0) + #define PMD_TYPE_SECT (_AT(pmdval_t, 2) << 0) ++#define PMD_PXNTABLE (_AT(pmdval_t, 1) << 2) /* v7 */ + #define PMD_BIT4 (_AT(pmdval_t, 1) << 4) + #define PMD_DOMAIN(x) (_AT(pmdval_t, (x)) << 5) + #define PMD_PROTECTION (_AT(pmdval_t, 1) << 9) /* v5 */ ++ + /* + * - section + */ ++#define PMD_SECT_PXN (_AT(pmdval_t, 1) << 0) /* v7 */ + #define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2) + #define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3) + #define PMD_SECT_XN (_AT(pmdval_t, 1) << 4) /* v6 */ +@@ -37,6 +40,7 @@ + #define PMD_SECT_nG (_AT(pmdval_t, 1) << 17) /* v6 */ + #define PMD_SECT_SUPER (_AT(pmdval_t, 1) << 18) /* v6 */ + #define PMD_SECT_AF (_AT(pmdval_t, 0)) ++#define PMD_SECT_RDONLY (_AT(pmdval_t, 0)) + + #define PMD_SECT_UNCACHED (_AT(pmdval_t, 0)) + #define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE) +@@ -66,6 +70,7 @@ + * - extended small page/tiny page + */ + #define PTE_EXT_XN (_AT(pteval_t, 1) << 0) /* v6 */ ++#define PTE_EXT_PXN (_AT(pteval_t, 1) << 2) /* v7 */ + #define PTE_EXT_AP_MASK (_AT(pteval_t, 3) << 4) + #define PTE_EXT_AP0 (_AT(pteval_t, 1) << 4) + #define PTE_EXT_AP1 (_AT(pteval_t, 2) << 4) +diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h +index f97ee02..07f1be5 100644 +--- a/arch/arm/include/asm/pgtable-2level.h ++++ b/arch/arm/include/asm/pgtable-2level.h +@@ -125,6 +125,7 @@ + #define L_PTE_XN (_AT(pteval_t, 1) << 9) + #define L_PTE_SHARED (_AT(pteval_t, 1) << 10) /* shared(v6), coherent(xsc3) */ + #define L_PTE_NONE (_AT(pteval_t, 1) << 11) ++#define L_PTE_PXN (_AT(pteval_t, 1) << 12) /* v7*/ + + /* + * These are the memory types, defined to be compatible with +diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h +index 18f5cef..25b8f43 100644 +--- a/arch/arm/include/asm/pgtable-3level-hwdef.h ++++ b/arch/arm/include/asm/pgtable-3level-hwdef.h +@@ -41,6 +41,7 @@ + */ + #define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2) + #define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3) ++#define PMD_SECT_RDONLY (_AT(pmdval_t, 1) << 7) + #define PMD_SECT_S (_AT(pmdval_t, 3) << 8) + #define PMD_SECT_AF (_AT(pmdval_t, 1) << 10) + #define PMD_SECT_nG (_AT(pmdval_t, 1) << 11) +@@ -71,6 +72,7 @@ + #define PTE_EXT_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */ + #define PTE_EXT_AF (_AT(pteval_t, 1) << 10) /* Access Flag */ + #define PTE_EXT_NG (_AT(pteval_t, 1) << 11) /* nG */ ++#define PTE_EXT_PXN (_AT(pteval_t, 1) << 53) /* PXN */ + #define PTE_EXT_XN (_AT(pteval_t, 1) << 54) /* XN */ + + /* +diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h +index 86b8fe3..e25f975 100644 +--- a/arch/arm/include/asm/pgtable-3level.h ++++ b/arch/arm/include/asm/pgtable-3level.h +@@ -74,6 +74,7 @@ + #define L_PTE_RDONLY (_AT(pteval_t, 1) << 7) /* AP[2] */ + #define L_PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */ + #define L_PTE_YOUNG (_AT(pteval_t, 1) << 10) /* AF */ ++#define L_PTE_PXN (_AT(pteval_t, 1) << 53) /* PXN */ + #define L_PTE_XN (_AT(pteval_t, 1) << 54) /* XN */ + #define L_PTE_DIRTY (_AT(pteval_t, 1) << 55) /* unused */ + #define L_PTE_SPECIAL (_AT(pteval_t, 1) << 56) /* unused */ +@@ -82,6 +83,7 @@ + /* + * To be used in assembly code with the upper page attributes. + */ ++#define L_PTE_PXN_HIGH (1 << (53 - 32)) + #define L_PTE_XN_HIGH (1 << (54 - 32)) + #define L_PTE_DIRTY_HIGH (1 << (55 - 32)) + +diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h +index 9bcd262..fba731c 100644 +--- a/arch/arm/include/asm/pgtable.h ++++ b/arch/arm/include/asm/pgtable.h +@@ -30,6 +30,9 @@ + #include <asm/pgtable-2level.h> + #endif + ++#define ktla_ktva(addr) (addr) ++#define ktva_ktla(addr) (addr) ++ + /* + * Just any arbitrary offset to the start of the vmalloc VM area: the + * current 8MB value just means that there will be a 8MB "hole" after the +@@ -45,6 +48,9 @@ + #define LIBRARY_TEXT_START 0x0c000000 + + #ifndef __ASSEMBLY__ ++extern pteval_t __supported_pte_mask; ++extern pmdval_t __supported_pmd_mask; ++ + extern void __pte_error(const char *file, int line, pte_t); + extern void __pmd_error(const char *file, int line, pmd_t); + extern void __pgd_error(const char *file, int line, pgd_t); +@@ -53,6 +59,50 @@ extern void __pgd_error(const char *file, int line, pgd_t); + #define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd) + #define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd) + ++#define __HAVE_ARCH_PAX_OPEN_KERNEL ++#define __HAVE_ARCH_PAX_CLOSE_KERNEL ++ ++#ifdef CONFIG_PAX_KERNEXEC ++#include <asm/domain.h> ++#include <linux/thread_info.h> ++#include <linux/preempt.h> ++#endif ++ ++#if defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) ++static inline int test_domain(int domain, int domaintype) ++{ ++ return ((current_thread_info()->cpu_domain) & domain_val(domain, 3)) == domain_val(domain, domaintype); ++} ++#endif ++ ++#ifdef CONFIG_PAX_KERNEXEC ++static inline unsigned long pax_open_kernel(void) { ++#ifdef CONFIG_ARM_LPAE ++ /* TODO */ ++#else ++ preempt_disable(); ++ BUG_ON(test_domain(DOMAIN_KERNEL, DOMAIN_KERNEXEC)); ++ modify_domain(DOMAIN_KERNEL, DOMAIN_KERNEXEC); ++#endif ++ return 0; ++} ++ ++static inline unsigned long pax_close_kernel(void) { ++#ifdef CONFIG_ARM_LPAE ++ /* TODO */ ++#else ++ BUG_ON(test_domain(DOMAIN_KERNEL, DOMAIN_MANAGER)); ++ /* DOMAIN_MANAGER = "client" under KERNEXEC */ ++ modify_domain(DOMAIN_KERNEL, DOMAIN_MANAGER); ++ preempt_enable_no_resched(); ++#endif ++ return 0; ++} ++#else ++static inline unsigned long pax_open_kernel(void) { return 0; } ++static inline unsigned long pax_close_kernel(void) { return 0; } ++#endif ++ + /* + * This is the lowest virtual address we can permit any user space + * mapping to be mapped at. This is particularly important for +@@ -72,8 +122,8 @@ extern void __pgd_error(const char *file, int line, pgd_t); + /* + * The pgprot_* and protection_map entries will be fixed up in runtime + * to include the cachable and bufferable bits based on memory policy, +- * as well as any architecture dependent bits like global/ASID and SMP +- * shared mapping bits. ++ * as well as any architecture dependent bits like global/ASID, PXN, ++ * and SMP shared mapping bits. + */ + #define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG + +@@ -257,7 +307,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } + static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) + { + const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER | +- L_PTE_NONE | L_PTE_VALID; ++ L_PTE_NONE | L_PTE_VALID | __supported_pte_mask; + pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); + return pte; + } +diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h +index f3628fb..a0672dd 100644 +--- a/arch/arm/include/asm/proc-fns.h ++++ b/arch/arm/include/asm/proc-fns.h +@@ -75,7 +75,7 @@ extern struct processor { + unsigned int suspend_size; + void (*do_suspend)(void *); + void (*do_resume)(void *); +-} processor; ++} __do_const processor; + + #ifndef MULTI_CPU + extern void cpu_proc_init(void); +diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h +index 06e7d50..8a8e251 100644 +--- a/arch/arm/include/asm/processor.h ++++ b/arch/arm/include/asm/processor.h +@@ -65,9 +65,8 @@ struct thread_struct { + regs->ARM_cpsr |= PSR_ENDSTATE; \ + regs->ARM_pc = pc & ~1; /* pc */ \ + regs->ARM_sp = sp; /* sp */ \ +- regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ +- regs->ARM_r1 = stack[1]; /* r1 (argv) */ \ +- regs->ARM_r0 = stack[0]; /* r0 (argc) */ \ ++ /* r2 (envp), r1 (argv), r0 (argc) */ \ ++ (void)copy_from_user(®s->ARM_r0, (const char __user *)stack, 3 * sizeof(unsigned long)); \ + nommu_start_thread(regs); \ + }) + +diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h +index ce0dbe7..c085b6f 100644 +--- a/arch/arm/include/asm/psci.h ++++ b/arch/arm/include/asm/psci.h +@@ -29,7 +29,7 @@ struct psci_operations { + int (*cpu_off)(struct psci_power_state state); + int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); + int (*migrate)(unsigned long cpuid); +-}; ++} __no_const; + + extern struct psci_operations psci_ops; + +diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h +index d3a22be..3a69ad5 100644 +--- a/arch/arm/include/asm/smp.h ++++ b/arch/arm/include/asm/smp.h +@@ -107,7 +107,7 @@ struct smp_operations { + int (*cpu_disable)(unsigned int cpu); + #endif + #endif +-}; ++} __no_const; + + /* + * set platform specific SMP operations diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h -index 0f04d84..2be5648 100644 +index cddda1f..ff357f7 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h -@@ -148,6 +148,12 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, - #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ - #define TIF_SYSCALL_TRACE 8 +@@ -77,9 +77,9 @@ struct thread_info { + .flags = 0, \ + .preempt_count = INIT_PREEMPT_COUNT, \ + .addr_limit = KERNEL_DS, \ +- .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ +- domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ +- domain_val(DOMAIN_IO, DOMAIN_CLIENT), \ ++ .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_USERCLIENT) | \ ++ domain_val(DOMAIN_KERNEL, DOMAIN_KERNELCLIENT) | \ ++ domain_val(DOMAIN_IO, DOMAIN_KERNELCLIENT), \ + .restart_block = { \ + .fn = do_no_restart_syscall, \ + }, \ +@@ -152,6 +152,12 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, #define TIF_SYSCALL_AUDIT 9 + #define TIF_SYSCALL_TRACEPOINT 10 + #define TIF_SECCOMP 11 /* seccomp syscall filtering active */ + +/* within 8 bits of TIF_SYSCALL_TRACE -+ to meet flexible second operand requirements -+*/ -+#define TIF_GRSEC_SETXID 10 ++ * to meet flexible second operand requirements ++ */ ++#define TIF_GRSEC_SETXID 12 + - #define TIF_POLLING_NRFLAG 16 #define TIF_USING_IWMMXT 17 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ -@@ -163,9 +169,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, - #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) - #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) + #define TIF_RESTORE_SIGMASK 20 +@@ -165,10 +171,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, + #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) + #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) +#define _TIF_GRSEC_SETXID (1 << TIF_GRSEC_SETXID) /* Checks for any syscall work in entry-common.S */ --#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT) -+#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ -+ _TIF_GRSEC_SETXID) + #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ +- _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP) ++ _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | _TIF_GRSEC_SETXID) /* * Change these and you break ASM code in entry-common.S diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h -index 71f6536..602f279 100644 +index 7e1f760..752fcb7 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h -@@ -22,6 +22,8 @@ +@@ -18,6 +18,7 @@ + #include <asm/domain.h> + #include <asm/unified.h> + #include <asm/compiler.h> ++#include <asm/pgtable.h> + #define VERIFY_READ 0 #define VERIFY_WRITE 1 +@@ -60,10 +61,34 @@ extern int __put_user_bad(void); + #define USER_DS TASK_SIZE + #define get_fs() (current_thread_info()->addr_limit) -+extern void check_object_size(const void *ptr, unsigned long n, bool to); ++static inline void pax_open_userland(void) ++{ + - /* - * The exception table consists of pairs of addresses: the first is the - * address of an instruction that is allowed to fault, and the second is -@@ -387,8 +389,23 @@ do { \ ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ if (get_fs() == USER_DS) { ++ BUG_ON(test_domain(DOMAIN_USER, DOMAIN_UDEREF)); ++ modify_domain(DOMAIN_USER, DOMAIN_UDEREF); ++ } ++#endif ++ ++} ++ ++static inline void pax_close_userland(void) ++{ ++ ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ if (get_fs() == USER_DS) { ++ BUG_ON(test_domain(DOMAIN_USER, DOMAIN_NOACCESS)); ++ modify_domain(DOMAIN_USER, DOMAIN_NOACCESS); ++ } ++#endif ++ ++} ++ + static inline void set_fs(mm_segment_t fs) + { + current_thread_info()->addr_limit = fs; +- modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER); ++ modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_KERNELCLIENT : DOMAIN_MANAGER); + } + + #define segment_eq(a,b) ((a) == (b)) +@@ -143,8 +168,12 @@ extern int __get_user_4(void *); + + #define get_user(x,p) \ + ({ \ ++ int __e; \ + might_fault(); \ +- __get_user_check(x,p); \ ++ pax_open_userland(); \ ++ __e = __get_user_check(x,p); \ ++ pax_close_userland(); \ ++ __e; \ + }) + + extern int __put_user_1(void *, unsigned int); +@@ -188,8 +217,12 @@ extern int __put_user_8(void *, unsigned long long); + + #define put_user(x,p) \ + ({ \ ++ int __e; \ + might_fault(); \ +- __put_user_check(x,p); \ ++ pax_open_userland(); \ ++ __e = __put_user_check(x,p); \ ++ pax_close_userland(); \ ++ __e; \ + }) + + #else /* CONFIG_MMU */ +@@ -230,13 +263,17 @@ static inline void set_fs(mm_segment_t fs) + #define __get_user(x,ptr) \ + ({ \ + long __gu_err = 0; \ ++ pax_open_userland(); \ + __get_user_err((x),(ptr),__gu_err); \ ++ pax_close_userland(); \ + __gu_err; \ + }) + + #define __get_user_error(x,ptr,err) \ + ({ \ ++ pax_open_userland(); \ + __get_user_err((x),(ptr),err); \ ++ pax_close_userland(); \ + (void) 0; \ + }) + +@@ -312,13 +349,17 @@ do { \ + #define __put_user(x,ptr) \ + ({ \ + long __pu_err = 0; \ ++ pax_open_userland(); \ + __put_user_err((x),(ptr),__pu_err); \ ++ pax_close_userland(); \ + __pu_err; \ + }) + + #define __put_user_error(x,ptr,err) \ + ({ \ ++ pax_open_userland(); \ + __put_user_err((x),(ptr),err); \ ++ pax_close_userland(); \ + (void) 0; \ + }) + +@@ -418,11 +459,44 @@ do { \ #ifdef CONFIG_MMU @@ -1610,22 +2220,44 @@ index 71f6536..602f279 100644 + +static inline unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n) +{ -+ if (!__builtin_constant_p(n)) -+ check_object_size(to, n, false); -+ return ___copy_from_user(to, from, n); ++ unsigned long ret; ++ ++ check_object_size(to, n, false); ++ pax_open_userland(); ++ ret = ___copy_from_user(to, from, n); ++ pax_close_userland(); ++ return ret; +} + +static inline unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n) +{ -+ if (!__builtin_constant_p(n)) -+ check_object_size(from, n, true); -+ return ___copy_to_user(to, from, n); ++ unsigned long ret; ++ ++ check_object_size(from, n, true); ++ pax_open_userland(); ++ ret = ___copy_to_user(to, from, n); ++ pax_close_userland(); ++ return ret; +} + extern unsigned long __must_check __copy_to_user_std(void __user *to, const void *from, unsigned long n); - extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n); +-extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n); ++extern unsigned long __must_check ___clear_user(void __user *addr, unsigned long n); extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n); -@@ -403,6 +420,9 @@ extern unsigned long __must_check __strnlen_user(const char __user *s, long n); ++ ++static inline unsigned long __must_check __clear_user(void __user *addr, unsigned long n) ++{ ++ unsigned long ret; ++ pax_open_userland(); ++ ret = ___clear_user(addr, n); ++ pax_close_userland(); ++ return ret; ++} ++ + #else + #define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) + #define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) +@@ -431,6 +505,9 @@ extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned l static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -1635,7 +2267,7 @@ index 71f6536..602f279 100644 if (access_ok(VERIFY_READ, from, n)) n = __copy_from_user(to, from, n); else /* security hole - plug it */ -@@ -412,6 +432,9 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u +@@ -440,6 +517,9 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n) { @@ -1645,23 +2277,508 @@ index 71f6536..602f279 100644 if (access_ok(VERIFY_WRITE, to, n)) n = __copy_to_user(to, from, n); return n; +diff --git a/arch/arm/include/uapi/asm/ptrace.h b/arch/arm/include/uapi/asm/ptrace.h +index 96ee092..37f1844 100644 +--- a/arch/arm/include/uapi/asm/ptrace.h ++++ b/arch/arm/include/uapi/asm/ptrace.h +@@ -73,7 +73,7 @@ + * ARMv7 groups of PSR bits + */ + #define APSR_MASK 0xf80f0000 /* N, Z, C, V, Q and GE flags */ +-#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */ ++#define PSR_ISET_MASK 0x01000020 /* ISA state (J, T) mask */ + #define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */ + #define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */ + diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c -index b57c75e..ed2d6b2 100644 +index 60d3b73..d27ee09 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c -@@ -94,8 +94,8 @@ EXPORT_SYMBOL(__strncpy_from_user); +@@ -89,9 +89,9 @@ EXPORT_SYMBOL(__memzero); #ifdef CONFIG_MMU EXPORT_SYMBOL(copy_page); -EXPORT_SYMBOL(__copy_from_user); -EXPORT_SYMBOL(__copy_to_user); +-EXPORT_SYMBOL(__clear_user); +EXPORT_SYMBOL(___copy_from_user); +EXPORT_SYMBOL(___copy_to_user); - EXPORT_SYMBOL(__clear_user); ++EXPORT_SYMBOL(___clear_user); EXPORT_SYMBOL(__get_user_1); + EXPORT_SYMBOL(__get_user_2); +diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S +index 0f82098..3dbd3ee 100644 +--- a/arch/arm/kernel/entry-armv.S ++++ b/arch/arm/kernel/entry-armv.S +@@ -47,6 +47,87 @@ + 9997: + .endm + ++ .macro pax_enter_kernel ++#if defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) ++ @ make aligned space for saved DACR ++ sub sp, sp, #8 ++ @ save regs ++ stmdb sp!, {r1, r2} ++ @ read DACR from cpu_domain into r1 ++ mov r2, sp ++ @ assume 8K pages, since we have to split the immediate in two ++ bic r2, r2, #(0x1fc0) ++ bic r2, r2, #(0x3f) ++ ldr r1, [r2, #TI_CPU_DOMAIN] ++ @ store old DACR on stack ++ str r1, [sp, #8] ++#ifdef CONFIG_PAX_KERNEXEC ++ @ set type of DOMAIN_KERNEL to DOMAIN_KERNELCLIENT ++ bic r1, r1, #(domain_val(DOMAIN_KERNEL, 3)) ++ orr r1, r1, #(domain_val(DOMAIN_KERNEL, DOMAIN_KERNELCLIENT)) ++#endif ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ @ set current DOMAIN_USER to DOMAIN_NOACCESS ++ bic r1, r1, #(domain_val(DOMAIN_USER, 3)) ++#endif ++ @ write r1 to current_thread_info()->cpu_domain ++ str r1, [r2, #TI_CPU_DOMAIN] ++ @ write r1 to DACR ++ mcr p15, 0, r1, c3, c0, 0 ++ @ instruction sync ++ instr_sync ++ @ restore regs ++ ldmia sp!, {r1, r2} ++#endif ++ .endm ++ ++ .macro pax_open_userland ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ @ save regs ++ stmdb sp!, {r0, r1} ++ @ read DACR from cpu_domain into r1 ++ mov r0, sp ++ @ assume 8K pages, since we have to split the immediate in two ++ bic r0, r0, #(0x1fc0) ++ bic r0, r0, #(0x3f) ++ ldr r1, [r0, #TI_CPU_DOMAIN] ++ @ set current DOMAIN_USER to DOMAIN_CLIENT ++ bic r1, r1, #(domain_val(DOMAIN_USER, 3)) ++ orr r1, r1, #(domain_val(DOMAIN_USER, DOMAIN_UDEREF)) ++ @ write r1 to current_thread_info()->cpu_domain ++ str r1, [r0, #TI_CPU_DOMAIN] ++ @ write r1 to DACR ++ mcr p15, 0, r1, c3, c0, 0 ++ @ instruction sync ++ instr_sync ++ @ restore regs ++ ldmia sp!, {r0, r1} ++#endif ++ .endm ++ ++ .macro pax_close_userland ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ @ save regs ++ stmdb sp!, {r0, r1} ++ @ read DACR from cpu_domain into r1 ++ mov r0, sp ++ @ assume 8K pages, since we have to split the immediate in two ++ bic r0, r0, #(0x1fc0) ++ bic r0, r0, #(0x3f) ++ ldr r1, [r0, #TI_CPU_DOMAIN] ++ @ set current DOMAIN_USER to DOMAIN_NOACCESS ++ bic r1, r1, #(domain_val(DOMAIN_USER, 3)) ++ @ write r1 to current_thread_info()->cpu_domain ++ str r1, [r0, #TI_CPU_DOMAIN] ++ @ write r1 to DACR ++ mcr p15, 0, r1, c3, c0, 0 ++ @ instruction sync ++ instr_sync ++ @ restore regs ++ ldmia sp!, {r0, r1} ++#endif ++ .endm ++ + .macro pabt_helper + @ PABORT handler takes pt_regs in r2, fault address in r4 and psr in r5 + #ifdef MULTI_PABORT +@@ -89,11 +170,15 @@ + * Invalid mode handlers + */ + .macro inv_entry, reason ++ ++ pax_enter_kernel ++ + sub sp, sp, #S_FRAME_SIZE + ARM( stmib sp, {r1 - lr} ) + THUMB( stmia sp, {r0 - r12} ) + THUMB( str sp, [sp, #S_SP] ) + THUMB( str lr, [sp, #S_LR] ) ++ + mov r1, #\reason + .endm + +@@ -149,7 +234,11 @@ ENDPROC(__und_invalid) + .macro svc_entry, stack_hole=0 + UNWIND(.fnstart ) + UNWIND(.save {r0 - pc} ) ++ ++ pax_enter_kernel ++ + sub sp, sp, #(S_FRAME_SIZE + \stack_hole - 4) ++ + #ifdef CONFIG_THUMB2_KERNEL + SPFIX( str r0, [sp] ) @ temporarily saved + SPFIX( mov r0, sp ) +@@ -164,7 +253,12 @@ ENDPROC(__und_invalid) + ldmia r0, {r3 - r5} + add r7, sp, #S_SP - 4 @ here for interlock avoidance + mov r6, #-1 @ "" "" "" "" ++#if defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) ++ @ offset sp by 8 as done in pax_enter_kernel ++ add r2, sp, #(S_FRAME_SIZE + \stack_hole + 4) ++#else + add r2, sp, #(S_FRAME_SIZE + \stack_hole - 4) ++#endif + SPFIX( addeq r2, r2, #4 ) + str r3, [sp, #-4]! @ save the "real" r0 copied + @ from the exception stack +@@ -359,6 +453,9 @@ ENDPROC(__pabt_svc) + .macro usr_entry + UNWIND(.fnstart ) + UNWIND(.cantunwind ) @ don't unwind the user space ++ ++ pax_enter_kernel_user ++ + sub sp, sp, #S_FRAME_SIZE + ARM( stmib sp, {r1 - r12} ) + THUMB( stmia sp, {r0 - r12} ) +@@ -456,7 +553,9 @@ __und_usr: + tst r3, #PSR_T_BIT @ Thumb mode? + bne __und_usr_thumb + sub r4, r2, #4 @ ARM instr at LR - 4 ++ pax_open_userland + 1: ldrt r0, [r4] ++ pax_close_userland + #ifdef CONFIG_CPU_ENDIAN_BE8 + rev r0, r0 @ little endian instruction + #endif +@@ -491,10 +590,14 @@ __und_usr_thumb: + */ + .arch armv6t2 + #endif ++ pax_open_userland + 2: ldrht r5, [r4] ++ pax_close_userland + cmp r5, #0xe800 @ 32bit instruction if xx != 0 + blo __und_usr_fault_16 @ 16bit undefined instruction ++ pax_open_userland + 3: ldrht r0, [r2] ++ pax_close_userland + add r2, r2, #2 @ r2 is PC + 2, make it PC + 4 + str r2, [sp, #S_PC] @ it's a 2x16bit instr, update + orr r0, r0, r5, lsl #16 +@@ -733,7 +836,7 @@ ENTRY(__switch_to) + THUMB( stmia ip!, {r4 - sl, fp} ) @ Store most regs on stack + THUMB( str sp, [ip], #4 ) + THUMB( str lr, [ip], #4 ) +-#ifdef CONFIG_CPU_USE_DOMAINS ++#if defined(CONFIG_CPU_USE_DOMAINS) || defined(CONFIG_PAX_KERNEXEC) + ldr r6, [r2, #TI_CPU_DOMAIN] + #endif + set_tls r3, r4, r5 +@@ -742,7 +845,7 @@ ENTRY(__switch_to) + ldr r8, =__stack_chk_guard + ldr r7, [r7, #TSK_STACK_CANARY] + #endif +-#ifdef CONFIG_CPU_USE_DOMAINS ++#if defined(CONFIG_CPU_USE_DOMAINS) || defined(CONFIG_PAX_KERNEXEC) + mcr p15, 0, r6, c3, c0, 0 @ Set domain register + #endif + mov r5, r0 +diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S +index fefd7f9..e6f250e 100644 +--- a/arch/arm/kernel/entry-common.S ++++ b/arch/arm/kernel/entry-common.S +@@ -10,18 +10,46 @@ + + #include <asm/unistd.h> + #include <asm/ftrace.h> ++#include <asm/domain.h> + #include <asm/unwind.h> + ++#include "entry-header.S" ++ + #ifdef CONFIG_NEED_RET_TO_USER + #include <mach/entry-macro.S> + #else + .macro arch_ret_to_user, tmp1, tmp2 ++#if defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) ++ @ save regs ++ stmdb sp!, {r1, r2} ++ @ read DACR from cpu_domain into r1 ++ mov r2, sp ++ @ assume 8K pages, since we have to split the immediate in two ++ bic r2, r2, #(0x1fc0) ++ bic r2, r2, #(0x3f) ++ ldr r1, [r2, #TI_CPU_DOMAIN] ++#ifdef CONFIG_PAX_KERNEXEC ++ @ set type of DOMAIN_KERNEL to DOMAIN_KERNELCLIENT ++ bic r1, r1, #(domain_val(DOMAIN_KERNEL, 3)) ++ orr r1, r1, #(domain_val(DOMAIN_KERNEL, DOMAIN_KERNELCLIENT)) ++#endif ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ @ set current DOMAIN_USER to DOMAIN_UDEREF ++ bic r1, r1, #(domain_val(DOMAIN_USER, 3)) ++ orr r1, r1, #(domain_val(DOMAIN_USER, DOMAIN_UDEREF)) ++#endif ++ @ write r1 to current_thread_info()->cpu_domain ++ str r1, [r2, #TI_CPU_DOMAIN] ++ @ write r1 to DACR ++ mcr p15, 0, r1, c3, c0, 0 ++ @ instruction sync ++ instr_sync ++ @ restore regs ++ ldmia sp!, {r1, r2} ++#endif + .endm + #endif + +-#include "entry-header.S" +- +- + .align 5 + /* + * This is the fast syscall return path. We do as little as +@@ -351,6 +379,7 @@ ENDPROC(ftrace_stub) + + .align 5 + ENTRY(vector_swi) ++ + sub sp, sp, #S_FRAME_SIZE + stmia sp, {r0 - r12} @ Calling r0 - r12 + ARM( add r8, sp, #S_PC ) +@@ -400,6 +429,12 @@ ENTRY(vector_swi) + ldr scno, [lr, #-4] @ get SWI instruction + #endif + ++ /* ++ * do this here to avoid a performance hit of wrapping the code above ++ * that directly dereferences userland to parse the SWI instruction ++ */ ++ pax_enter_kernel_user ++ + #ifdef CONFIG_ALIGNMENT_TRAP + ldr ip, __cr_alignment + ldr ip, [ip] +diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S +index 9a8531e..812e287 100644 +--- a/arch/arm/kernel/entry-header.S ++++ b/arch/arm/kernel/entry-header.S +@@ -73,9 +73,66 @@ + msr cpsr_c, \rtemp @ switch back to the SVC mode + .endm + ++ .macro pax_enter_kernel_user ++#if defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) ++ @ save regs ++ stmdb sp!, {r0, r1} ++ @ read DACR from cpu_domain into r1 ++ mov r0, sp ++ @ assume 8K pages, since we have to split the immediate in two ++ bic r0, r0, #(0x1fc0) ++ bic r0, r0, #(0x3f) ++ ldr r1, [r0, #TI_CPU_DOMAIN] ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ @ set current DOMAIN_USER to DOMAIN_NOACCESS ++ bic r1, r1, #(domain_val(DOMAIN_USER, 3)) ++#endif ++#ifdef CONFIG_PAX_KERNEXEC ++ @ set current DOMAIN_KERNEL to DOMAIN_KERNELCLIENT ++ bic r1, r1, #(domain_val(DOMAIN_KERNEL, 3)) ++ orr r1, r1, #(domain_val(DOMAIN_KERNEL, DOMAIN_KERNELCLIENT)) ++#endif ++ @ write r1 to current_thread_info()->cpu_domain ++ str r1, [r0, #TI_CPU_DOMAIN] ++ @ write r1 to DACR ++ mcr p15, 0, r1, c3, c0, 0 ++ @ instruction sync ++ instr_sync ++ @ restore regs ++ ldmia sp!, {r0, r1} ++#endif ++ .endm ++ ++ .macro pax_exit_kernel ++#if defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) ++ @ save regs ++ stmdb sp!, {r0, r1} ++ @ read old DACR from stack into r1 ++ ldr r1, [sp, #(8 + S_SP)] ++ sub r1, r1, #8 ++ ldr r1, [r1] ++ ++ @ write r1 to current_thread_info()->cpu_domain ++ mov r0, sp ++ @ assume 8K pages, since we have to split the immediate in two ++ bic r0, r0, #(0x1fc0) ++ bic r0, r0, #(0x3f) ++ str r1, [r0, #TI_CPU_DOMAIN] ++ @ write r1 to DACR ++ mcr p15, 0, r1, c3, c0, 0 ++ @ instruction sync ++ instr_sync ++ @ restore regs ++ ldmia sp!, {r0, r1} ++#endif ++ .endm ++ + #ifndef CONFIG_THUMB2_KERNEL + .macro svc_exit, rpsr + msr spsr_cxsf, \rpsr ++ ++ pax_exit_kernel ++ + #if defined(CONFIG_CPU_V6) + ldr r0, [sp] + strex r1, r2, [sp] @ clear the exclusive monitor +@@ -121,6 +178,9 @@ + .endm + #else /* CONFIG_THUMB2_KERNEL */ + .macro svc_exit, rpsr ++ ++ pax_exit_kernel ++ + ldr lr, [sp, #S_SP] @ top of the stack + ldrd r0, r1, [sp, #S_LR] @ calling lr and pc + clrex @ clear the exclusive monitor +diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c +index 2adda11..7fbe958 100644 +--- a/arch/arm/kernel/fiq.c ++++ b/arch/arm/kernel/fiq.c +@@ -82,7 +82,9 @@ void set_fiq_handler(void *start, unsigned int length) + #if defined(CONFIG_CPU_USE_DOMAINS) + memcpy((void *)0xffff001c, start, length); + #else ++ pax_open_kernel(); + memcpy(vectors_page + 0x1c, start, length); ++ pax_close_kernel(); + #endif + flush_icache_range(0xffff001c, 0xffff001c + length); + if (!vectors_high()) +diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S +index 8bac553..caee108 100644 +--- a/arch/arm/kernel/head.S ++++ b/arch/arm/kernel/head.S +@@ -52,7 +52,9 @@ + .equ swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE + + .macro pgtbl, rd, phys +- add \rd, \phys, #TEXT_OFFSET - PG_DIR_SIZE ++ mov \rd, #TEXT_OFFSET ++ sub \rd, #PG_DIR_SIZE ++ add \rd, \rd, \phys + .endm + + /* +@@ -434,7 +436,7 @@ __enable_mmu: + mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ + domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ + domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \ +- domain_val(DOMAIN_IO, DOMAIN_CLIENT)) ++ domain_val(DOMAIN_IO, DOMAIN_KERNELCLIENT)) + mcr p15, 0, r5, c3, c0, 0 @ load domain access register + mcr p15, 0, r4, c2, c0, 0 @ load page table pointer + #endif +diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c +index 1fd749e..47adb08 100644 +--- a/arch/arm/kernel/hw_breakpoint.c ++++ b/arch/arm/kernel/hw_breakpoint.c +@@ -1029,7 +1029,7 @@ static int __cpuinit dbg_reset_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata dbg_reset_nb = { ++static struct notifier_block dbg_reset_nb = { + .notifier_call = dbg_reset_notify, + }; + +diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c +index 1e9be5d..03edbc2 100644 +--- a/arch/arm/kernel/module.c ++++ b/arch/arm/kernel/module.c +@@ -37,12 +37,37 @@ + #endif + + #ifdef CONFIG_MMU +-void *module_alloc(unsigned long size) ++static inline void *__module_alloc(unsigned long size, pgprot_t prot) + { ++ if (!size || PAGE_ALIGN(size) > MODULES_END - MODULES_VADDR) ++ return NULL; + return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, +- GFP_KERNEL, PAGE_KERNEL_EXEC, -1, ++ GFP_KERNEL, prot, -1, + __builtin_return_address(0)); + } ++ ++void *module_alloc(unsigned long size) ++{ ++ ++#ifdef CONFIG_PAX_KERNEXEC ++ return __module_alloc(size, PAGE_KERNEL); ++#else ++ return __module_alloc(size, PAGE_KERNEL_EXEC); ++#endif ++ ++} ++ ++#ifdef CONFIG_PAX_KERNEXEC ++void module_free_exec(struct module *mod, void *module_region) ++{ ++ module_free(mod, module_region); ++} ++ ++void *module_alloc_exec(unsigned long size) ++{ ++ return __module_alloc(size, PAGE_KERNEL_EXEC); ++} ++#endif + #endif + + int +diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c +index 07314af..c46655c 100644 +--- a/arch/arm/kernel/patch.c ++++ b/arch/arm/kernel/patch.c +@@ -18,6 +18,7 @@ void __kprobes __patch_text(void *addr, unsigned int insn) + bool thumb2 = IS_ENABLED(CONFIG_THUMB2_KERNEL); + int size; + ++ pax_open_kernel(); + if (thumb2 && __opcode_is_thumb16(insn)) { + *(u16 *)addr = __opcode_to_mem_thumb16(insn); + size = sizeof(u16); +@@ -39,6 +40,7 @@ void __kprobes __patch_text(void *addr, unsigned int insn) + *(u32 *)addr = insn; + size = sizeof(u32); + } ++ pax_close_kernel(); + + flush_icache_range((uintptr_t)(addr), + (uintptr_t)(addr) + size); +diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c +index 1f2740e..b36e225 100644 +--- a/arch/arm/kernel/perf_event_cpu.c ++++ b/arch/arm/kernel/perf_event_cpu.c +@@ -171,7 +171,7 @@ static int __cpuinit cpu_pmu_notify(struct notifier_block *b, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata cpu_pmu_hotplug_notifier = { ++static struct notifier_block cpu_pmu_hotplug_notifier = { + .notifier_call = cpu_pmu_notify, + }; + diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c -index 48f3624..eabfb29 100644 +index 047d3e4..7e96107 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -28,7 +28,6 @@ @@ -1671,8 +2788,8 @@ index 48f3624..eabfb29 100644 -#include <linux/random.h> #include <linux/hw_breakpoint.h> #include <linux/cpuidle.h> - -@@ -276,9 +275,10 @@ void machine_power_off(void) + #include <linux/leds.h> +@@ -251,9 +250,10 @@ void machine_power_off(void) machine_shutdown(); if (pm_power_off) pm_power_off(); @@ -1684,7 +2801,18 @@ index 48f3624..eabfb29 100644 { machine_shutdown(); -@@ -521,12 +521,6 @@ unsigned long get_wchan(struct task_struct *p) +@@ -278,8 +278,8 @@ void __show_regs(struct pt_regs *regs) + init_utsname()->release, + (int)strcspn(init_utsname()->version, " "), + init_utsname()->version); +- print_symbol("PC is at %s\n", instruction_pointer(regs)); +- print_symbol("LR is at %s\n", regs->ARM_lr); ++ printk("PC is at %pA\n", instruction_pointer(regs)); ++ printk("LR is at %pA\n", regs->ARM_lr); + printk("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n" + "sp : %08lx ip : %08lx fp : %08lx\n", + regs->ARM_pc, regs->ARM_lr, regs->ARM_cpsr, +@@ -447,12 +447,6 @@ unsigned long get_wchan(struct task_struct *p) return 0; } @@ -1697,36 +2825,73 @@ index 48f3624..eabfb29 100644 #ifdef CONFIG_MMU /* * The vectors page is always readable from user space for the +@@ -465,9 +459,8 @@ static int __init gate_vma_init(void) + { + gate_vma.vm_start = 0xffff0000; + gate_vma.vm_end = 0xffff0000 + PAGE_SIZE; +- gate_vma.vm_page_prot = PAGE_READONLY_EXEC; +- gate_vma.vm_flags = VM_READ | VM_EXEC | +- VM_MAYREAD | VM_MAYEXEC; ++ gate_vma.vm_flags = VM_NONE; ++ gate_vma.vm_page_prot = vm_get_page_prot(gate_vma.vm_flags); + return 0; + } + arch_initcall(gate_vma_init); +diff --git a/arch/arm/kernel/psci.c b/arch/arm/kernel/psci.c +index 3653164..d83e55d 100644 +--- a/arch/arm/kernel/psci.c ++++ b/arch/arm/kernel/psci.c +@@ -24,7 +24,7 @@ + #include <asm/opcodes-virt.h> + #include <asm/psci.h> + +-struct psci_operations psci_ops; ++struct psci_operations psci_ops __read_only; + + static int (*invoke_psci_fn)(u32, u32, u32, u32); + diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c -index 9650c14..ae30cdd 100644 +index 03deeff..741ce88 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c -@@ -906,10 +906,19 @@ long arch_ptrace(struct task_struct *child, long request, - return ret; +@@ -937,10 +937,19 @@ static int tracehook_report_syscall(struct pt_regs *regs, + return current_thread_info()->syscall; } +#ifdef CONFIG_GRKERNSEC_SETXID +extern void gr_delayed_cred_worker(void); +#endif + - asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) + asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno) { - unsigned long ip; + current_thread_info()->syscall = scno; +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) + gr_delayed_cred_worker(); +#endif + - if (why) - audit_syscall_exit(regs); - else + /* Do the secure computing check first; failures should be fast. */ + if (secure_computing(scno) == -1) + return -1; diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c -index ebfac78..cbea9c0 100644 +index 234e339..81264a1 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c -@@ -111,13 +111,13 @@ struct processor processor __read_mostly; - struct cpu_tlb_fns cpu_tlb __read_mostly; +@@ -96,21 +96,23 @@ EXPORT_SYMBOL(system_serial_high); + unsigned int elf_hwcap __read_mostly; + EXPORT_SYMBOL(elf_hwcap); + ++pteval_t __supported_pte_mask __read_only; ++pmdval_t __supported_pmd_mask __read_only; + + #ifdef MULTI_CPU +-struct processor processor __read_mostly; ++struct processor processor; + #endif + #ifdef MULTI_TLB +-struct cpu_tlb_fns cpu_tlb __read_mostly; ++struct cpu_tlb_fns cpu_tlb __read_only; #endif #ifdef MULTI_USER -struct cpu_user_fns cpu_user __read_mostly; @@ -1742,29 +2907,230 @@ index ebfac78..cbea9c0 100644 EXPORT_SYMBOL(outer_cache); #endif +@@ -235,9 +237,13 @@ static int __get_cpu_architecture(void) + asm("mrc p15, 0, %0, c0, c1, 4" + : "=r" (mmfr0)); + if ((mmfr0 & 0x0000000f) >= 0x00000003 || +- (mmfr0 & 0x000000f0) >= 0x00000030) ++ (mmfr0 & 0x000000f0) >= 0x00000030) { + cpu_arch = CPU_ARCH_ARMv7; +- else if ((mmfr0 & 0x0000000f) == 0x00000002 || ++ if ((mmfr0 & 0x0000000f) == 0x00000005 || (mmfr0 & 0x0000000f) == 0x00000004) { ++ __supported_pte_mask |= L_PTE_PXN; ++ __supported_pmd_mask |= PMD_PXNTABLE; ++ } ++ } else if ((mmfr0 & 0x0000000f) == 0x00000002 || + (mmfr0 & 0x000000f0) == 0x00000020) + cpu_arch = CPU_ARCH_ARMv6; + else +@@ -478,7 +484,7 @@ static void __init setup_processor(void) + __cpu_architecture = __get_cpu_architecture(); + + #ifdef MULTI_CPU +- processor = *list->proc; ++ memcpy((void *)&processor, list->proc, sizeof processor); + #endif + #ifdef MULTI_TLB + cpu_tlb = *list->tlb; +diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c +index 296786b..a8d4dd5 100644 +--- a/arch/arm/kernel/signal.c ++++ b/arch/arm/kernel/signal.c +@@ -396,22 +396,14 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig, + __put_user(sigreturn_codes[idx+1], rc+1)) + return 1; + +- if (cpsr & MODE32_BIT) { +- /* +- * 32-bit code can use the new high-page +- * signal return code support. +- */ +- retcode = KERN_SIGRETURN_CODE + (idx << 2) + thumb; +- } else { +- /* +- * Ensure that the instruction cache sees +- * the return code written onto the stack. +- */ +- flush_icache_range((unsigned long)rc, +- (unsigned long)(rc + 2)); ++ /* ++ * Ensure that the instruction cache sees ++ * the return code written onto the stack. ++ */ ++ flush_icache_range((unsigned long)rc, ++ (unsigned long)(rc + 2)); + +- retcode = ((unsigned long)rc) + thumb; +- } ++ retcode = ((unsigned long)rc) + thumb; + } + + regs->ARM_r0 = map_sig(ksig->sig); +diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c +index 1f2cccc..f40c02e 100644 +--- a/arch/arm/kernel/smp.c ++++ b/arch/arm/kernel/smp.c +@@ -70,7 +70,7 @@ enum ipi_msg_type { + + static DECLARE_COMPLETION(cpu_running); + +-static struct smp_operations smp_ops; ++static struct smp_operations smp_ops __read_only; + + void __init smp_set_ops(struct smp_operations *ops) + { diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c -index a8ad1e3..859d689 100644 +index 1c08911..264f009 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c -@@ -264,6 +264,8 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt - - static DEFINE_RAW_SPINLOCK(die_lock); +@@ -57,7 +57,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long); + void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) + { + #ifdef CONFIG_KALLSYMS +- printk("[<%08lx>] (%pS) from [<%08lx>] (%pS)\n", where, (void *)where, from, (void *)from); ++ printk("[<%08lx>] (%pA) from [<%08lx>] (%pA)\n", where, (void *)where, from, (void *)from); + #else + printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); + #endif +@@ -266,6 +266,8 @@ static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; + static int die_owner = -1; + static unsigned int die_nest_count; +extern void gr_handle_kernel_exploit(void); + - /* - * This function is protected against re-entrancy. - */ -@@ -296,6 +298,9 @@ void die(const char *str, struct pt_regs *regs, int err) + static unsigned long oops_begin(void) + { + int cpu; +@@ -308,6 +310,9 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr) panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); + + gr_handle_kernel_exploit(); + - if (ret != NOTIFY_STOP) - do_exit(SIGSEGV); + if (signr) + do_exit(signr); } +@@ -601,7 +606,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) + * The user helper at 0xffff0fe0 must be used instead. + * (see entry-armv.S for details) + */ ++ pax_open_kernel(); + *((unsigned int *)0xffff0ff0) = regs->ARM_r0; ++ pax_close_kernel(); + } + return 0; + +@@ -841,13 +848,10 @@ void __init early_trap_init(void *vectors_base) + */ + kuser_get_tls_init(vectors); + +- /* +- * Copy signal return handlers into the vector page, and +- * set sigreturn to be a pointer to these. +- */ +- memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE), +- sigreturn_codes, sizeof(sigreturn_codes)); +- + flush_icache_range(vectors, vectors + PAGE_SIZE); +- modify_domain(DOMAIN_USER, DOMAIN_CLIENT); ++ ++#ifndef CONFIG_PAX_MEMORY_UDEREF ++ modify_domain(DOMAIN_USER, DOMAIN_USERCLIENT); ++#endif ++ + } +diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S +index b571484..4b2fc9b 100644 +--- a/arch/arm/kernel/vmlinux.lds.S ++++ b/arch/arm/kernel/vmlinux.lds.S +@@ -8,7 +8,11 @@ + #include <asm/thread_info.h> + #include <asm/memory.h> + #include <asm/page.h> +- ++ ++#ifdef CONFIG_PAX_KERNEXEC ++#include <asm/pgtable.h> ++#endif ++ + #define PROC_INFO \ + . = ALIGN(4); \ + VMLINUX_SYMBOL(__proc_info_begin) = .; \ +@@ -94,6 +98,11 @@ SECTIONS + _text = .; + HEAD_TEXT + } ++ ++#ifdef CONFIG_PAX_KERNEXEC ++ . = ALIGN(1<<SECTION_SHIFT); ++#endif ++ + .text : { /* Real text segment */ + _stext = .; /* Text and read-only data */ + __exception_text_start = .; +@@ -116,6 +125,8 @@ SECTIONS + ARM_CPU_KEEP(PROC_INFO) + } + ++ _etext = .; /* End of text section */ ++ + RO_DATA(PAGE_SIZE) + + . = ALIGN(4); +@@ -146,7 +157,9 @@ SECTIONS + + NOTES + +- _etext = .; /* End of text and rodata section */ ++#ifdef CONFIG_PAX_KERNEXEC ++ . = ALIGN(1<<SECTION_SHIFT); ++#endif + + #ifndef CONFIG_XIP_KERNEL + . = ALIGN(PAGE_SIZE); +@@ -207,6 +220,11 @@ SECTIONS + . = PAGE_OFFSET + TEXT_OFFSET; + #else + __init_end = .; ++ ++#ifdef CONFIG_PAX_KERNEXEC ++ . = ALIGN(1<<SECTION_SHIFT); ++#endif ++ + . = ALIGN(THREAD_SIZE); + __data_loc = .; + #endif +diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S +index 14a0d98..7771a7d 100644 +--- a/arch/arm/lib/clear_user.S ++++ b/arch/arm/lib/clear_user.S +@@ -12,14 +12,14 @@ + + .text + +-/* Prototype: int __clear_user(void *addr, size_t sz) ++/* Prototype: int ___clear_user(void *addr, size_t sz) + * Purpose : clear some user memory + * Params : addr - user memory address to clear + * : sz - number of bytes to clear + * Returns : number of bytes NOT cleared + */ + ENTRY(__clear_user_std) +-WEAK(__clear_user) ++WEAK(___clear_user) + stmfd sp!, {r1, lr} + mov r2, #0 + cmp r1, #4 +@@ -44,7 +44,7 @@ WEAK(__clear_user) + USER( strnebt r2, [r0]) + mov r0, #0 + ldmfd sp!, {r1, pc} +-ENDPROC(__clear_user) ++ENDPROC(___clear_user) + ENDPROC(__clear_user_std) + + .pushsection .fixup,"ax" diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S index 66a477a..bee61d3 100644 --- a/arch/arm/lib/copy_from_user.S @@ -1831,63 +3197,34 @@ index d066df6..df28194 100644 ENDPROC(__copy_to_user_std) .pushsection .fixup,"ax" -diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S -index 5c908b1..e712687 100644 ---- a/arch/arm/lib/uaccess.S -+++ b/arch/arm/lib/uaccess.S -@@ -20,7 +20,7 @@ - - #define PAGE_SHIFT 12 - --/* Prototype: int __copy_to_user(void *to, const char *from, size_t n) -+/* Prototype: int ___copy_to_user(void *to, const char *from, size_t n) - * Purpose : copy a block to user memory from kernel memory - * Params : to - user memory - * : from - kernel memory -@@ -40,7 +40,7 @@ USER( TUSER( strgtb) r3, [r0], #1) @ May fault - sub r2, r2, ip - b .Lc2u_dest_aligned - --ENTRY(__copy_to_user) -+ENTRY(___copy_to_user) - stmfd sp!, {r2, r4 - r7, lr} - cmp r2, #4 - blt .Lc2u_not_enough -@@ -278,14 +278,14 @@ USER( TUSER( strgeb) r3, [r0], #1) @ May fault - ldrgtb r3, [r1], #0 - USER( TUSER( strgtb) r3, [r0], #1) @ May fault - b .Lc2u_finished --ENDPROC(__copy_to_user) -+ENDPROC(___copy_to_user) +diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialcopyuser.S +index 7d08b43..f7ca7ea 100644 +--- a/arch/arm/lib/csumpartialcopyuser.S ++++ b/arch/arm/lib/csumpartialcopyuser.S +@@ -57,8 +57,8 @@ + * Returns : r0 = checksum, [[sp, #0], #0] = 0 or -EFAULT + */ - .pushsection .fixup,"ax" - .align 0 - 9001: ldmfd sp!, {r0, r4 - r7, pc} - .popsection - --/* Prototype: unsigned long __copy_from_user(void *to,const void *from,unsigned long n); -+/* Prototype: unsigned long ___copy_from_user(void *to,const void *from,unsigned long n); - * Purpose : copy a block from user memory to kernel memory - * Params : to - kernel memory - * : from - user memory -@@ -304,7 +304,7 @@ USER( TUSER( ldrgtb) r3, [r1], #1) @ May fault - sub r2, r2, ip - b .Lcfu_dest_aligned +-#define FN_ENTRY ENTRY(csum_partial_copy_from_user) +-#define FN_EXIT ENDPROC(csum_partial_copy_from_user) ++#define FN_ENTRY ENTRY(__csum_partial_copy_from_user) ++#define FN_EXIT ENDPROC(__csum_partial_copy_from_user) --ENTRY(__copy_from_user) -+ENTRY(___copy_from_user) - stmfd sp!, {r0, r2, r4 - r7, lr} - cmp r2, #4 - blt .Lcfu_not_enough -@@ -544,7 +544,7 @@ USER( TUSER( ldrgeb) r3, [r1], #1) @ May fault - USER( TUSER( ldrgtb) r3, [r1], #1) @ May fault - strgtb r3, [r0], #1 - b .Lcfu_finished --ENDPROC(__copy_from_user) -+ENDPROC(___copy_from_user) + #include "csumpartialcopygeneric.S" - .pushsection .fixup,"ax" - .align 0 +diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c +index 64dbfa5..84a3fd9 100644 +--- a/arch/arm/lib/delay.c ++++ b/arch/arm/lib/delay.c +@@ -28,7 +28,7 @@ + /* + * Default to the loop-based delay implementation. + */ +-struct arm_delay_ops arm_delay_ops = { ++struct arm_delay_ops arm_delay_ops __read_only = { + .delay = __loop_delay, + .const_udelay = __loop_const_udelay, + .udelay = __loop_udelay, diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c index 025f742..8432b08 100644 --- a/arch/arm/lib/uaccess_with_memcpy.c @@ -1901,11 +3238,48 @@ index 025f742..8432b08 100644 { /* * This test is stubbed out of the main function above to keep +diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c +index 49792a0..f192052 100644 +--- a/arch/arm/mach-kirkwood/common.c ++++ b/arch/arm/mach-kirkwood/common.c +@@ -150,7 +150,16 @@ static void clk_gate_fn_disable(struct clk_hw *hw) + clk_gate_ops.disable(hw); + } + +-static struct clk_ops clk_gate_fn_ops; ++static int clk_gate_fn_is_enabled(struct clk_hw *hw) ++{ ++ return clk_gate_ops.is_enabled(hw); ++} ++ ++static struct clk_ops clk_gate_fn_ops = { ++ .enable = clk_gate_fn_enable, ++ .disable = clk_gate_fn_disable, ++ .is_enabled = clk_gate_fn_is_enabled, ++}; + + static struct clk __init *clk_register_gate_fn(struct device *dev, + const char *name, +@@ -184,14 +193,6 @@ static struct clk __init *clk_register_gate_fn(struct device *dev, + gate_fn->fn_en = fn_en; + gate_fn->fn_dis = fn_dis; + +- /* ops is the gate ops, but with our enable/disable functions */ +- if (clk_gate_fn_ops.enable != clk_gate_fn_enable || +- clk_gate_fn_ops.disable != clk_gate_fn_disable) { +- clk_gate_fn_ops = clk_gate_ops; +- clk_gate_fn_ops.enable = clk_gate_fn_enable; +- clk_gate_fn_ops.disable = clk_gate_fn_disable; +- } +- + clk = clk_register(dev, &gate_fn->gate.hw); + + if (IS_ERR(clk)) diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c -index 518091c..eae9a76 100644 +index f6eeb87..cc90868 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c -@@ -596,7 +596,7 @@ static int n8x0_menelaus_late_init(struct device *dev) +@@ -631,7 +631,7 @@ static int n8x0_menelaus_late_init(struct device *dev) } #endif @@ -1914,11 +3288,286 @@ index 518091c..eae9a76 100644 .late_init = n8x0_menelaus_late_init, }; +diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c +index 410e1ba..1d2dd59 100644 +--- a/arch/arm/mach-omap2/gpmc.c ++++ b/arch/arm/mach-omap2/gpmc.c +@@ -145,7 +145,6 @@ struct omap3_gpmc_regs { + }; + + static struct gpmc_client_irq gpmc_client_irq[GPMC_NR_IRQ]; +-static struct irq_chip gpmc_irq_chip; + static unsigned gpmc_irq_start; + + static struct resource gpmc_mem_root; +@@ -707,6 +706,18 @@ static void gpmc_irq_noop(struct irq_data *data) { } + + static unsigned int gpmc_irq_noop_ret(struct irq_data *data) { return 0; } + ++static struct irq_chip gpmc_irq_chip = { ++ .name = "gpmc", ++ .irq_startup = gpmc_irq_noop_ret, ++ .irq_enable = gpmc_irq_enable, ++ .irq_disable = gpmc_irq_disable, ++ .irq_shutdown = gpmc_irq_noop, ++ .irq_ack = gpmc_irq_noop, ++ .irq_mask = gpmc_irq_noop, ++ .irq_unmask = gpmc_irq_noop, ++ ++}; ++ + static int gpmc_setup_irq(void) + { + int i; +@@ -721,15 +732,6 @@ static int gpmc_setup_irq(void) + return gpmc_irq_start; + } + +- gpmc_irq_chip.name = "gpmc"; +- gpmc_irq_chip.irq_startup = gpmc_irq_noop_ret; +- gpmc_irq_chip.irq_enable = gpmc_irq_enable; +- gpmc_irq_chip.irq_disable = gpmc_irq_disable; +- gpmc_irq_chip.irq_shutdown = gpmc_irq_noop; +- gpmc_irq_chip.irq_ack = gpmc_irq_noop; +- gpmc_irq_chip.irq_mask = gpmc_irq_noop; +- gpmc_irq_chip.irq_unmask = gpmc_irq_noop; +- + gpmc_client_irq[0].bitmask = GPMC_IRQ_FIFOEVENTENABLE; + gpmc_client_irq[1].bitmask = GPMC_IRQ_COUNT_EVENT; + +diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c +index f8bb3b9..831e7b8 100644 +--- a/arch/arm/mach-omap2/omap-wakeupgen.c ++++ b/arch/arm/mach-omap2/omap-wakeupgen.c +@@ -339,7 +339,7 @@ static int __cpuinit irq_cpu_hotplug_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __refdata irq_hotplug_notifier = { ++static struct notifier_block irq_hotplug_notifier = { + .notifier_call = irq_cpu_hotplug_notify, + }; + +diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c +index 381be7a..89b9c7e 100644 +--- a/arch/arm/mach-omap2/omap_device.c ++++ b/arch/arm/mach-omap2/omap_device.c +@@ -499,7 +499,7 @@ void omap_device_delete(struct omap_device *od) + struct platform_device __init *omap_device_build(const char *pdev_name, + int pdev_id, + struct omap_hwmod *oh, +- void *pdata, int pdata_len) ++ const void *pdata, int pdata_len) + { + struct omap_hwmod *ohs[] = { oh }; + +@@ -527,7 +527,7 @@ struct platform_device __init *omap_device_build(const char *pdev_name, + struct platform_device __init *omap_device_build_ss(const char *pdev_name, + int pdev_id, + struct omap_hwmod **ohs, +- int oh_cnt, void *pdata, ++ int oh_cnt, const void *pdata, + int pdata_len) + { + int ret = -ENOMEM; +diff --git a/arch/arm/mach-omap2/omap_device.h b/arch/arm/mach-omap2/omap_device.h +index 044c31d..2ee0861 100644 +--- a/arch/arm/mach-omap2/omap_device.h ++++ b/arch/arm/mach-omap2/omap_device.h +@@ -72,12 +72,12 @@ int omap_device_idle(struct platform_device *pdev); + /* Core code interface */ + + struct platform_device *omap_device_build(const char *pdev_name, int pdev_id, +- struct omap_hwmod *oh, void *pdata, ++ struct omap_hwmod *oh, const void *pdata, + int pdata_len); + + struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, + struct omap_hwmod **oh, int oh_cnt, +- void *pdata, int pdata_len); ++ const void *pdata, int pdata_len); + + struct omap_device *omap_device_alloc(struct platform_device *pdev, + struct omap_hwmod **ohs, int oh_cnt); +diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c +index a202a47..c430564 100644 +--- a/arch/arm/mach-omap2/omap_hwmod.c ++++ b/arch/arm/mach-omap2/omap_hwmod.c +@@ -191,10 +191,10 @@ struct omap_hwmod_soc_ops { + int (*init_clkdm)(struct omap_hwmod *oh); + void (*update_context_lost)(struct omap_hwmod *oh); + int (*get_context_lost)(struct omap_hwmod *oh); +-}; ++} __no_const; + + /* soc_ops: adapts the omap_hwmod code to the currently-booted SoC */ +-static struct omap_hwmod_soc_ops soc_ops; ++static struct omap_hwmod_soc_ops soc_ops __read_only; + + /* omap_hwmod_list contains all registered struct omap_hwmods */ + static LIST_HEAD(omap_hwmod_list); +diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c +index d15c7bb..b2d1f0c 100644 +--- a/arch/arm/mach-omap2/wd_timer.c ++++ b/arch/arm/mach-omap2/wd_timer.c +@@ -110,7 +110,9 @@ static int __init omap_init_wdt(void) + struct omap_hwmod *oh; + char *oh_name = "wd_timer2"; + char *dev_name = "omap_wdt"; +- struct omap_wd_timer_platform_data pdata; ++ static struct omap_wd_timer_platform_data pdata = { ++ .read_reset_sources = prm_read_reset_sources ++ }; + + if (!cpu_class_is_omap2() || of_have_populated_dt()) + return 0; +@@ -121,8 +123,6 @@ static int __init omap_init_wdt(void) + return -EINVAL; + } + +- pdata.read_reset_sources = prm_read_reset_sources; +- + pdev = omap_device_build(dev_name, id, oh, &pdata, + sizeof(struct omap_wd_timer_platform_data)); + WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n", +diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h +index bddce2b..3eb04e2 100644 +--- a/arch/arm/mach-ux500/include/mach/setup.h ++++ b/arch/arm/mach-ux500/include/mach/setup.h +@@ -37,13 +37,6 @@ extern void ux500_timer_init(void); + .type = MT_DEVICE, \ + } + +-#define __MEM_DEV_DESC(x, sz) { \ +- .virtual = IO_ADDRESS(x), \ +- .pfn = __phys_to_pfn(x), \ +- .length = sz, \ +- .type = MT_MEMORY, \ +-} +- + extern struct smp_operations ux500_smp_ops; + extern void ux500_cpu_die(unsigned int cpu); + +diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig +index 4045c49..4e26c79 100644 +--- a/arch/arm/mm/Kconfig ++++ b/arch/arm/mm/Kconfig +@@ -425,7 +425,7 @@ config CPU_32v5 + + config CPU_32v6 + bool +- select CPU_USE_DOMAINS if CPU_V6 && MMU ++ select CPU_USE_DOMAINS if CPU_V6 && MMU && !PAX_KERNEXEC + select TLS_REG_EMUL if !CPU_32v6K && !MMU + + config CPU_32v6K +@@ -574,6 +574,7 @@ config CPU_CP15_MPU + + config CPU_USE_DOMAINS + bool ++ depends on !ARM_LPAE && !PAX_KERNEXEC + help + This option enables or disables the use of domain switching + via the set_fs() function. +diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c +index db26e2e..ee44569 100644 +--- a/arch/arm/mm/alignment.c ++++ b/arch/arm/mm/alignment.c +@@ -211,10 +211,12 @@ union offset_union { + #define __get16_unaligned_check(ins,val,addr) \ + do { \ + unsigned int err = 0, v, a = addr; \ ++ pax_open_userland(); \ + __get8_unaligned_check(ins,v,a,err); \ + val = v << ((BE) ? 8 : 0); \ + __get8_unaligned_check(ins,v,a,err); \ + val |= v << ((BE) ? 0 : 8); \ ++ pax_close_userland(); \ + if (err) \ + goto fault; \ + } while (0) +@@ -228,6 +230,7 @@ union offset_union { + #define __get32_unaligned_check(ins,val,addr) \ + do { \ + unsigned int err = 0, v, a = addr; \ ++ pax_open_userland(); \ + __get8_unaligned_check(ins,v,a,err); \ + val = v << ((BE) ? 24 : 0); \ + __get8_unaligned_check(ins,v,a,err); \ +@@ -236,6 +239,7 @@ union offset_union { + val |= v << ((BE) ? 8 : 16); \ + __get8_unaligned_check(ins,v,a,err); \ + val |= v << ((BE) ? 0 : 24); \ ++ pax_close_userland(); \ + if (err) \ + goto fault; \ + } while (0) +@@ -249,6 +253,7 @@ union offset_union { + #define __put16_unaligned_check(ins,val,addr) \ + do { \ + unsigned int err = 0, v = val, a = addr; \ ++ pax_open_userland(); \ + __asm__( FIRST_BYTE_16 \ + ARM( "1: "ins" %1, [%2], #1\n" ) \ + THUMB( "1: "ins" %1, [%2]\n" ) \ +@@ -268,6 +273,7 @@ union offset_union { + " .popsection\n" \ + : "=r" (err), "=&r" (v), "=&r" (a) \ + : "0" (err), "1" (v), "2" (a)); \ ++ pax_close_userland(); \ + if (err) \ + goto fault; \ + } while (0) +@@ -281,6 +287,7 @@ union offset_union { + #define __put32_unaligned_check(ins,val,addr) \ + do { \ + unsigned int err = 0, v = val, a = addr; \ ++ pax_open_userland(); \ + __asm__( FIRST_BYTE_32 \ + ARM( "1: "ins" %1, [%2], #1\n" ) \ + THUMB( "1: "ins" %1, [%2]\n" ) \ +@@ -310,6 +317,7 @@ union offset_union { + " .popsection\n" \ + : "=r" (err), "=&r" (v), "=&r" (a) \ + : "0" (err), "1" (v), "2" (a)); \ ++ pax_close_userland(); \ + if (err) \ + goto fault; \ + } while (0) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c -index 5bb4835..4760f68 100644 +index 5dbf13f..1a60561 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c -@@ -174,6 +174,13 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr, +@@ -25,6 +25,7 @@ + #include <asm/system_misc.h> + #include <asm/system_info.h> + #include <asm/tlbflush.h> ++#include <asm/sections.h> + + #include "fault.h" + +@@ -138,6 +139,20 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, + if (fixup_exception(regs)) + return; + ++#ifdef CONFIG_PAX_KERNEXEC ++ if ((fsr & FSR_WRITE) && ++ (((unsigned long)_stext <= addr && addr < init_mm.end_code) || ++ (MODULES_VADDR <= addr && addr < MODULES_END))) ++ { ++ if (current->signal->curr_ip) ++ printk(KERN_ERR "PAX: From %pI4: %s:%d, uid/euid: %u/%u, attempted to modify kernel code\n", ¤t->signal->curr_ip, current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid())); ++ else ++ printk(KERN_ERR "PAX: %s:%d, uid/euid: %u/%u, attempted to modify kernel code\n", current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid())); ++ } ++#endif ++ + /* + * No handler, we'll have to terminate things with extreme prejudice. + */ +@@ -174,6 +189,13 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr, } #endif @@ -1932,7 +3581,7 @@ index 5bb4835..4760f68 100644 tsk->thread.address = addr; tsk->thread.error_code = fsr; tsk->thread.trap_no = 14; -@@ -397,6 +404,33 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) +@@ -398,6 +420,33 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) } #endif /* CONFIG_MMU */ @@ -1966,12 +3615,60 @@ index 5bb4835..4760f68 100644 /* * First Level Translation Fault Handler * -@@ -577,6 +611,20 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs) +@@ -543,9 +592,22 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) + const struct fsr_info *inf = fsr_info + fsr_fs(fsr); + struct siginfo info; + ++#ifdef CONFIG_PAX_MEMORY_UDEREF ++ if (addr < TASK_SIZE && is_domain_fault(fsr)) { ++ if (current->signal->curr_ip) ++ printk(KERN_ERR "PAX: From %pI4: %s:%d, uid/euid: %u/%u, attempted to access userland memory at %08lx\n", ¤t->signal->curr_ip, current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid()), addr); ++ else ++ printk(KERN_ERR "PAX: %s:%d, uid/euid: %u/%u, attempted to access userland memory at %08lx\n", current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid()), addr); ++ goto die; ++ } ++#endif ++ + if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs)) + return; + ++die: + printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n", + inf->name, fsr, addr); + +@@ -575,9 +637,49 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs) const struct fsr_info *inf = ifsr_info + fsr_fs(ifsr); struct siginfo info; ++ if (user_mode(regs)) { ++ if (addr == 0xffff0fe0UL) { ++ /* ++ * PaX: __kuser_get_tls emulation ++ */ ++ regs->ARM_r0 = current_thread_info()->tp_value; ++ regs->ARM_pc = regs->ARM_lr; ++ return; ++ } ++ } ++ ++#if defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) ++ else if (is_domain_fault(ifsr) || is_xn_fault(ifsr)) { ++ if (current->signal->curr_ip) ++ printk(KERN_ERR "PAX: From %pI4: %s:%d, uid/euid: %u/%u, attempted to execute %s memory at %08lx\n", ¤t->signal->curr_ip, current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid()), ++ addr >= TASK_SIZE ? "non-executable kernel" : "userland", addr); ++ else ++ printk(KERN_ERR "PAX: %s:%d, uid/euid: %u/%u, attempted to execute %s memory at %08lx\n", current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid()), ++ addr >= TASK_SIZE ? "non-executable kernel" : "userland", addr); ++ goto die; ++ } ++#endif ++ +#ifdef CONFIG_PAX_REFCOUNT -+ if (fsr_fs(ifsr) == 2) { ++ if (fsr_fs(ifsr) == FAULT_CODE_DEBUG) { + unsigned int bkpt; + + if (!probe_kernel_address((unsigned int *)addr, bkpt) && bkpt == 0xe12f1073) { @@ -1987,11 +3684,129 @@ index 5bb4835..4760f68 100644 if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs)) return; ++die: + printk(KERN_ALERT "Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n", + inf->name, ifsr, addr); + +diff --git a/arch/arm/mm/fault.h b/arch/arm/mm/fault.h +index cf08bdf..772656c 100644 +--- a/arch/arm/mm/fault.h ++++ b/arch/arm/mm/fault.h +@@ -3,6 +3,7 @@ + + /* + * Fault status register encodings. We steal bit 31 for our own purposes. ++ * Set when the FSR value is from an instruction fault. + */ + #define FSR_LNX_PF (1 << 31) + #define FSR_WRITE (1 << 11) +@@ -22,6 +23,17 @@ static inline int fsr_fs(unsigned int fsr) + } + #endif + ++/* valid for LPAE and !LPAE */ ++static inline int is_xn_fault(unsigned int fsr) ++{ ++ return ((fsr_fs(fsr) & 0x3c) == 0xc); ++} ++ ++static inline int is_domain_fault(unsigned int fsr) ++{ ++ return ((fsr_fs(fsr) & 0xD) == 0x9); ++} ++ + void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs); + unsigned long search_exception_table(unsigned long addr); + +diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c +index ad722f1..763fdd3 100644 +--- a/arch/arm/mm/init.c ++++ b/arch/arm/mm/init.c +@@ -30,6 +30,8 @@ + #include <asm/setup.h> + #include <asm/tlb.h> + #include <asm/fixmap.h> ++#include <asm/system_info.h> ++#include <asm/cp15.h> + + #include <asm/mach/arch.h> + #include <asm/mach/map.h> +@@ -736,7 +738,46 @@ void free_initmem(void) + { + #ifdef CONFIG_HAVE_TCM + extern char __tcm_start, __tcm_end; ++#endif + ++#ifdef CONFIG_PAX_KERNEXEC ++ unsigned long addr; ++ pgd_t *pgd; ++ pud_t *pud; ++ pmd_t *pmd; ++ int cpu_arch = cpu_architecture(); ++ unsigned int cr = get_cr(); ++ ++ if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) { ++ /* make pages tables, etc before .text NX */ ++ for (addr = PAGE_OFFSET; addr < (unsigned long)_stext; addr += SECTION_SIZE) { ++ pgd = pgd_offset_k(addr); ++ pud = pud_offset(pgd, addr); ++ pmd = pmd_offset(pud, addr); ++ __section_update(pmd, addr, PMD_SECT_XN); ++ } ++ /* make init NX */ ++ for (addr = (unsigned long)__init_begin; addr < (unsigned long)_sdata; addr += SECTION_SIZE) { ++ pgd = pgd_offset_k(addr); ++ pud = pud_offset(pgd, addr); ++ pmd = pmd_offset(pud, addr); ++ __section_update(pmd, addr, PMD_SECT_XN); ++ } ++ /* make kernel code/rodata RX */ ++ for (addr = (unsigned long)_stext; addr < (unsigned long)__init_begin; addr += SECTION_SIZE) { ++ pgd = pgd_offset_k(addr); ++ pud = pud_offset(pgd, addr); ++ pmd = pmd_offset(pud, addr); ++#ifdef CONFIG_ARM_LPAE ++ __section_update(pmd, addr, PMD_SECT_RDONLY); ++#else ++ __section_update(pmd, addr, PMD_SECT_APX|PMD_SECT_AP_WRITE); ++#endif ++ } ++ } ++#endif ++ ++#ifdef CONFIG_HAVE_TCM + poison_init_mem(&__tcm_start, &__tcm_end - &__tcm_start); + totalram_pages += free_area(__phys_to_pfn(__pa(&__tcm_start)), + __phys_to_pfn(__pa(&__tcm_end)), +diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c +index 04d9006..c547d85 100644 +--- a/arch/arm/mm/ioremap.c ++++ b/arch/arm/mm/ioremap.c +@@ -392,9 +392,9 @@ __arm_ioremap_exec(unsigned long phys_addr, size_t size, bool cached) + unsigned int mtype; + + if (cached) +- mtype = MT_MEMORY; ++ mtype = MT_MEMORY_RX; + else +- mtype = MT_MEMORY_NONCACHED; ++ mtype = MT_MEMORY_NONCACHED_RX; + + return __arm_ioremap_caller(phys_addr, size, mtype, + __builtin_return_address(0)); diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c -index ce8cb19..3ec539d 100644 +index 10062ce..cd34fb9 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c -@@ -93,6 +93,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, +@@ -59,6 +59,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, + struct vm_area_struct *vma; + int do_align = 0; + int aliasing = cache_is_vipt_aliasing(); ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + struct vm_unmapped_area_info info; + + /* +@@ -81,6 +82,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, if (len > TASK_SIZE) return -ENOMEM; @@ -2002,45 +3817,86 @@ index ce8cb19..3ec539d 100644 if (addr) { if (do_align) addr = COLOUR_ALIGN(addr, pgoff); -@@ -100,15 +104,14 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, +@@ -88,8 +93,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } - if (len > mm->cached_hole_size) { -- start_addr = addr = mm->free_area_cache; -+ start_addr = addr = mm->free_area_cache; - } else { -- start_addr = addr = mm->mmap_base; -- mm->cached_hole_size = 0; -+ start_addr = addr = mm->mmap_base; -+ mm->cached_hole_size = 0; + +@@ -99,6 +103,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, + info.high_limit = TASK_SIZE; + info.align_mask = do_align ? (PAGE_MASK & (SHMLBA - 1)) : 0; + info.align_offset = pgoff << PAGE_SHIFT; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); + } + +@@ -112,6 +117,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + unsigned long addr = addr0; + int do_align = 0; + int aliasing = cache_is_vipt_aliasing(); ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + struct vm_unmapped_area_info info; + + /* +@@ -132,6 +138,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + return addr; } - full_search: -@@ -124,14 +127,14 @@ full_search: - * Start a new search - just in case we missed - * some holes. - */ -- if (start_addr != TASK_UNMAPPED_BASE) { -- start_addr = addr = TASK_UNMAPPED_BASE; -+ if (start_addr != mm->mmap_base) { -+ start_addr = addr = mm->mmap_base; - mm->cached_hole_size = 0; - goto full_search; - } - return -ENOMEM; - } -- if (!vma || addr + len <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr, len)) { - /* - * Remember the place where we stopped the search: - */ -@@ -266,10 +269,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + /* requesting a specific address */ + if (addr) { + if (do_align) +@@ -139,8 +149,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + else + addr = PAGE_ALIGN(addr); + vma = find_vma(mm, addr); +- if (TASK_SIZE - len >= addr && +- (!vma || addr + len <= vma->vm_start)) ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) + return addr; + } + +@@ -150,6 +159,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + info.high_limit = mm->mmap_base; + info.align_mask = do_align ? (PAGE_MASK & (SHMLBA - 1)) : 0; + info.align_offset = pgoff << PAGE_SHIFT; ++ info.threadstack_offset = offset; + addr = vm_unmapped_area(&info); + + /* +@@ -162,6 +172,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + VM_BUG_ON(addr != -ENOMEM); + info.flags = 0; + info.low_limit = mm->mmap_base; ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; ++#endif ++ + info.high_limit = TASK_SIZE; + addr = vm_unmapped_area(&info); + } +@@ -173,6 +189,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm) + { + unsigned long random_factor = 0UL; + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + /* 8 bits of randomness in 20 address space bits */ + if ((current->flags & PF_RANDOMIZE) && + !(current->personality & ADDR_NO_RANDOMIZE)) +@@ -180,10 +200,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) if (mmap_is_legacy()) { mm->mmap_base = TASK_UNMAPPED_BASE + random_factor; @@ -2063,24 +3919,376 @@ index ce8cb19..3ec539d 100644 mm->get_unmapped_area = arch_get_unmapped_area_topdown; mm->unmap_area = arch_unmap_area_topdown; } -diff --git a/arch/arm/plat-orion/include/plat/addr-map.h b/arch/arm/plat-orion/include/plat/addr-map.h -index fd556f7..af2e7d2 100644 ---- a/arch/arm/plat-orion/include/plat/addr-map.h -+++ b/arch/arm/plat-orion/include/plat/addr-map.h -@@ -26,7 +26,7 @@ struct orion_addr_map_cfg { - value in bridge_virt_base */ - void __iomem *(*win_cfg_base) (const struct orion_addr_map_cfg *cfg, - const int win); --}; -+} __no_const; +diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c +index a84ff76..f221c1d 100644 +--- a/arch/arm/mm/mmu.c ++++ b/arch/arm/mm/mmu.c +@@ -36,6 +36,22 @@ + #include "mm.h" + #include "tcm.h" ++#if defined(CONFIG_CPU_USE_DOMAINS) || defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) ++void modify_domain(unsigned int dom, unsigned int type) ++{ ++ struct thread_info *thread = current_thread_info(); ++ unsigned int domain = thread->cpu_domain; ++ /* ++ * DOMAIN_MANAGER might be defined to some other value, ++ * use the arch-defined constant ++ */ ++ domain &= ~domain_val(dom, 3); ++ thread->cpu_domain = domain | domain_val(dom, type); ++ set_domain(thread->cpu_domain); ++} ++EXPORT_SYMBOL(modify_domain); ++#endif ++ /* - * Information needed to setup one address mapping. + * empty_zero_page is a special page that is used for + * zero-initialized data and COW. +@@ -211,10 +227,18 @@ void adjust_cr(unsigned long mask, unsigned long set) + } + #endif + +-#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN ++#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY + #define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE + +-static struct mem_type mem_types[] = { ++#ifdef CONFIG_PAX_KERNEXEC ++#define L_PTE_KERNEXEC L_PTE_RDONLY ++#define PMD_SECT_KERNEXEC PMD_SECT_RDONLY ++#else ++#define L_PTE_KERNEXEC L_PTE_DIRTY ++#define PMD_SECT_KERNEXEC PMD_SECT_AP_WRITE ++#endif ++ ++static struct mem_type mem_types[] __read_only = { + [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ + .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | + L_PTE_SHARED, +@@ -243,16 +267,16 @@ static struct mem_type mem_types[] = { + [MT_UNCACHED] = { + .prot_pte = PROT_PTE_DEVICE, + .prot_l1 = PMD_TYPE_TABLE, +- .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, ++ .prot_sect = PROT_SECT_DEVICE, + .domain = DOMAIN_IO, + }, + [MT_CACHECLEAN] = { +- .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, ++ .prot_sect = PMD_TYPE_SECT | PMD_SECT_RDONLY, + .domain = DOMAIN_KERNEL, + }, + #ifndef CONFIG_ARM_LPAE + [MT_MINICLEAN] = { +- .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE, ++ .prot_sect = PMD_TYPE_SECT | PMD_SECT_MINICACHE | PMD_SECT_RDONLY, + .domain = DOMAIN_KERNEL, + }, + #endif +@@ -260,36 +284,54 @@ static struct mem_type mem_types[] = { + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | + L_PTE_RDONLY, + .prot_l1 = PMD_TYPE_TABLE, +- .domain = DOMAIN_USER, ++ .domain = DOMAIN_VECTORS, + }, + [MT_HIGH_VECTORS] = { + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | +- L_PTE_USER | L_PTE_RDONLY, ++ L_PTE_RDONLY, + .prot_l1 = PMD_TYPE_TABLE, +- .domain = DOMAIN_USER, ++ .domain = DOMAIN_VECTORS, + }, +- [MT_MEMORY] = { ++ [MT_MEMORY_RWX] = { + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, + .prot_l1 = PMD_TYPE_TABLE, + .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, + .domain = DOMAIN_KERNEL, + }, ++ [MT_MEMORY_RW] = { ++ .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, ++ .prot_l1 = PMD_TYPE_TABLE, ++ .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, ++ .domain = DOMAIN_KERNEL, ++ }, ++ [MT_MEMORY_RX] = { ++ .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_KERNEXEC, ++ .prot_l1 = PMD_TYPE_TABLE, ++ .prot_sect = PMD_TYPE_SECT | PMD_SECT_KERNEXEC, ++ .domain = DOMAIN_KERNEL, ++ }, + [MT_ROM] = { +- .prot_sect = PMD_TYPE_SECT, ++ .prot_sect = PMD_TYPE_SECT | PMD_SECT_RDONLY, + .domain = DOMAIN_KERNEL, + }, +- [MT_MEMORY_NONCACHED] = { ++ [MT_MEMORY_NONCACHED_RW] = { + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | + L_PTE_MT_BUFFERABLE, + .prot_l1 = PMD_TYPE_TABLE, + .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, + .domain = DOMAIN_KERNEL, + }, ++ [MT_MEMORY_NONCACHED_RX] = { ++ .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_KERNEXEC | ++ L_PTE_MT_BUFFERABLE, ++ .prot_l1 = PMD_TYPE_TABLE, ++ .prot_sect = PMD_TYPE_SECT | PMD_SECT_KERNEXEC, ++ .domain = DOMAIN_KERNEL, ++ }, + [MT_MEMORY_DTCM] = { +- .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | +- L_PTE_XN, ++ .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, + .prot_l1 = PMD_TYPE_TABLE, +- .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, ++ .prot_sect = PMD_TYPE_SECT | PMD_SECT_RDONLY, + .domain = DOMAIN_KERNEL, + }, + [MT_MEMORY_ITCM] = { +@@ -299,10 +341,10 @@ static struct mem_type mem_types[] = { + }, + [MT_MEMORY_SO] = { + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | +- L_PTE_MT_UNCACHED | L_PTE_XN, ++ L_PTE_MT_UNCACHED, + .prot_l1 = PMD_TYPE_TABLE, + .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_S | +- PMD_SECT_UNCACHED | PMD_SECT_XN, ++ PMD_SECT_UNCACHED, + .domain = DOMAIN_KERNEL, + }, + [MT_MEMORY_DMA_READY] = { +@@ -388,9 +430,35 @@ static void __init build_mem_type_table(void) + * to prevent speculative instruction fetches. + */ + mem_types[MT_DEVICE].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_DEVICE].prot_pte |= L_PTE_XN; + mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_DEVICE_NONSHARED].prot_pte |= L_PTE_XN; + mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_XN; + mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_XN; ++ ++ /* Mark other regions on ARMv6+ as execute-never */ ++ ++#ifdef CONFIG_PAX_KERNEXEC ++ mem_types[MT_UNCACHED].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_UNCACHED].prot_pte |= L_PTE_XN; ++ mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_CACHECLEAN].prot_pte |= L_PTE_XN; ++#ifndef CONFIG_ARM_LPAE ++ mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_MINICLEAN].prot_pte |= L_PTE_XN; ++#endif ++ mem_types[MT_MEMORY_RW].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_MEMORY_RW].prot_pte |= L_PTE_XN; ++ mem_types[MT_MEMORY_NONCACHED_RW].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_MEMORY_NONCACHED_RW].prot_pte |= PMD_SECT_XN; ++ mem_types[MT_MEMORY_DTCM].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_MEMORY_DTCM].prot_pte |= L_PTE_XN; ++#endif ++ ++ mem_types[MT_MEMORY_SO].prot_sect |= PMD_SECT_XN; ++ mem_types[MT_MEMORY_SO].prot_pte |= L_PTE_XN; + } + if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) { + /* +@@ -451,6 +519,9 @@ static void __init build_mem_type_table(void) + * from SVC mode and no access from userspace. + */ + mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; ++#ifdef CONFIG_PAX_KERNEXEC ++ mem_types[MT_MEMORY_RX].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; ++#endif + mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; + mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; + #endif +@@ -468,11 +539,17 @@ static void __init build_mem_type_table(void) + mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED; + mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S; + mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED; +- mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; +- mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED; ++ mem_types[MT_MEMORY_RWX].prot_sect |= PMD_SECT_S; ++ mem_types[MT_MEMORY_RWX].prot_pte |= L_PTE_SHARED; ++ mem_types[MT_MEMORY_RW].prot_sect |= PMD_SECT_S; ++ mem_types[MT_MEMORY_RW].prot_pte |= L_PTE_SHARED; ++ mem_types[MT_MEMORY_RX].prot_sect |= PMD_SECT_S; ++ mem_types[MT_MEMORY_RX].prot_pte |= L_PTE_SHARED; + mem_types[MT_MEMORY_DMA_READY].prot_pte |= L_PTE_SHARED; +- mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; +- mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED; ++ mem_types[MT_MEMORY_NONCACHED_RW].prot_sect |= PMD_SECT_S; ++ mem_types[MT_MEMORY_NONCACHED_RW].prot_pte |= L_PTE_SHARED; ++ mem_types[MT_MEMORY_NONCACHED_RX].prot_sect |= PMD_SECT_S; ++ mem_types[MT_MEMORY_NONCACHED_RX].prot_pte |= L_PTE_SHARED; + } + } + +@@ -483,15 +560,20 @@ static void __init build_mem_type_table(void) + if (cpu_arch >= CPU_ARCH_ARMv6) { + if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) { + /* Non-cacheable Normal is XCB = 001 */ +- mem_types[MT_MEMORY_NONCACHED].prot_sect |= ++ mem_types[MT_MEMORY_NONCACHED_RW].prot_sect |= ++ PMD_SECT_BUFFERED; ++ mem_types[MT_MEMORY_NONCACHED_RX].prot_sect |= + PMD_SECT_BUFFERED; + } else { + /* For both ARMv6 and non-TEX-remapping ARMv7 */ +- mem_types[MT_MEMORY_NONCACHED].prot_sect |= ++ mem_types[MT_MEMORY_NONCACHED_RW].prot_sect |= ++ PMD_SECT_TEX(1); ++ mem_types[MT_MEMORY_NONCACHED_RX].prot_sect |= + PMD_SECT_TEX(1); + } + } else { +- mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE; ++ mem_types[MT_MEMORY_NONCACHED_RW].prot_sect |= PMD_SECT_BUFFERABLE; ++ mem_types[MT_MEMORY_NONCACHED_RX].prot_sect |= PMD_SECT_BUFFERABLE; + } + + #ifdef CONFIG_ARM_LPAE +@@ -507,6 +589,8 @@ static void __init build_mem_type_table(void) + vecs_pgprot |= PTE_EXT_AF; + #endif + ++ user_pgprot |= __supported_pte_mask; ++ + for (i = 0; i < 16; i++) { + pteval_t v = pgprot_val(protection_map[i]); + protection_map[i] = __pgprot(v | user_pgprot); +@@ -524,10 +608,15 @@ static void __init build_mem_type_table(void) + + mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; + mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; +- mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd; +- mem_types[MT_MEMORY].prot_pte |= kern_pgprot; ++ mem_types[MT_MEMORY_RWX].prot_sect |= ecc_mask | cp->pmd; ++ mem_types[MT_MEMORY_RWX].prot_pte |= kern_pgprot; ++ mem_types[MT_MEMORY_RW].prot_sect |= ecc_mask | cp->pmd; ++ mem_types[MT_MEMORY_RW].prot_pte |= kern_pgprot; ++ mem_types[MT_MEMORY_RX].prot_sect |= ecc_mask | cp->pmd; ++ mem_types[MT_MEMORY_RX].prot_pte |= kern_pgprot; + mem_types[MT_MEMORY_DMA_READY].prot_pte |= kern_pgprot; +- mem_types[MT_MEMORY_NONCACHED].prot_sect |= ecc_mask; ++ mem_types[MT_MEMORY_NONCACHED_RW].prot_sect |= ecc_mask; ++ mem_types[MT_MEMORY_NONCACHED_RX].prot_sect |= ecc_mask; + mem_types[MT_ROM].prot_sect |= cp->pmd; + + switch (cp->pmd) { +@@ -1147,18 +1236,15 @@ void __init arm_mm_memblock_reserve(void) + * called function. This means you can't use any function or debugging + * method which may touch any device, otherwise the kernel _will_ crash. + */ ++ ++static char vectors[PAGE_SIZE] __read_only __aligned(PAGE_SIZE); ++ + static void __init devicemaps_init(struct machine_desc *mdesc) + { + struct map_desc map; + unsigned long addr; +- void *vectors; + +- /* +- * Allocate the vector page early. +- */ +- vectors = early_alloc(PAGE_SIZE); +- +- early_trap_init(vectors); ++ early_trap_init(&vectors); + + for (addr = VMALLOC_START; addr; addr += PMD_SIZE) + pmd_clear(pmd_off_k(addr)); +@@ -1198,7 +1284,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc) + * location (0xffff0000). If we aren't using high-vectors, also + * create a mapping at the low-vectors virtual address. + */ +- map.pfn = __phys_to_pfn(virt_to_phys(vectors)); ++ map.pfn = __phys_to_pfn(virt_to_phys(&vectors)); + map.virtual = 0xffff0000; + map.length = PAGE_SIZE; + map.type = MT_HIGH_VECTORS; +@@ -1256,8 +1342,39 @@ static void __init map_lowmem(void) + map.pfn = __phys_to_pfn(start); + map.virtual = __phys_to_virt(start); + map.length = end - start; +- map.type = MT_MEMORY; + ++#ifdef CONFIG_PAX_KERNEXEC ++ if (map.virtual <= (unsigned long)_stext && ((unsigned long)_end < (map.virtual + map.length))) { ++ struct map_desc kernel; ++ struct map_desc initmap; ++ ++ /* when freeing initmem we will make this RW */ ++ initmap.pfn = __phys_to_pfn(__pa(__init_begin)); ++ initmap.virtual = (unsigned long)__init_begin; ++ initmap.length = _sdata - __init_begin; ++ initmap.type = MT_MEMORY_RWX; ++ create_mapping(&initmap); ++ ++ /* when freeing initmem we will make this RX */ ++ kernel.pfn = __phys_to_pfn(__pa(_stext)); ++ kernel.virtual = (unsigned long)_stext; ++ kernel.length = __init_begin - _stext; ++ kernel.type = MT_MEMORY_RWX; ++ create_mapping(&kernel); ++ ++ if (map.virtual < (unsigned long)_stext) { ++ map.length = (unsigned long)_stext - map.virtual; ++ map.type = MT_MEMORY_RWX; ++ create_mapping(&map); ++ } ++ ++ map.pfn = __phys_to_pfn(__pa(_sdata)); ++ map.virtual = (unsigned long)_sdata; ++ map.length = end - __pa(_sdata); ++ } ++#endif ++ ++ map.type = MT_MEMORY_RW; + create_mapping(&map); + } + } +diff --git a/arch/arm/mm/proc-v7-2level.S b/arch/arm/mm/proc-v7-2level.S +index 78f520b..31f0cb6 100644 +--- a/arch/arm/mm/proc-v7-2level.S ++++ b/arch/arm/mm/proc-v7-2level.S +@@ -99,6 +99,9 @@ ENTRY(cpu_v7_set_pte_ext) + tst r1, #L_PTE_XN + orrne r3, r3, #PTE_EXT_XN + ++ tst r1, #L_PTE_PXN ++ orrne r3, r3, #PTE_EXT_PXN ++ + tst r1, #L_PTE_YOUNG + tstne r1, #L_PTE_VALID + #ifndef CONFIG_CPU_USE_DOMAINS +diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c +index a5bc92d..0bb4730 100644 +--- a/arch/arm/plat-omap/sram.c ++++ b/arch/arm/plat-omap/sram.c +@@ -93,6 +93,8 @@ void __init omap_map_sram(unsigned long start, unsigned long size, + * Looks like we need to preserve some bootloader code at the + * beginning of SRAM for jumping to flash for reboot to work... + */ ++ pax_open_kernel(); + memset_io(omap_sram_base + omap_sram_skip, 0, + omap_sram_size - omap_sram_skip); ++ pax_close_kernel(); + } diff --git a/arch/arm/plat-samsung/include/plat/dma-ops.h b/arch/arm/plat-samsung/include/plat/dma-ops.h -index 71a6827..e7fbc23 100644 +index 1141782..0959d64 100644 --- a/arch/arm/plat-samsung/include/plat/dma-ops.h +++ b/arch/arm/plat-samsung/include/plat/dma-ops.h -@@ -43,7 +43,7 @@ struct samsung_dma_ops { +@@ -48,7 +48,7 @@ struct samsung_dma_ops { int (*started)(unsigned ch); int (*flush)(unsigned ch); int (*stop)(unsigned ch); @@ -2089,18 +4297,31 @@ index 71a6827..e7fbc23 100644 extern void *samsung_dmadev_get_ops(void); extern void *s3c_dma_get_ops(void); -diff --git a/arch/arm/plat-samsung/include/plat/ehci.h b/arch/arm/plat-samsung/include/plat/ehci.h -index 5f28cae..3d23723 100644 ---- a/arch/arm/plat-samsung/include/plat/ehci.h -+++ b/arch/arm/plat-samsung/include/plat/ehci.h -@@ -14,7 +14,7 @@ - struct s5p_ehci_platdata { - int (*phy_init)(struct platform_device *pdev, int type); - int (*phy_exit)(struct platform_device *pdev, int type); --}; -+} __no_const; +diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c +index 0c3ba9f..95722b3 100644 +--- a/arch/arm64/kernel/debug-monitors.c ++++ b/arch/arm64/kernel/debug-monitors.c +@@ -151,7 +151,7 @@ static int __cpuinit os_lock_notify(struct notifier_block *self, + return NOTIFY_OK; + } - extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd); +-static struct notifier_block __cpuinitdata os_lock_nb = { ++static struct notifier_block os_lock_nb = { + .notifier_call = os_lock_notify, + }; + +diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c +index 5ab825c..96aaec8 100644 +--- a/arch/arm64/kernel/hw_breakpoint.c ++++ b/arch/arm64/kernel/hw_breakpoint.c +@@ -831,7 +831,7 @@ static int __cpuinit hw_breakpoint_reset_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata hw_breakpoint_reset_nb = { ++static struct notifier_block hw_breakpoint_reset_nb = { + .notifier_call = hw_breakpoint_reset_notify, + }; diff --git a/arch/avr32/include/asm/cache.h b/arch/avr32/include/asm/cache.h index c3a58a1..78fbf54 100644 @@ -2119,7 +4340,7 @@ index c3a58a1..78fbf54 100644 /* * Memory returned by kmalloc() may be used for DMA, so we must make diff --git a/arch/avr32/include/asm/elf.h b/arch/avr32/include/asm/elf.h -index 3b3159b..425ea94 100644 +index d232888..87c8df1 100644 --- a/arch/avr32/include/asm/elf.h +++ b/arch/avr32/include/asm/elf.h @@ -84,8 +84,14 @@ typedef struct user_fpu_struct elf_fpregset_t; @@ -2139,21 +4360,23 @@ index 3b3159b..425ea94 100644 /* This yields a mask that user programs can use to figure out what instruction set this CPU supports. This could be done in user space, diff --git a/arch/avr32/include/asm/kmap_types.h b/arch/avr32/include/asm/kmap_types.h -index b7f5c68..556135c 100644 +index 479330b..53717a8 100644 --- a/arch/avr32/include/asm/kmap_types.h +++ b/arch/avr32/include/asm/kmap_types.h -@@ -22,7 +22,8 @@ D(10) KM_IRQ0, - D(11) KM_IRQ1, - D(12) KM_SOFTIRQ0, - D(13) KM_SOFTIRQ1, --D(14) KM_TYPE_NR -+D(14) KM_CLEARPAGE, -+D(15) KM_TYPE_NR - }; +@@ -2,9 +2,9 @@ + #define __ASM_AVR32_KMAP_TYPES_H - #undef D + #ifdef CONFIG_DEBUG_HIGHMEM +-# define KM_TYPE_NR 29 ++# define KM_TYPE_NR 30 + #else +-# define KM_TYPE_NR 14 ++# define KM_TYPE_NR 15 + #endif + + #endif /* __ASM_AVR32_KMAP_TYPES_H */ diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c -index f7040a1..db9f300 100644 +index b2f2d2d..d1c85cb 100644 --- a/arch/avr32/mm/fault.c +++ b/arch/avr32/mm/fault.c @@ -41,6 +41,23 @@ static inline int notify_page_fault(struct pt_regs *regs, int trap) @@ -2180,7 +4403,7 @@ index f7040a1..db9f300 100644 /* * This routine handles page faults. It determines the address and the * problem, and then passes it off to one of the appropriate routines. -@@ -156,6 +173,16 @@ bad_area: +@@ -174,6 +191,16 @@ bad_area: up_read(&mm->mmap_sem); if (user_mode(regs)) { @@ -2234,7 +4457,7 @@ index aea2718..3639a60 100644 #endif /* _ASM_ARCH_CACHE_H */ diff --git a/arch/cris/include/arch-v32/arch/cache.h b/arch/cris/include/arch-v32/arch/cache.h -index 1de779f..336fad3 100644 +index 7caf25d..ee65ac5 100644 --- a/arch/cris/include/arch-v32/arch/cache.h +++ b/arch/cris/include/arch-v32/arch/cache.h @@ -1,11 +1,12 @@ @@ -2249,7 +4472,7 @@ index 1de779f..336fad3 100644 #define L1_CACHE_SHIFT 5 +#define L1_CACHE_BYTES (_AC(1,UL) << L1_CACHE_SHIFT) - #define __read_mostly __attribute__((__section__(".data.read_mostly"))) + #define __read_mostly __attribute__((__section__(".data..read_mostly"))) diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h index b86329d..6709906 100644 @@ -2290,67 +4513,49 @@ index 2797163..c2a401d 100644 #define __cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES))) #define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES))) diff --git a/arch/frv/include/asm/kmap_types.h b/arch/frv/include/asm/kmap_types.h -index f8e16b2..c73ff79 100644 +index 43901f2..0d8b865 100644 --- a/arch/frv/include/asm/kmap_types.h +++ b/arch/frv/include/asm/kmap_types.h -@@ -23,6 +23,7 @@ enum km_type { - KM_IRQ1, - KM_SOFTIRQ0, - KM_SOFTIRQ1, -+ KM_CLEARPAGE, - KM_TYPE_NR - }; +@@ -2,6 +2,6 @@ + #ifndef _ASM_KMAP_TYPES_H + #define _ASM_KMAP_TYPES_H + +-#define KM_TYPE_NR 17 ++#define KM_TYPE_NR 18 + #endif diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c -index 385fd30..6c3d97e 100644 +index 836f147..4cf23f5 100644 --- a/arch/frv/mm/elf-fdpic.c +++ b/arch/frv/mm/elf-fdpic.c -@@ -73,8 +73,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi +@@ -61,6 +61,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi + { + struct vm_area_struct *vma; + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(current->mm, filp, flags); + + if (len > TASK_SIZE) + return -ENOMEM; +@@ -73,8 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi if (addr) { addr = PAGE_ALIGN(addr); vma = find_vma(current->mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) goto success; } -@@ -89,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - for (; vma; vma = vma->vm_next) { - if (addr > limit) - break; -- if (addr + len <= vma->vm_start) -+ if (check_heap_stack_gap(vma, addr, len)) - goto success; - addr = vma->vm_end; - } -@@ -104,7 +103,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - for (; vma; vma = vma->vm_next) { - if (addr > limit) - break; -- if (addr + len <= vma->vm_start) -+ if (check_heap_stack_gap(vma, addr, len)) - goto success; - addr = vma->vm_end; - } -diff --git a/arch/h8300/include/asm/cache.h b/arch/h8300/include/asm/cache.h -index c635028..6d9445a 100644 ---- a/arch/h8300/include/asm/cache.h -+++ b/arch/h8300/include/asm/cache.h -@@ -1,8 +1,10 @@ - #ifndef __ARCH_H8300_CACHE_H - #define __ARCH_H8300_CACHE_H - -+#include <linux/const.h> -+ - /* bytes per L1 cache line */ --#define L1_CACHE_BYTES 4 -+#define L1_CACHE_BYTES _AC(4,UL) - - /* m68k-elf-gcc 2.95.2 doesn't like these */ - +@@ -85,6 +85,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi + info.high_limit = (current->mm->start_stack - 0x00200000); + info.align_mask = 0; + info.align_offset = 0; ++ info.threadstack_offset = offset; + addr = vm_unmapped_area(&info); + if (!(addr & ~PAGE_MASK)) + goto success; diff --git a/arch/hexagon/include/asm/cache.h b/arch/hexagon/include/asm/cache.h -index 0f01de2..d37d309 100644 +index f4ca594..adc72fd6 100644 --- a/arch/hexagon/include/asm/cache.h +++ b/arch/hexagon/include/asm/cache.h @@ -21,9 +21,11 @@ @@ -2410,7 +4615,7 @@ index 988254a..e1ee885 100644 #ifdef CONFIG_SMP # define SMP_CACHE_SHIFT L1_CACHE_SHIFT diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h -index b5298eb..67c6e62 100644 +index 5a83c5c..4d7f553 100644 --- a/arch/ia64/include/asm/elf.h +++ b/arch/ia64/include/asm/elf.h @@ -42,6 +42,13 @@ @@ -2502,27 +4707,93 @@ index 54ff557..70c88b7 100644 static __always_inline void __ticket_spin_unlock_wait(arch_spinlock_t *lock) diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h -index 449c8c0..432a3d2 100644 +index 449c8c0..18965fb 100644 --- a/arch/ia64/include/asm/uaccess.h +++ b/arch/ia64/include/asm/uaccess.h -@@ -257,7 +257,7 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) +@@ -240,12 +240,24 @@ extern unsigned long __must_check __copy_user (void __user *to, const void __use + static inline unsigned long + __copy_to_user (void __user *to, const void *from, unsigned long count) + { ++ if (count > INT_MAX) ++ return count; ++ ++ if (!__builtin_constant_p(count)) ++ check_object_size(from, count, true); ++ + return __copy_user(to, (__force void __user *) from, count); + } + + static inline unsigned long + __copy_from_user (void *to, const void __user *from, unsigned long count) + { ++ if (count > INT_MAX) ++ return count; ++ ++ if (!__builtin_constant_p(count)) ++ check_object_size(to, count, false); ++ + return __copy_user((__force void __user *) to, from, count); + } + +@@ -255,10 +267,13 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) + ({ \ + void __user *__cu_to = (to); \ const void *__cu_from = (from); \ - long __cu_len = (n); \ +- long __cu_len = (n); \ ++ unsigned long __cu_len = (n); \ \ - if (__access_ok(__cu_to, __cu_len, get_fs())) \ -+ if (__cu_len > 0 && __cu_len <= INT_MAX && __access_ok(__cu_to, __cu_len, get_fs())) \ ++ if (__cu_len <= INT_MAX && __access_ok(__cu_to, __cu_len, get_fs())) { \ ++ if (!__builtin_constant_p(n)) \ ++ check_object_size(__cu_from, __cu_len, true); \ __cu_len = __copy_user(__cu_to, (__force void __user *) __cu_from, __cu_len); \ ++ } \ __cu_len; \ }) -@@ -269,7 +269,7 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) - long __cu_len = (n); \ + +@@ -266,11 +281,14 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) + ({ \ + void *__cu_to = (to); \ + const void __user *__cu_from = (from); \ +- long __cu_len = (n); \ ++ unsigned long __cu_len = (n); \ \ __chk_user_ptr(__cu_from); \ - if (__access_ok(__cu_from, __cu_len, get_fs())) \ -+ if (__cu_len > 0 && __cu_len <= INT_MAX && __access_ok(__cu_from, __cu_len, get_fs())) \ ++ if (__cu_len <= INT_MAX && __access_ok(__cu_from, __cu_len, get_fs())) { \ ++ if (!__builtin_constant_p(n)) \ ++ check_object_size(__cu_to, __cu_len, false); \ __cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len); \ ++ } \ __cu_len; \ }) + +diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c +index 2d67317..07d8bfa 100644 +--- a/arch/ia64/kernel/err_inject.c ++++ b/arch/ia64/kernel/err_inject.c +@@ -256,7 +256,7 @@ static int __cpuinit err_inject_cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata err_inject_cpu_notifier = ++static struct notifier_block err_inject_cpu_notifier = + { + .notifier_call = err_inject_cpu_callback, + }; +diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c +index d7396db..b33e873 100644 +--- a/arch/ia64/kernel/mca.c ++++ b/arch/ia64/kernel/mca.c +@@ -1922,7 +1922,7 @@ static int __cpuinit mca_cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block mca_cpu_notifier __cpuinitdata = { ++static struct notifier_block mca_cpu_notifier = { + .notifier_call = mca_cpu_callback + }; + diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index 24603be..948052d 100644 --- a/arch/ia64/kernel/module.c @@ -2615,11 +4886,45 @@ index 24603be..948052d 100644 mod->arch.gp = gp; DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp); } +diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c +index 79521d5..43dddff 100644 +--- a/arch/ia64/kernel/palinfo.c ++++ b/arch/ia64/kernel/palinfo.c +@@ -1006,7 +1006,7 @@ static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block __refdata palinfo_cpu_notifier = ++static struct notifier_block palinfo_cpu_notifier = + { + .notifier_call = palinfo_cpu_callback, + .priority = 0, +diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c +index aa527d7..f237752 100644 +--- a/arch/ia64/kernel/salinfo.c ++++ b/arch/ia64/kernel/salinfo.c +@@ -616,7 +616,7 @@ salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu + return NOTIFY_OK; + } + +-static struct notifier_block salinfo_cpu_notifier __cpuinitdata = ++static struct notifier_block salinfo_cpu_notifier = + { + .notifier_call = salinfo_cpu_callback, + .priority = 0, diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c -index 609d500..7dde2a8 100644 +index 41e33f8..65180b2 100644 --- a/arch/ia64/kernel/sys_ia64.c +++ b/arch/ia64/kernel/sys_ia64.c -@@ -43,6 +43,13 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len +@@ -28,6 +28,7 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len + unsigned long align_mask = 0; + struct mm_struct *mm = current->mm; + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + + if (len > RGN_MAP_LIMIT) + return -ENOMEM; +@@ -43,6 +44,13 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len if (REGION_NUMBER(addr) == RGN_HPAGE) addr = 0; #endif @@ -2631,26 +4936,29 @@ index 609d500..7dde2a8 100644 +#endif + if (!addr) - addr = mm->free_area_cache; + addr = TASK_UNMAPPED_BASE; -@@ -61,14 +68,14 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len - for (vma = find_vma(mm, addr); ; vma = vma->vm_next) { - /* At this point: (!vma || addr < vma->vm_end). */ - if (TASK_SIZE - len < addr || RGN_MAP_LIMIT - len < REGION_OFFSET(addr)) { -- if (start_addr != TASK_UNMAPPED_BASE) { -+ if (start_addr != mm->mmap_base) { - /* Start a new search --- just in case we missed some holes. */ -- addr = TASK_UNMAPPED_BASE; -+ addr = mm->mmap_base; - goto full_search; - } - return -ENOMEM; - } -- if (!vma || addr + len <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr, len)) { - /* Remember the address where we stopped this search: */ - mm->free_area_cache = addr + len; - return addr; +@@ -61,6 +69,7 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len + info.high_limit = TASK_SIZE; + info.align_mask = align_mask; + info.align_offset = 0; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); + } + +diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c +index dc00b2c..cce53c2 100644 +--- a/arch/ia64/kernel/topology.c ++++ b/arch/ia64/kernel/topology.c +@@ -445,7 +445,7 @@ static int __cpuinit cache_cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata cache_cpu_notifier = ++static struct notifier_block cache_cpu_notifier = + { + .notifier_call = cache_cpu_callback + }; diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 0ccb28f..8992469 100644 --- a/arch/ia64/kernel/vmlinux.lds.S @@ -2665,7 +4973,7 @@ index 0ccb28f..8992469 100644 * ensure percpu data fits * into percpu page size diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c -index 02d29c2..ea893df 100644 +index 6cf0341..d352594 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c @@ -72,6 +72,23 @@ mapped_kernel_page_is_present (unsigned long address) @@ -2689,12 +4997,12 @@ index 02d29c2..ea893df 100644 +} +#endif + - void __kprobes - ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *regs) - { -@@ -145,9 +162,23 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re - mask = ( (((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT) - | (((isr >> IA64_ISR_W_BIT) & 1UL) << VM_WRITE_BIT)); + # define VM_READ_BIT 0 + # define VM_WRITE_BIT 1 + # define VM_EXEC_BIT 2 +@@ -149,8 +166,21 @@ retry: + if (((isr >> IA64_ISR_R_BIT) & 1UL) && (!(vma->vm_flags & (VM_READ | VM_WRITE)))) + goto bad_area; - if ((vma->vm_flags & mask) != mask) + if ((vma->vm_flags & mask) != mask) { @@ -2711,27 +5019,32 @@ index 02d29c2..ea893df 100644 +#endif + goto bad_area; - + } -+ + /* * If for any reason at all we couldn't handle the fault, make - * sure we exit gracefully rather than endlessly redo the diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c -index 5ca674b..e0e1b70 100644 +index 76069c1..c2aa816 100644 --- a/arch/ia64/mm/hugetlbpage.c +++ b/arch/ia64/mm/hugetlbpage.c -@@ -171,7 +171,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, u - /* At this point: (!vmm || addr < vmm->vm_end). */ - if (REGION_OFFSET(addr) + len > RGN_MAP_LIMIT) - return -ENOMEM; -- if (!vmm || (addr + len) <= vmm->vm_start) -+ if (check_heap_stack_gap(vmm, addr, len)) - return addr; - addr = ALIGN(vmm->vm_end, HPAGE_SIZE); - } +@@ -149,6 +149,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, u + unsigned long pgoff, unsigned long flags) + { + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(current->mm, file, flags); + + if (len > RGN_MAP_LIMIT) + return -ENOMEM; +@@ -172,6 +173,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, u + info.high_limit = HPAGE_REGION_BASE + RGN_MAP_LIMIT; + info.align_mask = PAGE_MASK & (HPAGE_SIZE - 1); + info.align_offset = 0; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); + } + diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c -index 0eab454..bd794f2 100644 +index 20bc967..a26993e 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -120,6 +120,19 @@ ia64_init_addr_space (void) @@ -2811,6 +5124,18 @@ index 0395c51..5f26031 100644 #define ARCH_DMA_MINALIGN L1_CACHE_BYTES +diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c +index 3c52fa6..11b2ad8 100644 +--- a/arch/metag/mm/hugetlbpage.c ++++ b/arch/metag/mm/hugetlbpage.c +@@ -200,6 +200,7 @@ hugetlb_get_unmapped_area_new_pmd(unsigned long len) + info.high_limit = TASK_SIZE; + info.align_mask = PAGE_MASK & HUGEPT_MASK; + info.align_offset = 0; ++ info.threadstack_offset = 0; + return vm_unmapped_area(&info); + } + diff --git a/arch/microblaze/include/asm/cache.h b/arch/microblaze/include/asm/cache.h index 4efe96a..60e8699 100644 --- a/arch/microblaze/include/asm/cache.h @@ -2830,7 +5155,7 @@ index 4efe96a..60e8699 100644 #define SMP_CACHE_BYTES L1_CACHE_BYTES diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h -index 3f4c5cb..3439c6e 100644 +index 08b6079..eb272cf 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h @@ -21,6 +21,10 @@ @@ -2841,10 +5166,10 @@ index 3f4c5cb..3439c6e 100644 +#include <asm-generic/atomic64.h> +#endif + - #define ATOMIC_INIT(i) { (i) } + #define ATOMIC_INIT(i) { (i) } /* -@@ -765,6 +769,16 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) +@@ -759,6 +763,16 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) */ #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) @@ -2879,11 +5204,11 @@ index b4db69f..8f3b093 100644 #define SMP_CACHE_SHIFT L1_CACHE_SHIFT #define SMP_CACHE_BYTES L1_CACHE_BYTES diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h -index 455c0ac..ad65fbe 100644 +index cf3ae24..238d22f 100644 --- a/arch/mips/include/asm/elf.h +++ b/arch/mips/include/asm/elf.h @@ -372,13 +372,16 @@ extern const char *__elf_platform; - #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) + #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) #endif +#ifdef CONFIG_PAX_ASLR @@ -2916,18 +5241,18 @@ index c1f6afa..38cc6e9 100644 #endif /* _ASM_EXEC_H */ diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h -index da9bd7d..91aa7ab 100644 +index eab99e5..607c98e 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h -@@ -98,7 +98,7 @@ extern void copy_user_highpage(struct page *to, struct page *from, +@@ -96,7 +96,7 @@ extern void copy_user_highpage(struct page *to, struct page *from, #ifdef CONFIG_CPU_MIPS32 typedef struct { unsigned long pte_low, pte_high; } pte_t; - #define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) -- #define __pte(x) ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; }) -+ #define __pte(x) ({ pte_t __pte = {(x), (x) >> 32}; __pte; }) + #define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) +- #define __pte(x) ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; }) ++ #define __pte(x) ({ pte_t __pte = {(x), (x) >> 32}; __pte; }) #else typedef struct { unsigned long long pte; } pte_t; - #define pte_val(x) ((x).pte) + #define pte_val(x) ((x).pte) diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h index 881d18b..cea38bc 100644 --- a/arch/mips/include/asm/pgalloc.h @@ -2945,10 +5270,10 @@ index 881d18b..cea38bc 100644 /* diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h -index abb13e8..cd2d702 100644 +index 178f792..8ebc510 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h -@@ -123,6 +123,8 @@ register struct thread_info *__current_thread_info __asm__("$28"); +@@ -111,6 +111,8 @@ register struct thread_info *__current_thread_info __asm__("$28"); #define TIF_32BIT_ADDR 23 /* 32-bit address space (o32/n32) */ #define TIF_FPUBOUND 24 /* thread bound to FPU-full CPU set */ #define TIF_LOAD_WATCH 25 /* If set, load watch registers */ @@ -2956,8 +5281,8 @@ index abb13e8..cd2d702 100644 +#define TIF_GRSEC_SETXID 29 /* update credentials on syscall entry/exit */ #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ - #ifdef CONFIG_MIPS32_O32 -@@ -146,15 +148,18 @@ register struct thread_info *__current_thread_info __asm__("$28"); + #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) +@@ -126,15 +128,18 @@ register struct thread_info *__current_thread_info __asm__("$28"); #define _TIF_32BIT_ADDR (1<<TIF_32BIT_ADDR) #define _TIF_FPUBOUND (1<<TIF_FPUBOUND) #define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH) @@ -2970,21 +5295,21 @@ index abb13e8..cd2d702 100644 +#define _TIF_WORK_SYSCALL_EXIT (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_GRSEC_SETXID) /* work to do on interrupt/exception return */ - #define _TIF_WORK_MASK (0x0000ffef & \ - ~(_TIF_SECCOMP | _TIF_SYSCALL_AUDIT)) + #define _TIF_WORK_MASK \ + (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_NOTIFY_RESUME) /* work to do on any return to u-space */ --#define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP) -+#define _TIF_ALLWORK_MASK ((0x8000ffff & ~_TIF_SECCOMP) | _TIF_GRSEC_SETXID) +-#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK | _TIF_WORK_SYSCALL_EXIT) ++#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK | _TIF_WORK_SYSCALL_EXIT | _TIF_GRSEC_SETXID) #endif /* __KERNEL__ */ diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c -index 9fdd8bc..4bd7f1a 100644 +index e06f777..3244284 100644 --- a/arch/mips/kernel/binfmt_elfn32.c +++ b/arch/mips/kernel/binfmt_elfn32.c @@ -50,6 +50,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; #undef ELF_ET_DYN_BASE - #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) + #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) +#ifdef CONFIG_PAX_ASLR +#define PAX_ELF_ET_DYN_BASE (TASK_IS_32BIT_ADDR ? 0x00400000UL : 0x00400000UL) @@ -2997,12 +5322,12 @@ index 9fdd8bc..4bd7f1a 100644 #include <linux/module.h> #include <linux/elfcore.h> diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c -index ff44823..97f8906 100644 +index 556a435..b4fd2e3 100644 --- a/arch/mips/kernel/binfmt_elfo32.c +++ b/arch/mips/kernel/binfmt_elfo32.c @@ -52,6 +52,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; #undef ELF_ET_DYN_BASE - #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) + #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) +#ifdef CONFIG_PAX_ASLR +#define PAX_ELF_ET_DYN_BASE (TASK_IS_32BIT_ADDR ? 0x00400000UL : 0x00400000UL) @@ -3015,10 +5340,10 @@ index ff44823..97f8906 100644 /* diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c -index e9a5fd7..378809a 100644 +index 3be4405..a799827 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c -@@ -480,15 +480,3 @@ unsigned long get_wchan(struct task_struct *task) +@@ -461,15 +461,3 @@ unsigned long get_wchan(struct task_struct *task) out: return pc; } @@ -3035,7 +5360,7 @@ index e9a5fd7..378809a 100644 - return sp & ALMASK; -} diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c -index 7c24c29..e2f1981 100644 +index 9c6299c..2fb4c22 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -528,6 +528,10 @@ static inline int audit_arch(void) @@ -3051,7 +5376,7 @@ index 7c24c29..e2f1981 100644 * - triggered by current->work.syscall_trace @@ -537,6 +541,11 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs) /* do the secure computing check first */ - secure_computing(regs->regs[2]); + secure_computing_strict(regs->regs[2]); +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) @@ -3062,7 +5387,7 @@ index 7c24c29..e2f1981 100644 goto out; diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S -index a632bc1..0b77c7c 100644 +index 9ea2964..c4329c3 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S @@ -52,7 +52,7 @@ NESTED(handle_sys, PT_SIZE, sp) @@ -3072,10 +5397,10 @@ index a632bc1..0b77c7c 100644 - li t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT + li t1, _TIF_SYSCALL_WORK and t0, t1 - bnez t0, syscall_trace_entry # -> yes + bnez t0, syscall_trace_entry # -> yes diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S -index 3b5a5e9..e1ee86d 100644 +index 36cfd40..b1436e0 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S @@ -54,7 +54,7 @@ NESTED(handle_sys64, PT_SIZE, sp) @@ -3088,10 +5413,10 @@ index 3b5a5e9..e1ee86d 100644 and t0, t1, t0 bnez t0, syscall_trace_entry diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S -index 6be6f70..1859577 100644 +index 693d60b..ae0ba75 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S -@@ -53,7 +53,7 @@ NESTED(handle_sysn32, PT_SIZE, sp) +@@ -47,7 +47,7 @@ NESTED(handle_sysn32, PT_SIZE, sp) sd a3, PT_R26(sp) # save a3 for syscall restarting @@ -3101,7 +5426,7 @@ index 6be6f70..1859577 100644 and t0, t1, t0 bnez t0, n32_syscall_trace_entry diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S -index 5422855..74e63a3 100644 +index af8887f..611ccb6 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S @@ -81,7 +81,7 @@ NESTED(handle_sys, PT_SIZE, sp) @@ -3114,7 +5439,7 @@ index 5422855..74e63a3 100644 and t0, t1, t0 bnez t0, trace_a_syscall diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c -index c14f6df..537e729 100644 +index 0fead53..a2c0fb5 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -27,6 +27,23 @@ @@ -3142,10 +5467,18 @@ index c14f6df..537e729 100644 * This routine handles page faults. It determines the address, * and the problem, and then passes it off to one of the appropriate diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c -index 302d779..7d35bf8 100644 +index 7e5fe27..9656513 100644 --- a/arch/mips/mm/mmap.c +++ b/arch/mips/mm/mmap.c -@@ -95,6 +95,11 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, +@@ -59,6 +59,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, + struct vm_area_struct *vma; + unsigned long addr = addr0; + int do_color_align; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + struct vm_unmapped_area_info info; + + if (unlikely(len > TASK_SIZE)) +@@ -84,6 +85,11 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, do_color_align = 1; /* requesting a specific address */ @@ -3157,48 +5490,59 @@ index 302d779..7d35bf8 100644 if (addr) { if (do_color_align) addr = COLOUR_ALIGN(addr, pgoff); -@@ -102,8 +107,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, +@@ -91,14 +97,14 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vmm, addr, len)) ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vmm, addr, len, offset)) return addr; } -@@ -118,7 +122,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, - /* At this point: (!vma || addr < vma->vm_end). */ - if (TASK_SIZE - len < addr) - return -ENOMEM; -- if (!vma || addr + len <= vma->vm_start) -+ if (check_heap_stack_gap(vmm, addr, len)) - return addr; - addr = vma->vm_end; - if (do_color_align) -@@ -145,7 +149,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, - /* make sure it can fit in the remaining address space */ - if (likely(addr > len)) { - vma = find_vma(mm, addr - len); -- if (!vma || addr <= vma->vm_start) { -+ if (check_heap_stack_gap(vmm, addr - len, len)) - /* cache the address as a hint for next time */ - return mm->free_area_cache = addr - len; - } -@@ -165,7 +169,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, - * return with success: - */ - vma = find_vma(mm, addr); -- if (likely(!vma || addr + len <= vma->vm_start)) { -+ if (check_heap_stack_gap(vmm, addr, len)) { - /* cache the address as a hint for next time */ - return mm->free_area_cache = addr; - } -@@ -242,30 +246,3 @@ void arch_pick_mmap_layout(struct mm_struct *mm) + info.length = len; + info.align_mask = do_color_align ? (PAGE_MASK & shm_align_mask) : 0; + info.align_offset = pgoff << PAGE_SHIFT; ++ info.threadstack_offset = offset; + + if (dir == DOWN) { + info.flags = VM_UNMAPPED_AREA_TOPDOWN; +@@ -146,6 +152,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm) + { + unsigned long random_factor = 0UL; + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + if (current->flags & PF_RANDOMIZE) { + random_factor = get_random_int(); + random_factor = random_factor << PAGE_SHIFT; +@@ -157,42 +167,27 @@ void arch_pick_mmap_layout(struct mm_struct *mm) + + if (mmap_is_legacy()) { + mm->mmap_base = TASK_UNMAPPED_BASE + random_factor; ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ mm->mmap_base += mm->delta_mmap; ++#endif ++ + mm->get_unmapped_area = arch_get_unmapped_area; + mm->unmap_area = arch_unmap_area; + } else { + mm->mmap_base = mmap_base(random_factor); ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ mm->mmap_base -= mm->delta_mmap + mm->delta_stack; ++#endif ++ + mm->get_unmapped_area = arch_get_unmapped_area_topdown; mm->unmap_area = arch_unmap_area_topdown; } } -- + -static inline unsigned long brk_rnd(void) -{ - unsigned long rnd = get_random_int(); @@ -3225,6 +5569,10 @@ index 302d779..7d35bf8 100644 - - return ret; -} +- + int __virt_addr_valid(const volatile void *kaddr) + { + return pfn_valid(PFN_DOWN(virt_to_phys(kaddr))); diff --git a/arch/mn10300/proc-mn103e010/include/proc/cache.h b/arch/mn10300/proc-mn103e010/include/proc/cache.h index 967d144..db12197 100644 --- a/arch/mn10300/proc-mn103e010/include/proc/cache.h @@ -3286,7 +5634,7 @@ index 4ce7a01..449202a 100644 #endif /* __ASM_OPENRISC_CACHE_H */ diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h -index af9cf30..2aae9b2 100644 +index f38e198..4179e38 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h @@ -229,6 +229,16 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) @@ -3335,7 +5683,7 @@ index 47f11c7..3420df2 100644 #define SMP_CACHE_BYTES L1_CACHE_BYTES diff --git a/arch/parisc/include/asm/elf.h b/arch/parisc/include/asm/elf.h -index 19f6cb1..6c78cf2 100644 +index ad2b503..bdf1651 100644 --- a/arch/parisc/include/asm/elf.h +++ b/arch/parisc/include/asm/elf.h @@ -342,6 +342,13 @@ struct pt_regs; /* forward declaration... */ @@ -3377,10 +5725,10 @@ index fc987a1..6e068ef 100644 #endif diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h -index ee99f23..802b0a1 100644 +index 1e40d7f..a3eb445 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h -@@ -212,6 +212,17 @@ struct vm_area_struct; +@@ -223,6 +223,17 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long); #define PAGE_EXECREAD __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_EXEC |_PAGE_ACCESSED) #define PAGE_COPY PAGE_EXECREAD #define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED) @@ -3399,10 +5747,10 @@ index ee99f23..802b0a1 100644 #define PAGE_KERNEL_EXEC __pgprot(_PAGE_KERNEL_EXEC) #define PAGE_KERNEL_RWX __pgprot(_PAGE_KERNEL_RWX) diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h -index 9ac0660..6ed15c4 100644 +index e0a8235..ce2f1e1 100644 --- a/arch/parisc/include/asm/uaccess.h +++ b/arch/parisc/include/asm/uaccess.h -@@ -252,10 +252,10 @@ static inline unsigned long __must_check copy_from_user(void *to, +@@ -245,10 +245,10 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -3416,7 +5764,7 @@ index 9ac0660..6ed15c4 100644 else copy_from_user_overflow(); diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c -index 5e34ccf..672bc9c 100644 +index 2a625fb..9908930 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c @@ -98,16 +98,38 @@ @@ -3462,7 +5810,7 @@ index 5e34ccf..672bc9c 100644 } static inline int in_local(struct module *me, void *loc) -@@ -373,13 +395,13 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr, +@@ -371,13 +393,13 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr, } /* align things a bit */ @@ -3482,7 +5830,7 @@ index 5e34ccf..672bc9c 100644 me->arch.got_max = gots; me->arch.fdesc_max = fdescs; -@@ -397,7 +419,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend) +@@ -395,7 +417,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend) BUG_ON(value == 0); @@ -3491,7 +5839,7 @@ index 5e34ccf..672bc9c 100644 for (i = 0; got[i].addr; i++) if (got[i].addr == value) goto out; -@@ -415,7 +437,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend) +@@ -413,7 +435,7 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend) #ifdef CONFIG_64BIT static Elf_Addr get_fdesc(struct module *me, unsigned long value) { @@ -3500,7 +5848,7 @@ index 5e34ccf..672bc9c 100644 if (!value) { printk(KERN_ERR "%s: zero OPD requested!\n", me->name); -@@ -433,7 +455,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value) +@@ -431,7 +453,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value) /* Create new one */ fdesc->addr = value; @@ -3509,7 +5857,7 @@ index 5e34ccf..672bc9c 100644 return (Elf_Addr)fdesc; } #endif /* CONFIG_64BIT */ -@@ -845,7 +867,7 @@ register_unwind_table(struct module *me, +@@ -843,7 +865,7 @@ register_unwind_table(struct module *me, table = (unsigned char *)sechdrs[me->arch.unwind_section].sh_addr; end = table + sechdrs[me->arch.unwind_section].sh_size; @@ -3519,38 +5867,81 @@ index 5e34ccf..672bc9c 100644 DEBUGP("register_unwind_table(), sect = %d at 0x%p - 0x%p (gp=0x%lx)\n", me->arch.unwind_section, table, end, gp); diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c -index c9b9322..02d8940 100644 +index 5dfd248..64914ac 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c -@@ -43,7 +43,7 @@ static unsigned long get_unshared_area(unsigned long addr, unsigned long len) - /* At this point: (!vma || addr < vma->vm_end). */ - if (TASK_SIZE - len < addr) - return -ENOMEM; -- if (!vma || addr + len <= vma->vm_start) -+ if (check_heap_stack_gap(vma, addr, len)) - return addr; - addr = vma->vm_end; - } -@@ -79,7 +79,7 @@ static unsigned long get_shared_area(struct address_space *mapping, - /* At this point: (!vma || addr < vma->vm_end). */ - if (TASK_SIZE - len < addr) - return -ENOMEM; -- if (!vma || addr + len <= vma->vm_start) -+ if (check_heap_stack_gap(vma, addr, len)) - return addr; - addr = DCACHE_ALIGN(vma->vm_end - offset) + offset; - if (addr < vma->vm_end) /* handle wraparound */ -@@ -98,7 +98,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - if (flags & MAP_FIXED) +@@ -33,9 +33,11 @@ + #include <linux/utsname.h> + #include <linux/personality.h> + +-static unsigned long get_unshared_area(unsigned long addr, unsigned long len) ++static unsigned long get_unshared_area(struct file *filp, unsigned long addr, unsigned long len, ++ unsigned long flags) + { + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(current->mm, filp, flags); + + info.flags = 0; + info.length = len; +@@ -43,6 +45,7 @@ static unsigned long get_unshared_area(unsigned long addr, unsigned long len) + info.high_limit = TASK_SIZE; + info.align_mask = 0; + info.align_offset = 0; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); + } + +@@ -61,10 +64,11 @@ static int get_offset(struct address_space *mapping) + return (unsigned long) mapping >> 8; + } + +-static unsigned long get_shared_area(struct address_space *mapping, +- unsigned long addr, unsigned long len, unsigned long pgoff) ++static unsigned long get_shared_area(struct file *filp, struct address_space *mapping, ++ unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) + { + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(current->mm, filp, flags); + + info.flags = 0; + info.length = len; +@@ -72,6 +76,7 @@ static unsigned long get_shared_area(struct address_space *mapping, + info.high_limit = TASK_SIZE; + info.align_mask = PAGE_MASK & (SHMLBA - 1); + info.align_offset = (get_offset(mapping) + pgoff) << PAGE_SHIFT; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); + } + +@@ -86,15 +91,22 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, + return -EINVAL; return addr; - if (!addr) -- addr = TASK_UNMAPPED_BASE; -+ addr = current->mm->mmap_base; + } +- if (!addr) ++ if (!addr) { + addr = TASK_UNMAPPED_BASE; ++#ifdef CONFIG_PAX_RANDMMAP ++ if (current->mm->pax_flags & MF_PAX_RANDMMAP) ++ addr += current->mm->delta_mmap; ++#endif ++ ++ } ++ if (filp) { - addr = get_shared_area(filp->f_mapping, addr, len, pgoff); +- addr = get_shared_area(filp->f_mapping, addr, len, pgoff); ++ addr = get_shared_area(filp, filp->f_mapping, addr, len, pgoff, flags); + } else if(flags & MAP_SHARED) { +- addr = get_shared_area(NULL, addr, len, pgoff); ++ addr = get_shared_area(filp, NULL, addr, len, pgoff, flags); + } else { +- addr = get_unshared_area(addr, len); ++ addr = get_unshared_area(filp, addr, len, flags); + } + return addr; + } diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c -index 45ba99f..8e22c33 100644 +index aeb8f8f..27a6c2f 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -732,9 +732,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs) @@ -3565,7 +5956,7 @@ index 45ba99f..8e22c33 100644 fault_space = regs->iasq[0]; diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c -index 18162ce..94de376 100644 +index f247a34..dc0f219 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -15,6 +15,7 @@ @@ -3702,7 +6093,7 @@ index 18162ce..94de376 100644 int fixup_exception(struct pt_regs *regs) { const struct exception_table_entry *fix; -@@ -192,8 +303,33 @@ good_area: +@@ -194,8 +305,33 @@ good_area: acc_type = parisc_acctyp(code,regs->iir); @@ -3738,10 +6129,10 @@ index 18162ce..94de376 100644 /* * If for any reason at all we couldn't handle the fault, make diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h -index da29032..f76c24c 100644 +index e3b1d41..8e81edf 100644 --- a/arch/powerpc/include/asm/atomic.h +++ b/arch/powerpc/include/asm/atomic.h -@@ -522,6 +522,16 @@ static __inline__ long atomic64_inc_not_zero(atomic64_t *v) +@@ -523,6 +523,16 @@ static __inline__ long atomic64_inc_not_zero(atomic64_t *v) return t1; } @@ -3780,10 +6171,10 @@ index 9e495c9..b6878e5 100644 #define SMP_CACHE_BYTES L1_CACHE_BYTES diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h -index 3bf9cca..e7457d0 100644 +index ac9790f..6d30741 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h -@@ -178,8 +178,19 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG]; +@@ -28,8 +28,19 @@ the loader. We need to make sure that it is out of the way of the program that it will "exec", and that there is sufficient room for the brk. */ @@ -3805,16 +6196,17 @@ index 3bf9cca..e7457d0 100644 /* * Our registers are always unsigned longs, whether we're a 32 bit -@@ -274,9 +285,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, +@@ -122,10 +133,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, (0x7ff >> (PAGE_SHIFT - 12)) : \ (0x3ffff >> (PAGE_SHIFT - 12))) -extern unsigned long arch_randomize_brk(struct mm_struct *mm); -#define arch_randomize_brk arch_randomize_brk - - #endif /* __KERNEL__ */ - - /* +- + #ifdef CONFIG_SPU_BASE + /* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */ + #define NT_SPU 1 diff --git a/arch/powerpc/include/asm/exec.h b/arch/powerpc/include/asm/exec.h index 8196e9c..d83a9f3 100644 --- a/arch/powerpc/include/asm/exec.h @@ -3828,22 +6220,23 @@ index 8196e9c..d83a9f3 100644 #endif /* _ASM_POWERPC_EXEC_H */ diff --git a/arch/powerpc/include/asm/kmap_types.h b/arch/powerpc/include/asm/kmap_types.h -index bca8fdc..61e9580 100644 +index 5acabbd..7ea14fa 100644 --- a/arch/powerpc/include/asm/kmap_types.h +++ b/arch/powerpc/include/asm/kmap_types.h -@@ -27,6 +27,7 @@ enum km_type { - KM_PPC_SYNC_PAGE, - KM_PPC_SYNC_ICACHE, - KM_KDB, -+ KM_CLEARPAGE, - KM_TYPE_NR - }; +@@ -10,7 +10,7 @@ + * 2 of the License, or (at your option) any later version. + */ + +-#define KM_TYPE_NR 16 ++#define KM_TYPE_NR 17 + #endif /* __KERNEL__ */ + #endif /* _ASM_POWERPC_KMAP_TYPES_H */ diff --git a/arch/powerpc/include/asm/mman.h b/arch/powerpc/include/asm/mman.h -index d4a7f64..451de1c 100644 +index 8565c25..2865190 100644 --- a/arch/powerpc/include/asm/mman.h +++ b/arch/powerpc/include/asm/mman.h -@@ -44,7 +44,7 @@ static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot) +@@ -24,7 +24,7 @@ static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot) } #define arch_calc_vm_prot_bits(prot) arch_calc_vm_prot_bits(prot) @@ -3879,10 +6272,10 @@ index f072e97..b436dee 100644 * Use the top bit of the higher-level page table entries to indicate whether * the entries we point to contain hugepages. This works because we know that diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h -index fed85e6..da5c71b 100644 +index cd915d6..c10cee8 100644 --- a/arch/powerpc/include/asm/page_64.h +++ b/arch/powerpc/include/asm/page_64.h -@@ -146,15 +146,18 @@ do { \ +@@ -154,15 +154,18 @@ do { \ * stack by default, so in the absence of a PT_GNU_STACK program header * we turn execute permission off. */ @@ -3936,7 +6329,7 @@ index 292725c..f87ae14 100644 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h -index 2e0e411..7899c68 100644 +index a9cbd3b..3b67efa 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h @@ -2,6 +2,7 @@ @@ -3960,10 +6353,10 @@ index 4aad413..85d86bf 100644 #define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */ #define _PAGE_WRITETHRU 0x040 /* W: cache write-through */ diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h -index cae0ed7..da44a51 100644 +index c9c67fc..e10c012 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h -@@ -212,6 +212,7 @@ +@@ -245,6 +245,7 @@ #define SPRN_DBCR 0x136 /* e300 Data Breakpoint Control Reg */ #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ #define DSISR_NOHPTE 0x40000000 /* no translation found */ @@ -3971,11 +6364,24 @@ index cae0ed7..da44a51 100644 #define DSISR_PROTFAULT 0x08000000 /* protection fault */ #define DSISR_ISSTORE 0x02000000 /* access was a store */ #define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ +diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h +index 195ce2a..ab5c614 100644 +--- a/arch/powerpc/include/asm/smp.h ++++ b/arch/powerpc/include/asm/smp.h +@@ -50,7 +50,7 @@ struct smp_ops_t { + int (*cpu_disable)(void); + void (*cpu_die)(unsigned int nr); + int (*cpu_bootable)(unsigned int nr); +-}; ++} __no_const; + + extern void smp_send_debugger_break(void); + extern void start_secondary_resume(void); diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h -index 4a741c7..c8162227b 100644 +index 406b7b9..af63426 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h -@@ -104,12 +104,14 @@ static inline struct thread_info *current_thread_info(void) +@@ -97,7 +97,6 @@ static inline struct thread_info *current_thread_info(void) #define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SINGLESTEP 8 /* singlestepping active */ @@ -3983,41 +6389,33 @@ index 4a741c7..c8162227b 100644 #define TIF_SECCOMP 10 /* secure computing */ #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ #define TIF_NOERROR 12 /* Force successful syscall return */ - #define TIF_NOTIFY_RESUME 13 /* callback before returning to user */ +@@ -106,6 +105,9 @@ static inline struct thread_info *current_thread_info(void) #define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */ -+#define TIF_MEMDIE 16 /* is terminating due to OOM killer */ + #define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation + for stack store? */ ++#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ +/* mask must be expressable within 16 bits to satisfy 'andi' instruction reqs */ +#define TIF_GRSEC_SETXID 9 /* update credentials on syscall entry/exit */ /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) -@@ -127,8 +129,11 @@ static inline struct thread_info *current_thread_info(void) - #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) +@@ -124,8 +126,10 @@ static inline struct thread_info *current_thread_info(void) + #define _TIF_UPROBE (1<<TIF_UPROBE) #define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) - #define _TIF_RUNLATCH (1<<TIF_RUNLATCH) + #define _TIF_EMULATE_STACK_STORE (1<<TIF_EMULATE_STACK_STORE) +#define _TIF_GRSEC_SETXID (1<<TIF_GRSEC_SETXID) -+ #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ - _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT) -+ _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT \ ++ _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \ + _TIF_GRSEC_SETXID) #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ - _TIF_NOTIFY_RESUME) + _TIF_NOTIFY_RESUME | _TIF_UPROBE) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h -index bd0fb84..a42a14b 100644 +index 4db4959..aba5c41 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h -@@ -13,6 +13,8 @@ - #define VERIFY_READ 0 - #define VERIFY_WRITE 1 - -+extern void check_object_size(const void *ptr, unsigned long n, bool to); -+ - /* - * The fs value determines whether argument validity checking should be - * performed or not. If get_fs() == USER_DS, checking is performed, with -@@ -327,52 +329,6 @@ do { \ +@@ -318,52 +318,6 @@ do { \ extern unsigned long __copy_tofrom_user(void __user *to, const void __user *from, unsigned long size); @@ -4070,7 +6468,7 @@ index bd0fb84..a42a14b 100644 static inline unsigned long __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) { -@@ -396,6 +352,10 @@ static inline unsigned long __copy_from_user_inatomic(void *to, +@@ -387,6 +341,10 @@ static inline unsigned long __copy_from_user_inatomic(void *to, if (ret == 0) return 0; } @@ -4081,7 +6479,7 @@ index bd0fb84..a42a14b 100644 return __copy_tofrom_user((__force void __user *)to, from, n); } -@@ -422,6 +382,10 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to, +@@ -413,6 +371,10 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to, if (ret == 0) return 0; } @@ -4092,7 +6490,7 @@ index bd0fb84..a42a14b 100644 return __copy_tofrom_user(to, (__force const void __user *)from, n); } -@@ -439,6 +403,92 @@ static inline unsigned long __copy_to_user(void __user *to, +@@ -430,6 +392,92 @@ static inline unsigned long __copy_to_user(void __user *to, return __copy_to_user_inatomic(to, from, size); } @@ -4186,10 +6584,10 @@ index bd0fb84..a42a14b 100644 static inline unsigned long clear_user(void __user *addr, unsigned long size) diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S -index 7215cc2..a9730c1 100644 +index ae54553..cf2184d 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S -@@ -661,6 +661,7 @@ storage_fault_common: +@@ -716,6 +716,7 @@ storage_fault_common: std r14,_DAR(r1) std r15,_DSISR(r1) addi r3,r1,STACK_FRAME_OVERHEAD @@ -4197,7 +6595,7 @@ index 7215cc2..a9730c1 100644 mr r4,r14 mr r5,r15 ld r14,PACA_EXGEN+EX_R14(r13) -@@ -669,8 +670,7 @@ storage_fault_common: +@@ -724,8 +725,7 @@ storage_fault_common: cmpdi r3,0 bne- 1f b .ret_from_except_lite @@ -4208,10 +6606,10 @@ index 7215cc2..a9730c1 100644 ld r4,_DAR(r1) bl .bad_page_fault diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S -index 8f880bc..c5bd2f3 100644 +index 3bbe7ed..14ec3eb 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S -@@ -890,10 +890,10 @@ handle_page_fault: +@@ -1390,10 +1390,10 @@ handle_page_fault: 11: ld r4,_DAR(r1) ld r5,_DSISR(r1) addi r3,r1,STACK_FRAME_OVERHEAD @@ -4257,10 +6655,10 @@ index 2e3200c..72095ce 100644 /* Find this entry, or if that fails, the next avail. entry */ while (entry->jump[0]) { diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c -index 94178e5..e6076f0 100644 +index 16e77a8..4501b41 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c -@@ -681,8 +681,8 @@ void show_regs(struct pt_regs * regs) +@@ -870,8 +870,8 @@ void show_regs(struct pt_regs * regs) * Lookup NIP late so we have the best change of getting the * above info out without failing */ @@ -4269,9 +6667,9 @@ index 94178e5..e6076f0 100644 + printk("NIP ["REG"] %pA\n", regs->nip, (void *)regs->nip); + printk("LR ["REG"] %pA\n", regs->link, (void *)regs->link); #endif - show_stack(current, (unsigned long *) regs->gpr[1]); - if (!user_mode(regs)) -@@ -1178,10 +1178,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) + #ifdef CONFIG_PPC_TRANSACTIONAL_MEM + printk("PACATMSCRATCH [%llx]\n", get_paca()->tm_scratch); +@@ -1330,10 +1330,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) newsp = stack[0]; ip = stack[STACK_FRAME_LR_SAVE]; if (!firstframe || ip != lr) { @@ -4284,7 +6682,7 @@ index 94178e5..e6076f0 100644 (void *)current->ret_stack[curr_frame].ret); curr_frame--; } -@@ -1201,7 +1201,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) +@@ -1353,7 +1353,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) struct pt_regs *regs = (struct pt_regs *) (sp + STACK_FRAME_OVERHEAD); lr = regs->link; @@ -4293,10 +6691,10 @@ index 94178e5..e6076f0 100644 regs->trap, (void *)regs->nip, (void *)lr); firstframe = 1; } -@@ -1274,58 +1274,3 @@ void thread_info_cache_init(void) +@@ -1395,58 +1395,3 @@ void __ppc64_runlatch_off(void) + mtspr(SPRN_CTRLT, ctrl); } - - #endif /* THREAD_SHIFT < PAGE_SHIFT */ + #endif /* CONFIG_PPC64 */ - -unsigned long arch_align_stack(unsigned long sp) -{ @@ -4353,10 +6751,10 @@ index 94178e5..e6076f0 100644 - return ret; -} diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c -index 8d8e028..c2aeb50 100644 +index f9b30c6..d72e7a3 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c -@@ -1702,6 +1702,10 @@ long arch_ptrace(struct task_struct *child, long request, +@@ -1771,6 +1771,10 @@ long arch_ptrace(struct task_struct *child, long request, return ret; } @@ -4367,9 +6765,9 @@ index 8d8e028..c2aeb50 100644 /* * We must return the syscall number to actually look up in the table. * This can be -1L to skip running any syscall at all. -@@ -1712,6 +1716,11 @@ long do_syscall_trace_enter(struct pt_regs *regs) +@@ -1781,6 +1785,11 @@ long do_syscall_trace_enter(struct pt_regs *regs) - secure_computing(regs->gpr[0]); + secure_computing_strict(regs->gpr[0]); +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) @@ -4379,7 +6777,7 @@ index 8d8e028..c2aeb50 100644 if (test_thread_flag(TIF_SYSCALL_TRACE) && tracehook_report_syscall_entry(regs)) /* -@@ -1746,6 +1755,11 @@ void do_syscall_trace_leave(struct pt_regs *regs) +@@ -1815,6 +1824,11 @@ void do_syscall_trace_leave(struct pt_regs *regs) { int step; @@ -4392,24 +6790,24 @@ index 8d8e028..c2aeb50 100644 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c -index 45eb998..0cb36bc 100644 +index 95068bf..9ba1814 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c -@@ -861,7 +861,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, +@@ -982,7 +982,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, /* Save user registers on the stack */ frame = &rt_sf->uc.uc_mcontext; addr = frame; - if (vdso32_rt_sigtramp && current->mm->context.vdso_base) { + if (vdso32_rt_sigtramp && current->mm->context.vdso_base != ~0UL) { - if (save_user_regs(regs, frame, 0, 1)) - goto badframe; - regs->link = current->mm->context.vdso_base + vdso32_rt_sigtramp; + sigret = 0; + tramp = current->mm->context.vdso_base + vdso32_rt_sigtramp; + } else { diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c -index 2692efd..6673d2e 100644 +index c179428..58acdaa 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c -@@ -430,7 +430,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info, - current->thread.fpscr.val = 0; +@@ -758,7 +758,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info, + #endif /* Set up to return from userspace. */ - if (vdso64_rt_sigtramp && current->mm->context.vdso_base) { @@ -4417,11 +6815,24 @@ index 2692efd..6673d2e 100644 regs->link = current->mm->context.vdso_base + vdso64_rt_sigtramp; } else { err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]); +diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c +index 3ce1f86..c30e629 100644 +--- a/arch/powerpc/kernel/sysfs.c ++++ b/arch/powerpc/kernel/sysfs.c +@@ -522,7 +522,7 @@ static int __cpuinit sysfs_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata sysfs_cpu_nb = { ++static struct notifier_block sysfs_cpu_nb = { + .notifier_call = sysfs_cpu_notify, + }; + diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c -index ae0843f..f16372c 100644 +index 83efa2f..6bb5839 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c -@@ -133,6 +133,8 @@ static unsigned __kprobes long oops_begin(struct pt_regs *regs) +@@ -141,6 +141,8 @@ static unsigned __kprobes long oops_begin(struct pt_regs *regs) return flags; } @@ -4430,7 +6841,7 @@ index ae0843f..f16372c 100644 static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) { -@@ -182,6 +184,9 @@ static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, +@@ -190,6 +192,9 @@ static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, panic("Fatal exception in interrupt"); if (panic_on_oops) panic("Fatal exception"); @@ -4441,7 +6852,7 @@ index ae0843f..f16372c 100644 } diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c -index 9eb5b9b..e45498a 100644 +index 1b2076f..835e4be 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c @@ -34,6 +34,7 @@ @@ -4506,7 +6917,7 @@ index 5eea6f3..5d10396 100644 EXPORT_SYMBOL(copy_in_user); diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c -index 08ffcf5..a0ab912 100644 +index 229951f..cdeca42 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -32,6 +32,10 @@ @@ -4554,7 +6965,7 @@ index 08ffcf5..a0ab912 100644 /* * Check whether the instruction at regs->nip is a store using * an update addressing form which will update r1. -@@ -215,7 +246,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address, +@@ -213,7 +244,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address, * indicate errors in DSISR but can validly be set in SRR1. */ if (trap == 0x400) @@ -4563,7 +6974,7 @@ index 08ffcf5..a0ab912 100644 else is_write = error_code & DSISR_ISSTORE; #else -@@ -366,7 +397,7 @@ good_area: +@@ -364,7 +395,7 @@ good_area: * "undefined". Of those that can be set, this is the only * one which seems bad. */ @@ -4572,7 +6983,7 @@ index 08ffcf5..a0ab912 100644 /* Guarded storage error. */ goto bad_area; #endif /* CONFIG_8xx */ -@@ -381,7 +412,7 @@ good_area: +@@ -379,7 +410,7 @@ good_area: * processors use the same I/D cache coherency mechanism * as embedded. */ @@ -4581,7 +6992,7 @@ index 08ffcf5..a0ab912 100644 goto bad_area; #endif /* CONFIG_PPC_STD_MMU */ -@@ -463,6 +494,23 @@ bad_area: +@@ -462,6 +493,23 @@ bad_area: bad_area_nosemaphore: /* User mode accesses cause a SIGSEGV */ if (user_mode(regs)) { @@ -4606,10 +7017,21 @@ index 08ffcf5..a0ab912 100644 return 0; } diff --git a/arch/powerpc/mm/mmap_64.c b/arch/powerpc/mm/mmap_64.c -index 67a42ed..1c7210c 100644 +index 67a42ed..cd463e0 100644 --- a/arch/powerpc/mm/mmap_64.c +++ b/arch/powerpc/mm/mmap_64.c -@@ -91,10 +91,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -57,6 +57,10 @@ static unsigned long mmap_rnd(void) + { + unsigned long rnd = 0; + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + if (current->flags & PF_RANDOMIZE) { + /* 8MB for 32bit, 1GB for 64bit */ + if (is_32bit_task()) +@@ -91,10 +95,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) */ if (mmap_is_legacy()) { mm->mmap_base = TASK_UNMAPPED_BASE; @@ -4632,29 +7054,55 @@ index 67a42ed..1c7210c 100644 mm->get_unmapped_area = arch_get_unmapped_area_topdown; mm->unmap_area = arch_unmap_area_topdown; } +diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c +index e779642..e5bb889 100644 +--- a/arch/powerpc/mm/mmu_context_nohash.c ++++ b/arch/powerpc/mm/mmu_context_nohash.c +@@ -363,7 +363,7 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata mmu_context_cpu_nb = { ++static struct notifier_block mmu_context_cpu_nb = { + .notifier_call = mmu_context_cpu_notify, + }; + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 6a252c4..3024d81 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -932,7 +932,7 @@ static void __init *careful_zallocation(int nid, unsigned long size, + return ret; + } + +-static struct notifier_block __cpuinitdata ppc64_numa_nb = { ++static struct notifier_block ppc64_numa_nb = { + .notifier_call = cpu_numa_callback, + .priority = 1 /* Must run before sched domains notifier. */ + }; diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c -index 73709f7..6b90313 100644 +index cf9dada..241529f 100644 --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c -@@ -98,7 +98,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, +@@ -103,7 +103,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, if ((mm->task_size - len) < addr) return 0; vma = find_vma(mm, addr); - return (!vma || (addr + len) <= vma->vm_start); -+ return check_heap_stack_gap(vma, addr, len); ++ return check_heap_stack_gap(vma, addr, len, 0); } static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice) -@@ -256,7 +256,7 @@ full_search: +@@ -272,7 +272,7 @@ full_search: addr = _ALIGN_UP(addr + 1, 1ul << SLICE_HIGH_SHIFT); continue; } - if (!vma || addr + len <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr, len)) { ++ if (check_heap_stack_gap(vma, addr, len, 0)) { /* * Remember the place where we stopped the search: */ -@@ -313,10 +313,14 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm, +@@ -329,10 +329,14 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm, } } @@ -4672,25 +7120,25 @@ index 73709f7..6b90313 100644 /* Check for hit with different page size */ mask = slice_range_to_mask(addr, len); -@@ -336,7 +340,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm, +@@ -352,7 +356,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm, * return with success: */ vma = find_vma(mm, addr); - if (!vma || (addr + len) <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr, len)) { ++ if (check_heap_stack_gap(vma, addr, len, 0)) { /* remember the address as a hint for next time */ if (use_cache) mm->free_area_cache = addr; -@@ -348,7 +352,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm, +@@ -364,7 +368,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm, mm->cached_hole_size = vma->vm_start - addr; /* try just below the current vma->vm_start */ - addr = vma->vm_start; -+ addr = skip_heap_stack_gap(vma, len); ++ addr = skip_heap_stack_gap(vma, len, 0); } /* -@@ -426,6 +430,11 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, +@@ -442,6 +446,11 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, if (fixed && addr > (mm->task_size - len)) return -EINVAL; @@ -4702,8 +7150,37 @@ index 73709f7..6b90313 100644 /* If hint, make sure it matches our alignment restrictions */ if (!fixed && addr) { addr = _ALIGN_UP(addr, 1ul << pshift); +diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c +index 68c57d3..1fdcfb2 100644 +--- a/arch/powerpc/platforms/cell/spufs/file.c ++++ b/arch/powerpc/platforms/cell/spufs/file.c +@@ -281,9 +281,9 @@ spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) + return VM_FAULT_NOPAGE; + } + +-static int spufs_mem_mmap_access(struct vm_area_struct *vma, ++static ssize_t spufs_mem_mmap_access(struct vm_area_struct *vma, + unsigned long address, +- void *buf, int len, int write) ++ void *buf, size_t len, int write) + { + struct spu_context *ctx = vma->vm_file->private_data; + unsigned long offset = address - vma->vm_start; +diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c +index bdb738a..49c9f95 100644 +--- a/arch/powerpc/platforms/powermac/smp.c ++++ b/arch/powerpc/platforms/powermac/smp.c +@@ -885,7 +885,7 @@ static int smp_core99_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata smp_core99_cpu_nb = { ++static struct notifier_block smp_core99_cpu_nb = { + .notifier_call = smp_core99_cpu_notify, + }; + #endif /* CONFIG_HOTPLUG_CPU */ diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h -index 748347b..81bc6c7 100644 +index c797832..ce575c8 100644 --- a/arch/s390/include/asm/atomic.h +++ b/arch/s390/include/asm/atomic.h @@ -326,6 +326,16 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v) @@ -4724,10 +7201,10 @@ index 748347b..81bc6c7 100644 #define smp_mb__after_atomic_dec() smp_mb() #define smp_mb__before_atomic_inc() smp_mb() diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h -index 2a30d5a..5e5586f 100644 +index 4d7ccac..d03d0ad 100644 --- a/arch/s390/include/asm/cache.h +++ b/arch/s390/include/asm/cache.h -@@ -11,8 +11,10 @@ +@@ -9,8 +9,10 @@ #ifndef __ARCH_S390_CACHE_H #define __ARCH_S390_CACHE_H @@ -4740,10 +7217,10 @@ index 2a30d5a..5e5586f 100644 #define __read_mostly __attribute__((__section__(".data..read_mostly"))) diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h -index c4ee39f..352881b 100644 +index 1bfdf24..9c9ab2e 100644 --- a/arch/s390/include/asm/elf.h +++ b/arch/s390/include/asm/elf.h -@@ -161,8 +161,14 @@ extern unsigned int vdso_enabled; +@@ -160,8 +160,14 @@ extern unsigned int vdso_enabled; the loader. We need to make sure that it is out of the way of the program that it will "exec", and that there is sufficient room for the brk. */ @@ -4760,13 +7237,15 @@ index c4ee39f..352881b 100644 /* This yields a mask that user programs can use to figure out what instruction set this CPU supports. */ -@@ -210,7 +216,4 @@ struct linux_binprm; +@@ -207,9 +213,6 @@ struct linux_binprm; #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 int arch_setup_additional_pages(struct linux_binprm *, int); -extern unsigned long arch_randomize_brk(struct mm_struct *mm); -#define arch_randomize_brk arch_randomize_brk - + void *fill_cpu_elf_notes(void *ptr, struct save_area *sa); + #endif diff --git a/arch/s390/include/asm/exec.h b/arch/s390/include/asm/exec.h index c4a93d6..4d2a9b4 100644 @@ -4781,10 +7260,10 @@ index c4a93d6..4d2a9b4 100644 #endif /* __ASM_EXEC_H */ diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h -index 8f2cada..43072c1 100644 +index 9c33ed4..e40cbef 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h -@@ -236,6 +236,10 @@ static inline unsigned long __must_check +@@ -252,6 +252,10 @@ static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n) { might_fault(); @@ -4792,10 +7271,10 @@ index 8f2cada..43072c1 100644 + if ((long)n < 0) + return n; + - if (access_ok(VERIFY_WRITE, to, n)) - n = __copy_to_user(to, from, n); - return n; -@@ -261,6 +265,9 @@ copy_to_user(void __user *to, const void *from, unsigned long n) + return __copy_to_user(to, from, n); + } + +@@ -275,6 +279,9 @@ copy_to_user(void __user *to, const void *from, unsigned long n) static inline unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -4805,7 +7284,7 @@ index 8f2cada..43072c1 100644 if (__builtin_constant_p(n) && (n <= 256)) return uaccess.copy_from_user_small(n, from, to); else -@@ -292,10 +299,14 @@ __compiletime_warning("copy_from_user() buffer size is not provably correct") +@@ -306,10 +313,14 @@ __compiletime_warning("copy_from_user() buffer size is not provably correct") static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -4823,10 +7302,10 @@ index 8f2cada..43072c1 100644 return n; } diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c -index dfcb343..eda788a 100644 +index 7845e15..59c4353 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c -@@ -161,11 +161,11 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, +@@ -169,11 +169,11 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, /* Increase core size by size of got & plt and set start offsets for got and plt. */ @@ -4843,7 +7322,7 @@ index dfcb343..eda788a 100644 return 0; } -@@ -242,7 +242,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, +@@ -289,7 +289,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, if (info->got_initialized == 0) { Elf_Addr *gotent; @@ -4852,16 +7331,16 @@ index dfcb343..eda788a 100644 info->got_offset; *gotent = val; info->got_initialized = 1; -@@ -266,7 +266,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, +@@ -312,7 +312,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, + rc = apply_rela_bits(loc, val, 0, 64, 0); else if (r_type == R_390_GOTENT || - r_type == R_390_GOTPLTENT) - *(unsigned int *) loc = -- (val + (Elf_Addr) me->module_core - loc) >> 1; -+ (val + (Elf_Addr) me->module_core_rw - loc) >> 1; - else if (r_type == R_390_GOT64 || - r_type == R_390_GOTPLT64) - *(unsigned long *) loc = val; -@@ -280,7 +280,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, + r_type == R_390_GOTPLTENT) { +- val += (Elf_Addr) me->module_core - loc; ++ val += (Elf_Addr) me->module_core_rw - loc; + rc = apply_rela_bits(loc, val, 1, 32, 1); + } + break; +@@ -325,7 +325,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, case R_390_PLTOFF64: /* 16 bit offset from GOT to PLT. */ if (info->plt_initialized == 0) { unsigned int *ip; @@ -4870,7 +7349,7 @@ index dfcb343..eda788a 100644 info->plt_offset; #ifndef CONFIG_64BIT ip[0] = 0x0d105810; /* basr 1,0; l 1,6(1); br 1 */ -@@ -305,7 +305,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, +@@ -350,7 +350,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, val - loc + 0xffffUL < 0x1ffffeUL) || (r_type == R_390_PLT32DBL && val - loc + 0xffffffffULL < 0x1fffffffeULL))) @@ -4879,16 +7358,16 @@ index dfcb343..eda788a 100644 me->arch.plt_offset + info->plt_offset; val += rela->r_addend - loc; -@@ -327,7 +327,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, +@@ -372,7 +372,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, case R_390_GOTOFF32: /* 32 bit offset to GOT. */ case R_390_GOTOFF64: /* 64 bit offset to GOT. */ val = val + rela->r_addend - - ((Elf_Addr) me->module_core + me->arch.got_offset); + ((Elf_Addr) me->module_core_rw + me->arch.got_offset); if (r_type == R_390_GOTOFF16) - *(unsigned short *) loc = val; + rc = apply_rela_bits(loc, val, 0, 16, 0); else if (r_type == R_390_GOTOFF32) -@@ -337,7 +337,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, +@@ -382,7 +382,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, break; case R_390_GOTPC: /* 32 bit PC relative offset to GOT. */ case R_390_GOTPCDBL: /* 32 bit PC rel. off. to GOT shifted by 1. */ @@ -4896,12 +7375,12 @@ index dfcb343..eda788a 100644 + val = (Elf_Addr) me->module_core_rw + me->arch.got_offset + rela->r_addend - loc; if (r_type == R_390_GOTPC) - *(unsigned int *) loc = val; + rc = apply_rela_bits(loc, val, 1, 32, 0); diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c -index 60055ce..ee4b252 100644 +index 536d645..4a5bd9e 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c -@@ -316,39 +316,3 @@ unsigned long get_wchan(struct task_struct *p) +@@ -250,39 +250,3 @@ unsigned long get_wchan(struct task_struct *p) } return 0; } @@ -4942,10 +7421,10 @@ index 60055ce..ee4b252 100644 - return ret; -} diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c -index a64fe53..5c66963 100644 +index 06bafec..2bca531 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c -@@ -92,10 +92,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -90,10 +90,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) */ if (mmap_is_legacy()) { mm->mmap_base = TASK_UNMAPPED_BASE; @@ -4968,7 +7447,7 @@ index a64fe53..5c66963 100644 mm->get_unmapped_area = arch_get_unmapped_area_topdown; mm->unmap_area = arch_unmap_area_topdown; } -@@ -174,10 +186,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -175,10 +187,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) */ if (mmap_is_legacy()) { mm->mmap_base = TASK_UNMAPPED_BASE; @@ -5019,10 +7498,10 @@ index f9f3cd5..58ff438 100644 #endif /* _ASM_SCORE_EXEC_H */ diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c -index 2707023..1c2a3b7 100644 +index 7956846..5f37677 100644 --- a/arch/score/kernel/process.c +++ b/arch/score/kernel/process.c -@@ -159,8 +159,3 @@ unsigned long get_wchan(struct task_struct *task) +@@ -134,8 +134,3 @@ unsigned long get_wchan(struct task_struct *task) return task_pt_regs(task)->cp0_epc; } @@ -5048,99 +7527,103 @@ index ef9e555..331bd29 100644 #define __read_mostly __attribute__((__section__(".data..read_mostly"))) +diff --git a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c +index 03f2b55..b0270327 100644 +--- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c ++++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c +@@ -143,7 +143,7 @@ shx3_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata shx3_cpu_notifier = { ++static struct notifier_block shx3_cpu_notifier = { + .notifier_call = shx3_cpu_callback, + }; + diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c -index afeb710..d1d1289 100644 +index 6777177..cb5e44f 100644 --- a/arch/sh/mm/mmap.c +++ b/arch/sh/mm/mmap.c -@@ -74,8 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, +@@ -36,6 +36,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + int do_colour_align; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + struct vm_unmapped_area_info info; + + if (flags & MAP_FIXED) { +@@ -55,6 +56,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, + if (filp || (flags & MAP_SHARED)) + do_colour_align = 1; + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + if (addr) { + if (do_colour_align) + addr = COLOUR_ALIGN(addr, pgoff); +@@ -62,14 +67,13 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } -@@ -106,7 +105,7 @@ full_search: - } - return -ENOMEM; - } -- if (likely(!vma || addr + len <= vma->vm_start)) { -+ if (likely(check_heap_stack_gap(vma, addr, len))) { - /* - * Remember the place where we stopped the search: - */ -@@ -157,8 +156,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + info.flags = 0; + info.length = len; +- info.low_limit = TASK_UNMAPPED_BASE; ++ info.low_limit = mm->mmap_base; + info.high_limit = TASK_SIZE; + info.align_mask = do_colour_align ? (PAGE_MASK & shm_align_mask) : 0; + info.align_offset = pgoff << PAGE_SHIFT; +@@ -85,6 +89,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + struct mm_struct *mm = current->mm; + unsigned long addr = addr0; + int do_colour_align; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + struct vm_unmapped_area_info info; + + if (flags & MAP_FIXED) { +@@ -104,6 +109,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + if (filp || (flags & MAP_SHARED)) + do_colour_align = 1; + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + /* requesting a specific address */ + if (addr) { + if (do_colour_align) +@@ -112,8 +121,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } -@@ -179,7 +177,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - /* make sure it can fit in the remaining address space */ - if (likely(addr > len)) { - vma = find_vma(mm, addr-len); -- if (!vma || addr <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr - len, len)) { - /* remember the address as a hint for next time */ - return (mm->free_area_cache = addr-len); - } -@@ -188,18 +186,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - if (unlikely(mm->mmap_base < len)) - goto bottomup; - -- addr = mm->mmap_base-len; -- if (do_colour_align) -- addr = COLOUR_ALIGN_DOWN(addr, pgoff); -+ addr = mm->mmap_base - len; - - do { -+ if (do_colour_align) -+ addr = COLOUR_ALIGN_DOWN(addr, pgoff); - /* - * Lookup failure means no vma is above this address, - * else if new region fits below vma->vm_start, - * return with success: - */ - vma = find_vma(mm, addr); -- if (likely(!vma || addr+len <= vma->vm_start)) { -+ if (likely(check_heap_stack_gap(vma, addr, len))) { - /* remember the address as a hint for next time */ - return (mm->free_area_cache = addr); - } -@@ -209,10 +207,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - mm->cached_hole_size = vma->vm_start - addr; - - /* try just below the current vma->vm_start */ -- addr = vma->vm_start-len; -- if (do_colour_align) -- addr = COLOUR_ALIGN_DOWN(addr, pgoff); -- } while (likely(len < vma->vm_start)); -+ addr = skip_heap_stack_gap(vma, len); -+ } while (!IS_ERR_VALUE(addr)); - - bottomup: - /* -diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile -index eddcfb3..b117d90 100644 ---- a/arch/sparc/Makefile -+++ b/arch/sparc/Makefile -@@ -75,7 +75,7 @@ drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/ - # Export what is needed by arch/sparc/boot/Makefile - export VMLINUX_INIT VMLINUX_MAIN - VMLINUX_INIT := $(head-y) $(init-y) --VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/ -+VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/ grsecurity/ - VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y) - VMLINUX_MAIN += $(drivers-y) $(net-y) - +@@ -135,6 +143,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + VM_BUG_ON(addr != -ENOMEM); + info.flags = 0; + info.low_limit = TASK_UNMAPPED_BASE; ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; ++#endif ++ + info.high_limit = TASK_SIZE; + addr = vm_unmapped_area(&info); + } diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h -index ce35a1c..2e7b8f9 100644 +index be56a24..443328f 100644 --- a/arch/sparc/include/asm/atomic_64.h +++ b/arch/sparc/include/asm/atomic_64.h @@ -14,18 +14,40 @@ @@ -5330,7 +7813,7 @@ index ce35a1c..2e7b8f9 100644 #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h -index 69358b5..9d0d492 100644 +index 5bb6991..5c2132e 100644 --- a/arch/sparc/include/asm/cache.h +++ b/arch/sparc/include/asm/cache.h @@ -7,10 +7,12 @@ @@ -5348,7 +7831,7 @@ index 69358b5..9d0d492 100644 #ifdef CONFIG_SPARC32 #define SMP_CACHE_BYTES_SHIFT 5 diff --git a/arch/sparc/include/asm/elf_32.h b/arch/sparc/include/asm/elf_32.h -index 4269ca6..e3da77f 100644 +index a24e41f..47677ff 100644 --- a/arch/sparc/include/asm/elf_32.h +++ b/arch/sparc/include/asm/elf_32.h @@ -114,6 +114,13 @@ typedef struct { @@ -5366,10 +7849,10 @@ index 4269ca6..e3da77f 100644 instruction set this cpu supports. This can NOT be done in userspace on Sparc. */ diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h -index 7df8b7f..4946269 100644 +index 370ca1e..d4f4a98 100644 --- a/arch/sparc/include/asm/elf_64.h +++ b/arch/sparc/include/asm/elf_64.h -@@ -180,6 +180,13 @@ typedef struct { +@@ -189,6 +189,13 @@ typedef struct { #define ELF_ET_DYN_BASE 0x0000010000000000UL #define COMPAT_ELF_ET_DYN_BASE 0x0000000070000000UL @@ -5384,19 +7867,19 @@ index 7df8b7f..4946269 100644 #define ELF_HWCAP sparc64_elf_hwcap diff --git a/arch/sparc/include/asm/pgalloc_32.h b/arch/sparc/include/asm/pgalloc_32.h -index ca2b344..c6084f89 100644 +index 9b1c36d..209298b 100644 --- a/arch/sparc/include/asm/pgalloc_32.h +++ b/arch/sparc/include/asm/pgalloc_32.h -@@ -37,6 +37,7 @@ BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *) - BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *) - #define pgd_set(pgdp,pmdp) BTFIXUP_CALL(pgd_set)(pgdp,pmdp) +@@ -33,6 +33,7 @@ static inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp) + } + #define pgd_populate(MM, PGD, PMD) pgd_set(PGD, PMD) +#define pgd_populate_kernel(MM, PGD, PMD) pgd_populate((MM), (PGD), (PMD)) - BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one, struct mm_struct *, unsigned long) - #define pmd_alloc_one(mm, address) BTFIXUP_CALL(pmd_alloc_one)(mm, address) + static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, + unsigned long address) diff --git a/arch/sparc/include/asm/pgalloc_64.h b/arch/sparc/include/asm/pgalloc_64.h -index 40b2d7a..22a665b 100644 +index bcfe063..b333142 100644 --- a/arch/sparc/include/asm/pgalloc_64.h +++ b/arch/sparc/include/asm/pgalloc_64.h @@ -26,6 +26,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) @@ -5408,54 +7891,56 @@ index 40b2d7a..22a665b 100644 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) { diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h -index 3d71018..48a11c5 100644 +index 6fc1348..390c50a 100644 --- a/arch/sparc/include/asm/pgtable_32.h +++ b/arch/sparc/include/asm/pgtable_32.h -@@ -45,6 +45,13 @@ BTFIXUPDEF_SIMM13(user_ptrs_per_pgd) - BTFIXUPDEF_INT(page_none) - BTFIXUPDEF_INT(page_copy) - BTFIXUPDEF_INT(page_readonly) -+ -+#ifdef CONFIG_PAX_PAGEEXEC -+BTFIXUPDEF_INT(page_shared_noexec) -+BTFIXUPDEF_INT(page_copy_noexec) -+BTFIXUPDEF_INT(page_readonly_noexec) -+#endif -+ - BTFIXUPDEF_INT(page_kernel) - - #define PMD_SHIFT SUN4C_PMD_SHIFT -@@ -66,6 +73,16 @@ extern pgprot_t PAGE_SHARED; - #define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy)) - #define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly)) - -+#ifdef CONFIG_PAX_PAGEEXEC -+extern pgprot_t PAGE_SHARED_NOEXEC; -+# define PAGE_COPY_NOEXEC __pgprot(BTFIXUP_INT(page_copy_noexec)) -+# define PAGE_READONLY_NOEXEC __pgprot(BTFIXUP_INT(page_readonly_noexec)) -+#else -+# define PAGE_SHARED_NOEXEC PAGE_SHARED -+# define PAGE_COPY_NOEXEC PAGE_COPY -+# define PAGE_READONLY_NOEXEC PAGE_READONLY -+#endif -+ - extern unsigned long page_kernel; - - #ifdef MODULE +@@ -50,6 +50,9 @@ extern unsigned long calc_highpages(void); + #define PAGE_SHARED SRMMU_PAGE_SHARED + #define PAGE_COPY SRMMU_PAGE_COPY + #define PAGE_READONLY SRMMU_PAGE_RDONLY ++#define PAGE_SHARED_NOEXEC SRMMU_PAGE_SHARED_NOEXEC ++#define PAGE_COPY_NOEXEC SRMMU_PAGE_COPY_NOEXEC ++#define PAGE_READONLY_NOEXEC SRMMU_PAGE_RDONLY_NOEXEC + #define PAGE_KERNEL SRMMU_PAGE_KERNEL + + /* Top-level page directory - dummy used by init-mm. +@@ -62,18 +65,18 @@ extern unsigned long ptr_in_current_pgd; + + /* xwr */ + #define __P000 PAGE_NONE +-#define __P001 PAGE_READONLY +-#define __P010 PAGE_COPY +-#define __P011 PAGE_COPY ++#define __P001 PAGE_READONLY_NOEXEC ++#define __P010 PAGE_COPY_NOEXEC ++#define __P011 PAGE_COPY_NOEXEC + #define __P100 PAGE_READONLY + #define __P101 PAGE_READONLY + #define __P110 PAGE_COPY + #define __P111 PAGE_COPY + + #define __S000 PAGE_NONE +-#define __S001 PAGE_READONLY +-#define __S010 PAGE_SHARED +-#define __S011 PAGE_SHARED ++#define __S001 PAGE_READONLY_NOEXEC ++#define __S010 PAGE_SHARED_NOEXEC ++#define __S011 PAGE_SHARED_NOEXEC + #define __S100 PAGE_READONLY + #define __S101 PAGE_READONLY + #define __S110 PAGE_SHARED diff --git a/arch/sparc/include/asm/pgtsrmmu.h b/arch/sparc/include/asm/pgtsrmmu.h -index f6ae2b2..b03ffc7 100644 +index 79da178..c2eede8 100644 --- a/arch/sparc/include/asm/pgtsrmmu.h +++ b/arch/sparc/include/asm/pgtsrmmu.h -@@ -115,6 +115,13 @@ +@@ -115,6 +115,11 @@ SRMMU_EXEC | SRMMU_REF) #define SRMMU_PAGE_RDONLY __pgprot(SRMMU_VALID | SRMMU_CACHE | \ SRMMU_EXEC | SRMMU_REF) + -+#ifdef CONFIG_PAX_PAGEEXEC +#define SRMMU_PAGE_SHARED_NOEXEC __pgprot(SRMMU_VALID | SRMMU_CACHE | SRMMU_WRITE | SRMMU_REF) -+#define SRMMU_PAGE_COPY_NOEXEC __pgprot(SRMMU_VALID | SRMMU_CACHE | SRMMU_REF) ++#define SRMMU_PAGE_COPY_NOEXEC __pgprot(SRMMU_VALID | SRMMU_CACHE | SRMMU_REF) +#define SRMMU_PAGE_RDONLY_NOEXEC __pgprot(SRMMU_VALID | SRMMU_CACHE | SRMMU_REF) -+#endif + #define SRMMU_PAGE_KERNEL __pgprot(SRMMU_VALID | SRMMU_CACHE | SRMMU_PRIV | \ SRMMU_DIRTY | SRMMU_REF) @@ -5562,10 +8047,10 @@ index 9689176..63c18ea 100644 unsigned long mask, tmp1, tmp2, result; diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h -index c2a1080..21ed218 100644 +index 25849ae..924c54b 100644 --- a/arch/sparc/include/asm/thread_info_32.h +++ b/arch/sparc/include/asm/thread_info_32.h -@@ -50,6 +50,8 @@ struct thread_info { +@@ -49,6 +49,8 @@ struct thread_info { unsigned long w_saved; struct restart_block restart_block; @@ -5575,7 +8060,7 @@ index c2a1080..21ed218 100644 /* diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h -index 01d057f..13a7d2f 100644 +index 269bd92..e46a9b8 100644 --- a/arch/sparc/include/asm/thread_info_64.h +++ b/arch/sparc/include/asm/thread_info_64.h @@ -63,6 +63,8 @@ struct thread_info { @@ -5587,7 +8072,7 @@ index 01d057f..13a7d2f 100644 unsigned long fpregs[0] __attribute__ ((aligned(64))); }; -@@ -214,10 +216,11 @@ register struct thread_info *current_thread_info_reg asm("g6"); +@@ -192,10 +194,11 @@ register struct thread_info *current_thread_info_reg asm("g6"); #define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */ /* flag bit 6 is available */ #define TIF_32BIT 7 /* 32-bit binary */ @@ -5600,7 +8085,7 @@ index 01d057f..13a7d2f 100644 /* NOTE: Thread flags >= 12 should be ones we have no interest * in using in assembly, else we can't use the mask as * an immediate value in instructions such as andcc. -@@ -236,12 +239,18 @@ register struct thread_info *current_thread_info_reg asm("g6"); +@@ -214,12 +217,18 @@ register struct thread_info *current_thread_info_reg asm("g6"); #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) #define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) @@ -5620,28 +8105,21 @@ index 01d057f..13a7d2f 100644 * Thread-synchronous status. * diff --git a/arch/sparc/include/asm/uaccess.h b/arch/sparc/include/asm/uaccess.h -index e88fbe5..96b0ce5 100644 +index 0167d26..767bb0c 100644 --- a/arch/sparc/include/asm/uaccess.h +++ b/arch/sparc/include/asm/uaccess.h -@@ -1,5 +1,13 @@ +@@ -1,5 +1,6 @@ #ifndef ___ASM_SPARC_UACCESS_H #define ___ASM_SPARC_UACCESS_H + -+#ifdef __KERNEL__ -+#ifndef __ASSEMBLY__ -+#include <linux/types.h> -+extern void check_object_size(const void *ptr, unsigned long n, bool to); -+#endif -+#endif -+ #if defined(__sparc__) && defined(__arch64__) #include <asm/uaccess_64.h> #else diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h -index 8303ac4..07f333d 100644 +index 53a28dd..50c38c3 100644 --- a/arch/sparc/include/asm/uaccess_32.h +++ b/arch/sparc/include/asm/uaccess_32.h -@@ -249,27 +249,46 @@ extern unsigned long __copy_user(void __user *to, const void __user *from, unsig +@@ -250,27 +250,46 @@ extern unsigned long __copy_user(void __user *to, const void __user *from, unsig static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) { @@ -5693,7 +8171,7 @@ index 8303ac4..07f333d 100644 } diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h -index a1091afb..380228e 100644 +index e562d3c..191f176 100644 --- a/arch/sparc/include/asm/uaccess_64.h +++ b/arch/sparc/include/asm/uaccess_64.h @@ -10,6 +10,7 @@ @@ -5704,7 +8182,7 @@ index a1091afb..380228e 100644 #include <asm/asi.h> #include <asm/spitfire.h> #include <asm-generic/uaccess-unaligned.h> -@@ -212,8 +213,15 @@ extern unsigned long copy_from_user_fixup(void *to, const void __user *from, +@@ -214,8 +215,15 @@ extern unsigned long copy_from_user_fixup(void *to, const void __user *from, static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long size) { @@ -5721,25 +8199,25 @@ index a1091afb..380228e 100644 if (unlikely(ret)) ret = copy_from_user_fixup(to, from, size); -@@ -229,8 +237,15 @@ extern unsigned long copy_to_user_fixup(void __user *to, const void *from, +@@ -231,8 +239,15 @@ extern unsigned long copy_to_user_fixup(void __user *to, const void *from, static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long size) { - unsigned long ret = ___copy_to_user(to, from, size); + unsigned long ret; -+ + + if ((long)size < 0 || size > INT_MAX) + return size; + + if (!__builtin_constant_p(size)) + check_object_size(from, size, true); - ++ + ret = ___copy_to_user(to, from, size); if (unlikely(ret)) ret = copy_to_user_fixup(to, from, size); return ret; diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile -index cb85458..e063f17 100644 +index 6cf591b..b49e65a 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile @@ -3,7 +3,7 @@ @@ -5750,21 +8228,12 @@ index cb85458..e063f17 100644 +#ccflags-y := -Werror extra-y := head_$(BITS).o - extra-y += init_task.o + diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c -index efa0754..74b03fe 100644 +index 62eede1..9c5b904 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c -@@ -200,7 +200,7 @@ void __show_backtrace(unsigned long fp) - rw->ins[4], rw->ins[5], - rw->ins[6], - rw->ins[7]); -- printk("%pS\n", (void *) rw->ins[7]); -+ printk("%pA\n", (void *) rw->ins[7]); - rw = (struct reg_window32 *) rw->ins[6]; - } - spin_unlock_irqrestore(&sparc_backtrace_lock, flags); -@@ -267,14 +267,14 @@ void show_regs(struct pt_regs *r) +@@ -125,14 +125,14 @@ void show_regs(struct pt_regs *r) printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n", r->psr, r->pc, r->npc, r->y, print_tainted()); @@ -5781,7 +8250,7 @@ index efa0754..74b03fe 100644 printk("%%L: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3], -@@ -309,7 +309,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) +@@ -167,7 +167,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) rw = (struct reg_window32 *) fp; pc = rw->ins[7]; printk("[%08lx : ", pc); @@ -5791,10 +8260,10 @@ index efa0754..74b03fe 100644 } while (++count < 16); printk("\n"); diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c -index aff0c72..9067b39 100644 +index cdb80b2..5ca141d 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c -@@ -179,14 +179,14 @@ static void show_regwindow(struct pt_regs *regs) +@@ -181,14 +181,14 @@ static void show_regwindow(struct pt_regs *regs) printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n", rwk->ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]); if (regs->tstate & TSTATE_PRIV) @@ -5811,7 +8280,7 @@ index aff0c72..9067b39 100644 printk("g0: %016lx g1: %016lx g2: %016lx g3: %016lx\n", regs->u_regs[0], regs->u_regs[1], regs->u_regs[2], regs->u_regs[3]); -@@ -199,7 +199,7 @@ void show_regs(struct pt_regs *regs) +@@ -201,7 +201,7 @@ void show_regs(struct pt_regs *regs) printk("o4: %016lx o5: %016lx sp: %016lx ret_pc: %016lx\n", regs->u_regs[12], regs->u_regs[13], regs->u_regs[14], regs->u_regs[15]); @@ -5820,7 +8289,7 @@ index aff0c72..9067b39 100644 show_regwindow(regs); show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]); } -@@ -284,7 +284,7 @@ void arch_trigger_all_cpu_backtrace(void) +@@ -290,7 +290,7 @@ void arch_trigger_all_cpu_backtrace(void) ((tp && tp->task) ? tp->task->pid : -1)); if (gp->tstate & TSTATE_PRIV) { @@ -5829,8 +8298,21 @@ index aff0c72..9067b39 100644 (void *) gp->tpc, (void *) gp->o7, (void *) gp->i7, +diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c +index 9f20566..67eb41b 100644 +--- a/arch/sparc/kernel/prom_common.c ++++ b/arch/sparc/kernel/prom_common.c +@@ -143,7 +143,7 @@ static int __init prom_common_nextprop(phandle node, char *prev, char *buf) + + unsigned int prom_early_allocated __initdata; + +-static struct of_pdt_ops prom_sparc_ops __initdata = { ++static struct of_pdt_ops prom_sparc_ops __initconst = { + .nextprop = prom_common_nextprop, + .getproplen = prom_getproplen, + .getproperty = prom_getproperty, diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c -index 6f97c07..b1300ec 100644 +index 7ff45e4..a58f271 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c @@ -1057,6 +1057,10 @@ long arch_ptrace(struct task_struct *child, long request, @@ -5846,7 +8328,7 @@ index 6f97c07..b1300ec 100644 int ret = 0; @@ -1064,6 +1068,11 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) /* do the secure computing check first */ - secure_computing(regs->u_regs[UREG_G1]); + secure_computing_strict(regs->u_regs[UREG_G1]); +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) @@ -5869,32 +8351,30 @@ index 6f97c07..b1300ec 100644 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c -index 42b282f..28ce9f2 100644 +index 3a8d184..49498a8 100644 --- a/arch/sparc/kernel/sys_sparc_32.c +++ b/arch/sparc/kernel/sys_sparc_32.c -@@ -56,7 +56,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - if (ARCH_SUN4C && len > 0x20000000) +@@ -52,7 +52,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi + if (len > TASK_SIZE - PAGE_SIZE) return -ENOMEM; if (!addr) - addr = TASK_UNMAPPED_BASE; + addr = current->mm->mmap_base; - if (flags & MAP_SHARED) - addr = COLOUR_ALIGN(addr); -@@ -71,7 +71,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - } - if (TASK_SIZE - PAGE_SIZE - len < addr) - return -ENOMEM; -- if (!vmm || addr + len <= vmm->vm_start) -+ if (check_heap_stack_gap(vmm, addr, len)) - return addr; - addr = vmm->vm_end; - if (flags & MAP_SHARED) + info.flags = 0; + info.length = len; diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c -index 3ee51f1..2ba4913 100644 +index 708bc29..6bfdfad 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c -@@ -124,7 +124,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi +@@ -90,13 +90,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi + struct vm_area_struct * vma; + unsigned long task_size = TASK_SIZE; + int do_color_align; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + struct vm_unmapped_area_info info; + + if (flags & MAP_FIXED) { /* We do not accept a shared mapping if it would violate * cache aliasing constraints. */ @@ -5903,7 +8383,7 @@ index 3ee51f1..2ba4913 100644 ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))) return -EINVAL; return addr; -@@ -139,6 +139,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi +@@ -111,6 +112,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi if (filp || (flags & MAP_SHARED)) do_color_align = 1; @@ -5913,45 +8393,48 @@ index 3ee51f1..2ba4913 100644 + if (addr) { if (do_color_align) - addr = COLOUR_ALIGN(addr, pgoff); -@@ -146,15 +150,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi + addr = COLOR_ALIGN(addr, pgoff); +@@ -118,22 +123,28 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); - if (task_size - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (task_size - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (task_size - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } - if (len > mm->cached_hole_size) { -- start_addr = addr = mm->free_area_cache; -+ start_addr = addr = mm->free_area_cache; - } else { -- start_addr = addr = TASK_UNMAPPED_BASE; -+ start_addr = addr = mm->mmap_base; - mm->cached_hole_size = 0; + info.flags = 0; + info.length = len; +- info.low_limit = TASK_UNMAPPED_BASE; ++ info.low_limit = mm->mmap_base; + info.high_limit = min(task_size, VA_EXCLUDE_START); + info.align_mask = do_color_align ? (PAGE_MASK & (SHMLBA - 1)) : 0; + info.align_offset = pgoff << PAGE_SHIFT; ++ info.threadstack_offset = offset; + addr = vm_unmapped_area(&info); + + if ((addr & ~PAGE_MASK) && task_size > VA_EXCLUDE_END) { + VM_BUG_ON(addr != -ENOMEM); + info.low_limit = VA_EXCLUDE_END; ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; ++#endif ++ + info.high_limit = task_size; + addr = vm_unmapped_area(&info); } +@@ -151,6 +162,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + unsigned long task_size = STACK_TOP32; + unsigned long addr = addr0; + int do_color_align; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + struct vm_unmapped_area_info info; -@@ -174,14 +177,14 @@ full_search: - vma = find_vma(mm, VA_EXCLUDE_END); - } - if (unlikely(task_size < addr)) { -- if (start_addr != TASK_UNMAPPED_BASE) { -- start_addr = addr = TASK_UNMAPPED_BASE; -+ if (start_addr != mm->mmap_base) { -+ start_addr = addr = mm->mmap_base; - mm->cached_hole_size = 0; - goto full_search; - } - return -ENOMEM; - } -- if (likely(!vma || addr + len <= vma->vm_start)) { -+ if (likely(check_heap_stack_gap(vma, addr, len))) { - /* - * Remember the place where we stopped the search: - */ -@@ -215,7 +218,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + /* This should only ever run for 32-bit processes. */ +@@ -160,7 +172,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, /* We do not accept a shared mapping if it would violate * cache aliasing constraints. */ @@ -5960,62 +8443,60 @@ index 3ee51f1..2ba4913 100644 ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))) return -EINVAL; return addr; -@@ -236,8 +239,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -173,6 +185,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + if (filp || (flags & MAP_SHARED)) + do_color_align = 1; + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + /* requesting a specific address */ + if (addr) { + if (do_color_align) +@@ -181,8 +197,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); - if (task_size - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (task_size - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (task_size - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } -@@ -258,7 +260,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - /* make sure it can fit in the remaining address space */ - if (likely(addr > len)) { - vma = find_vma(mm, addr-len); -- if (!vma || addr <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr - len, len)) { - /* remember the address as a hint for next time */ - return (mm->free_area_cache = addr-len); - } -@@ -267,18 +269,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - if (unlikely(mm->mmap_base < len)) - goto bottomup; - -- addr = mm->mmap_base-len; -- if (do_color_align) -- addr = COLOUR_ALIGN_DOWN(addr, pgoff); -+ addr = mm->mmap_base - len; - - do { -+ if (do_color_align) -+ addr = COLOUR_ALIGN_DOWN(addr, pgoff); - /* - * Lookup failure means no vma is above this address, - * else if new region fits below vma->vm_start, - * return with success: - */ - vma = find_vma(mm, addr); -- if (likely(!vma || addr+len <= vma->vm_start)) { -+ if (likely(check_heap_stack_gap(vma, addr, len))) { - /* remember the address as a hint for next time */ - return (mm->free_area_cache = addr); - } -@@ -288,10 +290,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - mm->cached_hole_size = vma->vm_start - addr; - - /* try just below the current vma->vm_start */ -- addr = vma->vm_start-len; -- if (do_color_align) -- addr = COLOUR_ALIGN_DOWN(addr, pgoff); -- } while (likely(len < vma->vm_start)); -+ addr = skip_heap_stack_gap(vma, len); -+ } while (!IS_ERR_VALUE(addr)); +@@ -192,6 +207,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + info.high_limit = mm->mmap_base; + info.align_mask = do_color_align ? (PAGE_MASK & (SHMLBA - 1)) : 0; + info.align_offset = pgoff << PAGE_SHIFT; ++ info.threadstack_offset = offset; + addr = vm_unmapped_area(&info); - bottomup: /* -@@ -390,6 +390,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -204,6 +220,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + VM_BUG_ON(addr != -ENOMEM); + info.flags = 0; + info.low_limit = TASK_UNMAPPED_BASE; ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; ++#endif ++ + info.high_limit = STACK_TOP32; + addr = vm_unmapped_area(&info); + } +@@ -264,6 +286,10 @@ static unsigned long mmap_rnd(void) + { + unsigned long rnd = 0UL; + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + if (current->flags & PF_RANDOMIZE) { + unsigned long val = get_random_int(); + if (test_thread_flag(TIF_32BIT)) +@@ -289,6 +315,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm) gap == RLIM_INFINITY || sysctl_legacy_va_layout) { mm->mmap_base = TASK_UNMAPPED_BASE + random_factor; @@ -6028,7 +8509,7 @@ index 3ee51f1..2ba4913 100644 mm->get_unmapped_area = arch_get_unmapped_area; mm->unmap_area = arch_unmap_area; } else { -@@ -402,6 +408,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm) +@@ -301,6 +333,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm) gap = (task_size / 6 * 5); mm->mmap_base = PAGE_ALIGN(task_size - gap - random_factor); @@ -6042,10 +8523,10 @@ index 3ee51f1..2ba4913 100644 mm->unmap_area = arch_unmap_area_topdown; } diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S -index 1d7e274..b39c527 100644 +index 22a1098..6255eb9 100644 --- a/arch/sparc/kernel/syscalls.S +++ b/arch/sparc/kernel/syscalls.S -@@ -62,7 +62,7 @@ sys32_rt_sigreturn: +@@ -52,7 +52,7 @@ sys32_rt_sigreturn: #endif .align 32 1: ldx [%g6 + TI_FLAGS], %l5 @@ -6054,7 +8535,7 @@ index 1d7e274..b39c527 100644 be,pt %icc, rtrap nop call syscall_trace_leave -@@ -179,7 +179,7 @@ linux_sparc_syscall32: +@@ -184,7 +184,7 @@ linux_sparc_syscall32: srl %i5, 0, %o5 ! IEU1 srl %i2, 0, %o2 ! IEU0 Group @@ -6063,7 +8544,7 @@ index 1d7e274..b39c527 100644 bne,pn %icc, linux_syscall_trace32 ! CTI mov %i0, %l5 ! IEU1 call %l7 ! CTI Group brk forced -@@ -202,7 +202,7 @@ linux_sparc_syscall: +@@ -207,7 +207,7 @@ linux_sparc_syscall: mov %i3, %o3 ! IEU1 mov %i4, %o4 ! IEU0 Group @@ -6072,26 +8553,30 @@ index 1d7e274..b39c527 100644 bne,pn %icc, linux_syscall_trace ! CTI Group mov %i0, %l5 ! IEU0 2: call %l7 ! CTI Group brk forced -@@ -226,7 +226,7 @@ ret_sys_call: +@@ -223,7 +223,7 @@ ret_sys_call: cmp %o0, -ERESTART_RESTARTBLOCK bgeu,pn %xcc, 1f -- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6 -+ andcc %l0, _TIF_WORK_SYSCALL, %l6 - 80: - /* System call success, clear Carry condition code. */ - andn %g3, %g2, %g3 -@@ -241,7 +241,7 @@ ret_sys_call: - /* System call failure, set Carry condition code. - * Also, get abs(errno) to return to the process. - */ -- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6 -+ andcc %l0, _TIF_WORK_SYSCALL, %l6 - sub %g0, %o0, %o0 - or %g3, %g2, %g3 - stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] +- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 ++ andcc %l0, _TIF_WORK_SYSCALL, %g0 + ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc + + 2: +diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c +index 654e8aa..45f431b 100644 +--- a/arch/sparc/kernel/sysfs.c ++++ b/arch/sparc/kernel/sysfs.c +@@ -266,7 +266,7 @@ static int __cpuinit sysfs_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata sysfs_cpu_nb = { ++static struct notifier_block sysfs_cpu_nb = { + .notifier_call = sysfs_cpu_notify, + }; + diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c -index d2de213..6b22bc3 100644 +index 6629829..036032d 100644 --- a/arch/sparc/kernel/traps_32.c +++ b/arch/sparc/kernel/traps_32.c @@ -44,6 +44,8 @@ static void instruction_dump(unsigned long *pc) @@ -6124,10 +8609,10 @@ index d2de213..6b22bc3 100644 } diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c -index c72fdf5..743a344 100644 +index 8d38ca9..845b1d6 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c -@@ -75,7 +75,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p) +@@ -76,7 +76,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p) i + 1, p->trapstack[i].tstate, p->trapstack[i].tpc, p->trapstack[i].tnpc, p->trapstack[i].tt); @@ -6136,7 +8621,7 @@ index c72fdf5..743a344 100644 } } -@@ -95,6 +95,12 @@ void bad_trap(struct pt_regs *regs, long lvl) +@@ -96,6 +96,12 @@ void bad_trap(struct pt_regs *regs, long lvl) lvl -= 0x100; if (regs->tstate & TSTATE_PRIV) { @@ -6149,7 +8634,7 @@ index c72fdf5..743a344 100644 sprintf(buffer, "Kernel bad sw trap %lx", lvl); die_if_kernel(buffer, regs); } -@@ -113,11 +119,16 @@ void bad_trap(struct pt_regs *regs, long lvl) +@@ -114,11 +120,16 @@ void bad_trap(struct pt_regs *regs, long lvl) void bad_trap_tl1(struct pt_regs *regs, long lvl) { char buffer[32]; @@ -6167,7 +8652,7 @@ index c72fdf5..743a344 100644 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); sprintf (buffer, "Bad trap %lx at tl>0", lvl); -@@ -1141,7 +1152,7 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in +@@ -1142,7 +1153,7 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in regs->tpc, regs->tnpc, regs->u_regs[UREG_I7], regs->tstate); printk("%s" "ERROR(%d): ", (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id()); @@ -6176,7 +8661,7 @@ index c72fdf5..743a344 100644 printk("%s" "ERROR(%d): M_SYND(%lx), E_SYND(%lx)%s%s\n", (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), (afsr & CHAFSR_M_SYNDROME) >> CHAFSR_M_SYNDROME_SHIFT, -@@ -1748,7 +1759,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs) +@@ -1749,7 +1760,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs) smp_processor_id(), (type & 0x1) ? 'I' : 'D', regs->tpc); @@ -6185,7 +8670,7 @@ index c72fdf5..743a344 100644 panic("Irrecoverable Cheetah+ parity error."); } -@@ -1756,7 +1767,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs) +@@ -1757,7 +1768,7 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs) smp_processor_id(), (type & 0x1) ? 'I' : 'D', regs->tpc); @@ -6194,7 +8679,7 @@ index c72fdf5..743a344 100644 } struct sun4v_error_entry { -@@ -1963,9 +1974,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl) +@@ -2104,9 +2115,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl) printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n", regs->tpc, tl); @@ -6206,7 +8691,7 @@ index c72fdf5..743a344 100644 (void *) regs->u_regs[UREG_I7]); printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] " "pte[%lx] error[%lx]\n", -@@ -1987,9 +1998,9 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl) +@@ -2128,9 +2139,9 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl) printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n", regs->tpc, tl); @@ -6218,7 +8703,7 @@ index c72fdf5..743a344 100644 (void *) regs->u_regs[UREG_I7]); printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] " "pte[%lx] error[%lx]\n", -@@ -2195,13 +2206,13 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) +@@ -2336,13 +2347,13 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) fp = (unsigned long)sf->fp + STACK_BIAS; } @@ -6234,7 +8719,7 @@ index c72fdf5..743a344 100644 graph++; } } -@@ -2226,6 +2237,8 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw) +@@ -2367,6 +2378,8 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw) return (struct reg_window *) (fp + STACK_BIAS); } @@ -6243,7 +8728,7 @@ index c72fdf5..743a344 100644 void die_if_kernel(char *str, struct pt_regs *regs) { static int die_counter; -@@ -2254,7 +2267,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) +@@ -2395,7 +2408,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) while (rw && count++ < 30 && kstack_valid(tp, (unsigned long) rw)) { @@ -6252,7 +8737,7 @@ index c72fdf5..743a344 100644 (void *) rw->ins[7]); rw = kernel_stack_up(rw); -@@ -2267,8 +2280,10 @@ void die_if_kernel(char *str, struct pt_regs *regs) +@@ -2408,8 +2421,10 @@ void die_if_kernel(char *str, struct pt_regs *regs) } user_instruction_dump ((unsigned int __user *) regs->tpc); } @@ -6265,10 +8750,10 @@ index c72fdf5..743a344 100644 } EXPORT_SYMBOL(die_if_kernel); diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c -index dae85bc..af1e19d 100644 +index 8201c25e..072a2a7 100644 --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c -@@ -279,7 +279,7 @@ static void log_unaligned(struct pt_regs *regs) +@@ -286,7 +286,7 @@ static void log_unaligned(struct pt_regs *regs) static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5); if (__ratelimit(&ratelimit)) { @@ -6277,8 +8762,117 @@ index dae85bc..af1e19d 100644 regs->tpc, (void *) regs->tpc); } } +diff --git a/arch/sparc/kernel/us3_cpufreq.c b/arch/sparc/kernel/us3_cpufreq.c +index eb1624b..55100de 100644 +--- a/arch/sparc/kernel/us3_cpufreq.c ++++ b/arch/sparc/kernel/us3_cpufreq.c +@@ -18,14 +18,12 @@ + #include <asm/head.h> + #include <asm/timer.h> + +-static struct cpufreq_driver *cpufreq_us3_driver; +- + struct us3_freq_percpu_info { + struct cpufreq_frequency_table table[4]; + }; + + /* Indexed by cpu number. */ +-static struct us3_freq_percpu_info *us3_freq_table; ++static struct us3_freq_percpu_info us3_freq_table[NR_CPUS]; + + /* UltraSPARC-III has three dividers: 1, 2, and 32. These are controlled + * in the Safari config register. +@@ -191,12 +189,25 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) + + static int us3_freq_cpu_exit(struct cpufreq_policy *policy) + { +- if (cpufreq_us3_driver) +- us3_set_cpu_divider_index(policy->cpu, 0); ++ us3_set_cpu_divider_index(policy->cpu, 0); + + return 0; + } + ++static int __init us3_freq_init(void); ++static void __exit us3_freq_exit(void); ++ ++static struct cpufreq_driver cpufreq_us3_driver = { ++ .init = us3_freq_cpu_init, ++ .verify = us3_freq_verify, ++ .target = us3_freq_target, ++ .get = us3_freq_get, ++ .exit = us3_freq_cpu_exit, ++ .owner = THIS_MODULE, ++ .name = "UltraSPARC-III", ++ ++}; ++ + static int __init us3_freq_init(void) + { + unsigned long manuf, impl, ver; +@@ -213,57 +224,15 @@ static int __init us3_freq_init(void) + (impl == CHEETAH_IMPL || + impl == CHEETAH_PLUS_IMPL || + impl == JAGUAR_IMPL || +- impl == PANTHER_IMPL)) { +- struct cpufreq_driver *driver; +- +- ret = -ENOMEM; +- driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL); +- if (!driver) +- goto err_out; +- +- us3_freq_table = kzalloc( +- (NR_CPUS * sizeof(struct us3_freq_percpu_info)), +- GFP_KERNEL); +- if (!us3_freq_table) +- goto err_out; +- +- driver->init = us3_freq_cpu_init; +- driver->verify = us3_freq_verify; +- driver->target = us3_freq_target; +- driver->get = us3_freq_get; +- driver->exit = us3_freq_cpu_exit; +- driver->owner = THIS_MODULE, +- strcpy(driver->name, "UltraSPARC-III"); +- +- cpufreq_us3_driver = driver; +- ret = cpufreq_register_driver(driver); +- if (ret) +- goto err_out; +- +- return 0; +- +-err_out: +- if (driver) { +- kfree(driver); +- cpufreq_us3_driver = NULL; +- } +- kfree(us3_freq_table); +- us3_freq_table = NULL; +- return ret; +- } ++ impl == PANTHER_IMPL)) ++ return cpufreq_register_driver(&cpufreq_us3_driver); + + return -ENODEV; + } + + static void __exit us3_freq_exit(void) + { +- if (cpufreq_us3_driver) { +- cpufreq_unregister_driver(cpufreq_us3_driver); +- kfree(cpufreq_us3_driver); +- cpufreq_us3_driver = NULL; +- kfree(us3_freq_table); +- us3_freq_table = NULL; +- } ++ cpufreq_unregister_driver(&cpufreq_us3_driver); + } + + MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile -index a3fc437..fea9957 100644 +index 8410065f2..4fd4ca22 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile @@ -2,7 +2,7 @@ @@ -6288,14 +8882,14 @@ index a3fc437..fea9957 100644 -ccflags-y := -Werror +#ccflags-y := -Werror - lib-$(CONFIG_SPARC32) += mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o + lib-$(CONFIG_SPARC32) += ashrdi3.o lib-$(CONFIG_SPARC32) += memcpy.o memset.o diff --git a/arch/sparc/lib/atomic_64.S b/arch/sparc/lib/atomic_64.S -index 59186e0..f747d7a 100644 +index 85c233d..68500e0 100644 --- a/arch/sparc/lib/atomic_64.S +++ b/arch/sparc/lib/atomic_64.S -@@ -18,7 +18,12 @@ - atomic_add: /* %o0 = increment, %o1 = atomic_ptr */ +@@ -17,7 +17,12 @@ + ENTRY(atomic_add) /* %o0 = increment, %o1 = atomic_ptr */ BACKOFF_SETUP(%o2) 1: lduw [%o1], %g1 - add %g1, %o0, %g7 @@ -6308,13 +8902,11 @@ index 59186e0..f747d7a 100644 cas [%o1], %g1, %g7 cmp %g1, %g7 bne,pn %icc, BACKOFF_LABEL(2f, 1b) -@@ -28,12 +33,32 @@ atomic_add: /* %o0 = increment, %o1 = atomic_ptr */ +@@ -27,10 +32,28 @@ ENTRY(atomic_add) /* %o0 = increment, %o1 = atomic_ptr */ 2: BACKOFF_SPIN(%o2, %o3, 1b) - .size atomic_add, .-atomic_add + ENDPROC(atomic_add) -+ .globl atomic_add_unchecked -+ .type atomic_add_unchecked,#function -+atomic_add_unchecked: /* %o0 = increment, %o1 = atomic_ptr */ ++ENTRY(atomic_add_unchecked) /* %o0 = increment, %o1 = atomic_ptr */ + BACKOFF_SETUP(%o2) +1: lduw [%o1], %g1 + add %g1, %o0, %g7 @@ -6325,11 +8917,9 @@ index 59186e0..f747d7a 100644 + retl + nop +2: BACKOFF_SPIN(%o2, %o3, 1b) -+ .size atomic_add_unchecked, .-atomic_add_unchecked ++ENDPROC(atomic_add_unchecked) + - .globl atomic_sub - .type atomic_sub,#function - atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */ + ENTRY(atomic_sub) /* %o0 = decrement, %o1 = atomic_ptr */ BACKOFF_SETUP(%o2) 1: lduw [%o1], %g1 - sub %g1, %o0, %g7 @@ -6342,13 +8932,11 @@ index 59186e0..f747d7a 100644 cas [%o1], %g1, %g7 cmp %g1, %g7 bne,pn %icc, BACKOFF_LABEL(2f, 1b) -@@ -43,12 +68,32 @@ atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */ +@@ -40,10 +63,28 @@ ENTRY(atomic_sub) /* %o0 = decrement, %o1 = atomic_ptr */ 2: BACKOFF_SPIN(%o2, %o3, 1b) - .size atomic_sub, .-atomic_sub + ENDPROC(atomic_sub) -+ .globl atomic_sub_unchecked -+ .type atomic_sub_unchecked,#function -+atomic_sub_unchecked: /* %o0 = decrement, %o1 = atomic_ptr */ ++ENTRY(atomic_sub_unchecked) /* %o0 = decrement, %o1 = atomic_ptr */ + BACKOFF_SETUP(%o2) +1: lduw [%o1], %g1 + sub %g1, %o0, %g7 @@ -6359,11 +8947,9 @@ index 59186e0..f747d7a 100644 + retl + nop +2: BACKOFF_SPIN(%o2, %o3, 1b) -+ .size atomic_sub_unchecked, .-atomic_sub_unchecked ++ENDPROC(atomic_sub_unchecked) + - .globl atomic_add_ret - .type atomic_add_ret,#function - atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */ + ENTRY(atomic_add_ret) /* %o0 = increment, %o1 = atomic_ptr */ BACKOFF_SETUP(%o2) 1: lduw [%o1], %g1 - add %g1, %o0, %g7 @@ -6376,13 +8962,11 @@ index 59186e0..f747d7a 100644 cas [%o1], %g1, %g7 cmp %g1, %g7 bne,pn %icc, BACKOFF_LABEL(2f, 1b) -@@ -58,12 +103,33 @@ atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */ +@@ -53,10 +94,29 @@ ENTRY(atomic_add_ret) /* %o0 = increment, %o1 = atomic_ptr */ 2: BACKOFF_SPIN(%o2, %o3, 1b) - .size atomic_add_ret, .-atomic_add_ret + ENDPROC(atomic_add_ret) -+ .globl atomic_add_ret_unchecked -+ .type atomic_add_ret_unchecked,#function -+atomic_add_ret_unchecked: /* %o0 = increment, %o1 = atomic_ptr */ ++ENTRY(atomic_add_ret_unchecked) /* %o0 = increment, %o1 = atomic_ptr */ + BACKOFF_SETUP(%o2) +1: lduw [%o1], %g1 + addcc %g1, %o0, %g7 @@ -6394,11 +8978,9 @@ index 59186e0..f747d7a 100644 + retl + nop +2: BACKOFF_SPIN(%o2, %o3, 1b) -+ .size atomic_add_ret_unchecked, .-atomic_add_ret_unchecked ++ENDPROC(atomic_add_ret_unchecked) + - .globl atomic_sub_ret - .type atomic_sub_ret,#function - atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */ + ENTRY(atomic_sub_ret) /* %o0 = decrement, %o1 = atomic_ptr */ BACKOFF_SETUP(%o2) 1: lduw [%o1], %g1 - sub %g1, %o0, %g7 @@ -6411,8 +8993,8 @@ index 59186e0..f747d7a 100644 cas [%o1], %g1, %g7 cmp %g1, %g7 bne,pn %icc, BACKOFF_LABEL(2f, 1b) -@@ -78,7 +144,12 @@ atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */ - atomic64_add: /* %o0 = increment, %o1 = atomic_ptr */ +@@ -69,7 +129,12 @@ ENDPROC(atomic_sub_ret) + ENTRY(atomic64_add) /* %o0 = increment, %o1 = atomic_ptr */ BACKOFF_SETUP(%o2) 1: ldx [%o1], %g1 - add %g1, %o0, %g7 @@ -6425,13 +9007,11 @@ index 59186e0..f747d7a 100644 casx [%o1], %g1, %g7 cmp %g1, %g7 bne,pn %xcc, BACKOFF_LABEL(2f, 1b) -@@ -88,12 +159,32 @@ atomic64_add: /* %o0 = increment, %o1 = atomic_ptr */ +@@ -79,10 +144,28 @@ ENTRY(atomic64_add) /* %o0 = increment, %o1 = atomic_ptr */ 2: BACKOFF_SPIN(%o2, %o3, 1b) - .size atomic64_add, .-atomic64_add + ENDPROC(atomic64_add) -+ .globl atomic64_add_unchecked -+ .type atomic64_add_unchecked,#function -+atomic64_add_unchecked: /* %o0 = increment, %o1 = atomic_ptr */ ++ENTRY(atomic64_add_unchecked) /* %o0 = increment, %o1 = atomic_ptr */ + BACKOFF_SETUP(%o2) +1: ldx [%o1], %g1 + addcc %g1, %o0, %g7 @@ -6442,11 +9022,9 @@ index 59186e0..f747d7a 100644 + retl + nop +2: BACKOFF_SPIN(%o2, %o3, 1b) -+ .size atomic64_add_unchecked, .-atomic64_add_unchecked ++ENDPROC(atomic64_add_unchecked) + - .globl atomic64_sub - .type atomic64_sub,#function - atomic64_sub: /* %o0 = decrement, %o1 = atomic_ptr */ + ENTRY(atomic64_sub) /* %o0 = decrement, %o1 = atomic_ptr */ BACKOFF_SETUP(%o2) 1: ldx [%o1], %g1 - sub %g1, %o0, %g7 @@ -6459,13 +9037,11 @@ index 59186e0..f747d7a 100644 casx [%o1], %g1, %g7 cmp %g1, %g7 bne,pn %xcc, BACKOFF_LABEL(2f, 1b) -@@ -103,12 +194,32 @@ atomic64_sub: /* %o0 = decrement, %o1 = atomic_ptr */ +@@ -92,10 +175,28 @@ ENTRY(atomic64_sub) /* %o0 = decrement, %o1 = atomic_ptr */ 2: BACKOFF_SPIN(%o2, %o3, 1b) - .size atomic64_sub, .-atomic64_sub + ENDPROC(atomic64_sub) -+ .globl atomic64_sub_unchecked -+ .type atomic64_sub_unchecked,#function -+atomic64_sub_unchecked: /* %o0 = decrement, %o1 = atomic_ptr */ ++ENTRY(atomic64_sub_unchecked) /* %o0 = decrement, %o1 = atomic_ptr */ + BACKOFF_SETUP(%o2) +1: ldx [%o1], %g1 + subcc %g1, %o0, %g7 @@ -6476,11 +9052,9 @@ index 59186e0..f747d7a 100644 + retl + nop +2: BACKOFF_SPIN(%o2, %o3, 1b) -+ .size atomic64_sub_unchecked, .-atomic64_sub_unchecked ++ENDPROC(atomic64_sub_unchecked) + - .globl atomic64_add_ret - .type atomic64_add_ret,#function - atomic64_add_ret: /* %o0 = increment, %o1 = atomic_ptr */ + ENTRY(atomic64_add_ret) /* %o0 = increment, %o1 = atomic_ptr */ BACKOFF_SETUP(%o2) 1: ldx [%o1], %g1 - add %g1, %o0, %g7 @@ -6493,13 +9067,11 @@ index 59186e0..f747d7a 100644 casx [%o1], %g1, %g7 cmp %g1, %g7 bne,pn %xcc, BACKOFF_LABEL(2f, 1b) -@@ -118,12 +229,33 @@ atomic64_add_ret: /* %o0 = increment, %o1 = atomic_ptr */ +@@ -105,10 +206,29 @@ ENTRY(atomic64_add_ret) /* %o0 = increment, %o1 = atomic_ptr */ 2: BACKOFF_SPIN(%o2, %o3, 1b) - .size atomic64_add_ret, .-atomic64_add_ret + ENDPROC(atomic64_add_ret) -+ .globl atomic64_add_ret_unchecked -+ .type atomic64_add_ret_unchecked,#function -+atomic64_add_ret_unchecked: /* %o0 = increment, %o1 = atomic_ptr */ ++ENTRY(atomic64_add_ret_unchecked) /* %o0 = increment, %o1 = atomic_ptr */ + BACKOFF_SETUP(%o2) +1: ldx [%o1], %g1 + addcc %g1, %o0, %g7 @@ -6511,11 +9083,9 @@ index 59186e0..f747d7a 100644 + retl + nop +2: BACKOFF_SPIN(%o2, %o3, 1b) -+ .size atomic64_add_ret_unchecked, .-atomic64_add_ret_unchecked ++ENDPROC(atomic64_add_ret_unchecked) + - .globl atomic64_sub_ret - .type atomic64_sub_ret,#function - atomic64_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */ + ENTRY(atomic64_sub_ret) /* %o0 = decrement, %o1 = atomic_ptr */ BACKOFF_SETUP(%o2) 1: ldx [%o1], %g1 - sub %g1, %o0, %g7 @@ -6529,10 +9099,10 @@ index 59186e0..f747d7a 100644 cmp %g1, %g7 bne,pn %xcc, BACKOFF_LABEL(2f, 1b) diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c -index f73c224..662af10 100644 +index 0c4e35e..745d3e4 100644 --- a/arch/sparc/lib/ksyms.c +++ b/arch/sparc/lib/ksyms.c -@@ -136,12 +136,18 @@ EXPORT_SYMBOL(__downgrade_write); +@@ -109,12 +109,18 @@ EXPORT_SYMBOL(__downgrade_write); /* Atomic counter implementation. */ EXPORT_SYMBOL(atomic_add); @@ -6549,10 +9119,10 @@ index f73c224..662af10 100644 EXPORT_SYMBOL(atomic64_sub); +EXPORT_SYMBOL(atomic64_sub_unchecked); EXPORT_SYMBOL(atomic64_sub_ret); + EXPORT_SYMBOL(atomic64_dec_if_positive); - /* Atomic bit operations. */ diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile -index 301421c..e2535d1 100644 +index 30c3ecc..736f015 100644 --- a/arch/sparc/mm/Makefile +++ b/arch/sparc/mm/Makefile @@ -2,7 +2,7 @@ @@ -6565,7 +9135,7 @@ index 301421c..e2535d1 100644 obj-$(CONFIG_SPARC64) += ultra.o tlb.o tsb.o gup.o obj-y += fault_$(BITS).o diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c -index df3155a..9c41fb9 100644 +index e98bfda..ea8d221 100644 --- a/arch/sparc/mm/fault_32.c +++ b/arch/sparc/mm/fault_32.c @@ -21,6 +21,9 @@ @@ -6578,7 +9148,7 @@ index df3155a..9c41fb9 100644 #include <asm/page.h> #include <asm/pgtable.h> -@@ -207,6 +210,277 @@ static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault) +@@ -159,6 +162,277 @@ static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault) return safe_compute_effective_address(regs, insn); } @@ -6856,8 +9426,8 @@ index df3155a..9c41fb9 100644 static noinline void do_fault_siginfo(int code, int sig, struct pt_regs *regs, int text_fault) { -@@ -282,6 +556,24 @@ good_area: - if(!(vma->vm_flags & VM_WRITE)) +@@ -230,6 +504,24 @@ good_area: + if (!(vma->vm_flags & VM_WRITE)) goto bad_area; } else { + @@ -6879,10 +9449,10 @@ index df3155a..9c41fb9 100644 +#endif + /* Allow reads even for write-only mappings */ - if(!(vma->vm_flags & (VM_READ | VM_EXEC))) + if (!(vma->vm_flags & (VM_READ | VM_EXEC))) goto bad_area; diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c -index 1fe0429..8dd5dd5 100644 +index 5062ff3..e0b75f3 100644 --- a/arch/sparc/mm/fault_64.c +++ b/arch/sparc/mm/fault_64.c @@ -21,6 +21,9 @@ @@ -6904,7 +9474,7 @@ index 1fe0429..8dd5dd5 100644 printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr); dump_stack(); unhandled_fault(regs->tpc, current, regs); -@@ -272,6 +275,466 @@ static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs, +@@ -270,6 +273,466 @@ static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs, show_regs(regs); } @@ -7371,7 +9941,7 @@ index 1fe0429..8dd5dd5 100644 asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) { struct mm_struct *mm = current->mm; -@@ -343,6 +806,29 @@ retry: +@@ -341,6 +804,29 @@ retry: if (!vma) goto bad_area; @@ -7402,124 +9972,69 @@ index 1fe0429..8dd5dd5 100644 * load/store/atomic was a write or not, it only says that there * was no match. So in such a case we (carefully) read the diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c -index 07e1453..0a7d9e9 100644 +index d2b5944..bd813f2 100644 --- a/arch/sparc/mm/hugetlbpage.c +++ b/arch/sparc/mm/hugetlbpage.c -@@ -67,7 +67,7 @@ full_search: - } - return -ENOMEM; - } -- if (likely(!vma || addr + len <= vma->vm_start)) { -+ if (likely(check_heap_stack_gap(vma, addr, len))) { - /* - * Remember the place where we stopped the search: - */ -@@ -106,7 +106,7 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - /* make sure it can fit in the remaining address space */ - if (likely(addr > len)) { - vma = find_vma(mm, addr-len); -- if (!vma || addr <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr - len, len)) { - /* remember the address as a hint for next time */ - return (mm->free_area_cache = addr-len); - } -@@ -115,16 +115,17 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - if (unlikely(mm->mmap_base < len)) - goto bottomup; - -- addr = (mm->mmap_base-len) & HPAGE_MASK; -+ addr = mm->mmap_base - len; - - do { -+ addr &= HPAGE_MASK; - /* - * Lookup failure means no vma is above this address, - * else if new region fits below vma->vm_start, - * return with success: - */ - vma = find_vma(mm, addr); -- if (likely(!vma || addr+len <= vma->vm_start)) { -+ if (likely(check_heap_stack_gap(vma, addr, len))) { - /* remember the address as a hint for next time */ - return (mm->free_area_cache = addr); - } -@@ -134,8 +135,8 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - mm->cached_hole_size = vma->vm_start - addr; +@@ -38,7 +38,7 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp, + + info.flags = 0; + info.length = len; +- info.low_limit = TASK_UNMAPPED_BASE; ++ info.low_limit = mm->mmap_base; + info.high_limit = min(task_size, VA_EXCLUDE_START); + info.align_mask = PAGE_MASK & ~HPAGE_MASK; + info.align_offset = 0; +@@ -47,6 +47,12 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp, + if ((addr & ~PAGE_MASK) && task_size > VA_EXCLUDE_END) { + VM_BUG_ON(addr != -ENOMEM); + info.low_limit = VA_EXCLUDE_END; ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; ++#endif ++ + info.high_limit = task_size; + addr = vm_unmapped_area(&info); + } +@@ -85,6 +91,12 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + VM_BUG_ON(addr != -ENOMEM); + info.flags = 0; + info.low_limit = TASK_UNMAPPED_BASE; ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; ++#endif ++ + info.high_limit = STACK_TOP32; + addr = vm_unmapped_area(&info); + } +@@ -99,6 +111,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + unsigned long task_size = TASK_SIZE; ++ unsigned long offset = gr_rand_threadstack_offset(mm, file, flags); - /* try just below the current vma->vm_start */ -- addr = (vma->vm_start-len) & HPAGE_MASK; -- } while (likely(len < vma->vm_start)); -+ addr = skip_heap_stack_gap(vma, len); -+ } while (!IS_ERR_VALUE(addr)); + if (test_thread_flag(TIF_32BIT)) + task_size = STACK_TOP32; +@@ -114,11 +127,14 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, + return addr; + } - bottomup: - /* -@@ -181,8 +182,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ if (addr) { addr = ALIGN(addr, HPAGE_SIZE); vma = find_vma(mm, addr); - if (task_size - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (task_size - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (task_size - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c -index c5f9021..7591bae 100644 ---- a/arch/sparc/mm/init_32.c -+++ b/arch/sparc/mm/init_32.c -@@ -315,6 +315,9 @@ extern void device_scan(void); - pgprot_t PAGE_SHARED __read_mostly; - EXPORT_SYMBOL(PAGE_SHARED); - -+pgprot_t PAGE_SHARED_NOEXEC __read_mostly; -+EXPORT_SYMBOL(PAGE_SHARED_NOEXEC); -+ - void __init paging_init(void) - { - switch(sparc_cpu_model) { -@@ -343,17 +346,17 @@ void __init paging_init(void) - - /* Initialize the protection map with non-constant, MMU dependent values. */ - protection_map[0] = PAGE_NONE; -- protection_map[1] = PAGE_READONLY; -- protection_map[2] = PAGE_COPY; -- protection_map[3] = PAGE_COPY; -+ protection_map[1] = PAGE_READONLY_NOEXEC; -+ protection_map[2] = PAGE_COPY_NOEXEC; -+ protection_map[3] = PAGE_COPY_NOEXEC; - protection_map[4] = PAGE_READONLY; - protection_map[5] = PAGE_READONLY; - protection_map[6] = PAGE_COPY; - protection_map[7] = PAGE_COPY; - protection_map[8] = PAGE_NONE; -- protection_map[9] = PAGE_READONLY; -- protection_map[10] = PAGE_SHARED; -- protection_map[11] = PAGE_SHARED; -+ protection_map[9] = PAGE_READONLY_NOEXEC; -+ protection_map[10] = PAGE_SHARED_NOEXEC; -+ protection_map[11] = PAGE_SHARED_NOEXEC; - protection_map[12] = PAGE_READONLY; - protection_map[13] = PAGE_READONLY; - protection_map[14] = PAGE_SHARED; -diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c -index cbef74e..c38fead 100644 ---- a/arch/sparc/mm/srmmu.c -+++ b/arch/sparc/mm/srmmu.c -@@ -2200,6 +2200,13 @@ void __init ld_mmu_srmmu(void) - PAGE_SHARED = pgprot_val(SRMMU_PAGE_SHARED); - BTFIXUPSET_INT(page_copy, pgprot_val(SRMMU_PAGE_COPY)); - BTFIXUPSET_INT(page_readonly, pgprot_val(SRMMU_PAGE_RDONLY)); -+ -+#ifdef CONFIG_PAX_PAGEEXEC -+ PAGE_SHARED_NOEXEC = pgprot_val(SRMMU_PAGE_SHARED_NOEXEC); -+ BTFIXUPSET_INT(page_copy_noexec, pgprot_val(SRMMU_PAGE_COPY_NOEXEC)); -+ BTFIXUPSET_INT(page_readonly_noexec, pgprot_val(SRMMU_PAGE_RDONLY_NOEXEC)); -+#endif -+ - BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL)); - page_kernel = pgprot_val(SRMMU_PAGE_KERNEL); - diff --git a/arch/tile/include/asm/atomic_64.h b/arch/tile/include/asm/atomic_64.h index f4500c6..889656c 100644 --- a/arch/tile/include/asm/atomic_64.h @@ -7542,7 +10057,7 @@ index f4500c6..889656c 100644 #define smp_mb__before_atomic_dec() smp_mb() #define smp_mb__after_atomic_dec() smp_mb() diff --git a/arch/tile/include/asm/cache.h b/arch/tile/include/asm/cache.h -index 392e533..536b092 100644 +index a9a5299..0fce79e 100644 --- a/arch/tile/include/asm/cache.h +++ b/arch/tile/include/asm/cache.h @@ -15,11 +15,12 @@ @@ -7560,10 +10075,10 @@ index 392e533..536b092 100644 /* bytes per L2 cache line */ #define L2_CACHE_SHIFT CHIP_L2_LOG_LINE_SIZE() diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm/uaccess.h -index ef34d2c..d6ce60c 100644 +index 9ab078a..d6635c2 100644 --- a/arch/tile/include/asm/uaccess.h +++ b/arch/tile/include/asm/uaccess.h -@@ -361,9 +361,9 @@ static inline unsigned long __must_check copy_from_user(void *to, +@@ -403,9 +403,9 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -7575,8 +10090,28 @@ index ef34d2c..d6ce60c 100644 n = _copy_from_user(to, from, n); else copy_from_user_overflow(); +diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c +index 650ccff..45fe2d6 100644 +--- a/arch/tile/mm/hugetlbpage.c ++++ b/arch/tile/mm/hugetlbpage.c +@@ -239,6 +239,7 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file, + info.high_limit = TASK_SIZE; + info.align_mask = PAGE_MASK & ~huge_page_mask(h); + info.align_offset = 0; ++ info.threadstack_offset = 0; + return vm_unmapped_area(&info); + } + +@@ -256,6 +257,7 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, + info.high_limit = current->mm->mmap_base; + info.align_mask = PAGE_MASK & ~huge_page_mask(h); + info.align_offset = 0; ++ info.threadstack_offset = 0; + addr = vm_unmapped_area(&info); + + /* diff --git a/arch/um/Makefile b/arch/um/Makefile -index 55c0661..86ad413 100644 +index 133f7de..1d6f2f1 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -62,6 +62,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ @@ -7584,12 +10119,24 @@ index 55c0661..86ad413 100644 $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include +ifdef CONSTIFY_PLUGIN -+USER_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify ++USER_CFLAGS += -fplugin-arg-constify_plugin-no-constify +endif + #This will adjust *FLAGS accordingly to the platform. include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) +diff --git a/arch/um/defconfig b/arch/um/defconfig +index 08107a7..ab22afe 100644 +--- a/arch/um/defconfig ++++ b/arch/um/defconfig +@@ -51,7 +51,6 @@ CONFIG_X86_CMPXCHG=y + CONFIG_X86_L1_CACHE_SHIFT=5 + CONFIG_X86_XADD=y + CONFIG_X86_PPRO_FENCE=y +-CONFIG_X86_WP_WORKS_OK=y + CONFIG_X86_INVLPG=y + CONFIG_X86_BSWAP=y + CONFIG_X86_POPAD_OK=y diff --git a/arch/um/include/asm/cache.h b/arch/um/include/asm/cache.h index 19e1bdd..3665b77 100644 --- a/arch/um/include/asm/cache.h @@ -7611,19 +10158,19 @@ index 19e1bdd..3665b77 100644 #endif diff --git a/arch/um/include/asm/kmap_types.h b/arch/um/include/asm/kmap_types.h -index 6c03acd..a5e0215 100644 +index 2e0a6b1..a64d0f5 100644 --- a/arch/um/include/asm/kmap_types.h +++ b/arch/um/include/asm/kmap_types.h -@@ -23,6 +23,7 @@ enum km_type { - KM_IRQ1, - KM_SOFTIRQ0, - KM_SOFTIRQ1, -+ KM_CLEARPAGE, - KM_TYPE_NR - }; +@@ -8,6 +8,6 @@ + + /* No more #include "asm/arch/kmap_types.h" ! */ +-#define KM_TYPE_NR 14 ++#define KM_TYPE_NR 15 + + #endif diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h -index 7cfc3ce..cbd1a58 100644 +index 5ff53d9..5850cdf 100644 --- a/arch/um/include/asm/page.h +++ b/arch/um/include/asm/page.h @@ -14,6 +14,9 @@ @@ -7649,10 +10196,10 @@ index 0032f92..cd151e0 100644 #ifdef CONFIG_64BIT #define set_pud(pudptr, pudval) set_64bit((u64 *) (pudptr), pud_val(pudval)) diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c -index 2b73ded..804f540 100644 +index b462b13..e7a19aa 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c -@@ -404,22 +404,6 @@ int singlestepping(void * t) +@@ -386,22 +386,6 @@ int singlestepping(void * t) return 2; } @@ -7693,10 +10240,10 @@ index ad8f795..2c7eec6 100644 /* * Memory returned by kmalloc() may be used for DMA, so we must make diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index c9866b0..fe53aef 100644 +index 6ef2a37..74ad6ad 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -229,7 +229,7 @@ config X86_HT +@@ -243,7 +243,7 @@ config X86_HT config X86_32_LAZY_GS def_bool y @@ -7705,7 +10252,15 @@ index c9866b0..fe53aef 100644 config ARCH_HWEIGHT_CFLAGS string -@@ -1042,7 +1042,7 @@ choice +@@ -1076,6 +1076,7 @@ config MICROCODE_EARLY + + config X86_MSR + tristate "/dev/cpu/*/msr - Model-specific register support" ++ depends on !GRKERNSEC_KMEM + ---help--- + This device gives privileged processes access to the x86 + Model-Specific Registers (MSRs). It is a character device with +@@ -1099,7 +1100,7 @@ choice config NOHIGHMEM bool "off" @@ -7714,7 +10269,7 @@ index c9866b0..fe53aef 100644 ---help--- Linux can use up to 64 Gigabytes of physical memory on x86 systems. However, the address space of 32-bit x86 processors is only 4 -@@ -1079,7 +1079,7 @@ config NOHIGHMEM +@@ -1136,7 +1137,7 @@ config NOHIGHMEM config HIGHMEM4G bool "4GB" @@ -7723,7 +10278,7 @@ index c9866b0..fe53aef 100644 ---help--- Select this if you have a 32-bit processor and between 1 and 4 gigabytes of physical RAM. -@@ -1133,7 +1133,7 @@ config PAGE_OFFSET +@@ -1189,7 +1190,7 @@ config PAGE_OFFSET hex default 0xB0000000 if VMSPLIT_3G_OPT default 0x80000000 if VMSPLIT_2G @@ -7732,56 +10287,49 @@ index c9866b0..fe53aef 100644 default 0x40000000 if VMSPLIT_1G default 0xC0000000 depends on X86_32 -@@ -1523,6 +1523,7 @@ config SECCOMP +@@ -1587,6 +1588,7 @@ config SECCOMP config CC_STACKPROTECTOR - bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" + bool "Enable -fstack-protector buffer overflow detection" + depends on X86_64 || !PAX_MEMORY_UDEREF ---help--- This option turns on the -fstack-protector GCC feature. This feature puts, at the beginning of functions, a canary value on -@@ -1580,6 +1581,7 @@ config KEXEC_JUMP - config PHYSICAL_START - hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP) - default "0x1000000" -+ range 0x400000 0x40000000 - ---help--- - This gives the physical address where the kernel is loaded. - -@@ -1643,6 +1645,7 @@ config X86_NEED_RELOCS +@@ -1706,6 +1708,8 @@ config X86_NEED_RELOCS config PHYSICAL_ALIGN hex "Alignment value to which kernel should be aligned" if X86_32 default "0x1000000" -+ range 0x400000 0x1000000 if PAX_KERNEXEC ++ range 0x200000 0x1000000 if PAX_KERNEXEC && X86_PAE ++ range 0x400000 0x1000000 if PAX_KERNEXEC && !X86_PAE range 0x2000 0x1000000 ---help--- This value puts the alignment restrictions on physical address -@@ -1674,9 +1677,10 @@ config HOTPLUG_CPU - Say N if you want to disable CPU hotplug. +@@ -1781,9 +1785,10 @@ config DEBUG_HOTPLUG_CPU0 + If unsure, say N. config COMPAT_VDSO - def_bool y + def_bool n prompt "Compat VDSO support" depends on X86_32 || IA32_EMULATION -+ depends on !PAX_NOEXEC && !PAX_MEMORY_UDEREF ++ depends on !PAX_PAGEEXEC && !PAX_SEGMEXEC && !PAX_KERNEXEC && !PAX_MEMORY_UDEREF ---help--- Map the 32-bit VDSO to the predictable old-style address too. diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu -index 706e12e..62e4feb 100644 +index c026cca..14657ae 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu -@@ -334,7 +334,7 @@ config X86_PPRO_FENCE +@@ -319,7 +319,7 @@ config X86_PPRO_FENCE config X86_F00F_BUG def_bool y -- depends on M586MMX || M586TSC || M586 || M486 || M386 -+ depends on (M586MMX || M586TSC || M586 || M486 || M386) && !PAX_KERNEXEC +- depends on M586MMX || M586TSC || M586 || M486 ++ depends on (M586MMX || M586TSC || M586 || M486) && !PAX_KERNEXEC config X86_INVD_BUG def_bool y -@@ -358,7 +358,7 @@ config X86_POPAD_OK +@@ -327,7 +327,7 @@ config X86_INVD_BUG config X86_ALIGNMENT_16 def_bool y @@ -7790,7 +10338,7 @@ index 706e12e..62e4feb 100644 config X86_INTEL_USERCOPY def_bool y -@@ -404,7 +404,7 @@ config X86_CMPXCHG64 +@@ -373,7 +373,7 @@ config X86_CMPXCHG64 # generates cmov. config X86_CMOV def_bool y @@ -7800,7 +10348,7 @@ index 706e12e..62e4feb 100644 config X86_MINIMUM_CPU_FAMILY int diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug -index e46c214..ab62fd1 100644 +index b322f12..652d0d9 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -84,7 +84,7 @@ config X86_PTDUMP @@ -7821,7 +10369,7 @@ index e46c214..ab62fd1 100644 ---help--- This option helps catch unintended modifications to loadable kernel module's text and read-only data. It also prevents execution -@@ -275,7 +275,7 @@ config OPTIMIZE_INLINING +@@ -294,7 +294,7 @@ config OPTIMIZE_INLINING config DEBUG_STRICT_USER_COPY_CHECKS bool "Strict copy size checks" @@ -7831,10 +10379,10 @@ index e46c214..ab62fd1 100644 Enabling this option turns a certain set of sanity checks for user copy operations into compile time failures. diff --git a/arch/x86/Makefile b/arch/x86/Makefile -index b1c611e..2c1a823 100644 +index 5c47726..8c4fa67 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile -@@ -46,6 +46,7 @@ else +@@ -54,6 +54,7 @@ else UTS_MACHINE := x86_64 CHECKFLAGS += -D__x86_64__ -m64 @@ -7842,7 +10390,7 @@ index b1c611e..2c1a823 100644 KBUILD_AFLAGS += -m64 KBUILD_CFLAGS += -m64 -@@ -222,3 +223,12 @@ define archhelp +@@ -234,3 +235,12 @@ define archhelp echo ' FDARGS="..." arguments for the booted kernel' echo ' FDINITRD=file initrd for the booted kernel' endef @@ -7856,15 +10404,15 @@ index b1c611e..2c1a823 100644 +archprepare: + $(if $(LDFLAGS_BUILD_ID),,$(error $(OLD_LD))) diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile -index 5a747dd..ff7b12c 100644 +index 379814b..add62ce 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile -@@ -64,6 +64,9 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ +@@ -65,6 +65,9 @@ KBUILD_CFLAGS := $(USERINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ $(call cc-option, -fno-stack-protector) \ $(call cc-option, -mpreferred-stack-boundary=2) KBUILD_CFLAGS += $(call cc-option, -m32) +ifdef CONSTIFY_PLUGIN -+KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify ++KBUILD_CFLAGS += -fplugin-arg-constify_plugin-no-constify +endif KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n @@ -7892,7 +10440,7 @@ index 878e4b9..20537ab 100644 #endif /* BOOT_BITOPS_H */ diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h -index 18997e5..83d9c67 100644 +index 5b75319..331a4ca 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h @@ -85,7 +85,7 @@ static inline void io_delay(void) @@ -7914,7 +10462,7 @@ index 18997e5..83d9c67 100644 return diff; } diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile -index e398bb5..3a382ca 100644 +index 5ef205c..342191d 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -14,6 +14,9 @@ cflags-$(CONFIG_X86_64) := -mcmodel=small @@ -7922,16 +10470,16 @@ index e398bb5..3a382ca 100644 KBUILD_CFLAGS += $(call cc-option,-ffreestanding) KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) +ifdef CONSTIFY_PLUGIN -+KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify ++KBUILD_CFLAGS += -fplugin-arg-constify_plugin-no-constify +endif KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c -index 0cdfc0d..6e79437 100644 +index 35ee62f..b6609b6 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c -@@ -122,7 +122,6 @@ again: +@@ -150,7 +150,6 @@ again: *addr = max_addr; } @@ -7939,7 +10487,7 @@ index 0cdfc0d..6e79437 100644 efi_call_phys1(sys_table->boottime->free_pool, map); fail: -@@ -186,7 +185,6 @@ static efi_status_t low_alloc(unsigned long size, unsigned long align, +@@ -214,7 +213,6 @@ static efi_status_t low_alloc(unsigned long size, unsigned long align, if (i == map_size / desc_size) status = EFI_NOT_FOUND; @@ -7948,10 +10496,10 @@ index 0cdfc0d..6e79437 100644 fail: return status; diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S -index c85e3ac..6f5aa80 100644 +index 1e3184f..0d11e2e 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S -@@ -106,7 +106,7 @@ preferred_addr: +@@ -118,7 +118,7 @@ preferred_addr: notl %eax andl %eax, %ebx #else @@ -7960,7 +10508,7 @@ index c85e3ac..6f5aa80 100644 #endif /* Target address to relocate to for decompression */ -@@ -192,7 +192,7 @@ relocated: +@@ -204,7 +204,7 @@ relocated: * and where it was actually loaded. */ movl %ebp, %ebx @@ -7969,7 +10517,7 @@ index c85e3ac..6f5aa80 100644 jz 2f /* Nothing to be done if loaded at compiled addr. */ /* * Process relocations. -@@ -200,8 +200,7 @@ relocated: +@@ -212,8 +212,7 @@ relocated: 1: subl $4, %edi movl (%edi), %ecx @@ -7980,10 +10528,10 @@ index c85e3ac..6f5aa80 100644 jmp 1b 2: diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S -index 87e03a1..0d94c76 100644 +index c1d383d..57ab51c 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S -@@ -91,7 +91,7 @@ ENTRY(startup_32) +@@ -97,7 +97,7 @@ ENTRY(startup_32) notl %eax andl %eax, %ebx #else @@ -7992,7 +10540,7 @@ index 87e03a1..0d94c76 100644 #endif /* Target address to relocate to for decompression */ -@@ -263,7 +263,7 @@ preferred_addr: +@@ -272,7 +272,7 @@ preferred_addr: notq %rax andq %rax, %rbp #else @@ -8001,11 +10549,22 @@ index 87e03a1..0d94c76 100644 #endif /* Target address to relocate to for decompression */ +@@ -363,8 +363,8 @@ gdt: + .long gdt + .word 0 + .quad 0x0000000000000000 /* NULL descriptor */ +- .quad 0x00af9a000000ffff /* __KERNEL_CS */ +- .quad 0x00cf92000000ffff /* __KERNEL_DS */ ++ .quad 0x00af9b000000ffff /* __KERNEL_CS */ ++ .quad 0x00cf93000000ffff /* __KERNEL_DS */ + .quad 0x0080890000000000 /* TS descriptor */ + .quad 0x0000000000000000 /* TS continued */ + gdt_end: diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c -index 7116dcb..d9ae1d7 100644 +index 7cb56c6..d382d84 100644 --- a/arch/x86/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc.c -@@ -310,7 +310,7 @@ static void parse_elf(void *output) +@@ -303,7 +303,7 @@ static void parse_elf(void *output) case PT_LOAD: #ifdef CONFIG_RELOCATABLE dest = output; @@ -8014,7 +10573,7 @@ index 7116dcb..d9ae1d7 100644 #else dest = (void *)(phdr->p_paddr); #endif -@@ -365,7 +365,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, +@@ -354,7 +354,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, error("Destination address too large"); #endif #ifndef CONFIG_RELOCATABLE @@ -8123,10 +10682,10 @@ index 4d3ff03..e4972ff 100644 err = check_flags(); } diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S -index f1bbeeb..e58f183 100644 +index 9ec06a1..2c25e79 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S -@@ -372,10 +372,14 @@ setup_data: .quad 0 # 64-bit physical pointer to +@@ -409,10 +409,14 @@ setup_data: .quad 0 # 64-bit physical pointer to # single linked list of # struct setup_data @@ -8181,7 +10740,7 @@ index 43eda28..5ab5fdb 100644 unsigned int v; diff --git a/arch/x86/crypto/aes-x86_64-asm_64.S b/arch/x86/crypto/aes-x86_64-asm_64.S -index 5b577d5..3c1fed4 100644 +index 9105655..5e37f27 100644 --- a/arch/x86/crypto/aes-x86_64-asm_64.S +++ b/arch/x86/crypto/aes-x86_64-asm_64.S @@ -8,6 +8,8 @@ @@ -8193,17 +10752,17 @@ index 5b577d5..3c1fed4 100644 .extern crypto_ft_tab .extern crypto_it_tab .extern crypto_fl_tab -@@ -71,6 +73,8 @@ FUNC: movq r1,r2; \ +@@ -70,6 +72,8 @@ je B192; \ leaq 32(r9),r9; +#define ret pax_force_retaddr 0, 1; ret + - #define epilogue(r1,r2,r3,r4,r5,r6,r7,r8,r9) \ + #define epilogue(FUNC,r1,r2,r3,r4,r5,r6,r7,r8,r9) \ movq r1,r2; \ movq r3,r4; \ diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S -index 3470624..201259d 100644 +index 04b7977..402f223 100644 --- a/arch/x86/crypto/aesni-intel_asm.S +++ b/arch/x86/crypto/aesni-intel_asm.S @@ -31,6 +31,7 @@ @@ -8214,309 +10773,408 @@ index 3470624..201259d 100644 #ifdef __x86_64__ .data -@@ -1436,7 +1437,9 @@ _return_T_done_decrypt: +@@ -1435,6 +1436,7 @@ _return_T_done_decrypt: pop %r14 pop %r13 pop %r12 + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_gcm_dec) - + ENDPROC(aesni_gcm_dec) - /***************************************************************************** -@@ -1699,7 +1702,9 @@ _return_T_done_encrypt: +@@ -1699,6 +1701,7 @@ _return_T_done_encrypt: pop %r14 pop %r13 pop %r12 + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_gcm_enc) + ENDPROC(aesni_gcm_enc) - #endif - -@@ -1714,6 +1719,7 @@ _key_expansion_256a: +@@ -1716,6 +1719,7 @@ _key_expansion_256a: pxor %xmm1, %xmm0 movaps %xmm0, (TKEYP) add $0x10, TKEYP + pax_force_retaddr_bts ret - - .align 4 -@@ -1738,6 +1744,7 @@ _key_expansion_192a: + ENDPROC(_key_expansion_128) + ENDPROC(_key_expansion_256a) +@@ -1742,6 +1746,7 @@ _key_expansion_192a: shufps $0b01001110, %xmm2, %xmm1 movaps %xmm1, 0x10(TKEYP) add $0x20, TKEYP + pax_force_retaddr_bts ret + ENDPROC(_key_expansion_192a) - .align 4 -@@ -1757,6 +1764,7 @@ _key_expansion_192b: +@@ -1762,6 +1767,7 @@ _key_expansion_192b: movaps %xmm0, (TKEYP) add $0x10, TKEYP + pax_force_retaddr_bts ret + ENDPROC(_key_expansion_192b) - .align 4 -@@ -1769,6 +1777,7 @@ _key_expansion_256b: +@@ -1775,6 +1781,7 @@ _key_expansion_256b: pxor %xmm1, %xmm2 movaps %xmm2, (TKEYP) add $0x10, TKEYP + pax_force_retaddr_bts ret + ENDPROC(_key_expansion_256b) - /* -@@ -1881,7 +1890,9 @@ ENTRY(aesni_set_key) +@@ -1888,6 +1895,7 @@ ENTRY(aesni_set_key) #ifndef __x86_64__ popl KEYP #endif + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_set_key) + ENDPROC(aesni_set_key) - /* - * void aesni_enc(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src) -@@ -1902,7 +1913,9 @@ ENTRY(aesni_enc) +@@ -1910,6 +1918,7 @@ ENTRY(aesni_enc) popl KLEN popl KEYP #endif + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_enc) + ENDPROC(aesni_enc) - /* - * _aesni_enc1: internal ABI -@@ -1959,6 +1972,7 @@ _aesni_enc1: +@@ -1968,6 +1977,7 @@ _aesni_enc1: AESENC KEY STATE movaps 0x70(TKEYP), KEY AESENCLAST KEY STATE + pax_force_retaddr_bts ret + ENDPROC(_aesni_enc1) - /* -@@ -2067,6 +2081,7 @@ _aesni_enc4: +@@ -2077,6 +2087,7 @@ _aesni_enc4: AESENCLAST KEY STATE2 AESENCLAST KEY STATE3 AESENCLAST KEY STATE4 + pax_force_retaddr_bts ret + ENDPROC(_aesni_enc4) - /* -@@ -2089,7 +2104,9 @@ ENTRY(aesni_dec) +@@ -2100,6 +2111,7 @@ ENTRY(aesni_dec) popl KLEN popl KEYP #endif + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_dec) + ENDPROC(aesni_dec) - /* - * _aesni_dec1: internal ABI -@@ -2146,6 +2163,7 @@ _aesni_dec1: +@@ -2158,6 +2170,7 @@ _aesni_dec1: AESDEC KEY STATE movaps 0x70(TKEYP), KEY AESDECLAST KEY STATE + pax_force_retaddr_bts ret + ENDPROC(_aesni_dec1) - /* -@@ -2254,6 +2272,7 @@ _aesni_dec4: +@@ -2267,6 +2280,7 @@ _aesni_dec4: AESDECLAST KEY STATE2 AESDECLAST KEY STATE3 AESDECLAST KEY STATE4 + pax_force_retaddr_bts ret + ENDPROC(_aesni_dec4) - /* -@@ -2311,7 +2330,9 @@ ENTRY(aesni_ecb_enc) +@@ -2325,6 +2339,7 @@ ENTRY(aesni_ecb_enc) popl KEYP popl LEN #endif + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_ecb_enc) + ENDPROC(aesni_ecb_enc) - /* - * void aesni_ecb_dec(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src, -@@ -2369,7 +2390,9 @@ ENTRY(aesni_ecb_dec) +@@ -2384,6 +2399,7 @@ ENTRY(aesni_ecb_dec) popl KEYP popl LEN #endif + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_ecb_dec) + ENDPROC(aesni_ecb_dec) - /* - * void aesni_cbc_enc(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src, -@@ -2410,7 +2433,9 @@ ENTRY(aesni_cbc_enc) +@@ -2426,6 +2442,7 @@ ENTRY(aesni_cbc_enc) popl LEN popl IVP #endif + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_cbc_enc) + ENDPROC(aesni_cbc_enc) - /* - * void aesni_cbc_dec(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src, -@@ -2500,7 +2525,9 @@ ENTRY(aesni_cbc_dec) +@@ -2517,6 +2534,7 @@ ENTRY(aesni_cbc_dec) popl LEN popl IVP #endif + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_cbc_dec) + ENDPROC(aesni_cbc_dec) - #ifdef __x86_64__ - .align 16 -@@ -2526,6 +2553,7 @@ _aesni_inc_init: +@@ -2544,6 +2562,7 @@ _aesni_inc_init: mov $1, TCTR_LOW MOVQ_R64_XMM TCTR_LOW INC MOVQ_R64_XMM CTR TCTR_LOW + pax_force_retaddr_bts ret + ENDPROC(_aesni_inc_init) - /* -@@ -2554,6 +2582,7 @@ _aesni_inc: +@@ -2573,6 +2592,7 @@ _aesni_inc: .Linc_low: movaps CTR, IV PSHUFB_XMM BSWAP_MASK IV + pax_force_retaddr_bts ret + ENDPROC(_aesni_inc) - /* -@@ -2614,5 +2643,7 @@ ENTRY(aesni_ctr_enc) +@@ -2634,6 +2654,7 @@ ENTRY(aesni_ctr_enc) .Lctr_enc_ret: movups IV, (IVP) .Lctr_enc_just_ret: + pax_force_retaddr 0, 1 ret -+ENDPROC(aesni_ctr_enc) + ENDPROC(aesni_ctr_enc) #endif diff --git a/arch/x86/crypto/blowfish-x86_64-asm_64.S b/arch/x86/crypto/blowfish-x86_64-asm_64.S -index 391d245..67f35c2 100644 +index 246c670..4d1ed00 100644 --- a/arch/x86/crypto/blowfish-x86_64-asm_64.S +++ b/arch/x86/crypto/blowfish-x86_64-asm_64.S -@@ -20,6 +20,8 @@ - * +@@ -21,6 +21,7 @@ */ + #include <linux/linkage.h> +#include <asm/alternative-asm.h> -+ + .file "blowfish-x86_64-asm.S" .text - -@@ -151,9 +153,11 @@ __blowfish_enc_blk: - jnz __enc_xor; +@@ -149,9 +150,11 @@ ENTRY(__blowfish_enc_blk) + jnz .L__enc_xor; write_block(); + pax_force_retaddr 0, 1 ret; - __enc_xor: + .L__enc_xor: xor_block(); + pax_force_retaddr 0, 1 ret; + ENDPROC(__blowfish_enc_blk) - .align 8 -@@ -188,6 +192,7 @@ blowfish_dec_blk: +@@ -183,6 +186,7 @@ ENTRY(blowfish_dec_blk) movq %r11, %rbp; + pax_force_retaddr 0, 1 ret; + ENDPROC(blowfish_dec_blk) - /********************************************************************** -@@ -342,6 +347,7 @@ __blowfish_enc_blk_4way: +@@ -334,6 +338,7 @@ ENTRY(__blowfish_enc_blk_4way) popq %rbx; popq %rbp; + pax_force_retaddr 0, 1 ret; - __enc_xor4: -@@ -349,6 +355,7 @@ __enc_xor4: + .L__enc_xor4: +@@ -341,6 +346,7 @@ ENTRY(__blowfish_enc_blk_4way) popq %rbx; popq %rbp; + pax_force_retaddr 0, 1 ret; + ENDPROC(__blowfish_enc_blk_4way) - .align 8 -@@ -386,5 +393,6 @@ blowfish_dec_blk_4way: +@@ -375,5 +381,6 @@ ENTRY(blowfish_dec_blk_4way) popq %rbx; popq %rbp; + pax_force_retaddr 0, 1 ret; - + ENDPROC(blowfish_dec_blk_4way) diff --git a/arch/x86/crypto/camellia-x86_64-asm_64.S b/arch/x86/crypto/camellia-x86_64-asm_64.S -index 0b33743..7a56206 100644 +index 310319c..ce174a4 100644 --- a/arch/x86/crypto/camellia-x86_64-asm_64.S +++ b/arch/x86/crypto/camellia-x86_64-asm_64.S -@@ -20,6 +20,8 @@ - * +@@ -21,6 +21,7 @@ */ + #include <linux/linkage.h> +#include <asm/alternative-asm.h> -+ + .file "camellia-x86_64-asm_64.S" .text - -@@ -229,12 +231,14 @@ __enc_done: +@@ -228,12 +229,14 @@ ENTRY(__camellia_enc_blk) enc_outunpack(mov, RT1); movq RRBP, %rbp; + pax_force_retaddr 0, 1 ret; - __enc_xor: + .L__enc_xor: enc_outunpack(xor, RT1); movq RRBP, %rbp; + pax_force_retaddr 0, 1 ret; + ENDPROC(__camellia_enc_blk) - .global camellia_dec_blk; -@@ -275,6 +279,7 @@ __dec_rounds16: +@@ -272,6 +275,7 @@ ENTRY(camellia_dec_blk) dec_outunpack(); movq RRBP, %rbp; + pax_force_retaddr 0, 1 ret; + ENDPROC(camellia_dec_blk) - /********************************************************************** -@@ -468,6 +473,7 @@ __enc2_done: +@@ -463,6 +467,7 @@ ENTRY(__camellia_enc_blk_2way) movq RRBP, %rbp; popq %rbx; + pax_force_retaddr 0, 1 ret; - __enc2_xor: -@@ -475,6 +481,7 @@ __enc2_xor: + .L__enc2_xor: +@@ -470,6 +475,7 @@ ENTRY(__camellia_enc_blk_2way) movq RRBP, %rbp; popq %rbx; + pax_force_retaddr 0, 1 ret; + ENDPROC(__camellia_enc_blk_2way) - .global camellia_dec_blk_2way; -@@ -517,4 +524,5 @@ __dec2_rounds16: +@@ -510,5 +516,6 @@ ENTRY(camellia_dec_blk_2way) movq RRBP, %rbp; movq RXOR, %rbx; + pax_force_retaddr 0, 1 ret; + ENDPROC(camellia_dec_blk_2way) +diff --git a/arch/x86/crypto/cast5-avx-x86_64-asm_64.S b/arch/x86/crypto/cast5-avx-x86_64-asm_64.S +index c35fd5d..c1ee236 100644 +--- a/arch/x86/crypto/cast5-avx-x86_64-asm_64.S ++++ b/arch/x86/crypto/cast5-avx-x86_64-asm_64.S +@@ -24,6 +24,7 @@ + */ + + #include <linux/linkage.h> ++#include <asm/alternative-asm.h> + + .file "cast5-avx-x86_64-asm_64.S" + +@@ -281,6 +282,7 @@ __cast5_enc_blk16: + outunpack_blocks(RR3, RL3, RTMP, RX, RKM); + outunpack_blocks(RR4, RL4, RTMP, RX, RKM); + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(__cast5_enc_blk16) + +@@ -352,6 +354,7 @@ __cast5_dec_blk16: + outunpack_blocks(RR3, RL3, RTMP, RX, RKM); + outunpack_blocks(RR4, RL4, RTMP, RX, RKM); + ++ pax_force_retaddr 0, 1 + ret; + + .L__skip_dec: +@@ -388,6 +391,7 @@ ENTRY(cast5_ecb_enc_16way) + vmovdqu RR4, (6*4*4)(%r11); + vmovdqu RL4, (7*4*4)(%r11); + ++ pax_force_retaddr + ret; + ENDPROC(cast5_ecb_enc_16way) + +@@ -420,6 +424,7 @@ ENTRY(cast5_ecb_dec_16way) + vmovdqu RR4, (6*4*4)(%r11); + vmovdqu RL4, (7*4*4)(%r11); + ++ pax_force_retaddr + ret; + ENDPROC(cast5_ecb_dec_16way) + +@@ -469,6 +474,7 @@ ENTRY(cast5_cbc_dec_16way) + + popq %r12; + ++ pax_force_retaddr + ret; + ENDPROC(cast5_cbc_dec_16way) + +@@ -542,5 +548,6 @@ ENTRY(cast5_ctr_16way) + + popq %r12; + ++ pax_force_retaddr + ret; + ENDPROC(cast5_ctr_16way) +diff --git a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S +index f93b610..c09bf40 100644 +--- a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S ++++ b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S +@@ -24,6 +24,7 @@ + */ + + #include <linux/linkage.h> ++#include <asm/alternative-asm.h> + #include "glue_helper-asm-avx.S" + + .file "cast6-avx-x86_64-asm_64.S" +@@ -293,6 +294,7 @@ __cast6_enc_blk8: + outunpack_blocks(RA1, RB1, RC1, RD1, RTMP, RX, RKRF, RKM); + outunpack_blocks(RA2, RB2, RC2, RD2, RTMP, RX, RKRF, RKM); + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(__cast6_enc_blk8) + +@@ -338,6 +340,7 @@ __cast6_dec_blk8: + outunpack_blocks(RA1, RB1, RC1, RD1, RTMP, RX, RKRF, RKM); + outunpack_blocks(RA2, RB2, RC2, RD2, RTMP, RX, RKRF, RKM); + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(__cast6_dec_blk8) + +@@ -356,6 +359,7 @@ ENTRY(cast6_ecb_enc_8way) + + store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); + ++ pax_force_retaddr + ret; + ENDPROC(cast6_ecb_enc_8way) + +@@ -374,6 +378,7 @@ ENTRY(cast6_ecb_dec_8way) + + store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); + ++ pax_force_retaddr + ret; + ENDPROC(cast6_ecb_dec_8way) + +@@ -397,6 +402,7 @@ ENTRY(cast6_cbc_dec_8way) + + popq %r12; + ++ pax_force_retaddr + ret; + ENDPROC(cast6_cbc_dec_8way) + +@@ -422,5 +428,6 @@ ENTRY(cast6_ctr_8way) + + popq %r12; + ++ pax_force_retaddr + ret; + ENDPROC(cast6_ctr_8way) diff --git a/arch/x86/crypto/salsa20-x86_64-asm_64.S b/arch/x86/crypto/salsa20-x86_64-asm_64.S -index 6214a9b..1f4fc9a 100644 +index 9279e0b..9270820 100644 --- a/arch/x86/crypto/salsa20-x86_64-asm_64.S +++ b/arch/x86/crypto/salsa20-x86_64-asm_64.S -@@ -1,3 +1,5 @@ +@@ -1,4 +1,5 @@ + #include <linux/linkage.h> +#include <asm/alternative-asm.h> -+ - # enter ECRYPT_encrypt_bytes - .text - .p2align 5 -@@ -790,6 +792,7 @@ ECRYPT_encrypt_bytes: + + # enter salsa20_encrypt_bytes + ENTRY(salsa20_encrypt_bytes) +@@ -789,6 +790,7 @@ ENTRY(salsa20_encrypt_bytes) add %r11,%rsp mov %rdi,%rax mov %rsi,%rdx @@ -8524,139 +11182,257 @@ index 6214a9b..1f4fc9a 100644 ret # bytesatleast65: ._bytesatleast65: -@@ -891,6 +894,7 @@ ECRYPT_keysetup: +@@ -889,6 +891,7 @@ ENTRY(salsa20_keysetup) add %r11,%rsp mov %rdi,%rax mov %rsi,%rdx + pax_force_retaddr ret - # enter ECRYPT_ivsetup - .text -@@ -917,4 +921,5 @@ ECRYPT_ivsetup: + ENDPROC(salsa20_keysetup) + +@@ -914,5 +917,6 @@ ENTRY(salsa20_ivsetup) add %r11,%rsp mov %rdi,%rax mov %rsi,%rdx + pax_force_retaddr ret + ENDPROC(salsa20_ivsetup) +diff --git a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S +index 43c9386..a0e2d60 100644 +--- a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S ++++ b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S +@@ -25,6 +25,7 @@ + */ + + #include <linux/linkage.h> ++#include <asm/alternative-asm.h> + #include "glue_helper-asm-avx.S" + + .file "serpent-avx-x86_64-asm_64.S" +@@ -617,6 +618,7 @@ __serpent_enc_blk8_avx: + write_blocks(RA1, RB1, RC1, RD1, RK0, RK1, RK2); + write_blocks(RA2, RB2, RC2, RD2, RK0, RK1, RK2); + ++ pax_force_retaddr + ret; + ENDPROC(__serpent_enc_blk8_avx) + +@@ -671,6 +673,7 @@ __serpent_dec_blk8_avx: + write_blocks(RC1, RD1, RB1, RE1, RK0, RK1, RK2); + write_blocks(RC2, RD2, RB2, RE2, RK0, RK1, RK2); + ++ pax_force_retaddr + ret; + ENDPROC(__serpent_dec_blk8_avx) + +@@ -687,6 +690,7 @@ ENTRY(serpent_ecb_enc_8way_avx) + + store_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); + ++ pax_force_retaddr + ret; + ENDPROC(serpent_ecb_enc_8way_avx) + +@@ -703,6 +707,7 @@ ENTRY(serpent_ecb_dec_8way_avx) + + store_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2); + ++ pax_force_retaddr + ret; + ENDPROC(serpent_ecb_dec_8way_avx) + +@@ -719,6 +724,7 @@ ENTRY(serpent_cbc_dec_8way_avx) + + store_cbc_8way(%rdx, %rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2); + ++ pax_force_retaddr + ret; + ENDPROC(serpent_cbc_dec_8way_avx) + +@@ -737,5 +743,6 @@ ENTRY(serpent_ctr_8way_avx) + + store_ctr_8way(%rdx, %rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); + ++ pax_force_retaddr + ret; + ENDPROC(serpent_ctr_8way_avx) diff --git a/arch/x86/crypto/serpent-sse2-x86_64-asm_64.S b/arch/x86/crypto/serpent-sse2-x86_64-asm_64.S -index 3ee1ff0..cbc568b 100644 +index acc066c..1559cc4 100644 --- a/arch/x86/crypto/serpent-sse2-x86_64-asm_64.S +++ b/arch/x86/crypto/serpent-sse2-x86_64-asm_64.S -@@ -24,6 +24,8 @@ - * +@@ -25,6 +25,7 @@ */ + #include <linux/linkage.h> +#include <asm/alternative-asm.h> -+ + .file "serpent-sse2-x86_64-asm_64.S" .text - -@@ -692,12 +694,14 @@ __serpent_enc_blk_8way: +@@ -690,12 +691,14 @@ ENTRY(__serpent_enc_blk_8way) write_blocks(%rsi, RA1, RB1, RC1, RD1, RK0, RK1, RK2); write_blocks(%rax, RA2, RB2, RC2, RD2, RK0, RK1, RK2); + pax_force_retaddr ret; - __enc_xor8: + .L__enc_xor8: xor_blocks(%rsi, RA1, RB1, RC1, RD1, RK0, RK1, RK2); xor_blocks(%rax, RA2, RB2, RC2, RD2, RK0, RK1, RK2); + pax_force_retaddr ret; + ENDPROC(__serpent_enc_blk_8way) - .align 8 -@@ -755,4 +759,5 @@ serpent_dec_blk_8way: +@@ -750,5 +753,6 @@ ENTRY(serpent_dec_blk_8way) write_blocks(%rsi, RC1, RD1, RB1, RE1, RK0, RK1, RK2); write_blocks(%rax, RC2, RD2, RB2, RE2, RK0, RK1, RK2); + pax_force_retaddr ret; + ENDPROC(serpent_dec_blk_8way) diff --git a/arch/x86/crypto/sha1_ssse3_asm.S b/arch/x86/crypto/sha1_ssse3_asm.S -index b2c2f57..8470cab 100644 +index a410950..3356d42 100644 --- a/arch/x86/crypto/sha1_ssse3_asm.S +++ b/arch/x86/crypto/sha1_ssse3_asm.S -@@ -28,6 +28,8 @@ - * (at your option) any later version. +@@ -29,6 +29,7 @@ */ + #include <linux/linkage.h> +#include <asm/alternative-asm.h> -+ + #define CTX %rdi // arg1 #define BUF %rsi // arg2 - #define CNT %rdx // arg3 -@@ -104,6 +106,7 @@ +@@ -104,6 +105,7 @@ pop %r12 pop %rbp pop %rbx + pax_force_retaddr 0, 1 ret - .size \name, .-\name + ENDPROC(\name) +diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S +index 8d3e113..898b161 100644 +--- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S ++++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S +@@ -24,6 +24,7 @@ + */ + + #include <linux/linkage.h> ++#include <asm/alternative-asm.h> + #include "glue_helper-asm-avx.S" + + .file "twofish-avx-x86_64-asm_64.S" +@@ -282,6 +283,7 @@ __twofish_enc_blk8: + outunpack_blocks(RC1, RD1, RA1, RB1, RK1, RX0, RY0, RK2); + outunpack_blocks(RC2, RD2, RA2, RB2, RK1, RX0, RY0, RK2); + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(__twofish_enc_blk8) + +@@ -322,6 +324,7 @@ __twofish_dec_blk8: + outunpack_blocks(RA1, RB1, RC1, RD1, RK1, RX0, RY0, RK2); + outunpack_blocks(RA2, RB2, RC2, RD2, RK1, RX0, RY0, RK2); + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(__twofish_dec_blk8) + +@@ -340,6 +343,7 @@ ENTRY(twofish_ecb_enc_8way) + + store_8way(%r11, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2); + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(twofish_ecb_enc_8way) + +@@ -358,6 +362,7 @@ ENTRY(twofish_ecb_dec_8way) + + store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(twofish_ecb_dec_8way) + +@@ -381,6 +386,7 @@ ENTRY(twofish_cbc_dec_8way) + + popq %r12; + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(twofish_cbc_dec_8way) + +@@ -406,5 +412,6 @@ ENTRY(twofish_ctr_8way) + + popq %r12; + ++ pax_force_retaddr 0, 1 + ret; + ENDPROC(twofish_ctr_8way) diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S -index 5b012a2..36d5364 100644 +index 1c3b7ce..b365c5e 100644 --- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S +++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S -@@ -20,6 +20,8 @@ - * +@@ -21,6 +21,7 @@ */ + #include <linux/linkage.h> +#include <asm/alternative-asm.h> -+ + .file "twofish-x86_64-asm-3way.S" .text - -@@ -260,6 +262,7 @@ __twofish_enc_blk_3way: +@@ -258,6 +259,7 @@ ENTRY(__twofish_enc_blk_3way) popq %r13; popq %r14; popq %r15; + pax_force_retaddr 0, 1 ret; - __enc_xor3: -@@ -271,6 +274,7 @@ __enc_xor3: + .L__enc_xor3: +@@ -269,6 +271,7 @@ ENTRY(__twofish_enc_blk_3way) popq %r13; popq %r14; popq %r15; + pax_force_retaddr 0, 1 ret; + ENDPROC(__twofish_enc_blk_3way) - .global twofish_dec_blk_3way -@@ -312,5 +316,6 @@ twofish_dec_blk_3way: +@@ -308,5 +311,6 @@ ENTRY(twofish_dec_blk_3way) popq %r13; popq %r14; popq %r15; + pax_force_retaddr 0, 1 ret; - + ENDPROC(twofish_dec_blk_3way) diff --git a/arch/x86/crypto/twofish-x86_64-asm_64.S b/arch/x86/crypto/twofish-x86_64-asm_64.S -index 7bcf3fc..f53832f 100644 +index a039d21..29e7615 100644 --- a/arch/x86/crypto/twofish-x86_64-asm_64.S +++ b/arch/x86/crypto/twofish-x86_64-asm_64.S -@@ -21,6 +21,7 @@ - .text +@@ -22,6 +22,7 @@ + #include <linux/linkage.h> #include <asm/asm-offsets.h> +#include <asm/alternative-asm.h> #define a_offset 0 #define b_offset 4 -@@ -268,6 +269,7 @@ twofish_enc_blk: +@@ -265,6 +266,7 @@ ENTRY(twofish_enc_blk) popq R1 movq $1,%rax + pax_force_retaddr 0, 1 ret + ENDPROC(twofish_enc_blk) - twofish_dec_blk: -@@ -319,4 +321,5 @@ twofish_dec_blk: +@@ -317,5 +319,6 @@ ENTRY(twofish_dec_blk) popq R1 movq $1,%rax + pax_force_retaddr 0, 1 ret + ENDPROC(twofish_dec_blk) diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c -index 07b3a68..bd2a388 100644 +index 03abf9b..a42ba29 100644 --- a/arch/x86/ia32/ia32_aout.c +++ b/arch/x86/ia32/ia32_aout.c @@ -159,6 +159,8 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, @@ -8669,37 +11445,10 @@ index 07b3a68..bd2a388 100644 set_fs(KERNEL_DS); has_dumped = 1; diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c -index 4f5bfac..e1ef0d3 100644 +index cf1a471..3bc4cf8 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c -@@ -168,7 +168,7 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr, - } - seg = get_fs(); - set_fs(KERNEL_DS); -- ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->sp); -+ ret = do_sigaltstack(uss_ptr ? (const stack_t __force_user *)&uss : NULL, (stack_t __force_user *)&uoss, regs->sp); - set_fs(seg); - if (ret >= 0 && uoss_ptr) { - if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t))) -@@ -369,7 +369,7 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc, - */ - static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, - size_t frame_size, -- void **fpstate) -+ void __user **fpstate) - { - unsigned long sp; - -@@ -390,7 +390,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, - - if (used_math()) { - sp = sp - sig_xstate_ia32_size; -- *fpstate = (struct _fpstate_ia32 *) sp; -+ *fpstate = (struct _fpstate_ia32 __user *) sp; - if (save_i387_xstate_ia32(*fpstate) < 0) - return (void __user *) -1L; - } -@@ -398,7 +398,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, +@@ -340,7 +340,7 @@ static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, sp -= frame_size; /* Align the stack pointer according to the i386 ABI, * i.e. so that on function entry ((sp + 4) & 15) == 0. */ @@ -8708,16 +11457,16 @@ index 4f5bfac..e1ef0d3 100644 return (void __user *) sp; } -@@ -456,7 +456,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka, +@@ -398,7 +398,7 @@ int ia32_setup_frame(int sig, struct ksignal *ksig, * These are actually not used anymore, but left because some * gdb versions depend on them as a marker. */ -- put_user_ex(*((u64 *)&code), (u64 *)frame->retcode); +- put_user_ex(*((u64 *)&code), (u64 __user *)frame->retcode); + put_user_ex(*((const u64 *)&code), (u64 __user *)frame->retcode); } put_user_catch(err); if (err) -@@ -498,7 +498,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, +@@ -440,7 +440,7 @@ int ia32_setup_rt_frame(int sig, struct ksignal *ksig, 0xb8, __NR_ia32_rt_sigreturn, 0x80cd, @@ -8725,11 +11474,11 @@ index 4f5bfac..e1ef0d3 100644 + 0 }; - frame = get_sigframe(ka, regs, sizeof(*frame), &fpstate); -@@ -528,16 +528,18 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, + frame = get_sigframe(ksig, regs, sizeof(*frame), &fpstate); +@@ -463,16 +463,18 @@ int ia32_setup_rt_frame(int sig, struct ksignal *ksig, - if (ka->sa.sa_flags & SA_RESTORER) - restorer = ka->sa.sa_restorer; + if (ksig->ka.sa.sa_flags & SA_RESTORER) + restorer = ksig->ka.sa.sa_restorer; + else if (current->mm->context.vdso) + /* Return stub is in 32bit vsyscall page */ + restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn); @@ -8743,19 +11492,19 @@ index 4f5bfac..e1ef0d3 100644 * Not actually used anymore, but left because some gdb * versions need it. */ -- put_user_ex(*((u64 *)&code), (u64 *)frame->retcode); +- put_user_ex(*((u64 *)&code), (u64 __user *)frame->retcode); + put_user_ex(*((const u64 *)&code), (u64 __user *)frame->retcode); } put_user_catch(err); - if (err) + err |= copy_siginfo_to_user32(&frame->info, &ksig->info); diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S -index e3e7340..05ed805 100644 +index 474dc1b..be7bff5 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S -@@ -13,8 +13,10 @@ - #include <asm/thread_info.h> - #include <asm/segment.h> +@@ -15,8 +15,10 @@ #include <asm/irqflags.h> + #include <asm/asm.h> + #include <asm/smap.h> +#include <asm/pgtable.h> #include <linux/linkage.h> #include <linux/err.h> @@ -8763,7 +11512,7 @@ index e3e7340..05ed805 100644 /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */ #include <linux/elf-em.h> -@@ -94,6 +96,32 @@ ENTRY(native_irq_enable_sysexit) +@@ -96,6 +98,32 @@ ENTRY(native_irq_enable_sysexit) ENDPROC(native_irq_enable_sysexit) #endif @@ -8796,7 +11545,7 @@ index e3e7340..05ed805 100644 /* * 32bit SYSENTER instruction entry. * -@@ -120,12 +148,6 @@ ENTRY(ia32_sysenter_target) +@@ -122,12 +150,6 @@ ENTRY(ia32_sysenter_target) CFI_REGISTER rsp,rbp SWAPGS_UNSAFE_STACK movq PER_CPU_VAR(kernel_stack), %rsp @@ -8809,7 +11558,7 @@ index e3e7340..05ed805 100644 movl %ebp,%ebp /* zero extension */ pushq_cfi $__USER32_DS /*CFI_REL_OFFSET ss,0*/ -@@ -133,24 +155,39 @@ ENTRY(ia32_sysenter_target) +@@ -135,24 +157,44 @@ ENTRY(ia32_sysenter_target) CFI_REL_OFFSET rsp,0 pushfq_cfi /*CFI_REL_OFFSET rflags,0*/ @@ -8829,6 +11578,11 @@ index e3e7340..05ed805 100644 cld SAVE_ARGS 0,1,0 + pax_enter_kernel_user ++ ++#ifdef CONFIG_PAX_RANDKSTACK ++ pax_erase_kstack ++#endif ++ + /* + * No need to follow this irqs on/off section: the syscall + * disabled irqs, here we enable it straight after entry: @@ -8838,14 +11592,14 @@ index e3e7340..05ed805 100644 32bit zero extended */ + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ mov $PAX_USER_SHADOW_BASE,%r11 ++ mov pax_user_shadow_base,%r11 + add %r11,%rbp +#endif + + ASM_STAC 1: movl (%rbp),%ebp - .section __ex_table,"a" - .quad 1b,ia32_badarg - .previous + _ASM_EXTABLE(1b,ia32_badarg) + ASM_CLAC - orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET) - testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) + GET_THREAD_INFO(%r11) @@ -8854,7 +11608,7 @@ index e3e7340..05ed805 100644 CFI_REMEMBER_STATE jnz sysenter_tracesys cmpq $(IA32_NR_syscalls-1),%rax -@@ -160,12 +197,15 @@ sysenter_do_call: +@@ -162,12 +204,15 @@ sysenter_do_call: sysenter_dispatch: call *ia32_sys_call_table(,%rax,8) movq %rax,RAX-ARGOFFSET(%rsp) @@ -8872,7 +11626,7 @@ index e3e7340..05ed805 100644 /* clear IF, that popfq doesn't enable interrupts early */ andl $~0x200,EFLAGS-R11(%rsp) movl RIP-R11(%rsp),%edx /* User %eip */ -@@ -191,6 +231,9 @@ sysexit_from_sys_call: +@@ -193,6 +238,9 @@ sysexit_from_sys_call: movl %eax,%esi /* 2nd arg: syscall number */ movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */ call __audit_syscall_entry @@ -8882,7 +11636,7 @@ index e3e7340..05ed805 100644 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */ cmpq $(IA32_NR_syscalls-1),%rax ja ia32_badsys -@@ -202,7 +245,7 @@ sysexit_from_sys_call: +@@ -204,7 +252,7 @@ sysexit_from_sys_call: .endm .macro auditsys_exit exit @@ -8890,22 +11644,22 @@ index e3e7340..05ed805 100644 + testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r11) jnz ia32_ret_from_sys_call TRACE_IRQS_ON - sti -@@ -213,11 +256,12 @@ sysexit_from_sys_call: + ENABLE_INTERRUPTS(CLBR_NONE) +@@ -215,11 +263,12 @@ sysexit_from_sys_call: 1: setbe %al /* 1 if error, 0 if not */ movzbl %al,%edi /* zero-extend that into %edi */ call __audit_syscall_exit + GET_THREAD_INFO(%r11) movq RAX-ARGOFFSET(%rsp),%rax /* reload syscall return value */ movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi - cli + DISABLE_INTERRUPTS(CLBR_NONE) TRACE_IRQS_OFF - testl %edi,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) + testl %edi,TI_flags(%r11) jz \exit CLEAR_RREGS -ARGOFFSET jmp int_with_check -@@ -235,7 +279,7 @@ sysexit_audit: +@@ -237,7 +286,7 @@ sysexit_audit: sysenter_tracesys: #ifdef CONFIG_AUDITSYSCALL @@ -8914,17 +11668,17 @@ index e3e7340..05ed805 100644 jz sysenter_auditsys #endif SAVE_REST -@@ -243,6 +287,9 @@ sysenter_tracesys: - movq $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */ - movq %rsp,%rdi /* &pt_regs -> arg1 */ - call syscall_trace_enter +@@ -249,6 +298,9 @@ sysenter_tracesys: + RESTORE_REST + cmpq $(IA32_NR_syscalls-1),%rax + ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */ + + pax_erase_kstack + - LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ - RESTORE_REST - cmpq $(IA32_NR_syscalls-1),%rax -@@ -274,19 +321,20 @@ ENDPROC(ia32_sysenter_target) + jmp sysenter_do_call + CFI_ENDPROC + ENDPROC(ia32_sysenter_target) +@@ -276,19 +328,25 @@ ENDPROC(ia32_sysenter_target) ENTRY(ia32_cstar_target) CFI_STARTPROC32 simple CFI_SIGNAL_FRAME @@ -8938,6 +11692,11 @@ index e3e7340..05ed805 100644 movq PER_CPU_VAR(kernel_stack),%rsp + SAVE_ARGS 8*6,0,0 + pax_enter_kernel_user ++ ++#ifdef CONFIG_PAX_RANDKSTACK ++ pax_erase_kstack ++#endif ++ /* * No need to follow this irqs on/off section: the syscall * disabled irqs and here we enable it straight after entry: @@ -8947,20 +11706,20 @@ index e3e7340..05ed805 100644 movl %eax,%eax /* zero extension */ movq %rax,ORIG_RAX-ARGOFFSET(%rsp) movq %rcx,RIP-ARGOFFSET(%rsp) -@@ -302,12 +350,19 @@ ENTRY(ia32_cstar_target) +@@ -304,12 +362,19 @@ ENTRY(ia32_cstar_target) /* no need to do an access_ok check here because r8 has been 32bit zero extended */ /* hardware stack frame is complete now */ + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ mov $PAX_USER_SHADOW_BASE,%r11 ++ mov pax_user_shadow_base,%r11 + add %r11,%r8 +#endif + + ASM_STAC 1: movl (%r8),%r9d - .section __ex_table,"a" - .quad 1b,ia32_badarg - .previous + _ASM_EXTABLE(1b,ia32_badarg) + ASM_CLAC - orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET) - testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) + GET_THREAD_INFO(%r11) @@ -8969,7 +11728,7 @@ index e3e7340..05ed805 100644 CFI_REMEMBER_STATE jnz cstar_tracesys cmpq $IA32_NR_syscalls-1,%rax -@@ -317,12 +372,15 @@ cstar_do_call: +@@ -319,12 +384,15 @@ cstar_do_call: cstar_dispatch: call *ia32_sys_call_table(,%rax,8) movq %rax,RAX-ARGOFFSET(%rsp) @@ -8987,7 +11746,7 @@ index e3e7340..05ed805 100644 RESTORE_ARGS 0,-ARG_SKIP,0,0,0 movl RIP-ARGOFFSET(%rsp),%ecx CFI_REGISTER rip,rcx -@@ -350,7 +408,7 @@ sysretl_audit: +@@ -352,7 +420,7 @@ sysretl_audit: cstar_tracesys: #ifdef CONFIG_AUDITSYSCALL @@ -8996,17 +11755,17 @@ index e3e7340..05ed805 100644 jz cstar_auditsys #endif xchgl %r9d,%ebp -@@ -359,6 +417,9 @@ cstar_tracesys: - movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */ - movq %rsp,%rdi /* &pt_regs -> arg1 */ - call syscall_trace_enter +@@ -366,6 +434,9 @@ cstar_tracesys: + xchgl %ebp,%r9d + cmpq $(IA32_NR_syscalls-1),%rax + ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */ + + pax_erase_kstack + - LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */ - RESTORE_REST - xchgl %ebp,%r9d -@@ -404,19 +465,21 @@ ENTRY(ia32_syscall) + jmp cstar_do_call + END(ia32_cstar_target) + +@@ -407,19 +478,26 @@ ENTRY(ia32_syscall) CFI_REL_OFFSET rip,RIP-RIP PARAVIRT_ADJUST_EXCEPTION_FRAME SWAPGS @@ -9024,6 +11783,11 @@ index e3e7340..05ed805 100644 - orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET) - testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) + pax_enter_kernel_user ++ ++#ifdef CONFIG_PAX_RANDKSTACK ++ pax_erase_kstack ++#endif ++ + /* + * No need to follow this irqs on/off section: the syscall + * disabled irqs and here we enable it straight after entry: @@ -9035,18 +11799,18 @@ index e3e7340..05ed805 100644 jnz ia32_tracesys cmpq $(IA32_NR_syscalls-1),%rax ja ia32_badsys -@@ -435,6 +498,9 @@ ia32_tracesys: - movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */ - movq %rsp,%rdi /* &pt_regs -> arg1 */ - call syscall_trace_enter +@@ -442,6 +520,9 @@ ia32_tracesys: + RESTORE_REST + cmpq $(IA32_NR_syscalls-1),%rax + ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */ + + pax_erase_kstack + - LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ - RESTORE_REST - cmpq $(IA32_NR_syscalls-1),%rax + jmp ia32_do_call + END(ia32_syscall) + diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c -index aec2202..f76174e 100644 +index ad7a20c..1ffa3c1 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c @@ -69,8 +69,8 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long offset_low, @@ -9057,46 +11821,10 @@ index aec2202..f76174e 100644 - typeof(ubuf->st_gid) gid = 0; + typeof(((struct stat64 *)0)->st_uid) uid = 0; + typeof(((struct stat64 *)0)->st_gid) gid = 0; - SET_UID(uid, stat->uid); - SET_GID(gid, stat->gid); + SET_UID(uid, from_kuid_munged(current_user_ns(), stat->uid)); + SET_GID(gid, from_kgid_munged(current_user_ns(), stat->gid)); if (!access_ok(VERIFY_WRITE, ubuf, sizeof(struct stat64)) || -@@ -292,7 +292,7 @@ asmlinkage long sys32_alarm(unsigned int seconds) - return alarm_setitimer(seconds); - } - --asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, -+asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int __user *stat_addr, - int options) - { - return compat_sys_wait4(pid, stat_addr, options, NULL); -@@ -313,7 +313,7 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid, - mm_segment_t old_fs = get_fs(); - - set_fs(KERNEL_DS); -- ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t); -+ ret = sys_sched_rr_get_interval(pid, (struct timespec __force_user *)&t); - set_fs(old_fs); - if (put_compat_timespec(&t, interval)) - return -EFAULT; -@@ -329,7 +329,7 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set, - mm_segment_t old_fs = get_fs(); - - set_fs(KERNEL_DS); -- ret = sys_rt_sigpending((sigset_t __user *)&s, sigsetsize); -+ ret = sys_rt_sigpending((sigset_t __force_user *)&s, sigsetsize); - set_fs(old_fs); - if (!ret) { - switch (_NSIG_WORDS) { -@@ -354,7 +354,7 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig, - if (copy_siginfo_from_user32(&info, uinfo)) - return -EFAULT; - set_fs(KERNEL_DS); -- ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info); -+ ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __force_user *)&info); - set_fs(old_fs); - return ret; - } -@@ -399,7 +399,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, +@@ -205,7 +205,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, return -EFAULT; set_fs(KERNEL_DS); @@ -9106,10 +11834,10 @@ index aec2202..f76174e 100644 set_fs(old_fs); diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h -index 952bd01..7692c6f 100644 +index 372231c..a5aa1a1 100644 --- a/arch/x86/include/asm/alternative-asm.h +++ b/arch/x86/include/asm/alternative-asm.h -@@ -15,6 +15,45 @@ +@@ -18,6 +18,45 @@ .endm #endif @@ -9156,20 +11884,29 @@ index 952bd01..7692c6f 100644 .long \orig - . .long \alt - . diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h -index 49331be..9706065 100644 +index 58ed6d9..f1cbe58 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h -@@ -89,7 +89,7 @@ static inline int alternatives_text_reserved(void *start, void *end) - ".section .discard,\"aw\",@progbits\n" \ - " .byte 0xff + (664f-663f) - (662b-661b)\n" /* rlen <= slen */ \ - ".previous\n" \ -- ".section .altinstr_replacement, \"ax\"\n" \ -+ ".section .altinstr_replacement, \"a\"\n" \ - "663:\n\t" newinstr "\n664:\n" /* replacement */ \ - ".previous" - +@@ -105,7 +105,7 @@ static inline int alternatives_text_reserved(void *start, void *end) + ".pushsection .discard,\"aw\",@progbits\n" \ + DISCARD_ENTRY(1) \ + ".popsection\n" \ +- ".pushsection .altinstr_replacement, \"ax\"\n" \ ++ ".pushsection .altinstr_replacement, \"a\"\n" \ + ALTINSTR_REPLACEMENT(newinstr, feature, 1) \ + ".popsection" + +@@ -119,7 +119,7 @@ static inline int alternatives_text_reserved(void *start, void *end) + DISCARD_ENTRY(1) \ + DISCARD_ENTRY(2) \ + ".popsection\n" \ +- ".pushsection .altinstr_replacement, \"ax\"\n" \ ++ ".pushsection .altinstr_replacement, \"a\"\n" \ + ALTINSTR_REPLACEMENT(newinstr1, feature1, 1) \ + ALTINSTR_REPLACEMENT(newinstr2, feature2, 2) \ + ".popsection" diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h -index d854101..f6ea947 100644 +index 3388034..050f0b9 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -44,7 +44,7 @@ static inline void generic_apic_probe(void) @@ -9204,7 +11941,7 @@ index 20370c6..a2eb9b0 100644 "popl %%ebp\n\t" "popl %%edi\n\t" diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h -index 58cb6d4..a4b806c 100644 +index 722aa3b..3a0bb27 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h @@ -22,7 +22,18 @@ @@ -9457,19 +12194,14 @@ index 58cb6d4..a4b806c 100644 : "+m" (v->counter), "=qm" (c) : "ir" (i) : "memory"); return c; -@@ -179,7 +341,7 @@ static inline int atomic_add_return(int i, atomic_t *v) - goto no_xadd; - #endif - /* Modern 486+ processor */ -- return i + xadd(&v->counter, i); +@@ -172,6 +334,18 @@ static inline int atomic_add_negative(int i, atomic_t *v) + */ + static inline int atomic_add_return(int i, atomic_t *v) + { + return i + xadd_check_overflow(&v->counter, i); - - #ifdef CONFIG_M386 - no_xadd: /* Legacy 386 processor */ -@@ -192,6 +354,34 @@ no_xadd: /* Legacy 386 processor */ - } - - /** ++} ++ ++/** + * atomic_add_return_unchecked - add integer and return + * @i: integer value to add + * @v: pointer of type atomic_unchecked_t @@ -9478,30 +12210,10 @@ index 58cb6d4..a4b806c 100644 + */ +static inline int atomic_add_return_unchecked(int i, atomic_unchecked_t *v) +{ -+#ifdef CONFIG_M386 -+ int __i; -+ unsigned long flags; -+ if (unlikely(boot_cpu_data.x86 <= 3)) -+ goto no_xadd; -+#endif -+ /* Modern 486+ processor */ -+ return i + xadd(&v->counter, i); -+ -+#ifdef CONFIG_M386 -+no_xadd: /* Legacy 386 processor */ -+ raw_local_irq_save(flags); -+ __i = atomic_read_unchecked(v); -+ atomic_set_unchecked(v, i + __i); -+ raw_local_irq_restore(flags); -+ return i + __i; -+#endif -+} -+ -+/** - * atomic_sub_return - subtract integer and return - * @v: pointer of type atomic_t - * @i: integer value to subtract -@@ -204,6 +394,10 @@ static inline int atomic_sub_return(int i, atomic_t *v) + return i + xadd(&v->counter, i); + } + +@@ -188,6 +362,10 @@ static inline int atomic_sub_return(int i, atomic_t *v) } #define atomic_inc_return(v) (atomic_add_return(1, v)) @@ -9512,7 +12224,7 @@ index 58cb6d4..a4b806c 100644 #define atomic_dec_return(v) (atomic_sub_return(1, v)) static inline int atomic_cmpxchg(atomic_t *v, int old, int new) -@@ -211,11 +405,21 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new) +@@ -195,11 +373,21 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new) return cmpxchg(&v->counter, old, new); } @@ -9534,7 +12246,7 @@ index 58cb6d4..a4b806c 100644 /** * __atomic_add_unless - add unless the number is already a given value * @v: pointer of type atomic_t -@@ -227,12 +431,25 @@ static inline int atomic_xchg(atomic_t *v, int new) +@@ -211,12 +399,25 @@ static inline int atomic_xchg(atomic_t *v, int new) */ static inline int __atomic_add_unless(atomic_t *v, int a, int u) { @@ -9563,11 +12275,10 @@ index 58cb6d4..a4b806c 100644 if (likely(old == c)) break; c = old; -@@ -240,6 +457,48 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) - return c; +@@ -225,6 +426,49 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) } -+/** + /** + * atomic_inc_not_zero_hint - increment if not null + * @v: pointer of type atomic_t + * @hint: probable value of the atomic before the increment @@ -9609,21 +12320,18 @@ index 58cb6d4..a4b806c 100644 + + return 0; +} - - /* - * atomic_dec_if_positive - decrement by 1 if old value positive -@@ -293,14 +552,37 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2) ++ ++/** + * atomic_inc_short - increment of a short integer + * @v: pointer to type int + * +@@ -253,14 +497,37 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2) #endif /* These are x86-specific, used by some header files */ -#define atomic_clear_mask(mask, addr) \ - asm volatile(LOCK_PREFIX "andl %0,%1" \ - : : "r" (~(mask)), "m" (*(addr)) : "memory") -- --#define atomic_set_mask(mask, addr) \ -- asm volatile(LOCK_PREFIX "orl %0,%1" \ -- : : "r" ((unsigned)(mask)), "m" (*(addr)) \ -- : "memory") +static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) +{ + asm volatile(LOCK_PREFIX "andl %1,%0" @@ -9631,7 +12339,11 @@ index 58cb6d4..a4b806c 100644 + : "r" (~(mask)) + : "memory"); +} -+ + +-#define atomic_set_mask(mask, addr) \ +- asm volatile(LOCK_PREFIX "orl %0,%1" \ +- : : "r" ((unsigned)(mask)), "m" (*(addr)) \ +- : "memory") +static inline void atomic_clear_mask_unchecked(unsigned int mask, atomic_unchecked_t *v) +{ + asm volatile(LOCK_PREFIX "andl %1,%0" @@ -9659,7 +12371,7 @@ index 58cb6d4..a4b806c 100644 /* Atomic operations are already serializing on x86 */ #define smp_mb__before_atomic_dec() barrier() diff --git a/arch/x86/include/asm/atomic64_32.h b/arch/x86/include/asm/atomic64_32.h -index 1981199..36b9dfb 100644 +index b154de7..aadebd8 100644 --- a/arch/x86/include/asm/atomic64_32.h +++ b/arch/x86/include/asm/atomic64_32.h @@ -12,6 +12,14 @@ typedef struct { @@ -10145,10 +12857,10 @@ index 0e1cbfc..5623683 100644 #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h -index b97596e..9bd48b06 100644 +index 6dfd019..28e188d 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h -@@ -38,7 +38,7 @@ +@@ -40,7 +40,7 @@ * a mask operation on a byte. */ #define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) @@ -10157,12 +12869,21 @@ index b97596e..9bd48b06 100644 #define CONST_MASK(nr) (1 << ((nr) & 7)) /** +@@ -486,7 +486,7 @@ static inline int fls(int x) + * at position 64. + */ + #ifdef CONFIG_X86_64 +-static __always_inline int fls64(__u64 x) ++static __always_inline long fls64(__u64 x) + { + int bitpos = -1; + /* diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h -index 5e1a2ee..c9f9533 100644 +index 4fa687a..60f2d39 100644 --- a/arch/x86/include/asm/boot.h +++ b/arch/x86/include/asm/boot.h -@@ -11,10 +11,15 @@ - #include <asm/pgtable_types.h> +@@ -6,10 +6,15 @@ + #include <uapi/asm/boot.h> /* Physical address where kernel should be loaded. */ -#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \ @@ -10249,7 +12970,7 @@ index 46fc474..b02b0f9 100644 if (len) diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h -index 99480e5..d81165b 100644 +index 8d871ea..c1a0dc9 100644 --- a/arch/x86/include/asm/cmpxchg.h +++ b/arch/x86/include/asm/cmpxchg.h @@ -14,8 +14,12 @@ extern void __cmpxchg_wrong_size(void) @@ -10310,11 +13031,24 @@ index 99480e5..d81165b 100644 #define __add(ptr, inc, lock) \ ({ \ __typeof__ (*(ptr)) __ret = (inc); \ +diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h +index 59c6c40..5e0b22c 100644 +--- a/arch/x86/include/asm/compat.h ++++ b/arch/x86/include/asm/compat.h +@@ -41,7 +41,7 @@ typedef s64 __attribute__((aligned(4))) compat_s64; + typedef u32 compat_uint_t; + typedef u32 compat_ulong_t; + typedef u64 __attribute__((aligned(4))) compat_u64; +-typedef u32 compat_uptr_t; ++typedef u32 __user compat_uptr_t; + + struct compat_timespec { + compat_time_t tv_sec; diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h -index f91e80f..7731066 100644 +index 93fe929..90858b7 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h -@@ -202,11 +202,12 @@ +@@ -207,7 +207,7 @@ #define X86_FEATURE_BMI1 (9*32+ 3) /* 1st group bit manipulation extensions */ #define X86_FEATURE_HLE (9*32+ 4) /* Hardware Lock Elision */ #define X86_FEATURE_AVX2 (9*32+ 5) /* AVX2 instructions */ @@ -10323,12 +13057,7 @@ index f91e80f..7731066 100644 #define X86_FEATURE_BMI2 (9*32+ 8) /* 2nd group bit manipulation extensions */ #define X86_FEATURE_ERMS (9*32+ 9) /* Enhanced REP MOVSB/STOSB */ #define X86_FEATURE_INVPCID (9*32+10) /* Invalidate Processor Context ID */ - #define X86_FEATURE_RTM (9*32+11) /* Restricted Transactional Memory */ -+#define X86_FEATURE_SMAP (9*32+20) /* Supervisor Mode Access Prevention */ - - #if defined(__KERNEL__) && !defined(__ASSEMBLY__) - -@@ -371,7 +372,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) +@@ -377,7 +377,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) ".section .discard,\"aw\",@progbits\n" " .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */ ".previous\n" @@ -10338,7 +13067,7 @@ index f91e80f..7731066 100644 "4:\n" ".previous\n" diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h -index e95822d..a90010e 100644 +index 8bf1c06..b6ae785 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h @@ -4,6 +4,7 @@ @@ -10348,8 +13077,8 @@ index e95822d..a90010e 100644 +#include <asm/pgtable.h> #include <linux/smp.h> - -@@ -16,6 +17,7 @@ static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *in + #include <linux/percpu.h> +@@ -17,6 +18,7 @@ static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *in desc->type = (info->read_exec_only ^ 1) << 1; desc->type |= info->contents << 2; @@ -10357,7 +13086,7 @@ index e95822d..a90010e 100644 desc->s = 1; desc->dpl = 0x3; -@@ -34,19 +36,14 @@ static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *in +@@ -35,19 +37,14 @@ static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *in } extern struct desc_ptr idt_descr; @@ -10381,7 +13110,7 @@ index e95822d..a90010e 100644 } #ifdef CONFIG_X86_64 -@@ -71,8 +68,14 @@ static inline void pack_gate(gate_desc *gate, unsigned char type, +@@ -72,8 +69,14 @@ static inline void pack_gate(gate_desc *gate, unsigned char type, unsigned long base, unsigned dpl, unsigned flags, unsigned short seg) { @@ -10398,7 +13127,7 @@ index e95822d..a90010e 100644 } #endif -@@ -117,12 +120,16 @@ static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries) +@@ -118,12 +121,16 @@ static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries) static inline void native_write_idt_entry(gate_desc *idt, int entry, const gate_desc *gate) { @@ -10415,7 +13144,7 @@ index e95822d..a90010e 100644 } static inline void -@@ -136,7 +143,9 @@ native_write_gdt_entry(struct desc_struct *gdt, int entry, const void *desc, int +@@ -137,7 +144,9 @@ native_write_gdt_entry(struct desc_struct *gdt, int entry, const void *desc, int default: size = sizeof(*gdt); break; } @@ -10425,7 +13154,7 @@ index e95822d..a90010e 100644 } static inline void pack_descriptor(struct desc_struct *desc, unsigned long base, -@@ -209,7 +218,9 @@ static inline void native_set_ldt(const void *addr, unsigned int entries) +@@ -210,7 +219,9 @@ static inline void native_set_ldt(const void *addr, unsigned int entries) static inline void native_load_tr_desc(void) { @@ -10435,7 +13164,7 @@ index e95822d..a90010e 100644 } static inline void native_load_gdt(const struct desc_ptr *dtr) -@@ -246,8 +257,10 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) +@@ -247,8 +258,10 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) struct desc_struct *gdt = get_cpu_gdt_table(cpu); unsigned int i; @@ -10446,7 +13175,16 @@ index e95822d..a90010e 100644 } #define _LDT_empty(info) \ -@@ -310,7 +323,7 @@ static inline void set_desc_limit(struct desc_struct *desc, unsigned long limit) +@@ -287,7 +300,7 @@ static inline void load_LDT(mm_context_t *pc) + preempt_enable(); + } + +-static inline unsigned long get_desc_base(const struct desc_struct *desc) ++static inline unsigned long __intentional_overflow(-1) get_desc_base(const struct desc_struct *desc) + { + return (unsigned)(desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24)); + } +@@ -311,7 +324,7 @@ static inline void set_desc_limit(struct desc_struct *desc, unsigned long limit) } #ifdef CONFIG_X86_64 @@ -10455,7 +13193,7 @@ index e95822d..a90010e 100644 { gate_desc s; -@@ -319,7 +332,7 @@ static inline void set_nmi_gate(int gate, void *addr) +@@ -320,7 +333,7 @@ static inline void set_nmi_gate(int gate, void *addr) } #endif @@ -10464,7 +13202,7 @@ index e95822d..a90010e 100644 unsigned dpl, unsigned ist, unsigned seg) { gate_desc s; -@@ -338,7 +351,7 @@ static inline void _set_gate(int gate, unsigned type, void *addr, +@@ -339,7 +352,7 @@ static inline void _set_gate(int gate, unsigned type, void *addr, * Pentium F0 0F bugfix can have resulted in the mapped * IDT being write-protected. */ @@ -10473,7 +13211,7 @@ index e95822d..a90010e 100644 { BUG_ON((unsigned)n > 0xFF); _set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS); -@@ -368,19 +381,19 @@ static inline void alloc_intr_gate(unsigned int n, void *addr) +@@ -369,19 +382,19 @@ static inline void alloc_intr_gate(unsigned int n, void *addr) /* * This routine sets up an interrupt gate at directory privilege level 3. */ @@ -10496,7 +13234,7 @@ index e95822d..a90010e 100644 { BUG_ON((unsigned)n > 0xFF); _set_gate(n, GATE_TRAP, addr, 0, 0, __KERNEL_CS); -@@ -389,19 +402,31 @@ static inline void set_trap_gate(unsigned int n, void *addr) +@@ -390,19 +403,31 @@ static inline void set_trap_gate(unsigned int n, void *addr) static inline void set_task_gate(unsigned int n, unsigned int gdt_entry) { BUG_ON((unsigned)n > 0xFF); @@ -10548,21 +13286,21 @@ index 278441f..b95a174 100644 }; } __attribute__((packed)); -diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h -index 3778256..c5d4fce 100644 ---- a/arch/x86/include/asm/e820.h -+++ b/arch/x86/include/asm/e820.h -@@ -69,7 +69,7 @@ struct e820map { - #define ISA_START_ADDRESS 0xa0000 - #define ISA_END_ADDRESS 0x100000 - --#define BIOS_BEGIN 0x000a0000 -+#define BIOS_BEGIN 0x000c0000 - #define BIOS_END 0x00100000 +diff --git a/arch/x86/include/asm/div64.h b/arch/x86/include/asm/div64.h +index ced283a..ffe04cc 100644 +--- a/arch/x86/include/asm/div64.h ++++ b/arch/x86/include/asm/div64.h +@@ -39,7 +39,7 @@ + __mod; \ + }) - #define BIOS_ROM_BASE 0xffe00000 +-static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) ++static inline u64 __intentional_overflow(-1) div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) + { + union { + u64 v64; diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h -index 5939f44..f8845f6 100644 +index 9c999c1..3860cb8 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -243,7 +243,25 @@ extern int force_personality32; @@ -10630,10 +13368,10 @@ index 5939f44..f8845f6 100644 * True on X86_32 or when emulating IA32 on X86_64 */ diff --git a/arch/x86/include/asm/emergency-restart.h b/arch/x86/include/asm/emergency-restart.h -index cc70c1c..d96d011 100644 +index 75ce3f4..882e801 100644 --- a/arch/x86/include/asm/emergency-restart.h +++ b/arch/x86/include/asm/emergency-restart.h -@@ -15,6 +15,6 @@ enum reboot_type { +@@ -13,6 +13,6 @@ enum reboot_type { extern enum reboot_type reboot_type; @@ -10642,67 +13380,61 @@ index cc70c1c..d96d011 100644 #endif /* _ASM_X86_EMERGENCY_RESTART_H */ diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h -index 4fa8815..71b121a 100644 +index e25cc33..425d099 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h -@@ -86,6 +86,11 @@ static inline int fxrstor_checking(struct i387_fxsave_struct *fx) - { - int err; - -+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ if ((unsigned long)fx < PAX_USER_SHADOW_BASE) -+ fx = (struct i387_fxsave_struct __user *)((void *)fx + PAX_USER_SHADOW_BASE); -+#endif -+ - /* See comment in fxsave() below. */ - #ifdef CONFIG_AS_FXSAVEQ - asm volatile("1: fxrstorq %[fx]\n\t" -@@ -115,6 +120,11 @@ static inline int fxsave_user(struct i387_fxsave_struct __user *fx) - { - int err; - -+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ if ((unsigned long)fx < PAX_USER_SHADOW_BASE) -+ fx = (struct i387_fxsave_struct __user *)((void __user *)fx + PAX_USER_SHADOW_BASE); -+#endif -+ - /* - * Clear the bytes not touched by the fxsave and reserved - * for the SW usage. -@@ -271,7 +281,7 @@ static inline int restore_fpu_checking(struct task_struct *tsk) +@@ -127,7 +127,9 @@ static inline void sanitize_i387_state(struct task_struct *tsk) + ({ \ + int err; \ + asm volatile(ASM_STAC "\n" \ +- "1:" #insn "\n\t" \ ++ "1:" \ ++ __copyuser_seg \ ++ #insn "\n\t" \ + "2: " ASM_CLAC "\n" \ + ".section .fixup,\"ax\"\n" \ + "3: movl $-1,%[err]\n" \ +@@ -300,7 +302,7 @@ static inline int restore_fpu_checking(struct task_struct *tsk) "emms\n\t" /* clear stack tags */ "fildl %P[addr]", /* set F?P to defined value */ X86_FEATURE_FXSAVE_LEAK, - [addr] "m" (tsk->thread.fpu.has_fpu)); -+ [addr] "m" (init_tss[smp_processor_id()].x86_tss.sp0)); ++ [addr] "m" (init_tss[raw_smp_processor_id()].x86_tss.sp0)); return fpu_restore_checking(&tsk->thread.fpu); } diff --git a/arch/x86/include/asm/futex.h b/arch/x86/include/asm/futex.h -index 71ecbcb..bac10b7 100644 +index be27ba1..8f13ff9 100644 --- a/arch/x86/include/asm/futex.h +++ b/arch/x86/include/asm/futex.h -@@ -11,16 +11,18 @@ - #include <asm/processor.h> +@@ -12,6 +12,7 @@ + #include <asm/smap.h> #define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ + typecheck(u32 __user *, uaddr); \ - asm volatile("1:\t" insn "\n" \ - "2:\t.section .fixup,\"ax\"\n" \ - "3:\tmov\t%3, %1\n" \ + asm volatile("\t" ASM_STAC "\n" \ + "1:\t" insn "\n" \ + "2:\t" ASM_CLAC "\n" \ +@@ -20,15 +21,16 @@ "\tjmp\t2b\n" \ "\t.previous\n" \ _ASM_EXTABLE(1b, 3b) \ - : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \ -+ : "=r" (oldval), "=r" (ret), "+m" (*(u32 __user *)____m(uaddr))\ ++ : "=r" (oldval), "=r" (ret), "+m" (*(u32 __user *)____m(uaddr)) \ : "i" (-EFAULT), "0" (oparg), "1" (0)) #define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ + typecheck(u32 __user *, uaddr); \ - asm volatile("1:\tmovl %2, %0\n" \ + asm volatile("\t" ASM_STAC "\n" \ + "1:\tmovl %2, %0\n" \ "\tmovl\t%0, %3\n" \ "\t" insn "\n" \ -@@ -33,7 +35,7 @@ +- "2:\t" LOCK_PREFIX "cmpxchgl %3, %2\n" \ ++ "2:\t" LOCK_PREFIX __copyuser_seg"cmpxchgl %3, %2\n" \ + "\tjnz\t1b\n" \ + "3:\t" ASM_CLAC "\n" \ + "\t.section .fixup,\"ax\"\n" \ +@@ -38,7 +40,7 @@ _ASM_EXTABLE(1b, 4b) \ _ASM_EXTABLE(2b, 4b) \ : "=&a" (oldval), "=&r" (ret), \ @@ -10711,7 +13443,7 @@ index 71ecbcb..bac10b7 100644 : "r" (oparg), "i" (-EFAULT), "1" (0)) static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) -@@ -60,10 +62,10 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) +@@ -59,10 +61,10 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) switch (op) { case FUTEX_OP_SET: @@ -10724,13 +13456,14 @@ index 71ecbcb..bac10b7 100644 uaddr, oparg); break; case FUTEX_OP_OR: -@@ -122,13 +124,13 @@ static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, - if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) +@@ -116,14 +118,14 @@ static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, return -EFAULT; -- asm volatile("1:\t" LOCK_PREFIX "cmpxchgl %4, %2\n" -+ asm volatile("1:\t" LOCK_PREFIX __copyuser_seg"cmpxchgl %4, %2\n" - "2:\t.section .fixup, \"ax\"\n" + asm volatile("\t" ASM_STAC "\n" +- "1:\t" LOCK_PREFIX "cmpxchgl %4, %2\n" ++ "1:\t" LOCK_PREFIX __copyuser_seg"cmpxchgl %4, %2\n" + "2:\t" ASM_CLAC "\n" + "\t.section .fixup, \"ax\"\n" "3:\tmov %3, %0\n" "\tjmp 2b\n" "\t.previous\n" @@ -10741,10 +13474,10 @@ index 71ecbcb..bac10b7 100644 : "memory" ); diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h -index eb92a6e..b98b2f4 100644 +index 10a78c3..cc77143 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h -@@ -136,8 +136,8 @@ extern void setup_ioapic_dest(void); +@@ -147,8 +147,8 @@ extern void setup_ioapic_dest(void); extern void enable_IO_APIC(void); /* Statistics */ @@ -10755,10 +13488,49 @@ index eb92a6e..b98b2f4 100644 /* EISA */ extern void eisa_set_level_irq(unsigned int irq); +diff --git a/arch/x86/include/asm/i8259.h b/arch/x86/include/asm/i8259.h +index a203659..9889f1c 100644 +--- a/arch/x86/include/asm/i8259.h ++++ b/arch/x86/include/asm/i8259.h +@@ -62,7 +62,7 @@ struct legacy_pic { + void (*init)(int auto_eoi); + int (*irq_pending)(unsigned int irq); + void (*make_irq)(unsigned int irq); +-}; ++} __do_const; + + extern struct legacy_pic *legacy_pic; + extern struct legacy_pic null_legacy_pic; diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h -index d8e8eef..99f81ae 100644 +index d8e8eef..1765f78 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h +@@ -51,12 +51,12 @@ static inline void name(type val, volatile void __iomem *addr) \ + "m" (*(volatile type __force *)addr) barrier); } + + build_mmio_read(readb, "b", unsigned char, "=q", :"memory") +-build_mmio_read(readw, "w", unsigned short, "=r", :"memory") +-build_mmio_read(readl, "l", unsigned int, "=r", :"memory") ++build_mmio_read(__intentional_overflow(-1) readw, "w", unsigned short, "=r", :"memory") ++build_mmio_read(__intentional_overflow(-1) readl, "l", unsigned int, "=r", :"memory") + + build_mmio_read(__readb, "b", unsigned char, "=q", ) +-build_mmio_read(__readw, "w", unsigned short, "=r", ) +-build_mmio_read(__readl, "l", unsigned int, "=r", ) ++build_mmio_read(__intentional_overflow(-1) __readw, "w", unsigned short, "=r", ) ++build_mmio_read(__intentional_overflow(-1) __readl, "l", unsigned int, "=r", ) + + build_mmio_write(writeb, "b", unsigned char, "q", :"memory") + build_mmio_write(writew, "w", unsigned short, "r", :"memory") +@@ -184,7 +184,7 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size) + return ioremap_nocache(offset, size); + } + +-extern void iounmap(volatile void __iomem *addr); ++extern void iounmap(const volatile void __iomem *addr); + + extern void set_iounmap_nonlazy(void); + @@ -194,6 +194,17 @@ extern void set_iounmap_nonlazy(void); #include <linux/vmalloc.h> @@ -10794,10 +13566,10 @@ index bba3cf8..06bc8da 100644 #define INTERRUPT_RETURN iret #define ENABLE_INTERRUPTS_SYSEXIT sti; sysexit diff --git a/arch/x86/include/asm/kprobes.h b/arch/x86/include/asm/kprobes.h -index 5478825..839e88c 100644 +index 5a6d287..f815789 100644 --- a/arch/x86/include/asm/kprobes.h +++ b/arch/x86/include/asm/kprobes.h -@@ -37,13 +37,8 @@ typedef u8 kprobe_opcode_t; +@@ -38,13 +38,8 @@ typedef u8 kprobe_opcode_t; #define RELATIVEJUMP_SIZE 5 #define RELATIVECALL_OPCODE 0xe8 #define RELATIVE_ADDR_SIZE 4 @@ -10813,24 +13585,24 @@ index 5478825..839e88c 100644 #define flush_insn_slot(p) do { } while (0) -diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h -index e216ba0..453f6ec 100644 ---- a/arch/x86/include/asm/kvm_host.h -+++ b/arch/x86/include/asm/kvm_host.h -@@ -679,7 +679,7 @@ struct kvm_x86_ops { - int (*check_intercept)(struct kvm_vcpu *vcpu, - struct x86_instruction_info *info, - enum x86_intercept_stage stage); --}; -+} __do_const; - - struct kvm_arch_async_pf { - u32 token; diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h -index c8bed0d..e5721fa 100644 +index 2d89e39..baee879 100644 --- a/arch/x86/include/asm/local.h +++ b/arch/x86/include/asm/local.h -@@ -17,26 +17,58 @@ typedef struct { +@@ -10,33 +10,97 @@ typedef struct { + atomic_long_t a; + } local_t; + ++typedef struct { ++ atomic_long_unchecked_t a; ++} local_unchecked_t; ++ + #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } + + #define local_read(l) atomic_long_read(&(l)->a) ++#define local_read_unchecked(l) atomic_long_read_unchecked(&(l)->a) + #define local_set(l, i) atomic_long_set(&(l)->a, (i)) ++#define local_set_unchecked(l, i) atomic_long_set_unchecked(&(l)->a, (i)) static inline void local_inc(local_t *l) { @@ -10844,6 +13616,12 @@ index c8bed0d..e5721fa 100644 + _ASM_EXTABLE(0b, 0b) +#endif + ++ : "+m" (l->a.counter)); ++} ++ ++static inline void local_inc_unchecked(local_unchecked_t *l) ++{ ++ asm volatile(_ASM_INC "%0\n" : "+m" (l->a.counter)); } @@ -10859,6 +13637,12 @@ index c8bed0d..e5721fa 100644 + _ASM_EXTABLE(0b, 0b) +#endif + ++ : "+m" (l->a.counter)); ++} ++ ++static inline void local_dec_unchecked(local_unchecked_t *l) ++{ ++ asm volatile(_ASM_DEC "%0\n" : "+m" (l->a.counter)); } @@ -10874,6 +13658,13 @@ index c8bed0d..e5721fa 100644 + _ASM_EXTABLE(0b, 0b) +#endif + ++ : "+m" (l->a.counter) ++ : "ir" (i)); ++} ++ ++static inline void local_add_unchecked(long i, local_unchecked_t *l) ++{ ++ asm volatile(_ASM_ADD "%1,%0\n" : "+m" (l->a.counter) : "ir" (i)); } @@ -10890,10 +13681,17 @@ index c8bed0d..e5721fa 100644 + _ASM_EXTABLE(0b, 0b) +#endif + ++ : "+m" (l->a.counter) ++ : "ir" (i)); ++} ++ ++static inline void local_sub_unchecked(long i, local_unchecked_t *l) ++{ ++ asm volatile(_ASM_SUB "%1,%0\n" : "+m" (l->a.counter) : "ir" (i)); } -@@ -54,7 +86,16 @@ static inline int local_sub_and_test(long i, local_t *l) +@@ -54,7 +118,16 @@ static inline int local_sub_and_test(long i, local_t *l) { unsigned char c; @@ -10911,7 +13709,7 @@ index c8bed0d..e5721fa 100644 : "+m" (l->a.counter), "=qm" (c) : "ir" (i) : "memory"); return c; -@@ -72,7 +113,16 @@ static inline int local_dec_and_test(local_t *l) +@@ -72,7 +145,16 @@ static inline int local_dec_and_test(local_t *l) { unsigned char c; @@ -10929,7 +13727,7 @@ index c8bed0d..e5721fa 100644 : "+m" (l->a.counter), "=qm" (c) : : "memory"); return c != 0; -@@ -90,7 +140,16 @@ static inline int local_inc_and_test(local_t *l) +@@ -90,7 +172,16 @@ static inline int local_inc_and_test(local_t *l) { unsigned char c; @@ -10947,7 +13745,7 @@ index c8bed0d..e5721fa 100644 : "+m" (l->a.counter), "=qm" (c) : : "memory"); return c != 0; -@@ -109,7 +168,16 @@ static inline int local_add_negative(long i, local_t *l) +@@ -109,7 +200,16 @@ static inline int local_add_negative(long i, local_t *l) { unsigned char c; @@ -10965,11 +13763,10 @@ index c8bed0d..e5721fa 100644 : "+m" (l->a.counter), "=qm" (c) : "ir" (i) : "memory"); return c; -@@ -132,7 +200,15 @@ static inline long local_add_return(long i, local_t *l) - #endif - /* Modern 486+ processor */ - __i = i; -- asm volatile(_ASM_XADD "%0, %1;" +@@ -125,6 +225,30 @@ static inline int local_add_negative(long i, local_t *l) + static inline long local_add_return(long i, local_t *l) + { + long __i = i; + asm volatile(_ASM_XADD "%0, %1\n" + +#ifdef CONFIG_PAX_REFCOUNT @@ -10979,28 +13776,54 @@ index c8bed0d..e5721fa 100644 + _ASM_EXTABLE(0b, 0b) +#endif + ++ : "+r" (i), "+m" (l->a.counter) ++ : : "memory"); ++ return i + __i; ++} ++ ++/** ++ * local_add_return_unchecked - add and return ++ * @i: integer value to add ++ * @l: pointer to type local_unchecked_t ++ * ++ * Atomically adds @i to @l and returns @i + @l ++ */ ++static inline long local_add_return_unchecked(long i, local_unchecked_t *l) ++{ ++ long __i = i; + asm volatile(_ASM_XADD "%0, %1;" : "+r" (i), "+m" (l->a.counter) : : "memory"); - return i + __i; -diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h -index 593e51d..fa69c9a 100644 ---- a/arch/x86/include/asm/mman.h -+++ b/arch/x86/include/asm/mman.h -@@ -5,4 +5,14 @@ +@@ -141,6 +265,8 @@ static inline long local_sub_return(long i, local_t *l) - #include <asm-generic/mman.h> + #define local_cmpxchg(l, o, n) \ + (cmpxchg_local(&((l)->a.counter), (o), (n))) ++#define local_cmpxchg_unchecked(l, o, n) \ ++ (cmpxchg_local(&((l)->a.counter), (o), (n))) + /* Always has a lock prefix */ + #define local_xchg(l, n) (xchg(&((l)->a.counter), (n))) +diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h +new file mode 100644 +index 0000000..2bfd3ba +--- /dev/null ++++ b/arch/x86/include/asm/mman.h +@@ -0,0 +1,15 @@ ++#ifndef _X86_MMAN_H ++#define _X86_MMAN_H ++ ++#include <uapi/asm/mman.h> ++ +#ifdef __KERNEL__ +#ifndef __ASSEMBLY__ +#ifdef CONFIG_X86_32 +#define arch_mmap_check i386_mmap_check -+int i386_mmap_check(unsigned long addr, unsigned long len, -+ unsigned long flags); ++int i386_mmap_check(unsigned long addr, unsigned long len, unsigned long flags); +#endif +#endif +#endif + - #endif /* _ASM_X86_MMAN_H */ ++#endif /* X86_MMAN_H */ diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h index 5f55e69..e20bfb1 100644 --- a/arch/x86/include/asm/mmu.h @@ -11036,7 +13859,7 @@ index 5f55e69..e20bfb1 100644 #ifdef CONFIG_SMP diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h -index 6902152..da4283a 100644 +index cdbf367..adb37ac 100644 --- a/arch/x86/include/asm/mmu_context.h +++ b/arch/x86/include/asm/mmu_context.h @@ -24,6 +24,18 @@ void destroy_context(struct mm_struct *mm); @@ -11056,8 +13879,8 @@ index 6902152..da4283a 100644 +#endif + #ifdef CONFIG_SMP - if (percpu_read(cpu_tlbstate.state) == TLBSTATE_OK) - percpu_write(cpu_tlbstate.state, TLBSTATE_LAZY); + if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) + this_cpu_write(cpu_tlbstate.state, TLBSTATE_LAZY); @@ -34,16 +46,30 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) { @@ -11069,10 +13892,10 @@ index 6902152..da4283a 100644 if (likely(prev != next)) { #ifdef CONFIG_SMP +#if defined(CONFIG_X86_32) && (defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)) -+ tlbstate = percpu_read(cpu_tlbstate.state); ++ tlbstate = this_cpu_read(cpu_tlbstate.state); +#endif - percpu_write(cpu_tlbstate.state, TLBSTATE_OK); - percpu_write(cpu_tlbstate.active_mm, next); + this_cpu_write(cpu_tlbstate.state, TLBSTATE_OK); + this_cpu_write(cpu_tlbstate.active_mm, next); #endif cpumask_set_cpu(cpu, mm_cpumask(next)); @@ -11126,8 +13949,8 @@ index 6902152..da4283a 100644 +#endif + +#ifdef CONFIG_SMP - percpu_write(cpu_tlbstate.state, TLBSTATE_OK); - BUG_ON(percpu_read(cpu_tlbstate.active_mm) != next); + this_cpu_write(cpu_tlbstate.state, TLBSTATE_OK); + BUG_ON(this_cpu_read(cpu_tlbstate.active_mm) != next); @@ -64,11 +119,28 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, * tlb flush IPI delivery. We must reload CR3 @@ -11153,14 +13976,14 @@ index 6902152..da4283a 100644 +#endif + } -- } - #endif -+ } ++#endif + } +-#endif } #define activate_mm(prev, next) \ diff --git a/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h -index 9eae775..c914fea 100644 +index e3b7819..b257c64 100644 --- a/arch/x86/include/asm/module.h +++ b/arch/x86/include/asm/module.h @@ -5,6 +5,7 @@ @@ -11168,10 +13991,10 @@ index 9eae775..c914fea 100644 #ifdef CONFIG_X86_64 /* X86_64 does not define MODULE_PROC_FAMILY */ +#define MODULE_PROC_FAMILY "" - #elif defined CONFIG_M386 - #define MODULE_PROC_FAMILY "386 " #elif defined CONFIG_M486 -@@ -59,8 +60,20 @@ + #define MODULE_PROC_FAMILY "486 " + #elif defined CONFIG_M586 +@@ -57,8 +58,20 @@ #error unknown processor family #endif @@ -11194,24 +14017,60 @@ index 9eae775..c914fea 100644 +#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_PAX_KERNEXEC MODULE_PAX_UDEREF + #endif /* _ASM_X86_MODULE_H */ -diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h -index 7639dbf..e08a58c 100644 ---- a/arch/x86/include/asm/page_64_types.h -+++ b/arch/x86/include/asm/page_64_types.h -@@ -56,7 +56,7 @@ void copy_page(void *to, void *from); +diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h +index c0fa356..07a498a 100644 +--- a/arch/x86/include/asm/nmi.h ++++ b/arch/x86/include/asm/nmi.h +@@ -42,11 +42,11 @@ struct nmiaction { + nmi_handler_t handler; + unsigned long flags; + const char *name; +-}; ++} __do_const; + + #define register_nmi_handler(t, fn, fg, n, init...) \ + ({ \ +- static struct nmiaction init fn##_na = { \ ++ static const struct nmiaction init fn##_na = { \ + .handler = (fn), \ + .name = (n), \ + .flags = (fg), \ +@@ -54,7 +54,7 @@ struct nmiaction { + __register_nmi_handler((t), &fn##_na); \ + }) + +-int __register_nmi_handler(unsigned int, struct nmiaction *); ++int __register_nmi_handler(unsigned int, const struct nmiaction *); + + void unregister_nmi_handler(unsigned int, const char *); + +diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h +index 0f1ddee..e56bec9 100644 +--- a/arch/x86/include/asm/page_64.h ++++ b/arch/x86/include/asm/page_64.h +@@ -7,7 +7,7 @@ /* duplicated to the one in bootmem.h */ extern unsigned long max_pfn; -extern unsigned long phys_base; +extern const unsigned long phys_base; - extern unsigned long __phys_addr(unsigned long); - #define __phys_reloc_hide(x) (x) + static inline unsigned long __phys_addr_nodebug(unsigned long x) + { diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h -index aa0f913..0c5bc6a 100644 +index 7361e47..16dc226 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h -@@ -668,6 +668,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd) +@@ -564,7 +564,7 @@ static inline pmd_t __pmd(pmdval_t val) + return (pmd_t) { ret }; + } + +-static inline pmdval_t pmd_val(pmd_t pmd) ++static inline __intentional_overflow(-1) pmdval_t pmd_val(pmd_t pmd) + { + pmdval_t ret; + +@@ -630,6 +630,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd) val); } @@ -11230,7 +14089,7 @@ index aa0f913..0c5bc6a 100644 static inline void pgd_clear(pgd_t *pgdp) { set_pgd(pgdp, __pgd(0)); -@@ -749,6 +761,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx, +@@ -714,6 +726,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx, pv_mmu_ops.set_fixmap(idx, phys, flags); } @@ -11252,7 +14111,7 @@ index aa0f913..0c5bc6a 100644 #if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT_SPINLOCKS) static inline int arch_spin_is_locked(struct arch_spinlock *lock) -@@ -965,7 +992,7 @@ extern void default_banner(void); +@@ -930,7 +957,7 @@ extern void default_banner(void); #define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 4) #define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .long, 4) @@ -11261,7 +14120,7 @@ index aa0f913..0c5bc6a 100644 #endif #define INTERRUPT_RETURN \ -@@ -1042,6 +1069,21 @@ extern void default_banner(void); +@@ -1005,6 +1032,21 @@ extern void default_banner(void); PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_irq_enable_sysexit), \ CLBR_NONE, \ jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_irq_enable_sysexit)) @@ -11284,10 +14143,10 @@ index aa0f913..0c5bc6a 100644 #endif /* __ASSEMBLY__ */ diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h -index 8e8b9a4..f07d725 100644 +index b3b0ec1..b1cd3eb 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h -@@ -84,20 +84,20 @@ struct pv_init_ops { +@@ -84,7 +84,7 @@ struct pv_init_ops { */ unsigned (*patch)(u8 type, u16 clobber, void *insnbuf, unsigned long addr, unsigned len); @@ -11296,13 +14155,7 @@ index 8e8b9a4..f07d725 100644 struct pv_lazy_ops { - /* Set deferred update mode, used for batching operations. */ - void (*enter)(void); - void (*leave)(void); --}; -+} __no_const; - - struct pv_time_ops { +@@ -98,7 +98,7 @@ struct pv_time_ops { unsigned long long (*sched_clock)(void); unsigned long long (*steal_clock)(int cpu); unsigned long (*get_tsc_khz)(void); @@ -11311,7 +14164,7 @@ index 8e8b9a4..f07d725 100644 struct pv_cpu_ops { /* hooks for various privileged instructions */ -@@ -193,7 +193,7 @@ struct pv_cpu_ops { +@@ -192,7 +192,7 @@ struct pv_cpu_ops { void (*start_context_switch)(struct task_struct *prev); void (*end_context_switch)(struct task_struct *next); @@ -11320,7 +14173,7 @@ index 8e8b9a4..f07d725 100644 struct pv_irq_ops { /* -@@ -224,7 +224,7 @@ struct pv_apic_ops { +@@ -223,7 +223,7 @@ struct pv_apic_ops { unsigned long start_eip, unsigned long start_esp); #endif @@ -11414,7 +14267,7 @@ index b4389a4..7024269 100644 { return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h -index 98391db..8f6984e 100644 +index f2b489c..4f7e2e5 100644 --- a/arch/x86/include/asm/pgtable-2level.h +++ b/arch/x86/include/asm/pgtable-2level.h @@ -18,7 +18,9 @@ static inline void native_set_pte(pte_t *ptep , pte_t pte) @@ -11428,7 +14281,7 @@ index 98391db..8f6984e 100644 static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h -index cb00ccc..17e9054 100644 +index 4cc9f2b..5fd9226 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h @@ -92,12 +92,16 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) @@ -11449,7 +14302,7 @@ index cb00ccc..17e9054 100644 /* diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h -index 49afb3f..91a8c63 100644 +index 1e67223..dd6e7ea 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -44,6 +44,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page); @@ -11479,7 +14332,7 @@ index 49afb3f..91a8c63 100644 + preempt_disable(); + barrier(); + cr0 = read_cr0() ^ X86_CR0_WP; -+ BUG_ON(unlikely(cr0 & X86_CR0_WP)); ++ BUG_ON(cr0 & X86_CR0_WP); + write_cr0(cr0); + return cr0 ^ X86_CR0_WP; +} @@ -11489,7 +14342,7 @@ index 49afb3f..91a8c63 100644 + unsigned long cr0; + + cr0 = read_cr0() ^ X86_CR0_WP; -+ BUG_ON(unlikely(!(cr0 & X86_CR0_WP))); ++ BUG_ON(!(cr0 & X86_CR0_WP)); + write_cr0(cr0); + barrier(); + preempt_enable_no_resched(); @@ -11512,7 +14365,19 @@ index 49afb3f..91a8c63 100644 static inline int pte_dirty(pte_t pte) { return pte_flags(pte) & _PAGE_DIRTY; -@@ -196,9 +236,29 @@ static inline pte_t pte_wrprotect(pte_t pte) +@@ -147,6 +187,11 @@ static inline unsigned long pud_pfn(pud_t pud) + return (pud_val(pud) & PTE_PFN_MASK) >> PAGE_SHIFT; + } + ++static inline unsigned long pgd_pfn(pgd_t pgd) ++{ ++ return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT; ++} ++ + #define pte_page(pte) pfn_to_page(pte_pfn(pte)) + + static inline int pmd_large(pmd_t pte) +@@ -200,9 +245,29 @@ static inline pte_t pte_wrprotect(pte_t pte) return pte_clear_flags(pte, _PAGE_RW); } @@ -11543,7 +14408,7 @@ index 49afb3f..91a8c63 100644 } static inline pte_t pte_mkdirty(pte_t pte) -@@ -390,6 +450,15 @@ pte_t *populate_extra_pte(unsigned long vaddr); +@@ -394,6 +459,15 @@ pte_t *populate_extra_pte(unsigned long vaddr); #endif #ifndef __ASSEMBLY__ @@ -11557,9 +14422,27 @@ index 49afb3f..91a8c63 100644 +#endif + #include <linux/mm_types.h> + #include <linux/log2.h> + +@@ -529,7 +603,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud) + * Currently stuck as a macro due to indirect forward reference to + * linux/mmzone.h's __section_mem_map_addr() definition: + */ +-#define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT) ++#define pud_page(pud) pfn_to_page((pud_val(pud) & PTE_PFN_MASK) >> PAGE_SHIFT) + + /* Find an entry in the second-level page table.. */ + static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) +@@ -569,7 +643,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd) + * Currently stuck as a macro due to indirect forward reference to + * linux/mmzone.h's __section_mem_map_addr() definition: + */ +-#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT) ++#define pgd_page(pgd) pfn_to_page((pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT) - static inline int pte_none(pte_t pte) -@@ -560,7 +629,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) + /* to find an entry in a page-table-directory. */ + static inline unsigned long pud_index(unsigned long address) +@@ -584,7 +658,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) static inline int pgd_bad(pgd_t pgd) { @@ -11568,7 +14451,7 @@ index 49afb3f..91a8c63 100644 } static inline int pgd_none(pgd_t pgd) -@@ -583,7 +652,12 @@ static inline int pgd_none(pgd_t pgd) +@@ -607,7 +681,12 @@ static inline int pgd_none(pgd_t pgd) * pgd_offset() returns a (pgd_t *) * pgd_index() is used get the offset into the pgd page's array of pgd_t's; */ @@ -11582,7 +14465,7 @@ index 49afb3f..91a8c63 100644 /* * a shortcut which implies the use of the kernel's pgd, instead * of a process's -@@ -594,6 +668,20 @@ static inline int pgd_none(pgd_t pgd) +@@ -618,6 +697,22 @@ static inline int pgd_none(pgd_t pgd) #define KERNEL_PGD_BOUNDARY pgd_index(PAGE_OFFSET) #define KERNEL_PGD_PTRS (PTRS_PER_PGD - KERNEL_PGD_BOUNDARY) @@ -11593,9 +14476,11 @@ index 49afb3f..91a8c63 100644 +#define USER_PGD_PTRS (_AC(1,UL) << (TASK_SIZE_MAX_SHIFT - PGDIR_SHIFT)) + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+#define PAX_USER_SHADOW_BASE (_AC(1,UL) << TASK_SIZE_MAX_SHIFT) ++#ifdef __ASSEMBLY__ ++#define pax_user_shadow_base pax_user_shadow_base(%rip) +#else -+#define PAX_USER_SHADOW_BASE (_AC(0,UL)) ++extern unsigned long pax_user_shadow_base; ++#endif +#endif + +#endif @@ -11603,7 +14488,7 @@ index 49afb3f..91a8c63 100644 #ifndef __ASSEMBLY__ extern int direct_gbpages; -@@ -758,11 +846,23 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, +@@ -784,11 +879,24 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, * dst and src can be on the same page, but the range must not overlap, * and must not cross a page boundary. */ @@ -11626,11 +14511,12 @@ index 49afb3f..91a8c63 100644 +#else +static inline void __shadow_user_pgds(pgd_t *dst, const pgd_t *src) {} +#endif - - #include <asm-generic/pgtable.h> - #endif /* __ASSEMBLY__ */ ++ + #define PTE_SHIFT ilog2(PTRS_PER_PTE) + static inline int page_level_shift(enum pg_level level) + { diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h -index 0c92113..34a77c6 100644 +index 9ee3221..b979c6b 100644 --- a/arch/x86/include/asm/pgtable_32.h +++ b/arch/x86/include/asm/pgtable_32.h @@ -25,9 +25,6 @@ @@ -11656,7 +14542,7 @@ index 0c92113..34a77c6 100644 #if defined(CONFIG_HIGHPTE) #define pte_offset_map(dir, address) \ ((pte_t *)kmap_atomic(pmd_page(*(dir))) + \ -@@ -62,7 +65,9 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t); +@@ -62,12 +65,17 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t); /* Clear a kernel PTE and flush it from the TLB */ #define kpte_clear_flush(ptep, vaddr) \ do { \ @@ -11666,8 +14552,6 @@ index 0c92113..34a77c6 100644 __flush_tlb_one((vaddr)); \ } while (0) -@@ -74,6 +79,9 @@ do { \ - #endif /* !__ASSEMBLY__ */ +#define HAVE_ARCH_UNMAPPED_AREA @@ -11710,7 +14594,7 @@ index ed5903b..c7fe163 100644 #define MODULES_END VMALLOC_END #define MODULES_LEN (MODULES_VADDR - MODULES_END) diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h -index 975f709..9f779c9 100644 +index e22c1db..23a625a 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h @@ -16,10 +16,14 @@ @@ -11765,10 +14649,10 @@ index 975f709..9f779c9 100644 } diff --git a/arch/x86/include/asm/pgtable_64_types.h b/arch/x86/include/asm/pgtable_64_types.h -index 766ea16..5b96cb3 100644 +index 2d88344..4679fc3 100644 --- a/arch/x86/include/asm/pgtable_64_types.h +++ b/arch/x86/include/asm/pgtable_64_types.h -@@ -59,5 +59,10 @@ typedef struct { pteval_t pte; } pte_t; +@@ -61,6 +61,11 @@ typedef struct { pteval_t pte; } pte_t; #define MODULES_VADDR _AC(0xffffffffa0000000, UL) #define MODULES_END _AC(0xffffffffff000000, UL) #define MODULES_LEN (MODULES_END - MODULES_VADDR) @@ -11778,9 +14662,10 @@ index 766ea16..5b96cb3 100644 +#define ktla_ktva(addr) (addr) +#define ktva_ktla(addr) (addr) - #endif /* _ASM_X86_PGTABLE_64_DEFS_H */ + #define EARLY_DYNAMIC_PAGE_TABLES 64 + diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h -index 013286a..8b42f4f 100644 +index 567b5d0..bd91d64 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -16,13 +16,12 @@ @@ -11820,7 +14705,7 @@ index 013286a..8b42f4f 100644 #endif #define _PAGE_FILE (_AT(pteval_t, 1) << _PAGE_BIT_FILE) -@@ -96,6 +96,9 @@ +@@ -116,6 +116,9 @@ #define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \ _PAGE_ACCESSED) @@ -11830,7 +14715,7 @@ index 013286a..8b42f4f 100644 #define __PAGE_KERNEL_EXEC \ (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL) #define __PAGE_KERNEL (__PAGE_KERNEL_EXEC | _PAGE_NX) -@@ -106,7 +109,7 @@ +@@ -126,7 +129,7 @@ #define __PAGE_KERNEL_WC (__PAGE_KERNEL | _PAGE_CACHE_WC) #define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT) #define __PAGE_KERNEL_UC_MINUS (__PAGE_KERNEL | _PAGE_PCD) @@ -11839,7 +14724,7 @@ index 013286a..8b42f4f 100644 #define __PAGE_KERNEL_VVAR (__PAGE_KERNEL_RO | _PAGE_USER) #define __PAGE_KERNEL_VVAR_NOCACHE (__PAGE_KERNEL_VVAR | _PAGE_PCD | _PAGE_PWT) #define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE) -@@ -168,8 +171,8 @@ +@@ -188,8 +191,8 @@ * bits are combined, this will alow user to access the high address mapped * VDSO in the presence of CONFIG_COMPAT_VDSO */ @@ -11850,7 +14735,7 @@ index 013286a..8b42f4f 100644 #define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */ #endif -@@ -207,7 +210,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd) +@@ -227,7 +230,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd) { return native_pgd_val(pgd) & PTE_FLAGS_MASK; } @@ -11868,7 +14753,7 @@ index 013286a..8b42f4f 100644 #if PAGETABLE_LEVELS > 3 typedef struct { pudval_t pud; } pud_t; -@@ -221,8 +234,6 @@ static inline pudval_t native_pud_val(pud_t pud) +@@ -241,8 +254,6 @@ static inline pudval_t native_pud_val(pud_t pud) return pud.pud; } #else @@ -11877,7 +14762,7 @@ index 013286a..8b42f4f 100644 static inline pudval_t native_pud_val(pud_t pud) { return native_pgd_val(pud.pgd); -@@ -242,8 +253,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) +@@ -262,8 +273,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) return pmd.pmd; } #else @@ -11886,7 +14771,7 @@ index 013286a..8b42f4f 100644 static inline pmdval_t native_pmd_val(pmd_t pmd) { return native_pgd_val(pmd.pud.pgd); -@@ -283,7 +292,6 @@ typedef struct page *pgtable_t; +@@ -303,7 +312,6 @@ typedef struct page *pgtable_t; extern pteval_t __supported_pte_mask; extern void set_nx(void); @@ -11894,23 +14779,11 @@ index 013286a..8b42f4f 100644 #define pgprot_writecombine pgprot_writecombine extern pgprot_t pgprot_writecombine(pgprot_t prot); -diff --git a/arch/x86/include/asm/processor-flags.h b/arch/x86/include/asm/processor-flags.h -index f8ab3ea..67889db 100644 ---- a/arch/x86/include/asm/processor-flags.h -+++ b/arch/x86/include/asm/processor-flags.h -@@ -63,6 +63,7 @@ - #define X86_CR4_RDWRGSFS 0x00010000 /* enable RDWRGSFS support */ - #define X86_CR4_OSXSAVE 0x00040000 /* enable xsave and xrestore */ - #define X86_CR4_SMEP 0x00100000 /* enable SMEP support */ -+#define X86_CR4_SMAP 0x00200000 /* enable SMAP support */ - - /* - * x86-64 Task Priority Register, CR8 diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h -index 4fa7dcc..764e33a 100644 +index 3270116..8d99d82 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h -@@ -276,7 +276,7 @@ struct tss_struct { +@@ -285,7 +285,7 @@ struct tss_struct { } ____cacheline_aligned; @@ -11919,7 +14792,7 @@ index 4fa7dcc..764e33a 100644 /* * Save the original ist values for checking stack pointers during debugging -@@ -807,11 +807,18 @@ static inline void spin_lock_prefetch(const void *x) +@@ -826,11 +826,18 @@ static inline void spin_lock_prefetch(const void *x) */ #define TASK_SIZE PAGE_OFFSET #define TASK_SIZE_MAX TASK_SIZE @@ -11940,7 +14813,7 @@ index 4fa7dcc..764e33a 100644 .vm86_info = NULL, \ .sysenter_cs = __KERNEL_CS, \ .io_bitmap_ptr = NULL, \ -@@ -825,7 +832,7 @@ static inline void spin_lock_prefetch(const void *x) +@@ -844,7 +851,7 @@ static inline void spin_lock_prefetch(const void *x) */ #define INIT_TSS { \ .x86_tss = { \ @@ -11949,7 +14822,7 @@ index 4fa7dcc..764e33a 100644 .ss0 = __KERNEL_DS, \ .ss1 = __KERNEL_CS, \ .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \ -@@ -836,11 +843,7 @@ static inline void spin_lock_prefetch(const void *x) +@@ -855,11 +862,7 @@ static inline void spin_lock_prefetch(const void *x) extern unsigned long thread_saved_pc(struct task_struct *tsk); #define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long)) @@ -11962,7 +14835,7 @@ index 4fa7dcc..764e33a 100644 /* * The below -8 is to reserve 8 bytes on top of the ring0 stack. -@@ -855,7 +858,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); +@@ -874,7 +877,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); #define task_pt_regs(task) \ ({ \ struct pt_regs *__regs__; \ @@ -11971,7 +14844,7 @@ index 4fa7dcc..764e33a 100644 __regs__ - 1; \ }) -@@ -865,13 +868,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); +@@ -884,13 +887,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); /* * User space process size. 47bits minus one guard page. */ @@ -11987,7 +14860,7 @@ index 4fa7dcc..764e33a 100644 #define TASK_SIZE (test_thread_flag(TIF_ADDR32) ? \ IA32_PAGE_OFFSET : TASK_SIZE_MAX) -@@ -882,11 +885,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); +@@ -901,11 +904,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); #define STACK_TOP_MAX TASK_SIZE_MAX #define INIT_THREAD { \ @@ -12001,7 +14874,7 @@ index 4fa7dcc..764e33a 100644 } /* -@@ -914,6 +917,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip, +@@ -933,6 +936,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip, */ #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) @@ -12012,26 +14885,28 @@ index 4fa7dcc..764e33a 100644 #define KSTK_EIP(task) (task_pt_regs(task)->ip) /* Get/set a process' ability to use the timestamp counter instruction */ -@@ -976,12 +983,12 @@ extern bool cpu_has_amd_erratum(const int *); - - void cpu_idle_wait(void); +@@ -993,7 +1000,7 @@ extern bool cpu_has_amd_erratum(const int *); + #define cpu_has_amd_erratum(x) (false) + #endif /* CONFIG_CPU_SUP_AMD */ -extern unsigned long arch_align_stack(unsigned long sp); +#define arch_align_stack(x) ((x) & ~0xfUL) extern void free_init_pages(char *what, unsigned long begin, unsigned long end); void default_idle(void); - bool set_pm_idle_to_default(void); +@@ -1003,6 +1010,6 @@ bool xen_set_default_idle(void); + #define xen_set_default_idle 0 + #endif -void stop_this_cpu(void *dummy); +void stop_this_cpu(void *dummy) __noreturn; #endif /* _ASM_X86_PROCESSOR_H */ diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h -index dcfde52..dbfea06 100644 +index 942a086..6c26446 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h -@@ -155,28 +155,29 @@ static inline unsigned long regs_return_value(struct pt_regs *regs) +@@ -85,28 +85,29 @@ static inline unsigned long regs_return_value(struct pt_regs *regs) } /* @@ -12067,7 +14942,7 @@ index dcfde52..dbfea06 100644 #endif } -@@ -192,15 +193,16 @@ static inline int v8086_mode(struct pt_regs *regs) +@@ -122,15 +123,16 @@ static inline int v8086_mode(struct pt_regs *regs) #ifdef CONFIG_X86_64 static inline bool user_64bit_mode(struct pt_regs *regs) { @@ -12085,12 +14960,49 @@ index dcfde52..dbfea06 100644 + return cs == __USER_CS || cs == pv_info.extra_user_64bit_cs; #endif } + +@@ -181,9 +183,11 @@ static inline unsigned long regs_get_register(struct pt_regs *regs, + * Traps from the kernel do not save sp and ss. + * Use the helper function to retrieve sp. + */ +- if (offset == offsetof(struct pt_regs, sp) && +- regs->cs == __KERNEL_CS) +- return kernel_stack_pointer(regs); ++ if (offset == offsetof(struct pt_regs, sp)) { ++ unsigned long cs = regs->cs & 0xffff; ++ if (cs == __KERNEL_CS || cs == __KERNEXEC_KERNEL_CS) ++ return kernel_stack_pointer(regs); ++ } + #endif + return *(unsigned long *)((unsigned long)regs + offset); + } +diff --git a/arch/x86/include/asm/realmode.h b/arch/x86/include/asm/realmode.h +index 9c6b890..5305f53 100644 +--- a/arch/x86/include/asm/realmode.h ++++ b/arch/x86/include/asm/realmode.h +@@ -22,16 +22,14 @@ struct real_mode_header { #endif + /* APM/BIOS reboot */ + u32 machine_real_restart_asm; +-#ifdef CONFIG_X86_64 + u32 machine_real_restart_seg; +-#endif + }; + + /* This must match data at trampoline_32/64.S */ + struct trampoline_header { + #ifdef CONFIG_X86_32 + u32 start; +- u16 gdt_pad; ++ u16 boot_cs; + u16 gdt_limit; + u32 gdt_base; + #else diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h -index 92f29706..d0a1a53 100644 +index a82c4f1..ac45053 100644 --- a/arch/x86/include/asm/reboot.h +++ b/arch/x86/include/asm/reboot.h -@@ -6,19 +6,19 @@ +@@ -6,13 +6,13 @@ struct pt_regs; struct machine_ops { @@ -12109,13 +15021,6 @@ index 92f29706..d0a1a53 100644 extern struct machine_ops machine_ops; - void native_machine_crash_shutdown(struct pt_regs *regs); - void native_machine_shutdown(void); --void machine_real_restart(unsigned int type); -+void __noreturn machine_real_restart(unsigned int type); - /* These must match dispatch_table in reboot_32.S */ - #define MRR_BIOS 0 - #define MRR_APM 1 diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h index 2dbe4a7..ce1db00 100644 --- a/arch/x86/include/asm/rwsem.h @@ -12237,7 +15142,7 @@ index 2dbe4a7..ce1db00 100644 #endif /* __KERNEL__ */ diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h -index 1654662..5af4157 100644 +index c48a950..c6d7468 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -64,10 +64,15 @@ @@ -12306,7 +15211,7 @@ index 1654662..5af4157 100644 #define __KERNEL_DS (GDT_ENTRY_KERNEL_DS*8) #define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS*8+3) #define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS*8+3) -@@ -263,7 +279,7 @@ static inline unsigned long get_limit(unsigned long segment) +@@ -265,7 +281,7 @@ static inline unsigned long get_limit(unsigned long segment) { unsigned long __limit; asm("lsll %1,%0" : "=r" (__limit) : "r" (segment)); @@ -12316,19 +15221,19 @@ index 1654662..5af4157 100644 #endif /* !__ASSEMBLY__ */ diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h -index 0434c40..1714bf0 100644 +index b073aae..39f9bdd 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h -@@ -36,7 +36,7 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_map); +@@ -36,7 +36,7 @@ DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_map); /* cpus sharing the last level cache: */ - DECLARE_PER_CPU(cpumask_var_t, cpu_llc_shared_map); - DECLARE_PER_CPU(u16, cpu_llc_id); --DECLARE_PER_CPU(int, cpu_number); -+DECLARE_PER_CPU(unsigned int, cpu_number); + DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map); + DECLARE_PER_CPU_READ_MOSTLY(u16, cpu_llc_id); +-DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number); ++DECLARE_PER_CPU_READ_MOSTLY(unsigned int, cpu_number); static inline struct cpumask *cpu_sibling_mask(int cpu) { -@@ -77,7 +77,7 @@ struct smp_ops { +@@ -79,7 +79,7 @@ struct smp_ops { void (*send_call_func_ipi)(const struct cpumask *mask); void (*send_call_func_single_ipi)(int cpu); @@ -12337,11 +15242,11 @@ index 0434c40..1714bf0 100644 /* Globals due to paravirt */ extern void set_cpu_sibling_map(int cpu); -@@ -192,14 +192,8 @@ extern unsigned disabled_cpus __cpuinitdata; +@@ -191,14 +191,8 @@ extern unsigned disabled_cpus __cpuinitdata; extern int safe_smp_processor_id(void); #elif defined(CONFIG_X86_64_SMP) --#define raw_smp_processor_id() (percpu_read(cpu_number)) +-#define raw_smp_processor_id() (this_cpu_read(cpu_number)) - -#define stack_smp_processor_id() \ -({ \ @@ -12349,16 +15254,16 @@ index 0434c40..1714bf0 100644 - __asm__("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK)); \ - ti->cpu; \ -}) -+#define raw_smp_processor_id() (percpu_read(cpu_number)) ++#define raw_smp_processor_id() (this_cpu_read(cpu_number)) +#define stack_smp_processor_id() raw_smp_processor_id() #define safe_smp_processor_id() smp_processor_id() #endif diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h -index 76bfa2c..12d3fe7 100644 +index 33692ea..350a534 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h -@@ -175,6 +175,14 @@ static inline int arch_write_can_lock(arch_rwlock_t *lock) +@@ -172,6 +172,14 @@ static inline int arch_write_can_lock(arch_rwlock_t *lock) static inline void arch_read_lock(arch_rwlock_t *rw) { asm volatile(LOCK_PREFIX READ_LOCK_SIZE(dec) " (%0)\n\t" @@ -12373,7 +15278,7 @@ index 76bfa2c..12d3fe7 100644 "jns 1f\n" "call __read_lock_failed\n\t" "1:\n" -@@ -184,6 +192,14 @@ static inline void arch_read_lock(arch_rwlock_t *rw) +@@ -181,6 +189,14 @@ static inline void arch_read_lock(arch_rwlock_t *rw) static inline void arch_write_lock(arch_rwlock_t *rw) { asm volatile(LOCK_PREFIX WRITE_LOCK_SUB(%1) "(%0)\n\t" @@ -12388,7 +15293,7 @@ index 76bfa2c..12d3fe7 100644 "jz 1f\n" "call __write_lock_failed\n\t" "1:\n" -@@ -213,13 +229,29 @@ static inline int arch_write_trylock(arch_rwlock_t *lock) +@@ -210,13 +226,29 @@ static inline int arch_write_trylock(arch_rwlock_t *lock) static inline void arch_read_unlock(arch_rwlock_t *rw) { @@ -12421,7 +15326,7 @@ index 76bfa2c..12d3fe7 100644 } diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h -index b5d9533..41655fa 100644 +index 6a99859..03cb807 100644 --- a/arch/x86/include/asm/stackprotector.h +++ b/arch/x86/include/asm/stackprotector.h @@ -47,7 +47,7 @@ @@ -12461,7 +15366,15 @@ index 70bbe39..4ae2bd4 100644 - void *data, - unsigned long *end, - int *graph); -- ++typedef unsigned long walk_stack_t(struct task_struct *task, ++ void *stack_start, ++ unsigned long *stack, ++ unsigned long bp, ++ const struct stacktrace_ops *ops, ++ void *data, ++ unsigned long *end, ++ int *graph); + -extern unsigned long -print_context_stack(struct thread_info *tinfo, - unsigned long *stack, unsigned long bp, @@ -12473,15 +15386,6 @@ index 70bbe39..4ae2bd4 100644 - unsigned long *stack, unsigned long bp, - const struct stacktrace_ops *ops, void *data, - unsigned long *end, int *graph); -+typedef unsigned long walk_stack_t(struct task_struct *task, -+ void *stack_start, -+ unsigned long *stack, -+ unsigned long bp, -+ const struct stacktrace_ops *ops, -+ void *data, -+ unsigned long *end, -+ int *graph); -+ +extern walk_stack_t print_context_stack; +extern walk_stack_t print_context_stack_bp; @@ -12518,21 +15422,8 @@ index 4ec45b3..a4f0a8a 100644 [current_task] "m" (current_task) \ __switch_canary_iparam \ : "memory", "cc" __EXTRA_CLOBBER) -diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h -index 3fda9db4..4ca1c61 100644 ---- a/arch/x86/include/asm/sys_ia32.h -+++ b/arch/x86/include/asm/sys_ia32.h -@@ -40,7 +40,7 @@ asmlinkage long sys32_sigaction(int, struct old_sigaction32 __user *, - struct old_sigaction32 __user *); - asmlinkage long sys32_alarm(unsigned int); - --asmlinkage long sys32_waitpid(compat_pid_t, unsigned int *, int); -+asmlinkage long sys32_waitpid(compat_pid_t, unsigned int __user *, int); - asmlinkage long sys32_sysfs(int, u32, u32); - - asmlinkage long sys32_sched_rr_get_interval(compat_pid_t, diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h -index ad6df8c..5e0cf6e 100644 +index 2cd056e..0224df8 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -10,6 +10,7 @@ @@ -12543,7 +15434,7 @@ index ad6df8c..5e0cf6e 100644 /* * low level task data that entry.S needs immediate access to -@@ -24,7 +25,6 @@ struct exec_domain; +@@ -23,7 +24,6 @@ struct exec_domain; #include <linux/atomic.h> struct thread_info { @@ -12551,7 +15442,7 @@ index ad6df8c..5e0cf6e 100644 struct exec_domain *exec_domain; /* execution domain */ __u32 flags; /* low level flags */ __u32 status; /* thread synchronous flags */ -@@ -34,19 +34,13 @@ struct thread_info { +@@ -33,19 +33,13 @@ struct thread_info { mm_segment_t addr_limit; struct restart_block restart_block; void __user *sysenter_return; @@ -12573,7 +15464,7 @@ index ad6df8c..5e0cf6e 100644 .exec_domain = &default_exec_domain, \ .flags = 0, \ .cpu = 0, \ -@@ -57,7 +51,7 @@ struct thread_info { +@@ -56,7 +50,7 @@ struct thread_info { }, \ } @@ -12590,7 +15481,7 @@ index ad6df8c..5e0cf6e 100644 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) -@@ -120,16 +115,18 @@ struct thread_info { +@@ -121,17 +116,18 @@ struct thread_info { #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) #define _TIF_ADDR32 (1 << TIF_ADDR32) #define _TIF_X32 (1 << TIF_X32) @@ -12599,60 +15490,45 @@ index ad6df8c..5e0cf6e 100644 /* work to do in syscall_trace_enter() */ #define _TIF_WORK_SYSCALL_ENTRY \ (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT | \ -- _TIF_SECCOMP | _TIF_SINGLESTEP | _TIF_SYSCALL_TRACEPOINT) -+ _TIF_SECCOMP | _TIF_SINGLESTEP | _TIF_SYSCALL_TRACEPOINT | \ -+ _TIF_GRSEC_SETXID) + _TIF_SECCOMP | _TIF_SINGLESTEP | _TIF_SYSCALL_TRACEPOINT | \ +- _TIF_NOHZ) ++ _TIF_NOHZ | _TIF_GRSEC_SETXID) /* work to do in syscall_trace_leave() */ #define _TIF_WORK_SYSCALL_EXIT \ (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP | \ -- _TIF_SYSCALL_TRACEPOINT) -+ _TIF_SYSCALL_TRACEPOINT | _TIF_GRSEC_SETXID) +- _TIF_SYSCALL_TRACEPOINT | _TIF_NOHZ) ++ _TIF_SYSCALL_TRACEPOINT | _TIF_NOHZ | _TIF_GRSEC_SETXID) /* work to do on interrupt/exception return */ #define _TIF_WORK_MASK \ -@@ -139,7 +136,8 @@ struct thread_info { - +@@ -142,7 +138,7 @@ struct thread_info { /* work to do on any return to user space */ #define _TIF_ALLWORK_MASK \ -- ((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_TRACEPOINT) -+ ((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_TRACEPOINT | \ -+ _TIF_GRSEC_SETXID) + ((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_TRACEPOINT | \ +- _TIF_NOHZ) ++ _TIF_NOHZ | _TIF_GRSEC_SETXID) /* Only used for 64 bit */ #define _TIF_DO_NOTIFY_MASK \ -@@ -173,6 +171,23 @@ struct thread_info { - ret; \ - }) - -+#ifdef __ASSEMBLY__ -+/* how to get the thread information struct from ASM */ -+#define GET_THREAD_INFO(reg) \ -+ mov PER_CPU_VAR(current_tinfo), reg -+ -+/* use this one if reg already contains %esp */ -+#define GET_THREAD_INFO_WITH_ESP(reg) GET_THREAD_INFO(reg) -+#else -+/* how to get the thread information struct from C */ -+DECLARE_PER_CPU(struct thread_info *, current_tinfo); -+ -+static __always_inline struct thread_info *current_thread_info(void) -+{ -+ return percpu_read_stable(current_tinfo); -+} -+#endif -+ - #ifdef CONFIG_X86_32 +@@ -158,45 +154,40 @@ struct thread_info { - #define STACK_WARN (THREAD_SIZE/8) -@@ -183,35 +198,13 @@ struct thread_info { - */ - #ifndef __ASSEMBLY__ + #define PREEMPT_ACTIVE 0x10000000 +-#ifdef CONFIG_X86_32 +- +-#define STACK_WARN (THREAD_SIZE/8) +-/* +- * macros/functions for gaining access to the thread information structure +- * +- * preempt_count needs to be 1 initially, until the scheduler is functional. +- */ +-#ifndef __ASSEMBLY__ +- +- +-/* how to get the current stack pointer from C */ +-register unsigned long current_stack_pointer asm("esp") __used; - - /* how to get the current stack pointer from C */ - register unsigned long current_stack_pointer asm("esp") __used; - -/* how to get the thread information struct from C */ -static inline struct thread_info *current_thread_info(void) -{ @@ -12662,15 +15538,40 @@ index ad6df8c..5e0cf6e 100644 - -#else /* !__ASSEMBLY__ */ - --/* how to get the thread information struct from ASM */ --#define GET_THREAD_INFO(reg) \ ++#ifdef __ASSEMBLY__ + /* how to get the thread information struct from ASM */ + #define GET_THREAD_INFO(reg) \ - movl $-THREAD_SIZE, reg; \ - andl %esp, reg -- --/* use this one if reg already contains %esp */ ++ mov PER_CPU_VAR(current_tinfo), reg + + /* use this one if reg already contains %esp */ -#define GET_THREAD_INFO_WITH_ESP(reg) \ - andl $-THREAD_SIZE, reg -- ++#define GET_THREAD_INFO_WITH_ESP(reg) GET_THREAD_INFO(reg) ++#else ++/* how to get the thread information struct from C */ ++DECLARE_PER_CPU(struct thread_info *, current_tinfo); ++ ++static __always_inline struct thread_info *current_thread_info(void) ++{ ++ return this_cpu_read_stable(current_tinfo); ++} ++#endif ++ ++#ifdef CONFIG_X86_32 ++ ++#define STACK_WARN (THREAD_SIZE/8) ++/* ++ * macros/functions for gaining access to the thread information structure ++ * ++ * preempt_count needs to be 1 initially, until the scheduler is functional. ++ */ ++#ifndef __ASSEMBLY__ ++ ++/* how to get the current stack pointer from C */ ++register unsigned long current_stack_pointer asm("esp") __used; + #endif #else /* X86_32 */ @@ -12681,14 +15582,14 @@ index ad6df8c..5e0cf6e 100644 /* * macros/functions for gaining access to the thread information structure * preempt_count needs to be 1 initially, until the scheduler is functional. -@@ -219,27 +212,8 @@ static inline struct thread_info *current_thread_info(void) +@@ -204,27 +195,8 @@ static inline struct thread_info *current_thread_info(void) #ifndef __ASSEMBLY__ DECLARE_PER_CPU(unsigned long, kernel_stack); -static inline struct thread_info *current_thread_info(void) -{ - struct thread_info *ti; -- ti = (void *)(percpu_read_stable(kernel_stack) + +- ti = (void *)(this_cpu_read_stable(kernel_stack) + - KERNEL_STACK_OFFSET - THREAD_SIZE); - return ti; -} @@ -12711,10 +15612,10 @@ index ad6df8c..5e0cf6e 100644 #endif #endif /* !X86_32 */ -@@ -285,5 +259,16 @@ extern void arch_task_cache_init(void); - extern void free_thread_info(struct thread_info *ti); +@@ -285,5 +257,12 @@ static inline bool is_ia32_task(void) + extern void arch_task_cache_init(void); extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); - #define arch_task_cache_init arch_task_cache_init + extern void arch_release_task_struct(struct task_struct *tsk); + +#define __HAVE_THREAD_FUNCTIONS +#define task_thread_info(task) (&(task)->tinfo) @@ -12722,33 +15623,21 @@ index ad6df8c..5e0cf6e 100644 +#define setup_thread_stack(p, org) do {} while (0) +#define end_of_stack(p) ((unsigned long *)task_stack_page(p) + 1) + -+#define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR -+extern struct task_struct *alloc_task_struct_node(int node); -+extern void free_task_struct(struct task_struct *); -+ #endif #endif /* _ASM_X86_THREAD_INFO_H */ diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h -index e054459..14bc8a7 100644 +index 5ee2687..70d5895 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h -@@ -7,12 +7,15 @@ +@@ -7,6 +7,7 @@ #include <linux/compiler.h> #include <linux/thread_info.h> #include <linux/string.h> +#include <linux/sched.h> #include <asm/asm.h> #include <asm/page.h> - - #define VERIFY_READ 0 - #define VERIFY_WRITE 1 - -+extern void check_object_size(const void *ptr, unsigned long n, bool to); -+ - /* - * The fs value determines whether argument validity checking should be - * performed or not. If get_fs() == USER_DS, checking is performed, with -@@ -28,7 +31,12 @@ + #include <asm/smap.h> +@@ -29,7 +30,12 @@ #define get_ds() (KERNEL_DS) #define get_fs() (current_thread_info()->addr_limit) @@ -12761,19 +15650,20 @@ index e054459..14bc8a7 100644 #define segment_eq(a, b) ((a).seg == (b).seg) -@@ -76,7 +84,33 @@ +@@ -77,8 +83,33 @@ * checks that the pointer is in the user space range - after calling * this function, memory access functions may still return -EFAULT. */ --#define access_ok(type, addr, size) (likely(__range_not_ok(addr, size) == 0)) -+#define __access_ok(type, addr, size) (likely(__range_not_ok(addr, size) == 0)) +-#define access_ok(type, addr, size) \ +- (likely(__range_not_ok(addr, size, user_addr_max()) == 0)) ++#define __access_ok(type, addr, size) (likely(__range_not_ok(addr, size, user_addr_max()) == 0)) +#define access_ok(type, addr, size) \ +({ \ + long __size = size; \ + unsigned long __addr = (unsigned long)addr; \ + unsigned long __addr_ao = __addr & PAGE_MASK; \ + unsigned long __end_ao = __addr + __size - 1; \ -+ bool __ret_ao = __range_not_ok(__addr, __size) == 0; \ ++ bool __ret_ao = __range_not_ok(__addr, __size, user_addr_max()) == 0;\ + if (__ret_ao && unlikely((__end_ao ^ __addr_ao) & PAGE_MASK)) { \ + while(__addr_ao <= __end_ao) { \ + char __c_ao; \ @@ -12795,8 +15685,8 @@ index e054459..14bc8a7 100644 +}) /* - * The exception table consists of pairs of addresses: the first is the -@@ -182,12 +216,20 @@ extern int __get_user_bad(void); + * The exception table consists of pairs of addresses relative to the +@@ -176,13 +207,21 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) asm volatile("call __put_user_" #size : "=a" (__ret_pu) \ : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") @@ -12813,25 +15703,26 @@ index e054459..14bc8a7 100644 #ifdef CONFIG_X86_32 #define __put_user_asm_u64(x, addr, err, errret) \ -- asm volatile("1: movl %%eax,0(%2)\n" \ + asm volatile(ASM_STAC "\n" \ +- "1: movl %%eax,0(%2)\n" \ - "2: movl %%edx,4(%2)\n" \ -+ asm volatile("1: "__copyuser_seg"movl %%eax,0(%2)\n" \ ++ "1: "__copyuser_seg"movl %%eax,0(%2)\n" \ + "2: "__copyuser_seg"movl %%edx,4(%2)\n" \ - "3:\n" \ + "3: " ASM_CLAC "\n" \ ".section .fixup,\"ax\"\n" \ "4: movl %3,%0\n" \ -@@ -199,8 +241,8 @@ extern int __get_user_bad(void); - : "A" (x), "r" (addr), "i" (errret), "0" (err)) +@@ -195,8 +234,8 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) #define __put_user_asm_ex_u64(x, addr) \ -- asm volatile("1: movl %%eax,0(%1)\n" \ + asm volatile(ASM_STAC "\n" \ +- "1: movl %%eax,0(%1)\n" \ - "2: movl %%edx,4(%1)\n" \ -+ asm volatile("1: "__copyuser_seg"movl %%eax,0(%1)\n" \ ++ "1: "__copyuser_seg"movl %%eax,0(%1)\n" \ + "2: "__copyuser_seg"movl %%edx,4(%1)\n" \ - "3:\n" \ - _ASM_EXTABLE(1b, 2b - 1b) \ - _ASM_EXTABLE(2b, 3b - 2b) \ -@@ -252,7 +294,7 @@ extern void __put_user_8(void); + "3: " ASM_CLAC "\n" \ + _ASM_EXTABLE_EX(1b, 2b) \ + _ASM_EXTABLE_EX(2b, 3b) \ +@@ -246,7 +285,7 @@ extern void __put_user_8(void); __typeof__(*(ptr)) __pu_val; \ __chk_user_ptr(ptr); \ might_fault(); \ @@ -12840,16 +15731,16 @@ index e054459..14bc8a7 100644 switch (sizeof(*(ptr))) { \ case 1: \ __put_user_x(1, __pu_val, ptr, __ret_pu); \ -@@ -373,7 +415,7 @@ do { \ - } while (0) +@@ -345,7 +384,7 @@ do { \ #define __get_user_asm(x, addr, err, itype, rtype, ltype, errret) \ -- asm volatile("1: mov"itype" %2,%"rtype"1\n" \ -+ asm volatile("1: "__copyuser_seg"mov"itype" %2,%"rtype"1\n"\ - "2:\n" \ + asm volatile(ASM_STAC "\n" \ +- "1: mov"itype" %2,%"rtype"1\n" \ ++ "1: "__copyuser_seg"mov"itype" %2,%"rtype"1\n"\ + "2: " ASM_CLAC "\n" \ ".section .fixup,\"ax\"\n" \ "3: mov %3,%0\n" \ -@@ -381,7 +423,7 @@ do { \ +@@ -353,7 +392,7 @@ do { \ " jmp 2b\n" \ ".previous\n" \ _ASM_EXTABLE(1b, 3b) \ @@ -12858,16 +15749,16 @@ index e054459..14bc8a7 100644 : "m" (__m(addr)), "i" (errret), "0" (err)) #define __get_user_size_ex(x, ptr, size) \ -@@ -406,7 +448,7 @@ do { \ +@@ -378,7 +417,7 @@ do { \ } while (0) #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \ - asm volatile("1: mov"itype" %1,%"rtype"0\n" \ + asm volatile("1: "__copyuser_seg"mov"itype" %1,%"rtype"0\n"\ "2:\n" \ - _ASM_EXTABLE(1b, 2b - 1b) \ + _ASM_EXTABLE_EX(1b, 2b) \ : ltype(x) : "m" (__m(addr))) -@@ -423,13 +465,24 @@ do { \ +@@ -395,13 +434,24 @@ do { \ int __gu_err; \ unsigned long __gu_val; \ __get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \ @@ -12883,9 +15774,9 @@ index e054459..14bc8a7 100644 +#define ____m(x) \ +({ \ + unsigned long ____x = (unsigned long)(x); \ -+ if (____x < PAX_USER_SHADOW_BASE) \ -+ ____x += PAX_USER_SHADOW_BASE; \ -+ (void __user *)____x; \ ++ if (____x < pax_user_shadow_base) \ ++ ____x += pax_user_shadow_base; \ ++ (typeof(x))____x; \ +}) +#else +#define ____m(x) (x) @@ -12894,16 +15785,16 @@ index e054459..14bc8a7 100644 /* * Tell gcc we read from memory instead of writing: this is because -@@ -437,7 +490,7 @@ struct __large_struct { unsigned long buf[100]; }; - * aliasing issues. +@@ -410,7 +460,7 @@ struct __large_struct { unsigned long buf[100]; }; */ #define __put_user_asm(x, addr, err, itype, rtype, ltype, errret) \ -- asm volatile("1: mov"itype" %"rtype"1,%2\n" \ -+ asm volatile("1: "__copyuser_seg"mov"itype" %"rtype"1,%2\n"\ - "2:\n" \ + asm volatile(ASM_STAC "\n" \ +- "1: mov"itype" %"rtype"1,%2\n" \ ++ "1: "__copyuser_seg"mov"itype" %"rtype"1,%2\n"\ + "2: " ASM_CLAC "\n" \ ".section .fixup,\"ax\"\n" \ "3: mov %3,%0\n" \ -@@ -445,10 +498,10 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -418,10 +468,10 @@ struct __large_struct { unsigned long buf[100]; }; ".previous\n" \ _ASM_EXTABLE(1b, 3b) \ : "=r"(err) \ @@ -12914,9 +15805,9 @@ index e054459..14bc8a7 100644 - asm volatile("1: mov"itype" %"rtype"0,%1\n" \ + asm volatile("1: "__copyuser_seg"mov"itype" %"rtype"0,%1\n"\ "2:\n" \ - _ASM_EXTABLE(1b, 2b - 1b) \ + _ASM_EXTABLE_EX(1b, 2b) \ : : ltype(x), "m" (__m(addr))) -@@ -487,8 +540,12 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -460,8 +510,12 @@ struct __large_struct { unsigned long buf[100]; }; * On error, the variable @x is set to zero. */ @@ -12929,7 +15820,7 @@ index e054459..14bc8a7 100644 /** * __put_user: - Write a simple value into user space, with less checking. -@@ -510,8 +567,12 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -483,8 +537,12 @@ struct __large_struct { unsigned long buf[100]; }; * Returns zero on success, or -EFAULT on error. */ @@ -12942,7 +15833,7 @@ index e054459..14bc8a7 100644 #define __get_user_unaligned __get_user #define __put_user_unaligned __put_user -@@ -529,7 +590,7 @@ struct __large_struct { unsigned long buf[100]; }; +@@ -502,7 +560,7 @@ struct __large_struct { unsigned long buf[100]; }; #define get_user_ex(x, ptr) do { \ unsigned long __gue_val; \ __get_user_size_ex((__gue_val), (ptr), (sizeof(*(ptr)))); \ @@ -12950,9 +15841,20 @@ index e054459..14bc8a7 100644 + (x) = (__typeof__(*(ptr)))__gue_val; \ } while (0) - #ifdef CONFIG_X86_WP_WORKS_OK + #define put_user_try uaccess_try +@@ -519,8 +577,8 @@ strncpy_from_user(char *dst, const char __user *src, long count); + extern __must_check long strlen_user(const char __user *str); + extern __must_check long strnlen_user(const char __user *str, long n); + +-unsigned long __must_check clear_user(void __user *mem, unsigned long len); +-unsigned long __must_check __clear_user(void __user *mem, unsigned long len); ++unsigned long __must_check clear_user(void __user *mem, unsigned long len) __size_overflow(2); ++unsigned long __must_check __clear_user(void __user *mem, unsigned long len) __size_overflow(2); + + /* + * movsl can be slow when source and dest are not both 8-byte aligned diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h -index 8084bc7..3d6ec37 100644 +index 7f760a9..04b1c65 100644 --- a/arch/x86/include/asm/uaccess_32.h +++ b/arch/x86/include/asm/uaccess_32.h @@ -11,15 +11,15 @@ @@ -12976,25 +15878,18 @@ index 8084bc7..3d6ec37 100644 /** * __copy_to_user_inatomic: - Copy a block of data into user space, with less checking. -@@ -43,6 +43,9 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero +@@ -43,6 +43,11 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero static __always_inline unsigned long __must_check __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n) { + if ((long)n < 0) + return n; + ++ check_object_size(from, n, true); ++ if (__builtin_constant_p(n)) { unsigned long ret; -@@ -61,6 +64,8 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n) - return ret; - } - } -+ if (!__builtin_constant_p(n)) -+ check_object_size(from, n, true); - return __copy_to_user_ll(to, from, n); - } - @@ -82,12 +87,16 @@ static __always_inline unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n) { @@ -13012,7 +15907,7 @@ index 8084bc7..3d6ec37 100644 /* Avoid zeroing the tail if the copy fails.. * If 'n' is constant and 1, 2, or 4, we do still zero on a failure, * but as the zeroing behaviour is only significant when n is not -@@ -137,6 +146,10 @@ static __always_inline unsigned long +@@ -137,6 +146,12 @@ static __always_inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) { might_fault(); @@ -13020,18 +15915,11 @@ index 8084bc7..3d6ec37 100644 + if ((long)n < 0) + return n; + ++ check_object_size(to, n, false); ++ if (__builtin_constant_p(n)) { unsigned long ret; -@@ -152,6 +165,8 @@ __copy_from_user(void *to, const void __user *from, unsigned long n) - return ret; - } - } -+ if (!__builtin_constant_p(n)) -+ check_object_size(to, n, false); - return __copy_from_user_ll(to, from, n); - } - @@ -159,6 +174,10 @@ static __always_inline unsigned long __copy_from_user_nocache(void *to, const void __user *from, unsigned long n) { @@ -13048,18 +15936,18 @@ index 8084bc7..3d6ec37 100644 unsigned long n) { - return __copy_from_user_ll_nocache_nozero(to, from, n); --} + if ((long)n < 0) + return n; ++ ++ return __copy_from_user_ll_nocache_nozero(to, from, n); + } -unsigned long __must_check copy_to_user(void __user *to, - const void *from, unsigned long n); -unsigned long __must_check _copy_from_user(void *to, - const void __user *from, - unsigned long n); -+ return __copy_from_user_ll_nocache_nozero(to, from, n); -+} - +- +extern void copy_to_user_overflow(void) +#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS + __compiletime_error("copy_to_user() buffer size is not provably correct") @@ -13070,7 +15958,7 @@ index 8084bc7..3d6ec37 100644 extern void copy_from_user_overflow(void) #ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS -@@ -199,17 +222,61 @@ extern void copy_from_user_overflow(void) +@@ -199,17 +222,60 @@ extern void copy_from_user_overflow(void) #endif ; @@ -13099,7 +15987,6 @@ index 8084bc7..3d6ec37 100644 - if (likely(sz == -1 || sz >= n)) - n = _copy_from_user(to, from, n); - else -- copy_from_user_overflow(); + if (unlikely(sz != (size_t)-1 && sz < n)) + copy_to_user_overflow(); + else if (access_ok(VERIFY_WRITE, to, n)) @@ -13127,31 +16014,21 @@ index 8084bc7..3d6ec37 100644 +copy_from_user(void *to, const void __user *from, unsigned long n) +{ + size_t sz = __compiletime_object_size(to); - ++ ++ check_object_size(to, n, false); ++ + if (unlikely(sz != (size_t)-1 && sz < n)) -+ copy_from_user_overflow(); + copy_from_user_overflow(); +- + else if (access_ok(VERIFY_READ, from, n)) + n = __copy_from_user(to, from, n); -+ else if ((long)n > 0) { -+ if (!__builtin_constant_p(n)) -+ check_object_size(to, n, false); ++ else if ((long)n > 0) + memset(to, 0, n); -+ } return n; } -@@ -230,7 +297,7 @@ static inline unsigned long __must_check copy_from_user(void *to, - #define strlen_user(str) strnlen_user(str, LONG_MAX) - - long strnlen_user(const char __user *str, long n); --unsigned long __must_check clear_user(void __user *mem, unsigned long len); --unsigned long __must_check __clear_user(void __user *mem, unsigned long len); -+unsigned long __must_check clear_user(void __user *mem, unsigned long len) __size_overflow(2); -+unsigned long __must_check __clear_user(void __user *mem, unsigned long len) __size_overflow(2); - - #endif /* _ASM_X86_UACCESS_32_H */ diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h -index fcd4b6f..835efe7 100644 +index 142810c..1f2a0a7 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h @@ -10,6 +10,9 @@ @@ -13164,24 +16041,25 @@ index fcd4b6f..835efe7 100644 /* * Copy To/From Userspace -@@ -17,12 +20,12 @@ +@@ -17,13 +20,13 @@ /* Handles exceptions in both to and from, but doesn't do access_ok */ __must_check unsigned long +-copy_user_enhanced_fast_string(void *to, const void *from, unsigned len); ++copy_user_enhanced_fast_string(void *to, const void *from, unsigned len) __size_overflow(3); + __must_check unsigned long -copy_user_generic_string(void *to, const void *from, unsigned len); -+copy_user_generic_string(void *to, const void *from, unsigned long len) __size_overflow(3); ++copy_user_generic_string(void *to, const void *from, unsigned len) __size_overflow(3); __must_check unsigned long -copy_user_generic_unrolled(void *to, const void *from, unsigned len); -+copy_user_generic_unrolled(void *to, const void *from, unsigned long len) __size_overflow(3); ++copy_user_generic_unrolled(void *to, const void *from, unsigned len) __size_overflow(3); -static __always_inline __must_check unsigned long --copy_user_generic(void *to, const void *from, unsigned len) -+static __always_inline __must_check __size_overflow(3) unsigned long -+copy_user_generic(void *to, const void *from, unsigned long len) ++static __always_inline __must_check __size_overflow(3) unsigned long + copy_user_generic(void *to, const void *from, unsigned len) { unsigned ret; - -@@ -32,142 +35,238 @@ copy_user_generic(void *to, const void *from, unsigned len) +@@ -41,142 +44,204 @@ copy_user_generic(void *to, const void *from, unsigned len) ASM_OUTPUT2("=a" (ret), "=D" (to), "=S" (from), "=d" (len)), "1" (to), "2" (from), "3" (len) @@ -13191,16 +16069,16 @@ index fcd4b6f..835efe7 100644 } +static __always_inline __must_check unsigned long -+__copy_to_user(void __user *to, const void *from, unsigned long len) __size_overflow(3); ++__copy_to_user(void __user *to, const void *from, unsigned long len); +static __always_inline __must_check unsigned long -+__copy_from_user(void *to, const void __user *from, unsigned long len) __size_overflow(3); ++__copy_from_user(void *to, const void __user *from, unsigned long len); __must_check unsigned long -_copy_to_user(void __user *to, const void *from, unsigned len); -__must_check unsigned long -_copy_from_user(void *to, const void __user *from, unsigned len); -__must_check unsigned long -copy_in_user(void __user *to, const void __user *from, unsigned len); -+copy_in_user(void __user *to, const void __user *from, unsigned long len) __size_overflow(3); ++copy_in_user(void __user *to, const void __user *from, unsigned long len); + +extern void copy_to_user_overflow(void) +#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS @@ -13232,13 +16110,12 @@ index fcd4b6f..835efe7 100644 - WARN(1, "Buffer overflow detected!\n"); -#endif + ++ check_object_size(to, n, false); ++ + if (access_ok(VERIFY_READ, from, n)) + n = __copy_from_user(to, from, n); -+ else if (n < INT_MAX) { -+ if (!__builtin_constant_p(n)) -+ check_object_size(to, n, false); ++ else if (n < INT_MAX) + memset(to, 0, n); -+ } return n; } @@ -13263,12 +16140,12 @@ index fcd4b6f..835efe7 100644 + unsigned ret = 0; might_fault(); -- if (!__builtin_constant_p(size)) -- return copy_user_generic(dst, (__force void *)src, size); + + if (size > INT_MAX) + return size; + ++ check_object_size(dst, size, false); ++ +#ifdef CONFIG_PAX_MEMORY_UDEREF + if (!__access_ok(VERIFY_READ, src, size)) + return size; @@ -13279,16 +16156,9 @@ index fcd4b6f..835efe7 100644 + return size; + } + -+ if (!__builtin_constant_p(size)) { -+ check_object_size(dst, size, false); -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)src < PAX_USER_SHADOW_BASE) -+ src += PAX_USER_SHADOW_BASE; -+#endif -+ -+ return copy_user_generic(dst, (__force_kernel const void *)src, size); -+ } + if (!__builtin_constant_p(size)) +- return copy_user_generic(dst, (__force void *)src, size); ++ return copy_user_generic(dst, (__force_kernel const void *)____m(src), size); switch (size) { - case 1:__get_user_asm(*(u8 *)dst, (u8 __user *)src, + case 1:__get_user_asm(*(u8 *)dst, (const u8 __user *)src, @@ -13330,13 +16200,7 @@ index fcd4b6f..835efe7 100644 return ret; default: - return copy_user_generic(dst, (__force void *)src, size); -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)src < PAX_USER_SHADOW_BASE) -+ src += PAX_USER_SHADOW_BASE; -+#endif -+ -+ return copy_user_generic(dst, (__force_kernel const void *)src, size); ++ return copy_user_generic(dst, (__force_kernel const void *)____m(src), size); } } @@ -13349,12 +16213,12 @@ index fcd4b6f..835efe7 100644 + unsigned ret = 0; might_fault(); -- if (!__builtin_constant_p(size)) -- return copy_user_generic((__force void *)dst, src, size); + + if (size > INT_MAX) + return size; + ++ check_object_size(src, size, true); ++ +#ifdef CONFIG_PAX_MEMORY_UDEREF + if (!__access_ok(VERIFY_WRITE, dst, size)) + return size; @@ -13365,16 +16229,9 @@ index fcd4b6f..835efe7 100644 + return size; + } + -+ if (!__builtin_constant_p(size)) { -+ check_object_size(src, size, true); -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)dst < PAX_USER_SHADOW_BASE) -+ dst += PAX_USER_SHADOW_BASE; -+#endif -+ -+ return copy_user_generic((__force_kernel void *)dst, src, size); -+ } + if (!__builtin_constant_p(size)) +- return copy_user_generic((__force void *)dst, src, size); ++ return copy_user_generic((__force_kernel void *)____m(dst), src, size); switch (size) { - case 1:__put_user_asm(*(u8 *)src, (u8 __user *)dst, + case 1:__put_user_asm(*(const u8 *)src, (u8 __user *)dst, @@ -13416,13 +16273,7 @@ index fcd4b6f..835efe7 100644 return ret; default: - return copy_user_generic((__force void *)dst, src, size); -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)dst < PAX_USER_SHADOW_BASE) -+ dst += PAX_USER_SHADOW_BASE; -+#endif -+ -+ return copy_user_generic((__force_kernel void *)dst, src, size); ++ return copy_user_generic((__force_kernel void *)____m(dst), src, size); } } @@ -13434,9 +16285,6 @@ index fcd4b6f..835efe7 100644 + unsigned ret = 0; might_fault(); -- if (!__builtin_constant_p(size)) -- return copy_user_generic((__force void *)dst, -- (__force void *)src, size); + + if (size > INT_MAX) + return size; @@ -13448,18 +16296,11 @@ index fcd4b6f..835efe7 100644 + return size; +#endif + -+ if (!__builtin_constant_p(size)) { -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)src < PAX_USER_SHADOW_BASE) -+ src += PAX_USER_SHADOW_BASE; -+ if ((unsigned long)dst < PAX_USER_SHADOW_BASE) -+ dst += PAX_USER_SHADOW_BASE; -+#endif -+ -+ return copy_user_generic((__force_kernel void *)dst, -+ (__force_kernel const void *)src, size); -+ } + if (!__builtin_constant_p(size)) +- return copy_user_generic((__force void *)dst, +- (__force void *)src, size); ++ return copy_user_generic((__force_kernel void *)____m(dst), ++ (__force_kernel const void *)____m(src), size); switch (size) { case 1: { u8 tmp; @@ -13468,7 +16309,7 @@ index fcd4b6f..835efe7 100644 ret, "b", "b", "=q", 1); if (likely(!ret)) __put_user_asm(tmp, (u8 __user *)dst, -@@ -176,7 +275,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +@@ -185,7 +250,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) } case 2: { u16 tmp; @@ -13477,7 +16318,7 @@ index fcd4b6f..835efe7 100644 ret, "w", "w", "=r", 2); if (likely(!ret)) __put_user_asm(tmp, (u16 __user *)dst, -@@ -186,7 +285,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +@@ -195,7 +260,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) case 4: { u32 tmp; @@ -13486,7 +16327,7 @@ index fcd4b6f..835efe7 100644 ret, "l", "k", "=r", 4); if (likely(!ret)) __put_user_asm(tmp, (u32 __user *)dst, -@@ -195,7 +294,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +@@ -204,7 +269,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) } case 8: { u64 tmp; @@ -13495,33 +16336,17 @@ index fcd4b6f..835efe7 100644 ret, "q", "", "=r", 8); if (likely(!ret)) __put_user_asm(tmp, (u64 __user *)dst, -@@ -203,47 +302,92 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) +@@ -212,41 +277,72 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) return ret; } default: - return copy_user_generic((__force void *)dst, - (__force void *)src, size); -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)src < PAX_USER_SHADOW_BASE) -+ src += PAX_USER_SHADOW_BASE; -+ if ((unsigned long)dst < PAX_USER_SHADOW_BASE) -+ dst += PAX_USER_SHADOW_BASE; -+#endif -+ -+ return copy_user_generic((__force_kernel void *)dst, -+ (__force_kernel const void *)src, size); ++ return copy_user_generic((__force_kernel void *)____m(dst), ++ (__force_kernel const void *)____m(src), size); } } - __must_check long strnlen_user(const char __user *str, long n); - __must_check long __strnlen_user(const char __user *str, long n); - __must_check long strlen_user(const char __user *str); --__must_check unsigned long clear_user(void __user *mem, unsigned long len); --__must_check unsigned long __clear_user(void __user *mem, unsigned long len); -+__must_check unsigned long clear_user(void __user *mem, unsigned long len) __size_overflow(2); -+__must_check unsigned long __clear_user(void __user *mem, unsigned long len) __size_overflow(2); - static __must_check __always_inline int -__copy_from_user_inatomic(void *dst, const void __user *src, unsigned size) +__copy_from_user_inatomic(void *dst, const void __user *src, unsigned long size) @@ -13533,12 +16358,9 @@ index fcd4b6f..835efe7 100644 +#ifdef CONFIG_PAX_MEMORY_UDEREF + if (!__access_ok(VERIFY_READ, src, size)) + return size; -+ -+ if ((unsigned long)src < PAX_USER_SHADOW_BASE) -+ src += PAX_USER_SHADOW_BASE; +#endif + -+ return copy_user_generic(dst, (__force_kernel const void *)src, size); ++ return copy_user_generic(dst, (__force_kernel const void *)____m(src), size); } -static __must_check __always_inline int @@ -13553,12 +16375,9 @@ index fcd4b6f..835efe7 100644 +#ifdef CONFIG_PAX_MEMORY_UDEREF + if (!__access_ok(VERIFY_WRITE, dst, size)) + return size; -+ -+ if ((unsigned long)dst < PAX_USER_SHADOW_BASE) -+ dst += PAX_USER_SHADOW_BASE; +#endif + -+ return copy_user_generic((__force_kernel void *)dst, src, size); ++ return copy_user_generic((__force_kernel void *)____m(dst), src, size); } -extern long __copy_user_nocache(void *dst, const void __user *src, @@ -13606,105 +16425,24 @@ index fcd4b6f..835efe7 100644 +copy_user_handle_tail(char __user *to, char __user *from, unsigned long len, unsigned zerorest) __size_overflow(3); #endif /* _ASM_X86_UACCESS_64_H */ -diff --git a/arch/x86/include/asm/vdso.h b/arch/x86/include/asm/vdso.h -index bb05228..d763d5b 100644 ---- a/arch/x86/include/asm/vdso.h -+++ b/arch/x86/include/asm/vdso.h -@@ -11,7 +11,7 @@ extern const char VDSO32_PRELINK[]; - #define VDSO32_SYMBOL(base, name) \ - ({ \ - extern const char VDSO32_##name[]; \ -- (void *)(VDSO32_##name - VDSO32_PRELINK + (unsigned long)(base)); \ -+ (void __user *)(VDSO32_##name - VDSO32_PRELINK + (unsigned long)(base)); \ - }) - #endif +diff --git a/arch/x86/include/asm/word-at-a-time.h b/arch/x86/include/asm/word-at-a-time.h +index 5b238981..77fdd78 100644 +--- a/arch/x86/include/asm/word-at-a-time.h ++++ b/arch/x86/include/asm/word-at-a-time.h +@@ -11,7 +11,7 @@ + * and shift, for example. + */ + struct word_at_a_time { +- const unsigned long one_bits, high_bits; ++ unsigned long one_bits, high_bits; + }; + #define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) } diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h -index 764b66a..ad3cfc8 100644 +index d8d9922..bf6cecb 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h -@@ -29,7 +29,7 @@ struct x86_init_mpparse { - void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name); - void (*find_smp_config)(void); - void (*get_smp_config)(unsigned int early); --}; -+} __no_const; - - /** - * struct x86_init_resources - platform specific resource related ops -@@ -43,7 +43,7 @@ struct x86_init_resources { - void (*probe_roms)(void); - void (*reserve_resources)(void); - char *(*memory_setup)(void); --}; -+} __no_const; - - /** - * struct x86_init_irqs - platform specific interrupt setup -@@ -56,7 +56,7 @@ struct x86_init_irqs { - void (*pre_vector_init)(void); - void (*intr_init)(void); - void (*trap_init)(void); --}; -+} __no_const; - - /** - * struct x86_init_oem - oem platform specific customizing functions -@@ -66,7 +66,7 @@ struct x86_init_irqs { - struct x86_init_oem { - void (*arch_setup)(void); - void (*banner)(void); --}; -+} __no_const; - - /** - * struct x86_init_mapping - platform specific initial kernel pagetable setup -@@ -77,7 +77,7 @@ struct x86_init_oem { - */ - struct x86_init_mapping { - void (*pagetable_reserve)(u64 start, u64 end); --}; -+} __no_const; - - /** - * struct x86_init_paging - platform specific paging functions -@@ -87,7 +87,7 @@ struct x86_init_mapping { - struct x86_init_paging { - void (*pagetable_setup_start)(pgd_t *base); - void (*pagetable_setup_done)(pgd_t *base); --}; -+} __no_const; - - /** - * struct x86_init_timers - platform specific timer setup -@@ -102,7 +102,7 @@ struct x86_init_timers { - void (*tsc_pre_init)(void); - void (*timer_init)(void); - void (*wallclock_init)(void); --}; -+} __no_const; - - /** - * struct x86_init_iommu - platform specific iommu setup -@@ -110,7 +110,7 @@ struct x86_init_timers { - */ - struct x86_init_iommu { - int (*iommu_init)(void); --}; -+} __no_const; - - /** - * struct x86_init_pci - platform specific pci init functions -@@ -124,7 +124,7 @@ struct x86_init_pci { - int (*init)(void); - void (*init_irq)(void); - void (*fixup_irqs)(void); --}; -+} __no_const; - - /** - * struct x86_init_ops - functions for platform specific setup -@@ -140,7 +140,7 @@ struct x86_init_ops { +@@ -129,7 +129,7 @@ struct x86_init_ops { struct x86_init_timers timers; struct x86_init_iommu iommu; struct x86_init_pci pci; @@ -13713,7 +16451,7 @@ index 764b66a..ad3cfc8 100644 /** * struct x86_cpuinit_ops - platform specific cpu hotplug setups -@@ -151,7 +151,7 @@ struct x86_cpuinit_ops { +@@ -140,7 +140,7 @@ struct x86_cpuinit_ops { void (*setup_percpu_clockev)(void); void (*early_percpu_clock_init)(void); void (*fixup_cpu_id)(struct cpuinfo_x86 *c, int node); @@ -13722,41 +16460,49 @@ index 764b66a..ad3cfc8 100644 /** * struct x86_platform_ops - platform specific runtime functions -@@ -177,7 +177,7 @@ struct x86_platform_ops { - int (*i8042_detect)(void); +@@ -166,7 +166,7 @@ struct x86_platform_ops { void (*save_sched_clock_state)(void); void (*restore_sched_clock_state)(void); + void (*apic_post_init)(void); -}; +} __no_const; struct pci_dev; - -@@ -186,7 +186,7 @@ struct x86_msi_ops { - void (*teardown_msi_irq)(unsigned int irq); + struct msi_msg; +@@ -180,7 +180,7 @@ struct x86_msi_ops { void (*teardown_msi_irqs)(struct pci_dev *dev); void (*restore_msi_irqs)(struct pci_dev *dev, int irq); + int (*setup_hpet_msi)(unsigned int irq, unsigned int id); +-}; ++} __no_const; + + struct IO_APIC_route_entry; + struct io_apic_irq_attr; +@@ -201,7 +201,7 @@ struct x86_io_apic_ops { + unsigned int destination, int vector, + struct io_apic_irq_attr *attr); + void (*eoi_ioapic_pin)(int apic, int pin, int vector); -}; +} __no_const; extern struct x86_init_ops x86_init; extern struct x86_cpuinit_ops x86_cpuinit; diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h -index c6ce245..ffbdab7 100644 +index 0415cda..b43d877 100644 --- a/arch/x86/include/asm/xsave.h +++ b/arch/x86/include/asm/xsave.h -@@ -65,6 +65,11 @@ static inline int xsave_user(struct xsave_struct __user *buf) - { - int err; +@@ -71,7 +71,9 @@ static inline int xsave_user(struct xsave_struct __user *buf) + return -EFAULT; -+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ if ((unsigned long)buf < PAX_USER_SHADOW_BASE) -+ buf = (struct xsave_struct __user *)((void __user*)buf + PAX_USER_SHADOW_BASE); -+#endif -+ - /* - * Clear the xsave header first, so that reserved fields are - * initialized to zero. -@@ -96,10 +101,15 @@ static inline int xsave_user(struct xsave_struct __user *buf) + __asm__ __volatile__(ASM_STAC "\n" +- "1: .byte " REX_PREFIX "0x0f,0xae,0x27\n" ++ "1:" ++ __copyuser_seg ++ ".byte " REX_PREFIX "0x0f,0xae,0x27\n" + "2: " ASM_CLAC "\n" + ".section .fixup,\"ax\"\n" + "3: movl $-1,%[err]\n" +@@ -87,12 +89,14 @@ static inline int xsave_user(struct xsave_struct __user *buf) static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask) { int err; @@ -13765,56 +16511,68 @@ index c6ce245..ffbdab7 100644 u32 lmask = mask; u32 hmask = mask >> 32; -+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ if ((unsigned long)xstate < PAX_USER_SHADOW_BASE) -+ xstate = (struct xsave_struct *)((void *)xstate + PAX_USER_SHADOW_BASE); -+#endif -+ - __asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n" - "2:\n" + __asm__ __volatile__(ASM_STAC "\n" +- "1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n" ++ "1:" ++ __copyuser_seg ++ ".byte " REX_PREFIX "0x0f,0xae,0x2f\n" + "2: " ASM_CLAC "\n" ".section .fixup,\"ax\"\n" -diff --git a/arch/x86/kernel/acpi/realmode/Makefile b/arch/x86/kernel/acpi/realmode/Makefile -index 6a564ac..9b1340c 100644 ---- a/arch/x86/kernel/acpi/realmode/Makefile -+++ b/arch/x86/kernel/acpi/realmode/Makefile -@@ -41,6 +41,9 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D_WAKEUP -D__KERNEL__ \ - $(call cc-option, -fno-stack-protector) \ - $(call cc-option, -mpreferred-stack-boundary=2) - KBUILD_CFLAGS += $(call cc-option, -m32) -+ifdef CONSTIFY_PLUGIN -+KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify -+endif - KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ - GCOV_PROFILE := n + "3: movl $-1,%[err]\n" +diff --git a/arch/x86/include/uapi/asm/e820.h b/arch/x86/include/uapi/asm/e820.h +index bbae024..e1528f9 100644 +--- a/arch/x86/include/uapi/asm/e820.h ++++ b/arch/x86/include/uapi/asm/e820.h +@@ -63,7 +63,7 @@ struct e820map { + #define ISA_START_ADDRESS 0xa0000 + #define ISA_END_ADDRESS 0x100000 -diff --git a/arch/x86/kernel/acpi/realmode/wakeup.S b/arch/x86/kernel/acpi/realmode/wakeup.S -index b4fd836..4358fe3 100644 ---- a/arch/x86/kernel/acpi/realmode/wakeup.S -+++ b/arch/x86/kernel/acpi/realmode/wakeup.S -@@ -108,6 +108,9 @@ wakeup_code: - /* Do any other stuff... */ +-#define BIOS_BEGIN 0x000a0000 ++#define BIOS_BEGIN 0x000c0000 + #define BIOS_END 0x00100000 - #ifndef CONFIG_64BIT -+ /* Recheck NX bit overrides (64bit path does this in trampoline */ -+ call verify_cpu -+ - /* This could also be done in C code... */ - movl pmode_cr3, %eax - movl %eax, %cr3 -@@ -131,6 +134,7 @@ wakeup_code: - movl pmode_cr0, %eax - movl %eax, %cr0 - jmp pmode_return -+# include "../../verify_cpu.S" - #else - pushw $0 - pushw trampoline_segment + #define BIOS_ROM_BASE 0xffe00000 +diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile +index 7bd3bd3..5dac791 100644 +--- a/arch/x86/kernel/Makefile ++++ b/arch/x86/kernel/Makefile +@@ -22,7 +22,7 @@ obj-y += time.o ioport.o ldt.o dumpstack.o nmi.o + obj-y += setup.o x86_init.o i8259.o irqinit.o jump_label.o + obj-$(CONFIG_IRQ_WORK) += irq_work.o + obj-y += probe_roms.o +-obj-$(CONFIG_X86_32) += i386_ksyms_32.o ++obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o + obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o + obj-y += syscall_$(BITS).o + obj-$(CONFIG_X86_64) += vsyscall_64.o +diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c +index 230c8ea..f915130 100644 +--- a/arch/x86/kernel/acpi/boot.c ++++ b/arch/x86/kernel/acpi/boot.c +@@ -1361,7 +1361,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) + * If your system is blacklisted here, but you find that acpi=force + * works for you, please contact linux-acpi@vger.kernel.org + */ +-static struct dmi_system_id __initdata acpi_dmi_table[] = { ++static const struct dmi_system_id __initconst acpi_dmi_table[] = { + /* + * Boxes that need ACPI disabled + */ +@@ -1436,7 +1436,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { + }; + + /* second table for DMI checks that should run after early-quirks */ +-static struct dmi_system_id __initdata acpi_dmi_table_late[] = { ++static const struct dmi_system_id __initconst acpi_dmi_table_late[] = { + /* + * HP laptops which use a DSDT reporting as HP/SB400/10000, + * which includes some code which overrides all temperature diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c -index 146a49c..1b5338b 100644 +index 0532f5d..36afc0a 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c -@@ -98,8 +98,12 @@ int acpi_suspend_lowlevel(void) - header->trampoline_segment = trampoline_address() >> 4; +@@ -74,8 +74,12 @@ int acpi_suspend_lowlevel(void) + #else /* CONFIG_64BIT */ #ifdef CONFIG_SMP stack_start = (unsigned long)temp_stack + sizeof(temp_stack); + @@ -13827,7 +16585,7 @@ index 146a49c..1b5338b 100644 #endif initial_code = (unsigned long)wakeup_long64; diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S -index 7261083..5c12053 100644 +index 13ab720..95d5442 100644 --- a/arch/x86/kernel/acpi/wakeup_32.S +++ b/arch/x86/kernel/acpi/wakeup_32.S @@ -30,13 +30,11 @@ wakeup_pmode_return: @@ -13847,10 +16605,10 @@ index 7261083..5c12053 100644 bogus_magic: jmp bogus_magic diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c -index 73ef56c..0238021 100644 +index ef5ccca..bd83949 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c -@@ -276,6 +276,13 @@ void __init_or_module apply_alternatives(struct alt_instr *start, +@@ -268,6 +268,13 @@ void __init_or_module apply_alternatives(struct alt_instr *start, */ for (a = start; a < end; a++) { instr = (u8 *)&a->instr_offset + a->instr_offset; @@ -13864,7 +16622,7 @@ index 73ef56c..0238021 100644 replacement = (u8 *)&a->repl_offset + a->repl_offset; BUG_ON(a->replacementlen > a->instrlen); BUG_ON(a->instrlen > sizeof(insnbuf)); -@@ -307,10 +314,16 @@ static void alternatives_smp_lock(const s32 *start, const s32 *end, +@@ -299,10 +306,16 @@ static void alternatives_smp_lock(const s32 *start, const s32 *end, for (poff = start; poff < end; poff++) { u8 *ptr = (u8 *)poff + *poff; @@ -13880,9 +16638,9 @@ index 73ef56c..0238021 100644 - if (*ptr == 0x3e) + if (*ktla_ktva(ptr) == 0x3e) text_poke(ptr, ((unsigned char []){0xf0}), 1); - }; + } mutex_unlock(&text_mutex); -@@ -328,10 +341,16 @@ static void alternatives_smp_unlock(const s32 *start, const s32 *end, +@@ -317,10 +330,16 @@ static void alternatives_smp_unlock(const s32 *start, const s32 *end, for (poff = start; poff < end; poff++) { u8 *ptr = (u8 *)poff + *poff; @@ -13898,9 +16656,9 @@ index 73ef56c..0238021 100644 - if (*ptr == 0xf0) + if (*ktla_ktva(ptr) == 0xf0) text_poke(ptr, ((unsigned char []){0x3E}), 1); - }; + } mutex_unlock(&text_mutex); -@@ -500,7 +519,7 @@ void __init_or_module apply_paravirt(struct paravirt_patch_site *start, +@@ -468,7 +487,7 @@ void __init_or_module apply_paravirt(struct paravirt_patch_site *start, BUG_ON(p->len > MAX_PATCH_LEN); /* prep the buffer with the original instructions */ @@ -13909,16 +16667,16 @@ index 73ef56c..0238021 100644 used = pv_init_ops.patch(p->instrtype, p->clobbers, insnbuf, (unsigned long)p->instr, p->len); -@@ -568,7 +587,7 @@ void __init alternative_instructions(void) - if (smp_alt_once) +@@ -515,7 +534,7 @@ void __init alternative_instructions(void) + if (!uniproc_patched || num_possible_cpus() == 1) free_init_pages("SMP alternatives", (unsigned long)__smp_locks, - (unsigned long)__smp_locks_end); + PAGE_ALIGN((unsigned long)__smp_locks_end)); + #endif - restart_nmi(); - } -@@ -585,13 +604,17 @@ void __init alternative_instructions(void) + apply_paravirt(__parainstructions, __parainstructions_end); +@@ -535,13 +554,17 @@ void __init alternative_instructions(void) * instructions. And on the local CPU you need to be protected again NMI or MCE * handlers seeing an inconsistent instruction while you patch. */ @@ -13938,7 +16696,7 @@ index 73ef56c..0238021 100644 local_irq_restore(flags); /* Could also do a CLFLUSH here to speed up CPU recovery; but that causes hangs on some VIA CPUs. */ -@@ -613,36 +636,22 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, +@@ -563,36 +586,22 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, */ void *__kprobes text_poke(void *addr, const void *opcode, size_t len) { @@ -13984,10 +16742,10 @@ index 73ef56c..0238021 100644 } diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c -index edc2448..553e7c5 100644 +index 904611b..004dde6 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c -@@ -184,7 +184,7 @@ int first_system_vector = 0xfe; +@@ -189,7 +189,7 @@ int first_system_vector = 0xfe; /* * Debug level, exported for io_apic.c */ @@ -13996,7 +16754,7 @@ index edc2448..553e7c5 100644 int pic_mode; -@@ -1917,7 +1917,7 @@ void smp_error_interrupt(struct pt_regs *regs) +@@ -1955,7 +1955,7 @@ void smp_error_interrupt(struct pt_regs *regs) apic_write(APIC_ESR, 0); v1 = apic_read(APIC_ESR); ack_APIC_irq(); @@ -14005,22 +16763,82 @@ index edc2448..553e7c5 100644 apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x(%02x)", smp_processor_id(), v0 , v1); -diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c -index e88300d..cd5a87a 100644 ---- a/arch/x86/kernel/apic/io_apic.c -+++ b/arch/x86/kernel/apic/io_apic.c -@@ -83,7 +83,9 @@ static struct io_apic_ops io_apic_ops = { +diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c +index 00c77cf..2dc6a2d 100644 +--- a/arch/x86/kernel/apic/apic_flat_64.c ++++ b/arch/x86/kernel/apic/apic_flat_64.c +@@ -157,7 +157,7 @@ static int flat_probe(void) + return 1; + } - void __init set_io_apic_ops(const struct io_apic_ops *ops) - { -- io_apic_ops = *ops; -+ pax_open_kernel(); -+ memcpy((void*)&io_apic_ops, ops, sizeof io_apic_ops); -+ pax_close_kernel(); +-static struct apic apic_flat = { ++static struct apic apic_flat __read_only = { + .name = "flat", + .probe = flat_probe, + .acpi_madt_oem_check = flat_acpi_madt_oem_check, +@@ -271,7 +271,7 @@ static int physflat_probe(void) + return 0; } - /* -@@ -1135,7 +1137,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin, +-static struct apic apic_physflat = { ++static struct apic apic_physflat __read_only = { + + .name = "physical flat", + .probe = physflat_probe, +diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c +index e145f28..2752888 100644 +--- a/arch/x86/kernel/apic/apic_noop.c ++++ b/arch/x86/kernel/apic/apic_noop.c +@@ -119,7 +119,7 @@ static void noop_apic_write(u32 reg, u32 v) + WARN_ON_ONCE(cpu_has_apic && !disable_apic); + } + +-struct apic apic_noop = { ++struct apic apic_noop __read_only = { + .name = "noop", + .probe = noop_probe, + .acpi_madt_oem_check = NULL, +diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c +index d50e364..543bee3 100644 +--- a/arch/x86/kernel/apic/bigsmp_32.c ++++ b/arch/x86/kernel/apic/bigsmp_32.c +@@ -152,7 +152,7 @@ static int probe_bigsmp(void) + return dmi_bigsmp; + } + +-static struct apic apic_bigsmp = { ++static struct apic apic_bigsmp __read_only = { + + .name = "bigsmp", + .probe = probe_bigsmp, +diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c +index 0874799..a7a7892 100644 +--- a/arch/x86/kernel/apic/es7000_32.c ++++ b/arch/x86/kernel/apic/es7000_32.c +@@ -608,8 +608,7 @@ static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem, + return ret && es7000_apic_is_cluster(); + } + +-/* We've been warned by a false positive warning.Use __refdata to keep calm. */ +-static struct apic __refdata apic_es7000_cluster = { ++static struct apic apic_es7000_cluster __read_only = { + + .name = "es7000", + .probe = probe_es7000, +@@ -675,7 +674,7 @@ static struct apic __refdata apic_es7000_cluster = { + .x86_32_early_logical_apicid = es7000_early_logical_apicid, + }; + +-static struct apic __refdata apic_es7000 = { ++static struct apic apic_es7000 __read_only = { + + .name = "es7000", + .probe = probe_es7000, +diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c +index 9ed796c..e930fe4 100644 +--- a/arch/x86/kernel/apic/io_apic.c ++++ b/arch/x86/kernel/apic/io_apic.c +@@ -1060,7 +1060,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin, } EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector); @@ -14029,7 +16847,7 @@ index e88300d..cd5a87a 100644 { /* Used to the online set of cpus does not change * during assign_irq_vector. -@@ -1143,7 +1145,7 @@ void lock_vector_lock(void) +@@ -1068,7 +1068,7 @@ void lock_vector_lock(void) raw_spin_lock(&vector_lock); } @@ -14038,7 +16856,7 @@ index e88300d..cd5a87a 100644 { raw_spin_unlock(&vector_lock); } -@@ -2549,7 +2551,7 @@ static void ack_apic_edge(struct irq_data *data) +@@ -2362,7 +2362,7 @@ static void ack_apic_edge(struct irq_data *data) ack_APIC_irq(); } @@ -14046,8 +16864,8 @@ index e88300d..cd5a87a 100644 +atomic_unchecked_t irq_mis_count; #ifdef CONFIG_GENERIC_PENDING_IRQ - static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg) -@@ -2667,7 +2669,7 @@ static void ack_apic_level(struct irq_data *data) + static bool io_apic_level_ack_pending(struct irq_cfg *cfg) +@@ -2503,7 +2503,7 @@ static void ack_apic_level(struct irq_data *data) * at the cpu. */ if (!(v & (1 << (i & 0x1f)))) { @@ -14056,11 +16874,99 @@ index e88300d..cd5a87a 100644 eoi_ioapic_irq(irq, cfg); } +diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c +index d661ee9..791fd33 100644 +--- a/arch/x86/kernel/apic/numaq_32.c ++++ b/arch/x86/kernel/apic/numaq_32.c +@@ -455,8 +455,7 @@ static void numaq_setup_portio_remap(void) + (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD); + } + +-/* Use __refdata to keep false positive warning calm. */ +-static struct apic __refdata apic_numaq = { ++static struct apic apic_numaq __read_only = { + + .name = "NUMAQ", + .probe = probe_numaq, +diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c +index eb35ef9..f184a21 100644 +--- a/arch/x86/kernel/apic/probe_32.c ++++ b/arch/x86/kernel/apic/probe_32.c +@@ -72,7 +72,7 @@ static int probe_default(void) + return 1; + } + +-static struct apic apic_default = { ++static struct apic apic_default __read_only = { + + .name = "default", + .probe = probe_default, +diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c +index 77c95c0..434f8a4 100644 +--- a/arch/x86/kernel/apic/summit_32.c ++++ b/arch/x86/kernel/apic/summit_32.c +@@ -486,7 +486,7 @@ void setup_summit(void) + } + #endif + +-static struct apic apic_summit = { ++static struct apic apic_summit __read_only = { + + .name = "summit", + .probe = probe_summit, +diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c +index c88baa4..757aee1 100644 +--- a/arch/x86/kernel/apic/x2apic_cluster.c ++++ b/arch/x86/kernel/apic/x2apic_cluster.c +@@ -183,7 +183,7 @@ update_clusterinfo(struct notifier_block *nfb, unsigned long action, void *hcpu) + return notifier_from_errno(err); + } + +-static struct notifier_block __refdata x2apic_cpu_notifier = { ++static struct notifier_block x2apic_cpu_notifier = { + .notifier_call = update_clusterinfo, + }; + +@@ -235,7 +235,7 @@ static void cluster_vector_allocation_domain(int cpu, struct cpumask *retmask, + cpumask_and(retmask, mask, per_cpu(cpus_in_cluster, cpu)); + } + +-static struct apic apic_x2apic_cluster = { ++static struct apic apic_x2apic_cluster __read_only = { + + .name = "cluster x2apic", + .probe = x2apic_cluster_probe, +diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c +index 562a76d..a003c0f 100644 +--- a/arch/x86/kernel/apic/x2apic_phys.c ++++ b/arch/x86/kernel/apic/x2apic_phys.c +@@ -89,7 +89,7 @@ static int x2apic_phys_probe(void) + return apic == &apic_x2apic_phys; + } + +-static struct apic apic_x2apic_phys = { ++static struct apic apic_x2apic_phys __read_only = { + + .name = "physical x2apic", + .probe = x2apic_phys_probe, +diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c +index 794f6eb..67e1db2 100644 +--- a/arch/x86/kernel/apic/x2apic_uv_x.c ++++ b/arch/x86/kernel/apic/x2apic_uv_x.c +@@ -342,7 +342,7 @@ static int uv_probe(void) + return apic == &apic_x2apic_uv_x; + } + +-static struct apic __refdata apic_x2apic_uv_x = { ++static struct apic apic_x2apic_uv_x __read_only = { + + .name = "UV large system", + .probe = uv_probe, diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c -index 459e78c..f037006 100644 +index 66b5faf..3442423 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c -@@ -410,7 +410,7 @@ static DEFINE_MUTEX(apm_mutex); +@@ -434,7 +434,7 @@ static DEFINE_MUTEX(apm_mutex); * This is for buggy BIOS's that refer to (real mode) segment 0x40 * even though they are called in protected mode. */ @@ -14069,7 +16975,7 @@ index 459e78c..f037006 100644 (unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1); static const char driver_version[] = "1.16ac"; /* no spaces */ -@@ -588,7 +588,10 @@ static long __apm_bios_call(void *_call) +@@ -612,7 +612,10 @@ static long __apm_bios_call(void *_call) BUG_ON(cpu != 0); gdt = get_cpu_gdt_table(cpu); save_desc_40 = gdt[0x40 / 8]; @@ -14080,7 +16986,7 @@ index 459e78c..f037006 100644 apm_irq_save(flags); APM_DO_SAVE_SEGS; -@@ -597,7 +600,11 @@ static long __apm_bios_call(void *_call) +@@ -621,7 +624,11 @@ static long __apm_bios_call(void *_call) &call->esi); APM_DO_RESTORE_SEGS; apm_irq_restore(flags); @@ -14092,7 +16998,7 @@ index 459e78c..f037006 100644 put_cpu(); return call->eax & 0xff; -@@ -664,7 +671,10 @@ static long __apm_bios_call_simple(void *_call) +@@ -688,7 +695,10 @@ static long __apm_bios_call_simple(void *_call) BUG_ON(cpu != 0); gdt = get_cpu_gdt_table(cpu); save_desc_40 = gdt[0x40 / 8]; @@ -14103,7 +17009,7 @@ index 459e78c..f037006 100644 apm_irq_save(flags); APM_DO_SAVE_SEGS; -@@ -672,7 +682,11 @@ static long __apm_bios_call_simple(void *_call) +@@ -696,7 +706,11 @@ static long __apm_bios_call_simple(void *_call) &call->eax); APM_DO_RESTORE_SEGS; apm_irq_restore(flags); @@ -14115,7 +17021,7 @@ index 459e78c..f037006 100644 put_cpu(); return error; } -@@ -2345,12 +2359,15 @@ static int __init apm_init(void) +@@ -2363,12 +2377,15 @@ static int __init apm_init(void) * code to that CPU. */ gdt = get_cpu_gdt_table(0); @@ -14132,7 +17038,7 @@ index 459e78c..f037006 100644 proc_create("apm", 0, NULL, &apm_file_ops); diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c -index 68de2dc..1f3c720 100644 +index 2861082..6d4718e 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c @@ -33,6 +33,8 @@ void common(void) { @@ -14151,16 +17057,16 @@ index 68de2dc..1f3c720 100644 + +#ifdef CONFIG_PAX_KERNEXEC + OFFSET(PV_CPU_write_cr0, pv_cpu_ops, write_cr0); -+#endif -+ + #endif + +#ifdef CONFIG_PAX_MEMORY_UDEREF + OFFSET(PV_MMU_read_cr3, pv_mmu_ops, read_cr3); + OFFSET(PV_MMU_write_cr3, pv_mmu_ops, write_cr3); +#ifdef CONFIG_X86_64 + OFFSET(PV_MMU_set_pgd_batched, pv_mmu_ops, set_pgd_batched); +#endif - #endif - ++#endif ++ +#endif + + BLANK(); @@ -14184,7 +17090,7 @@ index 1b4754f..fbb4227 100644 BLANK(); diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile -index 6ab6aa2..8f71507 100644 +index a0e067d..9c7db16 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile @@ -8,10 +8,6 @@ CFLAGS_REMOVE_common.o = -pg @@ -14197,12 +17103,12 @@ index 6ab6aa2..8f71507 100644 - obj-y := intel_cacheinfo.o scattered.o topology.o obj-y += proc.o capflags.o powerflags.o common.o - obj-y += vmware.o hypervisor.o sched.o mshyperv.o + obj-y += vmware.o hypervisor.o mshyperv.o diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c -index 146bb62..ac9c74a 100644 +index fa96eb0..03efe73 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c -@@ -691,7 +691,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c, +@@ -737,7 +737,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c, unsigned int size) { /* AMD errata T13 (order #21922) */ @@ -14212,10 +17118,10 @@ index 146bb62..ac9c74a 100644 if (c->x86_model == 3 && c->x86_mask == 0) size = 64; diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c -index cf79302..b1b28ae 100644 +index d814772..c615653 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c -@@ -86,60 +86,6 @@ static const struct cpu_dev __cpuinitconst default_cpu = { +@@ -88,60 +88,6 @@ static const struct cpu_dev __cpuinitconst default_cpu = { static const struct cpu_dev *this_cpu __cpuinitdata = &default_cpu; @@ -14276,7 +17182,7 @@ index cf79302..b1b28ae 100644 static int __init x86_xsave_setup(char *s) { setup_clear_cpu_cap(X86_FEATURE_XSAVE); -@@ -374,7 +320,7 @@ void switch_to_new_gdt(int cpu) +@@ -386,7 +332,7 @@ void switch_to_new_gdt(int cpu) { struct desc_ptr gdt_descr; @@ -14285,7 +17191,7 @@ index cf79302..b1b28ae 100644 gdt_descr.size = GDT_SIZE - 1; load_gdt(&gdt_descr); /* Reload the per-cpu base */ -@@ -841,6 +787,10 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) +@@ -882,6 +828,10 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) /* Filter out anything that depends on CPUID levels we don't have */ filter_cpuid_features(c, true); @@ -14296,7 +17202,7 @@ index cf79302..b1b28ae 100644 /* If the model name is still unset, do table lookup. */ if (!c->x86_model_id[0]) { const char *p; -@@ -1021,10 +971,12 @@ static __init int setup_disablecpuid(char *arg) +@@ -1065,10 +1015,12 @@ static __init int setup_disablecpuid(char *arg) } __setup("clearcpuid=", setup_disablecpuid); @@ -14311,7 +17217,7 @@ index cf79302..b1b28ae 100644 DEFINE_PER_CPU_FIRST(union irq_stack_union, irq_stack_union) __aligned(PAGE_SIZE); -@@ -1038,7 +990,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned = +@@ -1082,7 +1034,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned = EXPORT_PER_CPU_SYMBOL(current_task); DEFINE_PER_CPU(unsigned long, kernel_stack) = @@ -14320,17 +17226,8 @@ index cf79302..b1b28ae 100644 EXPORT_PER_CPU_SYMBOL(kernel_stack); DEFINE_PER_CPU(char *, irq_stack_ptr) = -@@ -1126,7 +1078,7 @@ struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs) - { - memset(regs, 0, sizeof(struct pt_regs)); - regs->fs = __KERNEL_PERCPU; -- regs->gs = __KERNEL_STACK_CANARY; -+ savesegment(gs, regs->gs); - - return regs; - } -@@ -1181,7 +1133,7 @@ void __cpuinit cpu_init(void) - int i; +@@ -1227,7 +1179,7 @@ void __cpuinit cpu_init(void) + load_ucode_ap(); cpu = stack_smp_processor_id(); - t = &per_cpu(init_tss, cpu); @@ -14338,7 +17235,7 @@ index cf79302..b1b28ae 100644 oist = &per_cpu(orig_ist, cpu); #ifdef CONFIG_NUMA -@@ -1207,7 +1159,7 @@ void __cpuinit cpu_init(void) +@@ -1253,7 +1205,7 @@ void __cpuinit cpu_init(void) switch_to_new_gdt(cpu); loadsegment(fs, 0); @@ -14347,15 +17244,15 @@ index cf79302..b1b28ae 100644 memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8); syscall_init(); -@@ -1216,7 +1168,6 @@ void __cpuinit cpu_init(void) +@@ -1262,7 +1214,6 @@ void __cpuinit cpu_init(void) wrmsrl(MSR_KERNEL_GS_BASE, 0); barrier(); - x86_configure_nx(); - if (cpu != 0) - enable_x2apic(); + enable_x2apic(); -@@ -1272,7 +1223,7 @@ void __cpuinit cpu_init(void) + /* +@@ -1314,7 +1265,7 @@ void __cpuinit cpu_init(void) { int cpu = smp_processor_id(); struct task_struct *curr = current; @@ -14363,12 +17260,12 @@ index cf79302..b1b28ae 100644 + struct tss_struct *t = init_tss + cpu; struct thread_struct *thread = &curr->thread; - if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) { + show_ucode_info_early(); diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c -index 3e6ff6c..54b4992 100644 +index 1905ce9..a7ac587 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c -@@ -174,7 +174,7 @@ static void __cpuinit trap_init_f00f_bug(void) +@@ -173,7 +173,7 @@ static void __cpuinit trap_init_f00f_bug(void) * Update the IDT descriptor and reload the IDT so that * it uses the read-only mapped virtual address. */ @@ -14377,11 +17274,111 @@ index 3e6ff6c..54b4992 100644 load_idt(&idt_descr); } #endif +diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c +index 7c6f7d5..8cac382 100644 +--- a/arch/x86/kernel/cpu/intel_cacheinfo.c ++++ b/arch/x86/kernel/cpu/intel_cacheinfo.c +@@ -1017,6 +1017,22 @@ static struct attribute *default_attrs[] = { + }; + + #ifdef CONFIG_AMD_NB ++static struct attribute *default_attrs_amd_nb[] = { ++ &type.attr, ++ &level.attr, ++ &coherency_line_size.attr, ++ &physical_line_partition.attr, ++ &ways_of_associativity.attr, ++ &number_of_sets.attr, ++ &size.attr, ++ &shared_cpu_map.attr, ++ &shared_cpu_list.attr, ++ NULL, ++ NULL, ++ NULL, ++ NULL ++}; ++ + static struct attribute ** __cpuinit amd_l3_attrs(void) + { + static struct attribute **attrs; +@@ -1027,18 +1043,7 @@ static struct attribute ** __cpuinit amd_l3_attrs(void) + + n = ARRAY_SIZE(default_attrs); + +- if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) +- n += 2; +- +- if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING)) +- n += 1; +- +- attrs = kzalloc(n * sizeof (struct attribute *), GFP_KERNEL); +- if (attrs == NULL) +- return attrs = default_attrs; +- +- for (n = 0; default_attrs[n]; n++) +- attrs[n] = default_attrs[n]; ++ attrs = default_attrs_amd_nb; + + if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE)) { + attrs[n++] = &cache_disable_0.attr; +@@ -1089,6 +1094,13 @@ static struct kobj_type ktype_cache = { + .default_attrs = default_attrs, + }; + ++#ifdef CONFIG_AMD_NB ++static struct kobj_type ktype_cache_amd_nb = { ++ .sysfs_ops = &sysfs_ops, ++ .default_attrs = default_attrs_amd_nb, ++}; ++#endif ++ + static struct kobj_type ktype_percpu_entry = { + .sysfs_ops = &sysfs_ops, + }; +@@ -1154,20 +1166,26 @@ static int __cpuinit cache_add_dev(struct device *dev) + return retval; + } + ++#ifdef CONFIG_AMD_NB ++ amd_l3_attrs(); ++#endif ++ + for (i = 0; i < num_cache_leaves; i++) { ++ struct kobj_type *ktype; ++ + this_object = INDEX_KOBJECT_PTR(cpu, i); + this_object->cpu = cpu; + this_object->index = i; + + this_leaf = CPUID4_INFO_IDX(cpu, i); + +- ktype_cache.default_attrs = default_attrs; ++ ktype = &ktype_cache; + #ifdef CONFIG_AMD_NB + if (this_leaf->base.nb) +- ktype_cache.default_attrs = amd_l3_attrs(); ++ ktype = &ktype_cache_amd_nb; + #endif + retval = kobject_init_and_add(&(this_object->kobj), +- &ktype_cache, ++ ktype, + per_cpu(ici_cache_kobject, cpu), + "index%1lu", i); + if (unlikely(retval)) { +@@ -1222,7 +1240,7 @@ static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata cacheinfo_cpu_notifier = { ++static struct notifier_block cacheinfo_cpu_notifier = { + .notifier_call = cacheinfo_cpu_callback, + }; + diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c -index 0d2db0e..7c1fb04 100644 +index 7bc1263..ce2cbfb 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c -@@ -42,6 +42,7 @@ +@@ -45,6 +45,7 @@ #include <asm/processor.h> #include <asm/mce.h> #include <asm/msr.h> @@ -14389,7 +17386,7 @@ index 0d2db0e..7c1fb04 100644 #include "mce-internal.h" -@@ -250,7 +251,7 @@ static void print_mce(struct mce *m) +@@ -246,7 +247,7 @@ static void print_mce(struct mce *m) !(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "", m->cs, m->ip); @@ -14398,7 +17395,7 @@ index 0d2db0e..7c1fb04 100644 print_symbol("{%s}", m->ip); pr_cont("\n"); } -@@ -283,10 +284,10 @@ static void print_mce(struct mce *m) +@@ -279,10 +280,10 @@ static void print_mce(struct mce *m) #define PANIC_TIMEOUT 5 /* 5 seconds */ @@ -14411,7 +17408,7 @@ index 0d2db0e..7c1fb04 100644 /* Panic in progress. Enable interrupts and wait for final IPI */ static void wait_for_panic(void) -@@ -310,7 +311,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp) +@@ -306,7 +307,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp) /* * Make sure only one CPU runs in machine check panic */ @@ -14420,7 +17417,7 @@ index 0d2db0e..7c1fb04 100644 wait_for_panic(); barrier(); -@@ -318,7 +319,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp) +@@ -314,7 +315,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp) console_verbose(); } else { /* Don't log too much for fake panic */ @@ -14429,16 +17426,16 @@ index 0d2db0e..7c1fb04 100644 return; } /* First print corrected ones that are still unlogged */ -@@ -684,7 +685,7 @@ static int mce_timed_out(u64 *t) +@@ -683,7 +684,7 @@ static int mce_timed_out(u64 *t) * might have been modified by someone else. */ rmb(); - if (atomic_read(&mce_paniced)) + if (atomic_read_unchecked(&mce_paniced)) wait_for_panic(); - if (!monarch_timeout) + if (!mca_cfg.monarch_timeout) goto out; -@@ -1537,7 +1538,7 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code) +@@ -1654,7 +1655,7 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code) } /* Call the installed machine check handler for this CPU setup. */ @@ -14447,7 +17444,7 @@ index 0d2db0e..7c1fb04 100644 unexpected_machine_check; /* -@@ -1560,7 +1561,9 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c) +@@ -1677,7 +1678,9 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c) return; } @@ -14457,7 +17454,7 @@ index 0d2db0e..7c1fb04 100644 __mcheck_cpu_init_generic(); __mcheck_cpu_init_vendor(c); -@@ -1574,7 +1577,7 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c) +@@ -1691,7 +1694,7 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c) */ static DEFINE_SPINLOCK(mce_chrdev_state_lock); @@ -14466,7 +17463,7 @@ index 0d2db0e..7c1fb04 100644 static int mce_chrdev_open_exclu; /* already open exclusive? */ static int mce_chrdev_open(struct inode *inode, struct file *file) -@@ -1582,7 +1585,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file) +@@ -1699,7 +1702,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file) spin_lock(&mce_chrdev_state_lock); if (mce_chrdev_open_exclu || @@ -14475,7 +17472,7 @@ index 0d2db0e..7c1fb04 100644 spin_unlock(&mce_chrdev_state_lock); return -EBUSY; -@@ -1590,7 +1593,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file) +@@ -1707,7 +1710,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file) if (file->f_flags & O_EXCL) mce_chrdev_open_exclu = 1; @@ -14484,7 +17481,7 @@ index 0d2db0e..7c1fb04 100644 spin_unlock(&mce_chrdev_state_lock); -@@ -1601,7 +1604,7 @@ static int mce_chrdev_release(struct inode *inode, struct file *file) +@@ -1718,7 +1721,7 @@ static int mce_chrdev_release(struct inode *inode, struct file *file) { spin_lock(&mce_chrdev_state_lock); @@ -14493,7 +17490,25 @@ index 0d2db0e..7c1fb04 100644 mce_chrdev_open_exclu = 0; spin_unlock(&mce_chrdev_state_lock); -@@ -2326,7 +2329,7 @@ struct dentry *mce_get_debugfs_dir(void) +@@ -2364,7 +2367,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) + return NOTIFY_OK; + } + +-static struct notifier_block mce_cpu_notifier __cpuinitdata = { ++static struct notifier_block mce_cpu_notifier = { + .notifier_call = mce_cpu_callback, + }; + +@@ -2374,7 +2377,7 @@ static __init void mce_init_banks(void) + + for (i = 0; i < mca_cfg.banks; i++) { + struct mce_bank *b = &mce_banks[i]; +- struct device_attribute *a = &b->attr; ++ device_attribute_no_const *a = &b->attr; + + sysfs_attr_init(&a->attr); + a->attr.name = b->attrname; +@@ -2442,7 +2445,7 @@ struct dentry *mce_get_debugfs_dir(void) static void mce_reset(void) { cpu_missing = 0; @@ -14503,7 +17518,7 @@ index 0d2db0e..7c1fb04 100644 atomic_set(&mce_callin, 0); atomic_set(&global_nwo, 0); diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c -index 2d5454c..51987eb 100644 +index 1c044b1..37a2a43 100644 --- a/arch/x86/kernel/cpu/mcheck/p5.c +++ b/arch/x86/kernel/cpu/mcheck/p5.c @@ -11,6 +11,7 @@ @@ -14524,8 +17539,21 @@ index 2d5454c..51987eb 100644 /* Make sure the vector pointer is visible before we enable MCEs: */ wmb(); +diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c +index 47a1870..8c019a7 100644 +--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c ++++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c +@@ -288,7 +288,7 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb, + return notifier_from_errno(err); + } + +-static struct notifier_block thermal_throttle_cpu_notifier __cpuinitdata = ++static struct notifier_block thermal_throttle_cpu_notifier = + { + .notifier_call = thermal_throttle_cpu_callback, + }; diff --git a/arch/x86/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c -index 2d7998f..17c9de1 100644 +index e9a701a..35317d6 100644 --- a/arch/x86/kernel/cpu/mcheck/winchip.c +++ b/arch/x86/kernel/cpu/mcheck/winchip.c @@ -10,6 +10,7 @@ @@ -14547,7 +17575,7 @@ index 2d7998f..17c9de1 100644 wmb(); diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c -index 6b96110..0da73eb 100644 +index 726bf96..81f0526 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c @@ -62,7 +62,7 @@ static DEFINE_MUTEX(mtrr_mutex); @@ -14573,10 +17601,37 @@ index df5e41f..816c719 100644 extern int generic_get_free_region(unsigned long base, unsigned long size, int replace_reg); diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c -index bb8e034..fb9020b 100644 +index bf0f01a..9adfee1 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c -@@ -1835,7 +1835,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) +@@ -1305,7 +1305,7 @@ static void __init pmu_check_apic(void) + pr_info("no hardware sampling interrupt available.\n"); + } + +-static struct attribute_group x86_pmu_format_group = { ++static attribute_group_no_const x86_pmu_format_group = { + .name = "format", + .attrs = NULL, + }; +@@ -1374,7 +1374,7 @@ static struct attribute *events_attr[] = { + NULL, + }; + +-static struct attribute_group x86_pmu_events_group = { ++static attribute_group_no_const x86_pmu_events_group = { + .name = "events", + .attrs = events_attr, + }; +@@ -1873,7 +1873,7 @@ static unsigned long get_segment_base(unsigned int segment) + if (idx > GDT_ENTRIES) + return 0; + +- desc = __this_cpu_ptr(&gdt_page.gdt[0]); ++ desc = get_cpu_gdt_table(smp_processor_id()); + } + + return get_desc_base(desc + idx); +@@ -1963,7 +1963,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) break; perf_callchain_store(entry, frame.return_address); @@ -14585,11 +17640,77 @@ index bb8e034..fb9020b 100644 } } +diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c +index 4a0a462..be3b204 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel.c ++++ b/arch/x86/kernel/cpu/perf_event_intel.c +@@ -1994,10 +1994,10 @@ __init int intel_pmu_init(void) + * v2 and above have a perf capabilities MSR + */ + if (version > 1) { +- u64 capabilities; ++ u64 capabilities = x86_pmu.intel_cap.capabilities; + +- rdmsrl(MSR_IA32_PERF_CAPABILITIES, capabilities); +- x86_pmu.intel_cap.capabilities = capabilities; ++ if (rdmsrl_safe(MSR_IA32_PERF_CAPABILITIES, &x86_pmu.intel_cap.capabilities)) ++ x86_pmu.intel_cap.capabilities = capabilities; + } + + intel_ds_init(); +diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c +index 3e091f0..d2dc8d6 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c +@@ -2428,7 +2428,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types) + static int __init uncore_type_init(struct intel_uncore_type *type) + { + struct intel_uncore_pmu *pmus; +- struct attribute_group *attr_group; ++ attribute_group_no_const *attr_group; + struct attribute **attrs; + int i, j; + +@@ -2826,7 +2826,7 @@ static int + return NOTIFY_OK; + } + +-static struct notifier_block uncore_cpu_nb __cpuinitdata = { ++static struct notifier_block uncore_cpu_nb = { + .notifier_call = uncore_cpu_notifier, + /* + * to migrate uncore events, our notifier should be executed +diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.h b/arch/x86/kernel/cpu/perf_event_intel_uncore.h +index e68a455..975a932 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.h ++++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.h +@@ -428,7 +428,7 @@ struct intel_uncore_box { + struct uncore_event_desc { + struct kobj_attribute attr; + const char *config; +-}; ++} __do_const; + + #define INTEL_UNCORE_EVENT_DESC(_name, _config) \ + { \ +diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c +index 1e4dbcf..b9a34c2 100644 +--- a/arch/x86/kernel/cpuid.c ++++ b/arch/x86/kernel/cpuid.c +@@ -171,7 +171,7 @@ static int __cpuinit cpuid_class_cpu_callback(struct notifier_block *nfb, + return notifier_from_errno(err); + } + +-static struct notifier_block __refdata cpuid_class_cpu_notifier = ++static struct notifier_block cpuid_class_cpu_notifier = + { + .notifier_call = cpuid_class_cpu_callback, + }; diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c -index 13ad899..f642b9a 100644 +index 74467fe..18793d5 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c -@@ -36,10 +36,8 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs) +@@ -58,10 +58,8 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs) { #ifdef CONFIG_X86_32 struct pt_regs fixed_regs; @@ -14637,7 +17758,7 @@ index 37250fe..bf2ec74 100644 .__cr3 = __pa_nodebug(swapper_pg_dir), diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c -index 1b81839..0b4e7b0 100644 +index c8797d5..c605e53 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -2,6 +2,9 @@ @@ -14772,16 +17893,16 @@ index 1b81839..0b4e7b0 100644 } int __kprobes __die(const char *str, struct pt_regs *regs, long err) -@@ -273,7 +277,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) - - show_registers(regs); +@@ -274,7 +278,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) + print_modules(); + show_regs(regs); #ifdef CONFIG_X86_32 - if (user_mode_vm(regs)) { + if (user_mode(regs)) { sp = regs->sp; ss = regs->ss & 0xffff; } else { -@@ -301,7 +305,7 @@ void die(const char *str, struct pt_regs *regs, long err) +@@ -302,7 +306,7 @@ void die(const char *str, struct pt_regs *regs, long err) unsigned long flags = oops_begin(); int sig = SIGSEGV; @@ -14791,7 +17912,7 @@ index 1b81839..0b4e7b0 100644 if (__die(str, regs, err)) diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c -index 88ec912..e95e935 100644 +index 1038a41..db2c12b 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c @@ -38,15 +38,13 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, @@ -14814,16 +17935,16 @@ index 88ec912..e95e935 100644 if (ops->stack(data, "IRQ") < 0) break; touch_nmi_watchdog(); -@@ -87,7 +85,7 @@ void show_registers(struct pt_regs *regs) +@@ -86,7 +84,7 @@ void show_regs(struct pt_regs *regs) + { int i; - print_modules(); - __show_regs(regs, !user_mode_vm(regs)); + __show_regs(regs, !user_mode(regs)); - printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)\n", - TASK_COMM_LEN, current->comm, task_pid_nr(current), -@@ -96,21 +94,22 @@ void show_registers(struct pt_regs *regs) + pr_emerg("Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)\n", + TASK_COMM_LEN, current->comm, task_pid_nr(current), +@@ -95,21 +93,22 @@ void show_regs(struct pt_regs *regs) * When in-kernel, we also print out the stack and code at the * time of the fault.. */ @@ -14833,12 +17954,12 @@ index 88ec912..e95e935 100644 unsigned int code_len = code_bytes; unsigned char c; u8 *ip; -+ unsigned long cs_base = get_desc_base(&get_cpu_gdt_table(smp_processor_id())[(0xffff & regs->cs) >> 3]); ++ unsigned long cs_base = get_desc_base(&get_cpu_gdt_table(0)[(0xffff & regs->cs) >> 3]); - printk(KERN_EMERG "Stack:\n"); + pr_emerg("Stack:\n"); show_stack_log_lvl(NULL, regs, ®s->sp, 0, KERN_EMERG); - printk(KERN_EMERG "Code: "); + pr_emerg("Code:"); - ip = (u8 *)regs->ip - code_prologue; + ip = (u8 *)regs->ip - code_prologue + cs_base; @@ -14849,16 +17970,16 @@ index 88ec912..e95e935 100644 code_len = code_len - code_prologue + 1; } for (i = 0; i < code_len; i++, ip++) { -@@ -119,7 +118,7 @@ void show_registers(struct pt_regs *regs) - printk(KERN_CONT " Bad EIP value."); +@@ -118,7 +117,7 @@ void show_regs(struct pt_regs *regs) + pr_cont(" Bad EIP value."); break; } - if (ip == (u8 *)regs->ip) + if (ip == (u8 *)regs->ip + cs_base) - printk(KERN_CONT "<%02x> ", c); + pr_cont(" <%02x>", c); else - printk(KERN_CONT "%02x ", c); -@@ -132,6 +131,7 @@ int is_valid_bugaddr(unsigned long ip) + pr_cont(" %02x", c); +@@ -131,6 +130,7 @@ int is_valid_bugaddr(unsigned long ip) { unsigned short ud2; @@ -14866,7 +17987,7 @@ index 88ec912..e95e935 100644 if (ip < PAGE_OFFSET) return 0; if (probe_kernel_address((unsigned short *)ip, ud2)) -@@ -139,3 +139,15 @@ int is_valid_bugaddr(unsigned long ip) +@@ -138,3 +138,15 @@ int is_valid_bugaddr(unsigned long ip) return ud2 == 0x0b0f; } @@ -14883,7 +18004,7 @@ index 88ec912..e95e935 100644 +EXPORT_SYMBOL(pax_check_alloca); +#endif diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c -index 17107bd..9623722 100644 +index b653675..51cc8c0 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c @@ -119,9 +119,9 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, @@ -14947,7 +18068,16 @@ index 17107bd..9623722 100644 put_cpu(); } EXPORT_SYMBOL(dump_trace); -@@ -305,3 +309,50 @@ int is_valid_bugaddr(unsigned long ip) +@@ -249,7 +253,7 @@ void show_regs(struct pt_regs *regs) + { + int i; + unsigned long sp; +- const int cpu = smp_processor_id(); ++ const int cpu = raw_smp_processor_id(); + struct task_struct *cur = current; + + sp = regs->sp; +@@ -304,3 +308,50 @@ int is_valid_bugaddr(unsigned long ip) return ud2 == 0x0b0f; } @@ -15011,10 +18141,10 @@ index 9b9f18b..9fcaa04 100644 #include <asm/processor.h> #include <asm/fcntl.h> diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S -index 7b784f4..db6b628 100644 +index 8f3e2de..934870f 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S -@@ -179,13 +179,146 @@ +@@ -177,13 +177,153 @@ /*CFI_REL_OFFSET gs, PT_GS*/ .endm .macro SET_KERNEL_GS reg @@ -15118,10 +18248,10 @@ index 7b784f4..db6b628 100644 +#ifdef CONFIG_PAX_MEMORY_STACKLEAK +/* + * ebp: thread_info -+ * ecx, edx: can be clobbered + */ +ENTRY(pax_erase_kstack) + pushl %edi ++ pushl %ecx + pushl %eax + + mov TI_lowest_stack(%ebp), %edi @@ -15145,6 +18275,12 @@ index 7b784f4..db6b628 100644 +2: cld + mov %esp, %ecx + sub %edi, %ecx ++ ++ cmp $THREAD_SIZE_asm, %ecx ++ jb 3f ++ ud2 ++3: ++ + shr $2, %ecx + rep stosl + @@ -15153,6 +18289,7 @@ index 7b784f4..db6b628 100644 + mov %edi, TI_lowest_stack(%ebp) + + popl %eax ++ popl %ecx + popl %edi + ret +ENDPROC(pax_erase_kstack) @@ -15162,7 +18299,7 @@ index 7b784f4..db6b628 100644 cld PUSH_GS pushl_cfi %fs -@@ -208,7 +341,7 @@ +@@ -206,7 +346,7 @@ CFI_REL_OFFSET ecx, 0 pushl_cfi %ebx CFI_REL_OFFSET ebx, 0 @@ -15171,7 +18308,7 @@ index 7b784f4..db6b628 100644 movl %edx, %ds movl %edx, %es movl $(__KERNEL_PERCPU), %edx -@@ -216,6 +349,15 @@ +@@ -214,6 +354,15 @@ SET_KERNEL_GS %edx .endm @@ -15187,16 +18324,16 @@ index 7b784f4..db6b628 100644 .macro RESTORE_INT_REGS popl_cfi %ebx CFI_RESTORE ebx -@@ -301,7 +443,7 @@ ENTRY(ret_from_fork) +@@ -297,7 +446,7 @@ ENTRY(ret_from_fork) popfl_cfi jmp syscall_exit CFI_ENDPROC -END(ret_from_fork) +ENDPROC(ret_from_fork) - /* - * Interrupt exit functions should be protected against kprobes -@@ -335,7 +477,15 @@ resume_userspace_sig: + ENTRY(ret_from_kernel_thread) + CFI_STARTPROC +@@ -344,7 +493,15 @@ ret_from_intr: andl $SEGMENT_RPL_MASK, %eax #endif cmpl $USER_RPL, %eax @@ -15212,7 +18349,7 @@ index 7b784f4..db6b628 100644 ENTRY(resume_userspace) LOCKDEP_SYS_EXIT -@@ -347,8 +497,8 @@ ENTRY(resume_userspace) +@@ -356,8 +513,8 @@ ENTRY(resume_userspace) andl $_TIF_WORK_MASK, %ecx # is there any work to be done on # int/exception return? jne work_pending @@ -15223,7 +18360,7 @@ index 7b784f4..db6b628 100644 #ifdef CONFIG_PREEMPT ENTRY(resume_kernel) -@@ -363,7 +513,7 @@ need_resched: +@@ -372,7 +529,7 @@ need_resched: jz restore_all call preempt_schedule_irq jmp need_resched @@ -15232,7 +18369,7 @@ index 7b784f4..db6b628 100644 #endif CFI_ENDPROC /* -@@ -397,23 +547,34 @@ sysenter_past_esp: +@@ -406,30 +563,45 @@ sysenter_past_esp: /*CFI_REL_OFFSET cs, 0*/ /* * Push current_thread_info()->sysenter_return to the stack. @@ -15264,13 +18401,24 @@ index 7b784f4..db6b628 100644 +#else cmpl $__PAGE_OFFSET-3,%ebp jae syscall_fault + ASM_STAC 1: movl (%ebp),%ebp + ASM_CLAC +#endif + movl %ebp,PT_EBP(%esp) - .section __ex_table,"a" - .align 4 -@@ -436,12 +597,24 @@ sysenter_do_call: + _ASM_EXTABLE(1b,syscall_fault) + + GET_THREAD_INFO(%ebp) + ++#ifdef CONFIG_PAX_RANDKSTACK ++ pax_erase_kstack ++#endif ++ + testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp) + jnz sysenter_audit + sysenter_do_call: +@@ -444,12 +616,24 @@ sysenter_do_call: testl $_TIF_ALLWORK_MASK, %ecx jne sysexit_audit sysenter_exit: @@ -15295,7 +18443,7 @@ index 7b784f4..db6b628 100644 PTGS_TO_GS ENABLE_INTERRUPTS_SYSEXIT -@@ -458,6 +631,9 @@ sysenter_audit: +@@ -466,6 +650,9 @@ sysenter_audit: movl %eax,%edx /* 2nd arg: syscall number */ movl $AUDIT_ARCH_I386,%eax /* 1st arg: audit arch */ call __audit_syscall_entry @@ -15305,7 +18453,7 @@ index 7b784f4..db6b628 100644 pushl_cfi %ebx movl PT_EAX(%esp),%eax /* reload syscall number */ jmp sysenter_do_call -@@ -483,11 +659,17 @@ sysexit_audit: +@@ -491,10 +678,16 @@ sysexit_audit: CFI_ENDPROC .pushsection .fixup,"ax" @@ -15316,16 +18464,27 @@ index 7b784f4..db6b628 100644 + jmp 1b +6: movl $0,PT_ES(%esp) jmp 1b - .section __ex_table,"a" - .align 4 -- .long 1b,2b -+ .long 1b,4b -+ .long 2b,5b -+ .long 3b,6b .popsection +- _ASM_EXTABLE(1b,2b) ++ _ASM_EXTABLE(1b,4b) ++ _ASM_EXTABLE(2b,5b) ++ _ASM_EXTABLE(3b,6b) PTGS_TO_GS_EX ENDPROC(ia32_sysenter_target) -@@ -520,6 +702,15 @@ syscall_exit: + +@@ -509,6 +702,11 @@ ENTRY(system_call) + pushl_cfi %eax # save orig_eax + SAVE_ALL + GET_THREAD_INFO(%ebp) ++ ++#ifdef CONFIG_PAX_RANDKSTACK ++ pax_erase_kstack ++#endif ++ + # system call tracing in operation / emulation + testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp) + jnz syscall_trace_entry +@@ -527,6 +725,15 @@ syscall_exit: testl $_TIF_ALLWORK_MASK, %ecx # current->work jne syscall_exit_work @@ -15341,7 +18500,7 @@ index 7b784f4..db6b628 100644 restore_all: TRACE_IRQS_IRET restore_all_notrace: -@@ -579,14 +770,34 @@ ldt_ss: +@@ -583,14 +790,34 @@ ldt_ss: * compensating for the offset by changing to the ESPFIX segment with * a base address that matches for the difference. */ @@ -15379,7 +18538,7 @@ index 7b784f4..db6b628 100644 pushl_cfi $__ESPFIX_SS pushl_cfi %eax /* new kernel esp */ /* Disable interrupts, but do not irqtrace this section: we -@@ -615,38 +826,30 @@ work_resched: +@@ -619,20 +846,18 @@ work_resched: movl TI_flags(%ebp), %ecx andl $_TIF_WORK_MASK, %ecx # is there any work to be done other # than syscall tracing? @@ -15394,36 +18553,24 @@ index 7b784f4..db6b628 100644 #ifdef CONFIG_VM86 testl $X86_EFLAGS_VM, PT_EFLAGS(%esp) - movl %esp, %eax -- jne work_notifysig_v86 # returning to kernel-space or -+ jz 1f # returning to kernel-space or + jne work_notifysig_v86 # returning to kernel-space or # vm86-space -- TRACE_IRQS_ON -- ENABLE_INTERRUPTS(CLBR_NONE) -- xorl %edx, %edx -- call do_notify_resume -- jmp resume_userspace_sig - -- ALIGN --work_notifysig_v86: - pushl_cfi %ecx # save ti_flags for do_notify_resume - call save_v86_state # %eax contains pt_regs pointer - popl_cfi %ecx - movl %eax, %esp + 1: -#else - movl %esp, %eax -+1: #endif TRACE_IRQS_ON ENABLE_INTERRUPTS(CLBR_NONE) - xorl %edx, %edx - call do_notify_resume - jmp resume_userspace_sig +@@ -653,7 +878,7 @@ work_notifysig_v86: + movl %eax, %esp + jmp 1b + #endif -END(work_pending) +ENDPROC(work_pending) # perform syscall exit tracing ALIGN -@@ -654,11 +857,14 @@ syscall_trace_entry: +@@ -661,11 +886,14 @@ syscall_trace_entry: movl $-ENOSYS,PT_EAX(%esp) movl %esp, %eax call syscall_trace_enter @@ -15439,7 +18586,7 @@ index 7b784f4..db6b628 100644 # perform syscall exit tracing ALIGN -@@ -671,20 +877,24 @@ syscall_exit_work: +@@ -678,21 +906,25 @@ syscall_exit_work: movl %esp, %eax call syscall_trace_leave jmp resume_userspace @@ -15453,6 +18600,7 @@ index 7b784f4..db6b628 100644 + push %ss + pop %ds +#endif + ASM_CLAC GET_THREAD_INFO(%ebp) movl $-EFAULT,PT_EAX(%esp) jmp resume_userspace @@ -15467,44 +18615,7 @@ index 7b784f4..db6b628 100644 CFI_ENDPROC /* * End of kprobes section -@@ -756,6 +966,36 @@ ENTRY(ptregs_clone) - CFI_ENDPROC - ENDPROC(ptregs_clone) - -+ ALIGN; -+ENTRY(kernel_execve) -+ CFI_STARTPROC -+ pushl_cfi %ebp -+ sub $PT_OLDSS+4,%esp -+ pushl_cfi %edi -+ pushl_cfi %ecx -+ pushl_cfi %eax -+ lea 3*4(%esp),%edi -+ mov $PT_OLDSS/4+1,%ecx -+ xorl %eax,%eax -+ rep stosl -+ popl_cfi %eax -+ popl_cfi %ecx -+ popl_cfi %edi -+ movl $X86_EFLAGS_IF,PT_EFLAGS(%esp) -+ pushl_cfi %esp -+ call sys_execve -+ add $4,%esp -+ CFI_ADJUST_CFA_OFFSET -4 -+ GET_THREAD_INFO(%ebp) -+ test %eax,%eax -+ jz syscall_exit -+ add $PT_OLDSS+4,%esp -+ CFI_ADJUST_CFA_OFFSET -PT_OLDSS-4 -+ popl_cfi %ebp -+ ret -+ CFI_ENDPROC -+ENDPROC(kernel_execve) -+ - .macro FIXUP_ESPFIX_STACK - /* - * Switch back for ESPFIX stack to the normal zerobased stack -@@ -765,8 +1005,15 @@ ENDPROC(ptregs_clone) +@@ -708,8 +940,15 @@ END(syscall_badsys) * normal stack and adjusts ESP with the matching offset. */ /* fixup the stack */ @@ -15522,7 +18633,7 @@ index 7b784f4..db6b628 100644 shl $16, %eax addl %esp, %eax /* the adjusted stack pointer */ pushl_cfi $__KERNEL_DS -@@ -819,7 +1066,7 @@ vector=vector+1 +@@ -762,7 +1001,7 @@ vector=vector+1 .endr 2: jmp common_interrupt .endr @@ -15531,7 +18642,7 @@ index 7b784f4..db6b628 100644 .previous END(interrupt) -@@ -867,7 +1114,7 @@ ENTRY(coprocessor_error) +@@ -813,7 +1052,7 @@ ENTRY(coprocessor_error) pushl_cfi $do_coprocessor_error jmp error_code CFI_ENDPROC @@ -15540,7 +18651,7 @@ index 7b784f4..db6b628 100644 ENTRY(simd_coprocessor_error) RING0_INT_FRAME -@@ -888,7 +1135,7 @@ ENTRY(simd_coprocessor_error) +@@ -835,7 +1074,7 @@ ENTRY(simd_coprocessor_error) #endif jmp error_code CFI_ENDPROC @@ -15549,7 +18660,7 @@ index 7b784f4..db6b628 100644 ENTRY(device_not_available) RING0_INT_FRAME -@@ -896,7 +1143,7 @@ ENTRY(device_not_available) +@@ -844,18 +1083,18 @@ ENTRY(device_not_available) pushl_cfi $do_device_not_available jmp error_code CFI_ENDPROC @@ -15558,10 +18669,8 @@ index 7b784f4..db6b628 100644 #ifdef CONFIG_PARAVIRT ENTRY(native_iret) -@@ -905,12 +1152,12 @@ ENTRY(native_iret) - .align 4 - .long native_iret, iret_exc - .previous + iret + _ASM_EXTABLE(native_iret, iret_exc) -END(native_iret) +ENDPROC(native_iret) @@ -15573,7 +18682,7 @@ index 7b784f4..db6b628 100644 #endif ENTRY(overflow) -@@ -919,7 +1166,7 @@ ENTRY(overflow) +@@ -865,7 +1104,7 @@ ENTRY(overflow) pushl_cfi $do_overflow jmp error_code CFI_ENDPROC @@ -15582,7 +18691,7 @@ index 7b784f4..db6b628 100644 ENTRY(bounds) RING0_INT_FRAME -@@ -927,7 +1174,7 @@ ENTRY(bounds) +@@ -874,7 +1113,7 @@ ENTRY(bounds) pushl_cfi $do_bounds jmp error_code CFI_ENDPROC @@ -15591,7 +18700,7 @@ index 7b784f4..db6b628 100644 ENTRY(invalid_op) RING0_INT_FRAME -@@ -935,7 +1182,7 @@ ENTRY(invalid_op) +@@ -883,7 +1122,7 @@ ENTRY(invalid_op) pushl_cfi $do_invalid_op jmp error_code CFI_ENDPROC @@ -15600,7 +18709,7 @@ index 7b784f4..db6b628 100644 ENTRY(coprocessor_segment_overrun) RING0_INT_FRAME -@@ -943,35 +1190,35 @@ ENTRY(coprocessor_segment_overrun) +@@ -892,7 +1131,7 @@ ENTRY(coprocessor_segment_overrun) pushl_cfi $do_coprocessor_segment_overrun jmp error_code CFI_ENDPROC @@ -15609,6 +18718,7 @@ index 7b784f4..db6b628 100644 ENTRY(invalid_TSS) RING0_EC_FRAME +@@ -900,7 +1139,7 @@ ENTRY(invalid_TSS) pushl_cfi $do_invalid_TSS jmp error_code CFI_ENDPROC @@ -15617,6 +18727,7 @@ index 7b784f4..db6b628 100644 ENTRY(segment_not_present) RING0_EC_FRAME +@@ -908,7 +1147,7 @@ ENTRY(segment_not_present) pushl_cfi $do_segment_not_present jmp error_code CFI_ENDPROC @@ -15625,6 +18736,7 @@ index 7b784f4..db6b628 100644 ENTRY(stack_segment) RING0_EC_FRAME +@@ -916,7 +1155,7 @@ ENTRY(stack_segment) pushl_cfi $do_stack_segment jmp error_code CFI_ENDPROC @@ -15633,6 +18745,7 @@ index 7b784f4..db6b628 100644 ENTRY(alignment_check) RING0_EC_FRAME +@@ -924,7 +1163,7 @@ ENTRY(alignment_check) pushl_cfi $do_alignment_check jmp error_code CFI_ENDPROC @@ -15641,7 +18754,7 @@ index 7b784f4..db6b628 100644 ENTRY(divide_error) RING0_INT_FRAME -@@ -979,7 +1226,7 @@ ENTRY(divide_error) +@@ -933,7 +1172,7 @@ ENTRY(divide_error) pushl_cfi $do_divide_error jmp error_code CFI_ENDPROC @@ -15650,7 +18763,7 @@ index 7b784f4..db6b628 100644 #ifdef CONFIG_X86_MCE ENTRY(machine_check) -@@ -988,7 +1235,7 @@ ENTRY(machine_check) +@@ -943,7 +1182,7 @@ ENTRY(machine_check) pushl_cfi machine_check_vector jmp error_code CFI_ENDPROC @@ -15659,7 +18772,7 @@ index 7b784f4..db6b628 100644 #endif ENTRY(spurious_interrupt_bug) -@@ -997,7 +1244,7 @@ ENTRY(spurious_interrupt_bug) +@@ -953,7 +1192,7 @@ ENTRY(spurious_interrupt_bug) pushl_cfi $do_spurious_interrupt_bug jmp error_code CFI_ENDPROC @@ -15668,7 +18781,7 @@ index 7b784f4..db6b628 100644 /* * End of kprobes section */ -@@ -1112,7 +1359,7 @@ BUILD_INTERRUPT3(xen_hvm_callback_vector, XEN_HVM_EVTCHN_CALLBACK, +@@ -1063,7 +1302,7 @@ BUILD_INTERRUPT3(hyperv_callback_vector, HYPERVISOR_CALLBACK_VECTOR, ENTRY(mcount) ret @@ -15677,16 +18790,16 @@ index 7b784f4..db6b628 100644 ENTRY(ftrace_caller) cmpl $0, function_trace_stop -@@ -1141,7 +1388,7 @@ ftrace_graph_call: +@@ -1096,7 +1335,7 @@ ftrace_graph_call: .globl ftrace_stub ftrace_stub: ret -END(ftrace_caller) +ENDPROC(ftrace_caller) - #else /* ! CONFIG_DYNAMIC_FTRACE */ - -@@ -1177,7 +1424,7 @@ trace: + ENTRY(ftrace_regs_caller) + pushf /* push flags before compare (in cs location) */ +@@ -1197,7 +1436,7 @@ trace: popl %ecx popl %eax jmp ftrace_stub @@ -15695,7 +18808,7 @@ index 7b784f4..db6b628 100644 #endif /* CONFIG_DYNAMIC_FTRACE */ #endif /* CONFIG_FUNCTION_TRACER */ -@@ -1198,7 +1445,7 @@ ENTRY(ftrace_graph_caller) +@@ -1215,7 +1454,7 @@ ENTRY(ftrace_graph_caller) popl %ecx popl %eax ret @@ -15704,7 +18817,7 @@ index 7b784f4..db6b628 100644 .globl return_to_handler return_to_handler: -@@ -1253,15 +1500,18 @@ error_code: +@@ -1271,15 +1510,18 @@ error_code: movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart REG_TO_PTGS %ecx SET_KERNEL_GS %ecx @@ -15725,7 +18838,7 @@ index 7b784f4..db6b628 100644 /* * Debug traps and NMI can happen at the one SYSENTER instruction -@@ -1303,7 +1553,7 @@ debug_stack_correct: +@@ -1322,7 +1564,7 @@ debug_stack_correct: call do_debug jmp ret_from_exception CFI_ENDPROC @@ -15734,7 +18847,7 @@ index 7b784f4..db6b628 100644 /* * NMI is doubly nasty. It can happen _while_ we're handling -@@ -1340,6 +1590,9 @@ nmi_stack_correct: +@@ -1360,6 +1602,9 @@ nmi_stack_correct: xorl %edx,%edx # zero error code movl %esp,%eax # pt_regs pointer call do_nmi @@ -15744,7 +18857,7 @@ index 7b784f4..db6b628 100644 jmp restore_all_notrace CFI_ENDPROC -@@ -1376,12 +1629,15 @@ nmi_espfix_stack: +@@ -1396,12 +1641,15 @@ nmi_espfix_stack: FIXUP_ESPFIX_STACK # %eax == %esp xorl %edx,%edx # zero error code call do_nmi @@ -15761,7 +18874,7 @@ index 7b784f4..db6b628 100644 ENTRY(int3) RING0_INT_FRAME -@@ -1393,14 +1649,14 @@ ENTRY(int3) +@@ -1414,14 +1662,14 @@ ENTRY(int3) call do_int3 jmp ret_from_exception CFI_ENDPROC @@ -15778,7 +18891,7 @@ index 7b784f4..db6b628 100644 #ifdef CONFIG_KVM_GUEST ENTRY(async_page_fault) -@@ -1408,7 +1664,7 @@ ENTRY(async_page_fault) +@@ -1430,7 +1678,7 @@ ENTRY(async_page_fault) pushl_cfi $do_async_page_fault jmp error_code CFI_ENDPROC @@ -15788,30 +18901,30 @@ index 7b784f4..db6b628 100644 /* diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S -index cdc79b5..4710a75 100644 +index c1d01e6..5625dce 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S -@@ -56,6 +56,8 @@ - #include <asm/ftrace.h> - #include <asm/percpu.h> +@@ -59,6 +59,8 @@ + #include <asm/context_tracking.h> + #include <asm/smap.h> #include <linux/err.h> +#include <asm/pgtable.h> +#include <asm/alternative-asm.h> /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */ #include <linux/elf-em.h> -@@ -69,8 +71,9 @@ - #ifdef CONFIG_FUNCTION_TRACER +@@ -80,8 +82,9 @@ #ifdef CONFIG_DYNAMIC_FTRACE - ENTRY(mcount) + + ENTRY(function_hook) + pax_force_retaddr retq --END(mcount) -+ENDPROC(mcount) +-END(function_hook) ++ENDPROC(function_hook) - ENTRY(ftrace_caller) - cmpl $0, function_trace_stop -@@ -93,8 +96,9 @@ GLOBAL(ftrace_graph_call) + /* skip is set if stack has been adjusted */ + .macro ftrace_caller_setup skip=0 +@@ -122,8 +125,9 @@ GLOBAL(ftrace_graph_call) #endif GLOBAL(ftrace_stub) @@ -15820,9 +18933,18 @@ index cdc79b5..4710a75 100644 -END(ftrace_caller) +ENDPROC(ftrace_caller) + ENTRY(ftrace_regs_caller) + /* Save the current flags before compare (in SS location)*/ +@@ -191,7 +195,7 @@ ftrace_restore_flags: + popfq + jmp ftrace_stub + +-END(ftrace_regs_caller) ++ENDPROC(ftrace_regs_caller) + + #else /* ! CONFIG_DYNAMIC_FTRACE */ - ENTRY(mcount) -@@ -113,6 +117,7 @@ ENTRY(mcount) +@@ -212,6 +216,7 @@ ENTRY(function_hook) #endif GLOBAL(ftrace_stub) @@ -15830,8 +18952,8 @@ index cdc79b5..4710a75 100644 retq trace: -@@ -122,12 +127,13 @@ trace: - movq 8(%rbp), %rsi +@@ -225,12 +230,13 @@ trace: + #endif subq $MCOUNT_INSN_SIZE, %rdi + pax_force_fptr ftrace_trace_function @@ -15840,12 +18962,12 @@ index cdc79b5..4710a75 100644 MCOUNT_RESTORE_FRAME jmp ftrace_stub --END(mcount) -+ENDPROC(mcount) +-END(function_hook) ++ENDPROC(function_hook) #endif /* CONFIG_DYNAMIC_FTRACE */ #endif /* CONFIG_FUNCTION_TRACER */ -@@ -147,8 +153,9 @@ ENTRY(ftrace_graph_caller) +@@ -252,8 +258,9 @@ ENTRY(ftrace_graph_caller) MCOUNT_RESTORE_FRAME @@ -15856,15 +18978,17 @@ index cdc79b5..4710a75 100644 GLOBAL(return_to_handler) subq $24, %rsp -@@ -164,6 +171,7 @@ GLOBAL(return_to_handler) +@@ -269,7 +276,9 @@ GLOBAL(return_to_handler) movq 8(%rsp), %rdx movq (%rsp), %rax addq $24, %rsp + pax_force_fptr %rdi jmp *%rdi ++ENDPROC(return_to_handler) #endif -@@ -179,6 +187,282 @@ ENTRY(native_usergs_sysret64) + +@@ -284,6 +293,282 @@ ENTRY(native_usergs_sysret64) ENDPROC(native_usergs_sysret64) #endif /* CONFIG_PARAVIRT */ @@ -15919,7 +19043,7 @@ index cdc79b5..4710a75 100644 + pax_force_retaddr + retq + -+2: ljmpq __KERNEL_CS,1f ++2: ljmpq __KERNEL_CS,1b +3: ljmpq __KERNEXEC_KERNEL_CS,4f +4: SET_RDI_INTO_CR0 + jmp 1b @@ -15935,6 +19059,9 @@ index cdc79b5..4710a75 100644 + mov %cs,%rdi + cmp $__KERNEXEC_KERNEL_CS,%edi + jz 2f ++ GET_CR0_INTO_RDI ++ bts $16,%rdi ++ jnc 4f +1: + +#ifdef CONFIG_PARAVIRT @@ -15947,16 +19074,12 @@ index cdc79b5..4710a75 100644 + +2: GET_CR0_INTO_RDI + btr $16,%rdi ++ jnc 4f + ljmpq __KERNEL_CS,3f +3: SET_RDI_INTO_CR0 + jmp 1b -+#ifdef CONFIG_PARAVIRT -+ PV_RESTORE_REGS(CLBR_RDI); -+#endif -+ -+ popq %rdi -+ pax_force_retaddr -+ retq ++4: ud2 ++ jmp 4b +ENDPROC(pax_exit_kernel) +#endif + @@ -16046,6 +19169,7 @@ index cdc79b5..4710a75 100644 +#ifdef CONFIG_PAX_KERNEXEC + GET_CR0_INTO_RDI + btr $16,%rdi ++ jnc 3f + SET_RDI_INTO_CR0 +#endif + @@ -16083,6 +19207,8 @@ index cdc79b5..4710a75 100644 + popq %rdi + pax_force_retaddr + retq ++3: ud2 ++ jmp 3b +ENDPROC(pax_exit_kernel_user) +#endif + @@ -16093,12 +19219,9 @@ index cdc79b5..4710a75 100644 +.endm + +#ifdef CONFIG_PAX_MEMORY_STACKLEAK -+/* -+ * r11: thread_info -+ * rcx, rdx: can be clobbered -+ */ +ENTRY(pax_erase_kstack) + pushq %rdi ++ pushq %rcx + pushq %rax + pushq %r11 + @@ -16139,6 +19262,7 @@ index cdc79b5..4710a75 100644 + + popq %r11 + popq %rax ++ popq %rcx + popq %rdi + pax_force_retaddr + ret @@ -16147,7 +19271,7 @@ index cdc79b5..4710a75 100644 .macro TRACE_IRQS_IRETQ offset=ARGOFFSET #ifdef CONFIG_TRACE_IRQFLAGS -@@ -232,8 +516,8 @@ ENDPROC(native_usergs_sysret64) +@@ -375,8 +660,8 @@ ENDPROC(native_usergs_sysret64) .endm .macro UNFAKE_STACK_FRAME @@ -16158,7 +19282,7 @@ index cdc79b5..4710a75 100644 .endm /* -@@ -320,7 +604,7 @@ ENDPROC(native_usergs_sysret64) +@@ -463,7 +748,7 @@ ENDPROC(native_usergs_sysret64) movq %rsp, %rsi leaq -RBP(%rsp),%rdi /* arg1 for handler */ @@ -16167,7 +19291,7 @@ index cdc79b5..4710a75 100644 je 1f SWAPGS /* -@@ -355,9 +639,10 @@ ENTRY(save_rest) +@@ -498,9 +783,10 @@ ENTRY(save_rest) movq_cfi r15, R15+16 movq %r11, 8(%rsp) /* return address */ FIXUP_TOP_OF_STACK %r11, 16 @@ -16179,7 +19303,7 @@ index cdc79b5..4710a75 100644 /* save complete stack frame */ .pushsection .kprobes.text, "ax" -@@ -386,9 +671,10 @@ ENTRY(save_paranoid) +@@ -529,9 +815,10 @@ ENTRY(save_paranoid) js 1f /* negative -> in kernel */ SWAPGS xorl %ebx,%ebx @@ -16192,25 +19316,25 @@ index cdc79b5..4710a75 100644 .popsection /* -@@ -410,7 +696,7 @@ ENTRY(ret_from_fork) +@@ -553,7 +840,7 @@ ENTRY(ret_from_fork) RESTORE_REST - testl $3, CS-ARGOFFSET(%rsp) # from kernel_thread? + testb $3, CS-ARGOFFSET(%rsp) # from kernel_thread? - jz retint_restore_args + jz 1f testl $_TIF_IA32, TI_flags(%rcx) # 32-bit compat task needs IRET -@@ -420,7 +706,7 @@ ENTRY(ret_from_fork) - jmp ret_from_sys_call # go to the SYSRET fastpath - +@@ -571,7 +858,7 @@ ENTRY(ret_from_fork) + RESTORE_REST + jmp int_ret_from_sys_call CFI_ENDPROC -END(ret_from_fork) +ENDPROC(ret_from_fork) /* * System call entry. Up to 6 arguments in registers are supported. -@@ -456,7 +742,7 @@ END(ret_from_fork) +@@ -608,7 +895,7 @@ END(ret_from_fork) ENTRY(system_call) CFI_STARTPROC simple CFI_SIGNAL_FRAME @@ -16219,12 +19343,17 @@ index cdc79b5..4710a75 100644 CFI_REGISTER rip,rcx /*CFI_REGISTER rflags,r11*/ SWAPGS_UNSAFE_STACK -@@ -469,16 +755,18 @@ GLOBAL(system_call_after_swapgs) +@@ -621,16 +908,23 @@ GLOBAL(system_call_after_swapgs) movq %rsp,PER_CPU_VAR(old_rsp) movq PER_CPU_VAR(kernel_stack),%rsp + SAVE_ARGS 8*6,0 + pax_enter_kernel_user ++ ++#ifdef CONFIG_PAX_RANDKSTACK ++ pax_erase_kstack ++#endif ++ /* * No need to follow this irqs off/on section - it's straight * and short: @@ -16240,7 +19369,7 @@ index cdc79b5..4710a75 100644 jnz tracesys system_call_fastpath: #if __SYSCALL_MASK == ~0 -@@ -488,7 +776,7 @@ system_call_fastpath: +@@ -640,7 +934,7 @@ system_call_fastpath: cmpl $__NR_syscall_max,%eax #endif ja badsys @@ -16249,7 +19378,7 @@ index cdc79b5..4710a75 100644 call *sys_call_table(,%rax,8) # XXX: rip relative movq %rax,RAX-ARGOFFSET(%rsp) /* -@@ -502,10 +790,13 @@ sysret_check: +@@ -654,10 +948,13 @@ sysret_check: LOCKDEP_SYS_EXIT DISABLE_INTERRUPTS(CLBR_NONE) TRACE_IRQS_OFF @@ -16264,7 +19393,7 @@ index cdc79b5..4710a75 100644 /* * sysretq will re-enable interrupts: */ -@@ -557,14 +848,18 @@ badsys: +@@ -709,14 +1006,18 @@ badsys: * jump back to the normal fast path. */ auditsys: @@ -16284,7 +19413,7 @@ index cdc79b5..4710a75 100644 jmp system_call_fastpath /* -@@ -585,7 +880,7 @@ sysret_audit: +@@ -737,7 +1038,7 @@ sysret_audit: /* Do syscall tracing */ tracesys: #ifdef CONFIG_AUDITSYSCALL @@ -16293,7 +19422,7 @@ index cdc79b5..4710a75 100644 jz auditsys #endif SAVE_REST -@@ -593,12 +888,16 @@ tracesys: +@@ -745,12 +1046,16 @@ tracesys: FIXUP_TOP_OF_STACK %rdi movq %rsp,%rdi call syscall_trace_enter @@ -16310,7 +19439,7 @@ index cdc79b5..4710a75 100644 RESTORE_REST #if __SYSCALL_MASK == ~0 cmpq $__NR_syscall_max,%rax -@@ -607,7 +906,7 @@ tracesys: +@@ -759,7 +1064,7 @@ tracesys: cmpl $__NR_syscall_max,%eax #endif ja int_ret_from_sys_call /* RAX(%rsp) set to -ENOSYS above */ @@ -16319,33 +19448,51 @@ index cdc79b5..4710a75 100644 call *sys_call_table(,%rax,8) movq %rax,RAX-ARGOFFSET(%rsp) /* Use IRET because user could have changed frame */ -@@ -628,6 +927,7 @@ GLOBAL(int_with_check) +@@ -780,7 +1085,9 @@ GLOBAL(int_with_check) andl %edi,%edx jnz int_careful andl $~TS_COMPAT,TI_status(%rcx) +- jmp retint_swapgs ++ pax_exit_kernel_user + pax_erase_kstack - jmp retint_swapgs ++ jmp retint_swapgs_pax /* Either reschedule or signal or syscall exit tracking needed. */ -@@ -674,7 +974,7 @@ int_restore_rest: + /* First do a reschedule test. */ +@@ -826,7 +1133,7 @@ int_restore_rest: TRACE_IRQS_OFF jmp int_with_check CFI_ENDPROC -END(system_call) +ENDPROC(system_call) - /* - * Certain special system calls that need to save a complete full stack frame. -@@ -690,7 +990,7 @@ ENTRY(\label) + .macro FORK_LIKE func + ENTRY(stub_\func) +@@ -839,9 +1146,10 @@ ENTRY(stub_\func) + DEFAULT_FRAME 0 8 /* offset 8: return address */ + call sys_\func + RESTORE_TOP_OF_STACK %r11, 8 ++ pax_force_retaddr + ret $REST_SKIP /* pop extended registers */ + CFI_ENDPROC +-END(stub_\func) ++ENDPROC(stub_\func) + .endm + + .macro FIXED_FRAME label,func +@@ -851,9 +1159,10 @@ ENTRY(\label) + FIXUP_TOP_OF_STACK %r11, 8-ARGOFFSET call \func - jmp ptregscall_common + RESTORE_TOP_OF_STACK %r11, 8-ARGOFFSET ++ pax_force_retaddr + ret CFI_ENDPROC -END(\label) +ENDPROC(\label) .endm - PTREGSCALL stub_clone, sys_clone, %r8 -@@ -708,9 +1008,10 @@ ENTRY(ptregscall_common) + FORK_LIKE clone +@@ -870,9 +1179,10 @@ ENTRY(ptregscall_common) movq_cfi_restore R12+8, r12 movq_cfi_restore RBP+8, rbp movq_cfi_restore RBX+8, rbx @@ -16357,7 +19504,7 @@ index cdc79b5..4710a75 100644 ENTRY(stub_execve) CFI_STARTPROC -@@ -725,7 +1026,7 @@ ENTRY(stub_execve) +@@ -885,7 +1195,7 @@ ENTRY(stub_execve) RESTORE_REST jmp int_ret_from_sys_call CFI_ENDPROC @@ -16366,7 +19513,7 @@ index cdc79b5..4710a75 100644 /* * sigreturn is special because it needs to restore all registers on return. -@@ -743,7 +1044,7 @@ ENTRY(stub_rt_sigreturn) +@@ -902,7 +1212,7 @@ ENTRY(stub_rt_sigreturn) RESTORE_REST jmp int_ret_from_sys_call CFI_ENDPROC @@ -16374,8 +19521,26 @@ index cdc79b5..4710a75 100644 +ENDPROC(stub_rt_sigreturn) #ifdef CONFIG_X86_X32_ABI - PTREGSCALL stub_x32_sigaltstack, sys32_sigaltstack, %rdx -@@ -812,7 +1113,7 @@ vector=vector+1 + ENTRY(stub_x32_rt_sigreturn) +@@ -916,7 +1226,7 @@ ENTRY(stub_x32_rt_sigreturn) + RESTORE_REST + jmp int_ret_from_sys_call + CFI_ENDPROC +-END(stub_x32_rt_sigreturn) ++ENDPROC(stub_x32_rt_sigreturn) + + ENTRY(stub_x32_execve) + CFI_STARTPROC +@@ -930,7 +1240,7 @@ ENTRY(stub_x32_execve) + RESTORE_REST + jmp int_ret_from_sys_call + CFI_ENDPROC +-END(stub_x32_execve) ++ENDPROC(stub_x32_execve) + + #endif + +@@ -967,7 +1277,7 @@ vector=vector+1 2: jmp common_interrupt .endr CFI_ENDPROC @@ -16384,7 +19549,7 @@ index cdc79b5..4710a75 100644 .previous END(interrupt) -@@ -832,6 +1133,16 @@ END(interrupt) +@@ -987,6 +1297,16 @@ END(interrupt) subq $ORIG_RAX-RBP, %rsp CFI_ADJUST_CFA_OFFSET ORIG_RAX-RBP SAVE_ARGS_IRQ @@ -16401,7 +19566,7 @@ index cdc79b5..4710a75 100644 call \func .endm -@@ -863,7 +1174,7 @@ ret_from_intr: +@@ -1019,7 +1339,7 @@ ret_from_intr: exit_intr: GET_THREAD_INFO(%rcx) @@ -16410,11 +19575,12 @@ index cdc79b5..4710a75 100644 je retint_kernel /* Interrupt came from user space */ -@@ -885,12 +1196,15 @@ retint_swapgs: /* return to user-space */ +@@ -1041,12 +1361,16 @@ retint_swapgs: /* return to user-space */ * The iretq could re-enable interrupts: */ DISABLE_INTERRUPTS(CLBR_ANY) + pax_exit_kernel_user ++retint_swapgs_pax: TRACE_IRQS_IRETQ SWAPGS jmp restore_args @@ -16422,11 +19588,11 @@ index cdc79b5..4710a75 100644 retint_restore_args: /* return to kernel space */ DISABLE_INTERRUPTS(CLBR_ANY) + pax_exit_kernel -+ pax_force_retaddr RIP-ARGOFFSET ++ pax_force_retaddr (RIP-ARGOFFSET) /* * The iretq could re-enable interrupts: */ -@@ -979,7 +1293,7 @@ ENTRY(retint_kernel) +@@ -1129,7 +1453,7 @@ ENTRY(retint_kernel) #endif CFI_ENDPROC @@ -16435,7 +19601,7 @@ index cdc79b5..4710a75 100644 /* * End of kprobes section */ -@@ -996,7 +1310,7 @@ ENTRY(\sym) +@@ -1147,7 +1471,7 @@ ENTRY(\sym) interrupt \do_sym jmp ret_from_intr CFI_ENDPROC @@ -16444,7 +19610,7 @@ index cdc79b5..4710a75 100644 .endm #ifdef CONFIG_SMP -@@ -1069,12 +1383,22 @@ ENTRY(\sym) +@@ -1203,12 +1527,22 @@ ENTRY(\sym) CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 call error_entry DEFAULT_FRAME 0 @@ -16468,7 +19634,7 @@ index cdc79b5..4710a75 100644 .endm .macro paranoidzeroentry sym do_sym -@@ -1086,15 +1410,25 @@ ENTRY(\sym) +@@ -1221,15 +1555,25 @@ ENTRY(\sym) CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 call save_paranoid TRACE_IRQS_OFF @@ -16496,10 +19662,10 @@ index cdc79b5..4710a75 100644 .macro paranoidzeroentry_ist sym do_sym ist ENTRY(\sym) INTR_FRAME -@@ -1104,14 +1438,30 @@ ENTRY(\sym) +@@ -1240,14 +1584,30 @@ ENTRY(\sym) CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 call save_paranoid - TRACE_IRQS_OFF + TRACE_IRQS_OFF_DEBUG +#ifdef CONFIG_PAX_MEMORY_UDEREF + testb $3, CS(%rsp) + jnz 1f @@ -16528,7 +19694,7 @@ index cdc79b5..4710a75 100644 .endm .macro errorentry sym do_sym -@@ -1122,13 +1472,23 @@ ENTRY(\sym) +@@ -1259,13 +1619,23 @@ ENTRY(\sym) CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15 call error_entry DEFAULT_FRAME 0 @@ -16553,7 +19719,7 @@ index cdc79b5..4710a75 100644 .endm /* error code is on the stack already */ -@@ -1141,13 +1501,23 @@ ENTRY(\sym) +@@ -1279,13 +1649,23 @@ ENTRY(\sym) call save_paranoid DEFAULT_FRAME 0 TRACE_IRQS_OFF @@ -16578,7 +19744,7 @@ index cdc79b5..4710a75 100644 .endm zeroentry divide_error do_divide_error -@@ -1177,9 +1547,10 @@ gs_change: +@@ -1315,9 +1695,10 @@ gs_change: 2: mfence /* workaround */ SWAPGS popfq_cfi @@ -16588,39 +19754,9 @@ index cdc79b5..4710a75 100644 -END(native_load_gs_index) +ENDPROC(native_load_gs_index) - .section __ex_table,"a" - .align 8 -@@ -1201,13 +1572,14 @@ ENTRY(kernel_thread_helper) - * Here we are in the child and the registers are set as they were - * at kernel_thread() invocation in the parent. - */ -+ pax_force_fptr %rsi - call *%rsi - # exit - mov %eax, %edi - call do_exit - ud2 # padding for call trace - CFI_ENDPROC --END(kernel_thread_helper) -+ENDPROC(kernel_thread_helper) - - /* - * execve(). This function needs to use IRET, not SYSRET, to set up all state properly. -@@ -1234,11 +1606,11 @@ ENTRY(kernel_execve) - RESTORE_REST - testq %rax,%rax - je int_ret_from_sys_call -- RESTORE_ARGS - UNFAKE_STACK_FRAME -+ pax_force_retaddr - ret - CFI_ENDPROC --END(kernel_execve) -+ENDPROC(kernel_execve) - - /* Call softirq on interrupt stack. Interrupts are off. */ - ENTRY(call_softirq) -@@ -1256,9 +1628,10 @@ ENTRY(call_softirq) + _ASM_EXTABLE(gs_change,bad_gs) + .section .fixup,"ax" +@@ -1345,9 +1726,10 @@ ENTRY(call_softirq) CFI_DEF_CFA_REGISTER rsp CFI_ADJUST_CFA_OFFSET -8 decl PER_CPU_VAR(irq_count) @@ -16632,7 +19768,7 @@ index cdc79b5..4710a75 100644 #ifdef CONFIG_XEN zeroentry xen_hypervisor_callback xen_do_hypervisor_callback -@@ -1296,7 +1669,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs) +@@ -1385,7 +1767,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs) decl PER_CPU_VAR(irq_count) jmp error_exit CFI_ENDPROC @@ -16641,17 +19777,17 @@ index cdc79b5..4710a75 100644 /* * Hypervisor uses this for application faults while it executes. -@@ -1355,7 +1728,7 @@ ENTRY(xen_failsafe_callback) +@@ -1444,7 +1826,7 @@ ENTRY(xen_failsafe_callback) SAVE_ALL jmp error_exit CFI_ENDPROC -END(xen_failsafe_callback) +ENDPROC(xen_failsafe_callback) - apicinterrupt XEN_HVM_EVTCHN_CALLBACK \ + apicinterrupt HYPERVISOR_CALLBACK_VECTOR \ xen_hvm_callback_vector xen_evtchn_do_upcall -@@ -1404,16 +1777,31 @@ ENTRY(paranoid_exit) - TRACE_IRQS_OFF +@@ -1498,16 +1880,31 @@ ENTRY(paranoid_exit) + TRACE_IRQS_OFF_DEBUG testl %ebx,%ebx /* swapgs needed? */ jnz paranoid_restore - testl $3,CS(%rsp) @@ -16677,13 +19813,13 @@ index cdc79b5..4710a75 100644 jmp irq_return paranoid_restore: + pax_exit_kernel - TRACE_IRQS_IRETQ 0 + TRACE_IRQS_IRETQ_DEBUG 0 RESTORE_ALL 8 + pax_force_retaddr_bts jmp irq_return paranoid_userspace: GET_THREAD_INFO(%rcx) -@@ -1442,7 +1830,7 @@ paranoid_schedule: +@@ -1536,7 +1933,7 @@ paranoid_schedule: TRACE_IRQS_OFF jmp paranoid_userspace CFI_ENDPROC @@ -16692,7 +19828,7 @@ index cdc79b5..4710a75 100644 /* * Exception entry point. This expects an error code/orig_rax on the stack. -@@ -1469,12 +1857,13 @@ ENTRY(error_entry) +@@ -1563,12 +1960,13 @@ ENTRY(error_entry) movq_cfi r14, R14+8 movq_cfi r15, R15+8 xorl %ebx,%ebx @@ -16707,7 +19843,7 @@ index cdc79b5..4710a75 100644 ret /* -@@ -1501,7 +1890,7 @@ bstep_iret: +@@ -1595,7 +1993,7 @@ bstep_iret: movq %rcx,RIP+8(%rsp) jmp error_swapgs CFI_ENDPROC @@ -16716,7 +19852,7 @@ index cdc79b5..4710a75 100644 /* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */ -@@ -1521,7 +1910,7 @@ ENTRY(error_exit) +@@ -1615,7 +2013,7 @@ ENTRY(error_exit) jnz retint_careful jmp retint_swapgs CFI_ENDPROC @@ -16725,7 +19861,7 @@ index cdc79b5..4710a75 100644 /* * Test if a given stack is an NMI stack or not. -@@ -1579,9 +1968,11 @@ ENTRY(nmi) +@@ -1673,9 +2071,11 @@ ENTRY(nmi) * If %cs was not the kernel segment, then the NMI triggered in user * space, which means it is definitely not nested. */ @@ -16738,10 +19874,28 @@ index cdc79b5..4710a75 100644 /* * Check the special variable on the stack to see if NMIs are * executing. -@@ -1728,6 +2119,16 @@ end_repeat_nmi: +@@ -1709,8 +2109,7 @@ nested_nmi: + + 1: + /* Set up the interrupted NMIs stack to jump to repeat_nmi */ +- leaq -1*8(%rsp), %rdx +- movq %rdx, %rsp ++ subq $8, %rsp + CFI_ADJUST_CFA_OFFSET 1*8 + leaq -10*8(%rsp), %rdx + pushq_cfi $__KERNEL_DS +@@ -1728,6 +2127,7 @@ nested_nmi_out: + CFI_RESTORE rdx + + /* No need to check faults here */ ++ pax_force_retaddr_bts + INTERRUPT_RETURN + + CFI_RESTORE_STATE +@@ -1844,6 +2244,17 @@ end_repeat_nmi: */ - call save_paranoid - DEFAULT_FRAME 0 + movq %cr2, %r12 + +#ifdef CONFIG_PAX_MEMORY_UDEREF + testb $3, CS(%rsp) + jnz 1f @@ -16752,10 +19906,11 @@ index cdc79b5..4710a75 100644 +#else + pax_enter_kernel +#endif ++ /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */ movq %rsp,%rdi movq $-1,%rsi -@@ -1735,21 +2136,32 @@ end_repeat_nmi: +@@ -1859,23 +2270,34 @@ end_repeat_nmi: testl %ebx,%ebx /* swapgs needed? */ jnz nmi_restore nmi_swapgs: @@ -16765,16 +19920,18 @@ index cdc79b5..4710a75 100644 + pax_exit_kernel +#endif SWAPGS_UNSAFE_STACK -+ RESTORE_ALL 8 ++ RESTORE_ALL 6*8 + /* Clear the NMI executing stack variable */ -+ movq $0, 10*8(%rsp) ++ movq $0, 5*8(%rsp) + jmp irq_return nmi_restore: + pax_exit_kernel - RESTORE_ALL 8 + /* Pop the extra iret frame at once */ + RESTORE_ALL 6*8 + pax_force_retaddr_bts + /* Clear the NMI executing stack variable */ - movq $0, 10*8(%rsp) + movq $0, 5*8(%rsp) jmp irq_return CFI_ENDPROC -END(nmi) @@ -16791,40 +19948,10 @@ index cdc79b5..4710a75 100644 /* * End of kprobes section diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c -index c9a281f..ce2f317 100644 +index 42a392a..fbbd930 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c -@@ -126,7 +126,7 @@ static void *mod_code_ip; /* holds the IP to write to */ - static const void *mod_code_newcode; /* holds the text to write to the IP */ - - static unsigned nmi_wait_count; --static atomic_t nmi_update_count = ATOMIC_INIT(0); -+static atomic_unchecked_t nmi_update_count = ATOMIC_INIT(0); - - int ftrace_arch_read_dyn_info(char *buf, int size) - { -@@ -134,7 +134,7 @@ int ftrace_arch_read_dyn_info(char *buf, int size) - - r = snprintf(buf, size, "%u %u", - nmi_wait_count, -- atomic_read(&nmi_update_count)); -+ atomic_read_unchecked(&nmi_update_count)); - return r; - } - -@@ -177,8 +177,10 @@ void ftrace_nmi_enter(void) - - if (atomic_inc_return(&nmi_running) & MOD_CODE_WRITE_FLAG) { - smp_rmb(); -+ pax_open_kernel(); - ftrace_mod_code(); -- atomic_inc(&nmi_update_count); -+ pax_close_kernel(); -+ atomic_inc_unchecked(&nmi_update_count); - } - /* Must have previous changes seen before executions */ - smp_mb(); -@@ -271,6 +273,8 @@ ftrace_modify_code(unsigned long ip, unsigned const char *old_code, +@@ -105,6 +105,8 @@ ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code, { unsigned char replaced[MCOUNT_INSN_SIZE]; @@ -16833,16 +19960,52 @@ index c9a281f..ce2f317 100644 /* * Note: Due to modules and __init, code can * disappear and change, we need to protect against faulting -@@ -327,7 +331,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func) +@@ -227,7 +229,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func) unsigned char old[MCOUNT_INSN_SIZE], *new; int ret; - memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE); + memcpy(old, (void *)ktla_ktva((unsigned long)ftrace_call), MCOUNT_INSN_SIZE); new = ftrace_call_replace(ip, (unsigned long)func); - ret = ftrace_modify_code(ip, old, new); -@@ -353,6 +357,8 @@ static int ftrace_mod_jmp(unsigned long ip, + /* See comment above by declaration of modifying_ftrace_code */ +@@ -238,7 +240,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func) + /* Also update the regs callback function */ + if (!ret) { + ip = (unsigned long)(&ftrace_regs_call); +- memcpy(old, &ftrace_regs_call, MCOUNT_INSN_SIZE); ++ memcpy(old, ktla_ktva((void *)&ftrace_regs_call), MCOUNT_INSN_SIZE); + new = ftrace_call_replace(ip, (unsigned long)func); + ret = ftrace_modify_code(ip, old, new); + } +@@ -279,7 +281,7 @@ static int ftrace_write(unsigned long ip, const char *val, int size) + * kernel identity mapping to modify code. + */ + if (within(ip, (unsigned long)_text, (unsigned long)_etext)) +- ip = (unsigned long)__va(__pa_symbol(ip)); ++ ip = (unsigned long)__va(__pa_symbol(ktla_ktva(ip))); + + return probe_kernel_write((void *)ip, val, size); + } +@@ -289,7 +291,7 @@ static int add_break(unsigned long ip, const char *old) + unsigned char replaced[MCOUNT_INSN_SIZE]; + unsigned char brk = BREAKPOINT_INSTRUCTION; + +- if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) ++ if (probe_kernel_read(replaced, (void *)ktla_ktva(ip), MCOUNT_INSN_SIZE)) + return -EFAULT; + + /* Make sure it is what we expect it to be */ +@@ -637,7 +639,7 @@ ftrace_modify_code(unsigned long ip, unsigned const char *old_code, + return ret; + + fail_update: +- probe_kernel_write((void *)ip, &old_code[0], 1); ++ probe_kernel_write((void *)ktla_ktva(ip), &old_code[0], 1); + goto out; + } + +@@ -670,6 +672,8 @@ static int ftrace_mod_jmp(unsigned long ip, { unsigned char code[MCOUNT_INSN_SIZE]; @@ -16851,33 +20014,23 @@ index c9a281f..ce2f317 100644 if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE)) return -EFAULT; -diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c -index 51ff186..9e77418 100644 ---- a/arch/x86/kernel/head32.c -+++ b/arch/x86/kernel/head32.c -@@ -19,6 +19,7 @@ - #include <asm/io_apic.h> - #include <asm/bios_ebda.h> - #include <asm/tlbflush.h> -+#include <asm/boot.h> +diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c +index 1c68ccb..b4bc15c 100644 +--- a/arch/x86/kernel/head64.c ++++ b/arch/x86/kernel/head64.c +@@ -175,7 +175,6 @@ void __init x86_64_start_kernel(char * real_mode_data) + if (console_loglevel == 10) + early_printk("Kernel alive\n"); - static void __init i386_default_early_setup(void) - { -@@ -31,8 +32,7 @@ static void __init i386_default_early_setup(void) - - void __init i386_start_kernel(void) - { -- memblock_reserve(__pa_symbol(&_text), -- __pa_symbol(&__bss_stop) - __pa_symbol(&_text)); -+ memblock_reserve(LOAD_PHYSICAL_ADDR, __pa_symbol(&__bss_stop) - LOAD_PHYSICAL_ADDR); +- clear_page(init_level4_pgt); + /* set init_level4_pgt kernel high mapping*/ + init_level4_pgt[511] = early_level4_pgt[511]; - #ifdef CONFIG_BLK_DEV_INITRD - /* Reserve INITRD */ diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S -index ce0be7c..c41476e 100644 +index 73afd11..d1670f5 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S -@@ -25,6 +25,12 @@ +@@ -26,6 +26,12 @@ /* Physical address */ #define pa(X) ((X) - __PAGE_OFFSET) @@ -16890,7 +20043,7 @@ index ce0be7c..c41476e 100644 /* * References to members of the new_cpu_data structure. */ -@@ -54,11 +60,7 @@ +@@ -55,11 +61,7 @@ * and small than max_low_pfn, otherwise will waste some page table entries */ @@ -16903,7 +20056,7 @@ index ce0be7c..c41476e 100644 /* Number of possible pages in the lowmem region */ LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) -@@ -77,6 +79,12 @@ INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE +@@ -78,6 +80,12 @@ INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE RESERVE_BRK(pagetables, INIT_MAP_SIZE) /* @@ -16916,7 +20069,7 @@ index ce0be7c..c41476e 100644 * 32-bit kernel entrypoint; only used by the boot CPU. On entry, * %esi points to the real-mode code as a 32-bit pointer. * CS and DS must be 4 GB flat segments, but we don't depend on -@@ -84,6 +92,13 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE) +@@ -85,6 +93,13 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE) * can. */ __HEAD @@ -16930,20 +20083,20 @@ index ce0be7c..c41476e 100644 ENTRY(startup_32) movl pa(stack_start),%ecx -@@ -105,6 +120,57 @@ ENTRY(startup_32) +@@ -106,6 +121,59 @@ ENTRY(startup_32) 2: leal -__PAGE_OFFSET(%ecx),%esp +#ifdef CONFIG_SMP + movl $pa(cpu_gdt_table),%edi + movl $__per_cpu_load,%eax -+ movw %ax,__KERNEL_PERCPU + 2(%edi) ++ movw %ax,GDT_ENTRY_PERCPU * 8 + 2(%edi) + rorl $16,%eax -+ movb %al,__KERNEL_PERCPU + 4(%edi) -+ movb %ah,__KERNEL_PERCPU + 7(%edi) ++ movb %al,GDT_ENTRY_PERCPU * 8 + 4(%edi) ++ movb %ah,GDT_ENTRY_PERCPU * 8 + 7(%edi) + movl $__per_cpu_end - 1,%eax + subl $__per_cpu_start,%eax -+ movw %ax,__KERNEL_PERCPU + 0(%edi) ++ movw %ax,GDT_ENTRY_PERCPU * 8 + 0(%edi) +#endif + +#ifdef CONFIG_PAX_MEMORY_UDEREF @@ -16960,10 +20113,10 @@ index ce0be7c..c41476e 100644 +#ifdef CONFIG_PAX_KERNEXEC + movl $pa(boot_gdt),%edi + movl $__LOAD_PHYSICAL_ADDR,%eax -+ movw %ax,__BOOT_CS + 2(%edi) ++ movw %ax,GDT_ENTRY_BOOT_CS * 8 + 2(%edi) + rorl $16,%eax -+ movb %al,__BOOT_CS + 4(%edi) -+ movb %ah,__BOOT_CS + 7(%edi) ++ movb %al,GDT_ENTRY_BOOT_CS * 8 + 4(%edi) ++ movb %ah,GDT_ENTRY_BOOT_CS * 8 + 7(%edi) + rorl $16,%eax + + ljmp $(__BOOT_CS),$1f @@ -16973,13 +20126,15 @@ index ce0be7c..c41476e 100644 + movl $pa(cpu_gdt_table),%edi + addl $__PAGE_OFFSET,%eax +1: -+ movw %ax,__KERNEL_CS + 2(%edi) -+ movw %ax,__KERNEXEC_KERNEL_CS + 2(%edi) ++ movb $0xc0,GDT_ENTRY_KERNEL_CS * 8 + 6(%edi) ++ movb $0xc0,GDT_ENTRY_KERNEXEC_KERNEL_CS * 8 + 6(%edi) ++ movw %ax,GDT_ENTRY_KERNEL_CS * 8 + 2(%edi) ++ movw %ax,GDT_ENTRY_KERNEXEC_KERNEL_CS * 8 + 2(%edi) + rorl $16,%eax -+ movb %al,__KERNEL_CS + 4(%edi) -+ movb %al,__KERNEXEC_KERNEL_CS + 4(%edi) -+ movb %ah,__KERNEL_CS + 7(%edi) -+ movb %ah,__KERNEXEC_KERNEL_CS + 7(%edi) ++ movb %al,GDT_ENTRY_KERNEL_CS * 8 + 4(%edi) ++ movb %al,GDT_ENTRY_KERNEXEC_KERNEL_CS * 8 + 4(%edi) ++ movb %ah,GDT_ENTRY_KERNEL_CS * 8 + 7(%edi) ++ movb %ah,GDT_ENTRY_KERNEXEC_KERNEL_CS * 8 + 7(%edi) + rorl $16,%eax + addl $PAGE_SIZE_asm,%edi + loop 1b @@ -16988,7 +20143,7 @@ index ce0be7c..c41476e 100644 /* * Clear BSS first so that there are no surprises... */ -@@ -195,8 +261,11 @@ ENTRY(startup_32) +@@ -201,8 +269,11 @@ ENTRY(startup_32) movl %eax, pa(max_pfn_mapped) /* Do early initialization of the fixmap area */ @@ -17002,7 +20157,7 @@ index ce0be7c..c41476e 100644 #else /* Not PAE */ page_pde_offset = (__PAGE_OFFSET >> 20); -@@ -226,8 +295,11 @@ page_pde_offset = (__PAGE_OFFSET >> 20); +@@ -232,8 +303,11 @@ page_pde_offset = (__PAGE_OFFSET >> 20); movl %eax, pa(max_pfn_mapped) /* Do early initialization of the fixmap area */ @@ -17016,7 +20171,7 @@ index ce0be7c..c41476e 100644 #endif #ifdef CONFIG_PARAVIRT -@@ -241,9 +313,7 @@ page_pde_offset = (__PAGE_OFFSET >> 20); +@@ -247,9 +321,7 @@ page_pde_offset = (__PAGE_OFFSET >> 20); cmpl $num_subarch_entries, %eax jae bad_subarch @@ -17027,7 +20182,7 @@ index ce0be7c..c41476e 100644 bad_subarch: WEAK(lguest_entry) -@@ -255,10 +325,10 @@ WEAK(xen_entry) +@@ -261,10 +333,10 @@ WEAK(xen_entry) __INITDATA subarch_entries: @@ -17042,25 +20197,25 @@ index ce0be7c..c41476e 100644 num_subarch_entries = (. - subarch_entries) / 4 .previous #else -@@ -312,6 +382,7 @@ default_entry: - orl %edx,%eax +@@ -355,6 +427,7 @@ default_entry: + movl pa(mmu_cr4_features),%eax movl %eax,%cr4 +#ifdef CONFIG_X86_PAE testb $X86_CR4_PAE, %al # check if PAE is enabled - jz 6f + jz enable_paging -@@ -340,6 +411,9 @@ default_entry: +@@ -383,6 +456,9 @@ default_entry: /* Make changes effective */ wrmsr + btsl $_PAGE_BIT_NX-32,pa(__supported_pte_mask+4) +#endif + - 6: + enable_paging: /* -@@ -443,7 +517,7 @@ is386: movl $2,%ecx # set MP +@@ -451,14 +527,20 @@ is486: 1: movl $(__KERNEL_DS),%eax # reload all the segment registers movl %eax,%ss # after changing gdt. @@ -17069,10 +20224,23 @@ index ce0be7c..c41476e 100644 movl %eax,%ds movl %eax,%es -@@ -457,15 +531,22 @@ is386: movl $2,%ecx # set MP + movl $(__KERNEL_PERCPU), %eax + movl %eax,%fs # set this cpu's percpu + ++#ifdef CONFIG_CC_STACKPROTECTOR + movl $(__KERNEL_STACK_CANARY),%eax ++#elif defined(CONFIG_PAX_MEMORY_UDEREF) ++ movl $(__USER_DS),%eax ++#else ++ xorl %eax,%eax ++#endif + movl %eax,%gs + + xorl %eax,%eax # Clear LDT +@@ -534,8 +616,11 @@ setup_once: + * relocation. Manually set base address in stack canary + * segment descriptor. */ - cmpb $0,ready - jne 1f - movl $gdt_page,%eax + movl $cpu_gdt_table,%eax movl $stack_canary,%ecx @@ -17082,47 +20250,26 @@ index ce0be7c..c41476e 100644 movw %cx, 8 * GDT_ENTRY_STACK_CANARY + 2(%eax) shrl $16, %ecx movb %cl, 8 * GDT_ENTRY_STACK_CANARY + 4(%eax) - movb %ch, 8 * GDT_ENTRY_STACK_CANARY + 7(%eax) - 1: --#endif - movl $(__KERNEL_STACK_CANARY),%eax -+#elif defined(CONFIG_PAX_MEMORY_UDEREF) -+ movl $(__USER_DS),%eax -+#else -+ xorl %eax,%eax -+#endif - movl %eax,%gs - - xorl %eax,%eax # Clear LDT -@@ -558,22 +639,22 @@ early_page_fault: - jmp early_fault - - early_fault: -- cld - #ifdef CONFIG_PRINTK +@@ -566,7 +651,7 @@ ENDPROC(early_idt_handlers) + /* This is global to keep gas from relaxing the jumps */ + ENTRY(early_idt_handler) + cld +- cmpl $2,%ss:early_recursion_flag + cmpl $1,%ss:early_recursion_flag -+ je hlt_loop -+ incl %ss:early_recursion_flag -+ cld - pusha - movl $(__KERNEL_DS),%eax - movl %eax,%ds - movl %eax,%es -- cmpl $2,early_recursion_flag -- je hlt_loop -- incl early_recursion_flag - movl %cr2,%eax - pushl %eax - pushl %edx /* trapno */ + je hlt_loop + incl %ss:early_recursion_flag + +@@ -604,8 +689,8 @@ ENTRY(early_idt_handler) + pushl (20+6*4)(%esp) /* trapno */ pushl $fault_msg call printk -+; call dump_stack - #endif -- call dump_stack +-#endif + call dump_stack ++#endif hlt_loop: hlt jmp hlt_loop -@@ -581,8 +662,11 @@ hlt_loop: +@@ -624,8 +709,11 @@ ENDPROC(early_idt_handler) /* This is the default interrupt "handler" :-) */ ALIGN ignore_int: @@ -17135,7 +20282,7 @@ index ce0be7c..c41476e 100644 pushl %eax pushl %ecx pushl %edx -@@ -591,9 +675,6 @@ ignore_int: +@@ -634,9 +722,6 @@ ignore_int: movl $(__KERNEL_DS),%eax movl %eax,%ds movl %eax,%es @@ -17145,7 +20292,7 @@ index ce0be7c..c41476e 100644 pushl 16(%esp) pushl 24(%esp) pushl 32(%esp) -@@ -622,29 +703,43 @@ ENTRY(initial_code) +@@ -670,29 +755,43 @@ ENTRY(setup_once_ref) /* * BSS section */ @@ -17194,7 +20341,7 @@ index ce0be7c..c41476e 100644 ENTRY(initial_page_table) .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */ # if KPMDS == 3 -@@ -663,18 +758,27 @@ ENTRY(initial_page_table) +@@ -711,12 +810,20 @@ ENTRY(initial_page_table) # error "Kernel PMDs should be 1, 2 or 3" # endif .align PAGE_SIZE /* needs to be page-sized too */ @@ -17214,18 +20361,18 @@ index ce0be7c..c41476e 100644 - .long init_thread_union+THREAD_SIZE + .long init_thread_union+THREAD_SIZE-8 -+ready: .byte 0 -+ -+.section .rodata,"a",@progbits - early_recursion_flag: - .long 0 - --ready: .byte 0 -- + __INITRODATA int_msg: - .asciz "Unknown interrupt or fault at: %p %p %p\n" +@@ -744,7 +851,7 @@ fault_msg: + * segment size, and 32-bit linear address value: + */ -@@ -707,7 +811,7 @@ fault_msg: +- .data ++.section .rodata,"a",@progbits + .globl boot_gdt_descr + .globl idt_descr + +@@ -753,7 +860,7 @@ fault_msg: .word 0 # 32 bit align gdt_desc.address boot_gdt_descr: .word __BOOT_DS+7 @@ -17234,7 +20381,7 @@ index ce0be7c..c41476e 100644 .word 0 # 32-bit align idt_desc.address idt_descr: -@@ -718,7 +822,7 @@ idt_descr: +@@ -764,7 +871,7 @@ idt_descr: .word 0 # 32 bit align gdt_desc.address ENTRY(early_gdt_descr) .word GDT_ENTRIES*8-1 @@ -17243,7 +20390,7 @@ index ce0be7c..c41476e 100644 /* * The boot_gdt must mirror the equivalent in setup.S and is -@@ -727,5 +831,65 @@ ENTRY(early_gdt_descr) +@@ -773,5 +880,65 @@ ENTRY(early_gdt_descr) .align L1_CACHE_BYTES ENTRY(boot_gdt) .fill GDT_ENTRY_BOOT_CS,8,0 @@ -17312,19 +20459,19 @@ index ce0be7c..c41476e 100644 + .fill PAGE_SIZE_asm - GDT_SIZE,1,0 + .endr diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S -index 40f4eb3..6d24d9d 100644 +index 08f7e80..40cbed5 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S -@@ -19,6 +19,8 @@ - #include <asm/cache.h> +@@ -20,6 +20,8 @@ #include <asm/processor-flags.h> #include <asm/percpu.h> + #include <asm/nops.h> +#include <asm/cpufeature.h> +#include <asm/alternative-asm.h> #ifdef CONFIG_PARAVIRT #include <asm/asm-offsets.h> -@@ -38,6 +40,12 @@ L4_PAGE_OFFSET = pgd_index(__PAGE_OFFSET) +@@ -41,6 +43,12 @@ L4_PAGE_OFFSET = pgd_index(__PAGE_OFFSET) L3_PAGE_OFFSET = pud_index(__PAGE_OFFSET) L4_START_KERNEL = pgd_index(__START_KERNEL_map) L3_START_KERNEL = pud_index(__START_KERNEL_map) @@ -17337,65 +20484,34 @@ index 40f4eb3..6d24d9d 100644 .text __HEAD -@@ -85,35 +93,23 @@ startup_64: +@@ -89,11 +97,15 @@ startup_64: + * Fixup the physical addresses in the page table */ - addq %rbp, init_level4_pgt + 0(%rip) - addq %rbp, init_level4_pgt + (L4_PAGE_OFFSET*8)(%rip) + addq %rbp, early_level4_pgt + (L4_START_KERNEL*8)(%rip) + addq %rbp, init_level4_pgt + (L4_VMALLOC_START*8)(%rip) + addq %rbp, init_level4_pgt + (L4_VMALLOC_END*8)(%rip) + addq %rbp, init_level4_pgt + (L4_VMEMMAP_START*8)(%rip) - addq %rbp, init_level4_pgt + (L4_START_KERNEL*8)(%rip) - addq %rbp, level3_ident_pgt + 0(%rip) -+#ifndef CONFIG_XEN -+ addq %rbp, level3_ident_pgt + 8(%rip) -+#endif + addq %rbp, level3_kernel_pgt + (510*8)(%rip) + addq %rbp, level3_kernel_pgt + (511*8)(%rip) -- addq %rbp, level3_kernel_pgt + (510*8)(%rip) -- addq %rbp, level3_kernel_pgt + (511*8)(%rip) -- -- addq %rbp, level2_fixmap_pgt + (506*8)(%rip) -- -- /* Add an Identity mapping if I am above 1G */ -- leaq _text(%rip), %rdi -- andq $PMD_PAGE_MASK, %rdi -- -- movq %rdi, %rax -- shrq $PUD_SHIFT, %rax -- andq $(PTRS_PER_PUD - 1), %rax -- jz ident_complete -+ addq %rbp, level3_vmemmap_pgt + (L3_VMEMMAP_START*8)(%rip) - -- leaq (level2_spare_pgt - __START_KERNEL_map + _KERNPG_TABLE)(%rbp), %rdx -- leaq level3_ident_pgt(%rip), %rbx -- movq %rdx, 0(%rbx, %rax, 8) -+ addq %rbp, level3_kernel_pgt + (L3_START_KERNEL*8)(%rip) -+ addq %rbp, level3_kernel_pgt + (L3_START_KERNEL*8+8)(%rip) - -- movq %rdi, %rax -- shrq $PMD_SHIFT, %rax -- andq $(PTRS_PER_PMD - 1), %rax -- leaq __PAGE_KERNEL_IDENT_LARGE_EXEC(%rdi), %rdx -- leaq level2_spare_pgt(%rip), %rbx -- movq %rdx, 0(%rbx, %rax, 8) --ident_complete: -+ addq %rbp, level2_fixmap_pgt + (506*8)(%rip) + addq %rbp, level2_fixmap_pgt + (506*8)(%rip) + addq %rbp, level2_fixmap_pgt + (507*8)(%rip) /* - * Fixup the kernel text+data virtual addresses. Note that -@@ -160,8 +156,8 @@ ENTRY(secondary_startup_64) - * after the boot processor executes this code. - */ + * Set up the identity mapping for the switchover. These +@@ -175,8 +187,8 @@ ENTRY(secondary_startup_64) + movq $(init_level4_pgt - __START_KERNEL_map), %rax + 1: - /* Enable PAE mode and PGE */ -- movl $(X86_CR4_PAE | X86_CR4_PGE), %eax +- movl $(X86_CR4_PAE | X86_CR4_PGE), %ecx + /* Enable PAE mode and PSE/PGE */ -+ movl $(X86_CR4_PSE | X86_CR4_PAE | X86_CR4_PGE), %eax - movq %rax, %cr4 ++ movl $(X86_CR4_PSE | X86_CR4_PAE | X86_CR4_PGE), %ecx + movq %rcx, %cr4 /* Setup early boot stage 4 level pagetables. */ -@@ -183,9 +179,17 @@ ENTRY(secondary_startup_64) +@@ -197,10 +209,18 @@ ENTRY(secondary_startup_64) movl $MSR_EFER, %ecx rdmsr btsl $_EFER_SCE, %eax /* Enable System Call */ @@ -17403,6 +20519,7 @@ index 40f4eb3..6d24d9d 100644 + btl $(X86_FEATURE_NX & 31),%edi /* No Execute supported? */ jnc 1f btsl $_EFER_NX, %eax + btsq $_PAGE_BIT_NX,early_pmd_flags(%rip) + leaq init_level4_pgt(%rip), %rdi +#ifndef CONFIG_EFI + btsq $_PAGE_BIT_NX, 8*L4_PAGE_OFFSET(%rdi) @@ -17414,69 +20531,52 @@ index 40f4eb3..6d24d9d 100644 1: wrmsr /* Make changes effective */ /* Setup cr0 */ -@@ -247,6 +251,7 @@ ENTRY(secondary_startup_64) - * jump. In addition we need to ensure %cs is set so we make this - * a far return. +@@ -280,6 +300,7 @@ ENTRY(secondary_startup_64) + * REX.W + FF /5 JMP m16:64 Jump far, absolute indirect, + * address given in m16:64. */ + pax_set_fptr_mask movq initial_code(%rip),%rax pushq $0 # fake return address to stop unwinder pushq $__KERNEL_CS # set correct cs -@@ -269,7 +274,7 @@ ENTRY(secondary_startup_64) - bad_address: - jmp bad_address - -- .section ".init.text","ax" -+ __INIT - #ifdef CONFIG_EARLY_PRINTK - .globl early_idt_handlers - early_idt_handlers: -@@ -314,18 +319,23 @@ ENTRY(early_idt_handler) +@@ -386,7 +407,7 @@ ENTRY(early_idt_handler) + call dump_stack + #ifdef CONFIG_KALLSYMS + leaq early_idt_ripmsg(%rip),%rdi +- movq 40(%rsp),%rsi # %rip again ++ movq 88(%rsp),%rsi # %rip again + call __print_symbol + #endif #endif /* EARLY_PRINTK */ - 1: hlt - jmp 1b -+ .previous - - #ifdef CONFIG_EARLY_PRINTK -+ __INITDATA +@@ -414,6 +435,7 @@ ENDPROC(early_idt_handler) early_recursion_flag: .long 0 -+ .previous + .section .rodata,"a",@progbits + #ifdef CONFIG_EARLY_PRINTK early_idt_msg: .asciz "PANIC: early exception %02lx rip %lx:%lx error %lx cr2 %lx\n" - early_idt_ripmsg: - .asciz "RIP %s\n" --#endif /* CONFIG_EARLY_PRINTK */ - .previous -+#endif /* CONFIG_EARLY_PRINTK */ +@@ -443,27 +465,50 @@ NEXT_PAGE(early_dynamic_pgts) -+ .section .rodata,"a",@progbits - #define NEXT_PAGE(name) \ - .balign PAGE_SIZE; \ - ENTRY(name) -@@ -338,7 +348,6 @@ ENTRY(name) - i = i + 1 ; \ - .endr + .data -- .data - /* - * This default setting generates an ident mapping at address 0x100000 - * and a mapping for the kernel that precisely maps virtual address -@@ -349,13 +358,41 @@ NEXT_PAGE(init_level4_pgt) - .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE - .org init_level4_pgt + L4_PAGE_OFFSET*8, 0 - .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE +-#ifndef CONFIG_XEN + NEXT_PAGE(init_level4_pgt) +- .fill 512,8,0 +-#else +-NEXT_PAGE(init_level4_pgt) +- .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE + .org init_level4_pgt + L4_PAGE_OFFSET*8, 0 + .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE + .org init_level4_pgt + L4_VMALLOC_START*8, 0 + .quad level3_vmalloc_start_pgt - __START_KERNEL_map + _KERNPG_TABLE + .org init_level4_pgt + L4_VMALLOC_END*8, 0 + .quad level3_vmalloc_end_pgt - __START_KERNEL_map + _KERNPG_TABLE + .org init_level4_pgt + L4_VMEMMAP_START*8, 0 + .quad level3_vmemmap_pgt - __START_KERNEL_map + _KERNPG_TABLE - .org init_level4_pgt + L4_START_KERNEL*8, 0 + .org init_level4_pgt + L4_START_KERNEL*8, 0 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ - .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE + .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE +#ifdef CONFIG_PAX_PER_CPU_PGD +NEXT_PAGE(cpu_pgd) @@ -17488,7 +20588,7 @@ index 40f4eb3..6d24d9d 100644 NEXT_PAGE(level3_ident_pgt) .quad level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE +#ifdef CONFIG_XEN - .fill 511,8,0 + .fill 511, 8, 0 +#else + .quad level2_ident_pgt + PAGE_SIZE - __START_KERNEL_map + _KERNPG_TABLE + .fill 510,8,0 @@ -17503,16 +20603,31 @@ index 40f4eb3..6d24d9d 100644 +NEXT_PAGE(level3_vmemmap_pgt) + .fill L3_VMEMMAP_START,8,0 + .quad level2_vmemmap_pgt - __START_KERNEL_map + _KERNPG_TABLE ++ + NEXT_PAGE(level2_ident_pgt) +- /* Since I easily can, map the first 1G. ++ /* Since I easily can, map the first 2G. + * Don't set NX because code runs from these pages. + */ +- PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD) +-#endif ++ PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, 2*PTRS_PER_PMD) NEXT_PAGE(level3_kernel_pgt) .fill L3_START_KERNEL,8,0 -@@ -363,20 +400,23 @@ NEXT_PAGE(level3_kernel_pgt) +@@ -471,6 +516,9 @@ NEXT_PAGE(level3_kernel_pgt) .quad level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE .quad level2_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE +NEXT_PAGE(level2_vmemmap_pgt) + .fill 512,8,0 + + NEXT_PAGE(level2_kernel_pgt) + /* + * 512 MB kernel mapping. We spend a full page on this pagetable +@@ -486,38 +534,64 @@ NEXT_PAGE(level2_kernel_pgt) + KERNEL_IMAGE_SIZE/PMD_SIZE) + NEXT_PAGE(level2_fixmap_pgt) - .fill 506,8,0 - .quad level1_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE @@ -17527,30 +20642,7 @@ index 40f4eb3..6d24d9d 100644 +NEXT_PAGE(level1_vsyscall_pgt) .fill 512,8,0 --NEXT_PAGE(level2_ident_pgt) -- /* Since I easily can, map the first 1G. -+ /* Since I easily can, map the first 2G. - * Don't set NX because code runs from these pages. - */ -- PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD) -+NEXT_PAGE(level2_ident_pgt) -+ PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, 2*PTRS_PER_PMD) - - NEXT_PAGE(level2_kernel_pgt) - /* -@@ -389,37 +429,59 @@ NEXT_PAGE(level2_kernel_pgt) - * If you want to increase this then increase MODULES_VADDR - * too.) - */ -- PMDS(0, __PAGE_KERNEL_LARGE_EXEC, -- KERNEL_IMAGE_SIZE/PMD_SIZE) -- --NEXT_PAGE(level2_spare_pgt) -- .fill 512, 8, 0 -+ PMDS(0, __PAGE_KERNEL_LARGE_EXEC, KERNEL_IMAGE_SIZE/PMD_SIZE) - #undef PMDS - #undef NEXT_PAGE - .data + .align PAGE_SIZE @@ -17608,9 +20700,9 @@ index 40f4eb3..6d24d9d 100644 + .fill 512,8,0 __PAGE_ALIGNED_BSS - .align PAGE_SIZE + NEXT_PAGE(empty_zero_page) diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c -index 9c3bd4a..e1d9b35 100644 +index 0fa6912..37fce70 100644 --- a/arch/x86/kernel/i386_ksyms_32.c +++ b/arch/x86/kernel/i386_ksyms_32.c @@ -20,8 +20,12 @@ extern void cmpxchg8b_emu(void); @@ -17626,7 +20718,7 @@ index 9c3bd4a..e1d9b35 100644 EXPORT_SYMBOL(__get_user_1); EXPORT_SYMBOL(__get_user_2); -@@ -36,3 +40,7 @@ EXPORT_SYMBOL(strstr); +@@ -37,3 +41,7 @@ EXPORT_SYMBOL(strstr); EXPORT_SYMBOL(csum_partial); EXPORT_SYMBOL(empty_zero_page); @@ -17635,10 +20727,10 @@ index 9c3bd4a..e1d9b35 100644 +EXPORT_SYMBOL(__LOAD_PHYSICAL_ADDR); +#endif diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c -index 2d6e649..df6e1af 100644 +index 245a71d..89d9ce4 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c -@@ -59,7 +59,7 @@ static inline bool interrupted_kernel_fpu_idle(void) +@@ -55,7 +55,7 @@ static inline bool interrupted_kernel_fpu_idle(void) static inline bool interrupted_user_mode(void) { struct pt_regs *regs = get_irq_regs(); @@ -17648,9 +20740,18 @@ index 2d6e649..df6e1af 100644 /* diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c -index 36d1853..bf25736 100644 +index 9a5c460..84868423 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c +@@ -110,7 +110,7 @@ static int i8259A_irq_pending(unsigned int irq) + static void make_8259A_irq(unsigned int irq) + { + disable_irq_nosync(irq); +- io_apic_irqs &= ~(1<<irq); ++ io_apic_irqs &= ~(1UL<<irq); + irq_set_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq, + i8259A_chip.name); + enable_irq(irq); @@ -209,7 +209,7 @@ spurious_8259A_irq: "spurious 8259A interrupt: IRQ%d.\n", irq); spurious_irq_mask |= irqmask; @@ -17660,30 +20761,40 @@ index 36d1853..bf25736 100644 /* * Theoretically we do not have to handle this IRQ, * but in Linux this does not cause problems and is -diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c -index 43e9ccf..44ccf6f 100644 ---- a/arch/x86/kernel/init_task.c -+++ b/arch/x86/kernel/init_task.c -@@ -20,8 +20,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); - * way process stacks are handled. This is done by having a special - * "init_task" linker map entry.. - */ --union thread_union init_thread_union __init_task_data = -- { INIT_THREAD_INFO(init_task) }; -+union thread_union init_thread_union __init_task_data; +@@ -333,14 +333,16 @@ static void init_8259A(int auto_eoi) + /* (slave's support for AEOI in flat mode is to be investigated) */ + outb_pic(SLAVE_ICW4_DEFAULT, PIC_SLAVE_IMR); - /* - * Initial task structure. -@@ -38,5 +37,5 @@ EXPORT_SYMBOL(init_task); - * section. Since TSS's are completely CPU-local, we want them - * on exact cacheline boundaries, to eliminate cacheline ping-pong. ++ pax_open_kernel(); + if (auto_eoi) + /* + * In AEOI mode we just have to mask the interrupt + * when acking. + */ +- i8259A_chip.irq_mask_ack = disable_8259A_irq; ++ *(void **)&i8259A_chip.irq_mask_ack = disable_8259A_irq; + else +- i8259A_chip.irq_mask_ack = mask_and_ack_8259A; ++ *(void **)&i8259A_chip.irq_mask_ack = mask_and_ack_8259A; ++ pax_close_kernel(); + + udelay(100); /* wait for 8259A to initialize */ + +diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c +index a979b5b..1d6db75 100644 +--- a/arch/x86/kernel/io_delay.c ++++ b/arch/x86/kernel/io_delay.c +@@ -58,7 +58,7 @@ static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id) + * Quirk table for systems that misbehave (lock up, etc.) if port + * 0x80 is used: */ --DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS; -- -+struct tss_struct init_tss[NR_CPUS] ____cacheline_internodealigned_in_smp = { [0 ... NR_CPUS-1] = INIT_TSS }; -+EXPORT_SYMBOL(init_tss); +-static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = { ++static const struct dmi_system_id __initconst io_delay_0xed_port_dmi_table[] = { + { + .callback = dmi_io_delay_0xed_port, + .ident = "Compaq Presario V6000", diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c -index 8c96897..be66bfa 100644 +index 4ddaf66..6292f4e 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c @@ -6,6 +6,7 @@ @@ -17716,7 +20827,7 @@ index 8c96897..be66bfa 100644 if (turn_on) bitmap_clear(t->io_bitmap_ptr, from, num); -@@ -102,6 +109,12 @@ long sys_iopl(unsigned int level, struct pt_regs *regs) +@@ -103,6 +110,12 @@ SYSCALL_DEFINE1(iopl, unsigned int, level) return -EINVAL; /* Trying to gain more privileges? */ if (level > old) { @@ -17730,7 +20841,7 @@ index 8c96897..be66bfa 100644 return -EPERM; } diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c -index 3dafc60..aa8e9c4 100644 +index 84b7789..e65e8be 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -18,7 +18,7 @@ @@ -17742,7 +20853,7 @@ index 3dafc60..aa8e9c4 100644 /* Function pointer for generic interrupt vector handling */ void (*x86_platform_ipi_callback)(void) = NULL; -@@ -121,9 +121,9 @@ int arch_show_interrupts(struct seq_file *p, int prec) +@@ -122,9 +122,9 @@ int arch_show_interrupts(struct seq_file *p, int prec) seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); seq_printf(p, " Machine check polls\n"); #endif @@ -17754,21 +20865,17 @@ index 3dafc60..aa8e9c4 100644 #endif return 0; } -@@ -164,10 +164,10 @@ u64 arch_irq_stat_cpu(unsigned int cpu) +@@ -164,7 +164,7 @@ u64 arch_irq_stat_cpu(unsigned int cpu) u64 arch_irq_stat(void) { - u64 sum = atomic_read(&irq_err_count); + u64 sum = atomic_read_unchecked(&irq_err_count); - - #ifdef CONFIG_X86_IO_APIC -- sum += atomic_read(&irq_mis_count); -+ sum += atomic_read_unchecked(&irq_mis_count); - #endif return sum; } + diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c -index 58b7f27..e112d08 100644 +index 344faf8..355f60d 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -39,7 +39,7 @@ static int check_stack_overflow(void) @@ -17838,7 +20945,7 @@ index 58b7f27..e112d08 100644 return 1; } -@@ -121,29 +125,11 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) +@@ -121,29 +125,14 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) */ void __cpuinit irq_ctx_init(int cpu) { @@ -17848,8 +20955,8 @@ index 58b7f27..e112d08 100644 return; - irqctx = page_address(alloc_pages_node(cpu_to_node(cpu), -- THREAD_FLAGS, -- THREAD_ORDER)); +- THREADINFO_GFP, +- THREAD_SIZE_ORDER)); - memset(&irqctx->tinfo, 0, sizeof(struct thread_info)); - irqctx->tinfo.cpu = cpu; - irqctx->tinfo.preempt_count = HARDIRQ_OFFSET; @@ -17858,19 +20965,22 @@ index 58b7f27..e112d08 100644 - per_cpu(hardirq_ctx, cpu) = irqctx; - - irqctx = page_address(alloc_pages_node(cpu_to_node(cpu), -- THREAD_FLAGS, -- THREAD_ORDER)); +- THREADINFO_GFP, +- THREAD_SIZE_ORDER)); - memset(&irqctx->tinfo, 0, sizeof(struct thread_info)); - irqctx->tinfo.cpu = cpu; - irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); - - per_cpu(softirq_ctx, cpu) = irqctx; -+ per_cpu(hardirq_ctx, cpu) = page_address(alloc_pages_node(cpu_to_node(cpu), THREAD_FLAGS, THREAD_ORDER)); -+ per_cpu(softirq_ctx, cpu) = page_address(alloc_pages_node(cpu_to_node(cpu), THREAD_FLAGS, THREAD_ORDER)); ++ per_cpu(hardirq_ctx, cpu) = page_address(alloc_pages_node(cpu_to_node(cpu), THREADINFO_GFP, THREAD_SIZE_ORDER)); ++ per_cpu(softirq_ctx, cpu) = page_address(alloc_pages_node(cpu_to_node(cpu), THREADINFO_GFP, THREAD_SIZE_ORDER)); ++ ++ printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n", ++ cpu, per_cpu(hardirq_ctx, cpu), per_cpu(softirq_ctx, cpu)); printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n", cpu, per_cpu(hardirq_ctx, cpu), per_cpu(softirq_ctx, cpu)); -@@ -152,7 +138,6 @@ void __cpuinit irq_ctx_init(int cpu) +@@ -152,7 +141,6 @@ void __cpuinit irq_ctx_init(int cpu) asmlinkage void do_softirq(void) { unsigned long flags; @@ -17878,7 +20988,7 @@ index 58b7f27..e112d08 100644 union irq_ctx *irqctx; u32 *isp; -@@ -162,15 +147,22 @@ asmlinkage void do_softirq(void) +@@ -162,15 +150,22 @@ asmlinkage void do_softirq(void) local_irq_save(flags); if (local_softirq_pending()) { @@ -17905,7 +21015,7 @@ index 58b7f27..e112d08 100644 /* * Shouldn't happen, we returned above if in_interrupt(): */ -@@ -191,7 +183,7 @@ bool handle_irq(unsigned irq, struct pt_regs *regs) +@@ -191,7 +186,7 @@ bool handle_irq(unsigned irq, struct pt_regs *regs) if (unlikely(!desc)) return false; @@ -17928,7 +21038,7 @@ index d04d3ec..ea4b374 100644 if (regs->sp >= curbase + sizeof(struct thread_info) + diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c -index 1d5d31e..72731d4 100644 +index dc1404b..bbc43e7 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c @@ -27,7 +27,7 @@ struct setup_data_node { @@ -17941,7 +21051,7 @@ index 1d5d31e..72731d4 100644 { struct setup_data_node *node = file->private_data; diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c -index 8bfb614..2b3b35f 100644 +index 836f832..a8bda67 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c @@ -127,11 +127,11 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) @@ -17958,7 +21068,19 @@ index 8bfb614..2b3b35f 100644 *(unsigned long *)mem = kernel_stack_pointer(regs); break; case GDB_GS: -@@ -476,12 +476,12 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code, +@@ -229,7 +229,10 @@ static void kgdb_correct_hw_break(void) + bp->attr.bp_addr = breakinfo[breakno].addr; + bp->attr.bp_len = breakinfo[breakno].len; + bp->attr.bp_type = breakinfo[breakno].type; +- info->address = breakinfo[breakno].addr; ++ if (breakinfo[breakno].type == X86_BREAKPOINT_EXECUTE) ++ info->address = ktla_ktva(breakinfo[breakno].addr); ++ else ++ info->address = breakinfo[breakno].addr; + info->len = breakinfo[breakno].len; + info->type = breakinfo[breakno].type; + val = arch_install_hw_breakpoint(bp); +@@ -476,12 +479,12 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code, case 'k': /* clear the trace bit */ linux_regs->flags &= ~X86_EFLAGS_TF; @@ -17973,7 +21095,7 @@ index 8bfb614..2b3b35f 100644 raw_smp_processor_id()); } -@@ -546,7 +546,7 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd) +@@ -546,7 +549,7 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd) switch (cmd) { case DIE_DEBUG: @@ -17982,50 +21104,55 @@ index 8bfb614..2b3b35f 100644 if (user_mode(regs)) return single_step_cont(regs, args); break; -diff --git a/arch/x86/kernel/kprobes-opt.c b/arch/x86/kernel/kprobes-opt.c -index c5e410e..da6aaf9 100644 ---- a/arch/x86/kernel/kprobes-opt.c -+++ b/arch/x86/kernel/kprobes-opt.c -@@ -338,7 +338,7 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op) - * Verify if the address gap is in 2GB range, because this uses - * a relative jump. - */ -- rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE; -+ rel = (long)op->optinsn.insn - ktla_ktva((long)op->kp.addr) + RELATIVEJUMP_SIZE; - if (abs(rel) > 0x7fffffff) - return -ERANGE; - -@@ -359,11 +359,11 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op) - synthesize_set_arg1(buf + TMPL_MOVE_IDX, (unsigned long)op); +@@ -751,11 +754,11 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) + #endif /* CONFIG_DEBUG_RODATA */ - /* Set probe function call */ -- synthesize_relcall(buf + TMPL_CALL_IDX, optimized_callback); -+ synthesize_relcall(buf + TMPL_CALL_IDX, ktla_ktva(optimized_callback)); - - /* Set returning jmp instruction at the tail of out-of-line buffer */ - synthesize_reljump(buf + TMPL_END_IDX + op->optinsn.size, -- (u8 *)op->kp.addr + op->optinsn.size); -+ (u8 *)ktla_ktva(op->kp.addr) + op->optinsn.size); - - flush_icache_range((unsigned long) buf, - (unsigned long) buf + TMPL_END_IDX + -@@ -385,7 +385,7 @@ static void __kprobes setup_optimize_kprobe(struct text_poke_param *tprm, - ((long)op->kp.addr + RELATIVEJUMP_SIZE)); - - /* Backup instructions which will be replaced by jump address */ -- memcpy(op->optinsn.copied_insn, op->kp.addr + INT3_SIZE, -+ memcpy(op->optinsn.copied_insn, ktla_ktva(op->kp.addr) + INT3_SIZE, - RELATIVE_ADDR_SIZE); + bpt->type = BP_BREAKPOINT; +- err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr, ++ err = probe_kernel_read(bpt->saved_instr, ktla_ktva((char *)bpt->bpt_addr), + BREAK_INSTR_SIZE); + if (err) + return err; +- err = probe_kernel_write((char *)bpt->bpt_addr, ++ err = probe_kernel_write(ktla_ktva((char *)bpt->bpt_addr), + arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE); + #ifdef CONFIG_DEBUG_RODATA + if (!err) +@@ -768,7 +771,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) + return -EBUSY; + text_poke((void *)bpt->bpt_addr, arch_kgdb_ops.gdb_bpt_instr, + BREAK_INSTR_SIZE); +- err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE); ++ err = probe_kernel_read(opc, ktla_ktva((char *)bpt->bpt_addr), BREAK_INSTR_SIZE); + if (err) + return err; + if (memcmp(opc, arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE)) +@@ -793,13 +796,13 @@ int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) + if (mutex_is_locked(&text_mutex)) + goto knl_write; + text_poke((void *)bpt->bpt_addr, bpt->saved_instr, BREAK_INSTR_SIZE); +- err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE); ++ err = probe_kernel_read(opc, ktla_ktva((char *)bpt->bpt_addr), BREAK_INSTR_SIZE); + if (err || memcmp(opc, bpt->saved_instr, BREAK_INSTR_SIZE)) + goto knl_write; + return err; + knl_write: + #endif /* CONFIG_DEBUG_RODATA */ +- return probe_kernel_write((char *)bpt->bpt_addr, ++ return probe_kernel_write(ktla_ktva((char *)bpt->bpt_addr), + (char *)bpt->saved_instr, BREAK_INSTR_SIZE); + } - insn_buf[0] = RELATIVEJUMP_OPCODE; -diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c -index e213fc8..d783ba4 100644 ---- a/arch/x86/kernel/kprobes.c -+++ b/arch/x86/kernel/kprobes.c -@@ -120,8 +120,11 @@ static void __kprobes __synthesize_relative_insn(void *from, void *to, u8 op) - } __attribute__((packed)) *insn; +diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c +index 7bfe318..383d238 100644 +--- a/arch/x86/kernel/kprobes/core.c ++++ b/arch/x86/kernel/kprobes/core.c +@@ -119,9 +119,12 @@ static void __kprobes __synthesize_relative_insn(void *from, void *to, u8 op) + s32 raddr; + } __packed *insn; - insn = (struct __arch_relative_insn *)from; +- insn = (struct __arch_relative_insn *)from; ++ insn = (struct __arch_relative_insn *)ktla_ktva(from); + + pax_open_kernel(); insn->raddr = (s32)((long)(to) - ((long)(from) + 5)); @@ -18043,6 +21170,18 @@ index e213fc8..d783ba4 100644 return 0; /* Page fault may occur on this address. */ retry: +@@ -238,9 +241,9 @@ __recover_probed_insn(kprobe_opcode_t *buf, unsigned long addr) + * for the first byte, we can recover the original instruction + * from it and kp->opcode. + */ +- memcpy(buf, kp->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); ++ memcpy(buf, ktla_ktva(kp->addr), MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); + buf[0] = kp->opcode; +- return (unsigned long)buf; ++ return ktva_ktla((unsigned long)buf); + } + + /* @@ -332,7 +335,9 @@ int __kprobes __copy_instruction(u8 *dest, u8 *src) /* Another subsystem puts a breakpoint, failed to recover */ if (insn.opcode.bytes[0] == BREAKPOINT_INSTRUCTION) @@ -18063,7 +21202,7 @@ index e213fc8..d783ba4 100644 } #endif return insn.length; -@@ -485,7 +492,7 @@ setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *k +@@ -488,7 +495,7 @@ setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *k * nor set current_kprobe, because it doesn't use single * stepping. */ @@ -18072,16 +21211,19 @@ index e213fc8..d783ba4 100644 preempt_enable_no_resched(); return; } -@@ -504,7 +511,7 @@ setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *k +@@ -505,9 +512,9 @@ setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *k + regs->flags &= ~X86_EFLAGS_IF; + /* single step inline if the instruction is an int3 */ if (p->opcode == BREAKPOINT_INSTRUCTION) - regs->ip = (unsigned long)p->addr; +- regs->ip = (unsigned long)p->addr; ++ regs->ip = ktla_ktva((unsigned long)p->addr); else - regs->ip = (unsigned long)p->ainsn.insn; + regs->ip = ktva_ktla((unsigned long)p->ainsn.insn); } /* -@@ -583,7 +590,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) +@@ -586,7 +593,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) setup_singlestep(p, regs, kcb, 0); return 1; } @@ -18090,7 +21232,7 @@ index e213fc8..d783ba4 100644 /* * The breakpoint instruction was removed right * after we hit it. Another cpu has removed -@@ -628,6 +635,9 @@ static void __used __kprobes kretprobe_trampoline_holder(void) +@@ -632,6 +639,9 @@ static void __used __kprobes kretprobe_trampoline_holder(void) " movq %rax, 152(%rsp)\n" RESTORE_REGS_STRING " popfq\n" @@ -18100,7 +21242,7 @@ index e213fc8..d783ba4 100644 #else " pushf\n" SAVE_REGS_STRING -@@ -765,7 +775,7 @@ static void __kprobes +@@ -769,7 +779,7 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb) { unsigned long *tos = stack_addr(regs); @@ -18109,7 +21251,7 @@ index e213fc8..d783ba4 100644 unsigned long orig_ip = (unsigned long)p->addr; kprobe_opcode_t *insn = p->ainsn.insn; -@@ -947,7 +957,7 @@ kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *d +@@ -951,7 +961,7 @@ kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *d struct die_args *args = data; int ret = NOTIFY_DONE; @@ -18118,6 +21260,88 @@ index e213fc8..d783ba4 100644 return ret; switch (val) { +diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c +index 76dc6f0..66bdfc3 100644 +--- a/arch/x86/kernel/kprobes/opt.c ++++ b/arch/x86/kernel/kprobes/opt.c +@@ -79,6 +79,7 @@ found: + /* Insert a move instruction which sets a pointer to eax/rdi (1st arg). */ + static void __kprobes synthesize_set_arg1(kprobe_opcode_t *addr, unsigned long val) + { ++ pax_open_kernel(); + #ifdef CONFIG_X86_64 + *addr++ = 0x48; + *addr++ = 0xbf; +@@ -86,6 +87,7 @@ static void __kprobes synthesize_set_arg1(kprobe_opcode_t *addr, unsigned long v + *addr++ = 0xb8; + #endif + *(unsigned long *)addr = val; ++ pax_close_kernel(); + } + + static void __used __kprobes kprobes_optinsn_template_holder(void) +@@ -338,7 +340,7 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op) + * Verify if the address gap is in 2GB range, because this uses + * a relative jump. + */ +- rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE; ++ rel = (long)op->optinsn.insn - ktla_ktva((long)op->kp.addr) + RELATIVEJUMP_SIZE; + if (abs(rel) > 0x7fffffff) + return -ERANGE; + +@@ -353,16 +355,18 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op) + op->optinsn.size = ret; + + /* Copy arch-dep-instance from template */ +- memcpy(buf, &optprobe_template_entry, TMPL_END_IDX); ++ pax_open_kernel(); ++ memcpy(buf, ktla_ktva(&optprobe_template_entry), TMPL_END_IDX); ++ pax_close_kernel(); + + /* Set probe information */ + synthesize_set_arg1(buf + TMPL_MOVE_IDX, (unsigned long)op); + + /* Set probe function call */ +- synthesize_relcall(buf + TMPL_CALL_IDX, optimized_callback); ++ synthesize_relcall(ktva_ktla(buf) + TMPL_CALL_IDX, optimized_callback); + + /* Set returning jmp instruction at the tail of out-of-line buffer */ +- synthesize_reljump(buf + TMPL_END_IDX + op->optinsn.size, ++ synthesize_reljump(ktva_ktla(buf) + TMPL_END_IDX + op->optinsn.size, + (u8 *)op->kp.addr + op->optinsn.size); + + flush_icache_range((unsigned long) buf, +@@ -385,7 +389,7 @@ static void __kprobes setup_optimize_kprobe(struct text_poke_param *tprm, + ((long)op->kp.addr + RELATIVEJUMP_SIZE)); + + /* Backup instructions which will be replaced by jump address */ +- memcpy(op->optinsn.copied_insn, op->kp.addr + INT3_SIZE, ++ memcpy(op->optinsn.copied_insn, ktla_ktva(op->kp.addr) + INT3_SIZE, + RELATIVE_ADDR_SIZE); + + insn_buf[0] = RELATIVEJUMP_OPCODE; +@@ -483,7 +487,7 @@ setup_detour_execution(struct kprobe *p, struct pt_regs *regs, int reenter) + /* This kprobe is really able to run optimized path. */ + op = container_of(p, struct optimized_kprobe, kp); + /* Detour through copied instructions */ +- regs->ip = (unsigned long)op->optinsn.insn + TMPL_END_IDX; ++ regs->ip = ktva_ktla((unsigned long)op->optinsn.insn) + TMPL_END_IDX; + if (!reenter) + reset_current_kprobe(); + preempt_enable_no_resched(); +diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c +index b686a90..60d36fb 100644 +--- a/arch/x86/kernel/kvm.c ++++ b/arch/x86/kernel/kvm.c +@@ -453,7 +453,7 @@ static int __cpuinit kvm_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata kvm_cpu_notifier = { ++static struct notifier_block kvm_cpu_notifier = { + .notifier_call = kvm_cpu_notify, + }; + #endif diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index ebc9873..1b9724b 100644 --- a/arch/x86/kernel/ldt.c @@ -18217,11 +21441,24 @@ index 5b19e4d..6476a76 100644 relocate_kernel_ptr = control_page; page_list[PA_CONTROL_PAGE] = __pa(control_page); +diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c +index 22db92b..d546bec 100644 +--- a/arch/x86/kernel/microcode_core.c ++++ b/arch/x86/kernel/microcode_core.c +@@ -513,7 +513,7 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) + return NOTIFY_OK; + } + +-static struct notifier_block __refdata mc_cpu_notifier = { ++static struct notifier_block mc_cpu_notifier = { + .notifier_call = mc_cpu_callback, + }; + diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c -index 0327e2b..e43737b 100644 +index 5fb2ceb..3ae90bb 100644 --- a/arch/x86/kernel/microcode_intel.c +++ b/arch/x86/kernel/microcode_intel.c -@@ -430,13 +430,13 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device) +@@ -293,13 +293,13 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device, static int get_ucode_user(void *to, const void *from, size_t n) { @@ -18238,18 +21475,18 @@ index 0327e2b..e43737b 100644 static void microcode_fini_cpu(int cpu) diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c -index f21fd94..61565cd 100644 +index 216a4d7..228255a 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c -@@ -35,15 +35,60 @@ - #define DEBUGP(fmt...) +@@ -43,15 +43,60 @@ do { \ + } while (0) #endif -void *module_alloc(unsigned long size) +static inline void *__module_alloc(unsigned long size, pgprot_t prot) { - if (PAGE_ALIGN(size) > MODULES_LEN) -+ if (size == 0 || PAGE_ALIGN(size) > MODULES_LEN) ++ if (!size || PAGE_ALIGN(size) > MODULES_LEN) return NULL; return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, - GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC, @@ -18305,15 +21542,15 @@ index f21fd94..61565cd 100644 #ifdef CONFIG_X86_32 int apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, -@@ -54,14 +99,16 @@ int apply_relocate(Elf32_Shdr *sechdrs, +@@ -62,14 +107,16 @@ int apply_relocate(Elf32_Shdr *sechdrs, unsigned int i; Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr; Elf32_Sym *sym; - uint32_t *location; + uint32_t *plocation, location; - DEBUGP("Applying relocate section %u to %u\n", relsec, - sechdrs[relsec].sh_info); + DEBUGP("Applying relocate section %u to %u\n", + relsec, sechdrs[relsec].sh_info); for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { /* This is where to make the change */ - location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr @@ -18325,7 +21562,7 @@ index f21fd94..61565cd 100644 /* This is the symbol it is referring to. Note that all undefined symbols have been resolved. */ sym = (Elf32_Sym *)sechdrs[symindex].sh_addr -@@ -70,11 +117,15 @@ int apply_relocate(Elf32_Shdr *sechdrs, +@@ -78,11 +125,15 @@ int apply_relocate(Elf32_Shdr *sechdrs, switch (ELF32_R_TYPE(rel[i].r_info)) { case R_386_32: /* We add the value into the location given */ @@ -18335,15 +21572,15 @@ index f21fd94..61565cd 100644 + pax_close_kernel(); break; case R_386_PC32: - /* Add the value, subtract its postition */ + /* Add the value, subtract its position */ - *location += sym->st_value - (uint32_t)location; + pax_open_kernel(); + *plocation += sym->st_value - location; + pax_close_kernel(); break; default: - printk(KERN_ERR "module %s: Unknown relocation: %u\n", -@@ -119,21 +170,30 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, + pr_err("%s: Unknown relocation: %u\n", +@@ -127,21 +178,30 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, case R_X86_64_NONE: break; case R_X86_64_64: @@ -18374,11 +21611,54 @@ index f21fd94..61565cd 100644 #if 0 if ((s64)val != *(s32 *)loc) goto overflow; +diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c +index ce13049..e2e9c3c 100644 +--- a/arch/x86/kernel/msr.c ++++ b/arch/x86/kernel/msr.c +@@ -233,7 +233,7 @@ static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb, + return notifier_from_errno(err); + } + +-static struct notifier_block __refdata msr_class_cpu_notifier = { ++static struct notifier_block msr_class_cpu_notifier = { + .notifier_call = msr_class_cpu_callback, + }; + diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c -index 32856fa..ce95eaa 100644 +index 6030805..2d33f21 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c -@@ -507,6 +507,17 @@ static inline void nmi_nesting_postprocess(void) +@@ -105,7 +105,7 @@ static int __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2 + return handled; + } + +-int __register_nmi_handler(unsigned int type, struct nmiaction *action) ++int __register_nmi_handler(unsigned int type, const struct nmiaction *action) + { + struct nmi_desc *desc = nmi_to_desc(type); + unsigned long flags; +@@ -129,9 +129,9 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action) + * event confuses some handlers (kdump uses this flag) + */ + if (action->flags & NMI_FLAG_FIRST) +- list_add_rcu(&action->list, &desc->head); ++ pax_list_add_rcu((struct list_head *)&action->list, &desc->head); + else +- list_add_tail_rcu(&action->list, &desc->head); ++ pax_list_add_tail_rcu((struct list_head *)&action->list, &desc->head); + + spin_unlock_irqrestore(&desc->lock, flags); + return 0; +@@ -154,7 +154,7 @@ void unregister_nmi_handler(unsigned int type, const char *name) + if (!strcmp(n->name, name)) { + WARN(in_nmi(), + "Trying to free NMI (%s) from NMI context!\n", n->name); +- list_del_rcu(&n->list); ++ pax_list_del_rcu((struct list_head *)&n->list); + break; + } + } +@@ -479,6 +479,17 @@ static inline void nmi_nesting_postprocess(void) dotraplinkage notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code) { @@ -18396,6 +21676,28 @@ index 32856fa..ce95eaa 100644 nmi_nesting_preprocess(regs); nmi_enter(); +diff --git a/arch/x86/kernel/nmi_selftest.c b/arch/x86/kernel/nmi_selftest.c +index 6d9582e..f746287 100644 +--- a/arch/x86/kernel/nmi_selftest.c ++++ b/arch/x86/kernel/nmi_selftest.c +@@ -43,7 +43,7 @@ static void __init init_nmi_testsuite(void) + { + /* trap all the unknown NMIs we may generate */ + register_nmi_handler(NMI_UNKNOWN, nmi_unk_cb, 0, "nmi_selftest_unk", +- __initdata); ++ __initconst); + } + + static void __init cleanup_nmi_testsuite(void) +@@ -66,7 +66,7 @@ static void __init test_nmi_ipi(struct cpumask *mask) + unsigned long timeout; + + if (register_nmi_handler(NMI_LOCAL, test_nmi_ipi_callback, +- NMI_FLAG_FIRST, "nmi_selftest", __initdata)) { ++ NMI_FLAG_FIRST, "nmi_selftest", __initconst)) { + nmi_fail = FAILURE; + return; + } diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c index 676b8c7..870ba04 100644 --- a/arch/x86/kernel/paravirt-spinlocks.c @@ -18410,7 +21712,7 @@ index 676b8c7..870ba04 100644 .spin_is_locked = __ticket_spin_is_locked, .spin_is_contended = __ticket_spin_is_contended, diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c -index ab13760..01218e0 100644 +index 8bfb335..c1463c6 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -55,6 +55,9 @@ u64 _paravirt_ident_64(u64 x) @@ -18438,10 +21740,10 @@ index ab13760..01218e0 100644 ret = paravirt_patch_ident_32(insnbuf, len); - else if (opfunc == _paravirt_ident_64) + else if (opfunc == (void *)_paravirt_ident_64) -+ ret = paravirt_patch_ident_64(insnbuf, len); + ret = paravirt_patch_ident_64(insnbuf, len); +#if defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE) + else if (opfunc == (void *)__raw_callee_save__paravirt_ident_64) - ret = paravirt_patch_ident_64(insnbuf, len); ++ ret = paravirt_patch_ident_64(insnbuf, len); +#endif else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) || @@ -18455,8 +21757,8 @@ index ab13760..01218e0 100644 return insn_len; } -@@ -304,7 +311,7 @@ void arch_flush_lazy_mmu_mode(void) - preempt_enable(); +@@ -304,7 +311,7 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void) + return this_cpu_read(paravirt_lazy_mode); } -struct pv_info pv_info = { @@ -18493,12 +21795,12 @@ index ab13760..01218e0 100644 .cpuid = native_cpuid, .get_debugreg = native_get_debugreg, .set_debugreg = native_set_debugreg, -@@ -397,21 +404,26 @@ struct pv_cpu_ops pv_cpu_ops = { +@@ -395,21 +402,26 @@ struct pv_cpu_ops pv_cpu_ops = { .end_context_switch = paravirt_nop, }; -struct pv_apic_ops pv_apic_ops = { -+struct pv_apic_ops pv_apic_ops __read_only = { ++struct pv_apic_ops pv_apic_ops __read_only= { #ifdef CONFIG_X86_LOCAL_APIC .startup_ipi_hook = paravirt_nop, #endif @@ -18523,7 +21825,7 @@ index ab13760..01218e0 100644 .read_cr2 = native_read_cr2, .write_cr2 = native_write_cr2, -@@ -461,6 +473,7 @@ struct pv_mmu_ops pv_mmu_ops = { +@@ -459,6 +471,7 @@ struct pv_mmu_ops pv_mmu_ops = { .make_pud = PTE_IDENT, .set_pgd = native_set_pgd, @@ -18531,7 +21833,7 @@ index ab13760..01218e0 100644 #endif #endif /* PAGETABLE_LEVELS >= 3 */ -@@ -480,6 +493,12 @@ struct pv_mmu_ops pv_mmu_ops = { +@@ -479,6 +492,12 @@ struct pv_mmu_ops pv_mmu_ops = { }, .set_fixmap = native_set_fixmap, @@ -18544,6 +21846,19 @@ index ab13760..01218e0 100644 }; EXPORT_SYMBOL_GPL(pv_time_ops); +diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c +index 299d493..2ccb0ee 100644 +--- a/arch/x86/kernel/pci-calgary_64.c ++++ b/arch/x86/kernel/pci-calgary_64.c +@@ -1339,7 +1339,7 @@ static void __init get_tce_space_from_tar(void) + tce_space = be64_to_cpu(readq(target)); + tce_space = tce_space & TAR_SW_BITS; + +- tce_space = tce_space & (~specified_table_size); ++ tce_space = tce_space & (~(unsigned long)specified_table_size); + info->tce_space = (u64 *)__va(tce_space); + } + } diff --git a/arch/x86/kernel/pci-iommu_table.c b/arch/x86/kernel/pci-iommu_table.c index 35ccf75..7a15747 100644 --- a/arch/x86/kernel/pci-iommu_table.c @@ -18557,49 +21872,43 @@ index 35ccf75..7a15747 100644 #define DEBUG 1 +diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c +index 6c483ba..d10ce2f 100644 +--- a/arch/x86/kernel/pci-swiotlb.c ++++ b/arch/x86/kernel/pci-swiotlb.c +@@ -32,7 +32,7 @@ static void x86_swiotlb_free_coherent(struct device *dev, size_t size, + void *vaddr, dma_addr_t dma_addr, + struct dma_attrs *attrs) + { +- swiotlb_free_coherent(dev, size, vaddr, dma_addr); ++ swiotlb_free_coherent(dev, size, vaddr, dma_addr, attrs); + } + + static struct dma_map_ops swiotlb_dma_ops = { diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c -index 1d92a5a..7bc8c29 100644 +index 14ae100..752a4f6 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c -@@ -69,16 +69,33 @@ void free_thread_xstate(struct task_struct *tsk) - - void free_thread_info(struct thread_info *ti) - { -- free_thread_xstate(ti->task); - free_pages((unsigned long)ti, THREAD_ORDER); - } +@@ -36,7 +36,8 @@ + * section. Since TSS's are completely CPU-local, we want them + * on exact cacheline boundaries, to eliminate cacheline ping-pong. + */ +-DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS; ++struct tss_struct init_tss[NR_CPUS] ____cacheline_internodealigned_in_smp = { [0 ... NR_CPUS-1] = INIT_TSS }; ++EXPORT_SYMBOL(init_tss); -+static struct kmem_cache *task_struct_cachep; -+ - void arch_task_cache_init(void) - { -- task_xstate_cachep = -- kmem_cache_create("task_xstate", xstate_size, -+ /* create a slab on which task_structs can be allocated */ -+ task_struct_cachep = -+ kmem_cache_create("task_struct", sizeof(struct task_struct), -+ ARCH_MIN_TASKALIGN, SLAB_PANIC | SLAB_NOTRACK, NULL); -+ -+ task_xstate_cachep = -+ kmem_cache_create("task_xstate", xstate_size, + #ifdef CONFIG_X86_64 + static DEFINE_PER_CPU(unsigned char, is_idle); +@@ -92,7 +93,7 @@ void arch_task_cache_init(void) + task_xstate_cachep = + kmem_cache_create("task_xstate", xstate_size, __alignof__(union thread_xstate), - SLAB_PANIC | SLAB_NOTRACK, NULL); + SLAB_PANIC | SLAB_NOTRACK | SLAB_USERCOPY, NULL); -+} -+ -+struct task_struct *alloc_task_struct_node(int node) -+{ -+ return kmem_cache_alloc_node(task_struct_cachep, GFP_KERNEL, node); -+} -+ -+void free_task_struct(struct task_struct *task) -+{ -+ free_thread_xstate(task); -+ kmem_cache_free(task_struct_cachep, task); } /* -@@ -91,7 +108,7 @@ void exit_thread(void) +@@ -105,7 +106,7 @@ void exit_thread(void) unsigned long *bp = t->io_bitmap_ptr; if (bp) { @@ -18608,16 +21917,16 @@ index 1d92a5a..7bc8c29 100644 t->io_bitmap_ptr = NULL; clear_thread_flag(TIF_IO_BITMAP); -@@ -127,7 +144,7 @@ void show_regs_common(void) +@@ -136,7 +137,7 @@ void show_regs_common(void) + board = dmi_get_system_info(DMI_BOARD_NAME); - printk(KERN_CONT "\n"); - printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s", -- current->pid, current->comm, print_tainted(), -+ task_pid_nr(current), current->comm, print_tainted(), - init_utsname()->release, - (int)strcspn(init_utsname()->version, " "), - init_utsname()->version); -@@ -141,6 +158,9 @@ void flush_thread(void) + printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s %s %s%s%s\n", +- current->pid, current->comm, print_tainted(), ++ task_pid_nr(current), current->comm, print_tainted(), + init_utsname()->release, + (int)strcspn(init_utsname()->version, " "), + init_utsname()->version, +@@ -149,6 +150,9 @@ void flush_thread(void) { struct task_struct *tsk = current; @@ -18626,22 +21935,8 @@ index 1d92a5a..7bc8c29 100644 +#endif flush_ptrace_hw_breakpoint(tsk); memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); - /* -@@ -303,10 +323,10 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) - regs.di = (unsigned long) arg; - - #ifdef CONFIG_X86_32 -- regs.ds = __USER_DS; -- regs.es = __USER_DS; -+ regs.ds = __KERNEL_DS; -+ regs.es = __KERNEL_DS; - regs.fs = __KERNEL_PERCPU; -- regs.gs = __KERNEL_STACK_CANARY; -+ savesegment(gs, regs.gs); - #else - regs.ss = __KERNEL_DS; - #endif -@@ -392,7 +412,7 @@ static void __exit_idle(void) + drop_init_fpu(tsk); +@@ -295,7 +299,7 @@ static void __exit_idle(void) void exit_idle(void) { /* idle loop has pid 0 */ @@ -18650,16 +21945,16 @@ index 1d92a5a..7bc8c29 100644 return; __exit_idle(); } -@@ -501,7 +521,7 @@ bool set_pm_idle_to_default(void) - +@@ -398,7 +402,7 @@ bool xen_set_default_idle(void) return ret; } + #endif -void stop_this_cpu(void *dummy) +__noreturn void stop_this_cpu(void *dummy) { local_irq_disable(); /* -@@ -743,16 +763,37 @@ static int __init idle_setup(char *str) +@@ -544,16 +548,37 @@ static int __init idle_setup(char *str) } early_param("idle", idle_setup); @@ -18684,7 +21979,7 @@ index 1d92a5a..7bc8c29 100644 + + if (v8086_mode(regs)) + return; -+ + + rdtscl(time); + + /* P4 seems to return a 0 LSB, ignore it */ @@ -18701,17 +21996,17 @@ index 1d92a5a..7bc8c29 100644 + + thread->sp0 ^= time; + load_sp0(init_tss + smp_processor_id(), thread); - ++ +#ifdef CONFIG_X86_64 -+ percpu_write(kernel_stack, thread->sp0); ++ this_cpu_write(kernel_stack, thread->sp0); +#endif +} +#endif diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c -index ae68473..7b0bb71 100644 +index b5a8905..d9cacac 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c -@@ -64,6 +64,7 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); +@@ -65,6 +65,7 @@ asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread"); unsigned long thread_saved_pc(struct task_struct *tsk) { return ((unsigned long *)tsk->thread.sp)[3]; @@ -18719,7 +22014,7 @@ index ae68473..7b0bb71 100644 } void __show_regs(struct pt_regs *regs, int all) -@@ -73,15 +74,14 @@ void __show_regs(struct pt_regs *regs, int all) +@@ -74,21 +75,20 @@ void __show_regs(struct pt_regs *regs, int all) unsigned long sp; unsigned short ss, gs; @@ -18737,23 +22032,40 @@ index ae68473..7b0bb71 100644 show_regs_common(); -@@ -143,13 +143,14 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, + printk(KERN_DEFAULT "EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n", + (u16)regs->cs, regs->ip, regs->flags, +- smp_processor_id()); ++ raw_smp_processor_id()); + print_symbol("EIP is at %s\n", regs->ip); + + printk(KERN_DEFAULT "EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", +@@ -130,20 +130,21 @@ void release_thread(struct task_struct *dead_task) + int copy_thread(unsigned long clone_flags, unsigned long sp, + unsigned long arg, struct task_struct *p) + { +- struct pt_regs *childregs = task_pt_regs(p); ++ struct pt_regs *childregs = task_stack_page(p) + THREAD_SIZE - sizeof(struct pt_regs) - 8; struct task_struct *tsk; int err; -- childregs = task_pt_regs(p); -+ childregs = task_stack_page(p) + THREAD_SIZE - sizeof(struct pt_regs) - 8; - *childregs = *regs; - childregs->ax = 0; - childregs->sp = sp; - p->thread.sp = (unsigned long) childregs; p->thread.sp0 = (unsigned long) (childregs+1); + p->tinfo.lowest_stack = (unsigned long)task_stack_page(p); - p->thread.ip = (unsigned long) ret_from_fork; - -@@ -240,7 +241,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) + if (unlikely(p->flags & PF_KTHREAD)) { + /* kernel thread */ + memset(childregs, 0, sizeof(struct pt_regs)); + p->thread.ip = (unsigned long) ret_from_kernel_thread; +- task_user_gs(p) = __KERNEL_STACK_CANARY; +- childregs->ds = __USER_DS; +- childregs->es = __USER_DS; ++ savesegment(gs, childregs->gs); ++ childregs->ds = __KERNEL_DS; ++ childregs->es = __KERNEL_DS; + childregs->fs = __KERNEL_PERCPU; + childregs->bx = sp; /* function */ + childregs->bp = arg; +@@ -250,7 +251,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) struct thread_struct *prev = &prev_p->thread, *next = &next_p->thread; int cpu = smp_processor_id(); @@ -18762,7 +22074,7 @@ index ae68473..7b0bb71 100644 fpu_switch_t fpu; /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */ -@@ -264,6 +265,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) +@@ -274,6 +275,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) */ lazy_save_gs(prev->gs); @@ -18773,53 +22085,48 @@ index ae68473..7b0bb71 100644 /* * Load the per-thread Thread-Local Storage descriptor. */ -@@ -294,6 +299,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) +@@ -304,6 +309,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) */ arch_end_context_switch(next_p); -+ percpu_write(current_task, next_p); -+ percpu_write(current_tinfo, &next_p->tinfo); ++ this_cpu_write(current_task, next_p); ++ this_cpu_write(current_tinfo, &next_p->tinfo); + /* * Restore %gs if needed (which is common) */ -@@ -302,8 +310,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) +@@ -312,8 +320,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) switch_fpu_finish(next_p, fpu); -- percpu_write(current_task, next_p); +- this_cpu_write(current_task, next_p); - return prev_p; } -@@ -333,4 +339,3 @@ unsigned long get_wchan(struct task_struct *p) +@@ -343,4 +349,3 @@ unsigned long get_wchan(struct task_struct *p) } while (count++ < 16); return 0; } - diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c -index 43d8b48..c45d566 100644 +index 0f49677..fcbf88c 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c -@@ -162,8 +162,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, +@@ -152,10 +152,11 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, struct pt_regs *childregs; struct task_struct *me = current; -- childregs = ((struct pt_regs *) -- (THREAD_SIZE + task_stack_page(p))) - 1; -+ childregs = task_stack_page(p) + THREAD_SIZE - sizeof(struct pt_regs) - 16; - *childregs = *regs; - - childregs->ax = 0; -@@ -175,6 +174,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, +- p->thread.sp0 = (unsigned long)task_stack_page(p) + THREAD_SIZE; ++ p->thread.sp0 = (unsigned long)task_stack_page(p) + THREAD_SIZE - 16; + childregs = task_pt_regs(p); p->thread.sp = (unsigned long) childregs; - p->thread.sp0 = (unsigned long) (childregs+1); p->thread.usersp = me->thread.usersp; + p->tinfo.lowest_stack = (unsigned long)task_stack_page(p); - set_tsk_thread_flag(p, TIF_FORK); - -@@ -280,7 +280,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) + p->fpu_counter = 0; + p->thread.io_bitmap_ptr = NULL; +@@ -274,7 +275,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) struct thread_struct *prev = &prev_p->thread; struct thread_struct *next = &next_p->thread; int cpu = smp_processor_id(); @@ -18828,20 +22135,20 @@ index 43d8b48..c45d566 100644 unsigned fsindex, gsindex; fpu_switch_t fpu; -@@ -362,10 +362,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) - prev->usersp = percpu_read(old_rsp); - percpu_write(old_rsp, next->usersp); - percpu_write(current_task, next_p); -+ percpu_write(current_tinfo, &next_p->tinfo); +@@ -356,10 +357,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) + prev->usersp = this_cpu_read(old_rsp); + this_cpu_write(old_rsp, next->usersp); + this_cpu_write(current_task, next_p); ++ this_cpu_write(current_tinfo, &next_p->tinfo); -- percpu_write(kernel_stack, +- this_cpu_write(kernel_stack, - (unsigned long)task_stack_page(next_p) + - THREAD_SIZE - KERNEL_STACK_OFFSET); -+ percpu_write(kernel_stack, next->sp0); ++ this_cpu_write(kernel_stack, next->sp0); /* * Now maybe reload the debug registers and handle I/O bitmaps -@@ -434,12 +433,11 @@ unsigned long get_wchan(struct task_struct *p) +@@ -428,12 +428,11 @@ unsigned long get_wchan(struct task_struct *p) if (!p || p == current || p->state == TASK_RUNNING) return 0; stack = (unsigned long)task_stack_page(p); @@ -18857,10 +22164,38 @@ index 43d8b48..c45d566 100644 ip = *(u64 *)(fp+8); if (!in_sched_functions(ip)) diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c -index cf11783..e7ce551 100644 +index 29a8120..a50b5ee 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c -@@ -824,7 +824,7 @@ long arch_ptrace(struct task_struct *child, long request, +@@ -184,14 +184,13 @@ unsigned long kernel_stack_pointer(struct pt_regs *regs) + { + unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1); + unsigned long sp = (unsigned long)®s->sp; +- struct thread_info *tinfo; + +- if (context == (sp & ~(THREAD_SIZE - 1))) ++ if (context == ((sp + 8) & ~(THREAD_SIZE - 1))) + return sp; + +- tinfo = (struct thread_info *)context; +- if (tinfo->previous_esp) +- return tinfo->previous_esp; ++ sp = *(unsigned long *)context; ++ if (sp) ++ return sp; + + return (unsigned long)regs; + } +@@ -588,7 +587,7 @@ static void ptrace_triggered(struct perf_event *bp, + static unsigned long ptrace_get_dr7(struct perf_event *bp[]) + { + int i; +- int dr7 = 0; ++ unsigned long dr7 = 0; + struct arch_hw_breakpoint *info; + + for (i = 0; i < HBP_NUM; i++) { +@@ -856,7 +855,7 @@ long arch_ptrace(struct task_struct *child, long request, unsigned long addr, unsigned long data) { int ret; @@ -18869,7 +22204,7 @@ index cf11783..e7ce551 100644 switch (request) { /* read the word at location addr in the USER area. */ -@@ -909,14 +909,14 @@ long arch_ptrace(struct task_struct *child, long request, +@@ -941,14 +940,14 @@ long arch_ptrace(struct task_struct *child, long request, if ((int) addr < 0) return -EIO; ret = do_get_thread_area(child, addr, @@ -18886,7 +22221,34 @@ index cf11783..e7ce551 100644 break; #endif -@@ -1426,7 +1426,7 @@ static void fill_sigtrap_info(struct task_struct *tsk, +@@ -1326,7 +1325,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, + + #ifdef CONFIG_X86_64 + +-static struct user_regset x86_64_regsets[] __read_mostly = { ++static user_regset_no_const x86_64_regsets[] __read_only = { + [REGSET_GENERAL] = { + .core_note_type = NT_PRSTATUS, + .n = sizeof(struct user_regs_struct) / sizeof(long), +@@ -1367,7 +1366,7 @@ static const struct user_regset_view user_x86_64_view = { + #endif /* CONFIG_X86_64 */ + + #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION +-static struct user_regset x86_32_regsets[] __read_mostly = { ++static user_regset_no_const x86_32_regsets[] __read_only = { + [REGSET_GENERAL] = { + .core_note_type = NT_PRSTATUS, + .n = sizeof(struct user_regs_struct32) / sizeof(u32), +@@ -1420,7 +1419,7 @@ static const struct user_regset_view user_x86_32_view = { + */ + u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS]; + +-void update_regset_xstate_info(unsigned int size, u64 xstate_mask) ++void __init update_regset_xstate_info(unsigned int size, u64 xstate_mask) + { + #ifdef CONFIG_X86_64 + x86_64_regsets[REGSET_XSTATE].n = size / sizeof(u64); +@@ -1455,7 +1454,7 @@ static void fill_sigtrap_info(struct task_struct *tsk, memset(info, 0, sizeof(*info)); info->si_signo = SIGTRAP; info->si_code = si_code; @@ -18895,7 +22257,7 @@ index cf11783..e7ce551 100644 } void user_single_step_siginfo(struct task_struct *tsk, -@@ -1455,6 +1455,10 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, +@@ -1484,6 +1483,10 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, # define IS_IA32 0 #endif @@ -18906,35 +22268,35 @@ index cf11783..e7ce551 100644 /* * We must return the syscall number to actually look up in the table. * This can be -1L to skip running any syscall at all. -@@ -1463,6 +1467,11 @@ long syscall_trace_enter(struct pt_regs *regs) - { - long ret = 0; +@@ -1494,6 +1497,11 @@ long syscall_trace_enter(struct pt_regs *regs) + + user_exit(); +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) -+ gr_delayed_cred_worker(); -+#endif ++ gr_delayed_cred_worker(); ++#endif + /* * If we stepped into a sysenter/syscall insn, it trapped in * kernel mode; do_debug() cleared TF and set TIF_SINGLESTEP. -@@ -1506,6 +1515,11 @@ void syscall_trace_leave(struct pt_regs *regs) - { - bool step; +@@ -1549,6 +1557,11 @@ void syscall_trace_leave(struct pt_regs *regs) + */ + user_exit(); +#ifdef CONFIG_GRKERNSEC_SETXID + if (unlikely(test_and_clear_thread_flag(TIF_GRSEC_SETXID))) -+ gr_delayed_cred_worker(); -+#endif ++ gr_delayed_cred_worker(); ++#endif + audit_syscall_exit(regs); if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c -index 42eb330..139955c 100644 +index 2cb9470..ff1fd80 100644 --- a/arch/x86/kernel/pvclock.c +++ b/arch/x86/kernel/pvclock.c -@@ -81,11 +81,11 @@ unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src) +@@ -43,11 +43,11 @@ unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src) return pv_tsc_khz; } @@ -18947,8 +22309,8 @@ index 42eb330..139955c 100644 + atomic64_set_unchecked(&last_value, 0); } - cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) -@@ -121,11 +121,11 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) + u8 pvclock_read_flags(struct pvclock_vcpu_time_info *src) +@@ -92,11 +92,11 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) * updating at the same time, and one of them could be slightly behind, * making the assumption that last_value always go forward fail to hold. */ @@ -18963,10 +22325,10 @@ index 42eb330..139955c 100644 return ret; diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c -index 3034ee5..554ae2d 100644 +index 76fa1e9..abf09ea 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c -@@ -35,7 +35,7 @@ void (*pm_power_off)(void); +@@ -36,7 +36,7 @@ void (*pm_power_off)(void); EXPORT_SYMBOL(pm_power_off); static const struct desc_ptr no_idt = {}; @@ -18975,49 +22337,25 @@ index 3034ee5..554ae2d 100644 enum reboot_type reboot_type = BOOT_ACPI; int reboot_force; -@@ -335,13 +335,17 @@ core_initcall(reboot_init); - extern const unsigned char machine_real_restart_asm[]; - extern const u64 machine_real_restart_gdt[3]; +@@ -157,6 +157,11 @@ static int __init set_bios_reboot(const struct dmi_system_id *d) --void machine_real_restart(unsigned int type) -+__noreturn void machine_real_restart(unsigned int type) + void __noreturn machine_real_restart(unsigned int type) { - void *restart_va; - unsigned long restart_pa; -- void (*restart_lowmem)(unsigned int); -+ void (* __noreturn restart_lowmem)(unsigned int); - u64 *lowmem_gdt; - ++ +#if defined(CONFIG_X86_32) && (defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF)) + struct desc_struct *gdt; +#endif + local_irq_disable(); - /* Write zero to CMOS register number 0x0f, which the BIOS POST -@@ -367,14 +371,14 @@ void machine_real_restart(unsigned int type) - boot)". This seems like a fairly standard thing that gets set by - REBOOT.COM programs, and the previous reset routine did this - too. */ -- *((unsigned short *)0x472) = reboot_mode; -+ *(unsigned short *)(__va(0x472)) = reboot_mode; - - /* Patch the GDT in the low memory trampoline */ - lowmem_gdt = TRAMPOLINE_SYM(machine_real_restart_gdt); - - restart_va = TRAMPOLINE_SYM(machine_real_restart_asm); - restart_pa = virt_to_phys(restart_va); -- restart_lowmem = (void (*)(unsigned int))restart_pa; -+ restart_lowmem = (void *)restart_pa; - - /* GDT[0]: GDT self-pointer */ - lowmem_gdt[0] = -@@ -385,7 +389,35 @@ void machine_real_restart(unsigned int type) - GDT_ENTRY(0x009b, restart_pa, 0xffff); + /* +@@ -184,7 +189,29 @@ void __noreturn machine_real_restart(unsigned int type) /* Jump to the identity-mapped low memory code */ + #ifdef CONFIG_X86_32 +- asm volatile("jmpl *%0" : : + -+#if defined(CONFIG_X86_32) && (defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF)) ++#if defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF) + gdt = get_cpu_gdt_table(smp_processor_id()); + pax_open_kernel(); +#ifdef CONFIG_PAX_MEMORY_UDEREF @@ -19038,17 +22376,11 @@ index 3034ee5..554ae2d 100644 + pax_close_kernel(); +#endif + -+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) -+ asm volatile("push %0; push %1; lret\n" : : "i" (__KERNEL_CS), "rm" (restart_lowmem), "a" (type)); -+ unreachable(); -+#else - restart_lowmem(type); -+#endif -+ - } - #ifdef CONFIG_APM_MODULE - EXPORT_SYMBOL(machine_real_restart); -@@ -564,7 +596,7 @@ void __attribute__((weak)) mach_reboot_fixups(void) ++ asm volatile("ljmpl *%0" : : + "rm" (real_mode_header->machine_real_restart_asm), + "a" (type)); + #else +@@ -531,7 +558,7 @@ void __attribute__((weak)) mach_reboot_fixups(void) * try to force a triple fault and then cycle between hitting the keyboard * controller and doing that */ @@ -19057,12 +22389,12 @@ index 3034ee5..554ae2d 100644 { int i; int attempt = 0; -@@ -688,13 +720,13 @@ void native_machine_shutdown(void) +@@ -654,13 +681,13 @@ void native_machine_shutdown(void) #endif } -static void __machine_emergency_restart(int emergency) -+static __noreturn void __machine_emergency_restart(int emergency) ++static void __noreturn __machine_emergency_restart(int emergency) { reboot_emergency = emergency; machine_ops.emergency_restart(); @@ -19071,18 +22403,18 @@ index 3034ee5..554ae2d 100644 -static void native_machine_restart(char *__unused) +static void __noreturn native_machine_restart(char *__unused) { - printk("machine restart\n"); + pr_notice("machine restart\n"); -@@ -703,7 +735,7 @@ static void native_machine_restart(char *__unused) +@@ -669,7 +696,7 @@ static void native_machine_restart(char *__unused) __machine_emergency_restart(0); } -static void native_machine_halt(void) +static void __noreturn native_machine_halt(void) { - /* stop other cpus and apics */ + /* Stop other cpus and apics */ machine_shutdown(); -@@ -714,7 +746,7 @@ static void native_machine_halt(void) +@@ -679,7 +706,7 @@ static void native_machine_halt(void) stop_this_cpu(NULL); } @@ -19091,14 +22423,18 @@ index 3034ee5..554ae2d 100644 { if (pm_power_off) { if (!reboot_force) -@@ -723,6 +755,7 @@ static void native_machine_power_off(void) +@@ -688,9 +715,10 @@ static void native_machine_power_off(void) } - /* a fallback in case there is no PM info available */ + /* A fallback in case there is no PM info available */ tboot_shutdown(TB_SHUTDOWN_HALT); + unreachable(); } - struct machine_ops machine_ops = { +-struct machine_ops machine_ops = { ++struct machine_ops machine_ops __read_only = { + .power_off = native_machine_power_off, + .shutdown = native_machine_shutdown, + .emergency_restart = native_machine_emergency_restart, diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S index 7a6f3b3..bed145d7 100644 --- a/arch/x86/kernel/relocate_kernel_64.S @@ -19128,10 +22464,18 @@ index 7a6f3b3..bed145d7 100644 1: diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index 1a29015..712f324 100644 +index fae9134..b7d4a57 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -447,7 +447,7 @@ static void __init parse_setup_data(void) +@@ -111,6 +111,7 @@ + #include <asm/mce.h> + #include <asm/alternative.h> + #include <asm/prom.h> ++#include <asm/boot.h> + + /* + * max_low_pfn_mapped: highest direct mapped pfn under 4GB +@@ -447,7 +448,7 @@ static void __init parse_setup_data(void) switch (data->type) { case SETUP_E820_EXT: @@ -19140,16 +22484,29 @@ index 1a29015..712f324 100644 break; case SETUP_DTB: add_dtb(pa_data); -@@ -639,7 +639,7 @@ static void __init trim_bios_range(void) +@@ -774,7 +775,7 @@ static void __init trim_bios_range(void) * area (640->1Mb) as ram even though it is not. * take them out. */ - e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1); + e820_remove_range(ISA_START_ADDRESS, ISA_END_ADDRESS - ISA_START_ADDRESS, E820_RAM, 1); + sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); } +@@ -844,8 +845,12 @@ static void __init trim_low_memory_range(void) -@@ -763,14 +763,14 @@ void __init setup_arch(char **cmdline_p) + void __init setup_arch(char **cmdline_p) + { ++#ifdef CONFIG_X86_32 ++ memblock_reserve(LOAD_PHYSICAL_ADDR, __pa_symbol(__bss_stop) - ____LOAD_PHYSICAL_ADDR); ++#else + memblock_reserve(__pa_symbol(_text), + (unsigned long)__bss_stop - (unsigned long)_text); ++#endif + + early_reserve_initrd(); + +@@ -937,14 +942,14 @@ void __init setup_arch(char **cmdline_p) if (!boot_params.hdr.root_flags) root_mountflags &= ~MS_RDONLY; @@ -19160,26 +22517,26 @@ index 1a29015..712f324 100644 init_mm.end_data = (unsigned long) _edata; init_mm.brk = _brk_end; -- code_resource.start = virt_to_phys(_text); -- code_resource.end = virt_to_phys(_etext)-1; -- data_resource.start = virt_to_phys(_etext); -+ code_resource.start = virt_to_phys(ktla_ktva(_text)); -+ code_resource.end = virt_to_phys(ktla_ktva(_etext))-1; -+ data_resource.start = virt_to_phys(_sdata); - data_resource.end = virt_to_phys(_edata)-1; - bss_resource.start = virt_to_phys(&__bss_start); - bss_resource.end = virt_to_phys(&__bss_stop)-1; +- code_resource.start = __pa_symbol(_text); +- code_resource.end = __pa_symbol(_etext)-1; +- data_resource.start = __pa_symbol(_etext); ++ code_resource.start = __pa_symbol(ktla_ktva(_text)); ++ code_resource.end = __pa_symbol(ktla_ktva(_etext))-1; ++ data_resource.start = __pa_symbol(_sdata); + data_resource.end = __pa_symbol(_edata)-1; + bss_resource.start = __pa_symbol(__bss_start); + bss_resource.end = __pa_symbol(__bss_stop)-1; diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c -index 5a98aa2..2f9288d 100644 +index 5cdff03..80fa283 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c @@ -21,19 +21,17 @@ #include <asm/cpu.h> #include <asm/stackprotector.h> --DEFINE_PER_CPU(int, cpu_number); +-DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number); +#ifdef CONFIG_SMP -+DEFINE_PER_CPU(unsigned int, cpu_number); ++DEFINE_PER_CPU_READ_MOSTLY(unsigned int, cpu_number); EXPORT_PER_CPU_SYMBOL(cpu_number); +#endif @@ -19197,6 +22554,15 @@ index 5a98aa2..2f9288d 100644 [0 ... NR_CPUS-1] = BOOT_PERCPU_OFFSET, }; EXPORT_SYMBOL(__per_cpu_offset); +@@ -66,7 +64,7 @@ static bool __init pcpu_need_numa(void) + { + #ifdef CONFIG_NEED_MULTIPLE_NODES + pg_data_t *last = NULL; +- unsigned int cpu; ++ int cpu; + + for_each_possible_cpu(cpu) { + int node = early_cpu_to_node(cpu); @@ -155,10 +153,10 @@ static inline void setup_percpu_segment(int cpu) { #ifdef CONFIG_X86_32 @@ -19237,10 +22603,10 @@ index 5a98aa2..2f9288d 100644 * Up to this point, the boot CPU has been using .init.data * area. Reload any changed state for the boot CPU. diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c -index 115eac4..c0591d5 100644 +index 6956299..f20beae 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c -@@ -190,7 +190,7 @@ static unsigned long align_sigframe(unsigned long sp) +@@ -196,7 +196,7 @@ static unsigned long align_sigframe(unsigned long sp) * Align the stack pointer according to the i386 ABI, * i.e. so that on function entry ((sp + 4) & 15) == 0. */ @@ -19249,21 +22615,7 @@ index 115eac4..c0591d5 100644 #else /* !CONFIG_X86_32 */ sp = round_down(sp, 16) - 8; #endif -@@ -241,11 +241,11 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size, - * Return an always-bogus address instead so we will die with SIGSEGV. - */ - if (onsigstack && !likely(on_sig_stack(sp))) -- return (void __user *)-1L; -+ return (__force void __user *)-1L; - - /* save i387 state */ - if (used_math() && save_i387_xstate(*fpstate) < 0) -- return (void __user *)-1L; -+ return (__force void __user *)-1L; - - return (void __user *)sp; - } -@@ -300,9 +300,9 @@ __setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, +@@ -304,9 +304,9 @@ __setup_frame(int sig, struct ksignal *ksig, sigset_t *set, } if (current->mm->context.vdso) @@ -19272,10 +22624,10 @@ index 115eac4..c0591d5 100644 else - restorer = &frame->retcode; + restorer = (void __user *)&frame->retcode; - if (ka->sa.sa_flags & SA_RESTORER) - restorer = ka->sa.sa_restorer; + if (ksig->ka.sa.sa_flags & SA_RESTORER) + restorer = ksig->ka.sa.sa_restorer; -@@ -316,7 +316,7 @@ __setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, +@@ -320,7 +320,7 @@ __setup_frame(int sig, struct ksignal *ksig, sigset_t *set, * reasons and because gdb uses it as a signature to notice * signal handler stack frames. */ @@ -19284,55 +22636,83 @@ index 115eac4..c0591d5 100644 if (err) return -EFAULT; -@@ -370,7 +370,10 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, - err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); +@@ -367,7 +367,10 @@ static int __setup_rt_frame(int sig, struct ksignal *ksig, + err |= __save_altstack(&frame->uc.uc_stack, regs->sp); /* Set up to return from userspace. */ - restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn); + if (current->mm->context.vdso) + restorer = (__force void __user *)VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn); + else -+ restorer = (void __user *)&frame->retcode; - if (ka->sa.sa_flags & SA_RESTORER) - restorer = ka->sa.sa_restorer; ++ restorer = (void __user *)&frame->retcode; + if (ksig->ka.sa.sa_flags & SA_RESTORER) + restorer = ksig->ka.sa.sa_restorer; put_user_ex(restorer, &frame->pretcode); -@@ -382,7 +385,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, +@@ -379,7 +382,7 @@ static int __setup_rt_frame(int sig, struct ksignal *ksig, * reasons and because gdb uses it as a signature to notice * signal handler stack frames. */ - put_user_ex(*((u64 *)&rt_retcode), (u64 *)frame->retcode); + put_user_ex(*((u64 *)&rt_retcode), (u64 __user *)frame->retcode); } put_user_catch(err); + + err |= copy_siginfo_to_user(&frame->info, &ksig->info); +@@ -615,7 +618,12 @@ setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) + { + int usig = signr_convert(ksig->sig); + sigset_t *set = sigmask_to_save(); +- compat_sigset_t *cset = (compat_sigset_t *) set; ++ sigset_t sigcopy; ++ compat_sigset_t *cset; ++ ++ sigcopy = *set; ++ ++ cset = (compat_sigset_t *) &sigcopy; - if (err) -@@ -773,7 +776,7 @@ static void do_signal(struct pt_regs *regs) - * X86_32: vm86 regs switched out by assembly code before reaching - * here, so testing against kernel CS suffices. - */ -- if (!user_mode(regs)) -+ if (!user_mode_novm(regs)) - return; + /* Set up the stack frame */ + if (is_ia32_frame()) { +@@ -626,7 +634,7 @@ setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) + } else if (is_x32_frame()) { + return x32_setup_rt_frame(ksig, cset, regs); + } else { +- return __setup_rt_frame(ksig->sig, ksig, set, regs); ++ return __setup_rt_frame(ksig->sig, ksig, &sigcopy, regs); + } + } + +diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c +index 48d2b7d..90d328a 100644 +--- a/arch/x86/kernel/smp.c ++++ b/arch/x86/kernel/smp.c +@@ -285,7 +285,7 @@ static int __init nonmi_ipi_setup(char *str) + + __setup("nonmi_ipi", nonmi_ipi_setup); - signr = get_signal_to_deliver(&info, &ka, regs, NULL); +-struct smp_ops smp_ops = { ++struct smp_ops smp_ops __read_only = { + .smp_prepare_boot_cpu = native_smp_prepare_boot_cpu, + .smp_prepare_cpus = native_smp_prepare_cpus, + .smp_cpus_done = native_smp_cpus_done, diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c -index 6e1e406..edfb7cb 100644 +index 9f190a2..90a0688 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c -@@ -699,17 +699,20 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu) - set_idle_for_cpu(cpu, c_idle.idle); - do_rest: - per_cpu(current_task, cpu) = c_idle.idle; -+ per_cpu(current_tinfo, cpu) = &c_idle.idle->tinfo; +@@ -748,6 +748,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle) + idle->thread.sp = (unsigned long) (((struct pt_regs *) + (THREAD_SIZE + task_stack_page(idle))) - 1); + per_cpu(current_task, cpu) = idle; ++ per_cpu(current_tinfo, cpu) = &idle->tinfo; + #ifdef CONFIG_X86_32 /* Stack for startup_32 can be just as for start_secondary onwards */ - irq_ctx_init(cpu); +@@ -755,11 +756,13 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle) #else - clear_tsk_thread_flag(c_idle.idle, TIF_FORK); + clear_tsk_thread_flag(idle, TIF_FORK); initial_gs = per_cpu_offset(cpu); - per_cpu(kernel_stack, cpu) = -- (unsigned long)task_stack_page(c_idle.idle) - +- (unsigned long)task_stack_page(idle) - - KERNEL_STACK_OFFSET + THREAD_SIZE; -+ per_cpu(kernel_stack, cpu) = (unsigned long)task_stack_page(c_idle.idle) - 16 + THREAD_SIZE; ++ per_cpu(kernel_stack, cpu) = (unsigned long)task_stack_page(idle) - 16 + THREAD_SIZE; #endif + + pax_open_kernel(); @@ -19340,11 +22720,11 @@ index 6e1e406..edfb7cb 100644 + pax_close_kernel(); + initial_code = (unsigned long)start_secondary; - stack_start = c_idle.idle->thread.sp; + stack_start = idle->thread.sp; -@@ -851,6 +854,12 @@ int __cpuinit native_cpu_up(unsigned int cpu) - - per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; +@@ -908,6 +911,15 @@ int __cpuinit native_cpu_up(unsigned int cpu, struct task_struct *tidle) + /* the FPU context is blank, nobody can own it */ + __cpu_disable_lazy_restore(cpu); +#ifdef CONFIG_PAX_PER_CPU_PGD + clone_pgd_range(get_cpu_pgd(cpu) + KERNEL_PGD_BOUNDARY, @@ -19352,11 +22732,14 @@ index 6e1e406..edfb7cb 100644 + KERNEL_PGD_PTRS); +#endif + - err = do_boot_cpu(apicid, cpu); ++ /* the FPU context is blank, nobody can own it */ ++ __cpu_disable_lazy_restore(cpu); ++ + err = do_boot_cpu(apicid, cpu, tidle); if (err) { pr_debug("do_boot_cpu failed %d\n", err); diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c -index c346d11..d43b163 100644 +index 9b4d51d..5d28b58 100644 --- a/arch/x86/kernel/step.c +++ b/arch/x86/kernel/step.c @@ -27,10 +27,10 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re @@ -19393,20 +22776,37 @@ index c346d11..d43b163 100644 for (i = 0; i < copied; i++) { switch (opcode[i]) { diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c -index 0b0cb5f..db6b9ed 100644 ---- a/arch/x86/kernel/sys_i386_32.c +new file mode 100644 +index 0000000..207bec6 +--- /dev/null +++ b/arch/x86/kernel/sys_i386_32.c -@@ -24,17 +24,224 @@ - - #include <asm/syscalls.h> - --/* -- * Do a system call from kernel instead of calling sys_execve so we -- * end up with proper pt_regs. -- */ --int kernel_execve(const char *filename, -- const char *const argv[], -- const char *const envp[]) +@@ -0,0 +1,250 @@ ++/* ++ * This file contains various random system calls that ++ * have a non-standard calling sequence on the Linux/i386 ++ * platform. ++ */ ++ ++#include <linux/errno.h> ++#include <linux/sched.h> ++#include <linux/mm.h> ++#include <linux/fs.h> ++#include <linux/smp.h> ++#include <linux/sem.h> ++#include <linux/msg.h> ++#include <linux/shm.h> ++#include <linux/stat.h> ++#include <linux/syscalls.h> ++#include <linux/mman.h> ++#include <linux/file.h> ++#include <linux/utsname.h> ++#include <linux/ipc.h> ++ ++#include <linux/uaccess.h> ++#include <linux/unistd.h> ++ ++#include <asm/syscalls.h> ++ +int i386_mmap_check(unsigned long addr, unsigned long len, unsigned long flags) +{ + unsigned long pax_task_size = TASK_SIZE; @@ -19416,8 +22816,9 @@ index 0b0cb5f..db6b9ed 100644 + pax_task_size = SEGMEXEC_TASK_SIZE; +#endif + -+ if (len > pax_task_size || addr > pax_task_size - len) -+ return -EINVAL; ++ if (flags & MAP_FIXED) ++ if (len > pax_task_size || addr > pax_task_size - len) ++ return -EINVAL; + + return 0; +} @@ -19429,6 +22830,7 @@ index 0b0cb5f..db6b9ed 100644 + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + unsigned long start_addr, pax_task_size = TASK_SIZE; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + +#ifdef CONFIG_PAX_SEGMEXEC + if (mm->pax_flags & MF_PAX_SEGMEXEC) @@ -19451,7 +22853,7 @@ index 0b0cb5f..db6b9ed 100644 + addr = PAGE_ALIGN(addr); + if (pax_task_size - len >= addr) { + vma = find_vma(mm, addr); -+ if (check_heap_stack_gap(vma, addr, len)) ++ if (check_heap_stack_gap(vma, addr, len, offset)) + return addr; + } + } @@ -19493,7 +22895,7 @@ index 0b0cb5f..db6b9ed 100644 + } + return -ENOMEM; + } -+ if (check_heap_stack_gap(vma, addr, len)) ++ if (check_heap_stack_gap(vma, addr, len, offset)) + break; + if (addr + mm->cached_hole_size < vma->vm_start) + mm->cached_hole_size = vma->vm_start - addr; @@ -19516,15 +22918,11 @@ index 0b0cb5f..db6b9ed 100644 +arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + const unsigned long len, const unsigned long pgoff, + const unsigned long flags) - { -- long __res; -- asm volatile ("int $0x80" -- : "=a" (__res) -- : "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory"); -- return __res; ++{ + struct vm_area_struct *vma; + struct mm_struct *mm = current->mm; + unsigned long base = mm->mmap_base, addr = addr0, pax_task_size = TASK_SIZE; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + +#ifdef CONFIG_PAX_SEGMEXEC + if (mm->pax_flags & MF_PAX_SEGMEXEC) @@ -19554,7 +22952,7 @@ index 0b0cb5f..db6b9ed 100644 + addr = PAGE_ALIGN(addr); + if (pax_task_size - len >= addr) { + vma = find_vma(mm, addr); -+ if (check_heap_stack_gap(vma, addr, len)) ++ if (check_heap_stack_gap(vma, addr, len, offset)) + return addr; + } + } @@ -19571,7 +22969,7 @@ index 0b0cb5f..db6b9ed 100644 + /* make sure it can fit in the remaining address space */ + if (addr > len) { + vma = find_vma(mm, addr-len); -+ if (check_heap_stack_gap(vma, addr - len, len)) ++ if (check_heap_stack_gap(vma, addr - len, len, offset)) + /* remember the address as a hint for next time */ + return (mm->free_area_cache = addr-len); + } @@ -19588,7 +22986,7 @@ index 0b0cb5f..db6b9ed 100644 + * return with success: + */ + vma = find_vma(mm, addr); -+ if (check_heap_stack_gap(vma, addr, len)) ++ if (check_heap_stack_gap(vma, addr, len, offset)) + /* remember the address as a hint for next time */ + return (mm->free_area_cache = addr); + @@ -19597,7 +22995,7 @@ index 0b0cb5f..db6b9ed 100644 + mm->cached_hole_size = vma->vm_start - addr; + + /* try just below the current vma->vm_start */ -+ addr = skip_heap_stack_gap(vma, len); ++ addr = skip_heap_stack_gap(vma, len, offset); + } while (!IS_ERR_VALUE(addr)); + +bottomup: @@ -19632,12 +23030,12 @@ index 0b0cb5f..db6b9ed 100644 + mm->cached_hole_size = ~0UL; + + return addr; - } ++} diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c -index b4d3c39..82bb73b 100644 +index dbded5a..ace2781 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c -@@ -95,8 +95,8 @@ out: +@@ -81,8 +81,8 @@ out: return error; } @@ -19648,7 +23046,7 @@ index b4d3c39..82bb73b 100644 { if (!test_thread_flag(TIF_ADDR32) && (flags & MAP_32BIT)) { unsigned long new_begin; -@@ -115,7 +115,7 @@ static void find_start_end(unsigned long flags, unsigned long *begin, +@@ -101,7 +101,7 @@ static void find_start_end(unsigned long flags, unsigned long *begin, *begin = new_begin; } } else { @@ -19657,7 +23055,12 @@ index b4d3c39..82bb73b 100644 *end = TASK_SIZE; } } -@@ -132,16 +132,19 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, +@@ -114,20 +114,24 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, + struct vm_area_struct *vma; + struct vm_unmapped_area_info info; + unsigned long begin, end; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + if (flags & MAP_FIXED) return addr; @@ -19676,29 +23079,27 @@ index b4d3c39..82bb73b 100644 vma = find_vma(mm, addr); - if (end - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (end - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (end - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } - if (((flags & MAP_32BIT) || test_thread_flag(TIF_ADDR32)) -@@ -172,7 +175,7 @@ full_search: - } - return -ENOMEM; - } -- if (!vma || addr + len <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr, len)) { - /* - * Remember the place where we stopped the search: - */ -@@ -195,7 +198,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - { - struct vm_area_struct *vma; + +@@ -137,6 +141,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, + info.high_limit = end; + info.align_mask = filp ? get_align_mask() : 0; + info.align_offset = pgoff << PAGE_SHIFT; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); + } + +@@ -149,6 +154,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, struct mm_struct *mm = current->mm; -- unsigned long addr = addr0, start_addr; -+ unsigned long base = mm->mmap_base, addr = addr0, start_addr; + unsigned long addr = addr0; + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); /* requested length too big for entire address space */ if (len > TASK_SIZE) -@@ -208,13 +211,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -161,12 +167,15 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, if (!test_thread_flag(TIF_ADDR32) && (flags & MAP_32BIT)) goto bottomup; @@ -19709,67 +23110,26 @@ index b4d3c39..82bb73b 100644 /* requesting a specific address */ if (addr) { addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); + vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -- return addr; -+ if (TASK_SIZE - len >= addr) { -+ vma = find_vma(mm, addr); -+ if (check_heap_stack_gap(vma, addr, len)) -+ return addr; -+ } ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) + return addr; } - /* check if free_area_cache is useful for us */ -@@ -240,7 +248,7 @@ try_again: - * return with success: - */ - vma = find_vma(mm, addr); -- if (!vma || addr+len <= vma->vm_start) -+ if (check_heap_stack_gap(vma, addr, len)) - /* remember the address as a hint for next time */ - return mm->free_area_cache = addr; - -@@ -249,8 +257,8 @@ try_again: - mm->cached_hole_size = vma->vm_start - addr; - - /* try just below the current vma->vm_start */ -- addr = vma->vm_start-len; -- } while (len < vma->vm_start); -+ addr = skip_heap_stack_gap(vma, len); -+ } while (!IS_ERR_VALUE(addr)); - - fail: - /* -@@ -270,13 +278,21 @@ bottomup: - * can happen with large stack limits and large mmap() - * allocations. - */ -+ mm->mmap_base = TASK_UNMAPPED_BASE; -+ -+#ifdef CONFIG_PAX_RANDMMAP -+ if (mm->pax_flags & MF_PAX_RANDMMAP) -+ mm->mmap_base += mm->delta_mmap; -+#endif -+ -+ mm->free_area_cache = mm->mmap_base; - mm->cached_hole_size = ~0UL; -- mm->free_area_cache = TASK_UNMAPPED_BASE; - addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags); - /* - * Restore the topdown base: - */ -- mm->free_area_cache = mm->mmap_base; -+ mm->mmap_base = base; -+ mm->free_area_cache = base; - mm->cached_hole_size = ~0UL; - - return addr; +@@ -176,6 +185,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + info.high_limit = mm->mmap_base; + info.align_mask = filp ? get_align_mask() : 0; + info.align_offset = pgoff << PAGE_SHIFT; ++ info.threadstack_offset = offset; + addr = vm_unmapped_area(&info); + if (!(addr & ~PAGE_MASK)) + return addr; diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c -index 6410744..79758f0 100644 +index f84fe00..f41d9f1 100644 --- a/arch/x86/kernel/tboot.c +++ b/arch/x86/kernel/tboot.c -@@ -219,7 +219,7 @@ static int tboot_setup_sleep(void) +@@ -220,7 +220,7 @@ static int tboot_setup_sleep(void) void tboot_shutdown(u32 shutdown_type) { @@ -19778,7 +23138,7 @@ index 6410744..79758f0 100644 if (!tboot_enabled()) return; -@@ -241,7 +241,7 @@ void tboot_shutdown(u32 shutdown_type) +@@ -242,7 +242,7 @@ void tboot_shutdown(u32 shutdown_type) switch_to_tboot_pt(); @@ -19787,7 +23147,7 @@ index 6410744..79758f0 100644 shutdown(); /* should not reach here */ -@@ -299,7 +299,7 @@ static int tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control) +@@ -300,7 +300,7 @@ static int tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control) return 0; } @@ -19796,7 +23156,7 @@ index 6410744..79758f0 100644 static int tboot_wait_for_aps(int num_aps) { -@@ -323,9 +323,9 @@ static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb, +@@ -324,16 +324,16 @@ static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb, { switch (action) { case CPU_DYING: @@ -19808,7 +23168,15 @@ index 6410744..79758f0 100644 return NOTIFY_BAD; break; } -@@ -344,7 +344,7 @@ static __init int tboot_late_init(void) + return NOTIFY_OK; + } + +-static struct notifier_block tboot_cpu_notifier __cpuinitdata = ++static struct notifier_block tboot_cpu_notifier = + { + .notifier_call = tboot_cpu_callback, + }; +@@ -345,7 +345,7 @@ static __init int tboot_late_init(void) tboot_create_trampoline(); @@ -19818,10 +23186,10 @@ index 6410744..79758f0 100644 acpi_os_set_prepare_sleep(&tboot_sleep); diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c -index c6eba2b..3303326 100644 +index 24d3c91..d06b473 100644 --- a/arch/x86/kernel/time.c +++ b/arch/x86/kernel/time.c -@@ -31,9 +31,9 @@ unsigned long profile_pc(struct pt_regs *regs) +@@ -30,9 +30,9 @@ unsigned long profile_pc(struct pt_regs *regs) { unsigned long pc = instruction_pointer(regs); @@ -19833,7 +23201,7 @@ index c6eba2b..3303326 100644 #else unsigned long *sp = (unsigned long *)kernel_stack_pointer(regs); -@@ -42,11 +42,17 @@ unsigned long profile_pc(struct pt_regs *regs) +@@ -41,11 +41,17 @@ unsigned long profile_pc(struct pt_regs *regs) * or above a saved flags. Eflags has bits 22-31 zero, * kernel addresses don't. */ @@ -19852,7 +23220,7 @@ index c6eba2b..3303326 100644 return pc; } diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c -index 9d9d2f9..ed344e4 100644 +index 9d9d2f9..cad418a 100644 --- a/arch/x86/kernel/tls.c +++ b/arch/x86/kernel/tls.c @@ -84,6 +84,11 @@ int do_set_thread_area(struct task_struct *p, int idx, @@ -19867,62 +23235,23 @@ index 9d9d2f9..ed344e4 100644 set_tls_desc(p, idx, &info, 1); return 0; -diff --git a/arch/x86/kernel/trampoline_32.S b/arch/x86/kernel/trampoline_32.S -index 451c0a7..e57f551 100644 ---- a/arch/x86/kernel/trampoline_32.S -+++ b/arch/x86/kernel/trampoline_32.S -@@ -32,6 +32,12 @@ - #include <asm/segment.h> - #include <asm/page_types.h> - -+#ifdef CONFIG_PAX_KERNEXEC -+#define ta(X) (X) -+#else -+#define ta(X) ((X) - __PAGE_OFFSET) -+#endif -+ - #ifdef CONFIG_SMP +@@ -204,7 +209,7 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset, - .section ".x86_trampoline","a" -@@ -62,7 +68,7 @@ r_base = . - inc %ax # protected mode (PE) bit - lmsw %ax # into protected mode - # flush prefetch and jump to startup_32_smp in arch/i386/kernel/head.S -- ljmpl $__BOOT_CS, $(startup_32_smp-__PAGE_OFFSET) -+ ljmpl $__BOOT_CS, $ta(startup_32_smp) - - # These need to be in the same 64K segment as the above; - # hence we don't use the boot_gdt_descr defined in head.S -diff --git a/arch/x86/kernel/trampoline_64.S b/arch/x86/kernel/trampoline_64.S -index 09ff517..df19fbff 100644 ---- a/arch/x86/kernel/trampoline_64.S -+++ b/arch/x86/kernel/trampoline_64.S -@@ -90,7 +90,7 @@ startup_32: - movl $__KERNEL_DS, %eax # Initialize the %ds segment register - movl %eax, %ds - -- movl $X86_CR4_PAE, %eax -+ movl $(X86_CR4_PSE | X86_CR4_PAE | X86_CR4_PGE), %eax - movl %eax, %cr4 # Enable PAE mode - - # Setup trampoline 4 level pagetables -@@ -138,7 +138,7 @@ tidt: - # so the kernel can live anywhere - .balign 4 - tgdt: -- .short tgdt_end - tgdt # gdt limit -+ .short tgdt_end - tgdt - 1 # gdt limit - .long tgdt - r_base - .short 0 - .quad 0x00cf9b000000ffff # __KERNEL32_CS + if (kbuf) + info = kbuf; +- else if (__copy_from_user(infobuf, ubuf, count)) ++ else if (count > sizeof infobuf || __copy_from_user(infobuf, ubuf, count)) + return -EFAULT; + else + info = infobuf; diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c -index ff9281f1..30cb4ac 100644 +index 68bda7a..3ec7bb7 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c -@@ -70,12 +70,6 @@ asmlinkage int system_call(void); +@@ -68,12 +68,6 @@ + #include <asm/setup.h> - /* Do we ignore FPU interrupts ? */ - char ignore_fpu_irq; + asmlinkage int system_call(void); - -/* - * The IDT has to be page-aligned to simplify the Pentium @@ -19932,74 +23261,98 @@ index ff9281f1..30cb4ac 100644 #endif DECLARE_BITMAP(used_vectors, NR_VECTORS); -@@ -108,13 +102,13 @@ static inline void preempt_conditional_cli(struct pt_regs *regs) +@@ -106,11 +100,11 @@ static inline void preempt_conditional_cli(struct pt_regs *regs) } - static void __kprobes --do_trap(int trapnr, int signr, char *str, struct pt_regs *regs, -+do_trap(int trapnr, int signr, const char *str, struct pt_regs *regs, - long error_code, siginfo_t *info) + static int __kprobes +-do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str, ++do_trap_no_signal(struct task_struct *tsk, int trapnr, const char *str, + struct pt_regs *regs, long error_code) { - struct task_struct *tsk = current; - #ifdef CONFIG_X86_32 - if (regs->flags & X86_VM_MASK) { + if (v8086_mode(regs)) { /* - * traps 0, 1, 3, 4, and 5 should be forwarded to vm86. + * Traps 0, 1, 3, 4, and 5 should be forwarded to vm86. * On nmi (interrupt 2), do_trap should not be called. -@@ -125,7 +119,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs, +@@ -123,12 +117,24 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str, + return -1; } #endif - -- if (!user_mode(regs)) -+ if (!user_mode_novm(regs)) - goto kernel_trap; - - #ifdef CONFIG_X86_32 -@@ -148,7 +142,7 @@ trap_signal: - printk_ratelimit()) { - printk(KERN_INFO - "%s[%d] trap %s ip:%lx sp:%lx error:%lx", -- tsk->comm, tsk->pid, str, -+ tsk->comm, task_pid_nr(tsk), str, - regs->ip, regs->sp, error_code); - print_vma_addr(" in ", regs->ip); - printk("\n"); -@@ -165,8 +159,20 @@ kernel_trap: - if (!fixup_exception(regs)) { - tsk->thread.error_code = error_code; - tsk->thread.trap_nr = trapnr; +- if (!user_mode(regs)) { ++ if (!user_mode_novm(regs)) { + if (!fixup_exception(regs)) { + tsk->thread.error_code = error_code; + tsk->thread.trap_nr = trapnr; + +#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) -+ if (trapnr == 12 && ((regs->cs & 0xFFFF) == __KERNEL_CS || (regs->cs & 0xFFFF) == __KERNEXEC_KERNEL_CS)) -+ str = "PAX: suspicious stack segment fault"; ++ if (trapnr == 12 && ((regs->cs & 0xFFFF) == __KERNEL_CS || (regs->cs & 0xFFFF) == __KERNEXEC_KERNEL_CS)) ++ str = "PAX: suspicious stack segment fault"; +#endif + - die(str, regs, error_code); - } + die(str, regs, error_code); + } + +#ifdef CONFIG_PAX_REFCOUNT -+ if (trapnr == 4) -+ pax_report_refcount_overflow(regs); ++ if (trapnr == 4) ++ pax_report_refcount_overflow(regs); +#endif + - return; + return 0; + } - #ifdef CONFIG_X86_32 -@@ -259,14 +265,30 @@ do_general_protection(struct pt_regs *regs, long error_code) +@@ -136,7 +142,7 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str, + } + + static void __kprobes +-do_trap(int trapnr, int signr, char *str, struct pt_regs *regs, ++do_trap(int trapnr, int signr, const char *str, struct pt_regs *regs, + long error_code, siginfo_t *info) + { + struct task_struct *tsk = current; +@@ -160,7 +166,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs, + if (show_unhandled_signals && unhandled_signal(tsk, signr) && + printk_ratelimit()) { + pr_info("%s[%d] trap %s ip:%lx sp:%lx error:%lx", +- tsk->comm, tsk->pid, str, ++ tsk->comm, task_pid_nr(tsk), str, + regs->ip, regs->sp, error_code); + print_vma_addr(" in ", regs->ip); + pr_cont("\n"); +@@ -266,7 +272,7 @@ do_general_protection(struct pt_regs *regs, long error_code) conditional_sti(regs); #ifdef CONFIG_X86_32 -- if (regs->flags & X86_VM_MASK) -+ if (v8086_mode(regs)) - goto gp_in_vm86; +- if (regs->flags & X86_VM_MASK) { ++ if (v8086_mode(regs)) { + local_irq_enable(); + handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code); + goto exit; +@@ -274,18 +280,42 @@ do_general_protection(struct pt_regs *regs, long error_code) #endif tsk = current; -- if (!user_mode(regs)) -+ if (!user_mode_novm(regs)) - goto gp_in_kernel; +- if (!user_mode(regs)) { ++ if (!user_mode_novm(regs)) { + if (fixup_exception(regs)) + goto exit; + + tsk->thread.error_code = error_code; + tsk->thread.trap_nr = X86_TRAP_GP; + if (notify_die(DIE_GPF, "general protection fault", regs, error_code, +- X86_TRAP_GP, SIGSEGV) != NOTIFY_STOP) ++ X86_TRAP_GP, SIGSEGV) != NOTIFY_STOP) { ++ ++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) ++ if ((regs->cs & 0xFFFF) == __KERNEL_CS || (regs->cs & 0xFFFF) == __KERNEXEC_KERNEL_CS) ++ die("PAX: suspicious general protection fault", regs, error_code); ++ else ++#endif ++ + die("general protection fault", regs, error_code); ++ } + goto exit; + } +#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_PAGEEXEC) + if (!(__supported_pte_mask & _PAGE_NX) && tsk->mm && (tsk->mm->pax_flags & MF_PAX_PAGEEXEC)) { @@ -20020,21 +23373,7 @@ index ff9281f1..30cb4ac 100644 tsk->thread.error_code = error_code; tsk->thread.trap_nr = X86_TRAP_GP; -@@ -299,6 +321,13 @@ gp_in_kernel: - if (notify_die(DIE_GPF, "general protection fault", regs, error_code, - X86_TRAP_GP, SIGSEGV) == NOTIFY_STOP) - return; -+ -+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) -+ if ((regs->cs & 0xFFFF) == __KERNEL_CS || (regs->cs & 0xFFFF) == __KERNEXEC_KERNEL_CS) -+ die("PAX: suspicious general protection fault", regs, error_code); -+ else -+#endif -+ - die("general protection fault", regs, error_code); - } - -@@ -425,7 +454,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) +@@ -440,7 +470,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) /* It's safe to allow irq's after DR6 has been saved */ preempt_conditional_sti(regs); @@ -20043,7 +23382,7 @@ index ff9281f1..30cb4ac 100644 handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, X86_TRAP_DB); preempt_conditional_cli(regs); -@@ -440,7 +469,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) +@@ -455,7 +485,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) * We already checked v86 mode above, so we can check for kernel mode * by just checking the CPL of CS. */ @@ -20052,7 +23391,7 @@ index ff9281f1..30cb4ac 100644 tsk->thread.debugreg6 &= ~DR_STEP; set_tsk_thread_flag(tsk, TIF_SINGLESTEP); regs->flags &= ~X86_EFLAGS_TF; -@@ -471,7 +500,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr) +@@ -487,7 +517,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr) return; conditional_sti(regs); @@ -20061,6 +23400,19 @@ index ff9281f1..30cb4ac 100644 { if (!fixup_exception(regs)) { task->thread.error_code = error_code; +diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c +index 0ba4cfb..4596bec 100644 +--- a/arch/x86/kernel/uprobes.c ++++ b/arch/x86/kernel/uprobes.c +@@ -629,7 +629,7 @@ int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, + int ret = NOTIFY_DONE; + + /* We are only interested in userspace traps */ +- if (regs && !user_mode_vm(regs)) ++ if (regs && !user_mode(regs)) + return NOTIFY_DONE; + + switch (val) { diff --git a/arch/x86/kernel/verify_cpu.S b/arch/x86/kernel/verify_cpu.S index b9242ba..50c5edd 100644 --- a/arch/x86/kernel/verify_cpu.S @@ -20074,10 +23426,10 @@ index b9242ba..50c5edd 100644 * verify_cpu, returns the status of longmode and SSE in register %eax. * 0: Success 1: Failure diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c -index 255f58a..5e91150 100644 +index 1cf5766..c0d9de7 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c -@@ -41,6 +41,7 @@ +@@ -43,6 +43,7 @@ #include <linux/ptrace.h> #include <linux/audit.h> #include <linux/stddef.h> @@ -20085,7 +23437,7 @@ index 255f58a..5e91150 100644 #include <asm/uaccess.h> #include <asm/io.h> -@@ -148,7 +149,7 @@ struct pt_regs *save_v86_state(struct kernel_vm86_regs *regs) +@@ -150,7 +151,7 @@ struct pt_regs *save_v86_state(struct kernel_vm86_regs *regs) do_exit(SIGSEGV); } @@ -20094,7 +23446,7 @@ index 255f58a..5e91150 100644 current->thread.sp0 = current->thread.saved_sp0; current->thread.sysenter_cs = __KERNEL_CS; load_sp0(tss, ¤t->thread); -@@ -210,6 +211,13 @@ int sys_vm86old(struct vm86_struct __user *v86, struct pt_regs *regs) +@@ -212,6 +213,13 @@ int sys_vm86old(struct vm86_struct __user *v86) struct task_struct *tsk; int tmp, ret = -EPERM; @@ -20108,7 +23460,7 @@ index 255f58a..5e91150 100644 tsk = current; if (tsk->thread.saved_sp0) goto out; -@@ -240,6 +248,14 @@ int sys_vm86(unsigned long cmd, unsigned long arg, struct pt_regs *regs) +@@ -242,6 +250,14 @@ int sys_vm86(unsigned long cmd, unsigned long arg) int tmp, ret; struct vm86plus_struct __user *v86; @@ -20123,7 +23475,7 @@ index 255f58a..5e91150 100644 tsk = current; switch (cmd) { case VM86_REQUEST_IRQ: -@@ -326,7 +342,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk +@@ -328,7 +344,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk tsk->thread.saved_fs = info->regs32->fs; tsk->thread.saved_gs = get_user_gs(info->regs32); @@ -20132,7 +23484,7 @@ index 255f58a..5e91150 100644 tsk->thread.sp0 = (unsigned long) &info->VM86_TSS_ESP0; if (cpu_has_sep) tsk->thread.sysenter_cs = 0; -@@ -533,7 +549,7 @@ static void do_int(struct kernel_vm86_regs *regs, int i, +@@ -535,7 +551,7 @@ static void do_int(struct kernel_vm86_regs *regs, int i, goto cannot_handle; if (i == 0x21 && is_revectored(AH(regs), &KVM86->int21_revectored)) goto cannot_handle; @@ -20142,7 +23494,7 @@ index 255f58a..5e91150 100644 goto cannot_handle; if ((segoffs >> 16) == BIOSSEG) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S -index 0f703f1..3b426f3 100644 +index 22a1530..8fbaaad 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -26,6 +26,13 @@ @@ -20342,9 +23694,9 @@ index 0f703f1..3b426f3 100644 + . = ALIGN(PAGE_SIZE); + INIT_DATA_SECTION(16) :init - /* - * Code and data for a variety of lowlevel trampolines, to be -@@ -269,19 +350,12 @@ SECTIONS + .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) { + __x86_cpu_dev_start = .; +@@ -257,19 +338,12 @@ SECTIONS } . = ALIGN(8); @@ -20365,7 +23717,7 @@ index 0f703f1..3b426f3 100644 PERCPU_SECTION(INTERNODE_CACHE_BYTES) #endif -@@ -300,16 +374,10 @@ SECTIONS +@@ -288,16 +362,10 @@ SECTIONS .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { __smp_locks = .; *(.smp_locks) @@ -20383,7 +23735,7 @@ index 0f703f1..3b426f3 100644 /* BSS */ . = ALIGN(PAGE_SIZE); .bss : AT(ADDR(.bss) - LOAD_OFFSET) { -@@ -325,6 +393,7 @@ SECTIONS +@@ -313,6 +381,7 @@ SECTIONS __brk_base = .; . += 64 * 1024; /* 64k alignment slop space */ *(.brk_reservation) /* areas brk users have reserved */ @@ -20391,7 +23743,7 @@ index 0f703f1..3b426f3 100644 __brk_limit = .; } -@@ -351,13 +420,12 @@ SECTIONS +@@ -339,13 +408,12 @@ SECTIONS * for the boot processor. */ #define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load @@ -20407,10 +23759,10 @@ index 0f703f1..3b426f3 100644 #ifdef CONFIG_SMP diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c -index 7515cf0..331a1a0 100644 +index 9a907a6..f83f921 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c -@@ -54,15 +54,13 @@ +@@ -56,15 +56,13 @@ DEFINE_VVAR(int, vgetcpu_mode); DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data); @@ -20427,16 +23779,7 @@ index 7515cf0..331a1a0 100644 else if (!strcmp("none", str)) vsyscall_mode = NONE; else -@@ -206,7 +204,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) - - tsk = current; - if (seccomp_mode(&tsk->seccomp)) -- do_exit(SIGKILL); -+ do_group_exit(SIGKILL); - - /* - * With a real vsyscall, page faults cause SIGSEGV. We want to -@@ -278,8 +276,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) +@@ -323,8 +321,7 @@ do_ret: return true; sigsegv: @@ -20446,7 +23789,7 @@ index 7515cf0..331a1a0 100644 } /* -@@ -332,10 +329,7 @@ void __init map_vsyscall(void) +@@ -377,10 +374,7 @@ void __init map_vsyscall(void) extern char __vvar_page; unsigned long physaddr_vvar_page = __pa_symbol(&__vvar_page); @@ -20459,51 +23802,80 @@ index 7515cf0..331a1a0 100644 (unsigned long)VSYSCALL_START); diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c -index 9796c2f..f686fbf 100644 +index b014d94..6d6ca7b 100644 --- a/arch/x86/kernel/x8664_ksyms_64.c +++ b/arch/x86/kernel/x8664_ksyms_64.c -@@ -29,8 +29,6 @@ EXPORT_SYMBOL(__put_user_8); - EXPORT_SYMBOL(copy_user_generic_string); +@@ -34,8 +34,6 @@ EXPORT_SYMBOL(copy_user_generic_string); EXPORT_SYMBOL(copy_user_generic_unrolled); + EXPORT_SYMBOL(copy_user_enhanced_fast_string); EXPORT_SYMBOL(__copy_user_nocache); -EXPORT_SYMBOL(_copy_from_user); -EXPORT_SYMBOL(_copy_to_user); EXPORT_SYMBOL(copy_page); EXPORT_SYMBOL(clear_page); +diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c +index 45a14db..075bb9b 100644 +--- a/arch/x86/kernel/x86_init.c ++++ b/arch/x86/kernel/x86_init.c +@@ -85,7 +85,7 @@ struct x86_init_ops x86_init __initdata = { + }, + }; + +-struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { ++struct x86_cpuinit_ops x86_cpuinit __cpuinitconst = { + .early_percpu_clock_init = x86_init_noop, + .setup_percpu_clockev = setup_secondary_APIC_clock, + }; +@@ -93,7 +93,7 @@ struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { + static void default_nmi_init(void) { }; + static int default_i8042_detect(void) { return 1; }; + +-struct x86_platform_ops x86_platform = { ++struct x86_platform_ops x86_platform __read_only = { + .calibrate_tsc = native_calibrate_tsc, + .get_wallclock = mach_get_cmos_time, + .set_wallclock = mach_set_rtc_mmss, +@@ -107,7 +107,7 @@ struct x86_platform_ops x86_platform = { + }; + + EXPORT_SYMBOL_GPL(x86_platform); +-struct x86_msi_ops x86_msi = { ++struct x86_msi_ops x86_msi __read_only = { + .setup_msi_irqs = native_setup_msi_irqs, + .compose_msi_msg = native_compose_msi_msg, + .teardown_msi_irq = native_teardown_msi_irq, +@@ -116,7 +116,7 @@ struct x86_msi_ops x86_msi = { + .setup_hpet_msi = default_setup_hpet_msi, + }; + +-struct x86_io_apic_ops x86_io_apic_ops = { ++struct x86_io_apic_ops x86_io_apic_ops __read_only = { + .init = native_io_apic_init_mappings, + .read = native_io_apic_read, + .write = native_io_apic_write, diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c -index e62728e..5fc3a07 100644 +index ada87a3..afea76d 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c -@@ -131,7 +131,7 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf, - fx_sw_user->xstate_size > fx_sw_user->extended_size) - return -EINVAL; - -- err = __get_user(magic2, (__u32 *) (((void *)fpstate) + -+ err = __get_user(magic2, (__u32 __user *) (((void __user *)fpstate) + - fx_sw_user->extended_size - - FP_XSTATE_MAGIC2_SIZE)); - if (err) -@@ -267,7 +267,7 @@ fx_only: - * the other extended state. - */ - xrstor_state(init_xstate_buf, pcntxt_mask & ~XSTATE_FPSSE); -- return fxrstor_checking((__force struct i387_fxsave_struct *)buf); -+ return fxrstor_checking((struct i387_fxsave_struct __force_kernel *)buf); - } +@@ -199,6 +199,7 @@ static inline int save_user_xstate(struct xsave_struct __user *buf) + { + int err; - /* -@@ -296,7 +296,7 @@ int restore_i387_xstate(void __user *buf) ++ buf = (struct xsave_struct __user *)____m(buf); if (use_xsave()) - err = restore_user_xstate(buf); - else -- err = fxrstor_checking((__force struct i387_fxsave_struct *) -+ err = fxrstor_checking((struct i387_fxsave_struct __force_kernel *) - buf); - if (unlikely(err)) { - /* + err = xsave_user(buf); + else if (use_fxsr()) +@@ -311,6 +312,7 @@ sanitize_restored_xstate(struct task_struct *tsk, + */ + static inline int restore_user_xstate(void __user *buf, u64 xbv, int fx_only) + { ++ buf = (void __user *)____m(buf); + if (use_xsave()) { + if ((unsigned long)buf % 64 || fx_only) { + u64 init_bv = pcntxt_mask & ~XSTATE_FPSSE; diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c -index 9fed5be..18fd595 100644 +index a20ecb5..d0e2194 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -124,15 +124,20 @@ int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, @@ -20554,10 +23926,10 @@ index 9fed5be..18fd595 100644 out: diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c -index 8375622..b7bca1a 100644 +index 59622c9..f338414 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c -@@ -252,6 +252,7 @@ struct gprefix { +@@ -328,6 +328,7 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) #define ____emulate_2op(ctxt, _op, _x, _y, _suffix, _dsttype) \ do { \ @@ -20565,7 +23937,7 @@ index 8375622..b7bca1a 100644 __asm__ __volatile__ ( \ _PRE_EFLAGS("0", "4", "2") \ _op _suffix " %"_x"3,%1; " \ -@@ -266,8 +267,6 @@ struct gprefix { +@@ -342,8 +343,6 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) /* Raw emulation: instruction has two explicit operands. */ #define __emulate_2op_nobyte(ctxt,_op,_wx,_wy,_lx,_ly,_qx,_qy) \ do { \ @@ -20574,7 +23946,7 @@ index 8375622..b7bca1a 100644 switch ((ctxt)->dst.bytes) { \ case 2: \ ____emulate_2op(ctxt,_op,_wx,_wy,"w",u16); \ -@@ -283,7 +282,6 @@ struct gprefix { +@@ -359,7 +358,6 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) #define __emulate_2op(ctxt,_op,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \ do { \ @@ -20583,10 +23955,10 @@ index 8375622..b7bca1a 100644 case 1: \ ____emulate_2op(ctxt,_op,_bx,_by,"b",u8); \ diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c -index 8584322..17d5955 100644 +index f77df1c..6f20690 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c -@@ -54,7 +54,7 @@ +@@ -55,7 +55,7 @@ #define APIC_BUS_CYCLE_NS 1 /* #define apic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg) */ @@ -20596,10 +23968,10 @@ index 8584322..17d5955 100644 #define APIC_LVT_NUM 6 /* 14 is the version for Xeon and Pentium 8.4.8*/ diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h -index df5a703..63748a7 100644 +index 105dd5b..1b0ccc2 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h -@@ -197,7 +197,7 @@ retry_walk: +@@ -208,7 +208,7 @@ retry_walk: if (unlikely(kvm_is_error_hva(host_addr))) goto error; @@ -20607,12 +23979,12 @@ index df5a703..63748a7 100644 + ptep_user = (pt_element_t __force_user *)((void *)host_addr + offset); if (unlikely(__copy_from_user(&pte, ptep_user, sizeof(pte)))) goto error; - + walker->ptep_user[walker->level - 1] = ptep_user; diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c -index e334389..6839087 100644 +index e1b1ce2..f7b4b43 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c -@@ -3509,7 +3509,11 @@ static void reload_tss(struct kvm_vcpu *vcpu) +@@ -3507,7 +3507,11 @@ static void reload_tss(struct kvm_vcpu *vcpu) int cpu = raw_smp_processor_id(); struct svm_cpu_data *sd = per_cpu(svm_data, cpu); @@ -20624,7 +23996,7 @@ index e334389..6839087 100644 load_TR_desc(); } -@@ -3887,6 +3891,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) +@@ -3901,6 +3905,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) #endif #endif @@ -20636,10 +24008,25 @@ index e334389..6839087 100644 local_irq_disable(); diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c -index 4ff0ab9..2ff68d3 100644 +index 0af1807..06912bb 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c -@@ -1303,7 +1303,11 @@ static void reload_tss(void) +@@ -1184,12 +1184,12 @@ static void vmcs_write64(unsigned long field, u64 value) + #endif + } + +-static void vmcs_clear_bits(unsigned long field, u32 mask) ++static void vmcs_clear_bits(unsigned long field, unsigned long mask) + { + vmcs_writel(field, vmcs_readl(field) & ~mask); + } + +-static void vmcs_set_bits(unsigned long field, u32 mask) ++static void vmcs_set_bits(unsigned long field, unsigned long mask) + { + vmcs_writel(field, vmcs_readl(field) | mask); + } +@@ -1390,7 +1390,11 @@ static void reload_tss(void) struct desc_struct *descs; descs = (void *)gdt->address; @@ -20651,7 +24038,18 @@ index 4ff0ab9..2ff68d3 100644 load_TR_desc(); } -@@ -2625,8 +2629,11 @@ static __init int hardware_setup(void) +@@ -1614,6 +1618,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) + vmcs_writel(HOST_TR_BASE, kvm_read_tr_base()); /* 22.2.4 */ + vmcs_writel(HOST_GDTR_BASE, gdt->address); /* 22.2.4 */ + ++#ifdef CONFIG_PAX_PER_CPU_PGD ++ vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */ ++#endif ++ + rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp); + vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */ + vmx->loaded_vmcs->cpu = cpu; +@@ -2779,8 +2787,11 @@ static __init int hardware_setup(void) if (!cpu_has_vmx_flexpriority()) flexpriority_enabled = 0; @@ -20665,29 +24063,55 @@ index 4ff0ab9..2ff68d3 100644 if (enable_ept && !cpu_has_vmx_ept_2m_page()) kvm_disable_largepages(); -@@ -3642,7 +3649,7 @@ static void vmx_set_constant_host_state(void) +@@ -2792,10 +2803,12 @@ static __init int hardware_setup(void) + !cpu_has_vmx_virtual_intr_delivery()) + enable_apicv_reg_vid = 0; + ++ pax_open_kernel(); + if (enable_apicv_reg_vid) +- kvm_x86_ops->update_cr8_intercept = NULL; ++ *(void **)&kvm_x86_ops->update_cr8_intercept = NULL; + else +- kvm_x86_ops->hwapic_irr_update = NULL; ++ *(void **)&kvm_x86_ops->hwapic_irr_update = NULL; ++ pax_close_kernel(); + + if (nested) + nested_vmx_setup_ctls_msrs(); +@@ -3883,7 +3896,10 @@ static void vmx_set_constant_host_state(void) + + vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */ + vmcs_writel(HOST_CR4, read_cr4()); /* 22.2.3, 22.2.5 */ ++ ++#ifndef CONFIG_PAX_PER_CPU_PGD + vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */ ++#endif + + vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */ + #ifdef CONFIG_X86_64 +@@ -3904,7 +3920,7 @@ static void vmx_set_constant_host_state(void) + native_store_idt(&dt); vmcs_writel(HOST_IDTR_BASE, dt.address); /* 22.2.4 */ - asm("mov $.Lkvm_vmx_return, %0" : "=r"(tmpl)); -- vmcs_writel(HOST_RIP, tmpl); /* 22.2.5 */ -+ vmcs_writel(HOST_RIP, ktla_ktva(tmpl)); /* 22.2.5 */ +- vmcs_writel(HOST_RIP, vmx_return); /* 22.2.5 */ ++ vmcs_writel(HOST_RIP, ktla_ktva(vmx_return)); /* 22.2.5 */ rdmsr(MSR_IA32_SYSENTER_CS, low32, high32); vmcs_write32(HOST_IA32_SYSENTER_CS, low32); -@@ -6180,6 +6187,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) - "jmp .Lkvm_vmx_return \n\t" - ".Llaunched: " __ex(ASM_VMX_VMRESUME) "\n\t" - ".Lkvm_vmx_return: " +@@ -6580,6 +6596,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) + "jmp 2f \n\t" + "1: " __ex(ASM_VMX_VMRESUME) "\n\t" + "2: " + +#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) -+ "ljmp %[cs],$.Lkvm_vmx_return2\n\t" -+ ".Lkvm_vmx_return2: " ++ "ljmp %[cs],$3f\n\t" ++ "3: " +#endif + /* Save guest registers, load host registers, keep flags */ - "mov %0, %c[wordsize](%%"R"sp) \n\t" + "mov %0, %c[wordsize](%%" _ASM_SP ") \n\t" "pop %0 \n\t" -@@ -6228,6 +6241,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) +@@ -6632,6 +6654,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) #endif [cr2]"i"(offsetof(struct vcpu_vmx, vcpu.arch.cr2)), [wordsize]"i"(sizeof(ulong)) @@ -20697,31 +24121,43 @@ index 4ff0ab9..2ff68d3 100644 +#endif + : "cc", "memory" - , R"ax", R"bx", R"di", R"si" #ifdef CONFIG_X86_64 -@@ -6256,7 +6274,16 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) - } - } + , "rax", "rbx", "rdi", "rsi" +@@ -6645,7 +6672,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) + if (debugctlmsr) + update_debugctlmsr(debugctlmsr); -- asm("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); -+ asm("mov %0, %%ds; mov %0, %%es; mov %0, %%ss" : : "r"(__KERNEL_DS)); +-#ifndef CONFIG_X86_64 ++#ifdef CONFIG_X86_32 + /* + * The sysexit path does not restore ds/es, so we must set them to + * a reasonable value ourselves. +@@ -6654,8 +6681,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) + * may be executed in interrupt context, which saves and restore segments + * around it, nullifying its effect. + */ +- loadsegment(ds, __USER_DS); +- loadsegment(es, __USER_DS); ++ loadsegment(ds, __KERNEL_DS); ++ loadsegment(es, __KERNEL_DS); ++ loadsegment(ss, __KERNEL_DS); + -+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) ++#ifdef CONFIG_PAX_KERNEXEC + loadsegment(fs, __KERNEL_PERCPU); +#endif + -+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_MEMORY_UDEREF) ++#ifdef CONFIG_PAX_MEMORY_UDEREF + __set_fs(current_thread_info()->addr_limit); +#endif + - vmx->loaded_vmcs->launched = 1; + #endif - vmx->exit_reason = vmcs_read32(VM_EXIT_REASON); + vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 185a2b8..866d2a6 100644 +index e172132..c3d3e27 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -1357,8 +1357,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data) +@@ -1686,8 +1686,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data) { struct kvm *kvm = vcpu->kvm; int lm = is_long_mode(vcpu); @@ -20732,7 +24168,7 @@ index 185a2b8..866d2a6 100644 u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64 : kvm->arch.xen_hvm_config.blob_size_32; u32 page_num = data & ~PAGE_MASK; -@@ -2213,6 +2213,8 @@ long kvm_arch_dev_ioctl(struct file *filp, +@@ -2567,6 +2567,8 @@ long kvm_arch_dev_ioctl(struct file *filp, if (n < msr_list.nmsrs) goto out; r = -EFAULT; @@ -20741,18 +24177,18 @@ index 185a2b8..866d2a6 100644 if (copy_to_user(user_msr_list->indices, &msrs_to_save, num_msrs_to_save * sizeof(u32))) goto out; -@@ -2338,7 +2340,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu, +@@ -2696,7 +2698,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu, static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq) { -- if (irq->irq < 0 || irq->irq >= 256) -+ if (irq->irq >= 256) +- if (irq->irq < 0 || irq->irq >= KVM_NR_INTERRUPTS) ++ if (irq->irq >= KVM_NR_INTERRUPTS) return -EINVAL; if (irqchip_in_kernel(vcpu->kvm)) return -ENXIO; -@@ -4860,7 +4862,7 @@ static void kvm_set_mmio_spte_mask(void) - kvm_mmu_set_mmio_spte_mask(mask); - } +@@ -5247,7 +5249,7 @@ static struct notifier_block pvclock_gtod_notifier = { + }; + #endif -int kvm_arch_init(void *opaque) +int kvm_arch_init(const void *opaque) @@ -20760,10 +24196,10 @@ index 185a2b8..866d2a6 100644 int r; struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque; diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c -index 642d880..44e0f3f 100644 +index 7114c63..a1018fc 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c -@@ -1200,9 +1200,10 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count) +@@ -1201,9 +1201,10 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count) * Rebooting also tells the Host we're finished, but the RESTART flag tells the * Launcher to reboot us. */ @@ -21260,20 +24696,20 @@ index f5cc9eb..51fa319 100644 CFI_ENDPROC ENDPROC(atomic64_inc_not_zero_cx8) diff --git a/arch/x86/lib/checksum_32.S b/arch/x86/lib/checksum_32.S -index 78d16a5..fbcf666 100644 +index 2af5df3..62b1a5a 100644 --- a/arch/x86/lib/checksum_32.S +++ b/arch/x86/lib/checksum_32.S -@@ -28,7 +28,8 @@ - #include <linux/linkage.h> +@@ -29,7 +29,8 @@ #include <asm/dwarf2.h> #include <asm/errno.h> + #include <asm/asm.h> - +#include <asm/segment.h> + /* * computes a partial checksum, e.g. for TCP/UDP fragments */ -@@ -296,9 +297,24 @@ unsigned int csum_partial_copy_generic (const char *src, char *dst, +@@ -293,9 +294,24 @@ unsigned int csum_partial_copy_generic (const char *src, char *dst, #define ARGBASE 16 #define FP 12 @@ -21300,7 +24736,7 @@ index 78d16a5..fbcf666 100644 subl $4,%esp CFI_ADJUST_CFA_OFFSET 4 pushl_cfi %edi -@@ -320,7 +336,7 @@ ENTRY(csum_partial_copy_generic) +@@ -317,7 +333,7 @@ ENTRY(csum_partial_copy_generic) jmp 4f SRC(1: movw (%esi), %bx ) addl $2, %esi @@ -21309,7 +24745,7 @@ index 78d16a5..fbcf666 100644 addl $2, %edi addw %bx, %ax adcl $0, %eax -@@ -332,30 +348,30 @@ DST( movw %bx, (%edi) ) +@@ -329,30 +345,30 @@ DST( movw %bx, (%edi) ) SRC(1: movl (%esi), %ebx ) SRC( movl 4(%esi), %edx ) adcl %ebx, %eax @@ -21348,7 +24784,7 @@ index 78d16a5..fbcf666 100644 lea 32(%esi), %esi lea 32(%edi), %edi -@@ -369,7 +385,7 @@ DST( movl %edx, 28(%edi) ) +@@ -366,7 +382,7 @@ DST( movl %edx, 28(%edi) ) shrl $2, %edx # This clears CF SRC(3: movl (%esi), %ebx ) adcl %ebx, %eax @@ -21357,7 +24793,7 @@ index 78d16a5..fbcf666 100644 lea 4(%esi), %esi lea 4(%edi), %edi dec %edx -@@ -381,12 +397,12 @@ DST( movl %ebx, (%edi) ) +@@ -378,12 +394,12 @@ DST( movl %ebx, (%edi) ) jb 5f SRC( movw (%esi), %cx ) leal 2(%esi), %esi @@ -21372,7 +24808,7 @@ index 78d16a5..fbcf666 100644 6: addl %ecx, %eax adcl $0, %eax 7: -@@ -397,7 +413,7 @@ DST( movb %cl, (%edi) ) +@@ -394,7 +410,7 @@ DST( movb %cl, (%edi) ) 6001: movl ARGBASE+20(%esp), %ebx # src_err_ptr @@ -21381,7 +24817,7 @@ index 78d16a5..fbcf666 100644 # zero the complete destination - computing the rest # is too much work -@@ -410,11 +426,15 @@ DST( movb %cl, (%edi) ) +@@ -407,11 +423,15 @@ DST( movb %cl, (%edi) ) 6002: movl ARGBASE+24(%esp), %ebx # dst_err_ptr @@ -21398,7 +24834,7 @@ index 78d16a5..fbcf666 100644 popl_cfi %ebx CFI_RESTORE ebx popl_cfi %esi -@@ -424,26 +444,43 @@ DST( movb %cl, (%edi) ) +@@ -421,26 +441,43 @@ DST( movb %cl, (%edi) ) popl_cfi %ecx # equivalent to addl $4,%esp ret CFI_ENDPROC @@ -21447,7 +24883,7 @@ index 78d16a5..fbcf666 100644 pushl_cfi %ebx CFI_REL_OFFSET ebx, 0 pushl_cfi %edi -@@ -464,7 +501,7 @@ ENTRY(csum_partial_copy_generic) +@@ -461,7 +498,7 @@ ENTRY(csum_partial_copy_generic) subl %ebx, %edi lea -1(%esi),%edx andl $-32,%edx @@ -21456,7 +24892,7 @@ index 78d16a5..fbcf666 100644 testl %esi, %esi jmp *%ebx 1: addl $64,%esi -@@ -485,19 +522,19 @@ ENTRY(csum_partial_copy_generic) +@@ -482,19 +519,19 @@ ENTRY(csum_partial_copy_generic) jb 5f SRC( movw (%esi), %dx ) leal 2(%esi), %esi @@ -21479,7 +24915,7 @@ index 78d16a5..fbcf666 100644 # zero the complete destination (computing the rest is too much work) movl ARGBASE+8(%esp),%edi # dst movl ARGBASE+12(%esp),%ecx # len -@@ -505,10 +542,17 @@ DST( movb %dl, (%edi) ) +@@ -502,10 +539,17 @@ DST( movb %dl, (%edi) ) rep; stosb jmp 7b 6002: movl ARGBASE+24(%esp), %ebx # dst_err_ptr @@ -21498,7 +24934,7 @@ index 78d16a5..fbcf666 100644 popl_cfi %esi CFI_RESTORE esi popl_cfi %edi -@@ -517,7 +561,7 @@ DST( movb %dl, (%edi) ) +@@ -514,7 +558,7 @@ DST( movb %dl, (%edi) ) CFI_RESTORE ebx ret CFI_ENDPROC @@ -21563,106 +24999,106 @@ index 1e572c5..2a162cd 100644 CFI_ENDPROC diff --git a/arch/x86/lib/copy_page_64.S b/arch/x86/lib/copy_page_64.S -index 6b34d04..dccb07f 100644 +index 176cca6..1166c50 100644 --- a/arch/x86/lib/copy_page_64.S +++ b/arch/x86/lib/copy_page_64.S -@@ -9,6 +9,7 @@ copy_page_c: +@@ -9,6 +9,7 @@ copy_page_rep: CFI_STARTPROC - movl $4096/8,%ecx - rep movsq + movl $4096/8, %ecx + rep movsq + pax_force_retaddr ret CFI_ENDPROC - ENDPROC(copy_page_c) -@@ -20,12 +21,14 @@ ENDPROC(copy_page_c) + ENDPROC(copy_page_rep) +@@ -20,12 +21,14 @@ ENDPROC(copy_page_rep) ENTRY(copy_page) CFI_STARTPROC -- subq $2*8,%rsp +- subq $2*8, %rsp - CFI_ADJUST_CFA_OFFSET 2*8 -+ subq $3*8,%rsp ++ subq $3*8, %rsp + CFI_ADJUST_CFA_OFFSET 3*8 - movq %rbx,(%rsp) + movq %rbx, (%rsp) CFI_REL_OFFSET rbx, 0 - movq %r12,1*8(%rsp) + movq %r12, 1*8(%rsp) CFI_REL_OFFSET r12, 1*8 -+ movq %r13,2*8(%rsp) ++ movq %r13, 2*8(%rsp) + CFI_REL_OFFSET r13, 2*8 - movl $(4096/64)-5,%ecx + movl $(4096/64)-5, %ecx .p2align 4 -@@ -37,7 +40,7 @@ ENTRY(copy_page) - movq 16 (%rsi), %rdx - movq 24 (%rsi), %r8 - movq 32 (%rsi), %r9 -- movq 40 (%rsi), %r10 -+ movq 40 (%rsi), %r13 - movq 48 (%rsi), %r11 - movq 56 (%rsi), %r12 - -@@ -48,7 +51,7 @@ ENTRY(copy_page) - movq %rdx, 16 (%rdi) - movq %r8, 24 (%rdi) - movq %r9, 32 (%rdi) -- movq %r10, 40 (%rdi) -+ movq %r13, 40 (%rdi) - movq %r11, 48 (%rdi) - movq %r12, 56 (%rdi) - -@@ -67,7 +70,7 @@ ENTRY(copy_page) - movq 16 (%rsi), %rdx - movq 24 (%rsi), %r8 - movq 32 (%rsi), %r9 -- movq 40 (%rsi), %r10 -+ movq 40 (%rsi), %r13 - movq 48 (%rsi), %r11 - movq 56 (%rsi), %r12 - -@@ -76,7 +79,7 @@ ENTRY(copy_page) - movq %rdx, 16 (%rdi) - movq %r8, 24 (%rdi) - movq %r9, 32 (%rdi) -- movq %r10, 40 (%rdi) -+ movq %r13, 40 (%rdi) - movq %r11, 48 (%rdi) - movq %r12, 56 (%rdi) - -@@ -89,8 +92,11 @@ ENTRY(copy_page) +@@ -36,7 +39,7 @@ ENTRY(copy_page) + movq 0x8*2(%rsi), %rdx + movq 0x8*3(%rsi), %r8 + movq 0x8*4(%rsi), %r9 +- movq 0x8*5(%rsi), %r10 ++ movq 0x8*5(%rsi), %r13 + movq 0x8*6(%rsi), %r11 + movq 0x8*7(%rsi), %r12 + +@@ -47,7 +50,7 @@ ENTRY(copy_page) + movq %rdx, 0x8*2(%rdi) + movq %r8, 0x8*3(%rdi) + movq %r9, 0x8*4(%rdi) +- movq %r10, 0x8*5(%rdi) ++ movq %r13, 0x8*5(%rdi) + movq %r11, 0x8*6(%rdi) + movq %r12, 0x8*7(%rdi) + +@@ -66,7 +69,7 @@ ENTRY(copy_page) + movq 0x8*2(%rsi), %rdx + movq 0x8*3(%rsi), %r8 + movq 0x8*4(%rsi), %r9 +- movq 0x8*5(%rsi), %r10 ++ movq 0x8*5(%rsi), %r13 + movq 0x8*6(%rsi), %r11 + movq 0x8*7(%rsi), %r12 + +@@ -75,7 +78,7 @@ ENTRY(copy_page) + movq %rdx, 0x8*2(%rdi) + movq %r8, 0x8*3(%rdi) + movq %r9, 0x8*4(%rdi) +- movq %r10, 0x8*5(%rdi) ++ movq %r13, 0x8*5(%rdi) + movq %r11, 0x8*6(%rdi) + movq %r12, 0x8*7(%rdi) + +@@ -87,8 +90,11 @@ ENTRY(copy_page) CFI_RESTORE rbx - movq 1*8(%rsp),%r12 + movq 1*8(%rsp), %r12 CFI_RESTORE r12 -- addq $2*8,%rsp +- addq $2*8, %rsp - CFI_ADJUST_CFA_OFFSET -2*8 -+ movq 2*8(%rsp),%r13 ++ movq 2*8(%rsp), %r13 + CFI_RESTORE r13 -+ addq $3*8,%rsp ++ addq $3*8, %rsp + CFI_ADJUST_CFA_OFFSET -3*8 + pax_force_retaddr ret .Lcopy_page_end: CFI_ENDPROC -@@ -101,7 +107,7 @@ ENDPROC(copy_page) +@@ -99,7 +105,7 @@ ENDPROC(copy_page) #include <asm/cpufeature.h> - .section .altinstr_replacement,"ax" + .section .altinstr_replacement,"a" 1: .byte 0xeb /* jmp <disp8> */ - .byte (copy_page_c - copy_page) - (2f - 1b) /* offset */ + .byte (copy_page_rep - copy_page) - (2f - 1b) /* offset */ 2: diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S -index 0248402..821c786 100644 +index a30ca15..d25fab6 100644 --- a/arch/x86/lib/copy_user_64.S +++ b/arch/x86/lib/copy_user_64.S -@@ -16,6 +16,7 @@ - #include <asm/thread_info.h> - #include <asm/cpufeature.h> +@@ -18,6 +18,7 @@ #include <asm/alternative-asm.h> + #include <asm/asm.h> + #include <asm/smap.h> +#include <asm/pgtable.h> /* * By placing feature2 after feature1 in altinstructions section, we logically -@@ -29,7 +30,7 @@ +@@ -31,7 +32,7 @@ .byte 0xe9 /* 32bit jump */ .long \orig-1f /* by default jump to orig */ 1: @@ -21671,7 +25107,7 @@ index 0248402..821c786 100644 2: .byte 0xe9 /* near jump with 32bit immediate */ .long \alt1-1b /* offset */ /* or alternatively to alt1 */ 3: .byte 0xe9 /* near jump with 32bit immediate */ -@@ -71,47 +72,20 @@ +@@ -70,47 +71,20 @@ #endif .endm @@ -21746,35 +25182,35 @@ index 0248402..821c786 100644 16: movq %r11,7*8(%rdi) leaq 64(%rsi),%rsi leaq 64(%rdi),%rdi -@@ -179,6 +153,7 @@ ENTRY(copy_user_generic_unrolled) - decl %ecx +@@ -180,6 +154,7 @@ ENTRY(copy_user_generic_unrolled) jnz 21b 23: xor %eax,%eax + ASM_CLAC + pax_force_retaddr ret .section .fixup,"ax" @@ -251,6 +226,7 @@ ENTRY(copy_user_generic_string) - 3: rep movsb 4: xorl %eax,%eax + ASM_CLAC + pax_force_retaddr ret .section .fixup,"ax" -@@ -287,6 +263,7 @@ ENTRY(copy_user_enhanced_fast_string) - 1: rep +@@ -286,6 +262,7 @@ ENTRY(copy_user_enhanced_fast_string) movsb 2: xorl %eax,%eax + ASM_CLAC + pax_force_retaddr ret .section .fixup,"ax" diff --git a/arch/x86/lib/copy_user_nocache_64.S b/arch/x86/lib/copy_user_nocache_64.S -index cb0c112..e3a6895 100644 +index 6a4f43c..f08b4a2 100644 --- a/arch/x86/lib/copy_user_nocache_64.S +++ b/arch/x86/lib/copy_user_nocache_64.S -@@ -8,12 +8,14 @@ +@@ -8,6 +8,7 @@ #include <linux/linkage.h> #include <asm/dwarf2.h> @@ -21782,29 +25218,30 @@ index cb0c112..e3a6895 100644 #define FIX_ALIGNMENT 1 - #include <asm/current.h> - #include <asm/asm-offsets.h> +@@ -16,6 +17,7 @@ #include <asm/thread_info.h> + #include <asm/asm.h> + #include <asm/smap.h> +#include <asm/pgtable.h> .macro ALIGN_DESTINATION #ifdef FIX_ALIGNMENT -@@ -50,6 +52,15 @@ +@@ -49,6 +51,15 @@ */ ENTRY(__copy_user_nocache) CFI_STARTPROC + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ mov $PAX_USER_SHADOW_BASE,%rcx ++ mov pax_user_shadow_base,%rcx + cmp %rcx,%rsi + jae 1f + add %rcx,%rsi +1: +#endif + + ASM_STAC cmpl $8,%edx jb 20f /* less then 8 bytes, go to byte copy loop */ - ALIGN_DESTINATION @@ -59,19 +70,19 @@ ENTRY(__copy_user_nocache) jz 17f 1: movq (%rsi),%r8 @@ -21829,27 +25266,27 @@ index cb0c112..e3a6895 100644 16: movnti %r11,7*8(%rdi) leaq 64(%rsi),%rsi leaq 64(%rdi),%rdi -@@ -98,6 +109,7 @@ ENTRY(__copy_user_nocache) - jnz 21b +@@ -99,6 +110,7 @@ ENTRY(__copy_user_nocache) 23: xorl %eax,%eax + ASM_CLAC sfence + pax_force_retaddr ret .section .fixup,"ax" diff --git a/arch/x86/lib/csum-copy_64.S b/arch/x86/lib/csum-copy_64.S -index fb903b7..c92b7f7 100644 +index 2419d5f..953ee51 100644 --- a/arch/x86/lib/csum-copy_64.S +++ b/arch/x86/lib/csum-copy_64.S -@@ -8,6 +8,7 @@ - #include <linux/linkage.h> +@@ -9,6 +9,7 @@ #include <asm/dwarf2.h> #include <asm/errno.h> + #include <asm/asm.h> +#include <asm/alternative-asm.h> /* * Checksum copy with exception handling. -@@ -228,6 +229,7 @@ ENTRY(csum_partial_copy_generic) +@@ -220,6 +221,7 @@ ENTRY(csum_partial_copy_generic) CFI_RESTORE rbp addq $7*8, %rsp CFI_ADJUST_CFA_OFFSET -7*8 @@ -21858,47 +25295,35 @@ index fb903b7..c92b7f7 100644 CFI_RESTORE_STATE diff --git a/arch/x86/lib/csum-wrappers_64.c b/arch/x86/lib/csum-wrappers_64.c -index 459b58a..9570bc7 100644 +index 25b7ae8..169fafc 100644 --- a/arch/x86/lib/csum-wrappers_64.c +++ b/arch/x86/lib/csum-wrappers_64.c -@@ -52,7 +52,13 @@ csum_partial_copy_from_user(const void __user *src, void *dst, +@@ -52,7 +52,7 @@ csum_partial_copy_from_user(const void __user *src, void *dst, len -= 2; } } - isum = csum_partial_copy_generic((__force const void *)src, -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)src < PAX_USER_SHADOW_BASE) -+ src += PAX_USER_SHADOW_BASE; -+#endif -+ -+ isum = csum_partial_copy_generic((const void __force_kernel *)src, ++ isum = csum_partial_copy_generic((const void __force_kernel *)____m(src), dst, len, isum, errp, NULL); if (unlikely(*errp)) goto out_err; -@@ -105,7 +111,13 @@ csum_partial_copy_to_user(const void *src, void __user *dst, +@@ -105,7 +105,7 @@ csum_partial_copy_to_user(const void *src, void __user *dst, } *errp = 0; - return csum_partial_copy_generic(src, (void __force *)dst, -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)dst < PAX_USER_SHADOW_BASE) -+ dst += PAX_USER_SHADOW_BASE; -+#endif -+ -+ return csum_partial_copy_generic(src, (void __force_kernel *)dst, ++ return csum_partial_copy_generic(src, (void __force_kernel *)____m(dst), len, isum, NULL, errp); } EXPORT_SYMBOL(csum_partial_copy_to_user); diff --git a/arch/x86/lib/getuser.S b/arch/x86/lib/getuser.S -index 51f1504..ddac4c1 100644 +index a451235..79fb5cf 100644 --- a/arch/x86/lib/getuser.S +++ b/arch/x86/lib/getuser.S -@@ -33,15 +33,38 @@ - #include <asm/asm-offsets.h> +@@ -33,17 +33,40 @@ #include <asm/thread_info.h> #include <asm/asm.h> + #include <asm/smap.h> +#include <asm/segment.h> +#include <asm/pgtable.h> +#include <asm/alternative-asm.h> @@ -21917,10 +25342,11 @@ index 51f1504..ddac4c1 100644 GET_THREAD_INFO(%_ASM_DX) cmp TI_addr_limit(%_ASM_DX),%_ASM_AX jae bad_get_user --1: movzb (%_ASM_AX),%edx + ASM_STAC +-1: movzbl (%_ASM_AX),%edx + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ mov $PAX_USER_SHADOW_BASE,%_ASM_DX ++ mov pax_user_shadow_base,%_ASM_DX + cmp %_ASM_DX,%_ASM_AX + jae 1234f + add %_ASM_DX,%_ASM_AX @@ -21929,13 +25355,14 @@ index 51f1504..ddac4c1 100644 + +#endif + -+1: __copyuser_seg movzb (%_ASM_AX),%edx ++1: __copyuser_seg movzbl (%_ASM_AX),%edx xor %eax,%eax + ASM_CLAC + pax_force_retaddr ret CFI_ENDPROC ENDPROC(__get_user_1) -@@ -49,12 +72,26 @@ ENDPROC(__get_user_1) +@@ -51,14 +74,28 @@ ENDPROC(__get_user_1) ENTRY(__get_user_2) CFI_STARTPROC add $1,%_ASM_AX @@ -21945,10 +25372,11 @@ index 51f1504..ddac4c1 100644 GET_THREAD_INFO(%_ASM_DX) cmp TI_addr_limit(%_ASM_DX),%_ASM_AX jae bad_get_user + ASM_STAC -2: movzwl -1(%_ASM_AX),%edx + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ mov $PAX_USER_SHADOW_BASE,%_ASM_DX ++ mov pax_user_shadow_base,%_ASM_DX + cmp %_ASM_DX,%_ASM_AX + jae 1234f + add %_ASM_DX,%_ASM_AX @@ -21959,11 +25387,12 @@ index 51f1504..ddac4c1 100644 + +2: __copyuser_seg movzwl -1(%_ASM_AX),%edx xor %eax,%eax + ASM_CLAC + pax_force_retaddr ret CFI_ENDPROC ENDPROC(__get_user_2) -@@ -62,12 +99,26 @@ ENDPROC(__get_user_2) +@@ -66,14 +103,28 @@ ENDPROC(__get_user_2) ENTRY(__get_user_4) CFI_STARTPROC add $3,%_ASM_AX @@ -21973,10 +25402,11 @@ index 51f1504..ddac4c1 100644 GET_THREAD_INFO(%_ASM_DX) cmp TI_addr_limit(%_ASM_DX),%_ASM_AX jae bad_get_user --3: mov -3(%_ASM_AX),%edx + ASM_STAC +-3: movl -3(%_ASM_AX),%edx + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ mov $PAX_USER_SHADOW_BASE,%_ASM_DX ++ mov pax_user_shadow_base,%_ASM_DX + cmp %_ASM_DX,%_ASM_AX + jae 1234f + add %_ASM_DX,%_ASM_AX @@ -21985,56 +25415,74 @@ index 51f1504..ddac4c1 100644 + +#endif + -+3: __copyuser_seg mov -3(%_ASM_AX),%edx ++3: __copyuser_seg movl -3(%_ASM_AX),%edx xor %eax,%eax + ASM_CLAC + pax_force_retaddr ret CFI_ENDPROC ENDPROC(__get_user_4) -@@ -80,8 +131,18 @@ ENTRY(__get_user_8) +@@ -86,10 +137,20 @@ ENTRY(__get_user_8) GET_THREAD_INFO(%_ASM_DX) cmp TI_addr_limit(%_ASM_DX),%_ASM_AX - jae bad_get_user + jae bad_get_user + +#ifdef CONFIG_PAX_MEMORY_UDEREF -+ mov $PAX_USER_SHADOW_BASE,%_ASM_DX ++ mov pax_user_shadow_base,%_ASM_DX + cmp %_ASM_DX,%_ASM_AX + jae 1234f + add %_ASM_DX,%_ASM_AX +1234: +#endif + - 4: movq -7(%_ASM_AX),%_ASM_DX + ASM_STAC + 4: movq -7(%_ASM_AX),%rdx + xor %eax,%eax + ASM_CLAC ++ pax_force_retaddr + ret + #else + add $7,%_ASM_AX +@@ -102,6 +163,7 @@ ENTRY(__get_user_8) + 5: movl -3(%_ASM_AX),%ecx xor %eax,%eax + ASM_CLAC + pax_force_retaddr ret + #endif CFI_ENDPROC - ENDPROC(__get_user_8) -@@ -91,6 +152,7 @@ bad_get_user: - CFI_STARTPROC +@@ -113,6 +175,7 @@ bad_get_user: xor %edx,%edx mov $(-EFAULT),%_ASM_AX + ASM_CLAC + pax_force_retaddr ret CFI_ENDPROC END(bad_get_user) +@@ -124,6 +187,7 @@ bad_get_user_8: + xor %ecx,%ecx + mov $(-EFAULT),%_ASM_AX + ASM_CLAC ++ pax_force_retaddr + ret + CFI_ENDPROC + END(bad_get_user_8) diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c -index b1e6c4b..21ae8fc 100644 +index 54fcffe..7be149e 100644 --- a/arch/x86/lib/insn.c +++ b/arch/x86/lib/insn.c -@@ -21,6 +21,11 @@ +@@ -20,8 +20,10 @@ + + #ifdef __KERNEL__ #include <linux/string.h> - #include <asm/inat.h> - #include <asm/insn.h> -+#ifdef __KERNEL__ +#include <asm/pgtable_types.h> -+#else + #else + #include <string.h> +#define ktla_ktva(addr) addr -+#endif - - /* Verify next sizeof(t) bytes can be on the same instruction */ - #define validate_next(t, insn, n) \ -@@ -49,8 +54,8 @@ + #endif + #include <asm/inat.h> + #include <asm/insn.h> +@@ -53,8 +55,8 @@ void insn_init(struct insn *insn, const void *kaddr, int x86_64) { memset(insn, 0, sizeof(*insn)); @@ -22647,7 +26095,7 @@ index c9f2d9b..e7fd2c0 100644 from += 64; to += 64; diff --git a/arch/x86/lib/msr-reg.S b/arch/x86/lib/msr-reg.S -index 69fa106..adda88b 100644 +index f6d13ee..aca5f0b 100644 --- a/arch/x86/lib/msr-reg.S +++ b/arch/x86/lib/msr-reg.S @@ -3,6 +3,7 @@ @@ -22658,7 +26106,7 @@ index 69fa106..adda88b 100644 #ifdef CONFIG_X86_64 /* -@@ -16,7 +17,7 @@ ENTRY(native_\op\()_safe_regs) +@@ -16,7 +17,7 @@ ENTRY(\op\()_safe_regs) CFI_STARTPROC pushq_cfi %rbx pushq_cfi %rbp @@ -22667,7 +26115,7 @@ index 69fa106..adda88b 100644 xorl %r11d, %r11d /* Return value */ movl (%rdi), %eax movl 4(%rdi), %ecx -@@ -27,16 +28,17 @@ ENTRY(native_\op\()_safe_regs) +@@ -27,16 +28,17 @@ ENTRY(\op\()_safe_regs) movl 28(%rdi), %edi CFI_REMEMBER_STATE 1: \op @@ -22693,13 +26141,13 @@ index 69fa106..adda88b 100644 3: CFI_RESTORE_STATE diff --git a/arch/x86/lib/putuser.S b/arch/x86/lib/putuser.S -index 36b0d15..d381858 100644 +index fc6ba17..d4d989d 100644 --- a/arch/x86/lib/putuser.S +++ b/arch/x86/lib/putuser.S -@@ -15,7 +15,9 @@ - #include <asm/thread_info.h> +@@ -16,7 +16,9 @@ #include <asm/errno.h> #include <asm/asm.h> + #include <asm/smap.h> - +#include <asm/segment.h> +#include <asm/pgtable.h> @@ -22707,15 +26155,18 @@ index 36b0d15..d381858 100644 /* * __put_user_X -@@ -29,52 +31,119 @@ +@@ -30,57 +32,125 @@ * as they get called from within inline assembly. */ -#define ENTER CFI_STARTPROC ; \ - GET_THREAD_INFO(%_ASM_BX) --#define EXIT ret ; \ +-#define EXIT ASM_CLAC ; \ +- ret ; \ +#define ENTER CFI_STARTPROC -+#define EXIT pax_force_retaddr; ret ; \ ++#define EXIT ASM_CLAC ; \ ++ pax_force_retaddr ; \ ++ ret ; \ CFI_ENDPROC +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) @@ -22738,10 +26189,11 @@ index 36b0d15..d381858 100644 + GET_THREAD_INFO(%_ASM_BX) cmp TI_addr_limit(%_ASM_BX),%_ASM_CX jae bad_put_user + ASM_STAC -1: movb %al,(%_ASM_CX) + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ mov $PAX_USER_SHADOW_BASE,%_ASM_BX ++ mov pax_user_shadow_base,%_ASM_BX + cmp %_ASM_BX,%_ASM_CX + jb 1234f + xor %ebx,%ebx @@ -22764,10 +26216,11 @@ index 36b0d15..d381858 100644 sub $1,%_ASM_BX cmp %_ASM_BX,%_ASM_CX jae bad_put_user + ASM_STAC -2: movw %ax,(%_ASM_CX) + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ mov $PAX_USER_SHADOW_BASE,%_ASM_BX ++ mov pax_user_shadow_base,%_ASM_BX + cmp %_ASM_BX,%_ASM_CX + jb 1234f + xor %ebx,%ebx @@ -22790,10 +26243,11 @@ index 36b0d15..d381858 100644 sub $3,%_ASM_BX cmp %_ASM_BX,%_ASM_CX jae bad_put_user + ASM_STAC -3: movl %eax,(%_ASM_CX) + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ mov $PAX_USER_SHADOW_BASE,%_ASM_BX ++ mov pax_user_shadow_base,%_ASM_BX + cmp %_ASM_BX,%_ASM_CX + jb 1234f + xor %ebx,%ebx @@ -22816,10 +26270,11 @@ index 36b0d15..d381858 100644 sub $7,%_ASM_BX cmp %_ASM_BX,%_ASM_CX jae bad_put_user + ASM_STAC -4: mov %_ASM_AX,(%_ASM_CX) + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ mov $PAX_USER_SHADOW_BASE,%_ASM_BX ++ mov pax_user_shadow_base,%_ASM_BX + cmp %_ASM_BX,%_ASM_CX + jb 1234f + xor %ebx,%ebx @@ -22967,39 +26422,24 @@ index a63efd6..ccecad8 100644 ret CFI_ENDPROC diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c -index ef2a6a5..dc7f3dd 100644 +index f0312d7..9c39d63 100644 --- a/arch/x86/lib/usercopy_32.c +++ b/arch/x86/lib/usercopy_32.c -@@ -41,10 +41,12 @@ do { \ +@@ -42,11 +42,13 @@ do { \ int __d0; \ might_fault(); \ __asm__ __volatile__( \ + __COPYUSER_SET_ES \ + ASM_STAC "\n" \ "0: rep; stosl\n" \ " movl %2,%0\n" \ "1: rep; stosb\n" \ - "2:\n" \ + "2: " ASM_CLAC "\n" \ + __COPYUSER_RESTORE_ES \ ".section .fixup,\"ax\"\n" \ "3: lea 0(%2,%0,4),%0\n" \ " jmp 2b\n" \ -@@ -113,6 +115,7 @@ long strnlen_user(const char __user *s, long n) - might_fault(); - - __asm__ __volatile__( -+ __COPYUSER_SET_ES - " testl %0, %0\n" - " jz 3f\n" - " andl %0,%%ecx\n" -@@ -121,6 +124,7 @@ long strnlen_user(const char __user *s, long n) - " subl %%ecx,%0\n" - " addl %0,%%eax\n" - "1:\n" -+ __COPYUSER_RESTORE_ES - ".section .fixup,\"ax\"\n" - "2: xorl %%eax,%%eax\n" - " jmp 1b\n" -@@ -140,7 +144,7 @@ EXPORT_SYMBOL(strnlen_user); +@@ -98,7 +100,7 @@ EXPORT_SYMBOL(__clear_user); #ifdef CONFIG_X86_INTEL_USERCOPY static unsigned long @@ -23008,7 +26448,7 @@ index ef2a6a5..dc7f3dd 100644 { int d0, d1; __asm__ __volatile__( -@@ -152,36 +156,36 @@ __copy_user_intel(void __user *to, const void *from, unsigned long size) +@@ -110,36 +112,36 @@ __copy_user_intel(void __user *to, const void *from, unsigned long size) " .align 2,0x90\n" "3: movl 0(%4), %%eax\n" "4: movl 4(%4), %%edx\n" @@ -23061,7 +26501,7 @@ index ef2a6a5..dc7f3dd 100644 " addl $-64, %0\n" " addl $64, %4\n" " addl $64, %3\n" -@@ -191,10 +195,12 @@ __copy_user_intel(void __user *to, const void *from, unsigned long size) +@@ -149,10 +151,12 @@ __copy_user_intel(void __user *to, const void *from, unsigned long size) " shrl $2, %0\n" " andl $3, %%eax\n" " cld\n" @@ -23074,7 +26514,7 @@ index ef2a6a5..dc7f3dd 100644 ".section .fixup,\"ax\"\n" "101: lea 0(%%eax,%0,4),%0\n" " jmp 100b\n" -@@ -247,46 +253,153 @@ __copy_user_intel(void __user *to, const void *from, unsigned long size) +@@ -202,46 +206,150 @@ __copy_user_intel(void __user *to, const void *from, unsigned long size) } static unsigned long @@ -23137,47 +26577,44 @@ index ef2a6a5..dc7f3dd 100644 + "101: lea 0(%%eax,%0,4),%0\n" + " jmp 100b\n" + ".previous\n" -+ ".section __ex_table,\"a\"\n" -+ " .align 4\n" -+ " .long 1b,100b\n" -+ " .long 2b,100b\n" -+ " .long 3b,100b\n" -+ " .long 4b,100b\n" -+ " .long 5b,100b\n" -+ " .long 6b,100b\n" -+ " .long 7b,100b\n" -+ " .long 8b,100b\n" -+ " .long 9b,100b\n" -+ " .long 10b,100b\n" -+ " .long 11b,100b\n" -+ " .long 12b,100b\n" -+ " .long 13b,100b\n" -+ " .long 14b,100b\n" -+ " .long 15b,100b\n" -+ " .long 16b,100b\n" -+ " .long 17b,100b\n" -+ " .long 18b,100b\n" -+ " .long 19b,100b\n" -+ " .long 20b,100b\n" -+ " .long 21b,100b\n" -+ " .long 22b,100b\n" -+ " .long 23b,100b\n" -+ " .long 24b,100b\n" -+ " .long 25b,100b\n" -+ " .long 26b,100b\n" -+ " .long 27b,100b\n" -+ " .long 28b,100b\n" -+ " .long 29b,100b\n" -+ " .long 30b,100b\n" -+ " .long 31b,100b\n" -+ " .long 32b,100b\n" -+ " .long 33b,100b\n" -+ " .long 34b,100b\n" -+ " .long 35b,100b\n" -+ " .long 36b,100b\n" -+ " .long 37b,100b\n" -+ " .long 99b,101b\n" -+ ".previous" ++ _ASM_EXTABLE(1b,100b) ++ _ASM_EXTABLE(2b,100b) ++ _ASM_EXTABLE(3b,100b) ++ _ASM_EXTABLE(4b,100b) ++ _ASM_EXTABLE(5b,100b) ++ _ASM_EXTABLE(6b,100b) ++ _ASM_EXTABLE(7b,100b) ++ _ASM_EXTABLE(8b,100b) ++ _ASM_EXTABLE(9b,100b) ++ _ASM_EXTABLE(10b,100b) ++ _ASM_EXTABLE(11b,100b) ++ _ASM_EXTABLE(12b,100b) ++ _ASM_EXTABLE(13b,100b) ++ _ASM_EXTABLE(14b,100b) ++ _ASM_EXTABLE(15b,100b) ++ _ASM_EXTABLE(16b,100b) ++ _ASM_EXTABLE(17b,100b) ++ _ASM_EXTABLE(18b,100b) ++ _ASM_EXTABLE(19b,100b) ++ _ASM_EXTABLE(20b,100b) ++ _ASM_EXTABLE(21b,100b) ++ _ASM_EXTABLE(22b,100b) ++ _ASM_EXTABLE(23b,100b) ++ _ASM_EXTABLE(24b,100b) ++ _ASM_EXTABLE(25b,100b) ++ _ASM_EXTABLE(26b,100b) ++ _ASM_EXTABLE(27b,100b) ++ _ASM_EXTABLE(28b,100b) ++ _ASM_EXTABLE(29b,100b) ++ _ASM_EXTABLE(30b,100b) ++ _ASM_EXTABLE(31b,100b) ++ _ASM_EXTABLE(32b,100b) ++ _ASM_EXTABLE(33b,100b) ++ _ASM_EXTABLE(34b,100b) ++ _ASM_EXTABLE(35b,100b) ++ _ASM_EXTABLE(36b,100b) ++ _ASM_EXTABLE(37b,100b) ++ _ASM_EXTABLE(99b,101b) + : "=&c"(size), "=&D" (d0), "=&S" (d1) + : "1"(to), "2"(from), "0"(size) + : "eax", "edx", "memory"); @@ -23246,7 +26683,7 @@ index ef2a6a5..dc7f3dd 100644 " movl %%eax, 56(%3)\n" " movl %%edx, 60(%3)\n" " addl $-64, %0\n" -@@ -298,9 +411,9 @@ __copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size) +@@ -253,9 +361,9 @@ __copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size) " shrl $2, %0\n" " andl $3, %%eax\n" " cld\n" @@ -23258,7 +26695,7 @@ index ef2a6a5..dc7f3dd 100644 "8:\n" ".section .fixup,\"ax\"\n" "9: lea 0(%%eax,%0,4),%0\n" -@@ -346,48 +459,48 @@ __copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size) +@@ -298,48 +406,48 @@ __copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size) * hyoshiok@miraclelinux.com */ @@ -23326,7 +26763,7 @@ index ef2a6a5..dc7f3dd 100644 " movnti %%eax, 56(%3)\n" " movnti %%edx, 60(%3)\n" " addl $-64, %0\n" -@@ -400,9 +513,9 @@ static unsigned long __copy_user_zeroing_intel_nocache(void *to, +@@ -352,9 +460,9 @@ static unsigned long __copy_user_zeroing_intel_nocache(void *to, " shrl $2, %0\n" " andl $3, %%eax\n" " cld\n" @@ -23338,7 +26775,7 @@ index ef2a6a5..dc7f3dd 100644 "8:\n" ".section .fixup,\"ax\"\n" "9: lea 0(%%eax,%0,4),%0\n" -@@ -443,48 +556,48 @@ static unsigned long __copy_user_zeroing_intel_nocache(void *to, +@@ -392,48 +500,48 @@ static unsigned long __copy_user_zeroing_intel_nocache(void *to, return size; } @@ -23406,7 +26843,7 @@ index ef2a6a5..dc7f3dd 100644 " movnti %%eax, 56(%3)\n" " movnti %%edx, 60(%3)\n" " addl $-64, %0\n" -@@ -497,9 +610,9 @@ static unsigned long __copy_user_intel_nocache(void *to, +@@ -446,9 +554,9 @@ static unsigned long __copy_user_intel_nocache(void *to, " shrl $2, %0\n" " andl $3, %%eax\n" " cld\n" @@ -23418,7 +26855,7 @@ index ef2a6a5..dc7f3dd 100644 "8:\n" ".section .fixup,\"ax\"\n" "9: lea 0(%%eax,%0,4),%0\n" -@@ -542,32 +655,36 @@ static unsigned long __copy_user_intel_nocache(void *to, +@@ -488,32 +596,36 @@ static unsigned long __copy_user_intel_nocache(void *to, */ unsigned long __copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size); @@ -23460,7 +26897,7 @@ index ef2a6a5..dc7f3dd 100644 ".section .fixup,\"ax\"\n" \ "5: addl %3,%0\n" \ " jmp 2b\n" \ -@@ -595,14 +712,14 @@ do { \ +@@ -538,14 +650,14 @@ do { \ " negl %0\n" \ " andl $7,%0\n" \ " subl %0,%3\n" \ @@ -23478,21 +26915,21 @@ index ef2a6a5..dc7f3dd 100644 "2:\n" \ ".section .fixup,\"ax\"\n" \ "5: addl %3,%0\n" \ -@@ -688,9 +805,9 @@ survive: - } - #endif +@@ -572,9 +684,9 @@ unsigned long __copy_to_user_ll(void __user *to, const void *from, + { + stac(); if (movsl_is_ok(to, from, n)) - __copy_user(to, from, n); + __copy_user(to, from, n, "", __COPYUSER_SET_ES, __COPYUSER_RESTORE_ES); else - n = __copy_user_intel(to, from, n); + n = __generic_copy_to_user_intel(to, from, n); + clac(); return n; } - EXPORT_SYMBOL(__copy_to_user_ll); -@@ -710,10 +827,9 @@ unsigned long __copy_from_user_ll_nozero(void *to, const void __user *from, - unsigned long n) +@@ -598,10 +710,9 @@ unsigned long __copy_from_user_ll_nozero(void *to, const void __user *from, { + stac(); if (movsl_is_ok(to, from, n)) - __copy_user(to, from, n); + __copy_user(to, from, n, __copyuser_seg, "", ""); @@ -23500,10 +26937,10 @@ index ef2a6a5..dc7f3dd 100644 - n = __copy_user_intel((void __user *)to, - (const void *)from, n); + n = __generic_copy_from_user_intel(to, from, n); + clac(); return n; } - EXPORT_SYMBOL(__copy_from_user_ll_nozero); -@@ -740,65 +856,50 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr +@@ -632,66 +743,51 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr if (n > 64 && cpu_has_xmm2) n = __copy_user_intel_nocache(to, from, n); else @@ -23513,6 +26950,7 @@ index ef2a6a5..dc7f3dd 100644 - __copy_user(to, from, n); + __copy_user(to, from, n, __copyuser_seg, "", ""); #endif + clac(); return n; } EXPORT_SYMBOL(__copy_from_user_ll_nocache_nozero); @@ -23532,16 +26970,13 @@ index ef2a6a5..dc7f3dd 100644 - */ -unsigned long -copy_to_user(void __user *to, const void *from, unsigned long n) -+void copy_from_user_overflow(void) - { +-{ - if (access_ok(VERIFY_WRITE, to, n)) - n = __copy_to_user(to, from, n); - return n; -+ WARN(1, "Buffer overflow detected!\n"); - } +-} -EXPORT_SYMBOL(copy_to_user); -+EXPORT_SYMBOL(copy_from_user_overflow); - +- -/** - * copy_from_user: - Copy a block of data from user space. - * @to: Destination address, in kernel space. @@ -23560,23 +26995,30 @@ index ef2a6a5..dc7f3dd 100644 - */ -unsigned long -_copy_from_user(void *to, const void __user *from, unsigned long n) -+void copy_to_user_overflow(void) - { +-{ - if (access_ok(VERIFY_READ, from, n)) - n = __copy_from_user(to, from, n); - else - memset(to, 0, n); - return n; -+ WARN(1, "Buffer overflow detected!\n"); - } +-} -EXPORT_SYMBOL(_copy_from_user); +- + void copy_from_user_overflow(void) + { + WARN(1, "Buffer overflow detected!\n"); + } + EXPORT_SYMBOL(copy_from_user_overflow); ++ ++void copy_to_user_overflow(void) ++{ ++ WARN(1, "Buffer overflow detected!\n"); ++} +EXPORT_SYMBOL(copy_to_user_overflow); - --void copy_from_user_overflow(void) ++ +#ifdef CONFIG_PAX_MEMORY_UDEREF +void __set_fs(mm_segment_t x) - { -- WARN(1, "Buffer overflow detected!\n"); ++{ + switch (x.seg) { + case 0: + loadsegment(gs, 0); @@ -23591,8 +27033,7 @@ index ef2a6a5..dc7f3dd 100644 + BUG(); + } + return; - } --EXPORT_SYMBOL(copy_from_user_overflow); ++} +EXPORT_SYMBOL(__set_fs); + +void set_fs(mm_segment_t x) @@ -23603,25 +27044,21 @@ index ef2a6a5..dc7f3dd 100644 +EXPORT_SYMBOL(set_fs); +#endif diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c -index 0d0326f..6a6155b 100644 +index 906fea3..ee8a097 100644 --- a/arch/x86/lib/usercopy_64.c +++ b/arch/x86/lib/usercopy_64.c -@@ -16,6 +16,12 @@ unsigned long __clear_user(void __user *addr, unsigned long size) - { - long __d0; - might_fault(); -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)addr < PAX_USER_SHADOW_BASE) -+ addr += PAX_USER_SHADOW_BASE; -+#endif -+ - /* no memory constraint because it doesn't change any memory gcc knows - about */ - asm volatile( -@@ -100,12 +106,20 @@ long strlen_user(const char __user *s) +@@ -39,7 +39,7 @@ unsigned long __clear_user(void __user *addr, unsigned long size) + _ASM_EXTABLE(0b,3b) + _ASM_EXTABLE(1b,2b) + : [size8] "=&c"(size), [dst] "=&D" (__d0) +- : [size1] "r"(size & 7), "[size8]" (size / 8), "[dst]"(addr), ++ : [size1] "r"(size & 7), "[size8]" (size / 8), "[dst]"(____m(addr)), + [zero] "r" (0UL), [eight] "r" (8UL)); + clac(); + return size; +@@ -54,12 +54,11 @@ unsigned long clear_user(void __user *to, unsigned long n) } - EXPORT_SYMBOL(strlen_user); + EXPORT_SYMBOL(clear_user); -unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len) +unsigned long copy_in_user(void __user *to, const void __user *from, unsigned long len) @@ -23630,22 +27067,13 @@ index 0d0326f..6a6155b 100644 - return copy_user_generic((__force void *)to, (__force void *)from, len); - } - return len; -+ if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) { -+ -+#ifdef CONFIG_PAX_MEMORY_UDEREF -+ if ((unsigned long)to < PAX_USER_SHADOW_BASE) -+ to += PAX_USER_SHADOW_BASE; -+ if ((unsigned long)from < PAX_USER_SHADOW_BASE) -+ from += PAX_USER_SHADOW_BASE; -+#endif -+ -+ return copy_user_generic((void __force_kernel *)to, (void __force_kernel *)from, len); -+ } ++ if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) ++ return copy_user_generic((void __force_kernel *)____m(to), (void __force_kernel *)____m(from), len); + return len; } EXPORT_SYMBOL(copy_in_user); -@@ -115,7 +129,7 @@ EXPORT_SYMBOL(copy_in_user); +@@ -69,7 +68,7 @@ EXPORT_SYMBOL(copy_in_user); * it is not necessary to optimize tail handling. */ unsigned long @@ -23654,8 +27082,8 @@ index 0d0326f..6a6155b 100644 { char c; unsigned zero_len; -@@ -132,3 +146,15 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest) - break; +@@ -87,3 +86,15 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest) + clac(); return len; } + @@ -23671,11 +27099,38 @@ index 0d0326f..6a6155b 100644 +} +EXPORT_SYMBOL(copy_to_user_overflow); diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c -index 1fb85db..8b3540b 100644 +index 903ec1e..c4166b2 100644 --- a/arch/x86/mm/extable.c +++ b/arch/x86/mm/extable.c -@@ -8,7 +8,7 @@ int fixup_exception(struct pt_regs *regs) - const struct exception_table_entry *fixup; +@@ -6,12 +6,24 @@ + static inline unsigned long + ex_insn_addr(const struct exception_table_entry *x) + { +- return (unsigned long)&x->insn + x->insn; ++ unsigned long reloc = 0; ++ ++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) ++ reloc = ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR; ++#endif ++ ++ return (unsigned long)&x->insn + x->insn + reloc; + } + static inline unsigned long + ex_fixup_addr(const struct exception_table_entry *x) + { +- return (unsigned long)&x->fixup + x->fixup; ++ unsigned long reloc = 0; ++ ++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) ++ reloc = ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR; ++#endif ++ ++ return (unsigned long)&x->fixup + x->fixup + reloc; + } + + int fixup_exception(struct pt_regs *regs) +@@ -20,7 +32,7 @@ int fixup_exception(struct pt_regs *regs) + unsigned long new_ip; #ifdef CONFIG_PNPBIOS - if (unlikely(SEGMENT_IS_PNP_CODE(regs->cs))) { @@ -23683,11 +27138,25 @@ index 1fb85db..8b3540b 100644 extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp; extern u32 pnp_bios_is_utter_crap; pnp_bios_is_utter_crap = 1; +@@ -145,6 +157,13 @@ void sort_extable(struct exception_table_entry *start, + i += 4; + p->fixup -= i; + i += 4; ++ ++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) ++ BUILD_BUG_ON(!IS_ENABLED(CONFIG_BUILDTIME_EXTABLE_SORT)); ++ p->insn -= ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR; ++ p->fixup -= ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR; ++#endif ++ + } + } + diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c -index 3ecfd1a..304d554 100644 +index 0e88336..2bb9777 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c -@@ -13,11 +13,18 @@ +@@ -13,12 +13,19 @@ #include <linux/perf_event.h> /* perf_sw_event */ #include <linux/hugetlb.h> /* hstate_index_to_shift */ #include <linux/prefetch.h> /* prefetchw */ @@ -23698,6 +27167,7 @@ index 3ecfd1a..304d554 100644 #include <asm/pgalloc.h> /* pgd_*(), ... */ #include <asm/kmemcheck.h> /* kmemcheck_*(), ... */ #include <asm/fixmap.h> /* VSYSCALL_START */ + #include <asm/context_tracking.h> /* exception_enter(), ... */ +#include <asm/tlbflush.h> + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) @@ -23706,7 +27176,7 @@ index 3ecfd1a..304d554 100644 /* * Page fault error code bits: -@@ -55,7 +62,7 @@ static inline int __kprobes notify_page_fault(struct pt_regs *regs) +@@ -56,7 +63,7 @@ static inline int __kprobes notify_page_fault(struct pt_regs *regs) int ret = 0; /* kprobe_running() needs smp_processor_id() */ @@ -23715,7 +27185,7 @@ index 3ecfd1a..304d554 100644 preempt_disable(); if (kprobe_running() && kprobe_fault_handler(regs, 14)) ret = 1; -@@ -116,7 +123,10 @@ check_prefetch_opcode(struct pt_regs *regs, unsigned char *instr, +@@ -117,7 +124,10 @@ check_prefetch_opcode(struct pt_regs *regs, unsigned char *instr, return !instr_lo || (instr_lo>>1) == 1; case 0x00: /* Prefetch instruction is 0x0F0D or 0x0F18 */ @@ -23727,7 +27197,7 @@ index 3ecfd1a..304d554 100644 return 0; *prefetch = (instr_lo == 0xF) && -@@ -150,7 +160,10 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr) +@@ -151,7 +161,10 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr) while (instr < max_instr) { unsigned char opcode; @@ -23739,7 +27209,7 @@ index 3ecfd1a..304d554 100644 break; instr++; -@@ -181,6 +194,34 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address, +@@ -182,6 +195,34 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address, force_sig_info(si_signo, &info, tsk); } @@ -23774,7 +27244,7 @@ index 3ecfd1a..304d554 100644 DEFINE_SPINLOCK(pgd_lock); LIST_HEAD(pgd_list); -@@ -231,10 +272,22 @@ void vmalloc_sync_all(void) +@@ -232,10 +273,22 @@ void vmalloc_sync_all(void) for (address = VMALLOC_START & PMD_MASK; address >= TASK_SIZE && address < FIXADDR_TOP; address += PMD_SIZE) { @@ -23793,15 +27263,16 @@ index 3ecfd1a..304d554 100644 + pmd_t *ret; +#else list_for_each_entry(page, &pgd_list, lru) { -+ pgd_t *pgd = page_address(page); ++ pgd_t *pgd; spinlock_t *pgt_lock; pmd_t *ret; -@@ -242,8 +295,13 @@ void vmalloc_sync_all(void) +@@ -243,8 +296,14 @@ void vmalloc_sync_all(void) pgt_lock = &pgd_page_get_mm(page)->page_table_lock; spin_lock(pgt_lock); - ret = vmalloc_sync_one(page_address(page), address); ++ pgd = page_address(page); +#endif + + ret = vmalloc_sync_one(pgd, address); @@ -23812,7 +27283,7 @@ index 3ecfd1a..304d554 100644 if (!ret) break; -@@ -277,6 +335,11 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) +@@ -278,6 +337,11 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) * an interrupt in the middle of a task switch.. */ pgd_paddr = read_cr3(); @@ -23824,7 +27295,7 @@ index 3ecfd1a..304d554 100644 pmd_k = vmalloc_sync_one(__va(pgd_paddr), address); if (!pmd_k) return -1; -@@ -372,7 +435,14 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) +@@ -373,7 +437,14 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) * happen within a race in page table update. In the later * case just flush: */ @@ -23839,7 +27310,7 @@ index 3ecfd1a..304d554 100644 pgd_ref = pgd_offset_k(address); if (pgd_none(*pgd_ref)) return -1; -@@ -540,7 +610,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address) +@@ -543,7 +614,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address) static int is_errata100(struct pt_regs *regs, unsigned long address) { #ifdef CONFIG_X86_64 @@ -23848,7 +27319,7 @@ index 3ecfd1a..304d554 100644 return 1; #endif return 0; -@@ -567,7 +637,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) +@@ -570,7 +641,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) } static const char nx_warning[] = KERN_CRIT @@ -23857,7 +27328,7 @@ index 3ecfd1a..304d554 100644 static void show_fault_oops(struct pt_regs *regs, unsigned long error_code, -@@ -576,15 +646,26 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, +@@ -579,15 +650,27 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, if (!oops_may_print()) return; @@ -23868,28 +27339,30 @@ index 3ecfd1a..304d554 100644 pte_t *pte = lookup_address(address, &level); if (pte && pte_present(*pte) && !pte_exec(*pte)) -- printk(nx_warning, current_uid()); -+ printk(nx_warning, current_uid(), current->comm, task_pid_nr(current)); +- printk(nx_warning, from_kuid(&init_user_ns, current_uid())); ++ printk(nx_warning, from_kuid_munged(&init_user_ns, current_uid()), current->comm, task_pid_nr(current)); } +#ifdef CONFIG_PAX_KERNEXEC + if (init_mm.start_code <= address && address < init_mm.end_code) { + if (current->signal->curr_ip) + printk(KERN_ERR "PAX: From %pI4: %s:%d, uid/euid: %u/%u, attempted to modify kernel code\n", -+ ¤t->signal->curr_ip, current->comm, task_pid_nr(current), current_uid(), current_euid()); ++ ¤t->signal->curr_ip, current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid())); + else -+ printk(KERN_ERR "PAX: %s:%d, uid/euid: %u/%u, attempted to modify kernel code\n", -+ current->comm, task_pid_nr(current), current_uid(), current_euid()); ++ printk(KERN_ERR "PAX: %s:%d, uid/euid: %u/%u, attempted to modify kernel code\n", current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid())); + } +#endif + printk(KERN_ALERT "BUG: unable to handle kernel "); if (address < PAGE_SIZE) printk(KERN_CONT "NULL pointer dereference"); -@@ -748,6 +829,21 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, +@@ -750,6 +833,22 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, + return; } #endif - ++ +#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC) + if (pax_is_fetch_fault(regs, error_code, address)) { + @@ -23905,10 +27378,10 @@ index 3ecfd1a..304d554 100644 + } +#endif + - if (unlikely(show_unhandled_signals)) - show_signal_msg(regs, error_code, address, tsk); - -@@ -844,7 +940,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, + /* Kernel addresses are always protection faults: */ + if (address >= TASK_SIZE) + error_code |= PF_PROT; +@@ -835,7 +934,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { printk(KERN_ERR "MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n", @@ -23917,7 +27390,7 @@ index 3ecfd1a..304d554 100644 code = BUS_MCEERR_AR; } #endif -@@ -900,6 +996,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte) +@@ -898,6 +997,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte) return 1; } @@ -24017,7 +27490,7 @@ index 3ecfd1a..304d554 100644 /* * Handle a spurious fault caused by a stale TLB entry. * -@@ -972,6 +1161,9 @@ int show_unhandled_signals = 1; +@@ -964,6 +1156,9 @@ int show_unhandled_signals = 1; static inline int access_error(unsigned long error_code, struct vm_area_struct *vma) { @@ -24027,7 +27500,16 @@ index 3ecfd1a..304d554 100644 if (error_code & PF_WRITE) { /* write, present and write, not present: */ if (unlikely(!(vma->vm_flags & VM_WRITE))) -@@ -1005,19 +1197,34 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code) +@@ -992,7 +1187,7 @@ static inline bool smap_violation(int error_code, struct pt_regs *regs) + if (error_code & PF_USER) + return false; + +- if (!user_mode_vm(regs) && (regs->flags & X86_EFLAGS_AC)) ++ if (!user_mode(regs) && (regs->flags & X86_EFLAGS_AC)) + return false; + + return true; +@@ -1008,18 +1203,33 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) { struct vm_area_struct *vma; struct task_struct *tsk; @@ -24038,35 +27520,35 @@ index 3ecfd1a..304d554 100644 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | (write ? FAULT_FLAG_WRITE : 0); -+ /* Get the faulting address: */ +- tsk = current; +- mm = tsk->mm; +- + /* Get the faulting address: */ +- address = read_cr2(); + unsigned long address = read_cr2(); + +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) -+ if (!user_mode(regs) && address < 2 * PAX_USER_SHADOW_BASE) { ++ if (!user_mode(regs) && address < 2 * pax_user_shadow_base) { + if (!search_exception_tables(regs->ip)) { + printk(KERN_ERR "PAX: please report this to pageexec@freemail.hu\n"); + bad_area_nosemaphore(regs, error_code, address); + return; + } -+ if (address < PAX_USER_SHADOW_BASE) { ++ if (address < pax_user_shadow_base) { + printk(KERN_ERR "PAX: please report this to pageexec@freemail.hu\n"); + printk(KERN_ERR "PAX: faulting IP: %pS\n", (void *)regs->ip); + show_trace_log_lvl(NULL, NULL, (void *)regs->sp, regs->bp, KERN_ERR); + } else -+ address -= PAX_USER_SHADOW_BASE; ++ address -= pax_user_shadow_base; + } +#endif + - tsk = current; - mm = tsk->mm; ++ tsk = current; ++ mm = tsk->mm; -- /* Get the faulting address: */ -- address = read_cr2(); -- /* * Detect and handle instructions that would cause a page fault for - * both a tracked kernel page and a userspace page. -@@ -1077,7 +1284,7 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code) +@@ -1080,7 +1290,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) * User-mode registers count as a user access even for any * potential system fault or CPU buglet: */ @@ -24075,7 +27557,7 @@ index 3ecfd1a..304d554 100644 local_irq_enable(); error_code |= PF_USER; } else { -@@ -1132,6 +1339,11 @@ retry: +@@ -1142,6 +1352,11 @@ retry: might_sleep(); } @@ -24087,7 +27569,7 @@ index 3ecfd1a..304d554 100644 vma = find_vma(mm, address); if (unlikely(!vma)) { bad_area(regs, error_code, address); -@@ -1143,18 +1355,24 @@ retry: +@@ -1153,18 +1368,24 @@ retry: bad_area(regs, error_code, address); return; } @@ -24123,9 +27605,9 @@ index 3ecfd1a..304d554 100644 if (unlikely(expand_stack(vma, address))) { bad_area(regs, error_code, address); return; -@@ -1209,3 +1427,292 @@ good_area: - - up_read(&mm->mmap_sem); +@@ -1228,3 +1449,292 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code) + __do_page_fault(regs, error_code); + exception_exit(regs); } + +#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC) @@ -24446,174 +27928,70 @@ index 6f31ee5..8ee4164 100644 return (void *)vaddr; diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c -index b91e485..d00e7c9 100644 +index ae1aa71..d9bea75 100644 --- a/arch/x86/mm/hugetlbpage.c +++ b/arch/x86/mm/hugetlbpage.c -@@ -277,13 +277,20 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file, +@@ -271,23 +271,30 @@ follow_huge_pud(struct mm_struct *mm, unsigned long address, + #ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA + static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file, + unsigned long addr, unsigned long len, +- unsigned long pgoff, unsigned long flags) ++ unsigned long pgoff, unsigned long flags, unsigned long offset) + { struct hstate *h = hstate_file(file); - struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; -- unsigned long start_addr; -+ unsigned long start_addr, pax_task_size = TASK_SIZE; + struct vm_unmapped_area_info info; +- ++ + info.flags = 0; + info.length = len; + info.low_limit = TASK_UNMAPPED_BASE; + -+#ifdef CONFIG_PAX_SEGMEXEC -+ if (mm->pax_flags & MF_PAX_SEGMEXEC) -+ pax_task_size = SEGMEXEC_TASK_SIZE; ++#ifdef CONFIG_PAX_RANDMMAP ++ if (current->mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += current->mm->delta_mmap; +#endif + -+ pax_task_size -= PAGE_SIZE; - - if (len > mm->cached_hole_size) { -- start_addr = mm->free_area_cache; -+ start_addr = mm->free_area_cache; - } else { -- start_addr = TASK_UNMAPPED_BASE; -- mm->cached_hole_size = 0; -+ start_addr = mm->mmap_base; -+ mm->cached_hole_size = 0; - } - - full_search: -@@ -291,26 +298,27 @@ full_search: - - for (vma = find_vma(mm, addr); ; vma = vma->vm_next) { - /* At this point: (!vma || addr < vma->vm_end). */ -- if (TASK_SIZE - len < addr) { -+ if (pax_task_size - len < addr) { - /* - * Start a new search - just in case we missed - * some holes. - */ -- if (start_addr != TASK_UNMAPPED_BASE) { -- start_addr = TASK_UNMAPPED_BASE; -+ if (start_addr != mm->mmap_base) { -+ start_addr = mm->mmap_base; - mm->cached_hole_size = 0; - goto full_search; - } - return -ENOMEM; - } -- if (!vma || addr + len <= vma->vm_start) { -- mm->free_area_cache = addr + len; -- return addr; -- } -+ if (check_heap_stack_gap(vma, addr, len)) -+ break; - if (addr + mm->cached_hole_size < vma->vm_start) - mm->cached_hole_size = vma->vm_start - addr; - addr = ALIGN(vma->vm_end, huge_page_size(h)); - } -+ -+ mm->free_area_cache = addr + len; -+ return addr; + info.high_limit = TASK_SIZE; + info.align_mask = PAGE_MASK & ~huge_page_mask(h); + info.align_offset = 0; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); } static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, -@@ -321,9 +329,8 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, - struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; - unsigned long base = mm->mmap_base; -- unsigned long addr = addr0; -+ unsigned long addr; - unsigned long largest_hole = mm->cached_hole_size; -- unsigned long start_addr; - - /* don't allow allocations above current base */ - if (mm->free_area_cache > base) -@@ -333,16 +340,15 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, - largest_hole = 0; - mm->free_area_cache = base; - } --try_again: -- start_addr = mm->free_area_cache; - - /* make sure it can fit in the remaining address space */ - if (mm->free_area_cache < len) - goto fail; - - /* either no address requested or can't fit in requested address hole */ -- addr = (mm->free_area_cache - len) & huge_page_mask(h); -+ addr = mm->free_area_cache - len; - do { -+ addr &= huge_page_mask(h); - /* - * Lookup failure means no vma is above this address, - * i.e. return with success: -@@ -351,10 +357,10 @@ try_again: - if (!vma) - return addr; - -- if (addr + len <= vma->vm_start) { -+ if (check_heap_stack_gap(vma, addr, len)) { - /* remember the address as a hint for next time */ -- mm->cached_hole_size = largest_hole; -- return (mm->free_area_cache = addr); -+ mm->cached_hole_size = largest_hole; -+ return (mm->free_area_cache = addr); - } else if (mm->free_area_cache == vma->vm_end) { - /* pull free_area_cache down to the first hole */ - mm->free_area_cache = vma->vm_start; -@@ -363,29 +369,34 @@ try_again: - - /* remember the largest hole we saw so far */ - if (addr + largest_hole < vma->vm_start) -- largest_hole = vma->vm_start - addr; -+ largest_hole = vma->vm_start - addr; - - /* try just below the current vma->vm_start */ -- addr = (vma->vm_start - len) & huge_page_mask(h); -- } while (len <= vma->vm_start); -+ addr = skip_heap_stack_gap(vma, len); -+ } while (!IS_ERR_VALUE(addr)); + unsigned long addr0, unsigned long len, +- unsigned long pgoff, unsigned long flags) ++ unsigned long pgoff, unsigned long flags, unsigned long offset) + { + struct hstate *h = hstate_file(file); + struct vm_unmapped_area_info info; +@@ -299,6 +306,7 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, + info.high_limit = current->mm->mmap_base; + info.align_mask = PAGE_MASK & ~huge_page_mask(h); + info.align_offset = 0; ++ info.threadstack_offset = offset; + addr = vm_unmapped_area(&info); - fail: /* -- * if hint left us with no space for the requested -- * mapping then try again: -- */ -- if (start_addr != base) { -- mm->free_area_cache = base; -- largest_hole = 0; -- goto try_again; -- } -- /* - * A failed mmap() very likely causes application failure, - * so fall back to the bottom-up function here. This scenario - * can happen with large stack limits and large mmap() - * allocations. - */ -- mm->free_area_cache = TASK_UNMAPPED_BASE; -+ -+#ifdef CONFIG_PAX_SEGMEXEC -+ if (mm->pax_flags & MF_PAX_SEGMEXEC) -+ mm->mmap_base = SEGMEXEC_TASK_UNMAPPED_BASE; -+ else -+#endif -+ -+ mm->mmap_base = TASK_UNMAPPED_BASE; +@@ -311,6 +319,12 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, + VM_BUG_ON(addr != -ENOMEM); + info.flags = 0; + info.low_limit = TASK_UNMAPPED_BASE; + +#ifdef CONFIG_PAX_RANDMMAP -+ if (mm->pax_flags & MF_PAX_RANDMMAP) -+ mm->mmap_base += mm->delta_mmap; ++ if (current->mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += current->mm->delta_mmap; +#endif + -+ mm->free_area_cache = mm->mmap_base; - mm->cached_hole_size = ~0UL; - addr = hugetlb_get_unmapped_area_bottomup(file, addr0, - len, pgoff, flags); -@@ -393,6 +404,7 @@ fail: - /* - * Restore the topdown base: - */ -+ mm->mmap_base = base; - mm->free_area_cache = base; - mm->cached_hole_size = ~0UL; - -@@ -406,10 +418,19 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, + info.high_limit = TASK_SIZE; + addr = vm_unmapped_area(&info); + } +@@ -325,10 +339,20 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, struct hstate *h = hstate_file(file); struct mm_struct *mm = current->mm; struct vm_area_struct *vma; + unsigned long pax_task_size = TASK_SIZE; ++ unsigned long offset = gr_rand_threadstack_offset(mm, file, flags); if (len & ~huge_page_mask(h)) return -EINVAL; @@ -24630,39 +28008,55 @@ index b91e485..d00e7c9 100644 return -ENOMEM; if (flags & MAP_FIXED) { -@@ -421,8 +442,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, +@@ -337,19 +361,22 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, + return addr; + } + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ if (addr) { addr = ALIGN(addr, huge_page_size(h)); vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -+ if (pax_task_size - len >= addr && check_heap_stack_gap(vma, addr, len)) ++ if (pax_task_size - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) return addr; } if (mm->get_unmapped_area == arch_get_unmapped_area) + return hugetlb_get_unmapped_area_bottomup(file, addr, len, +- pgoff, flags); ++ pgoff, flags, offset); + else + return hugetlb_get_unmapped_area_topdown(file, addr, len, +- pgoff, flags); ++ pgoff, flags, offset); + } + + #endif /*HAVE_ARCH_HUGETLB_UNMAPPED_AREA*/ diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c -index 4f0cec7..00976ce 100644 +index 59b7fc4..b1dd75f 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c -@@ -16,6 +16,8 @@ - #include <asm/tlb.h> +@@ -4,6 +4,7 @@ + #include <linux/swap.h> + #include <linux/memblock.h> + #include <linux/bootmem.h> /* for max_low_pfn */ ++#include <linux/tboot.h> + + #include <asm/cacheflush.h> + #include <asm/e820.h> +@@ -17,6 +18,8 @@ #include <asm/proto.h> #include <asm/dma.h> /* for MAX_DMA_PFN */ + #include <asm/microcode.h> +#include <asm/desc.h> +#include <asm/bios_ebda.h> - unsigned long __initdata pgt_buf_start; - unsigned long __meminitdata pgt_buf_end; -@@ -32,7 +34,7 @@ int direct_gbpages - static void __init find_early_table_space(unsigned long end, int use_pse, - int use_gbpages) - { -- unsigned long puds, pmds, ptes, tables, start = 0, good_end = end; -+ unsigned long puds, pmds, ptes, tables, start = 0x100000, good_end = end; - phys_addr_t base; + #include "mm_internal.h" - puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; -@@ -311,10 +313,37 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, +@@ -464,10 +467,40 @@ void __init init_mem_mapping(void) * Access has to be given to non-kernel-ram areas as well, these contain the PCI * mmio resources as well as potential bios/acpi data regions. */ @@ -24674,17 +28068,20 @@ index 4f0cec7..00976ce 100644 + int devmem_is_allowed(unsigned long pagenr) { -- if (pagenr <= 256) +- if (pagenr < 256) +#ifdef CONFIG_GRKERNSEC_KMEM + /* allow BDA */ + if (!pagenr) -+ return 1; + return 1; + /* allow EBDA */ + if (pagenr >= ebda_start && pagenr < ebda_end) + return 1; ++ /* if tboot is in use, allow access to its hardcoded serial log range */ ++ if (tboot_enabled() && ((0x60000 >> PAGE_SHIFT) <= pagenr) && (pagenr < (0x68000 >> PAGE_SHIFT))) ++ return 1; +#else + if (!pagenr) - return 1; ++ return 1; +#ifdef CONFIG_VM86 + if (pagenr < (ISA_START_ADDRESS >> PAGE_SHIFT)) + return 1; @@ -24701,7 +28098,7 @@ index 4f0cec7..00976ce 100644 if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) return 0; if (!page_is_ram(pagenr)) -@@ -371,8 +400,116 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) +@@ -524,8 +557,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) #endif } @@ -24755,6 +28152,7 @@ index 4f0cec7..00976ce 100644 + for (cpu = 0; cpu < nr_cpu_ids; cpu++) { + pack_descriptor(&d, get_desc_base(&get_cpu_gdt_table(cpu)[GDT_ENTRY_KERNEL_CS]), limit, 0x9B, 0xC); + write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_KERNEL_CS, &d, DESCTYPE_S); ++ write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_KERNEXEC_KERNEL_CS, &d, DESCTYPE_S); + } + + /* PaX: make KERNEL_CS read-only */ @@ -24819,11 +28217,11 @@ index 4f0cec7..00976ce 100644 (unsigned long)(&__init_begin), (unsigned long)(&__init_end)); diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c -index 575d86f..4987469 100644 +index 2d19001..6a1046c 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c -@@ -73,36 +73,6 @@ static __init void *alloc_low_page(void) - } +@@ -62,33 +62,6 @@ static noinline int do_test_wp_bit(void); + bool __read_mostly __vmalloc_start_set = false; /* - * Creates a middle page table and puts a pointer to it in the @@ -24837,10 +28235,7 @@ index 575d86f..4987469 100644 - -#ifdef CONFIG_X86_PAE - if (!(pgd_val(*pgd) & _PAGE_PRESENT)) { -- if (after_bootmem) -- pmd_table = (pmd_t *)alloc_bootmem_pages(PAGE_SIZE); -- else -- pmd_table = (pmd_t *)alloc_low_page(); +- pmd_table = (pmd_t *)alloc_low_page(); - paravirt_alloc_pmd(&init_mm, __pa(pmd_table) >> PAGE_SHIFT); - set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT)); - pud = pud_offset(pgd, 0); @@ -24859,8 +28254,8 @@ index 575d86f..4987469 100644 * Create a page table and place a pointer to it in a middle page * directory entry: */ -@@ -122,13 +92,28 @@ static pte_t * __init one_page_table_init(pmd_t *pmd) - page_table = (pte_t *)alloc_low_page(); +@@ -98,13 +71,28 @@ static pte_t * __init one_page_table_init(pmd_t *pmd) + pte_t *page_table = (pte_t *)alloc_low_page(); paravirt_alloc_pte(&init_mm, __pa(page_table) >> PAGE_SHIFT); +#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC) @@ -24888,15 +28283,15 @@ index 575d86f..4987469 100644 pmd_t * __init populate_extra_pmd(unsigned long vaddr) { int pgd_idx = pgd_index(vaddr); -@@ -202,6 +187,7 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base) +@@ -208,6 +196,7 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base) int pgd_idx, pmd_idx; unsigned long vaddr; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte = NULL; - -@@ -211,8 +197,13 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base) + unsigned long count = page_table_range_init_count(start, end); +@@ -222,8 +211,13 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base) pgd = pgd_base + pgd_idx; for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd++, pgd_idx++) { @@ -24912,7 +28307,7 @@ index 575d86f..4987469 100644 for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_idx++) { pte = page_table_kmap_check(one_page_table_init(pmd), -@@ -224,11 +215,20 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base) +@@ -235,11 +229,20 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base) } } @@ -24937,7 +28332,7 @@ index 575d86f..4987469 100644 } /* -@@ -245,9 +245,10 @@ kernel_physical_mapping_init(unsigned long start, +@@ -256,9 +259,10 @@ kernel_physical_mapping_init(unsigned long start, unsigned long last_map_addr = end; unsigned long start_pfn, end_pfn; pgd_t *pgd_base = swapper_pg_dir; @@ -24949,7 +28344,7 @@ index 575d86f..4987469 100644 pmd_t *pmd; pte_t *pte; unsigned pages_2m, pages_4k; -@@ -280,8 +281,13 @@ repeat: +@@ -291,8 +295,13 @@ repeat: pfn = start_pfn; pgd_idx = pgd_index((pfn<<PAGE_SHIFT) + PAGE_OFFSET); pgd = pgd_base + pgd_idx; @@ -24965,7 +28360,7 @@ index 575d86f..4987469 100644 if (pfn >= end_pfn) continue; -@@ -293,14 +299,13 @@ repeat: +@@ -304,14 +313,13 @@ repeat: #endif for (; pmd_idx < PTRS_PER_PMD && pfn < end_pfn; pmd++, pmd_idx++) { @@ -24981,10 +28376,10 @@ index 575d86f..4987469 100644 pgprot_t prot = PAGE_KERNEL_LARGE; /* * first pass will use the same initial -@@ -310,11 +315,7 @@ repeat: - __pgprot(PTE_IDENT_ATTR | +@@ -322,11 +330,7 @@ repeat: _PAGE_PSE); + pfn &= PMD_MASK >> PAGE_SHIFT; - addr2 = (pfn + PTRS_PER_PTE-1) * PAGE_SIZE + - PAGE_OFFSET + PAGE_SIZE-1; - @@ -24994,7 +28389,7 @@ index 575d86f..4987469 100644 prot = PAGE_KERNEL_LARGE_EXEC; pages_2m++; -@@ -331,7 +332,7 @@ repeat: +@@ -343,7 +347,7 @@ repeat: pte_ofs = pte_index((pfn<<PAGE_SHIFT) + PAGE_OFFSET); pte += pte_ofs; for (; pte_ofs < PTRS_PER_PTE && pfn < end_pfn; @@ -25003,7 +28398,7 @@ index 575d86f..4987469 100644 pgprot_t prot = PAGE_KERNEL; /* * first pass will use the same initial -@@ -339,7 +340,7 @@ repeat: +@@ -351,7 +355,7 @@ repeat: */ pgprot_t init_prot = __pgprot(PTE_IDENT_ATTR); @@ -25012,16 +28407,16 @@ index 575d86f..4987469 100644 prot = PAGE_KERNEL_EXEC; pages_4k++; -@@ -465,7 +466,7 @@ void __init native_pagetable_setup_start(pgd_t *base) +@@ -482,7 +486,7 @@ void __init native_pagetable_init(void) pud = pud_offset(pgd, va); pmd = pmd_offset(pud, va); - if (!pmd_present(*pmd)) -+ if (!pmd_present(*pmd) || pmd_huge(*pmd)) ++ if (!pmd_present(*pmd)) // PAX TODO || pmd_large(*pmd)) break; - pte = pte_offset_kernel(pmd, va); -@@ -517,12 +518,10 @@ void __init early_ioremap_page_table_range_init(void) + /* should not be large page here */ +@@ -540,12 +544,10 @@ void __init early_ioremap_page_table_range_init(void) static void __init pagetable_init(void) { @@ -25036,7 +28431,7 @@ index 575d86f..4987469 100644 EXPORT_SYMBOL_GPL(__supported_pte_mask); /* user-defined highmem size */ -@@ -734,6 +733,12 @@ void __init mem_init(void) +@@ -752,6 +754,12 @@ void __init mem_init(void) pci_iommu_alloc(); @@ -25049,8 +28444,8 @@ index 575d86f..4987469 100644 #ifdef CONFIG_FLATMEM BUG_ON(!mem_map); #endif -@@ -760,7 +765,7 @@ void __init mem_init(void) - reservedpages++; +@@ -780,7 +788,7 @@ void __init mem_init(void) + after_bootmem = 1; codesize = (unsigned long) &_etext - (unsigned long) &_text; - datasize = (unsigned long) &_edata - (unsigned long) &_etext; @@ -25058,7 +28453,7 @@ index 575d86f..4987469 100644 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, " -@@ -801,10 +806,10 @@ void __init mem_init(void) +@@ -821,10 +829,10 @@ void __init mem_init(void) ((unsigned long)&__init_end - (unsigned long)&__init_begin) >> 10, @@ -25072,7 +28467,7 @@ index 575d86f..4987469 100644 ((unsigned long)&_etext - (unsigned long)&_text) >> 10); /* -@@ -882,6 +887,7 @@ void set_kernel_text_rw(void) +@@ -914,6 +922,7 @@ void set_kernel_text_rw(void) if (!kernel_set_to_readonly) return; @@ -25080,7 +28475,7 @@ index 575d86f..4987469 100644 pr_debug("Set kernel text: %lx - %lx for read write\n", start, start+size); -@@ -896,6 +902,7 @@ void set_kernel_text_ro(void) +@@ -928,6 +937,7 @@ void set_kernel_text_ro(void) if (!kernel_set_to_readonly) return; @@ -25088,7 +28483,7 @@ index 575d86f..4987469 100644 pr_debug("Set kernel text: %lx - %lx for read only\n", start, start+size); -@@ -924,6 +931,7 @@ void mark_rodata_ro(void) +@@ -956,6 +966,7 @@ void mark_rodata_ro(void) unsigned long start = PFN_ALIGN(_text); unsigned long size = PFN_ALIGN(_etext) - start; @@ -25097,10 +28492,10 @@ index 575d86f..4987469 100644 printk(KERN_INFO "Write protecting the kernel text: %luk\n", size >> 10); diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c -index fc18be0..e539653 100644 +index 474e28f..647dd12 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c -@@ -74,7 +74,7 @@ early_param("gbpages", parse_direct_gbpages_on); +@@ -150,7 +150,7 @@ early_param("gbpages", parse_direct_gbpages_on); * around without checking the pgd every time. */ @@ -25109,7 +28504,7 @@ index fc18be0..e539653 100644 EXPORT_SYMBOL_GPL(__supported_pte_mask); int force_personality32; -@@ -107,12 +107,22 @@ void sync_global_pgds(unsigned long start, unsigned long end) +@@ -183,12 +183,22 @@ void sync_global_pgds(unsigned long start, unsigned long end) for (address = start; address <= end; address += PGDIR_SIZE) { const pgd_t *pgd_ref = pgd_offset_k(address); @@ -25132,7 +28527,7 @@ index fc18be0..e539653 100644 list_for_each_entry(page, &pgd_list, lru) { pgd_t *pgd; spinlock_t *pgt_lock; -@@ -121,6 +131,7 @@ void sync_global_pgds(unsigned long start, unsigned long end) +@@ -197,6 +207,7 @@ void sync_global_pgds(unsigned long start, unsigned long end) /* the pgt_lock only for Xen */ pgt_lock = &pgd_page_get_mm(page)->page_table_lock; spin_lock(pgt_lock); @@ -25140,7 +28535,7 @@ index fc18be0..e539653 100644 if (pgd_none(*pgd)) set_pgd(pgd, *pgd_ref); -@@ -128,7 +139,10 @@ void sync_global_pgds(unsigned long start, unsigned long end) +@@ -204,7 +215,10 @@ void sync_global_pgds(unsigned long start, unsigned long end) BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref)); @@ -25151,7 +28546,7 @@ index fc18be0..e539653 100644 } spin_unlock(&pgd_lock); } -@@ -161,7 +175,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr) +@@ -237,7 +251,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr) { if (pgd_none(*pgd)) { pud_t *pud = (pud_t *)spp_getpage(); @@ -25160,7 +28555,7 @@ index fc18be0..e539653 100644 if (pud != pud_offset(pgd, 0)) printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n", pud, pud_offset(pgd, 0)); -@@ -173,7 +187,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr) +@@ -249,7 +263,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr) { if (pud_none(*pud)) { pmd_t *pmd = (pmd_t *) spp_getpage(); @@ -25169,7 +28564,7 @@ index fc18be0..e539653 100644 if (pmd != pmd_offset(pud, 0)) printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n", pmd, pmd_offset(pud, 0)); -@@ -202,7 +216,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte) +@@ -278,7 +292,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte) pmd = fill_pmd(pud, vaddr); pte = fill_pte(pmd, vaddr); @@ -25179,7 +28574,7 @@ index fc18be0..e539653 100644 /* * It's enough to flush this one mapping. -@@ -261,14 +277,12 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size, +@@ -337,14 +353,12 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size, pgd = pgd_offset_k((unsigned long)__va(phys)); if (pgd_none(*pgd)) { pud = (pud_t *) spp_getpage(); @@ -25196,43 +28591,25 @@ index fc18be0..e539653 100644 } pmd = pmd_offset(pud, phys); BUG_ON(!pmd_none(*pmd)); -@@ -329,7 +343,7 @@ static __ref void *alloc_low_page(unsigned long *phys) - if (pfn >= pgt_buf_top) - panic("alloc_low_page: ran out of memory"); - -- adr = early_memremap(pfn * PAGE_SIZE, PAGE_SIZE); -+ adr = (void __force_kernel *)early_memremap(pfn * PAGE_SIZE, PAGE_SIZE); - clear_page(adr); - *phys = pfn * PAGE_SIZE; - return adr; -@@ -345,7 +359,7 @@ static __ref void *map_low_page(void *virt) - - phys = __pa(virt); - left = phys & (PAGE_SIZE - 1); -- adr = early_memremap(phys & PAGE_MASK, PAGE_SIZE); -+ adr = (void __force_kernel *)early_memremap(phys & PAGE_MASK, PAGE_SIZE); - adr = (void *)(((unsigned long)adr) | left); - - return adr; -@@ -545,7 +559,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end, - unmap_low_page(pmd); +@@ -585,7 +599,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end, + prot); spin_lock(&init_mm.page_table_lock); -- pud_populate(&init_mm, pud, __va(pmd_phys)); -+ pud_populate_kernel(&init_mm, pud, __va(pmd_phys)); +- pud_populate(&init_mm, pud, pmd); ++ pud_populate_kernel(&init_mm, pud, pmd); spin_unlock(&init_mm.page_table_lock); } __flush_tlb_all(); -@@ -591,7 +605,7 @@ kernel_physical_mapping_init(unsigned long start, - unmap_low_page(pud); +@@ -626,7 +640,7 @@ kernel_physical_mapping_init(unsigned long start, + page_size_mask); spin_lock(&init_mm.page_table_lock); -- pgd_populate(&init_mm, pgd, __va(pud_phys)); -+ pgd_populate_kernel(&init_mm, pgd, __va(pud_phys)); +- pgd_populate(&init_mm, pgd, pud); ++ pgd_populate_kernel(&init_mm, pgd, pud); spin_unlock(&init_mm.page_table_lock); pgd_changed = true; } -@@ -683,6 +697,12 @@ void __init mem_init(void) +@@ -1065,6 +1079,12 @@ void __init mem_init(void) pci_iommu_alloc(); @@ -25245,7 +28622,7 @@ index fc18be0..e539653 100644 /* clear_bss() already clear the empty_zero_page */ reservedpages = 0; -@@ -843,8 +863,8 @@ int kern_addr_valid(unsigned long addr) +@@ -1224,8 +1244,8 @@ int kern_addr_valid(unsigned long addr) static struct vm_area_struct gate_vma = { .vm_start = VSYSCALL_START, .vm_end = VSYSCALL_START + (VSYSCALL_MAPPED_PAGES * PAGE_SIZE), @@ -25256,7 +28633,7 @@ index fc18be0..e539653 100644 }; struct vm_area_struct *get_gate_vma(struct mm_struct *mm) -@@ -878,7 +898,7 @@ int in_gate_area_no_mm(unsigned long addr) +@@ -1259,7 +1279,7 @@ int in_gate_area_no_mm(unsigned long addr) const char *arch_vma_name(struct vm_area_struct *vma) { @@ -25266,7 +28643,7 @@ index fc18be0..e539653 100644 if (vma == &gate_vma) return "[vsyscall]"; diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c -index 7b179b4..6bd1777 100644 +index 7b179b4..6bd17777 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c @@ -64,7 +64,11 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot) @@ -25282,7 +28659,7 @@ index 7b179b4..6bd1777 100644 return (void *)vaddr; diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c -index be1ef57..55f0160 100644 +index 78fe3f1..73b95e2 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -97,7 +97,7 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, @@ -25294,6 +28671,15 @@ index be1ef57..55f0160 100644 return NULL; WARN_ON_ONCE(is_ram); } +@@ -256,7 +256,7 @@ EXPORT_SYMBOL(ioremap_prot); + * + * Caller must ensure there is only one unmapping for the same pointer. + */ +-void iounmap(volatile void __iomem *addr) ++void iounmap(const volatile void __iomem *addr) + { + struct vm_struct *p, *o; + @@ -315,6 +315,9 @@ void *xlate_dev_mem_ptr(unsigned long phys) /* If page is RAM, we can use __va. Otherwise ioremap and unmap. */ @@ -25304,7 +28690,17 @@ index be1ef57..55f0160 100644 return __va(phys); addr = (void __force *)ioremap_cache(start, PAGE_SIZE); -@@ -344,7 +347,7 @@ static int __init early_ioremap_debug_setup(char *str) +@@ -327,6 +330,9 @@ void *xlate_dev_mem_ptr(unsigned long phys) + void unxlate_dev_mem_ptr(unsigned long phys, void *addr) + { + if (page_is_ram(phys >> PAGE_SHIFT)) ++#ifdef CONFIG_HIGHMEM ++ if ((phys >> PAGE_SHIFT) < max_low_pfn) ++#endif + return; + + iounmap((void __iomem *)((unsigned long)addr & PAGE_MASK)); +@@ -344,7 +350,7 @@ static int __init early_ioremap_debug_setup(char *str) early_param("early_ioremap_debug", early_ioremap_debug_setup); static __initdata int after_paging_init; @@ -25313,7 +28709,7 @@ index be1ef57..55f0160 100644 static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) { -@@ -381,8 +384,7 @@ void __init early_ioremap_init(void) +@@ -381,8 +387,7 @@ void __init early_ioremap_init(void) slot_virt[i] = __fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i); pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); @@ -25425,7 +28821,7 @@ index 845df68..1d8d29f 100644 mm->unmap_area = arch_unmap_area_topdown; } diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c -index dc0b727..dc9d71a 100644 +index dc0b727..f612039 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c @@ -194,7 +194,7 @@ static void pre(struct kmmio_probe *p, struct pt_regs *regs, @@ -25455,8 +28851,39 @@ index dc0b727..dc9d71a 100644 }; map.map_id = trace->id; +@@ -290,7 +290,7 @@ void mmiotrace_ioremap(resource_size_t offset, unsigned long size, + ioremap_trace_core(offset, size, addr); + } + +-static void iounmap_trace_core(volatile void __iomem *addr) ++static void iounmap_trace_core(const volatile void __iomem *addr) + { + struct mmiotrace_map map = { + .phys = 0, +@@ -328,7 +328,7 @@ not_enabled: + } + } + +-void mmiotrace_iounmap(volatile void __iomem *addr) ++void mmiotrace_iounmap(const volatile void __iomem *addr) + { + might_sleep(); + if (is_enabled()) /* recheck and proper locking in *_core() */ +diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c +index 72fe01e..f1a8daa 100644 +--- a/arch/x86/mm/numa.c ++++ b/arch/x86/mm/numa.c +@@ -477,7 +477,7 @@ static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi) + return true; + } + +-static int __init numa_register_memblks(struct numa_meminfo *mi) ++static int __init __intentional_overflow(-1) numa_register_memblks(struct numa_meminfo *mi) + { + unsigned long uninitialized_var(pfn_align); + int i, nid; diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c -index b008656..773eac2 100644 +index 0e38951..4ca8458 100644 --- a/arch/x86/mm/pageattr-test.c +++ b/arch/x86/mm/pageattr-test.c @@ -36,7 +36,7 @@ enum { @@ -25469,7 +28896,7 @@ index b008656..773eac2 100644 struct split_state { diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c -index e1ebde3..b1e1db38 100644 +index fb4e73e..43f7238 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -261,7 +261,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address, @@ -25495,8 +28922,8 @@ index e1ebde3..b1e1db38 100644 * The .rodata section needs to be read-only. Using the pfn * catches all aliases. @@ -279,6 +280,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address, - if (within(pfn, __pa((unsigned long)__start_rodata) >> PAGE_SHIFT, - __pa((unsigned long)__end_rodata) >> PAGE_SHIFT)) + if (within(pfn, __pa_symbol(__start_rodata) >> PAGE_SHIFT, + __pa_symbol(__end_rodata) >> PAGE_SHIFT)) pgprot_val(forbidden) |= _PAGE_RW; +#endif @@ -25507,7 +28934,7 @@ index e1ebde3..b1e1db38 100644 #endif +#ifdef CONFIG_PAX_KERNEXEC -+ if (within(pfn, __pa((unsigned long)&_text), __pa((unsigned long)&_sdata))) { ++ if (within(pfn, __pa(ktla_ktva((unsigned long)&_text)), __pa((unsigned long)&_sdata))) { + pgprot_val(forbidden) |= _PAGE_RW; + pgprot_val(forbidden) |= _PAGE_NX & __supported_pte_mask; + } @@ -25516,7 +28943,7 @@ index e1ebde3..b1e1db38 100644 prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden)); return prot; -@@ -369,23 +378,37 @@ EXPORT_SYMBOL_GPL(lookup_address); +@@ -400,23 +409,37 @@ EXPORT_SYMBOL_GPL(slow_virt_to_phys); static void __set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte) { /* change init_mm */ @@ -25557,56 +28984,56 @@ index e1ebde3..b1e1db38 100644 static int diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c -index f6ff57b..481690f 100644 +index 6574388..87e9bef 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c -@@ -361,7 +361,7 @@ int free_memtype(u64 start, u64 end) +@@ -376,7 +376,7 @@ int free_memtype(u64 start, u64 end) if (!entry) { - printk(KERN_INFO "%s:%d freeing invalid memtype %Lx-%Lx\n", -- current->comm, current->pid, start, end); -+ current->comm, task_pid_nr(current), start, end); + printk(KERN_INFO "%s:%d freeing invalid memtype [mem %#010Lx-%#010Lx]\n", +- current->comm, current->pid, start, end - 1); ++ current->comm, task_pid_nr(current), start, end - 1); return -EINVAL; } -@@ -492,8 +492,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) +@@ -506,8 +506,8 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) + while (cursor < to) { if (!devmem_is_allowed(pfn)) { - printk(KERN_INFO -- "Program %s tried to access /dev/mem between %Lx->%Lx.\n", -- current->comm, from, to); -+ "Program %s tried to access /dev/mem between %Lx->%Lx (%Lx).\n", -+ current->comm, from, to, cursor); +- printk(KERN_INFO "Program %s tried to access /dev/mem between [mem %#010Lx-%#010Lx]\n", +- current->comm, from, to - 1); ++ printk(KERN_INFO "Program %s tried to access /dev/mem between [mem %#010Lx-%#010Lx] (%#010Lx)\n", ++ current->comm, from, to - 1, cursor); return 0; } cursor += PAGE_SIZE; -@@ -557,7 +557,7 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags) - printk(KERN_INFO - "%s:%d ioremap_change_attr failed %s " - "for %Lx-%Lx\n", +@@ -577,7 +577,7 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags) + if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) { + printk(KERN_INFO "%s:%d ioremap_change_attr failed %s " + "for [mem %#010Lx-%#010Lx]\n", - current->comm, current->pid, + current->comm, task_pid_nr(current), cattr_name(flags), - base, (unsigned long long)(base + size)); + base, (unsigned long long)(base + size-1)); return -EINVAL; -@@ -593,7 +593,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, +@@ -612,7 +612,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, + flags = lookup_memtype(paddr); if (want_flags != flags) { - printk(KERN_WARNING - "%s:%d map pfn RAM range req %s for %Lx-%Lx, got %s\n", + printk(KERN_WARNING "%s:%d map pfn RAM range req %s for [mem %#010Lx-%#010Lx], got %s\n", - current->comm, current->pid, + current->comm, task_pid_nr(current), cattr_name(want_flags), (unsigned long long)paddr, - (unsigned long long)(paddr + size), -@@ -615,7 +615,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, + (unsigned long long)(paddr + size - 1), +@@ -634,7 +634,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, free_memtype(paddr, paddr + size); printk(KERN_ERR "%s:%d map pfn expected mapping type %s" - " for %Lx-%Lx, got %s\n", + " for [mem %#010Lx-%#010Lx], got %s\n", - current->comm, current->pid, + current->comm, task_pid_nr(current), cattr_name(want_flags), (unsigned long long)paddr, - (unsigned long long)(paddr + size), + (unsigned long long)(paddr + size - 1), diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c index 9f0614d..92ae64a 100644 --- a/arch/x86/mm/pf_in.c @@ -25657,10 +29084,10 @@ index 9f0614d..92ae64a 100644 p += get_opcode(p, &opcode); for (i = 0; i < ARRAY_SIZE(imm_wop); i++) diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c -index 8573b83..4f3ed7e 100644 +index 17fda6a..489c74a 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c -@@ -84,10 +84,64 @@ static inline void pgd_list_del(pgd_t *pgd) +@@ -91,10 +91,64 @@ static inline void pgd_list_del(pgd_t *pgd) list_del(&page->lru); } @@ -25672,7 +29099,7 @@ index 8573b83..4f3ed7e 100644 +void __shadow_user_pgds(pgd_t *dst, const pgd_t *src) +{ + unsigned int count = USER_PGD_PTRS; -+ + + while (count--) + *dst++ = __pgd((pgd_val(*src++) | (_PAGE_NX & __supported_pte_mask)) & ~_PAGE_USER); +} @@ -25695,7 +29122,7 @@ index 8573b83..4f3ed7e 100644 +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) + pgd = __pgd(pgd_val(pgd) & clone_pgd_mask); +#endif - ++ + *dst++ = pgd; + } + @@ -25727,7 +29154,7 @@ index 8573b83..4f3ed7e 100644 static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm) { BUILD_BUG_ON(sizeof(virt_to_page(pgd)->index) < sizeof(mm)); -@@ -128,6 +182,7 @@ static void pgd_dtor(pgd_t *pgd) +@@ -135,6 +189,7 @@ static void pgd_dtor(pgd_t *pgd) pgd_list_del(pgd); spin_unlock(&pgd_lock); } @@ -25735,8 +29162,8 @@ index 8573b83..4f3ed7e 100644 /* * List of all pgd's needed for non-PAE so it can invalidate entries -@@ -140,7 +195,7 @@ static void pgd_dtor(pgd_t *pgd) - * -- wli +@@ -147,7 +202,7 @@ static void pgd_dtor(pgd_t *pgd) + * -- nyc */ -#ifdef CONFIG_X86_PAE @@ -25744,7 +29171,7 @@ index 8573b83..4f3ed7e 100644 /* * In PAE mode, we need to do a cr3 reload (=tlb flush) when * updating the top-level pagetable entries to guarantee the -@@ -152,7 +207,7 @@ static void pgd_dtor(pgd_t *pgd) +@@ -159,7 +214,7 @@ static void pgd_dtor(pgd_t *pgd) * not shared between pagetables (!SHARED_KERNEL_PMDS), we allocate * and initialize the kernel pmds here. */ @@ -25753,7 +29180,7 @@ index 8573b83..4f3ed7e 100644 void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) { -@@ -170,36 +225,38 @@ void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) +@@ -177,36 +232,38 @@ void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) */ flush_tlb_mm(mm); } @@ -25803,7 +29230,7 @@ index 8573b83..4f3ed7e 100644 return -ENOMEM; } -@@ -212,51 +269,55 @@ static int preallocate_pmds(pmd_t *pmds[]) +@@ -219,51 +276,55 @@ static int preallocate_pmds(pmd_t *pmds[]) * preallocate which never got a corresponding vma will need to be * freed manually. */ @@ -25876,7 +29303,7 @@ index 8573b83..4f3ed7e 100644 pgd = (pgd_t *)__get_free_page(PGALLOC_GFP); -@@ -265,11 +326,11 @@ pgd_t *pgd_alloc(struct mm_struct *mm) +@@ -272,11 +333,11 @@ pgd_t *pgd_alloc(struct mm_struct *mm) mm->pgd = pgd; @@ -25890,7 +29317,7 @@ index 8573b83..4f3ed7e 100644 /* * Make sure that pre-populating the pmds is atomic with -@@ -279,14 +340,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm) +@@ -286,14 +347,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm) spin_lock(&pgd_lock); pgd_ctor(mm, pgd); @@ -25908,7 +29335,7 @@ index 8573b83..4f3ed7e 100644 out_free_pgd: free_page((unsigned long)pgd); out: -@@ -295,7 +356,7 @@ out: +@@ -302,7 +363,7 @@ out: void pgd_free(struct mm_struct *mm, pgd_t *pgd) { @@ -25935,6 +29362,28 @@ index a69bcb8..19068ab 100644 /* * It's enough to flush this one mapping. +diff --git a/arch/x86/mm/physaddr.c b/arch/x86/mm/physaddr.c +index e666cbb..61788c45 100644 +--- a/arch/x86/mm/physaddr.c ++++ b/arch/x86/mm/physaddr.c +@@ -10,7 +10,7 @@ + #ifdef CONFIG_X86_64 + + #ifdef CONFIG_DEBUG_VIRTUAL +-unsigned long __phys_addr(unsigned long x) ++unsigned long __intentional_overflow(-1) __phys_addr(unsigned long x) + { + unsigned long y = x - __START_KERNEL_map; + +@@ -67,7 +67,7 @@ EXPORT_SYMBOL(__virt_addr_valid); + #else + + #ifdef CONFIG_DEBUG_VIRTUAL +-unsigned long __phys_addr(unsigned long x) ++unsigned long __intentional_overflow(-1) __phys_addr(unsigned long x) + { + unsigned long phys_addr = x - PAGE_OFFSET; + /* VMALLOC_* aren't constants */ diff --git a/arch/x86/mm/setup_nx.c b/arch/x86/mm/setup_nx.c index 410531d..0f16030 100644 --- a/arch/x86/mm/setup_nx.c @@ -25969,21 +29418,21 @@ index 410531d..0f16030 100644 } diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c -index d6c0418..06a0ad5 100644 +index 282375f..e03a98f 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c -@@ -65,7 +65,11 @@ void leave_mm(int cpu) +@@ -48,7 +48,11 @@ void leave_mm(int cpu) BUG(); - cpumask_clear_cpu(cpu, - mm_cpumask(percpu_read(cpu_tlbstate.active_mm))); + if (cpumask_test_cpu(cpu, mm_cpumask(active_mm))) { + cpumask_clear_cpu(cpu, mm_cpumask(active_mm)); + +#ifndef CONFIG_PAX_PER_CPU_PGD - load_cr3(swapper_pg_dir); + load_cr3(swapper_pg_dir); +#endif + + } } EXPORT_SYMBOL_GPL(leave_mm); - diff --git a/arch/x86/net/bpf_jit.S b/arch/x86/net/bpf_jit.S index 877b9a1..a8ecf42 100644 --- a/arch/x86/net/bpf_jit.S @@ -26098,10 +29547,139 @@ index 877b9a1..a8ecf42 100644 + pax_force_retaddr ret diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c -index 0597f95..a12c36e 100644 +index 3cbe4538..fd756dc 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c -@@ -120,6 +120,11 @@ static inline void bpf_flush_icache(void *start, void *end) +@@ -12,6 +12,7 @@ + #include <linux/netdevice.h> + #include <linux/filter.h> + #include <linux/if_vlan.h> ++#include <linux/random.h> + + /* + * Conventions : +@@ -49,13 +50,87 @@ static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len) + return ptr + len; + } + ++#ifdef CONFIG_GRKERNSEC_JIT_HARDEN ++#define MAX_INSTR_CODE_SIZE 96 ++#else ++#define MAX_INSTR_CODE_SIZE 64 ++#endif ++ + #define EMIT(bytes, len) do { prog = emit_code(prog, bytes, len); } while (0) + + #define EMIT1(b1) EMIT(b1, 1) + #define EMIT2(b1, b2) EMIT((b1) + ((b2) << 8), 2) + #define EMIT3(b1, b2, b3) EMIT((b1) + ((b2) << 8) + ((b3) << 16), 3) + #define EMIT4(b1, b2, b3, b4) EMIT((b1) + ((b2) << 8) + ((b3) << 16) + ((b4) << 24), 4) ++ ++#ifdef CONFIG_GRKERNSEC_JIT_HARDEN ++/* original constant will appear in ecx */ ++#define DILUTE_CONST_SEQUENCE(_off, _key) \ ++do { \ ++ /* mov ecx, randkey */ \ ++ EMIT1(0xb9); \ ++ EMIT(_key, 4); \ ++ /* xor ecx, randkey ^ off */ \ ++ EMIT2(0x81, 0xf1); \ ++ EMIT((_key) ^ (_off), 4); \ ++} while (0) ++ ++#define EMIT1_off32(b1, _off) \ ++do { \ ++ switch (b1) { \ ++ case 0x05: /* add eax, imm32 */ \ ++ case 0x2d: /* sub eax, imm32 */ \ ++ case 0x25: /* and eax, imm32 */ \ ++ case 0x0d: /* or eax, imm32 */ \ ++ case 0xb8: /* mov eax, imm32 */ \ ++ case 0x3d: /* cmp eax, imm32 */ \ ++ case 0xa9: /* test eax, imm32 */ \ ++ DILUTE_CONST_SEQUENCE(_off, randkey); \ ++ EMIT2((b1) - 4, 0xc8); /* convert imm instruction to eax, ecx */\ ++ break; \ ++ case 0xbb: /* mov ebx, imm32 */ \ ++ DILUTE_CONST_SEQUENCE(_off, randkey); \ ++ /* mov ebx, ecx */ \ ++ EMIT2(0x89, 0xcb); \ ++ break; \ ++ case 0xbe: /* mov esi, imm32 */ \ ++ DILUTE_CONST_SEQUENCE(_off, randkey); \ ++ /* mov esi, ecx */ \ ++ EMIT2(0x89, 0xce); \ ++ break; \ ++ case 0xe9: /* jmp rel imm32 */ \ ++ EMIT1(b1); \ ++ EMIT(_off, 4); \ ++ /* prevent fall-through, we're not called if off = 0 */ \ ++ EMIT(0xcccccccc, 4); \ ++ EMIT(0xcccccccc, 4); \ ++ break; \ ++ default: \ ++ EMIT1(b1); \ ++ EMIT(_off, 4); \ ++ } \ ++} while (0) ++ ++#define EMIT2_off32(b1, b2, _off) \ ++do { \ ++ if ((b1) == 0x8d && (b2) == 0xb3) { /* lea esi, [rbx+imm32] */ \ ++ EMIT2(0x8d, 0xb3); /* lea esi, [rbx+randkey] */ \ ++ EMIT(randkey, 4); \ ++ EMIT2(0x8d, 0xb6); /* lea esi, [esi+off-randkey] */ \ ++ EMIT((_off) - randkey, 4); \ ++ } else if ((b1) == 0x69 && (b2) == 0xc0) { /* imul eax, imm32 */\ ++ DILUTE_CONST_SEQUENCE(_off, randkey); \ ++ /* imul eax, ecx */ \ ++ EMIT3(0x0f, 0xaf, 0xc1); \ ++ } else { \ ++ EMIT2(b1, b2); \ ++ EMIT(_off, 4); \ ++ } \ ++} while (0) ++#else + #define EMIT1_off32(b1, off) do { EMIT1(b1); EMIT(off, 4);} while (0) ++#define EMIT2_off32(b1, b2, off) do { EMIT2(b1, b2); EMIT(off, 4);} while (0) ++#endif + + #define CLEAR_A() EMIT2(0x31, 0xc0) /* xor %eax,%eax */ + #define CLEAR_X() EMIT2(0x31, 0xdb) /* xor %ebx,%ebx */ +@@ -90,6 +165,24 @@ do { \ + #define X86_JBE 0x76 + #define X86_JA 0x77 + ++#ifdef CONFIG_GRKERNSEC_JIT_HARDEN ++#define APPEND_FLOW_VERIFY() \ ++do { \ ++ /* mov ecx, randkey */ \ ++ EMIT1(0xb9); \ ++ EMIT(randkey, 4); \ ++ /* cmp ecx, randkey */ \ ++ EMIT2(0x81, 0xf9); \ ++ EMIT(randkey, 4); \ ++ /* jz after 8 int 3s */ \ ++ EMIT2(0x74, 0x08); \ ++ EMIT(0xcccccccc, 4); \ ++ EMIT(0xcccccccc, 4); \ ++} while (0) ++#else ++#define APPEND_FLOW_VERIFY() do { } while (0) ++#endif ++ + #define EMIT_COND_JMP(op, offset) \ + do { \ + if (is_near(offset)) \ +@@ -97,6 +190,7 @@ do { \ + else { \ + EMIT2(0x0f, op + 0x10); \ + EMIT(offset, 4); /* jxx .+off32 */ \ ++ APPEND_FLOW_VERIFY(); \ + } \ + } while (0) + +@@ -121,6 +215,11 @@ static inline void bpf_flush_icache(void *start, void *end) set_fs(old_fs); } @@ -26113,7 +29691,26 @@ index 0597f95..a12c36e 100644 #define CHOOSE_LOAD_FUNC(K, func) \ ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset) -@@ -146,6 +151,10 @@ void bpf_jit_compile(struct sk_filter *fp) +@@ -146,7 +245,7 @@ static int pkt_type_offset(void) + + void bpf_jit_compile(struct sk_filter *fp) + { +- u8 temp[64]; ++ u8 temp[MAX_INSTR_CODE_SIZE]; + u8 *prog; + unsigned int proglen, oldproglen = 0; + int ilen, i; +@@ -159,6 +258,9 @@ void bpf_jit_compile(struct sk_filter *fp) + unsigned int *addrs; + const struct sock_filter *filter = fp->insns; + int flen = fp->len; ++#ifdef CONFIG_GRKERNSEC_JIT_HARDEN ++ unsigned int randkey; ++#endif + + if (!bpf_jit_enable) + return; +@@ -167,11 +269,19 @@ void bpf_jit_compile(struct sk_filter *fp) if (addrs == NULL) return; @@ -26121,10 +29718,68 @@ index 0597f95..a12c36e 100644 + if (!fp->work) + goto out; + ++#ifdef CONFIG_GRKERNSEC_JIT_HARDEN ++ randkey = get_random_int(); ++#endif ++ /* Before first pass, make a rough estimation of addrs[] - * each bpf instruction is translated to less than 64 bytes +- * each bpf instruction is translated to less than 64 bytes ++ * each bpf instruction is translated to less than MAX_INSTR_CODE_SIZE bytes */ -@@ -589,17 +598,18 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; + for (proglen = 0, i = 0; i < flen; i++) { +- proglen += 64; ++ proglen += MAX_INSTR_CODE_SIZE; + addrs[i] = proglen; + } + cleanup_addr = proglen; /* epilogue address */ +@@ -282,10 +392,8 @@ void bpf_jit_compile(struct sk_filter *fp) + case BPF_S_ALU_MUL_K: /* A *= K */ + if (is_imm8(K)) + EMIT3(0x6b, 0xc0, K); /* imul imm8,%eax,%eax */ +- else { +- EMIT2(0x69, 0xc0); /* imul imm32,%eax */ +- EMIT(K, 4); +- } ++ else ++ EMIT2_off32(0x69, 0xc0, K); /* imul imm32,%eax */ + break; + case BPF_S_ALU_DIV_X: /* A /= X; */ + seen |= SEEN_XREG; +@@ -325,13 +433,23 @@ void bpf_jit_compile(struct sk_filter *fp) + break; + case BPF_S_ALU_MOD_K: /* A %= K; */ + EMIT2(0x31, 0xd2); /* xor %edx,%edx */ ++#ifdef CONFIG_GRKERNSEC_JIT_HARDEN ++ DILUTE_CONST_SEQUENCE(K, randkey); ++#else + EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */ ++#endif + EMIT2(0xf7, 0xf1); /* div %ecx */ + EMIT2(0x89, 0xd0); /* mov %edx,%eax */ + break; + case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K); */ ++#ifdef CONFIG_GRKERNSEC_JIT_HARDEN ++ DILUTE_CONST_SEQUENCE(K, randkey); ++ // imul rax, rcx ++ EMIT4(0x48, 0x0f, 0xaf, 0xc1); ++#else + EMIT3(0x48, 0x69, 0xc0); /* imul imm32,%rax,%rax */ + EMIT(K, 4); ++#endif + EMIT4(0x48, 0xc1, 0xe8, 0x20); /* shr $0x20,%rax */ + break; + case BPF_S_ALU_AND_X: +@@ -602,8 +720,7 @@ common_load_ind: seen |= SEEN_DATAREF | SEEN_XREG; + if (is_imm8(K)) { + EMIT3(0x8d, 0x73, K); /* lea imm8(%rbx), %esi */ + } else { +- EMIT2(0x8d, 0xb3); /* lea imm32(%rbx),%esi */ +- EMIT(K, 4); ++ EMIT2_off32(0x8d, 0xb3, K); /* lea imm32(%rbx),%esi */ + } + } else { + EMIT2(0x89,0xde); /* mov %ebx,%esi */ +@@ -686,17 +803,18 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; break; default: /* hmm, too complex filter, give up with jit compiler */ @@ -26147,7 +29802,7 @@ index 0597f95..a12c36e 100644 } proglen += ilen; addrs[i] = proglen; -@@ -620,11 +630,9 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; +@@ -717,11 +835,9 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; break; } if (proglen == oldproglen) { @@ -26161,7 +29816,7 @@ index 0597f95..a12c36e 100644 } oldproglen = proglen; } -@@ -640,7 +648,10 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; +@@ -737,7 +853,10 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; bpf_flush_icache(image, image + proglen); fp->bpf_func = (void *)image; @@ -26173,7 +29828,7 @@ index 0597f95..a12c36e 100644 out: kfree(addrs); return; -@@ -648,18 +659,20 @@ out: +@@ -745,18 +864,20 @@ out: static void jit_free_defer(struct work_struct *arg) { @@ -26233,21 +29888,144 @@ index d6aa6e8..266395a 100644 unsigned long stack = kernel_stack_pointer(regs); if (depth) dump_trace(NULL, regs, (unsigned long *)stack, 0, -diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c -index 831971e..dd8ca6f 100644 ---- a/arch/x86/pci/i386.c -+++ b/arch/x86/pci/i386.c -@@ -57,7 +57,7 @@ static struct pcibios_fwaddrmap *pcibios_fwaddrmap_lookup(struct pci_dev *dev) +diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c +index 48768df..ba9143c 100644 +--- a/arch/x86/oprofile/nmi_int.c ++++ b/arch/x86/oprofile/nmi_int.c +@@ -23,6 +23,7 @@ + #include <asm/nmi.h> + #include <asm/msr.h> + #include <asm/apic.h> ++#include <asm/pgtable.h> + + #include "op_counter.h" + #include "op_x86_model.h" +@@ -774,8 +775,11 @@ int __init op_nmi_init(struct oprofile_operations *ops) + if (ret) + return ret; + +- if (!model->num_virt_counters) +- model->num_virt_counters = model->num_counters; ++ if (!model->num_virt_counters) { ++ pax_open_kernel(); ++ *(unsigned int *)&model->num_virt_counters = model->num_counters; ++ pax_close_kernel(); ++ } + + mux_init(ops); + +diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c +index b2b9443..be58856 100644 +--- a/arch/x86/oprofile/op_model_amd.c ++++ b/arch/x86/oprofile/op_model_amd.c +@@ -519,9 +519,11 @@ static int op_amd_init(struct oprofile_operations *ops) + num_counters = AMD64_NUM_COUNTERS; + } + +- op_amd_spec.num_counters = num_counters; +- op_amd_spec.num_controls = num_counters; +- op_amd_spec.num_virt_counters = max(num_counters, NUM_VIRT_COUNTERS); ++ pax_open_kernel(); ++ *(unsigned int *)&op_amd_spec.num_counters = num_counters; ++ *(unsigned int *)&op_amd_spec.num_controls = num_counters; ++ *(unsigned int *)&op_amd_spec.num_virt_counters = max(num_counters, NUM_VIRT_COUNTERS); ++ pax_close_kernel(); + + return 0; + } +diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c +index d90528e..0127e2b 100644 +--- a/arch/x86/oprofile/op_model_ppro.c ++++ b/arch/x86/oprofile/op_model_ppro.c +@@ -19,6 +19,7 @@ + #include <asm/msr.h> + #include <asm/apic.h> + #include <asm/nmi.h> ++#include <asm/pgtable.h> + + #include "op_x86_model.h" + #include "op_counter.h" +@@ -221,8 +222,10 @@ static void arch_perfmon_setup_counters(void) + + num_counters = min((int)eax.split.num_counters, OP_MAX_COUNTER); + +- op_arch_perfmon_spec.num_counters = num_counters; +- op_arch_perfmon_spec.num_controls = num_counters; ++ pax_open_kernel(); ++ *(unsigned int *)&op_arch_perfmon_spec.num_counters = num_counters; ++ *(unsigned int *)&op_arch_perfmon_spec.num_controls = num_counters; ++ pax_close_kernel(); + } + + static int arch_perfmon_init(struct oprofile_operations *ignore) +diff --git a/arch/x86/oprofile/op_x86_model.h b/arch/x86/oprofile/op_x86_model.h +index 71e8a67..6a313bb 100644 +--- a/arch/x86/oprofile/op_x86_model.h ++++ b/arch/x86/oprofile/op_x86_model.h +@@ -52,7 +52,7 @@ struct op_x86_model_spec { + void (*switch_ctrl)(struct op_x86_model_spec const *model, + struct op_msrs const * const msrs); + #endif +-}; ++} __do_const; + + struct op_counter_config; + +diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c +index e9e6ed5..e47ae67 100644 +--- a/arch/x86/pci/amd_bus.c ++++ b/arch/x86/pci/amd_bus.c +@@ -337,7 +337,7 @@ static int __cpuinit amd_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata amd_cpu_notifier = { ++static struct notifier_block amd_cpu_notifier = { + .notifier_call = amd_cpu_notify, + }; + +diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c +index 372e9b8..e775a6c 100644 +--- a/arch/x86/pci/irq.c ++++ b/arch/x86/pci/irq.c +@@ -50,7 +50,7 @@ struct irq_router { + struct irq_router_handler { + u16 vendor; + int (*probe)(struct irq_router *r, struct pci_dev *router, u16 device); +-}; ++} __do_const; + + int (*pcibios_enable_irq)(struct pci_dev *dev) = pirq_enable_irq; + void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL; +@@ -794,7 +794,7 @@ static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router + return 0; + } + +-static __initdata struct irq_router_handler pirq_routers[] = { ++static __initconst const struct irq_router_handler pirq_routers[] = { + { PCI_VENDOR_ID_INTEL, intel_router_probe }, + { PCI_VENDOR_ID_AL, ali_router_probe }, + { PCI_VENDOR_ID_ITE, ite_router_probe }, +@@ -821,7 +821,7 @@ static struct pci_dev *pirq_router_dev; + static void __init pirq_find_router(struct irq_router *r) { - struct pcibios_fwaddrmap *map; + struct irq_routing_table *rt = pirq_table; +- struct irq_router_handler *h; ++ const struct irq_router_handler *h; -- WARN_ON(!spin_is_locked(&pcibios_fwaddrmap_lock)); -+ WARN_ON_SMP(!spin_is_locked(&pcibios_fwaddrmap_lock)); + #ifdef CONFIG_PCI_BIOS + if (!rt->signature) { +@@ -1094,7 +1094,7 @@ static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d) + return 0; + } - list_for_each_entry(map, &pcibios_fwaddrmappings, list) - if (map->dev == dev) +-static struct dmi_system_id __initdata pciirq_dmi_table[] = { ++static const struct dmi_system_id __initconst pciirq_dmi_table[] = { + { + .callback = fix_broken_hp_bios_irq9, + .ident = "HP Pavilion N5400 Series Laptop", diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c -index 140942f..8a5cc55 100644 +index 6eb18c4..20d83de 100644 --- a/arch/x86/pci/mrst.c +++ b/arch/x86/pci/mrst.c @@ -238,7 +238,9 @@ int __init pci_mrst_init(void) @@ -26262,10 +30040,10 @@ index 140942f..8a5cc55 100644 /* Continue with standard init */ return 1; diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c -index da8fe05..7ee6704 100644 +index c77b24a..c979855 100644 --- a/arch/x86/pci/pcbios.c +++ b/arch/x86/pci/pcbios.c -@@ -79,50 +79,93 @@ union bios32 { +@@ -79,7 +79,7 @@ union bios32 { static struct { unsigned long address; unsigned short segment; @@ -26274,13 +30052,7 @@ index da8fe05..7ee6704 100644 /* * Returns the entry point for the given service, NULL on error - */ - --static unsigned long bios32_service(unsigned long service) -+static unsigned long __devinit bios32_service(unsigned long service) - { - unsigned char return_code; /* %al */ - unsigned long address; /* %ebx */ +@@ -92,37 +92,80 @@ static unsigned long bios32_service(unsigned long service) unsigned long length; /* %ecx */ unsigned long entry; /* %edx */ unsigned long flags; @@ -26371,9 +30143,9 @@ index da8fe05..7ee6704 100644 -static int pci_bios_present; +static int pci_bios_present __read_only; - static int __devinit check_pcibios(void) + static int check_pcibios(void) { -@@ -131,11 +174,13 @@ static int __devinit check_pcibios(void) +@@ -131,11 +174,13 @@ static int check_pcibios(void) unsigned long flags, pcibios_entry; if ((pcibios_entry = bios32_service(PCI_SERVICE))) { @@ -26390,7 +30162,7 @@ index da8fe05..7ee6704 100644 "jc 1f\n\t" "xor %%ah, %%ah\n" "1:" -@@ -144,7 +189,8 @@ static int __devinit check_pcibios(void) +@@ -144,7 +189,8 @@ static int check_pcibios(void) "=b" (ebx), "=c" (ecx) : "1" (PCIBIOS_PCI_BIOS_PRESENT), @@ -26612,7 +30384,7 @@ index 40e4469..1ab536e 100644 gdt_descr.size = GDT_SIZE - 1; load_gdt(&gdt_descr); diff --git a/arch/x86/platform/efi/efi_stub_32.S b/arch/x86/platform/efi/efi_stub_32.S -index fbe66e6..f62f167 100644 +index fbe66e6..eae5e38 100644 --- a/arch/x86/platform/efi/efi_stub_32.S +++ b/arch/x86/platform/efi/efi_stub_32.S @@ -6,7 +6,9 @@ @@ -26690,7 +30462,7 @@ index fbe66e6..f62f167 100644 /* * 6. After EFI runtime service returns, control will return to * following instruction. We'd better readjust stack pointer first. -@@ -88,35 +97,40 @@ ENTRY(efi_call_phys) +@@ -88,35 +97,36 @@ ENTRY(efi_call_phys) movl %cr0, %edx orl $0x80000000, %edx movl %edx, %cr0 @@ -26713,10 +30485,6 @@ index fbe66e6..f62f167 100644 + jmp 1f+__PAGE_OFFSET +#endif 1: -+ movl $(__KERNEL_DS), %edx -+ mov %edx, %ds -+ mov %edx, %es -+ mov %edx, %ss /* * 9. Balance the stack. And because EAX contain the return value, @@ -26833,11 +30601,24 @@ index e31bcd8..f12dc46 100644 } /* parse all the mtimer info to a static mtimer array */ +diff --git a/arch/x86/platform/olpc/olpc_dt.c b/arch/x86/platform/olpc/olpc_dt.c +index d6ee929..3637cb5 100644 +--- a/arch/x86/platform/olpc/olpc_dt.c ++++ b/arch/x86/platform/olpc/olpc_dt.c +@@ -156,7 +156,7 @@ void * __init prom_early_alloc(unsigned long size) + return res; + } + +-static struct of_pdt_ops prom_olpc_ops __initdata = { ++static struct of_pdt_ops prom_olpc_ops __initconst = { + .nextprop = olpc_dt_nextprop, + .getproplen = olpc_dt_getproplen, + .getproperty = olpc_dt_getproperty, diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c -index 218cdb1..fd55c08 100644 +index 3c68768..07e82b8 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c -@@ -132,7 +132,7 @@ static void do_fpu_end(void) +@@ -134,7 +134,7 @@ static void do_fpu_end(void) static void fix_processor_context(void) { int cpu = smp_processor_id(); @@ -26846,18 +30627,130 @@ index 218cdb1..fd55c08 100644 set_tss_desc(cpu, t); /* * This just modifies memory; should not be -@@ -142,7 +142,9 @@ static void fix_processor_context(void) +@@ -144,8 +144,6 @@ static void fix_processor_context(void) */ #ifdef CONFIG_X86_64 -+ pax_open_kernel(); - get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9; -+ pax_close_kernel(); - +- get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9; +- syscall_init(); /* This sets MSR_*STAR and related */ #endif + load_TR_desc(); /* This does ltr */ +diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c +index a44f457..9140171 100644 +--- a/arch/x86/realmode/init.c ++++ b/arch/x86/realmode/init.c +@@ -70,7 +70,13 @@ void __init setup_real_mode(void) + __va(real_mode_header->trampoline_header); + + #ifdef CONFIG_X86_32 +- trampoline_header->start = __pa_symbol(startup_32_smp); ++ trampoline_header->start = __pa_symbol(ktla_ktva(startup_32_smp)); ++ ++#ifdef CONFIG_PAX_KERNEXEC ++ trampoline_header->start -= LOAD_PHYSICAL_ADDR; ++#endif ++ ++ trampoline_header->boot_cs = __BOOT_CS; + trampoline_header->gdt_limit = __BOOT_DS + 7; + trampoline_header->gdt_base = __pa_symbol(boot_gdt); + #else +@@ -86,7 +92,7 @@ void __init setup_real_mode(void) + *trampoline_cr4_features = read_cr4(); + + trampoline_pgd = (u64 *) __va(real_mode_header->trampoline_pgd); +- trampoline_pgd[0] = init_level4_pgt[pgd_index(__PAGE_OFFSET)].pgd; ++ trampoline_pgd[0] = init_level4_pgt[pgd_index(__PAGE_OFFSET)].pgd & ~_PAGE_NX; + trampoline_pgd[511] = init_level4_pgt[511].pgd; + #endif + } +diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile +index 8869287..d577672 100644 +--- a/arch/x86/realmode/rm/Makefile ++++ b/arch/x86/realmode/rm/Makefile +@@ -78,5 +78,8 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -m32 -g -Os -D_SETUP -D__KERNEL__ -D_WAKEUP \ + $(call cc-option, -fno-unit-at-a-time)) \ + $(call cc-option, -fno-stack-protector) \ + $(call cc-option, -mpreferred-stack-boundary=2) ++ifdef CONSTIFY_PLUGIN ++KBUILD_CFLAGS += -fplugin-arg-constify_plugin-no-constify ++endif + KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ + GCOV_PROFILE := n +diff --git a/arch/x86/realmode/rm/header.S b/arch/x86/realmode/rm/header.S +index a28221d..93c40f1 100644 +--- a/arch/x86/realmode/rm/header.S ++++ b/arch/x86/realmode/rm/header.S +@@ -30,7 +30,9 @@ GLOBAL(real_mode_header) + #endif + /* APM/BIOS reboot */ + .long pa_machine_real_restart_asm +-#ifdef CONFIG_X86_64 ++#ifdef CONFIG_X86_32 ++ .long __KERNEL_CS ++#else + .long __KERNEL32_CS + #endif + END(real_mode_header) +diff --git a/arch/x86/realmode/rm/trampoline_32.S b/arch/x86/realmode/rm/trampoline_32.S +index c1b2791..f9e31c7 100644 +--- a/arch/x86/realmode/rm/trampoline_32.S ++++ b/arch/x86/realmode/rm/trampoline_32.S +@@ -25,6 +25,12 @@ + #include <asm/page_types.h> + #include "realmode.h" + ++#ifdef CONFIG_PAX_KERNEXEC ++#define ta(X) (X) ++#else ++#define ta(X) (pa_ ## X) ++#endif ++ + .text + .code16 + +@@ -39,8 +45,6 @@ ENTRY(trampoline_start) + + cli # We should be safe anyway + +- movl tr_start, %eax # where we need to go +- + movl $0xA5A5A5A5, trampoline_status + # write marker for master knows we're running + +@@ -56,7 +60,7 @@ ENTRY(trampoline_start) + movw $1, %dx # protected mode (PE) bit + lmsw %dx # into protected mode + +- ljmpl $__BOOT_CS, $pa_startup_32 ++ ljmpl *(trampoline_header) + + .section ".text32","ax" + .code32 +@@ -67,7 +71,7 @@ ENTRY(startup_32) # note: also used from wakeup_asm.S + .balign 8 + GLOBAL(trampoline_header) + tr_start: .space 4 +- tr_gdt_pad: .space 2 ++ tr_boot_cs: .space 2 + tr_gdt: .space 6 + END(trampoline_header) + +diff --git a/arch/x86/realmode/rm/trampoline_64.S b/arch/x86/realmode/rm/trampoline_64.S +index bb360dc..3e5945f 100644 +--- a/arch/x86/realmode/rm/trampoline_64.S ++++ b/arch/x86/realmode/rm/trampoline_64.S +@@ -107,7 +107,7 @@ ENTRY(startup_32) + wrmsr + + # Enable paging and in turn activate Long Mode +- movl $(X86_CR0_PG | X86_CR0_WP | X86_CR0_PE), %eax ++ movl $(X86_CR0_PG | X86_CR0_PE), %eax + movl %eax, %cr0 + + /* diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c -index b685296..4ac6aaa 100644 +index 79d67bd..c7e1b90 100644 --- a/arch/x86/tools/relocs.c +++ b/arch/x86/tools/relocs.c @@ -12,10 +12,13 @@ @@ -26874,7 +30767,7 @@ index b685296..4ac6aaa 100644 static unsigned long reloc_count, reloc_idx; static unsigned long *relocs; static unsigned long reloc16_count, reloc16_idx; -@@ -323,9 +326,39 @@ static void read_ehdr(FILE *fp) +@@ -330,9 +333,39 @@ static void read_ehdr(FILE *fp) } } @@ -26915,7 +30808,7 @@ index b685296..4ac6aaa 100644 Elf32_Shdr shdr; secs = calloc(ehdr.e_shnum, sizeof(struct section)); -@@ -360,7 +393,7 @@ static void read_shdrs(FILE *fp) +@@ -367,7 +400,7 @@ static void read_shdrs(FILE *fp) static void read_strtabs(FILE *fp) { @@ -26924,7 +30817,7 @@ index b685296..4ac6aaa 100644 for (i = 0; i < ehdr.e_shnum; i++) { struct section *sec = &secs[i]; if (sec->shdr.sh_type != SHT_STRTAB) { -@@ -385,7 +418,7 @@ static void read_strtabs(FILE *fp) +@@ -392,7 +425,7 @@ static void read_strtabs(FILE *fp) static void read_symtabs(FILE *fp) { @@ -26933,9 +30826,12 @@ index b685296..4ac6aaa 100644 for (i = 0; i < ehdr.e_shnum; i++) { struct section *sec = &secs[i]; if (sec->shdr.sh_type != SHT_SYMTAB) { -@@ -418,7 +451,9 @@ static void read_symtabs(FILE *fp) +@@ -423,9 +456,11 @@ static void read_symtabs(FILE *fp) + } - static void read_relocs(FILE *fp) + +-static void read_relocs(FILE *fp) ++static void read_relocs(FILE *fp, int use_real_mode) { - int i,j; + unsigned int i,j; @@ -26944,14 +30840,14 @@ index b685296..4ac6aaa 100644 for (i = 0; i < ehdr.e_shnum; i++) { struct section *sec = &secs[i]; if (sec->shdr.sh_type != SHT_REL) { -@@ -438,9 +473,22 @@ static void read_relocs(FILE *fp) +@@ -445,9 +480,22 @@ static void read_relocs(FILE *fp) die("Cannot read symbol table: %s\n", strerror(errno)); } + base = 0; + +#ifdef CONFIG_X86_32 -+ for (j = 0; j < ehdr.e_phnum; j++) { ++ for (j = 0; !use_real_mode && j < ehdr.e_phnum; j++) { + if (phdr[j].p_type != PT_LOAD ) + continue; + if (secs[sec->shdr.sh_info].shdr.sh_offset < phdr[j].p_offset || secs[sec->shdr.sh_info].shdr.sh_offset >= phdr[j].p_offset + phdr[j].p_filesz) @@ -26968,7 +30864,7 @@ index b685296..4ac6aaa 100644 rel->r_info = elf32_to_cpu(rel->r_info); } } -@@ -449,13 +497,13 @@ static void read_relocs(FILE *fp) +@@ -456,13 +504,13 @@ static void read_relocs(FILE *fp) static void print_absolute_symbols(void) { @@ -26984,7 +30880,7 @@ index b685296..4ac6aaa 100644 if (sec->shdr.sh_type != SHT_SYMTAB) { continue; -@@ -482,14 +530,14 @@ static void print_absolute_symbols(void) +@@ -489,14 +537,14 @@ static void print_absolute_symbols(void) static void print_absolute_relocs(void) { @@ -27001,7 +30897,7 @@ index b685296..4ac6aaa 100644 if (sec->shdr.sh_type != SHT_REL) { continue; } -@@ -551,13 +599,13 @@ static void print_absolute_relocs(void) +@@ -558,13 +606,13 @@ static void print_absolute_relocs(void) static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym), int use_real_mode) { @@ -27017,30 +30913,32 @@ index b685296..4ac6aaa 100644 struct section *sec = &secs[i]; if (sec->shdr.sh_type != SHT_REL) { -@@ -581,6 +629,22 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym), +@@ -588,6 +636,24 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym), sym = &sh_symtab[ELF32_R_SYM(rel->r_info)]; r_type = ELF32_R_TYPE(rel->r_info); -+ /* Don't relocate actual per-cpu variables, they are absolute indices, not addresses */ -+ if (!strcmp(sec_name(sym->st_shndx), ".data..percpu") && strcmp(sym_name(sym_strtab, sym), "__per_cpu_load")) -+ continue; ++ if (!use_real_mode) { ++ /* Don't relocate actual per-cpu variables, they are absolute indices, not addresses */ ++ if (!strcmp(sec_name(sym->st_shndx), ".data..percpu") && strcmp(sym_name(sym_strtab, sym), "__per_cpu_load")) ++ continue; + +#if defined(CONFIG_PAX_KERNEXEC) && defined(CONFIG_X86_32) -+ /* Don't relocate actual code, they are relocated implicitly by the base address of KERNEL_CS */ -+ if (!strcmp(sec_name(sym->st_shndx), ".text.end") && !strcmp(sym_name(sym_strtab, sym), "_etext")) -+ continue; -+ if (!strcmp(sec_name(sym->st_shndx), ".init.text")) -+ continue; -+ if (!strcmp(sec_name(sym->st_shndx), ".exit.text")) -+ continue; -+ if (!strcmp(sec_name(sym->st_shndx), ".text") && strcmp(sym_name(sym_strtab, sym), "__LOAD_PHYSICAL_ADDR")) -+ continue; ++ /* Don't relocate actual code, they are relocated implicitly by the base address of KERNEL_CS */ ++ if (!strcmp(sec_name(sym->st_shndx), ".text.end") && !strcmp(sym_name(sym_strtab, sym), "_etext")) ++ continue; ++ if (!strcmp(sec_name(sym->st_shndx), ".init.text")) ++ continue; ++ if (!strcmp(sec_name(sym->st_shndx), ".exit.text")) ++ continue; ++ if (!strcmp(sec_name(sym->st_shndx), ".text") && strcmp(sym_name(sym_strtab, sym), "__LOAD_PHYSICAL_ADDR")) ++ continue; +#endif ++ } + shn_abs = sym->st_shndx == SHN_ABS; switch (r_type) { -@@ -674,7 +738,7 @@ static int write32(unsigned int v, FILE *f) +@@ -681,7 +747,7 @@ static int write32(unsigned int v, FILE *f) static void emit_relocs(int as_text, int use_real_mode) { @@ -27049,7 +30947,7 @@ index b685296..4ac6aaa 100644 /* Count how many relocations I have and allocate space for them. */ reloc_count = 0; walk_relocs(count_reloc, use_real_mode); -@@ -801,6 +865,7 @@ int main(int argc, char **argv) +@@ -808,10 +874,11 @@ int main(int argc, char **argv) fname, strerror(errno)); } read_ehdr(fp); @@ -27057,6 +30955,11 @@ index b685296..4ac6aaa 100644 read_shdrs(fp); read_strtabs(fp); read_symtabs(fp); +- read_relocs(fp); ++ read_relocs(fp, use_real_mode); + if (show_absolute_syms) { + print_absolute_symbols(); + goto out; diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile index fd14be1..e3c79c0 100644 --- a/arch/x86/vdso/Makefile @@ -27071,7 +30974,7 @@ index fd14be1..e3c79c0 100644 # diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c -index 66e6d93..587f435 100644 +index 0faad64..39ef157 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c @@ -25,6 +25,7 @@ @@ -27157,7 +31060,7 @@ index 66e6d93..587f435 100644 return NULL; } diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c -index 00aaf04..4a26505 100644 +index 431e875..cbb23f3 100644 --- a/arch/x86/vdso/vma.c +++ b/arch/x86/vdso/vma.c @@ -16,8 +16,6 @@ @@ -27173,7 +31076,7 @@ index 00aaf04..4a26505 100644 * unaligned here as a result of stack start randomization. */ addr = PAGE_ALIGN(addr); -- addr = align_addr(addr, NULL, ALIGN_VDSO); +- addr = align_vdso_addr(addr); return addr; } @@ -27195,7 +31098,7 @@ index 00aaf04..4a26505 100644 +#endif + addr = vdso_addr(mm->start_stack, size); -+ addr = align_addr(addr, NULL, ALIGN_VDSO); ++ addr = align_vdso_addr(addr); addr = get_unmapped_area(NULL, addr, size, 0, 0); if (IS_ERR_VALUE(addr)) { ret = addr; @@ -27230,10 +31133,10 @@ index 00aaf04..4a26505 100644 -} -__setup("vdso=", vdso_setup); diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c -index 40edfc3..b4d80ac 100644 +index cf95e19..17e9f50 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c -@@ -95,8 +95,6 @@ EXPORT_SYMBOL_GPL(xen_start_info); +@@ -100,8 +100,6 @@ EXPORT_SYMBOL_GPL(xen_start_info); struct shared_info xen_dummy_shared_info; @@ -27242,7 +31145,45 @@ index 40edfc3..b4d80ac 100644 RESERVE_BRK(shared_info_page_brk, PAGE_SIZE); __read_mostly int xen_have_vector_callback; EXPORT_SYMBOL_GPL(xen_have_vector_callback); -@@ -1165,30 +1163,30 @@ static const struct pv_apic_ops xen_apic_ops __initconst = { +@@ -511,8 +509,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) + { + unsigned long va = dtr->address; + unsigned int size = dtr->size + 1; +- unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; +- unsigned long frames[pages]; ++ unsigned long frames[65536 / PAGE_SIZE]; + int f; + + /* +@@ -560,8 +557,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr) + { + unsigned long va = dtr->address; + unsigned int size = dtr->size + 1; +- unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; +- unsigned long frames[pages]; ++ unsigned long frames[(GDT_SIZE + PAGE_SIZE - 1) / PAGE_SIZE]; + int f; + + /* +@@ -569,7 +565,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr) + * 8-byte entries, or 16 4k pages.. + */ + +- BUG_ON(size > 65536); ++ BUG_ON(size > GDT_SIZE); + BUG_ON(va & ~PAGE_MASK); + + for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) { +@@ -954,7 +950,7 @@ static u32 xen_safe_apic_wait_icr_idle(void) + return 0; + } + +-static void set_xen_basic_apic_ops(void) ++static void __init set_xen_basic_apic_ops(void) + { + apic->read = xen_apic_read; + apic->write = xen_apic_write; +@@ -1260,30 +1256,30 @@ static const struct pv_apic_ops xen_apic_ops __initconst = { #endif }; @@ -27280,7 +31221,7 @@ index 40edfc3..b4d80ac 100644 { if (pm_power_off) pm_power_off(); -@@ -1291,7 +1289,17 @@ asmlinkage void __init xen_start_kernel(void) +@@ -1385,7 +1381,17 @@ asmlinkage void __init xen_start_kernel(void) __userpte_alloc_gfp &= ~__GFP_HIGHMEM; /* Work out if we support NX */ @@ -27299,7 +31240,7 @@ index 40edfc3..b4d80ac 100644 xen_setup_features(); -@@ -1322,13 +1330,6 @@ asmlinkage void __init xen_start_kernel(void) +@@ -1416,13 +1422,6 @@ asmlinkage void __init xen_start_kernel(void) machine_ops = xen_machine_ops; @@ -27313,21 +31254,30 @@ index 40edfc3..b4d80ac 100644 xen_smp_init(); #ifdef CONFIG_ACPI_NUMA +@@ -1616,7 +1615,7 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block xen_hvm_cpu_notifier __cpuinitdata = { ++static struct notifier_block xen_hvm_cpu_notifier = { + .notifier_call = xen_hvm_cpu_notify, + }; + diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c -index 69f5857..0699dc5 100644 +index e006c18..b9a7d6c 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c -@@ -1738,6 +1738,9 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd, - convert_pfn_mfn(init_level4_pgt); - convert_pfn_mfn(level3_ident_pgt); +@@ -1894,6 +1894,9 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn) + /* L3_k[510] -> level2_kernel_pgt + * L3_i[511] -> level2_fixmap_pgt */ convert_pfn_mfn(level3_kernel_pgt); + convert_pfn_mfn(level3_vmalloc_start_pgt); + convert_pfn_mfn(level3_vmalloc_end_pgt); + convert_pfn_mfn(level3_vmemmap_pgt); + /* We get [511][511] and have Xen's version of level2_kernel_pgt */ l3 = m2v(pgd[pgd_index(__START_KERNEL_map)].pgd); - l2 = m2v(l3[pud_index(__START_KERNEL_map)].pud); -@@ -1756,7 +1759,11 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd, +@@ -1923,8 +1926,12 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn) set_page_prot(init_level4_pgt, PAGE_KERNEL_RO); set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO); set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO); @@ -27335,11 +31285,12 @@ index 69f5857..0699dc5 100644 + set_page_prot(level3_vmalloc_end_pgt, PAGE_KERNEL_RO); + set_page_prot(level3_vmemmap_pgt, PAGE_KERNEL_RO); set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO); + set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO); + set_page_prot(level2_vmemmap_pgt, PAGE_KERNEL_RO); set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO); set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO); -@@ -1964,6 +1971,7 @@ static void __init xen_post_allocator_init(void) +@@ -2110,6 +2117,7 @@ static void __init xen_post_allocator_init(void) pv_mmu_ops.set_pud = xen_set_pud; #if PAGETABLE_LEVELS == 4 pv_mmu_ops.set_pgd = xen_set_pgd; @@ -27347,7 +31298,7 @@ index 69f5857..0699dc5 100644 #endif /* This will work as long as patching hasn't happened yet -@@ -2045,6 +2053,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { +@@ -2188,6 +2196,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { .pud_val = PV_CALLEE_SAVE(xen_pud_val), .make_pud = PV_CALLEE_SAVE(xen_make_pud), .set_pgd = xen_set_pgd_hyper, @@ -27356,10 +31307,10 @@ index 69f5857..0699dc5 100644 .alloc_pud = xen_alloc_pmd_init, .release_pud = xen_release_pmd_init, diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c -index 0503c0c..ceb2d16 100644 +index 22c800a..8915f1e 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c -@@ -215,11 +215,6 @@ static void __init xen_smp_prepare_boot_cpu(void) +@@ -229,11 +229,6 @@ static void __init xen_smp_prepare_boot_cpu(void) { BUG_ON(smp_processor_id() != 0); native_smp_prepare_boot_cpu(); @@ -27371,14 +31322,7 @@ index 0503c0c..ceb2d16 100644 xen_filter_cpu_maps(); xen_setup_vcpu_info_placement(); } -@@ -296,12 +291,12 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle) - gdt = get_cpu_gdt_table(cpu); - - ctxt->flags = VGCF_IN_KERNEL; -- ctxt->user_regs.ds = __USER_DS; -- ctxt->user_regs.es = __USER_DS; -+ ctxt->user_regs.ds = __KERNEL_DS; -+ ctxt->user_regs.es = __KERNEL_DS; +@@ -303,7 +298,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle) ctxt->user_regs.ss = __KERNEL_DS; #ifdef CONFIG_X86_32 ctxt->user_regs.fs = __KERNEL_PERCPU; @@ -27387,7 +31331,18 @@ index 0503c0c..ceb2d16 100644 #else ctxt->gs_base_kernel = per_cpu_offset(cpu); #endif -@@ -352,13 +347,12 @@ static int __cpuinit xen_cpu_up(unsigned int cpu) +@@ -313,8 +308,8 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle) + + { + ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */ +- ctxt->user_regs.ds = __USER_DS; +- ctxt->user_regs.es = __USER_DS; ++ ctxt->user_regs.ds = __KERNEL_DS; ++ ctxt->user_regs.es = __KERNEL_DS; + + xen_copy_trap_info(ctxt->trap_ctxt); + +@@ -359,13 +354,12 @@ static int __cpuinit xen_cpu_up(unsigned int cpu, struct task_struct *idle) int rc; per_cpu(current_task, cpu) = idle; @@ -27403,11 +31358,20 @@ index 0503c0c..ceb2d16 100644 #endif xen_setup_runstate_info(cpu); xen_setup_timer(cpu); +@@ -634,7 +628,7 @@ static const struct smp_ops xen_smp_ops __initconst = { + + void __init xen_smp_init(void) + { +- smp_ops = xen_smp_ops; ++ memcpy((void *)&smp_ops, &xen_smp_ops, sizeof smp_ops); + xen_fill_possible_map(); + xen_init_spinlocks(); + } diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S -index b040b0e..8cc4fe0 100644 +index 33ca6e4..0ded929 100644 --- a/arch/x86/xen/xen-asm_32.S +++ b/arch/x86/xen/xen-asm_32.S -@@ -83,14 +83,14 @@ ENTRY(xen_iret) +@@ -84,14 +84,14 @@ ENTRY(xen_iret) ESP_OFFSET=4 # bytes pushed onto stack /* @@ -27417,19 +31381,19 @@ index b040b0e..8cc4fe0 100644 */ #ifdef CONFIG_SMP - GET_THREAD_INFO(%eax) -- movl TI_cpu(%eax), %eax -- movl __per_cpu_offset(,%eax,4), %eax -- mov xen_vcpu(%eax), %eax +- movl %ss:TI_cpu(%eax), %eax +- movl %ss:__per_cpu_offset(,%eax,4), %eax +- mov %ss:xen_vcpu(%eax), %eax + push %fs + mov $(__KERNEL_PERCPU), %eax + mov %eax, %fs + mov PER_CPU_VAR(xen_vcpu), %eax + pop %fs #else - movl xen_vcpu, %eax + movl %ss:xen_vcpu, %eax #endif diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S -index aaa7291..3f77960 100644 +index 7faed58..ba4427c 100644 --- a/arch/x86/xen/xen-head.S +++ b/arch/x86/xen/xen-head.S @@ -19,6 +19,17 @@ ENTRY(startup_xen) @@ -27451,7 +31415,7 @@ index aaa7291..3f77960 100644 mov %rsi,xen_start_info mov $init_thread_union+THREAD_SIZE,%rsp diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h -index b095739..8c17bcd 100644 +index a95b417..b6dbd0b 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -10,8 +10,6 @@ @@ -27525,7 +31489,7 @@ index af00795..2bb8105 100644 #define XCHAL_ICACHE_SIZE 32768 /* I-cache size in bytes or 0 */ #define XCHAL_DCACHE_SIZE 32768 /* D-cache size in bytes or 0 */ diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c -index 58916af..9cb880b 100644 +index 58916af..eb9dbcf6 100644 --- a/block/blk-iopoll.c +++ b/block/blk-iopoll.c @@ -77,7 +77,7 @@ void blk_iopoll_complete(struct blk_iopoll *iopoll) @@ -27537,6 +31501,15 @@ index 58916af..9cb880b 100644 { struct list_head *list = &__get_cpu_var(blk_cpu_iopoll); int rearm = 0, budget = blk_iopoll_budget; +@@ -209,7 +209,7 @@ static int __cpuinit blk_iopoll_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata blk_iopoll_cpu_notifier = { ++static struct notifier_block blk_iopoll_cpu_notifier = { + .notifier_call = blk_iopoll_cpu_notify, + }; + diff --git a/block/blk-map.c b/block/blk-map.c index 623e1cd..ca1e109 100644 --- a/block/blk-map.c @@ -27551,7 +31524,7 @@ index 623e1cd..ca1e109 100644 bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading); else diff --git a/block/blk-softirq.c b/block/blk-softirq.c -index 467c8de..4bddc6d 100644 +index 467c8de..f3628c5 100644 --- a/block/blk-softirq.c +++ b/block/blk-softirq.c @@ -18,7 +18,7 @@ static DEFINE_PER_CPU(struct list_head, blk_cpu_done); @@ -27563,8 +31536,17 @@ index 467c8de..4bddc6d 100644 { struct list_head *cpu_list, local_list; +@@ -98,7 +98,7 @@ static int __cpuinit blk_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata blk_cpu_notifier = { ++static struct notifier_block blk_cpu_notifier = { + .notifier_call = blk_cpu_notify, + }; + diff --git a/block/bsg.c b/block/bsg.c -index ff64ae3..593560c 100644 +index 420a5a9..23834aa 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -176,16 +176,24 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq, @@ -27608,30 +31590,32 @@ index 7c668c8..db3521c 100644 err = -EFAULT; goto out; diff --git a/block/partitions/efi.c b/block/partitions/efi.c -index 6296b40..417c00f 100644 +index ff5804e..a88acad 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c @@ -234,14 +234,14 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state, if (!gpt) return NULL; -- count = le32_to_cpu(gpt->num_partition_entries) * -- le32_to_cpu(gpt->sizeof_partition_entry); -- if (!count) + if (!le32_to_cpu(gpt->num_partition_entries)) - return NULL; -- pte = kzalloc(count, GFP_KERNEL); ++ return NULL; + pte = kcalloc(le32_to_cpu(gpt->num_partition_entries), le32_to_cpu(gpt->sizeof_partition_entry), GFP_KERNEL); - if (!pte) - return NULL; - -+ count = le32_to_cpu(gpt->num_partition_entries) * -+ le32_to_cpu(gpt->sizeof_partition_entry); ++ if (!pte) ++ return NULL; ++ + count = le32_to_cpu(gpt->num_partition_entries) * + le32_to_cpu(gpt->sizeof_partition_entry); +- if (!count) +- return NULL; +- pte = kzalloc(count, GFP_KERNEL); +- if (!pte) +- return NULL; +- if (read_lba(state, le64_to_cpu(gpt->partition_entry_lba), (u8 *) pte, count) < count) { diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c -index 260fa80..e8f3caf 100644 +index 9a87daa..fb17486 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -223,8 +223,20 @@ EXPORT_SYMBOL(blk_verify_command); @@ -27686,7 +31670,7 @@ index 260fa80..e8f3caf 100644 goto error; diff --git a/crypto/cryptd.c b/crypto/cryptd.c -index 671d4d6..5f24030 100644 +index 7bdd61b..afec999 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -63,7 +63,7 @@ struct cryptd_blkcipher_ctx { @@ -27707,11 +31691,24 @@ index 671d4d6..5f24030 100644 static void cryptd_queue_worker(struct work_struct *work); +diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h +index f220d64..d359ad6 100644 +--- a/drivers/acpi/apei/apei-internal.h ++++ b/drivers/acpi/apei/apei-internal.h +@@ -20,7 +20,7 @@ typedef int (*apei_exec_ins_func_t)(struct apei_exec_context *ctx, + struct apei_exec_ins_type { + u32 flags; + apei_exec_ins_func_t run; +-}; ++} __do_const; + + struct apei_exec_context { + u32 ip; diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c -index e6defd8..c26a225 100644 +index fefc2ca..12a535d 100644 --- a/drivers/acpi/apei/cper.c +++ b/drivers/acpi/apei/cper.c -@@ -38,12 +38,12 @@ +@@ -39,12 +39,12 @@ */ u64 cper_next_record_id(void) { @@ -27728,6 +31725,45 @@ index e6defd8..c26a225 100644 } EXPORT_SYMBOL_GPL(cper_next_record_id); +diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c +index be60399..778b33e8 100644 +--- a/drivers/acpi/bgrt.c ++++ b/drivers/acpi/bgrt.c +@@ -87,8 +87,10 @@ static int __init bgrt_init(void) + return -ENODEV; + + sysfs_bin_attr_init(&image_attr); +- image_attr.private = bgrt_image; +- image_attr.size = bgrt_image_size; ++ pax_open_kernel(); ++ *(void **)&image_attr.private = bgrt_image; ++ *(size_t *)&image_attr.size = bgrt_image_size; ++ pax_close_kernel(); + + bgrt_kobj = kobject_create_and_add("bgrt", acpi_kobj); + if (!bgrt_kobj) +diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c +index cb96296..b81293b 100644 +--- a/drivers/acpi/blacklist.c ++++ b/drivers/acpi/blacklist.c +@@ -52,7 +52,7 @@ struct acpi_blacklist_item { + u32 is_critical_error; + }; + +-static struct dmi_system_id acpi_osi_dmi_table[] __initdata; ++static const struct dmi_system_id acpi_osi_dmi_table[] __initconst; + + /* + * POLICY: If *anything* doesn't work, put it on the blacklist. +@@ -193,7 +193,7 @@ static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) + return 0; + } + +-static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { ++static const struct dmi_system_id acpi_osi_dmi_table[] __initconst = { + { + .callback = dmi_disable_osi_vista, + .ident = "Fujitsu Siemens", diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c index 7586544..636a2f0 100644 --- a/drivers/acpi/ec_sys.c @@ -27781,62 +31817,55 @@ index 7586544..636a2f0 100644 err = ec_write(*off, byte_write); if (err) return err; -diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c -index 251c7b62..000462d 100644 ---- a/drivers/acpi/proc.c -+++ b/drivers/acpi/proc.c -@@ -343,19 +343,13 @@ acpi_system_write_wakeup_device(struct file *file, - size_t count, loff_t * ppos) - { - struct list_head *node, *next; -- char strbuf[5]; -- char str[5] = ""; -- unsigned int len = count; -+ char strbuf[5] = {0}; - -- if (len > 4) -- len = 4; -- if (len < 0) -+ if (count > 4) -+ count = 4; -+ if (copy_from_user(strbuf, buffer, count)) - return -EFAULT; -- -- if (copy_from_user(strbuf, buffer, len)) -- return -EFAULT; -- strbuf[len] = '\0'; -- sscanf(strbuf, "%s", str); -+ strbuf[count] = '\0'; - - mutex_lock(&acpi_device_lock); - list_for_each_safe(node, next, &acpi_wakeup_device_list) { -@@ -364,7 +358,7 @@ acpi_system_write_wakeup_device(struct file *file, - if (!dev->wakeup.flags.valid) - continue; +diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c +index ee255c6..747c68b 100644 +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -986,7 +986,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) + { + int i, count = CPUIDLE_DRIVER_STATE_START; + struct acpi_processor_cx *cx; +- struct cpuidle_state *state; ++ cpuidle_state_no_const *state; + struct cpuidle_driver *drv = &acpi_idle_driver; + + if (!pr->flags.power_setup_done) +diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c +index 41c0504..f8c0836 100644 +--- a/drivers/acpi/sysfs.c ++++ b/drivers/acpi/sysfs.c +@@ -420,11 +420,11 @@ static u32 num_counters; + static struct attribute **all_attrs; + static u32 acpi_gpe_count; + +-static struct attribute_group interrupt_stats_attr_group = { ++static attribute_group_no_const interrupt_stats_attr_group = { + .name = "interrupts", + }; -- if (!strncmp(dev->pnp.bus_id, str, 4)) { -+ if (!strncmp(dev->pnp.bus_id, strbuf, 4)) { - if (device_can_wakeup(&dev->dev)) { - bool enable = !device_may_wakeup(&dev->dev); - device_set_wakeup_enable(&dev->dev, enable); -diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c -index bbac51e..4c094f9 100644 ---- a/drivers/acpi/processor_driver.c -+++ b/drivers/acpi/processor_driver.c -@@ -556,7 +556,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) - return 0; - #endif +-static struct kobj_attribute *counter_attrs; ++static kobj_attribute_no_const *counter_attrs; -- BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0)); -+ BUG_ON(pr->id >= nr_cpu_ids); + static void delete_gpe_attr_array(void) + { +diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c +index 34c8216..f56c828 100644 +--- a/drivers/ata/libahci.c ++++ b/drivers/ata/libahci.c +@@ -1230,7 +1230,7 @@ int ahci_kick_engine(struct ata_port *ap) + } + EXPORT_SYMBOL_GPL(ahci_kick_engine); - /* - * Buggy BIOS check +-static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, ++static int __intentional_overflow(-1) ahci_exec_polled_cmd(struct ata_port *ap, int pmp, + struct ata_taskfile *tf, int is_cmd, u16 flags, + unsigned long timeout_msec) + { diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c -index d31ee55..8363a8b 100644 +index 63c743b..0422dc6 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c -@@ -4742,7 +4742,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) +@@ -4786,7 +4786,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) struct ata_port *ap; unsigned int tag; @@ -27845,7 +31874,7 @@ index d31ee55..8363a8b 100644 ap = qc->ap; qc->flags = 0; -@@ -4758,7 +4758,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) +@@ -4802,7 +4802,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) struct ata_port *ap; struct ata_link *link; @@ -27854,7 +31883,7 @@ index d31ee55..8363a8b 100644 WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); ap = qc->ap; link = qc->dev->link; -@@ -5822,6 +5822,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) +@@ -5920,6 +5920,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) return; spin_lock(&lock); @@ -27862,7 +31891,7 @@ index d31ee55..8363a8b 100644 for (cur = ops->inherits; cur; cur = cur->inherits) { void **inherit = (void **)cur; -@@ -5835,8 +5836,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) +@@ -5933,8 +5934,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) if (IS_ERR(*pp)) *pp = NULL; @@ -27874,10 +31903,10 @@ index d31ee55..8363a8b 100644 } diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c -index 3239517..343b5f6 100644 +index 405022d..fb70e53 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c -@@ -862,7 +862,9 @@ static int __devinit arasan_cf_probe(struct platform_device *pdev) +@@ -864,7 +864,9 @@ static int arasan_cf_probe(struct platform_device *pdev) /* Handle platform specific quirks */ if (pdata->quirk) { if (pdata->quirk & CF_BROKEN_PIO) { @@ -27902,7 +31931,7 @@ index f9b983a..887b9d8 100644 return 0; } diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c -index f8f41e0..1f987dd 100644 +index 77a7480..05cde58 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c @@ -454,7 +454,7 @@ static void tx_complete (amb_dev * dev, tx_out * tx) { @@ -27942,10 +31971,10 @@ index f8f41e0..1f987dd 100644 } diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c -index b22d71c..d6e1049 100644 +index 0e3f8f9..765a7a5 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c -@@ -207,7 +207,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) +@@ -206,7 +206,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) if (vcc->pop) vcc->pop(vcc,skb); else dev_kfree_skb(skb); if (dev_data) return 0; @@ -27954,7 +31983,7 @@ index b22d71c..d6e1049 100644 return -ENOLINK; } size = skb->len+sizeof(struct atmtcp_hdr); -@@ -215,7 +215,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) +@@ -214,7 +214,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) if (!new_skb) { if (vcc->pop) vcc->pop(vcc,skb); else dev_kfree_skb(skb); @@ -27963,7 +31992,7 @@ index b22d71c..d6e1049 100644 return -ENOBUFS; } hdr = (void *) skb_put(new_skb,sizeof(struct atmtcp_hdr)); -@@ -226,8 +226,8 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) +@@ -225,8 +225,8 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) if (vcc->pop) vcc->pop(vcc,skb); else dev_kfree_skb(skb); out_vcc->push(out_vcc,new_skb); @@ -27974,7 +32003,7 @@ index b22d71c..d6e1049 100644 return 0; } -@@ -301,7 +301,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) +@@ -299,7 +299,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) out_vcc = find_vcc(dev, ntohs(hdr->vpi), ntohs(hdr->vci)); read_unlock(&vcc_sklist_lock); if (!out_vcc) { @@ -27983,7 +32012,7 @@ index b22d71c..d6e1049 100644 goto done; } skb_pull(skb,sizeof(struct atmtcp_hdr)); -@@ -313,8 +313,8 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) +@@ -311,8 +311,8 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) __net_timestamp(new_skb); skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len); out_vcc->push(out_vcc,new_skb); @@ -27995,7 +32024,7 @@ index b22d71c..d6e1049 100644 if (vcc->pop) vcc->pop(vcc,skb); else dev_kfree_skb(skb); diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c -index 2059ee4..faf51c7 100644 +index b1955ba..b179940 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -522,7 +522,7 @@ static int rx_aal0(struct atm_vcc *vcc) @@ -28043,17 +32072,8 @@ index 2059ee4..faf51c7 100644 wake_up(&eni_dev->tx_wait); dma_complete++; } -@@ -1567,7 +1567,7 @@ tx_complete++; - /*--------------------------------- entries ---------------------------------*/ - - --static const char *media_name[] __devinitdata = { -+static const char *media_name[] __devinitconst = { - "MMF", "SMF", "MMF", "03?", /* 0- 3 */ - "UTP", "05?", "06?", "07?", /* 4- 7 */ - "TAXI","09?", "10?", "11?", /* 8-11 */ diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c -index 86fed1b..6dc4721 100644 +index b41c948..a002b17 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -749,7 +749,7 @@ static void process_txdone_queue (struct fs_dev *dev, struct queue *q) @@ -28090,10 +32110,10 @@ index 86fed1b..6dc4721 100644 default: /* Hmm. Haven't written the code to handle the others yet... -- REW */ printk (KERN_WARNING "Don't know what to do with RX status %x: %s.\n", diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c -index 361f5ae..7fc552d 100644 +index 204814e..cede831 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c -@@ -933,9 +933,9 @@ fore200e_tx_irq(struct fore200e* fore200e) +@@ -931,9 +931,9 @@ fore200e_tx_irq(struct fore200e* fore200e) #endif /* check error condition */ if (*entry->status & STATUS_ERROR) @@ -28105,7 +32125,7 @@ index 361f5ae..7fc552d 100644 } } -@@ -1084,7 +1084,7 @@ fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rp +@@ -1082,7 +1082,7 @@ fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rp if (skb == NULL) { DPRINTK(2, "unable to alloc new skb, rx PDU length = %d\n", pdu_len); @@ -28114,7 +32134,7 @@ index 361f5ae..7fc552d 100644 return -ENOMEM; } -@@ -1127,14 +1127,14 @@ fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rp +@@ -1125,14 +1125,14 @@ fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rp dev_kfree_skb_any(skb); @@ -28131,7 +32151,7 @@ index 361f5ae..7fc552d 100644 ASSERT(atomic_read(&sk_atm(vcc)->sk_wmem_alloc) >= 0); -@@ -1212,7 +1212,7 @@ fore200e_rx_irq(struct fore200e* fore200e) +@@ -1210,7 +1210,7 @@ fore200e_rx_irq(struct fore200e* fore200e) DPRINTK(2, "damaged PDU on %d.%d.%d\n", fore200e->atm_dev->number, entry->rpd->atm_header.vpi, entry->rpd->atm_header.vci); @@ -28140,7 +32160,7 @@ index 361f5ae..7fc552d 100644 } } -@@ -1657,7 +1657,7 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -1655,7 +1655,7 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb) goto retry_here; } @@ -28150,10 +32170,10 @@ index 361f5ae..7fc552d 100644 fore200e->tx_sat++; DPRINTK(2, "tx queue of device %s is saturated, PDU dropped - heartbeat is %08x\n", diff --git a/drivers/atm/he.c b/drivers/atm/he.c -index b182c2f..1c6fa8a 100644 +index d689126..e78e412 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c -@@ -1709,7 +1709,7 @@ he_service_rbrq(struct he_dev *he_dev, int group) +@@ -1698,7 +1698,7 @@ he_service_rbrq(struct he_dev *he_dev, int group) if (RBRQ_HBUF_ERR(he_dev->rbrq_head)) { hprintk("HBUF_ERR! (cid 0x%x)\n", cid); @@ -28162,7 +32182,7 @@ index b182c2f..1c6fa8a 100644 goto return_host_buffers; } -@@ -1736,7 +1736,7 @@ he_service_rbrq(struct he_dev *he_dev, int group) +@@ -1725,7 +1725,7 @@ he_service_rbrq(struct he_dev *he_dev, int group) RBRQ_LEN_ERR(he_dev->rbrq_head) ? "LEN_ERR" : "", vcc->vpi, vcc->vci); @@ -28171,7 +32191,7 @@ index b182c2f..1c6fa8a 100644 goto return_host_buffers; } -@@ -1788,7 +1788,7 @@ he_service_rbrq(struct he_dev *he_dev, int group) +@@ -1777,7 +1777,7 @@ he_service_rbrq(struct he_dev *he_dev, int group) vcc->push(vcc, skb); spin_lock(&he_dev->global_lock); @@ -28180,7 +32200,7 @@ index b182c2f..1c6fa8a 100644 return_host_buffers: ++pdus_assembled; -@@ -2114,7 +2114,7 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid) +@@ -2103,7 +2103,7 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid) tpd->vcc->pop(tpd->vcc, tpd->skb); else dev_kfree_skb_any(tpd->skb); @@ -28189,7 +32209,7 @@ index b182c2f..1c6fa8a 100644 } pci_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status)); return; -@@ -2526,7 +2526,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -2515,7 +2515,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) vcc->pop(vcc, skb); else dev_kfree_skb_any(skb); @@ -28198,7 +32218,7 @@ index b182c2f..1c6fa8a 100644 return -EINVAL; } -@@ -2537,7 +2537,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -2526,7 +2526,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) vcc->pop(vcc, skb); else dev_kfree_skb_any(skb); @@ -28207,7 +32227,7 @@ index b182c2f..1c6fa8a 100644 return -EINVAL; } #endif -@@ -2549,7 +2549,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -2538,7 +2538,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) vcc->pop(vcc, skb); else dev_kfree_skb_any(skb); @@ -28216,7 +32236,7 @@ index b182c2f..1c6fa8a 100644 spin_unlock_irqrestore(&he_dev->global_lock, flags); return -ENOMEM; } -@@ -2591,7 +2591,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -2580,7 +2580,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) vcc->pop(vcc, skb); else dev_kfree_skb_any(skb); @@ -28225,7 +32245,7 @@ index b182c2f..1c6fa8a 100644 spin_unlock_irqrestore(&he_dev->global_lock, flags); return -ENOMEM; } -@@ -2622,7 +2622,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -2611,7 +2611,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb) __enqueue_tpd(he_dev, tpd, cid); spin_unlock_irqrestore(&he_dev->global_lock, flags); @@ -28235,7 +32255,7 @@ index b182c2f..1c6fa8a 100644 return 0; } diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c -index 75fd691..2d20b14 100644 +index 1dc0519..1aadaf7 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c @@ -1034,7 +1034,7 @@ static void rx_schedule (hrz_dev * dev, int irq) { @@ -28257,7 +32277,7 @@ index 75fd691..2d20b14 100644 // free the skb hrz_kfree_skb (skb); diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c -index 1c05212..c28e200 100644 +index 272f009..a18ba55 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -812,7 +812,7 @@ drain_scq(struct idt77252_dev *card, struct vc_map *vc) @@ -28415,7 +32435,7 @@ index 1c05212..c28e200 100644 } atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c -index d438601..8b98495 100644 +index 4217f29..88f547a 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -1145,7 +1145,7 @@ static int rx_pkt(struct atm_dev *dev) @@ -28515,7 +32535,7 @@ index d438601..8b98495 100644 vcc->tx_quota = vcc->tx_quota * 3 / 4; printk("Tx1: vcc->tx_quota = %d \n", (u32)vcc->tx_quota ); diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c -index 68c7588..7036683 100644 +index fa7d701..1e404c7 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1303,7 +1303,7 @@ static void lanai_send_one_aal5(struct lanai_dev *lanai, @@ -28573,10 +32593,10 @@ index 68c7588..7036683 100644 lvcc->rx.buf.ptr = &lvcc->rx.buf.start[SERVICE_GET_END(s) * 4]; cardvcc_write(lvcc, SERVICE_GET_END(s), vcc_rxreadptr); diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c -index 1c70c45..300718d 100644 +index 6587dc2..149833d 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c -@@ -1654,7 +1654,7 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -1641,7 +1641,7 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) if ((vc = (vc_map *) vcc->dev_data) == NULL) { printk("nicstar%d: vcc->dev_data == NULL on ns_send().\n", card->index); @@ -28585,7 +32605,7 @@ index 1c70c45..300718d 100644 dev_kfree_skb_any(skb); return -EINVAL; } -@@ -1662,7 +1662,7 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -1649,7 +1649,7 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) if (!vc->tx) { printk("nicstar%d: Trying to transmit on a non-tx VC.\n", card->index); @@ -28594,7 +32614,7 @@ index 1c70c45..300718d 100644 dev_kfree_skb_any(skb); return -EINVAL; } -@@ -1670,14 +1670,14 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -1657,14 +1657,14 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) if (vcc->qos.aal != ATM_AAL5 && vcc->qos.aal != ATM_AAL0) { printk("nicstar%d: Only AAL0 and AAL5 are supported.\n", card->index); @@ -28611,7 +32631,7 @@ index 1c70c45..300718d 100644 dev_kfree_skb_any(skb); return -EINVAL; } -@@ -1725,11 +1725,11 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) +@@ -1712,11 +1712,11 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) } if (push_scqe(card, vc, scq, &scqe, skb) != 0) { @@ -28625,7 +32645,7 @@ index 1c70c45..300718d 100644 return 0; } -@@ -2046,14 +2046,14 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2033,14 +2033,14 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) printk ("nicstar%d: Can't allocate buffers for aal0.\n", card->index); @@ -28642,7 +32662,7 @@ index 1c70c45..300718d 100644 dev_kfree_skb_any(sb); break; } -@@ -2068,7 +2068,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2055,7 +2055,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) ATM_SKB(sb)->vcc = vcc; __net_timestamp(sb); vcc->push(vcc, sb); @@ -28651,7 +32671,7 @@ index 1c70c45..300718d 100644 cell += ATM_CELL_PAYLOAD; } -@@ -2085,7 +2085,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2072,7 +2072,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) if (iovb == NULL) { printk("nicstar%d: Out of iovec buffers.\n", card->index); @@ -28660,7 +32680,7 @@ index 1c70c45..300718d 100644 recycle_rx_buf(card, skb); return; } -@@ -2109,7 +2109,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2096,7 +2096,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) small or large buffer itself. */ } else if (NS_PRV_IOVCNT(iovb) >= NS_MAX_IOVECS) { printk("nicstar%d: received too big AAL5 SDU.\n", card->index); @@ -28669,7 +32689,7 @@ index 1c70c45..300718d 100644 recycle_iovec_rx_bufs(card, (struct iovec *)iovb->data, NS_MAX_IOVECS); NS_PRV_IOVCNT(iovb) = 0; -@@ -2129,7 +2129,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2116,7 +2116,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) ("nicstar%d: Expected a small buffer, and this is not one.\n", card->index); which_list(card, skb); @@ -28678,7 +32698,7 @@ index 1c70c45..300718d 100644 recycle_rx_buf(card, skb); vc->rx_iov = NULL; recycle_iov_buf(card, iovb); -@@ -2142,7 +2142,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2129,7 +2129,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) ("nicstar%d: Expected a large buffer, and this is not one.\n", card->index); which_list(card, skb); @@ -28687,7 +32707,7 @@ index 1c70c45..300718d 100644 recycle_iovec_rx_bufs(card, (struct iovec *)iovb->data, NS_PRV_IOVCNT(iovb)); vc->rx_iov = NULL; -@@ -2165,7 +2165,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2152,7 +2152,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) printk(" - PDU size mismatch.\n"); else printk(".\n"); @@ -28696,7 +32716,7 @@ index 1c70c45..300718d 100644 recycle_iovec_rx_bufs(card, (struct iovec *)iovb->data, NS_PRV_IOVCNT(iovb)); vc->rx_iov = NULL; -@@ -2179,7 +2179,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2166,7 +2166,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) /* skb points to a small buffer */ if (!atm_charge(vcc, skb->truesize)) { push_rxbufs(card, skb); @@ -28705,7 +32725,7 @@ index 1c70c45..300718d 100644 } else { skb_put(skb, len); dequeue_sm_buf(card, skb); -@@ -2189,7 +2189,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2176,7 +2176,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) ATM_SKB(skb)->vcc = vcc; __net_timestamp(skb); vcc->push(vcc, skb); @@ -28714,7 +32734,7 @@ index 1c70c45..300718d 100644 } } else if (NS_PRV_IOVCNT(iovb) == 2) { /* One small plus one large buffer */ struct sk_buff *sb; -@@ -2200,7 +2200,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2187,7 +2187,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) if (len <= NS_SMBUFSIZE) { if (!atm_charge(vcc, sb->truesize)) { push_rxbufs(card, sb); @@ -28723,7 +32743,7 @@ index 1c70c45..300718d 100644 } else { skb_put(sb, len); dequeue_sm_buf(card, sb); -@@ -2210,7 +2210,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2197,7 +2197,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) ATM_SKB(sb)->vcc = vcc; __net_timestamp(sb); vcc->push(vcc, sb); @@ -28732,7 +32752,7 @@ index 1c70c45..300718d 100644 } push_rxbufs(card, skb); -@@ -2219,7 +2219,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2206,7 +2206,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) if (!atm_charge(vcc, skb->truesize)) { push_rxbufs(card, skb); @@ -28741,7 +32761,7 @@ index 1c70c45..300718d 100644 } else { dequeue_lg_buf(card, skb); #ifdef NS_USE_DESTRUCTORS -@@ -2232,7 +2232,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2219,7 +2219,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) ATM_SKB(skb)->vcc = vcc; __net_timestamp(skb); vcc->push(vcc, skb); @@ -28750,7 +32770,7 @@ index 1c70c45..300718d 100644 } push_rxbufs(card, sb); -@@ -2253,7 +2253,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2240,7 +2240,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) printk ("nicstar%d: Out of huge buffers.\n", card->index); @@ -28759,7 +32779,7 @@ index 1c70c45..300718d 100644 recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, -@@ -2304,7 +2304,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2291,7 +2291,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) card->hbpool.count++; } else dev_kfree_skb_any(hb); @@ -28768,7 +32788,7 @@ index 1c70c45..300718d 100644 } else { /* Copy the small buffer to the huge buffer */ sb = (struct sk_buff *)iov->iov_base; -@@ -2341,7 +2341,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) +@@ -2328,7 +2328,7 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe) #endif /* NS_USE_DESTRUCTORS */ __net_timestamp(hb); vcc->push(vcc, hb); @@ -28778,10 +32798,10 @@ index 1c70c45..300718d 100644 } diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c -index 9851093..adb2b1e 100644 +index 32784d1..4a8434a 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c -@@ -714,7 +714,7 @@ void solos_bh(unsigned long card_arg) +@@ -838,7 +838,7 @@ void solos_bh(unsigned long card_arg) } atm_charge(vcc, skb->truesize); vcc->push(vcc, skb); @@ -28790,14 +32810,14 @@ index 9851093..adb2b1e 100644 break; case PKT_STATUS: -@@ -1009,7 +1009,7 @@ static uint32_t fpga_tx(struct solos_card *card) +@@ -1116,7 +1116,7 @@ static uint32_t fpga_tx(struct solos_card *card) vcc = SKB_CB(oldskb)->vcc; if (vcc) { - atomic_inc(&vcc->stats->tx); + atomic_inc_unchecked(&vcc->stats->tx); solos_pop(vcc, oldskb); - } else + } else { dev_kfree_skb_irq(oldskb); diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c index 0215934..ce9f5b1 100644 @@ -28863,7 +32883,7 @@ index 5120a96..e2572bd 100644 } diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c -index abe4e20..83c4727 100644 +index 969c3c2..9b72956 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c @@ -459,7 +459,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]); @@ -28893,11 +32913,33 @@ index abe4e20..83c4727 100644 wake_up(&zatm_vcc->tx_wait); } +diff --git a/drivers/base/bus.c b/drivers/base/bus.c +index 519865b..e540db3 100644 +--- a/drivers/base/bus.c ++++ b/drivers/base/bus.c +@@ -1163,7 +1163,7 @@ int subsys_interface_register(struct subsys_interface *sif) + return -EINVAL; + + mutex_lock(&subsys->p->mutex); +- list_add_tail(&sif->node, &subsys->p->interfaces); ++ pax_list_add_tail((struct list_head *)&sif->node, &subsys->p->interfaces); + if (sif->add_dev) { + subsys_dev_iter_init(&iter, subsys, NULL, NULL); + while ((dev = subsys_dev_iter_next(&iter))) +@@ -1188,7 +1188,7 @@ void subsys_interface_unregister(struct subsys_interface *sif) + subsys = sif->subsys; + + mutex_lock(&subsys->p->mutex); +- list_del_init(&sif->node); ++ pax_list_del_init((struct list_head *)&sif->node); + if (sif->remove_dev) { + subsys_dev_iter_init(&iter, subsys, NULL, NULL); + while ((dev = subsys_dev_iter_next(&iter))) diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c -index 8493536..31adee0 100644 +index 01fc5b0..d0ed716 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c -@@ -368,7 +368,7 @@ int devtmpfs_mount(const char *mntdir) +@@ -348,7 +348,7 @@ int devtmpfs_mount(const char *mntdir) if (!thread) return 0; @@ -28907,29 +32949,45 @@ index 8493536..31adee0 100644 printk(KERN_INFO "devtmpfs: error mounting %i\n", err); else diff --git a/drivers/base/node.c b/drivers/base/node.c -index 90aa2a1..af1a177 100644 +index fac124a..66bd4ab 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c -@@ -592,11 +592,9 @@ static ssize_t print_nodes_state(enum node_states state, char *buf) - { - int n; +@@ -625,7 +625,7 @@ static ssize_t print_nodes_state(enum node_states state, char *buf) + struct node_attr { + struct device_attribute attr; + enum node_states state; +-}; ++} __do_const; -- n = nodelist_scnprintf(buf, PAGE_SIZE, node_states[state]); -- if (n > 0 && PAGE_SIZE > n + 1) { -- *(buf + n++) = '\n'; -- *(buf + n++) = '\0'; -- } -+ n = nodelist_scnprintf(buf, PAGE_SIZE-2, node_states[state]); -+ buf[n++] = '\n'; -+ buf[n] = '\0'; - return n; - } + static ssize_t show_node_state(struct device *dev, + struct device_attribute *attr, char *buf) +diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c +index 9a6b05a..2fc8fb9 100644 +--- a/drivers/base/power/domain.c ++++ b/drivers/base/power/domain.c +@@ -1850,7 +1850,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) + { + struct cpuidle_driver *cpuidle_drv; + struct gpd_cpu_data *cpu_data; +- struct cpuidle_state *idle_state; ++ cpuidle_state_no_const *idle_state; + int ret = 0; + + if (IS_ERR_OR_NULL(genpd) || state < 0) +@@ -1918,7 +1918,7 @@ int pm_genpd_name_attach_cpuidle(const char *name, int state) + int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) + { + struct gpd_cpu_data *cpu_data; +- struct cpuidle_state *idle_state; ++ cpuidle_state_no_const *idle_state; + int ret = 0; + if (IS_ERR_OR_NULL(genpd)) diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c -index 2a3e581..3d6a73f 100644 +index 79715e7..df06b3b 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c -@@ -30,14 +30,14 @@ bool events_check_enabled; +@@ -29,14 +29,14 @@ bool events_check_enabled __read_mostly; * They need to be modified together atomically, so it's better to use one * atomic variable to hold them both. */ @@ -28946,29 +33004,51 @@ index 2a3e581..3d6a73f 100644 *cnt = (comb >> IN_PROGRESS_BITS); *inpr = comb & MAX_IN_PROGRESS; -@@ -379,7 +379,7 @@ static void wakeup_source_activate(struct wakeup_source *ws) - ws->last_time = ktime_get(); +@@ -395,7 +395,7 @@ static void wakeup_source_activate(struct wakeup_source *ws) + ws->start_prevent_time = ws->last_time; /* Increment the counter of events in progress. */ -- atomic_inc(&combined_event_count); -+ atomic_inc_unchecked(&combined_event_count); - } +- cec = atomic_inc_return(&combined_event_count); ++ cec = atomic_inc_return_unchecked(&combined_event_count); - /** -@@ -475,7 +475,7 @@ static void wakeup_source_deactivate(struct wakeup_source *ws) + trace_wakeup_source_activate(ws->name, cec); + } +@@ -521,7 +521,7 @@ static void wakeup_source_deactivate(struct wakeup_source *ws) * Increment the counter of registered wakeup events and decrement the * couter of wakeup events in progress simultaneously. */ -- atomic_add(MAX_IN_PROGRESS, &combined_event_count); -+ atomic_add_unchecked(MAX_IN_PROGRESS, &combined_event_count); - } - - /** +- cec = atomic_add_return(MAX_IN_PROGRESS, &combined_event_count); ++ cec = atomic_add_return_unchecked(MAX_IN_PROGRESS, &combined_event_count); + trace_wakeup_source_deactivate(ws->name, cec); + + split_counters(&cnt, &inpr); +diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c +index e8d11b6..7b1b36f 100644 +--- a/drivers/base/syscore.c ++++ b/drivers/base/syscore.c +@@ -21,7 +21,7 @@ static DEFINE_MUTEX(syscore_ops_lock); + void register_syscore_ops(struct syscore_ops *ops) + { + mutex_lock(&syscore_ops_lock); +- list_add_tail(&ops->node, &syscore_ops_list); ++ pax_list_add_tail((struct list_head *)&ops->node, &syscore_ops_list); + mutex_unlock(&syscore_ops_lock); + } + EXPORT_SYMBOL_GPL(register_syscore_ops); +@@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(register_syscore_ops); + void unregister_syscore_ops(struct syscore_ops *ops) + { + mutex_lock(&syscore_ops_lock); +- list_del(&ops->node); ++ pax_list_del((struct list_head *)&ops->node); + mutex_unlock(&syscore_ops_lock); + } + EXPORT_SYMBOL_GPL(unregister_syscore_ops); diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c -index b0f553b..77b928b 100644 +index 1c1b8e5..b7fc681 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c -@@ -1198,6 +1198,8 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode, +@@ -1196,6 +1196,8 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode, int err; u32 cp; @@ -28977,7 +33057,7 @@ index b0f553b..77b928b 100644 err = 0; err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, -@@ -3007,7 +3009,7 @@ static void start_io(ctlr_info_t *h) +@@ -3005,7 +3007,7 @@ static void start_io(ctlr_info_t *h) while (!list_empty(&h->reqQ)) { c = list_entry(h->reqQ.next, CommandList_struct, list); /* can't do anything if fifo is full */ @@ -28986,7 +33066,7 @@ index b0f553b..77b928b 100644 dev_warn(&h->pdev->dev, "fifo full\n"); break; } -@@ -3017,7 +3019,7 @@ static void start_io(ctlr_info_t *h) +@@ -3015,7 +3017,7 @@ static void start_io(ctlr_info_t *h) h->Qdepth--; /* Tell the controller execute command */ @@ -28995,7 +33075,7 @@ index b0f553b..77b928b 100644 /* Put job onto the completed Q */ addQ(&h->cmpQ, c); -@@ -3443,17 +3445,17 @@ startio: +@@ -3441,17 +3443,17 @@ startio: static inline unsigned long get_next_completion(ctlr_info_t *h) { @@ -29016,7 +33096,7 @@ index b0f553b..77b928b 100644 (h->interrupts_enabled == 0)); } -@@ -3486,7 +3488,7 @@ static inline u32 next_command(ctlr_info_t *h) +@@ -3484,7 +3486,7 @@ static inline u32 next_command(ctlr_info_t *h) u32 a; if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant))) @@ -29025,7 +33105,7 @@ index b0f553b..77b928b 100644 if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) { a = *(h->reply_pool_head); /* Next cmd in ring buffer */ -@@ -4044,7 +4046,7 @@ static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h) +@@ -4041,7 +4043,7 @@ static void cciss_put_controller_into_performant_mode(ctlr_info_t *h) trans_support & CFGTBL_Trans_use_short_tags); /* Change the access methods to the performant access methods */ @@ -29034,7 +33114,7 @@ index b0f553b..77b928b 100644 h->transMethod = CFGTBL_Trans_Performant; return; -@@ -4316,7 +4318,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *h) +@@ -4310,7 +4312,7 @@ static int cciss_pci_init(ctlr_info_t *h) if (prod_index < 0) return -ENODEV; h->product_name = products[prod_index].product_name; @@ -29043,7 +33123,7 @@ index b0f553b..77b928b 100644 if (cciss_board_disabled(h)) { dev_warn(&h->pdev->dev, "controller appears to be disabled\n"); -@@ -5041,7 +5043,7 @@ reinit_after_soft_reset: +@@ -5032,7 +5034,7 @@ reinit_after_soft_reset: } /* make sure the board interrupts are off */ @@ -29052,7 +33132,7 @@ index b0f553b..77b928b 100644 rc = cciss_request_irq(h, do_cciss_msix_intr, do_cciss_intx); if (rc) goto clean2; -@@ -5093,7 +5095,7 @@ reinit_after_soft_reset: +@@ -5082,7 +5084,7 @@ reinit_after_soft_reset: * fake ones to scoop up any residual completions. */ spin_lock_irqsave(&h->lock, flags); @@ -29061,7 +33141,7 @@ index b0f553b..77b928b 100644 spin_unlock_irqrestore(&h->lock, flags); free_irq(h->intr[h->intr_mode], h); rc = cciss_request_irq(h, cciss_msix_discard_completions, -@@ -5113,9 +5115,9 @@ reinit_after_soft_reset: +@@ -5102,9 +5104,9 @@ reinit_after_soft_reset: dev_info(&h->pdev->dev, "Board READY.\n"); dev_info(&h->pdev->dev, "Waiting for stale completions to drain.\n"); @@ -29073,7 +33153,7 @@ index b0f553b..77b928b 100644 rc = controller_reset_failed(h->cfgtable); if (rc) -@@ -5138,7 +5140,7 @@ reinit_after_soft_reset: +@@ -5127,7 +5129,7 @@ reinit_after_soft_reset: cciss_scsi_setup(h); /* Turn the interrupts on so we can service requests */ @@ -29082,7 +33162,7 @@ index b0f553b..77b928b 100644 /* Get the firmware version */ inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL); -@@ -5211,7 +5213,7 @@ static void cciss_shutdown(struct pci_dev *pdev) +@@ -5199,7 +5201,7 @@ static void cciss_shutdown(struct pci_dev *pdev) kfree(flush_buf); if (return_code != IO_OK) dev_warn(&h->pdev->dev, "Error flushing cache\n"); @@ -29105,10 +33185,10 @@ index 7fda30e..eb5dfe0 100644 /* queue and queue Info */ struct list_head reqQ; diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c -index 9125bbe..eede5c8 100644 +index 3f08713..56a586a 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c -@@ -404,7 +404,7 @@ static int __devinit cpqarray_register_ctlr( int i, struct pci_dev *pdev) +@@ -404,7 +404,7 @@ static int cpqarray_register_ctlr(int i, struct pci_dev *pdev) if (register_blkdev(COMPAQ_SMART2_MAJOR+i, hba[i]->devname)) { goto Enomem4; } @@ -29117,7 +33197,7 @@ index 9125bbe..eede5c8 100644 if (request_irq(hba[i]->intr, do_ida_intr, IRQF_DISABLED|IRQF_SHARED, hba[i]->devname, hba[i])) { -@@ -459,7 +459,7 @@ static int __devinit cpqarray_register_ctlr( int i, struct pci_dev *pdev) +@@ -459,7 +459,7 @@ static int cpqarray_register_ctlr(int i, struct pci_dev *pdev) add_timer(&hba[i]->timer); /* Enable IRQ now that spinlock and rate limit timer are set up */ @@ -29135,7 +33215,7 @@ index 9125bbe..eede5c8 100644 break; } } -@@ -792,7 +792,7 @@ static int __devinit cpqarray_eisa_detect(void) +@@ -792,7 +792,7 @@ static int cpqarray_eisa_detect(void) hba[ctlr]->intr = intr; sprintf(hba[ctlr]->devname, "ida%d", nr_ctlr); hba[ctlr]->product_name = products[j].product_name; @@ -29238,11 +33318,11 @@ index be73e9d..7fbf140 100644 cmdlist_t *reqQ; cmdlist_t *cmpQ; diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h -index 8d68056..e67050f 100644 +index 6b51afa..17e1191 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h -@@ -736,7 +736,7 @@ struct drbd_request; - struct drbd_epoch { +@@ -582,7 +582,7 @@ struct drbd_epoch { + struct drbd_tconn *tconn; struct list_head list; unsigned int barrier_nr; - atomic_t epoch_size; /* increased on every request added. */ @@ -29250,159 +33330,71 @@ index 8d68056..e67050f 100644 atomic_t active; /* increased on every req. added, and dec on every finished. */ unsigned long flags; }; -@@ -1108,7 +1108,7 @@ struct drbd_conf { - void *int_dig_in; - void *int_dig_vv; +@@ -1011,7 +1011,7 @@ struct drbd_conf { + int al_tr_cycle; + int al_tr_pos; /* position of the next transaction in the journal */ wait_queue_head_t seq_wait; - atomic_t packet_seq; + atomic_unchecked_t packet_seq; unsigned int peer_seq; spinlock_t peer_seq_lock; unsigned int minor; -@@ -1617,30 +1617,30 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname, - - static inline void drbd_tcp_cork(struct socket *sock) - { -- int __user val = 1; -+ int val = 1; - (void) drbd_setsockopt(sock, SOL_TCP, TCP_CORK, -- (char __user *)&val, sizeof(val)); -+ (char __force_user *)&val, sizeof(val)); - } - - static inline void drbd_tcp_uncork(struct socket *sock) - { -- int __user val = 0; -+ int val = 0; - (void) drbd_setsockopt(sock, SOL_TCP, TCP_CORK, -- (char __user *)&val, sizeof(val)); -+ (char __force_user *)&val, sizeof(val)); - } - - static inline void drbd_tcp_nodelay(struct socket *sock) - { -- int __user val = 1; -+ int val = 1; - (void) drbd_setsockopt(sock, SOL_TCP, TCP_NODELAY, -- (char __user *)&val, sizeof(val)); -+ (char __force_user *)&val, sizeof(val)); - } +@@ -1527,7 +1527,7 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname, + char __user *uoptval; + int err; - static inline void drbd_tcp_quickack(struct socket *sock) - { -- int __user val = 2; -+ int val = 2; - (void) drbd_setsockopt(sock, SOL_TCP, TCP_QUICKACK, -- (char __user *)&val, sizeof(val)); -+ (char __force_user *)&val, sizeof(val)); - } +- uoptval = (char __user __force *)optval; ++ uoptval = (char __force_user *)optval; - void drbd_bump_write_ordering(struct drbd_conf *mdev, enum write_ordering_e wo); + set_fs(KERNEL_DS); + if (level == SOL_SOCKET) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c -index 211fc44..c5116f1 100644 +index 54d03d4..332f311 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c -@@ -2397,7 +2397,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packets cmd, - p.sector = sector; - p.block_id = block_id; - p.blksize = blksize; -- p.seq_num = cpu_to_be32(atomic_add_return(1, &mdev->packet_seq)); -+ p.seq_num = cpu_to_be32(atomic_add_return_unchecked(1, &mdev->packet_seq)); - - if (!mdev->meta.socket || mdev->state.conn < C_CONNECTED) - return false; -@@ -2696,7 +2696,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req) - p.sector = cpu_to_be64(req->sector); - p.block_id = (unsigned long)req; - p.seq_num = cpu_to_be32(req->seq_num = -- atomic_add_return(1, &mdev->packet_seq)); -+ atomic_add_return_unchecked(1, &mdev->packet_seq)); +@@ -1317,7 +1317,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd, + p->sector = sector; + p->block_id = block_id; + p->blksize = blksize; +- p->seq_num = cpu_to_be32(atomic_inc_return(&mdev->packet_seq)); ++ p->seq_num = cpu_to_be32(atomic_inc_return_unchecked(&mdev->packet_seq)); + return drbd_send_command(mdev, sock, cmd, sizeof(*p), NULL, 0); + } +@@ -1619,7 +1619,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req) + return -EIO; + p->sector = cpu_to_be64(req->i.sector); + p->block_id = (unsigned long)req; +- p->seq_num = cpu_to_be32(atomic_inc_return(&mdev->packet_seq)); ++ p->seq_num = cpu_to_be32(atomic_inc_return_unchecked(&mdev->packet_seq)); dp_flags = bio_flags_to_wire(mdev, req->master_bio->bi_rw); + if (mdev->state.conn >= C_SYNC_SOURCE && + mdev->state.conn <= C_PAUSED_SYNC_T) +@@ -2574,8 +2574,8 @@ void conn_destroy(struct kref *kref) + { + struct drbd_tconn *tconn = container_of(kref, struct drbd_tconn, kref); -@@ -2981,7 +2981,7 @@ void drbd_init_set_defaults(struct drbd_conf *mdev) - atomic_set(&mdev->unacked_cnt, 0); - atomic_set(&mdev->local_cnt, 0); - atomic_set(&mdev->net_cnt, 0); -- atomic_set(&mdev->packet_seq, 0); -+ atomic_set_unchecked(&mdev->packet_seq, 0); - atomic_set(&mdev->pp_in_use, 0); - atomic_set(&mdev->pp_in_use_by_net, 0); - atomic_set(&mdev->rs_sect_in, 0); -@@ -3063,8 +3063,8 @@ void drbd_mdev_cleanup(struct drbd_conf *mdev) - mdev->receiver.t_state); - - /* no need to lock it, I'm the only thread alive */ -- if (atomic_read(&mdev->current_epoch->epoch_size) != 0) -- dev_err(DEV, "epoch_size:%d\n", atomic_read(&mdev->current_epoch->epoch_size)); -+ if (atomic_read_unchecked(&mdev->current_epoch->epoch_size) != 0) -+ dev_err(DEV, "epoch_size:%d\n", atomic_read_unchecked(&mdev->current_epoch->epoch_size)); - mdev->al_writ_cnt = - mdev->bm_writ_cnt = - mdev->read_cnt = -diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c -index 946166e..356b39a 100644 ---- a/drivers/block/drbd/drbd_nl.c -+++ b/drivers/block/drbd/drbd_nl.c -@@ -2359,7 +2359,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms - module_put(THIS_MODULE); - } - --static atomic_t drbd_nl_seq = ATOMIC_INIT(2); /* two. */ -+static atomic_unchecked_t drbd_nl_seq = ATOMIC_INIT(2); /* two. */ - - static unsigned short * - __tl_add_blob(unsigned short *tl, enum drbd_tags tag, const void *data, -@@ -2430,7 +2430,7 @@ void drbd_bcast_state(struct drbd_conf *mdev, union drbd_state state) - cn_reply->id.idx = CN_IDX_DRBD; - cn_reply->id.val = CN_VAL_DRBD; - -- cn_reply->seq = atomic_add_return(1, &drbd_nl_seq); -+ cn_reply->seq = atomic_add_return_unchecked(1, &drbd_nl_seq); - cn_reply->ack = 0; /* not used here. */ - cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + - (int)((char *)tl - (char *)reply->tag_list); -@@ -2462,7 +2462,7 @@ void drbd_bcast_ev_helper(struct drbd_conf *mdev, char *helper_name) - cn_reply->id.idx = CN_IDX_DRBD; - cn_reply->id.val = CN_VAL_DRBD; - -- cn_reply->seq = atomic_add_return(1, &drbd_nl_seq); -+ cn_reply->seq = atomic_add_return_unchecked(1, &drbd_nl_seq); - cn_reply->ack = 0; /* not used here. */ - cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + - (int)((char *)tl - (char *)reply->tag_list); -@@ -2540,7 +2540,7 @@ void drbd_bcast_ee(struct drbd_conf *mdev, - cn_reply->id.idx = CN_IDX_DRBD; - cn_reply->id.val = CN_VAL_DRBD; - -- cn_reply->seq = atomic_add_return(1,&drbd_nl_seq); -+ cn_reply->seq = atomic_add_return_unchecked(1,&drbd_nl_seq); - cn_reply->ack = 0; // not used here. - cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + - (int)((char*)tl - (char*)reply->tag_list); -@@ -2579,7 +2579,7 @@ void drbd_bcast_sync_progress(struct drbd_conf *mdev) - cn_reply->id.idx = CN_IDX_DRBD; - cn_reply->id.val = CN_VAL_DRBD; - -- cn_reply->seq = atomic_add_return(1, &drbd_nl_seq); -+ cn_reply->seq = atomic_add_return_unchecked(1, &drbd_nl_seq); - cn_reply->ack = 0; /* not used here. */ - cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + - (int)((char *)tl - (char *)reply->tag_list); +- if (atomic_read(&tconn->current_epoch->epoch_size) != 0) +- conn_err(tconn, "epoch_size:%d\n", atomic_read(&tconn->current_epoch->epoch_size)); ++ if (atomic_read_unchecked(&tconn->current_epoch->epoch_size) != 0) ++ conn_err(tconn, "epoch_size:%d\n", atomic_read_unchecked(&tconn->current_epoch->epoch_size)); + kfree(tconn->current_epoch); + + idr_destroy(&tconn->volumes); diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c -index 43beaca..4a5b1dd 100644 +index 2f5fffd..b22a1ae 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c -@@ -894,7 +894,7 @@ retry: - sock->sk->sk_sndtimeo = mdev->net_conf->timeout*HZ/10; - sock->sk->sk_rcvtimeo = MAX_SCHEDULE_TIMEOUT; +@@ -833,7 +833,7 @@ int drbd_connected(struct drbd_conf *mdev) + { + int err; - atomic_set(&mdev->packet_seq, 0); + atomic_set_unchecked(&mdev->packet_seq, 0); mdev->peer_seq = 0; - drbd_thread_start(&mdev->asender); -@@ -985,7 +985,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev, + mdev->state_mutex = mdev->tconn->agreed_pro_version < 100 ? +@@ -1191,7 +1191,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_tconn *tconn, do { next_epoch = NULL; @@ -29411,7 +33403,7 @@ index 43beaca..4a5b1dd 100644 switch (ev & ~EV_CLEANUP) { case EV_PUT: -@@ -1020,7 +1020,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev, +@@ -1231,7 +1231,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_tconn *tconn, rv = FE_DESTROYED; } else { epoch->flags = 0; @@ -29420,24 +33412,16 @@ index 43beaca..4a5b1dd 100644 /* atomic_set(&epoch->active, 0); is already zero */ if (rv == FE_STILL_LIVE) rv = FE_RECYCLED; -@@ -1191,14 +1191,14 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign - drbd_wait_ee_list_empty(mdev, &mdev->active_ee); - drbd_flush(mdev); +@@ -1449,7 +1449,7 @@ static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi) + conn_wait_active_ee_empty(tconn); + drbd_flush(tconn); -- if (atomic_read(&mdev->current_epoch->epoch_size)) { -+ if (atomic_read_unchecked(&mdev->current_epoch->epoch_size)) { +- if (atomic_read(&tconn->current_epoch->epoch_size)) { ++ if (atomic_read_unchecked(&tconn->current_epoch->epoch_size)) { epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO); if (epoch) break; - } - - epoch = mdev->current_epoch; -- wait_event(mdev->ee_wait, atomic_read(&epoch->epoch_size) == 0); -+ wait_event(mdev->ee_wait, atomic_read_unchecked(&epoch->epoch_size) == 0); - - D_ASSERT(atomic_read(&epoch->active) == 0); - D_ASSERT(epoch->flags == 0); -@@ -1210,11 +1210,11 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign +@@ -1462,11 +1462,11 @@ static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi) } epoch->flags = 0; @@ -29445,44 +33429,62 @@ index 43beaca..4a5b1dd 100644 + atomic_set_unchecked(&epoch->epoch_size, 0); atomic_set(&epoch->active, 0); - spin_lock(&mdev->epoch_lock); -- if (atomic_read(&mdev->current_epoch->epoch_size)) { -+ if (atomic_read_unchecked(&mdev->current_epoch->epoch_size)) { - list_add(&epoch->list, &mdev->current_epoch->list); - mdev->current_epoch = epoch; - mdev->epochs++; -@@ -1663,7 +1663,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned - spin_unlock(&mdev->peer_seq_lock); - - drbd_send_ack_dp(mdev, P_NEG_ACK, p, data_size); -- atomic_inc(&mdev->current_epoch->epoch_size); -+ atomic_inc_unchecked(&mdev->current_epoch->epoch_size); - return drbd_drain_block(mdev, data_size); - } - -@@ -1689,7 +1689,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned - - spin_lock(&mdev->epoch_lock); - e->epoch = mdev->current_epoch; -- atomic_inc(&e->epoch->epoch_size); -+ atomic_inc_unchecked(&e->epoch->epoch_size); - atomic_inc(&e->epoch->active); - spin_unlock(&mdev->epoch_lock); - -@@ -3885,7 +3885,7 @@ static void drbd_disconnect(struct drbd_conf *mdev) - D_ASSERT(list_empty(&mdev->done_ee)); + spin_lock(&tconn->epoch_lock); +- if (atomic_read(&tconn->current_epoch->epoch_size)) { ++ if (atomic_read_unchecked(&tconn->current_epoch->epoch_size)) { + list_add(&epoch->list, &tconn->current_epoch->list); + tconn->current_epoch = epoch; + tconn->epochs++; +@@ -2170,7 +2170,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi) + + err = wait_for_and_update_peer_seq(mdev, peer_seq); + drbd_send_ack_dp(mdev, P_NEG_ACK, p, pi->size); +- atomic_inc(&tconn->current_epoch->epoch_size); ++ atomic_inc_unchecked(&tconn->current_epoch->epoch_size); + err2 = drbd_drain_block(mdev, pi->size); + if (!err) + err = err2; +@@ -2204,7 +2204,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi) + + spin_lock(&tconn->epoch_lock); + peer_req->epoch = tconn->current_epoch; +- atomic_inc(&peer_req->epoch->epoch_size); ++ atomic_inc_unchecked(&peer_req->epoch->epoch_size); + atomic_inc(&peer_req->epoch->active); + spin_unlock(&tconn->epoch_lock); + +@@ -4345,7 +4345,7 @@ struct data_cmd { + int expect_payload; + size_t pkt_size; + int (*fn)(struct drbd_tconn *, struct packet_info *); +-}; ++} __do_const; + static struct data_cmd drbd_cmd_handler[] = { + [P_DATA] = { 1, sizeof(struct p_data), receive_Data }, +@@ -4465,7 +4465,7 @@ static void conn_disconnect(struct drbd_tconn *tconn) + if (!list_empty(&tconn->current_epoch->list)) + conn_err(tconn, "ASSERTION FAILED: tconn->current_epoch->list not empty\n"); /* ok, no more ee's on the fly, it is safe to reset the epoch_size */ -- atomic_set(&mdev->current_epoch->epoch_size, 0); -+ atomic_set_unchecked(&mdev->current_epoch->epoch_size, 0); - D_ASSERT(list_empty(&mdev->current_epoch->list)); - } +- atomic_set(&tconn->current_epoch->epoch_size, 0); ++ atomic_set_unchecked(&tconn->current_epoch->epoch_size, 0); + tconn->send.seen_any_write_yet = false; + + conn_info(tconn, "Connection closed\n"); +@@ -5221,7 +5221,7 @@ static int tconn_finish_peer_reqs(struct drbd_tconn *tconn) + struct asender_cmd { + size_t pkt_size; + int (*fn)(struct drbd_tconn *tconn, struct packet_info *); +-}; ++} __do_const; + static struct asender_cmd asender_tbl[] = { + [P_PING] = { 0, got_Ping }, diff --git a/drivers/block/loop.c b/drivers/block/loop.c -index bbca966..65e37dd 100644 +index dfe7583..83768bb 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c -@@ -226,7 +226,7 @@ static int __do_lo_send_write(struct file *file, +@@ -231,7 +231,7 @@ static int __do_lo_send_write(struct file *file, mm_segment_t old_fs = get_fs(); set_fs(get_ds()); @@ -29491,8 +33493,67 @@ index bbca966..65e37dd 100644 set_fs(old_fs); if (likely(bw == len)) return 0; +diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c +index 2e7de7a..ed86dc0 100644 +--- a/drivers/block/pktcdvd.c ++++ b/drivers/block/pktcdvd.c +@@ -83,7 +83,7 @@ + + #define MAX_SPEED 0xffff + +-#define ZONE(sector, pd) (((sector) + (pd)->offset) & ~((pd)->settings.size - 1)) ++#define ZONE(sector, pd) (((sector) + (pd)->offset) & ~((pd)->settings.size - 1UL)) + + static DEFINE_MUTEX(pktcdvd_mutex); + static struct pktcdvd_device *pkt_devs[MAX_WRITERS]; +diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c +index d620b44..587561e 100644 +--- a/drivers/cdrom/cdrom.c ++++ b/drivers/cdrom/cdrom.c +@@ -416,7 +416,6 @@ int register_cdrom(struct cdrom_device_info *cdi) + ENSURE(reset, CDC_RESET); + ENSURE(generic_packet, CDC_GENERIC_PACKET); + cdi->mc_flags = 0; +- cdo->n_minors = 0; + cdi->options = CDO_USE_FFLAGS; + + if (autoclose==1 && CDROM_CAN(CDC_CLOSE_TRAY)) +@@ -436,8 +435,11 @@ int register_cdrom(struct cdrom_device_info *cdi) + else + cdi->cdda_method = CDDA_OLD; + +- if (!cdo->generic_packet) +- cdo->generic_packet = cdrom_dummy_generic_packet; ++ if (!cdo->generic_packet) { ++ pax_open_kernel(); ++ *(void **)&cdo->generic_packet = cdrom_dummy_generic_packet; ++ pax_close_kernel(); ++ } + + cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name); + mutex_lock(&cdrom_mutex); +@@ -458,7 +460,6 @@ void unregister_cdrom(struct cdrom_device_info *cdi) + if (cdi->exit) + cdi->exit(cdi); + +- cdi->ops->n_minors--; + cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name); + } + +diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c +index d59cdcb..11afddf 100644 +--- a/drivers/cdrom/gdrom.c ++++ b/drivers/cdrom/gdrom.c +@@ -491,7 +491,6 @@ static struct cdrom_device_ops gdrom_ops = { + .audio_ioctl = gdrom_audio_ioctl, + .capability = CDC_MULTI_SESSION | CDC_MEDIA_CHANGED | + CDC_RESET | CDC_DRIVE_STATUS | CDC_CD_R, +- .n_minors = 1, + }; + + static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode) diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index ee94686..3e09ad3 100644 +index 3bb6fa3..34013fb 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -8,7 +8,8 @@ source "drivers/tty/Kconfig" @@ -29505,7 +33566,7 @@ index ee94686..3e09ad3 100644 help Say Y here if you want to support the /dev/kmem device. The /dev/kmem device is rarely used, but can be used for certain -@@ -581,6 +582,7 @@ config DEVPORT +@@ -582,6 +583,7 @@ config DEVPORT bool depends on !M68K depends on ISA || PCI @@ -29539,10 +33600,10 @@ index 21cb980..f15107c 100644 return -EINVAL; else diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c -index dfd7876..c0b0885 100644 +index d784650..e8bfd69 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c -@@ -571,7 +571,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets, +@@ -559,7 +559,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets, } static int @@ -29552,7 +33613,7 @@ index dfd7876..c0b0885 100644 { struct hpet_timer __iomem *timer; diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c -index 2c29942..604c5ba 100644 +index 053201b0..8335cce 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -420,7 +420,7 @@ struct ipmi_smi { @@ -29586,7 +33647,7 @@ index 2c29942..604c5ba 100644 intf->proc_dir = NULL; diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c -index 1e638ff..a869ef5 100644 +index 0ac9b45..6179fb5 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -275,7 +275,7 @@ struct smi_info { @@ -29610,7 +33671,7 @@ index 1e638ff..a869ef5 100644 #define SI_MAX_PARMS 4 -@@ -3209,7 +3209,7 @@ static int try_smi_init(struct smi_info *new_smi) +@@ -3254,7 +3254,7 @@ static int try_smi_init(struct smi_info *new_smi) atomic_set(&new_smi->req_events, 0); new_smi->run_to_completion = 0; for (i = 0; i < SI_NUM_STATS; i++) @@ -29619,21 +33680,8 @@ index 1e638ff..a869ef5 100644 new_smi->interrupt_disabled = 1; atomic_set(&new_smi->stop_operation, 0); -diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c -index 47ff7e4..0c7d340 100644 ---- a/drivers/char/mbcs.c -+++ b/drivers/char/mbcs.c -@@ -799,7 +799,7 @@ static int mbcs_remove(struct cx_dev *dev) - return 0; - } - --static const struct cx_device_id __devinitdata mbcs_id_table[] = { -+static const struct cx_device_id __devinitconst mbcs_id_table[] = { - { - .part_num = MBCS_PART_NUM, - .mfg_num = MBCS_MFG_NUM, diff --git a/drivers/char/mem.c b/drivers/char/mem.c -index d6e9d08..0c314bf 100644 +index 2c644af..b867b3e 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -18,6 +18,7 @@ @@ -29644,9 +33692,9 @@ index d6e9d08..0c314bf 100644 #include <linux/ptrace.h> #include <linux/device.h> #include <linux/highmem.h> -@@ -35,6 +36,10 @@ - # include <linux/efi.h> - #endif +@@ -37,6 +38,10 @@ + + #define DEVPORT_MINOR 4 +#if defined(CONFIG_GRKERNSEC) && !defined(CONFIG_GRKERNSEC_NO_RBAC) +extern const struct file_operations grsec_fops; @@ -29655,7 +33703,7 @@ index d6e9d08..0c314bf 100644 static inline unsigned long size_inside_page(unsigned long start, unsigned long size) { -@@ -66,9 +71,13 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) +@@ -68,9 +73,13 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) while (cursor < to) { if (!devmem_is_allowed(pfn)) { @@ -29669,7 +33717,7 @@ index d6e9d08..0c314bf 100644 return 0; } cursor += PAGE_SIZE; -@@ -76,6 +85,11 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) +@@ -78,6 +87,11 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) } return 1; } @@ -29681,7 +33729,7 @@ index d6e9d08..0c314bf 100644 #else static inline int range_is_allowed(unsigned long pfn, unsigned long size) { -@@ -118,6 +132,7 @@ static ssize_t read_mem(struct file *file, char __user *buf, +@@ -120,6 +134,7 @@ static ssize_t read_mem(struct file *file, char __user *buf, while (count > 0) { unsigned long remaining; @@ -29689,7 +33737,7 @@ index d6e9d08..0c314bf 100644 sz = size_inside_page(p, count); -@@ -133,7 +148,23 @@ static ssize_t read_mem(struct file *file, char __user *buf, +@@ -135,7 +150,23 @@ static ssize_t read_mem(struct file *file, char __user *buf, if (!ptr) return -EFAULT; @@ -29714,18 +33762,18 @@ index d6e9d08..0c314bf 100644 unxlate_dev_mem_ptr(p, ptr); if (remaining) return -EFAULT; -@@ -396,9 +427,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf, +@@ -398,9 +429,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf, size_t count, loff_t *ppos) { unsigned long p = *ppos; - ssize_t low_count, read, sz; + ssize_t low_count, read, sz, err = 0; - char * kbuf; /* k-addr because vread() takes vmlist_lock rwlock */ + char *kbuf; /* k-addr because vread() takes vmlist_lock rwlock */ - int err = 0; read = 0; if (p < (unsigned long) high_memory) { -@@ -420,6 +450,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf, +@@ -422,6 +452,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf, } #endif while (low_count > 0) { @@ -29734,7 +33782,7 @@ index d6e9d08..0c314bf 100644 sz = size_inside_page(p, low_count); /* -@@ -429,7 +461,22 @@ static ssize_t read_kmem(struct file *file, char __user *buf, +@@ -431,7 +463,22 @@ static ssize_t read_kmem(struct file *file, char __user *buf, */ kbuf = xlate_dev_kmem_ptr((char *)p); @@ -29758,7 +33806,7 @@ index d6e9d08..0c314bf 100644 return -EFAULT; buf += sz; p += sz; -@@ -867,6 +914,9 @@ static const struct memdev { +@@ -833,6 +880,9 @@ static const struct memdev { #ifdef CONFIG_CRASH_DUMP [12] = { "oldmem", 0, &oldmem_fops, NULL }, #endif @@ -29781,8 +33829,83 @@ index 9df78e2..01ba9ae 100644 return -EFAULT; *ppos = i; +diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c +index 5c5cc00..ac9edb7 100644 +--- a/drivers/char/pcmcia/synclink_cs.c ++++ b/drivers/char/pcmcia/synclink_cs.c +@@ -2345,9 +2345,9 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp) + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):mgslpc_close(%s) entry, count=%d\n", +- __FILE__, __LINE__, info->device_name, port->count); ++ __FILE__, __LINE__, info->device_name, atomic_read(&port->count)); + +- WARN_ON(!port->count); ++ WARN_ON(!atomic_read(&port->count)); + + if (tty_port_close_start(port, tty, filp) == 0) + goto cleanup; +@@ -2365,7 +2365,7 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp) + cleanup: + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):mgslpc_close(%s) exit, count=%d\n", __FILE__, __LINE__, +- tty->driver->name, port->count); ++ tty->driver->name, atomic_read(&port->count)); + } + + /* Wait until the transmitter is empty. +@@ -2507,7 +2507,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):mgslpc_open(%s), old ref count = %d\n", +- __FILE__, __LINE__, tty->driver->name, port->count); ++ __FILE__, __LINE__, tty->driver->name, atomic_read(&port->count)); + + /* If port is closing, signal caller to try again */ + if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING){ +@@ -2527,11 +2527,11 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) + goto cleanup; + } + spin_lock(&port->lock); +- port->count++; ++ atomic_inc(&port->count); + spin_unlock(&port->lock); + spin_unlock_irqrestore(&info->netlock, flags); + +- if (port->count == 1) { ++ if (atomic_read(&port->count) == 1) { + /* 1st open on this device, init hardware */ + retval = startup(info, tty); + if (retval < 0) +@@ -3920,7 +3920,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, + unsigned short new_crctype; + + /* return error if TTY interface open */ +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + return -EBUSY; + + switch (encoding) +@@ -4024,7 +4024,7 @@ static int hdlcdev_open(struct net_device *dev) + + /* arbitrate between network and tty opens */ + spin_lock_irqsave(&info->netlock, flags); +- if (info->port.count != 0 || info->netcount != 0) { ++ if (atomic_read(&info->port.count) != 0 || info->netcount != 0) { + printk(KERN_WARNING "%s: hdlc_open returning busy\n", dev->name); + spin_unlock_irqrestore(&info->netlock, flags); + return -EBUSY; +@@ -4114,7 +4114,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + printk("%s:hdlcdev_ioctl(%s)\n", __FILE__, dev->name); + + /* return error if TTY interface open */ +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + return -EBUSY; + + if (cmd != SIOCWANDEV) diff --git a/drivers/char/random.c b/drivers/char/random.c -index d98b2a6..230b4c6 100644 +index 32a6c57..e7f0f7b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -272,8 +272,13 @@ @@ -29817,7 +33940,7 @@ index d98b2a6..230b4c6 100644 #if 0 /* x^2048 + x^1638 + x^1231 + x^819 + x^411 + x + 1 -- 115 */ { 2048, 1638, 1231, 819, 411, 1 }, -@@ -527,8 +539,8 @@ static void _mix_pool_bytes(struct entropy_store *r, const void *in, +@@ -524,8 +536,8 @@ static void _mix_pool_bytes(struct entropy_store *r, const void *in, input_rotate += i ? 7 : 14; } @@ -29828,25 +33951,7 @@ index d98b2a6..230b4c6 100644 smp_wmb(); if (out) -@@ -799,6 +811,17 @@ void add_disk_randomness(struct gendisk *disk) - } - #endif - -+#ifdef CONFIG_PAX_LATENT_ENTROPY -+u64 latent_entropy; -+ -+__init void transfer_latent_entropy(void) -+{ -+ mix_pool_bytes(&input_pool, &latent_entropy, sizeof(latent_entropy)); -+ mix_pool_bytes(&nonblocking_pool, &latent_entropy, sizeof(latent_entropy)); -+// printk(KERN_INFO "PAX: transferring latent entropy: %16llx\n", latent_entropy); -+} -+#endif -+ - /********************************************************************* - * - * Entropy extraction routines -@@ -1008,7 +1031,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf, +@@ -1024,7 +1036,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf, extract_buf(r, tmp); i = min_t(int, nbytes, EXTRACT_SIZE); @@ -29855,7 +33960,7 @@ index d98b2a6..230b4c6 100644 ret = -EFAULT; break; } -@@ -1342,7 +1365,7 @@ EXPORT_SYMBOL(generate_random_uuid); +@@ -1360,7 +1372,7 @@ EXPORT_SYMBOL(generate_random_uuid); #include <linux/sysctl.h> static int min_read_thresh = 8, min_write_thresh; @@ -29864,8 +33969,17 @@ index d98b2a6..230b4c6 100644 static int max_write_thresh = INPUT_POOL_WORDS * 32; static char sysctl_bootid[16]; +@@ -1376,7 +1388,7 @@ static char sysctl_bootid[16]; + static int proc_do_uuid(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- ctl_table fake_table; ++ ctl_table_no_const fake_table; + unsigned char buf[64], tmp_uuid[16], *uuid; + + uuid = table->data; diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c -index 45713f0..8286d21 100644 +index bf2349db..5456d53 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c @@ -54,6 +54,7 @@ @@ -29906,24 +34020,29 @@ index 45713f0..8286d21 100644 mutex_unlock(&sonypi_device.lock); return 0; -diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c -index 08427ab..1ab10b7 100644 ---- a/drivers/char/tpm/tpm.c -+++ b/drivers/char/tpm/tpm.c -@@ -415,7 +415,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, - chip->vendor.req_complete_val) - goto out_recv; - -- if ((status == chip->vendor.req_canceled)) { -+ if (status == chip->vendor.req_canceled) { - dev_err(chip->dev, "Operation Canceled\n"); - rc = -ECANCELED; - goto out; -diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c -index 0636520..169c1d0 100644 ---- a/drivers/char/tpm/tpm_bios.c -+++ b/drivers/char/tpm/tpm_bios.c -@@ -173,7 +173,7 @@ static void *tpm_bios_measurements_start(struct seq_file *m, loff_t *pos) +diff --git a/drivers/char/tpm/tpm_acpi.c b/drivers/char/tpm/tpm_acpi.c +index 64420b3..5c40b56 100644 +--- a/drivers/char/tpm/tpm_acpi.c ++++ b/drivers/char/tpm/tpm_acpi.c +@@ -98,11 +98,12 @@ int read_log(struct tpm_bios_log *log) + virt = acpi_os_map_memory(start, len); + if (!virt) { + kfree(log->bios_event_log); ++ log->bios_event_log = NULL; + printk("%s: ERROR - Unable to map memory\n", __func__); + return -EIO; + } + +- memcpy_fromio(log->bios_event_log, virt, len); ++ memcpy_fromio(log->bios_event_log, (const char __force_kernel *)virt, len); + + acpi_os_unmap_memory(virt, len); + return 0; +diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c +index 84ddc55..1d32f1e 100644 +--- a/drivers/char/tpm/tpm_eventlog.c ++++ b/drivers/char/tpm/tpm_eventlog.c +@@ -95,7 +95,7 @@ static void *tpm_bios_measurements_start(struct seq_file *m, loff_t *pos) event = addr; if ((event->event_type == 0 && event->event_size == 0) || @@ -29932,7 +34051,7 @@ index 0636520..169c1d0 100644 return NULL; return addr; -@@ -198,7 +198,7 @@ static void *tpm_bios_measurements_next(struct seq_file *m, void *v, +@@ -120,7 +120,7 @@ static void *tpm_bios_measurements_next(struct seq_file *m, void *v, return NULL; if ((event->event_type == 0 && event->event_size == 0) || @@ -29941,7 +34060,7 @@ index 0636520..169c1d0 100644 return NULL; (*pos)++; -@@ -291,7 +291,8 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) +@@ -213,7 +213,8 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) int i; for (i = 0; i < sizeof(struct tcpa_event) + event->event_size; i++) @@ -29951,26 +34070,11 @@ index 0636520..169c1d0 100644 return 0; } -@@ -410,8 +411,13 @@ static int read_log(struct tpm_bios_log *log) - log->bios_event_log_end = log->bios_event_log + len; - - virt = acpi_os_map_memory(start, len); -+ if (!virt) { -+ kfree(log->bios_event_log); -+ log->bios_event_log = NULL; -+ return -EFAULT; -+ } - -- memcpy(log->bios_event_log, virt, len); -+ memcpy(log->bios_event_log, (const char __force_kernel *)virt, len); - - acpi_os_unmap_memory(virt, len); - return 0; diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c -index cdf2f54..e55c197 100644 +index ce5f3fc..e2d3e55 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c -@@ -563,7 +563,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count, +@@ -679,7 +679,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count, if (to_user) { ssize_t ret; @@ -29979,7 +34083,7 @@ index cdf2f54..e55c197 100644 if (ret) return -EFAULT; } else { -@@ -662,7 +662,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, +@@ -778,7 +778,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, if (!port_has_data(port) && !port->host_connected) return 0; @@ -29987,9 +34091,322 @@ index cdf2f54..e55c197 100644 + return fill_readbuf(port, (char __force_kernel *)ubuf, count, true); } - static ssize_t port_fops_write(struct file *filp, const char __user *ubuf, + static int wait_port_writable(struct port *port, bool nonblock) +diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c +index d7ad425..3e3f81f 100644 +--- a/drivers/clocksource/arm_arch_timer.c ++++ b/drivers/clocksource/arm_arch_timer.c +@@ -262,7 +262,7 @@ static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { ++static struct notifier_block arch_timer_cpu_nb = { + .notifier_call = arch_timer_cpu_notify, + }; + +diff --git a/drivers/clocksource/metag_generic.c b/drivers/clocksource/metag_generic.c +index ade7513..069445f 100644 +--- a/drivers/clocksource/metag_generic.c ++++ b/drivers/clocksource/metag_generic.c +@@ -169,7 +169,7 @@ static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata arch_timer_cpu_nb = { ++static struct notifier_block arch_timer_cpu_nb = { + .notifier_call = arch_timer_cpu_notify, + }; + +diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c +index 57a8774..545e993 100644 +--- a/drivers/cpufreq/acpi-cpufreq.c ++++ b/drivers/cpufreq/acpi-cpufreq.c +@@ -172,7 +172,7 @@ static ssize_t show_global_boost(struct kobject *kobj, + return sprintf(buf, "%u\n", boost_enabled); + } + +-static struct global_attr global_boost = __ATTR(boost, 0644, ++static global_attr_no_const global_boost = __ATTR(boost, 0644, + show_global_boost, + store_global_boost); + +@@ -712,8 +712,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) + data->acpi_data = per_cpu_ptr(acpi_perf_data, cpu); + per_cpu(acfreq_data, cpu) = data; + +- if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) +- acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS; ++ if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) { ++ pax_open_kernel(); ++ *(u8 *)&acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS; ++ pax_close_kernel(); ++ } + + result = acpi_processor_register_performance(data->acpi_data, cpu); + if (result) +@@ -839,7 +842,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) + policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); + break; + case ACPI_ADR_SPACE_FIXED_HARDWARE: +- acpi_cpufreq_driver.get = get_cur_freq_on_cpu; ++ pax_open_kernel(); ++ *(void **)&acpi_cpufreq_driver.get = get_cur_freq_on_cpu; ++ pax_close_kernel(); + policy->cur = get_cur_freq_on_cpu(cpu); + break; + default: +@@ -850,8 +855,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) + acpi_processor_notify_smm(THIS_MODULE); + + /* Check for APERF/MPERF support in hardware */ +- if (boot_cpu_has(X86_FEATURE_APERFMPERF)) +- acpi_cpufreq_driver.getavg = cpufreq_get_measured_perf; ++ if (boot_cpu_has(X86_FEATURE_APERFMPERF)) { ++ pax_open_kernel(); ++ *(void **)&acpi_cpufreq_driver.getavg = cpufreq_get_measured_perf; ++ pax_close_kernel(); ++ } + + pr_debug("CPU%u - ACPI performance management activated.\n", cpu); + for (i = 0; i < perf->state_count; i++) +diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c +index b02824d..51e44aa 100644 +--- a/drivers/cpufreq/cpufreq.c ++++ b/drivers/cpufreq/cpufreq.c +@@ -1813,7 +1813,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block __refdata cpufreq_cpu_notifier = { ++static struct notifier_block cpufreq_cpu_notifier = { + .notifier_call = cpufreq_cpu_callback, + }; + +@@ -1845,8 +1845,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) + + pr_debug("trying to register driver %s\n", driver_data->name); + +- if (driver_data->setpolicy) +- driver_data->flags |= CPUFREQ_CONST_LOOPS; ++ if (driver_data->setpolicy) { ++ pax_open_kernel(); ++ *(u8 *)&driver_data->flags |= CPUFREQ_CONST_LOOPS; ++ pax_close_kernel(); ++ } + + spin_lock_irqsave(&cpufreq_driver_lock, flags); + if (cpufreq_driver) { +diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c +index 5a76086..0f4d394 100644 +--- a/drivers/cpufreq/cpufreq_governor.c ++++ b/drivers/cpufreq/cpufreq_governor.c +@@ -201,8 +201,8 @@ int cpufreq_governor_dbs(struct dbs_data *dbs_data, + { + struct od_cpu_dbs_info_s *od_dbs_info = NULL; + struct cs_cpu_dbs_info_s *cs_dbs_info = NULL; +- struct cs_ops *cs_ops = NULL; +- struct od_ops *od_ops = NULL; ++ const struct cs_ops *cs_ops = NULL; ++ const struct od_ops *od_ops = NULL; + struct od_dbs_tuners *od_tuners = dbs_data->tuners; + struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; + struct cpu_dbs_common_info *cpu_cdbs; +diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h +index cc4bd2f..ad142bc 100644 +--- a/drivers/cpufreq/cpufreq_governor.h ++++ b/drivers/cpufreq/cpufreq_governor.h +@@ -142,7 +142,7 @@ struct dbs_data { + void (*gov_check_cpu)(int cpu, unsigned int load); + + /* Governor specific ops, see below */ +- void *gov_ops; ++ const void *gov_ops; + }; + + /* Governor specific ops, will be passed to dbs_data->gov_ops */ +diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c +index bfd6273..e39dd63 100644 +--- a/drivers/cpufreq/cpufreq_stats.c ++++ b/drivers/cpufreq/cpufreq_stats.c +@@ -365,7 +365,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb, + } + + /* priority=1 so this will get called before cpufreq_remove_dev */ +-static struct notifier_block cpufreq_stat_cpu_notifier __refdata = { ++static struct notifier_block cpufreq_stat_cpu_notifier = { + .notifier_call = cpufreq_stat_cpu_callback, + .priority = 1, + }; +diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c +index 827629c9..0bc6a03 100644 +--- a/drivers/cpufreq/p4-clockmod.c ++++ b/drivers/cpufreq/p4-clockmod.c +@@ -167,10 +167,14 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) + case 0x0F: /* Core Duo */ + case 0x16: /* Celeron Core */ + case 0x1C: /* Atom */ +- p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; ++ pax_open_kernel(); ++ *(u8 *)&p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; ++ pax_close_kernel(); + return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE); + case 0x0D: /* Pentium M (Dothan) */ +- p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; ++ pax_open_kernel(); ++ *(u8 *)&p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; ++ pax_close_kernel(); + /* fall through */ + case 0x09: /* Pentium M (Banias) */ + return speedstep_get_frequency(SPEEDSTEP_CPU_PM); +@@ -182,7 +186,9 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) + + /* on P-4s, the TSC runs with constant frequency independent whether + * throttling is active or not. */ +- p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; ++ pax_open_kernel(); ++ *(u8 *)&p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; ++ pax_close_kernel(); + + if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4M) { + printk(KERN_WARNING PFX "Warning: Pentium 4-M detected. " +diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c +index 3a953d5..f5993f6 100644 +--- a/drivers/cpufreq/speedstep-centrino.c ++++ b/drivers/cpufreq/speedstep-centrino.c +@@ -353,8 +353,11 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) + !cpu_has(cpu, X86_FEATURE_EST)) + return -ENODEV; + +- if (cpu_has(cpu, X86_FEATURE_CONSTANT_TSC)) +- centrino_driver.flags |= CPUFREQ_CONST_LOOPS; ++ if (cpu_has(cpu, X86_FEATURE_CONSTANT_TSC)) { ++ pax_open_kernel(); ++ *(u8 *)¢rino_driver.flags |= CPUFREQ_CONST_LOOPS; ++ pax_close_kernel(); ++ } + + if (policy->cpu != 0) + return -ENODEV; +diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c +index eba6929..0f53baf 100644 +--- a/drivers/cpuidle/cpuidle.c ++++ b/drivers/cpuidle/cpuidle.c +@@ -277,7 +277,7 @@ static int poll_idle(struct cpuidle_device *dev, + + static void poll_idle_init(struct cpuidle_driver *drv) + { +- struct cpuidle_state *state = &drv->states[0]; ++ cpuidle_state_no_const *state = &drv->states[0]; + + snprintf(state->name, CPUIDLE_NAME_LEN, "POLL"); + snprintf(state->desc, CPUIDLE_DESC_LEN, "CPUIDLE CORE POLL IDLE"); +diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c +index ea2f8e7..70ac501 100644 +--- a/drivers/cpuidle/governor.c ++++ b/drivers/cpuidle/governor.c +@@ -87,7 +87,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov) + mutex_lock(&cpuidle_lock); + if (__cpuidle_find_governor(gov->name) == NULL) { + ret = 0; +- list_add_tail(&gov->governor_list, &cpuidle_governors); ++ pax_list_add_tail((struct list_head *)&gov->governor_list, &cpuidle_governors); + if (!cpuidle_curr_governor || + cpuidle_curr_governor->rating < gov->rating) + cpuidle_switch_governor(gov); +@@ -135,7 +135,7 @@ void cpuidle_unregister_governor(struct cpuidle_governor *gov) + new_gov = cpuidle_replace_governor(gov->rating); + cpuidle_switch_governor(new_gov); + } +- list_del(&gov->governor_list); ++ pax_list_del((struct list_head *)&gov->governor_list); + mutex_unlock(&cpuidle_lock); + } + +diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c +index 428754a..8bdf9cc 100644 +--- a/drivers/cpuidle/sysfs.c ++++ b/drivers/cpuidle/sysfs.c +@@ -131,7 +131,7 @@ static struct attribute *cpuidle_switch_attrs[] = { + NULL + }; + +-static struct attribute_group cpuidle_attr_group = { ++static attribute_group_no_const cpuidle_attr_group = { + .attrs = cpuidle_default_attrs, + .name = "cpuidle", + }; +diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c +index 3b36797..289c16a 100644 +--- a/drivers/devfreq/devfreq.c ++++ b/drivers/devfreq/devfreq.c +@@ -588,7 +588,7 @@ int devfreq_add_governor(struct devfreq_governor *governor) + goto err_out; + } + +- list_add(&governor->node, &devfreq_governor_list); ++ pax_list_add((struct list_head *)&governor->node, &devfreq_governor_list); + + list_for_each_entry(devfreq, &devfreq_list, node) { + int ret = 0; +@@ -676,7 +676,7 @@ int devfreq_remove_governor(struct devfreq_governor *governor) + } + } + +- list_del(&governor->node); ++ pax_list_del((struct list_head *)&governor->node); + err_out: + mutex_unlock(&devfreq_list_lock); + +diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c +index b70709b..1d8d02a 100644 +--- a/drivers/dma/sh/shdma.c ++++ b/drivers/dma/sh/shdma.c +@@ -476,7 +476,7 @@ static int sh_dmae_nmi_handler(struct notifier_block *self, + return ret; + } + +-static struct notifier_block sh_dmae_nmi_notifier __read_mostly = { ++static struct notifier_block sh_dmae_nmi_notifier = { + .notifier_call = sh_dmae_nmi_handler, + + /* Run before NMI debug handler and KGDB */ +diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c +index 769d92e..a3dcc1e 100644 +--- a/drivers/edac/edac_mc_sysfs.c ++++ b/drivers/edac/edac_mc_sysfs.c +@@ -148,7 +148,7 @@ static const char *edac_caps[] = { + struct dev_ch_attribute { + struct device_attribute attr; + int channel; +-}; ++} __do_const; + + #define DEVICE_CHANNEL(_name, _mode, _show, _store, _var) \ + struct dev_ch_attribute dev_attr_legacy_##_name = \ +@@ -1003,14 +1003,16 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) + } + + if (mci->set_sdram_scrub_rate || mci->get_sdram_scrub_rate) { ++ pax_open_kernel(); + if (mci->get_sdram_scrub_rate) { +- dev_attr_sdram_scrub_rate.attr.mode |= S_IRUGO; +- dev_attr_sdram_scrub_rate.show = &mci_sdram_scrub_rate_show; ++ *(umode_t *)&dev_attr_sdram_scrub_rate.attr.mode |= S_IRUGO; ++ *(void **)&dev_attr_sdram_scrub_rate.show = &mci_sdram_scrub_rate_show; + } + if (mci->set_sdram_scrub_rate) { +- dev_attr_sdram_scrub_rate.attr.mode |= S_IWUSR; +- dev_attr_sdram_scrub_rate.store = &mci_sdram_scrub_rate_store; ++ *(umode_t *)&dev_attr_sdram_scrub_rate.attr.mode |= S_IWUSR; ++ *(void **)&dev_attr_sdram_scrub_rate.store = &mci_sdram_scrub_rate_store; + } ++ pax_close_kernel(); + err = device_create_file(&mci->dev, + &dev_attr_sdram_scrub_rate); + if (err) { diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c -index 97f5064..202b6e6 100644 +index e8658e4..22746d6 100644 --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c @@ -26,8 +26,8 @@ static int edac_pci_log_pe = 1; /* log PCI parity errors */ @@ -30003,7 +34420,16 @@ index 97f5064..202b6e6 100644 static struct kobject *edac_pci_top_main_kobj; static atomic_t edac_pci_sysfs_refcount = ATOMIC_INIT(0); -@@ -582,7 +582,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) +@@ -235,7 +235,7 @@ struct edac_pci_dev_attribute { + void *value; + ssize_t(*show) (void *, char *); + ssize_t(*store) (void *, const char *, size_t); +-}; ++} __do_const; + + /* Set of show/store abstract level functions for PCI Parity object */ + static ssize_t edac_pci_dev_show(struct kobject *kobj, struct attribute *attr, +@@ -579,7 +579,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) edac_printk(KERN_CRIT, EDAC_PCI, "Signaled System Error on %s\n", pci_name(dev)); @@ -30012,7 +34438,7 @@ index 97f5064..202b6e6 100644 } if (status & (PCI_STATUS_PARITY)) { -@@ -590,7 +590,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) +@@ -587,7 +587,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) "Master Data Parity Error on %s\n", pci_name(dev)); @@ -30021,7 +34447,7 @@ index 97f5064..202b6e6 100644 } if (status & (PCI_STATUS_DETECTED_PARITY)) { -@@ -598,7 +598,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) +@@ -595,7 +595,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) "Detected Parity Error on %s\n", pci_name(dev)); @@ -30030,7 +34456,7 @@ index 97f5064..202b6e6 100644 } } -@@ -619,7 +619,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) +@@ -618,7 +618,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " "Signaled System Error on %s\n", pci_name(dev)); @@ -30039,7 +34465,7 @@ index 97f5064..202b6e6 100644 } if (status & (PCI_STATUS_PARITY)) { -@@ -627,7 +627,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) +@@ -626,7 +626,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) "Master Data Parity Error on " "%s\n", pci_name(dev)); @@ -30048,7 +34474,7 @@ index 97f5064..202b6e6 100644 } if (status & (PCI_STATUS_DETECTED_PARITY)) { -@@ -635,7 +635,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) +@@ -634,7 +634,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) "Detected Parity Error on %s\n", pci_name(dev)); @@ -30057,7 +34483,7 @@ index 97f5064..202b6e6 100644 } } } -@@ -677,7 +677,7 @@ void edac_pci_do_parity_check(void) +@@ -672,7 +672,7 @@ void edac_pci_do_parity_check(void) if (!check_pci_errors) return; @@ -30066,7 +34492,7 @@ index 97f5064..202b6e6 100644 /* scan all PCI devices looking for a Parity Error on devices and * bridges. -@@ -689,7 +689,7 @@ void edac_pci_do_parity_check(void) +@@ -684,7 +684,7 @@ void edac_pci_do_parity_check(void) /* Only if operator has selected panic on PCI Error */ if (edac_pci_get_panic_on_pe()) { /* If the count is different 'after' from 'before' */ @@ -30076,23 +34502,23 @@ index 97f5064..202b6e6 100644 } } diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h -index c6074c5..88a9e2e 100644 +index 51b7e3a..aa8a3e8 100644 --- a/drivers/edac/mce_amd.h +++ b/drivers/edac/mce_amd.h -@@ -82,7 +82,7 @@ extern const char * const ii_msgs[]; - struct amd_decoder_ops { - bool (*dc_mce)(u16, u8); - bool (*ic_mce)(u16, u8); +@@ -77,7 +77,7 @@ struct amd_decoder_ops { + bool (*mc0_mce)(u16, u8); + bool (*mc1_mce)(u16, u8); + bool (*mc2_mce)(u16, u8); -}; +} __no_const; void amd_report_gart_errors(bool); void amd_register_ecc_decoder(void (*f)(int, struct mce *)); diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c -index cc595eb..4ec702a 100644 +index 57ea7f4..789e3c3 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c -@@ -679,7 +679,7 @@ void fw_card_release(struct kref *kref) +@@ -680,7 +680,7 @@ EXPORT_SYMBOL_GPL(fw_card_release); void fw_core_remove_card(struct fw_card *card) { @@ -30102,10 +34528,10 @@ index cc595eb..4ec702a 100644 card->driver->update_phy_reg(card, 4, PHY_LINK_ACTIVE | PHY_CONTENDER, 0); diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c -index 2e6b245..c3857d9 100644 +index 27ac423..13573e8 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c -@@ -1341,8 +1341,7 @@ static int init_iso_resource(struct client *client, +@@ -1366,8 +1366,7 @@ static int init_iso_resource(struct client *client, int ret; if ((request->channels == 0 && request->bandwidth == 0) || @@ -30115,11 +34541,24 @@ index 2e6b245..c3857d9 100644 return -EINVAL; r = kmalloc(sizeof(*r), GFP_KERNEL); +diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c +index 03ce7d9..b70f5da 100644 +--- a/drivers/firewire/core-device.c ++++ b/drivers/firewire/core-device.c +@@ -232,7 +232,7 @@ EXPORT_SYMBOL(fw_device_enable_phys_dma); + struct config_rom_attribute { + struct device_attribute attr; + u32 key; +-}; ++} __do_const; + + static ssize_t show_immediate(struct device *dev, + struct device_attribute *dattr, char *buf) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c -index dea2dcc..a4fb978 100644 +index 28a94c7..58da63a 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c -@@ -37,6 +37,7 @@ +@@ -38,6 +38,7 @@ #include <linux/timer.h> #include <linux/types.h> #include <linux/workqueue.h> @@ -30128,10 +34567,10 @@ index dea2dcc..a4fb978 100644 #include <asm/byteorder.h> diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h -index 9047f55..e47c7ff 100644 +index 515a42c..5ecf3ba 100644 --- a/drivers/firewire/core.h +++ b/drivers/firewire/core.h -@@ -110,6 +110,7 @@ struct fw_card_driver { +@@ -111,6 +111,7 @@ struct fw_card_driver { int (*stop_iso)(struct fw_iso_context *ctx); }; @@ -30139,11 +34578,24 @@ index 9047f55..e47c7ff 100644 void fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver, struct device *device); +diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c +index 94a58a0..f5eba42 100644 +--- a/drivers/firmware/dmi-id.c ++++ b/drivers/firmware/dmi-id.c +@@ -16,7 +16,7 @@ + struct dmi_device_attribute{ + struct device_attribute dev_attr; + int field; +-}; ++} __do_const; + #define to_dmi_dev_attr(_dev_attr) \ + container_of(_dev_attr, struct dmi_device_attribute, dev_attr) + diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c -index b298158..7ed8432 100644 +index 4cd392d..4b629e1 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c -@@ -452,11 +452,6 @@ void __init dmi_scan_machine(void) +@@ -490,11 +490,6 @@ void __init dmi_scan_machine(void) } } else { @@ -30155,7 +34607,7 @@ index b298158..7ed8432 100644 p = dmi_ioremap(0xF0000, 0x10000); if (p == NULL) goto error; -@@ -726,7 +721,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *), +@@ -769,7 +764,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *), if (buf == NULL) return -1; @@ -30164,8 +34616,58 @@ index b298158..7ed8432 100644 iounmap(buf); return 0; +diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c +index f4baa11..7970c3a 100644 +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -139,7 +139,7 @@ struct efivar_attribute { + }; + + static struct efivars __efivars; +-static struct efivar_operations ops; ++static efivar_operations_no_const ops __read_only; + + #define PSTORE_EFI_ATTRIBUTES \ + (EFI_VARIABLE_NON_VOLATILE | \ +@@ -1844,7 +1844,7 @@ efivar_create_sysfs_entry(struct efivars *efivars, + static int + create_efivars_bin_attributes(struct efivars *efivars) + { +- struct bin_attribute *attr; ++ bin_attribute_no_const *attr; + int error; + + /* new_var */ +diff --git a/drivers/firmware/google/memconsole.c b/drivers/firmware/google/memconsole.c +index 2a90ba6..07f3733 100644 +--- a/drivers/firmware/google/memconsole.c ++++ b/drivers/firmware/google/memconsole.c +@@ -147,7 +147,9 @@ static int __init memconsole_init(void) + if (!found_memconsole()) + return -ENODEV; + +- memconsole_bin_attr.size = memconsole_length; ++ pax_open_kernel(); ++ *(size_t *)&memconsole_bin_attr.size = memconsole_length; ++ pax_close_kernel(); + + ret = sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr); + +diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c +index de3c317..b7cd029 100644 +--- a/drivers/gpio/gpio-ich.c ++++ b/drivers/gpio/gpio-ich.c +@@ -69,7 +69,7 @@ struct ichx_desc { + /* Some chipsets have quirks, let these use their own request/get */ + int (*request)(struct gpio_chip *chip, unsigned offset); + int (*get)(struct gpio_chip *chip, unsigned offset); +-}; ++} __do_const; + + static struct { + spinlock_t lock; diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c -index 82d5c20..44a7177 100644 +index 9902732..64b62dd 100644 --- a/drivers/gpio/gpio-vr41xx.c +++ b/drivers/gpio/gpio-vr41xx.c @@ -204,7 +204,7 @@ static int giu_get_irq(unsigned int irq) @@ -30178,10 +34680,10 @@ index 82d5c20..44a7177 100644 return -EINVAL; } diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c -index 8111889..367b253 100644 +index 7b2d378..cc947ea 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c -@@ -286,7 +286,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder, +@@ -319,7 +319,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder, struct drm_crtc *tmp; int crtc_mask = 1; @@ -30191,10 +34693,10 @@ index 8111889..367b253 100644 dev = crtc->dev; diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c -index 6116e3b..c29dd16 100644 +index 25f91cd..a376f55 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c -@@ -316,7 +316,7 @@ module_exit(drm_core_exit); +@@ -306,7 +306,7 @@ module_exit(drm_core_exit); /** * Copy and IOCTL return string to user space */ @@ -30203,7 +34705,16 @@ index 6116e3b..c29dd16 100644 { int len; -@@ -399,7 +399,7 @@ long drm_ioctl(struct file *filp, +@@ -376,7 +376,7 @@ long drm_ioctl(struct file *filp, + struct drm_file *file_priv = filp->private_data; + struct drm_device *dev; + struct drm_ioctl_desc *ioctl; +- drm_ioctl_t *func; ++ drm_ioctl_no_const_t func; + unsigned int nr = DRM_IOCTL_NR(cmd); + int retcode = -EINVAL; + char stack_kdata[128]; +@@ -389,7 +389,7 @@ long drm_ioctl(struct file *filp, return -ENODEV; atomic_inc(&dev->ioctl_count); @@ -30213,7 +34724,7 @@ index 6116e3b..c29dd16 100644 DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n", diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c -index 123de28..43a0897 100644 +index 429e07d..e681a2c 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -71,7 +71,7 @@ static int drm_setup(struct drm_device * dev) @@ -30225,18 +34736,34 @@ index 123de28..43a0897 100644 dev->sigdata.lock = NULL; -@@ -138,8 +138,8 @@ int drm_open(struct inode *inode, struct file *filp) +@@ -135,7 +135,7 @@ int drm_open(struct inode *inode, struct file *filp) + if (drm_device_is_unplugged(dev)) + return -ENODEV; +- if (!dev->open_count++) ++ if (local_inc_return(&dev->open_count) == 1) + need_setup = 1; + mutex_lock(&dev->struct_mutex); + old_imapping = inode->i_mapping; +@@ -151,7 +151,7 @@ int drm_open(struct inode *inode, struct file *filp) retcode = drm_open_helper(inode, filp, dev); - if (!retcode) { -- atomic_inc(&dev->counts[_DRM_STAT_OPENS]); -- if (!dev->open_count++) -+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_OPENS]); -+ if (local_inc_return(&dev->open_count) == 1) - retcode = drm_setup(dev); - } - if (!retcode) { -@@ -482,7 +482,7 @@ int drm_release(struct inode *inode, struct file *filp) + if (retcode) + goto err_undo; +- atomic_inc(&dev->counts[_DRM_STAT_OPENS]); ++ atomic_inc_unchecked(&dev->counts[_DRM_STAT_OPENS]); + if (need_setup) { + retcode = drm_setup(dev); + if (retcode) +@@ -166,7 +166,7 @@ err_undo: + iput(container_of(dev->dev_mapping, struct inode, i_data)); + dev->dev_mapping = old_mapping; + mutex_unlock(&dev->struct_mutex); +- dev->open_count--; ++ local_dec(&dev->open_count); + return retcode; + } + EXPORT_SYMBOL(drm_open); +@@ -441,7 +441,7 @@ int drm_release(struct inode *inode, struct file *filp) mutex_lock(&drm_global_mutex); @@ -30245,7 +34772,7 @@ index 123de28..43a0897 100644 if (dev->driver->preclose) dev->driver->preclose(dev, file_priv); -@@ -491,10 +491,10 @@ int drm_release(struct inode *inode, struct file *filp) +@@ -450,10 +450,10 @@ int drm_release(struct inode *inode, struct file *filp) * Begin inline drm_release */ @@ -30258,7 +34785,7 @@ index 123de28..43a0897 100644 /* Release any auth tokens that might point to this file_priv, (do that under the drm_global_mutex) */ -@@ -584,8 +584,8 @@ int drm_release(struct inode *inode, struct file *filp) +@@ -550,8 +550,8 @@ int drm_release(struct inode *inode, struct file *filp) * End inline drm_release */ @@ -30270,7 +34797,7 @@ index 123de28..43a0897 100644 DRM_ERROR("Device busy: %d\n", atomic_read(&dev->ioctl_count)); diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c -index c87dc96..326055d 100644 +index f731116..629842c 100644 --- a/drivers/gpu/drm/drm_global.c +++ b/drivers/gpu/drm/drm_global.c @@ -36,7 +36,7 @@ @@ -30331,7 +34858,7 @@ index c87dc96..326055d 100644 item->object = NULL; } diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c -index ab1162d..42587b2 100644 +index d4b20ce..77a8d41 100644 --- a/drivers/gpu/drm/drm_info.c +++ b/drivers/gpu/drm/drm_info.c @@ -75,10 +75,14 @@ int drm_vm_info(struct seq_file *m, void *data) @@ -30362,7 +34889,7 @@ index ab1162d..42587b2 100644 type = "??"; else type = types[map->type]; -@@ -290,7 +294,11 @@ int drm_vma_info(struct seq_file *m, void *data) +@@ -253,7 +257,11 @@ int drm_vma_info(struct seq_file *m, void *data) vma->vm_flags & VM_MAYSHARE ? 's' : 'p', vma->vm_flags & VM_LOCKED ? 'l' : '-', vma->vm_flags & VM_IO ? 'i' : '-', @@ -30375,7 +34902,7 @@ index ab1162d..42587b2 100644 #if defined(__i386__) pgprot = pgprot_val(vma->vm_page_prot); diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c -index 637fcc3..e890b33 100644 +index 2f4c434..dd12cd2 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -457,7 +457,7 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd, @@ -30396,8 +34923,38 @@ index 637fcc3..e890b33 100644 if (__put_user(count, &request->count) || __put_user(list, &request->list)) +@@ -1016,7 +1016,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, + return 0; + } + +-drm_ioctl_compat_t *drm_compat_ioctls[] = { ++drm_ioctl_compat_t drm_compat_ioctls[] = { + [DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version, + [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE32)] = compat_drm_getunique, + [DRM_IOCTL_NR(DRM_IOCTL_GET_MAP32)] = compat_drm_getmap, +@@ -1062,7 +1062,6 @@ drm_ioctl_compat_t *drm_compat_ioctls[] = { + long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) + { + unsigned int nr = DRM_IOCTL_NR(cmd); +- drm_ioctl_compat_t *fn; + int ret; + + /* Assume that ioctls without an explicit compat routine will just +@@ -1072,10 +1071,8 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) + if (nr >= ARRAY_SIZE(drm_compat_ioctls)) + return drm_ioctl(filp, cmd, arg); + +- fn = drm_compat_ioctls[nr]; +- +- if (fn != NULL) +- ret = (*fn) (filp, cmd, arg); ++ if (drm_compat_ioctls[nr] != NULL) ++ ret = (*drm_compat_ioctls[nr]) (filp, cmd, arg); + else + ret = drm_ioctl(filp, cmd, arg); + diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c -index cf85155..f2665cb 100644 +index e77bd8b..1571b85 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -252,7 +252,7 @@ int drm_getstats(struct drm_device *dev, void *data, @@ -30410,10 +34967,10 @@ index cf85155..f2665cb 100644 } diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c -index c79c713..2048588 100644 +index d752c96..fe08455 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c -@@ -90,7 +90,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) +@@ -86,7 +86,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) if (drm_lock_take(&master->lock, lock->context)) { master->lock.file_priv = file_priv; master->lock.lock_time = jiffies; @@ -30422,7 +34979,7 @@ index c79c713..2048588 100644 break; /* Got lock */ } -@@ -161,7 +161,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) +@@ -157,7 +157,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) return -EINVAL; } @@ -30432,10 +34989,10 @@ index c79c713..2048588 100644 if (drm_lock_free(&master->lock, lock->context)) { /* FIXME: Should really bail out here. */ diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c -index aa454f8..6d38580 100644 +index 7d30802..42c6cbb 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c -@@ -512,7 +512,7 @@ void drm_unplug_dev(struct drm_device *dev) +@@ -501,7 +501,7 @@ void drm_unplug_dev(struct drm_device *dev) drm_device_set_unplugged(dev); @@ -30445,7 +35002,7 @@ index aa454f8..6d38580 100644 } mutex_unlock(&drm_global_mutex); diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c -index f920fb5..001c52d 100644 +index 004ecdf..db1f6e0 100644 --- a/drivers/gpu/drm/i810/i810_dma.c +++ b/drivers/gpu/drm/i810/i810_dma.c @@ -945,8 +945,8 @@ static int i810_dma_vertex(struct drm_device *dev, void *data, @@ -30471,7 +35028,7 @@ index f920fb5..001c52d 100644 sarea_priv->last_dispatch = (int)hw_status[5]; diff --git a/drivers/gpu/drm/i810/i810_drv.h b/drivers/gpu/drm/i810/i810_drv.h -index c9339f4..f5e1b9d 100644 +index 6e0acad..93c8289 100644 --- a/drivers/gpu/drm/i810/i810_drv.h +++ b/drivers/gpu/drm/i810/i810_drv.h @@ -108,8 +108,8 @@ typedef struct drm_i810_private { @@ -30486,32 +35043,23 @@ index c9339f4..f5e1b9d 100644 int front_offset; } drm_i810_private_t; diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c -index e6162a1..b2ff486 100644 +index 7299ea4..5314487 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c -@@ -500,7 +500,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) +@@ -499,7 +499,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(GTIMR)); } seq_printf(m, "Interrupts received: %d\n", - atomic_read(&dev_priv->irq_received)); + atomic_read_unchecked(&dev_priv->irq_received)); - for (i = 0; i < I915_NUM_RINGS; i++) { + for_each_ring(ring, dev_priv, i) { if (IS_GEN6(dev) || IS_GEN7(dev)) { - seq_printf(m, "Graphics Interrupt mask (%s): %08x\n", -@@ -1313,7 +1313,7 @@ static int i915_opregion(struct seq_file *m, void *unused) - return ret; - - if (opregion->header) -- seq_write(m, opregion->header, OPREGION_SIZE); -+ seq_write(m, (const void __force_kernel *)opregion->header, OPREGION_SIZE); - - mutex_unlock(&dev->struct_mutex); - + seq_printf(m, diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c -index ba60f3c..e2dff7f 100644 +index 4fa6beb..f930fec 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c -@@ -1178,7 +1178,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev) +@@ -1259,7 +1259,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev) bool can_switch; spin_lock(&dev->count_lock); @@ -30521,38 +35069,20 @@ index ba60f3c..e2dff7f 100644 return can_switch; } diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h -index 5fabc6c..0b08aa1 100644 +index ef99b1c..09ce7fb 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h -@@ -240,7 +240,7 @@ struct drm_i915_display_funcs { - /* render clock increase/decrease */ - /* display clock increase/decrease */ - /* pll clock increase/decrease */ --}; -+} __no_const; - - struct intel_device_info { - u8 gen; -@@ -350,7 +350,7 @@ typedef struct drm_i915_private { - int current_page; - int page_flipping; +@@ -893,7 +893,7 @@ typedef struct drm_i915_private { + drm_dma_handle_t *status_page_dmah; + struct resource mch_res; - atomic_t irq_received; + atomic_unchecked_t irq_received; /* protects the irq masks */ spinlock_t irq_lock; -@@ -937,7 +937,7 @@ struct drm_i915_gem_object { - * will be page flipped away on the next vblank. When it - * reaches 0, dev_priv->pending_flip_queue will be woken up. - */ -- atomic_t pending_flip; -+ atomic_unchecked_t pending_flip; - }; - - #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base) -@@ -1359,7 +1359,7 @@ extern int intel_setup_gmbus(struct drm_device *dev); - extern void intel_teardown_gmbus(struct drm_device *dev); +@@ -1775,7 +1775,7 @@ extern struct i2c_adapter *intel_gmbus_get_adapter( + struct drm_i915_private *dev_priv, unsigned port); extern void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed); extern void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit); -extern inline bool intel_gmbus_is_forced_bit(struct i2c_adapter *adapter) @@ -30561,19 +35091,10 @@ index 5fabc6c..0b08aa1 100644 return container_of(adapter, struct intel_gmbus, adapter)->force_bit; } diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c -index de43194..a14c4cc 100644 +index 9a48e1a..f0cbc3e 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c -@@ -189,7 +189,7 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj, - i915_gem_clflush_object(obj); - - if (obj->base.pending_write_domain) -- cd->flips |= atomic_read(&obj->pending_flip); -+ cd->flips |= atomic_read_unchecked(&obj->pending_flip); - - /* The actual obj->write_domain will be updated with - * pending_write_domain after we emit the accumulated flush for all -@@ -933,9 +933,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec) +@@ -729,9 +729,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec) static int validate_exec_list(struct drm_i915_gem_exec_object2 *exec, @@ -30582,110 +35103,207 @@ index de43194..a14c4cc 100644 { - int i; + unsigned int i; + int relocs_total = 0; + int relocs_max = INT_MAX / sizeof(struct drm_i915_gem_relocation_entry); - for (i = 0; i < count; i++) { - char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr; +@@ -1195,7 +1195,7 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data, + return -ENOMEM; + } + ret = copy_from_user(exec2_list, +- (struct drm_i915_relocation_entry __user *) ++ (struct drm_i915_gem_exec_object2 __user *) + (uintptr_t) args->buffers_ptr, + sizeof(*exec2_list) * args->buffer_count); + if (ret != 0) { +diff --git a/drivers/gpu/drm/i915/i915_ioc32.c b/drivers/gpu/drm/i915/i915_ioc32.c +index 3c59584..500f2e9 100644 +--- a/drivers/gpu/drm/i915/i915_ioc32.c ++++ b/drivers/gpu/drm/i915/i915_ioc32.c +@@ -181,7 +181,7 @@ static int compat_i915_alloc(struct file *file, unsigned int cmd, + (unsigned long)request); + } + +-static drm_ioctl_compat_t *i915_compat_ioctls[] = { ++static drm_ioctl_compat_t i915_compat_ioctls[] = { + [DRM_I915_BATCHBUFFER] = compat_i915_batchbuffer, + [DRM_I915_CMDBUFFER] = compat_i915_cmdbuffer, + [DRM_I915_GETPARAM] = compat_i915_getparam, +@@ -202,18 +202,15 @@ static drm_ioctl_compat_t *i915_compat_ioctls[] = { + long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) + { + unsigned int nr = DRM_IOCTL_NR(cmd); +- drm_ioctl_compat_t *fn = NULL; + int ret; + + if (nr < DRM_COMMAND_BASE) + return drm_compat_ioctl(filp, cmd, arg); + +- if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(i915_compat_ioctls)) +- fn = i915_compat_ioctls[nr - DRM_COMMAND_BASE]; +- +- if (fn != NULL) ++ if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(i915_compat_ioctls)) { ++ drm_ioctl_compat_t fn = i915_compat_ioctls[nr - DRM_COMMAND_BASE]; + ret = (*fn) (filp, cmd, arg); +- else ++ } else + ret = drm_ioctl(filp, cmd, arg); + + return ret; diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c -index 26c67a7..8d4cbcb 100644 +index 3c7bb04..182e049 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c -@@ -496,7 +496,7 @@ static irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS) - u32 de_iir, gt_iir, de_ier, pch_iir, pm_iir; - struct drm_i915_master_private *master_priv; +@@ -549,7 +549,7 @@ static irqreturn_t valleyview_irq_handler(int irq, void *arg) + int pipe; + u32 pipe_stats[I915_MAX_PIPES]; + +- atomic_inc(&dev_priv->irq_received); ++ atomic_inc_unchecked(&dev_priv->irq_received); + + while (true) { + iir = I915_READ(VLV_IIR); +@@ -705,7 +705,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg) + irqreturn_t ret = IRQ_NONE; + int i; - atomic_inc(&dev_priv->irq_received); + atomic_inc_unchecked(&dev_priv->irq_received); /* disable master interrupt before clearing iir */ de_ier = I915_READ(DEIER); -@@ -579,7 +579,7 @@ static irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS) - struct drm_i915_master_private *master_priv; - u32 bsd_usr_interrupt = GT_BSD_USER_INTERRUPT; +@@ -791,7 +791,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) + int ret = IRQ_NONE; + u32 de_iir, gt_iir, de_ier, pm_iir, sde_ier; - atomic_inc(&dev_priv->irq_received); + atomic_inc_unchecked(&dev_priv->irq_received); - if (IS_GEN6(dev)) - bsd_usr_interrupt = GT_GEN6_BSD_USER_INTERRUPT; -@@ -1291,7 +1291,7 @@ static irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) - int ret = IRQ_NONE, pipe; - bool blc_event = false; + /* disable master interrupt before clearing iir */ + de_ier = I915_READ(DEIER); +@@ -1886,7 +1886,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev) + { + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + +- atomic_set(&dev_priv->irq_received, 0); ++ atomic_set_unchecked(&dev_priv->irq_received, 0); + + I915_WRITE(HWSTAM, 0xeffe); + +@@ -1912,7 +1912,7 @@ static void valleyview_irq_preinstall(struct drm_device *dev) + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + int pipe; + +- atomic_set(&dev_priv->irq_received, 0); ++ atomic_set_unchecked(&dev_priv->irq_received, 0); + + /* VLV magic */ + I915_WRITE(VLV_IMR, 0); +@@ -2208,7 +2208,7 @@ static void i8xx_irq_preinstall(struct drm_device * dev) + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + int pipe; + +- atomic_set(&dev_priv->irq_received, 0); ++ atomic_set_unchecked(&dev_priv->irq_received, 0); + + for_each_pipe(pipe) + I915_WRITE(PIPESTAT(pipe), 0); +@@ -2259,7 +2259,7 @@ static irqreturn_t i8xx_irq_handler(int irq, void *arg) + I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT | + I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT; - atomic_inc(&dev_priv->irq_received); + atomic_inc_unchecked(&dev_priv->irq_received); - iir = I915_READ(IIR); - -@@ -1802,7 +1802,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev) - { + iir = I915_READ16(IIR); + if (iir == 0) +@@ -2344,7 +2344,7 @@ static void i915_irq_preinstall(struct drm_device * dev) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + int pipe; - atomic_set(&dev_priv->irq_received, 0); + atomic_set_unchecked(&dev_priv->irq_received, 0); - INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func); - INIT_WORK(&dev_priv->error_work, i915_error_work_func); -@@ -1979,7 +1979,7 @@ static void i915_driver_irq_preinstall(struct drm_device * dev) + if (I915_HAS_HOTPLUG(dev)) { + I915_WRITE(PORT_HOTPLUG_EN, 0); +@@ -2448,7 +2448,7 @@ static irqreturn_t i915_irq_handler(int irq, void *arg) + }; + int pipe, ret = IRQ_NONE; + +- atomic_inc(&dev_priv->irq_received); ++ atomic_inc_unchecked(&dev_priv->irq_received); + + iir = I915_READ(IIR); + do { +@@ -2574,7 +2574,7 @@ static void i965_irq_preinstall(struct drm_device * dev) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int pipe; - atomic_set(&dev_priv->irq_received, 0); + atomic_set_unchecked(&dev_priv->irq_received, 0); - INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func); - INIT_WORK(&dev_priv->error_work, i915_error_work_func); + I915_WRITE(PORT_HOTPLUG_EN, 0); + I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT)); +@@ -2690,7 +2690,7 @@ static irqreturn_t i965_irq_handler(int irq, void *arg) + int irq_received; + int ret = IRQ_NONE, pipe; + +- atomic_inc(&dev_priv->irq_received); ++ atomic_inc_unchecked(&dev_priv->irq_received); + + iir = I915_READ(IIR); + diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c -index 3de3d9b..7cb4130 100644 +index c2d173a..f4357cc 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c -@@ -2254,7 +2254,7 @@ intel_finish_fb(struct drm_framebuffer *old_fb) - - wait_event(dev_priv->pending_flip_queue, - atomic_read(&dev_priv->mm.wedged) || -- atomic_read(&obj->pending_flip) == 0); -+ atomic_read_unchecked(&obj->pending_flip) == 0); - - /* Big Hammer, we also need to ensure that any pending - * MI_WAIT_FOR_EVENT inside a user batch buffer on the -@@ -2919,7 +2919,7 @@ static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) - obj = to_intel_framebuffer(crtc->fb)->obj; - dev_priv = crtc->dev->dev_private; - wait_event(dev_priv->pending_flip_queue, -- atomic_read(&obj->pending_flip) == 0); -+ atomic_read_unchecked(&obj->pending_flip) == 0); - } - - static bool intel_crtc_driving_pch(struct drm_crtc *crtc) -@@ -7273,9 +7273,8 @@ static void do_intel_finish_page_flip(struct drm_device *dev, - - obj = work->old_fb_obj; - -- atomic_clear_mask(1 << intel_crtc->plane, -- &obj->pending_flip.counter); -- if (atomic_read(&obj->pending_flip) == 0) -+ atomic_clear_mask_unchecked(1 << intel_crtc->plane, &obj->pending_flip); -+ if (atomic_read_unchecked(&obj->pending_flip) == 0) - wake_up(&dev_priv->pending_flip_queue); - - schedule_work(&work->work); -@@ -7571,7 +7570,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, - /* Block clients from rendering to the new back buffer until - * the flip occurs and the object is no longer visible. - */ -- atomic_add(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip); -+ atomic_add_unchecked(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip); +@@ -8722,13 +8722,13 @@ struct intel_quirk { + int subsystem_vendor; + int subsystem_device; + void (*hook)(struct drm_device *dev); +-}; ++} __do_const; - ret = dev_priv->display.queue_flip(dev, crtc, fb, obj); - if (ret) -@@ -7585,7 +7584,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, - return 0; + /* For systems that don't have a meaningful PCI subdevice/subvendor ID */ + struct intel_dmi_quirk { + void (*hook)(struct drm_device *dev); + const struct dmi_system_id (*dmi_id_list)[]; +-}; ++} __do_const; - cleanup_pending: -- atomic_sub(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip); -+ atomic_sub_unchecked(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip); - drm_gem_object_unreference(&work->old_fb_obj->base); - drm_gem_object_unreference(&obj->base); - mutex_unlock(&dev->struct_mutex); + static int intel_dmi_reverse_brightness(const struct dmi_system_id *id) + { +@@ -8736,18 +8736,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id) + return 1; + } + +-static const struct intel_dmi_quirk intel_dmi_quirks[] = { ++static const struct dmi_system_id intel_dmi_quirks_table[] = { + { +- .dmi_id_list = &(const struct dmi_system_id[]) { +- { +- .callback = intel_dmi_reverse_brightness, +- .ident = "NCR Corporation", +- .matches = {DMI_MATCH(DMI_SYS_VENDOR, "NCR Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, ""), +- }, +- }, +- { } /* terminating entry */ ++ .callback = intel_dmi_reverse_brightness, ++ .ident = "NCR Corporation", ++ .matches = {DMI_MATCH(DMI_SYS_VENDOR, "NCR Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, ""), + }, ++ }, ++ { } /* terminating entry */ ++}; ++ ++static const struct intel_dmi_quirk intel_dmi_quirks[] = { ++ { ++ .dmi_id_list = &intel_dmi_quirks_table, + .hook = quirk_invert_brightness, + }, + }; diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h index 54558a0..2d97005 100644 --- a/drivers/gpu/drm/mga/mga_drv.h @@ -30702,11 +35320,46 @@ index 54558a0..2d97005 100644 u32 next_fence_to_post; unsigned int fb_cpp; +diff --git a/drivers/gpu/drm/mga/mga_ioc32.c b/drivers/gpu/drm/mga/mga_ioc32.c +index 709e90d..89a1c0d 100644 +--- a/drivers/gpu/drm/mga/mga_ioc32.c ++++ b/drivers/gpu/drm/mga/mga_ioc32.c +@@ -189,7 +189,7 @@ static int compat_mga_dma_bootstrap(struct file *file, unsigned int cmd, + return 0; + } + +-drm_ioctl_compat_t *mga_compat_ioctls[] = { ++drm_ioctl_compat_t mga_compat_ioctls[] = { + [DRM_MGA_INIT] = compat_mga_init, + [DRM_MGA_GETPARAM] = compat_mga_getparam, + [DRM_MGA_DMA_BOOTSTRAP] = compat_mga_dma_bootstrap, +@@ -207,18 +207,15 @@ drm_ioctl_compat_t *mga_compat_ioctls[] = { + long mga_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) + { + unsigned int nr = DRM_IOCTL_NR(cmd); +- drm_ioctl_compat_t *fn = NULL; + int ret; + + if (nr < DRM_COMMAND_BASE) + return drm_compat_ioctl(filp, cmd, arg); + +- if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls)) +- fn = mga_compat_ioctls[nr - DRM_COMMAND_BASE]; +- +- if (fn != NULL) ++ if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls)) { ++ drm_ioctl_compat_t fn = mga_compat_ioctls[nr - DRM_COMMAND_BASE]; + ret = (*fn) (filp, cmd, arg); +- else ++ } else + ret = drm_ioctl(filp, cmd, arg); + + return ret; diff --git a/drivers/gpu/drm/mga/mga_irq.c b/drivers/gpu/drm/mga/mga_irq.c -index 2581202..f230a8d9 100644 +index 598c281..60d590e 100644 --- a/drivers/gpu/drm/mga/mga_irq.c +++ b/drivers/gpu/drm/mga/mga_irq.c -@@ -44,7 +44,7 @@ u32 mga_get_vblank_counter(struct drm_device *dev, int crtc) +@@ -43,7 +43,7 @@ u32 mga_get_vblank_counter(struct drm_device *dev, int crtc) if (crtc != 0) return 0; @@ -30715,7 +35368,7 @@ index 2581202..f230a8d9 100644 } -@@ -60,7 +60,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS) +@@ -59,7 +59,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS) /* VBLANK interrupt */ if (status & MGA_VLINEPEN) { MGA_WRITE(MGA_ICLEAR, MGA_VLINEICLR); @@ -30724,7 +35377,7 @@ index 2581202..f230a8d9 100644 drm_handle_vblank(dev, 0); handled = 1; } -@@ -79,7 +79,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS) +@@ -78,7 +78,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS) if ((prim_start & ~0x03) != (prim_end & ~0x03)) MGA_WRITE(MGA_PRIMEND, prim_end); @@ -30733,7 +35386,7 @@ index 2581202..f230a8d9 100644 DRM_WAKEUP(&dev_priv->fence_queue); handled = 1; } -@@ -130,7 +130,7 @@ int mga_driver_fence_wait(struct drm_device *dev, unsigned int *sequence) +@@ -129,7 +129,7 @@ int mga_driver_fence_wait(struct drm_device *dev, unsigned int *sequence) * using fences. */ DRM_WAIT_ON(ret, dev_priv->fence_queue, 3 * DRM_HZ, @@ -30743,10 +35396,10 @@ index 2581202..f230a8d9 100644 *sequence = cur_fence; diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c -index 0be4a81..7464804 100644 +index 50a6dd0..ea66ed8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c -@@ -5329,7 +5329,7 @@ parse_bit_U_tbl_entry(struct drm_device *dev, struct nvbios *bios, +@@ -965,7 +965,7 @@ static int parse_bit_tmds_tbl_entry(struct drm_device *dev, struct nvbios *bios, struct bit_table { const char id; int (* const parse_fn)(struct drm_device *, struct nvbios *, struct bit_entry *); @@ -30755,102 +35408,59 @@ index 0be4a81..7464804 100644 #define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry }) -diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h -index 3aef353..0ad1322 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_drv.h -+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h -@@ -240,7 +240,7 @@ struct nouveau_channel { - struct list_head pending; - uint32_t sequence; - uint32_t sequence_ack; -- atomic_t last_sequence_irq; -+ atomic_unchecked_t last_sequence_irq; - struct nouveau_vma vma; - } fence; - -@@ -321,7 +321,7 @@ struct nouveau_exec_engine { - u32 handle, u16 class); - void (*set_tile_region)(struct drm_device *dev, int i); - void (*tlb_flush)(struct drm_device *, int engine); --}; -+} __no_const; - - struct nouveau_instmem_engine { - void *priv; -@@ -343,13 +343,13 @@ struct nouveau_instmem_engine { - struct nouveau_mc_engine { - int (*init)(struct drm_device *dev); - void (*takedown)(struct drm_device *dev); --}; -+} __no_const; - - struct nouveau_timer_engine { - int (*init)(struct drm_device *dev); - void (*takedown)(struct drm_device *dev); - uint64_t (*read)(struct drm_device *dev); --}; -+} __no_const; - - struct nouveau_fb_engine { - int num_tiles; -@@ -590,7 +590,7 @@ struct nouveau_vram_engine { - void (*put)(struct drm_device *, struct nouveau_mem **); - - bool (*flags_valid)(struct drm_device *, u32 tile_flags); --}; -+} __no_const; - - struct nouveau_engine { - struct nouveau_instmem_engine instmem; -@@ -739,7 +739,7 @@ struct drm_nouveau_private { +diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h +index 9c39baf..30a22be 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_drm.h ++++ b/drivers/gpu/drm/nouveau/nouveau_drm.h +@@ -81,7 +81,7 @@ struct nouveau_drm { struct drm_global_reference mem_global_ref; struct ttm_bo_global_ref bo_global_ref; struct ttm_bo_device bdev; - atomic_t validate_sequence; + atomic_unchecked_t validate_sequence; - } ttm; - - struct { -diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c -index c1dc20f..4df673c 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_fence.c -+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c -@@ -85,7 +85,7 @@ nouveau_fence_update(struct nouveau_channel *chan) - if (USE_REFCNT(dev)) - sequence = nvchan_rd32(chan, 0x48); - else -- sequence = atomic_read(&chan->fence.last_sequence_irq); -+ sequence = atomic_read_unchecked(&chan->fence.last_sequence_irq); - - if (chan->fence.sequence_ack == sequence) - goto out; -@@ -538,7 +538,7 @@ nouveau_fence_channel_init(struct nouveau_channel *chan) - return ret; - } - -- atomic_set(&chan->fence.last_sequence_irq, 0); -+ atomic_set_unchecked(&chan->fence.last_sequence_irq, 0); - return 0; - } - + int (*move)(struct nouveau_channel *, + struct ttm_buffer_object *, + struct ttm_mem_reg *, struct ttm_mem_reg *); diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c -index ed52a6f..484acdc 100644 +index b4b4d0c..b7edc15 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c -@@ -314,7 +314,7 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv, - int trycnt = 0; +@@ -322,7 +322,7 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv, int ret, i; + struct nouveau_bo *res_bo = NULL; -- sequence = atomic_add_return(1, &dev_priv->ttm.validate_sequence); -+ sequence = atomic_add_return_unchecked(1, &dev_priv->ttm.validate_sequence); +- sequence = atomic_add_return(1, &drm->ttm.validate_sequence); ++ sequence = atomic_add_return_unchecked(1, &drm->ttm.validate_sequence); retry: if (++trycnt > 100000) { - NV_ERROR(dev, "%s failed and gave up.\n", __func__); -diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c -index c2a8511..4b996f9 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_state.c -+++ b/drivers/gpu/drm/nouveau/nouveau_state.c -@@ -588,7 +588,7 @@ static bool nouveau_switcheroo_can_switch(struct pci_dev *pdev) + NV_ERROR(cli, "%s failed and gave up.\n", __func__); +@@ -359,7 +359,7 @@ retry: + if (ret) { + validate_fini(op, NULL); + if (unlikely(ret == -EAGAIN)) { +- sequence = atomic_add_return(1, &drm->ttm.validate_sequence); ++ sequence = atomic_add_return_unchecked(1, &drm->ttm.validate_sequence); + ret = ttm_bo_reserve_slowpath(&nvbo->bo, true, + sequence); + if (!ret) +diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c b/drivers/gpu/drm/nouveau/nouveau_ioc32.c +index 08214bc..9208577 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_ioc32.c ++++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c +@@ -50,7 +50,7 @@ long nouveau_compat_ioctl(struct file *filp, unsigned int cmd, + unsigned long arg) + { + unsigned int nr = DRM_IOCTL_NR(cmd); +- drm_ioctl_compat_t *fn = NULL; ++ drm_ioctl_compat_t fn = NULL; + int ret; + + if (nr < DRM_COMMAND_BASE) +diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c +index 25d3495..d81aaf6 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_vga.c ++++ b/drivers/gpu/drm/nouveau/nouveau_vga.c +@@ -62,7 +62,7 @@ nouveau_switcheroo_can_switch(struct pci_dev *pdev) bool can_switch; spin_lock(&dev->count_lock); @@ -30859,50 +35469,11 @@ index c2a8511..4b996f9 100644 spin_unlock(&dev->count_lock); return can_switch; } -diff --git a/drivers/gpu/drm/nouveau/nv04_graph.c b/drivers/gpu/drm/nouveau/nv04_graph.c -index dbdea8e..cd6eeeb 100644 ---- a/drivers/gpu/drm/nouveau/nv04_graph.c -+++ b/drivers/gpu/drm/nouveau/nv04_graph.c -@@ -554,7 +554,7 @@ static int - nv04_graph_mthd_set_ref(struct nouveau_channel *chan, - u32 class, u32 mthd, u32 data) - { -- atomic_set(&chan->fence.last_sequence_irq, data); -+ atomic_set_unchecked(&chan->fence.last_sequence_irq, data); - return 0; - } - -diff --git a/drivers/gpu/drm/nouveau/nv50_sor.c b/drivers/gpu/drm/nouveau/nv50_sor.c -index 2746402..c8dc4a4 100644 ---- a/drivers/gpu/drm/nouveau/nv50_sor.c -+++ b/drivers/gpu/drm/nouveau/nv50_sor.c -@@ -304,7 +304,7 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode) - } - - if (nv_encoder->dcb->type == OUTPUT_DP) { -- struct dp_train_func func = { -+ static struct dp_train_func func = { - .link_set = nv50_sor_dp_link_set, - .train_set = nv50_sor_dp_train_set, - .train_adj = nv50_sor_dp_train_adj -diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c -index 8a555fb..2743fe6 100644 ---- a/drivers/gpu/drm/nouveau/nvd0_display.c -+++ b/drivers/gpu/drm/nouveau/nvd0_display.c -@@ -1366,7 +1366,7 @@ nvd0_sor_dpms(struct drm_encoder *encoder, int mode) - nv_wait(dev, 0x61c030 + (or * 0x0800), 0x10000000, 0x00000000); - - if (nv_encoder->dcb->type == OUTPUT_DP) { -- struct dp_train_func func = { -+ static struct dp_train_func func = { - .link_set = nvd0_sor_dp_link_set, - .train_set = nvd0_sor_dp_train_set, - .train_adj = nvd0_sor_dp_train_adj diff --git a/drivers/gpu/drm/r128/r128_cce.c b/drivers/gpu/drm/r128/r128_cce.c -index bcac90b..53bfc76 100644 +index d4660cf..70dbe65 100644 --- a/drivers/gpu/drm/r128/r128_cce.c +++ b/drivers/gpu/drm/r128/r128_cce.c -@@ -378,7 +378,7 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init) +@@ -377,7 +377,7 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init) /* GH: Simple idle check. */ @@ -30932,11 +35503,46 @@ index 930c71b..499aded 100644 u32 color_fmt; unsigned int front_offset; +diff --git a/drivers/gpu/drm/r128/r128_ioc32.c b/drivers/gpu/drm/r128/r128_ioc32.c +index a954c54..9cc595c 100644 +--- a/drivers/gpu/drm/r128/r128_ioc32.c ++++ b/drivers/gpu/drm/r128/r128_ioc32.c +@@ -177,7 +177,7 @@ static int compat_r128_getparam(struct file *file, unsigned int cmd, + return drm_ioctl(file, DRM_IOCTL_R128_GETPARAM, (unsigned long)getparam); + } + +-drm_ioctl_compat_t *r128_compat_ioctls[] = { ++drm_ioctl_compat_t r128_compat_ioctls[] = { + [DRM_R128_INIT] = compat_r128_init, + [DRM_R128_DEPTH] = compat_r128_depth, + [DRM_R128_STIPPLE] = compat_r128_stipple, +@@ -196,18 +196,15 @@ drm_ioctl_compat_t *r128_compat_ioctls[] = { + long r128_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) + { + unsigned int nr = DRM_IOCTL_NR(cmd); +- drm_ioctl_compat_t *fn = NULL; + int ret; + + if (nr < DRM_COMMAND_BASE) + return drm_compat_ioctl(filp, cmd, arg); + +- if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(r128_compat_ioctls)) +- fn = r128_compat_ioctls[nr - DRM_COMMAND_BASE]; +- +- if (fn != NULL) ++ if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(r128_compat_ioctls)) { ++ drm_ioctl_compat_t fn = r128_compat_ioctls[nr - DRM_COMMAND_BASE]; + ret = (*fn) (filp, cmd, arg); +- else ++ } else + ret = drm_ioctl(filp, cmd, arg); + + return ret; diff --git a/drivers/gpu/drm/r128/r128_irq.c b/drivers/gpu/drm/r128/r128_irq.c -index 429d5a0..7e899ed 100644 +index 2ea4f09..d391371 100644 --- a/drivers/gpu/drm/r128/r128_irq.c +++ b/drivers/gpu/drm/r128/r128_irq.c -@@ -42,7 +42,7 @@ u32 r128_get_vblank_counter(struct drm_device *dev, int crtc) +@@ -41,7 +41,7 @@ u32 r128_get_vblank_counter(struct drm_device *dev, int crtc) if (crtc != 0) return 0; @@ -30945,7 +35551,7 @@ index 429d5a0..7e899ed 100644 } irqreturn_t r128_driver_irq_handler(DRM_IRQ_ARGS) -@@ -56,7 +56,7 @@ irqreturn_t r128_driver_irq_handler(DRM_IRQ_ARGS) +@@ -55,7 +55,7 @@ irqreturn_t r128_driver_irq_handler(DRM_IRQ_ARGS) /* VBLANK interrupt */ if (status & R128_CRTC_VBLANK_INT) { R128_WRITE(R128_GEN_INT_STATUS, R128_CRTC_VBLANK_INT_AK); @@ -30955,10 +35561,10 @@ index 429d5a0..7e899ed 100644 return IRQ_HANDLED; } diff --git a/drivers/gpu/drm/r128/r128_state.c b/drivers/gpu/drm/r128/r128_state.c -index a9e33ce..09edd4b 100644 +index 19bb7e6..de7e2a2 100644 --- a/drivers/gpu/drm/r128/r128_state.c +++ b/drivers/gpu/drm/r128/r128_state.c -@@ -321,10 +321,10 @@ static void r128_clear_box(drm_r128_private_t *dev_priv, +@@ -320,10 +320,10 @@ static void r128_clear_box(drm_r128_private_t *dev_priv, static void r128_cce_performance_boxes(drm_r128_private_t *dev_priv) { @@ -30992,42 +35598,11 @@ index 5a82b6b..9e69c73 100644 if (regcomp (&mask_rex, "(0x[0-9a-fA-F]*) *([_a-zA-Z0-9]*)", REG_EXTENDED)) { -diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h -index 138b952..d74f9cb 100644 ---- a/drivers/gpu/drm/radeon/radeon.h -+++ b/drivers/gpu/drm/radeon/radeon.h -@@ -253,7 +253,7 @@ struct radeon_fence_driver { - uint32_t scratch_reg; - uint64_t gpu_addr; - volatile uint32_t *cpu_addr; -- atomic_t seq; -+ atomic_unchecked_t seq; - uint32_t last_seq; - unsigned long last_jiffies; - unsigned long last_timeout; -@@ -753,7 +753,7 @@ struct r600_blit_cp_primitives { - int x2, int y2); - void (*draw_auto)(struct radeon_device *rdev); - void (*set_default_state)(struct radeon_device *rdev); --}; -+} __no_const; - - struct r600_blit { - struct mutex mutex; -@@ -1246,7 +1246,7 @@ struct radeon_asic { - u32 (*page_flip)(struct radeon_device *rdev, int crtc, u64 crtc_base); - void (*post_page_flip)(struct radeon_device *rdev, int crtc); - } pflip; --}; -+} __no_const; - - /* - * Asic structures diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c -index 5992502..c19c633 100644 +index 44b8034..cc722fd 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c -@@ -691,7 +691,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev) +@@ -977,7 +977,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev) bool can_switch; spin_lock(&dev->count_lock); @@ -31037,10 +35612,10 @@ index 5992502..c19c633 100644 return can_switch; } diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h -index a1b59ca..86f2d44 100644 +index b369d42..8dd04eb 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.h +++ b/drivers/gpu/drm/radeon/radeon_drv.h -@@ -255,7 +255,7 @@ typedef struct drm_radeon_private { +@@ -258,7 +258,7 @@ typedef struct drm_radeon_private { /* SW interrupt */ wait_queue_head_t swi_queue; @@ -31049,42 +35624,11 @@ index a1b59ca..86f2d44 100644 int vblank_crtc; uint32_t irq_enable_reg; uint32_t r500_disp_irq_reg; -diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c -index 4bd36a3..e66fe9c 100644 ---- a/drivers/gpu/drm/radeon/radeon_fence.c -+++ b/drivers/gpu/drm/radeon/radeon_fence.c -@@ -70,7 +70,7 @@ int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence) - write_unlock_irqrestore(&rdev->fence_lock, irq_flags); - return 0; - } -- fence->seq = atomic_add_return(1, &rdev->fence_drv[fence->ring].seq); -+ fence->seq = atomic_add_return_unchecked(1, &rdev->fence_drv[fence->ring].seq); - if (!rdev->ring[fence->ring].ready) - /* FIXME: cp is not running assume everythings is done right - * away -@@ -405,7 +405,7 @@ int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring) - } - rdev->fence_drv[ring].cpu_addr = &rdev->wb.wb[index/4]; - rdev->fence_drv[ring].gpu_addr = rdev->wb.gpu_addr + index; -- radeon_fence_write(rdev, atomic_read(&rdev->fence_drv[ring].seq), ring); -+ radeon_fence_write(rdev, atomic_read_unchecked(&rdev->fence_drv[ring].seq), ring); - rdev->fence_drv[ring].initialized = true; - DRM_INFO("fence driver on ring %d use gpu addr 0x%08Lx and cpu addr 0x%p\n", - ring, rdev->fence_drv[ring].gpu_addr, rdev->fence_drv[ring].cpu_addr); -@@ -418,7 +418,7 @@ static void radeon_fence_driver_init_ring(struct radeon_device *rdev, int ring) - rdev->fence_drv[ring].scratch_reg = -1; - rdev->fence_drv[ring].cpu_addr = NULL; - rdev->fence_drv[ring].gpu_addr = 0; -- atomic_set(&rdev->fence_drv[ring].seq, 0); -+ atomic_set_unchecked(&rdev->fence_drv[ring].seq, 0); - INIT_LIST_HEAD(&rdev->fence_drv[ring].created); - INIT_LIST_HEAD(&rdev->fence_drv[ring].emitted); - INIT_LIST_HEAD(&rdev->fence_drv[ring].signaled); diff --git a/drivers/gpu/drm/radeon/radeon_ioc32.c b/drivers/gpu/drm/radeon/radeon_ioc32.c -index 48b7cea..342236f 100644 +index c180df8..5fd8186 100644 --- a/drivers/gpu/drm/radeon/radeon_ioc32.c +++ b/drivers/gpu/drm/radeon/radeon_ioc32.c -@@ -359,7 +359,7 @@ static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, +@@ -358,7 +358,7 @@ static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, request = compat_alloc_user_space(sizeof(*request)); if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) || __put_user(req32.param, &request->param) @@ -31093,11 +35637,42 @@ index 48b7cea..342236f 100644 &request->value)) return -EFAULT; +@@ -368,7 +368,7 @@ static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, + #define compat_radeon_cp_setparam NULL + #endif /* X86_64 || IA64 */ + +-static drm_ioctl_compat_t *radeon_compat_ioctls[] = { ++static drm_ioctl_compat_t radeon_compat_ioctls[] = { + [DRM_RADEON_CP_INIT] = compat_radeon_cp_init, + [DRM_RADEON_CLEAR] = compat_radeon_cp_clear, + [DRM_RADEON_STIPPLE] = compat_radeon_cp_stipple, +@@ -393,18 +393,15 @@ static drm_ioctl_compat_t *radeon_compat_ioctls[] = { + long radeon_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) + { + unsigned int nr = DRM_IOCTL_NR(cmd); +- drm_ioctl_compat_t *fn = NULL; + int ret; + + if (nr < DRM_COMMAND_BASE) + return drm_compat_ioctl(filp, cmd, arg); + +- if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(radeon_compat_ioctls)) +- fn = radeon_compat_ioctls[nr - DRM_COMMAND_BASE]; +- +- if (fn != NULL) ++ if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(radeon_compat_ioctls)) { ++ drm_ioctl_compat_t fn = radeon_compat_ioctls[nr - DRM_COMMAND_BASE]; + ret = (*fn) (filp, cmd, arg); +- else ++ } else + ret = drm_ioctl(filp, cmd, arg); + + return ret; diff --git a/drivers/gpu/drm/radeon/radeon_irq.c b/drivers/gpu/drm/radeon/radeon_irq.c -index 00da384..32f972d 100644 +index 8d68e97..9dcfed8 100644 --- a/drivers/gpu/drm/radeon/radeon_irq.c +++ b/drivers/gpu/drm/radeon/radeon_irq.c -@@ -225,8 +225,8 @@ static int radeon_emit_irq(struct drm_device * dev) +@@ -226,8 +226,8 @@ static int radeon_emit_irq(struct drm_device * dev) unsigned int ret; RING_LOCALS; @@ -31108,7 +35683,7 @@ index 00da384..32f972d 100644 BEGIN_RING(4); OUT_RING_REG(RADEON_LAST_SWI_REG, ret); -@@ -352,7 +352,7 @@ int radeon_driver_irq_postinstall(struct drm_device *dev) +@@ -353,7 +353,7 @@ int radeon_driver_irq_postinstall(struct drm_device *dev) drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; @@ -31118,7 +35693,7 @@ index 00da384..32f972d 100644 dev->max_vblank_count = 0x001fffff; diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c -index e8422ae..d22d4a8 100644 +index 4d20910..6726b6d 100644 --- a/drivers/gpu/drm/radeon/radeon_state.c +++ b/drivers/gpu/drm/radeon/radeon_state.c @@ -2168,7 +2168,7 @@ static int radeon_cp_clear(struct drm_device *dev, void *data, struct drm_file * @@ -31140,27 +35715,82 @@ index e8422ae..d22d4a8 100644 DRM_DEBUG("pid=%d\n", DRM_CURRENTPID); diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c -index f493c64..524ab6b 100644 +index 93f760e..8088227 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c -@@ -843,8 +843,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma) +@@ -782,7 +782,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size) + man->size = size >> PAGE_SHIFT; + } + +-static struct vm_operations_struct radeon_ttm_vm_ops; ++static vm_operations_struct_no_const radeon_ttm_vm_ops __read_only; + static const struct vm_operations_struct *ttm_vm_ops = NULL; + + static int radeon_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +@@ -823,8 +823,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma) } if (unlikely(ttm_vm_ops == NULL)) { ttm_vm_ops = vma->vm_ops; -- radeon_ttm_vm_ops = *ttm_vm_ops; -- radeon_ttm_vm_ops.fault = &radeon_ttm_fault; + pax_open_kernel(); -+ memcpy((void *)&radeon_ttm_vm_ops, ttm_vm_ops, sizeof(radeon_ttm_vm_ops)); -+ *(void **)&radeon_ttm_vm_ops.fault = &radeon_ttm_fault; + radeon_ttm_vm_ops = *ttm_vm_ops; + radeon_ttm_vm_ops.fault = &radeon_ttm_fault; + pax_close_kernel(); } vma->vm_ops = &radeon_ttm_vm_ops; return 0; +@@ -862,28 +864,33 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev) + sprintf(radeon_mem_types_names[i], "radeon_vram_mm"); + else + sprintf(radeon_mem_types_names[i], "radeon_gtt_mm"); +- radeon_mem_types_list[i].name = radeon_mem_types_names[i]; +- radeon_mem_types_list[i].show = &radeon_mm_dump_table; +- radeon_mem_types_list[i].driver_features = 0; ++ pax_open_kernel(); ++ *(const char **)&radeon_mem_types_list[i].name = radeon_mem_types_names[i]; ++ *(void **)&radeon_mem_types_list[i].show = &radeon_mm_dump_table; ++ *(u32 *)&radeon_mem_types_list[i].driver_features = 0; + if (i == 0) +- radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_VRAM].priv; ++ *(void **)&radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_VRAM].priv; + else +- radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_TT].priv; +- ++ *(void **)&radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_TT].priv; ++ pax_close_kernel(); + } + /* Add ttm page pool to debugfs */ + sprintf(radeon_mem_types_names[i], "ttm_page_pool"); +- radeon_mem_types_list[i].name = radeon_mem_types_names[i]; +- radeon_mem_types_list[i].show = &ttm_page_alloc_debugfs; +- radeon_mem_types_list[i].driver_features = 0; +- radeon_mem_types_list[i++].data = NULL; ++ pax_open_kernel(); ++ *(const char **)&radeon_mem_types_list[i].name = radeon_mem_types_names[i]; ++ *(void **)&radeon_mem_types_list[i].show = &ttm_page_alloc_debugfs; ++ *(u32 *)&radeon_mem_types_list[i].driver_features = 0; ++ *(void **)&radeon_mem_types_list[i++].data = NULL; ++ pax_close_kernel(); + #ifdef CONFIG_SWIOTLB + if (swiotlb_nr_tbl()) { + sprintf(radeon_mem_types_names[i], "ttm_dma_page_pool"); +- radeon_mem_types_list[i].name = radeon_mem_types_names[i]; +- radeon_mem_types_list[i].show = &ttm_dma_page_alloc_debugfs; +- radeon_mem_types_list[i].driver_features = 0; +- radeon_mem_types_list[i++].data = NULL; ++ pax_open_kernel(); ++ *(const char **)&radeon_mem_types_list[i].name = radeon_mem_types_names[i]; ++ *(void **)&radeon_mem_types_list[i].show = &ttm_dma_page_alloc_debugfs; ++ *(u32 *)&radeon_mem_types_list[i].driver_features = 0; ++ *(void **)&radeon_mem_types_list[i++].data = NULL; ++ pax_close_kernel(); + } + #endif + return radeon_debugfs_add_files(rdev, radeon_mem_types_list, i); diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c -index f2c3b9d..d5a376b 100644 +index 5706d2a..17aedaa 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c -@@ -304,9 +304,11 @@ void rs690_crtc_bandwidth_compute(struct radeon_device *rdev, +@@ -304,9 +304,11 @@ static void rs690_crtc_bandwidth_compute(struct radeon_device *rdev, if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full && rdev->pm.sideport_bandwidth.full) rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth; @@ -31174,7 +35804,7 @@ index f2c3b9d..d5a376b 100644 if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full && rdev->pm.k8_bandwidth.full) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c -index ebc6fac..a8313ed 100644 +index bd2a3b4..122d9ad 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -394,9 +394,9 @@ static int ttm_pool_get_num_unused_pages(void) @@ -31189,8 +35819,20 @@ index ebc6fac..a8313ed 100644 struct ttm_page_pool *pool; int shrink_pages = sc->nr_to_scan; +diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c +index 9f4be3d..cbc9fcc 100644 +--- a/drivers/gpu/drm/udl/udl_fb.c ++++ b/drivers/gpu/drm/udl/udl_fb.c +@@ -367,7 +367,6 @@ static int udl_fb_release(struct fb_info *info, int user) + fb_deferred_io_cleanup(info); + kfree(info->fbdefio); + info->fbdefio = NULL; +- info->fbops->fb_mmap = udl_fb_mmap; + } + + pr_warn("released /dev/fb%d user=%d count=%d\n", diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h -index 88edacc..1e5412b 100644 +index 893a650..6190d3b 100644 --- a/drivers/gpu/drm/via/via_drv.h +++ b/drivers/gpu/drm/via/via_drv.h @@ -51,7 +51,7 @@ typedef struct drm_via_ring_buffer { @@ -31212,10 +35854,10 @@ index 88edacc..1e5412b 100644 char pci_buf[VIA_PCI_BUF_SIZE]; const uint32_t *fire_offsets[VIA_FIRE_BUF_SIZE]; diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c -index d391f48..10c8ca3 100644 +index ac98964..5dbf512 100644 --- a/drivers/gpu/drm/via/via_irq.c +++ b/drivers/gpu/drm/via/via_irq.c -@@ -102,7 +102,7 @@ u32 via_get_vblank_counter(struct drm_device *dev, int crtc) +@@ -101,7 +101,7 @@ u32 via_get_vblank_counter(struct drm_device *dev, int crtc) if (crtc != 0) return 0; @@ -31224,7 +35866,7 @@ index d391f48..10c8ca3 100644 } irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS) -@@ -117,8 +117,8 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS) +@@ -116,8 +116,8 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS) status = VIA_READ(VIA_REG_INTERRUPT); if (status & VIA_IRQ_VBLANK_PENDING) { @@ -31235,7 +35877,7 @@ index d391f48..10c8ca3 100644 do_gettimeofday(&cur_vblank); if (dev_priv->last_vblank_valid) { dev_priv->usec_per_vblank = -@@ -128,7 +128,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS) +@@ -127,7 +127,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS) dev_priv->last_vblank = cur_vblank; dev_priv->last_vblank_valid = 1; } @@ -31244,7 +35886,7 @@ index d391f48..10c8ca3 100644 DRM_DEBUG("US per vblank is: %u\n", dev_priv->usec_per_vblank); } -@@ -138,7 +138,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS) +@@ -137,7 +137,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS) for (i = 0; i < dev_priv->num_irqs; ++i) { if (status & cur_irq->pending_mask) { @@ -31253,7 +35895,7 @@ index d391f48..10c8ca3 100644 DRM_WAKEUP(&cur_irq->irq_queue); handled = 1; if (dev_priv->irq_map[drm_via_irq_dma0_td] == i) -@@ -243,11 +243,11 @@ via_driver_irq_wait(struct drm_device *dev, unsigned int irq, int force_sequence +@@ -242,11 +242,11 @@ via_driver_irq_wait(struct drm_device *dev, unsigned int irq, int force_sequence DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * DRM_HZ, ((VIA_READ(masks[irq][2]) & masks[irq][3]) == masks[irq][4])); @@ -31267,7 +35909,7 @@ index d391f48..10c8ca3 100644 *sequence) <= (1 << 23))); } *sequence = cur_irq_sequence; -@@ -285,7 +285,7 @@ void via_driver_irq_preinstall(struct drm_device *dev) +@@ -284,7 +284,7 @@ void via_driver_irq_preinstall(struct drm_device *dev) } for (i = 0; i < dev_priv->num_irqs; ++i) { @@ -31276,7 +35918,7 @@ index d391f48..10c8ca3 100644 cur_irq->enable_mask = dev_priv->irq_masks[i][0]; cur_irq->pending_mask = dev_priv->irq_masks[i][1]; DRM_INIT_WAITQUEUE(&cur_irq->irq_queue); -@@ -367,7 +367,7 @@ int via_wait_irq(struct drm_device *dev, void *data, struct drm_file *file_priv) +@@ -366,7 +366,7 @@ int via_wait_irq(struct drm_device *dev, void *data, struct drm_file *file_priv) switch (irqwait->request.type & ~VIA_IRQ_FLAGS_MASK) { case VIA_IRQ_RELATIVE: irqwait->request.sequence += @@ -31286,10 +35928,10 @@ index d391f48..10c8ca3 100644 case VIA_IRQ_ABSOLUTE: break; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h -index d0f2c07..9ebd9c3 100644 +index 13aeda7..4a952d1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h -@@ -263,7 +263,7 @@ struct vmw_private { +@@ -290,7 +290,7 @@ struct vmw_private { * Fencing and IRQs. */ @@ -31299,7 +35941,7 @@ index d0f2c07..9ebd9c3 100644 wait_queue_head_t fifo_queue; int fence_queue_waiters; /* Protected by hw_mutex */ diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c -index a0c2f12..68ae6cb 100644 +index 3eb1486..0a47ee9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c @@ -137,7 +137,7 @@ int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo) @@ -31339,7 +35981,7 @@ index a0c2f12..68ae6cb 100644 if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE)) { diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c -index cabc95f..14b3d77 100644 +index 4640adb..e1384ed 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c @@ -107,7 +107,7 @@ bool vmw_seqno_passed(struct vmw_private *dev_priv, @@ -31361,7 +36003,7 @@ index cabc95f..14b3d77 100644 for (;;) { diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c b/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c -index 8a8725c..afed796 100644 +index 8a8725c2..afed796 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c @@ -151,7 +151,7 @@ int vmw_wait_lag(struct vmw_private *dev_priv, @@ -31374,10 +36016,10 @@ index 8a8725c..afed796 100644 marker = list_first_entry(&queue->head, struct vmw_marker, head); diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c -index 41d4437..631c2e5 100644 +index e6dbf09..3dd2540 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c -@@ -2073,7 +2073,7 @@ static bool hid_ignore(struct hid_device *hdev) +@@ -2268,7 +2268,7 @@ EXPORT_SYMBOL_GPL(hid_ignore); int hid_add_device(struct hid_device *hdev) { @@ -31386,7 +36028,7 @@ index 41d4437..631c2e5 100644 int ret; if (WARN_ON(hdev->status & HID_STAT_ADDED)) -@@ -2088,7 +2088,7 @@ int hid_add_device(struct hid_device *hdev) +@@ -2302,7 +2302,7 @@ int hid_add_device(struct hid_device *hdev) /* XXX hack, any other cleaner solution after the driver core * is converted to allow more than 20 bytes as the device name? */ dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus, @@ -31396,7 +36038,7 @@ index 41d4437..631c2e5 100644 hid_debug_register(hdev, dev_name(&hdev->dev)); ret = device_add(&hdev->dev); diff --git a/drivers/hid/hid-wiimote-debug.c b/drivers/hid/hid-wiimote-debug.c -index eec3291..8ed706b 100644 +index 90124ff..3761764 100644 --- a/drivers/hid/hid-wiimote-debug.c +++ b/drivers/hid/hid-wiimote-debug.c @@ -66,7 +66,7 @@ static ssize_t wiidebug_eeprom_read(struct file *f, char __user *u, size_t s, @@ -31408,24 +36050,11 @@ index eec3291..8ed706b 100644 return -EFAULT; *off += size; -diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c -index b1ec0e2..c295a61 100644 ---- a/drivers/hid/usbhid/hiddev.c -+++ b/drivers/hid/usbhid/hiddev.c -@@ -624,7 +624,7 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) - break; - - case HIDIOCAPPLICATION: -- if (arg < 0 || arg >= hid->maxapplication) -+ if (arg >= hid->maxapplication) - break; - - for (i = 0; i < hid->maxcollection; i++) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c -index 4065374..10ed7dc 100644 +index 0b122f8..b1d8160 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c -@@ -400,8 +400,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer, +@@ -394,8 +394,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer, int ret = 0; int t; @@ -31437,10 +36066,10 @@ index 4065374..10ed7dc 100644 ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount); if (ret) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c -index 15956bd..ea34398 100644 +index 7311589..861e9ef 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c -@@ -132,7 +132,7 @@ static u64 do_hypercall(u64 control, void *input, void *output) +@@ -112,7 +112,7 @@ static u64 do_hypercall(u64 control, void *input, void *output) u64 output_address = (output) ? virt_to_phys(output) : 0; u32 output_address_hi = output_address >> 32; u32 output_address_lo = output_address & 0xFFFFFFFF; @@ -31450,10 +36079,10 @@ index 15956bd..ea34398 100644 __asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi), "=a"(hv_status_lo) : "d" (control_hi), diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h -index 699f0d8..f4f19250 100644 +index 12f2f9e..679603c 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h -@@ -555,7 +555,7 @@ enum vmbus_connect_state { +@@ -591,7 +591,7 @@ enum vmbus_connect_state { struct vmbus_connection { enum vmbus_connect_state conn_state; @@ -31463,10 +36092,10 @@ index 699f0d8..f4f19250 100644 /* * Represents channel interrupts. Each bit position represents a diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c -index a220e57..428f54d 100644 +index bf421e0..ce2c897 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c -@@ -663,10 +663,10 @@ int vmbus_device_register(struct hv_device *child_device_obj) +@@ -668,10 +668,10 @@ int vmbus_device_register(struct hv_device *child_device_obj) { int ret = 0; @@ -31480,35 +36109,160 @@ index a220e57..428f54d 100644 child_device_obj->device.bus = &hv_bus; child_device_obj->device.parent = &hv_acpi_dev->dev; diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c -index 9140236..ceaef4e 100644 +index 6351aba..dc4aaf4 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c -@@ -316,8 +316,6 @@ static ssize_t set_trip(struct device *dev, struct device_attribute *devattr, - return res; +@@ -117,7 +117,7 @@ struct sensor_template { + struct device_attribute *devattr, + const char *buf, size_t count); + int index; +-}; ++} __do_const; - temp /= 1000; -- if (temp < 0) -- return -EINVAL; + /* Averaging interval */ + static int update_avg_interval(struct acpi_power_meter_resource *resource) +@@ -629,7 +629,7 @@ static int register_attrs(struct acpi_power_meter_resource *resource, + struct sensor_template *attrs) + { + struct device *dev = &resource->acpi_dev->dev; +- struct sensor_device_attribute *sensors = ++ sensor_device_attribute_no_const *sensors = + &resource->sensors[resource->num_sensors]; + int res = 0; + +diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c +index b41baff..4953e4d 100644 +--- a/drivers/hwmon/applesmc.c ++++ b/drivers/hwmon/applesmc.c +@@ -1084,7 +1084,7 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num) + { + struct applesmc_node_group *grp; + struct applesmc_dev_attr *node; +- struct attribute *attr; ++ attribute_no_const *attr; + int ret, i; + + for (grp = groups; grp->format; grp++) { +diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c +index b25c643..a13460d 100644 +--- a/drivers/hwmon/asus_atk0110.c ++++ b/drivers/hwmon/asus_atk0110.c +@@ -152,10 +152,10 @@ MODULE_DEVICE_TABLE(acpi, atk_ids); + struct atk_sensor_data { + struct list_head list; + struct atk_data *data; +- struct device_attribute label_attr; +- struct device_attribute input_attr; +- struct device_attribute limit1_attr; +- struct device_attribute limit2_attr; ++ device_attribute_no_const label_attr; ++ device_attribute_no_const input_attr; ++ device_attribute_no_const limit1_attr; ++ device_attribute_no_const limit2_attr; + char label_attr_name[ATTR_NAME_SIZE]; + char input_attr_name[ATTR_NAME_SIZE]; + char limit1_attr_name[ATTR_NAME_SIZE]; +@@ -275,7 +275,7 @@ static ssize_t atk_name_show(struct device *dev, + static struct device_attribute atk_name_attr = + __ATTR(name, 0444, atk_name_show, NULL); + +-static void atk_init_attribute(struct device_attribute *attr, char *name, ++static void atk_init_attribute(device_attribute_no_const *attr, char *name, + sysfs_show_func show) + { + sysfs_attr_init(&attr->attr); +diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c +index 3f1e297..a6cafb5 100644 +--- a/drivers/hwmon/coretemp.c ++++ b/drivers/hwmon/coretemp.c +@@ -791,7 +791,7 @@ static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block coretemp_cpu_notifier __refdata = { ++static struct notifier_block coretemp_cpu_notifier = { + .notifier_call = coretemp_cpu_callback, + }; - mutex_lock(&resource->lock); - resource->trip[attr->index - 7] = temp; +diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c +index a14f634..2916ee2 100644 +--- a/drivers/hwmon/ibmaem.c ++++ b/drivers/hwmon/ibmaem.c +@@ -925,7 +925,7 @@ static int aem_register_sensors(struct aem_data *data, + struct aem_rw_sensor_template *rw) + { + struct device *dev = &data->pdev->dev; +- struct sensor_device_attribute *sensors = data->sensors; ++ sensor_device_attribute_no_const *sensors = data->sensors; + int err; + + /* Set up read-only sensors */ +diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c +index 9add6092..ee7ba3f 100644 +--- a/drivers/hwmon/pmbus/pmbus_core.c ++++ b/drivers/hwmon/pmbus/pmbus_core.c +@@ -781,7 +781,7 @@ static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr) + return 0; + } + +-static void pmbus_dev_attr_init(struct device_attribute *dev_attr, ++static void pmbus_dev_attr_init(device_attribute_no_const *dev_attr, + const char *name, + umode_t mode, + ssize_t (*show)(struct device *dev, +@@ -798,7 +798,7 @@ static void pmbus_dev_attr_init(struct device_attribute *dev_attr, + dev_attr->store = store; + } + +-static void pmbus_attr_init(struct sensor_device_attribute *a, ++static void pmbus_attr_init(sensor_device_attribute_no_const *a, + const char *name, + umode_t mode, + ssize_t (*show)(struct device *dev, +@@ -820,7 +820,7 @@ static int pmbus_add_boolean(struct pmbus_data *data, + u16 reg, u8 mask) + { + struct pmbus_boolean *boolean; +- struct sensor_device_attribute *a; ++ sensor_device_attribute_no_const *a; + + boolean = devm_kzalloc(data->dev, sizeof(*boolean), GFP_KERNEL); + if (!boolean) +@@ -845,7 +845,7 @@ static struct pmbus_sensor *pmbus_add_sensor(struct pmbus_data *data, + bool update, bool readonly) + { + struct pmbus_sensor *sensor; +- struct device_attribute *a; ++ device_attribute_no_const *a; + + sensor = devm_kzalloc(data->dev, sizeof(*sensor), GFP_KERNEL); + if (!sensor) +@@ -876,7 +876,7 @@ static int pmbus_add_label(struct pmbus_data *data, + const char *lstring, int index) + { + struct pmbus_label *label; +- struct device_attribute *a; ++ device_attribute_no_const *a; + + label = devm_kzalloc(data->dev, sizeof(*label), GFP_KERNEL); + if (!label) diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c -index 8b011d0..3de24a1 100644 +index 2507f90..1645765 100644 --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c -@@ -166,7 +166,7 @@ struct sht15_data { - int supply_uV; - bool supply_uV_valid; +@@ -169,7 +169,7 @@ struct sht15_data { + int supply_uv; + bool supply_uv_valid; struct work_struct update_supply_work; - atomic_t interrupt_handled; + atomic_unchecked_t interrupt_handled; }; /** -@@ -509,13 +509,13 @@ static int sht15_measurement(struct sht15_data *data, +@@ -542,13 +542,13 @@ static int sht15_measurement(struct sht15_data *data, + ret = gpio_direction_input(data->pdata->gpio_data); + if (ret) return ret; - - gpio_direction_input(data->pdata->gpio_data); - atomic_set(&data->interrupt_handled, 0); + atomic_set_unchecked(&data->interrupt_handled, 0); @@ -31521,7 +36275,7 @@ index 8b011d0..3de24a1 100644 schedule_work(&data->read_work); } ret = wait_event_timeout(data->wait_queue, -@@ -782,7 +782,7 @@ static irqreturn_t sht15_interrupt_fired(int irq, void *d) +@@ -820,7 +820,7 @@ static irqreturn_t sht15_interrupt_fired(int irq, void *d) /* First disable the interrupt */ disable_irq_nosync(irq); @@ -31530,7 +36284,7 @@ index 8b011d0..3de24a1 100644 /* Then schedule a reading work struct */ if (data->state != SHT15_READING_NOTHING) schedule_work(&data->read_work); -@@ -804,11 +804,11 @@ static void sht15_bh_read_data(struct work_struct *work_s) +@@ -842,11 +842,11 @@ static void sht15_bh_read_data(struct work_struct *work_s) * If not, then start the interrupt again - care here as could * have gone low in meantime so verify it hasn't! */ @@ -31544,6 +36298,19 @@ index 8b011d0..3de24a1 100644 return; } +diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c +index 76f157b..9c0db1b 100644 +--- a/drivers/hwmon/via-cputemp.c ++++ b/drivers/hwmon/via-cputemp.c +@@ -296,7 +296,7 @@ static int __cpuinit via_cputemp_cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block via_cputemp_cpu_notifier __refdata = { ++static struct notifier_block via_cputemp_cpu_notifier = { + .notifier_call = via_cputemp_cpu_callback, + }; + diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c index 378fcb5..5e91fa8 100644 --- a/drivers/i2c/busses/i2c-amd756-s4882.c @@ -31570,248 +36337,6 @@ index 29015eb..af2d8e9 100644 /* Wrapper access functions for multiplexed SMBus */ static DEFINE_MUTEX(nforce2_lock); -diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c -index d7a4833..7fae376 100644 ---- a/drivers/i2c/i2c-mux.c -+++ b/drivers/i2c/i2c-mux.c -@@ -28,7 +28,7 @@ - /* multiplexer per channel data */ - struct i2c_mux_priv { - struct i2c_adapter adap; -- struct i2c_algorithm algo; -+ i2c_algorithm_no_const algo; - - struct i2c_adapter *parent; - void *mux_dev; /* the mux chip/device */ -diff --git a/drivers/ide/aec62xx.c b/drivers/ide/aec62xx.c -index 57d00ca..0145194 100644 ---- a/drivers/ide/aec62xx.c -+++ b/drivers/ide/aec62xx.c -@@ -181,7 +181,7 @@ static const struct ide_port_ops atp86x_port_ops = { - .cable_detect = atp86x_cable_detect, - }; - --static const struct ide_port_info aec62xx_chipsets[] __devinitdata = { -+static const struct ide_port_info aec62xx_chipsets[] __devinitconst = { - { /* 0: AEC6210 */ - .name = DRV_NAME, - .init_chipset = init_chipset_aec62xx, -diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c -index 2c8016a..911a27c 100644 ---- a/drivers/ide/alim15x3.c -+++ b/drivers/ide/alim15x3.c -@@ -512,7 +512,7 @@ static const struct ide_dma_ops ali_dma_ops = { - .dma_sff_read_status = ide_dma_sff_read_status, - }; - --static const struct ide_port_info ali15x3_chipset __devinitdata = { -+static const struct ide_port_info ali15x3_chipset __devinitconst = { - .name = DRV_NAME, - .init_chipset = init_chipset_ali15x3, - .init_hwif = init_hwif_ali15x3, -diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c -index 3747b25..56fc995 100644 ---- a/drivers/ide/amd74xx.c -+++ b/drivers/ide/amd74xx.c -@@ -223,7 +223,7 @@ static const struct ide_port_ops amd_port_ops = { - .udma_mask = udma, \ - } - --static const struct ide_port_info amd74xx_chipsets[] __devinitdata = { -+static const struct ide_port_info amd74xx_chipsets[] __devinitconst = { - /* 0: AMD7401 */ DECLARE_AMD_DEV(0x00, ATA_UDMA2), - /* 1: AMD7409 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA4), - /* 2: AMD7411/7441 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5), -diff --git a/drivers/ide/atiixp.c b/drivers/ide/atiixp.c -index 15f0ead..cb43480 100644 ---- a/drivers/ide/atiixp.c -+++ b/drivers/ide/atiixp.c -@@ -139,7 +139,7 @@ static const struct ide_port_ops atiixp_port_ops = { - .cable_detect = atiixp_cable_detect, - }; - --static const struct ide_port_info atiixp_pci_info[] __devinitdata = { -+static const struct ide_port_info atiixp_pci_info[] __devinitconst = { - { /* 0: IXP200/300/400/700 */ - .name = DRV_NAME, - .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, -diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c -index 5f80312..d1fc438 100644 ---- a/drivers/ide/cmd64x.c -+++ b/drivers/ide/cmd64x.c -@@ -327,7 +327,7 @@ static const struct ide_dma_ops cmd646_rev1_dma_ops = { - .dma_sff_read_status = ide_dma_sff_read_status, - }; - --static const struct ide_port_info cmd64x_chipsets[] __devinitdata = { -+static const struct ide_port_info cmd64x_chipsets[] __devinitconst = { - { /* 0: CMD643 */ - .name = DRV_NAME, - .init_chipset = init_chipset_cmd64x, -diff --git a/drivers/ide/cs5520.c b/drivers/ide/cs5520.c -index 2c1e5f7..1444762 100644 ---- a/drivers/ide/cs5520.c -+++ b/drivers/ide/cs5520.c -@@ -94,7 +94,7 @@ static const struct ide_port_ops cs5520_port_ops = { - .set_dma_mode = cs5520_set_dma_mode, - }; - --static const struct ide_port_info cyrix_chipset __devinitdata = { -+static const struct ide_port_info cyrix_chipset __devinitconst = { - .name = DRV_NAME, - .enablebits = { { 0x60, 0x01, 0x01 }, { 0x60, 0x02, 0x02 } }, - .port_ops = &cs5520_port_ops, -diff --git a/drivers/ide/cs5530.c b/drivers/ide/cs5530.c -index 4dc4eb9..49b40ad 100644 ---- a/drivers/ide/cs5530.c -+++ b/drivers/ide/cs5530.c -@@ -245,7 +245,7 @@ static const struct ide_port_ops cs5530_port_ops = { - .udma_filter = cs5530_udma_filter, - }; - --static const struct ide_port_info cs5530_chipset __devinitdata = { -+static const struct ide_port_info cs5530_chipset __devinitconst = { - .name = DRV_NAME, - .init_chipset = init_chipset_cs5530, - .init_hwif = init_hwif_cs5530, -diff --git a/drivers/ide/cs5535.c b/drivers/ide/cs5535.c -index 5059faf..18d4c85 100644 ---- a/drivers/ide/cs5535.c -+++ b/drivers/ide/cs5535.c -@@ -170,7 +170,7 @@ static const struct ide_port_ops cs5535_port_ops = { - .cable_detect = cs5535_cable_detect, - }; - --static const struct ide_port_info cs5535_chipset __devinitdata = { -+static const struct ide_port_info cs5535_chipset __devinitconst = { - .name = DRV_NAME, - .port_ops = &cs5535_port_ops, - .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE, -diff --git a/drivers/ide/cy82c693.c b/drivers/ide/cy82c693.c -index 847553f..3ffb49d 100644 ---- a/drivers/ide/cy82c693.c -+++ b/drivers/ide/cy82c693.c -@@ -163,7 +163,7 @@ static const struct ide_port_ops cy82c693_port_ops = { - .set_dma_mode = cy82c693_set_dma_mode, - }; - --static const struct ide_port_info cy82c693_chipset __devinitdata = { -+static const struct ide_port_info cy82c693_chipset __devinitconst = { - .name = DRV_NAME, - .init_iops = init_iops_cy82c693, - .port_ops = &cy82c693_port_ops, -diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c -index 58c51cd..4aec3b8 100644 ---- a/drivers/ide/hpt366.c -+++ b/drivers/ide/hpt366.c -@@ -443,7 +443,7 @@ static struct hpt_timings hpt37x_timings = { - } - }; - --static const struct hpt_info hpt36x __devinitdata = { -+static const struct hpt_info hpt36x __devinitconst = { - .chip_name = "HPT36x", - .chip_type = HPT36x, - .udma_mask = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2, -@@ -451,7 +451,7 @@ static const struct hpt_info hpt36x __devinitdata = { - .timings = &hpt36x_timings - }; - --static const struct hpt_info hpt370 __devinitdata = { -+static const struct hpt_info hpt370 __devinitconst = { - .chip_name = "HPT370", - .chip_type = HPT370, - .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4, -@@ -459,7 +459,7 @@ static const struct hpt_info hpt370 __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt370a __devinitdata = { -+static const struct hpt_info hpt370a __devinitconst = { - .chip_name = "HPT370A", - .chip_type = HPT370A, - .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4, -@@ -467,7 +467,7 @@ static const struct hpt_info hpt370a __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt374 __devinitdata = { -+static const struct hpt_info hpt374 __devinitconst = { - .chip_name = "HPT374", - .chip_type = HPT374, - .udma_mask = ATA_UDMA5, -@@ -475,7 +475,7 @@ static const struct hpt_info hpt374 __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt372 __devinitdata = { -+static const struct hpt_info hpt372 __devinitconst = { - .chip_name = "HPT372", - .chip_type = HPT372, - .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, -@@ -483,7 +483,7 @@ static const struct hpt_info hpt372 __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt372a __devinitdata = { -+static const struct hpt_info hpt372a __devinitconst = { - .chip_name = "HPT372A", - .chip_type = HPT372A, - .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, -@@ -491,7 +491,7 @@ static const struct hpt_info hpt372a __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt302 __devinitdata = { -+static const struct hpt_info hpt302 __devinitconst = { - .chip_name = "HPT302", - .chip_type = HPT302, - .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, -@@ -499,7 +499,7 @@ static const struct hpt_info hpt302 __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt371 __devinitdata = { -+static const struct hpt_info hpt371 __devinitconst = { - .chip_name = "HPT371", - .chip_type = HPT371, - .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, -@@ -507,7 +507,7 @@ static const struct hpt_info hpt371 __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt372n __devinitdata = { -+static const struct hpt_info hpt372n __devinitconst = { - .chip_name = "HPT372N", - .chip_type = HPT372N, - .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, -@@ -515,7 +515,7 @@ static const struct hpt_info hpt372n __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt302n __devinitdata = { -+static const struct hpt_info hpt302n __devinitconst = { - .chip_name = "HPT302N", - .chip_type = HPT302N, - .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, -@@ -523,7 +523,7 @@ static const struct hpt_info hpt302n __devinitdata = { - .timings = &hpt37x_timings - }; - --static const struct hpt_info hpt371n __devinitdata = { -+static const struct hpt_info hpt371n __devinitconst = { - .chip_name = "HPT371N", - .chip_type = HPT371N, - .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, -@@ -1361,7 +1361,7 @@ static const struct ide_dma_ops hpt36x_dma_ops = { - .dma_sff_read_status = ide_dma_sff_read_status, - }; - --static const struct ide_port_info hpt366_chipsets[] __devinitdata = { -+static const struct ide_port_info hpt366_chipsets[] __devinitconst = { - { /* 0: HPT36x */ - .name = DRV_NAME, - .init_chipset = init_chipset_hpt366, diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 8126824..55a2798 100644 --- a/drivers/ide/ide-cd.c @@ -31825,307 +36350,21 @@ index 8126824..55a2798 100644 drive->dma = 0; } } -diff --git a/drivers/ide/ide-pci-generic.c b/drivers/ide/ide-pci-generic.c -index 7f56b73..dab5b67 100644 ---- a/drivers/ide/ide-pci-generic.c -+++ b/drivers/ide/ide-pci-generic.c -@@ -53,7 +53,7 @@ static const struct ide_port_ops netcell_port_ops = { - .udma_mask = ATA_UDMA6, \ - } - --static const struct ide_port_info generic_chipsets[] __devinitdata = { -+static const struct ide_port_info generic_chipsets[] __devinitconst = { - /* 0: Unknown */ - DECLARE_GENERIC_PCI_DEV(0), - -diff --git a/drivers/ide/it8172.c b/drivers/ide/it8172.c -index 560e66d..d5dd180 100644 ---- a/drivers/ide/it8172.c -+++ b/drivers/ide/it8172.c -@@ -115,7 +115,7 @@ static const struct ide_port_ops it8172_port_ops = { - .set_dma_mode = it8172_set_dma_mode, - }; - --static const struct ide_port_info it8172_port_info __devinitdata = { -+static const struct ide_port_info it8172_port_info __devinitconst = { - .name = DRV_NAME, - .port_ops = &it8172_port_ops, - .enablebits = { {0x41, 0x80, 0x80}, {0x00, 0x00, 0x00} }, -diff --git a/drivers/ide/it8213.c b/drivers/ide/it8213.c -index 46816ba..1847aeb 100644 ---- a/drivers/ide/it8213.c -+++ b/drivers/ide/it8213.c -@@ -156,7 +156,7 @@ static const struct ide_port_ops it8213_port_ops = { - .cable_detect = it8213_cable_detect, - }; - --static const struct ide_port_info it8213_chipset __devinitdata = { -+static const struct ide_port_info it8213_chipset __devinitconst = { - .name = DRV_NAME, - .enablebits = { {0x41, 0x80, 0x80} }, - .port_ops = &it8213_port_ops, -diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c -index 2e3169f..c5611db 100644 ---- a/drivers/ide/it821x.c -+++ b/drivers/ide/it821x.c -@@ -630,7 +630,7 @@ static const struct ide_port_ops it821x_port_ops = { - .cable_detect = it821x_cable_detect, - }; - --static const struct ide_port_info it821x_chipset __devinitdata = { -+static const struct ide_port_info it821x_chipset __devinitconst = { - .name = DRV_NAME, - .init_chipset = init_chipset_it821x, - .init_hwif = init_hwif_it821x, -diff --git a/drivers/ide/jmicron.c b/drivers/ide/jmicron.c -index 74c2c4a..efddd7d 100644 ---- a/drivers/ide/jmicron.c -+++ b/drivers/ide/jmicron.c -@@ -102,7 +102,7 @@ static const struct ide_port_ops jmicron_port_ops = { - .cable_detect = jmicron_cable_detect, - }; - --static const struct ide_port_info jmicron_chipset __devinitdata = { -+static const struct ide_port_info jmicron_chipset __devinitconst = { - .name = DRV_NAME, - .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } }, - .port_ops = &jmicron_port_ops, -diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c -index 95327a2..73f78d8 100644 ---- a/drivers/ide/ns87415.c -+++ b/drivers/ide/ns87415.c -@@ -293,7 +293,7 @@ static const struct ide_dma_ops ns87415_dma_ops = { - .dma_sff_read_status = superio_dma_sff_read_status, - }; - --static const struct ide_port_info ns87415_chipset __devinitdata = { -+static const struct ide_port_info ns87415_chipset __devinitconst = { - .name = DRV_NAME, - .init_hwif = init_hwif_ns87415, - .tp_ops = &ns87415_tp_ops, -diff --git a/drivers/ide/opti621.c b/drivers/ide/opti621.c -index 1a53a4c..39edc66 100644 ---- a/drivers/ide/opti621.c -+++ b/drivers/ide/opti621.c -@@ -131,7 +131,7 @@ static const struct ide_port_ops opti621_port_ops = { - .set_pio_mode = opti621_set_pio_mode, - }; - --static const struct ide_port_info opti621_chipset __devinitdata = { -+static const struct ide_port_info opti621_chipset __devinitconst = { - .name = DRV_NAME, - .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} }, - .port_ops = &opti621_port_ops, -diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c -index 9546fe2..2e5ceb6 100644 ---- a/drivers/ide/pdc202xx_new.c -+++ b/drivers/ide/pdc202xx_new.c -@@ -465,7 +465,7 @@ static const struct ide_port_ops pdcnew_port_ops = { - .udma_mask = udma, \ - } - --static const struct ide_port_info pdcnew_chipsets[] __devinitdata = { -+static const struct ide_port_info pdcnew_chipsets[] __devinitconst = { - /* 0: PDC202{68,70} */ DECLARE_PDCNEW_DEV(ATA_UDMA5), - /* 1: PDC202{69,71,75,76,77} */ DECLARE_PDCNEW_DEV(ATA_UDMA6), - }; -diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c -index 3a35ec6..5634510 100644 ---- a/drivers/ide/pdc202xx_old.c -+++ b/drivers/ide/pdc202xx_old.c -@@ -270,7 +270,7 @@ static const struct ide_dma_ops pdc2026x_dma_ops = { - .max_sectors = sectors, \ - } - --static const struct ide_port_info pdc202xx_chipsets[] __devinitdata = { -+static const struct ide_port_info pdc202xx_chipsets[] __devinitconst = { - { /* 0: PDC20246 */ - .name = DRV_NAME, - .init_chipset = init_chipset_pdc202xx, -diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c -index 1892e81..fe0fd60 100644 ---- a/drivers/ide/piix.c -+++ b/drivers/ide/piix.c -@@ -344,7 +344,7 @@ static const struct ide_port_ops ich_port_ops = { - .udma_mask = udma, \ - } - --static const struct ide_port_info piix_pci_info[] __devinitdata = { -+static const struct ide_port_info piix_pci_info[] __devinitconst = { - /* 0: MPIIX */ - { /* - * MPIIX actually has only a single IDE channel mapped to -diff --git a/drivers/ide/rz1000.c b/drivers/ide/rz1000.c -index a6414a8..c04173e 100644 ---- a/drivers/ide/rz1000.c -+++ b/drivers/ide/rz1000.c -@@ -38,7 +38,7 @@ static int __devinit rz1000_disable_readahead(struct pci_dev *dev) - } - } - --static const struct ide_port_info rz1000_chipset __devinitdata = { -+static const struct ide_port_info rz1000_chipset __devinitconst = { - .name = DRV_NAME, - .host_flags = IDE_HFLAG_NO_DMA, - }; -diff --git a/drivers/ide/sc1200.c b/drivers/ide/sc1200.c -index 356b9b5..d4758eb 100644 ---- a/drivers/ide/sc1200.c -+++ b/drivers/ide/sc1200.c -@@ -291,7 +291,7 @@ static const struct ide_dma_ops sc1200_dma_ops = { - .dma_sff_read_status = ide_dma_sff_read_status, - }; - --static const struct ide_port_info sc1200_chipset __devinitdata = { -+static const struct ide_port_info sc1200_chipset __devinitconst = { - .name = DRV_NAME, - .port_ops = &sc1200_port_ops, - .dma_ops = &sc1200_dma_ops, -diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c -index b7f5b0c..9701038 100644 ---- a/drivers/ide/scc_pata.c -+++ b/drivers/ide/scc_pata.c -@@ -811,7 +811,7 @@ static const struct ide_dma_ops scc_dma_ops = { - .dma_sff_read_status = scc_dma_sff_read_status, - }; - --static const struct ide_port_info scc_chipset __devinitdata = { -+static const struct ide_port_info scc_chipset __devinitconst = { - .name = "sccIDE", - .init_iops = init_iops_scc, - .init_dma = scc_init_dma, -diff --git a/drivers/ide/serverworks.c b/drivers/ide/serverworks.c -index 35fb8da..24d72ef 100644 ---- a/drivers/ide/serverworks.c -+++ b/drivers/ide/serverworks.c -@@ -337,7 +337,7 @@ static const struct ide_port_ops svwks_port_ops = { - .cable_detect = svwks_cable_detect, - }; - --static const struct ide_port_info serverworks_chipsets[] __devinitdata = { -+static const struct ide_port_info serverworks_chipsets[] __devinitconst = { - { /* 0: OSB4 */ - .name = DRV_NAME, - .init_chipset = init_chipset_svwks, -diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c -index ddeda44..46f7e30 100644 ---- a/drivers/ide/siimage.c -+++ b/drivers/ide/siimage.c -@@ -719,7 +719,7 @@ static const struct ide_dma_ops sil_dma_ops = { - .udma_mask = ATA_UDMA6, \ - } - --static const struct ide_port_info siimage_chipsets[] __devinitdata = { -+static const struct ide_port_info siimage_chipsets[] __devinitconst = { - /* 0: SiI680 */ DECLARE_SII_DEV(&sil_pata_port_ops), - /* 1: SiI3112 */ DECLARE_SII_DEV(&sil_sata_port_ops) - }; -diff --git a/drivers/ide/sis5513.c b/drivers/ide/sis5513.c -index 4a00225..09e61b4 100644 ---- a/drivers/ide/sis5513.c -+++ b/drivers/ide/sis5513.c -@@ -563,7 +563,7 @@ static const struct ide_port_ops sis_ata133_port_ops = { - .cable_detect = sis_cable_detect, - }; - --static const struct ide_port_info sis5513_chipset __devinitdata = { -+static const struct ide_port_info sis5513_chipset __devinitconst = { - .name = DRV_NAME, - .init_chipset = init_chipset_sis5513, - .enablebits = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} }, -diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c -index f21dc2a..d051cd2 100644 ---- a/drivers/ide/sl82c105.c -+++ b/drivers/ide/sl82c105.c -@@ -299,7 +299,7 @@ static const struct ide_dma_ops sl82c105_dma_ops = { - .dma_sff_read_status = ide_dma_sff_read_status, - }; - --static const struct ide_port_info sl82c105_chipset __devinitdata = { -+static const struct ide_port_info sl82c105_chipset __devinitconst = { - .name = DRV_NAME, - .init_chipset = init_chipset_sl82c105, - .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, -diff --git a/drivers/ide/slc90e66.c b/drivers/ide/slc90e66.c -index 864ffe0..863a5e9 100644 ---- a/drivers/ide/slc90e66.c -+++ b/drivers/ide/slc90e66.c -@@ -132,7 +132,7 @@ static const struct ide_port_ops slc90e66_port_ops = { - .cable_detect = slc90e66_cable_detect, - }; - --static const struct ide_port_info slc90e66_chipset __devinitdata = { -+static const struct ide_port_info slc90e66_chipset __devinitconst = { - .name = DRV_NAME, - .enablebits = { {0x41, 0x80, 0x80}, {0x43, 0x80, 0x80} }, - .port_ops = &slc90e66_port_ops, -diff --git a/drivers/ide/tc86c001.c b/drivers/ide/tc86c001.c -index 4799d5c..1794678 100644 ---- a/drivers/ide/tc86c001.c -+++ b/drivers/ide/tc86c001.c -@@ -192,7 +192,7 @@ static const struct ide_dma_ops tc86c001_dma_ops = { - .dma_sff_read_status = ide_dma_sff_read_status, - }; - --static const struct ide_port_info tc86c001_chipset __devinitdata = { -+static const struct ide_port_info tc86c001_chipset __devinitconst = { - .name = DRV_NAME, - .init_hwif = init_hwif_tc86c001, - .port_ops = &tc86c001_port_ops, -diff --git a/drivers/ide/triflex.c b/drivers/ide/triflex.c -index 281c914..55ce1b8 100644 ---- a/drivers/ide/triflex.c -+++ b/drivers/ide/triflex.c -@@ -92,7 +92,7 @@ static const struct ide_port_ops triflex_port_ops = { - .set_dma_mode = triflex_set_mode, - }; - --static const struct ide_port_info triflex_device __devinitdata = { -+static const struct ide_port_info triflex_device __devinitconst = { - .name = DRV_NAME, - .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, - .port_ops = &triflex_port_ops, -diff --git a/drivers/ide/trm290.c b/drivers/ide/trm290.c -index 4b42ca0..e494a98 100644 ---- a/drivers/ide/trm290.c -+++ b/drivers/ide/trm290.c -@@ -324,7 +324,7 @@ static struct ide_dma_ops trm290_dma_ops = { - .dma_check = trm290_dma_check, - }; - --static const struct ide_port_info trm290_chipset __devinitdata = { -+static const struct ide_port_info trm290_chipset __devinitconst = { - .name = DRV_NAME, - .init_hwif = init_hwif_trm290, - .tp_ops = &trm290_tp_ops, -diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c -index f46f49c..eb77678 100644 ---- a/drivers/ide/via82cxxx.c -+++ b/drivers/ide/via82cxxx.c -@@ -403,7 +403,7 @@ static const struct ide_port_ops via_port_ops = { - .cable_detect = via82cxxx_cable_detect, - }; - --static const struct ide_port_info via82cxxx_chipset __devinitdata = { -+static const struct ide_port_info via82cxxx_chipset __devinitconst = { - .name = DRV_NAME, - .init_chipset = init_chipset_via82cxxx, - .enablebits = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } }, -diff --git a/drivers/ieee802154/fakehard.c b/drivers/ieee802154/fakehard.c -index 73d4531..c90cd2d 100644 ---- a/drivers/ieee802154/fakehard.c -+++ b/drivers/ieee802154/fakehard.c -@@ -386,7 +386,7 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev) - phy->transmit_power = 0xbf; - - dev->netdev_ops = &fake_ops; -- dev->ml_priv = &fake_mlme; -+ dev->ml_priv = (void *)&fake_mlme; +diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c +index 8848f16..f8e6dd8 100644 +--- a/drivers/iio/industrialio-core.c ++++ b/drivers/iio/industrialio-core.c +@@ -506,7 +506,7 @@ static ssize_t iio_write_channel_info(struct device *dev, + } - priv = netdev_priv(dev); - priv->phy = phy; + static +-int __iio_device_attr_init(struct device_attribute *dev_attr, ++int __iio_device_attr_init(device_attribute_no_const *dev_attr, + const char *postfix, + struct iio_chan_spec const *chan, + ssize_t (*readfunc)(struct device *dev, diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c -index c889aae..6cf5aa7 100644 +index 784b97c..c9ceadf 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -114,7 +114,7 @@ static char const counter_group_names[CM_COUNTER_GROUPS] @@ -32137,7 +36376,7 @@ index c889aae..6cf5aa7 100644 }; struct cm_counter_attribute { -@@ -1394,7 +1394,7 @@ static void cm_dup_req_handler(struct cm_work *work, +@@ -1395,7 +1395,7 @@ static void cm_dup_req_handler(struct cm_work *work, struct ib_mad_send_buf *msg = NULL; int ret; @@ -32146,7 +36385,7 @@ index c889aae..6cf5aa7 100644 counter[CM_REQ_COUNTER]); /* Quick state check to discard duplicate REQs. */ -@@ -1778,7 +1778,7 @@ static void cm_dup_rep_handler(struct cm_work *work) +@@ -1779,7 +1779,7 @@ static void cm_dup_rep_handler(struct cm_work *work) if (!cm_id_priv) return; @@ -32155,7 +36394,7 @@ index c889aae..6cf5aa7 100644 counter[CM_REP_COUNTER]); ret = cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg); if (ret) -@@ -1945,7 +1945,7 @@ static int cm_rtu_handler(struct cm_work *work) +@@ -1946,7 +1946,7 @@ static int cm_rtu_handler(struct cm_work *work) if (cm_id_priv->id.state != IB_CM_REP_SENT && cm_id_priv->id.state != IB_CM_MRA_REP_RCVD) { spin_unlock_irq(&cm_id_priv->lock); @@ -32164,7 +36403,7 @@ index c889aae..6cf5aa7 100644 counter[CM_RTU_COUNTER]); goto out; } -@@ -2128,7 +2128,7 @@ static int cm_dreq_handler(struct cm_work *work) +@@ -2129,7 +2129,7 @@ static int cm_dreq_handler(struct cm_work *work) cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id, dreq_msg->local_comm_id); if (!cm_id_priv) { @@ -32173,7 +36412,7 @@ index c889aae..6cf5aa7 100644 counter[CM_DREQ_COUNTER]); cm_issue_drep(work->port, work->mad_recv_wc); return -EINVAL; -@@ -2153,7 +2153,7 @@ static int cm_dreq_handler(struct cm_work *work) +@@ -2154,7 +2154,7 @@ static int cm_dreq_handler(struct cm_work *work) case IB_CM_MRA_REP_RCVD: break; case IB_CM_TIMEWAIT: @@ -32182,7 +36421,7 @@ index c889aae..6cf5aa7 100644 counter[CM_DREQ_COUNTER]); if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg)) goto unlock; -@@ -2167,7 +2167,7 @@ static int cm_dreq_handler(struct cm_work *work) +@@ -2168,7 +2168,7 @@ static int cm_dreq_handler(struct cm_work *work) cm_free_msg(msg); goto deref; case IB_CM_DREQ_RCVD: @@ -32191,7 +36430,7 @@ index c889aae..6cf5aa7 100644 counter[CM_DREQ_COUNTER]); goto unlock; default: -@@ -2534,7 +2534,7 @@ static int cm_mra_handler(struct cm_work *work) +@@ -2535,7 +2535,7 @@ static int cm_mra_handler(struct cm_work *work) ib_modify_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg, timeout)) { if (cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD) @@ -32200,7 +36439,7 @@ index c889aae..6cf5aa7 100644 counter_group[CM_RECV_DUPLICATES]. counter[CM_MRA_COUNTER]); goto out; -@@ -2543,7 +2543,7 @@ static int cm_mra_handler(struct cm_work *work) +@@ -2544,7 +2544,7 @@ static int cm_mra_handler(struct cm_work *work) break; case IB_CM_MRA_REQ_RCVD: case IB_CM_MRA_REP_RCVD: @@ -32209,7 +36448,7 @@ index c889aae..6cf5aa7 100644 counter[CM_MRA_COUNTER]); /* fall through */ default: -@@ -2705,7 +2705,7 @@ static int cm_lap_handler(struct cm_work *work) +@@ -2706,7 +2706,7 @@ static int cm_lap_handler(struct cm_work *work) case IB_CM_LAP_IDLE: break; case IB_CM_MRA_LAP_SENT: @@ -32218,7 +36457,7 @@ index c889aae..6cf5aa7 100644 counter[CM_LAP_COUNTER]); if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg)) goto unlock; -@@ -2721,7 +2721,7 @@ static int cm_lap_handler(struct cm_work *work) +@@ -2722,7 +2722,7 @@ static int cm_lap_handler(struct cm_work *work) cm_free_msg(msg); goto deref; case IB_CM_LAP_RCVD: @@ -32227,7 +36466,7 @@ index c889aae..6cf5aa7 100644 counter[CM_LAP_COUNTER]); goto unlock; default: -@@ -3005,7 +3005,7 @@ static int cm_sidr_req_handler(struct cm_work *work) +@@ -3006,7 +3006,7 @@ static int cm_sidr_req_handler(struct cm_work *work) cur_cm_id_priv = cm_insert_remote_sidr(cm_id_priv); if (cur_cm_id_priv) { spin_unlock_irq(&cm.lock); @@ -32236,7 +36475,7 @@ index c889aae..6cf5aa7 100644 counter[CM_SIDR_REQ_COUNTER]); goto out; /* Duplicate message. */ } -@@ -3217,10 +3217,10 @@ static void cm_send_handler(struct ib_mad_agent *mad_agent, +@@ -3218,10 +3218,10 @@ static void cm_send_handler(struct ib_mad_agent *mad_agent, if (!msg->context[0] && (attr_index != CM_REJ_COUNTER)) msg->retries = 1; @@ -32249,7 +36488,7 @@ index c889aae..6cf5aa7 100644 &port->counter_group[CM_XMIT_RETRIES]. counter[attr_index]); -@@ -3430,7 +3430,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, +@@ -3431,7 +3431,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, } attr_id = be16_to_cpu(mad_recv_wc->recv_buf.mad->mad_hdr.attr_id); @@ -32258,7 +36497,7 @@ index c889aae..6cf5aa7 100644 counter[attr_id - CM_ATTR_ID_OFFSET]); work = kmalloc(sizeof *work + sizeof(struct ib_sa_path_rec) * paths, -@@ -3635,7 +3635,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr, +@@ -3636,7 +3636,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr, cm_attr = container_of(attr, struct cm_counter_attribute, attr); return sprintf(buf, "%ld\n", @@ -32268,7 +36507,7 @@ index c889aae..6cf5aa7 100644 static const struct sysfs_ops cm_counter_ops = { diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c -index 176c8f9..2627b62 100644 +index 9f5ad7c..588cd84 100644 --- a/drivers/infiniband/core/fmr_pool.c +++ b/drivers/infiniband/core/fmr_pool.c @@ -98,8 +98,8 @@ struct ib_fmr_pool { @@ -32282,7 +36521,7 @@ index 176c8f9..2627b62 100644 wait_queue_head_t force_wait; }; -@@ -180,10 +180,10 @@ static int ib_fmr_cleanup_thread(void *pool_ptr) +@@ -179,10 +179,10 @@ static int ib_fmr_cleanup_thread(void *pool_ptr) struct ib_fmr_pool *pool = pool_ptr; do { @@ -32295,7 +36534,7 @@ index 176c8f9..2627b62 100644 wake_up_interruptible(&pool->force_wait); if (pool->flush_function) -@@ -191,7 +191,7 @@ static int ib_fmr_cleanup_thread(void *pool_ptr) +@@ -190,7 +190,7 @@ static int ib_fmr_cleanup_thread(void *pool_ptr) } set_current_state(TASK_INTERRUPTIBLE); @@ -32304,7 +36543,7 @@ index 176c8f9..2627b62 100644 !kthread_should_stop()) schedule(); __set_current_state(TASK_RUNNING); -@@ -283,8 +283,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd, +@@ -282,8 +282,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd, pool->dirty_watermark = params->dirty_watermark; pool->dirty_len = 0; spin_lock_init(&pool->pool_lock); @@ -32315,7 +36554,7 @@ index 176c8f9..2627b62 100644 init_waitqueue_head(&pool->force_wait); pool->thread = kthread_run(ib_fmr_cleanup_thread, -@@ -412,11 +412,11 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool) +@@ -411,11 +411,11 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool) } spin_unlock_irq(&pool->pool_lock); @@ -32329,7 +36568,7 @@ index 176c8f9..2627b62 100644 return -EINTR; return 0; -@@ -526,7 +526,7 @@ int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr) +@@ -525,7 +525,7 @@ int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr) } else { list_add_tail(&fmr->list, &pool->dirty_list); if (++pool->dirty_len >= pool->dirty_watermark) { @@ -32339,7 +36578,7 @@ index 176c8f9..2627b62 100644 } } diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c -index 40c8353..946b0e4 100644 +index 903a92d..9262548 100644 --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c @@ -122,7 +122,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, @@ -32351,10 +36590,10 @@ index 40c8353..946b0e4 100644 if (c4iw_fatal_error(rdev)) return -EIO; -@@ -135,7 +135,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, - &rdev->resource.tpt_fifo_lock); - if (!stag_idx) - return -ENOMEM; +@@ -139,7 +139,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, + if (rdev->stats.stag.cur > rdev->stats.stag.max) + rdev->stats.stag.max = rdev->stats.stag.cur; + mutex_unlock(&rdev->stats.lock); - *stag = (stag_idx << 8) | (atomic_inc_return(&key) & 0xff); + *stag = (stag_idx << 8) | (atomic_inc_return_unchecked(&key) & 0xff); } @@ -32414,11 +36653,37 @@ index 1f95bba..9530f87 100644 (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr, sdata, wqe->wr.wr.atomic.swap); goto send_comp; +diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c +index 9d3e5c1..d9afe4a 100644 +--- a/drivers/infiniband/hw/mthca/mthca_cmd.c ++++ b/drivers/infiniband/hw/mthca/mthca_cmd.c +@@ -772,7 +772,7 @@ static void mthca_setup_cmd_doorbells(struct mthca_dev *dev, u64 base) + mthca_dbg(dev, "Mapped doorbell page for posting FW commands\n"); + } + +-int mthca_QUERY_FW(struct mthca_dev *dev) ++int __intentional_overflow(-1) mthca_QUERY_FW(struct mthca_dev *dev) + { + struct mthca_mailbox *mailbox; + u32 *outbox; +diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c +index ed9a989..e0c5871 100644 +--- a/drivers/infiniband/hw/mthca/mthca_mr.c ++++ b/drivers/infiniband/hw/mthca/mthca_mr.c +@@ -426,7 +426,7 @@ static inline u32 adjust_key(struct mthca_dev *dev, u32 key) + return key; + } + +-int mthca_mr_alloc(struct mthca_dev *dev, u32 pd, int buffer_size_shift, ++int __intentional_overflow(-1) mthca_mr_alloc(struct mthca_dev *dev, u32 pd, int buffer_size_shift, + u64 iova, u64 total_size, u32 access, struct mthca_mr *mr) + { + struct mthca_mailbox *mailbox; diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c -index 7140199..da60063 100644 +index 4291410..d2ab1fb 100644 --- a/drivers/infiniband/hw/nes/nes.c +++ b/drivers/infiniband/hw/nes/nes.c -@@ -103,7 +103,7 @@ MODULE_PARM_DESC(limit_maxrdreqsz, "Limit max read request size to 256 Bytes"); +@@ -98,7 +98,7 @@ MODULE_PARM_DESC(limit_maxrdreqsz, "Limit max read request size to 256 Bytes"); LIST_HEAD(nes_adapter_list); static LIST_HEAD(nes_dev_list); @@ -32427,7 +36692,7 @@ index 7140199..da60063 100644 static unsigned int ee_flsh_adapter; static unsigned int sysfs_nonidx_addr; -@@ -272,7 +272,7 @@ static void nes_cqp_rem_ref_callback(struct nes_device *nesdev, struct nes_cqp_r +@@ -269,7 +269,7 @@ static void nes_cqp_rem_ref_callback(struct nes_device *nesdev, struct nes_cqp_r struct nes_qp *nesqp = cqp_request->cqp_callback_pointer; struct nes_adapter *nesadapter = nesdev->nesadapter; @@ -32437,10 +36702,10 @@ index 7140199..da60063 100644 /* Free the control structures */ diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h -index c438e46..ca30356 100644 +index 33cc589..3bd6538 100644 --- a/drivers/infiniband/hw/nes/nes.h +++ b/drivers/infiniband/hw/nes/nes.h -@@ -178,17 +178,17 @@ extern unsigned int nes_debug_level; +@@ -177,17 +177,17 @@ extern unsigned int nes_debug_level; extern unsigned int wqm_quanta; extern struct list_head nes_adapter_list; @@ -32469,7 +36734,7 @@ index c438e46..ca30356 100644 extern u32 mh_detected; extern u32 mh_pauses_sent; extern u32 cm_packets_sent; -@@ -197,16 +197,16 @@ extern u32 cm_packets_created; +@@ -196,16 +196,16 @@ extern u32 cm_packets_created; extern u32 cm_packets_received; extern u32 cm_packets_dropped; extern u32 cm_packets_retrans; @@ -32496,7 +36761,7 @@ index c438e46..ca30356 100644 extern u32 int_mod_timer_init; extern u32 int_mod_cq_depth_256; diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c -index 71edfbb..15b62ae 100644 +index 24b9f1a..00fd004 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -68,14 +68,14 @@ u32 cm_packets_dropped; @@ -32542,7 +36807,7 @@ index 71edfbb..15b62ae 100644 int nes_add_ref_cm_node(struct nes_cm_node *cm_node) { -@@ -1279,7 +1279,7 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core, +@@ -1272,7 +1272,7 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core, kfree(listener); listener = NULL; ret = 0; @@ -32551,7 +36816,7 @@ index 71edfbb..15b62ae 100644 } else { spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); } -@@ -1482,7 +1482,7 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core, +@@ -1466,7 +1466,7 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core, cm_node->rem_mac); add_hte_node(cm_core, cm_node); @@ -32560,7 +36825,7 @@ index 71edfbb..15b62ae 100644 return cm_node; } -@@ -1540,7 +1540,7 @@ static int rem_ref_cm_node(struct nes_cm_core *cm_core, +@@ -1524,7 +1524,7 @@ static int rem_ref_cm_node(struct nes_cm_core *cm_core, } atomic_dec(&cm_core->node_cnt); @@ -32569,7 +36834,7 @@ index 71edfbb..15b62ae 100644 nesqp = cm_node->nesqp; if (nesqp) { nesqp->cm_node = NULL; -@@ -1604,7 +1604,7 @@ static int process_options(struct nes_cm_node *cm_node, u8 *optionsloc, +@@ -1588,7 +1588,7 @@ static int process_options(struct nes_cm_node *cm_node, u8 *optionsloc, static void drop_packet(struct sk_buff *skb) { @@ -32578,7 +36843,7 @@ index 71edfbb..15b62ae 100644 dev_kfree_skb_any(skb); } -@@ -1667,7 +1667,7 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb, +@@ -1651,7 +1651,7 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb, { int reset = 0; /* whether to send reset in case of err.. */ @@ -32587,7 +36852,7 @@ index 71edfbb..15b62ae 100644 nes_debug(NES_DBG_CM, "Received Reset, cm_node = %p, state = %u." " refcnt=%d\n", cm_node, cm_node->state, atomic_read(&cm_node->ref_count)); -@@ -2308,7 +2308,7 @@ static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core, +@@ -2292,7 +2292,7 @@ static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core, rem_ref_cm_node(cm_node->cm_core, cm_node); return NULL; } @@ -32596,7 +36861,7 @@ index 71edfbb..15b62ae 100644 loopbackremotenode->loopbackpartner = cm_node; loopbackremotenode->tcp_cntxt.rcv_wscale = NES_CM_DEFAULT_RCV_WND_SCALE; -@@ -2583,7 +2583,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, +@@ -2567,7 +2567,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, nes_queue_mgt_skbs(skb, nesvnic, cm_node->nesqp); else { rem_ref_cm_node(cm_core, cm_node); @@ -32605,7 +36870,7 @@ index 71edfbb..15b62ae 100644 dev_kfree_skb_any(skb); } break; -@@ -2890,7 +2890,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp) +@@ -2875,7 +2875,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp) if ((cm_id) && (cm_id->event_handler)) { if (issue_disconn) { @@ -32614,7 +36879,7 @@ index 71edfbb..15b62ae 100644 cm_event.event = IW_CM_EVENT_DISCONNECT; cm_event.status = disconn_status; cm_event.local_addr = cm_id->local_addr; -@@ -2912,7 +2912,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp) +@@ -2897,7 +2897,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp) } if (issue_close) { @@ -32623,7 +36888,7 @@ index 71edfbb..15b62ae 100644 nes_disconnect(nesqp, 1); cm_id->provider_data = nesqp; -@@ -3048,7 +3048,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) +@@ -3033,7 +3033,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) nes_debug(NES_DBG_CM, "QP%u, cm_node=%p, jiffies = %lu listener = %p\n", nesqp->hwqp.qp_id, cm_node, jiffies, cm_node->listener); @@ -32632,7 +36897,7 @@ index 71edfbb..15b62ae 100644 nes_debug(NES_DBG_CM, "netdev refcnt = %u.\n", netdev_refcnt_read(nesvnic->netdev)); -@@ -3250,7 +3250,7 @@ int nes_reject(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len) +@@ -3228,7 +3228,7 @@ int nes_reject(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len) struct nes_cm_core *cm_core; u8 *start_buff; @@ -32641,7 +36906,7 @@ index 71edfbb..15b62ae 100644 cm_node = (struct nes_cm_node *)cm_id->provider_data; loopback = cm_node->loopbackpartner; cm_core = cm_node->cm_core; -@@ -3310,7 +3310,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) +@@ -3288,7 +3288,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) ntohl(cm_id->local_addr.sin_addr.s_addr), ntohs(cm_id->local_addr.sin_port)); @@ -32650,7 +36915,7 @@ index 71edfbb..15b62ae 100644 nesqp->active_conn = 1; /* cache the cm_id in the qp */ -@@ -3416,7 +3416,7 @@ int nes_create_listen(struct iw_cm_id *cm_id, int backlog) +@@ -3398,7 +3398,7 @@ int nes_create_listen(struct iw_cm_id *cm_id, int backlog) g_cm_core->api->stop_listener(g_cm_core, (void *)cm_node); return err; } @@ -32659,7 +36924,7 @@ index 71edfbb..15b62ae 100644 } cm_id->add_ref(cm_id); -@@ -3517,7 +3517,7 @@ static void cm_event_connected(struct nes_cm_event *event) +@@ -3499,7 +3499,7 @@ static void cm_event_connected(struct nes_cm_event *event) if (nesqp->destroyed) return; @@ -32668,7 +36933,7 @@ index 71edfbb..15b62ae 100644 nes_debug(NES_DBG_CM, "QP%u attempting to connect to 0x%08X:0x%04X on" " local port 0x%04X. jiffies = %lu.\n", nesqp->hwqp.qp_id, -@@ -3704,7 +3704,7 @@ static void cm_event_reset(struct nes_cm_event *event) +@@ -3679,7 +3679,7 @@ static void cm_event_reset(struct nes_cm_event *event) cm_id->add_ref(cm_id); ret = cm_id->event_handler(cm_id, &cm_event); @@ -32677,7 +36942,7 @@ index 71edfbb..15b62ae 100644 cm_event.event = IW_CM_EVENT_CLOSE; cm_event.status = 0; cm_event.provider_data = cm_id->provider_data; -@@ -3740,7 +3740,7 @@ static void cm_event_mpa_req(struct nes_cm_event *event) +@@ -3715,7 +3715,7 @@ static void cm_event_mpa_req(struct nes_cm_event *event) return; cm_id = cm_node->cm_id; @@ -32686,7 +36951,7 @@ index 71edfbb..15b62ae 100644 nes_debug(NES_DBG_CM, "cm_node = %p - cm_id = %p, jiffies = %lu\n", cm_node, cm_id, jiffies); -@@ -3780,7 +3780,7 @@ static void cm_event_mpa_reject(struct nes_cm_event *event) +@@ -3755,7 +3755,7 @@ static void cm_event_mpa_reject(struct nes_cm_event *event) return; cm_id = cm_node->cm_id; @@ -32696,7 +36961,7 @@ index 71edfbb..15b62ae 100644 cm_node, cm_id, jiffies); diff --git a/drivers/infiniband/hw/nes/nes_mgt.c b/drivers/infiniband/hw/nes/nes_mgt.c -index 3ba7be3..c81f6ff 100644 +index 4166452..fc952c3 100644 --- a/drivers/infiniband/hw/nes/nes_mgt.c +++ b/drivers/infiniband/hw/nes/nes_mgt.c @@ -40,8 +40,8 @@ @@ -32719,7 +36984,7 @@ index 3ba7be3..c81f6ff 100644 /* Free packets that have not yet been forwarded */ /* Lock is acquired by skb_dequeue when removing the skb */ -@@ -812,7 +812,7 @@ static void nes_mgt_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq * +@@ -810,7 +810,7 @@ static void nes_mgt_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq * cq->cq_vbase[head].cqe_words[NES_NIC_CQE_HASH_RCVNXT]); skb_queue_head_init(&nesqp->pau_list); spin_lock_init(&nesqp->pau_lock); @@ -32729,10 +36994,10 @@ index 3ba7be3..c81f6ff 100644 } diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c -index f3a3ecf..57d311d 100644 +index 85cf4d1..05d8e71 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c -@@ -1277,39 +1277,39 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev, +@@ -1273,39 +1273,39 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev, target_stat_values[++index] = mh_detected; target_stat_values[++index] = mh_pauses_sent; target_stat_values[++index] = nesvnic->endnode_ipv4_tcp_retransmits; @@ -32793,7 +37058,7 @@ index f3a3ecf..57d311d 100644 /** diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c -index 8b8812d..a5e1133 100644 +index 8f67fe2..8960859 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -46,9 +46,9 @@ @@ -32809,7 +37074,7 @@ index 8b8812d..a5e1133 100644 static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev); -@@ -1131,7 +1131,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd, +@@ -1134,7 +1134,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd, if (init_attr->create_flags) return ERR_PTR(-EINVAL); @@ -32818,7 +37083,7 @@ index 8b8812d..a5e1133 100644 switch (init_attr->qp_type) { case IB_QPT_RC: if (nes_drv_opt & NES_DRV_OPT_NO_INLINE_DATA) { -@@ -1460,7 +1460,7 @@ static int nes_destroy_qp(struct ib_qp *ibqp) +@@ -1465,7 +1465,7 @@ static int nes_destroy_qp(struct ib_qp *ibqp) struct iw_cm_event cm_event; int ret = 0; @@ -32828,7 +37093,7 @@ index 8b8812d..a5e1133 100644 /* Blow away the connection if it exists. */ diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h -index 6b811e3..f8acf88 100644 +index 4d11575..3e890e5 100644 --- a/drivers/infiniband/hw/qib/qib.h +++ b/drivers/infiniband/hw/qib/qib.h @@ -51,6 +51,7 @@ @@ -32861,19 +37126,19 @@ index da739d9..da1c7f4 100644 gameport->dev.release = gameport_release_port; if (gameport->parent) diff --git a/drivers/input/input.c b/drivers/input/input.c -index 8921c61..f5cd63d 100644 +index c044699..174d71a 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c -@@ -1814,7 +1814,7 @@ static void input_cleanse_bitmasks(struct input_dev *dev) +@@ -2019,7 +2019,7 @@ static void devm_input_device_unregister(struct device *dev, void *res) */ int input_register_device(struct input_dev *dev) { - static atomic_t input_no = ATOMIC_INIT(0); + static atomic_unchecked_t input_no = ATOMIC_INIT(0); + struct input_devres *devres = NULL; struct input_handler *handler; - const char *path; - int error; -@@ -1851,7 +1851,7 @@ int input_register_device(struct input_dev *dev) + unsigned int packet_size; +@@ -2074,7 +2074,7 @@ int input_register_device(struct input_dev *dev) dev->setkeycode = input_default_setkeycode; dev_set_name(&dev->dev, "input%ld", @@ -32883,7 +37148,7 @@ index 8921c61..f5cd63d 100644 error = device_add(&dev->dev); if (error) diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c -index b8d8611..7a4a04b 100644 +index 04c69af..5f92d00 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c @@ -30,6 +30,7 @@ @@ -32895,10 +37160,10 @@ index b8d8611..7a4a04b 100644 #include <linux/input.h> #include <linux/gameport.h> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c -index 42f7b25..09fcf46 100644 +index d6cbfe9..6225402 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c -@@ -714,7 +714,7 @@ static void xpad_led_set(struct led_classdev *led_cdev, +@@ -735,7 +735,7 @@ static void xpad_led_set(struct led_classdev *led_cdev, static int xpad_led_probe(struct usb_xpad *xpad) { @@ -32907,7 +37172,7 @@ index 42f7b25..09fcf46 100644 long led_no; struct xpad_led *led; struct led_classdev *led_cdev; -@@ -727,7 +727,7 @@ static int xpad_led_probe(struct usb_xpad *xpad) +@@ -748,7 +748,7 @@ static int xpad_led_probe(struct usb_xpad *xpad) if (!led) return -ENOMEM; @@ -32916,11 +37181,24 @@ index 42f7b25..09fcf46 100644 snprintf(led->name, sizeof(led->name), "xpad%ld", led_no); led->xpad = xpad; +diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h +index 2f0b39d..7370f13 100644 +--- a/drivers/input/mouse/psmouse.h ++++ b/drivers/input/mouse/psmouse.h +@@ -116,7 +116,7 @@ struct psmouse_attribute { + ssize_t (*set)(struct psmouse *psmouse, void *data, + const char *buf, size_t count); + bool protect; +-}; ++} __do_const; + #define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr) + + ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *attr, diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c -index 0110b5a..d3ad144 100644 +index 4c842c3..590b0bf 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c -@@ -763,7 +763,7 @@ static ssize_t mousedev_read(struct file *file, char __user *buffer, +@@ -738,7 +738,7 @@ static ssize_t mousedev_read(struct file *file, char __user *buffer, spin_unlock_irq(&client->packet_lock); @@ -32930,7 +37208,7 @@ index 0110b5a..d3ad144 100644 return count; diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c -index d0f7533..fb8215b 100644 +index 25fc597..558bf3b3 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -496,7 +496,7 @@ static void serio_release_port(struct device *dev) @@ -32951,11 +37229,67 @@ index d0f7533..fb8215b 100644 serio->dev.bus = &serio_bus; serio->dev.release = serio_release_port; serio->dev.groups = serio_device_attr_groups; +diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c +index b972d43..8943713 100644 +--- a/drivers/iommu/iommu.c ++++ b/drivers/iommu/iommu.c +@@ -554,7 +554,7 @@ static struct notifier_block iommu_bus_nb = { + static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops) + { + bus_register_notifier(bus, &iommu_bus_nb); +- bus_for_each_dev(bus, NULL, ops, add_iommu_group); ++ bus_for_each_dev(bus, NULL, (void *)ops, add_iommu_group); + } + + /** +diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c +index 7c11ff3..5b2d7a7 100644 +--- a/drivers/iommu/irq_remapping.c ++++ b/drivers/iommu/irq_remapping.c +@@ -369,10 +369,12 @@ static void ir_print_prefix(struct irq_data *data, struct seq_file *p) + + void irq_remap_modify_chip_defaults(struct irq_chip *chip) + { +- chip->irq_print_chip = ir_print_prefix; +- chip->irq_ack = ir_ack_apic_edge; +- chip->irq_eoi = ir_ack_apic_level; +- chip->irq_set_affinity = x86_io_apic_ops.set_affinity; ++ pax_open_kernel(); ++ *(void **)&chip->irq_print_chip = ir_print_prefix; ++ *(void **)&chip->irq_ack = ir_ack_apic_edge; ++ *(void **)&chip->irq_eoi = ir_ack_apic_level; ++ *(void **)&chip->irq_set_affinity = x86_io_apic_ops.set_affinity; ++ pax_close_kernel(); + } + + bool setup_remapped_irq(int irq, struct irq_cfg *cfg, struct irq_chip *chip) +diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c +index fc6aebf..762c5f5 100644 +--- a/drivers/irqchip/irq-gic.c ++++ b/drivers/irqchip/irq-gic.c +@@ -83,7 +83,7 @@ static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly; + * Supported arch specific GIC irq extension. + * Default make them NULL. + */ +-struct irq_chip gic_arch_extn = { ++irq_chip_no_const gic_arch_extn = { + .irq_eoi = NULL, + .irq_mask = NULL, + .irq_unmask = NULL, +@@ -332,7 +332,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) + chained_irq_exit(chip, desc); + } + +-static struct irq_chip gic_chip = { ++static irq_chip_no_const gic_chip __read_only = { + .name = "GIC", + .irq_mask = gic_mask_irq, + .irq_unmask = gic_unmask_irq, diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c -index b902794..fc7b85b 100644 +index 89562a8..218999b 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c -@@ -83,8 +83,8 @@ struct capiminor { +@@ -81,8 +81,8 @@ struct capiminor { struct capi20_appl *ap; u32 ncci; @@ -32966,7 +37300,7 @@ index b902794..fc7b85b 100644 struct tty_port port; int ttyinstop; -@@ -397,7 +397,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb) +@@ -391,7 +391,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb) capimsg_setu16(s, 2, mp->ap->applid); capimsg_setu8 (s, 4, CAPI_DATA_B3); capimsg_setu8 (s, 5, CAPI_RESP); @@ -32975,7 +37309,7 @@ index b902794..fc7b85b 100644 capimsg_setu32(s, 8, mp->ncci); capimsg_setu16(s, 12, datahandle); } -@@ -518,14 +518,14 @@ static void handle_minor_send(struct capiminor *mp) +@@ -512,14 +512,14 @@ static void handle_minor_send(struct capiminor *mp) mp->outbytes -= len; spin_unlock_bh(&mp->outlock); @@ -32992,6 +37326,34 @@ index b902794..fc7b85b 100644 capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */ capimsg_setu32(skb->data, 12, (u32)(long)skb->data);/* Data32 */ capimsg_setu16(skb->data, 16, len); /* Data length */ +diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c +index e2b5396..c5486dc 100644 +--- a/drivers/isdn/gigaset/interface.c ++++ b/drivers/isdn/gigaset/interface.c +@@ -130,9 +130,9 @@ static int if_open(struct tty_struct *tty, struct file *filp) + } + tty->driver_data = cs; + +- ++cs->port.count; ++ atomic_inc(&cs->port.count); + +- if (cs->port.count == 1) { ++ if (atomic_read(&cs->port.count) == 1) { + tty_port_tty_set(&cs->port, tty); + cs->port.low_latency = 1; + } +@@ -156,9 +156,9 @@ static void if_close(struct tty_struct *tty, struct file *filp) + + if (!cs->connected) + gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */ +- else if (!cs->port.count) ++ else if (!atomic_read(&cs->port.count)) + dev_warn(cs->dev, "%s: device not opened\n", __func__); +- else if (!--cs->port.count) ++ else if (!atomic_dec_return(&cs->port.count)) + tty_port_tty_set(&cs->port, NULL); + + mutex_unlock(&cs->mutex); diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c index 821f7ac..28d4030 100644 --- a/drivers/isdn/hardware/avm/b1.c @@ -33014,32 +37376,71 @@ index 821f7ac..28d4030 100644 return -EFAULT; } else { memcpy(buf, dp, left); -diff --git a/drivers/isdn/hardware/eicon/divasync.h b/drivers/isdn/hardware/eicon/divasync.h -index dd6b53a..19d9ee6 100644 ---- a/drivers/isdn/hardware/eicon/divasync.h -+++ b/drivers/isdn/hardware/eicon/divasync.h -@@ -146,7 +146,7 @@ typedef struct _diva_didd_add_adapter { - } diva_didd_add_adapter_t; - typedef struct _diva_didd_remove_adapter { - IDI_CALL p_request; --} diva_didd_remove_adapter_t; -+} __no_const diva_didd_remove_adapter_t; - typedef struct _diva_didd_read_adapter_array { - void *buffer; - dword length; -diff --git a/drivers/isdn/hardware/eicon/xdi_adapter.h b/drivers/isdn/hardware/eicon/xdi_adapter.h -index d303e65..28bcb7b 100644 ---- a/drivers/isdn/hardware/eicon/xdi_adapter.h -+++ b/drivers/isdn/hardware/eicon/xdi_adapter.h -@@ -44,7 +44,7 @@ typedef struct _xdi_mbox_t { - typedef struct _diva_os_idi_adapter_interface { - diva_init_card_proc_t cleanup_adapter_proc; - diva_cmd_card_proc_t cmd_proc; --} diva_os_idi_adapter_interface_t; -+} __no_const diva_os_idi_adapter_interface_t; - - typedef struct _diva_os_xdi_adapter { - struct list_head link; +diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c +index ebaebdf..acd4405 100644 +--- a/drivers/isdn/i4l/isdn_tty.c ++++ b/drivers/isdn/i4l/isdn_tty.c +@@ -1511,9 +1511,9 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp) + + #ifdef ISDN_DEBUG_MODEM_OPEN + printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name, +- port->count); ++ atomic_read(&port->count)); + #endif +- port->count++; ++ atomic_inc(&port->count); + port->tty = tty; + /* + * Start up serial port +@@ -1557,7 +1557,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp) + #endif + return; + } +- if ((tty->count == 1) && (port->count != 1)) { ++ if ((tty->count == 1) && (atomic_read(&port->count) != 1)) { + /* + * Uh, oh. tty->count is 1, which means that the tty + * structure will be freed. Info->count should always +@@ -1566,15 +1566,15 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp) + * serial port won't be shutdown. + */ + printk(KERN_ERR "isdn_tty_close: bad port count; tty->count is 1, " +- "info->count is %d\n", port->count); +- port->count = 1; ++ "info->count is %d\n", atomic_read(&port->count)); ++ atomic_set(&port->count, 1); + } +- if (--port->count < 0) { ++ if (atomic_dec_return(&port->count) < 0) { + printk(KERN_ERR "isdn_tty_close: bad port count for ttyi%d: %d\n", +- info->line, port->count); +- port->count = 0; ++ info->line, atomic_read(&port->count)); ++ atomic_set(&port->count, 0); + } +- if (port->count) { ++ if (atomic_read(&port->count)) { + #ifdef ISDN_DEBUG_MODEM_OPEN + printk(KERN_DEBUG "isdn_tty_close after info->count != 0\n"); + #endif +@@ -1628,7 +1628,7 @@ isdn_tty_hangup(struct tty_struct *tty) + if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_hangup")) + return; + isdn_tty_shutdown(info); +- port->count = 0; ++ atomic_set(&port->count, 0); + port->flags &= ~ASYNC_NORMAL_ACTIVE; + port->tty = NULL; + wake_up_interruptible(&port->open_wait); +@@ -1973,7 +1973,7 @@ isdn_tty_find_icall(int di, int ch, setup_parm *setup) + for (i = 0; i < ISDN_MAX_CHANNELS; i++) { + modem_info *info = &dev->mdm.info[i]; + +- if (info->port.count == 0) ++ if (atomic_read(&info->port.count) == 0) + continue; + if ((info->emu.mdmreg[REG_SI1] & si2bit[si1]) && /* SI1 is matching */ + (info->emu.mdmreg[REG_SI2] == si2)) { /* SI2 is matching */ diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c index e74df7c..03a03ba 100644 --- a/drivers/isdn/icn/icn.c @@ -33053,21 +37454,34 @@ index e74df7c..03a03ba 100644 return -EFAULT; } else memcpy(msg, buf, count); -diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c -index 8bc4915..4cc6a2e 100644 ---- a/drivers/leds/leds-mc13783.c -+++ b/drivers/leds/leds-mc13783.c -@@ -280,7 +280,7 @@ static int __devinit mc13783_led_probe(struct platform_device *pdev) - return -EINVAL; - } - -- led = kzalloc(sizeof(*led) * pdata->num_leds, GFP_KERNEL); -+ led = kcalloc(pdata->num_leds, sizeof(*led), GFP_KERNEL); - if (led == NULL) { - dev_err(&pdev->dev, "failed to alloc memory\n"); - return -ENOMEM; +diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c +index 6a8405d..0bd1c7e 100644 +--- a/drivers/leds/leds-clevo-mail.c ++++ b/drivers/leds/leds-clevo-mail.c +@@ -40,7 +40,7 @@ static int __init clevo_mail_led_dmi_callback(const struct dmi_system_id *id) + * detected as working, but in reality it is not) as low as + * possible. + */ +-static struct dmi_system_id __initdata clevo_mail_led_dmi_table[] = { ++static const struct dmi_system_id __initconst clevo_mail_led_dmi_table[] = { + { + .callback = clevo_mail_led_dmi_callback, + .ident = "Clevo D410J", +diff --git a/drivers/leds/leds-ss4200.c b/drivers/leds/leds-ss4200.c +index 64e204e..c6bf189 100644 +--- a/drivers/leds/leds-ss4200.c ++++ b/drivers/leds/leds-ss4200.c +@@ -91,7 +91,7 @@ MODULE_PARM_DESC(nodetect, "Skip DMI-based hardware detection"); + * detected as working, but in reality it is not) as low as + * possible. + */ +-static struct dmi_system_id __initdata nas_led_whitelist[] = { ++static const struct dmi_system_id __initconst nas_led_whitelist[] = { + { + .callback = ss4200_led_dmi_callback, + .ident = "Intel SS4200-E", diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c -index b5fdcb7..5b6c59f 100644 +index a5ebc00..982886f 100644 --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c @@ -92,9 +92,17 @@ static __init int map_switcher(void) @@ -33097,8 +37511,21 @@ index b5fdcb7..5b6c59f 100644 end_switcher_text - start_switcher_text); printk(KERN_INFO "lguest: mapped switcher at %p\n", +diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c +index 3b62be16..e33134a 100644 +--- a/drivers/lguest/page_tables.c ++++ b/drivers/lguest/page_tables.c +@@ -532,7 +532,7 @@ void pin_page(struct lg_cpu *cpu, unsigned long vaddr) + /*:*/ + + #ifdef CONFIG_X86_PAE +-static void release_pmd(pmd_t *spmd) ++static void __intentional_overflow(-1) release_pmd(pmd_t *spmd) + { + /* If the entry's not present, there's nothing to release. */ + if (pmd_flags(*spmd) & _PAGE_PRESENT) { diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c -index 39809035..ce25c5e 100644 +index 4af12e1..0e89afe 100644 --- a/drivers/lguest/x86/core.c +++ b/drivers/lguest/x86/core.c @@ -59,7 +59,7 @@ static struct { @@ -33124,7 +37551,7 @@ index 39809035..ce25c5e 100644 /* * Set up the Guest's page tables to see this CPU's pages (and no * other CPU's pages). -@@ -472,7 +478,7 @@ void __init lguest_arch_host_init(void) +@@ -476,7 +482,7 @@ void __init lguest_arch_host_init(void) * compiled-in switcher code and the high-mapped copy we just made. */ for (i = 0; i < IDT_ENTRIES; i++) @@ -33133,7 +37560,7 @@ index 39809035..ce25c5e 100644 /* * Set up the Switcher's per-cpu areas. -@@ -555,7 +561,7 @@ void __init lguest_arch_host_init(void) +@@ -559,7 +565,7 @@ void __init lguest_arch_host_init(void) * it will be undisturbed when we switch. To change %cs and jump we * need this structure to feed to Intel's "lcall" instruction. */ @@ -33204,37 +37631,24 @@ index 40634b0..4f5855e 100644 // Every interrupt can come to us here // But we must truly tell each apart. -diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c -index 20e5c2c..9e849a9 100644 ---- a/drivers/macintosh/macio_asic.c -+++ b/drivers/macintosh/macio_asic.c -@@ -748,7 +748,7 @@ static void __devexit macio_pci_remove(struct pci_dev* pdev) - * MacIO is matched against any Apple ID, it's probe() function - * will then decide wether it applies or not - */ --static const struct pci_device_id __devinitdata pci_ids [] = { { -+static const struct pci_device_id __devinitconst pci_ids [] = { { - .vendor = PCI_VENDOR_ID_APPLE, - .device = PCI_ANY_ID, - .subvendor = PCI_ANY_ID, diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c -index 17e2b47..bcbeec4 100644 +index 4fd9d6a..834fa03 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c -@@ -1823,7 +1823,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap) +@@ -1779,7 +1779,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap) chunk_kb ? "KB" : "B"); - if (bitmap->file) { + if (bitmap->storage.file) { seq_printf(seq, ", file: "); -- seq_path(seq, &bitmap->file->f_path, " \t\n"); -+ seq_path(seq, &bitmap->file->f_path, " \t\n\\"); +- seq_path(seq, &bitmap->storage.file->f_path, " \t\n"); ++ seq_path(seq, &bitmap->storage.file->f_path, " \t\n\\"); } seq_printf(seq, "\n"); diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c -index a1a3e6d..1918bfc 100644 +index aa04f02..2a1309e 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c -@@ -1590,7 +1590,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param) +@@ -1694,7 +1694,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param) cmd == DM_LIST_VERSIONS_CMD) return 0; @@ -33244,7 +37658,7 @@ index a1a3e6d..1918bfc 100644 DMWARN("name not supplied when creating device"); return -EINVAL; diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c -index b58b7a3..8018b19 100644 +index d053098..05cc375 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -40,7 +40,7 @@ enum dm_raid1_error { @@ -33256,7 +37670,7 @@ index b58b7a3..8018b19 100644 unsigned long error_type; struct dm_dev *dev; sector_t offset; -@@ -185,7 +185,7 @@ static struct mirror *get_valid_mirror(struct mirror_set *ms) +@@ -186,7 +186,7 @@ static struct mirror *get_valid_mirror(struct mirror_set *ms) struct mirror *m; for (m = ms->mirror; m < ms->mirror + ms->nr_mirrors; m++) @@ -33265,7 +37679,7 @@ index b58b7a3..8018b19 100644 return m; return NULL; -@@ -217,7 +217,7 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type) +@@ -218,7 +218,7 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type) * simple way to tell if a device has encountered * errors. */ @@ -33274,7 +37688,7 @@ index b58b7a3..8018b19 100644 if (test_and_set_bit(error_type, &m->error_type)) return; -@@ -408,7 +408,7 @@ static struct mirror *choose_mirror(struct mirror_set *ms, sector_t sector) +@@ -409,7 +409,7 @@ static struct mirror *choose_mirror(struct mirror_set *ms, sector_t sector) struct mirror *m = get_default_mirror(ms); do { @@ -33283,7 +37697,7 @@ index b58b7a3..8018b19 100644 return m; if (m-- == ms->mirror) -@@ -422,7 +422,7 @@ static int default_ok(struct mirror *m) +@@ -423,7 +423,7 @@ static int default_ok(struct mirror *m) { struct mirror *default_mirror = get_default_mirror(m->ms); @@ -33292,7 +37706,7 @@ index b58b7a3..8018b19 100644 } static int mirror_available(struct mirror_set *ms, struct bio *bio) -@@ -559,7 +559,7 @@ static void do_reads(struct mirror_set *ms, struct bio_list *reads) +@@ -560,7 +560,7 @@ static void do_reads(struct mirror_set *ms, struct bio_list *reads) */ if (likely(region_in_sync(ms, region, 1))) m = choose_mirror(ms, bio->bi_sector); @@ -33301,7 +37715,7 @@ index b58b7a3..8018b19 100644 m = NULL; if (likely(m)) -@@ -938,7 +938,7 @@ static int get_mirror(struct mirror_set *ms, struct dm_target *ti, +@@ -927,7 +927,7 @@ static int get_mirror(struct mirror_set *ms, struct dm_target *ti, } ms->mirror[mirror].ms = ms; @@ -33310,7 +37724,7 @@ index b58b7a3..8018b19 100644 ms->mirror[mirror].error_type = 0; ms->mirror[mirror].offset = offset; -@@ -1352,7 +1352,7 @@ static void mirror_resume(struct dm_target *ti) +@@ -1340,7 +1340,7 @@ static void mirror_resume(struct dm_target *ti) */ static char device_status_char(struct mirror *m) { @@ -33320,7 +37734,7 @@ index b58b7a3..8018b19 100644 return (test_bit(DM_RAID1_FLUSH_ERROR, &(m->error_type))) ? 'F' : diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c -index 35c94ff..20d4c17 100644 +index 7b8b2b9..9c7d145 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -20,7 +20,7 @@ struct stripe { @@ -33332,7 +37746,7 @@ index 35c94ff..20d4c17 100644 }; struct stripe_c { -@@ -193,7 +193,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv) +@@ -185,7 +185,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv) kfree(sc); return r; } @@ -33341,7 +37755,7 @@ index 35c94ff..20d4c17 100644 } ti->private = sc; -@@ -315,7 +315,7 @@ static int stripe_status(struct dm_target *ti, +@@ -326,7 +326,7 @@ static void stripe_status(struct dm_target *ti, status_type_t type, DMEMIT("%d ", sc->stripes); for (i = 0; i < sc->stripes; i++) { DMEMIT("%s ", sc->stripe[i].dev->name); @@ -33350,7 +37764,7 @@ index 35c94ff..20d4c17 100644 'D' : 'A'; } buffer[i] = '\0'; -@@ -362,8 +362,8 @@ static int stripe_end_io(struct dm_target *ti, struct bio *bio, +@@ -371,8 +371,8 @@ static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error) */ for (i = 0; i < sc->stripes; i++) if (!strcmp(sc->stripe[i].dev->name, major_minor)) { @@ -33362,10 +37776,10 @@ index 35c94ff..20d4c17 100644 schedule_work(&sc->trigger_event); } diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c -index 2e227fb..44ead1f 100644 +index 1ff252a..ee384c1 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c -@@ -390,7 +390,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev, +@@ -389,7 +389,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev, if (!dev_size) return 0; @@ -33375,21 +37789,21 @@ index 2e227fb..44ead1f 100644 "start=%llu, len=%llu, dev_size=%llu", dm_device_name(ti->table->md), bdevname(bdev, b), diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c -index 737d388..811ad5a 100644 +index 00cee02..b89a29d 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c -@@ -432,7 +432,7 @@ static int init_pmd(struct dm_pool_metadata *pmd, - - pmd->info.tm = tm; +@@ -397,7 +397,7 @@ static void __setup_btree_details(struct dm_pool_metadata *pmd) + { + pmd->info.tm = pmd->tm; pmd->info.levels = 2; - pmd->info.value_type.context = pmd->data_sm; + pmd->info.value_type.context = (dm_space_map_no_const *)pmd->data_sm; pmd->info.value_type.size = sizeof(__le64); pmd->info.value_type.inc = data_block_inc; pmd->info.value_type.dec = data_block_dec; -@@ -451,7 +451,7 @@ static int init_pmd(struct dm_pool_metadata *pmd, +@@ -416,7 +416,7 @@ static void __setup_btree_details(struct dm_pool_metadata *pmd) - pmd->bl_info.tm = tm; + pmd->bl_info.tm = pmd->tm; pmd->bl_info.levels = 1; - pmd->bl_info.value_type.context = pmd->data_sm; + pmd->bl_info.value_type.context = (dm_space_map_no_const *)pmd->data_sm; @@ -33397,10 +37811,10 @@ index 737d388..811ad5a 100644 pmd->bl_info.value_type.inc = data_block_inc; pmd->bl_info.value_type.dec = data_block_dec; diff --git a/drivers/md/dm.c b/drivers/md/dm.c -index e24143c..ce2f21a1 100644 +index 9a0bdad..4df9543 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c -@@ -176,9 +176,9 @@ struct mapped_device { +@@ -169,9 +169,9 @@ struct mapped_device { /* * Event handling. */ @@ -33412,7 +37826,7 @@ index e24143c..ce2f21a1 100644 struct list_head uevent_list; spinlock_t uevent_lock; /* Protect access to uevent_list */ -@@ -1845,8 +1845,8 @@ static struct mapped_device *alloc_dev(int minor) +@@ -1879,8 +1879,8 @@ static struct mapped_device *alloc_dev(int minor) rwlock_init(&md->map_lock); atomic_set(&md->holders, 1); atomic_set(&md->open_count, 0); @@ -33423,7 +37837,7 @@ index e24143c..ce2f21a1 100644 INIT_LIST_HEAD(&md->uevent_list); spin_lock_init(&md->uevent_lock); -@@ -1980,7 +1980,7 @@ static void event_callback(void *context) +@@ -2028,7 +2028,7 @@ static void event_callback(void *context) dm_send_uevents(&uevents, &disk_to_dev(md->disk)->kobj); @@ -33432,7 +37846,7 @@ index e24143c..ce2f21a1 100644 wake_up(&md->eventq); } -@@ -2622,18 +2622,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, +@@ -2685,18 +2685,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, uint32_t dm_next_uevent_seq(struct mapped_device *md) { @@ -33455,10 +37869,10 @@ index e24143c..ce2f21a1 100644 void dm_uevent_add(struct mapped_device *md, struct list_head *elist) diff --git a/drivers/md/md.c b/drivers/md/md.c -index 9ee8ce3..362b519 100644 +index a4a93b9..4747b63 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c -@@ -277,10 +277,10 @@ EXPORT_SYMBOL_GPL(md_trim_bio); +@@ -240,10 +240,10 @@ EXPORT_SYMBOL_GPL(md_trim_bio); * start build, activate spare */ static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters); @@ -33471,7 +37885,7 @@ index 9ee8ce3..362b519 100644 wake_up(&md_event_waiters); } EXPORT_SYMBOL_GPL(md_new_event); -@@ -290,7 +290,7 @@ EXPORT_SYMBOL_GPL(md_new_event); +@@ -253,7 +253,7 @@ EXPORT_SYMBOL_GPL(md_new_event); */ static void md_new_event_inintr(struct mddev *mddev) { @@ -33480,16 +37894,16 @@ index 9ee8ce3..362b519 100644 wake_up(&md_event_waiters); } -@@ -1526,7 +1526,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ - - rdev->preferred_minor = 0xffff; - rdev->data_offset = le64_to_cpu(sb->data_offset); +@@ -1507,7 +1507,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ + if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_RESHAPE_ACTIVE) && + (le32_to_cpu(sb->feature_map) & MD_FEATURE_NEW_OFFSET)) + rdev->new_data_offset += (s32)le32_to_cpu(sb->new_offset); - atomic_set(&rdev->corrected_errors, le32_to_cpu(sb->cnt_corrected_read)); + atomic_set_unchecked(&rdev->corrected_errors, le32_to_cpu(sb->cnt_corrected_read)); rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256; bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1; -@@ -1745,7 +1745,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev) +@@ -1751,7 +1751,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev) else sb->resync_offset = cpu_to_le64(0); @@ -33498,7 +37912,7 @@ index 9ee8ce3..362b519 100644 sb->raid_disks = cpu_to_le32(mddev->raid_disks); sb->size = cpu_to_le64(mddev->dev_sectors); -@@ -2691,7 +2691,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); +@@ -2751,7 +2751,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); static ssize_t errors_show(struct md_rdev *rdev, char *page) { @@ -33507,7 +37921,7 @@ index 9ee8ce3..362b519 100644 } static ssize_t -@@ -2700,7 +2700,7 @@ errors_store(struct md_rdev *rdev, const char *buf, size_t len) +@@ -2760,7 +2760,7 @@ errors_store(struct md_rdev *rdev, const char *buf, size_t len) char *e; unsigned long n = simple_strtoul(buf, &e, 10); if (*buf && (*e == 0 || *e == '\n')) { @@ -33516,7 +37930,7 @@ index 9ee8ce3..362b519 100644 return len; } return -EINVAL; -@@ -3086,8 +3086,8 @@ int md_rdev_init(struct md_rdev *rdev) +@@ -3210,8 +3210,8 @@ int md_rdev_init(struct md_rdev *rdev) rdev->sb_loaded = 0; rdev->bb_page = NULL; atomic_set(&rdev->nr_pending, 0); @@ -33527,7 +37941,7 @@ index 9ee8ce3..362b519 100644 INIT_LIST_HEAD(&rdev->same_set); init_waitqueue_head(&rdev->blocked_wait); -@@ -6748,7 +6748,7 @@ static int md_seq_show(struct seq_file *seq, void *v) +@@ -6994,7 +6994,7 @@ static int md_seq_show(struct seq_file *seq, void *v) spin_unlock(&pers_lock); seq_printf(seq, "\n"); @@ -33536,7 +37950,7 @@ index 9ee8ce3..362b519 100644 return 0; } if (v == (void*)2) { -@@ -6851,7 +6851,7 @@ static int md_seq_open(struct inode *inode, struct file *file) +@@ -7097,7 +7097,7 @@ static int md_seq_open(struct inode *inode, struct file *file) return error; seq = file->private_data; @@ -33545,7 +37959,7 @@ index 9ee8ce3..362b519 100644 return error; } -@@ -6865,7 +6865,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait) +@@ -7111,7 +7111,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait) /* always allow read */ mask = POLLIN | POLLRDNORM; @@ -33554,7 +37968,7 @@ index 9ee8ce3..362b519 100644 mask |= POLLERR | POLLPRI; return mask; } -@@ -6909,7 +6909,7 @@ static int is_mddev_idle(struct mddev *mddev, int init) +@@ -7155,7 +7155,7 @@ static int is_mddev_idle(struct mddev *mddev, int init) struct gendisk *disk = rdev->bdev->bd_contains->bd_disk; curr_events = (int)part_stat_read(&disk->part0, sectors[0]) + (int)part_stat_read(&disk->part0, sectors[1]) - @@ -33564,10 +37978,10 @@ index 9ee8ce3..362b519 100644 * as sync_io is counted when a request starts, and * disk_stats is counted when it completes. diff --git a/drivers/md/md.h b/drivers/md/md.h -index 1c2063c..9639970 100644 +index d90fb1a..4174a2b 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h -@@ -93,13 +93,13 @@ struct md_rdev { +@@ -94,13 +94,13 @@ struct md_rdev { * only maintained for arrays that * support hot removal */ @@ -33583,7 +37997,7 @@ index 1c2063c..9639970 100644 * for reporting to userspace and storing * in superblock. */ -@@ -429,7 +429,7 @@ static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) +@@ -434,7 +434,7 @@ static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors) { @@ -33592,45 +38006,6 @@ index 1c2063c..9639970 100644 } struct md_personality -diff --git a/drivers/md/persistent-data/dm-space-map-checker.c b/drivers/md/persistent-data/dm-space-map-checker.c -index fc90c11..c8cd9a9 100644 ---- a/drivers/md/persistent-data/dm-space-map-checker.c -+++ b/drivers/md/persistent-data/dm-space-map-checker.c -@@ -167,7 +167,7 @@ static int ca_commit(struct count_array *old, struct count_array *new) - /*----------------------------------------------------------------*/ - - struct sm_checker { -- struct dm_space_map sm; -+ dm_space_map_no_const sm; - - struct count_array old_counts; - struct count_array counts; -diff --git a/drivers/md/persistent-data/dm-space-map-disk.c b/drivers/md/persistent-data/dm-space-map-disk.c -index 3d0ed53..35dc592 100644 ---- a/drivers/md/persistent-data/dm-space-map-disk.c -+++ b/drivers/md/persistent-data/dm-space-map-disk.c -@@ -23,7 +23,7 @@ - * Space map interface. - */ - struct sm_disk { -- struct dm_space_map sm; -+ dm_space_map_no_const sm; - - struct ll_disk ll; - struct ll_disk old_ll; -diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c -index e89ae5e..062e4c2 100644 ---- a/drivers/md/persistent-data/dm-space-map-metadata.c -+++ b/drivers/md/persistent-data/dm-space-map-metadata.c -@@ -43,7 +43,7 @@ struct block_op { - }; - - struct sm_metadata { -- struct dm_space_map sm; -+ dm_space_map_no_const sm; - - struct ll_disk ll; - struct ll_disk old_ll; diff --git a/drivers/md/persistent-data/dm-space-map.h b/drivers/md/persistent-data/dm-space-map.h index 1cbfc6b..56e1dbb 100644 --- a/drivers/md/persistent-data/dm-space-map.h @@ -33644,10 +38019,10 @@ index 1cbfc6b..56e1dbb 100644 /*----------------------------------------------------------------*/ diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c -index 23904d2..c4801f9 100644 +index 6af167f..40c25a1 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c -@@ -1688,7 +1688,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) +@@ -1826,7 +1826,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) if (r1_sync_page_io(rdev, sect, s, bio->bi_io_vec[idx].bv_page, READ) != 0) @@ -33656,7 +38031,7 @@ index 23904d2..c4801f9 100644 } sectors -= s; sect += s; -@@ -1908,7 +1908,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, +@@ -2048,7 +2048,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, test_bit(In_sync, &rdev->flags)) { if (r1_sync_page_io(rdev, sect, s, conf->tmppage, READ)) { @@ -33666,10 +38041,10 @@ index 23904d2..c4801f9 100644 "md/raid1:%s: read error corrected " "(%d sectors at %llu on %s)\n", diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c -index a954c95..6e7a21c 100644 +index 46c14e5..4db5966 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c -@@ -1684,7 +1684,7 @@ static void end_sync_read(struct bio *bio, int error) +@@ -1932,7 +1932,7 @@ static void end_sync_read(struct bio *bio, int error) /* The write handler will notice the lack of * R10BIO_Uptodate and record any errors etc */ @@ -33678,7 +38053,7 @@ index a954c95..6e7a21c 100644 &conf->mirrors[d].rdev->corrected_errors); /* for reconstruct, we always reschedule after a read. -@@ -2033,7 +2033,7 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev) +@@ -2281,7 +2281,7 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev) { struct timespec cur_time_mon; unsigned long hours_since_last; @@ -33687,7 +38062,7 @@ index a954c95..6e7a21c 100644 ktime_get_ts(&cur_time_mon); -@@ -2055,9 +2055,9 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev) +@@ -2303,9 +2303,9 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev) * overflowing the shift of read_errors by hours_since_last. */ if (hours_since_last >= 8 * sizeof(read_errors)) @@ -33699,7 +38074,7 @@ index a954c95..6e7a21c 100644 } static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector, -@@ -2111,8 +2111,8 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 +@@ -2359,8 +2359,8 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 return; check_decay_read_errors(mddev, rdev); @@ -33710,7 +38085,7 @@ index a954c95..6e7a21c 100644 char b[BDEVNAME_SIZE]; bdevname(rdev->bdev, b); -@@ -2120,7 +2120,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 +@@ -2368,7 +2368,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 "md/raid10:%s: %s: Raid device exceeded " "read_error threshold [cur %d:max %d]\n", mdname(mddev), b, @@ -33719,9 +38094,9 @@ index a954c95..6e7a21c 100644 printk(KERN_NOTICE "md/raid10:%s: %s: Failing raid device\n", mdname(mddev), b); -@@ -2271,7 +2271,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 - (unsigned long long)( - sect + rdev->data_offset), +@@ -2523,7 +2523,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 + sect + + choose_data_offset(r10_bio, rdev)), bdevname(rdev->bdev, b)); - atomic_add(s, &rdev->corrected_errors); + atomic_add_unchecked(s, &rdev->corrected_errors); @@ -33729,18 +38104,20 @@ index a954c95..6e7a21c 100644 rdev_dec_pending(rdev, mddev); diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c -index 73a5800..2b0e3b1 100644 +index f4e87bf..0d4ad3f 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c -@@ -1694,18 +1694,18 @@ static void raid5_end_read_request(struct bio * bi, int error) - (unsigned long long)(sh->sector - + rdev->data_offset), +@@ -1763,21 +1763,21 @@ static void raid5_end_read_request(struct bio * bi, int error) + mdname(conf->mddev), STRIPE_SECTORS, + (unsigned long long)s, bdevname(rdev->bdev, b)); - atomic_add(STRIPE_SECTORS, &rdev->corrected_errors); + atomic_add_unchecked(STRIPE_SECTORS, &rdev->corrected_errors); clear_bit(R5_ReadError, &sh->dev[i].flags); clear_bit(R5_ReWrite, &sh->dev[i].flags); - } + } else if (test_bit(R5_ReadNoMerge, &sh->dev[i].flags)) + clear_bit(R5_ReadNoMerge, &sh->dev[i].flags); + - if (atomic_read(&rdev->read_errors)) - atomic_set(&rdev->read_errors, 0); + if (atomic_read_unchecked(&rdev->read_errors)) @@ -33748,6 +38125,7 @@ index 73a5800..2b0e3b1 100644 } else { const char *bdn = bdevname(rdev->bdev, b); int retry = 0; + int set_bad = 0; clear_bit(R5_UPTODATE, &sh->dev[i].flags); - atomic_inc(&rdev->read_errors); @@ -33755,45 +38133,19 @@ index 73a5800..2b0e3b1 100644 if (test_bit(R5_ReadRepl, &sh->dev[i].flags)) printk_ratelimited( KERN_WARNING -@@ -1734,7 +1734,7 @@ static void raid5_end_read_request(struct bio * bi, int error) - (unsigned long long)(sh->sector - + rdev->data_offset), +@@ -1805,7 +1805,7 @@ static void raid5_end_read_request(struct bio * bi, int error) + mdname(conf->mddev), + (unsigned long long)s, bdn); -- else if (atomic_read(&rdev->read_errors) -+ else if (atomic_read_unchecked(&rdev->read_errors) +- } else if (atomic_read(&rdev->read_errors) ++ } else if (atomic_read_unchecked(&rdev->read_errors) > conf->max_nr_stripes) printk(KERN_WARNING "md/raid:%s: Too many read errors, failing device %s.\n", -diff --git a/drivers/media/dvb/ddbridge/ddbridge-core.c b/drivers/media/dvb/ddbridge/ddbridge-core.c -index d88c4aa..17c80b1 100644 ---- a/drivers/media/dvb/ddbridge/ddbridge-core.c -+++ b/drivers/media/dvb/ddbridge/ddbridge-core.c -@@ -1679,7 +1679,7 @@ static struct ddb_info ddb_v6 = { - .subvendor = _subvend, .subdevice = _subdev, \ - .driver_data = (unsigned long)&_driverdata } - --static const struct pci_device_id ddb_id_tbl[] __devinitdata = { -+static const struct pci_device_id ddb_id_tbl[] __devinitconst = { - DDB_ID(DDVID, 0x0002, DDVID, 0x0001, ddb_octopus), - DDB_ID(DDVID, 0x0003, DDVID, 0x0001, ddb_octopus), - DDB_ID(DDVID, 0x0003, DDVID, 0x0002, ddb_octopus_le), -diff --git a/drivers/media/dvb/dvb-core/dvb_demux.h b/drivers/media/dvb/dvb-core/dvb_demux.h -index a7d876f..8c21b61 100644 ---- a/drivers/media/dvb/dvb-core/dvb_demux.h -+++ b/drivers/media/dvb/dvb-core/dvb_demux.h -@@ -73,7 +73,7 @@ struct dvb_demux_feed { - union { - dmx_ts_cb ts; - dmx_section_cb sec; -- } cb; -+ } __no_const cb; - - struct dvb_demux *demux; - void *priv; -diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c -index 39eab73..60033e7 100644 ---- a/drivers/media/dvb/dvb-core/dvbdev.c -+++ b/drivers/media/dvb/dvb-core/dvbdev.c +diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c +index 401ef64..836e563 100644 +--- a/drivers/media/dvb-core/dvbdev.c ++++ b/drivers/media/dvb-core/dvbdev.c @@ -192,7 +192,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, const struct dvb_device *template, void *priv, int type) { @@ -33803,36 +38155,10 @@ index 39eab73..60033e7 100644 struct device *clsdev; int minor; int id; -diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c -index 3940bb0..fb3952a 100644 ---- a/drivers/media/dvb/dvb-usb/cxusb.c -+++ b/drivers/media/dvb/dvb-usb/cxusb.c -@@ -1068,7 +1068,7 @@ static struct dib0070_config dib7070p_dib0070_config = { - - struct dib0700_adapter_state { - int (*set_param_save) (struct dvb_frontend *); --}; -+} __no_const; - - static int dib7070_set_param_override(struct dvb_frontend *fe) - { -diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c -index 451c5a7..649f711 100644 ---- a/drivers/media/dvb/dvb-usb/dw2102.c -+++ b/drivers/media/dvb/dvb-usb/dw2102.c -@@ -95,7 +95,7 @@ struct su3000_state { - - struct s6x0_state { - int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v); --}; -+} __no_const; - - /* debug */ - static int dvb_usb_dw2102_debug; -diff --git a/drivers/media/dvb/frontends/dib3000.h b/drivers/media/dvb/frontends/dib3000.h -index 404f63a..4796533 100644 ---- a/drivers/media/dvb/frontends/dib3000.h -+++ b/drivers/media/dvb/frontends/dib3000.h +diff --git a/drivers/media/dvb-frontends/dib3000.h b/drivers/media/dvb-frontends/dib3000.h +index 9b6c3bb..baeb5c7 100644 +--- a/drivers/media/dvb-frontends/dib3000.h ++++ b/drivers/media/dvb-frontends/dib3000.h @@ -39,7 +39,7 @@ struct dib_fe_xfer_ops int (*fifo_ctrl)(struct dvb_frontend *fe, int onoff); int (*pid_ctrl)(struct dvb_frontend *fe, int index, int pid, int onoff); @@ -33840,101 +38166,30 @@ index 404f63a..4796533 100644 -}; +} __no_const; - #if defined(CONFIG_DVB_DIB3000MB) || (defined(CONFIG_DVB_DIB3000MB_MODULE) && defined(MODULE)) + #if IS_ENABLED(CONFIG_DVB_DIB3000MB) extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, -diff --git a/drivers/media/dvb/ngene/ngene-cards.c b/drivers/media/dvb/ngene/ngene-cards.c -index 7539a5d..06531a6 100644 ---- a/drivers/media/dvb/ngene/ngene-cards.c -+++ b/drivers/media/dvb/ngene/ngene-cards.c -@@ -478,7 +478,7 @@ static struct ngene_info ngene_info_m780 = { - - /****************************************************************************/ - --static const struct pci_device_id ngene_id_tbl[] __devinitdata = { -+static const struct pci_device_id ngene_id_tbl[] __devinitconst = { - NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2), - NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2), - NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2), -diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c -index 16a089f..1661b11 100644 ---- a/drivers/media/radio/radio-cadet.c -+++ b/drivers/media/radio/radio-cadet.c -@@ -326,6 +326,8 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo - unsigned char readbuf[RDS_BUFFER]; - int i = 0; - -+ if (count > RDS_BUFFER) -+ return -EFAULT; - mutex_lock(&dev->lock); - if (dev->rdsstat == 0) { - dev->rdsstat = 1; -@@ -347,7 +349,7 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo - readbuf[i++] = dev->rdsbuf[dev->rdsout++]; - mutex_unlock(&dev->lock); - -- if (copy_to_user(data, readbuf, i)) -+ if (i > sizeof(readbuf) || copy_to_user(data, readbuf, i)) - return -EFAULT; - return i; - } -diff --git a/drivers/media/video/au0828/au0828.h b/drivers/media/video/au0828/au0828.h -index 9cde353..8c6a1c3 100644 ---- a/drivers/media/video/au0828/au0828.h -+++ b/drivers/media/video/au0828/au0828.h -@@ -191,7 +191,7 @@ struct au0828_dev { - - /* I2C */ - struct i2c_adapter i2c_adap; -- struct i2c_algorithm i2c_algo; -+ i2c_algorithm_no_const i2c_algo; - struct i2c_client i2c_client; - u32 i2c_rc; - -diff --git a/drivers/media/video/cx25821/cx25821-core.c b/drivers/media/video/cx25821/cx25821-core.c -index 7930ca5..235bf7d 100644 ---- a/drivers/media/video/cx25821/cx25821-core.c -+++ b/drivers/media/video/cx25821/cx25821-core.c -@@ -912,9 +912,6 @@ static int cx25821_dev_setup(struct cx25821_dev *dev) - list_add_tail(&dev->devlist, &cx25821_devlist); - mutex_unlock(&cx25821_devlist_mutex); - -- strcpy(cx25821_boards[UNKNOWN_BOARD].name, "unknown"); -- strcpy(cx25821_boards[CX25821_BOARD].name, "cx25821"); -- - if (dev->pci->device != 0x8210) { - pr_info("%s(): Exiting. Incorrect Hardware device = 0x%02x\n", - __func__, dev->pci->device); -diff --git a/drivers/media/video/cx25821/cx25821.h b/drivers/media/video/cx25821/cx25821.h -index b9aa801..029f293 100644 ---- a/drivers/media/video/cx25821/cx25821.h -+++ b/drivers/media/video/cx25821/cx25821.h -@@ -187,7 +187,7 @@ enum port { - }; - - struct cx25821_board { -- char *name; -+ const char *name; - enum port porta; - enum port portb; - enum port portc; -diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c -index 04bf662..e0ac026 100644 ---- a/drivers/media/video/cx88/cx88-alsa.c -+++ b/drivers/media/video/cx88/cx88-alsa.c -@@ -766,7 +766,7 @@ static struct snd_kcontrol_new snd_cx88_alc_switch = { - * Only boards with eeprom and byte 1 at eeprom=1 have it - */ - --static const struct pci_device_id const cx88_audio_pci_tbl[] __devinitdata = { -+static const struct pci_device_id const cx88_audio_pci_tbl[] __devinitconst = { - {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, - {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, - {0, } -diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c -index 88cf9d9..bbc4b2c 100644 ---- a/drivers/media/video/omap/omap_vout.c -+++ b/drivers/media/video/omap/omap_vout.c -@@ -64,7 +64,6 @@ enum omap_vout_channels { +diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c +index bc78354..42c9459 100644 +--- a/drivers/media/pci/cx88/cx88-video.c ++++ b/drivers/media/pci/cx88/cx88-video.c +@@ -50,9 +50,9 @@ MODULE_VERSION(CX88_VERSION); + + /* ------------------------------------------------------------------ */ + +-static unsigned int video_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; +-static unsigned int vbi_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; +-static unsigned int radio_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; ++static int video_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; ++static int vbi_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; ++static int radio_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; + + module_param_array(video_nr, int, NULL, 0444); + module_param_array(vbi_nr, int, NULL, 0444); +diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c +index 96c4a17..1305a79 100644 +--- a/drivers/media/platform/omap/omap_vout.c ++++ b/drivers/media/platform/omap/omap_vout.c +@@ -63,7 +63,6 @@ enum omap_vout_channels { OMAP_VIDEO2, }; @@ -33942,7 +38197,7 @@ index 88cf9d9..bbc4b2c 100644 /* Variables configurable through module params*/ static u32 video1_numbuffers = 3; static u32 video2_numbuffers = 3; -@@ -1000,6 +999,12 @@ static int omap_vout_open(struct file *file) +@@ -1012,6 +1011,12 @@ static int omap_vout_open(struct file *file) { struct videobuf_queue *q; struct omap_vout_device *vout = NULL; @@ -33955,7 +38210,7 @@ index 88cf9d9..bbc4b2c 100644 vout = video_drvdata(file); v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Entering %s\n", __func__); -@@ -1017,10 +1022,6 @@ static int omap_vout_open(struct file *file) +@@ -1029,10 +1034,6 @@ static int omap_vout_open(struct file *file) vout->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; q = &vout->vbq; @@ -33966,46 +38221,234 @@ index 88cf9d9..bbc4b2c 100644 spin_lock_init(&vout->vbq_lock); videobuf_queue_dma_contig_init(q, &video_vbq_ops, q->dev, -diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h -index 305e6aa..0143317 100644 ---- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h -+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h -@@ -196,7 +196,7 @@ struct pvr2_hdw { - - /* I2C stuff */ - struct i2c_adapter i2c_adap; -- struct i2c_algorithm i2c_algo; -+ i2c_algorithm_no_const i2c_algo; - pvr2_i2c_func i2c_func[PVR2_I2C_FUNC_CNT]; - int i2c_cx25840_hack_state; - int i2c_linked; -diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c -index 02194c0..091733b 100644 ---- a/drivers/media/video/timblogiw.c -+++ b/drivers/media/video/timblogiw.c -@@ -745,7 +745,7 @@ static int timblogiw_mmap(struct file *file, struct vm_area_struct *vma) - - /* Platform device functions */ - --static __devinitconst struct v4l2_ioctl_ops timblogiw_ioctl_ops = { -+static __devinitconst v4l2_ioctl_ops_no_const timblogiw_ioctl_ops = { - .vidioc_querycap = timblogiw_querycap, - .vidioc_enum_fmt_vid_cap = timblogiw_enum_fmt, - .vidioc_g_fmt_vid_cap = timblogiw_g_fmt, -@@ -767,7 +767,7 @@ static __devinitconst struct v4l2_ioctl_ops timblogiw_ioctl_ops = { - .vidioc_enum_framesizes = timblogiw_enum_framesizes, - }; +diff --git a/drivers/media/platform/s5p-tv/mixer.h b/drivers/media/platform/s5p-tv/mixer.h +index 04e6490..2df65bf 100644 +--- a/drivers/media/platform/s5p-tv/mixer.h ++++ b/drivers/media/platform/s5p-tv/mixer.h +@@ -156,7 +156,7 @@ struct mxr_layer { + /** layer index (unique identifier) */ + int idx; + /** callbacks for layer methods */ +- struct mxr_layer_ops ops; ++ struct mxr_layer_ops *ops; + /** format array */ + const struct mxr_format **fmt_array; + /** size of format array */ +diff --git a/drivers/media/platform/s5p-tv/mixer_grp_layer.c b/drivers/media/platform/s5p-tv/mixer_grp_layer.c +index b93a21f..2535195 100644 +--- a/drivers/media/platform/s5p-tv/mixer_grp_layer.c ++++ b/drivers/media/platform/s5p-tv/mixer_grp_layer.c +@@ -235,7 +235,7 @@ struct mxr_layer *mxr_graph_layer_create(struct mxr_device *mdev, int idx) + { + struct mxr_layer *layer; + int ret; +- struct mxr_layer_ops ops = { ++ static struct mxr_layer_ops ops = { + .release = mxr_graph_layer_release, + .buffer_set = mxr_graph_buffer_set, + .stream_set = mxr_graph_stream_set, +diff --git a/drivers/media/platform/s5p-tv/mixer_reg.c b/drivers/media/platform/s5p-tv/mixer_reg.c +index b713403..53cb5ad 100644 +--- a/drivers/media/platform/s5p-tv/mixer_reg.c ++++ b/drivers/media/platform/s5p-tv/mixer_reg.c +@@ -276,7 +276,7 @@ static void mxr_irq_layer_handle(struct mxr_layer *layer) + layer->update_buf = next; + } + +- layer->ops.buffer_set(layer, layer->update_buf); ++ layer->ops->buffer_set(layer, layer->update_buf); + + if (done && done != layer->shadow_buf) + vb2_buffer_done(&done->vb, VB2_BUF_STATE_DONE); +diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c +index 82142a2..6de47e8 100644 +--- a/drivers/media/platform/s5p-tv/mixer_video.c ++++ b/drivers/media/platform/s5p-tv/mixer_video.c +@@ -209,7 +209,7 @@ static void mxr_layer_default_geo(struct mxr_layer *layer) + layer->geo.src.height = layer->geo.src.full_height; + + mxr_geometry_dump(mdev, &layer->geo); +- layer->ops.fix_geometry(layer, MXR_GEOMETRY_SINK, 0); ++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_SINK, 0); + mxr_geometry_dump(mdev, &layer->geo); + } + +@@ -227,7 +227,7 @@ static void mxr_layer_update_output(struct mxr_layer *layer) + layer->geo.dst.full_width = mbus_fmt.width; + layer->geo.dst.full_height = mbus_fmt.height; + layer->geo.dst.field = mbus_fmt.field; +- layer->ops.fix_geometry(layer, MXR_GEOMETRY_SINK, 0); ++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_SINK, 0); + + mxr_geometry_dump(mdev, &layer->geo); + } +@@ -333,7 +333,7 @@ static int mxr_s_fmt(struct file *file, void *priv, + /* set source size to highest accepted value */ + geo->src.full_width = max(geo->dst.full_width, pix->width); + geo->src.full_height = max(geo->dst.full_height, pix->height); +- layer->ops.fix_geometry(layer, MXR_GEOMETRY_SOURCE, 0); ++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_SOURCE, 0); + mxr_geometry_dump(mdev, &layer->geo); + /* set cropping to total visible screen */ + geo->src.width = pix->width; +@@ -341,12 +341,12 @@ static int mxr_s_fmt(struct file *file, void *priv, + geo->src.x_offset = 0; + geo->src.y_offset = 0; + /* assure consistency of geometry */ +- layer->ops.fix_geometry(layer, MXR_GEOMETRY_CROP, MXR_NO_OFFSET); ++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_CROP, MXR_NO_OFFSET); + mxr_geometry_dump(mdev, &layer->geo); + /* set full size to lowest possible value */ + geo->src.full_width = 0; + geo->src.full_height = 0; +- layer->ops.fix_geometry(layer, MXR_GEOMETRY_SOURCE, 0); ++ layer->ops->fix_geometry(layer, MXR_GEOMETRY_SOURCE, 0); + mxr_geometry_dump(mdev, &layer->geo); + + /* returning results */ +@@ -473,7 +473,7 @@ static int mxr_s_selection(struct file *file, void *fh, + target->width = s->r.width; + target->height = s->r.height; + +- layer->ops.fix_geometry(layer, stage, s->flags); ++ layer->ops->fix_geometry(layer, stage, s->flags); + + /* retrieve update selection rectangle */ + res.left = target->x_offset; +@@ -938,13 +938,13 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) + mxr_output_get(mdev); + + mxr_layer_update_output(layer); +- layer->ops.format_set(layer); ++ layer->ops->format_set(layer); + /* enabling layer in hardware */ + spin_lock_irqsave(&layer->enq_slock, flags); + layer->state = MXR_LAYER_STREAMING; + spin_unlock_irqrestore(&layer->enq_slock, flags); + +- layer->ops.stream_set(layer, MXR_ENABLE); ++ layer->ops->stream_set(layer, MXR_ENABLE); + mxr_streamer_get(mdev); + + return 0; +@@ -1014,7 +1014,7 @@ static int stop_streaming(struct vb2_queue *vq) + spin_unlock_irqrestore(&layer->enq_slock, flags); + + /* disabling layer in hardware */ +- layer->ops.stream_set(layer, MXR_DISABLE); ++ layer->ops->stream_set(layer, MXR_DISABLE); + /* remove one streamer */ + mxr_streamer_put(mdev); + /* allow changes in output configuration */ +@@ -1053,8 +1053,8 @@ void mxr_base_layer_unregister(struct mxr_layer *layer) + + void mxr_layer_release(struct mxr_layer *layer) + { +- if (layer->ops.release) +- layer->ops.release(layer); ++ if (layer->ops->release) ++ layer->ops->release(layer); + } + + void mxr_base_layer_release(struct mxr_layer *layer) +@@ -1080,7 +1080,7 @@ struct mxr_layer *mxr_base_layer_create(struct mxr_device *mdev, + + layer->mdev = mdev; + layer->idx = idx; +- layer->ops = *ops; ++ layer->ops = ops; + + spin_lock_init(&layer->enq_slock); + INIT_LIST_HEAD(&layer->enq_list); +diff --git a/drivers/media/platform/s5p-tv/mixer_vp_layer.c b/drivers/media/platform/s5p-tv/mixer_vp_layer.c +index 3d13a63..da31bf1 100644 +--- a/drivers/media/platform/s5p-tv/mixer_vp_layer.c ++++ b/drivers/media/platform/s5p-tv/mixer_vp_layer.c +@@ -206,7 +206,7 @@ struct mxr_layer *mxr_vp_layer_create(struct mxr_device *mdev, int idx) + { + struct mxr_layer *layer; + int ret; +- struct mxr_layer_ops ops = { ++ static struct mxr_layer_ops ops = { + .release = mxr_vp_layer_release, + .buffer_set = mxr_vp_buffer_set, + .stream_set = mxr_vp_stream_set, +diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c +index 643d80a..56bb96b 100644 +--- a/drivers/media/radio/radio-cadet.c ++++ b/drivers/media/radio/radio-cadet.c +@@ -302,6 +302,8 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo + unsigned char readbuf[RDS_BUFFER]; + int i = 0; + ++ if (count > RDS_BUFFER) ++ return -EFAULT; + mutex_lock(&dev->lock); + if (dev->rdsstat == 0) + cadet_start_rds(dev); +@@ -317,7 +319,7 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo + while (i < count && dev->rdsin != dev->rdsout) + readbuf[i++] = dev->rdsbuf[dev->rdsout++]; + +- if (i && copy_to_user(data, readbuf, i)) ++ if (i > sizeof(readbuf) || copy_to_user(data, readbuf, i)) + i = -EFAULT; + unlock: + mutex_unlock(&dev->lock); +diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c +index 3940bb0..fb3952a 100644 +--- a/drivers/media/usb/dvb-usb/cxusb.c ++++ b/drivers/media/usb/dvb-usb/cxusb.c +@@ -1068,7 +1068,7 @@ static struct dib0070_config dib7070p_dib0070_config = { + + struct dib0700_adapter_state { + int (*set_param_save) (struct dvb_frontend *); +-}; ++} __no_const; --static __devinitconst struct v4l2_file_operations timblogiw_fops = { -+static __devinitconst v4l2_file_operations_no_const timblogiw_fops = { - .owner = THIS_MODULE, - .open = timblogiw_open, - .release = timblogiw_close, + static int dib7070_set_param_override(struct dvb_frontend *fe) + { +diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c +index 9578a67..31aa652 100644 +--- a/drivers/media/usb/dvb-usb/dw2102.c ++++ b/drivers/media/usb/dvb-usb/dw2102.c +@@ -115,7 +115,7 @@ struct su3000_state { + + struct s6x0_state { + int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v); +-}; ++} __no_const; + + /* debug */ + static int dvb_usb_dw2102_debug; +diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c +index aa6e7c7..4cd8061 100644 +--- a/drivers/media/v4l2-core/v4l2-ioctl.c ++++ b/drivers/media/v4l2-core/v4l2-ioctl.c +@@ -1923,7 +1923,8 @@ struct v4l2_ioctl_info { + struct file *file, void *fh, void *p); + } u; + void (*debug)(const void *arg, bool write_only); +-}; ++} __do_const; ++typedef struct v4l2_ioctl_info __no_const v4l2_ioctl_info_no_const; + + /* This control needs a priority check */ + #define INFO_FL_PRIO (1 << 0) +@@ -2108,7 +2109,7 @@ static long __video_do_ioctl(struct file *file, + struct video_device *vfd = video_devdata(file); + const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops; + bool write_only = false; +- struct v4l2_ioctl_info default_info; ++ v4l2_ioctl_info_no_const default_info; + const struct v4l2_ioctl_info *info; + void *fh = file->private_data; + struct v4l2_fh *vfh = NULL; diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c -index a5c591f..db692a3 100644 +index fb69baa..3aeea2e 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c -@@ -6754,8 +6754,13 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v) +@@ -6755,8 +6755,13 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v) seq_printf(m, " MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth); seq_printf(m, " MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize); @@ -34019,8 +38462,20 @@ index a5c591f..db692a3 100644 /* * Rounding UP to nearest 4-kB boundary here... */ +@@ -6769,7 +6774,11 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v) + ioc->facts.GlobalCredits); + + seq_printf(m, " Frames @ 0x%p (Dma @ 0x%p)\n", ++#ifdef CONFIG_GRKERNSEC_HIDESYM ++ NULL, NULL); ++#else + (void *)ioc->alloc, (void *)(ulong)ioc->alloc_dma); ++#endif + sz = (ioc->reply_sz * ioc->reply_depth) + 128; + seq_printf(m, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n", + ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz); diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c -index 551262e..7551198 100644 +index fa43c39..daeb158 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -446,6 +446,23 @@ mptsas_is_end_device(struct mptsas_devinfo * attached) @@ -34072,10 +38527,10 @@ index 551262e..7551198 100644 mptsas_get_port(struct mptsas_phyinfo *phy_info) { diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c -index 0c3ced7..1fe34ec 100644 +index 164afa7..b6b2e74 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c -@@ -1270,15 +1270,16 @@ mptscsih_info(struct Scsi_Host *SChost) +@@ -1271,15 +1271,16 @@ mptscsih_info(struct Scsi_Host *SChost) h = shost_priv(SChost); @@ -34101,16 +38556,15 @@ index 0c3ced7..1fe34ec 100644 return h->info_kbuf; } diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c -index 6d115c7..58ff7fd 100644 +index 8001aa6..b137580 100644 --- a/drivers/message/i2o/i2o_proc.c +++ b/drivers/message/i2o/i2o_proc.c -@@ -255,13 +255,6 @@ static char *scsi_devices[] = { +@@ -255,12 +255,6 @@ static char *scsi_devices[] = { "Array Controller Device" }; --static char *chtostr(u8 * chars, int n) +-static char *chtostr(char *tmp, u8 *chars, int n) -{ -- char tmp[256]; - tmp[0] = 0; - return strncat(tmp, (char *)chars, n); -} @@ -34118,39 +38572,64 @@ index 6d115c7..58ff7fd 100644 static int i2o_report_query_status(struct seq_file *seq, int block_status, char *group) { -@@ -838,8 +831,7 @@ static int i2o_seq_show_ddm_table(struct seq_file *seq, void *v) +@@ -790,7 +784,6 @@ static int i2o_seq_show_ddm_table(struct seq_file *seq, void *v) + } *result; + + i2o_exec_execute_ddm_table ddm_table; +- char tmp[28 + 1]; + + result = kmalloc(sizeof(*result), GFP_KERNEL); + if (!result) +@@ -825,8 +818,7 @@ static int i2o_seq_show_ddm_table(struct seq_file *seq, void *v) seq_printf(seq, "%-#7x", ddm_table.i2o_vendor_id); seq_printf(seq, "%-#8x", ddm_table.module_id); - seq_printf(seq, "%-29s", -- chtostr(ddm_table.module_name_version, 28)); +- chtostr(tmp, ddm_table.module_name_version, 28)); + seq_printf(seq, "%-.28s", ddm_table.module_name_version); seq_printf(seq, "%9d ", ddm_table.data_size); seq_printf(seq, "%8d", ddm_table.code_size); -@@ -940,8 +932,8 @@ static int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v) +@@ -893,7 +885,6 @@ static int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v) + + i2o_driver_result_table *result; + i2o_driver_store_table *dst; +- char tmp[28 + 1]; + + result = kmalloc(sizeof(i2o_driver_result_table), GFP_KERNEL); + if (result == NULL) +@@ -928,9 +919,8 @@ static int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v) seq_printf(seq, "%-#7x", dst->i2o_vendor_id); seq_printf(seq, "%-#8x", dst->module_id); -- seq_printf(seq, "%-29s", chtostr(dst->module_name_version, 28)); -- seq_printf(seq, "%-9s", chtostr(dst->date, 8)); +- seq_printf(seq, "%-29s", +- chtostr(tmp, dst->module_name_version, 28)); +- seq_printf(seq, "%-9s", chtostr(tmp, dst->date, 8)); + seq_printf(seq, "%-.28s", dst->module_name_version); + seq_printf(seq, "%-.8s", dst->date); seq_printf(seq, "%8d ", dst->module_size); seq_printf(seq, "%8d ", dst->mpb_size); seq_printf(seq, "0x%04x", dst->module_flags); -@@ -1272,14 +1264,10 @@ static int i2o_seq_show_dev_identity(struct seq_file *seq, void *v) +@@ -1250,7 +1240,6 @@ static int i2o_seq_show_dev_identity(struct seq_file *seq, void *v) + // == (allow) 512d bytes (max) + static u16 *work16 = (u16 *) work32; + int token; +- char tmp[16 + 1]; + + token = i2o_parm_field_get(d, 0xF100, -1, &work32, sizeof(work32)); + +@@ -1262,14 +1251,10 @@ static int i2o_seq_show_dev_identity(struct seq_file *seq, void *v) seq_printf(seq, "Device Class : %s\n", i2o_get_class_name(work16[0])); seq_printf(seq, "Owner TID : %0#5x\n", work16[2]); seq_printf(seq, "Parent TID : %0#5x\n", work16[3]); - seq_printf(seq, "Vendor info : %s\n", -- chtostr((u8 *) (work32 + 2), 16)); +- chtostr(tmp, (u8 *) (work32 + 2), 16)); - seq_printf(seq, "Product info : %s\n", -- chtostr((u8 *) (work32 + 6), 16)); +- chtostr(tmp, (u8 *) (work32 + 6), 16)); - seq_printf(seq, "Description : %s\n", -- chtostr((u8 *) (work32 + 10), 16)); +- chtostr(tmp, (u8 *) (work32 + 10), 16)); - seq_printf(seq, "Product rev. : %s\n", -- chtostr((u8 *) (work32 + 14), 8)); +- chtostr(tmp, (u8 *) (work32 + 14), 8)); + seq_printf(seq, "Vendor info : %.16s\n", (u8 *) (work32 + 2)); + seq_printf(seq, "Product info : %.16s\n", (u8 *) (work32 + 6)); + seq_printf(seq, "Description : %.16s\n", (u8 *) (work32 + 10)); @@ -34158,31 +38637,49 @@ index 6d115c7..58ff7fd 100644 seq_printf(seq, "Serial number : "); print_serial_number(seq, (u8 *) (work32 + 16), -@@ -1324,10 +1312,8 @@ static int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v) +@@ -1306,8 +1291,6 @@ static int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v) + u8 pad[256]; // allow up to 256 byte (max) serial number + } result; + +- char tmp[24 + 1]; +- + token = i2o_parm_field_get(d, 0xF101, -1, &result, sizeof(result)); + + if (token < 0) { +@@ -1316,10 +1299,8 @@ static int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v) } seq_printf(seq, "Registering DDM TID : 0x%03x\n", result.ddm_tid); - seq_printf(seq, "Module name : %s\n", -- chtostr(result.module_name, 24)); +- chtostr(tmp, result.module_name, 24)); - seq_printf(seq, "Module revision : %s\n", -- chtostr(result.module_rev, 8)); +- chtostr(tmp, result.module_rev, 8)); + seq_printf(seq, "Module name : %.24s\n", result.module_name); + seq_printf(seq, "Module revision : %.8s\n", result.module_rev); seq_printf(seq, "Serial number : "); print_serial_number(seq, result.serial_number, sizeof(result) - 36); -@@ -1358,14 +1344,10 @@ static int i2o_seq_show_uinfo(struct seq_file *seq, void *v) +@@ -1343,8 +1324,6 @@ static int i2o_seq_show_uinfo(struct seq_file *seq, void *v) + u8 instance_number[4]; + } result; + +- char tmp[64 + 1]; +- + token = i2o_parm_field_get(d, 0xF102, -1, &result, sizeof(result)); + + if (token < 0) { +@@ -1352,14 +1331,10 @@ static int i2o_seq_show_uinfo(struct seq_file *seq, void *v) return 0; } - seq_printf(seq, "Device name : %s\n", -- chtostr(result.device_name, 64)); +- chtostr(tmp, result.device_name, 64)); - seq_printf(seq, "Service name : %s\n", -- chtostr(result.service_name, 64)); +- chtostr(tmp, result.service_name, 64)); - seq_printf(seq, "Physical name : %s\n", -- chtostr(result.physical_location, 64)); +- chtostr(tmp, result.physical_location, 64)); - seq_printf(seq, "Instance number : %s\n", -- chtostr(result.instance_number, 4)); +- chtostr(tmp, result.instance_number, 4)); + seq_printf(seq, "Device name : %.64s\n", result.device_name); + seq_printf(seq, "Service name : %.64s\n", result.service_name); + seq_printf(seq, "Physical name : %.64s\n", result.physical_location); @@ -34217,21 +38714,8 @@ index a8c08f3..155fe3d 100644 INIT_LIST_HEAD(&c->context_list); #endif -diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c -index 7ce65f4..e66e9bc 100644 ---- a/drivers/mfd/abx500-core.c -+++ b/drivers/mfd/abx500-core.c -@@ -15,7 +15,7 @@ static LIST_HEAD(abx500_list); - - struct abx500_device_entry { - struct list_head list; -- struct abx500_ops ops; -+ abx500_ops_no_const ops; - struct device *dev; - }; - diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c -index a9223ed..4127b13 100644 +index 45ece11..8efa218 100644 --- a/drivers/mfd/janz-cmodio.c +++ b/drivers/mfd/janz-cmodio.c @@ -13,6 +13,7 @@ @@ -34242,11 +38726,97 @@ index a9223ed..4127b13 100644 #include <linux/init.h> #include <linux/pci.h> #include <linux/interrupt.h> +diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c +index a5f9888..1c0ed56 100644 +--- a/drivers/mfd/twl4030-irq.c ++++ b/drivers/mfd/twl4030-irq.c +@@ -35,6 +35,7 @@ + #include <linux/of.h> + #include <linux/irqdomain.h> + #include <linux/i2c/twl.h> ++#include <asm/pgtable.h> + + #include "twl-core.h" + +@@ -728,10 +729,12 @@ int twl4030_init_irq(struct device *dev, int irq_num) + * Install an irq handler for each of the SIH modules; + * clone dummy irq_chip since PIH can't *do* anything + */ +- twl4030_irq_chip = dummy_irq_chip; +- twl4030_irq_chip.name = "twl4030"; ++ pax_open_kernel(); ++ memcpy((void *)&twl4030_irq_chip, &dummy_irq_chip, sizeof twl4030_irq_chip); ++ *(const char **)&twl4030_irq_chip.name = "twl4030"; + +- twl4030_sih_irq_chip.irq_ack = dummy_irq_chip.irq_ack; ++ *(void **)&twl4030_sih_irq_chip.irq_ack = dummy_irq_chip.irq_ack; ++ pax_close_kernel(); + + for (i = irq_base; i < irq_end; i++) { + irq_set_chip_and_handler(i, &twl4030_irq_chip, +diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c +index 277a8db..0e0b754 100644 +--- a/drivers/mfd/twl6030-irq.c ++++ b/drivers/mfd/twl6030-irq.c +@@ -387,10 +387,12 @@ int twl6030_init_irq(struct device *dev, int irq_num) + * install an irq handler for each of the modules; + * clone dummy irq_chip since PIH can't *do* anything + */ +- twl6030_irq_chip = dummy_irq_chip; +- twl6030_irq_chip.name = "twl6030"; +- twl6030_irq_chip.irq_set_type = NULL; +- twl6030_irq_chip.irq_set_wake = twl6030_irq_set_wake; ++ pax_open_kernel(); ++ memcpy((void *)&twl6030_irq_chip, &dummy_irq_chip, sizeof twl6030_irq_chip); ++ *(const char **)&twl6030_irq_chip.name = "twl6030"; ++ *(void **)&twl6030_irq_chip.irq_set_type = NULL; ++ *(void **)&twl6030_irq_chip.irq_set_wake = twl6030_irq_set_wake; ++ pax_close_kernel(); + + for (i = irq_base; i < irq_end; i++) { + irq_set_chip_and_handler(i, &twl6030_irq_chip, +diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c +index f32550a..e3e52a2 100644 +--- a/drivers/misc/c2port/core.c ++++ b/drivers/misc/c2port/core.c +@@ -920,7 +920,9 @@ struct c2port_device *c2port_device_register(char *name, + mutex_init(&c2dev->mutex); + + /* Create binary file */ +- c2port_bin_attrs.size = ops->blocks_num * ops->block_size; ++ pax_open_kernel(); ++ *(size_t *)&c2port_bin_attrs.size = ops->blocks_num * ops->block_size; ++ pax_close_kernel(); + ret = device_create_bin_file(c2dev->dev, &c2port_bin_attrs); + if (unlikely(ret)) + goto error_device_create_bin_file; +diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c +index 36f5d52..32311c3 100644 +--- a/drivers/misc/kgdbts.c ++++ b/drivers/misc/kgdbts.c +@@ -834,7 +834,7 @@ static void run_plant_and_detach_test(int is_early) + char before[BREAK_INSTR_SIZE]; + char after[BREAK_INSTR_SIZE]; + +- probe_kernel_read(before, (char *)kgdbts_break_test, ++ probe_kernel_read(before, ktla_ktva((char *)kgdbts_break_test), + BREAK_INSTR_SIZE); + init_simple_test(); + ts.tst = plant_and_detach_test; +@@ -842,7 +842,7 @@ static void run_plant_and_detach_test(int is_early) + /* Activate test with initial breakpoint */ + if (!is_early) + kgdb_breakpoint(); +- probe_kernel_read(after, (char *)kgdbts_break_test, ++ probe_kernel_read(after, ktla_ktva((char *)kgdbts_break_test), + BREAK_INSTR_SIZE); + if (memcmp(before, after, BREAK_INSTR_SIZE)) { + printk(KERN_CRIT "kgdbts: ERROR kgdb corrupted memory\n"); diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c -index a981e2a..5ca0c8b 100644 +index 4a87e5c..76bdf5c 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c -@@ -466,7 +466,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *data) +@@ -498,7 +498,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *data) * the lid is closed. This leads to interrupts as soon as a little move * is done. */ @@ -34255,7 +38825,7 @@ index a981e2a..5ca0c8b 100644 wake_up_interruptible(&lis3->misc_wait); kill_fasync(&lis3->async_queue, SIGIO, POLL_IN); -@@ -552,7 +552,7 @@ static int lis3lv02d_misc_open(struct inode *inode, struct file *file) +@@ -584,7 +584,7 @@ static int lis3lv02d_misc_open(struct inode *inode, struct file *file) if (lis3->pm_dev) pm_runtime_get_sync(lis3->pm_dev); @@ -34264,7 +38834,7 @@ index a981e2a..5ca0c8b 100644 return 0; } -@@ -585,7 +585,7 @@ static ssize_t lis3lv02d_misc_read(struct file *file, char __user *buf, +@@ -617,7 +617,7 @@ static ssize_t lis3lv02d_misc_read(struct file *file, char __user *buf, add_wait_queue(&lis3->misc_wait, &wait); while (true) { set_current_state(TASK_INTERRUPTIBLE); @@ -34273,7 +38843,7 @@ index a981e2a..5ca0c8b 100644 if (data) break; -@@ -626,7 +626,7 @@ static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait) +@@ -658,7 +658,7 @@ static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait) struct lis3lv02d, miscdev); poll_wait(file, &lis3->misc_wait, wait); @@ -34283,10 +38853,10 @@ index a981e2a..5ca0c8b 100644 return 0; } diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h -index 2b1482a..5d33616 100644 +index c439c82..1f20f57 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.h +++ b/drivers/misc/lis3lv02d/lis3lv02d.h -@@ -266,7 +266,7 @@ struct lis3lv02d { +@@ -297,7 +297,7 @@ struct lis3lv02d { struct input_polled_dev *idev; /* input device */ struct platform_device *pdev; /* platform device */ struct regulator_bulk_data regulators[2]; @@ -34295,19 +38865,6 @@ index 2b1482a..5d33616 100644 union axis_conversion ac; /* hw -> logical axis */ int mapped_btns[3]; -diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c -index 28adefe..08aad69 100644 ---- a/drivers/misc/lkdtm.c -+++ b/drivers/misc/lkdtm.c -@@ -477,6 +477,8 @@ static ssize_t lkdtm_debugfs_read(struct file *f, char __user *user_buf, - int i, n, out; - - buf = (char *)__get_free_page(GFP_KERNEL); -+ if (buf == NULL) -+ return -ENOMEM; - - n = snprintf(buf, PAGE_SIZE, "Available crash types:\n"); - for (i = 0; i < ARRAY_SIZE(cp_type); i++) diff --git a/drivers/misc/sgi-gru/gruhandles.c b/drivers/misc/sgi-gru/gruhandles.c index 2f30bad..c4c13d0 100644 --- a/drivers/misc/sgi-gru/gruhandles.c @@ -34409,31 +38966,6 @@ index 5c3ce24..4915ccb 100644 - atomic_long_t flush_tlb_gru; - atomic_long_t flush_tlb_gru_tgh; - atomic_long_t flush_tlb_gru_zero_asid; -- -- atomic_long_t copy_gpa; -- atomic_long_t read_gpa; -- -- atomic_long_t mesq_receive; -- atomic_long_t mesq_receive_none; -- atomic_long_t mesq_send; -- atomic_long_t mesq_send_failed; -- atomic_long_t mesq_noop; -- atomic_long_t mesq_send_unexpected_error; -- atomic_long_t mesq_send_lb_overflow; -- atomic_long_t mesq_send_qlimit_reached; -- atomic_long_t mesq_send_amo_nacked; -- atomic_long_t mesq_send_put_nacked; -- atomic_long_t mesq_page_overflow; -- atomic_long_t mesq_qf_locked; -- atomic_long_t mesq_qf_noop_not_full; -- atomic_long_t mesq_qf_switch_head_failed; -- atomic_long_t mesq_qf_unexpected_error; -- atomic_long_t mesq_noop_unexpected_error; -- atomic_long_t mesq_noop_lb_overflow; -- atomic_long_t mesq_noop_qlimit_reached; -- atomic_long_t mesq_noop_amo_nacked; -- atomic_long_t mesq_noop_put_nacked; -- atomic_long_t mesq_noop_page_overflow; + atomic_long_unchecked_t vdata_alloc; + atomic_long_unchecked_t vdata_free; + atomic_long_unchecked_t gts_alloc; @@ -34485,10 +39017,33 @@ index 5c3ce24..4915ccb 100644 + atomic_long_unchecked_t flush_tlb_gru; + atomic_long_unchecked_t flush_tlb_gru_tgh; + atomic_long_unchecked_t flush_tlb_gru_zero_asid; -+ + +- atomic_long_t copy_gpa; +- atomic_long_t read_gpa; + atomic_long_unchecked_t copy_gpa; + atomic_long_unchecked_t read_gpa; -+ + +- atomic_long_t mesq_receive; +- atomic_long_t mesq_receive_none; +- atomic_long_t mesq_send; +- atomic_long_t mesq_send_failed; +- atomic_long_t mesq_noop; +- atomic_long_t mesq_send_unexpected_error; +- atomic_long_t mesq_send_lb_overflow; +- atomic_long_t mesq_send_qlimit_reached; +- atomic_long_t mesq_send_amo_nacked; +- atomic_long_t mesq_send_put_nacked; +- atomic_long_t mesq_page_overflow; +- atomic_long_t mesq_qf_locked; +- atomic_long_t mesq_qf_noop_not_full; +- atomic_long_t mesq_qf_switch_head_failed; +- atomic_long_t mesq_qf_unexpected_error; +- atomic_long_t mesq_noop_unexpected_error; +- atomic_long_t mesq_noop_lb_overflow; +- atomic_long_t mesq_noop_qlimit_reached; +- atomic_long_t mesq_noop_amo_nacked; +- atomic_long_t mesq_noop_put_nacked; +- atomic_long_t mesq_noop_page_overflow; + atomic_long_unchecked_t mesq_receive; + atomic_long_unchecked_t mesq_receive_none; + atomic_long_unchecked_t mesq_send; @@ -34568,10 +39123,10 @@ index b94d5f7..7f494c5 100644 extern int xpc_disengage_timedout; extern int xpc_activate_IRQ_rcvd; diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c -index 8d082b4..aa749ae 100644 +index d971817..33bdca5 100644 --- a/drivers/misc/sgi-xp/xpc_main.c +++ b/drivers/misc/sgi-xp/xpc_main.c -@@ -162,7 +162,7 @@ static struct notifier_block xpc_die_notifier = { +@@ -166,7 +166,7 @@ static struct notifier_block xpc_die_notifier = { .notifier_call = xpc_system_die, }; @@ -34580,35 +39135,58 @@ index 8d082b4..aa749ae 100644 /* * Timer function to enforce the timelimit on the partition disengage. -diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c -index 2b62232..acfaeeb 100644 ---- a/drivers/misc/ti-st/st_core.c -+++ b/drivers/misc/ti-st/st_core.c -@@ -349,6 +349,11 @@ void st_int_recv(void *disc_data, - st_gdata->rx_skb = alloc_skb( - st_gdata->list[type]->max_frame_size, - GFP_ATOMIC); -+ if (st_gdata->rx_skb == NULL) { -+ pr_err("out of memory: dropping\n"); -+ goto done; -+ } -+ - skb_reserve(st_gdata->rx_skb, - st_gdata->list[type]->reserve); - /* next 2 required for BT only */ -diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c -index 504da71..9722d43 100644 ---- a/drivers/mmc/host/sdhci-pci.c -+++ b/drivers/mmc/host/sdhci-pci.c -@@ -653,7 +653,7 @@ static const struct sdhci_pci_fixes sdhci_via = { - .probe = via_probe, - }; +@@ -1210,7 +1210,7 @@ xpc_system_die(struct notifier_block *nb, unsigned long event, void *_die_args) --static const struct pci_device_id pci_ids[] __devinitdata = { -+static const struct pci_device_id pci_ids[] __devinitconst = { - { - .vendor = PCI_VENDOR_ID_RICOH, - .device = PCI_DEVICE_ID_RICOH_R5C822, + if (((die_args->trapnr == X86_TRAP_MF) || + (die_args->trapnr == X86_TRAP_XF)) && +- !user_mode_vm(die_args->regs)) ++ !user_mode(die_args->regs)) + xpc_die_deactivate(); + + break; +diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c +index 49f04bc..65660c2 100644 +--- a/drivers/mmc/core/mmc_ops.c ++++ b/drivers/mmc/core/mmc_ops.c +@@ -247,7 +247,7 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, + void *data_buf; + int is_on_stack; + +- is_on_stack = object_is_on_stack(buf); ++ is_on_stack = object_starts_on_stack(buf); + if (is_on_stack) { + /* + * dma onto stack is unsafe/nonportable, but callers to this +diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h +index 53b8fd9..615b462 100644 +--- a/drivers/mmc/host/dw_mmc.h ++++ b/drivers/mmc/host/dw_mmc.h +@@ -205,5 +205,5 @@ struct dw_mci_drv_data { + int (*parse_dt)(struct dw_mci *host); + int (*setup_bus)(struct dw_mci *host, + struct device_node *slot_np, u8 bus_width); +-}; ++} __do_const; + #endif /* _DW_MMC_H_ */ +diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c +index 7363efe..681558e 100644 +--- a/drivers/mmc/host/sdhci-s3c.c ++++ b/drivers/mmc/host/sdhci-s3c.c +@@ -720,9 +720,11 @@ static int sdhci_s3c_probe(struct platform_device *pdev) + * we can use overriding functions instead of default. + */ + if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK) { +- sdhci_s3c_ops.set_clock = sdhci_cmu_set_clock; +- sdhci_s3c_ops.get_min_clock = sdhci_cmu_get_min_clock; +- sdhci_s3c_ops.get_max_clock = sdhci_cmu_get_max_clock; ++ pax_open_kernel(); ++ *(void **)&sdhci_s3c_ops.set_clock = sdhci_cmu_set_clock; ++ *(void **)&sdhci_s3c_ops.get_min_clock = sdhci_cmu_get_min_clock; ++ *(void **)&sdhci_s3c_ops.get_max_clock = sdhci_cmu_get_max_clock; ++ pax_close_kernel(); + } + + /* It supports additional host capabilities if needed */ diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c index a4eb8b5..8c0628f 100644 --- a/drivers/mtd/devices/doc2000.c @@ -34623,11 +39201,11 @@ index a4eb8b5..8c0628f 100644 "ECC needs a full sector write (adr: %lx size %lx)\n", (long) to, (long) len); diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c -index a9e57d6..c6d8731 100644 +index 0c8bb6b..6f35deb 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c -@@ -26,6 +26,7 @@ - #include <linux/pci.h> +@@ -24,6 +24,7 @@ + #include <linux/slab.h> #include <linux/mtd/mtd.h> #include <linux/module.h> +#include <linux/slab.h> @@ -34646,37 +39224,116 @@ index 51b9d6a..52af9a7 100644 #include <linux/mtd/mtd.h> #include <linux/mtd/nand.h> #include <linux/mtd/nftl.h> -diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c -index 6762dc4..9956862 100644 ---- a/drivers/net/ethernet/atheros/atlx/atl2.c -+++ b/drivers/net/ethernet/atheros/atlx/atl2.c -@@ -2859,7 +2859,7 @@ static void atl2_force_ps(struct atl2_hw *hw) - */ +diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c +index 8dd6ba5..419cc1d 100644 +--- a/drivers/mtd/sm_ftl.c ++++ b/drivers/mtd/sm_ftl.c +@@ -56,7 +56,7 @@ ssize_t sm_attr_show(struct device *dev, struct device_attribute *attr, + #define SM_CIS_VENDOR_OFFSET 0x59 + struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl) + { +- struct attribute_group *attr_group; ++ attribute_group_no_const *attr_group; + struct attribute **attributes; + struct sm_sysfs_attribute *vendor_attribute; + +diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c +index dbbea0e..3f4a0b1 100644 +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -4822,7 +4822,7 @@ static unsigned int bond_get_num_tx_queues(void) + return tx_queues; + } + +-static struct rtnl_link_ops bond_link_ops __read_mostly = { ++static struct rtnl_link_ops bond_link_ops = { + .kind = "bond", + .priv_size = sizeof(struct bonding), + .setup = bond_setup, +@@ -4947,8 +4947,8 @@ static void __exit bonding_exit(void) + + bond_destroy_debugfs(); + +- rtnl_link_unregister(&bond_link_ops); + unregister_pernet_subsys(&bond_net_ops); ++ rtnl_link_unregister(&bond_link_ops); + + #ifdef CONFIG_NET_POLL_CONTROLLER + /* +diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c +index e1d2643..7f4133b 100644 +--- a/drivers/net/ethernet/8390/ax88796.c ++++ b/drivers/net/ethernet/8390/ax88796.c +@@ -872,9 +872,11 @@ static int ax_probe(struct platform_device *pdev) + if (ax->plat->reg_offsets) + ei_local->reg_offset = ax->plat->reg_offsets; + else { ++ resource_size_t _mem_size = mem_size; ++ do_div(_mem_size, 0x18); + ei_local->reg_offset = ax->reg_offsets; + for (ret = 0; ret < 0x18; ret++) +- ax->reg_offsets[ret] = (mem_size / 0x18) * ret; ++ ax->reg_offsets[ret] = _mem_size * ret; + } + + if (!request_mem_region(mem->start, mem_size, pdev->name)) { +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +index aee7671..3ca2651 100644 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +@@ -1093,7 +1093,7 @@ static inline u8 bnx2x_get_path_func_num(struct bnx2x *bp) + static inline void bnx2x_init_bp_objs(struct bnx2x *bp) + { + /* RX_MODE controlling object */ +- bnx2x_init_rx_mode_obj(bp, &bp->rx_mode_obj); ++ bnx2x_init_rx_mode_obj(bp); + + /* multicast configuration controlling object */ + bnx2x_init_mcast_obj(bp, &bp->mcast_obj, bp->fp->cl_id, bp->fp->cid, +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +index 7306416..5fb7fb5 100644 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +@@ -2381,15 +2381,14 @@ int bnx2x_config_rx_mode(struct bnx2x *bp, + return rc; + } + +-void bnx2x_init_rx_mode_obj(struct bnx2x *bp, +- struct bnx2x_rx_mode_obj *o) ++void bnx2x_init_rx_mode_obj(struct bnx2x *bp) + { + if (CHIP_IS_E1x(bp)) { +- o->wait_comp = bnx2x_empty_rx_mode_wait; +- o->config_rx_mode = bnx2x_set_rx_mode_e1x; ++ bp->rx_mode_obj.wait_comp = bnx2x_empty_rx_mode_wait; ++ bp->rx_mode_obj.config_rx_mode = bnx2x_set_rx_mode_e1x; + } else { +- o->wait_comp = bnx2x_wait_rx_mode_comp_e2; +- o->config_rx_mode = bnx2x_set_rx_mode_e2; ++ bp->rx_mode_obj.wait_comp = bnx2x_wait_rx_mode_comp_e2; ++ bp->rx_mode_obj.config_rx_mode = bnx2x_set_rx_mode_e2; + } + } - #define ATL2_PARAM(X, desc) \ -- static const int __devinitdata X[ATL2_MAX_NIC + 1] = ATL2_PARAM_INIT; \ -+ static const int __devinitconst X[ATL2_MAX_NIC + 1] = ATL2_PARAM_INIT; \ - MODULE_PARM(X, "1-" __MODULE_STRING(ATL2_MAX_NIC) "i"); \ - MODULE_PARM_DESC(X, desc); - #else diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h -index 61a7670..7da6e34 100644 +index ff90760..08d8aed 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h -@@ -483,7 +483,7 @@ struct bnx2x_rx_mode_obj { +@@ -1306,8 +1306,7 @@ int bnx2x_vlan_mac_move(struct bnx2x *bp, - int (*wait_comp)(struct bnx2x *bp, - struct bnx2x_rx_mode_ramrod_params *p); --}; -+} __no_const; + /********************* RX MODE ****************/ - /********************** Set multicast group ***********************************/ +-void bnx2x_init_rx_mode_obj(struct bnx2x *bp, +- struct bnx2x_rx_mode_obj *o); ++void bnx2x_init_rx_mode_obj(struct bnx2x *bp); + /** + * bnx2x_config_rx_mode - Send and RX_MODE ramrod according to the provided parameters. diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h -index 93865f8..5448741 100644 +index 8d7d4c2..95f7681 100644 --- a/drivers/net/ethernet/broadcom/tg3.h +++ b/drivers/net/ethernet/broadcom/tg3.h -@@ -140,6 +140,7 @@ +@@ -147,6 +147,7 @@ #define CHIPREV_ID_5750_A0 0x4000 #define CHIPREV_ID_5750_A1 0x4001 #define CHIPREV_ID_5750_A3 0x4003 @@ -34685,7 +39342,7 @@ index 93865f8..5448741 100644 #define CHIPREV_ID_5752_A0_HW 0x5000 #define CHIPREV_ID_5752_A0 0x6000 diff --git a/drivers/net/ethernet/chelsio/cxgb3/l2t.h b/drivers/net/ethernet/chelsio/cxgb3/l2t.h -index c4e8643..0979484 100644 +index 8cffcdf..aadf043 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/l2t.h +++ b/drivers/net/ethernet/chelsio/cxgb3/l2t.h @@ -87,7 +87,7 @@ typedef void (*arp_failure_handler_func)(struct t3cdev * dev, @@ -34698,7 +39355,7 @@ index c4e8643..0979484 100644 #define L2T_SKB_CB(skb) ((struct l2t_skb_cb *)(skb)->cb) diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c -index 18b106c..2b38d36 100644 +index 4c83003..2a2a5b9 100644 --- a/drivers/net/ethernet/dec/tulip/de4x5.c +++ b/drivers/net/ethernet/dec/tulip/de4x5.c @@ -5388,7 +5388,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) @@ -34719,50 +39376,11 @@ index 18b106c..2b38d36 100644 return -EFAULT; break; } -diff --git a/drivers/net/ethernet/dec/tulip/eeprom.c b/drivers/net/ethernet/dec/tulip/eeprom.c -index ed7d1dc..d426748 100644 ---- a/drivers/net/ethernet/dec/tulip/eeprom.c -+++ b/drivers/net/ethernet/dec/tulip/eeprom.c -@@ -79,7 +79,7 @@ static struct eeprom_fixup eeprom_fixups[] __devinitdata = { - {NULL}}; - - --static const char *block_name[] __devinitdata = { -+static const char *block_name[] __devinitconst = { - "21140 non-MII", - "21140 MII PHY", - "21142 Serial PHY", -diff --git a/drivers/net/ethernet/dec/tulip/winbond-840.c b/drivers/net/ethernet/dec/tulip/winbond-840.c -index 2ac6fff..2d127d0 100644 ---- a/drivers/net/ethernet/dec/tulip/winbond-840.c -+++ b/drivers/net/ethernet/dec/tulip/winbond-840.c -@@ -236,7 +236,7 @@ struct pci_id_info { - int drv_flags; /* Driver use, intended as capability flags. */ - }; - --static const struct pci_id_info pci_id_tbl[] __devinitdata = { -+static const struct pci_id_info pci_id_tbl[] __devinitconst = { - { /* Sometime a Level-One switch card. */ - "Winbond W89c840", CanHaveMII | HasBrokenTx | FDXOnNoMII}, - { "Winbond W89c840", CanHaveMII | HasBrokenTx}, -diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c -index d783f4f..97fa1b0 100644 ---- a/drivers/net/ethernet/dlink/sundance.c -+++ b/drivers/net/ethernet/dlink/sundance.c -@@ -218,7 +218,7 @@ enum { - struct pci_id_info { - const char *name; - }; --static const struct pci_id_info pci_id_tbl[] __devinitdata = { -+static const struct pci_id_info pci_id_tbl[] __devinitconst = { - {"D-Link DFE-550TX FAST Ethernet Adapter"}, - {"D-Link DFE-550FX 100Mbps Fiber-optics Adapter"}, - {"D-Link DFE-580TX 4 port Server Adapter"}, diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c -index 1bbf6b3..430dcd0 100644 +index 2886c9b..db71673 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c -@@ -403,7 +403,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val) +@@ -455,7 +455,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val) if (wrapped) newacc += 65536; @@ -34772,7 +39390,7 @@ index 1bbf6b3..430dcd0 100644 void be_parse_stats(struct be_adapter *adapter) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c -index 16b0704..d2c07d7 100644 +index 7c361d1..57e3ff1 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -31,6 +31,8 @@ @@ -34785,7 +39403,7 @@ index 16b0704..d2c07d7 100644 #include "ftgmac100.h" diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c -index 829b109..4ae5f6a 100644 +index b5ea8fb..bd25e9a 100644 --- a/drivers/net/ethernet/faraday/ftmac100.c +++ b/drivers/net/ethernet/faraday/ftmac100.c @@ -31,6 +31,8 @@ @@ -34797,368 +39415,96 @@ index 829b109..4ae5f6a 100644 #include "ftmac100.h" -diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c -index 1637b98..c42f87b 100644 ---- a/drivers/net/ethernet/fealnx.c -+++ b/drivers/net/ethernet/fealnx.c -@@ -150,7 +150,7 @@ struct chip_info { - int flags; - }; - --static const struct chip_info skel_netdrv_tbl[] __devinitdata = { -+static const struct chip_info skel_netdrv_tbl[] __devinitconst = { - { "100/10M Ethernet PCI Adapter", HAS_MII_XCVR }, - { "100/10M Ethernet PCI Adapter", HAS_CHIP_XCVR }, - { "1000/100/10M Ethernet PCI Adapter", HAS_MII_XCVR }, -diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h -index b83897f..b2d970f 100644 ---- a/drivers/net/ethernet/intel/e1000e/e1000.h -+++ b/drivers/net/ethernet/intel/e1000e/e1000.h -@@ -181,7 +181,7 @@ struct e1000_info; - #define E1000_TXDCTL_DMA_BURST_ENABLE \ - (E1000_TXDCTL_GRAN | /* set descriptor granularity */ \ - E1000_TXDCTL_COUNT_DESC | \ -- (5 << 16) | /* wthresh must be +1 more than desired */\ -+ (1 << 16) | /* wthresh must be +1 more than desired */\ - (1 << 8) | /* hthresh */ \ - 0x1f) /* pthresh */ - -diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h -index f82ecf5..7d59ecb 100644 ---- a/drivers/net/ethernet/intel/e1000e/hw.h -+++ b/drivers/net/ethernet/intel/e1000e/hw.h -@@ -784,6 +784,7 @@ struct e1000_mac_operations { - void (*config_collision_dist)(struct e1000_hw *); - s32 (*read_mac_addr)(struct e1000_hw *); - }; -+typedef struct e1000_mac_operations __no_const e1000_mac_operations_no_const; - - /* - * When to use various PHY register access functions: -@@ -824,6 +825,7 @@ struct e1000_phy_operations { - void (*power_up)(struct e1000_hw *); - void (*power_down)(struct e1000_hw *); - }; -+typedef struct e1000_phy_operations __no_const e1000_phy_operations_no_const; - - /* Function pointers for the NVM. */ - struct e1000_nvm_operations { -@@ -836,9 +838,10 @@ struct e1000_nvm_operations { - s32 (*validate)(struct e1000_hw *); - s32 (*write)(struct e1000_hw *, u16, u16, u16 *); - }; -+typedef struct e1000_nvm_operations __no_const e1000_nvm_operations_no_const; - - struct e1000_mac_info { -- struct e1000_mac_operations ops; -+ e1000_mac_operations_no_const ops; - u8 addr[ETH_ALEN]; - u8 perm_addr[ETH_ALEN]; - -@@ -879,7 +882,7 @@ struct e1000_mac_info { - }; - - struct e1000_phy_info { -- struct e1000_phy_operations ops; -+ e1000_phy_operations_no_const ops; - - enum e1000_phy_type type; - -@@ -913,7 +916,7 @@ struct e1000_phy_info { - }; - - struct e1000_nvm_info { -- struct e1000_nvm_operations ops; -+ e1000_nvm_operations_no_const ops; - - enum e1000_nvm_type type; - enum e1000_nvm_override override; -diff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h -index f67cbd3..cef9e3d 100644 ---- a/drivers/net/ethernet/intel/igb/e1000_hw.h -+++ b/drivers/net/ethernet/intel/igb/e1000_hw.h -@@ -314,6 +314,7 @@ struct e1000_mac_operations { - s32 (*read_mac_addr)(struct e1000_hw *); - s32 (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *); - }; -+typedef struct e1000_mac_operations __no_const e1000_mac_operations_no_const; - - struct e1000_phy_operations { - s32 (*acquire)(struct e1000_hw *); -@@ -330,6 +331,7 @@ struct e1000_phy_operations { - s32 (*set_d3_lplu_state)(struct e1000_hw *, bool); - s32 (*write_reg)(struct e1000_hw *, u32, u16); - }; -+typedef struct e1000_phy_operations __no_const e1000_phy_operations_no_const; - - struct e1000_nvm_operations { - s32 (*acquire)(struct e1000_hw *); -@@ -339,6 +341,7 @@ struct e1000_nvm_operations { - s32 (*update)(struct e1000_hw *); - s32 (*validate)(struct e1000_hw *); - }; -+typedef struct e1000_nvm_operations __no_const e1000_nvm_operations_no_const; - - struct e1000_info { - s32 (*get_invariants)(struct e1000_hw *); -@@ -350,7 +353,7 @@ struct e1000_info { - extern const struct e1000_info e1000_82575_info; - - struct e1000_mac_info { -- struct e1000_mac_operations ops; -+ e1000_mac_operations_no_const ops; - - u8 addr[6]; - u8 perm_addr[6]; -@@ -388,7 +391,7 @@ struct e1000_mac_info { - }; - - struct e1000_phy_info { -- struct e1000_phy_operations ops; -+ e1000_phy_operations_no_const ops; - - enum e1000_phy_type type; - -@@ -423,7 +426,7 @@ struct e1000_phy_info { - }; - - struct e1000_nvm_info { -- struct e1000_nvm_operations ops; -+ e1000_nvm_operations_no_const ops; - enum e1000_nvm_type type; - enum e1000_nvm_override override; - -@@ -468,6 +471,7 @@ struct e1000_mbx_operations { - s32 (*check_for_ack)(struct e1000_hw *, u16); - s32 (*check_for_rst)(struct e1000_hw *, u16); - }; -+typedef struct e1000_mbx_operations __no_const e1000_mbx_operations_no_const; - - struct e1000_mbx_stats { - u32 msgs_tx; -@@ -479,7 +483,7 @@ struct e1000_mbx_stats { - }; - - struct e1000_mbx_info { -- struct e1000_mbx_operations ops; -+ e1000_mbx_operations_no_const ops; - struct e1000_mbx_stats stats; - u32 timeout; - u32 usec_delay; -diff --git a/drivers/net/ethernet/intel/igbvf/vf.h b/drivers/net/ethernet/intel/igbvf/vf.h -index 57db3c6..aa825fc 100644 ---- a/drivers/net/ethernet/intel/igbvf/vf.h -+++ b/drivers/net/ethernet/intel/igbvf/vf.h -@@ -189,9 +189,10 @@ struct e1000_mac_operations { - s32 (*read_mac_addr)(struct e1000_hw *); - s32 (*set_vfta)(struct e1000_hw *, u16, bool); - }; -+typedef struct e1000_mac_operations __no_const e1000_mac_operations_no_const; - - struct e1000_mac_info { -- struct e1000_mac_operations ops; -+ e1000_mac_operations_no_const ops; - u8 addr[6]; - u8 perm_addr[6]; - -@@ -213,6 +214,7 @@ struct e1000_mbx_operations { - s32 (*check_for_ack)(struct e1000_hw *); - s32 (*check_for_rst)(struct e1000_hw *); - }; -+typedef struct e1000_mbx_operations __no_const e1000_mbx_operations_no_const; - - struct e1000_mbx_stats { - u32 msgs_tx; -@@ -224,7 +226,7 @@ struct e1000_mbx_stats { - }; - - struct e1000_mbx_info { -- struct e1000_mbx_operations ops; -+ e1000_mbx_operations_no_const ops; - struct e1000_mbx_stats stats; - u32 timeout; - u32 usec_delay; -diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h -index 8636e83..ab9bbc3 100644 ---- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h -+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h -@@ -2710,6 +2710,7 @@ struct ixgbe_eeprom_operations { - s32 (*update_checksum)(struct ixgbe_hw *); - u16 (*calc_checksum)(struct ixgbe_hw *); - }; -+typedef struct ixgbe_eeprom_operations __no_const ixgbe_eeprom_operations_no_const; - - struct ixgbe_mac_operations { - s32 (*init_hw)(struct ixgbe_hw *); -@@ -2773,6 +2774,7 @@ struct ixgbe_mac_operations { - /* Manageability interface */ - s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8); - }; -+typedef struct ixgbe_mac_operations __no_const ixgbe_mac_operations_no_const; +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +index 331987d..3be1135 100644 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +@@ -776,7 +776,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter) + } - struct ixgbe_phy_operations { - s32 (*identify)(struct ixgbe_hw *); -@@ -2792,9 +2794,10 @@ struct ixgbe_phy_operations { - s32 (*write_i2c_eeprom)(struct ixgbe_hw *, u8, u8); - s32 (*check_overtemp)(struct ixgbe_hw *); - }; -+typedef struct ixgbe_phy_operations __no_const ixgbe_phy_operations_no_const; - - struct ixgbe_eeprom_info { -- struct ixgbe_eeprom_operations ops; -+ ixgbe_eeprom_operations_no_const ops; - enum ixgbe_eeprom_type type; - u32 semaphore_delay; - u16 word_size; -@@ -2804,7 +2807,7 @@ struct ixgbe_eeprom_info { - - #define IXGBE_FLAGS_DOUBLE_RESET_REQUIRED 0x01 - struct ixgbe_mac_info { -- struct ixgbe_mac_operations ops; -+ ixgbe_mac_operations_no_const ops; - enum ixgbe_mac_type type; - u8 addr[ETH_ALEN]; - u8 perm_addr[ETH_ALEN]; -@@ -2832,7 +2835,7 @@ struct ixgbe_mac_info { - }; + /* update the base incval used to calculate frequency adjustment */ +- ACCESS_ONCE(adapter->base_incval) = incval; ++ ACCESS_ONCE_RW(adapter->base_incval) = incval; + smp_mb(); - struct ixgbe_phy_info { -- struct ixgbe_phy_operations ops; -+ ixgbe_phy_operations_no_const ops; - struct mdio_if_info mdio; - enum ixgbe_phy_type type; - u32 id; -@@ -2860,6 +2863,7 @@ struct ixgbe_mbx_operations { - s32 (*check_for_ack)(struct ixgbe_hw *, u16); - s32 (*check_for_rst)(struct ixgbe_hw *, u16); - }; -+typedef struct ixgbe_mbx_operations __no_const ixgbe_mbx_operations_no_const; + /* need lock to prevent incorrect read while modifying cyclecounter */ +diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c +index fbe5363..266b4e3 100644 +--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c ++++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c +@@ -3461,7 +3461,10 @@ __vxge_hw_fifo_create(struct __vxge_hw_vpath_handle *vp, + struct __vxge_hw_fifo *fifo; + struct vxge_hw_fifo_config *config; + u32 txdl_size, txdl_per_memblock; +- struct vxge_hw_mempool_cbs fifo_mp_callback; ++ static struct vxge_hw_mempool_cbs fifo_mp_callback = { ++ .item_func_alloc = __vxge_hw_fifo_mempool_item_alloc, ++ }; ++ + struct __vxge_hw_virtualpath *vpath; - struct ixgbe_mbx_stats { - u32 msgs_tx; -@@ -2871,7 +2875,7 @@ struct ixgbe_mbx_stats { - }; + if ((vp == NULL) || (attr == NULL)) { +@@ -3544,8 +3547,6 @@ __vxge_hw_fifo_create(struct __vxge_hw_vpath_handle *vp, + goto exit; + } - struct ixgbe_mbx_info { -- struct ixgbe_mbx_operations ops; -+ ixgbe_mbx_operations_no_const ops; - struct ixgbe_mbx_stats stats; - u32 timeout; - u32 usec_delay; -diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c -index 307611a..d8e4562 100644 ---- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c -+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c -@@ -969,8 +969,6 @@ static irqreturn_t ixgbevf_msix_clean_tx(int irq, void *data) - r_idx = find_first_bit(q_vector->txr_idx, adapter->num_tx_queues); - for (i = 0; i < q_vector->txr_count; i++) { - tx_ring = &(adapter->tx_ring[r_idx]); -- tx_ring->total_bytes = 0; -- tx_ring->total_packets = 0; - ixgbevf_clean_tx_irq(adapter, tx_ring); - r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues, - r_idx + 1); -@@ -994,16 +992,6 @@ static irqreturn_t ixgbevf_msix_clean_rx(int irq, void *data) - struct ixgbe_hw *hw = &adapter->hw; - struct ixgbevf_ring *rx_ring; - int r_idx; -- int i; +- fifo_mp_callback.item_func_alloc = __vxge_hw_fifo_mempool_item_alloc; - -- r_idx = find_first_bit(q_vector->rxr_idx, adapter->num_rx_queues); -- for (i = 0; i < q_vector->rxr_count; i++) { -- rx_ring = &(adapter->rx_ring[r_idx]); -- rx_ring->total_bytes = 0; -- rx_ring->total_packets = 0; -- r_idx = find_next_bit(q_vector->rxr_idx, adapter->num_rx_queues, -- r_idx + 1); -- } - - if (!q_vector->rxr_count) - return IRQ_HANDLED; -diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.h b/drivers/net/ethernet/intel/ixgbevf/vf.h -index 25c951d..cc7cf33 100644 ---- a/drivers/net/ethernet/intel/ixgbevf/vf.h -+++ b/drivers/net/ethernet/intel/ixgbevf/vf.h -@@ -70,6 +70,7 @@ struct ixgbe_mac_operations { - s32 (*clear_vfta)(struct ixgbe_hw *); - s32 (*set_vfta)(struct ixgbe_hw *, u32, u32, bool); - }; -+typedef struct ixgbe_mac_operations __no_const ixgbe_mac_operations_no_const; - - enum ixgbe_mac_type { - ixgbe_mac_unknown = 0, -@@ -79,7 +80,7 @@ enum ixgbe_mac_type { - }; - - struct ixgbe_mac_info { -- struct ixgbe_mac_operations ops; -+ ixgbe_mac_operations_no_const ops; - u8 addr[6]; - u8 perm_addr[6]; - -@@ -103,6 +104,7 @@ struct ixgbe_mbx_operations { - s32 (*check_for_ack)(struct ixgbe_hw *); - s32 (*check_for_rst)(struct ixgbe_hw *); - }; -+typedef struct ixgbe_mbx_operations __no_const ixgbe_mbx_operations_no_const; - - struct ixgbe_mbx_stats { - u32 msgs_tx; -@@ -114,7 +116,7 @@ struct ixgbe_mbx_stats { - }; - - struct ixgbe_mbx_info { -- struct ixgbe_mbx_operations ops; -+ ixgbe_mbx_operations_no_const ops; - struct ixgbe_mbx_stats stats; - u32 timeout; - u32 udelay; -diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c -index 8bb05b4..074796f 100644 ---- a/drivers/net/ethernet/mellanox/mlx4/main.c -+++ b/drivers/net/ethernet/mellanox/mlx4/main.c -@@ -41,6 +41,7 @@ - #include <linux/slab.h> - #include <linux/io-mapping.h> - #include <linux/delay.h> -+#include <linux/sched.h> - - #include <linux/mlx4/device.h> - #include <linux/mlx4/doorbell.h> -diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.h b/drivers/net/ethernet/neterion/vxge/vxge-config.h -index 5046a64..71ca936 100644 ---- a/drivers/net/ethernet/neterion/vxge/vxge-config.h -+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.h -@@ -514,7 +514,7 @@ struct vxge_hw_uld_cbs { - void (*link_down)(struct __vxge_hw_device *devh); - void (*crit_err)(struct __vxge_hw_device *devh, - enum vxge_hw_event type, u64 ext_data); --}; -+} __no_const; - - /* - * struct __vxge_hw_blockpool_entry - Block private data structure -diff --git a/drivers/net/ethernet/neterion/vxge/vxge-traffic.h b/drivers/net/ethernet/neterion/vxge/vxge-traffic.h -index 4a518a3..936b334 100644 ---- a/drivers/net/ethernet/neterion/vxge/vxge-traffic.h -+++ b/drivers/net/ethernet/neterion/vxge/vxge-traffic.h -@@ -2088,7 +2088,7 @@ struct vxge_hw_mempool_cbs { - struct vxge_hw_mempool_dma *dma_object, - u32 index, - u32 is_last); --}; -+} __no_const; - - #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath) \ - ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next) + fifo->mempool = + __vxge_hw_mempool_create(vpath->hldev, + fifo->config->memblock_size, +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +index 5c033f2..7bbb0d8 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +@@ -1894,7 +1894,9 @@ int qlcnic_83xx_config_default_opmode(struct qlcnic_adapter *adapter) + op_mode = QLCRDX(ahw, QLC_83XX_DRV_OP_MODE); + + if (op_mode == QLC_83XX_DEFAULT_OPMODE) { +- adapter->nic_ops->init_driver = qlcnic_83xx_init_default_driver; ++ pax_open_kernel(); ++ *(void **)&adapter->nic_ops->init_driver = qlcnic_83xx_init_default_driver; ++ pax_close_kernel(); + ahw->idc.state_entry = qlcnic_83xx_idc_ready_state_entry; + } else { + return -EIO; +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c +index b0c3de9..fc5857e 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c +@@ -200,15 +200,21 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *adapter) + if (priv_level == QLCNIC_NON_PRIV_FUNC) { + ahw->op_mode = QLCNIC_NON_PRIV_FUNC; + ahw->idc.state_entry = qlcnic_83xx_idc_ready_state_entry; +- nic_ops->init_driver = qlcnic_83xx_init_non_privileged_vnic; ++ pax_open_kernel(); ++ *(void **)&nic_ops->init_driver = qlcnic_83xx_init_non_privileged_vnic; ++ pax_close_kernel(); + } else if (priv_level == QLCNIC_PRIV_FUNC) { + ahw->op_mode = QLCNIC_PRIV_FUNC; + ahw->idc.state_entry = qlcnic_83xx_idc_vnic_pf_entry; +- nic_ops->init_driver = qlcnic_83xx_init_privileged_vnic; ++ pax_open_kernel(); ++ *(void **)&nic_ops->init_driver = qlcnic_83xx_init_privileged_vnic; ++ pax_close_kernel(); + } else if (priv_level == QLCNIC_MGMT_FUNC) { + ahw->op_mode = QLCNIC_MGMT_FUNC; + ahw->idc.state_entry = qlcnic_83xx_idc_ready_state_entry; +- nic_ops->init_driver = qlcnic_83xx_init_mgmt_vnic; ++ pax_open_kernel(); ++ *(void **)&nic_ops->init_driver = qlcnic_83xx_init_mgmt_vnic; ++ pax_close_kernel(); + } else { + return -EIO; + } diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c -index a73bbe7..94abcb7 100644 +index 15ba8c4..3f56838 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c -@@ -708,17 +708,17 @@ struct rtl8169_private { +@@ -740,22 +740,22 @@ struct rtl8169_private { struct mdio_ops { - void (*write)(void __iomem *, int, int); - int (*read)(void __iomem *, int); + void (*write)(struct rtl8169_private *, int, int); + int (*read)(struct rtl8169_private *, int); - } mdio_ops; + } __no_const mdio_ops; @@ -35174,23 +39520,29 @@ index a73bbe7..94abcb7 100644 - } jumbo_ops; + } __no_const jumbo_ops; + struct csi_ops { + void (*write)(struct rtl8169_private *, int, int); + u32 (*read)(struct rtl8169_private *, int); +- } csi_ops; ++ } __no_const csi_ops; + int (*set_speed)(struct net_device *, u8 aneg, u16 sp, u8 dpx, u32 adv); int (*get_settings)(struct net_device *, struct ethtool_cmd *); -diff --git a/drivers/net/ethernet/sis/sis190.c b/drivers/net/ethernet/sis/sis190.c -index a9deda8..5507c31 100644 ---- a/drivers/net/ethernet/sis/sis190.c -+++ b/drivers/net/ethernet/sis/sis190.c -@@ -1620,7 +1620,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev, - static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev, - struct net_device *dev) - { -- static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 }; -+ static const u16 __devinitconst ids[] = { 0x0965, 0x0966, 0x0968 }; - struct sis190_private *tp = netdev_priv(dev); - struct pci_dev *isa_bridge; - u8 reg, tmp8; +diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c +index 3f93624..cf01144 100644 +--- a/drivers/net/ethernet/sfc/ptp.c ++++ b/drivers/net/ethernet/sfc/ptp.c +@@ -553,7 +553,7 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings) + (u32)((u64)ptp->start.dma_addr >> 32)); + + /* Clear flag that signals MC ready */ +- ACCESS_ONCE(*start) = 0; ++ ACCESS_ONCE_RW(*start) = 0; + efx_mcdi_rpc_start(efx, MC_CMD_PTP, synch_buf, + MC_CMD_PTP_IN_SYNCHRONIZE_LEN); + diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c -index c07cfe9..81cbf7e 100644 +index 50617c5..b13724c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c @@ -140,8 +140,8 @@ void dwmac_mmc_ctrl(void __iomem *ioaddr, unsigned int mode) @@ -35204,33 +39556,11 @@ index c07cfe9..81cbf7e 100644 } /* To mask all all interrupts.*/ -diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index 9bdfaba..3d8f8d4 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -1587,7 +1587,7 @@ static const struct file_operations stmmac_rings_status_fops = { - .open = stmmac_sysfs_ring_open, - .read = seq_read, - .llseek = seq_lseek, -- .release = seq_release, -+ .release = single_release, - }; - - static int stmmac_sysfs_dma_cap_read(struct seq_file *seq, void *v) -@@ -1659,7 +1659,7 @@ static const struct file_operations stmmac_dma_cap_fops = { - .open = stmmac_sysfs_dma_cap_open, - .read = seq_read, - .llseek = seq_lseek, -- .release = seq_release, -+ .release = single_release, - }; - - static int stmmac_init_fs(struct net_device *dev) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h -index c358245..8c1de63 100644 +index e6fe0d8..2b7d752 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h -@@ -98,7 +98,7 @@ struct rndis_device { +@@ -101,7 +101,7 @@ struct rndis_device { enum rndis_device_state state; bool link_state; @@ -35240,10 +39570,10 @@ index c358245..8c1de63 100644 spinlock_t request_lock; struct list_head req_list; diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c -index d6be64b..5d97e3b 100644 +index 0775f0a..d4fb316 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c -@@ -97,7 +97,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev, +@@ -104,7 +104,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev, * template */ set = &rndis_msg->msg.set_req; @@ -35252,7 +39582,7 @@ index d6be64b..5d97e3b 100644 /* Add to the request list */ spin_lock_irqsave(&dev->request_lock, flags); -@@ -648,7 +648,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev) +@@ -752,7 +752,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev) /* Setup the rndis set */ halt = &request->request_msg.msg.halt_req; @@ -35261,11 +39591,85 @@ index d6be64b..5d97e3b 100644 /* Ignore return since this msg is optional. */ rndis_filter_send_request(dev, request); +diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c +index 8f1c256..a2991d1 100644 +--- a/drivers/net/ieee802154/fakehard.c ++++ b/drivers/net/ieee802154/fakehard.c +@@ -385,7 +385,7 @@ static int ieee802154fake_probe(struct platform_device *pdev) + phy->transmit_power = 0xbf; + + dev->netdev_ops = &fake_ops; +- dev->ml_priv = &fake_mlme; ++ dev->ml_priv = (void *)&fake_mlme; + + priv = netdev_priv(dev); + priv->phy = phy; +diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c +index 011062e..ada88e9 100644 +--- a/drivers/net/macvlan.c ++++ b/drivers/net/macvlan.c +@@ -892,13 +892,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = { + int macvlan_link_register(struct rtnl_link_ops *ops) + { + /* common fields */ +- ops->priv_size = sizeof(struct macvlan_dev); +- ops->validate = macvlan_validate; +- ops->maxtype = IFLA_MACVLAN_MAX; +- ops->policy = macvlan_policy; +- ops->changelink = macvlan_changelink; +- ops->get_size = macvlan_get_size; +- ops->fill_info = macvlan_fill_info; ++ pax_open_kernel(); ++ *(size_t *)&ops->priv_size = sizeof(struct macvlan_dev); ++ *(void **)&ops->validate = macvlan_validate; ++ *(int *)&ops->maxtype = IFLA_MACVLAN_MAX; ++ *(const void **)&ops->policy = macvlan_policy; ++ *(void **)&ops->changelink = macvlan_changelink; ++ *(void **)&ops->get_size = macvlan_get_size; ++ *(void **)&ops->fill_info = macvlan_fill_info; ++ pax_close_kernel(); + + return rtnl_link_register(ops); + }; +@@ -954,7 +956,7 @@ static int macvlan_device_event(struct notifier_block *unused, + return NOTIFY_DONE; + } + +-static struct notifier_block macvlan_notifier_block __read_mostly = { ++static struct notifier_block macvlan_notifier_block = { + .notifier_call = macvlan_device_event, + }; + +diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c +index a449439..1e468fe 100644 +--- a/drivers/net/macvtap.c ++++ b/drivers/net/macvtap.c +@@ -1090,7 +1090,7 @@ static int macvtap_device_event(struct notifier_block *unused, + return NOTIFY_DONE; + } + +-static struct notifier_block macvtap_notifier_block __read_mostly = { ++static struct notifier_block macvtap_notifier_block = { + .notifier_call = macvtap_device_event, + }; + +diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c +index daec9b0..6428fcb 100644 +--- a/drivers/net/phy/mdio-bitbang.c ++++ b/drivers/net/phy/mdio-bitbang.c +@@ -234,6 +234,7 @@ void free_mdio_bitbang(struct mii_bus *bus) + struct mdiobb_ctrl *ctrl = bus->priv; + + module_put(ctrl->ops->owner); ++ mdiobus_unregister(bus); + mdiobus_free(bus); + } + EXPORT_SYMBOL(free_mdio_bitbang); diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c -index 21d7151..8034208 100644 +index 72ff14b..11d442d 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c -@@ -986,7 +986,6 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +@@ -999,7 +999,6 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) void __user *addr = (void __user *) ifr->ifr_ifru.ifru_data; struct ppp_stats stats; struct ppp_comp_stats cstats; @@ -35273,7 +39677,7 @@ index 21d7151..8034208 100644 switch (cmd) { case SIOCGPPPSTATS: -@@ -1008,8 +1007,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +@@ -1021,8 +1020,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) break; case SIOCGPPPVER: @@ -35283,85 +39687,57 @@ index 21d7151..8034208 100644 break; err = 0; break; -diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c -index b715e6b..6d2490f 100644 ---- a/drivers/net/tokenring/abyss.c -+++ b/drivers/net/tokenring/abyss.c -@@ -450,10 +450,12 @@ static struct pci_driver abyss_driver = { - - static int __init abyss_init (void) - { -- abyss_netdev_ops = tms380tr_netdev_ops; -+ pax_open_kernel(); -+ memcpy((void *)&abyss_netdev_ops, &tms380tr_netdev_ops, sizeof(tms380tr_netdev_ops)); - -- abyss_netdev_ops.ndo_open = abyss_open; -- abyss_netdev_ops.ndo_stop = abyss_close; -+ *(void **)&abyss_netdev_ops.ndo_open = abyss_open; -+ *(void **)&abyss_netdev_ops.ndo_stop = abyss_close; -+ pax_close_kernel(); +diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c +index 1252d9c..80e660b 100644 +--- a/drivers/net/slip/slhc.c ++++ b/drivers/net/slip/slhc.c +@@ -488,7 +488,7 @@ slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize) + register struct tcphdr *thp; + register struct iphdr *ip; + register struct cstate *cs; +- int len, hdrlen; ++ long len, hdrlen; + unsigned char *cp = icp; + + /* We've got a compressed packet; read the change byte */ +diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c +index bf34192..fba3500 100644 +--- a/drivers/net/team/team.c ++++ b/drivers/net/team/team.c +@@ -2668,7 +2668,7 @@ static int team_device_event(struct notifier_block *unused, + return NOTIFY_DONE; + } + +-static struct notifier_block team_notifier_block __read_mostly = { ++static struct notifier_block team_notifier_block = { + .notifier_call = team_device_event, + }; - return pci_register_driver(&abyss_driver); +diff --git a/drivers/net/tun.c b/drivers/net/tun.c +index 755fa9e..631fdce 100644 +--- a/drivers/net/tun.c ++++ b/drivers/net/tun.c +@@ -1841,7 +1841,7 @@ unlock: } -diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c -index 28adcdf..ae82f35 100644 ---- a/drivers/net/tokenring/madgemc.c -+++ b/drivers/net/tokenring/madgemc.c -@@ -742,9 +742,11 @@ static struct mca_driver madgemc_driver = { - static int __init madgemc_init (void) + static long __tun_chr_ioctl(struct file *file, unsigned int cmd, +- unsigned long arg, int ifreq_len) ++ unsigned long arg, size_t ifreq_len) { -- madgemc_netdev_ops = tms380tr_netdev_ops; -- madgemc_netdev_ops.ndo_open = madgemc_open; -- madgemc_netdev_ops.ndo_stop = madgemc_close; -+ pax_open_kernel(); -+ memcpy((void *)&madgemc_netdev_ops, &tms380tr_netdev_ops, sizeof(tms380tr_netdev_ops)); -+ *(void **)&madgemc_netdev_ops.ndo_open = madgemc_open; -+ *(void **)&madgemc_netdev_ops.ndo_stop = madgemc_close; -+ pax_close_kernel(); - - return mca_register_driver (&madgemc_driver); - } -diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c -index 62d90e4..9d84237 100644 ---- a/drivers/net/tokenring/proteon.c -+++ b/drivers/net/tokenring/proteon.c -@@ -352,9 +352,11 @@ static int __init proteon_init(void) - struct platform_device *pdev; - int i, num = 0, err = 0; - -- proteon_netdev_ops = tms380tr_netdev_ops; -- proteon_netdev_ops.ndo_open = proteon_open; -- proteon_netdev_ops.ndo_stop = tms380tr_close; -+ pax_open_kernel(); -+ memcpy((void *)&proteon_netdev_ops, &tms380tr_netdev_ops, sizeof(tms380tr_netdev_ops)); -+ *(void **)&proteon_netdev_ops.ndo_open = proteon_open; -+ *(void **)&proteon_netdev_ops.ndo_stop = tms380tr_close; -+ pax_close_kernel(); - - err = platform_driver_register(&proteon_driver); - if (err) -diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c -index ee11e93..c8f19c7 100644 ---- a/drivers/net/tokenring/skisa.c -+++ b/drivers/net/tokenring/skisa.c -@@ -362,9 +362,11 @@ static int __init sk_isa_init(void) - struct platform_device *pdev; - int i, num = 0, err = 0; - -- sk_isa_netdev_ops = tms380tr_netdev_ops; -- sk_isa_netdev_ops.ndo_open = sk_isa_open; -- sk_isa_netdev_ops.ndo_stop = tms380tr_close; -+ pax_open_kernel(); -+ memcpy((void *)&sk_isa_netdev_ops, &tms380tr_netdev_ops, sizeof(tms380tr_netdev_ops)); -+ *(void **)&sk_isa_netdev_ops.ndo_open = sk_isa_open; -+ *(void **)&sk_isa_netdev_ops.ndo_stop = tms380tr_close; -+ pax_close_kernel(); + struct tun_file *tfile = file->private_data; + struct tun_struct *tun; +@@ -1853,6 +1853,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, + int vnet_hdr_sz; + int ret; - err = platform_driver_register(&sk_isa_driver); - if (err) ++ if (ifreq_len > sizeof ifr) ++ return -EFAULT; ++ + if (cmd == TUNSETIFF || cmd == TUNSETQUEUE || _IOC_TYPE(cmd) == 0x89) { + if (copy_from_user(&ifr, argp, ifreq_len)) + return -EFAULT; diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c -index 2d2a688..35f2372 100644 +index e2dd324..be92fcf 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -71,7 +71,7 @@ @@ -35373,110 +39749,115 @@ index 2d2a688..35f2372 100644 #define MOD_AUTHOR "Option Wireless" #define MOD_DESCRIPTION "USB High Speed Option driver" -@@ -257,7 +257,7 @@ struct hso_serial { - - /* from usb_serial_port */ - struct tty_struct *tty; -- int open_count; -+ local_t open_count; - spinlock_t serial_lock; - - int (*write_data) (struct hso_serial *serial); -@@ -1190,7 +1190,7 @@ static void put_rxbuf_data_and_resubmit_ctrl_urb(struct hso_serial *serial) +@@ -1180,7 +1180,7 @@ static void put_rxbuf_data_and_resubmit_ctrl_urb(struct hso_serial *serial) struct urb *urb; urb = serial->rx_urb[0]; -- if (serial->open_count > 0) { -+ if (local_read(&serial->open_count) > 0) { +- if (serial->port.count > 0) { ++ if (atomic_read(&serial->port.count) > 0) { count = put_rxbuf_data(urb, serial); if (count == -1) return; -@@ -1226,7 +1226,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) +@@ -1216,7 +1216,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) DUMP1(urb->transfer_buffer, urb->actual_length); /* Anyone listening? */ -- if (serial->open_count == 0) -+ if (local_read(&serial->open_count) == 0) +- if (serial->port.count == 0) ++ if (atomic_read(&serial->port.count) == 0) return; if (status == 0) { -@@ -1311,8 +1311,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) - spin_unlock_irq(&serial->serial_lock); +@@ -1298,8 +1298,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) + tty_port_tty_set(&serial->port, tty); /* check for port already opened, if not set the termios */ -- serial->open_count++; -- if (serial->open_count == 1) { -+ if (local_inc_return(&serial->open_count) == 1) { +- serial->port.count++; +- if (serial->port.count == 1) { ++ if (atomic_inc_return(&serial->port.count) == 1) { serial->rx_state = RX_IDLE; /* Force default termio settings */ _hso_serial_set_termios(tty, NULL); -@@ -1324,7 +1323,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) +@@ -1311,7 +1310,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) result = hso_start_serial_device(serial->parent, GFP_KERNEL); if (result) { hso_stop_serial_device(serial->parent); -- serial->open_count--; -+ local_dec(&serial->open_count); +- serial->port.count--; ++ atomic_dec(&serial->port.count); kref_put(&serial->parent->ref, hso_serial_ref_free); } } else { -@@ -1361,10 +1360,10 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) +@@ -1348,10 +1347,10 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) /* reset the rts and dtr */ /* do the actual close */ -- serial->open_count--; -+ local_dec(&serial->open_count); - -- if (serial->open_count <= 0) { -- serial->open_count = 0; -+ if (local_read(&serial->open_count) <= 0) { -+ local_set(&serial->open_count, 0); - spin_lock_irq(&serial->serial_lock); - if (serial->tty == tty) { - serial->tty->driver_data = NULL; -@@ -1446,7 +1445,7 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old) +- serial->port.count--; ++ atomic_dec(&serial->port.count); + +- if (serial->port.count <= 0) { +- serial->port.count = 0; ++ if (atomic_read(&serial->port.count) <= 0) { ++ atomic_set(&serial->port.count, 0); + tty_port_tty_set(&serial->port, NULL); + if (!usb_gone) + hso_stop_serial_device(serial->parent); +@@ -1427,7 +1426,7 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old) /* the actual setup */ spin_lock_irqsave(&serial->serial_lock, flags); -- if (serial->open_count) -+ if (local_read(&serial->open_count)) +- if (serial->port.count) ++ if (atomic_read(&serial->port.count)) _hso_serial_set_termios(tty, old); else - tty->termios = old; -@@ -1905,7 +1904,7 @@ static void intr_callback(struct urb *urb) + tty->termios = *old; +@@ -1886,7 +1885,7 @@ static void intr_callback(struct urb *urb) D1("Pending read interrupt on port %d\n", i); spin_lock(&serial->serial_lock); if (serial->rx_state == RX_IDLE && -- serial->open_count > 0) { -+ local_read(&serial->open_count) > 0) { +- serial->port.count > 0) { ++ atomic_read(&serial->port.count) > 0) { /* Setup and send a ctrl req read on * port i */ if (!serial->rx_urb_filled[0]) { -@@ -3098,7 +3097,7 @@ static int hso_resume(struct usb_interface *iface) +@@ -3066,7 +3065,7 @@ static int hso_resume(struct usb_interface *iface) /* Start all serial ports */ for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) { if (serial_table[i] && (serial_table[i]->interface == iface)) { -- if (dev2ser(serial_table[i])->open_count) { -+ if (local_read(&dev2ser(serial_table[i])->open_count)) { +- if (dev2ser(serial_table[i])->port.count) { ++ if (atomic_read(&dev2ser(serial_table[i])->port.count)) { result = hso_start_serial_device(serial_table[i], GFP_NOIO); hso_kick_transmit(dev2ser(serial_table[i])); -diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h -index 420d69b..74f90a2 100644 ---- a/drivers/net/wireless/ath/ath.h -+++ b/drivers/net/wireless/ath/ath.h -@@ -119,6 +119,7 @@ struct ath_ops { - void (*write_flush) (void *); - u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr); - }; -+typedef struct ath_ops __no_const ath_ops_no_const; - - struct ath_common; - struct ath_bus_ops; +diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c +index 7cee7a3..1eb9f3b 100644 +--- a/drivers/net/vxlan.c ++++ b/drivers/net/vxlan.c +@@ -1443,7 +1443,7 @@ nla_put_failure: + return -EMSGSIZE; + } + +-static struct rtnl_link_ops vxlan_link_ops __read_mostly = { ++static struct rtnl_link_ops vxlan_link_ops = { + .kind = "vxlan", + .maxtype = IFLA_VXLAN_MAX, + .policy = vxlan_policy, +diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c +index 5ac5f7a..5f82012 100644 +--- a/drivers/net/wireless/at76c50x-usb.c ++++ b/drivers/net/wireless/at76c50x-usb.c +@@ -353,7 +353,7 @@ static int at76_dfu_get_state(struct usb_device *udev, u8 *state) + } + + /* Convert timeout from the DFU status to jiffies */ +-static inline unsigned long at76_get_timeout(struct dfu_status *s) ++static inline unsigned long __intentional_overflow(-1) at76_get_timeout(struct dfu_status *s) + { + return msecs_to_jiffies((s->poll_timeout[2] << 16) + | (s->poll_timeout[1] << 8) diff --git a/drivers/net/wireless/ath/ath9k/ar9002_mac.c b/drivers/net/wireless/ath/ath9k/ar9002_mac.c -index aa2abaf..5f5152d 100644 +index 8d78253..bebbb68 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c -@@ -183,8 +183,8 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) +@@ -184,8 +184,8 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) ads->ds_txstatus6 = ads->ds_txstatus7 = 0; ads->ds_txstatus8 = ads->ds_txstatus9 = 0; @@ -35487,7 +39868,7 @@ index aa2abaf..5f5152d 100644 ctl1 = i->buf_len[0] | (i->is_last ? 0 : AR_TxMore); ctl6 = SM(i->keytype, AR_EncrType); -@@ -198,26 +198,26 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) +@@ -199,26 +199,26 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) if ((i->is_first || i->is_last) && i->aggr != AGGR_BUF_MIDDLE && i->aggr != AGGR_BUF_LAST) { @@ -35521,7 +39902,7 @@ index aa2abaf..5f5152d 100644 return; } -@@ -242,7 +242,7 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) +@@ -243,7 +243,7 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) break; } @@ -35530,7 +39911,7 @@ index aa2abaf..5f5152d 100644 | (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0) | SM(i->txpower, AR_XmitPower) | (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0) -@@ -252,19 +252,19 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) +@@ -253,19 +253,19 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) | (i->flags & ATH9K_TXDESC_RTSENA ? AR_RTSEnable : (i->flags & ATH9K_TXDESC_CTSENA ? AR_CTSEnable : 0)); @@ -35556,7 +39937,7 @@ index aa2abaf..5f5152d 100644 | set11nRateFlags(i->rates, 2) | set11nRateFlags(i->rates, 3) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c -index a66a13b..0ef399e 100644 +index 301bf72..3f5654f 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c @@ -39,47 +39,47 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) @@ -35678,10 +40059,10 @@ index a66a13b..0ef399e 100644 static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads) diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h -index f8e1fbb..bbc303c 100644 +index 784e81c..349e01e 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -615,7 +615,7 @@ struct ath_hw_private_ops { +@@ -653,7 +653,7 @@ struct ath_hw_private_ops { /* ANI */ void (*ani_cache_ini_regs)(struct ath_hw *ah); @@ -35689,43 +40070,21 @@ index f8e1fbb..bbc303c 100644 +} __no_const; /** - * struct ath_hw_ops - callbacks used by hardware code and driver code -@@ -645,7 +645,7 @@ struct ath_hw_ops { - void (*antdiv_comb_conf_set)(struct ath_hw *ah, - struct ath_hw_antcomb_conf *antconf); - + * struct ath_spec_scan - parameters for Atheros spectral scan +@@ -722,7 +722,7 @@ struct ath_hw_ops { + struct ath_spec_scan *param); + void (*spectral_scan_trigger)(struct ath_hw *ah); + void (*spectral_scan_wait)(struct ath_hw *ah); -}; +} __no_const; struct ath_nf_limits { s16 max; -@@ -665,7 +665,7 @@ enum ath_cal_list { - #define AH_FASTCC 0x4 - - struct ath_hw { -- struct ath_ops reg_ops; -+ ath_ops_no_const reg_ops; - - struct ieee80211_hw *hw; - struct ath_common common; -diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h -index af00e2c..ab04d34 100644 ---- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h -+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h -@@ -545,7 +545,7 @@ struct phy_func_ptr { - void (*carrsuppr)(struct brcms_phy *); - s32 (*rxsigpwr)(struct brcms_phy *, s32); - void (*detach)(struct brcms_phy *); --}; -+} __no_const; - - struct brcms_phy { - struct brcms_phy_pub pubpi_ro; diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c -index faec404..a5277f1 100644 +index c353b5f..62aaca2 100644 --- a/drivers/net/wireless/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/iwlegacy/3945-mac.c -@@ -3611,7 +3611,9 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +@@ -3639,7 +3639,9 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) */ if (il3945_mod_params.disable_hw_scan) { D_INFO("Disabling hw_scan\n"); @@ -35736,43 +40095,197 @@ index faec404..a5277f1 100644 } D_INFO("*** LOAD DRIVER ***\n"); +diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c +index 81d4071..f2071ea 100644 +--- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c ++++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c +@@ -203,7 +203,7 @@ static ssize_t iwl_dbgfs_sram_write(struct file *file, + { + struct iwl_priv *priv = file->private_data; + char buf[64]; +- int buf_size; ++ size_t buf_size; + u32 offset, len; + + memset(buf, 0, sizeof(buf)); +@@ -473,7 +473,7 @@ static ssize_t iwl_dbgfs_rx_handlers_write(struct file *file, + struct iwl_priv *priv = file->private_data; + + char buf[8]; +- int buf_size; ++ size_t buf_size; + u32 reset_flag; + + memset(buf, 0, sizeof(buf)); +@@ -554,7 +554,7 @@ static ssize_t iwl_dbgfs_disable_ht40_write(struct file *file, + { + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int ht40; + + memset(buf, 0, sizeof(buf)); +@@ -606,7 +606,7 @@ static ssize_t iwl_dbgfs_sleep_level_override_write(struct file *file, + { + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int value; + + memset(buf, 0, sizeof(buf)); +@@ -1871,7 +1871,7 @@ static ssize_t iwl_dbgfs_clear_ucode_statistics_write(struct file *file, + { + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int clear; + + memset(buf, 0, sizeof(buf)); +@@ -1916,7 +1916,7 @@ static ssize_t iwl_dbgfs_ucode_tracing_write(struct file *file, + { + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int trace; + + memset(buf, 0, sizeof(buf)); +@@ -1987,7 +1987,7 @@ static ssize_t iwl_dbgfs_missed_beacon_write(struct file *file, + { + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int missed; + + memset(buf, 0, sizeof(buf)); +@@ -2028,7 +2028,7 @@ static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file, + + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int plcp; + + memset(buf, 0, sizeof(buf)); +@@ -2088,7 +2088,7 @@ static ssize_t iwl_dbgfs_txfifo_flush_write(struct file *file, + + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int flush; + + memset(buf, 0, sizeof(buf)); +@@ -2178,7 +2178,7 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file, + + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int rts; + + if (!priv->cfg->ht_params) +@@ -2220,7 +2220,7 @@ static ssize_t iwl_dbgfs_echo_test_write(struct file *file, + { + struct iwl_priv *priv = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + + memset(buf, 0, sizeof(buf)); + buf_size = min(count, sizeof(buf) - 1); +@@ -2256,7 +2256,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file, + struct iwl_priv *priv = file->private_data; + u32 event_log_flag; + char buf[8]; +- int buf_size; ++ size_t buf_size; + + /* check that the interface is up */ + if (!iwl_is_ready(priv)) +@@ -2310,7 +2310,7 @@ static ssize_t iwl_dbgfs_calib_disabled_write(struct file *file, + struct iwl_priv *priv = file->private_data; + char buf[8]; + u32 calib_disabled; +- int buf_size; ++ size_t buf_size; + + memset(buf, 0, sizeof(buf)); + buf_size = min(count, sizeof(buf) - 1); +diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c +index 12c4f31..484d948 100644 +--- a/drivers/net/wireless/iwlwifi/pcie/trans.c ++++ b/drivers/net/wireless/iwlwifi/pcie/trans.c +@@ -1328,7 +1328,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file, + struct isr_statistics *isr_stats = &trans_pcie->isr_stats; + + char buf[8]; +- int buf_size; ++ size_t buf_size; + u32 reset_flag; + + memset(buf, 0, sizeof(buf)); +@@ -1349,7 +1349,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file, + { + struct iwl_trans *trans = file->private_data; + char buf[8]; +- int buf_size; ++ size_t buf_size; + int csr; + + memset(buf, 0, sizeof(buf)); diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c -index b7ce6a6..5649756 100644 +index cffdf4f..7cefb69 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -1721,9 +1721,11 @@ static int __init init_mac80211_hwsim(void) - return -EINVAL; +@@ -2144,25 +2144,19 @@ static int __init init_mac80211_hwsim(void) - if (fake_hw_scan) { + if (channels > 1) { + hwsim_if_comb.num_different_channels = channels; - mac80211_hwsim_ops.hw_scan = mac80211_hwsim_hw_scan; +- mac80211_hwsim_ops.cancel_hw_scan = +- mac80211_hwsim_cancel_hw_scan; - mac80211_hwsim_ops.sw_scan_start = NULL; - mac80211_hwsim_ops.sw_scan_complete = NULL; +- mac80211_hwsim_ops.remain_on_channel = +- mac80211_hwsim_roc; +- mac80211_hwsim_ops.cancel_remain_on_channel = +- mac80211_hwsim_croc; +- mac80211_hwsim_ops.add_chanctx = +- mac80211_hwsim_add_chanctx; +- mac80211_hwsim_ops.remove_chanctx = +- mac80211_hwsim_remove_chanctx; +- mac80211_hwsim_ops.change_chanctx = +- mac80211_hwsim_change_chanctx; +- mac80211_hwsim_ops.assign_vif_chanctx = +- mac80211_hwsim_assign_vif_chanctx; +- mac80211_hwsim_ops.unassign_vif_chanctx = +- mac80211_hwsim_unassign_vif_chanctx; + pax_open_kernel(); + *(void **)&mac80211_hwsim_ops.hw_scan = mac80211_hwsim_hw_scan; ++ *(void **)&mac80211_hwsim_ops.cancel_hw_scan = mac80211_hwsim_cancel_hw_scan; + *(void **)&mac80211_hwsim_ops.sw_scan_start = NULL; + *(void **)&mac80211_hwsim_ops.sw_scan_complete = NULL; ++ *(void **)&mac80211_hwsim_ops.remain_on_channel = mac80211_hwsim_roc; ++ *(void **)&mac80211_hwsim_ops.cancel_remain_on_channel = mac80211_hwsim_croc; ++ *(void **)&mac80211_hwsim_ops.add_chanctx = mac80211_hwsim_add_chanctx; ++ *(void **)&mac80211_hwsim_ops.remove_chanctx = mac80211_hwsim_remove_chanctx; ++ *(void **)&mac80211_hwsim_ops.change_chanctx = mac80211_hwsim_change_chanctx; ++ *(void **)&mac80211_hwsim_ops.assign_vif_chanctx = mac80211_hwsim_assign_vif_chanctx; ++ *(void **)&mac80211_hwsim_ops.unassign_vif_chanctx = mac80211_hwsim_unassign_vif_chanctx; + pax_close_kernel(); } spin_lock_init(&hwsim_radio_lock); -diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h -index 35225e9..95e6bf9 100644 ---- a/drivers/net/wireless/mwifiex/main.h -+++ b/drivers/net/wireless/mwifiex/main.h -@@ -537,7 +537,7 @@ struct mwifiex_if_ops { - void (*cleanup_mpa_buf) (struct mwifiex_adapter *); - int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *); - int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *); --}; -+} __no_const; - - struct mwifiex_adapter { - u8 iface_type; diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c -index d66e298..55b0a89 100644 +index 525fd75..6c9f791 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c -@@ -1278,7 +1278,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold) +@@ -1238,7 +1238,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold) netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold); @@ -35782,7 +40295,7 @@ index d66e298..55b0a89 100644 tmp = cpu_to_le32(rts_threshold); diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h -index c264dfa..08ee30e 100644 +index 086abb4..8279c30 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h @@ -396,7 +396,7 @@ struct rt2x00_intf { @@ -35795,10 +40308,10 @@ index c264dfa..08ee30e 100644 static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c -index 50f92d5..f3afc41 100644 +index 4d91795..62fccff 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c -@@ -229,9 +229,9 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev, +@@ -251,9 +251,9 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev, * sequence counter given by mac80211. */ if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) @@ -35810,24 +40323,93 @@ index 50f92d5..f3afc41 100644 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); hdr->seq_ctrl |= cpu_to_le16(seqno); -diff --git a/drivers/net/wireless/wl1251/wl1251.h b/drivers/net/wireless/wl1251/wl1251.h -index 9d8f581..0f6589e 100644 ---- a/drivers/net/wireless/wl1251/wl1251.h -+++ b/drivers/net/wireless/wl1251/wl1251.h -@@ -266,7 +266,7 @@ struct wl1251_if_operations { - void (*reset)(struct wl1251 *wl); - void (*enable_irq)(struct wl1251 *wl); - void (*disable_irq)(struct wl1251 *wl); --}; -+} __no_const; +diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c +index e57ee48..541cf6c 100644 +--- a/drivers/net/wireless/ti/wl1251/sdio.c ++++ b/drivers/net/wireless/ti/wl1251/sdio.c +@@ -269,13 +269,17 @@ static int wl1251_sdio_probe(struct sdio_func *func, + + irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); + +- wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq; +- wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq; ++ pax_open_kernel(); ++ *(void **)&wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq; ++ *(void **)&wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq; ++ pax_close_kernel(); + + wl1251_info("using dedicated interrupt line"); + } else { +- wl1251_sdio_ops.enable_irq = wl1251_sdio_enable_irq; +- wl1251_sdio_ops.disable_irq = wl1251_sdio_disable_irq; ++ pax_open_kernel(); ++ *(void **)&wl1251_sdio_ops.enable_irq = wl1251_sdio_enable_irq; ++ *(void **)&wl1251_sdio_ops.disable_irq = wl1251_sdio_disable_irq; ++ pax_close_kernel(); - struct wl1251 { - struct ieee80211_hw *hw; + wl1251_info("using SDIO interrupt"); + } +diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c +index 09694e3..24ccec7 100644 +--- a/drivers/net/wireless/ti/wl12xx/main.c ++++ b/drivers/net/wireless/ti/wl12xx/main.c +@@ -656,7 +656,9 @@ static int wl12xx_identify_chip(struct wl1271 *wl) + sizeof(wl->conf.mem)); + + /* read data preparation is only needed by wl127x */ +- wl->ops->prepare_read = wl127x_prepare_read; ++ pax_open_kernel(); ++ *(void **)&wl->ops->prepare_read = wl127x_prepare_read; ++ pax_close_kernel(); + + wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER, + WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER, +@@ -681,7 +683,9 @@ static int wl12xx_identify_chip(struct wl1271 *wl) + sizeof(wl->conf.mem)); + + /* read data preparation is only needed by wl127x */ +- wl->ops->prepare_read = wl127x_prepare_read; ++ pax_open_kernel(); ++ *(void **)&wl->ops->prepare_read = wl127x_prepare_read; ++ pax_close_kernel(); + + wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER, + WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER, +diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c +index da3ef1b..4790b95 100644 +--- a/drivers/net/wireless/ti/wl18xx/main.c ++++ b/drivers/net/wireless/ti/wl18xx/main.c +@@ -1664,8 +1664,10 @@ static int wl18xx_setup(struct wl1271 *wl) + } + + if (!checksum_param) { +- wl18xx_ops.set_rx_csum = NULL; +- wl18xx_ops.init_vif = NULL; ++ pax_open_kernel(); ++ *(void **)&wl18xx_ops.set_rx_csum = NULL; ++ *(void **)&wl18xx_ops.init_vif = NULL; ++ pax_close_kernel(); + } + + /* Enable 11a Band only if we have 5G antennas */ +diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c +index 7ef0b4a..ff65c28 100644 +--- a/drivers/net/wireless/zd1211rw/zd_usb.c ++++ b/drivers/net/wireless/zd1211rw/zd_usb.c +@@ -386,7 +386,7 @@ static inline void handle_regs_int(struct urb *urb) + { + struct zd_usb *usb = urb->context; + struct zd_usb_interrupt *intr = &usb->intr; +- int len; ++ unsigned int len; + u16 int_num; + + ZD_ASSERT(in_interrupt()); diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c -index f34b5b2..b5abb9f 100644 +index d93b2b6..ae50401 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c -@@ -343,7 +343,7 @@ static void add_data(struct op_entry *entry, struct mm_struct *mm) +@@ -332,7 +332,7 @@ static void add_data(struct op_entry *entry, struct mm_struct *mm) if (cookie == NO_COOKIE) offset = pc; if (cookie == INVALID_COOKIE) { @@ -35836,7 +40418,7 @@ index f34b5b2..b5abb9f 100644 offset = pc; } if (cookie != last_cookie) { -@@ -387,14 +387,14 @@ add_sample(struct mm_struct *mm, struct op_sample *s, int in_kernel) +@@ -376,14 +376,14 @@ add_sample(struct mm_struct *mm, struct op_sample *s, int in_kernel) /* add userspace sample */ if (!mm) { @@ -35853,7 +40435,7 @@ index f34b5b2..b5abb9f 100644 return 0; } -@@ -563,7 +563,7 @@ void sync_buffer(int cpu) +@@ -552,7 +552,7 @@ void sync_buffer(int cpu) /* ignore backtraces if failed to add a sample */ if (state == sb_bt_start) { state = sb_bt_ignore; @@ -35888,6 +40470,19 @@ index ed2c3ec..deda85a 100644 start_switch_worker(); } +diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c +index 84a208d..d61b0a1 100644 +--- a/drivers/oprofile/oprofile_files.c ++++ b/drivers/oprofile/oprofile_files.c +@@ -27,7 +27,7 @@ unsigned long oprofile_time_slice; + + #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX + +-static ssize_t timeout_read(struct file *file, char __user *buf, ++static ssize_t __intentional_overflow(-1) timeout_read(struct file *file, char __user *buf, + size_t count, loff_t *offset) + { + return oprofilefs_ulong_to_user(jiffies_to_msecs(oprofile_time_slice), diff --git a/drivers/oprofile/oprofile_stats.c b/drivers/oprofile/oprofile_stats.c index 917d28e..d62d981 100644 --- a/drivers/oprofile/oprofile_stats.c @@ -35931,10 +40526,10 @@ index 38b6fc0..b5cbfce 100644 extern struct oprofile_stat_struct oprofile_stats; diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c -index 849357c..b83c1e0 100644 +index 7c12d9c..558bf3bb 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c -@@ -185,7 +185,7 @@ static const struct file_operations atomic_ro_fops = { +@@ -190,7 +190,7 @@ static const struct file_operations atomic_ro_fops = { int oprofilefs_create_ro_atomic(struct super_block *sb, struct dentry *root, @@ -35943,6 +40538,19 @@ index 849357c..b83c1e0 100644 { return __oprofilefs_create_file(sb, root, name, &atomic_ro_fops, 0444, val); +diff --git a/drivers/oprofile/timer_int.c b/drivers/oprofile/timer_int.c +index 93404f7..4a313d8 100644 +--- a/drivers/oprofile/timer_int.c ++++ b/drivers/oprofile/timer_int.c +@@ -93,7 +93,7 @@ static int __cpuinit oprofile_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __refdata oprofile_cpu_notifier = { ++static struct notifier_block oprofile_cpu_notifier = { + .notifier_call = oprofile_cpu_notify, + }; + diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 3f56bc0..707d642 100644 --- a/drivers/parport/procfs.c @@ -35965,19 +40573,97 @@ index 3f56bc0..707d642 100644 } #endif /* IEEE1284.3 support. */ -diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h -index 9fff878..ad0ad53 100644 ---- a/drivers/pci/hotplug/cpci_hotplug.h -+++ b/drivers/pci/hotplug/cpci_hotplug.h -@@ -59,7 +59,7 @@ struct cpci_hp_controller_ops { - int (*hardware_test) (struct slot* slot, u32 value); - u8 (*get_power) (struct slot* slot); - int (*set_power) (struct slot* slot, int value); --}; -+} __no_const; +diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c +index c35e8ad..fc33beb 100644 +--- a/drivers/pci/hotplug/acpiphp_ibm.c ++++ b/drivers/pci/hotplug/acpiphp_ibm.c +@@ -464,7 +464,9 @@ static int __init ibm_acpiphp_init(void) + goto init_cleanup; + } + +- ibm_apci_table_attr.size = ibm_get_table_from_acpi(NULL); ++ pax_open_kernel(); ++ *(size_t *)&ibm_apci_table_attr.size = ibm_get_table_from_acpi(NULL); ++ pax_close_kernel(); + retval = sysfs_create_bin_file(sysdir, &ibm_apci_table_attr); + + return retval; +diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c +index a6a71c4..c91097b 100644 +--- a/drivers/pci/hotplug/cpcihp_generic.c ++++ b/drivers/pci/hotplug/cpcihp_generic.c +@@ -73,7 +73,6 @@ static u16 port; + static unsigned int enum_bit; + static u8 enum_mask; + +-static struct cpci_hp_controller_ops generic_hpc_ops; + static struct cpci_hp_controller generic_hpc; + + static int __init validate_parameters(void) +@@ -139,6 +138,10 @@ static int query_enum(void) + return ((value & enum_mask) == enum_mask); + } + ++static struct cpci_hp_controller_ops generic_hpc_ops = { ++ .query_enum = query_enum, ++}; ++ + static int __init cpcihp_generic_init(void) + { + int status; +@@ -165,7 +168,6 @@ static int __init cpcihp_generic_init(void) + pci_dev_put(dev); + + memset(&generic_hpc, 0, sizeof (struct cpci_hp_controller)); +- generic_hpc_ops.query_enum = query_enum; + generic_hpc.ops = &generic_hpc_ops; + + status = cpci_hp_register_controller(&generic_hpc); +diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c +index 449b4bb..257e2e8 100644 +--- a/drivers/pci/hotplug/cpcihp_zt5550.c ++++ b/drivers/pci/hotplug/cpcihp_zt5550.c +@@ -59,7 +59,6 @@ + /* local variables */ + static bool debug; + static bool poll; +-static struct cpci_hp_controller_ops zt5550_hpc_ops; + static struct cpci_hp_controller zt5550_hpc; + + /* Primary cPCI bus bridge device */ +@@ -205,6 +204,10 @@ static int zt5550_hc_disable_irq(void) + return 0; + } + ++static struct cpci_hp_controller_ops zt5550_hpc_ops = { ++ .query_enum = zt5550_hc_query_enum, ++}; ++ + static int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) + { + int status; +@@ -216,16 +219,17 @@ static int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id + dbg("returned from zt5550_hc_config"); - struct cpci_hp_controller { - unsigned int irq; + memset(&zt5550_hpc, 0, sizeof (struct cpci_hp_controller)); +- zt5550_hpc_ops.query_enum = zt5550_hc_query_enum; + zt5550_hpc.ops = &zt5550_hpc_ops; + if(!poll) { + zt5550_hpc.irq = hc_dev->irq; + zt5550_hpc.irq_flags = IRQF_SHARED; + zt5550_hpc.dev_id = hc_dev; + +- zt5550_hpc_ops.enable_irq = zt5550_hc_enable_irq; +- zt5550_hpc_ops.disable_irq = zt5550_hc_disable_irq; +- zt5550_hpc_ops.check_irq = zt5550_hc_check_irq; ++ pax_open_kernel(); ++ *(void **)&zt5550_hpc_ops.enable_irq = zt5550_hc_enable_irq; ++ *(void **)&zt5550_hpc_ops.disable_irq = zt5550_hc_disable_irq; ++ *(void **)&zt5550_hpc_ops.check_irq = zt5550_hc_check_irq; ++ pax_open_kernel(); + } else { + info("using ENUM# polling mode"); + } diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c index 76ba8a1..20ca857 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.c @@ -35996,8 +40682,82 @@ index 76ba8a1..20ca857 100644 dbg("int15 entry = %p\n", compaq_int15_entry_point); /* initialize our int15 lock */ +diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c +index 202f4a9..8ee47d0 100644 +--- a/drivers/pci/hotplug/pci_hotplug_core.c ++++ b/drivers/pci/hotplug/pci_hotplug_core.c +@@ -448,8 +448,10 @@ int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, + return -EINVAL; + } + +- slot->ops->owner = owner; +- slot->ops->mod_name = mod_name; ++ pax_open_kernel(); ++ *(struct module **)&slot->ops->owner = owner; ++ *(const char **)&slot->ops->mod_name = mod_name; ++ pax_close_kernel(); + + mutex_lock(&pci_hp_mutex); + /* +diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c +index 7d72c5e..edce02c 100644 +--- a/drivers/pci/hotplug/pciehp_core.c ++++ b/drivers/pci/hotplug/pciehp_core.c +@@ -91,7 +91,7 @@ static int init_slot(struct controller *ctrl) + struct slot *slot = ctrl->slot; + struct hotplug_slot *hotplug = NULL; + struct hotplug_slot_info *info = NULL; +- struct hotplug_slot_ops *ops = NULL; ++ hotplug_slot_ops_no_const *ops = NULL; + char name[SLOT_NAME_SIZE]; + int retval = -ENOMEM; + +diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c +index 9c6e9bb..2916736 100644 +--- a/drivers/pci/pci-sysfs.c ++++ b/drivers/pci/pci-sysfs.c +@@ -1071,7 +1071,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine) + { + /* allocate attribute structure, piggyback attribute name */ + int name_len = write_combine ? 13 : 10; +- struct bin_attribute *res_attr; ++ bin_attribute_no_const *res_attr; + int retval; + + res_attr = kzalloc(sizeof(*res_attr) + name_len, GFP_ATOMIC); +@@ -1256,7 +1256,7 @@ static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_stor + static int pci_create_capabilities_sysfs(struct pci_dev *dev) + { + int retval; +- struct bin_attribute *attr; ++ bin_attribute_no_const *attr; + + /* If the device has VPD, try to expose it in sysfs. */ + if (dev->vpd) { +@@ -1303,7 +1303,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev) + { + int retval; + int rom_size = 0; +- struct bin_attribute *attr; ++ bin_attribute_no_const *attr; + + if (!sysfs_initialized) + return -EACCES; +diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h +index 7346ee6..41520eb 100644 +--- a/drivers/pci/pci.h ++++ b/drivers/pci/pci.h +@@ -93,7 +93,7 @@ struct pci_vpd_ops { + struct pci_vpd { + unsigned int len; + const struct pci_vpd_ops *ops; +- struct bin_attribute *attr; /* descriptor for sysfs VPD entry */ ++ bin_attribute_no_const *attr; /* descriptor for sysfs VPD entry */ + }; + + extern int pci_vpd_pci22_init(struct pci_dev *dev); diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c -index b500840..d7159d3 100644 +index d320df6..ca9a8f6 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -27,9 +27,9 @@ @@ -36014,23 +40774,23 @@ index b500840..d7159d3 100644 #define ASPM_STATE_ALL (ASPM_STATE_L0S | ASPM_STATE_L1) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c -index 5e1ca3c..08082fe 100644 +index 5427787..8df273b 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c -@@ -215,7 +215,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, - u16 orig_cmd; +@@ -173,7 +173,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, struct pci_bus_region region; + bool bar_too_big = false, bar_disabled = false; - mask = type ? PCI_ROM_ADDRESS_MASK : ~0; + mask = type ? (u32)PCI_ROM_ADDRESS_MASK : ~0; + /* No printks while decoding is disabled! */ if (!dev->mmio_always_on) { - pci_read_config_word(dev, PCI_COMMAND, &orig_cmd); diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c -index 27911b5..5b6db88 100644 +index 0b00947..64f7c0a 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c -@@ -476,7 +476,16 @@ static const struct file_operations proc_bus_pci_dev_operations = { +@@ -465,7 +465,16 @@ static const struct file_operations proc_bus_pci_dev_operations = { static int __init pci_proc_init(void) { struct pci_dev *dev = NULL; @@ -36047,11 +40807,62 @@ index 27911b5..5b6db88 100644 proc_create("devices", 0, proc_bus_pci_dir, &proc_bus_pci_dev_operations); proc_initialized = 1; +diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c +index 3e5b4497..dcdfb70 100644 +--- a/drivers/platform/x86/chromeos_laptop.c ++++ b/drivers/platform/x86/chromeos_laptop.c +@@ -301,7 +301,7 @@ static int __init setup_tsl2563_als(const struct dmi_system_id *id) + return 0; + } + +-static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = { ++static struct dmi_system_id __initconst chromeos_laptop_dmi_table[] = { + { + .ident = "Samsung Series 5 550 - Touchpad", + .matches = { +diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c +index 6b22938..bc9700e 100644 +--- a/drivers/platform/x86/msi-laptop.c ++++ b/drivers/platform/x86/msi-laptop.c +@@ -1000,12 +1000,14 @@ static int __init load_scm_model_init(struct platform_device *sdev) + + if (!quirks->ec_read_only) { + /* allow userland write sysfs file */ +- dev_attr_bluetooth.store = store_bluetooth; +- dev_attr_wlan.store = store_wlan; +- dev_attr_threeg.store = store_threeg; +- dev_attr_bluetooth.attr.mode |= S_IWUSR; +- dev_attr_wlan.attr.mode |= S_IWUSR; +- dev_attr_threeg.attr.mode |= S_IWUSR; ++ pax_open_kernel(); ++ *(void **)&dev_attr_bluetooth.store = store_bluetooth; ++ *(void **)&dev_attr_wlan.store = store_wlan; ++ *(void **)&dev_attr_threeg.store = store_threeg; ++ *(umode_t *)&dev_attr_bluetooth.attr.mode |= S_IWUSR; ++ *(umode_t *)&dev_attr_wlan.attr.mode |= S_IWUSR; ++ *(umode_t *)&dev_attr_threeg.attr.mode |= S_IWUSR; ++ pax_close_kernel(); + } + + /* disable hardware control by fn key */ +diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c +index 14d4dce..b129917 100644 +--- a/drivers/platform/x86/sony-laptop.c ++++ b/drivers/platform/x86/sony-laptop.c +@@ -2465,7 +2465,7 @@ static void sony_nc_gfx_switch_cleanup(struct platform_device *pd) + } + + /* High speed charging function */ +-static struct device_attribute *hsc_handle; ++static device_attribute_no_const *hsc_handle; + + static ssize_t sony_nc_highspeed_charging_store(struct device *dev, + struct device_attribute *attr, diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c -index d68c000..f6094ca 100644 +index edec135..59a24a3 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c -@@ -2094,7 +2094,7 @@ static int hotkey_mask_get(void) +@@ -2093,7 +2093,7 @@ static int hotkey_mask_get(void) return 0; } @@ -36060,7 +40871,7 @@ index d68c000..f6094ca 100644 { /* log only what the user can fix... */ const u32 wantedmask = hotkey_driver_mask & -@@ -2325,11 +2325,6 @@ static void hotkey_read_nvram(struct tp_nvram_state *n, const u32 m) +@@ -2324,11 +2324,6 @@ static void hotkey_read_nvram(struct tp_nvram_state *n, const u32 m) } } @@ -36072,7 +40883,7 @@ index d68c000..f6094ca 100644 #define TPACPI_COMPARE_KEY(__scancode, __member) \ do { \ if ((event_mask & (1 << __scancode)) && \ -@@ -2343,36 +2338,42 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2342,36 +2337,42 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, tpacpi_hotkey_send_key(__scancode); \ } while (0) @@ -36139,7 +40950,7 @@ index d68c000..f6094ca 100644 TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_THINKPAD, thinkpad_toggle); TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNSPACE, zoom_toggle); TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNF7, display_toggle); -@@ -2406,7 +2407,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2405,7 +2406,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, oldn->volume_level != newn->volume_level) { /* recently muted, or repeated mute keypress, or * multiple presses ending in mute */ @@ -36148,7 +40959,7 @@ index d68c000..f6094ca 100644 TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_MUTE); } } else { -@@ -2416,7 +2417,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2415,7 +2416,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP); } if (oldn->volume_level != newn->volume_level) { @@ -36157,7 +40968,7 @@ index d68c000..f6094ca 100644 } else if (oldn->volume_toggle != newn->volume_toggle) { /* repeated vol up/down keypress at end of scale ? */ if (newn->volume_level == 0) -@@ -2429,7 +2430,8 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2428,7 +2429,8 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, /* handle brightness */ if (oldn->brightness_level != newn->brightness_level) { issue_brightnesschange(oldn->brightness_level, @@ -36167,7 +40978,7 @@ index d68c000..f6094ca 100644 } else if (oldn->brightness_toggle != newn->brightness_toggle) { /* repeated key presses that didn't change state */ if (newn->brightness_level == 0) -@@ -2438,10 +2440,10 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, +@@ -2437,10 +2439,10 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn, && !tp_features.bright_unkfw) TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME); } @@ -36240,7 +41051,7 @@ index 769d265..a3a05ca 100644 + pax_close_kernel(); } diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c -index b0ecacb..7c9da2e 100644 +index 3e6db1c..1fbbdae 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -360,7 +360,7 @@ int pnp_check_irq(struct pnp_dev *dev, struct resource *res) @@ -36261,24 +41072,104 @@ index b0ecacb..7c9da2e 100644 return 0; /* check if the resource is reserved */ -diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c -index 222ccd8..6275fa5 100644 ---- a/drivers/power/bq27x00_battery.c -+++ b/drivers/power/bq27x00_battery.c -@@ -72,7 +72,7 @@ - struct bq27x00_device_info; - struct bq27x00_access_methods { - int (*read)(struct bq27x00_device_info *di, u8 reg, bool single); --}; -+} __no_const; +diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c +index 7df7c5f..bd48c47 100644 +--- a/drivers/power/pda_power.c ++++ b/drivers/power/pda_power.c +@@ -37,7 +37,11 @@ static int polling; + + #ifdef CONFIG_USB_OTG_UTILS + static struct usb_phy *transceiver; +-static struct notifier_block otg_nb; ++static int otg_handle_notification(struct notifier_block *nb, ++ unsigned long event, void *unused); ++static struct notifier_block otg_nb = { ++ .notifier_call = otg_handle_notification ++}; + #endif + + static struct regulator *ac_draw; +@@ -369,7 +373,6 @@ static int pda_power_probe(struct platform_device *pdev) - enum bq27x00_chip { BQ27000, BQ27500 }; + #ifdef CONFIG_USB_OTG_UTILS + if (!IS_ERR_OR_NULL(transceiver) && pdata->use_otg_notifier) { +- otg_nb.notifier_call = otg_handle_notification; + ret = usb_register_notifier(transceiver, &otg_nb); + if (ret) { + dev_err(dev, "failure to register otg notifier\n"); +diff --git a/drivers/power/power_supply.h b/drivers/power/power_supply.h +index cc439fd..8fa30df 100644 +--- a/drivers/power/power_supply.h ++++ b/drivers/power/power_supply.h +@@ -16,12 +16,12 @@ struct power_supply; + + #ifdef CONFIG_SYSFS + +-extern void power_supply_init_attrs(struct device_type *dev_type); ++extern void power_supply_init_attrs(void); + extern int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env); + + #else + +-static inline void power_supply_init_attrs(struct device_type *dev_type) {} ++static inline void power_supply_init_attrs(void) {} + #define power_supply_uevent NULL + + #endif /* CONFIG_SYSFS */ +diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c +index 5deac43..608c5ff 100644 +--- a/drivers/power/power_supply_core.c ++++ b/drivers/power/power_supply_core.c +@@ -24,7 +24,10 @@ + struct class *power_supply_class; + EXPORT_SYMBOL_GPL(power_supply_class); + +-static struct device_type power_supply_dev_type; ++extern const struct attribute_group *power_supply_attr_groups[]; ++static struct device_type power_supply_dev_type = { ++ .groups = power_supply_attr_groups, ++}; + + static int __power_supply_changed_work(struct device *dev, void *data) + { +@@ -393,7 +396,7 @@ static int __init power_supply_class_init(void) + return PTR_ERR(power_supply_class); + + power_supply_class->dev_uevent = power_supply_uevent; +- power_supply_init_attrs(&power_supply_dev_type); ++ power_supply_init_attrs(); + return 0; + } +diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c +index 29178f7..c65f324 100644 +--- a/drivers/power/power_supply_sysfs.c ++++ b/drivers/power/power_supply_sysfs.c +@@ -230,17 +230,15 @@ static struct attribute_group power_supply_attr_group = { + .is_visible = power_supply_attr_is_visible, + }; + +-static const struct attribute_group *power_supply_attr_groups[] = { ++const struct attribute_group *power_supply_attr_groups[] = { + &power_supply_attr_group, + NULL, + }; + +-void power_supply_init_attrs(struct device_type *dev_type) ++void power_supply_init_attrs(void) + { + int i; + +- dev_type->groups = power_supply_attr_groups; +- + for (i = 0; i < ARRAY_SIZE(power_supply_attrs); i++) + __power_supply_attrs[i] = &power_supply_attrs[i].attr; + } diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c -index 4c5b053..104263e 100644 +index 4d7c635..9860196 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c -@@ -385,8 +385,10 @@ static int __devinit max8660_probe(struct i2c_client *client, +@@ -333,8 +333,10 @@ static int max8660_probe(struct i2c_client *client, max8660->shadow_regs[MAX8660_OVER1] = 5; } else { /* Otherwise devices can be toggled via software */ @@ -36291,11 +41182,30 @@ index 4c5b053..104263e 100644 } /* +diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c +index 9a8ea91..c483dd9 100644 +--- a/drivers/regulator/max8973-regulator.c ++++ b/drivers/regulator/max8973-regulator.c +@@ -401,9 +401,11 @@ static int max8973_probe(struct i2c_client *client, + if (!pdata->enable_ext_control) { + max->desc.enable_reg = MAX8973_VOUT; + max->desc.enable_mask = MAX8973_VOUT_ENABLE; +- max8973_dcdc_ops.enable = regulator_enable_regmap; +- max8973_dcdc_ops.disable = regulator_disable_regmap; +- max8973_dcdc_ops.is_enabled = regulator_is_enabled_regmap; ++ pax_open_kernel(); ++ *(void **)&max8973_dcdc_ops.enable = regulator_enable_regmap; ++ *(void **)&max8973_dcdc_ops.disable = regulator_disable_regmap; ++ *(void **)&max8973_dcdc_ops.is_enabled = regulator_is_enabled_regmap; ++ pax_close_kernel(); + } + + max->enable_external_control = pdata->enable_ext_control; diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c -index 845aa22..99ec402 100644 +index 9891aec..beb3083 100644 --- a/drivers/regulator/mc13892-regulator.c +++ b/drivers/regulator/mc13892-regulator.c -@@ -574,10 +574,12 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) +@@ -583,10 +583,12 @@ static int mc13892_regulator_probe(struct platform_device *pdev) } mc13xxx_unlock(mc13892); @@ -36309,12 +41219,27 @@ index 845aa22..99ec402 100644 + pax_close_kernel(); mc13xxx_data = mc13xxx_parse_regulators_dt(pdev, mc13892_regulators, - ARRAY_SIZE(mc13892_regulators)); + ARRAY_SIZE(mc13892_regulators), +diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c +index cc5bea9..689f7d9 100644 +--- a/drivers/rtc/rtc-cmos.c ++++ b/drivers/rtc/rtc-cmos.c +@@ -724,7 +724,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) + hpet_rtc_timer_init(); + + /* export at least the first block of NVRAM */ +- nvram.size = address_space - NVRAM_OFFSET; ++ pax_open_kernel(); ++ *(size_t *)&nvram.size = address_space - NVRAM_OFFSET; ++ pax_close_kernel(); + retval = sysfs_create_bin_file(&dev->kobj, &nvram); + if (retval < 0) { + dev_dbg(dev, "can't create nvram file? %d\n", retval); diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c -index cace6d3..f623fda 100644 +index d049393..bb20be0 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c -@@ -14,6 +14,7 @@ +@@ -16,6 +16,7 @@ #include <linux/module.h> #include <linux/rtc.h> #include <linux/sched.h> @@ -36322,7 +41247,7 @@ index cace6d3..f623fda 100644 #include "rtc-core.h" static dev_t rtc_devt; -@@ -345,6 +346,8 @@ static long rtc_dev_ioctl(struct file *file, +@@ -347,6 +348,8 @@ static long rtc_dev_ioctl(struct file *file, if (copy_from_user(&tm, uarg, sizeof(tm))) return -EFAULT; @@ -36331,103 +41256,49 @@ index cace6d3..f623fda 100644 return rtc_set_time(rtc, &tm); case RTC_PIE_ON: -diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h -index 3fcf627..f334910 100644 ---- a/drivers/scsi/aacraid/aacraid.h -+++ b/drivers/scsi/aacraid/aacraid.h -@@ -492,7 +492,7 @@ struct adapter_ops - int (*adapter_scsi)(struct fib * fib, struct scsi_cmnd * cmd); - /* Administrative operations */ - int (*adapter_comm)(struct aac_dev * dev, int comm); --}; -+} __no_const; +diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c +index 970a236..3613169 100644 +--- a/drivers/rtc/rtc-ds1307.c ++++ b/drivers/rtc/rtc-ds1307.c +@@ -106,7 +106,7 @@ struct ds1307 { + u8 offset; /* register's offset */ + u8 regs[11]; + u16 nvram_offset; +- struct bin_attribute *nvram; ++ bin_attribute_no_const *nvram; + enum ds_type type; + unsigned long flags; + #define HAS_NVRAM 0 /* bit 0 == sysfs file active */ +diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c +index 130f29a..6179d03 100644 +--- a/drivers/rtc/rtc-m48t59.c ++++ b/drivers/rtc/rtc-m48t59.c +@@ -482,7 +482,9 @@ static int m48t59_rtc_probe(struct platform_device *pdev) + goto out; + } - /* - * Define which interrupt handler needs to be installed -diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c -index 0d279c44..3d25a97 100644 ---- a/drivers/scsi/aacraid/linit.c -+++ b/drivers/scsi/aacraid/linit.c -@@ -93,7 +93,7 @@ static DECLARE_PCI_DEVICE_TABLE(aac_pci_tbl) = { - #elif defined(__devinitconst) - static const struct pci_device_id aac_pci_tbl[] __devinitconst = { - #else --static const struct pci_device_id aac_pci_tbl[] __devinitdata = { -+static const struct pci_device_id aac_pci_tbl[] __devinitconst = { - #endif - { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */ - { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */ -diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c -index ff80552..1c4120c 100644 ---- a/drivers/scsi/aic94xx/aic94xx_init.c -+++ b/drivers/scsi/aic94xx/aic94xx_init.c -@@ -1012,7 +1012,7 @@ static struct sas_domain_function_template aic94xx_transport_functions = { - .lldd_ata_set_dmamode = asd_set_dmamode, - }; +- m48t59_nvram_attr.size = pdata->offset; ++ pax_open_kernel(); ++ *(size_t *)&m48t59_nvram_attr.size = pdata->offset; ++ pax_close_kernel(); --static const struct pci_device_id aic94xx_pci_table[] __devinitdata = { -+static const struct pci_device_id aic94xx_pci_table[] __devinitconst = { - {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x410),0, 0, 1}, - {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x412),0, 0, 1}, - {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x416),0, 0, 1}, -diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h -index 4ad7e36..d004679 100644 ---- a/drivers/scsi/bfa/bfa.h -+++ b/drivers/scsi/bfa/bfa.h -@@ -196,7 +196,7 @@ struct bfa_hwif_s { - u32 *end); - int cpe_vec_q0; - int rme_vec_q0; --}; -+} __no_const; - typedef void (*bfa_cb_iocfc_t) (void *cbarg, enum bfa_status status); - - struct bfa_faa_cbfn_s { -diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c -index f0f80e2..8ec946b 100644 ---- a/drivers/scsi/bfa/bfa_fcpim.c -+++ b/drivers/scsi/bfa/bfa_fcpim.c -@@ -3715,7 +3715,7 @@ bfa_fcp_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, - - bfa_iotag_attach(fcp); - -- fcp->itn_arr = (struct bfa_itn_s *) bfa_mem_kva_curp(fcp); -+ fcp->itn_arr = (bfa_itn_s_no_const *) bfa_mem_kva_curp(fcp); - bfa_mem_kva_curp(fcp) = (u8 *)fcp->itn_arr + - (fcp->num_itns * sizeof(struct bfa_itn_s)); - memset(fcp->itn_arr, 0, -@@ -3773,7 +3773,7 @@ bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport, - void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m)) - { - struct bfa_fcp_mod_s *fcp = BFA_FCP_MOD(bfa); -- struct bfa_itn_s *itn; -+ bfa_itn_s_no_const *itn; - - itn = BFA_ITN_FROM_TAG(fcp, rport->rport_tag); - itn->isr = isr; + ret = sysfs_create_bin_file(&pdev->dev.kobj, &m48t59_nvram_attr); + if (ret) { diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h -index 36f26da..38a34a8 100644 +index e693af6..2e525b6 100644 --- a/drivers/scsi/bfa/bfa_fcpim.h +++ b/drivers/scsi/bfa/bfa_fcpim.h -@@ -37,6 +37,7 @@ struct bfa_iotag_s { +@@ -36,7 +36,7 @@ struct bfa_iotag_s { + struct bfa_itn_s { bfa_isr_func_t isr; - }; -+typedef struct bfa_itn_s __no_const bfa_itn_s_no_const; +-}; ++} __no_const; void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport, void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m)); -@@ -147,7 +148,7 @@ struct bfa_fcp_mod_s { - struct list_head iotag_tio_free_q; /* free IO resources */ - struct list_head iotag_unused_q; /* unused IO resources*/ - struct bfa_iotag_s *iotag_arr; -- struct bfa_itn_s *itn_arr; -+ bfa_itn_s_no_const *itn_arr; - int num_ioim_reqs; - int num_fwtio_reqs; - int num_itns; diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h -index 1a99d4b..e85d64b 100644 +index 23a90e7..9cf04ee 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h @@ -258,7 +258,7 @@ struct bfa_ioc_cbfn_s { @@ -36449,15 +41320,15 @@ index 1a99d4b..e85d64b 100644 /* * Queue element to wait for room in request queue. FIFO order is diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c -index b48c24f..dac0fbc 100644 +index df0c3c7..b00e1d0 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -42,7 +42,7 @@ #include "scsi_logging.h" --static atomic_t scsi_host_next_hn; /* host_no for next new host */ -+static atomic_unchecked_t scsi_host_next_hn; /* host_no for next new host */ +-static atomic_t scsi_host_next_hn = ATOMIC_INIT(0); /* host_no for next new host */ ++static atomic_unchecked_t scsi_host_next_hn = ATOMIC_INIT(0); /* host_no for next new host */ static void scsi_host_cls_release(struct device *dev) @@ -36471,19 +41342,19 @@ index b48c24f..dac0fbc 100644 /* These three are default values which can be overridden */ diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c -index 500e20d..ebd3059 100644 +index 7f4f790..b75b92a 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c -@@ -521,7 +521,7 @@ static inline u32 next_command(struct ctlr_info *h) - u32 a; +@@ -554,7 +554,7 @@ static inline u32 next_command(struct ctlr_info *h, u8 q) + unsigned long flags; if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant))) -- return h->access.command_completed(h); -+ return h->access->command_completed(h); +- return h->access.command_completed(h, q); ++ return h->access->command_completed(h, q); - if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) { - a = *(h->reply_pool_head); /* Next cmd in ring buffer */ -@@ -3002,7 +3002,7 @@ static void start_io(struct ctlr_info *h) + if ((rq->head[rq->current_entry] & 1) == rq->wraparound) { + a = rq->head[rq->current_entry]; +@@ -3422,7 +3422,7 @@ static void start_io(struct ctlr_info *h) while (!list_empty(&h->reqQ)) { c = list_entry(h->reqQ.next, struct CommandList, list); /* can't do anything if fifo is full */ @@ -36492,21 +41363,21 @@ index 500e20d..ebd3059 100644 dev_warn(&h->pdev->dev, "fifo full\n"); break; } -@@ -3012,7 +3012,7 @@ static void start_io(struct ctlr_info *h) - h->Qdepth--; +@@ -3444,7 +3444,7 @@ static void start_io(struct ctlr_info *h) /* Tell the controller execute command */ + spin_unlock_irqrestore(&h->lock, flags); - h->access.submit_command(h, c); + h->access->submit_command(h, c); + spin_lock_irqsave(&h->lock, flags); + } + spin_unlock_irqrestore(&h->lock, flags); +@@ -3452,17 +3452,17 @@ static void start_io(struct ctlr_info *h) - /* Put job onto the completed Q */ - addQ(&h->cmpQ, c); -@@ -3021,17 +3021,17 @@ static void start_io(struct ctlr_info *h) - - static inline unsigned long get_next_completion(struct ctlr_info *h) + static inline unsigned long get_next_completion(struct ctlr_info *h, u8 q) { -- return h->access.command_completed(h); -+ return h->access->command_completed(h); +- return h->access.command_completed(h, q); ++ return h->access->command_completed(h, q); } static inline bool interrupt_pending(struct ctlr_info *h) @@ -36522,16 +41393,16 @@ index 500e20d..ebd3059 100644 (h->interrupts_enabled == 0); } -@@ -3930,7 +3930,7 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h) +@@ -4364,7 +4364,7 @@ static int hpsa_pci_init(struct ctlr_info *h) if (prod_index < 0) return -ENODEV; h->product_name = products[prod_index].product_name; - h->access = *(products[prod_index].access); + h->access = products[prod_index].access; - if (hpsa_board_disabled(h->pdev)) { - dev_warn(&h->pdev->dev, "controller appears to be disabled\n"); -@@ -4175,7 +4175,7 @@ static void controller_lockup_detected(struct ctlr_info *h) + pci_disable_link_state(h->pdev, PCIE_LINK_STATE_L0S | + PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM); +@@ -4646,7 +4646,7 @@ static void controller_lockup_detected(struct ctlr_info *h) assert_spin_locked(&lockup_detector_lock); remove_ctlr_from_lockup_detector_list(h); @@ -36540,7 +41411,7 @@ index 500e20d..ebd3059 100644 spin_lock_irqsave(&h->lock, flags); h->lockup_detected = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET); spin_unlock_irqrestore(&h->lock, flags); -@@ -4355,7 +4355,7 @@ reinit_after_soft_reset: +@@ -4823,7 +4823,7 @@ reinit_after_soft_reset: } /* make sure the board interrupts are off */ @@ -36549,16 +41420,16 @@ index 500e20d..ebd3059 100644 if (hpsa_request_irq(h, do_hpsa_intr_msi, do_hpsa_intr_intx)) goto clean2; -@@ -4389,7 +4389,7 @@ reinit_after_soft_reset: +@@ -4857,7 +4857,7 @@ reinit_after_soft_reset: * fake ones to scoop up any residual completions. */ spin_lock_irqsave(&h->lock, flags); - h->access.set_intr_mask(h, HPSA_INTR_OFF); + h->access->set_intr_mask(h, HPSA_INTR_OFF); spin_unlock_irqrestore(&h->lock, flags); - free_irq(h->intr[h->intr_mode], h); + free_irqs(h); rc = hpsa_request_irq(h, hpsa_msix_discard_completions, -@@ -4408,9 +4408,9 @@ reinit_after_soft_reset: +@@ -4876,9 +4876,9 @@ reinit_after_soft_reset: dev_info(&h->pdev->dev, "Board READY.\n"); dev_info(&h->pdev->dev, "Waiting for stale completions to drain.\n"); @@ -36570,7 +41441,7 @@ index 500e20d..ebd3059 100644 rc = controller_reset_failed(h->cfgtable); if (rc) -@@ -4431,7 +4431,7 @@ reinit_after_soft_reset: +@@ -4899,7 +4899,7 @@ reinit_after_soft_reset: } /* Turn the interrupts on so we can service requests */ @@ -36579,16 +41450,16 @@ index 500e20d..ebd3059 100644 hpsa_hba_inquiry(h); hpsa_register_scsi(h); /* hook ourselves into SCSI subsystem */ -@@ -4483,7 +4483,7 @@ static void hpsa_shutdown(struct pci_dev *pdev) +@@ -4954,7 +4954,7 @@ static void hpsa_shutdown(struct pci_dev *pdev) * To write all data in the battery backed cache to disks */ hpsa_flush_cache(h); - h->access.set_intr_mask(h, HPSA_INTR_OFF); + h->access->set_intr_mask(h, HPSA_INTR_OFF); - free_irq(h->intr[h->intr_mode], h); - #ifdef CONFIG_PCI_MSI - if (h->msix_vector) -@@ -4657,7 +4657,7 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h, + hpsa_free_irqs_and_disable_msix(h); + } + +@@ -5122,7 +5122,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 use_short_tags) return; } /* Change the access methods to the performant access methods */ @@ -36598,10 +41469,10 @@ index 500e20d..ebd3059 100644 } diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h -index 7b28d54..952f23a 100644 +index 9816479..c5d4e97 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h -@@ -72,7 +72,7 @@ struct ctlr_info { +@@ -79,7 +79,7 @@ struct ctlr_info { unsigned int msix_vector; unsigned int msi_vector; int intr_mode; /* either PERF_MODE_INT or SIMPLE_MODE_INT */ @@ -36610,26 +41481,13 @@ index 7b28d54..952f23a 100644 /* queue and queue Info */ struct list_head reqQ; -diff --git a/drivers/scsi/ips.h b/drivers/scsi/ips.h -index f2df059..a3a9930 100644 ---- a/drivers/scsi/ips.h -+++ b/drivers/scsi/ips.h -@@ -1027,7 +1027,7 @@ typedef struct { - int (*intr)(struct ips_ha *); - void (*enableint)(struct ips_ha *); - uint32_t (*statupd)(struct ips_ha *); --} ips_hw_func_t; -+} __no_const ips_hw_func_t; - - typedef struct ips_ha { - uint8_t ha_id[IPS_MAX_CHANNELS+1]; diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c -index aceffad..c35c08d 100644 +index c772d8d..35c362c 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c -@@ -105,12 +105,12 @@ struct fc_exch_mgr { - * all together if not used XXX - */ +@@ -100,12 +100,12 @@ struct fc_exch_mgr { + u16 pool_max_index; + struct { - atomic_t no_free_exch; - atomic_t no_free_exch_xid; @@ -36646,7 +41504,7 @@ index aceffad..c35c08d 100644 } stats; }; -@@ -719,7 +719,7 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, +@@ -725,7 +725,7 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, /* allocate memory for exchange */ ep = mempool_alloc(mp->ep_pool, GFP_ATOMIC); if (!ep) { @@ -36655,7 +41513,7 @@ index aceffad..c35c08d 100644 goto out; } memset(ep, 0, sizeof(*ep)); -@@ -780,7 +780,7 @@ out: +@@ -786,7 +786,7 @@ out: return ep; err: spin_unlock_bh(&pool->lock); @@ -36664,7 +41522,7 @@ index aceffad..c35c08d 100644 mempool_free(ep, mp->ep_pool); return NULL; } -@@ -923,7 +923,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, +@@ -929,7 +929,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, xid = ntohs(fh->fh_ox_id); /* we originated exch */ ep = fc_exch_find(mp, xid); if (!ep) { @@ -36673,7 +41531,7 @@ index aceffad..c35c08d 100644 reject = FC_RJT_OX_ID; goto out; } -@@ -953,7 +953,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, +@@ -959,7 +959,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, ep = fc_exch_find(mp, xid); if ((f_ctl & FC_FC_FIRST_SEQ) && fc_sof_is_init(fr_sof(fp))) { if (ep) { @@ -36682,7 +41540,7 @@ index aceffad..c35c08d 100644 reject = FC_RJT_RX_ID; goto rel; } -@@ -964,7 +964,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, +@@ -970,7 +970,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, } xid = ep->xid; /* get our XID */ } else if (!ep) { @@ -36691,7 +41549,7 @@ index aceffad..c35c08d 100644 reject = FC_RJT_RX_ID; /* XID not found */ goto out; } -@@ -981,7 +981,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, +@@ -987,7 +987,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, } else { sp = &ep->seq; if (sp->id != fh->fh_seq_id) { @@ -36700,7 +41558,7 @@ index aceffad..c35c08d 100644 if (f_ctl & FC_FC_END_SEQ) { /* * Update sequence_id based on incoming last -@@ -1431,22 +1431,22 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) +@@ -1437,22 +1437,22 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) ep = fc_exch_find(mp, ntohs(fh->fh_ox_id)); if (!ep) { @@ -36727,7 +41585,7 @@ index aceffad..c35c08d 100644 goto rel; } sof = fr_sof(fp); -@@ -1455,7 +1455,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) +@@ -1461,7 +1461,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) sp->ssb_stat |= SSB_ST_RESP; sp->id = fh->fh_seq_id; } else if (sp->id != fh->fh_seq_id) { @@ -36736,7 +41594,7 @@ index aceffad..c35c08d 100644 goto rel; } -@@ -1519,9 +1519,9 @@ static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) +@@ -1525,9 +1525,9 @@ static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) sp = fc_seq_lookup_orig(mp, fp); /* doesn't hold sequence */ if (!sp) @@ -36748,11 +41606,31 @@ index aceffad..c35c08d 100644 fc_frame_free(fp); } +@@ -2174,13 +2174,13 @@ void fc_exch_update_stats(struct fc_lport *lport) + + list_for_each_entry(ema, &lport->ema_list, ema_list) { + mp = ema->mp; +- st->fc_no_free_exch += atomic_read(&mp->stats.no_free_exch); ++ st->fc_no_free_exch += atomic_read_unchecked(&mp->stats.no_free_exch); + st->fc_no_free_exch_xid += +- atomic_read(&mp->stats.no_free_exch_xid); +- st->fc_xid_not_found += atomic_read(&mp->stats.xid_not_found); +- st->fc_xid_busy += atomic_read(&mp->stats.xid_busy); +- st->fc_seq_not_found += atomic_read(&mp->stats.seq_not_found); +- st->fc_non_bls_resp += atomic_read(&mp->stats.non_bls_resp); ++ atomic_read_unchecked(&mp->stats.no_free_exch_xid); ++ st->fc_xid_not_found += atomic_read_unchecked(&mp->stats.xid_not_found); ++ st->fc_xid_busy += atomic_read_unchecked(&mp->stats.xid_busy); ++ st->fc_seq_not_found += atomic_read_unchecked(&mp->stats.seq_not_found); ++ st->fc_non_bls_resp += atomic_read_unchecked(&mp->stats.non_bls_resp); + } + } + EXPORT_SYMBOL(fc_exch_update_stats); diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c -index d109cc3..09f4e7d 100644 +index bdb81cd..d3c7c2c 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c -@@ -529,7 +529,7 @@ static struct ata_port_operations sas_sata_ops = { +@@ -554,7 +554,7 @@ static struct ata_port_operations sas_sata_ops = { .postreset = ata_std_postreset, .error_handler = ata_std_error_handler, .post_internal_cmd = sas_ata_post_internal, @@ -36761,24 +41639,11 @@ index d109cc3..09f4e7d 100644 .qc_prep = ata_noop_qc_prep, .qc_issue = sas_ata_qc_issue, .qc_fill_rtf = sas_ata_qc_fill_rtf, -diff --git a/drivers/scsi/lpfc/Makefile b/drivers/scsi/lpfc/Makefile -index fe5d396..e93d526 100644 ---- a/drivers/scsi/lpfc/Makefile -+++ b/drivers/scsi/lpfc/Makefile -@@ -22,7 +22,7 @@ - ccflags-$(GCOV) := -fprofile-arcs -ftest-coverage - ccflags-$(GCOV) += -O0 - --ccflags-y += -Werror -+#ccflags-y += -Werror - - obj-$(CONFIG_SCSI_LPFC) := lpfc.o - diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h -index 3a1ffdd..8eb7c71 100644 +index 7706c99..3b4fc0c 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h -@@ -413,7 +413,7 @@ struct lpfc_vport { +@@ -424,7 +424,7 @@ struct lpfc_vport { struct dentry *debug_nodelist; struct dentry *vport_debugfs_root; struct lpfc_debugfs_trc *disc_trc; @@ -36787,7 +41652,7 @@ index 3a1ffdd..8eb7c71 100644 #endif uint8_t stat_data_enabled; uint8_t stat_data_blocked; -@@ -826,8 +826,8 @@ struct lpfc_hba { +@@ -853,8 +853,8 @@ struct lpfc_hba { struct timer_list fabric_block_timer; unsigned long bit_flags; #define FABRIC_COMANDS_BLOCKED 0 @@ -36798,7 +41663,7 @@ index 3a1ffdd..8eb7c71 100644 unsigned long last_rsrc_error_time; unsigned long last_ramp_down_time; unsigned long last_ramp_up_time; -@@ -863,7 +863,7 @@ struct lpfc_hba { +@@ -890,7 +890,7 @@ struct lpfc_hba { struct dentry *debug_slow_ring_trc; struct lpfc_debugfs_trc *slow_ring_trc; @@ -36808,7 +41673,7 @@ index 3a1ffdd..8eb7c71 100644 struct dentry *idiag_root; struct dentry *idiag_pci_cfg; diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c -index af04b0d..8f1a97e 100644 +index f63f5ff..de29189 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -106,7 +106,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc, @@ -36838,7 +41703,7 @@ index af04b0d..8f1a97e 100644 (lpfc_debugfs_max_slow_ring_trc - 1); for (i = index; i < lpfc_debugfs_max_slow_ring_trc; i++) { dtp = phba->slow_ring_trc + i; -@@ -636,14 +636,14 @@ lpfc_debugfs_disc_trc(struct lpfc_vport *vport, int mask, char *fmt, +@@ -646,14 +646,14 @@ lpfc_debugfs_disc_trc(struct lpfc_vport *vport, int mask, char *fmt, !vport || !vport->disc_trc) return; @@ -36855,7 +41720,7 @@ index af04b0d..8f1a97e 100644 dtp->jif = jiffies; #endif return; -@@ -674,14 +674,14 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_hba *phba, char *fmt, +@@ -684,14 +684,14 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_hba *phba, char *fmt, !phba || !phba->slow_ring_trc) return; @@ -36872,7 +41737,7 @@ index af04b0d..8f1a97e 100644 dtp->jif = jiffies; #endif return; -@@ -4090,7 +4090,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) +@@ -4182,7 +4182,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) "slow_ring buffer\n"); goto debug_failed; } @@ -36881,7 +41746,7 @@ index af04b0d..8f1a97e 100644 memset(phba->slow_ring_trc, 0, (sizeof(struct lpfc_debugfs_trc) * lpfc_debugfs_max_slow_ring_trc)); -@@ -4136,7 +4136,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) +@@ -4228,7 +4228,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) "buffer\n"); goto debug_failed; } @@ -36891,10 +41756,10 @@ index af04b0d..8f1a97e 100644 snprintf(name, sizeof(name), "discovery_trace"); vport->debug_disc_trc = diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c -index 9598fdc..7e9f3d9 100644 +index 314b4f6..7005d10 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c -@@ -10266,8 +10266,10 @@ lpfc_init(void) +@@ -10551,8 +10551,10 @@ lpfc_init(void) "misc_register returned with status %d", error); if (lpfc_enable_npiv) { @@ -36908,10 +41773,10 @@ index 9598fdc..7e9f3d9 100644 lpfc_transport_template = fc_attach_transport(&lpfc_transport_functions); diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c -index 88f3a83..686d3fa 100644 +index 98af07c..7625fb5 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c -@@ -311,7 +311,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba) +@@ -325,7 +325,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba) uint32_t evt_posted; spin_lock_irqsave(&phba->hbalock, flags); @@ -36920,7 +41785,7 @@ index 88f3a83..686d3fa 100644 phba->last_rsrc_error_time = jiffies; if ((phba->last_ramp_down_time + QUEUE_RAMP_DOWN_INTERVAL) > jiffies) { -@@ -352,7 +352,7 @@ lpfc_rampup_queue_depth(struct lpfc_vport *vport, +@@ -366,7 +366,7 @@ lpfc_rampup_queue_depth(struct lpfc_vport *vport, unsigned long flags; struct lpfc_hba *phba = vport->phba; uint32_t evt_posted; @@ -36929,7 +41794,7 @@ index 88f3a83..686d3fa 100644 if (vport->cfg_lun_queue_depth <= queue_depth) return; -@@ -396,8 +396,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) +@@ -410,8 +410,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) unsigned long num_rsrc_err, num_cmd_success; int i; @@ -36938,9 +41803,9 @@ index 88f3a83..686d3fa 100644 + num_rsrc_err = atomic_read_unchecked(&phba->num_rsrc_err); + num_cmd_success = atomic_read_unchecked(&phba->num_cmd_success); - vports = lpfc_create_vport_work_array(phba); - if (vports != NULL) -@@ -417,8 +417,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) + /* + * The error and success command counters are global per +@@ -439,8 +439,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) } } lpfc_destroy_vport_work_array(phba, vports); @@ -36951,7 +41816,7 @@ index 88f3a83..686d3fa 100644 } /** -@@ -452,8 +452,8 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba) +@@ -474,8 +474,8 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba) } } lpfc_destroy_vport_work_array(phba, vports); @@ -36963,7 +41828,7 @@ index 88f3a83..686d3fa 100644 /** diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c -index ea8a0b4..812a124 100644 +index b46f5e9..c4c4ccb 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -200,8 +200,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev) @@ -37016,7 +41881,7 @@ index ea8a0b4..812a124 100644 return; fw_version = be16_to_cpu(pinstance->inq_data->fw_version); -@@ -5331,8 +5331,8 @@ static int __devinit pmcraid_init_instance( +@@ -5324,8 +5324,8 @@ static int pmcraid_init_instance(struct pci_dev *pdev, struct Scsi_Host *host, init_waitqueue_head(&pinstance->reset_wait_q); atomic_set(&pinstance->outstanding_cmds, 0); @@ -37027,7 +41892,7 @@ index ea8a0b4..812a124 100644 INIT_LIST_HEAD(&pinstance->free_res_q); INIT_LIST_HEAD(&pinstance->used_res_q); -@@ -6047,7 +6047,7 @@ static int __devinit pmcraid_probe( +@@ -6038,7 +6038,7 @@ static int pmcraid_probe(struct pci_dev *pdev, /* Schedule worker thread to handle CCN and take care of adding and * removing devices to OS */ @@ -37069,24 +41934,65 @@ index e1d150f..6c6df44 100644 /* To indicate add/delete/modify during CCN */ u8 change_detected; -diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h -index a244303..6015eb7 100644 ---- a/drivers/scsi/qla2xxx/qla_def.h -+++ b/drivers/scsi/qla2xxx/qla_def.h -@@ -2264,7 +2264,7 @@ struct isp_operations { - int (*start_scsi) (srb_t *); - int (*abort_isp) (struct scsi_qla_host *); - int (*iospace_config)(struct qla_hw_data*); --}; -+} __no_const; +diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c +index b3db9dc..c3b1756 100644 +--- a/drivers/scsi/qla2xxx/qla_attr.c ++++ b/drivers/scsi/qla2xxx/qla_attr.c +@@ -1971,7 +1971,7 @@ qla24xx_vport_disable(struct fc_vport *fc_vport, bool disable) + return 0; + } - /* MSI-X Support *************************************************************/ +-struct fc_function_template qla2xxx_transport_functions = { ++fc_function_template_no_const qla2xxx_transport_functions = { + .show_host_node_name = 1, + .show_host_port_name = 1, +@@ -2018,7 +2018,7 @@ struct fc_function_template qla2xxx_transport_functions = { + .bsg_timeout = qla24xx_bsg_timeout, + }; + +-struct fc_function_template qla2xxx_transport_vport_functions = { ++fc_function_template_no_const qla2xxx_transport_vport_functions = { + + .show_host_node_name = 1, + .show_host_port_name = 1, +diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h +index b310fa9..b9b3944 100644 +--- a/drivers/scsi/qla2xxx/qla_gbl.h ++++ b/drivers/scsi/qla2xxx/qla_gbl.h +@@ -523,8 +523,8 @@ extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *); + struct device_attribute; + extern struct device_attribute *qla2x00_host_attrs[]; + struct fc_function_template; +-extern struct fc_function_template qla2xxx_transport_functions; +-extern struct fc_function_template qla2xxx_transport_vport_functions; ++extern fc_function_template_no_const qla2xxx_transport_functions; ++extern fc_function_template_no_const qla2xxx_transport_vport_functions; + extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); + extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); + extern void qla2x00_init_host_attr(scsi_qla_host_t *); +diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c +index 2c6dd3d..e5ecd82 100644 +--- a/drivers/scsi/qla2xxx/qla_os.c ++++ b/drivers/scsi/qla2xxx/qla_os.c +@@ -1554,8 +1554,10 @@ qla2x00_config_dma_addressing(struct qla_hw_data *ha) + !pci_set_consistent_dma_mask(ha->pdev, DMA_BIT_MASK(64))) { + /* Ok, a 64bit DMA mask is applicable. */ + ha->flags.enable_64bit_addressing = 1; +- ha->isp_ops->calc_req_entries = qla2x00_calc_iocbs_64; +- ha->isp_ops->build_iocbs = qla2x00_build_scsi_iocbs_64; ++ pax_open_kernel(); ++ *(void **)&ha->isp_ops->calc_req_entries = qla2x00_calc_iocbs_64; ++ *(void **)&ha->isp_ops->build_iocbs = qla2x00_build_scsi_iocbs_64; ++ pax_close_kernel(); + return; + } + } diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h -index 7f2492e..5113877 100644 +index 129f5dd..ade53e8 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h -@@ -268,7 +268,7 @@ struct ddb_entry { +@@ -275,7 +275,7 @@ struct ddb_entry { * (4000 only) */ atomic_t relogin_timer; /* Max Time to wait for * relogin to complete */ @@ -37096,10 +42002,10 @@ index 7f2492e..5113877 100644 uint32_t default_time2wait; /* Default Min time between * relogins (+aens) */ diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c -index ee47820..a83b1f4 100644 +index 6142729..b6a85c9 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c -@@ -2551,12 +2551,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess) +@@ -2622,12 +2622,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess) */ if (!iscsi_is_session_online(cls_sess)) { /* Reset retry relogin timer */ @@ -37114,7 +42020,7 @@ index ee47820..a83b1f4 100644 ddb_entry->default_time2wait + 4)); set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags); atomic_set(&ddb_entry->retry_relogin_timer, -@@ -4453,7 +4453,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha, +@@ -4742,7 +4742,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha, atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY); atomic_set(&ddb_entry->relogin_timer, 0); @@ -37124,10 +42030,10 @@ index ee47820..a83b1f4 100644 ddb_entry->default_relogin_timeout = (def_timeout > LOGIN_TOV) && (def_timeout < LOGIN_TOV * 10) ? diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c -index 07322ec..91ccc23 100644 +index 2c0d0ec..4e8681a 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c -@@ -655,7 +655,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) +@@ -661,7 +661,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) unsigned long timeout; int rtn = 0; @@ -37137,10 +42043,10 @@ index 07322ec..91ccc23 100644 /* check if the device is still usable */ if (unlikely(cmd->device->sdev_state == SDEV_DEL)) { diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c -index 2bc0362..a858ebe 100644 +index c31187d..0ead8c3 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c -@@ -1425,7 +1425,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q) +@@ -1459,7 +1459,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q) shost = sdev->host; scsi_init_cmd_errh(cmd); cmd->result = DID_NO_CONNECT << 16; @@ -37149,7 +42055,7 @@ index 2bc0362..a858ebe 100644 /* * SCSI request completion path will do scsi_device_unbusy(), -@@ -1451,9 +1451,9 @@ static void scsi_softirq_done(struct request *rq) +@@ -1485,9 +1485,9 @@ static void scsi_softirq_done(struct request *rq) INIT_LIST_HEAD(&cmd->eh_entry); @@ -37162,10 +42068,10 @@ index 2bc0362..a858ebe 100644 disposition = scsi_decide_disposition(cmd); if (disposition != SUCCESS && diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c -index bb7c482..7551a95 100644 +index 931a7d9..0c2a754 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c -@@ -660,7 +660,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \ +@@ -658,7 +658,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \ char *buf) \ { \ struct scsi_device *sdev = to_scsi_device(dev); \ @@ -37188,7 +42094,7 @@ index 84a1fdf..693b0d6 100644 /* * TODO: need to fixup sg_tablesize, max_segment_size, diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c -index 80fbe2a..efa223b 100644 +index e894ca7..de9d7660 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -498,7 +498,7 @@ static DECLARE_TRANSPORT_CLASS(fc_vport_class, @@ -37228,7 +42134,7 @@ index 80fbe2a..efa223b 100644 /* * Check for overflow; dev_loss_tmo is u32 diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c -index 1cf640e..78e9014 100644 +index 0a74b97..fa8d648 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -79,7 +79,7 @@ struct iscsi_internal { @@ -37249,7 +42155,7 @@ index 1cf640e..78e9014 100644 if (target_id == ISCSI_MAX_TARGET) { id = ida_simple_get(&iscsi_sess_ida, 0, 0, GFP_KERNEL); -@@ -2940,7 +2940,7 @@ static __init int iscsi_transport_init(void) +@@ -2955,7 +2955,7 @@ static __init int iscsi_transport_init(void) printk(KERN_INFO "Loading iSCSI transport class v%s.\n", ISCSI_TRANSPORT_VERSION); @@ -37259,7 +42165,7 @@ index 1cf640e..78e9014 100644 err = class_register(&iscsi_transport_class); if (err) diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c -index 21a045e..ec89e03 100644 +index f379c7f..e8fc69c 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c @@ -33,7 +33,7 @@ @@ -37271,7 +42177,7 @@ index 21a045e..ec89e03 100644 }; #define to_srp_host_attrs(host) ((struct srp_host_attrs *)(host)->shost_data) -@@ -62,7 +62,7 @@ static int srp_host_setup(struct transport_container *tc, struct device *dev, +@@ -61,7 +61,7 @@ static int srp_host_setup(struct transport_container *tc, struct device *dev, struct Scsi_Host *shost = dev_to_shost(dev); struct srp_host_attrs *srp_host = to_srp_host_attrs(shost); @@ -37280,7 +42186,7 @@ index 21a045e..ec89e03 100644 return 0; } -@@ -211,7 +211,7 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost, +@@ -210,7 +210,7 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost, memcpy(rport->port_id, ids->port_id, sizeof(rport->port_id)); rport->roles = ids->roles; @@ -37289,11 +42195,24 @@ index 21a045e..ec89e03 100644 dev_set_name(&rport->dev, "port-%d:%d", shost->host_no, id); transport_setup_device(&rport->dev); +diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c +index 82910cc..7c350ad 100644 +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -2929,7 +2929,7 @@ static int sd_probe(struct device *dev) + sdkp->disk = gd; + sdkp->index = index; + atomic_set(&sdkp->openers, 0); +- atomic_set(&sdkp->device->ioerr_cnt, 0); ++ atomic_set_unchecked(&sdkp->device->ioerr_cnt, 0); + + if (!sdp->request_queue->rq_timeout) { + if (sdp->type != TYPE_MOD) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c -index eacd46b..e3f4d62 100644 +index 9f0c465..47194ee 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c -@@ -1077,7 +1077,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) +@@ -1101,7 +1101,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) sdp->disk->disk_name, MKDEV(SCSI_GENERIC_MAJOR, sdp->index), NULL, @@ -37302,29 +42221,11 @@ index eacd46b..e3f4d62 100644 case BLKTRACESTART: return blk_trace_startstop(sdp->device->request_queue, 1); case BLKTRACESTOP: -@@ -2312,7 +2312,7 @@ struct sg_proc_leaf { - const struct file_operations * fops; - }; - --static struct sg_proc_leaf sg_proc_leaf_arr[] = { -+static const struct sg_proc_leaf sg_proc_leaf_arr[] = { - {"allow_dio", &adio_fops}, - {"debug", &debug_fops}, - {"def_reserved_size", &dressz_fops}, -@@ -2332,7 +2332,7 @@ sg_proc_init(void) - if (!sg_proc_sgp) - return 1; - for (k = 0; k < num_leaves; ++k) { -- struct sg_proc_leaf *leaf = &sg_proc_leaf_arr[k]; -+ const struct sg_proc_leaf *leaf = &sg_proc_leaf_arr[k]; - umode_t mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; - proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops); - } diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c -index 3d8f662..070f1a5 100644 +index 004b10f..7c98d51 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -1361,7 +1361,7 @@ int spi_bus_unlock(struct spi_master *master) +@@ -1620,7 +1620,7 @@ int spi_bus_unlock(struct spi_master *master) EXPORT_SYMBOL_GPL(spi_bus_unlock); /* portable code must never pass more than 32 bytes */ @@ -37333,8 +42234,21 @@ index 3d8f662..070f1a5 100644 static u8 *buf; +diff --git a/drivers/staging/iio/iio_hwmon.c b/drivers/staging/iio/iio_hwmon.c +index 93af756..a4bc5bf 100644 +--- a/drivers/staging/iio/iio_hwmon.c ++++ b/drivers/staging/iio/iio_hwmon.c +@@ -67,7 +67,7 @@ static int iio_hwmon_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; + struct iio_hwmon_state *st; +- struct sensor_device_attribute *a; ++ sensor_device_attribute_no_const *a; + int ret, i; + int in_i = 1, temp_i = 1, curr_i = 1; + enum iio_chan_type type; diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c -index d91751f..a3a9e36 100644 +index 34afc16..ffe44dd 100644 --- a/drivers/staging/octeon/ethernet-rx.c +++ b/drivers/staging/octeon/ethernet-rx.c @@ -421,11 +421,11 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) @@ -37366,10 +42280,10 @@ index d91751f..a3a9e36 100644 dev_kfree_skb_irq(skb); } diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c -index 60cba81..71eb239 100644 +index c3a90e7..023619a 100644 --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -259,11 +259,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev) +@@ -252,11 +252,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev) * since the RX tasklet also increments it. */ #ifdef CONFIG_64BIT @@ -37386,7 +42300,7 @@ index 60cba81..71eb239 100644 } diff --git a/drivers/staging/rtl8712/rtl871x_io.h b/drivers/staging/rtl8712/rtl871x_io.h -index d3d8727..f9327bb8 100644 +index dc23395..cf7e9b1 100644 --- a/drivers/staging/rtl8712/rtl871x_io.h +++ b/drivers/staging/rtl8712/rtl871x_io.h @@ -108,7 +108,7 @@ struct _io_ops { @@ -37399,10 +42313,10 @@ index d3d8727..f9327bb8 100644 struct io_req { struct list_head list; diff --git a/drivers/staging/sbe-2t3e3/netdev.c b/drivers/staging/sbe-2t3e3/netdev.c -index c7b5e8b..783d6cb 100644 +index 1f5088b..0e59820 100644 --- a/drivers/staging/sbe-2t3e3/netdev.c +++ b/drivers/staging/sbe-2t3e3/netdev.c -@@ -51,7 +51,7 @@ int t3e3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +@@ -51,7 +51,7 @@ static int t3e3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) t3e3_if_config(sc, cmd_2t3e3, (char *)¶m, &resp, &rlen); if (rlen) @@ -37411,41 +42325,11 @@ index c7b5e8b..783d6cb 100644 return -EFAULT; return 0; -diff --git a/drivers/staging/speakup/speakup_soft.c b/drivers/staging/speakup/speakup_soft.c -index 42cdafe..2769103 100644 ---- a/drivers/staging/speakup/speakup_soft.c -+++ b/drivers/staging/speakup/speakup_soft.c -@@ -241,11 +241,11 @@ static ssize_t softsynth_read(struct file *fp, char *buf, size_t count, - break; - } else if (!initialized) { - if (*init) { -- ch = *init; - init++; - } else { - initialized = 1; - } -+ ch = *init; - } else { - ch = synth_buffer_getc(); - } -diff --git a/drivers/staging/usbip/usbip_common.h b/drivers/staging/usbip/usbip_common.h -index c7b888c..c94be93 100644 ---- a/drivers/staging/usbip/usbip_common.h -+++ b/drivers/staging/usbip/usbip_common.h -@@ -289,7 +289,7 @@ struct usbip_device { - void (*shutdown)(struct usbip_device *); - void (*reset)(struct usbip_device *); - void (*unusable)(struct usbip_device *); -- } eh_ops; -+ } __no_const eh_ops; - }; - - /* usbip_common.c */ diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h -index 88b3298..3783eee 100644 +index 5dddc4d..34fcb2f 100644 --- a/drivers/staging/usbip/vhci.h +++ b/drivers/staging/usbip/vhci.h -@@ -88,7 +88,7 @@ struct vhci_hcd { +@@ -83,7 +83,7 @@ struct vhci_hcd { unsigned resuming:1; unsigned long re_timeout; @@ -37455,19 +42339,19 @@ index 88b3298..3783eee 100644 /* * NOTE: diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c -index dca9bf1..80735c9 100644 +index f1ca084..7b5c0c3 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c -@@ -488,7 +488,7 @@ static void vhci_tx_urb(struct urb *urb) - return; - } +@@ -441,7 +441,7 @@ static void vhci_tx_urb(struct urb *urb) + + spin_lock(&vdev->priv_lock); - priv->seqnum = atomic_inc_return(&the_controller->seqnum); + priv->seqnum = atomic_inc_return_unchecked(&the_controller->seqnum); if (priv->seqnum == 0xffff) dev_info(&urb->dev->dev, "seqnum max\n"); -@@ -740,7 +740,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) +@@ -687,7 +687,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) return -ENOMEM; } @@ -37476,7 +42360,7 @@ index dca9bf1..80735c9 100644 if (unlink->seqnum == 0xffff) pr_info("seqnum max\n"); -@@ -928,7 +928,7 @@ static int vhci_start(struct usb_hcd *hcd) +@@ -891,7 +891,7 @@ static int vhci_start(struct usb_hcd *hcd) vdev->rhport = rhport; } @@ -37486,10 +42370,10 @@ index dca9bf1..80735c9 100644 hcd->power_budget = 0; /* no limit */ diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c -index f5fba732..210a16c 100644 +index faf8e60..c46f8ab 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c -@@ -77,7 +77,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, +@@ -76,7 +76,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, if (!urb) { pr_err("cannot find a urb of seqnum %u\n", pdu->base.seqnum); pr_info("max seqnum %d\n", @@ -37499,10 +42383,10 @@ index f5fba732..210a16c 100644 return; } diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c -index 7735027..30eed13 100644 +index 5f13890..36a044b 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c -@@ -79,14 +79,13 @@ static int msglevel =MSG_LEVEL_INFO; +@@ -73,14 +73,13 @@ static int msglevel =MSG_LEVEL_INFO; * */ @@ -37519,7 +42403,7 @@ index 7735027..30eed13 100644 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name); -@@ -98,6 +97,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) +@@ -92,6 +91,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) *apdev_priv = *pDevice; memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN); @@ -37529,27 +42413,27 @@ index 7735027..30eed13 100644 pDevice->apdev->type = ARPHRD_IEEE80211; diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c -index 51b5adf..098e320 100644 +index bc5e9da..dacd556 100644 --- a/drivers/staging/vt6656/hostap.c +++ b/drivers/staging/vt6656/hostap.c -@@ -80,14 +80,13 @@ static int msglevel =MSG_LEVEL_INFO; +@@ -60,14 +60,13 @@ static int msglevel =MSG_LEVEL_INFO; * */ +static net_device_ops_no_const apdev_netdev_ops; + - static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) + static int hostap_enable_hostapd(struct vnt_private *pDevice, int rtnl_locked) { - PSDevice apdev_priv; + struct vnt_private *apdev_priv; struct net_device *dev = pDevice->dev; int ret; - const struct net_device_ops apdev_netdev_ops = { -- .ndo_start_xmit = pDevice->tx_80211, +- .ndo_start_xmit = pDevice->tx_80211, - }; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name); -@@ -99,6 +98,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) +@@ -79,6 +78,8 @@ static int hostap_enable_hostapd(struct vnt_private *pDevice, int rtnl_locked) *apdev_priv = *pDevice; memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN); @@ -37558,24 +42442,11 @@ index 51b5adf..098e320 100644 pDevice->apdev->netdev_ops = &apdev_netdev_ops; pDevice->apdev->type = ARPHRD_IEEE80211; -diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c -index 7843dfd..3db105f 100644 ---- a/drivers/staging/wlan-ng/hfa384x_usb.c -+++ b/drivers/staging/wlan-ng/hfa384x_usb.c -@@ -204,7 +204,7 @@ static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx); - - struct usbctlx_completor { - int (*complete) (struct usbctlx_completor *); --}; -+} __no_const; - - static int - hfa384x_usbctlx_complete_sync(hfa384x_t *hw, diff --git a/drivers/staging/zcache/tmem.c b/drivers/staging/zcache/tmem.c -index 1ca66ea..76f1343 100644 +index a2b7e03..9ff4bbd 100644 --- a/drivers/staging/zcache/tmem.c +++ b/drivers/staging/zcache/tmem.c -@@ -39,7 +39,7 @@ +@@ -50,7 +50,7 @@ * A tmem host implementation must use this function to register callbacks * for memory allocation. */ @@ -37584,9 +42455,9 @@ index 1ca66ea..76f1343 100644 static void tmem_objnode_tree_init(void); -@@ -53,7 +53,7 @@ void tmem_register_hostops(struct tmem_hostops *m) +@@ -64,7 +64,7 @@ void tmem_register_hostops(struct tmem_hostops *m) * A tmem host implementation must use this function to register - * callbacks for a page-accessible memory (PAM) implementation + * callbacks for a page-accessible memory (PAM) implementation. */ -static struct tmem_pamops tmem_pamops; +static tmem_pamops_no_const tmem_pamops; @@ -37594,18 +42465,18 @@ index 1ca66ea..76f1343 100644 void tmem_register_pamops(struct tmem_pamops *m) { diff --git a/drivers/staging/zcache/tmem.h b/drivers/staging/zcache/tmem.h -index 0d4aa82..f7832d4 100644 +index adbe5a8..d387359 100644 --- a/drivers/staging/zcache/tmem.h +++ b/drivers/staging/zcache/tmem.h -@@ -180,6 +180,7 @@ struct tmem_pamops { - void (*new_obj)(struct tmem_obj *); +@@ -226,6 +226,7 @@ struct tmem_pamops { int (*replace_in_obj)(void *, struct tmem_obj *); + #endif }; +typedef struct tmem_pamops __no_const tmem_pamops_no_const; extern void tmem_register_pamops(struct tmem_pamops *m); /* memory allocation methods provided by the host implementation */ -@@ -189,6 +190,7 @@ struct tmem_hostops { +@@ -235,6 +236,7 @@ struct tmem_hostops { struct tmem_objnode *(*objnode_alloc)(struct tmem_pool *); void (*objnode_free)(struct tmem_objnode *, struct tmem_pool *); }; @@ -37613,64 +42484,118 @@ index 0d4aa82..f7832d4 100644 extern void tmem_register_hostops(struct tmem_hostops *m); /* core tmem accessor functions */ -diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c -index f015839..b15dfc4 100644 ---- a/drivers/target/target_core_tmr.c -+++ b/drivers/target/target_core_tmr.c -@@ -327,7 +327,7 @@ static void core_tmr_drain_task_list( - cmd->se_tfo->get_task_tag(cmd), cmd->pr_res_key, - cmd->t_task_list_num, - atomic_read(&cmd->t_task_cdbs_left), -- atomic_read(&cmd->t_task_cdbs_sent), -+ atomic_read_unchecked(&cmd->t_task_cdbs_sent), - (cmd->transport_state & CMD_T_ACTIVE) != 0, - (cmd->transport_state & CMD_T_STOP) != 0, - (cmd->transport_state & CMD_T_SENT) != 0); -diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c -index 222f1c5..0cdfd3e 100644 ---- a/drivers/target/target_core_transport.c -+++ b/drivers/target/target_core_transport.c -@@ -1355,7 +1355,7 @@ struct se_device *transport_add_device_to_core_hba( +diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c +index 2e4d655..fd72e68 100644 +--- a/drivers/target/target_core_device.c ++++ b/drivers/target/target_core_device.c +@@ -1414,7 +1414,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) spin_lock_init(&dev->se_port_lock); spin_lock_init(&dev->se_tmr_lock); spin_lock_init(&dev->qf_cmd_lock); - atomic_set(&dev->dev_ordered_id, 0); + atomic_set_unchecked(&dev->dev_ordered_id, 0); - - se_dev_set_default_attribs(dev, dev_limits); - -@@ -1542,7 +1542,7 @@ static int transport_check_alloc_task_attr(struct se_cmd *cmd) + INIT_LIST_HEAD(&dev->t10_wwn.t10_vpd_list); + spin_lock_init(&dev->t10_wwn.t10_vpd_lock); + INIT_LIST_HEAD(&dev->t10_pr.registration_list); +diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c +index 0d46276..f327cab5 100644 +--- a/drivers/target/target_core_transport.c ++++ b/drivers/target/target_core_transport.c +@@ -1080,7 +1080,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd) * Used to determine when ORDERED commands should go from * Dormant to Active status. */ -- cmd->se_ordered_id = atomic_inc_return(&cmd->se_dev->dev_ordered_id); -+ cmd->se_ordered_id = atomic_inc_return_unchecked(&cmd->se_dev->dev_ordered_id); +- cmd->se_ordered_id = atomic_inc_return(&dev->dev_ordered_id); ++ cmd->se_ordered_id = atomic_inc_return_unchecked(&dev->dev_ordered_id); smp_mb__after_atomic_inc(); pr_debug("Allocated se_ordered_id: %u for Task Attr: 0x%02x on %s\n", cmd->se_ordered_id, cmd->sam_task_attr, -@@ -1956,7 +1956,7 @@ void transport_generic_request_failure(struct se_cmd *cmd) - " CMD_T_ACTIVE: %d CMD_T_STOP: %d CMD_T_SENT: %d\n", - cmd->t_task_list_num, - atomic_read(&cmd->t_task_cdbs_left), -- atomic_read(&cmd->t_task_cdbs_sent), -+ atomic_read_unchecked(&cmd->t_task_cdbs_sent), - atomic_read(&cmd->t_task_cdbs_ex_left), - (cmd->transport_state & CMD_T_ACTIVE) != 0, - (cmd->transport_state & CMD_T_STOP) != 0, -@@ -2217,9 +2217,9 @@ check_depth: - cmd = task->task_se_cmd; - spin_lock_irqsave(&cmd->t_state_lock, flags); - task->task_flags |= (TF_ACTIVE | TF_SENT); -- atomic_inc(&cmd->t_task_cdbs_sent); -+ atomic_inc_unchecked(&cmd->t_task_cdbs_sent); - -- if (atomic_read(&cmd->t_task_cdbs_sent) == -+ if (atomic_read_unchecked(&cmd->t_task_cdbs_sent) == - cmd->t_task_list_num) - cmd->transport_state |= CMD_T_SENT; +diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c +index 345bd0e..61d5375 100644 +--- a/drivers/tty/cyclades.c ++++ b/drivers/tty/cyclades.c +@@ -1576,10 +1576,10 @@ static int cy_open(struct tty_struct *tty, struct file *filp) + printk(KERN_DEBUG "cyc:cy_open ttyC%d, count = %d\n", info->line, + info->port.count); + #endif +- info->port.count++; ++ atomic_inc(&info->port.count); + #ifdef CY_DEBUG_COUNT + printk(KERN_DEBUG "cyc:cy_open (%d): incrementing count to %d\n", +- current->pid, info->port.count); ++ current->pid, atomic_read(&info->port.count)); + #endif + + /* +@@ -3978,7 +3978,7 @@ static int cyclades_proc_show(struct seq_file *m, void *v) + for (j = 0; j < cy_card[i].nports; j++) { + info = &cy_card[i].ports[j]; + +- if (info->port.count) { ++ if (atomic_read(&info->port.count)) { + /* XXX is the ldisc num worth this? */ + struct tty_struct *tty; + struct tty_ldisc *ld; +diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c +index eb255e8..f637a57 100644 +--- a/drivers/tty/hvc/hvc_console.c ++++ b/drivers/tty/hvc/hvc_console.c +@@ -338,7 +338,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) + + spin_lock_irqsave(&hp->port.lock, flags); + /* Check and then increment for fast path open. */ +- if (hp->port.count++ > 0) { ++ if (atomic_inc_return(&hp->port.count) > 1) { + spin_unlock_irqrestore(&hp->port.lock, flags); + hvc_kick(); + return 0; +@@ -388,7 +388,7 @@ static void hvc_close(struct tty_struct *tty, struct file * filp) + + spin_lock_irqsave(&hp->port.lock, flags); + +- if (--hp->port.count == 0) { ++ if (atomic_dec_return(&hp->port.count) == 0) { + spin_unlock_irqrestore(&hp->port.lock, flags); + /* We are done with the tty pointer now. */ + tty_port_tty_set(&hp->port, NULL); +@@ -406,9 +406,9 @@ static void hvc_close(struct tty_struct *tty, struct file * filp) + */ + tty_wait_until_sent_from_close(tty, HVC_CLOSE_WAIT); + } else { +- if (hp->port.count < 0) ++ if (atomic_read(&hp->port.count) < 0) + printk(KERN_ERR "hvc_close %X: oops, count is %d\n", +- hp->vtermno, hp->port.count); ++ hp->vtermno, atomic_read(&hp->port.count)); + spin_unlock_irqrestore(&hp->port.lock, flags); + } + } +@@ -438,12 +438,12 @@ static void hvc_hangup(struct tty_struct *tty) + * open->hangup case this can be called after the final close so prevent + * that from happening for now. + */ +- if (hp->port.count <= 0) { ++ if (atomic_read(&hp->port.count) <= 0) { + spin_unlock_irqrestore(&hp->port.lock, flags); + return; + } + +- hp->port.count = 0; ++ atomic_set(&hp->port.count, 0); + spin_unlock_irqrestore(&hp->port.lock, flags); + tty_port_tty_set(&hp->port, NULL); + +@@ -491,7 +491,7 @@ static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count + return -EPIPE; + + /* FIXME what's this (unprotected) check for? */ +- if (hp->port.count <= 0) ++ if (atomic_read(&hp->port.count) <= 0) + return -EIO; + spin_lock_irqsave(&hp->lock, flags); diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c -index 3436436..772237b 100644 +index 81e939e..95ead10 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -83,6 +83,7 @@ @@ -37681,39 +42606,30 @@ index 3436436..772237b 100644 /* * 1.3.0 -> 1.3.1 In hvcs_open memset(..,0x00,..) instead of memset(..,0x3F,00). -@@ -270,7 +271,7 @@ struct hvcs_struct { - unsigned int index; - - struct tty_struct *tty; -- int open_count; -+ local_t open_count; - - /* - * Used to tell the driver kernel_thread what operations need to take -@@ -422,7 +423,7 @@ static ssize_t hvcs_vterm_state_store(struct device *dev, struct device_attribut +@@ -416,7 +417,7 @@ static ssize_t hvcs_vterm_state_store(struct device *dev, struct device_attribut spin_lock_irqsave(&hvcsd->lock, flags); -- if (hvcsd->open_count > 0) { -+ if (local_read(&hvcsd->open_count) > 0) { +- if (hvcsd->port.count > 0) { ++ if (atomic_read(&hvcsd->port.count) > 0) { spin_unlock_irqrestore(&hvcsd->lock, flags); printk(KERN_INFO "HVCS: vterm state unchanged. " "The hvcs device node is still in use.\n"); -@@ -1138,7 +1139,7 @@ static int hvcs_open(struct tty_struct *tty, struct file *filp) - if ((retval = hvcs_partner_connect(hvcsd))) - goto error_release; +@@ -1127,7 +1128,7 @@ static int hvcs_install(struct tty_driver *driver, struct tty_struct *tty) + } + } -- hvcsd->open_count = 1; -+ local_set(&hvcsd->open_count, 1); - hvcsd->tty = tty; +- hvcsd->port.count = 0; ++ atomic_set(&hvcsd->port.count, 0); + hvcsd->port.tty = tty; tty->driver_data = hvcsd; -@@ -1172,7 +1173,7 @@ fast_open: +@@ -1180,7 +1181,7 @@ static int hvcs_open(struct tty_struct *tty, struct file *filp) + unsigned long flags; spin_lock_irqsave(&hvcsd->lock, flags); - kref_get(&hvcsd->kref); -- hvcsd->open_count++; -+ local_inc(&hvcsd->open_count); +- hvcsd->port.count++; ++ atomic_inc(&hvcsd->port.count); hvcsd->todo_mask |= HVCS_SCHED_READ; spin_unlock_irqrestore(&hvcsd->lock, flags); @@ -37721,62 +42637,62 @@ index 3436436..772237b 100644 hvcsd = tty->driver_data; spin_lock_irqsave(&hvcsd->lock, flags); -- if (--hvcsd->open_count == 0) { -+ if (local_dec_and_test(&hvcsd->open_count)) { +- if (--hvcsd->port.count == 0) { ++ if (atomic_dec_and_test(&hvcsd->port.count)) { vio_disable_interrupts(hvcsd->vdev); -@@ -1242,10 +1243,10 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp) +@@ -1241,10 +1242,10 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp) + free_irq(irq, hvcsd); - kref_put(&hvcsd->kref, destroy_hvcs_struct); return; -- } else if (hvcsd->open_count < 0) { -+ } else if (local_read(&hvcsd->open_count) < 0) { +- } else if (hvcsd->port.count < 0) { ++ } else if (atomic_read(&hvcsd->port.count) < 0) { printk(KERN_ERR "HVCS: vty-server@%X open_count: %d" " is missmanaged.\n", -- hvcsd->vdev->unit_address, hvcsd->open_count); -+ hvcsd->vdev->unit_address, local_read(&hvcsd->open_count)); +- hvcsd->vdev->unit_address, hvcsd->port.count); ++ hvcsd->vdev->unit_address, atomic_read(&hvcsd->port.count)); } spin_unlock_irqrestore(&hvcsd->lock, flags); -@@ -1261,7 +1262,7 @@ static void hvcs_hangup(struct tty_struct * tty) +@@ -1266,7 +1267,7 @@ static void hvcs_hangup(struct tty_struct * tty) spin_lock_irqsave(&hvcsd->lock, flags); /* Preserve this so that we know how many kref refs to put */ -- temp_open_count = hvcsd->open_count; -+ temp_open_count = local_read(&hvcsd->open_count); +- temp_open_count = hvcsd->port.count; ++ temp_open_count = atomic_read(&hvcsd->port.count); /* * Don't kref put inside the spinlock because the destruction -@@ -1276,7 +1277,7 @@ static void hvcs_hangup(struct tty_struct * tty) - hvcsd->tty->driver_data = NULL; - hvcsd->tty = NULL; +@@ -1281,7 +1282,7 @@ static void hvcs_hangup(struct tty_struct * tty) + tty->driver_data = NULL; + hvcsd->port.tty = NULL; -- hvcsd->open_count = 0; -+ local_set(&hvcsd->open_count, 0); +- hvcsd->port.count = 0; ++ atomic_set(&hvcsd->port.count, 0); /* This will drop any buffered data on the floor which is OK in a hangup * scenario. */ -@@ -1347,7 +1348,7 @@ static int hvcs_write(struct tty_struct *tty, +@@ -1352,7 +1353,7 @@ static int hvcs_write(struct tty_struct *tty, * the middle of a write operation? This is a crummy place to do this * but we want to keep it all in the spinlock. */ -- if (hvcsd->open_count <= 0) { -+ if (local_read(&hvcsd->open_count) <= 0) { +- if (hvcsd->port.count <= 0) { ++ if (atomic_read(&hvcsd->port.count) <= 0) { spin_unlock_irqrestore(&hvcsd->lock, flags); return -ENODEV; } -@@ -1421,7 +1422,7 @@ static int hvcs_write_room(struct tty_struct *tty) +@@ -1426,7 +1427,7 @@ static int hvcs_write_room(struct tty_struct *tty) { struct hvcs_struct *hvcsd = tty->driver_data; -- if (!hvcsd || hvcsd->open_count <= 0) -+ if (!hvcsd || local_read(&hvcsd->open_count) <= 0) +- if (!hvcsd || hvcsd->port.count <= 0) ++ if (!hvcsd || atomic_read(&hvcsd->port.count) <= 0) return 0; return HVCS_BUFF_LEN - hvcsd->chars_in_buffer; diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c -index 4daf962..b4a2281 100644 +index 8fd72ff..34a0bed 100644 --- a/drivers/tty/ipwireless/tty.c +++ b/drivers/tty/ipwireless/tty.c @@ -29,6 +29,7 @@ @@ -37787,126 +42703,130 @@ index 4daf962..b4a2281 100644 #include "tty.h" #include "network.h" -@@ -51,7 +52,7 @@ struct ipw_tty { - int tty_type; - struct ipw_network *network; - struct tty_struct *linux_tty; -- int open_count; -+ local_t open_count; - unsigned int control_lines; - struct mutex ipw_tty_mutex; - int tx_bytes_queued; -@@ -117,10 +118,10 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp) +@@ -99,10 +100,10 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp) mutex_unlock(&tty->ipw_tty_mutex); return -ENODEV; } -- if (tty->open_count == 0) -+ if (local_read(&tty->open_count) == 0) +- if (tty->port.count == 0) ++ if (atomic_read(&tty->port.count) == 0) tty->tx_bytes_queued = 0; -- tty->open_count++; -+ local_inc(&tty->open_count); +- tty->port.count++; ++ atomic_inc(&tty->port.count); - tty->linux_tty = linux_tty; + tty->port.tty = linux_tty; linux_tty->driver_data = tty; -@@ -136,9 +137,7 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp) +@@ -118,9 +119,7 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp) static void do_ipw_close(struct ipw_tty *tty) { -- tty->open_count--; +- tty->port.count--; - -- if (tty->open_count == 0) { -+ if (local_dec_return(&tty->open_count) == 0) { - struct tty_struct *linux_tty = tty->linux_tty; +- if (tty->port.count == 0) { ++ if (atomic_dec_return(&tty->port.count) == 0) { + struct tty_struct *linux_tty = tty->port.tty; if (linux_tty != NULL) { -@@ -159,7 +158,7 @@ static void ipw_hangup(struct tty_struct *linux_tty) +@@ -141,7 +140,7 @@ static void ipw_hangup(struct tty_struct *linux_tty) return; mutex_lock(&tty->ipw_tty_mutex); -- if (tty->open_count == 0) { -+ if (local_read(&tty->open_count) == 0) { +- if (tty->port.count == 0) { ++ if (atomic_read(&tty->port.count) == 0) { mutex_unlock(&tty->ipw_tty_mutex); return; } -@@ -188,7 +187,7 @@ void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data, - return; - } +@@ -164,7 +163,7 @@ void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data, -- if (!tty->open_count) { -+ if (!local_read(&tty->open_count)) { + mutex_lock(&tty->ipw_tty_mutex); + +- if (!tty->port.count) { ++ if (!atomic_read(&tty->port.count)) { mutex_unlock(&tty->ipw_tty_mutex); return; } -@@ -230,7 +229,7 @@ static int ipw_write(struct tty_struct *linux_tty, +@@ -206,7 +205,7 @@ static int ipw_write(struct tty_struct *linux_tty, return -ENODEV; mutex_lock(&tty->ipw_tty_mutex); -- if (!tty->open_count) { -+ if (!local_read(&tty->open_count)) { +- if (!tty->port.count) { ++ if (!atomic_read(&tty->port.count)) { mutex_unlock(&tty->ipw_tty_mutex); return -EINVAL; } -@@ -270,7 +269,7 @@ static int ipw_write_room(struct tty_struct *linux_tty) +@@ -246,7 +245,7 @@ static int ipw_write_room(struct tty_struct *linux_tty) if (!tty) return -ENODEV; -- if (!tty->open_count) -+ if (!local_read(&tty->open_count)) +- if (!tty->port.count) ++ if (!atomic_read(&tty->port.count)) return -EINVAL; room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued; -@@ -312,7 +311,7 @@ static int ipw_chars_in_buffer(struct tty_struct *linux_tty) +@@ -288,7 +287,7 @@ static int ipw_chars_in_buffer(struct tty_struct *linux_tty) if (!tty) return 0; -- if (!tty->open_count) -+ if (!local_read(&tty->open_count)) +- if (!tty->port.count) ++ if (!atomic_read(&tty->port.count)) return 0; return tty->tx_bytes_queued; -@@ -393,7 +392,7 @@ static int ipw_tiocmget(struct tty_struct *linux_tty) +@@ -369,7 +368,7 @@ static int ipw_tiocmget(struct tty_struct *linux_tty) if (!tty) return -ENODEV; -- if (!tty->open_count) -+ if (!local_read(&tty->open_count)) +- if (!tty->port.count) ++ if (!atomic_read(&tty->port.count)) return -EINVAL; return get_control_lines(tty); -@@ -409,7 +408,7 @@ ipw_tiocmset(struct tty_struct *linux_tty, +@@ -385,7 +384,7 @@ ipw_tiocmset(struct tty_struct *linux_tty, if (!tty) return -ENODEV; -- if (!tty->open_count) -+ if (!local_read(&tty->open_count)) +- if (!tty->port.count) ++ if (!atomic_read(&tty->port.count)) return -EINVAL; return set_control_lines(tty, set, clear); -@@ -423,7 +422,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty, +@@ -399,7 +398,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty, if (!tty) return -ENODEV; -- if (!tty->open_count) -+ if (!local_read(&tty->open_count)) +- if (!tty->port.count) ++ if (!atomic_read(&tty->port.count)) return -EINVAL; /* FIXME: Exactly how is the tty object locked here .. */ -@@ -572,7 +571,7 @@ void ipwireless_tty_free(struct ipw_tty *tty) - against a parallel ioctl etc */ +@@ -555,7 +554,7 @@ void ipwireless_tty_free(struct ipw_tty *tty) + * are gone */ mutex_lock(&ttyj->ipw_tty_mutex); } -- while (ttyj->open_count) -+ while (local_read(&ttyj->open_count)) +- while (ttyj->port.count) ++ while (atomic_read(&ttyj->port.count)) do_ipw_close(ttyj); ipwireless_disassociate_network_ttys(network, ttyj->channel_idx); +diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c +index adeac25..787a0a1 100644 +--- a/drivers/tty/moxa.c ++++ b/drivers/tty/moxa.c +@@ -1193,7 +1193,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) + } + + ch = &brd->ports[port % MAX_PORTS_PER_BOARD]; +- ch->port.count++; ++ atomic_inc(&ch->port.count); + tty->driver_data = ch; + tty_port_tty_set(&ch->port, tty); + mutex_lock(&ch->port.mutex); diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c -index c43b683..0a88f1c 100644 +index 4a43ef5d7..aa71f27 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c -@@ -1629,7 +1629,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr) - kref_init(&dlci->ref); +@@ -1636,7 +1636,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr) + spin_lock_init(&dlci->lock); mutex_init(&dlci->mutex); dlci->fifo = &dlci->_fifo; - if (kfifo_alloc(&dlci->_fifo, 4096, GFP_KERNEL) < 0) { @@ -37914,11 +42834,20 @@ index c43b683..0a88f1c 100644 kfree(dlci); return NULL; } +@@ -2936,7 +2936,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp) + struct gsm_dlci *dlci = tty->driver_data; + struct tty_port *port = &dlci->port; + +- port->count++; ++ atomic_inc(&port->count); + dlci_get(dlci); + dlci_get(dlci->gsm->dlci[0]); + mux_get(dlci->gsm); diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c -index 94b6eda..15f7cec 100644 +index 05e72be..67f6a0f 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c -@@ -2122,6 +2122,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops) +@@ -2197,6 +2197,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops) { *ops = tty_ldisc_N_TTY; ops->owner = NULL; @@ -37928,10 +42857,10 @@ index 94b6eda..15f7cec 100644 } EXPORT_SYMBOL_GPL(n_tty_inherit_ops); diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c -index eeae7fa..177a743 100644 +index 125e0fd..8c50690 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c -@@ -707,8 +707,10 @@ static void __init unix98_pty_init(void) +@@ -800,8 +800,10 @@ static void __init unix98_pty_init(void) panic("Couldn't register Unix98 pts driver"); /* Now create the /dev/ptmx special device */ @@ -37943,8 +42872,39 @@ index eeae7fa..177a743 100644 cdev_init(&ptmx_cdev, &ptmx_fops); if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || +diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c +index 1d27003..959f452 100644 +--- a/drivers/tty/rocket.c ++++ b/drivers/tty/rocket.c +@@ -923,7 +923,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) + tty->driver_data = info; + tty_port_tty_set(port, tty); + +- if (port->count++ == 0) { ++ if (atomic_inc_return(&port->count) == 1) { + atomic_inc(&rp_num_ports_open); + + #ifdef ROCKET_DEBUG_OPEN +@@ -932,7 +932,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) + #endif + } + #ifdef ROCKET_DEBUG_OPEN +- printk(KERN_INFO "rp_open ttyR%d, count=%d\n", info->line, info->port.count); ++ printk(KERN_INFO "rp_open ttyR%d, count=%d\n", info->line, atomic-read(&info->port.count)); + #endif + + /* +@@ -1527,7 +1527,7 @@ static void rp_hangup(struct tty_struct *tty) + spin_unlock_irqrestore(&info->port.lock, flags); + return; + } +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + atomic_dec(&rp_num_ports_open); + clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); + spin_unlock_irqrestore(&info->port.lock, flags); diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c -index 2b42a01..32a2ed3 100644 +index 1002054..dd644a8 100644 --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c @@ -24,8 +24,9 @@ @@ -37958,7 +42918,7 @@ index 2b42a01..32a2ed3 100644 static int configured = -1; static char config[MAX_CONFIG_LEN]; -@@ -148,6 +149,8 @@ static void cleanup_kgdboc(void) +@@ -151,6 +152,8 @@ static void cleanup_kgdboc(void) kgdboc_unregister_kbd(); if (configured == 1) kgdb_unregister_io_module(&kgdboc_io_ops); @@ -37967,7 +42927,7 @@ index 2b42a01..32a2ed3 100644 } static int configure_kgdboc(void) -@@ -157,13 +160,13 @@ static int configure_kgdboc(void) +@@ -160,13 +163,13 @@ static int configure_kgdboc(void) int err; char *cptr = config; struct console *cons; @@ -37982,7 +42942,7 @@ index 2b42a01..32a2ed3 100644 kgdb_tty_driver = NULL; kgdboc_use_kms = 0; -@@ -184,7 +187,7 @@ static int configure_kgdboc(void) +@@ -187,7 +190,7 @@ static int configure_kgdboc(void) int idx; if (cons->device && cons->device(cons, &idx) == p && idx == tty_line) { @@ -37991,7 +42951,7 @@ index 2b42a01..32a2ed3 100644 break; } cons = cons->next; -@@ -194,12 +197,16 @@ static int configure_kgdboc(void) +@@ -197,7 +200,13 @@ static int configure_kgdboc(void) kgdb_tty_line = tty_line; do_register: @@ -38006,12 +42966,16 @@ index 2b42a01..32a2ed3 100644 if (err) goto noconfig; +@@ -205,8 +214,6 @@ do_register: + if (err) + goto nmi_con_failed; + - configured = 1; - return 0; - noconfig: -@@ -213,7 +220,7 @@ noconfig: + nmi_con_failed: +@@ -223,7 +230,7 @@ noconfig: static int __init init_kgdboc(void) { /* Already configured? */ @@ -38020,7 +42984,7 @@ index 2b42a01..32a2ed3 100644 return 0; return configure_kgdboc(); -@@ -262,7 +269,7 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) +@@ -272,7 +279,7 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) if (config[len - 1] == '\n') config[len - 1] = '\0'; @@ -38029,7 +42993,7 @@ index 2b42a01..32a2ed3 100644 cleanup_kgdboc(); /* Go and configure with the new params. */ -@@ -302,6 +309,15 @@ static struct kgdb_io kgdboc_io_ops = { +@@ -312,6 +319,15 @@ static struct kgdb_io kgdboc_io_ops = { .post_exception = kgdboc_post_exp_handler, }; @@ -38045,11 +43009,472 @@ index 2b42a01..32a2ed3 100644 #ifdef CONFIG_KGDB_SERIAL_CONSOLE /* This is only available if kgdboc is a built in for early debugging */ static int __init kgdboc_early_init(char *opt) +diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c +index 2769a38..f3dbe48 100644 +--- a/drivers/tty/serial/samsung.c ++++ b/drivers/tty/serial/samsung.c +@@ -451,11 +451,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port) + } + } + ++static int s3c64xx_serial_startup(struct uart_port *port); + static int s3c24xx_serial_startup(struct uart_port *port) + { + struct s3c24xx_uart_port *ourport = to_ourport(port); + int ret; + ++ /* Startup sequence is different for s3c64xx and higher SoC's */ ++ if (s3c24xx_serial_has_interrupt_mask(port)) ++ return s3c64xx_serial_startup(port); ++ + dbg("s3c24xx_serial_startup: port=%p (%08lx,%p)\n", + port->mapbase, port->membase); + +@@ -1120,10 +1125,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, + /* setup info for port */ + port->dev = &platdev->dev; + +- /* Startup sequence is different for s3c64xx and higher SoC's */ +- if (s3c24xx_serial_has_interrupt_mask(port)) +- s3c24xx_serial_ops.startup = s3c64xx_serial_startup; +- + port->uartclk = 1; + + if (cfg->uart_flags & UPF_CONS_FLOW) { +diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c +index 8fbb6d2..822a9e6 100644 +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -1454,7 +1454,7 @@ static void uart_hangup(struct tty_struct *tty) + uart_flush_buffer(tty); + uart_shutdown(tty, state); + spin_lock_irqsave(&port->lock, flags); +- port->count = 0; ++ atomic_set(&port->count, 0); + clear_bit(ASYNCB_NORMAL_ACTIVE, &port->flags); + spin_unlock_irqrestore(&port->lock, flags); + tty_port_tty_set(port, NULL); +@@ -1550,7 +1550,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp) + goto end; + } + +- port->count++; ++ atomic_inc(&port->count); + if (!state->uart_port || state->uart_port->flags & UPF_DEAD) { + retval = -ENXIO; + goto err_dec_count; +@@ -1578,7 +1578,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp) + /* + * Make sure the device is in D0 state. + */ +- if (port->count == 1) ++ if (atomic_read(&port->count) == 1) + uart_change_pm(state, UART_PM_STATE_ON); + + /* +@@ -1596,7 +1596,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp) + end: + return retval; + err_dec_count: +- port->count--; ++ atomic_inc(&port->count); + mutex_unlock(&port->mutex); + goto end; + } +diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c +index 8983276..72a4090 100644 +--- a/drivers/tty/synclink.c ++++ b/drivers/tty/synclink.c +@@ -3093,7 +3093,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp) + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):mgsl_close(%s) entry, count=%d\n", +- __FILE__,__LINE__, info->device_name, info->port.count); ++ __FILE__,__LINE__, info->device_name, atomic_read(&info->port.count)); + + if (tty_port_close_start(&info->port, tty, filp) == 0) + goto cleanup; +@@ -3111,7 +3111,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp) + cleanup: + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):mgsl_close(%s) exit, count=%d\n", __FILE__,__LINE__, +- tty->driver->name, info->port.count); ++ tty->driver->name, atomic_read(&info->port.count)); + + } /* end of mgsl_close() */ + +@@ -3210,8 +3210,8 @@ static void mgsl_hangup(struct tty_struct *tty) + + mgsl_flush_buffer(tty); + shutdown(info); +- +- info->port.count = 0; ++ ++ atomic_set(&info->port.count, 0); + info->port.flags &= ~ASYNC_NORMAL_ACTIVE; + info->port.tty = NULL; + +@@ -3300,12 +3300,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):block_til_ready before block on %s count=%d\n", +- __FILE__,__LINE__, tty->driver->name, port->count ); ++ __FILE__,__LINE__, tty->driver->name, atomic_read(&port->count)); + + spin_lock_irqsave(&info->irq_spinlock, flags); + if (!tty_hung_up_p(filp)) { + extra_count = true; +- port->count--; ++ atomic_dec(&port->count); + } + spin_unlock_irqrestore(&info->irq_spinlock, flags); + port->blocked_open++; +@@ -3334,7 +3334,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):block_til_ready blocking on %s count=%d\n", +- __FILE__,__LINE__, tty->driver->name, port->count ); ++ __FILE__,__LINE__, tty->driver->name, atomic_read(&port->count)); + + tty_unlock(tty); + schedule(); +@@ -3346,12 +3346,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, + + /* FIXME: Racy on hangup during close wait */ + if (extra_count) +- port->count++; ++ atomic_inc(&port->count); + port->blocked_open--; + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):block_til_ready after blocking on %s count=%d\n", +- __FILE__,__LINE__, tty->driver->name, port->count ); ++ __FILE__,__LINE__, tty->driver->name, atomic_read(&port->count)); + + if (!retval) + port->flags |= ASYNC_NORMAL_ACTIVE; +@@ -3403,7 +3403,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp) + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):mgsl_open(%s), old ref count = %d\n", +- __FILE__,__LINE__,tty->driver->name, info->port.count); ++ __FILE__,__LINE__,tty->driver->name, atomic_read(&info->port.count)); + + /* If port is closing, signal caller to try again */ + if (tty_hung_up_p(filp) || info->port.flags & ASYNC_CLOSING){ +@@ -3422,10 +3422,10 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp) + spin_unlock_irqrestore(&info->netlock, flags); + goto cleanup; + } +- info->port.count++; ++ atomic_inc(&info->port.count); + spin_unlock_irqrestore(&info->netlock, flags); + +- if (info->port.count == 1) { ++ if (atomic_read(&info->port.count) == 1) { + /* 1st open on this device, init hardware */ + retval = startup(info); + if (retval < 0) +@@ -3449,8 +3449,8 @@ cleanup: + if (retval) { + if (tty->count == 1) + info->port.tty = NULL; /* tty layer will release tty struct */ +- if(info->port.count) +- info->port.count--; ++ if (atomic_read(&info->port.count)) ++ atomic_dec(&info->port.count); + } + + return retval; +@@ -7668,7 +7668,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, + unsigned short new_crctype; + + /* return error if TTY interface open */ +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + return -EBUSY; + + switch (encoding) +@@ -7763,7 +7763,7 @@ static int hdlcdev_open(struct net_device *dev) + + /* arbitrate between network and tty opens */ + spin_lock_irqsave(&info->netlock, flags); +- if (info->port.count != 0 || info->netcount != 0) { ++ if (atomic_read(&info->port.count) != 0 || info->netcount != 0) { + printk(KERN_WARNING "%s: hdlc_open returning busy\n", dev->name); + spin_unlock_irqrestore(&info->netlock, flags); + return -EBUSY; +@@ -7849,7 +7849,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + printk("%s:hdlcdev_ioctl(%s)\n",__FILE__,dev->name); + + /* return error if TTY interface open */ +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + return -EBUSY; + + if (cmd != SIOCWANDEV) +diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c +index aa9eece..d8baaec 100644 +--- a/drivers/tty/synclink_gt.c ++++ b/drivers/tty/synclink_gt.c +@@ -670,7 +670,7 @@ static int open(struct tty_struct *tty, struct file *filp) + tty->driver_data = info; + info->port.tty = tty; + +- DBGINFO(("%s open, old ref count = %d\n", info->device_name, info->port.count)); ++ DBGINFO(("%s open, old ref count = %d\n", info->device_name, atomic_read(&info->port.count))); + + /* If port is closing, signal caller to try again */ + if (tty_hung_up_p(filp) || info->port.flags & ASYNC_CLOSING){ +@@ -691,10 +691,10 @@ static int open(struct tty_struct *tty, struct file *filp) + mutex_unlock(&info->port.mutex); + goto cleanup; + } +- info->port.count++; ++ atomic_inc(&info->port.count); + spin_unlock_irqrestore(&info->netlock, flags); + +- if (info->port.count == 1) { ++ if (atomic_read(&info->port.count) == 1) { + /* 1st open on this device, init hardware */ + retval = startup(info); + if (retval < 0) { +@@ -715,8 +715,8 @@ cleanup: + if (retval) { + if (tty->count == 1) + info->port.tty = NULL; /* tty layer will release tty struct */ +- if(info->port.count) +- info->port.count--; ++ if(atomic_read(&info->port.count)) ++ atomic_dec(&info->port.count); + } + + DBGINFO(("%s open rc=%d\n", info->device_name, retval)); +@@ -729,7 +729,7 @@ static void close(struct tty_struct *tty, struct file *filp) + + if (sanity_check(info, tty->name, "close")) + return; +- DBGINFO(("%s close entry, count=%d\n", info->device_name, info->port.count)); ++ DBGINFO(("%s close entry, count=%d\n", info->device_name, atomic_read(&info->port.count))); + + if (tty_port_close_start(&info->port, tty, filp) == 0) + goto cleanup; +@@ -746,7 +746,7 @@ static void close(struct tty_struct *tty, struct file *filp) + tty_port_close_end(&info->port, tty); + info->port.tty = NULL; + cleanup: +- DBGINFO(("%s close exit, count=%d\n", tty->driver->name, info->port.count)); ++ DBGINFO(("%s close exit, count=%d\n", tty->driver->name, atomic_read(&info->port.count))); + } + + static void hangup(struct tty_struct *tty) +@@ -764,7 +764,7 @@ static void hangup(struct tty_struct *tty) + shutdown(info); + + spin_lock_irqsave(&info->port.lock, flags); +- info->port.count = 0; ++ atomic_set(&info->port.count, 0); + info->port.flags &= ~ASYNC_NORMAL_ACTIVE; + info->port.tty = NULL; + spin_unlock_irqrestore(&info->port.lock, flags); +@@ -1449,7 +1449,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, + unsigned short new_crctype; + + /* return error if TTY interface open */ +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + return -EBUSY; + + DBGINFO(("%s hdlcdev_attach\n", info->device_name)); +@@ -1544,7 +1544,7 @@ static int hdlcdev_open(struct net_device *dev) + + /* arbitrate between network and tty opens */ + spin_lock_irqsave(&info->netlock, flags); +- if (info->port.count != 0 || info->netcount != 0) { ++ if (atomic_read(&info->port.count) != 0 || info->netcount != 0) { + DBGINFO(("%s hdlc_open busy\n", dev->name)); + spin_unlock_irqrestore(&info->netlock, flags); + return -EBUSY; +@@ -1629,7 +1629,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + DBGINFO(("%s hdlcdev_ioctl\n", dev->name)); + + /* return error if TTY interface open */ +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + return -EBUSY; + + if (cmd != SIOCWANDEV) +@@ -2413,7 +2413,7 @@ static irqreturn_t slgt_interrupt(int dummy, void *dev_id) + if (port == NULL) + continue; + spin_lock(&port->lock); +- if ((port->port.count || port->netcount) && ++ if ((atomic_read(&port->port.count) || port->netcount) && + port->pending_bh && !port->bh_running && + !port->bh_requested) { + DBGISR(("%s bh queued\n", port->device_name)); +@@ -3302,7 +3302,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, + spin_lock_irqsave(&info->lock, flags); + if (!tty_hung_up_p(filp)) { + extra_count = true; +- port->count--; ++ atomic_dec(&port->count); + } + spin_unlock_irqrestore(&info->lock, flags); + port->blocked_open++; +@@ -3339,7 +3339,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, + remove_wait_queue(&port->open_wait, &wait); + + if (extra_count) +- port->count++; ++ atomic_inc(&port->count); + port->blocked_open--; + + if (!retval) +diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c +index 6d5780c..aa4d8cd 100644 +--- a/drivers/tty/synclinkmp.c ++++ b/drivers/tty/synclinkmp.c +@@ -750,7 +750,7 @@ static int open(struct tty_struct *tty, struct file *filp) + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):%s open(), old ref count = %d\n", +- __FILE__,__LINE__,tty->driver->name, info->port.count); ++ __FILE__,__LINE__,tty->driver->name, atomic_read(&info->port.count)); + + /* If port is closing, signal caller to try again */ + if (tty_hung_up_p(filp) || info->port.flags & ASYNC_CLOSING){ +@@ -769,10 +769,10 @@ static int open(struct tty_struct *tty, struct file *filp) + spin_unlock_irqrestore(&info->netlock, flags); + goto cleanup; + } +- info->port.count++; ++ atomic_inc(&info->port.count); + spin_unlock_irqrestore(&info->netlock, flags); + +- if (info->port.count == 1) { ++ if (atomic_read(&info->port.count) == 1) { + /* 1st open on this device, init hardware */ + retval = startup(info); + if (retval < 0) +@@ -796,8 +796,8 @@ cleanup: + if (retval) { + if (tty->count == 1) + info->port.tty = NULL; /* tty layer will release tty struct */ +- if(info->port.count) +- info->port.count--; ++ if(atomic_read(&info->port.count)) ++ atomic_dec(&info->port.count); + } + + return retval; +@@ -815,7 +815,7 @@ static void close(struct tty_struct *tty, struct file *filp) + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):%s close() entry, count=%d\n", +- __FILE__,__LINE__, info->device_name, info->port.count); ++ __FILE__,__LINE__, info->device_name, atomic_read(&info->port.count)); + + if (tty_port_close_start(&info->port, tty, filp) == 0) + goto cleanup; +@@ -834,7 +834,7 @@ static void close(struct tty_struct *tty, struct file *filp) + cleanup: + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):%s close() exit, count=%d\n", __FILE__,__LINE__, +- tty->driver->name, info->port.count); ++ tty->driver->name, atomic_read(&info->port.count)); + } + + /* Called by tty_hangup() when a hangup is signaled. +@@ -857,7 +857,7 @@ static void hangup(struct tty_struct *tty) + shutdown(info); + + spin_lock_irqsave(&info->port.lock, flags); +- info->port.count = 0; ++ atomic_set(&info->port.count, 0); + info->port.flags &= ~ASYNC_NORMAL_ACTIVE; + info->port.tty = NULL; + spin_unlock_irqrestore(&info->port.lock, flags); +@@ -1565,7 +1565,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, + unsigned short new_crctype; + + /* return error if TTY interface open */ +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + return -EBUSY; + + switch (encoding) +@@ -1660,7 +1660,7 @@ static int hdlcdev_open(struct net_device *dev) + + /* arbitrate between network and tty opens */ + spin_lock_irqsave(&info->netlock, flags); +- if (info->port.count != 0 || info->netcount != 0) { ++ if (atomic_read(&info->port.count) != 0 || info->netcount != 0) { + printk(KERN_WARNING "%s: hdlc_open returning busy\n", dev->name); + spin_unlock_irqrestore(&info->netlock, flags); + return -EBUSY; +@@ -1746,7 +1746,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + printk("%s:hdlcdev_ioctl(%s)\n",__FILE__,dev->name); + + /* return error if TTY interface open */ +- if (info->port.count) ++ if (atomic_read(&info->port.count)) + return -EBUSY; + + if (cmd != SIOCWANDEV) +@@ -2620,7 +2620,7 @@ static irqreturn_t synclinkmp_interrupt(int dummy, void *dev_id) + * do not request bottom half processing if the + * device is not open in a normal mode. + */ +- if ( port && (port->port.count || port->netcount) && ++ if ( port && (atomic_read(&port->port.count) || port->netcount) && + port->pending_bh && !port->bh_running && + !port->bh_requested ) { + if ( debug_level >= DEBUG_LEVEL_ISR ) +@@ -3318,12 +3318,12 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):%s block_til_ready() before block, count=%d\n", +- __FILE__,__LINE__, tty->driver->name, port->count ); ++ __FILE__,__LINE__, tty->driver->name, atomic_read(&port->count)); + + spin_lock_irqsave(&info->lock, flags); + if (!tty_hung_up_p(filp)) { + extra_count = true; +- port->count--; ++ atomic_dec(&port->count); + } + spin_unlock_irqrestore(&info->lock, flags); + port->blocked_open++; +@@ -3352,7 +3352,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):%s block_til_ready() count=%d\n", +- __FILE__,__LINE__, tty->driver->name, port->count ); ++ __FILE__,__LINE__, tty->driver->name, atomic_read(&port->count)); + + tty_unlock(tty); + schedule(); +@@ -3363,12 +3363,12 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, + remove_wait_queue(&port->open_wait, &wait); + + if (extra_count) +- port->count++; ++ atomic_inc(&port->count); + port->blocked_open--; + + if (debug_level >= DEBUG_LEVEL_INFO) + printk("%s(%d):%s block_til_ready() after, count=%d\n", +- __FILE__,__LINE__, tty->driver->name, port->count ); ++ __FILE__,__LINE__, tty->driver->name, atomic_read(&port->count)); + + if (!retval) + port->flags |= ASYNC_NORMAL_ACTIVE; diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c -index 05728894..b9d44c6 100644 +index 3687f0c..6b9b808 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c -@@ -865,7 +865,7 @@ EXPORT_SYMBOL(unregister_sysrq_key); +@@ -995,7 +995,7 @@ EXPORT_SYMBOL(unregister_sysrq_key); static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { @@ -38059,10 +43484,10 @@ index 05728894..b9d44c6 100644 if (get_user(c, buf)) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c -index d939bd7..33d92cd 100644 +index a9cd0b9..47b9336 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c -@@ -3278,7 +3278,7 @@ EXPORT_SYMBOL_GPL(get_current_tty); +@@ -3398,7 +3398,7 @@ EXPORT_SYMBOL_GPL(get_current_tty); void tty_default_fops(struct file_operations *fops) { @@ -38072,37 +43497,37 @@ index d939bd7..33d92cd 100644 /* diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c -index 24b95db..9c078d0 100644 +index d794087..e4f49e5 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c -@@ -57,7 +57,7 @@ static void put_ldisc(struct tty_ldisc *ld) - if (atomic_dec_and_lock(&ld->users, &tty_ldisc_lock)) { +@@ -56,7 +56,7 @@ static void put_ldisc(struct tty_ldisc *ld) + if (atomic_dec_and_test(&ld->users)) { struct tty_ldisc_ops *ldo = ld->ops; - ldo->refcount--; + atomic_dec(&ldo->refcount); module_put(ldo->owner); - spin_unlock_irqrestore(&tty_ldisc_lock, flags); + raw_spin_unlock_irqrestore(&tty_ldisc_lock, flags); -@@ -92,7 +92,7 @@ int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc) - spin_lock_irqsave(&tty_ldisc_lock, flags); +@@ -93,7 +93,7 @@ int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc) + raw_spin_lock_irqsave(&tty_ldisc_lock, flags); tty_ldiscs[disc] = new_ldisc; new_ldisc->num = disc; - new_ldisc->refcount = 0; + atomic_set(&new_ldisc->refcount, 0); - spin_unlock_irqrestore(&tty_ldisc_lock, flags); + raw_spin_unlock_irqrestore(&tty_ldisc_lock, flags); return ret; -@@ -120,7 +120,7 @@ int tty_unregister_ldisc(int disc) +@@ -121,7 +121,7 @@ int tty_unregister_ldisc(int disc) return -EINVAL; - spin_lock_irqsave(&tty_ldisc_lock, flags); + raw_spin_lock_irqsave(&tty_ldisc_lock, flags); - if (tty_ldiscs[disc]->refcount) + if (atomic_read(&tty_ldiscs[disc]->refcount)) ret = -EBUSY; else tty_ldiscs[disc] = NULL; -@@ -141,7 +141,7 @@ static struct tty_ldisc_ops *get_ldops(int disc) +@@ -142,7 +142,7 @@ static struct tty_ldisc_ops *get_ldops(int disc) if (ldops) { ret = ERR_PTR(-EAGAIN); if (try_module_get(ldops->owner)) { @@ -38111,20 +43536,87 @@ index 24b95db..9c078d0 100644 ret = ldops; } } -@@ -154,7 +154,7 @@ static void put_ldops(struct tty_ldisc_ops *ldops) +@@ -155,7 +155,7 @@ static void put_ldops(struct tty_ldisc_ops *ldops) unsigned long flags; - spin_lock_irqsave(&tty_ldisc_lock, flags); + raw_spin_lock_irqsave(&tty_ldisc_lock, flags); - ldops->refcount--; + atomic_dec(&ldops->refcount); module_put(ldops->owner); - spin_unlock_irqrestore(&tty_ldisc_lock, flags); + raw_spin_unlock_irqrestore(&tty_ldisc_lock, flags); } +diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c +index b7ff59d..7c6105e 100644 +--- a/drivers/tty/tty_port.c ++++ b/drivers/tty/tty_port.c +@@ -218,7 +218,7 @@ void tty_port_hangup(struct tty_port *port) + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); +- port->count = 0; ++ atomic_set(&port->count, 0); + port->flags &= ~ASYNC_NORMAL_ACTIVE; + if (port->tty) { + set_bit(TTY_IO_ERROR, &port->tty->flags); +@@ -344,7 +344,7 @@ int tty_port_block_til_ready(struct tty_port *port, + /* The port lock protects the port counts */ + spin_lock_irqsave(&port->lock, flags); + if (!tty_hung_up_p(filp)) +- port->count--; ++ atomic_dec(&port->count); + port->blocked_open++; + spin_unlock_irqrestore(&port->lock, flags); + +@@ -386,7 +386,7 @@ int tty_port_block_til_ready(struct tty_port *port, + we must not mess that up further */ + spin_lock_irqsave(&port->lock, flags); + if (!tty_hung_up_p(filp)) +- port->count++; ++ atomic_inc(&port->count); + port->blocked_open--; + if (retval == 0) + port->flags |= ASYNC_NORMAL_ACTIVE; +@@ -406,19 +406,19 @@ int tty_port_close_start(struct tty_port *port, + return 0; + } + +- if (tty->count == 1 && port->count != 1) { ++ if (tty->count == 1 && atomic_read(&port->count) != 1) { + printk(KERN_WARNING + "tty_port_close_start: tty->count = 1 port count = %d.\n", +- port->count); +- port->count = 1; ++ atomic_read(&port->count)); ++ atomic_set(&port->count, 1); + } +- if (--port->count < 0) { ++ if (atomic_dec_return(&port->count) < 0) { + printk(KERN_WARNING "tty_port_close_start: count = %d\n", +- port->count); +- port->count = 0; ++ atomic_read(&port->count)); ++ atomic_set(&port->count, 0); + } + +- if (port->count) { ++ if (atomic_read(&port->count)) { + spin_unlock_irqrestore(&port->lock, flags); + if (port->ops->drop) + port->ops->drop(port); +@@ -516,7 +516,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty, + { + spin_lock_irq(&port->lock); + if (!tty_hung_up_p(filp)) +- ++port->count; ++ atomic_inc(&port->count); + spin_unlock_irq(&port->lock); + tty_port_tty_set(port, tty); + diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c -index 3b0c4e3..f98a992 100644 +index a9af1b9a..1e08e7f 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c -@@ -663,6 +663,16 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag) +@@ -647,6 +647,16 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag) kbd->kbdmode == VC_OFF) && value != KVAL(K_SAK)) return; /* SAK is allowed even in raw mode */ @@ -38141,7 +43633,7 @@ index 3b0c4e3..f98a992 100644 fn_handler[value](vc); } -@@ -1812,9 +1822,6 @@ int vt_do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, +@@ -1795,9 +1805,6 @@ int vt_do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry))) return -EFAULT; @@ -38151,7 +43643,7 @@ index 3b0c4e3..f98a992 100644 switch (cmd) { case KDGKBENT: /* Ensure another thread doesn't free it under us */ -@@ -1829,6 +1836,9 @@ int vt_do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, +@@ -1812,6 +1819,9 @@ int vt_do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, spin_unlock_irqrestore(&kbd_event_lock, flags); return put_user(val, &user_kbe->kb_value); case KDSKBENT: @@ -38161,7 +43653,7 @@ index 3b0c4e3..f98a992 100644 if (!perm) return -EPERM; if (!i && v == K_NOSUCHMAP) { -@@ -1919,9 +1929,6 @@ int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm) +@@ -1902,9 +1912,6 @@ int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm) int i, j, k; int ret; @@ -38171,7 +43663,7 @@ index 3b0c4e3..f98a992 100644 kbs = kmalloc(sizeof(*kbs), GFP_KERNEL); if (!kbs) { ret = -ENOMEM; -@@ -1955,6 +1962,9 @@ int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm) +@@ -1938,6 +1945,9 @@ int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm) kfree(kbs); return ((p && *p) ? -EOVERFLOW : 0); case KDSKBSENT: @@ -38182,7 +43674,7 @@ index 3b0c4e3..f98a992 100644 ret = -EPERM; goto reterr; diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c -index a783d53..cb30d94 100644 +index c8b9262..7e824e6 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -25,6 +25,7 @@ @@ -38215,7 +43707,7 @@ index a783d53..cb30d94 100644 } static struct device_attribute uio_class_attributes[] = { -@@ -408,7 +409,7 @@ void uio_event_notify(struct uio_info *info) +@@ -397,7 +398,7 @@ void uio_event_notify(struct uio_info *info) { struct uio_device *idev = info->uio_dev; @@ -38224,7 +43716,7 @@ index a783d53..cb30d94 100644 wake_up_interruptible(&idev->wait); kill_fasync(&idev->async_queue, SIGIO, POLL_IN); } -@@ -461,7 +462,7 @@ static int uio_open(struct inode *inode, struct file *filep) +@@ -450,7 +451,7 @@ static int uio_open(struct inode *inode, struct file *filep) } listener->dev = idev; @@ -38233,7 +43725,7 @@ index a783d53..cb30d94 100644 filep->private_data = listener; if (idev->info->open) { -@@ -512,7 +513,7 @@ static unsigned int uio_poll(struct file *filep, poll_table *wait) +@@ -501,7 +502,7 @@ static unsigned int uio_poll(struct file *filep, poll_table *wait) return -EIO; poll_wait(filep, &idev->wait, wait); @@ -38242,7 +43734,7 @@ index a783d53..cb30d94 100644 return POLLIN | POLLRDNORM; return 0; } -@@ -537,7 +538,7 @@ static ssize_t uio_read(struct file *filep, char __user *buf, +@@ -526,7 +527,7 @@ static ssize_t uio_read(struct file *filep, char __user *buf, do { set_current_state(TASK_INTERRUPTIBLE); @@ -38251,7 +43743,7 @@ index a783d53..cb30d94 100644 if (event_count != listener->event_count) { if (copy_to_user(buf, &event_count, count)) retval = -EFAULT; -@@ -606,13 +607,13 @@ static int uio_find_mem_index(struct vm_area_struct *vma) +@@ -595,13 +596,13 @@ static int uio_find_mem_index(struct vm_area_struct *vma) static void uio_vma_open(struct vm_area_struct *vma) { struct uio_device *idev = vma->vm_private_data; @@ -38267,7 +43759,7 @@ index a783d53..cb30d94 100644 } static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) -@@ -821,7 +822,7 @@ int __uio_register_device(struct module *owner, +@@ -808,7 +809,7 @@ int __uio_register_device(struct module *owner, idev->owner = owner; idev->info = info; init_waitqueue_head(&idev->wait); @@ -38277,7 +43769,7 @@ index a783d53..cb30d94 100644 ret = uio_get_minor(idev); if (ret) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c -index 98b89fe..aff824e 100644 +index b7eb86a..36d28af 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c @@ -473,7 +473,7 @@ static ssize_t cxacru_sysfs_store_adsl_config(struct device *dev, @@ -38290,7 +43782,7 @@ index 98b89fe..aff824e 100644 pos += tmp; diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c -index d3448ca..d2864ca 100644 +index 35f10bf..6a38a0b 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -333,7 +333,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char @@ -38328,7 +43820,7 @@ index d3448ca..d2864ca 100644 goto out; } -@@ -387,7 +387,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char +@@ -389,7 +389,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char if (printk_ratelimit()) atm_err(instance, "%s: no memory for skb (length: %u)!\n", __func__, length); @@ -38337,7 +43829,7 @@ index d3448ca..d2864ca 100644 goto out; } -@@ -412,7 +412,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char +@@ -417,7 +417,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char vcc->push(vcc, skb); @@ -38346,7 +43838,7 @@ index d3448ca..d2864ca 100644 out: skb_trim(sarb, 0); } -@@ -615,7 +615,7 @@ static void usbatm_tx_process(unsigned long data) +@@ -623,7 +623,7 @@ static void usbatm_tx_process(unsigned long data) struct atm_vcc *vcc = UDSL_SKB(skb)->atm.vcc; usbatm_pop(vcc, skb); @@ -38355,7 +43847,7 @@ index d3448ca..d2864ca 100644 skb = skb_dequeue(&instance->sndqueue); } -@@ -773,11 +773,11 @@ static int usbatm_atm_proc_read(struct atm_dev *atm_dev, loff_t * pos, char *pag +@@ -779,11 +779,11 @@ static int usbatm_atm_proc_read(struct atm_dev *atm_dev, loff_t * pos, char *pag if (!left--) return sprintf(page, "AAL5: tx %d ( %d err ), rx %d ( %d err, %d drop )\n", @@ -38373,7 +43865,7 @@ index d3448ca..d2864ca 100644 if (!left--) { if (instance->disconnected) diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c -index d956965..4179a77 100644 +index 2a3bbdf..91d72cf 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c @@ -126,7 +126,7 @@ static const char format_endpt[] = @@ -38394,7 +43886,7 @@ index d956965..4179a77 100644 wake_up(&device_event.wait); } -@@ -648,7 +648,7 @@ static unsigned int usb_device_poll(struct file *file, +@@ -652,7 +652,7 @@ static unsigned int usb_device_poll(struct file *file, poll_wait(file, &device_event.wait, wait); @@ -38403,11 +43895,72 @@ index d956965..4179a77 100644 if (file->f_version != event_count) { file->f_version = event_count; return POLLIN | POLLRDNORM; +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c +index f9ec44c..eb5779f 100644 +--- a/drivers/usb/core/hcd.c ++++ b/drivers/usb/core/hcd.c +@@ -1526,7 +1526,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags) + */ + usb_get_urb(urb); + atomic_inc(&urb->use_count); +- atomic_inc(&urb->dev->urbnum); ++ atomic_inc_unchecked(&urb->dev->urbnum); + usbmon_urb_submit(&hcd->self, urb); + + /* NOTE requirements on root-hub callers (usbfs and the hub +@@ -1553,7 +1553,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags) + urb->hcpriv = NULL; + INIT_LIST_HEAD(&urb->urb_list); + atomic_dec(&urb->use_count); +- atomic_dec(&urb->dev->urbnum); ++ atomic_dec_unchecked(&urb->dev->urbnum); + if (atomic_read(&urb->reject)) + wake_up(&usb_kill_urb_queue); + usb_put_urb(urb); +diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c +index 444d30e..f15c850 100644 +--- a/drivers/usb/core/message.c ++++ b/drivers/usb/core/message.c +@@ -129,7 +129,7 @@ static int usb_internal_control_msg(struct usb_device *usb_dev, + * method can wait for it to complete. Since you don't have a handle on the + * URB used, you can't cancel the request. + */ +-int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, ++int __intentional_overflow(-1) usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, + __u8 requesttype, __u16 value, __u16 index, void *data, + __u16 size, int timeout) + { +diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c +index 3f81a3d..a3aa993 100644 +--- a/drivers/usb/core/sysfs.c ++++ b/drivers/usb/core/sysfs.c +@@ -239,7 +239,7 @@ show_urbnum(struct device *dev, struct device_attribute *attr, char *buf) + struct usb_device *udev; + + udev = to_usb_device(dev); +- return sprintf(buf, "%d\n", atomic_read(&udev->urbnum)); ++ return sprintf(buf, "%d\n", atomic_read_unchecked(&udev->urbnum)); + } + static DEVICE_ATTR(urbnum, S_IRUGO, show_urbnum, NULL); + +diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c +index f81b925..78d22ec 100644 +--- a/drivers/usb/core/usb.c ++++ b/drivers/usb/core/usb.c +@@ -388,7 +388,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, + set_dev_node(&dev->dev, dev_to_node(bus->controller)); + dev->state = USB_STATE_ATTACHED; + dev->lpm_disable_count = 1; +- atomic_set(&dev->urbnum, 0); ++ atomic_set_unchecked(&dev->urbnum, 0); + + INIT_LIST_HEAD(&dev->ep0.urb_list); + dev->ep0.desc.bLength = USB_DT_ENDPOINT_SIZE; diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c -index 347bb05..63e1b73 100644 +index 5e29dde..eca992f 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c -@@ -97,7 +97,8 @@ static inline u32 dbgp_len_update(u32 x, u32 len) +@@ -98,7 +98,8 @@ static inline u32 dbgp_len_update(u32 x, u32 len) #ifdef CONFIG_KGDB static struct kgdb_io kgdbdbgp_io_ops; @@ -38417,7 +43970,7 @@ index 347bb05..63e1b73 100644 #else #define dbgp_kgdb_mode (0) #endif -@@ -1035,6 +1036,13 @@ static struct kgdb_io kgdbdbgp_io_ops = { +@@ -1047,6 +1048,13 @@ static struct kgdb_io kgdbdbgp_io_ops = { .write_char = kgdbdbgp_write_char, }; @@ -38431,7 +43984,7 @@ index 347bb05..63e1b73 100644 static int kgdbdbgp_wait_time; static int __init kgdbdbgp_parse_config(char *str) -@@ -1050,8 +1058,10 @@ static int __init kgdbdbgp_parse_config(char *str) +@@ -1062,8 +1070,10 @@ static int __init kgdbdbgp_parse_config(char *str) ptr++; kgdbdbgp_wait_time = simple_strtoul(ptr, &ptr, 10); } @@ -38444,6 +43997,148 @@ index 347bb05..63e1b73 100644 return 0; } +diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c +index b369292..9f3ba40 100644 +--- a/drivers/usb/gadget/u_serial.c ++++ b/drivers/usb/gadget/u_serial.c +@@ -733,9 +733,9 @@ static int gs_open(struct tty_struct *tty, struct file *file) + spin_lock_irq(&port->port_lock); + + /* already open? Great. */ +- if (port->port.count) { ++ if (atomic_read(&port->port.count)) { + status = 0; +- port->port.count++; ++ atomic_inc(&port->port.count); + + /* currently opening/closing? wait ... */ + } else if (port->openclose) { +@@ -794,7 +794,7 @@ static int gs_open(struct tty_struct *tty, struct file *file) + tty->driver_data = port; + port->port.tty = tty; + +- port->port.count = 1; ++ atomic_set(&port->port.count, 1); + port->openclose = false; + + /* if connected, start the I/O stream */ +@@ -836,11 +836,11 @@ static void gs_close(struct tty_struct *tty, struct file *file) + + spin_lock_irq(&port->port_lock); + +- if (port->port.count != 1) { +- if (port->port.count == 0) ++ if (atomic_read(&port->port.count) != 1) { ++ if (atomic_read(&port->port.count) == 0) + WARN_ON(1); + else +- --port->port.count; ++ atomic_dec(&port->port.count); + goto exit; + } + +@@ -850,7 +850,7 @@ static void gs_close(struct tty_struct *tty, struct file *file) + * and sleep if necessary + */ + port->openclose = true; +- port->port.count = 0; ++ atomic_set(&port->port.count, 0); + + gser = port->port_usb; + if (gser && gser->disconnect) +@@ -1066,7 +1066,7 @@ static int gs_closed(struct gs_port *port) + int cond; + + spin_lock_irq(&port->port_lock); +- cond = (port->port.count == 0) && !port->openclose; ++ cond = (atomic_read(&port->port.count) == 0) && !port->openclose; + spin_unlock_irq(&port->port_lock); + return cond; + } +@@ -1209,7 +1209,7 @@ int gserial_connect(struct gserial *gser, u8 port_num) + /* if it's already open, start I/O ... and notify the serial + * protocol about open/close status (connect/disconnect). + */ +- if (port->port.count) { ++ if (atomic_read(&port->port.count)) { + pr_debug("gserial_connect: start ttyGS%d\n", port->port_num); + gs_start_io(port); + if (gser->connect) +@@ -1256,7 +1256,7 @@ void gserial_disconnect(struct gserial *gser) + + port->port_usb = NULL; + gser->ioport = NULL; +- if (port->port.count > 0 || port->openclose) { ++ if (atomic_read(&port->port.count) > 0 || port->openclose) { + wake_up_interruptible(&port->drain_wait); + if (port->port.tty) + tty_hangup(port->port.tty); +@@ -1272,7 +1272,7 @@ void gserial_disconnect(struct gserial *gser) + + /* finally, free any unused/unusable I/O buffers */ + spin_lock_irqsave(&port->port_lock, flags); +- if (port->port.count == 0 && !port->openclose) ++ if (atomic_read(&port->port.count) == 0 && !port->openclose) + gs_buf_free(&port->port_write_buf); + gs_free_requests(gser->out, &port->read_pool, NULL); + gs_free_requests(gser->out, &port->read_queue, NULL); +diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c +index 5f3bcd3..bfca43f 100644 +--- a/drivers/usb/serial/console.c ++++ b/drivers/usb/serial/console.c +@@ -124,7 +124,7 @@ static int usb_console_setup(struct console *co, char *options) + + info->port = port; + +- ++port->port.count; ++ atomic_inc(&port->port.count); + if (!test_bit(ASYNCB_INITIALIZED, &port->port.flags)) { + if (serial->type->set_termios) { + /* +@@ -174,7 +174,7 @@ static int usb_console_setup(struct console *co, char *options) + } + /* Now that any required fake tty operations are completed restore + * the tty port count */ +- --port->port.count; ++ atomic_dec(&port->port.count); + /* The console is special in terms of closing the device so + * indicate this port is now acting as a system console. */ + port->port.console = 1; +@@ -187,7 +187,7 @@ static int usb_console_setup(struct console *co, char *options) + free_tty: + kfree(tty); + reset_open_count: +- port->port.count = 0; ++ atomic_set(&port->port.count, 0); + usb_autopm_put_interface(serial->interface); + error_get_interface: + usb_serial_put(serial); +diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c +index 6c3586a..a94e621 100644 +--- a/drivers/usb/storage/realtek_cr.c ++++ b/drivers/usb/storage/realtek_cr.c +@@ -429,7 +429,7 @@ static int rts51x_read_status(struct us_data *us, + + buf = kmalloc(len, GFP_NOIO); + if (buf == NULL) +- return USB_STOR_TRANSPORT_ERROR; ++ return -ENOMEM; + + US_DEBUGP("%s, lun = %d\n", __func__, lun); + +diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h +index 75f70f0..d467e1a 100644 +--- a/drivers/usb/storage/usb.h ++++ b/drivers/usb/storage/usb.h +@@ -63,7 +63,7 @@ struct us_unusual_dev { + __u8 useProtocol; + __u8 useTransport; + int (*initFunction)(struct us_data *); +-}; ++} __do_const; + + + /* Dynamic bitflag definitions (us->dflags): used in set_bit() etc. */ diff --git a/drivers/usb/wusbcore/wa-hc.h b/drivers/usb/wusbcore/wa-hc.h index d6bea3e..60b250e 100644 --- a/drivers/usb/wusbcore/wa-hc.h @@ -38467,7 +44162,7 @@ index d6bea3e..60b250e 100644 /** diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c -index 57c01ab..8a05959 100644 +index 6ef94bc..1b41265 100644 --- a/drivers/usb/wusbcore/wa-xfer.c +++ b/drivers/usb/wusbcore/wa-xfer.c @@ -296,7 +296,7 @@ out: @@ -38479,32 +44174,100 @@ index 57c01ab..8a05959 100644 } /* -diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c -index 51e4c1e..9d87e2a 100644 ---- a/drivers/vhost/vhost.c -+++ b/drivers/vhost/vhost.c -@@ -632,7 +632,7 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m) - return 0; - } - --static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) -+static long vhost_set_vring(struct vhost_dev *d, unsigned int ioctl, void __user *argp) - { - struct file *eventfp, *filep = NULL, - *pollstart = NULL, *pollstop = NULL; diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c -index b0b2ac3..89a4399 100644 +index 8c55011..eed4ae1a 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c -@@ -148,7 +148,7 @@ enum { +@@ -149,7 +149,7 @@ enum { }; /* Must match above enum */ --static const char *r128_family[] __devinitdata = { -+static const char *r128_family[] __devinitconst = { +-static char * const r128_family[] = { ++static const char * const r128_family[] = { "AGP", "PCI", "PRO AGP", +diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c +index 4f27fdc..d3537e6 100644 +--- a/drivers/video/aty/atyfb_base.c ++++ b/drivers/video/aty/atyfb_base.c +@@ -1325,10 +1325,14 @@ static int atyfb_set_par(struct fb_info *info) + par->accel_flags = var->accel_flags; /* hack */ + + if (var->accel_flags) { +- info->fbops->fb_sync = atyfb_sync; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_sync = atyfb_sync; ++ pax_close_kernel(); + info->flags &= ~FBINFO_HWACCEL_DISABLED; + } else { +- info->fbops->fb_sync = NULL; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_sync = NULL; ++ pax_close_kernel(); + info->flags |= FBINFO_HWACCEL_DISABLED; + } + +diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c +index 95ec042..e6affdd 100644 +--- a/drivers/video/aty/mach64_cursor.c ++++ b/drivers/video/aty/mach64_cursor.c +@@ -7,6 +7,7 @@ + #include <linux/string.h> + + #include <asm/io.h> ++#include <asm/pgtable.h> + + #ifdef __sparc__ + #include <asm/fbio.h> +@@ -208,7 +209,9 @@ int aty_init_cursor(struct fb_info *info) + info->sprite.buf_align = 16; /* and 64 lines tall. */ + info->sprite.flags = FB_PIXMAP_IO; + +- info->fbops->fb_cursor = atyfb_cursor; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_cursor = atyfb_cursor; ++ pax_close_kernel(); + + return 0; + } +diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c +index 6c5ed6b..b727c88 100644 +--- a/drivers/video/backlight/kb3886_bl.c ++++ b/drivers/video/backlight/kb3886_bl.c +@@ -78,7 +78,7 @@ static struct kb3886bl_machinfo *bl_machinfo; + static unsigned long kb3886bl_flags; + #define KB3886BL_SUSPENDED 0x01 + +-static struct dmi_system_id __initdata kb3886bl_device_table[] = { ++static const struct dmi_system_id __initconst kb3886bl_device_table[] = { + { + .ident = "Sahara Touch-iT", + .matches = { +diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c +index 900aa4e..6d49418 100644 +--- a/drivers/video/fb_defio.c ++++ b/drivers/video/fb_defio.c +@@ -206,7 +206,9 @@ void fb_deferred_io_init(struct fb_info *info) + + BUG_ON(!fbdefio); + mutex_init(&fbdefio->lock); +- info->fbops->fb_mmap = fb_deferred_io_mmap; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_mmap = fb_deferred_io_mmap; ++ pax_close_kernel(); + INIT_DELAYED_WORK(&info->deferred_work, fb_deferred_io_work); + INIT_LIST_HEAD(&fbdefio->pagelist); + if (fbdefio->delay == 0) /* set a default of 1 s */ +@@ -237,7 +239,7 @@ void fb_deferred_io_cleanup(struct fb_info *info) + page->mapping = NULL; + } + +- info->fbops->fb_mmap = NULL; ++ *(void **)&info->fbops->fb_mmap = NULL; + mutex_destroy(&fbdefio->lock); + } + EXPORT_SYMBOL_GPL(fb_deferred_io_cleanup); diff --git a/drivers/video/fbcmap.c b/drivers/video/fbcmap.c index 5c3960d..15cf8fc 100644 --- a/drivers/video/fbcmap.c @@ -38520,7 +44283,7 @@ index 5c3960d..15cf8fc 100644 goto out1; } diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c -index c6ce416..3b9b642 100644 +index 86291dc..7cc5962 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -428,7 +428,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, @@ -38541,7 +44304,7 @@ index c6ce416..3b9b642 100644 info->fbops->fb_imageblit(info, image); image->dy -= image->height + 8; } -@@ -1157,7 +1157,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, +@@ -1166,7 +1166,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, return -EFAULT; if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) return -EINVAL; @@ -38550,41 +44313,6 @@ index c6ce416..3b9b642 100644 return -EINVAL; if (!registered_fb[con2fb.framebuffer]) request_module("fb%d", con2fb.framebuffer); -diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c -index 5a5d092..265c5ed 100644 ---- a/drivers/video/geode/gx1fb_core.c -+++ b/drivers/video/geode/gx1fb_core.c -@@ -29,7 +29,7 @@ static int crt_option = 1; - static char panel_option[32] = ""; - - /* Modes relevant to the GX1 (taken from modedb.c) */ --static const struct fb_videomode __devinitdata gx1_modedb[] = { -+static const struct fb_videomode __devinitconst gx1_modedb[] = { - /* 640x480-60 VESA */ - { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, - 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c -index 0fad23f..0e9afa4 100644 ---- a/drivers/video/gxt4500.c -+++ b/drivers/video/gxt4500.c -@@ -156,7 +156,7 @@ struct gxt4500_par { - static char *mode_option; - - /* default mode: 1280x1024 @ 60 Hz, 8 bpp */ --static const struct fb_videomode defaultmode __devinitdata = { -+static const struct fb_videomode defaultmode __devinitconst = { - .refresh = 60, - .xres = 1280, - .yres = 1024, -@@ -581,7 +581,7 @@ static int gxt4500_blank(int blank, struct fb_info *info) - return 0; - } - --static const struct fb_fix_screeninfo gxt4500_fix __devinitdata = { -+static const struct fb_fix_screeninfo gxt4500_fix __devinitconst = { - .id = "IBM GXT4500P", - .type = FB_TYPE_PACKED_PIXELS, - .visual = FB_VISUAL_PSEUDOCOLOR, diff --git a/drivers/video/i810/i810_accel.c b/drivers/video/i810/i810_accel.c index 7672d2e..b56437f 100644 --- a/drivers/video/i810/i810_accel.c @@ -38597,32 +44325,6 @@ index 7672d2e..b56437f 100644 i810_report_error(mmio); par->dev_flags |= LOCKUP; info->pixmap.scan_align = 1; -diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c -index b83f361..2b05a91 100644 ---- a/drivers/video/i810/i810_main.c -+++ b/drivers/video/i810/i810_main.c -@@ -97,7 +97,7 @@ static int i810fb_blank (int blank_mode, struct fb_info *info); - static void i810fb_release_resource (struct fb_info *info, struct i810fb_par *par); - - /* PCI */ --static const char *i810_pci_list[] __devinitdata = { -+static const char *i810_pci_list[] __devinitconst = { - "Intel(R) 810 Framebuffer Device" , - "Intel(R) 810-DC100 Framebuffer Device" , - "Intel(R) 810E Framebuffer Device" , -diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c -index de36693..3c63fc2 100644 ---- a/drivers/video/jz4740_fb.c -+++ b/drivers/video/jz4740_fb.c -@@ -136,7 +136,7 @@ struct jzfb { - uint32_t pseudo_palette[16]; - }; - --static const struct fb_fix_screeninfo jzfb_fix __devinitdata = { -+static const struct fb_fix_screeninfo jzfb_fix __devinitconst = { - .id = "JZ4740 FB", - .type = FB_TYPE_PACKED_PIXELS, - .visual = FB_VISUAL_TRUECOLOR, diff --git a/drivers/video/logo/logo_linux_clut224.ppm b/drivers/video/logo/logo_linux_clut224.ppm index 3c14e43..eafa544 100644 --- a/drivers/video/logo/logo_linux_clut224.ppm @@ -41352,11 +47054,122 @@ index 3c14e43..eafa544 100644 +4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 +4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 +4 4 4 4 4 4 +diff --git a/drivers/video/mb862xx/mb862xxfb_accel.c b/drivers/video/mb862xx/mb862xxfb_accel.c +index fe92eed..106e085 100644 +--- a/drivers/video/mb862xx/mb862xxfb_accel.c ++++ b/drivers/video/mb862xx/mb862xxfb_accel.c +@@ -312,14 +312,18 @@ void mb862xxfb_init_accel(struct fb_info *info, int xres) + struct mb862xxfb_par *par = info->par; + + if (info->var.bits_per_pixel == 32) { +- info->fbops->fb_fillrect = cfb_fillrect; +- info->fbops->fb_copyarea = cfb_copyarea; +- info->fbops->fb_imageblit = cfb_imageblit; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_fillrect = cfb_fillrect; ++ *(void **)&info->fbops->fb_copyarea = cfb_copyarea; ++ *(void **)&info->fbops->fb_imageblit = cfb_imageblit; ++ pax_close_kernel(); + } else { + outreg(disp, GC_L0EM, 3); +- info->fbops->fb_fillrect = mb86290fb_fillrect; +- info->fbops->fb_copyarea = mb86290fb_copyarea; +- info->fbops->fb_imageblit = mb86290fb_imageblit; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_fillrect = mb86290fb_fillrect; ++ *(void **)&info->fbops->fb_copyarea = mb86290fb_copyarea; ++ *(void **)&info->fbops->fb_imageblit = mb86290fb_imageblit; ++ pax_close_kernel(); + } + outreg(draw, GDC_REG_DRAW_BASE, 0); + outreg(draw, GDC_REG_MODE_MISC, 0x8000); +diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c +index ff22871..b129bed 100644 +--- a/drivers/video/nvidia/nvidia.c ++++ b/drivers/video/nvidia/nvidia.c +@@ -669,19 +669,23 @@ static int nvidiafb_set_par(struct fb_info *info) + info->fix.line_length = (info->var.xres_virtual * + info->var.bits_per_pixel) >> 3; + if (info->var.accel_flags) { +- info->fbops->fb_imageblit = nvidiafb_imageblit; +- info->fbops->fb_fillrect = nvidiafb_fillrect; +- info->fbops->fb_copyarea = nvidiafb_copyarea; +- info->fbops->fb_sync = nvidiafb_sync; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_imageblit = nvidiafb_imageblit; ++ *(void **)&info->fbops->fb_fillrect = nvidiafb_fillrect; ++ *(void **)&info->fbops->fb_copyarea = nvidiafb_copyarea; ++ *(void **)&info->fbops->fb_sync = nvidiafb_sync; ++ pax_close_kernel(); + info->pixmap.scan_align = 4; + info->flags &= ~FBINFO_HWACCEL_DISABLED; + info->flags |= FBINFO_READS_FAST; + NVResetGraphics(info); + } else { +- info->fbops->fb_imageblit = cfb_imageblit; +- info->fbops->fb_fillrect = cfb_fillrect; +- info->fbops->fb_copyarea = cfb_copyarea; +- info->fbops->fb_sync = NULL; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_imageblit = cfb_imageblit; ++ *(void **)&info->fbops->fb_fillrect = cfb_fillrect; ++ *(void **)&info->fbops->fb_copyarea = cfb_copyarea; ++ *(void **)&info->fbops->fb_sync = NULL; ++ pax_close_kernel(); + info->pixmap.scan_align = 1; + info->flags |= FBINFO_HWACCEL_DISABLED; + info->flags &= ~FBINFO_READS_FAST; +@@ -1173,8 +1177,11 @@ static int nvidia_set_fbinfo(struct fb_info *info) + info->pixmap.size = 8 * 1024; + info->pixmap.flags = FB_PIXMAP_SYSTEM; + +- if (!hwcur) +- info->fbops->fb_cursor = NULL; ++ if (!hwcur) { ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_cursor = NULL; ++ pax_close_kernel(); ++ } + + info->var.accel_flags = (!noaccel); + +diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c +index 76d9053..dec2bfd 100644 +--- a/drivers/video/s1d13xxxfb.c ++++ b/drivers/video/s1d13xxxfb.c +@@ -881,8 +881,10 @@ static int s1d13xxxfb_probe(struct platform_device *pdev) + + switch(prod_id) { + case S1D13506_PROD_ID: /* activate acceleration */ +- s1d13xxxfb_fbops.fb_fillrect = s1d13xxxfb_bitblt_solidfill; +- s1d13xxxfb_fbops.fb_copyarea = s1d13xxxfb_bitblt_copyarea; ++ pax_open_kernel(); ++ *(void **)&s1d13xxxfb_fbops.fb_fillrect = s1d13xxxfb_bitblt_solidfill; ++ *(void **)&s1d13xxxfb_fbops.fb_copyarea = s1d13xxxfb_bitblt_copyarea; ++ pax_close_kernel(); + info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | + FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA; + break; +diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c +index 97bd662..39fab85 100644 +--- a/drivers/video/smscufx.c ++++ b/drivers/video/smscufx.c +@@ -1171,7 +1171,9 @@ static int ufx_ops_release(struct fb_info *info, int user) + fb_deferred_io_cleanup(info); + kfree(info->fbdefio); + info->fbdefio = NULL; +- info->fbops->fb_mmap = ufx_ops_mmap; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_mmap = ufx_ops_mmap; ++ pax_close_kernel(); + } + + pr_debug("released /dev/fb%d user=%d count=%d", diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c -index a159b63..4ab532d 100644 +index 86d449e..8e04dc5 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c -@@ -620,11 +620,11 @@ int dlfb_handle_damage(struct dlfb_data *dev, int x, int y, +@@ -619,11 +619,11 @@ int dlfb_handle_damage(struct dlfb_data *dev, int x, int y, dlfb_urb_completion(urb); error: @@ -41372,7 +47185,7 @@ index a159b63..4ab532d 100644 >> 10)), /* Kcycles */ &dev->cpu_kcycles_used); -@@ -745,11 +745,11 @@ static void dlfb_dpy_deferred_io(struct fb_info *info, +@@ -744,11 +744,11 @@ static void dlfb_dpy_deferred_io(struct fb_info *info, dlfb_urb_completion(urb); error: @@ -41388,7 +47201,18 @@ index a159b63..4ab532d 100644 >> 10)), /* Kcycles */ &dev->cpu_kcycles_used); } -@@ -1373,7 +1373,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev, +@@ -989,7 +989,9 @@ static int dlfb_ops_release(struct fb_info *info, int user) + fb_deferred_io_cleanup(info); + kfree(info->fbdefio); + info->fbdefio = NULL; +- info->fbops->fb_mmap = dlfb_ops_mmap; ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_mmap = dlfb_ops_mmap; ++ pax_close_kernel(); + } + + pr_warn("released /dev/fb%d user=%d count=%d\n", +@@ -1372,7 +1374,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev, struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dev = fb_info->par; return snprintf(buf, PAGE_SIZE, "%u\n", @@ -41397,7 +47221,7 @@ index a159b63..4ab532d 100644 } static ssize_t metrics_bytes_identical_show(struct device *fbdev, -@@ -1381,7 +1381,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev, +@@ -1380,7 +1382,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev, struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dev = fb_info->par; return snprintf(buf, PAGE_SIZE, "%u\n", @@ -41406,7 +47230,7 @@ index a159b63..4ab532d 100644 } static ssize_t metrics_bytes_sent_show(struct device *fbdev, -@@ -1389,7 +1389,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev, +@@ -1388,7 +1390,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev, struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dev = fb_info->par; return snprintf(buf, PAGE_SIZE, "%u\n", @@ -41415,7 +47239,7 @@ index a159b63..4ab532d 100644 } static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev, -@@ -1397,7 +1397,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev, +@@ -1396,7 +1398,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev, struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dev = fb_info->par; return snprintf(buf, PAGE_SIZE, "%u\n", @@ -41424,7 +47248,7 @@ index a159b63..4ab532d 100644 } static ssize_t edid_show( -@@ -1457,10 +1457,10 @@ static ssize_t metrics_reset_store(struct device *fbdev, +@@ -1456,10 +1458,10 @@ static ssize_t metrics_reset_store(struct device *fbdev, struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dev = fb_info->par; @@ -41440,7 +47264,7 @@ index a159b63..4ab532d 100644 return count; } diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c -index b0e2a42..e2df3ad 100644 +index d428445..79a78df 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -19,6 +19,7 @@ @@ -41451,7 +47275,7 @@ index b0e2a42..e2df3ad 100644 #include <video/edid.h> #include <video/uvesafb.h> #ifdef CONFIG_X86 -@@ -569,10 +570,32 @@ static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task, +@@ -569,10 +570,32 @@ static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task, if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) { par->pmi_setpal = par->ypan = 0; } else { @@ -41484,7 +47308,7 @@ index b0e2a42..e2df3ad 100644 printk(KERN_INFO "uvesafb: protected mode interface info at " "%04x:%04x\n", (u16)task->t.regs.es, (u16)task->t.regs.edi); -@@ -816,13 +839,14 @@ static int __devinit uvesafb_vbe_init(struct fb_info *info) +@@ -817,13 +840,14 @@ static int uvesafb_vbe_init(struct fb_info *info) par->ypan = ypan; if (par->pmi_setpal || par->ypan) { @@ -41501,7 +47325,35 @@ index b0e2a42..e2df3ad 100644 } #else /* The protected mode interface is not available on non-x86. */ -@@ -1836,6 +1860,11 @@ out: +@@ -1457,8 +1481,11 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode) + info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0; + + /* Disable blanking if the user requested so. */ +- if (!blank) +- info->fbops->fb_blank = NULL; ++ if (!blank) { ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_blank = NULL; ++ pax_close_kernel(); ++ } + + /* + * Find out how much IO memory is required for the mode with +@@ -1534,8 +1561,11 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode) + info->flags = FBINFO_FLAG_DEFAULT | + (par->ypan ? FBINFO_HWACCEL_YPAN : 0); + +- if (!par->ypan) +- info->fbops->fb_pan_display = NULL; ++ if (!par->ypan) { ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_pan_display = NULL; ++ pax_close_kernel(); ++ } + } + + static void uvesafb_init_mtrr(struct fb_info *info) +@@ -1836,6 +1866,11 @@ out: if (par->vbe_modes) kfree(par->vbe_modes); @@ -41513,7 +47365,7 @@ index b0e2a42..e2df3ad 100644 framebuffer_release(info); return err; } -@@ -1862,6 +1891,12 @@ static int uvesafb_remove(struct platform_device *dev) +@@ -1862,6 +1897,12 @@ static int uvesafb_remove(struct platform_device *dev) kfree(par->vbe_state_orig); if (par->vbe_state_saved) kfree(par->vbe_state_saved); @@ -41527,7 +47379,7 @@ index b0e2a42..e2df3ad 100644 framebuffer_release(info); diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c -index 501b340..86bd4cf 100644 +index 501b340..d80aa17 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c @@ -9,6 +9,7 @@ @@ -41620,7 +47472,21 @@ index 501b340..86bd4cf 100644 printk(KERN_INFO "vesafb: pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal); if (pmi_base[3]) { printk(KERN_INFO "vesafb: pmi: ports = "); -@@ -488,6 +514,11 @@ static int __init vesafb_probe(struct platform_device *dev) +@@ -472,8 +498,11 @@ static int __init vesafb_probe(struct platform_device *dev) + info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE | + (ypan ? FBINFO_HWACCEL_YPAN : 0); + +- if (!ypan) +- info->fbops->fb_pan_display = NULL; ++ if (!ypan) { ++ pax_open_kernel(); ++ *(void **)&info->fbops->fb_pan_display = NULL; ++ pax_close_kernel(); ++ } + + if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { + err = -ENOMEM; +@@ -488,6 +517,11 @@ static int __init vesafb_probe(struct platform_device *dev) info->node, info->fix.id); return 0; err: @@ -41645,34 +47511,28 @@ index 88714ae..16c2e11 100644 static inline u32 get_pll_internal_frequency(u32 ref_freq, -diff --git a/drivers/xen/xen-pciback/conf_space.h b/drivers/xen/xen-pciback/conf_space.h -index e56c934..fc22f4b 100644 ---- a/drivers/xen/xen-pciback/conf_space.h -+++ b/drivers/xen/xen-pciback/conf_space.h -@@ -44,15 +44,15 @@ struct config_field { - struct { - conf_dword_write write; - conf_dword_read read; -- } dw; -+ } __no_const dw; - struct { - conf_word_write write; - conf_word_read read; -- } w; -+ } __no_const w; - struct { - conf_byte_write write; - conf_byte_read read; -- } b; -+ } __no_const b; - } u; - struct list_head list; - }; +diff --git a/drivers/xen/xenfs/xenstored.c b/drivers/xen/xenfs/xenstored.c +index fef20db..d28b1ab 100644 +--- a/drivers/xen/xenfs/xenstored.c ++++ b/drivers/xen/xenfs/xenstored.c +@@ -24,7 +24,12 @@ static int xsd_release(struct inode *inode, struct file *file) + static int xsd_kva_open(struct inode *inode, struct file *file) + { + file->private_data = (void *)kasprintf(GFP_KERNEL, "0x%p", ++#ifdef CONFIG_GRKERNSEC_HIDESYM ++ NULL); ++#else + xen_store_interface); ++#endif ++ + if (!file->private_data) + return -ENOMEM; + return 0; diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c -index 014c8dd..6f3dfe6 100644 +index d86edc8..40ff2fb 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c -@@ -1303,7 +1303,7 @@ static void *v9fs_vfs_follow_link(struct dentry *dentry, struct nameidata *nd) +@@ -1314,7 +1314,7 @@ static void *v9fs_vfs_follow_link(struct dentry *dentry, struct nameidata *nd) void v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p) { @@ -41682,7 +47542,7 @@ index 014c8dd..6f3dfe6 100644 p9_debug(P9_DEBUG_VFS, " %s %s\n", dentry->d_name.name, IS_ERR(s) ? "<error>" : s); diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt -index e95d1b6..3454244 100644 +index 0efd152..b5802ad 100644 --- a/fs/Kconfig.binfmt +++ b/fs/Kconfig.binfmt @@ -89,7 +89,7 @@ config HAVE_AOUT @@ -41695,10 +47555,10 @@ index e95d1b6..3454244 100644 A.out (Assembler.OUTput) is a set of formats for libraries and executables used in the earliest versions of UNIX. Linux used diff --git a/fs/aio.c b/fs/aio.c -index e7f2fad..15ad8a4 100644 +index 1dc8786..d3b29e8 100644 --- a/fs/aio.c +++ b/fs/aio.c -@@ -118,7 +118,7 @@ static int aio_setup_ring(struct kioctx *ctx) +@@ -111,7 +111,7 @@ static int aio_setup_ring(struct kioctx *ctx) size += sizeof(struct io_event) * nr_events; nr_pages = (size + PAGE_SIZE-1) >> PAGE_SHIFT; @@ -41707,7 +47567,7 @@ index e7f2fad..15ad8a4 100644 return -EINVAL; nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) / sizeof(struct io_event); -@@ -1440,18 +1440,19 @@ static ssize_t aio_fsync(struct kiocb *iocb) +@@ -1375,18 +1375,19 @@ static ssize_t aio_fsync(struct kiocb *iocb) static ssize_t aio_setup_vectored_rw(int type, struct kiocb *kiocb, bool compat) { ssize_t ret; @@ -41719,17 +47579,17 @@ index e7f2fad..15ad8a4 100644 (struct compat_iovec __user *)kiocb->ki_buf, - kiocb->ki_nbytes, 1, &kiocb->ki_inline_vec, + kiocb->ki_nbytes, 1, &iovstack, - &kiocb->ki_iovec, 1); + &kiocb->ki_iovec); else #endif ret = rw_copy_check_uvector(type, (struct iovec __user *)kiocb->ki_buf, - kiocb->ki_nbytes, 1, &kiocb->ki_inline_vec, + kiocb->ki_nbytes, 1, &iovstack, - &kiocb->ki_iovec, 1); + &kiocb->ki_iovec); if (ret < 0) goto out; -@@ -1460,6 +1461,10 @@ static ssize_t aio_setup_vectored_rw(int type, struct kiocb *kiocb, bool compat) +@@ -1395,6 +1396,10 @@ static ssize_t aio_setup_vectored_rw(int type, struct kiocb *kiocb, bool compat) if (ret < 0) goto out; @@ -41741,10 +47601,10 @@ index e7f2fad..15ad8a4 100644 kiocb->ki_cur_seg = 0; /* ki_nbytes/left now reflect bytes instead of segs */ diff --git a/fs/attr.c b/fs/attr.c -index d94d1b6..f9bccd6 100644 +index 1449adb..a2038c2 100644 --- a/fs/attr.c +++ b/fs/attr.c -@@ -99,6 +99,7 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset) +@@ -102,6 +102,7 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset) unsigned long limit; limit = rlimit(RLIMIT_FSIZE); @@ -41753,10 +47613,10 @@ index d94d1b6..f9bccd6 100644 goto out_sig; if (offset > inode->i_sb->s_maxbytes) diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c -index da8876d..9f3e6d8 100644 +index 3db70da..7aeec5b 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c -@@ -61,7 +61,7 @@ static int autofs4_write(struct autofs_sb_info *sbi, +@@ -59,7 +59,7 @@ static int autofs4_write(struct autofs_sb_info *sbi, { unsigned long sigpipe, flags; mm_segment_t fs; @@ -41765,11 +47625,57 @@ index da8876d..9f3e6d8 100644 ssize_t wr = 0; sigpipe = sigismember(¤t->pending.signal, SIGPIPE); +@@ -346,6 +346,10 @@ static int validate_request(struct autofs_wait_queue **wait, + return 1; + } + ++#ifdef CONFIG_GRKERNSEC_HIDESYM ++static atomic_unchecked_t autofs_dummy_name_id = ATOMIC_INIT(0); ++#endif ++ + int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, + enum autofs_notify notify) + { +@@ -379,7 +383,12 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, + + /* If this is a direct mount request create a dummy name */ + if (IS_ROOT(dentry) && autofs_type_trigger(sbi->type)) ++#ifdef CONFIG_GRKERNSEC_HIDESYM ++ /* this name does get written to userland via autofs4_write() */ ++ qstr.len = sprintf(name, "%08x", atomic_inc_return_unchecked(&autofs_dummy_name_id)); ++#else + qstr.len = sprintf(name, "%p", dentry); ++#endif + else { + qstr.len = autofs4_getpath(sbi, dentry, &name); + if (!qstr.len) { +diff --git a/fs/befs/endian.h b/fs/befs/endian.h +index 2722387..c8dd2a7 100644 +--- a/fs/befs/endian.h ++++ b/fs/befs/endian.h +@@ -11,7 +11,7 @@ + + #include <asm/byteorder.h> + +-static inline u64 ++static inline u64 __intentional_overflow(-1) + fs64_to_cpu(const struct super_block *sb, fs64 n) + { + if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) +@@ -29,7 +29,7 @@ cpu_to_fs64(const struct super_block *sb, u64 n) + return (__force fs64)cpu_to_be64(n); + } + +-static inline u32 ++static inline u32 __intentional_overflow(-1) + fs32_to_cpu(const struct super_block *sb, fs32 n) + { + if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c -index e18da23..affc30e 100644 +index 8615ee8..388ed68 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c -@@ -502,7 +502,7 @@ static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p) +@@ -510,7 +510,7 @@ static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p) { befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); if (befs_ino->i_flags & BEFS_LONG_SYMLINK) { @@ -41779,7 +47685,7 @@ index e18da23..affc30e 100644 kfree(link); } diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c -index d146e18..12d1bd1 100644 +index bbc8f88..7c7ac97 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c @@ -16,6 +16,7 @@ @@ -41790,7 +47696,7 @@ index d146e18..12d1bd1 100644 #include <linux/stat.h> #include <linux/fcntl.h> #include <linux/ptrace.h> -@@ -83,6 +84,8 @@ static int aout_core_dump(struct coredump_params *cprm) +@@ -59,6 +60,8 @@ static int aout_core_dump(struct coredump_params *cprm) #endif # define START_STACK(u) ((void __user *)u.start_stack) @@ -41799,7 +47705,7 @@ index d146e18..12d1bd1 100644 fs = get_fs(); set_fs(KERNEL_DS); has_dumped = 1; -@@ -94,10 +97,12 @@ static int aout_core_dump(struct coredump_params *cprm) +@@ -70,10 +73,12 @@ static int aout_core_dump(struct coredump_params *cprm) /* If the size of the dump file exceeds the rlimit, then see what would happen if we wrote the stack, but not the data area. */ @@ -41812,7 +47718,7 @@ index d146e18..12d1bd1 100644 if ((dump.u_ssize + 1) * PAGE_SIZE > cprm->limit) dump.u_ssize = 0; -@@ -231,6 +236,8 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) +@@ -234,6 +239,8 @@ static int load_aout_binary(struct linux_binprm * bprm) rlim = rlimit(RLIMIT_DATA); if (rlim >= RLIM_INFINITY) rlim = ~0; @@ -41821,7 +47727,7 @@ index d146e18..12d1bd1 100644 if (ex.a_data + ex.a_bss > rlim) return -ENOMEM; -@@ -265,6 +272,27 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) +@@ -268,6 +275,27 @@ static int load_aout_binary(struct linux_binprm * bprm) install_exec_creds(bprm); @@ -41849,7 +47755,7 @@ index d146e18..12d1bd1 100644 if (N_MAGIC(ex) == OMAGIC) { unsigned long text_addr, map_size; loff_t pos; -@@ -330,7 +358,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) +@@ -333,7 +361,7 @@ static int load_aout_binary(struct linux_binprm * bprm) } error = vm_mmap(bprm->file, N_DATADDR(ex), ex.a_data, @@ -41859,18 +47765,18 @@ index d146e18..12d1bd1 100644 fd_offset + ex.a_text); if (error != N_DATADDR(ex)) { diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c -index 16f7354..7cc1e24 100644 +index 86af964..8a1da7e 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c -@@ -32,6 +32,7 @@ - #include <linux/elf.h> +@@ -34,6 +34,7 @@ #include <linux/utsname.h> #include <linux/coredump.h> + #include <linux/sched.h> +#include <linux/xattr.h> #include <asm/uaccess.h> #include <asm/param.h> #include <asm/page.h> -@@ -52,6 +53,10 @@ static int elf_core_dump(struct coredump_params *cprm); +@@ -60,6 +61,10 @@ static int elf_core_dump(struct coredump_params *cprm); #define elf_core_dump NULL #endif @@ -41881,7 +47787,7 @@ index 16f7354..7cc1e24 100644 #if ELF_EXEC_PAGESIZE > PAGE_SIZE #define ELF_MIN_ALIGN ELF_EXEC_PAGESIZE #else -@@ -71,6 +76,11 @@ static struct linux_binfmt elf_format = { +@@ -79,6 +84,11 @@ static struct linux_binfmt elf_format = { .load_binary = load_elf_binary, .load_shlib = load_elf_library, .core_dump = elf_core_dump, @@ -41893,7 +47799,7 @@ index 16f7354..7cc1e24 100644 .min_coredump = ELF_EXEC_PAGESIZE, }; -@@ -78,6 +88,8 @@ static struct linux_binfmt elf_format = { +@@ -86,6 +96,8 @@ static struct linux_binfmt elf_format = { static int set_brk(unsigned long start, unsigned long end) { @@ -41902,7 +47808,7 @@ index 16f7354..7cc1e24 100644 start = ELF_PAGEALIGN(start); end = ELF_PAGEALIGN(end); if (end > start) { -@@ -86,7 +98,7 @@ static int set_brk(unsigned long start, unsigned long end) +@@ -94,7 +106,7 @@ static int set_brk(unsigned long start, unsigned long end) if (BAD_ADDR(addr)) return addr; } @@ -41911,7 +47817,7 @@ index 16f7354..7cc1e24 100644 return 0; } -@@ -147,12 +159,13 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, +@@ -155,12 +167,13 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, elf_addr_t __user *u_rand_bytes; const char *k_platform = ELF_PLATFORM; const char *k_base_platform = ELF_BASE_PLATFORM; @@ -41926,7 +47832,7 @@ index 16f7354..7cc1e24 100644 /* * In some cases (e.g. Hyper-Threading), we want to avoid L1 -@@ -194,8 +207,12 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, +@@ -202,8 +215,12 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, * Generate 16 random bytes for userspace PRNG seeding. */ get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes)); @@ -41941,7 +47847,7 @@ index 16f7354..7cc1e24 100644 if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes))) return -EFAULT; -@@ -307,9 +324,11 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, +@@ -315,9 +332,11 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, return -EFAULT; current->mm->env_end = p; @@ -41954,7 +47860,13 @@ index 16f7354..7cc1e24 100644 return -EFAULT; return 0; } -@@ -380,10 +399,10 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, +@@ -385,15 +404,14 @@ static unsigned long total_mapping_size(struct elf_phdr *cmds, int nr) + an ELF header */ + + static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, +- struct file *interpreter, unsigned long *interp_map_addr, +- unsigned long no_base) ++ struct file *interpreter, unsigned long no_base) { struct elf_phdr *elf_phdata; struct elf_phdr *eppnt; @@ -41967,7 +47879,7 @@ index 16f7354..7cc1e24 100644 unsigned long total_size; int retval, i, size; -@@ -429,6 +448,11 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, +@@ -439,6 +457,11 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, goto out_close; } @@ -41979,7 +47891,16 @@ index 16f7354..7cc1e24 100644 eppnt = elf_phdata; for (i = 0; i < interp_elf_ex->e_phnum; i++, eppnt++) { if (eppnt->p_type == PT_LOAD) { -@@ -472,8 +496,8 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, +@@ -462,8 +485,6 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, + map_addr = elf_map(interpreter, load_addr + vaddr, + eppnt, elf_prot, elf_type, total_size); + total_size = 0; +- if (!*interp_map_addr) +- *interp_map_addr = map_addr; + error = map_addr; + if (BAD_ADDR(map_addr)) + goto out_close; +@@ -482,8 +503,8 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, k = load_addr + eppnt->p_vaddr; if (BAD_ADDR(k) || eppnt->p_filesz > eppnt->p_memsz || @@ -41990,7 +47911,7 @@ index 16f7354..7cc1e24 100644 error = -ENOMEM; goto out_close; } -@@ -525,6 +549,311 @@ out: +@@ -535,6 +556,315 @@ out: return error; } @@ -42011,7 +47932,7 @@ index 16f7354..7cc1e24 100644 +#endif + +#ifdef CONFIG_PAX_EMUTRAMP -+ if (elf_phdata->p_flags & PF_EMUTRAMP) ++ if ((elf_phdata->p_flags & PF_EMUTRAMP) && (pax_flags & (MF_PAX_PAGEEXEC | MF_PAX_SEGMEXEC))) + pax_flags |= MF_PAX_EMUTRAMP; +#endif + @@ -42220,11 +48141,11 @@ index 16f7354..7cc1e24 100644 + +#ifdef CONFIG_PAX_XATTR_PAX_FLAGS + ssize_t xattr_size, i; -+ unsigned char xattr_value[5]; ++ unsigned char xattr_value[sizeof("pemrs") - 1]; + unsigned long pax_flags_hardmode = 0UL, pax_flags_softmode = 0UL; + -+ xattr_size = vfs_getxattr(file->f_path.dentry, XATTR_NAME_PAX_FLAGS, xattr_value, sizeof xattr_value); -+ if (xattr_size <= 0) ++ xattr_size = pax_getxattr(file->f_path.dentry, xattr_value, sizeof xattr_value); ++ if (xattr_size <= 0 || xattr_size > sizeof xattr_value) + return ~0UL; + + for (i = 0; i < xattr_size; i++) @@ -42234,9 +48155,13 @@ index 16f7354..7cc1e24 100644 + +#define parse_flag(option1, option2, flag) \ + case option1: \ ++ if (pax_flags_hardmode & MF_PAX_##flag) \ ++ return ~0UL; \ + pax_flags_hardmode |= MF_PAX_##flag; \ + break; \ + case option2: \ ++ if (pax_flags_softmode & MF_PAX_##flag) \ ++ return ~0UL; \ + pax_flags_softmode |= MF_PAX_##flag; \ + break; + @@ -42302,19 +48227,19 @@ index 16f7354..7cc1e24 100644 /* * These are the functions used to load ELF style executables and shared * libraries. There is no binary dependent code anywhere else. -@@ -541,6 +870,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top) +@@ -551,6 +881,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top) { unsigned int random_variable = 0; +#ifdef CONFIG_PAX_RANDUSTACK -+ if (randomize_va_space) ++ if (current->mm->pax_flags & MF_PAX_RANDMMAP) + return stack_top - current->mm->delta_stack; +#endif + if ((current->flags & PF_RANDOMIZE) && !(current->personality & ADDR_NO_RANDOMIZE)) { random_variable = get_random_int() & STACK_RND_MASK; -@@ -559,7 +893,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) +@@ -569,7 +904,7 @@ static int load_elf_binary(struct linux_binprm *bprm) unsigned long load_addr = 0, load_bias = 0; int load_addr_set = 0; char * elf_interpreter = NULL; @@ -42323,11 +48248,12 @@ index 16f7354..7cc1e24 100644 struct elf_phdr *elf_ppnt, *elf_phdata; unsigned long elf_bss, elf_brk; int retval, i; -@@ -569,11 +903,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) +@@ -579,12 +914,12 @@ static int load_elf_binary(struct linux_binprm *bprm) unsigned long start_code, end_code, start_data, end_data; unsigned long reloc_func_desc __maybe_unused = 0; int executable_stack = EXSTACK_DEFAULT; - unsigned long def_flags = 0; + struct pt_regs *regs = current_pt_regs(); struct { struct elfhdr elf_ex; struct elfhdr interp_elf_ex; @@ -42336,7 +48262,7 @@ index 16f7354..7cc1e24 100644 loc = kmalloc(sizeof(*loc), GFP_KERNEL); if (!loc) { -@@ -709,11 +1043,81 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) +@@ -720,11 +1055,81 @@ static int load_elf_binary(struct linux_binprm *bprm) goto out_free_dentry; /* OK, This is the point of no return */ @@ -42378,7 +48304,7 @@ index 16f7354..7cc1e24 100644 +#ifdef CONFIG_ARCH_TRACK_EXEC_LIMIT + if ((current->mm->pax_flags & MF_PAX_PAGEEXEC) && !(__supported_pte_mask & _PAGE_NX)) { + current->mm->context.user_cs_limit = PAGE_SIZE; -+ current->mm->def_flags |= VM_PAGEEXEC; ++ current->mm->def_flags |= VM_PAGEEXEC | VM_NOHUGEPAGE; + } +#endif + @@ -42419,7 +48345,7 @@ index 16f7354..7cc1e24 100644 if (elf_read_implies_exec(loc->elf_ex, executable_stack)) current->personality |= READ_IMPLIES_EXEC; -@@ -804,6 +1208,20 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) +@@ -815,6 +1220,20 @@ static int load_elf_binary(struct linux_binprm *bprm) #else load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr); #endif @@ -42440,7 +48366,7 @@ index 16f7354..7cc1e24 100644 } error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, -@@ -836,9 +1254,9 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) +@@ -847,9 +1266,9 @@ static int load_elf_binary(struct linux_binprm *bprm) * allowed task size. Note that p_filesz must always be * <= p_memsz so it is only necessary to check p_memsz. */ @@ -42453,7 +48379,7 @@ index 16f7354..7cc1e24 100644 /* set_brk can never work. Avoid overflows. */ send_sig(SIGKILL, current, 0); retval = -EINVAL; -@@ -877,10 +1295,39 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) +@@ -888,17 +1307,45 @@ static int load_elf_binary(struct linux_binprm *bprm) goto out_free_dentry; } if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) { @@ -42465,23 +48391,25 @@ index 16f7354..7cc1e24 100644 + * file specifies odd protections. So + * we don't check the return value + */ -+ } -+ + } + +#ifdef CONFIG_PAX_RANDMMAP + if (current->mm->pax_flags & MF_PAX_RANDMMAP) { -+ unsigned long start, size; ++ unsigned long start, size, flags; ++ vm_flags_t vm_flags; + + start = ELF_PAGEALIGN(elf_brk); + size = PAGE_SIZE + ((pax_get_random_long() & ((1UL << 22) - 1UL)) << 4); ++ flags = MAP_FIXED | MAP_PRIVATE; ++ vm_flags = VM_DONTEXPAND | VM_DONTDUMP; ++ + down_write(¤t->mm->mmap_sem); ++ start = get_unmapped_area(NULL, start, PAGE_ALIGN(size), 0, flags); + retval = -ENOMEM; -+ if (!find_vma_intersection(current->mm, start, start + size + PAGE_SIZE)) { -+ unsigned long prot = PROT_NONE; -+ -+ current->mm->brk_gap = PAGE_ALIGN(size) >> PAGE_SHIFT; ++ if (!IS_ERR_VALUE(start) && !find_vma_intersection(current->mm, start, start + size + PAGE_SIZE)) { +// if (current->personality & ADDR_NO_RANDOMIZE) -+// prot = PROT_READ; -+ start = do_mmap(NULL, start, size, prot, MAP_ANONYMOUS | MAP_FIXED | MAP_PRIVATE, 0); ++// vm_flags |= VM_READ | VM_MAYREAD; ++ start = mmap_region(NULL, start, PAGE_ALIGN(size), vm_flags, 0); + retval = IS_ERR_VALUE(start) ? start : 0; + } + up_write(¤t->mm->mmap_sem); @@ -42491,12 +48419,19 @@ index 16f7354..7cc1e24 100644 + send_sig(SIGKILL, current, 0); + goto out_free_dentry; + } - } ++ } +#endif - ++ if (elf_interpreter) { - unsigned long uninitialized_var(interp_map_addr); -@@ -1109,7 +1556,7 @@ static bool always_dump_vma(struct vm_area_struct *vma) +- unsigned long interp_map_addr = 0; +- + elf_entry = load_elf_interp(&loc->interp_elf_ex, + interpreter, +- &interp_map_addr, + load_bias); + if (!IS_ERR((void *)elf_entry)) { + /* +@@ -1120,7 +1567,7 @@ static bool always_dump_vma(struct vm_area_struct *vma) * Decide what to dump of a segment, part, all or none. */ static unsigned long vma_dump_size(struct vm_area_struct *vma, @@ -42505,7 +48440,7 @@ index 16f7354..7cc1e24 100644 { #define FILTER(type) (mm_flags & (1UL << MMF_DUMP_##type)) -@@ -1146,7 +1593,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, +@@ -1158,7 +1605,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, if (vma->vm_file == NULL) return 0; @@ -42514,7 +48449,7 @@ index 16f7354..7cc1e24 100644 goto whole; /* -@@ -1368,9 +1815,9 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm) +@@ -1383,9 +1830,9 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm) { elf_addr_t *auxv = (elf_addr_t *) mm->saved_auxv; int i = 0; @@ -42526,7 +48461,7 @@ index 16f7354..7cc1e24 100644 fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv); } -@@ -1892,14 +2339,14 @@ static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, +@@ -2015,14 +2462,14 @@ static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, } static size_t elf_core_vma_data_size(struct vm_area_struct *gate_vma, @@ -42539,11 +48474,11 @@ index 16f7354..7cc1e24 100644 for (vma = first_vma(current, gate_vma); vma != NULL; vma = next_vma(vma, gate_vma)) - size += vma_dump_size(vma, mm_flags); -+ size += vma_dump_size(vma, cprm->mm_flags, cprm->signr); ++ size += vma_dump_size(vma, cprm->mm_flags, cprm->siginfo->si_signo); return size; } -@@ -1993,7 +2440,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2116,7 +2563,7 @@ static int elf_core_dump(struct coredump_params *cprm) dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE); @@ -42552,7 +48487,7 @@ index 16f7354..7cc1e24 100644 offset += elf_core_extra_data_size(); e_shoff = offset; -@@ -2007,10 +2454,12 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2130,10 +2577,12 @@ static int elf_core_dump(struct coredump_params *cprm) offset = dataoff; size += sizeof(*elf); @@ -42565,16 +48500,16 @@ index 16f7354..7cc1e24 100644 if (size > cprm->limit || !dump_write(cprm->file, phdr4note, sizeof(*phdr4note))) goto end_coredump; -@@ -2024,7 +2473,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2147,7 +2596,7 @@ static int elf_core_dump(struct coredump_params *cprm) phdr.p_offset = offset; phdr.p_vaddr = vma->vm_start; phdr.p_paddr = 0; - phdr.p_filesz = vma_dump_size(vma, cprm->mm_flags); -+ phdr.p_filesz = vma_dump_size(vma, cprm->mm_flags, cprm->signr); ++ phdr.p_filesz = vma_dump_size(vma, cprm->mm_flags, cprm->siginfo->si_signo); phdr.p_memsz = vma->vm_end - vma->vm_start; offset += phdr.p_filesz; phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0; -@@ -2035,6 +2484,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2158,6 +2607,7 @@ static int elf_core_dump(struct coredump_params *cprm) phdr.p_align = ELF_EXEC_PAGESIZE; size += sizeof(phdr); @@ -42582,16 +48517,16 @@ index 16f7354..7cc1e24 100644 if (size > cprm->limit || !dump_write(cprm->file, &phdr, sizeof(phdr))) goto end_coredump; -@@ -2059,7 +2509,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2182,7 +2632,7 @@ static int elf_core_dump(struct coredump_params *cprm) unsigned long addr; unsigned long end; - end = vma->vm_start + vma_dump_size(vma, cprm->mm_flags); -+ end = vma->vm_start + vma_dump_size(vma, cprm->mm_flags, cprm->signr); ++ end = vma->vm_start + vma_dump_size(vma, cprm->mm_flags, cprm->siginfo->si_signo); for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) { struct page *page; -@@ -2068,6 +2518,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2191,6 +2641,7 @@ static int elf_core_dump(struct coredump_params *cprm) page = get_dump_page(addr); if (page) { void *kaddr = kmap(page); @@ -42599,7 +48534,7 @@ index 16f7354..7cc1e24 100644 stop = ((size += PAGE_SIZE) > cprm->limit) || !dump_write(cprm->file, kaddr, PAGE_SIZE); -@@ -2085,6 +2536,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2208,6 +2659,7 @@ static int elf_core_dump(struct coredump_params *cprm) if (e_phnum == PN_XNUM) { size += sizeof(*shdr4extnum); @@ -42607,7 +48542,7 @@ index 16f7354..7cc1e24 100644 if (size > cprm->limit || !dump_write(cprm->file, shdr4extnum, sizeof(*shdr4extnum))) -@@ -2105,6 +2557,97 @@ out: +@@ -2228,6 +2680,97 @@ out: #endif /* CONFIG_ELF_CORE */ @@ -42706,7 +48641,7 @@ index 16f7354..7cc1e24 100644 { register_binfmt(&elf_format); diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c -index 6b2daf9..a70dccb 100644 +index 2036d21..b0430d0 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c @@ -562,7 +562,9 @@ static int load_flat_file(struct linux_binprm * bprm, @@ -42714,7 +48649,7 @@ index 6b2daf9..a70dccb 100644 printk("Unable to allocate RAM for process data, errno %d\n", (int)-realdatastart); + down_write(¤t->mm->mmap_sem); - do_munmap(current->mm, textpos, text_len); + vm_munmap(textpos, text_len); + up_write(¤t->mm->mmap_sem); ret = realdatastart; goto err; @@ -42724,8 +48659,8 @@ index 6b2daf9..a70dccb 100644 if (IS_ERR_VALUE(result)) { printk("Unable to read data+bss, errno %d\n", (int)-result); + down_write(¤t->mm->mmap_sem); - do_munmap(current->mm, textpos, text_len); - do_munmap(current->mm, realdatastart, len); + vm_munmap(textpos, text_len); + vm_munmap(realdatastart, len); + up_write(¤t->mm->mmap_sem); ret = result; goto err; @@ -42735,17 +48670,17 @@ index 6b2daf9..a70dccb 100644 if (IS_ERR_VALUE(result)) { printk("Unable to read code+data+bss, errno %d\n",(int)-result); + down_write(¤t->mm->mmap_sem); - do_munmap(current->mm, textpos, text_len + data_len + extra + + vm_munmap(textpos, text_len + data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long)); + up_write(¤t->mm->mmap_sem); ret = result; goto err; } diff --git a/fs/bio.c b/fs/bio.c -index 84da885..bac1d48 100644 +index b96fc6c..431d628 100644 --- a/fs/bio.c +++ b/fs/bio.c -@@ -838,7 +838,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q, +@@ -818,7 +818,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q, /* * Overflow, abort */ @@ -42754,7 +48689,7 @@ index 84da885..bac1d48 100644 return ERR_PTR(-EINVAL); nr_pages += end - start; -@@ -972,7 +972,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q, +@@ -952,7 +952,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q, /* * Overflow, abort */ @@ -42763,7 +48698,7 @@ index 84da885..bac1d48 100644 return ERR_PTR(-EINVAL); nr_pages += end - start; -@@ -1234,7 +1234,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err) +@@ -1214,7 +1214,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err) const int read = bio_data_dir(bio) == READ; struct bio_map_data *bmd = bio->bi_private; int i; @@ -42773,10 +48708,10 @@ index 84da885..bac1d48 100644 __bio_for_each_segment(bvec, bio, i, 0) { char *addr = page_address(bvec->bv_page); diff --git a/fs/block_dev.c b/fs/block_dev.c -index ba11c30..623d736 100644 +index aae187a..fd790ba 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c -@@ -704,7 +704,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole, +@@ -652,7 +652,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole, else if (bdev->bd_contains == bdev) return true; /* is a whole device which isn't held */ @@ -42785,24 +48720,11 @@ index ba11c30..623d736 100644 return true; /* is a partition of a device that is being partitioned */ else if (whole->bd_holder != NULL) return false; /* is a partition of a held device */ -diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c -index c053e90..e5f1afc 100644 ---- a/fs/btrfs/check-integrity.c -+++ b/fs/btrfs/check-integrity.c -@@ -156,7 +156,7 @@ struct btrfsic_block { - union { - bio_end_io_t *bio; - bh_end_io_t *bh; -- } orig_bio_bh_end_io; -+ } __no_const orig_bio_bh_end_io; - int submit_bio_bh_rw; - u64 flush_gen; /* only valid if !never_written */ - }; diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c -index 4106264..8157ede 100644 +index ca9d8f1..8c0142d 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c -@@ -513,9 +513,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, +@@ -1036,9 +1036,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, free_extent_buffer(buf); add_root_to_dirty_list(root); } else { @@ -42818,39 +48740,11 @@ index 4106264..8157ede 100644 parent_start = 0; WARN_ON(trans->transid != btrfs_header_generation(parent)); -diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c -index 0df0d1f..4bdcbfe 100644 ---- a/fs/btrfs/inode.c -+++ b/fs/btrfs/inode.c -@@ -7074,7 +7074,7 @@ fail: - return -ENOMEM; - } - --static int btrfs_getattr(struct vfsmount *mnt, -+int btrfs_getattr(struct vfsmount *mnt, - struct dentry *dentry, struct kstat *stat) - { - struct inode *inode = dentry->d_inode; -@@ -7088,6 +7088,14 @@ static int btrfs_getattr(struct vfsmount *mnt, - return 0; - } - -+EXPORT_SYMBOL(btrfs_getattr); -+ -+dev_t get_btrfs_dev_from_inode(struct inode *inode) -+{ -+ return BTRFS_I(inode)->root->anon_dev; -+} -+EXPORT_SYMBOL(get_btrfs_dev_from_inode); -+ - /* - * If a file is moved, it will inherit the cow and compression flags of the new - * directory. diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c -index 14f8e1f..ab8d81f 100644 +index 2c02310..a0c895e 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c -@@ -2882,9 +2882,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg) +@@ -3077,9 +3077,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg) for (i = 0; i < num_types; i++) { struct btrfs_space_info *tmp; @@ -42863,7 +48757,7 @@ index 14f8e1f..ab8d81f 100644 info = NULL; rcu_read_lock(); list_for_each_entry_rcu(tmp, &root->fs_info->space_info, -@@ -2906,15 +2909,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg) +@@ -3101,10 +3104,7 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg) memcpy(dest, &space, sizeof(space)); dest++; space_args.total_spaces++; @@ -42874,25 +48768,19 @@ index 14f8e1f..ab8d81f 100644 } up_read(&info->groups_sem); } - -- user_dest = (struct btrfs_ioctl_space_info *) -+ user_dest = (struct btrfs_ioctl_space_info __user *) - (arg + sizeof(struct btrfs_ioctl_space_args)); - - if (copy_to_user(user_dest, dest_orig, alloc_size)) -diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c -index 646ee21..f020f87 100644 ---- a/fs/btrfs/relocation.c -+++ b/fs/btrfs/relocation.c -@@ -1268,7 +1268,7 @@ static int __update_reloc_root(struct btrfs_root *root, int del) +diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c +index f6b8859..54fe8c5 100644 +--- a/fs/btrfs/super.c ++++ b/fs/btrfs/super.c +@@ -266,7 +266,7 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans, + function, line, errstr); + return; } - spin_unlock(&rc->reloc_root_tree.lock); - -- BUG_ON((struct btrfs_root *)node->data != root); -+ BUG_ON(!node || (struct btrfs_root *)node->data != root); - - if (!del) { - spin_lock(&rc->reloc_root_tree.lock); +- ACCESS_ONCE(trans->transaction->aborted) = errno; ++ ACCESS_ONCE_RW(trans->transaction->aborted) = errno; + __btrfs_std_error(root->fs_info, function, line, errno, NULL); + } + /* diff --git a/fs/cachefiles/bind.c b/fs/cachefiles/bind.c index 622f469..e8d2d55 100644 --- a/fs/cachefiles/bind.c @@ -42954,10 +48842,10 @@ index 0a1467b..6a53245 100644 cache->bstop_percent = bstop; diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h -index bd6bc1b..b627b53 100644 +index 4938251..7e01445 100644 --- a/fs/cachefiles/internal.h +++ b/fs/cachefiles/internal.h -@@ -57,7 +57,7 @@ struct cachefiles_cache { +@@ -59,7 +59,7 @@ struct cachefiles_cache { wait_queue_head_t daemon_pollwq; /* poll waitqueue for daemon */ struct rb_root active_nodes; /* active nodes (can't be culled) */ rwlock_t active_lock; /* lock for active_nodes */ @@ -42966,7 +48854,7 @@ index bd6bc1b..b627b53 100644 unsigned frun_percent; /* when to stop culling (% files) */ unsigned fcull_percent; /* when to start culling (% files) */ unsigned fstop_percent; /* when to stop allocating (% files) */ -@@ -169,19 +169,19 @@ extern int cachefiles_check_in_use(struct cachefiles_cache *cache, +@@ -171,19 +171,19 @@ extern int cachefiles_check_in_use(struct cachefiles_cache *cache, * proc.c */ #ifdef CONFIG_CACHEFILES_HISTOGRAM @@ -42992,10 +48880,10 @@ index bd6bc1b..b627b53 100644 #else diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c -index 7f0771d..87d4f36 100644 +index 8c01c5fc..15f982e 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c -@@ -318,7 +318,7 @@ try_again: +@@ -317,7 +317,7 @@ try_again: /* first step is to make up a grave dentry in the graveyard */ sprintf(nbuffer, "%08x%08x", (uint32_t) get_seconds(), @@ -43035,10 +48923,10 @@ index eccd339..4c1d995 100644 return 0; diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c -index 0e3c092..818480e 100644 +index 4809922..aab2c39 100644 --- a/fs/cachefiles/rdwr.c +++ b/fs/cachefiles/rdwr.c -@@ -945,7 +945,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page) +@@ -965,7 +965,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page) old_fs = get_fs(); set_fs(KERNEL_DS); ret = file->f_op->write( @@ -43048,10 +48936,10 @@ index 0e3c092..818480e 100644 kunmap(page); if (ret != len) diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c -index 3e8094b..cb3ff3d 100644 +index 6d797f4..0ace2e5 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c -@@ -244,7 +244,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) +@@ -243,7 +243,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) struct ceph_fs_client *fsc = ceph_inode_to_client(inode); struct ceph_mds_client *mdsc = fsc->mdsc; unsigned frag = fpos_frag(filp->f_pos); @@ -43060,20 +48948,11 @@ index 3e8094b..cb3ff3d 100644 int err; u32 ftype; struct ceph_mds_reply_info_parsed *rinfo; -@@ -598,7 +598,7 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry, - if (nd && - (nd->flags & LOOKUP_OPEN) && - !(nd->intent.open.flags & O_CREAT)) { -- int mode = nd->intent.open.create_mode & ~current->fs->umask; -+ int mode = nd->intent.open.create_mode & ~current_umask(); - return ceph_lookup_open(dir, dentry, nd, mode, 1); - } - diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c -index 2704646..c581c91 100644 +index d9ea6ed..1e6c8ac 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c -@@ -265,8 +265,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, +@@ -267,8 +267,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, if (c == '1' || c == 'y' || c == 'Y' || c == '0') { #ifdef CONFIG_CIFS_STATS2 @@ -43084,52 +48963,16 @@ index 2704646..c581c91 100644 #endif /* CONFIG_CIFS_STATS2 */ spin_lock(&cifs_tcp_ses_lock); list_for_each(tmp1, &cifs_tcp_ses_list) { -@@ -279,25 +279,25 @@ static ssize_t cifs_stats_proc_write(struct file *file, +@@ -281,7 +281,7 @@ static ssize_t cifs_stats_proc_write(struct file *file, tcon = list_entry(tmp3, struct cifs_tcon, tcon_list); - atomic_set(&tcon->num_smbs_sent, 0); -- atomic_set(&tcon->num_writes, 0); -- atomic_set(&tcon->num_reads, 0); -- atomic_set(&tcon->num_oplock_brks, 0); -- atomic_set(&tcon->num_opens, 0); -- atomic_set(&tcon->num_posixopens, 0); -- atomic_set(&tcon->num_posixmkdirs, 0); -- atomic_set(&tcon->num_closes, 0); -- atomic_set(&tcon->num_deletes, 0); -- atomic_set(&tcon->num_mkdirs, 0); -- atomic_set(&tcon->num_rmdirs, 0); -- atomic_set(&tcon->num_renames, 0); -- atomic_set(&tcon->num_t2renames, 0); -- atomic_set(&tcon->num_ffirst, 0); -- atomic_set(&tcon->num_fnext, 0); -- atomic_set(&tcon->num_fclose, 0); -- atomic_set(&tcon->num_hardlinks, 0); -- atomic_set(&tcon->num_symlinks, 0); -- atomic_set(&tcon->num_locks, 0); + atomic_set_unchecked(&tcon->num_smbs_sent, 0); -+ atomic_set_unchecked(&tcon->num_writes, 0); -+ atomic_set_unchecked(&tcon->num_reads, 0); -+ atomic_set_unchecked(&tcon->num_oplock_brks, 0); -+ atomic_set_unchecked(&tcon->num_opens, 0); -+ atomic_set_unchecked(&tcon->num_posixopens, 0); -+ atomic_set_unchecked(&tcon->num_posixmkdirs, 0); -+ atomic_set_unchecked(&tcon->num_closes, 0); -+ atomic_set_unchecked(&tcon->num_deletes, 0); -+ atomic_set_unchecked(&tcon->num_mkdirs, 0); -+ atomic_set_unchecked(&tcon->num_rmdirs, 0); -+ atomic_set_unchecked(&tcon->num_renames, 0); -+ atomic_set_unchecked(&tcon->num_t2renames, 0); -+ atomic_set_unchecked(&tcon->num_ffirst, 0); -+ atomic_set_unchecked(&tcon->num_fnext, 0); -+ atomic_set_unchecked(&tcon->num_fclose, 0); -+ atomic_set_unchecked(&tcon->num_hardlinks, 0); -+ atomic_set_unchecked(&tcon->num_symlinks, 0); -+ atomic_set_unchecked(&tcon->num_locks, 0); + if (server->ops->clear_stats) + server->ops->clear_stats(tcon); } - } - } -@@ -327,8 +327,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) +@@ -313,8 +313,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) smBufAllocCount.counter, cifs_min_small); #ifdef CONFIG_CIFS_STATS2 seq_printf(m, "Total Large %d Small %d Allocations\n", @@ -43140,82 +48983,29 @@ index 2704646..c581c91 100644 #endif /* CONFIG_CIFS_STATS2 */ seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount)); -@@ -357,41 +357,41 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) +@@ -343,7 +343,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) if (tcon->need_reconnect) seq_puts(m, "\tDISCONNECTED "); - seq_printf(m, "\nSMBs: %d Oplock Breaks: %d", -- atomic_read(&tcon->num_smbs_sent), -- atomic_read(&tcon->num_oplock_brks)); -+ atomic_read_unchecked(&tcon->num_smbs_sent), -+ atomic_read_unchecked(&tcon->num_oplock_brks)); - seq_printf(m, "\nReads: %d Bytes: %lld", -- atomic_read(&tcon->num_reads), -+ atomic_read_unchecked(&tcon->num_reads), - (long long)(tcon->bytes_read)); - seq_printf(m, "\nWrites: %d Bytes: %lld", -- atomic_read(&tcon->num_writes), -+ atomic_read_unchecked(&tcon->num_writes), - (long long)(tcon->bytes_written)); - seq_printf(m, "\nFlushes: %d", -- atomic_read(&tcon->num_flushes)); -+ atomic_read_unchecked(&tcon->num_flushes)); - seq_printf(m, "\nLocks: %d HardLinks: %d " - "Symlinks: %d", -- atomic_read(&tcon->num_locks), -- atomic_read(&tcon->num_hardlinks), -- atomic_read(&tcon->num_symlinks)); -+ atomic_read_unchecked(&tcon->num_locks), -+ atomic_read_unchecked(&tcon->num_hardlinks), -+ atomic_read_unchecked(&tcon->num_symlinks)); - seq_printf(m, "\nOpens: %d Closes: %d " - "Deletes: %d", -- atomic_read(&tcon->num_opens), -- atomic_read(&tcon->num_closes), -- atomic_read(&tcon->num_deletes)); -+ atomic_read_unchecked(&tcon->num_opens), -+ atomic_read_unchecked(&tcon->num_closes), -+ atomic_read_unchecked(&tcon->num_deletes)); - seq_printf(m, "\nPosix Opens: %d " - "Posix Mkdirs: %d", -- atomic_read(&tcon->num_posixopens), -- atomic_read(&tcon->num_posixmkdirs)); -+ atomic_read_unchecked(&tcon->num_posixopens), -+ atomic_read_unchecked(&tcon->num_posixmkdirs)); - seq_printf(m, "\nMkdirs: %d Rmdirs: %d", -- atomic_read(&tcon->num_mkdirs), -- atomic_read(&tcon->num_rmdirs)); -+ atomic_read_unchecked(&tcon->num_mkdirs), -+ atomic_read_unchecked(&tcon->num_rmdirs)); - seq_printf(m, "\nRenames: %d T2 Renames %d", -- atomic_read(&tcon->num_renames), -- atomic_read(&tcon->num_t2renames)); -+ atomic_read_unchecked(&tcon->num_renames), -+ atomic_read_unchecked(&tcon->num_t2renames)); - seq_printf(m, "\nFindFirst: %d FNext %d " - "FClose %d", -- atomic_read(&tcon->num_ffirst), -- atomic_read(&tcon->num_fnext), -- atomic_read(&tcon->num_fclose)); -+ atomic_read_unchecked(&tcon->num_ffirst), -+ atomic_read_unchecked(&tcon->num_fnext), -+ atomic_read_unchecked(&tcon->num_fclose)); + seq_printf(m, "\nSMBs: %d", +- atomic_read(&tcon->num_smbs_sent)); ++ atomic_read_unchecked(&tcon->num_smbs_sent)); + if (server->ops->print_stats) + server->ops->print_stats(m, tcon); } - } - } diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c -index 541ef81..a78deb8 100644 +index 345fc89..b2acae5 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c -@@ -985,7 +985,7 @@ cifs_init_request_bufs(void) +@@ -1033,7 +1033,7 @@ cifs_init_request_bufs(void) + /* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */ cifs_req_cachep = kmem_cache_create("cifs_request", - CIFSMaxBufSize + - MAX_CIFS_HDR_SIZE, 0, + CIFSMaxBufSize + max_hdr_size, 0, - SLAB_HWCACHE_ALIGN, NULL); + SLAB_HWCACHE_ALIGN | SLAB_USERCOPY, NULL); if (cifs_req_cachep == NULL) return -ENOMEM; -@@ -1012,7 +1012,7 @@ cifs_init_request_bufs(void) +@@ -1060,7 +1060,7 @@ cifs_init_request_bufs(void) efficient to alloc 1 per page off the slab compared to 17K (5page) alloc of large cifs buffers even when page debugging is on */ cifs_sm_req_cachep = kmem_cache_create("cifs_small_rq", @@ -43224,7 +49014,7 @@ index 541ef81..a78deb8 100644 NULL); if (cifs_sm_req_cachep == NULL) { mempool_destroy(cifs_req_poolp); -@@ -1097,8 +1097,8 @@ init_cifs(void) +@@ -1145,8 +1145,8 @@ init_cifs(void) atomic_set(&bufAllocCount, 0); atomic_set(&smBufAllocCount, 0); #ifdef CONFIG_CIFS_STATS2 @@ -43236,61 +49026,70 @@ index 541ef81..a78deb8 100644 atomic_set(&midCount, 0); diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h -index 73fea28..b996b84 100644 +index 4f07f6f..55de8ce 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h -@@ -439,28 +439,28 @@ struct cifs_tcon { +@@ -751,35 +751,35 @@ struct cifs_tcon { __u16 Flags; /* optional support bits */ enum statusEnum tidStatus; #ifdef CONFIG_CIFS_STATS - atomic_t num_smbs_sent; -- atomic_t num_writes; -- atomic_t num_reads; -- atomic_t num_flushes; -- atomic_t num_oplock_brks; -- atomic_t num_opens; -- atomic_t num_closes; -- atomic_t num_deletes; -- atomic_t num_mkdirs; -- atomic_t num_posixopens; -- atomic_t num_posixmkdirs; -- atomic_t num_rmdirs; -- atomic_t num_renames; -- atomic_t num_t2renames; -- atomic_t num_ffirst; -- atomic_t num_fnext; -- atomic_t num_fclose; -- atomic_t num_hardlinks; -- atomic_t num_symlinks; -- atomic_t num_locks; -- atomic_t num_acl_get; -- atomic_t num_acl_set; + atomic_unchecked_t num_smbs_sent; -+ atomic_unchecked_t num_writes; -+ atomic_unchecked_t num_reads; -+ atomic_unchecked_t num_flushes; -+ atomic_unchecked_t num_oplock_brks; -+ atomic_unchecked_t num_opens; -+ atomic_unchecked_t num_closes; -+ atomic_unchecked_t num_deletes; -+ atomic_unchecked_t num_mkdirs; -+ atomic_unchecked_t num_posixopens; -+ atomic_unchecked_t num_posixmkdirs; -+ atomic_unchecked_t num_rmdirs; -+ atomic_unchecked_t num_renames; -+ atomic_unchecked_t num_t2renames; -+ atomic_unchecked_t num_ffirst; -+ atomic_unchecked_t num_fnext; -+ atomic_unchecked_t num_fclose; -+ atomic_unchecked_t num_hardlinks; -+ atomic_unchecked_t num_symlinks; -+ atomic_unchecked_t num_locks; -+ atomic_unchecked_t num_acl_get; -+ atomic_unchecked_t num_acl_set; - #ifdef CONFIG_CIFS_STATS2 - unsigned long long time_writes; - unsigned long long time_reads; -@@ -677,7 +677,7 @@ convert_delimiter(char *path, char delim) + union { + struct { +- atomic_t num_writes; +- atomic_t num_reads; +- atomic_t num_flushes; +- atomic_t num_oplock_brks; +- atomic_t num_opens; +- atomic_t num_closes; +- atomic_t num_deletes; +- atomic_t num_mkdirs; +- atomic_t num_posixopens; +- atomic_t num_posixmkdirs; +- atomic_t num_rmdirs; +- atomic_t num_renames; +- atomic_t num_t2renames; +- atomic_t num_ffirst; +- atomic_t num_fnext; +- atomic_t num_fclose; +- atomic_t num_hardlinks; +- atomic_t num_symlinks; +- atomic_t num_locks; +- atomic_t num_acl_get; +- atomic_t num_acl_set; ++ atomic_unchecked_t num_writes; ++ atomic_unchecked_t num_reads; ++ atomic_unchecked_t num_flushes; ++ atomic_unchecked_t num_oplock_brks; ++ atomic_unchecked_t num_opens; ++ atomic_unchecked_t num_closes; ++ atomic_unchecked_t num_deletes; ++ atomic_unchecked_t num_mkdirs; ++ atomic_unchecked_t num_posixopens; ++ atomic_unchecked_t num_posixmkdirs; ++ atomic_unchecked_t num_rmdirs; ++ atomic_unchecked_t num_renames; ++ atomic_unchecked_t num_t2renames; ++ atomic_unchecked_t num_ffirst; ++ atomic_unchecked_t num_fnext; ++ atomic_unchecked_t num_fclose; ++ atomic_unchecked_t num_hardlinks; ++ atomic_unchecked_t num_symlinks; ++ atomic_unchecked_t num_locks; ++ atomic_unchecked_t num_acl_get; ++ atomic_unchecked_t num_acl_set; + } cifs_stats; + #ifdef CONFIG_CIFS_SMB2 + struct { +- atomic_t smb2_com_sent[NUMBER_OF_SMB2_COMMANDS]; +- atomic_t smb2_com_failed[NUMBER_OF_SMB2_COMMANDS]; ++ atomic_unchecked_t smb2_com_sent[NUMBER_OF_SMB2_COMMANDS]; ++ atomic_unchecked_t smb2_com_failed[NUMBER_OF_SMB2_COMMANDS]; + } smb2_stats; + #endif /* CONFIG_CIFS_SMB2 */ + } stats; +@@ -1080,7 +1080,7 @@ convert_delimiter(char *path, char delim) } #ifdef CONFIG_CIFS_STATS @@ -43299,7 +49098,7 @@ index 73fea28..b996b84 100644 static inline void cifs_stats_bytes_written(struct cifs_tcon *tcon, unsigned int bytes) -@@ -1036,8 +1036,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnectCount; +@@ -1445,8 +1445,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnectCount; /* Various Debug counters */ GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */ #ifdef CONFIG_CIFS_STATS2 @@ -43311,10 +49110,10 @@ index 73fea28..b996b84 100644 GLOBAL_EXTERN atomic_t smBufAllocCount; GLOBAL_EXTERN atomic_t midCount; diff --git a/fs/cifs/link.c b/fs/cifs/link.c -index 6b0e064..94e6c3c 100644 +index 9f6c4c4..8de307a 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c -@@ -600,7 +600,7 @@ symlink_exit: +@@ -616,7 +616,7 @@ symlink_exit: void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie) { @@ -43324,11 +49123,11 @@ index 6b0e064..94e6c3c 100644 kfree(p); } diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c -index c29d1aa..58018da 100644 +index 1b15bf8..1ce489e 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c -@@ -156,7 +156,7 @@ cifs_buf_get(void) - memset(ret_buf, 0, sizeof(struct smb_hdr) + 3); +@@ -169,7 +169,7 @@ cifs_buf_get(void) + memset(ret_buf, 0, buf_size + 3); atomic_inc(&bufAllocCount); #ifdef CONFIG_CIFS_STATS2 - atomic_inc(&totBufAllocCount); @@ -43336,7 +49135,7 @@ index c29d1aa..58018da 100644 #endif /* CONFIG_CIFS_STATS2 */ } -@@ -191,7 +191,7 @@ cifs_small_buf_get(void) +@@ -204,7 +204,7 @@ cifs_small_buf_get(void) /* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/ atomic_inc(&smBufAllocCount); #ifdef CONFIG_CIFS_STATS2 @@ -43345,8 +49144,253 @@ index c29d1aa..58018da 100644 #endif /* CONFIG_CIFS_STATS2 */ } +diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c +index 47bc5a8..10decbe 100644 +--- a/fs/cifs/smb1ops.c ++++ b/fs/cifs/smb1ops.c +@@ -586,27 +586,27 @@ static void + cifs_clear_stats(struct cifs_tcon *tcon) + { + #ifdef CONFIG_CIFS_STATS +- atomic_set(&tcon->stats.cifs_stats.num_writes, 0); +- atomic_set(&tcon->stats.cifs_stats.num_reads, 0); +- atomic_set(&tcon->stats.cifs_stats.num_flushes, 0); +- atomic_set(&tcon->stats.cifs_stats.num_oplock_brks, 0); +- atomic_set(&tcon->stats.cifs_stats.num_opens, 0); +- atomic_set(&tcon->stats.cifs_stats.num_posixopens, 0); +- atomic_set(&tcon->stats.cifs_stats.num_posixmkdirs, 0); +- atomic_set(&tcon->stats.cifs_stats.num_closes, 0); +- atomic_set(&tcon->stats.cifs_stats.num_deletes, 0); +- atomic_set(&tcon->stats.cifs_stats.num_mkdirs, 0); +- atomic_set(&tcon->stats.cifs_stats.num_rmdirs, 0); +- atomic_set(&tcon->stats.cifs_stats.num_renames, 0); +- atomic_set(&tcon->stats.cifs_stats.num_t2renames, 0); +- atomic_set(&tcon->stats.cifs_stats.num_ffirst, 0); +- atomic_set(&tcon->stats.cifs_stats.num_fnext, 0); +- atomic_set(&tcon->stats.cifs_stats.num_fclose, 0); +- atomic_set(&tcon->stats.cifs_stats.num_hardlinks, 0); +- atomic_set(&tcon->stats.cifs_stats.num_symlinks, 0); +- atomic_set(&tcon->stats.cifs_stats.num_locks, 0); +- atomic_set(&tcon->stats.cifs_stats.num_acl_get, 0); +- atomic_set(&tcon->stats.cifs_stats.num_acl_set, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_writes, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_reads, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_flushes, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_oplock_brks, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_opens, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_posixopens, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_posixmkdirs, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_closes, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_deletes, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_mkdirs, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_rmdirs, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_renames, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_t2renames, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_ffirst, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_fnext, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_fclose, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_hardlinks, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_symlinks, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_locks, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_acl_get, 0); ++ atomic_set_unchecked(&tcon->stats.cifs_stats.num_acl_set, 0); + #endif + } + +@@ -615,36 +615,36 @@ cifs_print_stats(struct seq_file *m, struct cifs_tcon *tcon) + { + #ifdef CONFIG_CIFS_STATS + seq_printf(m, " Oplocks breaks: %d", +- atomic_read(&tcon->stats.cifs_stats.num_oplock_brks)); ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_oplock_brks)); + seq_printf(m, "\nReads: %d Bytes: %llu", +- atomic_read(&tcon->stats.cifs_stats.num_reads), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_reads), + (long long)(tcon->bytes_read)); + seq_printf(m, "\nWrites: %d Bytes: %llu", +- atomic_read(&tcon->stats.cifs_stats.num_writes), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_writes), + (long long)(tcon->bytes_written)); + seq_printf(m, "\nFlushes: %d", +- atomic_read(&tcon->stats.cifs_stats.num_flushes)); ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_flushes)); + seq_printf(m, "\nLocks: %d HardLinks: %d Symlinks: %d", +- atomic_read(&tcon->stats.cifs_stats.num_locks), +- atomic_read(&tcon->stats.cifs_stats.num_hardlinks), +- atomic_read(&tcon->stats.cifs_stats.num_symlinks)); ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_locks), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_hardlinks), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_symlinks)); + seq_printf(m, "\nOpens: %d Closes: %d Deletes: %d", +- atomic_read(&tcon->stats.cifs_stats.num_opens), +- atomic_read(&tcon->stats.cifs_stats.num_closes), +- atomic_read(&tcon->stats.cifs_stats.num_deletes)); ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_opens), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_closes), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_deletes)); + seq_printf(m, "\nPosix Opens: %d Posix Mkdirs: %d", +- atomic_read(&tcon->stats.cifs_stats.num_posixopens), +- atomic_read(&tcon->stats.cifs_stats.num_posixmkdirs)); ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_posixopens), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_posixmkdirs)); + seq_printf(m, "\nMkdirs: %d Rmdirs: %d", +- atomic_read(&tcon->stats.cifs_stats.num_mkdirs), +- atomic_read(&tcon->stats.cifs_stats.num_rmdirs)); ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_mkdirs), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_rmdirs)); + seq_printf(m, "\nRenames: %d T2 Renames %d", +- atomic_read(&tcon->stats.cifs_stats.num_renames), +- atomic_read(&tcon->stats.cifs_stats.num_t2renames)); ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_renames), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_t2renames)); + seq_printf(m, "\nFindFirst: %d FNext %d FClose %d", +- atomic_read(&tcon->stats.cifs_stats.num_ffirst), +- atomic_read(&tcon->stats.cifs_stats.num_fnext), +- atomic_read(&tcon->stats.cifs_stats.num_fclose)); ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_ffirst), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_fnext), ++ atomic_read_unchecked(&tcon->stats.cifs_stats.num_fclose)); + #endif + } + +diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c +index bceffe7..cd1ae59 100644 +--- a/fs/cifs/smb2ops.c ++++ b/fs/cifs/smb2ops.c +@@ -274,8 +274,8 @@ smb2_clear_stats(struct cifs_tcon *tcon) + #ifdef CONFIG_CIFS_STATS + int i; + for (i = 0; i < NUMBER_OF_SMB2_COMMANDS; i++) { +- atomic_set(&tcon->stats.smb2_stats.smb2_com_sent[i], 0); +- atomic_set(&tcon->stats.smb2_stats.smb2_com_failed[i], 0); ++ atomic_set_unchecked(&tcon->stats.smb2_stats.smb2_com_sent[i], 0); ++ atomic_set_unchecked(&tcon->stats.smb2_stats.smb2_com_failed[i], 0); + } + #endif + } +@@ -284,66 +284,66 @@ static void + smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon) + { + #ifdef CONFIG_CIFS_STATS +- atomic_t *sent = tcon->stats.smb2_stats.smb2_com_sent; +- atomic_t *failed = tcon->stats.smb2_stats.smb2_com_failed; ++ atomic_unchecked_t *sent = tcon->stats.smb2_stats.smb2_com_sent; ++ atomic_unchecked_t *failed = tcon->stats.smb2_stats.smb2_com_failed; + seq_printf(m, "\nNegotiates: %d sent %d failed", +- atomic_read(&sent[SMB2_NEGOTIATE_HE]), +- atomic_read(&failed[SMB2_NEGOTIATE_HE])); ++ atomic_read_unchecked(&sent[SMB2_NEGOTIATE_HE]), ++ atomic_read_unchecked(&failed[SMB2_NEGOTIATE_HE])); + seq_printf(m, "\nSessionSetups: %d sent %d failed", +- atomic_read(&sent[SMB2_SESSION_SETUP_HE]), +- atomic_read(&failed[SMB2_SESSION_SETUP_HE])); ++ atomic_read_unchecked(&sent[SMB2_SESSION_SETUP_HE]), ++ atomic_read_unchecked(&failed[SMB2_SESSION_SETUP_HE])); + #define SMB2LOGOFF 0x0002 /* trivial request/resp */ + seq_printf(m, "\nLogoffs: %d sent %d failed", +- atomic_read(&sent[SMB2_LOGOFF_HE]), +- atomic_read(&failed[SMB2_LOGOFF_HE])); ++ atomic_read_unchecked(&sent[SMB2_LOGOFF_HE]), ++ atomic_read_unchecked(&failed[SMB2_LOGOFF_HE])); + seq_printf(m, "\nTreeConnects: %d sent %d failed", +- atomic_read(&sent[SMB2_TREE_CONNECT_HE]), +- atomic_read(&failed[SMB2_TREE_CONNECT_HE])); ++ atomic_read_unchecked(&sent[SMB2_TREE_CONNECT_HE]), ++ atomic_read_unchecked(&failed[SMB2_TREE_CONNECT_HE])); + seq_printf(m, "\nTreeDisconnects: %d sent %d failed", +- atomic_read(&sent[SMB2_TREE_DISCONNECT_HE]), +- atomic_read(&failed[SMB2_TREE_DISCONNECT_HE])); ++ atomic_read_unchecked(&sent[SMB2_TREE_DISCONNECT_HE]), ++ atomic_read_unchecked(&failed[SMB2_TREE_DISCONNECT_HE])); + seq_printf(m, "\nCreates: %d sent %d failed", +- atomic_read(&sent[SMB2_CREATE_HE]), +- atomic_read(&failed[SMB2_CREATE_HE])); ++ atomic_read_unchecked(&sent[SMB2_CREATE_HE]), ++ atomic_read_unchecked(&failed[SMB2_CREATE_HE])); + seq_printf(m, "\nCloses: %d sent %d failed", +- atomic_read(&sent[SMB2_CLOSE_HE]), +- atomic_read(&failed[SMB2_CLOSE_HE])); ++ atomic_read_unchecked(&sent[SMB2_CLOSE_HE]), ++ atomic_read_unchecked(&failed[SMB2_CLOSE_HE])); + seq_printf(m, "\nFlushes: %d sent %d failed", +- atomic_read(&sent[SMB2_FLUSH_HE]), +- atomic_read(&failed[SMB2_FLUSH_HE])); ++ atomic_read_unchecked(&sent[SMB2_FLUSH_HE]), ++ atomic_read_unchecked(&failed[SMB2_FLUSH_HE])); + seq_printf(m, "\nReads: %d sent %d failed", +- atomic_read(&sent[SMB2_READ_HE]), +- atomic_read(&failed[SMB2_READ_HE])); ++ atomic_read_unchecked(&sent[SMB2_READ_HE]), ++ atomic_read_unchecked(&failed[SMB2_READ_HE])); + seq_printf(m, "\nWrites: %d sent %d failed", +- atomic_read(&sent[SMB2_WRITE_HE]), +- atomic_read(&failed[SMB2_WRITE_HE])); ++ atomic_read_unchecked(&sent[SMB2_WRITE_HE]), ++ atomic_read_unchecked(&failed[SMB2_WRITE_HE])); + seq_printf(m, "\nLocks: %d sent %d failed", +- atomic_read(&sent[SMB2_LOCK_HE]), +- atomic_read(&failed[SMB2_LOCK_HE])); ++ atomic_read_unchecked(&sent[SMB2_LOCK_HE]), ++ atomic_read_unchecked(&failed[SMB2_LOCK_HE])); + seq_printf(m, "\nIOCTLs: %d sent %d failed", +- atomic_read(&sent[SMB2_IOCTL_HE]), +- atomic_read(&failed[SMB2_IOCTL_HE])); ++ atomic_read_unchecked(&sent[SMB2_IOCTL_HE]), ++ atomic_read_unchecked(&failed[SMB2_IOCTL_HE])); + seq_printf(m, "\nCancels: %d sent %d failed", +- atomic_read(&sent[SMB2_CANCEL_HE]), +- atomic_read(&failed[SMB2_CANCEL_HE])); ++ atomic_read_unchecked(&sent[SMB2_CANCEL_HE]), ++ atomic_read_unchecked(&failed[SMB2_CANCEL_HE])); + seq_printf(m, "\nEchos: %d sent %d failed", +- atomic_read(&sent[SMB2_ECHO_HE]), +- atomic_read(&failed[SMB2_ECHO_HE])); ++ atomic_read_unchecked(&sent[SMB2_ECHO_HE]), ++ atomic_read_unchecked(&failed[SMB2_ECHO_HE])); + seq_printf(m, "\nQueryDirectories: %d sent %d failed", +- atomic_read(&sent[SMB2_QUERY_DIRECTORY_HE]), +- atomic_read(&failed[SMB2_QUERY_DIRECTORY_HE])); ++ atomic_read_unchecked(&sent[SMB2_QUERY_DIRECTORY_HE]), ++ atomic_read_unchecked(&failed[SMB2_QUERY_DIRECTORY_HE])); + seq_printf(m, "\nChangeNotifies: %d sent %d failed", +- atomic_read(&sent[SMB2_CHANGE_NOTIFY_HE]), +- atomic_read(&failed[SMB2_CHANGE_NOTIFY_HE])); ++ atomic_read_unchecked(&sent[SMB2_CHANGE_NOTIFY_HE]), ++ atomic_read_unchecked(&failed[SMB2_CHANGE_NOTIFY_HE])); + seq_printf(m, "\nQueryInfos: %d sent %d failed", +- atomic_read(&sent[SMB2_QUERY_INFO_HE]), +- atomic_read(&failed[SMB2_QUERY_INFO_HE])); ++ atomic_read_unchecked(&sent[SMB2_QUERY_INFO_HE]), ++ atomic_read_unchecked(&failed[SMB2_QUERY_INFO_HE])); + seq_printf(m, "\nSetInfos: %d sent %d failed", +- atomic_read(&sent[SMB2_SET_INFO_HE]), +- atomic_read(&failed[SMB2_SET_INFO_HE])); ++ atomic_read_unchecked(&sent[SMB2_SET_INFO_HE]), ++ atomic_read_unchecked(&failed[SMB2_SET_INFO_HE])); + seq_printf(m, "\nOplockBreaks: %d sent %d failed", +- atomic_read(&sent[SMB2_OPLOCK_BREAK_HE]), +- atomic_read(&failed[SMB2_OPLOCK_BREAK_HE])); ++ atomic_read_unchecked(&sent[SMB2_OPLOCK_BREAK_HE]), ++ atomic_read_unchecked(&failed[SMB2_OPLOCK_BREAK_HE])); + #endif + } + +diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c +index 41d9d07..dbb4772 100644 +--- a/fs/cifs/smb2pdu.c ++++ b/fs/cifs/smb2pdu.c +@@ -1761,8 +1761,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, + default: + cERROR(1, "info level %u isn't supported", + srch_inf->info_level); +- rc = -EINVAL; +- goto qdir_exit; ++ return -EINVAL; + } + + req->FileIndex = cpu_to_le32(index); diff --git a/fs/coda/cache.c b/fs/coda/cache.c -index 6901578..d402eb5 100644 +index 1da168c..8bc7ff6 100644 --- a/fs/coda/cache.c +++ b/fs/coda/cache.c @@ -24,7 +24,7 @@ @@ -43364,7 +49408,7 @@ index 6901578..d402eb5 100644 spin_lock(&cii->c_lock); - cii->c_cached_epoch = atomic_read(&permission_epoch); + cii->c_cached_epoch = atomic_read_unchecked(&permission_epoch); - if (cii->c_uid != current_fsuid()) { + if (!uid_eq(cii->c_uid, current_fsuid())) { cii->c_uid = current_fsuid(); cii->c_cached_perm = mask; @@ -46,14 +46,14 @@ void coda_cache_clear_inode(struct inode *inode) @@ -43387,16 +49431,25 @@ index 6901578..d402eb5 100644 @@ -66,7 +66,7 @@ int coda_cache_check(struct inode *inode, int mask) spin_lock(&cii->c_lock); hit = (mask & cii->c_cached_perm) == mask && - cii->c_uid == current_fsuid() && + uid_eq(cii->c_uid, current_fsuid()) && - cii->c_cached_epoch == atomic_read(&permission_epoch); + cii->c_cached_epoch == atomic_read_unchecked(&permission_epoch); spin_unlock(&cii->c_lock); return hit; diff --git a/fs/compat.c b/fs/compat.c -index 2b371b3..7e947e3 100644 +index d487985..c9e04b1 100644 --- a/fs/compat.c +++ b/fs/compat.c +@@ -54,7 +54,7 @@ + #include <asm/ioctls.h> + #include "internal.h" + +-int compat_log = 1; ++int compat_log = 0; + + int compat_printk(const char *fmt, ...) + { @@ -490,7 +490,7 @@ compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p) set_fs(KERNEL_DS); @@ -43415,7 +49468,7 @@ index 2b371b3..7e947e3 100644 goto out; if (nr_segs > fast_segs) { ret = -ENOMEM; -@@ -831,6 +831,7 @@ struct compat_old_linux_dirent { +@@ -835,6 +835,7 @@ struct compat_old_linux_dirent { struct compat_readdir_callback { struct compat_old_linux_dirent __user *dirent; @@ -43423,7 +49476,7 @@ index 2b371b3..7e947e3 100644 int result; }; -@@ -848,6 +849,10 @@ static int compat_fillonedir(void *__buf, const char *name, int namlen, +@@ -852,6 +853,10 @@ static int compat_fillonedir(void *__buf, const char *name, int namlen, buf->result = -EOVERFLOW; return -EOVERFLOW; } @@ -43434,15 +49487,15 @@ index 2b371b3..7e947e3 100644 buf->result++; dirent = buf->dirent; if (!access_ok(VERIFY_WRITE, dirent, -@@ -880,6 +885,7 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd, +@@ -882,6 +887,7 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd, buf.result = 0; buf.dirent = dirent; -+ buf.file = file; ++ buf.file = f.file; - error = vfs_readdir(file, compat_fillonedir, &buf); + error = vfs_readdir(f.file, compat_fillonedir, &buf); if (buf.result) -@@ -900,6 +906,7 @@ struct compat_linux_dirent { +@@ -901,6 +907,7 @@ struct compat_linux_dirent { struct compat_getdents_callback { struct compat_linux_dirent __user *current_dir; struct compat_linux_dirent __user *previous; @@ -43450,7 +49503,7 @@ index 2b371b3..7e947e3 100644 int count; int error; }; -@@ -921,6 +928,10 @@ static int compat_filldir(void *__buf, const char *name, int namlen, +@@ -922,6 +929,10 @@ static int compat_filldir(void *__buf, const char *name, int namlen, buf->error = -EOVERFLOW; return -EOVERFLOW; } @@ -43461,15 +49514,15 @@ index 2b371b3..7e947e3 100644 dirent = buf->previous; if (dirent) { if (__put_user(offset, &dirent->d_off)) -@@ -968,6 +979,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd, +@@ -967,6 +978,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd, buf.previous = NULL; buf.count = count; buf.error = 0; -+ buf.file = file; ++ buf.file = f.file; - error = vfs_readdir(file, compat_filldir, &buf); + error = vfs_readdir(f.file, compat_filldir, &buf); if (error >= 0) -@@ -989,6 +1001,7 @@ out: +@@ -987,6 +999,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd, struct compat_getdents_callback64 { struct linux_dirent64 __user *current_dir; struct linux_dirent64 __user *previous; @@ -43477,7 +49530,7 @@ index 2b371b3..7e947e3 100644 int count; int error; }; -@@ -1005,6 +1018,10 @@ static int compat_filldir64(void * __buf, const char * name, int namlen, loff_t +@@ -1003,6 +1016,10 @@ static int compat_filldir64(void * __buf, const char * name, int namlen, loff_t buf->error = -EINVAL; /* only used if we fail.. */ if (reclen > buf->count) return -EINVAL; @@ -43488,24 +49541,24 @@ index 2b371b3..7e947e3 100644 dirent = buf->previous; if (dirent) { -@@ -1056,13 +1073,14 @@ asmlinkage long compat_sys_getdents64(unsigned int fd, +@@ -1052,13 +1069,14 @@ asmlinkage long compat_sys_getdents64(unsigned int fd, buf.previous = NULL; buf.count = count; buf.error = 0; -+ buf.file = file; ++ buf.file = f.file; - error = vfs_readdir(file, compat_filldir64, &buf); + error = vfs_readdir(f.file, compat_filldir64, &buf); if (error >= 0) error = buf.error; lastdirent = buf.previous; if (lastdirent) { -- typeof(lastdirent->d_off) d_off = file->f_pos; -+ typeof(((struct linux_dirent64 *)0)->d_off) d_off = file->f_pos; +- typeof(lastdirent->d_off) d_off = f.file->f_pos; ++ typeof(((struct linux_dirent64 *)0)->d_off) d_off = f.file->f_pos; if (__put_user_unaligned(d_off, &lastdirent->d_off)) error = -EFAULT; else diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c -index 112e45a..b59845b 100644 +index a81147e..20bf2b5 100644 --- a/fs/compat_binfmt_elf.c +++ b/fs/compat_binfmt_elf.c @@ -30,11 +30,13 @@ @@ -43523,19 +49576,10 @@ index 112e45a..b59845b 100644 /* diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c -index debdfe0..75d31d4 100644 +index 3ced75f..1eeca06 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c -@@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsigned int fd, unsigned int cmd, - - err = get_user(palp, &up->palette); - err |= get_user(length, &up->length); -+ if (err) -+ return -EFAULT; - - up_native = compat_alloc_user_space(sizeof(struct video_spu_palette)); - err = put_user(compat_ptr(palp), &up_native->palette); -@@ -621,7 +623,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd, +@@ -623,7 +623,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd, return -EFAULT; if (__get_user(udata, &ss32->iomem_base)) return -EFAULT; @@ -43544,7 +49588,7 @@ index debdfe0..75d31d4 100644 if (__get_user(ss.iomem_reg_shift, &ss32->iomem_reg_shift) || __get_user(ss.port_high, &ss32->port_high)) return -EFAULT; -@@ -796,7 +798,7 @@ static int compat_ioctl_preallocate(struct file *file, +@@ -798,7 +798,7 @@ static int compat_ioctl_preallocate(struct file *file, copy_in_user(&p->l_len, &p32->l_len, sizeof(s64)) || copy_in_user(&p->l_sysid, &p32->l_sysid, sizeof(s32)) || copy_in_user(&p->l_pid, &p32->l_pid, sizeof(u32)) || @@ -43553,7 +49597,7 @@ index debdfe0..75d31d4 100644 return -EFAULT; return ioctl_preallocate(file, p); -@@ -1610,8 +1612,8 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, +@@ -1620,8 +1620,8 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, static int __init init_sys32_ioctl_cmp(const void *p, const void *q) { unsigned int a, b; @@ -43565,10 +49609,10 @@ index debdfe0..75d31d4 100644 return 1; if (a < b) diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c -index 7e6c52d..94bc756 100644 +index 7aabc6a..34c1197 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c -@@ -1564,7 +1564,8 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir +@@ -1565,7 +1565,8 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir } for (p=q->next; p!= &parent_sd->s_children; p=p->next) { struct configfs_dirent *next; @@ -43578,7 +49622,7 @@ index 7e6c52d..94bc756 100644 int len; struct inode *inode = NULL; -@@ -1574,7 +1575,12 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir +@@ -1575,7 +1576,12 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir continue; name = configfs_get_name(next); @@ -43592,11 +49636,132 @@ index 7e6c52d..94bc756 100644 /* * We'll have a dentry and an inode for +diff --git a/fs/coredump.c b/fs/coredump.c +index c647965..a77bff3 100644 +--- a/fs/coredump.c ++++ b/fs/coredump.c +@@ -52,7 +52,7 @@ struct core_name { + char *corename; + int used, size; + }; +-static atomic_t call_count = ATOMIC_INIT(1); ++static atomic_unchecked_t call_count = ATOMIC_INIT(1); + + /* The maximal length of core_pattern is also specified in sysctl.c */ + +@@ -60,7 +60,7 @@ static int expand_corename(struct core_name *cn) + { + char *old_corename = cn->corename; + +- cn->size = CORENAME_MAX_SIZE * atomic_inc_return(&call_count); ++ cn->size = CORENAME_MAX_SIZE * atomic_inc_return_unchecked(&call_count); + cn->corename = krealloc(old_corename, cn->size, GFP_KERNEL); + + if (!cn->corename) { +@@ -157,7 +157,7 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm) + int pid_in_pattern = 0; + int err = 0; + +- cn->size = CORENAME_MAX_SIZE * atomic_read(&call_count); ++ cn->size = CORENAME_MAX_SIZE * atomic_read_unchecked(&call_count); + cn->corename = kmalloc(cn->size, GFP_KERNEL); + cn->used = 0; + +@@ -414,17 +414,17 @@ static void wait_for_dump_helpers(struct file *file) + pipe = file_inode(file)->i_pipe; + + pipe_lock(pipe); +- pipe->readers++; +- pipe->writers--; ++ atomic_inc(&pipe->readers); ++ atomic_dec(&pipe->writers); + +- while ((pipe->readers > 1) && (!signal_pending(current))) { ++ while ((atomic_read(&pipe->readers) > 1) && (!signal_pending(current))) { + wake_up_interruptible_sync(&pipe->wait); + kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); + pipe_wait(pipe); + } + +- pipe->readers--; +- pipe->writers++; ++ atomic_dec(&pipe->readers); ++ atomic_inc(&pipe->writers); + pipe_unlock(pipe); + + } +@@ -471,7 +471,8 @@ void do_coredump(siginfo_t *siginfo) + int ispipe; + struct files_struct *displaced; + bool need_nonrelative = false; +- static atomic_t core_dump_count = ATOMIC_INIT(0); ++ static atomic_unchecked_t core_dump_count = ATOMIC_INIT(0); ++ long signr = siginfo->si_signo; + struct coredump_params cprm = { + .siginfo = siginfo, + .regs = signal_pt_regs(), +@@ -484,7 +485,10 @@ void do_coredump(siginfo_t *siginfo) + .mm_flags = mm->flags, + }; + +- audit_core_dumps(siginfo->si_signo); ++ audit_core_dumps(signr); ++ ++ if (signr == SIGSEGV || signr == SIGBUS || signr == SIGKILL || signr == SIGILL) ++ gr_handle_brute_attach(cprm.mm_flags); + + binfmt = mm->binfmt; + if (!binfmt || !binfmt->core_dump) +@@ -508,7 +512,7 @@ void do_coredump(siginfo_t *siginfo) + need_nonrelative = true; + } + +- retval = coredump_wait(siginfo->si_signo, &core_state); ++ retval = coredump_wait(signr, &core_state); + if (retval < 0) + goto fail_creds; + +@@ -556,7 +560,7 @@ void do_coredump(siginfo_t *siginfo) + } + cprm.limit = RLIM_INFINITY; + +- dump_count = atomic_inc_return(&core_dump_count); ++ dump_count = atomic_inc_return_unchecked(&core_dump_count); + if (core_pipe_limit && (core_pipe_limit < dump_count)) { + printk(KERN_WARNING "Pid %d(%s) over core_pipe_limit\n", + task_tgid_vnr(current), current->comm); +@@ -583,6 +587,8 @@ void do_coredump(siginfo_t *siginfo) + } else { + struct inode *inode; + ++ gr_learn_resource(current, RLIMIT_CORE, binfmt->min_coredump, 1); ++ + if (cprm.limit < binfmt->min_coredump) + goto fail_unlock; + +@@ -640,7 +646,7 @@ close_fail: + filp_close(cprm.file, NULL); + fail_dropcount: + if (ispipe) +- atomic_dec(&core_dump_count); ++ atomic_dec_unchecked(&core_dump_count); + fail_unlock: + kfree(cn.corename); + fail_corename: +@@ -659,7 +665,7 @@ fail: + */ + int dump_write(struct file *file, const void *addr, int nr) + { +- return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, addr, nr, &file->f_pos) == nr; ++ return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, (const char __force_user *)addr, nr, &file->f_pos) == nr; + } + EXPORT_SYMBOL(dump_write); + diff --git a/fs/dcache.c b/fs/dcache.c -index b80531c..8ca7e2d 100644 +index e689268..f36956e 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -3084,7 +3084,7 @@ void __init vfs_caches_init(unsigned long mempages) +@@ -3100,7 +3100,7 @@ void __init vfs_caches_init(unsigned long mempages) mempages -= reserve; names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0, @@ -43606,44 +49771,35 @@ index b80531c..8ca7e2d 100644 dcache_init(); inode_init(); diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c -index b80bc84..0d46d1a 100644 +index 4888cb3..e0f7cf8 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c -@@ -408,7 +408,11 @@ EXPORT_SYMBOL_GPL(debugfs_create_file); +@@ -415,7 +415,11 @@ EXPORT_SYMBOL_GPL(debugfs_create_file); + */ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent) { - return debugfs_create_file(name, +#ifdef CONFIG_GRKERNSEC_SYSFS_RESTRICT -+ S_IFDIR | S_IRWXU, ++ return __create_file(name, S_IFDIR | S_IRWXU, +#else - S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, + return __create_file(name, S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, +#endif parent, NULL, NULL); } EXPORT_SYMBOL_GPL(debugfs_create_dir); diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c -index ab35b11..b30af66 100644 +index 5eab400..810a3f5 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c -@@ -672,7 +672,7 @@ static int ecryptfs_readlink_lower(struct dentry *dentry, char **buf, +@@ -674,7 +674,7 @@ static int ecryptfs_readlink_lower(struct dentry *dentry, char **buf, old_fs = get_fs(); set_fs(get_ds()); rc = lower_dentry->d_inode->i_op->readlink(lower_dentry, - (char __user *)lower_buf, + (char __force_user *)lower_buf, - lower_bufsiz); + PATH_MAX); set_fs(old_fs); if (rc < 0) -@@ -718,7 +718,7 @@ static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd) - } - old_fs = get_fs(); - set_fs(get_ds()); -- rc = dentry->d_inode->i_op->readlink(dentry, (char __user *)buf, len); -+ rc = dentry->d_inode->i_op->readlink(dentry, (char __force_user *)buf, len); - set_fs(old_fs); - if (rc < 0) { - kfree(buf); -@@ -733,7 +733,7 @@ out: +@@ -706,7 +706,7 @@ out: static void ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr) { @@ -43653,10 +49809,10 @@ index ab35b11..b30af66 100644 /* Free the char* */ kfree(buf); diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c -index c0038f6..47ab347 100644 +index e4141f2..d8263e8 100644 --- a/fs/ecryptfs/miscdev.c +++ b/fs/ecryptfs/miscdev.c -@@ -355,7 +355,7 @@ check_list: +@@ -304,7 +304,7 @@ check_list: goto out_unlock_msg_ctx; i = PKT_TYPE_SIZE + PKT_CTR_SIZE; if (msg_ctx->msg) { @@ -43666,19 +49822,10 @@ index c0038f6..47ab347 100644 i += packet_length_size; if (copy_to_user(&buf[i], msg_ctx->msg, msg_ctx->msg_size)) diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c -index b2a34a1..162fa69 100644 +index 6a16053..2155147 100644 --- a/fs/ecryptfs/read_write.c +++ b/fs/ecryptfs/read_write.c -@@ -48,7 +48,7 @@ int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data, - return -EIO; - fs_save = get_fs(); - set_fs(get_ds()); -- rc = vfs_write(lower_file, data, size, &offset); -+ rc = vfs_write(lower_file, (const char __force_user *)data, size, &offset); - set_fs(fs_save); - mark_inode_dirty_sync(ecryptfs_inode); - return rc; -@@ -244,7 +244,7 @@ int ecryptfs_read_lower(char *data, loff_t offset, size_t size, +@@ -240,7 +240,7 @@ int ecryptfs_read_lower(char *data, loff_t offset, size_t size, return -EIO; fs_save = get_fs(); set_fs(get_ds()); @@ -43688,15 +49835,17 @@ index b2a34a1..162fa69 100644 return rc; } diff --git a/fs/exec.c b/fs/exec.c -index 126e01c..be60c6e 100644 +index 6d56ff2..b56586d 100644 --- a/fs/exec.c +++ b/fs/exec.c -@@ -55,6 +55,15 @@ +@@ -55,8 +55,20 @@ #include <linux/pipe_fs_i.h> #include <linux/oom.h> #include <linux/compat.h> +#include <linux/random.h> +#include <linux/seq_file.h> ++#include <linux/coredump.h> ++#include <linux/mman.h> + +#ifdef CONFIG_PAX_REFCOUNT +#include <linux/kallsyms.h> @@ -43706,15 +49855,18 @@ index 126e01c..be60c6e 100644 +#include <trace/events/fs.h> #include <asm/uaccess.h> ++#include <asm/sections.h> #include <asm/mmu_context.h> -@@ -66,6 +75,18 @@ + #include <asm/tlb.h> + +@@ -66,6 +78,18 @@ #include <trace/events/sched.h> +#ifdef CONFIG_PAX_HAVE_ACL_FLAGS +void __weak pax_set_initial_flags(struct linux_binprm *bprm) +{ -+ WARN_ONCE(1, "PAX: PAX_HAVE_ACL_FLAGS was enabled without providing the pax_set_initial_flags callback, this is probably not what you wanted.\n"); ++ pr_warn_once("PAX: PAX_HAVE_ACL_FLAGS was enabled without providing the pax_set_initial_flags callback, this is probably not what you wanted.\n"); +} +#endif + @@ -43723,19 +49875,30 @@ index 126e01c..be60c6e 100644 +EXPORT_SYMBOL(pax_set_initial_flags_func); +#endif + - int core_uses_pid; - char core_pattern[CORENAME_MAX_SIZE] = "core"; - unsigned int core_pipe_limit; -@@ -75,7 +96,7 @@ struct core_name { - char *corename; - int used, size; - }; --static atomic_t call_count = ATOMIC_INIT(1); -+static atomic_unchecked_t call_count = ATOMIC_INIT(1); + int suid_dumpable = 0; - /* The maximal length of core_pattern is also specified in sysctl.c */ + static LIST_HEAD(formats); +@@ -75,8 +99,8 @@ void __register_binfmt(struct linux_binfmt * fmt, int insert) + { + BUG_ON(!fmt); + write_lock(&binfmt_lock); +- insert ? list_add(&fmt->lh, &formats) : +- list_add_tail(&fmt->lh, &formats); ++ insert ? pax_list_add((struct list_head *)&fmt->lh, &formats) : ++ pax_list_add_tail((struct list_head *)&fmt->lh, &formats); + write_unlock(&binfmt_lock); + } + +@@ -85,7 +109,7 @@ EXPORT_SYMBOL(__register_binfmt); + void unregister_binfmt(struct linux_binfmt * fmt) + { + write_lock(&binfmt_lock); +- list_del(&fmt->lh); ++ pax_list_del((struct list_head *)&fmt->lh); + write_unlock(&binfmt_lock); + } -@@ -191,18 +212,10 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, +@@ -180,18 +204,10 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, int write) { struct page *page; @@ -43757,15 +49920,15 @@ index 126e01c..be60c6e 100644 return NULL; if (write) { -@@ -218,6 +231,17 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, +@@ -207,6 +223,17 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, if (size <= ARG_MAX) return page; +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP + // only allow 512KB for argv+env on suid/sgid binaries + // to prevent easy ASLR exhaustion -+ if (((bprm->cred->euid != current_euid()) || -+ (bprm->cred->egid != current_egid())) && ++ if (((!uid_eq(bprm->cred->euid, current_euid())) || ++ (!gid_eq(bprm->cred->egid, current_egid()))) && + (size > (512 * 1024))) { + put_page(page); + return NULL; @@ -43775,7 +49938,7 @@ index 126e01c..be60c6e 100644 /* * Limit to 1/4-th the stack size for the argv+env strings. * This ensures that: -@@ -277,6 +301,11 @@ static int __bprm_mm_init(struct linux_binprm *bprm) +@@ -266,6 +293,11 @@ static int __bprm_mm_init(struct linux_binprm *bprm) vma->vm_end = STACK_TOP_MAX; vma->vm_start = vma->vm_end - PAGE_SIZE; vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP; @@ -43787,7 +49950,7 @@ index 126e01c..be60c6e 100644 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); INIT_LIST_HEAD(&vma->anon_vma_chain); -@@ -291,6 +320,12 @@ static int __bprm_mm_init(struct linux_binprm *bprm) +@@ -276,6 +308,12 @@ static int __bprm_mm_init(struct linux_binprm *bprm) mm->stack_vm = mm->total_vm = 1; up_write(&mm->mmap_sem); bprm->p = vma->vm_end - sizeof(void *); @@ -43800,28 +49963,16 @@ index 126e01c..be60c6e 100644 return 0; err: up_write(&mm->mmap_sem); -@@ -399,19 +434,7 @@ err: - return err; - } +@@ -396,7 +434,7 @@ struct user_arg_ptr { + } ptr; + }; --struct user_arg_ptr { --#ifdef CONFIG_COMPAT -- bool is_compat; --#endif -- union { -- const char __user *const __user *native; --#ifdef CONFIG_COMPAT -- compat_uptr_t __user *compat; --#endif -- } ptr; --}; -- -static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr) +const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr) { const char __user *native; -@@ -420,14 +443,14 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr) +@@ -405,14 +443,14 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr) compat_uptr_t compat; if (get_user(compat, argv.ptr.compat + nr)) @@ -43838,7 +49989,7 @@ index 126e01c..be60c6e 100644 return native; } -@@ -446,7 +469,7 @@ static int count(struct user_arg_ptr argv, int max) +@@ -431,7 +469,7 @@ static int count(struct user_arg_ptr argv, int max) if (!p) break; @@ -43846,8 +49997,8 @@ index 126e01c..be60c6e 100644 + if (IS_ERR((const char __force_kernel *)p)) return -EFAULT; - if (i++ >= max) -@@ -480,7 +503,7 @@ static int copy_strings(int argc, struct user_arg_ptr argv, + if (i >= max) +@@ -466,7 +504,7 @@ static int copy_strings(int argc, struct user_arg_ptr argv, ret = -EFAULT; str = get_user_arg_ptr(argv, argc); @@ -43856,7 +50007,7 @@ index 126e01c..be60c6e 100644 goto out; len = strnlen_user(str, MAX_ARG_STRLEN); -@@ -562,7 +585,7 @@ int copy_strings_kernel(int argc, const char *const *__argv, +@@ -548,7 +586,7 @@ int copy_strings_kernel(int argc, const char *const *__argv, int r; mm_segment_t oldfs = get_fs(); struct user_arg_ptr argv = { @@ -43865,7 +50016,7 @@ index 126e01c..be60c6e 100644 }; set_fs(KERNEL_DS); -@@ -597,7 +620,8 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) +@@ -583,7 +621,8 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) unsigned long new_end = old_end - shift; struct mmu_gather tlb; @@ -43875,7 +50026,7 @@ index 126e01c..be60c6e 100644 /* * ensure there are no vmas between where we want to go -@@ -606,6 +630,10 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) +@@ -592,6 +631,10 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) if (vma != find_vma(mm, new_start)) return -EFAULT; @@ -43886,7 +50037,7 @@ index 126e01c..be60c6e 100644 /* * cover the whole range: [new_start, old_end) */ -@@ -686,10 +714,6 @@ int setup_arg_pages(struct linux_binprm *bprm, +@@ -672,10 +715,6 @@ int setup_arg_pages(struct linux_binprm *bprm, stack_top = arch_align_stack(stack_top); stack_top = PAGE_ALIGN(stack_top); @@ -43897,7 +50048,7 @@ index 126e01c..be60c6e 100644 stack_shift = vma->vm_end - stack_top; bprm->p -= stack_shift; -@@ -701,8 +725,28 @@ int setup_arg_pages(struct linux_binprm *bprm, +@@ -687,8 +726,28 @@ int setup_arg_pages(struct linux_binprm *bprm, bprm->exec -= stack_shift; down_write(&mm->mmap_sem); @@ -43926,7 +50077,7 @@ index 126e01c..be60c6e 100644 /* * Adjust stack execute permissions; explicitly enable for * EXSTACK_ENABLE_X, disable for EXSTACK_DISABLE_X and leave alone -@@ -721,13 +765,6 @@ int setup_arg_pages(struct linux_binprm *bprm, +@@ -707,13 +766,6 @@ int setup_arg_pages(struct linux_binprm *bprm, goto out_unlock; BUG_ON(prev != vma); @@ -43940,7 +50091,35 @@ index 126e01c..be60c6e 100644 /* mprotect_fixup is overkill to remove the temporary stack flags */ vma->vm_flags &= ~VM_STACK_INCOMPLETE_SETUP; -@@ -785,6 +822,8 @@ struct file *open_exec(const char *name) +@@ -737,6 +789,27 @@ int setup_arg_pages(struct linux_binprm *bprm, + #endif + current->mm->start_stack = bprm->p; + ret = expand_stack(vma, stack_base); ++ ++#if !defined(CONFIG_STACK_GROWSUP) && defined(CONFIG_PAX_RANDMMAP) ++ if (!ret && (mm->pax_flags & MF_PAX_RANDMMAP) && STACK_TOP <= 0xFFFFFFFFU && STACK_TOP > vma->vm_end) { ++ unsigned long size; ++ vm_flags_t vm_flags; ++ ++ size = STACK_TOP - vma->vm_end; ++ vm_flags = VM_NONE | VM_DONTEXPAND | VM_DONTDUMP; ++ ++ ret = vma->vm_end != mmap_region(NULL, vma->vm_end, size, vm_flags, 0); ++ ++#ifdef CONFIG_X86 ++ if (!ret) { ++ size = mmap_min_addr + ((mm->delta_mmap ^ mm->delta_stack) & (0xFFUL << PAGE_SHIFT)); ++ ret = 0 != mmap_region(NULL, 0, PAGE_ALIGN(size), vm_flags, 0); ++ } ++#endif ++ ++ } ++#endif ++ + if (ret) + ret = -EFAULT; + +@@ -772,6 +845,8 @@ struct file *open_exec(const char *name) fsnotify_open(file); @@ -43949,7 +50128,7 @@ index 126e01c..be60c6e 100644 err = deny_write_access(file); if (err) goto exit; -@@ -808,7 +847,7 @@ int kernel_read(struct file *file, loff_t offset, +@@ -795,7 +870,7 @@ int kernel_read(struct file *file, loff_t offset, old_fs = get_fs(); set_fs(get_ds()); /* The cast to a user pointer is valid due to the set_fs() */ @@ -43958,7 +50137,7 @@ index 126e01c..be60c6e 100644 set_fs(old_fs); return result; } -@@ -1254,7 +1293,7 @@ static int check_unsafe_exec(struct linux_binprm *bprm) +@@ -1250,7 +1325,7 @@ static int check_unsafe_exec(struct linux_binprm *bprm) } rcu_read_unlock(); @@ -43967,7 +50146,7 @@ index 126e01c..be60c6e 100644 bprm->unsafe |= LSM_UNSAFE_SHARE; } else { res = -EAGAIN; -@@ -1451,6 +1490,28 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) +@@ -1450,6 +1525,31 @@ int search_binary_handler(struct linux_binprm *bprm) EXPORT_SYMBOL(search_binary_handler); @@ -43993,12 +50172,15 @@ index 126e01c..be60c6e 100644 +static inline void increment_exec_counter(void) {} +#endif + ++extern void gr_handle_exec_args(struct linux_binprm *bprm, ++ struct user_arg_ptr argv); ++ /* * sys_execve() executes a new program. */ -@@ -1459,6 +1520,11 @@ static int do_execve_common(const char *filename, - struct user_arg_ptr envp, - struct pt_regs *regs) +@@ -1457,6 +1557,11 @@ static int do_execve_common(const char *filename, + struct user_arg_ptr argv, + struct user_arg_ptr envp) { +#ifdef CONFIG_GRKERNSEC + struct file *old_exec_file; @@ -44008,7 +50190,7 @@ index 126e01c..be60c6e 100644 struct linux_binprm *bprm; struct file *file; struct files_struct *displaced; -@@ -1466,6 +1532,8 @@ static int do_execve_common(const char *filename, +@@ -1464,6 +1569,8 @@ static int do_execve_common(const char *filename, int retval; const struct cred *cred = current_cred(); @@ -44017,7 +50199,7 @@ index 126e01c..be60c6e 100644 /* * We move the actual failure in case of RLIMIT_NPROC excess from * set*uid() to execve() because too many poorly written programs -@@ -1506,12 +1574,27 @@ static int do_execve_common(const char *filename, +@@ -1504,12 +1611,27 @@ static int do_execve_common(const char *filename, if (IS_ERR(file)) goto out_unmark; @@ -44037,7 +50219,7 @@ index 126e01c..be60c6e 100644 + goto out_file; + } + -+ if (!gr_acl_handle_execve(file->f_dentry, file->f_vfsmnt)) { ++ if (!gr_acl_handle_execve(file->f_path.dentry, file->f_path.mnt)) { + retval = -EACCES; + goto out_file; + } @@ -44045,7 +50227,7 @@ index 126e01c..be60c6e 100644 retval = bprm_mm_init(bprm); if (retval) goto out_file; -@@ -1528,24 +1611,65 @@ static int do_execve_common(const char *filename, +@@ -1526,24 +1648,65 @@ static int do_execve_common(const char *filename, if (retval < 0) goto out; @@ -44058,9 +50240,9 @@ index 126e01c..be60c6e 100644 +#endif +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP + /* limit suid stack to 8MB -+ we saved the old limits above and will restore them if this exec fails -+ */ -+ if (((bprm->cred->euid != current_euid()) || (bprm->cred->egid != current_egid())) && ++ * we saved the old limits above and will restore them if this exec fails ++ */ ++ if (((!uid_eq(bprm->cred->euid, current_euid())) || (!gid_eq(bprm->cred->egid, current_egid()))) && + (old_rlim[RLIMIT_STACK].rlim_cur > (8 * 1024 * 1024))) + current->signal->rlim[RLIMIT_STACK].rlim_cur = 8 * 1024 * 1024; +#endif @@ -44075,7 +50257,7 @@ index 126e01c..be60c6e 100644 + goto out_fail; + } + -+ retval = gr_set_proc_label(file->f_dentry, file->f_vfsmnt, ++ retval = gr_set_proc_label(file->f_path.dentry, file->f_path.mnt, + bprm->unsafe); + if (retval < 0) + goto out_fail; @@ -44096,11 +50278,11 @@ index 126e01c..be60c6e 100644 - goto out; + goto out_fail; + -+ gr_log_chroot_exec(file->f_dentry, file->f_vfsmnt); ++ gr_log_chroot_exec(file->f_path.dentry, file->f_path.mnt); + + gr_handle_exec_args(bprm, argv); - retval = search_binary_handler(bprm,regs); + retval = search_binary_handler(bprm); if (retval < 0) - goto out; + goto out_fail; @@ -44115,7 +50297,7 @@ index 126e01c..be60c6e 100644 current->fs->in_exec = 0; current->in_execve = 0; acct_update_integrals(current); -@@ -1554,6 +1678,14 @@ static int do_execve_common(const char *filename, +@@ -1552,6 +1715,14 @@ static int do_execve_common(const char *filename, put_files_struct(displaced); return retval; @@ -44130,28 +50312,11 @@ index 126e01c..be60c6e 100644 out: if (bprm->mm) { acct_arg_size(bprm, 0); -@@ -1627,7 +1759,7 @@ static int expand_corename(struct core_name *cn) - { - char *old_corename = cn->corename; - -- cn->size = CORENAME_MAX_SIZE * atomic_inc_return(&call_count); -+ cn->size = CORENAME_MAX_SIZE * atomic_inc_return_unchecked(&call_count); - cn->corename = krealloc(old_corename, cn->size, GFP_KERNEL); - - if (!cn->corename) { -@@ -1724,7 +1856,7 @@ static int format_corename(struct core_name *cn, long signr) - int pid_in_pattern = 0; - int err = 0; - -- cn->size = CORENAME_MAX_SIZE * atomic_read(&call_count); -+ cn->size = CORENAME_MAX_SIZE * atomic_read_unchecked(&call_count); - cn->corename = kmalloc(cn->size, GFP_KERNEL); - cn->used = 0; - -@@ -1821,6 +1953,250 @@ out: - return ispipe; +@@ -1700,3 +1871,283 @@ asmlinkage long compat_sys_execve(const char __user * filename, + return error; } - + #endif ++ +int pax_check_flags(unsigned long *flags) +{ + int retval = 0; @@ -44160,7 +50325,7 @@ index 126e01c..be60c6e 100644 + if (*flags & MF_PAX_SEGMEXEC) + { + *flags &= ~MF_PAX_SEGMEXEC; -+ retval = -EINVAL; ++ retval = -EINVAL; + } +#endif + @@ -44185,7 +50350,7 @@ index 126e01c..be60c6e 100644 + ) + { + *flags &= ~MF_PAX_MPROTECT; -+ retval = -EINVAL; ++ retval = -EINVAL; + } + + if ((*flags & MF_PAX_EMUTRAMP) @@ -44215,6 +50380,7 @@ index 126e01c..be60c6e 100644 + char *path_exec = NULL; + char *path_fault = NULL; + unsigned long start = 0UL, end = 0UL, offset = 0UL; ++ siginfo_t info = { }; + + if (buffer_exec && buffer_fault) { + struct vm_area_struct *vma, *vma_exec = NULL, *vma_fault = NULL; @@ -44222,7 +50388,7 @@ index 126e01c..be60c6e 100644 + down_read(&mm->mmap_sem); + vma = mm->mmap; + while (vma && (!vma_exec || !vma_fault)) { -+ if ((vma->vm_flags & VM_EXECUTABLE) && vma->vm_file) ++ if (vma->vm_file && mm->exe_file == vma->vm_file && (vma->vm_flags & VM_EXEC)) + vma_exec = vma; + if (vma->vm_start <= (unsigned long)pc && (unsigned long)pc < vma->vm_end) + vma_fault = vma; @@ -44266,13 +50432,17 @@ index 126e01c..be60c6e 100644 + printk(KERN_ERR "PAX: From %pI4: execution attempt in: %s, %08lx-%08lx %08lx\n", &tsk->signal->curr_ip, path_fault, start, end, offset); + else + printk(KERN_ERR "PAX: execution attempt in: %s, %08lx-%08lx %08lx\n", path_fault, start, end, offset); -+ printk(KERN_ERR "PAX: terminating task: %s(%s):%d, uid/euid: %u/%u, " -+ "PC: %p, SP: %p\n", path_exec, tsk->comm, task_pid_nr(tsk), -+ task_uid(tsk), task_euid(tsk), pc, sp); ++ printk(KERN_ERR "PAX: terminating task: %s(%s):%d, uid/euid: %u/%u, PC: %p, SP: %p\n", path_exec, tsk->comm, task_pid_nr(tsk), ++ from_kuid_munged(&init_user_ns, task_uid(tsk)), from_kuid_munged(&init_user_ns, task_euid(tsk)), pc, sp); + free_page((unsigned long)buffer_exec); + free_page((unsigned long)buffer_fault); + pax_report_insns(regs, pc, sp); -+ do_coredump(SIGKILL, SIGKILL, regs); ++ info.si_signo = SIGKILL; ++ info.si_errno = 0; ++ info.si_code = SI_KERNEL; ++ info.si_pid = 0; ++ info.si_uid = 0; ++ do_coredump(&info); +} +#endif + @@ -44281,10 +50451,11 @@ index 126e01c..be60c6e 100644 +{ + if (current->signal->curr_ip) + printk(KERN_ERR "PAX: From %pI4: refcount overflow detected in: %s:%d, uid/euid: %u/%u\n", -+ ¤t->signal->curr_ip, current->comm, task_pid_nr(current), current_uid(), current_euid()); ++ ¤t->signal->curr_ip, current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid())); + else -+ printk(KERN_ERR "PAX: refcount overflow detected in: %s:%d, uid/euid: %u/%u\n", -+ current->comm, task_pid_nr(current), current_uid(), current_euid()); ++ printk(KERN_ERR "PAX: refcount overflow detected in: %s:%d, uid/euid: %u/%u\n", current->comm, task_pid_nr(current), ++ from_kuid_munged(&init_user_ns, current_uid()), from_kuid_munged(&init_user_ns, current_euid())); + print_symbol(KERN_ERR "PAX: refcount overflow occured at: %s\n", instruction_pointer(regs)); + show_regs(regs); + force_sig_info(SIGKILL, SEND_SIG_FORCED, current); @@ -44339,21 +50510,44 @@ index 126e01c..be60c6e 100644 +#endif +} + -+static __noreturn void pax_report_usercopy(const void *ptr, unsigned long len, bool to, const char *type) ++static __noreturn void pax_report_usercopy(const void *ptr, unsigned long len, bool to_user, const char *type) +{ + if (current->signal->curr_ip) + printk(KERN_ERR "PAX: From %pI4: kernel memory %s attempt detected %s %p (%s) (%lu bytes)\n", -+ ¤t->signal->curr_ip, to ? "leak" : "overwrite", to ? "from" : "to", ptr, type ? : "unknown", len); ++ ¤t->signal->curr_ip, to_user ? "leak" : "overwrite", to_user ? "from" : "to", ptr, type ? : "unknown", len); + else + printk(KERN_ERR "PAX: kernel memory %s attempt detected %s %p (%s) (%lu bytes)\n", -+ to ? "leak" : "overwrite", to ? "from" : "to", ptr, type ? : "unknown", len); ++ to_user ? "leak" : "overwrite", to_user ? "from" : "to", ptr, type ? : "unknown", len); + dump_stack(); + gr_handle_kernel_exploit(); + do_group_exit(SIGKILL); +} +#endif + -+void check_object_size(const void *ptr, unsigned long n, bool to) ++#ifdef CONFIG_PAX_USERCOPY ++static inline bool check_kernel_text_object(unsigned long low, unsigned long high) ++{ ++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) ++ unsigned long textlow = ktla_ktva((unsigned long)_stext); ++#ifdef CONFIG_MODULES ++ unsigned long texthigh = (unsigned long)MODULES_EXEC_VADDR; ++#else ++ unsigned long texthigh = ktla_ktva((unsigned long)_etext); ++#endif ++ ++#else ++ unsigned long textlow = _stext; ++ unsigned long texthigh = _etext; ++#endif ++ ++ if (high <= textlow || low > texthigh) ++ return false; ++ else ++ return true; ++} ++#endif ++ ++void __check_object_size(const void *ptr, unsigned long n, bool to_user) +{ + +#ifdef CONFIG_PAX_USERCOPY @@ -44362,18 +50556,25 @@ index 126e01c..be60c6e 100644 + if (!n) + return; + -+ type = check_heap_object(ptr, n, to); ++ type = check_heap_object(ptr, n); + if (!type) { -+ if (check_stack_object(ptr, n) != -1) ++ int ret = check_stack_object(ptr, n); ++ if (ret == 1 || ret == 2) + return; -+ type = "<process stack>"; ++ if (ret == 0) { ++ if (check_kernel_text_object((unsigned long)ptr, (unsigned long)ptr + n)) ++ type = "<kernel text>"; ++ else ++ return; ++ } else ++ type = "<process stack>"; + } + -+ pax_report_usercopy(ptr, n, to, type); ++ pax_report_usercopy(ptr, n, to_user, type); +#endif + +} -+EXPORT_SYMBOL(check_object_size); ++EXPORT_SYMBOL(__check_object_size); + +#ifdef CONFIG_PAX_MEMORY_STACKLEAK +void pax_track_stack(void) @@ -44387,209 +50588,68 @@ index 126e01c..be60c6e 100644 +#endif + +#ifdef CONFIG_PAX_SIZE_OVERFLOW -+void report_size_overflow(const char *file, unsigned int line, const char *func) ++void report_size_overflow(const char *file, unsigned int line, const char *func, const char *ssa_name) +{ -+ printk(KERN_ERR "PAX: size overflow detected in function %s %s:%u\n", func, file, line); ++ printk(KERN_ERR "PAX: size overflow detected in function %s %s:%u %s", func, file, line, ssa_name); + dump_stack(); + do_group_exit(SIGKILL); +} +EXPORT_SYMBOL(report_size_overflow); +#endif -+ - static int zap_process(struct task_struct *start, int exit_code) - { - struct task_struct *t; -@@ -1980,17 +2356,17 @@ static void coredump_finish(struct mm_struct *mm) - void set_dumpable(struct mm_struct *mm, int value) - { - switch (value) { -- case 0: -+ case SUID_DUMPABLE_DISABLED: - clear_bit(MMF_DUMPABLE, &mm->flags); - smp_wmb(); - clear_bit(MMF_DUMP_SECURELY, &mm->flags); - break; -- case 1: -+ case SUID_DUMPABLE_ENABLED: - set_bit(MMF_DUMPABLE, &mm->flags); - smp_wmb(); - clear_bit(MMF_DUMP_SECURELY, &mm->flags); - break; -- case 2: -+ case SUID_DUMPABLE_SAFE: - set_bit(MMF_DUMP_SECURELY, &mm->flags); - smp_wmb(); - set_bit(MMF_DUMPABLE, &mm->flags); -@@ -2003,7 +2379,7 @@ static int __get_dumpable(unsigned long mm_flags) - int ret; - - ret = mm_flags & MMF_DUMPABLE_MASK; -- return (ret >= 2) ? 2 : ret; -+ return (ret > SUID_DUMPABLE_ENABLED) ? SUID_DUMPABLE_SAFE : ret; - } - - int get_dumpable(struct mm_struct *mm) -@@ -2018,17 +2394,17 @@ static void wait_for_dump_helpers(struct file *file) - pipe = file->f_path.dentry->d_inode->i_pipe; - - pipe_lock(pipe); -- pipe->readers++; -- pipe->writers--; -+ atomic_inc(&pipe->readers); -+ atomic_dec(&pipe->writers); - -- while ((pipe->readers > 1) && (!signal_pending(current))) { -+ while ((atomic_read(&pipe->readers) > 1) && (!signal_pending(current))) { - wake_up_interruptible_sync(&pipe->wait); - kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); - pipe_wait(pipe); - } - -- pipe->readers--; -- pipe->writers++; -+ atomic_dec(&pipe->readers); -+ atomic_inc(&pipe->writers); - pipe_unlock(pipe); - - } -@@ -2089,7 +2465,8 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) - int retval = 0; - int flag = 0; - int ispipe; -- static atomic_t core_dump_count = ATOMIC_INIT(0); -+ bool need_nonrelative = false; -+ static atomic_unchecked_t core_dump_count = ATOMIC_INIT(0); - struct coredump_params cprm = { - .signr = signr, - .regs = regs, -@@ -2104,6 +2481,9 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) - - audit_core_dumps(signr); - -+ if (signr == SIGSEGV || signr == SIGBUS || signr == SIGKILL || signr == SIGILL) -+ gr_handle_brute_attach(current, cprm.mm_flags); -+ - binfmt = mm->binfmt; - if (!binfmt || !binfmt->core_dump) - goto fail; -@@ -2114,14 +2494,16 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) - if (!cred) - goto fail; - /* -- * We cannot trust fsuid as being the "true" uid of the -- * process nor do we know its entire history. We only know it -- * was tainted so we dump it as root in mode 2. -+ * We cannot trust fsuid as being the "true" uid of the process -+ * nor do we know its entire history. We only know it was tainted -+ * so we dump it as root in mode 2, and only into a controlled -+ * environment (pipe handler or fully qualified path). - */ -- if (__get_dumpable(cprm.mm_flags) == 2) { -+ if (__get_dumpable(cprm.mm_flags) == SUID_DUMPABLE_SAFE) { - /* Setuid core dump mode */ - flag = O_EXCL; /* Stop rewrite attacks */ - cred->fsuid = 0; /* Dump root private */ -+ need_nonrelative = true; - } - - retval = coredump_wait(exit_code, &core_state); -@@ -2171,7 +2553,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) - } - cprm.limit = RLIM_INFINITY; - -- dump_count = atomic_inc_return(&core_dump_count); -+ dump_count = atomic_inc_return_unchecked(&core_dump_count); - if (core_pipe_limit && (core_pipe_limit < dump_count)) { - printk(KERN_WARNING "Pid %d(%s) over core_pipe_limit\n", - task_tgid_vnr(current), current->comm); -@@ -2198,9 +2580,19 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) - } else { - struct inode *inode; - -+ gr_learn_resource(current, RLIMIT_CORE, binfmt->min_coredump, 1); -+ - if (cprm.limit < binfmt->min_coredump) - goto fail_unlock; - -+ if (need_nonrelative && cn.corename[0] != '/') { -+ printk(KERN_WARNING "Pid %d(%s) can only dump core "\ -+ "to fully qualified path!\n", -+ task_tgid_vnr(current), current->comm); -+ printk(KERN_WARNING "Skipping core dump\n"); -+ goto fail_unlock; -+ } -+ - cprm.file = filp_open(cn.corename, - O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE | flag, - 0600); -@@ -2241,7 +2633,7 @@ close_fail: - filp_close(cprm.file, NULL); - fail_dropcount: - if (ispipe) -- atomic_dec(&core_dump_count); -+ atomic_dec_unchecked(&core_dump_count); - fail_unlock: - kfree(cn.corename); - fail_corename: -@@ -2260,7 +2652,7 @@ fail: - */ - int dump_write(struct file *file, const void *addr, int nr) - { -- return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, addr, nr, &file->f_pos) == nr; -+ return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, (const char __force_user *)addr, nr, &file->f_pos) == nr; - } - EXPORT_SYMBOL(dump_write); - diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c -index a8cbe1b..fed04cb 100644 +index 9f9992b..8b59411 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c -@@ -1192,7 +1192,7 @@ static int ext2_has_free_blocks(struct ext2_sb_info *sbi) +@@ -1184,10 +1184,10 @@ static int ext2_has_free_blocks(struct ext2_sb_info *sbi) free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter); root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count); - if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) && -+ if (free_blocks < root_blocks + 1 && !capable_nolog(CAP_SYS_RESOURCE) && - sbi->s_resuid != current_fsuid() && - (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) { ++ if (free_blocks < root_blocks + 1 && + !uid_eq(sbi->s_resuid, current_fsuid()) && + (gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) || +- !in_group_p (sbi->s_resgid))) { ++ !in_group_p (sbi->s_resgid)) && !capable_nolog(CAP_SYS_RESOURCE)) { return 0; + } + return 1; diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c -index baac1b1..1499b62 100644 +index 22548f5..41521d8 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c -@@ -1438,9 +1438,10 @@ static int ext3_has_free_blocks(struct ext3_sb_info *sbi, int use_reservation) +@@ -1438,10 +1438,10 @@ static int ext3_has_free_blocks(struct ext3_sb_info *sbi, int use_reservation) free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter); root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count); - if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) && + if (free_blocks < root_blocks + 1 && - !use_reservation && sbi->s_resuid != current_fsuid() && -- (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) { -+ (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid)) && -+ !capable_nolog(CAP_SYS_RESOURCE)) { + !use_reservation && !uid_eq(sbi->s_resuid, current_fsuid()) && + (gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) || +- !in_group_p (sbi->s_resgid))) { ++ !in_group_p (sbi->s_resgid)) && !capable_nolog(CAP_SYS_RESOURCE)) { return 0; } return 1; diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c -index df76291..60a4ad3 100644 +index 92e68b3..115d987 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c -@@ -463,8 +463,8 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi, +@@ -505,8 +505,8 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi, /* Hm, nope. Are (enough) root reserved clusters available? */ - if (sbi->s_resuid == current_fsuid() || - ((sbi->s_resgid != 0) && in_group_p(sbi->s_resgid)) || + if (uid_eq(sbi->s_resuid, current_fsuid()) || + (!gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) && in_group_p(sbi->s_resgid)) || - capable(CAP_SYS_RESOURCE) || - (flags & EXT4_MB_USE_ROOT_BLOCKS)) { -+ (flags & EXT4_MB_USE_ROOT_BLOCKS) || ++ (flags & EXT4_MB_USE_ROOT_BLOCKS) || + capable_nolog(CAP_SYS_RESOURCE)) { if (free_clusters >= (nclusters + dirty_clusters)) return 1; diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h -index 47d1c8c..a8e1cc7 100644 +index 3b83cd6..0f34dcd 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h -@@ -1224,19 +1224,19 @@ struct ext4_sb_info { +@@ -1254,19 +1254,19 @@ struct ext4_sb_info { unsigned long s_mb_last_start; /* stats for buddy allocator */ @@ -44620,10 +50680,10 @@ index 47d1c8c..a8e1cc7 100644 /* locality groups */ diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c -index 6b0a57e..1955a44 100644 +index f3190ab..84ffb21 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c -@@ -1747,7 +1747,7 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac, +@@ -1754,7 +1754,7 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac, BUG_ON(ac->ac_b_ex.fe_len != ac->ac_g_ex.fe_len); if (EXT4_SB(sb)->s_mb_stats) @@ -44632,7 +50692,7 @@ index 6b0a57e..1955a44 100644 break; } -@@ -2041,7 +2041,7 @@ repeat: +@@ -2059,7 +2059,7 @@ repeat: ac->ac_status = AC_STATUS_CONTINUE; ac->ac_flags |= EXT4_MB_HINT_FIRST; cr = 3; @@ -44641,7 +50701,7 @@ index 6b0a57e..1955a44 100644 goto repeat; } } -@@ -2545,25 +2545,25 @@ int ext4_mb_release(struct super_block *sb) +@@ -2567,25 +2567,25 @@ int ext4_mb_release(struct super_block *sb) if (sbi->s_mb_stats) { ext4_msg(sb, KERN_INFO, "mballoc: %u blocks %u reqs (%u success)", @@ -44677,7 +50737,7 @@ index 6b0a57e..1955a44 100644 } free_percpu(sbi->s_locality_groups); -@@ -3045,16 +3045,16 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac) +@@ -3039,16 +3039,16 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac) struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb); if (sbi->s_mb_stats && ac->ac_g_ex.fe_len > 1) { @@ -44700,7 +50760,7 @@ index 6b0a57e..1955a44 100644 } if (ac->ac_op == EXT4_MB_HISTORY_ALLOC) -@@ -3458,7 +3458,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac) +@@ -3448,7 +3448,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac) trace_ext4_mb_new_inode_pa(ac, pa); ext4_mb_use_inode_pa(ac, pa); @@ -44709,7 +50769,7 @@ index 6b0a57e..1955a44 100644 ei = EXT4_I(ac->ac_inode); grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group); -@@ -3518,7 +3518,7 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac) +@@ -3508,7 +3508,7 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac) trace_ext4_mb_new_group_pa(ac, pa); ext4_mb_use_group_pa(ac, pa); @@ -44718,7 +50778,7 @@ index 6b0a57e..1955a44 100644 grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group); lg = ac->ac_lg; -@@ -3607,7 +3607,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh, +@@ -3597,7 +3597,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh, * from the bitmap and continue. */ } @@ -44727,7 +50787,7 @@ index 6b0a57e..1955a44 100644 return err; } -@@ -3625,7 +3625,7 @@ ext4_mb_release_group_pa(struct ext4_buddy *e4b, +@@ -3615,7 +3615,7 @@ ext4_mb_release_group_pa(struct ext4_buddy *e4b, ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, &bit); BUG_ON(group != e4b->bd_group && pa->pa_len != 0); mb_free_blocks(pa->pa_inode, e4b, bit, pa->pa_len); @@ -44736,11 +50796,24 @@ index 6b0a57e..1955a44 100644 trace_ext4_mballoc_discard(sb, NULL, group, bit, pa->pa_len); return 0; +diff --git a/fs/ext4/super.c b/fs/ext4/super.c +index febbe0e..782c4fd 100644 +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -2380,7 +2380,7 @@ struct ext4_attr { + ssize_t (*store)(struct ext4_attr *, struct ext4_sb_info *, + const char *, size_t); + int offset; +-}; ++} __do_const; + + static int parse_strtoul(const char *buf, + unsigned long max, unsigned long *value) diff --git a/fs/fcntl.c b/fs/fcntl.c -index 75e7c1f..1eb3e4d 100644 +index 6599222..e7bf0de 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c -@@ -224,6 +224,11 @@ int __f_setown(struct file *filp, struct pid *pid, enum pid_type type, +@@ -107,6 +107,11 @@ int __f_setown(struct file *filp, struct pid *pid, enum pid_type type, if (err) return err; @@ -44752,32 +50825,20 @@ index 75e7c1f..1eb3e4d 100644 f_modown(filp, pid, type, force); return 0; } -@@ -266,7 +271,7 @@ pid_t f_getown(struct file *filp) - - static int f_setown_ex(struct file *filp, unsigned long arg) - { -- struct f_owner_ex * __user owner_p = (void * __user)arg; -+ struct f_owner_ex __user *owner_p = (void __user *)arg; - struct f_owner_ex owner; - struct pid *pid; - int type; -@@ -306,7 +311,7 @@ static int f_setown_ex(struct file *filp, unsigned long arg) - - static int f_getown_ex(struct file *filp, unsigned long arg) - { -- struct f_owner_ex * __user owner_p = (void * __user)arg; -+ struct f_owner_ex __user *owner_p = (void __user *)arg; - struct f_owner_ex owner; - int ret = 0; - -@@ -348,6 +353,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg, - switch (cmd) { - case F_DUPFD: - case F_DUPFD_CLOEXEC: -+ gr_learn_resource(current, RLIMIT_NOFILE, arg, 0); - if (arg >= rlimit(RLIMIT_NOFILE)) - break; - err = alloc_fd(arg, cmd == F_DUPFD_CLOEXEC ? O_CLOEXEC : 0); +diff --git a/fs/fhandle.c b/fs/fhandle.c +index 999ff5c..41f4109 100644 +--- a/fs/fhandle.c ++++ b/fs/fhandle.c +@@ -67,8 +67,7 @@ static long do_sys_name_to_handle(struct path *path, + } else + retval = 0; + /* copy the mount id */ +- if (copy_to_user(mnt_id, &real_mount(path->mnt)->mnt_id, +- sizeof(*mnt_id)) || ++ if (put_user(real_mount(path->mnt)->mnt_id, mnt_id) || + copy_to_user(ufh, handle, + sizeof(struct file_handle) + handle_bytes)) + retval = -EFAULT; diff --git a/fs/fifo.c b/fs/fifo.c index cf6f434..3d7942c 100644 --- a/fs/fifo.c @@ -44853,10 +50914,10 @@ index cf6f434..3d7942c 100644 err_nocleanup: diff --git a/fs/file.c b/fs/file.c -index ba3f605..fade102 100644 +index 3906d95..5fe379b 100644 --- a/fs/file.c +++ b/fs/file.c -@@ -15,6 +15,7 @@ +@@ -16,6 +16,7 @@ #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/file.h> @@ -44864,33 +50925,48 @@ index ba3f605..fade102 100644 #include <linux/fdtable.h> #include <linux/bitops.h> #include <linux/interrupt.h> -@@ -255,6 +256,7 @@ int expand_files(struct files_struct *files, int nr) - * N.B. For clone tasks sharing a files structure, this test - * will limit the total number of files that can be opened. - */ -+ gr_learn_resource(current, RLIMIT_NOFILE, nr, 0); - if (nr >= rlimit(RLIMIT_NOFILE)) - return -EMFILE; +@@ -892,6 +893,7 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags) + if (!file) + return __close_fd(files, fd); + ++ gr_learn_resource(current, RLIMIT_NOFILE, fd, 0); + if (fd >= rlimit(RLIMIT_NOFILE)) + return -EBADF; +@@ -918,6 +920,7 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags) + if (unlikely(oldfd == newfd)) + return -EINVAL; + ++ gr_learn_resource(current, RLIMIT_NOFILE, newfd, 0); + if (newfd >= rlimit(RLIMIT_NOFILE)) + return -EBADF; + +@@ -973,6 +976,7 @@ SYSCALL_DEFINE1(dup, unsigned int, fildes) + int f_dupfd(unsigned int from, struct file *file, unsigned flags) + { + int err; ++ gr_learn_resource(current, RLIMIT_NOFILE, from, 0); + if (from >= rlimit(RLIMIT_NOFILE)) + return -EINVAL; + err = alloc_fd(from, flags); diff --git a/fs/filesystems.c b/fs/filesystems.c -index 96f2428..f5eeb8e 100644 +index 92567d9..fcd8cbf 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c -@@ -273,7 +273,12 @@ struct file_system_type *get_fs_type(const char *name) +@@ -273,7 +273,11 @@ struct file_system_type *get_fs_type(const char *name) int len = dot ? dot - name : strlen(name); fs = __get_fs_type(name, len); -+ +#ifdef CONFIG_GRKERNSEC_MODHARDEN -+ if (!fs && (___request_module(true, "grsec_modharden_fs", "%.*s", len, name) == 0)) ++ if (!fs && (___request_module(true, "grsec_modharden_fs", "fs-%.*s", len, name) == 0)) +#else - if (!fs && (request_module("%.*s", len, name) == 0)) + if (!fs && (request_module("fs-%.*s", len, name) == 0)) +#endif fs = __get_fs_type(name, len); if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) { diff --git a/fs/fs_struct.c b/fs/fs_struct.c -index e159e68..e7d2a6f 100644 +index d8ac61d..79a36f0 100644 --- a/fs/fs_struct.c +++ b/fs/fs_struct.c @@ -4,6 +4,7 @@ @@ -44900,8 +50976,8 @@ index e159e68..e7d2a6f 100644 +#include <linux/grsecurity.h> #include "internal.h" - static inline void path_get_longterm(struct path *path) -@@ -31,6 +32,7 @@ void set_fs_root(struct fs_struct *fs, struct path *path) + /* +@@ -19,6 +20,7 @@ void set_fs_root(struct fs_struct *fs, const struct path *path) write_seqcount_begin(&fs->seq); old_root = fs->root; fs->root = *path; @@ -44909,34 +50985,18 @@ index e159e68..e7d2a6f 100644 write_seqcount_end(&fs->seq); spin_unlock(&fs->lock); if (old_root.dentry) -@@ -65,6 +67,17 @@ static inline int replace_path(struct path *p, const struct path *old, const str - return 1; - } - -+static inline int replace_root_path(struct task_struct *task, struct path *p, const struct path *old, struct path *new) -+{ -+ if (likely(p->dentry != old->dentry || p->mnt != old->mnt)) -+ return 0; -+ *p = *new; -+ -+ gr_set_chroot_entries(task, new); -+ -+ return 1; -+} -+ - void chroot_fs_refs(struct path *old_root, struct path *new_root) - { - struct task_struct *g, *p; -@@ -79,7 +92,7 @@ void chroot_fs_refs(struct path *old_root, struct path *new_root) +@@ -67,6 +69,10 @@ void chroot_fs_refs(const struct path *old_root, const struct path *new_root) int hits = 0; spin_lock(&fs->lock); write_seqcount_begin(&fs->seq); -- hits += replace_path(&fs->root, old_root, new_root); -+ hits += replace_root_path(p, &fs->root, old_root, new_root); ++ /* this root replacement is only done by pivot_root, ++ leave grsec's chroot tagging alone for this task ++ so that a pivoted root isn't treated as a chroot ++ */ + hits += replace_path(&fs->root, old_root, new_root); hits += replace_path(&fs->pwd, old_root, new_root); write_seqcount_end(&fs->seq); - while (hits--) { -@@ -111,7 +124,8 @@ void exit_fs(struct task_struct *tsk) +@@ -99,7 +105,8 @@ void exit_fs(struct task_struct *tsk) task_lock(tsk); spin_lock(&fs->lock); tsk->fs = NULL; @@ -44946,7 +51006,7 @@ index e159e68..e7d2a6f 100644 spin_unlock(&fs->lock); task_unlock(tsk); if (kill) -@@ -124,7 +138,7 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old) +@@ -112,7 +119,7 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old) struct fs_struct *fs = kmem_cache_alloc(fs_cachep, GFP_KERNEL); /* We don't need to lock fs - think why ;-) */ if (fs) { @@ -44955,17 +51015,17 @@ index e159e68..e7d2a6f 100644 fs->in_exec = 0; spin_lock_init(&fs->lock); seqcount_init(&fs->seq); -@@ -133,6 +147,9 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old) +@@ -121,6 +128,9 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old) spin_lock(&old->lock); fs->root = old->root; - path_get_longterm(&fs->root); + path_get(&fs->root); + /* instead of calling gr_set_chroot_entries here, + we call it from every caller of this function + */ fs->pwd = old->pwd; - path_get_longterm(&fs->pwd); + path_get(&fs->pwd); spin_unlock(&old->lock); -@@ -151,8 +168,9 @@ int unshare_fs_struct(void) +@@ -139,8 +149,9 @@ int unshare_fs_struct(void) task_lock(current); spin_lock(&fs->lock); @@ -44976,7 +51036,7 @@ index e159e68..e7d2a6f 100644 spin_unlock(&fs->lock); task_unlock(current); -@@ -165,13 +183,13 @@ EXPORT_SYMBOL_GPL(unshare_fs_struct); +@@ -153,13 +164,13 @@ EXPORT_SYMBOL_GPL(unshare_fs_struct); int current_umask(void) { @@ -44992,24 +51052,8 @@ index e159e68..e7d2a6f 100644 .lock = __SPIN_LOCK_UNLOCKED(init_fs.lock), .seq = SEQCNT_ZERO, .umask = 0022, -@@ -187,12 +205,13 @@ void daemonize_fs_struct(void) - task_lock(current); - - spin_lock(&init_fs.lock); -- init_fs.users++; -+ atomic_inc(&init_fs.users); - spin_unlock(&init_fs.lock); - - spin_lock(&fs->lock); - current->fs = &init_fs; -- kill = !--fs->users; -+ gr_set_chroot_entries(current, ¤t->fs->root); -+ kill = !atomic_dec_return(&fs->users); - spin_unlock(&fs->lock); - - task_unlock(current); diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c -index 9905350..02eaec4 100644 +index e2cba1f..17a25bb 100644 --- a/fs/fscache/cookie.c +++ b/fs/fscache/cookie.c @@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire_cookie( @@ -45077,7 +51121,7 @@ index 9905350..02eaec4 100644 _leave(" = -ENOMEDIUM [no cache]"); return -ENOMEDIUM; } -@@ -256,12 +256,12 @@ static int fscache_alloc_object(struct fscache_cache *cache, +@@ -255,12 +255,12 @@ static int fscache_alloc_object(struct fscache_cache *cache, object = cache->ops->alloc_object(cache, cookie); fscache_stat_d(&fscache_n_cop_alloc_object); if (IS_ERR(object)) { @@ -45092,9 +51136,18 @@ index 9905350..02eaec4 100644 object->debug_id = atomic_inc_return(&fscache_object_debug_id); -@@ -377,10 +377,10 @@ void __fscache_update_cookie(struct fscache_cookie *cookie) +@@ -376,7 +376,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie) + + _enter("{%s}", cookie->def->name); + +- fscache_stat(&fscache_n_invalidates); ++ fscache_stat_unchecked(&fscache_n_invalidates); + + /* Only permit invalidation of data files. Invalidating an index will + * require the caller to release all its attachments to the tree rooted +@@ -434,10 +434,10 @@ void __fscache_update_cookie(struct fscache_cookie *cookie) + { struct fscache_object *object; - struct hlist_node *_p; - fscache_stat(&fscache_n_updates); + fscache_stat_unchecked(&fscache_n_updates); @@ -45105,7 +51158,7 @@ index 9905350..02eaec4 100644 _leave(" [no cookie]"); return; } -@@ -414,12 +414,12 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) +@@ -471,12 +471,12 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) struct fscache_object *object; unsigned long event; @@ -45121,7 +51174,7 @@ index 9905350..02eaec4 100644 _leave(" [no cookie]"); return; } -@@ -435,7 +435,7 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) +@@ -492,7 +492,7 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) /* wait for the cookie to finish being instantiated (or to fail) */ if (test_bit(FSCACHE_COOKIE_CREATING, &cookie->flags)) { @@ -45131,12 +51184,17 @@ index 9905350..02eaec4 100644 fscache_wait_bit, TASK_UNINTERRUPTIBLE); } diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h -index f6aad48..88dcf26 100644 +index ee38fef..0a326d4 100644 --- a/fs/fscache/internal.h +++ b/fs/fscache/internal.h -@@ -144,94 +144,94 @@ extern void fscache_proc_cleanup(void); - extern atomic_t fscache_n_ops_processed[FSCACHE_MAX_THREADS]; - extern atomic_t fscache_n_objs_processed[FSCACHE_MAX_THREADS]; +@@ -148,101 +148,101 @@ extern void fscache_proc_cleanup(void); + * stats.c + */ + #ifdef CONFIG_FSCACHE_STATS +-extern atomic_t fscache_n_ops_processed[FSCACHE_MAX_THREADS]; +-extern atomic_t fscache_n_objs_processed[FSCACHE_MAX_THREADS]; ++extern atomic_unchecked_t fscache_n_ops_processed[FSCACHE_MAX_THREADS]; ++extern atomic_unchecked_t fscache_n_objs_processed[FSCACHE_MAX_THREADS]; -extern atomic_t fscache_n_op_pend; -extern atomic_t fscache_n_op_run; @@ -45146,13 +51204,26 @@ index f6aad48..88dcf26 100644 -extern atomic_t fscache_n_op_gc; -extern atomic_t fscache_n_op_cancelled; -extern atomic_t fscache_n_op_rejected; -- ++extern atomic_unchecked_t fscache_n_op_pend; ++extern atomic_unchecked_t fscache_n_op_run; ++extern atomic_unchecked_t fscache_n_op_enqueue; ++extern atomic_unchecked_t fscache_n_op_deferred_release; ++extern atomic_unchecked_t fscache_n_op_release; ++extern atomic_unchecked_t fscache_n_op_gc; ++extern atomic_unchecked_t fscache_n_op_cancelled; ++extern atomic_unchecked_t fscache_n_op_rejected; + -extern atomic_t fscache_n_attr_changed; -extern atomic_t fscache_n_attr_changed_ok; -extern atomic_t fscache_n_attr_changed_nobufs; -extern atomic_t fscache_n_attr_changed_nomem; -extern atomic_t fscache_n_attr_changed_calls; -- ++extern atomic_unchecked_t fscache_n_attr_changed; ++extern atomic_unchecked_t fscache_n_attr_changed_ok; ++extern atomic_unchecked_t fscache_n_attr_changed_nobufs; ++extern atomic_unchecked_t fscache_n_attr_changed_nomem; ++extern atomic_unchecked_t fscache_n_attr_changed_calls; + -extern atomic_t fscache_n_allocs; -extern atomic_t fscache_n_allocs_ok; -extern atomic_t fscache_n_allocs_wait; @@ -45161,7 +51232,15 @@ index f6aad48..88dcf26 100644 -extern atomic_t fscache_n_allocs_object_dead; -extern atomic_t fscache_n_alloc_ops; -extern atomic_t fscache_n_alloc_op_waits; -- ++extern atomic_unchecked_t fscache_n_allocs; ++extern atomic_unchecked_t fscache_n_allocs_ok; ++extern atomic_unchecked_t fscache_n_allocs_wait; ++extern atomic_unchecked_t fscache_n_allocs_nobufs; ++extern atomic_unchecked_t fscache_n_allocs_intr; ++extern atomic_unchecked_t fscache_n_allocs_object_dead; ++extern atomic_unchecked_t fscache_n_alloc_ops; ++extern atomic_unchecked_t fscache_n_alloc_op_waits; + -extern atomic_t fscache_n_retrievals; -extern atomic_t fscache_n_retrievals_ok; -extern atomic_t fscache_n_retrievals_wait; @@ -45172,84 +51251,6 @@ index f6aad48..88dcf26 100644 -extern atomic_t fscache_n_retrievals_object_dead; -extern atomic_t fscache_n_retrieval_ops; -extern atomic_t fscache_n_retrieval_op_waits; -- --extern atomic_t fscache_n_stores; --extern atomic_t fscache_n_stores_ok; --extern atomic_t fscache_n_stores_again; --extern atomic_t fscache_n_stores_nobufs; --extern atomic_t fscache_n_stores_oom; --extern atomic_t fscache_n_store_ops; --extern atomic_t fscache_n_store_calls; --extern atomic_t fscache_n_store_pages; --extern atomic_t fscache_n_store_radix_deletes; --extern atomic_t fscache_n_store_pages_over_limit; -- --extern atomic_t fscache_n_store_vmscan_not_storing; --extern atomic_t fscache_n_store_vmscan_gone; --extern atomic_t fscache_n_store_vmscan_busy; --extern atomic_t fscache_n_store_vmscan_cancelled; -- --extern atomic_t fscache_n_marks; --extern atomic_t fscache_n_uncaches; -- --extern atomic_t fscache_n_acquires; --extern atomic_t fscache_n_acquires_null; --extern atomic_t fscache_n_acquires_no_cache; --extern atomic_t fscache_n_acquires_ok; --extern atomic_t fscache_n_acquires_nobufs; --extern atomic_t fscache_n_acquires_oom; -- --extern atomic_t fscache_n_updates; --extern atomic_t fscache_n_updates_null; --extern atomic_t fscache_n_updates_run; -- --extern atomic_t fscache_n_relinquishes; --extern atomic_t fscache_n_relinquishes_null; --extern atomic_t fscache_n_relinquishes_waitcrt; --extern atomic_t fscache_n_relinquishes_retire; -- --extern atomic_t fscache_n_cookie_index; --extern atomic_t fscache_n_cookie_data; --extern atomic_t fscache_n_cookie_special; -- --extern atomic_t fscache_n_object_alloc; --extern atomic_t fscache_n_object_no_alloc; --extern atomic_t fscache_n_object_lookups; --extern atomic_t fscache_n_object_lookups_negative; --extern atomic_t fscache_n_object_lookups_positive; --extern atomic_t fscache_n_object_lookups_timed_out; --extern atomic_t fscache_n_object_created; --extern atomic_t fscache_n_object_avail; --extern atomic_t fscache_n_object_dead; -- --extern atomic_t fscache_n_checkaux_none; --extern atomic_t fscache_n_checkaux_okay; --extern atomic_t fscache_n_checkaux_update; --extern atomic_t fscache_n_checkaux_obsolete; -+extern atomic_unchecked_t fscache_n_op_pend; -+extern atomic_unchecked_t fscache_n_op_run; -+extern atomic_unchecked_t fscache_n_op_enqueue; -+extern atomic_unchecked_t fscache_n_op_deferred_release; -+extern atomic_unchecked_t fscache_n_op_release; -+extern atomic_unchecked_t fscache_n_op_gc; -+extern atomic_unchecked_t fscache_n_op_cancelled; -+extern atomic_unchecked_t fscache_n_op_rejected; -+ -+extern atomic_unchecked_t fscache_n_attr_changed; -+extern atomic_unchecked_t fscache_n_attr_changed_ok; -+extern atomic_unchecked_t fscache_n_attr_changed_nobufs; -+extern atomic_unchecked_t fscache_n_attr_changed_nomem; -+extern atomic_unchecked_t fscache_n_attr_changed_calls; -+ -+extern atomic_unchecked_t fscache_n_allocs; -+extern atomic_unchecked_t fscache_n_allocs_ok; -+extern atomic_unchecked_t fscache_n_allocs_wait; -+extern atomic_unchecked_t fscache_n_allocs_nobufs; -+extern atomic_unchecked_t fscache_n_allocs_intr; -+extern atomic_unchecked_t fscache_n_allocs_object_dead; -+extern atomic_unchecked_t fscache_n_alloc_ops; -+extern atomic_unchecked_t fscache_n_alloc_op_waits; -+ +extern atomic_unchecked_t fscache_n_retrievals; +extern atomic_unchecked_t fscache_n_retrievals_ok; +extern atomic_unchecked_t fscache_n_retrievals_wait; @@ -45260,7 +51261,17 @@ index f6aad48..88dcf26 100644 +extern atomic_unchecked_t fscache_n_retrievals_object_dead; +extern atomic_unchecked_t fscache_n_retrieval_ops; +extern atomic_unchecked_t fscache_n_retrieval_op_waits; -+ + +-extern atomic_t fscache_n_stores; +-extern atomic_t fscache_n_stores_ok; +-extern atomic_t fscache_n_stores_again; +-extern atomic_t fscache_n_stores_nobufs; +-extern atomic_t fscache_n_stores_oom; +-extern atomic_t fscache_n_store_ops; +-extern atomic_t fscache_n_store_calls; +-extern atomic_t fscache_n_store_pages; +-extern atomic_t fscache_n_store_radix_deletes; +-extern atomic_t fscache_n_store_pages_over_limit; +extern atomic_unchecked_t fscache_n_stores; +extern atomic_unchecked_t fscache_n_stores_ok; +extern atomic_unchecked_t fscache_n_stores_again; @@ -45271,35 +51282,73 @@ index f6aad48..88dcf26 100644 +extern atomic_unchecked_t fscache_n_store_pages; +extern atomic_unchecked_t fscache_n_store_radix_deletes; +extern atomic_unchecked_t fscache_n_store_pages_over_limit; -+ + +-extern atomic_t fscache_n_store_vmscan_not_storing; +-extern atomic_t fscache_n_store_vmscan_gone; +-extern atomic_t fscache_n_store_vmscan_busy; +-extern atomic_t fscache_n_store_vmscan_cancelled; +-extern atomic_t fscache_n_store_vmscan_wait; +extern atomic_unchecked_t fscache_n_store_vmscan_not_storing; +extern atomic_unchecked_t fscache_n_store_vmscan_gone; +extern atomic_unchecked_t fscache_n_store_vmscan_busy; +extern atomic_unchecked_t fscache_n_store_vmscan_cancelled; -+ ++extern atomic_unchecked_t fscache_n_store_vmscan_wait; + +-extern atomic_t fscache_n_marks; +-extern atomic_t fscache_n_uncaches; +extern atomic_unchecked_t fscache_n_marks; +extern atomic_unchecked_t fscache_n_uncaches; -+ + +-extern atomic_t fscache_n_acquires; +-extern atomic_t fscache_n_acquires_null; +-extern atomic_t fscache_n_acquires_no_cache; +-extern atomic_t fscache_n_acquires_ok; +-extern atomic_t fscache_n_acquires_nobufs; +-extern atomic_t fscache_n_acquires_oom; +extern atomic_unchecked_t fscache_n_acquires; +extern atomic_unchecked_t fscache_n_acquires_null; +extern atomic_unchecked_t fscache_n_acquires_no_cache; +extern atomic_unchecked_t fscache_n_acquires_ok; +extern atomic_unchecked_t fscache_n_acquires_nobufs; +extern atomic_unchecked_t fscache_n_acquires_oom; -+ + +-extern atomic_t fscache_n_invalidates; +-extern atomic_t fscache_n_invalidates_run; ++extern atomic_unchecked_t fscache_n_invalidates; ++extern atomic_unchecked_t fscache_n_invalidates_run; + +-extern atomic_t fscache_n_updates; +-extern atomic_t fscache_n_updates_null; +-extern atomic_t fscache_n_updates_run; +extern atomic_unchecked_t fscache_n_updates; +extern atomic_unchecked_t fscache_n_updates_null; +extern atomic_unchecked_t fscache_n_updates_run; -+ + +-extern atomic_t fscache_n_relinquishes; +-extern atomic_t fscache_n_relinquishes_null; +-extern atomic_t fscache_n_relinquishes_waitcrt; +-extern atomic_t fscache_n_relinquishes_retire; +extern atomic_unchecked_t fscache_n_relinquishes; +extern atomic_unchecked_t fscache_n_relinquishes_null; +extern atomic_unchecked_t fscache_n_relinquishes_waitcrt; +extern atomic_unchecked_t fscache_n_relinquishes_retire; -+ + +-extern atomic_t fscache_n_cookie_index; +-extern atomic_t fscache_n_cookie_data; +-extern atomic_t fscache_n_cookie_special; +extern atomic_unchecked_t fscache_n_cookie_index; +extern atomic_unchecked_t fscache_n_cookie_data; +extern atomic_unchecked_t fscache_n_cookie_special; -+ + +-extern atomic_t fscache_n_object_alloc; +-extern atomic_t fscache_n_object_no_alloc; +-extern atomic_t fscache_n_object_lookups; +-extern atomic_t fscache_n_object_lookups_negative; +-extern atomic_t fscache_n_object_lookups_positive; +-extern atomic_t fscache_n_object_lookups_timed_out; +-extern atomic_t fscache_n_object_created; +-extern atomic_t fscache_n_object_avail; +-extern atomic_t fscache_n_object_dead; +extern atomic_unchecked_t fscache_n_object_alloc; +extern atomic_unchecked_t fscache_n_object_no_alloc; +extern atomic_unchecked_t fscache_n_object_lookups; @@ -45309,7 +51358,11 @@ index f6aad48..88dcf26 100644 +extern atomic_unchecked_t fscache_n_object_created; +extern atomic_unchecked_t fscache_n_object_avail; +extern atomic_unchecked_t fscache_n_object_dead; -+ + +-extern atomic_t fscache_n_checkaux_none; +-extern atomic_t fscache_n_checkaux_okay; +-extern atomic_t fscache_n_checkaux_update; +-extern atomic_t fscache_n_checkaux_obsolete; +extern atomic_unchecked_t fscache_n_checkaux_none; +extern atomic_unchecked_t fscache_n_checkaux_okay; +extern atomic_unchecked_t fscache_n_checkaux_update; @@ -45317,7 +51370,7 @@ index f6aad48..88dcf26 100644 extern atomic_t fscache_n_cop_alloc_object; extern atomic_t fscache_n_cop_lookup_object; -@@ -255,6 +255,11 @@ static inline void fscache_stat(atomic_t *stat) +@@ -267,6 +267,11 @@ static inline void fscache_stat(atomic_t *stat) atomic_inc(stat); } @@ -45329,7 +51382,7 @@ index f6aad48..88dcf26 100644 static inline void fscache_stat_d(atomic_t *stat) { atomic_dec(stat); -@@ -267,6 +272,7 @@ extern const struct file_operations fscache_stats_fops; +@@ -279,6 +284,7 @@ extern const struct file_operations fscache_stats_fops; #define __fscache_stat(stat) (NULL) #define fscache_stat(stat) do {} while (0) @@ -45338,10 +51391,19 @@ index f6aad48..88dcf26 100644 #endif diff --git a/fs/fscache/object.c b/fs/fscache/object.c -index b6b897c..0ffff9c 100644 +index 50d41c1..10ee117 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c -@@ -128,7 +128,7 @@ static void fscache_object_state_machine(struct fscache_object *object) +@@ -143,7 +143,7 @@ static void fscache_object_state_machine(struct fscache_object *object) + /* Invalidate an object on disk */ + case FSCACHE_OBJECT_INVALIDATING: + clear_bit(FSCACHE_OBJECT_EV_INVALIDATE, &object->events); +- fscache_stat(&fscache_n_invalidates_run); ++ fscache_stat_unchecked(&fscache_n_invalidates_run); + fscache_stat(&fscache_n_cop_invalidate_object); + fscache_invalidate_object(object); + fscache_stat_d(&fscache_n_cop_invalidate_object); +@@ -153,7 +153,7 @@ static void fscache_object_state_machine(struct fscache_object *object) /* update the object metadata on disk */ case FSCACHE_OBJECT_UPDATING: clear_bit(FSCACHE_OBJECT_EV_UPDATE, &object->events); @@ -45350,7 +51412,7 @@ index b6b897c..0ffff9c 100644 fscache_stat(&fscache_n_cop_update_object); object->cache->ops->update_object(object); fscache_stat_d(&fscache_n_cop_update_object); -@@ -217,7 +217,7 @@ static void fscache_object_state_machine(struct fscache_object *object) +@@ -242,7 +242,7 @@ static void fscache_object_state_machine(struct fscache_object *object) spin_lock(&object->lock); object->state = FSCACHE_OBJECT_DEAD; spin_unlock(&object->lock); @@ -45359,7 +51421,7 @@ index b6b897c..0ffff9c 100644 goto terminal_transit; /* handle the parent cache of this object being withdrawn from -@@ -232,7 +232,7 @@ static void fscache_object_state_machine(struct fscache_object *object) +@@ -257,7 +257,7 @@ static void fscache_object_state_machine(struct fscache_object *object) spin_lock(&object->lock); object->state = FSCACHE_OBJECT_DEAD; spin_unlock(&object->lock); @@ -45368,7 +51430,7 @@ index b6b897c..0ffff9c 100644 goto terminal_transit; /* complain about the object being woken up once it is -@@ -461,7 +461,7 @@ static void fscache_lookup_object(struct fscache_object *object) +@@ -495,7 +495,7 @@ static void fscache_lookup_object(struct fscache_object *object) parent->cookie->def->name, cookie->def->name, object->cache->tag->name); @@ -45377,7 +51439,7 @@ index b6b897c..0ffff9c 100644 fscache_stat(&fscache_n_cop_lookup_object); ret = object->cache->ops->lookup_object(object); fscache_stat_d(&fscache_n_cop_lookup_object); -@@ -472,7 +472,7 @@ static void fscache_lookup_object(struct fscache_object *object) +@@ -506,7 +506,7 @@ static void fscache_lookup_object(struct fscache_object *object) if (ret == -ETIMEDOUT) { /* probably stuck behind another object, so move this one to * the back of the queue */ @@ -45386,7 +51448,7 @@ index b6b897c..0ffff9c 100644 set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events); } -@@ -495,7 +495,7 @@ void fscache_object_lookup_negative(struct fscache_object *object) +@@ -529,7 +529,7 @@ void fscache_object_lookup_negative(struct fscache_object *object) spin_lock(&object->lock); if (object->state == FSCACHE_OBJECT_LOOKING_UP) { @@ -45395,7 +51457,7 @@ index b6b897c..0ffff9c 100644 /* transit here to allow write requests to begin stacking up * and read requests to begin returning ENODATA */ -@@ -541,7 +541,7 @@ void fscache_obtained_object(struct fscache_object *object) +@@ -575,7 +575,7 @@ void fscache_obtained_object(struct fscache_object *object) * result, in which case there may be data available */ spin_lock(&object->lock); if (object->state == FSCACHE_OBJECT_LOOKING_UP) { @@ -45404,7 +51466,7 @@ index b6b897c..0ffff9c 100644 clear_bit(FSCACHE_COOKIE_NO_DATA_YET, &cookie->flags); -@@ -555,7 +555,7 @@ void fscache_obtained_object(struct fscache_object *object) +@@ -589,7 +589,7 @@ void fscache_obtained_object(struct fscache_object *object) set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events); } else { ASSERTCMP(object->state, ==, FSCACHE_OBJECT_CREATING); @@ -45413,7 +51475,7 @@ index b6b897c..0ffff9c 100644 object->state = FSCACHE_OBJECT_AVAILABLE; spin_unlock(&object->lock); -@@ -602,7 +602,7 @@ static void fscache_object_available(struct fscache_object *object) +@@ -634,7 +634,7 @@ static void fscache_object_available(struct fscache_object *object) fscache_enqueue_dependents(object); fscache_hist(fscache_obj_instantiate_histogram, object->lookup_jif); @@ -45422,7 +51484,7 @@ index b6b897c..0ffff9c 100644 _leave(""); } -@@ -861,7 +861,7 @@ enum fscache_checkaux fscache_check_aux(struct fscache_object *object, +@@ -894,7 +894,7 @@ enum fscache_checkaux fscache_check_aux(struct fscache_object *object, enum fscache_checkaux result; if (!object->cookie->def->check_aux) { @@ -45431,7 +51493,7 @@ index b6b897c..0ffff9c 100644 return FSCACHE_CHECKAUX_OKAY; } -@@ -870,17 +870,17 @@ enum fscache_checkaux fscache_check_aux(struct fscache_object *object, +@@ -903,17 +903,17 @@ enum fscache_checkaux fscache_check_aux(struct fscache_object *object, switch (result) { /* entry okay as is */ case FSCACHE_CHECKAUX_OKAY: @@ -45453,7 +51515,7 @@ index b6b897c..0ffff9c 100644 default: diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c -index 30afdfa..2256596 100644 +index 762a9ec..2023284 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c @@ -17,7 +17,7 @@ @@ -45465,16 +51527,16 @@ index 30afdfa..2256596 100644 EXPORT_SYMBOL(fscache_op_debug_id); /** -@@ -38,7 +38,7 @@ void fscache_enqueue_operation(struct fscache_operation *op) - ASSERTCMP(op->object->state, >=, FSCACHE_OBJECT_AVAILABLE); +@@ -39,7 +39,7 @@ void fscache_enqueue_operation(struct fscache_operation *op) ASSERTCMP(atomic_read(&op->usage), >, 0); + ASSERTCMP(op->state, ==, FSCACHE_OP_ST_IN_PROGRESS); - fscache_stat(&fscache_n_op_enqueue); + fscache_stat_unchecked(&fscache_n_op_enqueue); switch (op->flags & FSCACHE_OP_TYPE) { case FSCACHE_OP_ASYNC: _debug("queue async"); -@@ -69,7 +69,7 @@ static void fscache_run_op(struct fscache_object *object, +@@ -73,7 +73,7 @@ static void fscache_run_op(struct fscache_object *object, wake_up_bit(&op->flags, FSCACHE_OP_WAITING); if (op->processor) fscache_enqueue_operation(op); @@ -45483,8 +51545,8 @@ index 30afdfa..2256596 100644 } /* -@@ -98,11 +98,11 @@ int fscache_submit_exclusive_op(struct fscache_object *object, - if (object->n_ops > 1) { +@@ -105,11 +105,11 @@ int fscache_submit_exclusive_op(struct fscache_object *object, + if (object->n_in_progress > 0) { atomic_inc(&op->usage); list_add_tail(&op->pend_link, &object->pending_ops); - fscache_stat(&fscache_n_op_pend); @@ -45497,7 +51559,7 @@ index 30afdfa..2256596 100644 fscache_start_operations(object); } else { ASSERTCMP(object->n_in_progress, ==, 0); -@@ -118,7 +118,7 @@ int fscache_submit_exclusive_op(struct fscache_object *object, +@@ -125,7 +125,7 @@ int fscache_submit_exclusive_op(struct fscache_object *object, object->n_exclusive++; /* reads and writes must wait */ atomic_inc(&op->usage); list_add_tail(&op->pend_link, &object->pending_ops); @@ -45505,8 +51567,8 @@ index 30afdfa..2256596 100644 + fscache_stat_unchecked(&fscache_n_op_pend); ret = 0; } else { - /* not allowed to submit ops in any other state */ -@@ -203,11 +203,11 @@ int fscache_submit_op(struct fscache_object *object, + /* If we're in any other state, there must have been an I/O +@@ -215,11 +215,11 @@ int fscache_submit_op(struct fscache_object *object, if (object->n_exclusive > 0) { atomic_inc(&op->usage); list_add_tail(&op->pend_link, &object->pending_ops); @@ -45520,7 +51582,7 @@ index 30afdfa..2256596 100644 fscache_start_operations(object); } else { ASSERTCMP(object->n_exclusive, ==, 0); -@@ -219,12 +219,12 @@ int fscache_submit_op(struct fscache_object *object, +@@ -231,12 +231,12 @@ int fscache_submit_op(struct fscache_object *object, object->n_ops++; atomic_inc(&op->usage); list_add_tail(&op->pend_link, &object->pending_ops); @@ -45532,28 +51594,37 @@ index 30afdfa..2256596 100644 object->state == FSCACHE_OBJECT_WITHDRAWING) { - fscache_stat(&fscache_n_op_rejected); + fscache_stat_unchecked(&fscache_n_op_rejected); + op->state = FSCACHE_OP_ST_CANCELLED; ret = -ENOBUFS; } else if (!test_bit(FSCACHE_IOERROR, &object->cache->flags)) { - fscache_report_unexpected_submission(object, op, ostate); -@@ -294,7 +294,7 @@ int fscache_cancel_op(struct fscache_operation *op) - +@@ -315,7 +315,7 @@ int fscache_cancel_op(struct fscache_operation *op, ret = -EBUSY; - if (!list_empty(&op->pend_link)) { + if (op->state == FSCACHE_OP_ST_PENDING) { + ASSERT(!list_empty(&op->pend_link)); +- fscache_stat(&fscache_n_op_cancelled); ++ fscache_stat_unchecked(&fscache_n_op_cancelled); + list_del_init(&op->pend_link); + if (do_cancel) + do_cancel(op); +@@ -347,7 +347,7 @@ void fscache_cancel_all_ops(struct fscache_object *object) + while (!list_empty(&object->pending_ops)) { + op = list_entry(object->pending_ops.next, + struct fscache_operation, pend_link); - fscache_stat(&fscache_n_op_cancelled); + fscache_stat_unchecked(&fscache_n_op_cancelled); list_del_init(&op->pend_link); - object->n_ops--; - if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags)) -@@ -331,7 +331,7 @@ void fscache_put_operation(struct fscache_operation *op) - if (test_and_set_bit(FSCACHE_OP_DEAD, &op->flags)) - BUG(); + + ASSERTCMP(op->state, ==, FSCACHE_OP_ST_PENDING); +@@ -419,7 +419,7 @@ void fscache_put_operation(struct fscache_operation *op) + op->state, ==, FSCACHE_OP_ST_CANCELLED); + op->state = FSCACHE_OP_ST_DEAD; - fscache_stat(&fscache_n_op_release); + fscache_stat_unchecked(&fscache_n_op_release); if (op->release) { op->release(op); -@@ -348,7 +348,7 @@ void fscache_put_operation(struct fscache_operation *op) +@@ -442,7 +442,7 @@ void fscache_put_operation(struct fscache_operation *op) * lock, and defer it otherwise */ if (!spin_trylock(&object->lock)) { _debug("defer put"); @@ -45562,7 +51633,7 @@ index 30afdfa..2256596 100644 cache = object->cache; spin_lock(&cache->op_gc_list_lock); -@@ -410,7 +410,7 @@ void fscache_operation_gc(struct work_struct *work) +@@ -495,7 +495,7 @@ void fscache_operation_gc(struct work_struct *work) _debug("GC DEFERRED REL OBJ%x OP%x", object->debug_id, op->debug_id); @@ -45570,12 +51641,12 @@ index 30afdfa..2256596 100644 + fscache_stat_unchecked(&fscache_n_op_gc); ASSERTCMP(atomic_read(&op->usage), ==, 0); - + ASSERTCMP(op->state, ==, FSCACHE_OP_ST_DEAD); diff --git a/fs/fscache/page.c b/fs/fscache/page.c -index 3f7a59b..cf196cc 100644 +index ff000e5..c44ec6d 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c -@@ -60,7 +60,7 @@ bool __fscache_maybe_release_page(struct fscache_cookie *cookie, +@@ -61,7 +61,7 @@ try_again: val = radix_tree_lookup(&cookie->stores, page->index); if (!val) { rcu_read_unlock(); @@ -45584,7 +51655,7 @@ index 3f7a59b..cf196cc 100644 __fscache_uncache_page(cookie, page); return true; } -@@ -90,11 +90,11 @@ bool __fscache_maybe_release_page(struct fscache_cookie *cookie, +@@ -91,11 +91,11 @@ try_again: spin_unlock(&cookie->stores_lock); if (xpage) { @@ -45599,16 +51670,21 @@ index 3f7a59b..cf196cc 100644 } wake_up_bit(&cookie->flags, 0); -@@ -107,7 +107,7 @@ page_busy: - /* we might want to wait here, but that could deadlock the allocator as - * the work threads writing to the cache may all end up sleeping - * on memory allocation */ -- fscache_stat(&fscache_n_store_vmscan_busy); -+ fscache_stat_unchecked(&fscache_n_store_vmscan_busy); - return false; - } - EXPORT_SYMBOL(__fscache_maybe_release_page); -@@ -131,7 +131,7 @@ static void fscache_end_page_write(struct fscache_object *object, +@@ -110,11 +110,11 @@ page_busy: + * sleeping on memory allocation, so we may need to impose a timeout + * too. */ + if (!(gfp & __GFP_WAIT)) { +- fscache_stat(&fscache_n_store_vmscan_busy); ++ fscache_stat_unchecked(&fscache_n_store_vmscan_busy); + return false; + } + +- fscache_stat(&fscache_n_store_vmscan_wait); ++ fscache_stat_unchecked(&fscache_n_store_vmscan_wait); + __fscache_wait_on_page_write(cookie, page); + gfp &= ~__GFP_WAIT; + goto try_again; +@@ -140,7 +140,7 @@ static void fscache_end_page_write(struct fscache_object *object, FSCACHE_COOKIE_STORING_TAG); if (!radix_tree_tag_get(&cookie->stores, page->index, FSCACHE_COOKIE_PENDING_TAG)) { @@ -45617,7 +51693,7 @@ index 3f7a59b..cf196cc 100644 xpage = radix_tree_delete(&cookie->stores, page->index); } spin_unlock(&cookie->stores_lock); -@@ -152,7 +152,7 @@ static void fscache_attr_changed_op(struct fscache_operation *op) +@@ -161,7 +161,7 @@ static void fscache_attr_changed_op(struct fscache_operation *op) _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id); @@ -45626,7 +51702,7 @@ index 3f7a59b..cf196cc 100644 if (fscache_object_is_active(object)) { fscache_stat(&fscache_n_cop_attr_changed); -@@ -177,11 +177,11 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) +@@ -187,11 +187,11 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX); @@ -45640,7 +51716,7 @@ index 3f7a59b..cf196cc 100644 _leave(" = -ENOMEM"); return -ENOMEM; } -@@ -199,7 +199,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) +@@ -209,7 +209,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) if (fscache_submit_exclusive_op(object, op) < 0) goto nobufs; spin_unlock(&cookie->lock); @@ -45649,7 +51725,7 @@ index 3f7a59b..cf196cc 100644 fscache_put_operation(op); _leave(" = 0"); return 0; -@@ -207,7 +207,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) +@@ -217,7 +217,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie) nobufs: spin_unlock(&cookie->lock); kfree(op); @@ -45658,7 +51734,7 @@ index 3f7a59b..cf196cc 100644 _leave(" = %d", -ENOBUFS); return -ENOBUFS; } -@@ -243,7 +243,7 @@ static struct fscache_retrieval *fscache_alloc_retrieval( +@@ -255,7 +255,7 @@ static struct fscache_retrieval *fscache_alloc_retrieval( /* allocate a retrieval operation and attempt to submit it */ op = kzalloc(sizeof(*op), GFP_NOIO); if (!op) { @@ -45667,7 +51743,7 @@ index 3f7a59b..cf196cc 100644 return NULL; } -@@ -271,13 +271,13 @@ static int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie) +@@ -283,13 +283,13 @@ static int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie) return 0; } @@ -45683,7 +51759,7 @@ index 3f7a59b..cf196cc 100644 _leave(" = -ERESTARTSYS"); return -ERESTARTSYS; } -@@ -295,8 +295,8 @@ static int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie) +@@ -318,8 +318,8 @@ static void fscache_do_cancel_retrieval(struct fscache_operation *_op) */ static int fscache_wait_for_retrieval_activation(struct fscache_object *object, struct fscache_retrieval *op, @@ -45694,7 +51770,7 @@ index 3f7a59b..cf196cc 100644 { int ret; -@@ -304,7 +304,7 @@ static int fscache_wait_for_retrieval_activation(struct fscache_object *object, +@@ -327,7 +327,7 @@ static int fscache_wait_for_retrieval_activation(struct fscache_object *object, goto check_if_dead; _debug(">>> WT"); @@ -45702,17 +51778,25 @@ index 3f7a59b..cf196cc 100644 + fscache_stat_unchecked(stat_op_waits); if (wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING, fscache_wait_bit_interruptible, - TASK_INTERRUPTIBLE) < 0) { -@@ -321,7 +321,7 @@ static int fscache_wait_for_retrieval_activation(struct fscache_object *object, + TASK_INTERRUPTIBLE) != 0) { +@@ -344,14 +344,14 @@ static int fscache_wait_for_retrieval_activation(struct fscache_object *object, check_if_dead: + if (op->op.state == FSCACHE_OP_ST_CANCELLED) { +- fscache_stat(stat_object_dead); ++ fscache_stat_unchecked(stat_object_dead); + _leave(" = -ENOBUFS [cancelled]"); + return -ENOBUFS; + } if (unlikely(fscache_object_is_dead(object))) { + pr_err("%s() = -ENOBUFS [obj dead %d]\n", __func__, op->op.state); + fscache_cancel_op(&op->op, fscache_do_cancel_retrieval); - fscache_stat(stat_object_dead); + fscache_stat_unchecked(stat_object_dead); return -ENOBUFS; } return 0; -@@ -348,7 +348,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie, +@@ -378,7 +378,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie, _enter("%p,%p,,,", cookie, page); @@ -45721,8 +51805,8 @@ index 3f7a59b..cf196cc 100644 if (hlist_empty(&cookie->backing_objects)) goto nobufs; -@@ -381,7 +381,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie, - goto nobufs_unlock; +@@ -417,7 +417,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie, + goto nobufs_unlock_dec; spin_unlock(&cookie->lock); - fscache_stat(&fscache_n_retrieval_ops); @@ -45730,7 +51814,7 @@ index 3f7a59b..cf196cc 100644 /* pin the netfs read context in case we need to do the actual netfs * read because we've encountered a cache read failure */ -@@ -411,15 +411,15 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie, +@@ -447,15 +447,15 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie, error: if (ret == -ENOMEM) @@ -45751,7 +51835,7 @@ index 3f7a59b..cf196cc 100644 fscache_put_retrieval(op); _leave(" = %d", ret); -@@ -429,7 +429,7 @@ nobufs_unlock: +@@ -467,7 +467,7 @@ nobufs_unlock: spin_unlock(&cookie->lock); kfree(op); nobufs: @@ -45760,7 +51844,7 @@ index 3f7a59b..cf196cc 100644 _leave(" = -ENOBUFS"); return -ENOBUFS; } -@@ -467,7 +467,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie, +@@ -505,7 +505,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie, _enter("%p,,%d,,,", cookie, *nr_pages); @@ -45769,8 +51853,8 @@ index 3f7a59b..cf196cc 100644 if (hlist_empty(&cookie->backing_objects)) goto nobufs; -@@ -497,7 +497,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie, - goto nobufs_unlock; +@@ -541,7 +541,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie, + goto nobufs_unlock_dec; spin_unlock(&cookie->lock); - fscache_stat(&fscache_n_retrieval_ops); @@ -45778,7 +51862,7 @@ index 3f7a59b..cf196cc 100644 /* pin the netfs read context in case we need to do the actual netfs * read because we've encountered a cache read failure */ -@@ -527,15 +527,15 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie, +@@ -571,15 +571,15 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie, error: if (ret == -ENOMEM) @@ -45799,7 +51883,7 @@ index 3f7a59b..cf196cc 100644 fscache_put_retrieval(op); _leave(" = %d", ret); -@@ -545,7 +545,7 @@ nobufs_unlock: +@@ -591,7 +591,7 @@ nobufs_unlock: spin_unlock(&cookie->lock); kfree(op); nobufs: @@ -45808,7 +51892,7 @@ index 3f7a59b..cf196cc 100644 _leave(" = -ENOBUFS"); return -ENOBUFS; } -@@ -569,7 +569,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie, +@@ -615,7 +615,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie, _enter("%p,%p,,,", cookie, page); @@ -45817,7 +51901,7 @@ index 3f7a59b..cf196cc 100644 if (hlist_empty(&cookie->backing_objects)) goto nobufs; -@@ -595,7 +595,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie, +@@ -647,7 +647,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie, goto nobufs_unlock; spin_unlock(&cookie->lock); @@ -45826,7 +51910,7 @@ index 3f7a59b..cf196cc 100644 ret = fscache_wait_for_retrieval_activation( object, op, -@@ -611,11 +611,11 @@ int __fscache_alloc_page(struct fscache_cookie *cookie, +@@ -663,11 +663,11 @@ int __fscache_alloc_page(struct fscache_cookie *cookie, error: if (ret == -ERESTARTSYS) @@ -45841,7 +51925,7 @@ index 3f7a59b..cf196cc 100644 fscache_put_retrieval(op); _leave(" = %d", ret); -@@ -625,7 +625,7 @@ nobufs_unlock: +@@ -677,7 +677,7 @@ nobufs_unlock: spin_unlock(&cookie->lock); kfree(op); nobufs: @@ -45850,7 +51934,7 @@ index 3f7a59b..cf196cc 100644 _leave(" = -ENOBUFS"); return -ENOBUFS; } -@@ -666,7 +666,7 @@ static void fscache_write_op(struct fscache_operation *_op) +@@ -736,7 +736,7 @@ static void fscache_write_op(struct fscache_operation *_op) spin_lock(&cookie->stores_lock); @@ -45859,7 +51943,7 @@ index 3f7a59b..cf196cc 100644 /* find a page to store */ page = NULL; -@@ -677,7 +677,7 @@ static void fscache_write_op(struct fscache_operation *_op) +@@ -747,7 +747,7 @@ static void fscache_write_op(struct fscache_operation *_op) page = results[0]; _debug("gang %d [%lx]", n, page->index); if (page->index > op->store_limit) { @@ -45868,7 +51952,7 @@ index 3f7a59b..cf196cc 100644 goto superseded; } -@@ -689,7 +689,7 @@ static void fscache_write_op(struct fscache_operation *_op) +@@ -759,7 +759,7 @@ static void fscache_write_op(struct fscache_operation *_op) spin_unlock(&cookie->stores_lock); spin_unlock(&object->lock); @@ -45877,16 +51961,16 @@ index 3f7a59b..cf196cc 100644 fscache_stat(&fscache_n_cop_write_page); ret = object->cache->ops->write_page(op, page); fscache_stat_d(&fscache_n_cop_write_page); -@@ -757,7 +757,7 @@ int __fscache_write_page(struct fscache_cookie *cookie, +@@ -860,7 +860,7 @@ int __fscache_write_page(struct fscache_cookie *cookie, ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX); ASSERT(PageFsCache(page)); - fscache_stat(&fscache_n_stores); + fscache_stat_unchecked(&fscache_n_stores); - op = kzalloc(sizeof(*op), GFP_NOIO); - if (!op) -@@ -808,7 +808,7 @@ int __fscache_write_page(struct fscache_cookie *cookie, + if (test_bit(FSCACHE_COOKIE_INVALIDATING, &cookie->flags)) { + _leave(" = -ENOBUFS [invalidating]"); +@@ -916,7 +916,7 @@ int __fscache_write_page(struct fscache_cookie *cookie, spin_unlock(&cookie->stores_lock); spin_unlock(&object->lock); @@ -45895,7 +51979,7 @@ index 3f7a59b..cf196cc 100644 op->store_limit = object->store_limit; if (fscache_submit_op(object, &op->op) < 0) -@@ -816,8 +816,8 @@ int __fscache_write_page(struct fscache_cookie *cookie, +@@ -924,8 +924,8 @@ int __fscache_write_page(struct fscache_cookie *cookie, spin_unlock(&cookie->lock); radix_tree_preload_end(); @@ -45906,7 +51990,7 @@ index 3f7a59b..cf196cc 100644 /* the work queue now carries its own ref on the object */ fscache_put_operation(&op->op); -@@ -825,14 +825,14 @@ int __fscache_write_page(struct fscache_cookie *cookie, +@@ -933,14 +933,14 @@ int __fscache_write_page(struct fscache_cookie *cookie, return 0; already_queued: @@ -45923,7 +52007,7 @@ index 3f7a59b..cf196cc 100644 _leave(" = 0"); return 0; -@@ -851,14 +851,14 @@ nobufs: +@@ -959,14 +959,14 @@ nobufs: spin_unlock(&cookie->lock); radix_tree_preload_end(); kfree(op); @@ -45940,7 +52024,7 @@ index 3f7a59b..cf196cc 100644 _leave(" = -ENOMEM"); return -ENOMEM; } -@@ -876,7 +876,7 @@ void __fscache_uncache_page(struct fscache_cookie *cookie, struct page *page) +@@ -984,7 +984,7 @@ void __fscache_uncache_page(struct fscache_cookie *cookie, struct page *page) ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX); ASSERTCMP(page, !=, NULL); @@ -45949,20 +52033,20 @@ index 3f7a59b..cf196cc 100644 /* cache withdrawal may beat us to it */ if (!PageFsCache(page)) -@@ -929,7 +929,7 @@ void fscache_mark_pages_cached(struct fscache_retrieval *op, - unsigned long loop; +@@ -1035,7 +1035,7 @@ void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page) + struct fscache_cookie *cookie = op->op.object->cookie; #ifdef CONFIG_FSCACHE_STATS -- atomic_add(pagevec->nr, &fscache_n_marks); -+ atomic_add_unchecked(pagevec->nr, &fscache_n_marks); +- atomic_inc(&fscache_n_marks); ++ atomic_inc_unchecked(&fscache_n_marks); #endif - for (loop = 0; loop < pagevec->nr; loop++) { + _debug("- mark %p{%lx}", page, page->index); diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c -index 4765190..2a067f2 100644 +index 40d13c7..ddf52b9 100644 --- a/fs/fscache/stats.c +++ b/fs/fscache/stats.c -@@ -18,95 +18,95 @@ +@@ -18,99 +18,99 @@ /* * operation counters */ @@ -45975,13 +52059,27 @@ index 4765190..2a067f2 100644 -atomic_t fscache_n_op_gc; -atomic_t fscache_n_op_cancelled; -atomic_t fscache_n_op_rejected; -- ++atomic_unchecked_t fscache_n_op_pend; ++atomic_unchecked_t fscache_n_op_run; ++atomic_unchecked_t fscache_n_op_enqueue; ++atomic_unchecked_t fscache_n_op_requeue; ++atomic_unchecked_t fscache_n_op_deferred_release; ++atomic_unchecked_t fscache_n_op_release; ++atomic_unchecked_t fscache_n_op_gc; ++atomic_unchecked_t fscache_n_op_cancelled; ++atomic_unchecked_t fscache_n_op_rejected; + -atomic_t fscache_n_attr_changed; -atomic_t fscache_n_attr_changed_ok; -atomic_t fscache_n_attr_changed_nobufs; -atomic_t fscache_n_attr_changed_nomem; -atomic_t fscache_n_attr_changed_calls; -- ++atomic_unchecked_t fscache_n_attr_changed; ++atomic_unchecked_t fscache_n_attr_changed_ok; ++atomic_unchecked_t fscache_n_attr_changed_nobufs; ++atomic_unchecked_t fscache_n_attr_changed_nomem; ++atomic_unchecked_t fscache_n_attr_changed_calls; + -atomic_t fscache_n_allocs; -atomic_t fscache_n_allocs_ok; -atomic_t fscache_n_allocs_wait; @@ -45990,7 +52088,15 @@ index 4765190..2a067f2 100644 -atomic_t fscache_n_allocs_object_dead; -atomic_t fscache_n_alloc_ops; -atomic_t fscache_n_alloc_op_waits; -- ++atomic_unchecked_t fscache_n_allocs; ++atomic_unchecked_t fscache_n_allocs_ok; ++atomic_unchecked_t fscache_n_allocs_wait; ++atomic_unchecked_t fscache_n_allocs_nobufs; ++atomic_unchecked_t fscache_n_allocs_intr; ++atomic_unchecked_t fscache_n_allocs_object_dead; ++atomic_unchecked_t fscache_n_alloc_ops; ++atomic_unchecked_t fscache_n_alloc_op_waits; + -atomic_t fscache_n_retrievals; -atomic_t fscache_n_retrievals_ok; -atomic_t fscache_n_retrievals_wait; @@ -46001,85 +52107,6 @@ index 4765190..2a067f2 100644 -atomic_t fscache_n_retrievals_object_dead; -atomic_t fscache_n_retrieval_ops; -atomic_t fscache_n_retrieval_op_waits; -- --atomic_t fscache_n_stores; --atomic_t fscache_n_stores_ok; --atomic_t fscache_n_stores_again; --atomic_t fscache_n_stores_nobufs; --atomic_t fscache_n_stores_oom; --atomic_t fscache_n_store_ops; --atomic_t fscache_n_store_calls; --atomic_t fscache_n_store_pages; --atomic_t fscache_n_store_radix_deletes; --atomic_t fscache_n_store_pages_over_limit; -- --atomic_t fscache_n_store_vmscan_not_storing; --atomic_t fscache_n_store_vmscan_gone; --atomic_t fscache_n_store_vmscan_busy; --atomic_t fscache_n_store_vmscan_cancelled; -- --atomic_t fscache_n_marks; --atomic_t fscache_n_uncaches; -- --atomic_t fscache_n_acquires; --atomic_t fscache_n_acquires_null; --atomic_t fscache_n_acquires_no_cache; --atomic_t fscache_n_acquires_ok; --atomic_t fscache_n_acquires_nobufs; --atomic_t fscache_n_acquires_oom; -- --atomic_t fscache_n_updates; --atomic_t fscache_n_updates_null; --atomic_t fscache_n_updates_run; -- --atomic_t fscache_n_relinquishes; --atomic_t fscache_n_relinquishes_null; --atomic_t fscache_n_relinquishes_waitcrt; --atomic_t fscache_n_relinquishes_retire; -- --atomic_t fscache_n_cookie_index; --atomic_t fscache_n_cookie_data; --atomic_t fscache_n_cookie_special; -- --atomic_t fscache_n_object_alloc; --atomic_t fscache_n_object_no_alloc; --atomic_t fscache_n_object_lookups; --atomic_t fscache_n_object_lookups_negative; --atomic_t fscache_n_object_lookups_positive; --atomic_t fscache_n_object_lookups_timed_out; --atomic_t fscache_n_object_created; --atomic_t fscache_n_object_avail; --atomic_t fscache_n_object_dead; -- --atomic_t fscache_n_checkaux_none; --atomic_t fscache_n_checkaux_okay; --atomic_t fscache_n_checkaux_update; --atomic_t fscache_n_checkaux_obsolete; -+atomic_unchecked_t fscache_n_op_pend; -+atomic_unchecked_t fscache_n_op_run; -+atomic_unchecked_t fscache_n_op_enqueue; -+atomic_unchecked_t fscache_n_op_requeue; -+atomic_unchecked_t fscache_n_op_deferred_release; -+atomic_unchecked_t fscache_n_op_release; -+atomic_unchecked_t fscache_n_op_gc; -+atomic_unchecked_t fscache_n_op_cancelled; -+atomic_unchecked_t fscache_n_op_rejected; -+ -+atomic_unchecked_t fscache_n_attr_changed; -+atomic_unchecked_t fscache_n_attr_changed_ok; -+atomic_unchecked_t fscache_n_attr_changed_nobufs; -+atomic_unchecked_t fscache_n_attr_changed_nomem; -+atomic_unchecked_t fscache_n_attr_changed_calls; -+ -+atomic_unchecked_t fscache_n_allocs; -+atomic_unchecked_t fscache_n_allocs_ok; -+atomic_unchecked_t fscache_n_allocs_wait; -+atomic_unchecked_t fscache_n_allocs_nobufs; -+atomic_unchecked_t fscache_n_allocs_intr; -+atomic_unchecked_t fscache_n_allocs_object_dead; -+atomic_unchecked_t fscache_n_alloc_ops; -+atomic_unchecked_t fscache_n_alloc_op_waits; -+ +atomic_unchecked_t fscache_n_retrievals; +atomic_unchecked_t fscache_n_retrievals_ok; +atomic_unchecked_t fscache_n_retrievals_wait; @@ -46090,7 +52117,17 @@ index 4765190..2a067f2 100644 +atomic_unchecked_t fscache_n_retrievals_object_dead; +atomic_unchecked_t fscache_n_retrieval_ops; +atomic_unchecked_t fscache_n_retrieval_op_waits; -+ + +-atomic_t fscache_n_stores; +-atomic_t fscache_n_stores_ok; +-atomic_t fscache_n_stores_again; +-atomic_t fscache_n_stores_nobufs; +-atomic_t fscache_n_stores_oom; +-atomic_t fscache_n_store_ops; +-atomic_t fscache_n_store_calls; +-atomic_t fscache_n_store_pages; +-atomic_t fscache_n_store_radix_deletes; +-atomic_t fscache_n_store_pages_over_limit; +atomic_unchecked_t fscache_n_stores; +atomic_unchecked_t fscache_n_stores_ok; +atomic_unchecked_t fscache_n_stores_again; @@ -46101,35 +52138,73 @@ index 4765190..2a067f2 100644 +atomic_unchecked_t fscache_n_store_pages; +atomic_unchecked_t fscache_n_store_radix_deletes; +atomic_unchecked_t fscache_n_store_pages_over_limit; -+ + +-atomic_t fscache_n_store_vmscan_not_storing; +-atomic_t fscache_n_store_vmscan_gone; +-atomic_t fscache_n_store_vmscan_busy; +-atomic_t fscache_n_store_vmscan_cancelled; +-atomic_t fscache_n_store_vmscan_wait; +atomic_unchecked_t fscache_n_store_vmscan_not_storing; +atomic_unchecked_t fscache_n_store_vmscan_gone; +atomic_unchecked_t fscache_n_store_vmscan_busy; +atomic_unchecked_t fscache_n_store_vmscan_cancelled; -+ ++atomic_unchecked_t fscache_n_store_vmscan_wait; + +-atomic_t fscache_n_marks; +-atomic_t fscache_n_uncaches; +atomic_unchecked_t fscache_n_marks; +atomic_unchecked_t fscache_n_uncaches; -+ + +-atomic_t fscache_n_acquires; +-atomic_t fscache_n_acquires_null; +-atomic_t fscache_n_acquires_no_cache; +-atomic_t fscache_n_acquires_ok; +-atomic_t fscache_n_acquires_nobufs; +-atomic_t fscache_n_acquires_oom; +atomic_unchecked_t fscache_n_acquires; +atomic_unchecked_t fscache_n_acquires_null; +atomic_unchecked_t fscache_n_acquires_no_cache; +atomic_unchecked_t fscache_n_acquires_ok; +atomic_unchecked_t fscache_n_acquires_nobufs; +atomic_unchecked_t fscache_n_acquires_oom; -+ + +-atomic_t fscache_n_invalidates; +-atomic_t fscache_n_invalidates_run; ++atomic_unchecked_t fscache_n_invalidates; ++atomic_unchecked_t fscache_n_invalidates_run; + +-atomic_t fscache_n_updates; +-atomic_t fscache_n_updates_null; +-atomic_t fscache_n_updates_run; +atomic_unchecked_t fscache_n_updates; +atomic_unchecked_t fscache_n_updates_null; +atomic_unchecked_t fscache_n_updates_run; -+ + +-atomic_t fscache_n_relinquishes; +-atomic_t fscache_n_relinquishes_null; +-atomic_t fscache_n_relinquishes_waitcrt; +-atomic_t fscache_n_relinquishes_retire; +atomic_unchecked_t fscache_n_relinquishes; +atomic_unchecked_t fscache_n_relinquishes_null; +atomic_unchecked_t fscache_n_relinquishes_waitcrt; +atomic_unchecked_t fscache_n_relinquishes_retire; -+ + +-atomic_t fscache_n_cookie_index; +-atomic_t fscache_n_cookie_data; +-atomic_t fscache_n_cookie_special; +atomic_unchecked_t fscache_n_cookie_index; +atomic_unchecked_t fscache_n_cookie_data; +atomic_unchecked_t fscache_n_cookie_special; -+ + +-atomic_t fscache_n_object_alloc; +-atomic_t fscache_n_object_no_alloc; +-atomic_t fscache_n_object_lookups; +-atomic_t fscache_n_object_lookups_negative; +-atomic_t fscache_n_object_lookups_positive; +-atomic_t fscache_n_object_lookups_timed_out; +-atomic_t fscache_n_object_created; +-atomic_t fscache_n_object_avail; +-atomic_t fscache_n_object_dead; +atomic_unchecked_t fscache_n_object_alloc; +atomic_unchecked_t fscache_n_object_no_alloc; +atomic_unchecked_t fscache_n_object_lookups; @@ -46139,7 +52214,11 @@ index 4765190..2a067f2 100644 +atomic_unchecked_t fscache_n_object_created; +atomic_unchecked_t fscache_n_object_avail; +atomic_unchecked_t fscache_n_object_dead; -+ + +-atomic_t fscache_n_checkaux_none; +-atomic_t fscache_n_checkaux_okay; +-atomic_t fscache_n_checkaux_update; +-atomic_t fscache_n_checkaux_obsolete; +atomic_unchecked_t fscache_n_checkaux_none; +atomic_unchecked_t fscache_n_checkaux_okay; +atomic_unchecked_t fscache_n_checkaux_update; @@ -46147,7 +52226,7 @@ index 4765190..2a067f2 100644 atomic_t fscache_n_cop_alloc_object; atomic_t fscache_n_cop_lookup_object; -@@ -133,113 +133,113 @@ static int fscache_stats_show(struct seq_file *m, void *v) +@@ -138,118 +138,118 @@ static int fscache_stats_show(struct seq_file *m, void *v) seq_puts(m, "FS-Cache statistics\n"); seq_printf(m, "Cookies: idx=%u dat=%u spc=%u\n", @@ -46210,6 +52289,12 @@ index 4765190..2a067f2 100644 + atomic_read_unchecked(&fscache_n_object_created), + atomic_read_unchecked(&fscache_n_object_lookups_timed_out)); + seq_printf(m, "Invals : n=%u run=%u\n", +- atomic_read(&fscache_n_invalidates), +- atomic_read(&fscache_n_invalidates_run)); ++ atomic_read_unchecked(&fscache_n_invalidates), ++ atomic_read_unchecked(&fscache_n_invalidates_run)); + seq_printf(m, "Updates: n=%u nul=%u run=%u\n", - atomic_read(&fscache_n_updates), - atomic_read(&fscache_n_updates_null), @@ -46306,15 +52391,17 @@ index 4765190..2a067f2 100644 + atomic_read_unchecked(&fscache_n_store_radix_deletes), + atomic_read_unchecked(&fscache_n_store_pages_over_limit)); - seq_printf(m, "VmScan : nos=%u gon=%u bsy=%u can=%u\n", + seq_printf(m, "VmScan : nos=%u gon=%u bsy=%u can=%u wt=%u\n", - atomic_read(&fscache_n_store_vmscan_not_storing), - atomic_read(&fscache_n_store_vmscan_gone), - atomic_read(&fscache_n_store_vmscan_busy), -- atomic_read(&fscache_n_store_vmscan_cancelled)); +- atomic_read(&fscache_n_store_vmscan_cancelled), +- atomic_read(&fscache_n_store_vmscan_wait)); + atomic_read_unchecked(&fscache_n_store_vmscan_not_storing), + atomic_read_unchecked(&fscache_n_store_vmscan_gone), + atomic_read_unchecked(&fscache_n_store_vmscan_busy), -+ atomic_read_unchecked(&fscache_n_store_vmscan_cancelled)); ++ atomic_read_unchecked(&fscache_n_store_vmscan_cancelled), ++ atomic_read_unchecked(&fscache_n_store_vmscan_wait)); seq_printf(m, "Ops : pend=%u run=%u enq=%u can=%u rej=%u\n", - atomic_read(&fscache_n_op_pend), @@ -46338,10 +52425,10 @@ index 4765190..2a067f2 100644 seq_printf(m, "CacheOp: alo=%d luo=%d luc=%d gro=%d\n", atomic_read(&fscache_n_cop_alloc_object), diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c -index 3426521..3b75162 100644 +index 6f96a8d..6019bb9 100644 --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c -@@ -587,10 +587,12 @@ static int __init cuse_init(void) +@@ -597,10 +597,12 @@ static int __init cuse_init(void) INIT_LIST_HEAD(&cuse_conntbl[i]); /* inherit and extend fuse_dev_operations */ @@ -46359,10 +52446,10 @@ index 3426521..3b75162 100644 cuse_class = class_create(THIS_MODULE, "cuse"); if (IS_ERR(cuse_class)) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c -index f4246cf..b4aed1d 100644 +index 11dfa0c..6f64416 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c -@@ -1242,7 +1242,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos, +@@ -1294,7 +1294,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos, ret = 0; pipe_lock(pipe); @@ -46372,10 +52459,10 @@ index f4246cf..b4aed1d 100644 if (!ret) ret = -EPIPE; diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c -index bc43832..0cfe5a6 100644 +index ff15522..092a0f6 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c -@@ -1181,7 +1181,7 @@ static char *read_link(struct dentry *dentry) +@@ -1409,7 +1409,7 @@ static char *read_link(struct dentry *dentry) return link; } @@ -46385,10 +52472,10 @@ index bc43832..0cfe5a6 100644 if (!IS_ERR(link)) free_page((unsigned long) link); diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c -index a9ba244..d9df391 100644 +index cc00bd1..3edb692 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c -@@ -1496,7 +1496,7 @@ out: +@@ -1500,7 +1500,7 @@ out: static void gfs2_put_link(struct dentry *dentry, struct nameidata *nd, void *p) { @@ -46398,23 +52485,60 @@ index a9ba244..d9df391 100644 kfree(s); } diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c -index 001ef01..f7d5f07 100644 +index a3f868a..bb308ae 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c -@@ -920,7 +920,7 @@ static struct file_system_type hugetlbfs_fs_type = { - .kill_sb = kill_litter_super, +@@ -152,6 +152,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + struct hstate *h = hstate_file(file); ++ unsigned long offset = gr_rand_threadstack_offset(mm, file, flags); + struct vm_unmapped_area_info info; + + if (len & ~huge_page_mask(h)) +@@ -165,17 +166,26 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, + return addr; + } + ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP)) ++#endif ++ + if (addr) { + addr = ALIGN(addr, huge_page_size(h)); + vma = find_vma(mm, addr); +- if (TASK_SIZE - len >= addr && +- (!vma || addr + len <= vma->vm_start)) ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) + return addr; + } + + info.flags = 0; + info.length = len; + info.low_limit = TASK_UNMAPPED_BASE; ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; ++#endif ++ + info.high_limit = TASK_SIZE; + info.align_mask = PAGE_MASK & ~huge_page_mask(h); + info.align_offset = 0; +@@ -898,7 +908,7 @@ static struct file_system_type hugetlbfs_fs_type = { }; + MODULE_ALIAS_FS("hugetlbfs"); --static struct vfsmount *hugetlbfs_vfsmount; -+struct vfsmount *hugetlbfs_vfsmount; +-static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; ++struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; static int can_do_hugetlb_shm(void) { diff --git a/fs/inode.c b/fs/inode.c -index 9f4f5fe..6214688 100644 +index a898b3d..9b5a214 100644 --- a/fs/inode.c +++ b/fs/inode.c -@@ -860,8 +860,8 @@ unsigned int get_next_ino(void) +@@ -878,8 +878,8 @@ unsigned int get_next_ino(void) #ifdef CONFIG_SMP if (unlikely((res & (LAST_INO_BATCH-1)) == 0)) { @@ -46440,10 +52564,10 @@ index 4a6cf28..d3a29d3 100644 jffs2_prealloc_raw_node_refs(c, jeb, 1); diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c -index 74d9be1..d5dd140 100644 +index a6597d6..41b30ec 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c -@@ -1022,7 +1022,8 @@ static const struct jffs2_unknown_node oob_cleanmarker = +@@ -1023,7 +1023,8 @@ static const struct jffs2_unknown_node oob_cleanmarker = { .magic = constant_cpu_to_je16(JFFS2_MAGIC_BITMASK), .nodetype = constant_cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER), @@ -46454,10 +52578,10 @@ index 74d9be1..d5dd140 100644 /* diff --git a/fs/jfs/super.c b/fs/jfs/super.c -index 4a82950..bcaa0cb 100644 +index 2003e83..40db287 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c -@@ -801,7 +801,7 @@ static int __init init_jfs_fs(void) +@@ -856,7 +856,7 @@ static int __init init_jfs_fs(void) jfs_inode_cachep = kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0, @@ -46467,7 +52591,7 @@ index 4a82950..bcaa0cb 100644 if (jfs_inode_cachep == NULL) return -ENOMEM; diff --git a/fs/libfs.c b/fs/libfs.c -index 18d08f5..fe3dc64 100644 +index 916da8c..1588998 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -165,6 +165,9 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir) @@ -46495,7 +52619,7 @@ index 18d08f5..fe3dc64 100644 next->d_inode->i_ino, dt_type(next->d_inode)) < 0) diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c -index 8392cb8..80d6193 100644 +index 9760ecb..9b838ef 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c @@ -36,11 +36,11 @@ static const struct rpc_call_ops nlmclnt_cancel_ops; @@ -46513,10 +52637,10 @@ index 8392cb8..80d6193 100644 memcpy(c->data, &cookie, 4); c->len=4; diff --git a/fs/locks.c b/fs/locks.c -index fcc50ab..c3dacf2 100644 +index cb424a4..850e4dd 100644 --- a/fs/locks.c +++ b/fs/locks.c -@@ -2075,16 +2075,16 @@ void locks_remove_flock(struct file *filp) +@@ -2064,16 +2064,16 @@ void locks_remove_flock(struct file *filp) return; if (filp->f_op && filp->f_op->flock) { @@ -46538,10 +52662,10 @@ index fcc50ab..c3dacf2 100644 lock_flocks(); diff --git a/fs/namei.c b/fs/namei.c -index c427919..232326c 100644 +index 85e40d1..b66744e 100644 --- a/fs/namei.c +++ b/fs/namei.c -@@ -278,16 +278,32 @@ int generic_permission(struct inode *inode, int mask) +@@ -319,16 +319,32 @@ int generic_permission(struct inode *inode, int mask) if (ret != -EACCES) return ret; @@ -46553,14 +52677,14 @@ index c427919..232326c 100644 + if (S_ISDIR(inode->i_mode)) { /* DACs are overridable for directories */ -- if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE)) +- if (inode_capable(inode, CAP_DAC_OVERRIDE)) - return 0; if (!(mask & MAY_WRITE)) -- if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH)) -+ if (ns_capable_nolog(inode_userns(inode), CAP_DAC_OVERRIDE) || -+ ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH)) +- if (inode_capable(inode, CAP_DAC_READ_SEARCH)) ++ if (inode_capable_nolog(inode, CAP_DAC_OVERRIDE) || ++ inode_capable(inode, CAP_DAC_READ_SEARCH)) return 0; -+ if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE)) ++ if (inode_capable(inode, CAP_DAC_OVERRIDE)) + return 0; return -EACCES; } @@ -46569,16 +52693,16 @@ index c427919..232326c 100644 + */ + mask &= MAY_READ | MAY_WRITE | MAY_EXEC; + if (mask == MAY_READ) -+ if (ns_capable_nolog(inode_userns(inode), CAP_DAC_OVERRIDE) || -+ ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH)) ++ if (inode_capable_nolog(inode, CAP_DAC_OVERRIDE) || ++ inode_capable(inode, CAP_DAC_READ_SEARCH)) + return 0; + + /* * Read/write DACs are always overridable. * Executable DACs are overridable when there is * at least one exec bit set. -@@ -296,14 +312,6 @@ int generic_permission(struct inode *inode, int mask) - if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE)) +@@ -337,14 +353,6 @@ int generic_permission(struct inode *inode, int mask) + if (inode_capable(inode, CAP_DAC_OVERRIDE)) return 0; - /* @@ -46586,68 +52710,68 @@ index c427919..232326c 100644 - */ - mask &= MAY_READ | MAY_WRITE | MAY_EXEC; - if (mask == MAY_READ) -- if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH)) +- if (inode_capable(inode, CAP_DAC_READ_SEARCH)) - return 0; - return -EACCES; } -@@ -652,11 +660,19 @@ follow_link(struct path *link, struct nameidata *nd, void **p) - return error; - } +@@ -820,7 +828,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p) + { + struct dentry *dentry = link->dentry; + int error; +- char *s; ++ const char *s; + + BUG_ON(nd->flags & LOOKUP_RCU); + +@@ -841,6 +849,12 @@ follow_link(struct path *link, struct nameidata *nd, void **p) + if (error) + goto out_put_nd_path; + if (gr_handle_follow_link(dentry->d_parent->d_inode, + dentry->d_inode, dentry, nd->path.mnt)) { + error = -EACCES; -+ *p = ERR_PTR(error); /* no ->put_link(), please */ -+ path_put(&nd->path); -+ return error; -+ } ++ goto out_put_nd_path; ++ } + nd->last_type = LAST_BIND; *p = dentry->d_inode->i_op->follow_link(dentry, nd); error = PTR_ERR(*p); - if (!IS_ERR(*p)) { -- char *s = nd_get_link(nd); -+ const char *s = nd_get_link(nd); - error = 0; - if (s) - error = __vfs_follow_link(nd, s); -@@ -1355,6 +1371,9 @@ static inline int nested_symlink(struct path *path, struct nameidata *nd) - if (!res) - res = walk_component(nd, path, &nd->last, - nd->last_type, LOOKUP_FOLLOW); -+ if (res >= 0 && gr_handle_symlink_owner(&link, nd->inode)) { +@@ -1588,6 +1602,8 @@ static inline int nested_symlink(struct path *path, struct nameidata *nd) + if (res) + break; + res = walk_component(nd, path, LOOKUP_FOLLOW); ++ if (res >= 0 && gr_handle_symlink_owner(&link, nd->inode)) + res = -EACCES; -+ } put_link(nd, &link, cookie); } while (res > 0); -@@ -1746,6 +1765,9 @@ static int path_lookupat(int dfd, const char *name, - err = follow_link(&link, nd, &cookie); - if (!err) - err = lookup_last(nd, &path); -+ if (!err && gr_handle_symlink_owner(&link, nd->inode)) { +@@ -1686,7 +1702,7 @@ EXPORT_SYMBOL(full_name_hash); + static inline unsigned long hash_name(const char *name, unsigned int *hashp) + { + unsigned long a, b, adata, bdata, mask, hash, len; +- const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; ++ static const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; + + hash = a = 0; + len = -sizeof(unsigned long); +@@ -1968,6 +1984,8 @@ static int path_lookupat(int dfd, const char *name, + if (err) + break; + err = lookup_last(nd, &path); ++ if (!err && gr_handle_symlink_owner(&link, nd->inode)) + err = -EACCES; -+ } put_link(nd, &link, cookie); } } -@@ -1753,6 +1775,21 @@ static int path_lookupat(int dfd, const char *name, +@@ -1975,6 +1993,13 @@ static int path_lookupat(int dfd, const char *name, if (!err) err = complete_walk(nd); -+ if (!(nd->flags & LOOKUP_PARENT)) { -+#ifdef CONFIG_GRKERNSEC -+ if (flags & LOOKUP_RCU) { -+ if (!err) -+ path_put(&nd->path); -+ err = -ECHILD; -+ } else -+#endif ++ if (!err && !(nd->flags & LOOKUP_PARENT)) { + if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) { -+ if (!err) -+ path_put(&nd->path); ++ path_put(&nd->path); + err = -ENOENT; + } + } @@ -46655,23 +52779,24 @@ index c427919..232326c 100644 if (!err && nd->flags & LOOKUP_DIRECTORY) { if (!nd->inode->i_op->lookup) { path_put(&nd->path); -@@ -1780,6 +1817,15 @@ static int do_path_lookup(int dfd, const char *name, - retval = path_lookupat(dfd, name, flags | LOOKUP_REVAL, nd); - - if (likely(!retval)) { -+ if (*name != '/' && nd->path.dentry && nd->inode) { -+#ifdef CONFIG_GRKERNSEC -+ if (flags & LOOKUP_RCU) -+ return -ECHILD; -+#endif -+ if (!gr_chroot_fchdir(nd->path.dentry, nd->path.mnt)) +@@ -2002,8 +2027,15 @@ static int filename_lookup(int dfd, struct filename *name, + retval = path_lookupat(dfd, name->name, + flags | LOOKUP_REVAL, nd); + +- if (likely(!retval)) ++ if (likely(!retval)) { + audit_inode(name, nd->path.dentry, flags & LOOKUP_PARENT); ++ if (name->name[0] != '/' && nd->path.dentry && nd->inode) { ++ if (!gr_chroot_fchdir(nd->path.dentry, nd->path.mnt)) { ++ path_put(&nd->path); + return -ENOENT; ++ } + } -+ - if (unlikely(!audit_dummy_context())) { - if (nd->path.dentry && nd->inode) - audit_inode(name, nd->path.dentry); -@@ -2126,6 +2172,13 @@ static int may_open(struct path *path, int acc_mode, int flag) ++ } + return retval; + } + +@@ -2381,6 +2413,13 @@ static int may_open(struct path *path, int acc_mode, int flag) if (flag & O_NOATIME && !inode_owner_or_capable(inode)) return -EPERM; @@ -46685,138 +52810,203 @@ index c427919..232326c 100644 return 0; } -@@ -2187,6 +2240,16 @@ static struct file *do_last(struct nameidata *nd, struct path *path, +@@ -2602,7 +2641,7 @@ looked_up: + * cleared otherwise prior to returning. + */ + static int lookup_open(struct nameidata *nd, struct path *path, +- struct file *file, ++ struct path *link, struct file *file, + const struct open_flags *op, + bool got_write, int *opened) + { +@@ -2637,6 +2676,17 @@ static int lookup_open(struct nameidata *nd, struct path *path, + /* Negative dentry, just create the file */ + if (!dentry->d_inode && (op->open_flag & O_CREAT)) { + umode_t mode = op->mode; ++ ++ if (link && gr_handle_symlink_owner(link, dir->d_inode)) { ++ error = -EACCES; ++ goto out_dput; ++ } ++ ++ if (!gr_acl_handle_creat(dentry, dir, nd->path.mnt, op->open_flag, op->acc_mode, mode)) { ++ error = -EACCES; ++ goto out_dput; ++ } ++ + if (!IS_POSIXACL(dir->d_inode)) + mode &= ~current_umask(); + /* +@@ -2658,6 +2708,8 @@ static int lookup_open(struct nameidata *nd, struct path *path, + nd->flags & LOOKUP_EXCL); + if (error) + goto out_dput; ++ else ++ gr_handle_create(dentry, nd->path.mnt); + } + out_no_open: + path->dentry = dentry; +@@ -2672,7 +2724,7 @@ out_dput: + /* + * Handle the last step of open() + */ +-static int do_last(struct nameidata *nd, struct path *path, ++static int do_last(struct nameidata *nd, struct path *path, struct path *link, + struct file *file, const struct open_flags *op, + int *opened, struct filename *name) + { +@@ -2701,16 +2753,32 @@ static int do_last(struct nameidata *nd, struct path *path, error = complete_walk(nd); if (error) - return ERR_PTR(error); -+#ifdef CONFIG_GRKERNSEC -+ if (nd->flags & LOOKUP_RCU) { -+ error = -ECHILD; -+ goto exit; -+ } -+#endif + return error; + if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) { + error = -ENOENT; -+ goto exit; ++ goto out; + } - audit_inode(pathname, nd->path.dentry); + audit_inode(name, nd->path.dentry, 0); if (open_flag & O_CREAT) { error = -EISDIR; -@@ -2197,6 +2260,16 @@ static struct file *do_last(struct nameidata *nd, struct path *path, + goto out; + } ++ if (link && gr_handle_symlink_owner(link, nd->inode)) { ++ error = -EACCES; ++ goto out; ++ } + goto finish_open; + case LAST_BIND: error = complete_walk(nd); if (error) - return ERR_PTR(error); -+#ifdef CONFIG_GRKERNSEC -+ if (nd->flags & LOOKUP_RCU) { -+ error = -ECHILD; -+ goto exit; -+ } -+#endif + return error; + if (!gr_acl_handle_hidden_file(dir, nd->path.mnt)) { + error = -ENOENT; -+ goto exit; -+ } - audit_inode(pathname, dir); - goto ok; - } -@@ -2218,6 +2291,16 @@ static struct file *do_last(struct nameidata *nd, struct path *path, - error = complete_walk(nd); - if (error) - return ERR_PTR(error); -+#ifdef CONFIG_GRKERNSEC -+ if (nd->flags & LOOKUP_RCU) { -+ error = -ECHILD; -+ goto exit; ++ goto out; + } -+#endif -+ if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) { -+ error = -ENOENT; -+ goto exit; ++ if (link && gr_handle_symlink_owner(link, nd->inode)) { ++ error = -EACCES; ++ goto out; + } + audit_inode(name, dir, 0); + goto finish_open; + } +@@ -2759,7 +2827,7 @@ retry_lookup: + */ + } + mutex_lock(&dir->d_inode->i_mutex); +- error = lookup_open(nd, path, file, op, got_write, opened); ++ error = lookup_open(nd, path, link, file, op, got_write, opened); + mutex_unlock(&dir->d_inode->i_mutex); - error = -ENOTDIR; - if (nd->flags & LOOKUP_DIRECTORY) { -@@ -2258,6 +2341,12 @@ static struct file *do_last(struct nameidata *nd, struct path *path, - /* Negative dentry, just create the file */ - if (!dentry->d_inode) { - umode_t mode = op->mode; + if (error <= 0) { +@@ -2783,11 +2851,28 @@ retry_lookup: + goto finish_open_created; + } + ++ if (!gr_acl_handle_hidden_file(path->dentry, nd->path.mnt)) { ++ error = -ENOENT; ++ goto exit_dput; ++ } ++ if (link && gr_handle_symlink_owner(link, path->dentry->d_inode)) { ++ error = -EACCES; ++ goto exit_dput; ++ } + -+ if (!gr_acl_handle_creat(path->dentry, nd->path.dentry, path->mnt, open_flag, acc_mode, mode)) { + /* + * create/update audit record if it already exists. + */ +- if (path->dentry->d_inode) ++ if (path->dentry->d_inode) { ++ /* only check if O_CREAT is specified, all other checks need to go ++ into may_open */ ++ if (gr_handle_fifo(path->dentry, path->mnt, dir, open_flag, acc_mode)) { + error = -EACCES; -+ goto exit_mutex_unlock; ++ goto exit_dput; + } + - if (!IS_POSIXACL(dir->d_inode)) - mode &= ~current_umask(); - /* -@@ -2281,6 +2370,8 @@ static struct file *do_last(struct nameidata *nd, struct path *path, - error = vfs_create(dir->d_inode, dentry, mode, nd); - if (error) - goto exit_mutex_unlock; -+ else -+ gr_handle_create(path->dentry, path->mnt); - mutex_unlock(&dir->d_inode->i_mutex); - dput(nd->path.dentry); - nd->path.dentry = dentry; -@@ -2290,6 +2381,19 @@ static struct file *do_last(struct nameidata *nd, struct path *path, + audit_inode(name, path->dentry, 0); ++ } + /* - * It already exists. - */ + * If atomic_open() acquired write access it is dropped now due to +@@ -2828,6 +2913,11 @@ finish_lookup: + } + } + BUG_ON(inode != path->dentry->d_inode); ++ /* if we're resolving a symlink to another symlink */ ++ if (link && gr_handle_symlink_owner(link, inode)) { ++ error = -EACCES; ++ goto out; ++ } + return 1; + } + +@@ -2837,7 +2927,6 @@ finish_lookup: + save_parent.dentry = nd->path.dentry; + save_parent.mnt = mntget(path->mnt); + nd->path.dentry = path->dentry; +- + } + nd->inode = inode; + /* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */ +@@ -2846,6 +2935,16 @@ finish_lookup: + path_put(&save_parent); + return error; + } + -+ if (!gr_acl_handle_hidden_file(dentry, nd->path.mnt)) { ++ if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) { + error = -ENOENT; -+ goto exit_mutex_unlock; ++ goto out; + } -+ -+ /* only check if O_CREAT is specified, all other checks need to go -+ into may_open */ -+ if (gr_handle_fifo(path->dentry, path->mnt, dir, open_flag, acc_mode)) { ++ if (link && gr_handle_symlink_owner(link, nd->inode)) { + error = -EACCES; -+ goto exit_mutex_unlock; ++ goto out; + } + - mutex_unlock(&dir->d_inode->i_mutex); - audit_inode(pathname, path->dentry); + error = -EISDIR; + if ((open_flag & O_CREAT) && S_ISDIR(nd->inode->i_mode)) + goto out; +@@ -2944,7 +3043,7 @@ static struct file *path_openat(int dfd, struct filename *pathname, + if (unlikely(error)) + goto out; -@@ -2407,8 +2511,14 @@ static struct file *path_openat(int dfd, const char *pathname, +- error = do_last(nd, &path, file, op, &opened, pathname); ++ error = do_last(nd, &path, NULL, file, op, &opened, pathname); + while (unlikely(error > 0)) { /* trailing symlink */ + struct path link = path; + void *cookie; +@@ -2962,7 +3061,7 @@ static struct file *path_openat(int dfd, struct filename *pathname, error = follow_link(&link, nd, &cookie); if (unlikely(error)) - filp = ERR_PTR(error); -- else -+ else { - filp = do_last(nd, &path, op, pathname); -+ if (!IS_ERR(filp) && gr_handle_symlink_owner(&link, nd->inode)) { -+ if (filp) -+ fput(filp); -+ filp = ERR_PTR(-EACCES); -+ } -+ } + break; +- error = do_last(nd, &path, file, op, &opened, pathname); ++ error = do_last(nd, &path, &link, file, op, &opened, pathname); put_link(nd, &link, cookie); } out: -@@ -2502,6 +2612,11 @@ struct dentry *kern_path_create(int dfd, const char *pathname, struct path *path - *path = nd.path; - return dentry; - eexist: -+ if (!gr_acl_handle_hidden_file(dentry, nd.path.mnt)) { -+ dput(dentry); -+ dentry = ERR_PTR(-ENOENT); -+ goto fail; +@@ -3062,8 +3161,12 @@ struct dentry *kern_path_create(int dfd, const char *pathname, + goto unlock; + + error = -EEXIST; +- if (dentry->d_inode) ++ if (dentry->d_inode) { ++ if (!gr_acl_handle_hidden_file(dentry, nd.path.mnt)) { ++ error = -ENOENT; ++ } + goto fail; + } - dput(dentry); - dentry = ERR_PTR(-EEXIST); - fail: -@@ -2524,6 +2639,20 @@ struct dentry *user_path_create(int dfd, const char __user *pathname, struct pat + /* + * Special case - lookup gave negative, but... we had foo/bar/ + * From the vfs_mknod() POV we just have a negative dentry - +@@ -3115,6 +3218,20 @@ struct dentry *user_path_create(int dfd, const char __user *pathname, } EXPORT_SYMBOL(user_path_create); -+static struct dentry *user_path_create_with_name(int dfd, const char __user *pathname, struct path *path, char **to, int is_dir) ++static struct dentry *user_path_create_with_name(int dfd, const char __user *pathname, struct path *path, struct filename **to, unsigned int lookup_flags) +{ -+ char *tmp = getname(pathname); ++ struct filename *tmp = getname(pathname); + struct dentry *res; + if (IS_ERR(tmp)) + return ERR_CAST(tmp); -+ res = kern_path_create(dfd, tmp, path, is_dir); ++ res = kern_path_create(dfd, tmp->name, path, lookup_flags); + if (IS_ERR(res)) + putname(tmp); + else @@ -46827,66 +53017,60 @@ index c427919..232326c 100644 int vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) { int error = may_create(dir, dentry); -@@ -2591,6 +2720,17 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode, - error = mnt_want_write(path.mnt); - if (error) - goto out_dput; +@@ -3177,6 +3294,17 @@ retry: + + if (!IS_POSIXACL(path.dentry->d_inode)) + mode &= ~current_umask(); + + if (gr_handle_chroot_mknod(dentry, path.mnt, mode)) { + error = -EPERM; -+ goto out_drop_write; ++ goto out; + } + + if (!gr_acl_handle_mknod(dentry, path.dentry, path.mnt, mode)) { + error = -EACCES; -+ goto out_drop_write; ++ goto out; + } + error = security_path_mknod(&path, dentry, mode, dev); if (error) - goto out_drop_write; -@@ -2608,6 +2748,9 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode, + goto out; +@@ -3193,6 +3321,8 @@ retry: + break; } - out_drop_write: - mnt_drop_write(path.mnt); -+ + out: + if (!error) + gr_handle_create(dentry, path.mnt); - out_dput: - dput(dentry); - mutex_unlock(&path.dentry->d_inode->i_mutex); -@@ -2661,12 +2804,21 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode) - error = mnt_want_write(path.mnt); - if (error) - goto out_dput; -+ + done_path_create(&path, dentry); + if (retry_estale(error, lookup_flags)) { + lookup_flags |= LOOKUP_REVAL; +@@ -3245,9 +3375,16 @@ retry: + + if (!IS_POSIXACL(path.dentry->d_inode)) + mode &= ~current_umask(); + if (!gr_acl_handle_mkdir(dentry, path.dentry, path.mnt)) { + error = -EACCES; -+ goto out_drop_write; ++ goto out; + } -+ error = security_path_mkdir(&path, dentry, mode); - if (error) - goto out_drop_write; - error = vfs_mkdir(path.dentry->d_inode, dentry, mode); - out_drop_write: - mnt_drop_write(path.mnt); -+ + if (!error) + error = vfs_mkdir(path.dentry->d_inode, dentry, mode); + if (!error) + gr_handle_create(dentry, path.mnt); - out_dput: - dput(dentry); - mutex_unlock(&path.dentry->d_inode->i_mutex); -@@ -2746,6 +2898,8 @@ static long do_rmdir(int dfd, const char __user *pathname) - char * name; ++out: + done_path_create(&path, dentry); + if (retry_estale(error, lookup_flags)) { + lookup_flags |= LOOKUP_REVAL; +@@ -3328,6 +3465,8 @@ static long do_rmdir(int dfd, const char __user *pathname) + struct filename *name; struct dentry *dentry; struct nameidata nd; + ino_t saved_ino = 0; + dev_t saved_dev = 0; - - error = user_path_parent(dfd, pathname, &nd, &name); - if (error) -@@ -2774,6 +2928,15 @@ static long do_rmdir(int dfd, const char __user *pathname) + unsigned int lookup_flags = 0; + retry: + name = user_path_parent(dfd, pathname, &nd, lookup_flags); +@@ -3360,10 +3499,21 @@ retry: error = -ENOENT; goto exit3; } @@ -46899,28 +53083,25 @@ index c427919..232326c 100644 + goto exit3; + } + - error = mnt_want_write(nd.path.mnt); + error = security_path_rmdir(&nd.path, dentry); if (error) goto exit3; -@@ -2781,6 +2944,8 @@ static long do_rmdir(int dfd, const char __user *pathname) - if (error) - goto exit4; error = vfs_rmdir(nd.path.dentry->d_inode, dentry); + if (!error && (saved_dev || saved_ino)) + gr_handle_delete(saved_ino, saved_dev); - exit4: - mnt_drop_write(nd.path.mnt); exit3: -@@ -2843,6 +3008,8 @@ static long do_unlinkat(int dfd, const char __user *pathname) + dput(dentry); + exit2: +@@ -3429,6 +3579,8 @@ static long do_unlinkat(int dfd, const char __user *pathname) struct dentry *dentry; struct nameidata nd; struct inode *inode = NULL; + ino_t saved_ino = 0; + dev_t saved_dev = 0; - - error = user_path_parent(dfd, pathname, &nd, &name); - if (error) -@@ -2865,6 +3032,16 @@ static long do_unlinkat(int dfd, const char __user *pathname) + unsigned int lookup_flags = 0; + retry: + name = user_path_parent(dfd, pathname, &nd, lookup_flags); +@@ -3455,10 +3607,22 @@ retry: if (!inode) goto slashes; ihold(inode); @@ -46934,86 +53115,80 @@ index c427919..232326c 100644 + goto exit2; + } + - error = mnt_want_write(nd.path.mnt); + error = security_path_unlink(&nd.path, dentry); if (error) goto exit2; -@@ -2872,6 +3049,8 @@ static long do_unlinkat(int dfd, const char __user *pathname) - if (error) - goto exit3; error = vfs_unlink(nd.path.dentry->d_inode, dentry); + if (!error && (saved_ino || saved_dev)) + gr_handle_delete(saved_ino, saved_dev); - exit3: - mnt_drop_write(nd.path.mnt); - exit2: -@@ -2947,10 +3126,18 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, - error = mnt_want_write(path.mnt); - if (error) - goto out_dput; -+ + exit2: + dput(dentry); + } +@@ -3536,9 +3700,17 @@ retry: + if (IS_ERR(dentry)) + goto out_putname; + + if (!gr_acl_handle_symlink(dentry, path.dentry, path.mnt, from)) { + error = -EACCES; -+ goto out_drop_write; ++ goto out; + } + - error = security_path_symlink(&path, dentry, from); - if (error) - goto out_drop_write; - error = vfs_symlink(path.dentry->d_inode, dentry, from); + error = security_path_symlink(&path, dentry, from->name); + if (!error) + error = vfs_symlink(path.dentry->d_inode, dentry, from->name); + if (!error) + gr_handle_create(dentry, path.mnt); - out_drop_write: - mnt_drop_write(path.mnt); - out_dput: -@@ -3025,6 +3212,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, ++out: + done_path_create(&path, dentry); + if (retry_estale(error, lookup_flags)) { + lookup_flags |= LOOKUP_REVAL; +@@ -3612,6 +3784,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, { struct dentry *new_dentry; struct path old_path, new_path; -+ char *to = NULL; ++ struct filename *to = NULL; int how = 0; int error; -@@ -3048,7 +3236,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, +@@ -3635,7 +3808,7 @@ retry: if (error) return error; -- new_dentry = user_path_create(newdfd, newname, &new_path, 0); -+ new_dentry = user_path_create_with_name(newdfd, newname, &new_path, &to, 0); +- new_dentry = user_path_create(newdfd, newname, &new_path, ++ new_dentry = user_path_create_with_name(newdfd, newname, &new_path, &to, + (how & LOOKUP_REVAL)); error = PTR_ERR(new_dentry); if (IS_ERR(new_dentry)) - goto out; -@@ -3059,13 +3247,30 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, - error = mnt_want_write(new_path.mnt); - if (error) +@@ -3647,11 +3820,28 @@ retry: + error = may_linkat(&old_path); + if (unlikely(error)) goto out_dput; + + if (gr_handle_hardlink(old_path.dentry, old_path.mnt, + old_path.dentry->d_inode, + old_path.dentry->d_inode->i_mode, to)) { + error = -EACCES; -+ goto out_drop_write; ++ goto out_dput; + } + + if (!gr_acl_handle_link(new_dentry, new_path.dentry, new_path.mnt, + old_path.dentry, old_path.mnt, to)) { + error = -EACCES; -+ goto out_drop_write; ++ goto out_dput; + } + error = security_path_link(old_path.dentry, &new_path, new_dentry); if (error) - goto out_drop_write; + goto out_dput; error = vfs_link(old_path.dentry, new_path.dentry->d_inode, new_dentry); + if (!error) + gr_handle_create(new_dentry, new_path.mnt); - out_drop_write: - mnt_drop_write(new_path.mnt); out_dput: + putname(to); - dput(new_dentry); - mutex_unlock(&new_path.dentry->d_inode->i_mutex); - path_put(&new_path); -@@ -3299,6 +3504,12 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, + done_path_create(&new_path, new_dentry); + if (retry_estale(error, how)) { + how |= LOOKUP_REVAL; +@@ -3897,12 +4087,21 @@ retry: if (new_dentry == trap) goto exit5; @@ -47023,20 +53198,19 @@ index c427919..232326c 100644 + if (error) + goto exit5; + - error = mnt_want_write(oldnd.path.mnt); + error = security_path_rename(&oldnd.path, old_dentry, + &newnd.path, new_dentry); if (error) goto exit5; -@@ -3308,6 +3519,9 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, - goto exit6; error = vfs_rename(old_dir->d_inode, old_dentry, new_dir->d_inode, new_dentry); + if (!error) + gr_handle_rename(old_dir->d_inode, new_dir->d_inode, old_dentry, + new_dentry, oldnd.path.mnt, new_dentry->d_inode ? 1 : 0); - exit6: - mnt_drop_write(oldnd.path.mnt); exit5: -@@ -3333,6 +3547,8 @@ SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newna + dput(new_dentry); + exit4: +@@ -3934,6 +4133,8 @@ SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newna int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const char *link) { @@ -47045,7 +53219,7 @@ index c427919..232326c 100644 int len; len = PTR_ERR(link); -@@ -3342,7 +3558,14 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const c +@@ -3943,7 +4144,14 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const c len = strlen(link); if (len > (unsigned) buflen) len = buflen; @@ -47062,10 +53236,10 @@ index c427919..232326c 100644 out: return len; diff --git a/fs/namespace.c b/fs/namespace.c -index 4e46539..b28253c 100644 +index e945b81..1dd8104 100644 --- a/fs/namespace.c +++ b/fs/namespace.c -@@ -1156,6 +1156,9 @@ static int do_umount(struct mount *mnt, int flags) +@@ -1219,6 +1219,9 @@ static int do_umount(struct mount *mnt, int flags) if (!(sb->s_flags & MS_RDONLY)) retval = do_remount_sb(sb, MS_RDONLY, NULL, 0); up_write(&sb->s_umount); @@ -47075,8 +53249,8 @@ index 4e46539..b28253c 100644 return retval; } -@@ -1175,6 +1178,9 @@ static int do_umount(struct mount *mnt, int flags) - br_write_unlock(vfsmount_lock); +@@ -1238,6 +1241,9 @@ static int do_umount(struct mount *mnt, int flags) + br_write_unlock(&vfsmount_lock); up_write(&namespace_sem); release_mounts(&umount_list); + @@ -47085,7 +53259,7 @@ index 4e46539..b28253c 100644 return retval; } -@@ -2176,6 +2182,16 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, +@@ -2267,6 +2273,16 @@ long do_mount(const char *dev_name, const char *dir_name, MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT | MS_STRICTATIME); @@ -47102,7 +53276,7 @@ index 4e46539..b28253c 100644 if (flags & MS_REMOUNT) retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags, data_page); -@@ -2190,6 +2206,9 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, +@@ -2281,6 +2297,9 @@ long do_mount(const char *dev_name, const char *dir_name, dev_name, data_page); dput_out: path_put(&path); @@ -47112,7 +53286,7 @@ index 4e46539..b28253c 100644 return retval; } -@@ -2471,6 +2490,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, +@@ -2567,6 +2586,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, if (error) goto out2; @@ -47124,20 +53298,33 @@ index 4e46539..b28253c 100644 get_fs_root(current->fs, &root); error = lock_mount(&old); if (error) +@@ -2815,7 +2839,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns) + !nsown_capable(CAP_SYS_ADMIN)) + return -EPERM; + +- if (fs->users != 1) ++ if (atomic_read(&fs->users) != 1) + return -EINVAL; + + get_mnt_ns(mnt_ns); +diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c +index 59461c9..b17c57e 100644 +--- a/fs/nfs/callback_xdr.c ++++ b/fs/nfs/callback_xdr.c +@@ -51,7 +51,7 @@ struct callback_op { + callback_decode_arg_t decode_args; + callback_encode_res_t encode_res; + long res_maxsize; +-}; ++} __do_const; + + static struct callback_op callback_ops[]; + diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c -index e8bbfa5..864f936 100644 +index 1f94167..79c4ce4 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c -@@ -152,7 +152,7 @@ static void nfs_zap_caches_locked(struct inode *inode) - nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); - nfsi->attrtimeo_timestamp = jiffies; - -- memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode))); -+ memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_I(inode)->cookieverf)); - if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) - nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; - else -@@ -1005,16 +1005,16 @@ static int nfs_size_need_update(const struct inode *inode, const struct nfs_fatt +@@ -1041,16 +1041,16 @@ static int nfs_size_need_update(const struct inode *inode, const struct nfs_fatt return nfs_size_to_loff_t(fattr->size) > i_size_read(inode); } @@ -47157,11 +53344,78 @@ index e8bbfa5..864f936 100644 } void nfs_fattr_init(struct nfs_fattr *fattr) +diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c +index d401d01..10b3e62 100644 +--- a/fs/nfsd/nfs4proc.c ++++ b/fs/nfsd/nfs4proc.c +@@ -1109,7 +1109,7 @@ struct nfsd4_operation { + nfsd4op_rsize op_rsize_bop; + stateid_getter op_get_currentstateid; + stateid_setter op_set_currentstateid; +-}; ++} __do_const; + + static struct nfsd4_operation nfsd4_ops[]; + +diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c +index 6eb0dc5..29067a9 100644 +--- a/fs/nfsd/nfs4xdr.c ++++ b/fs/nfsd/nfs4xdr.c +@@ -1457,7 +1457,7 @@ nfsd4_decode_notsupp(struct nfsd4_compoundargs *argp, void *p) + + typedef __be32(*nfsd4_dec)(struct nfsd4_compoundargs *argp, void *); + +-static nfsd4_dec nfsd4_dec_ops[] = { ++static const nfsd4_dec nfsd4_dec_ops[] = { + [OP_ACCESS] = (nfsd4_dec)nfsd4_decode_access, + [OP_CLOSE] = (nfsd4_dec)nfsd4_decode_close, + [OP_COMMIT] = (nfsd4_dec)nfsd4_decode_commit, +@@ -1497,7 +1497,7 @@ static nfsd4_dec nfsd4_dec_ops[] = { + [OP_RELEASE_LOCKOWNER] = (nfsd4_dec)nfsd4_decode_release_lockowner, + }; + +-static nfsd4_dec nfsd41_dec_ops[] = { ++static const nfsd4_dec nfsd41_dec_ops[] = { + [OP_ACCESS] = (nfsd4_dec)nfsd4_decode_access, + [OP_CLOSE] = (nfsd4_dec)nfsd4_decode_close, + [OP_COMMIT] = (nfsd4_dec)nfsd4_decode_commit, +@@ -1559,7 +1559,7 @@ static nfsd4_dec nfsd41_dec_ops[] = { + }; + + struct nfsd4_minorversion_ops { +- nfsd4_dec *decoders; ++ const nfsd4_dec *decoders; + int nops; + }; + +diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c +index ca05f6d..411a576 100644 +--- a/fs/nfsd/nfscache.c ++++ b/fs/nfsd/nfscache.c +@@ -461,13 +461,15 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp) + { + struct svc_cacherep *rp = rqstp->rq_cacherep; + struct kvec *resv = &rqstp->rq_res.head[0], *cachv; +- int len; ++ long len; + + if (!rp) + return; + +- len = resv->iov_len - ((char*)statp - (char*)resv->iov_base); +- len >>= 2; ++ if (statp) { ++ len = resv->iov_len - ((char*)statp - (char*)resv->iov_base); ++ len >>= 2; ++ } + + /* Don't cache excessive amounts of data and XDR failures */ + if (!statp || len > (256 >> 2)) { diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c -index 5686661..80a9a3a 100644 +index 2b2e239..c915b48 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c -@@ -933,7 +933,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, +@@ -939,7 +939,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, } else { oldfs = get_fs(); set_fs(KERNEL_DS); @@ -47170,40 +53424,124 @@ index 5686661..80a9a3a 100644 set_fs(oldfs); } -@@ -1037,7 +1037,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, +@@ -1026,7 +1026,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, /* Write the data. */ oldfs = get_fs(); set_fs(KERNEL_DS); -- host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset); -+ host_err = vfs_writev(file, (struct iovec __force_user *)vec, vlen, &offset); +- host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &pos); ++ host_err = vfs_writev(file, (struct iovec __force_user *)vec, vlen, &pos); set_fs(oldfs); if (host_err < 0) goto out_nfserr; -@@ -1573,7 +1573,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) +@@ -1572,7 +1572,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) */ oldfs = get_fs(); set_fs(KERNEL_DS); -- host_err = inode->i_op->readlink(path.dentry, buf, *lenp); +- host_err = inode->i_op->readlink(path.dentry, (char __user *)buf, *lenp); + host_err = inode->i_op->readlink(path.dentry, (char __force_user *)buf, *lenp); set_fs(oldfs); if (host_err < 0) +diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c +index fea6bd5..8ee9d81 100644 +--- a/fs/nls/nls_base.c ++++ b/fs/nls/nls_base.c +@@ -234,20 +234,22 @@ EXPORT_SYMBOL(utf16s_to_utf8s); + + int register_nls(struct nls_table * nls) + { +- struct nls_table ** tmp = &tables; ++ struct nls_table *tmp = tables; + + if (nls->next) + return -EBUSY; + + spin_lock(&nls_lock); +- while (*tmp) { +- if (nls == *tmp) { ++ while (tmp) { ++ if (nls == tmp) { + spin_unlock(&nls_lock); + return -EBUSY; + } +- tmp = &(*tmp)->next; ++ tmp = tmp->next; + } +- nls->next = tables; ++ pax_open_kernel(); ++ *(struct nls_table **)&nls->next = tables; ++ pax_close_kernel(); + tables = nls; + spin_unlock(&nls_lock); + return 0; +@@ -255,12 +257,14 @@ int register_nls(struct nls_table * nls) + + int unregister_nls(struct nls_table * nls) + { +- struct nls_table ** tmp = &tables; ++ struct nls_table * const * tmp = &tables; + + spin_lock(&nls_lock); + while (*tmp) { + if (nls == *tmp) { +- *tmp = nls->next; ++ pax_open_kernel(); ++ *(struct nls_table **)tmp = nls->next; ++ pax_close_kernel(); + spin_unlock(&nls_lock); + return 0; + } +diff --git a/fs/nls/nls_euc-jp.c b/fs/nls/nls_euc-jp.c +index 7424929..35f6be5 100644 +--- a/fs/nls/nls_euc-jp.c ++++ b/fs/nls/nls_euc-jp.c +@@ -561,8 +561,10 @@ static int __init init_nls_euc_jp(void) + p_nls = load_nls("cp932"); + + if (p_nls) { +- table.charset2upper = p_nls->charset2upper; +- table.charset2lower = p_nls->charset2lower; ++ pax_open_kernel(); ++ *(const unsigned char **)&table.charset2upper = p_nls->charset2upper; ++ *(const unsigned char **)&table.charset2lower = p_nls->charset2lower; ++ pax_close_kernel(); + return register_nls(&table); + } + +diff --git a/fs/nls/nls_koi8-ru.c b/fs/nls/nls_koi8-ru.c +index e7bc1d7..06bd4bb 100644 +--- a/fs/nls/nls_koi8-ru.c ++++ b/fs/nls/nls_koi8-ru.c +@@ -63,8 +63,10 @@ static int __init init_nls_koi8_ru(void) + p_nls = load_nls("koi8-u"); + + if (p_nls) { +- table.charset2upper = p_nls->charset2upper; +- table.charset2lower = p_nls->charset2lower; ++ pax_open_kernel(); ++ *(const unsigned char **)&table.charset2upper = p_nls->charset2upper; ++ *(const unsigned char **)&table.charset2lower = p_nls->charset2lower; ++ pax_close_kernel(); + return register_nls(&table); + } + diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c -index 3568c8a..e0240d8 100644 +index 5d84442..bf24453 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c -@@ -278,7 +278,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, - goto out_close_fd; +@@ -251,8 +251,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, + fd = fanotify_event_metadata.fd; ret = -EFAULT; - if (copy_to_user(buf, &fanotify_event_metadata, +- fanotify_event_metadata.event_len)) + if (fanotify_event_metadata.event_len > sizeof fanotify_event_metadata || -+ copy_to_user(buf, &fanotify_event_metadata, - fanotify_event_metadata.event_len)) - goto out_kill_access_response; ++ copy_to_user(buf, &fanotify_event_metadata, fanotify_event_metadata.event_len)) + goto out_close_fd; + ret = prepare_for_access_response(group, event, fd); diff --git a/fs/notify/notification.c b/fs/notify/notification.c -index c887b13..0fdf472 100644 +index 7b51b05..5ea5ef6 100644 --- a/fs/notify/notification.c +++ b/fs/notify/notification.c @@ -57,7 +57,7 @@ static struct kmem_cache *fsnotify_event_holder_cachep; @@ -47225,7 +53563,7 @@ index c887b13..0fdf472 100644 EXPORT_SYMBOL_GPL(fsnotify_get_cookie); diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c -index 99e3610..02c1068 100644 +index aa411c3..c260a84 100644 --- a/fs/ntfs/dir.c +++ b/fs/ntfs/dir.c @@ -1329,7 +1329,7 @@ find_next_index_buffer: @@ -47238,10 +53576,10 @@ index 99e3610..02c1068 100644 "inode 0x%lx or driver bug.", vdir->i_ino); goto err_out; diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c -index 8639169..76697aa 100644 +index 5b2d4f0..c6de396 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c -@@ -2229,6 +2229,6 @@ const struct inode_operations ntfs_file_inode_ops = { +@@ -2242,6 +2242,6 @@ const struct inode_operations ntfs_file_inode_ops = { #endif /* NTFS_RW */ }; @@ -47251,10 +53589,10 @@ index 8639169..76697aa 100644 -const struct inode_operations ntfs_empty_inode_ops = {}; +const struct inode_operations ntfs_empty_inode_ops __read_only; diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c -index 210c352..a174f83 100644 +index aebeacd..0dcdd26 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c -@@ -1283,7 +1283,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb, +@@ -1278,7 +1278,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb, goto bail; } @@ -47285,7 +53623,7 @@ index d355e6e..578d905 100644 enum ocfs2_local_alloc_state diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c -index f169da4..9112253 100644 +index b7e74b5..19c6536 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -872,7 +872,7 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb, @@ -47297,7 +53635,7 @@ index f169da4..9112253 100644 /* You should never ask for this much metadata */ BUG_ON(bits_wanted > -@@ -2008,7 +2008,7 @@ int ocfs2_claim_metadata(handle_t *handle, +@@ -2007,7 +2007,7 @@ int ocfs2_claim_metadata(handle_t *handle, mlog_errno(status); goto bail; } @@ -47306,7 +53644,7 @@ index f169da4..9112253 100644 *suballoc_loc = res.sr_bg_blkno; *suballoc_bit_start = res.sr_bit_offset; -@@ -2172,7 +2172,7 @@ int ocfs2_claim_new_inode_at_loc(handle_t *handle, +@@ -2171,7 +2171,7 @@ int ocfs2_claim_new_inode_at_loc(handle_t *handle, trace_ocfs2_claim_new_inode_at_loc((unsigned long long)di_blkno, res->sr_bits); @@ -47315,7 +53653,7 @@ index f169da4..9112253 100644 BUG_ON(res->sr_bits != 1); -@@ -2214,7 +2214,7 @@ int ocfs2_claim_new_inode(handle_t *handle, +@@ -2213,7 +2213,7 @@ int ocfs2_claim_new_inode(handle_t *handle, mlog_errno(status); goto bail; } @@ -47324,7 +53662,7 @@ index f169da4..9112253 100644 BUG_ON(res.sr_bits != 1); -@@ -2318,7 +2318,7 @@ int __ocfs2_claim_clusters(handle_t *handle, +@@ -2317,7 +2317,7 @@ int __ocfs2_claim_clusters(handle_t *handle, cluster_start, num_clusters); if (!status) @@ -47333,7 +53671,7 @@ index f169da4..9112253 100644 } else { if (min_clusters > (osb->bitmap_cpg - 1)) { /* The only paths asking for contiguousness -@@ -2344,7 +2344,7 @@ int __ocfs2_claim_clusters(handle_t *handle, +@@ -2343,7 +2343,7 @@ int __ocfs2_claim_clusters(handle_t *handle, ocfs2_desc_bitmap_to_cluster_off(ac->ac_inode, res.sr_bg_blkno, res.sr_bit_offset); @@ -47343,7 +53681,7 @@ index f169da4..9112253 100644 } } diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c -index 68f4541..89cfe6a 100644 +index 01b8516..579c4df 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -301,11 +301,11 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) @@ -47363,7 +53701,7 @@ index 68f4541..89cfe6a 100644 out += snprintf(buf + out, len - out, "%10s => State: %u Descriptor: %llu Size: %u bits " -@@ -2116,11 +2116,11 @@ static int ocfs2_initialize_super(struct super_block *sb, +@@ -2122,11 +2122,11 @@ static int ocfs2_initialize_super(struct super_block *sb, spin_lock_init(&osb->osb_xattr_lock); ocfs2_init_steal_slots(osb); @@ -47380,44 +53718,38 @@ index 68f4541..89cfe6a 100644 /* Copy the blockcheck stats from the superblock probe */ osb->osb_ecc_stats = *stats; -diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c -index 5d22872..523db20 100644 ---- a/fs/ocfs2/symlink.c -+++ b/fs/ocfs2/symlink.c -@@ -142,7 +142,7 @@ bail: - - static void ocfs2_fast_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) - { -- char *link = nd_get_link(nd); -+ const char *link = nd_get_link(nd); - if (!IS_ERR(link)) - kfree(link); - } diff --git a/fs/open.c b/fs/open.c -index cf1d34f..e58a595 100644 +index 6835446..eadf09f 100644 --- a/fs/open.c +++ b/fs/open.c -@@ -31,6 +31,8 @@ - #include <linux/ima.h> +@@ -32,6 +32,8 @@ #include <linux/dnotify.h> + #include <linux/compat.h> +#define CREATE_TRACE_POINTS +#include <trace/events/fs.h> #include "internal.h" int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, -@@ -112,6 +114,10 @@ static long do_sys_truncate(const char __user *pathname, loff_t length) +@@ -102,6 +104,8 @@ long vfs_truncate(struct path *path, loff_t length) error = locks_verify_truncate(inode, NULL, length); if (!error) - error = security_path_truncate(&path); -+ -+ if (!error && !gr_acl_handle_truncate(path.dentry, path.mnt)) + error = security_path_truncate(path); ++ if (!error && !gr_acl_handle_truncate(path->dentry, path->mnt)) + error = -EACCES; -+ if (!error) - error = do_truncate(path.dentry, length, 0, NULL); + error = do_truncate(path->dentry, length, 0, NULL); -@@ -358,6 +364,9 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) +@@ -186,6 +190,8 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small) + error = locks_verify_truncate(inode, f.file, length); + if (!error) + error = security_path_truncate(&f.file->f_path); ++ if (!error && !gr_acl_handle_truncate(f.file->f_path.dentry, f.file->f_path.mnt)) ++ error = -EACCES; + if (!error) + error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, f.file); + sb_end_write(inode->i_sb); +@@ -388,6 +394,9 @@ retry: if (__mnt_is_readonly(path.mnt)) res = -EROFS; @@ -47426,8 +53758,8 @@ index cf1d34f..e58a595 100644 + out_path_release: path_put(&path); - out: -@@ -384,6 +393,8 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) + if (retry_estale(res, lookup_flags)) { +@@ -419,6 +428,8 @@ retry: if (error) goto dput_and_out; @@ -47436,21 +53768,21 @@ index cf1d34f..e58a595 100644 set_fs_pwd(current->fs, &path); dput_and_out: -@@ -410,6 +421,13 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd) +@@ -448,6 +459,13 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd) goto out_putf; error = inode_permission(inode, MAY_EXEC | MAY_CHDIR); + -+ if (!error && !gr_chroot_fchdir(file->f_path.dentry, file->f_path.mnt)) ++ if (!error && !gr_chroot_fchdir(f.file->f_path.dentry, f.file->f_path.mnt)) + error = -EPERM; + + if (!error) -+ gr_log_chdir(file->f_path.dentry, file->f_path.mnt); ++ gr_log_chdir(f.file->f_path.dentry, f.file->f_path.mnt); + if (!error) - set_fs_pwd(current->fs, &file->f_path); + set_fs_pwd(current->fs, &f.file->f_path); out_putf: -@@ -438,7 +456,13 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename) +@@ -477,7 +495,13 @@ retry: if (error) goto dput_and_out; @@ -47464,7 +53796,7 @@ index cf1d34f..e58a595 100644 error = 0; dput_and_out: path_put(&path); -@@ -456,6 +480,16 @@ static int chmod_common(struct path *path, umode_t mode) +@@ -499,6 +523,16 @@ static int chmod_common(struct path *path, umode_t mode) if (error) return error; mutex_lock(&inode->i_mutex); @@ -47481,26 +53813,26 @@ index cf1d34f..e58a595 100644 error = security_path_chmod(path, mode); if (error) goto out_unlock; -@@ -506,6 +540,9 @@ static int chown_common(struct path *path, uid_t user, gid_t group) - int error; - struct iattr newattrs; +@@ -559,6 +593,9 @@ static int chown_common(struct path *path, uid_t user, gid_t group) + uid = make_kuid(current_user_ns(), user); + gid = make_kgid(current_user_ns(), group); + if (!gr_acl_handle_chown(path->dentry, path->mnt)) + return -EACCES; + newattrs.ia_valid = ATTR_CTIME; if (user != (uid_t) -1) { - newattrs.ia_valid |= ATTR_UID; -@@ -988,6 +1025,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode) + if (!uid_valid(uid)) +@@ -974,6 +1011,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode) } else { fsnotify_open(f); fd_install(fd, f); -+ trace_do_sys_open(tmp, flags, mode); ++ trace_do_sys_open(tmp->name, flags, mode); } } putname(tmp); diff --git a/fs/pipe.c b/fs/pipe.c -index fec5e4a..f4210f9 100644 +index 2234f3f..f9083a1 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -438,9 +438,9 @@ redo: @@ -47545,7 +53877,7 @@ index fec5e4a..f4210f9 100644 } out: mutex_unlock(&inode->i_mutex); -@@ -713,7 +713,7 @@ pipe_poll(struct file *filp, poll_table *wait) +@@ -716,7 +716,7 @@ pipe_poll(struct file *filp, poll_table *wait) mask = 0; if (filp->f_mode & FMODE_READ) { mask = (nrbufs > 0) ? POLLIN | POLLRDNORM : 0; @@ -47554,7 +53886,7 @@ index fec5e4a..f4210f9 100644 mask |= POLLHUP; } -@@ -723,7 +723,7 @@ pipe_poll(struct file *filp, poll_table *wait) +@@ -726,7 +726,7 @@ pipe_poll(struct file *filp, poll_table *wait) * Most Unices do not set POLLERR for FIFOs but on Linux they * behave exactly like pipes for poll(). */ @@ -47563,7 +53895,7 @@ index fec5e4a..f4210f9 100644 mask |= POLLERR; } -@@ -737,10 +737,10 @@ pipe_release(struct inode *inode, int decr, int decw) +@@ -740,10 +740,10 @@ pipe_release(struct inode *inode, int decr, int decw) mutex_lock(&inode->i_mutex); pipe = inode->i_pipe; @@ -47577,7 +53909,7 @@ index fec5e4a..f4210f9 100644 free_pipe_info(inode); } else { wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP); -@@ -830,7 +830,7 @@ pipe_read_open(struct inode *inode, struct file *filp) +@@ -833,7 +833,7 @@ pipe_read_open(struct inode *inode, struct file *filp) if (inode->i_pipe) { ret = 0; @@ -47586,7 +53918,7 @@ index fec5e4a..f4210f9 100644 } mutex_unlock(&inode->i_mutex); -@@ -847,7 +847,7 @@ pipe_write_open(struct inode *inode, struct file *filp) +@@ -850,7 +850,7 @@ pipe_write_open(struct inode *inode, struct file *filp) if (inode->i_pipe) { ret = 0; @@ -47595,7 +53927,7 @@ index fec5e4a..f4210f9 100644 } mutex_unlock(&inode->i_mutex); -@@ -865,9 +865,9 @@ pipe_rdwr_open(struct inode *inode, struct file *filp) +@@ -871,9 +871,9 @@ pipe_rdwr_open(struct inode *inode, struct file *filp) if (inode->i_pipe) { ret = 0; if (filp->f_mode & FMODE_READ) @@ -47607,7 +53939,7 @@ index fec5e4a..f4210f9 100644 } mutex_unlock(&inode->i_mutex); -@@ -959,7 +959,7 @@ void free_pipe_info(struct inode *inode) +@@ -965,7 +965,7 @@ void free_pipe_info(struct inode *inode) inode->i_pipe = NULL; } @@ -47616,7 +53948,7 @@ index fec5e4a..f4210f9 100644 /* * pipefs_dname() is called from d_path(). -@@ -989,7 +989,8 @@ static struct inode * get_pipe_inode(void) +@@ -995,7 +995,8 @@ static struct inode * get_pipe_inode(void) goto fail_iput; inode->i_pipe = pipe; @@ -47658,7 +53990,7 @@ index 15af622..0e9f4467 100644 help Various /proc files exist to monitor process memory utilization: diff --git a/fs/proc/array.c b/fs/proc/array.c -index f9bd395..acb7847 100644 +index cbd0f1b..adec3f0 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -60,6 +60,7 @@ @@ -47669,7 +54001,7 @@ index f9bd395..acb7847 100644 #include <linux/proc_fs.h> #include <linux/ioport.h> #include <linux/uaccess.h> -@@ -337,6 +338,21 @@ static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) +@@ -363,6 +364,21 @@ static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) seq_putc(m, '\n'); } @@ -47691,7 +54023,7 @@ index f9bd395..acb7847 100644 int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { -@@ -354,9 +370,24 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, +@@ -381,9 +397,24 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, task_cpus_allowed(m, task); cpuset_task_status_allowed(m, task); task_context_switch_counts(m, task); @@ -47716,7 +54048,7 @@ index f9bd395..acb7847 100644 static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task, int whole) { -@@ -378,6 +409,13 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, +@@ -405,6 +436,13 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, char tcomm[sizeof(task->comm)]; unsigned long flags; @@ -47730,8 +54062,8 @@ index f9bd395..acb7847 100644 state = *get_task_state(task); vsize = eip = esp = 0; permitted = ptrace_may_access(task, PTRACE_MODE_READ | PTRACE_MODE_NOAUDIT); -@@ -449,6 +487,19 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, - gtime = task->gtime; +@@ -476,6 +514,19 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, + gtime = task_gtime(task); } +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP @@ -47750,9 +54082,9 @@ index f9bd395..acb7847 100644 /* scale priority and nice values from timeslices to -20..20 */ /* to make it look like a "normal" Unix priority/nice value */ priority = task_prio(task); -@@ -485,9 +536,15 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, +@@ -512,9 +563,15 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, seq_put_decimal_ull(m, ' ', vsize); - seq_put_decimal_ll(m, ' ', mm ? get_mm_rss(mm) : 0); + seq_put_decimal_ull(m, ' ', mm ? get_mm_rss(mm) : 0); seq_put_decimal_ull(m, ' ', rsslim); +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP + seq_put_decimal_ull(m, ' ', PAX_RAND_FLAGS(mm) ? 1 : (mm ? (permitted ? mm->start_code : 1) : 0)); @@ -47766,23 +54098,20 @@ index f9bd395..acb7847 100644 seq_put_decimal_ull(m, ' ', esp); seq_put_decimal_ull(m, ' ', eip); /* The signal information here is obsolete. -@@ -508,9 +565,15 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, - seq_put_decimal_ull(m, ' ', delayacct_blkio_ticks(task)); +@@ -536,7 +593,11 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, seq_put_decimal_ull(m, ' ', cputime_to_clock_t(gtime)); seq_put_decimal_ll(m, ' ', cputime_to_clock_t(cgtime)); + +- if (mm && permitted) { ++ if (mm && permitted +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP -+ seq_put_decimal_ull(m, ' ', PAX_RAND_FLAGS(mm) ? 0 : ((mm && permitted) ? mm->start_data : 0)); -+ seq_put_decimal_ull(m, ' ', PAX_RAND_FLAGS(mm) ? 0 : ((mm && permitted) ? mm->end_data : 0)); -+ seq_put_decimal_ull(m, ' ', PAX_RAND_FLAGS(mm) ? 0 : ((mm && permitted) ? mm->start_brk : 0)); -+#else - seq_put_decimal_ull(m, ' ', (mm && permitted) ? mm->start_data : 0); - seq_put_decimal_ull(m, ' ', (mm && permitted) ? mm->end_data : 0); - seq_put_decimal_ull(m, ' ', (mm && permitted) ? mm->start_brk : 0); ++ && !PAX_RAND_FLAGS(mm) +#endif - seq_putc(m, '\n'); - if (mm) - mmput(mm); -@@ -533,8 +596,15 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, ++ ) { + seq_put_decimal_ull(m, ' ', mm->start_data); + seq_put_decimal_ull(m, ' ', mm->end_data); + seq_put_decimal_ull(m, ' ', mm->start_brk); +@@ -574,8 +635,15 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { unsigned long size = 0, resident = 0, shared = 0, text = 0, data = 0; @@ -47799,30 +54128,25 @@ index f9bd395..acb7847 100644 if (mm) { size = task_statm(mm, &shared, &text, &data, &resident); mmput(mm); -@@ -556,3 +626,18 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, - +@@ -598,6 +666,13 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, return 0; } -+ + +#ifdef CONFIG_GRKERNSEC_PROC_IPADDR +int proc_pid_ipaddr(struct task_struct *task, char *buffer) +{ -+ u32 curr_ip = 0; -+ unsigned long flags; -+ -+ if (lock_task_sighand(task, &flags)) { -+ curr_ip = task->signal->curr_ip; -+ unlock_task_sighand(task, &flags); -+ } -+ -+ return sprintf(buffer, "%pI4\n", &curr_ip); ++ return sprintf(buffer, "%pI4\n", &task->signal->curr_ip); +} +#endif ++ + #ifdef CONFIG_CHECKPOINT_RESTORE + static struct pid * + get_children_pid(struct inode *inode, struct pid *pid_prev, loff_t pos) diff --git a/fs/proc/base.c b/fs/proc/base.c -index 9fc77b4..4877d08 100644 +index 69078c7..3e12a75 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c -@@ -109,6 +109,14 @@ struct pid_entry { +@@ -112,6 +112,14 @@ struct pid_entry { union proc_op op; }; @@ -47837,19 +54161,7 @@ index 9fc77b4..4877d08 100644 #define NOD(NAME, MODE, IOP, FOP, OP) { \ .name = (NAME), \ .len = sizeof(NAME) - 1, \ -@@ -198,11 +206,6 @@ static int proc_root_link(struct dentry *dentry, struct path *path) - return result; - } - --struct mm_struct *mm_for_maps(struct task_struct *task) --{ -- return mm_access(task, PTRACE_MODE_READ); --} -- - static int proc_pid_cmdline(struct task_struct *task, char * buffer) - { - int res = 0; -@@ -213,6 +216,9 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer) +@@ -209,6 +217,9 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer) if (!mm->arg_end) goto out_mm; /* Shh! No looking before we're done */ @@ -47859,7 +54171,7 @@ index 9fc77b4..4877d08 100644 len = mm->arg_end - mm->arg_start; if (len > PAGE_SIZE) -@@ -240,12 +246,28 @@ out: +@@ -236,12 +247,28 @@ out: return res; } @@ -47871,8 +54183,7 @@ index 9fc77b4..4877d08 100644 + static int proc_pid_auxv(struct task_struct *task, char *buffer) { -- struct mm_struct *mm = mm_for_maps(task); -+ struct mm_struct *mm = mm_access(task, PTRACE_MODE_READ); + struct mm_struct *mm = mm_access(task, PTRACE_MODE_READ); int res = PTR_ERR(mm); if (mm && !IS_ERR(mm)) { unsigned int nwords = 0; @@ -47889,7 +54200,7 @@ index 9fc77b4..4877d08 100644 do { nwords += 2; } while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */ -@@ -259,7 +281,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer) +@@ -255,7 +282,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer) } @@ -47898,7 +54209,7 @@ index 9fc77b4..4877d08 100644 /* * Provides a wchan file via kallsyms in a proper one-value-per-file format. * Returns the resolved symbol. If that fails, simply return the address. -@@ -298,7 +320,7 @@ static void unlock_trace(struct task_struct *task) +@@ -294,7 +321,7 @@ static void unlock_trace(struct task_struct *task) mutex_unlock(&task->signal->cred_guard_mutex); } @@ -47907,7 +54218,7 @@ index 9fc77b4..4877d08 100644 #define MAX_STACK_TRACE_DEPTH 64 -@@ -489,7 +511,7 @@ static int proc_pid_limits(struct task_struct *task, char *buffer) +@@ -486,7 +513,7 @@ static int proc_pid_limits(struct task_struct *task, char *buffer) return count; } @@ -47916,7 +54227,7 @@ index 9fc77b4..4877d08 100644 static int proc_pid_syscall(struct task_struct *task, char *buffer) { long nr; -@@ -518,7 +540,7 @@ static int proc_pid_syscall(struct task_struct *task, char *buffer) +@@ -515,7 +542,7 @@ static int proc_pid_syscall(struct task_struct *task, char *buffer) /************************************************************************/ /* permission checks */ @@ -47925,7 +54236,7 @@ index 9fc77b4..4877d08 100644 { struct task_struct *task; int allowed = 0; -@@ -528,7 +550,10 @@ static int proc_fd_access_allowed(struct inode *inode) +@@ -525,7 +552,10 @@ static int proc_fd_access_allowed(struct inode *inode) */ task = get_proc_task(inode); if (task) { @@ -47937,7 +54248,7 @@ index 9fc77b4..4877d08 100644 put_task_struct(task); } return allowed; -@@ -566,10 +591,35 @@ static bool has_pid_permissions(struct pid_namespace *pid, +@@ -556,10 +586,35 @@ static bool has_pid_permissions(struct pid_namespace *pid, struct task_struct *task, int hide_pid_min) { @@ -47950,9 +54261,9 @@ index 9fc77b4..4877d08 100644 + const struct cred *tmpcred = current_cred(); + const struct cred *cred = __task_cred(task); + -+ if (!tmpcred->uid || (tmpcred->uid == cred->uid) ++ if (uid_eq(tmpcred->uid, GLOBAL_ROOT_UID) || uid_eq(tmpcred->uid, cred->uid) +#ifdef CONFIG_GRKERNSEC_PROC_USERGROUP -+ || in_group_p(CONFIG_GRKERNSEC_PROC_GID) ++ || in_group_p(grsec_proc_gid) +#endif + ) { + rcu_read_unlock(); @@ -47973,7 +54284,7 @@ index 9fc77b4..4877d08 100644 return ptrace_may_access(task, PTRACE_MODE_READ); } -@@ -587,7 +637,11 @@ static int proc_pid_permission(struct inode *inode, int mask) +@@ -577,7 +632,11 @@ static int proc_pid_permission(struct inode *inode, int mask) put_task_struct(task); if (!has_perms) { @@ -47985,35 +54296,20 @@ index 9fc77b4..4877d08 100644 /* * Let's make getdents(), stat(), and open() * consistent with each other. If a process -@@ -677,7 +731,7 @@ static const struct file_operations proc_single_file_operations = { - .release = single_release, - }; - --static int mem_open(struct inode* inode, struct file* file) -+static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) - { - struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); - struct mm_struct *mm; -@@ -685,7 +739,12 @@ static int mem_open(struct inode* inode, struct file* file) +@@ -675,6 +734,11 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) if (!task) return -ESRCH; -- mm = mm_access(task, PTRACE_MODE_ATTACH); + if (gr_acl_handle_procpidmem(task)) { + put_task_struct(task); + return -EPERM; + } + -+ mm = mm_access(task, mode); + mm = mm_access(task, mode); put_task_struct(task); - if (IS_ERR(mm)) -@@ -698,13 +757,26 @@ static int mem_open(struct inode* inode, struct file* file) - mmput(mm); - } +@@ -690,6 +754,10 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) -- /* OK to pass negative loff_t, we can catch out-of-range */ -- file->f_mode |= FMODE_UNSIGNED_OFFSET; file->private_data = mm; +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP @@ -48023,21 +54319,7 @@ index 9fc77b4..4877d08 100644 return 0; } -+static int mem_open(struct inode *inode, struct file *file) -+{ -+ int ret; -+ ret = __mem_open(inode, file, PTRACE_MODE_ATTACH); -+ -+ /* OK to pass negative loff_t, we can catch out-of-range */ -+ file->f_mode |= FMODE_UNSIGNED_OFFSET; -+ -+ return ret; -+} -+ - static ssize_t mem_rw(struct file *file, char __user *buf, - size_t count, loff_t *ppos, int write) - { -@@ -713,6 +785,17 @@ static ssize_t mem_rw(struct file *file, char __user *buf, +@@ -711,6 +779,17 @@ static ssize_t mem_rw(struct file *file, char __user *buf, ssize_t copied; char *page; @@ -48055,110 +54337,48 @@ index 9fc77b4..4877d08 100644 if (!mm) return 0; -@@ -801,42 +884,49 @@ static const struct file_operations proc_mem_operations = { - .release = mem_release, - }; +@@ -723,7 +802,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf, + goto free; -+static int environ_open(struct inode *inode, struct file *file) -+{ -+ return __mem_open(inode, file, PTRACE_MODE_READ); -+} -+ - static ssize_t environ_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) - { -- struct task_struct *task = get_proc_task(file->f_dentry->d_inode); - char *page; - unsigned long src = *ppos; -- int ret = -ESRCH; -- struct mm_struct *mm; -+ int ret = 0; -+ struct mm_struct *mm = file->private_data; + while (count > 0) { +- int this_len = min_t(int, count, PAGE_SIZE); ++ ssize_t this_len = min_t(ssize_t, count, PAGE_SIZE); + + if (write && copy_from_user(page, buf, this_len)) { + copied = -EFAULT; +@@ -815,6 +894,13 @@ static ssize_t environ_read(struct file *file, char __user *buf, + if (!mm) + return 0; -- if (!task) -- goto out_no_task; -+ if (!mm) -+ return 0; -+ +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP + if (file->f_version != current->exec_id) { + gr_log_badprocpid("environ"); + return 0; + } +#endif - -- ret = -ENOMEM; ++ page = (char *)__get_free_page(GFP_TEMPORARY); if (!page) -- goto out; -- -- -- mm = mm_for_maps(task); -- ret = PTR_ERR(mm); -- if (!mm || IS_ERR(mm)) -- goto out_free; -+ return -ENOMEM; - - ret = 0; -+ if (!atomic_inc_not_zero(&mm->mm_users)) -+ goto free; + return -ENOMEM; +@@ -824,7 +910,7 @@ static ssize_t environ_read(struct file *file, char __user *buf, + goto free; while (count > 0) { -- int this_len, retval, max_len; -- -- this_len = mm->env_end - (mm->env_start + src); -+ size_t this_len, max_len; -+ int retval; + size_t this_len, max_len; +- int retval; ++ ssize_t retval; -- if (this_len <= 0) -+ if (src >= (mm->env_end - mm->env_start)) + if (src >= (mm->env_end - mm->env_start)) break; - -- max_len = (count > PAGE_SIZE) ? PAGE_SIZE : count; -- this_len = (this_len > max_len) ? max_len : this_len; -+ this_len = mm->env_end - (mm->env_start + src); -+ -+ max_len = min_t(size_t, PAGE_SIZE, count); -+ this_len = min(max_len, this_len); - -- retval = access_process_vm(task, (mm->env_start + src), -+ retval = access_remote_vm(mm, (mm->env_start + src), - page, this_len, 0); - - if (retval <= 0) { -@@ -855,19 +945,18 @@ static ssize_t environ_read(struct file *file, char __user *buf, - count -= retval; - } - *ppos = src; -- - mmput(mm); --out_free: -+ -+free: - free_page((unsigned long) page); --out: -- put_task_struct(task); --out_no_task: - return ret; - } - - static const struct file_operations proc_environ_operations = { -+ .open = environ_open, - .read = environ_read, - .llseek = generic_file_llseek, -+ .release = mem_release, - }; - - static ssize_t oom_adjust_read(struct file *file, char __user *buf, -@@ -1433,7 +1522,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) - path_put(&nd->path); +@@ -1430,7 +1516,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) + int error = -EACCES; /* Are we allowed to snoop on the tasks file descriptors? */ - if (!proc_fd_access_allowed(inode)) + if (!proc_fd_access_allowed(inode, 0)) goto out; - error = PROC_I(inode)->op.proc_get_link(dentry, &nd->path); -@@ -1472,8 +1561,18 @@ static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int b + error = PROC_I(inode)->op.proc_get_link(dentry, &path); +@@ -1474,8 +1560,18 @@ static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int b struct path path; /* Are we allowed to snoop on the tasks file descriptors? */ @@ -48179,19 +54399,19 @@ index 9fc77b4..4877d08 100644 error = PROC_I(inode)->op.proc_get_link(dentry, &path); if (error) -@@ -1538,7 +1637,11 @@ struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *t +@@ -1525,7 +1621,11 @@ struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *t rcu_read_lock(); cred = __task_cred(task); inode->i_uid = cred->euid; +#ifdef CONFIG_GRKERNSEC_PROC_USERGROUP -+ inode->i_gid = CONFIG_GRKERNSEC_PROC_GID; ++ inode->i_gid = grsec_proc_gid; +#else inode->i_gid = cred->egid; +#endif rcu_read_unlock(); } security_task_to_inode(task, inode); -@@ -1574,10 +1677,19 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) +@@ -1561,10 +1661,19 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) return -ENOENT; } if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) || @@ -48204,14 +54424,14 @@ index 9fc77b4..4877d08 100644 cred = __task_cred(task); stat->uid = cred->euid; +#ifdef CONFIG_GRKERNSEC_PROC_USERGROUP -+ stat->gid = CONFIG_GRKERNSEC_PROC_GID; ++ stat->gid = grsec_proc_gid; +#else stat->gid = cred->egid; +#endif } } rcu_read_unlock(); -@@ -1615,11 +1727,20 @@ int pid_revalidate(struct dentry *dentry, struct nameidata *nd) +@@ -1602,11 +1711,20 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags) if (task) { if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) || @@ -48225,62 +54445,14 @@ index 9fc77b4..4877d08 100644 cred = __task_cred(task); inode->i_uid = cred->euid; +#ifdef CONFIG_GRKERNSEC_PROC_USERGROUP -+ inode->i_gid = CONFIG_GRKERNSEC_PROC_GID; ++ inode->i_gid = grsec_proc_gid; +#else inode->i_gid = cred->egid; +#endif rcu_read_unlock(); } else { - inode->i_uid = 0; -@@ -1737,7 +1858,8 @@ static int proc_fd_info(struct inode *inode, struct path *path, char *info) - int fd = proc_fd(inode); - - if (task) { -- files = get_files_struct(task); -+ if (!gr_acl_handle_procpidmem(task)) -+ files = get_files_struct(task); - put_task_struct(task); - } - if (files) { -@@ -2025,11 +2147,8 @@ static int map_files_d_revalidate(struct dentry *dentry, struct nameidata *nd) - if (!task) - goto out_notask; - -- if (!ptrace_may_access(task, PTRACE_MODE_READ)) -- goto out; -- -- mm = get_task_mm(task); -- if (!mm) -+ mm = mm_access(task, PTRACE_MODE_READ); -+ if (IS_ERR_OR_NULL(mm)) - goto out; - - if (!dname_to_vma_addr(dentry, &vm_start, &vm_end)) { -@@ -2338,11 +2457,21 @@ static const struct file_operations proc_map_files_operations = { - */ - static int proc_fd_permission(struct inode *inode, int mask) - { -+ struct task_struct *task; - int rv = generic_permission(inode, mask); -- if (rv == 0) -- return 0; -+ - if (task_pid(current) == proc_pid(inode)) - rv = 0; -+ -+ task = get_proc_task(inode); -+ if (task == NULL) -+ return rv; -+ -+ if (gr_acl_handle_procpidmem(task)) -+ rv = -EACCES; -+ -+ put_task_struct(task); -+ - return rv; - } - -@@ -2452,6 +2581,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir, + inode->i_uid = GLOBAL_ROOT_UID; +@@ -2059,6 +2177,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir, if (!task) goto out_no_task; @@ -48290,7 +54462,7 @@ index 9fc77b4..4877d08 100644 /* * Yes, it does not scale. And it should not. Don't add * new entries into /proc/<tgid>/ without very good reasons. -@@ -2496,6 +2628,9 @@ static int proc_pident_readdir(struct file *filp, +@@ -2103,6 +2224,9 @@ static int proc_pident_readdir(struct file *filp, if (!task) goto out_no_task; @@ -48300,16 +54472,7 @@ index 9fc77b4..4877d08 100644 ret = 0; i = filp->f_pos; switch (i) { -@@ -2766,7 +2901,7 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) - static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd, - void *cookie) - { -- char *s = nd_get_link(nd); -+ const char *s = nd_get_link(nd); - if (!IS_ERR(s)) - __putname(s); - } -@@ -2967,7 +3102,7 @@ static const struct pid_entry tgid_base_stuff[] = { +@@ -2516,7 +2640,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("autogroup", S_IRUGO|S_IWUSR, proc_pid_sched_autogroup_operations), #endif REG("comm", S_IRUGO|S_IWUSR, proc_pid_set_comm_operations), @@ -48318,7 +54481,7 @@ index 9fc77b4..4877d08 100644 INF("syscall", S_IRUGO, proc_pid_syscall), #endif INF("cmdline", S_IRUGO, proc_pid_cmdline), -@@ -2992,10 +3127,10 @@ static const struct pid_entry tgid_base_stuff[] = { +@@ -2541,10 +2665,10 @@ static const struct pid_entry tgid_base_stuff[] = { #ifdef CONFIG_SECURITY DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations), #endif @@ -48331,24 +54494,24 @@ index 9fc77b4..4877d08 100644 ONE("stack", S_IRUGO, proc_pid_stack), #endif #ifdef CONFIG_SCHEDSTATS -@@ -3029,6 +3164,9 @@ static const struct pid_entry tgid_base_stuff[] = { +@@ -2578,6 +2702,9 @@ static const struct pid_entry tgid_base_stuff[] = { #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), #endif +#ifdef CONFIG_GRKERNSEC_PROC_IPADDR -+ INF("ipaddr", S_IRUSR, proc_pid_ipaddr), ++ INF("ipaddr", S_IRUSR, proc_pid_ipaddr), +#endif - }; - - static int proc_tgid_base_readdir(struct file * filp, -@@ -3155,7 +3293,14 @@ static struct dentry *proc_pid_instantiate(struct inode *dir, + #ifdef CONFIG_USER_NS + REG("uid_map", S_IRUGO|S_IWUSR, proc_uid_map_operations), + REG("gid_map", S_IRUGO|S_IWUSR, proc_gid_map_operations), +@@ -2707,7 +2834,14 @@ static struct dentry *proc_pid_instantiate(struct inode *dir, if (!inode) goto out; +#ifdef CONFIG_GRKERNSEC_PROC_USER + inode->i_mode = S_IFDIR|S_IRUSR|S_IXUSR; +#elif defined(CONFIG_GRKERNSEC_PROC_USERGROUP) -+ inode->i_gid = CONFIG_GRKERNSEC_PROC_GID; ++ inode->i_gid = grsec_proc_gid; + inode->i_mode = S_IFDIR|S_IRUSR|S_IRGRP|S_IXUSR|S_IXGRP; +#else inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO; @@ -48356,7 +54519,7 @@ index 9fc77b4..4877d08 100644 inode->i_op = &proc_tgid_base_inode_operations; inode->i_fop = &proc_tgid_base_operations; inode->i_flags|=S_IMMUTABLE; -@@ -3197,7 +3342,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct +@@ -2745,7 +2879,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, unsign if (!task) goto out; @@ -48368,7 +54531,7 @@ index 9fc77b4..4877d08 100644 put_task_struct(task); out: return result; -@@ -3260,6 +3409,8 @@ static int proc_pid_fill_cache(struct file *filp, void *dirent, filldir_t filldi +@@ -2808,6 +2946,8 @@ static int proc_pid_fill_cache(struct file *filp, void *dirent, filldir_t filldi static int fake_filldir(void *buf, const char *name, int namelen, loff_t offset, u64 ino, unsigned d_type) { @@ -48377,7 +54540,7 @@ index 9fc77b4..4877d08 100644 return 0; } -@@ -3326,7 +3477,7 @@ static const struct pid_entry tid_base_stuff[] = { +@@ -2859,7 +2999,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), #endif REG("comm", S_IRUGO|S_IWUSR, proc_pid_set_comm_operations), @@ -48386,7 +54549,7 @@ index 9fc77b4..4877d08 100644 INF("syscall", S_IRUGO, proc_pid_syscall), #endif INF("cmdline", S_IRUGO, proc_pid_cmdline), -@@ -3350,10 +3501,10 @@ static const struct pid_entry tid_base_stuff[] = { +@@ -2886,10 +3026,10 @@ static const struct pid_entry tid_base_stuff[] = { #ifdef CONFIG_SECURITY DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations), #endif @@ -48431,11 +54594,49 @@ index b143471..bb105e5 100644 return 0; } module_init(proc_devices_init); +diff --git a/fs/proc/fd.c b/fs/proc/fd.c +index d7a4a28..0201742 100644 +--- a/fs/proc/fd.c ++++ b/fs/proc/fd.c +@@ -25,7 +25,8 @@ static int seq_show(struct seq_file *m, void *v) + if (!task) + return -ENOENT; + +- files = get_files_struct(task); ++ if (!gr_acl_handle_procpidmem(task)) ++ files = get_files_struct(task); + put_task_struct(task); + + if (files) { +@@ -302,11 +303,21 @@ static struct dentry *proc_lookupfd(struct inode *dir, struct dentry *dentry, + */ + int proc_fd_permission(struct inode *inode, int mask) + { ++ struct task_struct *task; + int rv = generic_permission(inode, mask); +- if (rv == 0) +- return 0; ++ + if (task_pid(current) == proc_pid(inode)) + rv = 0; ++ ++ task = get_proc_task(inode); ++ if (task == NULL) ++ return rv; ++ ++ if (gr_acl_handle_procpidmem(task)) ++ rv = -EACCES; ++ ++ put_task_struct(task); ++ + return rv; + } + diff --git a/fs/proc/inode.c b/fs/proc/inode.c -index 205c922..2ee4c57 100644 +index 869116c..820cb27 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c -@@ -21,11 +21,17 @@ +@@ -22,11 +22,17 @@ #include <linux/seq_file.h> #include <linux/slab.h> #include <linux/mount.h> @@ -48453,10 +54654,10 @@ index 205c922..2ee4c57 100644 static void proc_evict_inode(struct inode *inode) { struct proc_dir_entry *de; -@@ -51,6 +57,13 @@ static void proc_evict_inode(struct inode *inode) - ns_ops = PROC_I(inode)->ns_ops; - if (ns_ops && ns_ops->put) - ns_ops->put(PROC_I(inode)->ns); +@@ -54,6 +60,13 @@ static void proc_evict_inode(struct inode *inode) + ns = PROC_I(inode)->ns; + if (ns_ops && ns) + ns_ops->put(ns); + +#ifdef CONFIG_PROC_SYSCTL + if (inode->i_op == &proc_sys_inode_operations || @@ -48472,7 +54673,7 @@ index 205c922..2ee4c57 100644 inode->i_mode = de->mode; inode->i_uid = de->uid; +#ifdef CONFIG_GRKERNSEC_PROC_USERGROUP -+ inode->i_gid = CONFIG_GRKERNSEC_PROC_GID; ++ inode->i_gid = grsec_proc_gid; +#else inode->i_gid = de->gid; +#endif @@ -48480,19 +54681,10 @@ index 205c922..2ee4c57 100644 if (de->size) inode->i_size = de->size; diff --git a/fs/proc/internal.h b/fs/proc/internal.h -index 5f79bb8..e9ab85d 100644 +index 85ff3a4..a512bd8 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h -@@ -31,8 +31,6 @@ struct vmalloc_info { - unsigned long largest_chunk; - }; - --extern struct mm_struct *mm_for_maps(struct task_struct *); -- - #ifdef CONFIG_MMU - #define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START) - extern void get_vmalloc_info(struct vmalloc_info *vmi); -@@ -54,6 +52,9 @@ extern int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, +@@ -56,6 +56,9 @@ extern int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task); extern int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task); @@ -48501,12 +54693,12 @@ index 5f79bb8..e9ab85d 100644 +#endif extern loff_t mem_lseek(struct file *file, loff_t offset, int orig); - extern const struct file_operations proc_pid_maps_operations; + extern const struct file_operations proc_tid_children_operations; diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c -index 86c67ee..cdca321 100644 +index eda6f01..006ae24 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c -@@ -480,9 +480,10 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) +@@ -481,9 +481,10 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) * the addresses in the elf_phdr on our list. */ start = kc_offset_to_vaddr(*fpos - elf_buflen); @@ -48519,12 +54711,14 @@ index 86c67ee..cdca321 100644 while (buflen) { struct kcore_list *m; -@@ -511,20 +512,23 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) +@@ -512,20 +513,23 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) kfree(elf_buf); } else { if (kern_addr_valid(start)) { - unsigned long n; -- ++ char *elf_buf; ++ mm_segment_t oldfs; + - n = copy_to_user(buffer, (char *)start, tsz); - /* - * We cannot distinguish between fault on source @@ -48535,9 +54729,6 @@ index 86c67ee..cdca321 100644 - if (n) { - if (clear_user(buffer + tsz - n, - n)) -+ char *elf_buf; -+ mm_segment_t oldfs; -+ + elf_buf = kmalloc(tsz, GFP_KERNEL); + if (!elf_buf) + return -ENOMEM; @@ -48555,7 +54746,7 @@ index 86c67ee..cdca321 100644 } else { if (clear_user(buffer, tsz)) return -EFAULT; -@@ -544,6 +548,9 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) +@@ -545,6 +549,9 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) static int open_kcore(struct inode *inode, struct file *filp) { @@ -48566,20 +54757,20 @@ index 86c67ee..cdca321 100644 return -EPERM; if (kcore_need_update) diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c -index 80e4645..53e5fcf 100644 +index 1efaaa1..834e49a 100644 --- a/fs/proc/meminfo.c +++ b/fs/proc/meminfo.c @@ -158,7 +158,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) vmi.used >> 10, vmi.largest_chunk >> 10 #ifdef CONFIG_MEMORY_FAILURE -- ,atomic_long_read(&mce_bad_pages) << (PAGE_SHIFT - 10) -+ ,atomic_long_read_unchecked(&mce_bad_pages) << (PAGE_SHIFT - 10) +- ,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10) ++ ,atomic_long_read_unchecked(&num_poisoned_pages) << (PAGE_SHIFT - 10) #endif #ifdef CONFIG_TRANSPARENT_HUGEPAGE ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) * diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c -index b1822dd..df622cb 100644 +index ccfd99b..1b7e255 100644 --- a/fs/proc/nommu.c +++ b/fs/proc/nommu.c @@ -66,7 +66,7 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region) @@ -48592,10 +54783,18 @@ index b1822dd..df622cb 100644 seq_putc(m, '\n'); diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c -index 06e1cc1..177cd98 100644 +index b4ac657..0842bd2 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c -@@ -105,6 +105,17 @@ static struct net *get_proc_task_net(struct inode *dir) +@@ -23,6 +23,7 @@ + #include <linux/nsproxy.h> + #include <net/net_namespace.h> + #include <linux/seq_file.h> ++#include <linux/grsecurity.h> + + #include "internal.h" + +@@ -105,6 +106,17 @@ static struct net *get_proc_task_net(struct inode *dir) struct task_struct *task; struct nsproxy *ns; struct net *net = NULL; @@ -48604,20 +54803,20 @@ index 06e1cc1..177cd98 100644 +#endif + +#ifdef CONFIG_GRKERNSEC_PROC_USER -+ if (cred->fsuid) ++ if (!uid_eq(cred->fsuid, GLOBAL_ROOT_UID)) + return net; +#elif defined(CONFIG_GRKERNSEC_PROC_USERGROUP) -+ if (cred->fsuid && !in_group_p(CONFIG_GRKERNSEC_PROC_GID)) ++ if (!uid_eq(cred->fsuid, GLOBAL_ROOT_UID) && !in_group_p(grsec_proc_gid)) + return net; +#endif rcu_read_lock(); task = pid_task(proc_pid(dir), PIDTYPE_PID); diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c -index 21d836f..bebf3ee 100644 +index ac05f33..1e6dc7e 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c -@@ -12,11 +12,15 @@ +@@ -13,11 +13,15 @@ #include <linux/module.h> #include "internal.h" @@ -48635,7 +54834,7 @@ index 21d836f..bebf3ee 100644 void proc_sys_poll_notify(struct ctl_table_poll *poll) { -@@ -470,8 +474,14 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, +@@ -467,6 +471,9 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, err = NULL; d_set_d_op(dentry, &proc_sys_dentry_operations); @@ -48644,35 +54843,25 @@ index 21d836f..bebf3ee 100644 + d_add(dentry, inode); -+ if (!gr_acl_handle_hidden_file(dentry, nd->path.mnt)) -+ err = ERR_PTR(-ENOENT); -+ out: - sysctl_head_finish(head); - return err; -@@ -483,18 +493,20 @@ static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, - struct inode *inode = filp->f_path.dentry->d_inode; +@@ -482,6 +489,7 @@ static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, + struct inode *inode = file_inode(filp); struct ctl_table_header *head = grab_header(inode); struct ctl_table *table = PROC_I(inode)->sysctl_entry; + int op = write ? MAY_WRITE : MAY_READ; ssize_t error; size_t res; - if (IS_ERR(head)) - return PTR_ERR(head); - -+ - /* - * At this point we know that the sysctl was not unregistered +@@ -493,7 +501,7 @@ static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, * and won't be until we finish. */ error = -EPERM; -- if (sysctl_perm(head->root, table, write ? MAY_WRITE : MAY_READ)) -+ if (sysctl_perm(head->root, table, op)) +- if (sysctl_perm(head, table, write ? MAY_WRITE : MAY_READ)) ++ if (sysctl_perm(head, table, op)) goto out; /* if that can happen at all, it should be -EINVAL, not -EISDIR */ -@@ -502,6 +514,22 @@ static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, +@@ -501,6 +509,22 @@ static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, if (!table->proc_handler) goto out; @@ -48695,7 +54884,7 @@ index 21d836f..bebf3ee 100644 /* careful: calling conventions are nasty here */ res = count; error = table->proc_handler(table, write, buf, &res, ppos); -@@ -599,6 +627,9 @@ static int proc_sys_fill_cache(struct file *filp, void *dirent, +@@ -598,6 +622,9 @@ static int proc_sys_fill_cache(struct file *filp, void *dirent, return -ENOMEM; } else { d_set_d_op(child, &proc_sys_dentry_operations); @@ -48705,7 +54894,7 @@ index 21d836f..bebf3ee 100644 d_add(child, inode); } } else { -@@ -642,6 +673,9 @@ static int scan(struct ctl_table_header *head, ctl_table *table, +@@ -641,6 +668,9 @@ static int scan(struct ctl_table_header *head, ctl_table *table, if ((*pos)++ < file->f_pos) return 0; @@ -48715,7 +54904,7 @@ index 21d836f..bebf3ee 100644 if (unlikely(S_ISLNK(table->mode))) res = proc_sys_link_fill_cache(file, dirent, filldir, head, table); else -@@ -759,6 +793,9 @@ static int proc_sys_getattr(struct vfsmount *mnt, struct dentry *dentry, struct +@@ -751,6 +781,9 @@ static int proc_sys_getattr(struct vfsmount *mnt, struct dentry *dentry, struct if (IS_ERR(head)) return PTR_ERR(head); @@ -48725,7 +54914,7 @@ index 21d836f..bebf3ee 100644 generic_fillattr(inode, stat); if (table) stat->mode = (stat->mode & S_IFMT) | table->mode; -@@ -781,13 +818,13 @@ static const struct file_operations proc_sys_dir_file_operations = { +@@ -773,13 +806,13 @@ static const struct file_operations proc_sys_dir_file_operations = { .llseek = generic_file_llseek, }; @@ -48741,11 +54930,80 @@ index 21d836f..bebf3ee 100644 .lookup = proc_sys_lookup, .permission = proc_sys_permission, .setattr = proc_sys_setattr, +@@ -855,7 +888,7 @@ static struct ctl_dir *find_subdir(struct ctl_dir *dir, + static struct ctl_dir *new_dir(struct ctl_table_set *set, + const char *name, int namelen) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + struct ctl_dir *new; + struct ctl_node *node; + char *new_name; +@@ -867,7 +900,7 @@ static struct ctl_dir *new_dir(struct ctl_table_set *set, + return NULL; + + node = (struct ctl_node *)(new + 1); +- table = (struct ctl_table *)(node + 1); ++ table = (ctl_table_no_const *)(node + 1); + new_name = (char *)(table + 2); + memcpy(new_name, name, namelen); + new_name[namelen] = '\0'; +@@ -1036,7 +1069,8 @@ static int sysctl_check_table(const char *path, struct ctl_table *table) + static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table *table, + struct ctl_table_root *link_root) + { +- struct ctl_table *link_table, *entry, *link; ++ ctl_table_no_const *link_table, *link; ++ struct ctl_table *entry; + struct ctl_table_header *links; + struct ctl_node *node; + char *link_name; +@@ -1059,7 +1093,7 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table + return NULL; + + node = (struct ctl_node *)(links + 1); +- link_table = (struct ctl_table *)(node + nr_entries); ++ link_table = (ctl_table_no_const *)(node + nr_entries); + link_name = (char *)&link_table[nr_entries + 1]; + + for (link = link_table, entry = table; entry->procname; link++, entry++) { +@@ -1307,8 +1341,8 @@ static int register_leaf_sysctl_tables(const char *path, char *pos, + struct ctl_table_header ***subheader, struct ctl_table_set *set, + struct ctl_table *table) + { +- struct ctl_table *ctl_table_arg = NULL; +- struct ctl_table *entry, *files; ++ ctl_table_no_const *ctl_table_arg = NULL, *files = NULL; ++ struct ctl_table *entry; + int nr_files = 0; + int nr_dirs = 0; + int err = -ENOMEM; +@@ -1320,10 +1354,9 @@ static int register_leaf_sysctl_tables(const char *path, char *pos, + nr_files++; + } + +- files = table; + /* If there are mixed files and directories we need a new table */ + if (nr_dirs && nr_files) { +- struct ctl_table *new; ++ ctl_table_no_const *new; + files = kzalloc(sizeof(struct ctl_table) * (nr_files + 1), + GFP_KERNEL); + if (!files) +@@ -1341,7 +1374,7 @@ static int register_leaf_sysctl_tables(const char *path, char *pos, + /* Register everything except a directory full of subdirectories */ + if (nr_files || !nr_dirs) { + struct ctl_table_header *header; +- header = __register_sysctl_table(set, path, files); ++ header = __register_sysctl_table(set, path, files ? files : table); + if (!header) { + kfree(ctl_table_arg); + goto out; diff --git a/fs/proc/root.c b/fs/proc/root.c -index eed44bf..abeb499 100644 +index 9c7fab1..ed1c8e0 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c -@@ -188,7 +188,15 @@ void __init proc_root_init(void) +@@ -180,7 +180,15 @@ void __init proc_root_init(void) #ifdef CONFIG_PROC_DEVICETREE proc_device_tree_init(); #endif @@ -48761,8 +55019,21 @@ index eed44bf..abeb499 100644 proc_sys_init(); } +diff --git a/fs/proc/self.c b/fs/proc/self.c +index aa5cc3b..c91a5d0 100644 +--- a/fs/proc/self.c ++++ b/fs/proc/self.c +@@ -37,7 +37,7 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) + static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd, + void *cookie) + { +- char *s = nd_get_link(nd); ++ const char *s = nd_get_link(nd); + if (!IS_ERR(s)) + kfree(s); + } diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index 7faaf2a..7793015 100644 +index 3e636d8..83e3b71 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -11,12 +11,19 @@ @@ -48798,7 +55069,7 @@ index 7faaf2a..7793015 100644 +#endif + + ,hiwater_vm << (PAGE_SHIFT-10), - (total_vm - mm->reserved_vm) << (PAGE_SHIFT-10), + total_vm << (PAGE_SHIFT-10), mm->locked_vm << (PAGE_SHIFT-10), mm->pinned_vm << (PAGE_SHIFT-10), @@ -62,7 +74,19 @@ void task_mem(struct seq_file *m, struct mm_struct *mm) @@ -48822,16 +55093,7 @@ index 7faaf2a..7793015 100644 } unsigned long task_vsize(struct mm_struct *mm) -@@ -125,7 +149,7 @@ static void *m_start(struct seq_file *m, loff_t *pos) - if (!priv->task) - return ERR_PTR(-ESRCH); - -- mm = mm_for_maps(priv->task); -+ mm = mm_access(priv->task, PTRACE_MODE_READ); - if (!mm || IS_ERR(mm)) - return mm; - down_read(&mm->mmap_sem); -@@ -231,13 +255,13 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) +@@ -277,13 +301,13 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; } @@ -48850,7 +55112,7 @@ index 7faaf2a..7793015 100644 seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n", start, -@@ -246,7 +270,11 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) +@@ -292,7 +316,11 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) flags & VM_WRITE ? 'w' : '-', flags & VM_EXEC ? 'x' : '-', flags & VM_MAYSHARE ? 's' : 'p', @@ -48862,7 +55124,7 @@ index 7faaf2a..7793015 100644 MAJOR(dev), MINOR(dev), ino, &len); /* -@@ -255,7 +283,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) +@@ -301,7 +329,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) */ if (file) { pad_len_spaces(m, len); @@ -48871,7 +55133,7 @@ index 7faaf2a..7793015 100644 goto done; } -@@ -281,8 +309,9 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) +@@ -327,8 +355,9 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) * Thread stack in /proc/PID/task/TID/maps or * the main process stack. */ @@ -48883,7 +55145,7 @@ index 7faaf2a..7793015 100644 name = "[stack]"; } else { /* Thread stack in /proc/PID/maps */ -@@ -306,6 +335,13 @@ static int show_map(struct seq_file *m, void *v, int is_pid) +@@ -352,6 +381,13 @@ static int show_map(struct seq_file *m, void *v, int is_pid) struct proc_maps_private *priv = m->private; struct task_struct *task = priv->task; @@ -48897,7 +55159,7 @@ index 7faaf2a..7793015 100644 show_map_vma(m, vma, is_pid); if (m->count < m->size) /* vma is copied successfully */ -@@ -482,12 +518,23 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) +@@ -589,12 +625,23 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) .private = &mss, }; @@ -48926,7 +55188,7 @@ index 7faaf2a..7793015 100644 show_map_vma(m, vma, is_pid); seq_printf(m, -@@ -505,7 +552,11 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) +@@ -612,7 +659,11 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) "KernelPageSize: %8lu kB\n" "MMUPageSize: %8lu kB\n" "Locked: %8lu kB\n", @@ -48938,16 +55200,7 @@ index 7faaf2a..7793015 100644 mss.resident >> 10, (unsigned long)(mss.pss >> (10 + PSS_SHIFT)), mss.shared_clean >> 10, -@@ -919,7 +970,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf, - if (!pm.buffer) - goto out_task; - -- mm = mm_for_maps(task); -+ mm = mm_access(task, PTRACE_MODE_READ); - ret = PTR_ERR(mm); - if (!mm || IS_ERR(mm)) - goto out_free; -@@ -1138,6 +1189,13 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) +@@ -1264,6 +1315,13 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) int n; char buffer[50]; @@ -48961,8 +55214,8 @@ index 7faaf2a..7793015 100644 if (!mm) return 0; -@@ -1155,11 +1213,15 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) - mpol_to_str(buffer, sizeof(buffer), pol, 0); +@@ -1281,11 +1339,15 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) + mpol_to_str(buffer, sizeof(buffer), pol); mpol_cond_put(pol); +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP @@ -48979,7 +55232,7 @@ index 7faaf2a..7793015 100644 seq_printf(m, " heap"); } else { diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c -index 74fe164..0848f95 100644 +index 56123a6..5a2f6ec 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -51,7 +51,7 @@ void task_mem(struct seq_file *m, struct mm_struct *mm) @@ -49000,21 +55253,34 @@ index 74fe164..0848f95 100644 } else if (mm) { pid_t tid = vm_is_stack(priv->task, vma, is_pid); -@@ -223,7 +223,7 @@ static void *m_start(struct seq_file *m, loff_t *pos) - if (!priv->task) - return ERR_PTR(-ESRCH); +diff --git a/fs/qnx6/qnx6.h b/fs/qnx6/qnx6.h +index b00fcc9..e0c6381 100644 +--- a/fs/qnx6/qnx6.h ++++ b/fs/qnx6/qnx6.h +@@ -74,7 +74,7 @@ enum { + BYTESEX_BE, + }; -- mm = mm_for_maps(priv->task); -+ mm = mm_access(priv->task, PTRACE_MODE_READ); - if (!mm || IS_ERR(mm)) { - put_task_struct(priv->task); - priv->task = NULL; +-static inline __u64 fs64_to_cpu(struct qnx6_sb_info *sbi, __fs64 n) ++static inline __u64 __intentional_overflow(-1) fs64_to_cpu(struct qnx6_sb_info *sbi, __fs64 n) + { + if (sbi->s_bytesex == BYTESEX_LE) + return le64_to_cpu((__force __le64)n); +@@ -90,7 +90,7 @@ static inline __fs64 cpu_to_fs64(struct qnx6_sb_info *sbi, __u64 n) + return (__force __fs64)cpu_to_be64(n); + } + +-static inline __u32 fs32_to_cpu(struct qnx6_sb_info *sbi, __fs32 n) ++static inline __u32 __intentional_overflow(-1) fs32_to_cpu(struct qnx6_sb_info *sbi, __fs32 n) + { + if (sbi->s_bytesex == BYTESEX_LE) + return le32_to_cpu((__force __le32)n); diff --git a/fs/quota/netlink.c b/fs/quota/netlink.c -index d67908b..d13f6a6 100644 +index 16e8abb..2dcf914 100644 --- a/fs/quota/netlink.c +++ b/fs/quota/netlink.c @@ -33,7 +33,7 @@ static struct genl_family quota_genl_family = { - void quota_send_warning(short type, unsigned int id, dev_t dev, + void quota_send_warning(struct kqid qid, dev_t dev, const char warntype) { - static atomic_t seq; @@ -49022,7 +55288,7 @@ index d67908b..d13f6a6 100644 struct sk_buff *skb; void *msg_head; int ret; -@@ -49,7 +49,7 @@ void quota_send_warning(short type, unsigned int id, dev_t dev, +@@ -49,7 +49,7 @@ void quota_send_warning(struct kqid qid, dev_t dev, "VFS: Not enough memory to send quota warning.\n"); return; } @@ -49032,7 +55298,7 @@ index d67908b..d13f6a6 100644 if (!msg_head) { printk(KERN_ERR diff --git a/fs/readdir.c b/fs/readdir.c -index cc0a822..43cb195 100644 +index fee38e0..12fdf47 100644 --- a/fs/readdir.c +++ b/fs/readdir.c @@ -17,6 +17,7 @@ @@ -49062,15 +55328,15 @@ index cc0a822..43cb195 100644 buf->result++; dirent = buf->dirent; if (!access_ok(VERIFY_WRITE, dirent, -@@ -116,6 +122,7 @@ SYSCALL_DEFINE3(old_readdir, unsigned int, fd, +@@ -114,6 +120,7 @@ SYSCALL_DEFINE3(old_readdir, unsigned int, fd, buf.result = 0; buf.dirent = dirent; -+ buf.file = file; ++ buf.file = f.file; - error = vfs_readdir(file, fillonedir, &buf); + error = vfs_readdir(f.file, fillonedir, &buf); if (buf.result) -@@ -142,6 +149,7 @@ struct linux_dirent { +@@ -139,6 +146,7 @@ struct linux_dirent { struct getdents_callback { struct linux_dirent __user * current_dir; struct linux_dirent __user * previous; @@ -49078,7 +55344,7 @@ index cc0a822..43cb195 100644 int count; int error; }; -@@ -163,6 +171,10 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, +@@ -160,6 +168,10 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, buf->error = -EOVERFLOW; return -EOVERFLOW; } @@ -49089,15 +55355,15 @@ index cc0a822..43cb195 100644 dirent = buf->previous; if (dirent) { if (__put_user(offset, &dirent->d_off)) -@@ -210,6 +222,7 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd, +@@ -205,6 +217,7 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd, buf.previous = NULL; buf.count = count; buf.error = 0; -+ buf.file = file; ++ buf.file = f.file; - error = vfs_readdir(file, filldir, &buf); + error = vfs_readdir(f.file, filldir, &buf); if (error >= 0) -@@ -229,6 +242,7 @@ out: +@@ -223,6 +236,7 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd, struct getdents_callback64 { struct linux_dirent64 __user * current_dir; struct linux_dirent64 __user * previous; @@ -49105,7 +55371,7 @@ index cc0a822..43cb195 100644 int count; int error; }; -@@ -244,6 +258,10 @@ static int filldir64(void * __buf, const char * name, int namlen, loff_t offset, +@@ -238,6 +252,10 @@ static int filldir64(void * __buf, const char * name, int namlen, loff_t offset, buf->error = -EINVAL; /* only used if we fail.. */ if (reclen > buf->count) return -EINVAL; @@ -49116,20 +55382,20 @@ index cc0a822..43cb195 100644 dirent = buf->previous; if (dirent) { if (__put_user(offset, &dirent->d_off)) -@@ -291,6 +309,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd, +@@ -283,6 +301,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd, buf.current_dir = dirent; buf.previous = NULL; -+ buf.file = file; ++ buf.file = f.file; buf.count = count; buf.error = 0; -@@ -299,7 +318,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd, +@@ -291,7 +310,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int, fd, error = buf.error; lastdirent = buf.previous; if (lastdirent) { -- typeof(lastdirent->d_off) d_off = file->f_pos; -+ typeof(((struct linux_dirent64 *)0)->d_off) d_off = file->f_pos; +- typeof(lastdirent->d_off) d_off = f.file->f_pos; ++ typeof(((struct linux_dirent64 *)0)->d_off) d_off = f.file->f_pos; if (__put_user(d_off, &lastdirent->d_off)) error = -EFAULT; else @@ -49147,7 +55413,7 @@ index 2b7882b..1c5ef48 100644 /* balance leaf returns 0 except if combining L R and S into diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c -index 2c1ade6..8c59d8d 100644 +index 9cc0740a..46bf953 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c @@ -112,7 +112,7 @@ static int show_super(struct seq_file *m, struct super_block *sb) @@ -49160,7 +55426,7 @@ index 2c1ade6..8c59d8d 100644 SF(s_do_balance), SF(s_unneeded_left_neighbor), SF(s_good_search_by_key_reada), SF(s_bmaps), diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h -index a59d271..e12d1cf 100644 +index 157e474..65a6114 100644 --- a/fs/reiserfs/reiserfs.h +++ b/fs/reiserfs/reiserfs.h @@ -453,7 +453,7 @@ struct reiserfs_sb_info { @@ -49172,7 +55438,7 @@ index a59d271..e12d1cf 100644 // tree gets re-balanced unsigned long s_properties; /* File system properties. Currently holds on-disk FS format */ -@@ -1973,7 +1973,7 @@ static inline loff_t max_reiserfs_offset(struct inode *inode) +@@ -1978,7 +1978,7 @@ static inline loff_t max_reiserfs_offset(struct inode *inode) #define REISERFS_USER_MEM 1 /* reiserfs user memory mode */ #define fs_generation(s) (REISERFS_SB(s)->s_generation_counter) @@ -49182,7 +55448,7 @@ index a59d271..e12d1cf 100644 #define __fs_changed(gen,s) (gen != get_generation (s)) #define fs_changed(gen,s) \ diff --git a/fs/select.c b/fs/select.c -index 0baa0a3..7795e27 100644 +index 8c1c96c..a0f9b6d 100644 --- a/fs/select.c +++ b/fs/select.c @@ -20,6 +20,7 @@ @@ -49193,7 +55459,7 @@ index 0baa0a3..7795e27 100644 #include <linux/personality.h> /* for STICKY_TIMEOUTS */ #include <linux/file.h> #include <linux/fdtable.h> -@@ -833,6 +834,7 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, +@@ -827,6 +828,7 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, struct poll_list *walk = head; unsigned long todo = nfds; @@ -49202,28 +55468,28 @@ index 0baa0a3..7795e27 100644 return -EINVAL; diff --git a/fs/seq_file.c b/fs/seq_file.c -index 0cbd049..64e705c 100644 +index 38bb59f..a304f9d 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c -@@ -9,6 +9,7 @@ - #include <linux/export.h> +@@ -10,6 +10,7 @@ #include <linux/seq_file.h> #include <linux/slab.h> + #include <linux/cred.h> +#include <linux/sched.h> #include <asm/uaccess.h> #include <asm/page.h> -@@ -56,6 +57,9 @@ int seq_open(struct file *file, const struct seq_operations *op) - memset(p, 0, sizeof(*p)); - mutex_init(&p->lock); - p->op = op; +@@ -60,6 +61,9 @@ int seq_open(struct file *file, const struct seq_operations *op) + #ifdef CONFIG_USER_NS + p->user_ns = file->f_cred->user_ns; + #endif +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP + p->exec_id = current->exec_id; +#endif /* * Wrappers around seq_open(e.g. swaps_open) need to be -@@ -92,7 +96,7 @@ static int traverse(struct seq_file *m, loff_t offset) +@@ -96,7 +100,7 @@ static int traverse(struct seq_file *m, loff_t offset) return 0; } if (!m->buf) { @@ -49232,7 +55498,7 @@ index 0cbd049..64e705c 100644 if (!m->buf) return -ENOMEM; } -@@ -132,7 +136,7 @@ static int traverse(struct seq_file *m, loff_t offset) +@@ -136,7 +140,7 @@ static int traverse(struct seq_file *m, loff_t offset) Eoverflow: m->op->stop(m, p); kfree(m->buf); @@ -49241,7 +55507,7 @@ index 0cbd049..64e705c 100644 return !m->buf ? -ENOMEM : -EAGAIN; } -@@ -187,7 +191,7 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos) +@@ -191,7 +195,7 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos) /* grab buffer if we didn't have one */ if (!m->buf) { @@ -49250,7 +55516,7 @@ index 0cbd049..64e705c 100644 if (!m->buf) goto Enomem; } -@@ -228,7 +232,7 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos) +@@ -232,7 +236,7 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos) goto Fill; m->op->stop(m, p); kfree(m->buf); @@ -49259,20 +55525,20 @@ index 0cbd049..64e705c 100644 if (!m->buf) goto Enomem; m->count = 0; -@@ -567,7 +571,7 @@ static void single_stop(struct seq_file *p, void *v) +@@ -581,7 +585,7 @@ static void single_stop(struct seq_file *p, void *v) int single_open(struct file *file, int (*show)(struct seq_file *, void *), void *data) { - struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL); -+ seq_operations_no_const *op = kmalloc(sizeof(*op), GFP_KERNEL); ++ seq_operations_no_const *op = kzalloc(sizeof(*op), GFP_KERNEL); int res = -ENOMEM; if (op) { diff --git a/fs/splice.c b/fs/splice.c -index 5cac690..f833a99 100644 +index 29e394e..b13c247 100644 --- a/fs/splice.c +++ b/fs/splice.c -@@ -194,7 +194,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, +@@ -195,7 +195,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, pipe_lock(pipe); for (;;) { @@ -49281,7 +55547,7 @@ index 5cac690..f833a99 100644 send_sig(SIGPIPE, current, 0); if (!ret) ret = -EPIPE; -@@ -248,9 +248,9 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, +@@ -249,9 +249,9 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, do_wakeup = 0; } @@ -49293,7 +55559,7 @@ index 5cac690..f833a99 100644 } pipe_unlock(pipe); -@@ -563,7 +563,7 @@ static ssize_t kernel_readv(struct file *file, const struct iovec *vec, +@@ -564,7 +564,7 @@ static ssize_t kernel_readv(struct file *file, const struct iovec *vec, old_fs = get_fs(); set_fs(get_ds()); /* The cast to a user pointer is valid due to the set_fs() */ @@ -49302,16 +55568,16 @@ index 5cac690..f833a99 100644 set_fs(old_fs); return res; -@@ -578,7 +578,7 @@ static ssize_t kernel_write(struct file *file, const char *buf, size_t count, +@@ -579,7 +579,7 @@ ssize_t kernel_write(struct file *file, const char *buf, size_t count, old_fs = get_fs(); set_fs(get_ds()); /* The cast to a user pointer is valid due to the set_fs() */ -- res = vfs_write(file, (const char __user *)buf, count, &pos); +- res = vfs_write(file, (__force const char __user *)buf, count, &pos); + res = vfs_write(file, (const char __force_user *)buf, count, &pos); set_fs(old_fs); return res; -@@ -630,7 +630,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos, +@@ -632,7 +632,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos, goto err; this_len = min_t(size_t, len, PAGE_CACHE_SIZE - offset); @@ -49320,7 +55586,7 @@ index 5cac690..f833a99 100644 vec[i].iov_len = this_len; spd.pages[i] = page; spd.nr_pages++; -@@ -849,10 +849,10 @@ EXPORT_SYMBOL(splice_from_pipe_feed); +@@ -853,10 +853,10 @@ EXPORT_SYMBOL(splice_from_pipe_feed); int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd) { while (!pipe->nrbufs) { @@ -49333,7 +55599,7 @@ index 5cac690..f833a99 100644 return 0; if (sd->flags & SPLICE_F_NONBLOCK) -@@ -1185,7 +1185,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, +@@ -1192,7 +1192,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, * out of the pipe right after the splice_to_pipe(). So set * PIPE_READERS appropriately. */ @@ -49342,7 +55608,7 @@ index 5cac690..f833a99 100644 current->splice_pipe = pipe; } -@@ -1738,9 +1738,9 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags) +@@ -1741,9 +1741,9 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags) ret = -ERESTARTSYS; break; } @@ -49354,7 +55620,7 @@ index 5cac690..f833a99 100644 if (flags & SPLICE_F_NONBLOCK) { ret = -EAGAIN; break; -@@ -1772,7 +1772,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags) +@@ -1775,7 +1775,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags) pipe_lock(pipe); while (pipe->nrbufs >= pipe->buffers) { @@ -49363,7 +55629,7 @@ index 5cac690..f833a99 100644 send_sig(SIGPIPE, current, 0); ret = -EPIPE; break; -@@ -1785,9 +1785,9 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags) +@@ -1788,9 +1788,9 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags) ret = -ERESTARTSYS; break; } @@ -49375,7 +55641,7 @@ index 5cac690..f833a99 100644 } pipe_unlock(pipe); -@@ -1823,14 +1823,14 @@ retry: +@@ -1826,14 +1826,14 @@ retry: pipe_double_lock(ipipe, opipe); do { @@ -49392,7 +55658,7 @@ index 5cac690..f833a99 100644 break; /* -@@ -1927,7 +1927,7 @@ static int link_pipe(struct pipe_inode_info *ipipe, +@@ -1930,7 +1930,7 @@ static int link_pipe(struct pipe_inode_info *ipipe, pipe_double_lock(ipipe, opipe); do { @@ -49401,7 +55667,7 @@ index 5cac690..f833a99 100644 send_sig(SIGPIPE, current, 0); if (!ret) ret = -EPIPE; -@@ -1972,7 +1972,7 @@ static int link_pipe(struct pipe_inode_info *ipipe, +@@ -1975,7 +1975,7 @@ static int link_pipe(struct pipe_inode_info *ipipe, * return EAGAIN if we have the potential of some data in the * future, otherwise just return 0 */ @@ -49410,11 +55676,78 @@ index 5cac690..f833a99 100644 ret = -EAGAIN; pipe_unlock(ipipe); +diff --git a/fs/stat.c b/fs/stat.c +index 04ce1ac..a13dd1e 100644 +--- a/fs/stat.c ++++ b/fs/stat.c +@@ -28,8 +28,13 @@ void generic_fillattr(struct inode *inode, struct kstat *stat) + stat->gid = inode->i_gid; + stat->rdev = inode->i_rdev; + stat->size = i_size_read(inode); +- stat->atime = inode->i_atime; +- stat->mtime = inode->i_mtime; ++ if (is_sidechannel_device(inode) && !capable_nolog(CAP_MKNOD)) { ++ stat->atime = inode->i_ctime; ++ stat->mtime = inode->i_ctime; ++ } else { ++ stat->atime = inode->i_atime; ++ stat->mtime = inode->i_mtime; ++ } + stat->ctime = inode->i_ctime; + stat->blksize = (1 << inode->i_blkbits); + stat->blocks = inode->i_blocks; +@@ -46,8 +51,14 @@ int vfs_getattr(struct path *path, struct kstat *stat) + if (retval) + return retval; + +- if (inode->i_op->getattr) +- return inode->i_op->getattr(path->mnt, path->dentry, stat); ++ if (inode->i_op->getattr) { ++ retval = inode->i_op->getattr(path->mnt, path->dentry, stat); ++ if (!retval && is_sidechannel_device(inode) && !capable_nolog(CAP_MKNOD)) { ++ stat->atime = stat->ctime; ++ stat->mtime = stat->ctime; ++ } ++ return retval; ++ } + + generic_fillattr(inode, stat); + return 0; +diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c +index 15c68f9..36a8b3e 100644 +--- a/fs/sysfs/bin.c ++++ b/fs/sysfs/bin.c +@@ -235,13 +235,13 @@ static int bin_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) + return ret; + } + +-static int bin_access(struct vm_area_struct *vma, unsigned long addr, +- void *buf, int len, int write) ++static ssize_t bin_access(struct vm_area_struct *vma, unsigned long addr, ++ void *buf, size_t len, int write) + { + struct file *file = vma->vm_file; + struct bin_buffer *bb = file->private_data; + struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; +- int ret; ++ ssize_t ret; + + if (!bb->vm_ops) + return -EINVAL; diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c -index 35a36d3..23424b2 100644 +index 6f31590..3c87c8a 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c -@@ -657,6 +657,18 @@ static int create_dir(struct kobject *kobj, struct sysfs_dirent *parent_sd, +@@ -40,7 +40,7 @@ static DEFINE_IDA(sysfs_ino_ida); + * + * Returns 31 bit hash of ns + name (so it fits in an off_t ) + */ +-static unsigned int sysfs_name_hash(const void *ns, const char *name) ++static unsigned int sysfs_name_hash(const void *ns, const unsigned char *name) + { + unsigned long hash = init_name_hash(); + unsigned int len = strlen(name); +@@ -685,6 +685,18 @@ static int create_dir(struct kobject *kobj, struct sysfs_dirent *parent_sd, struct sysfs_dirent *sd; int rc; @@ -49434,7 +55767,7 @@ index 35a36d3..23424b2 100644 sd = sysfs_new_dirent(name, mode, SYSFS_DIR); if (!sd) diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c -index 00012e3..8392349 100644 +index 602f56d..6853db8 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -37,7 +37,7 @@ static DEFINE_SPINLOCK(sysfs_open_dirent_lock); @@ -49483,10 +55816,10 @@ index 00012e3..8392349 100644 } diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c -index a7ac78f..02158e1 100644 +index 8c940df..25b733e 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c -@@ -286,7 +286,7 @@ static void *sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) +@@ -305,7 +305,7 @@ static void *sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) { @@ -49495,6 +55828,32 @@ index a7ac78f..02158e1 100644 if (!IS_ERR(page)) free_page((unsigned long)page); } +diff --git a/fs/sysv/sysv.h b/fs/sysv/sysv.h +index 69d4889..a810bd4 100644 +--- a/fs/sysv/sysv.h ++++ b/fs/sysv/sysv.h +@@ -188,7 +188,7 @@ static inline u32 PDP_swab(u32 x) + #endif + } + +-static inline __u32 fs32_to_cpu(struct sysv_sb_info *sbi, __fs32 n) ++static inline __u32 __intentional_overflow(-1) fs32_to_cpu(struct sysv_sb_info *sbi, __fs32 n) + { + if (sbi->s_bytesex == BYTESEX_PDP) + return PDP_swab((__force __u32)n); +diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c +index e18b988..f1d4ad0f 100644 +--- a/fs/ubifs/io.c ++++ b/fs/ubifs/io.c +@@ -155,7 +155,7 @@ int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len) + return err; + } + +-int ubifs_leb_unmap(struct ubifs_info *c, int lnum) ++int __intentional_overflow(-1) ubifs_leb_unmap(struct ubifs_info *c, int lnum) + { + int err; + diff --git a/fs/udf/misc.c b/fs/udf/misc.c index c175b4d..8f36a16 100644 --- a/fs/udf/misc.c @@ -49508,8 +55867,30 @@ index c175b4d..8f36a16 100644 u8 checksum = 0; int i; for (i = 0; i < sizeof(struct tag); ++i) +diff --git a/fs/ufs/swab.h b/fs/ufs/swab.h +index 8d974c4..b82f6ec 100644 +--- a/fs/ufs/swab.h ++++ b/fs/ufs/swab.h +@@ -22,7 +22,7 @@ enum { + BYTESEX_BE + }; + +-static inline u64 ++static inline u64 __intentional_overflow(-1) + fs64_to_cpu(struct super_block *sbp, __fs64 n) + { + if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) +@@ -40,7 +40,7 @@ cpu_to_fs64(struct super_block *sbp, u64 n) + return (__force __fs64)cpu_to_be64(n); + } + +-static inline u32 ++static inline u32 __intentional_overflow(-1) + fs32_to_cpu(struct super_block *sbp, __fs32 n) + { + if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) diff --git a/fs/utimes.c b/fs/utimes.c -index ba653f3..06ea4b1 100644 +index f4fb7ec..3fe03c0 100644 --- a/fs/utimes.c +++ b/fs/utimes.c @@ -1,6 +1,7 @@ @@ -49534,10 +55915,38 @@ index ba653f3..06ea4b1 100644 error = notify_change(path->dentry, &newattrs); mutex_unlock(&inode->i_mutex); diff --git a/fs/xattr.c b/fs/xattr.c -index 3c8c1cc..a83c398 100644 +index 3377dff..4d074d9 100644 --- a/fs/xattr.c +++ b/fs/xattr.c -@@ -316,7 +316,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr); +@@ -227,6 +227,27 @@ int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, + return rc; + } + ++#ifdef CONFIG_PAX_XATTR_PAX_FLAGS ++ssize_t ++pax_getxattr(struct dentry *dentry, void *value, size_t size) ++{ ++ struct inode *inode = dentry->d_inode; ++ ssize_t error; ++ ++ error = inode_permission(inode, MAY_EXEC); ++ if (error) ++ return error; ++ ++ if (inode->i_op->getxattr) ++ error = inode->i_op->getxattr(dentry, XATTR_NAME_PAX_FLAGS, value, size); ++ else ++ error = -EOPNOTSUPP; ++ ++ return error; ++} ++EXPORT_SYMBOL(pax_getxattr); ++#endif ++ + ssize_t + vfs_getxattr(struct dentry *dentry, const char *name, void *value, size_t size) + { +@@ -319,7 +340,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr); * Extended attribute SET operations */ static long @@ -49546,8 +55955,8 @@ index 3c8c1cc..a83c398 100644 size_t size, int flags) { int error; -@@ -349,7 +349,12 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value, - } +@@ -355,7 +376,12 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value, + posix_acl_fix_xattr_from_user(kvalue, size); } - error = vfs_setxattr(d, kname, kvalue, size, flags); @@ -49560,7 +55969,7 @@ index 3c8c1cc..a83c398 100644 out: if (vvalue) vfree(vvalue); -@@ -370,7 +375,7 @@ SYSCALL_DEFINE5(setxattr, const char __user *, pathname, +@@ -377,7 +403,7 @@ retry: return error; error = mnt_want_write(path.mnt); if (!error) { @@ -49569,7 +55978,7 @@ index 3c8c1cc..a83c398 100644 mnt_drop_write(path.mnt); } path_put(&path); -@@ -389,7 +394,7 @@ SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname, +@@ -401,7 +427,7 @@ retry: return error; error = mnt_want_write(path.mnt); if (!error) { @@ -49578,33 +55987,32 @@ index 3c8c1cc..a83c398 100644 mnt_drop_write(path.mnt); } path_put(&path); -@@ -400,17 +405,15 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, +@@ -416,16 +442,14 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, const void __user *,value, size_t, size, int, flags) { - struct file *f; + struct fd f = fdget(fd); - struct dentry *dentry; int error = -EBADF; - f = fget(fd); - if (!f) + if (!f.file) return error; -- dentry = f->f_path.dentry; -- audit_inode(NULL, dentry); -+ audit_inode(NULL, f->f_path.dentry); - error = mnt_want_write_file(f); +- dentry = f.file->f_path.dentry; +- audit_inode(NULL, dentry, 0); ++ audit_inode(NULL, f.file->f_path.dentry, 0); + error = mnt_want_write_file(f.file); if (!error) { - error = setxattr(dentry, name, value, size, flags); -+ error = setxattr(&f->f_path, name, value, size, flags); - mnt_drop_write_file(f); ++ error = setxattr(&f.file->f_path, name, value, size, flags); + mnt_drop_write_file(f.file); } - fput(f); + fdput(f); diff --git a/fs/xattr_acl.c b/fs/xattr_acl.c -index 69d06b0..c0996e5 100644 +index 9fbea87..6b19972 100644 --- a/fs/xattr_acl.c +++ b/fs/xattr_acl.c -@@ -17,8 +17,8 @@ - struct posix_acl * - posix_acl_from_xattr(const void *value, size_t size) +@@ -76,8 +76,8 @@ struct posix_acl * + posix_acl_from_xattr(struct user_namespace *user_ns, + const void *value, size_t size) { - posix_acl_xattr_header *header = (posix_acl_xattr_header *)value; - posix_acl_xattr_entry *entry = (posix_acl_xattr_entry *)(header+1), *end; @@ -49614,10 +56022,10 @@ index 69d06b0..c0996e5 100644 struct posix_acl *acl; struct posix_acl_entry *acl_e; diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c -index 85e7e32..5344e52 100644 +index b44af92..06073da 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c -@@ -190,7 +190,7 @@ xfs_bmap_validate_ret( +@@ -192,7 +192,7 @@ xfs_bmap_validate_ret( int nmap, int ret_nmap); #else @@ -49627,10 +56035,10 @@ index 85e7e32..5344e52 100644 STATIC int diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c -index 79d05e8..e3e5861 100644 +index 1b9fc3e..e1bdde0 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c -@@ -852,7 +852,15 @@ xfs_dir2_sf_getdents( +@@ -851,7 +851,15 @@ xfs_dir2_sf_getdents( } ino = xfs_dir2_sfe_get_ino(sfp, sfep); @@ -49648,10 +56056,10 @@ index 79d05e8..e3e5861 100644 *offset = off & 0x7fffffff; return 0; diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c -index 91f8ff5..0ce68f9 100644 +index d681e34..2a3f5ab 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c -@@ -128,7 +128,7 @@ xfs_find_handle( +@@ -127,7 +127,7 @@ xfs_find_handle( } error = -EFAULT; @@ -49661,10 +56069,10 @@ index 91f8ff5..0ce68f9 100644 goto out_put; diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c -index 3011b87..1ab03e9 100644 +index d82efaa..0904a8e 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c -@@ -397,7 +397,7 @@ xfs_vn_put_link( +@@ -395,7 +395,7 @@ xfs_vn_put_link( struct nameidata *nd, void *p) { @@ -49675,10 +56083,10 @@ index 3011b87..1ab03e9 100644 kfree(s); diff --git a/grsecurity/Kconfig b/grsecurity/Kconfig new file mode 100644 -index 0000000..4d533f1 +index 0000000..7174794 --- /dev/null +++ b/grsecurity/Kconfig -@@ -0,0 +1,941 @@ +@@ -0,0 +1,1031 @@ +# +# grecurity configuration +# @@ -49692,18 +56100,24 @@ index 0000000..4d533f1 + help + If you say Y here, /dev/kmem and /dev/mem won't be allowed to + be written to or read from to modify or leak the contents of the running -+ kernel. /dev/port will also not be allowed to be opened. If you have module -+ support disabled, enabling this will close up four ways that are ++ kernel. /dev/port will also not be allowed to be opened and support ++ for /dev/cpu/*/msr will be removed. If you have module ++ support disabled, enabling this will close up five ways that are + currently used to insert malicious code into the running kernel. ++ + Even with all these features enabled, we still highly recommend that + you use the RBAC system, as it is still possible for an attacker to + modify the running kernel through privileged I/O granted by ioperm/iopl. ++ + If you are not using XFree86, you may be able to stop this additional + case by enabling the 'Disable privileged I/O' option. Though nothing + legitimately writes to /dev/kmem, XFree86 does need to write to /dev/mem, + but only to video memory, which is the only writing we allow in this + case. If /dev/kmem or /dev/mem are mmaped without PROT_WRITE, they will + not be allowed to mprotect it with PROT_WRITE later. ++ Enabling this feature will prevent the "cpupower" and "powertop" tools ++ from working. ++ + It is highly recommended that you say Y here if you meet all the + conditions above. + @@ -49741,6 +56155,43 @@ index 0000000..4d533f1 + IF YOU USE XFree86. If you use XFree86 and you still want to + protect your kernel against modification, use the RBAC system. + ++config GRKERNSEC_JIT_HARDEN ++ bool "Harden BPF JIT against spray attacks" ++ default y if GRKERNSEC_CONFIG_AUTO ++ depends on BPF_JIT ++ help ++ If you say Y here, the native code generated by the kernel's Berkeley ++ Packet Filter (BPF) JIT engine will be hardened against JIT-spraying ++ attacks that attempt to fit attacker-beneficial instructions in ++ 32bit immediate fields of JIT-generated native instructions. The ++ attacker will generally aim to cause an unintended instruction sequence ++ of JIT-generated native code to execute by jumping into the middle of ++ a generated instruction. This feature effectively randomizes the 32bit ++ immediate constants present in the generated code to thwart such attacks. ++ ++ If you're using KERNEXEC, it's recommended that you enable this option ++ to supplement the hardening of the kernel. ++ ++config GRKERNSEC_RAND_THREADSTACK ++ bool "Insert random gaps between thread stacks" ++ default y if GRKERNSEC_CONFIG_AUTO ++ depends on PAX_RANDMMAP && !PPC && BROKEN ++ help ++ If you say Y here, a random-sized gap will be enforced between allocated ++ thread stacks. Glibc's NPTL and other threading libraries that ++ pass MAP_STACK to the kernel for thread stack allocation are supported. ++ The implementation currently provides 8 bits of entropy for the gap. ++ ++ Many distributions do not compile threaded remote services with the ++ -fstack-check argument to GCC, causing the variable-sized stack-based ++ allocator, alloca(), to not probe the stack on allocation. This ++ permits an unbounded alloca() to skip over any guard page and potentially ++ modify another thread's stack reliably. An enforced random gap ++ reduces the reliability of such an attack and increases the chance ++ that such a read/write to another thread's stack instead lands in ++ an unmapped area, causing a crash and triggering grsecurity's ++ anti-bruteforcing logic. ++ +config GRKERNSEC_PROC_MEMMAP + bool "Harden ASLR against information leaks and entropy reduction" + default y if (GRKERNSEC_CONFIG_AUTO || PAX_NOEXEC || PAX_ASLR) @@ -49923,10 +56374,11 @@ index 0000000..4d533f1 + depends on GRKERNSEC_PROC && !GRKERNSEC_PROC_USER + help + If you say Y here, you will be able to select a group that will be -+ able to view all processes and network-related information. If you've -+ enabled GRKERNSEC_HIDESYM, kernel and symbol information may still -+ remain hidden. This option is useful if you want to run identd as -+ a non-root user. ++ able to view all processes and network-related information. If you've ++ enabled GRKERNSEC_HIDESYM, kernel and symbol information may still ++ remain hidden. This option is useful if you want to run identd as ++ a non-root user. The group you select may also be chosen at boot time ++ via "grsec_proc_gid=" on the kernel commandline. + +config GRKERNSEC_PROC_GID + int "GID for special group" @@ -50022,6 +56474,19 @@ index 0000000..4d533f1 + behavior if this option is enabled in an init script on a read-only + filesystem. This feature is mainly intended for secure embedded systems. + ++config GRKERNSEC_DEVICE_SIDECHANNEL ++ bool "Eliminate stat/notify-based device sidechannels" ++ default y if GRKERNSEC_CONFIG_AUTO ++ help ++ If you say Y here, timing analyses on block or character ++ devices like /dev/ptmx using stat or inotify/dnotify/fanotify ++ will be thwarted for unprivileged users. If a process without ++ CAP_MKNOD stats such a device, the last access and last modify times ++ will match the device's create time. No access or modify events ++ will be triggered through inotify/dnotify/fanotify for such devices. ++ This feature will prevent attacks that may at a minimum ++ allow an attacker to determine the administrator's password length. ++ +config GRKERNSEC_CHROOT + bool "Chroot jail restrictions" + default y if GRKERNSEC_CONFIG_AUTO @@ -50186,6 +56651,16 @@ index 0000000..4d533f1 + tasks. If the sysctl option is enabled, a sysctl option with + name "chroot_caps" is created. + ++config GRKERNSEC_CHROOT_INITRD ++ bool "Exempt initrd tasks from restrictions" ++ default y if GRKERNSEC_CONFIG_AUTO ++ depends on GRKERNSEC_CHROOT && BLK_DEV_RAM ++ help ++ If you say Y here, tasks started prior to init will be exempted from ++ grsecurity's chroot restrictions. This option is mainly meant to ++ resolve Plymouth's performing privileged operations unnecessarily ++ in a chroot. ++ +endmenu +menu "Kernel Auditing" +depends on GRKERNSEC @@ -50193,11 +56668,11 @@ index 0000000..4d533f1 +config GRKERNSEC_AUDIT_GROUP + bool "Single group for auditing" + help -+ If you say Y here, the exec, chdir, and (un)mount logging features -+ will only operate on a group you specify. This option is recommended -+ if you only want to watch certain users instead of having a large -+ amount of logs from the entire system. If the sysctl option is enabled, -+ a sysctl option with name "audit_group" is created. ++ If you say Y here, the exec and chdir logging features will only operate ++ on a group you specify. This option is recommended if you only want to ++ watch certain users instead of having a large amount of logs from the ++ entire system. If the sysctl option is enabled, a sysctl option with ++ name "audit_group" is created. + +config GRKERNSEC_AUDIT_GID + int "GID for auditing" @@ -50326,7 +56801,7 @@ index 0000000..4d533f1 + default y if GRKERNSEC_CONFIG_AUTO + help + If you say Y here, non-root users will not be able to use dmesg(8) -+ to view up to the last 4kb of messages in the kernel's log buffer. ++ to view the contents of the kernel's circular log buffer. + The kernel's log buffer often contains kernel addresses and other + identifying information useful to an attacker in fingerprinting a + system for a targeted exploit. @@ -50415,7 +56890,12 @@ index 0000000..4d533f1 + entry will default to on for backward-compatibility. + +config GRKERNSEC_TPE_GID -+ int "GID for untrusted users" ++ int ++ default GRKERNSEC_TPE_UNTRUSTED_GID if (GRKERNSEC_TPE && !GRKERNSEC_TPE_INVERT) ++ default GRKERNSEC_TPE_TRUSTED_GID if (GRKERNSEC_TPE && GRKERNSEC_TPE_INVERT) ++ ++config GRKERNSEC_TPE_UNTRUSTED_GID ++ int "GID for TPE-untrusted users" + depends on GRKERNSEC_TPE && !GRKERNSEC_TPE_INVERT + default 1005 + help @@ -50423,8 +56903,8 @@ index 0000000..4d533f1 + *enabled* for. If the sysctl option is enabled, a sysctl option + with name "tpe_gid" is created. + -+config GRKERNSEC_TPE_GID -+ int "GID for trusted users" ++config GRKERNSEC_TPE_TRUSTED_GID ++ int "GID for TPE-trusted users" + depends on GRKERNSEC_TPE && GRKERNSEC_TPE_INVERT + default 1005 + help @@ -50480,6 +56960,24 @@ index 0000000..4d533f1 + prevents a socket from lasting more than 45 seconds in LAST_ACK + state. + ++config GRKERNSEC_NO_SIMULT_CONNECT ++ bool "Disable TCP Simultaneous Connect" ++ default y if GRKERNSEC_CONFIG_AUTO ++ depends on NET ++ help ++ If you say Y here, a feature by Willy Tarreau will be enabled that ++ removes a weakness in Linux's strict implementation of TCP that ++ allows two clients to connect to each other without either entering ++ a listening state. The weakness allows an attacker to easily prevent ++ a client from connecting to a known server provided the source port ++ for the connection is guessed correctly. ++ ++ As the weakness could be used to prevent an antivirus or IPS from ++ fetching updates, or prevent an SSL gateway from fetching a CRL, ++ it should be eliminated by enabling this option. Though Linux is ++ one of few operating systems supporting simultaneous connect, it ++ has no legitimate use in practice and is rarely supported by firewalls. ++ +config GRKERNSEC_SOCKET + bool "Socket restrictions" + depends on NET @@ -50666,10 +57164,10 @@ index 0000000..1b9afa9 +endif diff --git a/grsecurity/gracl.c b/grsecurity/gracl.c new file mode 100644 -index 0000000..7a5922f +index 0000000..1248ee0 --- /dev/null +++ b/grsecurity/gracl.c -@@ -0,0 +1,4016 @@ +@@ -0,0 +1,4073 @@ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/sched.h> @@ -50695,12 +57193,24 @@ index 0000000..7a5922f +#include <linux/stop_machine.h> +#include <linux/fdtable.h> +#include <linux/percpu.h> ++#include <linux/lglock.h> ++#include <linux/hugetlb.h> ++#include <linux/posix-timers.h> ++#if defined(CONFIG_BTRFS_FS) || defined(CONFIG_BTRFS_FS_MODULE) ++#include <linux/magic.h> ++#include <linux/pagemap.h> ++#include "../fs/btrfs/async-thread.h" ++#include "../fs/btrfs/ctree.h" ++#include "../fs/btrfs/btrfs_inode.h" ++#endif +#include "../fs/mount.h" + +#include <asm/uaccess.h> +#include <asm/errno.h> +#include <asm/mman.h> + ++extern struct lglock vfsmount_lock; ++ +static struct acl_role_db acl_role_set; +static struct name_db name_set; +static struct inodev_db inodev_set; @@ -50730,11 +57240,6 @@ index 0000000..7a5922f +extern int chkpw(struct gr_arg *entry, unsigned char *salt, unsigned char *sum); +extern void gr_clear_learn_entries(void); + -+#ifdef CONFIG_GRKERNSEC_RESLOG -+extern void gr_log_resource(const struct task_struct *task, -+ const int res, const unsigned long wanted, const int gt); -+#endif -+ +unsigned char *gr_system_salt; +unsigned char *gr_system_sum; + @@ -50752,8 +57257,9 @@ index 0000000..7a5922f + +extern struct vfsmount *pipe_mnt; +extern struct vfsmount *shm_mnt; ++ +#ifdef CONFIG_HUGETLBFS -+extern struct vfsmount *hugetlbfs_vfsmount; ++extern struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; +#endif + +static struct acl_object_label *fakefs_obj_rw; @@ -50764,27 +57270,20 @@ index 0000000..7a5922f +extern void gr_remove_uid(uid_t uid); +extern int gr_find_uid(uid_t uid); + -+DECLARE_BRLOCK(vfsmount_lock); -+ +__inline__ int +gr_acl_is_enabled(void) +{ + return (gr_status & GR_READY); +} + -+#ifdef CONFIG_BTRFS_FS -+extern dev_t get_btrfs_dev_from_inode(struct inode *inode); -+extern int btrfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); -+#endif -+ +static inline dev_t __get_dev(const struct dentry *dentry) +{ -+#ifdef CONFIG_BTRFS_FS -+ if (dentry->d_inode->i_op && dentry->d_inode->i_op->getattr == &btrfs_getattr) -+ return get_btrfs_dev_from_inode(dentry->d_inode); ++#if defined(CONFIG_BTRFS_FS) || defined(CONFIG_BTRFS_FS_MODULE) ++ if (dentry->d_sb->s_magic == BTRFS_SUPER_MAGIC) ++ return BTRFS_I(dentry->d_inode)->root->anon_dev; + else +#endif -+ return dentry->d_inode->i_sb->s_dev; ++ return dentry->d_sb->s_dev; +} + +dev_t gr_get_dev_from_dentry(struct dentry *dentry) @@ -50967,11 +57466,11 @@ index 0000000..7a5922f + /* we can't use real_root.dentry, real_root.mnt, because they belong only to the RBAC system */ + get_fs_root(reaper->fs, &root); + ++ br_read_lock(&vfsmount_lock); + write_seqlock(&rename_lock); -+ br_read_lock(vfsmount_lock); + res = gen_full_path(&path, &root, buf, buflen); -+ br_read_unlock(vfsmount_lock); + write_sequnlock(&rename_lock); ++ br_read_unlock(&vfsmount_lock); + + path_put(&root); + return res; @@ -50981,12 +57480,12 @@ index 0000000..7a5922f +gr_to_filename_rbac(const struct dentry *dentry, const struct vfsmount *mnt) +{ + char *ret; ++ br_read_lock(&vfsmount_lock); + write_seqlock(&rename_lock); -+ br_read_lock(vfsmount_lock); + ret = __d_real_path(dentry, mnt, per_cpu_ptr(gr_shared_page[0],smp_processor_id()), + PAGE_SIZE); -+ br_read_unlock(vfsmount_lock); + write_sequnlock(&rename_lock); ++ br_read_unlock(&vfsmount_lock); + return ret; +} + @@ -50997,8 +57496,8 @@ index 0000000..7a5922f + char *buf; + int buflen; + ++ br_read_lock(&vfsmount_lock); + write_seqlock(&rename_lock); -+ br_read_lock(vfsmount_lock); + buf = per_cpu_ptr(gr_shared_page[0], smp_processor_id()); + ret = __d_real_path(dentry, mnt, buf, PAGE_SIZE - 6); + buflen = (int)(ret - buf); @@ -51006,8 +57505,8 @@ index 0000000..7a5922f + prepend(&ret, &buflen, "/proc", 5); + else + ret = strcpy(buf, "<path too long>"); -+ br_read_unlock(vfsmount_lock); + write_sequnlock(&rename_lock); ++ br_read_unlock(&vfsmount_lock); + return ret; +} + @@ -51058,7 +57557,7 @@ index 0000000..7a5922f +struct acl_subject_label * +lookup_subject_map(const struct acl_subject_label *userp) +{ -+ unsigned int index = shash(userp, subj_map_set.s_size); ++ unsigned int index = gr_shash(userp, subj_map_set.s_size); + struct subject_map *match; + + match = subj_map_set.s_hash[index]; @@ -51075,7 +57574,7 @@ index 0000000..7a5922f +static void +insert_subj_map_entry(struct subject_map *subjmap) +{ -+ unsigned int index = shash(subjmap->user, subj_map_set.s_size); ++ unsigned int index = gr_shash(subjmap->user, subj_map_set.s_size); + struct subject_map **curr; + + subjmap->prev = NULL; @@ -51094,7 +57593,7 @@ index 0000000..7a5922f +lookup_acl_role_label(const struct task_struct *task, const uid_t uid, + const gid_t gid) +{ -+ unsigned int index = rhash(uid, GR_ROLE_USER, acl_role_set.r_size); ++ unsigned int index = gr_rhash(uid, GR_ROLE_USER, acl_role_set.r_size); + struct acl_role_label *match; + struct role_allowed_ip *ipp; + unsigned int x; @@ -51117,7 +57616,7 @@ index 0000000..7a5922f +found: + if (match == NULL) { + try_group: -+ index = rhash(gid, GR_ROLE_GROUP, acl_role_set.r_size); ++ index = gr_rhash(gid, GR_ROLE_GROUP, acl_role_set.r_size); + match = acl_role_set.r_hash[index]; + + while (match) { @@ -51163,7 +57662,7 @@ index 0000000..7a5922f +lookup_acl_subj_label(const ino_t ino, const dev_t dev, + const struct acl_role_label *role) +{ -+ unsigned int index = fhash(ino, dev, role->subj_hash_size); ++ unsigned int index = gr_fhash(ino, dev, role->subj_hash_size); + struct acl_subject_label *match; + + match = role->subj_hash[index]; @@ -51183,7 +57682,7 @@ index 0000000..7a5922f +lookup_acl_subj_label_deleted(const ino_t ino, const dev_t dev, + const struct acl_role_label *role) +{ -+ unsigned int index = fhash(ino, dev, role->subj_hash_size); ++ unsigned int index = gr_fhash(ino, dev, role->subj_hash_size); + struct acl_subject_label *match; + + match = role->subj_hash[index]; @@ -51203,7 +57702,7 @@ index 0000000..7a5922f +lookup_acl_obj_label(const ino_t ino, const dev_t dev, + const struct acl_subject_label *subj) +{ -+ unsigned int index = fhash(ino, dev, subj->obj_hash_size); ++ unsigned int index = gr_fhash(ino, dev, subj->obj_hash_size); + struct acl_object_label *match; + + match = subj->obj_hash[index]; @@ -51223,7 +57722,7 @@ index 0000000..7a5922f +lookup_acl_obj_label_create(const ino_t ino, const dev_t dev, + const struct acl_subject_label *subj) +{ -+ unsigned int index = fhash(ino, dev, subj->obj_hash_size); ++ unsigned int index = gr_fhash(ino, dev, subj->obj_hash_size); + struct acl_object_label *match; + + match = subj->obj_hash[index]; @@ -51297,7 +57796,7 @@ index 0000000..7a5922f +static struct inodev_entry * +lookup_inodev_entry(const ino_t ino, const dev_t dev) +{ -+ unsigned int index = fhash(ino, dev, inodev_set.i_size); ++ unsigned int index = gr_fhash(ino, dev, inodev_set.i_size); + struct inodev_entry *match; + + match = inodev_set.i_hash[index]; @@ -51311,7 +57810,7 @@ index 0000000..7a5922f +static void +insert_inodev_entry(struct inodev_entry *entry) +{ -+ unsigned int index = fhash(entry->nentry->inode, entry->nentry->device, ++ unsigned int index = gr_fhash(entry->nentry->inode, entry->nentry->device, + inodev_set.i_size); + struct inodev_entry **curr; + @@ -51331,7 +57830,7 @@ index 0000000..7a5922f +__insert_acl_role_label(struct acl_role_label *role, uid_t uidgid) +{ + unsigned int index = -+ rhash(uidgid, role->roletype & (GR_ROLE_USER | GR_ROLE_GROUP), acl_role_set.r_size); ++ gr_rhash(uidgid, role->roletype & (GR_ROLE_USER | GR_ROLE_GROUP), acl_role_set.r_size); + struct acl_role_label **curr; + struct acl_role_label *tmp, *tmp2; + @@ -51464,7 +57963,7 @@ index 0000000..7a5922f + struct acl_subject_label *subj) +{ + unsigned int index = -+ fhash(obj->inode, obj->device, subj->obj_hash_size); ++ gr_fhash(obj->inode, obj->device, subj->obj_hash_size); + struct acl_object_label **curr; + + @@ -51484,7 +57983,7 @@ index 0000000..7a5922f +insert_acl_subj_label(struct acl_subject_label *obj, + struct acl_role_label *role) +{ -+ unsigned int index = fhash(obj->inode, obj->device, role->subj_hash_size); ++ unsigned int index = gr_fhash(obj->inode, obj->device, role->subj_hash_size); + struct acl_subject_label **curr; + + obj->prev = NULL; @@ -51733,7 +58232,7 @@ index 0000000..7a5922f +} + +static struct acl_subject_label * -+do_copy_user_subj(struct acl_subject_label *userp, struct acl_role_label *role); ++do_copy_user_subj(struct acl_subject_label *userp, struct acl_role_label *role, int *already_copied); + +static int +copy_user_glob(struct acl_object_label *obj) @@ -51819,13 +58318,18 @@ index 0000000..7a5922f + return ret; + + if (o_tmp->nested) { -+ o_tmp->nested = do_copy_user_subj(o_tmp->nested, role); ++ int already_copied; ++ ++ o_tmp->nested = do_copy_user_subj(o_tmp->nested, role, &already_copied); + if (IS_ERR(o_tmp->nested)) + return PTR_ERR(o_tmp->nested); + -+ /* insert into nested subject list */ -+ o_tmp->nested->next = role->hash->first; -+ role->hash->first = o_tmp->nested; ++ /* insert into nested subject list if we haven't copied this one yet ++ to prevent duplicate entries */ ++ if (!already_copied) { ++ o_tmp->nested->next = role->hash->first; ++ role->hash->first = o_tmp->nested; ++ } + } + } + @@ -51844,14 +58348,6 @@ index 0000000..7a5922f + break; + + userp = s_tmp.prev; -+ /* do not count nested subjects against this count, since -+ they are not included in the hash table, but are -+ attached to objects. We have already counted -+ the subjects in userspace for the allocation -+ stack -+ */ -+ if (!(s_tmp.mode & GR_NESTED)) -+ num++; + } + + return num; @@ -51944,7 +58440,7 @@ index 0000000..7a5922f +} + +static struct acl_subject_label * -+do_copy_user_subj(struct acl_subject_label *userp, struct acl_role_label *role) ++do_copy_user_subj(struct acl_subject_label *userp, struct acl_role_label *role, int *already_copied) +{ + struct acl_subject_label *s_tmp = NULL, *s_tmp2; + unsigned int len; @@ -51956,13 +58452,19 @@ index 0000000..7a5922f + unsigned int i_num; + int err; + ++ if (already_copied != NULL) ++ *already_copied = 0; ++ + s_tmp = lookup_subject_map(userp); + + /* we've already copied this subject into the kernel, just return + the reference to it, and don't copy it over again + */ -+ if (s_tmp) ++ if (s_tmp) { ++ if (already_copied != NULL) ++ *already_copied = 1; + return(s_tmp); ++ } + + if ((s_tmp = (struct acl_subject_label *) + acl_alloc(sizeof (struct acl_subject_label))) == NULL) @@ -52048,7 +58550,7 @@ index 0000000..7a5922f + + /* set pointer for parent subject */ + if (s_tmp->parent_subject) { -+ s_tmp2 = do_copy_user_subj(s_tmp->parent_subject, role); ++ s_tmp2 = do_copy_user_subj(s_tmp->parent_subject, role, NULL); + + if (IS_ERR(s_tmp2)) + return s_tmp2; @@ -52123,16 +58625,7 @@ index 0000000..7a5922f + sizeof (struct acl_subject_label))) + return -EFAULT; + -+ /* do not add nested subjects here, add -+ while parsing objects -+ */ -+ -+ if (s_pre.mode & GR_NESTED) { -+ userp = s_pre.prev; -+ continue; -+ } -+ -+ ret = do_copy_user_subj(userp, role); ++ ret = do_copy_user_subj(userp, role, NULL); + + err = PTR_ERR(ret); + if (IS_ERR(ret)) @@ -52150,6 +58643,7 @@ index 0000000..7a5922f +copy_user_acl(struct gr_arg *arg) +{ + struct acl_role_label *r_tmp = NULL, **r_utmp, *r_utmp2; ++ struct acl_subject_label *subj_list; + struct sprole_pw *sptmp; + struct gr_hash_struct *ghash; + uid_t *domainlist; @@ -52278,14 +58772,21 @@ index 0000000..7a5922f + r_tmp->subj_hash_size * + sizeof (struct acl_subject_label *)); + -+ err = copy_user_subjs(r_tmp->hash->first, r_tmp); -+ -+ if (err) -+ return err; ++ /* acquire the list of subjects, then NULL out ++ the list prior to parsing the subjects for this role, ++ as during this parsing the list is replaced with a list ++ of *nested* subjects for the role ++ */ ++ subj_list = r_tmp->hash->first; + + /* set nested subject list to null */ + r_tmp->hash->first = NULL; + ++ err = copy_user_subjs(subj_list, r_tmp); ++ ++ if (err) ++ return err; ++ + insert_acl_role_label(r_tmp); + } + @@ -52528,6 +59029,20 @@ index 0000000..7a5922f + return __full_lookup(orig_dentry, orig_mnt, inode, device, subj, path, newglob); +} + ++#ifdef CONFIG_HUGETLBFS ++static inline bool ++is_hugetlbfs_mnt(const struct vfsmount *mnt) ++{ ++ int i; ++ for (i = 0; i < HUGE_MAX_HSTATE; i++) { ++ if (unlikely(hugetlbfs_vfsmount[i] == mnt)) ++ return true; ++ } ++ ++ return false; ++} ++#endif ++ +static struct acl_object_label * +__chk_obj_label(const struct dentry *l_dentry, const struct vfsmount *l_mnt, + const struct acl_subject_label *subj, char *path, const int checkglob) @@ -52538,15 +59053,15 @@ index 0000000..7a5922f + struct acl_object_label *retval; + struct dentry *parent; + ++ br_read_lock(&vfsmount_lock); + write_seqlock(&rename_lock); -+ br_read_lock(vfsmount_lock); + + if (unlikely((mnt == shm_mnt && dentry->d_inode->i_nlink == 0) || mnt == pipe_mnt || +#ifdef CONFIG_NET + mnt == sock_mnt || +#endif +#ifdef CONFIG_HUGETLBFS -+ (mnt == hugetlbfs_vfsmount && dentry->d_inode->i_nlink == 0) || ++ (is_hugetlbfs_mnt(mnt) && dentry->d_inode->i_nlink == 0) || +#endif + /* ignore Eric Biederman */ + IS_PRIVATE(l_dentry->d_inode))) { @@ -52586,8 +59101,8 @@ index 0000000..7a5922f + if (retval == NULL) + retval = full_lookup(l_dentry, l_mnt, real_root.dentry, subj, &path, checkglob); +out: -+ br_read_unlock(vfsmount_lock); + write_sequnlock(&rename_lock); ++ br_read_unlock(&vfsmount_lock); + + BUG_ON(retval == NULL); + @@ -52627,8 +59142,8 @@ index 0000000..7a5922f + struct acl_subject_label *retval; + struct dentry *parent; + ++ br_read_lock(&vfsmount_lock); + write_seqlock(&rename_lock); -+ br_read_lock(vfsmount_lock); + + for (;;) { + if (dentry == real_root.dentry && mnt == real_root.mnt) @@ -52682,8 +59197,8 @@ index 0000000..7a5922f + read_unlock(&gr_inode_lock); + } +out: -+ br_read_unlock(vfsmount_lock); + write_sequnlock(&rename_lock); ++ br_read_unlock(&vfsmount_lock); + + BUG_ON(retval == NULL); + @@ -52697,7 +59212,7 @@ index 0000000..7a5922f + const struct cred *cred = current_cred(); + + security_learn(GR_LEARN_AUDIT_MSG, task->role->rolename, task->role->roletype, -+ cred->uid, cred->gid, task->exec_file ? gr_to_filename1(task->exec_file->f_path.dentry, ++ GR_GLOBAL_UID(cred->uid), GR_GLOBAL_GID(cred->gid), task->exec_file ? gr_to_filename1(task->exec_file->f_path.dentry, + task->exec_file->f_path.mnt) : task->acl->filename, task->acl->filename, + 1UL, 1UL, gr_to_filename(dentry, mnt), (unsigned long) mode, &task->signal->saved_ip); + @@ -52705,16 +59220,29 @@ index 0000000..7a5922f +} + +static void -+gr_log_learn_id_change(const char type, const unsigned int real, -+ const unsigned int effective, const unsigned int fs) ++gr_log_learn_uid_change(const kuid_t real, const kuid_t effective, const kuid_t fs) +{ + struct task_struct *task = current; + const struct cred *cred = current_cred(); + + security_learn(GR_ID_LEARN_MSG, task->role->rolename, task->role->roletype, -+ cred->uid, cred->gid, task->exec_file ? gr_to_filename1(task->exec_file->f_path.dentry, ++ GR_GLOBAL_UID(cred->uid), GR_GLOBAL_GID(cred->gid), task->exec_file ? gr_to_filename1(task->exec_file->f_path.dentry, + task->exec_file->f_path.mnt) : task->acl->filename, task->acl->filename, -+ type, real, effective, fs, &task->signal->saved_ip); ++ 'u', GR_GLOBAL_UID(real), GR_GLOBAL_UID(effective), GR_GLOBAL_UID(fs), &task->signal->saved_ip); ++ ++ return; ++} ++ ++static void ++gr_log_learn_gid_change(const kgid_t real, const kgid_t effective, const kgid_t fs) ++{ ++ struct task_struct *task = current; ++ const struct cred *cred = current_cred(); ++ ++ security_learn(GR_ID_LEARN_MSG, task->role->rolename, task->role->roletype, ++ GR_GLOBAL_UID(cred->uid), GR_GLOBAL_GID(cred->gid), task->exec_file ? gr_to_filename1(task->exec_file->f_path.dentry, ++ task->exec_file->f_path.mnt) : task->acl->filename, task->acl->filename, ++ 'g', GR_GLOBAL_GID(real), GR_GLOBAL_GID(effective), GR_GLOBAL_GID(fs), &task->signal->saved_ip); + + return; +} @@ -52868,8 +59396,8 @@ index 0000000..7a5922f + // if old name had restrictions/auditing, make sure the new name does as well + needmode = oldmode & (GR_NOPTRACE | GR_PTRACERD | GR_INHERIT | GR_AUDITS); + -+ // don't allow hardlinking of suid/sgid files without permission -+ if (old_dentry->d_inode->i_mode & (S_ISUID | S_ISGID)) ++ // don't allow hardlinking of suid/sgid/fcapped files without permission ++ if (is_privileged_binary(old_dentry)) + needmode |= GR_SETID; + + if ((newmode & needmode) != needmode) @@ -52880,7 +59408,7 @@ index 0000000..7a5922f + return newmode; +bad: + needmode = oldmode; -+ if (old_dentry->d_inode->i_mode & (S_ISUID | S_ISGID)) ++ if (is_privileged_binary(old_dentry)) + needmode |= GR_SETID; + + if (current->acl->mode & (GR_LEARN | GR_INHERITLEARN)) { @@ -52974,11 +59502,14 @@ index 0000000..7a5922f + return; + + for (i = 0; i < RLIM_NLIMITS; i++) { -+ if (!(proc->resmask & (1 << i))) ++ if (!(proc->resmask & (1U << i))) + continue; + + task->signal->rlim[i].rlim_cur = proc->res[i].rlim_cur; + task->signal->rlim[i].rlim_max = proc->res[i].rlim_max; ++ ++ if (i == RLIMIT_CPU) ++ update_rlimit_cpu(task, proc->res[i].rlim_cur); + } + + return; @@ -52987,23 +59518,28 @@ index 0000000..7a5922f +extern int __gr_process_user_ban(struct user_struct *user); + +int -+gr_check_user_change(int real, int effective, int fs) ++gr_check_user_change(kuid_t real, kuid_t effective, kuid_t fs) +{ + unsigned int i; + __u16 num; + uid_t *uidlist; -+ int curuid; ++ uid_t curuid; + int realok = 0; + int effectiveok = 0; + int fsok = 0; ++ uid_t globalreal, globaleffective, globalfs; + +#if defined(CONFIG_GRKERNSEC_KERN_LOCKOUT) || defined(CONFIG_GRKERNSEC_BRUTE) + struct user_struct *user; + -+ if (real == -1) ++ if (!uid_valid(real)) + goto skipit; + -+ user = find_user(real); ++ /* find user based on global namespace */ ++ ++ globalreal = GR_GLOBAL_UID(real); ++ ++ user = find_user(make_kuid(&init_user_ns, globalreal)); + if (user == NULL) + goto skipit; + @@ -53023,7 +59559,7 @@ index 0000000..7a5922f + return 0; + + if (current->acl->mode & (GR_LEARN | GR_INHERITLEARN)) -+ gr_log_learn_id_change('u', real, effective, fs); ++ gr_log_learn_uid_change(real, effective, fs); + + num = current->acl->user_trans_num; + uidlist = current->acl->user_transitions; @@ -53031,31 +59567,43 @@ index 0000000..7a5922f + if (uidlist == NULL) + return 0; + -+ if (real == -1) ++ if (!uid_valid(real)) { + realok = 1; -+ if (effective == -1) ++ globalreal = (uid_t)-1; ++ } else { ++ globalreal = GR_GLOBAL_UID(real); ++ } ++ if (!uid_valid(effective)) { + effectiveok = 1; -+ if (fs == -1) ++ globaleffective = (uid_t)-1; ++ } else { ++ globaleffective = GR_GLOBAL_UID(effective); ++ } ++ if (!uid_valid(fs)) { + fsok = 1; ++ globalfs = (uid_t)-1; ++ } else { ++ globalfs = GR_GLOBAL_UID(fs); ++ } + + if (current->acl->user_trans_type & GR_ID_ALLOW) { + for (i = 0; i < num; i++) { -+ curuid = (int)uidlist[i]; -+ if (real == curuid) ++ curuid = uidlist[i]; ++ if (globalreal == curuid) + realok = 1; -+ if (effective == curuid) ++ if (globaleffective == curuid) + effectiveok = 1; -+ if (fs == curuid) ++ if (globalfs == curuid) + fsok = 1; + } + } else if (current->acl->user_trans_type & GR_ID_DENY) { + for (i = 0; i < num; i++) { -+ curuid = (int)uidlist[i]; -+ if (real == curuid) ++ curuid = uidlist[i]; ++ if (globalreal == curuid) + break; -+ if (effective == curuid) ++ if (globaleffective == curuid) + break; -+ if (fs == curuid) ++ if (globalfs == curuid) + break; + } + /* not in deny list */ @@ -53069,27 +59617,28 @@ index 0000000..7a5922f + if (realok && effectiveok && fsok) + return 0; + else { -+ gr_log_int(GR_DONT_AUDIT, GR_USRCHANGE_ACL_MSG, realok ? (effectiveok ? (fsok ? 0 : fs) : effective) : real); ++ gr_log_int(GR_DONT_AUDIT, GR_USRCHANGE_ACL_MSG, realok ? (effectiveok ? (fsok ? 0 : globalfs) : globaleffective) : globalreal); + return 1; + } +} + +int -+gr_check_group_change(int real, int effective, int fs) ++gr_check_group_change(kgid_t real, kgid_t effective, kgid_t fs) +{ + unsigned int i; + __u16 num; + gid_t *gidlist; -+ int curgid; ++ gid_t curgid; + int realok = 0; + int effectiveok = 0; + int fsok = 0; ++ gid_t globalreal, globaleffective, globalfs; + + if (unlikely(!(gr_status & GR_READY))) + return 0; + + if (current->acl->mode & (GR_LEARN | GR_INHERITLEARN)) -+ gr_log_learn_id_change('g', real, effective, fs); ++ gr_log_learn_gid_change(real, effective, fs); + + num = current->acl->group_trans_num; + gidlist = current->acl->group_transitions; @@ -53097,31 +59646,43 @@ index 0000000..7a5922f + if (gidlist == NULL) + return 0; + -+ if (real == -1) ++ if (!gid_valid(real)) { + realok = 1; -+ if (effective == -1) ++ globalreal = (gid_t)-1; ++ } else { ++ globalreal = GR_GLOBAL_GID(real); ++ } ++ if (!gid_valid(effective)) { + effectiveok = 1; -+ if (fs == -1) ++ globaleffective = (gid_t)-1; ++ } else { ++ globaleffective = GR_GLOBAL_GID(effective); ++ } ++ if (!gid_valid(fs)) { + fsok = 1; ++ globalfs = (gid_t)-1; ++ } else { ++ globalfs = GR_GLOBAL_GID(fs); ++ } + + if (current->acl->group_trans_type & GR_ID_ALLOW) { + for (i = 0; i < num; i++) { -+ curgid = (int)gidlist[i]; -+ if (real == curgid) ++ curgid = gidlist[i]; ++ if (globalreal == curgid) + realok = 1; -+ if (effective == curgid) ++ if (globaleffective == curgid) + effectiveok = 1; -+ if (fs == curgid) ++ if (globalfs == curgid) + fsok = 1; + } + } else if (current->acl->group_trans_type & GR_ID_DENY) { + for (i = 0; i < num; i++) { -+ curgid = (int)gidlist[i]; -+ if (real == curgid) ++ curgid = gidlist[i]; ++ if (globalreal == curgid) + break; -+ if (effective == curgid) ++ if (globaleffective == curgid) + break; -+ if (fs == curgid) ++ if (globalfs == curgid) + break; + } + /* not in deny list */ @@ -53135,7 +59696,7 @@ index 0000000..7a5922f + if (realok && effectiveok && fsok) + return 0; + else { -+ gr_log_int(GR_DONT_AUDIT, GR_GRPCHANGE_ACL_MSG, realok ? (effectiveok ? (fsok ? 0 : fs) : effective) : real); ++ gr_log_int(GR_DONT_AUDIT, GR_GRPCHANGE_ACL_MSG, realok ? (effectiveok ? (fsok ? 0 : globalfs) : globaleffective) : globalreal); + return 1; + } +} @@ -53143,16 +59704,21 @@ index 0000000..7a5922f +extern int gr_acl_is_capable(const int cap); + +void -+gr_set_role_label(struct task_struct *task, const uid_t uid, const uid_t gid) ++gr_set_role_label(struct task_struct *task, const kuid_t kuid, const kgid_t kgid) +{ + struct acl_role_label *role = task->role; + struct acl_subject_label *subj = NULL; + struct acl_object_label *obj; + struct file *filp; ++ uid_t uid; ++ gid_t gid; + + if (unlikely(!(gr_status & GR_READY))) + return; + ++ uid = GR_GLOBAL_UID(kuid); ++ gid = GR_GLOBAL_GID(kgid); ++ + filp = task->exec_file; + + /* kernel process, we'll give them the kernel role */ @@ -53198,7 +59764,7 @@ index 0000000..7a5922f + task->is_writable = 1; + +#ifdef CONFIG_GRKERNSEC_RBAC_DEBUG -+ printk(KERN_ALERT "Set role label for (%s:%d): role:%s, subject:%s\n", task->comm, task->pid, task->role->rolename, task->acl->filename); ++ printk(KERN_ALERT "Set role label for (%s:%d): role:%s, subject:%s\n", task->comm, task_pid_nr(task), task->role->rolename, task->acl->filename); +#endif + + gr_set_proc_res(task); @@ -53273,7 +59839,7 @@ index 0000000..7a5922f + gr_set_proc_res(task); + +#ifdef CONFIG_GRKERNSEC_RBAC_DEBUG -+ printk(KERN_ALERT "Set subject label for (%s:%d): role:%s, subject:%s\n", task->comm, task->pid, task->role->rolename, task->acl->filename); ++ printk(KERN_ALERT "Set subject label for (%s:%d): role:%s, subject:%s\n", task->comm, task_pid_nr(task), task->role->rolename, task->acl->filename); +#endif + return 0; +} @@ -53294,8 +59860,9 @@ index 0000000..7a5922f + matchpo->mode |= GR_DELETED; + FOR_EACH_SUBJECT_END(subj,x) + FOR_EACH_NESTED_SUBJECT_START(role, subj) -+ if (subj->inode == ino && subj->device == dev) -+ subj->mode |= GR_DELETED; ++ /* nested subjects aren't in the role's subj_hash table */ ++ if ((matchpo = lookup_acl_obj_label(ino, dev, subj)) != NULL) ++ matchpo->mode |= GR_DELETED; + FOR_EACH_NESTED_SUBJECT_END(subj) + if ((matchps = lookup_acl_subj_label(ino, dev, role)) != NULL) + matchps->mode |= GR_DELETED; @@ -53328,7 +59895,7 @@ index 0000000..7a5922f + const ino_t newinode, const dev_t newdevice, + struct acl_subject_label *subj) +{ -+ unsigned int index = fhash(oldinode, olddevice, subj->obj_hash_size); ++ unsigned int index = gr_fhash(oldinode, olddevice, subj->obj_hash_size); + struct acl_object_label *match; + + match = subj->obj_hash[index]; @@ -53367,7 +59934,7 @@ index 0000000..7a5922f + const ino_t newinode, const dev_t newdevice, + struct acl_role_label *role) +{ -+ unsigned int index = fhash(oldinode, olddevice, role->subj_hash_size); ++ unsigned int index = gr_fhash(oldinode, olddevice, role->subj_hash_size); + struct acl_subject_label *match; + + match = role->subj_hash[index]; @@ -53405,7 +59972,7 @@ index 0000000..7a5922f +update_inodev_entry(const ino_t oldinode, const dev_t olddevice, + const ino_t newinode, const dev_t newdevice) +{ -+ unsigned int index = fhash(oldinode, olddevice, inodev_set.i_size); ++ unsigned int index = gr_fhash(oldinode, olddevice, inodev_set.i_size); + struct inodev_entry *match; + + match = inodev_set.i_hash[index]; @@ -53453,6 +60020,9 @@ index 0000000..7a5922f + subj->inode = ino; + subj->device = dev; + } ++ /* nested subjects aren't in the role's subj_hash table */ ++ update_acl_obj_label(matchn->inode, matchn->device, ++ ino, dev, subj); + FOR_EACH_NESTED_SUBJECT_END(subj) + FOR_EACH_SUBJECT_START(role, subj, x) + update_acl_obj_label(matchn->inode, matchn->device, @@ -53683,7 +60253,7 @@ index 0000000..7a5922f + tsk->is_writable = 1; + +#ifdef CONFIG_GRKERNSEC_RBAC_DEBUG -+ printk(KERN_ALERT "Assigning special role:%s subject:%s to process (%s:%d)\n", tsk->role->rolename, tsk->acl->filename, tsk->comm, tsk->pid); ++ printk(KERN_ALERT "Assigning special role:%s subject:%s to process (%s:%d)\n", tsk->role->rolename, tsk->acl->filename, tsk->comm, task_pid_nr(tsk)); +#endif + +out_unlock: @@ -53737,7 +60307,7 @@ index 0000000..7a5922f + if (file && S_ISCHR(file->f_path.dentry->d_inode->i_mode) && + file->f_path.dentry->d_inode->i_rdev == our_file->f_path.dentry->d_inode->i_rdev) { + p3 = task; -+ while (p3->pid > 0) { ++ while (task_pid_nr(p3) > 0) { + if (p3 == p) + break; + p3 = p3->real_parent; @@ -53828,7 +60398,7 @@ index 0000000..7a5922f + + if (gr_usermode->mode != GR_SPROLE && gr_usermode->mode != GR_STATUS && + gr_usermode->mode != GR_UNSPROLE && gr_usermode->mode != GR_SPROLEPAM && -+ current_uid()) { ++ gr_is_global_nonroot(current_uid())) { + error = -EPERM; + goto out; + } @@ -54067,7 +60637,7 @@ index 0000000..7a5922f + gr_set_proc_res(task); + +#ifdef CONFIG_GRKERNSEC_RBAC_DEBUG -+ printk(KERN_ALERT "gr_set_acls for (%s:%d): role:%s, subject:%s\n", task->comm, task->pid, task->role->rolename, task->acl->filename); ++ printk(KERN_ALERT "gr_set_acls for (%s:%d): role:%s, subject:%s\n", task->comm, task_pid_nr(task), task->role->rolename, task->acl->filename); +#endif + } else { + return 1; @@ -54102,13 +60672,13 @@ index 0000000..7a5922f + + if (task->exec_file) { + cred = __task_cred(task); -+ task->role = lookup_acl_role_label(task, cred->uid, cred->gid); ++ task->role = lookup_acl_role_label(task, GR_GLOBAL_UID(cred->uid), GR_GLOBAL_GID(cred->gid)); + ret = gr_apply_subject_to_task(task); + if (ret) { + read_unlock(&grsec_exec_file_lock); + read_unlock(&tasklist_lock); + rcu_read_unlock(); -+ gr_log_str_int(GR_DONT_AUDIT_GOOD, GR_DEFACL_MSG, task->comm, task->pid); ++ gr_log_str_int(GR_DONT_AUDIT_GOOD, GR_DEFACL_MSG, task->comm, task_pid_nr(task)); + return ret; + } + } else { @@ -54127,6 +60697,26 @@ index 0000000..7a5922f + return 0; +} + ++#if defined(CONFIG_GRKERNSEC_RESLOG) || !defined(CONFIG_GRKERNSEC_NO_RBAC) ++static const unsigned long res_learn_bumps[GR_NLIMITS] = { ++ [RLIMIT_CPU] = GR_RLIM_CPU_BUMP, ++ [RLIMIT_FSIZE] = GR_RLIM_FSIZE_BUMP, ++ [RLIMIT_DATA] = GR_RLIM_DATA_BUMP, ++ [RLIMIT_STACK] = GR_RLIM_STACK_BUMP, ++ [RLIMIT_CORE] = GR_RLIM_CORE_BUMP, ++ [RLIMIT_RSS] = GR_RLIM_RSS_BUMP, ++ [RLIMIT_NPROC] = GR_RLIM_NPROC_BUMP, ++ [RLIMIT_NOFILE] = GR_RLIM_NOFILE_BUMP, ++ [RLIMIT_MEMLOCK] = GR_RLIM_MEMLOCK_BUMP, ++ [RLIMIT_AS] = GR_RLIM_AS_BUMP, ++ [RLIMIT_LOCKS] = GR_RLIM_LOCKS_BUMP, ++ [RLIMIT_SIGPENDING] = GR_RLIM_SIGPENDING_BUMP, ++ [RLIMIT_MSGQUEUE] = GR_RLIM_MSGQUEUE_BUMP, ++ [RLIMIT_NICE] = GR_RLIM_NICE_BUMP, ++ [RLIMIT_RTPRIO] = GR_RLIM_RTPRIO_BUMP, ++ [RLIMIT_RTTIME] = GR_RLIM_RTTIME_BUMP ++}; ++ +void +gr_learn_resource(const struct task_struct *task, + const int res, const unsigned long wanted, const int gt) @@ -54138,10 +60728,8 @@ index 0000000..7a5922f + task->acl && (task->acl->mode & (GR_LEARN | GR_INHERITLEARN)))) + goto skip_reslog; + -+#ifdef CONFIG_GRKERNSEC_RESLOG + gr_log_resource(task, res, wanted, gt); -+#endif -+ skip_reslog: ++skip_reslog: + + if (unlikely(!(gr_status & GR_READY) || !wanted || res >= GR_NLIMITS)) + return; @@ -54149,63 +60737,13 @@ index 0000000..7a5922f + acl = task->acl; + + if (likely(!acl || !(acl->mode & (GR_LEARN | GR_INHERITLEARN)) || -+ !(acl->resmask & (1 << (unsigned short) res)))) ++ !(acl->resmask & (1U << (unsigned short) res)))) + return; + + if (wanted >= acl->res[res].rlim_cur) { + unsigned long res_add; + -+ res_add = wanted; -+ switch (res) { -+ case RLIMIT_CPU: -+ res_add += GR_RLIM_CPU_BUMP; -+ break; -+ case RLIMIT_FSIZE: -+ res_add += GR_RLIM_FSIZE_BUMP; -+ break; -+ case RLIMIT_DATA: -+ res_add += GR_RLIM_DATA_BUMP; -+ break; -+ case RLIMIT_STACK: -+ res_add += GR_RLIM_STACK_BUMP; -+ break; -+ case RLIMIT_CORE: -+ res_add += GR_RLIM_CORE_BUMP; -+ break; -+ case RLIMIT_RSS: -+ res_add += GR_RLIM_RSS_BUMP; -+ break; -+ case RLIMIT_NPROC: -+ res_add += GR_RLIM_NPROC_BUMP; -+ break; -+ case RLIMIT_NOFILE: -+ res_add += GR_RLIM_NOFILE_BUMP; -+ break; -+ case RLIMIT_MEMLOCK: -+ res_add += GR_RLIM_MEMLOCK_BUMP; -+ break; -+ case RLIMIT_AS: -+ res_add += GR_RLIM_AS_BUMP; -+ break; -+ case RLIMIT_LOCKS: -+ res_add += GR_RLIM_LOCKS_BUMP; -+ break; -+ case RLIMIT_SIGPENDING: -+ res_add += GR_RLIM_SIGPENDING_BUMP; -+ break; -+ case RLIMIT_MSGQUEUE: -+ res_add += GR_RLIM_MSGQUEUE_BUMP; -+ break; -+ case RLIMIT_NICE: -+ res_add += GR_RLIM_NICE_BUMP; -+ break; -+ case RLIMIT_RTPRIO: -+ res_add += GR_RLIM_RTPRIO_BUMP; -+ break; -+ case RLIMIT_RTTIME: -+ res_add += GR_RLIM_RTTIME_BUMP; -+ break; -+ } ++ res_add = wanted + res_learn_bumps[res]; + + acl->res[res].rlim_cur = res_add; + @@ -54217,7 +60755,7 @@ index 0000000..7a5922f + rcu_read_lock(); + cred = __task_cred(task); + security_learn(GR_LEARN_AUDIT_MSG, task->role->rolename, -+ task->role->roletype, cred->uid, cred->gid, acl->filename, ++ task->role->roletype, GR_GLOBAL_UID(cred->uid), GR_GLOBAL_GID(cred->gid), acl->filename, + acl->filename, acl->res[res].rlim_cur, acl->res[res].rlim_max, + "", (unsigned long) res, &task->signal->saved_ip); + rcu_read_unlock(); @@ -54225,6 +60763,8 @@ index 0000000..7a5922f + + return; +} ++EXPORT_SYMBOL(gr_learn_resource); ++#endif + +#if defined(CONFIG_PAX_HAVE_ACL_FLAGS) && (defined(CONFIG_PAX_NOEXEC) || defined(CONFIG_PAX_ASLR)) +void @@ -54286,13 +60826,13 @@ index 0000000..7a5922f + read_lock(&grsec_exec_file_lock); + filp = task->exec_file; + -+ while (tmp->pid > 0) { ++ while (task_pid_nr(tmp) > 0) { + if (tmp == curtemp) + break; + tmp = tmp->real_parent; + } + -+ if (!filp || (tmp->pid == 0 && ((grsec_enable_harden_ptrace && current_uid() && !(gr_status & GR_READY)) || ++ if (!filp || (task_pid_nr(tmp) == 0 && ((grsec_enable_harden_ptrace && gr_is_global_nonroot(current_uid()) && !(gr_status & GR_READY)) || + ((gr_status & GR_READY) && !(current->acl->mode & GR_RELAXPTRACE))))) { + read_unlock(&grsec_exec_file_lock); + read_unlock(&tasklist_lock); @@ -54316,7 +60856,7 @@ index 0000000..7a5922f + + if (!(current->acl->mode & GR_POVERRIDE) && !(current->role->roletype & GR_ROLE_GOD) + && (current->acl != task->acl || (current->acl != current->role->root_label -+ && current->pid != task->pid))) ++ && task_pid_nr(current) != task_pid_nr(task)))) + return 1; + + return 0; @@ -54348,13 +60888,13 @@ index 0000000..7a5922f +#endif + if (request == PTRACE_ATTACH || request == PTRACE_SEIZE) { + read_lock(&tasklist_lock); -+ while (tmp->pid > 0) { ++ while (task_pid_nr(tmp) > 0) { + if (tmp == curtemp) + break; + tmp = tmp->real_parent; + } + -+ if (tmp->pid == 0 && ((grsec_enable_harden_ptrace && current_uid() && !(gr_status & GR_READY)) || ++ if (task_pid_nr(tmp) == 0 && ((grsec_enable_harden_ptrace && gr_is_global_nonroot(current_uid()) && !(gr_status & GR_READY)) || + ((gr_status & GR_READY) && !(current->acl->mode & GR_RELAXPTRACE)))) { + read_unlock(&tasklist_lock); + gr_log_ptrace(GR_DONT_AUDIT, GR_PTRACE_ACL_MSG, task); @@ -54566,10 +61106,10 @@ index 0000000..7a5922f +#if defined(CONFIG_GRKERNSEC_PROC_USER) || defined(CONFIG_GRKERNSEC_PROC_USERGROUP) + cred = __task_cred(task); +#ifdef CONFIG_GRKERNSEC_PROC_USER -+ if (cred->uid != 0) ++ if (gr_is_global_nonroot(cred->uid)) + ret = -EACCES; +#elif defined(CONFIG_GRKERNSEC_PROC_USERGROUP) -+ if (cred->uid != 0 && !groups_search(cred->group_info, CONFIG_GRKERNSEC_PROC_GID)) ++ if (gr_is_global_nonroot(cred->uid) && !groups_search(cred->group_info, grsec_proc_gid)) + ret = -EACCES; +#endif +#endif @@ -54676,10 +61216,25 @@ index 0000000..7a5922f + return (obj->mode & GR_FIND) ? 1 : 0; +} + ++void gr_put_exec_file(struct task_struct *task) ++{ ++ struct file *filp; ++ ++ write_lock(&grsec_exec_file_lock); ++ filp = task->exec_file; ++ task->exec_file = NULL; ++ write_unlock(&grsec_exec_file_lock); ++ ++ if (filp) ++ fput(filp); ++ ++ return; ++} ++ ++ +#ifdef CONFIG_NETFILTER_XT_MATCH_GRADM_MODULE +EXPORT_SYMBOL(gr_acl_is_enabled); +#endif -+EXPORT_SYMBOL(gr_learn_resource); +EXPORT_SYMBOL(gr_set_kernel_label); +#ifdef CONFIG_SECURITY +EXPORT_SYMBOL(gr_check_user_change); @@ -54799,7 +61354,7 @@ index 0000000..34fefda +} diff --git a/grsecurity/gracl_cap.c b/grsecurity/gracl_cap.c new file mode 100644 -index 0000000..6d21049 +index 0000000..bdd51ea --- /dev/null +++ b/grsecurity/gracl_cap.c @@ -0,0 +1,110 @@ @@ -54854,8 +61409,8 @@ index 0000000..6d21049 + if ((curracl->mode & (GR_LEARN | GR_INHERITLEARN)) + && cap_raised(cred->cap_effective, cap)) { + security_learn(GR_LEARN_AUDIT_MSG, task->role->rolename, -+ task->role->roletype, cred->uid, -+ cred->gid, task->exec_file ? ++ task->role->roletype, GR_GLOBAL_UID(cred->uid), ++ GR_GLOBAL_GID(cred->gid), task->exec_file ? + gr_to_filename(task->exec_file->f_path.dentry, + task->exec_file->f_path.mnt) : curracl->filename, + curracl->filename, 0UL, @@ -54915,10 +61470,10 @@ index 0000000..6d21049 + diff --git a/grsecurity/gracl_fs.c b/grsecurity/gracl_fs.c new file mode 100644 -index 0000000..88d0e87 +index 0000000..a340c17 --- /dev/null +++ b/grsecurity/gracl_fs.c -@@ -0,0 +1,435 @@ +@@ -0,0 +1,431 @@ +#include <linux/kernel.h> +#include <linux/sched.h> +#include <linux/types.h> @@ -55019,7 +61574,8 @@ index 0000000..88d0e87 + if ((acc_mode & MAY_READ) && + !((open_flags & O_DIRECTORY) || (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode)))) + reqmode |= GR_READ; -+ if ((open_flags & O_CREAT) && (imode & (S_ISUID | S_ISGID))) ++ if ((open_flags & O_CREAT) && ++ ((imode & S_ISUID) || ((imode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)))) + reqmode |= GR_SETID; + + mode = @@ -55137,7 +61693,8 @@ index 0000000..88d0e87 + if (unlikely(dentry->d_inode && S_ISSOCK(dentry->d_inode->i_mode))) + return 1; + -+ if (unlikely(mode & (S_ISUID | S_ISGID))) { ++ if (unlikely(dentry->d_inode && !S_ISDIR(dentry->d_inode->i_mode) && ++ ((mode & S_ISUID) || ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP))))) { + return generic_fs_handler(dentry, mnt, GR_WRITE | GR_SETID, + GR_CHMOD_ACL_MSG); + } else { @@ -55179,7 +61736,7 @@ index 0000000..88d0e87 + const struct dentry * parent_dentry, + const struct vfsmount * parent_mnt, + const struct dentry * old_dentry, -+ const struct vfsmount * old_mnt, const char *to) ++ const struct vfsmount * old_mnt, const struct filename *to) +{ + __u32 mode; + __u32 needmode = GR_CREATE | GR_LINK; @@ -55190,10 +61747,10 @@ index 0000000..88d0e87 + old_mnt); + + if (unlikely(((mode & needmode) == needmode) && (mode & needaudit))) { -+ gr_log_fs_rbac_str(GR_DO_AUDIT, GR_LINK_ACL_MSG, old_dentry, old_mnt, to); ++ gr_log_fs_rbac_str(GR_DO_AUDIT, GR_LINK_ACL_MSG, old_dentry, old_mnt, to->name); + return mode; + } else if (unlikely(((mode & needmode) != needmode) && !(mode & GR_SUPPRESS))) { -+ gr_log_fs_rbac_str(GR_DONT_AUDIT, GR_LINK_ACL_MSG, old_dentry, old_mnt, to); ++ gr_log_fs_rbac_str(GR_DONT_AUDIT, GR_LINK_ACL_MSG, old_dentry, old_mnt, to->name); + return 0; + } else if (unlikely((mode & needmode) != needmode)) + return 0; @@ -55204,7 +61761,7 @@ index 0000000..88d0e87 +__u32 +gr_acl_handle_symlink(const struct dentry * new_dentry, + const struct dentry * parent_dentry, -+ const struct vfsmount * parent_mnt, const char *from) ++ const struct vfsmount * parent_mnt, const struct filename *from) +{ + __u32 needmode = GR_WRITE | GR_CREATE; + __u32 mode; @@ -55215,10 +61772,10 @@ index 0000000..88d0e87 + GR_WRITE | GR_AUDIT_WRITE | GR_SUPPRESS); + + if (unlikely(mode & GR_WRITE && mode & GR_AUDITS)) { -+ gr_log_fs_str_rbac(GR_DO_AUDIT, GR_SYMLINK_ACL_MSG, from, new_dentry, parent_mnt); ++ gr_log_fs_str_rbac(GR_DO_AUDIT, GR_SYMLINK_ACL_MSG, from->name, new_dentry, parent_mnt); + return mode; + } else if (unlikely(((mode & needmode) != needmode) && !(mode & GR_SUPPRESS))) { -+ gr_log_fs_str_rbac(GR_DONT_AUDIT, GR_SYMLINK_ACL_MSG, from, new_dentry, parent_mnt); ++ gr_log_fs_str_rbac(GR_DONT_AUDIT, GR_SYMLINK_ACL_MSG, from->name, new_dentry, parent_mnt); + return 0; + } else if (unlikely((mode & needmode) != needmode)) + return 0; @@ -55251,7 +61808,7 @@ index 0000000..88d0e87 + const int mode) +{ + __u32 reqmode = GR_WRITE | GR_CREATE; -+ if (unlikely(mode & (S_ISUID | S_ISGID))) ++ if (unlikely((mode & S_ISUID) || ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)))) + reqmode |= GR_SETID; + + return generic_fs_create_handler(new_dentry, parent_dentry, parent_mnt, @@ -55277,7 +61834,7 @@ index 0000000..88d0e87 + const struct vfsmount *parent_mnt, + struct dentry *old_dentry, + struct inode *old_parent_inode, -+ struct vfsmount *old_mnt, const char *newname) ++ struct vfsmount *old_mnt, const struct filename *newname) +{ + __u32 comp1, comp2; + int error = 0; @@ -55308,10 +61865,10 @@ index 0000000..88d0e87 + + if (RENAME_CHECK_SUCCESS(comp1, comp2) && + ((comp1 & GR_AUDITS) || (comp2 & GR_AUDITS))) -+ gr_log_fs_rbac_str(GR_DO_AUDIT, GR_RENAME_ACL_MSG, old_dentry, old_mnt, newname); ++ gr_log_fs_rbac_str(GR_DO_AUDIT, GR_RENAME_ACL_MSG, old_dentry, old_mnt, newname->name); + else if (!RENAME_CHECK_SUCCESS(comp1, comp2) && !(comp1 & GR_SUPPRESS) + && !(comp2 & GR_SUPPRESS)) { -+ gr_log_fs_rbac_str(GR_DONT_AUDIT, GR_RENAME_ACL_MSG, old_dentry, old_mnt, newname); ++ gr_log_fs_rbac_str(GR_DONT_AUDIT, GR_RENAME_ACL_MSG, old_dentry, old_mnt, newname->name); + error = -EACCES; + } else if (unlikely(!RENAME_CHECK_SUCCESS(comp1, comp2))) + error = -EACCES; @@ -55324,7 +61881,6 @@ index 0000000..88d0e87 +{ + u16 id; + char *rolename; -+ struct file *exec_file; + + if (unlikely(current->acl_sp_role && gr_acl_is_enabled() && + !(current->role->roletype & GR_ROLE_PERSIST))) { @@ -55334,13 +61890,8 @@ index 0000000..88d0e87 + gr_log_str_int(GR_DONT_AUDIT_GOOD, GR_SPROLEL_ACL_MSG, rolename, id); + } + -+ write_lock(&grsec_exec_file_lock); -+ exec_file = current->exec_file; -+ current->exec_file = NULL; -+ write_unlock(&grsec_exec_file_lock); -+ -+ if (exec_file) -+ fput(exec_file); ++ gr_put_exec_file(current); ++ return; +} + +int @@ -55356,10 +61907,10 @@ index 0000000..88d0e87 +} diff --git a/grsecurity/gracl_ip.c b/grsecurity/gracl_ip.c new file mode 100644 -index 0000000..58800a7 +index 0000000..8132048 --- /dev/null +++ b/grsecurity/gracl_ip.c -@@ -0,0 +1,384 @@ +@@ -0,0 +1,387 @@ +#include <linux/kernel.h> +#include <asm/uaccess.h> +#include <asm/errno.h> @@ -55466,7 +62017,7 @@ index 0000000..58800a7 + + curr = current->acl; + -+ if (curr->sock_families[domain / 32] & (1 << (domain % 32))) { ++ if (curr->sock_families[domain / 32] & (1U << (domain % 32))) { + /* the family is allowed, if this is PF_INET allow it only if + the extra sock type/protocol checks pass */ + if (domain == PF_INET) @@ -55476,8 +62027,8 @@ index 0000000..58800a7 + if (curr->mode & (GR_LEARN | GR_INHERITLEARN)) { + __u32 fakeip = 0; + security_learn(GR_IP_LEARN_MSG, current->role->rolename, -+ current->role->roletype, cred->uid, -+ cred->gid, current->exec_file ? ++ current->role->roletype, GR_GLOBAL_UID(cred->uid), ++ GR_GLOBAL_GID(cred->gid), current->exec_file ? + gr_to_filename(current->exec_file->f_path.dentry, + current->exec_file->f_path.mnt) : + curr->filename, curr->filename, @@ -55493,8 +62044,8 @@ index 0000000..58800a7 + if (!curr->ips) + goto exit; + -+ if ((curr->ip_type & (1 << type)) && -+ (curr->ip_proto[protocol / 32] & (1 << (protocol % 32)))) ++ if ((curr->ip_type & (1U << type)) && ++ (curr->ip_proto[protocol / 32] & (1U << (protocol % 32)))) + goto exit; + + if (curr->mode & (GR_LEARN | GR_INHERITLEARN)) { @@ -55504,8 +62055,8 @@ index 0000000..58800a7 + if (type == SOCK_RAW || type == SOCK_PACKET) { + __u32 fakeip = 0; + security_learn(GR_IP_LEARN_MSG, current->role->rolename, -+ current->role->roletype, cred->uid, -+ cred->gid, current->exec_file ? ++ current->role->roletype, GR_GLOBAL_UID(cred->uid), ++ GR_GLOBAL_GID(cred->gid), current->exec_file ? + gr_to_filename(current->exec_file->f_path.dentry, + current->exec_file->f_path.mnt) : + curr->filename, curr->filename, @@ -55514,8 +62065,8 @@ index 0000000..58800a7 + } else if ((type == SOCK_DGRAM) && (protocol == IPPROTO_IP)) { + __u32 fakeip = 0; + security_learn(GR_IP_LEARN_MSG, current->role->rolename, -+ current->role->roletype, cred->uid, -+ cred->gid, current->exec_file ? ++ current->role->roletype, GR_GLOBAL_UID(cred->uid), ++ GR_GLOBAL_GID(cred->gid), current->exec_file ? + gr_to_filename(current->exec_file->f_path.dentry, + current->exec_file->f_path.mnt) : + curr->filename, curr->filename, @@ -55531,6 +62082,9 @@ index 0000000..58800a7 + gr_log_str3(GR_DONT_AUDIT, GR_SOCK_MSG, gr_sockfamily_to_name(domain), + gr_socktype_to_name(type), gr_proto_to_name(protocol)); + else ++#ifndef CONFIG_IPV6 ++ if (domain != PF_INET6) ++#endif + gr_log_str2_int(GR_DONT_AUDIT, GR_SOCK_NOINET_MSG, gr_sockfamily_to_name(domain), + gr_socktype_to_name(type), protocol); + @@ -55546,8 +62100,8 @@ index 0000000..58800a7 + (ip_port <= ip->high) && + ((ntohl(ip_addr) & our_netmask) == + (ntohl(our_addr) & our_netmask)) -+ && (ip->proto[protocol / 32] & (1 << (protocol % 32))) -+ && (ip->type & (1 << type))) { ++ && (ip->proto[protocol / 32] & (1U << (protocol % 32))) ++ && (ip->type & (1U << type))) { + if (ip->mode & GR_INVERT) + return 2; // specifically denied + else @@ -55611,8 +62165,8 @@ index 0000000..58800a7 + + if (curr->mode & (GR_LEARN | GR_INHERITLEARN)) { + security_learn(GR_IP_LEARN_MSG, current->role->rolename, -+ current->role->roletype, cred->uid, -+ cred->gid, current->exec_file ? ++ current->role->roletype, GR_GLOBAL_UID(cred->uid), ++ GR_GLOBAL_GID(cred->gid), current->exec_file ? + gr_to_filename(current->exec_file->f_path.dentry, + current->exec_file->f_path.mnt) : + curr->filename, curr->filename, @@ -56033,10 +62587,10 @@ index 0000000..39645c9 +} diff --git a/grsecurity/gracl_segv.c b/grsecurity/gracl_segv.c new file mode 100644 -index 0000000..5556be3 +index 0000000..4dcc92a --- /dev/null +++ b/grsecurity/gracl_segv.c -@@ -0,0 +1,299 @@ +@@ -0,0 +1,305 @@ +#include <linux/kernel.h> +#include <linux/mm.h> +#include <asm/uaccess.h> @@ -56054,6 +62608,13 @@ index 0000000..5556be3 +#include <linux/gracl.h> +#include <linux/grsecurity.h> +#include <linux/grinternal.h> ++#if defined(CONFIG_BTRFS_FS) || defined(CONFIG_BTRFS_FS_MODULE) ++#include <linux/magic.h> ++#include <linux/pagemap.h> ++#include "../fs/btrfs/async-thread.h" ++#include "../fs/btrfs/ctree.h" ++#include "../fs/btrfs/btrfs_inode.h" ++#endif + +static struct crash_uid *uid_set; +static unsigned short uid_used; @@ -56063,19 +62624,14 @@ index 0000000..5556be3 + lookup_acl_subj_label(const ino_t inode, const dev_t dev, + struct acl_role_label *role); + -+#ifdef CONFIG_BTRFS_FS -+extern dev_t get_btrfs_dev_from_inode(struct inode *inode); -+extern int btrfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); -+#endif -+ +static inline dev_t __get_dev(const struct dentry *dentry) +{ -+#ifdef CONFIG_BTRFS_FS -+ if (dentry->d_inode->i_op && dentry->d_inode->i_op->getattr == &btrfs_getattr) -+ return get_btrfs_dev_from_inode(dentry->d_inode); ++#if defined(CONFIG_BTRFS_FS) || defined(CONFIG_BTRFS_FS_MODULE) ++ if (dentry->d_sb->s_magic == BTRFS_SUPER_MAGIC) ++ return BTRFS_I(dentry->d_inode)->root->anon_dev; + else +#endif -+ return dentry->d_inode->i_sb->s_dev; ++ return dentry->d_sb->s_dev; +} + +int @@ -56138,9 +62694,10 @@ index 0000000..5556be3 +} + +static __inline__ void -+gr_insert_uid(const uid_t uid, const unsigned long expires) ++gr_insert_uid(const kuid_t kuid, const unsigned long expires) +{ + int loc; ++ uid_t uid = GR_GLOBAL_UID(kuid); + + if (uid_used == GR_UIDTABLE_MAX) + return; @@ -56175,14 +62732,17 @@ index 0000000..5556be3 +} + +int -+gr_check_crash_uid(const uid_t uid) ++gr_check_crash_uid(const kuid_t kuid) +{ + int loc; + int ret = 0; ++ uid_t uid; + + if (unlikely(!gr_acl_is_enabled())) + return 0; + ++ uid = GR_GLOBAL_UID(kuid); ++ + spin_lock(&gr_uid_lock); + loc = gr_find_uid(uid); + @@ -56202,11 +62762,11 @@ index 0000000..5556be3 +static __inline__ int +proc_is_setxid(const struct cred *cred) +{ -+ if (cred->uid != cred->euid || cred->uid != cred->suid || -+ cred->uid != cred->fsuid) ++ if (!uid_eq(cred->uid, cred->euid) || !uid_eq(cred->uid, cred->suid) || ++ !uid_eq(cred->uid, cred->fsuid)) + return 1; -+ if (cred->gid != cred->egid || cred->gid != cred->sgid || -+ cred->gid != cred->fsgid) ++ if (!gid_eq(cred->gid, cred->egid) || !gid_eq(cred->gid, cred->sgid) || ++ !gid_eq(cred->gid, cred->fsgid)) + return 1; + + return 0; @@ -56230,7 +62790,7 @@ index 0000000..5556be3 + + curr = task->acl; + -+ if (!(curr->resmask & (1 << GR_CRASH_RES))) ++ if (!(curr->resmask & (1U << GR_CRASH_RES))) + return; + + if (time_before_eq(curr->expires, get_seconds())) { @@ -56247,7 +62807,7 @@ index 0000000..5556be3 + time_after(curr->expires, get_seconds())) { + rcu_read_lock(); + cred = __task_cred(task); -+ if (cred->uid && proc_is_setxid(cred)) { ++ if (gr_is_global_nonroot(cred->uid) && proc_is_setxid(cred)) { + gr_log_crash1(GR_DONT_AUDIT, GR_SEGVSTART_ACL_MSG, task, curr->res[GR_CRASH_RES].rlim_max); + spin_lock(&gr_uid_lock); + gr_insert_uid(cred->uid, curr->expires); @@ -56257,7 +62817,7 @@ index 0000000..5556be3 + read_lock(&tasklist_lock); + do_each_thread(tsk2, tsk) { + cred2 = __task_cred(tsk); -+ if (tsk != task && cred2->uid == cred->uid) ++ if (tsk != task && uid_eq(cred2->uid, cred->uid)) + gr_fake_force_sig(SIGKILL, tsk); + } while_each_thread(tsk2, tsk); + read_unlock(&tasklist_lock); @@ -56296,7 +62856,7 @@ index 0000000..5556be3 + current->role); + read_unlock(&gr_inode_lock); + -+ if (!curr || !(curr->resmask & (1 << GR_CRASH_RES)) || ++ if (!curr || !(curr->resmask & (1U << GR_CRASH_RES)) || + (!curr->crashes && !curr->expires)) + return 0; + @@ -56338,7 +62898,7 @@ index 0000000..5556be3 +} diff --git a/grsecurity/gracl_shm.c b/grsecurity/gracl_shm.c new file mode 100644 -index 0000000..9d83a69 +index 0000000..98011b0 --- /dev/null +++ b/grsecurity/gracl_shm.c @@ -0,0 +1,40 @@ @@ -56353,7 +62913,7 @@ index 0000000..9d83a69 + +int +gr_handle_shmat(const pid_t shm_cprid, const pid_t shm_lapid, -+ const time_t shm_createtime, const uid_t cuid, const int shmid) ++ const time_t shm_createtime, const kuid_t cuid, const int shmid) +{ + struct task_struct *task; + @@ -56369,12 +62929,12 @@ index 0000000..9d83a69 + task = find_task_by_vpid(shm_lapid); + + if (unlikely(task && (time_before_eq((unsigned long)task->start_time.tv_sec, (unsigned long)shm_createtime) || -+ (task->pid == shm_lapid)) && ++ (task_pid_nr(task) == shm_lapid)) && + (task->acl->mode & GR_PROTSHM) && + (task->acl != current->acl))) { + read_unlock(&tasklist_lock); + rcu_read_unlock(); -+ gr_log_int3(GR_DONT_AUDIT, GR_SHMAT_ACL_MSG, cuid, shm_cprid, shmid); ++ gr_log_int3(GR_DONT_AUDIT, GR_SHMAT_ACL_MSG, GR_GLOBAL_UID(cuid), shm_cprid, shmid); + return 0; + } + read_unlock(&tasklist_lock); @@ -56409,10 +62969,10 @@ index 0000000..bc0be01 +} diff --git a/grsecurity/grsec_chroot.c b/grsecurity/grsec_chroot.c new file mode 100644 -index 0000000..9807ee2 +index 0000000..bd6e105 --- /dev/null +++ b/grsecurity/grsec_chroot.c -@@ -0,0 +1,368 @@ +@@ -0,0 +1,370 @@ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/sched.h> @@ -56424,14 +62984,27 @@ index 0000000..9807ee2 +#include <linux/grsecurity.h> +#include <linux/grinternal.h> + -+void gr_set_chroot_entries(struct task_struct *task, struct path *path) ++#ifdef CONFIG_GRKERNSEC_CHROOT_INITRD ++static int gr_init_ran; ++#endif ++ ++void gr_set_chroot_entries(struct task_struct *task, const struct path *path) +{ +#ifdef CONFIG_GRKERNSEC -+ if (task->pid > 1 && path->dentry != init_task.fs->root.dentry && -+ path->dentry != task->nsproxy->mnt_ns->root->mnt.mnt_root) ++ if (task_pid_nr(task) > 1 && path->dentry != init_task.fs->root.dentry && ++ path->dentry != task->nsproxy->mnt_ns->root->mnt.mnt_root ++#ifdef CONFIG_GRKERNSEC_CHROOT_INITRD ++ && gr_init_ran ++#endif ++ ) + task->gr_is_chrooted = 1; -+ else ++ else { ++#ifdef CONFIG_GRKERNSEC_CHROOT_INITRD ++ if (task_pid_nr(task) == 1 && !gr_init_ran) ++ gr_init_ran = 1; ++#endif + task->gr_is_chrooted = 0; ++ } + + task->gr_chroot_dentry = path->dentry; +#endif @@ -56492,7 +63065,7 @@ index 0000000..9807ee2 +#ifdef CONFIG_GRKERNSEC_CHROOT_NICE + if (grsec_enable_chroot_nice && (niceval < task_nice(p)) + && proc_is_chrooted(current)) { -+ gr_log_str_int(GR_DONT_AUDIT, GR_PRIORITY_CHROOT_MSG, p->comm, p->pid); ++ gr_log_str_int(GR_DONT_AUDIT, GR_PRIORITY_CHROOT_MSG, p->comm, task_pid_nr(p)); + return -EACCES; + } +#endif @@ -56500,17 +63073,6 @@ index 0000000..9807ee2 +} + +int -+gr_handle_chroot_rawio(const struct inode *inode) -+{ -+#ifdef CONFIG_GRKERNSEC_CHROOT_CAPS -+ if (grsec_enable_chroot_caps && proc_is_chrooted(current) && -+ inode && S_ISBLK(inode->i_mode) && !capable(CAP_SYS_RAWIO)) -+ return 1; -+#endif -+ return 0; -+} -+ -+int +gr_handle_chroot_fowner(struct pid *pid, enum pid_type type) +{ +#ifdef CONFIG_GRKERNSEC_CHROOT_FINDTASK @@ -56757,7 +63319,7 @@ index 0000000..9807ee2 +} + +void -+gr_handle_chroot_chdir(struct path *path) ++gr_handle_chroot_chdir(const struct path *path) +{ +#ifdef CONFIG_GRKERNSEC_CHROOT_CHDIR + if (grsec_enable_chroot_chdir) @@ -56783,10 +63345,10 @@ index 0000000..9807ee2 +} diff --git a/grsecurity/grsec_disabled.c b/grsecurity/grsec_disabled.c new file mode 100644 -index 0000000..213ad8b +index 0000000..ce65ceb --- /dev/null +++ b/grsecurity/grsec_disabled.c -@@ -0,0 +1,437 @@ +@@ -0,0 +1,434 @@ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/sched.h> @@ -56858,13 +63420,6 @@ index 0000000..213ad8b + return 0; +} + -+void -+gr_learn_resource(const struct task_struct *task, -+ const int res, const unsigned long wanted, const int gt) -+{ -+ return; -+} -+ +int +gr_set_acls(const int type) +{ @@ -56933,7 +63488,7 @@ index 0000000..213ad8b +} + +int -+gr_check_crash_uid(const uid_t uid) ++gr_check_crash_uid(const kuid_t uid) +{ + return 0; +} @@ -57075,7 +63630,7 @@ index 0000000..213ad8b +__u32 +gr_acl_handle_symlink(const struct dentry * new_dentry, + const struct dentry * parent_dentry, -+ const struct vfsmount * parent_mnt, const char *from) ++ const struct vfsmount * parent_mnt, const struct filename *from) +{ + return 1; +} @@ -57085,7 +63640,7 @@ index 0000000..213ad8b + const struct dentry * parent_dentry, + const struct vfsmount * parent_mnt, + const struct dentry * old_dentry, -+ const struct vfsmount * old_mnt, const char *to) ++ const struct vfsmount * old_mnt, const struct filename *to) +{ + return 1; +} @@ -57096,7 +63651,7 @@ index 0000000..213ad8b + const struct vfsmount *parent_mnt, + const struct dentry *old_dentry, + const struct inode *old_parent_inode, -+ const struct vfsmount *old_mnt, const char *newname) ++ const struct vfsmount *old_mnt, const struct filename *newname) +{ + return 0; +} @@ -57110,7 +63665,7 @@ index 0000000..213ad8b + +int +gr_handle_shmat(const pid_t shm_cprid, const pid_t shm_lapid, -+ const time_t shm_createtime, const uid_t cuid, const int shmid) ++ const time_t shm_createtime, const kuid_t cuid, const int shmid) +{ + return 1; +} @@ -57167,7 +63722,7 @@ index 0000000..213ad8b +} + +void -+gr_set_role_label(const uid_t uid, const gid_t gid) ++gr_set_role_label(const kuid_t uid, const kgid_t gid) +{ + return; +} @@ -57197,13 +63752,13 @@ index 0000000..213ad8b +} + +int -+gr_check_user_change(int real, int effective, int fs) ++gr_check_user_change(kuid_t real, kuid_t effective, kuid_t fs) +{ + return 0; +} + +int -+gr_check_group_change(int real, int effective, int fs) ++gr_check_group_change(kgid_t real, kgid_t effective, kgid_t fs) +{ + return 0; +} @@ -57215,10 +63770,14 @@ index 0000000..213ad8b + +dev_t gr_get_dev_from_dentry(struct dentry *dentry) +{ -+ return dentry->d_inode->i_sb->s_dev; ++ return dentry->d_sb->s_dev; ++} ++ ++void gr_put_exec_file(struct task_struct *task) ++{ ++ return; +} + -+EXPORT_SYMBOL(gr_learn_resource); +EXPORT_SYMBOL(gr_set_kernel_label); +#ifdef CONFIG_SECURITY +EXPORT_SYMBOL(gr_check_user_change); @@ -57226,10 +63785,10 @@ index 0000000..213ad8b +#endif diff --git a/grsecurity/grsec_exec.c b/grsecurity/grsec_exec.c new file mode 100644 -index 0000000..abfa971 +index 0000000..387032b --- /dev/null +++ b/grsecurity/grsec_exec.c -@@ -0,0 +1,174 @@ +@@ -0,0 +1,187 @@ +#include <linux/kernel.h> +#include <linux/sched.h> +#include <linux/file.h> @@ -57241,6 +63800,7 @@ index 0000000..abfa971 +#include <linux/grinternal.h> +#include <linux/capability.h> +#include <linux/module.h> ++#include <linux/compat.h> + +#include <asm/uaccess.h> + @@ -57249,6 +63809,18 @@ index 0000000..abfa971 +static DEFINE_MUTEX(gr_exec_arg_mutex); +#endif + ++struct user_arg_ptr { ++#ifdef CONFIG_COMPAT ++ bool is_compat; ++#endif ++ union { ++ const char __user *const __user *native; ++#ifdef CONFIG_COMPAT ++ const compat_uptr_t __user *compat; ++#endif ++ } ptr; ++}; ++ +extern const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr); + +void @@ -57406,7 +63978,7 @@ index 0000000..abfa971 +EXPORT_SYMBOL(gr_task_is_capable_nolog); diff --git a/grsecurity/grsec_fifo.c b/grsecurity/grsec_fifo.c new file mode 100644 -index 0000000..d3ee748 +index 0000000..06cc6ea --- /dev/null +++ b/grsecurity/grsec_fifo.c @@ -0,0 +1,24 @@ @@ -57425,10 +63997,10 @@ index 0000000..d3ee748 + + if (grsec_enable_fifo && S_ISFIFO(dentry->d_inode->i_mode) && + !(flag & O_EXCL) && (dir->d_inode->i_mode & S_ISVTX) && -+ (dentry->d_inode->i_uid != dir->d_inode->i_uid) && -+ (cred->fsuid != dentry->d_inode->i_uid)) { ++ !uid_eq(dentry->d_inode->i_uid, dir->d_inode->i_uid) && ++ !uid_eq(cred->fsuid, dentry->d_inode->i_uid)) { + if (!inode_permission(dentry->d_inode, acc_mode)) -+ gr_log_fs_int2(GR_DONT_AUDIT, GR_FIFO_MSG, dentry, mnt, dentry->d_inode->i_uid, dentry->d_inode->i_gid); ++ gr_log_fs_int2(GR_DONT_AUDIT, GR_FIFO_MSG, dentry, mnt, GR_GLOBAL_UID(dentry->d_inode->i_uid), GR_GLOBAL_GID(dentry->d_inode->i_gid)); + return -EACCES; + } +#endif @@ -57465,7 +64037,7 @@ index 0000000..8ca18bf +} diff --git a/grsecurity/grsec_init.c b/grsecurity/grsec_init.c new file mode 100644 -index 0000000..05a6015 +index 0000000..a862e9f --- /dev/null +++ b/grsecurity/grsec_init.c @@ -0,0 +1,283 @@ @@ -57481,7 +64053,7 @@ index 0000000..05a6015 +int grsec_enable_ptrace_readexec; +int grsec_enable_setxid; +int grsec_enable_symlinkown; -+int grsec_symlinkown_gid; ++kgid_t grsec_symlinkown_gid; +int grsec_enable_brute; +int grsec_enable_link; +int grsec_enable_dmesg; @@ -57494,7 +64066,7 @@ index 0000000..05a6015 +int grsec_enable_time; +int grsec_enable_audit_textrel; +int grsec_enable_group; -+int grsec_audit_gid; ++kgid_t grsec_audit_gid; +int grsec_enable_chdir; +int grsec_enable_mount; +int grsec_enable_rofs; @@ -57513,7 +64085,7 @@ index 0000000..05a6015 +int grsec_enable_chroot_sysctl; +int grsec_enable_chroot_unix; +int grsec_enable_tpe; -+int grsec_tpe_gid; ++kgid_t grsec_tpe_gid; +int grsec_enable_blackhole; +#ifdef CONFIG_IPV6_MODULE +EXPORT_SYMBOL(grsec_enable_blackhole); @@ -57522,11 +64094,11 @@ index 0000000..05a6015 +int grsec_enable_tpe_all; +int grsec_enable_tpe_invert; +int grsec_enable_socket_all; -+int grsec_socket_all_gid; ++kgid_t grsec_socket_all_gid; +int grsec_enable_socket_client; -+int grsec_socket_client_gid; ++kgid_t grsec_socket_client_gid; +int grsec_enable_socket_server; -+int grsec_socket_server_gid; ++kgid_t grsec_socket_server_gid; +int grsec_resource_logging; +int grsec_disable_privio; +int grsec_enable_log_rwxmaps; @@ -57632,7 +64204,7 @@ index 0000000..05a6015 +#endif +#ifdef CONFIG_GRKERNSEC_AUDIT_GROUP + grsec_enable_group = 1; -+ grsec_audit_gid = CONFIG_GRKERNSEC_AUDIT_GID; ++ grsec_audit_gid = KGIDT_INIT(CONFIG_GRKERNSEC_AUDIT_GID); +#endif +#ifdef CONFIG_GRKERNSEC_PTRACE_READEXEC + grsec_enable_ptrace_readexec = 1; @@ -57727,26 +64299,26 @@ index 0000000..05a6015 +#endif +#ifdef CONFIG_GRKERNSEC_SYMLINKOWN + grsec_enable_symlinkown = 1; -+ grsec_symlinkown_gid = CONFIG_GRKERNSEC_SYMLINKOWN_GID; ++ grsec_symlinkown_gid = KGIDT_INIT(CONFIG_GRKERNSEC_SYMLINKOWN_GID); +#endif +#ifdef CONFIG_GRKERNSEC_TPE + grsec_enable_tpe = 1; -+ grsec_tpe_gid = CONFIG_GRKERNSEC_TPE_GID; ++ grsec_tpe_gid = KGIDT_INIT(CONFIG_GRKERNSEC_TPE_GID); +#ifdef CONFIG_GRKERNSEC_TPE_ALL + grsec_enable_tpe_all = 1; +#endif +#endif +#ifdef CONFIG_GRKERNSEC_SOCKET_ALL + grsec_enable_socket_all = 1; -+ grsec_socket_all_gid = CONFIG_GRKERNSEC_SOCKET_ALL_GID; ++ grsec_socket_all_gid = KGIDT_INIT(CONFIG_GRKERNSEC_SOCKET_ALL_GID); +#endif +#ifdef CONFIG_GRKERNSEC_SOCKET_CLIENT + grsec_enable_socket_client = 1; -+ grsec_socket_client_gid = CONFIG_GRKERNSEC_SOCKET_CLIENT_GID; ++ grsec_socket_client_gid = KGIDT_INIT(CONFIG_GRKERNSEC_SOCKET_CLIENT_GID); +#endif +#ifdef CONFIG_GRKERNSEC_SOCKET_SERVER + grsec_enable_socket_server = 1; -+ grsec_socket_server_gid = CONFIG_GRKERNSEC_SOCKET_SERVER_GID; ++ grsec_socket_server_gid = KGIDT_INIT(CONFIG_GRKERNSEC_SOCKET_SERVER_GID); +#endif +#endif + @@ -57754,10 +64326,10 @@ index 0000000..05a6015 +} diff --git a/grsecurity/grsec_link.c b/grsecurity/grsec_link.c new file mode 100644 -index 0000000..35a96d1 +index 0000000..5e05e20 --- /dev/null +++ b/grsecurity/grsec_link.c -@@ -0,0 +1,59 @@ +@@ -0,0 +1,58 @@ +#include <linux/kernel.h> +#include <linux/sched.h> +#include <linux/fs.h> @@ -57771,8 +64343,8 @@ index 0000000..35a96d1 + + if (grsec_enable_symlinkown && in_group_p(grsec_symlinkown_gid) && + /* ignore root-owned links, e.g. /proc/self */ -+ link_inode->i_uid && -+ link_inode->i_uid != target->i_uid) { ++ gr_is_global_nonroot(link_inode->i_uid) && target && ++ !uid_eq(link_inode->i_uid, target->i_uid)) { + gr_log_fs_int2(GR_DONT_AUDIT, GR_SYMLINKOWNER_MSG, link->dentry, link->mnt, link_inode->i_uid, target->i_uid); + return 1; + } @@ -57789,8 +64361,8 @@ index 0000000..35a96d1 + const struct cred *cred = current_cred(); + + if (grsec_enable_link && S_ISLNK(inode->i_mode) && -+ (parent->i_mode & S_ISVTX) && (parent->i_uid != inode->i_uid) && -+ (parent->i_mode & S_IWOTH) && (cred->fsuid != inode->i_uid)) { ++ (parent->i_mode & S_ISVTX) && !uid_eq(parent->i_uid, inode->i_uid) && ++ (parent->i_mode & S_IWOTH) && !uid_eq(cred->fsuid, inode->i_uid)) { + gr_log_fs_int2(GR_DONT_AUDIT, GR_SYMLINK_MSG, dentry, mnt, inode->i_uid, inode->i_gid); + return -EACCES; + } @@ -57801,17 +64373,16 @@ index 0000000..35a96d1 +int +gr_handle_hardlink(const struct dentry *dentry, + const struct vfsmount *mnt, -+ struct inode *inode, const int mode, const char *to) ++ struct inode *inode, const int mode, const struct filename *to) +{ +#ifdef CONFIG_GRKERNSEC_LINK + const struct cred *cred = current_cred(); + -+ if (grsec_enable_link && cred->fsuid != inode->i_uid && -+ (!S_ISREG(mode) || (mode & S_ISUID) || -+ ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) || ++ if (grsec_enable_link && !uid_eq(cred->fsuid, inode->i_uid) && ++ (!S_ISREG(mode) || is_privileged_binary(dentry) || + (inode_permission(inode, MAY_READ | MAY_WRITE))) && -+ !capable(CAP_FOWNER) && cred->uid) { -+ gr_log_fs_int2_str(GR_DONT_AUDIT, GR_HARDLINK_MSG, dentry, mnt, inode->i_uid, inode->i_gid, to); ++ !capable(CAP_FOWNER) && gr_is_global_nonroot(cred->uid)) { ++ gr_log_fs_int2_str(GR_DONT_AUDIT, GR_HARDLINK_MSG, dentry, mnt, inode->i_uid, inode->i_gid, to->name); + return -EPERM; + } +#endif @@ -57819,10 +64390,10 @@ index 0000000..35a96d1 +} diff --git a/grsecurity/grsec_log.c b/grsecurity/grsec_log.c new file mode 100644 -index 0000000..a45d2e9 +index 0000000..7c06085 --- /dev/null +++ b/grsecurity/grsec_log.c -@@ -0,0 +1,322 @@ +@@ -0,0 +1,326 @@ +#include <linux/kernel.h> +#include <linux/sched.h> +#include <linux/file.h> @@ -57947,10 +64518,14 @@ index 0000000..a45d2e9 +static void gr_log_end(int audit, int append_default) +{ + char *buf = (audit == GR_DO_AUDIT) ? gr_audit_log_buf : gr_alert_log_buf; -+ + if (append_default) { ++ struct task_struct *task = current; ++ struct task_struct *parent = task->real_parent; ++ const struct cred *cred = __task_cred(task); ++ const struct cred *pcred = __task_cred(parent); + unsigned int len = strlen(buf); -+ snprintf(buf + len, PAGE_SIZE - len - 1, DEFAULTSECMSG, DEFAULTSECARGS(current, current_cred(), __task_cred(current->real_parent))); ++ ++ snprintf(buf + len, PAGE_SIZE - len - 1, DEFAULTSECMSG, gr_task_fullpath(task), task->comm, task_pid_nr(task), GR_GLOBAL_UID(cred->uid), GR_GLOBAL_UID(cred->euid), GR_GLOBAL_GID(cred->gid), GR_GLOBAL_GID(cred->egid), gr_parent_task_fullpath(task), parent->comm, task_pid_nr(task->real_parent), GR_GLOBAL_UID(pcred->uid), GR_GLOBAL_UID(pcred->euid), GR_GLOBAL_GID(pcred->gid), GR_GLOBAL_GID(pcred->egid)); + } + + printk("%s\n", buf); @@ -57983,7 +64558,7 @@ index 0000000..a45d2e9 + switch (argtypes) { + case GR_TTYSNIFF: + task = va_arg(ap, struct task_struct *); -+ gr_log_middle_varargs(audit, msg, &task->signal->curr_ip, gr_task_fullpath0(task), task->comm, task->pid, gr_parent_task_fullpath0(task), task->real_parent->comm, task->real_parent->pid); ++ gr_log_middle_varargs(audit, msg, &task->signal->curr_ip, gr_task_fullpath0(task), task->comm, task_pid_nr(task), gr_parent_task_fullpath0(task), task->real_parent->comm, task_pid_nr(task->real_parent)); + break; + case GR_SYSCTL_HIDDEN: + str1 = va_arg(ap, char *); @@ -58061,7 +64636,7 @@ index 0000000..a45d2e9 + break; + case GR_PTRACE: + task = va_arg(ap, struct task_struct *); -+ gr_log_middle_varargs(audit, msg, task->exec_file ? gr_to_filename(task->exec_file->f_path.dentry, task->exec_file->f_path.mnt) : "(none)", task->comm, task->pid); ++ gr_log_middle_varargs(audit, msg, task->exec_file ? gr_to_filename(task->exec_file->f_path.dentry, task->exec_file->f_path.mnt) : "(none)", task->comm, task_pid_nr(task)); + break; + case GR_RESOURCE: + task = va_arg(ap, struct task_struct *); @@ -58070,14 +64645,14 @@ index 0000000..a45d2e9 + ulong1 = va_arg(ap, unsigned long); + str1 = va_arg(ap, char *); + ulong2 = va_arg(ap, unsigned long); -+ gr_log_middle_varargs(audit, msg, ulong1, str1, ulong2, gr_task_fullpath(task), task->comm, task->pid, cred->uid, cred->euid, cred->gid, cred->egid, gr_parent_task_fullpath(task), task->real_parent->comm, task->real_parent->pid, pcred->uid, pcred->euid, pcred->gid, pcred->egid); ++ gr_log_middle_varargs(audit, msg, ulong1, str1, ulong2, gr_task_fullpath(task), task->comm, task_pid_nr(task), GR_GLOBAL_UID(cred->uid), GR_GLOBAL_UID(cred->euid), GR_GLOBAL_GID(cred->gid), GR_GLOBAL_GID(cred->egid), gr_parent_task_fullpath(task), task->real_parent->comm, task_pid_nr(task->real_parent), GR_GLOBAL_UID(pcred->uid), GR_GLOBAL_UID(pcred->euid), GR_GLOBAL_GID(pcred->gid), GR_GLOBAL_GID(pcred->egid)); + break; + case GR_CAP: + task = va_arg(ap, struct task_struct *); + cred = __task_cred(task); + pcred = __task_cred(task->real_parent); + str1 = va_arg(ap, char *); -+ gr_log_middle_varargs(audit, msg, str1, gr_task_fullpath(task), task->comm, task->pid, cred->uid, cred->euid, cred->gid, cred->egid, gr_parent_task_fullpath(task), task->real_parent->comm, task->real_parent->pid, pcred->uid, pcred->euid, pcred->gid, pcred->egid); ++ gr_log_middle_varargs(audit, msg, str1, gr_task_fullpath(task), task->comm, task_pid_nr(task), GR_GLOBAL_UID(cred->uid), GR_GLOBAL_UID(cred->euid), GR_GLOBAL_GID(cred->gid), GR_GLOBAL_GID(cred->egid), gr_parent_task_fullpath(task), task->real_parent->comm, task_pid_nr(task->real_parent), GR_GLOBAL_UID(pcred->uid), GR_GLOBAL_UID(pcred->euid), GR_GLOBAL_GID(pcred->gid), GR_GLOBAL_GID(pcred->egid)); + break; + case GR_SIG: + str1 = va_arg(ap, char *); @@ -58089,21 +64664,21 @@ index 0000000..a45d2e9 + cred = __task_cred(task); + pcred = __task_cred(task->real_parent); + num1 = va_arg(ap, int); -+ gr_log_middle_varargs(audit, msg, num1, gr_task_fullpath0(task), task->comm, task->pid, cred->uid, cred->euid, cred->gid, cred->egid, gr_parent_task_fullpath0(task), task->real_parent->comm, task->real_parent->pid, pcred->uid, pcred->euid, pcred->gid, pcred->egid); ++ gr_log_middle_varargs(audit, msg, num1, gr_task_fullpath0(task), task->comm, task_pid_nr(task), GR_GLOBAL_UID(cred->uid), GR_GLOBAL_UID(cred->euid), GR_GLOBAL_GID(cred->gid), GR_GLOBAL_GID(cred->egid), gr_parent_task_fullpath0(task), task->real_parent->comm, task_pid_nr(task->real_parent), GR_GLOBAL_UID(pcred->uid), GR_GLOBAL_UID(pcred->euid), GR_GLOBAL_GID(pcred->gid), GR_GLOBAL_GID(pcred->egid)); + break; + case GR_CRASH1: + task = va_arg(ap, struct task_struct *); + cred = __task_cred(task); + pcred = __task_cred(task->real_parent); + ulong1 = va_arg(ap, unsigned long); -+ gr_log_middle_varargs(audit, msg, gr_task_fullpath(task), task->comm, task->pid, cred->uid, cred->euid, cred->gid, cred->egid, gr_parent_task_fullpath(task), task->real_parent->comm, task->real_parent->pid, pcred->uid, pcred->euid, pcred->gid, pcred->egid, cred->uid, ulong1); ++ gr_log_middle_varargs(audit, msg, gr_task_fullpath(task), task->comm, task_pid_nr(task), GR_GLOBAL_UID(cred->uid), GR_GLOBAL_UID(cred->euid), GR_GLOBAL_GID(cred->gid), GR_GLOBAL_GID(cred->egid), gr_parent_task_fullpath(task), task->real_parent->comm, task_pid_nr(task->real_parent), GR_GLOBAL_UID(pcred->uid), GR_GLOBAL_UID(pcred->euid), GR_GLOBAL_GID(pcred->gid), GR_GLOBAL_GID(pcred->egid), GR_GLOBAL_UID(cred->uid), ulong1); + break; + case GR_CRASH2: + task = va_arg(ap, struct task_struct *); + cred = __task_cred(task); + pcred = __task_cred(task->real_parent); + ulong1 = va_arg(ap, unsigned long); -+ gr_log_middle_varargs(audit, msg, gr_task_fullpath(task), task->comm, task->pid, cred->uid, cred->euid, cred->gid, cred->egid, gr_parent_task_fullpath(task), task->real_parent->comm, task->real_parent->pid, pcred->uid, pcred->euid, pcred->gid, pcred->egid, ulong1); ++ gr_log_middle_varargs(audit, msg, gr_task_fullpath(task), task->comm, task_pid_nr(task), GR_GLOBAL_UID(cred->uid), GR_GLOBAL_UID(cred->euid), GR_GLOBAL_GID(cred->gid), GR_GLOBAL_GID(cred->egid), gr_parent_task_fullpath(task), task->real_parent->comm, task_pid_nr(task->real_parent), GR_GLOBAL_UID(pcred->uid), GR_GLOBAL_UID(pcred->euid), GR_GLOBAL_GID(pcred->gid), GR_GLOBAL_GID(pcred->egid), ulong1); + break; + case GR_RWXMAP: + file = va_arg(ap, struct file *); @@ -58131,7 +64706,7 @@ index 0000000..a45d2e9 + cred = __task_cred(task); + pcred = __task_cred(task->real_parent); + -+ gr_log_middle_varargs(audit, msg, gr_task_fullpath(task), task->comm, task->pid, &task->signal->curr_ip, tty_name(task->signal->tty, cur_tty), cred->uid, cred->euid, cred->gid, cred->egid, wday, whr, wmin, wsec, cday, chr, cmin, csec, (task->flags & PF_SIGNALED) ? "killed by signal" : "exited", ulong1, gr_parent_task_fullpath(task), task->real_parent->comm, task->real_parent->pid, &task->real_parent->signal->curr_ip, tty_name(task->real_parent->signal->tty, parent_tty), pcred->uid, pcred->euid, pcred->gid, pcred->egid); ++ gr_log_middle_varargs(audit, msg, gr_task_fullpath(task), task->comm, task_pid_nr(task), &task->signal->curr_ip, tty_name(task->signal->tty, cur_tty), GR_GLOBAL_UID(cred->uid), GR_GLOBAL_UID(cred->euid), GR_GLOBAL_GID(cred->gid), GR_GLOBAL_GID(cred->egid), wday, whr, wmin, wsec, cday, chr, cmin, csec, (task->flags & PF_SIGNALED) ? "killed by signal" : "exited", ulong1, gr_parent_task_fullpath(task), task->real_parent->comm, task_pid_nr(task->real_parent), &task->real_parent->signal->curr_ip, tty_name(task->real_parent->signal->tty, parent_tty), GR_GLOBAL_UID(pcred->uid), GR_GLOBAL_UID(pcred->euid), GR_GLOBAL_GID(pcred->gid), GR_GLOBAL_GID(pcred->egid)); + } + break; + default: @@ -58339,10 +64914,10 @@ index 0000000..f7f29aa +} diff --git a/grsecurity/grsec_sig.c b/grsecurity/grsec_sig.c new file mode 100644 -index 0000000..7a5b2de +index 0000000..e09715a --- /dev/null +++ b/grsecurity/grsec_sig.c -@@ -0,0 +1,207 @@ +@@ -0,0 +1,222 @@ +#include <linux/kernel.h> +#include <linux/sched.h> +#include <linux/delay.h> @@ -58363,7 +64938,7 @@ index 0000000..7a5b2de +#ifdef CONFIG_GRKERNSEC_SIGNAL + if (grsec_enable_signal && ((sig == SIGSEGV) || (sig == SIGILL) || + (sig == SIGABRT) || (sig == SIGBUS))) { -+ if (t->pid == current->pid) { ++ if (task_pid_nr(t) == task_pid_nr(current)) { + gr_log_sig_addr(GR_DONT_AUDIT_GOOD, GR_UNISIGLOG_MSG, signames[sig], addr); + } else { + gr_log_sig_task(GR_DONT_AUDIT_GOOD, GR_DUALSIGLOG_MSG, t, sig); @@ -58378,7 +64953,7 @@ index 0000000..7a5b2de +{ +#ifdef CONFIG_GRKERNSEC + /* ignore the 0 signal for protected task checks */ -+ if (current->pid > 1 && sig && gr_check_protected_task(p)) { ++ if (task_pid_nr(current) > 1 && sig && gr_check_protected_task(p)) { + gr_log_sig_task(GR_DONT_AUDIT, GR_SIG_ACL_MSG, p, sig); + return -EPERM; + } else if (gr_pid_is_chrooted((struct task_struct *)p)) { @@ -58420,6 +64995,7 @@ index 0000000..7a5b2de + +#ifdef CONFIG_GRKERNSEC_BRUTE +#define GR_USER_BAN_TIME (15 * 60) ++#define GR_DAEMON_BRUTE_TIME (30 * 60) + +static int __get_dumpable(unsigned long mm_flags) +{ @@ -58430,10 +65006,12 @@ index 0000000..7a5b2de +} +#endif + -+void gr_handle_brute_attach(struct task_struct *p, unsigned long mm_flags) ++void gr_handle_brute_attach(unsigned long mm_flags) +{ +#ifdef CONFIG_GRKERNSEC_BRUTE -+ uid_t uid = 0; ++ struct task_struct *p = current; ++ kuid_t uid = GLOBAL_ROOT_UID; ++ int daemon = 0; + + if (!grsec_enable_brute) + return; @@ -58441,13 +65019,15 @@ index 0000000..7a5b2de + rcu_read_lock(); + read_lock(&tasklist_lock); + read_lock(&grsec_exec_file_lock); -+ if (p->real_parent && p->real_parent->exec_file == p->exec_file) ++ if (p->real_parent && p->real_parent->exec_file == p->exec_file) { ++ p->real_parent->brute_expires = get_seconds() + GR_DAEMON_BRUTE_TIME; + p->real_parent->brute = 1; -+ else { ++ daemon = 1; ++ } else { + const struct cred *cred = __task_cred(p), *cred2; + struct task_struct *tsk, *tsk2; + -+ if (!__get_dumpable(mm_flags) && cred->uid) { ++ if (!__get_dumpable(mm_flags) && gr_is_global_nonroot(cred->uid)) { + struct user_struct *user; + + uid = cred->uid; @@ -58463,7 +65043,7 @@ index 0000000..7a5b2de + + do_each_thread(tsk2, tsk) { + cred2 = __task_cred(tsk); -+ if (tsk != p && cred2->uid == uid) ++ if (tsk != p && uid_eq(cred2->uid, uid)) + gr_fake_force_sig(SIGKILL, tsk); + } while_each_thread(tsk2, tsk); + } @@ -58473,8 +65053,11 @@ index 0000000..7a5b2de + read_unlock(&tasklist_lock); + rcu_read_unlock(); + -+ if (uid) -+ printk(KERN_ALERT "grsec: bruteforce prevention initiated against uid %u, banning for %d minutes\n", uid, GR_USER_BAN_TIME / 60); ++ if (gr_is_global_nonroot(uid)) ++ printk(KERN_ALERT "grsec: bruteforce prevention initiated against uid %u, banning for %d minutes\n", ++ GR_GLOBAL_UID(uid), GR_USER_BAN_TIME / 60); ++ else if (daemon) ++ gr_log_noargs(GR_DONT_AUDIT, GR_BRUTE_DAEMON_MSG); + +#endif + return; @@ -58483,8 +65066,14 @@ index 0000000..7a5b2de +void gr_handle_brute_check(void) +{ +#ifdef CONFIG_GRKERNSEC_BRUTE -+ if (current->brute) -+ msleep(30 * 1000); ++ struct task_struct *p = current; ++ ++ if (unlikely(p->brute)) { ++ if (!grsec_enable_brute) ++ p->brute = 0; ++ else if (time_before(get_seconds(), p->brute_expires)) ++ msleep(30 * 1000); ++ } +#endif + return; +} @@ -58495,21 +65084,22 @@ index 0000000..7a5b2de + const struct cred *cred; + struct task_struct *tsk, *tsk2; + struct user_struct *user; -+ uid_t uid; ++ kuid_t uid; + + if (in_irq() || in_serving_softirq() || in_nmi()) + panic("grsec: halting the system due to suspicious kernel crash caused in interrupt context"); + + uid = current_uid(); + -+ if (uid == 0) ++ if (gr_is_global_root(uid)) + panic("grsec: halting the system due to suspicious kernel crash caused by root"); + else { + /* kill all the processes of this user, hold a reference + to their creds struct, and prevent them from creating + another process until system reset + */ -+ printk(KERN_ALERT "grsec: banning user with uid %u until system restart for suspicious kernel crash\n", uid); ++ printk(KERN_ALERT "grsec: banning user with uid %u until system restart for suspicious kernel crash\n", ++ GR_GLOBAL_UID(uid)); + /* we intentionally leak this ref */ + user = get_uid(current->cred->user); + if (user) { @@ -58520,7 +65110,7 @@ index 0000000..7a5b2de + read_lock(&tasklist_lock); + do_each_thread(tsk2, tsk) { + cred = __task_cred(tsk); -+ if (cred->uid == uid) ++ if (uid_eq(cred->uid, uid)) + gr_fake_force_sig(SIGKILL, tsk); + } while_each_thread(tsk2, tsk); + read_unlock(&tasklist_lock); @@ -59299,7 +65889,7 @@ index 0000000..0dc13c3 +EXPORT_SYMBOL(gr_log_timechange); diff --git a/grsecurity/grsec_tpe.c b/grsecurity/grsec_tpe.c new file mode 100644 -index 0000000..07e0dc0 +index 0000000..ee57dcf --- /dev/null +++ b/grsecurity/grsec_tpe.c @@ -0,0 +1,73 @@ @@ -59321,7 +65911,7 @@ index 0000000..07e0dc0 + char *msg2 = NULL; + + // never restrict root -+ if (!cred->uid) ++ if (gr_is_global_root(cred->uid)) + return 1; + + if (grsec_enable_tpe) { @@ -59342,7 +65932,7 @@ index 0000000..07e0dc0 + if (!msg) + goto next_check; + -+ if (inode->i_uid) ++ if (gr_is_global_nonroot(inode->i_uid)) + msg2 = "file in non-root-owned directory"; + else if (inode->i_mode & S_IWOTH) + msg2 = "file in world-writable directory"; @@ -59361,7 +65951,7 @@ index 0000000..07e0dc0 + if (!grsec_enable_tpe || !grsec_enable_tpe_all) + return 1; + -+ if (inode->i_uid && (inode->i_uid != cred->uid)) ++ if (gr_is_global_nonroot(inode->i_uid) && !uid_eq(inode->i_uid, cred->uid)) + msg = "directory not owned by user"; + else if (inode->i_mode & S_IWOTH) + msg = "file in world-writable directory"; @@ -59443,19 +66033,6 @@ index 0000000..9f7b1ac + + return retval; +} -diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h -index f1c8ca6..b5c1cc7 100644 ---- a/include/acpi/acpi_bus.h -+++ b/include/acpi/acpi_bus.h -@@ -107,7 +107,7 @@ struct acpi_device_ops { - acpi_op_bind bind; - acpi_op_unbind unbind; - acpi_op_notify notify; --}; -+} __no_const; - - #define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1 /* system AND device events */ - diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 77ff547..181834f 100644 --- a/include/asm-generic/4level-fixup.h @@ -59472,7 +66049,7 @@ index 77ff547..181834f 100644 #define pud_none(pud) 0 #define pud_bad(pud) 0 diff --git a/include/asm-generic/atomic-long.h b/include/asm-generic/atomic-long.h -index b7babf0..3ba8aee 100644 +index b7babf0..04ad282 100644 --- a/include/asm-generic/atomic-long.h +++ b/include/asm-generic/atomic-long.h @@ -22,6 +22,12 @@ @@ -59584,7 +66161,23 @@ index b7babf0..3ba8aee 100644 static inline int atomic_long_sub_and_test(long i, atomic_long_t *l) { atomic64_t *v = (atomic64_t *)l; -@@ -115,6 +175,15 @@ static inline long atomic_long_inc_return(atomic_long_t *l) +@@ -101,6 +161,15 @@ static inline long atomic_long_add_return(long i, atomic_long_t *l) + return (long)atomic64_add_return(i, v); + } + ++#ifdef CONFIG_PAX_REFCOUNT ++static inline long atomic_long_add_return_unchecked(long i, atomic_long_unchecked_t *l) ++{ ++ atomic64_unchecked_t *v = (atomic64_unchecked_t *)l; ++ ++ return (long)atomic64_add_return_unchecked(i, v); ++} ++#endif ++ + static inline long atomic_long_sub_return(long i, atomic_long_t *l) + { + atomic64_t *v = (atomic64_t *)l; +@@ -115,6 +184,15 @@ static inline long atomic_long_inc_return(atomic_long_t *l) return (long)atomic64_inc_return(v); } @@ -59600,7 +66193,7 @@ index b7babf0..3ba8aee 100644 static inline long atomic_long_dec_return(atomic_long_t *l) { atomic64_t *v = (atomic64_t *)l; -@@ -140,6 +209,12 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) +@@ -140,6 +218,12 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) typedef atomic_t atomic_long_t; @@ -59613,7 +66206,7 @@ index b7babf0..3ba8aee 100644 #define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i) static inline long atomic_long_read(atomic_long_t *l) { -@@ -148,6 +223,15 @@ static inline long atomic_long_read(atomic_long_t *l) +@@ -148,6 +232,15 @@ static inline long atomic_long_read(atomic_long_t *l) return (long)atomic_read(v); } @@ -59629,7 +66222,7 @@ index b7babf0..3ba8aee 100644 static inline void atomic_long_set(atomic_long_t *l, long i) { atomic_t *v = (atomic_t *)l; -@@ -155,6 +239,15 @@ static inline void atomic_long_set(atomic_long_t *l, long i) +@@ -155,6 +248,15 @@ static inline void atomic_long_set(atomic_long_t *l, long i) atomic_set(v, i); } @@ -59645,7 +66238,7 @@ index b7babf0..3ba8aee 100644 static inline void atomic_long_inc(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; -@@ -162,6 +255,15 @@ static inline void atomic_long_inc(atomic_long_t *l) +@@ -162,6 +264,15 @@ static inline void atomic_long_inc(atomic_long_t *l) atomic_inc(v); } @@ -59661,7 +66254,7 @@ index b7babf0..3ba8aee 100644 static inline void atomic_long_dec(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; -@@ -169,6 +271,15 @@ static inline void atomic_long_dec(atomic_long_t *l) +@@ -169,6 +280,15 @@ static inline void atomic_long_dec(atomic_long_t *l) atomic_dec(v); } @@ -59677,7 +66270,7 @@ index b7babf0..3ba8aee 100644 static inline void atomic_long_add(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; -@@ -176,6 +287,15 @@ static inline void atomic_long_add(long i, atomic_long_t *l) +@@ -176,6 +296,15 @@ static inline void atomic_long_add(long i, atomic_long_t *l) atomic_add(i, v); } @@ -59693,7 +66286,7 @@ index b7babf0..3ba8aee 100644 static inline void atomic_long_sub(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; -@@ -183,6 +303,15 @@ static inline void atomic_long_sub(long i, atomic_long_t *l) +@@ -183,6 +312,15 @@ static inline void atomic_long_sub(long i, atomic_long_t *l) atomic_sub(i, v); } @@ -59709,7 +66302,24 @@ index b7babf0..3ba8aee 100644 static inline int atomic_long_sub_and_test(long i, atomic_long_t *l) { atomic_t *v = (atomic_t *)l; -@@ -232,6 +361,15 @@ static inline long atomic_long_inc_return(atomic_long_t *l) +@@ -218,6 +356,16 @@ static inline long atomic_long_add_return(long i, atomic_long_t *l) + return (long)atomic_add_return(i, v); + } + ++#ifdef CONFIG_PAX_REFCOUNT ++static inline long atomic_long_add_return_unchecked(long i, atomic_long_unchecked_t *l) ++{ ++ atomic_unchecked_t *v = (atomic_unchecked_t *)l; ++ ++ return (long)atomic_add_return_unchecked(i, v); ++} ++ ++#endif ++ + static inline long atomic_long_sub_return(long i, atomic_long_t *l) + { + atomic_t *v = (atomic_t *)l; +@@ -232,6 +380,15 @@ static inline long atomic_long_inc_return(atomic_long_t *l) return (long)atomic_inc_return(v); } @@ -59725,7 +66335,7 @@ index b7babf0..3ba8aee 100644 static inline long atomic_long_dec_return(atomic_long_t *l) { atomic_t *v = (atomic_t *)l; -@@ -255,4 +393,55 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) +@@ -255,4 +412,57 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) #endif /* BITS_PER_LONG == 64 */ @@ -59753,6 +66363,7 @@ index b7babf0..3ba8aee 100644 + atomic_long_add_unchecked(0, (atomic_long_unchecked_t *)NULL); + atomic_long_sub_unchecked(0, (atomic_long_unchecked_t *)NULL); + atomic_long_inc_unchecked((atomic_long_unchecked_t *)NULL); ++ atomic_long_add_return_unchecked(0, (atomic_long_unchecked_t *)NULL); + atomic_long_inc_return_unchecked((atomic_long_unchecked_t *)NULL); + atomic_long_dec_unchecked((atomic_long_unchecked_t *)NULL); +} @@ -59776,16 +66387,17 @@ index b7babf0..3ba8aee 100644 +#define atomic_long_add_unchecked(i, v) atomic_long_add((i), (v)) +#define atomic_long_sub_unchecked(i, v) atomic_long_sub((i), (v)) +#define atomic_long_inc_unchecked(v) atomic_long_inc(v) ++#define atomic_long_add_return_unchecked(i, v) atomic_long_add_return((i), (v)) +#define atomic_long_inc_return_unchecked(v) atomic_long_inc_return(v) +#define atomic_long_dec_unchecked(v) atomic_long_dec(v) +#endif + #endif /* _ASM_GENERIC_ATOMIC_LONG_H */ diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h -index 1ced641..c896ee8 100644 +index 33bd2de..f31bff97 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h -@@ -159,7 +159,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) +@@ -153,7 +153,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) * Atomically clears the bits set in @mask from @v */ #ifndef atomic_clear_mask @@ -59850,34 +66462,63 @@ index 0d68a1e..b74a761 100644 machine_restart(NULL); } diff --git a/include/asm-generic/kmap_types.h b/include/asm-generic/kmap_types.h -index 0232ccb..13d9165 100644 +index 90f99c7..00ce236 100644 --- a/include/asm-generic/kmap_types.h +++ b/include/asm-generic/kmap_types.h -@@ -29,10 +29,11 @@ KMAP_D(16) KM_IRQ_PTE, - KMAP_D(17) KM_NMI, - KMAP_D(18) KM_NMI_PTE, - KMAP_D(19) KM_KDB, -+KMAP_D(20) KM_CLEARPAGE, - /* - * Remember to update debug_kmap_atomic() when adding new kmap types! - */ --KMAP_D(20) KM_TYPE_NR -+KMAP_D(21) KM_TYPE_NR - }; +@@ -2,9 +2,9 @@ + #define _ASM_GENERIC_KMAP_TYPES_H + + #ifdef __WITH_KM_FENCE +-# define KM_TYPE_NR 41 ++# define KM_TYPE_NR 42 + #else +-# define KM_TYPE_NR 20 ++# define KM_TYPE_NR 21 + #endif - #undef KMAP_D + #endif diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h -index 9ceb03b..2efbcbd 100644 +index 9ceb03b..62b0b8f 100644 --- a/include/asm-generic/local.h +++ b/include/asm-generic/local.h -@@ -39,6 +39,7 @@ typedef struct +@@ -23,24 +23,37 @@ typedef struct + atomic_long_t a; + } local_t; + ++typedef struct { ++ atomic_long_unchecked_t a; ++} local_unchecked_t; ++ + #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } + + #define local_read(l) atomic_long_read(&(l)->a) ++#define local_read_unchecked(l) atomic_long_read_unchecked(&(l)->a) + #define local_set(l,i) atomic_long_set((&(l)->a),(i)) ++#define local_set_unchecked(l,i) atomic_long_set_unchecked((&(l)->a),(i)) + #define local_inc(l) atomic_long_inc(&(l)->a) ++#define local_inc_unchecked(l) atomic_long_inc_unchecked(&(l)->a) + #define local_dec(l) atomic_long_dec(&(l)->a) ++#define local_dec_unchecked(l) atomic_long_dec_unchecked(&(l)->a) + #define local_add(i,l) atomic_long_add((i),(&(l)->a)) ++#define local_add_unchecked(i,l) atomic_long_add_unchecked((i),(&(l)->a)) + #define local_sub(i,l) atomic_long_sub((i),(&(l)->a)) ++#define local_sub_unchecked(i,l) atomic_long_sub_unchecked((i),(&(l)->a)) + + #define local_sub_and_test(i, l) atomic_long_sub_and_test((i), (&(l)->a)) + #define local_dec_and_test(l) atomic_long_dec_and_test(&(l)->a) + #define local_inc_and_test(l) atomic_long_inc_and_test(&(l)->a) + #define local_add_negative(i, l) atomic_long_add_negative((i), (&(l)->a)) #define local_add_return(i, l) atomic_long_add_return((i), (&(l)->a)) ++#define local_add_return_unchecked(i, l) atomic_long_add_return_unchecked((i), (&(l)->a)) #define local_sub_return(i, l) atomic_long_sub_return((i), (&(l)->a)) #define local_inc_return(l) atomic_long_inc_return(&(l)->a) +#define local_dec_return(l) atomic_long_dec_return(&(l)->a) #define local_cmpxchg(l, o, n) atomic_long_cmpxchg((&(l)->a), (o), (n)) ++#define local_cmpxchg_unchecked(l, o, n) atomic_long_cmpxchg((&(l)->a), (o), (n)) #define local_xchg(l, n) atomic_long_xchg((&(l)->a), (n)) + #define local_add_unless(l, _a, u) atomic_long_add_unless((&(l)->a), (_a), (u)) + #define local_inc_not_zero(l) atomic_long_inc_not_zero(&(l)->a) diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index 725612b..9cc513a 100644 --- a/include/asm-generic/pgtable-nopmd.h @@ -59961,12 +66602,12 @@ index 810431d..0ec4804f 100644 * (puds are folded into pgds so this doesn't get actually called, * but the define is needed for a generic inline function.) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h -index c7ec2cd..909d125 100644 +index a59ff51..2594a70 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h -@@ -531,6 +531,14 @@ static inline int pmd_trans_unstable(pmd_t *pmd) - #endif +@@ -688,6 +688,14 @@ static inline pmd_t pmd_mknuma(pmd_t pmd) } + #endif /* CONFIG_NUMA_BALANCING */ +#ifndef __HAVE_ARCH_PAX_OPEN_KERNEL +static inline unsigned long pax_open_kernel(void) { return 0; } @@ -59980,10 +66621,10 @@ index c7ec2cd..909d125 100644 #endif /* !__ASSEMBLY__ */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h -index 8aeadf6..f1dc019 100644 +index afa12c7..99d4da0 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h -@@ -218,6 +218,7 @@ +@@ -245,6 +245,7 @@ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ VMLINUX_SYMBOL(__start_rodata) = .; \ *(.rodata) *(.rodata.*) \ @@ -59991,7 +66632,7 @@ index 8aeadf6..f1dc019 100644 *(__vermagic) /* Kernel version magic */ \ . = ALIGN(8); \ VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \ -@@ -716,17 +717,18 @@ +@@ -755,17 +756,18 @@ * section in the linker script will go there too. @phdr should have * a leading colon. * @@ -60014,8 +66655,21 @@ index 8aeadf6..f1dc019 100644 /** * PERCPU_SECTION - define output section for percpu area, simple version +diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h +index 418d270..bfd2794 100644 +--- a/include/crypto/algapi.h ++++ b/include/crypto/algapi.h +@@ -34,7 +34,7 @@ struct crypto_type { + unsigned int maskclear; + unsigned int maskset; + unsigned int tfmsize; +-}; ++} __do_const; + + struct crypto_instance { + struct crypto_alg alg; diff --git a/include/drm/drmP.h b/include/drm/drmP.h -index dd73104..fde86bd 100644 +index f1ce786..086a7a5 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -72,6 +72,7 @@ @@ -60023,10 +66677,46 @@ index dd73104..fde86bd 100644 #include <linux/poll.h> #include <asm/pgalloc.h> +#include <asm/local.h> - #include "drm.h" + #include <drm/drm.h> + #include <drm/drm_sarea.h> - #include <linux/idr.h> -@@ -1074,7 +1075,7 @@ struct drm_device { +@@ -296,10 +297,12 @@ do { \ + * \param cmd command. + * \param arg argument. + */ +-typedef int drm_ioctl_t(struct drm_device *dev, void *data, ++typedef int (* const drm_ioctl_t)(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); ++typedef int (* drm_ioctl_no_const_t)(struct drm_device *dev, void *data, + struct drm_file *file_priv); + +-typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, ++typedef int (* const drm_ioctl_compat_t)(struct file *filp, unsigned int cmd, + unsigned long arg); + + #define DRM_IOCTL_NR(n) _IOC_NR(n) +@@ -314,9 +317,9 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, + struct drm_ioctl_desc { + unsigned int cmd; + int flags; +- drm_ioctl_t *func; ++ drm_ioctl_t func; + unsigned int cmd_drv; +-}; ++} __do_const; + + /** + * Creates a driver or general drm_ioctl_desc array entry for the given +@@ -1014,7 +1017,7 @@ struct drm_info_list { + int (*show)(struct seq_file*, void*); /** show callback */ + u32 driver_features; /**< Required driver features for this entry */ + void *data; +-}; ++} __do_const; + + /** + * debugfs node structure. This structure represents a debugfs file. +@@ -1087,7 +1090,7 @@ struct drm_device { /** \name Usage Counters */ /*@{ */ @@ -60035,7 +66725,7 @@ index dd73104..fde86bd 100644 atomic_t ioctl_count; /**< Outstanding IOCTLs pending */ atomic_t vma_count; /**< Outstanding vma areas open */ int buf_use; /**< Buffers in use -- cannot alloc */ -@@ -1085,7 +1086,7 @@ struct drm_device { +@@ -1098,7 +1101,7 @@ struct drm_device { /*@{ */ unsigned long counters; enum drm_stat_type types[15]; @@ -60045,29 +66735,20 @@ index dd73104..fde86bd 100644 struct list_head filelist; diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h -index 37515d1..34fa8b0 100644 +index f43d556..94d9343 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h -@@ -74,7 +74,7 @@ struct drm_crtc_helper_funcs { - - /* disable crtc when not in use - more explicit than dpms off */ - void (*disable)(struct drm_crtc *crtc); --}; -+} __no_const; - - struct drm_encoder_helper_funcs { - void (*dpms)(struct drm_encoder *encoder, int mode); -@@ -95,7 +95,7 @@ struct drm_encoder_helper_funcs { +@@ -109,7 +109,7 @@ struct drm_encoder_helper_funcs { struct drm_connector *connector); /* disable encoder when not in use - more explicit than dpms off */ void (*disable)(struct drm_encoder *encoder); -}; +} __no_const; - struct drm_connector_helper_funcs { - int (*get_modes)(struct drm_connector *connector); + /** + * drm_connector_helper_funcs - helper operations for connectors diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h -index d6d1da4..fdd1ac5 100644 +index 72dcbe8..8db58d7 100644 --- a/include/drm/ttm/ttm_memory.h +++ b/include/drm/ttm/ttm_memory.h @@ -48,7 +48,7 @@ @@ -60079,30 +66760,24 @@ index d6d1da4..fdd1ac5 100644 /** * struct ttm_mem_global - Global memory accounting structure. -diff --git a/include/linux/a.out.h b/include/linux/a.out.h -index e86dfca..40cc55f 100644 ---- a/include/linux/a.out.h -+++ b/include/linux/a.out.h -@@ -39,6 +39,14 @@ enum machine_type { - M_MIPS2 = 152 /* MIPS R6000/R4000 binary */ - }; +diff --git a/include/keys/asymmetric-subtype.h b/include/keys/asymmetric-subtype.h +index 4b840e8..155d235 100644 +--- a/include/keys/asymmetric-subtype.h ++++ b/include/keys/asymmetric-subtype.h +@@ -37,7 +37,7 @@ struct asymmetric_key_subtype { + /* Verify the signature on a key of this subtype (optional) */ + int (*verify_signature)(const struct key *key, + const struct public_key_signature *sig); +-}; ++} __do_const; -+/* Constants for the N_FLAGS field */ -+#define F_PAX_PAGEEXEC 1 /* Paging based non-executable pages */ -+#define F_PAX_EMUTRAMP 2 /* Emulate trampolines */ -+#define F_PAX_MPROTECT 4 /* Restrict mprotect() */ -+#define F_PAX_RANDMMAP 8 /* Randomize mmap() base */ -+/*#define F_PAX_RANDEXEC 16*/ /* Randomize ET_EXEC base */ -+#define F_PAX_SEGMEXEC 32 /* Segmentation based non-executable pages */ -+ - #if !defined (N_MAGIC) - #define N_MAGIC(exec) ((exec).a_info & 0xffff) - #endif + /** + * asymmetric_key_subtype - Get the subtype from an asymmetric key diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h -index 06fd4bb..1caec0d 100644 +index c1da539..1dcec55 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h -@@ -237,7 +237,7 @@ struct compat_atm_iobuf { +@@ -28,7 +28,7 @@ struct compat_atm_iobuf { #endif struct k_atm_aal_stats { @@ -60111,23 +66786,35 @@ index 06fd4bb..1caec0d 100644 __AAL_STAT_ITEMS #undef __HANDLE_ITEM }; +@@ -200,7 +200,7 @@ struct atmdev_ops { /* only send is required */ + int (*change_qos)(struct atm_vcc *vcc,struct atm_qos *qos,int flags); + int (*proc_read)(struct atm_dev *dev,loff_t *pos,char *page); + struct module *owner; +-}; ++} __do_const ; + + struct atmphy_ops { + int (*start)(struct atm_dev *dev); diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h -index 366422b..1fa7f84 100644 +index c3a0914..ec5d48a 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h -@@ -89,6 +89,7 @@ struct linux_binfmt { - int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); +@@ -73,8 +73,9 @@ struct linux_binfmt { + int (*load_binary)(struct linux_binprm *); int (*load_shlib)(struct file *); int (*core_dump)(struct coredump_params *cprm); + void (*handle_mprotect)(struct vm_area_struct *vma, unsigned long newflags); unsigned long min_coredump; /* minimal dump size */ - }; +-}; ++} __do_const; + + extern void __register_binfmt(struct linux_binfmt *fmt, int insert); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h -index 4d4ac24..2c3ccce 100644 +index 33f358f..7f2c27f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h -@@ -1376,7 +1376,7 @@ struct block_device_operations { +@@ -1499,7 +1499,7 @@ struct block_device_operations { /* this callback is with swap_lock and sometimes page table lock held */ void (*swap_slot_free_notify) (struct block_device *, unsigned long); struct module *owner; @@ -60137,10 +66824,10 @@ index 4d4ac24..2c3ccce 100644 extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int, unsigned long); diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h -index 4d1a074..88f929a 100644 +index 7c2e030..b72475d 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h -@@ -162,7 +162,7 @@ struct blk_trace { +@@ -23,7 +23,7 @@ struct blk_trace { struct dentry *dir; struct dentry *dropped_file; struct dentry *msg_file; @@ -60149,74 +66836,6 @@ index 4d1a074..88f929a 100644 }; extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); -diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h -index 83195fb..0b0f77d 100644 ---- a/include/linux/byteorder/little_endian.h -+++ b/include/linux/byteorder/little_endian.h -@@ -42,51 +42,51 @@ - - static inline __le64 __cpu_to_le64p(const __u64 *p) - { -- return (__force __le64)*p; -+ return (__force const __le64)*p; - } - static inline __u64 __le64_to_cpup(const __le64 *p) - { -- return (__force __u64)*p; -+ return (__force const __u64)*p; - } - static inline __le32 __cpu_to_le32p(const __u32 *p) - { -- return (__force __le32)*p; -+ return (__force const __le32)*p; - } - static inline __u32 __le32_to_cpup(const __le32 *p) - { -- return (__force __u32)*p; -+ return (__force const __u32)*p; - } - static inline __le16 __cpu_to_le16p(const __u16 *p) - { -- return (__force __le16)*p; -+ return (__force const __le16)*p; - } - static inline __u16 __le16_to_cpup(const __le16 *p) - { -- return (__force __u16)*p; -+ return (__force const __u16)*p; - } - static inline __be64 __cpu_to_be64p(const __u64 *p) - { -- return (__force __be64)__swab64p(p); -+ return (__force const __be64)__swab64p(p); - } - static inline __u64 __be64_to_cpup(const __be64 *p) - { -- return __swab64p((__u64 *)p); -+ return __swab64p((const __u64 *)p); - } - static inline __be32 __cpu_to_be32p(const __u32 *p) - { -- return (__force __be32)__swab32p(p); -+ return (__force const __be32)__swab32p(p); - } - static inline __u32 __be32_to_cpup(const __be32 *p) - { -- return __swab32p((__u32 *)p); -+ return __swab32p((const __u32 *)p); - } - static inline __be16 __cpu_to_be16p(const __u16 *p) - { -- return (__force __be16)__swab16p(p); -+ return (__force const __be16)__swab16p(p); - } - static inline __u16 __be16_to_cpup(const __be16 *p) - { -- return __swab16p((__u16 *)p); -+ return __swab16p((const __u16 *)p); - } - #define __cpu_to_le64s(x) do { (void)(x); } while (0) - #define __le64_to_cpus(x) do { (void)(x); } while (0) diff --git a/include/linux/cache.h b/include/linux/cache.h index 4c57065..4307975 100644 --- a/include/linux/cache.h @@ -60233,18 +66852,35 @@ index 4c57065..4307975 100644 #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) #endif diff --git a/include/linux/capability.h b/include/linux/capability.h -index 12d52de..b5f7fa7 100644 +index d9a4f7f4..19f77d6 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h -@@ -548,6 +548,8 @@ extern bool has_ns_capability_noaudit(struct task_struct *t, - extern bool capable(int cap); - extern bool ns_capable(struct user_namespace *ns, int cap); +@@ -213,8 +213,13 @@ extern bool ns_capable(struct user_namespace *ns, int cap); extern bool nsown_capable(int cap); + extern bool inode_capable(const struct inode *inode, int cap); + extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); +extern bool capable_nolog(int cap); +extern bool ns_capable_nolog(struct user_namespace *ns, int cap); ++extern bool inode_capable_nolog(const struct inode *inode, int cap); /* audit system wants to get cap info from files as well */ extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); + ++extern int is_privileged_binary(const struct dentry *dentry); ++ + #endif /* !_LINUX_CAPABILITY_H */ +diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h +index 8609d57..86e4d79 100644 +--- a/include/linux/cdrom.h ++++ b/include/linux/cdrom.h +@@ -87,7 +87,6 @@ struct cdrom_device_ops { + + /* driver specifications */ + const int capability; /* capability flags */ +- int n_minors; /* number of active minor devices */ + /* handle uniform packets for scsi type devices (scsi,atapi) */ + int (*generic_packet) (struct cdrom_device_info *, + struct packet_command *); diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h index 42e55de..1cd0e66 100644 --- a/include/linux/cleancache.h @@ -60258,14 +66894,52 @@ index 42e55de..1cd0e66 100644 extern struct cleancache_ops cleancache_register_ops(struct cleancache_ops *ops); +diff --git a/include/linux/compat.h b/include/linux/compat.h +index 377cd8c..2479845 100644 +--- a/include/linux/compat.h ++++ b/include/linux/compat.h +@@ -332,14 +332,14 @@ long compat_sys_msgsnd(int first, int second, int third, void __user *uptr); + long compat_sys_msgrcv(int first, int second, int msgtyp, int third, + int version, void __user *uptr); + long compat_sys_shmat(int first, int second, compat_uptr_t third, int version, +- void __user *uptr); ++ void __user *uptr) __intentional_overflow(0); + #else + long compat_sys_semctl(int semid, int semnum, int cmd, int arg); + long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp, + compat_ssize_t msgsz, int msgflg); + long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp, + compat_ssize_t msgsz, long msgtyp, int msgflg); +-long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg); ++long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg) __intentional_overflow(0); + #endif + long compat_sys_msgctl(int first, int second, void __user *uptr); + long compat_sys_shmctl(int first, int second, void __user *uptr); +@@ -442,7 +442,7 @@ extern int compat_ptrace_request(struct task_struct *child, + extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request, + compat_ulong_t addr, compat_ulong_t data); + asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, +- compat_long_t addr, compat_long_t data); ++ compat_ulong_t addr, compat_ulong_t data); + + /* + * epoll (fs/eventpoll.c) compat bits follow ... diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h -index 2f40791..938880e 100644 +index 68b162d..660f5f0 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h -@@ -32,6 +32,21 @@ - #define __linktime_error(message) __attribute__((__error__(message))) +@@ -39,9 +39,29 @@ + # define __compiletime_warning(message) __attribute__((warning(message))) + # define __compiletime_error(message) __attribute__((error(message))) + #endif /* __CHECKER__ */ ++ ++#define __alloc_size(...) __attribute((alloc_size(__VA_ARGS__))) ++#define __bos(ptr, arg) __builtin_object_size((ptr), (arg)) ++#define __bos0(ptr) __bos((ptr), 0) ++#define __bos1(ptr) __bos((ptr), 1) + #endif /* GCC_VERSION >= 40300 */ - #if __GNUC_MINOR__ >= 5 + #if GCC_VERSION >= 40500 + +#ifdef CONSTIFY_PLUGIN +#define __no_const __attribute__((no_const)) @@ -60284,23 +66958,11 @@ index 2f40791..938880e 100644 /* * Mark a position in code as unreachable. This can be used to * suppress control flow warnings after asm blocks that transfer -@@ -47,6 +62,11 @@ - #define __noclone __attribute__((__noclone__)) - - #endif -+ -+#define __alloc_size(...) __attribute((alloc_size(__VA_ARGS__))) -+#define __bos(ptr, arg) __builtin_object_size((ptr), (arg)) -+#define __bos0(ptr) __bos((ptr), 0) -+#define __bos1(ptr) __bos((ptr), 1) - #endif - - #if __GNUC_MINOR__ > 0 diff --git a/include/linux/compiler.h b/include/linux/compiler.h -index 923d093..3625de1 100644 +index 10b8f23..5e0b083 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h -@@ -5,31 +5,62 @@ +@@ -5,11 +5,14 @@ #ifdef __CHECKER__ # define __user __attribute__((noderef, address_space(1))) @@ -60312,9 +66974,10 @@ index 923d093..3625de1 100644 # define __nocast __attribute__((nocast)) # define __iomem __attribute__((noderef, address_space(2))) +# define __force_iomem __force __iomem + # define __must_hold(x) __attribute__((context(x,1,1))) # define __acquires(x) __attribute__((context(x,0,1))) # define __releases(x) __attribute__((context(x,1,0))) - # define __acquire(x) __context__(x,1) +@@ -17,20 +20,37 @@ # define __release(x) __context__(x,-1) # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) # define __percpu __attribute__((noderef, address_space(3))) @@ -60328,33 +66991,24 @@ index 923d093..3625de1 100644 #endif extern void __chk_user_ptr(const volatile void __user *); extern void __chk_io_ptr(const volatile void __iomem *); -+#elif defined(CHECKER_PLUGIN) -+//# define __user -+//# define __force_user -+//# define __kernel -+//# define __force_kernel -+# define __safe -+# define __force -+# define __nocast -+# define __iomem -+# define __force_iomem -+# define __chk_user_ptr(x) (void)0 -+# define __chk_io_ptr(x) (void)0 -+# define __builtin_warning(x, y...) (1) -+# define __acquires(x) -+# define __releases(x) -+# define __acquire(x) (void)0 -+# define __release(x) (void)0 -+# define __cond_lock(x,c) (c) -+# define __percpu -+# define __force_percpu -+# define __rcu -+# define __force_rcu #else - # define __user -+# define __force_user - # define __kernel -+# define __force_kernel +-# define __user +-# define __kernel ++# ifdef CHECKER_PLUGIN ++//# define __user ++//# define __force_user ++//# define __kernel ++//# define __force_kernel ++# else ++# ifdef STRUCTLEAK_PLUGIN ++# define __user __attribute__((user)) ++# else ++# define __user ++# endif ++# define __force_user ++# define __kernel ++# define __force_kernel ++# endif # define __safe # define __force # define __nocast @@ -60363,7 +67017,7 @@ index 923d093..3625de1 100644 # define __chk_user_ptr(x) (void)0 # define __chk_io_ptr(x) (void)0 # define __builtin_warning(x, y...) (1) -@@ -39,7 +70,9 @@ extern void __chk_io_ptr(const volatile void __iomem *); +@@ -41,7 +61,9 @@ extern void __chk_io_ptr(const volatile void __iomem *); # define __release(x) (void)0 # define __cond_lock(x,c) (c) # define __percpu @@ -60372,8 +67026,8 @@ index 923d093..3625de1 100644 +# define __force_rcu #endif - #ifdef __KERNEL__ -@@ -264,6 +297,26 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); + /* Indirect macros required for expanded argument pasting, eg. __LINE__. */ +@@ -275,6 +297,26 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); # define __attribute_const__ /* unimplemented */ #endif @@ -60389,18 +67043,18 @@ index 923d093..3625de1 100644 +# define __size_overflow(...) +#endif + -+#ifndef __latent_entropy -+# define __latent_entropy -+#endif -+ +#ifndef __intentional_overflow +# define __intentional_overflow(...) +#endif + ++#ifndef __latent_entropy ++# define __latent_entropy ++#endif ++ /* * Tell gcc if a function is cold. The compiler will assume any path * directly leading to the call is unlikely. -@@ -273,6 +326,22 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); +@@ -284,6 +326,22 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); #define __cold #endif @@ -60423,7 +67077,7 @@ index 923d093..3625de1 100644 /* Simple shorthand for a section definition */ #ifndef __section # define __section(S) __attribute__ ((__section__(#S))) -@@ -308,6 +377,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); +@@ -349,6 +407,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); * use is to mediate communication between process-level code and irq/NMI * handlers, all running on the same CPU. */ @@ -60432,11 +67086,156 @@ index 923d093..3625de1 100644 +#define ACCESS_ONCE_RW(x) (*(volatile typeof(x) *)&(x)) #endif /* __LINUX_COMPILER_H */ +diff --git a/include/linux/completion.h b/include/linux/completion.h +index 33f0280..35c6568 100644 +--- a/include/linux/completion.h ++++ b/include/linux/completion.h +@@ -79,15 +79,15 @@ static inline void init_completion(struct completion *x) + extern void wait_for_completion(struct completion *); + extern void wait_for_completion_io(struct completion *); + extern int wait_for_completion_interruptible(struct completion *x); +-extern int wait_for_completion_killable(struct completion *x); ++extern int wait_for_completion_killable(struct completion *x) __intentional_overflow(-1); + extern unsigned long wait_for_completion_timeout(struct completion *x, + unsigned long timeout); + extern unsigned long wait_for_completion_io_timeout(struct completion *x, + unsigned long timeout); + extern long wait_for_completion_interruptible_timeout( +- struct completion *x, unsigned long timeout); ++ struct completion *x, unsigned long timeout) __intentional_overflow(-1); + extern long wait_for_completion_killable_timeout( +- struct completion *x, unsigned long timeout); ++ struct completion *x, unsigned long timeout) __intentional_overflow(-1); + extern bool try_wait_for_completion(struct completion *x); + extern bool completion_done(struct completion *x); + +diff --git a/include/linux/configfs.h b/include/linux/configfs.h +index 34025df..d94bbbc 100644 +--- a/include/linux/configfs.h ++++ b/include/linux/configfs.h +@@ -125,7 +125,7 @@ struct configfs_attribute { + const char *ca_name; + struct module *ca_owner; + umode_t ca_mode; +-}; ++} __do_const; + + /* + * Users often need to create attribute structures for their configurable +diff --git a/include/linux/cpu.h b/include/linux/cpu.h +index ce7a074..01ab8ac 100644 +--- a/include/linux/cpu.h ++++ b/include/linux/cpu.h +@@ -115,7 +115,7 @@ enum { + /* Need to know about CPUs going up/down? */ + #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) + #define cpu_notifier(fn, pri) { \ +- static struct notifier_block fn##_nb __cpuinitdata = \ ++ static struct notifier_block fn##_nb = \ + { .notifier_call = fn, .priority = pri }; \ + register_cpu_notifier(&fn##_nb); \ + } +diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h +index a22944c..4e695fe 100644 +--- a/include/linux/cpufreq.h ++++ b/include/linux/cpufreq.h +@@ -252,7 +252,7 @@ struct cpufreq_driver { + int (*suspend) (struct cpufreq_policy *policy); + int (*resume) (struct cpufreq_policy *policy); + struct freq_attr **attr; +-}; ++} __do_const; + + /* flags */ + +@@ -311,6 +311,7 @@ struct global_attr { + ssize_t (*store)(struct kobject *a, struct attribute *b, + const char *c, size_t count); + }; ++typedef struct global_attr __no_const global_attr_no_const; + + #define define_one_global_ro(_name) \ + static struct global_attr _name = \ +diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h +index 480c14d..552896f 100644 +--- a/include/linux/cpuidle.h ++++ b/include/linux/cpuidle.h +@@ -52,7 +52,8 @@ struct cpuidle_state { + int index); + + int (*enter_dead) (struct cpuidle_device *dev, int index); +-}; ++} __do_const; ++typedef struct cpuidle_state __no_const cpuidle_state_no_const; + + /* Idle State Flags */ + #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ +@@ -194,7 +195,7 @@ struct cpuidle_governor { + void (*reflect) (struct cpuidle_device *dev, int index); + + struct module *owner; +-}; ++} __do_const; + + #ifdef CONFIG_CPU_IDLE + +diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h +index 0325602..5e9feff 100644 +--- a/include/linux/cpumask.h ++++ b/include/linux/cpumask.h +@@ -118,17 +118,17 @@ static inline unsigned int cpumask_first(const struct cpumask *srcp) + } + + /* Valid inputs for n are -1 and 0. */ +-static inline unsigned int cpumask_next(int n, const struct cpumask *srcp) ++static inline unsigned int __intentional_overflow(-1) cpumask_next(int n, const struct cpumask *srcp) + { + return n+1; + } + +-static inline unsigned int cpumask_next_zero(int n, const struct cpumask *srcp) ++static inline unsigned int __intentional_overflow(-1) cpumask_next_zero(int n, const struct cpumask *srcp) + { + return n+1; + } + +-static inline unsigned int cpumask_next_and(int n, ++static inline unsigned int __intentional_overflow(-1) cpumask_next_and(int n, + const struct cpumask *srcp, + const struct cpumask *andp) + { +@@ -167,7 +167,7 @@ static inline unsigned int cpumask_first(const struct cpumask *srcp) + * + * Returns >= nr_cpu_ids if no further cpus set. + */ +-static inline unsigned int cpumask_next(int n, const struct cpumask *srcp) ++static inline unsigned int __intentional_overflow(-1) cpumask_next(int n, const struct cpumask *srcp) + { + /* -1 is a legal arg here. */ + if (n != -1) +@@ -182,7 +182,7 @@ static inline unsigned int cpumask_next(int n, const struct cpumask *srcp) + * + * Returns >= nr_cpu_ids if no further cpus unset. + */ +-static inline unsigned int cpumask_next_zero(int n, const struct cpumask *srcp) ++static inline unsigned int __intentional_overflow(-1) cpumask_next_zero(int n, const struct cpumask *srcp) + { + /* -1 is a legal arg here. */ + if (n != -1) +@@ -190,7 +190,7 @@ static inline unsigned int cpumask_next_zero(int n, const struct cpumask *srcp) + return find_next_zero_bit(cpumask_bits(srcp), nr_cpumask_bits, n+1); + } + +-int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *); ++int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *) __intentional_overflow(-1); + int cpumask_any_but(const struct cpumask *mask, unsigned int cpu); + + /** diff --git a/include/linux/cred.h b/include/linux/cred.h -index adadf71..6af5560 100644 +index 04421e8..6bce4ef 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h -@@ -207,6 +207,9 @@ static inline void validate_creds_for_do_exit(struct task_struct *tsk) +@@ -194,6 +194,9 @@ static inline void validate_creds_for_do_exit(struct task_struct *tsk) static inline void validate_process_creds(void) { } @@ -60475,6 +67274,19 @@ index b92eadf..b4ecdc1 100644 #define crt_ablkcipher crt_u.ablkcipher #define crt_aead crt_u.aead +diff --git a/include/linux/ctype.h b/include/linux/ctype.h +index 8acfe31..6ffccd63 100644 +--- a/include/linux/ctype.h ++++ b/include/linux/ctype.h +@@ -56,7 +56,7 @@ static inline unsigned char __toupper(unsigned char c) + * Fast implementation of tolower() for internal usage. Do not use in your + * code. + */ +-static inline char _tolower(const char c) ++static inline unsigned char _tolower(const unsigned char c) + { + return c | 0x20; + } diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index 7925bf0..d5143d2 100644 --- a/include/linux/decompress/mm.h @@ -60488,11 +67300,60 @@ index 7925bf0..d5143d2 100644 #define free(a) kfree(a) #define large_malloc(a) vmalloc(a) +diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h +index fe8c447..bdc1f33 100644 +--- a/include/linux/devfreq.h ++++ b/include/linux/devfreq.h +@@ -114,7 +114,7 @@ struct devfreq_governor { + int (*get_target_freq)(struct devfreq *this, unsigned long *freq); + int (*event_handler)(struct devfreq *devfreq, + unsigned int event, void *data); +-}; ++} __do_const; + + /** + * struct devfreq - Device devfreq structure +diff --git a/include/linux/device.h b/include/linux/device.h +index 9d6464e..8a5cc92 100644 +--- a/include/linux/device.h ++++ b/include/linux/device.h +@@ -295,7 +295,7 @@ struct subsys_interface { + struct list_head node; + int (*add_dev)(struct device *dev, struct subsys_interface *sif); + int (*remove_dev)(struct device *dev, struct subsys_interface *sif); +-}; ++} __do_const; + + int subsys_interface_register(struct subsys_interface *sif); + void subsys_interface_unregister(struct subsys_interface *sif); +@@ -475,7 +475,7 @@ struct device_type { + void (*release)(struct device *dev); + + const struct dev_pm_ops *pm; +-}; ++} __do_const; + + /* interface for exporting device attributes */ + struct device_attribute { +@@ -485,11 +485,12 @@ struct device_attribute { + ssize_t (*store)(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count); + }; ++typedef struct device_attribute __no_const device_attribute_no_const; + + struct dev_ext_attribute { + struct device_attribute attr; + void *var; +-}; ++} __do_const; + + ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr, + char *buf); diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h -index dfc099e..e583e66 100644 +index 94af418..b1ca7a2 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h -@@ -51,7 +51,7 @@ struct dma_map_ops { +@@ -54,7 +54,7 @@ struct dma_map_ops { u64 (*get_required_mask)(struct device *dev); #endif int is_phys; @@ -60502,10 +67363,10 @@ index dfc099e..e583e66 100644 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h -index f9a2e5e..c392120 100644 +index 91ac8da..a841318 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h -@@ -993,9 +993,9 @@ struct dma_pinned_list { +@@ -1034,9 +1034,9 @@ struct dma_pinned_list { struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len); void dma_unpin_iovec_pages(struct dma_pinned_list* pinned_list); @@ -60518,79 +67379,22 @@ index f9a2e5e..c392120 100644 unsigned int offset, size_t len); diff --git a/include/linux/efi.h b/include/linux/efi.h -index ec45ccd..9923c32 100644 +index 3d7df3d..301f024 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -635,7 +635,7 @@ struct efivar_operations { - efi_get_variable_t *get_variable; - efi_get_next_variable_t *get_next_variable; +@@ -740,6 +740,7 @@ struct efivar_operations { efi_set_variable_t *set_variable; --}; -+} __no_const; + efi_query_variable_store_t *query_variable_store; + }; ++typedef struct efivar_operations __no_const efivar_operations_no_const; struct efivars { /* diff --git a/include/linux/elf.h b/include/linux/elf.h -index 999b4f5..57753b4 100644 +index 40a3c0e..4c45a38 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h -@@ -40,6 +40,17 @@ typedef __s64 Elf64_Sxword; - #define PT_GNU_EH_FRAME 0x6474e550 - - #define PT_GNU_STACK (PT_LOOS + 0x474e551) -+#define PT_GNU_RELRO (PT_LOOS + 0x474e552) -+ -+#define PT_PAX_FLAGS (PT_LOOS + 0x5041580) -+ -+/* Constants for the e_flags field */ -+#define EF_PAX_PAGEEXEC 1 /* Paging based non-executable pages */ -+#define EF_PAX_EMUTRAMP 2 /* Emulate trampolines */ -+#define EF_PAX_MPROTECT 4 /* Restrict mprotect() */ -+#define EF_PAX_RANDMMAP 8 /* Randomize mmap() base */ -+/*#define EF_PAX_RANDEXEC 16*/ /* Randomize ET_EXEC base */ -+#define EF_PAX_SEGMEXEC 32 /* Segmentation based non-executable pages */ - - /* - * Extended Numbering -@@ -97,6 +108,8 @@ typedef __s64 Elf64_Sxword; - #define DT_DEBUG 21 - #define DT_TEXTREL 22 - #define DT_JMPREL 23 -+#define DT_FLAGS 30 -+ #define DF_TEXTREL 0x00000004 - #define DT_ENCODING 32 - #define OLD_DT_LOOS 0x60000000 - #define DT_LOOS 0x6000000d -@@ -243,6 +256,19 @@ typedef struct elf64_hdr { - #define PF_W 0x2 - #define PF_X 0x1 - -+#define PF_PAGEEXEC (1U << 4) /* Enable PAGEEXEC */ -+#define PF_NOPAGEEXEC (1U << 5) /* Disable PAGEEXEC */ -+#define PF_SEGMEXEC (1U << 6) /* Enable SEGMEXEC */ -+#define PF_NOSEGMEXEC (1U << 7) /* Disable SEGMEXEC */ -+#define PF_MPROTECT (1U << 8) /* Enable MPROTECT */ -+#define PF_NOMPROTECT (1U << 9) /* Disable MPROTECT */ -+/*#define PF_RANDEXEC (1U << 10)*/ /* Enable RANDEXEC */ -+/*#define PF_NORANDEXEC (1U << 11)*/ /* Disable RANDEXEC */ -+#define PF_EMUTRAMP (1U << 12) /* Enable EMUTRAMP */ -+#define PF_NOEMUTRAMP (1U << 13) /* Disable EMUTRAMP */ -+#define PF_RANDMMAP (1U << 14) /* Enable RANDMMAP */ -+#define PF_NORANDMMAP (1U << 15) /* Disable RANDMMAP */ -+ - typedef struct elf32_phdr{ - Elf32_Word p_type; - Elf32_Off p_offset; -@@ -335,6 +361,8 @@ typedef struct elf64_shdr { - #define EI_OSABI 7 - #define EI_PAD 8 - -+#define EI_PAX 14 -+ - #define ELFMAG0 0x7f /* EI_MAG */ - #define ELFMAG1 'E' - #define ELFMAG2 'L' -@@ -421,6 +449,7 @@ extern Elf32_Dyn _DYNAMIC []; +@@ -24,6 +24,7 @@ extern Elf32_Dyn _DYNAMIC []; #define elf_note elf32_note #define elf_addr_t Elf32_Off #define Elf_Half Elf32_Half @@ -60598,7 +67402,7 @@ index 999b4f5..57753b4 100644 #else -@@ -431,6 +460,7 @@ extern Elf64_Dyn _DYNAMIC []; +@@ -34,6 +35,7 @@ extern Elf64_Dyn _DYNAMIC []; #define elf_note elf64_note #define elf_addr_t Elf64_Off #define Elf_Half Elf64_Half @@ -60606,11 +67410,56 @@ index 999b4f5..57753b4 100644 #endif +diff --git a/include/linux/err.h b/include/linux/err.h +index f2edce2..cc2082c 100644 +--- a/include/linux/err.h ++++ b/include/linux/err.h +@@ -19,12 +19,12 @@ + + #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) + +-static inline void * __must_check ERR_PTR(long error) ++static inline void * __must_check __intentional_overflow(-1) ERR_PTR(long error) + { + return (void *) error; + } + +-static inline long __must_check PTR_ERR(const void *ptr) ++static inline long __must_check __intentional_overflow(-1) PTR_ERR(const void *ptr) + { + return (long) ptr; + } +diff --git a/include/linux/extcon.h b/include/linux/extcon.h +index fcb51c8..bdafcf6 100644 +--- a/include/linux/extcon.h ++++ b/include/linux/extcon.h +@@ -134,7 +134,7 @@ struct extcon_dev { + /* /sys/class/extcon/.../mutually_exclusive/... */ + struct attribute_group attr_g_muex; + struct attribute **attrs_muex; +- struct device_attribute *d_attrs_muex; ++ device_attribute_no_const *d_attrs_muex; + }; + + /** +diff --git a/include/linux/fb.h b/include/linux/fb.h +index 58b9860..58e5516 100644 +--- a/include/linux/fb.h ++++ b/include/linux/fb.h +@@ -304,7 +304,7 @@ struct fb_ops { + /* called at KDB enter and leave time to prepare the console */ + int (*fb_debug_enter)(struct fb_info *info); + int (*fb_debug_leave)(struct fb_info *info); +-}; ++} __do_const; + + #ifdef CONFIG_FB_TILEBLITTING + #define FB_TILE_CURSOR_NONE 0 diff --git a/include/linux/filter.h b/include/linux/filter.h -index 8eeb205..d59bfa2 100644 +index c45eabc..baa0be5 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h -@@ -134,6 +134,7 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ +@@ -20,6 +20,7 @@ struct compat_sock_fprog { struct sk_buff; struct sock; @@ -60618,7 +67467,7 @@ index 8eeb205..d59bfa2 100644 struct sk_filter { -@@ -141,6 +142,9 @@ struct sk_filter +@@ -27,6 +28,9 @@ struct sk_filter unsigned int len; /* Number of filter blocks */ unsigned int (*bpf_func)(const struct sk_buff *skb, const struct sock_filter *filter); @@ -60628,35 +67477,50 @@ index 8eeb205..d59bfa2 100644 struct rcu_head rcu; struct sock_filter insns[0]; }; -diff --git a/include/linux/firewire.h b/include/linux/firewire.h -index cdc9b71..ce69fb5 100644 ---- a/include/linux/firewire.h -+++ b/include/linux/firewire.h -@@ -413,7 +413,7 @@ struct fw_iso_context { - union { - fw_iso_callback_t sc; - fw_iso_mc_callback_t mc; -- } callback; -+ } __no_const callback; - void *callback_data; - }; +diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h +index 3044254..9767f41 100644 +--- a/include/linux/frontswap.h ++++ b/include/linux/frontswap.h +@@ -11,7 +11,7 @@ struct frontswap_ops { + int (*load)(unsigned, pgoff_t, struct page *); + void (*invalidate_page)(unsigned, pgoff_t); + void (*invalidate_area)(unsigned); +-}; ++} __no_const; + extern bool frontswap_enabled; + extern struct frontswap_ops diff --git a/include/linux/fs.h b/include/linux/fs.h -index 25c40b9..1bfd4f4 100644 +index 2c28271..8d3d74c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h -@@ -1634,7 +1634,8 @@ struct file_operations { - int (*setlease)(struct file *, long, struct file_lock **); +@@ -1541,7 +1541,8 @@ struct file_operations { long (*fallocate)(struct file *file, int mode, loff_t offset, loff_t len); + int (*show_fdinfo)(struct seq_file *m, struct file *f); -}; +} __do_const; +typedef struct file_operations __no_const file_operations_no_const; struct inode_operations { - struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); + struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); +@@ -2672,4 +2673,14 @@ static inline void inode_has_no_xattr(struct inode *inode) + inode->i_flags |= S_NOSEC; + } + ++static inline bool is_sidechannel_device(const struct inode *inode) ++{ ++#ifdef CONFIG_GRKERNSEC_DEVICE_SIDECHANNEL ++ umode_t mode = inode->i_mode; ++ return ((S_ISCHR(mode) || S_ISBLK(mode)) && (mode & (S_IROTH | S_IWOTH))); ++#else ++ return false; ++#endif ++} ++ + #endif /* _LINUX_FS_H */ diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h -index 003dc0f..3c4ea97 100644 +index 2b93a9a..855d94a 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h @@ -6,7 +6,7 @@ @@ -60669,10 +67533,10 @@ index 003dc0f..3c4ea97 100644 seqcount_t seq; int umask; diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h -index ce31408..b1ad003 100644 +index 5dfa0aa..6acf322 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h -@@ -102,7 +102,7 @@ struct fscache_operation { +@@ -112,7 +112,7 @@ struct fscache_operation { fscache_operation_release_t release; }; @@ -60681,20 +67545,53 @@ index ce31408..b1ad003 100644 extern void fscache_op_work_func(struct work_struct *work); extern void fscache_enqueue_operation(struct fscache_operation *); -@@ -122,7 +122,7 @@ static inline void fscache_operation_init(struct fscache_operation *op, - { +@@ -134,7 +134,7 @@ static inline void fscache_operation_init(struct fscache_operation *op, INIT_WORK(&op->work, fscache_op_work_func); atomic_set(&op->usage, 1); + op->state = FSCACHE_OP_ST_INITIALISED; - op->debug_id = atomic_inc_return(&fscache_op_debug_id); + op->debug_id = atomic_inc_return_unchecked(&fscache_op_debug_id); op->processor = processor; op->release = release; INIT_LIST_HEAD(&op->pend_link); +diff --git a/include/linux/fscache.h b/include/linux/fscache.h +index 7a08623..4c07b0f 100644 +--- a/include/linux/fscache.h ++++ b/include/linux/fscache.h +@@ -152,7 +152,7 @@ struct fscache_cookie_def { + * - this is mandatory for any object that may have data + */ + void (*now_uncached)(void *cookie_netfs_data); +-}; ++} __do_const; + + /* + * fscache cached network filesystem type diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h -index a6dfe69..569586df 100644 +index a78680a..87bd73e 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h -@@ -315,7 +315,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) +@@ -195,6 +195,9 @@ static inline void fsnotify_access(struct file *file) + struct inode *inode = path->dentry->d_inode; + __u32 mask = FS_ACCESS; + ++ if (is_sidechannel_device(inode)) ++ return; ++ + if (S_ISDIR(inode->i_mode)) + mask |= FS_ISDIR; + +@@ -213,6 +216,9 @@ static inline void fsnotify_modify(struct file *file) + struct inode *inode = path->dentry->d_inode; + __u32 mask = FS_MODIFY; + ++ if (is_sidechannel_device(inode)) ++ return; ++ + if (S_ISDIR(inode->i_mode)) + mask |= FS_ISDIR; + +@@ -315,7 +321,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) */ static inline const unsigned char *fsnotify_oldname_init(const unsigned char *name) { @@ -60703,45 +67600,24 @@ index a6dfe69..569586df 100644 } /* -diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h -index 91d0e0a3..035666b 100644 ---- a/include/linux/fsnotify_backend.h -+++ b/include/linux/fsnotify_backend.h -@@ -105,6 +105,7 @@ struct fsnotify_ops { - void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); - void (*free_event_priv)(struct fsnotify_event_private_data *priv); - }; -+typedef struct fsnotify_ops __no_const fsnotify_ops_no_const; - - /* - * A group is a "thing" that wants to receive notification about filesystem diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h -index 176a939..1462211 100644 +index 13a54d0..c6ce2a7 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h -@@ -97,7 +97,7 @@ struct trace_event_functions { - trace_print_func raw; - trace_print_func hex; - trace_print_func binary; --}; -+} __no_const; - - struct trace_event { - struct hlist_node node; -@@ -263,7 +263,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type, +@@ -274,7 +274,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type, extern int trace_add_event_call(struct ftrace_event_call *call); extern void trace_remove_event_call(struct ftrace_event_call *call); --#define is_signed_type(type) (((type)(-1)) < 0) +-#define is_signed_type(type) (((type)(-1)) < (type)0) +#define is_signed_type(type) (((type)(-1)) < (type)1) int trace_set_clr_event(const char *system, const char *event, int set); diff --git a/include/linux/genhd.h b/include/linux/genhd.h -index 017a7fb..33a8507 100644 +index 9f3c275..911b591 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h -@@ -185,7 +185,7 @@ struct gendisk { +@@ -194,7 +194,7 @@ struct gendisk { struct kobject *slave_dir; struct timer_rand_state *random; @@ -60750,32 +67626,46 @@ index 017a7fb..33a8507 100644 struct disk_events *ev; #ifdef CONFIG_BLK_DEV_INTEGRITY struct blk_integrity *integrity; +diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h +index 023bc34..b02b46a 100644 +--- a/include/linux/genl_magic_func.h ++++ b/include/linux/genl_magic_func.h +@@ -246,7 +246,7 @@ const char *CONCAT_(GENL_MAGIC_FAMILY, _genl_cmd_to_str)(__u8 cmd) + }, + + #define ZZZ_genl_ops CONCAT_(GENL_MAGIC_FAMILY, _genl_ops) +-static struct genl_ops ZZZ_genl_ops[] __read_mostly = { ++static struct genl_ops ZZZ_genl_ops[] = { + #include GENL_MAGIC_INCLUDE_FILE + }; + diff --git a/include/linux/gfp.h b/include/linux/gfp.h -index 581e74b..8c34a24 100644 +index 0f615eb..5c3832f 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h -@@ -38,6 +38,12 @@ struct vm_area_struct; +@@ -35,6 +35,13 @@ struct vm_area_struct; + #define ___GFP_NO_KSWAPD 0x400000u #define ___GFP_OTHER_NODE 0x800000u #define ___GFP_WRITE 0x1000000u - ++ +#ifdef CONFIG_PAX_USERCOPY_SLABS +#define ___GFP_USERCOPY 0x2000000u +#else +#define ___GFP_USERCOPY 0 +#endif + + /* If the above are modified, __GFP_BITS_SHIFT may need updating */ + /* - * GFP bitmasks.. - * -@@ -87,6 +93,7 @@ struct vm_area_struct; - #define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD) +@@ -92,6 +99,7 @@ struct vm_area_struct; #define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ + #define __GFP_KMEMCG ((__force gfp_t)___GFP_KMEMCG) /* Allocation comes from a memcg-accounted resource */ #define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ +#define __GFP_USERCOPY ((__force gfp_t)___GFP_USERCOPY)/* Allocator intends to copy page to/from userland */ /* * This may seem redundant, but it's a way of annotating false positives vs. -@@ -94,7 +101,7 @@ struct vm_area_struct; +@@ -99,7 +107,7 @@ struct vm_area_struct; */ #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) @@ -60784,7 +67674,7 @@ index 581e74b..8c34a24 100644 #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) /* This equals 0, but use constants in case they ever change */ -@@ -148,6 +155,8 @@ struct vm_area_struct; +@@ -153,6 +161,8 @@ struct vm_area_struct; /* 4GB DMA on some platforms */ #define GFP_DMA32 __GFP_DMA32 @@ -60795,7 +67685,7 @@ index 581e74b..8c34a24 100644 { diff --git a/include/linux/gracl.h b/include/linux/gracl.h new file mode 100644 -index 0000000..c938b1f +index 0000000..ebe6d72 --- /dev/null +++ b/include/linux/gracl.h @@ -0,0 +1,319 @@ @@ -61059,25 +67949,25 @@ index 0000000..c938b1f + Shift/add algorithm with modulus of table size and an XOR*/ + +static __inline__ unsigned int -+rhash(const uid_t uid, const __u16 type, const unsigned int sz) ++gr_rhash(const uid_t uid, const __u16 type, const unsigned int sz) +{ + return ((((uid + type) << (16 + type)) ^ uid) % sz); +} + + static __inline__ unsigned int -+shash(const struct acl_subject_label *userp, const unsigned int sz) ++gr_shash(const struct acl_subject_label *userp, const unsigned int sz) +{ + return ((const unsigned long)userp % sz); +} + +static __inline__ unsigned int -+fhash(const ino_t ino, const dev_t dev, const unsigned int sz) ++gr_fhash(const ino_t ino, const dev_t dev, const unsigned int sz) +{ + return (((ino + dev) ^ ((ino << 13) + (ino << 23) + (dev << 9))) % sz); +} + +static __inline__ unsigned int -+nhash(const char *name, const __u16 len, const unsigned int sz) ++gr_nhash(const char *name, const __u16 len, const unsigned int sz) +{ + return full_name_hash((const unsigned char *)name, len) % sz; +} @@ -61135,7 +68025,7 @@ index 0000000..323ecf2 +#endif diff --git a/include/linux/grdefs.h b/include/linux/grdefs.h new file mode 100644 -index 0000000..b30e9bc +index 0000000..be66033 --- /dev/null +++ b/include/linux/grdefs.h @@ -0,0 +1,140 @@ @@ -61223,7 +68113,7 @@ index 0000000..b30e9bc + GR_PROTPROCFD = 0x00000400, + GR_PROCACCT = 0x00000800, + GR_RELAXPTRACE = 0x00001000, -+ GR_NESTED = 0x00002000, ++ //GR_NESTED = 0x00002000, + GR_INHERITLEARN = 0x00004000, + GR_PROCFIND = 0x00008000, + GR_POVERRIDE = 0x00010000, @@ -61281,10 +68171,10 @@ index 0000000..b30e9bc +#endif diff --git a/include/linux/grinternal.h b/include/linux/grinternal.h new file mode 100644 -index 0000000..c9292f7 +index 0000000..5402bce --- /dev/null +++ b/include/linux/grinternal.h -@@ -0,0 +1,223 @@ +@@ -0,0 +1,215 @@ +#ifndef __GRINTERNAL_H +#define __GRINTERNAL_H + @@ -61347,18 +68237,18 @@ index 0000000..c9292f7 +extern int grsec_enable_chroot_sysctl; +extern int grsec_enable_chroot_unix; +extern int grsec_enable_symlinkown; -+extern int grsec_symlinkown_gid; ++extern kgid_t grsec_symlinkown_gid; +extern int grsec_enable_tpe; -+extern int grsec_tpe_gid; ++extern kgid_t grsec_tpe_gid; +extern int grsec_enable_tpe_all; +extern int grsec_enable_tpe_invert; +extern int grsec_enable_socket_all; -+extern int grsec_socket_all_gid; ++extern kgid_t grsec_socket_all_gid; +extern int grsec_enable_socket_client; -+extern int grsec_socket_client_gid; ++extern kgid_t grsec_socket_client_gid; +extern int grsec_enable_socket_server; -+extern int grsec_socket_server_gid; -+extern int grsec_audit_gid; ++extern kgid_t grsec_socket_server_gid; ++extern kgid_t grsec_audit_gid; +extern int grsec_enable_group; +extern int grsec_enable_audit_textrel; +extern int grsec_enable_log_rwxmaps; @@ -61380,32 +68270,24 @@ index 0000000..c9292f7 + +#define gr_task_fullpath(tsk) ((tsk)->exec_file ? \ + gr_to_filename2((tsk)->exec_file->f_path.dentry, \ -+ (tsk)->exec_file->f_vfsmnt) : "/") ++ (tsk)->exec_file->f_path.mnt) : "/") + +#define gr_parent_task_fullpath(tsk) ((tsk)->real_parent->exec_file ? \ + gr_to_filename3((tsk)->real_parent->exec_file->f_path.dentry, \ -+ (tsk)->real_parent->exec_file->f_vfsmnt) : "/") ++ (tsk)->real_parent->exec_file->f_path.mnt) : "/") + +#define gr_task_fullpath0(tsk) ((tsk)->exec_file ? \ + gr_to_filename((tsk)->exec_file->f_path.dentry, \ -+ (tsk)->exec_file->f_vfsmnt) : "/") ++ (tsk)->exec_file->f_path.mnt) : "/") + +#define gr_parent_task_fullpath0(tsk) ((tsk)->real_parent->exec_file ? \ + gr_to_filename1((tsk)->real_parent->exec_file->f_path.dentry, \ -+ (tsk)->real_parent->exec_file->f_vfsmnt) : "/") ++ (tsk)->real_parent->exec_file->f_path.mnt) : "/") + +#define proc_is_chrooted(tsk_a) ((tsk_a)->gr_is_chrooted) + +#define have_same_root(tsk_a,tsk_b) ((tsk_a)->gr_chroot_dentry == (tsk_b)->gr_chroot_dentry) + -+#define DEFAULTSECARGS(task, cred, pcred) gr_task_fullpath(task), (task)->comm, \ -+ (task)->pid, (cred)->uid, \ -+ (cred)->euid, (cred)->gid, (cred)->egid, \ -+ gr_parent_task_fullpath(task), \ -+ (task)->real_parent->comm, (task)->real_parent->pid, \ -+ (pcred)->uid, (pcred)->euid, \ -+ (pcred)->gid, (pcred)->egid -+ +#define GR_CHROOT_CAPS {{ \ + CAP_TO_MASK(CAP_LINUX_IMMUTABLE) | CAP_TO_MASK(CAP_NET_ADMIN) | \ + CAP_TO_MASK(CAP_SYS_MODULE) | CAP_TO_MASK(CAP_SYS_RAWIO) | \ @@ -61510,10 +68392,10 @@ index 0000000..c9292f7 +#endif diff --git a/include/linux/grmsg.h b/include/linux/grmsg.h new file mode 100644 -index 0000000..54f4e85 +index 0000000..2bd4c8d --- /dev/null +++ b/include/linux/grmsg.h -@@ -0,0 +1,110 @@ +@@ -0,0 +1,111 @@ +#define DEFAULTSECMSG "%.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u, parent %.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u" +#define GR_ACL_PROCACCT_MSG "%.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u run time:[%ud %uh %um %us] cpu time:[%ud %uh %um %us] %s with exit code %ld, parent %.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u" +#define GR_PTRACE_ACL_MSG "denied ptrace of %.950s(%.16s:%d) by " @@ -61624,12 +68506,13 @@ index 0000000..54f4e85 +#define GR_INIT_TRANSFER_MSG "persistent special role transferred privilege to init by " +#define GR_BADPROCPID_MSG "denied read of sensitive /proc/pid/%s entry via fd passed across exec by " +#define GR_SYMLINKOWNER_MSG "denied following symlink %.950s since symlink owner %u does not match target owner %u, by " ++#define GR_BRUTE_DAEMON_MSG "bruteforce prevention initiated for the next 30 minutes or until service restarted, stalling each fork 30 seconds. Please investigate the crash report for " diff --git a/include/linux/grsecurity.h b/include/linux/grsecurity.h new file mode 100644 -index 0000000..38bfb04 +index 0000000..d7ef0ac --- /dev/null +++ b/include/linux/grsecurity.h -@@ -0,0 +1,233 @@ +@@ -0,0 +1,242 @@ +#ifndef GR_SECURITY_H +#define GR_SECURITY_H +#include <linux/fs.h> @@ -61651,21 +68534,7 @@ index 0000000..38bfb04 +#error "CONFIG_PAX enabled, but no PaX options are enabled." +#endif + -+#include <linux/compat.h> -+ -+struct user_arg_ptr { -+#ifdef CONFIG_COMPAT -+ bool is_compat; -+#endif -+ union { -+ const char __user *const __user *native; -+#ifdef CONFIG_COMPAT -+ compat_uptr_t __user *compat; -+#endif -+ } ptr; -+}; -+ -+void gr_handle_brute_attach(struct task_struct *p, unsigned long mm_flags); ++void gr_handle_brute_attach(unsigned long mm_flags); +void gr_handle_brute_check(void); +void gr_handle_kernel_exploit(void); +int gr_process_user_ban(void); @@ -61674,8 +68543,8 @@ index 0000000..38bfb04 + +int gr_acl_enable_at_secure(void); + -+int gr_check_user_change(int real, int effective, int fs); -+int gr_check_group_change(int real, int effective, int fs); ++int gr_check_user_change(kuid_t real, kuid_t effective, kuid_t fs); ++int gr_check_group_change(kgid_t real, kgid_t effective, kgid_t fs); + +void gr_del_task_from_ip_table(struct task_struct *p); + @@ -61688,7 +68557,7 @@ index 0000000..38bfb04 +int gr_chroot_fchdir(struct dentry *u_dentry, struct vfsmount *u_mnt); +int gr_handle_chroot_chroot(const struct dentry *dentry, + const struct vfsmount *mnt); -+void gr_handle_chroot_chdir(struct path *path); ++void gr_handle_chroot_chdir(const struct path *path); +int gr_handle_chroot_chmod(const struct dentry *dentry, + const struct vfsmount *mnt, const int mode); +int gr_handle_chroot_mknod(const struct dentry *dentry, @@ -61708,7 +68577,7 @@ index 0000000..38bfb04 + +int gr_tpe_allow(const struct file *file); + -+void gr_set_chroot_entries(struct task_struct *task, struct path *path); ++void gr_set_chroot_entries(struct task_struct *task, const struct path *path); +void gr_clear_chroot_entries(struct task_struct *task); + +void gr_log_forkfail(const int retval); @@ -61718,7 +68587,6 @@ index 0000000..38bfb04 + const struct vfsmount *mnt); +void gr_log_chroot_exec(const struct dentry *dentry, + const struct vfsmount *mnt); -+void gr_handle_exec_args(struct linux_binprm *bprm, struct user_arg_ptr argv); +void gr_log_remount(const char *devname, const int retval); +void gr_log_unmount(const char *devname, const int retval); +void gr_log_mount(const char *from, const char *to, const int retval); @@ -61737,19 +68605,17 @@ index 0000000..38bfb04 +int gr_handle_hardlink(const struct dentry *dentry, + const struct vfsmount *mnt, + struct inode *inode, -+ const int mode, const char *to); ++ const int mode, const struct filename *to); + +int gr_is_capable(const int cap); +int gr_is_capable_nolog(const int cap); +int gr_task_is_capable(const struct task_struct *task, const struct cred *cred, const int cap); +int gr_task_is_capable_nolog(const struct task_struct *task, const int cap); + -+void gr_learn_resource(const struct task_struct *task, const int limit, -+ const unsigned long wanted, const int gt); +void gr_copy_label(struct task_struct *tsk); +void gr_handle_crash(struct task_struct *task, const int sig); +int gr_handle_signal(const struct task_struct *p, const int sig); -+int gr_check_crash_uid(const uid_t uid); ++int gr_check_crash_uid(const kuid_t uid); +int gr_check_protected_task(const struct task_struct *task); +int gr_check_protected_task_fowner(struct pid *pid, enum pid_type type); +int gr_acl_handle_mmap(const struct file *file, @@ -61776,8 +68642,8 @@ index 0000000..38bfb04 +int gr_check_crash_exec(const struct file *filp); +int gr_acl_is_enabled(void); +void gr_set_kernel_label(struct task_struct *task); -+void gr_set_role_label(struct task_struct *task, const uid_t uid, -+ const gid_t gid); ++void gr_set_role_label(struct task_struct *task, const kuid_t uid, ++ const kgid_t gid); +int gr_set_proc_label(const struct dentry *dentry, + const struct vfsmount *mnt, + const int unsafe_flags); @@ -61808,19 +68674,19 @@ index 0000000..38bfb04 +__u32 gr_acl_handle_symlink(const struct dentry *new_dentry, + const struct dentry *parent_dentry, + const struct vfsmount *parent_mnt, -+ const char *from); ++ const struct filename *from); +__u32 gr_acl_handle_link(const struct dentry *new_dentry, + const struct dentry *parent_dentry, + const struct vfsmount *parent_mnt, + const struct dentry *old_dentry, -+ const struct vfsmount *old_mnt, const char *to); ++ const struct vfsmount *old_mnt, const struct filename *to); +int gr_handle_symlink_owner(const struct path *link, const struct inode *target); +int gr_acl_handle_rename(struct dentry *new_dentry, + struct dentry *parent_dentry, + const struct vfsmount *parent_mnt, + struct dentry *old_dentry, + struct inode *old_parent_inode, -+ struct vfsmount *old_mnt, const char *newname); ++ struct vfsmount *old_mnt, const struct filename *newname); +void gr_handle_rename(struct inode *old_dir, struct inode *new_dir, + struct dentry *old_dentry, + struct dentry *new_dentry, @@ -61842,9 +68708,30 @@ index 0000000..38bfb04 +int gr_handle_rofs_blockwrite(struct dentry *dentry, struct vfsmount *mnt, int acc_mode); +void gr_audit_ptrace(struct task_struct *task); +dev_t gr_get_dev_from_dentry(struct dentry *dentry); ++void gr_put_exec_file(struct task_struct *task); + +int gr_ptrace_readexec(struct file *file, int unsafe_flags); + ++#if defined(CONFIG_GRKERNSEC) && (defined(CONFIG_GRKERNSEC_RESLOG) || !defined(CONFIG_GRKERNSEC_NO_RBAC)) ++extern void gr_learn_resource(const struct task_struct *task, const int res, ++ const unsigned long wanted, const int gt); ++#else ++static inline void gr_learn_resource(const struct task_struct *task, const int res, ++ const unsigned long wanted, const int gt) ++{ ++} ++#endif ++ ++#ifdef CONFIG_GRKERNSEC_RESLOG ++extern void gr_log_resource(const struct task_struct *task, const int res, ++ const unsigned long wanted, const int gt); ++#else ++static inline void gr_log_resource(const struct task_struct *task, const int res, ++ const unsigned long wanted, const int gt) ++{ ++} ++#endif ++ +#ifdef CONFIG_GRKERNSEC +void task_grsec_rbac(struct seq_file *m, struct task_struct *p); +void gr_handle_vm86(void); @@ -61854,6 +68741,11 @@ index 0000000..38bfb04 + +extern int grsec_enable_dmesg; +extern int grsec_disable_privio; ++ ++#ifdef CONFIG_GRKERNSEC_PROC_USERGROUP ++extern kgid_t grsec_proc_gid; ++#endif ++ +#ifdef CONFIG_GRKERNSEC_CHROOT_FINDTASK +extern int grsec_enable_chroot_findtask; +#endif @@ -61888,24 +68780,11 @@ index 0000000..e7ffaaf + const int protocol); + +#endif -diff --git a/include/linux/hid.h b/include/linux/hid.h -index 3a95da6..51986f1 100644 ---- a/include/linux/hid.h -+++ b/include/linux/hid.h -@@ -696,7 +696,7 @@ struct hid_ll_driver { - unsigned int code, int value); - - int (*parse)(struct hid_device *hdev); --}; -+} __no_const; - - #define PM_HINT_FULLON 1<<5 - #define PM_HINT_NORMAL 1<<1 diff --git a/include/linux/highmem.h b/include/linux/highmem.h -index d3999b4..1304cb4 100644 +index 7fb31da..08b5114 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h -@@ -221,6 +221,18 @@ static inline void clear_highpage(struct page *page) +@@ -189,6 +189,18 @@ static inline void clear_highpage(struct page *page) kunmap_atomic(kaddr); } @@ -61924,11 +68803,34 @@ index d3999b4..1304cb4 100644 static inline void zero_user_segments(struct page *page, unsigned start1, unsigned end1, unsigned start2, unsigned end2) +diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h +index 1c7b89a..7f52502 100644 +--- a/include/linux/hwmon-sysfs.h ++++ b/include/linux/hwmon-sysfs.h +@@ -25,7 +25,8 @@ + struct sensor_device_attribute{ + struct device_attribute dev_attr; + int index; +-}; ++} __do_const; ++typedef struct sensor_device_attribute __no_const sensor_device_attribute_no_const; + #define to_sensor_dev_attr(_dev_attr) \ + container_of(_dev_attr, struct sensor_device_attribute, dev_attr) + +@@ -41,7 +42,7 @@ struct sensor_device_attribute_2 { + struct device_attribute dev_attr; + u8 index; + u8 nr; +-}; ++} __do_const; + #define to_sensor_dev_attr_2(_dev_attr) \ + container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) + diff --git a/include/linux/i2c.h b/include/linux/i2c.h -index 195d8b3..e20cfab 100644 +index d0c4db7..61b3577 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h -@@ -365,6 +365,7 @@ struct i2c_algorithm { +@@ -369,6 +369,7 @@ struct i2c_algorithm { /* To determine what the adapter supports */ u32 (*functionality) (struct i2c_adapter *); }; @@ -61949,96 +68851,84 @@ index d23c3c2..eb63c81 100644 struct list_head context_list; /* list of context id's and pointers */ #endif -diff --git a/include/linux/if_team.h b/include/linux/if_team.h -index 58404b0..439ed95 100644 ---- a/include/linux/if_team.h -+++ b/include/linux/if_team.h -@@ -64,6 +64,7 @@ struct team_mode_ops { - void (*port_leave)(struct team *team, struct team_port *port); - void (*port_change_mac)(struct team *team, struct team_port *port); - }; -+typedef struct team_mode_ops __no_const team_mode_ops_no_const; - - enum team_option_type { - TEAM_OPTION_TYPE_U32, -@@ -112,7 +113,7 @@ struct team { - struct list_head option_list; - - const struct team_mode *mode; -- struct team_mode_ops ops; -+ team_mode_ops_no_const ops; - long mode_priv[TEAM_MODE_PRIV_LONGS]; - }; +diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h +index aff7ad8..3942bbd 100644 +--- a/include/linux/if_pppox.h ++++ b/include/linux/if_pppox.h +@@ -76,7 +76,7 @@ struct pppox_proto { + int (*ioctl)(struct socket *sock, unsigned int cmd, + unsigned long arg); + struct module *owner; +-}; ++} __do_const; + extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp); + extern void unregister_pppox_proto(int proto_num); diff --git a/include/linux/init.h b/include/linux/init.h -index 6b95109..bcbdd68 100644 +index 8618147..0821126 100644 --- a/include/linux/init.h +++ b/include/linux/init.h -@@ -39,9 +39,15 @@ +@@ -39,9 +39,36 @@ * Also note, that this data cannot be "const". */ +#ifdef MODULE -+#define add_latent_entropy ++#define add_init_latent_entropy ++#define add_devinit_latent_entropy ++#define add_cpuinit_latent_entropy ++#define add_meminit_latent_entropy ++#else ++#define add_init_latent_entropy __latent_entropy ++ ++#ifdef CONFIG_HOTPLUG ++#define add_devinit_latent_entropy ++#else ++#define add_devinit_latent_entropy __latent_entropy ++#endif ++ ++#ifdef CONFIG_HOTPLUG_CPU ++#define add_cpuinit_latent_entropy +#else -+#define add_latent_entropy __latent_entropy ++#define add_cpuinit_latent_entropy __latent_entropy ++#endif ++ ++#ifdef CONFIG_MEMORY_HOTPLUG ++#define add_meminit_latent_entropy ++#else ++#define add_meminit_latent_entropy __latent_entropy ++#endif +#endif + /* These are for everybody (although not all archs will actually discard it in modules) */ -#define __init __section(.init.text) __cold notrace -+#define __init __section(.init.text) __cold notrace add_latent_entropy ++#define __init __section(.init.text) __cold notrace add_init_latent_entropy #define __initdata __section(.init.data) - #define __initconst __section(.init.rodata) + #define __initconst __constsection(.init.rodata) #define __exitdata __section(.exit.data) -@@ -83,7 +89,7 @@ +@@ -94,7 +121,7 @@ #define __exit __section(.exit.text) __exitused __cold notrace - /* Used for HOTPLUG */ --#define __devinit __section(.devinit.text) __cold notrace -+#define __devinit __section(.devinit.text) __cold notrace add_latent_entropy - #define __devinitdata __section(.devinit.data) - #define __devinitconst __section(.devinit.rodata) - #define __devexit __section(.devexit.text) __exitused __cold notrace -@@ -91,7 +97,7 @@ - #define __devexitconst __section(.devexit.rodata) - /* Used for HOTPLUG_CPU */ -#define __cpuinit __section(.cpuinit.text) __cold notrace -+#define __cpuinit __section(.cpuinit.text) __cold notrace add_latent_entropy ++#define __cpuinit __section(.cpuinit.text) __cold notrace add_cpuinit_latent_entropy #define __cpuinitdata __section(.cpuinit.data) - #define __cpuinitconst __section(.cpuinit.rodata) + #define __cpuinitconst __constsection(.cpuinit.rodata) #define __cpuexit __section(.cpuexit.text) __exitused __cold notrace -@@ -99,7 +105,7 @@ - #define __cpuexitconst __section(.cpuexit.rodata) +@@ -102,7 +129,7 @@ + #define __cpuexitconst __constsection(.cpuexit.rodata) /* Used for MEMORY_HOTPLUG */ -#define __meminit __section(.meminit.text) __cold notrace -+#define __meminit __section(.meminit.text) __cold notrace add_latent_entropy ++#define __meminit __section(.meminit.text) __cold notrace add_meminit_latent_entropy #define __meminitdata __section(.meminit.data) - #define __meminitconst __section(.meminit.rodata) + #define __meminitconst __constsection(.meminit.rodata) #define __memexit __section(.memexit.text) __exitused __cold notrace -@@ -294,13 +300,13 @@ void __init parse_early_options(char *cmdline); - - /* Each module must use one module_init(). */ - #define module_init(initfn) \ -- static inline initcall_t __inittest(void) \ -+ static inline __used initcall_t __inittest(void) \ - { return initfn; } \ - int init_module(void) __attribute__((alias(#initfn))); - - /* This is only required if you want to be unloadable. */ - #define module_exit(exitfn) \ -- static inline exitcall_t __exittest(void) \ -+ static inline __used exitcall_t __exittest(void) \ - { return exitfn; } \ - void cleanup_module(void) __attribute__((alias(#exitfn))); - diff --git a/include/linux/init_task.h b/include/linux/init_task.h -index e4baff5..83bb175 100644 +index 5cd0f09..c9f67cc 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h -@@ -134,6 +134,12 @@ extern struct cred init_cred; +@@ -154,6 +154,12 @@ extern struct task_group root_task_group; #define INIT_TASK_COMM "swapper" @@ -62051,32 +68941,19 @@ index e4baff5..83bb175 100644 /* * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) -@@ -172,6 +178,7 @@ extern struct cred init_cred; - RCU_INIT_POINTER(.cred, &init_cred), \ +@@ -193,6 +199,7 @@ extern struct task_group root_task_group; + RCU_POINTER_INITIALIZER(cred, &init_cred), \ .comm = INIT_TASK_COMM, \ .thread = INIT_THREAD, \ + INIT_TASK_THREAD_INFO \ .fs = &init_fs, \ .files = &init_files, \ .signal = &init_signals, \ -diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h -index e6ca56d..8583707 100644 ---- a/include/linux/intel-iommu.h -+++ b/include/linux/intel-iommu.h -@@ -296,7 +296,7 @@ struct iommu_flush { - u8 fm, u64 type); - void (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr, - unsigned int size_order, u64 type); --}; -+} __no_const; - - enum { - SR_DMAR_FECTL_REG, diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index 2aea5d2..0b82f0c 100644 +index 5fa5afe..ac55b25 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -439,7 +439,7 @@ enum +@@ -430,7 +430,7 @@ enum /* map softirq index to softirq name. update 'softirq_to_name' in * kernel/softirq.c when adding a new softirq. */ @@ -62085,13 +68962,14 @@ index 2aea5d2..0b82f0c 100644 /* softirq mask and active fields moved to irq_cpustat_t in * asm/hardirq.h to get better cache usage. KAO -@@ -447,12 +447,12 @@ extern char *softirq_to_name[NR_SOFTIRQS]; +@@ -438,12 +438,12 @@ extern char *softirq_to_name[NR_SOFTIRQS]; struct softirq_action { - void (*action)(struct softirq_action *); +-}; + void (*action)(void); - }; ++} __no_const; asmlinkage void do_softirq(void); asmlinkage void __do_softirq(void); @@ -62100,8 +68978,65 @@ index 2aea5d2..0b82f0c 100644 extern void softirq_init(void); extern void __raise_softirq_irqoff(unsigned int nr); +diff --git a/include/linux/iommu.h b/include/linux/iommu.h +index ba3b8a9..7e14ed8 100644 +--- a/include/linux/iommu.h ++++ b/include/linux/iommu.h +@@ -113,7 +113,7 @@ struct iommu_ops { + u32 (*domain_get_windows)(struct iommu_domain *domain); + + unsigned long pgsize_bitmap; +-}; ++} __do_const; + + #define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */ + #define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */ +diff --git a/include/linux/ioport.h b/include/linux/ioport.h +index 85ac9b9b..e5759ab 100644 +--- a/include/linux/ioport.h ++++ b/include/linux/ioport.h +@@ -161,7 +161,7 @@ struct resource *lookup_resource(struct resource *root, resource_size_t start); + int adjust_resource(struct resource *res, resource_size_t start, + resource_size_t size); + resource_size_t resource_alignment(struct resource *res); +-static inline resource_size_t resource_size(const struct resource *res) ++static inline resource_size_t __intentional_overflow(-1) resource_size(const struct resource *res) + { + return res->end - res->start + 1; + } +diff --git a/include/linux/irq.h b/include/linux/irq.h +index bc4e066..50468a9 100644 +--- a/include/linux/irq.h ++++ b/include/linux/irq.h +@@ -328,7 +328,8 @@ struct irq_chip { + void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); + + unsigned long flags; +-}; ++} __do_const; ++typedef struct irq_chip __no_const irq_chip_no_const; + + /* + * irq_chip specific flags +diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h +index 3fd8e42..a73e966 100644 +--- a/include/linux/irqchip/arm-gic.h ++++ b/include/linux/irqchip/arm-gic.h +@@ -59,9 +59,11 @@ + + #ifndef __ASSEMBLY__ + ++#include <linux/irq.h> ++ + struct device_node; + +-extern struct irq_chip gic_arch_extn; ++extern irq_chip_no_const gic_arch_extn; + + void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *, + u32 offset, struct device_node *); diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h -index 3875719..4cd454c 100644 +index 6883e19..06992b1 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -15,7 +15,8 @@ @@ -62114,7 +69049,7 @@ index 3875719..4cd454c 100644 /* Lookup the address for a symbol. Returns 0 if not found. */ unsigned long kallsyms_lookup_name(const char *name); -@@ -99,6 +100,16 @@ static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, u +@@ -106,6 +107,17 @@ static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, u /* Stupid that this does nothing, but I didn't create this mess. */ #define __print_symbol(fmt, addr) #endif /*CONFIG_KALLSYMS*/ @@ -62123,6 +69058,7 @@ index 3875719..4cd454c 100644 +extern void __print_symbol(const char *fmt, unsigned long address); +extern int sprint_backtrace(char *buffer, unsigned long address); +extern int sprint_symbol(char *buffer, unsigned long address); ++extern int sprint_symbol_no_offset(char *buffer, unsigned long address); +const char *kallsyms_lookup(unsigned long addr, + unsigned long *symbolsize, + unsigned long *offset, @@ -62131,11 +69067,24 @@ index 3875719..4cd454c 100644 /* This macro allows us to keep printk typechecking */ static __printf(1, 2) +diff --git a/include/linux/key-type.h b/include/linux/key-type.h +index 518a53a..5e28358 100644 +--- a/include/linux/key-type.h ++++ b/include/linux/key-type.h +@@ -125,7 +125,7 @@ struct key_type { + /* internal fields */ + struct list_head link; /* link in types list */ + struct lock_class_key lock_class; /* key->sem lock class */ +-}; ++} __do_const; + + extern struct key_type key_type_keyring; + diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h -index c4d2fc1..5df9c19 100644 +index c6e091b..a940adf 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h -@@ -53,7 +53,7 @@ extern int kgdb_connected; +@@ -52,7 +52,7 @@ extern int kgdb_connected; extern int kgdb_io_module_registered; extern atomic_t kgdb_setting_breakpoint; @@ -62144,16 +69093,16 @@ index c4d2fc1..5df9c19 100644 extern struct task_struct *kgdb_usethread; extern struct task_struct *kgdb_contthread; -@@ -252,7 +252,7 @@ struct kgdb_arch { - void (*disable_hw_break)(struct pt_regs *regs); - void (*remove_all_hw_break)(void); +@@ -254,7 +254,7 @@ struct kgdb_arch { void (*correct_hw_break)(void); + + void (*enable_nmi)(bool on); -}; +} __do_const; /** * struct kgdb_io - Describe the interface for an I/O driver to talk with KGDB. -@@ -277,7 +277,7 @@ struct kgdb_io { +@@ -279,7 +279,7 @@ struct kgdb_io { void (*pre_exception) (void); void (*post_exception) (void); int is_console; @@ -62163,7 +69112,7 @@ index c4d2fc1..5df9c19 100644 extern struct kgdb_arch arch_kgdb_ops; diff --git a/include/linux/kmod.h b/include/linux/kmod.h -index dd99c32..da06047 100644 +index 5398d58..5883a34 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -34,6 +34,8 @@ extern char modprobe_path[]; /* for sysctl */ @@ -62175,11 +69124,45 @@ index dd99c32..da06047 100644 #define request_module(mod...) __request_module(true, mod) #define request_module_nowait(mod...) __request_module(false, mod) #define try_then_request_module(x, mod...) \ +diff --git a/include/linux/kobject.h b/include/linux/kobject.h +index 939b112..ed6ed51 100644 +--- a/include/linux/kobject.h ++++ b/include/linux/kobject.h +@@ -111,7 +111,7 @@ struct kobj_type { + struct attribute **default_attrs; + const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj); + const void *(*namespace)(struct kobject *kobj); +-}; ++} __do_const; + + struct kobj_uevent_env { + char *envp[UEVENT_NUM_ENVP]; +@@ -134,6 +134,7 @@ struct kobj_attribute { + ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr, + const char *buf, size_t count); + }; ++typedef struct kobj_attribute __no_const kobj_attribute_no_const; + + extern const struct sysfs_ops kobj_sysfs_ops; + +diff --git a/include/linux/kobject_ns.h b/include/linux/kobject_ns.h +index f66b065..c2c29b4 100644 +--- a/include/linux/kobject_ns.h ++++ b/include/linux/kobject_ns.h +@@ -43,7 +43,7 @@ struct kobj_ns_type_operations { + const void *(*netlink_ns)(struct sock *sk); + const void *(*initial_ns)(void); + void (*drop_ns)(void *); +-}; ++} __do_const; + + int kobj_ns_type_register(const struct kobj_ns_type_operations *ops); + int kobj_ns_type_registered(enum kobj_ns_type type); diff --git a/include/linux/kref.h b/include/linux/kref.h -index 9c07dce..a92fa71 100644 +index 7419c02..aa2f02d 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h -@@ -63,7 +63,7 @@ static inline void kref_get(struct kref *kref) +@@ -65,7 +65,7 @@ static inline void kref_get(struct kref *kref) static inline int kref_sub(struct kref *kref, unsigned int count, void (*release)(struct kref *kref)) { @@ -62189,11 +69172,11 @@ index 9c07dce..a92fa71 100644 if (atomic_sub_and_test((int) count, &kref->refcount)) { release(kref); diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h -index 72cbf08..dd0201d 100644 +index c139582..0b5b102 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h -@@ -322,7 +322,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); - void vcpu_load(struct kvm_vcpu *vcpu); +@@ -424,7 +424,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); + int __must_check vcpu_load(struct kvm_vcpu *vcpu); void vcpu_put(struct kvm_vcpu *vcpu); -int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, @@ -62201,7 +69184,7 @@ index 72cbf08..dd0201d 100644 struct module *module); void kvm_exit(void); -@@ -486,7 +486,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, +@@ -582,7 +582,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg); int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run); @@ -62211,10 +69194,10 @@ index 72cbf08..dd0201d 100644 int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu); diff --git a/include/linux/libata.h b/include/linux/libata.h -index 6e887c7..4539601 100644 +index eae7a05..2cdd875 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h -@@ -910,7 +910,7 @@ struct ata_port_operations { +@@ -919,7 +919,7 @@ struct ata_port_operations { * fields must be pointers. */ const struct ata_port_operations *inherits; @@ -62223,77 +69206,130 @@ index 6e887c7..4539601 100644 struct ata_port_info { unsigned long flags; -diff --git a/include/linux/mca.h b/include/linux/mca.h -index 3797270..7765ede 100644 ---- a/include/linux/mca.h -+++ b/include/linux/mca.h -@@ -80,7 +80,7 @@ struct mca_bus_accessor_functions { - int region); - void * (*mca_transform_memory)(struct mca_device *, - void *memory); --}; -+} __no_const; - - struct mca_bus { - u64 default_dma_mask; -diff --git a/include/linux/memory.h b/include/linux/memory.h -index 1ac7f6e..a5794d0 100644 ---- a/include/linux/memory.h -+++ b/include/linux/memory.h -@@ -143,7 +143,7 @@ struct memory_accessor { - size_t count); - ssize_t (*write)(struct memory_accessor *, const char *buf, - off_t offset, size_t count); --}; -+} __no_const; +diff --git a/include/linux/list.h b/include/linux/list.h +index 6a1f8df..eaec1ff 100644 +--- a/include/linux/list.h ++++ b/include/linux/list.h +@@ -112,6 +112,19 @@ extern void __list_del_entry(struct list_head *entry); + extern void list_del(struct list_head *entry); + #endif - /* - * Kernel text modification mutex, used for code patching. Users of this lock -diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h -index ee96cd5..7823c3a 100644 ---- a/include/linux/mfd/abx500.h -+++ b/include/linux/mfd/abx500.h -@@ -455,6 +455,7 @@ struct abx500_ops { - int (*event_registers_startup_state_get) (struct device *, u8 *); - int (*startup_irq_enabled) (struct device *, unsigned int); - }; -+typedef struct abx500_ops __no_const abx500_ops_no_const; - - int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); - void abx500_remove_ops(struct device *dev); -diff --git a/include/linux/mfd/abx500/ux500_chargalg.h b/include/linux/mfd/abx500/ux500_chargalg.h -index 9b07725..3d55001 100644 ---- a/include/linux/mfd/abx500/ux500_chargalg.h -+++ b/include/linux/mfd/abx500/ux500_chargalg.h -@@ -19,7 +19,7 @@ struct ux500_charger_ops { - int (*enable) (struct ux500_charger *, int, int, int); - int (*kick_wd) (struct ux500_charger *); - int (*update_curr) (struct ux500_charger *, int); --}; -+} __no_const; ++extern void __pax_list_add(struct list_head *new, ++ struct list_head *prev, ++ struct list_head *next); ++static inline void pax_list_add(struct list_head *new, struct list_head *head) ++{ ++ __pax_list_add(new, head, head->next); ++} ++static inline void pax_list_add_tail(struct list_head *new, struct list_head *head) ++{ ++ __pax_list_add(new, head->prev, head); ++} ++extern void pax_list_del(struct list_head *entry); ++ + /** + * list_replace - replace old entry by new one + * @old : the element to be replaced +@@ -145,6 +158,8 @@ static inline void list_del_init(struct list_head *entry) + INIT_LIST_HEAD(entry); + } ++extern void pax_list_del_init(struct list_head *entry); ++ /** - * struct ux500_charger - power supply ux500 charger sub class + * list_move - delete from one list and add as another's head + * @list: the entry to move +diff --git a/include/linux/math64.h b/include/linux/math64.h +index b8ba855..0148090 100644 +--- a/include/linux/math64.h ++++ b/include/linux/math64.h +@@ -14,7 +14,7 @@ + * This is commonly provided by 32bit archs to provide an optimized 64bit + * divide. + */ +-static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) ++static inline u64 __intentional_overflow(-1) div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) + { + *remainder = dividend % divisor; + return dividend / divisor; +@@ -50,7 +50,7 @@ static inline s64 div64_s64(s64 dividend, s64 divisor) + #define div64_long(x,y) div_s64((x),(y)) + + #ifndef div_u64_rem +-static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) ++static inline u64 __intentional_overflow(-1) div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) + { + *remainder = do_div(dividend, divisor); + return dividend; +@@ -79,7 +79,7 @@ extern s64 div64_s64(s64 dividend, s64 divisor); + * divide. + */ + #ifndef div_u64 +-static inline u64 div_u64(u64 dividend, u32 divisor) ++static inline u64 __intentional_overflow(-1) div_u64(u64 dividend, u32 divisor) + { + u32 remainder; + return div_u64_rem(dividend, divisor, &remainder); diff --git a/include/linux/mm.h b/include/linux/mm.h -index 441a564..81a3499 100644 +index e2091b8..821db54 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -116,7 +116,14 @@ extern unsigned int kobjsize(const void *objp); - - #define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */ - #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ +@@ -101,6 +101,11 @@ extern unsigned int kobjsize(const void *objp); + #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ + #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ + #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ + +#if defined(CONFIG_PAX_PAGEEXEC) && defined(CONFIG_X86_32) -+#define VM_SAO 0x00000000 /* Strong Access Ordering (powerpc) */ -+#define VM_PAGEEXEC 0x20000000 /* vma->vm_page_prot needs special handling */ -+#else - #define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ ++#define VM_PAGEEXEC 0x02000000 /* vma->vm_page_prot needs special handling */ +#endif + - #define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ - #define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ + #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ + + #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ +@@ -202,8 +207,8 @@ struct vm_operations_struct { + /* called by access_process_vm when get_user_pages() fails, typically + * for use by special VMAs that can switch between memory and hardware + */ +- int (*access)(struct vm_area_struct *vma, unsigned long addr, +- void *buf, int len, int write); ++ ssize_t (*access)(struct vm_area_struct *vma, unsigned long addr, ++ void *buf, size_t len, int write); + #ifdef CONFIG_NUMA + /* + * set_policy() op must add a reference to any non-NULL @new mempolicy +@@ -233,6 +238,7 @@ struct vm_operations_struct { + int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr, + unsigned long size, pgoff_t pgoff); + }; ++typedef struct vm_operations_struct __no_const vm_operations_struct_no_const; + + struct mmu_gather; + struct inode; +@@ -970,8 +976,8 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address, + unsigned long *pfn); + int follow_phys(struct vm_area_struct *vma, unsigned long address, + unsigned int flags, unsigned long *prot, resource_size_t *phys); +-int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, +- void *buf, int len, int write); ++ssize_t generic_access_phys(struct vm_area_struct *vma, unsigned long addr, ++ void *buf, size_t len, int write); + + static inline void unmap_shared_mapping_range(struct address_space *mapping, + loff_t const holebegin, loff_t const holelen) +@@ -1010,9 +1016,9 @@ static inline int fixup_user_fault(struct task_struct *tsk, + } + #endif + +-extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); +-extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, +- void *buf, int len, int write); ++extern ssize_t access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, size_t len, int write); ++extern ssize_t access_remote_vm(struct mm_struct *mm, unsigned long addr, ++ void *buf, size_t len, int write); -@@ -1013,34 +1020,6 @@ int set_page_dirty(struct page *page); + long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, +@@ -1043,34 +1049,6 @@ int set_page_dirty(struct page *page); int set_page_dirty_lock(struct page *page); int clear_page_dirty_for_io(struct page *page); @@ -62328,7 +69364,7 @@ index 441a564..81a3499 100644 extern pid_t vm_is_stack(struct task_struct *task, struct vm_area_struct *vma, int in_group); -@@ -1139,6 +1118,15 @@ static inline void sync_mm_rss(struct mm_struct *mm) +@@ -1173,6 +1151,15 @@ static inline void sync_mm_rss(struct mm_struct *mm) } #endif @@ -62344,7 +69380,7 @@ index 441a564..81a3499 100644 int vma_wants_writenotify(struct vm_area_struct *vma); extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, -@@ -1157,8 +1145,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, +@@ -1191,8 +1178,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, { return 0; } @@ -62360,7 +69396,7 @@ index 441a564..81a3499 100644 #endif #ifdef __PAGETABLE_PMD_FOLDED -@@ -1167,8 +1162,15 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, +@@ -1201,8 +1195,15 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, { return 0; } @@ -62376,7 +69412,7 @@ index 441a564..81a3499 100644 #endif int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, -@@ -1186,11 +1188,23 @@ static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long a +@@ -1220,11 +1221,23 @@ static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long a NULL: pud_offset(pgd, address); } @@ -62400,15 +69436,23 @@ index 441a564..81a3499 100644 #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ #if USE_SPLIT_PTLOCKS -@@ -1400,6 +1414,7 @@ extern unsigned long do_mmap(struct file *, unsigned long, - unsigned long, unsigned long, - unsigned long, unsigned long); +@@ -1455,6 +1468,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, + unsigned long len, unsigned long prot, unsigned long flags, + unsigned long pgoff, unsigned long *populate); extern int do_munmap(struct mm_struct *, unsigned long, size_t); +extern int __do_munmap(struct mm_struct *, unsigned long, size_t); - /* These take the mm semaphore themselves */ - extern unsigned long vm_brk(unsigned long, unsigned long); -@@ -1462,6 +1477,10 @@ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long add + #ifdef CONFIG_MMU + extern int __mm_populate(unsigned long addr, unsigned long len, +@@ -1483,6 +1497,7 @@ struct vm_unmapped_area_info { + unsigned long high_limit; + unsigned long align_mask; + unsigned long align_offset; ++ unsigned long threadstack_offset; + }; + + extern unsigned long unmapped_area(struct vm_unmapped_area_info *info); +@@ -1561,6 +1576,10 @@ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long add extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr, struct vm_area_struct **pprev); @@ -62419,7 +69463,7 @@ index 441a564..81a3499 100644 /* Look up the first VMA which intersects the interval start_addr..end_addr-1, NULL if none. Assume start_addr < end_addr. */ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr) -@@ -1490,15 +1509,6 @@ static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm, +@@ -1589,15 +1608,6 @@ static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm, return vma; } @@ -62432,19 +69476,31 @@ index 441a564..81a3499 100644 -} -#endif - - struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); - int remap_pfn_range(struct vm_area_struct *, unsigned long addr, - unsigned long pfn, unsigned long size, pgprot_t); -@@ -1603,7 +1613,7 @@ extern int unpoison_memory(unsigned long pfn); + #ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE + unsigned long change_prot_numa(struct vm_area_struct *vma, + unsigned long start, unsigned long end); +@@ -1649,6 +1659,11 @@ void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); + static inline void vm_stat_account(struct mm_struct *mm, + unsigned long flags, struct file *file, long pages) + { ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP) || (flags & (VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC))) ++#endif ++ + mm->total_vm += pages; + } + #endif /* CONFIG_PROC_FS */ +@@ -1725,7 +1740,7 @@ extern int unpoison_memory(unsigned long pfn); extern int sysctl_memory_failure_early_kill; extern int sysctl_memory_failure_recovery; extern void shake_page(struct page *p, int access); --extern atomic_long_t mce_bad_pages; -+extern atomic_long_unchecked_t mce_bad_pages; +-extern atomic_long_t num_poisoned_pages; ++extern atomic_long_unchecked_t num_poisoned_pages; extern int soft_offline_page(struct page *page, int flags); extern void dump_page(struct page *page); -@@ -1634,5 +1644,11 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; } +@@ -1756,5 +1771,11 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; } static inline bool page_is_guard(struct page *page) { return false; } #endif /* CONFIG_DEBUG_PAGEALLOC */ @@ -62457,10 +69513,10 @@ index 441a564..81a3499 100644 #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index b35752f..41075a0 100644 +index ace9a5f..81bdb59 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h -@@ -262,6 +262,8 @@ struct vm_area_struct { +@@ -289,6 +289,8 @@ struct vm_area_struct { #ifdef CONFIG_NUMA struct mempolicy *vm_policy; /* NUMA policy for the VMA */ #endif @@ -62469,21 +69525,12 @@ index b35752f..41075a0 100644 }; struct core_thread { -@@ -336,7 +338,7 @@ struct mm_struct { - unsigned long def_flags; - unsigned long nr_ptes; /* Page table pages */ - unsigned long start_code, end_code, start_data, end_data; -- unsigned long start_brk, brk, start_stack; -+ unsigned long brk_gap, start_brk, brk, start_stack; - unsigned long arg_start, arg_end, env_start, env_end; - - unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ -@@ -398,6 +400,24 @@ struct mm_struct { - #ifdef CONFIG_CPUMASK_OFFSTACK - struct cpumask cpumask_allocation; +@@ -437,6 +439,24 @@ struct mm_struct { + int first_nid; #endif + struct uprobes_state uprobes_state; + -+#if defined(CONFIG_PAX_EI_PAX) || defined(CONFIG_PAX_PT_PAX_FLAGS) || defined(CONFIG_PAX_XATTR_PAX_FLAGS) || defined(CONFIG_PAX_HAVE_ACL_FLAGS) || defined(CONFIG_PAX_HOOK_ACL_FLAGS) ++#if defined(CONFIG_PAX_NOEXEC) || defined(CONFIG_PAX_ASLR) + unsigned long pax_flags; +#endif + @@ -62502,32 +69549,34 @@ index b35752f..41075a0 100644 + }; - static inline void mm_init_cpumask(struct mm_struct *mm) -diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h -index 1d1b1e1..2a13c78 100644 ---- a/include/linux/mmu_notifier.h -+++ b/include/linux/mmu_notifier.h -@@ -255,12 +255,12 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) - */ - #define ptep_clear_flush_notify(__vma, __address, __ptep) \ - ({ \ -- pte_t __pte; \ -+ pte_t ___pte; \ - struct vm_area_struct *___vma = __vma; \ - unsigned long ___address = __address; \ -- __pte = ptep_clear_flush(___vma, ___address, __ptep); \ -+ ___pte = ptep_clear_flush(___vma, ___address, __ptep); \ - mmu_notifier_invalidate_page(___vma->vm_mm, ___address); \ -- __pte; \ -+ ___pte; \ - }) + /* first nid will either be a valid NID or one of these values */ +diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h +index c5d5278..f0b68c8 100644 +--- a/include/linux/mmiotrace.h ++++ b/include/linux/mmiotrace.h +@@ -46,7 +46,7 @@ extern int kmmio_handler(struct pt_regs *regs, unsigned long addr); + /* Called from ioremap.c */ + extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size, + void __iomem *addr); +-extern void mmiotrace_iounmap(volatile void __iomem *addr); ++extern void mmiotrace_iounmap(const volatile void __iomem *addr); + + /* For anyone to insert markers. Remember trailing newline. */ + extern __printf(1, 2) int mmiotrace_printk(const char *fmt, ...); +@@ -66,7 +66,7 @@ static inline void mmiotrace_ioremap(resource_size_t offset, + { + } + +-static inline void mmiotrace_iounmap(volatile void __iomem *addr) ++static inline void mmiotrace_iounmap(const volatile void __iomem *addr) + { + } - #define pmdp_clear_flush_notify(__vma, __address, __pmdp) \ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h -index 5f6806b..49db2b2 100644 +index c74092e..b663967 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h -@@ -380,7 +380,7 @@ struct zone { +@@ -396,7 +396,7 @@ struct zone { unsigned long flags; /* zone flags, see below */ /* Zone statistics */ @@ -62537,7 +69586,7 @@ index 5f6806b..49db2b2 100644 /* * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h -index 501da4c..ba79bb4 100644 +index 779cf7c..e6768240 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -12,7 +12,7 @@ @@ -62549,20 +69598,29 @@ index 501da4c..ba79bb4 100644 struct pci_device_id { __u32 vendor, device; /* Vendor and device ID or PCI_ANY_ID*/ -@@ -131,7 +131,7 @@ struct usb_device_id { - #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 +@@ -138,7 +138,7 @@ struct usb_device_id { #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 + #define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400 -#define HID_ANY_ID (~0) +#define HID_ANY_ID (~0U) + #define HID_BUS_ANY 0xffff + #define HID_GROUP_ANY 0x0000 - struct hid_device_id { - __u16 bus; +@@ -464,7 +464,7 @@ struct dmi_system_id { + const char *ident; + struct dmi_strmatch matches[4]; + void *driver_data; +-}; ++} __do_const; + /* + * struct dmi_device_id appears during expansion of + * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it diff --git a/include/linux/module.h b/include/linux/module.h -index fbcafe2..e5d9587 100644 +index ead1b57..81a3b6c 100644 --- a/include/linux/module.h +++ b/include/linux/module.h -@@ -17,6 +17,7 @@ +@@ -17,9 +17,11 @@ #include <linux/moduleparam.h> #include <linux/tracepoint.h> #include <linux/export.h> @@ -62570,7 +69628,35 @@ index fbcafe2..e5d9587 100644 #include <linux/percpu.h> #include <asm/module.h> -@@ -273,19 +274,16 @@ struct module ++#include <asm/pgtable.h> + + /* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */ + #define MODULE_SIG_STRING "~Module signature appended~\n" +@@ -54,12 +56,13 @@ struct module_attribute { + int (*test)(struct module *); + void (*free)(struct module *); + }; ++typedef struct module_attribute __no_const module_attribute_no_const; + + struct module_version_attribute { + struct module_attribute mattr; + const char *module_name; + const char *version; +-} __attribute__ ((__aligned__(sizeof(void *)))); ++} __do_const __attribute__ ((__aligned__(sizeof(void *)))); + + extern ssize_t __modver_version_show(struct module_attribute *, + struct module_kobject *, char *); +@@ -232,7 +235,7 @@ struct module + + /* Sysfs stuff. */ + struct module_kobject mkobj; +- struct module_attribute *modinfo_attrs; ++ module_attribute_no_const *modinfo_attrs; + const char *version; + const char *srcversion; + struct kobject *holders_dir; +@@ -281,19 +284,16 @@ struct module int (*init)(void); /* If this is non-NULL, vfree after init() returns */ @@ -62594,7 +69680,7 @@ index fbcafe2..e5d9587 100644 /* Arch-specific module values */ struct mod_arch_specific arch; -@@ -341,6 +339,10 @@ struct module +@@ -349,6 +349,10 @@ struct module #ifdef CONFIG_EVENT_TRACING struct ftrace_event_call **trace_events; unsigned int num_trace_events; @@ -62605,7 +69691,7 @@ index fbcafe2..e5d9587 100644 #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD unsigned int num_ftrace_callsites; -@@ -388,16 +390,46 @@ bool is_module_address(unsigned long addr); +@@ -396,16 +400,46 @@ bool is_module_address(unsigned long addr); bool is_module_percpu_address(unsigned long addr); bool is_module_text_address(unsigned long addr); @@ -62621,34 +69707,34 @@ index fbcafe2..e5d9587 100644 + return ((void *)addr >= start && (void *)addr < start + size); +} + -+static inline int within_module_core_rx(unsigned long addr, struct module *mod) ++static inline int within_module_core_rx(unsigned long addr, const struct module *mod) +{ + return within_module_range(addr, mod->module_core_rx, mod->core_size_rx); +} + -+static inline int within_module_core_rw(unsigned long addr, struct module *mod) ++static inline int within_module_core_rw(unsigned long addr, const struct module *mod) +{ + return within_module_range(addr, mod->module_core_rw, mod->core_size_rw); +} + -+static inline int within_module_init_rx(unsigned long addr, struct module *mod) ++static inline int within_module_init_rx(unsigned long addr, const struct module *mod) +{ + return within_module_range(addr, mod->module_init_rx, mod->init_size_rx); +} + -+static inline int within_module_init_rw(unsigned long addr, struct module *mod) ++static inline int within_module_init_rw(unsigned long addr, const struct module *mod) +{ + return within_module_range(addr, mod->module_init_rw, mod->init_size_rw); +} + - static inline int within_module_core(unsigned long addr, struct module *mod) + static inline int within_module_core(unsigned long addr, const struct module *mod) { - return (unsigned long)mod->module_core <= addr && - addr < (unsigned long)mod->module_core + mod->core_size; + return within_module_core_rx(addr, mod) || within_module_core_rw(addr, mod); } - static inline int within_module_init(unsigned long addr, struct module *mod) + static inline int within_module_init(unsigned long addr, const struct module *mod) { - return (unsigned long)mod->module_init <= addr && - addr < (unsigned long)mod->module_init + mod->init_size; @@ -62657,22 +69743,19 @@ index fbcafe2..e5d9587 100644 /* Search for module by name: must hold module_mutex. */ diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h -index b2be02e..72d2f78 100644 +index 560ca53..ef621ef 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h -@@ -23,11 +23,23 @@ unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section); - - /* Allocator used for allocating struct module, core sections and init +@@ -25,9 +25,21 @@ unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section); sections. Returns NULL on failure. */ --void *module_alloc(unsigned long size); -+void *module_alloc(unsigned long size) __size_overflow(1); -+ + void *module_alloc(unsigned long size); + +#ifdef CONFIG_PAX_KERNEXEC -+void *module_alloc_exec(unsigned long size) __size_overflow(1); ++void *module_alloc_exec(unsigned long size); +#else +#define module_alloc_exec(x) module_alloc(x) +#endif - ++ /* Free memory returned from module_alloc. */ void module_free(struct module *mod, void *module_region); @@ -62682,14 +69765,34 @@ index b2be02e..72d2f78 100644 +#define module_free_exec(x, y) module_free((x), (y)) +#endif + - /* Apply the given relocation to the (simplified) ELF. Return -error - or 0. */ - int apply_relocate(Elf_Shdr *sechdrs, + /* + * Apply the given relocation to the (simplified) ELF. Return -error + * or 0. +@@ -45,7 +57,9 @@ static inline int apply_relocate(Elf_Shdr *sechdrs, + unsigned int relsec, + struct module *me) + { ++#ifdef CONFIG_MODULES + printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name); ++#endif + return -ENOEXEC; + } + #endif +@@ -67,7 +81,9 @@ static inline int apply_relocate_add(Elf_Shdr *sechdrs, + unsigned int relsec, + struct module *me) + { ++#ifdef CONFIG_MODULES + printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name); ++#endif + return -ENOEXEC; + } + #endif diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h -index 944bc18..042d291 100644 +index 137b419..fe663ec 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h -@@ -286,7 +286,7 @@ static inline void __kernel_param_unlock(void) +@@ -284,7 +284,7 @@ static inline void __kernel_param_unlock(void) * @len is usually just sizeof(string). */ #define module_param_string(name, string, len, perm) \ @@ -62698,7 +69801,7 @@ index 944bc18..042d291 100644 = { len, string }; \ __module_param_call(MODULE_PARAM_PREFIX, name, \ ¶m_ops_string, \ -@@ -424,7 +424,7 @@ extern int param_set_bint(const char *val, const struct kernel_param *kp); +@@ -423,7 +423,7 @@ extern int param_set_bint(const char *val, const struct kernel_param *kp); */ #define module_param_array_named(name, array, type, nump, perm) \ param_check_##type(name, &(array)[0]); \ @@ -62708,21 +69811,21 @@ index 944bc18..042d291 100644 .ops = ¶m_ops_##type, \ .elemsize = sizeof(array[0]), .elem = array }; \ diff --git a/include/linux/namei.h b/include/linux/namei.h -index ffc0213..2c1f2cb 100644 +index 5a5ff57..5ae5070 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h -@@ -24,7 +24,7 @@ struct nameidata { +@@ -19,7 +19,7 @@ struct nameidata { unsigned seq; int last_type; unsigned depth; - char *saved_names[MAX_NESTED_LINKS + 1]; + const char *saved_names[MAX_NESTED_LINKS + 1]; + }; - /* Intent data */ - union { -@@ -94,12 +94,12 @@ extern int follow_up(struct path *); - extern struct dentry *lock_rename(struct dentry *, struct dentry *); - extern void unlock_rename(struct dentry *, struct dentry *); + /* +@@ -84,12 +84,12 @@ extern void unlock_rename(struct dentry *, struct dentry *); + + extern void nd_jump_link(struct nameidata *nd, struct path *path); -static inline void nd_set_link(struct nameidata *nd, char *path) +static inline void nd_set_link(struct nameidata *nd, const char *path) @@ -62735,19 +69838,32 @@ index ffc0213..2c1f2cb 100644 { return nd->saved_names[nd->depth]; } +diff --git a/include/linux/net.h b/include/linux/net.h +index aa16731..514b875 100644 +--- a/include/linux/net.h ++++ b/include/linux/net.h +@@ -183,7 +183,7 @@ struct net_proto_family { + int (*create)(struct net *net, struct socket *sock, + int protocol, int kern); + struct module *owner; +-}; ++} __do_const; + + struct iovec; + struct kvec; diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 33900a5..2072000 100644 +index 6151e90..2e0afb0 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1003,6 +1003,7 @@ struct net_device_ops { - int (*ndo_neigh_construct)(struct neighbour *n); - void (*ndo_neigh_destroy)(struct neighbour *n); +@@ -1028,6 +1028,7 @@ struct net_device_ops { + int (*ndo_change_carrier)(struct net_device *dev, + bool new_carrier); }; +typedef struct net_device_ops __no_const net_device_ops_no_const; /* * The DEVICE structure. -@@ -1064,7 +1065,7 @@ struct net_device { +@@ -1094,7 +1095,7 @@ struct net_device { int iflink; struct net_device_stats stats; @@ -62756,6 +69872,45 @@ index 33900a5..2072000 100644 * Do not use this in drivers. */ +diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h +index ee14284..bc65d63 100644 +--- a/include/linux/netfilter.h ++++ b/include/linux/netfilter.h +@@ -82,7 +82,7 @@ struct nf_sockopt_ops { + #endif + /* Use the module struct to lock set/get code in place */ + struct module *owner; +-}; ++} __do_const; + + /* Function to register/unregister hook points. */ + int nf_register_hook(struct nf_hook_ops *reg); +diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h +index 7958e84..ed74d7a 100644 +--- a/include/linux/netfilter/ipset/ip_set.h ++++ b/include/linux/netfilter/ipset/ip_set.h +@@ -98,7 +98,7 @@ struct ip_set_type_variant { + /* Return true if "b" set is the same as "a" + * according to the create set parameters */ + bool (*same_set)(const struct ip_set *a, const struct ip_set *b); +-}; ++} __do_const; + + /* The core set type structure */ + struct ip_set_type { +diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h +index ecbb8e4..8a1c4e1 100644 +--- a/include/linux/netfilter/nfnetlink.h ++++ b/include/linux/netfilter/nfnetlink.h +@@ -16,7 +16,7 @@ struct nfnl_callback { + const struct nlattr * const cda[]); + const struct nla_policy *policy; /* netlink attribute policy */ + const u_int16_t attr_count; /* number of nlattr's */ +-}; ++} __do_const; + + struct nfnetlink_subsystem { + const char *name; diff --git a/include/linux/netfilter/xt_gradm.h b/include/linux/netfilter/xt_gradm.h new file mode 100644 index 0000000..33f4af8 @@ -62771,19 +69926,33 @@ index 0000000..33f4af8 +}; + +#endif -diff --git a/include/linux/of_pdt.h b/include/linux/of_pdt.h -index c65a18a..0c05f3a 100644 ---- a/include/linux/of_pdt.h -+++ b/include/linux/of_pdt.h -@@ -32,7 +32,7 @@ struct of_pdt_ops { - - /* return 0 on success; fill in 'len' with number of bytes in path */ - int (*pkg2path)(phandle node, char *buf, const int buflen, int *len); +diff --git a/include/linux/nls.h b/include/linux/nls.h +index 5dc635f..35f5e11 100644 +--- a/include/linux/nls.h ++++ b/include/linux/nls.h +@@ -31,7 +31,7 @@ struct nls_table { + const unsigned char *charset2upper; + struct module *owner; + struct nls_table *next; -}; -+} __no_const; ++} __do_const; - extern void *prom_early_alloc(unsigned long size); + /* this value hold the maximum octet of charset */ + #define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */ +diff --git a/include/linux/notifier.h b/include/linux/notifier.h +index d65746e..62e72c2 100644 +--- a/include/linux/notifier.h ++++ b/include/linux/notifier.h +@@ -51,7 +51,8 @@ struct notifier_block { + int (*notifier_call)(struct notifier_block *, unsigned long, void *); + struct notifier_block __rcu *next; + int priority; +-}; ++} __do_const; ++typedef struct notifier_block __no_const notifier_block_no_const; + struct atomic_notifier_head { + spinlock_t lock; diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index a4c5624..79d6d88 100644 --- a/include/linux/oprofile.h @@ -62800,11 +69969,25 @@ index a4c5624..79d6d88 100644 /** create a directory */ struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root, +diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h +index 45fc162..01a4068 100644 +--- a/include/linux/pci_hotplug.h ++++ b/include/linux/pci_hotplug.h +@@ -80,7 +80,8 @@ struct hotplug_slot_ops { + int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); + int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); + int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); +-}; ++} __do_const; ++typedef struct hotplug_slot_ops __no_const hotplug_slot_ops_no_const; + + /** + * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h -index ddbb6a9..be1680e 100644 +index 1d795df..727aa7b 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h -@@ -879,8 +879,8 @@ struct perf_event { +@@ -333,8 +333,8 @@ struct perf_event { enum perf_event_active_state state; unsigned int attach_state; @@ -62815,7 +69998,7 @@ index ddbb6a9..be1680e 100644 /* * These are the total time in nanoseconds that the event -@@ -931,8 +931,8 @@ struct perf_event { +@@ -385,8 +385,8 @@ struct perf_event { * These accumulate total time (in nanoseconds) that children * events have been enabled and running, respectively. */ @@ -62826,20 +70009,56 @@ index ddbb6a9..be1680e 100644 /* * Protect attach/detach and child_list: -diff --git a/include/linux/personality.h b/include/linux/personality.h -index 8fc7dd1a..c19d89e 100644 ---- a/include/linux/personality.h -+++ b/include/linux/personality.h -@@ -44,6 +44,7 @@ enum { - #define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \ - ADDR_NO_RANDOMIZE | \ - ADDR_COMPAT_LAYOUT | \ -+ ADDR_LIMIT_3GB | \ - MMAP_PAGE_ZERO) +@@ -704,7 +704,7 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64 + entry->ip[entry->nr++] = ip; + } - /* +-extern int sysctl_perf_event_paranoid; ++extern int sysctl_perf_event_legitimately_concerned; + extern int sysctl_perf_event_mlock; + extern int sysctl_perf_event_sample_rate; + +@@ -714,17 +714,17 @@ extern int perf_proc_update_handler(struct ctl_table *table, int write, + + static inline bool perf_paranoid_tracepoint_raw(void) + { +- return sysctl_perf_event_paranoid > -1; ++ return sysctl_perf_event_legitimately_concerned > -1; + } + + static inline bool perf_paranoid_cpu(void) + { +- return sysctl_perf_event_paranoid > 0; ++ return sysctl_perf_event_legitimately_concerned > 0; + } + + static inline bool perf_paranoid_kernel(void) + { +- return sysctl_perf_event_paranoid > 1; ++ return sysctl_perf_event_legitimately_concerned > 1; + } + + extern void perf_event_init(void); +@@ -812,7 +812,7 @@ static inline void perf_restore_debug_store(void) { } + */ + #define perf_cpu_notifier(fn) \ + do { \ +- static struct notifier_block fn##_nb __cpuinitdata = \ ++ static struct notifier_block fn##_nb = \ + { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ + unsigned long cpu = smp_processor_id(); \ + unsigned long flags; \ +@@ -831,7 +831,7 @@ do { \ + struct perf_pmu_events_attr { + struct device_attribute attr; + u64 id; +-}; ++} __do_const; + + #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ + static struct perf_pmu_events_attr _var = { \ diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h -index e1ac1ce..0675fed 100644 +index ad1a427..6419649 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -45,9 +45,9 @@ struct pipe_buffer { @@ -62855,11 +70074,50 @@ index e1ac1ce..0675fed 100644 unsigned int r_counter; unsigned int w_counter; struct page *tmp_page; +diff --git a/include/linux/platform_data/usb-ehci-s5p.h b/include/linux/platform_data/usb-ehci-s5p.h +index 5f28cae..3d23723 100644 +--- a/include/linux/platform_data/usb-ehci-s5p.h ++++ b/include/linux/platform_data/usb-ehci-s5p.h +@@ -14,7 +14,7 @@ + struct s5p_ehci_platdata { + int (*phy_init)(struct platform_device *pdev, int type); + int (*phy_exit)(struct platform_device *pdev, int type); +-}; ++} __no_const; + + extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd); + +diff --git a/include/linux/platform_data/usb-exynos.h b/include/linux/platform_data/usb-exynos.h +index c256c59..8ea94c7 100644 +--- a/include/linux/platform_data/usb-exynos.h ++++ b/include/linux/platform_data/usb-exynos.h +@@ -14,7 +14,7 @@ + struct exynos4_ohci_platdata { + int (*phy_init)(struct platform_device *pdev, int type); + int (*phy_exit)(struct platform_device *pdev, int type); +-}; ++} __no_const; + + extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd); + +diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h +index 7c1d252..c5c773e 100644 +--- a/include/linux/pm_domain.h ++++ b/include/linux/pm_domain.h +@@ -48,7 +48,7 @@ struct gpd_dev_ops { + + struct gpd_cpu_data { + unsigned int saved_exit_latency; +- struct cpuidle_state *idle_state; ++ cpuidle_state_no_const *idle_state; + }; + + struct generic_pm_domain { diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h -index 609daae..5392427 100644 +index 7d7e09e..8671ef8 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h -@@ -97,7 +97,7 @@ static inline bool pm_runtime_callbacks_present(struct device *dev) +@@ -104,7 +104,7 @@ static inline bool pm_runtime_callbacks_present(struct device *dev) static inline void pm_runtime_mark_last_busy(struct device *dev) { @@ -62868,6 +70126,19 @@ index 609daae..5392427 100644 } #else /* !CONFIG_PM_RUNTIME */ +diff --git a/include/linux/pnp.h b/include/linux/pnp.h +index 195aafc..49a7bc2 100644 +--- a/include/linux/pnp.h ++++ b/include/linux/pnp.h +@@ -297,7 +297,7 @@ static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data) + struct pnp_fixup { + char id[7]; + void (*quirk_function) (struct pnp_dev * dev); /* fixup function */ +-}; ++} __do_const; + + /* config parameters */ + #define PNP_CONFIG_NORMAL 0x0001 diff --git a/include/linux/poison.h b/include/linux/poison.h index 2110a81..13a11bb 100644 --- a/include/linux/poison.h @@ -62883,45 +70154,58 @@ index 2110a81..13a11bb 100644 /********** include/linux/timer.h **********/ /* -diff --git a/include/linux/preempt.h b/include/linux/preempt.h -index 5a710b9..0b0dab9 100644 ---- a/include/linux/preempt.h -+++ b/include/linux/preempt.h -@@ -126,7 +126,7 @@ struct preempt_ops { - void (*sched_in)(struct preempt_notifier *notifier, int cpu); - void (*sched_out)(struct preempt_notifier *notifier, - struct task_struct *next); +diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h +index c0f44c2..1572583 100644 +--- a/include/linux/power/smartreflex.h ++++ b/include/linux/power/smartreflex.h +@@ -238,7 +238,7 @@ struct omap_sr_class_data { + int (*notify)(struct omap_sr *sr, u32 status); + u8 notify_flags; + u8 class_type; -}; -+} __no_const; ++} __do_const; /** - * preempt_notifier - key for installing preemption notifiers + * struct omap_sr_nvalue_table - Smartreflex n-target value info +diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h +index 4ea1d37..80f4b33 100644 +--- a/include/linux/ppp-comp.h ++++ b/include/linux/ppp-comp.h +@@ -84,7 +84,7 @@ struct compressor { + struct module *owner; + /* Extra skb space needed by the compressor algorithm */ + unsigned int comp_extra; +-}; ++} __do_const; + + /* + * The return value from decompress routine is the length of the diff --git a/include/linux/printk.h b/include/linux/printk.h -index 0525927..a5388b6 100644 +index 822171f..12b30e8 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h -@@ -94,6 +94,8 @@ void early_printk(const char *fmt, ...); - extern int printk_needs_cpu(int cpu); - extern void printk_tick(void); +@@ -98,6 +98,8 @@ int no_printk(const char *fmt, ...) + extern asmlinkage __printf(1, 2) + void early_printk(const char *fmt, ...); +extern int kptr_restrict; + #ifdef CONFIG_PRINTK - asmlinkage __printf(1, 0) - int vprintk(const char *fmt, va_list args); -@@ -117,7 +119,6 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, + asmlinkage __printf(5, 0) + int vprintk_emit(int facility, int level, +@@ -132,7 +134,6 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, extern int printk_delay_msec; extern int dmesg_restrict; -extern int kptr_restrict; - void log_buf_kexec_setup(void); - void __init setup_log_buf(int early); + extern void wake_up_klogd(void); + diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h -index 85c5073..51fac8b 100644 +index 94dfb2a..88b9d3b 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h -@@ -155,6 +155,18 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode, +@@ -165,6 +165,18 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode, return proc_create_data(name, mode, parent, proc_fops, NULL); } @@ -62940,58 +70224,84 @@ index 85c5073..51fac8b 100644 static inline struct proc_dir_entry *create_proc_read_entry(const char *name, umode_t mode, struct proc_dir_entry *base, read_proc_t *read_proc, void * data) -@@ -258,7 +270,7 @@ union proc_op { - int (*proc_show)(struct seq_file *m, - struct pid_namespace *ns, struct pid *pid, - struct task_struct *task); +@@ -266,7 +278,7 @@ struct proc_ns_operations { + void (*put)(void *ns); + int (*install)(struct nsproxy *nsproxy, void *ns); + unsigned int (*inum)(void *ns); -}; -+} __no_const; - - struct ctl_table_header; - struct ctl_table; ++} __do_const; + extern const struct proc_ns_operations netns_operations; + extern const struct proc_ns_operations utsns_operations; + extern const struct proc_ns_operations ipcns_operations; diff --git a/include/linux/random.h b/include/linux/random.h -index ac621ce..e085135 100644 +index 347ce55..880f97c 100644 --- a/include/linux/random.h +++ b/include/linux/random.h -@@ -53,6 +53,14 @@ extern void add_input_randomness(unsigned int type, unsigned int code, - unsigned int value); - extern void add_interrupt_randomness(int irq, int irq_flags); - -+#ifdef CONFIG_PAX_LATENT_ENTROPY -+extern void transfer_latent_entropy(void); -+#endif -+ -+#ifdef CONFIG_PAX_LATENT_ENTROPY -+extern void transfer_latent_entropy(void); -+#endif -+ - extern void get_random_bytes(void *buf, int nbytes); - extern void get_random_bytes_arch(void *buf, int nbytes); - void generate_random_uuid(unsigned char uuid_out[16]); -@@ -69,12 +77,17 @@ void srandom32(u32 seed); - - u32 prandom32(struct rnd_state *); +@@ -39,6 +39,11 @@ void prandom_seed(u32 seed); + u32 prandom_u32_state(struct rnd_state *); + void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); +static inline unsigned long pax_get_random_long(void) +{ -+ return random32() + (sizeof(long) > 4 ? (unsigned long)random32() << 32 : 0); ++ return prandom_u32() + (sizeof(long) > 4 ? (unsigned long)prandom_u32() << 32 : 0); +} + /* * Handle minimum values for seeds */ - static inline u32 __seed(u32 x, u32 m) - { -- return (x < m) ? x + m : x; -+ return (x <= m) ? x + m + 1 : x; +diff --git a/include/linux/rculist.h b/include/linux/rculist.h +index 8089e35..3a0d59a 100644 +--- a/include/linux/rculist.h ++++ b/include/linux/rculist.h +@@ -44,6 +44,9 @@ extern void __list_add_rcu(struct list_head *new, + struct list_head *prev, struct list_head *next); + #endif + ++extern void __pax_list_add_rcu(struct list_head *new, ++ struct list_head *prev, struct list_head *next); ++ + /** + * list_add_rcu - add a new entry to rcu-protected list + * @new: new entry to be added +@@ -65,6 +68,11 @@ static inline void list_add_rcu(struct list_head *new, struct list_head *head) + __list_add_rcu(new, head, head->next); } ++static inline void pax_list_add_rcu(struct list_head *new, struct list_head *head) ++{ ++ __pax_list_add_rcu(new, head, head->next); ++} ++ /** + * list_add_tail_rcu - add a new entry to rcu-protected list + * @new: new entry to be added +@@ -87,6 +95,12 @@ static inline void list_add_tail_rcu(struct list_head *new, + __list_add_rcu(new, head->prev, head); + } + ++static inline void pax_list_add_tail_rcu(struct list_head *new, ++ struct list_head *head) ++{ ++ __pax_list_add_rcu(new, head->prev, head); ++} ++ + /** + * list_del_rcu - deletes entry from list without re-initialization + * @entry: the element to delete from the list. +@@ -117,6 +131,8 @@ static inline void list_del_rcu(struct list_head *entry) + entry->prev = LIST_POISON2; + } + ++extern void pax_list_del_rcu(struct list_head *entry); ++ + /** + * hlist_del_init_rcu - deletes entry from hash list with re-initialization + * @n: the element to delete from the hash list. diff --git a/include/linux/reboot.h b/include/linux/reboot.h -index e0879a7..a12f962 100644 +index 23b3630..e1bc12b 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h -@@ -52,9 +52,9 @@ extern int unregister_reboot_notifier(struct notifier_block *); +@@ -18,9 +18,9 @@ extern int unregister_reboot_notifier(struct notifier_block *); * Architecture-specific implementations of sys_reboot commands. */ @@ -63004,7 +70314,7 @@ index e0879a7..a12f962 100644 extern void machine_shutdown(void); struct pt_regs; -@@ -65,9 +65,9 @@ extern void machine_crash_shutdown(struct pt_regs *); +@@ -31,9 +31,9 @@ extern void machine_crash_shutdown(struct pt_regs *); */ extern void kernel_restart_prepare(char *cmd); @@ -63017,7 +70327,7 @@ index e0879a7..a12f962 100644 extern int C_A_D; /* for sysctl */ void ctrl_alt_del(void); -@@ -81,7 +81,7 @@ extern int orderly_poweroff(bool force); +@@ -47,7 +47,7 @@ extern int orderly_poweroff(bool force); * Emergency restart, callable from an interrupt handler. */ @@ -63025,7 +70335,21 @@ index e0879a7..a12f962 100644 +extern void emergency_restart(void) __noreturn; #include <asm/emergency-restart.h> - #endif + #endif /* _LINUX_REBOOT_H */ +diff --git a/include/linux/regset.h b/include/linux/regset.h +index 8e0c9fe..ac4d221 100644 +--- a/include/linux/regset.h ++++ b/include/linux/regset.h +@@ -161,7 +161,8 @@ struct user_regset { + unsigned int align; + unsigned int bias; + unsigned int core_note_type; +-}; ++} __do_const; ++typedef struct user_regset __no_const user_regset_no_const; + + /** + * struct user_regset_view - available regsets diff --git a/include/linux/relay.h b/include/linux/relay.h index 91cacc3..b55ff74 100644 --- a/include/linux/relay.h @@ -63039,52 +70363,39 @@ index 91cacc3..b55ff74 100644 /* * CONFIG_RELAY kernel API, kernel/relay.c -diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h -index 6fdf027..ff72610 100644 ---- a/include/linux/rfkill.h -+++ b/include/linux/rfkill.h -@@ -147,6 +147,7 @@ struct rfkill_ops { - void (*query)(struct rfkill *rfkill, void *data); - int (*set_block)(void *data, bool blocked); - }; -+typedef struct rfkill_ops __no_const rfkill_ops_no_const; - - #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) - /** diff --git a/include/linux/rio.h b/include/linux/rio.h -index 4d50611..c6858a2 100644 +index a3e7842..d973ca6 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h -@@ -315,7 +315,7 @@ struct rio_ops { - int mbox, void *buffer, size_t len); - int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf); - void *(*get_inb_message)(struct rio_mport *mport, int mbox); +@@ -339,7 +339,7 @@ struct rio_ops { + int (*map_inb)(struct rio_mport *mport, dma_addr_t lstart, + u64 rstart, u32 size, u32 flags); + void (*unmap_inb)(struct rio_mport *mport, dma_addr_t lstart); -}; +} __no_const; #define RIO_RESOURCE_MEM 0x00000100 #define RIO_RESOURCE_DOORBELL 0x00000200 diff --git a/include/linux/rmap.h b/include/linux/rmap.h -index fd07c45..4676b8e 100644 +index 6dacb93..6174423 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h -@@ -119,9 +119,9 @@ static inline void anon_vma_unlock(struct anon_vma *anon_vma) +@@ -145,8 +145,8 @@ static inline void anon_vma_unlock_read(struct anon_vma *anon_vma) void anon_vma_init(void); /* create anon_vma_cachep */ int anon_vma_prepare(struct vm_area_struct *); void unlink_anon_vmas(struct vm_area_struct *); -int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *); -+int anon_vma_clone(struct vm_area_struct *, const struct vm_area_struct *); - void anon_vma_moveto_tail(struct vm_area_struct *); -int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *); ++int anon_vma_clone(struct vm_area_struct *, const struct vm_area_struct *); +int anon_vma_fork(struct vm_area_struct *, const struct vm_area_struct *); static inline void anon_vma_merge(struct vm_area_struct *vma, struct vm_area_struct *next) diff --git a/include/linux/sched.h b/include/linux/sched.h -index 7b06169..eb46ae3 100644 +index be4e742..7f9d593 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -100,6 +100,7 @@ struct bio_list; +@@ -62,6 +62,7 @@ struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; @@ -63092,33 +70403,35 @@ index 7b06169..eb46ae3 100644 /* * List of flags we want to share for kernel threads, -@@ -382,10 +383,13 @@ struct user_namespace; - #define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) - - extern int sysctl_max_map_count; -+extern unsigned long sysctl_heap_stack_gap; - +@@ -315,7 +316,7 @@ extern char __sched_text_start[], __sched_text_end[]; + extern int in_sched_functions(unsigned long addr); + + #define MAX_SCHEDULE_TIMEOUT LONG_MAX +-extern signed long schedule_timeout(signed long timeout); ++extern signed long schedule_timeout(signed long timeout) __intentional_overflow(-1); + extern signed long schedule_timeout_interruptible(signed long timeout); + extern signed long schedule_timeout_killable(signed long timeout); + extern signed long schedule_timeout_uninterruptible(signed long timeout); +@@ -329,6 +330,18 @@ struct user_namespace; #include <linux/aio.h> #ifdef CONFIG_MMU -+extern bool check_heap_stack_gap(const struct vm_area_struct *vma, unsigned long addr, unsigned long len); -+extern unsigned long skip_heap_stack_gap(const struct vm_area_struct *vma, unsigned long len); ++ ++#ifdef CONFIG_GRKERNSEC_RAND_THREADSTACK ++extern unsigned long gr_rand_threadstack_offset(const struct mm_struct *mm, const struct file *filp, unsigned long flags); ++#else ++static inline unsigned long gr_rand_threadstack_offset(const struct mm_struct *mm, const struct file *filp, unsigned long flags) ++{ ++ return 0; ++} ++#endif ++ ++extern bool check_heap_stack_gap(const struct vm_area_struct *vma, unsigned long addr, unsigned long len, unsigned long offset); ++extern unsigned long skip_heap_stack_gap(const struct vm_area_struct *vma, unsigned long len, unsigned long offset); extern void arch_pick_mmap_layout(struct mm_struct *mm); extern unsigned long arch_get_unmapped_area(struct file *, unsigned long, unsigned long, -@@ -404,6 +408,11 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} - extern void set_dumpable(struct mm_struct *mm, int value); - extern int get_dumpable(struct mm_struct *mm); - -+/* get/set_dumpable() values */ -+#define SUID_DUMPABLE_DISABLED 0 -+#define SUID_DUMPABLE_ENABLED 1 -+#define SUID_DUMPABLE_SAFE 2 -+ - /* mm flags */ - /* dumpable bits */ - #define MMF_DUMPABLE 0 /* core dump is permitted */ -@@ -643,6 +652,17 @@ struct signal_struct { +@@ -605,6 +618,17 @@ struct signal_struct { #ifdef CONFIG_TASKSTATS struct taskstats *stats; #endif @@ -63136,7 +70449,7 @@ index 7b06169..eb46ae3 100644 #ifdef CONFIG_AUDIT unsigned audit_tty; struct tty_audit_buf *tty_audit_buf; -@@ -726,6 +746,11 @@ struct user_struct { +@@ -683,6 +707,11 @@ struct user_struct { struct key *session_keyring; /* UID's default session keyring */ #endif @@ -63147,8 +70460,17 @@ index 7b06169..eb46ae3 100644 + /* Hash table maintenance information */ struct hlist_node uidhash_node; - uid_t uid; -@@ -1386,8 +1411,8 @@ struct task_struct { + kuid_t uid; +@@ -1082,7 +1111,7 @@ struct sched_class { + #ifdef CONFIG_FAIR_GROUP_SCHED + void (*task_move_group) (struct task_struct *p, int on_rq); + #endif +-}; ++} __do_const; + + struct load_weight { + unsigned long weight, inv_weight; +@@ -1323,8 +1352,8 @@ struct task_struct { struct list_head thread_group; struct completion *vfork_done; /* for vfork() */ @@ -63159,7 +70481,7 @@ index 7b06169..eb46ae3 100644 cputime_t utime, stime, utimescaled, stimescaled; cputime_t gtime; -@@ -1403,13 +1428,6 @@ struct task_struct { +@@ -1349,11 +1378,6 @@ struct task_struct { struct task_cputime cputime_expires; struct list_head cpu_timers[3]; @@ -63168,12 +70490,10 @@ index 7b06169..eb46ae3 100644 - * credentials (COW) */ - const struct cred __rcu *cred; /* effective (overridable) subjective task - * credentials (COW) */ -- struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */ -- char comm[TASK_COMM_LEN]; /* executable name excluding path - access with [gs]et_task_comm (which lock it with task_lock()) -@@ -1426,8 +1444,16 @@ struct task_struct { +@@ -1370,6 +1394,10 @@ struct task_struct { #endif /* CPU-specific state of this task */ struct thread_struct thread; @@ -63183,29 +70503,33 @@ index 7b06169..eb46ae3 100644 +#endif /* filesystem information */ struct fs_struct *fs; -+ -+ const struct cred __rcu *cred; /* effective (overridable) subjective task -+ * credentials (COW) */ -+ /* open file information */ - struct files_struct *files; - /* namespaces */ -@@ -1469,6 +1495,11 @@ struct task_struct { - struct rt_mutex_waiter *pi_blocked_on; +@@ -1443,6 +1471,10 @@ struct task_struct { + gfp_t lockdep_reclaim_gfp; #endif +/* process credentials */ + const struct cred __rcu *real_cred; /* objective and real subjective task + * credentials (COW) */ -+ struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */ + - #ifdef CONFIG_DEBUG_MUTEXES - /* mutex deadlock detection */ - struct mutex_waiter *blocked_on; -@@ -1585,6 +1616,27 @@ struct task_struct { - unsigned long default_timer_slack_ns; + /* journalling filesystem info */ + void *journal_info; - struct list_head *scm_work_list; +@@ -1481,6 +1513,10 @@ struct task_struct { + /* cg_list protected by css_set_lock and tsk->alloc_lock */ + struct list_head cg_list; + #endif ++ ++ const struct cred __rcu *cred; /* effective (overridable) subjective task ++ * credentials (COW) */ ++ + #ifdef CONFIG_FUTEX + struct robust_list_head __user *robust_list; + #ifdef CONFIG_COMPAT +@@ -1577,8 +1613,74 @@ struct task_struct { + #ifdef CONFIG_UPROBES + struct uprobe_task *utask; + #endif + +#ifdef CONFIG_GRKERNSEC + /* grsecurity */ @@ -63219,6 +70543,7 @@ index 7b06169..eb46ae3 100644 + struct acl_subject_label *acl; + struct acl_role_label *role; + struct file *exec_file; ++ unsigned long brute_expires; + u16 acl_role_id; + /* is this the task that authenticated to the special role */ + u8 acl_sp_role; @@ -63227,11 +70552,6 @@ index 7b06169..eb46ae3 100644 + u8 gr_is_chrooted; +#endif + - #ifdef CONFIG_FUNCTION_GRAPH_TRACER - /* Index of current stored address in ret_stack */ - int curr_ret_stack; -@@ -1619,6 +1671,51 @@ struct task_struct { - #endif }; +#define MF_PAX_PAGEEXEC 0x01000000 /* Paging based non-executable pages */ @@ -63277,12 +70597,20 @@ index 7b06169..eb46ae3 100644 +extern void pax_report_fault(struct pt_regs *regs, void *pc, void *sp); +extern void pax_report_insns(struct pt_regs *regs, void *pc, void *sp); +extern void pax_report_refcount_overflow(struct pt_regs *regs); -+extern void check_object_size(const void *ptr, unsigned long n, bool to); + /* Future-safe accessor for struct task_struct's cpus_allowed. */ #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) -@@ -2146,7 +2243,9 @@ void yield(void); +@@ -1637,7 +1739,7 @@ struct pid_namespace; + pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + struct pid_namespace *ns); + +-static inline pid_t task_pid_nr(struct task_struct *tsk) ++static inline pid_t task_pid_nr(const struct task_struct *tsk) + { + return tsk->pid; + } +@@ -2073,7 +2175,9 @@ void yield(void); extern struct exec_domain default_exec_domain; union thread_union { @@ -63292,7 +70620,7 @@ index 7b06169..eb46ae3 100644 unsigned long stack[THREAD_SIZE/sizeof(long)]; }; -@@ -2179,6 +2278,7 @@ extern struct pid_namespace init_pid_ns; +@@ -2106,6 +2210,7 @@ extern struct pid_namespace init_pid_ns; */ extern struct task_struct *find_task_by_vpid(pid_t nr); @@ -63300,16 +70628,16 @@ index 7b06169..eb46ae3 100644 extern struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns); -@@ -2322,7 +2422,7 @@ extern void __cleanup_sighand(struct sighand_struct *); +@@ -2272,7 +2377,7 @@ extern void __cleanup_sighand(struct sighand_struct *); extern void exit_itimers(struct signal_struct *); extern void flush_itimer_signals(void); -extern void do_group_exit(int); +extern __noreturn void do_group_exit(int); - extern void daemonize(const char *, ...); extern int allow_signal(int); -@@ -2523,9 +2623,9 @@ static inline unsigned long *end_of_stack(struct task_struct *p) + extern int disallow_signal(int); +@@ -2463,9 +2568,9 @@ static inline unsigned long *end_of_stack(struct task_struct *p) #endif @@ -63321,22 +70649,20 @@ index 7b06169..eb46ae3 100644 return (obj >= stack) && (obj < (stack + THREAD_SIZE)); } -diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h -index 899fbb4..1cb4138 100644 ---- a/include/linux/screen_info.h -+++ b/include/linux/screen_info.h -@@ -43,7 +43,8 @@ struct screen_info { - __u16 pages; /* 0x32 */ - __u16 vesa_attributes; /* 0x34 */ - __u32 capabilities; /* 0x36 */ -- __u8 _reserved[6]; /* 0x3a */ -+ __u16 vesapm_size; /* 0x3a */ -+ __u8 _reserved[4]; /* 0x3c */ - } __attribute__((packed)); +diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h +index bf8086b..962b035 100644 +--- a/include/linux/sched/sysctl.h ++++ b/include/linux/sched/sysctl.h +@@ -30,6 +30,7 @@ enum { sysctl_hung_task_timeout_secs = 0 }; + #define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) - #define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ + extern int sysctl_max_map_count; ++extern unsigned long sysctl_heap_stack_gap; + + extern unsigned int sysctl_sched_latency; + extern unsigned int sysctl_sched_min_granularity; diff --git a/include/linux/security.h b/include/linux/security.h -index 673afbb..2b7454b 100644 +index 032c366..2c1c2dc2 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -26,6 +26,7 @@ @@ -63348,20 +70674,20 @@ index 673afbb..2b7454b 100644 struct linux_binprm; struct cred; diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h -index fc61854..d7c490b 100644 +index 68a04a3..866e6a1 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h -@@ -25,6 +25,9 @@ struct seq_file { +@@ -26,6 +26,9 @@ struct seq_file { struct mutex lock; const struct seq_operations *op; int poll_event; +#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP + u64 exec_id; +#endif - void *private; - }; - -@@ -34,6 +37,7 @@ struct seq_operations { + #ifdef CONFIG_USER_NS + struct user_namespace *user_ns; + #endif +@@ -38,6 +41,7 @@ struct seq_operations { void * (*next) (struct seq_file *m, void *v, loff_t *pos); int (*show) (struct seq_file *m, void *v); }; @@ -63370,10 +70696,10 @@ index fc61854..d7c490b 100644 #define SEQ_SKIP 1 diff --git a/include/linux/shm.h b/include/linux/shm.h -index 92808b8..c28cac4 100644 +index 429c199..4d42e38 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h -@@ -98,6 +98,10 @@ struct shmid_kernel /* private to the kernel */ +@@ -21,6 +21,10 @@ struct shmid_kernel /* private to the kernel */ /* The task created the shm object. NULL if the task is dead. */ struct task_struct *shm_creator; @@ -63385,19 +70711,19 @@ index 92808b8..c28cac4 100644 /* shm_mode upper byte flags */ diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index c1bae8d..f25c5e2 100644 +index b8292d8..96db310 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -560,7 +560,7 @@ extern void __kfree_skb(struct sk_buff *skb); +@@ -599,7 +599,7 @@ extern bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from, extern struct sk_buff *__alloc_skb(unsigned int size, - gfp_t priority, int fclone, int node); - extern struct sk_buff *build_skb(void *data); + gfp_t priority, int flags, int node); + extern struct sk_buff *build_skb(void *data, unsigned int frag_size); -static inline struct sk_buff *alloc_skb(unsigned int size, +static inline struct sk_buff * __intentional_overflow(0) alloc_skb(unsigned int size, gfp_t priority) { return __alloc_skb(size, priority, 0, NUMA_NO_NODE); -@@ -663,7 +663,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb) +@@ -709,7 +709,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb) */ static inline int skb_queue_empty(const struct sk_buff_head *list) { @@ -63406,7 +70732,7 @@ index c1bae8d..f25c5e2 100644 } /** -@@ -676,7 +676,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list) +@@ -722,7 +722,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list) static inline bool skb_queue_is_last(const struct sk_buff_head *list, const struct sk_buff *skb) { @@ -63415,7 +70741,7 @@ index c1bae8d..f25c5e2 100644 } /** -@@ -689,7 +689,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list, +@@ -735,7 +735,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list, static inline bool skb_queue_is_first(const struct sk_buff_head *list, const struct sk_buff *skb) { @@ -63424,7 +70750,7 @@ index c1bae8d..f25c5e2 100644 } /** -@@ -1584,7 +1584,7 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) +@@ -1756,7 +1756,7 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD @@ -63433,7 +70759,7 @@ index c1bae8d..f25c5e2 100644 #endif extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); -@@ -2097,7 +2097,7 @@ extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, +@@ -2351,7 +2351,7 @@ extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, int *err); extern unsigned int datagram_poll(struct file *file, struct socket *sock, struct poll_table_struct *wait); @@ -63442,14 +70768,25 @@ index c1bae8d..f25c5e2 100644 int offset, struct iovec *to, int size); extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, +@@ -2641,6 +2641,9 @@ static inline void nf_reset(struct sk_buff *skb) + nf_bridge_put(skb->nf_bridge); + skb->nf_bridge = NULL; + #endif ++#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) ++ skb->nf_trace = 0; ++#endif + } + + static inline void nf_reset_trace(struct sk_buff *skb) diff --git a/include/linux/slab.h b/include/linux/slab.h -index a595dce..dfab0d2 100644 +index 5d168d7..720bff3 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h -@@ -11,12 +11,20 @@ - +@@ -12,13 +12,20 @@ #include <linux/gfp.h> #include <linux/types.h> + #include <linux/workqueue.h> +- +#include <linux/err.h> /* @@ -63467,7 +70804,7 @@ index a595dce..dfab0d2 100644 #define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */ #define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */ #define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */ -@@ -87,10 +95,13 @@ +@@ -89,10 +96,13 @@ * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can. * Both make kfree a no-op. */ @@ -63483,47 +70820,65 @@ index a595dce..dfab0d2 100644 +#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) - 1 >= (unsigned long)ZERO_SIZE_PTR - 1) /* - * struct kmem_cache related prototypes -@@ -161,6 +172,8 @@ void * __must_check krealloc(const void *, size_t, gfp_t); + * Common fields provided in kmem_cache by all slab allocators +@@ -112,7 +122,7 @@ struct kmem_cache { + unsigned int align; /* Alignment as calculated */ + unsigned long flags; /* Active flags on the slab */ + const char *name; /* Slab name for sysfs */ +- int refcount; /* Use counter */ ++ atomic_t refcount; /* Use counter */ + void (*ctor)(void *); /* Called on object slot creation */ + struct list_head list; /* List of all slab caches on the system */ + }; +@@ -232,6 +242,8 @@ void * __must_check krealloc(const void *, size_t, gfp_t); void kfree(const void *); void kzfree(const void *); size_t ksize(const void *); -+const char *check_heap_object(const void *ptr, unsigned long n, bool to); ++const char *check_heap_object(const void *ptr, unsigned long n); +bool is_usercopy_object(const void *ptr); /* * Allocator specific definitions. These are mainly used to establish optimized -@@ -240,6 +253,7 @@ size_t ksize(const void *); +@@ -311,6 +323,7 @@ size_t ksize(const void *); * for general use, and so are not documented here. For a full list of * potential flags, always refer to linux/gfp.h. */ -+static void *kmalloc_array(size_t n, size_t size, gfp_t flags) __size_overflow(1, 2); ++ static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) { - if (size != 0 && n > ULONG_MAX / size) -@@ -298,7 +312,7 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, - */ + if (size != 0 && n > SIZE_MAX / size) +@@ -370,7 +383,7 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \ - (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) + (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) || \ + (defined(CONFIG_SLOB) && defined(CONFIG_TRACING)) -extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); +extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long) __size_overflow(1); #define kmalloc_track_caller(size, flags) \ __kmalloc_track_caller(size, flags, _RET_IP_) #else -@@ -317,7 +331,7 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); - */ +@@ -390,7 +403,7 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \ - (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) + (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) || \ + (defined(CONFIG_SLOB) && defined(CONFIG_TRACING)) -extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long); +extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long) __size_overflow(1); #define kmalloc_node_track_caller(size, flags, node) \ __kmalloc_node_track_caller(size, flags, node, \ _RET_IP_) diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h -index fbd1117..0a3d314 100644 +index 8bb6e0e..8eb0dbe 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h -@@ -66,10 +66,10 @@ struct kmem_cache { +@@ -52,7 +52,7 @@ struct kmem_cache { + /* 4) cache creation/removal */ + const char *name; + struct list_head list; +- int refcount; ++ atomic_t refcount; + int object_size; + int align; + +@@ -68,10 +68,10 @@ struct kmem_cache { unsigned long node_allocs; unsigned long node_frees; unsigned long node_overflow; @@ -63538,7 +70893,7 @@ index fbd1117..0a3d314 100644 /* * If debugging is enabled, then the allocator can add additional -@@ -103,11 +103,16 @@ struct cache_sizes { +@@ -111,11 +111,16 @@ struct cache_sizes { #ifdef CONFIG_ZONE_DMA struct kmem_cache *cs_dmacachep; #endif @@ -63555,8 +70910,8 @@ index fbd1117..0a3d314 100644 +void *__kmalloc(size_t size, gfp_t flags) __size_overflow(1); #ifdef CONFIG_TRACING - extern void *kmem_cache_alloc_trace(size_t size, -@@ -150,6 +155,13 @@ found: + extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t); +@@ -152,6 +157,13 @@ found: cachep = malloc_sizes[i].cs_dmacachep; else #endif @@ -63569,8 +70924,8 @@ index fbd1117..0a3d314 100644 + cachep = malloc_sizes[i].cs_cachep; - ret = kmem_cache_alloc_trace(size, cachep, flags); -@@ -160,7 +172,7 @@ found: + ret = kmem_cache_alloc_trace(cachep, flags, size); +@@ -162,7 +174,7 @@ found: } #ifdef CONFIG_NUMA @@ -63579,7 +70934,7 @@ index fbd1117..0a3d314 100644 extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); #ifdef CONFIG_TRACING -@@ -203,6 +215,13 @@ found: +@@ -205,6 +217,13 @@ found: cachep = malloc_sizes[i].cs_dmacachep; else #endif @@ -63592,13 +70947,13 @@ index fbd1117..0a3d314 100644 + cachep = malloc_sizes[i].cs_cachep; - return kmem_cache_alloc_node_trace(size, cachep, flags, node); + return kmem_cache_alloc_node_trace(cachep, flags, node, size); diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h -index 0ec00b3..22b4715 100644 +index f28e14a..7831211 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h -@@ -9,7 +9,7 @@ static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, - return kmem_cache_alloc_node(cachep, flags, -1); +@@ -11,7 +11,7 @@ static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, + return kmem_cache_alloc_node(cachep, flags, NUMA_NO_NODE); } -void *__kmalloc_node(size_t size, gfp_t flags, int node); @@ -63606,8 +70961,8 @@ index 0ec00b3..22b4715 100644 static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) { -@@ -29,7 +29,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) - return __kmalloc_node(size, flags, -1); +@@ -31,7 +31,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) + return __kmalloc_node(size, flags, NUMA_NO_NODE); } -static __always_inline void *__kmalloc(size_t size, gfp_t flags) @@ -63616,10 +70971,10 @@ index 0ec00b3..22b4715 100644 return kmalloc(size, flags); } diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h -index c2f8c8b..d992a41 100644 +index 9db4825..ed42fb5 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h -@@ -92,7 +92,7 @@ struct kmem_cache { +@@ -91,7 +91,7 @@ struct kmem_cache { struct kmem_cache_order_objects max; struct kmem_cache_order_objects min; gfp_t allocflags; /* gfp flags to use on each alloc */ @@ -63628,7 +70983,7 @@ index c2f8c8b..d992a41 100644 void (*ctor)(void *); int inuse; /* Offset to metadata */ int align; /* Alignment */ -@@ -153,7 +153,7 @@ extern struct kmem_cache *kmalloc_caches[SLUB_PAGE_SHIFT]; +@@ -156,7 +156,7 @@ extern struct kmem_cache *kmalloc_caches[SLUB_PAGE_SHIFT]; * Sorry that the following has to be that ugly but some versions of GCC * have trouble with constant propagation and loops. */ @@ -63637,7 +70992,7 @@ index c2f8c8b..d992a41 100644 { if (!size) return 0; -@@ -218,7 +218,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size) +@@ -221,7 +221,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size) } void *kmem_cache_alloc(struct kmem_cache *, gfp_t); @@ -63646,7 +71001,7 @@ index c2f8c8b..d992a41 100644 static __always_inline void * kmalloc_order(size_t size, gfp_t flags, unsigned int order) -@@ -259,7 +259,7 @@ kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order) +@@ -265,7 +265,7 @@ kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order) } #endif @@ -63655,7 +71010,7 @@ index c2f8c8b..d992a41 100644 { unsigned int order = get_order(size); return kmalloc_order_trace(size, flags, order); -@@ -284,7 +284,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) +@@ -290,7 +290,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) } #ifdef CONFIG_NUMA @@ -63664,12 +71019,25 @@ index c2f8c8b..d992a41 100644 void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); #ifdef CONFIG_TRACING +diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h +index e8d702e..0a56eb4 100644 +--- a/include/linux/sock_diag.h ++++ b/include/linux/sock_diag.h +@@ -10,7 +10,7 @@ struct sock; + struct sock_diag_handler { + __u8 family; + int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh); +-}; ++} __do_const; + + int sock_diag_register(const struct sock_diag_handler *h); + void sock_diag_unregister(const struct sock_diag_handler *h); diff --git a/include/linux/sonet.h b/include/linux/sonet.h -index de8832d..0147b46 100644 +index 680f9a3..f13aeb0 100644 --- a/include/linux/sonet.h +++ b/include/linux/sonet.h -@@ -61,7 +61,7 @@ struct sonet_stats { - #include <linux/atomic.h> +@@ -7,7 +7,7 @@ + #include <uapi/linux/sonet.h> struct k_sonet_stats { -#define __HANDLE_ITEM(i) atomic_t i @@ -63677,11 +71045,11 @@ index de8832d..0147b46 100644 __SONET_ITEMS #undef __HANDLE_ITEM }; -diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h -index 523547e..2cb7140 100644 ---- a/include/linux/sunrpc/clnt.h -+++ b/include/linux/sunrpc/clnt.h -@@ -174,9 +174,9 @@ static inline unsigned short rpc_get_port(const struct sockaddr *sap) +diff --git a/include/linux/sunrpc/addr.h b/include/linux/sunrpc/addr.h +index 07d8e53..dc934c9 100644 +--- a/include/linux/sunrpc/addr.h ++++ b/include/linux/sunrpc/addr.h +@@ -23,9 +23,9 @@ static inline unsigned short rpc_get_port(const struct sockaddr *sap) { switch (sap->sa_family) { case AF_INET: @@ -63693,7 +71061,7 @@ index 523547e..2cb7140 100644 } return 0; } -@@ -209,7 +209,7 @@ static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1, +@@ -58,7 +58,7 @@ static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1, static inline bool __rpc_copy_addr4(struct sockaddr *dst, const struct sockaddr *src) { @@ -63702,7 +71070,7 @@ index 523547e..2cb7140 100644 struct sockaddr_in *dsin = (struct sockaddr_in *) dst; dsin->sin_family = ssin->sin_family; -@@ -312,7 +312,7 @@ static inline u32 rpc_get_scope_id(const struct sockaddr *sa) +@@ -164,7 +164,7 @@ static inline u32 rpc_get_scope_id(const struct sockaddr *sa) if (sa->sa_family != AF_INET6) return 0; @@ -63710,19 +71078,33 @@ index 523547e..2cb7140 100644 + return ((const struct sockaddr_in6 *) sa)->sin6_scope_id; } - #endif /* __KERNEL__ */ -diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h -index dc0c3cc..8503fb6 100644 ---- a/include/linux/sunrpc/sched.h -+++ b/include/linux/sunrpc/sched.h -@@ -106,6 +106,7 @@ struct rpc_call_ops { - void (*rpc_count_stats)(struct rpc_task *, void *); - void (*rpc_release)(void *); - }; -+typedef struct rpc_call_ops __no_const rpc_call_ops_no_const; + #endif /* _LINUX_SUNRPC_ADDR_H */ +diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h +index 2cf4ffa..470d140 100644 +--- a/include/linux/sunrpc/clnt.h ++++ b/include/linux/sunrpc/clnt.h +@@ -96,7 +96,7 @@ struct rpc_procinfo { + unsigned int p_timer; /* Which RTT timer to use */ + u32 p_statidx; /* Which procedure to account */ + const char * p_name; /* name of procedure */ +-}; ++} __do_const; - struct rpc_task_setup { - struct rpc_task *task; + #ifdef __KERNEL__ + +diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h +index 1f0216b..6a4fa50 100644 +--- a/include/linux/sunrpc/svc.h ++++ b/include/linux/sunrpc/svc.h +@@ -411,7 +411,7 @@ struct svc_procedure { + unsigned int pc_count; /* call count */ + unsigned int pc_cachetype; /* cache info (NFS) */ + unsigned int pc_xdrressize; /* maximum size of XDR reply */ +-}; ++} __do_const; + + /* + * Function prototypes. diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index 0b8e3e6..33e0a01 100644 --- a/include/linux/sunrpc/svc_rdma.h @@ -63752,24 +71134,71 @@ index 0b8e3e6..33e0a01 100644 #define RPCRDMA_VERSION 1 +diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h +index ff374ab..7fd2ecb 100644 +--- a/include/linux/sunrpc/svcauth.h ++++ b/include/linux/sunrpc/svcauth.h +@@ -109,7 +109,7 @@ struct auth_ops { + int (*release)(struct svc_rqst *rq); + void (*domain_release)(struct auth_domain *); + int (*set_client)(struct svc_rqst *rq); +-}; ++} __do_const; + + #define SVC_GARBAGE 1 + #define SVC_SYSERR 2 +diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h +index a5ffd32..0935dea 100644 +--- a/include/linux/swiotlb.h ++++ b/include/linux/swiotlb.h +@@ -60,7 +60,8 @@ extern void + + extern void + swiotlb_free_coherent(struct device *hwdev, size_t size, +- void *vaddr, dma_addr_t dma_handle); ++ void *vaddr, dma_addr_t dma_handle, ++ struct dma_attrs *attrs); + + extern dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, + unsigned long offset, size_t size, +diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h +index 313a8e0..1da8fc6 100644 +--- a/include/linux/syscalls.h ++++ b/include/linux/syscalls.h +@@ -634,7 +634,7 @@ asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *); + asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *); + asmlinkage long sys_send(int, void __user *, size_t, unsigned); + asmlinkage long sys_sendto(int, void __user *, size_t, unsigned, +- struct sockaddr __user *, int); ++ struct sockaddr __user *, int) __intentional_overflow(0); + asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags); + asmlinkage long sys_sendmmsg(int fd, struct mmsghdr __user *msg, + unsigned int vlen, unsigned flags); +diff --git a/include/linux/syscore_ops.h b/include/linux/syscore_ops.h +index 27b3b0b..e093dd9 100644 +--- a/include/linux/syscore_ops.h ++++ b/include/linux/syscore_ops.h +@@ -16,7 +16,7 @@ struct syscore_ops { + int (*suspend)(void); + void (*resume)(void); + void (*shutdown)(void); +-}; ++} __do_const; + + extern void register_syscore_ops(struct syscore_ops *ops); + extern void unregister_syscore_ops(struct syscore_ops *ops); diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h -index c34b4c8..a65b67d 100644 +index 14a8ff2..af52bad 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h -@@ -155,7 +155,11 @@ enum - KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ - }; +@@ -34,13 +34,13 @@ struct ctl_table_root; + struct ctl_table_header; + struct ctl_dir; +-typedef struct ctl_table ctl_table; - -+#ifdef CONFIG_PAX_SOFTMODE -+enum { -+ PAX_SOFTMODE=1 /* PaX: disable/enable soft mode */ -+}; -+#endif - - /* CTL_VM names: */ - enum -@@ -948,6 +952,8 @@ typedef int proc_handler (struct ctl_table *ctl, int write, + typedef int proc_handler (struct ctl_table *ctl, int write, + void __user *buffer, size_t *lenp, loff_t *ppos); extern int proc_dostring(struct ctl_table *, int, void __user *, size_t *, loff_t *); @@ -63778,11 +71207,133 @@ index c34b4c8..a65b67d 100644 extern int proc_dointvec(struct ctl_table *, int, void __user *, size_t *, loff_t *); extern int proc_dointvec_minmax(struct ctl_table *, int, +@@ -115,7 +115,9 @@ struct ctl_table + struct ctl_table_poll *poll; + void *extra1; + void *extra2; +-}; ++} __do_const; ++typedef struct ctl_table __no_const ctl_table_no_const; ++typedef struct ctl_table ctl_table; + + struct ctl_node { + struct rb_node node; +diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h +index e2cee22..3ddb921 100644 +--- a/include/linux/sysfs.h ++++ b/include/linux/sysfs.h +@@ -31,7 +31,8 @@ struct attribute { + struct lock_class_key *key; + struct lock_class_key skey; + #endif +-}; ++} __do_const; ++typedef struct attribute __no_const attribute_no_const; + + /** + * sysfs_attr_init - initialize a dynamically allocated sysfs attribute +@@ -59,8 +60,8 @@ struct attribute_group { + umode_t (*is_visible)(struct kobject *, + struct attribute *, int); + struct attribute **attrs; +-}; +- ++} __do_const; ++typedef struct attribute_group __no_const attribute_group_no_const; + + + /** +@@ -107,7 +108,8 @@ struct bin_attribute { + char *, loff_t, size_t); + int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr, + struct vm_area_struct *vma); +-}; ++} __do_const; ++typedef struct bin_attribute __no_const bin_attribute_no_const; + + /** + * sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute +diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h +index 7faf933..9b85a0c 100644 +--- a/include/linux/sysrq.h ++++ b/include/linux/sysrq.h +@@ -16,6 +16,7 @@ + + #include <linux/errno.h> + #include <linux/types.h> ++#include <linux/compiler.h> + + /* Enable/disable SYSRQ support by default (0==no, 1==yes). */ + #define SYSRQ_DEFAULT_ENABLE 1 +@@ -36,7 +37,7 @@ struct sysrq_key_op { + char *help_msg; + char *action_msg; + int enable_mask; +-}; ++} __do_const; + + #ifdef CONFIG_MAGIC_SYSRQ + +diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h +index e7e0473..7989295 100644 +--- a/include/linux/thread_info.h ++++ b/include/linux/thread_info.h +@@ -148,6 +148,15 @@ static inline bool test_and_clear_restore_sigmask(void) + #error "no set_restore_sigmask() provided and default one won't work" + #endif + ++extern void __check_object_size(const void *ptr, unsigned long n, bool to_user); ++static inline void check_object_size(const void *ptr, unsigned long n, bool to_user) ++{ ++#ifndef CONFIG_PAX_USERCOPY_DEBUG ++ if (!__builtin_constant_p(n)) ++#endif ++ __check_object_size(ptr, n, to_user); ++} ++ + #endif /* __KERNEL__ */ + + #endif /* _LINUX_THREAD_INFO_H */ +diff --git a/include/linux/tty.h b/include/linux/tty.h +index c75d886..04cb148 100644 +--- a/include/linux/tty.h ++++ b/include/linux/tty.h +@@ -194,7 +194,7 @@ struct tty_port { + const struct tty_port_operations *ops; /* Port operations */ + spinlock_t lock; /* Lock protecting tty field */ + int blocked_open; /* Waiting to open */ +- int count; /* Usage count */ ++ atomic_t count; /* Usage count */ + wait_queue_head_t open_wait; /* Open waiters */ + wait_queue_head_t close_wait; /* Close waiters */ + wait_queue_head_t delta_msr_wait; /* Modem status change */ +@@ -515,7 +515,7 @@ extern int tty_port_open(struct tty_port *port, + struct tty_struct *tty, struct file *filp); + static inline int tty_port_users(struct tty_port *port) + { +- return port->count + port->blocked_open; ++ return atomic_read(&port->count) + port->blocked_open; + } + + extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); +diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h +index 756a609..b302dd6 100644 +--- a/include/linux/tty_driver.h ++++ b/include/linux/tty_driver.h +@@ -285,7 +285,7 @@ struct tty_operations { + void (*poll_put_char)(struct tty_driver *driver, int line, char ch); + #endif + const struct file_operations *proc_fops; +-}; ++} __do_const; + + struct tty_driver { + int magic; /* magic number for this structure */ diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h -index ff7dc08..893e1bd 100644 +index 455a0d7..bf97ff5 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h -@@ -148,7 +148,7 @@ struct tty_ldisc_ops { +@@ -146,7 +146,7 @@ struct tty_ldisc_ops { struct module *owner; @@ -63792,10 +71343,10 @@ index ff7dc08..893e1bd 100644 struct tty_ldisc { diff --git a/include/linux/types.h b/include/linux/types.h -index 7f480db..175c256 100644 +index 4d118ba..c3ee9bf 100644 --- a/include/linux/types.h +++ b/include/linux/types.h -@@ -220,10 +220,26 @@ typedef struct { +@@ -176,10 +176,26 @@ typedef struct { int counter; } atomic_t; @@ -63841,51 +71392,95 @@ index 5ca0951..ab496a5 100644 ret; \ }) +diff --git a/include/linux/uidgid.h b/include/linux/uidgid.h +index 8e522cbc..aa8572d 100644 +--- a/include/linux/uidgid.h ++++ b/include/linux/uidgid.h +@@ -197,4 +197,9 @@ static inline bool kgid_has_mapping(struct user_namespace *ns, kgid_t gid) + + #endif /* CONFIG_USER_NS */ + ++#define GR_GLOBAL_UID(x) from_kuid_munged(&init_user_ns, (x)) ++#define GR_GLOBAL_GID(x) from_kgid_munged(&init_user_ns, (x)) ++#define gr_is_global_root(x) uid_eq((x), GLOBAL_ROOT_UID) ++#define gr_is_global_nonroot(x) (!uid_eq((x), GLOBAL_ROOT_UID)) ++ + #endif /* _LINUX_UIDGID_H */ diff --git a/include/linux/unaligned/access_ok.h b/include/linux/unaligned/access_ok.h -index 99c1b4d..bb94261 100644 +index 99c1b4d..562e6f3 100644 --- a/include/linux/unaligned/access_ok.h +++ b/include/linux/unaligned/access_ok.h -@@ -6,32 +6,32 @@ +@@ -4,34 +4,34 @@ + #include <linux/kernel.h> + #include <asm/byteorder.h> - static inline u16 get_unaligned_le16(const void *p) +-static inline u16 get_unaligned_le16(const void *p) ++static inline u16 __intentional_overflow(-1) get_unaligned_le16(const void *p) { - return le16_to_cpup((__le16 *)p); + return le16_to_cpup((const __le16 *)p); } - static inline u32 get_unaligned_le32(const void *p) +-static inline u32 get_unaligned_le32(const void *p) ++static inline u32 __intentional_overflow(-1) get_unaligned_le32(const void *p) { - return le32_to_cpup((__le32 *)p); + return le32_to_cpup((const __le32 *)p); } - static inline u64 get_unaligned_le64(const void *p) +-static inline u64 get_unaligned_le64(const void *p) ++static inline u64 __intentional_overflow(-1) get_unaligned_le64(const void *p) { - return le64_to_cpup((__le64 *)p); + return le64_to_cpup((const __le64 *)p); } - static inline u16 get_unaligned_be16(const void *p) +-static inline u16 get_unaligned_be16(const void *p) ++static inline u16 __intentional_overflow(-1) get_unaligned_be16(const void *p) { - return be16_to_cpup((__be16 *)p); + return be16_to_cpup((const __be16 *)p); } - static inline u32 get_unaligned_be32(const void *p) +-static inline u32 get_unaligned_be32(const void *p) ++static inline u32 __intentional_overflow(-1) get_unaligned_be32(const void *p) { - return be32_to_cpup((__be32 *)p); + return be32_to_cpup((const __be32 *)p); } - static inline u64 get_unaligned_be64(const void *p) +-static inline u64 get_unaligned_be64(const void *p) ++static inline u64 __intentional_overflow(-1) get_unaligned_be64(const void *p) { - return be64_to_cpup((__be64 *)p); + return be64_to_cpup((const __be64 *)p); } static inline void put_unaligned_le16(u16 val, void *p) +diff --git a/include/linux/usb.h b/include/linux/usb.h +index 4d22d0f..8d0e8f8 100644 +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -554,7 +554,7 @@ struct usb_device { + int maxchild; + + u32 quirks; +- atomic_t urbnum; ++ atomic_unchecked_t urbnum; + + unsigned long active_duration; + +@@ -1604,7 +1604,7 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in, + + extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, + __u8 request, __u8 requesttype, __u16 value, __u16 index, +- void *data, __u16 size, int timeout); ++ void *data, __u16 size, int timeout) __intentional_overflow(-1); + extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe, + void *data, int len, int *actual_length, int timeout); + extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h -index 547e59c..db6ad19 100644 +index c5d36c6..108f4f9 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h @@ -39,7 +39,7 @@ enum { @@ -63897,15 +71492,6 @@ index 547e59c..db6ad19 100644 /* * callback functions for platform -@@ -97,7 +97,7 @@ struct renesas_usbhs_platform_callback { - * VBUS control is needed for Host - */ - int (*set_vbus)(struct platform_device *pdev, int enable); --}; -+} __no_const; - - /* - * parameters for renesas usbhs diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index 6f8fbcf..8259001 100644 --- a/include/linux/vermagic.h @@ -63948,7 +71534,7 @@ index 6f8fbcf..8259001 100644 + MODULE_GRSEC diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h -index dcdfc2b..ec79ab5 100644 +index 6071e91..ca6a489 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -14,6 +14,11 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */ @@ -63967,12 +71553,12 @@ index dcdfc2b..ec79ab5 100644 extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); extern void *__vmalloc_node_range(unsigned long size, unsigned long align, unsigned long start, unsigned long end, gfp_t gfp_mask, -- pgprot_t prot, int node, void *caller); -+ pgprot_t prot, int node, void *caller) __size_overflow(1); +- pgprot_t prot, int node, const void *caller); ++ pgprot_t prot, int node, const void *caller) __size_overflow(1); extern void vfree(const void *addr); extern void *vmap(struct page **pages, unsigned int count, -@@ -123,8 +128,8 @@ extern struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes); +@@ -124,8 +129,8 @@ extern struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes); extern void free_vm_area(struct vm_struct *area); /* for /dev/kmem */ @@ -63984,10 +71570,10 @@ index dcdfc2b..ec79ab5 100644 /* * Internals. Dont't use.. diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h -index 65efb92..137adbb 100644 +index 5fd71a7..e5ef9a9 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h -@@ -87,18 +87,18 @@ static inline void vm_events_fold_cpu(int cpu) +@@ -95,18 +95,18 @@ static inline void vm_events_fold_cpu(int cpu) /* * Zone based page accounting with per cpu differentials. */ @@ -64010,7 +71596,7 @@ index 65efb92..137adbb 100644 #ifdef CONFIG_SMP if (x < 0) x = 0; -@@ -109,7 +109,7 @@ static inline unsigned long global_page_state(enum zone_stat_item item) +@@ -117,7 +117,7 @@ static inline unsigned long global_page_state(enum zone_stat_item item) static inline unsigned long zone_page_state(struct zone *zone, enum zone_stat_item item) { @@ -64019,7 +71605,7 @@ index 65efb92..137adbb 100644 #ifdef CONFIG_SMP if (x < 0) x = 0; -@@ -126,7 +126,7 @@ static inline unsigned long zone_page_state(struct zone *zone, +@@ -134,7 +134,7 @@ static inline unsigned long zone_page_state(struct zone *zone, static inline unsigned long zone_page_state_snapshot(struct zone *zone, enum zone_stat_item item) { @@ -64028,7 +71614,7 @@ index 65efb92..137adbb 100644 #ifdef CONFIG_SMP int cpu; -@@ -221,8 +221,8 @@ static inline void __mod_zone_page_state(struct zone *zone, +@@ -226,8 +226,8 @@ static inline void __mod_zone_page_state(struct zone *zone, static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) { @@ -64039,7 +71625,7 @@ index 65efb92..137adbb 100644 } static inline void __inc_zone_page_state(struct page *page, -@@ -233,8 +233,8 @@ static inline void __inc_zone_page_state(struct page *page, +@@ -238,8 +238,8 @@ static inline void __inc_zone_page_state(struct page *page, static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item) { @@ -64051,81 +71637,100 @@ index 65efb92..137adbb 100644 static inline void __dec_zone_page_state(struct page *page, diff --git a/include/linux/xattr.h b/include/linux/xattr.h -index e5d1220..ef6e406 100644 +index fdbafc6..49dfe4f 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h -@@ -57,6 +57,11 @@ - #define XATTR_POSIX_ACL_DEFAULT "posix_acl_default" - #define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT +@@ -28,7 +28,7 @@ struct xattr_handler { + size_t size, int handler_flags); + int (*set)(struct dentry *dentry, const char *name, const void *buffer, + size_t size, int flags, int handler_flags); +-}; ++} __do_const; -+/* User namespace */ -+#define XATTR_PAX_PREFIX XATTR_USER_PREFIX "pax." -+#define XATTR_PAX_FLAGS_SUFFIX "flags" -+#define XATTR_NAME_PAX_FLAGS XATTR_PAX_PREFIX XATTR_PAX_FLAGS_SUFFIX -+ - #ifdef __KERNEL__ + struct xattr { + char *name; +@@ -37,6 +37,9 @@ struct xattr { + }; - #include <linux/types.h> -diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h -index 4aeff96..b378cdc 100644 ---- a/include/media/saa7146_vv.h -+++ b/include/media/saa7146_vv.h -@@ -163,7 +163,7 @@ struct saa7146_ext_vv - int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); - - /* 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; + ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); ++#ifdef CONFIG_PAX_XATTR_PAX_FLAGS ++ssize_t pax_getxattr(struct dentry *, void *, size_t); ++#endif + ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t); + ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); + int __vfs_setxattr_noperm(struct dentry *, const char *, const void *, size_t, int); +diff --git a/include/linux/zlib.h b/include/linux/zlib.h +index 9c5a6b4..09c9438 100644 +--- a/include/linux/zlib.h ++++ b/include/linux/zlib.h +@@ -31,6 +31,7 @@ + #define _ZLIB_H + + #include <linux/zconf.h> ++#include <linux/compiler.h> + /* zlib deflate based on ZLIB_VERSION "1.1.3" */ + /* zlib inflate based on ZLIB_VERSION "1.2.3" */ +@@ -179,7 +180,7 @@ typedef z_stream *z_streamp; + + /* basic functions */ + +-extern int zlib_deflate_workspacesize (int windowBits, int memLevel); ++extern int zlib_deflate_workspacesize (int windowBits, int memLevel) __intentional_overflow(0); + /* + Returns the number of bytes that needs to be allocated for a per- + stream workspace with the specified parameters. A pointer to this diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h -index 96d2221..2292f89 100644 +index 95d1c91..6798cca 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h -@@ -56,7 +56,7 @@ int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local); - - - struct v4l2_file_operations { -- struct module *owner; -+ struct module * const owner; - ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); - ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); - unsigned int (*poll) (struct file *, struct poll_table_struct *); -@@ -71,6 +71,7 @@ struct v4l2_file_operations { +@@ -76,7 +76,7 @@ struct v4l2_file_operations { + int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct file *); int (*release) (struct file *); - }; -+typedef struct v4l2_file_operations __no_const v4l2_file_operations_no_const; +-}; ++} __do_const; /* * Newer version of video_device, handled by videodev2.c diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h -index 3cb939c..f23c6bb 100644 +index 4118ad1..cb7e25f 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h -@@ -281,7 +281,7 @@ struct v4l2_ioctl_ops { - long (*vidioc_default) (struct file *file, void *fh, +@@ -284,7 +284,6 @@ struct v4l2_ioctl_ops { bool valid_prio, int cmd, void *arg); }; -- -+typedef struct v4l2_ioctl_ops __no_const v4l2_ioctl_ops_no_const; +- /* v4l debugging and diagnostics */ -diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h -index 6db8ecf..8c23861 100644 ---- a/include/net/caif/caif_hsi.h -+++ b/include/net/caif/caif_hsi.h -@@ -98,7 +98,7 @@ struct cfhsi_drv { - void (*rx_done_cb) (struct cfhsi_drv *drv); - void (*wake_up_cb) (struct cfhsi_drv *drv); - void (*wake_down_cb) (struct cfhsi_drv *drv); + /* Debug bitmask flags to be used on V4L2 */ +diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h +index adcbb20..62c2559 100644 +--- a/include/net/9p/transport.h ++++ b/include/net/9p/transport.h +@@ -57,7 +57,7 @@ struct p9_trans_module { + int (*cancel) (struct p9_client *, struct p9_req_t *req); + int (*zc_request)(struct p9_client *, struct p9_req_t *, + char *, char *, int , int, int, int); -}; -+} __no_const; ++} __do_const; + + void v9fs_register_trans(struct p9_trans_module *m); + void v9fs_unregister_trans(struct p9_trans_module *m); +diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h +index cdd3302..76f8ede 100644 +--- a/include/net/bluetooth/l2cap.h ++++ b/include/net/bluetooth/l2cap.h +@@ -551,7 +551,7 @@ struct l2cap_ops { + void (*defer) (struct l2cap_chan *chan); + struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, + unsigned long len, int nb); +-}; ++} __do_const; - /* Structure implemented by HSI device. */ - struct cfhsi_dev { + struct l2cap_conn { + struct hci_conn *hcon; diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h index 9e5425b..8136ffc 100644 --- a/include/net/caif/cfctrl.h @@ -64151,7 +71756,7 @@ index 9e5425b..8136ffc 100644 /* Protects from simultaneous access to first_req list */ spinlock_t info_list_lock; diff --git a/include/net/flow.h b/include/net/flow.h -index 6c469db..7743b8e 100644 +index 628e11b..4c475df 100644 --- a/include/net/flow.h +++ b/include/net/flow.h @@ -221,6 +221,6 @@ extern struct flow_cache_object *flow_cache_lookup( @@ -64162,11 +71767,50 @@ index 6c469db..7743b8e 100644 +extern atomic_unchecked_t flow_cache_genid; #endif +diff --git a/include/net/genetlink.h b/include/net/genetlink.h +index bdfbe68..4402ebe 100644 +--- a/include/net/genetlink.h ++++ b/include/net/genetlink.h +@@ -118,7 +118,7 @@ struct genl_ops { + struct netlink_callback *cb); + int (*done)(struct netlink_callback *cb); + struct list_head ops_list; +-}; ++} __do_const; + + extern int genl_register_family(struct genl_family *family); + extern int genl_register_family_with_ops(struct genl_family *family, +diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h +index 734d9b5..48a9a4b 100644 +--- a/include/net/gro_cells.h ++++ b/include/net/gro_cells.h +@@ -29,7 +29,7 @@ static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *s + cell += skb_get_rx_queue(skb) & gcells->gro_cells_mask; + + if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { +- atomic_long_inc(&dev->rx_dropped); ++ atomic_long_inc_unchecked(&dev->rx_dropped); + kfree_skb(skb); + return; + } +diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h +index 1832927..ce39aea 100644 +--- a/include/net/inet_connection_sock.h ++++ b/include/net/inet_connection_sock.h +@@ -62,7 +62,7 @@ struct inet_connection_sock_af_ops { + void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); + int (*bind_conflict)(const struct sock *sk, + const struct inet_bind_bucket *tb, bool relax); +-}; ++} __do_const; + + /** inet_connection_sock - INET connection oriented sock + * diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h -index 2040bff..f4c0733 100644 +index 53f464d..ba76aaa 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h -@@ -51,8 +51,8 @@ struct inet_peer { +@@ -47,8 +47,8 @@ struct inet_peer { */ union { struct { @@ -64174,10 +71818,10 @@ index 2040bff..f4c0733 100644 - atomic_t ip_id_count; /* IP ID for the next packet */ + atomic_unchecked_t rid; /* Frag reception counter */ + atomic_unchecked_t ip_id_count; /* IP ID for the next packet */ - __u32 tcp_ts; - __u32 tcp_ts_stamp; }; -@@ -118,11 +118,11 @@ static inline int inet_getid(struct inet_peer *p, int more) + struct rcu_head rcu; + struct inet_peer *gc_next; +@@ -182,11 +182,11 @@ static inline int inet_getid(struct inet_peer *p, int more) more++; inet_peer_refcheck(p); do { @@ -64191,11 +71835,24 @@ index 2040bff..f4c0733 100644 return new; } +diff --git a/include/net/ip.h b/include/net/ip.h +index a68f838..74518ab 100644 +--- a/include/net/ip.h ++++ b/include/net/ip.h +@@ -202,7 +202,7 @@ extern struct local_ports { + } sysctl_local_ports; + extern void inet_get_local_port_range(int *low, int *high); + +-extern unsigned long *sysctl_local_reserved_ports; ++extern unsigned long sysctl_local_reserved_ports[65536 / 8 / sizeof(unsigned long)]; + static inline int inet_is_reserved_local_port(int port) + { + return test_bit(port, sysctl_local_reserved_ports); diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h -index 10422ef..662570f 100644 +index e49db91..76a81de 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h -@@ -146,7 +146,7 @@ extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); +@@ -167,7 +167,7 @@ extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); #define FIB_RES_SADDR(net, res) \ ((FIB_RES_NH(res).nh_saddr_genid == \ @@ -64205,10 +71862,10 @@ index 10422ef..662570f 100644 fib_info_update_nh_saddr((net), &FIB_RES_NH(res))) #define FIB_RES_GW(res) (FIB_RES_NH(res).nh_gw) diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h -index 72522f0..2965e05 100644 +index fce8e6b..3ca4916 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h -@@ -510,7 +510,7 @@ struct ip_vs_conn { +@@ -599,7 +599,7 @@ struct ip_vs_conn { struct ip_vs_conn *control; /* Master control connection */ atomic_t n_control; /* Number of controlled ones */ struct ip_vs_dest *dest; /* real server */ @@ -64217,39 +71874,31 @@ index 72522f0..2965e05 100644 /* packet transmitter for different forwarding methods. If it mangles the packet, it must return NF_DROP or better NF_STOLEN, -@@ -648,7 +648,7 @@ struct ip_vs_dest { +@@ -737,7 +737,7 @@ struct ip_vs_dest { __be16 port; /* port number of the server */ union nf_inet_addr addr; /* IP address of the server */ - volatile unsigned flags; /* dest status flags */ + volatile unsigned int flags; /* dest status flags */ - atomic_t conn_flags; /* flags to copy to conn */ + atomic_unchecked_t conn_flags; /* flags to copy to conn */ atomic_t weight; /* server weight */ atomic_t refcnt; /* reference counter */ -@@ -1356,7 +1356,7 @@ static inline void ip_vs_notrack(struct sk_buff *skb) - struct nf_conn *ct = nf_ct_get(skb, &ctinfo); - - if (!ct || !nf_ct_is_untracked(ct)) { -- nf_reset(skb); -+ nf_conntrack_put(skb->nfct); - skb->nfct = &nf_ct_untracked_get()->ct_general; - skb->nfctinfo = IP_CT_NEW; - nf_conntrack_get(skb->nfct); -diff --git a/include/net/irda/ircomm_core.h b/include/net/irda/ircomm_core.h -index 69b610a..fe3962c 100644 ---- a/include/net/irda/ircomm_core.h -+++ b/include/net/irda/ircomm_core.h -@@ -51,7 +51,7 @@ typedef struct { - int (*connect_response)(struct ircomm_cb *, struct sk_buff *); - int (*disconnect_request)(struct ircomm_cb *, struct sk_buff *, - struct ircomm_info *); --} call_t; -+} __no_const call_t; - - struct ircomm_cb { - irda_queue_t queue; +@@ -981,11 +981,11 @@ struct netns_ipvs { + /* ip_vs_lblc */ + int sysctl_lblc_expiration; + struct ctl_table_header *lblc_ctl_header; +- struct ctl_table *lblc_ctl_table; ++ ctl_table_no_const *lblc_ctl_table; + /* ip_vs_lblcr */ + int sysctl_lblcr_expiration; + struct ctl_table_header *lblcr_ctl_header; +- struct ctl_table *lblcr_ctl_table; ++ ctl_table_no_const *lblcr_ctl_table; + /* ip_vs_est */ + struct list_head est_list; /* estimator list */ + spinlock_t est_lock; diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h -index 59ba38bc..d515662 100644 +index 80ffde3..968b0f4 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h @@ -35,6 +35,7 @@ @@ -64260,22 +71909,11 @@ index 59ba38bc..d515662 100644 #include <net/irda/irias_object.h> #include <net/irda/ircomm_core.h> -@@ -105,8 +106,8 @@ struct ircomm_tty_cb { - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ - -- int open_count; -- int blocked_open; /* # of blocked opens */ -+ local_t open_count; -+ local_t blocked_open; /* # of blocked opens */ - - /* Protect concurent access to : - * o self->open_count diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h -index cc7c197..9f2da2a 100644 +index 714cc9a..ea05f3e 100644 --- a/include/net/iucv/af_iucv.h +++ b/include/net/iucv/af_iucv.h -@@ -141,7 +141,7 @@ struct iucv_sock { +@@ -149,7 +149,7 @@ struct iucv_skb_cb { struct iucv_sock_list { struct hlist_head head; rwlock_t lock; @@ -64284,8 +71922,88 @@ index cc7c197..9f2da2a 100644 }; unsigned int iucv_sock_poll(struct file *file, struct socket *sock, +diff --git a/include/net/llc_c_ac.h b/include/net/llc_c_ac.h +index df83f69..9b640b8 100644 +--- a/include/net/llc_c_ac.h ++++ b/include/net/llc_c_ac.h +@@ -87,7 +87,7 @@ + #define LLC_CONN_AC_STOP_SENDACK_TMR 70 + #define LLC_CONN_AC_START_SENDACK_TMR_IF_NOT_RUNNING 71 + +-typedef int (*llc_conn_action_t)(struct sock *sk, struct sk_buff *skb); ++typedef int (* const llc_conn_action_t)(struct sock *sk, struct sk_buff *skb); + + extern int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb); + extern int llc_conn_ac_conn_ind(struct sock *sk, struct sk_buff *skb); +diff --git a/include/net/llc_c_ev.h b/include/net/llc_c_ev.h +index 6ca3113..f8026dd 100644 +--- a/include/net/llc_c_ev.h ++++ b/include/net/llc_c_ev.h +@@ -125,8 +125,8 @@ static __inline__ struct llc_conn_state_ev *llc_conn_ev(struct sk_buff *skb) + return (struct llc_conn_state_ev *)skb->cb; + } + +-typedef int (*llc_conn_ev_t)(struct sock *sk, struct sk_buff *skb); +-typedef int (*llc_conn_ev_qfyr_t)(struct sock *sk, struct sk_buff *skb); ++typedef int (* const llc_conn_ev_t)(struct sock *sk, struct sk_buff *skb); ++typedef int (* const llc_conn_ev_qfyr_t)(struct sock *sk, struct sk_buff *skb); + + extern int llc_conn_ev_conn_req(struct sock *sk, struct sk_buff *skb); + extern int llc_conn_ev_data_req(struct sock *sk, struct sk_buff *skb); +diff --git a/include/net/llc_c_st.h b/include/net/llc_c_st.h +index 0e79cfb..f46db31 100644 +--- a/include/net/llc_c_st.h ++++ b/include/net/llc_c_st.h +@@ -37,7 +37,7 @@ struct llc_conn_state_trans { + u8 next_state; + llc_conn_ev_qfyr_t *ev_qualifiers; + llc_conn_action_t *ev_actions; +-}; ++} __do_const; + + struct llc_conn_state { + u8 current_state; +diff --git a/include/net/llc_s_ac.h b/include/net/llc_s_ac.h +index 37a3bbd..55a4241 100644 +--- a/include/net/llc_s_ac.h ++++ b/include/net/llc_s_ac.h +@@ -23,7 +23,7 @@ + #define SAP_ACT_TEST_IND 9 + + /* All action functions must look like this */ +-typedef int (*llc_sap_action_t)(struct llc_sap *sap, struct sk_buff *skb); ++typedef int (* const llc_sap_action_t)(struct llc_sap *sap, struct sk_buff *skb); + + extern int llc_sap_action_unitdata_ind(struct llc_sap *sap, + struct sk_buff *skb); +diff --git a/include/net/llc_s_st.h b/include/net/llc_s_st.h +index 567c681..cd73ac0 100644 +--- a/include/net/llc_s_st.h ++++ b/include/net/llc_s_st.h +@@ -20,7 +20,7 @@ struct llc_sap_state_trans { + llc_sap_ev_t ev; + u8 next_state; + llc_sap_action_t *ev_actions; +-}; ++} __do_const; + + struct llc_sap_state { + u8 curr_state; +diff --git a/include/net/mac80211.h b/include/net/mac80211.h +index f7eba13..91ed983 100644 +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -4119,7 +4119,7 @@ struct rate_control_ops { + void (*add_sta_debugfs)(void *priv, void *priv_sta, + struct dentry *dir); + void (*remove_sta_debugfs)(void *priv, void *priv_sta); +-}; ++} __do_const; + + static inline int rate_supported(struct ieee80211_sta *sta, + enum ieee80211_band band, diff --git a/include/net/neighbour.h b/include/net/neighbour.h -index 34c996f..bb3b4d4 100644 +index 7e748ad..5c6229b 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -123,7 +123,7 @@ struct neigh_ops { @@ -64297,6 +72015,55 @@ index 34c996f..bb3b4d4 100644 struct pneigh_entry { struct pneigh_entry *next; +diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h +index de644bc..dfbcc4c 100644 +--- a/include/net/net_namespace.h ++++ b/include/net/net_namespace.h +@@ -115,7 +115,7 @@ struct net { + #endif + struct netns_ipvs *ipvs; + struct sock *diag_nlsk; +- atomic_t rt_genid; ++ atomic_unchecked_t rt_genid; + }; + + /* +@@ -272,7 +272,11 @@ static inline struct net *read_pnet(struct net * const *pnet) + #define __net_init __init + #define __net_exit __exit_refok + #define __net_initdata __initdata ++#ifdef CONSTIFY_PLUGIN + #define __net_initconst __initconst ++#else ++#define __net_initconst __initdata ++#endif + #endif + + struct pernet_operations { +@@ -282,7 +286,7 @@ struct pernet_operations { + void (*exit_batch)(struct list_head *net_exit_list); + int *id; + size_t size; +-}; ++} __do_const; + + /* + * Use these carefully. If you implement a network device and it +@@ -330,12 +334,12 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header) + + static inline int rt_genid(struct net *net) + { +- return atomic_read(&net->rt_genid); ++ return atomic_read_unchecked(&net->rt_genid); + } + + static inline void rt_genid_bump(struct net *net) + { +- atomic_inc(&net->rt_genid); ++ atomic_inc_unchecked(&net->rt_genid); + } + + #endif /* __NET_NET_NAMESPACE_H */ diff --git a/include/net/netdma.h b/include/net/netdma.h index 8ba8ce2..99b7fff 100644 --- a/include/net/netdma.h @@ -64311,7 +72078,7 @@ index 8ba8ce2..99b7fff 100644 size_t len, struct dma_pinned_list *pinned_list); diff --git a/include/net/netlink.h b/include/net/netlink.h -index f394fe5..fd073f9 100644 +index 9690b0f..87aded7 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h @@ -534,7 +534,7 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb) @@ -64323,26 +72090,85 @@ index f394fe5..fd073f9 100644 } /** +diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h +index c9c0c53..53f24c3 100644 +--- a/include/net/netns/conntrack.h ++++ b/include/net/netns/conntrack.h +@@ -12,10 +12,10 @@ struct nf_conntrack_ecache; + struct nf_proto_net { + #ifdef CONFIG_SYSCTL + struct ctl_table_header *ctl_table_header; +- struct ctl_table *ctl_table; ++ ctl_table_no_const *ctl_table; + #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT + struct ctl_table_header *ctl_compat_header; +- struct ctl_table *ctl_compat_table; ++ ctl_table_no_const *ctl_compat_table; + #endif + #endif + unsigned int users; +@@ -58,7 +58,7 @@ struct nf_ip_net { + struct nf_icmp_net icmpv6; + #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) + struct ctl_table_header *ctl_table_header; +- struct ctl_table *ctl_table; ++ ctl_table_no_const *ctl_table; + #endif + }; + diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h -index bbd023a..97c6d0d 100644 +index 2ba9de8..47bd6c7 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h -@@ -57,8 +57,8 @@ struct netns_ipv4 { - unsigned int sysctl_ping_group_range[2]; +@@ -67,7 +67,7 @@ struct netns_ipv4 { + kgid_t sysctl_ping_group_range[2]; long sysctl_tcp_mem[3]; -- atomic_t rt_genid; - atomic_t dev_addr_genid; -+ atomic_unchecked_t rt_genid; -+ atomic_unchecked_t dev_addr_genid; ++ atomic_unchecked_t dev_addr_genid; #ifdef CONFIG_IP_MROUTE #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES +diff --git a/include/net/protocol.h b/include/net/protocol.h +index 047c047..b9dad15 100644 +--- a/include/net/protocol.h ++++ b/include/net/protocol.h +@@ -44,7 +44,7 @@ struct net_protocol { + void (*err_handler)(struct sk_buff *skb, u32 info); + unsigned int no_policy:1, + netns_ok:1; +-}; ++} __do_const; + + #if IS_ENABLED(CONFIG_IPV6) + struct inet6_protocol { +@@ -57,7 +57,7 @@ struct inet6_protocol { + u8 type, u8 code, int offset, + __be32 info); + unsigned int flags; /* INET6_PROTO_xxx */ +-}; ++} __do_const; + + #define INET6_PROTO_NOPOLICY 0x1 + #define INET6_PROTO_FINAL 0x2 +diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h +index 5a15fab..d799ea7 100644 +--- a/include/net/rtnetlink.h ++++ b/include/net/rtnetlink.h +@@ -81,7 +81,7 @@ struct rtnl_link_ops { + const struct net_device *dev); + unsigned int (*get_num_tx_queues)(void); + unsigned int (*get_num_rx_queues)(void); +-}; ++} __do_const; + + extern int __rtnl_link_register(struct rtnl_link_ops *ops); + extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h -index a2ef814..31a8e3f 100644 +index df85a0c..19ac300 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h -@@ -318,9 +318,9 @@ do { \ +@@ -330,9 +330,9 @@ do { \ #else /* SCTP_DEBUG */ @@ -64355,11 +72181,58 @@ index a2ef814..31a8e3f 100644 #define SCTP_ENABLE_DEBUG #define SCTP_DISABLE_DEBUG #define SCTP_ASSERT(expr, str, func) +diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h +index 2a82d13..62a31c2 100644 +--- a/include/net/sctp/sm.h ++++ b/include/net/sctp/sm.h +@@ -87,7 +87,7 @@ typedef void (sctp_timer_event_t) (unsigned long); + typedef struct { + sctp_state_fn_t *fn; + const char *name; +-} sctp_sm_table_entry_t; ++} __do_const sctp_sm_table_entry_t; + + /* A naming convention of "sctp_sf_xxx" applies to all the state functions + * currently in use. +@@ -299,7 +299,7 @@ __u32 sctp_generate_tag(const struct sctp_endpoint *); + __u32 sctp_generate_tsn(const struct sctp_endpoint *); + + /* Extern declarations for major data structures. */ +-extern sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES]; ++extern sctp_timer_event_t * const sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES]; + + + /* Get the size of a DATA chunk payload. */ +diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h +index 0e0f9d2..cd05ebb 100644 +--- a/include/net/sctp/structs.h ++++ b/include/net/sctp/structs.h +@@ -517,7 +517,7 @@ struct sctp_pf { + struct sctp_association *asoc); + void (*addr_v4map) (struct sctp_sock *, union sctp_addr *); + struct sctp_af *af; +-}; ++} __do_const; + + + /* Structure to track chunk fragments that have been acked, but peer +diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h +index c2e542b..6ca975b 100644 +--- a/include/net/secure_seq.h ++++ b/include/net/secure_seq.h +@@ -3,6 +3,7 @@ + + #include <linux/types.h> + ++extern void net_secret_init(void); + extern __u32 secure_ip_id(__be32 daddr); + extern __u32 secure_ipv6_id(const __be32 daddr[4]); + extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); diff --git a/include/net/sock.h b/include/net/sock.h -index 5a0a58a..ed2bf11 100644 +index 0be480a..586232f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h -@@ -302,7 +302,7 @@ struct sock { +@@ -325,7 +325,7 @@ struct sock { #ifdef CONFIG_RPS __u32 sk_rxhash; #endif @@ -64368,7 +72241,7 @@ index 5a0a58a..ed2bf11 100644 int sk_rcvbuf; struct sk_filter __rcu *sk_filter; -@@ -1691,7 +1691,7 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags) +@@ -1796,7 +1796,7 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags) } static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, @@ -64377,20 +72250,20 @@ index 5a0a58a..ed2bf11 100644 int copy, int offset) { if (skb->ip_summed == CHECKSUM_NONE) { -@@ -1953,7 +1953,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk) +@@ -2055,7 +2055,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk) } } -struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp); +struct sk_buff * __intentional_overflow(0) sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp); - static inline struct page *sk_stream_alloc_page(struct sock *sk) - { + /** + * sk_page_frag - return an appropriate page_frag diff --git a/include/net/tcp.h b/include/net/tcp.h -index f75a04d..e8f5101 100644 +index a345480..3c65cf4 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -478,7 +478,7 @@ extern void tcp_retransmit_timer(struct sock *sk); +@@ -529,7 +529,7 @@ extern void tcp_retransmit_timer(struct sock *sk); extern void tcp_xmit_retransmit_queue(struct sock *); extern void tcp_simple_retransmit(struct sock *); extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); @@ -64399,7 +72272,7 @@ index f75a04d..e8f5101 100644 extern void tcp_send_probe0(struct sock *); extern void tcp_send_partial(struct sock *); -@@ -641,8 +641,8 @@ struct tcp_skb_cb { +@@ -700,8 +700,8 @@ struct tcp_skb_cb { struct inet6_skb_parm h6; #endif } header; /* For incoming frames */ @@ -64409,43 +72282,48 @@ index f75a04d..e8f5101 100644 + __u32 end_seq __intentional_overflow(0); /* SEQ + FIN + SYN + datalen */ __u32 when; /* used to compute rtt's */ __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ - __u8 sacked; /* State flags for SACK/FACK. */ -@@ -655,7 +655,7 @@ struct tcp_skb_cb { - #define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ - #define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) +@@ -715,7 +715,7 @@ struct tcp_skb_cb { + + __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */ + /* 1 byte hole */ - __u32 ack_seq; /* Sequence number ACK'd */ + __u32 ack_seq __intentional_overflow(0); /* Sequence number ACK'd */ }; #define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0])) -@@ -1425,7 +1425,7 @@ struct tcp_seq_afinfo { - char *name; - sa_family_t family; - const struct file_operations *seq_fops; -- struct seq_operations seq_ops; -+ seq_operations_no_const seq_ops; - }; - - struct tcp_iter_state { -diff --git a/include/net/udp.h b/include/net/udp.h -index 5d606d9..e879f7b 100644 ---- a/include/net/udp.h -+++ b/include/net/udp.h -@@ -244,7 +244,7 @@ struct udp_seq_afinfo { - sa_family_t family; - struct udp_table *udp_table; - const struct file_operations *seq_fops; -- struct seq_operations seq_ops; -+ seq_operations_no_const seq_ops; - }; - - struct udp_iter_state { diff --git a/include/net/xfrm.h b/include/net/xfrm.h -index 96239e7..c85b032 100644 +index 24c8886..e6fb816 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h -@@ -505,7 +505,7 @@ struct xfrm_policy { +@@ -304,7 +304,7 @@ struct xfrm_policy_afinfo { + struct net_device *dev, + const struct flowi *fl); + struct dst_entry *(*blackhole_route)(struct net *net, struct dst_entry *orig); +-}; ++} __do_const; + + extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); + extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); +@@ -340,7 +340,7 @@ struct xfrm_state_afinfo { + struct sk_buff *skb); + int (*transport_finish)(struct sk_buff *skb, + int async); +-}; ++} __do_const; + + extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); + extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); +@@ -423,7 +423,7 @@ struct xfrm_mode { + struct module *owner; + unsigned int encap; + int flags; +-}; ++} __do_const; + + /* Flags for xfrm_mode. */ + enum { +@@ -520,7 +520,7 @@ struct xfrm_policy { struct timer_list timer; struct flow_cache_object flo; @@ -64468,10 +72346,10 @@ index 1a046b1..ee0bef0 100644 /** * iw_create_cm_id - Create an IW CM identifier. diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h -index 8f9dfba..610ab6c 100644 +index e1379b4..67eafbe 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h -@@ -756,6 +756,7 @@ struct libfc_function_template { +@@ -762,6 +762,7 @@ struct libfc_function_template { */ void (*disc_stop_final) (struct fc_lport *); }; @@ -64479,7 +72357,7 @@ index 8f9dfba..610ab6c 100644 /** * struct fc_disc - Discovery context -@@ -861,7 +862,7 @@ struct fc_lport { +@@ -866,7 +867,7 @@ struct fc_lport { struct fc_vport *vport; /* Operational Information */ @@ -64489,10 +72367,10 @@ index 8f9dfba..610ab6c 100644 u8 qfull; enum fc_lport_state state; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h -index ba96988..ecf2eb9 100644 +index a7f9cba..b1f44d0 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h -@@ -163,9 +163,9 @@ struct scsi_device { +@@ -171,9 +171,9 @@ struct scsi_device { unsigned int max_device_blocked; /* what device_blocked counts down from */ #define SCSI_DEFAULT_DEVICE_BLOCKED 3 @@ -64506,151 +72384,70 @@ index ba96988..ecf2eb9 100644 struct device sdev_gendev, sdev_dev; diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h -index 719faf1..d1154d4 100644 +index b797e8f..8e2c3aa 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h -@@ -739,7 +739,7 @@ struct fc_function_template { +@@ -751,7 +751,8 @@ struct fc_function_template { unsigned long show_host_system_hostname:1; unsigned long disable_target_scan:1; -}; +} __do_const; ++typedef struct fc_function_template __no_const fc_function_template_no_const; /** -diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h -index 030b87c..98a6954 100644 ---- a/include/sound/ak4xxx-adda.h -+++ b/include/sound/ak4xxx-adda.h -@@ -35,7 +35,7 @@ struct snd_ak4xxx_ops { - void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, - unsigned char val); - void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); --}; -+} __no_const; - - #define AK4XXX_IMAGE_SIZE (AK4XXX_MAX_CHIPS * 16) /* 64 bytes */ - -diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h -index 8c05e47..2b5df97 100644 ---- a/include/sound/hwdep.h -+++ b/include/sound/hwdep.h -@@ -49,7 +49,7 @@ struct snd_hwdep_ops { - struct snd_hwdep_dsp_status *status); - int (*dsp_load)(struct snd_hwdep *hw, - struct snd_hwdep_dsp_image *image); --}; -+} __no_const; - - struct snd_hwdep { - struct snd_card *card; -diff --git a/include/sound/info.h b/include/sound/info.h -index 9ca1a49..aba1728 100644 ---- a/include/sound/info.h -+++ b/include/sound/info.h -@@ -44,7 +44,7 @@ struct snd_info_entry_text { - struct snd_info_buffer *buffer); - void (*write)(struct snd_info_entry *entry, - struct snd_info_buffer *buffer); --}; -+} __no_const; - - struct snd_info_entry_ops { - int (*open)(struct snd_info_entry *entry, -diff --git a/include/sound/pcm.h b/include/sound/pcm.h -index 0d11128..814178e 100644 ---- a/include/sound/pcm.h -+++ b/include/sound/pcm.h -@@ -81,6 +81,7 @@ struct snd_pcm_ops { - int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma); - int (*ack)(struct snd_pcm_substream *substream); - }; -+typedef struct snd_pcm_ops __no_const snd_pcm_ops_no_const; - - /* - * -diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h -index af1b49e..a5d55a5 100644 ---- a/include/sound/sb16_csp.h -+++ b/include/sound/sb16_csp.h -@@ -146,7 +146,7 @@ struct snd_sb_csp_ops { - int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels); - int (*csp_stop) (struct snd_sb_csp * p); - int (*csp_qsound_transfer) (struct snd_sb_csp * p); +diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h +index ff6c741..393815f 100644 +--- a/include/sound/compress_driver.h ++++ b/include/sound/compress_driver.h +@@ -130,7 +130,7 @@ struct snd_compr_ops { + struct snd_compr_caps *caps); + int (*get_codec_caps) (struct snd_compr_stream *stream, + struct snd_compr_codec_caps *codec); -}; +} __no_const; - /* - * CSP private data + /** + * struct snd_compr: Compressed device diff --git a/include/sound/soc.h b/include/sound/soc.h -index 2ebf787..0276839 100644 +index a6a059c..2243336 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h -@@ -711,7 +711,7 @@ struct snd_soc_platform_driver { - /* platform IO - used for platform DAPM */ +@@ -771,7 +771,7 @@ struct snd_soc_codec_driver { + /* probe ordering - for components with runtime dependencies */ + int probe_order; + int remove_order; +-}; ++} __do_const; + + /* SoC platform interface */ + struct snd_soc_platform_driver { +@@ -817,7 +817,7 @@ struct snd_soc_platform_driver { unsigned int (*read)(struct snd_soc_platform *, unsigned int); int (*write)(struct snd_soc_platform *, unsigned int, unsigned int); + int (*bespoke_trigger)(struct snd_pcm_substream *, int); -}; +} __do_const; struct snd_soc_platform { const char *name; -@@ -887,7 +887,7 @@ struct snd_soc_pcm_runtime { - struct snd_soc_dai_link *dai_link; - struct mutex pcm_mutex; - enum snd_soc_pcm_subclass pcm_subclass; -- struct snd_pcm_ops ops; -+ snd_pcm_ops_no_const ops; - - unsigned int complete:1; - unsigned int dev_registered:1; -diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h -index 4119966..1a4671c 100644 ---- a/include/sound/ymfpci.h -+++ b/include/sound/ymfpci.h -@@ -358,7 +358,7 @@ struct snd_ymfpci { - spinlock_t reg_lock; - spinlock_t voice_lock; - wait_queue_head_t interrupt_sleep; -- atomic_t interrupt_sleep_count; -+ atomic_unchecked_t interrupt_sleep_count; - struct snd_info_entry *proc_entry; - const struct firmware *dsp_microcode; - const struct firmware *controller_microcode; diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h -index 3ad5b33..1fa86f4 100644 +index c4af592..20c52d2 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h -@@ -448,7 +448,7 @@ struct t10_reservation_ops { - int (*t10_seq_non_holder)(struct se_cmd *, unsigned char *, u32); - int (*t10_pr_register)(struct se_cmd *); - int (*t10_pr_clear)(struct se_cmd *); --}; -+} __no_const; - - struct t10_reservation { - /* Reservation effects all target ports */ -@@ -577,7 +577,7 @@ struct se_cmd { - atomic_t t_se_count; - atomic_t t_task_cdbs_left; - atomic_t t_task_cdbs_ex_left; -- atomic_t t_task_cdbs_sent; -+ atomic_unchecked_t t_task_cdbs_sent; - unsigned int transport_state; - #define CMD_T_ABORTED (1 << 0) - #define CMD_T_ACTIVE (1 << 1) -@@ -803,7 +803,7 @@ struct se_device { +@@ -657,7 +657,7 @@ struct se_device { spinlock_t stats_lock; /* Active commands on this virtual SE device */ atomic_t simple_cmds; - atomic_t dev_ordered_id; + atomic_unchecked_t dev_ordered_id; - atomic_t execute_tasks; atomic_t dev_ordered_sync; atomic_t dev_qf_count; + int export_count; diff --git a/include/trace/events/fs.h b/include/trace/events/fs.h new file mode 100644 -index 0000000..2efe49d +index 0000000..fb634b7 --- /dev/null +++ b/include/trace/events/fs.h @@ -0,0 +1,53 @@ @@ -64665,7 +72462,7 @@ index 0000000..2efe49d + +TRACE_EVENT(do_sys_open, + -+ TP_PROTO(char *filename, int flags, int mode), ++ TP_PROTO(const char *filename, int flags, int mode), + + TP_ARGS(filename, flags, mode), + @@ -64729,6 +72526,243 @@ index 1c09820..7f5ec79 100644 TP_ARGS(irq, action, ret), +diff --git a/include/uapi/linux/a.out.h b/include/uapi/linux/a.out.h +index 7caf44c..23c6f27 100644 +--- a/include/uapi/linux/a.out.h ++++ b/include/uapi/linux/a.out.h +@@ -39,6 +39,14 @@ enum machine_type { + M_MIPS2 = 152 /* MIPS R6000/R4000 binary */ + }; + ++/* Constants for the N_FLAGS field */ ++#define F_PAX_PAGEEXEC 1 /* Paging based non-executable pages */ ++#define F_PAX_EMUTRAMP 2 /* Emulate trampolines */ ++#define F_PAX_MPROTECT 4 /* Restrict mprotect() */ ++#define F_PAX_RANDMMAP 8 /* Randomize mmap() base */ ++/*#define F_PAX_RANDEXEC 16*/ /* Randomize ET_EXEC base */ ++#define F_PAX_SEGMEXEC 32 /* Segmentation based non-executable pages */ ++ + #if !defined (N_MAGIC) + #define N_MAGIC(exec) ((exec).a_info & 0xffff) + #endif +diff --git a/include/uapi/linux/byteorder/little_endian.h b/include/uapi/linux/byteorder/little_endian.h +index d876736..ccce5c0 100644 +--- a/include/uapi/linux/byteorder/little_endian.h ++++ b/include/uapi/linux/byteorder/little_endian.h +@@ -42,51 +42,51 @@ + + static inline __le64 __cpu_to_le64p(const __u64 *p) + { +- return (__force __le64)*p; ++ return (__force const __le64)*p; + } +-static inline __u64 __le64_to_cpup(const __le64 *p) ++static inline __u64 __intentional_overflow(-1) __le64_to_cpup(const __le64 *p) + { +- return (__force __u64)*p; ++ return (__force const __u64)*p; + } + static inline __le32 __cpu_to_le32p(const __u32 *p) + { +- return (__force __le32)*p; ++ return (__force const __le32)*p; + } + static inline __u32 __le32_to_cpup(const __le32 *p) + { +- return (__force __u32)*p; ++ return (__force const __u32)*p; + } + static inline __le16 __cpu_to_le16p(const __u16 *p) + { +- return (__force __le16)*p; ++ return (__force const __le16)*p; + } + static inline __u16 __le16_to_cpup(const __le16 *p) + { +- return (__force __u16)*p; ++ return (__force const __u16)*p; + } + static inline __be64 __cpu_to_be64p(const __u64 *p) + { +- return (__force __be64)__swab64p(p); ++ return (__force const __be64)__swab64p(p); + } + static inline __u64 __be64_to_cpup(const __be64 *p) + { +- return __swab64p((__u64 *)p); ++ return __swab64p((const __u64 *)p); + } + static inline __be32 __cpu_to_be32p(const __u32 *p) + { +- return (__force __be32)__swab32p(p); ++ return (__force const __be32)__swab32p(p); + } +-static inline __u32 __be32_to_cpup(const __be32 *p) ++static inline __u32 __intentional_overflow(-1) __be32_to_cpup(const __be32 *p) + { +- return __swab32p((__u32 *)p); ++ return __swab32p((const __u32 *)p); + } + static inline __be16 __cpu_to_be16p(const __u16 *p) + { +- return (__force __be16)__swab16p(p); ++ return (__force const __be16)__swab16p(p); + } + static inline __u16 __be16_to_cpup(const __be16 *p) + { +- return __swab16p((__u16 *)p); ++ return __swab16p((const __u16 *)p); + } + #define __cpu_to_le64s(x) do { (void)(x); } while (0) + #define __le64_to_cpus(x) do { (void)(x); } while (0) +diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h +index 8072d35..e77aeb8 100644 +--- a/include/uapi/linux/elf.h ++++ b/include/uapi/linux/elf.h +@@ -37,6 +37,17 @@ typedef __s64 Elf64_Sxword; + #define PT_GNU_EH_FRAME 0x6474e550 + + #define PT_GNU_STACK (PT_LOOS + 0x474e551) ++#define PT_GNU_RELRO (PT_LOOS + 0x474e552) ++ ++#define PT_PAX_FLAGS (PT_LOOS + 0x5041580) ++ ++/* Constants for the e_flags field */ ++#define EF_PAX_PAGEEXEC 1 /* Paging based non-executable pages */ ++#define EF_PAX_EMUTRAMP 2 /* Emulate trampolines */ ++#define EF_PAX_MPROTECT 4 /* Restrict mprotect() */ ++#define EF_PAX_RANDMMAP 8 /* Randomize mmap() base */ ++/*#define EF_PAX_RANDEXEC 16*/ /* Randomize ET_EXEC base */ ++#define EF_PAX_SEGMEXEC 32 /* Segmentation based non-executable pages */ + + /* + * Extended Numbering +@@ -94,6 +105,8 @@ typedef __s64 Elf64_Sxword; + #define DT_DEBUG 21 + #define DT_TEXTREL 22 + #define DT_JMPREL 23 ++#define DT_FLAGS 30 ++ #define DF_TEXTREL 0x00000004 + #define DT_ENCODING 32 + #define OLD_DT_LOOS 0x60000000 + #define DT_LOOS 0x6000000d +@@ -240,6 +253,19 @@ typedef struct elf64_hdr { + #define PF_W 0x2 + #define PF_X 0x1 + ++#define PF_PAGEEXEC (1U << 4) /* Enable PAGEEXEC */ ++#define PF_NOPAGEEXEC (1U << 5) /* Disable PAGEEXEC */ ++#define PF_SEGMEXEC (1U << 6) /* Enable SEGMEXEC */ ++#define PF_NOSEGMEXEC (1U << 7) /* Disable SEGMEXEC */ ++#define PF_MPROTECT (1U << 8) /* Enable MPROTECT */ ++#define PF_NOMPROTECT (1U << 9) /* Disable MPROTECT */ ++/*#define PF_RANDEXEC (1U << 10)*/ /* Enable RANDEXEC */ ++/*#define PF_NORANDEXEC (1U << 11)*/ /* Disable RANDEXEC */ ++#define PF_EMUTRAMP (1U << 12) /* Enable EMUTRAMP */ ++#define PF_NOEMUTRAMP (1U << 13) /* Disable EMUTRAMP */ ++#define PF_RANDMMAP (1U << 14) /* Enable RANDMMAP */ ++#define PF_NORANDMMAP (1U << 15) /* Disable RANDMMAP */ ++ + typedef struct elf32_phdr{ + Elf32_Word p_type; + Elf32_Off p_offset; +@@ -332,6 +358,8 @@ typedef struct elf64_shdr { + #define EI_OSABI 7 + #define EI_PAD 8 + ++#define EI_PAX 14 ++ + #define ELFMAG0 0x7f /* EI_MAG */ + #define ELFMAG1 'E' + #define ELFMAG2 'L' +diff --git a/include/uapi/linux/personality.h b/include/uapi/linux/personality.h +index aa169c4..6a2771d 100644 +--- a/include/uapi/linux/personality.h ++++ b/include/uapi/linux/personality.h +@@ -30,6 +30,7 @@ enum { + #define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \ + ADDR_NO_RANDOMIZE | \ + ADDR_COMPAT_LAYOUT | \ ++ ADDR_LIMIT_3GB | \ + MMAP_PAGE_ZERO) + + /* +diff --git a/include/uapi/linux/screen_info.h b/include/uapi/linux/screen_info.h +index 7530e74..e714828 100644 +--- a/include/uapi/linux/screen_info.h ++++ b/include/uapi/linux/screen_info.h +@@ -43,7 +43,8 @@ struct screen_info { + __u16 pages; /* 0x32 */ + __u16 vesa_attributes; /* 0x34 */ + __u32 capabilities; /* 0x36 */ +- __u8 _reserved[6]; /* 0x3a */ ++ __u16 vesapm_size; /* 0x3a */ ++ __u8 _reserved[4]; /* 0x3c */ + } __attribute__((packed)); + + #define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ +diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h +index 0e011eb..82681b1 100644 +--- a/include/uapi/linux/swab.h ++++ b/include/uapi/linux/swab.h +@@ -43,7 +43,7 @@ + * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32 + */ + +-static inline __attribute_const__ __u16 __fswab16(__u16 val) ++static inline __intentional_overflow(-1) __attribute_const__ __u16 __fswab16(__u16 val) + { + #ifdef __HAVE_BUILTIN_BSWAP16__ + return __builtin_bswap16(val); +@@ -54,7 +54,7 @@ static inline __attribute_const__ __u16 __fswab16(__u16 val) + #endif + } + +-static inline __attribute_const__ __u32 __fswab32(__u32 val) ++static inline __intentional_overflow(-1) __attribute_const__ __u32 __fswab32(__u32 val) + { + #ifdef __HAVE_BUILTIN_BSWAP32__ + return __builtin_bswap32(val); +@@ -65,7 +65,7 @@ static inline __attribute_const__ __u32 __fswab32(__u32 val) + #endif + } + +-static inline __attribute_const__ __u64 __fswab64(__u64 val) ++static inline __intentional_overflow(-1) __attribute_const__ __u64 __fswab64(__u64 val) + { + #ifdef __HAVE_BUILTIN_BSWAP64__ + return __builtin_bswap64(val); +diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h +index 6d67213..8dab561 100644 +--- a/include/uapi/linux/sysctl.h ++++ b/include/uapi/linux/sysctl.h +@@ -155,7 +155,11 @@ enum + KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ + }; + +- ++#ifdef CONFIG_PAX_SOFTMODE ++enum { ++ PAX_SOFTMODE=1 /* PaX: disable/enable soft mode */ ++}; ++#endif + + /* CTL_VM names: */ + enum +diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h +index e4629b9..6958086 100644 +--- a/include/uapi/linux/xattr.h ++++ b/include/uapi/linux/xattr.h +@@ -63,5 +63,9 @@ + #define XATTR_POSIX_ACL_DEFAULT "posix_acl_default" + #define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT + ++/* User namespace */ ++#define XATTR_PAX_PREFIX XATTR_USER_PREFIX "pax." ++#define XATTR_PAX_FLAGS_SUFFIX "flags" ++#define XATTR_NAME_PAX_FLAGS XATTR_PAX_PREFIX XATTR_PAX_FLAGS_SUFFIX + + #endif /* _UAPI_LINUX_XATTR_H */ diff --git a/include/video/udlfb.h b/include/video/udlfb.h index f9466fa..f4e2b81 100644 --- a/include/video/udlfb.h @@ -64749,10 +72783,10 @@ index f9466fa..f4e2b81 100644 #define NR_USB_REQUEST_I2C_SUB_IO 0x02 diff --git a/include/video/uvesafb.h b/include/video/uvesafb.h -index 0993a22..32ba2fe 100644 +index 1a91850..28573f8 100644 --- a/include/video/uvesafb.h +++ b/include/video/uvesafb.h -@@ -177,6 +177,7 @@ struct uvesafb_par { +@@ -122,6 +122,7 @@ struct uvesafb_par { u8 ypan; /* 0 - nothing, 1 - ypan, 2 - ywrap */ u8 pmi_setpal; /* PMI for palette changes */ u16 *pmi_base; /* protected mode interface location */ @@ -64761,10 +72795,10 @@ index 0993a22..32ba2fe 100644 void *pmi_pal; u8 *vbe_state_orig; /* diff --git a/init/Kconfig b/init/Kconfig -index 6cfd71d..16006e6 100644 +index 5341d72..153f24f 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -790,6 +790,7 @@ endif # CGROUPS +@@ -984,6 +984,7 @@ endif # CGROUPS config CHECKPOINT_RESTORE bool "Checkpoint/restore support" if EXPERT @@ -64772,7 +72806,7 @@ index 6cfd71d..16006e6 100644 default n help Enables additional kernel features in a sake of checkpoint/restore. -@@ -1240,7 +1241,7 @@ config SLUB_DEBUG +@@ -1471,7 +1472,7 @@ config SLUB_DEBUG config COMPAT_BRK bool "Disable heap randomization" @@ -64781,7 +72815,7 @@ index 6cfd71d..16006e6 100644 help Randomizing heap placement makes heap exploits harder, but it also breaks ancient binaries (including anything libc5 based). -@@ -1423,7 +1424,7 @@ config INIT_ALL_POSSIBLE +@@ -1734,7 +1735,7 @@ config INIT_ALL_POSSIBLE config STOP_MACHINE bool default y @@ -64790,11 +72824,25 @@ index 6cfd71d..16006e6 100644 help Need stop_machine() primitive. +diff --git a/init/Makefile b/init/Makefile +index 7bc47ee..6da2dc7 100644 +--- a/init/Makefile ++++ b/init/Makefile +@@ -2,6 +2,9 @@ + # Makefile for the linux kernel. + # + ++ccflags-y := $(GCC_PLUGINS_CFLAGS) ++asflags-y := $(GCC_PLUGINS_AFLAGS) ++ + obj-y := main.o version.o mounts.o + ifneq ($(CONFIG_BLK_DEV_INITRD),y) + obj-y += noinitramfs.o diff --git a/init/do_mounts.c b/init/do_mounts.c -index 42b0707..c06eef4 100644 +index a2b49f2..03a0e17c 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c -@@ -326,11 +326,11 @@ static void __init get_fs_names(char *page) +@@ -355,11 +355,11 @@ static void __init get_fs_names(char *page) static int __init do_mount_root(char *name, char *fs, int flags, void *data) { struct super_block *s; @@ -64803,12 +72851,12 @@ index 42b0707..c06eef4 100644 if (err) return err; -- sys_chdir((const char __user __force *)"/root"); +- sys_chdir("/root"); + sys_chdir((const char __force_user *)"/root"); s = current->fs->pwd.dentry->d_sb; ROOT_DEV = s->s_dev; printk(KERN_INFO -@@ -450,18 +450,18 @@ void __init change_floppy(char *fmt, ...) +@@ -480,18 +480,18 @@ void __init change_floppy(char *fmt, ...) va_start(args, fmt); vsprintf(buf, fmt, args); va_end(args); @@ -64830,12 +72878,12 @@ index 42b0707..c06eef4 100644 termios.c_lflag |= ICANON; sys_ioctl(fd, TCSETSF, (long)&termios); sys_close(fd); -@@ -555,6 +555,6 @@ void __init prepare_namespace(void) +@@ -585,6 +585,6 @@ void __init prepare_namespace(void) mount_root(); out: devtmpfs_mount("dev"); - sys_mount(".", "/", NULL, MS_MOVE, NULL); -- sys_chroot((const char __user __force *)"."); +- sys_chroot("."); + sys_mount((char __force_user *)".", (char __force_user *)"/", NULL, MS_MOVE, NULL); + sys_chroot((const char __force_user *)"."); } @@ -64872,41 +72920,29 @@ index f5b978a..69dbfe8 100644 if (!S_ISBLK(stat.st_mode)) return 0; diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c -index 9047330..de0d1fb 100644 +index a32ec1c..ac08811 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c -@@ -43,13 +43,13 @@ static void __init handle_initrd(void) +@@ -58,8 +58,8 @@ static void __init handle_initrd(void) create_dev("/dev/root.old", Root_RAM0); /* mount initrd on rootfs' /root */ mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY); - sys_mkdir("/old", 0700); -- root_fd = sys_open("/", 0, 0); -- old_fd = sys_open("/old", 0, 0); +- sys_chdir("/old"); + sys_mkdir((const char __force_user *)"/old", 0700); -+ root_fd = sys_open((const char __force_user *)"/", 0, 0); -+ old_fd = sys_open((const char __force_user *)"/old", 0, 0); - /* move initrd over / and chdir/chroot in initrd root */ -- sys_chdir("/root"); -- sys_mount(".", "/", NULL, MS_MOVE, NULL); -- sys_chroot("."); -+ sys_chdir((const char __force_user *)"/root"); -+ sys_mount((char __force_user *)".", (char __force_user *)"/", NULL, MS_MOVE, NULL); -+ sys_chroot((const char __force_user *)"."); ++ sys_chdir((const char __force_user *)"/old"); - /* - * In case that a resume from disk is carried out by linuxrc or one of -@@ -66,15 +66,15 @@ static void __init handle_initrd(void) + /* try loading default modules from initrd */ + load_default_modules(); +@@ -76,31 +76,31 @@ static void __init handle_initrd(void) + current->flags &= ~PF_FREEZER_SKIP; /* move initrd to rootfs' /old */ - sys_fchdir(old_fd); -- sys_mount("/", ".", NULL, MS_MOVE, NULL); -+ sys_mount((char __force_user *)"/", (char __force_user *)".", NULL, MS_MOVE, NULL); +- sys_mount("..", ".", NULL, MS_MOVE, NULL); ++ sys_mount((char __force_user *)"..", (char __force_user *)".", NULL, MS_MOVE, NULL); /* switch root and cwd back to / of rootfs */ - sys_fchdir(root_fd); -- sys_chroot("."); -+ sys_chroot((const char __force_user *)"."); - sys_close(old_fd); - sys_close(root_fd); +- sys_chroot(".."); ++ sys_chroot((const char __force_user *)".."); if (new_decode_dev(real_root_dev) == Root_RAM0) { - sys_chdir("/old"); @@ -64914,7 +72950,9 @@ index 9047330..de0d1fb 100644 return; } -@@ -82,17 +82,17 @@ static void __init handle_initrd(void) +- sys_chdir("/"); ++ sys_chdir((const char __force_user *)"/"); + ROOT_DEV = new_decode_dev(real_root_dev); mount_root(); printk(KERN_NOTICE "Trying to move old root to /initrd ... "); @@ -64935,7 +72973,7 @@ index 9047330..de0d1fb 100644 printk(KERN_NOTICE "Trying to free ramdisk memory ... "); if (fd < 0) { error = fd; -@@ -115,11 +115,11 @@ int __init initrd_load(void) +@@ -123,11 +123,11 @@ int __init initrd_load(void) * mounted in the normal path. */ if (rd_load_image("/initrd.image") && ROOT_DEV != Root_RAM0) { @@ -64950,10 +72988,10 @@ index 9047330..de0d1fb 100644 return 0; } diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c -index 32c4799..c27ee74 100644 +index 8cb6db5..d729f50 100644 --- a/init/do_mounts_md.c +++ b/init/do_mounts_md.c -@@ -170,7 +170,7 @@ static void __init md_setup_drive(void) +@@ -180,7 +180,7 @@ static void __init md_setup_drive(void) partitioned ? "_d" : "", minor, md_setup_args[ent].device_names); @@ -64962,7 +73000,7 @@ index 32c4799..c27ee74 100644 if (fd < 0) { printk(KERN_ERR "md: open failed - cannot start " "array %s\n", name); -@@ -233,7 +233,7 @@ static void __init md_setup_drive(void) +@@ -243,7 +243,7 @@ static void __init md_setup_drive(void) * array without it */ sys_close(fd); @@ -64971,29 +73009,43 @@ index 32c4799..c27ee74 100644 sys_ioctl(fd, BLKRRPART, 0); } sys_close(fd); -@@ -283,7 +283,7 @@ static void __init autodetect_raid(void) +@@ -293,7 +293,7 @@ static void __init autodetect_raid(void) wait_for_device_probe(); -- fd = sys_open((const char __user __force *) "/dev/md0", 0, 0); +- fd = sys_open("/dev/md0", 0, 0); + fd = sys_open((const char __force_user *) "/dev/md0", 0, 0); if (fd >= 0) { sys_ioctl(fd, RAID_AUTORUN, raid_autopart); sys_close(fd); +diff --git a/init/init_task.c b/init/init_task.c +index ba0a7f36..2bcf1d5 100644 +--- a/init/init_task.c ++++ b/init/init_task.c +@@ -22,5 +22,9 @@ EXPORT_SYMBOL(init_task); + * Initial thread structure. Alignment of this is handled by a special + * linker map entry. + */ ++#ifdef CONFIG_X86 ++union thread_union init_thread_union __init_task_data; ++#else + union thread_union init_thread_union __init_task_data = + { INIT_THREAD_INFO(init_task) }; ++#endif diff --git a/init/initramfs.c b/init/initramfs.c -index 8216c30..25e8e32 100644 +index a67ef9d..3d88592 100644 --- a/init/initramfs.c +++ b/init/initramfs.c -@@ -74,7 +74,7 @@ static void __init free_hash(void) +@@ -84,7 +84,7 @@ static void __init free_hash(void) } } --static long __init do_utime(char __user *filename, time_t mtime) -+static long __init do_utime(__force char __user *filename, time_t mtime) +-static long __init do_utime(char *filename, time_t mtime) ++static long __init do_utime(char __force_user *filename, time_t mtime) { struct timespec t[2]; -@@ -109,7 +109,7 @@ static void __init dir_utime(void) +@@ -119,7 +119,7 @@ static void __init dir_utime(void) struct dir_entry *de, *tmp; list_for_each_entry_safe(de, tmp, &dir_list, list) { list_del(&de->list); @@ -65002,7 +73054,7 @@ index 8216c30..25e8e32 100644 kfree(de->name); kfree(de); } -@@ -271,7 +271,7 @@ static int __init maybe_link(void) +@@ -281,7 +281,7 @@ static int __init maybe_link(void) if (nlink >= 2) { char *old = find_link(major, minor, ino, mode, collected); if (old) @@ -65011,7 +73063,7 @@ index 8216c30..25e8e32 100644 } return 0; } -@@ -280,11 +280,11 @@ static void __init clean_path(char *path, umode_t mode) +@@ -290,11 +290,11 @@ static void __init clean_path(char *path, umode_t mode) { struct stat st; @@ -65026,7 +73078,7 @@ index 8216c30..25e8e32 100644 } } -@@ -305,7 +305,7 @@ static int __init do_name(void) +@@ -315,7 +315,7 @@ static int __init do_name(void) int openflags = O_WRONLY|O_CREAT; if (ml != 1) openflags |= O_TRUNC; @@ -65035,7 +73087,7 @@ index 8216c30..25e8e32 100644 if (wfd >= 0) { sys_fchown(wfd, uid, gid); -@@ -317,17 +317,17 @@ static int __init do_name(void) +@@ -327,17 +327,17 @@ static int __init do_name(void) } } } else if (S_ISDIR(mode)) { @@ -65060,7 +73112,7 @@ index 8216c30..25e8e32 100644 } } return 0; -@@ -336,15 +336,15 @@ static int __init do_name(void) +@@ -346,15 +346,15 @@ static int __init do_name(void) static int __init do_copy(void) { if (count >= body_len) { @@ -65079,7 +73131,7 @@ index 8216c30..25e8e32 100644 body_len -= count; eat(count); return 1; -@@ -355,9 +355,9 @@ static int __init do_symlink(void) +@@ -365,9 +365,9 @@ static int __init do_symlink(void) { collected[N_ALIGN(name_len) + body_len] = '\0'; clean_path(collected, 0); @@ -65093,10 +73145,10 @@ index 8216c30..25e8e32 100644 next_state = Reset; return 0; diff --git a/init/main.c b/init/main.c -index b08c5f7..3688049 100644 +index 63534a1..8abcaf1 100644 --- a/init/main.c +++ b/init/main.c -@@ -95,6 +95,8 @@ static inline void mark_rodata_ro(void) { } +@@ -98,6 +98,8 @@ static inline void mark_rodata_ro(void) { } extern void tc_init(void); #endif @@ -65105,11 +73157,23 @@ index b08c5f7..3688049 100644 /* * Debug helper: via this flag we know that we are in 'early bootup code' * where only the boot processor is running with IRQ disabled. This means -@@ -148,6 +150,51 @@ static int __init set_reset_devices(char *str) +@@ -151,6 +153,64 @@ static int __init set_reset_devices(char *str) __setup("reset_devices", set_reset_devices); ++#ifdef CONFIG_GRKERNSEC_PROC_USERGROUP ++kgid_t grsec_proc_gid = KGIDT_INIT(CONFIG_GRKERNSEC_PROC_GID); ++static int __init setup_grsec_proc_gid(char *str) ++{ ++ grsec_proc_gid = KGIDT_INIT(simple_strtol(str, NULL, 0)); ++ return 1; ++} ++__setup("grsec_proc_gid=", setup_grsec_proc_gid); ++#endif ++ +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF) ++unsigned long pax_user_shadow_base __read_only = 1UL << TASK_SIZE_MAX_SHIFT; ++EXPORT_SYMBOL(pax_user_shadow_base); +extern char pax_enter_kernel_user[]; +extern char pax_exit_kernel_user[]; +extern pgdval_t clone_pgd_mask; @@ -65136,6 +73200,7 @@ index b08c5f7..3688049 100644 + memcpy(pax_enter_kernel_user, (unsigned char []){0xc3}, 1); + memcpy(pax_exit_kernel_user, (unsigned char []){0xc3}, 1); + clone_pgd_mask = ~(pgdval_t)0UL; ++ pax_user_shadow_base = 0UL; +#endif + + return 0; @@ -65157,7 +73222,7 @@ index b08c5f7..3688049 100644 static const char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; const char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; static const char *panic_later, *panic_param; -@@ -674,6 +721,7 @@ int __init_or_module do_one_initcall(initcall_t fn) +@@ -683,6 +743,7 @@ int __init_or_module do_one_initcall(initcall_t fn) { int count = preempt_count(); int ret; @@ -65165,7 +73230,7 @@ index b08c5f7..3688049 100644 if (initcall_debug) ret = do_one_initcall_debug(fn); -@@ -686,15 +734,15 @@ int __init_or_module do_one_initcall(initcall_t fn) +@@ -695,15 +756,15 @@ int __init_or_module do_one_initcall(initcall_t fn) sprintf(msgbuf, "error code %d ", ret); if (preempt_count() != count) { @@ -65185,23 +73250,23 @@ index b08c5f7..3688049 100644 } return ret; -@@ -747,8 +795,14 @@ static void __init do_initcall_level(int level) +@@ -757,8 +818,14 @@ static void __init do_initcall_level(int level) level, level, - repair_env_string); + &repair_env_string); - for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++) + for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++) { do_one_initcall(*fn); + -+#ifdef CONFIG_PAX_LATENT_ENTROPY -+ transfer_latent_entropy(); ++#ifdef LATENT_ENTROPY_PLUGIN ++ add_device_randomness((const void *)&latent_entropy, sizeof(latent_entropy)); +#endif + + } } static void __init do_initcalls(void) -@@ -782,8 +836,14 @@ static void __init do_pre_smp_initcalls(void) +@@ -792,8 +859,14 @@ static void __init do_pre_smp_initcalls(void) { initcall_t *fn; @@ -65209,15 +73274,15 @@ index b08c5f7..3688049 100644 + for (fn = __initcall_start; fn < __initcall0_start; fn++) { do_one_initcall(*fn); + -+#ifdef CONFIG_PAX_LATENT_ENTROPY -+ transfer_latent_entropy(); ++#ifdef LATENT_ENTROPY_PLUGIN ++ add_device_randomness((const void *)&latent_entropy, sizeof(latent_entropy)); +#endif + + } } - static void run_init_process(const char *init_filename) -@@ -865,7 +925,7 @@ static int __init kernel_init(void * unused) + /* +@@ -890,7 +963,7 @@ static noinline void __init kernel_init_freeable(void) do_basic_setup(); /* Open the /dev/console on the rootfs, this should never fail */ @@ -65226,7 +73291,7 @@ index b08c5f7..3688049 100644 printk(KERN_WARNING "Warning: unable to open an initial console.\n"); (void) sys_dup(0); -@@ -878,11 +938,13 @@ static int __init kernel_init(void * unused) +@@ -903,11 +976,13 @@ static noinline void __init kernel_init_freeable(void) if (!ramdisk_execute_command) ramdisk_execute_command = "/init"; @@ -65241,20 +73306,82 @@ index b08c5f7..3688049 100644 /* * Ok, we have completed the initial bootup, and * we're essentially up and running. Get rid of the +diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c +index 130dfec..cc88451 100644 +--- a/ipc/ipc_sysctl.c ++++ b/ipc/ipc_sysctl.c +@@ -30,7 +30,7 @@ static void *get_ipc(ctl_table *table) + static int proc_ipc_dointvec(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table ipc_table; ++ ctl_table_no_const ipc_table; + + memcpy(&ipc_table, table, sizeof(ipc_table)); + ipc_table.data = get_ipc(table); +@@ -41,7 +41,7 @@ static int proc_ipc_dointvec(ctl_table *table, int write, + static int proc_ipc_dointvec_minmax(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table ipc_table; ++ ctl_table_no_const ipc_table; + + memcpy(&ipc_table, table, sizeof(ipc_table)); + ipc_table.data = get_ipc(table); +@@ -65,7 +65,7 @@ static int proc_ipc_dointvec_minmax_orphans(ctl_table *table, int write, + static int proc_ipc_callback_dointvec(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table ipc_table; ++ ctl_table_no_const ipc_table; + size_t lenp_bef = *lenp; + int rc; + +@@ -88,7 +88,7 @@ static int proc_ipc_callback_dointvec(ctl_table *table, int write, + static int proc_ipc_doulongvec_minmax(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table ipc_table; ++ ctl_table_no_const ipc_table; + memcpy(&ipc_table, table, sizeof(ipc_table)); + ipc_table.data = get_ipc(table); + +@@ -122,7 +122,7 @@ static void ipc_auto_callback(int val) + static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table ipc_table; ++ ctl_table_no_const ipc_table; + size_t lenp_bef = *lenp; + int oldval; + int rc; +diff --git a/ipc/mq_sysctl.c b/ipc/mq_sysctl.c +index 383d638..943fdbb 100644 +--- a/ipc/mq_sysctl.c ++++ b/ipc/mq_sysctl.c +@@ -25,7 +25,7 @@ static void *get_mq(ctl_table *table) + static int proc_mq_dointvec_minmax(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table mq_table; ++ ctl_table_no_const mq_table; + memcpy(&mq_table, table, sizeof(mq_table)); + mq_table.data = get_mq(table); + diff --git a/ipc/mqueue.c b/ipc/mqueue.c -index 28bd64d..c66b72a 100644 +index e4e47f6..a85e0ad 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c -@@ -156,6 +156,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, - mq_bytes = (mq_msg_tblsz + - (info->attr.mq_maxmsg * info->attr.mq_msgsize)); +@@ -278,6 +278,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, + mq_bytes = mq_treesize + (info->attr.mq_maxmsg * + info->attr.mq_msgsize); + gr_learn_resource(current, RLIMIT_MSGQUEUE, u->mq_bytes + mq_bytes, 1); spin_lock(&mq_lock); if (u->mq_bytes + mq_bytes < u->mq_bytes || u->mq_bytes + mq_bytes > rlimit(RLIMIT_MSGQUEUE)) { diff --git a/ipc/msg.c b/ipc/msg.c -index 7385de2..a8180e0 100644 +index fede1d0..9778e0f8 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -309,18 +309,19 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg) @@ -65283,7 +73410,7 @@ index 7385de2..a8180e0 100644 msg_params.flg = msgflg; diff --git a/ipc/sem.c b/ipc/sem.c -index 5215a81..cfc0cac 100644 +index 58d31f1..cce7a55 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -364,10 +364,15 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp, @@ -65315,7 +73442,7 @@ index 5215a81..cfc0cac 100644 sem_params.flg = semflg; sem_params.u.nsems = nsems; diff --git a/ipc/shm.c b/ipc/shm.c -index 406c5b2..bc66d67 100644 +index 7e199fa..180a1ca 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -69,6 +69,14 @@ static void shm_destroy (struct ipc_namespace *ns, struct shmid_kernel *shp); @@ -65324,7 +73451,7 @@ index 406c5b2..bc66d67 100644 +#ifdef CONFIG_GRKERNSEC +extern int gr_handle_shmat(const pid_t shm_cprid, const pid_t shm_lapid, -+ const time_t shm_createtime, const uid_t cuid, ++ const time_t shm_createtime, const kuid_t cuid, + const int shmid); +extern int gr_chroot_shmat(const pid_t shm_cprid, const pid_t shm_lapid, + const time_t shm_createtime); @@ -65333,7 +73460,7 @@ index 406c5b2..bc66d67 100644 void shm_init_ns(struct ipc_namespace *ns) { ns->shm_ctlmax = SHMMAX; -@@ -508,6 +516,14 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) +@@ -531,6 +539,14 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) shp->shm_lprid = 0; shp->shm_atim = shp->shm_dtim = 0; shp->shm_ctim = get_seconds(); @@ -65348,7 +73475,7 @@ index 406c5b2..bc66d67 100644 shp->shm_segsz = size; shp->shm_nattch = 0; shp->shm_file = file; -@@ -559,18 +575,19 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp, +@@ -582,18 +598,19 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp, return 0; } @@ -65373,7 +73500,7 @@ index 406c5b2..bc66d67 100644 shm_params.key = key; shm_params.flg = shmflg; shm_params.u.size = size; -@@ -988,6 +1005,12 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) +@@ -1014,6 +1031,12 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr, f_mode = FMODE_READ | FMODE_WRITE; } if (shmflg & SHM_EXEC) { @@ -65386,7 +73513,7 @@ index 406c5b2..bc66d67 100644 prot |= PROT_EXEC; acc_mode |= S_IXUGO; } -@@ -1011,9 +1034,21 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) +@@ -1037,9 +1060,21 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr, if (err) goto out_unlock; @@ -65409,7 +73536,7 @@ index 406c5b2..bc66d67 100644 shm_unlock(shp); diff --git a/kernel/acct.c b/kernel/acct.c -index 02e6167..54824f7 100644 +index b9bd7f0..1762b4a 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -550,7 +550,7 @@ static void do_acct_process(struct bsd_acct_struct *acct, @@ -65422,10 +73549,10 @@ index 02e6167..54824f7 100644 current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim; set_fs(fs); diff --git a/kernel/audit.c b/kernel/audit.c -index 1c7f2c6..9ba5359 100644 +index d596e53..dbef3c3 100644 --- a/kernel/audit.c +++ b/kernel/audit.c -@@ -115,7 +115,7 @@ u32 audit_sig_sid = 0; +@@ -116,7 +116,7 @@ u32 audit_sig_sid = 0; 3) suppressed due to audit_rate_limit 4) suppressed due to audit_backlog_limit */ @@ -65434,7 +73561,7 @@ index 1c7f2c6..9ba5359 100644 /* The netlink socket. */ static struct sock *audit_sock; -@@ -237,7 +237,7 @@ void audit_log_lost(const char *message) +@@ -238,7 +238,7 @@ void audit_log_lost(const char *message) unsigned long now; int print; @@ -65443,7 +73570,7 @@ index 1c7f2c6..9ba5359 100644 print = (audit_failure == AUDIT_FAIL_PANIC || !audit_rate_limit); -@@ -256,7 +256,7 @@ void audit_log_lost(const char *message) +@@ -257,7 +257,7 @@ void audit_log_lost(const char *message) printk(KERN_WARNING "audit: audit_lost=%d audit_rate_limit=%d " "audit_backlog_limit=%d\n", @@ -65452,20 +73579,20 @@ index 1c7f2c6..9ba5359 100644 audit_rate_limit, audit_backlog_limit); audit_panic(message); -@@ -689,7 +689,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) +@@ -681,7 +681,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) status_set.pid = audit_pid; status_set.rate_limit = audit_rate_limit; status_set.backlog_limit = audit_backlog_limit; - status_set.lost = atomic_read(&audit_lost); + status_set.lost = atomic_read_unchecked(&audit_lost); status_set.backlog = skb_queue_len(&audit_skb_queue); - audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_GET, 0, 0, + audit_send_reply(NETLINK_CB(skb).portid, seq, AUDIT_GET, 0, 0, &status_set, sizeof(status_set)); diff --git a/kernel/auditsc.c b/kernel/auditsc.c -index af1de0f..06dfe57 100644 +index c4b72b0..8654c4e 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c -@@ -2288,7 +2288,7 @@ int auditsc_get_stamp(struct audit_context *ctx, +@@ -2295,7 +2295,7 @@ int auditsc_get_stamp(struct audit_context *ctx, } /* global counter which is incremented every time something logs in */ @@ -65474,7 +73601,7 @@ index af1de0f..06dfe57 100644 /** * audit_set_loginuid - set current task's audit_context loginuid -@@ -2312,7 +2312,7 @@ int audit_set_loginuid(uid_t loginuid) +@@ -2319,7 +2319,7 @@ int audit_set_loginuid(kuid_t loginuid) return -EPERM; #endif /* CONFIG_AUDIT_LOGINUID_IMMUTABLE */ @@ -65484,7 +73611,7 @@ index af1de0f..06dfe57 100644 struct audit_buffer *ab; diff --git a/kernel/capability.c b/kernel/capability.c -index 3f1adb6..c564db0 100644 +index f6c2ce5..982c0f9 100644 --- a/kernel/capability.c +++ b/kernel/capability.c @@ -202,6 +202,9 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr) @@ -65540,11 +73667,11 @@ index 3f1adb6..c564db0 100644 +bool ns_capable_nolog(struct user_namespace *ns, int cap) +{ + if (unlikely(!cap_valid(cap))) { -+ printk(KERN_CRIT "capable() called with invalid cap=%u\n", cap); ++ printk(KERN_CRIT "capable_nolog() called with invalid cap=%u\n", cap); + BUG(); + } + -+ if (security_capable(current_cred(), ns, cap) == 0 && gr_is_capable_nolog(cap)) { ++ if (security_capable_noaudit(current_cred(), ns, cap) == 0 && gr_is_capable_nolog(cap)) { + current->flags |= PF_SUPERPRIV; + return true; + } @@ -65553,9 +73680,9 @@ index 3f1adb6..c564db0 100644 +EXPORT_SYMBOL(ns_capable_nolog); + /** - * capable - Determine if the current task has a superior capability in effect - * @cap: The capability to be tested for -@@ -408,6 +427,12 @@ bool capable(int cap) + * file_ns_capable - Determine if the file's opener had a capability in effect + * @file: The file we want to check +@@ -432,6 +451,12 @@ bool capable(int cap) } EXPORT_SYMBOL(capable); @@ -65568,8 +73695,32 @@ index 3f1adb6..c564db0 100644 /** * nsown_capable - Check superior capability to one's own user_ns * @cap: The capability in question +@@ -464,3 +489,10 @@ bool inode_capable(const struct inode *inode, int cap) + + return ns_capable(ns, cap) && kuid_has_mapping(ns, inode->i_uid); + } ++ ++bool inode_capable_nolog(const struct inode *inode, int cap) ++{ ++ struct user_namespace *ns = current_user_ns(); ++ ++ return ns_capable_nolog(ns, cap) && kuid_has_mapping(ns, inode->i_uid); ++} +diff --git a/kernel/cgroup.c b/kernel/cgroup.c +index ba1f977..f840d9c 100644 +--- a/kernel/cgroup.c ++++ b/kernel/cgroup.c +@@ -5569,7 +5569,7 @@ static int cgroup_css_links_read(struct cgroup *cont, + struct css_set *cg = link->cg; + struct task_struct *task; + int count = 0; +- seq_printf(seq, "css_set %p\n", cg); ++ seq_printf(seq, "css_set %pK\n", cg); + list_for_each_entry(task, &cg->tasks, cg_list) { + if (count++ > MAX_TASKS_SHOWN_PER_CSS) { + seq_puts(seq, " ...\n"); diff --git a/kernel/compat.c b/kernel/compat.c -index d2c67aa..a629b2e 100644 +index 19971d8..02fe2df 100644 --- a/kernel/compat.c +++ b/kernel/compat.c @@ -13,6 +13,7 @@ @@ -65625,7 +73776,7 @@ index d2c67aa..a629b2e 100644 set_fs(old_fs); if (ret) -@@ -550,8 +551,8 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options, +@@ -552,8 +553,8 @@ COMPAT_SYSCALL_DEFINE4(wait4, set_fs (KERNEL_DS); ret = sys_wait4(pid, (stat_addr ? @@ -65636,7 +73787,7 @@ index d2c67aa..a629b2e 100644 set_fs (old_fs); if (ret > 0) { -@@ -576,8 +577,8 @@ asmlinkage long compat_sys_waitid(int which, compat_pid_t pid, +@@ -579,8 +580,8 @@ COMPAT_SYSCALL_DEFINE5(waitid, memset(&info, 0, sizeof(info)); set_fs(KERNEL_DS); @@ -65647,7 +73798,7 @@ index d2c67aa..a629b2e 100644 set_fs(old_fs); if ((ret < 0) || (info.si_signo == 0)) -@@ -707,8 +708,8 @@ long compat_sys_timer_settime(timer_t timer_id, int flags, +@@ -714,8 +715,8 @@ long compat_sys_timer_settime(timer_t timer_id, int flags, oldfs = get_fs(); set_fs(KERNEL_DS); err = sys_timer_settime(timer_id, flags, @@ -65658,7 +73809,7 @@ index d2c67aa..a629b2e 100644 set_fs(oldfs); if (!err && old && put_compat_itimerspec(old, &oldts)) return -EFAULT; -@@ -725,7 +726,7 @@ long compat_sys_timer_gettime(timer_t timer_id, +@@ -732,7 +733,7 @@ long compat_sys_timer_gettime(timer_t timer_id, oldfs = get_fs(); set_fs(KERNEL_DS); err = sys_timer_gettime(timer_id, @@ -65667,7 +73818,7 @@ index d2c67aa..a629b2e 100644 set_fs(oldfs); if (!err && put_compat_itimerspec(setting, &ts)) return -EFAULT; -@@ -744,7 +745,7 @@ long compat_sys_clock_settime(clockid_t which_clock, +@@ -751,7 +752,7 @@ long compat_sys_clock_settime(clockid_t which_clock, oldfs = get_fs(); set_fs(KERNEL_DS); err = sys_clock_settime(which_clock, @@ -65676,7 +73827,7 @@ index d2c67aa..a629b2e 100644 set_fs(oldfs); return err; } -@@ -759,7 +760,7 @@ long compat_sys_clock_gettime(clockid_t which_clock, +@@ -766,7 +767,7 @@ long compat_sys_clock_gettime(clockid_t which_clock, oldfs = get_fs(); set_fs(KERNEL_DS); err = sys_clock_gettime(which_clock, @@ -65685,7 +73836,7 @@ index d2c67aa..a629b2e 100644 set_fs(oldfs); if (!err && put_compat_timespec(&ts, tp)) return -EFAULT; -@@ -779,7 +780,7 @@ long compat_sys_clock_adjtime(clockid_t which_clock, +@@ -786,7 +787,7 @@ long compat_sys_clock_adjtime(clockid_t which_clock, oldfs = get_fs(); set_fs(KERNEL_DS); @@ -65694,7 +73845,7 @@ index d2c67aa..a629b2e 100644 set_fs(oldfs); err = compat_put_timex(utp, &txc); -@@ -799,7 +800,7 @@ long compat_sys_clock_getres(clockid_t which_clock, +@@ -806,7 +807,7 @@ long compat_sys_clock_getres(clockid_t which_clock, oldfs = get_fs(); set_fs(KERNEL_DS); err = sys_clock_getres(which_clock, @@ -65703,7 +73854,7 @@ index d2c67aa..a629b2e 100644 set_fs(oldfs); if (!err && tp && put_compat_timespec(&ts, tp)) return -EFAULT; -@@ -811,9 +812,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart) +@@ -818,9 +819,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart) long err; mm_segment_t oldfs; struct timespec tu; @@ -65715,7 +73866,7 @@ index d2c67aa..a629b2e 100644 oldfs = get_fs(); set_fs(KERNEL_DS); err = clock_nanosleep_restart(restart); -@@ -845,8 +846,8 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags, +@@ -852,8 +853,8 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags, oldfs = get_fs(); set_fs(KERNEL_DS); err = sys_clock_nanosleep(which_clock, flags, @@ -65751,26 +73902,27 @@ index 42e8fa0..9e7406b 100644 return -ENOMEM; diff --git a/kernel/cred.c b/kernel/cred.c -index e70683d..27761b6 100644 +index e0573a4..3874e41 100644 --- a/kernel/cred.c +++ b/kernel/cred.c -@@ -205,6 +205,15 @@ void exit_creds(struct task_struct *tsk) - validate_creds(cred); - put_cred(cred); - } +@@ -164,6 +164,16 @@ void exit_creds(struct task_struct *tsk) + validate_creds(cred); + alter_cred_subscribers(cred, -1); + put_cred(cred); + +#ifdef CONFIG_GRKERNSEC_SETXID + cred = (struct cred *) tsk->delayed_cred; -+ if (cred) { ++ if (cred != NULL) { + tsk->delayed_cred = NULL; + validate_creds(cred); ++ alter_cred_subscribers(cred, -1); + put_cred(cred); + } +#endif } /** -@@ -473,7 +482,7 @@ error_put: +@@ -411,7 +421,7 @@ static bool cred_cap_issubset(const struct cred *set, const struct cred *subset) * Always returns 0 thus allowing this function to be tail-called at the end * of, say, sys_setgid(). */ @@ -65779,16 +73931,16 @@ index e70683d..27761b6 100644 { struct task_struct *task = current; const struct cred *old = task->real_cred; -@@ -492,6 +501,8 @@ int commit_creds(struct cred *new) +@@ -430,6 +440,8 @@ int commit_creds(struct cred *new) get_cred(new); /* we will require a ref for the subj creds too */ + gr_set_role_label(task, new->uid, new->gid); + /* dumpability changes */ - if (old->euid != new->euid || - old->egid != new->egid || -@@ -541,6 +552,101 @@ int commit_creds(struct cred *new) + if (!uid_eq(old->euid, new->euid) || + !gid_eq(old->egid, new->egid) || +@@ -479,6 +491,102 @@ int commit_creds(struct cred *new) put_cred(old); return 0; } @@ -65802,7 +73954,7 @@ index e70683d..27761b6 100644 + + current->delayed_cred = NULL; + -+ if (current_uid() && new != NULL) { ++ if (!uid_eq(current_uid(), GLOBAL_ROOT_UID) && new != NULL) { + // from doing get_cred on it when queueing this + put_cred(new); + return; @@ -65863,7 +74015,8 @@ index e70683d..27761b6 100644 + init_cred + */ + if (grsec_enable_setxid && !current_is_single_threaded() && -+ !current_uid() && new->uid) { ++ uid_eq(current_uid(), GLOBAL_ROOT_UID) && ++ !uid_eq(new->uid, GLOBAL_ROOT_UID)) { + schedule_it = 1; + } + ret = __commit_creds(new); @@ -65891,10 +74044,10 @@ index e70683d..27761b6 100644 /** diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c -index 0557f24..1a00d9a 100644 +index c26278f..e323fb8 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c -@@ -122,7 +122,7 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_lock); +@@ -123,7 +123,7 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_lock); */ static atomic_t masters_in_kgdb; static atomic_t slaves_in_kgdb; @@ -65903,7 +74056,7 @@ index 0557f24..1a00d9a 100644 atomic_t kgdb_setting_breakpoint; struct task_struct *kgdb_usethread; -@@ -132,7 +132,7 @@ int kgdb_single_step; +@@ -133,7 +133,7 @@ int kgdb_single_step; static pid_t kgdb_sstep_pid; /* to keep track of the CPU which is doing the single stepping*/ @@ -65912,7 +74065,7 @@ index 0557f24..1a00d9a 100644 /* * If you are debugging a problem where roundup (the collection of -@@ -540,7 +540,7 @@ return_normal: +@@ -541,7 +541,7 @@ return_normal: * kernel will only try for the value of sstep_tries before * giving up and continuing on. */ @@ -65921,7 +74074,7 @@ index 0557f24..1a00d9a 100644 (kgdb_info[cpu].task && kgdb_info[cpu].task->pid != kgdb_sstep_pid) && --sstep_tries) { atomic_set(&kgdb_active, -1); -@@ -634,8 +634,8 @@ cpu_master_loop: +@@ -635,8 +635,8 @@ cpu_master_loop: } kgdb_restore: @@ -65932,7 +74085,7 @@ index 0557f24..1a00d9a 100644 if (kgdb_info[sstep_cpu].task) kgdb_sstep_pid = kgdb_info[sstep_cpu].task->pid; else -@@ -861,18 +861,18 @@ static void kgdb_unregister_callbacks(void) +@@ -888,18 +888,18 @@ static void kgdb_unregister_callbacks(void) static void kgdb_tasklet_bpt(unsigned long ing) { kgdb_breakpoint(); @@ -65955,11 +74108,11 @@ index 0557f24..1a00d9a 100644 } EXPORT_SYMBOL_GPL(kgdb_schedule_breakpoint); diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c -index 67b847d..93834dd 100644 +index 00eb8f7..d7e3244 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c -@@ -1983,7 +1983,7 @@ static int kdb_lsmod(int argc, const char **argv) - list_for_each_entry(mod, kdb_modules, list) { +@@ -1974,7 +1974,7 @@ static int kdb_lsmod(int argc, const char **argv) + continue; kdb_printf("%-20s%8u 0x%p ", mod->name, - mod->core_size, (void *)mod); @@ -65967,7 +74120,7 @@ index 67b847d..93834dd 100644 #ifdef CONFIG_MODULE_UNLOAD kdb_printf("%4ld ", module_refcount(mod)); #endif -@@ -1993,7 +1993,7 @@ static int kdb_lsmod(int argc, const char **argv) +@@ -1984,7 +1984,7 @@ static int kdb_lsmod(int argc, const char **argv) kdb_printf(" (Loading)"); else kdb_printf(" (Live)"); @@ -65977,10 +74130,23 @@ index 67b847d..93834dd 100644 #ifdef CONFIG_MODULE_UNLOAD { diff --git a/kernel/events/core.c b/kernel/events/core.c -index fd126f8..70b755b 100644 +index 9fcb094..5c06aeb 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c -@@ -181,7 +181,7 @@ int perf_proc_update_handler(struct ctl_table *table, int write, +@@ -155,7 +155,11 @@ static struct srcu_struct pmus_srcu; + * 1 - disallow cpu events for unpriv + * 2 - disallow kernel profiling for unpriv + */ +-int sysctl_perf_event_paranoid __read_mostly = 1; ++#ifdef CONFIG_GRKERNSEC_HIDESYM ++int sysctl_perf_event_legitimately_concerned __read_mostly = 2; ++#else ++int sysctl_perf_event_legitimately_concerned __read_mostly = 1; ++#endif + + /* Minimum for 512 kiB + 1 user control page */ + int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */ +@@ -182,7 +186,7 @@ int perf_proc_update_handler(struct ctl_table *table, int write, return 0; } @@ -65989,7 +74155,7 @@ index fd126f8..70b755b 100644 static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx, enum event_type_t event_type); -@@ -2659,7 +2659,7 @@ static void __perf_event_read(void *info) +@@ -2677,7 +2681,7 @@ static void __perf_event_read(void *info) static inline u64 perf_event_count(struct perf_event *event) { @@ -65998,7 +74164,7 @@ index fd126f8..70b755b 100644 } static u64 perf_event_read(struct perf_event *event) -@@ -2983,9 +2983,9 @@ u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running) +@@ -3007,9 +3011,9 @@ u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running) mutex_lock(&event->child_mutex); total += perf_event_read(event); *enabled += event->total_time_enabled + @@ -66010,7 +74176,7 @@ index fd126f8..70b755b 100644 list_for_each_entry(child, &event->child_list, child_list) { total += perf_event_read(child); -@@ -3393,10 +3393,10 @@ void perf_event_update_userpage(struct perf_event *event) +@@ -3412,10 +3416,10 @@ void perf_event_update_userpage(struct perf_event *event) userpg->offset -= local64_read(&event->hw.prev_count); userpg->time_enabled = enabled + @@ -66023,7 +74189,7 @@ index fd126f8..70b755b 100644 arch_perf_update_userpage(userpg, now); -@@ -3829,11 +3829,11 @@ static void perf_output_read_one(struct perf_output_handle *handle, +@@ -3974,11 +3978,11 @@ static void perf_output_read_one(struct perf_output_handle *handle, values[n++] = perf_event_count(event); if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) { values[n++] = enabled + @@ -66037,7 +74203,7 @@ index fd126f8..70b755b 100644 } if (read_format & PERF_FORMAT_ID) values[n++] = primary_event_id(event); -@@ -4511,12 +4511,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event) +@@ -4726,12 +4730,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event) * need to add enough zero bytes after the string to handle * the 64bit alignment we do later. */ @@ -66052,16 +74218,16 @@ index fd126f8..70b755b 100644 if (IS_ERR(name)) { name = strncpy(tmp, "//toolong", sizeof(tmp)); goto got_name; -@@ -5929,7 +5929,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu, +@@ -6167,7 +6171,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu, event->parent = parent_event; - event->ns = get_pid_ns(current->nsproxy->pid_ns); + event->ns = get_pid_ns(task_active_pid_ns(current)); - event->id = atomic64_inc_return(&perf_event_id); + event->id = atomic64_inc_return_unchecked(&perf_event_id); event->state = PERF_EVENT_STATE_INACTIVE; -@@ -6491,10 +6491,10 @@ static void sync_child_event(struct perf_event *child_event, +@@ -6795,10 +6799,10 @@ static void sync_child_event(struct perf_event *child_event, /* * Add back the child's count to the parent's count: */ @@ -66076,21 +74242,10 @@ index fd126f8..70b755b 100644 /* diff --git a/kernel/exit.c b/kernel/exit.c -index bfbd856..0dd1897 100644 +index 60bc027..ca6d727 100644 --- a/kernel/exit.c +++ b/kernel/exit.c -@@ -59,6 +59,10 @@ - #include <asm/pgtable.h> - #include <asm/mmu_context.h> - -+#ifdef CONFIG_GRKERNSEC -+extern rwlock_t grsec_exec_file_lock; -+#endif -+ - static void exit_mm(struct task_struct * tsk); - - static void __unhash_process(struct task_struct *p, bool group_dead) -@@ -170,6 +174,10 @@ void release_task(struct task_struct * p) +@@ -172,6 +172,10 @@ void release_task(struct task_struct * p) struct task_struct *leader; int zap_leader; repeat: @@ -66101,7 +74256,7 @@ index bfbd856..0dd1897 100644 /* don't need to get the RCU readlock here - the process is dead and * can't be modifying its own credentials. But shut RCU-lockdep up */ rcu_read_lock(); -@@ -382,7 +390,7 @@ int allow_signal(int sig) +@@ -340,7 +344,7 @@ int allow_signal(int sig) * know it'll be handled, so that they don't get converted to * SIGKILL or just silently dropped. */ @@ -66110,25 +74265,7 @@ index bfbd856..0dd1897 100644 recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); return 0; -@@ -418,6 +426,17 @@ void daemonize(const char *name, ...) - vsnprintf(current->comm, sizeof(current->comm), name, args); - va_end(args); - -+#ifdef CONFIG_GRKERNSEC -+ write_lock(&grsec_exec_file_lock); -+ if (current->exec_file) { -+ fput(current->exec_file); -+ current->exec_file = NULL; -+ } -+ write_unlock(&grsec_exec_file_lock); -+#endif -+ -+ gr_set_kernel_label(current); -+ - /* - * If we were started as result of loading a module, close all of the - * user space pages. We don't need them, and if we didn't close them -@@ -901,6 +920,8 @@ void do_exit(long code) +@@ -710,6 +714,8 @@ void do_exit(long code) struct task_struct *tsk = current; int group_dead; @@ -66137,7 +74274,7 @@ index bfbd856..0dd1897 100644 profile_task_exit(tsk); WARN_ON(blk_needs_flush_plug(tsk)); -@@ -917,7 +938,6 @@ void do_exit(long code) +@@ -726,7 +732,6 @@ void do_exit(long code) * mm_release()->clear_child_tid() from writing to a user-controlled * kernel address. */ @@ -66145,7 +74282,7 @@ index bfbd856..0dd1897 100644 ptrace_event(PTRACE_EVENT_EXIT, code); -@@ -978,6 +998,9 @@ void do_exit(long code) +@@ -785,6 +790,9 @@ void do_exit(long code) tsk->exit_code = code; taskstats_exit(tsk, group_dead); @@ -66155,7 +74292,7 @@ index bfbd856..0dd1897 100644 exit_mm(tsk); if (group_dead) -@@ -1094,7 +1117,7 @@ SYSCALL_DEFINE1(exit, int, error_code) +@@ -905,7 +913,7 @@ SYSCALL_DEFINE1(exit, int, error_code) * Take down every thread in the group. This is called by fatal signals * as well as by sys_exit_group (below). */ @@ -66165,30 +74302,10 @@ index bfbd856..0dd1897 100644 { struct signal_struct *sig = current->signal; diff --git a/kernel/fork.c b/kernel/fork.c -index 8163333..aee97f3 100644 +index 1766d32..c0e44e2 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -274,19 +274,24 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) - } - - err = arch_dup_task_struct(tsk, orig); -- if (err) -- goto out; - -+ /* -+ * We defer looking at err, because we will need this setup -+ * for the clean up path to work correctly. -+ */ - tsk->stack = ti; -- - setup_thread_stack(tsk, orig); -+ -+ if (err) -+ goto out; -+ - clear_user_return_notifier(tsk); - clear_tsk_need_resched(tsk); - stackend = end_of_stack(tsk); +@@ -318,7 +318,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) *stackend = STACK_END_MAGIC; /* for overflow detection */ #ifdef CONFIG_CC_STACKPROTECTOR @@ -66197,7 +74314,7 @@ index 8163333..aee97f3 100644 #endif /* -@@ -310,13 +315,78 @@ out: +@@ -344,13 +344,81 @@ free_tsk: } #ifdef CONFIG_MMU @@ -66210,8 +74327,8 @@ index 8163333..aee97f3 100644 + + charge = 0; + if (mpnt->vm_flags & VM_ACCOUNT) { -+ unsigned long len; -+ len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; ++ unsigned long len = vma_pages(mpnt); ++ + if (security_vm_enough_memory_mm(oldmm, len)) /* sic */ + goto fail_nomem; + charge = len; @@ -66233,7 +74350,7 @@ index 8163333..aee97f3 100644 + tmp->vm_mirror = NULL; + file = tmp->vm_file; + if (file) { -+ struct inode *inode = file->f_path.dentry->d_inode; ++ struct inode *inode = file_inode(file); + struct address_space *mapping = file->f_mapping; + + get_file(file); @@ -66244,7 +74361,10 @@ index 8163333..aee97f3 100644 + mapping->i_mmap_writable++; + flush_dcache_mmap_lock(mapping); + /* insert tmp into the share list, just after mpnt */ -+ vma_prio_tree_add(tmp, mpnt); ++ if (unlikely(tmp->vm_flags & VM_NONLINEAR)) ++ vma_nonlinear_insert(tmp, &mapping->i_mmap_nonlinear); ++ else ++ vma_interval_tree_insert_after(tmp, mpnt, &mapping->i_mmap); + flush_dcache_mmap_unlock(mapping); + mutex_unlock(&mapping->i_mmap_mutex); + } @@ -66276,9 +74396,9 @@ index 8163333..aee97f3 100644 - unsigned long charge; - struct mempolicy *pol; + uprobe_start_dup_mmap(); down_write(&oldmm->mmap_sem); - flush_cache_dup_mm(oldmm); -@@ -328,8 +398,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) +@@ -364,8 +432,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) mm->locked_vm = 0; mm->mmap = NULL; mm->mmap_cache = NULL; @@ -66289,23 +74409,21 @@ index 8163333..aee97f3 100644 mm->map_count = 0; cpumask_clear(mm_cpumask(mm)); mm->mm_rb = RB_ROOT; -@@ -345,8 +415,6 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) +@@ -381,57 +449,15 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) prev = NULL; for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) { - struct file *file; - if (mpnt->vm_flags & VM_DONTCOPY) { - long pages = vma_pages(mpnt); - mm->total_vm -= pages; -@@ -354,56 +422,13 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) - -pages); + vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file, + -vma_pages(mpnt)); continue; } - charge = 0; - if (mpnt->vm_flags & VM_ACCOUNT) { -- unsigned long len; -- len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; +- unsigned long len = vma_pages(mpnt); +- - if (security_vm_enough_memory_mm(oldmm, len)) /* sic */ - goto fail_nomem; - charge = len; @@ -66327,7 +74445,7 @@ index 8163333..aee97f3 100644 - tmp->vm_next = tmp->vm_prev = NULL; - file = tmp->vm_file; - if (file) { -- struct inode *inode = file->f_path.dentry->d_inode; +- struct inode *inode = file_inode(file); - struct address_space *mapping = file->f_mapping; - - get_file(file); @@ -66338,7 +74456,12 @@ index 8163333..aee97f3 100644 - mapping->i_mmap_writable++; - flush_dcache_mmap_lock(mapping); - /* insert tmp into the share list, just after mpnt */ -- vma_prio_tree_add(tmp, mpnt); +- if (unlikely(tmp->vm_flags & VM_NONLINEAR)) +- vma_nonlinear_insert(tmp, +- &mapping->i_mmap_nonlinear); +- else +- vma_interval_tree_insert_after(tmp, mpnt, +- &mapping->i_mmap); - flush_dcache_mmap_unlock(mapping); - mutex_unlock(&mapping->i_mmap_mutex); + tmp = dup_vma(mm, oldmm, mpnt); @@ -66348,18 +74471,7 @@ index 8163333..aee97f3 100644 } /* -- * Clear hugetlb-related page reserves for children. This only -- * affects MAP_PRIVATE mappings. Faults generated by the child -- * are not guaranteed to succeed, even if read-only -- */ -- if (is_vm_hugetlb_page(tmp)) -- reset_vma_resv_huge_pages(tmp); -- -- /* - * Link in the new vma and copy the page table entries. - */ - *pprev = tmp; -@@ -424,6 +449,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) +@@ -463,6 +489,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) if (retval) goto out; } @@ -66391,9 +74503,9 @@ index 8163333..aee97f3 100644 /* a new mm has just been created */ arch_dup_mmap(oldmm, mm); retval = 0; -@@ -432,14 +482,6 @@ out: - flush_tlb_mm(oldmm); +@@ -472,14 +523,6 @@ out: up_write(&oldmm->mmap_sem); + uprobe_end_dup_mmap(); return retval; -fail_nomem_anon_vma_fork: - mpol_put(pol); @@ -66406,7 +74518,7 @@ index 8163333..aee97f3 100644 } static inline int mm_alloc_pgd(struct mm_struct *mm) -@@ -676,8 +718,8 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode) +@@ -694,8 +737,8 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode) return ERR_PTR(err); mm = get_task_mm(task); @@ -66417,7 +74529,7 @@ index 8163333..aee97f3 100644 mmput(mm); mm = ERR_PTR(-EACCES); } -@@ -899,13 +941,14 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk) +@@ -917,13 +960,20 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk) spin_unlock(&fs->lock); return -EAGAIN; } @@ -66429,11 +74541,17 @@ index 8163333..aee97f3 100644 tsk->fs = copy_fs_struct(fs); if (!tsk->fs) return -ENOMEM; -+ gr_set_chroot_entries(tsk, &tsk->fs->root); ++ /* Carry through gr_chroot_dentry and is_chrooted instead ++ of recomputing it here. Already copied when the task struct ++ is duplicated. This allows pivot_root to not be treated as ++ a chroot ++ */ ++ //gr_set_chroot_entries(tsk, &tsk->fs->root); ++ return 0; } -@@ -1172,6 +1215,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, +@@ -1196,6 +1246,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); #endif retval = -EAGAIN; @@ -66443,17 +74561,19 @@ index 8163333..aee97f3 100644 if (atomic_read(&p->real_cred->user->processes) >= task_rlimit(p, RLIMIT_NPROC)) { if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) && -@@ -1392,6 +1438,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, - /* Need tasklist lock for parent etc handling! */ - write_lock_irq(&tasklist_lock); +@@ -1441,6 +1494,11 @@ static struct task_struct *copy_process(unsigned long clone_flags, + goto bad_fork_free_pid; + } -+ /* synchronizes with gr_set_acls() */ ++ /* synchronizes with gr_set_acls() ++ we need to call this past the point of no return for fork() ++ */ + gr_copy_label(p); + - /* CLONE_PARENT re-uses the old parent */ - if (clone_flags & (CLONE_PARENT|CLONE_THREAD)) { - p->real_parent = current->real_parent; -@@ -1502,6 +1551,8 @@ bad_fork_cleanup_count: + if (clone_flags & CLONE_THREAD) { + current->signal->nr_threads++; + atomic_inc(¤t->signal->live); +@@ -1524,6 +1582,8 @@ bad_fork_cleanup_count: bad_fork_free: free_task(p); fork_out: @@ -66462,7 +74582,31 @@ index 8163333..aee97f3 100644 return ERR_PTR(retval); } -@@ -1602,6 +1653,8 @@ long do_fork(unsigned long clone_flags, +@@ -1574,6 +1634,23 @@ long do_fork(unsigned long clone_flags, + return -EINVAL; + } + ++#ifdef CONFIG_GRKERNSEC ++ if (clone_flags & CLONE_NEWUSER) { ++ /* ++ * This doesn't really inspire confidence: ++ * http://marc.info/?l=linux-kernel&m=135543612731939&w=2 ++ * http://marc.info/?l=linux-kernel&m=135545831607095&w=2 ++ * Increases kernel attack surface in areas developers ++ * previously cared little about ("low importance due ++ * to requiring "root" capability") ++ * To be removed when this code receives *proper* review ++ */ ++ if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SETUID) || ++ !capable(CAP_SETGID)) ++ return -EPERM; ++ } ++#endif ++ + /* + * Determine whether and which event to report to ptracer. When + * called from kernel_thread or CLONE_UNTRACED is explicitly +@@ -1608,6 +1685,8 @@ long do_fork(unsigned long clone_flags, if (clone_flags & CLONE_PARENT_SETTID) put_user(nr, parent_tidptr); @@ -66471,7 +74615,7 @@ index 8163333..aee97f3 100644 if (clone_flags & CLONE_VFORK) { p->vfork_done = &vfork; init_completion(&vfork); -@@ -1700,7 +1753,7 @@ static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp) +@@ -1761,7 +1840,7 @@ static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp) return 0; /* don't need lock here; in the worst case we'll do useless copy */ @@ -66480,7 +74624,7 @@ index 8163333..aee97f3 100644 return 0; *new_fsp = copy_fs_struct(fs); -@@ -1789,7 +1842,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) +@@ -1873,7 +1952,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) fs = current->fs; spin_lock(&fs->lock); current->fs = new_fs; @@ -66491,7 +74635,7 @@ index 8163333..aee97f3 100644 else new_fs = fs; diff --git a/kernel/futex.c b/kernel/futex.c -index 3717e7b..473c750 100644 +index b26dcfc..39e266a 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -54,6 +54,7 @@ @@ -66502,7 +74646,7 @@ index 3717e7b..473c750 100644 #include <linux/signal.h> #include <linux/export.h> #include <linux/magic.h> -@@ -239,6 +240,11 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw) +@@ -241,6 +242,11 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw) struct page *page, *page_head; int err, ro = 0; @@ -66514,7 +74658,7 @@ index 3717e7b..473c750 100644 /* * The futex address must be "naturally" aligned. */ -@@ -2714,6 +2720,7 @@ static int __init futex_init(void) +@@ -2732,6 +2738,7 @@ static int __init futex_init(void) { u32 curval; int i; @@ -66522,7 +74666,7 @@ index 3717e7b..473c750 100644 /* * This will fail and we want it. Some arch implementations do -@@ -2725,8 +2732,11 @@ static int __init futex_init(void) +@@ -2743,8 +2750,11 @@ static int __init futex_init(void) * implementation, the non-functional ones will return * -ENOSYS. */ @@ -66534,6 +74678,19 @@ index 3717e7b..473c750 100644 for (i = 0; i < ARRAY_SIZE(futex_queues); i++) { plist_head_init(&futex_queues[i].chain); +diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c +index f9f44fd..29885e4 100644 +--- a/kernel/futex_compat.c ++++ b/kernel/futex_compat.c +@@ -32,7 +32,7 @@ fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry, + return 0; + } + +-static void __user *futex_uaddr(struct robust_list __user *entry, ++static void __user __intentional_overflow(-1) *futex_uaddr(struct robust_list __user *entry, + compat_long_t futex_offset) + { + compat_uptr_t base = ptr_to_compat(entry); diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c index 9b22d03..6295b62 100644 --- a/kernel/gcov/base.c @@ -66560,10 +74717,10 @@ index 9b22d03..6295b62 100644 prev->next = info->next; else diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c -index 6db7a5e..25b6648 100644 +index 7ef5556..8247f11 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c -@@ -1407,7 +1407,7 @@ void hrtimer_peek_ahead_timers(void) +@@ -1416,7 +1416,7 @@ void hrtimer_peek_ahead_timers(void) local_irq_restore(flags); } @@ -66572,8 +74729,38 @@ index 6db7a5e..25b6648 100644 { struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); +@@ -1758,7 +1758,7 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata hrtimers_nb = { ++static struct notifier_block hrtimers_nb = { + .notifier_call = hrtimer_cpu_notify, + }; + +diff --git a/kernel/irq_work.c b/kernel/irq_work.c +index 55fcce6..0e4cf34 100644 +--- a/kernel/irq_work.c ++++ b/kernel/irq_work.c +@@ -189,12 +189,13 @@ static int irq_work_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block cpu_notify; ++static struct notifier_block cpu_notify = { ++ .notifier_call = irq_work_cpu_notify, ++ .priority = 0, ++}; + + static __init int irq_work_init_cpu_notifier(void) + { +- cpu_notify.notifier_call = irq_work_cpu_notify; +- cpu_notify.priority = 0; + register_cpu_notifier(&cpu_notify); + return 0; + } diff --git a/kernel/jump_label.c b/kernel/jump_label.c -index 4304919..408c4c0 100644 +index 60f48fa..7f3a770 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c @@ -13,6 +13,7 @@ @@ -66594,7 +74781,7 @@ index 4304919..408c4c0 100644 } static void jump_label_update(struct static_key *key, int enable); -@@ -356,10 +359,12 @@ static void jump_label_invalidate_module_init(struct module *mod) +@@ -357,10 +360,12 @@ static void jump_label_invalidate_module_init(struct module *mod) struct jump_entry *iter_stop = iter_start + mod->num_jump_entries; struct jump_entry *iter; @@ -66608,7 +74795,7 @@ index 4304919..408c4c0 100644 static int diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c -index 079f1d3..4e80e69 100644 +index 2169fee..706ccca 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -11,6 +11,9 @@ @@ -66684,7 +74871,7 @@ index 079f1d3..4e80e69 100644 if (all_var) return is_kernel(addr); -@@ -454,7 +493,6 @@ static unsigned long get_ksymbol_core(struct kallsym_iter *iter) +@@ -470,7 +509,6 @@ static unsigned long get_ksymbol_core(struct kallsym_iter *iter) static void reset_iter(struct kallsym_iter *iter, loff_t new_pos) { @@ -66692,42 +74879,27 @@ index 079f1d3..4e80e69 100644 iter->nameoff = get_symbol_offset(new_pos); iter->pos = new_pos; } -@@ -502,6 +540,11 @@ static int s_show(struct seq_file *m, void *p) +@@ -518,6 +556,11 @@ static int s_show(struct seq_file *m, void *p) { struct kallsym_iter *iter = m->private; +#ifdef CONFIG_GRKERNSEC_HIDESYM -+ if (current_uid()) ++ if (!uid_eq(current_uid(), GLOBAL_ROOT_UID)) + return 0; +#endif + /* Some debugging symbols have no name. Ignore them. */ if (!iter->name[0]) return 0; -@@ -515,11 +558,22 @@ static int s_show(struct seq_file *m, void *p) +@@ -531,6 +574,7 @@ static int s_show(struct seq_file *m, void *p) */ type = iter->exported ? toupper(iter->type) : tolower(iter->type); + -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ seq_printf(m, "%pP %c %s\t[%s]\n", (void *)iter->value, -+ type, iter->name, iter->module_name); -+#else seq_printf(m, "%pK %c %s\t[%s]\n", (void *)iter->value, type, iter->name, iter->module_name); -+#endif } else -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ seq_printf(m, "%pP %c %s\n", (void *)iter->value, -+ iter->type, iter->name); -+#else - seq_printf(m, "%pK %c %s\n", (void *)iter->value, - iter->type, iter->name); -+#endif - return 0; - } - -@@ -540,7 +594,7 @@ static int kallsyms_open(struct inode *inode, struct file *file) +@@ -556,7 +600,7 @@ static int kallsyms_open(struct inode *inode, struct file *file) struct kallsym_iter *iter; int ret; @@ -66736,11 +74908,26 @@ index 079f1d3..4e80e69 100644 if (!iter) return -ENOMEM; reset_iter(iter, 0); +diff --git a/kernel/kcmp.c b/kernel/kcmp.c +index e30ac0f..3528cac 100644 +--- a/kernel/kcmp.c ++++ b/kernel/kcmp.c +@@ -99,6 +99,10 @@ SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type, + struct task_struct *task1, *task2; + int ret; + ++#ifdef CONFIG_GRKERNSEC ++ return -ENOSYS; ++#endif ++ + rcu_read_lock(); + + /* diff --git a/kernel/kexec.c b/kernel/kexec.c -index 4e2e472..cd0c7ae 100644 +index ffd4e11..c3ff6bf 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c -@@ -1046,7 +1046,8 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry, +@@ -1048,7 +1048,8 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry, unsigned long flags) { struct compat_kexec_segment in; @@ -66751,10 +74938,10 @@ index 4e2e472..cd0c7ae 100644 /* Don't allow clients that don't understand the native diff --git a/kernel/kmod.c b/kernel/kmod.c -index 05698a7..a4c1e3a 100644 +index 8985c87..f539dbe 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c -@@ -66,7 +66,7 @@ static void free_modprobe_argv(struct subprocess_info *info) +@@ -75,7 +75,7 @@ static void free_modprobe_argv(struct subprocess_info *info) kfree(info->argv); } @@ -66763,7 +74950,7 @@ index 05698a7..a4c1e3a 100644 { static char *envp[] = { "HOME=/", -@@ -75,7 +75,7 @@ static int call_modprobe(char *module_name, int wait) +@@ -84,7 +84,7 @@ static int call_modprobe(char *module_name, int wait) NULL }; @@ -66772,7 +74959,7 @@ index 05698a7..a4c1e3a 100644 if (!argv) goto out; -@@ -87,7 +87,8 @@ static int call_modprobe(char *module_name, int wait) +@@ -96,7 +96,8 @@ static int call_modprobe(char *module_name, int wait) argv[1] = "-q"; argv[2] = "--"; argv[3] = module_name; /* check free_modprobe_argv() */ @@ -66782,7 +74969,7 @@ index 05698a7..a4c1e3a 100644 return call_usermodehelper_fns(modprobe_path, argv, envp, wait | UMH_KILLABLE, NULL, free_modprobe_argv, NULL); -@@ -112,9 +113,8 @@ out: +@@ -121,9 +122,8 @@ out: * If module auto-loading support is disabled then this function * becomes a no-operation. */ @@ -66793,9 +74980,9 @@ index 05698a7..a4c1e3a 100644 char module_name[MODULE_NAME_LEN]; unsigned int max_modprobes; int ret; -@@ -122,9 +122,7 @@ int __request_module(bool wait, const char *fmt, ...) - #define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */ - static int kmod_loop_msg; +@@ -139,9 +139,7 @@ int __request_module(bool wait, const char *fmt, ...) + */ + WARN_ON_ONCE(wait && current_is_async()); - va_start(args, fmt); - ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); @@ -66804,12 +74991,12 @@ index 05698a7..a4c1e3a 100644 if (ret >= MODULE_NAME_LEN) return -ENAMETOOLONG; -@@ -132,6 +130,20 @@ int __request_module(bool wait, const char *fmt, ...) +@@ -149,6 +147,20 @@ int __request_module(bool wait, const char *fmt, ...) if (ret) return ret; +#ifdef CONFIG_GRKERNSEC_MODHARDEN -+ if (!current_uid()) { ++ if (uid_eq(current_uid(), GLOBAL_ROOT_UID)) { + /* hack to workaround consolekit/udisks stupidity */ + read_lock(&tasklist_lock); + if (!strcmp(current->comm, "mount") && @@ -66825,7 +75012,7 @@ index 05698a7..a4c1e3a 100644 /* If modprobe needs a service that is in a module, we get a recursive * loop. Limit the number of running kmod threads to max_threads/2 or * MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method -@@ -160,11 +172,52 @@ int __request_module(bool wait, const char *fmt, ...) +@@ -177,11 +189,52 @@ int __request_module(bool wait, const char *fmt, ...) trace_module_request(module_name, wait, _RET_IP_); @@ -66854,12 +75041,12 @@ index 05698a7..a4c1e3a 100644 + int ret; + +#ifdef CONFIG_GRKERNSEC_MODHARDEN -+ if (current_uid()) { ++ if (!uid_eq(current_uid(), GLOBAL_ROOT_UID)) { + char module_param[MODULE_NAME_LEN]; + + memset(module_param, 0, sizeof(module_param)); + -+ snprintf(module_param, sizeof(module_param) - 1, "grsec_modharden_normal%u_", current_uid()); ++ snprintf(module_param, sizeof(module_param) - 1, "grsec_modharden_normal%u_", GR_GLOBAL_UID(current_uid())); + + va_start(args, fmt); + ret = ____request_module(wait, module_param, fmt, args); @@ -66879,7 +75066,7 @@ index 05698a7..a4c1e3a 100644 EXPORT_SYMBOL(__request_module); #endif /* CONFIG_MODULES */ -@@ -267,7 +320,7 @@ static int wait_for_helper(void *data) +@@ -292,7 +345,7 @@ static int wait_for_helper(void *data) * * Thus the __user pointer cast is valid here. */ @@ -66888,8 +75075,17 @@ index 05698a7..a4c1e3a 100644 /* * If ret is 0, either ____call_usermodehelper failed and the +@@ -649,7 +702,7 @@ EXPORT_SYMBOL(call_usermodehelper_fns); + static int proc_cap_handler(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table t; ++ ctl_table_no_const t; + unsigned long cap_array[_KERNEL_CAPABILITY_U32S]; + kernel_cap_t new_cap; + int err, i; diff --git a/kernel/kprobes.c b/kernel/kprobes.c -index c62b854..cb67968 100644 +index 3fed7f0..a3f95ed 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -185,7 +185,7 @@ static kprobe_opcode_t __kprobes *__get_insn_slot(struct kprobe_insn_cache *c) @@ -66910,7 +75106,7 @@ index c62b854..cb67968 100644 kfree(kip); } return 1; -@@ -1955,7 +1955,7 @@ static int __init init_kprobes(void) +@@ -2073,7 +2073,7 @@ static int __init init_kprobes(void) { int i, err = 0; unsigned long offset = 0, size = 0; @@ -66919,7 +75115,21 @@ index c62b854..cb67968 100644 const char *symbol_name; void *addr; struct kprobe_blackpoint *kb; -@@ -2081,7 +2081,7 @@ static int __kprobes show_kprobe_addr(struct seq_file *pi, void *v) +@@ -2158,11 +2158,11 @@ static void __kprobes report_probe(struct seq_file *pi, struct kprobe *p, + kprobe_type = "k"; + + if (sym) +- seq_printf(pi, "%p %s %s+0x%x %s ", ++ seq_printf(pi, "%pK %s %s+0x%x %s ", + p->addr, kprobe_type, sym, offset, + (modname ? modname : " ")); + else +- seq_printf(pi, "%p %s %p ", ++ seq_printf(pi, "%pK %s %pK ", + p->addr, kprobe_type, p->addr); + + if (!pp) +@@ -2199,7 +2199,7 @@ static int __kprobes show_kprobe_addr(struct seq_file *pi, void *v) const char *sym = NULL; unsigned int i = *(loff_t *) v; unsigned long offset = 0; @@ -66929,10 +75139,10 @@ index c62b854..cb67968 100644 head = &kprobe_table[i]; preempt_disable(); diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c -index 4e316e1..5501eef 100644 +index 6ada93c..dce7d5d 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c -@@ -47,6 +47,8 @@ static ssize_t uevent_helper_store(struct kobject *kobj, +@@ -46,6 +46,8 @@ static ssize_t uevent_helper_store(struct kobject *kobj, { if (count+1 > UEVENT_HELPER_PATH_LEN) return -ENOENT; @@ -66941,8 +75151,17 @@ index 4e316e1..5501eef 100644 memcpy(uevent_helper, buf, count); uevent_helper[count] = '\0'; if (count && uevent_helper[count-1] == '\n') +@@ -172,7 +174,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj, + return count; + } + +-static struct bin_attribute notes_attr = { ++static bin_attribute_no_const notes_attr __read_only = { + .attr = { + .name = "notes", + .mode = S_IRUGO, diff --git a/kernel/lockdep.c b/kernel/lockdep.c -index ea9ee45..67ebc8f 100644 +index 8a0efac..56f1e2d 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c @@ -590,6 +590,10 @@ static int static_obj(void *obj) @@ -66964,7 +75183,7 @@ index ea9ee45..67ebc8f 100644 printk("the code is fine but needs lockdep annotation.\n"); printk("turning off the locking correctness validator.\n"); dump_stack(); -@@ -3042,7 +3047,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, +@@ -3078,7 +3083,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, if (!class) return 0; } @@ -66974,31 +75193,67 @@ index ea9ee45..67ebc8f 100644 printk("\nacquire class [%p] %s", class->key, class->name); if (class->name_version > 1) diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c -index 91c32a0..b2c71c5 100644 +index b2c71c5..7b88d63 100644 --- a/kernel/lockdep_proc.c +++ b/kernel/lockdep_proc.c -@@ -39,7 +39,7 @@ static void l_stop(struct seq_file *m, void *v) +@@ -65,7 +65,7 @@ static int l_show(struct seq_file *m, void *v) + return 0; + } - static void print_name(struct seq_file *m, struct lock_class *class) - { -- char str[128]; -+ char str[KSYM_NAME_LEN]; - const char *name = class->name; +- seq_printf(m, "%p", class->key); ++ seq_printf(m, "%pK", class->key); + #ifdef CONFIG_DEBUG_LOCKDEP + seq_printf(m, " OPS:%8ld", class->ops); + #endif +@@ -83,7 +83,7 @@ static int l_show(struct seq_file *m, void *v) + + list_for_each_entry(entry, &class->locks_after, entry) { + if (entry->distance == 1) { +- seq_printf(m, " -> [%p] ", entry->class->key); ++ seq_printf(m, " -> [%pK] ", entry->class->key); + print_name(m, entry->class); + seq_puts(m, "\n"); + } +@@ -152,7 +152,7 @@ static int lc_show(struct seq_file *m, void *v) + if (!class->key) + continue; - if (!name) { +- seq_printf(m, "[%p] ", class->key); ++ seq_printf(m, "[%pK] ", class->key); + print_name(m, class); + seq_puts(m, "\n"); + } +@@ -495,7 +495,7 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data) + if (!i) + seq_line(m, '-', 40-namelen, namelen); + +- snprintf(ip, sizeof(ip), "[<%p>]", ++ snprintf(ip, sizeof(ip), "[<%pK>]", + (void *)class->contention_point[i]); + seq_printf(m, "%40s %14lu %29s %pS\n", + name, stats->contention_point[i], +@@ -510,7 +510,7 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data) + if (!i) + seq_line(m, '-', 40-namelen, namelen); + +- snprintf(ip, sizeof(ip), "[<%p>]", ++ snprintf(ip, sizeof(ip), "[<%pK>]", + (void *)class->contending_point[i]); + seq_printf(m, "%40s %14lu %29s %pS\n", + name, stats->contending_point[i], diff --git a/kernel/module.c b/kernel/module.c -index 78ac6ec..e87db0e 100644 +index 0925c9a..6b044ac 100644 --- a/kernel/module.c +++ b/kernel/module.c -@@ -58,6 +58,7 @@ - #include <linux/jump_label.h> +@@ -61,6 +61,7 @@ #include <linux/pfn.h> #include <linux/bsearch.h> + #include <linux/fips.h> +#include <linux/grsecurity.h> + #include <uapi/linux/module.h> + #include "module-internal.h" - #define CREATE_TRACE_POINTS - #include <trace/events/module.h> -@@ -114,7 +115,8 @@ static BLOCKING_NOTIFIER_HEAD(module_notify_list); +@@ -156,7 +157,8 @@ static BLOCKING_NOTIFIER_HEAD(module_notify_list); /* Bounds of module allocation, for speeding __module_address. * Protected by module_mutex. */ @@ -67008,7 +75263,7 @@ index 78ac6ec..e87db0e 100644 int register_module_notifier(struct notifier_block * nb) { -@@ -278,7 +280,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr, +@@ -323,7 +325,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr, return true; list_for_each_entry_rcu(mod, &modules, list) { @@ -67017,16 +75272,16 @@ index 78ac6ec..e87db0e 100644 { mod->syms, mod->syms + mod->num_syms, mod->crcs, NOT_GPL_ONLY, false }, { mod->gpl_syms, mod->gpl_syms + mod->num_gpl_syms, -@@ -300,7 +302,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr, - #endif - }; +@@ -348,7 +350,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr, + if (mod->state == MODULE_STATE_UNFORMED) + continue; - if (each_symbol_in_section(arr, ARRAY_SIZE(arr), mod, fn, data)) + if (each_symbol_in_section(modarr, ARRAY_SIZE(modarr), mod, fn, data)) return true; } return false; -@@ -432,7 +434,7 @@ static inline void __percpu *mod_percpu(struct module *mod) +@@ -485,7 +487,7 @@ static inline void __percpu *mod_percpu(struct module *mod) static int percpu_modalloc(struct module *mod, unsigned long size, unsigned long align) { @@ -67035,7 +75290,7 @@ index 78ac6ec..e87db0e 100644 printk(KERN_WARNING "%s: per-cpu alignment %li > %li\n", mod->name, align, PAGE_SIZE); align = PAGE_SIZE; -@@ -1032,7 +1034,7 @@ struct module_attribute module_uevent = +@@ -1089,7 +1091,7 @@ struct module_attribute module_uevent = static ssize_t show_coresize(struct module_attribute *mattr, struct module_kobject *mk, char *buffer) { @@ -67044,7 +75299,7 @@ index 78ac6ec..e87db0e 100644 } static struct module_attribute modinfo_coresize = -@@ -1041,7 +1043,7 @@ static struct module_attribute modinfo_coresize = +@@ -1098,7 +1100,7 @@ static struct module_attribute modinfo_coresize = static ssize_t show_initsize(struct module_attribute *mattr, struct module_kobject *mk, char *buffer) { @@ -67053,7 +75308,7 @@ index 78ac6ec..e87db0e 100644 } static struct module_attribute modinfo_initsize = -@@ -1255,7 +1257,7 @@ resolve_symbol_wait(struct module *mod, +@@ -1312,7 +1314,7 @@ resolve_symbol_wait(struct module *mod, */ #ifdef CONFIG_SYSFS @@ -67062,7 +75317,25 @@ index 78ac6ec..e87db0e 100644 static inline bool sect_empty(const Elf_Shdr *sect) { return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size == 0; -@@ -1721,21 +1723,21 @@ static void set_section_ro_nx(void *base, +@@ -1452,7 +1454,7 @@ static void add_notes_attrs(struct module *mod, const struct load_info *info) + { + unsigned int notes, loaded, i; + struct module_notes_attrs *notes_attrs; +- struct bin_attribute *nattr; ++ bin_attribute_no_const *nattr; + + /* failed to create section attributes, so can't create notes */ + if (!mod->sect_attrs) +@@ -1564,7 +1566,7 @@ static void del_usage_links(struct module *mod) + static int module_add_modinfo_attrs(struct module *mod) + { + struct module_attribute *attr; +- struct module_attribute *temp_attr; ++ module_attribute_no_const *temp_attr; + int error = 0; + int i; + +@@ -1778,21 +1780,21 @@ static void set_section_ro_nx(void *base, static void unset_module_core_ro_nx(struct module *mod) { @@ -67092,10 +75365,10 @@ index 78ac6ec..e87db0e 100644 set_memory_rw); } -@@ -1746,14 +1748,14 @@ void set_all_modules_text_rw(void) - - mutex_lock(&module_mutex); +@@ -1805,14 +1807,14 @@ void set_all_modules_text_rw(void) list_for_each_entry_rcu(mod, &modules, list) { + if (mod->state == MODULE_STATE_UNFORMED) + continue; - if ((mod->module_core) && (mod->core_text_size)) { - set_page_attributes(mod->module_core, - mod->module_core + mod->core_text_size, @@ -67113,10 +75386,10 @@ index 78ac6ec..e87db0e 100644 set_memory_rw); } } -@@ -1767,14 +1769,14 @@ void set_all_modules_text_ro(void) - - mutex_lock(&module_mutex); +@@ -1828,14 +1830,14 @@ void set_all_modules_text_ro(void) list_for_each_entry_rcu(mod, &modules, list) { + if (mod->state == MODULE_STATE_UNFORMED) + continue; - if ((mod->module_core) && (mod->core_text_size)) { - set_page_attributes(mod->module_core, - mod->module_core + mod->core_text_size, @@ -67134,7 +75407,7 @@ index 78ac6ec..e87db0e 100644 set_memory_ro); } } -@@ -1820,16 +1822,19 @@ static void free_module(struct module *mod) +@@ -1881,16 +1883,19 @@ static void free_module(struct module *mod) /* This may be NULL, but that's OK */ unset_module_init_ro_nx(mod); @@ -67157,7 +75430,7 @@ index 78ac6ec..e87db0e 100644 #ifdef CONFIG_MPU update_protections(current->mm); -@@ -1899,9 +1904,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) +@@ -1960,9 +1965,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) int ret = 0; const struct kernel_symbol *ksym; @@ -67168,7 +75441,7 @@ index 78ac6ec..e87db0e 100644 + + p = strstr(mod->args, "grsec_modharden_fs"); + if (p) { -+ char *endptr = p + strlen("grsec_modharden_fs"); ++ char *endptr = p + sizeof("grsec_modharden_fs") - 1; + /* copy \0 as well */ + memmove(p, endptr, strlen(mod->args) - (unsigned int)(endptr - mod->args) + 1); + is_fs_load = 1; @@ -67189,7 +75462,7 @@ index 78ac6ec..e87db0e 100644 switch (sym[i].st_shndx) { case SHN_COMMON: /* We compiled with -fno-common. These are not -@@ -1922,7 +1949,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) +@@ -1983,7 +2010,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) ksym = resolve_symbol_wait(mod, info, name); /* Ok if resolved. */ if (ksym && !IS_ERR(ksym)) { @@ -67199,7 +75472,7 @@ index 78ac6ec..e87db0e 100644 break; } -@@ -1941,11 +1970,20 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) +@@ -2002,11 +2031,20 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) secbase = (unsigned long)mod_percpu(mod); else secbase = info->sechdrs[sym[i].st_shndx].sh_addr; @@ -67220,7 +75493,7 @@ index 78ac6ec..e87db0e 100644 return ret; } -@@ -2049,22 +2087,12 @@ static void layout_sections(struct module *mod, struct load_info *info) +@@ -2090,22 +2128,12 @@ static void layout_sections(struct module *mod, struct load_info *info) || s->sh_entsize != ~0UL || strstarts(sname, ".init")) continue; @@ -67247,7 +75520,7 @@ index 78ac6ec..e87db0e 100644 } pr_debug("Init section allocation order:\n"); -@@ -2078,23 +2106,13 @@ static void layout_sections(struct module *mod, struct load_info *info) +@@ -2119,23 +2147,13 @@ static void layout_sections(struct module *mod, struct load_info *info) || s->sh_entsize != ~0UL || !strstarts(sname, ".init")) continue; @@ -67276,7 +75549,7 @@ index 78ac6ec..e87db0e 100644 } } -@@ -2266,7 +2284,7 @@ static void layout_symtab(struct module *mod, struct load_info *info) +@@ -2308,7 +2326,7 @@ static void layout_symtab(struct module *mod, struct load_info *info) /* Put symbol section at end of init part of module. */ symsect->sh_flags |= SHF_ALLOC; @@ -67285,8 +75558,8 @@ index 78ac6ec..e87db0e 100644 info->index.sym) | INIT_OFFSET_MASK; pr_debug("\t%s\n", info->secstrings + symsect->sh_name); -@@ -2281,13 +2299,13 @@ static void layout_symtab(struct module *mod, struct load_info *info) - } +@@ -2325,13 +2343,13 @@ static void layout_symtab(struct module *mod, struct load_info *info) + } /* Append room for core symbols at end of core part. */ - info->symoffs = ALIGN(mod->core_size, symsect->sh_addralign ?: 1); @@ -67303,7 +75576,7 @@ index 78ac6ec..e87db0e 100644 info->index.str) | INIT_OFFSET_MASK; pr_debug("\t%s\n", info->secstrings + strsect->sh_name); } -@@ -2305,12 +2323,14 @@ static void add_kallsyms(struct module *mod, const struct load_info *info) +@@ -2349,12 +2367,14 @@ static void add_kallsyms(struct module *mod, const struct load_info *info) /* Make sure we get permanent strtab: don't use info->strtab. */ mod->strtab = (void *)info->sechdrs[info->index.str].sh_addr; @@ -67318,10 +75591,10 @@ index 78ac6ec..e87db0e 100644 + mod->core_symtab = dst = mod->module_core_rx + info->symoffs; + mod->core_strtab = s = mod->module_core_rx + info->stroffs; src = mod->symtab; - *dst = *src; - *s++ = 0; -@@ -2323,6 +2343,8 @@ static void add_kallsyms(struct module *mod, const struct load_info *info) - s += strlcpy(s, &mod->strtab[src->st_name], KSYM_NAME_LEN) + 1; + for (ndst = i = 0; i < mod->num_symtab; i++) { + if (i == 0 || +@@ -2366,6 +2386,8 @@ static void add_kallsyms(struct module *mod, const struct load_info *info) + } } mod->core_num_syms = ndst; + @@ -67329,8 +75602,8 @@ index 78ac6ec..e87db0e 100644 } #else static inline void layout_symtab(struct module *mod, struct load_info *info) -@@ -2356,17 +2378,33 @@ void * __weak module_alloc(unsigned long size) - return size == 0 ? NULL : vmalloc_exec(size); +@@ -2399,17 +2421,33 @@ void * __weak module_alloc(unsigned long size) + return vmalloc_exec(size); } -static void *module_alloc_update_bounds(unsigned long size) @@ -67368,8 +75641,8 @@ index 78ac6ec..e87db0e 100644 mutex_unlock(&module_mutex); } return ret; -@@ -2543,8 +2581,14 @@ static struct module *setup_load_info(struct load_info *info) - static int check_modinfo(struct module *mod, struct load_info *info) +@@ -2685,8 +2723,14 @@ static struct module *setup_load_info(struct load_info *info, int flags) + static int check_modinfo(struct module *mod, struct load_info *info, int flags) { const char *modmagic = get_modinfo(info, "vermagic"); + const char *license = get_modinfo(info, "license"); @@ -67380,10 +75653,10 @@ index 78ac6ec..e87db0e 100644 + return -ENOEXEC; +#endif + - /* This is allowed: modprobe --force will invalidate it. */ - if (!modmagic) { - err = try_to_force_load(mod, "bad vermagic"); -@@ -2567,7 +2611,7 @@ static int check_modinfo(struct module *mod, struct load_info *info) + if (flags & MODULE_INIT_IGNORE_VERMAGIC) + modmagic = NULL; + +@@ -2712,7 +2756,7 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags) } /* Set up license info based on the info section */ @@ -67392,7 +75665,7 @@ index 78ac6ec..e87db0e 100644 return 0; } -@@ -2661,7 +2705,7 @@ static int move_module(struct module *mod, struct load_info *info) +@@ -2806,7 +2850,7 @@ static int move_module(struct module *mod, struct load_info *info) void *ptr; /* Do the allocs. */ @@ -67401,7 +75674,7 @@ index 78ac6ec..e87db0e 100644 /* * The pointer to this block is stored in the module structure * which is inside the block. Just mark it as not being a -@@ -2671,23 +2715,50 @@ static int move_module(struct module *mod, struct load_info *info) +@@ -2816,11 +2860,11 @@ static int move_module(struct module *mod, struct load_info *info) if (!ptr) return -ENOMEM; @@ -67410,29 +75683,34 @@ index 78ac6ec..e87db0e 100644 + memset(ptr, 0, mod->core_size_rw); + mod->module_core_rw = ptr; -- ptr = module_alloc_update_bounds(mod->init_size); -+ ptr = module_alloc_update_bounds_rw(mod->init_size_rw); - /* - * The pointer to this block is stored in the module structure - * which is inside the block. This block doesn't need to be - * scanned as it contains data and code that will be freed - * after the module is initialized. - */ -- kmemleak_ignore(ptr); -- if (!ptr && mod->init_size) { -- module_free(mod, mod->module_core); -+ kmemleak_not_leak(ptr); -+ if (!ptr && mod->init_size_rw) { -+ module_free(mod, mod->module_core_rw); -+ return -ENOMEM; -+ } -+ memset(ptr, 0, mod->init_size_rw); -+ mod->module_init_rw = ptr; +- if (mod->init_size) { +- ptr = module_alloc_update_bounds(mod->init_size); ++ if (mod->init_size_rw) { ++ ptr = module_alloc_update_bounds_rw(mod->init_size_rw); + /* + * The pointer to this block is stored in the module structure + * which is inside the block. This block doesn't need to be +@@ -2829,13 +2873,45 @@ static int move_module(struct module *mod, struct load_info *info) + */ + kmemleak_ignore(ptr); + if (!ptr) { +- module_free(mod, mod->module_core); ++ module_free(mod, mod->module_core_rw); + return -ENOMEM; + } +- memset(ptr, 0, mod->init_size); +- mod->module_init = ptr; ++ memset(ptr, 0, mod->init_size_rw); ++ mod->module_init_rw = ptr; + } else +- mod->module_init = NULL; ++ mod->module_init_rw = NULL; + + ptr = module_alloc_update_bounds_rx(mod->core_size_rx); + kmemleak_not_leak(ptr); + if (!ptr) { -+ module_free(mod, mod->module_init_rw); ++ if (mod->module_init_rw) ++ module_free(mod, mod->module_init_rw); + module_free(mod, mod->module_core_rw); + return -ENOMEM; + } @@ -67442,25 +75720,27 @@ index 78ac6ec..e87db0e 100644 + pax_close_kernel(); + mod->module_core_rx = ptr; + -+ ptr = module_alloc_update_bounds_rx(mod->init_size_rx); -+ kmemleak_not_leak(ptr); -+ if (!ptr && mod->init_size_rx) { -+ module_free_exec(mod, mod->module_core_rx); -+ module_free(mod, mod->module_init_rw); -+ module_free(mod, mod->module_core_rw); - return -ENOMEM; - } -- memset(ptr, 0, mod->init_size); -- mod->module_init = ptr; ++ if (mod->init_size_rx) { ++ ptr = module_alloc_update_bounds_rx(mod->init_size_rx); ++ kmemleak_ignore(ptr); ++ if (!ptr && mod->init_size_rx) { ++ module_free_exec(mod, mod->module_core_rx); ++ if (mod->module_init_rw) ++ module_free(mod, mod->module_init_rw); ++ module_free(mod, mod->module_core_rw); ++ return -ENOMEM; ++ } + -+ pax_open_kernel(); -+ memset(ptr, 0, mod->init_size_rx); -+ pax_close_kernel(); -+ mod->module_init_rx = ptr; ++ pax_open_kernel(); ++ memset(ptr, 0, mod->init_size_rx); ++ pax_close_kernel(); ++ mod->module_init_rx = ptr; ++ } else ++ mod->module_init_rx = NULL; /* Transfer each section which specifies SHF_ALLOC */ pr_debug("final section addresses:\n"); -@@ -2698,16 +2769,45 @@ static int move_module(struct module *mod, struct load_info *info) +@@ -2846,16 +2922,45 @@ static int move_module(struct module *mod, struct load_info *info) if (!(shdr->sh_flags & SHF_ALLOC)) continue; @@ -67513,7 +75793,7 @@ index 78ac6ec..e87db0e 100644 pr_debug("\t0x%lx %s\n", (long)shdr->sh_addr, info->secstrings + shdr->sh_name); } -@@ -2758,12 +2858,12 @@ static void flush_module_icache(const struct module *mod) +@@ -2912,12 +3017,12 @@ static void flush_module_icache(const struct module *mod) * Do it before processing of module parameters, so the module * can provide parameter accessor functions of its own. */ @@ -67532,7 +75812,7 @@ index 78ac6ec..e87db0e 100644 set_fs(old_fs); } -@@ -2833,8 +2933,10 @@ out: +@@ -2987,8 +3092,10 @@ out: static void module_deallocate(struct module *mod, struct load_info *info) { percpu_modfree(mod); @@ -67545,7 +75825,60 @@ index 78ac6ec..e87db0e 100644 } int __weak module_finalize(const Elf_Ehdr *hdr, -@@ -2898,9 +3000,38 @@ static struct module *load_module(void __user *umod, +@@ -3001,7 +3108,9 @@ int __weak module_finalize(const Elf_Ehdr *hdr, + static int post_relocation(struct module *mod, const struct load_info *info) + { + /* Sort exception table now relocations are done. */ ++ pax_open_kernel(); + sort_extable(mod->extable, mod->extable + mod->num_exentries); ++ pax_close_kernel(); + + /* Copy relocated percpu area over. */ + percpu_modcopy(mod, (void *)info->sechdrs[info->index.pcpu].sh_addr, +@@ -3055,16 +3164,16 @@ static int do_init_module(struct module *mod) + MODULE_STATE_COMING, mod); + + /* Set RO and NX regions for core */ +- set_section_ro_nx(mod->module_core, +- mod->core_text_size, +- mod->core_ro_size, +- mod->core_size); ++ set_section_ro_nx(mod->module_core_rx, ++ mod->core_size_rx, ++ mod->core_size_rx, ++ mod->core_size_rx); + + /* Set RO and NX regions for init */ +- set_section_ro_nx(mod->module_init, +- mod->init_text_size, +- mod->init_ro_size, +- mod->init_size); ++ set_section_ro_nx(mod->module_init_rx, ++ mod->init_size_rx, ++ mod->init_size_rx, ++ mod->init_size_rx); + + do_mod_ctors(mod); + /* Start the module */ +@@ -3126,11 +3235,12 @@ static int do_init_module(struct module *mod) + mod->strtab = mod->core_strtab; + #endif + unset_module_init_ro_nx(mod); +- module_free(mod, mod->module_init); +- mod->module_init = NULL; +- mod->init_size = 0; +- mod->init_ro_size = 0; +- mod->init_text_size = 0; ++ module_free(mod, mod->module_init_rw); ++ module_free_exec(mod, mod->module_init_rx); ++ mod->module_init_rw = NULL; ++ mod->module_init_rx = NULL; ++ mod->init_size_rw = 0; ++ mod->init_size_rx = 0; + mutex_unlock(&module_mutex); + wake_up_all(&module_wq); + +@@ -3257,9 +3367,38 @@ static int load_module(struct load_info *info, const char __user *uargs, if (err) goto free_unload; @@ -67557,7 +75890,7 @@ index 78ac6ec..e87db0e 100644 + } + /* Set up MODINFO_ATTR fields */ - setup_modinfo(mod, &info); + setup_modinfo(mod, info); +#ifdef CONFIG_GRKERNSEC_MODHARDEN + { @@ -67568,7 +75901,7 @@ index 78ac6ec..e87db0e 100644 + err = -EPERM; + goto free_modinfo; + } else if ((p = strstr(mod->args, "grsec_modharden_normal"))) { -+ p += strlen("grsec_modharden_normal"); ++ p += sizeof("grsec_modharden_normal") - 1; + p2 = strstr(p, "_"); + if (p2) { + *p2 = '\0'; @@ -67582,9 +75915,9 @@ index 78ac6ec..e87db0e 100644 +#endif + /* Fix up syms, so that st_value is a pointer to location. */ - err = simplify_symbols(mod, &info); + err = simplify_symbols(mod, info); if (err < 0) -@@ -2916,13 +3047,6 @@ static struct module *load_module(void __user *umod, +@@ -3275,13 +3414,6 @@ static int load_module(struct load_info *info, const char __user *uargs, flush_module_icache(mod); @@ -67595,12 +75928,12 @@ index 78ac6ec..e87db0e 100644 - goto free_arch_cleanup; - } - - /* Mark state as coming so strong_try_module_get() ignores us. */ - mod->state = MODULE_STATE_COMING; + dynamic_debug_setup(info->debug, info->num_debug); -@@ -2980,11 +3104,10 @@ static struct module *load_module(void __user *umod, - unlock: - mutex_unlock(&module_mutex); + /* Finally it's fully formed, ready to start executing. */ +@@ -3316,11 +3448,10 @@ static int load_module(struct load_info *info, const char __user *uargs, + ddebug_cleanup: + dynamic_debug_remove(info->debug); synchronize_sched(); - kfree(mod->args); - free_arch_cleanup: @@ -67610,51 +75943,8 @@ index 78ac6ec..e87db0e 100644 + kfree(mod->args); free_unload: module_unload_free(mod); - free_module: -@@ -3025,16 +3148,16 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, - MODULE_STATE_COMING, mod); - - /* Set RO and NX regions for core */ -- set_section_ro_nx(mod->module_core, -- mod->core_text_size, -- mod->core_ro_size, -- mod->core_size); -+ set_section_ro_nx(mod->module_core_rx, -+ mod->core_size_rx, -+ mod->core_size_rx, -+ mod->core_size_rx); - - /* Set RO and NX regions for init */ -- set_section_ro_nx(mod->module_init, -- mod->init_text_size, -- mod->init_ro_size, -- mod->init_size); -+ set_section_ro_nx(mod->module_init_rx, -+ mod->init_size_rx, -+ mod->init_size_rx, -+ mod->init_size_rx); - - do_mod_ctors(mod); - /* Start the module */ -@@ -3080,11 +3203,12 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, - mod->strtab = mod->core_strtab; - #endif - unset_module_init_ro_nx(mod); -- module_free(mod, mod->module_init); -- mod->module_init = NULL; -- mod->init_size = 0; -- mod->init_ro_size = 0; -- mod->init_text_size = 0; -+ module_free(mod, mod->module_init_rw); -+ module_free_exec(mod, mod->module_init_rx); -+ mod->module_init_rw = NULL; -+ mod->module_init_rx = NULL; -+ mod->init_size_rw = 0; -+ mod->init_size_rx = 0; - mutex_unlock(&module_mutex); - - return 0; -@@ -3115,10 +3239,16 @@ static const char *get_ksymbol(struct module *mod, + unlink_mod: +@@ -3403,10 +3534,16 @@ static const char *get_ksymbol(struct module *mod, unsigned long nextval; /* At worse, next value is at end of module */ @@ -67674,8 +75964,8 @@ index 78ac6ec..e87db0e 100644 /* Scan for closest preceding symbol, and next symbol. (ELF starts real symbols at 1). */ -@@ -3353,7 +3483,7 @@ static int m_show(struct seq_file *m, void *p) - char buf[8]; +@@ -3659,7 +3796,7 @@ static int m_show(struct seq_file *m, void *p) + return 0; seq_printf(m, "%s %u", - mod->name, mod->init_size + mod->core_size); @@ -67683,7 +75973,7 @@ index 78ac6ec..e87db0e 100644 print_unload_info(m, mod); /* Informative for users. */ -@@ -3362,7 +3492,7 @@ static int m_show(struct seq_file *m, void *p) +@@ -3668,7 +3805,7 @@ static int m_show(struct seq_file *m, void *p) mod->state == MODULE_STATE_COMING ? "Loading": "Live"); /* Used by oprofile and other similar tools. */ @@ -67692,7 +75982,7 @@ index 78ac6ec..e87db0e 100644 /* Taints info */ if (mod->taints) -@@ -3398,7 +3528,17 @@ static const struct file_operations proc_modules_operations = { +@@ -3704,7 +3841,17 @@ static const struct file_operations proc_modules_operations = { static int __init proc_modules_init(void) { @@ -67710,7 +76000,7 @@ index 78ac6ec..e87db0e 100644 return 0; } module_init(proc_modules_init); -@@ -3457,12 +3597,12 @@ struct module *__module_address(unsigned long addr) +@@ -3765,14 +3912,14 @@ struct module *__module_address(unsigned long addr) { struct module *mod; @@ -67719,14 +76009,16 @@ index 78ac6ec..e87db0e 100644 + (addr < module_addr_min_rw || addr > module_addr_max_rw)) return NULL; - list_for_each_entry_rcu(mod, &modules, list) + list_for_each_entry_rcu(mod, &modules, list) { + if (mod->state == MODULE_STATE_UNFORMED) + continue; - if (within_module_core(addr, mod) - || within_module_init(addr, mod)) + if (within_module_init(addr, mod) || within_module_core(addr, mod)) return mod; + } return NULL; - } -@@ -3496,11 +3636,20 @@ bool is_module_text_address(unsigned long addr) +@@ -3807,11 +3954,20 @@ bool is_module_text_address(unsigned long addr) */ struct module *__module_text_address(unsigned long addr) { @@ -67799,10 +76091,10 @@ index 0799fd3..d06ae3b 100644 extern void debug_mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key); diff --git a/kernel/mutex.c b/kernel/mutex.c -index a307cc9..27fd2e9 100644 +index 52f2301..73f7528 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c -@@ -198,7 +198,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, +@@ -199,7 +199,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, spin_lock_mutex(&lock->wait_lock, flags); debug_mutex_lock_common(lock, &waiter); @@ -67811,7 +76103,7 @@ index a307cc9..27fd2e9 100644 /* add waiting tasks to the end of the waitqueue (FIFO): */ list_add_tail(&waiter.list, &lock->wait_list); -@@ -227,8 +227,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, +@@ -228,8 +228,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, * TASK_UNINTERRUPTIBLE case.) */ if (unlikely(signal_pending_state(state, task))) { @@ -67821,7 +76113,7 @@ index a307cc9..27fd2e9 100644 mutex_release(&lock->dep_map, 1, ip); spin_unlock_mutex(&lock->wait_lock, flags); -@@ -247,7 +246,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, +@@ -248,7 +247,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, done: lock_acquired(&lock->dep_map, ip); /* got the lock - rejoice! */ @@ -67830,26 +76122,67 @@ index a307cc9..27fd2e9 100644 mutex_set_owner(lock); /* set it to 0 if there are no waiters left: */ +diff --git a/kernel/notifier.c b/kernel/notifier.c +index 2d5cc4c..d9ea600 100644 +--- a/kernel/notifier.c ++++ b/kernel/notifier.c +@@ -5,6 +5,7 @@ + #include <linux/rcupdate.h> + #include <linux/vmalloc.h> + #include <linux/reboot.h> ++#include <linux/mm.h> + + /* + * Notifier list for kernel code which wants to be called +@@ -24,10 +25,12 @@ static int notifier_chain_register(struct notifier_block **nl, + while ((*nl) != NULL) { + if (n->priority > (*nl)->priority) + break; +- nl = &((*nl)->next); ++ nl = (struct notifier_block **)&((*nl)->next); + } +- n->next = *nl; ++ pax_open_kernel(); ++ *(const void **)&n->next = *nl; + rcu_assign_pointer(*nl, n); ++ pax_close_kernel(); + return 0; + } + +@@ -39,10 +42,12 @@ static int notifier_chain_cond_register(struct notifier_block **nl, + return 0; + if (n->priority > (*nl)->priority) + break; +- nl = &((*nl)->next); ++ nl = (struct notifier_block **)&((*nl)->next); + } +- n->next = *nl; ++ pax_open_kernel(); ++ *(const void **)&n->next = *nl; + rcu_assign_pointer(*nl, n); ++ pax_close_kernel(); + return 0; + } + +@@ -51,10 +56,12 @@ static int notifier_chain_unregister(struct notifier_block **nl, + { + while ((*nl) != NULL) { + if ((*nl) == n) { ++ pax_open_kernel(); + rcu_assign_pointer(*nl, n->next); ++ pax_close_kernel(); + return 0; + } +- nl = &((*nl)->next); ++ nl = (struct notifier_block **)&((*nl)->next); + } + return -ENOENT; + } diff --git a/kernel/panic.c b/kernel/panic.c -index 9ed023b..4846159 100644 +index 7c57cc9..28f1b3f 100644 --- a/kernel/panic.c +++ b/kernel/panic.c -@@ -75,6 +75,14 @@ void panic(const char *fmt, ...) - int state = 0; - - /* -+ * Disable local interrupts. This will prevent panic_smp_self_stop -+ * from deadlocking the first cpu that invokes the panic, since -+ * there is nothing to prevent an interrupt handler (that runs -+ * after the panic_lock is acquired) from invoking panic again. -+ */ -+ local_irq_disable(); -+ -+ /* - * It's possible to come here directly from a panic-assertion and - * not have preempt disabled. Some functions called from here want - * preempt to be disabled. No point enabling it later though... -@@ -402,7 +410,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller, +@@ -403,7 +403,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller, const char *board; printk(KERN_WARNING "------------[ cut here ]------------\n"); @@ -67858,7 +76191,7 @@ index 9ed023b..4846159 100644 board = dmi_get_system_info(DMI_PRODUCT_NAME); if (board) printk(KERN_WARNING "Hardware name: %s\n", board); -@@ -457,7 +465,8 @@ EXPORT_SYMBOL(warn_slowpath_null); +@@ -459,7 +459,8 @@ EXPORT_SYMBOL(warn_slowpath_null); */ void __stack_chk_fail(void) { @@ -67869,7 +76202,7 @@ index 9ed023b..4846159 100644 } EXPORT_SYMBOL(__stack_chk_fail); diff --git a/kernel/pid.c b/kernel/pid.c -index 9f08dfa..6765c40 100644 +index 047dc62..418d74b 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -33,6 +33,7 @@ @@ -67880,7 +76213,7 @@ index 9f08dfa..6765c40 100644 #include <linux/pid_namespace.h> #include <linux/init_task.h> #include <linux/syscalls.h> -@@ -45,7 +46,7 @@ struct pid init_struct_pid = INIT_STRUCT_PID; +@@ -46,7 +47,7 @@ struct pid init_struct_pid = INIT_STRUCT_PID; int pid_max = PID_MAX_DEFAULT; @@ -67889,7 +76222,7 @@ index 9f08dfa..6765c40 100644 int pid_max_min = RESERVED_PIDS + 1; int pid_max_max = PID_MAX_LIMIT; -@@ -420,10 +421,18 @@ EXPORT_SYMBOL(pid_task); +@@ -440,10 +441,18 @@ EXPORT_SYMBOL(pid_task); */ struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns) { @@ -67909,8 +76242,8 @@ index 9f08dfa..6765c40 100644 } struct task_struct *find_task_by_vpid(pid_t vnr) -@@ -431,6 +440,14 @@ struct task_struct *find_task_by_vpid(pid_t vnr) - return find_task_by_pid_ns(vnr, current->nsproxy->pid_ns); +@@ -451,6 +460,14 @@ struct task_struct *find_task_by_vpid(pid_t vnr) + return find_task_by_pid_ns(vnr, task_active_pid_ns(current)); } +struct task_struct *find_task_by_vpid_unrestricted(pid_t vnr) @@ -67918,25 +76251,30 @@ index 9f08dfa..6765c40 100644 + rcu_lockdep_assert(rcu_read_lock_held(), + "find_task_by_pid_ns() needs rcu_read_lock()" + " protection"); -+ return pid_task(find_pid_ns(vnr, current->nsproxy->pid_ns), PIDTYPE_PID); ++ return pid_task(find_pid_ns(vnr, task_active_pid_ns(current)), PIDTYPE_PID); +} + struct pid *get_task_pid(struct task_struct *task, enum pid_type type) { struct pid *pid; +diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c +index bea15bd..789f3d0 100644 +--- a/kernel/pid_namespace.c ++++ b/kernel/pid_namespace.c +@@ -249,7 +249,7 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { + struct pid_namespace *pid_ns = task_active_pid_ns(current); +- struct ctl_table tmp = *table; ++ ctl_table_no_const tmp = *table; + + if (write && !ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN)) + return -EPERM; diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c -index 125cb67..a4d1c30 100644 +index 8fd709c..542bf4b 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c -@@ -6,6 +6,7 @@ - #include <linux/posix-timers.h> - #include <linux/errno.h> - #include <linux/math64.h> -+#include <linux/security.h> - #include <asm/uaccess.h> - #include <linux/kernel_stat.h> - #include <trace/events/timer.h> -@@ -1578,14 +1579,14 @@ struct k_clock clock_posix_cpu = { +@@ -1592,14 +1592,14 @@ struct k_clock clock_posix_cpu = { static __init int init_posix_cpu_timers(void) { @@ -67954,7 +76292,7 @@ index 125cb67..a4d1c30 100644 .clock_get = thread_cpu_clock_get, .timer_create = thread_cpu_timer_create, diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c -index 69185ae..cc2847a 100644 +index 6edbb2c..334f085 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -43,6 +43,7 @@ @@ -68037,7 +76375,7 @@ index 69185ae..cc2847a 100644 } static int common_timer_create(struct k_itimer *new_timer) -@@ -959,6 +960,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, +@@ -964,6 +965,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, if (copy_from_user(&new_tp, tp, sizeof (*tp))) return -EFAULT; @@ -68051,21 +76389,8 @@ index 69185ae..cc2847a 100644 return kc->clock_set(which_clock, &new_tp); } -diff --git a/kernel/power/poweroff.c b/kernel/power/poweroff.c -index d523593..68197a4 100644 ---- a/kernel/power/poweroff.c -+++ b/kernel/power/poweroff.c -@@ -37,7 +37,7 @@ static struct sysrq_key_op sysrq_poweroff_op = { - .enable_mask = SYSRQ_ENABLE_BOOT, - }; - --static int pm_sysrq_init(void) -+static int __init pm_sysrq_init(void) - { - register_sysrq_key('o', &sysrq_poweroff_op); - return 0; diff --git a/kernel/power/process.c b/kernel/power/process.c -index 19db29f..33b52b6 100644 +index 98088e0..aaf95c0 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -33,6 +33,7 @@ static int try_to_freeze_tasks(bool user_only) @@ -68076,7 +76401,7 @@ index 19db29f..33b52b6 100644 do_gettimeofday(&start); -@@ -43,6 +44,8 @@ static int try_to_freeze_tasks(bool user_only) +@@ -43,13 +44,20 @@ static int try_to_freeze_tasks(bool user_only) while (true) { todo = 0; @@ -68085,13 +76410,10 @@ index 19db29f..33b52b6 100644 read_lock(&tasklist_lock); do_each_thread(g, p) { if (p == current || !freeze_task(p)) -@@ -58,9 +61,13 @@ static int try_to_freeze_tasks(bool user_only) - * guaranteed that TASK_STOPPED/TRACED -> TASK_RUNNING - * transition can't race with task state testing here. - */ -- if (!task_is_stopped_or_traced(p) && -- !freezer_should_skip(p)) -+ if (!task_is_stopped_or_traced(p) && !freezer_should_skip(p)) { + continue; + +- if (!freezer_should_skip(p)) ++ if (!freezer_should_skip(p)) { todo++; + if (timedout) { + printk(KERN_ERR "Task refusing to freeze:\n"); @@ -68101,7 +76423,7 @@ index 19db29f..33b52b6 100644 } while_each_thread(g, p); read_unlock(&tasklist_lock); -@@ -69,7 +76,7 @@ static int try_to_freeze_tasks(bool user_only) +@@ -58,7 +66,7 @@ static int try_to_freeze_tasks(bool user_only) todo += wq_busy; } @@ -68111,10 +76433,37 @@ index 19db29f..33b52b6 100644 if (pm_wakeup_pending()) { diff --git a/kernel/printk.c b/kernel/printk.c -index b663c2c..1d6ba7a 100644 +index abbdd9e..f294251 100644 --- a/kernel/printk.c +++ b/kernel/printk.c -@@ -316,6 +316,11 @@ static int check_syslog_permissions(int type, bool from_file) +@@ -615,11 +615,17 @@ static unsigned int devkmsg_poll(struct file *file, poll_table *wait) + return ret; + } + ++static int check_syslog_permissions(int type, bool from_file); ++ + static int devkmsg_open(struct inode *inode, struct file *file) + { + struct devkmsg_user *user; + int err; + ++ err = check_syslog_permissions(SYSLOG_ACTION_OPEN, SYSLOG_FROM_FILE); ++ if (err) ++ return err; ++ + /* write-only does not need any file context */ + if ((file->f_flags & O_ACCMODE) == O_WRONLY) + return 0; +@@ -828,7 +834,7 @@ static int syslog_action_restricted(int type) + if (dmesg_restrict) + return 1; + /* Unless restricted, we allow "read all" and "get buffer size" for everybody */ +- return type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER; ++ return type != SYSLOG_ACTION_OPEN && type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER; + } + + static int check_syslog_permissions(int type, bool from_file) +@@ -840,6 +846,11 @@ static int check_syslog_permissions(int type, bool from_file) if (from_file && type != SYSLOG_ACTION_OPEN) return 0; @@ -68127,19 +76476,19 @@ index b663c2c..1d6ba7a 100644 if (capable(CAP_SYSLOG)) return 0; diff --git a/kernel/profile.c b/kernel/profile.c -index 76b8e77..a2930e8 100644 +index dc3384e..0de5b49 100644 --- a/kernel/profile.c +++ b/kernel/profile.c -@@ -39,7 +39,7 @@ struct profile_hit { - /* Oprofile timer tick hook */ - static int (*timer_hook)(struct pt_regs *) __read_mostly; +@@ -37,7 +37,7 @@ struct profile_hit { + #define NR_PROFILE_HIT (PAGE_SIZE/sizeof(struct profile_hit)) + #define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ) -static atomic_t *prof_buffer; +static atomic_unchecked_t *prof_buffer; static unsigned long prof_len, prof_shift; int prof_on __read_mostly; -@@ -281,7 +281,7 @@ static void profile_flip_buffers(void) +@@ -260,7 +260,7 @@ static void profile_flip_buffers(void) hits[i].pc = 0; continue; } @@ -68148,7 +76497,7 @@ index 76b8e77..a2930e8 100644 hits[i].hits = hits[i].pc = 0; } } -@@ -342,9 +342,9 @@ static void do_profile_hits(int type, void *__pc, unsigned int nr_hits) +@@ -321,9 +321,9 @@ static void do_profile_hits(int type, void *__pc, unsigned int nr_hits) * Add the current hit(s) and flush the write-queue out * to the global buffer: */ @@ -68160,7 +76509,7 @@ index 76b8e77..a2930e8 100644 hits[i].pc = hits[i].hits = 0; } out: -@@ -419,7 +419,7 @@ static void do_profile_hits(int type, void *__pc, unsigned int nr_hits) +@@ -398,7 +398,7 @@ static void do_profile_hits(int type, void *__pc, unsigned int nr_hits) { unsigned long pc; pc = ((unsigned long)__pc - (unsigned long)_stext) >> prof_shift; @@ -68169,7 +76518,7 @@ index 76b8e77..a2930e8 100644 } #endif /* !CONFIG_SMP */ -@@ -517,7 +517,7 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos) +@@ -494,7 +494,7 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos) return -EFAULT; buf++; p++; count--; read++; } @@ -68178,7 +76527,7 @@ index 76b8e77..a2930e8 100644 if (copy_to_user(buf, (void *)pnt, count)) return -EFAULT; read += count; -@@ -548,7 +548,7 @@ static ssize_t write_profile(struct file *file, const char __user *buf, +@@ -525,7 +525,7 @@ static ssize_t write_profile(struct file *file, const char __user *buf, } #endif profile_discard_flip_buffers(); @@ -68188,19 +76537,19 @@ index 76b8e77..a2930e8 100644 } diff --git a/kernel/ptrace.c b/kernel/ptrace.c -index ee8d49b..bd3d790 100644 +index acbd284..00bb0c9 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c -@@ -280,7 +280,7 @@ static int ptrace_attach(struct task_struct *task, long request, - +@@ -324,7 +324,7 @@ static int ptrace_attach(struct task_struct *task, long request, if (seize) flags |= PT_SEIZED; -- if (ns_capable(task_user_ns(task), CAP_SYS_PTRACE)) -+ if (ns_capable_nolog(task_user_ns(task), CAP_SYS_PTRACE)) + rcu_read_lock(); +- if (ns_capable(__task_cred(task)->user_ns, CAP_SYS_PTRACE)) ++ if (ns_capable_nolog(__task_cred(task)->user_ns, CAP_SYS_PTRACE)) flags |= PT_PTRACE_CAP; + rcu_read_unlock(); task->ptrace = flags; - -@@ -487,7 +487,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst +@@ -535,7 +535,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst break; return -EIO; } @@ -68209,7 +76558,7 @@ index ee8d49b..bd3d790 100644 return -EFAULT; copied += retval; src += retval; -@@ -672,7 +672,7 @@ int ptrace_request(struct task_struct *child, long request, +@@ -726,7 +726,7 @@ int ptrace_request(struct task_struct *child, long request, bool seized = child->ptrace & PT_SEIZED; int ret = -EIO; siginfo_t siginfo, *si; @@ -68218,7 +76567,7 @@ index ee8d49b..bd3d790 100644 unsigned long __user *datalp = datavp; unsigned long flags; -@@ -874,14 +874,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, +@@ -928,14 +928,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, goto out; } @@ -68241,7 +76590,7 @@ index ee8d49b..bd3d790 100644 goto out_put_task_struct; } -@@ -907,7 +914,7 @@ int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, +@@ -963,7 +970,7 @@ int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, copied = access_process_vm(tsk, addr, &tmp, sizeof(tmp), 0); if (copied != sizeof(tmp)) return -EIO; @@ -68250,7 +76599,16 @@ index ee8d49b..bd3d790 100644 } int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, -@@ -1017,14 +1024,21 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, +@@ -1057,7 +1064,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request, + } + + asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, +- compat_long_t addr, compat_long_t data) ++ compat_ulong_t addr, compat_ulong_t data) + { + struct task_struct *child; + long ret; +@@ -1073,14 +1080,21 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, goto out; } @@ -68273,8 +76631,25 @@ index ee8d49b..bd3d790 100644 goto out_put_task_struct; } +diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c +index 48ab703..07561d4 100644 +--- a/kernel/rcupdate.c ++++ b/kernel/rcupdate.c +@@ -439,10 +439,10 @@ int rcu_jiffies_till_stall_check(void) + * for CONFIG_RCU_CPU_STALL_TIMEOUT. + */ + if (till_stall_check < 3) { +- ACCESS_ONCE(rcu_cpu_stall_timeout) = 3; ++ ACCESS_ONCE_RW(rcu_cpu_stall_timeout) = 3; + till_stall_check = 3; + } else if (till_stall_check > 300) { +- ACCESS_ONCE(rcu_cpu_stall_timeout) = 300; ++ ACCESS_ONCE_RW(rcu_cpu_stall_timeout) = 300; + till_stall_check = 300; + } + return till_stall_check * HZ + RCU_STALL_DELAY_DELTA; diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c -index 37a5444..eec170a 100644 +index a0714a5..2ab5e34 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c @@ -46,7 +46,7 @@ @@ -68286,7 +76661,7 @@ index 37a5444..eec170a 100644 static void __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu), struct rcu_ctrlblk *rcp); -@@ -307,7 +307,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp) +@@ -312,7 +312,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp) rcu_is_callbacks_kthread())); } @@ -68296,10 +76671,10 @@ index 37a5444..eec170a 100644 __rcu_process_callbacks(&rcu_sched_ctrlblk); __rcu_process_callbacks(&rcu_bh_ctrlblk); diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h -index 22ecea0..3789898 100644 +index 8a23300..4255818 100644 --- a/kernel/rcutiny_plugin.h +++ b/kernel/rcutiny_plugin.h -@@ -955,7 +955,7 @@ static int rcu_kthread(void *arg) +@@ -945,7 +945,7 @@ static int rcu_kthread(void *arg) have_rcu_kthread_work = morework; local_irq_restore(flags); if (work) @@ -68309,10 +76684,10 @@ index 22ecea0..3789898 100644 } diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c -index a89b381..efdcad8 100644 +index e1f3a8c..42c94a2 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c -@@ -158,12 +158,12 @@ static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count) = +@@ -164,12 +164,12 @@ static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count) = { 0 }; static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_batch) = { 0 }; @@ -68328,10 +76703,10 @@ index a89b381..efdcad8 100644 +static atomic_unchecked_t n_rcu_torture_free; +static atomic_unchecked_t n_rcu_torture_mberror; +static atomic_unchecked_t n_rcu_torture_error; + static long n_rcu_torture_barrier_error; static long n_rcu_torture_boost_ktrerror; static long n_rcu_torture_boost_rterror; - static long n_rcu_torture_boost_failure; -@@ -253,11 +253,11 @@ rcu_torture_alloc(void) +@@ -287,11 +287,11 @@ rcu_torture_alloc(void) spin_lock_bh(&rcu_torture_lock); if (list_empty(&rcu_torture_freelist)) { @@ -68345,7 +76720,7 @@ index a89b381..efdcad8 100644 p = rcu_torture_freelist.next; list_del_init(p); spin_unlock_bh(&rcu_torture_lock); -@@ -270,7 +270,7 @@ rcu_torture_alloc(void) +@@ -304,7 +304,7 @@ rcu_torture_alloc(void) static void rcu_torture_free(struct rcu_torture *p) { @@ -68354,7 +76729,7 @@ index a89b381..efdcad8 100644 spin_lock_bh(&rcu_torture_lock); list_add_tail(&p->rtort_free, &rcu_torture_freelist); spin_unlock_bh(&rcu_torture_lock); -@@ -390,7 +390,7 @@ rcu_torture_cb(struct rcu_head *p) +@@ -424,7 +424,7 @@ rcu_torture_cb(struct rcu_head *p) i = rp->rtort_pipe_count; if (i > RCU_TORTURE_PIPE_LEN) i = RCU_TORTURE_PIPE_LEN; @@ -68363,7 +76738,7 @@ index a89b381..efdcad8 100644 if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) { rp->rtort_mbtest = 0; rcu_torture_free(rp); -@@ -437,7 +437,7 @@ static void rcu_sync_torture_deferred_free(struct rcu_torture *p) +@@ -472,7 +472,7 @@ static void rcu_sync_torture_deferred_free(struct rcu_torture *p) i = rp->rtort_pipe_count; if (i > RCU_TORTURE_PIPE_LEN) i = RCU_TORTURE_PIPE_LEN; @@ -68372,7 +76747,7 @@ index a89b381..efdcad8 100644 if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) { rp->rtort_mbtest = 0; list_del(&rp->rtort_free); -@@ -926,7 +926,7 @@ rcu_torture_writer(void *arg) +@@ -990,7 +990,7 @@ rcu_torture_writer(void *arg) i = old_rp->rtort_pipe_count; if (i > RCU_TORTURE_PIPE_LEN) i = RCU_TORTURE_PIPE_LEN; @@ -68381,58 +76756,58 @@ index a89b381..efdcad8 100644 old_rp->rtort_pipe_count++; cur_ops->deferred_free(old_rp); } -@@ -1007,7 +1007,7 @@ static void rcu_torture_timer(unsigned long unused) +@@ -1076,7 +1076,7 @@ static void rcu_torture_timer(unsigned long unused) + return; } - do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu); if (p->rtort_mbtest == 0) - atomic_inc(&n_rcu_torture_mberror); + atomic_inc_unchecked(&n_rcu_torture_mberror); spin_lock(&rand_lock); cur_ops->read_delay(&rand); n_rcu_torture_timers++; -@@ -1071,7 +1071,7 @@ rcu_torture_reader(void *arg) +@@ -1146,7 +1146,7 @@ rcu_torture_reader(void *arg) + continue; } - do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu); if (p->rtort_mbtest == 0) - atomic_inc(&n_rcu_torture_mberror); + atomic_inc_unchecked(&n_rcu_torture_mberror); cur_ops->read_delay(&rand); preempt_disable(); pipe_count = p->rtort_pipe_count; -@@ -1133,10 +1133,10 @@ rcu_torture_printk(char *page) +@@ -1209,11 +1209,11 @@ rcu_torture_printk(char *page) rcu_torture_current, rcu_torture_current_version, list_empty(&rcu_torture_freelist), - atomic_read(&n_rcu_torture_alloc), - atomic_read(&n_rcu_torture_alloc_fail), -- atomic_read(&n_rcu_torture_free), -- atomic_read(&n_rcu_torture_mberror), +- atomic_read(&n_rcu_torture_free)); + atomic_read_unchecked(&n_rcu_torture_alloc), + atomic_read_unchecked(&n_rcu_torture_alloc_fail), -+ atomic_read_unchecked(&n_rcu_torture_free), ++ atomic_read_unchecked(&n_rcu_torture_free)); + cnt += sprintf(&page[cnt], "rtmbe: %d rtbke: %ld rtbre: %ld ", +- atomic_read(&n_rcu_torture_mberror), + atomic_read_unchecked(&n_rcu_torture_mberror), n_rcu_torture_boost_ktrerror, - n_rcu_torture_boost_rterror, - n_rcu_torture_boost_failure, -@@ -1146,7 +1146,7 @@ rcu_torture_printk(char *page) - n_online_attempts, - n_offline_successes, - n_offline_attempts); + n_rcu_torture_boost_rterror); + cnt += sprintf(&page[cnt], "rtbf: %ld rtb: %ld nt: %ld ", +@@ -1232,14 +1232,14 @@ rcu_torture_printk(char *page) + n_barrier_attempts, + n_rcu_torture_barrier_error); + cnt += sprintf(&page[cnt], "\n%s%s ", torture_type, TORTURE_FLAG); - if (atomic_read(&n_rcu_torture_mberror) != 0 || + if (atomic_read_unchecked(&n_rcu_torture_mberror) != 0 || + n_rcu_torture_barrier_error != 0 || n_rcu_torture_boost_ktrerror != 0 || n_rcu_torture_boost_rterror != 0 || - n_rcu_torture_boost_failure != 0) -@@ -1154,7 +1154,7 @@ rcu_torture_printk(char *page) - cnt += sprintf(&page[cnt], "\n%s%s ", torture_type, TORTURE_FLAG); - if (i > 1) { + n_rcu_torture_boost_failure != 0 || + i > 1) { cnt += sprintf(&page[cnt], "!!! "); - atomic_inc(&n_rcu_torture_error); + atomic_inc_unchecked(&n_rcu_torture_error); WARN_ON_ONCE(1); } cnt += sprintf(&page[cnt], "Reader Pipe: "); -@@ -1168,7 +1168,7 @@ rcu_torture_printk(char *page) +@@ -1253,7 +1253,7 @@ rcu_torture_printk(char *page) cnt += sprintf(&page[cnt], "Free-Block Circulation: "); for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) { cnt += sprintf(&page[cnt], " %d", @@ -68441,16 +76816,16 @@ index a89b381..efdcad8 100644 } cnt += sprintf(&page[cnt], "\n"); if (cur_ops->stats) -@@ -1676,7 +1676,7 @@ rcu_torture_cleanup(void) +@@ -1962,7 +1962,7 @@ rcu_torture_cleanup(void) - if (cur_ops->cleanup) - cur_ops->cleanup(); -- if (atomic_read(&n_rcu_torture_error)) -+ if (atomic_read_unchecked(&n_rcu_torture_error)) + rcu_torture_stats_print(); /* -After- the stats thread is stopped! */ + +- if (atomic_read(&n_rcu_torture_error) || n_rcu_torture_barrier_error) ++ if (atomic_read_unchecked(&n_rcu_torture_error) || n_rcu_torture_barrier_error) rcu_torture_print_module_parms(cur_ops, "End of test: FAILURE"); else if (n_online_successes != n_online_attempts || n_offline_successes != n_offline_attempts) -@@ -1744,17 +1744,17 @@ rcu_torture_init(void) +@@ -2031,18 +2031,18 @@ rcu_torture_init(void) rcu_torture_current = NULL; rcu_torture_current_version = 0; @@ -68464,6 +76839,7 @@ index a89b381..efdcad8 100644 + atomic_set_unchecked(&n_rcu_torture_free, 0); + atomic_set_unchecked(&n_rcu_torture_mberror, 0); + atomic_set_unchecked(&n_rcu_torture_error, 0); + n_rcu_torture_barrier_error = 0; n_rcu_torture_boost_ktrerror = 0; n_rcu_torture_boost_rterror = 0; n_rcu_torture_boost_failure = 0; @@ -68475,10 +76851,10 @@ index a89b381..efdcad8 100644 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) { per_cpu(rcu_torture_count, cpu)[i] = 0; diff --git a/kernel/rcutree.c b/kernel/rcutree.c -index d0c5baf..109b2e7 100644 +index 5b8ad82..17274d1 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c -@@ -357,9 +357,9 @@ static void rcu_idle_enter_common(struct rcu_dynticks *rdtp, long long oldval) +@@ -353,9 +353,9 @@ static void rcu_eqs_enter_common(struct rcu_dynticks *rdtp, long long oldval, rcu_prepare_for_idle(smp_processor_id()); /* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */ smp_mb__before_atomic_inc(); /* See above. */ @@ -68489,9 +76865,9 @@ index d0c5baf..109b2e7 100644 + WARN_ON_ONCE(atomic_read_unchecked(&rdtp->dynticks) & 0x1); /* - * The idle task is not permitted to enter the idle loop while -@@ -448,10 +448,10 @@ void rcu_irq_exit(void) - static void rcu_idle_exit_common(struct rcu_dynticks *rdtp, long long oldval) + * It is illegal to enter an extended quiescent state while +@@ -491,10 +491,10 @@ static void rcu_eqs_exit_common(struct rcu_dynticks *rdtp, long long oldval, + int user) { smp_mb__before_atomic_inc(); /* Force ordering w/previous sojourn. */ - atomic_inc(&rdtp->dynticks); @@ -68502,8 +76878,8 @@ index d0c5baf..109b2e7 100644 + WARN_ON_ONCE(!(atomic_read_unchecked(&rdtp->dynticks) & 0x1)); rcu_cleanup_after_idle(smp_processor_id()); trace_rcu_dyntick("End", oldval, rdtp->dynticks_nesting); - if (!is_idle_task(current)) { -@@ -545,14 +545,14 @@ void rcu_nmi_enter(void) + if (!user && !is_idle_task(current)) { +@@ -633,14 +633,14 @@ void rcu_nmi_enter(void) struct rcu_dynticks *rdtp = &__get_cpu_var(rcu_dynticks); if (rdtp->dynticks_nmi_nesting == 0 && @@ -68521,7 +76897,7 @@ index d0c5baf..109b2e7 100644 } /** -@@ -571,9 +571,9 @@ void rcu_nmi_exit(void) +@@ -659,9 +659,9 @@ void rcu_nmi_exit(void) return; /* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */ smp_mb__before_atomic_inc(); /* See above. */ @@ -68532,8 +76908,8 @@ index d0c5baf..109b2e7 100644 + WARN_ON_ONCE(atomic_read_unchecked(&rdtp->dynticks) & 0x1); } - #ifdef CONFIG_PROVE_RCU -@@ -589,7 +589,7 @@ int rcu_is_cpu_idle(void) + /** +@@ -675,7 +675,7 @@ int rcu_is_cpu_idle(void) int ret; preempt_disable(); @@ -68542,7 +76918,7 @@ index d0c5baf..109b2e7 100644 preempt_enable(); return ret; } -@@ -659,7 +659,7 @@ int rcu_is_cpu_rrupt_from_idle(void) +@@ -743,7 +743,7 @@ static int rcu_is_cpu_rrupt_from_idle(void) */ static int dyntick_save_progress_counter(struct rcu_data *rdp) { @@ -68551,7 +76927,7 @@ index d0c5baf..109b2e7 100644 return (rdp->dynticks_snap & 0x1) == 0; } -@@ -674,7 +674,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) +@@ -758,7 +758,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) unsigned int curr; unsigned int snap; @@ -68560,93 +76936,167 @@ index d0c5baf..109b2e7 100644 snap = (unsigned int)rdp->dynticks_snap; /* -@@ -704,10 +704,10 @@ static int jiffies_till_stall_check(void) - * for CONFIG_RCU_CPU_STALL_TIMEOUT. - */ - if (till_stall_check < 3) { -- ACCESS_ONCE(rcu_cpu_stall_timeout) = 3; -+ ACCESS_ONCE_RW(rcu_cpu_stall_timeout) = 3; - till_stall_check = 3; - } else if (till_stall_check > 300) { -- ACCESS_ONCE(rcu_cpu_stall_timeout) = 300; -+ ACCESS_ONCE_RW(rcu_cpu_stall_timeout) = 300; - till_stall_check = 300; +@@ -1698,7 +1698,7 @@ rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp, + rsp->qlen += rdp->qlen; + rdp->n_cbs_orphaned += rdp->qlen; + rdp->qlen_lazy = 0; +- ACCESS_ONCE(rdp->qlen) = 0; ++ ACCESS_ONCE_RW(rdp->qlen) = 0; } - return till_stall_check * HZ + RCU_STALL_DELAY_DELTA; -@@ -1766,7 +1766,7 @@ __rcu_process_callbacks(struct rcu_state *rsp, struct rcu_data *rdp) + + /* +@@ -1944,7 +1944,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp) + } + smp_mb(); /* List handling before counting for rcu_barrier(). */ + rdp->qlen_lazy -= count_lazy; +- ACCESS_ONCE(rdp->qlen) -= count; ++ ACCESS_ONCE_RW(rdp->qlen) -= count; + rdp->n_cbs_invoked += count; + + /* Reinstate batch limit if we have worked down the excess. */ +@@ -2137,7 +2137,7 @@ __rcu_process_callbacks(struct rcu_state *rsp) /* * Do RCU core processing for the current CPU. */ -static void rcu_process_callbacks(struct softirq_action *unused) +static void rcu_process_callbacks(void) { - trace_rcu_utilization("Start RCU core"); - __rcu_process_callbacks(&rcu_sched_state, -@@ -1949,8 +1949,8 @@ void synchronize_rcu_bh(void) - } - EXPORT_SYMBOL_GPL(synchronize_rcu_bh); - --static atomic_t sync_sched_expedited_started = ATOMIC_INIT(0); --static atomic_t sync_sched_expedited_done = ATOMIC_INIT(0); -+static atomic_unchecked_t sync_sched_expedited_started = ATOMIC_INIT(0); -+static atomic_unchecked_t sync_sched_expedited_done = ATOMIC_INIT(0); + struct rcu_state *rsp; - static int synchronize_sched_expedited_cpu_stop(void *data) - { -@@ -2011,7 +2011,7 @@ void synchronize_sched_expedited(void) - int firstsnap, s, snap, trycount = 0; +@@ -2260,7 +2260,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu), + local_irq_restore(flags); + return; + } +- ACCESS_ONCE(rdp->qlen)++; ++ ACCESS_ONCE_RW(rdp->qlen)++; + if (lazy) + rdp->qlen_lazy++; + else +@@ -2469,11 +2469,11 @@ void synchronize_sched_expedited(void) + * counter wrap on a 32-bit system. Quite a few more CPUs would of + * course be required on a 64-bit system. + */ +- if (ULONG_CMP_GE((ulong)atomic_long_read(&rsp->expedited_start), ++ if (ULONG_CMP_GE((ulong)atomic_long_read_unchecked(&rsp->expedited_start), + (ulong)atomic_long_read(&rsp->expedited_done) + + ULONG_MAX / 8)) { + synchronize_sched(); +- atomic_long_inc(&rsp->expedited_wrap); ++ atomic_long_inc_unchecked(&rsp->expedited_wrap); + return; + } - /* Note that atomic_inc_return() implies full memory barrier. */ -- firstsnap = snap = atomic_inc_return(&sync_sched_expedited_started); -+ firstsnap = snap = atomic_inc_return_unchecked(&sync_sched_expedited_started); +@@ -2481,7 +2481,7 @@ void synchronize_sched_expedited(void) + * Take a ticket. Note that atomic_inc_return() implies a + * full memory barrier. + */ +- snap = atomic_long_inc_return(&rsp->expedited_start); ++ snap = atomic_long_inc_return_unchecked(&rsp->expedited_start); + firstsnap = snap; get_online_cpus(); WARN_ON_ONCE(cpu_is_offline(raw_smp_processor_id())); +@@ -2494,14 +2494,14 @@ void synchronize_sched_expedited(void) + synchronize_sched_expedited_cpu_stop, + NULL) == -EAGAIN) { + put_online_cpus(); +- atomic_long_inc(&rsp->expedited_tryfail); ++ atomic_long_inc_unchecked(&rsp->expedited_tryfail); -@@ -2033,7 +2033,7 @@ void synchronize_sched_expedited(void) + /* Check to see if someone else did our work for us. */ + s = atomic_long_read(&rsp->expedited_done); + if (ULONG_CMP_GE((ulong)s, (ulong)firstsnap)) { + /* ensure test happens before caller kfree */ + smp_mb__before_atomic_inc(); /* ^^^ */ +- atomic_long_inc(&rsp->expedited_workdone1); ++ atomic_long_inc_unchecked(&rsp->expedited_workdone1); + return; } - /* Check to see if someone else did our work for us. */ -- s = atomic_read(&sync_sched_expedited_done); -+ s = atomic_read_unchecked(&sync_sched_expedited_done); - if (UINT_CMP_GE((unsigned)s, (unsigned)firstsnap)) { - smp_mb(); /* ensure test happens before caller kfree */ +@@ -2510,7 +2510,7 @@ void synchronize_sched_expedited(void) + udelay(trycount * num_online_cpus()); + } else { + wait_rcu_gp(call_rcu_sched); +- atomic_long_inc(&rsp->expedited_normal); ++ atomic_long_inc_unchecked(&rsp->expedited_normal); return; -@@ -2048,7 +2048,7 @@ void synchronize_sched_expedited(void) - * grace period works for us. + } + +@@ -2519,7 +2519,7 @@ void synchronize_sched_expedited(void) + if (ULONG_CMP_GE((ulong)s, (ulong)firstsnap)) { + /* ensure test happens before caller kfree */ + smp_mb__before_atomic_inc(); /* ^^^ */ +- atomic_long_inc(&rsp->expedited_workdone2); ++ atomic_long_inc_unchecked(&rsp->expedited_workdone2); + return; + } + +@@ -2531,10 +2531,10 @@ void synchronize_sched_expedited(void) + * period works for us. */ get_online_cpus(); -- snap = atomic_read(&sync_sched_expedited_started); -+ snap = atomic_read_unchecked(&sync_sched_expedited_started); +- snap = atomic_long_read(&rsp->expedited_start); ++ snap = atomic_long_read_unchecked(&rsp->expedited_start); smp_mb(); /* ensure read is before try_stop_cpus(). */ } +- atomic_long_inc(&rsp->expedited_stoppedcpus); ++ atomic_long_inc_unchecked(&rsp->expedited_stoppedcpus); -@@ -2059,12 +2059,12 @@ void synchronize_sched_expedited(void) - * than we did beat us to the punch. + /* + * Everyone up to our most recent fetch is covered by our grace +@@ -2543,16 +2543,16 @@ void synchronize_sched_expedited(void) + * than we did already did their update. */ do { -- s = atomic_read(&sync_sched_expedited_done); -+ s = atomic_read_unchecked(&sync_sched_expedited_done); - if (UINT_CMP_GE((unsigned)s, (unsigned)snap)) { - smp_mb(); /* ensure test happens before caller kfree */ +- atomic_long_inc(&rsp->expedited_done_tries); ++ atomic_long_inc_unchecked(&rsp->expedited_done_tries); + s = atomic_long_read(&rsp->expedited_done); + if (ULONG_CMP_GE((ulong)s, (ulong)snap)) { + /* ensure test happens before caller kfree */ + smp_mb__before_atomic_inc(); /* ^^^ */ +- atomic_long_inc(&rsp->expedited_done_lost); ++ atomic_long_inc_unchecked(&rsp->expedited_done_lost); break; } -- } while (atomic_cmpxchg(&sync_sched_expedited_done, s, snap) != s); -+ } while (atomic_cmpxchg_unchecked(&sync_sched_expedited_done, s, snap) != s); + } while (atomic_long_cmpxchg(&rsp->expedited_done, s, snap) != s); +- atomic_long_inc(&rsp->expedited_done_exit); ++ atomic_long_inc_unchecked(&rsp->expedited_done_exit); put_online_cpus(); } -@@ -2262,7 +2262,7 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) - rdp->qlen = 0; +@@ -2726,7 +2726,7 @@ static void _rcu_barrier(struct rcu_state *rsp) + * ACCESS_ONCE() to prevent the compiler from speculating + * the increment to precede the early-exit check. + */ +- ACCESS_ONCE(rsp->n_barrier_done)++; ++ ACCESS_ONCE_RW(rsp->n_barrier_done)++; + WARN_ON_ONCE((rsp->n_barrier_done & 0x1) != 1); + _rcu_barrier_trace(rsp, "Inc1", -1, rsp->n_barrier_done); + smp_mb(); /* Order ->n_barrier_done increment with below mechanism. */ +@@ -2776,7 +2776,7 @@ static void _rcu_barrier(struct rcu_state *rsp) + + /* Increment ->n_barrier_done to prevent duplicate work. */ + smp_mb(); /* Keep increment after above mechanism. */ +- ACCESS_ONCE(rsp->n_barrier_done)++; ++ ACCESS_ONCE_RW(rsp->n_barrier_done)++; + WARN_ON_ONCE((rsp->n_barrier_done & 0x1) != 0); + _rcu_barrier_trace(rsp, "Inc2", -1, rsp->n_barrier_done); + smp_mb(); /* Keep increment before caller's subsequent code. */ +@@ -2821,10 +2821,10 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) + rdp->grpmask = 1UL << (cpu - rdp->mynode->grplo); + init_callback_list(rdp); + rdp->qlen_lazy = 0; +- ACCESS_ONCE(rdp->qlen) = 0; ++ ACCESS_ONCE_RW(rdp->qlen) = 0; rdp->dynticks = &per_cpu(rcu_dynticks, cpu); WARN_ON_ONCE(rdp->dynticks->dynticks_nesting != DYNTICK_TASK_EXIT_IDLE); - WARN_ON_ONCE(atomic_read(&rdp->dynticks->dynticks) != 1); + WARN_ON_ONCE(atomic_read_unchecked(&rdp->dynticks->dynticks) != 1); rdp->cpu = cpu; rdp->rsp = rsp; - raw_spin_unlock_irqrestore(&rnp->lock, flags); -@@ -2290,8 +2290,8 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptible) - rdp->n_force_qs_snap = rsp->n_force_qs; + rcu_boot_init_nocb_percpu_data(rdp); +@@ -2857,8 +2857,8 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptible) rdp->blimit = blimit; + init_callback_list(rdp); /* Re-enable callbacks on this CPU. */ rdp->dynticks->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE; - atomic_set(&rdp->dynticks->dynticks, - (atomic_read(&rdp->dynticks->dynticks) & ~0x1) + 1); @@ -68656,23 +77106,52 @@ index d0c5baf..109b2e7 100644 raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ diff --git a/kernel/rcutree.h b/kernel/rcutree.h -index cdd1be0..5b2efb4 100644 +index c896b50..c357252 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h -@@ -87,7 +87,7 @@ struct rcu_dynticks { +@@ -86,7 +86,7 @@ struct rcu_dynticks { long long dynticks_nesting; /* Track irq/process nesting level. */ /* Process level is worth LLONG_MAX/2. */ int dynticks_nmi_nesting; /* Track NMI nesting level. */ - atomic_t dynticks; /* Even value for idle, else odd. */ + atomic_unchecked_t dynticks;/* Even value for idle, else odd. */ - }; - - /* RCU's kthread states for tracing. */ + #ifdef CONFIG_RCU_FAST_NO_HZ + int dyntick_drain; /* Prepare-for-idle state variable. */ + unsigned long dyntick_holdoff; +@@ -416,17 +416,17 @@ struct rcu_state { + /* _rcu_barrier(). */ + /* End of fields guarded by barrier_mutex. */ + +- atomic_long_t expedited_start; /* Starting ticket. */ +- atomic_long_t expedited_done; /* Done ticket. */ +- atomic_long_t expedited_wrap; /* # near-wrap incidents. */ +- atomic_long_t expedited_tryfail; /* # acquisition failures. */ +- atomic_long_t expedited_workdone1; /* # done by others #1. */ +- atomic_long_t expedited_workdone2; /* # done by others #2. */ +- atomic_long_t expedited_normal; /* # fallbacks to normal. */ +- atomic_long_t expedited_stoppedcpus; /* # successful stop_cpus. */ +- atomic_long_t expedited_done_tries; /* # tries to update _done. */ +- atomic_long_t expedited_done_lost; /* # times beaten to _done. */ +- atomic_long_t expedited_done_exit; /* # times exited _done loop. */ ++ atomic_long_unchecked_t expedited_start; /* Starting ticket. */ ++ atomic_long_t expedited_done; /* Done ticket. */ ++ atomic_long_unchecked_t expedited_wrap; /* # near-wrap incidents. */ ++ atomic_long_unchecked_t expedited_tryfail; /* # acquisition failures. */ ++ atomic_long_unchecked_t expedited_workdone1; /* # done by others #1. */ ++ atomic_long_unchecked_t expedited_workdone2; /* # done by others #2. */ ++ atomic_long_unchecked_t expedited_normal; /* # fallbacks to normal. */ ++ atomic_long_unchecked_t expedited_stoppedcpus; /* # successful stop_cpus. */ ++ atomic_long_unchecked_t expedited_done_tries; /* # tries to update _done. */ ++ atomic_long_unchecked_t expedited_done_lost; /* # times beaten to _done. */ ++ atomic_long_unchecked_t expedited_done_exit; /* # times exited _done loop. */ + + unsigned long jiffies_force_qs; /* Time at which to invoke */ + /* force_quiescent_state(). */ diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h -index c023464..7f57225 100644 +index c1cc7e1..f62e436 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h -@@ -909,7 +909,7 @@ void synchronize_rcu_expedited(void) +@@ -892,7 +892,7 @@ void synchronize_rcu_expedited(void) /* Clean up and exit. */ smp_mb(); /* ensure expedited GP seen before counter increment. */ @@ -68681,33 +77160,115 @@ index c023464..7f57225 100644 unlock_mb_ret: mutex_unlock(&sync_rcu_preempt_exp_mutex); mb_ret: +@@ -1440,7 +1440,7 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu) + free_cpumask_var(cm); + } + +-static struct smp_hotplug_thread rcu_cpu_thread_spec = { ++static struct smp_hotplug_thread rcu_cpu_thread_spec __read_only = { + .store = &rcu_cpu_kthread_task, + .thread_should_run = rcu_cpu_kthread_should_run, + .thread_fn = rcu_cpu_kthread, +@@ -2072,7 +2072,7 @@ static void print_cpu_stall_info(struct rcu_state *rsp, int cpu) + print_cpu_stall_fast_no_hz(fast_no_hz, cpu); + printk(KERN_ERR "\t%d: (%lu %s) idle=%03x/%llx/%d %s\n", + cpu, ticks_value, ticks_title, +- atomic_read(&rdtp->dynticks) & 0xfff, ++ atomic_read_unchecked(&rdtp->dynticks) & 0xfff, + rdtp->dynticks_nesting, rdtp->dynticks_nmi_nesting, + fast_no_hz); + } +@@ -2192,7 +2192,7 @@ static void __call_rcu_nocb_enqueue(struct rcu_data *rdp, + + /* Enqueue the callback on the nocb list and update counts. */ + old_rhpp = xchg(&rdp->nocb_tail, rhtp); +- ACCESS_ONCE(*old_rhpp) = rhp; ++ ACCESS_ONCE_RW(*old_rhpp) = rhp; + atomic_long_add(rhcount, &rdp->nocb_q_count); + atomic_long_add(rhcount_lazy, &rdp->nocb_q_count_lazy); + +@@ -2384,12 +2384,12 @@ static int rcu_nocb_kthread(void *arg) + * Extract queued callbacks, update counts, and wait + * for a grace period to elapse. + */ +- ACCESS_ONCE(rdp->nocb_head) = NULL; ++ ACCESS_ONCE_RW(rdp->nocb_head) = NULL; + tail = xchg(&rdp->nocb_tail, &rdp->nocb_head); + c = atomic_long_xchg(&rdp->nocb_q_count, 0); + cl = atomic_long_xchg(&rdp->nocb_q_count_lazy, 0); +- ACCESS_ONCE(rdp->nocb_p_count) += c; +- ACCESS_ONCE(rdp->nocb_p_count_lazy) += cl; ++ ACCESS_ONCE_RW(rdp->nocb_p_count) += c; ++ ACCESS_ONCE_RW(rdp->nocb_p_count_lazy) += cl; + wait_rcu_gp(rdp->rsp->call_remote); + + /* Each pass through the following loop invokes a callback. */ +@@ -2411,8 +2411,8 @@ static int rcu_nocb_kthread(void *arg) + list = next; + } + trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1); +- ACCESS_ONCE(rdp->nocb_p_count) -= c; +- ACCESS_ONCE(rdp->nocb_p_count_lazy) -= cl; ++ ACCESS_ONCE_RW(rdp->nocb_p_count) -= c; ++ ACCESS_ONCE_RW(rdp->nocb_p_count_lazy) -= cl; + rdp->n_nocbs_invoked += c; + } + return 0; +@@ -2438,7 +2438,7 @@ static void __init rcu_spawn_nocb_kthreads(struct rcu_state *rsp) + rdp = per_cpu_ptr(rsp->rda, cpu); + t = kthread_run(rcu_nocb_kthread, rdp, "rcuo%d", cpu); + BUG_ON(IS_ERR(t)); +- ACCESS_ONCE(rdp->nocb_kthread) = t; ++ ACCESS_ONCE_RW(rdp->nocb_kthread) = t; + } + } + diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c -index ed459ed..a03c3fa 100644 +index 93f8e8f..cf812ae 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c -@@ -68,7 +68,7 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp) - rdp->passed_quiesce, rdp->passed_quiesce_gpnum, - rdp->qs_pending); +@@ -123,7 +123,7 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp) + ulong2long(rdp->completed), ulong2long(rdp->gpnum), + rdp->passed_quiesce, rdp->qs_pending); seq_printf(m, " dt=%d/%llx/%d df=%lu", - atomic_read(&rdp->dynticks->dynticks), + atomic_read_unchecked(&rdp->dynticks->dynticks), rdp->dynticks->dynticks_nesting, rdp->dynticks->dynticks_nmi_nesting, rdp->dynticks_fqs); -@@ -140,7 +140,7 @@ static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp) - rdp->passed_quiesce, rdp->passed_quiesce_gpnum, - rdp->qs_pending); - seq_printf(m, ",%d,%llx,%d,%lu", -- atomic_read(&rdp->dynticks->dynticks), -+ atomic_read_unchecked(&rdp->dynticks->dynticks), - rdp->dynticks->dynticks_nesting, - rdp->dynticks->dynticks_nmi_nesting, - rdp->dynticks_fqs); +@@ -184,17 +184,17 @@ static int show_rcuexp(struct seq_file *m, void *v) + struct rcu_state *rsp = (struct rcu_state *)m->private; + + seq_printf(m, "s=%lu d=%lu w=%lu tf=%lu wd1=%lu wd2=%lu n=%lu sc=%lu dt=%lu dl=%lu dx=%lu\n", +- atomic_long_read(&rsp->expedited_start), ++ atomic_long_read_unchecked(&rsp->expedited_start), + atomic_long_read(&rsp->expedited_done), +- atomic_long_read(&rsp->expedited_wrap), +- atomic_long_read(&rsp->expedited_tryfail), +- atomic_long_read(&rsp->expedited_workdone1), +- atomic_long_read(&rsp->expedited_workdone2), +- atomic_long_read(&rsp->expedited_normal), +- atomic_long_read(&rsp->expedited_stoppedcpus), +- atomic_long_read(&rsp->expedited_done_tries), +- atomic_long_read(&rsp->expedited_done_lost), +- atomic_long_read(&rsp->expedited_done_exit)); ++ atomic_long_read_unchecked(&rsp->expedited_wrap), ++ atomic_long_read_unchecked(&rsp->expedited_tryfail), ++ atomic_long_read_unchecked(&rsp->expedited_workdone1), ++ atomic_long_read_unchecked(&rsp->expedited_workdone2), ++ atomic_long_read_unchecked(&rsp->expedited_normal), ++ atomic_long_read_unchecked(&rsp->expedited_stoppedcpus), ++ atomic_long_read_unchecked(&rsp->expedited_done_tries), ++ atomic_long_read_unchecked(&rsp->expedited_done_lost), ++ atomic_long_read_unchecked(&rsp->expedited_done_exit)); + return 0; + } + diff --git a/kernel/resource.c b/kernel/resource.c -index 7e8ea66..1efd11f 100644 +index 73f35d4..4684fc4 100644 --- a/kernel/resource.c +++ b/kernel/resource.c -@@ -141,8 +141,18 @@ static const struct file_operations proc_iomem_operations = { +@@ -143,8 +143,18 @@ static const struct file_operations proc_iomem_operations = { static int __init ioresources_init(void) { @@ -68727,10 +77288,10 @@ index 7e8ea66..1efd11f 100644 } __initcall(ioresources_init); diff --git a/kernel/rtmutex-tester.c b/kernel/rtmutex-tester.c -index 98ec494..4241d6d 100644 +index 7890b10..8b68605f 100644 --- a/kernel/rtmutex-tester.c +++ b/kernel/rtmutex-tester.c -@@ -20,7 +20,7 @@ +@@ -21,7 +21,7 @@ #define MAX_RT_TEST_MUTEXES 8 static spinlock_t rttest_lock; @@ -68739,7 +77300,7 @@ index 98ec494..4241d6d 100644 struct test_thread_data { int opcode; -@@ -61,7 +61,7 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) +@@ -62,7 +62,7 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) case RTTEST_LOCKCONT: td->mutexes[td->opdata] = 1; @@ -68748,7 +77309,7 @@ index 98ec494..4241d6d 100644 return 0; case RTTEST_RESET: -@@ -74,7 +74,7 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) +@@ -75,7 +75,7 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) return 0; case RTTEST_RESETEVENT: @@ -68757,7 +77318,7 @@ index 98ec494..4241d6d 100644 return 0; default: -@@ -91,9 +91,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) +@@ -92,9 +92,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) return ret; td->mutexes[id] = 1; @@ -68769,7 +77330,7 @@ index 98ec494..4241d6d 100644 td->mutexes[id] = 4; return 0; -@@ -104,9 +104,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) +@@ -105,9 +105,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) return ret; td->mutexes[id] = 1; @@ -68781,7 +77342,7 @@ index 98ec494..4241d6d 100644 td->mutexes[id] = ret ? 0 : 4; return ret ? -EINTR : 0; -@@ -115,9 +115,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) +@@ -116,9 +116,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) if (id < 0 || id >= MAX_RT_TEST_MUTEXES || td->mutexes[id] != 4) return ret; @@ -68793,7 +77354,7 @@ index 98ec494..4241d6d 100644 td->mutexes[id] = 0; return 0; -@@ -164,7 +164,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex) +@@ -165,7 +165,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex) break; td->mutexes[dat] = 2; @@ -68802,7 +77363,7 @@ index 98ec494..4241d6d 100644 break; default: -@@ -184,7 +184,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex) +@@ -185,7 +185,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex) return; td->mutexes[dat] = 3; @@ -68811,7 +77372,7 @@ index 98ec494..4241d6d 100644 break; case RTTEST_LOCKNOWAIT: -@@ -196,7 +196,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex) +@@ -197,7 +197,7 @@ void schedule_rt_mutex_test(struct rt_mutex *mutex) return; td->mutexes[dat] = 1; @@ -68821,7 +77382,7 @@ index 98ec494..4241d6d 100644 default: diff --git a/kernel/sched/auto_group.c b/kernel/sched/auto_group.c -index 0984a21..939f183 100644 +index 64de5f8..7735e12 100644 --- a/kernel/sched/auto_group.c +++ b/kernel/sched/auto_group.c @@ -11,7 +11,7 @@ @@ -68833,7 +77394,7 @@ index 0984a21..939f183 100644 void __init autogroup_init(struct task_struct *init_task) { -@@ -78,7 +78,7 @@ static inline struct autogroup *autogroup_create(void) +@@ -81,7 +81,7 @@ static inline struct autogroup *autogroup_create(void) kref_init(&ag->kref); init_rwsem(&ag->lock); @@ -68843,10 +77404,37 @@ index 0984a21..939f183 100644 #ifdef CONFIG_RT_GROUP_SCHED /* diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index ef6a8f2..d9bc4df 100644 +index 67d0465..4cf9361 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -4044,6 +4044,8 @@ int can_nice(const struct task_struct *p, const int nice) +@@ -3406,7 +3406,7 @@ EXPORT_SYMBOL(wait_for_completion_interruptible); + * The return value is -ERESTARTSYS if interrupted, 0 if timed out, + * positive (at least 1, or number of jiffies left till timeout) if completed. + */ +-long __sched ++long __sched __intentional_overflow(-1) + wait_for_completion_interruptible_timeout(struct completion *x, + unsigned long timeout) + { +@@ -3423,7 +3423,7 @@ EXPORT_SYMBOL(wait_for_completion_interruptible_timeout); + * + * The return value is -ERESTARTSYS if interrupted, 0 if completed. + */ +-int __sched wait_for_completion_killable(struct completion *x) ++int __sched __intentional_overflow(-1) wait_for_completion_killable(struct completion *x) + { + long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_KILLABLE); + if (t == -ERESTARTSYS) +@@ -3444,7 +3444,7 @@ EXPORT_SYMBOL(wait_for_completion_killable); + * The return value is -ERESTARTSYS if interrupted, 0 if timed out, + * positive (at least 1, or number of jiffies left till timeout) if completed. + */ +-long __sched ++long __sched __intentional_overflow(-1) + wait_for_completion_killable_timeout(struct completion *x, + unsigned long timeout) + { +@@ -3670,6 +3670,8 @@ int can_nice(const struct task_struct *p, const int nice) /* convert nice value [19,-20] to rlimit style value [1,40] */ int nice_rlim = 20 - nice; @@ -68855,7 +77443,7 @@ index ef6a8f2..d9bc4df 100644 return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) || capable(CAP_SYS_NICE)); } -@@ -4077,7 +4079,8 @@ SYSCALL_DEFINE1(nice, int, increment) +@@ -3703,7 +3705,8 @@ SYSCALL_DEFINE1(nice, int, increment) if (nice > 19) nice = 19; @@ -68865,7 +77453,7 @@ index ef6a8f2..d9bc4df 100644 return -EPERM; retval = security_task_setnice(current, nice); -@@ -4234,6 +4237,7 @@ recheck: +@@ -3857,6 +3860,7 @@ recheck: unsigned long rlim_rtprio = task_rlimit(p, RLIMIT_RTPRIO); @@ -68873,11 +77461,143 @@ index ef6a8f2..d9bc4df 100644 /* can't set/change the rt policy */ if (policy != p->policy && !rlim_rtprio) return -EPERM; +@@ -4954,7 +4958,7 @@ static void migrate_tasks(unsigned int dead_cpu) + + #if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_SYSCTL) + +-static struct ctl_table sd_ctl_dir[] = { ++static ctl_table_no_const sd_ctl_dir[] __read_only = { + { + .procname = "sched_domain", + .mode = 0555, +@@ -4971,17 +4975,17 @@ static struct ctl_table sd_ctl_root[] = { + {} + }; + +-static struct ctl_table *sd_alloc_ctl_entry(int n) ++static ctl_table_no_const *sd_alloc_ctl_entry(int n) + { +- struct ctl_table *entry = ++ ctl_table_no_const *entry = + kcalloc(n, sizeof(struct ctl_table), GFP_KERNEL); + + return entry; + } + +-static void sd_free_ctl_entry(struct ctl_table **tablep) ++static void sd_free_ctl_entry(ctl_table_no_const *tablep) + { +- struct ctl_table *entry; ++ ctl_table_no_const *entry; + + /* + * In the intermediate directories, both the child directory and +@@ -4989,22 +4993,25 @@ static void sd_free_ctl_entry(struct ctl_table **tablep) + * will always be set. In the lowest directory the names are + * static strings and all have proc handlers. + */ +- for (entry = *tablep; entry->mode; entry++) { +- if (entry->child) +- sd_free_ctl_entry(&entry->child); ++ for (entry = tablep; entry->mode; entry++) { ++ if (entry->child) { ++ sd_free_ctl_entry(entry->child); ++ pax_open_kernel(); ++ entry->child = NULL; ++ pax_close_kernel(); ++ } + if (entry->proc_handler == NULL) + kfree(entry->procname); + } + +- kfree(*tablep); +- *tablep = NULL; ++ kfree(tablep); + } + + static int min_load_idx = 0; + static int max_load_idx = CPU_LOAD_IDX_MAX-1; + + static void +-set_table_entry(struct ctl_table *entry, ++set_table_entry(ctl_table_no_const *entry, + const char *procname, void *data, int maxlen, + umode_t mode, proc_handler *proc_handler, + bool load_idx) +@@ -5024,7 +5031,7 @@ set_table_entry(struct ctl_table *entry, + static struct ctl_table * + sd_alloc_ctl_domain_table(struct sched_domain *sd) + { +- struct ctl_table *table = sd_alloc_ctl_entry(13); ++ ctl_table_no_const *table = sd_alloc_ctl_entry(13); + + if (table == NULL) + return NULL; +@@ -5059,9 +5066,9 @@ sd_alloc_ctl_domain_table(struct sched_domain *sd) + return table; + } + +-static ctl_table *sd_alloc_ctl_cpu_table(int cpu) ++static ctl_table_no_const *sd_alloc_ctl_cpu_table(int cpu) + { +- struct ctl_table *entry, *table; ++ ctl_table_no_const *entry, *table; + struct sched_domain *sd; + int domain_num = 0, i; + char buf[32]; +@@ -5088,11 +5095,13 @@ static struct ctl_table_header *sd_sysctl_header; + static void register_sched_domain_sysctl(void) + { + int i, cpu_num = num_possible_cpus(); +- struct ctl_table *entry = sd_alloc_ctl_entry(cpu_num + 1); ++ ctl_table_no_const *entry = sd_alloc_ctl_entry(cpu_num + 1); + char buf[32]; + + WARN_ON(sd_ctl_dir[0].child); ++ pax_open_kernel(); + sd_ctl_dir[0].child = entry; ++ pax_close_kernel(); + + if (entry == NULL) + return; +@@ -5115,8 +5124,12 @@ static void unregister_sched_domain_sysctl(void) + if (sd_sysctl_header) + unregister_sysctl_table(sd_sysctl_header); + sd_sysctl_header = NULL; +- if (sd_ctl_dir[0].child) +- sd_free_ctl_entry(&sd_ctl_dir[0].child); ++ if (sd_ctl_dir[0].child) { ++ sd_free_ctl_entry(sd_ctl_dir[0].child); ++ pax_open_kernel(); ++ sd_ctl_dir[0].child = NULL; ++ pax_close_kernel(); ++ } + } + #else + static void register_sched_domain_sysctl(void) +@@ -5215,7 +5228,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) + * happens before everything else. This has to be lower priority than + * the notifier in the perf_event subsystem, though. + */ +-static struct notifier_block __cpuinitdata migration_notifier = { ++static struct notifier_block migration_notifier = { + .notifier_call = migration_call, + .priority = CPU_PRI_MIGRATION, + }; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index e955364..eacd2a4 100644 +index 7a33e59..2f7730c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -5107,7 +5107,7 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) { } +@@ -830,7 +830,7 @@ void task_numa_fault(int node, int pages, bool migrated) + + static void reset_ptenuma_scan(struct task_struct *p) + { +- ACCESS_ONCE(p->mm->numa_scan_seq)++; ++ ACCESS_ONCE_RW(p->mm->numa_scan_seq)++; + p->mm->numa_scan_offset = 0; + } + +@@ -5654,7 +5654,7 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) { } * run_rebalance_domains is triggered when needed from the scheduler tick. * Also triggered for nohz idle balancing (with nohz_balancing_kick set). */ @@ -68887,10 +77607,10 @@ index e955364..eacd2a4 100644 int this_cpu = smp_processor_id(); struct rq *this_rq = cpu_rq(this_cpu); diff --git a/kernel/signal.c b/kernel/signal.c -index 17afcaf..4500b05 100644 +index 598dc06..471310a 100644 --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -47,12 +47,12 @@ static struct kmem_cache *sigqueue_cachep; +@@ -50,12 +50,12 @@ static struct kmem_cache *sigqueue_cachep; int print_fatal_signals __read_mostly; @@ -68905,7 +77625,7 @@ index 17afcaf..4500b05 100644 { /* Is it explicitly or implicitly ignored? */ return handler == SIG_IGN || -@@ -61,7 +61,7 @@ static int sig_handler_ignored(void __user *handler, int sig) +@@ -64,7 +64,7 @@ static int sig_handler_ignored(void __user *handler, int sig) static int sig_task_ignored(struct task_struct *t, int sig, bool force) { @@ -68914,7 +77634,7 @@ index 17afcaf..4500b05 100644 handler = sig_handler(t, sig); -@@ -365,6 +365,9 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi +@@ -368,6 +368,9 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi atomic_inc(&user->sigpending); rcu_read_unlock(); @@ -68924,7 +77644,7 @@ index 17afcaf..4500b05 100644 if (override_rlimit || atomic_read(&user->sigpending) <= task_rlimit(t, RLIMIT_SIGPENDING)) { -@@ -489,7 +492,7 @@ flush_signal_handlers(struct task_struct *t, int force_default) +@@ -495,7 +498,7 @@ flush_signal_handlers(struct task_struct *t, int force_default) int unhandled_signal(struct task_struct *tsk, int sig) { @@ -68933,7 +77653,7 @@ index 17afcaf..4500b05 100644 if (is_global_init(tsk)) return 1; if (handler != SIG_IGN && handler != SIG_DFL) -@@ -816,6 +819,13 @@ static int check_kill_permission(int sig, struct siginfo *info, +@@ -815,6 +818,13 @@ static int check_kill_permission(int sig, struct siginfo *info, } } @@ -68947,7 +77667,7 @@ index 17afcaf..4500b05 100644 return security_task_kill(t, info, sig, 0); } -@@ -1204,7 +1214,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) +@@ -1197,7 +1207,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) return send_signal(sig, info, p, 1); } @@ -68956,7 +77676,7 @@ index 17afcaf..4500b05 100644 specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t) { return send_signal(sig, info, t, 0); -@@ -1241,6 +1251,7 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) +@@ -1234,6 +1244,7 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) unsigned long int flags; int ret, blocked, ignored; struct k_sigaction *action; @@ -68964,7 +77684,7 @@ index 17afcaf..4500b05 100644 spin_lock_irqsave(&t->sighand->siglock, flags); action = &t->sighand->action[sig-1]; -@@ -1255,9 +1266,18 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) +@@ -1248,9 +1259,18 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) } if (action->sa.sa_handler == SIG_DFL) t->signal->flags &= ~SIGNAL_UNKILLABLE; @@ -68983,7 +77703,7 @@ index 17afcaf..4500b05 100644 return ret; } -@@ -1324,8 +1344,11 @@ int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) +@@ -1317,8 +1337,11 @@ int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) ret = check_kill_permission(sig, info, p); rcu_read_unlock(); @@ -68996,7 +77716,7 @@ index 17afcaf..4500b05 100644 return ret; } -@@ -2840,7 +2863,15 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info) +@@ -2923,7 +2946,15 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info) int error = -ESRCH; rcu_read_lock(); @@ -69013,42 +77733,62 @@ index 17afcaf..4500b05 100644 if (p && (tgid <= 0 || task_tgid_vnr(p) == tgid)) { error = check_kill_permission(sig, info, p); /* +@@ -3237,8 +3268,8 @@ COMPAT_SYSCALL_DEFINE2(sigaltstack, + } + seg = get_fs(); + set_fs(KERNEL_DS); +- ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL), +- (stack_t __force __user *) &uoss, ++ ret = do_sigaltstack((stack_t __force_user *) (uss_ptr ? &uss : NULL), ++ (stack_t __force_user *) &uoss, + compat_user_stack_pointer()); + set_fs(seg); + if (ret >= 0 && uoss_ptr) { diff --git a/kernel/smp.c b/kernel/smp.c -index 2f8b10e..a41bc14 100644 +index 8e451f3..8322029 100644 --- a/kernel/smp.c +++ b/kernel/smp.c -@@ -580,22 +580,22 @@ int smp_call_function(smp_call_func_t func, void *info, int wait) - } - EXPORT_SYMBOL(smp_call_function); - --void ipi_call_lock(void) -+void ipi_call_lock(void) __acquires(call_function.lock) - { - raw_spin_lock(&call_function.lock); +@@ -73,7 +73,7 @@ hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu) + return NOTIFY_OK; } --void ipi_call_unlock(void) -+void ipi_call_unlock(void) __releases(call_function.lock) - { - raw_spin_unlock(&call_function.lock); - } - --void ipi_call_lock_irq(void) -+void ipi_call_lock_irq(void) __acquires(call_function.lock) - { - raw_spin_lock_irq(&call_function.lock); - } +-static struct notifier_block __cpuinitdata hotplug_cfd_notifier = { ++static struct notifier_block hotplug_cfd_notifier = { + .notifier_call = hotplug_cfd, + }; --void ipi_call_unlock_irq(void) -+void ipi_call_unlock_irq(void) __releases(call_function.lock) +diff --git a/kernel/smpboot.c b/kernel/smpboot.c +index 02fc5c9..e54c335 100644 +--- a/kernel/smpboot.c ++++ b/kernel/smpboot.c +@@ -288,7 +288,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread) + } + smpboot_unpark_thread(plug_thread, cpu); + } +- list_add(&plug_thread->list, &hotplug_threads); ++ pax_list_add(&plug_thread->list, &hotplug_threads); + out: + mutex_unlock(&smpboot_threads_lock); + return ret; +@@ -305,7 +305,7 @@ void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *plug_thread) { - raw_spin_unlock_irq(&call_function.lock); - } + get_online_cpus(); + mutex_lock(&smpboot_threads_lock); +- list_del(&plug_thread->list); ++ pax_list_del(&plug_thread->list); + smpboot_destroy_threads(plug_thread); + mutex_unlock(&smpboot_threads_lock); + put_online_cpus(); diff --git a/kernel/softirq.c b/kernel/softirq.c -index 671f959..91c51cb 100644 +index 14d7758..012121f 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -56,7 +56,7 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp +@@ -53,11 +53,11 @@ irq_cpustat_t irq_stat[NR_CPUS] ____cacheline_aligned; + EXPORT_SYMBOL(irq_stat); + #endif + +-static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp; ++static struct softirq_action softirq_vec[NR_SOFTIRQS] __read_only __aligned(PAGE_SIZE); DEFINE_PER_CPU(struct task_struct *, ksoftirqd); @@ -69057,7 +77797,7 @@ index 671f959..91c51cb 100644 "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL", "TASKLET", "SCHED", "HRTIMER", "RCU" }; -@@ -235,7 +235,7 @@ restart: +@@ -244,7 +244,7 @@ restart: kstat_incr_softirqs_this_cpu(vec_nr); trace_softirq_entry(vec_nr); @@ -69066,21 +77806,16 @@ index 671f959..91c51cb 100644 trace_softirq_exit(vec_nr); if (unlikely(prev_count != preempt_count())) { printk(KERN_ERR "huh, entered softirq %u %s %p" -@@ -381,9 +381,11 @@ void __raise_softirq_irqoff(unsigned int nr) +@@ -389,7 +389,7 @@ void __raise_softirq_irqoff(unsigned int nr) or_softirq_pending(1UL << nr); } -void open_softirq(int nr, void (*action)(struct softirq_action *)) -+void open_softirq(int nr, void (*action)(void)) ++void __init open_softirq(int nr, void (*action)(void)) { -- softirq_vec[nr].action = action; -+ pax_open_kernel(); -+ *(void **)&softirq_vec[nr].action = action; -+ pax_close_kernel(); + softirq_vec[nr].action = action; } - - /* -@@ -437,7 +439,7 @@ void __tasklet_hi_schedule_first(struct tasklet_struct *t) +@@ -445,7 +445,7 @@ void __tasklet_hi_schedule_first(struct tasklet_struct *t) EXPORT_SYMBOL(__tasklet_hi_schedule_first); @@ -69089,7 +77824,7 @@ index 671f959..91c51cb 100644 { struct tasklet_struct *list; -@@ -472,7 +474,7 @@ static void tasklet_action(struct softirq_action *a) +@@ -480,7 +480,7 @@ static void tasklet_action(struct softirq_action *a) } } @@ -69098,8 +77833,47 @@ index 671f959..91c51cb 100644 { struct tasklet_struct *list; +@@ -716,7 +716,7 @@ static int __cpuinit remote_softirq_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata remote_softirq_cpu_notifier = { ++static struct notifier_block remote_softirq_cpu_notifier = { + .notifier_call = remote_softirq_cpu_notify, + }; + +@@ -833,11 +833,11 @@ static int __cpuinit cpu_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata cpu_nfb = { ++static struct notifier_block cpu_nfb = { + .notifier_call = cpu_callback + }; + +-static struct smp_hotplug_thread softirq_threads = { ++static struct smp_hotplug_thread softirq_threads __read_only = { + .store = &ksoftirqd, + .thread_should_run = ksoftirqd_should_run, + .thread_fn = run_ksoftirqd, +diff --git a/kernel/srcu.c b/kernel/srcu.c +index 01d5ccb..cdcbee6 100644 +--- a/kernel/srcu.c ++++ b/kernel/srcu.c +@@ -300,9 +300,9 @@ int __srcu_read_lock(struct srcu_struct *sp) + + idx = ACCESS_ONCE(sp->completed) & 0x1; + preempt_disable(); +- ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->c[idx]) += 1; ++ ACCESS_ONCE_RW(this_cpu_ptr(sp->per_cpu_ref)->c[idx]) += 1; + smp_mb(); /* B */ /* Avoid leaking the critical section. */ +- ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->seq[idx]) += 1; ++ ACCESS_ONCE_RW(this_cpu_ptr(sp->per_cpu_ref)->seq[idx]) += 1; + preempt_enable(); + return idx; + } diff --git a/kernel/sys.c b/kernel/sys.c -index e7006eb..8fb7c51 100644 +index 0da73cf..a22106a 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -158,6 +158,12 @@ static int set_one_prio(struct task_struct *p, int niceval, int error) @@ -69115,28 +77889,28 @@ index e7006eb..8fb7c51 100644 no_nice = security_task_setnice(p, niceval); if (no_nice) { error = no_nice; -@@ -581,6 +587,9 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid) +@@ -598,6 +604,9 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid) goto error; } -+ if (gr_check_group_change(new->gid, new->egid, -1)) ++ if (gr_check_group_change(new->gid, new->egid, INVALID_GID)) + goto error; + if (rgid != (gid_t) -1 || - (egid != (gid_t) -1 && egid != old->gid)) + (egid != (gid_t) -1 && !gid_eq(kegid, old->gid))) new->sgid = new->egid; -@@ -610,6 +619,10 @@ SYSCALL_DEFINE1(setgid, gid_t, gid) +@@ -633,6 +642,10 @@ SYSCALL_DEFINE1(setgid, gid_t, gid) old = current_cred(); retval = -EPERM; + -+ if (gr_check_group_change(gid, gid, gid)) ++ if (gr_check_group_change(kgid, kgid, kgid)) + goto error; + if (nsown_capable(CAP_SETGID)) - new->gid = new->egid = new->sgid = new->fsgid = gid; - else if (gid == old->gid || gid == old->sgid) -@@ -627,7 +640,7 @@ error: + new->gid = new->egid = new->sgid = new->fsgid = kgid; + else if (gid_eq(kgid, old->gid) || gid_eq(kgid, old->sgid)) +@@ -650,7 +663,7 @@ error: /* * change the user struct in a credentials set to match the new UID */ @@ -69145,60 +77919,59 @@ index e7006eb..8fb7c51 100644 { struct user_struct *new_user; -@@ -697,6 +710,9 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid) +@@ -730,6 +743,9 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid) goto error; } -+ if (gr_check_user_change(new->uid, new->euid, -1)) ++ if (gr_check_user_change(new->uid, new->euid, INVALID_UID)) + goto error; + - if (new->uid != old->uid) { + if (!uid_eq(new->uid, old->uid)) { retval = set_user(new); if (retval < 0) -@@ -741,6 +757,12 @@ SYSCALL_DEFINE1(setuid, uid_t, uid) +@@ -780,6 +796,12 @@ SYSCALL_DEFINE1(setuid, uid_t, uid) old = current_cred(); retval = -EPERM; + -+ if (gr_check_crash_uid(uid)) ++ if (gr_check_crash_uid(kuid)) + goto error; -+ if (gr_check_user_change(uid, uid, uid)) ++ if (gr_check_user_change(kuid, kuid, kuid)) + goto error; + if (nsown_capable(CAP_SETUID)) { - new->suid = new->uid = uid; - if (uid != old->uid) { -@@ -795,6 +817,9 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) + new->suid = new->uid = kuid; + if (!uid_eq(kuid, old->uid)) { +@@ -849,6 +871,9 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) goto error; } -+ if (gr_check_user_change(ruid, euid, -1)) ++ if (gr_check_user_change(kruid, keuid, INVALID_UID)) + goto error; + if (ruid != (uid_t) -1) { - new->uid = ruid; - if (ruid != old->uid) { -@@ -859,6 +884,9 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) + new->uid = kruid; + if (!uid_eq(kruid, old->uid)) { +@@ -931,6 +956,9 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) goto error; } -+ if (gr_check_group_change(rgid, egid, -1)) ++ if (gr_check_group_change(krgid, kegid, INVALID_GID)) + goto error; + if (rgid != (gid_t) -1) - new->gid = rgid; + new->gid = krgid; if (egid != (gid_t) -1) -@@ -905,6 +933,9 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid) - old = current_cred(); - old_fsuid = old->fsuid; - -+ if (gr_check_user_change(-1, -1, uid)) -+ goto error; -+ - if (uid == old->uid || uid == old->euid || - uid == old->suid || uid == old->fsuid || +@@ -992,12 +1020,16 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid) + uid_eq(kuid, old->suid) || uid_eq(kuid, old->fsuid) || nsown_capable(CAP_SETUID)) { -@@ -915,6 +946,7 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid) + if (!uid_eq(kuid, old->fsuid)) { ++ if (gr_check_user_change(INVALID_UID, INVALID_UID, kuid)) ++ goto error; ++ + new->fsuid = kuid; + if (security_task_fix_setuid(new, old, LSM_SETID_FS) == 0) + goto change_okay; } } @@ -69206,15 +77979,15 @@ index e7006eb..8fb7c51 100644 abort_creds(new); return old_fsuid; -@@ -941,12 +973,16 @@ SYSCALL_DEFINE1(setfsgid, gid_t, gid) - if (gid == old->gid || gid == old->egid || - gid == old->sgid || gid == old->fsgid || +@@ -1030,12 +1062,16 @@ SYSCALL_DEFINE1(setfsgid, gid_t, gid) + if (gid_eq(kgid, old->gid) || gid_eq(kgid, old->egid) || + gid_eq(kgid, old->sgid) || gid_eq(kgid, old->fsgid) || nsown_capable(CAP_SETGID)) { -+ if (gr_check_group_change(-1, -1, gid)) ++ if (gr_check_group_change(INVALID_GID, INVALID_GID, kgid)) + goto error; + - if (gid != old_fsgid) { - new->fsgid = gid; + if (!gid_eq(kgid, old->fsgid)) { + new->fsgid = kgid; goto change_okay; } } @@ -69223,19 +77996,7 @@ index e7006eb..8fb7c51 100644 abort_creds(new); return old_fsgid; -@@ -1198,7 +1234,10 @@ static int override_release(char __user *release, int len) - } - v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40; - snprintf(buf, len, "2.6.%u%s", v, rest); -- ret = copy_to_user(release, buf, len); -+ if (len > sizeof(buf)) -+ ret = -EFAULT; -+ else -+ ret = copy_to_user(release, buf, len); - } - return ret; - } -@@ -1252,19 +1291,19 @@ SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name) +@@ -1343,19 +1379,19 @@ SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name) return -EFAULT; down_read(&uts_sem); @@ -69260,20 +78021,25 @@ index e7006eb..8fb7c51 100644 __OLD_UTS_LEN); error |= __put_user(0, name->machine + __OLD_UTS_LEN); up_read(&uts_sem); -@@ -1847,7 +1886,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, - error = get_dumpable(me->mm); - break; - case PR_SET_DUMPABLE: -- if (arg2 < 0 || arg2 > 1) { -+ if (arg2 > 1) { - error = -EINVAL; - break; - } +@@ -1557,6 +1593,13 @@ int do_prlimit(struct task_struct *tsk, unsigned int resource, + */ + new_rlim->rlim_cur = 1; + } ++ /* Handle the case where a fork and setuid occur and then RLIMIT_NPROC ++ is changed to a lower value. Since tasks can be created by the same ++ user in between this limit change and an execve by this task, force ++ a recheck only for this task by setting PF_NPROC_EXCEEDED ++ */ ++ if (resource == RLIMIT_NPROC) ++ tsk->flags |= PF_NPROC_EXCEEDED; + } + if (!retval) { + if (old_rlim) diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index 4ab1187..33f4f2b 100644 +index afc1dc6..5e28bbf 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c -@@ -91,7 +91,6 @@ +@@ -93,7 +93,6 @@ #if defined(CONFIG_SYSCTL) @@ -69281,7 +78047,7 @@ index 4ab1187..33f4f2b 100644 /* External variables not in a header file. */ extern int sysctl_overcommit_memory; extern int sysctl_overcommit_ratio; -@@ -169,10 +168,13 @@ static int proc_taint(struct ctl_table *table, int write, +@@ -178,10 +177,8 @@ static int proc_taint(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); #endif @@ -69289,15 +78055,10 @@ index 4ab1187..33f4f2b 100644 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); -#endif -+ -+static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, -+ void __user *buffer, size_t *lenp, loff_t *ppos); -+static int proc_dostring_coredump(struct ctl_table *table, int write, -+ void __user *buffer, size_t *lenp, loff_t *ppos); - #ifdef CONFIG_MAGIC_SYSRQ - /* Note: sysrq code uses it's own private copy */ -@@ -196,6 +198,8 @@ static int sysrq_sysctl_handler(ctl_table *table, int write, + static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos); +@@ -212,6 +209,8 @@ static int sysrq_sysctl_handler(ctl_table *table, int write, #endif @@ -69306,7 +78067,7 @@ index 4ab1187..33f4f2b 100644 static struct ctl_table kern_table[]; static struct ctl_table vm_table[]; static struct ctl_table fs_table[]; -@@ -210,6 +214,20 @@ extern struct ctl_table epoll_table[]; +@@ -226,6 +225,20 @@ extern struct ctl_table epoll_table[]; int sysctl_legacy_va_layout; #endif @@ -69327,7 +78088,7 @@ index 4ab1187..33f4f2b 100644 /* The default sysctl tables: */ static struct ctl_table sysctl_base_table[] = { -@@ -256,6 +274,22 @@ static int max_extfrag_threshold = 1000; +@@ -274,6 +287,22 @@ static int max_extfrag_threshold = 1000; #endif static struct ctl_table kern_table[] = { @@ -69350,16 +78111,7 @@ index 4ab1187..33f4f2b 100644 { .procname = "sched_child_runs_first", .data = &sysctl_sched_child_runs_first, -@@ -410,7 +444,7 @@ static struct ctl_table kern_table[] = { - .data = core_pattern, - .maxlen = CORENAME_MAX_SIZE, - .mode = 0644, -- .proc_handler = proc_dostring, -+ .proc_handler = proc_dostring_coredump, - }, - { - .procname = "core_pipe_limit", -@@ -540,7 +574,7 @@ static struct ctl_table kern_table[] = { +@@ -608,7 +637,7 @@ static struct ctl_table kern_table[] = { .data = &modprobe_path, .maxlen = KMOD_PATH_LEN, .mode = 0644, @@ -69368,7 +78120,7 @@ index 4ab1187..33f4f2b 100644 }, { .procname = "modules_disabled", -@@ -707,16 +741,20 @@ static struct ctl_table kern_table[] = { +@@ -775,16 +804,20 @@ static struct ctl_table kern_table[] = { .extra1 = &zero, .extra2 = &one, }, @@ -69390,7 +78142,18 @@ index 4ab1187..33f4f2b 100644 { .procname = "ngroups_max", .data = &ngroups_max, -@@ -1215,6 +1253,13 @@ static struct ctl_table vm_table[] = { +@@ -1026,8 +1059,8 @@ static struct ctl_table kern_table[] = { + */ + { + .procname = "perf_event_paranoid", +- .data = &sysctl_perf_event_paranoid, +- .maxlen = sizeof(sysctl_perf_event_paranoid), ++ .data = &sysctl_perf_event_legitimately_concerned, ++ .maxlen = sizeof(sysctl_perf_event_legitimately_concerned), + .mode = 0644, + .proc_handler = proc_dointvec, + }, +@@ -1283,6 +1316,13 @@ static struct ctl_table vm_table[] = { .proc_handler = proc_dointvec_minmax, .extra1 = &zero, }, @@ -69404,16 +78167,7 @@ index 4ab1187..33f4f2b 100644 #else { .procname = "nr_trim_pages", -@@ -1498,7 +1543,7 @@ static struct ctl_table fs_table[] = { - .data = &suid_dumpable, - .maxlen = sizeof(int), - .mode = 0644, -- .proc_handler = proc_dointvec_minmax, -+ .proc_handler = proc_dointvec_minmax_coredump, - .extra1 = &zero, - .extra2 = &two, - }, -@@ -1645,6 +1690,16 @@ int proc_dostring(struct ctl_table *table, int write, +@@ -1733,6 +1773,16 @@ int proc_dostring(struct ctl_table *table, int write, buffer, lenp, ppos); } @@ -69430,7 +78184,7 @@ index 4ab1187..33f4f2b 100644 static size_t proc_skip_spaces(char **buf) { size_t ret; -@@ -1750,6 +1805,8 @@ static int proc_put_long(void __user **buf, size_t *size, unsigned long val, +@@ -1838,6 +1888,8 @@ static int proc_put_long(void __user **buf, size_t *size, unsigned long val, len = strlen(tmp); if (len > *size) len = *size; @@ -69439,7 +78193,16 @@ index 4ab1187..33f4f2b 100644 if (copy_to_user(*buf, tmp, len)) return -EFAULT; *size -= len; -@@ -1942,7 +1999,6 @@ static int proc_taint(struct ctl_table *table, int write, +@@ -2002,7 +2054,7 @@ int proc_dointvec(struct ctl_table *table, int write, + static int proc_taint(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table t; ++ ctl_table_no_const t; + unsigned long tmptaint = get_taint(); + int err; + +@@ -2030,7 +2082,6 @@ static int proc_taint(struct ctl_table *table, int write, return err; } @@ -69447,7 +78210,7 @@ index 4ab1187..33f4f2b 100644 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { -@@ -1951,7 +2007,6 @@ static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, +@@ -2039,7 +2090,6 @@ static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, return proc_dointvec_minmax(table, write, buffer, lenp, ppos); } @@ -69455,42 +78218,7 @@ index 4ab1187..33f4f2b 100644 struct do_proc_dointvec_minmax_conv_param { int *min; -@@ -2009,6 +2064,34 @@ int proc_dointvec_minmax(struct ctl_table *table, int write, - do_proc_dointvec_minmax_conv, ¶m); - } - -+static void validate_coredump_safety(void) -+{ -+ if (suid_dumpable == SUID_DUMPABLE_SAFE && -+ core_pattern[0] != '/' && core_pattern[0] != '|') { -+ printk(KERN_WARNING "Unsafe core_pattern used with "\ -+ "suid_dumpable=2. Pipe handler or fully qualified "\ -+ "core dump path required.\n"); -+ } -+} -+ -+static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, -+ void __user *buffer, size_t *lenp, loff_t *ppos) -+{ -+ int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos); -+ if (!error) -+ validate_coredump_safety(); -+ return error; -+} -+ -+static int proc_dostring_coredump(struct ctl_table *table, int write, -+ void __user *buffer, size_t *lenp, loff_t *ppos) -+{ -+ int error = proc_dostring(table, write, buffer, lenp, ppos); -+ if (!error) -+ validate_coredump_safety(); -+ return error; -+} -+ - static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, - void __user *buffer, - size_t *lenp, loff_t *ppos, -@@ -2066,8 +2149,11 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int +@@ -2186,8 +2236,11 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int *i = val; } else { val = convdiv * (*i) / convmul; @@ -69503,7 +78231,7 @@ index 4ab1187..33f4f2b 100644 err = proc_put_long(&buffer, &left, val, false); if (err) break; -@@ -2459,6 +2545,12 @@ int proc_dostring(struct ctl_table *table, int write, +@@ -2579,6 +2632,12 @@ int proc_dostring(struct ctl_table *table, int write, return -ENOSYS; } @@ -69516,88 +78244,21 @@ index 4ab1187..33f4f2b 100644 int proc_dointvec(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { -@@ -2515,5 +2607,6 @@ EXPORT_SYMBOL(proc_dointvec_minmax); +@@ -2635,5 +2694,6 @@ EXPORT_SYMBOL(proc_dointvec_minmax); EXPORT_SYMBOL(proc_dointvec_userhz_jiffies); EXPORT_SYMBOL(proc_dointvec_ms_jiffies); EXPORT_SYMBOL(proc_dostring); +EXPORT_SYMBOL(proc_dostring_modpriv); EXPORT_SYMBOL(proc_doulongvec_minmax); EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); -diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c -index a650694..aaeeb20 100644 ---- a/kernel/sysctl_binary.c -+++ b/kernel/sysctl_binary.c -@@ -989,7 +989,7 @@ static ssize_t bin_intvec(struct file *file, - int i; - - set_fs(KERNEL_DS); -- result = vfs_read(file, buffer, BUFSZ - 1, &pos); -+ result = vfs_read(file, (char __force_user *)buffer, BUFSZ - 1, &pos); - set_fs(old_fs); - if (result < 0) - goto out_kfree; -@@ -1034,7 +1034,7 @@ static ssize_t bin_intvec(struct file *file, - } - - set_fs(KERNEL_DS); -- result = vfs_write(file, buffer, str - buffer, &pos); -+ result = vfs_write(file, (const char __force_user *)buffer, str - buffer, &pos); - set_fs(old_fs); - if (result < 0) - goto out_kfree; -@@ -1067,7 +1067,7 @@ static ssize_t bin_ulongvec(struct file *file, - int i; - - set_fs(KERNEL_DS); -- result = vfs_read(file, buffer, BUFSZ - 1, &pos); -+ result = vfs_read(file, (char __force_user *)buffer, BUFSZ - 1, &pos); - set_fs(old_fs); - if (result < 0) - goto out_kfree; -@@ -1112,7 +1112,7 @@ static ssize_t bin_ulongvec(struct file *file, - } - - set_fs(KERNEL_DS); -- result = vfs_write(file, buffer, str - buffer, &pos); -+ result = vfs_write(file, (const char __force_user *)buffer, str - buffer, &pos); - set_fs(old_fs); - if (result < 0) - goto out_kfree; -@@ -1138,7 +1138,7 @@ static ssize_t bin_uuid(struct file *file, - int i; - - set_fs(KERNEL_DS); -- result = vfs_read(file, buf, sizeof(buf) - 1, &pos); -+ result = vfs_read(file, (char __force_user *)buf, sizeof(buf) - 1, &pos); - set_fs(old_fs); - if (result < 0) - goto out; -@@ -1185,7 +1185,7 @@ static ssize_t bin_dn_node_address(struct file *file, - __le16 dnaddr; - - set_fs(KERNEL_DS); -- result = vfs_read(file, buf, sizeof(buf) - 1, &pos); -+ result = vfs_read(file, (char __force_user *)buf, sizeof(buf) - 1, &pos); - set_fs(old_fs); - if (result < 0) - goto out; -@@ -1233,7 +1233,7 @@ static ssize_t bin_dn_node_address(struct file *file, - le16_to_cpu(dnaddr) & 0x3ff); - - set_fs(KERNEL_DS); -- result = vfs_write(file, buf, len, &pos); -+ result = vfs_write(file, (const char __force_user *)buf, len, &pos); - set_fs(old_fs); - if (result < 0) - goto out; diff --git a/kernel/taskstats.c b/kernel/taskstats.c -index e660464..c8b9e67 100644 +index 145bb4d..b2aa969 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c -@@ -27,9 +27,12 @@ - #include <linux/cgroup.h> +@@ -28,9 +28,12 @@ #include <linux/fs.h> #include <linux/file.h> + #include <linux/pid_namespace.h> +#include <linux/grsecurity.h> #include <net/genetlink.h> #include <linux/atomic.h> @@ -69607,7 +78268,7 @@ index e660464..c8b9e67 100644 /* * Maximum length of a cpumask that can be specified in * the TASKSTATS_CMD_ATTR_REGISTER/DEREGISTER_CPUMASK attribute -@@ -556,6 +559,9 @@ err: +@@ -570,6 +573,9 @@ err: static int taskstats_user_cmd(struct sk_buff *skb, struct genl_info *info) { @@ -69618,10 +78279,10 @@ index e660464..c8b9e67 100644 return cmd_attr_register_cpumask(info); else if (info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK]) diff --git a/kernel/time.c b/kernel/time.c -index ba744cf..267b7c5 100644 +index f8342a4..288f13b 100644 --- a/kernel/time.c +++ b/kernel/time.c -@@ -163,6 +163,11 @@ int do_sys_settimeofday(const struct timespec *tv, const struct timezone *tz) +@@ -171,6 +171,11 @@ int do_sys_settimeofday(const struct timespec *tv, const struct timezone *tz) return error; if (tz) { @@ -69633,11 +78294,20 @@ index ba744cf..267b7c5 100644 sys_tz = *tz; update_vsyscall_tz(); if (firsttime) { +@@ -501,7 +506,7 @@ EXPORT_SYMBOL(usecs_to_jiffies); + * The >> (NSEC_JIFFIE_SC - SEC_JIFFIE_SC) converts the scaled nsec + * value to a scaled second value. + */ +-unsigned long ++unsigned long __intentional_overflow(-1) + timespec_to_jiffies(const struct timespec *value) + { + unsigned long sec = value->tv_sec; diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c -index 8a538c5..def79d4 100644 +index f11d83b..d016d91 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c -@@ -779,7 +779,7 @@ static int __init alarmtimer_init(void) +@@ -750,7 +750,7 @@ static int __init alarmtimer_init(void) struct platform_device *pdev; int error = 0; int i; @@ -69647,23 +78317,23 @@ index 8a538c5..def79d4 100644 .clock_get = alarm_clock_get, .timer_create = alarm_timer_create, diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c -index f113755..ec24223 100644 +index 90ad470..1814e9a 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c -@@ -115,7 +115,7 @@ int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu) +@@ -138,7 +138,7 @@ int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu) * then clear the broadcast bit. */ if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) { - int cpu = smp_processor_id(); + cpu = smp_processor_id(); - cpumask_clear_cpu(cpu, tick_get_broadcast_mask()); tick_broadcast_clear_oneshot(cpu); + } else { diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c -index 7c50de8..e29a94d 100644 +index 9a0bc98..fceb7d0 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c -@@ -14,6 +14,7 @@ +@@ -15,6 +15,7 @@ #include <linux/init.h> #include <linux/mm.h> #include <linux/sched.h> @@ -69671,17 +78341,17 @@ index 7c50de8..e29a94d 100644 #include <linux/syscore_ops.h> #include <linux/clocksource.h> #include <linux/jiffies.h> -@@ -388,6 +389,8 @@ int do_settimeofday(const struct timespec *tv) - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) +@@ -448,6 +449,8 @@ int do_settimeofday(const struct timespec *tv) + if (!timespec_valid_strict(tv)) return -EINVAL; + gr_log_timechange(); + - write_seqlock_irqsave(&timekeeper.lock, flags); + write_seqlock_irqsave(&tk->lock, flags); - timekeeping_forward_now(); + timekeeping_forward_now(tk); diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c -index 3258455..f35227d 100644 +index af5a7e9..715611a 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c @@ -38,12 +38,16 @@ DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases); @@ -69726,7 +78396,7 @@ index 3258455..f35227d 100644 return -ENOMEM; return 0; diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c -index 0b537f2..9e71eca 100644 +index 0b537f2..40d6c20 100644 --- a/kernel/time/timer_stats.c +++ b/kernel/time/timer_stats.c @@ -116,7 +116,7 @@ static ktime_t time_start, time_stop; @@ -69766,7 +78436,8 @@ index 0b537f2..9e71eca 100644 char symname[KSYM_NAME_LEN]; if (lookup_symbol_name(addr, symname) < 0) - seq_printf(m, "<%p>", (void *)addr); +- seq_printf(m, "<%p>", (void *)addr); ++ seq_printf(m, "<%pK>", (void *)addr); else seq_printf(m, "%s", symname); +#endif @@ -69798,10 +78469,10 @@ index 0b537f2..9e71eca 100644 return -ENOMEM; return 0; diff --git a/kernel/timer.c b/kernel/timer.c -index a297ffc..5e16b0b 100644 +index 1b399c8..90e1849 100644 --- a/kernel/timer.c +++ b/kernel/timer.c -@@ -1354,7 +1354,7 @@ void update_process_times(int user_tick) +@@ -1363,7 +1363,7 @@ void update_process_times(int user_tick) /* * This function runs timers and the timer-tq in bottom half context. */ @@ -69810,8 +78481,26 @@ index a297ffc..5e16b0b 100644 { struct tvec_base *base = __this_cpu_read(tvec_bases); +@@ -1481,7 +1481,7 @@ static void process_timeout(unsigned long __data) + * + * In all cases the return value is guaranteed to be non-negative. + */ +-signed long __sched schedule_timeout(signed long timeout) ++signed long __sched __intentional_overflow(-1) schedule_timeout(signed long timeout) + { + struct timer_list timer; + unsigned long expire; +@@ -1772,7 +1772,7 @@ static int __cpuinit timer_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata timers_nb = { ++static struct notifier_block timers_nb = { + .notifier_call = timer_cpu_notify, + }; + diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c -index c0bd030..62a1927 100644 +index 5a0f781..1497f95 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -317,7 +317,7 @@ static ssize_t blk_dropped_read(struct file *filp, char __user *buffer, @@ -69842,10 +78531,10 @@ index c0bd030..62a1927 100644 ret = -EIO; bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt, diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c -index 0fa92f6..89950b2 100644 +index 0a0e2a6..943495e 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c -@@ -1800,12 +1800,17 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec) +@@ -1909,12 +1909,17 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec) if (unlikely(ftrace_disabled)) return 0; @@ -69865,7 +78554,7 @@ index 0fa92f6..89950b2 100644 } /* -@@ -2917,7 +2922,7 @@ static void ftrace_free_entry_rcu(struct rcu_head *rhp) +@@ -2986,7 +2991,7 @@ static void ftrace_free_entry_rcu(struct rcu_head *rhp) int register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, @@ -69874,11 +78563,337 @@ index 0fa92f6..89950b2 100644 { struct ftrace_func_probe *entry; struct ftrace_page *pg; +@@ -3854,8 +3859,10 @@ static int ftrace_process_locs(struct module *mod, + if (!count) + return 0; + ++ pax_open_kernel(); + sort(start, count, sizeof(*start), + ftrace_cmp_ips, ftrace_swap_ips); ++ pax_close_kernel(); + + start_pg = ftrace_allocate_pages(count); + if (!start_pg) +@@ -4574,8 +4581,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, + #ifdef CONFIG_FUNCTION_GRAPH_TRACER + + static int ftrace_graph_active; +-static struct notifier_block ftrace_suspend_notifier; +- + int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace) + { + return 0; +@@ -4719,6 +4724,10 @@ ftrace_suspend_notifier_call(struct notifier_block *bl, unsigned long state, + return NOTIFY_DONE; + } + ++static struct notifier_block ftrace_suspend_notifier = { ++ .notifier_call = ftrace_suspend_notifier_call ++}; ++ + int register_ftrace_graph(trace_func_graph_ret_t retfunc, + trace_func_graph_ent_t entryfunc) + { +@@ -4732,7 +4741,6 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc, + goto out; + } + +- ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call; + register_pm_notifier(&ftrace_suspend_notifier); + + ftrace_graph_active++; +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index 6989df2..c2265cf 100644 +--- a/kernel/trace/ring_buffer.c ++++ b/kernel/trace/ring_buffer.c +@@ -349,9 +349,9 @@ struct buffer_data_page { + */ + struct buffer_page { + struct list_head list; /* list of buffer pages */ +- local_t write; /* index for next write */ ++ local_unchecked_t write; /* index for next write */ + unsigned read; /* index for next read */ +- local_t entries; /* entries on this page */ ++ local_unchecked_t entries; /* entries on this page */ + unsigned long real_end; /* real end of data */ + struct buffer_data_page *page; /* Actual data page */ + }; +@@ -464,8 +464,8 @@ struct ring_buffer_per_cpu { + unsigned long last_overrun; + local_t entries_bytes; + local_t entries; +- local_t overrun; +- local_t commit_overrun; ++ local_unchecked_t overrun; ++ local_unchecked_t commit_overrun; + local_t dropped_events; + local_t committing; + local_t commits; +@@ -864,8 +864,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer, + * + * We add a counter to the write field to denote this. + */ +- old_write = local_add_return(RB_WRITE_INTCNT, &next_page->write); +- old_entries = local_add_return(RB_WRITE_INTCNT, &next_page->entries); ++ old_write = local_add_return_unchecked(RB_WRITE_INTCNT, &next_page->write); ++ old_entries = local_add_return_unchecked(RB_WRITE_INTCNT, &next_page->entries); + + /* + * Just make sure we have seen our old_write and synchronize +@@ -893,8 +893,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer, + * cmpxchg to only update if an interrupt did not already + * do it for us. If the cmpxchg fails, we don't care. + */ +- (void)local_cmpxchg(&next_page->write, old_write, val); +- (void)local_cmpxchg(&next_page->entries, old_entries, eval); ++ (void)local_cmpxchg_unchecked(&next_page->write, old_write, val); ++ (void)local_cmpxchg_unchecked(&next_page->entries, old_entries, eval); + + /* + * No need to worry about races with clearing out the commit. +@@ -1253,12 +1253,12 @@ static void rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer); + + static inline unsigned long rb_page_entries(struct buffer_page *bpage) + { +- return local_read(&bpage->entries) & RB_WRITE_MASK; ++ return local_read_unchecked(&bpage->entries) & RB_WRITE_MASK; + } + + static inline unsigned long rb_page_write(struct buffer_page *bpage) + { +- return local_read(&bpage->write) & RB_WRITE_MASK; ++ return local_read_unchecked(&bpage->write) & RB_WRITE_MASK; + } + + static int +@@ -1353,7 +1353,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned int nr_pages) + * bytes consumed in ring buffer from here. + * Increment overrun to account for the lost events. + */ +- local_add(page_entries, &cpu_buffer->overrun); ++ local_add_unchecked(page_entries, &cpu_buffer->overrun); + local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes); + } + +@@ -1909,7 +1909,7 @@ rb_handle_head_page(struct ring_buffer_per_cpu *cpu_buffer, + * it is our responsibility to update + * the counters. + */ +- local_add(entries, &cpu_buffer->overrun); ++ local_add_unchecked(entries, &cpu_buffer->overrun); + local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes); + + /* +@@ -2059,7 +2059,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer, + if (tail == BUF_PAGE_SIZE) + tail_page->real_end = 0; + +- local_sub(length, &tail_page->write); ++ local_sub_unchecked(length, &tail_page->write); + return; + } + +@@ -2094,7 +2094,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer, + rb_event_set_padding(event); + + /* Set the write back to the previous setting */ +- local_sub(length, &tail_page->write); ++ local_sub_unchecked(length, &tail_page->write); + return; + } + +@@ -2106,7 +2106,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer, + + /* Set write to end of buffer */ + length = (tail + length) - BUF_PAGE_SIZE; +- local_sub(length, &tail_page->write); ++ local_sub_unchecked(length, &tail_page->write); + } + + /* +@@ -2132,7 +2132,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer, + * about it. + */ + if (unlikely(next_page == commit_page)) { +- local_inc(&cpu_buffer->commit_overrun); ++ local_inc_unchecked(&cpu_buffer->commit_overrun); + goto out_reset; + } + +@@ -2188,7 +2188,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer, + cpu_buffer->tail_page) && + (cpu_buffer->commit_page == + cpu_buffer->reader_page))) { +- local_inc(&cpu_buffer->commit_overrun); ++ local_inc_unchecked(&cpu_buffer->commit_overrun); + goto out_reset; + } + } +@@ -2236,7 +2236,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, + length += RB_LEN_TIME_EXTEND; + + tail_page = cpu_buffer->tail_page; +- write = local_add_return(length, &tail_page->write); ++ write = local_add_return_unchecked(length, &tail_page->write); + + /* set write to only the index of the write */ + write &= RB_WRITE_MASK; +@@ -2253,7 +2253,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, + kmemcheck_annotate_bitfield(event, bitfield); + rb_update_event(cpu_buffer, event, length, add_timestamp, delta); + +- local_inc(&tail_page->entries); ++ local_inc_unchecked(&tail_page->entries); + + /* + * If this is the first commit on the page, then update +@@ -2286,7 +2286,7 @@ rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer, + + if (bpage->page == (void *)addr && rb_page_write(bpage) == old_index) { + unsigned long write_mask = +- local_read(&bpage->write) & ~RB_WRITE_MASK; ++ local_read_unchecked(&bpage->write) & ~RB_WRITE_MASK; + unsigned long event_length = rb_event_length(event); + /* + * This is on the tail page. It is possible that +@@ -2296,7 +2296,7 @@ rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer, + */ + old_index += write_mask; + new_index += write_mask; +- index = local_cmpxchg(&bpage->write, old_index, new_index); ++ index = local_cmpxchg_unchecked(&bpage->write, old_index, new_index); + if (index == old_index) { + /* update counters */ + local_sub(event_length, &cpu_buffer->entries_bytes); +@@ -2670,7 +2670,7 @@ rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer, + + /* Do the likely case first */ + if (likely(bpage->page == (void *)addr)) { +- local_dec(&bpage->entries); ++ local_dec_unchecked(&bpage->entries); + return; + } + +@@ -2682,7 +2682,7 @@ rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer, + start = bpage; + do { + if (bpage->page == (void *)addr) { +- local_dec(&bpage->entries); ++ local_dec_unchecked(&bpage->entries); + return; + } + rb_inc_page(cpu_buffer, &bpage); +@@ -2964,7 +2964,7 @@ static inline unsigned long + rb_num_of_entries(struct ring_buffer_per_cpu *cpu_buffer) + { + return local_read(&cpu_buffer->entries) - +- (local_read(&cpu_buffer->overrun) + cpu_buffer->read); ++ (local_read_unchecked(&cpu_buffer->overrun) + cpu_buffer->read); + } + + /** +@@ -3053,7 +3053,7 @@ unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu) + return 0; + + cpu_buffer = buffer->buffers[cpu]; +- ret = local_read(&cpu_buffer->overrun); ++ ret = local_read_unchecked(&cpu_buffer->overrun); + + return ret; + } +@@ -3076,7 +3076,7 @@ ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu) + return 0; + + cpu_buffer = buffer->buffers[cpu]; +- ret = local_read(&cpu_buffer->commit_overrun); ++ ret = local_read_unchecked(&cpu_buffer->commit_overrun); + + return ret; + } +@@ -3161,7 +3161,7 @@ unsigned long ring_buffer_overruns(struct ring_buffer *buffer) + /* if you care about this being correct, lock the buffer */ + for_each_buffer_cpu(buffer, cpu) { + cpu_buffer = buffer->buffers[cpu]; +- overruns += local_read(&cpu_buffer->overrun); ++ overruns += local_read_unchecked(&cpu_buffer->overrun); + } + + return overruns; +@@ -3337,8 +3337,8 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer) + /* + * Reset the reader page to size zero. + */ +- local_set(&cpu_buffer->reader_page->write, 0); +- local_set(&cpu_buffer->reader_page->entries, 0); ++ local_set_unchecked(&cpu_buffer->reader_page->write, 0); ++ local_set_unchecked(&cpu_buffer->reader_page->entries, 0); + local_set(&cpu_buffer->reader_page->page->commit, 0); + cpu_buffer->reader_page->real_end = 0; + +@@ -3372,7 +3372,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer) + * want to compare with the last_overrun. + */ + smp_mb(); +- overwrite = local_read(&(cpu_buffer->overrun)); ++ overwrite = local_read_unchecked(&(cpu_buffer->overrun)); + + /* + * Here's the tricky part. +@@ -3942,8 +3942,8 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer) + + cpu_buffer->head_page + = list_entry(cpu_buffer->pages, struct buffer_page, list); +- local_set(&cpu_buffer->head_page->write, 0); +- local_set(&cpu_buffer->head_page->entries, 0); ++ local_set_unchecked(&cpu_buffer->head_page->write, 0); ++ local_set_unchecked(&cpu_buffer->head_page->entries, 0); + local_set(&cpu_buffer->head_page->page->commit, 0); + + cpu_buffer->head_page->read = 0; +@@ -3953,14 +3953,14 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer) + + INIT_LIST_HEAD(&cpu_buffer->reader_page->list); + INIT_LIST_HEAD(&cpu_buffer->new_pages); +- local_set(&cpu_buffer->reader_page->write, 0); +- local_set(&cpu_buffer->reader_page->entries, 0); ++ local_set_unchecked(&cpu_buffer->reader_page->write, 0); ++ local_set_unchecked(&cpu_buffer->reader_page->entries, 0); + local_set(&cpu_buffer->reader_page->page->commit, 0); + cpu_buffer->reader_page->read = 0; + + local_set(&cpu_buffer->entries_bytes, 0); +- local_set(&cpu_buffer->overrun, 0); +- local_set(&cpu_buffer->commit_overrun, 0); ++ local_set_unchecked(&cpu_buffer->overrun, 0); ++ local_set_unchecked(&cpu_buffer->commit_overrun, 0); + local_set(&cpu_buffer->dropped_events, 0); + local_set(&cpu_buffer->entries, 0); + local_set(&cpu_buffer->committing, 0); +@@ -4364,8 +4364,8 @@ int ring_buffer_read_page(struct ring_buffer *buffer, + rb_init_page(bpage); + bpage = reader->page; + reader->page = *data_page; +- local_set(&reader->write, 0); +- local_set(&reader->entries, 0); ++ local_set_unchecked(&reader->write, 0); ++ local_set_unchecked(&reader->entries, 0); + reader->read = 0; + *data_page = bpage; + diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index 55e4d4c..8c915ec 100644 +index 3f28192..a29e8b0 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -4316,10 +4316,9 @@ static const struct file_operations tracing_dyn_info_fops = { +@@ -2893,7 +2893,7 @@ int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set) + return 0; + } + +-int set_tracer_flag(unsigned int mask, int enabled) ++int set_tracer_flag(unsigned long mask, int enabled) + { + /* do nothing if flag is already set */ + if (!!(trace_flags & mask) == !!enabled) +@@ -4637,10 +4637,9 @@ static const struct file_operations tracing_dyn_info_fops = { }; #endif @@ -69890,23 +78905,36 @@ index 55e4d4c..8c915ec 100644 static int once; if (d_tracer) -@@ -4339,10 +4338,9 @@ struct dentry *tracing_init_dentry(void) +@@ -4660,10 +4659,9 @@ struct dentry *tracing_init_dentry(void) return d_tracer; } -static struct dentry *d_percpu; - - struct dentry *tracing_dentry_percpu(void) + static struct dentry *tracing_dentry_percpu(void) { + static struct dentry *d_percpu; static int once; struct dentry *d_tracer; +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 2081971..09f861e 100644 +--- a/kernel/trace/trace.h ++++ b/kernel/trace/trace.h +@@ -948,7 +948,7 @@ extern const char *__stop___trace_bprintk_fmt[]; + void trace_printk_init_buffers(void); + void trace_printk_start_comm(void); + int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set); +-int set_tracer_flag(unsigned int mask, int enabled); ++int set_tracer_flag(unsigned long mask, int enabled); + + #undef FTRACE_ENTRY + #define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter) \ diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c -index 29111da..d190fe2 100644 +index 57e9b28..eebe41c 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c -@@ -1308,10 +1308,6 @@ static LIST_HEAD(ftrace_module_file_list); +@@ -1329,10 +1329,6 @@ static LIST_HEAD(ftrace_module_file_list); struct ftrace_module_file_ops { struct list_head list; struct module *mod; @@ -69917,7 +78945,7 @@ index 29111da..d190fe2 100644 }; static struct ftrace_module_file_ops * -@@ -1332,17 +1328,12 @@ trace_create_file_ops(struct module *mod) +@@ -1353,17 +1349,12 @@ trace_create_file_ops(struct module *mod) file_ops->mod = mod; @@ -69933,15 +78961,15 @@ index 29111da..d190fe2 100644 - file_ops->format = ftrace_event_format_fops; - file_ops->format.owner = mod; + pax_open_kernel(); -+ *(void **)&mod->trace_id.owner = mod; -+ *(void **)&mod->trace_enable.owner = mod; -+ *(void **)&mod->trace_filter.owner = mod; -+ *(void **)&mod->trace_format.owner = mod; ++ mod->trace_id.owner = mod; ++ mod->trace_enable.owner = mod; ++ mod->trace_filter.owner = mod; ++ mod->trace_format.owner = mod; + pax_close_kernel(); list_add(&file_ops->list, &ftrace_module_file_list); -@@ -1366,8 +1357,8 @@ static void trace_module_add_events(struct module *mod) +@@ -1387,8 +1378,8 @@ static void trace_module_add_events(struct module *mod) for_each_event(call, start, end) { __trace_add_event_call(*call, mod, @@ -69952,46 +78980,6 @@ index 29111da..d190fe2 100644 } } -diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c -index 580a05e..9b31acb 100644 ---- a/kernel/trace/trace_kprobe.c -+++ b/kernel/trace/trace_kprobe.c -@@ -217,7 +217,7 @@ static __kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs, - long ret; - int maxlen = get_rloc_len(*(u32 *)dest); - u8 *dst = get_rloc_data(dest); -- u8 *src = addr; -+ const u8 __user *src = (const u8 __force_user *)addr; - mm_segment_t old_fs = get_fs(); - if (!maxlen) - return; -@@ -229,7 +229,7 @@ static __kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs, - pagefault_disable(); - do - ret = __copy_from_user_inatomic(dst++, src++, 1); -- while (dst[-1] && ret == 0 && src - (u8 *)addr < maxlen); -+ while (dst[-1] && ret == 0 && src - (const u8 __force_user *)addr < maxlen); - dst[-1] = '\0'; - pagefault_enable(); - set_fs(old_fs); -@@ -238,7 +238,7 @@ static __kprobes void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs, - ((u8 *)get_rloc_data(dest))[0] = '\0'; - *(u32 *)dest = make_data_rloc(0, get_rloc_offs(*(u32 *)dest)); - } else -- *(u32 *)dest = make_data_rloc(src - (u8 *)addr, -+ *(u32 *)dest = make_data_rloc(src - (const u8 __force_user *)addr, - get_rloc_offs(*(u32 *)dest)); - } - /* Return the length of string -- including null terminal byte */ -@@ -252,7 +252,7 @@ static __kprobes void FETCH_FUNC_NAME(memory, string_size)(struct pt_regs *regs, - set_fs(KERNEL_DS); - pagefault_disable(); - do { -- ret = __copy_from_user_inatomic(&c, (u8 *)addr + len, 1); -+ ret = __copy_from_user_inatomic(&c, (const u8 __force_user *)addr + len, 1); - len++; - } while (c && ret == 0 && len < MAX_STRING_SIZE); - pagefault_enable(); diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index fd3c8aa..5f324a6 100644 --- a/kernel/trace/trace_mmiotrace.c @@ -70033,7 +79021,7 @@ index fd3c8aa..5f324a6 100644 } entry = ring_buffer_event_data(event); diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c -index df611a0..10d8b32 100644 +index 697e88d..1a79993 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -278,7 +278,7 @@ int trace_seq_path(struct trace_seq *s, const struct path *path) @@ -70045,55 +79033,111 @@ index df611a0..10d8b32 100644 if (p) { s->len = p - s->buffer; return 1; +@@ -851,14 +851,16 @@ int register_ftrace_event(struct trace_event *event) + goto out; + } + ++ pax_open_kernel(); + if (event->funcs->trace == NULL) +- event->funcs->trace = trace_nop_print; ++ *(void **)&event->funcs->trace = trace_nop_print; + if (event->funcs->raw == NULL) +- event->funcs->raw = trace_nop_print; ++ *(void **)&event->funcs->raw = trace_nop_print; + if (event->funcs->hex == NULL) +- event->funcs->hex = trace_nop_print; ++ *(void **)&event->funcs->hex = trace_nop_print; + if (event->funcs->binary == NULL) +- event->funcs->binary = trace_nop_print; ++ *(void **)&event->funcs->binary = trace_nop_print; ++ pax_close_kernel(); + + key = event->type & (EVENT_HASHSIZE - 1); + diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c -index d4545f4..a9010a1 100644 +index b20428c..4845a10 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c -@@ -53,7 +53,7 @@ static inline void check_stack(void) +@@ -68,7 +68,7 @@ check_stack(unsigned long ip, unsigned long *stack) return; /* we do not handle interrupt stacks yet */ -- if (!object_is_on_stack(&this_size)) -+ if (!object_starts_on_stack(&this_size)) +- if (!object_is_on_stack(stack)) ++ if (!object_starts_on_stack(stack)) return; local_irq_save(flags); -diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c -index 209b379..7f76423 100644 ---- a/kernel/trace/trace_workqueue.c -+++ b/kernel/trace/trace_workqueue.c -@@ -22,7 +22,7 @@ struct cpu_workqueue_stats { - int cpu; - pid_t pid; - /* Can be inserted from interrupt or user context, need to be atomic */ -- atomic_t inserted; -+ atomic_unchecked_t inserted; - /* - * Don't need to be atomic, works are serialized in a single workqueue thread - * on a single CPU. -@@ -60,7 +60,7 @@ probe_workqueue_insertion(void *ignore, - spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags); - list_for_each_entry(node, &workqueue_cpu_stat(cpu)->list, list) { - if (node->pid == wq_thread->pid) { -- atomic_inc(&node->inserted); -+ atomic_inc_unchecked(&node->inserted); - goto found; - } - } -@@ -210,7 +210,7 @@ static int workqueue_stat_show(struct seq_file *s, void *p) - tsk = get_pid_task(pid, PIDTYPE_PID); - if (tsk) { - seq_printf(s, "%3d %6d %6u %s\n", cws->cpu, -- atomic_read(&cws->inserted), cws->executed, -+ atomic_read_unchecked(&cws->inserted), cws->executed, - tsk->comm); - put_task_struct(tsk); - } +diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c +index e134d8f..a018cdd 100644 +--- a/kernel/user_namespace.c ++++ b/kernel/user_namespace.c +@@ -853,7 +853,7 @@ static int userns_install(struct nsproxy *nsproxy, void *ns) + if (atomic_read(¤t->mm->mm_users) > 1) + return -EINVAL; + +- if (current->fs->users != 1) ++ if (atomic_read(¤t->fs->users) != 1) + return -EINVAL; + + if (!ns_capable(user_ns, CAP_SYS_ADMIN)) +diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c +index 4f69f9a..7c6f8f8 100644 +--- a/kernel/utsname_sysctl.c ++++ b/kernel/utsname_sysctl.c +@@ -47,7 +47,7 @@ static void put_uts(ctl_table *table, int write, void *which) + static int proc_do_uts_string(ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- struct ctl_table uts_table; ++ ctl_table_no_const uts_table; + int r; + memcpy(&uts_table, table, sizeof(uts_table)); + uts_table.data = get_uts(table, write); +diff --git a/kernel/watchdog.c b/kernel/watchdog.c +index 4a94467..80a6f9c 100644 +--- a/kernel/watchdog.c ++++ b/kernel/watchdog.c +@@ -526,7 +526,7 @@ int proc_dowatchdog(struct ctl_table *table, int write, + } + #endif /* CONFIG_SYSCTL */ + +-static struct smp_hotplug_thread watchdog_threads = { ++static struct smp_hotplug_thread watchdog_threads __read_only = { + .store = &softlockup_watchdog, + .thread_should_run = watchdog_should_run, + .thread_fn = watchdog, diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug -index 6777153..8519f60 100644 +index 28be08c..47bab92 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug -@@ -1132,6 +1132,7 @@ config LATENCYTOP +@@ -549,7 +549,7 @@ config DEBUG_MUTEXES + + config DEBUG_LOCK_ALLOC + bool "Lock debugging: detect incorrect freeing of live locks" +- depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT ++ depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT && !PAX_CONSTIFY_PLUGIN + select DEBUG_SPINLOCK + select DEBUG_MUTEXES + select LOCKDEP +@@ -563,7 +563,7 @@ config DEBUG_LOCK_ALLOC + + config PROVE_LOCKING + bool "Lock debugging: prove locking correctness" +- depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT ++ depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT && !PAX_CONSTIFY_PLUGIN + select LOCKDEP + select DEBUG_SPINLOCK + select DEBUG_MUTEXES +@@ -614,7 +614,7 @@ config LOCKDEP + + config LOCK_STAT + bool "Lock usage statistics" +- depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT ++ depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT && !PAX_CONSTIFY_PLUGIN + select LOCKDEP + select DEBUG_SPINLOCK + select DEBUG_MUTEXES +@@ -1282,6 +1282,7 @@ config LATENCYTOP depends on DEBUG_KERNEL depends on STACKTRACE_SUPPORT depends on PROC_FS @@ -70101,11 +79145,42 @@ index 6777153..8519f60 100644 select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND select KALLSYMS select KALLSYMS_ALL +@@ -1310,7 +1311,7 @@ config INTERVAL_TREE_TEST + + config PROVIDE_OHCI1394_DMA_INIT + bool "Remote debugging over FireWire early on boot" +- depends on PCI && X86 ++ depends on PCI && X86 && !GRKERNSEC + help + If you want to debug problems which hang or crash the kernel early + on boot and the crashing machine has a FireWire port, you can use +@@ -1339,7 +1340,7 @@ config PROVIDE_OHCI1394_DMA_INIT + + config FIREWIRE_OHCI_REMOTE_DMA + bool "Remote debugging over FireWire with firewire-ohci" +- depends on FIREWIRE_OHCI ++ depends on FIREWIRE_OHCI && !GRKERNSEC + help + This option lets you use the FireWire bus for remote debugging + with help of the firewire-ohci driver. It enables unfiltered +diff --git a/lib/Makefile b/lib/Makefile +index 6e2cc56..9b13738 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -47,7 +47,7 @@ obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o + + obj-$(CONFIG_BTREE) += btree.o + obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o +-obj-$(CONFIG_DEBUG_LIST) += list_debug.o ++obj-y += list_debug.o + obj-$(CONFIG_DEBUG_OBJECTS) += debugobjects.o + + ifneq ($(CONFIG_HAVE_DEC_LOCK),y) diff --git a/lib/bitmap.c b/lib/bitmap.c -index b5a8b6a..a69623c 100644 +index 06f7e4f..f3cf2b0 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c -@@ -421,7 +421,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen, +@@ -422,7 +422,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen, { int c, old_c, totaldigits, ndigits, nchunks, nbits; u32 chunk; @@ -70114,7 +79189,7 @@ index b5a8b6a..a69623c 100644 bitmap_zero(maskp, nmaskbits); -@@ -506,7 +506,7 @@ int bitmap_parse_user(const char __user *ubuf, +@@ -507,7 +507,7 @@ int bitmap_parse_user(const char __user *ubuf, { if (!access_ok(VERIFY_READ, ubuf, ulen)) return -EFAULT; @@ -70142,10 +79217,10 @@ index b5a8b6a..a69623c 100644 } EXPORT_SYMBOL(bitmap_parselist_user); diff --git a/lib/bug.c b/lib/bug.c -index a28c141..2bd3d95 100644 +index 1686034..a9c00c8 100644 --- a/lib/bug.c +++ b/lib/bug.c -@@ -133,6 +133,8 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) +@@ -134,6 +134,8 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) return BUG_TRAP_TYPE_NONE; bug = find_bug(bugaddr); @@ -70155,10 +79230,10 @@ index a28c141..2bd3d95 100644 file = NULL; line = 0; diff --git a/lib/debugobjects.c b/lib/debugobjects.c -index 0ab9ae8..f01ceca 100644 +index 37061ed..da83f48 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c -@@ -288,7 +288,7 @@ static void debug_object_is_on_stack(void *addr, int onstack) +@@ -286,7 +286,7 @@ static void debug_object_is_on_stack(void *addr, int onstack) if (limit > 4) return; @@ -70168,10 +79243,10 @@ index 0ab9ae8..f01ceca 100644 return; diff --git a/lib/devres.c b/lib/devres.c -index 80b9c76..9e32279 100644 +index 8235331..5881053 100644 --- a/lib/devres.c +++ b/lib/devres.c -@@ -80,7 +80,7 @@ EXPORT_SYMBOL(devm_ioremap_nocache); +@@ -81,7 +81,7 @@ EXPORT_SYMBOL(devm_ioremap_nocache); void devm_iounmap(struct device *dev, void __iomem *addr) { WARN_ON(devres_destroy(dev, devm_ioremap_release, devm_ioremap_match, @@ -70180,7 +79255,7 @@ index 80b9c76..9e32279 100644 iounmap(addr); } EXPORT_SYMBOL(devm_iounmap); -@@ -192,7 +192,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr) +@@ -224,7 +224,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr) { ioport_unmap(addr); WARN_ON(devres_destroy(dev, devm_ioport_map_release, @@ -70188,12 +79263,43 @@ index 80b9c76..9e32279 100644 + devm_ioport_map_match, (void __force *)addr)); } EXPORT_SYMBOL(devm_ioport_unmap); - + #endif /* CONFIG_HAS_IOPORT */ +diff --git a/lib/div64.c b/lib/div64.c +index a163b6c..9618fa5 100644 +--- a/lib/div64.c ++++ b/lib/div64.c +@@ -59,7 +59,7 @@ uint32_t __attribute__((weak)) __div64_32(uint64_t *n, uint32_t base) + EXPORT_SYMBOL(__div64_32); + + #ifndef div_s64_rem +-s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) ++s64 __intentional_overflow(-1) div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) + { + u64 quotient; + +@@ -90,7 +90,7 @@ EXPORT_SYMBOL(div_s64_rem); + * 'http://www.hackersdelight.org/HDcode/newCode/divDouble.c.txt' + */ + #ifndef div64_u64 +-u64 div64_u64(u64 dividend, u64 divisor) ++u64 __intentional_overflow(-1) div64_u64(u64 dividend, u64 divisor) + { + u32 high = divisor >> 32; + u64 quot; diff --git a/lib/dma-debug.c b/lib/dma-debug.c -index 13ef233..5241683 100644 +index d87a17a..ac0d79a 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c -@@ -924,7 +924,7 @@ out: +@@ -768,7 +768,7 @@ static int dma_debug_device_change(struct notifier_block *nb, unsigned long acti + + void dma_debug_add_bus(struct bus_type *bus) + { +- struct notifier_block *nb; ++ notifier_block_no_const *nb; + + if (global_disable) + return; +@@ -945,7 +945,7 @@ static void check_unmap(struct dma_debug_entry *ref) static void check_for_stack(struct device *dev, void *addr) { @@ -70202,29 +79308,6 @@ index 13ef233..5241683 100644 err_printk(dev, NULL, "DMA-API: device driver maps memory from" "stack [addr=%p]\n", addr); } -diff --git a/lib/extable.c b/lib/extable.c -index 4cac81e..63e9b8f 100644 ---- a/lib/extable.c -+++ b/lib/extable.c -@@ -13,6 +13,7 @@ - #include <linux/init.h> - #include <linux/sort.h> - #include <asm/uaccess.h> -+#include <asm/pgtable.h> - - #ifndef ARCH_HAS_SORT_EXTABLE - /* -@@ -36,8 +37,10 @@ static int cmp_ex(const void *a, const void *b) - void sort_extable(struct exception_table_entry *start, - struct exception_table_entry *finish) - { -+ pax_open_kernel(); - sort(start, finish - start, sizeof(struct exception_table_entry), - cmp_ex, NULL); -+ pax_close_kernel(); - } - - #ifdef CONFIG_MODULES diff --git a/lib/inflate.c b/lib/inflate.c index 013a761..c28f3fc 100644 --- a/lib/inflate.c @@ -70274,21 +79357,252 @@ index bd2bea9..6b3c95e 100644 if (atomic_read(&task->signal->live) != 1) return false; +diff --git a/lib/kobject.c b/lib/kobject.c +index a654866..a4fd13d 100644 +--- a/lib/kobject.c ++++ b/lib/kobject.c +@@ -859,9 +859,9 @@ EXPORT_SYMBOL_GPL(kset_create_and_add); + + + static DEFINE_SPINLOCK(kobj_ns_type_lock); +-static const struct kobj_ns_type_operations *kobj_ns_ops_tbl[KOBJ_NS_TYPES]; ++static const struct kobj_ns_type_operations *kobj_ns_ops_tbl[KOBJ_NS_TYPES] __read_only; + +-int kobj_ns_type_register(const struct kobj_ns_type_operations *ops) ++int __init kobj_ns_type_register(const struct kobj_ns_type_operations *ops) + { + enum kobj_ns_type type = ops->type; + int error; +diff --git a/lib/list_debug.c b/lib/list_debug.c +index c24c2f7..06e070b 100644 +--- a/lib/list_debug.c ++++ b/lib/list_debug.c +@@ -11,7 +11,9 @@ + #include <linux/bug.h> + #include <linux/kernel.h> + #include <linux/rculist.h> ++#include <linux/mm.h> + ++#ifdef CONFIG_DEBUG_LIST + /* + * Insert a new entry between two known consecutive entries. + * +@@ -19,21 +21,32 @@ + * the prev/next entries already! + */ + +-void __list_add(struct list_head *new, +- struct list_head *prev, +- struct list_head *next) ++static bool __list_add_debug(struct list_head *new, ++ struct list_head *prev, ++ struct list_head *next) + { +- WARN(next->prev != prev, ++ if (WARN(next->prev != prev, + "list_add corruption. next->prev should be " + "prev (%p), but was %p. (next=%p).\n", +- prev, next->prev, next); +- WARN(prev->next != next, ++ prev, next->prev, next) || ++ WARN(prev->next != next, + "list_add corruption. prev->next should be " + "next (%p), but was %p. (prev=%p).\n", +- next, prev->next, prev); +- WARN(new == prev || new == next, +- "list_add double add: new=%p, prev=%p, next=%p.\n", +- new, prev, next); ++ next, prev->next, prev) || ++ WARN(new == prev || new == next, ++ "list_add double add: new=%p, prev=%p, next=%p.\n", ++ new, prev, next)) ++ return false; ++ return true; ++} ++ ++void __list_add(struct list_head *new, ++ struct list_head *prev, ++ struct list_head *next) ++{ ++ if (!__list_add_debug(new, prev, next)) ++ return; ++ + next->prev = new; + new->next = next; + new->prev = prev; +@@ -41,7 +54,7 @@ void __list_add(struct list_head *new, + } + EXPORT_SYMBOL(__list_add); + +-void __list_del_entry(struct list_head *entry) ++static bool __list_del_entry_debug(struct list_head *entry) + { + struct list_head *prev, *next; + +@@ -60,9 +73,16 @@ void __list_del_entry(struct list_head *entry) + WARN(next->prev != entry, + "list_del corruption. next->prev should be %p, " + "but was %p\n", entry, next->prev)) ++ return false; ++ return true; ++} ++ ++void __list_del_entry(struct list_head *entry) ++{ ++ if (!__list_del_entry_debug(entry)) + return; + +- __list_del(prev, next); ++ __list_del(entry->prev, entry->next); + } + EXPORT_SYMBOL(__list_del_entry); + +@@ -86,15 +106,85 @@ EXPORT_SYMBOL(list_del); + void __list_add_rcu(struct list_head *new, + struct list_head *prev, struct list_head *next) + { +- WARN(next->prev != prev, +- "list_add_rcu corruption. next->prev should be prev (%p), but was %p. (next=%p).\n", +- prev, next->prev, next); +- WARN(prev->next != next, +- "list_add_rcu corruption. prev->next should be next (%p), but was %p. (prev=%p).\n", +- next, prev->next, prev); ++ if (!__list_add_debug(new, prev, next)) ++ return; ++ + new->next = next; + new->prev = prev; + rcu_assign_pointer(list_next_rcu(prev), new); + next->prev = new; + } + EXPORT_SYMBOL(__list_add_rcu); ++#endif ++ ++void __pax_list_add(struct list_head *new, struct list_head *prev, struct list_head *next) ++{ ++#ifdef CONFIG_DEBUG_LIST ++ if (!__list_add_debug(new, prev, next)) ++ return; ++#endif ++ ++ pax_open_kernel(); ++ next->prev = new; ++ new->next = next; ++ new->prev = prev; ++ prev->next = new; ++ pax_close_kernel(); ++} ++EXPORT_SYMBOL(__pax_list_add); ++ ++void pax_list_del(struct list_head *entry) ++{ ++#ifdef CONFIG_DEBUG_LIST ++ if (!__list_del_entry_debug(entry)) ++ return; ++#endif ++ ++ pax_open_kernel(); ++ __list_del(entry->prev, entry->next); ++ entry->next = LIST_POISON1; ++ entry->prev = LIST_POISON2; ++ pax_close_kernel(); ++} ++EXPORT_SYMBOL(pax_list_del); ++ ++void pax_list_del_init(struct list_head *entry) ++{ ++ pax_open_kernel(); ++ __list_del(entry->prev, entry->next); ++ INIT_LIST_HEAD(entry); ++ pax_close_kernel(); ++} ++EXPORT_SYMBOL(pax_list_del_init); ++ ++void __pax_list_add_rcu(struct list_head *new, ++ struct list_head *prev, struct list_head *next) ++{ ++#ifdef CONFIG_DEBUG_LIST ++ if (!__list_add_debug(new, prev, next)) ++ return; ++#endif ++ ++ pax_open_kernel(); ++ new->next = next; ++ new->prev = prev; ++ rcu_assign_pointer(list_next_rcu(prev), new); ++ next->prev = new; ++ pax_close_kernel(); ++} ++EXPORT_SYMBOL(__pax_list_add_rcu); ++ ++void pax_list_del_rcu(struct list_head *entry) ++{ ++#ifdef CONFIG_DEBUG_LIST ++ if (!__list_del_entry_debug(entry)) ++ return; ++#endif ++ ++ pax_open_kernel(); ++ __list_del(entry->prev, entry->next); ++ entry->next = LIST_POISON1; ++ entry->prev = LIST_POISON2; ++ pax_close_kernel(); ++} ++EXPORT_SYMBOL(pax_list_del_rcu); diff --git a/lib/radix-tree.c b/lib/radix-tree.c -index 3ac50dc..240bb7e 100644 +index e796429..6e38f9f 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c -@@ -79,7 +79,7 @@ struct radix_tree_preload { +@@ -92,7 +92,7 @@ struct radix_tree_preload { int nr; - struct radix_tree_node *nodes[RADIX_TREE_MAX_PATH]; + struct radix_tree_node *nodes[RADIX_TREE_PRELOAD_SIZE]; }; -static DEFINE_PER_CPU(struct radix_tree_preload, radix_tree_preloads) = { 0, }; +static DEFINE_PER_CPU(struct radix_tree_preload, radix_tree_preloads); static inline void *ptr_to_indirect(void *ptr) { +diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c +index bb2b201..46abaf9 100644 +--- a/lib/strncpy_from_user.c ++++ b/lib/strncpy_from_user.c +@@ -21,7 +21,7 @@ + */ + static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, unsigned long max) + { +- const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; ++ static const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; + long res = 0; + + /* +diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c +index a28df52..3d55877 100644 +--- a/lib/strnlen_user.c ++++ b/lib/strnlen_user.c +@@ -26,7 +26,7 @@ + */ + static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max) + { +- const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; ++ static const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; + long align, res = 0; + unsigned long c; + +diff --git a/lib/swiotlb.c b/lib/swiotlb.c +index d23762e..e21eab2 100644 +--- a/lib/swiotlb.c ++++ b/lib/swiotlb.c +@@ -664,7 +664,7 @@ EXPORT_SYMBOL(swiotlb_alloc_coherent); + + void + swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, +- dma_addr_t dev_addr) ++ dma_addr_t dev_addr, struct dma_attrs *attrs) + { + phys_addr_t paddr = dma_to_phys(hwdev, dev_addr); + diff --git a/lib/vsprintf.c b/lib/vsprintf.c -index abbabec..6779788 100644 +index 0d62fd7..b7bc911 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -16,6 +16,9 @@ @@ -70301,16 +79615,7 @@ index abbabec..6779788 100644 #include <stdarg.h> #include <linux/module.h> /* for KSYM_SYMBOL_LEN */ #include <linux/types.h> -@@ -433,7 +436,7 @@ char *symbol_string(char *buf, char *end, void *ptr, - char sym[KSYM_SYMBOL_LEN]; - if (ext == 'B') - sprint_backtrace(sym, value); -- else if (ext != 'f' && ext != 's') -+ else if (ext != 'f' && ext != 's' && ext != 'a') - sprint_symbol(sym, value); - else - kallsyms_lookup(value, NULL, NULL, NULL, sym); -@@ -809,7 +812,11 @@ char *netdev_feature_string(char *buf, char *end, const u8 *addr, +@@ -974,7 +977,11 @@ char *netdev_feature_string(char *buf, char *end, const u8 *addr, return number(buf, end, *(const netdev_features_t *)addr, spec); } @@ -70322,7 +79627,7 @@ index abbabec..6779788 100644 /* * Show a '%p' thing. A kernel extension is that the '%p' is followed -@@ -823,6 +830,8 @@ int kptr_restrict __read_mostly; +@@ -988,6 +995,8 @@ int kptr_restrict __read_mostly; * - 'S' For symbolic direct pointers with offset * - 's' For symbolic direct pointers without offset * - 'B' For backtraced symbolic direct pointers with offset @@ -70331,8 +79636,8 @@ index abbabec..6779788 100644 * - 'R' For decoded struct resource, e.g., [mem 0x0-0x1f 64bit pref] * - 'r' For raw struct resource, e.g., [mem 0x0-0x1f flags 0x201] * - 'M' For a 6-byte MAC address, it prints the address in the -@@ -868,12 +877,12 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, - { +@@ -1044,12 +1053,12 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, + if (!ptr && *fmt != 'K') { /* - * Print (null) with the same width as a pointer so it makes @@ -70340,13 +79645,13 @@ index abbabec..6779788 100644 * tabular output look nice. */ if (spec.field_width == -1) - spec.field_width = 2 * sizeof(void *); + spec.field_width = default_width; - return string(buf, end, "(null)", spec); + return string(buf, end, "(nil)", spec); } switch (*fmt) { -@@ -883,6 +892,13 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, +@@ -1059,6 +1068,12 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, /* Fallthrough */ case 'S': case 's': @@ -70356,11 +79661,10 @@ index abbabec..6779788 100644 + return symbol_string(buf, end, ptr, spec, *fmt); +#endif + case 'A': -+ case 'a': case 'B': return symbol_string(buf, end, ptr, spec, *fmt); case 'R': -@@ -920,12 +936,15 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, +@@ -1099,6 +1114,8 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, va_end(va); return buf; } @@ -70369,25 +79673,19 @@ index abbabec..6779788 100644 case 'K': /* * %pK cannot be used in IRQ context because its test - * for CAP_SYSLOG would be meaningless. - */ -- if (in_irq() || in_serving_softirq() || in_nmi()) { -+ if (kptr_restrict && (in_irq() || in_serving_softirq() || -+ in_nmi())) { - if (spec.field_width == -1) - spec.field_width = 2 * sizeof(void *); - return string(buf, end, "pK-error", spec); -@@ -942,6 +961,19 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, - } - break; +@@ -1128,6 +1145,21 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, + return number(buf, end, + (unsigned long long) *((phys_addr_t *)ptr), spec); } + +#ifdef CONFIG_GRKERNSEC_HIDESYM + /* 'P' = approved pointers to copy to userland, + as in the /proc/kallsyms case, as we make it display nothing + for non-root users, and the real contents for root users ++ Also ignore 'K' pointers, since we force their NULLing for non-root users ++ above + */ -+ if (ptr > TASK_SIZE && *fmt != 'P' && is_usercopy_object(buf)) { ++ if ((unsigned long)ptr > TASK_SIZE && *fmt != 'P' && *fmt != 'K' && is_usercopy_object(buf)) { + printk(KERN_ALERT "grsec: kernel infoleak detected! Please report this log to spender@grsecurity.net.\n"); + dump_stack(); + ptr = NULL; @@ -70396,8 +79694,8 @@ index abbabec..6779788 100644 + spec.flags |= SMALL; if (spec.field_width == -1) { - spec.field_width = 2 * sizeof(void *); -@@ -1653,11 +1685,11 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) + spec.field_width = default_width; +@@ -1849,11 +1881,11 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) typeof(type) value; \ if (sizeof(type) == 8) { \ args = PTR_ALIGN(args, sizeof(u32)); \ @@ -70412,7 +79710,7 @@ index abbabec..6779788 100644 } \ args += sizeof(type); \ value; \ -@@ -1720,7 +1752,7 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) +@@ -1916,7 +1948,7 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) case FORMAT_TYPE_STR: { const char *str_arg = args; args += strlen(str_arg) + 1; @@ -70429,10 +79727,10 @@ index 0000000..7cd6065 @@ -0,0 +1 @@ +-grsec diff --git a/mm/Kconfig b/mm/Kconfig -index e338407..4210331 100644 +index 3bea74f..e821c99 100644 --- a/mm/Kconfig +++ b/mm/Kconfig -@@ -247,10 +247,10 @@ config KSM +@@ -311,10 +311,10 @@ config KSM root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set). config DEFAULT_MMAP_MIN_ADDR @@ -70446,7 +79744,7 @@ index e338407..4210331 100644 This is the portion of low virtual memory which should be protected from userspace allocation. Keeping a user from writing to low pages can help reduce the impact of kernel NULL pointer bugs. -@@ -280,7 +280,7 @@ config MEMORY_FAILURE +@@ -345,7 +345,7 @@ config MEMORY_FAILURE config HWPOISON_INJECT tristate "HWPoison pages injector" @@ -70456,10 +79754,10 @@ index e338407..4210331 100644 config NOMMU_INITIAL_TRIM_EXCESS diff --git a/mm/filemap.c b/mm/filemap.c -index 79c4b2b..596b417 100644 +index e1979fd..dda5120 100644 --- a/mm/filemap.c +++ b/mm/filemap.c -@@ -1762,7 +1762,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma) +@@ -1748,7 +1748,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma) struct address_space *mapping = file->f_mapping; if (!mapping->a_ops->readpage) @@ -70467,8 +79765,8 @@ index 79c4b2b..596b417 100644 + return -ENODEV; file_accessed(file); vma->vm_ops = &generic_file_vm_ops; - vma->vm_flags |= VM_CAN_NONLINEAR; -@@ -2168,6 +2168,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i + return 0; +@@ -2088,6 +2088,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i *pos = i_size_read(inode); if (limit != RLIM_INFINITY) { @@ -70477,10 +79775,10 @@ index 79c4b2b..596b417 100644 send_sig(SIGXFSZ, current, 0); return -EFBIG; diff --git a/mm/fremap.c b/mm/fremap.c -index 9ed4fd4..c42648d 100644 +index 87da359..3f41cb1 100644 --- a/mm/fremap.c +++ b/mm/fremap.c -@@ -155,6 +155,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, +@@ -158,6 +158,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, retry: vma = find_vma(mm, start); @@ -70493,22 +79791,21 @@ index 9ed4fd4..c42648d 100644 * Make sure the vma is shared, that it supports prefaulting, * and that the remapped range is valid and fully within diff --git a/mm/highmem.c b/mm/highmem.c -index 57d82c6..e9e0552 100644 +index b32b70c..e512eb0 100644 --- a/mm/highmem.c +++ b/mm/highmem.c -@@ -125,9 +125,10 @@ static void flush_all_zero_pkmaps(void) +@@ -138,8 +138,9 @@ static void flush_all_zero_pkmaps(void) * So no dangers, even with speculative execution. */ page = pte_page(pkmap_page_table[i]); + pax_open_kernel(); - pte_clear(&init_mm, (unsigned long)page_address(page), - &pkmap_page_table[i]); + pte_clear(&init_mm, PKMAP_ADDR(i), &pkmap_page_table[i]); - + pax_close_kernel(); set_page_address(page, NULL); need_flush = 1; } -@@ -186,9 +187,11 @@ start: +@@ -198,9 +199,11 @@ start: } } vaddr = PKMAP_ADDR(last_pkmap_nr); @@ -70521,24 +79818,53 @@ index 57d82c6..e9e0552 100644 pkmap_count[last_pkmap_nr] = 1; set_page_address(page, (void *)vaddr); -diff --git a/mm/huge_memory.c b/mm/huge_memory.c -index f0e5306..cb9398e 100644 ---- a/mm/huge_memory.c -+++ b/mm/huge_memory.c -@@ -733,7 +733,7 @@ out: - * run pte_offset_map on the pmd, if an huge pmd could - * materialize from under us from a different thread. - */ -- if (unlikely(__pte_alloc(mm, vma, pmd, address))) -+ if (unlikely(pmd_none(*pmd) && __pte_alloc(mm, vma, pmd, address))) - return VM_FAULT_OOM; - /* if an huge pmd materialized from under us just retry later */ - if (unlikely(pmd_trans_huge(*pmd))) diff --git a/mm/hugetlb.c b/mm/hugetlb.c -index a799df5..a987032 100644 +index 1a12f5b..a85b8fc 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c -@@ -2462,6 +2462,27 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2005,15 +2005,17 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy, + struct hstate *h = &default_hstate; + unsigned long tmp; + int ret; ++ ctl_table_no_const hugetlb_table; + + tmp = h->max_huge_pages; + + if (write && h->order >= MAX_ORDER) + return -EINVAL; + +- table->data = &tmp; +- table->maxlen = sizeof(unsigned long); +- ret = proc_doulongvec_minmax(table, write, buffer, length, ppos); ++ hugetlb_table = *table; ++ hugetlb_table.data = &tmp; ++ hugetlb_table.maxlen = sizeof(unsigned long); ++ ret = proc_doulongvec_minmax(&hugetlb_table, write, buffer, length, ppos); + if (ret) + goto out; + +@@ -2070,15 +2072,17 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write, + struct hstate *h = &default_hstate; + unsigned long tmp; + int ret; ++ ctl_table_no_const hugetlb_table; + + tmp = h->nr_overcommit_huge_pages; + + if (write && h->order >= MAX_ORDER) + return -EINVAL; + +- table->data = &tmp; +- table->maxlen = sizeof(unsigned long); +- ret = proc_doulongvec_minmax(table, write, buffer, length, ppos); ++ hugetlb_table = *table; ++ hugetlb_table.data = &tmp; ++ hugetlb_table.maxlen = sizeof(unsigned long); ++ ret = proc_doulongvec_minmax(&hugetlb_table, write, buffer, length, ppos); + if (ret) + goto out; + +@@ -2512,6 +2516,27 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma, return 1; } @@ -70566,7 +79892,7 @@ index a799df5..a987032 100644 /* * Hugetlb_cow() should be called with page lock of the original hugepage held. * Called with hugetlb_instantiation_mutex held and pte_page locked so we -@@ -2574,6 +2595,11 @@ retry_avoidcopy: +@@ -2630,6 +2655,11 @@ retry_avoidcopy: make_huge_pte(vma, new_page, 1)); page_remove_rmap(old_page); hugepage_add_new_anon_rmap(new_page, vma, address); @@ -70577,8 +79903,8 @@ index a799df5..a987032 100644 + /* Make the old page be freed below */ new_page = old_page; - mmu_notifier_invalidate_range_end(mm, -@@ -2728,6 +2754,10 @@ retry: + } +@@ -2788,6 +2818,10 @@ retry: && (vma->vm_flags & VM_SHARED))); set_huge_pte_at(mm, address, ptep, new_pte); @@ -70589,7 +79915,7 @@ index a799df5..a987032 100644 if ((flags & FAULT_FLAG_WRITE) && !(vma->vm_flags & VM_SHARED)) { /* Optimization, do the COW without a second fault */ ret = hugetlb_cow(mm, vma, address, ptep, new_pte, page); -@@ -2757,6 +2787,10 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2817,6 +2851,10 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, static DEFINE_MUTEX(hugetlb_instantiation_mutex); struct hstate *h = hstate_vma(vma); @@ -70600,8 +79926,8 @@ index a799df5..a987032 100644 address &= huge_page_mask(h); ptep = huge_pte_offset(mm, address); -@@ -2770,6 +2804,26 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, - VM_FAULT_SET_HINDEX(h - hstates); +@@ -2830,6 +2868,26 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, + VM_FAULT_SET_HINDEX(hstate_index(h)); } +#ifdef CONFIG_PAX_SEGMEXEC @@ -70628,10 +79954,10 @@ index a799df5..a987032 100644 if (!ptep) return VM_FAULT_OOM; diff --git a/mm/internal.h b/mm/internal.h -index 2189af4..f2ca332 100644 +index 8562de0..7fdfe92 100644 --- a/mm/internal.h +++ b/mm/internal.h -@@ -95,6 +95,7 @@ extern void putback_lru_page(struct page *page); +@@ -100,6 +100,7 @@ extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address); * in mm/page_alloc.c */ extern void __free_pages_bootmem(struct page *page, unsigned int order); @@ -70640,7 +79966,7 @@ index 2189af4..f2ca332 100644 #ifdef CONFIG_MEMORY_FAILURE extern bool is_free_buddy_page(struct page *page); diff --git a/mm/kmemleak.c b/mm/kmemleak.c -index 45eb621..6ccd8ea 100644 +index c8d7f31..2dbeffd 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -363,7 +363,7 @@ static void print_unreferenced(struct seq_file *seq, @@ -70648,10 +79974,19 @@ index 45eb621..6ccd8ea 100644 for (i = 0; i < object->trace_len; i++) { void *ptr = (void *)object->trace[i]; - seq_printf(seq, " [<%p>] %pS\n", ptr, ptr); -+ seq_printf(seq, " [<%p>] %pA\n", ptr, ptr); ++ seq_printf(seq, " [<%pP>] %pA\n", ptr, ptr); } } +@@ -1851,7 +1851,7 @@ static int __init kmemleak_late_init(void) + return -ENOMEM; + } + +- dentry = debugfs_create_file("kmemleak", S_IRUGO, NULL, NULL, ++ dentry = debugfs_create_file("kmemleak", S_IRUSR, NULL, NULL, + &kmemleak_fops); + if (!dentry) + pr_warning("Failed to create the debugfs kmemleak file\n"); diff --git a/mm/maccess.c b/mm/maccess.c index d53adf9..03a24bf 100644 --- a/mm/maccess.c @@ -70675,10 +80010,10 @@ index d53adf9..03a24bf 100644 set_fs(old_fs); diff --git a/mm/madvise.c b/mm/madvise.c -index 55f645c..cde5320 100644 +index c58c94b..86ec14e 100644 --- a/mm/madvise.c +++ b/mm/madvise.c -@@ -46,6 +46,10 @@ static long madvise_behavior(struct vm_area_struct * vma, +@@ -51,6 +51,10 @@ static long madvise_behavior(struct vm_area_struct * vma, pgoff_t pgoff; unsigned long new_flags = vma->vm_flags; @@ -70689,7 +80024,7 @@ index 55f645c..cde5320 100644 switch (behavior) { case MADV_NORMAL: new_flags = new_flags & ~VM_RAND_READ & ~VM_SEQ_READ; -@@ -117,6 +121,13 @@ success: +@@ -126,6 +130,13 @@ success: /* * vm_flags is protected by the mmap_sem held in write mode. */ @@ -70703,7 +80038,7 @@ index 55f645c..cde5320 100644 vma->vm_flags = new_flags; out: -@@ -175,6 +186,11 @@ static long madvise_dontneed(struct vm_area_struct * vma, +@@ -274,6 +285,11 @@ static long madvise_dontneed(struct vm_area_struct * vma, struct vm_area_struct ** prev, unsigned long start, unsigned long end) { @@ -70715,7 +80050,7 @@ index 55f645c..cde5320 100644 *prev = vma; if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP)) return -EINVAL; -@@ -187,6 +203,21 @@ static long madvise_dontneed(struct vm_area_struct * vma, +@@ -286,6 +302,21 @@ static long madvise_dontneed(struct vm_area_struct * vma, zap_page_range(vma, start, end - start, &details); } else zap_page_range(vma, start, end - start, NULL); @@ -70737,7 +80072,7 @@ index 55f645c..cde5320 100644 return 0; } -@@ -394,6 +425,16 @@ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) +@@ -491,6 +522,16 @@ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) if (end < start) goto out; @@ -70755,15 +80090,15 @@ index 55f645c..cde5320 100644 if (end == start) goto out; diff --git a/mm/memory-failure.c b/mm/memory-failure.c -index 274c3cc..4836a70 100644 +index df0694c..bc95539 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -61,7 +61,7 @@ int sysctl_memory_failure_early_kill __read_mostly = 0; int sysctl_memory_failure_recovery __read_mostly = 1; --atomic_long_t mce_bad_pages __read_mostly = ATOMIC_LONG_INIT(0); -+atomic_long_unchecked_t mce_bad_pages __read_mostly = ATOMIC_LONG_INIT(0); +-atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0); ++atomic_long_unchecked_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0); #if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE) @@ -70776,79 +80111,115 @@ index 274c3cc..4836a70 100644 #ifdef __ARCH_SI_TRAPNO si.si_trapno = trapno; #endif -@@ -1038,7 +1038,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags) - } - - nr_pages = 1 << compound_trans_order(hpage); -- atomic_long_add(nr_pages, &mce_bad_pages); -+ atomic_long_add_unchecked(nr_pages, &mce_bad_pages); +@@ -760,7 +760,7 @@ static struct page_state { + unsigned long res; + char *msg; + int (*action)(struct page *p, unsigned long pfn); +-} error_states[] = { ++} __do_const error_states[] = { + { reserved, reserved, "reserved kernel", me_kernel }, + /* + * free pages are specially detected outside this table: +@@ -1051,7 +1051,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags) + nr_pages = 1 << compound_order(hpage); + else /* normal page or thp */ + nr_pages = 1; +- atomic_long_add(nr_pages, &num_poisoned_pages); ++ atomic_long_add_unchecked(nr_pages, &num_poisoned_pages); /* * We need/can do nothing about count=0 pages. -@@ -1068,7 +1068,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags) +@@ -1081,7 +1081,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags) if (!PageHWPoison(hpage) || (hwpoison_filter(p) && TestClearPageHWPoison(p)) || (p != hpage && TestSetPageHWPoison(hpage))) { -- atomic_long_sub(nr_pages, &mce_bad_pages); -+ atomic_long_sub_unchecked(nr_pages, &mce_bad_pages); +- atomic_long_sub(nr_pages, &num_poisoned_pages); ++ atomic_long_sub_unchecked(nr_pages, &num_poisoned_pages); return 0; } set_page_hwpoison_huge_page(hpage); -@@ -1126,7 +1126,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags) +@@ -1148,7 +1148,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags) } if (hwpoison_filter(p)) { if (TestClearPageHWPoison(p)) -- atomic_long_sub(nr_pages, &mce_bad_pages); -+ atomic_long_sub_unchecked(nr_pages, &mce_bad_pages); +- atomic_long_sub(nr_pages, &num_poisoned_pages); ++ atomic_long_sub_unchecked(nr_pages, &num_poisoned_pages); unlock_page(hpage); put_page(hpage); return 0; -@@ -1321,7 +1321,7 @@ int unpoison_memory(unsigned long pfn) +@@ -1350,7 +1350,7 @@ int unpoison_memory(unsigned long pfn) return 0; } if (TestClearPageHWPoison(p)) -- atomic_long_sub(nr_pages, &mce_bad_pages); -+ atomic_long_sub_unchecked(nr_pages, &mce_bad_pages); +- atomic_long_sub(nr_pages, &num_poisoned_pages); ++ atomic_long_sub_unchecked(nr_pages, &num_poisoned_pages); pr_info("MCE: Software-unpoisoned free page %#lx\n", pfn); return 0; } -@@ -1335,7 +1335,7 @@ int unpoison_memory(unsigned long pfn) +@@ -1364,7 +1364,7 @@ int unpoison_memory(unsigned long pfn) */ if (TestClearPageHWPoison(page)) { pr_info("MCE: Software-unpoisoned page %#lx\n", pfn); -- atomic_long_sub(nr_pages, &mce_bad_pages); -+ atomic_long_sub_unchecked(nr_pages, &mce_bad_pages); +- atomic_long_sub(nr_pages, &num_poisoned_pages); ++ atomic_long_sub_unchecked(nr_pages, &num_poisoned_pages); freeit = 1; if (PageHuge(page)) clear_page_hwpoison_huge_page(page); -@@ -1448,7 +1448,7 @@ static int soft_offline_huge_page(struct page *page, int flags) +@@ -1491,7 +1491,7 @@ static int soft_offline_huge_page(struct page *page, int flags) + } else { + set_page_hwpoison_huge_page(hpage); + dequeue_hwpoisoned_huge_page(hpage); +- atomic_long_add(1 << compound_trans_order(hpage), ++ atomic_long_add_unchecked(1 << compound_trans_order(hpage), + &num_poisoned_pages); } - done: - if (!PageHWPoison(hpage)) -- atomic_long_add(1 << compound_trans_order(hpage), &mce_bad_pages); -+ atomic_long_add_unchecked(1 << compound_trans_order(hpage), &mce_bad_pages); - set_page_hwpoison_huge_page(hpage); - dequeue_hwpoisoned_huge_page(hpage); /* keep elevated page count for bad page */ -@@ -1579,7 +1579,7 @@ int soft_offline_page(struct page *page, int flags) - return ret; - - done: -- atomic_long_add(1, &mce_bad_pages); -+ atomic_long_add_unchecked(1, &mce_bad_pages); - SetPageHWPoison(page); +@@ -1552,11 +1552,11 @@ int soft_offline_page(struct page *page, int flags) + if (PageHuge(page)) { + set_page_hwpoison_huge_page(hpage); + dequeue_hwpoisoned_huge_page(hpage); +- atomic_long_add(1 << compound_trans_order(hpage), ++ atomic_long_add_unchecked(1 << compound_trans_order(hpage), + &num_poisoned_pages); + } else { + SetPageHWPoison(page); +- atomic_long_inc(&num_poisoned_pages); ++ atomic_long_inc_unchecked(&num_poisoned_pages); + } + } /* keep elevated page count for bad page */ - return ret; +@@ -1596,7 +1596,7 @@ static int __soft_offline_page(struct page *page, int flags) + put_page(page); + pr_info("soft_offline: %#lx: invalidated\n", pfn); + SetPageHWPoison(page); +- atomic_long_inc(&num_poisoned_pages); ++ atomic_long_inc_unchecked(&num_poisoned_pages); + return 0; + } + +@@ -1626,7 +1626,7 @@ static int __soft_offline_page(struct page *page, int flags) + ret = -EIO; + } else { + SetPageHWPoison(page); +- atomic_long_inc(&num_poisoned_pages); ++ atomic_long_inc_unchecked(&num_poisoned_pages); + } + } else { + pr_info("soft offline: %#lx: isolation failed: %d, page count %d, type %lx\n", diff --git a/mm/memory.c b/mm/memory.c -index 6105f47..3363489 100644 +index ba94dec..08ffe0d 100644 --- a/mm/memory.c +++ b/mm/memory.c -@@ -434,8 +434,12 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud, - return; +@@ -438,6 +438,7 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud, + free_pte_range(tlb, pmd, addr); + } while (pmd++, addr = next, addr != end); - pmd = pmd_offset(pud, start); -+ +#if !defined(CONFIG_X86_32) || !defined(CONFIG_PAX_PER_CPU_PGD) + start &= PUD_MASK; + if (start < floor) + return; +@@ -452,6 +453,8 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud, + pmd = pmd_offset(pud, start); pud_clear(pud); pmd_free_tlb(tlb, pmd, start); +#endif @@ -70856,11 +80227,15 @@ index 6105f47..3363489 100644 } static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, -@@ -466,9 +470,12 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, - if (end - 1 > ceiling - 1) - return; +@@ -471,6 +474,7 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, + free_pmd_range(tlb, pud, addr, next, floor, ceiling); + } while (pud++, addr = next, addr != end); +#if !defined(CONFIG_X86_64) || !defined(CONFIG_PAX_PER_CPU_PGD) + start &= PGDIR_MASK; + if (start < floor) + return; +@@ -485,6 +489,8 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, pud = pud_offset(pgd, start); pgd_clear(pgd); pud_free_tlb(tlb, pud, start); @@ -70869,7 +80244,7 @@ index 6105f47..3363489 100644 } /* -@@ -1597,12 +1604,6 @@ no_page_table: +@@ -1644,12 +1650,6 @@ no_page_table: return page; } @@ -70882,8 +80257,8 @@ index 6105f47..3363489 100644 /** * __get_user_pages() - pin user pages in memory * @tsk: task_struct of target task -@@ -1675,10 +1676,10 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, - (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE); +@@ -1736,10 +1736,10 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, + i = 0; - do { @@ -70895,7 +80270,7 @@ index 6105f47..3363489 100644 if (!vma && in_gate_area(mm, start)) { unsigned long pg = start & PAGE_MASK; pgd_t *pgd; -@@ -1726,7 +1727,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, +@@ -1788,7 +1788,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, goto next_page; } @@ -70904,7 +80279,7 @@ index 6105f47..3363489 100644 (vma->vm_flags & (VM_IO | VM_PFNMAP)) || !(vm_flags & vma->vm_flags)) return i ? : -EFAULT; -@@ -1753,11 +1754,6 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, +@@ -1817,11 +1817,6 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, int ret; unsigned int fault_flags = 0; @@ -70916,16 +80291,16 @@ index 6105f47..3363489 100644 if (foll_flags & FOLL_WRITE) fault_flags |= FAULT_FLAG_WRITE; if (nonblocking) -@@ -1831,7 +1827,7 @@ next_page: - start += PAGE_SIZE; - nr_pages--; +@@ -1901,7 +1896,7 @@ next_page: + start += page_increm * PAGE_SIZE; + nr_pages -= page_increm; } while (nr_pages && start < vma->vm_end); - } while (nr_pages); + } return i; } EXPORT_SYMBOL(__get_user_pages); -@@ -2038,6 +2034,10 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr, +@@ -2108,6 +2103,10 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr, page_add_file_rmap(page); set_pte_at(mm, addr, pte, mk_pte(page, prot)); @@ -70936,30 +80311,29 @@ index 6105f47..3363489 100644 retval = 0; pte_unmap_unlock(pte, ptl); return retval; -@@ -2072,10 +2072,22 @@ out: - int vm_insert_page(struct vm_area_struct *vma, unsigned long addr, - struct page *page) - { +@@ -2152,9 +2151,21 @@ int vm_insert_page(struct vm_area_struct *vma, unsigned long addr, + if (!page_count(page)) + return -EINVAL; + if (!(vma->vm_flags & VM_MIXEDMAP)) { + +#ifdef CONFIG_PAX_SEGMEXEC -+ struct vm_area_struct *vma_m; ++ struct vm_area_struct *vma_m; +#endif + - if (addr < vma->vm_start || addr >= vma->vm_end) - return -EFAULT; - if (!page_count(page)) - return -EINVAL; + BUG_ON(down_read_trylock(&vma->vm_mm->mmap_sem)); + BUG_ON(vma->vm_flags & VM_PFNMAP); + vma->vm_flags |= VM_MIXEDMAP; + +#ifdef CONFIG_PAX_SEGMEXEC -+ vma_m = pax_find_mirror_vma(vma); -+ if (vma_m) -+ vma_m->vm_flags |= VM_INSERTPAGE; ++ vma_m = pax_find_mirror_vma(vma); ++ if (vma_m) ++ vma_m->vm_flags |= VM_MIXEDMAP; +#endif + - vma->vm_flags |= VM_INSERTPAGE; + } return insert_page(vma, addr, page, vma->vm_page_prot); } -@@ -2161,6 +2173,7 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, +@@ -2237,6 +2248,7 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn) { BUG_ON(!(vma->vm_flags & VM_MIXEDMAP)); @@ -70967,7 +80341,7 @@ index 6105f47..3363489 100644 if (addr < vma->vm_start || addr >= vma->vm_end) return -EFAULT; -@@ -2368,7 +2381,9 @@ static int apply_to_pmd_range(struct mm_struct *mm, pud_t *pud, +@@ -2484,7 +2496,9 @@ static int apply_to_pmd_range(struct mm_struct *mm, pud_t *pud, BUG_ON(pud_huge(*pud)); @@ -70978,7 +80352,7 @@ index 6105f47..3363489 100644 if (!pmd) return -ENOMEM; do { -@@ -2388,7 +2403,9 @@ static int apply_to_pud_range(struct mm_struct *mm, pgd_t *pgd, +@@ -2504,7 +2518,9 @@ static int apply_to_pud_range(struct mm_struct *mm, pgd_t *pgd, unsigned long next; int err; @@ -70989,7 +80363,7 @@ index 6105f47..3363489 100644 if (!pud) return -ENOMEM; do { -@@ -2476,6 +2493,186 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo +@@ -2592,6 +2608,186 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo copy_user_highpage(dst, src, va, vma); } @@ -71065,7 +80439,7 @@ index 6105f47..3363489 100644 + page_add_anon_rmap(page_m, vma_m, address_m); + inc_mm_counter_fast(mm, MM_ANONPAGES); + set_pte_at(mm, address_m, pte_m, entry_m); -+ update_mmu_cache(vma_m, address_m, entry_m); ++ update_mmu_cache(vma_m, address_m, pte_m); +out: + if (ptl != ptl_m) + spin_unlock(ptl_m); @@ -71104,7 +80478,7 @@ index 6105f47..3363489 100644 + page_add_file_rmap(page_m); + inc_mm_counter_fast(mm, MM_FILEPAGES); + set_pte_at(mm, address_m, pte_m, entry_m); -+ update_mmu_cache(vma_m, address_m, entry_m); ++ update_mmu_cache(vma_m, address_m, pte_m); +out: + if (ptl != ptl_m) + spin_unlock(ptl_m); @@ -71176,7 +80550,7 @@ index 6105f47..3363489 100644 /* * This routine handles present pages, when users try to write * to a shared page. It is done by copying the page to a new address -@@ -2687,6 +2884,12 @@ gotten: +@@ -2808,6 +3004,12 @@ gotten: */ page_table = pte_offset_map_lock(mm, pmd, address, &ptl); if (likely(pte_same(*page_table, orig_pte))) { @@ -71189,7 +80563,7 @@ index 6105f47..3363489 100644 if (old_page) { if (!PageAnon(old_page)) { dec_mm_counter_fast(mm, MM_FILEPAGES); -@@ -2738,6 +2941,10 @@ gotten: +@@ -2859,6 +3061,10 @@ gotten: page_remove_rmap(old_page); } @@ -71200,7 +80574,7 @@ index 6105f47..3363489 100644 /* Free the old page.. */ new_page = old_page; ret |= VM_FAULT_WRITE; -@@ -3017,6 +3224,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -3134,6 +3340,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, swap_free(entry); if (vm_swap_full() || (vma->vm_flags & VM_LOCKED) || PageMlocked(page)) try_to_free_swap(page); @@ -71210,9 +80584,9 @@ index 6105f47..3363489 100644 +#endif + unlock_page(page); - if (swapcache) { + if (page != swapcache) { /* -@@ -3040,6 +3252,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -3157,6 +3368,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, /* No need to invalidate - it was non-present before */ update_mmu_cache(vma, address, page_table); @@ -71224,7 +80598,7 @@ index 6105f47..3363489 100644 unlock: pte_unmap_unlock(page_table, ptl); out: -@@ -3059,40 +3276,6 @@ out_release: +@@ -3176,40 +3392,6 @@ out_release: } /* @@ -71265,7 +80639,7 @@ index 6105f47..3363489 100644 * We enter with non-exclusive mmap_sem (to exclude vma changes, * but allow concurrent faults), and pte mapped but not yet locked. * We return with mmap_sem still held, but pte unmapped and unlocked. -@@ -3101,27 +3284,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -3218,27 +3400,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *page_table, pmd_t *pmd, unsigned int flags) { @@ -71298,7 +80672,7 @@ index 6105f47..3363489 100644 if (unlikely(anon_vma_prepare(vma))) goto oom; page = alloc_zeroed_user_highpage_movable(vma, address); -@@ -3140,6 +3319,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -3257,6 +3435,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, if (!pte_none(*page_table)) goto release; @@ -71310,7 +80684,7 @@ index 6105f47..3363489 100644 inc_mm_counter_fast(mm, MM_ANONPAGES); page_add_new_anon_rmap(page, vma, address); setpte: -@@ -3147,6 +3331,12 @@ setpte: +@@ -3264,6 +3447,12 @@ setpte: /* No need to invalidate - it was non-present before */ update_mmu_cache(vma, address, page_table); @@ -71323,7 +80697,7 @@ index 6105f47..3363489 100644 unlock: pte_unmap_unlock(page_table, ptl); return 0; -@@ -3290,6 +3480,12 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -3407,6 +3596,12 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, */ /* Only go through if we didn't race with anybody else... */ if (likely(pte_same(*page_table, orig_pte))) { @@ -71336,7 +80710,7 @@ index 6105f47..3363489 100644 flush_icache_page(vma, page); entry = mk_pte(page, vma->vm_page_prot); if (flags & FAULT_FLAG_WRITE) -@@ -3309,6 +3505,14 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -3426,6 +3621,14 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, /* no need to invalidate: a not-present page won't be cached */ update_mmu_cache(vma, address, page_table); @@ -71351,7 +80725,7 @@ index 6105f47..3363489 100644 } else { if (cow_page) mem_cgroup_uncharge_page(cow_page); -@@ -3462,6 +3666,12 @@ int handle_pte_fault(struct mm_struct *mm, +@@ -3747,6 +3950,12 @@ int handle_pte_fault(struct mm_struct *mm, if (flags & FAULT_FLAG_WRITE) flush_tlb_fix_spurious_fault(vma, address); } @@ -71364,7 +80738,7 @@ index 6105f47..3363489 100644 unlock: pte_unmap_unlock(pte, ptl); return 0; -@@ -3478,6 +3688,10 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -3763,6 +3972,10 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, pmd_t *pmd; pte_t *pte; @@ -71375,7 +80749,7 @@ index 6105f47..3363489 100644 __set_current_state(TASK_RUNNING); count_vm_event(PGFAULT); -@@ -3489,6 +3703,34 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -3774,6 +3987,34 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, if (unlikely(is_vm_hugetlb_page(vma))) return hugetlb_fault(mm, vma, address, flags); @@ -71407,19 +80781,10 @@ index 6105f47..3363489 100644 + } +#endif + + retry: pgd = pgd_offset(mm, address); pud = pud_alloc(mm, pgd, address); - if (!pud) -@@ -3518,7 +3760,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, - * run pte_offset_map on the pmd, if an huge pmd could - * materialize from under us from a different thread. - */ -- if (unlikely(pmd_none(*pmd)) && __pte_alloc(mm, vma, pmd, address)) -+ if (unlikely(pmd_none(*pmd) && __pte_alloc(mm, vma, pmd, address))) - return VM_FAULT_OOM; - /* if an huge pmd materialized from under us just retry later */ - if (unlikely(pmd_trans_huge(*pmd))) -@@ -3555,6 +3797,23 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) +@@ -3872,6 +4113,23 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) spin_unlock(&mm->page_table_lock); return 0; } @@ -71443,7 +80808,7 @@ index 6105f47..3363489 100644 #endif /* __PAGETABLE_PUD_FOLDED */ #ifndef __PAGETABLE_PMD_FOLDED -@@ -3585,6 +3844,30 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) +@@ -3902,6 +4160,30 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) spin_unlock(&mm->page_table_lock); return 0; } @@ -71473,8 +80838,8 @@ index 6105f47..3363489 100644 +} #endif /* __PAGETABLE_PMD_FOLDED */ - int make_pages_present(unsigned long addr, unsigned long end) -@@ -3622,7 +3905,7 @@ static int __init gate_vma_init(void) + #if !defined(__HAVE_ARCH_GATE_AREA) +@@ -3915,7 +4197,7 @@ static int __init gate_vma_init(void) gate_vma.vm_start = FIXADDR_USER_START; gate_vma.vm_end = FIXADDR_USER_END; gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC; @@ -71483,11 +80848,68 @@ index 6105f47..3363489 100644 return 0; } +@@ -4049,8 +4331,8 @@ out: + return ret; + } + +-int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, +- void *buf, int len, int write) ++ssize_t generic_access_phys(struct vm_area_struct *vma, unsigned long addr, ++ void *buf, size_t len, int write) + { + resource_size_t phys_addr; + unsigned long prot = 0; +@@ -4075,8 +4357,8 @@ int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, + * Access another process' address space as given in mm. If non-NULL, use the + * given task for page fault accounting. + */ +-static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, +- unsigned long addr, void *buf, int len, int write) ++static ssize_t __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, ++ unsigned long addr, void *buf, size_t len, int write) + { + struct vm_area_struct *vma; + void *old_buf = buf; +@@ -4084,7 +4366,7 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, + down_read(&mm->mmap_sem); + /* ignore errors, just check how much was successfully transferred */ + while (len) { +- int bytes, ret, offset; ++ ssize_t bytes, ret, offset; + void *maddr; + struct page *page = NULL; + +@@ -4143,8 +4425,8 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, + * + * The caller must hold a reference on @mm. + */ +-int access_remote_vm(struct mm_struct *mm, unsigned long addr, +- void *buf, int len, int write) ++ssize_t access_remote_vm(struct mm_struct *mm, unsigned long addr, ++ void *buf, size_t len, int write) + { + return __access_remote_vm(NULL, mm, addr, buf, len, write); + } +@@ -4154,11 +4436,11 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr, + * Source/target buffer must be kernel space, + * Do not walk the page table directly, use get_user_pages + */ +-int access_process_vm(struct task_struct *tsk, unsigned long addr, +- void *buf, int len, int write) ++ssize_t access_process_vm(struct task_struct *tsk, unsigned long addr, ++ void *buf, size_t len, int write) + { + struct mm_struct *mm; +- int ret; ++ ssize_t ret; + + mm = get_task_mm(tsk); + if (!mm) diff --git a/mm/mempolicy.c b/mm/mempolicy.c -index 9afcbad..bfa00c2 100644 +index 7431001..0f8344e 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c -@@ -619,6 +619,10 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, +@@ -708,6 +708,10 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, unsigned long vmstart; unsigned long vmend; @@ -71498,15 +80920,19 @@ index 9afcbad..bfa00c2 100644 vma = find_vma(mm, start); if (!vma || vma->vm_start > start) return -EFAULT; -@@ -672,6 +676,16 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, +@@ -744,9 +748,20 @@ static int mbind_range(struct mm_struct *mm, unsigned long start, if (err) goto out; } + + err = vma_replace_policy(vma, new_pol); + if (err) + goto out; ++ +#ifdef CONFIG_PAX_SEGMEXEC + vma_m = pax_find_mirror_vma(vma); -+ if (vma_m && vma_m->vm_ops && vma_m->vm_ops->set_policy) { -+ err = vma_m->vm_ops->set_policy(vma_m, new_pol); ++ if (vma_m) { ++ err = vma_replace_policy(vma_m, new_pol); + if (err) + goto out; + } @@ -71515,7 +80941,7 @@ index 9afcbad..bfa00c2 100644 } out: -@@ -1105,6 +1119,17 @@ static long do_mbind(unsigned long start, unsigned long len, +@@ -1202,6 +1217,17 @@ static long do_mbind(unsigned long start, unsigned long len, if (end < start) return -EINVAL; @@ -71533,17 +80959,17 @@ index 9afcbad..bfa00c2 100644 if (end == start) return 0; -@@ -1328,8 +1353,7 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, +@@ -1430,8 +1456,7 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, */ tcred = __task_cred(task); - if (cred->euid != tcred->suid && cred->euid != tcred->uid && -- cred->uid != tcred->suid && cred->uid != tcred->uid && + if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && +- !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && - !capable(CAP_SYS_NICE)) { -+ cred->uid != tcred->suid && !capable(CAP_SYS_NICE)) { ++ !uid_eq(cred->uid, tcred->suid) && !capable(CAP_SYS_NICE)) { rcu_read_unlock(); err = -EPERM; goto out_put; -@@ -1360,6 +1384,15 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, +@@ -1462,6 +1487,15 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, goto out; } @@ -71559,8 +80985,22 @@ index 9afcbad..bfa00c2 100644 err = do_migrate_pages(mm, old, new, capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE); +diff --git a/mm/migrate.c b/mm/migrate.c +index 3bbaf5d..299b0e9 100644 +--- a/mm/migrate.c ++++ b/mm/migrate.c +@@ -1382,8 +1382,7 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + */ + tcred = __task_cred(task); + if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && +- !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && +- !capable(CAP_SYS_NICE)) { ++ !uid_eq(cred->uid, tcred->suid) && !capable(CAP_SYS_NICE)) { + rcu_read_unlock(); + err = -EPERM; + goto out; diff --git a/mm/mlock.c b/mm/mlock.c -index ef726e8..cd7f1ec 100644 +index 79b7cf7..c60424f 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -13,6 +13,7 @@ @@ -71571,7 +81011,7 @@ index ef726e8..cd7f1ec 100644 #include <linux/sched.h> #include <linux/export.h> #include <linux/rmap.h> -@@ -376,7 +377,7 @@ static int do_mlock(unsigned long start, size_t len, int on) +@@ -334,7 +335,7 @@ static int do_mlock(unsigned long start, size_t len, int on) { unsigned long nstart, end, tmp; struct vm_area_struct * vma, * prev; @@ -71580,7 +81020,7 @@ index ef726e8..cd7f1ec 100644 VM_BUG_ON(start & ~PAGE_MASK); VM_BUG_ON(len != PAGE_ALIGN(len)); -@@ -385,6 +386,9 @@ static int do_mlock(unsigned long start, size_t len, int on) +@@ -343,6 +344,9 @@ static int do_mlock(unsigned long start, size_t len, int on) return -EINVAL; if (end == start) return 0; @@ -71590,7 +81030,7 @@ index ef726e8..cd7f1ec 100644 vma = find_vma(current->mm, start); if (!vma || vma->vm_start > start) return -ENOMEM; -@@ -396,6 +400,11 @@ static int do_mlock(unsigned long start, size_t len, int on) +@@ -354,6 +358,11 @@ static int do_mlock(unsigned long start, size_t len, int on) for (nstart = start ; ; ) { vm_flags_t newflags; @@ -71601,8 +81041,8 @@ index ef726e8..cd7f1ec 100644 + /* Here we know that vma->vm_start <= nstart < vma->vm_end. */ - newflags = vma->vm_flags | VM_LOCKED; -@@ -501,6 +510,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len) + newflags = vma->vm_flags & ~VM_LOCKED; +@@ -466,6 +475,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len) lock_limit >>= PAGE_SHIFT; /* check against resource limits */ @@ -71610,21 +81050,7 @@ index ef726e8..cd7f1ec 100644 if ((locked <= lock_limit) || capable(CAP_IPC_LOCK)) error = do_mlock(start, len, 1); up_write(¤t->mm->mmap_sem); -@@ -524,17 +534,23 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) - static int do_mlockall(int flags) - { - struct vm_area_struct * vma, * prev = NULL; -- unsigned int def_flags = 0; - - if (flags & MCL_FUTURE) -- def_flags = VM_LOCKED; -- current->mm->def_flags = def_flags; -+ current->mm->def_flags |= VM_LOCKED; -+ else -+ current->mm->def_flags &= ~VM_LOCKED; - if (flags == MCL_FUTURE) - goto out; - +@@ -500,6 +510,12 @@ static int do_mlockall(int flags) for (vma = current->mm->mmap; vma ; vma = prev->vm_next) { vm_flags_t newflags; @@ -71634,10 +81060,10 @@ index ef726e8..cd7f1ec 100644 +#endif + + BUG_ON(vma->vm_end > TASK_SIZE); - newflags = vma->vm_flags | VM_LOCKED; - if (!(flags & MCL_CURRENT)) - newflags &= ~VM_LOCKED; -@@ -567,6 +583,7 @@ SYSCALL_DEFINE1(mlockall, int, flags) + newflags = vma->vm_flags & ~VM_LOCKED; + if (flags & MCL_CURRENT) + newflags |= VM_LOCKED; +@@ -532,6 +548,7 @@ SYSCALL_DEFINE1(mlockall, int, flags) lock_limit >>= PAGE_SHIFT; ret = -ENOMEM; @@ -71646,10 +81072,18 @@ index ef726e8..cd7f1ec 100644 capable(CAP_IPC_LOCK)) ret = do_mlockall(flags); diff --git a/mm/mmap.c b/mm/mmap.c -index 848ef52..d2b586c 100644 +index 0dceed8..671951c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c -@@ -46,6 +46,16 @@ +@@ -33,6 +33,7 @@ + #include <linux/uprobes.h> + #include <linux/rbtree_augmented.h> + #include <linux/sched/sysctl.h> ++#include <linux/random.h> + + #include <asm/uaccess.h> + #include <asm/cacheflush.h> +@@ -49,6 +50,16 @@ #define arch_rebalance_pgtables(addr, len) (addr) #endif @@ -71666,7 +81100,7 @@ index 848ef52..d2b586c 100644 static void unmap_region(struct mm_struct *mm, struct vm_area_struct *vma, struct vm_area_struct *prev, unsigned long start, unsigned long end); -@@ -71,22 +81,32 @@ static void unmap_region(struct mm_struct *mm, +@@ -68,22 +79,32 @@ static void unmap_region(struct mm_struct *mm, * x: (no) no x: (no) yes x: (no) yes x: (yes) yes * */ @@ -71702,15 +81136,15 @@ index 848ef52..d2b586c 100644 /* * Make sure vm_committed_as in one cacheline and not cacheline shared with * other variables. It can be updated by several CPUs frequently. -@@ -228,6 +248,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) +@@ -239,6 +260,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) struct vm_area_struct *next = vma->vm_next; might_sleep(); + BUG_ON(vma->vm_mirror); if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); - if (vma->vm_file) { -@@ -274,6 +295,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) + if (vma->vm_file) +@@ -283,6 +305,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) * not page aligned -Ram Gupta */ rlim = rlimit(RLIMIT_DATA); @@ -71718,7 +81152,7 @@ index 848ef52..d2b586c 100644 if (rlim < RLIM_INFINITY && (brk - mm->start_brk) + (mm->end_data - mm->start_data) > rlim) goto out; -@@ -690,6 +712,12 @@ static int +@@ -897,6 +920,12 @@ static int can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags, struct anon_vma *anon_vma, struct file *file, pgoff_t vm_pgoff) { @@ -71731,7 +81165,7 @@ index 848ef52..d2b586c 100644 if (is_mergeable_vma(vma, file, vm_flags) && is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) { if (vma->vm_pgoff == vm_pgoff) -@@ -709,6 +737,12 @@ static int +@@ -916,6 +945,12 @@ static int can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags, struct anon_vma *anon_vma, struct file *file, pgoff_t vm_pgoff) { @@ -71744,7 +81178,7 @@ index 848ef52..d2b586c 100644 if (is_mergeable_vma(vma, file, vm_flags) && is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) { pgoff_t vm_pglen; -@@ -751,13 +785,20 @@ can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags, +@@ -958,13 +993,20 @@ can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags, struct vm_area_struct *vma_merge(struct mm_struct *mm, struct vm_area_struct *prev, unsigned long addr, unsigned long end, unsigned long vm_flags, @@ -71766,7 +81200,7 @@ index 848ef52..d2b586c 100644 /* * We later require that vma->vm_flags == vm_flags, * so this tests vma->vm_flags & VM_SPECIAL, too. -@@ -773,6 +814,15 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm, +@@ -980,6 +1022,15 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm, if (next && next->vm_end == end) /* cases 6, 7, 8 */ next = next->vm_next; @@ -71782,7 +81216,7 @@ index 848ef52..d2b586c 100644 /* * Can it merge with the predecessor? */ -@@ -792,9 +842,24 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm, +@@ -999,9 +1050,24 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm, /* cases 1, 6 */ err = vma_adjust(prev, prev->vm_start, next->vm_end, prev->vm_pgoff, NULL); @@ -71808,7 +81242,7 @@ index 848ef52..d2b586c 100644 if (err) return NULL; khugepaged_enter_vma_merge(prev); -@@ -808,12 +873,27 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm, +@@ -1015,12 +1081,27 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm, mpol_equal(policy, vma_policy(next)) && can_vma_merge_before(next, vm_flags, anon_vma, file, pgoff+pglen)) { @@ -71838,23 +81272,29 @@ index 848ef52..d2b586c 100644 if (err) return NULL; khugepaged_enter_vma_merge(area); -@@ -922,14 +1002,11 @@ none: +@@ -1129,8 +1210,10 @@ none: void vm_stat_account(struct mm_struct *mm, unsigned long flags, struct file *file, long pages) { - const unsigned long stack_flags - = VM_STACK_FLAGS & (VM_GROWSUP|VM_GROWSDOWN); -- - if (file) { ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP) || (flags & (VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC))) ++#endif + + mm->total_vm += pages; + +@@ -1138,7 +1221,7 @@ void vm_stat_account(struct mm_struct *mm, unsigned long flags, mm->shared_vm += pages; if ((flags & (VM_EXEC|VM_WRITE)) == VM_EXEC) mm->exec_vm += pages; - } else if (flags & stack_flags) + } else if (flags & (VM_GROWSUP|VM_GROWSDOWN)) mm->stack_vm += pages; - if (flags & (VM_RESERVED|VM_IO)) - mm->reserved_vm += pages; -@@ -969,7 +1046,7 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, + } + #endif /* CONFIG_PROC_FS */ +@@ -1177,7 +1260,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, * (the exception is when the underlying filesystem is noexec * mounted, in which case we dont add PROT_EXEC.) */ @@ -71863,7 +81303,7 @@ index 848ef52..d2b586c 100644 if (!(file && (file->f_path.mnt->mnt_flags & MNT_NOEXEC))) prot |= PROT_EXEC; -@@ -995,7 +1072,7 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, +@@ -1203,7 +1286,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, /* Obtain the address to map to. we verify (or select) it and ensure * that it represents a valid section of the address space. */ @@ -71872,7 +81312,7 @@ index 848ef52..d2b586c 100644 if (addr & ~PAGE_MASK) return addr; -@@ -1006,6 +1083,36 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, +@@ -1214,6 +1297,36 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) | mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; @@ -71909,7 +81349,7 @@ index 848ef52..d2b586c 100644 if (flags & MAP_LOCKED) if (!can_do_mlock()) return -EPERM; -@@ -1017,6 +1124,7 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, +@@ -1225,6 +1338,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, locked += mm->locked_vm; lock_limit = rlimit(RLIMIT_MEMLOCK); lock_limit >>= PAGE_SHIFT; @@ -71917,17 +81357,17 @@ index 848ef52..d2b586c 100644 if (locked > lock_limit && !capable(CAP_IPC_LOCK)) return -EAGAIN; } -@@ -1087,6 +1195,9 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, - if (error) - return error; +@@ -1305,6 +1419,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, + vm_flags |= VM_NORESERVE; + } + if (!gr_acl_handle_mmap(file, prot)) + return -EACCES; -+ - return mmap_region(file, addr, len, flags, vm_flags, pgoff); - } - -@@ -1192,7 +1303,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma) ++ + addr = mmap_region(file, addr, len, vm_flags, pgoff); + if (!IS_ERR_VALUE(addr) && + ((vm_flags & VM_LOCKED) || +@@ -1396,7 +1513,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma) vm_flags_t vm_flags = vma->vm_flags; /* If it was private or non-writable, the write bit is already clear */ @@ -71936,9 +81376,9 @@ index 848ef52..d2b586c 100644 return 0; /* The backer wishes to know when pages are first written to? */ -@@ -1241,14 +1352,24 @@ unsigned long mmap_region(struct file *file, unsigned long addr, +@@ -1444,16 +1561,30 @@ unsigned long mmap_region(struct file *file, unsigned long addr, unsigned long charged = 0; - struct inode *inode = file ? file->f_path.dentry->d_inode : NULL; + struct inode *inode = file ? file_inode(file) : NULL; +#ifdef CONFIG_PAX_SEGMEXEC + struct vm_area_struct *vma_m = NULL; @@ -71953,17 +81393,23 @@ index 848ef52..d2b586c 100644 /* Clear old maps */ error = -ENOMEM; -munmap_back: - vma = find_vma_prepare(mm, addr, &prev, &rb_link, &rb_parent); - if (vma && vma->vm_start < addr + len) { + if (find_vma_links(mm, addr, addr + len, &prev, &rb_link, &rb_parent)) { if (do_munmap(mm, addr, len)) return -ENOMEM; - goto munmap_back; -+ vma = find_vma_prepare(mm, addr, &prev, &rb_link, &rb_parent); -+ BUG_ON(vma && vma->vm_start < addr + len); ++ BUG_ON(find_vma_links(mm, addr, addr + len, &prev, &rb_link, &rb_parent)); } /* Check against address space limit. */ -@@ -1297,6 +1418,16 @@ munmap_back: ++ ++#ifdef CONFIG_PAX_RANDMMAP ++ if (!(mm->pax_flags & MF_PAX_RANDMMAP) || (vm_flags & (VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC))) ++#endif ++ + if (!may_expand_vm(mm, len >> PAGE_SHIFT)) + return -ENOMEM; + +@@ -1485,6 +1616,16 @@ munmap_back: goto unacct_error; } @@ -71980,16 +81426,10 @@ index 848ef52..d2b586c 100644 vma->vm_mm = mm; vma->vm_start = addr; vma->vm_end = addr + len; -@@ -1321,6 +1452,19 @@ munmap_back: - error = file->f_op->mmap(file, vma); +@@ -1509,6 +1650,13 @@ munmap_back: if (error) goto unmap_and_free_vma; -+ -+#ifdef CONFIG_PAX_SEGMEXEC -+ if (vma_m && (vm_flags & VM_EXECUTABLE)) -+ added_exe_file_vma(mm); -+#endif -+ + +#if defined(CONFIG_PAX_PAGEEXEC) && defined(CONFIG_X86_32) + if ((mm->pax_flags & MF_PAX_PAGEEXEC) && !(vma->vm_flags & VM_SPECIAL)) { + vma->vm_flags |= VM_PAGEEXEC; @@ -71997,10 +81437,10 @@ index 848ef52..d2b586c 100644 + } +#endif + - if (vm_flags & VM_EXECUTABLE) - added_exe_file_vma(mm); - -@@ -1358,6 +1502,11 @@ munmap_back: + /* Can addr have changed?? + * + * Answer: Yes, several device drivers can do it in their +@@ -1547,6 +1695,11 @@ munmap_back: vma_link(mm, vma, prev, rb_link, rb_parent); file = vma->vm_file; @@ -72012,15 +81452,15 @@ index 848ef52..d2b586c 100644 /* Once vma denies write, undo our temporary denial count */ if (correct_wcount) atomic_inc(&inode->i_writecount); -@@ -1366,6 +1515,7 @@ out: +@@ -1554,6 +1707,7 @@ out: + perf_event_mmap(vma); - mm->total_vm += len >> PAGE_SHIFT; vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT); + track_exec_limit(mm, addr, addr + len, vm_flags); if (vm_flags & VM_LOCKED) { - if (!mlock_vma_pages_range(vma, addr, addr + len)) - mm->locked_vm += (len >> PAGE_SHIFT); -@@ -1383,6 +1533,12 @@ unmap_and_free_vma: + if (!((vm_flags & VM_SPECIAL) || is_vm_hugetlb_page(vma) || + vma == get_gate_vma(current->mm))) +@@ -1577,6 +1731,12 @@ unmap_and_free_vma: unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); charged = 0; free_vma: @@ -72033,11 +81473,21 @@ index 848ef52..d2b586c 100644 kmem_cache_free(vm_area_cachep, vma); unacct_error: if (charged) -@@ -1390,6 +1546,44 @@ unacct_error: +@@ -1584,6 +1744,62 @@ unacct_error: return error; } -+bool check_heap_stack_gap(const struct vm_area_struct *vma, unsigned long addr, unsigned long len) ++#ifdef CONFIG_GRKERNSEC_RAND_THREADSTACK ++unsigned long gr_rand_threadstack_offset(const struct mm_struct *mm, const struct file *filp, unsigned long flags) ++{ ++ if ((mm->pax_flags & MF_PAX_RANDMMAP) && !filp && (flags & MAP_STACK)) ++ return (random32() & 0xFF) << PAGE_SHIFT; ++ ++ return 0; ++} ++#endif ++ ++bool check_heap_stack_gap(const struct vm_area_struct *vma, unsigned long addr, unsigned long len, unsigned long offset) +{ + if (!vma) { +#ifdef CONFIG_STACK_GROWSUP @@ -72060,25 +81510,41 @@ index 848ef52..d2b586c 100644 + else if (vma->vm_prev && (vma->vm_prev->vm_flags & VM_GROWSUP)) + return addr - vma->vm_prev->vm_end <= sysctl_heap_stack_gap; +#endif ++ else if (offset) ++ return offset <= vma->vm_start - addr - len; + + return true; +} + -+unsigned long skip_heap_stack_gap(const struct vm_area_struct *vma, unsigned long len) ++unsigned long skip_heap_stack_gap(const struct vm_area_struct *vma, unsigned long len, unsigned long offset) +{ + if (vma->vm_start < len) + return -ENOMEM; -+ if (!(vma->vm_flags & VM_GROWSDOWN)) -+ return vma->vm_start - len; ++ ++ if (!(vma->vm_flags & VM_GROWSDOWN)) { ++ if (offset <= vma->vm_start - len) ++ return vma->vm_start - len - offset; ++ else ++ return -ENOMEM; ++ } ++ + if (sysctl_heap_stack_gap <= vma->vm_start - len) + return vma->vm_start - len - sysctl_heap_stack_gap; + return -ENOMEM; +} + - /* Get an address range which is currently unmapped. - * For shmat() with addr=0. - * -@@ -1416,18 +1610,23 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, + unsigned long unmapped_area(struct vm_unmapped_area_info *info) + { + /* +@@ -1803,6 +2019,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); + + if (len > TASK_SIZE) + return -ENOMEM; +@@ -1810,29 +2027,45 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, if (flags & MAP_FIXED) return addr; @@ -72088,60 +81554,26 @@ index 848ef52..d2b586c 100644 + if (addr) { addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); + vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -- return addr; -+ if (TASK_SIZE - len >= addr) { -+ vma = find_vma(mm, addr); -+ if (check_heap_stack_gap(vma, addr, len)) -+ return addr; -+ } - } - if (len > mm->cached_hole_size) { -- start_addr = addr = mm->free_area_cache; -+ start_addr = addr = mm->free_area_cache; - } else { -- start_addr = addr = TASK_UNMAPPED_BASE; -- mm->cached_hole_size = 0; -+ start_addr = addr = mm->mmap_base; -+ mm->cached_hole_size = 0; ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) + return addr; } - full_search: -@@ -1438,34 +1637,40 @@ full_search: - * Start a new search - just in case we missed - * some holes. - */ -- if (start_addr != TASK_UNMAPPED_BASE) { -- addr = TASK_UNMAPPED_BASE; -- start_addr = addr; -+ if (start_addr != mm->mmap_base) { -+ start_addr = addr = mm->mmap_base; - mm->cached_hole_size = 0; - goto full_search; - } - return -ENOMEM; - } -- if (!vma || addr + len <= vma->vm_start) { -- /* -- * Remember the place where we stopped the search: -- */ -- mm->free_area_cache = addr + len; -- return addr; -- } -+ if (check_heap_stack_gap(vma, addr, len)) -+ break; - if (addr + mm->cached_hole_size < vma->vm_start) - mm->cached_hole_size = vma->vm_start - addr; - addr = vma->vm_end; - } + info.flags = 0; + info.length = len; + info.low_limit = TASK_UNMAPPED_BASE; + -+ /* -+ * Remember the place where we stopped the search: -+ */ -+ mm->free_area_cache = addr + len; -+ return addr; ++#ifdef CONFIG_PAX_RANDMMAP ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; ++#endif ++ + info.high_limit = TASK_SIZE; + info.align_mask = 0; ++ info.threadstack_offset = offset; + return vm_unmapped_area(&info); } #endif @@ -72161,16 +81593,15 @@ index 848ef52..d2b586c 100644 mm->free_area_cache = addr; } -@@ -1481,7 +1686,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - { - struct vm_area_struct *vma; +@@ -1850,6 +2083,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, struct mm_struct *mm = current->mm; -- unsigned long addr = addr0, start_addr; -+ unsigned long base = mm->mmap_base, addr = addr0, start_addr; + unsigned long addr = addr0; + struct vm_unmapped_area_info info; ++ unsigned long offset = gr_rand_threadstack_offset(mm, filp, flags); /* requested length too big for entire address space */ if (len > TASK_SIZE) -@@ -1490,13 +1695,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, +@@ -1858,12 +2092,15 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, if (flags & MAP_FIXED) return addr; @@ -72181,63 +81612,35 @@ index 848ef52..d2b586c 100644 /* requesting a specific address */ if (addr) { addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); + vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -- return addr; -+ if (TASK_SIZE - len >= addr) { -+ vma = find_vma(mm, addr); -+ if (check_heap_stack_gap(vma, addr, len)) -+ return addr; -+ } ++ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vma, addr, len, offset)) + return addr; } - /* check if free_area_cache is useful for us */ -@@ -1520,7 +1730,7 @@ try_again: - * return with success: - */ - vma = find_vma(mm, addr); -- if (!vma || addr+len <= vma->vm_start) -+ if (check_heap_stack_gap(vma, addr, len)) - /* remember the address as a hint for next time */ - return (mm->free_area_cache = addr); - -@@ -1529,8 +1739,8 @@ try_again: - mm->cached_hole_size = vma->vm_start - addr; - - /* try just below the current vma->vm_start */ -- addr = vma->vm_start-len; -- } while (len < vma->vm_start); -+ addr = skip_heap_stack_gap(vma, len); -+ } while (!IS_ERR_VALUE(addr)); +@@ -1872,6 +2109,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + info.low_limit = PAGE_SIZE; + info.high_limit = mm->mmap_base; + info.align_mask = 0; ++ info.threadstack_offset = offset; + addr = vm_unmapped_area(&info); - fail: /* -@@ -1553,13 +1763,21 @@ fail: - * can happen with large stack limits and large mmap() - * allocations. - */ -+ mm->mmap_base = TASK_UNMAPPED_BASE; +@@ -1884,6 +2122,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, + VM_BUG_ON(addr != -ENOMEM); + info.flags = 0; + info.low_limit = TASK_UNMAPPED_BASE; + +#ifdef CONFIG_PAX_RANDMMAP -+ if (mm->pax_flags & MF_PAX_RANDMMAP) -+ mm->mmap_base += mm->delta_mmap; ++ if (mm->pax_flags & MF_PAX_RANDMMAP) ++ info.low_limit += mm->delta_mmap; +#endif + -+ mm->free_area_cache = mm->mmap_base; - mm->cached_hole_size = ~0UL; -- mm->free_area_cache = TASK_UNMAPPED_BASE; - addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags); - /* - * Restore the topdown base: - */ -- mm->free_area_cache = mm->mmap_base; -+ mm->mmap_base = base; -+ mm->free_area_cache = base; - mm->cached_hole_size = ~0UL; - - return addr; -@@ -1568,6 +1786,12 @@ fail: + info.high_limit = TASK_SIZE; + addr = vm_unmapped_area(&info); + } +@@ -1894,6 +2138,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr) { @@ -72250,7 +81653,7 @@ index 848ef52..d2b586c 100644 /* * Is this a new hole at the highest possible address? */ -@@ -1575,8 +1799,10 @@ void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr) +@@ -1901,8 +2151,10 @@ void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr) mm->free_area_cache = addr; /* dont allow allocations above current base */ @@ -72262,7 +81665,7 @@ index 848ef52..d2b586c 100644 } unsigned long -@@ -1672,6 +1898,28 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr, +@@ -2001,6 +2253,28 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr, return vma; } @@ -72283,7 +81686,7 @@ index 848ef52..d2b586c 100644 + BUG_ON(vma->vm_end - vma->vm_start != vma_m->vm_end - vma_m->vm_start); + BUG_ON(vma->vm_pgoff != vma_m->vm_pgoff); + BUG_ON(vma->anon_vma != vma_m->anon_vma && vma->anon_vma->root != vma_m->anon_vma->root); -+ BUG_ON((vma->vm_flags ^ vma_m->vm_flags) & ~(VM_WRITE | VM_MAYWRITE | VM_ACCOUNT | VM_LOCKED | VM_RESERVED)); ++ BUG_ON((vma->vm_flags ^ vma_m->vm_flags) & ~(VM_WRITE | VM_MAYWRITE | VM_ACCOUNT | VM_LOCKED)); + return vma_m; +} +#endif @@ -72291,7 +81694,7 @@ index 848ef52..d2b586c 100644 /* * Verify that the stack growth is acceptable and * update accounting. This is shared with both the -@@ -1688,6 +1936,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns +@@ -2017,6 +2291,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns return -ENOMEM; /* Stack limit test */ @@ -72299,7 +81702,7 @@ index 848ef52..d2b586c 100644 if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur)) return -ENOMEM; -@@ -1698,6 +1947,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns +@@ -2027,6 +2302,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns locked = mm->locked_vm + grow; limit = ACCESS_ONCE(rlim[RLIMIT_MEMLOCK].rlim_cur); limit >>= PAGE_SHIFT; @@ -72307,7 +81710,7 @@ index 848ef52..d2b586c 100644 if (locked > limit && !capable(CAP_IPC_LOCK)) return -ENOMEM; } -@@ -1728,37 +1978,48 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns +@@ -2056,37 +2332,48 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns * PA-RISC uses this for its stack; IA64 for its Register Backing Store. * vma is the last one with address > vma->vm_end. Have to extend vma. */ @@ -72365,7 +81768,7 @@ index 848ef52..d2b586c 100644 unsigned long size, grow; size = address - vma->vm_start; -@@ -1773,6 +2034,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) +@@ -2121,6 +2408,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) } } } @@ -72373,8 +81776,8 @@ index 848ef52..d2b586c 100644 + vma_unlock_anon_vma(vma->vm_next); vma_unlock_anon_vma(vma); khugepaged_enter_vma_merge(vma); - return error; -@@ -1786,6 +2049,8 @@ int expand_downwards(struct vm_area_struct *vma, + validate_mm(vma->vm_mm); +@@ -2135,6 +2424,8 @@ int expand_downwards(struct vm_area_struct *vma, unsigned long address) { int error; @@ -72383,7 +81786,7 @@ index 848ef52..d2b586c 100644 /* * We must make sure the anon_vma is allocated -@@ -1799,6 +2064,15 @@ int expand_downwards(struct vm_area_struct *vma, +@@ -2148,6 +2439,15 @@ int expand_downwards(struct vm_area_struct *vma, if (error) return error; @@ -72399,7 +81802,7 @@ index 848ef52..d2b586c 100644 vma_lock_anon_vma(vma); /* -@@ -1808,9 +2082,17 @@ int expand_downwards(struct vm_area_struct *vma, +@@ -2157,9 +2457,17 @@ int expand_downwards(struct vm_area_struct *vma, */ /* Somebody else might have raced and expanded it already */ @@ -72418,30 +81821,26 @@ index 848ef52..d2b586c 100644 size = vma->vm_end - address; grow = (vma->vm_start - address) >> PAGE_SHIFT; -@@ -1820,11 +2102,22 @@ int expand_downwards(struct vm_area_struct *vma, - if (!error) { - vma->vm_start = address; +@@ -2184,6 +2492,18 @@ int expand_downwards(struct vm_area_struct *vma, vma->vm_pgoff -= grow; + anon_vma_interval_tree_post_update_vma(vma); + vma_gap_update(vma); + track_exec_limit(vma->vm_mm, vma->vm_start, vma->vm_end, vma->vm_flags); + +#ifdef CONFIG_PAX_SEGMEXEC + if (vma_m) { ++ anon_vma_interval_tree_pre_update_vma(vma_m); + vma_m->vm_start -= grow << PAGE_SHIFT; + vma_m->vm_pgoff -= grow; ++ anon_vma_interval_tree_post_update_vma(vma_m); ++ vma_gap_update(vma_m); + } +#endif + + spin_unlock(&vma->vm_mm->page_table_lock); + perf_event_mmap(vma); - } - } - } - vma_unlock_anon_vma(vma); -+ if (lockprev) -+ vma_unlock_anon_vma(prev); - khugepaged_enter_vma_merge(vma); - return error; - } -@@ -1894,6 +2187,13 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma) +@@ -2288,6 +2608,13 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma) do { long nrpages = vma_pages(vma); @@ -72452,10 +81851,10 @@ index 848ef52..d2b586c 100644 + } +#endif + - mm->total_vm -= nrpages; + if (vma->vm_flags & VM_ACCOUNT) + nr_accounted += nrpages; vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages); - vma = remove_vma(vma); -@@ -1939,6 +2239,16 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2333,6 +2660,16 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, insertion_point = (prev ? &prev->vm_next : &mm->mmap); vma->vm_prev = NULL; do { @@ -72469,10 +81868,10 @@ index 848ef52..d2b586c 100644 + } +#endif + - rb_erase(&vma->vm_rb, &mm->mm_rb); + vma_rb_erase(vma, &mm->mm_rb); mm->map_count--; tail_vma = vma; -@@ -1967,14 +2277,33 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, +@@ -2364,14 +2701,33 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, struct vm_area_struct *new; int err = -ENOMEM; @@ -72506,7 +81905,7 @@ index 848ef52..d2b586c 100644 /* most fields are the same, copy all, and then fixup */ *new = *vma; -@@ -1987,6 +2316,22 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, +@@ -2384,6 +2740,22 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, new->vm_pgoff += ((addr - vma->vm_start) >> PAGE_SHIFT); } @@ -72529,7 +81928,7 @@ index 848ef52..d2b586c 100644 pol = mpol_dup(vma_policy(vma)); if (IS_ERR(pol)) { err = PTR_ERR(pol); -@@ -2012,6 +2357,42 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, +@@ -2406,6 +2778,36 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, else err = vma_adjust(vma, vma->vm_start, addr, vma->vm_pgoff, new); @@ -72541,11 +81940,8 @@ index 848ef52..d2b586c 100644 + mpol_get(pol); + vma_set_policy(new_m, pol); + -+ if (new_m->vm_file) { ++ if (new_m->vm_file) + get_file(new_m->vm_file); -+ if (vma_m->vm_flags & VM_EXECUTABLE) -+ added_exe_file_vma(mm); -+ } + + if (new_m->vm_ops && new_m->vm_ops->open) + new_m->vm_ops->open(new_m); @@ -72559,11 +81955,8 @@ index 848ef52..d2b586c 100644 + if (err) { + if (new_m->vm_ops && new_m->vm_ops->close) + new_m->vm_ops->close(new_m); -+ if (new_m->vm_file) { -+ if (vma_m->vm_flags & VM_EXECUTABLE) -+ removed_exe_file_vma(mm); ++ if (new_m->vm_file) + fput(new_m->vm_file); -+ } + mpol_put(pol); + } + } @@ -72572,10 +81965,10 @@ index 848ef52..d2b586c 100644 /* Success. */ if (!err) return 0; -@@ -2024,10 +2405,18 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, - removed_exe_file_vma(mm); +@@ -2415,10 +2817,18 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, + new->vm_ops->close(new); + if (new->vm_file) fput(new->vm_file); - } - unlink_anon_vmas(new); out_free_mpol: mpol_put(pol); @@ -72592,7 +81985,7 @@ index 848ef52..d2b586c 100644 kmem_cache_free(vm_area_cachep, new); out_err: return err; -@@ -2040,6 +2429,15 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, +@@ -2431,6 +2841,15 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, int new_below) { @@ -72608,7 +82001,7 @@ index 848ef52..d2b586c 100644 if (mm->map_count >= sysctl_max_map_count) return -ENOMEM; -@@ -2051,11 +2449,30 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2442,11 +2861,30 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, * work. This now handles partial unmappings. * Jeremy Fitzhardinge <jeremy@goop.org> */ @@ -72639,7 +82032,7 @@ index 848ef52..d2b586c 100644 if ((start & ~PAGE_MASK) || start > TASK_SIZE || len > TASK_SIZE-start) return -EINVAL; -@@ -2130,6 +2547,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) +@@ -2521,6 +2959,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) /* Fix up all other VM information */ remove_vma_list(mm, vma); @@ -72647,8 +82040,8 @@ index 848ef52..d2b586c 100644 + return 0; } - EXPORT_SYMBOL(do_munmap); -@@ -2139,6 +2558,13 @@ int vm_munmap(unsigned long start, size_t len) + +@@ -2529,6 +2969,13 @@ int vm_munmap(unsigned long start, size_t len) int ret; struct mm_struct *mm = current->mm; @@ -72662,7 +82055,7 @@ index 848ef52..d2b586c 100644 down_write(&mm->mmap_sem); ret = do_munmap(mm, start, len); up_write(&mm->mmap_sem); -@@ -2152,16 +2578,6 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) +@@ -2542,16 +2989,6 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) return vm_munmap(addr, len); } @@ -72679,7 +82072,7 @@ index 848ef52..d2b586c 100644 /* * this is really a simplified "do_mmap". it only handles * anonymous maps. eventually we may be able to do some -@@ -2175,6 +2591,7 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) +@@ -2565,6 +3002,7 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) struct rb_node ** rb_link, * rb_parent; pgoff_t pgoff = addr >> PAGE_SHIFT; int error; @@ -72687,7 +82080,7 @@ index 848ef52..d2b586c 100644 len = PAGE_ALIGN(len); if (!len) -@@ -2186,16 +2603,30 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) +@@ -2572,16 +3010,30 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags; @@ -72719,20 +82112,17 @@ index 848ef52..d2b586c 100644 locked += mm->locked_vm; lock_limit = rlimit(RLIMIT_MEMLOCK); lock_limit >>= PAGE_SHIFT; -@@ -2212,22 +2643,22 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) +@@ -2598,21 +3050,20 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) /* * Clear old maps. this also does some error checking for us */ - munmap_back: - vma = find_vma_prepare(mm, addr, &prev, &rb_link, &rb_parent); - if (vma && vma->vm_start < addr + len) { + if (find_vma_links(mm, addr, addr + len, &prev, &rb_link, &rb_parent)) { if (do_munmap(mm, addr, len)) return -ENOMEM; - goto munmap_back; -- } -+ vma = find_vma_prepare(mm, addr, &prev, &rb_link, &rb_parent); -+ BUG_ON(vma && vma->vm_start < addr + len); -+ } ++ BUG_ON(find_vma_links(mm, addr, addr + len, &prev, &rb_link, &rb_parent)); + } /* Check against address space limits *after* clearing old maps... */ - if (!may_expand_vm(mm, len >> PAGE_SHIFT)) @@ -72747,7 +82137,7 @@ index 848ef52..d2b586c 100644 return -ENOMEM; /* Can we just expand an old private anonymous mapping? */ -@@ -2241,7 +2672,7 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) +@@ -2626,7 +3077,7 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) */ vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); if (!vma) { @@ -72756,52 +82146,45 @@ index 848ef52..d2b586c 100644 return -ENOMEM; } -@@ -2255,11 +2686,12 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) +@@ -2640,9 +3091,10 @@ static unsigned long do_brk(unsigned long addr, unsigned long len) vma_link(mm, vma, prev, rb_link, rb_parent); out: perf_event_mmap(vma); - mm->total_vm += len >> PAGE_SHIFT; + mm->total_vm += charged; - if (flags & VM_LOCKED) { - if (!mlock_vma_pages_range(vma, addr, addr + len)) -- mm->locked_vm += (len >> PAGE_SHIFT); -+ mm->locked_vm += charged; - } + if (flags & VM_LOCKED) +- mm->locked_vm += (len >> PAGE_SHIFT); ++ mm->locked_vm += charged; + track_exec_limit(mm, addr, addr + len, flags); return addr; } -@@ -2315,8 +2747,10 @@ void exit_mmap(struct mm_struct *mm) - * Walk the list again, actually closing and freeing it, - * with preemption enabled, without holding any MM locks. - */ -- while (vma) -+ while (vma) { +@@ -2704,6 +3156,7 @@ void exit_mmap(struct mm_struct *mm) + while (vma) { + if (vma->vm_flags & VM_ACCOUNT) + nr_accounted += vma_pages(vma); + vma->vm_mirror = NULL; vma = remove_vma(vma); -+ } - - BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT); - } -@@ -2330,6 +2764,13 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma) - struct vm_area_struct * __vma, * prev; - struct rb_node ** rb_link, * rb_parent; + } + vm_unacct_memory(nr_accounted); +@@ -2720,6 +3173,13 @@ int insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma) + struct vm_area_struct *prev; + struct rb_node **rb_link, *rb_parent; +#ifdef CONFIG_PAX_SEGMEXEC + struct vm_area_struct *vma_m = NULL; +#endif + -+ if (security_file_mmap(NULL, 0, 0, 0, vma->vm_start, 1)) ++ if (security_mmap_addr(vma->vm_start)) + return -EPERM; + /* * The vm_pgoff of a purely anonymous vma should be irrelevant * until its first write fault, when page's anon_vma and index -@@ -2352,7 +2793,22 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma) - if ((vma->vm_flags & VM_ACCOUNT) && +@@ -2743,7 +3203,21 @@ int insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma) security_vm_enough_memory_mm(mm, vma_pages(vma))) return -ENOMEM; -+ + +#ifdef CONFIG_PAX_SEGMEXEC + if ((mm->pax_flags & MF_PAX_SEGMEXEC) && (vma->vm_flags & VM_EXEC)) { + vma_m = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); @@ -72820,7 +82203,7 @@ index 848ef52..d2b586c 100644 return 0; } -@@ -2371,6 +2827,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, +@@ -2763,6 +3237,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, struct mempolicy *pol; bool faulted_in_anon_vma = true; @@ -72829,7 +82212,7 @@ index 848ef52..d2b586c 100644 /* * If anonymous vma has not yet been faulted, update new pgoff * to match new location, to increase its chance of merging. -@@ -2438,6 +2896,39 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, +@@ -2829,6 +3305,39 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, return NULL; } @@ -72858,7 +82241,7 @@ index 848ef52..d2b586c 100644 + get_file(vma_m->vm_file); + if (vma_m->vm_ops && vma_m->vm_ops->open) + vma_m->vm_ops->open(vma_m); -+ find_vma_prepare(vma->vm_mm, vma_m->vm_start, &prev_m, &rb_link_m, &rb_parent_m); ++ BUG_ON(find_vma_links(vma->vm_mm, vma_m->vm_start, vma_m->vm_end, &prev_m, &rb_link_m, &rb_parent_m)); + vma_link(vma->vm_mm, vma_m, prev_m, rb_link_m, rb_parent_m); + vma_m->vm_mirror = vma; + vma->vm_mirror = vma_m; @@ -72869,20 +82252,15 @@ index 848ef52..d2b586c 100644 /* * Return true if the calling process may expand its vm space by the passed * number of pages -@@ -2449,6 +2940,12 @@ int may_expand_vm(struct mm_struct *mm, unsigned long npages) +@@ -2840,6 +3349,7 @@ int may_expand_vm(struct mm_struct *mm, unsigned long npages) lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT; -+#ifdef CONFIG_PAX_RANDMMAP -+ if (mm->pax_flags & MF_PAX_RANDMMAP) -+ cur -= mm->brk_gap; -+#endif -+ + gr_learn_resource(current, RLIMIT_AS, (cur + npages) << PAGE_SHIFT, 1); if (cur + npages > lim) return 0; return 1; -@@ -2519,6 +3016,22 @@ int install_special_mapping(struct mm_struct *mm, +@@ -2910,6 +3420,22 @@ int install_special_mapping(struct mm_struct *mm, vma->vm_start = addr; vma->vm_end = addr + len; @@ -72906,13 +82284,14 @@ index 848ef52..d2b586c 100644 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); diff --git a/mm/mprotect.c b/mm/mprotect.c -index a409926..8b32e6d 100644 +index 94722a4..07d9926 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c -@@ -23,10 +23,17 @@ +@@ -23,10 +23,18 @@ #include <linux/mmu_notifier.h> #include <linux/migrate.h> #include <linux/perf_event.h> ++#include <linux/sched/sysctl.h> + +#ifdef CONFIG_PAX_MPROTECT +#include <linux/elf.h> @@ -72927,8 +82306,8 @@ index a409926..8b32e6d 100644 #ifndef pgprot_modify static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) -@@ -141,6 +148,48 @@ static void change_protection(struct vm_area_struct *vma, - flush_tlb_range(vma, start, end); +@@ -233,6 +241,48 @@ unsigned long change_protection(struct vm_area_struct *vma, unsigned long start, + return pages; } +#ifdef CONFIG_ARCH_TRACK_EXEC_LIMIT @@ -72968,7 +82347,7 @@ index a409926..8b32e6d 100644 + if (is_vm_hugetlb_page(vma)) + hugetlb_change_protection(vma, vma->vm_start, vma->vm_end, vma->vm_page_prot); + else -+ change_protection(vma, vma->vm_start, vma->vm_end, vma->vm_page_prot, vma_wants_writenotify(vma)); ++ change_protection(vma, vma->vm_start, vma->vm_end, vma->vm_page_prot, vma_wants_writenotify(vma), 0); + } +} +#endif @@ -72976,7 +82355,7 @@ index a409926..8b32e6d 100644 int mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, unsigned long start, unsigned long end, unsigned long newflags) -@@ -153,11 +202,29 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, +@@ -245,11 +295,29 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, int error; int dirty_accountable = 0; @@ -73006,7 +82385,7 @@ index a409926..8b32e6d 100644 /* * If we make a private mapping writable we increase our commit; * but (without finer accounting) cannot reduce our commit if we -@@ -174,6 +241,42 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, +@@ -266,6 +334,42 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, } } @@ -73049,7 +82428,7 @@ index a409926..8b32e6d 100644 /* * First try to merge with previous and/or next vma. */ -@@ -204,9 +307,21 @@ success: +@@ -296,9 +400,21 @@ success: * vm_flags and vm_page_prot are protected by the mmap_sem * held in write mode. */ @@ -73072,7 +82451,7 @@ index a409926..8b32e6d 100644 if (vma_wants_writenotify(vma)) { vma->vm_page_prot = vm_get_page_prot(newflags & ~VM_SHARED); -@@ -248,6 +363,17 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, +@@ -337,6 +453,17 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, end = start + len; if (end <= start) return -ENOMEM; @@ -73090,7 +82469,7 @@ index a409926..8b32e6d 100644 if (!arch_validate_prot(prot)) return -EINVAL; -@@ -255,7 +381,7 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, +@@ -344,7 +471,7 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, /* * Does the application expect PROT_READ to imply PROT_EXEC: */ @@ -73099,7 +82478,7 @@ index a409926..8b32e6d 100644 prot |= PROT_EXEC; vm_flags = calc_vm_prot_bits(prot); -@@ -288,6 +414,11 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, +@@ -376,6 +503,11 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, if (start > vma->vm_start) prev = vma; @@ -73111,7 +82490,7 @@ index a409926..8b32e6d 100644 for (nstart = start ; ; ) { unsigned long newflags; -@@ -297,6 +428,14 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, +@@ -386,6 +518,14 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, /* newflags >> 4 shift VM_MAY% in place of VM_% */ if ((newflags & ~(newflags >> 4)) & (VM_READ | VM_WRITE | VM_EXEC)) { @@ -73126,7 +82505,7 @@ index a409926..8b32e6d 100644 error = -EACCES; goto out; } -@@ -311,6 +450,9 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, +@@ -400,6 +540,9 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, error = mprotect_fixup(vma, &prev, nstart, tmp, newflags); if (error) goto out; @@ -73137,10 +82516,10 @@ index a409926..8b32e6d 100644 if (nstart < prev->vm_end) diff --git a/mm/mremap.c b/mm/mremap.c -index db8d983..76506cb 100644 +index 463a257..c0c7a92 100644 --- a/mm/mremap.c +++ b/mm/mremap.c -@@ -106,6 +106,12 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, +@@ -126,6 +126,12 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, continue; pte = ptep_get_and_clear(mm, old_addr, old_pte); pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr); @@ -73153,7 +82532,7 @@ index db8d983..76506cb 100644 set_pte_at(mm, new_addr, new_pte, pte); } -@@ -299,6 +305,11 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr, +@@ -318,6 +324,11 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr, if (is_vm_hugetlb_page(vma)) goto Einval; @@ -73165,7 +82544,7 @@ index db8d983..76506cb 100644 /* We can't remap across vm area boundaries */ if (old_len > vma->vm_end - addr) goto Efault; -@@ -355,20 +366,25 @@ static unsigned long mremap_to(unsigned long addr, +@@ -373,20 +384,25 @@ static unsigned long mremap_to(unsigned long addr, unsigned long old_len, unsigned long ret = -EINVAL; unsigned long charged = 0; unsigned long map_flags; @@ -73195,16 +82574,16 @@ index db8d983..76506cb 100644 + if (addr + old_len > new_addr && new_addr + new_len > addr) goto out; - ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); -@@ -440,6 +456,7 @@ unsigned long do_mremap(unsigned long addr, - struct vm_area_struct *vma; + ret = do_munmap(mm, new_addr, new_len); +@@ -455,6 +471,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long ret = -EINVAL; unsigned long charged = 0; + bool locked = false; + unsigned long pax_task_size = TASK_SIZE; - if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE)) - goto out; -@@ -458,6 +475,17 @@ unsigned long do_mremap(unsigned long addr, + down_write(¤t->mm->mmap_sem); + +@@ -475,6 +492,17 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, if (!new_len) goto out; @@ -73221,22 +82600,21 @@ index db8d983..76506cb 100644 + if (flags & MREMAP_FIXED) { if (flags & MREMAP_MAYMOVE) - ret = mremap_to(addr, old_len, new_addr, new_len); -@@ -507,6 +535,7 @@ unsigned long do_mremap(unsigned long addr, - addr + new_len); + ret = mremap_to(addr, old_len, new_addr, new_len, +@@ -524,6 +552,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, + new_addr = addr; } ret = addr; + track_exec_limit(vma->vm_mm, vma->vm_start, addr + new_len, vma->vm_flags); goto out; } } -@@ -533,7 +562,13 @@ unsigned long do_mremap(unsigned long addr, - ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); - if (ret) +@@ -547,7 +576,12 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, goto out; -+ + } + + map_flags = vma->vm_flags; - ret = move_vma(vma, addr, old_len, new_len, new_addr); + ret = move_vma(vma, addr, old_len, new_len, new_addr, &locked); + if (!(ret & ~PAGE_MASK)) { + track_exec_limit(current->mm, addr, addr + old_len, 0UL); + track_exec_limit(current->mm, new_addr, new_addr + new_len, map_flags); @@ -73245,10 +82623,10 @@ index db8d983..76506cb 100644 out: if (ret & ~PAGE_MASK) diff --git a/mm/nommu.c b/mm/nommu.c -index bb8f4f0..40d3e02 100644 +index e001768..9b52b30 100644 --- a/mm/nommu.c +++ b/mm/nommu.c -@@ -62,7 +62,6 @@ int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ +@@ -63,7 +63,6 @@ int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ int sysctl_overcommit_ratio = 50; /* default is 50% */ int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT; int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS; @@ -73256,7 +82634,7 @@ index bb8f4f0..40d3e02 100644 atomic_long_t mmap_pages_allocated; -@@ -827,15 +826,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) +@@ -841,15 +840,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) EXPORT_SYMBOL(find_vma); /* @@ -73272,7 +82650,7 @@ index bb8f4f0..40d3e02 100644 * expand a stack to a given address * - not supported under NOMMU conditions */ -@@ -1580,6 +1570,7 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -1560,6 +1550,7 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, /* most fields are the same, copy all, and then fixup */ *new = *vma; @@ -73280,11 +82658,72 @@ index bb8f4f0..40d3e02 100644 *region = *vma->vm_region; new->vm_region = region; +@@ -1992,8 +1983,8 @@ int generic_file_remap_pages(struct vm_area_struct *vma, unsigned long addr, + } + EXPORT_SYMBOL(generic_file_remap_pages); + +-static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, +- unsigned long addr, void *buf, int len, int write) ++static ssize_t __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, ++ unsigned long addr, void *buf, size_t len, int write) + { + struct vm_area_struct *vma; + +@@ -2034,8 +2025,8 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, + * + * The caller must hold a reference on @mm. + */ +-int access_remote_vm(struct mm_struct *mm, unsigned long addr, +- void *buf, int len, int write) ++ssize_t access_remote_vm(struct mm_struct *mm, unsigned long addr, ++ void *buf, size_t len, int write) + { + return __access_remote_vm(NULL, mm, addr, buf, len, write); + } +@@ -2044,7 +2035,7 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr, + * Access another process' address space. + * - source/target buffer must be kernel space + */ +-int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write) ++ssize_t access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, size_t len, int write) + { + struct mm_struct *mm; + +diff --git a/mm/page-writeback.c b/mm/page-writeback.c +index efe6814..64b4701 100644 +--- a/mm/page-writeback.c ++++ b/mm/page-writeback.c +@@ -659,7 +659,7 @@ unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, unsigned long dirty) + * card's bdi_dirty may rush to many times higher than bdi_setpoint. + * - the bdi dirty thresh drops quickly due to change of JBOD workload + */ +-static unsigned long bdi_position_ratio(struct backing_dev_info *bdi, ++static unsigned long __intentional_overflow(-1) bdi_position_ratio(struct backing_dev_info *bdi, + unsigned long thresh, + unsigned long bg_thresh, + unsigned long dirty, +@@ -1634,7 +1634,7 @@ ratelimit_handler(struct notifier_block *self, unsigned long action, + } + } + +-static struct notifier_block __cpuinitdata ratelimit_nb = { ++static struct notifier_block ratelimit_nb = { + .notifier_call = ratelimit_handler, + .next = NULL, + }; diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 918330f..ae99ae1 100644 +index 8fcced7..ebcd481 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -335,7 +335,7 @@ out: +@@ -59,6 +59,7 @@ + #include <linux/migrate.h> + #include <linux/page-debug-flags.h> + #include <linux/sched/rt.h> ++#include <linux/random.h> + + #include <asm/tlbflush.h> + #include <asm/div64.h> +@@ -344,7 +345,7 @@ out: * This usage means that zero-order pages may not be compound. */ @@ -73293,7 +82732,7 @@ index 918330f..ae99ae1 100644 { __free_pages_ok(page, compound_order(page)); } -@@ -692,6 +692,10 @@ static bool free_pages_prepare(struct page *page, unsigned int order) +@@ -701,6 +702,10 @@ static bool free_pages_prepare(struct page *page, unsigned int order) int i; int bad = 0; @@ -73304,7 +82743,7 @@ index 918330f..ae99ae1 100644 trace_mm_page_free(page, order); kmemcheck_free_shadow(page, order); -@@ -707,6 +711,12 @@ static bool free_pages_prepare(struct page *page, unsigned int order) +@@ -716,6 +721,12 @@ static bool free_pages_prepare(struct page *page, unsigned int order) debug_check_no_obj_freed(page_address(page), PAGE_SIZE << order); } @@ -73317,7 +82756,47 @@ index 918330f..ae99ae1 100644 arch_free_page(page, order); kernel_map_pages(page, 1 << order, 0); -@@ -830,8 +840,10 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags) +@@ -738,6 +749,19 @@ static void __free_pages_ok(struct page *page, unsigned int order) + local_irq_restore(flags); + } + ++#ifdef CONFIG_PAX_LATENT_ENTROPY ++bool __meminitdata extra_latent_entropy; ++ ++static int __init setup_pax_extra_latent_entropy(char *str) ++{ ++ extra_latent_entropy = true; ++ return 0; ++} ++early_param("pax_extra_latent_entropy", setup_pax_extra_latent_entropy); ++ ++volatile u64 latent_entropy; ++#endif ++ + /* + * Read access to zone->managed_pages is safe because it's unsigned long, + * but we still need to serialize writers. Currently all callers of +@@ -760,6 +784,19 @@ void __meminit __free_pages_bootmem(struct page *page, unsigned int order) + set_page_count(p, 0); + } + ++#ifdef CONFIG_PAX_LATENT_ENTROPY ++ if (extra_latent_entropy && !PageHighMem(page) && page_to_pfn(page) < 0x100000) { ++ u64 hash = 0; ++ size_t index, end = PAGE_SIZE * nr_pages / sizeof hash; ++ const u64 *data = lowmem_page_address(page); ++ ++ for (index = 0; index < end; index++) ++ hash ^= hash + data[index]; ++ latent_entropy ^= hash; ++ add_device_randomness((const void *)&latent_entropy, sizeof(latent_entropy)); ++ } ++#endif ++ + page_zone(page)->managed_pages += 1 << order; + set_page_refcounted(page); + __free_pages(page, order); +@@ -869,8 +906,10 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags) arch_alloc_page(page, order); kernel_map_pages(page, 1 << order, 1); @@ -73328,22 +82807,8 @@ index 918330f..ae99ae1 100644 if (order && (gfp_flags & __GFP_COMP)) prep_compound_page(page, order); -@@ -3523,7 +3535,13 @@ static int pageblock_is_reserved(unsigned long start_pfn, unsigned long end_pfn) - unsigned long pfn; - - for (pfn = start_pfn; pfn < end_pfn; pfn++) { -+#ifdef CONFIG_X86_32 -+ /* boot failures in VMware 8 on 32bit vanilla since -+ this change */ -+ if (!pfn_valid(pfn) || PageReserved(pfn_to_page(pfn))) -+#else - if (!pfn_valid_within(pfn) || PageReserved(pfn_to_page(pfn))) -+#endif - return 1; - } - return 0; diff --git a/mm/percpu.c b/mm/percpu.c -index bb4be74..a43ea85 100644 +index 8c8e08f..73a5cda 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -122,7 +122,7 @@ static unsigned int pcpu_low_unit_cpu __read_mostly; @@ -73356,7 +82821,7 @@ index bb4be74..a43ea85 100644 static const int *pcpu_unit_map __read_mostly; /* cpu -> unit */ diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c -index c20ff48..137702a 100644 +index fd26d04..0cea1b0 100644 --- a/mm/process_vm_access.c +++ b/mm/process_vm_access.c @@ -13,6 +13,7 @@ @@ -73407,10 +82872,10 @@ index c20ff48..137702a 100644 if (!mm || IS_ERR(mm)) { rc = IS_ERR(mm) ? PTR_ERR(mm) : -ESRCH; diff --git a/mm/rmap.c b/mm/rmap.c -index 5b5ad58..0f77903 100644 +index 807c96b..0e05279 100644 --- a/mm/rmap.c +++ b/mm/rmap.c -@@ -167,6 +167,10 @@ int anon_vma_prepare(struct vm_area_struct *vma) +@@ -163,6 +163,10 @@ int anon_vma_prepare(struct vm_area_struct *vma) struct anon_vma *anon_vma = vma->anon_vma; struct anon_vma_chain *avc; @@ -73421,7 +82886,7 @@ index 5b5ad58..0f77903 100644 might_sleep(); if (unlikely(!anon_vma)) { struct mm_struct *mm = vma->vm_mm; -@@ -176,6 +180,12 @@ int anon_vma_prepare(struct vm_area_struct *vma) +@@ -172,6 +176,12 @@ int anon_vma_prepare(struct vm_area_struct *vma) if (!avc) goto out_enomem; @@ -73434,7 +82899,7 @@ index 5b5ad58..0f77903 100644 anon_vma = find_mergeable_anon_vma(vma); allocated = NULL; if (!anon_vma) { -@@ -189,6 +199,18 @@ int anon_vma_prepare(struct vm_area_struct *vma) +@@ -185,6 +195,18 @@ int anon_vma_prepare(struct vm_area_struct *vma) /* page_table_lock to protect against threads */ spin_lock(&mm->page_table_lock); if (likely(!vma->anon_vma)) { @@ -73453,7 +82918,7 @@ index 5b5ad58..0f77903 100644 vma->anon_vma = anon_vma; anon_vma_chain_link(vma, avc, anon_vma); allocated = NULL; -@@ -199,12 +221,24 @@ int anon_vma_prepare(struct vm_area_struct *vma) +@@ -195,12 +217,24 @@ int anon_vma_prepare(struct vm_area_struct *vma) if (unlikely(allocated)) put_anon_vma(allocated); @@ -73478,7 +82943,7 @@ index 5b5ad58..0f77903 100644 anon_vma_chain_free(avc); out_enomem: return -ENOMEM; -@@ -240,7 +274,7 @@ static inline void unlock_anon_vma_root(struct anon_vma *root) +@@ -236,7 +270,7 @@ static inline void unlock_anon_vma_root(struct anon_vma *root) * Attach the anon_vmas from src to dst. * Returns 0 on success, -ENOMEM on failure. */ @@ -73487,7 +82952,7 @@ index 5b5ad58..0f77903 100644 { struct anon_vma_chain *avc, *pavc; struct anon_vma *root = NULL; -@@ -318,7 +352,7 @@ void anon_vma_moveto_tail(struct vm_area_struct *dst) +@@ -269,7 +303,7 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src) * the corresponding VMA in the parent process is attached to. * Returns 0 on success, non-zero on failure. */ @@ -73497,7 +82962,7 @@ index 5b5ad58..0f77903 100644 struct anon_vma_chain *avc; struct anon_vma *anon_vma; diff --git a/mm/shmem.c b/mm/shmem.c -index 9d65a02..7c877e7 100644 +index 1c44af7..cefe9a6 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -31,7 +31,7 @@ @@ -73509,16 +82974,44 @@ index 9d65a02..7c877e7 100644 #ifdef CONFIG_SHMEM /* -@@ -74,7 +74,7 @@ static struct vfsmount *shm_mnt; +@@ -75,7 +75,7 @@ static struct vfsmount *shm_mnt; #define BOGO_DIRENT_SIZE 20 /* Symlink up to this size is kmalloc'ed instead of using a swappable page */ -#define SHORT_SYMLINK_LEN 128 +#define SHORT_SYMLINK_LEN 64 - struct shmem_xattr { - struct list_head list; /* anchored by shmem_inode_info->xattr_list */ -@@ -2236,8 +2236,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent) + /* + * shmem_fallocate and shmem_writepage communicate via inode->i_private +@@ -2201,6 +2201,11 @@ static const struct xattr_handler *shmem_xattr_handlers[] = { + static int shmem_xattr_validate(const char *name) + { + struct { const char *prefix; size_t len; } arr[] = { ++ ++#ifdef CONFIG_PAX_XATTR_PAX_FLAGS ++ { XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN}, ++#endif ++ + { XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN }, + { XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN } + }; +@@ -2256,6 +2261,15 @@ static int shmem_setxattr(struct dentry *dentry, const char *name, + if (err) + return err; + ++#ifdef CONFIG_PAX_XATTR_PAX_FLAGS ++ if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { ++ if (strcmp(name, XATTR_NAME_PAX_FLAGS)) ++ return -EOPNOTSUPP; ++ if (size > 8) ++ return -EINVAL; ++ } ++#endif ++ + return simple_xattr_set(&info->xattrs, name, value, size, flags); + } + +@@ -2568,8 +2582,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent) int err = -ENOMEM; /* Round up to L1_CACHE_BYTES to resist false sharing */ @@ -73529,28 +83022,10 @@ index 9d65a02..7c877e7 100644 return -ENOMEM; diff --git a/mm/slab.c b/mm/slab.c -index e901a36..9ff3f90 100644 +index 856e4a1..fafb820 100644 --- a/mm/slab.c +++ b/mm/slab.c -@@ -153,7 +153,7 @@ - - /* Legal flag mask for kmem_cache_create(). */ - #if DEBUG --# define CREATE_MASK (SLAB_RED_ZONE | \ -+# define CREATE_MASK (SLAB_USERCOPY | SLAB_RED_ZONE | \ - SLAB_POISON | SLAB_HWCACHE_ALIGN | \ - SLAB_CACHE_DMA | \ - SLAB_STORE_USER | \ -@@ -161,7 +161,7 @@ - SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD | \ - SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE | SLAB_NOTRACK) - #else --# define CREATE_MASK (SLAB_HWCACHE_ALIGN | \ -+# define CREATE_MASK (SLAB_USERCOPY | SLAB_HWCACHE_ALIGN | \ - SLAB_CACHE_DMA | \ - SLAB_RECLAIM_ACCOUNT | SLAB_PANIC | \ - SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD | \ -@@ -290,7 +290,7 @@ struct kmem_list3 { +@@ -306,7 +306,7 @@ struct kmem_list3 { * Need this for bootstrapping a per node allocator. */ #define NUM_INIT_LISTS (3 * MAX_NUMNODES) @@ -73559,7 +83034,7 @@ index e901a36..9ff3f90 100644 #define CACHE_CACHE 0 #define SIZE_AC MAX_NUMNODES #define SIZE_L3 (2 * MAX_NUMNODES) -@@ -391,10 +391,10 @@ static void kmem_list3_init(struct kmem_list3 *parent) +@@ -407,10 +407,10 @@ static void kmem_list3_init(struct kmem_list3 *parent) if ((x)->max_freeable < i) \ (x)->max_freeable = i; \ } while (0) @@ -73574,7 +83049,7 @@ index e901a36..9ff3f90 100644 #else #define STATS_INC_ACTIVE(x) do { } while (0) #define STATS_DEC_ACTIVE(x) do { } while (0) -@@ -542,7 +542,7 @@ static inline void *index_to_obj(struct kmem_cache *cache, struct slab *slab, +@@ -518,7 +518,7 @@ static inline void *index_to_obj(struct kmem_cache *cache, struct slab *slab, * reciprocal_divide(offset, cache->reciprocal_buffer_size) */ static inline unsigned int obj_to_index(const struct kmem_cache *cache, @@ -73583,7 +83058,7 @@ index e901a36..9ff3f90 100644 { u32 offset = (obj - slab->s_mem); return reciprocal_divide(offset, cache->reciprocal_buffer_size); -@@ -563,12 +563,13 @@ EXPORT_SYMBOL(malloc_sizes); +@@ -539,12 +539,13 @@ EXPORT_SYMBOL(malloc_sizes); struct cache_names { char *name; char *name_dma; @@ -73599,7 +83074,7 @@ index e901a36..9ff3f90 100644 #undef CACHE }; -@@ -756,6 +757,12 @@ static inline struct kmem_cache *__find_general_cachep(size_t size, +@@ -729,6 +730,12 @@ static inline struct kmem_cache *__find_general_cachep(size_t size, if (unlikely(gfpflags & GFP_DMA)) return csizep->cs_dmacachep; #endif @@ -73612,51 +83087,61 @@ index e901a36..9ff3f90 100644 return csizep->cs_cachep; } -@@ -1588,7 +1595,7 @@ void __init kmem_cache_init(void) - sizes[INDEX_AC].cs_cachep = kmem_cache_create(names[INDEX_AC].name, - sizes[INDEX_AC].cs_size, - ARCH_KMALLOC_MINALIGN, -- ARCH_KMALLOC_FLAGS|SLAB_PANIC, -+ ARCH_KMALLOC_FLAGS|SLAB_PANIC|SLAB_USERCOPY, - NULL); - - if (INDEX_AC != INDEX_L3) { -@@ -1596,7 +1603,7 @@ void __init kmem_cache_init(void) - kmem_cache_create(names[INDEX_L3].name, - sizes[INDEX_L3].cs_size, - ARCH_KMALLOC_MINALIGN, -- ARCH_KMALLOC_FLAGS|SLAB_PANIC, -+ ARCH_KMALLOC_FLAGS|SLAB_PANIC|SLAB_USERCOPY, - NULL); - } - -@@ -1614,7 +1621,7 @@ void __init kmem_cache_init(void) - sizes->cs_cachep = kmem_cache_create(names->name, - sizes->cs_size, - ARCH_KMALLOC_MINALIGN, -- ARCH_KMALLOC_FLAGS|SLAB_PANIC, -+ ARCH_KMALLOC_FLAGS|SLAB_PANIC|SLAB_USERCOPY, - NULL); - } +@@ -1482,7 +1489,7 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb, + return notifier_from_errno(err); + } + +-static struct notifier_block __cpuinitdata cpucache_notifier = { ++static struct notifier_block cpucache_notifier = { + &cpuup_callback, NULL, 0 + }; + +@@ -1667,12 +1674,12 @@ void __init kmem_cache_init(void) + */ + + sizes[INDEX_AC].cs_cachep = create_kmalloc_cache(names[INDEX_AC].name, +- sizes[INDEX_AC].cs_size, ARCH_KMALLOC_FLAGS); ++ sizes[INDEX_AC].cs_size, ARCH_KMALLOC_FLAGS|SLAB_USERCOPY); + + if (INDEX_AC != INDEX_L3) + sizes[INDEX_L3].cs_cachep = + create_kmalloc_cache(names[INDEX_L3].name, +- sizes[INDEX_L3].cs_size, ARCH_KMALLOC_FLAGS); ++ sizes[INDEX_L3].cs_size, ARCH_KMALLOC_FLAGS|SLAB_USERCOPY); + + slab_early_init = 0; + +@@ -1686,13 +1693,20 @@ void __init kmem_cache_init(void) + */ + if (!sizes->cs_cachep) + sizes->cs_cachep = create_kmalloc_cache(names->name, +- sizes->cs_size, ARCH_KMALLOC_FLAGS); ++ sizes->cs_size, ARCH_KMALLOC_FLAGS|SLAB_USERCOPY); + #ifdef CONFIG_ZONE_DMA -@@ -1626,6 +1633,16 @@ void __init kmem_cache_init(void) - SLAB_PANIC, - NULL); + sizes->cs_dmacachep = create_kmalloc_cache( + names->name_dma, sizes->cs_size, + SLAB_CACHE_DMA|ARCH_KMALLOC_FLAGS); #endif + +#ifdef CONFIG_PAX_USERCOPY_SLABS -+ sizes->cs_usercopycachep = kmem_cache_create( -+ names->name_usercopy, -+ sizes->cs_size, -+ ARCH_KMALLOC_MINALIGN, -+ ARCH_KMALLOC_FLAGS|SLAB_PANIC|SLAB_USERCOPY, -+ NULL); ++ sizes->cs_usercopycachep = create_kmalloc_cache( ++ names->name_usercopy, sizes->cs_size, ++ ARCH_KMALLOC_FLAGS|SLAB_USERCOPY); +#endif + sizes++; names++; } -@@ -4390,10 +4407,10 @@ static int s_show(struct seq_file *m, void *p) +@@ -3924,6 +3938,7 @@ void kfree(const void *objp) + + if (unlikely(ZERO_OR_NULL_PTR(objp))) + return; ++ VM_BUG_ON(!virt_addr_valid(objp)); + local_irq_save(flags); + kfree_debugcheck(objp); + c = virt_to_cache(objp); +@@ -4365,10 +4380,10 @@ void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *cachep) } /* cpu stats */ { @@ -73671,9 +83156,9 @@ index e901a36..9ff3f90 100644 seq_printf(m, " : cpustat %6lu %6lu %6lu %6lu", allochit, allocmiss, freehit, freemiss); -@@ -4652,13 +4669,71 @@ static int __init slab_proc_init(void) +@@ -4600,13 +4615,71 @@ static const struct file_operations proc_slabstats_operations = { + static int __init slab_proc_init(void) { - proc_create("slabinfo",S_IWUSR|S_IRUSR,NULL,&proc_slabinfo_operations); #ifdef CONFIG_DEBUG_SLAB_LEAK - proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations); + proc_create("slab_allocators", S_IRUSR, NULL, &proc_slabstats_operations); @@ -73702,12 +83187,12 @@ index e901a36..9ff3f90 100644 + if (!PageSlab(page)) + return false; + -+ cachep = page_get_cache(page); ++ cachep = page->slab_cache; + return cachep->flags & SLAB_USERCOPY; +} + +#ifdef CONFIG_PAX_USERCOPY -+const char *check_heap_object(const void *ptr, unsigned long n, bool to) ++const char *check_heap_object(const void *ptr, unsigned long n) +{ + struct page *page; + struct kmem_cache *cachep; @@ -73726,15 +83211,15 @@ index e901a36..9ff3f90 100644 + if (!PageSlab(page)) + return NULL; + -+ cachep = page_get_cache(page); ++ cachep = page->slab_cache; + if (!(cachep->flags & SLAB_USERCOPY)) + return cachep->name; + -+ slabp = page_get_slab(page); ++ slabp = page->slab_page; + objnr = obj_to_index(cachep, slabp, ptr); + BUG_ON(objnr >= cachep->num); + offset = ptr - index_to_obj(cachep, slabp, objnr) - obj_offset(cachep); -+ if (offset <= obj_size(cachep) && n <= obj_size(cachep) - offset) ++ if (offset <= cachep->object_size && n <= cachep->object_size - offset) + return NULL; + + return cachep->name; @@ -73744,57 +83229,84 @@ index e901a36..9ff3f90 100644 /** * ksize - get the actual amount of memory allocated for a given object * @objp: Pointer to the object -diff --git a/mm/slob.c b/mm/slob.c -index 8105be4..33e52d7 100644 ---- a/mm/slob.c -+++ b/mm/slob.c -@@ -29,7 +29,7 @@ - * If kmalloc is asked for objects of PAGE_SIZE or larger, it calls - * alloc_pages() directly, allocating compound pages so the page order - * does not have to be separately tracked, and also stores the exact -- * allocation size in page->private so that it can be used to accurately -+ * allocation size in slob_page->size so that it can be used to accurately - * provide ksize(). These objects are detected in kfree() because slob_page() - * is false for them. - * -@@ -58,6 +58,7 @@ - */ +diff --git a/mm/slab.h b/mm/slab.h +index 34a98d6..73633d1 100644 +--- a/mm/slab.h ++++ b/mm/slab.h +@@ -58,7 +58,7 @@ __kmem_cache_alias(struct mem_cgroup *memcg, const char *name, size_t size, + + /* Legal flag mask for kmem_cache_create(), for various configurations */ + #define SLAB_CORE_FLAGS (SLAB_HWCACHE_ALIGN | SLAB_CACHE_DMA | SLAB_PANIC | \ +- SLAB_DESTROY_BY_RCU | SLAB_DEBUG_OBJECTS ) ++ SLAB_DESTROY_BY_RCU | SLAB_DEBUG_OBJECTS | SLAB_USERCOPY) + + #if defined(CONFIG_DEBUG_SLAB) + #define SLAB_DEBUG_FLAGS (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER) +@@ -220,6 +220,9 @@ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x) + return s; - #include <linux/kernel.h> -+#include <linux/sched.h> - #include <linux/slab.h> - #include <linux/mm.h> - #include <linux/swap.h> /* struct reclaim_state */ -@@ -100,9 +101,8 @@ struct slob_page { - union { - struct { - unsigned long flags; /* mandatory */ -- atomic_t _count; /* mandatory */ - slobidx_t units; /* free units left in page */ -- unsigned long pad[2]; -+ unsigned long size; /* size when >=PAGE_SIZE */ - slob_t *free; /* first free slob_t in page */ - struct list_head list; /* linked list of free pages */ - }; -@@ -135,7 +135,7 @@ static LIST_HEAD(free_slob_large); - */ - static inline int is_slob_page(struct slob_page *sp) - { -- return PageSlab((struct page *)sp); -+ return PageSlab((struct page *)sp) && !sp->size; + page = virt_to_head_page(x); ++ ++ BUG_ON(!PageSlab(page)); ++ + cachep = page->slab_cache; + if (slab_equal_or_root(cachep, s)) + return cachep; +diff --git a/mm/slab_common.c b/mm/slab_common.c +index 3f3cd97..93b0236 100644 +--- a/mm/slab_common.c ++++ b/mm/slab_common.c +@@ -22,7 +22,7 @@ + + #include "slab.h" + +-enum slab_state slab_state; ++enum slab_state slab_state __read_only; + LIST_HEAD(slab_caches); + DEFINE_MUTEX(slab_mutex); + struct kmem_cache *kmem_cache; +@@ -209,7 +209,7 @@ kmem_cache_create_memcg(struct mem_cgroup *memcg, const char *name, size_t size, + + err = __kmem_cache_create(s, flags); + if (!err) { +- s->refcount = 1; ++ atomic_set(&s->refcount, 1); + list_add(&s->list, &slab_caches); + memcg_cache_list_add(memcg, s); + } else { +@@ -255,8 +255,7 @@ void kmem_cache_destroy(struct kmem_cache *s) + + get_online_cpus(); + mutex_lock(&slab_mutex); +- s->refcount--; +- if (!s->refcount) { ++ if (atomic_dec_and_test(&s->refcount)) { + list_del(&s->list); + + if (!__kmem_cache_shutdown(s)) { +@@ -302,7 +301,7 @@ void __init create_boot_cache(struct kmem_cache *s, const char *name, size_t siz + panic("Creation of kmalloc slab %s size=%zd failed. Reason %d\n", + name, size, err); + +- s->refcount = -1; /* Exempt from merging for now */ ++ atomic_set(&s->refcount, -1); /* Exempt from merging for now */ } - static inline void set_slob_page(struct slob_page *sp) -@@ -150,7 +150,7 @@ static inline void clear_slob_page(struct slob_page *sp) + struct kmem_cache *__init create_kmalloc_cache(const char *name, size_t size, +@@ -315,7 +314,7 @@ struct kmem_cache *__init create_kmalloc_cache(const char *name, size_t size, - static inline struct slob_page *slob_page(const void *addr) - { -- return (struct slob_page *)virt_to_page(addr); -+ return (struct slob_page *)virt_to_head_page(addr); + create_boot_cache(s, name, size, flags); + list_add(&s->list, &slab_caches); +- s->refcount = 1; ++ atomic_set(&s->refcount, 1); + return s; } - /* -@@ -210,7 +210,7 @@ static void set_slob(slob_t *s, slobidx_t size, slob_t *next) +diff --git a/mm/slob.c b/mm/slob.c +index eeed4a0..6ee34ec 100644 +--- a/mm/slob.c ++++ b/mm/slob.c +@@ -157,7 +157,7 @@ static void set_slob(slob_t *s, slobidx_t size, slob_t *next) /* * Return the size of a slob block. */ @@ -73803,7 +83315,7 @@ index 8105be4..33e52d7 100644 { if (s->units > 0) return s->units; -@@ -220,7 +220,7 @@ static slobidx_t slob_units(slob_t *s) +@@ -167,7 +167,7 @@ static slobidx_t slob_units(slob_t *s) /* * Return the next free slob block pointer after this one. */ @@ -73812,7 +83324,7 @@ index 8105be4..33e52d7 100644 { slob_t *base = (slob_t *)((unsigned long)s & PAGE_MASK); slobidx_t next; -@@ -235,7 +235,7 @@ static slob_t *slob_next(slob_t *s) +@@ -182,14 +182,14 @@ static slob_t *slob_next(slob_t *s) /* * Returns true if s is the last free block in its page. */ @@ -73821,41 +83333,84 @@ index 8105be4..33e52d7 100644 { return !((unsigned long)slob_next(s) & ~PAGE_MASK); } -@@ -254,6 +254,7 @@ static void *slob_new_pages(gfp_t gfp, int order, int node) + +-static void *slob_new_pages(gfp_t gfp, int order, int node) ++static struct page *slob_new_pages(gfp_t gfp, unsigned int order, int node) + { +- void *page; ++ struct page *page; + + #ifdef CONFIG_NUMA + if (node != NUMA_NO_NODE) +@@ -201,14 +201,18 @@ static void *slob_new_pages(gfp_t gfp, int order, int node) if (!page) return NULL; -+ set_slob_page(page); - return page_address(page); +- return page_address(page); ++ __SetPageSlab(page); ++ return page; + } + +-static void slob_free_pages(void *b, int order) ++static void slob_free_pages(struct page *sp, int order) + { + if (current->reclaim_state) + current->reclaim_state->reclaimed_slab += 1 << order; +- free_pages((unsigned long)b, order); ++ __ClearPageSlab(sp); ++ reset_page_mapcount(sp); ++ sp->private = 0; ++ __free_pages(sp, order); } -@@ -370,11 +371,11 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node) - if (!b) + /* +@@ -313,15 +317,15 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node) + + /* Not enough space: must allocate a new page */ + if (!b) { +- b = slob_new_pages(gfp & ~__GFP_ZERO, 0, node); +- if (!b) ++ sp = slob_new_pages(gfp & ~__GFP_ZERO, 0, node); ++ if (!sp) return NULL; - sp = slob_page(b); -- set_slob_page(sp); +- sp = virt_to_page(b); +- __SetPageSlab(sp); ++ b = page_address(sp); spin_lock_irqsave(&slob_lock, flags); sp->units = SLOB_UNITS(PAGE_SIZE); - sp->free = b; -+ sp->size = 0; + sp->freelist = b; ++ sp->private = 0; INIT_LIST_HEAD(&sp->list); set_slob(b, SLOB_UNITS(PAGE_SIZE), b + SLOB_UNITS(PAGE_SIZE)); set_slob_page_free(sp, slob_list); -@@ -476,10 +477,9 @@ out: - * End of slob allocator proper. Begin kmem_cache_alloc and kmalloc frontend. +@@ -359,9 +363,7 @@ static void slob_free(void *block, int size) + if (slob_page_free(sp)) + clear_slob_page_free(sp); + spin_unlock_irqrestore(&slob_lock, flags); +- __ClearPageSlab(sp); +- page_mapcount_reset(sp); +- slob_free_pages(b, 0); ++ slob_free_pages(sp, 0); + return; + } + +@@ -424,11 +426,10 @@ out: */ --void *__kmalloc_node(size_t size, gfp_t gfp, int node) -+static void *__kmalloc_node_align(size_t size, gfp_t gfp, int node, int align) + static __always_inline void * +-__do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller) ++__do_kmalloc_node_align(size_t size, gfp_t gfp, int node, unsigned long caller, int align) { - unsigned int *m; -- int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); +- int align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); +- void *ret; + slob_t *m; - void *ret; ++ void *ret = NULL; gfp &= gfp_allowed_mask; -@@ -494,7 +494,10 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node) + +@@ -442,23 +443,41 @@ __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller) if (!m) return NULL; @@ -73866,20 +83421,22 @@ index 8105be4..33e52d7 100644 + m[1].units = align; ret = (void *)m + align; - trace_kmalloc_node(_RET_IP_, ret, -@@ -506,16 +509,25 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node) + trace_kmalloc_node(caller, ret, + size, size + align, gfp, node); + } else { + unsigned int order = get_order(size); ++ struct page *page; + + if (likely(order)) gfp |= __GFP_COMP; - ret = slob_new_pages(gfp, order, node); - if (ret) { -- struct page *page; -- page = virt_to_page(ret); -- page->private = size; -+ struct slob_page *sp; -+ sp = slob_page(ret); -+ sp->size = size; - } +- ret = slob_new_pages(gfp, order, node); ++ page = slob_new_pages(gfp, order, node); ++ if (page) { ++ ret = page_address(page); ++ page->private = size; ++ } - trace_kmalloc_node(_RET_IP_, ret, + trace_kmalloc_node(caller, ret, size, PAGE_SIZE << order, gfp, node); } @@ -73887,30 +83444,37 @@ index 8105be4..33e52d7 100644 + return ret; +} + -+void *__kmalloc_node(size_t size, gfp_t gfp, int node) ++static __always_inline void * ++__do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller) +{ + int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); -+ void *ret = __kmalloc_node_align(size, gfp, node, align); ++ void *ret = __do_kmalloc_node_align(size, gfp, node, caller, align); + + if (!ZERO_OR_NULL_PTR(ret)) + kmemleak_alloc(ret, size, 1, gfp); return ret; } - EXPORT_SYMBOL(__kmalloc_node); -@@ -533,13 +545,88 @@ void kfree(const void *block) - sp = slob_page(block); - if (is_slob_page(sp)) { - int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); + +@@ -493,34 +512,112 @@ void kfree(const void *block) + return; + kmemleak_free(block); + ++ VM_BUG_ON(!virt_addr_valid(block)); + sp = virt_to_page(block); +- if (PageSlab(sp)) { ++ VM_BUG_ON(!PageSlab(sp)); ++ if (!sp->private) { + int align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); - unsigned int *m = (unsigned int *)(block - align); - slob_free(m, *m + align); - } else + slob_t *m = (slob_t *)(block - align); + slob_free(m, m[0].units + align); + } else { -+ clear_slob_page(sp); -+ free_slob_page(sp); -+ sp->size = 0; - put_page(&sp->page); ++ __ClearPageSlab(sp); ++ reset_page_mapcount(sp); ++ sp->private = 0; + __free_pages(sp, compound_order(sp)); + } } EXPORT_SYMBOL(kfree); @@ -73926,9 +83490,9 @@ index 8105be4..33e52d7 100644 +} + +#ifdef CONFIG_PAX_USERCOPY -+const char *check_heap_object(const void *ptr, unsigned long n, bool to) ++const char *check_heap_object(const void *ptr, unsigned long n) +{ -+ struct slob_page *sp; ++ struct page *page; + const slob_t *free; + const void *base; + unsigned long flags; @@ -73939,13 +83503,13 @@ index 8105be4..33e52d7 100644 + if (!virt_addr_valid(ptr)) + return NULL; + -+ sp = slob_page(ptr); -+ if (!PageSlab((struct page *)sp)) ++ page = virt_to_head_page(ptr); ++ if (!PageSlab(page)) + return NULL; + -+ if (sp->size) { -+ base = page_address(&sp->page); -+ if (base <= ptr && n <= sp->size - (ptr - base)) ++ if (page->private) { ++ base = page; ++ if (base <= ptr && n <= page->private - (ptr - base)) + return NULL; + return "<slob>"; + } @@ -73953,9 +83517,9 @@ index 8105be4..33e52d7 100644 + /* some tricky double walking to find the chunk */ + spin_lock_irqsave(&slob_lock, flags); + base = (void *)((unsigned long)ptr & PAGE_MASK); -+ free = sp->free; ++ free = page->freelist; + -+ while ((void *)free <= ptr) { ++ while (!slob_last(free) && (void *)free <= ptr) { + base = free + slob_units(free); + free = slob_next(free); + } @@ -73989,53 +83553,59 @@ index 8105be4..33e52d7 100644 /* can't use ksize for kmem_cache_alloc memory, only kmalloc */ size_t ksize(const void *block) { -@@ -552,10 +639,10 @@ size_t ksize(const void *block) - sp = slob_page(block); - if (is_slob_page(sp)) { - int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); -- unsigned int *m = (unsigned int *)(block - align); -- return SLOB_UNITS(*m) * SLOB_UNIT; -+ slob_t *m = (slob_t *)(block - align); -+ return SLOB_UNITS(m[0].units) * SLOB_UNIT; - } else -- return sp->page.private; -+ return sp->size; + struct page *sp; + int align; +- unsigned int *m; ++ slob_t *m; + + BUG_ON(!block); + if (unlikely(block == ZERO_SIZE_PTR)) + return 0; + + sp = virt_to_page(block); +- if (unlikely(!PageSlab(sp))) +- return PAGE_SIZE << compound_order(sp); ++ VM_BUG_ON(!PageSlab(sp)); ++ if (sp->private) ++ return sp->private; + + align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); +- m = (unsigned int *)(block - align); +- return SLOB_UNITS(*m) * SLOB_UNIT; ++ m = (slob_t *)(block - align); ++ return SLOB_UNITS(m[0].units) * SLOB_UNIT; } EXPORT_SYMBOL(ksize); -@@ -571,8 +658,13 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, - { - struct kmem_cache *c; +@@ -536,23 +633,33 @@ int __kmem_cache_create(struct kmem_cache *c, unsigned long flags) -+#ifdef CONFIG_PAX_USERCOPY_SLABS -+ c = __kmalloc_node_align(sizeof(struct kmem_cache), -+ GFP_KERNEL, -1, ARCH_KMALLOC_MINALIGN); -+#else - c = slob_alloc(sizeof(struct kmem_cache), - GFP_KERNEL, ARCH_KMALLOC_MINALIGN, -1); -+#endif + void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node) + { +- void *b; ++ void *b = NULL; - if (c) { - c->name = name; -@@ -614,17 +706,25 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node) + flags &= gfp_allowed_mask; lockdep_trace_alloc(flags); +#ifdef CONFIG_PAX_USERCOPY_SLABS -+ b = __kmalloc_node_align(c->size, flags, node, c->align); ++ b = __do_kmalloc_node_align(c->size, flags, node, _RET_IP_, c->align); +#else if (c->size < PAGE_SIZE) { b = slob_alloc(c->size, flags, c->align, node); - trace_kmem_cache_alloc_node(_RET_IP_, b, c->size, + trace_kmem_cache_alloc_node(_RET_IP_, b, c->object_size, SLOB_UNITS(c->size) * SLOB_UNIT, flags, node); } else { -+ struct slob_page *sp; +- b = slob_new_pages(flags, get_order(c->size), node); ++ struct page *sp; + - b = slob_new_pages(flags, get_order(c->size), node); -+ sp = slob_page(b); -+ sp->size = c->size; - trace_kmem_cache_alloc_node(_RET_IP_, b, c->size, ++ sp = slob_new_pages(flags, get_order(c->size), node); ++ if (sp) { ++ b = page_address(sp); ++ sp->private = c->size; ++ } + trace_kmem_cache_alloc_node(_RET_IP_, b, c->object_size, PAGE_SIZE << get_order(c->size), flags, node); } @@ -74043,26 +83613,24 @@ index 8105be4..33e52d7 100644 if (c->ctor) c->ctor(b); -@@ -636,10 +736,16 @@ EXPORT_SYMBOL(kmem_cache_alloc_node); +@@ -564,10 +671,14 @@ EXPORT_SYMBOL(kmem_cache_alloc_node); static void __kmem_cache_free(void *b, int size) { - if (size < PAGE_SIZE) -+ struct slob_page *sp = slob_page(b); ++ struct page *sp; + -+ if (is_slob_page(sp)) ++ sp = virt_to_page(b); ++ BUG_ON(!PageSlab(sp)); ++ if (!sp->private) slob_free(b, size); -- else -+ else { -+ clear_slob_page(sp); -+ free_slob_page(sp); -+ sp->size = 0; - slob_free_pages(b, get_order(size)); -+ } + else +- slob_free_pages(b, get_order(size)); ++ slob_free_pages(sp, get_order(size)); } static void kmem_rcu_free(struct rcu_head *head) -@@ -652,17 +758,31 @@ static void kmem_rcu_free(struct rcu_head *head) +@@ -580,17 +691,31 @@ static void kmem_rcu_free(struct rcu_head *head) void kmem_cache_free(struct kmem_cache *c, void *b) { @@ -74098,10 +83666,10 @@ index 8105be4..33e52d7 100644 EXPORT_SYMBOL(kmem_cache_free); diff --git a/mm/slub.c b/mm/slub.c -index 71de9b5..51f97c9 100644 +index 4aec537..a64753d 100644 --- a/mm/slub.c +++ b/mm/slub.c -@@ -209,7 +209,7 @@ struct track { +@@ -197,7 +197,7 @@ struct track { enum track_item { TRACK_ALLOC, TRACK_FREE }; @@ -74110,7 +83678,7 @@ index 71de9b5..51f97c9 100644 static int sysfs_slab_add(struct kmem_cache *); static int sysfs_slab_alias(struct kmem_cache *, const char *); static void sysfs_slab_remove(struct kmem_cache *); -@@ -538,7 +538,7 @@ static void print_track(const char *s, struct track *t) +@@ -518,7 +518,7 @@ static void print_track(const char *s, struct track *t) if (!t->addr) return; @@ -74119,16 +83687,7 @@ index 71de9b5..51f97c9 100644 s, (void *)t->addr, jiffies - t->when, t->cpu, t->pid); #ifdef CONFIG_STACKTRACE { -@@ -2603,6 +2603,8 @@ void kmem_cache_free(struct kmem_cache *s, void *x) - - page = virt_to_head_page(x); - -+ BUG_ON(!PageSlab(page)); -+ - slab_free(s, page, x, _RET_IP_); - - trace_kmem_cache_free(_RET_IP_, x); -@@ -2636,7 +2638,7 @@ static int slub_min_objects; +@@ -2653,7 +2653,7 @@ static int slub_min_objects; * Merge control. If this is set then no merging of slab caches will occur. * (Could be removed. This was introduced to pacify the merge skeptics.) */ @@ -74137,26 +83696,7 @@ index 71de9b5..51f97c9 100644 /* * Calculate the order of allocation given an slab object size. -@@ -3089,7 +3091,7 @@ static int kmem_cache_open(struct kmem_cache *s, - else - s->cpu_partial = 30; - -- s->refcount = 1; -+ atomic_set(&s->refcount, 1); - #ifdef CONFIG_NUMA - s->remote_node_defrag_ratio = 1000; - #endif -@@ -3193,8 +3195,7 @@ static inline int kmem_cache_close(struct kmem_cache *s) - void kmem_cache_destroy(struct kmem_cache *s) - { - down_write(&slub_lock); -- s->refcount--; -- if (!s->refcount) { -+ if (atomic_dec_and_test(&s->refcount)) { - list_del(&s->list); - up_write(&slub_lock); - if (kmem_cache_close(s)) { -@@ -3223,6 +3224,10 @@ static struct kmem_cache *kmem_cache; +@@ -3181,6 +3181,10 @@ EXPORT_SYMBOL(kmalloc_caches); static struct kmem_cache *kmalloc_dma_caches[SLUB_PAGE_SHIFT]; #endif @@ -74167,7 +83707,7 @@ index 71de9b5..51f97c9 100644 static int __init setup_slub_min_order(char *str) { get_option(&str, &slub_min_order); -@@ -3337,6 +3342,13 @@ static struct kmem_cache *get_slab(size_t size, gfp_t flags) +@@ -3272,6 +3276,13 @@ static struct kmem_cache *get_slab(size_t size, gfp_t flags) return kmalloc_dma_caches[index]; #endif @@ -74181,7 +83721,7 @@ index 71de9b5..51f97c9 100644 return kmalloc_caches[index]; } -@@ -3405,6 +3417,59 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node) +@@ -3340,6 +3351,59 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node) EXPORT_SYMBOL(__kmalloc_node); #endif @@ -74204,12 +83744,12 @@ index 71de9b5..51f97c9 100644 + if (!PageSlab(page)) + return false; + -+ s = page->slab; ++ s = page->slab_cache; + return s->flags & SLAB_USERCOPY; +} + +#ifdef CONFIG_PAX_USERCOPY -+const char *check_heap_object(const void *ptr, unsigned long n, bool to) ++const char *check_heap_object(const void *ptr, unsigned long n) +{ + struct page *page; + struct kmem_cache *s; @@ -74226,12 +83766,12 @@ index 71de9b5..51f97c9 100644 + if (!PageSlab(page)) + return NULL; + -+ s = page->slab; ++ s = page->slab_cache; + if (!(s->flags & SLAB_USERCOPY)) + return s->name; + + offset = (ptr - page_address(page)) % s->size; -+ if (offset <= s->objsize && n <= s->objsize - offset) ++ if (offset <= s->object_size && n <= s->object_size - offset) + return NULL; + + return s->name; @@ -74241,16 +83781,15 @@ index 71de9b5..51f97c9 100644 size_t ksize(const void *object) { struct page *page; -@@ -3679,7 +3744,7 @@ static void __init kmem_cache_bootstrap_fixup(struct kmem_cache *s) - int node; - - list_add(&s->list, &slab_caches); -- s->refcount = -1; -+ atomic_set(&s->refcount, -1); +@@ -3404,6 +3468,7 @@ void kfree(const void *x) + if (unlikely(ZERO_OR_NULL_PTR(x))) + return; - for_each_node_state(node, N_NORMAL_MEMORY) { - struct kmem_cache_node *n = get_node(s, node); -@@ -3799,17 +3864,17 @@ void __init kmem_cache_init(void) ++ VM_BUG_ON(!virt_addr_valid(x)); + page = virt_to_head_page(x); + if (unlikely(!PageSlab(page))) { + BUG_ON(!PageCompound(page)); +@@ -3712,17 +3777,17 @@ void __init kmem_cache_init(void) /* Caches that are not of the two-to-the-power-of size */ if (KMALLOC_MIN_SIZE <= 32) { @@ -74271,7 +83810,7 @@ index 71de9b5..51f97c9 100644 caches++; } -@@ -3851,6 +3916,22 @@ void __init kmem_cache_init(void) +@@ -3764,6 +3829,22 @@ void __init kmem_cache_init(void) } } #endif @@ -74282,11 +83821,11 @@ index 71de9b5..51f97c9 100644 + + if (s && s->size) { + char *name = kasprintf(GFP_NOWAIT, -+ "usercopy-kmalloc-%d", s->objsize); ++ "usercopy-kmalloc-%d", s->object_size); + + BUG_ON(!name); + kmalloc_usercopy_caches[i] = create_kmalloc_cache(name, -+ s->objsize, SLAB_USERCOPY); ++ s->object_size, SLAB_USERCOPY); + } + } +#endif @@ -74294,7 +83833,7 @@ index 71de9b5..51f97c9 100644 printk(KERN_INFO "SLUB: Genslabs=%d, HWalign=%d, Order=%d-%d, MinObjects=%d," " CPUs=%d, Nodes=%d\n", -@@ -3877,7 +3958,7 @@ static int slab_unmergeable(struct kmem_cache *s) +@@ -3790,7 +3871,7 @@ static int slab_unmergeable(struct kmem_cache *s) /* * We may have set a slab to be unmergeable during bootstrap. */ @@ -74303,25 +83842,34 @@ index 71de9b5..51f97c9 100644 return 1; return 0; -@@ -3936,7 +4017,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, - down_write(&slub_lock); - s = find_mergeable(size, align, flags, name, ctor); +@@ -3848,7 +3929,7 @@ __kmem_cache_alias(struct mem_cgroup *memcg, const char *name, size_t size, + + s = find_mergeable(memcg, size, align, flags, name, ctor); if (s) { - s->refcount++; + atomic_inc(&s->refcount); /* * Adjust the object sizes so that we clear * the complete object on kzalloc. -@@ -3945,7 +4026,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, +@@ -3857,7 +3938,7 @@ __kmem_cache_alias(struct mem_cgroup *memcg, const char *name, size_t size, s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *))); if (sysfs_slab_alias(s, name)) { - s->refcount--; + atomic_dec(&s->refcount); - goto err; + s = NULL; } - up_write(&slub_lock); -@@ -4074,7 +4155,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags, + } +@@ -3919,7 +4000,7 @@ static int __cpuinit slab_cpuup_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata slab_notifier = { ++static struct notifier_block slab_notifier = { + .notifier_call = slab_cpuup_callback + }; + +@@ -3977,7 +4058,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags, } #endif @@ -74330,7 +83878,7 @@ index 71de9b5..51f97c9 100644 static int count_inuse(struct page *page) { return page->inuse; -@@ -4461,12 +4542,12 @@ static void resiliency_test(void) +@@ -4364,12 +4445,12 @@ static void resiliency_test(void) validate_slab_cache(kmalloc_caches[9]); } #else @@ -74345,7 +83893,7 @@ index 71de9b5..51f97c9 100644 enum slab_stat_type { SL_ALL, /* All slabs */ SL_PARTIAL, /* Only partially allocated slabs */ -@@ -4709,7 +4790,7 @@ SLAB_ATTR_RO(ctor); +@@ -4613,7 +4694,7 @@ SLAB_ATTR_RO(ctor); static ssize_t aliases_show(struct kmem_cache *s, char *buf) { @@ -74354,7 +83902,7 @@ index 71de9b5..51f97c9 100644 } SLAB_ATTR_RO(aliases); -@@ -5280,6 +5361,7 @@ static char *create_unique_id(struct kmem_cache *s) +@@ -5266,6 +5347,7 @@ static char *create_unique_id(struct kmem_cache *s) return name; } @@ -74362,7 +83910,7 @@ index 71de9b5..51f97c9 100644 static int sysfs_slab_add(struct kmem_cache *s) { int err; -@@ -5342,6 +5424,7 @@ static void sysfs_slab_remove(struct kmem_cache *s) +@@ -5323,6 +5405,7 @@ static void sysfs_slab_remove(struct kmem_cache *s) kobject_del(&s->kobj); kobject_put(&s->kobj); } @@ -74370,7 +83918,7 @@ index 71de9b5..51f97c9 100644 /* * Need to buffer aliases during bootup until sysfs becomes -@@ -5355,6 +5438,7 @@ struct saved_alias { +@@ -5336,6 +5419,7 @@ struct saved_alias { static struct saved_alias *alias_list; @@ -74378,7 +83926,7 @@ index 71de9b5..51f97c9 100644 static int sysfs_slab_alias(struct kmem_cache *s, const char *name) { struct saved_alias *al; -@@ -5377,6 +5461,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name) +@@ -5358,6 +5442,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name) alias_list = al; return 0; } @@ -74408,8 +83956,21 @@ index 1b7e22a..3fcd4f3 100644 } return pgd; } +diff --git a/mm/sparse.c b/mm/sparse.c +index 7ca6dc8..6472aa1 100644 +--- a/mm/sparse.c ++++ b/mm/sparse.c +@@ -783,7 +783,7 @@ static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) + + for (i = 0; i < PAGES_PER_SECTION; i++) { + if (PageHWPoison(&memmap[i])) { +- atomic_long_sub(1, &num_poisoned_pages); ++ atomic_long_sub_unchecked(1, &num_poisoned_pages); + ClearPageHWPoison(&memmap[i]); + } + } diff --git a/mm/swap.c b/mm/swap.c -index 5c13f13..f1cfc13 100644 +index 8a529a0..154ef26 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -30,6 +30,7 @@ @@ -74420,7 +83981,7 @@ index 5c13f13..f1cfc13 100644 #include "internal.h" -@@ -70,6 +71,8 @@ static void __put_compound_page(struct page *page) +@@ -72,6 +73,8 @@ static void __put_compound_page(struct page *page) __page_cache_release(page); dtor = get_compound_page_dtor(page); @@ -74430,10 +83991,10 @@ index 5c13f13..f1cfc13 100644 } diff --git a/mm/swapfile.c b/mm/swapfile.c -index 38186d9..bfba6d3 100644 +index a1f7772..9e982ac 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c -@@ -61,7 +61,7 @@ static DEFINE_MUTEX(swapon_mutex); +@@ -66,7 +66,7 @@ static DEFINE_MUTEX(swapon_mutex); static DECLARE_WAIT_QUEUE_HEAD(proc_poll_wait); /* Activity counter to indicate that a swapon or swapoff has occurred */ @@ -74442,7 +84003,7 @@ index 38186d9..bfba6d3 100644 static inline unsigned char swap_count(unsigned char ent) { -@@ -1671,7 +1671,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) +@@ -1683,7 +1683,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) } filp_close(swap_file, NULL); err = 0; @@ -74451,7 +84012,7 @@ index 38186d9..bfba6d3 100644 wake_up_interruptible(&proc_poll_wait); out_dput: -@@ -1687,8 +1687,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait) +@@ -1700,8 +1700,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait) poll_wait(file, &proc_poll_wait, wait); @@ -74462,7 +84023,7 @@ index 38186d9..bfba6d3 100644 return POLLIN | POLLRDNORM | POLLERR | POLLPRI; } -@@ -1786,7 +1786,7 @@ static int swaps_open(struct inode *inode, struct file *file) +@@ -1799,7 +1799,7 @@ static int swaps_open(struct inode *inode, struct file *file) return ret; seq = file->private_data; @@ -74471,8 +84032,8 @@ index 38186d9..bfba6d3 100644 return 0; } -@@ -2123,7 +2123,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) - (p->flags & SWP_DISCARDABLE) ? "D" : ""); +@@ -2142,7 +2142,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) + (frontswap_map) ? "FS" : ""); mutex_unlock(&swapon_mutex); - atomic_inc(&proc_poll_event); @@ -74481,10 +84042,10 @@ index 38186d9..bfba6d3 100644 if (S_ISREG(inode->i_mode)) diff --git a/mm/util.c b/mm/util.c -index ae962b3..0bba886 100644 +index ab1424d..7c5bd5a 100644 --- a/mm/util.c +++ b/mm/util.c -@@ -284,6 +284,12 @@ done: +@@ -294,6 +294,12 @@ done: void arch_pick_mmap_layout(struct mm_struct *mm) { mm->mmap_base = TASK_UNMAPPED_BASE; @@ -74498,7 +84059,7 @@ index ae962b3..0bba886 100644 mm->unmap_area = arch_unmap_area; } diff --git a/mm/vmalloc.c b/mm/vmalloc.c -index 1196c77..fb1cca8 100644 +index 0f751f2..ef398a0 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -39,8 +39,19 @@ static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end) @@ -74523,15 +84084,7 @@ index 1196c77..fb1cca8 100644 } while (pte++, addr += PAGE_SIZE, addr != end); } -@@ -91,6 +102,7 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr, - unsigned long end, pgprot_t prot, struct page **pages, int *nr) - { - pte_t *pte; -+ int ret = -ENOMEM; - - /* - * nr is a running index into the array which helps higher level -@@ -100,17 +112,30 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr, +@@ -100,16 +111,29 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr, pte = pte_alloc_kernel(pmd, addr); if (!pte) return -ENOMEM; @@ -74541,33 +84094,29 @@ index 1196c77..fb1cca8 100644 struct page *page = pages[*nr]; - if (WARN_ON(!pte_none(*pte))) -- return -EBUSY; -- if (WARN_ON(!page)) -- return -ENOMEM; +#if defined(CONFIG_MODULES) && defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC) + if (pgprot_val(prot) & _PAGE_NX) +#endif + -+ if (WARN_ON(!pte_none(*pte))) { -+ ret = -EBUSY; -+ goto out; ++ if (!pte_none(*pte)) { ++ pax_close_kernel(); ++ WARN_ON(1); + return -EBUSY; +- if (WARN_ON(!page)) + } -+ if (WARN_ON(!page)) { -+ ret = -ENOMEM; -+ goto out; ++ if (!page) { ++ pax_close_kernel(); ++ WARN_ON(1); + return -ENOMEM; + } set_pte_at(&init_mm, addr, pte, mk_pte(page, prot)); (*nr)++; } while (pte++, addr += PAGE_SIZE, addr != end); -- return 0; -+ ret = 0; -+out: + pax_close_kernel(); -+ return ret; + return 0; } - static int vmap_pmd_range(pud_t *pud, unsigned long addr, -@@ -119,7 +144,7 @@ static int vmap_pmd_range(pud_t *pud, unsigned long addr, +@@ -119,7 +143,7 @@ static int vmap_pmd_range(pud_t *pud, unsigned long addr, pmd_t *pmd; unsigned long next; @@ -74576,7 +84125,7 @@ index 1196c77..fb1cca8 100644 if (!pmd) return -ENOMEM; do { -@@ -136,7 +161,7 @@ static int vmap_pud_range(pgd_t *pgd, unsigned long addr, +@@ -136,7 +160,7 @@ static int vmap_pud_range(pgd_t *pgd, unsigned long addr, pud_t *pud; unsigned long next; @@ -74585,7 +84134,7 @@ index 1196c77..fb1cca8 100644 if (!pud) return -ENOMEM; do { -@@ -191,11 +216,20 @@ int is_vmalloc_or_module_addr(const void *x) +@@ -191,11 +215,20 @@ int is_vmalloc_or_module_addr(const void *x) * and fall back on vmalloc() if that fails. Others * just put it in the vmalloc space. */ @@ -74607,7 +84156,7 @@ index 1196c77..fb1cca8 100644 return is_vmalloc_addr(x); } -@@ -216,8 +250,14 @@ struct page *vmalloc_to_page(const void *vmalloc_addr) +@@ -216,8 +249,14 @@ struct page *vmalloc_to_page(const void *vmalloc_addr) if (!pgd_none(*pgd)) { pud_t *pud = pud_offset(pgd, addr); @@ -74622,18 +84171,16 @@ index 1196c77..fb1cca8 100644 if (!pmd_none(*pmd)) { pte_t *ptep, pte; -@@ -329,6 +369,10 @@ static void purge_vmap_area_lazy(void); +@@ -329,7 +368,7 @@ static void purge_vmap_area_lazy(void); * Allocate a region of KVA of the specified size and alignment, within the * vstart and vend. */ +-static struct vmap_area *alloc_vmap_area(unsigned long size, +static __size_overflow(1) struct vmap_area *alloc_vmap_area(unsigned long size, -+ unsigned long align, -+ unsigned long vstart, unsigned long vend, -+ int node, gfp_t gfp_mask) __size_overflow(1); - static struct vmap_area *alloc_vmap_area(unsigned long size, unsigned long align, unsigned long vstart, unsigned long vend, -@@ -1320,6 +1364,16 @@ static struct vm_struct *__get_vm_area_node(unsigned long size, + int node, gfp_t gfp_mask) +@@ -1328,6 +1367,16 @@ static struct vm_struct *__get_vm_area_node(unsigned long size, struct vm_struct *area; BUG_ON(in_interrupt()); @@ -74650,7 +84197,7 @@ index 1196c77..fb1cca8 100644 if (flags & VM_IOREMAP) { int bit = fls(size); -@@ -1552,6 +1606,11 @@ void *vmap(struct page **pages, unsigned int count, +@@ -1569,6 +1618,11 @@ void *vmap(struct page **pages, unsigned int count, if (count > totalram_pages) return NULL; @@ -74662,7 +84209,7 @@ index 1196c77..fb1cca8 100644 area = get_vm_area_caller((count << PAGE_SHIFT), flags, __builtin_return_address(0)); if (!area) -@@ -1653,6 +1712,13 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, +@@ -1670,6 +1724,13 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, if (!size || (size >> PAGE_SHIFT) > totalram_pages) goto fail; @@ -74676,7 +84223,7 @@ index 1196c77..fb1cca8 100644 area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST, start, end, node, gfp_mask, caller); if (!area) -@@ -1826,10 +1892,9 @@ EXPORT_SYMBOL(vzalloc_node); +@@ -1845,10 +1906,9 @@ EXPORT_SYMBOL(vzalloc_node); * For tight control over page level allocator and protection flags * use __vmalloc() instead. */ @@ -74685,10 +84232,10 @@ index 1196c77..fb1cca8 100644 { - return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC, + return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL_EXEC, - -1, __builtin_return_address(0)); + NUMA_NO_NODE, __builtin_return_address(0)); } -@@ -2124,6 +2189,8 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, +@@ -2139,6 +2199,8 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, unsigned long uaddr = vma->vm_start; unsigned long usize = vma->vm_end - vma->vm_start; @@ -74697,19 +84244,20 @@ index 1196c77..fb1cca8 100644 if ((PAGE_SIZE-1) & (unsigned long)addr) return -EINVAL; -@@ -2376,8 +2443,8 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, - return NULL; - } +@@ -2578,7 +2640,11 @@ static int s_show(struct seq_file *m, void *p) + v->addr, v->addr + v->size, v->size); -- vms = kzalloc(sizeof(vms[0]) * nr_vms, GFP_KERNEL); -- vas = kzalloc(sizeof(vas[0]) * nr_vms, GFP_KERNEL); -+ vms = kcalloc(nr_vms, sizeof(vms[0]), GFP_KERNEL); -+ vas = kcalloc(nr_vms, sizeof(vas[0]), GFP_KERNEL); - if (!vas || !vms) - goto err_free2; + if (v->caller) ++#ifdef CONFIG_GRKERNSEC_HIDESYM ++ seq_printf(m, " %pK", v->caller); ++#else + seq_printf(m, " %pS", v->caller); ++#endif + if (v->nr_pages) + seq_printf(m, " pages=%d", v->nr_pages); diff --git a/mm/vmstat.c b/mm/vmstat.c -index 7db1b9b..e9f6b07 100644 +index e1d8ed1..253fa3c 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -78,7 +78,7 @@ void vm_events_fold_cpu(int cpu) @@ -74738,8 +84286,28 @@ index 7db1b9b..e9f6b07 100644 + atomic_long_add_unchecked(global_diff[i], &vm_stat[i]); } + void drain_zonestat(struct zone *zone, struct per_cpu_pageset *pset) +@@ -503,8 +503,8 @@ void drain_zonestat(struct zone *zone, struct per_cpu_pageset *pset) + if (pset->vm_stat_diff[i]) { + int v = pset->vm_stat_diff[i]; + pset->vm_stat_diff[i] = 0; +- atomic_long_add(v, &zone->vm_stat[i]); +- atomic_long_add(v, &vm_stat[i]); ++ atomic_long_add_unchecked(v, &zone->vm_stat[i]); ++ atomic_long_add_unchecked(v, &vm_stat[i]); + } + } #endif -@@ -1208,10 +1208,20 @@ static int __init setup_vmstat(void) +@@ -1224,7 +1224,7 @@ static int __cpuinit vmstat_cpuup_callback(struct notifier_block *nfb, + return NOTIFY_OK; + } + +-static struct notifier_block __cpuinitdata vmstat_notifier = ++static struct notifier_block vmstat_notifier = + { &vmstat_cpuup_callback, NULL, 0 }; + #endif + +@@ -1239,10 +1239,20 @@ static int __init setup_vmstat(void) start_cpu_timer(cpu); #endif #ifdef CONFIG_PROC_FS @@ -74765,12 +84333,35 @@ index 7db1b9b..e9f6b07 100644 return 0; } diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c -index cf4a49c..de3b32e 100644 +index 85addcd..c429a13 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c -@@ -557,8 +557,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg) +@@ -114,6 +114,13 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head) + if (vlan_id) + vlan_vid_del(real_dev, vlan_id); + ++ /* Take it out of our own structures, but be sure to interlock with ++ * HW accelerating devices or SW vlan input packet processing if ++ * VLAN is not 0 (leave it there for 802.1p). ++ */ ++ if (vlan_id) ++ vlan_vid_del(real_dev, vlan_id); ++ + /* Get rid of the vlan's reference to real_dev */ + dev_put(real_dev); + } +@@ -496,7 +503,7 @@ out: + return NOTIFY_DONE; + } + +-static struct notifier_block vlan_notifier_block __read_mostly = { ++static struct notifier_block vlan_notifier_block = { + .notifier_call = vlan_device_event, + }; + +@@ -571,8 +578,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg) err = -EPERM; - if (!capable(CAP_NET_ADMIN)) + if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) break; - if ((args.u.name_type >= 0) && - (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) { @@ -74778,8 +84369,30 @@ index cf4a49c..de3b32e 100644 struct vlan_net *vn; vn = net_generic(net, vlan_net_id); +diff --git a/net/9p/mod.c b/net/9p/mod.c +index 6ab36ae..6f1841b 100644 +--- a/net/9p/mod.c ++++ b/net/9p/mod.c +@@ -84,7 +84,7 @@ static LIST_HEAD(v9fs_trans_list); + void v9fs_register_trans(struct p9_trans_module *m) + { + spin_lock(&v9fs_trans_lock); +- list_add_tail(&m->list, &v9fs_trans_list); ++ pax_list_add_tail((struct list_head *)&m->list, &v9fs_trans_list); + spin_unlock(&v9fs_trans_lock); + } + EXPORT_SYMBOL(v9fs_register_trans); +@@ -97,7 +97,7 @@ EXPORT_SYMBOL(v9fs_register_trans); + void v9fs_unregister_trans(struct p9_trans_module *m) + { + spin_lock(&v9fs_trans_lock); +- list_del_init(&m->list); ++ pax_list_del_init((struct list_head *)&m->list); + spin_unlock(&v9fs_trans_lock); + } + EXPORT_SYMBOL(v9fs_unregister_trans); diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c -index fccae26..e7ece2f 100644 +index 02efb25..41541a9 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -425,7 +425,7 @@ static int p9_fd_write(struct p9_client *client, void *v, int len) @@ -74832,7 +84445,7 @@ index 876fbe8..8bbea9f 100644 #undef __HANDLE_ITEM } diff --git a/net/atm/lec.h b/net/atm/lec.h -index dfc0719..47c5322 100644 +index a86aff9..3a0d6f6 100644 --- a/net/atm/lec.h +++ b/net/atm/lec.h @@ -48,7 +48,7 @@ struct lane2_ops { @@ -74844,21 +84457,8 @@ index dfc0719..47c5322 100644 /* * ATM LAN Emulation supports both LLC & Dix Ethernet EtherType -diff --git a/net/atm/mpc.h b/net/atm/mpc.h -index 0919a88..a23d54e 100644 ---- a/net/atm/mpc.h -+++ b/net/atm/mpc.h -@@ -33,7 +33,7 @@ struct mpoa_client { - struct mpc_parameters parameters; /* parameters for this client */ - - const struct net_device_ops *old_ops; -- struct net_device_ops new_ops; -+ net_device_ops_no_const new_ops; - }; - - diff --git a/net/atm/proc.c b/net/atm/proc.c -index 0d020de..011c7bb 100644 +index 6ac35ff..ac0e136 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c @@ -45,9 +45,9 @@ static void add_stats(struct seq_file *seq, const char *aal, @@ -74875,7 +84475,7 @@ index 0d020de..011c7bb 100644 static void atm_dev_info(struct seq_file *seq, const struct atm_dev *dev) diff --git a/net/atm/resources.c b/net/atm/resources.c -index 23f45ce..c748f1a 100644 +index 0447d5d..3cf4728 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c @@ -160,7 +160,7 @@ EXPORT_SYMBOL(atm_dev_deregister); @@ -74896,104 +84496,134 @@ index 23f45ce..c748f1a 100644 __AAL_STAT_ITEMS #undef __HANDLE_ITEM } +diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c +index d5744b7..506bae3 100644 +--- a/net/ax25/sysctl_net_ax25.c ++++ b/net/ax25/sysctl_net_ax25.c +@@ -152,7 +152,7 @@ int ax25_register_dev_sysctl(ax25_dev *ax25_dev) + { + char path[sizeof("net/ax25/") + IFNAMSIZ]; + int k; +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(ax25_param_table, sizeof(ax25_param_table), GFP_KERNEL); + if (!table) diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c -index a6d5d63..1cc6c2b 100644 +index a5bb0a7..e1d8b97 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c -@@ -539,7 +539,7 @@ static void bat_iv_ogm_schedule(struct hard_iface *hard_iface, - - /* change sequence number to network order */ - batman_ogm_packet->seqno = -- htonl((uint32_t)atomic_read(&hard_iface->seqno)); -+ htonl((uint32_t)atomic_read_unchecked(&hard_iface->seqno)); +@@ -63,7 +63,7 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface) - batman_ogm_packet->ttvn = atomic_read(&bat_priv->ttvn); - batman_ogm_packet->tt_crc = htons((uint16_t) -@@ -559,7 +559,7 @@ static void bat_iv_ogm_schedule(struct hard_iface *hard_iface, - else - batman_ogm_packet->gw_flags = NO_FLAGS; + /* randomize initial seqno to avoid collision */ + get_random_bytes(&random_seqno, sizeof(random_seqno)); +- atomic_set(&hard_iface->bat_iv.ogm_seqno, random_seqno); ++ atomic_set_unchecked(&hard_iface->bat_iv.ogm_seqno, random_seqno); -- atomic_inc(&hard_iface->seqno); -+ atomic_inc_unchecked(&hard_iface->seqno); + hard_iface->bat_iv.ogm_buff_len = BATADV_OGM_HLEN; + ogm_buff = kmalloc(hard_iface->bat_iv.ogm_buff_len, GFP_ATOMIC); +@@ -611,9 +611,9 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface) + batadv_ogm_packet = (struct batadv_ogm_packet *)(*ogm_buff); - slide_own_bcast_window(hard_iface); - bat_iv_ogm_queue_add(bat_priv, hard_iface->packet_buff, -@@ -917,7 +917,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, + /* change sequence number to network order */ +- seqno = (uint32_t)atomic_read(&hard_iface->bat_iv.ogm_seqno); ++ seqno = (uint32_t)atomic_read_unchecked(&hard_iface->bat_iv.ogm_seqno); + batadv_ogm_packet->seqno = htonl(seqno); +- atomic_inc(&hard_iface->bat_iv.ogm_seqno); ++ atomic_inc_unchecked(&hard_iface->bat_iv.ogm_seqno); + + batadv_ogm_packet->ttvn = atomic_read(&bat_priv->tt.vn); + batadv_ogm_packet->tt_crc = htons(bat_priv->tt.local_crc); +@@ -1013,7 +1013,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr, return; /* could be changed by schedule_own_packet() */ -- if_incoming_seqno = atomic_read(&if_incoming->seqno); -+ if_incoming_seqno = atomic_read_unchecked(&if_incoming->seqno); - - has_directlink_flag = (batman_ogm_packet->flags & DIRECTLINK ? 1 : 0); +- if_incoming_seqno = atomic_read(&if_incoming->bat_iv.ogm_seqno); ++ if_incoming_seqno = atomic_read_unchecked(&if_incoming->bat_iv.ogm_seqno); + if (batadv_ogm_packet->flags & BATADV_DIRECTLINK) + has_directlink_flag = 1; diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c -index 3778977..f6a9450 100644 +index 368219e..53f56f9 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c -@@ -328,8 +328,8 @@ int hardif_enable_interface(struct hard_iface *hard_iface, +@@ -370,7 +370,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, hard_iface->batman_adv_ptype.dev = hard_iface->net_dev; dev_add_pack(&hard_iface->batman_adv_ptype); -- atomic_set(&hard_iface->seqno, 1); - atomic_set(&hard_iface->frag_seqno, 1); -+ atomic_set_unchecked(&hard_iface->seqno, 1); + atomic_set_unchecked(&hard_iface->frag_seqno, 1); - bat_info(hard_iface->soft_iface, "Adding interface: %s\n", - hard_iface->net_dev->name); + batadv_info(hard_iface->soft_iface, "Adding interface: %s\n", + hard_iface->net_dev->name); +@@ -514,7 +514,7 @@ batadv_hardif_add_interface(struct net_device *net_dev) + /* This can't be called via a bat_priv callback because + * we have no bat_priv yet. + */ +- atomic_set(&hard_iface->bat_iv.ogm_seqno, 1); ++ atomic_set_unchecked(&hard_iface->bat_iv.ogm_seqno, 1); + hard_iface->bat_iv.ogm_buff = NULL; + + return hard_iface; diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c -index a5590f4..8d31969 100644 +index 2711e87..4ca48fa 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c -@@ -645,7 +645,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface) +@@ -252,7 +252,7 @@ static int batadv_interface_tx(struct sk_buff *skb, + primary_if->net_dev->dev_addr, ETH_ALEN); /* set broadcast sequence number */ - bcast_packet->seqno = -- htonl(atomic_inc_return(&bat_priv->bcast_seqno)); -+ htonl(atomic_inc_return_unchecked(&bat_priv->bcast_seqno)); - - add_bcast_packet_to_list(bat_priv, skb, 1); +- seqno = atomic_inc_return(&bat_priv->bcast_seqno); ++ seqno = atomic_inc_return_unchecked(&bat_priv->bcast_seqno); + bcast_packet->seqno = htonl(seqno); -@@ -841,7 +841,7 @@ struct net_device *softif_create(const char *name) - atomic_set(&bat_priv->batman_queue_left, BATMAN_QUEUE_LEN); + batadv_add_bcast_packet_to_list(bat_priv, skb, brd_delay); +@@ -527,7 +527,7 @@ struct net_device *batadv_softif_create(const char *name) + atomic_set(&bat_priv->batman_queue_left, BATADV_BATMAN_QUEUE_LEN); - atomic_set(&bat_priv->mesh_state, MESH_INACTIVE); + atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE); - atomic_set(&bat_priv->bcast_seqno, 1); + atomic_set_unchecked(&bat_priv->bcast_seqno, 1); - atomic_set(&bat_priv->ttvn, 0); - atomic_set(&bat_priv->tt_local_changes, 0); - atomic_set(&bat_priv->tt_ogm_append_cnt, 0); + atomic_set(&bat_priv->tt.vn, 0); + atomic_set(&bat_priv->tt.local_changes, 0); + atomic_set(&bat_priv->tt.ogm_append_cnt, 0); diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h -index 302efb5..1590365 100644 +index 4cd87a0..348e705 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h -@@ -38,8 +38,8 @@ struct hard_iface { +@@ -51,7 +51,7 @@ + struct batadv_hard_iface_bat_iv { + unsigned char *ogm_buff; + int ogm_buff_len; +- atomic_t ogm_seqno; ++ atomic_unchecked_t ogm_seqno; + }; + + /** +@@ -75,7 +75,7 @@ struct batadv_hard_iface { int16_t if_num; char if_status; struct net_device *net_dev; -- atomic_t seqno; - atomic_t frag_seqno; -+ atomic_unchecked_t seqno; + atomic_unchecked_t frag_seqno; - unsigned char *packet_buff; - int packet_len; struct kobject *hardif_obj; -@@ -155,7 +155,7 @@ struct bat_priv { - atomic_t orig_interval; /* uint */ - atomic_t hop_penalty; /* uint */ - atomic_t log_level; /* uint */ + atomic_t refcount; + struct packet_type batman_adv_ptype; +@@ -495,7 +495,7 @@ struct batadv_priv { + #ifdef CONFIG_BATMAN_ADV_DEBUG + atomic_t log_level; + #endif - atomic_t bcast_seqno; + atomic_unchecked_t bcast_seqno; atomic_t bcast_queue_left; atomic_t batman_queue_left; - atomic_t ttvn; /* translation table version number */ + char num_ifaces; diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c -index 676f6a6..3b4e668 100644 +index 50e079f..49ce2d2 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c -@@ -264,7 +264,7 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, - frag1->flags = UNI_FRAG_HEAD | large_tail; +@@ -270,7 +270,7 @@ int batadv_frag_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv, + frag1->flags = BATADV_UNI_FRAG_HEAD | large_tail; frag2->flags = large_tail; - seqno = atomic_add_return(2, &hard_iface->frag_seqno); @@ -75001,24 +84631,24 @@ index 676f6a6..3b4e668 100644 frag1->seqno = htons(seqno - 1); frag2->seqno = htons(seqno); -diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c -index 5238b6b..c9798ce 100644 ---- a/net/bluetooth/hci_conn.c -+++ b/net/bluetooth/hci_conn.c -@@ -233,7 +233,7 @@ void hci_le_ltk_reply(struct hci_conn *conn, u8 ltk[16]) - memset(&cp, 0, sizeof(cp)); - - cp.handle = cpu_to_le16(conn->handle); -- memcpy(cp.ltk, ltk, sizeof(ltk)); -+ memcpy(cp.ltk, ltk, sizeof(cp.ltk)); +diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c +index 6a93614..1415549 100644 +--- a/net/bluetooth/hci_sock.c ++++ b/net/bluetooth/hci_sock.c +@@ -929,7 +929,7 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname, + uf.event_mask[1] = *((u32 *) f->event_mask + 1); + } - hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); - } +- len = min_t(unsigned int, len, sizeof(uf)); ++ len = min((size_t)len, sizeof(uf)); + if (copy_from_user(&uf, optval, len)) { + err = -EFAULT; + break; diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c -index 9a86759..f0951ea 100644 +index 7c7e932..7a7815d 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c -@@ -2467,8 +2467,10 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, voi +@@ -3395,8 +3395,10 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, break; case L2CAP_CONF_RFC: @@ -75030,25 +84660,124 @@ index 9a86759..f0951ea 100644 + memcpy(&rfc, (void *)val, olen); if (test_bit(CONF_STATE2_DEVICE, &chan->conf_state) && - rfc.mode != chan->mode) -@@ -2586,8 +2588,10 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len) + rfc.mode != chan->mode) +diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c +index 1bcfb84..dad9f98 100644 +--- a/net/bluetooth/l2cap_sock.c ++++ b/net/bluetooth/l2cap_sock.c +@@ -479,7 +479,8 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, + struct sock *sk = sock->sk; + struct l2cap_chan *chan = l2cap_pi(sk)->chan; + struct l2cap_options opts; +- int len, err = 0; ++ int err = 0; ++ size_t len = optlen; + u32 opt; - switch (type) { - case L2CAP_CONF_RFC: -- if (olen == sizeof(rfc)) -- memcpy(&rfc, (void *)val, olen); -+ if (olen != sizeof(rfc)) -+ break; -+ -+ memcpy(&rfc, (void *)val, olen); - goto done; - } + BT_DBG("sk %p", sk); +@@ -501,7 +502,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, + opts.max_tx = chan->max_tx; + opts.txwin_size = chan->tx_win; + +- len = min_t(unsigned int, sizeof(opts), optlen); ++ len = min(sizeof(opts), len); + if (copy_from_user((char *) &opts, optval, len)) { + err = -EFAULT; + break; +@@ -581,7 +582,8 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, + struct bt_security sec; + struct bt_power pwr; + struct l2cap_conn *conn; +- int len, err = 0; ++ int err = 0; ++ size_t len = optlen; + u32 opt; + + BT_DBG("sk %p", sk); +@@ -604,7 +606,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, + + sec.level = BT_SECURITY_LOW; + +- len = min_t(unsigned int, sizeof(sec), optlen); ++ len = min(sizeof(sec), len); + if (copy_from_user((char *) &sec, optval, len)) { + err = -EFAULT; + break; +@@ -701,7 +703,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, + + pwr.force_active = BT_POWER_FORCE_ACTIVE_ON; + +- len = min_t(unsigned int, sizeof(pwr), optlen); ++ len = min(sizeof(pwr), len); + if (copy_from_user((char *) &pwr, optval, len)) { + err = -EFAULT; + break; +diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c +index 7c9224b..381009e 100644 +--- a/net/bluetooth/rfcomm/sock.c ++++ b/net/bluetooth/rfcomm/sock.c +@@ -666,7 +666,7 @@ static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, c + struct sock *sk = sock->sk; + struct bt_security sec; + int err = 0; +- size_t len; ++ size_t len = optlen; + u32 opt; + + BT_DBG("sk %p", sk); +@@ -688,7 +688,7 @@ static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, c + + sec.level = BT_SECURITY_LOW; + +- len = min_t(unsigned int, sizeof(sec), optlen); ++ len = min(sizeof(sec), len); + if (copy_from_user((char *) &sec, optval, len)) { + err = -EFAULT; + break; +diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c +index b6e44ad..5b0d514 100644 +--- a/net/bluetooth/rfcomm/tty.c ++++ b/net/bluetooth/rfcomm/tty.c +@@ -309,7 +309,7 @@ static void rfcomm_dev_del(struct rfcomm_dev *dev) + BUG_ON(test_and_set_bit(RFCOMM_TTY_RELEASED, &dev->flags)); + + spin_lock_irqsave(&dev->port.lock, flags); +- if (dev->port.count > 0) { ++ if (atomic_read(&dev->port.count) > 0) { + spin_unlock_irqrestore(&dev->port.lock, flags); + return; } +@@ -659,10 +659,10 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp) + return -ENODEV; + + BT_DBG("dev %p dst %pMR channel %d opened %d", dev, &dev->dst, +- dev->channel, dev->port.count); ++ dev->channel, atomic_read(&dev->port.count)); + + spin_lock_irqsave(&dev->port.lock, flags); +- if (++dev->port.count > 1) { ++ if (atomic_inc_return(&dev->port.count) > 1) { + spin_unlock_irqrestore(&dev->port.lock, flags); + return 0; + } +@@ -727,10 +727,10 @@ static void rfcomm_tty_close(struct tty_struct *tty, struct file *filp) + return; + + BT_DBG("tty %p dev %p dlc %p opened %d", tty, dev, dev->dlc, +- dev->port.count); ++ atomic_read(&dev->port.count)); + + spin_lock_irqsave(&dev->port.lock, flags); +- if (!--dev->port.count) { ++ if (!atomic_dec_return(&dev->port.count)) { + spin_unlock_irqrestore(&dev->port.lock, flags); + if (dev->tty_dev->parent) + device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST); diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c -index 5fe2ff3..10968b5 100644 +index 8d493c9..3849e49 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c -@@ -1523,7 +1523,7 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) +@@ -1525,7 +1525,7 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) tmp.valid_hooks = t->table->valid_hooks; } mutex_unlock(&ebt_mutex); @@ -75057,19 +84786,37 @@ index 5fe2ff3..10968b5 100644 BUGPRINT("c2u Didn't work\n"); ret = -EFAULT; break; +@@ -2331,7 +2331,7 @@ static int compat_do_ebt_get_ctl(struct sock *sk, int cmd, + goto out; + tmp.valid_hooks = t->valid_hooks; + +- if (copy_to_user(user, &tmp, *len) != 0) { ++ if (*len > sizeof(tmp) || copy_to_user(user, &tmp, *len) != 0) { + ret = -EFAULT; + break; + } +@@ -2342,7 +2342,7 @@ static int compat_do_ebt_get_ctl(struct sock *sk, int cmd, + tmp.entries_size = t->table->entries_size; + tmp.valid_hooks = t->table->valid_hooks; + +- if (copy_to_user(user, &tmp, *len) != 0) { ++ if (*len > sizeof(tmp) || copy_to_user(user, &tmp, *len) != 0) { + ret = -EFAULT; + break; + } diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c -index 5cf5222..6f704ad 100644 +index a376ec1..1fbd6be 100644 --- a/net/caif/cfctrl.c +++ b/net/caif/cfctrl.c -@@ -9,6 +9,7 @@ - #include <linux/stddef.h> +@@ -10,6 +10,7 @@ #include <linux/spinlock.h> #include <linux/slab.h> + #include <linux/pkt_sched.h> +#include <linux/sched.h> #include <net/caif/caif_layer.h> #include <net/caif/cfpkt.h> #include <net/caif/cfctrl.h> -@@ -42,8 +43,8 @@ struct cflayer *cfctrl_create(void) +@@ -43,8 +44,8 @@ struct cflayer *cfctrl_create(void) memset(&dev_info, 0, sizeof(dev_info)); dev_info.id = 0xff; cfsrvl_init(&this->serv, 0, &dev_info, false); @@ -75080,7 +84827,7 @@ index 5cf5222..6f704ad 100644 this->serv.layer.receive = cfctrl_recv; sprintf(this->serv.layer.name, "ctrl"); this->serv.layer.ctrlcmd = cfctrl_ctrlcmd; -@@ -129,8 +130,8 @@ static void cfctrl_insert_req(struct cfctrl *ctrl, +@@ -130,8 +131,8 @@ static void cfctrl_insert_req(struct cfctrl *ctrl, struct cfctrl_request_info *req) { spin_lock_bh(&ctrl->info_list_lock); @@ -75091,7 +84838,7 @@ index 5cf5222..6f704ad 100644 list_add_tail(&req->list, &ctrl->list); spin_unlock_bh(&ctrl->info_list_lock); } -@@ -148,7 +149,7 @@ static struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl, +@@ -149,7 +150,7 @@ static struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl, if (p != first) pr_warn("Requests are not received in order\n"); @@ -75100,21 +84847,52 @@ index 5cf5222..6f704ad 100644 p->sequence_no); list_del(&p->list); goto out; +diff --git a/net/can/af_can.c b/net/can/af_can.c +index c48e522..1223690 100644 +--- a/net/can/af_can.c ++++ b/net/can/af_can.c +@@ -870,7 +870,7 @@ static const struct net_proto_family can_family_ops = { + }; + + /* notifier block for netdevice event */ +-static struct notifier_block can_netdev_notifier __read_mostly = { ++static struct notifier_block can_netdev_notifier = { + .notifier_call = can_notifier, + }; + diff --git a/net/can/gw.c b/net/can/gw.c -index 3d79b12..8de85fa 100644 +index 117814a..ad4fb73 100644 --- a/net/can/gw.c +++ b/net/can/gw.c -@@ -96,7 +96,7 @@ struct cf_mod { - struct { - void (*xor)(struct can_frame *cf, struct cgw_csum_xor *xor); - void (*crc8)(struct can_frame *cf, struct cgw_csum_crc8 *crc8); -- } csumfunc; -+ } __no_const csumfunc; - }; +@@ -80,7 +80,6 @@ MODULE_PARM_DESC(max_hops, + "default: " __stringify(CGW_DEFAULT_HOPS) ")"); + + static HLIST_HEAD(cgw_list); +-static struct notifier_block notifier; + + static struct kmem_cache *cgw_cache __read_mostly; + +@@ -928,6 +927,10 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) + return err; + } + ++static struct notifier_block notifier = { ++ .notifier_call = cgw_notifier ++}; ++ + static __init int cgw_module_init(void) + { + /* sanitize given module parameter */ +@@ -943,7 +946,6 @@ static __init int cgw_module_init(void) + return -ENOMEM; + /* set notifier */ +- notifier.notifier_call = cgw_notifier; + register_netdevice_notifier(¬ifier); + if (__rtnl_register(PF_CAN, RTM_GETROUTE, NULL, cgw_dump_jobs, NULL)) { diff --git a/net/compat.c b/net/compat.c -index ae6d67a..95dbaf6 100644 +index 79ae884..17c5c09 100644 --- a/net/compat.c +++ b/net/compat.c @@ -71,9 +71,9 @@ int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg) @@ -75190,7 +84968,7 @@ index ae6d67a..95dbaf6 100644 int fdmax = (kmsg->msg_controllen - sizeof(struct compat_cmsghdr)) / sizeof(int); int fdnum = scm->fp->count; struct file **fp = scm->fp->fp; -@@ -372,7 +372,7 @@ static int do_set_sock_timeout(struct socket *sock, int level, +@@ -363,7 +363,7 @@ static int do_set_sock_timeout(struct socket *sock, int level, return -EFAULT; old_fs = get_fs(); set_fs(KERNEL_DS); @@ -75199,7 +84977,7 @@ index ae6d67a..95dbaf6 100644 set_fs(old_fs); return err; -@@ -433,7 +433,7 @@ static int do_get_sock_timeout(struct socket *sock, int level, int optname, +@@ -424,7 +424,7 @@ static int do_get_sock_timeout(struct socket *sock, int level, int optname, len = sizeof(ktime); old_fs = get_fs(); set_fs(KERNEL_DS); @@ -75208,7 +84986,7 @@ index ae6d67a..95dbaf6 100644 set_fs(old_fs); if (!err) { -@@ -576,7 +576,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, +@@ -567,7 +567,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, case MCAST_JOIN_GROUP: case MCAST_LEAVE_GROUP: { @@ -75217,7 +84995,7 @@ index ae6d67a..95dbaf6 100644 struct group_req __user *kgr = compat_alloc_user_space(sizeof(struct group_req)); u32 interface; -@@ -597,7 +597,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, +@@ -588,7 +588,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, case MCAST_BLOCK_SOURCE: case MCAST_UNBLOCK_SOURCE: { @@ -75226,7 +85004,7 @@ index ae6d67a..95dbaf6 100644 struct group_source_req __user *kgsr = compat_alloc_user_space( sizeof(struct group_source_req)); u32 interface; -@@ -618,7 +618,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, +@@ -609,7 +609,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, } case MCAST_MSFILTER: { @@ -75235,7 +85013,7 @@ index ae6d67a..95dbaf6 100644 struct group_filter __user *kgf; u32 interface, fmode, numsrc; -@@ -656,7 +656,7 @@ int compat_mc_getsockopt(struct sock *sock, int level, int optname, +@@ -647,7 +647,7 @@ int compat_mc_getsockopt(struct sock *sock, int level, int optname, char __user *optval, int __user *optlen, int (*getsockopt)(struct sock *, int, int, char __user *, int __user *)) { @@ -75244,11 +85022,20 @@ index ae6d67a..95dbaf6 100644 struct group_filter __user *kgf; int __user *koptlen; u32 interface, fmode, numsrc; +@@ -796,7 +796,7 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args) + + if (call < SYS_SOCKET || call > SYS_SENDMMSG) + return -EINVAL; +- if (copy_from_user(a, args, nas[call])) ++ if (nas[call] > sizeof a || copy_from_user(a, args, nas[call])) + return -EFAULT; + a0 = a[0]; + a1 = a[1]; diff --git a/net/core/datagram.c b/net/core/datagram.c -index e4fbfd6..6a6ac94 100644 +index 368f9c3..f82d4a3 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c -@@ -290,7 +290,7 @@ int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags) +@@ -289,7 +289,7 @@ int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags) } kfree_skb(skb); @@ -75258,24 +85045,10 @@ index e4fbfd6..6a6ac94 100644 return err; diff --git a/net/core/dev.c b/net/core/dev.c -index c299416..8733baa 100644 +index 9a278e9..15f2b9e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -1136,9 +1136,13 @@ void dev_load(struct net *net, const char *name) - if (no_module && capable(CAP_NET_ADMIN)) - no_module = request_module("netdev-%s", name); - if (no_module && capable(CAP_SYS_MODULE)) { -+#ifdef CONFIG_GRKERNSEC_MODHARDEN -+ ___request_module(true, "grsec_modharden_netdev", "%s", name); -+#else - if (!request_module("%s", name)) - pr_err("Loading kernel module for a network device with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s instead.\n", - name); -+#endif - } - } - EXPORT_SYMBOL(dev_load); -@@ -1603,7 +1607,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) +@@ -1617,7 +1617,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) { if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) { if (skb_copy_ubufs(skb, GFP_ATOMIC)) { @@ -75284,8 +85057,8 @@ index c299416..8733baa 100644 kfree_skb(skb); return NET_RX_DROP; } -@@ -1613,7 +1617,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) - nf_reset(skb); +@@ -1626,7 +1626,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) + skb_orphan(skb); if (unlikely(!is_skb_forwardable(dev, skb))) { - atomic_long_inc(&dev->rx_dropped); @@ -75293,7 +85066,7 @@ index c299416..8733baa 100644 kfree_skb(skb); return NET_RX_DROP; } -@@ -2043,7 +2047,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb) +@@ -2351,7 +2351,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb) struct dev_gso_cb { void (*destructor)(struct sk_buff *skb); @@ -75302,7 +85075,7 @@ index c299416..8733baa 100644 #define DEV_GSO_CB(skb) ((struct dev_gso_cb *)(skb)->cb) -@@ -2878,7 +2882,7 @@ enqueue: +@@ -3093,7 +3093,7 @@ enqueue: local_irq_restore(flags); @@ -75311,7 +85084,7 @@ index c299416..8733baa 100644 kfree_skb(skb); return NET_RX_DROP; } -@@ -2950,7 +2954,7 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -3165,7 +3165,7 @@ int netif_rx_ni(struct sk_buff *skb) } EXPORT_SYMBOL(netif_rx_ni); @@ -75320,16 +85093,16 @@ index c299416..8733baa 100644 { struct softnet_data *sd = &__get_cpu_var(softnet_data); -@@ -3238,7 +3242,7 @@ ncls: - if (pt_prev) { - ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); +@@ -3490,7 +3490,7 @@ ncls: + ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); } else { + drop: - atomic_long_inc(&skb->dev->rx_dropped); + atomic_long_inc_unchecked(&skb->dev->rx_dropped); kfree_skb(skb); /* Jamal, now you will not able to escape explaining * me how you were going to use this. :-) -@@ -3798,7 +3802,7 @@ void netif_napi_del(struct napi_struct *napi) +@@ -4095,7 +4095,7 @@ void netif_napi_del(struct napi_struct *napi) } EXPORT_SYMBOL(netif_napi_del); @@ -75338,21 +85111,7 @@ index c299416..8733baa 100644 { struct softnet_data *sd = &__get_cpu_var(softnet_data); unsigned long time_limit = jiffies + 2; -@@ -4268,8 +4272,13 @@ static int ptype_seq_show(struct seq_file *seq, void *v) - else - seq_printf(seq, "%04x", ntohs(pt->type)); - -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ seq_printf(seq, " %-8s %p\n", -+ pt->dev ? pt->dev->name : "", NULL); -+#else - seq_printf(seq, " %-8s %pF\n", - pt->dev ? pt->dev->name : "", pt->func); -+#endif - } - - return 0; -@@ -5821,7 +5830,7 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, +@@ -5522,7 +5522,7 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, } else { netdev_stats_to_stats64(storage, &dev->stats); } @@ -75361,8 +85120,26 @@ index c299416..8733baa 100644 return storage; } EXPORT_SYMBOL(dev_get_stats); +diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c +index 6cc0481..59cfb00 100644 +--- a/net/core/dev_ioctl.c ++++ b/net/core/dev_ioctl.c +@@ -376,9 +376,13 @@ void dev_load(struct net *net, const char *name) + if (no_module && capable(CAP_NET_ADMIN)) + no_module = request_module("netdev-%s", name); + if (no_module && capable(CAP_SYS_MODULE)) { ++#ifdef CONFIG_GRKERNSEC_MODHARDEN ++ ___request_module(true, "grsec_modharden_netdev", "%s", name); ++#else + if (!request_module("%s", name)) + pr_warn("Loading kernel module for a network device with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s instead.\n", + name); ++#endif + } + } + EXPORT_SYMBOL(dev_load); diff --git a/net/core/flow.c b/net/core/flow.c -index e318c7e..168b1d0 100644 +index 2bfd081..53c6058 100644 --- a/net/core/flow.c +++ b/net/core/flow.c @@ -61,7 +61,7 @@ struct flow_cache { @@ -75383,7 +85160,7 @@ index e318c7e..168b1d0 100644 return 0; if (fle->object && !fle->object->ops->check(fle->object)) return 0; -@@ -259,7 +259,7 @@ flow_cache_lookup(struct net *net, const struct flowi *key, u16 family, u8 dir, +@@ -258,7 +258,7 @@ flow_cache_lookup(struct net *net, const struct flowi *key, u16 family, u8 dir, hlist_add_head(&fle->u.hlist, &fcp->hash_table[hash]); fcp->hash_count++; } @@ -75392,7 +85169,7 @@ index e318c7e..168b1d0 100644 flo = fle->object; if (!flo) goto ret_object; -@@ -280,7 +280,7 @@ nocache: +@@ -279,7 +279,7 @@ nocache: } flo = resolver(net, key, family, dir, flo, ctx); if (fle) { @@ -75423,11 +85200,95 @@ index 7e7aeb0..2a998cb 100644 return -EFAULT; m->msg_iov = iov; +diff --git a/net/core/neighbour.c b/net/core/neighbour.c +index 3863b8f..85c99a6 100644 +--- a/net/core/neighbour.c ++++ b/net/core/neighbour.c +@@ -2778,7 +2778,7 @@ static int proc_unres_qlen(ctl_table *ctl, int write, void __user *buffer, + size_t *lenp, loff_t *ppos) + { + int size, ret; +- ctl_table tmp = *ctl; ++ ctl_table_no_const tmp = *ctl; + + tmp.extra1 = &zero; + tmp.extra2 = &unres_qlen_max; +diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c +index 3174f19..5810985 100644 +--- a/net/core/net-procfs.c ++++ b/net/core/net-procfs.c +@@ -271,8 +271,13 @@ static int ptype_seq_show(struct seq_file *seq, void *v) + else + seq_printf(seq, "%04x", ntohs(pt->type)); + ++#ifdef CONFIG_GRKERNSEC_HIDESYM ++ seq_printf(seq, " %-8s %pF\n", ++ pt->dev ? pt->dev->name : "", NULL); ++#else + seq_printf(seq, " %-8s %pF\n", + pt->dev ? pt->dev->name : "", pt->func); ++#endif + } + + return 0; +diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c +index 7427ab5..389f411 100644 +--- a/net/core/net-sysfs.c ++++ b/net/core/net-sysfs.c +@@ -1321,7 +1321,7 @@ void netdev_class_remove_file(struct class_attribute *class_attr) + } + EXPORT_SYMBOL(netdev_class_remove_file); + +-int netdev_kobject_init(void) ++int __init netdev_kobject_init(void) + { + kobj_ns_type_register(&net_ns_type_operations); + return class_register(&net_class); +diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c +index 80e271d..2980cc2 100644 +--- a/net/core/net_namespace.c ++++ b/net/core/net_namespace.c +@@ -442,7 +442,7 @@ static int __register_pernet_operations(struct list_head *list, + int error; + LIST_HEAD(net_exit_list); + +- list_add_tail(&ops->list, list); ++ pax_list_add_tail((struct list_head *)&ops->list, list); + if (ops->init || (ops->id && ops->size)) { + for_each_net(net) { + error = ops_init(ops, net); +@@ -455,7 +455,7 @@ static int __register_pernet_operations(struct list_head *list, + + out_undo: + /* If I have an error cleanup all namespaces I initialized */ +- list_del(&ops->list); ++ pax_list_del((struct list_head *)&ops->list); + ops_exit_list(ops, &net_exit_list); + ops_free_list(ops, &net_exit_list); + return error; +@@ -466,7 +466,7 @@ static void __unregister_pernet_operations(struct pernet_operations *ops) + struct net *net; + LIST_HEAD(net_exit_list); + +- list_del(&ops->list); ++ pax_list_del((struct list_head *)&ops->list); + for_each_net(net) + list_add_tail(&net->exit_list, &net_exit_list); + ops_exit_list(ops, &net_exit_list); +@@ -600,7 +600,7 @@ int register_pernet_device(struct pernet_operations *ops) + mutex_lock(&net_mutex); + error = register_pernet_operations(&pernet_list, ops); + if (!error && (first_device == &pernet_list)) +- first_device = &ops->list; ++ first_device = (struct list_head *)&ops->list; + mutex_unlock(&net_mutex); + return error; + } diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c -index 900fc61..90d0583 100644 +index 23854b5..ff4fda4 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c -@@ -56,7 +56,7 @@ struct rtnl_link { +@@ -58,7 +58,7 @@ struct rtnl_link { rtnl_doit_func doit; rtnl_dumpit_func dumpit; rtnl_calcit_func calcit; @@ -75436,11 +85297,37 @@ index 900fc61..90d0583 100644 static DEFINE_MUTEX(rtnl_mutex); +@@ -299,10 +299,13 @@ int __rtnl_link_register(struct rtnl_link_ops *ops) + if (rtnl_link_ops_get(ops->kind)) + return -EEXIST; + +- if (!ops->dellink) +- ops->dellink = unregister_netdevice_queue; ++ if (!ops->dellink) { ++ pax_open_kernel(); ++ *(void **)&ops->dellink = unregister_netdevice_queue; ++ pax_close_kernel(); ++ } + +- list_add_tail(&ops->list, &link_ops); ++ pax_list_add_tail((struct list_head *)&ops->list, &link_ops); + return 0; + } + EXPORT_SYMBOL_GPL(__rtnl_link_register); +@@ -349,7 +352,7 @@ void __rtnl_link_unregister(struct rtnl_link_ops *ops) + for_each_net(net) { + __rtnl_kill_links(net, ops); + } +- list_del(&ops->list); ++ pax_list_del((struct list_head *)&ops->list); + } + EXPORT_SYMBOL_GPL(__rtnl_link_unregister); + diff --git a/net/core/scm.c b/net/core/scm.c -index 611c5ef..88f6d6d 100644 +index 2dc6cda..2159524 100644 --- a/net/core/scm.c +++ b/net/core/scm.c -@@ -219,7 +219,7 @@ EXPORT_SYMBOL(__scm_send); +@@ -226,7 +226,7 @@ EXPORT_SYMBOL(__scm_send); int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data) { struct cmsghdr __user *cm @@ -75449,7 +85336,7 @@ index 611c5ef..88f6d6d 100644 struct cmsghdr cmhdr; int cmlen = CMSG_LEN(len); int err; -@@ -242,7 +242,7 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data) +@@ -249,7 +249,7 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data) err = -EFAULT; if (copy_to_user(cm, &cmhdr, sizeof cmhdr)) goto out; @@ -75458,7 +85345,7 @@ index 611c5ef..88f6d6d 100644 goto out; cmlen = CMSG_SPACE(len); if (msg->msg_controllen < cmlen) -@@ -258,7 +258,7 @@ EXPORT_SYMBOL(put_cmsg); +@@ -265,7 +265,7 @@ EXPORT_SYMBOL(put_cmsg); void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) { struct cmsghdr __user *cm @@ -75467,7 +85354,7 @@ index 611c5ef..88f6d6d 100644 int fdmax = 0; int fdnum = scm->fp->count; -@@ -278,7 +278,7 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) +@@ -285,7 +285,7 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) if (fdnum < fdmax) fdmax = fdnum; @@ -75475,12 +85362,30 @@ index 611c5ef..88f6d6d 100644 + for (i=0, cmfptr=(int __force_user *)CMSG_DATA((void __force_kernel *)cm); i<fdmax; i++, cmfptr++) { - int new_fd; + struct socket *sock; +diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c +index e61a8bb..6a2f13c 100644 +--- a/net/core/secure_seq.c ++++ b/net/core/secure_seq.c +@@ -12,12 +12,10 @@ + + static u32 net_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned; + +-static int __init net_secret_init(void) ++void net_secret_init(void) + { + get_random_bytes(net_secret, sizeof(net_secret)); +- return 0; + } +-late_initcall(net_secret_init); + + #ifdef CONFIG_INET + static u32 seq_scale(u32 seq) diff --git a/net/core/sock.c b/net/core/sock.c -index 0f8402e..f0b6338 100644 +index 1432266..1a0d4a1 100644 --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -340,7 +340,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) +@@ -390,7 +390,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) struct sk_buff_head *list = &sk->sk_receive_queue; if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) { @@ -75489,16 +85394,16 @@ index 0f8402e..f0b6338 100644 trace_sock_rcvqueue_full(sk, skb); return -ENOMEM; } -@@ -350,7 +350,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) +@@ -400,7 +400,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) return err; - if (!sk_rmem_schedule(sk, skb->truesize)) { + if (!sk_rmem_schedule(sk, skb, skb->truesize)) { - atomic_inc(&sk->sk_drops); + atomic_inc_unchecked(&sk->sk_drops); return -ENOBUFS; } -@@ -370,7 +370,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) +@@ -420,7 +420,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) skb_dst_force(skb); spin_lock_irqsave(&list->lock, flags); @@ -75507,43 +85412,55 @@ index 0f8402e..f0b6338 100644 __skb_queue_tail(list, skb); spin_unlock_irqrestore(&list->lock, flags); -@@ -390,7 +390,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested) +@@ -440,7 +440,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested) skb->dev = NULL; - if (sk_rcvqueues_full(sk, skb)) { + if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) { - atomic_inc(&sk->sk_drops); + atomic_inc_unchecked(&sk->sk_drops); goto discard_and_relse; } if (nested) -@@ -408,7 +408,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested) +@@ -458,7 +458,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested) mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_); - } else if (sk_add_backlog(sk, skb)) { + } else if (sk_add_backlog(sk, skb, sk->sk_rcvbuf)) { bh_unlock_sock(sk); - atomic_inc(&sk->sk_drops); + atomic_inc_unchecked(&sk->sk_drops); goto discard_and_relse; } -@@ -984,7 +984,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, - if (len > sizeof(peercred)) - len = sizeof(peercred); - cred_to_ucred(sk->sk_peer_pid, sk->sk_peer_cred, &peercred); -- if (copy_to_user(optval, &peercred, len)) -+ if (len > sizeof(peercred) || copy_to_user(optval, &peercred, len)) - return -EFAULT; - goto lenout; - } -@@ -997,7 +997,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, +@@ -942,12 +942,12 @@ int sock_getsockopt(struct socket *sock, int level, int optname, + struct timeval tm; + } v; + +- int lv = sizeof(int); +- int len; ++ unsigned int lv = sizeof(int); ++ unsigned int len; + + if (get_user(len, optlen)) + return -EFAULT; +- if (len < 0) ++ if (len > INT_MAX) + return -EINVAL; + + memset(&v, 0, sizeof(v)); +@@ -1099,11 +1099,11 @@ int sock_getsockopt(struct socket *sock, int level, int optname, + + case SO_PEERNAME: + { +- char address[128]; ++ char address[_K_SS_MAXSIZE]; + + if (sock->ops->getname(sock, (struct sockaddr *)address, &lv, 2)) return -ENOTCONN; - if (lv < len) +- if (lv < len) ++ if (lv < len || sizeof address < len) return -EINVAL; -- if (copy_to_user(optval, address, len)) -+ if (len > sizeof(address) || copy_to_user(optval, address, len)) + if (copy_to_user(optval, address, len)) return -EFAULT; - goto lenout; - } -@@ -1043,7 +1043,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, +@@ -1166,7 +1166,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, if (len > lv) len = lv; @@ -75552,7 +85469,7 @@ index 0f8402e..f0b6338 100644 return -EFAULT; lenout: if (put_user(len, optlen)) -@@ -2131,7 +2131,7 @@ void sock_init_data(struct socket *sock, struct sock *sk) +@@ -2284,7 +2284,7 @@ void sock_init_data(struct socket *sock, struct sock *sk) */ smp_wmb(); atomic_set(&sk->sk_refcnt, 1); @@ -75562,10 +85479,17 @@ index 0f8402e..f0b6338 100644 EXPORT_SYMBOL(sock_init_data); diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c -index b9868e1..849f809 100644 +index a29e90c..922399c 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c -@@ -16,20 +16,27 @@ static DEFINE_MUTEX(sock_diag_table_mutex); +@@ -9,26 +9,33 @@ + #include <linux/inet_diag.h> + #include <linux/sock_diag.h> + +-static const struct sock_diag_handler *sock_diag_handlers[AF_MAX]; ++static const struct sock_diag_handler *sock_diag_handlers[AF_MAX] __read_only; + static int (*inet_rcv_compat)(struct sk_buff *skb, struct nlmsghdr *nlh); + static DEFINE_MUTEX(sock_diag_table_mutex); int sock_diag_check_cookie(void *sk, __u32 *cookie) { @@ -75593,8 +85517,103 @@ index b9868e1..849f809 100644 } EXPORT_SYMBOL_GPL(sock_diag_save_cookie); +@@ -75,8 +82,11 @@ int sock_diag_register(const struct sock_diag_handler *hndl) + mutex_lock(&sock_diag_table_mutex); + if (sock_diag_handlers[hndl->family]) + err = -EBUSY; +- else ++ else { ++ pax_open_kernel(); + sock_diag_handlers[hndl->family] = hndl; ++ pax_close_kernel(); ++ } + mutex_unlock(&sock_diag_table_mutex); + + return err; +@@ -92,7 +102,9 @@ void sock_diag_unregister(const struct sock_diag_handler *hnld) + + mutex_lock(&sock_diag_table_mutex); + BUG_ON(sock_diag_handlers[family] != hnld); ++ pax_open_kernel(); + sock_diag_handlers[family] = NULL; ++ pax_close_kernel(); + mutex_unlock(&sock_diag_table_mutex); + } + EXPORT_SYMBOL_GPL(sock_diag_unregister); +diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c +index cfdb46a..cef55e1 100644 +--- a/net/core/sysctl_net_core.c ++++ b/net/core/sysctl_net_core.c +@@ -28,7 +28,7 @@ static int rps_sock_flow_sysctl(ctl_table *table, int write, + { + unsigned int orig_size, size; + int ret, i; +- ctl_table tmp = { ++ ctl_table_no_const tmp = { + .data = &size, + .maxlen = sizeof(size), + .mode = table->mode +@@ -211,13 +211,12 @@ static struct ctl_table netns_core_table[] = { + + static __net_init int sysctl_core_net_init(struct net *net) + { +- struct ctl_table *tbl; ++ ctl_table_no_const *tbl = NULL; + + net->core.sysctl_somaxconn = SOMAXCONN; + +- tbl = netns_core_table; + if (!net_eq(net, &init_net)) { +- tbl = kmemdup(tbl, sizeof(netns_core_table), GFP_KERNEL); ++ tbl = kmemdup(netns_core_table, sizeof(netns_core_table), GFP_KERNEL); + if (tbl == NULL) + goto err_dup; + +@@ -227,17 +226,16 @@ static __net_init int sysctl_core_net_init(struct net *net) + if (net->user_ns != &init_user_ns) { + tbl[0].procname = NULL; + } +- } +- +- net->core.sysctl_hdr = register_net_sysctl(net, "net/core", tbl); ++ net->core.sysctl_hdr = register_net_sysctl(net, "net/core", tbl); ++ } else ++ net->core.sysctl_hdr = register_net_sysctl(net, "net/core", netns_core_table); + if (net->core.sysctl_hdr == NULL) + goto err_reg; + + return 0; + + err_reg: +- if (tbl != netns_core_table) +- kfree(tbl); ++ kfree(tbl); + err_dup: + return -ENOMEM; + } +@@ -252,7 +250,7 @@ static __net_exit void sysctl_core_net_exit(struct net *net) + kfree(tbl); + } + +-static __net_initdata struct pernet_operations sysctl_core_ops = { ++static __net_initconst struct pernet_operations sysctl_core_ops = { + .init = sysctl_core_net_init, + .exit = sysctl_core_net_exit, + }; +diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c +index c21f200..bc4565b 100644 +--- a/net/decnet/af_decnet.c ++++ b/net/decnet/af_decnet.c +@@ -465,6 +465,7 @@ static struct proto dn_proto = { + .sysctl_rmem = sysctl_decnet_rmem, + .max_header = DN_MAX_NSP_DATA_HEADER + 64, + .obj_size = sizeof(struct dn_sock), ++ .slab_flags = SLAB_USERCOPY, + }; + + static struct sock *dn_alloc_sock(struct net *net, struct socket *sock, gfp_t gfp) diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c -index 02e75d1..9a57a7c 100644 +index a55eecc..dd8428c 100644 --- a/net/decnet/sysctl_net_decnet.c +++ b/net/decnet/sysctl_net_decnet.c @@ -174,7 +174,7 @@ static int dn_node_address_handler(ctl_table *table, int write, @@ -75615,30 +85634,144 @@ index 02e75d1..9a57a7c 100644 return -EFAULT; *lenp = len; -diff --git a/net/econet/Kconfig b/net/econet/Kconfig -index 39a2d29..f39c0fe 100644 ---- a/net/econet/Kconfig -+++ b/net/econet/Kconfig -@@ -4,7 +4,7 @@ - - config ECONET - tristate "Acorn Econet/AUN protocols (EXPERIMENTAL)" -- depends on EXPERIMENTAL && INET -+ depends on EXPERIMENTAL && INET && BROKEN - ---help--- - Econet is a fairly old and slow networking protocol mainly used by - Acorn computers to access file and print servers. It uses native +diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c +index c929d9c..df10cde 100644 +--- a/net/ipv4/af_inet.c ++++ b/net/ipv4/af_inet.c +@@ -115,6 +115,7 @@ + #include <net/inet_common.h> + #include <net/xfrm.h> + #include <net/net_namespace.h> ++#include <net/secure_seq.h> + #ifdef CONFIG_IP_MROUTE + #include <linux/mroute.h> + #endif +@@ -263,8 +264,10 @@ void build_ehash_secret(void) + get_random_bytes(&rnd, sizeof(rnd)); + } while (rnd == 0); + +- if (cmpxchg(&inet_ehash_secret, 0, rnd) == 0) ++ if (cmpxchg(&inet_ehash_secret, 0, rnd) == 0) { + get_random_bytes(&ipv6_hash_secret, sizeof(ipv6_hash_secret)); ++ net_secret_init(); ++ } + } + EXPORT_SYMBOL(build_ehash_secret); + +@@ -1699,13 +1702,9 @@ static int __init inet_init(void) + + BUILD_BUG_ON(sizeof(struct inet_skb_parm) > FIELD_SIZEOF(struct sk_buff, cb)); + +- sysctl_local_reserved_ports = kzalloc(65536 / 8, GFP_KERNEL); +- if (!sysctl_local_reserved_ports) +- goto out; +- + rc = proto_register(&tcp_prot, 1); + if (rc) +- goto out_free_reserved_ports; ++ goto out; + + rc = proto_register(&udp_prot, 1); + if (rc) +@@ -1814,8 +1813,6 @@ out_unregister_udp_proto: + proto_unregister(&udp_prot); + out_unregister_tcp_proto: + proto_unregister(&tcp_prot); +-out_free_reserved_ports: +- kfree(sysctl_local_reserved_ports); + goto out; + } + +diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c +index 2e7f194..0fa4d6d 100644 +--- a/net/ipv4/ah4.c ++++ b/net/ipv4/ah4.c +@@ -420,7 +420,7 @@ static void ah4_err(struct sk_buff *skb, u32 info) + return; + + if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) { +- atomic_inc(&flow_cache_genid); ++ atomic_inc_unchecked(&flow_cache_genid); + rt_genid_bump(net); + + ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0); +diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c +index c6287cd..e9bc96a 100644 +--- a/net/ipv4/devinet.c ++++ b/net/ipv4/devinet.c +@@ -1992,7 +1992,7 @@ static int ipv4_doint_and_flush(ctl_table *ctl, int write, + #define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \ + DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush) + +-static struct devinet_sysctl_table { ++static const struct devinet_sysctl_table { + struct ctl_table_header *sysctl_header; + struct ctl_table devinet_vars[__IPV4_DEVCONF_MAX]; + } devinet_sysctl = { +@@ -2110,7 +2110,7 @@ static __net_init int devinet_init_net(struct net *net) + int err; + struct ipv4_devconf *all, *dflt; + #ifdef CONFIG_SYSCTL +- struct ctl_table *tbl = ctl_forward_entry; ++ ctl_table_no_const *tbl = NULL; + struct ctl_table_header *forw_hdr; + #endif + +@@ -2128,7 +2128,7 @@ static __net_init int devinet_init_net(struct net *net) + goto err_alloc_dflt; + + #ifdef CONFIG_SYSCTL +- tbl = kmemdup(tbl, sizeof(ctl_forward_entry), GFP_KERNEL); ++ tbl = kmemdup(ctl_forward_entry, sizeof(ctl_forward_entry), GFP_KERNEL); + if (tbl == NULL) + goto err_alloc_ctl; + +@@ -2148,7 +2148,10 @@ static __net_init int devinet_init_net(struct net *net) + goto err_reg_dflt; + + err = -ENOMEM; +- forw_hdr = register_net_sysctl(net, "net/ipv4", tbl); ++ if (!net_eq(net, &init_net)) ++ forw_hdr = register_net_sysctl(net, "net/ipv4", tbl); ++ else ++ forw_hdr = register_net_sysctl(net, "net/ipv4", ctl_forward_entry); + if (forw_hdr == NULL) + goto err_reg_ctl; + net->ipv4.forw_hdr = forw_hdr; +@@ -2164,8 +2167,7 @@ err_reg_ctl: + err_reg_dflt: + __devinet_sysctl_unregister(all); + err_reg_all: +- if (tbl != ctl_forward_entry) +- kfree(tbl); ++ kfree(tbl); + err_alloc_ctl: + #endif + if (dflt != &ipv4_devconf_dflt) +diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c +index 4cfe34d..a6ba66e 100644 +--- a/net/ipv4/esp4.c ++++ b/net/ipv4/esp4.c +@@ -503,7 +503,7 @@ static void esp4_err(struct sk_buff *skb, u32 info) + return; + + if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) { +- atomic_inc(&flow_cache_genid); ++ atomic_inc_unchecked(&flow_cache_genid); + rt_genid_bump(net); + + ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ESP, 0); diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c -index cbe3a68..a879b75 100644 +index eb4bb12..ee4ec7d 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c -@@ -969,12 +969,12 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, +@@ -1017,12 +1017,12 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, #ifdef CONFIG_IP_ROUTE_MULTIPATH fib_sync_up(dev); #endif - atomic_inc(&net->ipv4.dev_addr_genid); + atomic_inc_unchecked(&net->ipv4.dev_addr_genid); - rt_cache_flush(dev_net(dev), -1); + rt_cache_flush(dev_net(dev)); break; case NETDEV_DOWN: fib_del_ifaddr(ifa, NULL); @@ -75647,20 +85780,20 @@ index cbe3a68..a879b75 100644 if (ifa->ifa_dev->ifa_list == NULL) { /* Last address was deleted from this interface. * Disable IP. -@@ -1010,7 +1010,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo +@@ -1058,7 +1058,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo #ifdef CONFIG_IP_ROUTE_MULTIPATH fib_sync_up(dev); #endif - atomic_inc(&net->ipv4.dev_addr_genid); + atomic_inc_unchecked(&net->ipv4.dev_addr_genid); - rt_cache_flush(dev_net(dev), -1); + rt_cache_flush(net); break; case NETDEV_DOWN: diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c -index 8861f91..ab1e3c1 100644 +index 8f6cb7a..34507f9 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c -@@ -698,7 +698,7 @@ __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh) +@@ -765,7 +765,7 @@ __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh) nh->nh_saddr = inet_select_addr(nh->nh_dev, nh->nh_gw, nh->nh_parent->fib_scope); @@ -75669,8 +85802,21 @@ index 8861f91..ab1e3c1 100644 return nh->nh_saddr; } +diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c +index 786d97a..1889c0d 100644 +--- a/net/ipv4/inet_connection_sock.c ++++ b/net/ipv4/inet_connection_sock.c +@@ -37,7 +37,7 @@ struct local_ports sysctl_local_ports __read_mostly = { + .range = { 32768, 61000 }, + }; + +-unsigned long *sysctl_local_reserved_ports; ++unsigned long sysctl_local_reserved_ports[65536 / 8 / sizeof(unsigned long)]; + EXPORT_SYMBOL(sysctl_local_reserved_ports); + + void inet_get_local_port_range(int *low, int *high) diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c -index 984ec65..97ac518 100644 +index 6af375a..c493c74 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c @@ -18,12 +18,15 @@ @@ -75689,7 +85835,7 @@ index 984ec65..97ac518 100644 /* * Allocate and initialize a new local port bind bucket. * The bindhash mutex for snum's hash chain must be held here. -@@ -530,6 +533,8 @@ ok: +@@ -554,6 +557,8 @@ ok: twrefcnt += inet_twsk_bind_unhash(tw, hinfo); spin_unlock(&head->lock); @@ -75699,10 +85845,10 @@ index 984ec65..97ac518 100644 inet_twsk_deschedule(tw, death_row); while (twrefcnt) { diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c -index dfba343..c827d50 100644 +index 000e3d2..5472da3 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c -@@ -487,8 +487,8 @@ relookup: +@@ -503,8 +503,8 @@ relookup: if (p) { p->daddr = *daddr; atomic_set(&p->refcnt, 1); @@ -75714,10 +85860,10 @@ index dfba343..c827d50 100644 secure_ip_id(daddr->addr.a4) : secure_ipv6_id(daddr->addr.a6)); diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c -index 3727e23..517f5df 100644 +index 52c273e..579060b 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c -@@ -318,7 +318,7 @@ static inline int ip_frag_too_far(struct ipq *qp) +@@ -311,7 +311,7 @@ static inline int ip_frag_too_far(struct ipq *qp) return 0; start = qp->rid; @@ -75726,11 +85872,80 @@ index 3727e23..517f5df 100644 qp->rid = end; rc = qp->q.fragments && (end - start) > max; +@@ -788,12 +788,11 @@ static struct ctl_table ip4_frags_ctl_table[] = { + + static int __net_init ip4_frags_ns_ctl_register(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table = NULL; + struct ctl_table_header *hdr; + +- table = ip4_frags_ns_ctl_table; + if (!net_eq(net, &init_net)) { +- table = kmemdup(table, sizeof(ip4_frags_ns_ctl_table), GFP_KERNEL); ++ table = kmemdup(ip4_frags_ns_ctl_table, sizeof(ip4_frags_ns_ctl_table), GFP_KERNEL); + if (table == NULL) + goto err_alloc; + +@@ -804,9 +803,10 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net) + /* Don't export sysctls to unprivileged users */ + if (net->user_ns != &init_user_ns) + table[0].procname = NULL; +- } ++ hdr = register_net_sysctl(net, "net/ipv4", table); ++ } else ++ hdr = register_net_sysctl(net, "net/ipv4", ip4_frags_ns_ctl_table); + +- hdr = register_net_sysctl(net, "net/ipv4", table); + if (hdr == NULL) + goto err_reg; + +@@ -814,8 +814,7 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net) + return 0; + + err_reg: +- if (!net_eq(net, &init_net)) +- kfree(table); ++ kfree(table); + err_alloc: + return -ENOMEM; + } +diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c +index 91d66db..4af7d99 100644 +--- a/net/ipv4/ip_gre.c ++++ b/net/ipv4/ip_gre.c +@@ -124,7 +124,7 @@ static bool log_ecn_error = true; + module_param(log_ecn_error, bool, 0644); + MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); + +-static struct rtnl_link_ops ipgre_link_ops __read_mostly; ++static struct rtnl_link_ops ipgre_link_ops; + static int ipgre_tunnel_init(struct net_device *dev); + static void ipgre_tunnel_setup(struct net_device *dev); + static int ipgre_tunnel_bind_dev(struct net_device *dev); +@@ -1823,7 +1823,7 @@ static const struct nla_policy ipgre_policy[IFLA_GRE_MAX + 1] = { + [IFLA_GRE_PMTUDISC] = { .type = NLA_U8 }, + }; + +-static struct rtnl_link_ops ipgre_link_ops __read_mostly = { ++static struct rtnl_link_ops ipgre_link_ops = { + .kind = "gre", + .maxtype = IFLA_GRE_MAX, + .policy = ipgre_policy, +@@ -1836,7 +1836,7 @@ static struct rtnl_link_ops ipgre_link_ops __read_mostly = { + .fill_info = ipgre_fill_info, + }; + +-static struct rtnl_link_ops ipgre_tap_ops __read_mostly = { ++static struct rtnl_link_ops ipgre_tap_ops = { + .kind = "gretap", + .maxtype = IFLA_GRE_MAX, + .policy = ipgre_policy, diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c -index 2fd0fba..83fac99 100644 +index d9c4f11..02b82dbc 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c -@@ -1137,7 +1137,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, +@@ -1152,7 +1152,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, len = min_t(unsigned int, len, opt->optlen); if (put_user(len, optlen)) return -EFAULT; @@ -75740,7 +85955,7 @@ index 2fd0fba..83fac99 100644 return -EFAULT; return 0; } -@@ -1268,7 +1269,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, +@@ -1283,7 +1284,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, if (sk->sk_type != SOCK_STREAM) return -ENOPROTOOPT; @@ -75749,11 +85964,46 @@ index 2fd0fba..83fac99 100644 msg.msg_controllen = len; msg.msg_flags = flags; +diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c +index c3a4233..1412161 100644 +--- a/net/ipv4/ip_vti.c ++++ b/net/ipv4/ip_vti.c +@@ -47,7 +47,7 @@ + #define HASH_SIZE 16 + #define HASH(addr) (((__force u32)addr^((__force u32)addr>>4))&(HASH_SIZE-1)) + +-static struct rtnl_link_ops vti_link_ops __read_mostly; ++static struct rtnl_link_ops vti_link_ops; + + static int vti_net_id __read_mostly; + struct vti_net { +@@ -886,7 +886,7 @@ static const struct nla_policy vti_policy[IFLA_VTI_MAX + 1] = { + [IFLA_VTI_REMOTE] = { .len = FIELD_SIZEOF(struct iphdr, daddr) }, + }; + +-static struct rtnl_link_ops vti_link_ops __read_mostly = { ++static struct rtnl_link_ops vti_link_ops = { + .kind = "vti", + .maxtype = IFLA_VTI_MAX, + .policy = vti_policy, +diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c +index f01d1b1..8fe03ad 100644 +--- a/net/ipv4/ipcomp.c ++++ b/net/ipv4/ipcomp.c +@@ -48,7 +48,7 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info) + return; + + if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) { +- atomic_inc(&flow_cache_genid); ++ atomic_inc_unchecked(&flow_cache_genid); + rt_genid_bump(net); + + ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_COMP, 0); diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c -index 92ac7e7..13f93d9 100644 +index bf6c5cf..ab2e9c6 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c -@@ -321,7 +321,7 @@ static int __init ic_devinet_ioctl(unsigned int cmd, struct ifreq *arg) +@@ -323,7 +323,7 @@ static int __init ic_devinet_ioctl(unsigned int cmd, struct ifreq *arg) mm_segment_t oldfs = get_fs(); set_fs(get_ds()); @@ -75762,7 +86012,7 @@ index 92ac7e7..13f93d9 100644 set_fs(oldfs); return res; } -@@ -332,7 +332,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg) +@@ -334,7 +334,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg) mm_segment_t oldfs = get_fs(); set_fs(get_ds()); @@ -75771,7 +86021,7 @@ index 92ac7e7..13f93d9 100644 set_fs(oldfs); return res; } -@@ -343,7 +343,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg) +@@ -345,7 +345,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg) mm_segment_t oldfs = get_fs(); set_fs(get_ds()); @@ -75780,13 +86030,133 @@ index 92ac7e7..13f93d9 100644 set_fs(oldfs); return res; } +diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c +index 8f024d4..8b3500c 100644 +--- a/net/ipv4/ipip.c ++++ b/net/ipv4/ipip.c +@@ -138,7 +138,7 @@ struct ipip_net { + static int ipip_tunnel_init(struct net_device *dev); + static void ipip_tunnel_setup(struct net_device *dev); + static void ipip_dev_free(struct net_device *dev); +-static struct rtnl_link_ops ipip_link_ops __read_mostly; ++static struct rtnl_link_ops ipip_link_ops; + + static struct rtnl_link_stats64 *ipip_get_stats64(struct net_device *dev, + struct rtnl_link_stats64 *tot) +@@ -974,7 +974,7 @@ static const struct nla_policy ipip_policy[IFLA_IPTUN_MAX + 1] = { + [IFLA_IPTUN_PMTUDISC] = { .type = NLA_U8 }, + }; + +-static struct rtnl_link_ops ipip_link_ops __read_mostly = { ++static struct rtnl_link_ops ipip_link_ops = { + .kind = "ipip", + .maxtype = IFLA_IPTUN_MAX, + .policy = ipip_policy, +diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c +index 7dc6a97..229c61b 100644 +--- a/net/ipv4/netfilter/arp_tables.c ++++ b/net/ipv4/netfilter/arp_tables.c +@@ -879,14 +879,14 @@ static int compat_table_info(const struct xt_table_info *info, + #endif + + static int get_info(struct net *net, void __user *user, +- const int *len, int compat) ++ int len, int compat) + { + char name[XT_TABLE_MAXNAMELEN]; + struct xt_table *t; + int ret; + +- if (*len != sizeof(struct arpt_getinfo)) { +- duprintf("length %u != %Zu\n", *len, ++ if (len != sizeof(struct arpt_getinfo)) { ++ duprintf("length %u != %Zu\n", len, + sizeof(struct arpt_getinfo)); + return -EINVAL; + } +@@ -923,7 +923,7 @@ static int get_info(struct net *net, void __user *user, + info.size = private->size; + strcpy(info.name, name); + +- if (copy_to_user(user, &info, *len) != 0) ++ if (copy_to_user(user, &info, len) != 0) + ret = -EFAULT; + else + ret = 0; +@@ -1682,7 +1682,7 @@ static int compat_do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, + + switch (cmd) { + case ARPT_SO_GET_INFO: +- ret = get_info(sock_net(sk), user, len, 1); ++ ret = get_info(sock_net(sk), user, *len, 1); + break; + case ARPT_SO_GET_ENTRIES: + ret = compat_get_entries(sock_net(sk), user, len); +@@ -1727,7 +1727,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len + + switch (cmd) { + case ARPT_SO_GET_INFO: +- ret = get_info(sock_net(sk), user, len, 0); ++ ret = get_info(sock_net(sk), user, *len, 0); + break; + + case ARPT_SO_GET_ENTRIES: +diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c +index 3efcf87..5247916 100644 +--- a/net/ipv4/netfilter/ip_tables.c ++++ b/net/ipv4/netfilter/ip_tables.c +@@ -1068,14 +1068,14 @@ static int compat_table_info(const struct xt_table_info *info, + #endif + + static int get_info(struct net *net, void __user *user, +- const int *len, int compat) ++ int len, int compat) + { + char name[XT_TABLE_MAXNAMELEN]; + struct xt_table *t; + int ret; + +- if (*len != sizeof(struct ipt_getinfo)) { +- duprintf("length %u != %zu\n", *len, ++ if (len != sizeof(struct ipt_getinfo)) { ++ duprintf("length %u != %zu\n", len, + sizeof(struct ipt_getinfo)); + return -EINVAL; + } +@@ -1112,7 +1112,7 @@ static int get_info(struct net *net, void __user *user, + info.size = private->size; + strcpy(info.name, name); + +- if (copy_to_user(user, &info, *len) != 0) ++ if (copy_to_user(user, &info, len) != 0) + ret = -EFAULT; + else + ret = 0; +@@ -1966,7 +1966,7 @@ compat_do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) + + switch (cmd) { + case IPT_SO_GET_INFO: +- ret = get_info(sock_net(sk), user, len, 1); ++ ret = get_info(sock_net(sk), user, *len, 1); + break; + case IPT_SO_GET_ENTRIES: + ret = compat_get_entries(sock_net(sk), user, len); +@@ -2013,7 +2013,7 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) + + switch (cmd) { + case IPT_SO_GET_INFO: +- ret = get_info(sock_net(sk), user, len, 0); ++ ret = get_info(sock_net(sk), user, *len, 0); + break; + + case IPT_SO_GET_ENTRIES: diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c -index 50009c7..5996a9f 100644 +index 2e91006..f084394 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c -@@ -838,7 +838,7 @@ static void ping_format_sock(struct sock *sp, struct seq_file *f, - sk_rmem_alloc_get(sp), - 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), +@@ -844,7 +844,7 @@ static void ping_format_sock(struct sock *sp, struct seq_file *f, + from_kuid_munged(seq_user_ns(f), sock_i_uid(sp)), + 0, sock_i_ino(sp), atomic_read(&sp->sk_refcnt), sp, - atomic_read(&sp->sk_drops), len); + atomic_read_unchecked(&sp->sk_drops), len); @@ -75794,10 +86164,10 @@ index 50009c7..5996a9f 100644 static int ping_seq_show(struct seq_file *seq, void *v) diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c -index bbd604c..4d5469c 100644 +index dd44e0a..06dcca4 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c -@@ -304,7 +304,7 @@ static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb) +@@ -309,7 +309,7 @@ static int raw_rcv_skb(struct sock *sk, struct sk_buff *skb) int raw_rcv(struct sock *sk, struct sk_buff *skb) { if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) { @@ -75806,7 +86176,7 @@ index bbd604c..4d5469c 100644 kfree_skb(skb); return NET_RX_DROP; } -@@ -740,16 +740,20 @@ static int raw_init(struct sock *sk) +@@ -745,16 +745,20 @@ static int raw_init(struct sock *sk) static int raw_seticmpfilter(struct sock *sk, char __user *optval, int optlen) { @@ -75828,7 +86198,7 @@ index bbd604c..4d5469c 100644 if (get_user(len, optlen)) goto out; -@@ -759,8 +763,8 @@ static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *o +@@ -764,8 +768,8 @@ static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *o if (len > sizeof(struct icmp_filter)) len = sizeof(struct icmp_filter); ret = -EFAULT; @@ -75839,57 +86209,216 @@ index bbd604c..4d5469c 100644 goto out; ret = 0; out: return ret; -@@ -988,7 +992,13 @@ static void raw_sock_seq_show(struct seq_file *seq, struct sock *sp, int i) - sk_wmem_alloc_get(sp), - sk_rmem_alloc_get(sp), - 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), +@@ -994,7 +998,7 @@ static void raw_sock_seq_show(struct seq_file *seq, struct sock *sp, int i) + 0, 0L, 0, + from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)), + 0, sock_i_ino(sp), - atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops)); -+ atomic_read(&sp->sk_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else -+ sp, -+#endif -+ atomic_read_unchecked(&sp->sk_drops)); ++ atomic_read(&sp->sk_refcnt), sp, atomic_read_unchecked(&sp->sk_drops)); } static int raw_seq_show(struct seq_file *seq, void *v) diff --git a/net/ipv4/route.c b/net/ipv4/route.c -index 167ea10..4b15883 100644 +index 6e28514..5e1b055 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c -@@ -312,7 +312,7 @@ static inline unsigned int rt_hash(__be32 daddr, __be32 saddr, int idx, +@@ -2553,34 +2553,34 @@ static struct ctl_table ipv4_route_flush_table[] = { + .maxlen = sizeof(int), + .mode = 0200, + .proc_handler = ipv4_sysctl_rtcache_flush, ++ .extra1 = &init_net, + }, + { }, + }; - static inline int rt_genid(struct net *net) + static __net_init int sysctl_route_net_init(struct net *net) { -- return atomic_read(&net->ipv4.rt_genid); -+ return atomic_read_unchecked(&net->ipv4.rt_genid); +- struct ctl_table *tbl; ++ ctl_table_no_const *tbl = NULL; + +- tbl = ipv4_route_flush_table; + if (!net_eq(net, &init_net)) { +- tbl = kmemdup(tbl, sizeof(ipv4_route_flush_table), GFP_KERNEL); ++ tbl = kmemdup(ipv4_route_flush_table, sizeof(ipv4_route_flush_table), GFP_KERNEL); + if (tbl == NULL) + goto err_dup; + + /* Don't export sysctls to unprivileged users */ + if (net->user_ns != &init_user_ns) + tbl[0].procname = NULL; +- } +- tbl[0].extra1 = net; ++ tbl[0].extra1 = net; ++ net->ipv4.route_hdr = register_net_sysctl(net, "net/ipv4/route", tbl); ++ } else ++ net->ipv4.route_hdr = register_net_sysctl(net, "net/ipv4/route", ipv4_route_flush_table); + +- net->ipv4.route_hdr = register_net_sysctl(net, "net/ipv4/route", tbl); + if (net->ipv4.route_hdr == NULL) + goto err_reg; + return 0; + + err_reg: +- if (tbl != ipv4_route_flush_table) +- kfree(tbl); ++ kfree(tbl); + err_dup: + return -ENOMEM; } +@@ -2603,7 +2603,7 @@ static __net_initdata struct pernet_operations sysctl_route_ops = { - #ifdef CONFIG_PROC_FS -@@ -936,7 +936,7 @@ static void rt_cache_invalidate(struct net *net) - unsigned char shuffle; - - get_random_bytes(&shuffle, sizeof(shuffle)); -- atomic_add(shuffle + 1U, &net->ipv4.rt_genid); -+ atomic_add_unchecked(shuffle + 1U, &net->ipv4.rt_genid); - inetpeer_invalidate_tree(AF_INET); - } - -@@ -3009,7 +3009,7 @@ static int rt_fill_info(struct net *net, - error = rt->dst.error; - if (peer) { - inet_peer_refcheck(rt->peer); -- id = atomic_read(&peer->ip_id_count) & 0xffff; -+ id = atomic_read_unchecked(&peer->ip_id_count) & 0xffff; - if (peer->tcp_ts_stamp) { - ts = peer->tcp_ts; - tsage = get_seconds() - peer->tcp_ts_stamp; + static __net_init int rt_genid_init(struct net *net) + { +- atomic_set(&net->rt_genid, 0); ++ atomic_set_unchecked(&net->rt_genid, 0); + get_random_bytes(&net->ipv4.dev_addr_genid, + sizeof(net->ipv4.dev_addr_genid)); + return 0; +diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c +index 960fd29..d55bf64 100644 +--- a/net/ipv4/sysctl_net_ipv4.c ++++ b/net/ipv4/sysctl_net_ipv4.c +@@ -55,7 +55,7 @@ static int ipv4_local_port_range(ctl_table *table, int write, + { + int ret; + int range[2]; +- ctl_table tmp = { ++ ctl_table_no_const tmp = { + .data = &range, + .maxlen = sizeof(range), + .mode = table->mode, +@@ -108,7 +108,7 @@ static int ipv4_ping_group_range(ctl_table *table, int write, + int ret; + gid_t urange[2]; + kgid_t low, high; +- ctl_table tmp = { ++ ctl_table_no_const tmp = { + .data = &urange, + .maxlen = sizeof(urange), + .mode = table->mode, +@@ -139,7 +139,7 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { + char val[TCP_CA_NAME_MAX]; +- ctl_table tbl = { ++ ctl_table_no_const tbl = { + .data = val, + .maxlen = TCP_CA_NAME_MAX, + }; +@@ -158,7 +158,7 @@ static int proc_tcp_available_congestion_control(ctl_table *ctl, + void __user *buffer, size_t *lenp, + loff_t *ppos) + { +- ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX, }; ++ ctl_table_no_const tbl = { .maxlen = TCP_CA_BUF_MAX, }; + int ret; + + tbl.data = kmalloc(tbl.maxlen, GFP_USER); +@@ -175,7 +175,7 @@ static int proc_allowed_congestion_control(ctl_table *ctl, + void __user *buffer, size_t *lenp, + loff_t *ppos) + { +- ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX }; ++ ctl_table_no_const tbl = { .maxlen = TCP_CA_BUF_MAX }; + int ret; + + tbl.data = kmalloc(tbl.maxlen, GFP_USER); +@@ -201,15 +201,17 @@ static int ipv4_tcp_mem(ctl_table *ctl, int write, + struct mem_cgroup *memcg; + #endif + +- ctl_table tmp = { ++ ctl_table_no_const tmp = { + .data = &vec, + .maxlen = sizeof(vec), + .mode = ctl->mode, + }; + + if (!write) { +- ctl->data = &net->ipv4.sysctl_tcp_mem; +- return proc_doulongvec_minmax(ctl, write, buffer, lenp, ppos); ++ ctl_table_no_const tcp_mem = *ctl; ++ ++ tcp_mem.data = &net->ipv4.sysctl_tcp_mem; ++ return proc_doulongvec_minmax(&tcp_mem, write, buffer, lenp, ppos); + } + + ret = proc_doulongvec_minmax(&tmp, write, buffer, lenp, ppos); +@@ -236,7 +238,7 @@ static int ipv4_tcp_mem(ctl_table *ctl, int write, + static int proc_tcp_fastopen_key(ctl_table *ctl, int write, void __user *buffer, + size_t *lenp, loff_t *ppos) + { +- ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) }; ++ ctl_table_no_const tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) }; + struct tcp_fastopen_context *ctxt; + int ret; + u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */ +@@ -477,7 +479,7 @@ static struct ctl_table ipv4_table[] = { + }, + { + .procname = "ip_local_reserved_ports", +- .data = NULL, /* initialized in sysctl_ipv4_init */ ++ .data = sysctl_local_reserved_ports, + .maxlen = 65536, + .mode = 0644, + .proc_handler = proc_do_large_bitmap, +@@ -856,11 +858,10 @@ static struct ctl_table ipv4_net_table[] = { + + static __net_init int ipv4_sysctl_init_net(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table = NULL; + +- table = ipv4_net_table; + if (!net_eq(net, &init_net)) { +- table = kmemdup(table, sizeof(ipv4_net_table), GFP_KERNEL); ++ table = kmemdup(ipv4_net_table, sizeof(ipv4_net_table), GFP_KERNEL); + if (table == NULL) + goto err_alloc; + +@@ -895,15 +896,17 @@ static __net_init int ipv4_sysctl_init_net(struct net *net) + + tcp_init_mem(net); + +- net->ipv4.ipv4_hdr = register_net_sysctl(net, "net/ipv4", table); ++ if (!net_eq(net, &init_net)) ++ net->ipv4.ipv4_hdr = register_net_sysctl(net, "net/ipv4", table); ++ else ++ net->ipv4.ipv4_hdr = register_net_sysctl(net, "net/ipv4", ipv4_net_table); + if (net->ipv4.ipv4_hdr == NULL) + goto err_reg; + + return 0; + + err_reg: +- if (!net_eq(net, &init_net)) +- kfree(table); ++ kfree(table); + err_alloc: + return -ENOMEM; + } +@@ -925,16 +928,6 @@ static __net_initdata struct pernet_operations ipv4_sysctl_ops = { + static __init int sysctl_ipv4_init(void) + { + struct ctl_table_header *hdr; +- struct ctl_table *i; +- +- for (i = ipv4_table; i->procname; i++) { +- if (strcmp(i->procname, "ip_local_reserved_ports") == 0) { +- i->data = sysctl_local_reserved_ports; +- break; +- } +- } +- if (!i->procname) +- return -EINVAL; + + hdr = register_net_sysctl(&init_net, "net/ipv4", ipv4_table); + if (hdr == NULL) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index 56a9c8d..82e01c0 100644 +index 13b9c08..d33a8d0 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4726,7 +4726,7 @@ static struct sk_buff *tcp_collapse_one(struct sock *sk, struct sk_buff *skb, +@@ -4724,7 +4724,7 @@ static struct sk_buff *tcp_collapse_one(struct sock *sk, struct sk_buff *skb, * simplifies code) */ static void @@ -75898,8 +86427,33 @@ index 56a9c8d..82e01c0 100644 struct sk_buff *head, struct sk_buff *tail, u32 start, u32 end) { +@@ -5838,6 +5838,7 @@ discard: + tcp_paws_reject(&tp->rx_opt, 0)) + goto discard_and_undo; + ++#ifndef CONFIG_GRKERNSEC_NO_SIMULT_CONNECT + if (th->syn) { + /* We see SYN without ACK. It is attempt of + * simultaneous connect with crossed SYNs. +@@ -5888,6 +5889,7 @@ discard: + goto discard; + #endif + } ++#endif + /* "fifth, if neither of the SYN or RST bits is set then + * drop the segment and return." + */ +@@ -5932,7 +5934,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, + goto discard; + + if (th->syn) { +- if (th->fin) ++ if (th->fin || th->urg || th->psh) + goto discard; + if (icsk->icsk_af_ops->conn_request(sk, skb) < 0) + return 1; diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index 0cb86ce..8e7fda8 100644 +index d09203c..fd5cc91 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -90,6 +90,10 @@ int sysctl_tcp_low_latency __read_mostly; @@ -75913,7 +86467,7 @@ index 0cb86ce..8e7fda8 100644 #ifdef CONFIG_TCP_MD5SIG static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key, __be32 daddr, __be32 saddr, const struct tcphdr *th); -@@ -1641,6 +1645,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) +@@ -1897,6 +1901,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) return 0; reset: @@ -75923,7 +86477,7 @@ index 0cb86ce..8e7fda8 100644 tcp_v4_send_reset(rsk, skb); discard: kfree_skb(skb); -@@ -1703,12 +1710,19 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -1996,12 +2003,19 @@ int tcp_v4_rcv(struct sk_buff *skb) TCP_SKB_CB(skb)->sacked = 0; sk = __inet_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); @@ -75946,7 +86500,7 @@ index 0cb86ce..8e7fda8 100644 if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) { NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); -@@ -1758,6 +1772,10 @@ no_tcp_socket: +@@ -2052,6 +2066,10 @@ no_tcp_socket: bad_packet: TCP_INC_STATS_BH(net, TCP_MIB_INERRS); } else { @@ -75957,49 +86511,8 @@ index 0cb86ce..8e7fda8 100644 tcp_v4_send_reset(NULL, skb); } -@@ -2419,7 +2437,11 @@ static void get_openreq4(const struct sock *sk, const struct request_sock *req, - 0, /* non standard timer */ - 0, /* open_requests have no inode */ - atomic_read(&sk->sk_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else - req, -+#endif - len); - } - -@@ -2469,7 +2491,12 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len) - sock_i_uid(sk), - icsk->icsk_probes_out, - sock_i_ino(sk), -- atomic_read(&sk->sk_refcnt), sk, -+ atomic_read(&sk->sk_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else -+ sk, -+#endif - jiffies_to_clock_t(icsk->icsk_rto), - jiffies_to_clock_t(icsk->icsk_ack.ato), - (icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong, -@@ -2497,7 +2524,13 @@ static void get_timewait4_sock(const struct inet_timewait_sock *tw, - " %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %pK%n", - i, src, srcp, dest, destp, tw->tw_substate, 0, 0, - 3, jiffies_to_clock_t(ttd), 0, 0, 0, 0, -- atomic_read(&tw->tw_refcnt), tw, len); -+ atomic_read(&tw->tw_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else -+ tw, -+#endif -+ len); - } - - #define TMPSZ 150 diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c -index 3cabafb..640525b 100644 +index 2f672e7..b8895e9 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -27,6 +27,10 @@ @@ -76013,19 +86526,20 @@ index 3cabafb..640525b 100644 int sysctl_tcp_syncookies __read_mostly = 1; EXPORT_SYMBOL(sysctl_tcp_syncookies); -@@ -753,6 +757,10 @@ listen_overflow: - - embryonic_reset: - NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_EMBRYONICRSTS); -+ +@@ -749,7 +753,10 @@ embryonic_reset: + * avoid becoming vulnerable to outside attack aiming at + * resetting legit local connections. + */ +- req->rsk_ops->send_reset(sk, skb); +#ifdef CONFIG_GRKERNSEC_BLACKHOLE -+ if (!grsec_enable_blackhole) ++ if (!grsec_enable_blackhole) +#endif - if (!(flg & TCP_FLAG_RST)) - req->rsk_ops->send_reset(sk, skb); - ++ req->rsk_ops->send_reset(sk, skb); + } else if (fastopen) { /* received a valid RST pkt */ + reqsk_fastopen_remove(sk, req, true); + tcp_reset(sk); diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c -index a981cdc..48f4c3a 100644 +index d4943f6..e7a74a5 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c @@ -204,7 +204,7 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf, @@ -76038,7 +86552,7 @@ index a981cdc..48f4c3a 100644 cnt += width; } diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c -index 34d4a02..3b57f86 100644 +index b78aac3..e18230b 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -22,6 +22,10 @@ @@ -76052,7 +86566,7 @@ index 34d4a02..3b57f86 100644 int sysctl_tcp_syn_retries __read_mostly = TCP_SYN_RETRIES; int sysctl_tcp_synack_retries __read_mostly = TCP_SYNACK_RETRIES; int sysctl_tcp_keepalive_time __read_mostly = TCP_KEEPALIVE_TIME; -@@ -196,6 +200,13 @@ static int tcp_write_timeout(struct sock *sk) +@@ -185,6 +189,13 @@ static int tcp_write_timeout(struct sock *sk) } } @@ -76067,7 +86581,7 @@ index 34d4a02..3b57f86 100644 syn_set ? 0 : icsk->icsk_user_timeout, syn_set)) { /* Has it gone just too far? */ diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c -index fe14105..0618260 100644 +index 0a073a2..ddf6279 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -87,6 +87,7 @@ @@ -76078,8 +86592,8 @@ index fe14105..0618260 100644 #include <linux/socket.h> #include <linux/sockios.h> #include <linux/igmp.h> -@@ -109,6 +110,10 @@ - #include <trace/events/udp.h> +@@ -111,6 +112,10 @@ + #include <trace/events/skb.h> #include "udp_impl.h" +#ifdef CONFIG_GRKERNSEC_BLACKHOLE @@ -76089,7 +86603,7 @@ index fe14105..0618260 100644 struct udp_table udp_table __read_mostly; EXPORT_SYMBOL(udp_table); -@@ -567,6 +572,9 @@ found: +@@ -594,6 +599,9 @@ found: return s; } @@ -76099,7 +86613,7 @@ index fe14105..0618260 100644 /* * This routine is called by the ICMP module when it gets some * sort of error condition. If err < 0 then the socket should -@@ -858,9 +866,18 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, +@@ -889,9 +897,18 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, dport = usin->sin_port; if (dport == 0) return -EINVAL; @@ -76118,7 +86632,7 @@ index fe14105..0618260 100644 daddr = inet->inet_daddr; dport = inet->inet_dport; /* Open fast path for connected socket. -@@ -1102,7 +1119,7 @@ static unsigned int first_packet_length(struct sock *sk) +@@ -1133,7 +1150,7 @@ static unsigned int first_packet_length(struct sock *sk) udp_lib_checksum_complete(skb)) { UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, IS_UDPLITE(sk)); @@ -76127,7 +86641,7 @@ index fe14105..0618260 100644 __skb_unlink(skb, rcvq); __skb_queue_tail(&list_kill, skb); } -@@ -1188,6 +1205,10 @@ try_again: +@@ -1219,6 +1236,10 @@ try_again: if (!skb) goto out; @@ -76138,7 +86652,16 @@ index fe14105..0618260 100644 ulen = skb->len - sizeof(struct udphdr); copied = len; if (copied > ulen) -@@ -1489,7 +1510,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) +@@ -1252,7 +1273,7 @@ try_again: + if (unlikely(err)) { + trace_kfree_skb(skb, udp_recvmsg); + if (!peeked) { +- atomic_inc(&sk->sk_drops); ++ atomic_inc_unchecked(&sk->sk_drops); + UDP_INC_STATS_USER(sock_net(sk), + UDP_MIB_INERRORS, is_udplite); + } +@@ -1535,7 +1556,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) drop: UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); @@ -76147,7 +86670,7 @@ index fe14105..0618260 100644 kfree_skb(skb); return -1; } -@@ -1508,7 +1529,7 @@ static void flush_stack(struct sock **stack, unsigned int count, +@@ -1554,7 +1575,7 @@ static void flush_stack(struct sock **stack, unsigned int count, skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC); if (!skb1) { @@ -76156,7 +86679,7 @@ index fe14105..0618260 100644 UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk)); UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, -@@ -1677,6 +1698,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, +@@ -1723,6 +1744,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, goto csum_error; UDP_INC_STATS_BH(net, UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE); @@ -76166,27 +86689,59 @@ index fe14105..0618260 100644 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); /* -@@ -2094,8 +2118,13 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f, - sk_wmem_alloc_get(sp), - sk_rmem_alloc_get(sp), - 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), -- atomic_read(&sp->sk_refcnt), sp, +@@ -2152,7 +2176,7 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f, + from_kuid_munged(seq_user_ns(f), sock_i_uid(sp)), + 0, sock_i_ino(sp), + atomic_read(&sp->sk_refcnt), sp, - atomic_read(&sp->sk_drops), len); -+ atomic_read(&sp->sk_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else -+ sp, -+#endif + atomic_read_unchecked(&sp->sk_drops), len); } int udp4_seq_show(struct seq_file *seq, void *v) +diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c +index 9a459be..086b866 100644 +--- a/net/ipv4/xfrm4_policy.c ++++ b/net/ipv4/xfrm4_policy.c +@@ -264,19 +264,18 @@ static struct ctl_table xfrm4_policy_table[] = { + + static int __net_init xfrm4_net_init(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table = NULL; + struct ctl_table_header *hdr; + +- table = xfrm4_policy_table; + if (!net_eq(net, &init_net)) { +- table = kmemdup(table, sizeof(xfrm4_policy_table), GFP_KERNEL); ++ table = kmemdup(xfrm4_policy_table, sizeof(xfrm4_policy_table), GFP_KERNEL); + if (!table) + goto err_alloc; + + table[0].data = &net->xfrm.xfrm4_dst_ops.gc_thresh; +- } +- +- hdr = register_net_sysctl(net, "net/ipv4", table); ++ hdr = register_net_sysctl(net, "net/ipv4", table); ++ } else ++ hdr = register_net_sysctl(net, "net/ipv4", xfrm4_policy_table); + if (!hdr) + goto err_reg; + +@@ -284,8 +283,7 @@ static int __net_init xfrm4_net_init(struct net *net) + return 0; + + err_reg: +- if (!net_eq(net, &init_net)) +- kfree(table); ++ kfree(table); + err_alloc: + return -ENOMEM; + } diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c -index 7d5cb97..c56564f 100644 +index dae802c..bfa4baa 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c -@@ -2142,7 +2142,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg) +@@ -2274,7 +2274,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg) p.iph.ihl = 5; p.iph.protocol = IPPROTO_IPV6; p.iph.ttl = 64; @@ -76195,33 +86750,104 @@ index 7d5cb97..c56564f 100644 if (ops->ndo_do_ioctl) { mm_segment_t oldfs = get_fs(); -diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c -index 02dd203..e03fcc9 100644 ---- a/net/ipv6/inet6_connection_sock.c -+++ b/net/ipv6/inet6_connection_sock.c -@@ -178,7 +178,7 @@ void __inet6_csk_dst_store(struct sock *sk, struct dst_entry *dst, - #ifdef CONFIG_XFRM - { - struct rt6_info *rt = (struct rt6_info *)dst; -- rt->rt6i_flow_cache_genid = atomic_read(&flow_cache_genid); -+ rt->rt6i_flow_cache_genid = atomic_read_unchecked(&flow_cache_genid); - } - #endif +@@ -4410,7 +4410,7 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, + int *valp = ctl->data; + int val = *valp; + loff_t pos = *ppos; +- ctl_table lctl; ++ ctl_table_no_const lctl; + int ret; + + /* +@@ -4492,7 +4492,7 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write, + int *valp = ctl->data; + int val = *valp; + loff_t pos = *ppos; +- ctl_table lctl; ++ ctl_table_no_const lctl; + int ret; + + /* +diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c +index fff5bdd..15194fb 100644 +--- a/net/ipv6/icmp.c ++++ b/net/ipv6/icmp.c +@@ -973,7 +973,7 @@ ctl_table ipv6_icmp_table_template[] = { + + struct ctl_table * __net_init ipv6_icmp_sysctl_init(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(ipv6_icmp_table_template, + sizeof(ipv6_icmp_table_template), +diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c +index 95d13c7..791fe2f 100644 +--- a/net/ipv6/ip6_gre.c ++++ b/net/ipv6/ip6_gre.c +@@ -73,7 +73,7 @@ struct ip6gre_net { + struct net_device *fb_tunnel_dev; + }; + +-static struct rtnl_link_ops ip6gre_link_ops __read_mostly; ++static struct rtnl_link_ops ip6gre_link_ops; + static int ip6gre_tunnel_init(struct net_device *dev); + static void ip6gre_tunnel_setup(struct net_device *dev); + static void ip6gre_tunnel_link(struct ip6gre_net *ign, struct ip6_tnl *t); +@@ -1337,7 +1337,7 @@ static void ip6gre_fb_tunnel_init(struct net_device *dev) } -@@ -193,7 +193,7 @@ struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie) - #ifdef CONFIG_XFRM - if (dst) { - struct rt6_info *rt = (struct rt6_info *)dst; -- if (rt->rt6i_flow_cache_genid != atomic_read(&flow_cache_genid)) { -+ if (rt->rt6i_flow_cache_genid != atomic_read_unchecked(&flow_cache_genid)) { - __sk_dst_reset(sk); - dst = NULL; - } + + +-static struct inet6_protocol ip6gre_protocol __read_mostly = { ++static struct inet6_protocol ip6gre_protocol = { + .handler = ip6gre_rcv, + .err_handler = ip6gre_err, + .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, +@@ -1671,7 +1671,7 @@ static const struct nla_policy ip6gre_policy[IFLA_GRE_MAX + 1] = { + [IFLA_GRE_FLAGS] = { .type = NLA_U32 }, + }; + +-static struct rtnl_link_ops ip6gre_link_ops __read_mostly = { ++static struct rtnl_link_ops ip6gre_link_ops = { + .kind = "ip6gre", + .maxtype = IFLA_GRE_MAX, + .policy = ip6gre_policy, +@@ -1684,7 +1684,7 @@ static struct rtnl_link_ops ip6gre_link_ops __read_mostly = { + .fill_info = ip6gre_fill_info, + }; + +-static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = { ++static struct rtnl_link_ops ip6gre_tap_ops = { + .kind = "ip6gretap", + .maxtype = IFLA_GRE_MAX, + .policy = ip6gre_policy, +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c +index fff83cb..82d49dd 100644 +--- a/net/ipv6/ip6_tunnel.c ++++ b/net/ipv6/ip6_tunnel.c +@@ -87,7 +87,7 @@ static u32 HASH(const struct in6_addr *addr1, const struct in6_addr *addr2) + + static int ip6_tnl_dev_init(struct net_device *dev); + static void ip6_tnl_dev_setup(struct net_device *dev); +-static struct rtnl_link_ops ip6_link_ops __read_mostly; ++static struct rtnl_link_ops ip6_link_ops; + + static int ip6_tnl_net_id __read_mostly; + struct ip6_tnl_net { +@@ -1684,7 +1684,7 @@ static const struct nla_policy ip6_tnl_policy[IFLA_IPTUN_MAX + 1] = { + [IFLA_IPTUN_PROTO] = { .type = NLA_U8 }, + }; + +-static struct rtnl_link_ops ip6_link_ops __read_mostly = { ++static struct rtnl_link_ops ip6_link_ops = { + .kind = "ip6tnl", + .maxtype = IFLA_IPTUN_MAX, + .policy = ip6_tnl_policy, diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c -index 63dd1f8..e7f53ca 100644 +index d1e2e8e..51c19ae 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c -@@ -990,7 +990,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, +@@ -991,7 +991,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, if (sk->sk_type != SOCK_STREAM) return -ENOPROTOOPT; @@ -76230,11 +86856,102 @@ index 63dd1f8..e7f53ca 100644 msg.msg_controllen = len; msg.msg_flags = flags; +diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c +index 341b54a..591e8ed 100644 +--- a/net/ipv6/netfilter/ip6_tables.c ++++ b/net/ipv6/netfilter/ip6_tables.c +@@ -1076,14 +1076,14 @@ static int compat_table_info(const struct xt_table_info *info, + #endif + + static int get_info(struct net *net, void __user *user, +- const int *len, int compat) ++ int len, int compat) + { + char name[XT_TABLE_MAXNAMELEN]; + struct xt_table *t; + int ret; + +- if (*len != sizeof(struct ip6t_getinfo)) { +- duprintf("length %u != %zu\n", *len, ++ if (len != sizeof(struct ip6t_getinfo)) { ++ duprintf("length %u != %zu\n", len, + sizeof(struct ip6t_getinfo)); + return -EINVAL; + } +@@ -1120,7 +1120,7 @@ static int get_info(struct net *net, void __user *user, + info.size = private->size; + strcpy(info.name, name); + +- if (copy_to_user(user, &info, *len) != 0) ++ if (copy_to_user(user, &info, len) != 0) + ret = -EFAULT; + else + ret = 0; +@@ -1974,7 +1974,7 @@ compat_do_ip6t_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) + + switch (cmd) { + case IP6T_SO_GET_INFO: +- ret = get_info(sock_net(sk), user, len, 1); ++ ret = get_info(sock_net(sk), user, *len, 1); + break; + case IP6T_SO_GET_ENTRIES: + ret = compat_get_entries(sock_net(sk), user, len); +@@ -2021,7 +2021,7 @@ do_ip6t_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) + + switch (cmd) { + case IP6T_SO_GET_INFO: +- ret = get_info(sock_net(sk), user, len, 0); ++ ret = get_info(sock_net(sk), user, *len, 0); + break; + + case IP6T_SO_GET_ENTRIES: +diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c +index 6700069..1e50f42 100644 +--- a/net/ipv6/netfilter/nf_conntrack_reasm.c ++++ b/net/ipv6/netfilter/nf_conntrack_reasm.c +@@ -89,12 +89,11 @@ static struct ctl_table nf_ct_frag6_sysctl_table[] = { + + static int nf_ct_frag6_sysctl_register(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table = NULL; + struct ctl_table_header *hdr; + +- table = nf_ct_frag6_sysctl_table; + if (!net_eq(net, &init_net)) { +- table = kmemdup(table, sizeof(nf_ct_frag6_sysctl_table), ++ table = kmemdup(nf_ct_frag6_sysctl_table, sizeof(nf_ct_frag6_sysctl_table), + GFP_KERNEL); + if (table == NULL) + goto err_alloc; +@@ -102,9 +101,9 @@ static int nf_ct_frag6_sysctl_register(struct net *net) + table[0].data = &net->nf_frag.frags.timeout; + table[1].data = &net->nf_frag.frags.low_thresh; + table[2].data = &net->nf_frag.frags.high_thresh; +- } +- +- hdr = register_net_sysctl(net, "net/netfilter", table); ++ hdr = register_net_sysctl(net, "net/netfilter", table); ++ } else ++ hdr = register_net_sysctl(net, "net/netfilter", nf_ct_frag6_sysctl_table); + if (hdr == NULL) + goto err_reg; + +@@ -112,8 +111,7 @@ static int nf_ct_frag6_sysctl_register(struct net *net) + return 0; + + err_reg: +- if (!net_eq(net, &init_net)) +- kfree(table); ++ kfree(table); + err_alloc: + return -ENOMEM; + } diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c -index 5bddea7..82d9d67 100644 +index 330b5e7..796fbf1 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c -@@ -377,7 +377,7 @@ static inline int rawv6_rcv_skb(struct sock *sk, struct sk_buff *skb) +@@ -378,7 +378,7 @@ static inline int rawv6_rcv_skb(struct sock *sk, struct sk_buff *skb) { if ((raw6_sk(sk)->checksum || rcu_access_pointer(sk->sk_filter)) && skb_checksum_complete(skb)) { @@ -76243,7 +86960,7 @@ index 5bddea7..82d9d67 100644 kfree_skb(skb); return NET_RX_DROP; } -@@ -405,7 +405,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) +@@ -406,7 +406,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) struct raw6_sock *rp = raw6_sk(sk); if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) { @@ -76252,7 +86969,7 @@ index 5bddea7..82d9d67 100644 kfree_skb(skb); return NET_RX_DROP; } -@@ -429,7 +429,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) +@@ -430,7 +430,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) if (inet->hdrincl) { if (skb_checksum_complete(skb)) { @@ -76261,7 +86978,7 @@ index 5bddea7..82d9d67 100644 kfree_skb(skb); return NET_RX_DROP; } -@@ -602,7 +602,7 @@ out: +@@ -603,7 +603,7 @@ out: return err; } @@ -76270,7 +86987,7 @@ index 5bddea7..82d9d67 100644 struct flowi6 *fl6, struct dst_entry **dstp, unsigned int flags) { -@@ -914,12 +914,15 @@ do_confirm: +@@ -915,12 +915,15 @@ do_confirm: static int rawv6_seticmpfilter(struct sock *sk, int level, int optname, char __user *optval, int optlen) { @@ -76287,7 +87004,7 @@ index 5bddea7..82d9d67 100644 return 0; default: return -ENOPROTOOPT; -@@ -932,6 +935,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname, +@@ -933,6 +936,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { int len; @@ -76295,7 +87012,7 @@ index 5bddea7..82d9d67 100644 switch (optname) { case ICMPV6_FILTER: -@@ -943,7 +947,8 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname, +@@ -944,7 +948,8 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname, len = sizeof(struct icmp6_filter); if (put_user(len, optlen)) return -EFAULT; @@ -76305,28 +87022,112 @@ index 5bddea7..82d9d67 100644 return -EFAULT; return 0; default: -@@ -1250,7 +1255,13 @@ static void raw6_sock_seq_show(struct seq_file *seq, struct sock *sp, int i) - 0, 0L, 0, - sock_i_uid(sp), 0, +@@ -1252,7 +1257,7 @@ static void raw6_sock_seq_show(struct seq_file *seq, struct sock *sp, int i) + from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)), + 0, sock_i_ino(sp), - atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops)); -+ atomic_read(&sp->sk_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else -+ sp, -+#endif -+ atomic_read_unchecked(&sp->sk_drops)); ++ atomic_read(&sp->sk_refcnt), sp, atomic_read_unchecked(&sp->sk_drops)); } static int raw6_seq_show(struct seq_file *seq, void *v) +diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c +index 0ba10e5..c14a4f6 100644 +--- a/net/ipv6/reassembly.c ++++ b/net/ipv6/reassembly.c +@@ -602,12 +602,11 @@ static struct ctl_table ip6_frags_ctl_table[] = { + + static int __net_init ip6_frags_ns_sysctl_register(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table = NULL; + struct ctl_table_header *hdr; + +- table = ip6_frags_ns_ctl_table; + if (!net_eq(net, &init_net)) { +- table = kmemdup(table, sizeof(ip6_frags_ns_ctl_table), GFP_KERNEL); ++ table = kmemdup(ip6_frags_ns_ctl_table, sizeof(ip6_frags_ns_ctl_table), GFP_KERNEL); + if (table == NULL) + goto err_alloc; + +@@ -618,9 +617,10 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net) + /* Don't export sysctls to unprivileged users */ + if (net->user_ns != &init_user_ns) + table[0].procname = NULL; +- } ++ hdr = register_net_sysctl(net, "net/ipv6", table); ++ } else ++ hdr = register_net_sysctl(net, "net/ipv6", ip6_frags_ns_ctl_table); + +- hdr = register_net_sysctl(net, "net/ipv6", table); + if (hdr == NULL) + goto err_reg; + +@@ -628,8 +628,7 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net) + return 0; + + err_reg: +- if (!net_eq(net, &init_net)) +- kfree(table); ++ kfree(table); + err_alloc: + return -ENOMEM; + } +diff --git a/net/ipv6/route.c b/net/ipv6/route.c +index e5fe004..9fe3e8e 100644 +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -2881,7 +2881,7 @@ ctl_table ipv6_route_table_template[] = { + + struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(ipv6_route_table_template, + sizeof(ipv6_route_table_template), +diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c +index 02f96dc..4a5a6e5 100644 +--- a/net/ipv6/sit.c ++++ b/net/ipv6/sit.c +@@ -74,7 +74,7 @@ static void ipip6_tunnel_setup(struct net_device *dev); + static void ipip6_dev_free(struct net_device *dev); + static bool check_6rd(struct ip_tunnel *tunnel, const struct in6_addr *v6dst, + __be32 *v4dst); +-static struct rtnl_link_ops sit_link_ops __read_mostly; ++static struct rtnl_link_ops sit_link_ops; + + static int sit_net_id __read_mostly; + struct sit_net { +@@ -1486,7 +1486,7 @@ static const struct nla_policy ipip6_policy[IFLA_IPTUN_MAX + 1] = { + #endif + }; + +-static struct rtnl_link_ops sit_link_ops __read_mostly = { ++static struct rtnl_link_ops sit_link_ops = { + .kind = "sit", + .maxtype = IFLA_IPTUN_MAX, + .policy = ipip6_policy, +diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c +index e85c48b..b8268d3 100644 +--- a/net/ipv6/sysctl_net_ipv6.c ++++ b/net/ipv6/sysctl_net_ipv6.c +@@ -40,7 +40,7 @@ static ctl_table ipv6_rotable[] = { + + static int __net_init ipv6_sysctl_net_init(struct net *net) + { +- struct ctl_table *ipv6_table; ++ ctl_table_no_const *ipv6_table; + struct ctl_table *ipv6_route_table; + struct ctl_table *ipv6_icmp_table; + int err; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c -index 98256cf..7f16dbd 100644 +index 0fce928..c52a518 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c -@@ -94,6 +94,10 @@ static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(struct sock *sk, +@@ -103,6 +103,10 @@ static void inet6_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb) + inet6_sk(sk)->rx_dst_cookie = rt->rt6i_node->fn_sernum; } - #endif +#ifdef CONFIG_GRKERNSEC_BLACKHOLE +extern int grsec_enable_blackhole; @@ -76335,7 +87136,7 @@ index 98256cf..7f16dbd 100644 static void tcp_v6_hash(struct sock *sk) { if (sk->sk_state != TCP_CLOSE) { -@@ -1542,6 +1546,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) +@@ -1446,6 +1450,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) return 0; reset: @@ -76345,7 +87146,7 @@ index 98256cf..7f16dbd 100644 tcp_v6_send_reset(sk, skb); discard: if (opt_skb) -@@ -1623,12 +1630,20 @@ static int tcp_v6_rcv(struct sk_buff *skb) +@@ -1527,12 +1534,20 @@ static int tcp_v6_rcv(struct sk_buff *skb) TCP_SKB_CB(skb)->sacked = 0; sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); @@ -76368,7 +87169,7 @@ index 98256cf..7f16dbd 100644 if (hdr->hop_limit < inet6_sk(sk)->min_hopcount) { NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); -@@ -1676,6 +1691,10 @@ no_tcp_socket: +@@ -1581,6 +1596,10 @@ no_tcp_socket: bad_packet: TCP_INC_STATS_BH(net, TCP_MIB_INERRS); } else { @@ -76379,56 +87180,12 @@ index 98256cf..7f16dbd 100644 tcp_v6_send_reset(NULL, skb); } -@@ -1930,7 +1949,13 @@ static void get_openreq6(struct seq_file *seq, - uid, - 0, /* non standard timer */ - 0, /* open_requests have no inode */ -- 0, req); -+ 0, -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL -+#else -+ req -+#endif -+ ); - } - - static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) -@@ -1980,7 +2005,12 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) - sock_i_uid(sp), - icsk->icsk_probes_out, - sock_i_ino(sp), -- atomic_read(&sp->sk_refcnt), sp, -+ atomic_read(&sp->sk_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else -+ sp, -+#endif - jiffies_to_clock_t(icsk->icsk_rto), - jiffies_to_clock_t(icsk->icsk_ack.ato), - (icsk->icsk_ack.quick << 1 ) | icsk->icsk_ack.pingpong, -@@ -2015,7 +2045,13 @@ static void get_timewait6_sock(struct seq_file *seq, - dest->s6_addr32[2], dest->s6_addr32[3], destp, - tw->tw_substate, 0, 0, - 3, jiffies_to_clock_t(ttd), 0, 0, 0, 0, -- atomic_read(&tw->tw_refcnt), tw); -+ atomic_read(&tw->tw_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL -+#else -+ tw -+#endif -+ ); - } - - static int tcp6_seq_show(struct seq_file *seq, void *v) diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c -index 37b0699..d323408 100644 +index 27f0f8e..949e7ee 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c -@@ -50,6 +50,10 @@ - #include <linux/seq_file.h> +@@ -52,6 +52,10 @@ + #include <trace/events/skb.h> #include "udp_impl.h" +#ifdef CONFIG_GRKERNSEC_BLACKHOLE @@ -76438,190 +87195,171 @@ index 37b0699..d323408 100644 int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) { const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr; -@@ -551,7 +555,7 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) - - return 0; +@@ -419,7 +423,7 @@ try_again: + if (unlikely(err)) { + trace_kfree_skb(skb, udpv6_recvmsg); + if (!peeked) { +- atomic_inc(&sk->sk_drops); ++ atomic_inc_unchecked(&sk->sk_drops); + if (is_udp4) + UDP_INC_STATS_USER(sock_net(sk), + UDP_MIB_INERRORS, +@@ -657,7 +661,7 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) + return rc; drop: + UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); - atomic_inc(&sk->sk_drops); + atomic_inc_unchecked(&sk->sk_drops); - drop_no_sk_drops_inc: - UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); kfree_skb(skb); -@@ -627,7 +631,7 @@ static void flush_stack(struct sock **stack, unsigned int count, - continue; - } - drop: -- atomic_inc(&sk->sk_drops); -+ atomic_inc_unchecked(&sk->sk_drops); - UDP6_INC_STATS_BH(sock_net(sk), - UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk)); - UDP6_INC_STATS_BH(sock_net(sk), -@@ -782,6 +786,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, - UDP6_INC_STATS_BH(net, UDP_MIB_NOPORTS, - proto == IPPROTO_UDPLITE); + return -1; + } +@@ -715,7 +719,7 @@ static void flush_stack(struct sock **stack, unsigned int count, + if (likely(skb1 == NULL)) + skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC); + if (!skb1) { +- atomic_inc(&sk->sk_drops); ++ atomic_inc_unchecked(&sk->sk_drops); + UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS, + IS_UDPLITE(sk)); + UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, +@@ -852,6 +856,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, + goto discard; + UDP6_INC_STATS_BH(net, UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE); +#ifdef CONFIG_GRKERNSEC_BLACKHOLE -+ if (!grsec_enable_blackhole || (skb->dev->flags & IFF_LOOPBACK)) ++ if (!grsec_enable_blackhole || (skb->dev->flags & IFF_LOOPBACK)) +#endif - icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0); + icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0); - kfree_skb(skb); -@@ -798,7 +805,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, - if (!sock_owned_by_user(sk)) - udpv6_queue_rcv_skb(sk, skb); - else if (sk_add_backlog(sk, skb)) { -- atomic_inc(&sk->sk_drops); -+ atomic_inc_unchecked(&sk->sk_drops); - bh_unlock_sock(sk); - sock_put(sk); - goto discard; -@@ -1411,8 +1418,13 @@ static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket - 0, 0L, 0, - sock_i_uid(sp), 0, + kfree_skb(skb); +@@ -1377,7 +1384,7 @@ static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket + 0, sock_i_ino(sp), -- atomic_read(&sp->sk_refcnt), sp, + atomic_read(&sp->sk_refcnt), sp, - atomic_read(&sp->sk_drops)); -+ atomic_read(&sp->sk_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else -+ sp, -+#endif + atomic_read_unchecked(&sp->sk_drops)); } int udp6_seq_show(struct seq_file *seq, void *v) +diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c +index 23ed03d..465a71d 100644 +--- a/net/ipv6/xfrm6_policy.c ++++ b/net/ipv6/xfrm6_policy.c +@@ -324,19 +324,19 @@ static struct ctl_table xfrm6_policy_table[] = { + + static int __net_init xfrm6_net_init(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table = NULL; + struct ctl_table_header *hdr; + +- table = xfrm6_policy_table; + if (!net_eq(net, &init_net)) { +- table = kmemdup(table, sizeof(xfrm6_policy_table), GFP_KERNEL); ++ table = kmemdup(xfrm6_policy_table, sizeof(xfrm6_policy_table), GFP_KERNEL); + if (!table) + goto err_alloc; + + table[0].data = &net->xfrm.xfrm6_dst_ops.gc_thresh; +- } ++ hdr = register_net_sysctl(net, "net/ipv6", table); ++ } else ++ hdr = register_net_sysctl(net, "net/ipv6", xfrm6_policy_table); + +- hdr = register_net_sysctl(net, "net/ipv6", table); + if (!hdr) + goto err_reg; + +@@ -344,8 +344,7 @@ static int __net_init xfrm6_net_init(struct net *net) + return 0; + + err_reg: +- if (!net_eq(net, &init_net)) +- kfree(table); ++ kfree(table); + err_alloc: + return -ENOMEM; + } diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c -index 6b9d5a0..4dffaf1 100644 +index 362ba47..66196f4 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c -@@ -281,16 +281,16 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, - add_wait_queue(&self->open_wait, &wait); +@@ -319,11 +319,11 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, + add_wait_queue(&port->open_wait, &wait); IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n", -- __FILE__,__LINE__, tty->driver->name, self->open_count ); -+ __FILE__,__LINE__, tty->driver->name, local_read(&self->open_count) ); +- __FILE__, __LINE__, tty->driver->name, port->count); ++ __FILE__, __LINE__, tty->driver->name, atomic_read(&port->count)); - /* As far as I can see, we protect open_count - Jean II */ - spin_lock_irqsave(&self->spinlock, flags); - if (!tty_hung_up_p(filp)) { - extra_count = 1; -- self->open_count--; -+ local_dec(&self->open_count); - } - spin_unlock_irqrestore(&self->spinlock, flags); -- self->blocked_open++; -+ local_inc(&self->blocked_open); + spin_lock_irqsave(&port->lock, flags); + if (!tty_hung_up_p(filp)) +- port->count--; ++ atomic_dec(&port->count); + port->blocked_open++; + spin_unlock_irqrestore(&port->lock, flags); - while (1) { - if (tty->termios->c_cflag & CBAUD) { -@@ -330,7 +330,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, +@@ -358,7 +358,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, } IRDA_DEBUG(1, "%s(%d):block_til_ready blocking on %s open_count=%d\n", -- __FILE__,__LINE__, tty->driver->name, self->open_count ); -+ __FILE__,__LINE__, tty->driver->name, local_read(&self->open_count) ); +- __FILE__, __LINE__, tty->driver->name, port->count); ++ __FILE__, __LINE__, tty->driver->name, atomic_read(&port->count)); schedule(); } -@@ -341,13 +341,13 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, - if (extra_count) { - /* ++ is not atomic, so this should be protected - Jean II */ - spin_lock_irqsave(&self->spinlock, flags); -- self->open_count++; -+ local_inc(&self->open_count); - spin_unlock_irqrestore(&self->spinlock, flags); - } -- self->blocked_open--; -+ local_dec(&self->blocked_open); +@@ -368,12 +368,12 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, + + spin_lock_irqsave(&port->lock, flags); + if (!tty_hung_up_p(filp)) +- port->count++; ++ atomic_inc(&port->count); + port->blocked_open--; + spin_unlock_irqrestore(&port->lock, flags); IRDA_DEBUG(1, "%s(%d):block_til_ready after blocking on %s open_count=%d\n", -- __FILE__,__LINE__, tty->driver->name, self->open_count); -+ __FILE__,__LINE__, tty->driver->name, local_read(&self->open_count)); +- __FILE__, __LINE__, tty->driver->name, port->count); ++ __FILE__, __LINE__, tty->driver->name, atomic_read(&port->count)); if (!retval) - self->flags |= ASYNC_NORMAL_ACTIVE; -@@ -412,14 +412,14 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) - } - /* ++ is not atomic, so this should be protected - Jean II */ - spin_lock_irqsave(&self->spinlock, flags); -- self->open_count++; -+ local_inc(&self->open_count); + port->flags |= ASYNC_NORMAL_ACTIVE; +@@ -447,12 +447,12 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) - tty->driver_data = self; - self->tty = tty; - spin_unlock_irqrestore(&self->spinlock, flags); + /* ++ is not atomic, so this should be protected - Jean II */ + spin_lock_irqsave(&self->port.lock, flags); +- self->port.count++; ++ atomic_inc(&self->port.count); + spin_unlock_irqrestore(&self->port.lock, flags); + tty_port_tty_set(&self->port, tty); IRDA_DEBUG(1, "%s(), %s%d, count = %d\n", __func__ , tty->driver->name, -- self->line, self->open_count); -+ self->line, local_read(&self->open_count)); +- self->line, self->port.count); ++ self->line, atomic_read(&self->port.count)); /* Not really used by us, but lets do it anyway */ - self->tty->low_latency = (self->flags & ASYNC_LOW_LATENCY) ? 1 : 0; -@@ -505,7 +505,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) - return; + self->port.low_latency = (self->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; +@@ -989,7 +989,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty) + tty_kref_put(port->tty); } + port->tty = NULL; +- port->count = 0; ++ atomic_set(&port->count, 0); + spin_unlock_irqrestore(&port->lock, flags); -- if ((tty->count == 1) && (self->open_count != 1)) { -+ if ((tty->count == 1) && (local_read(&self->open_count) != 1)) { - /* - * Uh, oh. tty->count is 1, which means that the tty - * structure will be freed. state->count should always -@@ -515,16 +515,16 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) - */ - IRDA_DEBUG(0, "%s(), bad serial port count; " - "tty->count is 1, state->count is %d\n", __func__ , -- self->open_count); -- self->open_count = 1; -+ local_read(&self->open_count)); -+ local_set(&self->open_count, 1); - } - -- if (--self->open_count < 0) { -+ if (local_dec_return(&self->open_count) < 0) { - IRDA_ERROR("%s(), bad serial port count for ttys%d: %d\n", -- __func__, self->line, self->open_count); -- self->open_count = 0; -+ __func__, self->line, local_read(&self->open_count)); -+ local_set(&self->open_count, 0); - } -- if (self->open_count) { -+ if (local_read(&self->open_count)) { - spin_unlock_irqrestore(&self->spinlock, flags); - - IRDA_DEBUG(0, "%s(), open count > 0\n", __func__ ); -@@ -556,7 +556,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) - tty->closing = 0; - self->tty = NULL; - -- if (self->blocked_open) { -+ if (local_read(&self->blocked_open)) { - if (self->close_delay) - schedule_timeout_interruptible(self->close_delay); - wake_up_interruptible(&self->open_wait); -@@ -1008,7 +1008,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty) - spin_lock_irqsave(&self->spinlock, flags); - self->flags &= ~ASYNC_NORMAL_ACTIVE; - self->tty = NULL; -- self->open_count = 0; -+ local_set(&self->open_count, 0); - spin_unlock_irqrestore(&self->spinlock, flags); - - wake_up_interruptible(&self->open_wait); -@@ -1355,7 +1355,7 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m) + wake_up_interruptible(&port->open_wait); +@@ -1346,7 +1346,7 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m) seq_putc(m, '\n'); seq_printf(m, "Role: %s\n", self->client ? "client" : "server"); -- seq_printf(m, "Open count: %d\n", self->open_count); -+ seq_printf(m, "Open count: %d\n", local_read(&self->open_count)); +- seq_printf(m, "Open count: %d\n", self->port.count); ++ seq_printf(m, "Open count: %d\n", atomic_read(&self->port.count)); seq_printf(m, "Max data size: %d\n", self->max_data_size); seq_printf(m, "Max header size: %d\n", self->max_header_size); diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c -index cd6f7a9..e63fe89 100644 +index 206ce6d..cfb27cd 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c -@@ -782,10 +782,10 @@ static int iucv_sock_autobind(struct sock *sk) +@@ -773,10 +773,10 @@ static int iucv_sock_autobind(struct sock *sk) write_lock_bh(&iucv_sk_list.lock); @@ -76634,11 +87372,24 @@ index cd6f7a9..e63fe89 100644 } write_unlock_bh(&iucv_sk_list.lock); +diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c +index 4fe76ff..426a904 100644 +--- a/net/iucv/iucv.c ++++ b/net/iucv/iucv.c +@@ -690,7 +690,7 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self, + return NOTIFY_OK; + } + +-static struct notifier_block __refdata iucv_cpu_notifier = { ++static struct notifier_block iucv_cpu_notifier = { + .notifier_call = iucv_cpu_notify, + }; + diff --git a/net/key/af_key.c b/net/key/af_key.c -index 7e5d927..cdbb54e 100644 +index 5b1e5af..2358147 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c -@@ -3016,10 +3016,10 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struc +@@ -3041,10 +3041,10 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struc static u32 get_acqseq(void) { u32 res; @@ -76651,8 +87402,41 @@ index 7e5d927..cdbb54e 100644 } while (!res); return res; } +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index 843d8c4..cb04fa1 100644 +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -799,7 +799,7 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy, + ret = ieee80211_vif_use_channel(sdata, chandef, + IEEE80211_CHANCTX_EXCLUSIVE); + } +- } else if (local->open_count == local->monitors) { ++ } else if (local_read(&local->open_count) == local->monitors) { + local->_oper_channel = chandef->chan; + local->_oper_channel_type = cfg80211_get_chandef_type(chandef); + ieee80211_hw_config(local, 0); +@@ -2834,7 +2834,7 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy, + else + local->probe_req_reg--; + +- if (!local->open_count) ++ if (!local_read(&local->open_count)) + break; + + ieee80211_queue_work(&local->hw, &local->reconfig_filter); +@@ -3297,8 +3297,8 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy, + if (chanctx_conf) { + *chandef = chanctx_conf->def; + ret = 0; +- } else if (local->open_count > 0 && +- local->open_count == local->monitors && ++ } else if (local_read(&local->open_count) > 0 && ++ local_read(&local->open_count) == local->monitors && + sdata->vif.type == NL80211_IFTYPE_MONITOR) { + if (local->use_chanctx) + *chandef = local->monitor_chandef; diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h -index db8fae5..ff070cd 100644 +index 5672533..6738c93 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -28,6 +28,7 @@ @@ -76662,8 +87446,8 @@ index db8fae5..ff070cd 100644 +#include <asm/local.h> #include "key.h" #include "sta_info.h" - -@@ -842,7 +843,7 @@ struct ieee80211_local { + #include "debug.h" +@@ -897,7 +898,7 @@ struct ieee80211_local { /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */ spinlock_t queue_stop_reason_lock; @@ -76673,10 +87457,10 @@ index db8fae5..ff070cd 100644 /* number of interfaces with corresponding FIF_ flags */ int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll, diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c -index 48f937e..4ccd7b8 100644 +index d51ca9d..042c35f 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c -@@ -222,7 +222,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) +@@ -495,7 +495,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) break; } @@ -76685,17 +87469,17 @@ index 48f937e..4ccd7b8 100644 res = drv_start(local); if (res) goto err_del_bss; -@@ -246,7 +246,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) - memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN); - - if (!is_valid_ether_addr(dev->dev_addr)) { -- if (!local->open_count) -+ if (!local_read(&local->open_count)) - drv_stop(local); - return -EADDRNOTAVAIL; +@@ -540,7 +540,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) + break; } -@@ -347,7 +347,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) - mutex_unlock(&local->mtx); + +- if (local->monitors == 0 && local->open_count == 0) { ++ if (local->monitors == 0 && local_read(&local->open_count) == 0) { + res = ieee80211_add_virtual_monitor(local); + if (res) + goto err_stop; +@@ -649,7 +649,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) + atomic_inc(&local->iff_promiscs); if (coming_up) - local->open_count++; @@ -76703,7 +87487,7 @@ index 48f937e..4ccd7b8 100644 if (hw_reconf_flags) ieee80211_hw_config(local, hw_reconf_flags); -@@ -360,7 +360,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) +@@ -663,7 +663,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) err_del_interface: drv_remove_interface(local, sdata); err_stop: @@ -76712,7 +87496,7 @@ index 48f937e..4ccd7b8 100644 drv_stop(local); err_del_bss: sdata->bss = NULL; -@@ -491,7 +491,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, +@@ -806,7 +806,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, } if (going_down) @@ -76721,7 +87505,7 @@ index 48f937e..4ccd7b8 100644 switch (sdata->vif.type) { case NL80211_IFTYPE_AP_VLAN: -@@ -562,7 +562,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, +@@ -871,7 +871,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, ieee80211_recalc_ps(local, -1); @@ -76730,13 +87514,22 @@ index 48f937e..4ccd7b8 100644 if (local->ops->napi_poll) napi_disable(&local->napi); ieee80211_clear_tx_pending(local); +@@ -897,7 +897,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, + } + spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); + +- if (local->monitors == local->open_count && local->monitors > 0) ++ if (local->monitors == local_read(&local->open_count) && local->monitors > 0) + ieee80211_add_virtual_monitor(local); + } + diff --git a/net/mac80211/main.c b/net/mac80211/main.c -index 1633648..d45ebfa 100644 +index 1a8591b..ef5db54 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -164,7 +164,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) - local->hw.conf.power_level = power; - } +@@ -180,7 +180,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) + changed &= ~(IEEE80211_CONF_CHANGE_CHANNEL | + IEEE80211_CONF_CHANGE_POWER); - if (changed && local->open_count) { + if (changed && local_read(&local->open_count)) { @@ -76744,19 +87537,19 @@ index 1633648..d45ebfa 100644 /* * Goal: diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c -index ef8eba1..5c63952 100644 +index 835584c..be46e67 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c -@@ -34,7 +34,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) - struct ieee80211_sub_if_data *sdata; +@@ -33,7 +33,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) struct sta_info *sta; + struct ieee80211_chanctx *ctx; - if (!local->open_count) + if (!local_read(&local->open_count)) goto suspend; ieee80211_scan_cancel(local); -@@ -72,7 +72,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) +@@ -75,7 +75,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) cancel_work_sync(&local->dynamic_ps_enable_work); del_timer_sync(&local->dynamic_ps_timer); @@ -76765,8 +87558,8 @@ index ef8eba1..5c63952 100644 if (local->wowlan) { int err = drv_suspend(local, wowlan); if (err < 0) { -@@ -128,7 +128,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) - } +@@ -214,7 +214,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) + mutex_unlock(&local->chanctx_mtx); /* stop hardware - this must stop RX */ - if (local->open_count) @@ -76775,10 +87568,10 @@ index ef8eba1..5c63952 100644 suspend: diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c -index 3313c11..bec9f17 100644 +index dd88381..eef4dd6 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c -@@ -494,7 +494,7 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, +@@ -493,7 +493,7 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, ASSERT_RTNL(); @@ -76801,10 +87594,10 @@ index c97a065..ff61928 100644 return p; diff --git a/net/mac80211/util.c b/net/mac80211/util.c -index eb9d7c0..d34b832 100644 +index 0f38f43..e53d4a8 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -1179,7 +1179,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) +@@ -1388,7 +1388,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) } #endif /* everything else happens only if HW was up & running */ @@ -76814,10 +87607,10 @@ index eb9d7c0..d34b832 100644 /* diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig -index 0c6f67e..d02cdfc 100644 +index 56d22ca..87c778f 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -836,6 +836,16 @@ config NETFILTER_XT_MATCH_ESP +@@ -958,6 +958,16 @@ config NETFILTER_XT_MATCH_ESP To compile it as a module, choose M here. If unsure, say N. @@ -76835,10 +87628,10 @@ index 0c6f67e..d02cdfc 100644 tristate '"hashlimit" match support' depends on (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n) diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile -index ca36765..0882e7c 100644 +index a1abf87..dbcb7ee 100644 --- a/net/netfilter/Makefile +++ b/net/netfilter/Makefile -@@ -86,6 +86,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_DEVGROUP) += xt_devgroup.o +@@ -112,6 +112,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_DEVGROUP) += xt_devgroup.o obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o obj-$(CONFIG_NETFILTER_XT_MATCH_ECN) += xt_ecn.o obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o @@ -76846,11 +87639,24 @@ index ca36765..0882e7c 100644 obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o obj-$(CONFIG_NETFILTER_XT_MATCH_HL) += xt_hl.o +diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c +index 1ba9dbc..e39f4ca 100644 +--- a/net/netfilter/ipset/ip_set_core.c ++++ b/net/netfilter/ipset/ip_set_core.c +@@ -1801,7 +1801,7 @@ done: + return ret; + } + +-static struct nf_sockopt_ops so_set __read_mostly = { ++static struct nf_sockopt_ops so_set = { + .pf = PF_INET, + .get_optmin = SO_IP_SET, + .get_optmax = SO_IP_SET + 1, diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c -index 29fa5ba..8debc79 100644 +index 704e514..d644cc2 100644 --- a/net/netfilter/ipvs/ip_vs_conn.c +++ b/net/netfilter/ipvs/ip_vs_conn.c -@@ -556,7 +556,7 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest) +@@ -551,7 +551,7 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest) /* Increase the refcnt counter of the dest */ atomic_inc(&dest->refcnt); @@ -76858,8 +87664,8 @@ index 29fa5ba..8debc79 100644 + conn_flags = atomic_read_unchecked(&dest->conn_flags); if (cp->protocol != IPPROTO_UDP) conn_flags &= ~IP_VS_CONN_F_ONE_PACKET; - /* Bind with the destination and its corresponding transmitter */ -@@ -869,7 +869,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p, + flags = cp->flags; +@@ -895,7 +895,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p, atomic_set(&cp->refcnt, 1); atomic_set(&cp->n_control, 0); @@ -76868,7 +87674,7 @@ index 29fa5ba..8debc79 100644 atomic_inc(&ipvs->conn_count); if (flags & IP_VS_CONN_F_NO_CPORT) -@@ -1149,7 +1149,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp) +@@ -1174,7 +1174,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp) /* Don't drop the entry if its number of incoming packets is not located in [0, 8] */ @@ -76878,11 +87684,11 @@ index 29fa5ba..8debc79 100644 if (!todrop_rate[i]) return 0; diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c -index 00bdb1d..6725a48 100644 +index 61f49d2..6c8c5bc 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c -@@ -562,7 +562,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, - ret = cp->packet_xmit(skb, cp, pd->pp); +@@ -559,7 +559,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, + ret = cp->packet_xmit(skb, cp, pd->pp, iph); /* do not touch skb anymore */ - atomic_inc(&cp->in_pkts); @@ -76890,20 +87696,20 @@ index 00bdb1d..6725a48 100644 ip_vs_conn_put(cp); return ret; } -@@ -1611,7 +1611,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) +@@ -1689,7 +1689,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) if (cp->flags & IP_VS_CONN_F_ONE_PACKET) pkts = sysctl_sync_threshold(ipvs); else - pkts = atomic_add_return(1, &cp->in_pkts); + pkts = atomic_add_return_unchecked(1, &cp->in_pkts); - if ((ipvs->sync_state & IP_VS_STATE_MASTER) && - cp->protocol == IPPROTO_SCTP) { + if (ipvs->sync_state & IP_VS_STATE_MASTER) + ip_vs_sync_conn(net, cp, pkts); diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c -index f558998..7dfb054 100644 +index 9e2d1cc..7f8f569 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c -@@ -788,7 +788,7 @@ __ip_vs_update_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest, +@@ -787,7 +787,7 @@ __ip_vs_update_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest, ip_vs_rs_hash(ipvs, dest); write_unlock_bh(&ipvs->rs_lock); } @@ -76912,30 +87718,16 @@ index f558998..7dfb054 100644 /* bind the service */ if (!dest->svc) { -@@ -1521,11 +1521,12 @@ static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, - { - struct net_device *dev = ptr; - struct net *net = dev_net(dev); -+ struct netns_ipvs *ipvs = net_ipvs(net); - struct ip_vs_service *svc; - struct ip_vs_dest *dest; - unsigned int idx; - -- if (event != NETDEV_UNREGISTER) -+ if (event != NETDEV_UNREGISTER || !ipvs) - return NOTIFY_DONE; - IP_VS_DBG(3, "%s() dev=%s\n", __func__, dev->name); - EnterFunction(2); -@@ -1551,7 +1552,7 @@ static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, - } - } +@@ -1688,7 +1688,7 @@ proc_do_sync_ports(ctl_table *table, int write, + * align with netns init in ip_vs_control_net_init() + */ -- list_for_each_entry(dest, &net_ipvs(net)->dest_trash, n_list) { -+ list_for_each_entry(dest, &ipvs->dest_trash, n_list) { - __ip_vs_dev_reset(dest, dev); - } - mutex_unlock(&__ip_vs_mutex); -@@ -2028,7 +2029,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v) +-static struct ctl_table vs_vars[] = { ++static ctl_table_no_const vs_vars[] __read_only = { + { + .procname = "amemthresh", + .maxlen = sizeof(int), +@@ -2087,7 +2087,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v) " %-7s %-6d %-10d %-10d\n", &dest->addr.in6, ntohs(dest->port), @@ -76944,7 +87736,7 @@ index f558998..7dfb054 100644 atomic_read(&dest->weight), atomic_read(&dest->activeconns), atomic_read(&dest->inactconns)); -@@ -2039,7 +2040,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v) +@@ -2098,7 +2098,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v) "%-7s %-6d %-10d %-10d\n", ntohl(dest->addr.ip), ntohs(dest->port), @@ -76953,7 +87745,7 @@ index f558998..7dfb054 100644 atomic_read(&dest->weight), atomic_read(&dest->activeconns), atomic_read(&dest->inactconns)); -@@ -2509,7 +2510,7 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get, +@@ -2568,7 +2568,7 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get, entry.addr = dest->addr.ip; entry.port = dest->port; @@ -76962,29 +87754,73 @@ index f558998..7dfb054 100644 entry.weight = atomic_read(&dest->weight); entry.u_threshold = dest->u_threshold; entry.l_threshold = dest->l_threshold; -@@ -3042,7 +3043,7 @@ static int ip_vs_genl_fill_dest(struct sk_buff *skb, struct ip_vs_dest *dest) - NLA_PUT_U16(skb, IPVS_DEST_ATTR_PORT, dest->port); - - NLA_PUT_U32(skb, IPVS_DEST_ATTR_FWD_METHOD, -- atomic_read(&dest->conn_flags) & IP_VS_CONN_F_FWD_MASK); -+ atomic_read_unchecked(&dest->conn_flags) & IP_VS_CONN_F_FWD_MASK); - NLA_PUT_U32(skb, IPVS_DEST_ATTR_WEIGHT, atomic_read(&dest->weight)); - NLA_PUT_U32(skb, IPVS_DEST_ATTR_U_THRESH, dest->u_threshold); - NLA_PUT_U32(skb, IPVS_DEST_ATTR_L_THRESH, dest->l_threshold); +@@ -3104,7 +3104,7 @@ static int ip_vs_genl_fill_dest(struct sk_buff *skb, struct ip_vs_dest *dest) + if (nla_put(skb, IPVS_DEST_ATTR_ADDR, sizeof(dest->addr), &dest->addr) || + nla_put_u16(skb, IPVS_DEST_ATTR_PORT, dest->port) || + nla_put_u32(skb, IPVS_DEST_ATTR_FWD_METHOD, +- (atomic_read(&dest->conn_flags) & ++ (atomic_read_unchecked(&dest->conn_flags) & + IP_VS_CONN_F_FWD_MASK)) || + nla_put_u32(skb, IPVS_DEST_ATTR_WEIGHT, + atomic_read(&dest->weight)) || +@@ -3694,7 +3694,7 @@ static int __net_init ip_vs_control_net_init_sysctl(struct net *net) + { + int idx; + struct netns_ipvs *ipvs = net_ipvs(net); +- struct ctl_table *tbl; ++ ctl_table_no_const *tbl; + + atomic_set(&ipvs->dropentry, 0); + spin_lock_init(&ipvs->dropentry_lock); +diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c +index fdd89b9..bd96aa9 100644 +--- a/net/netfilter/ipvs/ip_vs_lblc.c ++++ b/net/netfilter/ipvs/ip_vs_lblc.c +@@ -115,7 +115,7 @@ struct ip_vs_lblc_table { + * IPVS LBLC sysctl table + */ + #ifdef CONFIG_SYSCTL +-static ctl_table vs_vars_table[] = { ++static ctl_table_no_const vs_vars_table[] __read_only = { + { + .procname = "lblc_expiration", + .data = NULL, +diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c +index c03b6a3..8ce3681 100644 +--- a/net/netfilter/ipvs/ip_vs_lblcr.c ++++ b/net/netfilter/ipvs/ip_vs_lblcr.c +@@ -288,7 +288,7 @@ struct ip_vs_lblcr_table { + * IPVS LBLCR sysctl table + */ + +-static ctl_table vs_vars_table[] = { ++static ctl_table_no_const vs_vars_table[] __read_only = { + { + .procname = "lblcr_expiration", + .data = NULL, diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c -index 8a0d6d6..90ec197 100644 +index 44fd10c..2a163b3 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c -@@ -649,7 +649,7 @@ control: - * i.e only increment in_pkts for Templates. - */ - if (cp->flags & IP_VS_CONN_F_TEMPLATE) { -- int pkts = atomic_add_return(1, &cp->in_pkts); -+ int pkts = atomic_add_return_unchecked(1, &cp->in_pkts); - - if (pkts % sysctl_sync_period(ipvs) != 1) - return; -@@ -795,7 +795,7 @@ static void ip_vs_proc_conn(struct net *net, struct ip_vs_conn_param *param, +@@ -596,7 +596,7 @@ static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp, + cp = cp->control; + if (cp) { + if (cp->flags & IP_VS_CONN_F_TEMPLATE) +- pkts = atomic_add_return(1, &cp->in_pkts); ++ pkts = atomic_add_return_unchecked(1, &cp->in_pkts); + else + pkts = sysctl_sync_threshold(ipvs); + ip_vs_sync_conn(net, cp->control, pkts); +@@ -758,7 +758,7 @@ control: + if (!cp) + return; + if (cp->flags & IP_VS_CONN_F_TEMPLATE) +- pkts = atomic_add_return(1, &cp->in_pkts); ++ pkts = atomic_add_return_unchecked(1, &cp->in_pkts); + else + pkts = sysctl_sync_threshold(ipvs); + goto sloop; +@@ -885,7 +885,7 @@ static void ip_vs_proc_conn(struct net *net, struct ip_vs_conn_param *param, if (opt) memcpy(&cp->in_seq, opt, sizeof(*opt)); @@ -76994,10 +87830,10 @@ index 8a0d6d6..90ec197 100644 cp->old_state = cp->state; /* diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c -index 7fd66de..e6fb361 100644 +index ee6b7a9..f9a89f6 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c -@@ -1151,7 +1151,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, +@@ -1210,7 +1210,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, else rc = NF_ACCEPT; /* do not touch skb anymore */ @@ -77006,7 +87842,7 @@ index 7fd66de..e6fb361 100644 goto out; } -@@ -1272,7 +1272,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, +@@ -1332,7 +1332,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, else rc = NF_ACCEPT; /* do not touch skb anymore */ @@ -77015,22 +87851,35 @@ index 7fd66de..e6fb361 100644 goto out; } +diff --git a/net/netfilter/nf_conntrack_acct.c b/net/netfilter/nf_conntrack_acct.c +index 2d3030a..7ba1c0a 100644 +--- a/net/netfilter/nf_conntrack_acct.c ++++ b/net/netfilter/nf_conntrack_acct.c +@@ -60,7 +60,7 @@ static struct nf_ct_ext_type acct_extend __read_mostly = { + #ifdef CONFIG_SYSCTL + static int nf_conntrack_acct_init_sysctl(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(acct_sysctl_table, sizeof(acct_sysctl_table), + GFP_KERNEL); diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c -index 729f157..ac0fa7b 100644 +index c8e001a..f842a8b 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -1538,6 +1538,10 @@ err_proto: - #define UNCONFIRMED_NULLS_VAL ((1<<30)+0) +@@ -1594,6 +1594,10 @@ void nf_conntrack_init_end(void) #define DYING_NULLS_VAL ((1<<30)+1) + #define TEMPLATE_NULLS_VAL ((1<<30)+2) +#ifdef CONFIG_GRKERNSEC_HIDESYM +static atomic_unchecked_t conntrack_cache_id = ATOMIC_INIT(0); +#endif + - static int nf_conntrack_init_net(struct net *net) + int nf_conntrack_init_net(struct net *net) { int ret; -@@ -1551,7 +1555,11 @@ static int nf_conntrack_init_net(struct net *net) +@@ -1608,7 +1612,11 @@ int nf_conntrack_init_net(struct net *net) goto err_stat; } @@ -77042,11 +87891,131 @@ index 729f157..ac0fa7b 100644 if (!net->ct.slabname) { ret = -ENOMEM; goto err_slabname; +diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c +index b5d2eb8..61ef19a 100644 +--- a/net/netfilter/nf_conntrack_ecache.c ++++ b/net/netfilter/nf_conntrack_ecache.c +@@ -186,7 +186,7 @@ static struct nf_ct_ext_type event_extend __read_mostly = { + #ifdef CONFIG_SYSCTL + static int nf_conntrack_event_init_sysctl(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(event_sysctl_table, sizeof(event_sysctl_table), + GFP_KERNEL); +diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c +index 94b4b98..97cf0ad 100644 +--- a/net/netfilter/nf_conntrack_helper.c ++++ b/net/netfilter/nf_conntrack_helper.c +@@ -56,7 +56,7 @@ static struct ctl_table helper_sysctl_table[] = { + + static int nf_conntrack_helper_init_sysctl(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(helper_sysctl_table, sizeof(helper_sysctl_table), + GFP_KERNEL); +diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c +index 58ab405..50eb8d3 100644 +--- a/net/netfilter/nf_conntrack_proto.c ++++ b/net/netfilter/nf_conntrack_proto.c +@@ -51,7 +51,7 @@ nf_ct_register_sysctl(struct net *net, + + static void + nf_ct_unregister_sysctl(struct ctl_table_header **header, +- struct ctl_table **table, ++ ctl_table_no_const **table, + unsigned int users) + { + if (users > 0) +diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c +index fedee39..d62a93d 100644 +--- a/net/netfilter/nf_conntrack_standalone.c ++++ b/net/netfilter/nf_conntrack_standalone.c +@@ -470,7 +470,7 @@ static ctl_table nf_ct_netfilter_table[] = { + + static int nf_conntrack_standalone_init_sysctl(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(nf_ct_sysctl_table, sizeof(nf_ct_sysctl_table), + GFP_KERNEL); +diff --git a/net/netfilter/nf_conntrack_timestamp.c b/net/netfilter/nf_conntrack_timestamp.c +index 902fb0a..87f7fdb 100644 +--- a/net/netfilter/nf_conntrack_timestamp.c ++++ b/net/netfilter/nf_conntrack_timestamp.c +@@ -42,7 +42,7 @@ static struct nf_ct_ext_type tstamp_extend __read_mostly = { + #ifdef CONFIG_SYSCTL + static int nf_conntrack_tstamp_init_sysctl(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(tstamp_sysctl_table, sizeof(tstamp_sysctl_table), + GFP_KERNEL); +diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c +index 9e31269..bc4c1b7 100644 +--- a/net/netfilter/nf_log.c ++++ b/net/netfilter/nf_log.c +@@ -215,7 +215,7 @@ static const struct file_operations nflog_file_ops = { + + #ifdef CONFIG_SYSCTL + static char nf_log_sysctl_fnames[NFPROTO_NUMPROTO-NFPROTO_UNSPEC][3]; +-static struct ctl_table nf_log_sysctl_table[NFPROTO_NUMPROTO+1]; ++static ctl_table_no_const nf_log_sysctl_table[NFPROTO_NUMPROTO+1] __read_only; + static struct ctl_table_header *nf_log_dir_header; + + static int nf_log_proc_dostring(ctl_table *table, int write, +@@ -246,14 +246,16 @@ static int nf_log_proc_dostring(ctl_table *table, int write, + rcu_assign_pointer(nf_loggers[tindex], logger); + mutex_unlock(&nf_log_mutex); + } else { ++ ctl_table_no_const nf_log_table = *table; ++ + mutex_lock(&nf_log_mutex); + logger = rcu_dereference_protected(nf_loggers[tindex], + lockdep_is_held(&nf_log_mutex)); + if (!logger) +- table->data = "NONE"; ++ nf_log_table.data = "NONE"; + else +- table->data = logger->name; +- r = proc_dostring(table, write, buffer, lenp, ppos); ++ nf_log_table.data = logger->name; ++ r = proc_dostring(&nf_log_table, write, buffer, lenp, ppos); + mutex_unlock(&nf_log_mutex); + } + +diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c +index f042ae5..30ea486 100644 +--- a/net/netfilter/nf_sockopt.c ++++ b/net/netfilter/nf_sockopt.c +@@ -45,7 +45,7 @@ int nf_register_sockopt(struct nf_sockopt_ops *reg) + } + } + +- list_add(®->list, &nf_sockopts); ++ pax_list_add((struct list_head *)®->list, &nf_sockopts); + out: + mutex_unlock(&nf_sockopt_mutex); + return ret; +@@ -55,7 +55,7 @@ EXPORT_SYMBOL(nf_register_sockopt); + void nf_unregister_sockopt(struct nf_sockopt_ops *reg) + { + mutex_lock(&nf_sockopt_mutex); +- list_del(®->list); ++ pax_list_del((struct list_head *)®->list); + mutex_unlock(&nf_sockopt_mutex); + } + EXPORT_SYMBOL(nf_unregister_sockopt); diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c -index 66b2c54..c7884e3 100644 +index f248db5..3778ad9 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c -@@ -70,7 +70,7 @@ struct nfulnl_instance { +@@ -72,7 +72,7 @@ struct nfulnl_instance { }; static DEFINE_SPINLOCK(instances_lock); @@ -77055,18 +88024,18 @@ index 66b2c54..c7884e3 100644 #define INSTANCE_BUCKETS 16 static struct hlist_head instance_table[INSTANCE_BUCKETS]; -@@ -502,7 +502,7 @@ __build_packet_message(struct nfulnl_instance *inst, +@@ -536,7 +536,7 @@ __build_packet_message(struct nfulnl_instance *inst, /* global sequence number */ - if (inst->flags & NFULNL_CFG_F_SEQ_GLOBAL) - NLA_PUT_BE32(inst->skb, NFULA_SEQ_GLOBAL, -- htonl(atomic_inc_return(&global_seq))); -+ htonl(atomic_inc_return_unchecked(&global_seq))); + if ((inst->flags & NFULNL_CFG_F_SEQ_GLOBAL) && + nla_put_be32(inst->skb, NFULA_SEQ_GLOBAL, +- htonl(atomic_inc_return(&global_seq)))) ++ htonl(atomic_inc_return_unchecked(&global_seq)))) + goto nla_put_failure; if (data_len) { - struct nlattr *nla; diff --git a/net/netfilter/xt_gradm.c b/net/netfilter/xt_gradm.c new file mode 100644 -index 0000000..6905327 +index 0000000..c566332 --- /dev/null +++ b/net/netfilter/xt_gradm.c @@ -0,0 +1,51 @@ @@ -77105,13 +88074,13 @@ index 0000000..6905327 +}; + +static int __init gradm_mt_init(void) -+{ -+ return xt_register_match(&gradm_mt_reg); ++{ ++ return xt_register_match(&gradm_mt_reg); +} + +static void __exit gradm_mt_exit(void) -+{ -+ xt_unregister_match(&gradm_mt_reg); ++{ ++ xt_unregister_match(&gradm_mt_reg); +} + +module_init(gradm_mt_init); @@ -77156,10 +88125,10 @@ index 4fe4fb4..87a89e5 100644 return 0; } diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c -index faa48f7..65f7f54 100644 +index 1e3fd5b..ad397ea 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c -@@ -741,7 +741,7 @@ static void netlink_overrun(struct sock *sk) +@@ -781,7 +781,7 @@ static void netlink_overrun(struct sock *sk) sk->sk_error_report(sk); } } @@ -77167,8 +88136,8 @@ index faa48f7..65f7f54 100644 + atomic_inc_unchecked(&sk->sk_drops); } - static struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid) -@@ -2013,7 +2013,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v) + static struct sock *netlink_getsockbyportid(struct sock *ssk, u32 portid) +@@ -2063,7 +2063,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v) sk_wmem_alloc_get(s), nlk->cb, atomic_read(&s->sk_refcnt), @@ -77177,11 +88146,53 @@ index faa48f7..65f7f54 100644 sock_i_ino(s) ); +diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c +index 5a55be3..7630745 100644 +--- a/net/netlink/genetlink.c ++++ b/net/netlink/genetlink.c +@@ -296,18 +296,20 @@ int genl_register_ops(struct genl_family *family, struct genl_ops *ops) + goto errout; + } + ++ pax_open_kernel(); + if (ops->dumpit) +- ops->flags |= GENL_CMD_CAP_DUMP; ++ *(unsigned int *)&ops->flags |= GENL_CMD_CAP_DUMP; + if (ops->doit) +- ops->flags |= GENL_CMD_CAP_DO; ++ *(unsigned int *)&ops->flags |= GENL_CMD_CAP_DO; + if (ops->policy) +- ops->flags |= GENL_CMD_CAP_HASPOL; ++ *(unsigned int *)&ops->flags |= GENL_CMD_CAP_HASPOL; ++ pax_close_kernel(); + + genl_lock(); +- list_add_tail(&ops->ops_list, &family->ops_list); ++ pax_list_add_tail((struct list_head *)&ops->ops_list, &family->ops_list); + genl_unlock(); + +- genl_ctrl_event(CTRL_CMD_NEWOPS, ops); ++ genl_ctrl_event(CTRL_CMD_NEWOPS, (void *)ops); + err = 0; + errout: + return err; +@@ -337,9 +339,9 @@ int genl_unregister_ops(struct genl_family *family, struct genl_ops *ops) + genl_lock(); + list_for_each_entry(rc, &family->ops_list, ops_list) { + if (rc == ops) { +- list_del(&ops->ops_list); ++ pax_list_del((struct list_head *)&ops->ops_list); + genl_unlock(); +- genl_ctrl_event(CTRL_CMD_DELOPS, ops); ++ genl_ctrl_event(CTRL_CMD_DELOPS, (void *)ops); + return 0; + } + } diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c -index 06592d8..64860f6 100644 +index 103bd70..f21aad3 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c -@@ -838,6 +838,7 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr, +@@ -834,6 +834,7 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr, struct sock *sk = sock->sk; struct nr_sock *nr = nr_sk(sk); @@ -77189,7 +88200,7 @@ index 06592d8..64860f6 100644 lock_sock(sk); if (peer != 0) { if (sk->sk_state != TCP_ESTABLISHED) { -@@ -852,7 +853,6 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr, +@@ -848,7 +849,6 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr, *uaddr_len = sizeof(struct full_sockaddr_ax25); } else { sax->fsa_ax25.sax25_family = AF_NETROM; @@ -77198,10 +88209,10 @@ index 06592d8..64860f6 100644 *uaddr_len = sizeof(struct sockaddr_ax25); } diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c -index 4f2c0df..a1a00a5 100644 +index f83e172..b57140d 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1687,7 +1687,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, +@@ -1571,7 +1571,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, spin_lock(&sk->sk_receive_queue.lock); po->stats.tp_packets++; @@ -77210,7 +88221,7 @@ index 4f2c0df..a1a00a5 100644 __skb_queue_tail(&sk->sk_receive_queue, skb); spin_unlock(&sk->sk_receive_queue.lock); sk->sk_data_ready(sk, skb->len); -@@ -1696,7 +1696,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, +@@ -1580,7 +1580,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, drop_n_acct: spin_lock(&sk->sk_receive_queue.lock); po->stats.tp_drops++; @@ -77219,7 +88230,7 @@ index 4f2c0df..a1a00a5 100644 spin_unlock(&sk->sk_receive_queue.lock); drop_n_restore: -@@ -2641,6 +2641,7 @@ out: +@@ -2558,6 +2558,7 @@ out: static int packet_recv_error(struct sock *sk, struct msghdr *msg, int len) { @@ -77227,7 +88238,7 @@ index 4f2c0df..a1a00a5 100644 struct sock_exterr_skb *serr; struct sk_buff *skb, *skb2; int copied, err; -@@ -2662,8 +2663,9 @@ static int packet_recv_error(struct sock *sk, struct msghdr *msg, int len) +@@ -2579,8 +2580,9 @@ static int packet_recv_error(struct sock *sk, struct msghdr *msg, int len) sock_recv_timestamp(msg, sk, skb); serr = SKB_EXT_ERR(skb); @@ -77238,7 +88249,7 @@ index 4f2c0df..a1a00a5 100644 msg->msg_flags |= MSG_ERRQUEUE; err = copied; -@@ -3294,7 +3296,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, +@@ -3205,7 +3207,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, case PACKET_HDRLEN: if (len > sizeof(int)) len = sizeof(int); @@ -77247,8 +88258,8 @@ index 4f2c0df..a1a00a5 100644 return -EFAULT; switch (val) { case TPACKET_V1: -@@ -3344,7 +3346,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, - +@@ -3247,7 +3249,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, + len = lv; if (put_user(len, optlen)) return -EFAULT; - if (copy_to_user(optval, data, len)) @@ -77257,18 +88268,9 @@ index 4f2c0df..a1a00a5 100644 return 0; } diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c -index d65f699..05aa6ce 100644 +index 5a940db..d6a502d 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c -@@ -41,7 +41,7 @@ static struct phonet_protocol *phonet_proto_get(unsigned int protocol) - { - struct phonet_protocol *pp; - -- if (protocol >= PHONET_NPROTO) -+ if (protocol < 0 || protocol >= PHONET_NPROTO) - return NULL; - - rcu_read_lock(); @@ -469,7 +469,7 @@ int __init_or_module phonet_proto_register(unsigned int protocol, { int err = 0; @@ -77279,7 +88281,7 @@ index d65f699..05aa6ce 100644 err = proto_register(pp->prot, 1); diff --git a/net/phonet/pep.c b/net/phonet/pep.c -index 9726fe6..fc4e3a4 100644 +index e774117..900b8b7 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c @@ -388,7 +388,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb) @@ -77310,25 +88312,31 @@ index 9726fe6..fc4e3a4 100644 break; } diff --git a/net/phonet/socket.c b/net/phonet/socket.c -index 4c7eff3..59c727f 100644 +index 1afd138..0b42453 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c -@@ -613,8 +613,13 @@ static int pn_sock_seq_show(struct seq_file *seq, void *v) - pn->resource, sk->sk_state, - sk_wmem_alloc_get(sk), sk_rmem_alloc_get(sk), - sock_i_uid(sk), sock_i_ino(sk), -- atomic_read(&sk->sk_refcnt), sk, +@@ -612,7 +612,7 @@ static int pn_sock_seq_show(struct seq_file *seq, void *v) + from_kuid_munged(seq_user_ns(seq), sock_i_uid(sk)), + sock_i_ino(sk), + atomic_read(&sk->sk_refcnt), sk, - atomic_read(&sk->sk_drops), &len); -+ atomic_read(&sk->sk_refcnt), -+#ifdef CONFIG_GRKERNSEC_HIDESYM -+ NULL, -+#else -+ sk, -+#endif + atomic_read_unchecked(&sk->sk_drops), &len); } seq_printf(seq, "%*s\n", 127 - len, ""); return 0; +diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c +index d6bbbbd..61561e4 100644 +--- a/net/phonet/sysctl.c ++++ b/net/phonet/sysctl.c +@@ -67,7 +67,7 @@ static int proc_local_port_range(ctl_table *table, int write, + { + int ret; + int range[2] = {local_port_range[0], local_port_range[1]}; +- ctl_table tmp = { ++ ctl_table_no_const tmp = { + .data = &range, + .maxlen = sizeof(range), + .mode = table->mode, diff --git a/net/rds/cong.c b/net/rds/cong.c index e5b65ac..f3b6fb7 100644 --- a/net/rds/cong.c @@ -77361,7 +88369,7 @@ index e5b65ac..f3b6fb7 100644 if (likely(*recent == gen)) return 0; diff --git a/net/rds/ib.h b/net/rds/ib.h -index edfaaaf..8c89879 100644 +index 7280ab8..e04f4ea 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -128,7 +128,7 @@ struct rds_ib_connection { @@ -77374,10 +88382,10 @@ index edfaaaf..8c89879 100644 spinlock_t i_ack_lock; /* protect i_ack_next */ u64 i_ack_next; /* next ACK to send */ diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c -index a1e1162..265e129 100644 +index 31b74f5..dc1fbfa 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c -@@ -718,7 +718,7 @@ void rds_ib_conn_shutdown(struct rds_connection *conn) +@@ -717,7 +717,7 @@ void rds_ib_conn_shutdown(struct rds_connection *conn) /* Clear the ACK state */ clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags); #ifdef KERNEL_HAS_ATOMIC64 @@ -77387,10 +88395,10 @@ index a1e1162..265e129 100644 ic->i_ack_next = 0; #endif diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c -index 8d19491..05a3e65 100644 +index 8eb9501..0c386ff 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c -@@ -592,7 +592,7 @@ static u64 rds_ib_get_ack(struct rds_ib_connection *ic) +@@ -597,7 +597,7 @@ static u64 rds_ib_get_ack(struct rds_ib_connection *ic) static void rds_ib_set_ack(struct rds_ib_connection *ic, u64 seq, int ack_required) { @@ -77399,7 +88407,7 @@ index 8d19491..05a3e65 100644 if (ack_required) { smp_mb__before_clear_bit(); set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags); -@@ -604,7 +604,7 @@ static u64 rds_ib_get_ack(struct rds_ib_connection *ic) +@@ -609,7 +609,7 @@ static u64 rds_ib_get_ack(struct rds_ib_connection *ic) clear_bit(IB_ACK_REQUESTED, &ic->i_ack_flags); smp_mb__after_clear_bit(); @@ -77456,27 +88464,19 @@ index 4503335..db566b4 100644 } #endif -diff --git a/net/rds/recv.c b/net/rds/recv.c -index 5c6e9f1..9f0f17c 100644 ---- a/net/rds/recv.c -+++ b/net/rds/recv.c -@@ -410,6 +410,8 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, - - rdsdebug("size %zu flags 0x%x timeo %ld\n", size, msg_flags, timeo); - -+ msg->msg_namelen = 0; -+ - if (msg_flags & MSG_OOB) - goto out; +diff --git a/net/rds/rds.h b/net/rds/rds.h +index ec1d731..90a3a8d 100644 +--- a/net/rds/rds.h ++++ b/net/rds/rds.h +@@ -449,7 +449,7 @@ struct rds_transport { + void (*sync_mr)(void *trans_private, int direction); + void (*free_mr)(void *trans_private, int invalidate); + void (*flush_mrs)(void); +-}; ++} __do_const; -@@ -485,6 +487,7 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, - sin->sin_port = inc->i_hdr.h_sport; - sin->sin_addr.s_addr = inc->i_saddr; - memset(sin->sin_zero, 0, sizeof(sin->sin_zero)); -+ msg->msg_namelen = sizeof(*sin); - } - break; - } + struct rds_sock { + struct sock rs_sk; diff --git a/net/rds/tcp.c b/net/rds/tcp.c index edac9ef..16bcb98 100644 --- a/net/rds/tcp.c @@ -77491,7 +88491,7 @@ index edac9ef..16bcb98 100644 set_fs(oldfs); } diff --git a/net/rds/tcp_send.c b/net/rds/tcp_send.c -index 1b4fd68..2234175 100644 +index 81cf5a4..b5826ff 100644 --- a/net/rds/tcp_send.c +++ b/net/rds/tcp_send.c @@ -43,7 +43,7 @@ static void rds_tcp_cork(struct socket *sock, int val) @@ -77504,10 +88504,10 @@ index 1b4fd68..2234175 100644 set_fs(oldfs); } diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c -index 74c064c..fdec26f 100644 +index e61aa60..f07cc89 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c -@@ -39,7 +39,7 @@ static const struct proto_ops rxrpc_rpc_ops; +@@ -40,7 +40,7 @@ static const struct proto_ops rxrpc_rpc_ops; __be32 rxrpc_epoch; /* current debugging ID */ @@ -77517,7 +88517,7 @@ index 74c064c..fdec26f 100644 /* count of skbs currently in use */ atomic_t rxrpc_n_skbs; diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c -index c3126e8..21facc7 100644 +index e4d9cbc..b229649 100644 --- a/net/rxrpc/ar-ack.c +++ b/net/rxrpc/ar-ack.c @@ -175,7 +175,7 @@ static void rxrpc_resend(struct rxrpc_call *call) @@ -77584,7 +88584,7 @@ index c3126e8..21facc7 100644 send_message_2: diff --git a/net/rxrpc/ar-call.c b/net/rxrpc/ar-call.c -index bf656c2..48f9d27 100644 +index a3bbb36..3341fb9 100644 --- a/net/rxrpc/ar-call.c +++ b/net/rxrpc/ar-call.c @@ -83,7 +83,7 @@ static struct rxrpc_call *rxrpc_alloc_call(gfp_t gfp) @@ -77623,7 +88623,7 @@ index e7ed43a..6afa140 100644 ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 2, len); diff --git a/net/rxrpc/ar-input.c b/net/rxrpc/ar-input.c -index 1a2b0633..e8d1382 100644 +index 529572f..c758ca7 100644 --- a/net/rxrpc/ar-input.c +++ b/net/rxrpc/ar-input.c @@ -340,9 +340,9 @@ void rxrpc_fast_process_packet(struct rxrpc_call *call, struct sk_buff *skb) @@ -77639,13 +88639,13 @@ index 1a2b0633..e8d1382 100644 /* request ACK generation for any ACK or DATA packet that requests diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h -index 8e22bd3..f66d1c0 100644 +index a693aca..81e7293 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -272,8 +272,8 @@ struct rxrpc_connection { int error; /* error code for local abort */ int debug_id; /* debug ID for printks */ - unsigned call_counter; /* call ID counter */ + unsigned int call_counter; /* call ID counter */ - atomic_t serial; /* packet serial number counter */ - atomic_t hi_serial; /* highest serial number received */ + atomic_unchecked_t serial; /* packet serial number counter */ @@ -77685,7 +88685,7 @@ index 87f7135..74d3703 100644 } diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c -index 16ae887..d24f12b 100644 +index e1ac183..b43e10e 100644 --- a/net/rxrpc/ar-output.c +++ b/net/rxrpc/ar-output.c @@ -682,9 +682,9 @@ static int rxrpc_send_data(struct kiocb *iocb, @@ -77701,7 +88701,7 @@ index 16ae887..d24f12b 100644 sp->hdr.userStatus = 0; sp->hdr.securityIndex = conn->security_ix; diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c -index 2754f09..b20e38f 100644 +index bebaa43..2644591 100644 --- a/net/rxrpc/ar-peer.c +++ b/net/rxrpc/ar-peer.c @@ -72,7 +72,7 @@ static struct rxrpc_peer *rxrpc_alloc_peer(struct sockaddr_rxrpc *srx, @@ -77742,7 +88742,7 @@ index 92df566..87ec1bf 100644 if (peer->srx.transport.family == AF_INET) { switch (peer->srx.transport_type) { diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c -index 7635107..4670276 100644 +index f226709..0e735a8 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -610,7 +610,7 @@ static int rxkad_issue_challenge(struct rxrpc_connection *conn) @@ -77763,11 +88763,55 @@ index 7635107..4670276 100644 _proto("Tx RESPONSE %%%u", ntohl(hdr->serial)); ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 3, len); +diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c +index 391a245..296b3d7 100644 +--- a/net/sctp/ipv6.c ++++ b/net/sctp/ipv6.c +@@ -981,7 +981,7 @@ static const struct inet6_protocol sctpv6_protocol = { + .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL, + }; + +-static struct sctp_af sctp_af_inet6 = { ++static struct sctp_af sctp_af_inet6 __read_only = { + .sa_family = AF_INET6, + .sctp_xmit = sctp_v6_xmit, + .setsockopt = ipv6_setsockopt, +@@ -1013,7 +1013,7 @@ static struct sctp_af sctp_af_inet6 = { + #endif + }; + +-static struct sctp_pf sctp_pf_inet6 = { ++static struct sctp_pf sctp_pf_inet6 __read_only = { + .event_msgname = sctp_inet6_event_msgname, + .skb_msgname = sctp_inet6_skb_msgname, + .af_supported = sctp_inet6_af_supported, +@@ -1038,7 +1038,7 @@ void sctp_v6_pf_init(void) + + void sctp_v6_pf_exit(void) + { +- list_del(&sctp_af_inet6.list); ++ pax_list_del(&sctp_af_inet6.list); + } + + /* Initialize IPv6 support and register with socket layer. */ +diff --git a/net/sctp/probe.c b/net/sctp/probe.c +index ad0dba8..e62c225 100644 +--- a/net/sctp/probe.c ++++ b/net/sctp/probe.c +@@ -63,7 +63,7 @@ static struct { + struct timespec tstart; + } sctpw; + +-static void printl(const char *fmt, ...) ++static __printf(1, 2) void printl(const char *fmt, ...) + { + va_list args; + int len; diff --git a/net/sctp/proc.c b/net/sctp/proc.c -index 1e2eee8..ce3967e 100644 +index ab3bba8..2fbab4e 100644 --- a/net/sctp/proc.c +++ b/net/sctp/proc.c -@@ -319,7 +319,8 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) +@@ -336,7 +336,8 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) seq_printf(seq, "%8pK %8pK %-3d %-3d %-2d %-4d " "%4d %8d %8d %7d %5lu %-5d %5d ", @@ -77777,27 +88821,174 @@ index 1e2eee8..ce3967e 100644 assoc->state, hash, assoc->assoc_id, assoc->sndbuf_used, +diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c +index 1c2e46c..f91cf5e 100644 +--- a/net/sctp/protocol.c ++++ b/net/sctp/protocol.c +@@ -834,8 +834,10 @@ int sctp_register_af(struct sctp_af *af) + return 0; + } + ++ pax_open_kernel(); + INIT_LIST_HEAD(&af->list); +- list_add_tail(&af->list, &sctp_address_families); ++ pax_close_kernel(); ++ pax_list_add_tail(&af->list, &sctp_address_families); + return 1; + } + +@@ -966,7 +968,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb, + + static struct sctp_af sctp_af_inet; + +-static struct sctp_pf sctp_pf_inet = { ++static struct sctp_pf sctp_pf_inet __read_only = { + .event_msgname = sctp_inet_event_msgname, + .skb_msgname = sctp_inet_skb_msgname, + .af_supported = sctp_inet_af_supported, +@@ -1037,7 +1039,7 @@ static const struct net_protocol sctp_protocol = { + }; + + /* IPv4 address related functions. */ +-static struct sctp_af sctp_af_inet = { ++static struct sctp_af sctp_af_inet __read_only = { + .sa_family = AF_INET, + .sctp_xmit = sctp_v4_xmit, + .setsockopt = ip_setsockopt, +@@ -1122,7 +1124,7 @@ static void sctp_v4_pf_init(void) + + static void sctp_v4_pf_exit(void) + { +- list_del(&sctp_af_inet.list); ++ pax_list_del(&sctp_af_inet.list); + } + + static int sctp_v4_protosw_init(void) +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c +index 8aab894..f6b7e7d 100644 +--- a/net/sctp/sm_sideeffect.c ++++ b/net/sctp/sm_sideeffect.c +@@ -447,7 +447,7 @@ static void sctp_generate_sack_event(unsigned long data) + sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_SACK); + } + +-sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES] = { ++sctp_timer_event_t * const sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES] = { + NULL, + sctp_generate_t1_cookie_event, + sctp_generate_t1_init_event, diff --git a/net/sctp/socket.c b/net/sctp/socket.c -index dba20d6..9352c05 100644 +index b907073..57fef6c 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c -@@ -4577,7 +4577,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, +@@ -2166,11 +2166,13 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval, + { + struct sctp_association *asoc; + struct sctp_ulpevent *event; ++ struct sctp_event_subscribe subscribe; + + if (optlen > sizeof(struct sctp_event_subscribe)) + return -EINVAL; +- if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen)) ++ if (copy_from_user(&subscribe, optval, optlen)) + return -EFAULT; ++ sctp_sk(sk)->subscribe = subscribe; + + /* + * At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, +@@ -4215,13 +4217,16 @@ static int sctp_getsockopt_disable_fragments(struct sock *sk, int len, + static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval, + int __user *optlen) + { ++ struct sctp_event_subscribe subscribe; ++ + if (len <= 0) + return -EINVAL; + if (len > sizeof(struct sctp_event_subscribe)) + len = sizeof(struct sctp_event_subscribe); + if (put_user(len, optlen)) + return -EFAULT; +- if (copy_to_user(optval, &sctp_sk(sk)->subscribe, len)) ++ subscribe = sctp_sk(sk)->subscribe; ++ if (copy_to_user(optval, &subscribe, len)) + return -EFAULT; + return 0; + } +@@ -4239,6 +4244,8 @@ static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval, + */ + static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optval, int __user *optlen) + { ++ __u32 autoclose; ++ + /* Applicable to UDP-style socket only */ + if (sctp_style(sk, TCP)) + return -EOPNOTSUPP; +@@ -4247,7 +4254,8 @@ static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optv + len = sizeof(int); + if (put_user(len, optlen)) + return -EFAULT; +- if (copy_to_user(optval, &sctp_sk(sk)->autoclose, sizeof(int))) ++ autoclose = sctp_sk(sk)->autoclose; ++ if (copy_to_user(optval, &autoclose, sizeof(int))) + return -EFAULT; + return 0; + } +@@ -4619,12 +4627,15 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len, + */ + static int sctp_getsockopt_initmsg(struct sock *sk, int len, char __user *optval, int __user *optlen) + { ++ struct sctp_initmsg initmsg; ++ + if (len < sizeof(struct sctp_initmsg)) + return -EINVAL; + len = sizeof(struct sctp_initmsg); + if (put_user(len, optlen)) + return -EFAULT; +- if (copy_to_user(optval, &sctp_sk(sk)->initmsg, len)) ++ initmsg = sctp_sk(sk)->initmsg; ++ if (copy_to_user(optval, &initmsg, len)) + return -EFAULT; + return 0; + } +@@ -4665,6 +4676,8 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; if (space_left < addrlen) return -ENOMEM; -- if (copy_to_user(to, &temp, addrlen)) -+ if (addrlen > sizeof(temp) || copy_to_user(to, &temp, addrlen)) ++ if (addrlen > sizeof(temp) || addrlen < 0) ++ return -EFAULT; + if (copy_to_user(to, &temp, addrlen)) return -EFAULT; to += addrlen; - cnt++; +diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c +index bf3c6e8..376d8d0 100644 +--- a/net/sctp/sysctl.c ++++ b/net/sctp/sysctl.c +@@ -307,7 +307,7 @@ static int proc_sctp_do_hmac_alg(ctl_table *ctl, + { + struct net *net = current->nsproxy->net_ns; + char tmp[8]; +- ctl_table tbl; ++ ctl_table_no_const tbl; + int ret; + int changed = 0; + char *none = "none"; +@@ -350,7 +350,7 @@ static int proc_sctp_do_hmac_alg(ctl_table *ctl, + + int sctp_sysctl_net_register(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + int i; + + table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL); diff --git a/net/socket.c b/net/socket.c -index 06ffa0f..aff61b1 100644 +index 88f759a..c6933de 100644 --- a/net/socket.c +++ b/net/socket.c @@ -88,6 +88,7 @@ - #include <linux/nsproxy.h> #include <linux/magic.h> #include <linux/slab.h> + #include <linux/xattr.h> +#include <linux/in.h> #include <asm/uaccess.h> @@ -77820,7 +89011,7 @@ index 06ffa0f..aff61b1 100644 static struct file_system_type sock_fs_type = { .name = "sockfs", -@@ -1210,6 +1213,8 @@ int __sock_create(struct net *net, int family, int type, int protocol, +@@ -1268,6 +1271,8 @@ int __sock_create(struct net *net, int family, int type, int protocol, return -EAFNOSUPPORT; if (type < 0 || type >= SOCK_MAX) return -EINVAL; @@ -77829,7 +89020,7 @@ index 06ffa0f..aff61b1 100644 /* Compatibility. -@@ -1342,6 +1347,16 @@ SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) +@@ -1399,6 +1404,16 @@ SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) if (SOCK_NONBLOCK != O_NONBLOCK && (flags & SOCK_NONBLOCK)) flags = (flags & ~SOCK_NONBLOCK) | O_NONBLOCK; @@ -77846,7 +89037,7 @@ index 06ffa0f..aff61b1 100644 retval = sock_create(family, type, protocol, &sock); if (retval < 0) goto out; -@@ -1454,6 +1469,14 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) +@@ -1526,6 +1541,14 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) if (sock) { err = move_addr_to_kernel(umyaddr, addrlen, &address); if (err >= 0) { @@ -77861,7 +89052,7 @@ index 06ffa0f..aff61b1 100644 err = security_socket_bind(sock, (struct sockaddr *)&address, addrlen); -@@ -1462,6 +1485,7 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) +@@ -1534,6 +1557,7 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) (struct sockaddr *) &address, addrlen); } @@ -77869,8 +89060,8 @@ index 06ffa0f..aff61b1 100644 fput_light(sock->file, fput_needed); } return err; -@@ -1485,10 +1509,20 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog) - if ((unsigned)backlog > somaxconn) +@@ -1557,10 +1581,20 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog) + if ((unsigned int)backlog > somaxconn) backlog = somaxconn; + if (gr_handle_sock_server_other(sock->sk)) { @@ -77890,7 +89081,7 @@ index 06ffa0f..aff61b1 100644 fput_light(sock->file, fput_needed); } return err; -@@ -1532,6 +1566,18 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, +@@ -1604,6 +1638,18 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, newsock->type = sock->type; newsock->ops = sock->ops; @@ -77909,7 +89100,7 @@ index 06ffa0f..aff61b1 100644 /* * We don't need try_module_get here, as the listening socket (sock) * has the protocol module (sock->ops->owner) held. -@@ -1570,6 +1616,8 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, +@@ -1649,6 +1695,8 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, fd_install(newfd, newfile); err = newfd; @@ -77918,7 +89109,7 @@ index 06ffa0f..aff61b1 100644 out_put: fput_light(sock->file, fput_needed); out: -@@ -1602,6 +1650,7 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, +@@ -1681,6 +1729,7 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, int, addrlen) { struct socket *sock; @@ -77926,7 +89117,7 @@ index 06ffa0f..aff61b1 100644 struct sockaddr_storage address; int err, fput_needed; -@@ -1612,6 +1661,17 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, +@@ -1691,6 +1740,17 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, if (err < 0) goto out_put; @@ -77944,7 +89135,25 @@ index 06ffa0f..aff61b1 100644 err = security_socket_connect(sock, (struct sockaddr *)&address, addrlen); if (err) -@@ -1969,7 +2029,7 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg, +@@ -1772,6 +1832,8 @@ SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr, + * the protocol. + */ + ++asmlinkage long sys_sendto(int, void *, size_t, unsigned, struct sockaddr *, int); ++ + SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, + unsigned int, flags, struct sockaddr __user *, addr, + int, addr_len) +@@ -1838,7 +1900,7 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, + struct socket *sock; + struct iovec iov; + struct msghdr msg; +- struct sockaddr_storage address; ++ struct sockaddr_storage address = { }; + int err, err2; + int fput_needed; + +@@ -2045,7 +2107,7 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg, * checking falls down on this. */ if (copy_from_user(ctl_buf, @@ -77953,7 +89162,16 @@ index 06ffa0f..aff61b1 100644 ctl_len)) goto out_freectl; msg_sys->msg_control = ctl_buf; -@@ -2139,7 +2199,7 @@ static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg, +@@ -2185,7 +2247,7 @@ static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg, + int err, total_len, len; + + /* kernel mode address */ +- struct sockaddr_storage addr; ++ struct sockaddr_storage addr = { }; + + /* user mode address pointers */ + struct sockaddr __user *uaddr; +@@ -2213,7 +2275,7 @@ static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg, * kernel msghdr to use the kernel address space) */ @@ -77962,50 +89180,7 @@ index 06ffa0f..aff61b1 100644 uaddr_len = COMPAT_NAMELEN(msg); if (MSG_CMSG_COMPAT & flags) { err = verify_compat_iovec(msg_sys, iov, &addr, VERIFY_WRITE); -@@ -2761,7 +2821,7 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32) - } - - ifr = compat_alloc_user_space(buf_size); -- rxnfc = (void *)ifr + ALIGN(sizeof(struct ifreq), 8); -+ rxnfc = (void __user *)ifr + ALIGN(sizeof(struct ifreq), 8); - - if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ)) - return -EFAULT; -@@ -2785,12 +2845,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32) - offsetof(struct ethtool_rxnfc, fs.ring_cookie)); - - if (copy_in_user(rxnfc, compat_rxnfc, -- (void *)(&rxnfc->fs.m_ext + 1) - -- (void *)rxnfc) || -+ (void __user *)(&rxnfc->fs.m_ext + 1) - -+ (void __user *)rxnfc) || - copy_in_user(&rxnfc->fs.ring_cookie, - &compat_rxnfc->fs.ring_cookie, -- (void *)(&rxnfc->fs.location + 1) - -- (void *)&rxnfc->fs.ring_cookie) || -+ (void __user *)(&rxnfc->fs.location + 1) - -+ (void __user *)&rxnfc->fs.ring_cookie) || - copy_in_user(&rxnfc->rule_cnt, &compat_rxnfc->rule_cnt, - sizeof(rxnfc->rule_cnt))) - return -EFAULT; -@@ -2802,12 +2862,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32) - - if (convert_out) { - if (copy_in_user(compat_rxnfc, rxnfc, -- (const void *)(&rxnfc->fs.m_ext + 1) - -- (const void *)rxnfc) || -+ (const void __user *)(&rxnfc->fs.m_ext + 1) - -+ (const void __user *)rxnfc) || - copy_in_user(&compat_rxnfc->fs.ring_cookie, - &rxnfc->fs.ring_cookie, -- (const void *)(&rxnfc->fs.location + 1) - -- (const void *)&rxnfc->fs.ring_cookie) || -+ (const void __user *)(&rxnfc->fs.location + 1) - -+ (const void __user *)&rxnfc->fs.ring_cookie) || - copy_in_user(&compat_rxnfc->rule_cnt, &rxnfc->rule_cnt, - sizeof(rxnfc->rule_cnt))) - return -EFAULT; -@@ -2877,7 +2937,7 @@ static int bond_ioctl(struct net *net, unsigned int cmd, +@@ -2952,7 +3014,7 @@ static int bond_ioctl(struct net *net, unsigned int cmd, old_fs = get_fs(); set_fs(KERNEL_DS); err = dev_ioctl(net, cmd, @@ -78014,7 +89189,7 @@ index 06ffa0f..aff61b1 100644 set_fs(old_fs); return err; -@@ -2986,7 +3046,7 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd, +@@ -3061,7 +3123,7 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd, old_fs = get_fs(); set_fs(KERNEL_DS); @@ -78023,7 +89198,7 @@ index 06ffa0f..aff61b1 100644 set_fs(old_fs); if (cmd == SIOCGIFMAP && !err) { -@@ -3091,7 +3151,7 @@ static int routing_ioctl(struct net *net, struct socket *sock, +@@ -3166,7 +3228,7 @@ static int routing_ioctl(struct net *net, struct socket *sock, ret |= __get_user(rtdev, &(ur4->rt_dev)); if (rtdev) { ret |= copy_from_user(devname, compat_ptr(rtdev), 15); @@ -78032,7 +89207,7 @@ index 06ffa0f..aff61b1 100644 devname[15] = 0; } else r4.rt_dev = NULL; -@@ -3317,8 +3377,8 @@ int kernel_getsockopt(struct socket *sock, int level, int optname, +@@ -3392,8 +3454,8 @@ int kernel_getsockopt(struct socket *sock, int level, int optname, int __user *uoptlen; int err; @@ -78043,7 +89218,7 @@ index 06ffa0f..aff61b1 100644 set_fs(KERNEL_DS); if (level == SOL_SOCKET) -@@ -3338,7 +3398,7 @@ int kernel_setsockopt(struct socket *sock, int level, int optname, +@@ -3413,7 +3475,7 @@ int kernel_setsockopt(struct socket *sock, int level, int optname, char __user *uoptval; int err; @@ -78052,11 +89227,26 @@ index 06ffa0f..aff61b1 100644 set_fs(KERNEL_DS); if (level == SOL_SOCKET) +diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c +index d5f35f1..da2680b5 100644 +--- a/net/sunrpc/clnt.c ++++ b/net/sunrpc/clnt.c +@@ -1283,7 +1283,9 @@ call_start(struct rpc_task *task) + (RPC_IS_ASYNC(task) ? "async" : "sync")); + + /* Increment call count */ +- task->tk_msg.rpc_proc->p_count++; ++ pax_open_kernel(); ++ (*(unsigned int *)&task->tk_msg.rpc_proc->p_count)++; ++ pax_close_kernel(); + clnt->cl_stats->rpccnt++; + task->tk_action = call_reserve; + } diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c -index eda32ae..1c9fa7c 100644 +index f8529fc..ce8c643 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c -@@ -240,9 +240,9 @@ static int rpc_wait_bit_killable(void *word) +@@ -261,9 +261,9 @@ static int rpc_wait_bit_killable(void *word) #ifdef RPC_DEBUG static void rpc_task_set_debuginfo(struct rpc_task *task) { @@ -78068,6 +89258,21 @@ index eda32ae..1c9fa7c 100644 } #else static inline void rpc_task_set_debuginfo(struct rpc_task *task) +diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c +index 89a588b..ba2cef8 100644 +--- a/net/sunrpc/svc.c ++++ b/net/sunrpc/svc.c +@@ -1160,7 +1160,9 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) + svc_putnl(resv, RPC_SUCCESS); + + /* Bump per-procedure stats counter */ +- procp->pc_count++; ++ pax_open_kernel(); ++ (*(unsigned int *)&procp->pc_count)++; ++ pax_close_kernel(); + + /* Initialize storage for argp and resp */ + memset(rqstp->rq_argp, 0, procp->pc_argsize); diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c index 8343737..677025e 100644 --- a/net/sunrpc/xprtrdma/svc_rdma.c @@ -78180,7 +89385,7 @@ index 8343737..677025e 100644 .proc_handler = read_reset_stat, }, diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c -index 41cb63b..c4a1489 100644 +index 0ce7552..d074459 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c @@ -501,7 +501,7 @@ next_sge: @@ -78211,7 +89416,7 @@ index 41cb63b..c4a1489 100644 /* Build up the XDR from the receive buffers. */ rdma_build_arg_xdr(rqstp, ctxt, ctxt->byte_len); diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c -index 42eb7ba..c887c45 100644 +index c1d124d..acfc59e 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -362,7 +362,7 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp, @@ -78224,7 +89429,7 @@ index 42eb7ba..c887c45 100644 goto err; return 0; diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c -index 73b428b..5f3f8f3 100644 +index 62e4f9b..dd3f2d7 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -292,7 +292,7 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt) @@ -78263,7 +89468,7 @@ index 73b428b..5f3f8f3 100644 } static void sq_comp_handler(struct ib_cq *cq, void *cq_context) -@@ -1266,7 +1266,7 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr) +@@ -1262,7 +1262,7 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr) spin_lock_bh(&xprt->sc_lock); if (xprt->sc_sq_depth < atomic_read(&xprt->sc_sq_count) + wr_count) { spin_unlock_bh(&xprt->sc_lock); @@ -78273,23 +89478,23 @@ index 73b428b..5f3f8f3 100644 /* See if we can opportunistically reap SQ WR to make room */ sq_cq_reap(xprt); diff --git a/net/sysctl_net.c b/net/sysctl_net.c -index c3e65ae..f512a2b 100644 +index 9bc6db0..47ac8c0 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c -@@ -47,7 +47,7 @@ static int net_ctl_permissions(struct ctl_table_root *root, - struct ctl_table *table) - { +@@ -46,7 +46,7 @@ static int net_ctl_permissions(struct ctl_table_header *head, + kgid_t root_gid = make_kgid(net->user_ns, 0); + /* Allow network administrator to have same access as root. */ -- if (capable(CAP_NET_ADMIN)) { -+ if (capable_nolog(CAP_NET_ADMIN)) { +- if (ns_capable(net->user_ns, CAP_NET_ADMIN) || ++ if (ns_capable_nolog(net->user_ns, CAP_NET_ADMIN) || + uid_eq(root_uid, current_uid())) { int mode = (table->mode >> 6) & 7; return (mode << 6) | (mode << 3) | mode; - } diff --git a/net/tipc/link.c b/net/tipc/link.c -index b4b9b30..5b62131 100644 +index daa6080..2bbbe70 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c -@@ -1203,7 +1203,7 @@ static int link_send_sections_long(struct tipc_port *sender, +@@ -1201,7 +1201,7 @@ static int link_send_sections_long(struct tipc_port *sender, struct tipc_msg fragm_hdr; struct sk_buff *buf, *buf_chain, *prev; u32 fragm_crs, fragm_rest, hsz, sect_rest; @@ -78298,7 +89503,7 @@ index b4b9b30..5b62131 100644 int curr_sect; u32 fragm_no; -@@ -1247,7 +1247,7 @@ again: +@@ -1242,7 +1242,7 @@ again: if (!sect_rest) { sect_rest = msg_sect[++curr_sect].iov_len; @@ -78307,7 +89512,7 @@ index b4b9b30..5b62131 100644 } if (sect_rest < fragm_rest) -@@ -1266,7 +1266,7 @@ error: +@@ -1261,7 +1261,7 @@ error: } } else skb_copy_to_linear_data_offset(buf, fragm_crs, @@ -78316,11 +89521,43 @@ index b4b9b30..5b62131 100644 sect_crs += sz; sect_rest -= sz; fragm_crs += sz; +@@ -2306,8 +2306,11 @@ static int link_recv_changeover_msg(struct tipc_link **l_ptr, + struct tipc_msg *tunnel_msg = buf_msg(tunnel_buf); + u32 msg_typ = msg_type(tunnel_msg); + u32 msg_count = msg_msgcnt(tunnel_msg); ++ u32 bearer_id = msg_bearer_id(tunnel_msg); + +- dest_link = (*l_ptr)->owner->links[msg_bearer_id(tunnel_msg)]; ++ if (bearer_id >= MAX_BEARERS) ++ goto exit; ++ dest_link = (*l_ptr)->owner->links[bearer_id]; + if (!dest_link) + goto exit; + if (dest_link == *l_ptr) { +@@ -2521,14 +2524,16 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, + struct tipc_msg *imsg = (struct tipc_msg *)msg_data(fragm); + u32 msg_sz = msg_size(imsg); + u32 fragm_sz = msg_data_sz(fragm); +- u32 exp_fragm_cnt = msg_sz/fragm_sz + !!(msg_sz % fragm_sz); ++ u32 exp_fragm_cnt; + u32 max = TIPC_MAX_USER_MSG_SIZE + NAMED_H_SIZE; ++ + if (msg_type(imsg) == TIPC_MCAST_MSG) + max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE; +- if (msg_size(imsg) > max) { ++ if (fragm_sz == 0 || msg_size(imsg) > max) { + kfree_skb(fbuf); + return 0; + } ++ exp_fragm_cnt = msg_sz / fragm_sz + !!(msg_sz % fragm_sz); + pbuf = tipc_buf_acquire(msg_size(imsg)); + if (pbuf != NULL) { + pbuf->next = *pending; diff --git a/net/tipc/msg.c b/net/tipc/msg.c -index e3afe16..333ea83 100644 +index f2db8a8..9245aa4 100644 --- a/net/tipc/msg.c +++ b/net/tipc/msg.c -@@ -99,7 +99,7 @@ int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect, +@@ -98,7 +98,7 @@ int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect, msg_sect[cnt].iov_len); else skb_copy_to_linear_data_offset(*buf, pos, @@ -78330,10 +89567,10 @@ index e3afe16..333ea83 100644 pos += msg_sect[cnt].iov_len; } diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c -index b2964e9..fdf2e27 100644 +index 6b42d47..2ac24d5 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c -@@ -101,7 +101,7 @@ static void subscr_send_event(struct tipc_subscription *sub, +@@ -96,7 +96,7 @@ static void subscr_send_event(struct tipc_subscription *sub, { struct iovec msg_sect; @@ -78343,10 +89580,10 @@ index b2964e9..fdf2e27 100644 sub->evt.event = htohl(event, sub->swap); diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c -index d510353..26c8a32 100644 +index 2db702d..09a77488 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c -@@ -779,6 +779,12 @@ static struct sock *unix_find_other(struct net *net, +@@ -783,6 +783,12 @@ static struct sock *unix_find_other(struct net *net, err = -ECONNREFUSED; if (!S_ISSOCK(inode->i_mode)) goto put_fail; @@ -78359,7 +89596,7 @@ index d510353..26c8a32 100644 u = unix_find_socket_byinode(inode); if (!u) goto put_fail; -@@ -799,6 +805,13 @@ static struct sock *unix_find_other(struct net *net, +@@ -803,6 +809,13 @@ static struct sock *unix_find_other(struct net *net, if (u) { struct dentry *dentry; dentry = unix_sk(u)->path.dentry; @@ -78373,43 +89610,71 @@ index d510353..26c8a32 100644 if (dentry) touch_atime(&unix_sk(u)->path); } else -@@ -881,11 +894,18 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) - err = security_path_mknod(&path, dentry, mode, 0); - if (err) - goto out_mknod_drop_write; +@@ -836,12 +849,18 @@ static int unix_mknod(const char *sun_path, umode_t mode, struct path *res) + */ + err = security_path_mknod(&path, dentry, mode, 0); + if (!err) { + if (!gr_acl_handle_mknod(dentry, path.dentry, path.mnt, mode)) { + err = -EACCES; -+ goto out_mknod_drop_write; ++ goto out; + } err = vfs_mknod(path.dentry->d_inode, dentry, mode, 0); - out_mknod_drop_write: - mnt_drop_write(path.mnt); - if (err) - goto out_mknod_dput; -+ -+ gr_handle_create(dentry, path.mnt); + if (!err) { + res->mnt = mntget(path.mnt); + res->dentry = dget(dentry); ++ gr_handle_create(dentry, path.mnt); + } + } ++out: + done_path_create(&path, dentry); + return err; + } +@@ -2323,9 +2342,13 @@ static int unix_seq_show(struct seq_file *seq, void *v) + seq_puts(seq, "Num RefCount Protocol Flags Type St " + "Inode Path\n"); + else { +- struct sock *s = v; ++ struct sock *s = v, *peer; + struct unix_sock *u = unix_sk(s); + unix_state_lock(s); ++ peer = unix_peer(s); ++ unix_state_unlock(s); ++ ++ unix_state_double_lock(s, peer); + + seq_printf(seq, "%pK: %08X %08X %08X %04X %02X %5lu", + s, +@@ -2352,8 +2375,10 @@ static int unix_seq_show(struct seq_file *seq, void *v) + } + for ( ; i < len; i++) + seq_putc(seq, u->addr->name->sun_path[i]); +- } +- unix_state_unlock(s); ++ } else if (peer) ++ seq_printf(seq, " P%lu", sock_i_ino(peer)); + - mutex_unlock(&path.dentry->d_inode->i_mutex); - dput(path.dentry); - path.dentry = dentry; -diff --git a/net/wireless/core.h b/net/wireless/core.h -index ce5597c..46d01db 100644 ---- a/net/wireless/core.h -+++ b/net/wireless/core.h -@@ -27,7 +27,7 @@ struct cfg80211_registered_device { - struct mutex mtx; - - /* rfkill support */ -- struct rfkill_ops rfkill_ops; -+ rfkill_ops_no_const rfkill_ops; - struct rfkill *rfkill; - struct work_struct rfkill_sync; ++ unix_state_double_unlock(s, peer); + seq_putc(seq, '\n'); + } +diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c +index 8800604..0526440 100644 +--- a/net/unix/sysctl_net_unix.c ++++ b/net/unix/sysctl_net_unix.c +@@ -28,7 +28,7 @@ static ctl_table unix_table[] = { + + int __net_init unix_sysctl_register(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + table = kmemdup(unix_table, sizeof(unix_table), GFP_KERNEL); + if (table == NULL) diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c -index af648e0..6185d3a 100644 +index c8717c1..08539f5 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c -@@ -747,8 +747,7 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, +@@ -748,8 +748,7 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, */ /* Support for very large requests */ @@ -78419,7 +89684,7 @@ index af648e0..6185d3a 100644 /* Allow userspace to GET more than max so * we can support any size GET requests. * There is still a limit : -ENOMEM. -@@ -787,22 +786,6 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, +@@ -788,22 +787,6 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, } } @@ -78443,28 +89708,28 @@ index af648e0..6185d3a 100644 iwp->length += essid_compat; diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c -index a15d2a0..12142af 100644 +index 167c67d..3f2ae427 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c -@@ -299,7 +299,7 @@ static void xfrm_policy_kill(struct xfrm_policy *policy) +@@ -334,7 +334,7 @@ static void xfrm_policy_kill(struct xfrm_policy *policy) { policy->walk.dead = 1; - atomic_inc(&policy->genid); + atomic_inc_unchecked(&policy->genid); - if (del_timer(&policy->timer)) - xfrm_pol_put(policy); -@@ -583,7 +583,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) + del_timer(&policy->polq.hold_timer); + xfrm_queue_purge(&policy->polq.hold_queue); +@@ -659,7 +659,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) hlist_add_head(&policy->bydst, chain); xfrm_pol_hold(policy); net->xfrm.policy_count[dir]++; - atomic_inc(&flow_cache_genid); + atomic_inc_unchecked(&flow_cache_genid); - if (delpol) - __xfrm_policy_unlink(delpol, dir); - policy->index = delpol ? delpol->index : xfrm_gen_index(net, dir); -@@ -1530,7 +1530,7 @@ free_dst: + rt_genid_bump(net); + if (delpol) { + xfrm_policy_requeue(delpol, policy); +@@ -1611,7 +1611,7 @@ free_dst: goto out; } @@ -78473,7 +89738,7 @@ index a15d2a0..12142af 100644 xfrm_dst_alloc_copy(void **target, const void *src, int size) { if (!*target) { -@@ -1542,7 +1542,7 @@ xfrm_dst_alloc_copy(void **target, const void *src, int size) +@@ -1623,7 +1623,7 @@ xfrm_dst_alloc_copy(void **target, const void *src, int size) return 0; } @@ -78482,7 +89747,7 @@ index a15d2a0..12142af 100644 xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel) { #ifdef CONFIG_XFRM_SUB_POLICY -@@ -1554,7 +1554,7 @@ xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel) +@@ -1635,7 +1635,7 @@ xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel) #endif } @@ -78491,7 +89756,7 @@ index a15d2a0..12142af 100644 xfrm_dst_update_origin(struct dst_entry *dst, const struct flowi *fl) { #ifdef CONFIG_XFRM_SUB_POLICY -@@ -1648,7 +1648,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, +@@ -1729,7 +1729,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, xdst->num_pols = num_pols; memcpy(xdst->pols, pols, sizeof(struct xfrm_policy*) * num_pols); @@ -78500,7 +89765,7 @@ index a15d2a0..12142af 100644 return xdst; } -@@ -2348,7 +2348,7 @@ static int xfrm_bundle_ok(struct xfrm_dst *first) +@@ -2598,7 +2598,7 @@ static int xfrm_bundle_ok(struct xfrm_dst *first) if (xdst->xfrm_genid != dst->xfrm->genid) return 0; if (xdst->num_pols > 0 && @@ -78509,7 +89774,32 @@ index a15d2a0..12142af 100644 return 0; mtu = dst_mtu(dst->child); -@@ -2885,7 +2885,7 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol, +@@ -2686,8 +2686,11 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) + dst_ops->link_failure = xfrm_link_failure; + if (likely(dst_ops->neigh_lookup == NULL)) + dst_ops->neigh_lookup = xfrm_neigh_lookup; +- if (likely(afinfo->garbage_collect == NULL)) +- afinfo->garbage_collect = xfrm_garbage_collect_deferred; ++ if (likely(afinfo->garbage_collect == NULL)) { ++ pax_open_kernel(); ++ *(void **)&afinfo->garbage_collect = xfrm_garbage_collect_deferred; ++ pax_close_kernel(); ++ } + rcu_assign_pointer(xfrm_policy_afinfo[afinfo->family], afinfo); + } + spin_unlock(&xfrm_policy_afinfo_lock); +@@ -2741,7 +2744,9 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo) + dst_ops->check = NULL; + dst_ops->negative_advice = NULL; + dst_ops->link_failure = NULL; +- afinfo->garbage_collect = NULL; ++ pax_open_kernel(); ++ *(void **)&afinfo->garbage_collect = NULL; ++ pax_close_kernel(); + } + return err; + } +@@ -3124,7 +3129,7 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol, sizeof(pol->xfrm_vec[i].saddr)); pol->xfrm_vec[i].encap_family = mp->new_family; /* flush bundles */ @@ -78518,8 +89808,116 @@ index a15d2a0..12142af 100644 } } +diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c +index 2c341bd..4404211 100644 +--- a/net/xfrm/xfrm_state.c ++++ b/net/xfrm/xfrm_state.c +@@ -177,12 +177,14 @@ int xfrm_register_type(const struct xfrm_type *type, unsigned short family) + + if (unlikely(afinfo == NULL)) + return -EAFNOSUPPORT; +- typemap = afinfo->type_map; ++ typemap = (const struct xfrm_type **)afinfo->type_map; + spin_lock_bh(&xfrm_type_lock); + +- if (likely(typemap[type->proto] == NULL)) ++ if (likely(typemap[type->proto] == NULL)) { ++ pax_open_kernel(); + typemap[type->proto] = type; +- else ++ pax_close_kernel(); ++ } else + err = -EEXIST; + spin_unlock_bh(&xfrm_type_lock); + xfrm_state_put_afinfo(afinfo); +@@ -198,13 +200,16 @@ int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family) + + if (unlikely(afinfo == NULL)) + return -EAFNOSUPPORT; +- typemap = afinfo->type_map; ++ typemap = (const struct xfrm_type **)afinfo->type_map; + spin_lock_bh(&xfrm_type_lock); + + if (unlikely(typemap[type->proto] != type)) + err = -ENOENT; +- else ++ else { ++ pax_open_kernel(); + typemap[type->proto] = NULL; ++ pax_close_kernel(); ++ } + spin_unlock_bh(&xfrm_type_lock); + xfrm_state_put_afinfo(afinfo); + return err; +@@ -214,7 +219,6 @@ EXPORT_SYMBOL(xfrm_unregister_type); + static const struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family) + { + struct xfrm_state_afinfo *afinfo; +- const struct xfrm_type **typemap; + const struct xfrm_type *type; + int modload_attempted = 0; + +@@ -222,9 +226,8 @@ retry: + afinfo = xfrm_state_get_afinfo(family); + if (unlikely(afinfo == NULL)) + return NULL; +- typemap = afinfo->type_map; + +- type = typemap[proto]; ++ type = afinfo->type_map[proto]; + if (unlikely(type && !try_module_get(type->owner))) + type = NULL; + if (!type && !modload_attempted) { +@@ -258,7 +261,7 @@ int xfrm_register_mode(struct xfrm_mode *mode, int family) + return -EAFNOSUPPORT; + + err = -EEXIST; +- modemap = afinfo->mode_map; ++ modemap = (struct xfrm_mode **)afinfo->mode_map; + spin_lock_bh(&xfrm_mode_lock); + if (modemap[mode->encap]) + goto out; +@@ -267,8 +270,10 @@ int xfrm_register_mode(struct xfrm_mode *mode, int family) + if (!try_module_get(afinfo->owner)) + goto out; + +- mode->afinfo = afinfo; ++ pax_open_kernel(); ++ *(const void **)&mode->afinfo = afinfo; + modemap[mode->encap] = mode; ++ pax_close_kernel(); + err = 0; + + out: +@@ -292,10 +297,12 @@ int xfrm_unregister_mode(struct xfrm_mode *mode, int family) + return -EAFNOSUPPORT; + + err = -ENOENT; +- modemap = afinfo->mode_map; ++ modemap = (struct xfrm_mode **)afinfo->mode_map; + spin_lock_bh(&xfrm_mode_lock); + if (likely(modemap[mode->encap] == mode)) { ++ pax_open_kernel(); + modemap[mode->encap] = NULL; ++ pax_close_kernel(); + module_put(mode->afinfo->owner); + err = 0; + } +diff --git a/net/xfrm/xfrm_sysctl.c b/net/xfrm/xfrm_sysctl.c +index 05a6e3d..6716ec9 100644 +--- a/net/xfrm/xfrm_sysctl.c ++++ b/net/xfrm/xfrm_sysctl.c +@@ -42,7 +42,7 @@ static struct ctl_table xfrm_table[] = { + + int __net_init xfrm_sysctl_init(struct net *net) + { +- struct ctl_table *table; ++ ctl_table_no_const *table; + + __xfrm_sysctl_init(net); + diff --git a/scripts/Makefile.build b/scripts/Makefile.build -index ff1720d..ed8475e 100644 +index 0e801c3..5c8ad3b 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -111,7 +111,7 @@ endif @@ -78617,7 +90015,7 @@ index 1ac414f..38575f7 100644 + $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) $(host-cxxshlib) $(host-cxxshobjs) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c -index cb1f50c..cef2a7c 100644 +index 7f6425e..9864506 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -161,7 +161,7 @@ static unsigned int strhash(const char *str, unsigned int sz) @@ -78662,15 +90060,15 @@ index cb1f50c..cef2a7c 100644 + unsigned int *p = (unsigned int *)test; if (*p != INT_CONF) { - fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", + fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n", diff --git a/scripts/gcc-plugin.sh b/scripts/gcc-plugin.sh new file mode 100644 -index 0000000..008ac1a +index 0000000..5e0222d --- /dev/null +++ b/scripts/gcc-plugin.sh @@ -0,0 +1,17 @@ +#!/bin/bash -+plugincc=`$1 -x c -shared - -o /dev/null -I\`$3 -print-file-name=plugin\`/include 2>&1 <<EOF ++plugincc=`$1 -E -shared - -o /dev/null -I\`$3 -print-file-name=plugin\`/include 2>&1 <<EOF +#include "gcc-plugin.h" +#include "tree.h" +#include "tm.h" @@ -78686,11 +90084,36 @@ index 0000000..008ac1a + [[ "$plugincc" =~ "$1" ]] && echo "$1" + [[ "$plugincc" =~ "$2" ]] && echo "$2" +fi +diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl +index 581ca99..a6ff02e 100644 +--- a/scripts/headers_install.pl ++++ b/scripts/headers_install.pl +@@ -35,6 +35,7 @@ foreach my $filename (@files) { + $line =~ s/([\s(])__user\s/$1/g; + $line =~ s/([\s(])__force\s/$1/g; + $line =~ s/([\s(])__iomem\s/$1/g; ++ $line =~ s/(\s?)__intentional_overflow\([-\d\s,]*\)\s?/$1/g; + $line =~ s/\s__attribute_const__\s/ /g; + $line =~ s/\s__attribute_const__$//g; + $line =~ s/\b__packed\b/__attribute__((packed))/g; +diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh +index 3d569d6..0c09522 100644 +--- a/scripts/link-vmlinux.sh ++++ b/scripts/link-vmlinux.sh +@@ -159,7 +159,7 @@ else + fi; + + # final build of init/ +-${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init ++${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init GCC_PLUGINS_CFLAGS="${GCC_PLUGINS_CFLAGS}" GCC_PLUGINS_AFLAGS="${GCC_PLUGINS_AFLAGS}" + + kallsymso="" + kallsyms_vmlinux="" diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c -index 44ddaa5..a3119bd 100644 +index 771ac17..9f0d3ee 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c -@@ -128,7 +128,7 @@ static void device_id_check(const char *modname, const char *device_id, +@@ -140,7 +140,7 @@ static void device_id_check(const char *modname, const char *device_id, unsigned long size, unsigned long id_size, void *symval) { @@ -78698,66 +90121,66 @@ index 44ddaa5..a3119bd 100644 + unsigned int i; if (size % id_size || size < id_size) { - if (cross_build != 0) -@@ -158,7 +158,7 @@ static void device_id_check(const char *modname, const char *device_id, + fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo " +@@ -168,7 +168,7 @@ static void device_id_check(const char *modname, const char *device_id, /* USB is special because the bcdDevice can be matched against a numeric range */ - /* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */ - static void do_usb_entry(struct usb_device_id *id, + /* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipNinN" */ + static void do_usb_entry(void *symval, - unsigned int bcdDevice_initial, int bcdDevice_initial_digits, + unsigned int bcdDevice_initial, unsigned int bcdDevice_initial_digits, unsigned char range_lo, unsigned char range_hi, unsigned char max, struct module *mod) { -@@ -259,7 +259,7 @@ static void do_usb_entry_multi(struct usb_device_id *id, struct module *mod) +@@ -278,7 +278,7 @@ static void do_usb_entry_multi(void *symval, struct module *mod) { unsigned int devlo, devhi; unsigned char chi, clo, max; - int ndigits; + unsigned int ndigits; - id->match_flags = TO_NATIVE(id->match_flags); - id->idVendor = TO_NATIVE(id->idVendor); -@@ -501,7 +501,7 @@ static void do_pnp_device_entry(void *symval, unsigned long size, + DEF_FIELD(symval, usb_device_id, match_flags); + DEF_FIELD(symval, usb_device_id, idVendor); +@@ -531,7 +531,7 @@ static void do_pnp_device_entry(void *symval, unsigned long size, for (i = 0; i < count; i++) { - const char *id = (char *)devs[i].id; - char acpi_id[sizeof(devs[0].id)]; + DEF_FIELD_ADDR(symval + i*id_size, pnp_device_id, id); + char acpi_id[sizeof(*id)]; - int j; + unsigned int j; buf_printf(&mod->dev_table_buf, - "MODULE_ALIAS(\"pnp:d%s*\");\n", id); -@@ -531,7 +531,7 @@ static void do_pnp_card_entries(void *symval, unsigned long size, + "MODULE_ALIAS(\"pnp:d%s*\");\n", *id); +@@ -560,7 +560,7 @@ static void do_pnp_card_entries(void *symval, unsigned long size, for (j = 0; j < PNP_MAX_DEVICES; j++) { - const char *id = (char *)card->devs[j].id; + const char *id = (char *)(*devs)[j].id; - int i2, j2; + unsigned int i2, j2; int dup = 0; if (!id[0]) -@@ -557,7 +557,7 @@ static void do_pnp_card_entries(void *symval, unsigned long size, +@@ -586,7 +586,7 @@ static void do_pnp_card_entries(void *symval, unsigned long size, /* add an individual alias for every device entry */ if (!dup) { - char acpi_id[sizeof(card->devs[0].id)]; + char acpi_id[PNP_ID_LEN]; - int k; + unsigned int k; buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"pnp:d%s*\");\n", id); -@@ -882,7 +882,7 @@ static void dmi_ascii_filter(char *d, const char *s) - static int do_dmi_entry(const char *filename, struct dmi_system_id *id, +@@ -938,7 +938,7 @@ static void dmi_ascii_filter(char *d, const char *s) + static int do_dmi_entry(const char *filename, void *symval, char *alias) { - int i, j; + unsigned int i, j; - + DEF_FIELD_ADDR(symval, dmi_system_id, matches); sprintf(alias, "dmi*"); diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c -index c4e7d15..dad16c1 100644 +index 78b30c1..536850d 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -922,6 +922,7 @@ enum mismatch { +@@ -931,6 +931,7 @@ enum mismatch { ANY_INIT_TO_ANY_EXIT, ANY_EXIT_TO_ANY_INIT, EXPORT_TO_INIT_EXIT, @@ -78765,7 +90188,7 @@ index c4e7d15..dad16c1 100644 }; struct sectioncheck { -@@ -1030,6 +1031,12 @@ const struct sectioncheck sectioncheck[] = { +@@ -1045,6 +1046,12 @@ const struct sectioncheck sectioncheck[] = { .tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL }, .mismatch = EXPORT_TO_INIT_EXIT, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, @@ -78778,7 +90201,7 @@ index c4e7d15..dad16c1 100644 } }; -@@ -1152,10 +1159,10 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr, +@@ -1167,10 +1174,10 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr, continue; if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) continue; @@ -78791,7 +90214,7 @@ index c4e7d15..dad16c1 100644 if (d < 0) d = addr - sym->st_value; if (d < distance) { -@@ -1434,6 +1441,14 @@ static void report_sec_mismatch(const char *modname, +@@ -1449,6 +1456,14 @@ static void report_sec_mismatch(const char *modname, tosym, prl_to, prl_to, tosym); free(prl_to); break; @@ -78806,7 +90229,7 @@ index c4e7d15..dad16c1 100644 } fprintf(stderr, "\n"); } -@@ -1668,7 +1683,7 @@ static void section_rel(const char *modname, struct elf_info *elf, +@@ -1683,7 +1698,7 @@ static void section_rel(const char *modname, struct elf_info *elf, static void check_sec_ref(struct module *mod, const char *modname, struct elf_info *elf) { @@ -78815,7 +90238,7 @@ index c4e7d15..dad16c1 100644 Elf_Shdr *sechdrs = elf->sechdrs; /* Walk through all sections */ -@@ -1766,7 +1781,7 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf, +@@ -1781,7 +1796,7 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf, va_end(ap); } @@ -78824,7 +90247,7 @@ index c4e7d15..dad16c1 100644 { if (buf->size - buf->pos < len) { buf->size += len + SZ; -@@ -1984,7 +1999,7 @@ static void write_if_changed(struct buffer *b, const char *fname) +@@ -1999,7 +2014,7 @@ static void write_if_changed(struct buffer *b, const char *fname) if (fstat(fileno(file), &st) < 0) goto close_write; @@ -78869,11 +90292,23 @@ index 9dfcd6d..099068e 100644 warn("writing sum in %s failed: %s\n", filename, strerror(errno)); goto out; +diff --git a/scripts/package/builddeb b/scripts/package/builddeb +index acb8650..b8c5f02 100644 +--- a/scripts/package/builddeb ++++ b/scripts/package/builddeb +@@ -246,6 +246,7 @@ fi + (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles") + (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles") + (cd $objtree; find arch/$SRCARCH/include .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles") ++(cd $objtree; find tools/gcc -name \*.so >> "$objtree/debian/hdrobjfiles") + destdir=$kernel_headers_dir/usr/src/linux-headers-$version + mkdir -p "$destdir" + (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -) diff --git a/scripts/pnmtologo.c b/scripts/pnmtologo.c -index 5c11312..72742b5 100644 +index 68bb4ef..2f419e1 100644 --- a/scripts/pnmtologo.c +++ b/scripts/pnmtologo.c -@@ -237,14 +237,14 @@ static void write_header(void) +@@ -244,14 +244,14 @@ static void write_header(void) fprintf(out, " * Linux logo %s\n", logoname); fputs(" */\n\n", out); fputs("#include <linux/linux_logo.h>\n\n", out); @@ -78890,7 +90325,7 @@ index 5c11312..72742b5 100644 fprintf(out, "\t.type\t\t= %s,\n", logo_types[logo_type]); fprintf(out, "\t.width\t\t= %d,\n", logo_width); fprintf(out, "\t.height\t\t= %d,\n", logo_height); -@@ -374,7 +374,7 @@ static void write_logo_clut224(void) +@@ -381,7 +381,7 @@ static void write_logo_clut224(void) fputs("\n};\n\n", out); /* write logo clut */ @@ -78899,11 +90334,28 @@ index 5c11312..72742b5 100644 logoname); write_hex_cnt = 0; for (i = 0; i < logo_clutsize; i++) { +diff --git a/scripts/sortextable.h b/scripts/sortextable.h +index f5eb43d..1814de8 100644 +--- a/scripts/sortextable.h ++++ b/scripts/sortextable.h +@@ -106,9 +106,9 @@ do_func(Elf_Ehdr *ehdr, char const *const fname, table_sort_t custom_sort) + const char *secstrtab; + const char *strtab; + char *extab_image; +- int extab_index = 0; +- int i; +- int idx; ++ unsigned int extab_index = 0; ++ unsigned int i; ++ unsigned int idx; + + shdr = (Elf_Shdr *)((char *)ehdr + _r(&ehdr->e_shoff)); + shstrtab_sec = shdr + r2(&ehdr->e_shstrndx); diff --git a/security/Kconfig b/security/Kconfig -index ccc61f8..0759500 100644 +index e9c6ac7..e6254cf 100644 --- a/security/Kconfig +++ b/security/Kconfig -@@ -4,6 +4,876 @@ +@@ -4,6 +4,944 @@ menu "Security options" @@ -78937,6 +90389,7 @@ index ccc61f8..0759500 100644 + select CRYPTO_SHA256 + select PROC_FS + select STOP_MACHINE ++ select TTY + help + If you say Y here, you will be able to configure many features + that will enhance the security of your system. It is highly @@ -79077,15 +90530,17 @@ index ccc61f8..0759500 100644 + help + Choose this option if performance is of highest priority for this deployment + of grsecurity. Features like UDEREF on a 64bit kernel, kernel stack clearing, -+ and freed memory sanitizing will be disabled. ++ clearing of structures intended for userland, and freed memory sanitizing will ++ be disabled. + +config GRKERNSEC_CONFIG_PRIORITY_SECURITY + bool "Security" + help + Choose this option if security is of highest priority for this deployment of -+ grsecurity. UDEREF, kernel stack clearing, and freed memory sanitizing will -+ be enabled for this kernel. In a worst-case scenario, these features can -+ introduce a 20% performance hit (UDEREF on x64 contributing half of this hit). ++ grsecurity. UDEREF, kernel stack clearing, clearing of structures intended ++ for userland, and freed memory sanitizing will be enabled for this kernel. ++ In a worst-case scenario, these features can introduce a 20% performance hit ++ (UDEREF on x64 contributing half of this hit). + +endchoice + @@ -79099,18 +90554,29 @@ index ccc61f8..0759500 100644 + Setting this GID determines which group will be exempted from + grsecurity's /proc restrictions, allowing users of the specified + group to view network statistics and the existence of other users' -+ processes on the system. ++ processes on the system. This GID may also be chosen at boot time ++ via "grsec_proc_gid=" on the kernel commandline. + -+config GRKERNSEC_TPE_GID -+ int "GID for untrusted users" -+ depends on GRKERNSEC_CONFIG_SERVER -+ default 1005 -+ help ++config GRKERNSEC_TPE_UNTRUSTED_GID ++ int "GID for TPE-untrusted users" ++ depends on GRKERNSEC_CONFIG_SERVER && GRKERNSEC_TPE && !GRKERNSEC_TPE_INVERT ++ default 1005 ++ help + Setting this GID determines which group untrusted users should + be added to. These users will be placed under grsecurity's Trusted Path + Execution mechanism, preventing them from executing their own binaries. + The users will only be able to execute binaries in directories owned and -+ writable only by the root user. ++ writable only by the root user. If the sysctl option is enabled, a sysctl ++ option with name "tpe_gid" is created. ++ ++config GRKERNSEC_TPE_TRUSTED_GID ++ int "GID for TPE-trusted users" ++ depends on GRKERNSEC_CONFIG_SERVER && GRKERNSEC_TPE && GRKERNSEC_TPE_INVERT ++ default 1005 ++ help ++ Setting this GID determines what group TPE restrictions will be ++ *disabled* for. If the sysctl option is enabled, a sysctl option ++ with name "tpe_gid" is created. + +config GRKERNSEC_SYMLINKOWN_GID + int "GID for users with kernel-enforced SymlinksIfOwnerMatch" @@ -79470,7 +90936,7 @@ index ccc61f8..0759500 100644 +config PAX_KERNEXEC + bool "Enforce non-executable kernel pages" + default y if GRKERNSEC_CONFIG_AUTO && (GRKERNSEC_CONFIG_VIRT_NONE || (GRKERNSEC_CONFIG_VIRT_EPT && GRKERNSEC_CONFIG_VIRT_GUEST) || (GRKERNSEC_CONFIG_VIRT_EPT && GRKERNSEC_CONFIG_VIRT_KVM)) -+ depends on (PPC || X86) && (!X86_32 || X86_WP_WORKS_OK) && !XEN ++ depends on (X86 || (ARM && (CPU_V6 || CPU_V7) && !(ARM_LPAE && MODULES))) && !XEN + select PAX_PER_CPU_PGD if X86_64 || (X86_32 && X86_PAE) + select PAX_KERNEXEC_PLUGIN if X86_64 + help @@ -79478,9 +90944,6 @@ index ccc61f8..0759500 100644 + that is, enabling this option will make it harder to inject + and execute 'foreign' code in kernel memory itself. + -+ Note that on x86_64 kernels there is a known regression when -+ this feature and KVM/VMX are both enabled in the host kernel. -+ +choice + prompt "Return Address Instrumentation Method" + default PAX_KERNEXEC_PLUGIN_METHOD_BTS @@ -79489,6 +90952,10 @@ index ccc61f8..0759500 100644 + Select the method used to instrument function pointer dereferences. + Note that binary modules cannot be instrumented by this approach. + ++ Note that the implementation requires a gcc with plugin support, ++ i.e., gcc 4.5 or newer. You may need to install the supporting ++ headers explicitly in addition to the normal gcc package. ++ + config PAX_KERNEXEC_PLUGIN_METHOD_BTS + bool "bts" + help @@ -79662,16 +91129,34 @@ index ccc61f8..0759500 100644 + and you are advised to test this feature on your expected workload + before deploying it. + -+ Note: full support for this feature requires gcc with plugin support -+ so make sure your compiler is at least gcc 4.5.0. Using older gcc -+ versions means that functions with large enough stack frames may -+ leave uninitialized memory behind that may be exposed to a later -+ syscall leaking the stack. ++ Note that the full feature requires a gcc with plugin support, ++ i.e., gcc 4.5 or newer. You may need to install the supporting ++ headers explicitly in addition to the normal gcc package. Using ++ older gcc versions means that functions with large enough stack ++ frames may leave uninitialized memory behind that may be exposed ++ to a later syscall leaking the stack. ++ ++config PAX_MEMORY_STRUCTLEAK ++ bool "Forcibly initialize local variables copied to userland" ++ default y if (GRKERNSEC_CONFIG_AUTO && GRKERNSEC_CONFIG_PRIORITY_SECURITY) ++ help ++ By saying Y here the kernel will zero initialize some local ++ variables that are going to be copied to userland. This in ++ turn prevents unintended information leakage from the kernel ++ stack should later code forget to explicitly set all parts of ++ the copied variable. ++ ++ The tradeoff is less performance impact than PAX_MEMORY_STACKLEAK ++ at a much smaller coverage. ++ ++ Note that the implementation requires a gcc with plugin support, ++ i.e., gcc 4.5 or newer. You may need to install the supporting ++ headers explicitly in addition to the normal gcc package. + +config PAX_MEMORY_UDEREF + bool "Prevent invalid userland pointer dereference" -+ default y if GRKERNSEC_CONFIG_AUTO && (X86_32 || (X86_64 && GRKERNSEC_CONFIG_PRIORITY_SECURITY)) && (GRKERNSEC_CONFIG_VIRT_NONE || GRKERNSEC_CONFIG_VIRT_EPT) -+ depends on X86 && !UML_X86 && !XEN ++ default y if GRKERNSEC_CONFIG_AUTO && !(X86_64 && GRKERNSEC_CONFIG_PRIORITY_PERF) && (GRKERNSEC_CONFIG_VIRT_NONE || GRKERNSEC_CONFIG_VIRT_EPT) ++ depends on (X86 || (ARM && (CPU_V6 || CPU_V7) && !ARM_LPAE)) && !UML_X86 && !XEN + select PAX_PER_CPU_PGD if X86_64 + help + By saying Y here the kernel will be prevented from dereferencing @@ -79708,10 +91193,28 @@ index ccc61f8..0759500 100644 + Since this has a negligible performance impact, you should enable + this feature. + ++config PAX_CONSTIFY_PLUGIN ++ bool "Automatically constify eligible structures" ++ default y ++ depends on !UML && PAX_KERNEXEC ++ help ++ By saying Y here the compiler will automatically constify a class ++ of types that contain only function pointers. This reduces the ++ kernel's attack surface and also produces a better memory layout. ++ ++ Note that the implementation requires a gcc with plugin support, ++ i.e., gcc 4.5 or newer. You may need to install the supporting ++ headers explicitly in addition to the normal gcc package. ++ ++ Note that if some code really has to modify constified variables ++ then the source code will have to be patched to allow it. Examples ++ can be found in PaX itself (the no_const attribute) and for some ++ out-of-tree modules at http://www.grsecurity.net/~paxguy1/ . ++ +config PAX_USERCOPY + bool "Harden heap object copies between kernel and userland" + default y if GRKERNSEC_CONFIG_AUTO -+ depends on X86 || PPC || SPARC || ARM ++ depends on ARM || IA64 || PPC || SPARC || X86 + depends on GRKERNSEC && (SLAB || SLUB || SLOB) + select PAX_USERCOPY_SLABS + help @@ -79739,6 +91242,11 @@ index ccc61f8..0759500 100644 + Since this has a negligible performance impact, you should enable + this feature. + ++config PAX_USERCOPY_DEBUG ++ bool ++ depends on X86 && PAX_USERCOPY ++ default n ++ +config PAX_SIZE_OVERFLOW + bool "Prevent various integer overflows in function size parameters" + default y if GRKERNSEC_CONFIG_AUTO @@ -79748,11 +91256,14 @@ index ccc61f8..0759500 100644 + arguments marked by a size_overflow attribute with double integer + precision (DImode/TImode for 32/64 bit integer types). + -+ The recomputed argument is checked against INT_MAX and an event ++ The recomputed argument is checked against TYPE_MAX and an event + is logged on overflow and the triggering process is killed. + -+ Homepage: -+ http://www.grsecurity.net/~ephox/overflow_plugin/ ++ Homepage: http://www.grsecurity.net/~ephox/overflow_plugin/ ++ ++ Note that the implementation requires a gcc with plugin support, ++ i.e., gcc 4.5 or newer. You may need to install the supporting ++ headers explicitly in addition to the normal gcc package. + +config PAX_LATENT_ENTROPY + bool "Generate some entropy during boot" @@ -79764,6 +91275,15 @@ index ccc61f8..0759500 100644 + there is little 'natural' source of entropy normally. The cost + is some slowdown of the boot process. + ++ When pax_extra_latent_entropy is passed on the kernel command line, ++ entropy will be extracted from up to the first 4GB of RAM while the ++ runtime memory allocator is being initialized. This costs even more ++ slowdown of the boot process. ++ ++ Note that the implementation requires a gcc with plugin support, ++ i.e., gcc 4.5 or newer. You may need to install the supporting ++ headers explicitly in addition to the normal gcc package. ++ + Note that entropy extracted this way is not cryptographically + secure! + @@ -79777,10 +91297,10 @@ index ccc61f8..0759500 100644 + +endmenu + - config KEYS - bool "Enable access key retention support" - help -@@ -169,7 +1039,7 @@ config INTEL_TXT + source security/keys/Kconfig + + config SECURITY_DMESG_RESTRICT +@@ -103,7 +1041,7 @@ config INTEL_TXT config LSM_MMAP_MIN_ADDR int "Low address space for LSM to protect from user allocation" depends on SECURITY && SECURITY_SELINUX @@ -79790,10 +91310,10 @@ index ccc61f8..0759500 100644 help This is the portion of low virtual memory which should be protected diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c -index ad05d39..afffccb 100644 +index b21830e..a7d1a17 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c -@@ -622,7 +622,7 @@ static int apparmor_task_setrlimit(struct task_struct *task, +@@ -614,7 +614,7 @@ static int apparmor_task_setrlimit(struct task_struct *task, return error; } @@ -79803,24 +91323,57 @@ index ad05d39..afffccb 100644 .ptrace_access_check = apparmor_ptrace_access_check, diff --git a/security/commoncap.c b/security/commoncap.c -index 71a166a..851bb3e 100644 +index c44b6fe..932df30 100644 --- a/security/commoncap.c +++ b/security/commoncap.c -@@ -576,6 +576,9 @@ int cap_bprm_secureexec(struct linux_binprm *bprm) - { +@@ -424,6 +424,32 @@ int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data + return 0; + } + ++/* returns: ++ 1 for suid privilege ++ 2 for sgid privilege ++ 3 for fscap privilege ++*/ ++int is_privileged_binary(const struct dentry *dentry) ++{ ++ struct cpu_vfs_cap_data capdata; ++ struct inode *inode = dentry->d_inode; ++ ++ if (!inode || S_ISDIR(inode->i_mode)) ++ return 0; ++ ++ if (inode->i_mode & S_ISUID) ++ return 1; ++ if ((inode->i_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) ++ return 2; ++ ++ if (!get_vfs_caps_from_disk(dentry, &capdata)) { ++ if (!cap_isclear(capdata.inheritable) || !cap_isclear(capdata.permitted)) ++ return 3; ++ } ++ ++ return 0; ++} ++ + /* + * Attempt to get the on-exec apply capability sets for an executable file from + * its xattrs and, if present, apply them to the proposed credentials being +@@ -592,6 +618,9 @@ int cap_bprm_secureexec(struct linux_binprm *bprm) const struct cred *cred = current_cred(); + kuid_t root_uid = make_kuid(cred->user_ns, 0); + if (gr_acl_enable_at_secure()) + return 1; + - if (cred->uid != 0) { + if (!uid_eq(cred->uid, root_uid)) { if (bprm->cap_effective) return 1; diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h -index 3ccf7ac..d73ad64 100644 +index a41c9c1..83da6dd 100644 --- a/security/integrity/ima/ima.h +++ b/security/integrity/ima/ima.h -@@ -86,8 +86,8 @@ void ima_add_violation(struct inode *inode, const unsigned char *filename, +@@ -97,8 +97,8 @@ int ima_init_crypto(void); extern spinlock_t ima_queue_lock; struct ima_h_table { @@ -79832,10 +91385,10 @@ index 3ccf7ac..d73ad64 100644 }; extern struct ima_h_table ima_htable; diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c -index 88a2788..581ab92 100644 +index 1c03e8f1..398a941 100644 --- a/security/integrity/ima/ima_api.c +++ b/security/integrity/ima/ima_api.c -@@ -75,7 +75,7 @@ void ima_add_violation(struct inode *inode, const unsigned char *filename, +@@ -79,7 +79,7 @@ void ima_add_violation(struct inode *inode, const unsigned char *filename, int result; /* can overflow, only indicator */ @@ -79845,7 +91398,7 @@ index 88a2788..581ab92 100644 entry = kmalloc(sizeof(*entry), GFP_KERNEL); if (!entry) { diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c -index e1aa2b4..52027bf 100644 +index 38477c9..87a60c7 100644 --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c @@ -28,12 +28,12 @@ @@ -79864,10 +91417,10 @@ index e1aa2b4..52027bf 100644 } diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c -index 55a6271..ad829c3 100644 +index ff63fe0..809cd96 100644 --- a/security/integrity/ima/ima_queue.c +++ b/security/integrity/ima/ima_queue.c -@@ -81,7 +81,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry) +@@ -80,7 +80,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry) INIT_LIST_HEAD(&qe->later); list_add_tail_rcu(&qe->later, &ima_measurements); @@ -79877,23 +91430,80 @@ index 55a6271..ad829c3 100644 hlist_add_head_rcu(&qe->hnext, &ima_htable.queue[key]); return 0; diff --git a/security/keys/compat.c b/security/keys/compat.c -index 4c48e13..7abdac9 100644 +index d65fa7f..cbfe366 100644 --- a/security/keys/compat.c +++ b/security/keys/compat.c -@@ -44,7 +44,7 @@ long compat_keyctl_instantiate_key_iov( +@@ -44,7 +44,7 @@ static long compat_keyctl_instantiate_key_iov( if (ret == 0) goto no_payload_free; - ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid); + ret = keyctl_instantiate_key_common(id, (const struct iovec __force_user *)iov, ioc, ret, ringid); - + err: if (iov != iovstack) kfree(iov); +diff --git a/security/keys/key.c b/security/keys/key.c +index 8fb7c7b..ba3610d 100644 +--- a/security/keys/key.c ++++ b/security/keys/key.c +@@ -284,7 +284,7 @@ struct key *key_alloc(struct key_type *type, const char *desc, + + atomic_set(&key->usage, 1); + init_rwsem(&key->sem); +- lockdep_set_class(&key->sem, &type->lock_class); ++ lockdep_set_class(&key->sem, (struct lock_class_key *)&type->lock_class); + key->type = type; + key->user = user; + key->quotalen = quotalen; +@@ -1032,7 +1032,9 @@ int register_key_type(struct key_type *ktype) + struct key_type *p; + int ret; + +- memset(&ktype->lock_class, 0, sizeof(ktype->lock_class)); ++ pax_open_kernel(); ++ memset((void *)&ktype->lock_class, 0, sizeof(ktype->lock_class)); ++ pax_close_kernel(); + + ret = -EEXIST; + down_write(&key_types_sem); +@@ -1044,7 +1046,7 @@ int register_key_type(struct key_type *ktype) + } + + /* store the type */ +- list_add(&ktype->link, &key_types_list); ++ pax_list_add((struct list_head *)&ktype->link, &key_types_list); + + pr_notice("Key type %s registered\n", ktype->name); + ret = 0; +@@ -1066,7 +1068,7 @@ EXPORT_SYMBOL(register_key_type); + void unregister_key_type(struct key_type *ktype) + { + down_write(&key_types_sem); +- list_del_init(&ktype->link); ++ pax_list_del_init((struct list_head *)&ktype->link); + downgrade_write(&key_types_sem); + key_gc_keytype(ktype); + pr_notice("Key type %s unregistered\n", ktype->name); +@@ -1084,10 +1086,10 @@ void __init key_init(void) + 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); + + /* add the special key types */ +- list_add_tail(&key_type_keyring.link, &key_types_list); +- list_add_tail(&key_type_dead.link, &key_types_list); +- list_add_tail(&key_type_user.link, &key_types_list); +- list_add_tail(&key_type_logon.link, &key_types_list); ++ pax_list_add_tail((struct list_head *)&key_type_keyring.link, &key_types_list); ++ pax_list_add_tail((struct list_head *)&key_type_dead.link, &key_types_list); ++ pax_list_add_tail((struct list_head *)&key_type_user.link, &key_types_list); ++ pax_list_add_tail((struct list_head *)&key_type_logon.link, &key_types_list); + + /* record the root user tracking */ + rb_link_node(&root_key_user.node, diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c -index fb767c6..b9c49c0 100644 +index 4b5c948..2054dc1 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c -@@ -935,7 +935,7 @@ static int keyctl_change_reqkey_auth(struct key *key) +@@ -986,7 +986,7 @@ static int keyctl_change_reqkey_auth(struct key *key) /* * Copy the iovec data from userspace */ @@ -79902,7 +91512,7 @@ index fb767c6..b9c49c0 100644 unsigned ioc) { for (; ioc > 0; ioc--) { -@@ -957,7 +957,7 @@ static long copy_from_user_iovec(void *buffer, const struct iovec *iov, +@@ -1008,7 +1008,7 @@ static long copy_from_user_iovec(void *buffer, const struct iovec *iov, * If successful, 0 will be returned. */ long keyctl_instantiate_key_common(key_serial_t id, @@ -79911,7 +91521,7 @@ index fb767c6..b9c49c0 100644 unsigned ioc, size_t plen, key_serial_t ringid) -@@ -1052,7 +1052,7 @@ long keyctl_instantiate_key(key_serial_t id, +@@ -1103,7 +1103,7 @@ long keyctl_instantiate_key(key_serial_t id, [0].iov_len = plen }; @@ -79920,25 +91530,26 @@ index fb767c6..b9c49c0 100644 } return keyctl_instantiate_key_common(id, NULL, 0, 0, ringid); -@@ -1085,7 +1085,7 @@ long keyctl_instantiate_key_iov(key_serial_t id, +@@ -1136,7 +1136,7 @@ long keyctl_instantiate_key_iov(key_serial_t id, if (ret == 0) goto no_payload_free; - ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid); + ret = keyctl_instantiate_key_common(id, (const struct iovec __force_user *)iov, ioc, ret, ringid); - + err: if (iov != iovstack) kfree(iov); diff --git a/security/keys/keyring.c b/security/keys/keyring.c -index d605f75..2bc6be9 100644 +index 6ece7f2..ecdb55c 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c -@@ -214,15 +214,15 @@ static long keyring_read(const struct key *keyring, +@@ -227,16 +227,16 @@ static long keyring_read(const struct key *keyring, ret = -EFAULT; for (loop = 0; loop < klist->nkeys; loop++) { + key_serial_t serial; - key = klist->keys[loop]; + key = rcu_deref_link_locked(klist, loop, + keyring); + serial = key->serial; tmp = sizeof(key_serial_t); @@ -79973,7 +91584,7 @@ index f728728..6457a0c 100644 /* diff --git a/security/security.c b/security/security.c -index bf619ff..cf3683f 100644 +index 03f248b..5710c33 100644 --- a/security/security.c +++ b/security/security.c @@ -20,6 +20,7 @@ @@ -79981,10 +91592,10 @@ index bf619ff..cf3683f 100644 #include <linux/evm.h> #include <linux/fsnotify.h> +#include <linux/mm.h> - #include <net/flow.h> - - #define MAX_LSM_EVM_XATTR 2 -@@ -28,8 +29,8 @@ + #include <linux/mman.h> + #include <linux/mount.h> + #include <linux/personality.h> +@@ -32,8 +33,8 @@ static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] = CONFIG_DEFAULT_SECURITY; @@ -79995,7 +91606,7 @@ index bf619ff..cf3683f 100644 .name = "default", }; -@@ -70,7 +71,9 @@ int __init security_init(void) +@@ -74,7 +75,9 @@ int __init security_init(void) void reset_security_ops(void) { @@ -80005,21 +91616,11 @@ index bf619ff..cf3683f 100644 } /* Save user chosen LSM */ -@@ -123,7 +126,9 @@ int __init register_security(struct security_operations *ops) - if (security_ops != &default_security_ops) - return -EAGAIN; - -+ pax_open_kernel(); - security_ops = ops; -+ pax_close_kernel(); - - return 0; - } diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c -index 5626222..891e275 100644 +index 7171a95..c35e879 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c -@@ -95,8 +95,6 @@ +@@ -96,8 +96,6 @@ #define NUM_SEL_MNT_OPTS 5 @@ -80028,7 +91629,7 @@ index 5626222..891e275 100644 /* SECMARK reference count */ static atomic_t selinux_secmark_refcount = ATOMIC_INIT(0); -@@ -5520,7 +5518,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer) +@@ -5498,7 +5496,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer) #endif @@ -80038,7 +91639,7 @@ index 5626222..891e275 100644 .ptrace_access_check = selinux_ptrace_access_check, diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h -index c220f31..89fab3f 100644 +index 65f67cb..3f141ef 100644 --- a/security/selinux/include/xfrm.h +++ b/security/selinux/include/xfrm.h @@ -50,7 +50,7 @@ int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall); @@ -80047,14 +91648,14 @@ index c220f31..89fab3f 100644 { - atomic_inc(&flow_cache_genid); + atomic_inc_unchecked(&flow_cache_genid); + rt_genid_bump(&init_net); } #else - static inline int selinux_xfrm_enabled(void) diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index 45c32f0..0038be2 100644 +index fa64740..bc95b74 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c -@@ -3500,7 +3500,7 @@ static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) +@@ -3392,7 +3392,7 @@ static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) return 0; } @@ -80063,11 +91664,26 @@ index 45c32f0..0038be2 100644 .name = "smack", .ptrace_access_check = smack_ptrace_access_check, +diff --git a/security/tomoyo/mount.c b/security/tomoyo/mount.c +index 390c646..f2f8db3 100644 +--- a/security/tomoyo/mount.c ++++ b/security/tomoyo/mount.c +@@ -118,6 +118,10 @@ static int tomoyo_mount_acl(struct tomoyo_request_info *r, + type == tomoyo_mounts[TOMOYO_MOUNT_MOVE]) { + need_dev = -1; /* dev_name is a directory */ + } else { ++ if (!capable(CAP_SYS_ADMIN)) { ++ error = -EPERM; ++ goto out; ++ } + fstype = get_fs_type(type); + if (!fstype) { + error = -ENODEV; diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c -index 620d37c..e2ad89b 100644 +index a2ee362..5754f34 100644 --- a/security/tomoyo/tomoyo.c +++ b/security/tomoyo/tomoyo.c -@@ -501,7 +501,7 @@ static int tomoyo_socket_sendmsg(struct socket *sock, struct msghdr *msg, +@@ -503,7 +503,7 @@ static int tomoyo_socket_sendmsg(struct socket *sock, struct msghdr *msg, * tomoyo_security_ops is a "struct security_operations" which is used for * registering TOMOYO. */ @@ -80077,7 +91693,7 @@ index 620d37c..e2ad89b 100644 .cred_alloc_blank = tomoyo_cred_alloc_blank, .cred_prepare = tomoyo_cred_prepare, diff --git a/security/yama/Kconfig b/security/yama/Kconfig -index 51d6709..1f3dbe2 100644 +index 20ef514..4182bed 100644 --- a/security/yama/Kconfig +++ b/security/yama/Kconfig @@ -1,6 +1,6 @@ @@ -80088,8 +91704,58 @@ index 51d6709..1f3dbe2 100644 select SECURITYFS select SECURITY_PATH default n +diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c +index 13c88fbc..f8c115e 100644 +--- a/security/yama/yama_lsm.c ++++ b/security/yama/yama_lsm.c +@@ -365,7 +365,7 @@ int yama_ptrace_traceme(struct task_struct *parent) + } + + #ifndef CONFIG_SECURITY_YAMA_STACKED +-static struct security_operations yama_ops = { ++static struct security_operations yama_ops __read_only = { + .name = "yama", + + .ptrace_access_check = yama_ptrace_access_check, +@@ -376,28 +376,24 @@ static struct security_operations yama_ops = { + #endif + + #ifdef CONFIG_SYSCTL ++static int zero __read_only; ++static int max_scope __read_only = YAMA_SCOPE_NO_ATTACH; ++ + static int yama_dointvec_minmax(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) + { +- int rc; ++ ctl_table_no_const yama_table; + + if (write && !capable(CAP_SYS_PTRACE)) + return -EPERM; + +- rc = proc_dointvec_minmax(table, write, buffer, lenp, ppos); +- if (rc) +- return rc; +- ++ yama_table = *table; + /* Lock the max value if it ever gets set. */ +- if (write && *(int *)table->data == *(int *)table->extra2) +- table->extra1 = table->extra2; +- +- return rc; ++ if (ptrace_scope == max_scope) ++ yama_table.extra1 = &max_scope; ++ return proc_dointvec_minmax(&yama_table, write, buffer, lenp, ppos); + } + +-static int zero; +-static int max_scope = YAMA_SCOPE_NO_ATTACH; +- + struct ctl_path yama_sysctl_path[] = { + { .procname = "kernel", }, + { .procname = "yama", }, diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c -index 270790d..c67dfcb 100644 +index 4cedc69..e59d8a3 100644 --- a/sound/aoa/codecs/onyx.c +++ b/sound/aoa/codecs/onyx.c @@ -54,7 +54,7 @@ struct onyx { @@ -80133,7 +91799,7 @@ index ffd2025..df062c9 100644 /* PCM3052 register definitions */ diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c -index 08fde00..0bf641a 100644 +index 4c1cc51..16040040 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1189,10 +1189,10 @@ snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream, const @@ -80208,7 +91874,7 @@ index 08fde00..0bf641a 100644 } } else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) { diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c -index 91cdf94..4085161 100644 +index af49721..e85058e 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -31,7 +31,7 @@ static int snd_pcm_ioctl_delay_compat(struct snd_pcm_substream *substream, @@ -80221,10 +91887,10 @@ index 91cdf94..4085161 100644 if (err < 0) return err; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c -index 3fe99e6..26952e4 100644 +index eb560fa..69a4995 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c -@@ -2770,11 +2770,11 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, +@@ -2806,11 +2806,11 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, switch (substream->stream) { case SNDRV_PCM_STREAM_PLAYBACK: result = snd_pcm_playback_ioctl1(NULL, substream, cmd, @@ -80239,7 +91905,7 @@ index 3fe99e6..26952e4 100644 default: result = -EINVAL; diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c -index 5cf8d65..912a79c 100644 +index 040c60e..989a19a 100644 --- a/sound/core/seq/seq_device.c +++ b/sound/core/seq/seq_device.c @@ -64,7 +64,7 @@ struct ops_list { @@ -80249,7 +91915,7 @@ index 5cf8d65..912a79c 100644 - struct snd_seq_dev_ops ops; + struct snd_seq_dev_ops *ops; - /* registred devices */ + /* registered devices */ struct list_head dev_list; /* list of devices */ @@ -333,7 +333,7 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry, @@ -80279,7 +91945,7 @@ index 5cf8d65..912a79c 100644 dev->driver_data = NULL; ops->num_init_devices--; diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c -index 621e60e..f4543f5 100644 +index 4e0dd22..7a1f32c 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -29,6 +29,7 @@ @@ -80352,7 +92018,7 @@ index b953fb4..1999c01 100644 int timeout = 10; while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0) diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c -index 3e32bd3..46fc152 100644 +index 991018d..8984740 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -48,6 +48,7 @@ @@ -80373,10 +92039,10 @@ index 3e32bd3..46fc152 100644 struct snd_rawmidi_substream *midi_input[PORTMAN_NUM_INPUT_PORTS]; }; diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c -index 87657dd..a8268d4 100644 +index ea995af..f1bfa37 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c -@@ -371,7 +371,7 @@ static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle) +@@ -389,7 +389,7 @@ static void queue_out_packet(struct amdtp_out_stream *s, unsigned int cycle) ptr = s->pcm_buffer_pointer + data_blocks; if (ptr >= pcm->runtime->buffer_size) ptr -= pcm->runtime->buffer_size; @@ -80385,7 +92051,7 @@ index 87657dd..a8268d4 100644 s->pcm_period_pointer += data_blocks; if (s->pcm_period_pointer >= pcm->runtime->period_size) { -@@ -511,7 +511,7 @@ EXPORT_SYMBOL(amdtp_out_stream_start); +@@ -557,7 +557,7 @@ EXPORT_SYMBOL(amdtp_out_stream_pcm_pointer); */ void amdtp_out_stream_update(struct amdtp_out_stream *s) { @@ -80395,10 +92061,10 @@ index 87657dd..a8268d4 100644 } EXPORT_SYMBOL(amdtp_out_stream_update); diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h -index 537a9cb..8e8c8e9 100644 +index b680c5e..061b7a0 100644 --- a/sound/firewire/amdtp.h +++ b/sound/firewire/amdtp.h -@@ -146,7 +146,7 @@ static inline void amdtp_out_stream_pcm_prepare(struct amdtp_out_stream *s) +@@ -139,7 +139,7 @@ static inline bool amdtp_out_streaming_error(struct amdtp_out_stream *s) static inline void amdtp_out_stream_pcm_trigger(struct amdtp_out_stream *s, struct snd_pcm_substream *pcm) { @@ -80406,7 +92072,7 @@ index 537a9cb..8e8c8e9 100644 + ACCESS_ONCE_RW(s->pcm) = pcm; } - /** + static inline bool cip_sfc_is_base_44100(enum cip_sfc sfc) diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c index d428ffe..751ef78 100644 --- a/sound/firewire/isight.c @@ -80451,24 +92117,44 @@ index d428ffe..751ef78 100644 break; default: return -EINVAL; -diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c -index 7bd5e33..1fcab12 100644 ---- a/sound/isa/cmi8330.c -+++ b/sound/isa/cmi8330.c -@@ -172,7 +172,7 @@ struct snd_cmi8330 { - - struct snd_pcm *pcm; - struct snd_cmi8330_stream { -- struct snd_pcm_ops ops; -+ snd_pcm_ops_no_const ops; - snd_pcm_open_callback_t open; - void *private_data; /* sb or wss */ - } streams[2]; +diff --git a/sound/firewire/scs1x.c b/sound/firewire/scs1x.c +index 844a555..985ab83 100644 +--- a/sound/firewire/scs1x.c ++++ b/sound/firewire/scs1x.c +@@ -74,7 +74,7 @@ static void scs_output_trigger(struct snd_rawmidi_substream *stream, int up) + { + struct scs *scs = stream->rmidi->private_data; + +- ACCESS_ONCE(scs->output) = up ? stream : NULL; ++ ACCESS_ONCE_RW(scs->output) = up ? stream : NULL; + if (up) { + scs->output_idle = false; + tasklet_schedule(&scs->tasklet); +@@ -257,7 +257,7 @@ static void scs_input_trigger(struct snd_rawmidi_substream *stream, int up) + { + struct scs *scs = stream->rmidi->private_data; + +- ACCESS_ONCE(scs->input) = up ? stream : NULL; ++ ACCESS_ONCE_RW(scs->input) = up ? stream : NULL; + } + + static void scs_input_escaped_byte(struct snd_rawmidi_substream *stream, +@@ -457,8 +457,8 @@ static int scs_remove(struct device *dev) + + snd_card_disconnect(scs->card); + +- ACCESS_ONCE(scs->output) = NULL; +- ACCESS_ONCE(scs->input) = NULL; ++ ACCESS_ONCE_RW(scs->output) = NULL; ++ ACCESS_ONCE_RW(scs->input) = NULL; + + wait_event(scs->idle_wait, scs->output_idle); + diff --git a/sound/oss/sb_audio.c b/sound/oss/sb_audio.c -index 733b014..56ce96f 100644 +index 048439a..3be9f6f 100644 --- a/sound/oss/sb_audio.c +++ b/sound/oss/sb_audio.c -@@ -901,7 +901,7 @@ sb16_copy_from_user(int dev, +@@ -904,7 +904,7 @@ sb16_copy_from_user(int dev, buf16 = (signed short *)(localbuf + localoffs); while (c) { @@ -80478,10 +92164,10 @@ index 733b014..56ce96f 100644 userbuf+useroffs + p, locallen)) diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c -index 09d4648..cf234c7 100644 +index 7d8803a..559f8d0 100644 --- a/sound/oss/swarm_cs4297a.c +++ b/sound/oss/swarm_cs4297a.c -@@ -2606,7 +2606,6 @@ static int __init cs4297a_init(void) +@@ -2621,7 +2621,6 @@ static int __init cs4297a_init(void) { struct cs4297a_state *s; u32 pwr, id; @@ -80489,7 +92175,7 @@ index 09d4648..cf234c7 100644 int rval; #ifndef CONFIG_BCM_CS4297A_CSWARM u64 cfg; -@@ -2696,22 +2695,23 @@ static int __init cs4297a_init(void) +@@ -2711,22 +2710,23 @@ static int __init cs4297a_init(void) if (!rval) { char *sb1250_duart_present; @@ -80515,72 +92201,24 @@ index 09d4648..cf234c7 100644 list_add(&s->list, &cs4297a_devs); -diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h -index 56b4f74..7cfd41a 100644 ---- a/sound/pci/hda/hda_codec.h -+++ b/sound/pci/hda/hda_codec.h -@@ -611,7 +611,7 @@ struct hda_bus_ops { - /* notify power-up/down from codec to controller */ - void (*pm_notify)(struct hda_bus *bus); - #endif --}; -+} __no_const; - - /* template to pass to the bus constructor */ - struct hda_bus_template { -@@ -713,6 +713,7 @@ struct hda_codec_ops { - #endif - void (*reboot_notify)(struct hda_codec *codec); - }; -+typedef struct hda_codec_ops __no_const hda_codec_ops_no_const; - - /* record for amp information cache */ - struct hda_cache_head { -@@ -743,7 +744,7 @@ struct hda_pcm_ops { - struct snd_pcm_substream *substream); - int (*cleanup)(struct hda_pcm_stream *info, struct hda_codec *codec, - struct snd_pcm_substream *substream); --}; -+} __no_const; - - /* PCM information for each substream */ - struct hda_pcm_stream { -@@ -801,7 +802,7 @@ struct hda_codec { - const char *modelname; /* model name for preset */ - - /* set by patch */ -- struct hda_codec_ops patch_ops; -+ hda_codec_ops_no_const patch_ops; - - /* PCM to create, set by patch_ops.build_pcms callback */ - unsigned int num_pcms; -diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h -index 0da778a..bc38b84 100644 ---- a/sound/pci/ice1712/ice1712.h -+++ b/sound/pci/ice1712/ice1712.h -@@ -269,7 +269,7 @@ struct snd_ak4xxx_private { - unsigned int mask_flags; /* total mask bits */ - struct snd_akm4xxx_ops { - void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); -- } ops; -+ } __no_const ops; - }; - - struct snd_ice1712_spdif { -@@ -285,7 +285,7 @@ struct snd_ice1712_spdif { - int (*default_put)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol); - void (*stream_get)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol); - int (*stream_put)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol); -- } ops; -+ } __no_const ops; - }; - - +diff --git a/sound/pci/ymfpci/ymfpci.h b/sound/pci/ymfpci/ymfpci.h +index 4631a23..001ae57 100644 +--- a/sound/pci/ymfpci/ymfpci.h ++++ b/sound/pci/ymfpci/ymfpci.h +@@ -358,7 +358,7 @@ struct snd_ymfpci { + spinlock_t reg_lock; + spinlock_t voice_lock; + wait_queue_head_t interrupt_sleep; +- atomic_t interrupt_sleep_count; ++ atomic_unchecked_t interrupt_sleep_count; + struct snd_info_entry *proc_entry; + const struct firmware *dsp_microcode; + const struct firmware *controller_microcode; diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c -index a8159b81..5f006a5 100644 +index 22056c5..25d3244 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c -@@ -203,8 +203,8 @@ static void snd_ymfpci_hw_stop(struct snd_ymfpci *chip) +@@ -202,8 +202,8 @@ static void snd_ymfpci_hw_stop(struct snd_ymfpci *chip) if ((snd_ymfpci_readl(chip, YDSXGR_STATUS) & 2) == 0) break; } @@ -80591,7 +92229,7 @@ index a8159b81..5f006a5 100644 wake_up(&chip->interrupt_sleep); } __end: -@@ -788,7 +788,7 @@ static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip) +@@ -787,7 +787,7 @@ static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip) continue; init_waitqueue_entry(&wait, current); add_wait_queue(&chip->interrupt_sleep, &wait); @@ -80600,7 +92238,7 @@ index a8159b81..5f006a5 100644 schedule_timeout_uninterruptible(msecs_to_jiffies(50)); remove_wait_queue(&chip->interrupt_sleep, &wait); } -@@ -826,8 +826,8 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id) +@@ -825,8 +825,8 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id) snd_ymfpci_writel(chip, YDSXGR_MODE, mode); spin_unlock(&chip->reg_lock); @@ -80611,7 +92249,7 @@ index a8159b81..5f006a5 100644 wake_up(&chip->interrupt_sleep); } } -@@ -2398,7 +2398,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card, +@@ -2421,7 +2421,7 @@ int snd_ymfpci_create(struct snd_card *card, spin_lock_init(&chip->reg_lock); spin_lock_init(&chip->voice_lock); init_waitqueue_head(&chip->interrupt_sleep); @@ -80620,40 +92258,19 @@ index a8159b81..5f006a5 100644 chip->card = card; chip->pci = pci; chip->irq = -1; -diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c -index 0ad8dca..7186339 100644 ---- a/sound/soc/soc-pcm.c -+++ b/sound/soc/soc-pcm.c -@@ -641,7 +641,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) - struct snd_soc_platform *platform = rtd->platform; - struct snd_soc_dai *codec_dai = rtd->codec_dai; - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -- struct snd_pcm_ops *soc_pcm_ops = &rtd->ops; -+ snd_pcm_ops_no_const *soc_pcm_ops = &rtd->ops; - struct snd_pcm *pcm; - char new_name[64]; - int ret = 0, playback = 0, capture = 0; -diff --git a/sound/usb/card.h b/sound/usb/card.h -index da5fa1a..113cd02 100644 ---- a/sound/usb/card.h -+++ b/sound/usb/card.h -@@ -45,6 +45,7 @@ struct snd_urb_ops { - int (*prepare_sync)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u); - int (*retire_sync)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u); - }; -+typedef struct snd_urb_ops __no_const snd_urb_ops_no_const; - - struct snd_usb_substream { - struct snd_usb_stream *stream; -@@ -94,7 +95,7 @@ struct snd_usb_substream { - struct snd_pcm_hw_constraint_list rate_list; /* limited rates */ - spinlock_t lock; - -- struct snd_urb_ops ops; /* callbacks (must be filled at init) */ -+ snd_urb_ops_no_const ops; /* callbacks (must be filled at init) */ - int last_frame_number; /* stored frame number */ - int last_delay; /* stored delay */ - }; +diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c +index 7decbd9..d17d9d0 100644 +--- a/sound/soc/fsl/fsl_ssi.c ++++ b/sound/soc/fsl/fsl_ssi.c +@@ -643,7 +643,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) + { + struct fsl_ssi_private *ssi_private; + int ret = 0; +- struct device_attribute *dev_attr = NULL; ++ device_attribute_no_const *dev_attr = NULL; + struct device_node *np = pdev->dev.of_node; + const char *p, *sprop; + const uint32_t *iprop; diff --git a/tools/gcc/.gitignore b/tools/gcc/.gitignore new file mode 100644 index 0000000..50f2f2f @@ -80663,10 +92280,10 @@ index 0000000..50f2f2f +size_overflow_hash.h diff --git a/tools/gcc/Makefile b/tools/gcc/Makefile new file mode 100644 -index 0000000..1d09b7e +index 0000000..144dbee --- /dev/null +++ b/tools/gcc/Makefile -@@ -0,0 +1,43 @@ +@@ -0,0 +1,45 @@ +#CC := gcc +#PLUGIN_SOURCE_FILES := pax_plugin.c +#PLUGIN_OBJECT_FILES := $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES)) @@ -80675,13 +92292,13 @@ index 0000000..1d09b7e + +ifeq ($(PLUGINCC),$(HOSTCC)) +HOSTLIBS := hostlibs -+HOST_EXTRACFLAGS += -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family -std=gnu99 -ggdb ++HOST_EXTRACFLAGS += -I$(GCCPLUGINS_DIR)/include -std=gnu99 -ggdb +else +HOSTLIBS := hostcxxlibs -+HOST_EXTRACXXFLAGS += -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family -std=gnu++98 -ggdb -Wno-unused-parameter ++HOST_EXTRACXXFLAGS += -I$(GCCPLUGINS_DIR)/include -std=gnu++98 -ggdb -Wno-unused-parameter +endif + -+$(HOSTLIBS)-y := constify_plugin.so ++$(HOSTLIBS)-$(CONFIG_PAX_CONSTIFY_PLUGIN) := constify_plugin.so +$(HOSTLIBS)-$(CONFIG_PAX_MEMORY_STACKLEAK) += stackleak_plugin.so +$(HOSTLIBS)-$(CONFIG_KALLOCSTAT_PLUGIN) += kallocstat_plugin.so +$(HOSTLIBS)-$(CONFIG_PAX_KERNEXEC_PLUGIN) += kernexec_plugin.so @@ -80689,6 +92306,7 @@ index 0000000..1d09b7e +$(HOSTLIBS)-y += colorize_plugin.so +$(HOSTLIBS)-$(CONFIG_PAX_SIZE_OVERFLOW) += size_overflow_plugin.so +$(HOSTLIBS)-$(CONFIG_PAX_LATENT_ENTROPY) += latent_entropy_plugin.so ++$(HOSTLIBS)-$(CONFIG_PAX_MEMORY_STRUCTLEAK) += structleak_plugin.so + +always := $($(HOSTLIBS)-y) + @@ -80700,6 +92318,7 @@ index 0000000..1d09b7e +colorize_plugin-objs := colorize_plugin.o +size_overflow_plugin-objs := size_overflow_plugin.o +latent_entropy_plugin-objs := latent_entropy_plugin.o ++structleak_plugin-objs := structleak_plugin.o + +$(obj)/size_overflow_plugin.o: $(objtree)/$(obj)/size_overflow_hash.h + @@ -80889,12 +92508,12 @@ index 0000000..d41b5af +} diff --git a/tools/gcc/colorize_plugin.c b/tools/gcc/colorize_plugin.c new file mode 100644 -index 0000000..846aeb0 +index 0000000..414fe5e --- /dev/null +++ b/tools/gcc/colorize_plugin.c -@@ -0,0 +1,148 @@ +@@ -0,0 +1,151 @@ +/* -+ * Copyright 2012 by PaX Team <pageexec@freemail.hu> ++ * Copyright 2012-2013 by PaX Team <pageexec@freemail.hu> + * Licensed under the GPL v2 + * + * Note: the choice of the license means that the compilation process is @@ -80923,7 +92542,7 @@ index 0000000..846aeb0 +int plugin_is_GPL_compatible; + +static struct plugin_info colorize_plugin_info = { -+ .version = "201203092200", ++ .version = "201302112000", + .help = NULL, +}; + @@ -81002,6 +92621,9 @@ index 0000000..846aeb0 + .pass = { + .type = SIMPLE_IPA_PASS, + .name = "colorize_rearm", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = NULL, + .execute = execute_colorize_rearm, + .sub = NULL, @@ -81043,13 +92665,13 @@ index 0000000..846aeb0 +} diff --git a/tools/gcc/constify_plugin.c b/tools/gcc/constify_plugin.c new file mode 100644 -index 0000000..048d4ff +index 0000000..bee0acb --- /dev/null +++ b/tools/gcc/constify_plugin.c -@@ -0,0 +1,328 @@ +@@ -0,0 +1,518 @@ +/* + * Copyright 2011 by Emese Revfy <re.emese@gmail.com> -+ * Copyright 2011 by PaX Team <pageexec@freemail.hu> ++ * Copyright 2011-2013 by PaX Team <pageexec@freemail.hu> + * Licensed under the GPL v2, or (at your option) v3 + * + * This gcc plugin constifies all structures which contain only function pointers or are explicitly marked for constification. @@ -81081,34 +92703,146 @@ index 0000000..048d4ff +#include "rtl.h" +#include "emit-rtl.h" +#include "tree-flow.h" ++#include "target.h" ++#include "langhooks.h" + ++// should come from c-tree.h if only it were installed for gcc 4.5... +#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE) + ++// unused type flag in all versions 4.5-4.8 ++#define TYPE_CONSTIFY_VISITED(TYPE) TYPE_LANG_FLAG_4(TYPE) ++ +int plugin_is_GPL_compatible; + +static struct plugin_info const_plugin_info = { -+ .version = "201205300030", ++ .version = "201303270300", + .help = "no-constify\tturn off constification\n", +}; + ++typedef struct { ++ bool has_fptr_field; ++ bool has_writable_field; ++ bool has_do_const_field; ++ bool has_no_const_field; ++} constify_info; ++ ++static const_tree get_field_type(const_tree field) ++{ ++ return strip_array_types(TREE_TYPE(field)); ++} ++ ++static bool is_fptr(const_tree field) ++{ ++ const_tree ptr = get_field_type(field); ++ ++ if (TREE_CODE(ptr) != POINTER_TYPE) ++ return false; ++ ++ return TREE_CODE(TREE_TYPE(ptr)) == FUNCTION_TYPE; ++} ++ ++/* ++ * determine whether the given structure type meets the requirements for automatic constification, ++ * including the constification attributes on nested structure types ++ */ ++static void constifiable(const_tree node, constify_info *cinfo) ++{ ++ const_tree field; ++ ++ gcc_assert(TREE_CODE(node) == RECORD_TYPE || TREE_CODE(node) == UNION_TYPE); ++ ++ // e.g., pointer to structure fields while still constructing the structure type ++ if (TYPE_FIELDS(node) == NULL_TREE) ++ return; ++ ++ for (field = TYPE_FIELDS(node); field; field = TREE_CHAIN(field)) { ++ const_tree type = get_field_type(field); ++ enum tree_code code = TREE_CODE(type); ++ ++ if (node == type) ++ continue; ++ ++ if (is_fptr(field)) ++ cinfo->has_fptr_field = true; ++ else if (!TREE_READONLY(field)) ++ cinfo->has_writable_field = true; ++ ++ if (code == RECORD_TYPE || code == UNION_TYPE) { ++ if (lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) ++ cinfo->has_do_const_field = true; ++ else if (lookup_attribute("no_const", TYPE_ATTRIBUTES(type))) ++ cinfo->has_no_const_field = true; ++ else ++ constifiable(type, cinfo); ++ } ++ } ++} ++ ++static bool constified(const_tree node) ++{ ++ constify_info cinfo = { ++ .has_fptr_field = false, ++ .has_writable_field = false, ++ .has_do_const_field = false, ++ .has_no_const_field = false ++ }; ++ ++ gcc_assert(TREE_CODE(node) == RECORD_TYPE || TREE_CODE(node) == UNION_TYPE); ++ ++ if (lookup_attribute("no_const", TYPE_ATTRIBUTES(node))) { ++ gcc_assert(!TYPE_READONLY(node)); ++ return false; ++ } ++ ++ if (lookup_attribute("do_const", TYPE_ATTRIBUTES(node))) { ++ gcc_assert(TYPE_READONLY(node)); ++ return true; ++ } ++ ++ constifiable(node, &cinfo); ++ if ((!cinfo.has_fptr_field || cinfo.has_writable_field) && !cinfo.has_do_const_field) ++ return false; ++ ++ return TYPE_READONLY(node); ++} ++ +static void deconstify_tree(tree node); + +static void deconstify_type(tree type) +{ + tree field; + ++ gcc_assert(TREE_CODE(type) == RECORD_TYPE || TREE_CODE(type) == UNION_TYPE); ++ + for (field = TYPE_FIELDS(type); field; field = TREE_CHAIN(field)) { -+ tree type = TREE_TYPE(field); ++ const_tree fieldtype = get_field_type(field); + -+ if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) ++ // special case handling of simple ptr-to-same-array-type members ++ if (TREE_CODE(TREE_TYPE(field)) == POINTER_TYPE) { ++ const_tree ptrtype = TREE_TYPE(TREE_TYPE(field)); ++ ++ if (TREE_CODE(ptrtype) != RECORD_TYPE && TREE_CODE(ptrtype) != UNION_TYPE) ++ continue; ++ if (TREE_TYPE(TREE_TYPE(field)) == type) ++ continue; ++ if (TYPE_MAIN_VARIANT(ptrtype) == TYPE_MAIN_VARIANT(type)) { ++ TREE_TYPE(field) = copy_node(TREE_TYPE(field)); ++ TREE_TYPE(TREE_TYPE(field)) = type; ++ } ++ continue; ++ } ++ if (TREE_CODE(fieldtype) != RECORD_TYPE && TREE_CODE(fieldtype) != UNION_TYPE) + continue; -+ if (!TYPE_READONLY(type)) ++ if (!constified(fieldtype)) + continue; + + deconstify_tree(field); ++ TREE_READONLY(field) = 0; + } + TYPE_READONLY(type) = 0; + C_TYPE_FIELDS_READONLY(type) = 0; ++ if (lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) ++ TYPE_ATTRIBUTES(type) = remove_attribute("do_const", TYPE_ATTRIBUTES(type)); +} + +static void deconstify_tree(tree node) @@ -81116,7 +92850,12 @@ index 0000000..048d4ff + tree old_type, new_type, field; + + old_type = TREE_TYPE(node); ++ while (TREE_CODE(old_type) == ARRAY_TYPE && TREE_CODE(TREE_TYPE(old_type)) != ARRAY_TYPE) { ++ node = TREE_TYPE(node) = copy_node(old_type); ++ old_type = TREE_TYPE(old_type); ++ } + ++ gcc_assert(TREE_CODE(old_type) == RECORD_TYPE || TREE_CODE(old_type) == UNION_TYPE); + gcc_assert(TYPE_READONLY(old_type) && (TYPE_QUALS(old_type) & TYPE_QUAL_CONST)); + + new_type = build_qualified_type(old_type, TYPE_QUALS(old_type) & ~TYPE_QUAL_CONST); @@ -81126,13 +92865,18 @@ index 0000000..048d4ff + + deconstify_type(new_type); + -+ TREE_READONLY(node) = 0; + TREE_TYPE(node) = new_type; +} + +static tree handle_no_const_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs) +{ + tree type; ++ constify_info cinfo = { ++ .has_fptr_field = false, ++ .has_writable_field = false, ++ .has_do_const_field = false, ++ .has_no_const_field = false ++ }; + + *no_add_attrs = true; + if (TREE_CODE(*node) == FUNCTION_DECL) { @@ -81140,21 +92884,24 @@ index 0000000..048d4ff + return NULL_TREE; + } + ++ if (TREE_CODE(*node) == PARM_DECL) { ++ error("%qE attribute does not apply to function parameters", name); ++ return NULL_TREE; ++ } ++ + if (TREE_CODE(*node) == VAR_DECL) { + error("%qE attribute does not apply to variables", name); + return NULL_TREE; + } + + if (TYPE_P(*node)) { -+ if (TREE_CODE(*node) == RECORD_TYPE || TREE_CODE(*node) == UNION_TYPE) -+ *no_add_attrs = false; -+ else -+ error("%qE attribute applies to struct and union types only", name); -+ return NULL_TREE; ++ *no_add_attrs = false; ++ type = *node; ++ } else { ++ gcc_assert(TREE_CODE(*node) == TYPE_DECL); ++ type = TREE_TYPE(*node); + } + -+ type = TREE_TYPE(*node); -+ + if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) { + error("%qE attribute applies to struct and union types only", name); + return NULL_TREE; @@ -81165,16 +92912,20 @@ index 0000000..048d4ff + return NULL_TREE; + } + -+ if (TREE_CODE(*node) == TYPE_DECL && !TYPE_READONLY(type)) { -+ error("%qE attribute used on type that is not constified", name); ++ if (TYPE_P(*node)) { ++ if (lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) ++ error("%qE attribute is incompatible with 'do_const'", name); + return NULL_TREE; + } + -+ if (TREE_CODE(*node) == TYPE_DECL) { ++ constifiable(type, &cinfo); ++ if ((cinfo.has_fptr_field && !cinfo.has_writable_field) || lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) { + deconstify_tree(*node); ++ TYPE_CONSTIFY_VISITED(TREE_TYPE(*node)) = 1; + return NULL_TREE; + } + ++ error("%qE attribute used on type that is not constified", name); + return NULL_TREE; +} + @@ -81182,6 +92933,8 @@ index 0000000..048d4ff +{ + TYPE_READONLY(type) = 1; + C_TYPE_FIELDS_READONLY(type) = 1; ++ TYPE_CONSTIFY_VISITED(type) = 1; ++// TYPE_ATTRIBUTES(type) = tree_cons(get_identifier("do_const"), NULL_TREE, TYPE_ATTRIBUTES(type)); +} + +static tree handle_do_const_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs) @@ -81197,8 +92950,17 @@ index 0000000..048d4ff + return NULL_TREE; + } + ++ if (lookup_attribute(IDENTIFIER_POINTER(name), TYPE_ATTRIBUTES(*node))) { ++ error("%qE attribute is already applied to the type", name); ++ return NULL_TREE; ++ } ++ ++ if (lookup_attribute("no_const", TYPE_ATTRIBUTES(*node))) { ++ error("%qE attribute is incompatible with 'no_const'", name); ++ return NULL_TREE; ++ } ++ + *no_add_attrs = false; -+ constify_type(*node); + return NULL_TREE; +} + @@ -81234,61 +92996,101 @@ index 0000000..048d4ff + register_attribute(&do_const_attr); +} + -+static bool is_fptr(tree field) ++static void finish_type(void *event_data, void *data) +{ -+ tree ptr = TREE_TYPE(field); ++ tree type = (tree)event_data; ++ constify_info cinfo = { ++ .has_fptr_field = false, ++ .has_writable_field = false, ++ .has_do_const_field = false, ++ .has_no_const_field = false ++ }; + -+ if (TREE_CODE(ptr) != POINTER_TYPE) -+ return false; ++ if (type == NULL_TREE || type == error_mark_node) ++ return; + -+ return TREE_CODE(TREE_TYPE(ptr)) == FUNCTION_TYPE; -+} ++ if (TYPE_FIELDS(type) == NULL_TREE || TYPE_CONSTIFY_VISITED(type)) ++ return; + -+static bool walk_struct(tree node) -+{ -+ tree field; ++ constifiable(type, &cinfo); + -+ if (TYPE_FIELDS(node) == NULL_TREE) -+ return false; ++ if (TYPE_READONLY(type) && C_TYPE_FIELDS_READONLY(type)) { ++ if (!lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) ++ return; ++ if (cinfo.has_writable_field) ++ return; ++ error("'do_const' attribute used on type that is%sconstified", cinfo.has_fptr_field ? " " : " not "); ++ return; ++ } + -+ if (lookup_attribute("no_const", TYPE_ATTRIBUTES(node))) { -+ gcc_assert(!TYPE_READONLY(node)); -+ deconstify_type(node); -+ return false; ++ if (lookup_attribute("no_const", TYPE_ATTRIBUTES(type))) { ++ if ((cinfo.has_fptr_field && !cinfo.has_writable_field) || cinfo.has_do_const_field) { ++ deconstify_type(type); ++ TYPE_CONSTIFY_VISITED(type) = 1; ++ } else ++ error("'no_const' attribute used on type that is not constified"); ++ return; + } + -+ for (field = TYPE_FIELDS(node); field; field = TREE_CHAIN(field)) { -+ tree type = TREE_TYPE(field); -+ enum tree_code code = TREE_CODE(type); -+ if (code == RECORD_TYPE || code == UNION_TYPE) { -+ if (!(walk_struct(type))) -+ return false; -+ } else if (!is_fptr(field) && !TREE_READONLY(field)) -+ return false; ++ if (lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) { ++ constify_type(type); ++ return; + } -+ return true; ++ ++ if (cinfo.has_fptr_field && !cinfo.has_writable_field) { ++ constify_type(type); ++ return; ++ } ++ ++ deconstify_type(type); ++ TYPE_CONSTIFY_VISITED(type) = 1; +} + -+static void finish_type(void *event_data, void *data) ++static unsigned int check_local_variables(void) +{ -+ tree type = (tree)event_data; ++ unsigned int ret = 0; ++ tree var; + -+ if (type == NULL_TREE) -+ return; ++#if BUILDING_GCC_VERSION == 4005 ++ tree vars; ++#else ++ unsigned int i; ++#endif + -+ if (TYPE_READONLY(type)) -+ return; ++#if BUILDING_GCC_VERSION == 4005 ++ for (vars = cfun->local_decls; vars; vars = TREE_CHAIN(vars)) { ++ var = TREE_VALUE(vars); ++#else ++ FOR_EACH_LOCAL_DECL(cfun, i, var) { ++#endif ++ tree type = TREE_TYPE(var); + -+ if (walk_struct(type)) -+ constify_type(type); -+} ++ gcc_assert(DECL_P(var)); ++ if (is_global_var(var)) ++ continue; + -+static unsigned int check_local_variables(void); ++ if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) ++ continue; ++ ++ if (!TYPE_READONLY(type) || !C_TYPE_FIELDS_READONLY(type)) ++ continue; ++ ++ if (!TYPE_CONSTIFY_VISITED(type)) ++ continue; + -+struct gimple_opt_pass pass_local_variable = { ++ error_at(DECL_SOURCE_LOCATION(var), "constified variable %qE cannot be local", var); ++ ret = 1; ++ } ++ return ret; ++} ++ ++static struct gimple_opt_pass pass_local_variable = { + { + .type = GIMPLE_PASS, + .name = "check_local_variables", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = NULL, + .execute = check_local_variables, + .sub = NULL, @@ -81303,39 +93105,43 @@ index 0000000..048d4ff + } +}; + -+static unsigned int check_local_variables(void) -+{ -+ tree var; -+ referenced_var_iterator rvi; -+ -+#if BUILDING_GCC_VERSION == 4005 -+ FOR_EACH_REFERENCED_VAR(var, rvi) { -+#else -+ FOR_EACH_REFERENCED_VAR(cfun, var, rvi) { -+#endif -+ tree type = TREE_TYPE(var); ++static struct { ++ const char *name; ++ const char *asm_op; ++} sections[] = { ++ {".init.rodata", "\t.section\t.init.rodata,\"a\""}, ++ {".ref.rodata", "\t.section\t.ref.rodata,\"a\""}, ++ {".devinit.rodata", "\t.section\t.devinit.rodata,\"a\""}, ++ {".devexit.rodata", "\t.section\t.devexit.rodata,\"a\""}, ++ {".cpuinit.rodata", "\t.section\t.cpuinit.rodata,\"a\""}, ++ {".cpuexit.rodata", "\t.section\t.cpuexit.rodata,\"a\""}, ++ {".meminit.rodata", "\t.section\t.meminit.rodata,\"a\""}, ++ {".memexit.rodata", "\t.section\t.memexit.rodata,\"a\""}, ++ {".data..read_only", "\t.section\t.data..read_only,\"a\""}, ++}; + -+ if (!DECL_P(var) || TREE_STATIC(var) || DECL_EXTERNAL(var)) -+ continue; ++static unsigned int (*old_section_type_flags)(tree decl, const char *name, int reloc); + -+ if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) -+ continue; ++static unsigned int constify_section_type_flags(tree decl, const char *name, int reloc) ++{ ++ size_t i; + -+ if (!TYPE_READONLY(type)) -+ continue; ++ for (i = 0; i < ARRAY_SIZE(sections); i++) ++ if (!strcmp(sections[i].name, name)) ++ return 0; ++ return old_section_type_flags(decl, name, reloc); ++} + -+// if (lookup_attribute("no_const", DECL_ATTRIBUTES(var))) -+// continue; ++static void constify_start_unit(void *gcc_data, void *user_data) ++{ ++// size_t i; + -+// if (lookup_attribute("no_const", TYPE_ATTRIBUTES(type))) -+// continue; ++// for (i = 0; i < ARRAY_SIZE(sections); i++) ++// sections[i].section = get_unnamed_section(0, output_section_asm_op, sections[i].asm_op); ++// sections[i].section = get_section(sections[i].name, 0, NULL); + -+ if (walk_struct(type)) { -+ error_at(DECL_SOURCE_LOCATION(var), "constified variable %qE cannot be local", var); -+ return 1; -+ } -+ } -+ return 0; ++ old_section_type_flags = targetm.section_type_flags; ++ targetm.section_type_flags = constify_section_type_flags; +} + +int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) @@ -81348,9 +93154,9 @@ index 0000000..048d4ff + + struct register_pass_info local_variable_pass_info = { + .pass = &pass_local_variable.pass, -+ .reference_pass_name = "*referenced_vars", ++ .reference_pass_name = "ssa", + .ref_pass_instance_number = 1, -+ .pos_op = PASS_POS_INSERT_AFTER ++ .pos_op = PASS_POS_INSERT_BEFORE + }; + + if (!plugin_default_version_check(version, &gcc_version)) { @@ -81366,10 +93172,16 @@ index 0000000..048d4ff + error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); + } + ++ if (strcmp(lang_hooks.name, "GNU C")) { ++ inform(UNKNOWN_LOCATION, G_("%s supports C only"), plugin_name); ++ constify = false; ++ } ++ + register_callback(plugin_name, PLUGIN_INFO, NULL, &const_plugin_info); + if (constify) { + register_callback(plugin_name, PLUGIN_FINISH_TYPE, finish_type, NULL); + register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &local_variable_pass_info); ++ register_callback(plugin_name, PLUGIN_START_UNIT, constify_start_unit, NULL); + } + register_callback(plugin_name, PLUGIN_ATTRIBUTES, register_attributes, NULL); + @@ -81377,10 +93189,10 @@ index 0000000..048d4ff +} diff --git a/tools/gcc/generate_size_overflow_hash.sh b/tools/gcc/generate_size_overflow_hash.sh new file mode 100644 -index 0000000..7d66989 +index 0000000..e518932 --- /dev/null +++ b/tools/gcc/generate_size_overflow_hash.sh -@@ -0,0 +1,96 @@ +@@ -0,0 +1,94 @@ +#!/bin/bash + +# This script generates the hash table (size_overflow_hash.h) for the size_overflow gcc plugin (size_overflow_plugin.c). @@ -81414,28 +93226,27 @@ index 0000000..7d66989 +done + +create_defines() { -+ for i in `seq 1 10` ++ for i in `seq 0 31` + do + echo -e "#define PARAM"$i" (1U << "$i")" >> "$header1" + done + echo >> "$header1" +} + -+create_structs () { ++create_structs() { + rm -f "$header1" + + create_defines + + cat "$database" | while read data + do -+ data_array=(${data// /?}) -+ data_array=(${data_array[@]//+/ }) ++ data_array=($data) + struct_hash_name="${data_array[0]}" -+ funcn="${data_array[1]//\?/ }" ++ funcn="${data_array[1]}" + params="${data_array[2]}" -+ next="${data_array[5]}" ++ next="${data_array[4]}" + -+ echo "struct size_overflow_hash $struct_hash_name = {" >> "$header1" ++ echo "const struct size_overflow_hash $struct_hash_name = {" >> "$header1" + + echo -e "\t.next\t= $next,\n\t.name\t= \"$funcn\"," >> "$header1" + echo -en "\t.param\t= " >> "$header1" @@ -81449,18 +93260,17 @@ index 0000000..7d66989 + done +} + -+create_headers () { -+ echo "struct size_overflow_hash *size_overflow_hash[$n] = {" >> "$header1" ++create_headers() { ++ echo "const struct size_overflow_hash * const size_overflow_hash[$n] = {" >> "$header1" +} + -+create_array_elements () { ++create_array_elements() { + index=0 -+ grep -v "nohasharray" $database | sort -n -t '+' -k 4 | while read data ++ grep -v "nohasharray" $database | sort -n -k 4 | while read data + do -+ data_array=(${data// /?}) -+ data_array=(${data_array//+/ }) ++ data_array=($data) + i="${data_array[3]}" -+ hash="${data_array[4]}" ++ hash="${data_array[0]}" + while [[ $index -lt $i ]] + do + echo -e "\t["$index"]\t= NULL," >> "$header1" @@ -81479,12 +93289,12 @@ index 0000000..7d66989 +exit 0 diff --git a/tools/gcc/kallocstat_plugin.c b/tools/gcc/kallocstat_plugin.c new file mode 100644 -index 0000000..a86e422 +index 0000000..568b360 --- /dev/null +++ b/tools/gcc/kallocstat_plugin.c -@@ -0,0 +1,167 @@ +@@ -0,0 +1,170 @@ +/* -+ * Copyright 2011 by the PaX Team <pageexec@freemail.hu> ++ * Copyright 2011-2013 by the PaX Team <pageexec@freemail.hu> + * Licensed under the GPL v2 + * + * Note: the choice of the license means that the compilation process is @@ -81536,7 +93346,7 @@ index 0000000..a86e422 +}; + +static struct plugin_info kallocstat_plugin_info = { -+ .version = "201111150100", ++ .version = "201302112000", +}; + +static unsigned int execute_kallocstat(void); @@ -81545,6 +93355,9 @@ index 0000000..a86e422 + .pass = { + .type = GIMPLE_PASS, + .name = "kallocstat", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = NULL, + .execute = execute_kallocstat, + .sub = NULL, @@ -81652,12 +93465,12 @@ index 0000000..a86e422 +} diff --git a/tools/gcc/kernexec_plugin.c b/tools/gcc/kernexec_plugin.c new file mode 100644 -index 0000000..98011fa +index 0000000..0408e06 --- /dev/null +++ b/tools/gcc/kernexec_plugin.c -@@ -0,0 +1,427 @@ +@@ -0,0 +1,465 @@ +/* -+ * Copyright 2011 by the PaX Team <pageexec@freemail.hu> ++ * Copyright 2011-2013 by the PaX Team <pageexec@freemail.hu> + * Licensed under the GPL v2 + * + * Note: the choice of the license means that the compilation process is @@ -81696,10 +93509,18 @@ index 0000000..98011fa +extern void print_gimple_stmt(FILE *, gimple, int, int); +extern rtx emit_move_insn(rtx x, rtx y); + ++#if BUILDING_GCC_VERSION <= 4006 ++#define ANY_RETURN_P(rtx) (GET_CODE(rtx) == RETURN) ++#endif ++ ++#if BUILDING_GCC_VERSION >= 4008 ++#define TODO_dump_func 0 ++#endif ++ +int plugin_is_GPL_compatible; + +static struct plugin_info kernexec_plugin_info = { -+ .version = "201111291120", ++ .version = "201302112000", + .help = "method=[bts|or]\tinstrumentation method\n" +}; + @@ -81715,6 +93536,9 @@ index 0000000..98011fa + .pass = { + .type = GIMPLE_PASS, + .name = "kernexec_reload", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = kernexec_cmodel_check, + .execute = execute_kernexec_reload, + .sub = NULL, @@ -81733,6 +93557,9 @@ index 0000000..98011fa + .pass = { + .type = GIMPLE_PASS, + .name = "kernexec_fptr", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = kernexec_cmodel_check, + .execute = execute_kernexec_fptr, + .sub = NULL, @@ -81751,6 +93578,9 @@ index 0000000..98011fa + .pass = { + .type = RTL_PASS, + .name = "kernexec_retaddr", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = kernexec_cmodel_check, + .execute = execute_kernexec_retaddr, + .sub = NULL, @@ -81848,8 +93678,10 @@ index 0000000..98011fa + + // create temporary unsigned long variable used for bitops and cast fptr to it + intptr = create_tmp_var(long_unsigned_type_node, "kernexec_bts"); ++#if BUILDING_GCC_VERSION <= 4007 + add_referenced_var(intptr); + mark_sym_for_renaming(intptr); ++#endif + assign_intptr = gimple_build_assign(intptr, fold_convert(long_unsigned_type_node, old_fptr)); + gsi_insert_before(gsi, assign_intptr, GSI_SAME_STMT); + update_stmt(assign_intptr); @@ -81863,8 +93695,10 @@ index 0000000..98011fa + + // cast temporary unsigned long back to a temporary fptr variable + new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_fptr"); ++#if BUILDING_GCC_VERSION <= 4007 + add_referenced_var(new_fptr); + mark_sym_for_renaming(new_fptr); ++#endif + assign_new_fptr = gimple_build_assign(new_fptr, fold_convert(TREE_TYPE(old_fptr), intptr)); + gsi_insert_before(gsi, assign_new_fptr, GSI_SAME_STMT); + update_stmt(assign_new_fptr); @@ -81878,24 +93712,36 @@ index 0000000..98011fa +{ + gimple asm_or_stmt, call_stmt; + tree old_fptr, new_fptr, input, output; ++#if BUILDING_GCC_VERSION <= 4007 + VEC(tree, gc) *inputs = NULL; + VEC(tree, gc) *outputs = NULL; ++#else ++ vec<tree, va_gc> *inputs = NULL; ++ vec<tree, va_gc> *outputs = NULL; ++#endif + + call_stmt = gsi_stmt(*gsi); + old_fptr = gimple_call_fn(call_stmt); + + // create temporary fptr variable + new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_or"); ++#if BUILDING_GCC_VERSION <= 4007 + add_referenced_var(new_fptr); + mark_sym_for_renaming(new_fptr); ++#endif + + // build asm volatile("orq %%r10, %0\n\t" : "=r"(new_fptr) : "0"(old_fptr)); + input = build_tree_list(NULL_TREE, build_string(2, "0")); + input = chainon(NULL_TREE, build_tree_list(input, old_fptr)); + output = build_tree_list(NULL_TREE, build_string(3, "=r")); + output = chainon(NULL_TREE, build_tree_list(output, new_fptr)); ++#if BUILDING_GCC_VERSION <= 4007 + VEC_safe_push(tree, gc, inputs, input); + VEC_safe_push(tree, gc, outputs, output); ++#else ++ vec_safe_push(inputs, input); ++ vec_safe_push(outputs, output); ++#endif + asm_or_stmt = gimple_build_asm_vec("orq %%r10, %0\n\t", inputs, outputs, NULL, NULL); + gimple_asm_set_volatile(asm_or_stmt, true); + gsi_insert_before(gsi, asm_or_stmt, GSI_SAME_STMT); @@ -81933,9 +93779,13 @@ index 0000000..98011fa + gcc_unreachable(); + + // ... through a function pointer -+ fn = SSA_NAME_VAR(fn); -+ if (TREE_CODE(fn) != VAR_DECL && TREE_CODE(fn) != PARM_DECL) -+ continue; ++ if (SSA_NAME_VAR(fn) != NULL_TREE) { ++ fn = SSA_NAME_VAR(fn); ++ if (TREE_CODE(fn) != VAR_DECL && TREE_CODE(fn) != PARM_DECL) { ++ debug_tree(fn); ++ gcc_unreachable(); ++ } ++ } + fn = TREE_TYPE(fn); + if (TREE_CODE(fn) != POINTER_TYPE) + continue; @@ -82000,6 +93850,7 @@ index 0000000..98011fa + for (insn = get_insns(); insn; insn = NEXT_INSN(insn)) { + // rtl match: (jump_insn 41 40 42 2 (return) fptr.c:42 634 {return_internal} (nil)) + // (jump_insn 12 9 11 2 (parallel [ (return) (unspec [ (0) ] UNSPEC_REP) ]) fptr.c:46 635 {return_internal_long} (nil)) ++ // (jump_insn 97 96 98 6 (simple_return) fptr.c:50 -1 (nil) -> simple_return) + rtx body; + + // is it a retn @@ -82008,7 +93859,7 @@ index 0000000..98011fa + body = PATTERN(insn); + if (GET_CODE(body) == PARALLEL) + body = XVECEXP(body, 0, 0); -+ if (GET_CODE(body) != RETURN) ++ if (!ANY_RETURN_P(body)) + continue; + kernexec_instrument_retaddr(insn); + } @@ -82085,12 +93936,12 @@ index 0000000..98011fa +} diff --git a/tools/gcc/latent_entropy_plugin.c b/tools/gcc/latent_entropy_plugin.c new file mode 100644 -index 0000000..b8008f7 +index 0000000..b5395ba --- /dev/null +++ b/tools/gcc/latent_entropy_plugin.c -@@ -0,0 +1,295 @@ +@@ -0,0 +1,327 @@ +/* -+ * Copyright 2012 by the PaX Team <pageexec@freemail.hu> ++ * Copyright 2012-2013 by the PaX Team <pageexec@freemail.hu> + * Licensed under the GPL v2 + * + * Note: the choice of the license means that the compilation process is @@ -82129,13 +93980,18 @@ index 0000000..b8008f7 +#include "rtl.h" +#include "emit-rtl.h" +#include "tree-flow.h" ++#include "langhooks.h" ++ ++#if BUILDING_GCC_VERSION >= 4008 ++#define TODO_dump_func 0 ++#endif + +int plugin_is_GPL_compatible; + +static tree latent_entropy_decl; + +static struct plugin_info latent_entropy_plugin_info = { -+ .version = "201207271820", ++ .version = "201303102320", + .help = NULL +}; + @@ -82146,6 +94002,9 @@ index 0000000..b8008f7 + .pass = { + .type = GIMPLE_PASS, + .name = "latent_entropy", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = gate_latent_entropy, + .execute = execute_latent_entropy, + .sub = NULL, @@ -82241,7 +94100,9 @@ index 0000000..b8008f7 + op = get_op(&rhs); + addxorrol = fold_build2_loc(UNKNOWN_LOCATION, op, unsigned_intDI_type_node, local_entropy, rhs); + assign = gimple_build_assign(local_entropy, addxorrol); ++#if BUILDING_GCC_VERSION <= 4007 + find_referenced_vars_in(assign); ++#endif +//debug_bb(bb); + gsi = gsi_after_labels(bb); + gsi_insert_before(&gsi, assign, GSI_NEW_STMT); @@ -82256,12 +94117,16 @@ index 0000000..b8008f7 + + // 1. create temporary copy of latent_entropy + temp = create_tmp_var(unsigned_intDI_type_node, "temp_latent_entropy"); ++#if BUILDING_GCC_VERSION <= 4007 + add_referenced_var(temp); + mark_sym_for_renaming(temp); ++#endif + + // 2. read... + assign = gimple_build_assign(temp, latent_entropy_decl); ++#if BUILDING_GCC_VERSION <= 4007 + find_referenced_vars_in(assign); ++#endif + gsi = gsi_after_labels(bb); + gsi_insert_after(&gsi, assign, GSI_NEW_STMT); + update_stmt(assign); @@ -82269,13 +94134,17 @@ index 0000000..b8008f7 + // 3. ...modify... + addxorrol = fold_build2_loc(UNKNOWN_LOCATION, get_op(NULL), unsigned_intDI_type_node, temp, rhs); + assign = gimple_build_assign(temp, addxorrol); ++#if BUILDING_GCC_VERSION <= 4007 + find_referenced_vars_in(assign); ++#endif + gsi_insert_after(&gsi, assign, GSI_NEW_STMT); + update_stmt(assign); + + // 4. ...write latent_entropy + assign = gimple_build_assign(latent_entropy_decl, temp); ++#if BUILDING_GCC_VERSION <= 4007 + find_referenced_vars_in(assign); ++#endif + gsi_insert_after(&gsi, assign, GSI_NEW_STMT); + update_stmt(assign); +} @@ -82290,8 +94159,13 @@ index 0000000..b8008f7 + if (!latent_entropy_decl) { + struct varpool_node *node; + ++#if BUILDING_GCC_VERSION <= 4007 + for (node = varpool_nodes; node; node = node->next) { + tree var = node->decl; ++#else ++ FOR_EACH_VARIABLE(node) { ++ tree var = node->symbol.decl; ++#endif + if (strcmp(IDENTIFIER_POINTER(DECL_NAME(var)), "latent_entropy")) + continue; + latent_entropy_decl = var; @@ -82308,8 +94182,10 @@ index 0000000..b8008f7 + + // 1. create local entropy variable + local_entropy = create_tmp_var(unsigned_intDI_type_node, "local_entropy"); ++#if BUILDING_GCC_VERSION <= 4007 + add_referenced_var(local_entropy); + mark_sym_for_renaming(local_entropy); ++#endif + + // 2. initialize local entropy variable + bb = split_block_after_labels(ENTRY_BLOCK_PTR)->dest; @@ -82319,7 +94195,9 @@ index 0000000..b8008f7 + + assign = gimple_build_assign(local_entropy, build_int_cstu(unsigned_intDI_type_node, get_random_const())); +// gimple_set_location(assign, loc); ++#if BUILDING_GCC_VERSION <= 4007 + find_referenced_vars_in(assign); ++#endif + gsi_insert_after(&gsi, assign, GSI_NEW_STMT); + update_stmt(assign); + bb = bb->next_bb; @@ -82337,6 +94215,8 @@ index 0000000..b8008f7 + +static void start_unit_callback(void *gcc_data, void *user_data) +{ ++ tree latent_entropy_type; ++ +#if BUILDING_GCC_VERSION >= 4007 + seed = get_random_seed(false); +#else @@ -82347,16 +94227,19 @@ index 0000000..b8008f7 + if (in_lto_p) + return; + -+ // extern u64 latent_entropy -+ latent_entropy_decl = build_decl(UNKNOWN_LOCATION, VAR_DECL, get_identifier("latent_entropy"), unsigned_intDI_type_node); ++ // extern volatile u64 latent_entropy ++ gcc_assert(TYPE_PRECISION(long_long_unsigned_type_node) == 64); ++ latent_entropy_type = build_qualified_type(long_long_unsigned_type_node, TYPE_QUALS(long_long_unsigned_type_node) | TYPE_QUAL_VOLATILE); ++ latent_entropy_decl = build_decl(UNKNOWN_LOCATION, VAR_DECL, get_identifier("latent_entropy"), latent_entropy_type); + + TREE_STATIC(latent_entropy_decl) = 1; + TREE_PUBLIC(latent_entropy_decl) = 1; + TREE_USED(latent_entropy_decl) = 1; + TREE_THIS_VOLATILE(latent_entropy_decl) = 1; + DECL_EXTERNAL(latent_entropy_decl) = 1; -+ DECL_ARTIFICIAL(latent_entropy_decl) = 0; ++ DECL_ARTIFICIAL(latent_entropy_decl) = 1; + DECL_INITIAL(latent_entropy_decl) = NULL; ++ lang_hooks.decls.pushdecl(latent_entropy_decl); +// DECL_ASSEMBLER_NAME(latent_entropy_decl); +// varpool_finalize_decl(latent_entropy_decl); +// varpool_mark_needed_node(latent_entropy_decl); @@ -82386,3057 +94269,5908 @@ index 0000000..b8008f7 +} diff --git a/tools/gcc/size_overflow_hash.data b/tools/gcc/size_overflow_hash.data new file mode 100644 -index 0000000..ba0e88b +index 0000000..ddd5b2e --- /dev/null +++ b/tools/gcc/size_overflow_hash.data -@@ -0,0 +1,3028 @@ -+_000001_hash alloc_dr 2 65495 _000001_hash NULL -+_000002_hash __copy_from_user 3 10918 _000002_hash NULL -+_000003_hash copy_from_user 3 17559 _000003_hash NULL -+_000004_hash __copy_from_user_inatomic 3 4365 _000004_hash NULL -+_000005_hash __copy_from_user_nocache 3 39351 _000005_hash NULL -+_000006_hash __copy_to_user_inatomic 3 19214 _000006_hash NULL -+_000007_hash do_xip_mapping_read 5 60297 _000007_hash NULL -+_000008_hash hugetlbfs_read 3 11268 _000008_hash NULL -+_000009_hash kmalloc 1 60432 _002597_hash NULL nohasharray -+_000010_hash kmalloc_array 1-2 9444 _000010_hash NULL -+_000012_hash kmalloc_slab 1 11917 _000012_hash NULL -+_000013_hash kmemdup 2 64015 _000013_hash NULL -+_000014_hash __krealloc 2 14857 _000331_hash NULL nohasharray -+_000015_hash memdup_user 2 59590 _000015_hash NULL -+_000016_hash module_alloc 1 63630 _000016_hash NULL -+_000017_hash read_default_ldt 2 14302 _000017_hash NULL -+_000018_hash read_kcore 3 63488 _000018_hash NULL -+_000019_hash read_ldt 2 47570 _000019_hash NULL -+_000020_hash read_zero 3 19366 _000020_hash NULL -+_000021_hash __vmalloc_node 1 39308 _000021_hash NULL -+_000022_hash vm_map_ram 2 23078 _001054_hash NULL nohasharray -+_000023_hash aa_simple_write_to_buffer 4-3 49683 _000023_hash NULL -+_000024_hash ablkcipher_copy_iv 3 64140 _000024_hash NULL -+_000025_hash ablkcipher_next_slow 4 47274 _000025_hash NULL -+_000026_hash acpi_battery_write_alarm 3 1240 _000026_hash NULL -+_000027_hash acpi_os_allocate 1 14892 _000027_hash NULL -+_000028_hash acpi_system_write_wakeup_device 3 34853 _000028_hash NULL -+_000029_hash adu_write 3 30487 _000029_hash NULL -+_000030_hash aer_inject_write 3 52399 _000030_hash NULL -+_000031_hash afs_alloc_flat_call 2-3 36399 _000031_hash NULL -+_000033_hash afs_proc_cells_write 3 61139 _000033_hash NULL -+_000034_hash afs_proc_rootcell_write 3 15822 _000034_hash NULL -+_000035_hash agp_3_5_isochronous_node_enable 3 49465 _000035_hash NULL -+_000036_hash agp_alloc_page_array 1 22554 _000036_hash NULL -+_000037_hash ah_alloc_tmp 2 54378 _000037_hash NULL -+_000038_hash ahash_setkey_unaligned 3 33521 _000038_hash NULL -+_000039_hash alg_setkey 3 31485 _000039_hash NULL -+_000040_hash aligned_kmalloc 1 3628 _000040_hash NULL -+_000041_hash alloc_context 1 3194 _000041_hash NULL -+_000042_hash alloc_ep_req 2 54860 _000042_hash NULL -+_000043_hash alloc_fdmem 1 27083 _000043_hash NULL -+_000044_hash alloc_flex_gd 1 57259 _000044_hash NULL -+_000045_hash alloc_sglist 1-3-2 22960 _000045_hash NULL -+_000046_hash aoedev_flush 2 44398 _000046_hash NULL -+_000047_hash append_to_buffer 3 63550 _000047_hash NULL -+_000048_hash asix_read_cmd 5 13245 _000048_hash NULL -+_000049_hash asix_write_cmd 5 58192 _000049_hash NULL -+_000050_hash asn1_octets_decode 2 9991 _000050_hash NULL -+_000051_hash asn1_oid_decode 2 4999 _000051_hash NULL -+_000052_hash at76_set_card_command 4 4471 _000052_hash NULL -+_000053_hash ath6kl_add_bss_if_needed 6 24317 _000053_hash NULL -+_000054_hash ath6kl_debug_roam_tbl_event 3 5224 _000054_hash NULL -+_000055_hash ath6kl_mgmt_powersave_ap 6 13791 _000055_hash NULL -+_000056_hash ath6kl_send_go_probe_resp 3 21113 _000056_hash NULL -+_000057_hash ath6kl_set_ap_probe_resp_ies 3 50539 _000057_hash NULL -+_000058_hash ath6kl_set_assoc_req_ies 3 43185 _000058_hash NULL -+_000059_hash ath6kl_wmi_bssinfo_event_rx 3 2275 _000059_hash NULL -+_000060_hash ath6kl_wmi_send_action_cmd 7 58860 _000060_hash NULL -+_000061_hash __ath6kl_wmi_send_mgmt_cmd 7 38971 _000061_hash NULL -+_000062_hash attach_hdlc_protocol 3 19986 _000062_hash NULL -+_000063_hash audio_write 4 54261 _001597_hash NULL nohasharray -+_000064_hash audit_unpack_string 3 13748 _000064_hash NULL -+_000065_hash av7110_vbi_write 3 34384 _000065_hash NULL -+_000066_hash ax25_setsockopt 5 42740 _000066_hash NULL -+_000067_hash b43_debugfs_write 3 34838 _000067_hash NULL -+_000068_hash b43legacy_debugfs_write 3 28556 _000068_hash NULL -+_000069_hash bch_alloc 1 4593 _000069_hash NULL -+_000070_hash befs_nls2utf 3 17163 _000070_hash NULL -+_000071_hash befs_utf2nls 3 25628 _000071_hash NULL -+_000072_hash bfad_debugfs_write_regrd 3 15218 _000072_hash NULL -+_000073_hash bfad_debugfs_write_regwr 3 61841 _000073_hash NULL -+_000074_hash bio_alloc_map_data 1-2 50782 _000074_hash NULL -+_000076_hash bio_kmalloc 2 54672 _000076_hash NULL -+_000077_hash blkcipher_copy_iv 3 24075 _000077_hash NULL -+_000078_hash blkcipher_next_slow 4 52733 _000078_hash NULL -+_000079_hash bl_pipe_downcall 3 34264 _000079_hash NULL -+_000080_hash bnad_debugfs_write_regrd 3 6706 _000080_hash NULL -+_000081_hash bnad_debugfs_write_regwr 3 57500 _000081_hash NULL -+_000082_hash bnx2fc_cmd_mgr_alloc 2-3 24873 _000082_hash NULL -+_000084_hash bnx2_nvram_write 4 7790 _000084_hash NULL -+_000085_hash brcmf_sdbrcm_downloadvars 3 42064 _000085_hash NULL -+_000086_hash btmrvl_gpiogap_write 3 35053 _000086_hash NULL -+_000087_hash btmrvl_hscfgcmd_write 3 27143 _000087_hash NULL -+_000088_hash btmrvl_hscmd_write 3 27089 _000088_hash NULL -+_000089_hash btmrvl_hsmode_write 3 42252 _000089_hash NULL -+_000090_hash btmrvl_pscmd_write 3 29504 _000090_hash NULL -+_000091_hash btmrvl_psmode_write 3 3703 _000091_hash NULL -+_000092_hash btrfs_alloc_delayed_item 1 11678 _000092_hash NULL -+_000093_hash cache_do_downcall 3 6926 _000093_hash NULL -+_000094_hash cachefiles_cook_key 2 33274 _000094_hash NULL -+_000095_hash cachefiles_daemon_write 3 43535 _000095_hash NULL -+_000096_hash capi_write 3 35104 _000096_hash NULL -+_000097_hash carl9170_debugfs_write 3 50857 _000097_hash NULL -+_000098_hash cciss_allocate_sg_chain_blocks 2-3 5368 _000098_hash NULL -+_000100_hash cciss_proc_write 3 10259 _000100_hash NULL -+_000101_hash cdrom_read_cdda_old 4 27664 _000101_hash NULL -+_000102_hash ceph_alloc_page_vector 1 18710 _000102_hash NULL -+_000103_hash ceph_buffer_new 1 35974 _000103_hash NULL -+_000104_hash ceph_copy_user_to_page_vector 4 656 _000104_hash NULL -+_000105_hash ceph_get_direct_page_vector 2 41917 _000105_hash NULL -+_000106_hash ceph_msg_new 2 5846 _000106_hash NULL -+_000107_hash ceph_setxattr 4 18913 _000107_hash NULL -+_000108_hash cfi_read_pri 3 24366 _000108_hash NULL -+_000109_hash cgroup_write_string 5 10900 _000109_hash NULL -+_000110_hash cgroup_write_X64 5 54514 _000110_hash NULL -+_000111_hash change_xattr 5 61390 _000111_hash NULL -+_000112_hash check_load_and_stores 2 2143 _000112_hash NULL -+_000113_hash cifs_idmap_key_instantiate 3 54503 _000113_hash NULL -+_000114_hash cifs_security_flags_proc_write 3 5484 _000114_hash NULL -+_000115_hash cifs_setxattr 4 23957 _000115_hash NULL -+_000116_hash cifs_spnego_key_instantiate 3 23588 _000116_hash NULL -+_000117_hash ci_ll_write 4 3740 _000117_hash NULL -+_000118_hash cld_pipe_downcall 3 15058 _000118_hash NULL -+_000119_hash clear_refs_write 3 61904 _000119_hash NULL -+_000120_hash clusterip_proc_write 3 44729 _000120_hash NULL -+_000121_hash cm4040_write 3 58079 _000121_hash NULL -+_000122_hash cm_copy_private_data 2 3649 _000122_hash NULL -+_000123_hash cmm_write 3 2896 _000123_hash NULL -+_000124_hash cm_write 3 36858 _000124_hash NULL -+_000125_hash coda_psdev_write 3 1711 _000125_hash NULL -+_000126_hash codec_reg_read_file 3 36280 _000126_hash NULL -+_000127_hash command_file_write 3 31318 _000127_hash NULL -+_000128_hash command_write 3 58841 _000128_hash NULL -+_000129_hash comm_write 3 44537 _001532_hash NULL nohasharray -+_000130_hash concat_writev 3 21451 _000130_hash NULL -+_000131_hash copy_and_check 3 19089 _000131_hash NULL -+_000132_hash copy_from_user_toio 3 31966 _000132_hash NULL -+_000133_hash copy_items 6 50140 _000133_hash NULL -+_000134_hash copy_macs 4 45534 _000134_hash NULL -+_000135_hash __copy_to_user 3 17551 _000135_hash NULL -+_000136_hash copy_vm86_regs_from_user 3 45340 _000136_hash NULL -+_000137_hash cosa_write 3 1774 _000137_hash NULL -+_000138_hash create_entry 2 33479 _000138_hash NULL -+_000139_hash create_queues 2-3 9088 _000139_hash NULL -+_000141_hash create_xattr 5 54106 _000141_hash NULL -+_000142_hash create_xattr_datum 5 33356 _000142_hash NULL -+_000143_hash csum_partial_copy_fromiovecend 3-4 9957 _000143_hash NULL -+_000145_hash ctrl_out 3-5 8712 _000145_hash NULL -+_000147_hash cx24116_writeregN 4 41975 _000147_hash NULL -+_000148_hash cxacru_cm_get_array 4 4412 _000148_hash NULL -+_000149_hash cxgbi_alloc_big_mem 1 4707 _000149_hash NULL -+_000150_hash dac960_user_command_proc_write 3 3071 _000150_hash NULL -+_000151_hash datablob_format 2 39571 _002156_hash NULL nohasharray -+_000152_hash dccp_feat_clone_sp_val 3 11942 _000152_hash NULL -+_000153_hash dccp_setsockopt_ccid 4 30701 _000153_hash NULL -+_000154_hash dccp_setsockopt_cscov 2 37766 _000154_hash NULL -+_000155_hash dccp_setsockopt_service 4 65336 _000155_hash NULL -+_000156_hash ddb_output_write 3 31902 _000156_hash NULL -+_000157_hash ddebug_proc_write 3 18055 _000157_hash NULL -+_000158_hash dev_config 3 8506 _000158_hash NULL -+_000159_hash device_write 3 45156 _000159_hash NULL -+_000160_hash devm_kzalloc 2 4966 _000160_hash NULL -+_000161_hash devres_alloc 2 551 _000161_hash NULL -+_000162_hash dfs_file_write 3 41196 _000162_hash NULL -+_000163_hash direct_entry 3 38836 _000163_hash NULL -+_000164_hash dispatch_proc_write 3 44320 _000164_hash NULL -+_000165_hash diva_os_copy_from_user 4 7792 _000165_hash NULL -+_000166_hash dlm_alloc_pagevec 1 54296 _000166_hash NULL -+_000167_hash dlmfs_file_read 3 28385 _000167_hash NULL -+_000168_hash dlmfs_file_write 3 6892 _000168_hash NULL -+_000169_hash dm_read 3 15674 _000169_hash NULL -+_000170_hash dm_write 3 2513 _000170_hash NULL -+_000171_hash __dn_setsockopt 5 13060 _000171_hash NULL -+_000172_hash dns_query 3 9676 _000172_hash NULL -+_000173_hash dns_resolver_instantiate 3 63314 _000173_hash NULL -+_000174_hash do_add_counters 3 3992 _000174_hash NULL -+_000175_hash __do_config_autodelink 3 58763 _000175_hash NULL -+_000176_hash do_ip_setsockopt 5 41852 _000176_hash NULL -+_000177_hash do_ipv6_setsockopt 5 18215 _000177_hash NULL -+_000178_hash do_ip_vs_set_ctl 4 48641 _000178_hash NULL -+_000179_hash do_kimage_alloc 3 64827 _000179_hash NULL -+_000180_hash do_register_entry 4 29478 _000180_hash NULL -+_000181_hash do_tty_write 5 44896 _000181_hash NULL -+_000182_hash do_update_counters 4 2259 _000182_hash NULL -+_000183_hash dsp_write 2 46218 _000183_hash NULL -+_000184_hash dup_to_netobj 3 26363 _000184_hash NULL -+_000185_hash dvb_aplay 3 56296 _000185_hash NULL -+_000186_hash dvb_ca_en50221_io_write 3 43533 _000186_hash NULL -+_000187_hash dvbdmx_write 3 19423 _000187_hash NULL -+_000188_hash dvb_play 3 50814 _000188_hash NULL -+_000189_hash dw210x_op_rw 6 39915 _000189_hash NULL -+_000190_hash dwc3_link_state_write 3 12641 _000190_hash NULL -+_000191_hash dwc3_mode_write 3 51997 _000191_hash NULL -+_000192_hash dwc3_testmode_write 3 30516 _000192_hash NULL -+_000193_hash ecryptfs_copy_filename 4 11868 _000193_hash NULL -+_000194_hash ecryptfs_miscdev_write 3 26847 _000194_hash NULL -+_000195_hash ecryptfs_send_miscdev 2 64816 _000195_hash NULL -+_000196_hash efx_tsoh_heap_alloc 2 58545 _000196_hash NULL -+_000197_hash emi26_writememory 4 57908 _000197_hash NULL -+_000198_hash emi62_writememory 4 29731 _000198_hash NULL -+_000199_hash encrypted_instantiate 3 3168 _000199_hash NULL -+_000200_hash encrypted_update 3 13414 _000200_hash NULL -+_000201_hash ep0_write 3 14536 _001328_hash NULL nohasharray -+_000202_hash ep_read 3 58813 _000202_hash NULL -+_000203_hash ep_write 3 59008 _000203_hash NULL -+_000204_hash erst_dbg_write 3 46715 _000204_hash NULL -+_000205_hash esp_alloc_tmp 2 40558 _000205_hash NULL -+_000206_hash exofs_read_lookup_dev_table 3 17733 _000206_hash NULL -+_000207_hash ext4_kvmalloc 1 14796 _000207_hash NULL -+_000208_hash ezusb_writememory 4 45976 _000208_hash NULL -+_000209_hash fanotify_write 3 64623 _000209_hash NULL -+_000210_hash fd_copyin 3 56247 _000210_hash NULL -+_000211_hash ffs_epfile_io 3 64886 _000211_hash NULL -+_000212_hash ffs_prepare_buffer 2 59892 _000212_hash NULL -+_000213_hash f_hidg_write 3 7932 _000213_hash NULL -+_000214_hash file_read_actor 4 1401 _000214_hash NULL -+_000215_hash fill_write_buffer 3 3142 _000215_hash NULL -+_000216_hash fl_create 5 56435 _000216_hash NULL -+_000217_hash ftdi_elan_write 3 57309 _000217_hash NULL -+_000218_hash fuse_conn_limit_write 3 30777 _000218_hash NULL -+_000219_hash fw_iso_buffer_init 3 54582 _000219_hash NULL -+_000220_hash garmin_write_bulk 3 58191 _000220_hash NULL -+_000221_hash garp_attr_create 3 3883 _000221_hash NULL -+_000222_hash get_arg 3 5694 _000222_hash NULL -+_000223_hash getdqbuf 1 62908 _000223_hash NULL -+_000224_hash get_fdb_entries 3 41916 _000224_hash NULL -+_000225_hash get_indirect_ea 4 51869 _000225_hash NULL -+_000226_hash get_registers 3 26187 _000226_hash NULL -+_000227_hash get_scq 2 10897 _000227_hash NULL -+_000228_hash get_server_iovec 2 16804 _000228_hash NULL -+_000229_hash get_ucode_user 3 38202 _000229_hash NULL -+_000230_hash get_user_cpu_mask 2 14861 _000230_hash NULL -+_000231_hash gfs2_alloc_sort_buffer 1 18275 _000231_hash NULL -+_000232_hash gfs2_glock_nq_m 1 20347 _000232_hash NULL -+_000233_hash gigaset_initcs 2 43753 _000233_hash NULL -+_000234_hash gigaset_initdriver 2 1060 _000234_hash NULL -+_000235_hash gs_alloc_req 2 58883 _000235_hash NULL -+_000236_hash gs_buf_alloc 2 25067 _000236_hash NULL -+_000237_hash gsm_data_alloc 3 42437 _000237_hash NULL -+_000238_hash gss_pipe_downcall 3 23182 _000238_hash NULL -+_000239_hash handle_request 9 10024 _000239_hash NULL -+_000240_hash hash_new 1 62224 _000240_hash NULL -+_000241_hash hashtab_create 3 33769 _000241_hash NULL -+_000242_hash hcd_buffer_alloc 2 27495 _000242_hash NULL -+_000243_hash hci_sock_setsockopt 5 28993 _000243_hash NULL -+_000244_hash heap_init 2 49617 _000244_hash NULL -+_000245_hash hest_ghes_dev_register 1 46766 _000245_hash NULL -+_000246_hash hidraw_get_report 3 45609 _000246_hash NULL -+_000247_hash hidraw_report_event 3 49578 _000509_hash NULL nohasharray -+_000248_hash hidraw_send_report 3 23449 _000248_hash NULL -+_000249_hash hpfs_translate_name 3 41497 _000249_hash NULL -+_000250_hash hysdn_conf_write 3 52145 _000250_hash NULL -+_000251_hash hysdn_log_write 3 48694 _000251_hash NULL -+_000252_hash __i2400mu_send_barker 3 23652 _000252_hash NULL -+_000253_hash i2cdev_read 3 1206 _000253_hash NULL -+_000254_hash i2cdev_write 3 23310 _000254_hash NULL -+_000255_hash i2o_parm_field_get 5 34477 _000255_hash NULL -+_000256_hash i2o_parm_table_get 6 61635 _000256_hash NULL -+_000257_hash ib_copy_from_udata 3 59502 _000257_hash NULL -+_000258_hash ib_ucm_alloc_data 3 36885 _000258_hash NULL -+_000259_hash ib_umad_write 3 47993 _000259_hash NULL -+_000260_hash ib_uverbs_unmarshall_recv 5 12251 _000260_hash NULL -+_000261_hash icn_writecmd 2 38629 _000261_hash NULL -+_000262_hash ide_driver_proc_write 3 32493 _000262_hash NULL -+_000263_hash ide_settings_proc_write 3 35110 _000263_hash NULL -+_000264_hash idetape_chrdev_write 3 53976 _000264_hash NULL -+_000265_hash idmap_pipe_downcall 3 14591 _000265_hash NULL -+_000266_hash ieee80211_build_probe_req 7 27660 _000266_hash NULL -+_000267_hash ieee80211_if_write 3 34894 _000267_hash NULL -+_000268_hash if_write 3 51756 _000268_hash NULL -+_000269_hash ilo_write 3 64378 _000269_hash NULL -+_000270_hash ima_write_policy 3 40548 _000270_hash NULL -+_000271_hash init_data_container 1 60709 _000271_hash NULL -+_000272_hash init_send_hfcd 1 34586 _000272_hash NULL -+_000273_hash insert_dent 7 65034 _000273_hash NULL -+_000274_hash interpret_user_input 2 19393 _000274_hash NULL -+_000275_hash int_proc_write 3 39542 _000275_hash NULL -+_000276_hash ioctl_private_iw_point 7 1273 _000276_hash NULL -+_000277_hash iov_iter_copy_from_user 4 31942 _000277_hash NULL -+_000278_hash iov_iter_copy_from_user_atomic 4 56368 _000278_hash NULL -+_000279_hash iowarrior_write 3 18604 _000279_hash NULL -+_000280_hash ipc_alloc 1 1192 _000280_hash NULL -+_000281_hash ipc_rcu_alloc 1 21208 _000281_hash NULL -+_000282_hash ip_options_get_from_user 4 64958 _000282_hash NULL -+_000283_hash ipv6_renew_option 3 38813 _000283_hash NULL -+_000284_hash ip_vs_conn_fill_param_sync 6 29771 _002404_hash NULL nohasharray -+_000285_hash ip_vs_create_timeout_table 2 64478 _000285_hash NULL -+_000286_hash ipw_queue_tx_init 3 49161 _000286_hash NULL -+_000287_hash irda_setsockopt 5 19824 _000287_hash NULL -+_000288_hash irias_new_octseq_value 2 13596 _000288_hash NULL -+_000289_hash ir_lirc_transmit_ir 3 64403 _000289_hash NULL -+_000290_hash irnet_ctrl_write 3 24139 _000290_hash NULL -+_000291_hash isdn_add_channels 3 40905 _000291_hash NULL -+_000292_hash isdn_ppp_fill_rq 2 41428 _000292_hash NULL -+_000293_hash isdn_ppp_write 4 29109 _000293_hash NULL -+_000294_hash isdn_read 3 50021 _000294_hash NULL -+_000295_hash isdn_v110_open 3 2418 _000295_hash NULL -+_000296_hash isdn_writebuf_stub 4 52383 _000296_hash NULL -+_000297_hash islpci_mgt_transmit 5 34133 _000297_hash NULL -+_000298_hash iso_callback 3 43208 _000298_hash NULL -+_000299_hash iso_packets_buffer_init 3 29061 _000299_hash NULL -+_000300_hash it821x_firmware_command 3 8628 _000300_hash NULL -+_000301_hash ivtv_buf_copy_from_user 4 25502 _000301_hash NULL -+_000302_hash iwch_alloc_fastreg_pbl 2 40153 _000302_hash NULL -+_000303_hash iwl_calib_set 3 34400 _002188_hash NULL nohasharray -+_000304_hash jbd2_journal_init_revoke_table 1 36336 _000304_hash NULL -+_000305_hash jffs2_alloc_full_dirent 1 60179 _001111_hash NULL nohasharray -+_000306_hash journal_init_revoke_table 1 56331 _000306_hash NULL -+_000307_hash kcalloc 1-2 27770 _000307_hash NULL -+_000309_hash keyctl_instantiate_key_common 4 47889 _000309_hash NULL -+_000310_hash keyctl_update_key 3 26061 _000310_hash NULL -+_000311_hash __kfifo_alloc 2-3 22173 _000311_hash NULL -+_000313_hash kfifo_copy_from_user 3 5091 _000313_hash NULL -+_000314_hash kmalloc_node 1 50163 _000314_hash NULL -+_000315_hash kmalloc_parameter 1 65279 _000315_hash NULL -+_000316_hash kmem_alloc 1 31920 _000316_hash NULL -+_000317_hash kobj_map 2-3 9566 _000317_hash NULL -+_000319_hash kone_receive 4 4690 _000319_hash NULL -+_000320_hash kone_send 4 63435 _000320_hash NULL -+_000321_hash krealloc 2 14908 _000321_hash NULL -+_000322_hash kvmalloc 1 32646 _000322_hash NULL -+_000323_hash kvm_read_guest_atomic 4 10765 _000323_hash NULL -+_000324_hash kvm_read_guest_cached 4 39666 _000324_hash NULL -+_000325_hash kvm_read_guest_page 5 18074 _000325_hash NULL -+_000326_hash kzalloc 1 54740 _000326_hash NULL -+_000327_hash l2cap_sock_setsockopt 5 50207 _000327_hash NULL -+_000328_hash l2cap_sock_setsockopt_old 4 29346 _000328_hash NULL -+_000329_hash lane2_associate_req 4 45398 _000329_hash NULL -+_000330_hash lbs_debugfs_write 3 48413 _000330_hash NULL -+_000331_hash lcd_write 3 14857 _000331_hash &_000014_hash -+_000332_hash ldm_frag_add 2 5611 _000332_hash NULL -+_000333_hash __lgread 4 31668 _000333_hash NULL -+_000334_hash libipw_alloc_txb 1-3-2 27579 _000334_hash NULL -+_000335_hash link_send_sections_long 4 46556 _000335_hash NULL -+_000336_hash listxattr 3 12769 _000336_hash NULL -+_000337_hash LoadBitmap 2 19658 _000337_hash NULL -+_000338_hash load_msg 2 95 _000338_hash NULL -+_000339_hash lpfc_debugfs_dif_err_write 3 17424 _000339_hash NULL -+_000340_hash lp_write 3 9511 _000340_hash NULL -+_000341_hash mb_cache_create 2 17307 _000341_hash NULL -+_000342_hash mce_write 3 26201 _000342_hash NULL -+_000343_hash mcs7830_get_reg 3 33308 _000343_hash NULL -+_000344_hash mcs7830_set_reg 3 31413 _000344_hash NULL -+_000345_hash memcpy_fromiovec 3 55247 _000345_hash NULL -+_000346_hash memcpy_fromiovecend 3-4 2707 _000346_hash NULL -+_000348_hash mempool_kmalloc 2 53831 _000348_hash NULL -+_000349_hash mempool_resize 2 47983 _001821_hash NULL nohasharray -+_000350_hash mem_rw 3 22085 _000350_hash NULL -+_000351_hash mgmt_control 3 7349 _000351_hash NULL -+_000352_hash mgmt_pending_add 5 46976 _000352_hash NULL -+_000353_hash mlx4_ib_alloc_fast_reg_page_list 2 46119 _000353_hash NULL -+_000354_hash mmc_alloc_sg 1 21504 _000354_hash NULL -+_000355_hash mmc_send_bus_test 4 18285 _000355_hash NULL -+_000356_hash mmc_send_cxd_data 5 38655 _000356_hash NULL -+_000357_hash module_alloc_update_bounds 1 47205 _000357_hash NULL -+_000358_hash move_addr_to_kernel 2 32673 _000358_hash NULL -+_000359_hash mpi_alloc_limb_space 1 23190 _000359_hash NULL -+_000360_hash mpi_resize 2 44674 _000360_hash NULL -+_000361_hash mptctl_getiocinfo 2 28545 _000361_hash NULL -+_000362_hash mtdchar_readoob 4 31200 _000362_hash NULL -+_000363_hash mtdchar_write 3 56831 _002688_hash NULL nohasharray -+_000364_hash mtdchar_writeoob 4 3393 _000364_hash NULL -+_000365_hash mtd_device_parse_register 5 5024 _000365_hash NULL -+_000366_hash mtf_test_write 3 18844 _000366_hash NULL -+_000367_hash mtrr_write 3 59622 _000367_hash NULL -+_000368_hash musb_test_mode_write 3 33518 _000368_hash NULL -+_000369_hash mwifiex_get_common_rates 3 17131 _000369_hash NULL -+_000370_hash mwifiex_update_curr_bss_params 5 16908 _000370_hash NULL -+_000371_hash nand_bch_init 2-3 16280 _001341_hash NULL nohasharray -+_000373_hash ncp_file_write 3 3813 _000373_hash NULL -+_000374_hash ncp__vol2io 5 4804 _000374_hash NULL -+_000375_hash nes_alloc_fast_reg_page_list 2 33523 _000375_hash NULL -+_000376_hash nfc_targets_found 3 29886 _000376_hash NULL -+_000377_hash nfs4_acl_new 1 49806 _000377_hash NULL -+_000378_hash nfs4_write_cached_acl 4 15070 _000378_hash NULL -+_000379_hash nfsd_cache_update 3 59574 _000379_hash NULL -+_000380_hash nfsd_symlink 6 63442 _000380_hash NULL -+_000381_hash nfs_idmap_get_desc 2-4 42990 _000381_hash NULL -+_000383_hash nfs_readdir_make_qstr 3 12509 _000383_hash NULL -+_000384_hash note_last_dentry 3 12285 _000384_hash NULL -+_000385_hash ntfs_copy_from_user 3-5 15072 _000385_hash NULL -+_000387_hash __ntfs_copy_from_user_iovec_inatomic 3-4 38153 _000387_hash NULL -+_000389_hash ntfs_ucstonls 3 23097 _000389_hash NULL -+_000390_hash nvme_alloc_iod 1 56027 _000390_hash NULL -+_000391_hash nvram_write 3 3894 _000391_hash NULL -+_000392_hash o2hb_debug_create 4 18744 _000392_hash NULL -+_000393_hash o2net_send_message_vec 4 879 _001792_hash NULL nohasharray -+_000394_hash ocfs2_control_cfu 2 37750 _000394_hash NULL -+_000395_hash oom_adjust_write 3 41116 _000395_hash NULL -+_000396_hash oom_score_adj_write 3 42594 _000396_hash NULL -+_000397_hash opera1_xilinx_rw 5 31453 _000397_hash NULL -+_000398_hash oprofilefs_ulong_from_user 3 57251 _000398_hash NULL -+_000399_hash opticon_write 4 60775 _000399_hash NULL -+_000400_hash orig_node_add_if 2 32833 _000400_hash NULL -+_000401_hash orig_node_del_if 2 28371 _000401_hash NULL -+_000402_hash p9_check_zc_errors 4 15534 _000402_hash NULL -+_000403_hash packet_buffer_init 2 1607 _000403_hash NULL -+_000404_hash packet_setsockopt 5 17662 _000404_hash NULL -+_000405_hash parse_command 2 37079 _000405_hash NULL -+_000406_hash pcbit_writecmd 2 12332 _000406_hash NULL -+_000407_hash pcmcia_replace_cis 3 57066 _000407_hash NULL -+_000408_hash pgctrl_write 3 50453 _000408_hash NULL -+_000409_hash pg_write 3 40766 _000409_hash NULL -+_000410_hash pidlist_allocate 1 64404 _000410_hash NULL -+_000411_hash pipe_iov_copy_from_user 3 23102 _000411_hash NULL -+_000412_hash pipe_iov_copy_to_user 3 3447 _000412_hash NULL -+_000413_hash pkt_add 3 39897 _000413_hash NULL -+_000414_hash pktgen_if_write 3 55628 _000414_hash NULL -+_000415_hash platform_device_add_data 3 310 _000415_hash NULL -+_000416_hash platform_device_add_resources 3 13289 _000416_hash NULL -+_000417_hash pm_qos_power_write 3 52513 _000417_hash NULL -+_000418_hash pnpbios_proc_write 3 19758 _000418_hash NULL -+_000419_hash pool_allocate 3 42012 _000419_hash NULL -+_000420_hash posix_acl_alloc 1 48063 _000420_hash NULL -+_000421_hash ppp_cp_parse_cr 4 5214 _000421_hash NULL -+_000422_hash ppp_write 3 34034 _000422_hash NULL -+_000423_hash pp_read 3 33210 _000423_hash NULL -+_000424_hash pp_write 3 39554 _000424_hash NULL -+_000425_hash printer_req_alloc 2 62687 _001807_hash NULL nohasharray -+_000426_hash printer_write 3 60276 _000426_hash NULL -+_000427_hash prism2_set_genericelement 3 29277 _000427_hash NULL -+_000428_hash __probe_kernel_read 3 61119 _000428_hash NULL -+_000429_hash __probe_kernel_write 3 29842 _000429_hash NULL -+_000430_hash proc_coredump_filter_write 3 25625 _000430_hash NULL -+_000431_hash _proc_do_string 2 6376 _000431_hash NULL -+_000432_hash process_vm_rw_pages 5-6 15954 _000432_hash NULL -+_000434_hash proc_loginuid_write 3 63648 _000434_hash NULL -+_000435_hash proc_pid_attr_write 3 63845 _000435_hash NULL -+_000436_hash proc_scsi_devinfo_write 3 32064 _000436_hash NULL -+_000437_hash proc_scsi_write 3 29142 _000437_hash NULL -+_000438_hash proc_scsi_write_proc 3 267 _000438_hash NULL -+_000439_hash pstore_mkfile 5 50830 _000439_hash NULL -+_000440_hash pti_char_write 3 60960 _000440_hash NULL -+_000441_hash ptrace_writedata 4 45021 _000441_hash NULL -+_000442_hash pt_write 3 40159 _000442_hash NULL -+_000443_hash pvr2_ioread_set_sync_key 3 59882 _000443_hash NULL -+_000444_hash pvr2_stream_buffer_count 2 33719 _000444_hash NULL -+_000445_hash qdisc_class_hash_alloc 1 18262 _000445_hash NULL -+_000446_hash r3964_write 4 57662 _000446_hash NULL -+_000447_hash raw_seticmpfilter 3 6888 _000447_hash NULL -+_000448_hash raw_setsockopt 5 45800 _000448_hash NULL -+_000449_hash rawv6_seticmpfilter 5 12137 _000449_hash NULL -+_000450_hash ray_cs_essid_proc_write 3 17875 _000450_hash NULL -+_000451_hash rbd_add 3 16366 _000451_hash NULL -+_000452_hash rbd_snap_add 4 19678 _000452_hash NULL -+_000453_hash rdma_set_ib_paths 3 45592 _000453_hash NULL -+_000454_hash rds_page_copy_user 4 35691 _000454_hash NULL -+_000455_hash read 3 9397 _000455_hash NULL -+_000456_hash read_buf 2 20469 _000456_hash NULL -+_000457_hash read_cis_cache 4 29735 _000457_hash NULL -+_000458_hash realloc_buffer 2 25816 _000458_hash NULL -+_000459_hash realloc_packet_buffer 2 25569 _000459_hash NULL -+_000460_hash receive_DataRequest 3 9904 _000460_hash NULL -+_000461_hash recent_mt_proc_write 3 8206 _000461_hash NULL -+_000462_hash regmap_access_read_file 3 37223 _000462_hash NULL -+_000463_hash regmap_bulk_write 4 59049 _000463_hash NULL -+_000464_hash regmap_map_read_file 3 37685 _000464_hash NULL -+_000465_hash regset_tls_set 4 18459 _000465_hash NULL -+_000466_hash reg_w_buf 3 27724 _000466_hash NULL -+_000467_hash reg_w_ixbuf 4 34736 _000467_hash NULL -+_000468_hash remote_settings_file_write 3 22987 _000468_hash NULL -+_000469_hash request_key_auth_new 3 38092 _000469_hash NULL -+_000470_hash restore_i387_fxsave 2 17528 _000470_hash NULL -+_000471_hash revalidate 2 19043 _000471_hash NULL -+_000472_hash rfcomm_sock_setsockopt 5 18254 _000472_hash NULL -+_000473_hash rndis_add_response 2 58544 _000473_hash NULL -+_000474_hash rndis_set_oid 4 6547 _000474_hash NULL -+_000475_hash rngapi_reset 3 34366 _002911_hash NULL nohasharray -+_000476_hash roccat_common_receive 4 53407 _000476_hash NULL -+_000477_hash roccat_common_send 4 12284 _000477_hash NULL -+_000478_hash rpc_malloc 2 43573 _000478_hash NULL -+_000479_hash rt2x00debug_write_bbp 3 8212 _000479_hash NULL -+_000480_hash rt2x00debug_write_csr 3 64753 _000480_hash NULL -+_000481_hash rt2x00debug_write_eeprom 3 23091 _000481_hash NULL -+_000482_hash rt2x00debug_write_rf 3 38195 _000482_hash NULL -+_000483_hash rts51x_read_mem 4 26577 _000483_hash NULL -+_000484_hash rts51x_read_status 4 11830 _000484_hash NULL -+_000485_hash rts51x_write_mem 4 17598 _000485_hash NULL -+_000486_hash rw_copy_check_uvector 3 34271 _000486_hash NULL -+_000487_hash rxrpc_request_key 3 27235 _000487_hash NULL -+_000488_hash rxrpc_server_keyring 3 16431 _000488_hash NULL -+_000489_hash savemem 3 58129 _000489_hash NULL -+_000490_hash sb16_copy_from_user 10-7-6 55836 _000490_hash NULL -+_000493_hash sched_autogroup_write 3 10984 _000493_hash NULL -+_000494_hash scsi_mode_select 6 37330 _000494_hash NULL -+_000495_hash scsi_tgt_copy_sense 3 26933 _000495_hash NULL -+_000496_hash sctp_auth_create_key 1 51641 _000496_hash NULL -+_000497_hash sctp_getsockopt_delayed_ack 2 9232 _000497_hash NULL -+_000498_hash sctp_getsockopt_local_addrs 2 25178 _000498_hash NULL -+_000499_hash sctp_make_abort_user 3 29654 _000499_hash NULL -+_000500_hash sctp_setsockopt_active_key 3 43755 _000500_hash NULL -+_000501_hash sctp_setsockopt_adaptation_layer 3 26935 _001925_hash NULL nohasharray -+_000502_hash sctp_setsockopt_associnfo 3 51684 _000502_hash NULL -+_000503_hash sctp_setsockopt_auth_chunk 3 30843 _000503_hash NULL -+_000504_hash sctp_setsockopt_auth_key 3 3793 _000504_hash NULL -+_000505_hash sctp_setsockopt_autoclose 3 5775 _000505_hash NULL -+_000506_hash sctp_setsockopt_bindx 3 49870 _000506_hash NULL -+_000507_hash __sctp_setsockopt_connectx 3 46949 _000507_hash NULL -+_000508_hash sctp_setsockopt_context 3 31091 _000508_hash NULL -+_000509_hash sctp_setsockopt_default_send_param 3 49578 _000509_hash &_000247_hash -+_000510_hash sctp_setsockopt_delayed_ack 3 40129 _000510_hash NULL -+_000511_hash sctp_setsockopt_del_key 3 42304 _002281_hash NULL nohasharray -+_000512_hash sctp_setsockopt_events 3 18862 _000512_hash NULL -+_000513_hash sctp_setsockopt_hmac_ident 3 11687 _000513_hash NULL -+_000514_hash sctp_setsockopt_initmsg 3 1383 _000514_hash NULL -+_000515_hash sctp_setsockopt_maxburst 3 28041 _000515_hash NULL -+_000516_hash sctp_setsockopt_maxseg 3 11829 _000516_hash NULL -+_000517_hash sctp_setsockopt_peer_addr_params 3 734 _000517_hash NULL -+_000518_hash sctp_setsockopt_peer_primary_addr 3 13440 _000518_hash NULL -+_000519_hash sctp_setsockopt_rtoinfo 3 30941 _000519_hash NULL -+_000520_hash security_context_to_sid_core 2 29248 _000520_hash NULL -+_000521_hash sel_commit_bools_write 3 46077 _000521_hash NULL -+_000522_hash sel_write_avc_cache_threshold 3 2256 _000522_hash NULL -+_000523_hash sel_write_bool 3 46996 _000523_hash NULL -+_000524_hash sel_write_checkreqprot 3 60774 _000524_hash NULL -+_000525_hash sel_write_disable 3 10511 _000525_hash NULL -+_000526_hash sel_write_enforce 3 48998 _000526_hash NULL -+_000527_hash sel_write_load 3 63830 _000527_hash NULL -+_000528_hash send_bulk_static_data 3 61932 _000528_hash NULL -+_000529_hash send_control_msg 6 48498 _000529_hash NULL -+_000530_hash set_aoe_iflist 2 42737 _000530_hash NULL -+_000531_hash setkey_unaligned 3 39474 _000531_hash NULL -+_000532_hash set_registers 3 53582 _000532_hash NULL -+_000533_hash setsockopt 5 54539 _000533_hash NULL -+_000534_hash setup_req 3 5848 _000534_hash NULL -+_000535_hash setup_window 7 59178 _000535_hash NULL -+_000536_hash setxattr 4 37006 _000536_hash NULL -+_000537_hash sfq_alloc 1 2861 _000537_hash NULL -+_000538_hash sg_kmalloc 1 50240 _000538_hash NULL -+_000539_hash sgl_map_user_pages 2 30610 _000539_hash NULL -+_000540_hash shash_setkey_unaligned 3 8620 _000540_hash NULL -+_000541_hash shmem_xattr_alloc 2 61190 _000541_hash NULL -+_000542_hash sierra_setup_urb 5 46029 _000542_hash NULL -+_000543_hash simple_transaction_get 3 50633 _000543_hash NULL -+_000544_hash simple_write_to_buffer 2-5 3122 _000544_hash NULL -+_000546_hash sisusb_send_bulk_msg 3 17864 _000546_hash NULL -+_000547_hash skb_add_data 3 48363 _000547_hash NULL -+_000548_hash skb_do_copy_data_nocache 5 12465 _000548_hash NULL -+_000549_hash sl_alloc_bufs 2 50380 _000549_hash NULL -+_000550_hash sl_realloc_bufs 2 64086 _000550_hash NULL -+_000551_hash smk_write_ambient 3 45691 _000551_hash NULL -+_000552_hash smk_write_cipso 3 17989 _000552_hash NULL -+_000553_hash smk_write_direct 3 46363 _000553_hash NULL -+_000554_hash smk_write_doi 3 49621 _000554_hash NULL -+_000555_hash smk_write_load_list 3 52280 _000555_hash NULL -+_000556_hash smk_write_logging 3 2618 _000556_hash NULL -+_000557_hash smk_write_netlbladdr 3 42525 _000557_hash NULL -+_000558_hash smk_write_onlycap 3 14400 _000558_hash NULL -+_000559_hash snd_ctl_elem_user_tlv 3 11695 _000559_hash NULL -+_000560_hash snd_emu10k1_fx8010_read 5 9605 _000560_hash NULL -+_000561_hash snd_emu10k1_synth_copy_from_user 3-5 9061 _000561_hash NULL -+_000563_hash snd_gus_dram_poke 4 18525 _000563_hash NULL -+_000564_hash snd_hdsp_playback_copy 5 20676 _000564_hash NULL -+_000565_hash snd_info_entry_write 3 63474 _000565_hash NULL -+_000566_hash snd_korg1212_copy_from 6 36169 _000566_hash NULL -+_000567_hash snd_mem_proc_write 3 9786 _000567_hash NULL -+_000568_hash snd_midi_channel_init_set 1 30092 _000568_hash NULL -+_000569_hash snd_midi_event_new 1 9893 _000750_hash NULL nohasharray -+_000570_hash snd_opl4_mem_proc_write 5 9670 _000570_hash NULL -+_000571_hash snd_pcm_aio_read 3 13900 _000571_hash NULL -+_000572_hash snd_pcm_aio_write 3 28738 _000572_hash NULL -+_000573_hash snd_pcm_oss_write1 3 10872 _000573_hash NULL -+_000574_hash snd_pcm_oss_write2 3 27332 _000574_hash NULL -+_000575_hash snd_rawmidi_kernel_write1 4 56847 _000575_hash NULL -+_000576_hash snd_rme9652_playback_copy 5 20970 _000576_hash NULL -+_000577_hash snd_sb_csp_load_user 3 45190 _000577_hash NULL -+_000578_hash snd_usb_ctl_msg 8 8436 _000578_hash NULL -+_000579_hash sock_bindtodevice 3 50942 _000579_hash NULL -+_000580_hash sock_kmalloc 2 62205 _000580_hash NULL -+_000581_hash spidev_write 3 44510 _000581_hash NULL -+_000582_hash squashfs_read_table 3 16945 _000582_hash NULL -+_000583_hash srpt_alloc_ioctx 2-3 51042 _000583_hash NULL -+_000585_hash srpt_alloc_ioctx_ring 2 49330 _000585_hash NULL -+_000586_hash st5481_setup_isocpipes 6-4 61340 _000586_hash NULL -+_000587_hash sta_agg_status_write 3 45164 _000587_hash NULL -+_000588_hash svc_setsockopt 5 36876 _000588_hash NULL -+_000589_hash sys_add_key 4 61288 _000589_hash NULL -+_000590_hash sys_modify_ldt 3 18824 _000590_hash NULL -+_000591_hash sys_semtimedop 3 4486 _000591_hash NULL -+_000592_hash sys_setdomainname 2 4373 _000592_hash NULL -+_000593_hash sys_sethostname 2 42962 _000593_hash NULL -+_000594_hash tda10048_writeregbulk 4 11050 _000594_hash NULL -+_000595_hash tipc_log_resize 1 34803 _000595_hash NULL -+_000596_hash tomoyo_write_self 3 45161 _000596_hash NULL -+_000597_hash tower_write 3 8580 _000597_hash NULL -+_000598_hash tpm_write 3 50798 _000598_hash NULL -+_000599_hash trusted_instantiate 3 4710 _000599_hash NULL -+_000600_hash trusted_update 3 12664 _000600_hash NULL -+_000601_hash tt_changes_fill_buffer 3 62649 _000601_hash NULL -+_000602_hash tty_buffer_alloc 2 45437 _000602_hash NULL -+_000603_hash __tun_chr_ioctl 4 22300 _000603_hash NULL -+_000604_hash ubi_more_leb_change_data 4 63534 _000604_hash NULL -+_000605_hash ubi_more_update_data 4 39189 _000605_hash NULL -+_000606_hash ubi_resize_volume 2 50172 _000606_hash NULL -+_000607_hash udf_alloc_i_data 2 35786 _000607_hash NULL -+_000608_hash uea_idma_write 3 64139 _000608_hash NULL -+_000609_hash uea_request 4 47613 _000609_hash NULL -+_000610_hash uea_send_modem_cmd 3 3888 _000610_hash NULL -+_000611_hash uio_write 3 43202 _000611_hash NULL -+_000612_hash um_idi_write 3 18293 _000612_hash NULL -+_000613_hash us122l_ctl_msg 8 13330 _000613_hash NULL -+_000614_hash usb_alloc_urb 1 43436 _000614_hash NULL -+_000615_hash usblp_new_writeurb 2 22894 _000615_hash NULL -+_000616_hash usblp_write 3 23178 _000616_hash NULL -+_000617_hash usbtest_alloc_urb 3-5 34446 _000617_hash NULL -+_000619_hash usbtmc_write 3 64340 _000619_hash NULL -+_000620_hash user_instantiate 3 26131 _000620_hash NULL -+_000621_hash user_update 3 41332 _000621_hash NULL -+_000622_hash uvc_simplify_fraction 3 31303 _000622_hash NULL -+_000623_hash uwb_rc_cmd_done 4 35892 _000623_hash NULL -+_000624_hash uwb_rc_neh_grok_event 3 55799 _000624_hash NULL -+_000625_hash v9fs_alloc_rdir_buf 2 42150 _000625_hash NULL -+_000626_hash __vb2_perform_fileio 3 63033 _000626_hash NULL -+_000627_hash vc_do_resize 3-4 48842 _000627_hash NULL -+_000629_hash vcs_write 3 3910 _000629_hash NULL -+_000630_hash vfd_write 3 14717 _000630_hash NULL -+_000631_hash vga_arb_write 3 36112 _000631_hash NULL -+_000632_hash vga_switcheroo_debugfs_write 3 33984 _000632_hash NULL -+_000633_hash vhci_get_user 3 45039 _000633_hash NULL -+_000634_hash video_proc_write 3 6724 _000634_hash NULL -+_000635_hash vlsi_alloc_ring 3-4 57003 _000635_hash NULL -+_000637_hash __vmalloc 1 61168 _000637_hash NULL -+_000638_hash vmalloc_32 1 1135 _000638_hash NULL -+_000639_hash vmalloc_32_user 1 37519 _000639_hash NULL -+_000640_hash vmalloc_exec 1 36132 _000640_hash NULL -+_000641_hash vmalloc_node 1 58700 _000641_hash NULL -+_000642_hash __vmalloc_node_flags 1 30352 _000642_hash NULL -+_000643_hash vmalloc_user 1 32308 _000643_hash NULL -+_000644_hash vol_cdev_direct_write 3 20751 _000644_hash NULL -+_000645_hash vp_request_msix_vectors 2 28849 _000645_hash NULL -+_000646_hash vring_add_indirect 3-4 20737 _000646_hash NULL -+_000648_hash vring_new_virtqueue 1 9671 _000648_hash NULL -+_000649_hash vxge_os_dma_malloc 2 46184 _000649_hash NULL -+_000650_hash vxge_os_dma_malloc_async 3 56348 _000650_hash NULL -+_000651_hash wdm_write 3 53735 _000651_hash NULL -+_000652_hash wiimote_hid_send 3 48528 _000652_hash NULL -+_000653_hash wl1273_fm_fops_write 3 60621 _000653_hash NULL -+_000654_hash wlc_phy_loadsampletable_nphy 3 64367 _000654_hash NULL -+_000655_hash write 3 62671 _000655_hash NULL -+_000656_hash write_flush 3 50803 _000656_hash NULL -+_000657_hash write_rio 3 54837 _000657_hash NULL -+_000658_hash x25_asy_change_mtu 2 26928 _000658_hash NULL -+_000659_hash xdi_copy_from_user 4 8395 _000659_hash NULL -+_000660_hash xfrm_dst_alloc_copy 3 3034 _000660_hash NULL -+_000661_hash xfrm_user_policy 4 62573 _000661_hash NULL -+_000662_hash xfs_attrmulti_attr_set 4 59346 _000662_hash NULL -+_000663_hash xfs_handle_to_dentry 3 12135 _000663_hash NULL -+_000664_hash __xip_file_write 3 2733 _000664_hash NULL -+_000665_hash xprt_rdma_allocate 2 31372 _000665_hash NULL -+_000666_hash zd_usb_iowrite16v_async 3 23984 _000666_hash NULL -+_000667_hash zd_usb_read_fw 4 22049 _000667_hash NULL -+_000668_hash zerocopy_sg_from_iovec 3 11828 _000668_hash NULL -+_000669_hash zoran_write 3 22404 _000669_hash NULL -+_000671_hash acpi_ex_allocate_name_string 2 7685 _002855_hash NULL nohasharray -+_000672_hash acpi_os_allocate_zeroed 1 37422 _000672_hash NULL -+_000673_hash acpi_ut_initialize_buffer 2 47143 _002314_hash NULL nohasharray -+_000674_hash ad7879_spi_xfer 3 36311 _000674_hash NULL -+_000675_hash add_new_gdb 3 27643 _000675_hash NULL -+_000676_hash add_numbered_child 5 14273 _000676_hash NULL -+_000677_hash add_res_range 4 21310 _000677_hash NULL -+_000678_hash addtgt 3 54703 _000678_hash NULL -+_000679_hash add_uuid 4 49831 _000679_hash NULL -+_000680_hash afs_cell_alloc 2 24052 _000680_hash NULL -+_000681_hash aggr_recv_addba_req_evt 4 38037 _000681_hash NULL -+_000682_hash agp_create_memory 1 1075 _000682_hash NULL -+_000683_hash agp_create_user_memory 1 62955 _000683_hash NULL -+_000684_hash alg_setsockopt 5 20985 _000684_hash NULL -+_000685_hash alloc_async 1 14208 _000685_hash NULL -+_000686_hash ___alloc_bootmem_nopanic 1 53626 _000686_hash NULL -+_000687_hash alloc_buf 1 34532 _000687_hash NULL -+_000688_hash alloc_chunk 1 49575 _000688_hash NULL -+_000689_hash alloc_context 1 41283 _000689_hash NULL -+_000690_hash alloc_ctrl_packet 1 44667 _000690_hash NULL -+_000691_hash alloc_data_packet 1 46698 _000691_hash NULL -+_000692_hash alloc_dca_provider 2 59670 _000692_hash NULL -+_000693_hash __alloc_dev_table 2 54343 _000693_hash NULL -+_000694_hash alloc_ep 1 17269 _000694_hash NULL -+_000695_hash __alloc_extent_buffer 3 15093 _000695_hash NULL -+_000696_hash alloc_group_attrs 2 9194 _000719_hash NULL nohasharray -+_000697_hash alloc_large_system_hash 2 64490 _000697_hash NULL -+_000698_hash alloc_netdev_mqs 1 30030 _000698_hash NULL -+_000699_hash __alloc_objio_seg 1 7203 _000699_hash NULL -+_000700_hash alloc_ring 2-4 15345 _000700_hash NULL -+_000701_hash alloc_ring 2-4 39151 _000701_hash NULL -+_000704_hash alloc_session 1-2 64171 _000704_hash NULL -+_000708_hash alloc_smp_req 1 51337 _000708_hash NULL -+_000709_hash alloc_smp_resp 1 3566 _000709_hash NULL -+_000710_hash alloc_ts_config 1 45775 _000710_hash NULL -+_000711_hash alloc_upcall 2 62186 _000711_hash NULL -+_000712_hash altera_drscan 2 48698 _000712_hash NULL -+_000713_hash altera_irscan 2 62396 _000713_hash NULL -+_000714_hash altera_set_dr_post 2 54291 _000714_hash NULL -+_000715_hash altera_set_dr_pre 2 64862 _000715_hash NULL -+_000716_hash altera_set_ir_post 2 20948 _000716_hash NULL -+_000717_hash altera_set_ir_pre 2 54103 _000717_hash NULL -+_000718_hash altera_swap_dr 2 50090 _000718_hash NULL -+_000719_hash altera_swap_ir 2 9194 _000719_hash &_000696_hash -+_000720_hash amd_create_gatt_pages 1 20537 _000720_hash NULL -+_000721_hash aoechr_write 3 62883 _001352_hash NULL nohasharray -+_000722_hash applesmc_create_nodes 2 49392 _000722_hash NULL -+_000723_hash array_zalloc 1-2 7519 _000723_hash NULL -+_000725_hash arvo_sysfs_read 6 31617 _000725_hash NULL -+_000726_hash arvo_sysfs_write 6 3311 _000726_hash NULL -+_000727_hash asd_store_update_bios 4 10165 _000727_hash NULL -+_000728_hash ata_host_alloc 2 46094 _000728_hash NULL -+_000729_hash atalk_sendmsg 4 21677 _000729_hash NULL -+_000730_hash ath6kl_cfg80211_connect_event 7-9-8 13443 _000730_hash NULL -+_000731_hash ath6kl_mgmt_tx 9 21153 _000731_hash NULL -+_000732_hash ath6kl_wmi_roam_tbl_event_rx 3 43440 _000732_hash NULL -+_000733_hash ath6kl_wmi_send_mgmt_cmd 7 17347 _000733_hash NULL -+_000734_hash ath_descdma_setup 5 12257 _000734_hash NULL -+_000735_hash ath_rx_edma_init 2 65483 _000735_hash NULL -+_000736_hash ati_create_gatt_pages 1 4722 _003142_hash NULL nohasharray -+_000737_hash au0828_init_isoc 2-3 61917 _000737_hash NULL -+_000739_hash audit_init_entry 1 38644 _000739_hash NULL -+_000740_hash ax25_sendmsg 4 62770 _000740_hash NULL -+_000741_hash b1_alloc_card 1 36155 _000741_hash NULL -+_000742_hash b43_nphy_load_samples 3 36481 _000742_hash NULL -+_000743_hash bio_copy_user_iov 4 37660 _000743_hash NULL -+_000744_hash __bio_map_kern 2-3 47379 _000744_hash NULL -+_000746_hash blk_register_region 1-2 51424 _000746_hash NULL -+_000748_hash bm_entry_write 3 28338 _000748_hash NULL -+_000749_hash bm_realloc_pages 2 9431 _000749_hash NULL -+_000750_hash bm_register_write 3 9893 _000750_hash &_000569_hash -+_000751_hash bm_status_write 3 12964 _000751_hash NULL -+_000752_hash br_mdb_rehash 2 42643 _000752_hash NULL -+_000753_hash btrfs_copy_from_user 3 43806 _000753_hash NULL -+_000754_hash btrfs_insert_delayed_dir_index 4 63720 _000754_hash NULL -+_000755_hash __btrfs_map_block 3 49839 _000755_hash NULL -+_000756_hash __c4iw_init_resource_fifo 3 8334 _000756_hash NULL -+_000757_hash cache_downcall 3 13666 _000757_hash NULL -+_000758_hash cache_slow_downcall 2 8570 _000758_hash NULL -+_000759_hash ca_extend 2 64541 _000759_hash NULL -+_000760_hash caif_seqpkt_sendmsg 4 22961 _000760_hash NULL -+_000761_hash caif_stream_sendmsg 4 9110 _000761_hash NULL -+_000762_hash carl9170_cmd_buf 3 950 _000762_hash NULL -+_000763_hash cdev_add 2-3 38176 _000763_hash NULL -+_000765_hash cdrom_read_cdda 4 50478 _000765_hash NULL -+_000766_hash ceph_dns_resolve_name 1 62488 _000766_hash NULL -+_000767_hash ceph_msgpool_get 2 54258 _000767_hash NULL -+_000768_hash cfg80211_connect_result 4-6 56515 _000768_hash NULL -+_000770_hash cfg80211_disconnected 4 57 _000770_hash NULL -+_000771_hash cfg80211_inform_bss 8 19332 _000771_hash NULL -+_000772_hash cfg80211_inform_bss_frame 4 41078 _000772_hash NULL -+_000773_hash cfg80211_mlme_register_mgmt 5 19852 _000773_hash NULL -+_000774_hash cfg80211_roamed_bss 4-6 50198 _000774_hash NULL -+_000776_hash cifs_readdata_alloc 1 50318 _000776_hash NULL -+_000777_hash cifs_readv_from_socket 3 19109 _000777_hash NULL -+_000778_hash cifs_writedata_alloc 1 32880 _003176_hash NULL nohasharray -+_000779_hash cnic_alloc_dma 3 34641 _000779_hash NULL -+_000780_hash configfs_write_file 3 61621 _000780_hash NULL -+_000781_hash construct_key 3 11329 _000781_hash NULL -+_000782_hash context_alloc 3 24645 _000782_hash NULL -+_000783_hash copy_to_user 3 57835 _000783_hash NULL -+_000784_hash create_attr_set 1 22861 _000784_hash NULL -+_000785_hash create_bounce_buffer 3 39155 _000785_hash NULL -+_000786_hash create_gpadl_header 2 19064 _000786_hash NULL -+_000787_hash _create_sg_bios 4 31244 _000787_hash NULL -+_000788_hash cryptd_alloc_instance 2-3 18048 _000788_hash NULL -+_000790_hash crypto_ahash_setkey 3 55134 _000790_hash NULL -+_000791_hash crypto_alloc_instance2 3 25277 _000791_hash NULL -+_000792_hash crypto_shash_setkey 3 60483 _000792_hash NULL -+_000793_hash cx231xx_init_bulk 3-2 47024 _000793_hash NULL -+_000794_hash cx231xx_init_isoc 2-3 56453 _000794_hash NULL -+_000796_hash cx231xx_init_vbi_isoc 2-3 28053 _000796_hash NULL -+_000798_hash cxgb_alloc_mem 1 24007 _000798_hash NULL -+_000799_hash cxgbi_device_portmap_create 3 25747 _000799_hash NULL -+_000800_hash cxgbi_device_register 1-2 36746 _000800_hash NULL -+_000802_hash __cxio_init_resource_fifo 3 23447 _000802_hash NULL -+_000803_hash dccp_sendmsg 4 56058 _000803_hash NULL -+_000804_hash ddp_make_gl 1 12179 _000804_hash NULL -+_000805_hash depth_write 3 3021 _000805_hash NULL -+_000806_hash dev_irnet_write 3 11398 _000806_hash NULL -+_000807_hash dev_set_alias 3 50084 _000807_hash NULL -+_000808_hash dev_write 3 7708 _000808_hash NULL -+_000809_hash dfs_global_file_write 3 6112 _000809_hash NULL -+_000810_hash dgram_sendmsg 4 45679 _000810_hash NULL -+_000811_hash disconnect 4 32521 _000811_hash NULL -+_000812_hash dma_attach 6-7 50831 _000812_hash NULL -+_000814_hash dn_sendmsg 4 38390 _000814_hash NULL -+_000815_hash do_dccp_setsockopt 5 54377 _000815_hash NULL -+_000816_hash do_jffs2_setxattr 5 25910 _000816_hash NULL -+_000817_hash do_msgsnd 4 1387 _000817_hash NULL -+_000818_hash do_raw_setsockopt 5 55215 _000818_hash NULL -+_000819_hash do_readv_writev 4 51849 _000819_hash NULL -+_000820_hash do_sync 1 9604 _000820_hash NULL -+_000821_hash dup_array 3 33551 _000821_hash NULL -+_000822_hash dvb_audio_write 3 51275 _000822_hash NULL -+_000823_hash dvb_ca_en50221_init 4 45718 _000823_hash NULL -+_000824_hash dvb_video_write 3 754 _000824_hash NULL -+_000825_hash econet_sendmsg 4 51430 _000825_hash NULL -+_000826_hash ecryptfs_decode_and_decrypt_filename 5 10379 _000826_hash NULL -+_000827_hash ecryptfs_encrypt_and_encode_filename 6 2109 _000827_hash NULL -+_000828_hash ecryptfs_send_message_locked 2 31801 _000828_hash NULL -+_000829_hash edac_device_alloc_ctl_info 1 5941 _000829_hash NULL -+_000830_hash edac_mc_alloc 1 54846 _000830_hash NULL -+_000831_hash edac_pci_alloc_ctl_info 1 63388 _000831_hash NULL -+_000832_hash efivar_create_sysfs_entry 2 19485 _000832_hash NULL -+_000833_hash em28xx_alloc_isoc 4 46892 _000833_hash NULL -+_000834_hash enable_write 3 30456 _000834_hash NULL -+_000835_hash enclosure_register 3 57412 _000835_hash NULL -+_000836_hash ext4_kvzalloc 1 47605 _000836_hash NULL -+_000837_hash extend_netdev_table 2 31680 _000837_hash NULL -+_000838_hash __feat_register_sp 6 64712 _000838_hash NULL -+_000839_hash __ffs_ep0_read_events 3 48868 _000839_hash NULL -+_000840_hash ffs_ep0_write 3 9438 _000840_hash NULL -+_000841_hash ffs_epfile_read 3 18775 _000841_hash NULL -+_000842_hash ffs_epfile_write 3 48014 _000842_hash NULL -+_000843_hash fib_info_hash_alloc 1 9075 _000843_hash NULL -+_000844_hash fillonedir 3 41746 _000844_hash NULL -+_000845_hash flexcop_device_kmalloc 1 54793 _000845_hash NULL -+_000846_hash frame_alloc 4 15981 _000846_hash NULL -+_000847_hash fw_node_create 2 9559 _000847_hash NULL -+_000848_hash garmin_read_process 3 27509 _000848_hash NULL -+_000849_hash garp_request_join 4 7471 _000849_hash NULL -+_000850_hash get_derived_key 4 61100 _000850_hash NULL -+_000851_hash get_entry 4 16003 _000851_hash NULL -+_000852_hash get_free_de 2 33714 _000852_hash NULL -+_000853_hash get_new_cssid 2 51665 _000853_hash NULL -+_000854_hash getxattr 4 24398 _000854_hash NULL -+_000855_hash gspca_dev_probe2 4 59833 _000855_hash NULL -+_000856_hash hcd_alloc_coherent 5 55862 _000856_hash NULL -+_000857_hash hci_sock_sendmsg 4 37420 _000857_hash NULL -+_000858_hash hid_register_field 2-3 4874 _000858_hash NULL -+_000860_hash hid_report_raw_event 4 7024 _000860_hash NULL -+_000861_hash hpi_alloc_control_cache 1 35351 _000861_hash NULL -+_000862_hash hugetlbfs_read_actor 2-5-4 34547 _000862_hash NULL -+_000865_hash hvc_alloc 4 12579 _000865_hash NULL -+_000866_hash __hwahc_dev_set_key 5 46328 _000866_hash NULL -+_000867_hash i2400m_zrealloc_2x 3 54166 _001430_hash NULL nohasharray -+_000868_hash ib_alloc_device 1 26483 _000868_hash NULL -+_000869_hash ib_create_send_mad 5 1196 _000869_hash NULL -+_000870_hash ibmasm_new_command 2 25714 _000870_hash NULL -+_000871_hash ib_send_cm_drep 3 50186 _000871_hash NULL -+_000872_hash ib_send_cm_mra 4 60202 _000872_hash NULL -+_000873_hash ib_send_cm_rtu 3 63138 _000873_hash NULL -+_000874_hash ieee80211_key_alloc 3 19065 _000874_hash NULL -+_000875_hash ieee80211_mgmt_tx 9 46860 _000875_hash NULL -+_000876_hash ieee80211_send_probe_req 6-4 6924 _000876_hash NULL -+_000877_hash if_writecmd 2 815 _000877_hash NULL -+_000878_hash init_bch 1-2 64130 _000878_hash NULL -+_000880_hash init_ipath 1 48187 _000880_hash NULL -+_000881_hash init_list_set 2-3 39188 _000881_hash NULL -+_000883_hash init_q 4 132 _000883_hash NULL -+_000884_hash init_state 2 60165 _000884_hash NULL -+_000885_hash init_tag_map 3 57515 _000885_hash NULL -+_000886_hash input_ff_create 2 21240 _000886_hash NULL -+_000887_hash input_mt_init_slots 2 31183 _000887_hash NULL -+_000888_hash interfaces 2 38859 _000888_hash NULL -+_000889_hash ioat2_alloc_ring 2 11172 _000889_hash NULL -+_000890_hash ip_generic_getfrag 3-4 12187 _000890_hash NULL -+_000892_hash ipr_alloc_ucode_buffer 1 40199 _000892_hash NULL -+_000893_hash ip_set_alloc 1 57953 _000893_hash NULL -+_000894_hash ipv6_flowlabel_opt 3 58135 _001125_hash NULL nohasharray -+_000895_hash ipv6_renew_options 5 28867 _000895_hash NULL -+_000896_hash ipxrtr_route_packet 4 54036 _000896_hash NULL -+_000897_hash irda_sendmsg 4 4388 _000897_hash NULL -+_000898_hash irda_sendmsg_dgram 4 38563 _000898_hash NULL -+_000899_hash irda_sendmsg_ultra 4 42047 _000899_hash NULL -+_000900_hash irias_add_octseq_attrib 4 29983 _000900_hash NULL -+_000901_hash irq_alloc_generic_chip 2 26650 _000901_hash NULL -+_000902_hash irq_domain_add_linear 2 29236 _000902_hash NULL -+_000903_hash iscsi_alloc_session 3 49390 _000903_hash NULL -+_000904_hash iscsi_create_conn 2 50425 _000904_hash NULL -+_000905_hash iscsi_create_endpoint 1 15193 _000905_hash NULL -+_000906_hash iscsi_create_iface 5 38510 _000906_hash NULL -+_000907_hash iscsi_decode_text_input 4 58292 _000907_hash NULL -+_000908_hash iscsi_pool_init 2-4 54913 _000908_hash NULL -+_000910_hash iscsit_dump_data_payload 2 38683 _000910_hash NULL -+_000911_hash isdn_write 3 45863 _000911_hash NULL -+_000912_hash isku_receive 4 54130 _000912_hash NULL -+_000913_hash isku_send 4 41542 _000913_hash NULL -+_000914_hash islpci_mgt_transaction 5 23610 _000914_hash NULL -+_000915_hash iso_sched_alloc 1 13377 _002079_hash NULL nohasharray -+_000916_hash ivtv_v4l2_write 3 39226 _000916_hash NULL -+_000917_hash iwl_trans_txq_alloc 3 36147 _000917_hash NULL -+_000918_hash iwmct_fw_parser_init 4 37876 _000918_hash NULL -+_000919_hash iwm_notif_send 6 12295 _000919_hash NULL -+_000920_hash iwm_ntf_calib_res 3 11686 _000920_hash NULL -+_000921_hash iwm_umac_set_config_var 4 17320 _000921_hash NULL -+_000922_hash ixgbe_alloc_q_vector 3-5 45428 _000922_hash NULL -+_000924_hash jbd2_journal_init_revoke 2 51088 _000924_hash NULL -+_000925_hash jffs2_write_dirent 5 37311 _000925_hash NULL -+_000926_hash journal_init_revoke 2 56933 _000926_hash NULL -+_000927_hash keyctl_instantiate_key 3 41855 _000927_hash NULL -+_000928_hash keyctl_instantiate_key_iov 3 16969 _000928_hash NULL -+_000929_hash __kfifo_from_user 3 20399 _000929_hash NULL -+_000930_hash kimage_crash_alloc 3 3233 _000930_hash NULL -+_000931_hash kimage_normal_alloc 3 31140 _000931_hash NULL -+_000932_hash kmem_realloc 2 37489 _000932_hash NULL -+_000933_hash kmem_zalloc 1 11510 _000933_hash NULL -+_000934_hash koneplus_send 4 18226 _000934_hash NULL -+_000935_hash koneplus_sysfs_read 6 42792 _000935_hash NULL -+_000936_hash kovaplus_send 4 10009 _000936_hash NULL -+_000937_hash kvm_read_guest_page_mmu 6 37611 _000937_hash NULL -+_000938_hash kvm_set_irq_routing 3 48704 _000938_hash NULL -+_000939_hash kvm_write_guest_cached 4 11106 _000939_hash NULL -+_000940_hash kvm_write_guest_page 5 63555 _002809_hash NULL nohasharray -+_000941_hash l2cap_skbuff_fromiovec 3-4 35003 _000941_hash NULL -+_000943_hash l2tp_ip_sendmsg 4 50411 _000943_hash NULL -+_000944_hash l2tp_session_create 1 25286 _000944_hash NULL -+_000945_hash lc_create 3 48662 _000945_hash NULL -+_000946_hash leaf_dealloc 3 29566 _000946_hash NULL -+_000947_hash linear_conf 2 23485 _000947_hash NULL -+_000948_hash lirc_buffer_init 2-3 53282 _000948_hash NULL -+_000950_hash llc_ui_sendmsg 4 24987 _000950_hash NULL -+_000951_hash lpfc_sli4_queue_alloc 3 62646 _000951_hash NULL -+_000952_hash mce_request_packet 3 1073 _000952_hash NULL -+_000953_hash mdiobus_alloc_size 1 52259 _000953_hash NULL -+_000954_hash media_entity_init 2-4 15870 _001556_hash NULL nohasharray -+_000956_hash memstick_alloc_host 1 142 _000956_hash NULL -+_000957_hash mesh_table_alloc 1 22305 _000957_hash NULL -+_000958_hash mfd_add_devices 4 56753 _000958_hash NULL -+_000959_hash mISDN_sock_sendmsg 4 41035 _000959_hash NULL -+_000960_hash mmc_alloc_host 1 48097 _000960_hash NULL -+_000961_hash mmc_test_alloc_mem 3 28102 _000961_hash NULL -+_000962_hash mpi_alloc 1 18094 _000962_hash NULL -+_000963_hash mpihelp_mul_karatsuba_case 5-3 23918 _000963_hash NULL -+_000964_hash mpihelp_mul_n 4 16405 _000964_hash NULL -+_000965_hash mpi_set_bit 2 15104 _000965_hash NULL -+_000966_hash mpi_set_highbit 2 37327 _001420_hash NULL nohasharray -+_000967_hash mtd_concat_create 2 14416 _000967_hash NULL -+_000968_hash mvumi_alloc_mem_resource 3 47750 _000968_hash NULL -+_000969_hash mwifiex_11n_create_rx_reorder_tbl 4 63806 _000969_hash NULL -+_000970_hash mwifiex_alloc_sdio_mpa_buffers 2-3 60961 _000970_hash NULL -+_000972_hash mwl8k_cmd_set_beacon 4 23110 _000972_hash NULL -+_000973_hash neigh_hash_alloc 1 17595 _000973_hash NULL -+_000974_hash netlink_sendmsg 4 33708 _001172_hash NULL nohasharray -+_000975_hash netxen_alloc_sds_rings 2 13417 _000975_hash NULL -+_000976_hash new_bind_ctl 2 35324 _000976_hash NULL -+_000977_hash new_dir 3 31919 _000977_hash NULL -+_000978_hash new_tape_buffer 2 32866 _000978_hash NULL -+_000979_hash nfc_llcp_build_tlv 3 19536 _000979_hash NULL -+_000980_hash nfc_llcp_send_i_frame 3 59130 _000980_hash NULL -+_000981_hash nfs4_alloc_slots 1 2454 _000981_hash NULL -+_000982_hash nfsctl_transaction_write 3 64800 _000982_hash NULL -+_000983_hash nfs_idmap_request_key 3 30208 _000983_hash NULL -+_000984_hash nfs_readdata_alloc 1 9990 _000984_hash NULL -+_000985_hash nfs_writedata_alloc 1 62868 _000985_hash NULL -+_000986_hash nl_pid_hash_zalloc 1 23314 _000986_hash NULL -+_000987_hash nr_sendmsg 4 53656 _000987_hash NULL -+_000988_hash nsm_create_handle 4 38060 _000988_hash NULL -+_000989_hash ntfs_copy_from_user_iovec 3-6 49829 _000989_hash NULL -+_000991_hash ntfs_file_buffered_write 4-6 41442 _000991_hash NULL -+_000993_hash __ntfs_malloc 1 34022 _000993_hash NULL -+_000994_hash nvme_alloc_queue 3 46865 _000994_hash NULL -+_000995_hash ocfs2_acl_from_xattr 2 21604 _000995_hash NULL -+_000996_hash ocfs2_control_message 3 19564 _000996_hash NULL -+_000997_hash opera1_usb_i2c_msgxfer 4 64521 _000997_hash NULL -+_000998_hash _ore_get_io_state 3 2166 _000998_hash NULL -+_000999_hash orig_hash_add_if 2 53676 _000999_hash NULL -+_001000_hash orig_hash_del_if 2 45080 _001000_hash NULL -+_001001_hash orinoco_set_key 5-7 17878 _001001_hash NULL -+_001003_hash osdmap_set_max_osd 2 57630 _001003_hash NULL -+_001004_hash _osd_realloc_seg 3 54352 _001004_hash NULL -+_001005_hash OSDSetBlock 2-4 38986 _001005_hash NULL -+_001007_hash osst_execute 7-6 17607 _001007_hash NULL -+_001008_hash osst_write 3 31581 _001008_hash NULL -+_001009_hash otp_read 2-5-4 10594 _001009_hash NULL -+_001012_hash ovs_vport_alloc 1 33475 _001012_hash NULL -+_001013_hash packet_sendmsg_spkt 4 28885 _001013_hash NULL -+_001014_hash pair_device 4 61175 _001708_hash NULL nohasharray -+_001015_hash pccard_store_cis 6 18176 _001015_hash NULL -+_001016_hash pci_add_cap_save_buffer 3 3426 _001016_hash NULL -+_001017_hash pcnet32_realloc_rx_ring 3 36598 _001017_hash NULL -+_001018_hash pcnet32_realloc_tx_ring 3 38428 _001018_hash NULL -+_001019_hash pcpu_mem_zalloc 1 22948 _001019_hash NULL -+_001020_hash pep_sendmsg 4 62524 _001020_hash NULL -+_001021_hash pfkey_sendmsg 4 47394 _001021_hash NULL -+_001022_hash pidlist_resize 2 496 _001022_hash NULL -+_001023_hash pin_code_reply 4 46510 _001023_hash NULL -+_001024_hash ping_getfrag 3-4 8360 _001024_hash NULL -+_001026_hash pipe_set_size 2 5204 _001026_hash NULL -+_001027_hash pkt_bio_alloc 1 48284 _001027_hash NULL -+_001028_hash platform_create_bundle 4-6 12785 _001028_hash NULL -+_001030_hash play_iframe 3 8219 _001030_hash NULL -+_001031_hash pm8001_store_update_fw 4 55716 _001031_hash NULL -+_001032_hash pmcraid_alloc_sglist 1 9864 _001032_hash NULL -+_001033_hash pn533_dep_link_up 5 7659 _001033_hash NULL -+_001034_hash pnp_alloc 1 24869 _001419_hash NULL nohasharray -+_001035_hash pn_sendmsg 4 12640 _001035_hash NULL -+_001036_hash pppoe_sendmsg 4 48039 _001036_hash NULL -+_001037_hash pppol2tp_sendmsg 4 56420 _001037_hash NULL -+_001038_hash process_vm_rw 3-5 47533 _001038_hash NULL -+_001040_hash process_vm_rw_single_vec 1-2 26213 _001040_hash NULL -+_001042_hash proc_write 3 51003 _001042_hash NULL -+_001043_hash profile_load 3 58267 _001043_hash NULL -+_001044_hash profile_remove 3 8556 _001044_hash NULL -+_001045_hash profile_replace 3 14652 _001045_hash NULL -+_001046_hash pscsi_get_bio 1 56103 _001046_hash NULL -+_001047_hash pyra_send 4 12061 _001047_hash NULL -+_001048_hash qc_capture 3 19298 _001048_hash NULL -+_001049_hash qla4xxx_alloc_work 2 44813 _001049_hash NULL -+_001050_hash qlcnic_alloc_msix_entries 2 46160 _001050_hash NULL -+_001051_hash qlcnic_alloc_sds_rings 2 26795 _001051_hash NULL -+_001052_hash queue_received_packet 5 9657 _001052_hash NULL -+_001053_hash raw_send_hdrinc 4 58803 _001053_hash NULL -+_001054_hash raw_sendmsg 4 23078 _001054_hash &_000022_hash -+_001055_hash rawsock_sendmsg 4 60010 _001055_hash NULL -+_001056_hash rawv6_send_hdrinc 3 35425 _001056_hash NULL -+_001057_hash rb_alloc 1 3102 _001057_hash NULL -+_001058_hash rbd_alloc_coll 1 33678 _001058_hash NULL -+_001059_hash rbd_create_rw_ops 2 4605 _001059_hash NULL -+_001060_hash rds_ib_inc_copy_to_user 3 55007 _001060_hash NULL -+_001061_hash rds_iw_inc_copy_to_user 3 29214 _001061_hash NULL -+_001062_hash rds_message_alloc 1 10517 _001062_hash NULL -+_001063_hash rds_message_copy_from_user 3 45510 _001063_hash NULL -+_001064_hash rds_message_inc_copy_to_user 3 26540 _001064_hash NULL -+_001065_hash redrat3_transmit_ir 3 64244 _001065_hash NULL -+_001066_hash regcache_rbtree_insert_to_block 5 58009 _001066_hash NULL -+_001067_hash _regmap_raw_write 4 42652 _001067_hash NULL -+_001068_hash regmap_register_patch 3 21681 _001068_hash NULL -+_001069_hash relay_alloc_page_array 1 52735 _001069_hash NULL -+_001070_hash remove_uuid 4 64505 _001070_hash NULL -+_001071_hash reshape_ring 2 29147 _001071_hash NULL -+_001072_hash RESIZE_IF_NEEDED 2 56286 _001072_hash NULL -+_001073_hash resize_stripes 2 61650 _001073_hash NULL -+_001074_hash rfcomm_sock_sendmsg 4 37661 _001074_hash NULL -+_001075_hash rose_sendmsg 4 20249 _001075_hash NULL -+_001076_hash rxrpc_send_data 5 21553 _001076_hash NULL -+_001077_hash rxrpc_setsockopt 5 50286 _001077_hash NULL -+_001078_hash saa7146_vmalloc_build_pgtable 2 19780 _001078_hash NULL -+_001079_hash saa7164_buffer_alloc_user 2 9627 _001079_hash NULL -+_001081_hash sco_send_frame 3 41815 _001081_hash NULL -+_001082_hash scsi_host_alloc 2 63041 _001082_hash NULL -+_001083_hash scsi_tgt_kspace_exec 8 9522 _001083_hash NULL -+_001084_hash sctp_sendmsg 4 61919 _001084_hash NULL -+_001085_hash sctp_setsockopt 5 44788 _001085_hash NULL -+_001086_hash sctp_setsockopt_connectx 3 6073 _001086_hash NULL -+_001087_hash sctp_setsockopt_connectx_old 3 22631 _001087_hash NULL -+_001088_hash sctp_tsnmap_init 2 36446 _001088_hash NULL -+_001089_hash sctp_user_addto_chunk 2-3 62047 _001089_hash NULL -+_001091_hash security_context_to_sid 2 19839 _001091_hash NULL -+_001092_hash security_context_to_sid_default 2 3492 _001092_hash NULL -+_001093_hash security_context_to_sid_force 2 20724 _001093_hash NULL -+_001094_hash selinux_transaction_write 3 59038 _001094_hash NULL -+_001095_hash sel_write_access 3 51704 _001095_hash NULL -+_001096_hash sel_write_create 3 11353 _001096_hash NULL -+_001097_hash sel_write_member 3 28800 _001097_hash NULL -+_001098_hash sel_write_relabel 3 55195 _001098_hash NULL -+_001099_hash sel_write_user 3 45060 _001099_hash NULL -+_001100_hash __seq_open_private 3 40715 _001100_hash NULL -+_001101_hash serverworks_create_gatt_pages 1 46582 _001101_hash NULL -+_001102_hash set_connectable 4 56458 _001102_hash NULL -+_001103_hash set_dev_class 4 39645 _001697_hash NULL nohasharray -+_001104_hash set_discoverable 4 48141 _001104_hash NULL -+_001105_hash setkey 3 14987 _001105_hash NULL -+_001106_hash set_le 4 30581 _001106_hash NULL -+_001107_hash set_link_security 4 4502 _001107_hash NULL -+_001108_hash set_local_name 4 55757 _001108_hash NULL -+_001109_hash set_powered 4 12129 _001109_hash NULL -+_001110_hash set_ssp 4 62411 _001110_hash NULL -+_001111_hash sg_build_sgat 3 60179 _001111_hash &_000305_hash -+_001112_hash sg_read_oxfer 3 51724 _001112_hash NULL -+_001113_hash shmem_xattr_set 4 11843 _001113_hash NULL -+_001114_hash simple_alloc_urb 3 60420 _001114_hash NULL -+_001115_hash sisusb_send_bridge_packet 2 11649 _001115_hash NULL -+_001116_hash sisusb_send_packet 2 20891 _001116_hash NULL -+_001117_hash skb_add_data_nocache 4 4682 _001117_hash NULL -+_001118_hash skb_copy_datagram_from_iovec 2-5-4 52014 _001118_hash NULL -+_001121_hash skb_copy_to_page_nocache 6 58624 _001121_hash NULL -+_001122_hash sk_chk_filter 2 42095 _001122_hash NULL -+_001123_hash skcipher_sendmsg 4 30290 _001123_hash NULL -+_001124_hash sl_change_mtu 2 7396 _001124_hash NULL -+_001125_hash slhc_init 1-2 58135 _001125_hash &_000894_hash -+_001127_hash sm501_create_subdev 3-4 48668 _001127_hash NULL -+_001129_hash smk_write_access 3 49561 _001129_hash NULL -+_001130_hash snapshot_write 3 28351 _001130_hash NULL -+_001131_hash snd_ac97_pcm_assign 2 30218 _001131_hash NULL -+_001132_hash snd_card_create 4 64418 _001411_hash NULL nohasharray -+_001133_hash snd_emux_create_port 3 42533 _001133_hash NULL -+_001134_hash snd_gus_dram_write 4 38784 _001134_hash NULL -+_001135_hash snd_midi_channel_alloc_set 1 28153 _001135_hash NULL -+_001136_hash _snd_pcm_lib_alloc_vmalloc_buffer 2 17820 _001136_hash NULL -+_001137_hash snd_pcm_oss_sync1 2 45298 _001137_hash NULL -+_001138_hash snd_pcm_oss_write 3 38108 _001138_hash NULL -+_001139_hash snd_pcm_plugin_build 5 25505 _001139_hash NULL -+_001140_hash snd_rawmidi_kernel_write 3 25106 _001140_hash NULL -+_001141_hash snd_rawmidi_write 3 28008 _001141_hash NULL -+_001142_hash snd_rme32_playback_copy 5 43732 _001142_hash NULL -+_001143_hash snd_rme96_playback_copy 5 13111 _001143_hash NULL -+_001144_hash snd_seq_device_new 4 31753 _001144_hash NULL -+_001145_hash snd_seq_oss_readq_new 2 14283 _001145_hash NULL -+_001146_hash snd_vx_create 4 40948 _001146_hash NULL -+_001147_hash sock_setsockopt 5 50088 _001147_hash NULL -+_001148_hash sound_write 3 5102 _001148_hash NULL -+_001149_hash _sp2d_alloc 1 16944 _001149_hash NULL -+_001150_hash spi_alloc_master 2 45223 _001150_hash NULL -+_001151_hash spidev_message 3 5518 _001151_hash NULL -+_001152_hash spi_register_board_info 2 35651 _001152_hash NULL -+_001153_hash squashfs_cache_init 2 41656 _001153_hash NULL -+_001154_hash squashfs_read_data 6 59440 _001154_hash NULL -+_001155_hash srp_alloc_iu 2 44227 _001155_hash NULL -+_001156_hash srp_iu_pool_alloc 2 17920 _001156_hash NULL -+_001157_hash srp_ring_alloc 2 26760 _001157_hash NULL -+_001159_hash start_isoc_chain 2 565 _001159_hash NULL -+_001160_hash stk_prepare_sio_buffers 2 57168 _001160_hash NULL -+_001161_hash store_iwmct_log_level 4 60209 _001161_hash NULL -+_001162_hash store_iwmct_log_level_fw 4 1974 _001162_hash NULL -+_001163_hash st_write 3 16874 _001163_hash NULL -+_001164_hash svc_pool_map_alloc_arrays 2 47181 _001164_hash NULL -+_001165_hash symtab_init 2 61050 _001165_hash NULL -+_001166_hash sys_bind 3 10799 _001166_hash NULL -+_001167_hash sys_connect 3 15291 _001167_hash NULL -+_001168_hash sys_flistxattr 3 41407 _001168_hash NULL -+_001169_hash sys_fsetxattr 4 49736 _001169_hash NULL -+_001170_hash sysfs_write_file 3 57116 _001170_hash NULL -+_001171_hash sys_ipc 3 4889 _001171_hash NULL -+_001172_hash sys_keyctl 4 33708 _001172_hash &_000974_hash -+_001173_hash sys_listxattr 3 27833 _001173_hash NULL -+_001174_hash sys_llistxattr 3 4532 _001174_hash NULL -+_001175_hash sys_lsetxattr 4 61177 _001175_hash NULL -+_001176_hash sys_mq_timedsend 3 57661 _001176_hash NULL -+_001177_hash sys_sched_setaffinity 2 32046 _001177_hash NULL -+_001178_hash sys_semop 3 39457 _001178_hash NULL -+_001179_hash sys_sendto 6 20809 _001179_hash NULL -+_001180_hash sys_setxattr 4 37880 _001180_hash NULL -+_001181_hash t4_alloc_mem 1 32342 _001181_hash NULL -+_001182_hash tcf_hash_create 4 54360 _001182_hash NULL -+_001183_hash __team_options_register 3 63941 _001183_hash NULL -+_001184_hash test_unaligned_bulk 3 52333 _001184_hash NULL -+_001185_hash tifm_alloc_adapter 1 10903 _001185_hash NULL -+_001186_hash timeout_write 3 50991 _001186_hash NULL -+_001187_hash tipc_link_send_sections_fast 4 37920 _001187_hash NULL -+_001188_hash tipc_subseq_alloc 1 5957 _001188_hash NULL -+_001189_hash tm6000_read_write_usb 7 50774 _002917_hash NULL nohasharray -+_001190_hash tnode_alloc 1 49407 _001190_hash NULL -+_001191_hash tomoyo_commit_ok 2 20167 _001191_hash NULL -+_001192_hash tomoyo_scan_bprm 2-4 15642 _001192_hash NULL -+_001194_hash tps65910_i2c_write 3 39531 _001194_hash NULL -+_001195_hash ts_write 3 64336 _001195_hash NULL -+_001196_hash ttusb2_msg 4 3100 _001196_hash NULL -+_001197_hash tty_write 3 5494 _001197_hash NULL -+_001198_hash ubi_dbg_check_all_ff 4 59810 _001198_hash NULL -+_001199_hash ubi_dbg_check_write 5 48525 _001199_hash NULL -+_001200_hash ubifs_setxattr 4 59650 _001370_hash NULL nohasharray -+_001201_hash udf_sb_alloc_partition_maps 2 62313 _001201_hash NULL -+_001202_hash udplite_getfrag 3-4 14479 _001202_hash NULL -+_001204_hash ulong_write_file 3 26485 _001204_hash NULL -+_001205_hash unix_dgram_sendmsg 4 45699 _001205_hash NULL -+_001206_hash unix_stream_sendmsg 4 61455 _001206_hash NULL -+_001207_hash unlink_queued 3-4 645 _001207_hash NULL -+_001208_hash update_pmkid 4 2481 _001208_hash NULL -+_001209_hash usb_alloc_coherent 2 65444 _001209_hash NULL -+_001210_hash uvc_alloc_buffers 2 9656 _001210_hash NULL -+_001211_hash uvc_alloc_entity 3-4 20836 _001211_hash NULL -+_001212_hash v4l2_ctrl_new 7 38725 _001212_hash NULL -+_001213_hash v4l2_event_subscribe 3 19510 _001213_hash NULL -+_001214_hash vb2_read 3 42703 _001214_hash NULL -+_001215_hash vb2_write 3 31948 _001215_hash NULL -+_001216_hash vc_resize 2-3 3585 _001216_hash NULL -+_001218_hash __vhost_add_used_n 3 26554 _001218_hash NULL -+_001219_hash __videobuf_alloc_vb 1 27062 _001219_hash NULL -+_001220_hash videobuf_dma_init_kernel 3 6963 _001220_hash NULL -+_001221_hash virtqueue_add_buf 3-4 59470 _001221_hash NULL -+_001223_hash vmalloc 1 15464 _001223_hash NULL -+_001224_hash vmalloc_to_sg 2 58354 _001224_hash NULL -+_001225_hash vol_cdev_write 3 40915 _001225_hash NULL -+_001226_hash vxge_device_register 4 7752 _001226_hash NULL -+_001227_hash __vxge_hw_channel_allocate 3 55462 _001227_hash NULL -+_001228_hash vzalloc 1 47421 _001228_hash NULL -+_001229_hash vzalloc_node 1 23424 _001229_hash NULL -+_001230_hash wa_nep_queue 2 8858 _001230_hash NULL -+_001231_hash __wa_xfer_setup_segs 2 56725 _001231_hash NULL -+_001232_hash wiphy_new 2 2482 _001232_hash NULL -+_001233_hash wpan_phy_alloc 1 48056 _001233_hash NULL -+_001234_hash wusb_ccm_mac 7 32199 _001234_hash NULL -+_001235_hash x25_sendmsg 4 12487 _001235_hash NULL -+_001236_hash xfrm_hash_alloc 1 10997 _001236_hash NULL -+_001237_hash _xfs_buf_get_pages 2 46811 _001237_hash NULL -+_001238_hash xfs_da_buf_make 1 55845 _001238_hash NULL -+_001239_hash xfs_da_grow_inode_int 3 21785 _001239_hash NULL -+_001240_hash xfs_dir_cilookup_result 3 64288 _003130_hash NULL nohasharray -+_001241_hash xfs_iext_add_indirect_multi 3 32400 _001241_hash NULL -+_001242_hash xfs_iext_inline_to_direct 2 12384 _001242_hash NULL -+_001243_hash xfs_iroot_realloc 2 46826 _001243_hash NULL -+_001244_hash xhci_alloc_stream_info 3 63902 _001244_hash NULL -+_001245_hash xlog_recover_add_to_trans 4 62839 _001245_hash NULL -+_001246_hash xprt_alloc 2 1475 _001246_hash NULL -+_001247_hash xt_alloc_table_info 1 57903 _001247_hash NULL -+_001248_hash _zd_iowrite32v_async_locked 3 39034 _001248_hash NULL -+_001249_hash zd_usb_iowrite16v 3 49744 _001249_hash NULL -+_001250_hash acpi_ds_build_internal_package_obj 3 58271 _001250_hash NULL -+_001251_hash acpi_system_read_event 3 55362 _001251_hash NULL -+_001252_hash acpi_ut_create_buffer_object 1 42030 _001252_hash NULL -+_001253_hash acpi_ut_create_package_object 1 17594 _001253_hash NULL -+_001254_hash acpi_ut_create_string_object 1 15360 _001254_hash NULL -+_001255_hash ad7879_spi_multi_read 3 8218 _001255_hash NULL -+_001256_hash add_child 4 45201 _001256_hash NULL -+_001257_hash add_port 2 54941 _001257_hash NULL -+_001258_hash adu_read 3 24177 _001258_hash NULL -+_001259_hash afs_cell_create 2 27346 _001259_hash NULL -+_001260_hash agp_generic_alloc_user 1 9470 _001260_hash NULL -+_001261_hash alloc_agpphysmem_i8xx 1 39427 _001261_hash NULL -+_001262_hash allocate_cnodes 1 5329 _001262_hash NULL -+_001263_hash ___alloc_bootmem 1 11410 _001263_hash NULL -+_001264_hash __alloc_bootmem_nopanic 1 65397 _001264_hash NULL -+_001265_hash alloc_bulk_urbs_generic 5 12127 _001265_hash NULL -+_001266_hash alloc_candev 1-2 7776 _001266_hash NULL -+_001268_hash ____alloc_ei_netdev 1 51475 _001268_hash NULL -+_001269_hash alloc_etherdev_mqs 1 36450 _001269_hash NULL -+_001270_hash alloc_extent_buffer 3 52824 _001270_hash NULL -+_001271_hash alloc_fcdev 1 18780 _001271_hash NULL -+_001272_hash alloc_fddidev 1 15382 _001272_hash NULL -+_001273_hash alloc_hippi_dev 1 51320 _001273_hash NULL -+_001274_hash alloc_irdadev 1 19140 _001274_hash NULL -+_001275_hash alloc_ltalkdev 1 38071 _001275_hash NULL -+_001276_hash alloc_one_pg_vec_page 1 10747 _001276_hash NULL -+_001277_hash alloc_orinocodev 1 21371 _001277_hash NULL -+_001279_hash alloc_trdev 1 16399 _001279_hash NULL -+_001280_hash async_setkey 3 35521 _001280_hash NULL -+_001281_hash ata_host_alloc_pinfo 3 17325 _001281_hash NULL -+_001284_hash ath6kl_connect_event 7-9-8 14267 _001284_hash NULL -+_001285_hash ath6kl_fwlog_block_read 3 49836 _001285_hash NULL -+_001286_hash ath6kl_fwlog_read 3 32101 _001286_hash NULL -+_001287_hash ath_rx_init 2 43564 _001287_hash NULL -+_001288_hash ath_tx_init 2 60515 _001288_hash NULL -+_001289_hash atm_get_addr 3 31221 _001289_hash NULL -+_001290_hash av7110_ipack_init 2 46655 _001290_hash NULL -+_001291_hash bdx_rxdb_create 1 46525 _001291_hash NULL -+_001292_hash bdx_tx_db_init 2 41719 _001292_hash NULL -+_001293_hash bio_map_kern 3 64751 _001293_hash NULL -+_001294_hash bits_to_user 3 47733 _001294_hash NULL -+_001295_hash __blk_queue_init_tags 2 9778 _001295_hash NULL -+_001296_hash blk_queue_resize_tags 2 28670 _001296_hash NULL -+_001297_hash blk_rq_map_user_iov 5 16772 _001297_hash NULL -+_001298_hash bm_init 2 13529 _001298_hash NULL -+_001299_hash brcmf_alloc_wdev 1 60347 _001299_hash NULL -+_001300_hash btrfs_insert_dir_item 4 59304 _001300_hash NULL -+_001301_hash btrfs_map_block 3 64379 _001301_hash NULL -+_001302_hash c4_add_card 3 54968 _001302_hash NULL -+_001303_hash cache_read 3 24790 _001303_hash NULL -+_001304_hash cache_write 3 13589 _001304_hash NULL -+_001305_hash calc_hmac 3 32010 _001305_hash NULL -+_001306_hash ccid_getsockopt_builtin_ccids 2 53634 _001306_hash NULL -+_001307_hash ceph_copy_page_vector_to_user 4 31270 _001307_hash NULL -+_001308_hash ceph_read_dir 3 17005 _001308_hash NULL -+_001309_hash cfg80211_roamed 5-7 32632 _001309_hash NULL -+_001311_hash ci_ll_init 3 12930 _001311_hash NULL -+_001312_hash coda_psdev_read 3 35029 _001312_hash NULL -+_001313_hash construct_key_and_link 4 8321 _001313_hash NULL -+_001314_hash copy_counters_to_user 5 17027 _001824_hash NULL nohasharray -+_001315_hash copy_entries_to_user 1 52367 _001315_hash NULL -+_001316_hash copy_from_buf 4 27308 _001316_hash NULL -+_001317_hash copy_oldmem_page 3 26164 _001317_hash NULL -+_001318_hash copy_to_user_fromio 3 57432 _001318_hash NULL -+_001319_hash cryptd_hash_setkey 3 42781 _001319_hash NULL -+_001320_hash crypto_authenc_esn_setkey 3 6985 _001320_hash NULL -+_001321_hash crypto_authenc_setkey 3 80 _001321_hash NULL -+_001322_hash cx18_copy_buf_to_user 4 22735 _001322_hash NULL -+_001324_hash cxgbi_ddp_reserve 4 30091 _001324_hash NULL -+_001325_hash datablob_hmac_append 3 40038 _001325_hash NULL -+_001326_hash datablob_hmac_verify 4 24786 _001326_hash NULL -+_001327_hash dataflash_read_fact_otp 3-2 33204 _001327_hash NULL -+_001328_hash dataflash_read_user_otp 3-2 14536 _001328_hash &_000201_hash -+_001329_hash dccp_feat_register_sp 5 17914 _001329_hash NULL -+_001330_hash ddb_input_read 3 9743 _001330_hash NULL -+_001331_hash dev_read 3 56369 _001331_hash NULL -+_001332_hash diva_os_copy_to_user 4 48508 _001332_hash NULL -+_001333_hash diva_os_malloc 2 16406 _001333_hash NULL -+_001334_hash dlm_dir_lookup 4 56662 _001334_hash NULL -+_001335_hash dm_vcalloc 1-2 16814 _001335_hash NULL -+_001337_hash do_proc_readlink 3 14096 _001337_hash NULL -+_001338_hash do_readlink 2 43518 _001338_hash NULL -+_001339_hash __do_replace 5 37227 _001339_hash NULL -+_001340_hash do_sigpending 2 9766 _001340_hash NULL -+_001341_hash drbd_setsockopt 5 16280 _001341_hash &_000371_hash -+_001342_hash dsp_buffer_alloc 2 11684 _001342_hash NULL -+_001343_hash dump_midi 3 51040 _001343_hash NULL -+_001344_hash dvb_dmxdev_set_buffer_size 2 55643 _001344_hash NULL -+_001345_hash dvb_dvr_set_buffer_size 2 9840 _001345_hash NULL -+_001346_hash dvb_ringbuffer_pkt_read_user 3-5-2 4303 _001346_hash NULL -+_001348_hash dvb_ringbuffer_read_user 3 56702 _001348_hash NULL -+_001349_hash ecryptfs_filldir 3 6622 _001349_hash NULL -+_001350_hash ecryptfs_readlink 3 40775 _001350_hash NULL -+_001351_hash ecryptfs_send_message 2 18322 _001351_hash NULL -+_001352_hash em28xx_init_isoc 4 62883 _001352_hash &_000721_hash -+_001353_hash et61x251_read 3 25420 _001353_hash NULL -+_001354_hash ext4_add_new_descs 3 19509 _001354_hash NULL -+_001355_hash fat_ioctl_filldir 3 36621 _001355_hash NULL -+_001356_hash fd_copyout 3 59323 _001356_hash NULL -+_001357_hash f_hidg_read 3 6238 _001357_hash NULL -+_001358_hash filldir 3 55137 _001358_hash NULL -+_001359_hash filldir64 3 46469 _001359_hash NULL -+_001360_hash fops_read 3 40672 _001360_hash NULL -+_001361_hash from_buffer 3 18625 _001361_hash NULL -+_001362_hash fsm_init 2 16134 _001362_hash NULL -+_001363_hash get_subdir 3 62581 _001363_hash NULL -+_001364_hash gspca_dev_probe 4 2570 _001364_hash NULL -+_001365_hash handle_received_packet 3 22457 _001365_hash NULL -+_001366_hash hash_setkey 3 48310 _001366_hash NULL -+_001367_hash hdlcdrv_register 2 6792 _001367_hash NULL -+_001368_hash hdpvr_read 3 9273 _001368_hash NULL -+_001369_hash hid_input_report 4 32458 _001369_hash NULL -+_001370_hash hidraw_read 3 59650 _001370_hash &_001200_hash -+_001371_hash HiSax_readstatus 2 15752 _001371_hash NULL -+_001373_hash __hwahc_op_set_gtk 4 42038 _001373_hash NULL -+_001374_hash __hwahc_op_set_ptk 5 36510 _001374_hash NULL -+_001375_hash ib_copy_to_udata 3 27525 _001375_hash NULL -+_001376_hash idetape_chrdev_read 3 2097 _001376_hash NULL -+_001377_hash ieee80211_alloc_hw 1 43829 _001377_hash NULL -+_001378_hash ieee80211_bss_info_update 4 13991 _001378_hash NULL -+_001379_hash ilo_read 3 32531 _001379_hash NULL -+_001380_hash init_map_ipmac 3-4 63896 _001380_hash NULL -+_001382_hash init_tid_tabs 2-4-3 13252 _001382_hash NULL -+_001385_hash iowarrior_read 3 53483 _001385_hash NULL -+_001386_hash ipv6_getsockopt_sticky 5 56711 _001386_hash NULL -+_001387_hash ipwireless_send_packet 4 8328 _001387_hash NULL -+_001388_hash ipx_sendmsg 4 1362 _001388_hash NULL -+_001389_hash iscsi_conn_setup 2 35159 _001389_hash NULL -+_001390_hash iscsi_create_session 3 51647 _001390_hash NULL -+_001391_hash iscsi_host_alloc 2 36671 _001391_hash NULL -+_001392_hash iscsi_session_setup 4-5 196 _001392_hash NULL -+_001394_hash iscsit_find_cmd_from_itt_or_dump 3 17194 _001701_hash NULL nohasharray -+_001395_hash isdn_ppp_read 4 50356 _001395_hash NULL -+_001396_hash isku_sysfs_read 6 58806 _001396_hash NULL -+_001397_hash isku_sysfs_write 6 49767 _001397_hash NULL -+_001398_hash iso_alloc_urb 4-5 45206 _001398_hash NULL -+_001400_hash ivtv_copy_buf_to_user 4 6159 _001400_hash NULL -+_001401_hash iwm_rx_handle 3 24899 _001401_hash NULL -+_001402_hash iwm_wdev_alloc 1 38415 _001402_hash NULL -+_001403_hash jbd2_alloc 1 41359 _001403_hash NULL -+_001404_hash jffs2_do_link 6 42048 _001404_hash NULL -+_001405_hash jffs2_do_unlink 4 62020 _001405_hash NULL -+_001406_hash jffs2_security_setxattr 4 62107 _001406_hash NULL -+_001407_hash jffs2_trusted_setxattr 4 17048 _001407_hash NULL -+_001408_hash jffs2_user_setxattr 4 10182 _001408_hash NULL -+_001409_hash kernel_setsockopt 5 35913 _001409_hash NULL -+_001410_hash keyctl_describe_key 3 36853 _001410_hash NULL -+_001411_hash keyctl_get_security 3 64418 _001411_hash &_001132_hash -+_001412_hash keyring_read 3 13438 _001412_hash NULL -+_001413_hash kfifo_copy_to_user 3 20646 _001413_hash NULL -+_001414_hash kmem_zalloc_large 1 56128 _001414_hash NULL -+_001415_hash kmp_init 2 41373 _001415_hash NULL -+_001416_hash koneplus_sysfs_write 6 35993 _001416_hash NULL -+_001417_hash kvm_clear_guest_page 4 2308 _001417_hash NULL -+_001418_hash kvm_read_nested_guest_page 5 13337 _001418_hash NULL -+_001419_hash l2cap_create_basic_pdu 3 24869 _001419_hash &_001034_hash -+_001420_hash l2cap_create_connless_pdu 3 37327 _001420_hash &_000966_hash -+_001421_hash l2cap_create_iframe_pdu 3 51801 _001421_hash NULL -+_001422_hash __lgwrite 4 57669 _001422_hash NULL -+_001423_hash libfc_host_alloc 2 7917 _001423_hash NULL -+_001424_hash llcp_sock_sendmsg 4 1092 _001424_hash NULL -+_001425_hash macvtap_get_user 4 28185 _001425_hash NULL -+_001426_hash mcam_v4l_read 3 36513 _001426_hash NULL -+_001427_hash mce_async_out 3 58056 _001427_hash NULL -+_001428_hash mce_flush_rx_buffer 2 14976 _001428_hash NULL -+_001429_hash mdc800_device_read 3 22896 _001429_hash NULL -+_001430_hash memcpy_toiovec 3 54166 _001430_hash &_000867_hash -+_001431_hash memcpy_toiovecend 3-4 19736 _001431_hash NULL -+_001433_hash mgt_set_varlen 4 60916 _001433_hash NULL -+_001434_hash mlx4_en_create_rx_ring 3 62498 _001434_hash NULL -+_001435_hash mlx4_en_create_tx_ring 4 48501 _001435_hash NULL -+_001436_hash mon_bin_get_event 4 52863 _001436_hash NULL -+_001437_hash mousedev_read 3 47123 _001437_hash NULL -+_001438_hash move_addr_to_user 2 2868 _001438_hash NULL -+_001439_hash mpihelp_mul 5-3 27805 _001439_hash NULL -+_001441_hash mpi_lshift_limbs 2 9337 _001441_hash NULL -+_001442_hash msnd_fifo_alloc 2 23179 _001442_hash NULL -+_001443_hash mtdswap_init 2 55719 _001443_hash NULL -+_001444_hash neigh_hash_grow 2 17283 _001444_hash NULL -+_001445_hash nfs4_realloc_slot_table 2 22859 _001445_hash NULL -+_001446_hash nfs_idmap_get_key 2 39616 _001446_hash NULL -+_001447_hash nsm_get_handle 4 52089 _001447_hash NULL -+_001448_hash ntfs_malloc_nofs 1 49572 _001448_hash NULL -+_001449_hash ntfs_malloc_nofs_nofail 1 63631 _001449_hash NULL -+_001450_hash nvme_create_queue 3 170 _001450_hash NULL -+_001451_hash ocfs2_control_write 3 54737 _001451_hash NULL -+_001452_hash orinoco_add_extscan_result 3 18207 _001452_hash NULL -+_001454_hash override_release 2 52032 _001454_hash NULL -+_001455_hash packet_snd 3 13634 _001455_hash NULL -+_001456_hash pcbit_stat 2 27364 _001456_hash NULL -+_001457_hash pcpu_extend_area_map 2 12589 _001457_hash NULL -+_001458_hash pg_read 3 17276 _001458_hash NULL -+_001459_hash picolcd_debug_eeprom_read 3 14549 _001459_hash NULL -+_001460_hash pkt_alloc_packet_data 1 37928 _001460_hash NULL -+_001461_hash pmcraid_build_passthrough_ioadls 2 62034 _001461_hash NULL -+_001462_hash pms_capture 4 27142 _001462_hash NULL -+_001463_hash posix_clock_register 2 5662 _001463_hash NULL -+_001464_hash printer_read 3 54851 _001464_hash NULL -+_001465_hash __proc_file_read 3 54978 _001465_hash NULL -+_001466_hash pt_read 3 49136 _001466_hash NULL -+_001467_hash put_cmsg 4 36589 _001467_hash NULL -+_001468_hash pvr2_ioread_read 3 10720 _001505_hash NULL nohasharray -+_001469_hash pwc_video_read 3 51735 _001469_hash NULL -+_001470_hash px_raw_event 4 49371 _001470_hash NULL -+_001471_hash qcam_read 3 13977 _001471_hash NULL -+_001472_hash rawv6_sendmsg 4 20080 _001472_hash NULL -+_001473_hash rds_sendmsg 4 40976 _001473_hash NULL -+_001474_hash read_flush 3 43851 _001474_hash NULL -+_001475_hash read_profile 3 27859 _001475_hash NULL -+_001476_hash read_vmcore 3 26501 _001476_hash NULL -+_001477_hash redirected_tty_write 3 65297 _001477_hash NULL -+_001478_hash __register_chrdev 2-3 54223 _001478_hash NULL -+_001480_hash regmap_raw_write 4 53803 _001480_hash NULL -+_001481_hash reiserfs_allocate_list_bitmaps 3 21732 _001481_hash NULL -+_001482_hash reiserfs_resize 2 34377 _001482_hash NULL -+_001483_hash request_key_auth_read 3 24109 _001483_hash NULL -+_001484_hash rfkill_fop_read 3 54711 _001484_hash NULL -+_001485_hash rng_dev_read 3 41581 _001485_hash NULL -+_001486_hash roccat_read 3 41093 _001486_hash NULL -+_001487_hash sco_sock_sendmsg 4 62542 _001487_hash NULL -+_001488_hash scsi_register 2 49094 _001488_hash NULL -+_001489_hash sctp_getsockopt_events 2 3607 _001489_hash NULL -+_001490_hash sctp_getsockopt_maxburst 2 42941 _001490_hash NULL -+_001491_hash sctp_getsockopt_maxseg 2 10737 _001491_hash NULL -+_001492_hash sctpprobe_read 3 17741 _001492_hash NULL -+_001493_hash sdhci_alloc_host 2 7509 _001493_hash NULL -+_001494_hash selinux_inode_post_setxattr 4 26037 _001494_hash NULL -+_001495_hash selinux_inode_setsecurity 4 18148 _001495_hash NULL -+_001496_hash selinux_inode_setxattr 4 10708 _001496_hash NULL -+_001497_hash selinux_secctx_to_secid 2 63744 _001497_hash NULL -+_001498_hash selinux_setprocattr 4 55611 _001498_hash NULL -+_001499_hash sel_write_context 3 25726 _002397_hash NULL nohasharray -+_001500_hash seq_copy_in_user 3 18543 _001500_hash NULL -+_001501_hash seq_open_net 4 8968 _001594_hash NULL nohasharray -+_001502_hash seq_open_private 3 61589 _001502_hash NULL -+_001503_hash set_arg 3 42824 _001503_hash NULL -+_001504_hash sg_read 3 25799 _001504_hash NULL -+_001505_hash shash_async_setkey 3 10720 _001505_hash &_001468_hash -+_001506_hash shash_compat_setkey 3 12267 _001506_hash NULL -+_001507_hash shmem_setxattr 4 55867 _001507_hash NULL -+_001508_hash simple_read_from_buffer 2-5 55957 _001508_hash NULL -+_001511_hash sm_checker_extend 2 23615 _001511_hash NULL -+_001512_hash sn9c102_read 3 29305 _001512_hash NULL -+_001513_hash snd_es1938_capture_copy 5 25930 _001513_hash NULL -+_001514_hash snd_gus_dram_peek 4 9062 _001514_hash NULL -+_001515_hash snd_hdsp_capture_copy 5 4011 _001515_hash NULL -+_001516_hash snd_korg1212_copy_to 6 92 _001516_hash NULL -+_001517_hash snd_opl4_mem_proc_read 5 63774 _001517_hash NULL -+_001518_hash snd_pcm_alloc_vmalloc_buffer 2 44595 _001518_hash NULL -+_001519_hash snd_pcm_oss_read1 3 63771 _001519_hash NULL -+_001520_hash snd_rawmidi_kernel_read1 4 36740 _001520_hash NULL -+_001521_hash snd_rme9652_capture_copy 5 10287 _001521_hash NULL -+_001522_hash srp_target_alloc 3 37288 _001522_hash NULL -+_001523_hash stk_allocate_buffers 2 16291 _001523_hash NULL -+_001524_hash store_ifalias 4 35088 _001524_hash NULL -+_001525_hash store_msg 3 56417 _001525_hash NULL -+_001526_hash str_to_user 2 11411 _001526_hash NULL -+_001527_hash subbuf_read_actor 3 2071 _001527_hash NULL -+_001528_hash sys_fgetxattr 4 25166 _001528_hash NULL -+_001529_hash sys_gethostname 2 49698 _001529_hash NULL -+_001530_hash sys_getxattr 4 37418 _001530_hash NULL -+_001531_hash sys_kexec_load 2 14222 _001531_hash NULL -+_001532_hash sys_msgsnd 3 44537 _001532_hash &_000129_hash -+_001533_hash sys_process_vm_readv 3-5 19090 _003178_hash NULL nohasharray -+_001535_hash sys_process_vm_writev 3-5 4928 _001535_hash NULL -+_001537_hash sys_sched_getaffinity 2 60033 _001537_hash NULL -+_001538_hash sys_setsockopt 5 35320 _001538_hash NULL -+_001539_hash t3_init_l2t 1 8261 _001539_hash NULL -+_001540_hash team_options_register 3 20091 _001540_hash NULL -+_001541_hash tipc_send2name 6 16809 _001541_hash NULL -+_001542_hash tipc_send2port 5 63935 _001542_hash NULL -+_001543_hash tipc_send 4 51238 _001543_hash NULL -+_001544_hash tm6000_i2c_recv_regs16 5 2949 _001544_hash NULL -+_001545_hash tm6000_i2c_recv_regs 5 46215 _001545_hash NULL -+_001546_hash tm6000_i2c_send_regs 5 20250 _001546_hash NULL -+_001547_hash tnode_new 3 44757 _001547_hash NULL -+_001548_hash tomoyo_read_self 3 33539 _001548_hash NULL -+_001549_hash tomoyo_update_domain 2 5498 _001549_hash NULL -+_001550_hash tomoyo_update_policy 2 40458 _001550_hash NULL -+_001551_hash tpm_read 3 50344 _001551_hash NULL -+_001552_hash TSS_rawhmac 3 17486 _001552_hash NULL -+_001553_hash tt3650_ci_msg 4 57219 _001553_hash NULL -+_001554_hash tun_get_user 3 33178 _001554_hash NULL -+_001555_hash ubi_dbg_dump_flash 4 3870 _001555_hash NULL -+_001556_hash ubi_io_write 4-5 15870 _001556_hash &_000954_hash -+_001558_hash uio_read 3 49300 _001558_hash NULL -+_001559_hash unix_seqpacket_sendmsg 4 27893 _001559_hash NULL -+_001560_hash unlink1 3 63059 _001560_hash NULL -+_001562_hash usb_allocate_stream_buffers 3 8964 _001562_hash NULL -+_001563_hash usbdev_read 3 45114 _001563_hash NULL -+_001564_hash usblp_read 3 57342 _001564_hash NULL -+_001565_hash usbtmc_read 3 32377 _001565_hash NULL -+_001566_hash usbvision_v4l2_read 3 34386 _001566_hash NULL -+_001567_hash _usb_writeN_sync 4 31682 _001567_hash NULL -+_001568_hash user_read 3 51881 _001568_hash NULL -+_001569_hash v4l_stk_read 3 39672 _001569_hash NULL -+_001570_hash vcs_read 3 8017 _001570_hash NULL -+_001571_hash vdma_mem_alloc 1 6171 _001571_hash NULL -+_001572_hash venus_create 4 20555 _001572_hash NULL -+_001573_hash venus_link 5 32165 _001573_hash NULL -+_001574_hash venus_lookup 4 8121 _001574_hash NULL -+_001575_hash venus_mkdir 4 8967 _001575_hash NULL -+_001576_hash venus_remove 4 59781 _001576_hash NULL -+_001577_hash venus_rename 4-5 17707 _001577_hash NULL -+_001579_hash venus_rmdir 4 45564 _001579_hash NULL -+_001580_hash venus_symlink 4-6 23570 _001580_hash NULL -+_001582_hash vfs_readlink 3 54368 _001582_hash NULL -+_001583_hash vfs_readv 3 38011 _001583_hash NULL -+_001584_hash vfs_writev 3 25278 _001584_hash NULL -+_001585_hash vga_arb_read 3 4886 _001585_hash NULL -+_001586_hash vhci_put_user 4 12604 _001586_hash NULL -+_001587_hash vhost_add_used_n 3 10760 _001587_hash NULL -+_001588_hash __videobuf_copy_to_user 4 15423 _001588_hash NULL -+_001589_hash videobuf_pages_to_sg 2 3708 _001589_hash NULL -+_001590_hash videobuf_vmalloc_to_sg 2 4548 _001590_hash NULL -+_001591_hash virtnet_send_command 5-6 61993 _001591_hash NULL -+_001593_hash vmbus_establish_gpadl 3 4495 _001593_hash NULL -+_001594_hash vol_cdev_read 3 8968 _001594_hash &_001501_hash -+_001595_hash w9966_v4l_read 3 31148 _001595_hash NULL -+_001596_hash wdm_read 3 6549 _001596_hash NULL -+_001597_hash wusb_prf 7 54261 _001597_hash &_000063_hash -+_001598_hash xdi_copy_to_user 4 48900 _001598_hash NULL -+_001599_hash xfs_buf_get_uncached 2 51477 _001599_hash NULL -+_001600_hash xfs_efd_init 3 5463 _001600_hash NULL -+_001601_hash xfs_efi_init 2 5476 _001601_hash NULL -+_001602_hash xfs_iext_realloc_direct 2 20521 _001602_hash NULL -+_001603_hash xfs_iext_realloc_indirect 2 59211 _001603_hash NULL -+_001604_hash xfs_inumbers_fmt 3 12817 _001604_hash NULL -+_001605_hash xlog_recover_add_to_cont_trans 4 44102 _001605_hash NULL -+_001606_hash xz_dec_lzma2_create 2 36353 _002745_hash NULL nohasharray -+_001607_hash _zd_iowrite32v_locked 3 44725 _001607_hash NULL -+_001608_hash aat2870_reg_read_file 3 12221 _001608_hash NULL -+_001609_hash add_sctp_bind_addr 3 12269 _001609_hash NULL -+_001610_hash aes_decrypt_fail_read 3 54815 _001610_hash NULL -+_001611_hash aes_decrypt_interrupt_read 3 19910 _001611_hash NULL -+_001612_hash aes_decrypt_packets_read 3 10155 _001612_hash NULL -+_001613_hash aes_encrypt_fail_read 3 32562 _001613_hash NULL -+_001614_hash aes_encrypt_interrupt_read 3 39919 _001614_hash NULL -+_001615_hash aes_encrypt_packets_read 3 48666 _001615_hash NULL -+_001616_hash afs_cell_lookup 2 8482 _001616_hash NULL -+_001617_hash agp_allocate_memory 2 58761 _001617_hash NULL -+_001618_hash __alloc_bootmem 1 31498 _001618_hash NULL -+_001619_hash __alloc_bootmem_low 1 43423 _001619_hash NULL -+_001620_hash __alloc_bootmem_node_nopanic 2 6432 _001620_hash NULL -+_001621_hash alloc_cc770dev 1 48186 _001621_hash NULL -+_001622_hash __alloc_ei_netdev 1 29338 _001622_hash NULL -+_001623_hash __alloc_eip_netdev 1 51549 _001623_hash NULL -+_001624_hash alloc_libipw 1 22708 _001624_hash NULL -+_001625_hash alloc_pg_vec 2 8533 _001625_hash NULL -+_001626_hash alloc_sja1000dev 1 17868 _001626_hash NULL -+_001627_hash alloc_targets 2 8074 _001627_hash NULL -+_001630_hash ath6kl_disconnect_timeout_read 3 3650 _001630_hash NULL -+_001631_hash ath6kl_endpoint_stats_read 3 41554 _001631_hash NULL -+_001632_hash ath6kl_fwlog_mask_read 3 2050 _001632_hash NULL -+_001633_hash ath6kl_keepalive_read 3 44303 _001633_hash NULL -+_001634_hash ath6kl_listen_int_read 3 10355 _001634_hash NULL -+_001635_hash ath6kl_lrssi_roam_read 3 61022 _001635_hash NULL -+_001636_hash ath6kl_regdump_read 3 14393 _001636_hash NULL -+_001637_hash ath6kl_regread_read 3 25884 _001637_hash NULL -+_001638_hash ath6kl_regwrite_read 3 48747 _001638_hash NULL -+_001639_hash ath6kl_roam_table_read 3 26166 _001639_hash NULL -+_001640_hash ath9k_debugfs_read_buf 3 25316 _001640_hash NULL -+_001641_hash atk_debugfs_ggrp_read 3 29522 _001641_hash NULL -+_001642_hash b43_debugfs_read 3 24425 _001642_hash NULL -+_001643_hash b43legacy_debugfs_read 3 2473 _001643_hash NULL -+_001644_hash bcm_recvmsg 4 43992 _001644_hash NULL -+_001645_hash bfad_debugfs_read 3 13119 _001645_hash NULL -+_001646_hash bfad_debugfs_read_regrd 3 57830 _001646_hash NULL -+_001647_hash blk_init_tags 1 30592 _001647_hash NULL -+_001648_hash blk_queue_init_tags 2 44355 _002686_hash NULL nohasharray -+_001649_hash blk_rq_map_kern 4 47004 _001649_hash NULL -+_001650_hash bm_entry_read 3 10976 _001650_hash NULL -+_001651_hash bm_status_read 3 19583 _001651_hash NULL -+_001652_hash bnad_debugfs_read 3 50665 _001652_hash NULL -+_001653_hash bnad_debugfs_read_regrd 3 51308 _001653_hash NULL -+_001654_hash btmrvl_curpsmode_read 3 46939 _001654_hash NULL -+_001655_hash btmrvl_gpiogap_read 3 4718 _001655_hash NULL -+_001656_hash btmrvl_hscfgcmd_read 3 56303 _001656_hash NULL -+_001657_hash btmrvl_hscmd_read 3 1614 _001657_hash NULL -+_001658_hash btmrvl_hsmode_read 3 1647 _001658_hash NULL -+_001659_hash btmrvl_hsstate_read 3 920 _001659_hash NULL -+_001660_hash btmrvl_pscmd_read 3 24308 _001660_hash NULL -+_001661_hash btmrvl_psmode_read 3 22395 _001661_hash NULL -+_001662_hash btmrvl_psstate_read 3 50683 _001662_hash NULL -+_001663_hash btmrvl_txdnldready_read 3 413 _001663_hash NULL -+_001664_hash btrfs_add_link 5 9973 _001664_hash NULL -+_001665_hash btrfs_discard_extent 2 38547 _001665_hash NULL -+_001666_hash btrfs_find_create_tree_block 3 55812 _001666_hash NULL -+_001667_hash btrfsic_map_block 2 56751 _001667_hash NULL -+_001668_hash caif_stream_recvmsg 4 13173 _001668_hash NULL -+_001669_hash carl9170_alloc 1 27 _001669_hash NULL -+_001670_hash carl9170_debugfs_read 3 47738 _001670_hash NULL -+_001671_hash cgroup_read_s64 5 19570 _001671_hash NULL -+_001672_hash cgroup_read_u64 5 45532 _001672_hash NULL -+_001673_hash channel_type_read 3 47308 _001673_hash NULL -+_001674_hash codec_list_read_file 3 24910 _001674_hash NULL -+_001675_hash configfs_read_file 3 1683 _001675_hash NULL -+_001676_hash cpuset_common_file_read 5 8800 _001676_hash NULL -+_001677_hash create_subvol 4 2347 _001677_hash NULL -+_001678_hash cx18_copy_mdl_to_user 4 45549 _001678_hash NULL -+_001679_hash dai_list_read_file 3 25421 _001679_hash NULL -+_001680_hash dapm_bias_read_file 3 64715 _001680_hash NULL -+_001681_hash dapm_widget_power_read_file 3 59950 _001754_hash NULL nohasharray -+_001684_hash dbgfs_frame 3 45917 _001684_hash NULL -+_001685_hash dbgfs_state 3 38894 _001685_hash NULL -+_001686_hash debugfs_read 3 62535 _001686_hash NULL -+_001687_hash debug_output 3 18575 _001687_hash NULL -+_001688_hash debug_read 3 19322 _001688_hash NULL -+_001689_hash dfs_file_read 3 18116 _001689_hash NULL -+_001690_hash dma_memcpy_pg_to_iovec 6 1725 _001690_hash NULL -+_001691_hash dma_memcpy_to_iovec 5 12173 _001691_hash NULL -+_001692_hash dma_rx_errors_read 3 52045 _001692_hash NULL -+_001693_hash dma_rx_requested_read 3 65354 _001693_hash NULL -+_001694_hash dma_show_regs 3 35266 _001694_hash NULL -+_001695_hash dma_tx_errors_read 3 46060 _001695_hash NULL -+_001696_hash dma_tx_requested_read 3 16110 _001775_hash NULL nohasharray -+_001697_hash dm_exception_table_init 2 39645 _001697_hash &_001103_hash -+_001698_hash dn_recvmsg 4 17213 _001698_hash NULL -+_001699_hash dns_resolver_read 3 54658 _001699_hash NULL -+_001700_hash do_msgrcv 4 5590 _001700_hash NULL -+_001701_hash driver_state_read 3 17194 _001701_hash &_001394_hash -+_001702_hash dvb_demux_do_ioctl 3 34871 _001702_hash NULL -+_001703_hash dvb_dmxdev_buffer_read 4 20682 _001703_hash NULL -+_001704_hash dvb_dvr_do_ioctl 3 43355 _001704_hash NULL -+_001705_hash econet_recvmsg 4 40978 _001705_hash NULL -+_001706_hash event_calibration_read 3 21083 _001706_hash NULL -+_001707_hash event_heart_beat_read 3 48961 _001707_hash NULL -+_001708_hash event_oom_late_read 3 61175 _001708_hash &_001014_hash -+_001709_hash event_phy_transmit_error_read 3 10471 _001709_hash NULL -+_001710_hash event_rx_mem_empty_read 3 40363 _001710_hash NULL -+_001711_hash event_rx_mismatch_read 3 38518 _001711_hash NULL -+_001712_hash event_rx_pool_read 3 25792 _001712_hash NULL -+_001713_hash event_tx_stuck_read 3 19305 _001713_hash NULL -+_001714_hash excessive_retries_read 3 60425 _001714_hash NULL -+_001715_hash fallback_on_nodma_alloc 2 35332 _001715_hash NULL -+_001716_hash filter_read 3 61692 _001716_hash NULL -+_001717_hash format_devstat_counter 3 32550 _001717_hash NULL -+_001718_hash fragmentation_threshold_read 3 61718 _001718_hash NULL -+_001719_hash fuse_conn_limit_read 3 20084 _001719_hash NULL -+_001720_hash fuse_conn_waiting_read 3 49762 _001720_hash NULL -+_001721_hash generic_readlink 3 32654 _001721_hash NULL -+_001722_hash gpio_power_read 3 36059 _001722_hash NULL -+_001723_hash hash_recvmsg 4 50924 _001723_hash NULL -+_001724_hash ht40allow_map_read 3 55209 _002830_hash NULL nohasharray -+_001725_hash hwflags_read 3 52318 _001725_hash NULL -+_001726_hash hysdn_conf_read 3 42324 _003159_hash NULL nohasharray -+_001727_hash i2400m_rx_stats_read 3 57706 _001727_hash NULL -+_001728_hash i2400m_tx_stats_read 3 28527 _001728_hash NULL -+_001729_hash idmouse_read 3 63374 _001729_hash NULL -+_001730_hash ieee80211_if_read 3 6785 _001730_hash NULL -+_001731_hash ieee80211_rx_bss_info 3 61630 _001731_hash NULL -+_001732_hash ikconfig_read_current 3 1658 _001732_hash NULL -+_001733_hash il3945_sta_dbgfs_stats_table_read 3 48802 _001733_hash NULL -+_001734_hash il3945_ucode_general_stats_read 3 46111 _001734_hash NULL -+_001735_hash il3945_ucode_rx_stats_read 3 3048 _001735_hash NULL -+_001736_hash il3945_ucode_tx_stats_read 3 36016 _001736_hash NULL -+_001737_hash il4965_rs_sta_dbgfs_rate_scale_data_read 3 37792 _001737_hash NULL -+_001738_hash il4965_rs_sta_dbgfs_scale_table_read 3 38564 _001738_hash NULL -+_001739_hash il4965_rs_sta_dbgfs_stats_table_read 3 49206 _001739_hash NULL -+_001740_hash il4965_ucode_general_stats_read 3 56277 _001740_hash NULL -+_001741_hash il4965_ucode_rx_stats_read 3 61948 _001741_hash NULL -+_001742_hash il4965_ucode_tx_stats_read 3 12064 _001742_hash NULL -+_001743_hash il_dbgfs_chain_noise_read 3 38044 _001743_hash NULL -+_001744_hash il_dbgfs_channels_read 3 25005 _001744_hash NULL -+_001745_hash il_dbgfs_disable_ht40_read 3 42386 _001745_hash NULL -+_001746_hash il_dbgfs_fh_reg_read 3 40993 _001746_hash NULL -+_001747_hash il_dbgfs_force_reset_read 3 57517 _001747_hash NULL -+_001748_hash il_dbgfs_interrupt_read 3 3351 _001748_hash NULL -+_001749_hash il_dbgfs_missed_beacon_read 3 59956 _001749_hash NULL -+_001750_hash il_dbgfs_nvm_read 3 12288 _001750_hash NULL -+_001751_hash il_dbgfs_power_save_status_read 3 43165 _001751_hash NULL -+_001752_hash il_dbgfs_qos_read 3 33615 _001752_hash NULL -+_001753_hash il_dbgfs_rxon_filter_flags_read 3 19281 _001753_hash NULL -+_001754_hash il_dbgfs_rxon_flags_read 3 59950 _001754_hash &_001681_hash -+_001755_hash il_dbgfs_rx_queue_read 3 11221 _001755_hash NULL -+_001756_hash il_dbgfs_rx_stats_read 3 15243 _001756_hash NULL -+_001757_hash il_dbgfs_sensitivity_read 3 2370 _001757_hash NULL -+_001758_hash il_dbgfs_sram_read 3 62296 _001758_hash NULL -+_001759_hash il_dbgfs_stations_read 3 21532 _001759_hash NULL -+_001760_hash il_dbgfs_status_read 3 58388 _001760_hash NULL -+_001761_hash il_dbgfs_tx_queue_read 3 55668 _001761_hash NULL -+_001762_hash il_dbgfs_tx_stats_read 3 32913 _001762_hash NULL -+_001763_hash ima_show_htable_value 2 57136 _001763_hash NULL -+_001765_hash ipw_write 3 59807 _001765_hash NULL -+_001766_hash irda_recvmsg_stream 4 35280 _001766_hash NULL -+_001767_hash iscsi_tcp_conn_setup 2 16376 _001767_hash NULL -+_001768_hash isr_cmd_cmplt_read 3 53439 _001768_hash NULL -+_001769_hash isr_commands_read 3 41398 _001769_hash NULL -+_001770_hash isr_decrypt_done_read 3 49490 _001770_hash NULL -+_001771_hash isr_dma0_done_read 3 8574 _001771_hash NULL -+_001772_hash isr_dma1_done_read 3 48159 _001772_hash NULL -+_001773_hash isr_fiqs_read 3 34687 _001773_hash NULL -+_001774_hash isr_host_acknowledges_read 3 54136 _001774_hash NULL -+_001775_hash isr_hw_pm_mode_changes_read 3 16110 _001775_hash &_001696_hash -+_001776_hash isr_irqs_read 3 9181 _001776_hash NULL -+_001777_hash isr_low_rssi_read 3 64789 _001777_hash NULL -+_001778_hash isr_pci_pm_read 3 30271 _001778_hash NULL -+_001779_hash isr_rx_headers_read 3 38325 _001779_hash NULL -+_001780_hash isr_rx_mem_overflow_read 3 43025 _001780_hash NULL -+_001781_hash isr_rx_procs_read 3 31804 _001781_hash NULL -+_001782_hash isr_rx_rdys_read 3 35283 _001782_hash NULL -+_001783_hash isr_tx_exch_complete_read 3 16103 _001783_hash NULL -+_001784_hash isr_tx_procs_read 3 23084 _001784_hash NULL -+_001785_hash isr_wakeups_read 3 49607 _001785_hash NULL -+_001786_hash ivtv_read 3 57796 _001786_hash NULL -+_001787_hash iwl_dbgfs_bt_traffic_read 3 35534 _001787_hash NULL -+_001788_hash iwl_dbgfs_chain_noise_read 3 46355 _001788_hash NULL -+_001789_hash iwl_dbgfs_channels_read 3 6784 _001789_hash NULL -+_001790_hash iwl_dbgfs_current_sleep_command_read 3 2081 _001790_hash NULL -+_001791_hash iwl_dbgfs_disable_ht40_read 3 35761 _001791_hash NULL -+_001792_hash iwl_dbgfs_fh_reg_read 3 879 _001792_hash &_000393_hash -+_001793_hash iwl_dbgfs_force_reset_read 3 62628 _001793_hash NULL -+_001794_hash iwl_dbgfs_interrupt_read 3 23574 _001794_hash NULL -+_001795_hash iwl_dbgfs_log_event_read 3 2107 _001795_hash NULL -+_001796_hash iwl_dbgfs_missed_beacon_read 3 50584 _001796_hash NULL -+_001797_hash iwl_dbgfs_nvm_read 3 23845 _001797_hash NULL -+_001798_hash iwl_dbgfs_plcp_delta_read 3 55407 _001798_hash NULL -+_001799_hash iwl_dbgfs_power_save_status_read 3 54392 _001799_hash NULL -+_001800_hash iwl_dbgfs_protection_mode_read 3 13943 _001800_hash NULL -+_001801_hash iwl_dbgfs_qos_read 3 11753 _001801_hash NULL -+_001802_hash iwl_dbgfs_reply_tx_error_read 3 19205 _001802_hash NULL -+_001803_hash iwl_dbgfs_rx_handlers_read 3 18708 _001803_hash NULL -+_001804_hash iwl_dbgfs_rxon_filter_flags_read 3 28832 _001804_hash NULL -+_001805_hash iwl_dbgfs_rxon_flags_read 3 20795 _001805_hash NULL -+_001806_hash iwl_dbgfs_rx_queue_read 3 19943 _001806_hash NULL -+_001807_hash iwl_dbgfs_rx_statistics_read 3 62687 _001807_hash &_000425_hash -+_001808_hash iwl_dbgfs_sensitivity_read 3 63116 _003026_hash NULL nohasharray -+_001809_hash iwl_dbgfs_sleep_level_override_read 3 3038 _001809_hash NULL -+_001810_hash iwl_dbgfs_sram_read 3 44505 _001810_hash NULL -+_001811_hash iwl_dbgfs_stations_read 3 9309 _001811_hash NULL -+_001812_hash iwl_dbgfs_status_read 3 5171 _001812_hash NULL -+_001813_hash iwl_dbgfs_temperature_read 3 29224 _001813_hash NULL -+_001814_hash iwl_dbgfs_thermal_throttling_read 3 38779 _001814_hash NULL -+_001815_hash iwl_dbgfs_traffic_log_read 3 58870 _001815_hash NULL -+_001816_hash iwl_dbgfs_tx_queue_read 3 4635 _001816_hash NULL -+_001817_hash iwl_dbgfs_tx_statistics_read 3 314 _001817_hash NULL -+_001818_hash iwl_dbgfs_ucode_bt_stats_read 3 42820 _001818_hash NULL -+_001819_hash iwl_dbgfs_ucode_general_stats_read 3 49199 _001819_hash NULL -+_001820_hash iwl_dbgfs_ucode_rx_stats_read 3 58023 _001820_hash NULL -+_001821_hash iwl_dbgfs_ucode_tracing_read 3 47983 _001821_hash &_000349_hash -+_001822_hash iwl_dbgfs_ucode_tx_stats_read 3 31611 _001822_hash NULL -+_001823_hash iwl_dbgfs_wowlan_sram_read 3 540 _001823_hash NULL -+_001824_hash iwm_if_alloc 1 17027 _001824_hash &_001314_hash -+_001825_hash kernel_readv 3 35617 _001825_hash NULL -+_001826_hash key_algorithm_read 3 57946 _001826_hash NULL -+_001827_hash key_icverrors_read 3 20895 _001827_hash NULL -+_001828_hash key_key_read 3 3241 _001828_hash NULL -+_001829_hash key_replays_read 3 62746 _001829_hash NULL -+_001830_hash key_rx_spec_read 3 12736 _001830_hash NULL -+_001831_hash key_tx_spec_read 3 4862 _001831_hash NULL -+_001832_hash __kfifo_to_user 3 36555 _002199_hash NULL nohasharray -+_001833_hash __kfifo_to_user_r 3 39123 _001833_hash NULL -+_001834_hash kmem_zalloc_greedy 2-3 65268 _001834_hash NULL -+_001836_hash l2cap_chan_send 3 49995 _001836_hash NULL -+_001837_hash l2cap_sar_segment_sdu 3 27701 _001837_hash NULL -+_001838_hash lbs_debugfs_read 3 30721 _001838_hash NULL -+_001839_hash lbs_dev_info 3 51023 _001839_hash NULL -+_001840_hash lbs_host_sleep_read 3 31013 _001840_hash NULL -+_001841_hash lbs_rdbbp_read 3 45805 _001841_hash NULL -+_001842_hash lbs_rdmac_read 3 418 _001842_hash NULL -+_001843_hash lbs_rdrf_read 3 41431 _001843_hash NULL -+_001844_hash lbs_sleepparams_read 3 10840 _001844_hash NULL -+_001845_hash lbs_threshold_read 5 21046 _001845_hash NULL -+_001846_hash libfc_vport_create 2 4415 _001846_hash NULL -+_001847_hash lkdtm_debugfs_read 3 45752 _001847_hash NULL -+_001848_hash llcp_sock_recvmsg 4 13556 _001848_hash NULL -+_001849_hash long_retry_limit_read 3 59766 _001849_hash NULL -+_001850_hash lpfc_debugfs_dif_err_read 3 36303 _001850_hash NULL -+_001851_hash lpfc_debugfs_read 3 16566 _001851_hash NULL -+_001852_hash lpfc_idiag_baracc_read 3 58466 _002447_hash NULL nohasharray -+_001853_hash lpfc_idiag_ctlacc_read 3 33943 _001853_hash NULL -+_001854_hash lpfc_idiag_drbacc_read 3 15948 _001854_hash NULL -+_001855_hash lpfc_idiag_extacc_read 3 48301 _001855_hash NULL -+_001856_hash lpfc_idiag_mbxacc_read 3 28061 _001856_hash NULL -+_001857_hash lpfc_idiag_pcicfg_read 3 50334 _001857_hash NULL -+_001858_hash lpfc_idiag_queacc_read 3 13950 _001858_hash NULL -+_001859_hash lpfc_idiag_queinfo_read 3 55662 _001859_hash NULL -+_001860_hash mac80211_format_buffer 2 41010 _001860_hash NULL -+_001861_hash macvtap_put_user 4 55609 _001861_hash NULL -+_001862_hash macvtap_sendmsg 4 30629 _001862_hash NULL -+_001863_hash mic_calc_failure_read 3 59700 _001863_hash NULL -+_001864_hash mic_rx_pkts_read 3 27972 _001864_hash NULL -+_001865_hash minstrel_stats_read 3 17290 _001865_hash NULL -+_001866_hash mmc_ext_csd_read 3 13205 _001866_hash NULL -+_001867_hash mon_bin_read 3 6841 _001867_hash NULL -+_001868_hash mon_stat_read 3 25238 _001868_hash NULL -+_001870_hash mqueue_read_file 3 6228 _001870_hash NULL -+_001871_hash mwifiex_debug_read 3 53074 _001871_hash NULL -+_001872_hash mwifiex_getlog_read 3 54269 _001872_hash NULL -+_001873_hash mwifiex_info_read 3 53447 _001873_hash NULL -+_001874_hash mwifiex_rdeeprom_read 3 51429 _001874_hash NULL -+_001875_hash mwifiex_regrdwr_read 3 34472 _001875_hash NULL -+_001876_hash nfsd_vfs_read 6 62605 _003003_hash NULL nohasharray -+_001877_hash nfsd_vfs_write 6 54577 _001877_hash NULL -+_001878_hash nfs_idmap_lookup_id 2 10660 _001878_hash NULL -+_001879_hash o2hb_debug_read 3 37851 _001879_hash NULL -+_001880_hash o2net_debug_read 3 52105 _001880_hash NULL -+_001881_hash ocfs2_control_read 3 56405 _001881_hash NULL -+_001882_hash ocfs2_debug_read 3 14507 _001882_hash NULL -+_001883_hash ocfs2_readlink 3 50656 _001883_hash NULL -+_001884_hash oom_adjust_read 3 25127 _001884_hash NULL -+_001885_hash oom_score_adj_read 3 39921 _002116_hash NULL nohasharray -+_001886_hash oprofilefs_str_to_user 3 42182 _001886_hash NULL -+_001887_hash oprofilefs_ulong_to_user 3 11582 _001887_hash NULL -+_001888_hash _osd_req_list_objects 6 4204 _001888_hash NULL -+_001889_hash osd_req_read_kern 5 59990 _001889_hash NULL -+_001890_hash osd_req_write_kern 5 53486 _001890_hash NULL -+_001891_hash p54_init_common 1 23850 _001891_hash NULL -+_001892_hash packet_sendmsg 4 24954 _001892_hash NULL -+_001893_hash page_readlink 3 23346 _001893_hash NULL -+_001894_hash pcf50633_write_block 3 2124 _001894_hash NULL -+_001895_hash platform_list_read_file 3 34734 _001895_hash NULL -+_001896_hash pm860x_bulk_write 3 43875 _001896_hash NULL -+_001897_hash pm_qos_power_read 3 55891 _001897_hash NULL -+_001898_hash pms_read 3 53873 _001898_hash NULL -+_001899_hash port_show_regs 3 5904 _001899_hash NULL -+_001900_hash proc_coredump_filter_read 3 39153 _001900_hash NULL -+_001901_hash proc_fdinfo_read 3 62043 _001901_hash NULL -+_001902_hash proc_info_read 3 63344 _001902_hash NULL -+_001903_hash proc_loginuid_read 3 15631 _001903_hash NULL -+_001904_hash proc_pid_attr_read 3 10173 _001904_hash NULL -+_001905_hash proc_pid_readlink 3 52186 _001905_hash NULL -+_001906_hash proc_read 3 43614 _001906_hash NULL -+_001907_hash proc_self_readlink 3 38094 _001907_hash NULL -+_001908_hash proc_sessionid_read 3 6911 _002038_hash NULL nohasharray -+_001909_hash provide_user_output 3 41105 _001909_hash NULL -+_001910_hash ps_pspoll_max_apturn_read 3 6699 _001910_hash NULL -+_001911_hash ps_pspoll_timeouts_read 3 11776 _001911_hash NULL -+_001912_hash ps_pspoll_utilization_read 3 5361 _001912_hash NULL -+_001913_hash pstore_file_read 3 57288 _001913_hash NULL -+_001914_hash ps_upsd_max_apturn_read 3 19918 _001914_hash NULL -+_001915_hash ps_upsd_max_sptime_read 3 63362 _001915_hash NULL -+_001916_hash ps_upsd_timeouts_read 3 28924 _001916_hash NULL -+_001917_hash ps_upsd_utilization_read 3 51669 _001917_hash NULL -+_001918_hash pvr2_v4l2_read 3 18006 _001918_hash NULL -+_001919_hash pwr_disable_ps_read 3 13176 _001919_hash NULL -+_001920_hash pwr_elp_enter_read 3 5324 _001920_hash NULL -+_001921_hash pwr_enable_ps_read 3 17686 _001921_hash NULL -+_001922_hash pwr_fix_tsf_ps_read 3 26627 _001922_hash NULL -+_001923_hash pwr_missing_bcns_read 3 25824 _001923_hash NULL -+_001924_hash pwr_power_save_off_read 3 18355 _001924_hash NULL -+_001925_hash pwr_ps_enter_read 3 26935 _001925_hash &_000501_hash -+_001926_hash pwr_rcvd_awake_beacons_read 3 50505 _001926_hash NULL -+_001927_hash pwr_rcvd_beacons_read 3 52836 _001927_hash NULL -+_001928_hash pwr_tx_without_ps_read 3 48423 _001928_hash NULL -+_001929_hash pwr_tx_with_ps_read 3 60851 _001929_hash NULL -+_001930_hash pwr_wake_on_host_read 3 26321 _001930_hash NULL -+_001931_hash pwr_wake_on_timer_exp_read 3 22640 _001931_hash NULL -+_001932_hash queues_read 3 24877 _001932_hash NULL -+_001933_hash raw_recvmsg 4 17277 _001933_hash NULL -+_001934_hash rcname_read 3 25919 _001934_hash NULL -+_001935_hash read_4k_modal_eeprom 3 30212 _001935_hash NULL -+_001936_hash read_9287_modal_eeprom 3 59327 _001936_hash NULL -+_001937_hash reada_find_extent 2 63486 _001937_hash NULL -+_001938_hash read_def_modal_eeprom 3 14041 _001938_hash NULL -+_001939_hash read_enabled_file_bool 3 37744 _001939_hash NULL -+_001940_hash read_file_ani 3 23161 _001940_hash NULL -+_001941_hash read_file_antenna 3 13574 _001941_hash NULL -+_001942_hash read_file_base_eeprom 3 42168 _001942_hash NULL -+_001943_hash read_file_beacon 3 32595 _001943_hash NULL -+_001944_hash read_file_blob 3 57406 _001944_hash NULL -+_001945_hash read_file_bool 3 4180 _001945_hash NULL -+_001946_hash read_file_credit_dist_stats 3 54367 _001946_hash NULL -+_001947_hash read_file_debug 3 58256 _001947_hash NULL -+_001948_hash read_file_disable_ani 3 6536 _001948_hash NULL -+_001949_hash read_file_dma 3 9530 _001949_hash NULL -+_001950_hash read_file_dump_nfcal 3 18766 _001950_hash NULL -+_001951_hash read_file_frameerrors 3 64001 _001951_hash NULL -+_001952_hash read_file_interrupt 3 61742 _001959_hash NULL nohasharray -+_001953_hash read_file_misc 3 9948 _001953_hash NULL -+_001954_hash read_file_modal_eeprom 3 39909 _001954_hash NULL -+_001955_hash read_file_queue 3 40895 _001955_hash NULL -+_001956_hash read_file_rcstat 3 22854 _001956_hash NULL -+_001957_hash read_file_recv 3 48232 _001957_hash NULL -+_001958_hash read_file_regidx 3 33370 _001958_hash NULL -+_001959_hash read_file_regval 3 61742 _001959_hash &_001952_hash -+_001960_hash read_file_reset 3 52310 _001960_hash NULL -+_001961_hash read_file_rx_chainmask 3 41605 _001961_hash NULL -+_001962_hash read_file_slot 3 50111 _001962_hash NULL -+_001963_hash read_file_stations 3 35795 _001963_hash NULL -+_001964_hash read_file_tgt_int_stats 3 20697 _001964_hash NULL -+_001965_hash read_file_tgt_rx_stats 3 33944 _001965_hash NULL -+_001966_hash read_file_tgt_stats 3 8959 _001966_hash NULL -+_001967_hash read_file_tgt_tx_stats 3 51847 _001967_hash NULL -+_001968_hash read_file_tx_chainmask 3 3829 _001968_hash NULL -+_001969_hash read_file_war_stats 3 292 _001969_hash NULL -+_001970_hash read_file_xmit 3 21487 _001970_hash NULL -+_001971_hash read_from_oldmem 2 3337 _001971_hash NULL -+_001972_hash read_oldmem 3 55658 _001972_hash NULL -+_001973_hash regmap_name_read_file 3 39379 _001973_hash NULL -+_001974_hash repair_io_failure 4 4815 _001974_hash NULL -+_001975_hash request_key_and_link 4 42693 _001975_hash NULL -+_001976_hash res_counter_read 4 33499 _001976_hash NULL -+_001977_hash retry_count_read 3 52129 _001977_hash NULL -+_001978_hash rs_sta_dbgfs_rate_scale_data_read 3 47165 _001978_hash NULL -+_001979_hash rs_sta_dbgfs_scale_table_read 3 40262 _001979_hash NULL -+_001980_hash rs_sta_dbgfs_stats_table_read 3 56573 _001980_hash NULL -+_001981_hash rts_threshold_read 3 44384 _001981_hash NULL -+_001982_hash rx_dropped_read 3 44799 _001982_hash NULL -+_001983_hash rx_fcs_err_read 3 62844 _001983_hash NULL -+_001984_hash rx_hdr_overflow_read 3 64407 _001984_hash NULL -+_001985_hash rx_hw_stuck_read 3 57179 _001985_hash NULL -+_001986_hash rx_out_of_mem_read 3 10157 _001986_hash NULL -+_001987_hash rx_path_reset_read 3 23801 _001987_hash NULL -+_001988_hash rxpipe_beacon_buffer_thres_host_int_trig_rx_data_read 3 55106 _001988_hash NULL -+_001989_hash rxpipe_descr_host_int_trig_rx_data_read 3 22001 _003089_hash NULL nohasharray -+_001990_hash rxpipe_missed_beacon_host_int_trig_rx_data_read 3 63405 _001990_hash NULL -+_001991_hash rxpipe_rx_prep_beacon_drop_read 3 2403 _001991_hash NULL -+_001992_hash rxpipe_tx_xfr_host_int_trig_rx_data_read 3 35538 _001992_hash NULL -+_001993_hash rx_reset_counter_read 3 58001 _001993_hash NULL -+_001994_hash rx_xfr_hint_trig_read 3 40283 _001994_hash NULL -+_001995_hash s5m_bulk_write 3 4833 _001995_hash NULL -+_001996_hash scrub_setup_recheck_block 3-4 56245 _001996_hash NULL -+_001998_hash scsi_adjust_queue_depth 3 12802 _001998_hash NULL -+_001999_hash selinux_inode_notifysecctx 3 36896 _001999_hash NULL -+_002000_hash sel_read_avc_cache_threshold 3 33942 _002000_hash NULL -+_002001_hash sel_read_avc_hash_stats 3 1984 _002001_hash NULL -+_002002_hash sel_read_bool 3 24236 _002002_hash NULL -+_002003_hash sel_read_checkreqprot 3 33068 _002003_hash NULL -+_002004_hash sel_read_class 3 12669 _002541_hash NULL nohasharray -+_002005_hash sel_read_enforce 3 2828 _002005_hash NULL -+_002006_hash sel_read_handle_status 3 56139 _002006_hash NULL -+_002007_hash sel_read_handle_unknown 3 57933 _002007_hash NULL -+_002008_hash sel_read_initcon 3 32362 _002008_hash NULL -+_002009_hash sel_read_mls 3 25369 _002009_hash NULL -+_002010_hash sel_read_perm 3 42302 _002010_hash NULL -+_002011_hash sel_read_policy 3 55947 _002011_hash NULL -+_002012_hash sel_read_policycap 3 28544 _002012_hash NULL -+_002013_hash sel_read_policyvers 3 55 _002013_hash NULL -+_002014_hash send_msg 4 37323 _002014_hash NULL -+_002015_hash send_packet 4 52960 _002015_hash NULL -+_002016_hash short_retry_limit_read 3 4687 _002016_hash NULL -+_002017_hash simple_attr_read 3 24738 _002017_hash NULL -+_002018_hash simple_transaction_read 3 17076 _002018_hash NULL -+_002019_hash skb_copy_datagram_const_iovec 2-5-4 48102 _002019_hash NULL -+_002022_hash skb_copy_datagram_iovec 2-4 5806 _002022_hash NULL -+_002024_hash smk_read_ambient 3 61220 _002024_hash NULL -+_002025_hash smk_read_direct 3 15803 _002025_hash NULL -+_002026_hash smk_read_doi 3 30813 _002026_hash NULL -+_002027_hash smk_read_logging 3 37804 _002027_hash NULL -+_002028_hash smk_read_onlycap 3 3855 _002028_hash NULL -+_002029_hash snapshot_read 3 22601 _002029_hash NULL -+_002030_hash snd_cs4281_BA0_read 5 6847 _002030_hash NULL -+_002031_hash snd_cs4281_BA1_read 5 20323 _002031_hash NULL -+_002032_hash snd_cs46xx_io_read 5 45734 _002032_hash NULL -+_002033_hash snd_gus_dram_read 4 56686 _002033_hash NULL -+_002034_hash snd_pcm_oss_read 3 28317 _002034_hash NULL -+_002035_hash snd_rme32_capture_copy 5 39653 _002035_hash NULL -+_002036_hash snd_rme96_capture_copy 5 58484 _002036_hash NULL -+_002037_hash snd_soc_hw_bulk_write_raw 4 14245 _002037_hash NULL -+_002038_hash spi_show_regs 3 6911 _002038_hash &_001908_hash -+_002039_hash sta_agg_status_read 3 14058 _002039_hash NULL -+_002040_hash sta_connected_time_read 3 17435 _002040_hash NULL -+_002041_hash sta_flags_read 3 56710 _002041_hash NULL -+_002042_hash sta_ht_capa_read 3 10366 _002042_hash NULL -+_002043_hash sta_last_seq_ctrl_read 3 19106 _002043_hash NULL -+_002044_hash sta_num_ps_buf_frames_read 3 1488 _002044_hash NULL -+_002045_hash st_read 3 51251 _002045_hash NULL -+_002046_hash supply_map_read_file 3 10608 _002046_hash NULL -+_002047_hash sysfs_read_file 3 42113 _002047_hash NULL -+_002048_hash sys_lgetxattr 4 45531 _002048_hash NULL -+_002049_hash sys_preadv 3 17100 _002049_hash NULL -+_002050_hash sys_pwritev 3 41722 _002050_hash NULL -+_002051_hash sys_readv 3 50664 _002051_hash NULL -+_002052_hash sys_rt_sigpending 2 24961 _002052_hash NULL -+_002053_hash sys_writev 3 28384 _002053_hash NULL -+_002054_hash test_iso_queue 5 62534 _002054_hash NULL -+_002055_hash ts_read 3 44687 _002055_hash NULL -+_002056_hash TSS_authhmac 3 12839 _002056_hash NULL -+_002057_hash TSS_checkhmac1 5 31429 _002057_hash NULL -+_002058_hash TSS_checkhmac2 5-7 40520 _002058_hash NULL -+_002060_hash tt3650_ci_msg_locked 4 8013 _002060_hash NULL -+_002061_hash tun_sendmsg 4 10337 _002061_hash NULL -+_002062_hash tx_internal_desc_overflow_read 3 47300 _002062_hash NULL -+_002063_hash tx_queue_len_read 3 1463 _002063_hash NULL -+_002064_hash tx_queue_status_read 3 44978 _002064_hash NULL -+_002065_hash ubi_io_write_data 4-5 40305 _002065_hash NULL -+_002067_hash uhci_debug_read 3 5911 _002067_hash NULL -+_002068_hash unix_stream_recvmsg 4 35210 _002068_hash NULL -+_002069_hash uvc_debugfs_stats_read 3 56651 _002069_hash NULL -+_002070_hash vhost_add_used_and_signal_n 4 8038 _002070_hash NULL -+_002071_hash vifs_state_read 3 33762 _002071_hash NULL -+_002072_hash vmbus_open 2-3 12154 _002072_hash NULL -+_002074_hash waiters_read 3 40902 _002074_hash NULL -+_002075_hash wep_addr_key_count_read 3 20174 _002075_hash NULL -+_002076_hash wep_decrypt_fail_read 3 58567 _002076_hash NULL -+_002077_hash wep_default_key_count_read 3 43035 _002077_hash NULL -+_002078_hash wep_interrupt_read 3 41492 _002078_hash NULL -+_002079_hash wep_key_not_found_read 3 13377 _002079_hash &_000915_hash -+_002080_hash wep_packets_read 3 18751 _002080_hash NULL -+_002081_hash wl1271_format_buffer 2 20834 _002081_hash NULL -+_002082_hash wm8994_bulk_write 3 13615 _002082_hash NULL -+_002083_hash wusb_prf_256 7 29203 _002083_hash NULL -+_002084_hash wusb_prf_64 7 51065 _002084_hash NULL -+_002085_hash xfs_buf_read_uncached 4 27519 _002085_hash NULL -+_002086_hash xfs_iext_add 3 41422 _002086_hash NULL -+_002087_hash xfs_iext_remove_direct 3 40744 _002087_hash NULL -+_002088_hash xfs_trans_get_efd 3 51148 _002088_hash NULL -+_002089_hash xfs_trans_get_efi 2 7898 _002089_hash NULL -+_002090_hash xlog_get_bp 2 23229 _002090_hash NULL -+_002091_hash xz_dec_init 2 29029 _002091_hash NULL -+_002092_hash aac_change_queue_depth 2 825 _002092_hash NULL -+_002093_hash agp_allocate_memory_wrap 1 16576 _002093_hash NULL -+_002094_hash arcmsr_adjust_disk_queue_depth 2 16756 _002094_hash NULL -+_002095_hash atalk_recvmsg 4 22053 _002095_hash NULL -+_002097_hash atomic_read_file 3 16227 _002097_hash NULL -+_002098_hash ax25_recvmsg 4 64441 _002098_hash NULL -+_002099_hash beacon_interval_read 3 7091 _002099_hash NULL -+_002100_hash btrfs_init_new_buffer 4 55761 _002100_hash NULL -+_002101_hash btrfs_mksubvol 3 39479 _002101_hash NULL -+_002102_hash bt_sock_recvmsg 4 12316 _002102_hash NULL -+_002103_hash bt_sock_stream_recvmsg 4 52518 _002103_hash NULL -+_002104_hash caif_seqpkt_recvmsg 4 32241 _002104_hash NULL -+_002105_hash cpu_type_read 3 36540 _002105_hash NULL -+_002106_hash cx18_read 3 23699 _002106_hash NULL -+_002107_hash dccp_recvmsg 4 16056 _002107_hash NULL -+_002108_hash depth_read 3 31112 _002108_hash NULL -+_002109_hash dfs_global_file_read 3 7787 _002109_hash NULL -+_002110_hash dgram_recvmsg 4 23104 _002110_hash NULL -+_002111_hash dma_skb_copy_datagram_iovec 3-5 21516 _002111_hash NULL -+_002113_hash dtim_interval_read 3 654 _002113_hash NULL -+_002114_hash dynamic_ps_timeout_read 3 10110 _002114_hash NULL -+_002115_hash enable_read 3 2117 _002115_hash NULL -+_002116_hash exofs_read_kern 6 39921 _002116_hash &_001885_hash -+_002117_hash fc_change_queue_depth 2 36841 _002117_hash NULL -+_002118_hash forced_ps_read 3 31685 _002118_hash NULL -+_002119_hash frequency_read 3 64031 _003106_hash NULL nohasharray -+_002120_hash get_alua_req 3 4166 _002120_hash NULL -+_002121_hash get_rdac_req 3 45882 _002121_hash NULL -+_002122_hash hci_sock_recvmsg 4 7072 _002122_hash NULL -+_002123_hash hpsa_change_queue_depth 2 15449 _002123_hash NULL -+_002124_hash hptiop_adjust_disk_queue_depth 2 20122 _002124_hash NULL -+_002125_hash ide_queue_pc_tail 5 11673 _002125_hash NULL -+_002126_hash ide_raw_taskfile 4 42355 _002126_hash NULL -+_002127_hash idetape_queue_rw_tail 3 29562 _002127_hash NULL -+_002128_hash ieee80211_if_read_aid 3 9705 _002128_hash NULL -+_002129_hash ieee80211_if_read_auto_open_plinks 3 38268 _002129_hash NULL -+_002130_hash ieee80211_if_read_ave_beacon 3 64924 _002130_hash NULL -+_002131_hash ieee80211_if_read_bssid 3 35161 _002131_hash NULL -+_002132_hash ieee80211_if_read_channel_type 3 23884 _002132_hash NULL -+_002133_hash ieee80211_if_read_dot11MeshConfirmTimeout 3 60670 _002133_hash NULL -+_002134_hash ieee80211_if_read_dot11MeshGateAnnouncementProtocol 3 14486 _002134_hash NULL -+_002135_hash ieee80211_if_read_dot11MeshHoldingTimeout 3 47356 _002135_hash NULL -+_002136_hash ieee80211_if_read_dot11MeshHWMPactivePathTimeout 3 7368 _002136_hash NULL -+_002137_hash ieee80211_if_read_dot11MeshHWMPmaxPREQretries 3 59829 _002137_hash NULL -+_002138_hash ieee80211_if_read_dot11MeshHWMPnetDiameterTraversalTime 3 1589 _002138_hash NULL -+_002139_hash ieee80211_if_read_dot11MeshHWMPperrMinInterval 3 17346 _002139_hash NULL -+_002140_hash ieee80211_if_read_dot11MeshHWMPpreqMinInterval 3 24208 _002140_hash NULL -+_002141_hash ieee80211_if_read_dot11MeshHWMPRannInterval 3 2249 _002141_hash NULL -+_002142_hash ieee80211_if_read_dot11MeshHWMPRootMode 3 51441 _002142_hash NULL -+_002143_hash ieee80211_if_read_dot11MeshMaxPeerLinks 3 23878 _002143_hash NULL -+_002144_hash ieee80211_if_read_dot11MeshMaxRetries 3 12756 _002144_hash NULL -+_002145_hash ieee80211_if_read_dot11MeshRetryTimeout 3 52168 _002145_hash NULL -+_002146_hash ieee80211_if_read_dot11MeshTTL 3 58307 _002146_hash NULL -+_002147_hash ieee80211_if_read_dropped_frames_congestion 3 32603 _002147_hash NULL -+_002148_hash ieee80211_if_read_dropped_frames_no_route 3 33383 _002148_hash NULL -+_002149_hash ieee80211_if_read_dropped_frames_ttl 3 44500 _002149_hash NULL -+_002150_hash ieee80211_if_read_drop_unencrypted 3 37053 _002150_hash NULL -+_002151_hash ieee80211_if_read_dtim_count 3 38419 _002151_hash NULL -+_002152_hash ieee80211_if_read_element_ttl 3 18869 _002152_hash NULL -+_002153_hash ieee80211_if_read_estab_plinks 3 32533 _002153_hash NULL -+_002154_hash ieee80211_if_read_flags 3 57470 _002389_hash NULL nohasharray -+_002155_hash ieee80211_if_read_fwded_frames 3 36520 _002155_hash NULL -+_002156_hash ieee80211_if_read_fwded_mcast 3 39571 _002156_hash &_000151_hash -+_002157_hash ieee80211_if_read_fwded_unicast 3 59740 _002859_hash NULL nohasharray -+_002158_hash ieee80211_if_read_last_beacon 3 31257 _002158_hash NULL -+_002159_hash ieee80211_if_read_min_discovery_timeout 3 13946 _002159_hash NULL -+_002160_hash ieee80211_if_read_num_buffered_multicast 3 12716 _002160_hash NULL -+_002161_hash ieee80211_if_read_num_sta_authorized 3 56177 _002161_hash NULL -+_002162_hash ieee80211_if_read_num_sta_ps 3 34722 _002162_hash NULL -+_002163_hash ieee80211_if_read_path_refresh_time 3 25545 _002163_hash NULL -+_002164_hash ieee80211_if_read_peer 3 45233 _002164_hash NULL -+_002165_hash ieee80211_if_read_rc_rateidx_mask_2ghz 3 61570 _002165_hash NULL -+_002166_hash ieee80211_if_read_rc_rateidx_mask_5ghz 3 27183 _002166_hash NULL -+_002167_hash ieee80211_if_read_rc_rateidx_mcs_mask_2ghz 3 37675 _002167_hash NULL -+_002168_hash ieee80211_if_read_rc_rateidx_mcs_mask_5ghz 3 44423 _002168_hash NULL -+_002169_hash ieee80211_if_read_rssi_threshold 3 49260 _002169_hash NULL -+_002170_hash ieee80211_if_read_smps 3 27416 _002170_hash NULL -+_002171_hash ieee80211_if_read_state 3 9813 _002280_hash NULL nohasharray -+_002172_hash ieee80211_if_read_tkip_mic_test 3 19565 _002172_hash NULL -+_002173_hash ieee80211_if_read_tsf 3 16420 _002173_hash NULL -+_002174_hash ieee80211_if_read_uapsd_max_sp_len 3 15067 _002174_hash NULL -+_002175_hash ieee80211_if_read_uapsd_queues 3 55150 _002175_hash NULL -+_002176_hash ieee80211_rx_mgmt_beacon 3 24430 _002176_hash NULL -+_002177_hash ieee80211_rx_mgmt_probe_resp 3 6918 _002177_hash NULL -+_002178_hash ima_show_htable_violations 3 10619 _002178_hash NULL -+_002179_hash ima_show_measurements_count 3 23536 _002179_hash NULL -+_002180_hash insert_one_name 7 61668 _002180_hash NULL -+_002181_hash ipr_change_queue_depth 2 6431 _002181_hash NULL -+_002182_hash ip_recv_error 3 23109 _002182_hash NULL -+_002183_hash ipv6_recv_error 3 56347 _002183_hash NULL -+_002184_hash ipv6_recv_rxpmtu 3 7142 _002184_hash NULL -+_002185_hash ipx_recvmsg 4 44366 _002185_hash NULL -+_002186_hash irda_recvmsg_dgram 4 32631 _002186_hash NULL -+_002187_hash iscsi_change_queue_depth 2 23416 _002187_hash NULL -+_002188_hash ivtv_read_pos 3 34400 _002188_hash &_000303_hash -+_002189_hash key_conf_hw_key_idx_read 3 25003 _002189_hash NULL -+_002190_hash key_conf_keyidx_read 3 42443 _002190_hash NULL -+_002191_hash key_conf_keylen_read 3 49758 _002191_hash NULL -+_002192_hash key_flags_read 3 25931 _002192_hash NULL -+_002193_hash key_ifindex_read 3 31411 _002193_hash NULL -+_002194_hash key_tx_rx_count_read 3 44742 _002194_hash NULL -+_002195_hash l2cap_sock_sendmsg 4 63427 _002195_hash NULL -+_002196_hash l2tp_ip_recvmsg 4 22681 _002196_hash NULL -+_002197_hash llc_ui_recvmsg 4 3826 _002197_hash NULL -+_002198_hash lpfc_change_queue_depth 2 25905 _002198_hash NULL -+_002199_hash macvtap_do_read 4 36555 _002199_hash &_001832_hash -+_002200_hash megaraid_change_queue_depth 2 64815 _002200_hash NULL -+_002201_hash megasas_change_queue_depth 2 32747 _002201_hash NULL -+_002202_hash mptscsih_change_queue_depth 2 26036 _002202_hash NULL -+_002203_hash NCR_700_change_queue_depth 2 31742 _002203_hash NULL -+_002204_hash netlink_recvmsg 4 61600 _002204_hash NULL -+_002205_hash nfsctl_transaction_read 3 48250 _002205_hash NULL -+_002206_hash nfs_map_group_to_gid 3 15892 _002206_hash NULL -+_002207_hash nfs_map_name_to_uid 3 51132 _002207_hash NULL -+_002208_hash nr_recvmsg 4 12649 _002208_hash NULL -+_002209_hash osd_req_list_collection_objects 5 36664 _002209_hash NULL -+_002210_hash osd_req_list_partition_objects 5 56464 _002210_hash NULL -+_002212_hash packet_recv_error 3 16669 _002212_hash NULL -+_002213_hash packet_recvmsg 4 47700 _002213_hash NULL -+_002214_hash pep_recvmsg 4 19402 _002214_hash NULL -+_002215_hash pfkey_recvmsg 4 53604 _002215_hash NULL -+_002216_hash ping_recvmsg 4 25597 _002216_hash NULL -+_002217_hash pmcraid_change_queue_depth 2 9116 _002217_hash NULL -+_002218_hash pn_recvmsg 4 30887 _002218_hash NULL -+_002219_hash pointer_size_read 3 51863 _002219_hash NULL -+_002220_hash power_read 3 15939 _002220_hash NULL -+_002221_hash pppoe_recvmsg 4 15073 _002221_hash NULL -+_002222_hash pppol2tp_recvmsg 4 57742 _002222_hash NULL -+_002223_hash qla2x00_adjust_sdev_qdepth_up 2 20097 _002223_hash NULL -+_002224_hash qla2x00_change_queue_depth 2 24742 _002224_hash NULL -+_002225_hash raw_recvmsg 4 52529 _002225_hash NULL -+_002226_hash rawsock_recvmsg 4 12144 _002226_hash NULL -+_002227_hash rawv6_recvmsg 4 30265 _002227_hash NULL -+_002228_hash reada_add_block 2 54247 _002228_hash NULL -+_002229_hash readahead_tree_block 3 36285 _002229_hash NULL -+_002230_hash reada_tree_block_flagged 3 18402 _002230_hash NULL -+_002231_hash read_tree_block 3 841 _002231_hash NULL -+_002232_hash recover_peb 6-7 29238 _002232_hash NULL -+_002234_hash recv_msg 4 48709 _002234_hash NULL -+_002235_hash recv_stream 4 30138 _002235_hash NULL -+_002236_hash _req_append_segment 2 41031 _002236_hash NULL -+_002237_hash request_key_async 4 6990 _002237_hash NULL -+_002238_hash request_key_async_with_auxdata 4 46624 _002238_hash NULL -+_002239_hash request_key_with_auxdata 4 24515 _002239_hash NULL -+_002240_hash rose_recvmsg 4 2368 _002240_hash NULL -+_002241_hash rxrpc_recvmsg 4 26233 _002241_hash NULL -+_002242_hash rx_streaming_always_read 3 49401 _002242_hash NULL -+_002243_hash rx_streaming_interval_read 3 55291 _002243_hash NULL -+_002244_hash sas_change_queue_depth 2 18555 _002244_hash NULL -+_002245_hash scsi_activate_tcq 2 42640 _002245_hash NULL -+_002246_hash scsi_deactivate_tcq 2 47086 _002246_hash NULL -+_002247_hash scsi_execute 5 33596 _002247_hash NULL -+_002248_hash _scsih_adjust_queue_depth 2 1083 _002248_hash NULL -+_002249_hash scsi_init_shared_tag_map 2 59812 _002249_hash NULL -+_002250_hash scsi_track_queue_full 2 44239 _002250_hash NULL -+_002251_hash sctp_recvmsg 4 23265 _002251_hash NULL -+_002252_hash send_stream 4 3397 _002252_hash NULL -+_002253_hash skb_copy_and_csum_datagram_iovec 2 24466 _002253_hash NULL -+_002255_hash snd_gf1_mem_proc_dump 5 16926 _002255_hash NULL -+_002256_hash split_scan_timeout_read 3 20029 _002256_hash NULL -+_002257_hash sta_dev_read 3 14782 _002257_hash NULL -+_002258_hash sta_inactive_ms_read 3 25690 _002258_hash NULL -+_002259_hash sta_last_signal_read 3 31818 _002259_hash NULL -+_002260_hash stats_dot11ACKFailureCount_read 3 45558 _002260_hash NULL -+_002261_hash stats_dot11FCSErrorCount_read 3 28154 _002261_hash NULL -+_002262_hash stats_dot11RTSFailureCount_read 3 43948 _002262_hash NULL -+_002263_hash stats_dot11RTSSuccessCount_read 3 33065 _002263_hash NULL -+_002264_hash storvsc_connect_to_vsp 2 22 _002264_hash NULL -+_002265_hash suspend_dtim_interval_read 3 64971 _002265_hash NULL -+_002266_hash sys_msgrcv 3 959 _002266_hash NULL -+_002267_hash tcm_loop_change_queue_depth 2 42454 _002267_hash NULL -+_002268_hash tcp_copy_to_iovec 3 28344 _002268_hash NULL -+_002269_hash tcp_recvmsg 4 31238 _002269_hash NULL -+_002270_hash timeout_read 3 47915 _002270_hash NULL -+_002271_hash total_ps_buffered_read 3 16365 _002271_hash NULL -+_002272_hash tun_put_user 4 59849 _002272_hash NULL -+_002273_hash twa_change_queue_depth 2 48808 _002273_hash NULL -+_002274_hash tw_change_queue_depth 2 11116 _002274_hash NULL -+_002275_hash twl_change_queue_depth 2 41342 _002275_hash NULL -+_002276_hash ubi_eba_write_leb 5-6 19826 _002276_hash NULL -+_002278_hash ubi_eba_write_leb_st 5 27896 _002278_hash NULL -+_002279_hash udp_recvmsg 4 42558 _002279_hash NULL -+_002280_hash udpv6_recvmsg 4 9813 _002280_hash &_002171_hash -+_002281_hash ulong_read_file 3 42304 _002281_hash &_000511_hash -+_002282_hash unix_dgram_recvmsg 4 14952 _002282_hash NULL -+_002283_hash user_power_read 3 39414 _002283_hash NULL -+_002284_hash vcc_recvmsg 4 37198 _002284_hash NULL -+_002285_hash wep_iv_read 3 54744 _002285_hash NULL -+_002286_hash x25_recvmsg 4 42777 _002286_hash NULL -+_002287_hash xfs_iext_insert 3 18667 _002287_hash NULL -+_002288_hash xfs_iext_remove 3 50909 _002288_hash NULL -+_002289_hash xlog_find_verify_log_record 2 18870 _002289_hash NULL -+_002290_hash btrfs_alloc_free_block 3 29982 _002290_hash NULL -+_002291_hash cx18_read_pos 3 4683 _002291_hash NULL -+_002292_hash l2cap_sock_recvmsg 4 59886 _002292_hash NULL -+_002293_hash osd_req_list_dev_partitions 4 60027 _002293_hash NULL -+_002294_hash osd_req_list_partition_collections 5 38223 _002294_hash NULL -+_002295_hash osst_do_scsi 4 44410 _002295_hash NULL -+_002296_hash qla2x00_handle_queue_full 2 24365 _002296_hash NULL -+_002297_hash rfcomm_sock_recvmsg 4 22227 _002297_hash NULL -+_002298_hash scsi_execute_req 5 42088 _002298_hash NULL -+_002299_hash _scsih_change_queue_depth 2 26230 _002299_hash NULL -+_002300_hash spi_execute 5 28736 _002300_hash NULL -+_002301_hash submit_inquiry 3 42108 _002301_hash NULL -+_002302_hash tcp_dma_try_early_copy 3 37651 _002302_hash NULL -+_002303_hash tun_do_read 4 50800 _002303_hash NULL -+_002304_hash ubi_eba_atomic_leb_change 5 13041 _002304_hash NULL -+_002305_hash ubi_leb_write 4-5 41691 _002305_hash NULL -+_002307_hash unix_seqpacket_recvmsg 4 23062 _002307_hash NULL -+_002308_hash write_leb 5 36957 _002308_hash NULL -+_002309_hash ch_do_scsi 4 31171 _002309_hash NULL -+_002310_hash dbg_leb_write 4-5 20478 _002310_hash NULL -+_002312_hash scsi_mode_sense 5 16835 _002312_hash NULL -+_002313_hash scsi_vpd_inquiry 4 30040 _002313_hash NULL -+_002314_hash ses_recv_diag 4 47143 _002314_hash &_000673_hash -+_002315_hash ses_send_diag 4 64527 _002315_hash NULL -+_002316_hash spi_dv_device_echo_buffer 2-3 39846 _002316_hash NULL -+_002318_hash ubifs_leb_write 4-5 61226 _002318_hash NULL -+_002320_hash ubi_leb_change 4 14899 _002320_hash NULL -+_002321_hash ubi_write 4-5 30809 _002321_hash NULL -+_002322_hash dbg_leb_change 4 19969 _002322_hash NULL -+_002323_hash gluebi_write 3 27905 _002323_hash NULL -+_002324_hash scsi_get_vpd_page 4 51951 _002324_hash NULL -+_002325_hash sd_do_mode_sense 5 11507 _002325_hash NULL -+_002326_hash ubifs_leb_change 4 22399 _002436_hash NULL nohasharray -+_002327_hash ubifs_write_node 5 15088 _002327_hash NULL -+_002328_hash fixup_leb 3 43256 _002328_hash NULL -+_002329_hash recover_head 3 17904 _002329_hash NULL -+_002330_hash alloc_cpu_rmap 1 65363 _002330_hash NULL -+_002331_hash alloc_ebda_hpc 1-2 50046 _002331_hash NULL -+_002333_hash alloc_sched_domains 1 28972 _002333_hash NULL -+_002334_hash amthi_read 4 45831 _002334_hash NULL -+_002335_hash bcm_char_read 3 31750 _002335_hash NULL -+_002336_hash BcmCopySection 5 2035 _002336_hash NULL -+_002337_hash buffer_from_user 3 51826 _002337_hash NULL -+_002338_hash buffer_to_user 3 35439 _002338_hash NULL -+_002339_hash c4iw_init_resource_fifo 3 48090 _002339_hash NULL -+_002340_hash c4iw_init_resource_fifo_random 3 25547 _002340_hash NULL -+_002341_hash card_send_command 3 40757 _002341_hash NULL -+_002342_hash chd_dec_fetch_cdata 3 50926 _002342_hash NULL -+_002343_hash crystalhd_create_dio_pool 2 3427 _002343_hash NULL -+_002344_hash crystalhd_user_data 3 18407 _002344_hash NULL -+_002345_hash cxio_init_resource_fifo 3 28764 _002345_hash NULL -+_002346_hash cxio_init_resource_fifo_random 3 47151 _002346_hash NULL -+_002347_hash do_pages_stat 2 4437 _002347_hash NULL -+_002348_hash do_read_log_to_user 4 3236 _002348_hash NULL -+_002349_hash do_write_log_from_user 3 39362 _002349_hash NULL -+_002350_hash dt3155_read 3 59226 _002350_hash NULL -+_002351_hash easycap_alsa_vmalloc 2 14426 _002351_hash NULL -+_002352_hash evm_read_key 3 54674 _002352_hash NULL -+_002353_hash evm_write_key 3 27715 _002353_hash NULL -+_002354_hash fir16_create 3 5574 _002354_hash NULL -+_002355_hash iio_allocate_device 1 18821 _002355_hash NULL -+_002356_hash __iio_allocate_kfifo 2-3 55738 _002356_hash NULL -+_002358_hash __iio_allocate_sw_ring_buffer 3 4843 _002358_hash NULL -+_002359_hash iio_debugfs_read_reg 3 60908 _002359_hash NULL -+_002360_hash iio_debugfs_write_reg 3 22742 _002360_hash NULL -+_002361_hash iio_event_chrdev_read 3 54757 _002361_hash NULL -+_002362_hash iio_read_first_n_kfifo 2 57910 _002362_hash NULL -+_002363_hash iio_read_first_n_sw_rb 2 51911 _002363_hash NULL -+_002364_hash ioapic_setup_resources 1 35255 _002364_hash NULL -+_002365_hash keymap_store 4 45406 _002365_hash NULL -+_002366_hash kzalloc_node 1 24352 _002366_hash NULL -+_002367_hash line6_alloc_sysex_buffer 4 28225 _002367_hash NULL -+_002368_hash line6_dumpreq_initbuf 3 53123 _002368_hash NULL -+_002369_hash line6_midibuf_init 2 52425 _002369_hash NULL -+_002370_hash lirc_write 3 20604 _002370_hash NULL -+_002371_hash _malloc 1 54077 _002371_hash NULL -+_002372_hash mei_read 3 6507 _002372_hash NULL -+_002373_hash mei_write 3 4005 _002373_hash NULL -+_002374_hash mempool_create_node 1 44715 _002374_hash NULL -+_002375_hash msg_set 3 51725 _002375_hash NULL -+_002376_hash newpart 6 47485 _002376_hash NULL -+_002377_hash OS_kmalloc 1 36909 _002377_hash NULL -+_002378_hash pcpu_alloc_bootmem 2 62074 _002378_hash NULL -+_002379_hash pcpu_get_vm_areas 3 50085 _002379_hash NULL -+_002380_hash resource_from_user 3 30341 _002380_hash NULL -+_002381_hash sca3000_read_data 4 57064 _002381_hash NULL -+_002382_hash sca3000_read_first_n_hw_rb 2 11479 _002382_hash NULL -+_002383_hash send_midi_async 3 57463 _002383_hash NULL -+_002384_hash sep_create_dcb_dmatables_context 6 37551 _002384_hash NULL -+_002385_hash sep_create_dcb_dmatables_context_kernel 6 49728 _002385_hash NULL -+_002386_hash sep_create_msgarea_context 4 33829 _002386_hash NULL -+_002387_hash sep_lli_table_secure_dma 2-3 64042 _002387_hash NULL -+_002389_hash sep_lock_user_pages 2-3 57470 _002389_hash &_002154_hash -+_002391_hash sep_prepare_input_output_dma_table_in_dcb 4-5 63087 _002391_hash NULL -+_002393_hash sep_read 3 17161 _002393_hash NULL -+_002394_hash TransmitTcb 4 12989 _002394_hash NULL -+_002395_hash ValidateDSDParamsChecksum 3 63654 _002395_hash NULL -+_002396_hash Wb35Reg_BurstWrite 4 62327 _002396_hash NULL -+_002397_hash __alloc_bootmem_low_node 2 25726 _002397_hash &_001499_hash -+_002398_hash __alloc_bootmem_node 2 1992 _002398_hash NULL -+_002399_hash alloc_irq_cpu_rmap 1 28459 _002399_hash NULL -+_002400_hash alloc_ring 2-4 18278 _002400_hash NULL -+_002402_hash c4iw_init_resource 2-3 30393 _002402_hash NULL -+_002404_hash cxio_hal_init_resource 2-7-6 29771 _002404_hash &_000284_hash -+_002407_hash cxio_hal_init_rhdl_resource 1 25104 _002407_hash NULL -+_002408_hash disk_expand_part_tbl 2 30561 _002408_hash NULL -+_002409_hash InterfaceTransmitPacket 3 42058 _002409_hash NULL -+_002410_hash line6_dumpreq_init 3 34473 _002410_hash NULL -+_002411_hash mempool_create 1 29437 _002411_hash NULL -+_002412_hash pcpu_fc_alloc 2 11818 _002412_hash NULL -+_002413_hash pod_alloc_sysex_buffer 3 31651 _002413_hash NULL -+_002414_hash r8712_usbctrl_vendorreq 6 48489 _002414_hash NULL -+_002415_hash r871x_set_wpa_ie 3 7000 _002415_hash NULL -+_002416_hash sys_move_pages 2 42626 _002416_hash NULL -+_002417_hash variax_alloc_sysex_buffer 3 15237 _002417_hash NULL -+_002418_hash vme_user_write 3 15587 _002418_hash NULL -+_002419_hash add_partition 2 55588 _002419_hash NULL -+_002420_hash __alloc_bootmem_node_high 2 65076 _002420_hash NULL -+_002421_hash ceph_msgpool_init 3 33312 _002421_hash NULL -+_002423_hash mempool_create_kmalloc_pool 1 41650 _002423_hash NULL -+_002424_hash mempool_create_page_pool 1 30189 _002424_hash NULL -+_002425_hash mempool_create_slab_pool 1 62907 _002425_hash NULL -+_002426_hash variax_set_raw2 4 32374 _002426_hash NULL -+_002427_hash bioset_create 1 5580 _002427_hash NULL -+_002428_hash bioset_integrity_create 2 62708 _002428_hash NULL -+_002429_hash biovec_create_pools 2 9575 _002429_hash NULL -+_002430_hash i2o_pool_alloc 4 55485 _002430_hash NULL -+_002431_hash prison_create 1 43623 _002431_hash NULL -+_002432_hash unlink_simple 3 47506 _002432_hash NULL -+_002433_hash alloc_ieee80211 1 20063 _002433_hash NULL -+_002434_hash alloc_ieee80211_rsl 1 34564 _002434_hash NULL -+_002435_hash alloc_page_cgroup 1 2919 _002435_hash NULL -+_002436_hash alloc_private 2 22399 _002436_hash &_002326_hash -+_002437_hash alloc_rtllib 1 51136 _002437_hash NULL -+_002438_hash alloc_rx_desc_ring 2 18016 _002438_hash NULL -+_002439_hash alloc_subdevices 2 43300 _002439_hash NULL -+_002440_hash atomic_counters_read 3 48827 _002440_hash NULL -+_002441_hash atomic_stats_read 3 36228 _002441_hash NULL -+_002442_hash capabilities_read 3 58457 _002442_hash NULL -+_002443_hash comedi_read 3 13199 _002443_hash NULL -+_002444_hash comedi_write 3 47926 _002444_hash NULL -+_002445_hash compat_do_arpt_set_ctl 4 12184 _002445_hash NULL -+_002446_hash compat_do_ip6t_set_ctl 4 3184 _002446_hash NULL -+_002447_hash compat_do_ipt_set_ctl 4 58466 _002447_hash &_001852_hash -+_002448_hash compat_filldir 3 32999 _002448_hash NULL -+_002449_hash compat_filldir64 3 35354 _002449_hash NULL -+_002450_hash compat_fillonedir 3 15620 _002450_hash NULL -+_002451_hash compat_rw_copy_check_uvector 3 25242 _002451_hash NULL -+_002452_hash compat_sock_setsockopt 5 23 _002452_hash NULL -+_002453_hash compat_sys_kexec_load 2 35674 _002453_hash NULL -+_002454_hash compat_sys_keyctl 4 9639 _002454_hash NULL -+_002455_hash compat_sys_move_pages 2 5861 _002455_hash NULL -+_002456_hash compat_sys_mq_timedsend 3 31060 _002456_hash NULL -+_002457_hash compat_sys_msgrcv 2 7482 _002457_hash NULL -+_002458_hash compat_sys_msgsnd 2 10738 _002458_hash NULL -+_002459_hash compat_sys_semtimedop 3 3606 _002459_hash NULL -+_002460_hash __copy_in_user 3 34790 _002460_hash NULL -+_002461_hash copy_in_user 3 57502 _002461_hash NULL -+_002462_hash dev_counters_read 3 19216 _002462_hash NULL -+_002463_hash dev_names_read 3 38509 _002463_hash NULL -+_002464_hash do_arpt_set_ctl 4 51053 _002464_hash NULL -+_002465_hash do_ip6t_set_ctl 4 60040 _002465_hash NULL -+_002466_hash do_ipt_set_ctl 4 56238 _002466_hash NULL -+_002467_hash drbd_bm_resize 2 20522 _002467_hash NULL -+_002468_hash driver_names_read 3 60399 _002468_hash NULL -+_002469_hash driver_stats_read 3 8944 _002469_hash NULL -+_002470_hash __earlyonly_bootmem_alloc 2 23824 _002470_hash NULL -+_002471_hash evtchn_read 3 3569 _002471_hash NULL -+_002472_hash ext_sd_execute_read_data 9 48589 _002472_hash NULL -+_002473_hash ext_sd_execute_write_data 9 8175 _002473_hash NULL -+_002474_hash fat_compat_ioctl_filldir 3 36328 _002474_hash NULL -+_002475_hash firmwareUpload 3 32794 _002475_hash NULL -+_002476_hash flash_read 3 57843 _002476_hash NULL -+_002477_hash flash_write 3 62354 _002477_hash NULL -+_002478_hash gather_array 3 56641 _002478_hash NULL -+_002479_hash ghash_async_setkey 3 60001 _002479_hash NULL -+_002480_hash gntdev_alloc_map 2 35145 _002480_hash NULL -+_002481_hash gnttab_map 2 56439 _002481_hash NULL -+_002482_hash gru_alloc_gts 2-3 60056 _002482_hash NULL -+_002484_hash handle_eviocgbit 3 44193 _002484_hash NULL -+_002485_hash hid_parse_report 3 51737 _002485_hash NULL -+_002486_hash ieee80211_alloc_txb 1-2 52477 _002486_hash NULL -+_002487_hash ieee80211_wx_set_gen_ie 3 51399 _002487_hash NULL -+_002488_hash ieee80211_wx_set_gen_ie_rsl 3 3521 _002488_hash NULL -+_002489_hash init_cdev 1 8274 _002489_hash NULL -+_002490_hash init_per_cpu 1 17880 _002490_hash NULL -+_002491_hash ipath_create_cq 2 45586 _002491_hash NULL -+_002492_hash ipath_get_base_info 3 7043 _002492_hash NULL -+_002493_hash ipath_init_qp_table 2 25167 _002493_hash NULL -+_002494_hash ipath_resize_cq 2 712 _002494_hash NULL -+_002495_hash ni_gpct_device_construct 5 610 _002495_hash NULL -+_002496_hash options_write 3 47243 _002496_hash NULL -+_002497_hash portcntrs_1_read 3 47253 _002497_hash NULL -+_002498_hash portcntrs_2_read 3 56586 _002498_hash NULL -+_002499_hash portnames_read 3 41958 _002499_hash NULL -+_002500_hash ptc_proc_write 3 12076 _002500_hash NULL -+_002501_hash put_cmsg_compat 4 35937 _002501_hash NULL -+_002502_hash qib_alloc_devdata 2 51819 _002502_hash NULL -+_002503_hash qib_alloc_fast_reg_page_list 2 10507 _002503_hash NULL -+_002504_hash qib_cdev_init 1 34778 _002504_hash NULL -+_002505_hash qib_create_cq 2 27497 _002505_hash NULL -+_002506_hash qib_diag_write 3 62133 _002506_hash NULL -+_002507_hash qib_get_base_info 3 11369 _002507_hash NULL -+_002508_hash qib_resize_cq 2 53090 _002508_hash NULL -+_002509_hash qsfp_1_read 3 21915 _002509_hash NULL -+_002510_hash qsfp_2_read 3 31491 _002510_hash NULL -+_002511_hash queue_reply 3 22416 _002511_hash NULL -+_002512_hash Realloc 2 34961 _002512_hash NULL -+_002513_hash rfc4106_set_key 3 54519 _002513_hash NULL -+_002514_hash rtllib_alloc_txb 1-2 21687 _002514_hash NULL -+_002515_hash rtllib_wx_set_gen_ie 3 59808 _002515_hash NULL -+_002516_hash rts51x_transfer_data_partial 6 5735 _002516_hash NULL -+_002517_hash sparse_early_usemaps_alloc_node 4 9269 _002517_hash NULL -+_002518_hash split 2 11691 _002518_hash NULL -+_002519_hash stats_read_ul 3 32751 _002519_hash NULL -+_002520_hash store_debug_level 3 35652 _002520_hash NULL -+_002521_hash sys32_ipc 3 7238 _002521_hash NULL -+_002522_hash sys32_rt_sigpending 2 25814 _002522_hash NULL -+_002523_hash tunables_read 3 36385 _002523_hash NULL -+_002524_hash tunables_write 3 59563 _002524_hash NULL -+_002525_hash u32_array_read 3 2219 _002525_hash NULL -+_002526_hash usb_buffer_alloc 2 36276 _002526_hash NULL -+_002527_hash xenbus_file_write 3 6282 _002527_hash NULL -+_002528_hash xpc_kmalloc_cacheline_aligned 1 42895 _002528_hash NULL -+_002529_hash xpc_kzalloc_cacheline_aligned 1 65433 _002529_hash NULL -+_002530_hash xsd_read 3 15653 _002530_hash NULL -+_002531_hash compat_do_readv_writev 4 49102 _002531_hash NULL -+_002532_hash compat_keyctl_instantiate_key_iov 3 57431 _003117_hash NULL nohasharray -+_002533_hash compat_process_vm_rw 3-5 22254 _002533_hash NULL -+_002535_hash compat_sys_setsockopt 5 3326 _002535_hash NULL -+_002536_hash ipath_cdev_init 1 37752 _002536_hash NULL -+_002537_hash ms_read_multiple_pages 4-5 8052 _002537_hash NULL -+_002539_hash ms_write_multiple_pages 5-6 10362 _002539_hash NULL -+_002541_hash sparse_mem_maps_populate_node 4 12669 _002541_hash &_002004_hash -+_002542_hash vmemmap_alloc_block 1 43245 _002542_hash NULL -+_002543_hash xd_read_multiple_pages 4-5 11422 _002543_hash NULL -+_002545_hash xd_write_multiple_pages 5-6 53633 _002545_hash NULL -+_002546_hash compat_readv 3 30273 _002546_hash NULL -+_002547_hash compat_sys_process_vm_readv 3-5 15374 _002547_hash NULL -+_002549_hash compat_sys_process_vm_writev 3-5 41194 _002549_hash NULL -+_002551_hash compat_writev 3 60063 _002551_hash NULL -+_002552_hash ms_rw_multi_sector 4 7459 _002552_hash NULL -+_002553_hash sparse_early_mem_maps_alloc_node 4 36971 _002553_hash NULL -+_002554_hash vmemmap_alloc_block_buf 1 61126 _002554_hash NULL -+_002555_hash xd_rw 4 49020 _002555_hash NULL -+_002556_hash compat_sys_preadv64 3 24283 _002556_hash NULL -+_002557_hash compat_sys_pwritev64 3 51151 _002557_hash NULL -+_002558_hash compat_sys_readv 3 20911 _002558_hash NULL -+_002559_hash compat_sys_writev 3 5784 _002559_hash NULL -+_002560_hash ms_rw 4 17220 _002560_hash NULL -+_002561_hash compat_sys_preadv 3 583 _002561_hash NULL -+_002562_hash compat_sys_pwritev 3 17886 _002562_hash NULL -+_002563_hash alloc_apertures 1 56561 _002563_hash NULL -+_002564_hash bin_uuid 3 28999 _002564_hash NULL -+_002565_hash __copy_from_user_inatomic_nocache 3 49921 _002565_hash NULL -+_002566_hash do_dmabuf_dirty_sou 7 3017 _002566_hash NULL -+_002567_hash do_surface_dirty_sou 7 39678 _002567_hash NULL -+_002568_hash drm_agp_bind_pages 3 56748 _002568_hash NULL -+_002569_hash drm_calloc_large 1-2 65421 _002569_hash NULL -+_002571_hash drm_fb_helper_init 3-4 19044 _002571_hash NULL -+_002573_hash drm_ht_create 2 18853 _002573_hash NULL -+_002574_hash drm_malloc_ab 1-2 16831 _002574_hash NULL -+_002576_hash drm_mode_crtc_set_gamma_size 2 31881 _002576_hash NULL -+_002577_hash drm_plane_init 6 28731 _002577_hash NULL -+_002578_hash drm_property_create 4 51239 _002578_hash NULL -+_002579_hash drm_property_create_blob 2 7414 _002579_hash NULL -+_002580_hash drm_vblank_init 2 11362 _002580_hash NULL -+_002581_hash drm_vmalloc_dma 1 14550 _002581_hash NULL -+_002582_hash fb_alloc_cmap_gfp 2 20792 _002582_hash NULL -+_002583_hash fbcon_prepare_logo 5 6246 _002583_hash NULL -+_002584_hash fb_read 3 33506 _002584_hash NULL -+_002585_hash fb_write 3 46924 _002585_hash NULL -+_002586_hash framebuffer_alloc 1 59145 _002586_hash NULL -+_002587_hash i915_cache_sharing_read 3 24775 _002587_hash NULL -+_002588_hash i915_cache_sharing_write 3 57961 _002588_hash NULL -+_002589_hash i915_max_freq_read 3 20581 _002589_hash NULL -+_002590_hash i915_max_freq_write 3 11350 _002590_hash NULL -+_002591_hash i915_wedged_read 3 35474 _002591_hash NULL -+_002592_hash i915_wedged_write 3 47771 _002592_hash NULL -+_002593_hash p9_client_read 5 19750 _002593_hash NULL -+_002594_hash probe_kernel_write 3 17481 _002594_hash NULL -+_002595_hash sched_feat_write 3 55202 _002595_hash NULL -+_002596_hash sd_alloc_ctl_entry 1 29708 _002596_hash NULL -+_002597_hash tstats_write 3 60432 _002597_hash &_000009_hash -+_002598_hash ttm_bo_fbdev_io 4 9805 _002598_hash NULL -+_002599_hash ttm_bo_io 5 47000 _002599_hash NULL -+_002600_hash ttm_dma_page_pool_free 2 34135 _002600_hash NULL -+_002601_hash ttm_page_pool_free 2 61661 _002601_hash NULL -+_002602_hash vmw_execbuf_process 5 22885 _002602_hash NULL -+_002603_hash vmw_fifo_reserve 2 12141 _002603_hash NULL -+_002604_hash vmw_kms_present 9 38130 _002604_hash NULL -+_002605_hash vmw_kms_readback 6 5727 _002605_hash NULL -+_002606_hash do_dmabuf_dirty_ldu 6 52241 _002606_hash NULL -+_002607_hash drm_mode_create_tv_properties 2 23122 _002607_hash NULL -+_002608_hash drm_property_create_enum 5 29201 _002608_hash NULL -+_002609_hash fast_user_write 5 20494 _002609_hash NULL -+_002610_hash fb_alloc_cmap 2 6554 _002610_hash NULL -+_002611_hash i915_gem_execbuffer_relocate_slow 7 25355 _002611_hash NULL -+_002612_hash kgdb_hex2mem 3 24755 _002612_hash NULL -+_002613_hash ttm_object_device_init 2 10321 _002613_hash NULL -+_002614_hash ttm_object_file_init 2 27804 _002614_hash NULL -+_002615_hash vmw_cursor_update_image 3-4 16332 _002615_hash NULL -+_002617_hash vmw_gmr2_bind 3 21305 _002617_hash NULL -+_002618_hash vmw_cursor_update_dmabuf 3-4 32045 _002618_hash NULL -+_002620_hash vmw_gmr_bind 3 44130 _002620_hash NULL -+_002621_hash vmw_du_crtc_cursor_set 4-5 28479 _002621_hash NULL -+_002622_hash __module_alloc 1 50004 _002622_hash NULL -+_002623_hash module_alloc_update_bounds_rw 1 63233 _002623_hash NULL -+_002624_hash module_alloc_update_bounds_rx 1 58634 _002624_hash NULL -+_002625_hash acpi_system_write_alarm 3 40205 _002625_hash NULL -+_002626_hash create_table 2 16213 _002626_hash NULL -+_002627_hash mem_read 3 57631 _002627_hash NULL -+_002628_hash mem_write 3 22232 _002628_hash NULL -+_002629_hash proc_fault_inject_read 3 36802 _002629_hash NULL -+_002630_hash proc_fault_inject_write 3 21058 _002630_hash NULL -+_002631_hash v9fs_fid_readn 4 60544 _002631_hash NULL -+_002632_hash v9fs_file_read 3 40858 _002632_hash NULL -+_002633_hash __devres_alloc 2 25598 _002633_hash NULL -+_002634_hash alloc_dummy_extent_buffer 2 56374 _002634_hash NULL -+_002635_hash alloc_fdtable 1 17389 _002635_hash NULL -+_002636_hash alloc_large_system_hash 2 22391 _002636_hash NULL -+_002637_hash alloc_ldt 2 21972 _002637_hash NULL -+_002638_hash __alloc_skb 1 23940 _002638_hash NULL -+_002639_hash __ata_change_queue_depth 3 23484 _002639_hash NULL -+_002640_hash btrfs_alloc_free_block 3 8986 _002640_hash NULL -+_002641_hash btrfs_find_device_for_logical 2 44993 _002641_hash NULL -+_002642_hash ccid3_hc_rx_getsockopt 3 62331 _002642_hash NULL -+_002643_hash ccid3_hc_tx_getsockopt 3 16314 _002643_hash NULL -+_002644_hash cifs_readdata_alloc 1 26360 _002644_hash NULL -+_002645_hash cistpl_vers_1 4 15023 _002645_hash NULL -+_002646_hash cmm_read 3 57520 _002646_hash NULL -+_002647_hash cosa_read 3 25966 _002647_hash NULL -+_002648_hash dm_table_create 3 35687 _002648_hash NULL -+_002649_hash dpcm_state_read_file 3 65489 _002649_hash NULL -+_002651_hash edac_mc_alloc 4 3611 _002651_hash NULL -+_002652_hash ep0_read 3 38095 _002652_hash NULL -+_002653_hash event_buffer_read 3 48772 _002765_hash NULL nohasharray -+_002654_hash extend_netdev_table 2 21453 _002654_hash NULL -+_002655_hash extract_entropy_user 3 26952 _002655_hash NULL -+_002656_hash fcoe_ctlr_device_add 3 1793 _002656_hash NULL -+_002657_hash fd_do_readv 3 51297 _002657_hash NULL -+_002658_hash fd_do_writev 3 29329 _002658_hash NULL -+_002659_hash ffs_ep0_read 3 2672 _002659_hash NULL -+_002660_hash fill_readbuf 3 32464 _002660_hash NULL -+_002661_hash fw_iso_buffer_alloc 2 13704 _002661_hash NULL -+_002662_hash get_fd_set 1 3866 _002662_hash NULL -+_002663_hash hidraw_report_event 3 20503 _002663_hash NULL -+_002664_hash ieee80211_if_read_ht_opmode 3 29044 _002664_hash NULL -+_002665_hash ieee80211_if_read_num_mcast_sta 3 12419 _002665_hash NULL -+_002666_hash iwl_dbgfs_calib_disabled_read 3 22649 _002666_hash NULL -+_002667_hash iwl_dbgfs_rf_reset_read 3 26512 _002667_hash NULL -+_002668_hash ixgbe_alloc_q_vector 4-6 24439 _002668_hash NULL -+_002670_hash joydev_handle_JSIOCSAXMAP 3 48898 _002836_hash NULL nohasharray -+_002671_hash joydev_handle_JSIOCSBTNMAP 3 15643 _002671_hash NULL -+_002672_hash __kfifo_from_user_r 3 60345 _002672_hash NULL -+_002673_hash kstrtoint_from_user 2 8778 _002673_hash NULL -+_002674_hash kstrtol_from_user 2 10168 _002674_hash NULL -+_002675_hash kstrtoll_from_user 2 19500 _002675_hash NULL -+_002676_hash kstrtos16_from_user 2 28300 _002676_hash NULL -+_002677_hash kstrtos8_from_user 2 58268 _002677_hash NULL -+_002678_hash kstrtou16_from_user 2 54274 _002678_hash NULL -+_002679_hash kstrtou8_from_user 2 55599 _002679_hash NULL -+_002680_hash kstrtouint_from_user 2 10536 _002680_hash NULL -+_002681_hash kstrtoul_from_user 2 64569 _002681_hash NULL -+_002682_hash kstrtoull_from_user 2 63026 _002682_hash NULL -+_002683_hash l2cap_create_iframe_pdu 3 40055 _002683_hash NULL -+_002684_hash l2tp_ip6_recvmsg 4 62874 _002684_hash NULL -+_002685_hash mem_cgroup_read 5 22461 _002685_hash NULL -+_002686_hash nfs_fscache_get_super_cookie 3 44355 _002686_hash &_001648_hash -+_002687_hash nfs_pgarray_set 2 1085 _002687_hash NULL -+_002688_hash ntfs_rl_realloc 3 56831 _002688_hash &_000363_hash -+_002689_hash ntfs_rl_realloc_nofail 3 32173 _002689_hash NULL -+_002690_hash pn533_dep_link_up 5 22154 _002690_hash NULL -+_002691_hash port_fops_write 3 54627 _002691_hash NULL -+_002692_hash ptp_read 4 63251 _002692_hash NULL -+_002693_hash qla4xxx_change_queue_depth 2 1268 _002693_hash NULL -+_002694_hash reqsk_queue_alloc 2 40272 _002694_hash NULL -+_002695_hash resize_info_buffer 2 62889 _002695_hash NULL -+_002696_hash rfkill_fop_write 3 64808 _002696_hash NULL -+_002697_hash rt2x00debug_write_rfcsr 3 41473 _002697_hash NULL -+_002698_hash rvmalloc 1 46873 _002698_hash NULL -+_002699_hash rw_copy_check_uvector 3 45748 _002699_hash NULL -+_002700_hash sctp_getsockopt_active_key 2 45483 _002700_hash NULL -+_002701_hash sctp_getsockopt_adaptation_layer 2 45375 _002701_hash NULL -+_002702_hash sctp_getsockopt_assoc_ids 2 9043 _002702_hash NULL -+_002703_hash sctp_getsockopt_associnfo 2 58169 _002703_hash NULL -+_002704_hash sctp_getsockopt_assoc_number 2 6384 _002704_hash NULL -+_002705_hash sctp_getsockopt_auto_asconf 2 46584 _002705_hash NULL -+_002706_hash sctp_getsockopt_context 2 52490 _002706_hash NULL -+_002707_hash sctp_getsockopt_default_send_param 2 63056 _002707_hash NULL -+_002708_hash sctp_getsockopt_disable_fragments 2 12330 _002708_hash NULL -+_002709_hash sctp_getsockopt_fragment_interleave 2 51215 _002709_hash NULL -+_002710_hash sctp_getsockopt_initmsg 2 26042 _002710_hash NULL -+_002711_hash sctp_getsockopt_mappedv4 2 20044 _002711_hash NULL -+_002712_hash sctp_getsockopt_nodelay 2 9560 _002712_hash NULL -+_002713_hash sctp_getsockopt_partial_delivery_point 2 60952 _002713_hash NULL -+_002714_hash sctp_getsockopt_peeloff 2 59190 _002714_hash NULL -+_002715_hash sctp_getsockopt_peer_addr_info 2 6024 _002715_hash NULL -+_002716_hash sctp_getsockopt_peer_addr_params 2 53645 _002716_hash NULL -+_002717_hash sctp_getsockopt_primary_addr 2 24639 _002717_hash NULL -+_002718_hash sctp_getsockopt_rtoinfo 2 62027 _002718_hash NULL -+_002719_hash sctp_getsockopt_sctp_status 2 56540 _002719_hash NULL -+_002720_hash self_check_write 5 50856 _002720_hash NULL -+_002721_hash smk_read_mapped 3 7562 _002721_hash NULL -+_002722_hash smk_set_cipso 3 20379 _002722_hash NULL -+_002723_hash smk_user_access 3 24440 _002723_hash NULL -+_002724_hash smk_write_mapped 3 13519 _002724_hash NULL -+_002725_hash smk_write_rules_list 3 18565 _002725_hash NULL -+_002726_hash snd_mixart_BA0_read 5 45069 _002726_hash NULL -+_002727_hash snd_mixart_BA1_read 5 5082 _002727_hash NULL -+_002728_hash snd_pcm_oss_read2 3 54387 _002728_hash NULL -+_002729_hash syslog_print 2 307 _002729_hash NULL -+_002730_hash tcp_dma_try_early_copy 3 4457 _002730_hash NULL -+_002731_hash tcp_send_rcvq 3 11316 _002731_hash NULL -+_002732_hash tomoyo_init_log 2 61526 _002732_hash NULL -+_002733_hash ubi_dump_flash 4 46381 _002733_hash NULL -+_002734_hash ubi_eba_atomic_leb_change 5 60379 _002734_hash NULL -+_002735_hash ubi_eba_write_leb 5-6 36029 _002735_hash NULL -+_002737_hash ubi_eba_write_leb_st 5 44343 _002737_hash NULL -+_002738_hash ubi_self_check_all_ff 4 41959 _002738_hash NULL -+_002739_hash unix_bind 3 15668 _002739_hash NULL -+_002740_hash usbvision_rvmalloc 1 19655 _002740_hash NULL -+_002742_hash v4l2_ctrl_new 7 24927 _002742_hash NULL -+_002743_hash v4l2_event_subscribe 3 53687 _002743_hash NULL -+_002744_hash v9fs_direct_read 3 45546 _002744_hash NULL -+_002745_hash v9fs_file_readn 4 36353 _002745_hash &_001606_hash -+_002746_hash __videobuf_alloc_vb 1 5665 _002746_hash NULL -+_002747_hash wm8350_write 3 24480 _002747_hash NULL -+_002748_hash xfs_buf_read_uncached 3 42844 _002748_hash NULL -+_002749_hash yurex_write 3 8761 _002749_hash NULL -+_002750_hash alloc_skb 1 55439 _002750_hash NULL -+_002751_hash alloc_skb_fclone 1 3467 _002751_hash NULL -+_002752_hash ata_scsi_change_queue_depth 2 23126 _002752_hash NULL -+_002753_hash ath6kl_disconnect_timeout_write 3 794 _002753_hash NULL -+_002754_hash ath6kl_keepalive_write 3 45600 _002754_hash NULL -+_002755_hash ath6kl_lrssi_roam_write 3 8362 _002755_hash NULL -+_002756_hash ath6kl_regread_write 3 14220 _002756_hash NULL -+_002757_hash core_sys_select 1 47494 _002757_hash NULL -+_002758_hash do_syslog 3 56807 _002758_hash NULL -+_002759_hash expand_fdtable 2 39273 _002759_hash NULL -+_002760_hash fd_execute_cmd 3 1132 _002760_hash NULL -+_002761_hash get_chars 3 40373 _002761_hash NULL -+_002762_hash hid_report_raw_event 4 2762 _002762_hash NULL -+_002763_hash inet_csk_listen_start 2 38233 _002763_hash NULL -+_002764_hash kstrtou32_from_user 2 30361 _002764_hash NULL -+_002765_hash l2cap_segment_sdu 4 48772 _002765_hash &_002653_hash -+_002766_hash __netdev_alloc_skb 2 18595 _002766_hash NULL -+_002767_hash nfs_readdata_alloc 2 65015 _002767_hash NULL -+_002768_hash nfs_writedata_alloc 2 12133 _002768_hash NULL -+_002769_hash ntfs_rl_append 2-4 6037 _002769_hash NULL -+_002771_hash ntfs_rl_insert 2-4 4931 _002771_hash NULL -+_002773_hash ntfs_rl_replace 2-4 14136 _002773_hash NULL -+_002775_hash ntfs_rl_split 2-4 52328 _002775_hash NULL -+_002777_hash port_fops_read 3 49626 _002777_hash NULL -+_002778_hash random_read 3 13815 _002778_hash NULL -+_002779_hash sg_proc_write_adio 3 45704 _002779_hash NULL -+_002780_hash sg_proc_write_dressz 3 46316 _002780_hash NULL -+_002781_hash tcp_sendmsg 4 30296 _002781_hash NULL -+_002782_hash tomoyo_write_log2 2 34318 _002782_hash NULL -+_002783_hash ubi_leb_change 4 10289 _002783_hash NULL -+_002784_hash ubi_leb_write 4-5 5478 _002784_hash NULL -+_002786_hash urandom_read 3 30462 _002786_hash NULL -+_002787_hash v9fs_cached_file_read 3 2514 _002787_hash NULL -+_002788_hash __videobuf_alloc_cached 1 12740 _002788_hash NULL -+_002789_hash __videobuf_alloc_uncached 1 55711 _002789_hash NULL -+_002790_hash wm8350_block_write 3 19727 _002790_hash NULL -+_002791_hash alloc_tx 2 32143 _002791_hash NULL -+_002792_hash alloc_wr 1-2 24635 _002792_hash NULL -+_002794_hash ath6kl_endpoint_stats_write 3 59621 _002794_hash NULL -+_002795_hash ath6kl_fwlog_mask_write 3 24810 _002795_hash NULL -+_002796_hash ath9k_wmi_cmd 4 327 _002796_hash NULL -+_002797_hash atm_alloc_charge 2 19517 _002879_hash NULL nohasharray -+_002798_hash ax25_output 2 22736 _002798_hash NULL -+_002799_hash bcsp_prepare_pkt 3 12961 _002799_hash NULL -+_002800_hash bt_skb_alloc 1 6404 _002800_hash NULL -+_002801_hash capinc_tty_write 3 28539 _002801_hash NULL -+_002802_hash cfpkt_create_pfx 1-2 23594 _002802_hash NULL -+_002804_hash cmd_complete 6 51629 _002804_hash NULL -+_002805_hash cmtp_add_msgpart 4 9252 _002805_hash NULL -+_002806_hash cmtp_send_interopmsg 7 376 _002806_hash NULL -+_002807_hash cxgb3_get_cpl_reply_skb 2 10620 _002807_hash NULL -+_002808_hash dbg_leb_change 4 23555 _002808_hash NULL -+_002809_hash dbg_leb_write 4-5 63555 _002809_hash &_000940_hash -+_002811_hash dccp_listen_start 2 35918 _002811_hash NULL -+_002812_hash __dev_alloc_skb 1 28681 _002812_hash NULL -+_002813_hash diva_os_alloc_message_buffer 1 64568 _002813_hash NULL -+_002814_hash dn_alloc_skb 2 6631 _002814_hash NULL -+_002815_hash do_pselect 1 62061 _002815_hash NULL -+_002816_hash _fc_frame_alloc 1 43568 _002816_hash NULL -+_002817_hash find_skb 2 20431 _002817_hash NULL -+_002818_hash fm_send_cmd 5 39639 _002818_hash NULL -+_002819_hash gem_alloc_skb 2 51715 _002819_hash NULL -+_002820_hash get_packet 3 41914 _002820_hash NULL -+_002821_hash get_packet 3 5747 _002821_hash NULL -+_002822_hash get_packet_pg 4 28023 _002822_hash NULL -+_002823_hash get_skb 2 63008 _002823_hash NULL -+_002824_hash hidp_queue_report 3 1881 _002824_hash NULL -+_002825_hash __hidp_send_ctrl_message 4 28303 _002825_hash NULL -+_002826_hash hycapi_rx_capipkt 3 11602 _002826_hash NULL -+_002827_hash i2400m_net_rx 5 27170 _002827_hash NULL -+_002828_hash igmpv3_newpack 2 35912 _002828_hash NULL -+_002829_hash inet_listen 2 14723 _002829_hash NULL -+_002830_hash isdn_net_ciscohdlck_alloc_skb 2 55209 _002830_hash &_001724_hash -+_002831_hash isdn_ppp_ccp_xmit_reset 6 63297 _002831_hash NULL -+_002832_hash kmsg_read 3 46514 _002832_hash NULL -+_002833_hash _l2_alloc_skb 1 11883 _002833_hash NULL -+_002834_hash l3_alloc_skb 1 32289 _002834_hash NULL -+_002835_hash llc_alloc_frame 4 64366 _002835_hash NULL -+_002836_hash mac_drv_rx_init 2 48898 _002836_hash &_002670_hash -+_002837_hash mgmt_event 4 12810 _002837_hash NULL -+_002838_hash mI_alloc_skb 1 24770 _002838_hash NULL -+_002839_hash nci_skb_alloc 2 49757 _002839_hash NULL -+_002840_hash netdev_alloc_skb 2 62437 _002840_hash NULL -+_002841_hash __netdev_alloc_skb_ip_align 2 55067 _002841_hash NULL -+_002842_hash new_skb 1 21148 _002842_hash NULL -+_002843_hash nfc_alloc_recv_skb 1 10244 _002843_hash NULL -+_002844_hash nfcwilink_skb_alloc 1 16167 _002844_hash NULL -+_002845_hash nfulnl_alloc_skb 2 65207 _002845_hash NULL -+_002846_hash ni65_alloc_mem 3 10664 _002846_hash NULL -+_002847_hash pep_alloc_skb 3 46303 _002847_hash NULL -+_002848_hash pn_raw_send 2 54330 _002848_hash NULL -+_002849_hash __pskb_copy 2 9038 _002849_hash NULL -+_002850_hash refill_pool 2 19477 _002850_hash NULL -+_002851_hash rfcomm_wmalloc 2 58090 _002851_hash NULL -+_002852_hash rx 4 57944 _002852_hash NULL -+_002853_hash sctp_ulpevent_new 1 33377 _002853_hash NULL -+_002854_hash send_command 4 10832 _002854_hash NULL -+_002855_hash skb_copy_expand 2-3 7685 _002855_hash &_000671_hash -+_002857_hash sk_stream_alloc_skb 2 57622 _002857_hash NULL -+_002858_hash sock_alloc_send_pskb 2 21246 _002858_hash NULL -+_002859_hash sock_rmalloc 2 59740 _002859_hash &_002157_hash -+_002860_hash sock_wmalloc 2 16472 _002860_hash NULL -+_002861_hash solos_param_store 4 34755 _002861_hash NULL -+_002862_hash sys_select 1 38827 _002862_hash NULL -+_002863_hash sys_syslog 3 10746 _002863_hash NULL -+_002864_hash t4vf_pktgl_to_skb 2 39005 _002864_hash NULL -+_002865_hash tcp_collapse 5-6 63294 _002865_hash NULL -+_002867_hash tipc_cfg_reply_alloc 1 27606 _002867_hash NULL -+_002868_hash ubifs_leb_change 4 17789 _002868_hash NULL -+_002869_hash ubifs_leb_write 4-5 22679 _002869_hash NULL -+_002871_hash ulog_alloc_skb 1 23427 _002871_hash NULL -+_002872_hash _alloc_mISDN_skb 3 52232 _002872_hash NULL -+_002873_hash ath9k_multi_regread 4 65056 _002873_hash NULL -+_002874_hash ath_rxbuf_alloc 2 24745 _002874_hash NULL -+_002875_hash ax25_send_frame 2 19964 _002875_hash NULL -+_002876_hash bchannel_get_rxbuf 2 37213 _002876_hash NULL -+_002877_hash cfpkt_create 1 18197 _002877_hash NULL -+_002878_hash console_store 4 36007 _002878_hash NULL -+_002879_hash dev_alloc_skb 1 19517 _002879_hash &_002797_hash -+_002880_hash dn_nsp_do_disc 2-6 49474 _002880_hash NULL -+_002882_hash do_write_orph_node 2 64343 _002882_hash NULL -+_002883_hash dsp_cmx_send_member 2 15625 _002883_hash NULL -+_002884_hash fc_frame_alloc 2 1596 _002884_hash NULL -+_002885_hash fc_frame_alloc_fill 2 59394 _002885_hash NULL -+_002886_hash fmc_send_cmd 5 20435 _002886_hash NULL -+_002887_hash hci_send_cmd 3 43810 _002887_hash NULL -+_002888_hash hci_si_event 3 1404 _002888_hash NULL -+_002889_hash hfcpci_empty_bfifo 4 62323 _002889_hash NULL -+_002890_hash hidp_send_ctrl_message 4 43702 _002890_hash NULL -+_002891_hash hysdn_sched_rx 3 60533 _002891_hash NULL -+_002892_hash inet_dccp_listen 2 28565 _002892_hash NULL -+_002893_hash ip6_append_data 4-5 36490 _002893_hash NULL -+_002894_hash __ip_append_data 7-8 36191 _002894_hash NULL -+_002895_hash l1oip_socket_recv 6 56537 _002895_hash NULL -+_002896_hash l2cap_build_cmd 4 48676 _002896_hash NULL -+_002897_hash l2down_create 4 21755 _002897_hash NULL -+_002898_hash l2up_create 3 6430 _002898_hash NULL -+_002899_hash ldisc_receive 4 41516 _002899_hash NULL -+_002902_hash lro_gen_skb 6 2644 _002902_hash NULL -+_002903_hash macvtap_alloc_skb 2-4-3 50629 _002903_hash NULL -+_002906_hash mgmt_device_found 10 14146 _002906_hash NULL -+_002907_hash nci_send_cmd 3 58206 _002907_hash NULL -+_002908_hash netdev_alloc_skb_ip_align 2 40811 _002908_hash NULL -+_002909_hash nfcwilink_send_bts_cmd 3 10802 _002909_hash NULL -+_002910_hash nfqnl_mangle 2 14583 _002910_hash NULL -+_002911_hash p54_alloc_skb 3 34366 _002911_hash &_000475_hash -+_002912_hash packet_alloc_skb 2-5-4 62602 _002912_hash NULL -+_002915_hash pep_indicate 5 38611 _002915_hash NULL -+_002916_hash pep_reply 5 50582 _002916_hash NULL -+_002917_hash pipe_handler_request 5 50774 _002917_hash &_001189_hash -+_002918_hash ql_process_mac_rx_page 4 15543 _002918_hash NULL -+_002919_hash ql_process_mac_rx_skb 4 6689 _002919_hash NULL -+_002920_hash rfcomm_tty_write 3 51603 _002920_hash NULL -+_002921_hash send_mpa_reject 3 7135 _002921_hash NULL -+_002922_hash send_mpa_reply 3 32372 _002922_hash NULL -+_002923_hash set_rxd_buffer_pointer 8 9950 _002923_hash NULL -+_002924_hash sge_rx 3 50594 _002924_hash NULL -+_002925_hash skb_cow_data 2 11565 _002925_hash NULL -+_002926_hash smp_build_cmd 3 45853 _002926_hash NULL -+_002927_hash sock_alloc_send_skb 2 23720 _002927_hash NULL -+_002928_hash sys_pselect6 1 57449 _002928_hash NULL -+_002929_hash tcp_fragment 3 20436 _002929_hash NULL -+_002930_hash teiup_create 3 43201 _002930_hash NULL -+_002931_hash tg3_run_loopback 2 30093 _002931_hash NULL -+_002932_hash tun_alloc_skb 2-4-3 41216 _002932_hash NULL -+_002935_hash ubifs_write_node 5 11258 _002935_hash NULL -+_002936_hash use_pool 2 64607 _002936_hash NULL -+_002937_hash vxge_rx_alloc 3 52024 _002937_hash NULL -+_002938_hash add_packet 3 54433 _002938_hash NULL -+_002939_hash add_rx_skb 3 8257 _002939_hash NULL -+_002940_hash ath6kl_buf_alloc 1 57304 _002940_hash NULL -+_002941_hash bat_iv_ogm_aggregate_new 2 2620 _002941_hash NULL -+_002942_hash bnx2fc_process_l2_frame_compl 3 65072 _002942_hash NULL -+_002943_hash brcmu_pkt_buf_get_skb 1 5556 _002943_hash NULL -+_002944_hash br_send_bpdu 3 29669 _002944_hash NULL -+_002945_hash bt_skb_send_alloc 2 6581 _002945_hash NULL -+_002946_hash c4iw_reject_cr 3 28174 _002946_hash NULL -+_002947_hash carl9170_rx_copy_data 2 21656 _002947_hash NULL -+_002948_hash cfpkt_add_body 3 44630 _002948_hash NULL -+_002949_hash cfpkt_append 3 61206 _002949_hash NULL -+_002950_hash cosa_net_setup_rx 2 38594 _002950_hash NULL -+_002951_hash cxgb4_pktgl_to_skb 2 61899 _002951_hash NULL -+_002952_hash dn_alloc_send_pskb 2 4465 _002952_hash NULL -+_002953_hash dn_nsp_return_disc 2 60296 _002953_hash NULL -+_002954_hash dn_nsp_send_disc 2 23469 _002954_hash NULL -+_002955_hash dsp_tone_hw_message 3 17678 _002955_hash NULL -+_002956_hash dvb_net_sec 3 37884 _002956_hash NULL -+_002957_hash e1000_check_copybreak 3 62448 _002957_hash NULL -+_002958_hash fast_rx_path 3 59214 _002958_hash NULL -+_002959_hash fc_fcp_frame_alloc 2 12624 _002959_hash NULL -+_002960_hash fcoe_ctlr_send_keep_alive 3 15308 _002960_hash NULL -+_002961_hash fwnet_incoming_packet 3 40380 _002961_hash NULL -+_002962_hash fwnet_pd_new 4 39947 _002962_hash NULL -+_002963_hash got_frame 2 16028 _002963_hash NULL -+_002964_hash gsm_mux_rx_netchar 3 33336 _002964_hash NULL -+_002965_hash hdlcdev_rx 3 997 _002965_hash NULL -+_002966_hash hdlc_empty_fifo 2 18397 _002966_hash NULL -+_002967_hash hfc_empty_fifo 2 57972 _002967_hash NULL -+_002968_hash hfcpci_empty_fifo 4 2427 _002968_hash NULL -+_002969_hash hfcsusb_rx_frame 3 52745 _002969_hash NULL -+_002970_hash hidp_output_raw_report 3 5629 _002970_hash NULL -+_002971_hash hscx_empty_fifo 2 13360 _002971_hash NULL -+_002972_hash hysdn_rx_netpkt 3 16136 _002972_hash NULL -+_002973_hash ieee80211_fragment 4 33112 _002973_hash NULL -+_002974_hash ieee80211_probereq_get 4-6 29069 _002974_hash NULL -+_002976_hash ieee80211_send_auth 5 24121 _002976_hash NULL -+_002977_hash ieee80211_set_probe_resp 3 10077 _002977_hash NULL -+_002978_hash ieee80211_tdls_mgmt 8 9581 _002978_hash NULL -+_002979_hash ip6_ufo_append_data 5-7-6 4780 _002979_hash NULL -+_002982_hash ip_ufo_append_data 6-8-7 12775 _002982_hash NULL -+_002985_hash ipw_packet_received_skb 2 1230 _002985_hash NULL -+_002986_hash iwch_reject_cr 3 23901 _002986_hash NULL -+_002987_hash iwm_rx_packet_alloc 3 9898 _002987_hash NULL -+_002988_hash ixgb_check_copybreak 3 5847 _002988_hash NULL -+_002989_hash l1oip_socket_parse 4 4507 _002989_hash NULL -+_002990_hash l2cap_send_cmd 4 14548 _002990_hash NULL -+_002991_hash l2tp_ip6_sendmsg 4 7461 _002991_hash NULL -+_002993_hash lowpan_fragment_xmit 3-4 22095 _002993_hash NULL -+_002996_hash mcs_unwrap_fir 3 25733 _002996_hash NULL -+_002997_hash mcs_unwrap_mir 3 9455 _002997_hash NULL -+_002998_hash mld_newpack 2 50950 _002998_hash NULL -+_002999_hash nfc_alloc_send_skb 4 3167 _002999_hash NULL -+_003000_hash p54_download_eeprom 4 43842 _003000_hash NULL -+_003002_hash ppp_tx_cp 5 62044 _003002_hash NULL -+_003003_hash prism2_send_mgmt 4 62605 _003003_hash &_001876_hash -+_003004_hash prism2_sta_send_mgmt 5 43916 _003004_hash NULL -+_003005_hash _queue_data 4 54983 _003005_hash NULL -+_003006_hash read_dma 3 55086 _003006_hash NULL -+_003007_hash read_fifo 3 826 _003007_hash NULL -+_003008_hash receive_copy 3 12216 _003008_hash NULL -+_003009_hash rtl8169_try_rx_copy 3 705 _003009_hash NULL -+_003010_hash _rtl92s_firmware_downloadcode 3 14021 _003010_hash NULL -+_003011_hash rx_data 4 60442 _003011_hash NULL -+_003012_hash sis190_try_rx_copy 3 57069 _003012_hash NULL -+_003013_hash skge_rx_get 3 40598 _003013_hash NULL -+_003014_hash tcp_mark_head_lost 2 35895 _003014_hash NULL -+_003015_hash tcp_match_skb_to_sack 3-4 23568 _003015_hash NULL -+_003017_hash tso_fragment 3 29050 _003017_hash NULL -+_003018_hash tt_response_fill_table 1 57902 _003018_hash NULL -+_003020_hash udpv6_sendmsg 4 22316 _003020_hash NULL -+_003021_hash velocity_rx_copy 2 34583 _003021_hash NULL -+_003022_hash W6692_empty_Bfifo 2 47804 _003022_hash NULL -+_003023_hash zd_mac_rx 3 38296 _003023_hash NULL -+_003024_hash ath6kl_wmi_get_new_buf 1 52304 _003024_hash NULL -+_003025_hash bat_iv_ogm_queue_add 3 30870 _003025_hash NULL -+_003026_hash brcmf_alloc_pkt_and_read 2 63116 _003026_hash &_001808_hash -+_003027_hash brcmf_sdcard_recv_buf 6 38179 _003027_hash NULL -+_003028_hash brcmf_sdcard_rwdata 5 65041 _003028_hash NULL -+_003029_hash brcmf_sdcard_send_buf 6 7713 _003029_hash NULL -+_003030_hash carl9170_handle_mpdu 3 11056 _003030_hash NULL -+_003031_hash cfpkt_add_trail 3 27260 _003031_hash NULL -+_003032_hash cfpkt_pad_trail 2 55511 _003032_hash NULL -+_003033_hash dvb_net_sec_callback 2 28786 _003033_hash NULL -+_003034_hash fwnet_receive_packet 9 50537 _003034_hash NULL -+_003035_hash handle_rx_packet 3 58993 _003035_hash NULL -+_003036_hash HDLC_irq 2 8709 _003036_hash NULL -+_003037_hash hdlc_rpr_irq 2 10240 _003037_hash NULL -+_003043_hash ipwireless_network_packet_received 4 51277 _003043_hash NULL -+_003044_hash l2cap_bredr_sig_cmd 3 49065 _003044_hash NULL -+_003045_hash l2cap_sock_alloc_skb_cb 2 33532 _003045_hash NULL -+_003046_hash llcp_allocate_pdu 3 19866 _003046_hash NULL -+_003047_hash ppp_cp_event 6 2965 _003047_hash NULL -+_003048_hash receive_client_update_packet 3 49104 _003048_hash NULL -+_003049_hash receive_server_sync_packet 3 59021 _003049_hash NULL -+_003050_hash sky2_receive 2 13407 _003050_hash NULL -+_003051_hash tcp_sacktag_walk 5-6 49703 _003051_hash NULL -+_003053_hash tcp_write_xmit 2 64602 _003053_hash NULL -+_003054_hash ath6kl_wmi_add_wow_pattern_cmd 4 12842 _003054_hash NULL -+_003055_hash ath6kl_wmi_beginscan_cmd 8 25462 _003055_hash NULL -+_003056_hash ath6kl_wmi_send_probe_response_cmd 6 31728 _003056_hash NULL -+_003057_hash ath6kl_wmi_set_appie_cmd 5 39266 _003057_hash NULL -+_003058_hash ath6kl_wmi_set_ie_cmd 6 37260 _003058_hash NULL -+_003059_hash ath6kl_wmi_startscan_cmd 8 33674 _003059_hash NULL -+_003060_hash ath6kl_wmi_test_cmd 3 27312 _003060_hash NULL -+_003061_hash brcmf_sdbrcm_membytes 3-5 37324 _003061_hash NULL -+_003063_hash brcmf_sdbrcm_read_control 3 22721 _003063_hash NULL -+_003064_hash brcmf_tx_frame 3 20978 _003064_hash NULL -+_003065_hash __carl9170_rx 3 56784 _003065_hash NULL -+_003066_hash cfpkt_setlen 2 49343 _003066_hash NULL -+_003067_hash hdlc_irq_one 2 3944 _003067_hash NULL -+_003069_hash tcp_push_one 2 48816 _003069_hash NULL -+_003070_hash __tcp_push_pending_frames 2 48148 _003070_hash NULL -+_003071_hash brcmf_sdbrcm_bus_txctl 3 42492 _003071_hash NULL -+_003072_hash carl9170_rx 3 13272 _003072_hash NULL -+_003073_hash carl9170_rx_stream 3 1334 _003073_hash NULL -+_003074_hash tcp_push 3 10680 _003074_hash NULL -+_003075_hash create_log 2 8225 _003075_hash NULL -+_003076_hash expand_files 2 17080 _003076_hash NULL -+_003077_hash iio_device_alloc 1 41440 _003077_hash NULL -+_003078_hash OS_mem_token_alloc 1 14276 _003078_hash NULL -+_003079_hash packet_came 3 18072 _003079_hash NULL -+_003080_hash softsynth_write 3 3455 _003080_hash NULL -+_003081_hash alloc_fd 1 37637 _003081_hash NULL -+_003082_hash sys_dup3 2 33421 _003082_hash NULL -+_003083_hash do_fcntl 3 31468 _003083_hash NULL -+_003084_hash sys_dup2 2 25284 _003084_hash NULL -+_003085_hash sys_fcntl 3 19267 _003085_hash NULL -+_003086_hash sys_fcntl64 3 29031 _003086_hash NULL -+_003087_hash cmpk_message_handle_tx 4 54024 _003087_hash NULL -+_003088_hash comedi_buf_alloc 3 24822 _003088_hash NULL -+_003089_hash compat_rw_copy_check_uvector 3 22001 _003089_hash &_001989_hash -+_003090_hash compat_sys_fcntl64 3 60256 _003090_hash NULL -+_003091_hash evtchn_write 3 43278 _003091_hash NULL -+_003092_hash fw_download_code 3 13249 _003092_hash NULL -+_003093_hash fwSendNullPacket 2 54618 _003093_hash NULL -+_003095_hash ieee80211_authentication_req 3 63973 _003095_hash NULL -+_003097_hash rtllib_authentication_req 3 26713 _003097_hash NULL -+_003098_hash SendTxCommandPacket 3 42901 _003098_hash NULL -+_003099_hash snd_nm256_capture_copy 5 28622 _003099_hash NULL -+_003100_hash snd_nm256_playback_copy 5 38567 _003100_hash NULL -+_003101_hash tomoyo_init_log 2 14806 _003101_hash NULL -+_003102_hash usbdux_attach_common 4 51764 _003102_hash NULL -+_003103_hash compat_sys_fcntl 3 15654 _003103_hash NULL -+_003104_hash ieee80211_auth_challenge 3 18810 _003104_hash NULL -+_003105_hash ieee80211_rtl_auth_challenge 3 61897 _003105_hash NULL -+_003106_hash resize_async_buffer 4 64031 _003106_hash &_002119_hash -+_003107_hash rtllib_auth_challenge 3 12493 _003107_hash NULL -+_003108_hash tomoyo_write_log2 2 11732 _003108_hash NULL -+_003109_hash l2cap_sock_alloc_skb_cb 2 27671 _003109_hash NULL -+_003110_hash tcp_sacktag_walk 5-6 26339 _003110_hash NULL -+_003112_hash tcp_write_xmit 2 39755 _003112_hash NULL -+_003113_hash ab8500_address_write 3 4099 _003113_hash NULL -+_003114_hash ab8500_bank_write 3 51960 _003114_hash NULL -+_003115_hash ab8500_val_write 3 16473 _003115_hash NULL -+_003116_hash allocate_probes 1 40204 _003116_hash NULL -+_003117_hash alloc_ftrace_hash 1 57431 _003117_hash &_002532_hash -+_003118_hash __alloc_preds 2 9492 _003118_hash NULL -+_003119_hash __alloc_pred_stack 2 26687 _003119_hash NULL -+_003120_hash alloc_sched_domains 1 47756 _003120_hash NULL -+_003121_hash alloc_trace_probe 6 12323 _003121_hash NULL -+_003122_hash blk_dropped_read 3 4168 _003122_hash NULL -+_003123_hash blk_msg_write 3 13655 _003123_hash NULL -+_003124_hash cyttsp_probe 4 1940 _003124_hash NULL -+_003125_hash dccpprobe_read 3 52549 _003125_hash NULL -+_003126_hash event_enable_read 3 7074 _003126_hash NULL -+_003127_hash event_enable_write 3 45238 _003127_hash NULL -+_003128_hash event_filter_read 3 23494 _003128_hash NULL -+_003129_hash event_filter_write 3 56609 _003129_hash NULL -+_003130_hash event_id_read 3 64288 _003130_hash &_001240_hash -+_003131_hash ftrace_pid_write 3 39710 _003131_hash NULL -+_003132_hash ftrace_profile_read 3 21327 _003132_hash NULL -+_003133_hash ftrace_profile_write 3 53327 _003133_hash NULL -+_003134_hash hsc_msg_alloc 1 60990 _003134_hash NULL -+_003135_hash hsc_write 3 55875 _003135_hash NULL -+_003136_hash hsi_alloc_controller 1 41802 _003136_hash NULL -+_003137_hash hsi_register_board_info 2 13820 _003137_hash NULL -+_003138_hash ivtvfb_write 3 40023 _003138_hash NULL -+_003139_hash probes_write 3 29711 _003139_hash NULL -+_003140_hash rb_simple_read 3 45972 _003140_hash NULL -+_003141_hash rb_simple_write 3 20890 _003141_hash NULL -+_003142_hash show_header 3 4722 _003142_hash &_000736_hash -+_003143_hash stack_max_size_read 3 1445 _003143_hash NULL -+_003144_hash stack_max_size_write 3 36068 _003144_hash NULL -+_003145_hash subsystem_filter_read 3 62310 _003145_hash NULL -+_003146_hash subsystem_filter_write 3 13022 _003146_hash NULL -+_003147_hash system_enable_read 3 25815 _003147_hash NULL -+_003148_hash system_enable_write 3 61396 _003148_hash NULL -+_003149_hash trace_options_core_read 3 47390 _003149_hash NULL -+_003150_hash trace_options_core_write 3 61551 _003150_hash NULL -+_003151_hash trace_options_read 3 11419 _003151_hash NULL -+_003152_hash trace_options_write 3 48275 _003152_hash NULL -+_003153_hash trace_parser_get_init 2 31379 _003153_hash NULL -+_003154_hash trace_seq_to_user 3 65398 _003154_hash NULL -+_003155_hash tracing_buffers_read 3 11124 _003155_hash NULL -+_003156_hash tracing_clock_write 3 27961 _003156_hash NULL -+_003157_hash tracing_cpumask_read 3 7010 _003157_hash NULL -+_003158_hash tracing_ctrl_read 3 46922 _003158_hash NULL -+_003159_hash tracing_ctrl_write 3 42324 _003159_hash &_001726_hash -+_003160_hash tracing_entries_read 3 8345 _003160_hash NULL -+_003161_hash tracing_entries_write 3 60563 _003161_hash NULL -+_003162_hash tracing_max_lat_read 3 8890 _003162_hash NULL -+_003163_hash tracing_max_lat_write 3 8728 _003163_hash NULL -+_003164_hash tracing_read_dyn_info 3 45468 _003164_hash NULL -+_003165_hash tracing_readme_read 3 16493 _003165_hash NULL -+_003166_hash tracing_saved_cmdlines_read 3 21434 _003166_hash NULL -+_003167_hash tracing_set_trace_read 3 44122 _003167_hash NULL -+_003168_hash tracing_set_trace_write 3 57096 _003168_hash NULL -+_003169_hash tracing_stats_read 3 34537 _003169_hash NULL -+_003170_hash tracing_total_entries_read 3 62817 _003170_hash NULL -+_003171_hash tracing_trace_options_write 3 153 _003171_hash NULL -+_003172_hash ttm_put_pages 2 9179 _003172_hash NULL -+_003173_hash u_memcpya 2-3 30139 _003173_hash NULL -+_003174_hash alloc_and_copy_ftrace_hash 1 29368 _003174_hash NULL -+_003175_hash ath6kl_sdio_alloc_prep_scat_req 2 51986 _003175_hash NULL -+_003176_hash ath6kl_usb_submit_ctrl_in 6 32880 _003176_hash &_000778_hash -+_003177_hash ath6kl_usb_submit_ctrl_out 6 9978 _003177_hash NULL -+_003178_hash brcmf_usbdev_qinit 2 19090 _003178_hash &_001533_hash -+_003179_hash brcmf_usb_dl_cmd 4 53130 _003179_hash NULL -+_003180_hash create_trace_probe 1 20175 _003180_hash NULL -+_003181_hash da9052_group_write 3 4534 _003181_hash NULL -+_003182_hash mmio_read 4 40348 _003182_hash NULL -+_003183_hash ptp_filter_init 2 36780 _003183_hash NULL -+_003184_hash read_file_dfs 3 43145 _003184_hash NULL -+_003185_hash tracing_read_pipe 3 35312 _003185_hash NULL -+_003186_hash vivi_read 3 23073 _003186_hash NULL -+_003187_hash arcfb_write 3 8702 _003187_hash NULL -+_003188_hash beacon_interval_write 3 17952 _003188_hash NULL -+_003189_hash brcmf_usb_attach 1-2 44656 _003189_hash NULL -+_003191_hash broadsheetfb_write 3 39976 _003191_hash NULL -+_003192_hash broadsheet_spiflash_rewrite_sector 2 54864 _003192_hash NULL -+_003193_hash dtim_interval_write 3 30489 _003193_hash NULL -+_003194_hash dynamic_ps_timeout_write 3 37713 _003194_hash NULL -+_003195_hash f_audio_buffer_alloc 1 41110 _003195_hash NULL -+_003196_hash fb_sys_read 3 13778 _003196_hash NULL -+_003197_hash fb_sys_write 3 33130 _003197_hash NULL -+_003198_hash forced_ps_write 3 37209 _003198_hash NULL -+_003199_hash gpio_power_write 3 1991 _003199_hash NULL -+_003200_hash hecubafb_write 3 26942 _003200_hash NULL -+_003201_hash metronomefb_write 3 8823 _003201_hash NULL -+_003202_hash odev_update 2 50169 _003202_hash NULL -+_003203_hash oz_add_farewell 5 20652 _003203_hash NULL -+_003204_hash oz_cdev_read 3 20659 _003204_hash NULL -+_003205_hash oz_cdev_write 3 33852 _003205_hash NULL -+_003206_hash oz_ep_alloc 2 5587 _003206_hash NULL -+_003207_hash pmcraid_copy_sglist 3 38431 _003207_hash NULL -+_003208_hash rx_streaming_always_write 3 32357 _003208_hash NULL -+_003209_hash rx_streaming_interval_write 3 50120 _003209_hash NULL -+_003210_hash split_scan_timeout_write 3 52128 _003210_hash NULL -+_003211_hash suspend_dtim_interval_write 3 48854 _003211_hash NULL -+_003212_hash ufx_alloc_urb_list 3 10349 _003212_hash NULL -+_003213_hash viafb_dfph_proc_write 3 49288 _003213_hash NULL -+_003214_hash viafb_dfpl_proc_write 3 627 _003214_hash NULL -+_003215_hash viafb_dvp0_proc_write 3 23023 _003215_hash NULL -+_003216_hash viafb_dvp1_proc_write 3 48864 _003216_hash NULL -+_003217_hash viafb_vt1636_proc_write 3 16018 _003217_hash NULL -+_003218_hash wl1271_rx_handle_data 3 56360 _003218_hash NULL -+_003219_hash wl12xx_cmd_build_probe_req 6-8 3098 _003219_hash NULL -+_003220_hash picolcd_fb_write 3 2318 _003220_hash NULL -+_003221_hash dlfb_ops_write 3 64150 _003221_hash NULL -+_003222_hash ufx_ops_write 3 54848 _003222_hash NULL -+_003223_hash viafb_iga1_odev_proc_write 3 36241 _003223_hash NULL -+_003224_hash viafb_iga2_odev_proc_write 3 2363 _003224_hash NULL -+_003225_hash xenfb_write 3 43412 _003225_hash NULL +@@ -0,0 +1,5876 @@ ++intel_fake_agp_alloc_by_type_1 intel_fake_agp_alloc_by_type 1 1 NULL ++batadv_orig_node_del_if_4 batadv_orig_node_del_if 2 4 NULL ++storvsc_connect_to_vsp_22 storvsc_connect_to_vsp 2 22 NULL ++compat_sock_setsockopt_23 compat_sock_setsockopt 5 23 NULL ++carl9170_alloc_27 carl9170_alloc 1 27 NULL ++sel_read_policyvers_55 sel_read_policyvers 3 55 NULL nohasharray ++padzero_55 padzero 1 55 &sel_read_policyvers_55 ++cfg80211_disconnected_57 cfg80211_disconnected 4 57 NULL ++__skb_to_sgvec_72 __skb_to_sgvec 0 72 NULL ++DepcaSignature_80 DepcaSignature 2 80 NULL nohasharray ++crypto_authenc_setkey_80 crypto_authenc_setkey 3 80 &DepcaSignature_80 ++snd_korg1212_copy_to_92 snd_korg1212_copy_to 6 92 NULL ++load_msg_95 load_msg 2 95 NULL ++device_flush_iotlb_115 device_flush_iotlb 2-3 115 NULL ++init_q_132 init_q 4 132 NULL ++memstick_alloc_host_142 memstick_alloc_host 1 142 NULL ++hva_to_gfn_memslot_149 hva_to_gfn_memslot 0-1 149 NULL ++tracing_trace_options_write_153 tracing_trace_options_write 3 153 NULL ++nvme_create_queue_170 nvme_create_queue 3 170 NULL ++xfs_buf_item_get_format_189 xfs_buf_item_get_format 2 189 NULL ++iscsi_session_setup_196 iscsi_session_setup 4-5 196 NULL ++virtblk_add_req_197 virtblk_add_req 2-3 197 NULL ++proc_scsi_write_proc_267 proc_scsi_write_proc 3 267 NULL ++br_port_info_size_268 br_port_info_size 0 268 NULL ++generic_file_direct_write_291 generic_file_direct_write 0 291 NULL ++read_file_war_stats_292 read_file_war_stats 3 292 NULL ++syslog_print_307 syslog_print 2 307 NULL ++platform_device_add_data_310 platform_device_add_data 3 310 NULL ++dn_setsockopt_314 dn_setsockopt 5 314 NULL ++next_node_allowed_318 next_node_allowed 1 318 NULL ++compat_sys_ioctl_333 compat_sys_ioctl 3 333 NULL ++btmrvl_txdnldready_read_413 btmrvl_txdnldready_read 3 413 NULL ++lbs_rdmac_read_418 lbs_rdmac_read 3 418 NULL ++snd_ca0106_ptr_read_467 snd_ca0106_ptr_read 0 467 NULL ++_alloc_get_attr_desc_470 _alloc_get_attr_desc 2 470 NULL ++dccp_manip_pkt_476 dccp_manip_pkt 4 476 NULL ++pidlist_resize_496 pidlist_resize 2 496 NULL ++read_vbt_r0_503 read_vbt_r0 1 503 NULL ++rx_rx_defrag_end_read_505 rx_rx_defrag_end_read 3 505 NULL ++ocfs2_validate_meta_ecc_bhs_527 ocfs2_validate_meta_ecc_bhs 0 527 NULL ++zlib_deflate_workspacesize_537 zlib_deflate_workspacesize 0-1-2 537 NULL ++iwl_dbgfs_wowlan_sram_read_540 iwl_dbgfs_wowlan_sram_read 3 540 NULL ++dle_count_543 dle_count 0 543 NULL ++devres_alloc_551 devres_alloc 2 551 NULL ++snd_aw2_saa7146_get_hw_ptr_playback_558 snd_aw2_saa7146_get_hw_ptr_playback 0 558 NULL ++dev_hard_header_565 dev_hard_header 0 565 NULL nohasharray ++start_isoc_chain_565 start_isoc_chain 2 565 &dev_hard_header_565 ++compat_sys_preadv_583 compat_sys_preadv 3 583 NULL ++smk_write_load_self2_591 smk_write_load_self2 3 591 NULL ++ni_gpct_device_construct_610 ni_gpct_device_construct 5 610 NULL ++compat_sys_shmat_620 compat_sys_shmat 3 620 NULL ++isp1760_register_628 isp1760_register 1-2 628 NULL ++drbd_bm_find_next_643 drbd_bm_find_next 2 643 NULL ++unlink_queued_645 unlink_queued 3-4 645 NULL ++dtim_interval_read_654 dtim_interval_read 3 654 NULL ++ceph_copy_user_to_page_vector_656 ceph_copy_user_to_page_vector 4-3 656 NULL ++div_u64_rem_672 div_u64_rem 0 672 NULL ++mem_rx_free_mem_blks_read_675 mem_rx_free_mem_blks_read 3 675 NULL ++rtl8169_try_rx_copy_705 rtl8169_try_rx_copy 3 705 NULL ++persistent_ram_vmap_709 persistent_ram_vmap 1-2 709 NULL ++ipath_resize_cq_712 ipath_resize_cq 2 712 NULL ++sctp_setsockopt_peer_addr_params_734 sctp_setsockopt_peer_addr_params 3 734 NULL ++wm8962_gpio_direction_out_738 wm8962_gpio_direction_out 2 738 NULL ++dvb_video_write_754 dvb_video_write 3 754 NULL ++iwl_read_targ_mem_772 iwl_read_targ_mem 0 772 NULL ++snd_pcm_drain_811 snd_pcm_drain 0 811 NULL ++if_writecmd_815 if_writecmd 2 815 NULL ++aac_change_queue_depth_825 aac_change_queue_depth 2 825 NULL ++read_fifo_826 read_fifo 3 826 NULL ++read_tree_block_841 read_tree_block 3 841 NULL ++um_idi_read_850 um_idi_read 3 850 NULL ++ieee80211_if_fmt_rc_rateidx_mcs_mask_5ghz_856 ieee80211_if_fmt_rc_rateidx_mcs_mask_5ghz 3 856 NULL ++o2net_send_message_vec_879 o2net_send_message_vec 4 879 NULL nohasharray ++iwl_dbgfs_fh_reg_read_879 iwl_dbgfs_fh_reg_read 3 879 &o2net_send_message_vec_879 ++snd_pcm_action_single_905 snd_pcm_action_single 0 905 NULL ++btmrvl_hsstate_read_920 btmrvl_hsstate_read 3 920 NULL ++readw_931 readw 0 931 NULL ++carl9170_cmd_buf_950 carl9170_cmd_buf 3 950 NULL ++ieee80211_ie_build_vht_cap_956 ieee80211_ie_build_vht_cap 0 956 NULL nohasharray ++__nodes_weight_956 __nodes_weight 2-0 956 &ieee80211_ie_build_vht_cap_956 ++sys_msgrcv_959 sys_msgrcv 3 959 NULL ++hdlcdev_rx_997 hdlcdev_rx 3 997 NULL ++smk_write_cipso2_1021 smk_write_cipso2 3 1021 NULL ++lp872x_select_buck_vout_addr_1045 lp872x_select_buck_vout_addr 0 1045 NULL ++gigaset_initdriver_1060 gigaset_initdriver 2 1060 NULL ++Read_hfc16_1070 Read_hfc16 0 1070 NULL ++mce_request_packet_1073 mce_request_packet 3 1073 NULL ++agp_create_memory_1075 agp_create_memory 1 1075 NULL ++_scsih_adjust_queue_depth_1083 _scsih_adjust_queue_depth 2 1083 NULL ++nfs_pgarray_set_1085 nfs_pgarray_set 2 1085 NULL ++llcp_sock_sendmsg_1092 llcp_sock_sendmsg 4 1092 NULL ++nfs4_init_nonuniform_client_string_1097 nfs4_init_nonuniform_client_string 3 1097 NULL ++store_risefalltime_1109 store_risefalltime 5 1109 NULL ++cfg80211_report_obss_beacon_1133 cfg80211_report_obss_beacon 3 1133 NULL ++vmalloc_32_1135 vmalloc_32 1 1135 NULL ++i2400m_rx_ctl_1157 i2400m_rx_ctl 4 1157 NULL ++ipc_alloc_1192 ipc_alloc 1 1192 NULL ++ib_create_send_mad_1196 ib_create_send_mad 5 1196 NULL ++i2400m_rx_ctl_ack_1199 i2400m_rx_ctl_ack 3 1199 NULL ++dgrp_dpa_read_1204 dgrp_dpa_read 3 1204 NULL ++i2cdev_read_1206 i2cdev_read 3 1206 NULL ++ipw_packet_received_skb_1230 ipw_packet_received_skb 2 1230 NULL ++thin_status_1239 thin_status 5 1239 NULL ++acpi_battery_write_alarm_1240 acpi_battery_write_alarm 3 1240 NULL ++ocfs2_extend_file_1266 ocfs2_extend_file 3 1266 NULL ++qla4xxx_change_queue_depth_1268 qla4xxx_change_queue_depth 2 1268 NULL ++ioctl_private_iw_point_1273 ioctl_private_iw_point 7 1273 NULL ++batadv_tt_prepare_packet_buff_1280 batadv_tt_prepare_packet_buff 4 1280 NULL ++tx_frag_in_process_called_read_1290 tx_frag_in_process_called_read 3 1290 NULL ++compat_put_u64_1319 compat_put_u64 1 1319 NULL ++ffs_1322 ffs 0 1322 NULL ++carl9170_rx_stream_1334 carl9170_rx_stream 3 1334 NULL ++btrfs_submit_compressed_write_1347 btrfs_submit_compressed_write 5 1347 NULL ++gen_pool_best_fit_1348 gen_pool_best_fit 2-3-4 1348 NULL ++io_mapping_create_wc_1354 io_mapping_create_wc 1-2 1354 NULL ++snd_pcm_lib_write1_1358 snd_pcm_lib_write1 0-3 1358 NULL ++ipx_sendmsg_1362 ipx_sendmsg 4 1362 NULL ++fw_stats_raw_read_1369 fw_stats_raw_read 3 1369 NULL ++ocfs2_prepare_inode_for_write_1372 ocfs2_prepare_inode_for_write 3 1372 NULL ++sctp_setsockopt_initmsg_1383 sctp_setsockopt_initmsg 3 1383 NULL ++do_msgsnd_1387 do_msgsnd 4 1387 NULL ++zone_page_state_1393 zone_page_state 0 1393 NULL ++file_read_actor_1401 file_read_actor 4 1401 NULL ++lm3533_als_get_threshold_reg_1404 lm3533_als_get_threshold_reg 0-1 1404 NULL ++stack_max_size_read_1445 stack_max_size_read 3 1445 NULL ++tx_queue_len_read_1463 tx_queue_len_read 3 1463 NULL ++xprt_alloc_1475 xprt_alloc 2 1475 NULL ++sta_num_ps_buf_frames_read_1488 sta_num_ps_buf_frames_read 3 1488 NULL ++posix_acl_permission_1495 posix_acl_permission 0 1495 NULL ++tomoyo_round2_1518 tomoyo_round2 0 1518 NULL ++alloc_perm_bits_1532 alloc_perm_bits 2 1532 NULL ++ieee80211_if_read_dot11MeshHWMPnetDiameterTraversalTime_1589 ieee80211_if_read_dot11MeshHWMPnetDiameterTraversalTime 3 1589 NULL ++fc_frame_alloc_1596 fc_frame_alloc 2 1596 NULL ++packet_buffer_init_1607 packet_buffer_init 2 1607 NULL ++btmrvl_hscmd_read_1614 btmrvl_hscmd_read 3 1614 NULL ++v9fs_fid_xattr_get_1618 v9fs_fid_xattr_get 0 1618 NULL ++btmrvl_hsmode_read_1647 btmrvl_hsmode_read 3 1647 NULL ++ikconfig_read_current_1658 ikconfig_read_current 3 1658 NULL ++netdev_feature_string_1667 netdev_feature_string 0 1667 NULL ++compat_x25_ioctl_1674 compat_x25_ioctl 3 1674 NULL ++rmap_add_1677 rmap_add 3 1677 NULL ++configfs_read_file_1683 configfs_read_file 3 1683 NULL ++coda_psdev_write_1711 coda_psdev_write 3 1711 NULL ++btrfs_dir_data_len_1714 btrfs_dir_data_len 0 1714 NULL ++dma_memcpy_pg_to_iovec_1725 dma_memcpy_pg_to_iovec 6 1725 NULL ++tx_frag_called_read_1748 tx_frag_called_read 3 1748 NULL ++compat_cdrom_generic_command_1756 compat_cdrom_generic_command 4 1756 NULL ++ieee80211_new_mesh_header_1761 ieee80211_new_mesh_header 0 1761 NULL ++ebt_size_mwt_1768 ebt_size_mwt 0 1768 NULL ++cosa_write_1774 cosa_write 3 1774 NULL ++update_macheader_1775 update_macheader 7 1775 NULL ++fcoe_ctlr_device_add_1793 fcoe_ctlr_device_add 3 1793 NULL ++__nodelist_scnprintf_1815 __nodelist_scnprintf 0-2-4 1815 NULL ++rx_defrag_called_read_1897 rx_defrag_called_read 3 1897 NULL ++nfs_parse_server_name_1899 nfs_parse_server_name 2 1899 NULL ++tx_tx_retry_data_read_1926 tx_tx_retry_data_read 3 1926 NULL ++cyttsp_probe_1940 cyttsp_probe 4 1940 NULL ++ieee80211_if_fmt_dot11MeshConfirmTimeout_1945 ieee80211_if_fmt_dot11MeshConfirmTimeout 3 1945 NULL ++read_swap_header_1957 read_swap_header 0 1957 NULL ++ivtv_v4l2_read_1964 ivtv_v4l2_read 3 1964 NULL ++sel_read_avc_hash_stats_1984 sel_read_avc_hash_stats 3 1984 NULL ++__alloc_bootmem_node_1992 __alloc_bootmem_node 2 1992 NULL ++atomic_read_unchecked_1995 atomic_read_unchecked 0 1995 NULL ++batadv_tt_commit_changes_2008 batadv_tt_commit_changes 4 2008 NULL ++sep_prepare_input_dma_table_2009 sep_prepare_input_dma_table 2-3 2009 NULL ++rx_rx_defrag_read_2010 rx_rx_defrag_read 3 2010 NULL ++ocfs2_global_qinit_alloc_2018 ocfs2_global_qinit_alloc 0 2018 NULL ++write_flush_pipefs_2021 write_flush_pipefs 3 2021 NULL ++BcmCopySection_2035 BcmCopySection 5 2035 NULL ++devm_ioremap_nocache_2036 devm_ioremap_nocache 2-3 2036 NULL ++ath6kl_fwlog_mask_read_2050 ath6kl_fwlog_mask_read 3 2050 NULL ++ocfs2_expand_inline_dir_2063 ocfs2_expand_inline_dir 3 2063 NULL ++subbuf_read_actor_2071 subbuf_read_actor 3 2071 NULL ++iwl_dbgfs_current_sleep_command_read_2081 iwl_dbgfs_current_sleep_command_read 3 2081 NULL ++get_unaligned_le32_2092 get_unaligned_le32 0 2092 NULL ++idetape_chrdev_read_2097 idetape_chrdev_read 3 2097 NULL ++audit_expand_2098 audit_expand 2 2098 NULL ++num_pages_spanned_2105 num_pages_spanned 0 2105 NULL ++iwl_dbgfs_log_event_read_2107 iwl_dbgfs_log_event_read 3 2107 NULL ++ecryptfs_encrypt_and_encode_filename_2109 ecryptfs_encrypt_and_encode_filename 6 2109 NULL ++__find_xattr_2117 __find_xattr 6 2117 NULL nohasharray ++enable_read_2117 enable_read 3 2117 &__find_xattr_2117 ++pcf50633_write_block_2124 pcf50633_write_block 3-2 2124 NULL ++check_load_and_stores_2143 check_load_and_stores 2 2143 NULL ++mlx4_init_icm_table_2151 mlx4_init_icm_table 5-4 2151 NULL nohasharray ++multipath_status_2151 multipath_status 5 2151 &mlx4_init_icm_table_2151 ++iov_iter_count_2152 iov_iter_count 0 2152 NULL ++_ore_get_io_state_2166 _ore_get_io_state 3-4-5 2166 NULL ++ssb_bus_ssbbus_register_2217 ssb_bus_ssbbus_register 2 2217 NULL ++u32_array_read_2219 u32_array_read 3 2219 NULL ++vhci_write_2224 vhci_write 3 2224 NULL ++efx_tsoh_page_count_2225 efx_tsoh_page_count 0 2225 NULL ++lowpan_get_mac_header_length_2231 lowpan_get_mac_header_length 0 2231 NULL ++ieee80211_if_read_dot11MeshHWMPRannInterval_2249 ieee80211_if_read_dot11MeshHWMPRannInterval 3 2249 NULL ++netlbl_secattr_catmap_walk_2255 netlbl_secattr_catmap_walk 0-2 2255 NULL ++sel_write_avc_cache_threshold_2256 sel_write_avc_cache_threshold 3 2256 NULL ++do_update_counters_2259 do_update_counters 4 2259 NULL ++ath6kl_wmi_bssinfo_event_rx_2275 ath6kl_wmi_bssinfo_event_rx 3 2275 NULL ++debug_debug5_read_2291 debug_debug5_read 3 2291 NULL ++kvm_clear_guest_page_2308 kvm_clear_guest_page 4 2308 NULL ++intel_sdvo_set_value_2311 intel_sdvo_set_value 4 2311 NULL ++picolcd_fb_write_2318 picolcd_fb_write 3 2318 NULL ++gart_map_page_2325 gart_map_page 3-4 2325 NULL ++__erst_read_to_erange_2341 __erst_read_to_erange 0 2341 NULL ++zr364xx_read_2354 zr364xx_read 3 2354 NULL ++viafb_iga2_odev_proc_write_2363 viafb_iga2_odev_proc_write 3 2363 NULL ++xfs_buf_map_from_irec_2368 xfs_buf_map_from_irec 5 2368 NULL ++il_dbgfs_sensitivity_read_2370 il_dbgfs_sensitivity_read 3 2370 NULL ++rtl_port_map_2385 rtl_port_map 1-2 2385 NULL ++rxpipe_rx_prep_beacon_drop_read_2403 rxpipe_rx_prep_beacon_drop_read 3 2403 NULL ++isdn_v110_open_2418 isdn_v110_open 3 2418 NULL ++raid1_size_2419 raid1_size 0-2 2419 NULL ++roccat_common2_send_2422 roccat_common2_send 4 2422 NULL ++hfcpci_empty_fifo_2427 hfcpci_empty_fifo 4 2427 NULL ++ioremap_nocache_2439 ioremap_nocache 1-2 2439 NULL ++tty_buffer_find_2443 tty_buffer_find 2 2443 NULL ++nfs4_alloc_slots_2454 nfs4_alloc_slots 1 2454 NULL nohasharray ++ath6kl_usb_bmi_write_2454 ath6kl_usb_bmi_write 3 2454 &nfs4_alloc_slots_2454 ++b43legacy_debugfs_read_2473 b43legacy_debugfs_read 3 2473 NULL ++update_pmkid_2481 update_pmkid 4 2481 NULL ++wiphy_new_2482 wiphy_new 2 2482 NULL ++bio_alloc_bioset_2484 bio_alloc_bioset 2 2484 NULL ++squashfs_read_fragment_index_table_2506 squashfs_read_fragment_index_table 4 2506 NULL ++dm_write_2513 dm_write 3 2513 NULL ++v9fs_cached_file_read_2514 v9fs_cached_file_read 3 2514 NULL ++ext4_get_inode_loc_2516 ext4_get_inode_loc 0 2516 NULL ++gspca_dev_probe_2570 gspca_dev_probe 4 2570 NULL ++pcm_sanity_check_2574 pcm_sanity_check 0 2574 NULL ++smk_write_logging_2618 smk_write_logging 3 2618 NULL ++lro_gen_skb_2644 lro_gen_skb 6 2644 NULL ++nfc_llcp_send_ui_frame_2702 nfc_llcp_send_ui_frame 5 2702 NULL ++memcpy_fromiovecend_2707 memcpy_fromiovecend 3-4 2707 NULL ++__xip_file_write_2733 __xip_file_write 4-3 2733 NULL ++hid_report_raw_event_2762 hid_report_raw_event 4 2762 NULL ++mon_bin_ioctl_2771 mon_bin_ioctl 3 2771 NULL ++__next_cpu_2782 __next_cpu 1 2782 NULL ++sel_read_enforce_2828 sel_read_enforce 3 2828 NULL ++vb2_dc_get_userptr_2829 vb2_dc_get_userptr 2-3 2829 NULL nohasharray ++snd_pcm_reset_2829 snd_pcm_reset 0 2829 &vb2_dc_get_userptr_2829 ++wait_for_avail_2847 wait_for_avail 0 2847 NULL ++ufs_free_fragments_2857 ufs_free_fragments 2 2857 NULL ++sfq_alloc_2861 sfq_alloc 1 2861 NULL ++move_addr_to_user_2868 move_addr_to_user 2 2868 NULL ++__swab64p_2875 __swab64p 0 2875 NULL ++nla_padlen_2883 nla_padlen 1 2883 NULL ++cmm_write_2896 cmm_write 3 2896 NULL ++rbd_req_sync_read_2915 rbd_req_sync_read 4-5 2915 NULL ++alloc_page_cgroup_2919 alloc_page_cgroup 1 2919 NULL ++xfs_trans_get_buf_map_2927 xfs_trans_get_buf_map 4 2927 NULL ++nes_read_indexed_2946 nes_read_indexed 0 2946 NULL ++tm6000_i2c_recv_regs16_2949 tm6000_i2c_recv_regs16 5 2949 NULL ++ppp_cp_event_2965 ppp_cp_event 6 2965 NULL ++do_strnlen_user_2976 do_strnlen_user 0-2 2976 NULL ++p9_nr_pages_2992 p9_nr_pages 0-2 2992 NULL ++do_dmabuf_dirty_sou_3017 do_dmabuf_dirty_sou 7 3017 NULL ++depth_write_3021 depth_write 3 3021 NULL ++snd_azf3328_codec_inl_3022 snd_azf3328_codec_inl 0 3022 NULL ++xfrm_dst_alloc_copy_3034 xfrm_dst_alloc_copy 3 3034 NULL ++iwl_dbgfs_sleep_level_override_read_3038 iwl_dbgfs_sleep_level_override_read 3 3038 NULL ++nr_free_buffer_pages_3044 nr_free_buffer_pages 0 3044 NULL ++il3945_ucode_rx_stats_read_3048 il3945_ucode_rx_stats_read 3 3048 NULL ++__blk_end_bidi_request_3070 __blk_end_bidi_request 3-4 3070 NULL ++dac960_user_command_proc_write_3071 dac960_user_command_proc_write 3 3071 NULL ++free_coherent_3082 free_coherent 4-2 3082 NULL ++ttusb2_msg_3100 ttusb2_msg 4 3100 NULL ++rb_alloc_3102 rb_alloc 1 3102 NULL ++simple_write_to_buffer_3122 simple_write_to_buffer 5-2 3122 NULL ++print_time_3132 print_time 0 3132 NULL ++fill_write_buffer_3142 fill_write_buffer 3 3142 NULL ++CIFSSMBSetPosixACL_3154 CIFSSMBSetPosixACL 5 3154 NULL ++compat_sys_migrate_pages_3157 compat_sys_migrate_pages 2 3157 NULL ++uv_num_possible_blades_3177 uv_num_possible_blades 0 3177 NULL ++uvc_video_stats_dump_3181 uvc_video_stats_dump 3 3181 NULL ++compat_do_ip6t_set_ctl_3184 compat_do_ip6t_set_ctl 4 3184 NULL ++mempool_create_node_3191 mempool_create_node 1 3191 NULL ++alloc_context_3194 alloc_context 1 3194 NULL ++shmem_pread_slow_3198 shmem_pread_slow 3 3198 NULL ++kimage_crash_alloc_3233 kimage_crash_alloc 3 3233 NULL ++do_read_log_to_user_3236 do_read_log_to_user 4 3236 NULL ++ext3_xattr_find_entry_3237 ext3_xattr_find_entry 0 3237 NULL ++key_key_read_3241 key_key_read 3 3241 NULL ++number_3243 number 0 3243 NULL ++check_vendor_extension_3254 check_vendor_extension 1 3254 NULL ++__ilog2_u64_3284 __ilog2_u64 0 3284 NULL ++arvo_sysfs_write_3311 arvo_sysfs_write 6 3311 NULL ++dbDiscardAG_3322 dbDiscardAG 3 3322 NULL ++compat_sys_setsockopt_3326 compat_sys_setsockopt 5 3326 NULL ++de600_read_byte_3332 de600_read_byte 0 3332 NULL ++aac_rkt_ioremap_3333 aac_rkt_ioremap 2 3333 NULL ++read_from_oldmem_3337 read_from_oldmem 2 3337 NULL ++tty_port_register_device_attr_3341 tty_port_register_device_attr 3 3341 NULL ++il_dbgfs_interrupt_read_3351 il_dbgfs_interrupt_read 3 3351 NULL ++gsm_control_rls_3353 gsm_control_rls 3 3353 NULL ++scnprintf_3360 scnprintf 0-2 3360 NULL nohasharray ++tps65090_clr_bits_3360 tps65090_clr_bits 2 3360 &scnprintf_3360 ++mtdchar_writeoob_3393 mtdchar_writeoob 4 3393 NULL ++send_stream_3397 send_stream 4 3397 NULL ++isdn_readbchan_3401 isdn_readbchan 0-5 3401 NULL ++msix_map_region_3411 msix_map_region 3 3411 NULL ++mei_io_cb_alloc_resp_buf_3414 mei_io_cb_alloc_resp_buf 2 3414 NULL ++pci_add_cap_save_buffer_3426 pci_add_cap_save_buffer 3 3426 NULL ++crystalhd_create_dio_pool_3427 crystalhd_create_dio_pool 2 3427 NULL ++pipe_iov_copy_to_user_3447 pipe_iov_copy_to_user 3 3447 NULL ++percpu_modalloc_3448 percpu_modalloc 2-3 3448 NULL ++jffs2_acl_setxattr_3464 jffs2_acl_setxattr 4 3464 NULL nohasharray ++snd_pcm_lib_readv_transfer_3464 snd_pcm_lib_readv_transfer 4-2-5 3464 &jffs2_acl_setxattr_3464 ++alloc_skb_fclone_3467 alloc_skb_fclone 1 3467 NULL ++security_context_to_sid_default_3492 security_context_to_sid_default 2 3492 NULL ++xfrm_migrate_msgsize_3496 xfrm_migrate_msgsize 1 3496 NULL ++mem_tx_free_mem_blks_read_3521 mem_tx_free_mem_blks_read 3 3521 NULL nohasharray ++ieee80211_wx_set_gen_ie_rsl_3521 ieee80211_wx_set_gen_ie_rsl 3 3521 &mem_tx_free_mem_blks_read_3521 ++btrfs_dir_name_len_3549 btrfs_dir_name_len 0 3549 NULL ++b43legacy_read16_3561 b43legacy_read16 0 3561 NULL ++alloc_smp_resp_3566 alloc_smp_resp 1 3566 NULL ++evtchn_read_3569 evtchn_read 3 3569 NULL ++vc_resize_3585 vc_resize 2-3 3585 NULL ++compat_sys_semtimedop_3606 compat_sys_semtimedop 3 3606 NULL ++sctp_getsockopt_events_3607 sctp_getsockopt_events 2 3607 NULL ++edac_mc_alloc_3611 edac_mc_alloc 4 3611 NULL ++tx_tx_starts_read_3617 tx_tx_starts_read 3 3617 NULL ++aligned_kmalloc_3628 aligned_kmalloc 1 3628 NULL ++x86_swiotlb_alloc_coherent_3649 x86_swiotlb_alloc_coherent 2 3649 NULL nohasharray ++cm_copy_private_data_3649 cm_copy_private_data 2 3649 &x86_swiotlb_alloc_coherent_3649 ++ath6kl_disconnect_timeout_read_3650 ath6kl_disconnect_timeout_read 3 3650 NULL ++i915_compat_ioctl_3656 i915_compat_ioctl 2 3656 NULL ++ntfs_attr_make_non_resident_3694 ntfs_attr_make_non_resident 0 3694 NULL ++create_irq_3703 create_irq 0 3703 NULL nohasharray ++btmrvl_psmode_write_3703 btmrvl_psmode_write 3 3703 &create_irq_3703 nohasharray ++snd_m3_assp_read_3703 snd_m3_assp_read 0 3703 &btmrvl_psmode_write_3703 ++videobuf_pages_to_sg_3708 videobuf_pages_to_sg 2 3708 NULL ++lm3533_als_get_threshold_3725 lm3533_als_get_threshold 2 3725 NULL ++ci_ll_write_3740 ci_ll_write 4 3740 NULL nohasharray ++ath6kl_mgmt_tx_3740 ath6kl_mgmt_tx 7 3740 &ci_ll_write_3740 ++sctp_setsockopt_auth_key_3793 sctp_setsockopt_auth_key 3 3793 NULL ++ncp_file_write_3813 ncp_file_write 3 3813 NULL ++read_file_tx_chainmask_3829 read_file_tx_chainmask 3 3829 NULL ++stringify_nodemap_3842 stringify_nodemap 2 3842 NULL ++ubi_eba_read_leb_3847 ubi_eba_read_leb 0 3847 NULL ++create_one_cdev_3852 create_one_cdev 2 3852 NULL ++smk_read_onlycap_3855 smk_read_onlycap 3 3855 NULL ++get_fd_set_3866 get_fd_set 1 3866 NULL ++garp_attr_create_3883 garp_attr_create 3 3883 NULL ++uea_send_modem_cmd_3888 uea_send_modem_cmd 3 3888 NULL ++efivarfs_file_read_3893 efivarfs_file_read 3 3893 NULL ++nvram_write_3894 nvram_write 3 3894 NULL ++pipeline_pre_proc_swi_read_3898 pipeline_pre_proc_swi_read 3 3898 NULL ++comedi_buf_read_n_available_3899 comedi_buf_read_n_available 0 3899 NULL ++vcs_write_3910 vcs_write 3 3910 NULL ++atalk_compat_ioctl_3991 atalk_compat_ioctl 3 3991 NULL ++do_add_counters_3992 do_add_counters 3 3992 NULL ++userspace_status_4004 userspace_status 4 4004 NULL ++mei_write_4005 mei_write 3 4005 NULL nohasharray ++xfs_check_block_4005 xfs_check_block 4 4005 &mei_write_4005 ++snd_hdsp_capture_copy_4011 snd_hdsp_capture_copy 5 4011 NULL ++blk_end_request_4024 blk_end_request 3 4024 NULL ++ext4_xattr_find_entry_4025 ext4_xattr_find_entry 0 4025 NULL ++usbnet_write_cmd_async_4035 usbnet_write_cmd_async 7 4035 NULL ++read_file_queues_4078 read_file_queues 3 4078 NULL ++fbcon_do_set_font_4079 fbcon_do_set_font 2-3 4079 NULL ++da9052_free_irq_4090 da9052_free_irq 2 4090 NULL ++tm6000_read_4151 tm6000_read 3 4151 NULL ++mpt_raid_phys_disk_get_num_paths_4155 mpt_raid_phys_disk_get_num_paths 0 4155 NULL ++msg_bits_4158 msg_bits 0-3-4 4158 NULL ++get_alua_req_4166 get_alua_req 3 4166 NULL ++blk_dropped_read_4168 blk_dropped_read 3 4168 NULL ++read_file_bool_4180 read_file_bool 3 4180 NULL ++f1x_determine_channel_4202 f1x_determine_channel 2 4202 NULL ++_osd_req_list_objects_4204 _osd_req_list_objects 6 4204 NULL ++__snd_gf1_read_addr_4210 __snd_gf1_read_addr 0 4210 NULL ++ext4_new_inode_4247 ext4_new_inode 5 4247 NULL ++xt_compat_add_offset_4289 xt_compat_add_offset 0 4289 NULL ++__usbnet_read_cmd_4299 __usbnet_read_cmd 7 4299 NULL ++dvb_ringbuffer_pkt_read_user_4303 dvb_ringbuffer_pkt_read_user 2-3-5 4303 NULL ++nouveau_fifo_create__4327 nouveau_fifo_create_ 5-6 4327 NULL ++snd_rawmidi_kernel_read_4328 snd_rawmidi_kernel_read 3 4328 NULL ++__copy_from_user_inatomic_4365 __copy_from_user_inatomic 3 4365 NULL ++sys_setdomainname_4373 sys_setdomainname 2 4373 NULL ++irda_sendmsg_4388 irda_sendmsg 4 4388 NULL ++access_process_vm_4412 access_process_vm 0-2-4 4412 NULL nohasharray ++cxacru_cm_get_array_4412 cxacru_cm_get_array 4 4412 &access_process_vm_4412 ++libfc_vport_create_4415 libfc_vport_create 2 4415 NULL ++do_pages_stat_4437 do_pages_stat 2 4437 NULL ++at76_set_card_command_4471 at76_set_card_command 4 4471 NULL ++snd_seq_expand_var_event_4481 snd_seq_expand_var_event 0-5 4481 NULL ++sys_semtimedop_4486 sys_semtimedop 3 4486 NULL ++vmbus_establish_gpadl_4495 vmbus_establish_gpadl 3 4495 NULL ++set_link_security_4502 set_link_security 4 4502 NULL ++sys_llistxattr_4532 sys_llistxattr 3 4532 NULL ++da9052_group_write_4534 da9052_group_write 2-3 4534 NULL ++tty_register_device_4544 tty_register_device 2 4544 NULL ++videobuf_vmalloc_to_sg_4548 videobuf_vmalloc_to_sg 2 4548 NULL ++btrfs_file_extent_inline_item_len_4575 btrfs_file_extent_inline_item_len 0 4575 NULL ++xfs_buf_get_maps_4581 xfs_buf_get_maps 2 4581 NULL ++bch_alloc_4593 bch_alloc 1 4593 NULL ++iwl_dbgfs_tx_queue_read_4635 iwl_dbgfs_tx_queue_read 3 4635 NULL ++skb_add_data_nocache_4682 skb_add_data_nocache 4 4682 NULL ++cx18_read_pos_4683 cx18_read_pos 3 4683 NULL ++short_retry_limit_read_4687 short_retry_limit_read 3 4687 NULL ++kone_receive_4690 kone_receive 4 4690 NULL ++round_pipe_size_4701 round_pipe_size 0 4701 NULL ++cxgbi_alloc_big_mem_4707 cxgbi_alloc_big_mem 1 4707 NULL ++btmrvl_gpiogap_read_4718 btmrvl_gpiogap_read 3 4718 NULL ++ati_create_gatt_pages_4722 ati_create_gatt_pages 1 4722 NULL nohasharray ++show_header_4722 show_header 3 4722 &ati_create_gatt_pages_4722 ++pwr_rcvd_bcns_cnt_read_4774 pwr_rcvd_bcns_cnt_read 3 4774 NULL ++ncp__vol2io_4804 ncp__vol2io 5 4804 NULL ++repair_io_failure_4815 repair_io_failure 4 4815 NULL ++__iio_allocate_sw_ring_buffer_4843 __iio_allocate_sw_ring_buffer 3 4843 NULL ++gigaset_if_receive_4861 gigaset_if_receive 3 4861 NULL ++key_tx_spec_read_4862 key_tx_spec_read 3 4862 NULL ++ocfs2_defrag_extent_4873 ocfs2_defrag_extent 3 4873 NULL ++hid_register_field_4874 hid_register_field 2-3 4874 NULL ++vga_arb_read_4886 vga_arb_read 3 4886 NULL ++sys_ipc_4889 sys_ipc 3 4889 NULL ++lp872x_write_byte_4914 lp872x_write_byte 2 4914 NULL ++sys_process_vm_writev_4928 sys_process_vm_writev 3-5 4928 NULL ++ntfs_rl_insert_4931 ntfs_rl_insert 2-4 4931 NULL ++ieee80211_if_fmt_ave_beacon_4941 ieee80211_if_fmt_ave_beacon 3 4941 NULL ++da9055_reg_write_4942 da9055_reg_write 2 4942 NULL ++devm_kzalloc_4966 devm_kzalloc 2 4966 NULL ++compat_rawv6_setsockopt_4967 compat_rawv6_setsockopt 5 4967 NULL ++skb_network_header_len_4971 skb_network_header_len 0 4971 NULL ++ieee80211_if_fmt_dot11MeshHWMPconfirmationInterval_4976 ieee80211_if_fmt_dot11MeshHWMPconfirmationInterval 3 4976 NULL ++vmw_surface_define_size_4993 vmw_surface_define_size 0 4993 NULL ++qla82xx_pci_mem_write_direct_5008 qla82xx_pci_mem_write_direct 2 5008 NULL ++lm3533_als_set_target_5010 lm3533_als_set_target 2-3 5010 NULL ++do_mincore_5018 do_mincore 0-1 5018 NULL ++mtd_device_parse_register_5024 mtd_device_parse_register 5 5024 NULL ++ocfs2_check_range_for_holes_5066 ocfs2_check_range_for_holes 2-3 5066 NULL ++snd_mixart_BA1_read_5082 snd_mixart_BA1_read 5 5082 NULL ++snd_emu10k1_ptr20_read_5087 snd_emu10k1_ptr20_read 0 5087 NULL ++get_random_bytes_5091 get_random_bytes 2 5091 NULL nohasharray ++kfifo_copy_from_user_5091 kfifo_copy_from_user 3 5091 &get_random_bytes_5091 nohasharray ++blk_rq_sectors_5091 blk_rq_sectors 0 5091 &kfifo_copy_from_user_5091 ++mpol_to_str_5093 mpol_to_str 2 5093 NULL ++sound_write_5102 sound_write 3 5102 NULL ++ufs_add_fragments_5144 ufs_add_fragments 2 5144 NULL ++compat_ptr_5159 compat_ptr 0-1 5159 NULL ++__uwb_addr_print_5161 __uwb_addr_print 2 5161 NULL ++iwl_dbgfs_status_read_5171 iwl_dbgfs_status_read 3 5171 NULL ++acpi_pcc_get_sqty_5176 acpi_pcc_get_sqty 0 5176 NULL ++sfi_map_memory_5183 sfi_map_memory 1-2 5183 NULL ++skb_network_header_5203 skb_network_header 0 5203 NULL ++pipe_set_size_5204 pipe_set_size 2 5204 NULL ++ppp_cp_parse_cr_5214 ppp_cp_parse_cr 4 5214 NULL ++ath6kl_debug_roam_tbl_event_5224 ath6kl_debug_roam_tbl_event 3 5224 NULL ++ssb_ioremap_5228 ssb_ioremap 2 5228 NULL ++isdn_ppp_skb_push_5236 isdn_ppp_skb_push 2 5236 NULL ++do_atmif_sioc_5247 do_atmif_sioc 3 5247 NULL ++pwr_elp_enter_read_5324 pwr_elp_enter_read 3 5324 NULL ++allocate_cnodes_5329 allocate_cnodes 1 5329 NULL ++ps_pspoll_utilization_read_5361 ps_pspoll_utilization_read 3 5361 NULL ++cciss_allocate_sg_chain_blocks_5368 cciss_allocate_sg_chain_blocks 3-2 5368 NULL ++bitmap_fold_5396 bitmap_fold 4 5396 NULL ++nilfs_palloc_entries_per_group_5418 nilfs_palloc_entries_per_group 0 5418 NULL ++sfi_map_table_5462 sfi_map_table 1 5462 NULL ++xfs_efd_init_5463 xfs_efd_init 3 5463 NULL ++xfs_efi_init_5476 xfs_efi_init 2 5476 NULL ++ubi_leb_write_5478 ubi_leb_write 4-5 5478 NULL ++cifs_security_flags_proc_write_5484 cifs_security_flags_proc_write 3 5484 NULL ++tty_write_5494 tty_write 3 5494 NULL ++tomoyo_update_domain_5498 tomoyo_update_domain 2 5498 NULL nohasharray ++ieee80211_if_fmt_last_beacon_5498 ieee80211_if_fmt_last_beacon 3 5498 &tomoyo_update_domain_5498 ++__max_nr_grant_frames_5505 __max_nr_grant_frames 0 5505 NULL ++spidev_message_5518 spidev_message 3 5518 NULL ++ieee80211_if_fmt_auto_open_plinks_5534 ieee80211_if_fmt_auto_open_plinks 3 5534 NULL ++brcmu_pkt_buf_get_skb_5556 brcmu_pkt_buf_get_skb 1 5556 NULL ++le_readq_5557 le_readq 0 5557 NULL ++inw_5558 inw 0 5558 NULL ++__first_dma_cap_5560 __first_dma_cap 0 5560 NULL ++fir16_create_5574 fir16_create 3 5574 NULL ++bioset_create_5580 bioset_create 1 5580 NULL ++oz_ep_alloc_5587 oz_ep_alloc 2 5587 NULL ++do_msgrcv_5590 do_msgrcv 4 5590 NULL ++usb_dump_device_descriptor_5599 usb_dump_device_descriptor 0 5599 NULL ++ldm_frag_add_5611 ldm_frag_add 2 5611 NULL ++compat_copy_entries_5617 compat_copy_entries 0 5617 NULL ++ext4_xattr_get_5661 ext4_xattr_get 0 5661 NULL ++posix_clock_register_5662 posix_clock_register 2 5662 NULL ++mthca_map_reg_5664 mthca_map_reg 2-3 5664 NULL ++__videobuf_alloc_vb_5665 __videobuf_alloc_vb 1 5665 NULL ++get_arg_5694 get_arg 3 5694 NULL ++vmw_kms_readback_5727 vmw_kms_readback 6 5727 NULL ++rts51x_transfer_data_partial_5735 rts51x_transfer_data_partial 6 5735 NULL ++ubi_cdev_compat_ioctl_5746 ubi_cdev_compat_ioctl 3 5746 NULL ++sctp_setsockopt_autoclose_5775 sctp_setsockopt_autoclose 3 5775 NULL ++compat_sys_writev_5784 compat_sys_writev 3 5784 NULL ++__vxge_hw_blockpool_malloc_5786 __vxge_hw_blockpool_malloc 2 5786 NULL ++skb_copy_datagram_iovec_5806 skb_copy_datagram_iovec 2-4 5806 NULL ++nv50_disp_pioc_create__5812 nv50_disp_pioc_create_ 5 5812 NULL ++ceph_x_encrypt_buflen_5829 ceph_x_encrypt_buflen 0-1 5829 NULL ++autofs4_root_compat_ioctl_5838 autofs4_root_compat_ioctl 3 5838 NULL ++ceph_msg_new_5846 ceph_msg_new 2 5846 NULL ++ixgb_check_copybreak_5847 ixgb_check_copybreak 3 5847 NULL ++setup_req_5848 setup_req 3 5848 NULL ++rx_filter_max_arp_queue_dep_read_5851 rx_filter_max_arp_queue_dep_read 3 5851 NULL ++compat_sys_move_pages_5861 compat_sys_move_pages 2 5861 NULL nohasharray ++uinput_compat_ioctl_5861 uinput_compat_ioctl 3 5861 &compat_sys_move_pages_5861 ++port_show_regs_5904 port_show_regs 3 5904 NULL ++rbd_segment_length_5907 rbd_segment_length 0-3-2 5907 NULL ++uhci_debug_read_5911 uhci_debug_read 3 5911 NULL ++qla82xx_pci_mem_read_2M_5912 qla82xx_pci_mem_read_2M 2 5912 NULL ++ttm_bo_kmap_ttm_5922 ttm_bo_kmap_ttm 3 5922 NULL ++lbs_highsnr_read_5931 lbs_highsnr_read 3 5931 NULL ++ps_poll_ps_poll_timeouts_read_5934 ps_poll_ps_poll_timeouts_read 3 5934 NULL ++edac_device_alloc_ctl_info_5941 edac_device_alloc_ctl_info 1 5941 NULL ++tipc_subseq_alloc_5957 tipc_subseq_alloc 1 5957 NULL ++__apu_get_register_5967 __apu_get_register 0 5967 NULL ++ieee80211_if_fmt_rc_rateidx_mask_5ghz_5971 ieee80211_if_fmt_rc_rateidx_mask_5ghz 3 5971 NULL ++ntfs_rl_append_6037 ntfs_rl_append 2-4 6037 NULL ++da9052_request_irq_6058 da9052_request_irq 2 6058 NULL ++sctp_setsockopt_connectx_6073 sctp_setsockopt_connectx 3 6073 NULL ++rts51x_ms_rw_multi_sector_6076 rts51x_ms_rw_multi_sector 3-4 6076 NULL ++ipmi_addr_length_6110 ipmi_addr_length 0 6110 NULL ++dfs_global_file_write_6112 dfs_global_file_write 3 6112 NULL ++matrix_keypad_build_keymap_6129 matrix_keypad_build_keymap 3 6129 NULL ++nouveau_parent_create__6131 nouveau_parent_create_ 7 6131 NULL ++ivtv_copy_buf_to_user_6159 ivtv_copy_buf_to_user 4 6159 NULL ++vdma_mem_alloc_6171 vdma_mem_alloc 1 6171 NULL ++wl1251_cmd_template_set_6172 wl1251_cmd_template_set 4 6172 NULL ++mxt_show_instance_6207 mxt_show_instance 2-0 6207 NULL ++v4l2_ctrl_new_std_menu_6221 v4l2_ctrl_new_std_menu 4 6221 NULL ++mqueue_read_file_6228 mqueue_read_file 3 6228 NULL ++f_hidg_read_6238 f_hidg_read 3 6238 NULL ++fbcon_prepare_logo_6246 fbcon_prepare_logo 5 6246 NULL ++pcpu_next_pop_6277 pcpu_next_pop 4 6277 NULL ++tx_tx_start_null_frame_read_6281 tx_tx_start_null_frame_read 3 6281 NULL ++snd_hda_override_conn_list_6282 snd_hda_override_conn_list 0 6282 NULL nohasharray ++xenbus_file_write_6282 xenbus_file_write 3 6282 &snd_hda_override_conn_list_6282 ++posix_acl_fix_xattr_to_user_6283 posix_acl_fix_xattr_to_user 2 6283 NULL ++nf_nat_ipv6_manip_pkt_6289 nf_nat_ipv6_manip_pkt 2 6289 NULL ++nf_nat_sack_adjust_6297 nf_nat_sack_adjust 2 6297 NULL ++mid_get_vbt_data_r10_6308 mid_get_vbt_data_r10 2 6308 NULL ++_proc_do_string_6376 _proc_do_string 2 6376 NULL ++osd_req_read_sg_kern_6378 osd_req_read_sg_kern 5 6378 NULL ++posix_acl_fix_xattr_userns_6420 posix_acl_fix_xattr_userns 4 6420 NULL ++ipr_change_queue_depth_6431 ipr_change_queue_depth 2 6431 NULL ++__alloc_bootmem_node_nopanic_6432 __alloc_bootmem_node_nopanic 2 6432 NULL ++ext4_compat_ioctl_6471 ext4_compat_ioctl 3 6471 NULL ++ieee80211_if_fmt_dot11MeshMaxRetries_6476 ieee80211_if_fmt_dot11MeshMaxRetries 3 6476 NULL ++cipso_v4_map_lvl_hton_6490 cipso_v4_map_lvl_hton 0 6490 NULL ++dbg_intr_buf_6501 dbg_intr_buf 2 6501 NULL ++mei_read_6507 mei_read 3 6507 NULL ++cpumask_next_and_6516 cpumask_next_and 1 6516 NULL ++read_file_disable_ani_6536 read_file_disable_ani 3 6536 NULL ++rndis_set_oid_6547 rndis_set_oid 4 6547 NULL ++wdm_read_6549 wdm_read 3 6549 NULL ++fb_alloc_cmap_6554 fb_alloc_cmap 2 6554 NULL ++usb_dump_config_descriptor_6572 usb_dump_config_descriptor 0 6572 NULL ++snd_pcm_hw_refine_old_user_6586 snd_pcm_hw_refine_old_user 0 6586 NULL ++usemap_size_6601 usemap_size 0-1 6601 NULL ++snmp_mib_init_6604 snmp_mib_init 2-3 6604 NULL ++ecryptfs_filldir_6622 ecryptfs_filldir 3 6622 NULL ++virtscsi_alloc_tgt_6643 virtscsi_alloc_tgt 2 6643 NULL ++aac_srcv_ioremap_6659 aac_srcv_ioremap 2 6659 NULL ++process_rcvd_data_6679 process_rcvd_data 3 6679 NULL ++ql_process_mac_rx_skb_6689 ql_process_mac_rx_skb 4 6689 NULL ++ieee80211_build_preq_ies_6691 ieee80211_build_preq_ies 0-4 6691 NULL ++btrfs_lookup_csums_range_6696 btrfs_lookup_csums_range 2 6696 NULL ++ps_pspoll_max_apturn_read_6699 ps_pspoll_max_apturn_read 3 6699 NULL ++bnad_debugfs_write_regrd_6706 bnad_debugfs_write_regrd 3 6706 NULL ++mpeg_read_6708 mpeg_read 3 6708 NULL ++video_proc_write_6724 video_proc_write 3 6724 NULL ++posix_acl_xattr_count_6725 posix_acl_xattr_count 0-1 6725 NULL ++rds_rdma_pages_6735 rds_rdma_pages 0 6735 NULL ++sfi_check_table_6772 sfi_check_table 1 6772 NULL ++iwl_dbgfs_channels_read_6784 iwl_dbgfs_channels_read 3 6784 NULL ++ieee80211_if_read_6785 ieee80211_if_read 3 6785 NULL ++hdlcdrv_register_6792 hdlcdrv_register 2 6792 NULL ++tx_tx_done_data_read_6799 tx_tx_done_data_read 3 6799 NULL ++make_8259A_irq_6828 make_8259A_irq 1 6828 NULL ++calc_pages_for_6838 calc_pages_for 0-1-2 6838 NULL ++mon_bin_read_6841 mon_bin_read 3 6841 NULL ++snd_cs4281_BA0_read_6847 snd_cs4281_BA0_read 5 6847 NULL ++ieee80211_if_fmt_path_refresh_time_6888 ieee80211_if_fmt_path_refresh_time 3 6888 NULL nohasharray ++raw_seticmpfilter_6888 raw_seticmpfilter 3 6888 &ieee80211_if_fmt_path_refresh_time_6888 ++dlmfs_file_write_6892 dlmfs_file_write 3 6892 NULL ++spi_show_regs_6911 spi_show_regs 3 6911 NULL nohasharray ++proc_sessionid_read_6911 proc_sessionid_read 3 6911 &spi_show_regs_6911 nohasharray ++acm_alloc_minor_6911 acm_alloc_minor 0 6911 &proc_sessionid_read_6911 ++__kfifo_dma_in_finish_r_6913 __kfifo_dma_in_finish_r 2-3 6913 NULL ++ieee80211_rx_mgmt_probe_resp_6918 ieee80211_rx_mgmt_probe_resp 3 6918 NULL ++do_msgrcv_6921 do_msgrcv 3 6921 NULL ++cache_do_downcall_6926 cache_do_downcall 3 6926 NULL ++qsfp_cks_6945 qsfp_cks 0-2 6945 NULL ++pch_uart_hal_read_6961 pch_uart_hal_read 0 6961 NULL ++videobuf_dma_init_kernel_6963 videobuf_dma_init_kernel 3 6963 NULL ++rsa_extract_mpi_6973 rsa_extract_mpi 5 6973 NULL ++crypto_authenc_esn_setkey_6985 crypto_authenc_esn_setkey 3 6985 NULL ++request_key_async_6990 request_key_async 4 6990 NULL ++r871x_set_wpa_ie_7000 r871x_set_wpa_ie 3 7000 NULL ++cipso_v4_gentag_enum_7006 cipso_v4_gentag_enum 0 7006 NULL ++tracing_cpumask_read_7010 tracing_cpumask_read 3 7010 NULL ++wimax_msg_7030 wimax_msg 4 7030 NULL ++ipath_get_base_info_7043 ipath_get_base_info 3 7043 NULL ++snd_pcm_oss_bytes_7051 snd_pcm_oss_bytes 2 7051 NULL ++event_enable_read_7074 event_enable_read 3 7074 NULL ++beacon_interval_read_7091 beacon_interval_read 3 7091 NULL ++lp_compat_ioctl_7098 lp_compat_ioctl 3 7098 NULL ++pipeline_enc_rx_stat_fifo_int_read_7107 pipeline_enc_rx_stat_fifo_int_read 3 7107 NULL ++check_header_7108 check_header 0 7108 NULL ++utf16_strsize_7203 utf16_strsize 0 7203 NULL nohasharray ++__alloc_objio_seg_7203 __alloc_objio_seg 1 7203 &utf16_strsize_7203 ++sys32_ipc_7238 sys32_ipc 3-5-6-4 7238 NULL ++get_param_h_7247 get_param_h 0 7247 NULL ++vm_mmap_pgoff_7259 vm_mmap_pgoff 0 7259 NULL ++dma_ops_alloc_addresses_7272 dma_ops_alloc_addresses 3-4-5 7272 NULL ++rx_rate_rx_frames_per_rates_read_7282 rx_rate_rx_frames_per_rates_read 3 7282 NULL ++mgmt_control_7349 mgmt_control 3 7349 NULL ++ext3_free_blocks_7362 ext3_free_blocks 3-4 7362 NULL ++ieee80211_if_read_dot11MeshHWMPactivePathTimeout_7368 ieee80211_if_read_dot11MeshHWMPactivePathTimeout 3 7368 NULL ++hweight_long_7388 hweight_long 0-1 7388 NULL ++vhost_scsi_compat_ioctl_7393 vhost_scsi_compat_ioctl 3 7393 NULL ++sl_change_mtu_7396 sl_change_mtu 2 7396 NULL ++readb_7401 readb 0 7401 NULL ++drm_property_create_blob_7414 drm_property_create_blob 2 7414 NULL ++ip_options_get_alloc_7448 ip_options_get_alloc 1 7448 NULL ++ms_rw_multi_sector_7459 ms_rw_multi_sector 3-4 7459 NULL ++__mutex_lock_common_7469 __mutex_lock_common 0 7469 NULL nohasharray ++wm8996_gpio_direction_out_7469 wm8996_gpio_direction_out 2 7469 &__mutex_lock_common_7469 ++garp_request_join_7471 garp_request_join 4 7471 NULL ++compat_sys_msgrcv_7482 compat_sys_msgrcv 2 7482 NULL ++snd_pcm_lib_read1_7491 snd_pcm_lib_read1 0-3 7491 NULL ++sdhci_alloc_host_7509 sdhci_alloc_host 2 7509 NULL nohasharray ++ahash_instance_headroom_7509 ahash_instance_headroom 0 7509 &sdhci_alloc_host_7509 ++array_zalloc_7519 array_zalloc 1-2 7519 NULL ++setup_usemap_7524 setup_usemap 3 7524 NULL ++goal_in_my_reservation_7553 goal_in_my_reservation 3 7553 NULL ++smk_read_mapped_7562 smk_read_mapped 3 7562 NULL ++ext3_try_to_allocate_7590 ext3_try_to_allocate 5-3 7590 NULL ++groups_alloc_7614 groups_alloc 1 7614 NULL ++sg_virt_7616 sg_virt 0 7616 NULL ++cpumask_first_7648 cpumask_first 0 7648 NULL ++skb_copy_expand_7685 skb_copy_expand 2-3 7685 NULL nohasharray ++acpi_ex_allocate_name_string_7685 acpi_ex_allocate_name_string 2-1 7685 &skb_copy_expand_7685 ++acpi_ns_get_pathname_length_7699 acpi_ns_get_pathname_length 0 7699 NULL ++dev_write_7708 dev_write 3 7708 NULL ++tps65090_set_bits_7709 tps65090_set_bits 2 7709 NULL ++brcmf_sdcard_send_buf_7713 brcmf_sdcard_send_buf 6 7713 NULL nohasharray ++dbg_check_cats_7713 dbg_check_cats 0 7713 &brcmf_sdcard_send_buf_7713 ++set_bypass_pwup_pfs_7742 set_bypass_pwup_pfs 3 7742 NULL ++vxge_device_register_7752 vxge_device_register 4 7752 NULL ++osdv2_attr_list_elem_size_7763 osdv2_attr_list_elem_size 0-1 7763 NULL ++ubi_io_read_vid_hdr_7766 ubi_io_read_vid_hdr 0 7766 NULL ++alloc_candev_7776 alloc_candev 1-2 7776 NULL ++dfs_global_file_read_7787 dfs_global_file_read 3 7787 NULL ++bnx2_nvram_write_7790 bnx2_nvram_write 4-2 7790 NULL ++diva_os_copy_from_user_7792 diva_os_copy_from_user 4 7792 NULL ++ubifs_leb_read_7828 ubifs_leb_read 0 7828 NULL ++da9052_reg_update_7858 da9052_reg_update 2 7858 NULL ++tps6586x_clr_bits_7889 tps6586x_clr_bits 2 7889 NULL ++dvb_dmxdev_read_sec_7892 dvb_dmxdev_read_sec 4 7892 NULL ++xfs_trans_get_efi_7898 xfs_trans_get_efi 2 7898 NULL ++gfs2_tune_get_i_7903 gfs2_tune_get_i 0 7903 NULL ++ext3_group_extend_7911 ext3_group_extend 3 7911 NULL ++libfc_host_alloc_7917 libfc_host_alloc 2 7917 NULL ++f_hidg_write_7932 f_hidg_write 3 7932 NULL ++io_apic_setup_irq_pin_once_7934 io_apic_setup_irq_pin_once 1 7934 NULL ++smk_write_load_self_7958 smk_write_load_self 3 7958 NULL ++sys_mbind_7990 sys_mbind 5 7990 NULL ++tt3650_ci_msg_locked_8013 tt3650_ci_msg_locked 4 8013 NULL ++vcs_read_8017 vcs_read 3 8017 NULL ++normalize_up_8037 normalize_up 0-1-2 8037 NULL ++vhost_add_used_and_signal_n_8038 vhost_add_used_and_signal_n 4 8038 NULL ++ms_read_multiple_pages_8052 ms_read_multiple_pages 5-4 8052 NULL ++dgrp_mon_read_8065 dgrp_mon_read 3 8065 NULL ++leb_read_lock_8070 leb_read_lock 0 8070 NULL ++alloc_targets_8074 alloc_targets 2 8074 NULL nohasharray ++qla4xxx_post_ping_evt_work_8074 qla4xxx_post_ping_evt_work 4 8074 &alloc_targets_8074 ++venus_lookup_8121 venus_lookup 4 8121 NULL ++lm3533_als_set_threshold_8125 lm3533_als_set_threshold 2 8125 NULL ++ieee80211_if_fmt_num_buffered_multicast_8127 ieee80211_if_fmt_num_buffered_multicast 3 8127 NULL ++ext_sd_execute_write_data_8175 ext_sd_execute_write_data 9 8175 NULL ++dma_map_area_8178 dma_map_area 5-2-3 8178 NULL ++__sk_mem_schedule_8185 __sk_mem_schedule 2 8185 NULL ++ieee80211_if_fmt_dot11MeshHoldingTimeout_8187 ieee80211_if_fmt_dot11MeshHoldingTimeout 3 8187 NULL ++recent_mt_proc_write_8206 recent_mt_proc_write 3 8206 NULL ++rt2x00debug_write_bbp_8212 rt2x00debug_write_bbp 3 8212 NULL ++ad7879_spi_multi_read_8218 ad7879_spi_multi_read 3 8218 NULL ++play_iframe_8219 play_iframe 3 8219 NULL ++create_log_8225 create_log 2 8225 NULL nohasharray ++kvm_mmu_page_set_gfn_8225 kvm_mmu_page_set_gfn 2 8225 &create_log_8225 ++sctp_ssnmap_size_8228 sctp_ssnmap_size 0-1-2 8228 NULL ++check_xattr_ref_inode_8244 check_xattr_ref_inode 0 8244 NULL ++add_rx_skb_8257 add_rx_skb 3 8257 NULL ++t3_init_l2t_8261 t3_init_l2t 1 8261 NULL ++init_cdev_8274 init_cdev 1 8274 NULL ++rproc_recovery_write_8281 rproc_recovery_write 3 8281 NULL ++qib_decode_7220_err_8315 qib_decode_7220_err 3 8315 NULL ++snd_pcm_update_state_8320 snd_pcm_update_state 0 8320 NULL ++lm3533_led_get_pattern_8321 lm3533_led_get_pattern 0 8321 NULL nohasharray ++construct_key_and_link_8321 construct_key_and_link 4 8321 &lm3533_led_get_pattern_8321 ++ipwireless_send_packet_8328 ipwireless_send_packet 4 8328 NULL ++tracing_entries_read_8345 tracing_entries_read 3 8345 NULL ++ieee80211_if_fmt_ht_opmode_8347 ieee80211_if_fmt_ht_opmode 3 8347 NULL ++ping_getfrag_8360 ping_getfrag 4-3 8360 NULL ++uvc_v4l2_compat_ioctl32_8375 uvc_v4l2_compat_ioctl32 3 8375 NULL ++xdi_copy_from_user_8395 xdi_copy_from_user 4 8395 NULL ++zd_rf_scnprint_id_8406 zd_rf_scnprint_id 0-3 8406 NULL ++uvc_v4l2_ioctl_8411 uvc_v4l2_ioctl 2 8411 NULL ++snd_usb_ctl_msg_8436 snd_usb_ctl_msg 8 8436 NULL ++irq_create_mapping_8437 irq_create_mapping 2 8437 NULL ++afs_cell_lookup_8482 afs_cell_lookup 2 8482 NULL ++_irq_to_enable_addr_8485 _irq_to_enable_addr 0-1 8485 NULL ++batadv_tt_len_8502 batadv_tt_len 0-1 8502 NULL ++dev_config_8506 dev_config 3 8506 NULL ++ACL_to_cifs_posix_8509 ACL_to_cifs_posix 3 8509 NULL ++utf16_strnlen_8513 utf16_strnlen 0 8513 NULL ++opticon_process_data_packet_8524 opticon_process_data_packet 3 8524 NULL ++pnp_resource_len_8532 pnp_resource_len 0 8532 NULL ++alloc_pg_vec_8533 alloc_pg_vec 2 8533 NULL ++ocfs2_read_virt_blocks_8538 ocfs2_read_virt_blocks 2-3 8538 NULL ++profile_remove_8556 profile_remove 3 8556 NULL ++cache_slow_downcall_8570 cache_slow_downcall 2 8570 NULL ++mga_ioremap_8571 mga_ioremap 1-2 8571 NULL ++isr_dma0_done_read_8574 isr_dma0_done_read 3 8574 NULL ++tower_write_8580 tower_write 3 8580 NULL ++rtllib_MFIE_rate_len_8606 rtllib_MFIE_rate_len 0 8606 NULL ++shash_setkey_unaligned_8620 shash_setkey_unaligned 3 8620 NULL ++it821x_firmware_command_8628 it821x_firmware_command 3 8628 NULL ++scsi_dma_map_8632 scsi_dma_map 0 8632 NULL ++fuse_send_write_pages_8636 fuse_send_write_pages 0 8636 NULL ++generic_acl_set_8658 generic_acl_set 4 8658 NULL ++dio_bio_alloc_8677 dio_bio_alloc 5 8677 NULL ++lbs_bcnmiss_read_8678 lbs_bcnmiss_read 3 8678 NULL ++tc3589x_gpio_irq_unmap_8680 tc3589x_gpio_irq_unmap 2 8680 NULL ++rproc_trace_read_8686 rproc_trace_read 3 8686 NULL ++skb_frag_size_8695 skb_frag_size 0 8695 NULL ++arcfb_write_8702 arcfb_write 3 8702 NULL ++i_size_read_8703 i_size_read 0 8703 NULL nohasharray ++init_header_8703 init_header 0 8703 &i_size_read_8703 ++ctrl_out_8712 ctrl_out 3-5 8712 NULL ++jffs2_acl_count_8729 jffs2_acl_count 0-1 8729 NULL nohasharray ++snapshot_status_8729 snapshot_status 5 8729 &jffs2_acl_count_8729 ++f_dupfd_8730 f_dupfd 1 8730 NULL ++tx_tx_exch_expiry_read_8749 tx_tx_exch_expiry_read 3 8749 NULL ++joydev_compat_ioctl_8765 joydev_compat_ioctl 2 8765 NULL ++sys_prctl_8766 sys_prctl 4 8766 NULL ++x32_arch_ptrace_8767 x32_arch_ptrace 3-4 8767 NULL ++paging32_prefetch_gpte_8783 paging32_prefetch_gpte 4 8783 NULL ++ext4_try_to_write_inline_data_8785 ext4_try_to_write_inline_data 3-4 8785 NULL ++__bitmap_weight_8796 __bitmap_weight 0-2 8796 NULL ++cpuset_common_file_read_8800 cpuset_common_file_read 5 8800 NULL ++metronomefb_write_8823 metronomefb_write 3 8823 NULL ++icmpv6_manip_pkt_8833 icmpv6_manip_pkt 4 8833 NULL nohasharray ++get_queue_depth_8833 get_queue_depth 0 8833 &icmpv6_manip_pkt_8833 ++dvb_ringbuffer_pkt_next_8834 dvb_ringbuffer_pkt_next 0-2 8834 NULL ++usb_ep_queue_8839 usb_ep_queue 0 8839 NULL ++debug_debug1_read_8856 debug_debug1_read 3 8856 NULL ++wa_nep_queue_8858 wa_nep_queue 2 8858 NULL ++send_pages_8872 send_pages 3 8872 NULL ++compressed_bio_size_8887 compressed_bio_size 0-2 8887 NULL ++tracing_max_lat_read_8890 tracing_max_lat_read 3 8890 NULL ++sdio_max_byte_size_8907 sdio_max_byte_size 0 8907 NULL ++layout_commit_8926 layout_commit 3 8926 NULL ++adjust_priv_size_8935 adjust_priv_size 0-1 8935 NULL ++driver_stats_read_8944 driver_stats_read 3 8944 NULL ++read_file_tgt_stats_8959 read_file_tgt_stats 3 8959 NULL ++seq_bitmap_list_8963 seq_bitmap_list 3 8963 NULL ++usb_allocate_stream_buffers_8964 usb_allocate_stream_buffers 3 8964 NULL ++qib_qsfp_dump_8966 qib_qsfp_dump 0-3 8966 NULL ++venus_mkdir_8967 venus_mkdir 4 8967 NULL ++vol_cdev_read_8968 vol_cdev_read 3 8968 NULL nohasharray ++seq_open_net_8968 seq_open_net 4 8968 &vol_cdev_read_8968 ++bio_integrity_get_tag_8974 bio_integrity_get_tag 3 8974 NULL ++btrfs_alloc_free_block_8986 btrfs_alloc_free_block 3 8986 NULL ++palmas_ldo_write_9012 palmas_ldo_write 2 9012 NULL ++snd_emu10k1_ptr_read_9026 snd_emu10k1_ptr_read 0-2 9026 NULL ++__pskb_copy_9038 __pskb_copy 2 9038 NULL ++nla_put_9042 nla_put 3 9042 NULL ++snd_emu10k1_synth_copy_from_user_9061 snd_emu10k1_synth_copy_from_user 3-5 9061 NULL ++snd_gus_dram_peek_9062 snd_gus_dram_peek 4 9062 NULL ++fib_info_hash_alloc_9075 fib_info_hash_alloc 1 9075 NULL ++string_9080 string 0 9080 NULL ++create_queues_9088 create_queues 2-3 9088 NULL ++ftdi_prepare_write_buffer_9093 ftdi_prepare_write_buffer 3 9093 NULL ++caif_stream_sendmsg_9110 caif_stream_sendmsg 4 9110 NULL nohasharray ++gfn_to_rmap_9110 gfn_to_rmap 2-3 9110 &caif_stream_sendmsg_9110 ++pmcraid_change_queue_depth_9116 pmcraid_change_queue_depth 2 9116 NULL ++ext4_list_backups_9138 ext4_list_backups 0 9138 NULL ++dbg_command_buf_9165 dbg_command_buf 2 9165 NULL ++isr_irqs_read_9181 isr_irqs_read 3 9181 NULL ++count_leading_zeros_9183 count_leading_zeros 0 9183 NULL ++alloc_group_attrs_9194 alloc_group_attrs 2 9194 NULL nohasharray ++altera_swap_ir_9194 altera_swap_ir 2 9194 &alloc_group_attrs_9194 ++gx1_gx_base_9198 gx1_gx_base 0 9198 NULL ++snd_m3_get_pointer_9206 snd_m3_get_pointer 0 9206 NULL ++tx_tx_prepared_descs_read_9221 tx_tx_prepared_descs_read 3 9221 NULL ++sctp_getsockopt_delayed_ack_9232 sctp_getsockopt_delayed_ack 2 9232 NULL ++ocfs2_clear_ext_refcount_9256 ocfs2_clear_ext_refcount 4 9256 NULL ++tcf_csum_ipv4_icmp_9258 tcf_csum_ipv4_icmp 3 9258 NULL ++sparse_early_usemaps_alloc_node_9269 sparse_early_usemaps_alloc_node 4 9269 NULL ++hdpvr_read_9273 hdpvr_read 3 9273 NULL ++flakey_status_9274 flakey_status 5 9274 NULL ++qla82xx_pci_set_window_9303 qla82xx_pci_set_window 0-2 9303 NULL ++iwl_dbgfs_stations_read_9309 iwl_dbgfs_stations_read 3 9309 NULL ++ceph_sync_setxattr_9310 ceph_sync_setxattr 4 9310 NULL ++ieee80211_if_fmt_txpower_9334 ieee80211_if_fmt_txpower 3 9334 NULL ++ocfs2_orphan_for_truncate_9342 ocfs2_orphan_for_truncate 4 9342 NULL ++read_9397 read 3 9397 NULL ++nf_nat_sip_expect_9418 nf_nat_sip_expect 8 9418 NULL ++cfg80211_report_obss_beacon_9422 cfg80211_report_obss_beacon 3 9422 NULL ++bm_realloc_pages_9431 bm_realloc_pages 2 9431 NULL ++ffs_ep0_write_9438 ffs_ep0_write 3 9438 NULL ++kmalloc_array_9444 kmalloc_array 1-2 9444 NULL ++ieee80211_if_fmt_fwded_unicast_9454 ieee80211_if_fmt_fwded_unicast 3 9454 NULL ++mcs_unwrap_mir_9455 mcs_unwrap_mir 3 9455 NULL ++ext3_xattr_set_acl_9467 ext3_xattr_set_acl 4 9467 NULL ++agp_generic_alloc_user_9470 agp_generic_alloc_user 1 9470 NULL ++rbd_coll_end_req_9472 rbd_coll_end_req 3 9472 NULL ++__alloc_preds_9492 __alloc_preds 2 9492 NULL nohasharray ++crypt_status_9492 crypt_status 5 9492 &__alloc_preds_9492 ++lp_write_9511 lp_write 3 9511 NULL ++scsi_tgt_kspace_exec_9522 scsi_tgt_kspace_exec 8 9522 NULL ++lm3533_update_9529 lm3533_update 2 9529 NULL ++read_file_dma_9530 read_file_dma 3 9530 NULL ++ext3_alloc_branch_9534 ext3_alloc_branch 5 9534 NULL ++tps65910_gpio_output_9539 tps65910_gpio_output 2 9539 NULL ++audit_log_n_untrustedstring_9548 audit_log_n_untrustedstring 3 9548 NULL ++readl_9557 readl 0 9557 NULL ++fw_node_create_9559 fw_node_create 2 9559 NULL ++kobj_map_9566 kobj_map 2-3 9566 NULL ++f2fs_read_data_pages_9574 f2fs_read_data_pages 4 9574 NULL ++biovec_create_pools_9575 biovec_create_pools 2 9575 NULL ++ieee80211_tdls_mgmt_9581 ieee80211_tdls_mgmt 8 9581 NULL ++do_sync_9604 do_sync 1 9604 NULL ++snd_emu10k1_fx8010_read_9605 snd_emu10k1_fx8010_read 5-6 9605 NULL ++saa7164_buffer_alloc_user_9627 saa7164_buffer_alloc_user 2 9627 NULL ++compat_sys_keyctl_9639 compat_sys_keyctl 4-2-3 9639 NULL ++ocfs2_xattr_get_rec_9652 ocfs2_xattr_get_rec 0 9652 NULL ++uvc_alloc_buffers_9656 uvc_alloc_buffers 2-3 9656 NULL ++queue_received_packet_9657 queue_received_packet 5 9657 NULL ++snd_opl4_mem_proc_write_9670 snd_opl4_mem_proc_write 5 9670 NULL ++ks8842_read16_9676 ks8842_read16 0 9676 NULL nohasharray ++dns_query_9676 dns_query 3 9676 &ks8842_read16_9676 ++qib_7322_handle_hwerrors_9678 qib_7322_handle_hwerrors 3 9678 NULL ++__erst_read_from_storage_9690 __erst_read_from_storage 0 9690 NULL ++x25_asy_compat_ioctl_9694 x25_asy_compat_ioctl 4 9694 NULL nohasharray ++is_hole_9694 is_hole 2 9694 &x25_asy_compat_ioctl_9694 ++fnb_9703 fnb 2-3 9703 NULL ++ieee80211_if_read_aid_9705 ieee80211_if_read_aid 3 9705 NULL ++ieee80211_if_fmt_num_mcast_sta_9738 ieee80211_if_fmt_num_mcast_sta 3 9738 NULL ++ddb_input_read_9743 ddb_input_read 3 9743 NULL ++sta_last_ack_signal_read_9751 sta_last_ack_signal_read 3 9751 NULL ++btrfs_super_root_9763 btrfs_super_root 0 9763 NULL ++__alloc_percpu_9764 __alloc_percpu 1-2 9764 NULL ++do_sigpending_9766 do_sigpending 2 9766 NULL ++__blk_queue_init_tags_9778 __blk_queue_init_tags 2 9778 NULL ++snd_mem_proc_write_9786 snd_mem_proc_write 3 9786 NULL ++_regmap_write_9803 _regmap_write 2 9803 NULL ++ttm_bo_fbdev_io_9805 ttm_bo_fbdev_io 4 9805 NULL ++ieee80211_if_read_state_9813 ieee80211_if_read_state 3 9813 NULL ++pnp_mem_start_9817 pnp_mem_start 0 9817 NULL ++kernel_physical_mapping_init_9818 kernel_physical_mapping_init 0-2-1 9818 NULL ++dvb_dvr_set_buffer_size_9840 dvb_dvr_set_buffer_size 2 9840 NULL ++cfg80211_send_deauth_9862 cfg80211_send_deauth 3 9862 NULL ++pmcraid_alloc_sglist_9864 pmcraid_alloc_sglist 1 9864 NULL ++btrfs_free_reserved_extent_9867 btrfs_free_reserved_extent 2 9867 NULL ++f1x_translate_sysaddr_to_cs_9868 f1x_translate_sysaddr_to_cs 2 9868 NULL ++mlx4_bitmap_alloc_range_9876 mlx4_bitmap_alloc_range 2-3 9876 NULL ++wil_read_file_ioblob_9878 wil_read_file_ioblob 3 9878 NULL ++bm_register_write_9893 bm_register_write 3 9893 NULL nohasharray ++snd_midi_event_new_9893 snd_midi_event_new 1 9893 &bm_register_write_9893 ++snd_gf1_pcm_playback_copy_9895 snd_gf1_pcm_playback_copy 3-5 9895 NULL ++receive_DataRequest_9904 receive_DataRequest 3 9904 NULL ++nonpaging_page_fault_9908 nonpaging_page_fault 2 9908 NULL ++pstore_ftrace_knob_read_9947 pstore_ftrace_knob_read 3 9947 NULL ++read_file_misc_9948 read_file_misc 3 9948 NULL ++set_rxd_buffer_pointer_9950 set_rxd_buffer_pointer 8 9950 NULL ++ext2_new_blocks_9954 ext2_new_blocks 2 9954 NULL ++csum_partial_copy_fromiovecend_9957 csum_partial_copy_fromiovecend 3-4 9957 NULL ++get_free_serial_index_9969 get_free_serial_index 0 9969 NULL ++btrfs_add_link_9973 btrfs_add_link 5 9973 NULL ++ath6kl_usb_submit_ctrl_out_9978 ath6kl_usb_submit_ctrl_out 6 9978 NULL ++twl6040_clear_bits_9985 twl6040_clear_bits 2 9985 NULL ++aat2870_dump_reg_10019 aat2870_dump_reg 0 10019 NULL ++handle_request_10024 handle_request 9 10024 NULL ++batadv_orig_hash_add_if_10033 batadv_orig_hash_add_if 2 10033 NULL ++ieee80211_probereq_get_10040 ieee80211_probereq_get 4-5 10040 NULL ++rbd_coll_end_req_index_10041 rbd_coll_end_req_index 5 10041 NULL ++ieee80211_set_probe_resp_10077 ieee80211_set_probe_resp 3 10077 NULL ++wm831x_gpio_direction_in_10099 wm831x_gpio_direction_in 2 10099 NULL ++ufs_bitmap_search_10105 ufs_bitmap_search 0-3 10105 NULL ++get_elem_size_10110 get_elem_size 0-2 10110 NULL nohasharray ++dynamic_ps_timeout_read_10110 dynamic_ps_timeout_read 3 10110 &get_elem_size_10110 ++gfs2_meta_read_10112 gfs2_meta_read 0 10112 NULL ++offset_to_bit_10134 offset_to_bit 0 10134 NULL ++aes_decrypt_packets_read_10155 aes_decrypt_packets_read 3 10155 NULL ++rx_out_of_mem_read_10157 rx_out_of_mem_read 3 10157 NULL ++hidg_alloc_ep_req_10159 hidg_alloc_ep_req 2 10159 NULL nohasharray ++ol_chunk_entries_10159 ol_chunk_entries 0 10159 &hidg_alloc_ep_req_10159 ++stmpe_irq_unmap_10164 stmpe_irq_unmap 2 10164 NULL ++asd_store_update_bios_10165 asd_store_update_bios 4 10165 NULL ++proc_pid_attr_read_10173 proc_pid_attr_read 3 10173 NULL ++jffs2_user_setxattr_10182 jffs2_user_setxattr 4 10182 NULL ++do_ioctl_trans_10194 do_ioctl_trans 3 10194 NULL ++cciss_proc_write_10259 cciss_proc_write 3 10259 NULL ++snd_rme9652_capture_copy_10287 snd_rme9652_capture_copy 5 10287 NULL ++ubi_leb_change_10289 ubi_leb_change 4 10289 NULL ++lm3533_led_delay_set_10291 lm3533_led_delay_set 2 10291 NULL ++read_emulate_10310 read_emulate 2-4 10310 NULL ++ttm_object_device_init_10321 ttm_object_device_init 2 10321 NULL ++ubi_leb_read_10328 ubi_leb_read 0 10328 NULL ++tun_sendmsg_10337 tun_sendmsg 4 10337 NULL ++ufx_alloc_urb_list_10349 ufx_alloc_urb_list 3 10349 NULL ++dbAllocAny_10354 dbAllocAny 0 10354 NULL ++ath6kl_listen_int_read_10355 ath6kl_listen_int_read 3 10355 NULL ++ms_write_multiple_pages_10362 ms_write_multiple_pages 6-5 10362 NULL ++sta_ht_capa_read_10366 sta_ht_capa_read 3 10366 NULL ++ecryptfs_decode_and_decrypt_filename_10379 ecryptfs_decode_and_decrypt_filename 5 10379 NULL ++do_compat_pselect_10398 do_compat_pselect 1 10398 NULL ++fwtty_rx_10434 fwtty_rx 3 10434 NULL ++event_phy_transmit_error_read_10471 event_phy_transmit_error_read 3 10471 NULL ++ca91cx42_alloc_resource_10502 ca91cx42_alloc_resource 2 10502 NULL ++qib_alloc_fast_reg_page_list_10507 qib_alloc_fast_reg_page_list 2 10507 NULL ++sel_write_disable_10511 sel_write_disable 3 10511 NULL ++osd_req_write_sg_kern_10514 osd_req_write_sg_kern 5 10514 NULL ++rds_message_alloc_10517 rds_message_alloc 1 10517 NULL ++snd_pcm_hw_params_user_10520 snd_pcm_hw_params_user 0 10520 NULL ++ocfs2_add_refcounted_extent_10526 ocfs2_add_refcounted_extent 6 10526 NULL ++get_vm_area_caller_10527 get_vm_area_caller 1 10527 NULL ++snd_pcm_lib_read_10536 snd_pcm_lib_read 0-3 10536 NULL ++ext4_write_begin_10576 ext4_write_begin 3-4 10576 NULL ++scrub_remap_extent_10588 scrub_remap_extent 2 10588 NULL ++otp_read_10594 otp_read 2-4-5 10594 NULL ++supply_map_read_file_10608 supply_map_read_file 3 10608 NULL ++mc13783_set_fmt_10616 mc13783_set_fmt 3 10616 NULL ++ima_show_htable_violations_10619 ima_show_htable_violations 3 10619 NULL ++alloc_coherent_10632 alloc_coherent 2 10632 NULL ++nfs_idmap_lookup_id_10660 nfs_idmap_lookup_id 2 10660 NULL ++parport_write_10669 parport_write 0 10669 NULL ++inl_10708 inl 0 10708 NULL nohasharray ++selinux_inode_setxattr_10708 selinux_inode_setxattr 4 10708 &inl_10708 ++pvr2_ioread_read_10720 pvr2_ioread_read 3 10720 NULL nohasharray ++shash_async_setkey_10720 shash_async_setkey 3 10720 &pvr2_ioread_read_10720 ++spi_sync_10731 spi_sync 0 10731 NULL ++sctp_getsockopt_maxseg_10737 sctp_getsockopt_maxseg 2 10737 NULL nohasharray ++apu_get_register_10737 apu_get_register 0 10737 &sctp_getsockopt_maxseg_10737 ++compat_sys_msgsnd_10738 compat_sys_msgsnd 2 10738 NULL ++sys_syslog_10746 sys_syslog 3 10746 NULL ++alloc_one_pg_vec_page_10747 alloc_one_pg_vec_page 1 10747 NULL ++vhost_add_used_n_10760 vhost_add_used_n 3 10760 NULL ++kvm_read_guest_atomic_10765 kvm_read_guest_atomic 4 10765 NULL ++sys_bind_10799 sys_bind 3 10799 NULL ++compat_put_int_10828 compat_put_int 1 10828 NULL ++lbs_sleepparams_read_10840 lbs_sleepparams_read 3 10840 NULL ++ida_get_new_above_10853 ida_get_new_above 2 10853 NULL ++fuse_conn_max_background_read_10855 fuse_conn_max_background_read 3 10855 NULL ++ol_chunk_blocks_10864 ol_chunk_blocks 0 10864 NULL ++batadv_check_unicast_packet_10866 batadv_check_unicast_packet 2 10866 NULL ++snd_pcm_oss_write1_10872 snd_pcm_oss_write1 3 10872 NULL ++mid_get_vbt_data_r0_10876 mid_get_vbt_data_r0 2 10876 NULL ++bl_mark_for_commit_10879 bl_mark_for_commit 2-3 10879 NULL ++get_scq_10897 get_scq 2 10897 NULL ++cgroup_write_string_10900 cgroup_write_string 5 10900 NULL ++tifm_alloc_adapter_10903 tifm_alloc_adapter 1 10903 NULL ++__copy_from_user_10918 __copy_from_user 3 10918 NULL ++da9052_map_irq_10952 da9052_map_irq 2 10952 NULL ++bm_entry_read_10976 bm_entry_read 3 10976 NULL ++i915_min_freq_write_10981 i915_min_freq_write 3 10981 NULL ++sched_autogroup_write_10984 sched_autogroup_write 3 10984 NULL ++__hci_num_ctrl_10985 __hci_num_ctrl 0 10985 NULL ++xfrm_hash_alloc_10997 xfrm_hash_alloc 1 10997 NULL ++rx_filter_accum_arp_pend_requests_read_11003 rx_filter_accum_arp_pend_requests_read 3 11003 NULL ++SetLineNumber_11023 SetLineNumber 0 11023 NULL ++mb_find_next_bit_11037 mb_find_next_bit 2-3-0 11037 NULL ++nouveau_gpio_create__11048 nouveau_gpio_create_ 4 11048 NULL ++tda10048_writeregbulk_11050 tda10048_writeregbulk 4 11050 NULL ++carl9170_handle_mpdu_11056 carl9170_handle_mpdu 3 11056 NULL ++tcp_send_mss_11079 tcp_send_mss 0 11079 NULL ++snd_pcm_delay_11081 snd_pcm_delay 0 11081 NULL ++count_argc_11083 count_argc 0 11083 NULL ++kvm_write_guest_cached_11106 kvm_write_guest_cached 4 11106 NULL ++stmpe_gpio_to_irq_11110 stmpe_gpio_to_irq 2 11110 NULL ++tw_change_queue_depth_11116 tw_change_queue_depth 2 11116 NULL ++page_offset_11120 page_offset 0 11120 NULL ++tracing_buffers_read_11124 tracing_buffers_read 3 11124 NULL ++alloc_alien_cache_11127 alloc_alien_cache 2 11127 NULL ++acpi_os_map_memory_11161 acpi_os_map_memory 1-2 11161 NULL ++ioat2_alloc_ring_11172 ioat2_alloc_ring 2 11172 NULL nohasharray ++snd_gf1_pcm_playback_silence_11172 snd_gf1_pcm_playback_silence 3-4 11172 &ioat2_alloc_ring_11172 ++__swab16p_11220 __swab16p 0 11220 NULL ++il_dbgfs_rx_queue_read_11221 il_dbgfs_rx_queue_read 3 11221 NULL ++of_irq_count_11253 of_irq_count 0 11253 NULL ++ubifs_write_node_11258 ubifs_write_node 5-3 11258 NULL ++hugetlbfs_read_11268 hugetlbfs_read 3 11268 NULL ++cru_detect_11272 cru_detect 1 11272 NULL ++ext4_xattr_check_names_11314 ext4_xattr_check_names 0 11314 NULL ++tcp_send_rcvq_11316 tcp_send_rcvq 3 11316 NULL ++construct_key_11329 construct_key 3 11329 NULL nohasharray ++__kfifo_out_peek_11329 __kfifo_out_peek 0-3 11329 &construct_key_11329 ++next_segment_11330 next_segment 0-2-1 11330 NULL ++persistent_ram_buffer_map_11332 persistent_ram_buffer_map 1-2 11332 NULL ++ext4_get_inline_size_11349 ext4_get_inline_size 0 11349 NULL ++i915_max_freq_write_11350 i915_max_freq_write 3 11350 NULL ++sel_write_create_11353 sel_write_create 3 11353 NULL ++handle_unit_11355 handle_unit 0-1 11355 NULL ++batadv_skb_head_push_11360 batadv_skb_head_push 2 11360 NULL ++drm_vblank_init_11362 drm_vblank_init 2 11362 NULL ++qib_get_base_info_11369 qib_get_base_info 3 11369 NULL ++dev_irnet_write_11398 dev_irnet_write 3 11398 NULL ++___alloc_bootmem_11410 ___alloc_bootmem 1 11410 NULL ++str_to_user_11411 str_to_user 2 11411 NULL ++mem_fw_gen_free_mem_blks_read_11413 mem_fw_gen_free_mem_blks_read 3 11413 NULL ++ath6kl_wmi_test_rx_11414 ath6kl_wmi_test_rx 3 11414 NULL ++adis16480_show_firmware_revision_11417 adis16480_show_firmware_revision 3 11417 NULL ++trace_options_read_11419 trace_options_read 3 11419 NULL ++xd_read_multiple_pages_11422 xd_read_multiple_pages 5-4 11422 NULL ++prepare_image_11424 prepare_image 0 11424 NULL ++vring_size_11426 vring_size 0-1-2 11426 NULL ++bttv_read_11432 bttv_read 3 11432 NULL ++create_zero_mask_11453 create_zero_mask 0-1 11453 NULL ++swp_offset_11475 swp_offset 0 11475 NULL ++sca3000_read_first_n_hw_rb_11479 sca3000_read_first_n_hw_rb 2 11479 NULL ++xfs_file_buffered_aio_write_11492 xfs_file_buffered_aio_write 4 11492 NULL ++sd_do_mode_sense_11507 sd_do_mode_sense 5 11507 NULL ++kmem_zalloc_11510 kmem_zalloc 1 11510 NULL ++twl_direction_in_11527 twl_direction_in 2 11527 NULL ++setup_IO_APIC_irq_extra_11537 setup_IO_APIC_irq_extra 1 11537 NULL ++skb_cow_data_11565 skb_cow_data 0-2 11565 NULL ++mlx4_init_cmpt_table_11569 mlx4_init_cmpt_table 3 11569 NULL ++oprofilefs_ulong_to_user_11582 oprofilefs_ulong_to_user 3 11582 NULL ++snd_pcm_action_11589 snd_pcm_action 0 11589 NULL ++fw_device_op_ioctl_11595 fw_device_op_ioctl 2 11595 NULL ++sisusb_send_bridge_packet_11649 sisusb_send_bridge_packet 2 11649 NULL ++nla_total_size_11658 nla_total_size 0-1 11658 NULL ++ide_queue_pc_tail_11673 ide_queue_pc_tail 5 11673 NULL ++btrfs_alloc_delayed_item_11678 btrfs_alloc_delayed_item 1 11678 NULL ++da9055_gpio_direction_output_11680 da9055_gpio_direction_output 2 11680 NULL ++dsp_buffer_alloc_11684 dsp_buffer_alloc 2 11684 NULL ++sctp_setsockopt_hmac_ident_11687 sctp_setsockopt_hmac_ident 3 11687 NULL ++split_11691 split 2 11691 NULL ++snd_ctl_elem_user_tlv_11695 snd_ctl_elem_user_tlv 3 11695 NULL ++blk_rq_cur_bytes_11723 blk_rq_cur_bytes 0 11723 NULL ++tcf_csum_ipv6_icmp_11738 tcf_csum_ipv6_icmp 4 11738 NULL ++nfsd4_get_drc_mem_11748 nfsd4_get_drc_mem 0-1-2 11748 NULL ++dm_bio_prison_create_11749 dm_bio_prison_create 1 11749 NULL ++iwl_dbgfs_qos_read_11753 iwl_dbgfs_qos_read 3 11753 NULL ++ps_pspoll_timeouts_read_11776 ps_pspoll_timeouts_read 3 11776 NULL ++ebt_buf_add_11779 ebt_buf_add 0 11779 NULL ++btrfs_key_blockptr_11786 btrfs_key_blockptr 0 11786 NULL ++pcpu_fc_alloc_11818 pcpu_fc_alloc 2 11818 NULL ++zerocopy_sg_from_iovec_11828 zerocopy_sg_from_iovec 3 11828 NULL ++sctp_setsockopt_maxseg_11829 sctp_setsockopt_maxseg 3 11829 NULL ++rts51x_read_status_11830 rts51x_read_status 4 11830 NULL ++unix_stream_connect_11844 unix_stream_connect 3 11844 NULL ++nf_nat_sdp_media_11863 nf_nat_sdp_media 9 11863 NULL ++ecryptfs_copy_filename_11868 ecryptfs_copy_filename 4 11868 NULL ++kmalloc_slab_11917 kmalloc_slab 1 11917 NULL ++fs_devrw_entry_11924 fs_devrw_entry 3 11924 NULL ++bitmap_remap_11929 bitmap_remap 5 11929 NULL ++atomic_sub_return_11939 atomic_sub_return 0-1 11939 NULL ++dccp_feat_clone_sp_val_11942 dccp_feat_clone_sp_val 3 11942 NULL ++kvm_set_msr_common_11953 kvm_set_msr_common 3 11953 NULL ++f1x_swap_interleaved_region_11970 f1x_swap_interleaved_region 0-2 11970 NULL ++atmel_read16_11981 atmel_read16 0 11981 NULL ++read_and_add_raw_conns_11987 read_and_add_raw_conns 0 11987 NULL ++mwifiex_cfg80211_mgmt_tx_12022 mwifiex_cfg80211_mgmt_tx 9 12022 NULL ++ftdi_elan_total_command_size_12045 ftdi_elan_total_command_size 0 12045 NULL ++ieee80211_if_read_user_power_level_12050 ieee80211_if_read_user_power_level 3 12050 NULL ++il4965_ucode_tx_stats_read_12064 il4965_ucode_tx_stats_read 3 12064 NULL ++ptc_proc_write_12076 ptc_proc_write 3 12076 NULL ++ubifs_recover_log_leb_12079 ubifs_recover_log_leb 3 12079 NULL ++da9052_gpio_direction_output_12120 da9052_gpio_direction_output 2 12120 NULL ++alloc_bulk_urbs_generic_12127 alloc_bulk_urbs_generic 5 12127 NULL ++set_powered_12129 set_powered 4 12129 NULL ++nfs_writedata_alloc_12133 nfs_writedata_alloc 2 12133 NULL ++ramoops_init_prz_12134 ramoops_init_prz 5 12134 NULL ++xfs_handle_to_dentry_12135 xfs_handle_to_dentry 3 12135 NULL ++batadv_add_packet_12136 batadv_add_packet 3 12136 NULL ++rawv6_seticmpfilter_12137 rawv6_seticmpfilter 5 12137 NULL ++vmw_fifo_reserve_12141 vmw_fifo_reserve 2 12141 NULL ++get_idx_gc_leb_12148 get_idx_gc_leb 0 12148 NULL ++btmrvl_sdio_host_to_card_12152 btmrvl_sdio_host_to_card 3 12152 NULL ++vmbus_open_12154 vmbus_open 2-3 12154 NULL ++wil_rxdesc_phy_length_12165 wil_rxdesc_phy_length 0 12165 NULL ++dma_memcpy_to_iovec_12173 dma_memcpy_to_iovec 5 12173 NULL ++ddp_make_gl_12179 ddp_make_gl 1 12179 NULL ++compat_do_arpt_set_ctl_12184 compat_do_arpt_set_ctl 4 12184 NULL ++ip_generic_getfrag_12187 ip_generic_getfrag 3-4 12187 NULL ++bl_is_sector_init_12199 bl_is_sector_init 2 12199 NULL ++receive_copy_12216 receive_copy 3 12216 NULL ++snd_pcm_kernel_ioctl_12219 snd_pcm_kernel_ioctl 0 12219 NULL ++aat2870_reg_read_file_12221 aat2870_reg_read_file 3 12221 NULL ++ib_uverbs_unmarshall_recv_12251 ib_uverbs_unmarshall_recv 5 12251 NULL ++ath_descdma_setup_12257 ath_descdma_setup 5 12257 NULL ++shash_compat_setkey_12267 shash_compat_setkey 3 12267 NULL ++add_sctp_bind_addr_12269 add_sctp_bind_addr 3 12269 NULL ++note_last_dentry_12285 note_last_dentry 3 12285 NULL ++roundup_to_multiple_of_64_12288 roundup_to_multiple_of_64 0-1 12288 NULL nohasharray ++il_dbgfs_nvm_read_12288 il_dbgfs_nvm_read 3 12288 &roundup_to_multiple_of_64_12288 ++vxge_get_num_vfs_12302 vxge_get_num_vfs 0 12302 NULL ++split_bvec_12312 split_bvec 6 12312 NULL ++tipc_msg_build_12326 tipc_msg_build 4 12326 NULL ++pcbit_writecmd_12332 pcbit_writecmd 2 12332 NULL ++mptctl_ioctl_12355 mptctl_ioctl 2 12355 NULL ++__nf_ct_ext_add_length_12364 __nf_ct_ext_add_length 3 12364 NULL ++receive_packet_12367 receive_packet 2 12367 NULL ++xfs_iext_inline_to_direct_12384 xfs_iext_inline_to_direct 2 12384 NULL ++btrfs_file_extent_ram_bytes_12391 btrfs_file_extent_ram_bytes 0 12391 NULL ++ntfs_get_size_for_mapping_pairs_12413 ntfs_get_size_for_mapping_pairs 0 12413 NULL ++ieee80211_if_read_num_mcast_sta_12419 ieee80211_if_read_num_mcast_sta 3 12419 NULL ++skb_do_copy_data_nocache_12465 skb_do_copy_data_nocache 5 12465 NULL ++qla4_82xx_pci_mem_write_direct_12479 qla4_82xx_pci_mem_write_direct 2 12479 NULL ++x25_sendmsg_12487 x25_sendmsg 4 12487 NULL ++rtllib_auth_challenge_12493 rtllib_auth_challenge 3 12493 NULL ++nfs_readdir_make_qstr_12509 nfs_readdir_make_qstr 3 12509 NULL ++qib_alloc_fast_reg_mr_12526 qib_alloc_fast_reg_mr 2 12526 NULL ++arizona_gpio_direction_out_12564 arizona_gpio_direction_out 2 12564 NULL ++hvc_alloc_12579 hvc_alloc 4 12579 NULL ++snd_pcm_plugin_alloc_12580 snd_pcm_plugin_alloc 2 12580 NULL ++macvtap_compat_ioctl_12587 macvtap_compat_ioctl 3 12587 NULL ++pcpu_extend_area_map_12589 pcpu_extend_area_map 2 12589 NULL ++ipv6_get_l4proto_12600 ipv6_get_l4proto 2 12600 NULL ++vhci_put_user_12604 vhci_put_user 4 12604 NULL ++fc_fcp_frame_alloc_12624 fc_fcp_frame_alloc 2 12624 NULL ++pwr_rcvd_awake_bcns_cnt_read_12632 pwr_rcvd_awake_bcns_cnt_read 3 12632 NULL ++ctrl_cdev_compat_ioctl_12634 ctrl_cdev_compat_ioctl 3 12634 NULL ++pn_sendmsg_12640 pn_sendmsg 4 12640 NULL ++dwc3_link_state_write_12641 dwc3_link_state_write 3 12641 NULL ++ocfs2_read_block_12659 ocfs2_read_block 0 12659 NULL ++sel_read_class_12669 sel_read_class 3 12669 NULL nohasharray ++sparse_mem_maps_populate_node_12669 sparse_mem_maps_populate_node 4 12669 &sel_read_class_12669 ++ieee80211_if_read_num_buffered_multicast_12716 ieee80211_if_read_num_buffered_multicast 3 12716 NULL ++ivtv_write_12721 ivtv_write 3 12721 NULL ++key_rx_spec_read_12736 key_rx_spec_read 3 12736 NULL ++__videobuf_alloc_cached_12740 __videobuf_alloc_cached 1 12740 NULL ++ieee80211_if_read_dot11MeshMaxRetries_12756 ieee80211_if_read_dot11MeshMaxRetries 3 12756 NULL ++listxattr_12769 listxattr 3 12769 NULL ++sctp_ssnmap_init_12772 sctp_ssnmap_init 2-3 12772 NULL ++platform_create_bundle_12785 platform_create_bundle 4-6 12785 NULL ++scsi_adjust_queue_depth_12802 scsi_adjust_queue_depth 3 12802 NULL ++xfs_inumbers_fmt_12817 xfs_inumbers_fmt 3 12817 NULL ++readq_12825 readq 0 12825 NULL ++TSS_authhmac_12839 TSS_authhmac 3 12839 NULL ++ath6kl_wmi_add_wow_pattern_cmd_12842 ath6kl_wmi_add_wow_pattern_cmd 4 12842 NULL nohasharray ++spidev_sync_12842 spidev_sync 0 12842 &ath6kl_wmi_add_wow_pattern_cmd_12842 ++spidev_ioctl_12846 spidev_ioctl 2 12846 NULL ++get_leb_cnt_12892 get_leb_cnt 0-2 12892 NULL ++ocfs2_hamming_encode_block_12904 ocfs2_hamming_encode_block 2 12904 NULL ++get_virtual_node_size_12908 get_virtual_node_size 0 12908 NULL ++rds_pages_in_vec_12922 rds_pages_in_vec 0 12922 NULL ++ci_ll_init_12930 ci_ll_init 3 12930 NULL ++tps65910_reg_update_bits_12934 tps65910_reg_update_bits 2 12934 NULL ++do_inode_permission_12946 do_inode_permission 0 12946 NULL ++bm_status_write_12964 bm_status_write 3 12964 NULL ++_drbd_md_first_sector_12984 _drbd_md_first_sector 0 12984 NULL ++acpi_tb_install_table_12988 acpi_tb_install_table 1 12988 NULL ++TransmitTcb_12989 TransmitTcb 4 12989 NULL ++sk_peek_offset_12991 sk_peek_offset 0 12991 NULL ++subsystem_filter_write_13022 subsystem_filter_write 3 13022 NULL ++generic_segment_checks_13041 generic_segment_checks 0 13041 NULL ++ocfs2_write_begin_13045 ocfs2_write_begin 3-4 13045 NULL ++__dn_setsockopt_13060 __dn_setsockopt 5 13060 NULL ++irq_set_chip_and_handler_13088 irq_set_chip_and_handler 1 13088 NULL ++tps6586x_set_bits_13089 tps6586x_set_bits 2 13089 NULL ++xattr_getsecurity_13090 xattr_getsecurity 0 13090 NULL ++blk_rq_map_sg_13092 blk_rq_map_sg 0 13092 NULL ++mb_find_next_zero_bit_13100 mb_find_next_zero_bit 2-3 13100 NULL ++ubifs_compat_ioctl_13108 ubifs_compat_ioctl 3 13108 NULL ++snd_rme96_playback_copy_13111 snd_rme96_playback_copy 5 13111 NULL ++xen_allocate_irq_dynamic_13116 xen_allocate_irq_dynamic 0 13116 NULL ++bfad_debugfs_read_13119 bfad_debugfs_read 3 13119 NULL ++blk_update_request_13146 blk_update_request 3 13146 NULL ++caif_stream_recvmsg_13173 caif_stream_recvmsg 4 13173 NULL ++pwr_disable_ps_read_13176 pwr_disable_ps_read 3 13176 NULL ++dgrp_net_ioctl_13183 dgrp_net_ioctl 2 13183 NULL ++create_trace_uprobe_13184 create_trace_uprobe 1 13184 NULL ++compat_put_ulong_13186 compat_put_ulong 1 13186 NULL ++comedi_read_13199 comedi_read 3 13199 NULL ++mmc_ext_csd_read_13205 mmc_ext_csd_read 3 13205 NULL ++__nodes_fold_13215 __nodes_fold 4 13215 NULL ++get_unaligned_le64_13219 get_unaligned_le64 0 13219 NULL ++svm_msrpm_offset_13220 svm_msrpm_offset 0-1 13220 NULL ++asix_read_cmd_13245 asix_read_cmd 5 13245 NULL ++fw_download_code_13249 fw_download_code 3 13249 NULL ++init_tid_tabs_13252 init_tid_tabs 2-3-4 13252 NULL ++hostap_80211_get_hdrlen_13255 hostap_80211_get_hdrlen 0 13255 NULL ++bio_integrity_trim_13259 bio_integrity_trim 3 13259 NULL ++carl9170_rx_13272 carl9170_rx 3 13272 NULL ++pmcraid_notify_aen_13274 pmcraid_notify_aen 3 13274 NULL ++il4965_stats_flag_13281 il4965_stats_flag 0-3 13281 NULL ++lpfc_idiag_mbxacc_get_setup_13282 lpfc_idiag_mbxacc_get_setup 0 13282 NULL ++platform_device_add_resources_13289 platform_device_add_resources 3 13289 NULL ++us122l_ctl_msg_13330 us122l_ctl_msg 8 13330 NULL ++kvm_read_nested_guest_page_13337 kvm_read_nested_guest_page 5 13337 NULL ++mthca_alloc_mtt_range_13371 mthca_alloc_mtt_range 2 13371 NULL ++iso_sched_alloc_13377 iso_sched_alloc 1 13377 NULL nohasharray ++wep_key_not_found_read_13377 wep_key_not_found_read 3 13377 &iso_sched_alloc_13377 ++carl9170_rx_untie_data_13405 carl9170_rx_untie_data 3 13405 NULL ++sky2_receive_13407 sky2_receive 2 13407 NULL ++netxen_alloc_sds_rings_13417 netxen_alloc_sds_rings 2 13417 NULL ++keyring_read_13438 keyring_read 3 13438 NULL ++sctp_setsockopt_peer_primary_addr_13440 sctp_setsockopt_peer_primary_addr 3 13440 NULL nohasharray ++set_tap_pwup_pfs_13440 set_tap_pwup_pfs 3 13440 &sctp_setsockopt_peer_primary_addr_13440 ++ath6kl_cfg80211_connect_event_13443 ath6kl_cfg80211_connect_event 7-8-9 13443 NULL ++mthca_buddy_alloc_13454 mthca_buddy_alloc 2 13454 NULL ++ocfs2_align_bytes_to_blocks_13512 ocfs2_align_bytes_to_blocks 2 13512 NULL ++core_status_13515 core_status 4 13515 NULL ++smk_write_mapped_13519 smk_write_mapped 3 13519 NULL ++bm_init_13529 bm_init 2 13529 NULL ++llcp_sock_recvmsg_13556 llcp_sock_recvmsg 4 13556 NULL ++ieee80211_if_read_ap_power_level_13558 ieee80211_if_read_ap_power_level 3 13558 NULL ++alloc_tio_13564 alloc_tio 3 13564 NULL ++ubifs_get_idx_gc_leb_13566 ubifs_get_idx_gc_leb 0 13566 NULL ++read_file_antenna_13574 read_file_antenna 3 13574 NULL ++pm860x_set_bits_13582 pm860x_set_bits 2 13582 NULL ++cache_write_13589 cache_write 3 13589 NULL ++mpt_lan_receive_post_turbo_13592 mpt_lan_receive_post_turbo 2 13592 NULL ++aac_sa_ioremap_13596 aac_sa_ioremap 2 13596 NULL nohasharray ++irias_new_octseq_value_13596 irias_new_octseq_value 2 13596 &aac_sa_ioremap_13596 ++usb_dump_interface_descriptor_13603 usb_dump_interface_descriptor 0 13603 NULL ++swap_cgroup_swapon_13614 swap_cgroup_swapon 2 13614 NULL ++wm8994_bulk_write_13615 wm8994_bulk_write 3-2 13615 NULL ++pmcraid_get_minor_13619 pmcraid_get_minor 0 13619 NULL ++iio_device_add_event_sysfs_13627 iio_device_add_event_sysfs 0 13627 NULL ++packet_snd_13634 packet_snd 3 13634 NULL ++blk_msg_write_13655 blk_msg_write 3 13655 NULL ++cache_downcall_13666 cache_downcall 3 13666 NULL ++fw_iso_buffer_alloc_13704 fw_iso_buffer_alloc 2 13704 NULL ++audit_unpack_string_13748 audit_unpack_string 3 13748 NULL ++ufs_dtog_13750 ufs_dtog 0-2 13750 NULL ++ieee802154_alloc_device_13767 ieee802154_alloc_device 1 13767 NULL ++fb_sys_read_13778 fb_sys_read 3 13778 NULL ++ath6kl_mgmt_powersave_ap_13791 ath6kl_mgmt_powersave_ap 6 13791 NULL ++random_read_13815 random_read 3 13815 NULL ++hsi_register_board_info_13820 hsi_register_board_info 2 13820 NULL ++evdev_ioctl_compat_13851 evdev_ioctl_compat 2-3 13851 NULL ++compat_ip_setsockopt_13870 compat_ip_setsockopt 5 13870 NULL nohasharray ++alloc_trace_uprobe_13870 alloc_trace_uprobe 3 13870 &compat_ip_setsockopt_13870 ++snd_pcm_aio_read_13900 snd_pcm_aio_read 3 13900 NULL ++ext3_xattr_block_get_13936 ext3_xattr_block_get 0 13936 NULL ++ieee80211_if_read_dot11MeshForwarding_13940 ieee80211_if_read_dot11MeshForwarding 3 13940 NULL nohasharray ++ocfs2_xa_value_truncate_13940 ocfs2_xa_value_truncate 2 13940 &ieee80211_if_read_dot11MeshForwarding_13940 ++iwl_dbgfs_protection_mode_read_13943 iwl_dbgfs_protection_mode_read 3 13943 NULL ++compat_chaninfo_13945 compat_chaninfo 2 13945 NULL ++ieee80211_if_read_min_discovery_timeout_13946 ieee80211_if_read_min_discovery_timeout 3 13946 NULL ++lpfc_idiag_queacc_read_13950 lpfc_idiag_queacc_read 3 13950 NULL ++snd_pcm_plug_slave_size_13967 snd_pcm_plug_slave_size 0-2 13967 NULL ++com90xx_found_13974 com90xx_found 3 13974 NULL ++qcam_read_13977 qcam_read 3 13977 NULL ++dsp_read_13980 dsp_read 2 13980 NULL ++bm_block_bits_13981 bm_block_bits 0 13981 NULL nohasharray ++dvb_demux_read_13981 dvb_demux_read 3 13981 &bm_block_bits_13981 ++ieee80211_bss_info_update_13991 ieee80211_bss_info_update 4 13991 NULL ++btrfs_get_blocks_direct_14016 btrfs_get_blocks_direct 2 14016 NULL ++_rtl92s_firmware_downloadcode_14021 _rtl92s_firmware_downloadcode 3 14021 NULL ++dvb_usercopy_14036 dvb_usercopy 2 14036 NULL ++read_def_modal_eeprom_14041 read_def_modal_eeprom 3 14041 NULL ++ieee80211_if_fmt_aid_14055 ieee80211_if_fmt_aid 3 14055 NULL ++sta_agg_status_read_14058 sta_agg_status_read 3 14058 NULL ++do_proc_readlink_14096 do_proc_readlink 3 14096 NULL ++compat_sys_pselect6_14105 compat_sys_pselect6 1 14105 NULL ++nlmsg_len_14115 nlmsg_len 0 14115 NULL ++vfio_fops_compat_ioctl_14130 vfio_fops_compat_ioctl 3 14130 NULL ++ntfs_rl_replace_14136 ntfs_rl_replace 2-4 14136 NULL ++em_canid_change_14150 em_canid_change 3 14150 NULL ++gsm_dlci_data_14155 gsm_dlci_data 3 14155 NULL ++print_input_mask_14168 print_input_mask 3-0 14168 NULL ++ocfs2_xattr_value_truncate_14183 ocfs2_xattr_value_truncate 3 14183 NULL ++alloc_async_14208 alloc_async 1 14208 NULL ++sys_kexec_load_14222 sys_kexec_load 2 14222 NULL ++pool_status_14230 pool_status 5 14230 NULL ++ieee80211_if_write_uapsd_max_sp_len_14233 ieee80211_if_write_uapsd_max_sp_len 3 14233 NULL ++inode_to_path_14235 inode_to_path 2 14235 NULL ++dma_declare_coherent_memory_14244 dma_declare_coherent_memory 4-2 14244 NULL ++snd_soc_hw_bulk_write_raw_14245 snd_soc_hw_bulk_write_raw 4-2 14245 NULL ++reiserfs_compat_ioctl_14265 reiserfs_compat_ioctl 3 14265 NULL ++ath6kl_connect_event_14267 ath6kl_connect_event 7-8-9 14267 NULL ++add_numbered_child_14273 add_numbered_child 5 14273 NULL ++OS_mem_token_alloc_14276 OS_mem_token_alloc 1 14276 NULL ++snd_seq_oss_readq_new_14283 snd_seq_oss_readq_new 2 14283 NULL ++rr_status_14293 rr_status 5 14293 NULL ++lp8788_write_byte_14299 lp8788_write_byte 2 14299 NULL ++read_default_ldt_14302 read_default_ldt 2 14302 NULL ++oo_objects_14319 oo_objects 0 14319 NULL ++p9_client_zc_rpc_14345 p9_client_zc_rpc 7 14345 NULL ++snd_pcm_lib_readv_14363 snd_pcm_lib_readv 0-3 14363 NULL ++acpi_get_override_irq_14381 acpi_get_override_irq 1 14381 NULL ++ath6kl_regdump_read_14393 ath6kl_regdump_read 3 14393 NULL ++smk_write_onlycap_14400 smk_write_onlycap 3 14400 NULL ++mtd_concat_create_14416 mtd_concat_create 2 14416 NULL ++get_kcore_size_14425 get_kcore_size 0 14425 NULL ++check_lpt_crc_14442 check_lpt_crc 0 14442 NULL ++block_size_14443 block_size 0 14443 NULL ++ci13xxx_add_device_14456 ci13xxx_add_device 3 14456 NULL ++snd_emu10k1_proc_spdif_status_14457 snd_emu10k1_proc_spdif_status 4-5 14457 NULL ++udplite_getfrag_14479 udplite_getfrag 3-4 14479 NULL ++ieee80211_if_read_dot11MeshGateAnnouncementProtocol_14486 ieee80211_if_read_dot11MeshGateAnnouncementProtocol 3 14486 NULL ++stripe_status_14506 stripe_status 5 14506 NULL ++ocfs2_debug_read_14507 ocfs2_debug_read 3 14507 NULL ++dataflash_read_user_otp_14536 dataflash_read_user_otp 2-3 14536 NULL nohasharray ++ep0_write_14536 ep0_write 3 14536 &dataflash_read_user_otp_14536 ++picolcd_debug_eeprom_read_14549 picolcd_debug_eeprom_read 3 14549 NULL ++drm_vmalloc_dma_14550 drm_vmalloc_dma 1 14550 NULL ++usb_dump_desc_14553 usb_dump_desc 0 14553 NULL ++idmap_pipe_downcall_14591 idmap_pipe_downcall 3 14591 NULL ++ocfs2_trim_group_14641 ocfs2_trim_group 4-3 14641 NULL ++dbJoin_14644 dbJoin 0 14644 NULL ++profile_replace_14652 profile_replace 3 14652 NULL ++pipeline_enc_tx_stat_fifo_int_read_14680 pipeline_enc_tx_stat_fifo_int_read 3 14680 NULL ++ieee80211_if_fmt_rc_rateidx_mask_2ghz_14683 ieee80211_if_fmt_rc_rateidx_mask_2ghz 3 14683 NULL ++tsi148_master_set_14685 tsi148_master_set 4 14685 NULL ++u_audio_playback_14709 u_audio_playback 3 14709 NULL ++vfd_write_14717 vfd_write 3 14717 NULL ++__blk_end_request_14729 __blk_end_request 3 14729 NULL ++raid1_resize_14740 raid1_resize 2 14740 NULL ++btrfs_inode_extref_name_len_14752 btrfs_inode_extref_name_len 0 14752 NULL ++rx_rx_cmplt_read_14753 rx_rx_cmplt_read 3 14753 NULL ++qla82xx_pci_mem_write_2M_14765 qla82xx_pci_mem_write_2M 2 14765 NULL ++regmap_range_read_file_14775 regmap_range_read_file 3 14775 NULL ++lm3533_als_get_hysteresis_14776 lm3533_als_get_hysteresis 2 14776 NULL ++sta_dev_read_14782 sta_dev_read 3 14782 NULL ++ext4_kvmalloc_14796 ext4_kvmalloc 1 14796 NULL ++hpet_readl_14801 hpet_readl 0 14801 NULL nohasharray ++snd_als300_gcr_read_14801 snd_als300_gcr_read 0 14801 &hpet_readl_14801 ++bcma_scan_read32_14802 bcma_scan_read32 0 14802 NULL ++do_tune_cpucache_14828 do_tune_cpucache 2 14828 NULL ++__mutex_fastpath_lock_retval_14844 __mutex_fastpath_lock_retval 0 14844 NULL ++lcd_write_14857 lcd_write 3 14857 NULL nohasharray ++__krealloc_14857 __krealloc 2 14857 &lcd_write_14857 ++get_user_cpu_mask_14861 get_user_cpu_mask 2 14861 NULL ++sriov_enable_migration_14889 sriov_enable_migration 2 14889 NULL ++acpi_os_allocate_14892 acpi_os_allocate 1 14892 NULL ++unifi_read_14899 unifi_read 3 14899 NULL ++krealloc_14908 krealloc 2 14908 NULL ++regmap_irq_get_virq_14910 regmap_irq_get_virq 2 14910 NULL ++__arch_hweight64_14923 __arch_hweight64 0 14923 NULL ++ocfs2_expand_nonsparse_inode_14936 ocfs2_expand_nonsparse_inode 3-4 14936 NULL ++queue_cnt_14951 queue_cnt 0 14951 NULL ++videobuf_read_stream_14956 videobuf_read_stream 3 14956 NULL ++mce_flush_rx_buffer_14976 mce_flush_rx_buffer 2 14976 NULL ++setkey_14987 setkey 3 14987 NULL nohasharray ++gpio_twl4030_write_14987 gpio_twl4030_write 1 14987 &setkey_14987 ++vmap_15025 vmap 2 15025 NULL ++blk_integrity_tuple_size_15027 blk_integrity_tuple_size 0 15027 NULL ++irq_get_next_irq_15053 irq_get_next_irq 1 15053 NULL ++cld_pipe_downcall_15058 cld_pipe_downcall 3 15058 NULL ++ieee80211_if_read_uapsd_max_sp_len_15067 ieee80211_if_read_uapsd_max_sp_len 3 15067 NULL ++nfs4_write_cached_acl_15070 nfs4_write_cached_acl 4 15070 NULL ++ntfs_copy_from_user_15072 ntfs_copy_from_user 3-5 15072 NULL ++__alloc_extent_buffer_15093 __alloc_extent_buffer 3 15093 NULL ++hex_dump_to_buffer_15121 hex_dump_to_buffer 6 15121 NULL ++start_port_15124 start_port 0 15124 NULL ++memchr_15126 memchr 0 15126 NULL ++ipwireless_ppp_mru_15153 ipwireless_ppp_mru 0 15153 NULL ++self_check_not_bad_15175 self_check_not_bad 0 15175 NULL ++iscsi_create_endpoint_15193 iscsi_create_endpoint 1 15193 NULL ++reserve_resources_15194 reserve_resources 3 15194 NULL ++bfad_debugfs_write_regrd_15218 bfad_debugfs_write_regrd 3 15218 NULL ++variax_alloc_sysex_buffer_15237 variax_alloc_sysex_buffer 3 15237 NULL ++il_dbgfs_rx_stats_read_15243 il_dbgfs_rx_stats_read 3 15243 NULL ++compat_raw_ioctl_15290 compat_raw_ioctl 3 15290 NULL ++sys_connect_15291 sys_connect 3 15291 NULL nohasharray ++xlate_dev_mem_ptr_15291 xlate_dev_mem_ptr 1 15291 &sys_connect_15291 ++arch_enable_uv_irq_15294 arch_enable_uv_irq 2 15294 NULL ++acpi_ev_create_gpe_block_15297 acpi_ev_create_gpe_block 5 15297 NULL ++tpm_tis_init_15304 tpm_tis_init 2-3 15304 NULL ++fcoe_ctlr_send_keep_alive_15308 fcoe_ctlr_send_keep_alive 3 15308 NULL ++__ocfs2_remove_xattr_range_15330 __ocfs2_remove_xattr_range 4-5-3 15330 NULL ++kovaplus_sysfs_read_15337 kovaplus_sysfs_read 6 15337 NULL ++ioread16_15342 ioread16 0 15342 NULL ++alloc_ring_15345 alloc_ring 2-4 15345 NULL ++acpi_ut_create_string_object_15360 acpi_ut_create_string_object 1 15360 NULL ++compat_sys_process_vm_readv_15374 compat_sys_process_vm_readv 3-5 15374 NULL ++fq_codel_zalloc_15378 fq_codel_zalloc 1 15378 NULL ++domain_flush_pages_15379 domain_flush_pages 2-3 15379 NULL ++alloc_fddidev_15382 alloc_fddidev 1 15382 NULL ++btrfs_level_size_15392 btrfs_level_size 0 15392 NULL ++pipeline_csum_to_rx_xfer_swi_read_15403 pipeline_csum_to_rx_xfer_swi_read 3 15403 NULL ++get_modalias_15406 get_modalias 2 15406 NULL ++__videobuf_copy_to_user_15423 __videobuf_copy_to_user 4 15423 NULL ++tcp_mtu_to_mss_15438 tcp_mtu_to_mss 0-2 15438 NULL ++hpsa_change_queue_depth_15449 hpsa_change_queue_depth 2 15449 NULL ++memweight_15450 memweight 2 15450 NULL ++vmalloc_15464 vmalloc 1 15464 NULL ++insert_old_idx_znode_15500 insert_old_idx_znode 0 15500 NULL ++zd_chip_is_zd1211b_15518 zd_chip_is_zd1211b 0 15518 NULL ++da9052_bat_irq_15533 da9052_bat_irq 1 15533 NULL ++p9_check_zc_errors_15534 p9_check_zc_errors 4 15534 NULL ++ql_process_mac_rx_page_15543 ql_process_mac_rx_page 4 15543 NULL ++ieee80211_amsdu_to_8023s_15561 ieee80211_amsdu_to_8023s 5 15561 NULL ++snd_pcm_channel_info_15572 snd_pcm_channel_info 0 15572 NULL ++persistent_status_15574 persistent_status 4 15574 NULL ++bnx2fc_process_unsol_compl_15576 bnx2fc_process_unsol_compl 2 15576 NULL ++vme_user_write_15587 vme_user_write 3 15587 NULL ++ocfs2_truncate_rec_15595 ocfs2_truncate_rec 7 15595 NULL ++sx150x_install_irq_chip_15609 sx150x_install_irq_chip 3 15609 NULL ++iommu_device_max_index_15620 iommu_device_max_index 0-3-2-1 15620 NULL nohasharray ++compat_fillonedir_15620 compat_fillonedir 3 15620 &iommu_device_max_index_15620 ++set_dis_tap_pfs_15621 set_dis_tap_pfs 3 15621 NULL ++proc_loginuid_read_15631 proc_loginuid_read 3 15631 NULL ++tomoyo_scan_bprm_15642 tomoyo_scan_bprm 2-4 15642 NULL nohasharray ++sk_memory_allocated_add_15642 sk_memory_allocated_add 2 15642 &tomoyo_scan_bprm_15642 nohasharray ++pipeline_hs_tx_stat_fifo_int_read_15642 pipeline_hs_tx_stat_fifo_int_read 3 15642 &sk_memory_allocated_add_15642 ++fs_path_add_15648 fs_path_add 3 15648 NULL ++xsd_read_15653 xsd_read 3 15653 NULL ++compat_sys_fcntl_15654 compat_sys_fcntl 3 15654 NULL ++unix_bind_15668 unix_bind 3 15668 NULL ++dm_read_15674 dm_read 3 15674 NULL ++pstore_mkfile_15675 pstore_mkfile 6 15675 NULL ++uf_sme_queue_message_15697 uf_sme_queue_message 3 15697 NULL ++ocfs2_split_tree_15716 ocfs2_split_tree 5 15716 NULL ++HiSax_readstatus_15752 HiSax_readstatus 2 15752 NULL ++bitmap_search_next_usable_block_15762 bitmap_search_next_usable_block 3-1 15762 NULL ++do_test_15766 do_test 1 15766 NULL ++set_std_nic_pfs_15792 set_std_nic_pfs 3 15792 NULL ++smk_read_direct_15803 smk_read_direct 3 15803 NULL ++snd_pcm_ioctl_compat_15804 snd_pcm_ioctl_compat 3 15804 NULL ++gx1_read_conf_reg_15817 gx1_read_conf_reg 0 15817 NULL nohasharray ++nameseq_list_15817 nameseq_list 3 15817 &gx1_read_conf_reg_15817 nohasharray ++gnttab_expand_15817 gnttab_expand 1 15817 &nameseq_list_15817 ++afs_proc_rootcell_write_15822 afs_proc_rootcell_write 3 15822 NULL ++brcmf_sdbrcm_died_dump_15841 brcmf_sdbrcm_died_dump 3 15841 NULL ++table_size_15851 table_size 0-1-2 15851 NULL ++ubi_io_write_15870 ubi_io_write 5-4 15870 NULL nohasharray ++media_entity_init_15870 media_entity_init 2-4 15870 &ubi_io_write_15870 ++__mptctl_ioctl_15875 __mptctl_ioctl 2 15875 NULL ++ERR_PTR_15881 ERR_PTR 0 15881 NULL ++nfs_map_group_to_gid_15892 nfs_map_group_to_gid 3 15892 NULL ++native_read_msr_15905 native_read_msr 0 15905 NULL ++wm5100_gpio_direction_in_15934 wm5100_gpio_direction_in 2 15934 NULL ++parse_audio_stream_data_15937 parse_audio_stream_data 3 15937 NULL ++power_read_15939 power_read 3 15939 NULL ++lpfc_idiag_drbacc_read_15948 lpfc_idiag_drbacc_read 3 15948 NULL ++snd_pcm_lib_read_transfer_15952 snd_pcm_lib_read_transfer 4-2-5 15952 NULL ++remap_pci_mem_15966 remap_pci_mem 1-2 15966 NULL ++set_spte_15977 set_spte 7-6 15977 NULL ++frame_alloc_15981 frame_alloc 4 15981 NULL ++alloc_vm_area_15989 alloc_vm_area 1 15989 NULL ++hdpvr_register_videodev_16010 hdpvr_register_videodev 3 16010 NULL ++viafb_vt1636_proc_write_16018 viafb_vt1636_proc_write 3 16018 NULL ++got_frame_16028 got_frame 2 16028 NULL ++isr_tx_exch_complete_read_16103 isr_tx_exch_complete_read 3 16103 NULL ++dma_tx_requested_read_16110 dma_tx_requested_read 3 16110 NULL nohasharray ++isr_hw_pm_mode_changes_read_16110 isr_hw_pm_mode_changes_read 3 16110 &dma_tx_requested_read_16110 ++irq_set_chip_and_handler_name_16111 irq_set_chip_and_handler_name 1 16111 NULL ++snd_dma_pointer_16126 snd_dma_pointer 0-2 16126 NULL ++compat_sys_select_16131 compat_sys_select 1 16131 NULL ++fsm_init_16134 fsm_init 2 16134 NULL ++hysdn_rx_netpkt_16136 hysdn_rx_netpkt 3 16136 NULL ++ext4_xattr_block_get_16148 ext4_xattr_block_get 0 16148 NULL ++bnx2i_get_cid_num_16166 bnx2i_get_cid_num 0 16166 NULL ++mapping_level_16188 mapping_level 2 16188 NULL ++cipso_v4_map_cat_rng_hton_16203 cipso_v4_map_cat_rng_hton 0 16203 NULL ++create_table_16213 create_table 2 16213 NULL ++atomic_read_file_16227 atomic_read_file 3 16227 NULL ++BcmGetSectionValStartOffset_16235 BcmGetSectionValStartOffset 0 16235 NULL ++btrfs_dev_extent_chunk_offset_16247 btrfs_dev_extent_chunk_offset 0 16247 NULL ++mark_written_sectors_16262 mark_written_sectors 2 16262 NULL ++reiserfs_acl_count_16265 reiserfs_acl_count 0-1 16265 NULL ++set_disc_pfs_16270 set_disc_pfs 3 16270 NULL ++ocfs2_xattr_bucket_value_truncate_16279 ocfs2_xattr_bucket_value_truncate 4 16279 NULL ++drbd_setsockopt_16280 drbd_setsockopt 5 16280 NULL nohasharray ++nand_bch_init_16280 nand_bch_init 3-2 16280 &drbd_setsockopt_16280 ++account_16283 account 0-2-4 16283 NULL nohasharray ++mirror_status_16283 mirror_status 5 16283 &account_16283 ++stk_allocate_buffers_16291 stk_allocate_buffers 2 16291 NULL ++rbd_segment_offset_16293 rbd_segment_offset 0-2 16293 NULL ++rsc_mgr_init_16299 rsc_mgr_init 3 16299 NULL ++vmw_cursor_update_image_16332 vmw_cursor_update_image 3-4 16332 NULL ++tps80031_update_16360 tps80031_update 3 16360 NULL ++total_ps_buffered_read_16365 total_ps_buffered_read 3 16365 NULL ++rbd_add_16366 rbd_add 3 16366 NULL ++iscsi_tcp_conn_setup_16376 iscsi_tcp_conn_setup 2 16376 NULL ++nl80211_send_unprot_deauth_16378 nl80211_send_unprot_deauth 4 16378 NULL ++diva_os_malloc_16406 diva_os_malloc 2 16406 NULL ++ieee80211_if_read_tsf_16420 ieee80211_if_read_tsf 3 16420 NULL ++rxrpc_server_keyring_16431 rxrpc_server_keyring 3 16431 NULL ++netlink_change_ngroups_16457 netlink_change_ngroups 2 16457 NULL ++tracing_readme_read_16493 tracing_readme_read 3 16493 NULL ++snd_interval_max_16529 snd_interval_max 0 16529 NULL ++raid10_resize_16537 raid10_resize 2 16537 NULL ++tcp_manip_pkt_16563 tcp_manip_pkt 4 16563 NULL ++lpfc_debugfs_read_16566 lpfc_debugfs_read 3 16566 NULL ++agp_allocate_memory_wrap_16576 agp_allocate_memory_wrap 1 16576 NULL ++btrfs_get_token_32_16651 btrfs_get_token_32 0 16651 NULL ++mfd_add_devices_16668 mfd_add_devices 4 16668 NULL ++da9052_reg_write_16685 da9052_reg_write 2 16685 NULL ++em28xx_v4l2_read_16701 em28xx_v4l2_read 3 16701 NULL ++arcmsr_adjust_disk_queue_depth_16756 arcmsr_adjust_disk_queue_depth 2 16756 NULL ++compat_blkdev_driver_ioctl_16769 compat_blkdev_driver_ioctl 4 16769 NULL ++blk_rq_map_user_iov_16772 blk_rq_map_user_iov 5 16772 NULL ++i2o_parm_issue_16790 i2o_parm_issue 0 16790 NULL ++get_server_iovec_16804 get_server_iovec 2 16804 NULL ++tipc_send2name_16809 tipc_send2name 6 16809 NULL ++dm_vcalloc_16814 dm_vcalloc 1-2 16814 NULL ++drm_malloc_ab_16831 drm_malloc_ab 1-2 16831 NULL ++scsi_mode_sense_16835 scsi_mode_sense 5 16835 NULL ++hfsplus_min_io_size_16859 hfsplus_min_io_size 0 16859 NULL ++alloc_idx_lebs_16872 alloc_idx_lebs 2 16872 NULL ++carl9170_debugfs_ampdu_state_read_16873 carl9170_debugfs_ampdu_state_read 3 16873 NULL ++st_write_16874 st_write 3 16874 NULL ++__kfifo_peek_n_16877 __kfifo_peek_n 0 16877 NULL ++wm8350_set_bits_16911 wm8350_set_bits 2 16911 NULL ++psb_unlocked_ioctl_16926 psb_unlocked_ioctl 2 16926 NULL nohasharray ++snd_gf1_mem_proc_dump_16926 snd_gf1_mem_proc_dump 5 16926 &psb_unlocked_ioctl_16926 ++random32_16937 random32 0 16937 NULL ++_sp2d_alloc_16944 _sp2d_alloc 1-2-3 16944 NULL ++squashfs_read_table_16945 squashfs_read_table 3 16945 NULL ++cfg80211_send_unprot_disassoc_16951 cfg80211_send_unprot_disassoc 3 16951 NULL ++keyctl_instantiate_key_iov_16969 keyctl_instantiate_key_iov 3 16969 NULL ++ceph_read_dir_17005 ceph_read_dir 3 17005 NULL ++copy_counters_to_user_17027 copy_counters_to_user 5 17027 NULL ++jffs2_trusted_setxattr_17048 jffs2_trusted_setxattr 4 17048 NULL ++__arch_hweight32_17060 __arch_hweight32 0 17060 NULL ++dvb_dvr_read_17073 dvb_dvr_read 3 17073 NULL ++simple_transaction_read_17076 simple_transaction_read 3 17076 NULL ++__kmalloc_reserve_17080 __kmalloc_reserve 1 17080 NULL ++carl9170_debugfs_mem_usage_read_17084 carl9170_debugfs_mem_usage_read 3 17084 NULL ++mac_address_string_17091 mac_address_string 0 17091 NULL ++entry_length_17093 entry_length 0 17093 NULL ++sys_preadv_17100 sys_preadv 3 17100 NULL ++pvr2_hdw_state_report_17121 pvr2_hdw_state_report 3 17121 NULL ++mwifiex_get_common_rates_17131 mwifiex_get_common_rates 3 17131 NULL ++nouveau_instobj_create__17144 nouveau_instobj_create_ 4 17144 NULL ++sep_read_17161 sep_read 3 17161 NULL ++befs_nls2utf_17163 befs_nls2utf 3 17163 NULL ++tx_tx_start_templates_read_17164 tx_tx_start_templates_read 3 17164 NULL ++UniStrnlen_17169 UniStrnlen 0 17169 NULL ++access_remote_vm_17189 access_remote_vm 0-2-4 17189 NULL ++driver_state_read_17194 driver_state_read 3 17194 NULL nohasharray ++iscsit_find_cmd_from_itt_or_dump_17194 iscsit_find_cmd_from_itt_or_dump 3 17194 &driver_state_read_17194 ++dn_recvmsg_17213 dn_recvmsg 4 17213 NULL ++ms_rw_17220 ms_rw 3-4 17220 NULL ++__be16_to_cpup_17261 __be16_to_cpup 0 17261 NULL ++error_error_frame_cts_nul_flid_read_17262 error_error_frame_cts_nul_flid_read 3 17262 NULL ++alloc_ep_17269 alloc_ep 1 17269 NULL ++pg_read_17276 pg_read 3 17276 NULL ++raw_recvmsg_17277 raw_recvmsg 4 17277 NULL ++hmac_sha256_17278 hmac_sha256 2 17278 NULL ++neigh_hash_grow_17283 neigh_hash_grow 2 17283 NULL ++minstrel_stats_read_17290 minstrel_stats_read 3 17290 NULL ++ieee80211_if_fmt_dot11MeshForwarding_17301 ieee80211_if_fmt_dot11MeshForwarding 3 17301 NULL ++skb_pad_17302 skb_pad 2 17302 NULL ++mb_cache_create_17307 mb_cache_create 2 17307 NULL ++gnttab_map_frames_v2_17314 gnttab_map_frames_v2 2 17314 NULL ++ata_host_alloc_pinfo_17325 ata_host_alloc_pinfo 3 17325 NULL ++ieee80211_if_read_dot11MeshHWMPperrMinInterval_17346 ieee80211_if_read_dot11MeshHWMPperrMinInterval 3 17346 NULL ++ath6kl_wmi_send_mgmt_cmd_17347 ath6kl_wmi_send_mgmt_cmd 7 17347 NULL ++lpfc_debugfs_dif_err_write_17424 lpfc_debugfs_dif_err_write 3 17424 NULL ++sta_connected_time_read_17435 sta_connected_time_read 3 17435 NULL ++nla_get_u32_17455 nla_get_u32 0 17455 NULL ++__ref_totlen_17461 __ref_totlen 0 17461 NULL ++compat_cmd_17465 compat_cmd 2 17465 NULL ++probe_bios_17467 probe_bios 1 17467 NULL ++probe_kernel_write_17481 probe_kernel_write 3 17481 NULL ++__alloc_session_17485 __alloc_session 2-1 17485 NULL ++TSS_rawhmac_17486 TSS_rawhmac 3 17486 NULL ++bitmap_pos_to_ord_17503 bitmap_pos_to_ord 3 17503 NULL ++arizona_apply_fll_17538 arizona_apply_fll 2 17538 NULL ++xlog_do_log_recovery_17550 xlog_do_log_recovery 3 17550 NULL ++__copy_to_user_17551 __copy_to_user 0-3 17551 NULL ++copy_from_user_17559 copy_from_user 3 17559 NULL ++snd_pcm_action_lock_irq_17569 snd_pcm_action_lock_irq 0 17569 NULL ++acpi_ut_create_package_object_17594 acpi_ut_create_package_object 1 17594 NULL ++neigh_hash_alloc_17595 neigh_hash_alloc 1 17595 NULL ++rts51x_write_mem_17598 rts51x_write_mem 4 17598 NULL ++iwl_dump_nic_event_log_17601 iwl_dump_nic_event_log 0 17601 NULL ++wm8994_gpio_to_irq_17604 wm8994_gpio_to_irq 2 17604 NULL ++osst_execute_17607 osst_execute 7-6 17607 NULL ++ocfs2_mark_extent_written_17615 ocfs2_mark_extent_written 6 17615 NULL ++ieee80211_if_read_dot11MeshHWMPactivePathToRootTimeout_17618 ieee80211_if_read_dot11MeshHWMPactivePathToRootTimeout 3 17618 NULL ++twl4030_set_gpio_direction_17645 twl4030_set_gpio_direction 1 17645 NULL ++packet_setsockopt_17662 packet_setsockopt 5 17662 NULL nohasharray ++ubi_io_read_data_17662 ubi_io_read_data 0 17662 &packet_setsockopt_17662 ++pwr_enable_ps_read_17686 pwr_enable_ps_read 3 17686 NULL ++__einj_error_trigger_17707 __einj_error_trigger 1 17707 NULL nohasharray ++venus_rename_17707 venus_rename 5-4 17707 &__einj_error_trigger_17707 ++exofs_read_lookup_dev_table_17733 exofs_read_lookup_dev_table 3 17733 NULL ++sctpprobe_read_17741 sctpprobe_read 3 17741 NULL ++mark_unsafe_pages_17759 mark_unsafe_pages 0 17759 NULL ++brcmf_usb_attach_17766 brcmf_usb_attach 2-3 17766 NULL ++ubifs_leb_change_17789 ubifs_leb_change 4 17789 NULL ++get_unaligned_be64_17794 get_unaligned_be64 0 17794 NULL ++_snd_pcm_lib_alloc_vmalloc_buffer_17820 _snd_pcm_lib_alloc_vmalloc_buffer 2 17820 NULL ++gnet_stats_copy_app_17821 gnet_stats_copy_app 3 17821 NULL ++cipso_v4_gentag_rbm_17836 cipso_v4_gentag_rbm 0 17836 NULL ++count_leafs_17842 count_leafs 0 17842 NULL ++sisusb_send_bulk_msg_17864 sisusb_send_bulk_msg 3 17864 NULL ++alloc_sja1000dev_17868 alloc_sja1000dev 1 17868 NULL ++ray_cs_essid_proc_write_17875 ray_cs_essid_proc_write 3 17875 NULL ++orinoco_set_key_17878 orinoco_set_key 5-7 17878 NULL ++init_per_cpu_17880 init_per_cpu 1 17880 NULL ++ieee80211_if_fmt_dot11MeshMaxPeerLinks_17883 ieee80211_if_fmt_dot11MeshMaxPeerLinks 3 17883 NULL ++compat_sys_pwritev_17886 compat_sys_pwritev 3 17886 NULL ++ieee80211_if_fmt_dot11MeshHWMPRootMode_17890 ieee80211_if_fmt_dot11MeshHWMPRootMode 3 17890 NULL ++ocfs2_clusters_to_blocks_17896 ocfs2_clusters_to_blocks 0-2 17896 NULL ++wm8400_set_bits_17898 wm8400_set_bits 2 17898 NULL ++recover_head_17904 recover_head 3 17904 NULL ++dccp_feat_register_sp_17914 dccp_feat_register_sp 5 17914 NULL ++xfs_buf_associate_memory_17915 xfs_buf_associate_memory 3 17915 NULL ++srp_iu_pool_alloc_17920 srp_iu_pool_alloc 2 17920 NULL ++scsi_bufflen_17933 scsi_bufflen 0 17933 NULL ++ufs_free_blocks_17963 ufs_free_blocks 2-3 17963 NULL ++calc_nr_buckets_17976 calc_nr_buckets 0 17976 NULL ++smk_write_cipso_17989 smk_write_cipso 3 17989 NULL ++gnttab_max_grant_frames_17993 gnttab_max_grant_frames 0 17993 NULL ++ext4_num_overhead_clusters_18001 ext4_num_overhead_clusters 2 18001 NULL ++pvr2_v4l2_read_18006 pvr2_v4l2_read 3 18006 NULL ++prandom32_18007 prandom32 0 18007 NULL ++alloc_rx_desc_ring_18016 alloc_rx_desc_ring 2 18016 NULL ++fill_read_18019 fill_read 0 18019 NULL ++o2hb_highest_node_18034 o2hb_highest_node 2 18034 NULL ++cryptd_alloc_instance_18048 cryptd_alloc_instance 2-3 18048 NULL ++find_next_inuse_18051 find_next_inuse 2-3 18051 NULL ++ddebug_proc_write_18055 ddebug_proc_write 3 18055 NULL ++lua_sysfs_read_18062 lua_sysfs_read 6 18062 NULL ++hex_byte_pack_18064 hex_byte_pack 0 18064 NULL ++packet_came_18072 packet_came 3 18072 NULL ++kvm_read_guest_page_18074 kvm_read_guest_page 5 18074 NULL ++get_vm_area_18080 get_vm_area 1 18080 NULL ++mpi_alloc_18094 mpi_alloc 1 18094 NULL ++tps65910_gpio_input_18110 tps65910_gpio_input 2 18110 NULL ++dfs_file_read_18116 dfs_file_read 3 18116 NULL ++svc_getnl_18120 svc_getnl 0 18120 NULL ++paging32_gpte_to_gfn_lvl_18131 paging32_gpte_to_gfn_lvl 0-1-2 18131 NULL ++vmw_surface_dma_size_18132 vmw_surface_dma_size 0 18132 NULL ++tps65910_gpio_set_18135 tps65910_gpio_set 2 18135 NULL ++selinux_inode_setsecurity_18148 selinux_inode_setsecurity 4 18148 NULL ++is_idx_node_in_use_18165 is_idx_node_in_use 0 18165 NULL ++_has_tag_18169 _has_tag 2 18169 NULL ++pccard_store_cis_18176 pccard_store_cis 6 18176 NULL ++snd_pcm_hw_refine_user_18204 snd_pcm_hw_refine_user 0 18204 NULL ++orinoco_add_extscan_result_18207 orinoco_add_extscan_result 3 18207 NULL ++gsm_control_message_18209 gsm_control_message 4 18209 NULL ++do_ipv6_setsockopt_18215 do_ipv6_setsockopt 5 18215 NULL ++gnttab_alloc_grant_references_18240 gnttab_alloc_grant_references 1 18240 NULL ++snd_ctl_ioctl_compat_18250 snd_ctl_ioctl_compat 3 18250 NULL ++qdisc_class_hash_alloc_18262 qdisc_class_hash_alloc 1 18262 NULL ++gfs2_alloc_sort_buffer_18275 gfs2_alloc_sort_buffer 1 18275 NULL ++alloc_ring_18278 alloc_ring 2-4 18278 NULL ++find_dirty_idx_leb_18280 find_dirty_idx_leb 0 18280 NULL ++nouveau_subdev_create__18281 nouveau_subdev_create_ 7 18281 NULL nohasharray ++bio_phys_segments_18281 bio_phys_segments 0 18281 &nouveau_subdev_create__18281 ++ext4_readpages_18283 ext4_readpages 4 18283 NULL ++mmc_send_bus_test_18285 mmc_send_bus_test 4 18285 NULL ++um_idi_write_18293 um_idi_write 3 18293 NULL ++ip6ip6_err_18308 ip6ip6_err 5 18308 NULL ++vga_r_18310 vga_r 0 18310 NULL ++ecryptfs_send_message_18322 ecryptfs_send_message 2 18322 NULL ++bio_integrity_advance_18324 bio_integrity_advance 2 18324 NULL ++wm8994_gpio_direction_out_18337 wm8994_gpio_direction_out 2 18337 NULL ++pwr_power_save_off_read_18355 pwr_power_save_off_read 3 18355 NULL ++xlbd_reserve_minors_18365 xlbd_reserve_minors 1-2 18365 NULL ++ep_io_18367 ep_io 0 18367 NULL ++lp872x_update_bits_18368 lp872x_update_bits 2 18368 NULL ++irq_find_mapping_18388 irq_find_mapping 0-2 18388 NULL ++__video_register_device_18399 __video_register_device 3 18399 NULL ++reada_tree_block_flagged_18402 reada_tree_block_flagged 3 18402 NULL nohasharray ++adis16136_show_serial_18402 adis16136_show_serial 3 18402 &reada_tree_block_flagged_18402 ++crystalhd_user_data_18407 crystalhd_user_data 3 18407 NULL ++usbnet_write_cmd_nopm_18426 usbnet_write_cmd_nopm 7 18426 NULL ++batadv_orig_node_add_if_18433 batadv_orig_node_add_if 2 18433 NULL ++snd_hda_get_connections_18437 snd_hda_get_connections 0 18437 NULL ++fuse_perform_write_18457 fuse_perform_write 4 18457 NULL ++regset_tls_set_18459 regset_tls_set 4 18459 NULL ++dma_alloc_from_contiguous_18466 dma_alloc_from_contiguous 3-2 18466 NULL ++pci_vpd_lrdt_size_18479 pci_vpd_lrdt_size 0 18479 NULL ++udpv6_setsockopt_18487 udpv6_setsockopt 5 18487 NULL ++snd_gus_dram_poke_18525 snd_gus_dram_poke 4 18525 NULL ++nouveau_fifo_channel_create__18530 nouveau_fifo_channel_create_ 5-6-9 18530 NULL ++seq_copy_in_user_18543 seq_copy_in_user 3 18543 NULL ++acpi_register_gsi_ioapic_18550 acpi_register_gsi_ioapic 2 18550 NULL ++sas_change_queue_depth_18555 sas_change_queue_depth 2 18555 NULL ++smk_write_rules_list_18565 smk_write_rules_list 3 18565 NULL ++debug_output_18575 debug_output 3 18575 NULL ++check_lpt_type_18577 check_lpt_type 0 18577 NULL ++__netdev_alloc_skb_18595 __netdev_alloc_skb 2 18595 NULL ++filemap_fdatawait_range_18600 filemap_fdatawait_range 0 18600 NULL nohasharray ++slabinfo_write_18600 slabinfo_write 3 18600 &filemap_fdatawait_range_18600 ++iowarrior_write_18604 iowarrior_write 3 18604 NULL ++batadv_arp_get_type_18609 batadv_arp_get_type 3 18609 NULL ++from_buffer_18625 from_buffer 3 18625 NULL ++f1x_map_sysaddr_to_csrow_18628 f1x_map_sysaddr_to_csrow 2 18628 NULL ++snd_pcm_oss_write3_18657 snd_pcm_oss_write3 0-3 18657 NULL ++ieee80211_if_fmt_rssi_threshold_18664 ieee80211_if_fmt_rssi_threshold 3 18664 NULL ++unmap_page_18665 unmap_page 2-3 18665 NULL ++edge_tty_recv_18667 edge_tty_recv 4 18667 NULL nohasharray ++xfs_iext_insert_18667 xfs_iext_insert 3 18667 &edge_tty_recv_18667 ++replay_log_leb_18704 replay_log_leb 3 18704 NULL ++iwl_dbgfs_rx_handlers_read_18708 iwl_dbgfs_rx_handlers_read 3 18708 NULL ++ceph_alloc_page_vector_18710 ceph_alloc_page_vector 1 18710 NULL ++ocfs2_trim_extent_18711 ocfs2_trim_extent 4-3 18711 NULL ++blk_rq_bytes_18715 blk_rq_bytes 0 18715 NULL ++snd_als4k_gcr_read_addr_18741 snd_als4k_gcr_read_addr 0 18741 NULL ++o2hb_debug_create_18744 o2hb_debug_create 4 18744 NULL ++__erst_read_to_erange_from_nvram_18748 __erst_read_to_erange_from_nvram 0 18748 NULL ++wep_packets_read_18751 wep_packets_read 3 18751 NULL ++md_compat_ioctl_18764 md_compat_ioctl 4 18764 NULL ++read_file_dump_nfcal_18766 read_file_dump_nfcal 3 18766 NULL ++ffs_epfile_read_18775 ffs_epfile_read 3 18775 NULL ++alloc_fcdev_18780 alloc_fcdev 1 18780 NULL ++fat_compat_dir_ioctl_18800 fat_compat_dir_ioctl 3 18800 NULL ++ieee80211_auth_challenge_18810 ieee80211_auth_challenge 3 18810 NULL ++setup_ioapic_irq_18813 setup_ioapic_irq 1 18813 NULL ++sys_modify_ldt_18824 sys_modify_ldt 3 18824 NULL ++mtf_test_write_18844 mtf_test_write 3 18844 NULL ++drm_ht_create_18853 drm_ht_create 2 18853 NULL ++sctp_setsockopt_events_18862 sctp_setsockopt_events 3 18862 NULL ++ieee80211_if_read_element_ttl_18869 ieee80211_if_read_element_ttl 3 18869 NULL ++xlog_find_verify_log_record_18870 xlog_find_verify_log_record 2 18870 NULL ++width_to_agaw_18883 width_to_agaw 0-1 18883 NULL ++ceph_setxattr_18913 ceph_setxattr 4 18913 NULL ++mangle_packet_18920 mangle_packet 7-9 18920 NULL ++snapshot_write_next_18937 snapshot_write_next 0 18937 NULL ++__nla_reserve_18974 __nla_reserve 3 18974 NULL ++alc_auto_create_extra_outs_18975 alc_auto_create_extra_outs 2 18975 NULL ++find_dirtiest_idx_leb_19001 find_dirtiest_idx_leb 0 19001 NULL ++layout_in_gaps_19006 layout_in_gaps 2 19006 NULL ++huge_page_size_19008 huge_page_size 0 19008 NULL ++usbdev_compat_ioctl_19026 usbdev_compat_ioctl 3 19026 NULL ++prepare_highmem_image_19028 prepare_highmem_image 0 19028 NULL ++revalidate_19043 revalidate 2 19043 NULL ++drm_fb_helper_init_19044 drm_fb_helper_init 3-4 19044 NULL ++create_gpadl_header_19064 create_gpadl_header 2 19064 NULL ++ieee80211_key_alloc_19065 ieee80211_key_alloc 3 19065 NULL ++copy_and_check_19089 copy_and_check 3 19089 NULL ++sys_process_vm_readv_19090 sys_process_vm_readv 3-5 19090 NULL nohasharray ++brcmf_usbdev_qinit_19090 brcmf_usbdev_qinit 2 19090 &sys_process_vm_readv_19090 ++sta_last_seq_ctrl_read_19106 sta_last_seq_ctrl_read 3 19106 NULL ++cifs_readv_from_socket_19109 cifs_readv_from_socket 3 19109 NULL ++skb_gro_offset_19123 skb_gro_offset 0 19123 NULL ++ext4_inode_table_19125 ext4_inode_table 0 19125 NULL ++snd_als4k_iobase_readl_19136 snd_als4k_iobase_readl 0 19136 NULL ++alloc_irdadev_19140 alloc_irdadev 1 19140 NULL ++sleep_auth_read_19159 sleep_auth_read 3 19159 NULL ++smk_write_access2_19170 smk_write_access2 3 19170 NULL ++iwl_dbgfs_reply_tx_error_read_19205 iwl_dbgfs_reply_tx_error_read 3 19205 NULL ++vmw_unlocked_ioctl_19212 vmw_unlocked_ioctl 2 19212 NULL ++__copy_to_user_inatomic_19214 __copy_to_user_inatomic 3 19214 NULL ++dev_counters_read_19216 dev_counters_read 3 19216 NULL ++wbcir_tx_19219 wbcir_tx 3 19219 NULL ++gsi_to_irq_19220 gsi_to_irq 0-1 19220 NULL ++snd_mask_max_19224 snd_mask_max 0 19224 NULL ++snd_pcm_capture_rewind_19229 snd_pcm_capture_rewind 0-2 19229 NULL ++bio_alloc_mddev_19238 bio_alloc_mddev 2 19238 NULL ++sys_fcntl_19267 sys_fcntl 3 19267 NULL ++il_dbgfs_rxon_filter_flags_read_19281 il_dbgfs_rxon_filter_flags_read 3 19281 NULL ++io_mapping_map_wc_19284 io_mapping_map_wc 2 19284 NULL ++qc_capture_19298 qc_capture 3 19298 NULL ++ocfs2_prepare_inode_for_refcount_19303 ocfs2_prepare_inode_for_refcount 3-4 19303 NULL ++event_tx_stuck_read_19305 event_tx_stuck_read 3 19305 NULL ++debug_read_19322 debug_read 3 19322 NULL ++cfg80211_inform_bss_19332 cfg80211_inform_bss 8 19332 NULL ++read_zero_19366 read_zero 3 19366 NULL ++interpret_user_input_19393 interpret_user_input 2 19393 NULL ++get_unaligned_be16_19400 get_unaligned_be16 0 19400 NULL ++get_n_events_by_type_19401 get_n_events_by_type 0 19401 NULL ++dvbdmx_write_19423 dvbdmx_write 3 19423 NULL ++__phys_addr_19434 __phys_addr 0 19434 NULL ++xfrm_alg_auth_len_19454 xfrm_alg_auth_len 0 19454 NULL ++hpet_compat_ioctl_19455 hpet_compat_ioctl 3 19455 NULL ++gnet_stats_copy_19458 gnet_stats_copy 4 19458 NULL ++sky2_read16_19475 sky2_read16 0 19475 NULL ++efivar_create_sysfs_entry_19485 efivar_create_sysfs_entry 2 19485 NULL ++ext4_add_new_descs_19509 ext4_add_new_descs 3 19509 NULL ++skb_realloc_headroom_19516 skb_realloc_headroom 2 19516 NULL ++dev_alloc_skb_19517 dev_alloc_skb 1 19517 NULL ++nfc_llcp_build_tlv_19536 nfc_llcp_build_tlv 3 19536 NULL ++gfn_to_index_19558 gfn_to_index 0-1-3-2 19558 NULL ++ocfs2_control_message_19564 ocfs2_control_message 3 19564 NULL ++ieee80211_if_read_tkip_mic_test_19565 ieee80211_if_read_tkip_mic_test 3 19565 NULL nohasharray ++wlcore_hw_get_rx_packet_len_19565 wlcore_hw_get_rx_packet_len 0 19565 &ieee80211_if_read_tkip_mic_test_19565 ++nfsd_read_19568 nfsd_read 5 19568 NULL ++cgroup_read_s64_19570 cgroup_read_s64 5 19570 NULL ++bm_status_read_19583 bm_status_read 3 19583 NULL ++batadv_tt_update_orig_19586 batadv_tt_update_orig 4 19586 NULL ++load_xattr_datum_19594 load_xattr_datum 0 19594 NULL ++usbvision_rvmalloc_19655 usbvision_rvmalloc 1 19655 NULL ++LoadBitmap_19658 LoadBitmap 2 19658 NULL ++usbnet_write_cmd_19679 usbnet_write_cmd 7 19679 NULL ++read_reg_19723 read_reg 0 19723 NULL ++wm8350_block_write_19727 wm8350_block_write 3-2 19727 NULL ++memcpy_toiovecend_19736 memcpy_toiovecend 4-3 19736 NULL ++snd_es1968_get_dma_ptr_19747 snd_es1968_get_dma_ptr 0 19747 NULL ++p9_client_read_19750 p9_client_read 5 19750 NULL ++pnpbios_proc_write_19758 pnpbios_proc_write 3 19758 NULL ++ocfs2_readpages_19759 ocfs2_readpages 4 19759 NULL ++jffs2_acl_from_medium_19762 jffs2_acl_from_medium 2 19762 NULL ++__set_print_fmt_19776 __set_print_fmt 0 19776 NULL ++saa7146_vmalloc_build_pgtable_19780 saa7146_vmalloc_build_pgtable 2 19780 NULL ++irda_setsockopt_19824 irda_setsockopt 5 19824 NULL ++pcpu_next_unpop_19831 pcpu_next_unpop 4 19831 NULL ++vip_read_19832 vip_read 3 19832 NULL nohasharray ++vfs_getxattr_19832 vfs_getxattr 0 19832 &vip_read_19832 ++security_context_to_sid_19839 security_context_to_sid 2 19839 NULL ++crypt_alloc_buffer_19846 crypt_alloc_buffer 2 19846 NULL ++cfg80211_mlme_register_mgmt_19852 cfg80211_mlme_register_mgmt 5 19852 NULL ++__nla_put_19857 __nla_put 3 19857 NULL ++ip6gre_err_19869 ip6gre_err 5 19869 NULL ++aes_decrypt_interrupt_read_19910 aes_decrypt_interrupt_read 3 19910 NULL ++ps_upsd_max_apturn_read_19918 ps_upsd_max_apturn_read 3 19918 NULL ++cgroup_task_count_19930 cgroup_task_count 0 19930 NULL ++iwl_dbgfs_rx_queue_read_19943 iwl_dbgfs_rx_queue_read 3 19943 NULL ++attach_hdlc_protocol_19986 attach_hdlc_protocol 3 19986 NULL ++diva_um_idi_read_20003 diva_um_idi_read 0 20003 NULL ++split_scan_timeout_read_20029 split_scan_timeout_read 3 20029 NULL ++__be32_to_cpup_20056 __be32_to_cpup 0 20056 NULL ++alloc_ieee80211_20063 alloc_ieee80211 1 20063 NULL ++rawv6_sendmsg_20080 rawv6_sendmsg 4 20080 NULL ++fuse_conn_limit_read_20084 fuse_conn_limit_read 3 20084 NULL ++team_options_register_20091 team_options_register 3 20091 NULL ++qla2x00_adjust_sdev_qdepth_up_20097 qla2x00_adjust_sdev_qdepth_up 2 20097 NULL ++hptiop_adjust_disk_queue_depth_20122 hptiop_adjust_disk_queue_depth 2 20122 NULL ++tomoyo_commit_ok_20167 tomoyo_commit_ok 2 20167 NULL ++read_flush_pipefs_20171 read_flush_pipefs 3 20171 NULL ++wep_addr_key_count_read_20174 wep_addr_key_count_read 3 20174 NULL ++create_trace_probe_20175 create_trace_probe 1 20175 NULL ++udf_bitmap_new_block_20214 udf_bitmap_new_block 4 20214 NULL ++pvr2_ctrl_value_to_sym_20229 pvr2_ctrl_value_to_sym 5 20229 NULL ++rose_sendmsg_20249 rose_sendmsg 4 20249 NULL ++tm6000_i2c_send_regs_20250 tm6000_i2c_send_regs 5 20250 NULL ++pcpu_alloc_20255 pcpu_alloc 1-2 20255 NULL ++resource_size_20256 resource_size 0 20256 NULL ++_rtl92s_get_h2c_cmdlen_20312 _rtl92s_get_h2c_cmdlen 0 20312 NULL ++tx_tx_burst_programmed_read_20320 tx_tx_burst_programmed_read 3 20320 NULL ++snd_cs4281_BA1_read_20323 snd_cs4281_BA1_read 5 20323 NULL ++gfs2_glock_nq_m_20347 gfs2_glock_nq_m 1 20347 NULL ++qla82xx_pci_mem_read_direct_20368 qla82xx_pci_mem_read_direct 2 20368 NULL ++snd_pcm_stop_20376 snd_pcm_stop 0 20376 NULL ++smk_set_cipso_20379 smk_set_cipso 3 20379 NULL ++u64_to_uptr_20384 u64_to_uptr 1 20384 NULL ++snd_nm256_readl_20394 snd_nm256_readl 0 20394 NULL ++__kfifo_from_user_20399 __kfifo_from_user 3 20399 NULL ++pm860x_write_reg_cache_20448 pm860x_write_reg_cache 2 20448 NULL ++nfs3_setxattr_20458 nfs3_setxattr 4 20458 NULL ++ip_vs_icmp_xmit_v6_20464 ip_vs_icmp_xmit_v6 4 20464 NULL ++compat_ipv6_setsockopt_20468 compat_ipv6_setsockopt 5 20468 NULL ++read_buf_20469 read_buf 2 20469 NULL ++btrfs_get_32_20476 btrfs_get_32 0 20476 NULL ++fast_user_write_20494 fast_user_write 5 20494 NULL ++ocfs2_db_frozen_trigger_20503 ocfs2_db_frozen_trigger 4 20503 NULL nohasharray ++hidraw_report_event_20503 hidraw_report_event 3 20503 &ocfs2_db_frozen_trigger_20503 ++pcpu_alloc_area_20511 pcpu_alloc_area 0-3 20511 NULL ++pcpu_depopulate_chunk_20517 pcpu_depopulate_chunk 2-3 20517 NULL ++xfs_iext_realloc_direct_20521 xfs_iext_realloc_direct 2 20521 NULL ++drbd_bm_resize_20522 drbd_bm_resize 2 20522 NULL ++amd_create_gatt_pages_20537 amd_create_gatt_pages 1 20537 NULL ++scsi_report_opcode_20551 scsi_report_opcode 3 20551 NULL ++venus_create_20555 venus_create 4 20555 NULL ++btrfs_super_log_root_20565 btrfs_super_log_root 0 20565 NULL ++crypto_ahash_reqsize_20569 crypto_ahash_reqsize 0 20569 NULL ++rc5t583_set_bits_20573 rc5t583_set_bits 2 20573 NULL ++i915_max_freq_read_20581 i915_max_freq_read 3 20581 NULL ++batadv_tt_append_diff_20588 batadv_tt_append_diff 4 20588 NULL ++lirc_write_20604 lirc_write 3 20604 NULL ++qib_qsfp_write_20614 qib_qsfp_write 0-4-2 20614 NULL ++snd_pcm_oss_prepare_20641 snd_pcm_oss_prepare 0 20641 NULL ++kfifo_copy_to_user_20646 kfifo_copy_to_user 3 20646 NULL ++cpulist_scnprintf_20648 cpulist_scnprintf 0-2 20648 NULL ++oz_add_farewell_20652 oz_add_farewell 5 20652 NULL ++ceph_osdc_new_request_20654 ceph_osdc_new_request 15-4 20654 NULL ++oz_cdev_read_20659 oz_cdev_read 3 20659 NULL ++sec_reg_write_20667 sec_reg_write 2 20667 NULL ++tps65910_reg_clear_bits_20672 tps65910_reg_clear_bits 2 20672 NULL ++snd_hdsp_playback_copy_20676 snd_hdsp_playback_copy 5 20676 NULL ++dvb_dmxdev_buffer_read_20682 dvb_dmxdev_buffer_read 0-4 20682 NULL ++cpumask_size_20683 cpumask_size 0 20683 NULL ++btrfs_node_blockptr_20685 btrfs_node_blockptr 0 20685 NULL ++read_file_tgt_int_stats_20697 read_file_tgt_int_stats 3 20697 NULL ++__maestro_read_20700 __maestro_read 0 20700 NULL ++cipso_v4_gentag_rng_20703 cipso_v4_gentag_rng 0 20703 NULL ++pcpu_page_first_chunk_20712 pcpu_page_first_chunk 1 20712 NULL ++ocfs2_read_xattr_bucket_20722 ocfs2_read_xattr_bucket 0 20722 NULL ++security_context_to_sid_force_20724 security_context_to_sid_force 2 20724 NULL ++vring_add_indirect_20737 vring_add_indirect 3-4 20737 NULL ++io_apic_set_pci_routing_20740 io_apic_set_pci_routing 2 20740 NULL ++vol_cdev_direct_write_20751 vol_cdev_direct_write 3 20751 NULL ++ocfs2_align_bytes_to_clusters_20754 ocfs2_align_bytes_to_clusters 2 20754 NULL ++ubi_io_read_20767 ubi_io_read 0 20767 NULL ++fb_alloc_cmap_gfp_20792 fb_alloc_cmap_gfp 2 20792 NULL ++iommu_range_alloc_20794 iommu_range_alloc 3 20794 NULL ++iwl_dbgfs_rxon_flags_read_20795 iwl_dbgfs_rxon_flags_read 3 20795 NULL ++sys_sendto_20809 sys_sendto 6 20809 NULL ++strndup_user_20819 strndup_user 2 20819 NULL ++wl1271_format_buffer_20834 wl1271_format_buffer 2 20834 NULL ++uvc_alloc_entity_20836 uvc_alloc_entity 4-3 20836 NULL ++snd_pcm_capture_avail_20867 snd_pcm_capture_avail 0 20867 NULL ++ocfs2_bmap_20874 ocfs2_bmap 2 20874 NULL ++sisusb_send_packet_20891 sisusb_send_packet 2 20891 NULL ++key_icverrors_read_20895 key_icverrors_read 3 20895 NULL ++vfio_msi_enable_20906 vfio_msi_enable 2 20906 NULL ++compat_sys_readv_20911 compat_sys_readv 3 20911 NULL ++htable_bits_20933 htable_bits 0 20933 NULL ++altera_set_ir_post_20948 altera_set_ir_post 2 20948 NULL ++rx_rx_phy_hdr_read_20950 rx_rx_phy_hdr_read 3 20950 NULL ++snd_rme9652_playback_copy_20970 snd_rme9652_playback_copy 5 20970 NULL ++brcmf_tx_frame_20978 brcmf_tx_frame 3 20978 NULL ++alg_setsockopt_20985 alg_setsockopt 5 20985 NULL ++ocfs2_free_clusters_21001 ocfs2_free_clusters 4 21001 NULL ++btrfs_inode_ref_name_len_21024 btrfs_inode_ref_name_len 0 21024 NULL ++rx_defrag_tkip_called_read_21031 rx_defrag_tkip_called_read 3 21031 NULL ++lbs_threshold_read_21046 lbs_threshold_read 5 21046 NULL ++proc_fault_inject_write_21058 proc_fault_inject_write 3 21058 NULL ++event_calibration_read_21083 event_calibration_read 3 21083 NULL ++compat_sock_ioctl_trans_21092 compat_sock_ioctl_trans 4 21092 NULL ++multipath_status_21094 multipath_status 5 21094 NULL ++__cfg80211_send_disassoc_21096 __cfg80211_send_disassoc 3 21096 NULL ++ext2_valid_block_bitmap_21101 ext2_valid_block_bitmap 3 21101 NULL ++ath6kl_send_go_probe_resp_21113 ath6kl_send_go_probe_resp 3 21113 NULL ++i2400m_rx_trace_21127 i2400m_rx_trace 3 21127 NULL ++tps6586x_irq_init_21144 tps6586x_irq_init 3 21144 NULL ++ocfs2_block_check_validate_21149 ocfs2_block_check_validate 2 21149 NULL ++ath6kl_mgmt_tx_21153 ath6kl_mgmt_tx 9 21153 NULL ++setup_msi_irq_21169 setup_msi_irq 3 21169 NULL ++cx18_v4l2_read_21196 cx18_v4l2_read 3 21196 NULL ++ipc_rcu_alloc_21208 ipc_rcu_alloc 1 21208 NULL ++_ocfs2_free_clusters_21220 _ocfs2_free_clusters 4 21220 NULL ++get_numpages_21227 get_numpages 0-1-2 21227 NULL ++input_ff_create_21240 input_ff_create 2 21240 NULL ++cfg80211_notify_new_peer_candidate_21242 cfg80211_notify_new_peer_candidate 4 21242 NULL ++ocfs2_blocks_for_bytes_21268 ocfs2_blocks_for_bytes 0-2 21268 NULL ++ip_vs_icmp_xmit_21269 ip_vs_icmp_xmit 4 21269 NULL ++rc5t583_clear_bits_21300 rc5t583_clear_bits 2 21300 NULL ++vmw_gmr2_bind_21305 vmw_gmr2_bind 3 21305 NULL ++do_msg_fill_21307 do_msg_fill 3 21307 NULL ++add_res_range_21310 add_res_range 4 21310 NULL ++get_zeroed_page_21322 get_zeroed_page 0 21322 NULL ++ftrace_profile_read_21327 ftrace_profile_read 3 21327 NULL ++gfs2_ea_get_copy_21353 gfs2_ea_get_copy 0 21353 NULL ++max77693_irq_domain_map_21357 max77693_irq_domain_map 2 21357 NULL ++alloc_orinocodev_21371 alloc_orinocodev 1 21371 NULL ++video_ioctl2_21380 video_ioctl2 2 21380 NULL ++diva_get_driver_dbg_mask_21399 diva_get_driver_dbg_mask 0 21399 NULL ++snd_m3_inw_21406 snd_m3_inw 0 21406 NULL ++snapshot_read_next_21426 snapshot_read_next 0 21426 NULL ++tcp_bound_to_half_wnd_21429 tcp_bound_to_half_wnd 0-2 21429 NULL ++tracing_saved_cmdlines_read_21434 tracing_saved_cmdlines_read 3 21434 NULL ++aggr_size_tx_agg_vs_rate_read_21438 aggr_size_tx_agg_vs_rate_read 3 21438 NULL ++btrfs_iref_to_path_21445 btrfs_iref_to_path 7 21445 NULL ++__ertm_hdr_size_21450 __ertm_hdr_size 0 21450 NULL ++concat_writev_21451 concat_writev 3 21451 NULL ++extend_netdev_table_21453 extend_netdev_table 2 21453 NULL ++read_file_xmit_21487 read_file_xmit 3 21487 NULL ++mmc_alloc_sg_21504 mmc_alloc_sg 1 21504 NULL ++btrfs_file_aio_write_21520 btrfs_file_aio_write 4 21520 NULL ++il_dbgfs_stations_read_21532 il_dbgfs_stations_read 3 21532 NULL ++cipso_v4_map_cat_enum_hton_21540 cipso_v4_map_cat_enum_hton 0 21540 NULL ++rxrpc_send_data_21553 rxrpc_send_data 5 21553 NULL ++rx_rx_beacon_early_term_read_21559 rx_rx_beacon_early_term_read 3 21559 NULL ++xfs_buf_read_uncached_21585 xfs_buf_read_uncached 3 21585 NULL ++ocfs2_acl_from_xattr_21604 ocfs2_acl_from_xattr 2 21604 NULL ++xlog_do_recovery_pass_21618 xlog_do_recovery_pass 3 21618 NULL ++__jfs_getxattr_21631 __jfs_getxattr 0 21631 NULL ++rbd_req_sync_op_21632 rbd_req_sync_op 7-8 21632 NULL ++validate_nnode_21638 validate_nnode 0 21638 NULL ++__irq_alloc_descs_21639 __irq_alloc_descs 2-1-3 21639 NULL ++carl9170_rx_copy_data_21656 carl9170_rx_copy_data 2 21656 NULL ++hpet_setup_msi_irq_21662 hpet_setup_msi_irq 1 21662 NULL ++atalk_sendmsg_21677 atalk_sendmsg 4 21677 NULL ++ocfs2_xattr_get_nolock_21678 ocfs2_xattr_get_nolock 0 21678 NULL ++regmap_register_patch_21681 regmap_register_patch 3 21681 NULL ++rtllib_alloc_txb_21687 rtllib_alloc_txb 1-2 21687 NULL ++evdev_ioctl_handler_21705 evdev_ioctl_handler 2 21705 NULL ++reiserfs_allocate_list_bitmaps_21732 reiserfs_allocate_list_bitmaps 3 21732 NULL ++__nf_nat_mangle_tcp_packet_21744 __nf_nat_mangle_tcp_packet 8-6 21744 NULL ++mthca_alloc_init_21754 mthca_alloc_init 2 21754 NULL ++gen_pool_add_21776 gen_pool_add 3 21776 NULL ++xfs_da_grow_inode_int_21785 xfs_da_grow_inode_int 3 21785 NULL ++__ioremap_caller_21800 __ioremap_caller 1-2 21800 NULL ++dvb_generic_ioctl_21810 dvb_generic_ioctl 2 21810 NULL ++wm8994_request_irq_21822 wm8994_request_irq 2 21822 NULL ++oom_adj_read_21847 oom_adj_read 3 21847 NULL ++acpi_tb_check_xsdt_21862 acpi_tb_check_xsdt 1 21862 NULL ++lpfc_idiag_extacc_avail_get_21865 lpfc_idiag_extacc_avail_get 0-3 21865 NULL ++brcms_debugfs_hardware_read_21867 brcms_debugfs_hardware_read 3 21867 NULL ++sisusbcon_bmove_21873 sisusbcon_bmove 6-5-7 21873 NULL nohasharray ++tcp_cookie_size_check_21873 tcp_cookie_size_check 0-1 21873 &sisusbcon_bmove_21873 ++__alloc_reserved_percpu_21895 __alloc_reserved_percpu 1-2 21895 NULL ++rio_destid_first_21900 rio_destid_first 0 21900 NULL ++dbAllocCtl_21911 dbAllocCtl 0 21911 NULL ++qsfp_1_read_21915 qsfp_1_read 3 21915 NULL ++rbd_req_read_21952 rbd_req_read 4-5 21952 NULL ++security_mmap_addr_21970 security_mmap_addr 0 21970 NULL ++alloc_ldt_21972 alloc_ldt 2 21972 NULL ++rxpipe_descr_host_int_trig_rx_data_read_22001 rxpipe_descr_host_int_trig_rx_data_read 3 22001 NULL nohasharray ++compat_rw_copy_check_uvector_22001 compat_rw_copy_check_uvector 0-3 22001 &rxpipe_descr_host_int_trig_rx_data_read_22001 ++btrfs_get_16_22023 btrfs_get_16 0 22023 NULL ++ti_recv_22027 ti_recv 4 22027 NULL ++pcf50633_irq_unmask_22034 pcf50633_irq_unmask 2 22034 NULL ++zd_usb_read_fw_22049 zd_usb_read_fw 4 22049 NULL ++ieee80211_if_fmt_dropped_frames_ttl_22054 ieee80211_if_fmt_dropped_frames_ttl 3 22054 NULL ++btrfs_reloc_clone_csums_22077 btrfs_reloc_clone_csums 2 22077 NULL ++mem_rw_22085 mem_rw 3 22085 NULL ++snd_pcm_xrun_22088 snd_pcm_xrun 0 22088 NULL ++lowpan_fragment_xmit_22095 lowpan_fragment_xmit 3-4 22095 NULL ++sys_remap_file_pages_22124 sys_remap_file_pages 1 22124 NULL ++__bitmap_size_22138 __bitmap_size 0 22138 NULL ++compat_insn_22142 compat_insn 2 22142 NULL ++pn533_dep_link_up_22154 pn533_dep_link_up 5 22154 NULL ++do_tcp_sendpages_22155 do_tcp_sendpages 4 22155 NULL ++__kfifo_alloc_22173 __kfifo_alloc 2-3 22173 NULL ++fls_22210 fls 0 22210 NULL ++bio_chain_clone_22227 bio_chain_clone 4 22227 NULL ++mem_write_22232 mem_write 3 22232 NULL ++p9_virtio_zc_request_22240 p9_virtio_zc_request 6-5 22240 NULL ++atomic64_xchg_22246 atomic64_xchg 0 22246 NULL ++compat_process_vm_rw_22254 compat_process_vm_rw 3-5 22254 NULL ++__btrfs_direct_write_22273 __btrfs_direct_write 4 22273 NULL ++queue_max_sectors_22280 queue_max_sectors 0 22280 NULL ++pci_vpd_srdt_size_22300 pci_vpd_srdt_size 0 22300 NULL nohasharray ++__tun_chr_ioctl_22300 __tun_chr_ioctl 4 22300 &pci_vpd_srdt_size_22300 ++mesh_table_alloc_22305 mesh_table_alloc 1 22305 NULL ++get_segment_base_22324 get_segment_base 0 22324 NULL ++radix_tree_find_next_bit_22334 radix_tree_find_next_bit 2-3 22334 NULL ++atomic_read_22342 atomic_read 0 22342 NULL ++mlx4_db_alloc_22358 mlx4_db_alloc 3 22358 NULL ++irq_reserve_irq_22360 irq_reserve_irq 1 22360 NULL ++snd_pcm_alsa_frames_22363 snd_pcm_alsa_frames 2 22363 NULL ++wlcore_alloc_hw_22365 wlcore_alloc_hw 1 22365 NULL nohasharray ++tps6586x_gpio_to_irq_22365 tps6586x_gpio_to_irq 2 22365 &wlcore_alloc_hw_22365 ++evdev_ioctl_22371 evdev_ioctl 2 22371 NULL ++alloc_large_system_hash_22391 alloc_large_system_hash 2 22391 NULL ++btmrvl_psmode_read_22395 btmrvl_psmode_read 3 22395 NULL ++zoran_write_22404 zoran_write 3 22404 NULL ++queue_reply_22416 queue_reply 3 22416 NULL ++__set_enter_print_fmt_22431 __set_enter_print_fmt 0 22431 NULL ++queue_max_segments_22441 queue_max_segments 0 22441 NULL ++handle_received_packet_22457 handle_received_packet 3 22457 NULL ++mem_cgroup_read_22461 mem_cgroup_read 5 22461 NULL ++cache_write_procfs_22491 cache_write_procfs 3 22491 NULL ++mp_find_ioapic_pin_22499 mp_find_ioapic_pin 0-2 22499 NULL ++mutex_lock_interruptible_22505 mutex_lock_interruptible 0 22505 NULL ++ip4_addr_string_22511 ip4_addr_string 0 22511 NULL ++pskb_may_pull_22546 pskb_may_pull 2 22546 NULL ++ocfs2_read_extent_block_22550 ocfs2_read_extent_block 0 22550 NULL ++atomic_long_read_unchecked_22551 atomic_long_read_unchecked 0 22551 NULL ++agp_alloc_page_array_22554 agp_alloc_page_array 1 22554 NULL ++dbFindCtl_22587 dbFindCtl 0 22587 NULL ++snapshot_read_22601 snapshot_read 3 22601 NULL ++sctp_setsockopt_connectx_old_22631 sctp_setsockopt_connectx_old 3 22631 NULL ++ide_core_cp_entry_22636 ide_core_cp_entry 3 22636 NULL ++wl1271_rx_filter_get_fields_size_22638 wl1271_rx_filter_get_fields_size 0 22638 NULL ++pwr_wake_on_timer_exp_read_22640 pwr_wake_on_timer_exp_read 3 22640 NULL ++iwl_dbgfs_calib_disabled_read_22649 iwl_dbgfs_calib_disabled_read 3 22649 NULL ++ubifs_leb_write_22679 ubifs_leb_write 4-5 22679 NULL ++fill_gap_22681 fill_gap 0 22681 NULL ++ocfs2_get_block_22687 ocfs2_get_block 2 22687 NULL ++compat_fd_ioctl_22694 compat_fd_ioctl 4 22694 NULL ++alloc_libipw_22708 alloc_libipw 1 22708 NULL ++brcmf_sdbrcm_read_control_22721 brcmf_sdbrcm_read_control 3 22721 NULL ++cx18_copy_buf_to_user_22735 cx18_copy_buf_to_user 4 22735 NULL ++ceph_decode_32_22738 ceph_decode_32 0 22738 NULL ++iio_debugfs_write_reg_22742 iio_debugfs_write_reg 3 22742 NULL ++print_frame_22769 print_frame 0 22769 NULL ++ftrace_arch_read_dyn_info_22773 ftrace_arch_read_dyn_info 0 22773 NULL ++retu_write_22800 retu_write 2 22800 NULL ++compat_blkdev_ioctl_22841 compat_blkdev_ioctl 3 22841 NULL ++can_nocow_odirect_22854 can_nocow_odirect 3 22854 NULL nohasharray ++read_file_rcstat_22854 read_file_rcstat 3 22854 &can_nocow_odirect_22854 ++do_atm_iobuf_22857 do_atm_iobuf 3 22857 NULL ++nfs4_realloc_slot_table_22859 nfs4_realloc_slot_table 2 22859 NULL ++create_attr_set_22861 create_attr_set 1 22861 NULL ++vmw_execbuf_process_22885 vmw_execbuf_process 5 22885 NULL ++usblp_new_writeurb_22894 usblp_new_writeurb 2 22894 NULL ++mdc800_device_read_22896 mdc800_device_read 3 22896 NULL ++pcpu_mem_zalloc_22948 pcpu_mem_zalloc 1 22948 NULL ++alloc_sglist_22960 alloc_sglist 1-2-3 22960 NULL ++caif_seqpkt_sendmsg_22961 caif_seqpkt_sendmsg 4 22961 NULL ++vme_get_size_22964 vme_get_size 0 22964 NULL ++tx_frag_key_not_found_read_22971 tx_frag_key_not_found_read 3 22971 NULL ++usb_get_langid_22983 usb_get_langid 0 22983 NULL ++remote_settings_file_write_22987 remote_settings_file_write 3 22987 NULL ++viafb_dvp0_proc_write_23023 viafb_dvp0_proc_write 3 23023 NULL ++cifs_local_to_utf16_bytes_23025 cifs_local_to_utf16_bytes 0 23025 NULL ++st_status_23032 st_status 5 23032 NULL ++nv50_disp_chan_create__23056 nv50_disp_chan_create_ 5 23056 NULL ++reiserfs_add_entry_23062 reiserfs_add_entry 4 23062 NULL ++vm_map_ram_23078 vm_map_ram 2 23078 NULL nohasharray ++raw_sendmsg_23078 raw_sendmsg 4 23078 &vm_map_ram_23078 ++qla4_82xx_pci_mem_read_2M_23081 qla4_82xx_pci_mem_read_2M 2 23081 NULL ++isr_tx_procs_read_23084 isr_tx_procs_read 3 23084 NULL ++lnw_gpio_irq_map_23087 lnw_gpio_irq_map 2 23087 NULL ++rt2x00debug_write_eeprom_23091 rt2x00debug_write_eeprom 3 23091 NULL ++fls_long_23096 fls_long 0 23096 NULL ++ntfs_ucstonls_23097 ntfs_ucstonls 3-5 23097 NULL ++pipe_iov_copy_from_user_23102 pipe_iov_copy_from_user 3 23102 NULL ++mwl8k_cmd_set_beacon_23110 mwl8k_cmd_set_beacon 4 23110 NULL ++nl80211_send_rx_auth_23111 nl80211_send_rx_auth 4 23111 NULL ++__clear_user_23118 __clear_user 0 23118 NULL ++dm_write_async_23120 dm_write_async 3 23120 NULL ++drm_mode_create_tv_properties_23122 drm_mode_create_tv_properties 2 23122 NULL ++ca91cx42_master_set_23146 ca91cx42_master_set 4 23146 NULL ++wm831x_set_bits_23158 wm831x_set_bits 2 23158 NULL ++read_file_ani_23161 read_file_ani 3 23161 NULL ++ioremap_23172 ioremap 1-2 23172 NULL ++usblp_write_23178 usblp_write 3 23178 NULL ++msnd_fifo_alloc_23179 msnd_fifo_alloc 2 23179 NULL ++gss_pipe_downcall_23182 gss_pipe_downcall 3 23182 NULL ++ieee80211_get_mesh_hdrlen_23183 ieee80211_get_mesh_hdrlen 0 23183 NULL ++fix_unclean_leb_23188 fix_unclean_leb 3 23188 NULL ++mpi_alloc_limb_space_23190 mpi_alloc_limb_space 1 23190 NULL ++__next_dma_cap_23195 __next_dma_cap 1 23195 NULL ++convert_ip_to_linear_23198 convert_ip_to_linear 0 23198 NULL ++pm80x_free_irq_23210 pm80x_free_irq 2 23210 NULL nohasharray ++compat_rawv6_ioctl_23210 compat_rawv6_ioctl 3 23210 &pm80x_free_irq_23210 ++tty_buffer_request_room_23228 tty_buffer_request_room 2 23228 NULL ++xlog_get_bp_23229 xlog_get_bp 2 23229 NULL ++rxrpc_client_sendmsg_23236 rxrpc_client_sendmsg 5 23236 NULL ++__gfn_to_rmap_23240 __gfn_to_rmap 1-2 23240 NULL ++uwb_dev_addr_print_23282 uwb_dev_addr_print 2 23282 NULL ++ipv6_skip_exthdr_23283 ipv6_skip_exthdr 0-2 23283 NULL ++doc_probe_23285 doc_probe 1 23285 NULL ++diva_get_trace_filter_23286 diva_get_trace_filter 0 23286 NULL ++i2cdev_write_23310 i2cdev_write 3 23310 NULL ++mc13xxx_get_num_regulators_dt_23344 mc13xxx_get_num_regulators_dt 0 23344 NULL ++page_readlink_23346 page_readlink 3 23346 NULL ++get_dst_timing_23358 get_dst_timing 0 23358 NULL ++iscsi_change_queue_depth_23416 iscsi_change_queue_depth 2 23416 NULL ++vga_mm_r_23419 vga_mm_r 0 23419 NULL ++vzalloc_node_23424 vzalloc_node 1 23424 NULL ++__cxio_init_resource_fifo_23447 __cxio_init_resource_fifo 3 23447 NULL nohasharray ++ocfs2_zero_tail_23447 ocfs2_zero_tail 3 23447 &__cxio_init_resource_fifo_23447 ++hidraw_send_report_23449 hidraw_send_report 3 23449 NULL ++linear_conf_23485 linear_conf 2 23485 NULL nohasharray ++divasa_remap_pci_bar_23485 divasa_remap_pci_bar 3-4 23485 &linear_conf_23485 ++event_filter_read_23494 event_filter_read 3 23494 NULL ++ima_show_measurements_count_23536 ima_show_measurements_count 3 23536 NULL ++xen_allocate_irq_gsi_23546 xen_allocate_irq_gsi 1-0 23546 NULL ++tcp_current_mss_23552 tcp_current_mss 0 23552 NULL ++dbg_leb_change_23555 dbg_leb_change 4 23555 NULL ++venus_symlink_23570 venus_symlink 4-6 23570 NULL ++iwl_dbgfs_interrupt_read_23574 iwl_dbgfs_interrupt_read 3 23574 NULL ++snd_interval_min_23590 snd_interval_min 0 23590 NULL ++_alloc_cdb_cont_23609 _alloc_cdb_cont 2 23609 NULL ++islpci_mgt_transaction_23610 islpci_mgt_transaction 5 23610 NULL ++__i2400mu_send_barker_23652 __i2400mu_send_barker 3 23652 NULL ++ext3_compat_ioctl_23659 ext3_compat_ioctl 3 23659 NULL ++sInW_23663 sInW 0 23663 NULL ++proc_ioctl_compat_23682 proc_ioctl_compat 2 23682 NULL ++nftl_partscan_23688 nftl_partscan 0 23688 NULL ++cx18_read_23699 cx18_read 3 23699 NULL ++mp_config_acpi_gsi_23728 mp_config_acpi_gsi 2 23728 NULL ++pack_sg_list_p_23739 pack_sg_list_p 0-2 23739 NULL ++rx_rx_dropped_frame_read_23748 rx_rx_dropped_frame_read 3 23748 NULL ++__kfifo_max_r_23768 __kfifo_max_r 0-2-1 23768 NULL ++security_inode_getxattr_23781 security_inode_getxattr 0 23781 NULL ++diva_alloc_dma_map_23798 diva_alloc_dma_map 2 23798 NULL ++rx_path_reset_read_23801 rx_path_reset_read 3 23801 NULL ++__earlyonly_bootmem_alloc_23824 __earlyonly_bootmem_alloc 2 23824 NULL ++xfs_dir2_leaf_getdents_23841 xfs_dir2_leaf_getdents 3 23841 NULL ++iwl_dbgfs_nvm_read_23845 iwl_dbgfs_nvm_read 3 23845 NULL ++p54_init_common_23850 p54_init_common 1 23850 NULL ++gart_alloc_coherent_23852 gart_alloc_coherent 2 23852 NULL ++bin_to_hex_dup_23853 bin_to_hex_dup 2 23853 NULL ++ocfs2_xattr_get_clusters_23857 ocfs2_xattr_get_clusters 0 23857 NULL ++ieee80211_if_read_dot11MeshMaxPeerLinks_23878 ieee80211_if_read_dot11MeshMaxPeerLinks 3 23878 NULL ++ieee80211_if_read_channel_type_23884 ieee80211_if_read_channel_type 3 23884 NULL ++nes_alloc_resource_23891 nes_alloc_resource 3 23891 NULL ++tipc_snprintf_23893 tipc_snprintf 2 23893 NULL ++add_new_gdb_meta_bg_23911 add_new_gdb_meta_bg 3 23911 NULL nohasharray ++ieee80211_if_read_hw_queues_23911 ieee80211_if_read_hw_queues 3 23911 &add_new_gdb_meta_bg_23911 ++f2fs_getxattr_23917 f2fs_getxattr 0 23917 NULL ++ipath_reg_phys_mr_23918 ipath_reg_phys_mr 3 23918 NULL nohasharray ++mpihelp_mul_karatsuba_case_23918 mpihelp_mul_karatsuba_case 5-3 23918 &ipath_reg_phys_mr_23918 ++kvm_read_guest_23928 kvm_read_guest 4-2 23928 NULL ++__alloc_skb_23940 __alloc_skb 1 23940 NULL ++uvc_endpoint_max_bpi_23944 uvc_endpoint_max_bpi 0 23944 NULL ++cifs_setxattr_23957 cifs_setxattr 4 23957 NULL ++zd_usb_iowrite16v_async_23984 zd_usb_iowrite16v_async 3 23984 NULL ++cxgb_alloc_mem_24007 cxgb_alloc_mem 1 24007 NULL ++dgrp_send_24028 dgrp_send 0-2 24028 NULL ++ocfs2_mark_extent_refcounted_24035 ocfs2_mark_extent_refcounted 6 24035 NULL ++afs_cell_alloc_24052 afs_cell_alloc 2 24052 NULL ++blkcipher_copy_iv_24075 blkcipher_copy_iv 3 24075 NULL ++vb2_fop_read_24080 vb2_fop_read 3 24080 NULL ++pipeline_post_proc_swi_read_24108 pipeline_post_proc_swi_read 3 24108 NULL ++request_key_auth_read_24109 request_key_auth_read 3 24109 NULL ++ieee80211_send_auth_24121 ieee80211_send_auth 5 24121 NULL ++mpu401_read_24126 mpu401_read 3 24126 NULL ++irnet_ctrl_write_24139 irnet_ctrl_write 3 24139 NULL ++trim_bitmaps_24158 trim_bitmaps 3 24158 NULL ++adu_read_24177 adu_read 3 24177 NULL ++safe_prepare_write_buffer_24187 safe_prepare_write_buffer 3 24187 NULL ++ieee80211_if_read_dot11MeshHWMPpreqMinInterval_24208 ieee80211_if_read_dot11MeshHWMPpreqMinInterval 3 24208 NULL ++efx_vf_size_24213 efx_vf_size 0 24213 NULL ++tcpprobe_sprint_24222 tcpprobe_sprint 0-2 24222 NULL ++pcpu_embed_first_chunk_24224 pcpu_embed_first_chunk 1-2-3 24224 NULL nohasharray ++mei_amthif_read_24224 mei_amthif_read 4 24224 &pcpu_embed_first_chunk_24224 ++pci_num_vf_24235 pci_num_vf 0 24235 NULL ++sel_read_bool_24236 sel_read_bool 3 24236 NULL ++thin_status_24278 thin_status 5 24278 NULL ++compat_sys_preadv64_24283 compat_sys_preadv64 3 24283 NULL ++msg_size_24288 msg_size 0 24288 NULL ++ext2_free_blocks_24292 ext2_free_blocks 2-3 24292 NULL ++map_page_24298 map_page 3-4 24298 NULL ++btmrvl_pscmd_read_24308 btmrvl_pscmd_read 3 24308 NULL ++ath6kl_add_bss_if_needed_24317 ath6kl_add_bss_if_needed 6 24317 NULL ++ocfs2_direct_IO_get_blocks_24333 ocfs2_direct_IO_get_blocks 2 24333 NULL ++kzalloc_node_24352 kzalloc_node 1 24352 NULL ++qla2x00_handle_queue_full_24365 qla2x00_handle_queue_full 2 24365 NULL ++cfi_read_pri_24366 cfi_read_pri 3 24366 NULL ++btrfs_item_size_nr_24367 btrfs_item_size_nr 0 24367 NULL ++igetword_24373 igetword 0 24373 NULL ++pvr2_v4l2_ioctl_24398 pvr2_v4l2_ioctl 2 24398 NULL nohasharray ++getxattr_24398 getxattr 4 24398 &pvr2_v4l2_ioctl_24398 ++blk_update_bidi_request_24415 blk_update_bidi_request 3-4 24415 NULL ++b43_debugfs_read_24425 b43_debugfs_read 3 24425 NULL ++ieee80211_rx_mgmt_beacon_24430 ieee80211_rx_mgmt_beacon 3 24430 NULL ++ixgbe_alloc_q_vector_24439 ixgbe_alloc_q_vector 4-6 24439 NULL ++smk_user_access_24440 smk_user_access 3 24440 NULL ++page_address_24444 page_address 0 24444 NULL ++evdev_do_ioctl_24459 evdev_do_ioctl 2 24459 NULL ++ocfs2_write_cluster_by_desc_24466 ocfs2_write_cluster_by_desc 5-6 24466 NULL ++pd_video_read_24510 pd_video_read 3 24510 NULL ++request_key_with_auxdata_24515 request_key_with_auxdata 4 24515 NULL ++xfs_buf_get_map_24522 xfs_buf_get_map 3 24522 NULL ++named_prepare_buf_24532 named_prepare_buf 2 24532 NULL ++do_mpage_readpage_24536 do_mpage_readpage 3 24536 NULL ++write_cache_pages_24562 write_cache_pages 0 24562 NULL ++tsi148_alloc_resource_24563 tsi148_alloc_resource 2 24563 NULL ++udf_compute_nr_groups_24594 udf_compute_nr_groups 0 24594 NULL ++palmas_smps_write_24600 palmas_smps_write 2 24600 NULL nohasharray ++count_preds_24600 count_preds 0 24600 &palmas_smps_write_24600 ++sensor_hub_get_physical_device_count_24605 sensor_hub_get_physical_device_count 0 24605 NULL ++context_alloc_24645 context_alloc 3 24645 NULL ++blk_rq_err_bytes_24650 blk_rq_err_bytes 0 24650 NULL ++unifi_net_data_malloc_24716 unifi_net_data_malloc 3 24716 NULL ++simple_attr_read_24738 simple_attr_read 3 24738 NULL ++qla2x00_change_queue_depth_24742 qla2x00_change_queue_depth 2 24742 NULL ++ath_rxbuf_alloc_24745 ath_rxbuf_alloc 2 24745 NULL ++get_dma_residue_24749 get_dma_residue 0 24749 NULL ++kgdb_hex2mem_24755 kgdb_hex2mem 3 24755 NULL ++nfsd4_sanitize_slot_size_24756 nfsd4_sanitize_slot_size 0-1 24756 NULL ++i915_cache_sharing_read_24775 i915_cache_sharing_read 3 24775 NULL ++ocfs2_read_blocks_24777 ocfs2_read_blocks 0 24777 NULL ++skb_make_writable_24783 skb_make_writable 2 24783 NULL ++datablob_hmac_verify_24786 datablob_hmac_verify 4 24786 NULL ++cache_read_24790 cache_read 3 24790 NULL ++unpack_str_24798 unpack_str 0 24798 NULL ++__next_cpu_nr_24805 __next_cpu_nr 1 24805 NULL ++comedi_buf_alloc_24822 comedi_buf_alloc 3 24822 NULL ++snd_als4k_gcr_read_24840 snd_als4k_gcr_read 0 24840 NULL ++snd_pcm_lib_buffer_bytes_24865 snd_pcm_lib_buffer_bytes 0 24865 NULL ++pnp_alloc_24869 pnp_alloc 1 24869 NULL nohasharray ++l2cap_create_basic_pdu_24869 l2cap_create_basic_pdu 3 24869 &pnp_alloc_24869 ++bnx2fc_cmd_mgr_alloc_24873 bnx2fc_cmd_mgr_alloc 3-2 24873 NULL ++queues_read_24877 queues_read 3 24877 NULL ++codec_list_read_file_24910 codec_list_read_file 3 24910 NULL ++v4l2_ctrl_new_24927 v4l2_ctrl_new 7 24927 NULL ++next_token_24929 next_token 0 24929 NULL ++uf_create_device_nodes_24948 uf_create_device_nodes 2 24948 NULL ++ocfs2_fiemap_24949 ocfs2_fiemap 3-4 24949 NULL ++packet_sendmsg_24954 packet_sendmsg 4 24954 NULL ++sys_rt_sigpending_24961 sys_rt_sigpending 2 24961 NULL ++ensure_wear_leveling_24971 ensure_wear_leveling 0 24971 NULL ++twl_i2c_write_u8_24976 twl_i2c_write_u8 3 24976 NULL ++nf_nat_sdp_port_24977 nf_nat_sdp_port 7 24977 NULL ++llc_ui_sendmsg_24987 llc_ui_sendmsg 4 24987 NULL ++key_conf_hw_key_idx_read_25003 key_conf_hw_key_idx_read 3 25003 NULL ++il_dbgfs_channels_read_25005 il_dbgfs_channels_read 3 25005 NULL ++ni_660x_num_counters_25031 ni_660x_num_counters 0 25031 NULL ++nfs_dns_resolve_name_25036 nfs_dns_resolve_name 3 25036 NULL ++gs_buf_alloc_25067 gs_buf_alloc 2 25067 NULL ++gfs2_iter_unstuffed_25099 gfs2_iter_unstuffed 0 25099 NULL ++cxio_hal_init_rhdl_resource_25104 cxio_hal_init_rhdl_resource 1 25104 NULL ++snd_rawmidi_kernel_write_25106 snd_rawmidi_kernel_write 3 25106 NULL ++fs32_to_cpu_25143 fs32_to_cpu 0 25143 NULL ++sys_fgetxattr_25166 sys_fgetxattr 4 25166 NULL ++ipath_init_qp_table_25167 ipath_init_qp_table 2 25167 NULL ++mmu_set_spte_25177 mmu_set_spte 8-9 25177 NULL ++sctp_getsockopt_local_addrs_25178 sctp_getsockopt_local_addrs 2 25178 NULL ++ks8851_rdreg32_25187 ks8851_rdreg32 0 25187 NULL ++ocfs2_block_check_compute_25223 ocfs2_block_check_compute 2 25223 NULL ++mon_stat_read_25238 mon_stat_read 3 25238 NULL ++tcf_csum_ipv6_udp_25241 tcf_csum_ipv6_udp 4 25241 NULL ++nilfs_palloc_find_available_slot_25245 nilfs_palloc_find_available_slot 3-5 25245 NULL ++stripe_status_25259 stripe_status 5 25259 NULL ++snd_pcm_start_25273 snd_pcm_start 0 25273 NULL ++crypto_alloc_instance2_25277 crypto_alloc_instance2 3 25277 NULL ++vfs_writev_25278 vfs_writev 3 25278 NULL ++l2tp_session_create_25286 l2tp_session_create 1 25286 NULL ++snd_seq_ioctl_compat_25307 snd_seq_ioctl_compat 3 25307 NULL ++help_25316 help 5 25316 NULL nohasharray ++ath9k_debugfs_read_buf_25316 ath9k_debugfs_read_buf 3 25316 &help_25316 ++rng_buffer_size_25348 rng_buffer_size 0 25348 NULL ++i915_gem_execbuffer_relocate_slow_25355 i915_gem_execbuffer_relocate_slow 7 25355 NULL ++rio_destid_next_25368 rio_destid_next 2 25368 NULL nohasharray ++unix_mkname_25368 unix_mkname 0-2 25368 &rio_destid_next_25368 ++sel_read_mls_25369 sel_read_mls 3 25369 NULL ++tc3589x_gpio_to_irq_25371 tc3589x_gpio_to_irq 2 25371 NULL ++ebt_buf_add_pad_25413 ebt_buf_add_pad 0 25413 NULL ++dai_list_read_file_25421 dai_list_read_file 3 25421 NULL ++ath6kl_wmi_beginscan_cmd_25462 ath6kl_wmi_beginscan_cmd 8 25462 NULL ++generic_file_buffered_write_25464 generic_file_buffered_write 4 25464 NULL ++crypto_hash_digestsize_25469 crypto_hash_digestsize 0 25469 NULL ++ocfs2_hamming_encode_25501 ocfs2_hamming_encode 3 25501 NULL ++ivtv_buf_copy_from_user_25502 ivtv_buf_copy_from_user 4 25502 NULL ++snd_pcm_plugin_build_25505 snd_pcm_plugin_build 5 25505 NULL ++sb_permission_25523 sb_permission 0 25523 NULL ++ext3_get_inode_loc_25542 ext3_get_inode_loc 0 25542 NULL ++ieee80211_if_read_path_refresh_time_25545 ieee80211_if_read_path_refresh_time 3 25545 NULL ++wimax_addr_scnprint_25548 wimax_addr_scnprint 2 25548 NULL ++ht_print_chan_25556 ht_print_chan 0 25556 NULL ++skb_tailroom_25567 skb_tailroom 0 25567 NULL ++__devres_alloc_25598 __devres_alloc 2 25598 NULL ++copy_user_generic_25611 copy_user_generic 0 25611 NULL ++proc_coredump_filter_write_25625 proc_coredump_filter_write 3 25625 NULL ++__get_user_pages_25628 __get_user_pages 0 25628 NULL nohasharray ++befs_utf2nls_25628 befs_utf2nls 3 25628 &__get_user_pages_25628 ++__direct_map_25647 __direct_map 5-6 25647 NULL ++ext2_try_to_allocate_25667 ext2_try_to_allocate 4-2 25667 NULL ++aircable_prepare_write_buffer_25669 aircable_prepare_write_buffer 3 25669 NULL ++sta_inactive_ms_read_25690 sta_inactive_ms_read 3 25690 NULL ++ebitmap_start_positive_25703 ebitmap_start_positive 0 25703 NULL ++rx_filter_mc_filter_read_25712 rx_filter_mc_filter_read 3 25712 NULL ++ibmasm_new_command_25714 ibmasm_new_command 2 25714 NULL ++sel_write_context_25726 sel_write_context 3 25726 NULL nohasharray ++__alloc_bootmem_low_node_25726 __alloc_bootmem_low_node 2 25726 &sel_write_context_25726 ++mcs_unwrap_fir_25733 mcs_unwrap_fir 3 25733 NULL ++ext2_find_near_25734 ext2_find_near 0 25734 NULL ++cxgbi_device_portmap_create_25747 cxgbi_device_portmap_create 3 25747 NULL ++event_rx_pool_read_25792 event_rx_pool_read 3 25792 NULL ++sg_read_25799 sg_read 3 25799 NULL ++sys32_rt_sigpending_25814 sys32_rt_sigpending 2 25814 NULL ++system_enable_read_25815 system_enable_read 3 25815 NULL ++realloc_buffer_25816 realloc_buffer 2 25816 NULL ++pwr_missing_bcns_read_25824 pwr_missing_bcns_read 3 25824 NULL ++parport_read_25855 parport_read 0 25855 NULL ++xfs_dir2_sf_hdr_size_25858 xfs_dir2_sf_hdr_size 0 25858 NULL ++uf_ap_process_data_pdu_25860 uf_ap_process_data_pdu 7 25860 NULL ++ath6kl_regread_read_25884 ath6kl_regread_read 3 25884 NULL ++run_delalloc_nocow_25896 run_delalloc_nocow 3 25896 NULL ++sisusbcon_scroll_area_25899 sisusbcon_scroll_area 4-3 25899 NULL ++lpfc_change_queue_depth_25905 lpfc_change_queue_depth 2 25905 NULL ++do_jffs2_setxattr_25910 do_jffs2_setxattr 5 25910 NULL ++utf16_strlen_25913 utf16_strlen 0 25913 NULL ++rcname_read_25919 rcname_read 3 25919 NULL ++snd_es1938_capture_copy_25930 snd_es1938_capture_copy 5 25930 NULL ++key_flags_read_25931 key_flags_read 3 25931 NULL ++copy_play_buf_25932 copy_play_buf 3 25932 NULL ++tps80031_clr_bits_25942 tps80031_clr_bits 3 25942 NULL ++flush_25957 flush 2 25957 NULL ++video_register_device_25971 video_register_device 3 25971 NULL ++udp_setsockopt_25985 udp_setsockopt 5 25985 NULL ++ebt_compat_entry_padsize_26001 ebt_compat_entry_padsize 0 26001 NULL ++lpfc_sli_probe_sriov_nr_virtfn_26004 lpfc_sli_probe_sriov_nr_virtfn 2 26004 NULL ++mirror_status_26010 mirror_status 5 26010 NULL ++irq_create_strict_mappings_26025 irq_create_strict_mappings 2-4 26025 NULL ++xfs_xattr_acl_set_26028 xfs_xattr_acl_set 4 26028 NULL ++skb_mac_header_26034 skb_mac_header 0 26034 NULL ++mptscsih_change_queue_depth_26036 mptscsih_change_queue_depth 2 26036 NULL ++selinux_inode_post_setxattr_26037 selinux_inode_post_setxattr 4 26037 NULL ++tun_do_read_26047 tun_do_read 5 26047 NULL ++keyctl_update_key_26061 keyctl_update_key 3 26061 NULL ++rx_rx_wa_density_dropped_frame_read_26095 rx_rx_wa_density_dropped_frame_read 3 26095 NULL ++cpumask_next_26096 cpumask_next 1 26096 NULL ++skb_cow_26138 skb_cow 2 26138 NULL ++usb_dump_device_strings_26146 usb_dump_device_strings 0 26146 NULL ++__fswab64_26155 __fswab64 0 26155 NULL ++copy_oldmem_page_26164 copy_oldmem_page 3-1 26164 NULL ++gfs2_xattr_acl_get_26166 gfs2_xattr_acl_get 0 26166 NULL nohasharray ++ath6kl_roam_table_read_26166 ath6kl_roam_table_read 3 26166 &gfs2_xattr_acl_get_26166 ++mid_get_vbt_data_r1_26170 mid_get_vbt_data_r1 2 26170 NULL ++disk_devt_26180 disk_devt 0 26180 NULL ++get_registers_26187 get_registers 3 26187 NULL ++cgroup_setxattr_26188 cgroup_setxattr 4 26188 NULL ++ieee80211_if_fmt_dot11MeshTTL_26198 ieee80211_if_fmt_dot11MeshTTL 3 26198 NULL ++xfs_idata_realloc_26199 xfs_idata_realloc 2 26199 NULL ++mce_write_26201 mce_write 3 26201 NULL ++_scsih_change_queue_depth_26230 _scsih_change_queue_depth 2 26230 NULL ++cxio_num_stags_26233 cxio_num_stags 0 26233 NULL ++bio_split_26235 bio_split 2 26235 NULL ++crypto_ctxsize_26278 crypto_ctxsize 0 26278 NULL ++wacom_set_device_mode_26280 wacom_set_device_mode 3 26280 NULL ++ext2_find_goal_26306 ext2_find_goal 0 26306 NULL ++snd_pcm_plug_client_channels_buf_26309 snd_pcm_plug_client_channels_buf 0-3 26309 NULL nohasharray ++pax_get_random_long_26309 pax_get_random_long 0 26309 &snd_pcm_plug_client_channels_buf_26309 ++pwr_wake_on_host_read_26321 pwr_wake_on_host_read 3 26321 NULL ++ocfs2_duplicate_clusters_by_page_26357 ocfs2_duplicate_clusters_by_page 5 26357 NULL ++cifs_readdata_alloc_26360 cifs_readdata_alloc 1 26360 NULL ++dup_to_netobj_26363 dup_to_netobj 3 26363 NULL ++invalidate_inode_pages2_range_26403 invalidate_inode_pages2_range 0 26403 NULL ++virtio_has_feature_26467 virtio_has_feature 0 26467 NULL ++ib_alloc_device_26483 ib_alloc_device 1 26483 NULL ++ulong_write_file_26485 ulong_write_file 3 26485 NULL ++dvb_ca_en50221_io_ioctl_26490 dvb_ca_en50221_io_ioctl 2 26490 NULL ++read_vmcore_26501 read_vmcore 3 26501 NULL ++vfio_pci_set_msi_trigger_26507 vfio_pci_set_msi_trigger 3-4 26507 NULL ++iwl_dbgfs_rf_reset_read_26512 iwl_dbgfs_rf_reset_read 3 26512 NULL ++rds_message_inc_copy_to_user_26540 rds_message_inc_copy_to_user 3 26540 NULL ++__vhost_add_used_n_26554 __vhost_add_used_n 3 26554 NULL ++ip6_addr_string_26568 ip6_addr_string 0 26568 NULL ++rts51x_read_mem_26577 rts51x_read_mem 4 26577 NULL nohasharray ++batadv_receive_server_sync_packet_26577 batadv_receive_server_sync_packet 3 26577 &rts51x_read_mem_26577 ++cirrusfb_get_memsize_26597 cirrusfb_get_memsize 0 26597 NULL ++__unmap_single_26604 __unmap_single 2-3 26604 NULL ++iommu_alloc_26621 iommu_alloc 4 26621 NULL ++pwr_fix_tsf_ps_read_26627 pwr_fix_tsf_ps_read 3 26627 NULL ++mmap_region_26649 mmap_region 0-2 26649 NULL ++irq_alloc_generic_chip_26650 irq_alloc_generic_chip 2 26650 NULL nohasharray ++inb_p_26650 inb_p 0 26650 &irq_alloc_generic_chip_26650 ++cipso_v4_map_cat_rbm_hton_26680 cipso_v4_map_cat_rbm_hton 0 26680 NULL ++__alloc_pred_stack_26687 __alloc_pred_stack 2 26687 NULL ++rtllib_authentication_req_26713 rtllib_authentication_req 3 26713 NULL ++aty_ld_le32_26720 aty_ld_le32 0 26720 NULL ++nouveau_namedb_create__26732 nouveau_namedb_create_ 7 26732 NULL ++pipeline_tcp_rx_stat_fifo_int_read_26745 pipeline_tcp_rx_stat_fifo_int_read 3 26745 NULL ++srp_ring_alloc_26760 srp_ring_alloc 2 26760 NULL ++snd_hda_get_raw_connections_26762 snd_hda_get_raw_connections 0 26762 NULL ++ntfs_are_rl_mergeable_26777 ntfs_are_rl_mergeable 0 26777 NULL ++qlcnic_alloc_sds_rings_26795 qlcnic_alloc_sds_rings 2 26795 NULL ++cipso_v4_genopt_26812 cipso_v4_genopt 0 26812 NULL ++smk_write_load_26829 smk_write_load 3 26829 NULL ++slgt_compat_ioctl_26834 slgt_compat_ioctl 3 26834 NULL ++__nodes_onto_26838 __nodes_onto 4 26838 NULL ++scnprint_id_26842 scnprint_id 3 26842 NULL ++ecryptfs_miscdev_write_26847 ecryptfs_miscdev_write 3 26847 NULL ++netxen_nic_hw_read_wx_128M_26858 netxen_nic_hw_read_wx_128M 2 26858 NULL ++svc_print_xprts_26881 svc_print_xprts 0 26881 NULL ++ext2_compat_ioctl_26883 ext2_compat_ioctl 3 26883 NULL ++slhc_uncompress_26905 slhc_uncompress 0-3 26905 NULL ++wm8994_reg_write_26919 wm8994_reg_write 2 26919 NULL ++x25_asy_change_mtu_26928 x25_asy_change_mtu 2 26928 NULL ++compat_mtw_from_user_26932 compat_mtw_from_user 0 26932 NULL ++scsi_tgt_copy_sense_26933 scsi_tgt_copy_sense 3 26933 NULL ++pwr_ps_enter_read_26935 pwr_ps_enter_read 3 26935 NULL nohasharray ++sctp_setsockopt_adaptation_layer_26935 sctp_setsockopt_adaptation_layer 3 26935 &pwr_ps_enter_read_26935 ++carl9170_handle_mpdu_26940 carl9170_handle_mpdu 3 26940 NULL nohasharray ++create_bm_block_list_26940 create_bm_block_list 0 26940 &carl9170_handle_mpdu_26940 ++hecubafb_write_26942 hecubafb_write 3 26942 NULL ++extract_entropy_user_26952 extract_entropy_user 3 26952 NULL nohasharray ++do_trimming_26952 do_trimming 3 26952 &extract_entropy_user_26952 ++pcf857x_irq_domain_map_26998 pcf857x_irq_domain_map 2 26998 NULL ++rbd_do_op_27025 rbd_do_op 7-8 27025 NULL ++ufs_alloc_fragments_27059 ufs_alloc_fragments 3-0-2 27059 NULL ++__videobuf_alloc_vb_27062 __videobuf_alloc_vb 1 27062 NULL ++snd_pcm_lib_period_bytes_27071 snd_pcm_lib_period_bytes 0 27071 NULL ++paravirt_read_msr_27077 paravirt_read_msr 0 27077 NULL ++alloc_fdmem_27083 alloc_fdmem 1 27083 NULL ++find_first_bit_27088 find_first_bit 0-2 27088 NULL ++btmrvl_hscmd_write_27089 btmrvl_hscmd_write 3 27089 NULL ++__devcgroup_inode_permission_27108 __devcgroup_inode_permission 0 27108 NULL ++get_kernel_page_27133 get_kernel_page 0 27133 NULL ++drbd_get_capacity_27141 drbd_get_capacity 0 27141 NULL ++pms_capture_27142 pms_capture 4 27142 NULL ++btmrvl_hscfgcmd_write_27143 btmrvl_hscfgcmd_write 3 27143 NULL ++snd_compr_calc_avail_27165 snd_compr_calc_avail 0 27165 NULL ++mc13xxx_irq_handle_27166 mc13xxx_irq_handle 3 27166 NULL ++i2400m_net_rx_27170 i2400m_net_rx 5 27170 NULL ++ieee80211_if_read_rc_rateidx_mask_5ghz_27183 ieee80211_if_read_rc_rateidx_mask_5ghz 3 27183 NULL ++get_unaligned_be32_27184 get_unaligned_be32 0 27184 NULL ++mmc_blk_compat_ioctl_27194 mmc_blk_compat_ioctl 4 27194 NULL ++dbAllocAG_27228 dbAllocAG 0 27228 NULL ++rxrpc_request_key_27235 rxrpc_request_key 3 27235 NULL ++cfpkt_add_trail_27260 cfpkt_add_trail 3 27260 NULL ++__dma_map_cont_27289 __dma_map_cont 5 27289 NULL ++hpi_read_reg_27302 hpi_read_reg 0 27302 NULL ++copy_from_buf_27308 copy_from_buf 4-2 27308 NULL ++ath6kl_wmi_test_cmd_27312 ath6kl_wmi_test_cmd 3 27312 NULL ++rbd_req_sync_exec_27320 rbd_req_sync_exec 8 27320 NULL ++ocfs2_blocks_to_clusters_27327 ocfs2_blocks_to_clusters 0-2 27327 NULL ++snd_pcm_oss_write2_27332 snd_pcm_oss_write2 3-0 27332 NULL ++afs_cell_create_27346 afs_cell_create 2 27346 NULL ++pcbit_stat_27364 pcbit_stat 2 27364 NULL ++init_memory_mapping_27395 init_memory_mapping 0 27395 NULL ++phys_pte_init_27411 phys_pte_init 0-3-2 27411 NULL ++ib_dma_map_sg_27413 ib_dma_map_sg 0 27413 NULL ++acpi_os_get_root_pointer_27416 acpi_os_get_root_pointer 0 27416 NULL nohasharray ++ieee80211_if_read_smps_27416 ieee80211_if_read_smps 3 27416 &acpi_os_get_root_pointer_27416 ++pack_sg_list_27425 pack_sg_list 0-2 27425 NULL ++tps65910_reg_set_bits_27468 tps65910_reg_set_bits 2 27468 NULL ++rtsx_write_cfg_seq_27485 rtsx_write_cfg_seq 5-3 27485 NULL ++v4l2_ctrl_new_std_menu_items_27487 v4l2_ctrl_new_std_menu_items 4 27487 NULL ++set_tpl_pfs_27490 set_tpl_pfs 3 27490 NULL ++hcd_buffer_alloc_27495 hcd_buffer_alloc 2 27495 NULL ++qib_create_cq_27497 qib_create_cq 2 27497 NULL ++ip_set_get_h32_27498 ip_set_get_h32 0 27498 NULL ++btrfs_get_64_27499 btrfs_get_64 0 27499 NULL ++__usbnet_write_cmd_27500 __usbnet_write_cmd 7 27500 NULL ++garmin_read_process_27509 garmin_read_process 3 27509 NULL ++ib_copy_to_udata_27525 ib_copy_to_udata 3 27525 NULL ++snd_sonicvibes_getdmaa_27552 snd_sonicvibes_getdmaa 0 27552 NULL ++libipw_alloc_txb_27579 libipw_alloc_txb 1-2-3 27579 NULL ++read_flush_procfs_27642 read_flush_procfs 3 27642 NULL nohasharray ++nl80211_send_connect_result_27642 nl80211_send_connect_result 5-7 27642 &read_flush_procfs_27642 nohasharray ++ocfs2_xattr_ibody_get_27642 ocfs2_xattr_ibody_get 0 27642 &nl80211_send_connect_result_27642 ++add_new_gdb_27643 add_new_gdb 3 27643 NULL ++qnx6_readpages_27657 qnx6_readpages 4 27657 NULL ++cdrom_read_cdda_old_27664 cdrom_read_cdda_old 4 27664 NULL ++set_bypass_pwoff_pfs_27669 set_bypass_pwoff_pfs 3 27669 NULL ++qword_get_27670 qword_get 0 27670 NULL ++ocfs2_extend_dir_27695 ocfs2_extend_dir 4 27695 NULL ++__tty_buffer_request_room_27700 __tty_buffer_request_room 2 27700 NULL ++fs_path_add_from_extent_buffer_27702 fs_path_add_from_extent_buffer 4 27702 NULL ++evm_write_key_27715 evm_write_key 3 27715 NULL ++ieee80211_if_fmt_dot11MeshGateAnnouncementProtocol_27722 ieee80211_if_fmt_dot11MeshGateAnnouncementProtocol 3 27722 NULL ++reg_w_buf_27724 reg_w_buf 3 27724 NULL ++xfs_dir2_block_sfsize_27727 xfs_dir2_block_sfsize 0 27727 NULL ++a4t_cs_init_27734 a4t_cs_init 3 27734 NULL ++kcalloc_27770 kcalloc 1-2 27770 NULL ++twl4030_set_gpio_dataout_27792 twl4030_set_gpio_dataout 1 27792 NULL ++DivaSTraceGetMemotyRequirement_27797 DivaSTraceGetMemotyRequirement 0-1 27797 NULL ++ttm_object_file_init_27804 ttm_object_file_init 2 27804 NULL ++mpihelp_mul_27805 mpihelp_mul 5-3 27805 NULL ++fwtty_buffer_rx_27821 fwtty_buffer_rx 3 27821 NULL ++init_header_complete_27833 init_header_complete 0 27833 NULL nohasharray ++sys_listxattr_27833 sys_listxattr 3 27833 &init_header_complete_27833 ++read_profile_27859 read_profile 3 27859 NULL ++sky2_pci_read16_27863 sky2_pci_read16 0 27863 NULL ++ieee80211_if_read_dot11MeshHWMProotInterval_27873 ieee80211_if_read_dot11MeshHWMProotInterval 3 27873 NULL ++unix_seqpacket_sendmsg_27893 unix_seqpacket_sendmsg 4 27893 NULL ++gluebi_write_27905 gluebi_write 3 27905 NULL ++mc13783_set_sysclk_27914 mc13783_set_sysclk 5 27914 NULL ++bm_find_next_27929 bm_find_next 2 27929 NULL ++tracing_clock_write_27961 tracing_clock_write 3 27961 NULL ++tipc_media_addr_printf_27971 tipc_media_addr_printf 2 27971 NULL ++mic_rx_pkts_read_27972 mic_rx_pkts_read 3 27972 NULL ++f2fs_bio_alloc_27983 f2fs_bio_alloc 2 27983 NULL ++edt_ft5x06_debugfs_raw_data_read_28002 edt_ft5x06_debugfs_raw_data_read 3 28002 NULL ++snd_rawmidi_write_28008 snd_rawmidi_write 3 28008 NULL ++serial8250_port_size_28019 serial8250_port_size 0 28019 NULL ++sctp_setsockopt_maxburst_28041 sctp_setsockopt_maxburst 3 28041 NULL ++rts51x_xd_rw_28046 rts51x_xd_rw 3-4 28046 NULL ++cx231xx_init_vbi_isoc_28053 cx231xx_init_vbi_isoc 3-2 28053 NULL ++pool_status_28055 pool_status 5 28055 NULL ++lpfc_idiag_mbxacc_read_28061 lpfc_idiag_mbxacc_read 3 28061 NULL ++tx_frag_bad_mblk_num_read_28064 tx_frag_bad_mblk_num_read 3 28064 NULL ++ext4_read_block_bitmap_nowait_28078 ext4_read_block_bitmap_nowait 2 28078 NULL ++GetRecvByte_28082 GetRecvByte 0 28082 NULL ++platform_get_irq_28088 platform_get_irq 0 28088 NULL ++gdth_init_isa_28091 gdth_init_isa 1 28091 NULL ++mmc_test_alloc_mem_28102 mmc_test_alloc_mem 3-2 28102 NULL ++rx_defrag_need_defrag_read_28117 rx_defrag_need_defrag_read 3 28117 NULL ++vgacon_adjust_height_28124 vgacon_adjust_height 2 28124 NULL ++video_read_28148 video_read 3 28148 NULL ++snd_midi_channel_alloc_set_28153 snd_midi_channel_alloc_set 1 28153 NULL ++stats_dot11FCSErrorCount_read_28154 stats_dot11FCSErrorCount_read 3 28154 NULL ++vread_28173 vread 0 28173 NULL ++macvtap_get_user_28185 macvtap_get_user 4 28185 NULL ++d_path_28198 d_path 0 28198 NULL ++nouveau_mxm_create__28200 nouveau_mxm_create_ 4 28200 NULL ++line6_alloc_sysex_buffer_28225 line6_alloc_sysex_buffer 4 28225 NULL nohasharray ++set_dis_disc_pfs_28225 set_dis_disc_pfs 3 28225 &line6_alloc_sysex_buffer_28225 ++amd_nb_num_28228 amd_nb_num 0 28228 NULL ++ext4_validate_block_bitmap_28243 ext4_validate_block_bitmap 3 28243 NULL ++usemap_size_28281 usemap_size 0 28281 NULL ++dma_map_sg_attrs_28289 dma_map_sg_attrs 0 28289 NULL ++acpi_register_gsi_xen_28305 acpi_register_gsi_xen 2 28305 NULL nohasharray ++nouveau_compat_ioctl_28305 nouveau_compat_ioctl 2 28305 &acpi_register_gsi_xen_28305 ++snd_pcm_oss_read_28317 snd_pcm_oss_read 3 28317 NULL ++bm_entry_write_28338 bm_entry_write 3 28338 NULL ++snapshot_write_28351 snapshot_write 3 28351 NULL ++__next_wq_cpu_28352 __next_wq_cpu 1 28352 NULL ++sys_writev_28384 sys_writev 3 28384 NULL ++dlmfs_file_read_28385 dlmfs_file_read 3 28385 NULL ++tx_frag_cache_miss_read_28394 tx_frag_cache_miss_read 3 28394 NULL ++set_bypass_pfs_28395 set_bypass_pfs 3 28395 NULL ++subdev_ioctl_28417 subdev_ioctl 2 28417 NULL ++mpage_readpages_28436 mpage_readpages 3 28436 NULL ++snd_emu10k1_efx_read_28452 snd_emu10k1_efx_read 2 28452 NULL ++key_mic_failures_read_28457 key_mic_failures_read 3 28457 NULL ++alloc_irq_cpu_rmap_28459 alloc_irq_cpu_rmap 1 28459 NULL ++vmw_du_crtc_cursor_set_28479 vmw_du_crtc_cursor_set 4-5 28479 NULL ++ocfs2_backup_super_blkno_28484 ocfs2_backup_super_blkno 0-2 28484 NULL ++max_response_pages_28492 max_response_pages 0 28492 NULL ++ps_poll_upsd_utilization_read_28519 ps_poll_upsd_utilization_read 3 28519 NULL ++__next_node_28521 __next_node 1 28521 NULL ++i2400m_tx_stats_read_28527 i2400m_tx_stats_read 3 28527 NULL ++early_init_dt_alloc_memory_arch_28528 early_init_dt_alloc_memory_arch 1 28528 NULL ++sel_read_policycap_28544 sel_read_policycap 3 28544 NULL ++run_delalloc_range_28545 run_delalloc_range 3 28545 NULL nohasharray ++mptctl_getiocinfo_28545 mptctl_getiocinfo 2 28545 &run_delalloc_range_28545 ++b43legacy_debugfs_write_28556 b43legacy_debugfs_write 3 28556 NULL ++i2o_msg_post_wait_mem_28558 i2o_msg_post_wait_mem 0 28558 NULL ++phys_pud_init_28574 phys_pud_init 0-3-2 28574 NULL ++cfg80211_send_rx_auth_28580 cfg80211_send_rx_auth 3 28580 NULL ++oxygen_read32_28582 oxygen_read32 0 28582 NULL ++ocfs2_read_dir_block_28587 ocfs2_read_dir_block 2 28587 NULL ++wm8350_clear_bits_28596 wm8350_clear_bits 2 28596 NULL ++extract_entropy_28604 extract_entropy 3-5 28604 NULL ++kfifo_unused_28612 kfifo_unused 0 28612 NULL ++mp_override_legacy_irq_28618 mp_override_legacy_irq 4 28618 NULL ++snd_nm256_capture_copy_28622 snd_nm256_capture_copy 5-3 28622 NULL ++_set_range_28627 _set_range 3 28627 NULL ++v4l2_compat_ioctl32_28630 v4l2_compat_ioctl32 3 28630 NULL ++setup_usemap_28636 setup_usemap 3-4 28636 NULL ++blk_queue_resize_tags_28670 blk_queue_resize_tags 2 28670 NULL ++__dev_alloc_skb_28681 __dev_alloc_skb 1 28681 NULL ++nl80211_send_new_peer_candidate_28692 nl80211_send_new_peer_candidate 5 28692 NULL nohasharray ++kvm_mmu_get_page_28692 kvm_mmu_get_page 2 28692 &nl80211_send_new_peer_candidate_28692 ++drm_plane_init_28731 drm_plane_init 6 28731 NULL ++spi_execute_28736 spi_execute 5 28736 NULL ++snd_pcm_aio_write_28738 snd_pcm_aio_write 3 28738 NULL nohasharray ++phantom_compat_ioctl_28738 phantom_compat_ioctl 3 28738 &snd_pcm_aio_write_28738 ++read_file_btcoex_28743 read_file_btcoex 3 28743 NULL ++cxio_init_resource_fifo_28764 cxio_init_resource_fifo 3 28764 NULL ++ath6kl_get_num_reg_28780 ath6kl_get_num_reg 0 28780 NULL ++dvb_net_sec_callback_28786 dvb_net_sec_callback 2 28786 NULL ++sel_write_member_28800 sel_write_member 3 28800 NULL ++cgroup_file_read_28804 cgroup_file_read 3 28804 NULL ++btrfs_ref_to_path_28809 btrfs_ref_to_path 0-8-3 28809 NULL ++memory_bm_create_28814 memory_bm_create 0 28814 NULL ++iwl_dbgfs_rxon_filter_flags_read_28832 iwl_dbgfs_rxon_filter_flags_read 3 28832 NULL ++vp_request_msix_vectors_28849 vp_request_msix_vectors 2 28849 NULL ++ipv6_renew_options_28867 ipv6_renew_options 5 28867 NULL ++packet_sendmsg_spkt_28885 packet_sendmsg_spkt 4 28885 NULL ++tps6586x_update_28898 tps6586x_update 2 28898 NULL ++da9055_group_write_28904 da9055_group_write 2-3 28904 NULL ++ps_upsd_timeouts_read_28924 ps_upsd_timeouts_read 3 28924 NULL ++ocfs2_frozen_trigger_28929 ocfs2_frozen_trigger 4 28929 NULL ++push_rx_28939 push_rx 3 28939 NULL ++btrfs_trim_block_group_28963 btrfs_trim_block_group 3 28963 NULL ++alloc_sched_domains_28972 alloc_sched_domains 1 28972 NULL ++ext4_mb_add_groupinfo_28988 ext4_mb_add_groupinfo 2 28988 NULL ++bin_uuid_28999 bin_uuid 3 28999 NULL ++xz_dec_init_29029 xz_dec_init 2 29029 NULL ++sys_fcntl64_29031 sys_fcntl64 3 29031 NULL ++ieee80211_if_read_ht_opmode_29044 ieee80211_if_read_ht_opmode 3 29044 NULL ++rxrpc_sendmsg_29049 rxrpc_sendmsg 4 29049 NULL ++iso_packets_buffer_init_29061 iso_packets_buffer_init 3-4 29061 NULL ++lpfc_idiag_extacc_drivr_get_29067 lpfc_idiag_extacc_drivr_get 0-3 29067 NULL ++ieee80211_probereq_get_29069 ieee80211_probereq_get 4-6 29069 NULL ++sctp_getsockopt_assoc_stats_29074 sctp_getsockopt_assoc_stats 2 29074 NULL ++mark_extents_written_29082 mark_extents_written 2 29082 NULL ++isdn_ppp_write_29109 isdn_ppp_write 4 29109 NULL ++snprintf_29125 snprintf 0 29125 NULL ++iov_shorten_29130 iov_shorten 0 29130 NULL ++pm860x_reg_write_29141 pm860x_reg_write 2 29141 NULL ++proc_scsi_write_29142 proc_scsi_write 3 29142 NULL ++reshape_ring_29147 reshape_ring 2 29147 NULL ++drm_property_create_enum_29201 drm_property_create_enum 5 29201 NULL ++wusb_prf_256_29203 wusb_prf_256 7 29203 NULL nohasharray ++alloc_group_attrs_29203 alloc_group_attrs 3 29203 &wusb_prf_256_29203 ++comedi_alloc_subdevices_29207 comedi_alloc_subdevices 2 29207 NULL ++do_shrinker_shrink_29208 do_shrinker_shrink 0 29208 NULL ++rds_iw_inc_copy_to_user_29214 rds_iw_inc_copy_to_user 3 29214 NULL ++iwl_dbgfs_temperature_read_29224 iwl_dbgfs_temperature_read 3 29224 NULL ++devm_ioremap_29235 devm_ioremap 2-3 29235 NULL ++irq_domain_add_linear_29236 irq_domain_add_linear 2 29236 NULL ++recover_peb_29238 recover_peb 6-7 29238 NULL ++security_context_to_sid_core_29248 security_context_to_sid_core 2 29248 NULL ++prism2_set_genericelement_29277 prism2_set_genericelement 3 29277 NULL ++bitmap_ord_to_pos_29279 bitmap_ord_to_pos 3 29279 NULL ++sn9c102_read_29305 sn9c102_read 3 29305 NULL ++fd_do_writev_29329 fd_do_writev 3 29329 NULL ++lo_compat_ioctl_29336 lo_compat_ioctl 4 29336 NULL ++tun_put_user_29337 tun_put_user 5 29337 NULL ++__alloc_ei_netdev_29338 __alloc_ei_netdev 1 29338 NULL ++alloc_and_copy_ftrace_hash_29368 alloc_and_copy_ftrace_hash 1 29368 NULL ++mwifiex_cfg80211_mgmt_tx_29387 mwifiex_cfg80211_mgmt_tx 7 29387 NULL ++pca953x_irq_setup_29407 pca953x_irq_setup 3 29407 NULL ++mempool_create_29437 mempool_create 1 29437 NULL ++crypto_ahash_alignmask_29445 crypto_ahash_alignmask 0 29445 NULL ++apei_exec_ctx_get_output_29457 apei_exec_ctx_get_output 0 29457 NULL ++validate_scan_freqs_29462 validate_scan_freqs 0 29462 NULL ++do_register_entry_29478 do_register_entry 4 29478 NULL ++simple_strtoul_29480 simple_strtoul 0 29480 NULL ++btmrvl_pscmd_write_29504 btmrvl_pscmd_write 3 29504 NULL ++btrfs_file_extent_disk_bytenr_29505 btrfs_file_extent_disk_bytenr 0 29505 NULL ++atk_debugfs_ggrp_read_29522 atk_debugfs_ggrp_read 3 29522 NULL ++ftrace_write_29551 ftrace_write 3 29551 NULL ++idetape_queue_rw_tail_29562 idetape_queue_rw_tail 3 29562 NULL ++leaf_dealloc_29566 leaf_dealloc 3 29566 NULL nohasharray ++alloc_empty_pages_29566 alloc_empty_pages 2 29566 &leaf_dealloc_29566 ++lbs_lowsnr_read_29571 lbs_lowsnr_read 3 29571 NULL ++pvr2_hdw_report_unlocked_29589 pvr2_hdw_report_unlocked 4 29589 NULL ++wm8903_gpio_set_29597 wm8903_gpio_set 2 29597 NULL ++slots_per_page_29601 slots_per_page 0 29601 NULL ++qla4_82xx_pci_set_window_29605 qla4_82xx_pci_set_window 0-2 29605 NULL ++nla_get_u16_29624 nla_get_u16 0 29624 NULL ++tx_frag_cache_hit_read_29639 tx_frag_cache_hit_read 3 29639 NULL ++lowmem_page_address_29649 lowmem_page_address 0 29649 NULL ++sctp_make_abort_user_29654 sctp_make_abort_user 3 29654 NULL ++br_send_bpdu_29669 br_send_bpdu 3 29669 NULL ++sisusb_write_mem_bulk_29678 sisusb_write_mem_bulk 4 29678 NULL ++sd_alloc_ctl_entry_29708 sd_alloc_ctl_entry 1 29708 NULL nohasharray ++posix_acl_from_xattr_29708 posix_acl_from_xattr 3 29708 &sd_alloc_ctl_entry_29708 ++probes_write_29711 probes_write 3 29711 NULL ++emi62_writememory_29731 emi62_writememory 4 29731 NULL ++read_cis_cache_29735 read_cis_cache 4 29735 NULL ++da9055_gpio_direction_input_29742 da9055_gpio_direction_input 2 29742 NULL ++cxio_hal_init_resource_29771 cxio_hal_init_resource 2-6-7 29771 NULL nohasharray ++ip_vs_conn_fill_param_sync_29771 ip_vs_conn_fill_param_sync 6 29771 &cxio_hal_init_resource_29771 ++dbAlloc_29794 dbAlloc 0 29794 NULL ++ext4_trim_all_free_29806 ext4_trim_all_free 4-3-2 29806 NULL ++arizona_gpio_set_29823 arizona_gpio_set 2 29823 NULL ++tcp_sendpage_29829 tcp_sendpage 4 29829 NULL ++scan_bitmap_block_29840 scan_bitmap_block 4 29840 NULL ++__probe_kernel_write_29842 __probe_kernel_write 3 29842 NULL ++kvm_read_hva_atomic_29848 kvm_read_hva_atomic 3 29848 NULL ++ipv6_setsockopt_29871 ipv6_setsockopt 5 29871 NULL ++scsi_end_request_29876 scsi_end_request 3 29876 NULL ++crypto_aead_alignmask_29885 crypto_aead_alignmask 0 29885 NULL ++nfc_targets_found_29886 nfc_targets_found 3 29886 NULL ++tps6586x_write_29894 tps6586x_write 2 29894 NULL ++check586_29914 check586 2 29914 NULL ++ext4_xattr_set_acl_29930 ext4_xattr_set_acl 4 29930 NULL ++__btrfs_getxattr_29947 __btrfs_getxattr 0 29947 NULL ++irias_add_octseq_attrib_29983 irias_add_octseq_attrib 4 29983 NULL nohasharray ++diva_os_get_context_size_29983 diva_os_get_context_size 0 29983 &irias_add_octseq_attrib_29983 ++arch_setup_dmar_msi_29992 arch_setup_dmar_msi 1 29992 NULL ++utf32_to_utf8_30028 utf32_to_utf8 0 30028 NULL ++alloc_netdev_mqs_30030 alloc_netdev_mqs 1 30030 NULL ++scsi_vpd_inquiry_30040 scsi_vpd_inquiry 4 30040 NULL ++drp_wmove_30043 drp_wmove 4 30043 NULL ++cxgbi_ddp_reserve_30091 cxgbi_ddp_reserve 4 30091 NULL ++snd_midi_channel_init_set_30092 snd_midi_channel_init_set 1 30092 NULL ++tg3_run_loopback_30093 tg3_run_loopback 2 30093 NULL ++rx_filter_data_filter_read_30098 rx_filter_data_filter_read 3 30098 NULL ++skb_pagelen_30113 skb_pagelen 0 30113 NULL ++spi_async_locked_30117 spi_async_locked 0 30117 NULL ++calgary_unmap_page_30130 calgary_unmap_page 2-3 30130 NULL ++_osd_req_sizeof_alist_header_30134 _osd_req_sizeof_alist_header 0 30134 NULL ++u_memcpya_30139 u_memcpya 2-3 30139 NULL ++cx25821_video_ioctl_30188 cx25821_video_ioctl 2 30188 NULL ++mempool_create_page_pool_30189 mempool_create_page_pool 1 30189 NULL ++drm_property_create_bitmask_30195 drm_property_create_bitmask 5 30195 NULL ++snd_pcm_playback_forward_30201 snd_pcm_playback_forward 0-2 30201 NULL ++usblp_ioctl_30203 usblp_ioctl 2 30203 NULL ++nfs_idmap_request_key_30208 nfs_idmap_request_key 3 30208 NULL ++read_4k_modal_eeprom_30212 read_4k_modal_eeprom 3 30212 NULL ++snd_ac97_pcm_assign_30218 snd_ac97_pcm_assign 2 30218 NULL ++isr_pci_pm_read_30271 isr_pci_pm_read 3 30271 NULL ++compat_readv_30273 compat_readv 3 30273 NULL ++lapic_register_intr_30279 lapic_register_intr 1 30279 NULL ++__be64_to_cpup_30283 __be64_to_cpup 0 30283 NULL ++skcipher_sendmsg_30290 skcipher_sendmsg 4 30290 NULL ++pipeline_sec_frag_swi_read_30294 pipeline_sec_frag_swi_read 3 30294 NULL ++tcp_sendmsg_30296 tcp_sendmsg 4 30296 NULL ++ext4_acl_from_disk_30320 ext4_acl_from_disk 2 30320 NULL ++generic_ptrace_pokedata_30338 generic_ptrace_pokedata 2 30338 NULL ++resource_from_user_30341 resource_from_user 3 30341 NULL ++__vmalloc_node_flags_30352 __vmalloc_node_flags 1 30352 NULL ++sys_get_mempolicy_30379 sys_get_mempolicy 3 30379 NULL ++mangle_sdp_packet_30381 mangle_sdp_packet 10 30381 NULL ++c4iw_init_resource_30393 c4iw_init_resource 2-3 30393 NULL ++get_kernel_pages_30397 get_kernel_pages 0 30397 NULL ++_drbd_bm_find_next_zero_30415 _drbd_bm_find_next_zero 2 30415 NULL ++vb2_fop_write_30420 vb2_fop_write 3 30420 NULL ++tx_tx_template_prepared_read_30424 tx_tx_template_prepared_read 3 30424 NULL ++enable_write_30456 enable_write 3 30456 NULL ++tx_tx_template_programmed_read_30461 tx_tx_template_programmed_read 3 30461 NULL ++urandom_read_30462 urandom_read 3 30462 NULL ++zoran_ioctl_30465 zoran_ioctl 2 30465 NULL ++write_head_30481 write_head 4 30481 NULL ++adu_write_30487 adu_write 3 30487 NULL ++dwc3_testmode_write_30516 dwc3_testmode_write 3 30516 NULL ++debug_debug2_read_30526 debug_debug2_read 3 30526 NULL ++batadv_dat_snoop_incoming_arp_request_30548 batadv_dat_snoop_incoming_arp_request 3 30548 NULL ++disk_expand_part_tbl_30561 disk_expand_part_tbl 2 30561 NULL ++set_le_30581 set_le 4 30581 NULL ++blk_init_tags_30592 blk_init_tags 1 30592 NULL ++i2c_hid_get_report_length_30598 i2c_hid_get_report_length 0 30598 NULL ++sgl_map_user_pages_30610 sgl_map_user_pages 2 30610 NULL ++macvtap_sendmsg_30629 macvtap_sendmsg 4 30629 NULL ++compat_raw_setsockopt_30634 compat_raw_setsockopt 5 30634 NULL ++nfsd_nrpools_30651 nfsd_nrpools 0 30651 NULL ++agp_remap_30665 agp_remap 2 30665 NULL ++jffs2_flash_read_30667 jffs2_flash_read 0 30667 NULL ++dccp_setsockopt_ccid_30701 dccp_setsockopt_ccid 4 30701 NULL ++lbs_debugfs_read_30721 lbs_debugfs_read 3 30721 NULL ++snd_nm256_playback_silence_30727 snd_nm256_playback_silence 4-3 30727 NULL ++snapshot_status_30744 snapshot_status 5 30744 NULL ++max77693_update_reg_30747 max77693_update_reg 2 30747 NULL ++tcf_csum_ipv4_udp_30777 tcf_csum_ipv4_udp 4 30777 NULL ++wm8350_read_auxadc_30780 wm8350_read_auxadc 2 30780 NULL ++smk_read_doi_30813 smk_read_doi 3 30813 NULL ++get_kobj_path_length_30831 get_kobj_path_length 0 30831 NULL ++create_subvol_30836 create_subvol 4 30836 NULL ++sctp_setsockopt_auth_chunk_30843 sctp_setsockopt_auth_chunk 3 30843 NULL ++cfg80211_rx_mgmt_30844 cfg80211_rx_mgmt 5 30844 NULL nohasharray ++twl6040_set_bits_30844 twl6040_set_bits 2 30844 &cfg80211_rx_mgmt_30844 ++hda_hwdep_ioctl_compat_30847 hda_hwdep_ioctl_compat 4 30847 NULL ++ieee80211_if_fmt_dropped_frames_no_route_30884 ieee80211_if_fmt_dropped_frames_no_route 3 30884 NULL ++f1x_match_to_this_node_30888 f1x_match_to_this_node 3 30888 NULL ++regmap_update_bits_check_30894 regmap_update_bits_check 2 30894 NULL ++iommu_map_mmio_space_30919 iommu_map_mmio_space 1 30919 NULL ++sctp_setsockopt_rtoinfo_30941 sctp_setsockopt_rtoinfo 3 30941 NULL ++tty_insert_flip_string_flags_30969 tty_insert_flip_string_flags 4 30969 NULL ++huge_page_mask_30981 huge_page_mask 0 30981 NULL ++i2400mu_rx_size_grow_30989 i2400mu_rx_size_grow 0 30989 NULL ++lbs_host_sleep_read_31013 lbs_host_sleep_read 3 31013 NULL ++phys_pmd_init_31024 phys_pmd_init 0-3-2 31024 NULL ++compat_sys_mq_timedsend_31060 compat_sys_mq_timedsend 3 31060 NULL ++lbs_failcount_read_31063 lbs_failcount_read 3 31063 NULL ++find_next_bit_le_31064 find_next_bit_le 0-2-3 31064 NULL ++sys_mincore_31079 sys_mincore 1 31079 NULL ++ttm_bo_ioremap_31082 ttm_bo_ioremap 2-3 31082 NULL ++sctp_setsockopt_context_31091 sctp_setsockopt_context 3 31091 NULL ++compat_sys_get_mempolicy_31109 compat_sys_get_mempolicy 3 31109 NULL ++depth_read_31112 depth_read 3 31112 NULL ++ssb_read16_31139 ssb_read16 0 31139 NULL ++kimage_normal_alloc_31140 kimage_normal_alloc 3 31140 NULL ++size_inside_page_31141 size_inside_page 0 31141 NULL ++w9966_v4l_read_31148 w9966_v4l_read 3 31148 NULL ++ch_do_scsi_31171 ch_do_scsi 4 31171 NULL ++acpi_ex_system_memory_space_handler_31192 acpi_ex_system_memory_space_handler 2 31192 NULL ++r592_read_fifo_pio_31198 r592_read_fifo_pio 3 31198 NULL ++mtdchar_readoob_31200 mtdchar_readoob 4 31200 NULL ++__btrfs_free_reserved_extent_31207 __btrfs_free_reserved_extent 2 31207 NULL ++cpumask_weight_31215 cpumask_weight 0 31215 NULL ++__read_reg_31216 __read_reg 0 31216 NULL ++atm_get_addr_31221 atm_get_addr 3 31221 NULL ++cyy_readb_31240 cyy_readb 0 31240 NULL ++_create_sg_bios_31244 _create_sg_bios 4 31244 NULL ++ieee80211_if_read_last_beacon_31257 ieee80211_if_read_last_beacon 3 31257 NULL ++ceph_copy_page_vector_to_user_31270 ceph_copy_page_vector_to_user 3-4 31270 NULL ++sctp_tsnmap_find_gap_ack_31272 sctp_tsnmap_find_gap_ack 3-2 31272 NULL ++uvc_simplify_fraction_31303 uvc_simplify_fraction 3 31303 NULL ++sisusbcon_scroll_31315 sisusbcon_scroll 5-2-3 31315 NULL ++futex_uaddr_31316 futex_uaddr 2 31316 NULL ++command_file_write_31318 command_file_write 3 31318 NULL ++__cpu_to_node_31345 __cpu_to_node 0 31345 NULL ++xprt_rdma_allocate_31372 xprt_rdma_allocate 2 31372 NULL ++vb2_vmalloc_get_userptr_31374 vb2_vmalloc_get_userptr 3 31374 NULL ++trace_parser_get_init_31379 trace_parser_get_init 2 31379 NULL ++inb_31388 inb 0 31388 NULL ++key_ifindex_read_31411 key_ifindex_read 3 31411 NULL ++mcs7830_set_reg_31413 mcs7830_set_reg 3 31413 NULL ++TSS_checkhmac1_31429 TSS_checkhmac1 5 31429 NULL ++snd_aw2_saa7146_get_hw_ptr_capture_31431 snd_aw2_saa7146_get_hw_ptr_capture 0 31431 NULL ++acpi_sci_ioapic_setup_31445 acpi_sci_ioapic_setup 4 31445 NULL ++opera1_xilinx_rw_31453 opera1_xilinx_rw 5 31453 NULL ++_regmap_update_bits_31456 _regmap_update_bits 2 31456 NULL ++input_get_new_minor_31464 input_get_new_minor 1 31464 NULL ++do_fcntl_31468 do_fcntl 3 31468 NULL ++xfs_btree_get_numrecs_31477 xfs_btree_get_numrecs 0 31477 NULL ++alg_setkey_31485 alg_setkey 3 31485 NULL ++rds_message_map_pages_31487 rds_message_map_pages 2 31487 NULL ++qsfp_2_read_31491 qsfp_2_read 3 31491 NULL ++__alloc_bootmem_31498 __alloc_bootmem 1 31498 NULL ++hidraw_write_31536 hidraw_write 3 31536 NULL ++mtd_div_by_eb_31543 mtd_div_by_eb 0-1 31543 NULL ++usbvision_read_31555 usbvision_read 3 31555 NULL ++normalize_31566 normalize 0-1-2 31566 NULL ++tx_frag_tkip_called_read_31575 tx_frag_tkip_called_read 3 31575 NULL ++get_max_inline_xattr_value_size_31578 get_max_inline_xattr_value_size 0 31578 NULL ++osst_write_31581 osst_write 3 31581 NULL ++snd_compr_get_avail_31584 snd_compr_get_avail 0 31584 NULL ++iwl_dbgfs_ucode_tx_stats_read_31611 iwl_dbgfs_ucode_tx_stats_read 3 31611 NULL ++mtd_get_user_prot_info_31616 mtd_get_user_prot_info 0 31616 NULL ++arvo_sysfs_read_31617 arvo_sysfs_read 6 31617 NULL ++videobuf_read_one_31637 videobuf_read_one 3 31637 NULL ++pod_alloc_sysex_buffer_31651 pod_alloc_sysex_buffer 3 31651 NULL ++xfer_secondary_pool_31661 xfer_secondary_pool 2 31661 NULL ++__lgread_31668 __lgread 4 31668 NULL ++symbol_string_31670 symbol_string 0 31670 NULL ++_usb_writeN_sync_31682 _usb_writeN_sync 4 31682 NULL ++forced_ps_read_31685 forced_ps_read 3 31685 NULL ++reiserfs_in_journal_31689 reiserfs_in_journal 3 31689 NULL ++audit_log_n_string_31705 audit_log_n_string 3 31705 NULL ++ath6kl_wmi_send_probe_response_cmd_31728 ath6kl_wmi_send_probe_response_cmd 6 31728 NULL ++utf16s_to_utf8s_31735 utf16s_to_utf8s 0 31735 NULL ++shmem_pwrite_slow_31741 shmem_pwrite_slow 3 31741 NULL ++NCR_700_change_queue_depth_31742 NCR_700_change_queue_depth 2 31742 NULL nohasharray ++input_abs_get_max_31742 input_abs_get_max 0 31742 &NCR_700_change_queue_depth_31742 ++bcm_char_read_31750 bcm_char_read 3 31750 NULL ++lm3533_led_get_pattern_reg_31752 lm3533_led_get_pattern_reg 0-2 31752 NULL ++snd_seq_device_new_31753 snd_seq_device_new 4 31753 NULL ++usblp_cache_device_id_string_31790 usblp_cache_device_id_string 0 31790 NULL ++get_count_order_31800 get_count_order 0 31800 NULL ++ecryptfs_send_message_locked_31801 ecryptfs_send_message_locked 2 31801 NULL ++isr_rx_procs_read_31804 isr_rx_procs_read 3 31804 NULL ++strnlen_user_31815 strnlen_user 0-2 31815 NULL ++sta_last_signal_read_31818 sta_last_signal_read 3 31818 NULL ++drm_mode_crtc_set_gamma_size_31881 drm_mode_crtc_set_gamma_size 2 31881 NULL ++ddb_output_write_31902 ddb_output_write 3 31902 NULL ++xattr_permission_31907 xattr_permission 0 31907 NULL ++new_dir_31919 new_dir 3 31919 NULL ++kmem_alloc_31920 kmem_alloc 1 31920 NULL ++guestwidth_to_adjustwidth_31937 guestwidth_to_adjustwidth 0-1 31937 NULL ++iov_iter_copy_from_user_31942 iov_iter_copy_from_user 4 31942 NULL ++vb2_write_31948 vb2_write 3 31948 NULL ++pvr2_ctrl_get_valname_31951 pvr2_ctrl_get_valname 4 31951 NULL ++regcache_rbtree_sync_31964 regcache_rbtree_sync 2 31964 NULL ++copy_from_user_toio_31966 copy_from_user_toio 3 31966 NULL ++mtd_add_partition_31971 mtd_add_partition 3 31971 NULL ++find_next_zero_bit_31990 find_next_zero_bit 0-2-3 31990 NULL ++tps6586x_irq_map_32002 tps6586x_irq_map 2 32002 NULL ++calc_hmac_32010 calc_hmac 3 32010 NULL ++aead_len_32021 aead_len 0 32021 NULL ++ocfs2_remove_extent_32032 ocfs2_remove_extent 4-3 32032 NULL ++posix_acl_set_32037 posix_acl_set 4 32037 NULL ++vmw_cursor_update_dmabuf_32045 vmw_cursor_update_dmabuf 3-4 32045 NULL ++sys_sched_setaffinity_32046 sys_sched_setaffinity 2 32046 NULL ++proc_scsi_devinfo_write_32064 proc_scsi_devinfo_write 3 32064 NULL ++cfg80211_send_unprot_deauth_32080 cfg80211_send_unprot_deauth 3 32080 NULL ++bio_alloc_32095 bio_alloc 2 32095 NULL ++alloc_pwms_32100 alloc_pwms 1-2 32100 NULL ++ath6kl_fwlog_read_32101 ath6kl_fwlog_read 3 32101 NULL ++disk_status_32120 disk_status 4 32120 NULL ++rc5t583_write_32124 rc5t583_write 2 32124 NULL ++venus_link_32165 venus_link 5 32165 NULL ++drbd_new_dev_size_32171 drbd_new_dev_size 0 32171 NULL ++do_writepages_32173 do_writepages 0 32173 NULL nohasharray ++ntfs_rl_realloc_nofail_32173 ntfs_rl_realloc_nofail 3 32173 &do_writepages_32173 ++load_header_32183 load_header 0 32183 NULL ++ubi_wl_scrub_peb_32196 ubi_wl_scrub_peb 0 32196 NULL ++wusb_ccm_mac_32199 wusb_ccm_mac 7 32199 NULL ++riva_get_cmap_len_32218 riva_get_cmap_len 0 32218 NULL ++lm3533_write_32236 lm3533_write 2 32236 NULL ++lbs_lowrssi_read_32242 lbs_lowrssi_read 3 32242 NULL ++ocfs2_xattr_find_entry_32260 ocfs2_xattr_find_entry 0 32260 NULL ++fb_compat_ioctl_32265 fb_compat_ioctl 3 32265 NULL ++vmalloc_user_32308 vmalloc_user 1 32308 NULL ++hex_string_32310 hex_string 0 32310 NULL ++flakey_status_32315 flakey_status 5 32315 NULL ++nouveau_bar_create__32332 nouveau_bar_create_ 4 32332 NULL ++nl80211_send_mlme_event_32337 nl80211_send_mlme_event 4 32337 NULL ++t4_alloc_mem_32342 t4_alloc_mem 1 32342 NULL ++dispatch_ioctl_32357 dispatch_ioctl 2 32357 NULL ++f1x_translate_sysaddr_to_cs_32359 f1x_translate_sysaddr_to_cs 2 32359 NULL ++sel_read_initcon_32362 sel_read_initcon 3 32362 NULL ++_drbd_bm_find_next_32372 _drbd_bm_find_next 2 32372 NULL ++variax_set_raw2_32374 variax_set_raw2 4 32374 NULL ++usbtmc_read_32377 usbtmc_read 3 32377 NULL ++qla4_82xx_pci_mem_write_2M_32398 qla4_82xx_pci_mem_write_2M 2 32398 NULL ++xfs_iext_add_indirect_multi_32400 xfs_iext_add_indirect_multi 3 32400 NULL ++log_text_32428 log_text 0 32428 NULL ++regmap_irq_map_32429 regmap_irq_map 2 32429 NULL ++hid_input_report_32458 hid_input_report 4 32458 NULL ++snd_pcm_sync_ptr_32461 snd_pcm_sync_ptr 0 32461 NULL ++ieee80211_fill_mesh_addresses_32465 ieee80211_fill_mesh_addresses 0 32465 NULL ++ide_driver_proc_write_32493 ide_driver_proc_write 3 32493 NULL ++ctrl_std_val_to_sym_32516 ctrl_std_val_to_sym 5 32516 NULL ++disconnect_32521 disconnect 4 32521 NULL ++qsfp_read_32522 qsfp_read 0-4-2 32522 NULL ++ilo_read_32531 ilo_read 3 32531 NULL ++ieee80211_if_read_estab_plinks_32533 ieee80211_if_read_estab_plinks 3 32533 NULL nohasharray ++crypt_status_32533 crypt_status 5 32533 &ieee80211_if_read_estab_plinks_32533 ++format_devstat_counter_32550 format_devstat_counter 3 32550 NULL ++__first_node_32558 __first_node 0 32558 NULL ++aes_encrypt_fail_read_32562 aes_encrypt_fail_read 3 32562 NULL ++pnp_mem_len_32584 pnp_mem_len 0 32584 NULL ++mem_swapout_entry_32586 mem_swapout_entry 3 32586 NULL ++pipeline_tcp_tx_stat_fifo_int_read_32589 pipeline_tcp_tx_stat_fifo_int_read 3 32589 NULL ++read_file_beacon_32595 read_file_beacon 3 32595 NULL ++ieee80211_if_read_dropped_frames_congestion_32603 ieee80211_if_read_dropped_frames_congestion 3 32603 NULL ++sys_set_mempolicy_32608 sys_set_mempolicy 3 32608 NULL ++cfg80211_roamed_32632 cfg80211_roamed 5-7 32632 NULL ++ieee80211_hdrlen_32637 ieee80211_hdrlen 0 32637 NULL ++ite_decode_bytes_32642 ite_decode_bytes 3 32642 NULL ++kvmalloc_32646 kvmalloc 1 32646 NULL ++ib_sg_dma_len_32649 ib_sg_dma_len 0 32649 NULL ++generic_readlink_32654 generic_readlink 3 32654 NULL ++move_addr_to_kernel_32673 move_addr_to_kernel 2 32673 NULL ++tps80031_set_bits_32686 tps80031_set_bits 3 32686 NULL ++jfs_readpages_32702 jfs_readpages 4 32702 NULL ++snd_hwdep_ioctl_compat_32736 snd_hwdep_ioctl_compat 3 32736 NULL ++megasas_change_queue_depth_32747 megasas_change_queue_depth 2 32747 NULL ++stats_read_ul_32751 stats_read_ul 3 32751 NULL ++tty_compat_ioctl_32761 tty_compat_ioctl 3 32761 NULL ++sctp_tsnmap_grow_32784 sctp_tsnmap_grow 2 32784 NULL ++firmwareUpload_32794 firmwareUpload 3 32794 NULL ++rproc_name_read_32805 rproc_name_read 3 32805 NULL ++vga_rseq_32848 vga_rseq 0 32848 NULL ++new_tape_buffer_32866 new_tape_buffer 2 32866 NULL ++io_apic_setup_irq_pin_32868 io_apic_setup_irq_pin 1 32868 NULL ++ath6kl_usb_submit_ctrl_in_32880 ath6kl_usb_submit_ctrl_in 6 32880 NULL nohasharray ++cifs_writedata_alloc_32880 cifs_writedata_alloc 1 32880 &ath6kl_usb_submit_ctrl_in_32880 ++ath6kl_usb_post_recv_transfers_32892 ath6kl_usb_post_recv_transfers 2 32892 NULL ++il_dbgfs_tx_stats_read_32913 il_dbgfs_tx_stats_read 3 32913 NULL ++zlib_inflate_workspacesize_32927 zlib_inflate_workspacesize 0 32927 NULL ++rmap_recycle_32938 rmap_recycle 3 32938 NULL ++irq_reserve_irqs_32946 irq_reserve_irqs 1-2 32946 NULL ++ext4_valid_block_bitmap_32958 ext4_valid_block_bitmap 3 32958 NULL ++arch_ptrace_32981 arch_ptrace 3 32981 NULL ++compat_filldir_32999 compat_filldir 3 32999 NULL ++ext3_alloc_blocks_33007 ext3_alloc_blocks 3 33007 NULL ++snd_pcm_prepare_33036 snd_pcm_prepare 0 33036 NULL ++pipeline_dec_packet_in_fifo_full_read_33052 pipeline_dec_packet_in_fifo_full_read 3 33052 NULL ++ebt_compat_match_offset_33053 ebt_compat_match_offset 0-2 33053 NULL ++bitmap_resize_33054 bitmap_resize 2 33054 NULL ++stats_dot11RTSSuccessCount_read_33065 stats_dot11RTSSuccessCount_read 3 33065 NULL ++sel_read_checkreqprot_33068 sel_read_checkreqprot 3 33068 NULL ++acl_permission_check_33083 acl_permission_check 0 33083 NULL ++ieee80211_fragment_33112 ieee80211_fragment 4 33112 NULL ++write_node_33121 write_node 4 33121 NULL ++calc_patch_size_33124 calc_patch_size 0 33124 NULL ++fb_sys_write_33130 fb_sys_write 3 33130 NULL ++debug_debug6_read_33168 debug_debug6_read 3 33168 NULL ++dataflash_read_fact_otp_33204 dataflash_read_fact_otp 2-3 33204 NULL ++pp_read_33210 pp_read 3 33210 NULL ++xfs_file_aio_write_33234 xfs_file_aio_write 4 33234 NULL ++snd_pcm_plug_client_size_33267 snd_pcm_plug_client_size 0-2 33267 NULL ++sched_find_first_bit_33270 sched_find_first_bit 0 33270 NULL ++cachefiles_cook_key_33274 cachefiles_cook_key 2 33274 NULL ++mei_compat_ioctl_33275 mei_compat_ioctl 3 33275 NULL ++pcf50633_irq_mask_33280 pcf50633_irq_mask 2 33280 NULL ++mcs7830_get_reg_33308 mcs7830_get_reg 3 33308 NULL ++ath6kl_usb_ctrl_msg_exchange_33327 ath6kl_usb_ctrl_msg_exchange 4 33327 NULL ++gsm_mux_rx_netchar_33336 gsm_mux_rx_netchar 3 33336 NULL ++joydev_ioctl_33343 joydev_ioctl 2 33343 NULL ++create_xattr_datum_33356 create_xattr_datum 5 33356 NULL nohasharray ++irq_pkt_threshold_read_33356 irq_pkt_threshold_read 3 33356 &create_xattr_datum_33356 ++read_file_regidx_33370 read_file_regidx 3 33370 NULL ++ceph_osdc_writepages_33375 ceph_osdc_writepages 5 33375 NULL ++ocfs2_quota_read_33382 ocfs2_quota_read 5 33382 NULL ++ieee80211_if_read_dropped_frames_no_route_33383 ieee80211_if_read_dropped_frames_no_route 3 33383 NULL ++scsi_varlen_cdb_length_33385 scsi_varlen_cdb_length 0 33385 NULL ++ocfs2_allocate_unwritten_extents_33394 ocfs2_allocate_unwritten_extents 2-3 33394 NULL ++ext4_meta_bg_first_block_no_33408 ext4_meta_bg_first_block_no 2 33408 NULL nohasharray ++snd_pcm_capture_ioctl1_33408 snd_pcm_capture_ioctl1 0 33408 &ext4_meta_bg_first_block_no_33408 ++ufs_getfrag_block_33409 ufs_getfrag_block 2 33409 NULL ++ubh_scanc_33436 ubh_scanc 0-4-3 33436 NULL ++ovs_vport_alloc_33475 ovs_vport_alloc 1 33475 NULL ++create_entry_33479 create_entry 2 33479 NULL ++ip_setsockopt_33487 ip_setsockopt 5 33487 NULL nohasharray ++elf_map_33487 elf_map 0-2 33487 &ip_setsockopt_33487 ++netxen_nic_hw_write_wx_128M_33488 netxen_nic_hw_write_wx_128M 2 33488 NULL ++ol_dqblk_chunk_off_33489 ol_dqblk_chunk_off 2 33489 NULL ++res_counter_read_33499 res_counter_read 4 33499 NULL ++fb_read_33506 fb_read 3 33506 NULL ++musb_test_mode_write_33518 musb_test_mode_write 3 33518 NULL ++ahash_setkey_unaligned_33521 ahash_setkey_unaligned 3 33521 NULL ++nes_alloc_fast_reg_page_list_33523 nes_alloc_fast_reg_page_list 2 33523 NULL ++aggr_size_rx_size_read_33526 aggr_size_rx_size_read 3 33526 NULL ++acpi_gsi_to_irq_33533 acpi_gsi_to_irq 1 33533 NULL ++tomoyo_read_self_33539 tomoyo_read_self 3 33539 NULL ++dup_array_33551 dup_array 3 33551 NULL ++solo_enc_read_33553 solo_enc_read 3 33553 NULL ++count_subheaders_33591 count_subheaders 0 33591 NULL ++scsi_execute_33596 scsi_execute 5 33596 NULL ++comedi_buf_write_n_allocated_33604 comedi_buf_write_n_allocated 0 33604 NULL ++xt_compat_target_offset_33608 xt_compat_target_offset 0 33608 NULL nohasharray ++ip6_find_1stfragopt_33608 ip6_find_1stfragopt 0 33608 &xt_compat_target_offset_33608 ++il_dbgfs_qos_read_33615 il_dbgfs_qos_read 3 33615 NULL ++irq_blk_threshold_read_33666 irq_blk_threshold_read 3 33666 NULL ++inw_p_33668 inw_p 0 33668 NULL ++arp_hdr_len_33671 arp_hdr_len 0 33671 NULL ++i2c_hid_alloc_buffers_33673 i2c_hid_alloc_buffers 2 33673 NULL ++ath6kl_wmi_startscan_cmd_33674 ath6kl_wmi_startscan_cmd 8 33674 NULL ++rbd_alloc_coll_33678 rbd_alloc_coll 1 33678 NULL ++nv50_disp_dmac_create__33696 nv50_disp_dmac_create_ 6 33696 NULL ++compat_insnlist_33706 compat_insnlist 2 33706 NULL ++sys_keyctl_33708 sys_keyctl 4 33708 NULL nohasharray ++netlink_sendmsg_33708 netlink_sendmsg 4 33708 &sys_keyctl_33708 ++tipc_link_stats_33716 tipc_link_stats 3 33716 NULL ++pvr2_stream_buffer_count_33719 pvr2_stream_buffer_count 2 33719 NULL ++ocfs2_extent_map_get_blocks_33720 ocfs2_extent_map_get_blocks 2 33720 NULL ++__mutex_lock_interruptible_slowpath_33735 __mutex_lock_interruptible_slowpath 0 33735 NULL ++Read_hfc_33755 Read_hfc 0 33755 NULL ++vifs_state_read_33762 vifs_state_read 3 33762 NULL ++hashtab_create_33769 hashtab_create 3 33769 NULL ++midibuf_message_length_33770 midibuf_message_length 0 33770 NULL ++if_sdio_read_rx_len_33800 if_sdio_read_rx_len 0 33800 NULL ++find_next_offset_33804 find_next_offset 3 33804 NULL ++sky2_rx_pad_33819 sky2_rx_pad 0 33819 NULL ++sep_create_msgarea_context_33829 sep_create_msgarea_context 4 33829 NULL ++scrub_setup_recheck_block_33831 scrub_setup_recheck_block 5-4 33831 NULL ++udplite_manip_pkt_33832 udplite_manip_pkt 4 33832 NULL ++snd_pcm_action_nonatomic_33844 snd_pcm_action_nonatomic 0 33844 NULL ++usb_dump_endpoint_descriptor_33849 usb_dump_endpoint_descriptor 0 33849 NULL ++calgary_alloc_coherent_33851 calgary_alloc_coherent 2 33851 NULL ++oz_cdev_write_33852 oz_cdev_write 3 33852 NULL ++cap_mmap_addr_33853 cap_mmap_addr 0 33853 NULL ++config_proc_write_33878 config_proc_write 3 33878 NULL ++get_user_pages_33908 get_user_pages 0 33908 NULL ++queue_logical_block_size_33918 queue_logical_block_size 0 33918 NULL ++sel_read_avc_cache_threshold_33942 sel_read_avc_cache_threshold 3 33942 NULL ++lpfc_idiag_ctlacc_read_33943 lpfc_idiag_ctlacc_read 3 33943 NULL ++read_file_tgt_rx_stats_33944 read_file_tgt_rx_stats 3 33944 NULL ++vga_switcheroo_debugfs_write_33984 vga_switcheroo_debugfs_write 3 33984 NULL ++__ntfs_malloc_34022 __ntfs_malloc 1 34022 NULL ++ppp_write_34034 ppp_write 3 34034 NULL ++tty_insert_flip_string_34042 tty_insert_flip_string 3 34042 NULL ++__domain_flush_pages_34045 __domain_flush_pages 2-3 34045 NULL ++acpi_dev_get_irqresource_34064 acpi_dev_get_irqresource 2 34064 NULL ++memcg_update_all_caches_34068 memcg_update_all_caches 1 34068 NULL ++read_file_ant_diversity_34071 read_file_ant_diversity 3 34071 NULL ++show_risefalltime_34084 show_risefalltime 4 34084 NULL ++compat_hdio_ioctl_34088 compat_hdio_ioctl 4 34088 NULL ++pipeline_pipeline_fifo_full_read_34095 pipeline_pipeline_fifo_full_read 3 34095 NULL ++islpci_mgt_transmit_34133 islpci_mgt_transmit 5 34133 NULL ++ttm_dma_page_pool_free_34135 ttm_dma_page_pool_free 2 34135 NULL ++cdc_mbim_process_dgram_34136 cdc_mbim_process_dgram 3 34136 NULL ++ixgbe_dbg_netdev_ops_write_34141 ixgbe_dbg_netdev_ops_write 3 34141 NULL ++shmem_pread_fast_34147 shmem_pread_fast 3 34147 NULL ++skb_to_sgvec_34171 skb_to_sgvec 0 34171 NULL ++ext4_da_write_begin_34215 ext4_da_write_begin 3-4 34215 NULL ++bl_pipe_downcall_34264 bl_pipe_downcall 3 34264 NULL ++pcf857x_to_irq_34273 pcf857x_to_irq 2 34273 NULL ++zone_spanned_pages_in_node_34299 zone_spanned_pages_in_node 0 34299 NULL ++iov_iter_single_seg_count_34326 iov_iter_single_seg_count 0 34326 NULL nohasharray ++pcpu_need_to_extend_34326 pcpu_need_to_extend 0 34326 &iov_iter_single_seg_count_34326 ++crypto_ablkcipher_ivsize_34363 crypto_ablkcipher_ivsize 0 34363 NULL ++rngapi_reset_34366 rngapi_reset 3 34366 NULL nohasharray ++p54_alloc_skb_34366 p54_alloc_skb 3 34366 &rngapi_reset_34366 ++reiserfs_resize_34377 reiserfs_resize 2 34377 NULL ++ea_read_34378 ea_read 0 34378 NULL ++av7110_vbi_write_34384 av7110_vbi_write 3 34384 NULL ++usbvision_v4l2_read_34386 usbvision_v4l2_read 3 34386 NULL ++read_rbu_image_type_34387 read_rbu_image_type 6 34387 NULL ++ivtv_read_pos_34400 ivtv_read_pos 3 34400 NULL nohasharray ++iwl_calib_set_34400 iwl_calib_set 3 34400 &ivtv_read_pos_34400 ++nl80211_send_disassoc_34424 nl80211_send_disassoc 4 34424 NULL ++usbtest_alloc_urb_34446 usbtest_alloc_urb 3-5 34446 NULL ++mwifiex_regrdwr_read_34472 mwifiex_regrdwr_read 3 34472 NULL ++line6_dumpreq_init_34473 line6_dumpreq_init 3 34473 NULL ++skcipher_sndbuf_34476 skcipher_sndbuf 0 34476 NULL ++i2o_parm_field_get_34477 i2o_parm_field_get 5 34477 NULL ++security_inode_permission_34488 security_inode_permission 0 34488 NULL ++alloc_buf_34532 alloc_buf 1 34532 NULL ++tracing_stats_read_34537 tracing_stats_read 3 34537 NULL ++hugetlbfs_read_actor_34547 hugetlbfs_read_actor 0-2-5-4 34547 NULL ++dbBackSplit_34561 dbBackSplit 0 34561 NULL ++alloc_ieee80211_rsl_34564 alloc_ieee80211_rsl 1 34564 NULL ++velocity_rx_copy_34583 velocity_rx_copy 2 34583 NULL ++init_send_hfcd_34586 init_send_hfcd 1 34586 NULL ++inet6_ifla6_size_34591 inet6_ifla6_size 0 34591 NULL ++ceph_msgpool_init_34599 ceph_msgpool_init 4 34599 NULL ++__jffs2_ref_totlen_34609 __jffs2_ref_totlen 0 34609 NULL ++__cfg80211_disconnected_34622 __cfg80211_disconnected 3 34622 NULL ++cnic_alloc_dma_34641 cnic_alloc_dma 3 34641 NULL ++nf_nat_mangle_udp_packet_34661 nf_nat_mangle_udp_packet 8-6 34661 NULL ++isr_fiqs_read_34687 isr_fiqs_read 3 34687 NULL ++port_print_34704 port_print 3 34704 NULL ++alloc_irq_and_cfg_at_34706 alloc_irq_and_cfg_at 1 34706 NULL ++ieee80211_if_read_num_sta_ps_34722 ieee80211_if_read_num_sta_ps 3 34722 NULL ++platform_list_read_file_34734 platform_list_read_file 3 34734 NULL ++reg_w_ixbuf_34736 reg_w_ixbuf 4 34736 NULL ++qib_cdev_init_34778 qib_cdev_init 1 34778 NULL ++ssd1307fb_write_array_34779 ssd1307fb_write_array 4 34779 NULL ++__copy_in_user_34790 __copy_in_user 3 34790 NULL ++drbd_get_max_capacity_34804 drbd_get_max_capacity 0 34804 NULL ++b43_debugfs_write_34838 b43_debugfs_write 3 34838 NULL ++nl_portid_hash_zalloc_34843 nl_portid_hash_zalloc 1 34843 NULL ++acpi_system_write_wakeup_device_34853 acpi_system_write_wakeup_device 3 34853 NULL ++usb_serial_generic_prepare_write_buffer_34857 usb_serial_generic_prepare_write_buffer 3 34857 NULL ++ieee80211_if_read_txpower_34871 ieee80211_if_read_txpower 3 34871 NULL ++lm3533_ctrlbank_get_reg_34886 lm3533_ctrlbank_get_reg 0-2 34886 NULL ++msg_print_text_34889 msg_print_text 0 34889 NULL ++ieee80211_if_write_34894 ieee80211_if_write 3 34894 NULL ++compat_put_uint_34905 compat_put_uint 1 34905 NULL ++__inode_permission_34925 __inode_permission 0 34925 NULL nohasharray ++btrfs_super_chunk_root_34925 btrfs_super_chunk_root 0 34925 &__inode_permission_34925 ++skb_gro_header_slow_34958 skb_gro_header_slow 2 34958 NULL ++Realloc_34961 Realloc 2 34961 NULL ++rx_rx_hdr_overflow_read_35002 rx_rx_hdr_overflow_read 3 35002 NULL ++l2cap_skbuff_fromiovec_35003 l2cap_skbuff_fromiovec 4-3 35003 NULL ++sisusb_copy_memory_35016 sisusb_copy_memory 4 35016 NULL ++coda_psdev_read_35029 coda_psdev_read 3 35029 NULL ++btmrvl_gpiogap_write_35053 btmrvl_gpiogap_write 3 35053 NULL ++pwr_connection_out_of_sync_read_35061 pwr_connection_out_of_sync_read 3 35061 NULL ++store_ifalias_35088 store_ifalias 4 35088 NULL ++__kfifo_uint_must_check_helper_35097 __kfifo_uint_must_check_helper 0-1 35097 NULL ++capi_write_35104 capi_write 3 35104 NULL nohasharray ++tx_tx_done_template_read_35104 tx_tx_done_template_read 3 35104 &capi_write_35104 ++ide_settings_proc_write_35110 ide_settings_proc_write 3 35110 NULL ++pointer_35138 pointer 0 35138 NULL ++gntdev_alloc_map_35145 gntdev_alloc_map 2 35145 NULL ++iscsi_conn_setup_35159 iscsi_conn_setup 2 35159 NULL ++ieee80211_if_read_bssid_35161 ieee80211_if_read_bssid 3 35161 NULL ++unix_stream_recvmsg_35210 unix_stream_recvmsg 4 35210 NULL ++_osd_req_alist_elem_size_35216 _osd_req_alist_elem_size 0-2 35216 NULL ++striped_read_35218 striped_read 0-2-8-3 35218 NULL nohasharray ++security_key_getsecurity_35218 security_key_getsecurity 0 35218 &striped_read_35218 ++video_register_device_no_warn_35226 video_register_device_no_warn 3 35226 NULL nohasharray ++rx_rx_cmplt_task_read_35226 rx_rx_cmplt_task_read 3 35226 &video_register_device_no_warn_35226 ++set_fd_set_35249 set_fd_set 1 35249 NULL ++ioapic_setup_resources_35255 ioapic_setup_resources 1 35255 NULL ++dma_show_regs_35266 dma_show_regs 3 35266 NULL ++irda_recvmsg_stream_35280 irda_recvmsg_stream 4 35280 NULL ++i2o_block_end_request_35282 i2o_block_end_request 3 35282 NULL ++isr_rx_rdys_read_35283 isr_rx_rdys_read 3 35283 NULL ++brcmf_sdio_forensic_read_35311 brcmf_sdio_forensic_read 3 35311 NULL nohasharray ++__btrfs_buffered_write_35311 __btrfs_buffered_write 3 35311 &brcmf_sdio_forensic_read_35311 ++tracing_read_pipe_35312 tracing_read_pipe 3 35312 NULL ++sys_setsockopt_35320 sys_setsockopt 5 35320 NULL ++new_bind_ctl_35324 new_bind_ctl 2 35324 NULL ++irq_domain_disassociate_many_35325 irq_domain_disassociate_many 2-3 35325 NULL ++fallback_on_nodma_alloc_35332 fallback_on_nodma_alloc 2 35332 NULL ++pskb_network_may_pull_35336 pskb_network_may_pull 2 35336 NULL ++ieee80211_if_fmt_ap_power_level_35347 ieee80211_if_fmt_ap_power_level 3 35347 NULL ++nouveau_devinit_create__35348 nouveau_devinit_create_ 4 35348 NULL ++hpi_alloc_control_cache_35351 hpi_alloc_control_cache 1 35351 NULL ++compat_filldir64_35354 compat_filldir64 3 35354 NULL ++rawv6_send_hdrinc_35425 rawv6_send_hdrinc 3 35425 NULL ++__set_test_and_free_35436 __set_test_and_free 2 35436 NULL ++buffer_to_user_35439 buffer_to_user 3 35439 NULL ++rdev_get_id_35454 rdev_get_id 0 35454 NULL ++i915_wedged_read_35474 i915_wedged_read 3 35474 NULL ++do_atm_ioctl_35519 do_atm_ioctl 3 35519 NULL ++async_setkey_35521 async_setkey 3 35521 NULL ++__filemap_fdatawrite_range_35528 __filemap_fdatawrite_range 0 35528 NULL ++iwl_dbgfs_bt_traffic_read_35534 iwl_dbgfs_bt_traffic_read 3 35534 NULL ++rxpipe_tx_xfr_host_int_trig_rx_data_read_35538 rxpipe_tx_xfr_host_int_trig_rx_data_read 3 35538 NULL ++ibnl_put_attr_35541 ibnl_put_attr 3 35541 NULL ++ieee80211_if_write_smps_35550 ieee80211_if_write_smps 3 35550 NULL ++ext2_acl_from_disk_35580 ext2_acl_from_disk 2 35580 NULL ++ReadZReg_35604 ReadZReg 0 35604 NULL ++kernel_readv_35617 kernel_readv 3 35617 NULL ++reiserfs_readpages_35629 reiserfs_readpages 4 35629 NULL ++scrub_stripe_35637 scrub_stripe 4-3 35637 NULL ++spi_register_board_info_35651 spi_register_board_info 2 35651 NULL ++store_debug_level_35652 store_debug_level 3 35652 NULL ++regmap_update_bits_35668 regmap_update_bits 2 35668 NULL ++rdmaltWithLock_35669 rdmaltWithLock 0 35669 NULL ++compat_sys_kexec_load_35674 compat_sys_kexec_load 2 35674 NULL ++dm_table_create_35687 dm_table_create 3 35687 NULL ++rds_page_copy_user_35691 rds_page_copy_user 4 35691 NULL ++pci_enable_sriov_35745 pci_enable_sriov 2 35745 NULL ++iwl_dbgfs_disable_ht40_read_35761 iwl_dbgfs_disable_ht40_read 3 35761 NULL ++udf_alloc_i_data_35786 udf_alloc_i_data 2 35786 NULL ++read_file_stations_35795 read_file_stations 3 35795 NULL ++pvr2_hdw_cpufw_get_35824 pvr2_hdw_cpufw_get 0-4-2 35824 NULL ++tx_tx_cmplt_read_35854 tx_tx_cmplt_read 3 35854 NULL ++mthca_buf_alloc_35861 mthca_buf_alloc 2 35861 NULL ++fls64_35862 fls64 0 35862 NULL ++kvm_dirty_bitmap_bytes_35886 kvm_dirty_bitmap_bytes 0 35886 NULL ++ieee80211_if_fmt_dot11MeshRetryTimeout_35890 ieee80211_if_fmt_dot11MeshRetryTimeout 3 35890 NULL ++uwb_rc_cmd_done_35892 uwb_rc_cmd_done 4 35892 NULL ++kernel_setsockopt_35913 kernel_setsockopt 5 35913 NULL ++vol_cdev_compat_ioctl_35923 vol_cdev_compat_ioctl 3 35923 NULL ++sctp_tsnmap_mark_35929 sctp_tsnmap_mark 2 35929 NULL ++rx_defrag_init_called_read_35935 rx_defrag_init_called_read 3 35935 NULL ++put_cmsg_compat_35937 put_cmsg_compat 4 35937 NULL ++wm8350_reg_write_35967 wm8350_reg_write 2 35967 NULL ++ext_rts51x_sd_execute_write_data_35971 ext_rts51x_sd_execute_write_data 9 35971 NULL ++ceph_buffer_new_35974 ceph_buffer_new 1 35974 NULL ++acl_alloc_35979 acl_alloc 1 35979 NULL ++generic_file_aio_read_35987 generic_file_aio_read 0 35987 NULL ++koneplus_sysfs_write_35993 koneplus_sysfs_write 6 35993 NULL ++il3945_ucode_tx_stats_read_36016 il3945_ucode_tx_stats_read 3 36016 NULL ++ubi_eba_write_leb_36029 ubi_eba_write_leb 5-6 36029 NULL ++sys_init_module_36047 sys_init_module 2 36047 NULL ++account_shadowed_36048 account_shadowed 2 36048 NULL ++gpio_power_read_36059 gpio_power_read 3 36059 NULL ++snd_pcm_playback_hw_avail_36061 snd_pcm_playback_hw_avail 0 36061 NULL ++write_emulate_36065 write_emulate 2-4 36065 NULL ++radeon_vm_num_pdes_36070 radeon_vm_num_pdes 0 36070 NULL ++ieee80211_if_fmt_peer_36071 ieee80211_if_fmt_peer 3 36071 NULL ++ext3_new_blocks_36073 ext3_new_blocks 3 36073 NULL ++ieee80211_if_write_tsf_36077 ieee80211_if_write_tsf 3 36077 NULL ++snd_pcm_plug_read_transfer_36080 snd_pcm_plug_read_transfer 0-3 36080 NULL ++vga_arb_write_36112 vga_arb_write 3 36112 NULL ++simple_xattr_alloc_36118 simple_xattr_alloc 2 36118 NULL ++compat_ptrace_request_36131 compat_ptrace_request 3-4 36131 NULL ++vmalloc_exec_36132 vmalloc_exec 1 36132 NULL ++ext3_readpages_36144 ext3_readpages 4 36144 NULL ++iwl_trans_txq_alloc_36147 iwl_trans_txq_alloc 3 36147 NULL ++alloc_vm_area_36149 alloc_vm_area 1 36149 NULL ++twl_set_36154 twl_set 2 36154 NULL ++b1_alloc_card_36155 b1_alloc_card 1 36155 NULL ++btrfs_file_extent_inline_len_36158 btrfs_file_extent_inline_len 0 36158 NULL ++snd_korg1212_copy_from_36169 snd_korg1212_copy_from 6 36169 NULL ++ubifs_read_nnode_36221 ubifs_read_nnode 0 36221 NULL ++nfqnl_mangle_36226 nfqnl_mangle 4-2 36226 NULL ++atomic_stats_read_36228 atomic_stats_read 3 36228 NULL ++viafb_iga1_odev_proc_write_36241 viafb_iga1_odev_proc_write 3 36241 NULL ++rproc_recovery_read_36245 rproc_recovery_read 3 36245 NULL ++scrub_stripe_36248 scrub_stripe 5-4 36248 NULL ++compat_sys_mbind_36256 compat_sys_mbind 5 36256 NULL ++usb_buffer_alloc_36276 usb_buffer_alloc 2 36276 NULL ++codec_reg_read_file_36280 codec_reg_read_file 3 36280 NULL ++crypto_shash_digestsize_36284 crypto_shash_digestsize 0 36284 NULL ++readahead_tree_block_36285 readahead_tree_block 3 36285 NULL ++nouveau_cli_create_36293 nouveau_cli_create 3 36293 NULL ++lpfc_debugfs_dif_err_read_36303 lpfc_debugfs_dif_err_read 3 36303 NULL ++ad7879_spi_xfer_36311 ad7879_spi_xfer 3 36311 NULL ++fat_compat_ioctl_filldir_36328 fat_compat_ioctl_filldir 3 36328 NULL ++lc_create_36332 lc_create 4 36332 NULL ++jbd2_journal_init_revoke_table_36336 jbd2_journal_init_revoke_table 1 36336 NULL ++v9fs_file_readn_36353 v9fs_file_readn 4 36353 NULL nohasharray ++xz_dec_lzma2_create_36353 xz_dec_lzma2_create 2 36353 &v9fs_file_readn_36353 ++to_sector_36361 to_sector 0-1 36361 NULL ++tunables_read_36385 tunables_read 3 36385 NULL ++afs_alloc_flat_call_36399 afs_alloc_flat_call 2-3 36399 NULL ++sctp_tsnmap_init_36446 sctp_tsnmap_init 2 36446 NULL ++alloc_etherdev_mqs_36450 alloc_etherdev_mqs 1 36450 NULL ++b43_nphy_load_samples_36481 b43_nphy_load_samples 3 36481 NULL ++tx_tx_checksum_result_read_36490 tx_tx_checksum_result_read 3 36490 NULL ++__hwahc_op_set_ptk_36510 __hwahc_op_set_ptk 5 36510 NULL ++mcam_v4l_read_36513 mcam_v4l_read 3 36513 NULL ++get_param_l_36518 get_param_l 0 36518 NULL ++ieee80211_if_read_fwded_frames_36520 ieee80211_if_read_fwded_frames 3 36520 NULL ++lguest_setup_irq_36531 lguest_setup_irq 1 36531 NULL ++crypto_aead_authsize_36537 crypto_aead_authsize 0 36537 NULL ++ssd1307fb_write_data_array_36538 ssd1307fb_write_data_array 3 36538 NULL ++cpu_type_read_36540 cpu_type_read 3 36540 NULL ++get_entry_len_36549 get_entry_len 0 36549 NULL ++__kfifo_to_user_36555 __kfifo_to_user 3 36555 NULL nohasharray ++macvtap_do_read_36555 macvtap_do_read 4 36555 &__kfifo_to_user_36555 ++btrfs_get_token_64_36572 btrfs_get_token_64 0 36572 NULL ++ssb_bus_scan_36578 ssb_bus_scan 2 36578 NULL ++__erst_read_36579 __erst_read 0 36579 NULL ++put_cmsg_36589 put_cmsg 4 36589 NULL ++pcnet32_realloc_rx_ring_36598 pcnet32_realloc_rx_ring 3 36598 NULL ++fat_ioctl_filldir_36621 fat_ioctl_filldir 3 36621 NULL ++vxge_config_vpaths_36636 vxge_config_vpaths 0 36636 NULL ++format_decode_36638 format_decode 0 36638 NULL ++ced_ioctl_36647 ced_ioctl 2 36647 NULL ++lpfc_idiag_extacc_alloc_get_36648 lpfc_idiag_extacc_alloc_get 0-3 36648 NULL ++osd_req_list_collection_objects_36664 osd_req_list_collection_objects 5 36664 NULL ++iscsi_host_alloc_36671 iscsi_host_alloc 2 36671 NULL ++ptr_to_compat_36680 ptr_to_compat 0 36680 NULL ++ext4_mb_discard_group_preallocations_36685 ext4_mb_discard_group_preallocations 2 36685 NULL ++snd_soc_update_bits_36714 snd_soc_update_bits 2 36714 NULL ++extract_icmp6_fields_36732 extract_icmp6_fields 2 36732 NULL ++snd_rawmidi_kernel_read1_36740 snd_rawmidi_kernel_read1 4 36740 NULL ++cxgbi_device_register_36746 cxgbi_device_register 1-2 36746 NULL ++ps_poll_upsd_timeouts_read_36755 ps_poll_upsd_timeouts_read 3 36755 NULL ++snd_soc_update_bits_locked_36766 snd_soc_update_bits_locked 2 36766 NULL ++ip4ip6_err_36772 ip4ip6_err 5 36772 NULL ++ptp_filter_init_36780 ptp_filter_init 2 36780 NULL ++proc_fault_inject_read_36802 proc_fault_inject_read 3 36802 NULL ++hiddev_ioctl_36816 hiddev_ioctl 2 36816 NULL ++int_hardware_entry_36833 int_hardware_entry 3 36833 NULL ++pcf50633_reg_write_36841 pcf50633_reg_write 2 36841 NULL nohasharray ++fc_change_queue_depth_36841 fc_change_queue_depth 2 36841 &pcf50633_reg_write_36841 ++keyctl_describe_key_36853 keyctl_describe_key 3 36853 NULL ++cm_write_36858 cm_write 3 36858 NULL ++tx_tx_data_programmed_read_36871 tx_tx_data_programmed_read 3 36871 NULL ++svc_setsockopt_36876 svc_setsockopt 5 36876 NULL ++ib_ucm_alloc_data_36885 ib_ucm_alloc_data 3 36885 NULL ++selinux_inode_notifysecctx_36896 selinux_inode_notifysecctx 3 36896 NULL ++lm3533_als_get_target_36905 lm3533_als_get_target 2-3 36905 NULL ++OS_kmalloc_36909 OS_kmalloc 1 36909 NULL ++crypto_blkcipher_ivsize_36944 crypto_blkcipher_ivsize 0 36944 NULL ++div_u64_36951 div_u64 0 36951 NULL ++write_leb_36957 write_leb 5 36957 NULL ++ntfs_external_attr_find_36963 ntfs_external_attr_find 0 36963 NULL ++sparse_early_mem_maps_alloc_node_36971 sparse_early_mem_maps_alloc_node 4 36971 NULL ++mc13xxx_reg_rmw_36997 mc13xxx_reg_rmw 2 36997 NULL ++drbd_new_dev_size_36998 drbd_new_dev_size 0-3 36998 NULL ++auok190xfb_write_37001 auok190xfb_write 3 37001 NULL ++setxattr_37006 setxattr 4 37006 NULL ++ieee80211_if_read_drop_unencrypted_37053 ieee80211_if_read_drop_unencrypted 3 37053 NULL ++parse_command_37079 parse_command 2 37079 NULL ++wm8994_gpio_set_37082 wm8994_gpio_set 2 37082 NULL ++pipeline_cs_rx_packet_in_read_37089 pipeline_cs_rx_packet_in_read 3 37089 NULL ++tun_get_user_37094 tun_get_user 5 37094 NULL ++has_wrprotected_page_37123 has_wrprotected_page 2-3 37123 NULL ++msg_word_37164 msg_word 0 37164 NULL ++can_set_xattr_37182 can_set_xattr 4 37182 NULL ++crypto_shash_descsize_37212 crypto_shash_descsize 0 37212 NULL ++regmap_access_read_file_37223 regmap_access_read_file 3 37223 NULL ++__do_replace_37227 __do_replace 5 37227 NULL ++rx_filter_dup_filter_read_37238 rx_filter_dup_filter_read 3 37238 NULL ++prot_queue_del_37258 prot_queue_del 0 37258 NULL ++ath6kl_wmi_set_ie_cmd_37260 ath6kl_wmi_set_ie_cmd 6 37260 NULL ++exofs_max_io_pages_37263 exofs_max_io_pages 0-2 37263 NULL ++c101_run_37279 c101_run 2 37279 NULL ++srp_target_alloc_37288 srp_target_alloc 3 37288 NULL ++jffs2_write_dirent_37311 jffs2_write_dirent 5 37311 NULL ++send_msg_37323 send_msg 4 37323 NULL ++brcmf_sdbrcm_membytes_37324 brcmf_sdbrcm_membytes 3-5 37324 NULL ++l2cap_create_connless_pdu_37327 l2cap_create_connless_pdu 3 37327 NULL ++scsi_mode_select_37330 scsi_mode_select 6 37330 NULL ++rxrpc_server_sendmsg_37331 rxrpc_server_sendmsg 4 37331 NULL ++security_inode_getsecurity_37354 security_inode_getsecurity 0 37354 NULL ++iommu_num_pages_37391 iommu_num_pages 0-1-3-2 37391 NULL ++sys_getxattr_37418 sys_getxattr 4 37418 NULL ++hci_sock_sendmsg_37420 hci_sock_sendmsg 4 37420 NULL ++acpi_os_allocate_zeroed_37422 acpi_os_allocate_zeroed 1 37422 NULL nohasharray ++find_next_bit_37422 find_next_bit 0-2-3 37422 &acpi_os_allocate_zeroed_37422 ++tty_insert_flip_string_fixed_flag_37428 tty_insert_flip_string_fixed_flag 4 37428 NULL ++iwl_print_last_event_logs_37433 iwl_print_last_event_logs 0-7-9 37433 NULL ++tcp_established_options_37450 tcp_established_options 0 37450 NULL ++brcmf_sdio_dump_console_37455 brcmf_sdio_dump_console 4 37455 NULL ++ufs_data_ptr_to_cpu_37475 ufs_data_ptr_to_cpu 0 37475 NULL ++get_est_timing_37484 get_est_timing 0 37484 NULL ++xfs_trans_read_buf_map_37487 xfs_trans_read_buf_map 5 37487 NULL ++kmem_realloc_37489 kmem_realloc 2 37489 NULL ++kvm_vcpu_compat_ioctl_37500 kvm_vcpu_compat_ioctl 3 37500 NULL ++vmalloc_32_user_37519 vmalloc_32_user 1 37519 NULL ++fault_inject_read_37534 fault_inject_read 3 37534 NULL ++hdr_size_37536 hdr_size 0 37536 NULL ++sep_create_dcb_dmatables_context_37551 sep_create_dcb_dmatables_context 6 37551 NULL nohasharray ++nf_nat_mangle_tcp_packet_37551 nf_nat_mangle_tcp_packet 6-8 37551 &sep_create_dcb_dmatables_context_37551 ++xhci_alloc_streams_37586 xhci_alloc_streams 5 37586 NULL ++mlx4_get_mgm_entry_size_37607 mlx4_get_mgm_entry_size 0 37607 NULL ++kvm_read_guest_page_mmu_37611 kvm_read_guest_page_mmu 6 37611 NULL ++alloc_fd_37637 alloc_fd 1 37637 NULL ++bio_copy_user_iov_37660 bio_copy_user_iov 4 37660 NULL ++rfcomm_sock_sendmsg_37661 rfcomm_sock_sendmsg 4 37661 NULL nohasharray ++vmw_framebuffer_dmabuf_dirty_37661 vmw_framebuffer_dmabuf_dirty 6 37661 &rfcomm_sock_sendmsg_37661 ++lnw_gpio_to_irq_37665 lnw_gpio_to_irq 2 37665 NULL ++ieee80211_if_read_rc_rateidx_mcs_mask_2ghz_37675 ieee80211_if_read_rc_rateidx_mcs_mask_2ghz 3 37675 NULL ++regmap_map_read_file_37685 regmap_map_read_file 3 37685 NULL ++nametbl_header_37698 nametbl_header 2 37698 NULL ++__le32_to_cpup_37702 __le32_to_cpup 0 37702 NULL ++soc_widget_update_bits_locked_37715 soc_widget_update_bits_locked 2 37715 NULL ++read_enabled_file_bool_37744 read_enabled_file_bool 3 37744 NULL ++ocfs2_duplicate_clusters_by_jbd_37749 ocfs2_duplicate_clusters_by_jbd 6-4-5 37749 NULL ++ocfs2_control_cfu_37750 ocfs2_control_cfu 2 37750 NULL ++ipath_cdev_init_37752 ipath_cdev_init 1 37752 NULL ++dccp_setsockopt_cscov_37766 dccp_setsockopt_cscov 2 37766 NULL ++il4965_rs_sta_dbgfs_rate_scale_data_read_37792 il4965_rs_sta_dbgfs_rate_scale_data_read 3 37792 NULL ++smk_read_logging_37804 smk_read_logging 3 37804 NULL ++deny_write_access_37813 deny_write_access 0 37813 NULL ++rx_decrypt_key_not_found_read_37820 rx_decrypt_key_not_found_read 3 37820 NULL ++bitmap_find_next_zero_area_37827 bitmap_find_next_zero_area 2-3-5-4 37827 NULL ++o2hb_debug_read_37851 o2hb_debug_read 3 37851 NULL ++xfs_dir2_block_to_sf_37868 xfs_dir2_block_to_sf 3 37868 NULL ++sys_setxattr_37880 sys_setxattr 4 37880 NULL ++lm3533_als_get_target_reg_37881 lm3533_als_get_target_reg 0-1-2 37881 NULL ++dvb_net_sec_37884 dvb_net_sec 3 37884 NULL ++max77686_irq_domain_map_37897 max77686_irq_domain_map 2 37897 NULL ++tipc_link_send_sections_fast_37920 tipc_link_send_sections_fast 4 37920 NULL ++pkt_alloc_packet_data_37928 pkt_alloc_packet_data 1 37928 NULL ++read_rbu_packet_size_37939 read_rbu_packet_size 6 37939 NULL ++fifo_alloc_37961 fifo_alloc 1 37961 NULL ++ext3_free_blocks_sb_37967 ext3_free_blocks_sb 3-4 37967 NULL ++rds_rdma_extra_size_37990 rds_rdma_extra_size 0 37990 NULL ++persistent_ram_old_size_37997 persistent_ram_old_size 0 37997 NULL ++vfs_readv_38011 vfs_readv 3 38011 NULL ++aggr_recv_addba_req_evt_38037 aggr_recv_addba_req_evt 4 38037 NULL ++klsi_105_prepare_write_buffer_38044 klsi_105_prepare_write_buffer 3 38044 NULL nohasharray ++il_dbgfs_chain_noise_read_38044 il_dbgfs_chain_noise_read 3 38044 &klsi_105_prepare_write_buffer_38044 ++_xfs_buf_alloc_38058 _xfs_buf_alloc 3 38058 NULL ++nsm_create_handle_38060 nsm_create_handle 4 38060 NULL ++alloc_ltalkdev_38071 alloc_ltalkdev 1 38071 NULL ++xfs_buf_readahead_map_38081 xfs_buf_readahead_map 3 38081 NULL ++uwb_mac_addr_print_38085 uwb_mac_addr_print 2 38085 NULL ++request_key_auth_new_38092 request_key_auth_new 3 38092 NULL ++proc_self_readlink_38094 proc_self_readlink 3 38094 NULL ++ep0_read_38095 ep0_read 3 38095 NULL ++sk_wmem_schedule_38096 sk_wmem_schedule 2 38096 NULL ++snd_pcm_oss_write_38108 snd_pcm_oss_write 3 38108 NULL ++vmw_kms_present_38130 vmw_kms_present 9 38130 NULL ++__ntfs_copy_from_user_iovec_inatomic_38153 __ntfs_copy_from_user_iovec_inatomic 3-4 38153 NULL ++kvm_clear_guest_38164 kvm_clear_guest 3-2 38164 NULL ++cdev_add_38176 cdev_add 2-3 38176 NULL ++brcmf_sdcard_recv_buf_38179 brcmf_sdcard_recv_buf 6 38179 NULL ++rt2x00debug_write_rf_38195 rt2x00debug_write_rf 3 38195 NULL ++get_ucode_user_38202 get_ucode_user 3 38202 NULL ++ext3_new_block_38208 ext3_new_block 3 38208 NULL ++stmpe_gpio_irq_map_38222 stmpe_gpio_irq_map 3 38222 NULL ++osd_req_list_partition_collections_38223 osd_req_list_partition_collections 5 38223 NULL ++vhost_net_compat_ioctl_38237 vhost_net_compat_ioctl 3 38237 NULL ++_ipw_read_reg32_38245 _ipw_read_reg32 0 38245 NULL ++snd_pcm_playback_rewind_38249 snd_pcm_playback_rewind 0-2 38249 NULL ++ieee80211_if_read_auto_open_plinks_38268 ieee80211_if_read_auto_open_plinks 3 38268 NULL nohasharray ++mthca_alloc_icm_table_38268 mthca_alloc_icm_table 4-3 38268 &ieee80211_if_read_auto_open_plinks_38268 ++verity_status_38273 verity_status 5 38273 NULL ++xfs_bmbt_to_bmdr_38275 xfs_bmbt_to_bmdr 3 38275 NULL nohasharray ++xfs_bmdr_to_bmbt_38275 xfs_bmdr_to_bmbt 5 38275 &xfs_bmbt_to_bmdr_38275 ++zd_mac_rx_38296 zd_mac_rx 3 38296 NULL ++ieee80211_send_probe_req_38307 ieee80211_send_probe_req 6-4 38307 NULL ++isr_rx_headers_read_38325 isr_rx_headers_read 3 38325 NULL ++ida_simple_get_38326 ida_simple_get 2 38326 NULL ++__snd_gf1_look8_38333 __snd_gf1_look8 0 38333 NULL ++pyra_sysfs_write_38370 pyra_sysfs_write 6 38370 NULL ++dn_sendmsg_38390 dn_sendmsg 4 38390 NULL ++get_valid_node_allowed_38412 get_valid_node_allowed 1-0 38412 NULL ++ocfs2_which_cluster_group_38413 ocfs2_which_cluster_group 2 38413 NULL ++ht_destroy_irq_38418 ht_destroy_irq 1 38418 NULL ++ieee80211_if_read_dtim_count_38419 ieee80211_if_read_dtim_count 3 38419 NULL ++asix_write_cmd_async_38420 asix_write_cmd_async 5 38420 NULL ++pcnet32_realloc_tx_ring_38428 pcnet32_realloc_tx_ring 3 38428 NULL ++pmcraid_copy_sglist_38431 pmcraid_copy_sglist 3 38431 NULL ++kvm_write_guest_38454 kvm_write_guest 4-2 38454 NULL ++i915_min_freq_read_38470 i915_min_freq_read 3 38470 NULL ++blk_end_bidi_request_38482 blk_end_bidi_request 3-4 38482 NULL ++cpu_to_mem_38501 cpu_to_mem 0 38501 NULL ++dev_names_read_38509 dev_names_read 3 38509 NULL ++iscsi_create_iface_38510 iscsi_create_iface 5 38510 NULL ++event_rx_mismatch_read_38518 event_rx_mismatch_read 3 38518 NULL ++set_queue_count_38519 set_queue_count 0 38519 NULL ++ubifs_idx_node_sz_38546 ubifs_idx_node_sz 0-2 38546 NULL ++btrfs_discard_extent_38547 btrfs_discard_extent 2 38547 NULL ++cpu_to_node_38561 cpu_to_node 0 38561 NULL ++irda_sendmsg_dgram_38563 irda_sendmsg_dgram 4 38563 NULL ++il4965_rs_sta_dbgfs_scale_table_read_38564 il4965_rs_sta_dbgfs_scale_table_read 3 38564 NULL ++_ipw_read32_38565 _ipw_read32 0 38565 NULL ++snd_nm256_playback_copy_38567 snd_nm256_playback_copy 5-3 38567 NULL ++copy_ctl_value_to_user_38587 copy_ctl_value_to_user 4 38587 NULL ++cosa_net_setup_rx_38594 cosa_net_setup_rx 2 38594 NULL ++compat_sys_ptrace_38595 compat_sys_ptrace 3-4 38595 NULL ++delay_status_38606 delay_status 5 38606 NULL ++icn_writecmd_38629 icn_writecmd 2 38629 NULL ++ext2_readpages_38640 ext2_readpages 4 38640 NULL ++cma_create_area_38642 cma_create_area 2 38642 NULL ++audit_init_entry_38644 audit_init_entry 1 38644 NULL ++mmc_send_cxd_data_38655 mmc_send_cxd_data 5 38655 NULL ++nouveau_instmem_create__38664 nouveau_instmem_create_ 4 38664 NULL ++cfg80211_send_disassoc_38678 cfg80211_send_disassoc 3 38678 NULL ++iscsit_dump_data_payload_38683 iscsit_dump_data_payload 2 38683 NULL ++ext4_wait_block_bitmap_38695 ext4_wait_block_bitmap 2 38695 NULL ++find_next_usable_block_38716 find_next_usable_block 1-3 38716 NULL ++alloc_trace_probe_38720 alloc_trace_probe 6 38720 NULL ++udf_readpages_38761 udf_readpages 4 38761 NULL ++iwl_dbgfs_thermal_throttling_read_38779 iwl_dbgfs_thermal_throttling_read 3 38779 NULL ++snd_gus_dram_write_38784 snd_gus_dram_write 4 38784 NULL ++err_decode_38804 err_decode 2 38804 NULL ++ipv6_renew_option_38813 ipv6_renew_option 3 38813 NULL ++sys_select_38827 sys_select 1 38827 NULL ++b43_txhdr_size_38832 b43_txhdr_size 0 38832 NULL ++direct_entry_38836 direct_entry 3 38836 NULL ++compat_udp_setsockopt_38840 compat_udp_setsockopt 5 38840 NULL ++interfaces_38859 interfaces 2 38859 NULL ++pci_msix_table_size_38867 pci_msix_table_size 0 38867 NULL ++sizeof_gpio_leds_priv_38882 sizeof_gpio_leds_priv 0-1 38882 NULL ++dbgfs_state_38894 dbgfs_state 3 38894 NULL ++f2fs_xattr_set_acl_38895 f2fs_xattr_set_acl 4 38895 NULL ++__fswab16_38898 __fswab16 0 38898 NULL ++process_bulk_data_command_38906 process_bulk_data_command 4 38906 NULL ++ext3_trim_all_free_38929 ext3_trim_all_free 3-4-2 38929 NULL ++sbp_count_se_tpg_luns_38943 sbp_count_se_tpg_luns 0 38943 NULL ++__ath6kl_wmi_send_mgmt_cmd_38971 __ath6kl_wmi_send_mgmt_cmd 7 38971 NULL ++usb_maxpacket_38977 usb_maxpacket 0 38977 NULL ++OSDSetBlock_38986 OSDSetBlock 4-2 38986 NULL ++udf_new_block_38999 udf_new_block 4 38999 NULL ++get_nodes_39012 get_nodes 3 39012 NULL ++twl6030_interrupt_unmask_39013 twl6030_interrupt_unmask 2 39013 NULL ++acpi_install_gpe_block_39031 acpi_install_gpe_block 4 39031 NULL ++_zd_iowrite32v_async_locked_39034 _zd_iowrite32v_async_locked 3 39034 NULL ++line6_midibuf_read_39067 line6_midibuf_read 0-3 39067 NULL ++ext4_init_block_bitmap_39071 ext4_init_block_bitmap 3 39071 NULL ++tun_get_user_39099 tun_get_user 4 39099 NULL ++tomoyo_truncate_39105 tomoyo_truncate 0 39105 NULL ++__kfifo_to_user_r_39123 __kfifo_to_user_r 3 39123 NULL ++ea_foreach_39133 ea_foreach 0 39133 NULL ++generic_permission_39150 generic_permission 0 39150 NULL ++alloc_ring_39151 alloc_ring 2-4 39151 NULL ++proc_coredump_filter_read_39153 proc_coredump_filter_read 3 39153 NULL ++create_bounce_buffer_39155 create_bounce_buffer 3 39155 NULL ++ext3_xattr_check_names_39174 ext3_xattr_check_names 0 39174 NULL ++init_list_set_39188 init_list_set 2-3 39188 NULL ++ubi_more_update_data_39189 ubi_more_update_data 4 39189 NULL ++qcam_read_bytes_39205 qcam_read_bytes 0 39205 NULL ++qla4_82xx_pci_mem_read_direct_39208 qla4_82xx_pci_mem_read_direct 2 39208 NULL ++vfio_group_fops_compat_ioctl_39219 vfio_group_fops_compat_ioctl 3 39219 NULL ++ivtv_v4l2_write_39226 ivtv_v4l2_write 3 39226 NULL ++batadv_tt_response_fill_table_39236 batadv_tt_response_fill_table 1 39236 NULL ++posix_acl_to_xattr_39237 posix_acl_to_xattr 0 39237 NULL ++drm_order_39244 drm_order 0 39244 NULL ++snd_pcm_capture_forward_39248 snd_pcm_capture_forward 0-2 39248 NULL ++r128_compat_ioctl_39250 r128_compat_ioctl 2 39250 NULL nohasharray ++pwr_cont_miss_bcns_spread_read_39250 pwr_cont_miss_bcns_spread_read 3 39250 &r128_compat_ioctl_39250 ++__skb_cow_39254 __skb_cow 2 39254 NULL ++ath6kl_wmi_set_appie_cmd_39266 ath6kl_wmi_set_appie_cmd 5 39266 NULL ++rx_filter_protection_filter_read_39282 rx_filter_protection_filter_read 3 39282 NULL ++__vmalloc_node_39308 __vmalloc_node 1 39308 NULL ++__cfg80211_connect_result_39326 __cfg80211_connect_result 4-6 39326 NULL ++wimax_msg_alloc_39343 wimax_msg_alloc 4 39343 NULL ++__cfg80211_send_deauth_39344 __cfg80211_send_deauth 3 39344 NULL ++__copy_from_user_nocache_39351 __copy_from_user_nocache 3 39351 NULL ++ide_complete_rq_39354 ide_complete_rq 3 39354 NULL ++do_write_log_from_user_39362 do_write_log_from_user 3 39362 NULL ++vortex_wtdma_getlinearpos_39371 vortex_wtdma_getlinearpos 0 39371 NULL ++regmap_name_read_file_39379 regmap_name_read_file 3 39379 NULL ++ps_poll_ps_poll_utilization_read_39383 ps_poll_ps_poll_utilization_read 3 39383 NULL ++__send_to_port_39386 __send_to_port 3 39386 NULL ++user_power_read_39414 user_power_read 3 39414 NULL ++alloc_agpphysmem_i8xx_39427 alloc_agpphysmem_i8xx 1 39427 NULL ++sys_semop_39457 sys_semop 3 39457 NULL ++setkey_unaligned_39474 setkey_unaligned 3 39474 NULL ++ieee80211_if_fmt_dot11MeshHWMPmaxPREQretries_39499 ieee80211_if_fmt_dot11MeshHWMPmaxPREQretries 3 39499 NULL ++atomic64_read_unchecked_39505 atomic64_read_unchecked 0 39505 NULL ++int_proc_write_39542 int_proc_write 3 39542 NULL ++pp_write_39554 pp_write 3 39554 NULL ++ol_dqblk_block_39558 ol_dqblk_block 0-3-2 39558 NULL ++datablob_format_39571 datablob_format 2 39571 NULL nohasharray ++ieee80211_if_read_fwded_mcast_39571 ieee80211_if_read_fwded_mcast 3 39571 &datablob_format_39571 ++handle_response_icmp_39574 handle_response_icmp 7 39574 NULL ++adau1373_set_pll_39593 adau1373_set_pll 2 39593 NULL ++mtdchar_compat_ioctl_39602 mtdchar_compat_ioctl 3 39602 NULL ++n_tty_compat_ioctl_helper_39605 n_tty_compat_ioctl_helper 4 39605 NULL ++ext_depth_39607 ext_depth 0 39607 NULL ++nfs_idmap_get_key_39616 nfs_idmap_get_key 2 39616 NULL ++sdio_readb_39618 sdio_readb 0 39618 NULL ++set_dev_class_39645 set_dev_class 4 39645 NULL nohasharray ++dm_exception_table_init_39645 dm_exception_table_init 2 39645 &set_dev_class_39645 ++snd_rme32_capture_copy_39653 snd_rme32_capture_copy 5 39653 NULL ++tcp_try_rmem_schedule_39657 tcp_try_rmem_schedule 3 39657 NULL nohasharray ++prism2_info_hostscanresults_39657 prism2_info_hostscanresults 3 39657 &tcp_try_rmem_schedule_39657 ++kvm_read_guest_cached_39666 kvm_read_guest_cached 4 39666 NULL ++v4l_stk_read_39672 v4l_stk_read 3 39672 NULL ++hsc_msg_len_get_39673 hsc_msg_len_get 0 39673 NULL ++do_surface_dirty_sou_39678 do_surface_dirty_sou 7 39678 NULL ++ftrace_pid_write_39710 ftrace_pid_write 3 39710 NULL ++tcf_csum_ipv4_tcp_39713 tcf_csum_ipv4_tcp 4 39713 NULL ++ocfs2_pages_per_cluster_39790 ocfs2_pages_per_cluster 0 39790 NULL ++security_inode_listsecurity_39812 security_inode_listsecurity 0 39812 NULL ++snd_pcm_oss_writev3_39818 snd_pcm_oss_writev3 3 39818 NULL ++sys_migrate_pages_39825 sys_migrate_pages 2 39825 NULL ++get_priv_size_39828 get_priv_size 0-1 39828 NULL ++pkt_add_39897 pkt_add 3 39897 NULL ++read_file_modal_eeprom_39909 read_file_modal_eeprom 3 39909 NULL ++gen_pool_add_virt_39913 gen_pool_add_virt 4 39913 NULL ++dw210x_op_rw_39915 dw210x_op_rw 6 39915 NULL ++aes_encrypt_interrupt_read_39919 aes_encrypt_interrupt_read 3 39919 NULL ++exofs_read_kern_39921 exofs_read_kern 6 39921 NULL nohasharray ++oom_score_adj_read_39921 oom_score_adj_read 3 39921 &exofs_read_kern_39921 ++__spi_async_39932 __spi_async 0 39932 NULL ++__get_order_39935 __get_order 0 39935 NULL ++error_error_frame_read_39947 error_error_frame_read 3 39947 NULL nohasharray ++fwnet_pd_new_39947 fwnet_pd_new 4 39947 &error_error_frame_read_39947 ++tty_prepare_flip_string_39955 tty_prepare_flip_string 3 39955 NULL ++dma_push_rx_39973 dma_push_rx 2 39973 NULL ++broadsheetfb_write_39976 broadsheetfb_write 3 39976 NULL ++mthca_array_init_39987 mthca_array_init 2 39987 NULL ++xen_hvm_config_40018 xen_hvm_config 2 40018 NULL ++nf_nat_icmpv6_reply_translation_40023 nf_nat_icmpv6_reply_translation 5 40023 NULL nohasharray ++ivtvfb_write_40023 ivtvfb_write 3 40023 &nf_nat_icmpv6_reply_translation_40023 ++ea_foreach_i_40028 ea_foreach_i 0 40028 NULL ++datablob_hmac_append_40038 datablob_hmac_append 3 40038 NULL ++regmap_add_irq_chip_40042 regmap_add_irq_chip 4 40042 NULL ++add_tty_40055 add_tty 1 40055 NULL nohasharray ++l2cap_create_iframe_pdu_40055 l2cap_create_iframe_pdu 3 40055 &add_tty_40055 ++atomic_xchg_40070 atomic_xchg 0 40070 NULL ++snd_pcm_sw_params_user_40095 snd_pcm_sw_params_user 0 40095 NULL ++gen_pool_first_fit_40110 gen_pool_first_fit 2-3-4 40110 NULL ++rbd_do_op_40128 rbd_do_op 4-5 40128 NULL ++sctp_setsockopt_delayed_ack_40129 sctp_setsockopt_delayed_ack 3 40129 NULL ++rx_rx_frame_checksum_read_40140 rx_rx_frame_checksum_read 3 40140 NULL ++iwch_alloc_fastreg_pbl_40153 iwch_alloc_fastreg_pbl 2 40153 NULL ++pt_write_40159 pt_write 3 40159 NULL ++scsi_sg_count_40182 scsi_sg_count 0 40182 NULL ++ipr_alloc_ucode_buffer_40199 ipr_alloc_ucode_buffer 1 40199 NULL nohasharray ++devnode_find_40199 devnode_find 3-2 40199 &ipr_alloc_ucode_buffer_40199 ++allocate_probes_40204 allocate_probes 1 40204 NULL ++acpi_system_write_alarm_40205 acpi_system_write_alarm 3 40205 NULL ++compat_put_long_40214 compat_put_long 1 40214 NULL ++au0828_v4l2_read_40220 au0828_v4l2_read 3 40220 NULL ++xfs_buf_read_map_40226 xfs_buf_read_map 3 40226 NULL ++osst_read_40237 osst_read 3 40237 NULL ++lpage_info_slot_40243 lpage_info_slot 1-3 40243 NULL ++ocfs2_zero_extend_get_range_40248 ocfs2_zero_extend_get_range 4 40248 NULL ++of_get_child_count_40254 of_get_child_count 0 40254 NULL ++rs_sta_dbgfs_scale_table_read_40262 rs_sta_dbgfs_scale_table_read 3 40262 NULL ++usbnet_read_cmd_40275 usbnet_read_cmd 7 40275 NULL ++rx_xfr_hint_trig_read_40283 rx_xfr_hint_trig_read 3 40283 NULL ++ubi_io_write_data_40305 ubi_io_write_data 4-5 40305 NULL ++batadv_tt_changes_fill_buff_40323 batadv_tt_changes_fill_buff 4 40323 NULL ++ib_get_mad_data_offset_40336 ib_get_mad_data_offset 0 40336 NULL ++mmio_read_40348 mmio_read 4 40348 NULL ++usb_dump_interface_40353 usb_dump_interface 0 40353 NULL ++ocfs2_release_clusters_40355 ocfs2_release_clusters 4 40355 NULL ++event_rx_mem_empty_read_40363 event_rx_mem_empty_read 3 40363 NULL ++ocfs2_check_range_for_refcount_40365 ocfs2_check_range_for_refcount 2-3 40365 NULL ++fwnet_incoming_packet_40380 fwnet_incoming_packet 3 40380 NULL ++brcmf_sdbrcm_get_image_40397 brcmf_sdbrcm_get_image 0-2 40397 NULL ++atmel_rmem16_40450 atmel_rmem16 0 40450 NULL ++tomoyo_update_policy_40458 tomoyo_update_policy 2 40458 NULL ++zd_usb_scnprint_id_40459 zd_usb_scnprint_id 0-3 40459 NULL ++batadv_hash_new_40491 batadv_hash_new 1 40491 NULL ++devcgroup_inode_permission_40492 devcgroup_inode_permission 0 40492 NULL ++tty_write_room_40495 tty_write_room 0 40495 NULL ++persistent_ram_new_40501 persistent_ram_new 1-2 40501 NULL ++sg_phys_40507 sg_phys 0 40507 NULL ++TSS_checkhmac2_40520 TSS_checkhmac2 5-7 40520 NULL ++ixgbe_dbg_reg_ops_read_40540 ixgbe_dbg_reg_ops_read 3 40540 NULL ++ima_write_policy_40548 ima_write_policy 3 40548 NULL ++esp_alloc_tmp_40558 esp_alloc_tmp 3-2 40558 NULL ++ufs_inode_getfrag_40560 ufs_inode_getfrag 2-4 40560 NULL ++arch_setup_hpet_msi_40584 arch_setup_hpet_msi 1 40584 NULL ++skge_rx_get_40598 skge_rx_get 3 40598 NULL ++get_priv_descr_and_size_40612 get_priv_descr_and_size 0 40612 NULL ++bl_mark_sectors_init_40613 bl_mark_sectors_init 2-3 40613 NULL ++cpuset_sprintf_cpulist_40627 cpuset_sprintf_cpulist 0 40627 NULL ++twl4030_kpwrite_u8_40665 twl4030_kpwrite_u8 3 40665 NULL ++__cfg80211_roamed_40668 __cfg80211_roamed 4-6 40668 NULL ++pipeline_rx_complete_stat_fifo_int_read_40671 pipeline_rx_complete_stat_fifo_int_read 3 40671 NULL ++fops_read_40672 fops_read 3 40672 NULL ++tps80031_write_40678 tps80031_write 3 40678 NULL ++nfc_hci_set_param_40697 nfc_hci_set_param 5 40697 NULL ++__seq_open_private_40715 __seq_open_private 3 40715 NULL ++xfs_iext_remove_direct_40744 xfs_iext_remove_direct 3 40744 NULL nohasharray ++find_next_zero_bit_le_40744 find_next_zero_bit_le 0-2-3 40744 &xfs_iext_remove_direct_40744 ++tps65910_irq_map_40748 tps65910_irq_map 2 40748 NULL ++security_inode_listxattr_40752 security_inode_listxattr 0 40752 NULL ++fat_generic_compat_ioctl_40755 fat_generic_compat_ioctl 3 40755 NULL ++card_send_command_40757 card_send_command 3 40757 NULL ++ad1889_readl_40765 ad1889_readl 0 40765 NULL ++pg_write_40766 pg_write 3 40766 NULL ++show_list_40775 show_list 3 40775 NULL ++kfifo_out_copy_r_40784 kfifo_out_copy_r 0-3 40784 NULL ++bitmap_weight_40791 bitmap_weight 0-2 40791 NULL ++pyra_sysfs_read_40795 pyra_sysfs_read 6 40795 NULL ++netdev_alloc_skb_ip_align_40811 netdev_alloc_skb_ip_align 2 40811 NULL ++nl80211_send_roamed_40825 nl80211_send_roamed 5-7 40825 NULL ++__mlx4_qp_reserve_range_40847 __mlx4_qp_reserve_range 2-3 40847 NULL ++ocfs2_zero_partial_clusters_40856 ocfs2_zero_partial_clusters 2-3 40856 NULL ++v9fs_file_read_40858 v9fs_file_read 3 40858 NULL ++read_file_queue_40895 read_file_queue 3 40895 NULL ++waiters_read_40902 waiters_read 3 40902 NULL ++isdn_add_channels_40905 isdn_add_channels 3 40905 NULL ++gfs2_ea_find_40913 gfs2_ea_find 0 40913 NULL ++vol_cdev_write_40915 vol_cdev_write 3 40915 NULL ++snd_vx_create_40948 snd_vx_create 4 40948 NULL ++skb_end_offset_40949 skb_end_offset 0 40949 NULL ++wm8994_free_irq_40951 wm8994_free_irq 2 40951 NULL ++rds_sendmsg_40976 rds_sendmsg 4 40976 NULL ++insert_old_idx_40987 insert_old_idx 0 40987 NULL ++il_dbgfs_fh_reg_read_40993 il_dbgfs_fh_reg_read 3 40993 NULL ++mac80211_format_buffer_41010 mac80211_format_buffer 2 41010 NULL ++mtd_block_isbad_41015 mtd_block_isbad 0 41015 NULL ++_req_append_segment_41031 _req_append_segment 2 41031 NULL ++mISDN_sock_sendmsg_41035 mISDN_sock_sendmsg 4 41035 NULL ++ocfs2_xattr_index_block_find_41040 ocfs2_xattr_index_block_find 0 41040 NULL ++vfs_listxattr_41062 vfs_listxattr 0 41062 NULL ++cfg80211_inform_bss_frame_41078 cfg80211_inform_bss_frame 4 41078 NULL ++roccat_read_41093 roccat_read 3 41093 NULL nohasharray ++nvme_map_user_pages_41093 nvme_map_user_pages 3-4 41093 &roccat_read_41093 ++dma_attach_41094 dma_attach 5-6 41094 NULL ++provide_user_output_41105 provide_user_output 3 41105 NULL ++f_audio_buffer_alloc_41110 f_audio_buffer_alloc 1 41110 NULL ++v4l2_ctrl_new_int_menu_41151 v4l2_ctrl_new_int_menu 4 41151 NULL ++tx_frag_mpdu_alloc_failed_read_41167 tx_frag_mpdu_alloc_failed_read 3 41167 NULL ++dvb_ca_write_41171 dvb_ca_write 3 41171 NULL ++ol_quota_chunk_block_41177 ol_quota_chunk_block 0-2 41177 NULL ++netif_get_num_default_rss_queues_41187 netif_get_num_default_rss_queues 0 41187 NULL ++compat_sys_process_vm_writev_41194 compat_sys_process_vm_writev 3-5 41194 NULL ++dfs_file_write_41196 dfs_file_write 3 41196 NULL ++xfs_readdir_41200 xfs_readdir 3 41200 NULL ++ocfs2_read_quota_block_41207 ocfs2_read_quota_block 2 41207 NULL ++nfs_page_array_len_41219 nfs_page_array_len 0-2-1 41219 NULL ++hiddev_compat_ioctl_41255 hiddev_compat_ioctl 2-3 41255 NULL ++erst_read_41260 erst_read 0 41260 NULL ++__fprog_create_41263 __fprog_create 2 41263 NULL ++alloc_context_41283 alloc_context 1 41283 NULL ++arch_gnttab_map_shared_41306 arch_gnttab_map_shared 3 41306 NULL ++twl_change_queue_depth_41342 twl_change_queue_depth 2 41342 NULL ++cnic_init_id_tbl_41354 cnic_init_id_tbl 2 41354 NULL ++jbd2_alloc_41359 jbd2_alloc 1 41359 NULL ++kmp_init_41373 kmp_init 2 41373 NULL ++isr_commands_read_41398 isr_commands_read 3 41398 NULL ++sys_flistxattr_41407 sys_flistxattr 3 41407 NULL ++rx_defrag_decrypt_failed_read_41411 rx_defrag_decrypt_failed_read 3 41411 NULL ++xfs_iext_add_41422 xfs_iext_add 3 41422 NULL ++isdn_ppp_fill_rq_41428 isdn_ppp_fill_rq 2 41428 NULL ++lbs_rdrf_read_41431 lbs_rdrf_read 3 41431 NULL ++ext4_trim_extent_41436 ext4_trim_extent 4 41436 NULL ++iio_device_alloc_41440 iio_device_alloc 1 41440 NULL ++ntfs_file_buffered_write_41442 ntfs_file_buffered_write 4-6 41442 NULL ++pcpu_build_alloc_info_41443 pcpu_build_alloc_info 1-2-3 41443 NULL ++layout_leb_in_gaps_41470 layout_leb_in_gaps 0 41470 NULL ++snd_pcm_status_41472 snd_pcm_status 0 41472 NULL ++rt2x00debug_write_rfcsr_41473 rt2x00debug_write_rfcsr 3 41473 NULL ++wep_interrupt_read_41492 wep_interrupt_read 3 41492 NULL ++hpfs_translate_name_41497 hpfs_translate_name 3 41497 NULL ++xfrm_hash_new_size_41505 xfrm_hash_new_size 0-1 41505 NULL ++ldisc_receive_41516 ldisc_receive 4 41516 NULL ++tx_tx_frame_checksum_read_41553 tx_tx_frame_checksum_read 3 41553 NULL ++ath6kl_endpoint_stats_read_41554 ath6kl_endpoint_stats_read 3 41554 NULL ++gserial_setup_41558 gserial_setup 2 41558 NULL ++nr_status_frames_41559 nr_status_frames 0-1 41559 NULL ++batadv_receive_client_update_packet_41578 batadv_receive_client_update_packet 3 41578 NULL ++rng_dev_read_41581 rng_dev_read 3 41581 NULL ++read_file_rx_chainmask_41605 read_file_rx_chainmask 3 41605 NULL ++vga_io_r_41609 vga_io_r 0 41609 NULL ++usb_endpoint_maxp_41613 usb_endpoint_maxp 0 41613 NULL ++a2mp_send_41615 a2mp_send 4 41615 NULL ++mempool_create_kmalloc_pool_41650 mempool_create_kmalloc_pool 1 41650 NULL ++rx_rx_pre_complt_read_41653 rx_rx_pre_complt_read 3 41653 NULL ++get_std_timing_41654 get_std_timing 0 41654 NULL ++squashfs_cache_init_41656 squashfs_cache_init 2 41656 NULL ++ieee80211_if_fmt_bssid_41677 ieee80211_if_fmt_bssid 3 41677 NULL ++params_period_bytes_41683 params_period_bytes 0 41683 NULL ++aac_src_ioremap_41688 aac_src_ioremap 2 41688 NULL ++bdx_tx_db_init_41719 bdx_tx_db_init 2 41719 NULL ++sys_pwritev_41722 sys_pwritev 3 41722 NULL ++get_bios_ebda_41730 get_bios_ebda 0 41730 NULL ++fillonedir_41746 fillonedir 3 41746 NULL ++ocfs2_dx_dir_rebalance_41793 ocfs2_dx_dir_rebalance 7 41793 NULL ++hsi_alloc_controller_41802 hsi_alloc_controller 1 41802 NULL ++da9052_enable_irq_41814 da9052_enable_irq 2 41814 NULL ++sco_send_frame_41815 sco_send_frame 3 41815 NULL ++ixgbe_dbg_netdev_ops_read_41839 ixgbe_dbg_netdev_ops_read 3 41839 NULL ++do_ip_setsockopt_41852 do_ip_setsockopt 5 41852 NULL ++irq_data_to_status_reg_41854 irq_data_to_status_reg 0 41854 NULL ++keyctl_instantiate_key_41855 keyctl_instantiate_key 3 41855 NULL ++ieee80211_rx_radiotap_space_41870 ieee80211_rx_radiotap_space 0 41870 NULL ++get_fdb_entries_41916 get_fdb_entries 3 41916 NULL ++ceph_get_direct_page_vector_41917 ceph_get_direct_page_vector 2 41917 NULL ++find_ge_pid_41918 find_ge_pid 1 41918 NULL ++build_inv_iotlb_pages_41922 build_inv_iotlb_pages 4-5 41922 NULL ++nfsd_getxattr_41934 nfsd_getxattr 0 41934 NULL ++ext4_da_write_inline_data_begin_41935 ext4_da_write_inline_data_begin 3-4 41935 NULL ++ocfs2_xattr_bucket_get_name_value_41949 ocfs2_xattr_bucket_get_name_value 0 41949 NULL ++portnames_read_41958 portnames_read 3 41958 NULL ++ubi_self_check_all_ff_41959 ubi_self_check_all_ff 4 41959 NULL ++dst_mtu_41969 dst_mtu 0 41969 NULL ++cx24116_writeregN_41975 cx24116_writeregN 4 41975 NULL ++ubi_io_is_bad_41983 ubi_io_is_bad 0 41983 NULL ++lguest_map_42008 lguest_map 1-2 42008 NULL ++pool_allocate_42012 pool_allocate 3 42012 NULL ++spidev_sync_read_42014 spidev_sync_read 0 42014 NULL ++acpi_ut_create_buffer_object_42030 acpi_ut_create_buffer_object 1 42030 NULL ++__hwahc_op_set_gtk_42038 __hwahc_op_set_gtk 4 42038 NULL ++irda_sendmsg_ultra_42047 irda_sendmsg_ultra 4 42047 NULL ++dma_generic_alloc_coherent_42048 dma_generic_alloc_coherent 2 42048 NULL nohasharray ++jffs2_do_link_42048 jffs2_do_link 6 42048 &dma_generic_alloc_coherent_42048 ++ps_poll_upsd_max_ap_turn_read_42050 ps_poll_upsd_max_ap_turn_read 3 42050 NULL ++InterfaceTransmitPacket_42058 InterfaceTransmitPacket 3 42058 NULL ++scsi_execute_req_42088 scsi_execute_req 5 42088 NULL ++sk_chk_filter_42095 sk_chk_filter 2 42095 NULL ++submit_inquiry_42108 submit_inquiry 3 42108 NULL ++sysfs_read_file_42113 sysfs_read_file 3 42113 NULL ++Read_hfc16_stable_42131 Read_hfc16_stable 0 42131 NULL ++v9fs_alloc_rdir_buf_42150 v9fs_alloc_rdir_buf 2 42150 NULL ++mmc_align_data_size_42161 mmc_align_data_size 0-2 42161 NULL ++read_file_base_eeprom_42168 read_file_base_eeprom 3 42168 NULL ++oprofilefs_str_to_user_42182 oprofilefs_str_to_user 3 42182 NULL ++get_znodes_to_commit_42201 get_znodes_to_commit 0 42201 NULL ++btmrvl_hsmode_write_42252 btmrvl_hsmode_write 3 42252 NULL ++rx_defrag_need_decrypt_read_42253 rx_defrag_need_decrypt_read 3 42253 NULL ++netxen_nic_map_indirect_address_128M_42257 netxen_nic_map_indirect_address_128M 2 42257 NULL ++savu_sysfs_write_42273 savu_sysfs_write 6 42273 NULL ++snd_pcm_hw_param_value_max_42280 snd_pcm_hw_param_value_max 0 42280 NULL ++sel_read_perm_42302 sel_read_perm 3 42302 NULL ++sctp_setsockopt_del_key_42304 sctp_setsockopt_del_key 3 42304 NULL nohasharray ++ulong_read_file_42304 ulong_read_file 3 42304 &sctp_setsockopt_del_key_42304 ++xfs_vm_readpages_42308 xfs_vm_readpages 4 42308 NULL ++hysdn_conf_read_42324 hysdn_conf_read 3 42324 NULL ++tcp_sync_mss_42330 tcp_sync_mss 2-0 42330 NULL ++snd_pcm_plug_alloc_42339 snd_pcm_plug_alloc 2 42339 NULL ++ide_raw_taskfile_42355 ide_raw_taskfile 4 42355 NULL ++il_dbgfs_disable_ht40_read_42386 il_dbgfs_disable_ht40_read 3 42386 NULL ++msnd_fifo_read_42406 msnd_fifo_read 0-3 42406 NULL ++krng_get_random_42420 krng_get_random 3 42420 NULL ++gsm_data_alloc_42437 gsm_data_alloc 3 42437 NULL ++key_conf_keyidx_read_42443 key_conf_keyidx_read 3 42443 NULL ++snd_pcm_action_group_42452 snd_pcm_action_group 0 42452 NULL ++tcm_loop_change_queue_depth_42454 tcm_loop_change_queue_depth 2 42454 NULL ++tc3589x_gpio_irq_get_virq_42457 tc3589x_gpio_irq_get_virq 2 42457 NULL ++ext3_valid_block_bitmap_42459 ext3_valid_block_bitmap 3 42459 NULL ++__simple_xattr_set_42474 __simple_xattr_set 4 42474 NULL ++follow_hugetlb_page_42486 follow_hugetlb_page 0-7 42486 NULL ++omfs_readpages_42490 omfs_readpages 4 42490 NULL ++brcmf_sdbrcm_bus_txctl_42492 brcmf_sdbrcm_bus_txctl 3 42492 NULL ++kvm_write_wall_clock_42520 kvm_write_wall_clock 2 42520 NULL ++smk_write_netlbladdr_42525 smk_write_netlbladdr 3 42525 NULL ++snd_emux_create_port_42533 snd_emux_create_port 3 42533 NULL ++dbAllocNear_42546 dbAllocNear 0 42546 NULL ++i915_ring_stop_read_42549 i915_ring_stop_read 3 42549 NULL nohasharray ++ath6kl_wmi_proc_events_vif_42549 ath6kl_wmi_proc_events_vif 5 42549 &i915_ring_stop_read_42549 ++iwl_print_event_log_42566 iwl_print_event_log 0-5-7 42566 NULL ++xfrm_new_hash_mask_42579 xfrm_new_hash_mask 0-1 42579 NULL ++oom_score_adj_write_42594 oom_score_adj_write 3 42594 NULL ++map_state_42602 map_state 1 42602 NULL nohasharray ++__pskb_pull_42602 __pskb_pull 2 42602 &map_state_42602 ++sys_move_pages_42626 sys_move_pages 2 42626 NULL ++ieee80211_if_fmt_dot11MeshHWMPactivePathTimeout_42635 ieee80211_if_fmt_dot11MeshHWMPactivePathTimeout 3 42635 NULL ++scsi_activate_tcq_42640 scsi_activate_tcq 2 42640 NULL ++br_mdb_rehash_42643 br_mdb_rehash 2 42643 NULL ++_regmap_raw_write_42652 _regmap_raw_write 4-2 42652 NULL ++l2tp_xmit_skb_42672 l2tp_xmit_skb 3 42672 NULL ++request_key_and_link_42693 request_key_and_link 4 42693 NULL ++vb2_read_42703 vb2_read 3 42703 NULL ++sierra_net_send_cmd_42708 sierra_net_send_cmd 3 42708 NULL ++__ocfs2_decrease_refcount_42717 __ocfs2_decrease_refcount 4 42717 NULL ++dvb_demux_ioctl_42733 dvb_demux_ioctl 2 42733 NULL ++set_aoe_iflist_42737 set_aoe_iflist 2 42737 NULL ++ax25_setsockopt_42740 ax25_setsockopt 5 42740 NULL ++xen_bind_pirq_gsi_to_irq_42750 xen_bind_pirq_gsi_to_irq 1 42750 NULL ++snd_midi_event_decode_42780 snd_midi_event_decode 0 42780 NULL ++cryptd_hash_setkey_42781 cryptd_hash_setkey 3 42781 NULL ++koneplus_sysfs_read_42792 koneplus_sysfs_read 6 42792 NULL ++ntfs_attr_extend_allocation_42796 ntfs_attr_extend_allocation 0-2 42796 NULL ++fw_device_op_compat_ioctl_42804 fw_device_op_compat_ioctl 2-3 42804 NULL ++drm_ioctl_42813 drm_ioctl 2 42813 NULL ++iwl_dbgfs_ucode_bt_stats_read_42820 iwl_dbgfs_ucode_bt_stats_read 3 42820 NULL ++set_arg_42824 set_arg 3 42824 NULL ++ocfs2_desc_bitmap_to_cluster_off_42831 ocfs2_desc_bitmap_to_cluster_off 2 42831 NULL ++xfs_buf_read_uncached_42844 xfs_buf_read_uncached 3 42844 NULL ++prandom_u32_42853 prandom_u32 0 42853 NULL ++of_property_count_strings_42863 of_property_count_strings 0 42863 NULL ++ocfs2_clusters_for_bytes_42872 ocfs2_clusters_for_bytes 0-2 42872 NULL ++pskb_expand_head_42881 pskb_expand_head 2-3 42881 NULL ++vt_compat_ioctl_42887 vt_compat_ioctl 3 42887 NULL ++tipc_port_recv_sections_42890 tipc_port_recv_sections 4 42890 NULL ++xpc_kmalloc_cacheline_aligned_42895 xpc_kmalloc_cacheline_aligned 1 42895 NULL ++SendTxCommandPacket_42901 SendTxCommandPacket 3 42901 NULL ++hd_end_request_42904 hd_end_request 2 42904 NULL ++sta_last_rx_rate_read_42909 sta_last_rx_rate_read 3 42909 NULL ++sctp_getsockopt_maxburst_42941 sctp_getsockopt_maxburst 2 42941 NULL ++get_unmapped_area_42944 get_unmapped_area 0 42944 NULL ++sys_sethostname_42962 sys_sethostname 2 42962 NULL ++read_file_node_stat_42964 read_file_node_stat 3 42964 NULL ++compat_udpv6_setsockopt_42981 compat_udpv6_setsockopt 5 42981 NULL ++snd_timer_user_ioctl_compat_42985 snd_timer_user_ioctl_compat 3 42985 NULL ++nfs_idmap_get_desc_42990 nfs_idmap_get_desc 4-2 42990 NULL ++mlx4_qp_reserve_range_43000 mlx4_qp_reserve_range 2-3 43000 NULL ++isr_rx_mem_overflow_read_43025 isr_rx_mem_overflow_read 3 43025 NULL ++wep_default_key_count_read_43035 wep_default_key_count_read 3 43035 NULL ++nouveau_gpuobj_create__43072 nouveau_gpuobj_create_ 9 43072 NULL ++cpuset_sprintf_memlist_43088 cpuset_sprintf_memlist 0 43088 NULL ++ieee80211_if_fmt_drop_unencrypted_43107 ieee80211_if_fmt_drop_unencrypted 3 43107 NULL ++read_file_dfs_43145 read_file_dfs 3 43145 NULL ++uuid_string_43154 uuid_string 0 43154 NULL ++usb_string_sub_43164 usb_string_sub 0 43164 NULL ++il_dbgfs_power_save_status_read_43165 il_dbgfs_power_save_status_read 3 43165 NULL ++ath6kl_set_assoc_req_ies_43185 ath6kl_set_assoc_req_ies 3 43185 NULL ++process_measurement_43190 process_measurement 0 43190 NULL ++ext4_xattr_ibody_get_43200 ext4_xattr_ibody_get 0 43200 NULL ++uio_write_43202 uio_write 3 43202 NULL ++iso_callback_43208 iso_callback 3 43208 NULL ++f2fs_acl_from_disk_43210 f2fs_acl_from_disk 2 43210 NULL ++atomic_long_add_return_43217 atomic_long_add_return 1 43217 NULL ++comedi_compat_ioctl_43218 comedi_compat_ioctl 3 43218 NULL ++vmemmap_alloc_block_43245 vmemmap_alloc_block 1 43245 NULL ++fixup_leb_43256 fixup_leb 3 43256 NULL ++ide_end_rq_43269 ide_end_rq 4 43269 NULL ++evtchn_write_43278 evtchn_write 3 43278 NULL ++filemap_write_and_wait_range_43279 filemap_write_and_wait_range 0 43279 NULL ++mpage_alloc_43299 mpage_alloc 3 43299 NULL ++get_nr_irqs_gsi_43315 get_nr_irqs_gsi 0 43315 NULL ++__ext4_get_inode_loc_43332 __ext4_get_inode_loc 0 43332 NULL ++gart_free_coherent_43362 gart_free_coherent 4-2 43362 NULL ++xenfb_write_43412 xenfb_write 3 43412 NULL ++gdm_wimax_netif_rx_43423 gdm_wimax_netif_rx 3 43423 NULL nohasharray ++__alloc_bootmem_low_43423 __alloc_bootmem_low 1 43423 &gdm_wimax_netif_rx_43423 ++usb_alloc_urb_43436 usb_alloc_urb 1 43436 NULL ++ath6kl_wmi_roam_tbl_event_rx_43440 ath6kl_wmi_roam_tbl_event_rx 3 43440 NULL ++usemap_size_43443 usemap_size 0-2-1 43443 NULL nohasharray ++usb_string_43443 usb_string 0 43443 &usemap_size_43443 ++alloc_new_reservation_43480 alloc_new_reservation 4 43480 NULL ++tx_tx_data_prepared_read_43497 tx_tx_data_prepared_read 3 43497 NULL ++ieee80211_if_fmt_dot11MeshHWMPnetDiameterTraversalTime_43505 ieee80211_if_fmt_dot11MeshHWMPnetDiameterTraversalTime 3 43505 NULL ++do_readlink_43518 do_readlink 2 43518 NULL ++dvb_ca_en50221_io_write_43533 dvb_ca_en50221_io_write 3 43533 NULL ++cachefiles_daemon_write_43535 cachefiles_daemon_write 3 43535 NULL ++tx_frag_failed_read_43540 tx_frag_failed_read 3 43540 NULL nohasharray ++ufs_alloccg_block_43540 ufs_alloccg_block 3-0 43540 &tx_frag_failed_read_43540 ++ath_rx_init_43564 ath_rx_init 2 43564 NULL ++_fc_frame_alloc_43568 _fc_frame_alloc 1 43568 NULL ++rpc_malloc_43573 rpc_malloc 2 43573 NULL ++lpfc_idiag_drbacc_read_reg_43606 lpfc_idiag_drbacc_read_reg 0-3 43606 NULL ++proc_read_43614 proc_read 3 43614 NULL ++bio_integrity_tag_43658 bio_integrity_tag 3 43658 NULL ++tps65217_set_bits_43659 tps65217_set_bits 2 43659 NULL nohasharray ++ext4_acl_count_43659 ext4_acl_count 0-1 43659 &tps65217_set_bits_43659 ++dmam_declare_coherent_memory_43679 dmam_declare_coherent_memory 4-2 43679 NULL ++calgary_map_page_43686 calgary_map_page 3-4 43686 NULL ++max77693_bulk_write_43698 max77693_bulk_write 2-3 43698 NULL ++drbd_md_first_sector_43729 drbd_md_first_sector 0 43729 NULL ++snd_rme32_playback_copy_43732 snd_rme32_playback_copy 5 43732 NULL ++ocfs2_replace_clusters_43733 ocfs2_replace_clusters 5 43733 NULL ++osdv1_attr_list_elem_size_43747 osdv1_attr_list_elem_size 0-1 43747 NULL ++__bm_find_next_43748 __bm_find_next 2 43748 NULL ++gigaset_initcs_43753 gigaset_initcs 2 43753 NULL ++sctp_setsockopt_active_key_43755 sctp_setsockopt_active_key 3 43755 NULL ++ocfs2_xattr_get_value_outside_43787 ocfs2_xattr_get_value_outside 0 43787 NULL nohasharray ++byte_pos_43787 byte_pos 0-2 43787 &ocfs2_xattr_get_value_outside_43787 ++btrfs_copy_from_user_43806 btrfs_copy_from_user 3-1 43806 NULL ++ext4_read_block_bitmap_43814 ext4_read_block_bitmap 2 43814 NULL ++ieee80211_if_fmt_element_ttl_43825 ieee80211_if_fmt_element_ttl 3 43825 NULL ++ieee80211_alloc_hw_43829 ieee80211_alloc_hw 1 43829 NULL ++p54_download_eeprom_43842 p54_download_eeprom 4 43842 NULL ++read_flush_43851 read_flush 3 43851 NULL ++ocfs2_block_group_find_clear_bits_43874 ocfs2_block_group_find_clear_bits 4 43874 NULL ++pm860x_bulk_write_43875 pm860x_bulk_write 3-2 43875 NULL ++ec_dbgfs_cmd_write_43895 ec_dbgfs_cmd_write 3 43895 NULL ++prism2_sta_send_mgmt_43916 prism2_sta_send_mgmt 5 43916 NULL ++SendString_43928 SendString 3 43928 NULL ++xen_register_gsi_43946 xen_register_gsi 1-2 43946 NULL ++stats_dot11RTSFailureCount_read_43948 stats_dot11RTSFailureCount_read 3 43948 NULL ++__get_required_blob_size_43980 __get_required_blob_size 0-2-3 43980 NULL ++nla_reserve_43984 nla_reserve 3 43984 NULL ++scsi_command_size_43992 scsi_command_size 0 43992 NULL nohasharray ++bcm_recvmsg_43992 bcm_recvmsg 4 43992 &scsi_command_size_43992 ++emit_flags_44006 emit_flags 4-3 44006 NULL ++write_flush_procfs_44011 write_flush_procfs 3 44011 NULL ++xlog_recover_add_to_cont_trans_44102 xlog_recover_add_to_cont_trans 4 44102 NULL ++tracing_set_trace_read_44122 tracing_set_trace_read 3 44122 NULL ++vmw_gmr_bind_44130 vmw_gmr_bind 3 44130 NULL ++scsi_get_resid_44147 scsi_get_resid 0 44147 NULL ++ubifs_find_dirty_idx_leb_44169 ubifs_find_dirty_idx_leb 0 44169 NULL ++ocfs2_xattr_bucket_find_44174 ocfs2_xattr_bucket_find 0 44174 NULL ++handle_eviocgbit_44193 handle_eviocgbit 3 44193 NULL ++IO_APIC_get_PCI_irq_vector_44198 IO_APIC_get_PCI_irq_vector 0 44198 NULL ++__set_free_44211 __set_free 2 44211 NULL ++claim_ptd_buffers_44213 claim_ptd_buffers 3 44213 NULL ++srp_alloc_iu_44227 srp_alloc_iu 2 44227 NULL ++ioapic_register_intr_44238 ioapic_register_intr 1 44238 NULL ++scsi_track_queue_full_44239 scsi_track_queue_full 2 44239 NULL ++tc3589x_gpio_irq_map_44245 tc3589x_gpio_irq_map 2 44245 NULL ++enlarge_skb_44248 enlarge_skb 2 44248 NULL nohasharray ++xfs_buf_readahead_map_44248 xfs_buf_readahead_map 3 44248 &enlarge_skb_44248 ++ufs_clusteracct_44293 ufs_clusteracct 3 44293 NULL ++ocfs2_zero_range_for_truncate_44294 ocfs2_zero_range_for_truncate 3 44294 NULL ++ath6kl_keepalive_read_44303 ath6kl_keepalive_read 3 44303 NULL ++bitmap_scnprintf_44318 bitmap_scnprintf 0-2 44318 NULL ++dispatch_proc_write_44320 dispatch_proc_write 3 44320 NULL ++ubi_eba_write_leb_st_44343 ubi_eba_write_leb_st 5 44343 NULL ++nfs_fscache_get_super_cookie_44355 nfs_fscache_get_super_cookie 3 44355 NULL nohasharray ++blk_queue_init_tags_44355 blk_queue_init_tags 2 44355 &nfs_fscache_get_super_cookie_44355 ++rts_threshold_read_44384 rts_threshold_read 3 44384 NULL ++aoedev_flush_44398 aoedev_flush 2 44398 NULL ++drm_buffer_alloc_44405 drm_buffer_alloc 2 44405 NULL ++osst_do_scsi_44410 osst_do_scsi 4 44410 NULL ++ieee80211_if_read_rc_rateidx_mcs_mask_5ghz_44423 ieee80211_if_read_rc_rateidx_mcs_mask_5ghz 3 44423 NULL ++prandom_u32_state_44445 prandom_u32_state 0 44445 NULL ++btrfs_chunk_item_size_44478 btrfs_chunk_item_size 0-1 44478 NULL ++sdio_align_size_44489 sdio_align_size 0-2 44489 NULL ++ieee80211_if_read_dropped_frames_ttl_44500 ieee80211_if_read_dropped_frames_ttl 3 44500 NULL ++security_getprocattr_44505 security_getprocattr 0 44505 NULL nohasharray ++iwl_dbgfs_sram_read_44505 iwl_dbgfs_sram_read 3 44505 &security_getprocattr_44505 ++spidev_write_44510 spidev_write 3 44510 NULL ++sys_msgsnd_44537 sys_msgsnd 3 44537 NULL nohasharray ++comm_write_44537 comm_write 3 44537 &sys_msgsnd_44537 ++snd_pcm_drop_44542 snd_pcm_drop 0 44542 NULL ++dbg_chk_pnode_44555 dbg_chk_pnode 0 44555 NULL ++snd_pcm_alloc_vmalloc_buffer_44595 snd_pcm_alloc_vmalloc_buffer 2 44595 NULL ++slip_compat_ioctl_44599 slip_compat_ioctl 4 44599 NULL ++wm5100_gpio_set_44602 wm5100_gpio_set 2 44602 NULL ++brcmf_sdbrcm_glom_len_44618 brcmf_sdbrcm_glom_len 0 44618 NULL ++cfpkt_add_body_44630 cfpkt_add_body 3 44630 NULL ++ext2_new_block_44645 ext2_new_block 2 44645 NULL ++alloc_ctrl_packet_44667 alloc_ctrl_packet 1 44667 NULL ++mpi_resize_44674 mpi_resize 2 44674 NULL ++ts_read_44687 ts_read 3 44687 NULL ++_zd_iowrite32v_locked_44725 _zd_iowrite32v_locked 3 44725 NULL ++clusterip_proc_write_44729 clusterip_proc_write 3 44729 NULL ++fib_count_nexthops_44730 fib_count_nexthops 0 44730 NULL ++key_tx_rx_count_read_44742 key_tx_rx_count_read 3 44742 NULL ++WIL_GET_BITS_44747 WIL_GET_BITS 0-1-2-3 44747 NULL ++tnode_new_44757 tnode_new 3 44757 NULL nohasharray ++pty_write_44757 pty_write 3 44757 &tnode_new_44757 ++__videobuf_copy_stream_44769 __videobuf_copy_stream 4 44769 NULL ++handsfree_ramp_44777 handsfree_ramp 2 44777 NULL ++sctp_setsockopt_44788 sctp_setsockopt 5 44788 NULL ++rx_dropped_read_44799 rx_dropped_read 3 44799 NULL ++qla4xxx_alloc_work_44813 qla4xxx_alloc_work 2 44813 NULL ++rmap_write_protect_44833 rmap_write_protect 2 44833 NULL ++sisusb_write_44834 sisusb_write 3 44834 NULL ++nl80211_send_unprot_disassoc_44846 nl80211_send_unprot_disassoc 4 44846 NULL ++kvm_read_hva_44847 kvm_read_hva 3 44847 NULL ++skb_availroom_44883 skb_availroom 0 44883 NULL ++nf_bridge_encap_header_len_44890 nf_bridge_encap_header_len 0 44890 NULL ++do_tty_write_44896 do_tty_write 5 44896 NULL ++tx_queue_status_read_44978 tx_queue_status_read 3 44978 NULL ++nf_nat_seq_adjust_44989 nf_nat_seq_adjust 4 44989 NULL ++max77693_write_reg_45004 max77693_write_reg 2 45004 NULL ++ftdi_process_packet_45005 ftdi_process_packet 5 45005 NULL ++bytepos_delta_45017 bytepos_delta 0 45017 NULL ++read_block_bitmap_45021 read_block_bitmap 2 45021 NULL nohasharray ++ptrace_writedata_45021 ptrace_writedata 4-3 45021 &read_block_bitmap_45021 ++vhci_get_user_45039 vhci_get_user 3 45039 NULL ++sel_write_user_45060 sel_write_user 3 45060 NULL ++snd_mixart_BA0_read_45069 snd_mixart_BA0_read 5 45069 NULL nohasharray ++do_video_ioctl_45069 do_video_ioctl 3 45069 &snd_mixart_BA0_read_45069 ++kvm_mmu_page_get_gfn_45110 kvm_mmu_page_get_gfn 0-2 45110 NULL ++pwr_missing_bcns_cnt_read_45113 pwr_missing_bcns_cnt_read 3 45113 NULL ++usbdev_read_45114 usbdev_read 3 45114 NULL ++send_to_tty_45141 send_to_tty 3 45141 NULL ++stmpe_irq_map_45146 stmpe_irq_map 2 45146 NULL ++crypto_aead_blocksize_45148 crypto_aead_blocksize 0 45148 NULL ++gen_bitmask_string_45149 gen_bitmask_string 6 45149 NULL ++ocfs2_remove_inode_range_45156 ocfs2_remove_inode_range 3-4 45156 NULL nohasharray ++device_write_45156 device_write 3 45156 &ocfs2_remove_inode_range_45156 ++ocfs2_dq_frozen_trigger_45159 ocfs2_dq_frozen_trigger 4 45159 NULL ++tomoyo_write_self_45161 tomoyo_write_self 3 45161 NULL ++sta_agg_status_write_45164 sta_agg_status_write 3 45164 NULL ++snd_sb_csp_load_user_45190 snd_sb_csp_load_user 3 45190 NULL ++num_clusters_in_group_45194 num_clusters_in_group 2 45194 NULL ++add_child_45201 add_child 4 45201 NULL ++iso_alloc_urb_45206 iso_alloc_urb 4-5 45206 NULL ++spi_alloc_master_45223 spi_alloc_master 2 45223 NULL ++ieee80211_if_read_peer_45233 ieee80211_if_read_peer 3 45233 NULL ++input_mt_init_slots_45279 input_mt_init_slots 2 45279 NULL ++vcc_compat_ioctl_45291 vcc_compat_ioctl 3 45291 NULL ++snd_pcm_oss_sync1_45298 snd_pcm_oss_sync1 2 45298 NULL ++copy_vm86_regs_from_user_45340 copy_vm86_regs_from_user 3 45340 NULL ++lane2_associate_req_45398 lane2_associate_req 4 45398 NULL ++keymap_store_45406 keymap_store 4 45406 NULL ++ieee80211_if_fmt_dot11MeshHWMProotInterval_45421 ieee80211_if_fmt_dot11MeshHWMProotInterval 3 45421 NULL ++tty_buffer_alloc_45437 tty_buffer_alloc 2 45437 NULL ++do_mmap_pgoff_45441 do_mmap_pgoff 0 45441 NULL ++intel_render_ring_init_dri_45446 intel_render_ring_init_dri 2-3 45446 NULL ++__node_remap_45458 __node_remap 4 45458 NULL ++rds_ib_set_wr_signal_state_45463 rds_ib_set_wr_signal_state 0 45463 NULL ++udp_manip_pkt_45467 udp_manip_pkt 4 45467 NULL ++tracing_read_dyn_info_45468 tracing_read_dyn_info 3 45468 NULL ++snd_pcm_hwsync_45479 snd_pcm_hwsync 0 45479 NULL ++arizona_init_fll_45503 arizona_init_fll 4-5 45503 NULL ++rds_message_copy_from_user_45510 rds_message_copy_from_user 3 45510 NULL ++clone_bio_45516 clone_bio 6 45516 NULL ++sys_lgetxattr_45531 sys_lgetxattr 4 45531 NULL ++cgroup_read_u64_45532 cgroup_read_u64 5 45532 NULL ++copy_macs_45534 copy_macs 4 45534 NULL ++nla_attr_size_45545 nla_attr_size 0-1 45545 NULL ++v9fs_direct_read_45546 v9fs_direct_read 3 45546 NULL ++cx18_copy_mdl_to_user_45549 cx18_copy_mdl_to_user 4 45549 NULL ++atomic_long_sub_return_45551 atomic_long_sub_return 1 45551 NULL ++ext3_group_first_block_no_45555 ext3_group_first_block_no 0-2 45555 NULL ++stats_dot11ACKFailureCount_read_45558 stats_dot11ACKFailureCount_read 3 45558 NULL ++posix_acl_xattr_size_45561 posix_acl_xattr_size 0-1 45561 NULL ++venus_rmdir_45564 venus_rmdir 4 45564 NULL ++ipath_create_cq_45586 ipath_create_cq 2 45586 NULL ++rdma_set_ib_paths_45592 rdma_set_ib_paths 3 45592 NULL ++hidraw_get_report_45609 hidraw_get_report 3 45609 NULL ++audit_log_n_hex_45617 audit_log_n_hex 3 45617 NULL ++da9052_gpio_set_45643 da9052_gpio_set 2 45643 NULL ++ebitmap_next_positive_45651 ebitmap_next_positive 3 45651 NULL ++dma_map_cont_45668 dma_map_cont 5 45668 NULL ++compat_mpctl_ioctl_45671 compat_mpctl_ioctl 2 45671 NULL ++dgram_sendmsg_45679 dgram_sendmsg 4 45679 NULL ++smk_write_ambient_45691 smk_write_ambient 3 45691 NULL ++dm_compat_ctl_ioctl_45692 dm_compat_ctl_ioctl 3 45692 NULL ++unix_dgram_sendmsg_45699 unix_dgram_sendmsg 4 45699 NULL nohasharray ++bscnl_emit_45699 bscnl_emit 2-5-0 45699 &unix_dgram_sendmsg_45699 ++dvb_ca_en50221_init_45718 dvb_ca_en50221_init 4 45718 NULL ++snd_cs46xx_io_read_45734 snd_cs46xx_io_read 5 45734 NULL ++rw_copy_check_uvector_45748 rw_copy_check_uvector 3 45748 NULL nohasharray ++v4l2_ctrl_new_std_45748 v4l2_ctrl_new_std 5 45748 &rw_copy_check_uvector_45748 ++lkdtm_debugfs_read_45752 lkdtm_debugfs_read 3 45752 NULL ++nilfs_compat_ioctl_45769 nilfs_compat_ioctl 3 45769 NULL ++alloc_ts_config_45775 alloc_ts_config 1 45775 NULL ++raw_setsockopt_45800 raw_setsockopt 5 45800 NULL ++lbs_rdbbp_read_45805 lbs_rdbbp_read 3 45805 NULL ++pcpu_alloc_alloc_info_45813 pcpu_alloc_alloc_info 1-2 45813 NULL ++fm_v4l2_init_video_device_45821 fm_v4l2_init_video_device 2 45821 NULL ++memcg_update_cache_size_45828 memcg_update_cache_size 2 45828 NULL ++amthi_read_45831 amthi_read 4 45831 NULL ++x509_process_extension_45854 x509_process_extension 5 45854 NULL ++isdn_write_45863 isdn_write 3 45863 NULL ++rbd_get_num_segments_45864 rbd_get_num_segments 0-2-3 45864 NULL ++unpack_orig_pfns_45867 unpack_orig_pfns 0 45867 NULL ++get_rdac_req_45882 get_rdac_req 3 45882 NULL ++ocfs2_xattr_block_find_45891 ocfs2_xattr_block_find 0 45891 NULL ++dbgfs_frame_45917 dbgfs_frame 3 45917 NULL ++nf_nat_ftp_fmt_cmd_45926 nf_nat_ftp_fmt_cmd 0 45926 NULL ++alloc_mr_45935 alloc_mr 1 45935 NULL ++rb_simple_read_45972 rb_simple_read 3 45972 NULL ++ezusb_writememory_45976 ezusb_writememory 4 45976 NULL ++ioat2_dca_count_dca_slots_45984 ioat2_dca_count_dca_slots 0 45984 NULL ++sierra_setup_urb_46029 sierra_setup_urb 5 46029 NULL ++get_free_entries_46030 get_free_entries 1 46030 NULL ++__access_remote_vm_46031 __access_remote_vm 0-5-3 46031 NULL ++snd_emu10k1x_ptr_read_46049 snd_emu10k1x_ptr_read 0 46049 NULL ++acpi_register_gsi_xen_hvm_46052 acpi_register_gsi_xen_hvm 2 46052 NULL ++line6_midibuf_bytes_used_46059 line6_midibuf_bytes_used 0 46059 NULL ++__ocfs2_move_extent_46060 __ocfs2_move_extent 5-6 46060 NULL nohasharray ++dma_tx_errors_read_46060 dma_tx_errors_read 3 46060 &__ocfs2_move_extent_46060 ++slhc_toss_46066 slhc_toss 0 46066 NULL ++sel_commit_bools_write_46077 sel_commit_bools_write 3 46077 NULL ++vfio_config_do_rw_46091 vfio_config_do_rw 3 46091 NULL ++ata_host_alloc_46094 ata_host_alloc 2 46094 NULL ++arizona_set_irq_wake_46101 arizona_set_irq_wake 2 46101 NULL ++pkt_ctl_compat_ioctl_46110 pkt_ctl_compat_ioctl 3 46110 NULL ++memcg_update_array_size_46111 memcg_update_array_size 1 46111 NULL nohasharray ++il3945_ucode_general_stats_read_46111 il3945_ucode_general_stats_read 3 46111 &memcg_update_array_size_46111 ++mlx4_ib_alloc_fast_reg_page_list_46119 mlx4_ib_alloc_fast_reg_page_list 2 46119 NULL ++__netlink_change_ngroups_46156 __netlink_change_ngroups 2 46156 NULL ++qlcnic_alloc_msix_entries_46160 qlcnic_alloc_msix_entries 2 46160 NULL ++twl_direction_out_46182 twl_direction_out 2 46182 NULL ++vxge_os_dma_malloc_46184 vxge_os_dma_malloc 2 46184 NULL ++i2400m_op_msg_from_user_46213 i2400m_op_msg_from_user 4 46213 NULL ++tm6000_i2c_recv_regs_46215 tm6000_i2c_recv_regs 5 46215 NULL ++dsp_write_46218 dsp_write 2 46218 NULL ++mpi_read_raw_data_46248 mpi_read_raw_data 2 46248 NULL ++__le64_to_cpup_46257 __le64_to_cpup 0 46257 NULL ++nf_nat_ftp_46265 nf_nat_ftp 6 46265 NULL ++ReadReg_46277 ReadReg 0 46277 NULL ++batadv_iv_ogm_queue_add_46319 batadv_iv_ogm_queue_add 3 46319 NULL ++__hwahc_dev_set_key_46328 __hwahc_dev_set_key 5 46328 NULL ++twl6040_write_46351 twl6040_write 2 46351 NULL ++iwl_dbgfs_chain_noise_read_46355 iwl_dbgfs_chain_noise_read 3 46355 NULL ++smk_write_direct_46363 smk_write_direct 3 46363 NULL ++__iommu_calculate_agaw_46366 __iommu_calculate_agaw 2 46366 NULL ++ubi_dump_flash_46381 ubi_dump_flash 4 46381 NULL ++fuse_file_aio_write_46399 fuse_file_aio_write 4 46399 NULL ++crypto_ablkcipher_reqsize_46411 crypto_ablkcipher_reqsize 0 46411 NULL ++cp210x_set_config_46447 cp210x_set_config 4 46447 NULL ++filldir64_46469 filldir64 3 46469 NULL ++fill_in_write_vector_46498 fill_in_write_vector 0 46498 NULL ++pin_code_reply_46510 pin_code_reply 4 46510 NULL ++mthca_alloc_cq_buf_46512 mthca_alloc_cq_buf 3 46512 NULL ++kmsg_read_46514 kmsg_read 3 46514 NULL ++bdx_rxdb_create_46525 bdx_rxdb_create 1 46525 NULL ++nl80211_send_rx_assoc_46538 nl80211_send_rx_assoc 4 46538 NULL ++pm860x_irq_domain_map_46553 pm860x_irq_domain_map 2 46553 NULL ++mv_get_hc_count_46554 mv_get_hc_count 0 46554 NULL ++link_send_sections_long_46556 link_send_sections_long 4 46556 NULL ++irq_domain_associate_46564 irq_domain_associate 2 46564 NULL ++dn_current_mss_46574 dn_current_mss 0 46574 NULL ++serverworks_create_gatt_pages_46582 serverworks_create_gatt_pages 1 46582 NULL ++snd_compr_write_data_46592 snd_compr_write_data 3 46592 NULL ++il3945_stats_flag_46606 il3945_stats_flag 0-3 46606 NULL ++vscnprintf_46617 vscnprintf 0-2 46617 NULL ++__kfifo_out_r_46623 __kfifo_out_r 0-3 46623 NULL ++request_key_async_with_auxdata_46624 request_key_async_with_auxdata 4 46624 NULL ++aircable_process_packet_46639 aircable_process_packet 5 46639 NULL ++av7110_ipack_init_46655 av7110_ipack_init 2 46655 NULL ++alloc_data_packet_46698 alloc_data_packet 1 46698 NULL ++__ilog2_u32_46706 __ilog2_u32 0 46706 NULL ++erst_dbg_write_46715 erst_dbg_write 3 46715 NULL ++wl1271_rx_filter_alloc_field_46721 wl1271_rx_filter_alloc_field 5 46721 NULL ++prepare_copy_46725 prepare_copy 2 46725 NULL ++irq_domain_add_simple_46734 irq_domain_add_simple 2-3 46734 NULL ++ext4_count_free_46754 ext4_count_free 2 46754 NULL ++hest_ghes_dev_register_46766 hest_ghes_dev_register 1 46766 NULL ++int_hw_irq_en_46776 int_hw_irq_en 3 46776 NULL ++regcache_lzo_sync_46777 regcache_lzo_sync 2 46777 NULL ++scrub_chunk_46789 scrub_chunk 4 46789 NULL ++_sys_packet_req_46793 _sys_packet_req 4 46793 NULL ++_xfs_buf_get_pages_46811 _xfs_buf_get_pages 2 46811 NULL ++xfs_iroot_realloc_46826 xfs_iroot_realloc 2 46826 NULL ++shmem_pwrite_fast_46842 shmem_pwrite_fast 3 46842 NULL ++ieee80211_rx_radiotap_len_46846 ieee80211_rx_radiotap_len 0 46846 NULL ++spi_async_46857 spi_async 0 46857 NULL ++ieee80211_mgmt_tx_46860 ieee80211_mgmt_tx 9 46860 NULL ++vsnprintf_46863 vsnprintf 0 46863 NULL ++nvme_alloc_queue_46865 nvme_alloc_queue 3 46865 NULL ++sip_sprintf_addr_46872 sip_sprintf_addr 0 46872 NULL ++rvmalloc_46873 rvmalloc 1 46873 NULL ++hpi_read_word_nolock_46881 hpi_read_word_nolock 0 46881 NULL ++stmpe_gpio_irq_unmap_46884 stmpe_gpio_irq_unmap 2 46884 NULL ++em28xx_alloc_isoc_46892 em28xx_alloc_isoc 4 46892 NULL ++ixgbe_dbg_reg_ops_write_46895 ixgbe_dbg_reg_ops_write 3 46895 NULL ++sk_mem_pages_46896 sk_mem_pages 0-1 46896 NULL ++ol_dqblk_off_46904 ol_dqblk_off 3-2 46904 NULL ++fb_write_46924 fb_write 3 46924 NULL ++raid_status_46930 raid_status 5 46930 NULL ++btmrvl_curpsmode_read_46939 btmrvl_curpsmode_read 3 46939 NULL ++__sctp_setsockopt_connectx_46949 __sctp_setsockopt_connectx 3 46949 NULL ++qla4xxx_post_aen_work_46953 qla4xxx_post_aen_work 3 46953 NULL ++crypto_tfm_alg_alignmask_46971 crypto_tfm_alg_alignmask 0 46971 NULL ++mgmt_pending_add_46976 mgmt_pending_add 5 46976 NULL ++gfs2_xattr_system_set_46996 gfs2_xattr_system_set 4 46996 NULL nohasharray ++sel_write_bool_46996 sel_write_bool 3 46996 &gfs2_xattr_system_set_46996 ++ttm_bo_io_47000 ttm_bo_io 5 47000 NULL ++blk_rq_map_kern_47004 blk_rq_map_kern 4 47004 NULL ++__map_single_47020 __map_single 3-4-7 47020 NULL ++cx231xx_init_bulk_47024 cx231xx_init_bulk 3-2 47024 NULL ++set_dis_bypass_pfs_47038 set_dis_bypass_pfs 3 47038 NULL ++wm8994_set_bits_47052 wm8994_set_bits 2 47052 NULL ++fs_path_len_47060 fs_path_len 0 47060 NULL ++ufs_new_fragments_47070 ufs_new_fragments 3-5-4 47070 NULL ++pipeline_dec_packet_in_read_47076 pipeline_dec_packet_in_read 3 47076 NULL ++scsi_deactivate_tcq_47086 scsi_deactivate_tcq 2 47086 NULL ++mousedev_read_47123 mousedev_read 3 47123 NULL ++ses_recv_diag_47143 ses_recv_diag 4 47143 NULL nohasharray ++acpi_ut_initialize_buffer_47143 acpi_ut_initialize_buffer 2 47143 &ses_recv_diag_47143 ++cxio_init_resource_fifo_random_47151 cxio_init_resource_fifo_random 3 47151 NULL ++persistent_ram_iomap_47156 persistent_ram_iomap 1-2 47156 NULL ++mxms_headerlen_47161 mxms_headerlen 0 47161 NULL ++rs_sta_dbgfs_rate_scale_data_read_47165 rs_sta_dbgfs_rate_scale_data_read 3 47165 NULL ++rts51x_ms_rw_47171 rts51x_ms_rw 3-4 47171 NULL ++svc_pool_map_alloc_arrays_47181 svc_pool_map_alloc_arrays 2 47181 NULL ++can_set_system_xattr_47182 can_set_system_xattr 4 47182 NULL ++ioremap_cache_47189 ioremap_cache 1-2 47189 NULL ++wm8903_gpio_direction_in_47213 wm8903_gpio_direction_in 2 47213 NULL ++l2headersize_47238 l2headersize 0 47238 NULL ++options_write_47243 options_write 3 47243 NULL ++portcntrs_1_read_47253 portcntrs_1_read 3 47253 NULL ++da9052_disable_irq_nosync_47260 da9052_disable_irq_nosync 2 47260 NULL ++ablkcipher_next_slow_47274 ablkcipher_next_slow 4-3 47274 NULL ++tty_audit_log_47280 tty_audit_log 8 47280 NULL ++gfs2_readpages_47285 gfs2_readpages 4 47285 NULL ++vsnprintf_47291 vsnprintf 0 47291 NULL ++tx_internal_desc_overflow_read_47300 tx_internal_desc_overflow_read 3 47300 NULL ++ieee80211_if_read_dot11MeshHoldingTimeout_47356 ieee80211_if_read_dot11MeshHoldingTimeout 3 47356 NULL ++avc_get_hash_stats_47359 avc_get_hash_stats 0 47359 NULL ++find_first_zero_bit_le_47369 find_first_zero_bit_le 2 47369 NULL ++__bio_map_kern_47379 __bio_map_kern 3 47379 NULL ++trace_options_core_read_47390 trace_options_core_read 3 47390 NULL ++nametbl_list_47391 nametbl_list 2 47391 NULL ++dgrp_net_write_47392 dgrp_net_write 3 47392 NULL ++pfkey_sendmsg_47394 pfkey_sendmsg 4 47394 NULL ++ocfs2_resv_end_47408 ocfs2_resv_end 0 47408 NULL ++crypto_ablkcipher_alignmask_47410 crypto_ablkcipher_alignmask 0 47410 NULL ++vzalloc_47421 vzalloc 1 47421 NULL ++posix_acl_from_disk_47445 posix_acl_from_disk 2 47445 NULL ++newpart_47485 newpart 6 47485 NULL ++core_sys_select_47494 core_sys_select 1 47494 NULL ++alloc_arraycache_47505 alloc_arraycache 2 47505 NULL ++unlink_simple_47506 unlink_simple 3 47506 NULL ++ufs_inode_getblock_47512 ufs_inode_getblock 4 47512 NULL ++snd_pcm_resume_47530 snd_pcm_resume 0 47530 NULL ++vscnprintf_47533 vscnprintf 0-2 47533 NULL nohasharray ++process_vm_rw_47533 process_vm_rw 3-5 47533 &vscnprintf_47533 ++oz_events_read_47535 oz_events_read 3 47535 NULL ++ieee80211_if_fmt_min_discovery_timeout_47539 ieee80211_if_fmt_min_discovery_timeout 3 47539 NULL ++cycx_setup_47562 cycx_setup 4 47562 NULL ++read_ldt_47570 read_ldt 2 47570 NULL ++pci_iomap_47575 pci_iomap 3 47575 NULL ++rpipe_get_idx_47579 rpipe_get_idx 2 47579 NULL ++ext4_kvzalloc_47605 ext4_kvzalloc 1 47605 NULL ++wm831x_gpio_direction_out_47607 wm831x_gpio_direction_out 2 47607 NULL ++sctp_ssnmap_new_47608 sctp_ssnmap_new 1-2 47608 NULL ++uea_request_47613 uea_request 4 47613 NULL ++cache_read_pipefs_47615 cache_read_pipefs 3 47615 NULL ++tps65217_clear_bits_47619 tps65217_clear_bits 2 47619 NULL ++twl4030_clear_set_47624 twl4030_clear_set 4 47624 NULL ++irq_set_chip_47638 irq_set_chip 1 47638 NULL ++__build_packet_message_47643 __build_packet_message 3-9 47643 NULL ++irq_linear_revmap_47682 irq_linear_revmap 0 47682 NULL ++snd_pcm_info_47699 snd_pcm_info 0 47699 NULL ++bits_to_user_47733 bits_to_user 2-3 47733 NULL ++carl9170_debugfs_read_47738 carl9170_debugfs_read 3 47738 NULL ++ir_prepare_write_buffer_47747 ir_prepare_write_buffer 3 47747 NULL ++mvumi_alloc_mem_resource_47750 mvumi_alloc_mem_resource 3 47750 NULL ++ext3_find_near_47752 ext3_find_near 0 47752 NULL ++alloc_sched_domains_47756 alloc_sched_domains 1 47756 NULL ++irq_domain_legacy_revmap_47765 irq_domain_legacy_revmap 0-2 47765 NULL ++i915_wedged_write_47771 i915_wedged_write 3 47771 NULL ++uwb_ie_dump_hex_47774 uwb_ie_dump_hex 4 47774 NULL ++error_error_numll_frame_cts_start_read_47781 error_error_numll_frame_cts_start_read 3 47781 NULL ++posix_acl_fix_xattr_from_user_47793 posix_acl_fix_xattr_from_user 2 47793 NULL ++stmmac_set_bfsize_47834 stmmac_set_bfsize 0 47834 NULL ++__pcf50633_irq_mask_set_47847 __pcf50633_irq_mask_set 2 47847 NULL ++ubifs_unpack_nnode_47866 ubifs_unpack_nnode 0 47866 NULL ++vhci_read_47878 vhci_read 3 47878 NULL ++keyctl_instantiate_key_common_47889 keyctl_instantiate_key_common 4 47889 NULL ++osd_req_read_sg_47905 osd_req_read_sg 5 47905 NULL ++timeout_read_47915 timeout_read 3 47915 NULL ++comedi_write_47926 comedi_write 3 47926 NULL ++lp8788_irq_map_47964 lp8788_irq_map 2 47964 NULL ++iwl_dbgfs_ucode_tracing_read_47983 iwl_dbgfs_ucode_tracing_read 3 47983 NULL nohasharray ++mempool_resize_47983 mempool_resize 2 47983 &iwl_dbgfs_ucode_tracing_read_47983 ++pnpacpi_parse_allocated_irqresource_47986 pnpacpi_parse_allocated_irqresource 2 47986 NULL ++dbg_port_buf_47990 dbg_port_buf 2 47990 NULL ++ib_umad_write_47993 ib_umad_write 3 47993 NULL ++ffs_epfile_write_48014 ffs_epfile_write 3 48014 NULL ++bio_integrity_set_tag_48035 bio_integrity_set_tag 3 48035 NULL ++pppoe_sendmsg_48039 pppoe_sendmsg 4 48039 NULL ++wpan_phy_alloc_48056 wpan_phy_alloc 1 48056 NULL ++posix_acl_alloc_48063 posix_acl_alloc 1 48063 NULL ++mmc_alloc_host_48097 mmc_alloc_host 1 48097 NULL ++skb_copy_datagram_const_iovec_48102 skb_copy_datagram_const_iovec 4-2-5 48102 NULL ++radio_isa_common_probe_48107 radio_isa_common_probe 3 48107 NULL ++vmw_framebuffer_surface_dirty_48132 vmw_framebuffer_surface_dirty 6 48132 NULL ++rtsx_read_cfg_seq_48139 rtsx_read_cfg_seq 5-3 48139 NULL ++set_discoverable_48141 set_discoverable 4 48141 NULL ++dn_fib_count_nhs_48145 dn_fib_count_nhs 0 48145 NULL ++bitmap_onto_48152 bitmap_onto 4 48152 NULL ++isr_dma1_done_read_48159 isr_dma1_done_read 3 48159 NULL ++c4iw_id_table_alloc_48163 c4iw_id_table_alloc 3 48163 NULL ++ocfs2_find_next_zero_bit_unaligned_48170 ocfs2_find_next_zero_bit_unaligned 2-3 48170 NULL ++alloc_cc770dev_48186 alloc_cc770dev 1 48186 NULL ++init_ipath_48187 init_ipath 1 48187 NULL nohasharray ++ieee80211_send_auth_48187 ieee80211_send_auth 6 48187 &init_ipath_48187 ++snd_seq_dump_var_event_48209 snd_seq_dump_var_event 0 48209 NULL ++is_block_in_journal_48223 is_block_in_journal 3 48223 NULL ++uv_blade_nr_possible_cpus_48226 uv_blade_nr_possible_cpus 0 48226 NULL ++nilfs_readpages_48229 nilfs_readpages 4 48229 NULL ++read_file_recv_48232 read_file_recv 3 48232 NULL ++unaccount_shadowed_48233 unaccount_shadowed 2 48233 NULL nohasharray ++blk_rq_pos_48233 blk_rq_pos 0 48233 &unaccount_shadowed_48233 ++nfsctl_transaction_read_48250 nfsctl_transaction_read 3 48250 NULL ++cache_write_pipefs_48270 cache_write_pipefs 3 48270 NULL ++send_set_info_48288 send_set_info 7 48288 NULL ++set_disc_pwup_pfs_48300 set_disc_pwup_pfs 3 48300 NULL ++lpfc_idiag_extacc_read_48301 lpfc_idiag_extacc_read 3 48301 NULL ++timblogiw_read_48305 timblogiw_read 3 48305 NULL ++hash_setkey_48310 hash_setkey 3 48310 NULL ++__alloc_fd_48356 __alloc_fd 2 48356 NULL ++skb_add_data_48363 skb_add_data 3 48363 NULL ++tx_frag_init_called_read_48377 tx_frag_init_called_read 3 48377 NULL ++lbs_debugfs_write_48413 lbs_debugfs_write 3 48413 NULL ++snd_power_wait_48422 snd_power_wait 0 48422 NULL ++pwr_tx_without_ps_read_48423 pwr_tx_without_ps_read 3 48423 NULL ++nfs4_alloc_pages_48426 nfs4_alloc_pages 1 48426 NULL ++tun_recvmsg_48463 tun_recvmsg 4 48463 NULL ++r8712_usbctrl_vendorreq_48489 r8712_usbctrl_vendorreq 6 48489 NULL ++send_control_msg_48498 send_control_msg 6 48498 NULL ++mlx4_en_create_tx_ring_48501 mlx4_en_create_tx_ring 4 48501 NULL ++count_masked_bytes_48507 count_masked_bytes 0-1 48507 NULL ++diva_os_copy_to_user_48508 diva_os_copy_to_user 4 48508 NULL ++brcmf_sdio_trap_info_48510 brcmf_sdio_trap_info 4 48510 NULL ++phantom_get_free_48514 phantom_get_free 0 48514 NULL ++wiimote_hid_send_48528 wiimote_hid_send 3 48528 NULL ++ext3_splice_branch_48531 ext3_splice_branch 6 48531 NULL ++named_distribute_48544 named_distribute 4 48544 NULL ++raid10_size_48571 raid10_size 0-2-3 48571 NULL ++ext_sd_execute_read_data_48589 ext_sd_execute_read_data 9 48589 NULL ++ufs_dtogd_48616 ufs_dtogd 0-2 48616 NULL ++do_ip_vs_set_ctl_48641 do_ip_vs_set_ctl 4 48641 NULL ++mtd_read_48655 mtd_read 0 48655 NULL ++lc_create_48662 lc_create 3 48662 NULL ++aes_encrypt_packets_read_48666 aes_encrypt_packets_read 3 48666 NULL ++sm501_create_subdev_48668 sm501_create_subdev 3-4 48668 NULL nohasharray ++sys_setgroups_48668 sys_setgroups 1 48668 &sm501_create_subdev_48668 ++altera_drscan_48698 altera_drscan 2 48698 NULL ++kvm_set_irq_routing_48704 kvm_set_irq_routing 3 48704 NULL ++ath6kl_usb_bmi_read_48745 ath6kl_usb_bmi_read 3 48745 NULL ++ath6kl_regwrite_read_48747 ath6kl_regwrite_read 3 48747 NULL ++l2cap_segment_sdu_48772 l2cap_segment_sdu 4 48772 NULL ++lua_sysfs_write_48797 lua_sysfs_write 6 48797 NULL ++il3945_sta_dbgfs_stats_table_read_48802 il3945_sta_dbgfs_stats_table_read 3 48802 NULL ++twa_change_queue_depth_48808 twa_change_queue_depth 2 48808 NULL ++atomic_counters_read_48827 atomic_counters_read 3 48827 NULL ++azx_get_position_48841 azx_get_position 0 48841 NULL ++vc_do_resize_48842 vc_do_resize 3-4 48842 NULL ++viafb_dvp1_proc_write_48864 viafb_dvp1_proc_write 3 48864 NULL ++__ffs_ep0_read_events_48868 __ffs_ep0_read_events 3 48868 NULL ++sys_setgroups16_48882 sys_setgroups16 1 48882 NULL ++get_num_ops_48886 get_num_ops 0 48886 NULL ++ext2_alloc_branch_48889 ext2_alloc_branch 4 48889 NULL ++crypto_cipher_ctxsize_48890 crypto_cipher_ctxsize 0 48890 NULL ++xdi_copy_to_user_48900 xdi_copy_to_user 4 48900 NULL ++msg_hdr_sz_48908 msg_hdr_sz 0 48908 NULL ++gdth_isa_probe_one_48925 gdth_isa_probe_one 1 48925 NULL nohasharray ++snd_pcm_update_hw_ptr_48925 snd_pcm_update_hw_ptr 0 48925 &gdth_isa_probe_one_48925 ++sep_crypto_dma_48937 sep_crypto_dma 0 48937 NULL ++event_heart_beat_read_48961 event_heart_beat_read 3 48961 NULL ++nand_ecc_test_run_48966 nand_ecc_test_run 1 48966 NULL ++batadv_orig_hash_del_if_48972 batadv_orig_hash_del_if 2 48972 NULL ++_alloc_set_attr_list_48991 _alloc_set_attr_list 4 48991 NULL ++rds_rm_size_48996 rds_rm_size 0-2 48996 NULL ++sel_write_enforce_48998 sel_write_enforce 3 48998 NULL ++xd_rw_49020 xd_rw 3-4 49020 NULL ++transient_status_49027 transient_status 4 49027 NULL ++ubi_read_49061 ubi_read 0 49061 NULL ++tps65910_reg_write_49066 tps65910_reg_write 2 49066 NULL ++calc_layout_49074 calc_layout 4 49074 NULL ++vmx_set_msr_49090 vmx_set_msr 3 49090 NULL ++scsi_register_49094 scsi_register 2 49094 NULL ++compat_do_readv_writev_49102 compat_do_readv_writev 4 49102 NULL ++xfrm_replay_state_esn_len_49119 xfrm_replay_state_esn_len 0 49119 NULL ++pt_read_49136 pt_read 3 49136 NULL ++tipc_multicast_49144 tipc_multicast 5 49144 NULL ++atyfb_setup_generic_49151 atyfb_setup_generic 3 49151 NULL ++ipwireless_tty_received_49154 ipwireless_tty_received 3 49154 NULL ++f2fs_acl_count_49155 f2fs_acl_count 0-1 49155 NULL ++ipw_queue_tx_init_49161 ipw_queue_tx_init 3 49161 NULL ++ext4_free_clusters_after_init_49174 ext4_free_clusters_after_init 2 49174 NULL ++dvb_dvr_ioctl_49182 dvb_dvr_ioctl 2 49182 NULL ++iwl_dbgfs_ucode_general_stats_read_49199 iwl_dbgfs_ucode_general_stats_read 3 49199 NULL ++il4965_rs_sta_dbgfs_stats_table_read_49206 il4965_rs_sta_dbgfs_stats_table_read 3 49206 NULL ++do_jffs2_getxattr_49210 do_jffs2_getxattr 0 49210 NULL ++pcf50633_gpio_invert_set_49256 pcf50633_gpio_invert_set 2 49256 NULL ++hugetlb_cgroup_read_49259 hugetlb_cgroup_read 5 49259 NULL ++ieee80211_if_read_rssi_threshold_49260 ieee80211_if_read_rssi_threshold 3 49260 NULL ++osd_req_add_get_attr_list_49278 osd_req_add_get_attr_list 3 49278 NULL ++rx_filter_beacon_filter_read_49279 rx_filter_beacon_filter_read 3 49279 NULL ++uio_read_49300 uio_read 3 49300 NULL ++ocfs2_resmap_find_free_bits_49301 ocfs2_resmap_find_free_bits 3 49301 NULL ++fwtty_port_handler_49327 fwtty_port_handler 9 49327 NULL ++srpt_alloc_ioctx_ring_49330 srpt_alloc_ioctx_ring 2-3-4 49330 NULL ++cfpkt_setlen_49343 cfpkt_setlen 2 49343 NULL ++joydev_ioctl_common_49359 joydev_ioctl_common 2 49359 NULL ++ocfs2_remove_btree_range_49370 ocfs2_remove_btree_range 4-5-3 49370 NULL ++px_raw_event_49371 px_raw_event 4 49371 NULL ++iscsi_alloc_session_49390 iscsi_alloc_session 3 49390 NULL ++applesmc_create_nodes_49392 applesmc_create_nodes 2 49392 NULL ++rx_streaming_always_read_49401 rx_streaming_always_read 3 49401 NULL ++tnode_alloc_49407 tnode_alloc 1 49407 NULL ++samples_to_bytes_49426 samples_to_bytes 0-2 49426 NULL ++md_domain_init_49432 md_domain_init 2 49432 NULL ++compat_do_msg_fill_49440 compat_do_msg_fill 3 49440 NULL ++agp_3_5_isochronous_node_enable_49465 agp_3_5_isochronous_node_enable 3 49465 NULL ++xfs_iformat_local_49472 xfs_iformat_local 4 49472 NULL ++savu_sysfs_read_49473 savu_sysfs_read 6 49473 NULL ++ieee80211_ie_split_49474 ieee80211_ie_split 0-5 49474 NULL ++isr_decrypt_done_read_49490 isr_decrypt_done_read 3 49490 NULL ++emulator_write_phys_49520 emulator_write_phys 2-4 49520 NULL ++acpi_os_ioremap_49523 acpi_os_ioremap 1-2 49523 NULL ++wm831x_dcdc_set_mode_int_49546 wm831x_dcdc_set_mode_int 2 49546 NULL ++smk_write_access_49561 smk_write_access 3 49561 NULL ++ntfs_malloc_nofs_49572 ntfs_malloc_nofs 1 49572 NULL ++alloc_chunk_49575 alloc_chunk 1 49575 NULL ++sctp_setsockopt_default_send_param_49578 sctp_setsockopt_default_send_param 3 49578 NULL ++isr_wakeups_read_49607 isr_wakeups_read 3 49607 NULL ++heap_init_49617 heap_init 2 49617 NULL ++smk_write_doi_49621 smk_write_doi 3 49621 NULL ++btrfsic_cmp_log_and_dev_bytenr_49628 btrfsic_cmp_log_and_dev_bytenr 2 49628 NULL ++svm_set_msr_49643 svm_set_msr 3 49643 NULL ++aa_simple_write_to_buffer_49683 aa_simple_write_to_buffer 3-4 49683 NULL ++sys_gethostname_49698 sys_gethostname 2 49698 NULL ++cx2341x_ctrl_new_menu_49700 cx2341x_ctrl_new_menu 3 49700 NULL ++sep_create_dcb_dmatables_context_kernel_49728 sep_create_dcb_dmatables_context_kernel 6 49728 NULL ++sys_fsetxattr_49736 sys_fsetxattr 4 49736 NULL ++check_frame_49741 check_frame 0 49741 NULL ++zd_usb_iowrite16v_49744 zd_usb_iowrite16v 3 49744 NULL ++btrfs_chunk_num_stripes_49751 btrfs_chunk_num_stripes 0 49751 NULL ++key_conf_keylen_read_49758 key_conf_keylen_read 3 49758 NULL ++fuse_conn_waiting_read_49762 fuse_conn_waiting_read 3 49762 NULL ++isku_sysfs_write_49767 isku_sysfs_write 6 49767 NULL ++ceph_osdc_readpages_49789 ceph_osdc_readpages 10-4 49789 NULL ++nfs4_acl_new_49806 nfs4_acl_new 1 49806 NULL ++arch_gnttab_map_status_49812 arch_gnttab_map_status 3 49812 NULL ++ntfs_copy_from_user_iovec_49829 ntfs_copy_from_user_iovec 3-6-0 49829 NULL ++add_uuid_49831 add_uuid 4 49831 NULL ++ath6kl_fwlog_block_read_49836 ath6kl_fwlog_block_read 3 49836 NULL ++__btrfs_map_block_49839 __btrfs_map_block 3 49839 NULL ++twl4030_write_49846 twl4030_write 2 49846 NULL ++scsi_dispatch_cmd_entry_49848 scsi_dispatch_cmd_entry 3 49848 NULL ++timeradd_entry_49850 timeradd_entry 3 49850 NULL ++sctp_setsockopt_bindx_49870 sctp_setsockopt_bindx 3 49870 NULL ++ceph_get_caps_49890 ceph_get_caps 0 49890 NULL ++__cow_file_range_49901 __cow_file_range 5 49901 NULL ++__copy_from_user_inatomic_nocache_49921 __copy_from_user_inatomic_nocache 3 49921 NULL ++batadv_tt_realloc_packet_buff_49960 batadv_tt_realloc_packet_buff 4 49960 NULL ++b43legacy_pio_read_49978 b43legacy_pio_read 0 49978 NULL ++ieee80211_if_fmt_dtim_count_49987 ieee80211_if_fmt_dtim_count 3 49987 NULL ++sta2x11_swiotlb_alloc_coherent_49994 sta2x11_swiotlb_alloc_coherent 2 49994 NULL ++l2cap_chan_send_49995 l2cap_chan_send 3 49995 NULL ++__module_alloc_50004 __module_alloc 1 50004 NULL ++dn_mss_from_pmtu_50011 dn_mss_from_pmtu 0-2 50011 NULL ++ptrace_readdata_50020 ptrace_readdata 2-4 50020 NULL ++isdn_read_50021 isdn_read 3 50021 NULL ++rbd_req_write_50041 rbd_req_write 4-5 50041 NULL ++alloc_ebda_hpc_50046 alloc_ebda_hpc 1-2 50046 NULL ++vmw_surface_destroy_size_50072 vmw_surface_destroy_size 0 50072 NULL ++arch_setup_ht_irq_50073 arch_setup_ht_irq 1 50073 NULL ++dev_set_alias_50084 dev_set_alias 3 50084 NULL ++pcpu_get_vm_areas_50085 pcpu_get_vm_areas 3 50085 NULL ++sock_setsockopt_50088 sock_setsockopt 5 50088 NULL ++altera_swap_dr_50090 altera_swap_dr 2 50090 NULL ++read_file_slot_50111 read_file_slot 3 50111 NULL ++copy_items_50140 copy_items 6 50140 NULL ++tx_frag_need_fragmentation_read_50153 tx_frag_need_fragmentation_read 3 50153 NULL ++set_cmd_header_50155 set_cmd_header 0 50155 NULL ++reiserfs_bmap_count_50160 reiserfs_bmap_count 0 50160 NULL ++aac_nark_ioremap_50163 aac_nark_ioremap 2 50163 NULL nohasharray ++kmalloc_node_50163 kmalloc_node 1 50163 &aac_nark_ioremap_50163 ++rx_filter_ibss_filter_read_50167 rx_filter_ibss_filter_read 3 50167 NULL ++odev_update_50169 odev_update 2 50169 NULL ++ieee80211_if_fmt_dot11MeshHWMPRannInterval_50172 ieee80211_if_fmt_dot11MeshHWMPRannInterval 3 50172 NULL nohasharray ++ubi_resize_volume_50172 ubi_resize_volume 2 50172 &ieee80211_if_fmt_dot11MeshHWMPRannInterval_50172 ++ib_send_cm_drep_50186 ib_send_cm_drep 3 50186 NULL ++cfg80211_roamed_bss_50198 cfg80211_roamed_bss 4-6 50198 NULL ++rx_rx_timeout_wa_read_50204 rx_rx_timeout_wa_read 3 50204 NULL ++ieee80211_skb_resize_50211 ieee80211_skb_resize 3 50211 NULL ++mon_bin_compat_ioctl_50234 mon_bin_compat_ioctl 3 50234 NULL ++sg_kmalloc_50240 sg_kmalloc 1 50240 NULL ++afs_extract_data_50261 afs_extract_data 5 50261 NULL ++rxrpc_setsockopt_50286 rxrpc_setsockopt 5 50286 NULL ++soc_codec_reg_show_50302 soc_codec_reg_show 0 50302 NULL ++soc_camera_read_50319 soc_camera_read 3 50319 NULL ++do_launder_page_50329 do_launder_page 0 50329 NULL ++nouveau_engine_create__50331 nouveau_engine_create_ 7 50331 NULL ++lpfc_idiag_pcicfg_read_50334 lpfc_idiag_pcicfg_read 3 50334 NULL ++ocfs2_block_to_cluster_group_50337 ocfs2_block_to_cluster_group 2 50337 NULL nohasharray ++snd_pcm_lib_writev_50337 snd_pcm_lib_writev 0-3 50337 &ocfs2_block_to_cluster_group_50337 ++roccat_common2_send_with_status_50343 roccat_common2_send_with_status 4 50343 NULL ++tpm_read_50344 tpm_read 3 50344 NULL ++kvm_arch_create_memslot_50354 kvm_arch_create_memslot 2 50354 NULL ++isdn_ppp_read_50356 isdn_ppp_read 4 50356 NULL ++unpack_u16_chunk_50357 unpack_u16_chunk 0 50357 NULL ++xfrm_send_migrate_50365 xfrm_send_migrate 5 50365 NULL ++roccat_common2_receive_50369 roccat_common2_receive 4 50369 NULL ++sl_alloc_bufs_50380 sl_alloc_bufs 2 50380 NULL ++l2tp_ip_sendmsg_50411 l2tp_ip_sendmsg 4 50411 NULL ++iscsi_create_conn_50425 iscsi_create_conn 2 50425 NULL ++btrfs_error_discard_extent_50444 btrfs_error_discard_extent 2 50444 NULL ++pgctrl_write_50453 pgctrl_write 3 50453 NULL ++tps65217_update_bits_50472 tps65217_update_bits 2 50472 NULL ++cdrom_read_cdda_50478 cdrom_read_cdda 4 50478 NULL ++mei_io_cb_alloc_req_buf_50493 mei_io_cb_alloc_req_buf 2 50493 NULL ++pwr_rcvd_awake_beacons_read_50505 pwr_rcvd_awake_beacons_read 3 50505 NULL ++fwnet_receive_packet_50537 fwnet_receive_packet 9 50537 NULL ++ath6kl_set_ap_probe_resp_ies_50539 ath6kl_set_ap_probe_resp_ies 3 50539 NULL ++pcf50633_reg_set_bit_mask_50544 pcf50633_reg_set_bit_mask 2 50544 NULL ++hme_read_desc32_50574 hme_read_desc32 0 50574 NULL ++fat_readpages_50582 fat_readpages 4 50582 NULL ++iwl_dbgfs_missed_beacon_read_50584 iwl_dbgfs_missed_beacon_read 3 50584 NULL ++build_inv_iommu_pages_50589 build_inv_iommu_pages 2-3 50589 NULL ++rx_rx_checksum_result_read_50617 rx_rx_checksum_result_read 3 50617 NULL ++__ffs_50625 __ffs 0 50625 NULL ++simple_transaction_get_50633 simple_transaction_get 3 50633 NULL ++ath6kl_tm_rx_event_50664 ath6kl_tm_rx_event 3 50664 NULL nohasharray ++sys_readv_50664 sys_readv 3 50664 &ath6kl_tm_rx_event_50664 ++bnad_debugfs_read_50665 bnad_debugfs_read 3 50665 NULL ++ext2_try_to_allocate_with_rsv_50669 ext2_try_to_allocate_with_rsv 4-2 50669 NULL ++btmrvl_psstate_read_50683 btmrvl_psstate_read 3 50683 NULL ++xfs_growfs_get_hdr_buf_50697 xfs_growfs_get_hdr_buf 3 50697 NULL ++blk_check_plugged_50736 blk_check_plugged 3 50736 NULL ++__ext3_get_inode_loc_50744 __ext3_get_inode_loc 0 50744 NULL ++skb_padto_50759 skb_padto 2 50759 NULL ++ocfs2_xattr_block_get_50773 ocfs2_xattr_block_get 0 50773 NULL ++tm6000_read_write_usb_50774 tm6000_read_write_usb 7 50774 NULL ++bio_alloc_map_data_50782 bio_alloc_map_data 1-2 50782 NULL ++tpm_write_50798 tpm_write 3 50798 NULL ++tun_do_read_50800 tun_do_read 4 50800 NULL ++write_flush_50803 write_flush 3 50803 NULL ++dvb_play_50814 dvb_play 3 50814 NULL ++dpcm_show_state_50827 dpcm_show_state 0 50827 NULL ++acpi_ev_install_gpe_block_50829 acpi_ev_install_gpe_block 2 50829 NULL ++pstore_mkfile_50830 pstore_mkfile 5 50830 NULL ++dma_attach_50831 dma_attach 6-7 50831 NULL ++SetArea_50835 SetArea 4 50835 NULL nohasharray ++create_mem_extents_50835 create_mem_extents 0 50835 &SetArea_50835 ++self_check_write_50856 self_check_write 5 50856 NULL ++carl9170_debugfs_write_50857 carl9170_debugfs_write 3 50857 NULL ++netlbl_secattr_catmap_walk_rng_50894 netlbl_secattr_catmap_walk_rng 0-2 50894 NULL ++osd_req_write_sg_50908 osd_req_write_sg 5 50908 NULL ++xfs_iext_remove_50909 xfs_iext_remove 3 50909 NULL ++blk_rq_cur_sectors_50910 blk_rq_cur_sectors 0 50910 NULL ++hash_recvmsg_50924 hash_recvmsg 4 50924 NULL ++chd_dec_fetch_cdata_50926 chd_dec_fetch_cdata 3 50926 NULL ++sock_bindtodevice_50942 sock_bindtodevice 3 50942 NULL ++ocfs2_add_refcount_flag_50952 ocfs2_add_refcount_flag 6 50952 NULL ++iwl_statistics_flag_50981 iwl_statistics_flag 0-3 50981 NULL ++timeout_write_50991 timeout_write 3 50991 NULL ++wm831x_irq_map_50995 wm831x_irq_map 2 50995 NULL nohasharray ++wm8903_gpio_direction_out_50995 wm8903_gpio_direction_out 2 50995 &wm831x_irq_map_50995 ++proc_write_51003 proc_write 3 51003 NULL ++lbs_dev_info_51023 lbs_dev_info 3 51023 NULL ++ntfs_attr_find_51028 ntfs_attr_find 0 51028 NULL nohasharray ++fuse_conn_congestion_threshold_read_51028 fuse_conn_congestion_threshold_read 3 51028 &ntfs_attr_find_51028 ++BcmGetSectionValEndOffset_51039 BcmGetSectionValEndOffset 0 51039 NULL ++dump_midi_51040 dump_midi 3 51040 NULL ++srpt_alloc_ioctx_51042 srpt_alloc_ioctx 2-3 51042 NULL ++do_arpt_set_ctl_51053 do_arpt_set_ctl 4 51053 NULL ++wusb_prf_64_51065 wusb_prf_64 7 51065 NULL ++jbd2_journal_init_revoke_51088 jbd2_journal_init_revoke 2 51088 NULL ++__ocfs2_find_path_51096 __ocfs2_find_path 0 51096 NULL ++dgrp_net_read_51113 dgrp_net_read 3 51113 NULL ++lm3533_als_get_current_51120 lm3533_als_get_current 2 51120 NULL ++nfs_map_name_to_uid_51132 nfs_map_name_to_uid 3 51132 NULL ++alloc_rtllib_51136 alloc_rtllib 1 51136 NULL ++simple_xattr_set_51140 simple_xattr_set 4 51140 NULL ++xfs_trans_get_efd_51148 xfs_trans_get_efd 3 51148 NULL ++compat_sys_pwritev64_51151 compat_sys_pwritev64 3 51151 NULL ++snd_pcm_unlink_51210 snd_pcm_unlink 0 51210 NULL ++blk_bio_map_sg_51213 blk_bio_map_sg 0 51213 NULL ++nf_ct_ext_create_51232 nf_ct_ext_create 3 51232 NULL ++snd_pcm_write_51235 snd_pcm_write 3 51235 NULL ++tipc_send_51238 tipc_send 4 51238 NULL ++drm_property_create_51239 drm_property_create 4 51239 NULL ++st_read_51251 st_read 3 51251 NULL ++compat_dccp_setsockopt_51263 compat_dccp_setsockopt 5 51263 NULL ++dvb_audio_write_51275 dvb_audio_write 3 51275 NULL ++ipwireless_network_packet_received_51277 ipwireless_network_packet_received 4 51277 NULL ++zone_reclaimable_pages_51283 zone_reclaimable_pages 0 51283 NULL ++pvr2_std_id_to_str_51288 pvr2_std_id_to_str 2 51288 NULL ++fd_do_readv_51297 fd_do_readv 3 51297 NULL ++bnad_debugfs_read_regrd_51308 bnad_debugfs_read_regrd 3 51308 NULL ++alloc_hippi_dev_51320 alloc_hippi_dev 1 51320 NULL ++ext2_xattr_get_51327 ext2_xattr_get 0 51327 NULL ++alloc_smp_req_51337 alloc_smp_req 1 51337 NULL nohasharray ++compat_arch_ptrace_51337 compat_arch_ptrace 3-4 51337 &alloc_smp_req_51337 ++ipw_get_event_log_len_51341 ipw_get_event_log_len 0 51341 NULL ++ieee80211_if_fmt_estab_plinks_51370 ieee80211_if_fmt_estab_plinks 3 51370 NULL ++radeon_kms_compat_ioctl_51371 radeon_kms_compat_ioctl 2 51371 NULL ++ieee80211_wx_set_gen_ie_51399 ieee80211_wx_set_gen_ie 3 51399 NULL ++ceph_sync_read_51410 ceph_sync_read 3 51410 NULL ++blk_register_region_51424 blk_register_region 1-2 51424 NULL ++mwifiex_rdeeprom_read_51429 mwifiex_rdeeprom_read 3 51429 NULL ++ieee80211_if_read_dot11MeshHWMPRootMode_51441 ieee80211_if_read_dot11MeshHWMPRootMode 3 51441 NULL ++print_devstats_dot11ACKFailureCount_51443 print_devstats_dot11ACKFailureCount 3 51443 NULL ++____alloc_ei_netdev_51475 ____alloc_ei_netdev 1 51475 NULL ++xfs_buf_get_uncached_51477 xfs_buf_get_uncached 2 51477 NULL ++ieee80211_if_write_uapsd_queues_51526 ieee80211_if_write_uapsd_queues 3 51526 NULL ++__alloc_eip_netdev_51549 __alloc_eip_netdev 1 51549 NULL ++icmp_manip_pkt_51560 icmp_manip_pkt 4 51560 NULL ++ixgb_get_eeprom_len_51586 ixgb_get_eeprom_len 0 51586 NULL ++aac_convert_sgraw2_51598 aac_convert_sgraw2 4 51598 NULL ++raw_ioctl_51607 raw_ioctl 3 51607 NULL ++table_size_to_number_of_entries_51613 table_size_to_number_of_entries 0-1 51613 NULL ++dns_resolve_server_name_to_ip_51632 dns_resolve_server_name_to_ip 0 51632 NULL ++sctp_auth_create_key_51641 sctp_auth_create_key 1 51641 NULL ++iscsi_create_session_51647 iscsi_create_session 3 51647 NULL ++get_new_cssid_51665 get_new_cssid 2 51665 NULL ++ps_upsd_utilization_read_51669 ps_upsd_utilization_read 3 51669 NULL ++sctp_setsockopt_associnfo_51684 sctp_setsockopt_associnfo 3 51684 NULL ++sfi_sysfs_install_table_51688 sfi_sysfs_install_table 1 51688 NULL ++sel_write_access_51704 sel_write_access 3 51704 NULL ++tty_cdev_add_51714 tty_cdev_add 2-4 51714 NULL ++drm_compat_ioctl_51717 drm_compat_ioctl 2 51717 NULL ++sg_read_oxfer_51724 sg_read_oxfer 3 51724 NULL ++msg_set_51725 msg_set 3 51725 NULL ++dbg_check_lpt_nodes_51727 dbg_check_lpt_nodes 0 51727 NULL ++hid_parse_report_51737 hid_parse_report 3 51737 NULL ++get_user_pages_fast_51751 get_user_pages_fast 0 51751 NULL ++ifx_spi_insert_flip_string_51752 ifx_spi_insert_flip_string 3 51752 NULL ++if_write_51756 if_write 3 51756 NULL ++ioremap_prot_51764 ioremap_prot 1-2 51764 NULL ++iio_buffer_add_channel_sysfs_51766 iio_buffer_add_channel_sysfs 0 51766 NULL ++__fswab32_51781 __fswab32 0 51781 NULL ++qib_alloc_devdata_51819 qib_alloc_devdata 2 51819 NULL ++buffer_from_user_51826 buffer_from_user 3 51826 NULL ++wm2000_write_51834 wm2000_write 2 51834 NULL ++ioread32_51847 ioread32 0 51847 NULL nohasharray ++read_file_tgt_tx_stats_51847 read_file_tgt_tx_stats 3 51847 &ioread32_51847 ++do_readv_writev_51849 do_readv_writev 4 51849 NULL ++pointer_size_read_51863 pointer_size_read 3 51863 NULL ++mlx4_alloc_db_from_pgdir_51865 mlx4_alloc_db_from_pgdir 3 51865 NULL ++get_indirect_ea_51869 get_indirect_ea 4 51869 NULL ++user_read_51881 user_read 3 51881 NULL ++dbAdjCtl_51888 dbAdjCtl 0 51888 NULL ++virt_to_phys_51896 virt_to_phys 0 51896 NULL ++iio_read_first_n_sw_rb_51911 iio_read_first_n_sw_rb 2 51911 NULL ++wmi_set_ie_51919 wmi_set_ie 3 51919 NULL ++dbg_status_buf_51930 dbg_status_buf 2 51930 NULL ++__tcp_mtu_to_mss_51938 __tcp_mtu_to_mss 0-2 51938 NULL ++xfrm_alg_len_51940 xfrm_alg_len 0 51940 NULL ++irq_dispose_mapping_51941 irq_dispose_mapping 1 51941 NULL ++scsi_get_vpd_page_51951 scsi_get_vpd_page 4 51951 NULL ++arizona_free_irq_51969 arizona_free_irq 2 51969 NULL nohasharray ++snd_mask_min_51969 snd_mask_min 0 51969 &arizona_free_irq_51969 ++ath6kl_sdio_alloc_prep_scat_req_51986 ath6kl_sdio_alloc_prep_scat_req 2 51986 NULL ++dwc3_mode_write_51997 dwc3_mode_write 3 51997 NULL ++skb_copy_datagram_from_iovec_52014 skb_copy_datagram_from_iovec 4-2-5 52014 NULL ++rdmalt_52022 rdmalt 0 52022 NULL ++vxge_rx_alloc_52024 vxge_rx_alloc 3 52024 NULL ++override_release_52032 override_release 2 52032 NULL ++end_port_52042 end_port 0 52042 NULL ++dma_rx_errors_read_52045 dma_rx_errors_read 3 52045 NULL ++msnd_fifo_write_52052 msnd_fifo_write 0-3 52052 NULL ++dvb_ringbuffer_avail_52057 dvb_ringbuffer_avail 0 52057 NULL ++isofs_readpages_52067 isofs_readpages 4 52067 NULL ++nsm_get_handle_52089 nsm_get_handle 4 52089 NULL ++o2net_debug_read_52105 o2net_debug_read 3 52105 NULL ++retry_count_read_52129 retry_count_read 3 52129 NULL ++snd_pcm_channel_info_user_52135 snd_pcm_channel_info_user 0 52135 NULL ++hysdn_conf_write_52145 hysdn_conf_write 3 52145 NULL nohasharray ++ext2_alloc_blocks_52145 ext2_alloc_blocks 2 52145 &hysdn_conf_write_52145 ++htable_size_52148 htable_size 0-1 52148 NULL ++__le16_to_cpup_52155 __le16_to_cpup 0 52155 NULL nohasharray ++smk_write_load2_52155 smk_write_load2 3 52155 &__le16_to_cpup_52155 ++ieee80211_if_read_dot11MeshRetryTimeout_52168 ieee80211_if_read_dot11MeshRetryTimeout 3 52168 NULL ++mga_compat_ioctl_52170 mga_compat_ioctl 2 52170 NULL ++print_prefix_52176 print_prefix 0 52176 NULL ++proc_pid_readlink_52186 proc_pid_readlink 3 52186 NULL ++do_dmabuf_dirty_ldu_52241 do_dmabuf_dirty_ldu 6 52241 NULL ++pm80x_request_irq_52250 pm80x_request_irq 2 52250 NULL ++mdiobus_alloc_size_52259 mdiobus_alloc_size 1 52259 NULL ++shrink_slab_52261 shrink_slab 2-3 52261 NULL ++sisusbcon_do_font_op_52271 sisusbcon_do_font_op 9 52271 NULL ++mpol_to_str_52293 mpol_to_str 2 52293 NULL ++ath6kl_wmi_get_new_buf_52304 ath6kl_wmi_get_new_buf 1 52304 NULL ++read_file_reset_52310 read_file_reset 3 52310 NULL ++ssd1307fb_write_52315 ssd1307fb_write 3 52315 NULL ++request_asymmetric_key_52317 request_asymmetric_key 2-4 52317 NULL ++hwflags_read_52318 hwflags_read 3 52318 NULL ++snd_pcm_hw_free_52327 snd_pcm_hw_free 0 52327 NULL ++ntfs_rl_split_52328 ntfs_rl_split 2-4 52328 NULL ++test_unaligned_bulk_52333 test_unaligned_bulk 3 52333 NULL ++bytes_to_frames_52362 bytes_to_frames 0-2 52362 NULL ++copy_entries_to_user_52367 copy_entries_to_user 1 52367 NULL ++iwl_dump_fh_52371 iwl_dump_fh 0 52371 NULL ++isdn_writebuf_stub_52383 isdn_writebuf_stub 4 52383 NULL ++jfs_setxattr_52389 jfs_setxattr 4 52389 NULL ++aer_inject_write_52399 aer_inject_write 3 52399 NULL ++pcf50633_reg_clear_bits_52407 pcf50633_reg_clear_bits 2 52407 NULL ++aac_rx_ioremap_52410 aac_rx_ioremap 2 52410 NULL ++cgroup_file_write_52417 cgroup_file_write 3 52417 NULL ++line6_midibuf_init_52425 line6_midibuf_init 2 52425 NULL ++delay_status_52431 delay_status 5 52431 NULL ++ieee80211_if_fmt_num_sta_ps_52438 ieee80211_if_fmt_num_sta_ps 3 52438 NULL ++nl80211_send_mgmt_tx_status_52445 nl80211_send_mgmt_tx_status 5 52445 NULL ++ieee80211_alloc_txb_52477 ieee80211_alloc_txb 1-2 52477 NULL ++ocfs2_extend_no_holes_52483 ocfs2_extend_no_holes 3-4 52483 NULL ++fd_do_rw_52495 fd_do_rw 3 52495 NULL nohasharray ++skb_cow_head_52495 skb_cow_head 2 52495 &fd_do_rw_52495 ++int_tasklet_entry_52500 int_tasklet_entry 3 52500 NULL ++pm_qos_power_write_52513 pm_qos_power_write 3 52513 NULL ++dccpprobe_read_52549 dccpprobe_read 3 52549 NULL ++ocfs2_make_right_split_rec_52562 ocfs2_make_right_split_rec 3 52562 NULL ++emit_code_52583 emit_code 0-3 52583 NULL ++snd_pcm_sw_params_52594 snd_pcm_sw_params 0 52594 NULL ++brcmf_sdio_assert_info_52653 brcmf_sdio_assert_info 4 52653 NULL ++ntfs_get_nr_significant_bytes_52688 ntfs_get_nr_significant_bytes 0 52688 NULL ++nvd0_disp_pioc_create__52693 nvd0_disp_pioc_create_ 5 52693 NULL ++nouveau_client_create__52715 nouveau_client_create_ 5 52715 NULL ++cx25840_ir_rx_read_52724 cx25840_ir_rx_read 3 52724 NULL ++blkcipher_next_slow_52733 blkcipher_next_slow 3-4 52733 NULL ++relay_alloc_page_array_52735 relay_alloc_page_array 1 52735 NULL ++carl9170_debugfs_vif_dump_read_52755 carl9170_debugfs_vif_dump_read 3 52755 NULL ++alloc_extent_buffer_52824 alloc_extent_buffer 3 52824 NULL ++pwr_rcvd_beacons_read_52836 pwr_rcvd_beacons_read 3 52836 NULL ++ext2_xattr_set_acl_52857 ext2_xattr_set_acl 4 52857 NULL ++mon_bin_get_event_52863 mon_bin_get_event 4 52863 NULL ++twlreg_write_52880 twlreg_write 3 52880 NULL ++pvr2_ctrl_value_to_sym_internal_52881 pvr2_ctrl_value_to_sym_internal 5 52881 NULL ++cache_read_procfs_52882 cache_read_procfs 3 52882 NULL ++kvm_kvzalloc_52894 kvm_kvzalloc 1 52894 NULL ++arizona_request_irq_52908 arizona_request_irq 2 52908 NULL ++__kfifo_out_peek_r_52919 __kfifo_out_peek_r 3 52919 NULL ++iblock_get_bio_52936 iblock_get_bio 3 52936 NULL nohasharray ++__iio_device_attr_init_52936 __iio_device_attr_init 0 52936 &iblock_get_bio_52936 ++__nodes_remap_52951 __nodes_remap 5 52951 NULL ++send_packet_52960 send_packet 4 52960 NULL ++ieee80211_if_fmt_fwded_mcast_52961 ieee80211_if_fmt_fwded_mcast 3 52961 NULL ++compat_sock_ioctl_52964 compat_sock_ioctl 3 52964 NULL ++tx_tx_exch_read_52986 tx_tx_exch_read 3 52986 NULL ++num_node_state_52989 num_node_state 0 52989 NULL ++batadv_check_management_packet_52993 batadv_check_management_packet 3 52993 NULL ++efivarfs_file_write_53000 efivarfs_file_write 3 53000 NULL ++btrfs_free_and_pin_reserved_extent_53016 btrfs_free_and_pin_reserved_extent 2 53016 NULL ++tx_tx_exch_pending_read_53018 tx_tx_exch_pending_read 3 53018 NULL ++ext4_meta_bg_first_group_53031 ext4_meta_bg_first_group 0-2 53031 NULL ++bio_cur_bytes_53037 bio_cur_bytes 0 53037 NULL ++regcache_lzo_block_count_53056 regcache_lzo_block_count 0 53056 NULL ++cfi_read_query_53066 cfi_read_query 0 53066 NULL ++mwifiex_debug_read_53074 mwifiex_debug_read 3 53074 NULL ++qib_resize_cq_53090 qib_resize_cq 2 53090 NULL ++verity_status_53120 verity_status 5 53120 NULL ++line6_dumpreq_initbuf_53123 line6_dumpreq_initbuf 3 53123 NULL ++brcmf_usb_dl_cmd_53130 brcmf_usb_dl_cmd 4 53130 NULL ++ps_poll_ps_poll_max_ap_turn_read_53140 ps_poll_ps_poll_max_ap_turn_read 3 53140 NULL ++clear_capture_buf_53192 clear_capture_buf 2 53192 NULL ++mtdoops_erase_block_53206 mtdoops_erase_block 2 53206 NULL ++tx_tx_start_data_read_53219 tx_tx_start_data_read 3 53219 NULL ++xfs_trans_read_buf_map_53258 xfs_trans_read_buf_map 5 53258 NULL ++wil_write_file_ssid_53266 wil_write_file_ssid 3 53266 NULL ++btrfs_file_extent_num_bytes_53269 btrfs_file_extent_num_bytes 0 53269 NULL ++lirc_buffer_init_53282 lirc_buffer_init 3-2 53282 NULL ++batadv_interface_rx_53325 batadv_interface_rx 4 53325 NULL ++gsm_control_reply_53333 gsm_control_reply 4 53333 NULL ++vm_mmap_53339 vm_mmap 0 53339 NULL ++sock_setbindtodevice_53369 sock_setbindtodevice 3 53369 NULL ++get_random_bytes_arch_53370 get_random_bytes_arch 2 53370 NULL ++iwl_pcie_txq_alloc_53413 iwl_pcie_txq_alloc 3 53413 NULL ++wm8996_gpio_set_53421 wm8996_gpio_set 2 53421 NULL ++isr_cmd_cmplt_read_53439 isr_cmd_cmplt_read 3 53439 NULL ++mwifiex_info_read_53447 mwifiex_info_read 3 53447 NULL ++apei_exec_run_optional_53452 apei_exec_run_optional 0 53452 NULL ++acpi_tb_parse_root_table_53455 acpi_tb_parse_root_table 1 53455 NULL ++n2_run_53459 n2_run 3 53459 NULL ++paging64_prefetch_gpte_53468 paging64_prefetch_gpte 4 53468 NULL ++wm831x_write_53469 wm831x_write 2 53469 NULL ++rds_tcp_data_recv_53476 rds_tcp_data_recv 3 53476 NULL ++iowarrior_read_53483 iowarrior_read 3 53483 NULL ++osd_req_write_kern_53486 osd_req_write_kern 5 53486 NULL ++do_verify_xattr_datum_53499 do_verify_xattr_datum 0 53499 NULL ++snd_pcm_format_physical_width_53505 snd_pcm_format_physical_width 0 53505 NULL ++dbAllocNext_53506 dbAllocNext 0 53506 NULL ++ocfs2_xattr_set_acl_53508 ocfs2_xattr_set_acl 4 53508 NULL ++check_acl_53512 check_acl 0 53512 NULL ++set_registers_53582 set_registers 3 53582 NULL ++cifs_utf16_bytes_53593 cifs_utf16_bytes 0 53593 NULL ++__readw_53594 __readw 0 53594 NULL ++___alloc_bootmem_nopanic_53626 ___alloc_bootmem_nopanic 1 53626 NULL ++xd_write_multiple_pages_53633 xd_write_multiple_pages 6-5 53633 NULL ++ccid_getsockopt_builtin_ccids_53634 ccid_getsockopt_builtin_ccids 2 53634 NULL ++nr_sendmsg_53656 nr_sendmsg 4 53656 NULL ++_preload_range_53676 _preload_range 2-3 53676 NULL ++fuse_fill_write_pages_53682 fuse_fill_write_pages 4 53682 NULL ++v4l2_event_subscribe_53687 v4l2_event_subscribe 3 53687 NULL ++igb_alloc_q_vector_53690 igb_alloc_q_vector 4-6 53690 NULL nohasharray ++bdev_logical_block_size_53690 bdev_logical_block_size 0 53690 &igb_alloc_q_vector_53690 ++find_overflow_devnum_53711 find_overflow_devnum 0 53711 NULL ++bio_integrity_split_53714 bio_integrity_split 3 53714 NULL ++__ocfs2_resv_find_window_53721 __ocfs2_resv_find_window 3 53721 NULL ++wdm_write_53735 wdm_write 3 53735 NULL ++ext3_try_to_allocate_with_rsv_53737 ext3_try_to_allocate_with_rsv 5-3 53737 NULL ++da9052_disable_irq_53745 da9052_disable_irq 2 53745 NULL ++lpfc_idiag_queacc_read_qe_53755 lpfc_idiag_queacc_read_qe 0-2 53755 NULL nohasharray ++amdtp_out_stream_get_max_payload_53755 amdtp_out_stream_get_max_payload 0 53755 &lpfc_idiag_queacc_read_qe_53755 ++ext2_acl_count_53773 ext2_acl_count 0-1 53773 NULL ++__kfifo_dma_in_prepare_r_53792 __kfifo_dma_in_prepare_r 4-5 53792 NULL ++__tty_alloc_driver_53799 __tty_alloc_driver 1 53799 NULL ++regmap_raw_write_53803 regmap_raw_write 4-2 53803 NULL ++lpfc_idiag_ctlacc_read_reg_53809 lpfc_idiag_ctlacc_read_reg 0-3 53809 NULL ++nls_nullsize_53815 nls_nullsize 0 53815 NULL ++cpumask_next_zero_53835 cpumask_next_zero 1 53835 NULL ++pms_read_53873 pms_read 3 53873 NULL ++ieee80211_if_fmt_dropped_frames_congestion_53883 ieee80211_if_fmt_dropped_frames_congestion 3 53883 NULL ++ocfs2_rm_xattr_cluster_53900 ocfs2_rm_xattr_cluster 5-4-3 53900 NULL ++proc_file_read_53905 proc_file_read 3 53905 NULL ++azx_via_get_position_53916 azx_via_get_position 0 53916 NULL ++ocfs2_make_clusters_writable_53938 ocfs2_make_clusters_writable 4 53938 NULL ++mthca_setup_cmd_doorbells_53954 mthca_setup_cmd_doorbells 2 53954 NULL ++mlx4_num_eq_uar_53965 mlx4_num_eq_uar 0 53965 NULL ++idetape_chrdev_write_53976 idetape_chrdev_write 3 53976 NULL ++__ocfs2_xattr_set_value_outside_53981 __ocfs2_xattr_set_value_outside 5 53981 NULL ++ieee80211_if_fmt_dot11MeshHWMPperrMinInterval_53998 ieee80211_if_fmt_dot11MeshHWMPperrMinInterval 3 53998 NULL ++snd_pcm_lib_write_transfer_54018 snd_pcm_lib_write_transfer 4-2-5 54018 NULL ++cmpk_message_handle_tx_54024 cmpk_message_handle_tx 4 54024 NULL ++ipxrtr_route_packet_54036 ipxrtr_route_packet 4 54036 NULL ++pipeline_dec_packet_out_read_54052 pipeline_dec_packet_out_read 3 54052 NULL ++nl80211_send_disconnected_54056 nl80211_send_disconnected 5 54056 NULL ++rproc_state_read_54057 rproc_state_read 3 54057 NULL ++_malloc_54077 _malloc 1 54077 NULL ++bitmap_bitremap_54096 bitmap_bitremap 4 54096 NULL ++altera_set_ir_pre_54103 altera_set_ir_pre 2 54103 NULL ++create_xattr_54106 create_xattr 5 54106 NULL ++strn_len_54122 strn_len 0 54122 NULL ++isku_receive_54130 isku_receive 4 54130 NULL ++isr_host_acknowledges_read_54136 isr_host_acknowledges_read 3 54136 NULL ++i2400m_zrealloc_2x_54166 i2400m_zrealloc_2x 3 54166 NULL nohasharray ++memcpy_toiovec_54166 memcpy_toiovec 3 54166 &i2400m_zrealloc_2x_54166 ++nouveau_falcon_create__54169 nouveau_falcon_create_ 8 54169 NULL ++acpi_os_read_memory_54186 acpi_os_read_memory 1-3 54186 NULL ++__register_chrdev_54223 __register_chrdev 2-3 54223 NULL ++_format_mac_addr_54229 _format_mac_addr 2-0 54229 NULL ++pi_read_regr_54231 pi_read_regr 0 54231 NULL ++reada_add_block_54247 reada_add_block 2 54247 NULL ++xfs_dir2_sf_addname_hard_54254 xfs_dir2_sf_addname_hard 3 54254 NULL ++ceph_msgpool_get_54258 ceph_msgpool_get 2 54258 NULL ++wusb_prf_54261 wusb_prf 7 54261 NULL nohasharray ++audio_write_54261 audio_write 4 54261 &wusb_prf_54261 ++mwifiex_getlog_read_54269 mwifiex_getlog_read 3 54269 NULL ++ubi_calc_data_len_54279 ubi_calc_data_len 0-3 54279 NULL ++altera_set_dr_post_54291 altera_set_dr_post 2 54291 NULL ++dlm_alloc_pagevec_54296 dlm_alloc_pagevec 1 54296 NULL ++sprintf_54306 sprintf 0 54306 NULL ++irq_domain_associate_many_54307 irq_domain_associate_many 2 54307 NULL ++br_fdb_fillbuf_54339 br_fdb_fillbuf 0 54339 NULL ++__alloc_dev_table_54343 __alloc_dev_table 2 54343 NULL ++__get_free_pages_54352 __get_free_pages 0 54352 NULL nohasharray ++_osd_realloc_seg_54352 _osd_realloc_seg 3 54352 &__get_free_pages_54352 ++tcf_hash_create_54360 tcf_hash_create 4 54360 NULL ++read_file_credit_dist_stats_54367 read_file_credit_dist_stats 3 54367 NULL ++vfs_readlink_54368 vfs_readlink 3 54368 NULL ++do_dccp_setsockopt_54377 do_dccp_setsockopt 5 54377 NULL nohasharray ++intel_sdvo_write_cmd_54377 intel_sdvo_write_cmd 4 54377 &do_dccp_setsockopt_54377 ++ah_alloc_tmp_54378 ah_alloc_tmp 3-2 54378 NULL ++gart_unmap_page_54379 gart_unmap_page 2-3 54379 NULL ++snd_pcm_oss_read2_54387 snd_pcm_oss_read2 0-3 54387 NULL ++i386_mmap_check_54388 i386_mmap_check 0 54388 NULL ++__do_krealloc_54389 __do_krealloc 2 54389 NULL ++iwl_dbgfs_power_save_status_read_54392 iwl_dbgfs_power_save_status_read 3 54392 NULL ++simple_strtoull_54493 simple_strtoull 0 54493 NULL ++btrfs_ordered_sum_size_54509 btrfs_ordered_sum_size 0-2 54509 NULL ++cgroup_write_X64_54514 cgroup_write_X64 5 54514 NULL ++rfc4106_set_key_54519 rfc4106_set_key 3 54519 NULL ++viacam_read_54526 viacam_read 3 54526 NULL ++unix_dgram_connect_54535 unix_dgram_connect 3 54535 NULL ++setsockopt_54539 setsockopt 5 54539 NULL ++mwifiex_usb_submit_rx_urb_54558 mwifiex_usb_submit_rx_urb 2 54558 NULL ++nfsd_vfs_write_54577 nfsd_vfs_write 6 54577 NULL ++fw_iso_buffer_init_54582 fw_iso_buffer_init 3 54582 NULL ++nvme_npages_54601 nvme_npages 0-1 54601 NULL ++fwSendNullPacket_54618 fwSendNullPacket 2 54618 NULL ++irq_of_parse_and_map_54646 irq_of_parse_and_map 0 54646 NULL ++irq_timeout_read_54653 irq_timeout_read 3 54653 NULL ++dns_resolver_read_54658 dns_resolver_read 3 54658 NULL ++twl6030_interrupt_mask_54659 twl6030_interrupt_mask 2 54659 NULL ++bio_kmalloc_54672 bio_kmalloc 2 54672 NULL ++vring_new_virtqueue_54673 vring_new_virtqueue 2 54673 NULL ++evm_read_key_54674 evm_read_key 3 54674 NULL ++resource_string_54699 resource_string 0 54699 NULL ++platform_get_irq_byname_54700 platform_get_irq_byname 0 54700 NULL ++rfkill_fop_read_54711 rfkill_fop_read 3 54711 NULL ++_add_sg_continuation_descriptor_54721 _add_sg_continuation_descriptor 3 54721 NULL ++ocfs2_control_write_54737 ocfs2_control_write 3 54737 NULL ++kzalloc_54740 kzalloc 1 54740 NULL ++wep_iv_read_54744 wep_iv_read 3 54744 NULL ++iio_event_chrdev_read_54757 iio_event_chrdev_read 3 54757 NULL ++batadv_iv_ogm_aggregate_new_54761 batadv_iv_ogm_aggregate_new 2 54761 NULL ++adis16480_show_firmware_date_54762 adis16480_show_firmware_date 3 54762 NULL ++flexcop_device_kmalloc_54793 flexcop_device_kmalloc 1 54793 NULL ++domain_init_54797 domain_init 2 54797 NULL ++ext3_find_goal_54801 ext3_find_goal 0 54801 NULL ++nfsd_write_54809 nfsd_write 6 54809 NULL ++aes_decrypt_fail_read_54815 aes_decrypt_fail_read 3 54815 NULL nohasharray ++crypto_tfm_ctx_alignment_54815 crypto_tfm_ctx_alignment 0 54815 &aes_decrypt_fail_read_54815 ++generic_perform_write_54832 generic_perform_write 3 54832 NULL ++write_rio_54837 write_rio 3 54837 NULL ++nouveau_engctx_create__54839 nouveau_engctx_create_ 8 54839 NULL nohasharray ++ext3_acl_from_disk_54839 ext3_acl_from_disk 2 54839 &nouveau_engctx_create__54839 ++ufx_ops_write_54848 ufx_ops_write 3 54848 NULL ++printer_read_54851 printer_read 3 54851 NULL ++alloc_ep_req_54860 alloc_ep_req 2 54860 NULL ++broadsheet_spiflash_rewrite_sector_54864 broadsheet_spiflash_rewrite_sector 2 54864 NULL ++prism_build_supp_rates_54865 prism_build_supp_rates 0 54865 NULL ++tcf_csum_ipv6_tcp_54877 tcf_csum_ipv6_tcp 4 54877 NULL ++lm3533_led_get_lv_reg_54900 lm3533_led_get_lv_reg 0-2 54900 NULL ++iscsi_pool_init_54913 iscsi_pool_init 2-4 54913 NULL ++btrfs_stack_chunk_num_stripes_54923 btrfs_stack_chunk_num_stripes 0 54923 NULL ++mxms_structlen_54939 mxms_structlen 0 54939 NULL ++add_port_54941 add_port 2 54941 NULL ++virtblk_add_buf_wait_54943 virtblk_add_buf_wait 3-4 54943 NULL ++wl12xx_cmd_build_probe_req_54946 wl12xx_cmd_build_probe_req 6-8 54946 NULL ++ath9k_dump_btcoex_54949 ath9k_dump_btcoex 0 54949 NULL ++c4_add_card_54968 c4_add_card 3 54968 NULL ++iwl_pcie_dump_fh_54975 iwl_pcie_dump_fh 0 54975 NULL ++__proc_file_read_54978 __proc_file_read 3 54978 NULL ++ext3_xattr_get_54989 ext3_xattr_get 0 54989 NULL ++rds_ib_inc_copy_to_user_55007 rds_ib_inc_copy_to_user 3 55007 NULL ++cx231xx_v4l2_read_55014 cx231xx_v4l2_read 3 55014 NULL ++error_error_null_Frame_tx_start_read_55024 error_error_null_Frame_tx_start_read 3 55024 NULL ++__netdev_alloc_skb_ip_align_55067 __netdev_alloc_skb_ip_align 2 55067 NULL ++apei_exec_run_55075 apei_exec_run 0 55075 NULL ++bitmap_storage_alloc_55077 bitmap_storage_alloc 2 55077 NULL ++snd_pcm_capture_hw_avail_55086 snd_pcm_capture_hw_avail 0 55086 NULL ++rxpipe_beacon_buffer_thres_host_int_trig_rx_data_read_55106 rxpipe_beacon_buffer_thres_host_int_trig_rx_data_read 3 55106 NULL ++corrupt_data_55120 corrupt_data 0 55120 NULL ++crypto_ahash_setkey_55134 crypto_ahash_setkey 3 55134 NULL ++ocfs2_prepare_refcount_change_for_del_55137 ocfs2_prepare_refcount_change_for_del 3 55137 NULL nohasharray ++filldir_55137 filldir 3 55137 &ocfs2_prepare_refcount_change_for_del_55137 ++ocfs2_truncate_file_55148 ocfs2_truncate_file 3 55148 NULL ++ieee80211_if_read_uapsd_queues_55150 ieee80211_if_read_uapsd_queues 3 55150 NULL ++mtd_get_fact_prot_info_55186 mtd_get_fact_prot_info 0 55186 NULL ++sel_write_relabel_55195 sel_write_relabel 3 55195 NULL ++sched_feat_write_55202 sched_feat_write 3 55202 NULL ++ht40allow_map_read_55209 ht40allow_map_read 3 55209 NULL nohasharray ++pcf50633_gpio_set_55209 pcf50633_gpio_set 2 55209 &ht40allow_map_read_55209 ++ssd1307fb_write_cmd_array_55211 ssd1307fb_write_cmd_array 3 55211 NULL nohasharray ++__kfifo_dma_out_prepare_r_55211 __kfifo_dma_out_prepare_r 4-5 55211 &ssd1307fb_write_cmd_array_55211 ++do_raw_setsockopt_55215 do_raw_setsockopt 5 55215 NULL ++dbAllocDmap_55227 dbAllocDmap 0 55227 NULL ++tipc_port_reject_sections_55229 tipc_port_reject_sections 5 55229 NULL ++register_unifi_sdio_55239 register_unifi_sdio 2 55239 NULL ++memcpy_fromiovec_55247 memcpy_fromiovec 3 55247 NULL ++ptrace_request_55288 ptrace_request 3 55288 NULL ++rx_streaming_interval_read_55291 rx_streaming_interval_read 3 55291 NULL ++rbd_create_rw_ops_55297 rbd_create_rw_ops 1 55297 NULL ++gsm_control_modem_55303 gsm_control_modem 3 55303 NULL ++__get_vm_area_node_55305 __get_vm_area_node 1 55305 NULL ++vme_user_read_55338 vme_user_read 3 55338 NULL ++sctp_datamsg_from_user_55342 sctp_datamsg_from_user 4 55342 NULL nohasharray ++__wa_xfer_setup_sizes_55342 __wa_xfer_setup_sizes 0 55342 &sctp_datamsg_from_user_55342 ++acpi_system_read_event_55362 acpi_system_read_event 3 55362 NULL ++__send_to_port_55383 __send_to_port 3 55383 NULL ++nf_nat_ipv4_manip_pkt_55387 nf_nat_ipv4_manip_pkt 2 55387 NULL ++iwl_dbgfs_plcp_delta_read_55407 iwl_dbgfs_plcp_delta_read 3 55407 NULL ++alloc_skb_55439 alloc_skb 1 55439 NULL ++__vxge_hw_channel_allocate_55462 __vxge_hw_channel_allocate 3 55462 NULL ++isdnhdlc_decode_55466 isdnhdlc_decode 0 55466 NULL ++cx23888_ir_rx_read_55473 cx23888_ir_rx_read 3 55473 NULL ++batadv_unicast_push_and_fill_skb_55474 batadv_unicast_push_and_fill_skb 2 55474 NULL ++snd_pcm_lib_write_55483 snd_pcm_lib_write 0-3 55483 NULL ++i2o_pool_alloc_55485 i2o_pool_alloc 4 55485 NULL ++wm5100_gpio_direction_out_55497 wm5100_gpio_direction_out 2 55497 NULL ++ocfs2_rec_clusters_55501 ocfs2_rec_clusters 0 55501 NULL ++ext4_flex_bg_size_55502 ext4_flex_bg_size 0 55502 NULL ++cfpkt_pad_trail_55511 cfpkt_pad_trail 2 55511 NULL nohasharray ++tx_tx_done_int_template_read_55511 tx_tx_done_int_template_read 3 55511 &cfpkt_pad_trail_55511 ++ea_get_55522 ea_get 0 55522 NULL ++buffer_size_55534 buffer_size 0 55534 NULL ++set_msr_interception_55538 set_msr_interception 2 55538 NULL ++tty_port_register_device_55543 tty_port_register_device 3 55543 NULL ++add_partition_55588 add_partition 2 55588 NULL ++macvtap_put_user_55609 macvtap_put_user 4 55609 NULL ++selinux_setprocattr_55611 selinux_setprocattr 4 55611 NULL ++reiserfs_xattr_get_55628 reiserfs_xattr_get 0 55628 NULL nohasharray ++pktgen_if_write_55628 pktgen_if_write 3 55628 &reiserfs_xattr_get_55628 ++dvb_dmxdev_set_buffer_size_55643 dvb_dmxdev_set_buffer_size 2 55643 NULL ++mlx4_buddy_alloc_55647 mlx4_buddy_alloc 2 55647 NULL ++xfs_bmbt_maxrecs_55649 xfs_bmbt_maxrecs 0-2 55649 NULL ++ib_umad_compat_ioctl_55650 ib_umad_compat_ioctl 3 55650 NULL ++cfg80211_send_rx_assoc_55651 cfg80211_send_rx_assoc 4 55651 NULL ++read_oldmem_55658 read_oldmem 3 55658 NULL ++lpfc_idiag_queinfo_read_55662 lpfc_idiag_queinfo_read 3 55662 NULL ++il_dbgfs_tx_queue_read_55668 il_dbgfs_tx_queue_read 3 55668 NULL ++get_info_55681 get_info 3 55681 NULL ++arizona_gpio_direction_in_55690 arizona_gpio_direction_in 2 55690 NULL ++wil_vring_alloc_skb_55703 wil_vring_alloc_skb 4 55703 NULL ++__videobuf_alloc_uncached_55711 __videobuf_alloc_uncached 1 55711 NULL ++pm8001_store_update_fw_55716 pm8001_store_update_fw 4 55716 NULL ++mtdswap_init_55719 mtdswap_init 2 55719 NULL ++__iio_allocate_kfifo_55738 __iio_allocate_kfifo 3-2 55738 NULL ++set_local_name_55757 set_local_name 4 55757 NULL ++btrfs_init_new_buffer_55761 btrfs_init_new_buffer 4 55761 NULL ++strlen_55778 strlen 0 55778 NULL nohasharray ++is_idx_node_in_tnc_55778 is_idx_node_in_tnc 0 55778 &strlen_55778 ++req_bio_endio_55786 req_bio_endio 3 55786 NULL nohasharray ++conf_read_55786 conf_read 3 55786 &req_bio_endio_55786 ++uwb_rc_neh_grok_event_55799 uwb_rc_neh_grok_event 3 55799 NULL ++btrfs_find_create_tree_block_55812 btrfs_find_create_tree_block 3 55812 NULL ++sb16_copy_from_user_55836 sb16_copy_from_user 10-6-7 55836 NULL ++ip_hdrlen_55849 ip_hdrlen 0 55849 NULL ++hcd_alloc_coherent_55862 hcd_alloc_coherent 5 55862 NULL ++shmem_setxattr_55867 shmem_setxattr 4 55867 NULL ++hsc_write_55875 hsc_write 3 55875 NULL ++pm_qos_power_read_55891 pm_qos_power_read 3 55891 NULL ++snd_pcm_hw_param_value_min_55917 snd_pcm_hw_param_value_min 0 55917 NULL ++sel_read_policy_55947 sel_read_policy 3 55947 NULL ++handle_response_55951 handle_response 5 55951 NULL ++simple_read_from_buffer_55957 simple_read_from_buffer 2-5 55957 NULL ++tx_tx_imm_resp_read_55964 tx_tx_imm_resp_read 3 55964 NULL ++ssb_bus_pcmciabus_register_56020 ssb_bus_pcmciabus_register 3 56020 NULL ++nvme_alloc_iod_56027 nvme_alloc_iod 1-2 56027 NULL ++dccp_sendmsg_56058 dccp_sendmsg 4 56058 NULL ++pscsi_get_bio_56103 pscsi_get_bio 1 56103 NULL ++usb_alloc_stream_buffers_56123 usb_alloc_stream_buffers 3 56123 NULL ++kmem_zalloc_large_56128 kmem_zalloc_large 1 56128 NULL ++sel_read_handle_status_56139 sel_read_handle_status 3 56139 NULL ++map_addr_56144 map_addr 7 56144 NULL ++rawv6_setsockopt_56165 rawv6_setsockopt 5 56165 NULL ++create_irq_nr_56180 create_irq_nr 1 56180 NULL ++ath9k_dump_legacy_btcoex_56194 ath9k_dump_legacy_btcoex 0 56194 NULL ++skb_headroom_56200 skb_headroom 0 56200 NULL ++usb_dump_iad_descriptor_56204 usb_dump_iad_descriptor 0 56204 NULL ++ncp_read_bounce_size_56221 ncp_read_bounce_size 0-1 56221 NULL ++ocfs2_find_xe_in_bucket_56224 ocfs2_find_xe_in_bucket 0 56224 NULL ++cp210x_get_config_56229 cp210x_get_config 4 56229 NULL ++do_ipt_set_ctl_56238 do_ipt_set_ctl 4 56238 NULL ++scrub_setup_recheck_block_56245 scrub_setup_recheck_block 4-3 56245 NULL ++fd_copyin_56247 fd_copyin 3 56247 NULL ++sk_rmem_schedule_56255 sk_rmem_schedule 3 56255 NULL ++il4965_ucode_general_stats_read_56277 il4965_ucode_general_stats_read 3 56277 NULL ++ieee80211_if_fmt_user_power_level_56283 ieee80211_if_fmt_user_power_level 3 56283 NULL ++RESIZE_IF_NEEDED_56286 RESIZE_IF_NEEDED 2 56286 NULL ++dvb_aplay_56296 dvb_aplay 3 56296 NULL ++btmrvl_hscfgcmd_read_56303 btmrvl_hscfgcmd_read 3 56303 NULL ++compat_cdrom_read_audio_56304 compat_cdrom_read_audio 4 56304 NULL ++pipeline_pre_to_defrag_swi_read_56321 pipeline_pre_to_defrag_swi_read 3 56321 NULL ++journal_init_revoke_table_56331 journal_init_revoke_table 1 56331 NULL ++snd_rawmidi_read_56337 snd_rawmidi_read 3 56337 NULL ++sixpack_compat_ioctl_56346 sixpack_compat_ioctl 4 56346 NULL ++vxge_os_dma_malloc_async_56348 vxge_os_dma_malloc_async 3 56348 NULL ++tps80031_ext_power_req_config_56353 tps80031_ext_power_req_config 3-4-5 56353 NULL ++iov_iter_copy_from_user_atomic_56368 iov_iter_copy_from_user_atomic 4 56368 NULL ++dev_read_56369 dev_read 3 56369 NULL ++alloc_dummy_extent_buffer_56374 alloc_dummy_extent_buffer 2 56374 NULL ++snd_pcm_common_ioctl1_56382 snd_pcm_common_ioctl1 0 56382 NULL ++ocfs2_control_read_56405 ocfs2_control_read 3 56405 NULL ++__get_vm_area_caller_56416 __get_vm_area_caller 1 56416 NULL nohasharray ++acpi_os_write_memory_56416 acpi_os_write_memory 1-3 56416 &__get_vm_area_caller_56416 ++store_msg_56417 store_msg 3 56417 NULL ++pppol2tp_sendmsg_56420 pppol2tp_sendmsg 4 56420 NULL ++ec_dbgfs_cmd_read_56431 ec_dbgfs_cmd_read 3 56431 NULL ++fl_create_56435 fl_create 5 56435 NULL ++gnttab_map_56439 gnttab_map 2 56439 NULL ++cx231xx_init_isoc_56453 cx231xx_init_isoc 3-2 56453 NULL ++set_connectable_56458 set_connectable 4 56458 NULL ++osd_req_list_partition_objects_56464 osd_req_list_partition_objects 5 56464 NULL ++calc_linear_pos_56472 calc_linear_pos 0-3 56472 NULL ++crypto_shash_alignmask_56486 crypto_shash_alignmask 0 56486 NULL ++cfg80211_connect_result_56515 cfg80211_connect_result 4-6 56515 NULL ++ip_options_get_56538 ip_options_get 4 56538 NULL ++ocfs2_change_extent_flag_56549 ocfs2_change_extent_flag 5 56549 NULL ++alloc_apertures_56561 alloc_apertures 1 56561 NULL ++rs_sta_dbgfs_stats_table_read_56573 rs_sta_dbgfs_stats_table_read 3 56573 NULL ++portcntrs_2_read_56586 portcntrs_2_read 3 56586 NULL ++event_filter_write_56609 event_filter_write 3 56609 NULL ++gather_array_56641 gather_array 3 56641 NULL ++uvc_debugfs_stats_read_56651 uvc_debugfs_stats_read 3 56651 NULL ++snd_gus_dram_read_56686 snd_gus_dram_read 4 56686 NULL nohasharray ++da9055_gpio_to_irq_56686 da9055_gpio_to_irq 2 56686 &snd_gus_dram_read_56686 ++dvb_ringbuffer_read_user_56702 dvb_ringbuffer_read_user 3 56702 NULL ++sta_flags_read_56710 sta_flags_read 3 56710 NULL ++ipv6_getsockopt_sticky_56711 ipv6_getsockopt_sticky 5 56711 NULL ++__wa_xfer_setup_segs_56725 __wa_xfer_setup_segs 2 56725 NULL ++pcpu_populate_chunk_56741 pcpu_populate_chunk 2-3 56741 NULL ++drm_agp_bind_pages_56748 drm_agp_bind_pages 3 56748 NULL ++btrfsic_map_block_56751 btrfsic_map_block 2 56751 NULL ++alloc_iommu_56778 alloc_iommu 2-3 56778 NULL ++__carl9170_rx_56784 __carl9170_rx 3 56784 NULL ++do_syslog_56807 do_syslog 3 56807 NULL ++mtdchar_write_56831 mtdchar_write 3 56831 NULL nohasharray ++ntfs_rl_realloc_56831 ntfs_rl_realloc 3 56831 &mtdchar_write_56831 ++snd_rawmidi_kernel_write1_56847 snd_rawmidi_kernel_write1 4 56847 NULL ++ext3_xattr_ibody_get_56880 ext3_xattr_ibody_get 0 56880 NULL ++pvr2_debugifc_print_status_56890 pvr2_debugifc_print_status 3 56890 NULL ++debug_debug3_read_56894 debug_debug3_read 3 56894 NULL ++batadv_tt_update_changes_56895 batadv_tt_update_changes 3 56895 NULL ++strcspn_56913 strcspn 0 56913 NULL ++__kfifo_out_56927 __kfifo_out 0-3 56927 NULL ++check_header_56930 check_header 2 56930 NULL ++journal_init_revoke_56933 journal_init_revoke 2 56933 NULL ++diva_get_driver_info_56967 diva_get_driver_info 0 56967 NULL ++nouveau_device_create__56984 nouveau_device_create_ 6 56984 NULL ++vlsi_alloc_ring_57003 vlsi_alloc_ring 3-4 57003 NULL ++btrfs_super_csum_size_57004 btrfs_super_csum_size 0 57004 NULL ++skb_network_offset_57043 skb_network_offset 0 57043 NULL nohasharray ++ieee80211_if_fmt_state_57043 ieee80211_if_fmt_state 3 57043 &skb_network_offset_57043 ++bytes_to_samples_57049 bytes_to_samples 0-2 57049 NULL ++xfs_buf_read_map_57053 xfs_buf_read_map 3 57053 NULL ++autofs_dev_ioctl_compat_57059 autofs_dev_ioctl_compat 3 57059 NULL ++cx2341x_ctrl_new_std_57061 cx2341x_ctrl_new_std 4 57061 NULL ++sca3000_read_data_57064 sca3000_read_data 4 57064 NULL ++pcmcia_replace_cis_57066 pcmcia_replace_cis 3 57066 NULL ++sis190_try_rx_copy_57069 sis190_try_rx_copy 3 57069 NULL ++tracing_set_trace_write_57096 tracing_set_trace_write 3 57096 NULL ++snd_pcm_hw_params_old_user_57108 snd_pcm_hw_params_old_user 0 57108 NULL ++crypto_compress_ctxsize_57109 crypto_compress_ctxsize 0 57109 NULL ++sysfs_write_file_57116 sysfs_write_file 3 57116 NULL ++cipso_v4_gentag_loc_57119 cipso_v4_gentag_loc 0 57119 NULL ++nl80211_send_deauth_57136 nl80211_send_deauth 4 57136 NULL nohasharray ++rds_ib_sub_signaled_57136 rds_ib_sub_signaled 2 57136 &nl80211_send_deauth_57136 nohasharray ++ima_show_htable_value_57136 ima_show_htable_value 2 57136 &rds_ib_sub_signaled_57136 ++snd_sonicvibes_getdmac_57140 snd_sonicvibes_getdmac 0 57140 NULL ++udl_prime_create_57159 udl_prime_create 2 57159 NULL ++stk_prepare_sio_buffers_57168 stk_prepare_sio_buffers 2 57168 NULL ++rx_hw_stuck_read_57179 rx_hw_stuck_read 3 57179 NULL ++tt3650_ci_msg_57219 tt3650_ci_msg 4 57219 NULL ++dma_fifo_alloc_57236 dma_fifo_alloc 5-3-2 57236 NULL ++ieee80211_if_fmt_tsf_57249 ieee80211_if_fmt_tsf 3 57249 NULL ++oprofilefs_ulong_from_user_57251 oprofilefs_ulong_from_user 3 57251 NULL ++alloc_flex_gd_57259 alloc_flex_gd 1 57259 NULL ++security_mmap_file_57268 security_mmap_file 0 57268 NULL ++pstore_file_read_57288 pstore_file_read 3 57288 NULL ++snd_pcm_read_57289 snd_pcm_read 3 57289 NULL ++ath6kl_buf_alloc_57304 ath6kl_buf_alloc 1 57304 NULL ++fw_file_size_57307 fw_file_size 0 57307 NULL ++ftdi_elan_write_57309 ftdi_elan_write 3 57309 NULL ++__mxt_write_reg_57326 __mxt_write_reg 3 57326 NULL ++ocfs2_xattr_shrink_size_57328 ocfs2_xattr_shrink_size 3 57328 NULL ++check_mirror_57342 check_mirror 1-2 57342 NULL nohasharray ++usblp_read_57342 usblp_read 3 57342 &check_mirror_57342 ++print_devstats_dot11RTSFailureCount_57347 print_devstats_dot11RTSFailureCount 3 57347 NULL ++tipc_bclink_stats_57372 tipc_bclink_stats 2 57372 NULL ++max8997_irq_domain_map_57375 max8997_irq_domain_map 2 57375 NULL ++tty_register_device_attr_57381 tty_register_device_attr 2 57381 NULL ++read_file_blob_57406 read_file_blob 3 57406 NULL ++enclosure_register_57412 enclosure_register 3 57412 NULL ++gre_manip_pkt_57416 gre_manip_pkt 4 57416 NULL ++wm831x_gpio_set_debounce_57428 wm831x_gpio_set_debounce 2 57428 NULL ++compat_keyctl_instantiate_key_iov_57431 compat_keyctl_instantiate_key_iov 3 57431 NULL nohasharray ++alloc_ftrace_hash_57431 alloc_ftrace_hash 1 57431 &compat_keyctl_instantiate_key_iov_57431 ++copy_to_user_fromio_57432 copy_to_user_fromio 3 57432 NULL ++sys_pselect6_57449 sys_pselect6 1 57449 NULL ++ReadReg_57453 ReadReg 0 57453 NULL ++__roundup_pow_of_two_57461 __roundup_pow_of_two 0 57461 NULL ++crypto_tfm_alg_blocksize_57463 crypto_tfm_alg_blocksize 0 57463 NULL nohasharray ++send_midi_async_57463 send_midi_async 3 57463 &crypto_tfm_alg_blocksize_57463 ++sisusb_clear_vram_57466 sisusb_clear_vram 3-2 57466 NULL ++ieee80211_if_read_flags_57470 ieee80211_if_read_flags 3 57470 NULL nohasharray ++sep_lock_user_pages_57470 sep_lock_user_pages 2-3 57470 &ieee80211_if_read_flags_57470 ++ocfs2_write_cluster_57483 ocfs2_write_cluster 8-2-9 57483 NULL ++bnad_debugfs_write_regwr_57500 bnad_debugfs_write_regwr 3 57500 NULL ++skb_headlen_57501 skb_headlen 0 57501 NULL ++copy_in_user_57502 copy_in_user 3 57502 NULL ++ks8842_read32_57505 ks8842_read32 0 57505 NULL nohasharray ++ckhdid_printf_57505 ckhdid_printf 2 57505 &ks8842_read32_57505 ++init_tag_map_57515 init_tag_map 3 57515 NULL ++wil_read_file_ssid_57517 wil_read_file_ssid 3 57517 NULL nohasharray ++il_dbgfs_force_reset_read_57517 il_dbgfs_force_reset_read 3 57517 &wil_read_file_ssid_57517 ++inode_permission_57531 inode_permission 0 57531 NULL ++acpi_dev_get_resources_57534 acpi_dev_get_resources 0 57534 NULL nohasharray ++DoC_Probe_57534 DoC_Probe 1 57534 &acpi_dev_get_resources_57534 ++ext4_group_first_block_no_57559 ext4_group_first_block_no 0-2 57559 NULL ++snd_pcm_playback_ioctl1_57569 snd_pcm_playback_ioctl1 0 57569 NULL ++lp8788_update_bits_57600 lp8788_update_bits 2 57600 NULL ++wm831x_gpio_to_irq_57614 wm831x_gpio_to_irq 2 57614 NULL ++sk_stream_alloc_skb_57622 sk_stream_alloc_skb 2 57622 NULL ++tps65217_reg_write_57623 tps65217_reg_write 2 57623 NULL nohasharray ++tx_tx_retry_template_read_57623 tx_tx_retry_template_read 3 57623 &tps65217_reg_write_57623 ++osdmap_set_max_osd_57630 osdmap_set_max_osd 2 57630 NULL nohasharray ++sisusbcon_putcs_57630 sisusbcon_putcs 3 57630 &osdmap_set_max_osd_57630 ++mem_read_57631 mem_read 3 57631 NULL ++tc3589x_irq_map_57639 tc3589x_irq_map 2 57639 NULL ++sys_mq_timedsend_57661 sys_mq_timedsend 3 57661 NULL ++r3964_write_57662 r3964_write 4 57662 NULL ++proc_ns_readlink_57664 proc_ns_readlink 3 57664 NULL ++__lgwrite_57669 __lgwrite 4 57669 NULL ++ieee80211_MFIE_rate_len_57692 ieee80211_MFIE_rate_len 0 57692 NULL ++f1x_match_to_this_node_57695 f1x_match_to_this_node 3 57695 NULL ++check_prefree_segments_57702 check_prefree_segments 2 57702 NULL ++i2400m_rx_stats_read_57706 i2400m_rx_stats_read 3 57706 NULL ++ieee80211_if_read_dot11MeshHWMPconfirmationInterval_57722 ieee80211_if_read_dot11MeshHWMPconfirmationInterval 3 57722 NULL ++compat_sys_set_mempolicy_57742 compat_sys_set_mempolicy 3 57742 NULL ++ieee80211_if_fmt_dot11MeshHWMPpreqMinInterval_57762 ieee80211_if_fmt_dot11MeshHWMPpreqMinInterval 3 57762 NULL ++ld2_57794 ld2 0 57794 NULL ++ivtv_read_57796 ivtv_read 3 57796 NULL ++generic_ptrace_peekdata_57806 generic_ptrace_peekdata 2 57806 NULL ++usb_dump_config_57817 usb_dump_config 0 57817 NULL ++bfad_debugfs_read_regrd_57830 bfad_debugfs_read_regrd 3 57830 NULL ++copy_to_user_57835 copy_to_user 3 57835 NULL ++flash_read_57843 flash_read 3 57843 NULL ++xt_alloc_table_info_57903 xt_alloc_table_info 1 57903 NULL ++ad5380_info_to_reg_57905 ad5380_info_to_reg 0 57905 NULL ++emi26_writememory_57908 emi26_writememory 4 57908 NULL ++iio_read_first_n_kfifo_57910 iio_read_first_n_kfifo 2 57910 NULL ++memcg_caches_array_size_57918 memcg_caches_array_size 0-1 57918 NULL ++twl_i2c_write_57923 twl_i2c_write 4-3 57923 NULL ++__snd_gf1_look16_57925 __snd_gf1_look16 0 57925 NULL ++sel_read_handle_unknown_57933 sel_read_handle_unknown 3 57933 NULL ++key_algorithm_read_57946 key_algorithm_read 3 57946 NULL ++ip_set_alloc_57953 ip_set_alloc 1 57953 NULL nohasharray ++ioat3_dca_count_dca_slots_57953 ioat3_dca_count_dca_slots 0 57953 &ip_set_alloc_57953 ++i915_cache_sharing_write_57961 i915_cache_sharing_write 3 57961 NULL ++hfc_empty_fifo_57972 hfc_empty_fifo 2 57972 NULL ++rx_reset_counter_read_58001 rx_reset_counter_read 3 58001 NULL ++regcache_rbtree_insert_to_block_58009 regcache_rbtree_insert_to_block 5 58009 NULL ++iwl_dbgfs_ucode_rx_stats_read_58023 iwl_dbgfs_ucode_rx_stats_read 3 58023 NULL ++io_playback_transfer_58030 io_playback_transfer 4 58030 NULL ++mc13783_write_58033 mc13783_write 2 58033 NULL ++mce_async_out_58056 mce_async_out 3 58056 NULL ++ocfs2_find_leaf_58065 ocfs2_find_leaf 0 58065 NULL ++dt3155_alloc_coherent_58073 dt3155_alloc_coherent 2 58073 NULL ++cm4040_write_58079 cm4040_write 3 58079 NULL ++udi_log_event_58105 udi_log_event 3 58105 NULL ++savemem_58129 savemem 3 58129 NULL ++ipv6_flowlabel_opt_58135 ipv6_flowlabel_opt 3 58135 NULL nohasharray ++slhc_init_58135 slhc_init 1-2 58135 &ipv6_flowlabel_opt_58135 ++garmin_write_bulk_58191 garmin_write_bulk 3 58191 NULL ++asix_write_cmd_58192 asix_write_cmd 5 58192 NULL ++ieee80211_if_fmt_flags_58205 ieee80211_if_fmt_flags 3 58205 NULL ++btrfs_mksubvol_58240 btrfs_mksubvol 3 58240 NULL ++btrfsic_create_link_to_next_block_58246 btrfsic_create_link_to_next_block 4 58246 NULL ++read_file_debug_58256 read_file_debug 3 58256 NULL ++cfg80211_mgmt_tx_status_58266 cfg80211_mgmt_tx_status 4 58266 NULL ++profile_load_58267 profile_load 3 58267 NULL ++acpi_ds_build_internal_package_obj_58271 acpi_ds_build_internal_package_obj 3 58271 NULL ++r100_mm_rreg_58276 r100_mm_rreg 0 58276 NULL ++iscsi_decode_text_input_58292 iscsi_decode_text_input 4 58292 NULL ++ieee80211_if_read_dot11MeshTTL_58307 ieee80211_if_read_dot11MeshTTL 3 58307 NULL ++tx_tx_start_int_templates_read_58324 tx_tx_start_int_templates_read 3 58324 NULL ++pcim_iomap_58334 pcim_iomap 3 58334 NULL ++diva_init_dma_map_58336 diva_init_dma_map 3 58336 NULL ++ieee80211_send_probe_req_58337 ieee80211_send_probe_req 4-6 58337 NULL ++next_pidmap_58347 next_pidmap 2 58347 NULL ++vmalloc_to_sg_58354 vmalloc_to_sg 2 58354 NULL ++brcmf_debugfs_sdio_counter_read_58369 brcmf_debugfs_sdio_counter_read 3 58369 NULL ++il_dbgfs_status_read_58388 il_dbgfs_status_read 3 58388 NULL ++kvm_mmu_write_protect_pt_masked_58406 kvm_mmu_write_protect_pt_masked 3 58406 NULL ++i2400m_pld_size_58415 i2400m_pld_size 0 58415 NULL ++__mlx4_alloc_mtt_range_58418 __mlx4_alloc_mtt_range 2 58418 NULL ++__iio_add_chan_devattr_58451 __iio_add_chan_devattr 0 58451 NULL ++capabilities_read_58457 capabilities_read 3 58457 NULL ++batadv_iv_ogm_aggr_packet_58462 batadv_iv_ogm_aggr_packet 3 58462 NULL ++lpfc_idiag_baracc_read_58466 lpfc_idiag_baracc_read 3 58466 NULL nohasharray ++compat_do_ipt_set_ctl_58466 compat_do_ipt_set_ctl 4 58466 &lpfc_idiag_baracc_read_58466 ++snd_gf1_read_addr_58483 snd_gf1_read_addr 0 58483 NULL ++snd_rme96_capture_copy_58484 snd_rme96_capture_copy 5 58484 NULL ++batadv_bla_is_backbone_gw_58488 batadv_bla_is_backbone_gw 3 58488 NULL ++wm831x_reg_write_58489 wm831x_reg_write 2 58489 NULL ++rndis_add_response_58544 rndis_add_response 2 58544 NULL ++wep_decrypt_fail_read_58567 wep_decrypt_fail_read 3 58567 NULL ++sip_sprintf_addr_port_58574 sip_sprintf_addr_port 0 58574 NULL ++scnprint_mac_oui_58578 scnprint_mac_oui 3-0 58578 NULL ++ea_read_inline_58589 ea_read_inline 0 58589 NULL ++xip_file_read_58592 xip_file_read 3 58592 NULL ++gdth_search_isa_58595 gdth_search_isa 1 58595 NULL ++ebt_buf_count_58607 ebt_buf_count 0 58607 NULL ++skb_copy_to_page_nocache_58624 skb_copy_to_page_nocache 6 58624 NULL ++module_alloc_update_bounds_rx_58634 module_alloc_update_bounds_rx 1 58634 NULL nohasharray ++efi_ioremap_58634 efi_ioremap 1-2 58634 &module_alloc_update_bounds_rx_58634 ++tx_tx_start_fw_gen_read_58648 tx_tx_start_fw_gen_read 3 58648 NULL ++ocfs2_block_to_cluster_start_58653 ocfs2_block_to_cluster_start 2 58653 NULL ++find_zero_58685 find_zero 0-1 58685 NULL nohasharray ++mcs7830_set_reg_async_58685 mcs7830_set_reg_async 3 58685 &find_zero_58685 ++uwb_bce_print_IEs_58686 uwb_bce_print_IEs 4 58686 NULL ++tps6586x_writes_58689 tps6586x_writes 3-2 58689 NULL ++vmalloc_node_58700 vmalloc_node 1 58700 NULL ++acpi_map_58725 acpi_map 1-2 58725 NULL ++da9052_gpio_to_irq_58729 da9052_gpio_to_irq 2 58729 NULL ++csum_exist_in_range_58730 csum_exist_in_range 2 58730 NULL ++frames_to_bytes_58741 frames_to_bytes 0-2 58741 NULL ++ieee80211_if_write_tkip_mic_test_58748 ieee80211_if_write_tkip_mic_test 3 58748 NULL ++agp_allocate_memory_58761 agp_allocate_memory 2 58761 NULL ++__do_config_autodelink_58763 __do_config_autodelink 3 58763 NULL ++regmap_calc_reg_len_58795 regmap_calc_reg_len 0 58795 NULL ++raw_send_hdrinc_58803 raw_send_hdrinc 4 58803 NULL ++isku_sysfs_read_58806 isku_sysfs_read 6 58806 NULL ++ep_read_58813 ep_read 3 58813 NULL ++command_write_58841 command_write 3 58841 NULL ++ocfs2_truncate_log_append_58850 ocfs2_truncate_log_append 3 58850 NULL ++ath6kl_wmi_send_action_cmd_58860 ath6kl_wmi_send_action_cmd 7 58860 NULL ++hw_write_58881 hw_write 2 58881 NULL ++gs_alloc_req_58883 gs_alloc_req 2 58883 NULL ++cs553x_init_one_58886 cs553x_init_one 3 58886 NULL ++raw_ctl_compat_ioctl_58905 raw_ctl_compat_ioctl 3 58905 NULL ++print_devstats_dot11FCSErrorCount_58919 print_devstats_dot11FCSErrorCount 3 58919 NULL ++tun_chr_compat_ioctl_58921 tun_chr_compat_ioctl 3 58921 NULL ++pipeline_cs_rx_packet_out_read_58926 pipeline_cs_rx_packet_out_read 3 58926 NULL ++st5481_isoc_flatten_58952 st5481_isoc_flatten 0 58952 NULL ++ieee80211_if_fmt_dot11MeshHWMPactivePathToRootTimeout_58965 ieee80211_if_fmt_dot11MeshHWMPactivePathToRootTimeout 3 58965 NULL ++crypto_aead_ivsize_58970 crypto_aead_ivsize 0 58970 NULL ++handle_rx_packet_58993 handle_rx_packet 3 58993 NULL ++edac_align_ptr_59003 edac_align_ptr 0 59003 NULL ++ep_write_59008 ep_write 3 59008 NULL ++i915_ring_stop_write_59010 i915_ring_stop_write 3 59010 NULL ++init_pci_cap_msi_perm_59033 init_pci_cap_msi_perm 2 59033 NULL ++selinux_transaction_write_59038 selinux_transaction_write 3 59038 NULL ++crypto_aead_reqsize_59039 crypto_aead_reqsize 0 59039 NULL ++regmap_bulk_write_59049 regmap_bulk_write 4-2 59049 NULL ++da9052_gpio_direction_input_59062 da9052_gpio_direction_input 2 59062 NULL ++vfio_device_fops_compat_ioctl_59111 vfio_device_fops_compat_ioctl 3 59111 NULL ++mmc_sd_num_wr_blocks_59112 mmc_sd_num_wr_blocks 0 59112 NULL ++scsi_io_completion_59122 scsi_io_completion 2 59122 NULL ++nfc_llcp_send_i_frame_59130 nfc_llcp_send_i_frame 3 59130 NULL ++__iio_add_event_config_attrs_59136 __iio_add_event_config_attrs 0 59136 NULL ++print_devstats_dot11RTSSuccessCount_59145 print_devstats_dot11RTSSuccessCount 3 59145 NULL nohasharray ++framebuffer_alloc_59145 framebuffer_alloc 1 59145 &print_devstats_dot11RTSSuccessCount_59145 ++radeon_compat_ioctl_59150 radeon_compat_ioctl 2 59150 NULL ++pvr2_hdw_report_clients_59152 pvr2_hdw_report_clients 3 59152 NULL ++setup_window_59178 setup_window 4-2-5-7 59178 NULL ++ocfs2_move_extent_59187 ocfs2_move_extent 3 59187 NULL ++xfs_iext_realloc_indirect_59211 xfs_iext_realloc_indirect 2 59211 NULL ++fast_rx_path_59214 fast_rx_path 3 59214 NULL ++inftl_partscan_59216 inftl_partscan 0 59216 NULL ++skb_transport_header_59223 skb_transport_header 0 59223 NULL ++dt3155_read_59226 dt3155_read 3 59226 NULL ++paging64_gpte_to_gfn_lvl_59229 paging64_gpte_to_gfn_lvl 0-1-2 59229 NULL ++rbd_do_request_59239 rbd_do_request 6-7 59239 NULL ++tty_prepare_flip_string_flags_59240 tty_prepare_flip_string_flags 4 59240 NULL ++solo_v4l2_read_59247 solo_v4l2_read 3 59247 NULL ++nla_len_59258 nla_len 0 59258 NULL ++da9055_reg_update_59280 da9055_reg_update 2 59280 NULL ++btrfs_insert_dir_item_59304 btrfs_insert_dir_item 4 59304 NULL ++fd_copyout_59323 fd_copyout 3 59323 NULL ++read_9287_modal_eeprom_59327 read_9287_modal_eeprom 3 59327 NULL ++rx_defrag_in_process_called_read_59338 rx_defrag_in_process_called_read 3 59338 NULL ++xfs_attrmulti_attr_set_59346 xfs_attrmulti_attr_set 4 59346 NULL ++xfs_dir2_sf_entsize_59366 xfs_dir2_sf_entsize 0-2 59366 NULL ++pvr2_debugifc_print_info_59380 pvr2_debugifc_print_info 3 59380 NULL ++fc_frame_alloc_fill_59394 fc_frame_alloc_fill 2 59394 NULL ++vxge_hw_ring_rxds_per_block_get_59425 vxge_hw_ring_rxds_per_block_get 0 59425 NULL ++snd_pcm_tstamp_59431 snd_pcm_tstamp 0 59431 NULL ++squashfs_read_data_59440 squashfs_read_data 6 59440 NULL ++fs_path_ensure_buf_59445 fs_path_ensure_buf 2 59445 NULL ++descriptor_loc_59446 descriptor_loc 3 59446 NULL ++do_compat_semctl_59449 do_compat_semctl 4 59449 NULL ++virtqueue_add_buf_59470 virtqueue_add_buf 3-4 59470 NULL ++ib_copy_from_udata_59502 ib_copy_from_udata 3 59502 NULL ++nfsd_nrpools_59503 nfsd_nrpools 0 59503 NULL ++rds_pin_pages_59507 rds_pin_pages 0 59507 NULL ++mpi_get_nbits_59551 mpi_get_nbits 0 59551 NULL ++tunables_write_59563 tunables_write 3 59563 NULL ++memdup_user_59590 memdup_user 2 59590 NULL ++tps6586x_irq_get_virq_59601 tps6586x_irq_get_virq 2 59601 NULL ++mem_fwlog_free_mem_blks_read_59616 mem_fwlog_free_mem_blks_read 3 59616 NULL ++mtrr_write_59622 mtrr_write 3 59622 NULL ++ip_vs_icmp_xmit_59624 ip_vs_icmp_xmit 4 59624 NULL ++find_first_zero_bit_59636 find_first_zero_bit 0-2 59636 NULL ++ubifs_setxattr_59650 ubifs_setxattr 4 59650 NULL nohasharray ++hidraw_read_59650 hidraw_read 3 59650 &ubifs_setxattr_59650 ++v9fs_xattr_set_acl_59651 v9fs_xattr_set_acl 4 59651 NULL ++__devcgroup_check_permission_59665 __devcgroup_check_permission 0 59665 NULL ++alloc_dca_provider_59670 alloc_dca_provider 2 59670 NULL ++wm8400_write_59675 wm8400_write 2 59675 NULL ++sriov_enable_59689 sriov_enable 2 59689 NULL ++mic_calc_failure_read_59700 mic_calc_failure_read 3 59700 NULL ++snd_pcm_info_user_59711 snd_pcm_info_user 0 59711 NULL ++prism2_info_scanresults_59729 prism2_info_scanresults 3 59729 NULL ++wm8996_gpio_direction_in_59739 wm8996_gpio_direction_in 2 59739 NULL ++ieee80211_if_read_fwded_unicast_59740 ieee80211_if_read_fwded_unicast 3 59740 NULL ++qib_decode_7220_sdma_errs_59745 qib_decode_7220_sdma_errs 4 59745 NULL ++strnlen_59746 strnlen 0 59746 NULL ++sctp_manip_pkt_59749 sctp_manip_pkt 4 59749 NULL ++ext3_acl_count_59754 ext3_acl_count 0-1 59754 NULL ++long_retry_limit_read_59766 long_retry_limit_read 3 59766 NULL ++sec_reg_update_59771 sec_reg_update 2 59771 NULL ++venus_remove_59781 venus_remove 4 59781 NULL ++xlog_do_recover_59789 xlog_do_recover 3 59789 NULL ++ipw_write_59807 ipw_write 3 59807 NULL ++rtllib_wx_set_gen_ie_59808 rtllib_wx_set_gen_ie 3 59808 NULL ++scsi_init_shared_tag_map_59812 scsi_init_shared_tag_map 2 59812 NULL ++ieee80211_if_read_dot11MeshHWMPmaxPREQretries_59829 ieee80211_if_read_dot11MeshHWMPmaxPREQretries 3 59829 NULL ++gspca_dev_probe2_59833 gspca_dev_probe2 4 59833 NULL ++fs64_to_cpu_59845 fs64_to_cpu 0 59845 NULL ++tun_put_user_59849 tun_put_user 4 59849 NULL ++pvr2_ioread_set_sync_key_59882 pvr2_ioread_set_sync_key 3 59882 NULL ++shmem_zero_setup_59885 shmem_zero_setup 0 59885 NULL ++ffs_prepare_buffer_59892 ffs_prepare_buffer 2 59892 NULL ++il_dbgfs_rxon_flags_read_59950 il_dbgfs_rxon_flags_read 3 59950 NULL nohasharray ++dapm_widget_power_read_file_59950 dapm_widget_power_read_file 3 59950 &il_dbgfs_rxon_flags_read_59950 ++compat_ipmi_ioctl_59956 compat_ipmi_ioctl 3 59956 NULL nohasharray ++il_dbgfs_missed_beacon_read_59956 il_dbgfs_missed_beacon_read 3 59956 &compat_ipmi_ioctl_59956 ++fb_getput_cmap_59971 fb_getput_cmap 3 59971 NULL ++__arch_hweight16_59975 __arch_hweight16 0 59975 NULL ++osd_req_read_kern_59990 osd_req_read_kern 5 59990 NULL ++ghash_async_setkey_60001 ghash_async_setkey 3 60001 NULL ++rawsock_sendmsg_60010 rawsock_sendmsg 4 60010 NULL ++mthca_init_cq_60011 mthca_init_cq 2 60011 NULL ++register_device_60015 register_device 2-3 60015 NULL ++osd_req_list_dev_partitions_60027 osd_req_list_dev_partitions 4 60027 NULL ++xlog_bread_offset_60030 xlog_bread_offset 3 60030 NULL ++sys_sched_getaffinity_60033 sys_sched_getaffinity 2 60033 NULL ++ceph_calc_raw_layout_60035 ceph_calc_raw_layout 4 60035 NULL ++bio_integrity_hw_sectors_60039 bio_integrity_hw_sectors 0-2 60039 NULL ++do_ip6t_set_ctl_60040 do_ip6t_set_ctl 4 60040 NULL ++pin_2_irq_60050 pin_2_irq 0-3 60050 NULL nohasharray ++vcs_size_60050 vcs_size 0 60050 &pin_2_irq_60050 ++load_module_60056 load_module 2 60056 NULL nohasharray ++gru_alloc_gts_60056 gru_alloc_gts 3-2 60056 &load_module_60056 ++compat_writev_60063 compat_writev 3 60063 NULL ++ieee80211_build_probe_req_60064 ieee80211_build_probe_req 8-6 60064 NULL ++c4iw_num_stags_60073 c4iw_num_stags 0 60073 NULL ++mp_register_gsi_60079 mp_register_gsi 2 60079 NULL ++rxrpc_kernel_send_data_60083 rxrpc_kernel_send_data 3 60083 NULL ++ieee80211_if_fmt_fwded_frames_60103 ieee80211_if_fmt_fwded_frames 3 60103 NULL ++ttm_bo_kmap_60118 ttm_bo_kmap 3-2 60118 NULL ++jmb38x_ms_count_slots_60164 jmb38x_ms_count_slots 0 60164 NULL ++init_state_60165 init_state 2 60165 NULL ++sg_build_sgat_60179 sg_build_sgat 3 60179 NULL nohasharray ++jffs2_alloc_full_dirent_60179 jffs2_alloc_full_dirent 1 60179 &sg_build_sgat_60179 ++rx_rx_tkip_replays_read_60193 rx_rx_tkip_replays_read 3 60193 NULL ++svc_compat_ioctl_60194 svc_compat_ioctl 3 60194 NULL ++ib_send_cm_mra_60202 ib_send_cm_mra 4 60202 NULL nohasharray ++qib_reg_phys_mr_60202 qib_reg_phys_mr 3 60202 &ib_send_cm_mra_60202 ++set_tap_pfs_60203 set_tap_pfs 3 60203 NULL ++ieee80211_mgmt_tx_60209 ieee80211_mgmt_tx 7 60209 NULL ++btrfs_get_token_16_60220 btrfs_get_token_16 0 60220 NULL ++arizona_map_irq_60230 arizona_map_irq 2 60230 NULL ++lp8788_select_buck_vout_addr_60241 lp8788_select_buck_vout_addr 0 60241 NULL ++wm831x_irq_60254 wm831x_irq 2 60254 NULL ++compat_sys_fcntl64_60256 compat_sys_fcntl64 3 60256 NULL ++printer_write_60276 printer_write 3 60276 NULL ++__pskb_pull_tail_60287 __pskb_pull_tail 2 60287 NULL ++do_xip_mapping_read_60297 do_xip_mapping_read 5 60297 NULL ++getDataLength_60301 getDataLength 0 60301 NULL ++ceph_parse_server_name_60318 ceph_parse_server_name 2 60318 NULL ++__kfifo_from_user_r_60345 __kfifo_from_user_r 3-5 60345 NULL ++dccp_setsockopt_60367 dccp_setsockopt 5 60367 NULL ++ubi_eba_atomic_leb_change_60379 ubi_eba_atomic_leb_change 5 60379 NULL ++mthca_alloc_resize_buf_60394 mthca_alloc_resize_buf 3 60394 NULL ++ocfs2_zero_extend_60396 ocfs2_zero_extend 3 60396 NULL ++driver_names_read_60399 driver_names_read 3 60399 NULL ++simple_alloc_urb_60420 simple_alloc_urb 3 60420 NULL ++excessive_retries_read_60425 excessive_retries_read 3 60425 NULL ++tstats_write_60432 tstats_write 3 60432 NULL nohasharray ++kmalloc_60432 kmalloc 1 60432 &tstats_write_60432 ++tipc_buf_acquire_60437 tipc_buf_acquire 1 60437 NULL ++rx_data_60442 rx_data 4 60442 NULL ++tcf_csum_ipv4_igmp_60446 tcf_csum_ipv4_igmp 3 60446 NULL ++crypto_shash_setkey_60483 crypto_shash_setkey 3 60483 NULL ++ath_tx_init_60515 ath_tx_init 2 60515 NULL ++hysdn_sched_rx_60533 hysdn_sched_rx 3 60533 NULL ++v9fs_fid_readn_60544 v9fs_fid_readn 4 60544 NULL ++nonpaging_map_60551 nonpaging_map 4 60551 NULL ++skb_transport_offset_60619 skb_transport_offset 0 60619 NULL ++wl1273_fm_fops_write_60621 wl1273_fm_fops_write 3 60621 NULL ++usb_control_msg_60624 usb_control_msg 0 60624 NULL ++acl_alloc_stack_init_60630 acl_alloc_stack_init 1 60630 NULL ++ubifs_recover_leb_60639 ubifs_recover_leb 3 60639 NULL ++fb_get_fscreeninfo_60640 fb_get_fscreeninfo 3 60640 NULL ++if_sdio_host_to_card_60666 if_sdio_host_to_card 4 60666 NULL ++ieee80211_if_read_dot11MeshConfirmTimeout_60670 ieee80211_if_read_dot11MeshConfirmTimeout 3 60670 NULL ++read_vbt_r10_60679 read_vbt_r10 1 60679 NULL ++init_data_container_60709 init_data_container 1 60709 NULL ++snd_ice1712_ds_read_60754 snd_ice1712_ds_read 0 60754 NULL ++raid_status_60755 raid_status 5 60755 NULL ++sel_write_checkreqprot_60774 sel_write_checkreqprot 3 60774 NULL ++opticon_write_60775 opticon_write 4 60775 NULL ++acl_alloc_num_60778 acl_alloc_num 1-2 60778 NULL ++snd_pcm_oss_readv3_60792 snd_pcm_oss_readv3 3 60792 NULL ++pwr_tx_with_ps_read_60851 pwr_tx_with_ps_read 3 60851 NULL ++alloc_buf_60864 alloc_buf 3-2 60864 NULL ++alloc_irq_from_60868 alloc_irq_from 1 60868 NULL ++generic_writepages_60871 generic_writepages 0 60871 NULL ++ubifs_read_one_lp_60882 ubifs_read_one_lp 0 60882 NULL ++ext4_update_inline_data_60888 ext4_update_inline_data 3 60888 NULL ++wm8962_gpio_set_60894 wm8962_gpio_set 2 60894 NULL ++iio_debugfs_read_reg_60908 iio_debugfs_read_reg 3 60908 NULL ++mgt_set_varlen_60916 mgt_set_varlen 4 60916 NULL ++scrub_chunk_60926 scrub_chunk 5 60926 NULL ++pti_char_write_60960 pti_char_write 3 60960 NULL ++mwifiex_alloc_sdio_mpa_buffers_60961 mwifiex_alloc_sdio_mpa_buffers 2-3 60961 NULL ++__a2mp_build_60987 __a2mp_build 3 60987 NULL ++hsc_msg_alloc_60990 hsc_msg_alloc 1 60990 NULL ++ath6kl_lrssi_roam_read_61022 ath6kl_lrssi_roam_read 3 61022 NULL ++symtab_init_61050 symtab_init 2 61050 NULL ++fuse_send_write_61053 fuse_send_write 0 61053 NULL ++snd_pcm_pause_61054 snd_pcm_pause 0 61054 NULL ++bitmap_scnlistprintf_61062 bitmap_scnlistprintf 0-4-2 61062 NULL ++ahash_align_buffer_size_61070 ahash_align_buffer_size 0-1-2 61070 NULL ++snd_pcm_update_hw_ptr0_61084 snd_pcm_update_hw_ptr0 0 61084 NULL ++get_derived_key_61100 get_derived_key 4 61100 NULL ++alloc_chrdev_region_61112 alloc_chrdev_region 0 61112 NULL ++p80211_headerlen_61119 p80211_headerlen 0 61119 NULL nohasharray ++__probe_kernel_read_61119 __probe_kernel_read 3 61119 &p80211_headerlen_61119 ++vmemmap_alloc_block_buf_61126 vmemmap_alloc_block_buf 1 61126 NULL ++afs_proc_cells_write_61139 afs_proc_cells_write 3 61139 NULL ++__vmalloc_61168 __vmalloc 1 61168 NULL ++event_oom_late_read_61175 event_oom_late_read 3 61175 NULL nohasharray ++pair_device_61175 pair_device 4 61175 &event_oom_late_read_61175 ++sys_lsetxattr_61177 sys_lsetxattr 4 61177 NULL ++arch_hibernation_header_save_61212 arch_hibernation_header_save 0 61212 NULL ++smk_read_ambient_61220 smk_read_ambient 3 61220 NULL ++btrfs_bio_alloc_61270 btrfs_bio_alloc 3 61270 NULL ++vortex_adbdma_getlinearpos_61283 vortex_adbdma_getlinearpos 0 61283 NULL ++sys_add_key_61288 sys_add_key 4 61288 NULL ++ext4_issue_discard_61305 ext4_issue_discard 2 61305 NULL ++xfrm_user_sec_ctx_size_61320 xfrm_user_sec_ctx_size 0 61320 NULL ++st5481_setup_isocpipes_61340 st5481_setup_isocpipes 6-4 61340 NULL ++rx_rx_wa_ba_not_expected_read_61341 rx_rx_wa_ba_not_expected_read 3 61341 NULL ++f1x_map_sysaddr_to_csrow_61344 f1x_map_sysaddr_to_csrow 2 61344 NULL ++debug_debug4_read_61367 debug_debug4_read 3 61367 NULL ++sys_ptrace_61369 sys_ptrace 3 61369 NULL ++change_xattr_61390 change_xattr 5 61390 NULL ++size_entry_mwt_61400 size_entry_mwt 0 61400 NULL ++irq_create_of_mapping_61428 irq_create_of_mapping 0 61428 NULL ++dma_ops_area_alloc_61440 dma_ops_area_alloc 3-4-5 61440 NULL ++tc3589x_irq_unmap_61447 tc3589x_irq_unmap 2 61447 NULL ++unix_stream_sendmsg_61455 unix_stream_sendmsg 4 61455 NULL ++snd_pcm_lib_writev_transfer_61483 snd_pcm_lib_writev_transfer 4-2-5 61483 NULL ++btrfs_item_size_61485 btrfs_item_size 0 61485 NULL ++mc13xxx_reg_write_61490 mc13xxx_reg_write 2 61490 NULL ++erst_errno_61526 erst_errno 0 61526 NULL ++ntfs_attr_lookup_61539 ntfs_attr_lookup 0 61539 NULL ++o2hb_pop_count_61553 o2hb_pop_count 2 61553 NULL ++dvb_net_ioctl_61559 dvb_net_ioctl 2 61559 NULL ++ieee80211_if_read_rc_rateidx_mask_2ghz_61570 ieee80211_if_read_rc_rateidx_mask_2ghz 3 61570 NULL ++seq_open_private_61589 seq_open_private 3 61589 NULL ++__get_vm_area_61599 __get_vm_area 1 61599 NULL ++nfs4_init_uniform_client_string_61601 nfs4_init_uniform_client_string 3 61601 NULL ++ncp_compat_ioctl_61608 ncp_compat_ioctl 3 61608 NULL ++configfs_write_file_61621 configfs_write_file 3 61621 NULL ++ieee80211_if_fmt_hw_queues_61629 ieee80211_if_fmt_hw_queues 3 61629 NULL ++ieee80211_rx_bss_info_61630 ieee80211_rx_bss_info 3 61630 NULL ++i2o_parm_table_get_61635 i2o_parm_table_get 6 61635 NULL ++snd_pcm_oss_read3_61643 snd_pcm_oss_read3 0-3 61643 NULL ++resize_stripes_61650 resize_stripes 2 61650 NULL ++ttm_page_pool_free_61661 ttm_page_pool_free 2 61661 NULL ++insert_one_name_61668 insert_one_name 7 61668 NULL ++snd_pcm_playback_avail_61671 snd_pcm_playback_avail 0 61671 NULL ++lock_loop_61681 lock_loop 1 61681 NULL ++__do_tune_cpucache_61684 __do_tune_cpucache 2 61684 NULL ++filter_read_61692 filter_read 3 61692 NULL ++iov_length_61716 iov_length 0 61716 NULL ++fragmentation_threshold_read_61718 fragmentation_threshold_read 3 61718 NULL ++read_file_interrupt_61742 read_file_interrupt 3 61742 NULL nohasharray ++read_file_regval_61742 read_file_regval 3 61742 &read_file_interrupt_61742 ++gfs2_meta_wait_61773 gfs2_meta_wait 0 61773 NULL ++batadv_dat_snoop_incoming_arp_reply_61801 batadv_dat_snoop_incoming_arp_reply 3 61801 NULL ++tps80031_irq_init_61830 tps80031_irq_init 3 61830 NULL ++bfad_debugfs_write_regwr_61841 bfad_debugfs_write_regwr 3 61841 NULL ++fs_path_prepare_for_add_61854 fs_path_prepare_for_add 2 61854 NULL ++evdev_compute_buffer_size_61863 evdev_compute_buffer_size 0 61863 NULL ++get_fw_name_61874 get_fw_name 3 61874 NULL ++twl4030_sih_setup_61878 twl4030_sih_setup 3 61878 NULL ++ieee80211_rtl_auth_challenge_61897 ieee80211_rtl_auth_challenge 3 61897 NULL ++ax25_addr_size_61899 ax25_addr_size 0 61899 NULL nohasharray ++cxgb4_pktgl_to_skb_61899 cxgb4_pktgl_to_skb 2 61899 &ax25_addr_size_61899 ++clear_refs_write_61904 clear_refs_write 3 61904 NULL ++rx_filter_arp_filter_read_61914 rx_filter_arp_filter_read 3 61914 NULL ++au0828_init_isoc_61917 au0828_init_isoc 3-2 61917 NULL ++sctp_sendmsg_61919 sctp_sendmsg 4 61919 NULL ++send_bulk_static_data_61932 send_bulk_static_data 3 61932 NULL ++il4965_ucode_rx_stats_read_61948 il4965_ucode_rx_stats_read 3 61948 NULL ++squashfs_read_id_index_table_61961 squashfs_read_id_index_table 4 61961 NULL ++mlx4_alloc_mtt_range_61966 mlx4_alloc_mtt_range 2 61966 NULL ++ocfs2_quota_write_61972 ocfs2_quota_write 5-4 61972 NULL ++cow_file_range_61979 cow_file_range 3 61979 NULL ++virtnet_send_command_61993 virtnet_send_command 5-6 61993 NULL ++xt_compat_match_offset_62011 xt_compat_match_offset 0 62011 NULL ++jffs2_do_unlink_62020 jffs2_do_unlink 4 62020 NULL ++pmcraid_build_passthrough_ioadls_62034 pmcraid_build_passthrough_ioadls 2 62034 NULL ++ppp_tx_cp_62044 ppp_tx_cp 5 62044 NULL ++sctp_user_addto_chunk_62047 sctp_user_addto_chunk 2-3 62047 NULL ++do_pselect_62061 do_pselect 1 62061 NULL ++pcpu_alloc_bootmem_62074 pcpu_alloc_bootmem 2 62074 NULL ++__next_gcwq_cpu_62078 __next_gcwq_cpu 1 62078 NULL ++get_domain_for_dev_62099 get_domain_for_dev 2 62099 NULL ++jffs2_security_setxattr_62107 jffs2_security_setxattr 4 62107 NULL ++llc_ui_header_len_62131 llc_ui_header_len 0 62131 NULL ++qib_diag_write_62133 qib_diag_write 3 62133 NULL ++ql_status_62135 ql_status 5 62135 NULL ++video_usercopy_62151 video_usercopy 2 62151 NULL ++prism54_wpa_bss_ie_get_62173 prism54_wpa_bss_ie_get 0 62173 NULL ++_irq_to_addr_62183 _irq_to_addr 0-1 62183 NULL ++alloc_upcall_62186 alloc_upcall 2 62186 NULL ++btrfs_xattr_acl_set_62203 btrfs_xattr_acl_set 4 62203 NULL ++sock_kmalloc_62205 sock_kmalloc 2 62205 NULL ++nfsd_read_file_62241 nfsd_read_file 6 62241 NULL ++allocate_partition_62245 allocate_partition 4 62245 NULL ++il_dbgfs_sram_read_62296 il_dbgfs_sram_read 3 62296 NULL ++sparse_early_usemaps_alloc_pgdat_section_62304 sparse_early_usemaps_alloc_pgdat_section 2 62304 NULL ++subsystem_filter_read_62310 subsystem_filter_read 3 62310 NULL ++udf_sb_alloc_partition_maps_62313 udf_sb_alloc_partition_maps 2 62313 NULL ++Wb35Reg_BurstWrite_62327 Wb35Reg_BurstWrite 4 62327 NULL ++subseq_list_62332 subseq_list 3-0 62332 NULL ++flash_write_62354 flash_write 3 62354 NULL ++set_wd_exp_mode_pfs_62372 set_wd_exp_mode_pfs 3 62372 NULL ++rx_rx_timeout_read_62389 rx_rx_timeout_read 3 62389 NULL ++altera_irscan_62396 altera_irscan 2 62396 NULL ++set_ssp_62411 set_ssp 4 62411 NULL ++tscadc_writel_62426 tscadc_writel 2 62426 NULL ++netdev_alloc_skb_62437 netdev_alloc_skb 2 62437 NULL ++e1000_check_copybreak_62448 e1000_check_copybreak 3 62448 NULL ++ip_vs_icmp_xmit_v6_62477 ip_vs_icmp_xmit_v6 4 62477 NULL ++ceph_dns_resolve_name_62488 ceph_dns_resolve_name 2 62488 NULL ++mlx4_en_create_rx_ring_62498 mlx4_en_create_rx_ring 3 62498 NULL ++ext_rts51x_sd_execute_read_data_62501 ext_rts51x_sd_execute_read_data 9 62501 NULL ++pep_sendmsg_62524 pep_sendmsg 4 62524 NULL ++test_iso_queue_62534 test_iso_queue 5 62534 NULL ++debugfs_read_62535 debugfs_read 3 62535 NULL ++sco_sock_sendmsg_62542 sco_sock_sendmsg 4 62542 NULL ++qib_refresh_qsfp_cache_62547 qib_refresh_qsfp_cache 0 62547 NULL ++xfrm_user_policy_62573 xfrm_user_policy 4 62573 NULL ++get_subdir_62581 get_subdir 3 62581 NULL ++prism2_send_mgmt_62605 prism2_send_mgmt 4 62605 NULL nohasharray ++nfsd_vfs_read_62605 nfsd_vfs_read 6 62605 &prism2_send_mgmt_62605 ++get_desc_base_62617 get_desc_base 0 62617 NULL ++iommu_area_alloc_62619 iommu_area_alloc 2-3-4-7 62619 NULL ++ems_pcmcia_add_card_62627 ems_pcmcia_add_card 2 62627 NULL ++compat_rangeinfo_62630 compat_rangeinfo 2 62630 NULL ++lpfc_sli4_queue_alloc_62646 lpfc_sli4_queue_alloc 3 62646 NULL ++wm8994_gpio_direction_in_62649 wm8994_gpio_direction_in 2 62649 NULL ++ima_file_mmap_62663 ima_file_mmap 0 62663 NULL ++write_62671 write 3 62671 NULL ++printer_req_alloc_62687 printer_req_alloc 2 62687 NULL ++qla4_83xx_rd_reg_62693 qla4_83xx_rd_reg 0 62693 NULL ++ioremap_wc_62695 ioremap_wc 1-2 62695 NULL ++bioset_integrity_create_62708 bioset_integrity_create 2 62708 NULL ++rdm_62719 rdm 0 62719 NULL ++key_replays_read_62746 key_replays_read 3 62746 NULL ++init_chip_wc_pat_62768 init_chip_wc_pat 2 62768 NULL ++ax25_sendmsg_62770 ax25_sendmsg 4 62770 NULL ++page_key_alloc_62771 page_key_alloc 0 62771 NULL ++tracing_total_entries_read_62817 tracing_total_entries_read 3 62817 NULL ++__rounddown_pow_of_two_62836 __rounddown_pow_of_two 0 62836 NULL ++bio_get_nr_vecs_62838 bio_get_nr_vecs 0 62838 NULL ++xlog_recover_add_to_trans_62839 xlog_recover_add_to_trans 4 62839 NULL ++rx_fcs_err_read_62844 rx_fcs_err_read 3 62844 NULL ++hpi_read_word_62862 hpi_read_word 0 62862 NULL ++aoechr_write_62883 aoechr_write 3 62883 NULL nohasharray ++em28xx_init_isoc_62883 em28xx_init_isoc 4 62883 &aoechr_write_62883 ++resize_info_buffer_62889 resize_info_buffer 2 62889 NULL ++if_spi_host_to_card_62890 if_spi_host_to_card 4 62890 NULL ++mempool_create_slab_pool_62907 mempool_create_slab_pool 1 62907 NULL ++getdqbuf_62908 getdqbuf 1 62908 NULL ++agp_create_user_memory_62955 agp_create_user_memory 1 62955 NULL ++PTR_ERR_63033 PTR_ERR 0 63033 NULL nohasharray ++__vb2_perform_fileio_63033 __vb2_perform_fileio 3 63033 &PTR_ERR_63033 ++pipeline_defrag_to_csum_swi_read_63037 pipeline_defrag_to_csum_swi_read 3 63037 NULL ++scsi_host_alloc_63041 scsi_host_alloc 2 63041 NULL ++unlink1_63059 unlink1 3 63059 NULL ++xen_set_nslabs_63066 xen_set_nslabs 0 63066 NULL ++ocfs2_decrease_refcount_63078 ocfs2_decrease_refcount 3 63078 NULL ++sep_prepare_input_output_dma_table_in_dcb_63087 sep_prepare_input_output_dma_table_in_dcb 4-5-2-3 63087 NULL ++iwl_dbgfs_sensitivity_read_63116 iwl_dbgfs_sensitivity_read 3 63116 NULL ++ib_send_cm_rtu_63138 ib_send_cm_rtu 3 63138 NULL ++snd_pcm_status_user_63140 snd_pcm_status_user 0 63140 NULL ++ubifs_change_one_lp_63157 ubifs_change_one_lp 0 63157 NULL ++smk_write_revoke_subj_63173 smk_write_revoke_subj 3 63173 NULL ++vme_master_read_63221 vme_master_read 0 63221 NULL ++module_alloc_update_bounds_rw_63233 module_alloc_update_bounds_rw 1 63233 NULL ++ptp_read_63251 ptp_read 4 63251 NULL ++ntfs_attr_can_be_non_resident_63267 ntfs_attr_can_be_non_resident 0 63267 NULL ++raid5_resize_63306 raid5_resize 2 63306 NULL ++proc_info_read_63344 proc_info_read 3 63344 NULL ++ps_upsd_max_sptime_read_63362 ps_upsd_max_sptime_read 3 63362 NULL ++idmouse_read_63374 idmouse_read 3 63374 NULL ++edac_pci_alloc_ctl_info_63388 edac_pci_alloc_ctl_info 1 63388 NULL nohasharray ++usbnet_read_cmd_nopm_63388 usbnet_read_cmd_nopm 7 63388 &edac_pci_alloc_ctl_info_63388 ++rxpipe_missed_beacon_host_int_trig_rx_data_read_63405 rxpipe_missed_beacon_host_int_trig_rx_data_read 3 63405 NULL ++l2cap_sock_sendmsg_63427 l2cap_sock_sendmsg 4 63427 NULL ++sep_prepare_input_output_dma_table_63429 sep_prepare_input_output_dma_table 2-4-3 63429 NULL ++kone_send_63435 kone_send 4 63435 NULL ++nfsd_symlink_63442 nfsd_symlink 6 63442 NULL ++snd_info_entry_write_63474 snd_info_entry_write 3 63474 NULL ++reada_find_extent_63486 reada_find_extent 2 63486 NULL ++read_kcore_63488 read_kcore 3 63488 NULL ++snd_pcm_plug_write_transfer_63503 snd_pcm_plug_write_transfer 0-3 63503 NULL ++ubi_more_leb_change_data_63534 ubi_more_leb_change_data 4 63534 NULL ++if_sdio_read_scratch_63540 if_sdio_read_scratch 0 63540 NULL ++append_to_buffer_63550 append_to_buffer 3 63550 NULL ++dbg_leb_write_63555 dbg_leb_write 4-5 63555 NULL nohasharray ++kvm_write_guest_page_63555 kvm_write_guest_page 5 63555 &dbg_leb_write_63555 ++ubifs_lpt_scan_nolock_63572 ubifs_lpt_scan_nolock 0 63572 NULL ++ocfs2_calc_trunc_pos_63576 ocfs2_calc_trunc_pos 4 63576 NULL ++rproc_alloc_63577 rproc_alloc 5 63577 NULL ++ext3_clear_blocks_63597 ext3_clear_blocks 4-5 63597 NULL ++module_alloc_63630 module_alloc 1 63630 NULL ++ntfs_malloc_nofs_nofail_63631 ntfs_malloc_nofs_nofail 1 63631 NULL ++symbol_build_supp_rates_63634 symbol_build_supp_rates 0 63634 NULL ++_ubh_find_next_zero_bit__63640 _ubh_find_next_zero_bit_ 4-5-3 63640 NULL ++proc_loginuid_write_63648 proc_loginuid_write 3 63648 NULL ++ValidateDSDParamsChecksum_63654 ValidateDSDParamsChecksum 3 63654 NULL ++hidraw_ioctl_63658 hidraw_ioctl 2 63658 NULL ++vbi_read_63673 vbi_read 3 63673 NULL nohasharray ++xen_register_pirq_63673 xen_register_pirq 1-2 63673 &vbi_read_63673 ++alloc_tty_driver_63681 alloc_tty_driver 1 63681 NULL ++mkiss_compat_ioctl_63686 mkiss_compat_ioctl 4 63686 NULL ++arizona_irq_map_63709 arizona_irq_map 2 63709 NULL ++nouveau_object_create__63715 nouveau_object_create_ 5 63715 NULL ++btrfs_insert_delayed_dir_index_63720 btrfs_insert_delayed_dir_index 4 63720 NULL ++selinux_secctx_to_secid_63744 selinux_secctx_to_secid 2 63744 NULL ++snd_pcm_oss_read1_63771 snd_pcm_oss_read1 3 63771 NULL ++snd_pcm_link_63772 snd_pcm_link 0 63772 NULL ++snd_opl4_mem_proc_read_63774 snd_opl4_mem_proc_read 5 63774 NULL ++spidev_compat_ioctl_63778 spidev_compat_ioctl 2-3 63778 NULL ++snapshot_compat_ioctl_63792 snapshot_compat_ioctl 3 63792 NULL ++kovaplus_sysfs_write_63795 kovaplus_sysfs_write 6 63795 NULL ++mwifiex_11n_create_rx_reorder_tbl_63806 mwifiex_11n_create_rx_reorder_tbl 4 63806 NULL ++copy_nodes_to_user_63807 copy_nodes_to_user 2 63807 NULL ++sel_write_load_63830 sel_write_load 3 63830 NULL ++proc_pid_attr_write_63845 proc_pid_attr_write 3 63845 NULL ++ieee80211_if_fmt_channel_type_63855 ieee80211_if_fmt_channel_type 3 63855 NULL ++init_map_ipmac_63896 init_map_ipmac 4-3 63896 NULL ++divas_write_63901 divas_write 3 63901 NULL ++xhci_alloc_stream_info_63902 xhci_alloc_stream_info 3 63902 NULL ++uvc_alloc_urb_buffers_63922 uvc_alloc_urb_buffers 0-3-2 63922 NULL ++snd_compr_write_63923 snd_compr_write 3 63923 NULL ++acpi_ev_get_gpe_xrupt_block_63924 acpi_ev_get_gpe_xrupt_block 1 63924 NULL ++tipc_send2port_63935 tipc_send2port 5 63935 NULL ++afs_send_simple_reply_63940 afs_send_simple_reply 3 63940 NULL ++__team_options_register_63941 __team_options_register 3 63941 NULL ++macvtap_recvmsg_63949 macvtap_recvmsg 4 63949 NULL ++ieee80211_if_fmt_rc_rateidx_mcs_mask_2ghz_63968 ieee80211_if_fmt_rc_rateidx_mcs_mask_2ghz 3 63968 NULL ++ieee80211_authentication_req_63973 ieee80211_authentication_req 3 63973 NULL ++diva_xdi_write_63975 diva_xdi_write 4 63975 NULL ++read_file_frameerrors_64001 read_file_frameerrors 3 64001 NULL ++kmemdup_64015 kmemdup 2 64015 NULL ++tcf_csum_skb_nextlayer_64025 tcf_csum_skb_nextlayer 3 64025 NULL ++dbAllocDmapLev_64030 dbAllocDmapLev 0 64030 NULL ++resize_async_buffer_64031 resize_async_buffer 4 64031 NULL ++sep_lli_table_secure_dma_64042 sep_lli_table_secure_dma 2-3 64042 NULL ++get_u8_64076 get_u8 0 64076 NULL ++sl_realloc_bufs_64086 sl_realloc_bufs 2 64086 NULL ++lbs_highrssi_read_64089 lbs_highrssi_read 3 64089 NULL ++do_load_xattr_datum_64118 do_load_xattr_datum 0 64118 NULL ++ol_quota_entries_per_block_64122 ol_quota_entries_per_block 0 64122 NULL ++ext4_prepare_inline_data_64124 ext4_prepare_inline_data 3 64124 NULL ++init_bch_64130 init_bch 1-2 64130 NULL ++uea_idma_write_64139 uea_idma_write 3 64139 NULL ++ablkcipher_copy_iv_64140 ablkcipher_copy_iv 3 64140 NULL ++dlfb_ops_write_64150 dlfb_ops_write 3 64150 NULL ++cpumask_scnprintf_64170 cpumask_scnprintf 2 64170 NULL ++read_pulse_64227 read_pulse 0-3 64227 NULL ++header_len_64232 header_len 0 64232 NULL ++redrat3_transmit_ir_64244 redrat3_transmit_ir 3 64244 NULL ++io_capture_transfer_64276 io_capture_transfer 4 64276 NULL ++btrfs_file_extent_offset_64278 btrfs_file_extent_offset 0 64278 NULL ++sta_current_tx_rate_read_64286 sta_current_tx_rate_read 3 64286 NULL ++event_id_read_64288 event_id_read 3 64288 NULL nohasharray ++xfs_dir_cilookup_result_64288 xfs_dir_cilookup_result 3 64288 &event_id_read_64288 ++ocfs2_block_check_validate_bhs_64302 ocfs2_block_check_validate_bhs 0 64302 NULL ++error_error_bar_retry_read_64305 error_error_bar_retry_read 3 64305 NULL ++ffz_64324 ffz 0 64324 NULL ++sisusbcon_clear_64329 sisusbcon_clear 4-3-5 64329 NULL ++ts_write_64336 ts_write 3 64336 NULL ++usbtmc_write_64340 usbtmc_write 3 64340 NULL ++do_write_orph_node_64343 do_write_orph_node 2 64343 NULL ++ft1000_read_reg_64352 ft1000_read_reg 0 64352 NULL ++wlc_phy_loadsampletable_nphy_64367 wlc_phy_loadsampletable_nphy 3 64367 NULL ++ilo_write_64378 ilo_write 3 64378 NULL ++btrfs_map_block_64379 btrfs_map_block 3 64379 NULL ++nilfs_alloc_seg_bio_64383 nilfs_alloc_seg_bio 3 64383 NULL ++ir_lirc_transmit_ir_64403 ir_lirc_transmit_ir 3 64403 NULL ++pidlist_allocate_64404 pidlist_allocate 1 64404 NULL ++rx_hdr_overflow_read_64407 rx_hdr_overflow_read 3 64407 NULL ++snd_card_create_64418 snd_card_create 4 64418 NULL nohasharray ++keyctl_get_security_64418 keyctl_get_security 3 64418 &snd_card_create_64418 ++nl80211_send_mgmt_64419 nl80211_send_mgmt 7 64419 NULL ++oom_adj_write_64428 oom_adj_write 3 64428 NULL ++ext4_trim_extent_64431 ext4_trim_extent 4 64431 NULL ++ieee80211_ie_build_ht_cap_64443 ieee80211_ie_build_ht_cap 0 64443 NULL ++cap_capable_64462 cap_capable 0 64462 NULL ++ip_vs_create_timeout_table_64478 ip_vs_create_timeout_table 2 64478 NULL ++p54_parse_rssical_64493 p54_parse_rssical 3 64493 NULL ++msg_data_sz_64503 msg_data_sz 0 64503 NULL ++remove_uuid_64505 remove_uuid 4 64505 NULL ++crypto_blkcipher_alignmask_64520 crypto_blkcipher_alignmask 0 64520 NULL ++opera1_usb_i2c_msgxfer_64521 opera1_usb_i2c_msgxfer 4 64521 NULL ++ses_send_diag_64527 ses_send_diag 4 64527 NULL ++prctl_set_mm_64538 prctl_set_mm 3 64538 NULL ++__spi_sync_64561 __spi_sync 0 64561 NULL ++__apei_exec_run_64563 __apei_exec_run 0 64563 NULL ++fanotify_write_64623 fanotify_write 3 64623 NULL ++regmap_read_debugfs_64658 regmap_read_debugfs 5 64658 NULL ++ocfs2_read_xattr_block_64661 ocfs2_read_xattr_block 0 64661 NULL nohasharray ++tlbflush_read_file_64661 tlbflush_read_file 3 64661 &ocfs2_read_xattr_block_64661 ++efx_tsoh_get_buffer_64664 efx_tsoh_get_buffer 3 64664 NULL ++rx_rx_out_of_mpdu_nodes_read_64668 rx_rx_out_of_mpdu_nodes_read 3 64668 NULL ++nr_free_zone_pages_64680 nr_free_zone_pages 0 64680 NULL ++sec_bulk_write_64691 sec_bulk_write 2-3 64691 NULL ++__feat_register_sp_64712 __feat_register_sp 6 64712 NULL ++snd_pcm_oss_capture_position_fixup_64713 snd_pcm_oss_capture_position_fixup 0 64713 NULL ++dapm_bias_read_file_64715 dapm_bias_read_file 3 64715 NULL ++atomic_add_return_64720 atomic_add_return 0-1 64720 NULL ++i2400m_msg_to_dev_64722 i2400m_msg_to_dev 3 64722 NULL ++squashfs_read_inode_lookup_table_64739 squashfs_read_inode_lookup_table 4 64739 NULL ++bio_map_kern_64751 bio_map_kern 3 64751 NULL ++rt2x00debug_write_csr_64753 rt2x00debug_write_csr 3 64753 NULL ++isr_low_rssi_read_64789 isr_low_rssi_read 3 64789 NULL ++twl6040_reg_write_64790 twl6040_reg_write 2 64790 NULL ++nfsctl_transaction_write_64800 nfsctl_transaction_write 3 64800 NULL ++megaraid_change_queue_depth_64815 megaraid_change_queue_depth 2 64815 NULL ++ecryptfs_send_miscdev_64816 ecryptfs_send_miscdev 2 64816 NULL ++do_kimage_alloc_64827 do_kimage_alloc 3 64827 NULL ++altera_set_dr_pre_64862 altera_set_dr_pre 2 64862 NULL ++ffs_epfile_io_64886 ffs_epfile_io 3 64886 NULL ++ieee80211_if_read_ave_beacon_64924 ieee80211_if_read_ave_beacon 3 64924 NULL ++ubifs_wbuf_write_nolock_64946 ubifs_wbuf_write_nolock 3 64946 NULL ++snd_rawmidi_ioctl_compat_64954 snd_rawmidi_ioctl_compat 3 64954 NULL ++ip_options_get_from_user_64958 ip_options_get_from_user 4 64958 NULL ++acpi_os_install_interrupt_handler_64968 acpi_os_install_interrupt_handler 1 64968 NULL ++traceprobe_probes_write_64969 traceprobe_probes_write 3 64969 NULL ++suspend_dtim_interval_read_64971 suspend_dtim_interval_read 3 64971 NULL ++ext2_group_first_block_no_64972 ext2_group_first_block_no 0-2 64972 NULL ++pskb_pull_65005 pskb_pull 2 65005 NULL ++unifi_write_65012 unifi_write 3 65012 NULL ++crypto_ahash_digestsize_65014 crypto_ahash_digestsize 0 65014 NULL ++nfs_readdata_alloc_65015 nfs_readdata_alloc 2 65015 NULL ++insert_dent_65034 insert_dent 7 65034 NULL ++compat_put_ushort_65040 compat_put_ushort 1 65040 NULL ++brcmf_sdcard_rwdata_65041 brcmf_sdcard_rwdata 5 65041 NULL ++compat_cmdtest_65064 compat_cmdtest 2 65064 NULL ++make_idx_node_65068 make_idx_node 0 65068 NULL ++count_run_65072 count_run 0-2-4 65072 NULL nohasharray ++bnx2fc_process_l2_frame_compl_65072 bnx2fc_process_l2_frame_compl 3 65072 &count_run_65072 ++__alloc_bootmem_node_high_65076 __alloc_bootmem_node_high 2 65076 NULL ++ocfs2_truncate_cluster_pages_65086 ocfs2_truncate_cluster_pages 2 65086 NULL ++ath9k_dump_mci_btcoex_65090 ath9k_dump_mci_btcoex 0 65090 NULL ++ssb_bus_register_65183 ssb_bus_register 3 65183 NULL ++rx_rx_done_read_65217 rx_rx_done_read 3 65217 NULL ++print_endpoint_stat_65232 print_endpoint_stat 0-4-3 65232 NULL ++whci_n_caps_65247 whci_n_caps 0 65247 NULL ++kmem_zalloc_greedy_65268 kmem_zalloc_greedy 3-2 65268 NULL ++kmalloc_parameter_65279 kmalloc_parameter 1 65279 NULL ++compat_core_sys_select_65285 compat_core_sys_select 1 65285 NULL ++get_unaligned_le16_65293 get_unaligned_le16 0 65293 NULL ++mpi_set_buffer_65294 mpi_set_buffer 3 65294 NULL ++redirected_tty_write_65297 redirected_tty_write 3 65297 NULL ++get_var_len_65304 get_var_len 0 65304 NULL ++unpack_array_65318 unpack_array 0 65318 NULL ++pci_vpd_find_tag_65325 pci_vpd_find_tag 0-2 65325 NULL ++dccp_setsockopt_service_65336 dccp_setsockopt_service 4 65336 NULL ++dma_rx_requested_read_65354 dma_rx_requested_read 3 65354 NULL ++batadv_tt_save_orig_buffer_65361 batadv_tt_save_orig_buffer 4 65361 NULL ++alloc_cpu_rmap_65363 alloc_cpu_rmap 1 65363 NULL ++strchr_65372 strchr 0 65372 NULL ++__alloc_bootmem_nopanic_65397 __alloc_bootmem_nopanic 1 65397 NULL ++trace_seq_to_user_65398 trace_seq_to_user 3 65398 NULL ++mtd_get_device_size_65400 mtd_get_device_size 0 65400 NULL ++iio_device_add_channel_sysfs_65406 iio_device_add_channel_sysfs 0 65406 NULL ++ocfs2_write_begin_nolock_65410 ocfs2_write_begin_nolock 3-4 65410 NULL ++drm_calloc_large_65421 drm_calloc_large 1-2 65421 NULL ++xpc_kzalloc_cacheline_aligned_65433 xpc_kzalloc_cacheline_aligned 1 65433 NULL ++pn533_init_target_frame_65438 pn533_init_target_frame 3 65438 NULL ++usb_alloc_coherent_65444 usb_alloc_coherent 2 65444 NULL ++regmap_write_65478 regmap_write 2 65478 NULL ++ath_rx_edma_init_65483 ath_rx_edma_init 2 65483 NULL ++dpcm_state_read_file_65489 dpcm_state_read_file 3 65489 NULL ++alloc_dr_65495 alloc_dr 2 65495 NULL diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c new file mode 100644 -index 0000000..24b6c8e +index 0000000..9db0d0e --- /dev/null +++ b/tools/gcc/size_overflow_plugin.c -@@ -0,0 +1,1595 @@ +@@ -0,0 +1,2114 @@ +/* -+ * Copyright 2011, 2012 by Emese Revfy <re.emese@gmail.com> ++ * Copyright 2011, 2012, 2013 by Emese Revfy <re.emese@gmail.com> + * Licensed under the GPL v2, or (at your option) v3 + * + * Homepage: + * http://www.grsecurity.net/~ephox/overflow_plugin/ + * ++ * Documentation: ++ * http://forums.grsecurity.net/viewtopic.php?f=7&t=3043 ++ * + * This plugin recomputes expressions of function arguments marked by a size_overflow attribute + * with double integer precision (DImode/TImode for 32/64 bit integer types). + * The recomputed argument is checked against TYPE_MAX and an event is logged on overflow and the triggering process is killed. + * + * Usage: -+ * $ gcc -I`gcc -print-file-name=plugin`/include/c-family -I`gcc -print-file-name=plugin`/include -fPIC -shared -O2 -ggdb -Wall -W -Wno-missing-field-initializers -o size_overflow_plugin.so size_overflow_plugin.c ++ * $ gcc -I`gcc -print-file-name=plugin`/include/c-family -I`gcc -print-file-name=plugin`/include -fPIC -shared -O2 -ggdb -Wall -W -o size_overflow_plugin.so size_overflow_plugin.c + * $ gcc -fplugin=size_overflow_plugin.so test.c -O2 + */ + @@ -85454,26 +100188,31 @@ index 0000000..24b6c8e +#include "tree-flow.h" +#include "plugin.h" +#include "gimple.h" -+#include "c-common.h" +#include "diagnostic.h" +#include "cfgloop.h" + ++#if BUILDING_GCC_VERSION >= 4008 ++#define TODO_dump_func 0 ++#endif ++ +struct size_overflow_hash { -+ struct size_overflow_hash *next; -+ const char *name; -+ unsigned int param; ++ const struct size_overflow_hash * const next; ++ const char * const name; ++ const unsigned int param; +}; + +#include "size_overflow_hash.h" + -+enum marked { -+ MARKED_NO, MARKED_YES, MARKED_NOT_INTENTIONAL ++enum mark { ++ MARK_NO, MARK_YES, MARK_NOT_INTENTIONAL, MARK_TURN_OFF +}; + -+enum overflow_reason { -+ OVERFLOW_NONE, OVERFLOW_INTENTIONAL ++enum err_code_conditions { ++ CAST_ONLY, FROM_CONST +}; + ++static unsigned int call_count = 0; ++ +#define __unused __attribute__((__unused__)) +#define NAME(node) IDENTIFIER_POINTER(DECL_NAME(node)) +#define NAME_LEN(node) IDENTIFIER_LENGTH(DECL_NAME(node)) @@ -85481,9 +100220,11 @@ index 0000000..24b6c8e +#define AFTER_STMT false +#define CREATE_NEW_VAR NULL_TREE +#define CODES_LIMIT 32 -+#define MAX_PARAM 16 ++#define MAX_PARAM 31 +#define MY_STMT GF_PLF_1 +#define NO_CAST_CHECK GF_PLF_2 ++#define FROM_ARG true ++#define FROM_RET false + +#if BUILDING_GCC_VERSION == 4005 +#define DECL_CHAIN(NODE) (TREE_CHAIN(DECL_MINIMAL_CHECK(NODE))) @@ -85492,36 +100233,88 @@ index 0000000..24b6c8e +int plugin_is_GPL_compatible; +void debug_gimple_stmt(gimple gs); + -+static tree expand(struct pointer_set_t *visited, bool *potentionally_overflowed, tree var); ++static tree expand(struct pointer_set_t *visited, tree lhs); ++static enum mark pre_expand(struct pointer_set_t *visited, bool *search_err_code, const_tree lhs); +static tree report_size_overflow_decl; -+static tree const_char_ptr_type_node; ++static const_tree const_char_ptr_type_node; +static unsigned int handle_function(void); -+static void check_size_overflow(gimple stmt, tree size_overflow_type, tree cast_rhs, tree rhs, bool *potentionally_overflowed, bool before); -+static tree get_size_overflow_type(gimple stmt, tree node); ++static void check_size_overflow(gimple stmt, tree size_overflow_type, tree cast_rhs, tree rhs, bool before); ++static tree get_size_overflow_type(gimple stmt, const_tree node); ++static tree dup_assign(struct pointer_set_t *visited, gimple oldstmt, const_tree node, tree rhs1, tree rhs2, tree __unused rhs3); ++static void print_missing_msg(tree func, unsigned int argnum); + +static struct plugin_info size_overflow_plugin_info = { -+ .version = "20120811beta", ++ .version = "20130410beta", + .help = "no-size-overflow\tturn off size overflow checking\n", +}; + +static tree handle_size_overflow_attribute(tree *node, tree __unused name, tree args, int __unused flags, bool *no_add_attrs) +{ + unsigned int arg_count; ++ enum tree_code code = TREE_CODE(*node); + -+ if (TREE_CODE(*node) == FUNCTION_DECL) ++ switch (code) { ++ case FUNCTION_DECL: + arg_count = type_num_arguments(TREE_TYPE(*node)); -+ else if (TREE_CODE(*node) == FUNCTION_TYPE || TREE_CODE(*node) == METHOD_TYPE) ++ break; ++ case FUNCTION_TYPE: ++ case METHOD_TYPE: + arg_count = type_num_arguments(*node); -+ else { ++ break; ++ default: ++ *no_add_attrs = true; ++ error("%s: %qE attribute only applies to functions", __func__, name); ++ return NULL_TREE; ++ } ++ ++ for (; args; args = TREE_CHAIN(args)) { ++ tree position = TREE_VALUE(args); ++ if (TREE_CODE(position) != INTEGER_CST || TREE_INT_CST_LOW(position) > arg_count ) { ++ error("%s: parameter %u is outside range.", __func__, (unsigned int)TREE_INT_CST_LOW(position)); ++ *no_add_attrs = true; ++ } ++ } ++ return NULL_TREE; ++} ++ ++static const char* get_asm_name(tree node) ++{ ++ return IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(node)); ++} ++ ++static tree handle_intentional_overflow_attribute(tree *node, tree __unused name, tree args, int __unused flags, bool *no_add_attrs) ++{ ++ unsigned int arg_count, arg_num; ++ enum tree_code code = TREE_CODE(*node); ++ ++ switch (code) { ++ case FUNCTION_DECL: ++ arg_count = type_num_arguments(TREE_TYPE(*node)); ++ break; ++ case FUNCTION_TYPE: ++ case METHOD_TYPE: ++ arg_count = type_num_arguments(*node); ++ break; ++ case FIELD_DECL: ++ arg_num = TREE_INT_CST_LOW(TREE_VALUE(args)); ++ if (arg_num != 0) { ++ *no_add_attrs = true; ++ error("%s: %qE attribute parameter can only be 0 in structure fields", __func__, name); ++ } ++ return NULL_TREE; ++ default: + *no_add_attrs = true; + error("%qE attribute only applies to functions", name); + return NULL_TREE; + } + ++ if (TREE_INT_CST_HIGH(TREE_VALUE(args)) != 0) ++ return NULL_TREE; ++ + for (; args; args = TREE_CHAIN(args)) { + tree position = TREE_VALUE(args); -+ if (TREE_CODE(position) != INTEGER_CST || TREE_INT_CST_HIGH(position) || TREE_INT_CST_LOW(position) < 1 || TREE_INT_CST_LOW(position) > arg_count ) { -+ error("handle_size_overflow_attribute: overflow parameter outside range."); ++ if (TREE_CODE(position) != INTEGER_CST || TREE_INT_CST_LOW(position) > arg_count ) { ++ error("%s: parameter %u is outside range.", __func__, (unsigned int)TREE_INT_CST_LOW(position)); + *no_add_attrs = true; + } + } @@ -85548,7 +100341,7 @@ index 0000000..24b6c8e + .decl_required = true, + .type_required = false, + .function_type_required = false, -+ .handler = NULL, ++ .handler = handle_intentional_overflow_attribute, +#if BUILDING_GCC_VERSION >= 4007 + .affects_type_identity = false +#endif @@ -85567,8 +100360,8 @@ index 0000000..24b6c8e +#define cwmixa( in ) { cwfold( in, m, k, h ); } +#define cwmixb( in ) { cwfold( in, n, h, k ); } + -+ const unsigned int m = 0x57559429; -+ const unsigned int n = 0x5052acdb; ++ unsigned int m = 0x57559429; ++ unsigned int n = 0x5052acdb; + const unsigned int *key4 = (const unsigned int *)key; + unsigned int h = len; + unsigned int k = len + seed + n; @@ -85606,10 +100399,11 @@ index 0000000..24b6c8e + return fndecl; +} + -+static inline gimple get_def_stmt(tree node) ++static inline gimple get_def_stmt(const_tree node) +{ + gcc_assert(node != NULL_TREE); -+ gcc_assert(TREE_CODE(node) == SSA_NAME); ++ if (TREE_CODE(node) != SSA_NAME) ++ return NULL; + return SSA_NAME_DEF_STMT(node); +} + @@ -85662,19 +100456,18 @@ index 0000000..24b6c8e + return len; +} + -+static unsigned int get_function_decl(tree fndecl, unsigned char *tree_codes) ++static unsigned int get_function_decl(const_tree fndecl, unsigned char *tree_codes) +{ -+ tree arg, result, type = TREE_TYPE(fndecl); ++ const_tree arg, result, arg_field, type = TREE_TYPE(fndecl); + enum tree_code code = TREE_CODE(type); + size_t len = 0; + -+ gcc_assert(code == FUNCTION_TYPE); ++ gcc_assert(code == FUNCTION_TYPE || code == METHOD_TYPE); + + arg = TYPE_ARG_TYPES(type); + // skip builtins __builtin_constant_p + if (!arg && DECL_BUILT_IN(fndecl)) + return 0; -+ gcc_assert(arg != NULL_TREE); + + if (TREE_CODE_CLASS(code) == tcc_type) + result = type; @@ -85684,6 +100477,18 @@ index 0000000..24b6c8e + gcc_assert(result != NULL_TREE); + len = add_type_codes(TREE_TYPE(result), tree_codes, len); + ++ if (arg == NULL_TREE) { ++ gcc_assert(CODE_CONTAINS_STRUCT(TREE_CODE(fndecl), TS_DECL_NON_COMMON)); ++ arg_field = DECL_ARGUMENT_FLD(fndecl); ++ if (arg_field == NULL_TREE) ++ return 0; ++ arg = TREE_TYPE(arg_field); ++ len = add_type_codes(arg, tree_codes, len); ++ gcc_assert(len != 0); ++ return len; ++ } ++ ++ gcc_assert(arg != NULL_TREE && TREE_CODE(arg) == TREE_LIST); + while (arg && len < CODES_LIMIT) { + len = add_type_codes(TREE_VALUE(arg), tree_codes, len); + arg = TREE_CHAIN(arg); @@ -85693,18 +100498,20 @@ index 0000000..24b6c8e + return len; +} + -+static struct size_overflow_hash *get_function_hash(tree fndecl) ++static const struct size_overflow_hash *get_function_hash(tree fndecl) +{ + unsigned int hash; -+ struct size_overflow_hash *entry; ++ const struct size_overflow_hash *entry; + unsigned char tree_codes[CODES_LIMIT]; + size_t len; -+ const char *func_name = NAME(fndecl); ++ const char *func_name; + ++ fndecl = get_original_function_decl(fndecl); + len = get_function_decl(fndecl, tree_codes); + if (len == 0) + return NULL; + ++ func_name = get_asm_name(fndecl); + hash = get_hash_num(func_name, (const char*) tree_codes, len, 0); + + entry = size_overflow_hash[hash]; @@ -85717,86 +100524,108 @@ index 0000000..24b6c8e + return NULL; +} + -+static void check_arg_type(tree var) ++static bool is_bool(const_tree node) +{ -+ tree type = TREE_TYPE(var); -+ enum tree_code code = TREE_CODE(type); ++ const_tree type; ++ ++ if (node == NULL_TREE) ++ return false; + -+ gcc_assert(code == INTEGER_TYPE || code == ENUMERAL_TYPE || -+ (code == POINTER_TYPE && TREE_CODE(TREE_TYPE(type)) == VOID_TYPE) || -+ (code == POINTER_TYPE && TREE_CODE(TREE_TYPE(type)) == INTEGER_TYPE)); ++ type = TREE_TYPE(node); ++ if (!INTEGRAL_TYPE_P(type)) ++ return false; ++ if (TREE_CODE(type) == BOOLEAN_TYPE) ++ return true; ++ if (TYPE_PRECISION(type) == 1) ++ return true; ++ return false; +} + -+static int find_arg_number(tree arg, tree func) ++static bool skip_types(const_tree var) +{ -+ tree var; -+ bool match = false; -+ unsigned int argnum = 1; -+ -+ if (TREE_CODE(arg) == SSA_NAME) -+ arg = SSA_NAME_VAR(arg); ++ tree type; + -+ for (var = DECL_ARGUMENTS(func); var; var = TREE_CHAIN(var)) { -+ if (strcmp(NAME(arg), NAME(var))) { -+ argnum++; -+ continue; -+ } -+ check_arg_type(var); ++ if (is_gimple_constant(var)) ++ return true; + -+ match = true; -+ break; -+ } -+ if (!match) { -+ warning(0, "find_arg_number: cannot find the %s argument in %s", NAME(arg), NAME(func)); -+ return 0; ++ switch (TREE_CODE(var)) { ++ case ADDR_EXPR: ++#if BUILDING_GCC_VERSION >= 4006 ++ case MEM_REF: ++#endif ++ case ARRAY_REF: ++ case BIT_FIELD_REF: ++ case INDIRECT_REF: ++ case TARGET_MEM_REF: ++ return true; ++ case PARM_DECL: ++ case VAR_DECL: ++ case COMPONENT_REF: ++ return false; ++ default: ++ break; + } -+ return argnum; -+} + -+static void print_missing_msg(tree func, unsigned int argnum) -+{ -+ unsigned int new_hash; -+ size_t len; -+ unsigned char tree_codes[CODES_LIMIT]; -+ location_t loc = DECL_SOURCE_LOCATION(func); -+ const char *curfunc = NAME(func); ++ gcc_assert(TREE_CODE(var) == SSA_NAME); + -+ len = get_function_decl(func, tree_codes); -+ new_hash = get_hash_num(curfunc, (const char *) tree_codes, len, 0); -+ inform(loc, "Function %s is missing from the size_overflow hash table +%s+%d+%u+", curfunc, curfunc, argnum, new_hash); -+} ++ type = TREE_TYPE(var); ++ switch (TREE_CODE(type)) { ++ case INTEGER_TYPE: ++ case ENUMERAL_TYPE: ++ return false; ++ case BOOLEAN_TYPE: ++ return is_bool(var); ++ default: ++ break; ++ } + -+static void check_missing_attribute(tree arg) -+{ -+ tree type, func = get_original_function_decl(current_function_decl); -+ unsigned int argnum; -+ struct size_overflow_hash *hash; ++ gcc_assert(TREE_CODE(type) == POINTER_TYPE); + -+ gcc_assert(TREE_CODE(arg) != COMPONENT_REF); ++ type = TREE_TYPE(type); ++ gcc_assert(type != NULL_TREE); ++ switch (TREE_CODE(type)) { ++ case RECORD_TYPE: ++ case POINTER_TYPE: ++ case ARRAY_TYPE: ++ return true; ++ case VOID_TYPE: ++ case INTEGER_TYPE: ++ case UNION_TYPE: ++ return false; ++ default: ++ break; ++ } + -+ type = TREE_TYPE(arg); ++ debug_tree((tree)var); ++ gcc_unreachable(); ++} + -+ if (TREE_CODE(type) == POINTER_TYPE) -+ return; ++static unsigned int find_arg_number(const_tree arg, tree func) ++{ ++ tree var; ++ unsigned int argnum = 1; + -+ if (lookup_attribute("size_overflow", DECL_ATTRIBUTES(func))) -+ return; ++ if (TREE_CODE(arg) == SSA_NAME) ++ arg = SSA_NAME_VAR(arg); + -+ argnum = find_arg_number(arg, func); -+ if (argnum == 0) -+ return; ++ for (var = DECL_ARGUMENTS(func); var; var = TREE_CHAIN(var), argnum++) { ++ if (!operand_equal_p(arg, var, 0) && strcmp(NAME(var), NAME(arg))) ++ continue; ++ if (!skip_types(var)) ++ return argnum; ++ } + -+ hash = get_function_hash(func); -+ if (!hash || !(hash->param & (1U << argnum))) -+ print_missing_msg(func, argnum); ++ return 0; +} + +static tree create_new_var(tree type) +{ + tree new_var = create_tmp_var(type, "cicus"); + ++#if BUILDING_GCC_VERSION <= 4007 + add_referenced_var(new_var); + mark_sym_for_renaming(new_var); ++#endif + return new_var; +} + @@ -85807,6 +100636,7 @@ index 0000000..24b6c8e + tree type = TREE_TYPE(rhs1); + tree lhs = create_new_var(type); + ++ gcc_assert(types_compatible_p(type, TREE_TYPE(rhs2))); + assign = gimple_build_assign_with_ops(code, lhs, rhs1, rhs2); + gimple_set_lhs(assign, make_ssa_name(lhs, assign)); + @@ -85816,23 +100646,6 @@ index 0000000..24b6c8e + return assign; +} + -+static bool is_bool(tree node) -+{ -+ tree type; -+ -+ if (node == NULL_TREE) -+ return false; -+ -+ type = TREE_TYPE(node); -+ if (!INTEGRAL_TYPE_P(type)) -+ return false; -+ if (TREE_CODE(type) == BOOLEAN_TYPE) -+ return true; -+ if (TYPE_PRECISION(type) == 1) -+ return true; -+ return false; -+} -+ +static tree cast_a_tree(tree type, tree var) +{ + gcc_assert(type != NULL_TREE); @@ -85842,26 +100655,66 @@ index 0000000..24b6c8e + return fold_convert(type, var); +} + -+static gimple build_cast_stmt(tree type, tree var, tree new_var, gimple_stmt_iterator *gsi, bool before) ++static tree get_lhs(const_gimple stmt) +{ -+ gimple assign; -+ location_t loc; ++ switch (gimple_code(stmt)) { ++ case GIMPLE_ASSIGN: ++ return gimple_get_lhs(stmt); ++ case GIMPLE_PHI: ++ return gimple_phi_result(stmt); ++ case GIMPLE_CALL: ++ return gimple_call_lhs(stmt); ++ default: ++ return NULL_TREE; ++ } ++} ++ ++static bool skip_cast(tree dst_type, const_tree rhs, bool force) ++{ ++ const_gimple def_stmt = get_def_stmt(rhs); + -+ gcc_assert(type != NULL_TREE && var != NULL_TREE); -+ if (gsi_end_p(*gsi) && before == BEFORE_STMT) ++ if (force) ++ return false; ++ ++ if (is_gimple_constant(rhs)) ++ return false; ++ ++ if (!def_stmt || gimple_code(def_stmt) == GIMPLE_NOP) ++ return false; ++ ++ if (!types_compatible_p(dst_type, TREE_TYPE(rhs))) ++ return false; ++ ++ // DI type can be on 32 bit (from create_assign) but overflow type stays DI ++ if (LONG_TYPE_SIZE == GET_MODE_BITSIZE(SImode)) ++ return false; ++ ++ return true; ++} ++ ++static gimple build_cast_stmt(tree dst_type, tree rhs, tree lhs, gimple_stmt_iterator *gsi, bool before, bool force) ++{ ++ gimple assign, def_stmt; ++ ++ gcc_assert(dst_type != NULL_TREE && rhs != NULL_TREE); ++ if (gsi_end_p(*gsi) && before == AFTER_STMT) + gcc_unreachable(); + -+ if (new_var == CREATE_NEW_VAR) -+ new_var = create_new_var(type); ++ def_stmt = get_def_stmt(rhs); ++ if (skip_cast(dst_type, rhs, force) && gimple_plf(def_stmt, MY_STMT)) ++ return def_stmt; + -+ assign = gimple_build_assign(new_var, cast_a_tree(type, var)); ++ if (lhs == CREATE_NEW_VAR) ++ lhs = create_new_var(dst_type); ++ ++ assign = gimple_build_assign(lhs, cast_a_tree(dst_type, rhs)); + + if (!gsi_end_p(*gsi)) { -+ loc = gimple_location(gsi_stmt(*gsi)); ++ location_t loc = gimple_location(gsi_stmt(*gsi)); + gimple_set_location(assign, loc); + } + -+ gimple_set_lhs(assign, make_ssa_name(new_var, assign)); ++ gimple_set_lhs(assign, make_ssa_name(lhs, assign)); + + if (before) + gsi_insert_before(gsi, assign, GSI_NEW_STMT); @@ -85873,59 +100726,86 @@ index 0000000..24b6c8e + return assign; +} + -+static tree cast_to_new_size_overflow_type(gimple stmt, tree new_rhs1, tree size_overflow_type, bool before) ++static tree cast_to_new_size_overflow_type(gimple stmt, tree rhs, tree size_overflow_type, bool before) +{ -+ gimple assign; + gimple_stmt_iterator gsi; ++ tree lhs; ++ const_gimple new_stmt; + -+ if (new_rhs1 == NULL_TREE) ++ if (rhs == NULL_TREE) + return NULL_TREE; + -+ if (!useless_type_conversion_p(TREE_TYPE(new_rhs1), size_overflow_type)) { -+ gsi = gsi_for_stmt(stmt); -+ assign = build_cast_stmt(size_overflow_type, new_rhs1, CREATE_NEW_VAR, &gsi, before); -+ return gimple_get_lhs(assign); -+ } -+ return new_rhs1; ++ gsi = gsi_for_stmt(stmt); ++ new_stmt = build_cast_stmt(size_overflow_type, rhs, CREATE_NEW_VAR, &gsi, before, false); ++ ++ lhs = get_lhs(new_stmt); ++ gcc_assert(lhs != NULL_TREE); ++ return lhs; +} + -+static tree create_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple oldstmt, tree rhs1, bool before) ++static tree cast_to_TI_type(gimple stmt, tree node) +{ -+ tree oldstmt_rhs1, size_overflow_type, lhs; -+ enum tree_code code; -+ gimple stmt; + gimple_stmt_iterator gsi; ++ gimple cast_stmt; ++ tree type = TREE_TYPE(node); + -+ if (!*potentionally_overflowed) -+ return NULL_TREE; ++ if (types_compatible_p(type, intTI_type_node)) ++ return node; ++ ++ gsi = gsi_for_stmt(stmt); ++ cast_stmt = build_cast_stmt(intTI_type_node, node, CREATE_NEW_VAR, &gsi, BEFORE_STMT, false); ++ return gimple_get_lhs(cast_stmt); ++} ++ ++static void check_function_hash(const_gimple stmt) ++{ ++ tree func; ++ const struct size_overflow_hash *hash; ++ ++ if (gimple_code(stmt) != GIMPLE_CALL) ++ return; ++ ++ func = gimple_call_fndecl(stmt); ++ //fs/xattr.c D.34222_15 = D.34219_14 (dentry_3(D), name_7(D), 0B, 0); ++ if (func == NULL_TREE) ++ return; ++ ++ hash = get_function_hash(func); ++ if (!hash) ++ print_missing_msg(func, 0); ++} ++ ++static tree create_assign(struct pointer_set_t *visited, gimple oldstmt, tree rhs1, bool before) ++{ ++ tree lhs, new_lhs; ++ gimple_stmt_iterator gsi; + + if (rhs1 == NULL_TREE) { + debug_gimple_stmt(oldstmt); -+ error("create_assign: rhs1 is NULL_TREE"); ++ error("%s: rhs1 is NULL_TREE", __func__); + gcc_unreachable(); + } + -+ if (gimple_code(oldstmt) == GIMPLE_ASM) ++ switch (gimple_code(oldstmt)) { ++ case GIMPLE_ASM: + lhs = rhs1; -+ else ++ break; ++ case GIMPLE_CALL: ++ lhs = gimple_call_lhs(oldstmt); ++ break; ++ case GIMPLE_ASSIGN: + lhs = gimple_get_lhs(oldstmt); -+ -+ oldstmt_rhs1 = gimple_assign_rhs1(oldstmt); -+ code = TREE_CODE(oldstmt_rhs1); -+ if (code == PARM_DECL || (code == SSA_NAME && gimple_code(get_def_stmt(oldstmt_rhs1)) == GIMPLE_NOP)) { -+ argnum = search_missing_attribute(oldstmt_rhs1); -+ if (argnum && is_already_marked(get_original_function_decl(current_function_decl), argnum) == MARKED_YES) { -+ *overflowed = OVERFLOW_INTENTIONAL; -+ return NULL_TREE; -+ } -+ ++ break; ++ default: ++ debug_gimple_stmt(oldstmt); ++ gcc_unreachable(); + } + + gsi = gsi_for_stmt(oldstmt); + pointer_set_insert(visited, oldstmt); + if (lookup_stmt_eh_lp(oldstmt) != 0) { + basic_block next_bb, cur_bb; -+ edge e; ++ const_edge e; + + gcc_assert(before == false); + gcc_assert(stmt_can_throw_internal(oldstmt)); @@ -85943,35 +100823,28 @@ index 0000000..24b6c8e + + before = true; + oldstmt = gsi_stmt(gsi); -+ pointer_set_insert(visited, oldstmt); + } + -+ size_overflow_type = get_size_overflow_type(oldstmt, lhs); -+ -+ stmt = build_cast_stmt(size_overflow_type, rhs1, CREATE_NEW_VAR, &gsi, before); -+ gimple_set_plf(stmt, MY_STMT, true); -+ return gimple_get_lhs(stmt); ++ new_lhs = cast_to_new_size_overflow_type(oldstmt, rhs1, get_size_overflow_type(oldstmt, lhs), before); ++ return new_lhs; +} + -+static tree dup_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple oldstmt, tree size_overflow_type, tree rhs1, tree rhs2, tree __unused rhs3) ++static tree dup_assign(struct pointer_set_t *visited, gimple oldstmt, const_tree node, tree rhs1, tree rhs2, tree __unused rhs3) +{ -+ tree new_var, lhs = gimple_get_lhs(oldstmt); + gimple stmt; + gimple_stmt_iterator gsi; -+ -+ if (!*potentionally_overflowed) -+ return NULL_TREE; ++ tree size_overflow_type, new_var, lhs = gimple_get_lhs(oldstmt); + + if (gimple_plf(oldstmt, MY_STMT)) + return lhs; + + if (gimple_num_ops(oldstmt) != 4 && rhs1 == NULL_TREE) { + rhs1 = gimple_assign_rhs1(oldstmt); -+ rhs1 = create_assign(visited, overflowed, oldstmt, rhs1, BEFORE_STMT); ++ rhs1 = create_assign(visited, oldstmt, rhs1, BEFORE_STMT); + } + if (gimple_num_ops(oldstmt) == 3 && rhs2 == NULL_TREE) { + rhs2 = gimple_assign_rhs2(oldstmt); -+ rhs2 = create_assign(visited, overflowed, oldstmt, rhs2, BEFORE_STMT); ++ rhs2 = create_assign(visited, oldstmt, rhs2, BEFORE_STMT); + } + + stmt = gimple_copy(oldstmt); @@ -85981,18 +100854,14 @@ index 0000000..24b6c8e + if (gimple_assign_rhs_code(oldstmt) == WIDEN_MULT_EXPR) + gimple_assign_set_rhs_code(stmt, MULT_EXPR); + -+ if (is_bool(lhs)) -+ new_var = SSA_NAME_VAR(lhs); -+ else -+ new_var = create_new_var(size_overflow_type); ++ size_overflow_type = get_size_overflow_type(oldstmt, node); ++ ++ new_var = create_new_var(size_overflow_type); + new_var = make_ssa_name(new_var, stmt); + gimple_set_lhs(stmt, new_var); + -+ if (rhs1 != NULL_TREE) { -+ if (!gimple_assign_cast_p(oldstmt)) -+ rhs1 = cast_a_tree(size_overflow_type, rhs1); ++ if (rhs1 != NULL_TREE) + gimple_assign_set_rhs1(stmt, rhs1); -+ } + + if (rhs2 != NULL_TREE) + gimple_assign_set_rhs2(stmt, rhs2); @@ -86010,264 +100879,346 @@ index 0000000..24b6c8e + return gimple_get_lhs(stmt); +} + -+static gimple overflow_create_phi_node(gimple oldstmt, tree var) ++static tree cast_parm_decl(tree phi_ssa_name, tree arg, tree size_overflow_type) +{ -+ basic_block bb; -+ gimple phi; -+ gimple_stmt_iterator gsi = gsi_for_stmt(oldstmt); -+ -+ bb = gsi_bb(gsi); ++ basic_block first_bb; ++ gimple assign; ++ gimple_stmt_iterator gsi; + -+ phi = create_phi_node(var, bb); -+ gsi = gsi_last(phi_nodes(bb)); -+ gsi_remove(&gsi, false); ++ first_bb = split_block_after_labels(ENTRY_BLOCK_PTR)->dest; ++ gcc_assert(dom_info_available_p(CDI_DOMINATORS)); ++ set_immediate_dominator(CDI_DOMINATORS, first_bb, ENTRY_BLOCK_PTR); + -+ gsi = gsi_for_stmt(oldstmt); -+ gsi_insert_after(&gsi, phi, GSI_NEW_STMT); -+ gimple_set_bb(phi, bb); -+ gimple_set_plf(phi, MY_STMT, true); -+ return phi; ++ gsi = gsi_start_bb(first_bb); ++ assign = build_cast_stmt(size_overflow_type, arg, phi_ssa_name, &gsi, BEFORE_STMT, false); ++ return gimple_get_lhs(assign); +} + -+static basic_block create_a_first_bb(void) ++static tree use_phi_ssa_name(tree phi_ssa_name, tree new_arg) +{ -+ basic_block first_bb; ++ gimple_stmt_iterator gsi; ++ const_gimple assign; ++ gimple def_stmt = get_def_stmt(new_arg); + -+ first_bb = split_block_after_labels(ENTRY_BLOCK_PTR)->dest; -+ if (dom_info_available_p(CDI_DOMINATORS)) -+ set_immediate_dominator(CDI_DOMINATORS, first_bb, ENTRY_BLOCK_PTR); -+ return first_bb; ++ if (gimple_code(def_stmt) == GIMPLE_PHI) { ++ gsi = gsi_after_labels(gimple_bb(def_stmt)); ++ assign = build_cast_stmt(TREE_TYPE(new_arg), new_arg, phi_ssa_name, &gsi, BEFORE_STMT, true); ++ } else { ++ gsi = gsi_for_stmt(def_stmt); ++ assign = build_cast_stmt(TREE_TYPE(new_arg), new_arg, phi_ssa_name, &gsi, AFTER_STMT, true); ++ } ++ ++ return gimple_get_lhs(assign); +} + -+static tree cast_old_phi_arg(gimple oldstmt, tree size_overflow_type, tree arg, tree new_var, unsigned int i) ++static tree cast_visited_phi_arg(tree phi_ssa_name, tree arg, tree size_overflow_type) +{ + basic_block bb; -+ gimple newstmt; + gimple_stmt_iterator gsi; -+ bool before = BEFORE_STMT; -+ -+ if (TREE_CODE(arg) == SSA_NAME && gimple_code(get_def_stmt(arg)) != GIMPLE_NOP) { -+ gsi = gsi_for_stmt(get_def_stmt(arg)); -+ newstmt = build_cast_stmt(size_overflow_type, arg, new_var, &gsi, AFTER_STMT); -+ return gimple_get_lhs(newstmt); -+ } ++ const_gimple assign, def_stmt; + -+ bb = gimple_phi_arg_edge(oldstmt, i)->src; ++ def_stmt = get_def_stmt(arg); ++ bb = gimple_bb(def_stmt); ++ gcc_assert(bb->index != 0); + gsi = gsi_after_labels(bb); -+ if (bb->index == 0) { -+ bb = create_a_first_bb(); -+ gsi = gsi_start_bb(bb); -+ } -+ if (gsi_end_p(gsi)) -+ before = AFTER_STMT; -+ newstmt = build_cast_stmt(size_overflow_type, arg, new_var, &gsi, before); -+ return gimple_get_lhs(newstmt); ++ ++ assign = build_cast_stmt(size_overflow_type, arg, phi_ssa_name, &gsi, BEFORE_STMT, false); ++ return gimple_get_lhs(assign); +} + -+static gimple handle_new_phi_arg(tree arg, tree new_var, tree new_rhs) ++static tree create_new_phi_arg(tree phi_ssa_name, tree new_arg, tree arg, gimple oldstmt) +{ -+ gimple newstmt; -+ gimple_stmt_iterator gsi; -+ void (*gsi_insert)(gimple_stmt_iterator *, gimple, enum gsi_iterator_update); -+ gimple def_newstmt = get_def_stmt(new_rhs); ++ tree size_overflow_type; ++ const_gimple def_stmt = get_def_stmt(arg); + -+ gsi_insert = gsi_insert_after; -+ gsi = gsi_for_stmt(def_newstmt); ++ if (phi_ssa_name != NULL_TREE) ++ phi_ssa_name = SSA_NAME_VAR(phi_ssa_name); ++ ++ size_overflow_type = get_size_overflow_type(oldstmt, arg); ++ ++ if (new_arg != NULL_TREE) { ++ gcc_assert(types_compatible_p(TREE_TYPE(new_arg), size_overflow_type)); ++ return use_phi_ssa_name(phi_ssa_name, new_arg); ++ } + -+ switch (gimple_code(get_def_stmt(arg))) { ++ switch(gimple_code(def_stmt)) { + case GIMPLE_PHI: -+ newstmt = gimple_build_assign(new_var, new_rhs); -+ gsi = gsi_after_labels(gimple_bb(def_newstmt)); -+ gsi_insert = gsi_insert_before; -+ break; -+ case GIMPLE_ASM: -+ case GIMPLE_CALL: -+ newstmt = gimple_build_assign(new_var, new_rhs); -+ break; -+ case GIMPLE_ASSIGN: -+ newstmt = gimple_build_assign(new_var, gimple_get_lhs(def_newstmt)); -+ break; ++ return cast_visited_phi_arg(phi_ssa_name, arg, size_overflow_type); ++ case GIMPLE_NOP: ++ return cast_parm_decl(phi_ssa_name, arg, size_overflow_type); + default: -+ /* unknown gimple_code (handle_build_new_phi_arg) */ ++ debug_gimple_stmt((gimple)def_stmt); + gcc_unreachable(); + } -+ -+ gimple_set_lhs(newstmt, make_ssa_name(new_var, newstmt)); -+ gsi_insert(&gsi, newstmt, GSI_NEW_STMT); -+ gimple_set_plf(newstmt, MY_STMT, true); -+ update_stmt(newstmt); -+ return newstmt; +} + -+static tree build_new_phi_arg(struct pointer_set_t *visited, bool *potentionally_overflowed, tree size_overflow_type, tree arg, tree new_var) ++static gimple overflow_create_phi_node(gimple oldstmt, tree result) +{ -+ gimple newstmt; -+ tree new_rhs; ++ basic_block bb; ++ gimple phi; ++ gimple_seq seq; ++ gimple_stmt_iterator gsi = gsi_for_stmt(oldstmt); + -+ new_rhs = expand(visited, potentionally_overflowed, arg); -+ if (new_rhs == NULL_TREE) -+ return NULL_TREE; ++ bb = gsi_bb(gsi); + -+ new_rhs = cast_to_new_size_overflow_type(get_def_stmt(new_rhs), new_rhs, size_overflow_type, AFTER_STMT); ++ phi = create_phi_node(result, bb); ++ gimple_phi_set_result(phi, make_ssa_name(result, phi)); ++ seq = phi_nodes(bb); ++ gsi = gsi_last(seq); ++ gsi_remove(&gsi, false); + -+ newstmt = handle_new_phi_arg(arg, new_var, new_rhs); -+ return gimple_get_lhs(newstmt); ++ gsi = gsi_for_stmt(oldstmt); ++ gsi_insert_after(&gsi, phi, GSI_NEW_STMT); ++ gimple_set_bb(phi, bb); ++ gimple_set_plf(phi, MY_STMT, true); ++ return phi; +} + -+static tree build_new_phi(struct pointer_set_t *visited, bool *potentionally_overflowed, tree var) ++static tree handle_phi(struct pointer_set_t *visited, tree orig_result) +{ -+ gimple phi, oldstmt = get_def_stmt(var); -+ tree new_var, size_overflow_type; -+ unsigned int i, n = gimple_phi_num_args(oldstmt); -+ -+ size_overflow_type = get_size_overflow_type(oldstmt, var); -+ -+ new_var = create_new_var(size_overflow_type); ++ gimple new_phi = NULL; ++ gimple oldstmt = get_def_stmt(orig_result); ++ tree phi_ssa_name = NULL_TREE; ++ unsigned int i; + + pointer_set_insert(visited, oldstmt); -+ phi = overflow_create_phi_node(oldstmt, new_var); -+ for (i = 0; i < n; i++) { -+ tree arg, lhs; ++ for (i = 0; i < gimple_phi_num_args(oldstmt); i++) { ++ tree arg, new_arg; + + arg = gimple_phi_arg_def(oldstmt, i); -+ if (is_gimple_constant(arg)) -+ arg = cast_a_tree(size_overflow_type, arg); -+ lhs = build_new_phi_arg(visited, potentionally_overflowed, size_overflow_type, arg, new_var); -+ if (lhs == NULL_TREE) -+ lhs = cast_old_phi_arg(oldstmt, size_overflow_type, arg, new_var, i); -+ add_phi_arg(phi, lhs, gimple_phi_arg_edge(oldstmt, i), gimple_location(oldstmt)); ++ ++ new_arg = expand(visited, arg); ++ new_arg = create_new_phi_arg(phi_ssa_name, new_arg, arg, oldstmt); ++ if (i == 0) { ++ phi_ssa_name = new_arg; ++ new_phi = overflow_create_phi_node(oldstmt, SSA_NAME_VAR(phi_ssa_name)); ++ } ++ ++ gcc_assert(new_phi != NULL); ++ add_phi_arg(new_phi, new_arg, gimple_phi_arg_edge(oldstmt, i), gimple_location(oldstmt)); + } + -+ update_stmt(phi); -+ return gimple_phi_result(phi); ++ gcc_assert(new_phi != NULL); ++ update_stmt(new_phi); ++ return gimple_phi_result(new_phi); +} + -+static tree change_assign_rhs(gimple stmt, tree orig_rhs, tree new_rhs) ++static tree change_assign_rhs(gimple stmt, const_tree orig_rhs, tree new_rhs) +{ -+ gimple assign; ++ const_gimple assign; + gimple_stmt_iterator gsi = gsi_for_stmt(stmt); + tree origtype = TREE_TYPE(orig_rhs); + + gcc_assert(gimple_code(stmt) == GIMPLE_ASSIGN); + -+ assign = build_cast_stmt(origtype, new_rhs, CREATE_NEW_VAR, &gsi, BEFORE_STMT); ++ assign = build_cast_stmt(origtype, new_rhs, CREATE_NEW_VAR, &gsi, BEFORE_STMT, false); + return gimple_get_lhs(assign); +} + -+static void change_rhs1(gimple stmt, tree new_rhs1) ++static bool is_a_cast_and_const_overflow(const_tree no_const_rhs) +{ -+ tree assign_rhs; -+ tree rhs = gimple_assign_rhs1(stmt); ++ const_tree rhs1, lhs, rhs1_type, lhs_type; ++ enum machine_mode lhs_mode, rhs_mode; ++ gimple def_stmt = get_def_stmt(no_const_rhs); + -+ assign_rhs = change_assign_rhs(stmt, rhs, new_rhs1); -+ gimple_assign_set_rhs1(stmt, assign_rhs); -+ update_stmt(stmt); ++ if (!gimple_assign_cast_p(def_stmt)) ++ return false; ++ ++ rhs1 = gimple_assign_rhs1(def_stmt); ++ lhs = gimple_get_lhs(def_stmt); ++ rhs1_type = TREE_TYPE(rhs1); ++ lhs_type = TREE_TYPE(lhs); ++ rhs_mode = TYPE_MODE(rhs1_type); ++ lhs_mode = TYPE_MODE(lhs_type); ++ if (TYPE_UNSIGNED(lhs_type) == TYPE_UNSIGNED(rhs1_type) || lhs_mode != rhs_mode) ++ return false; ++ ++ return true; +} + -+static bool check_mode_type(gimple stmt) ++static tree create_cast_assign(struct pointer_set_t *visited, gimple stmt) +{ ++ tree rhs1 = gimple_assign_rhs1(stmt); + tree lhs = gimple_get_lhs(stmt); -+ tree lhs_type = TREE_TYPE(lhs); -+ tree rhs_type = TREE_TYPE(gimple_assign_rhs1(stmt)); -+ enum machine_mode lhs_mode = TYPE_MODE(lhs_type); -+ enum machine_mode rhs_mode = TYPE_MODE(rhs_type); ++ const_tree rhs1_type = TREE_TYPE(rhs1); ++ const_tree lhs_type = TREE_TYPE(lhs); + -+ if (rhs_mode == lhs_mode && TYPE_UNSIGNED(rhs_type) == TYPE_UNSIGNED(lhs_type)) -+ return false; ++ if (TYPE_UNSIGNED(rhs1_type) == TYPE_UNSIGNED(lhs_type)) ++ return create_assign(visited, stmt, lhs, AFTER_STMT); + -+ if (rhs_mode == SImode && lhs_mode == DImode && (TYPE_UNSIGNED(rhs_type) || !TYPE_UNSIGNED(lhs_type))) -+ return false; ++ return create_assign(visited, stmt, rhs1, AFTER_STMT); ++} + ++static bool no_uses(tree node) ++{ ++ imm_use_iterator imm_iter; ++ use_operand_p use_p; ++ ++ FOR_EACH_IMM_USE_FAST(use_p, imm_iter, node) { ++ const_gimple use_stmt = USE_STMT(use_p); ++ if (use_stmt == NULL) ++ return true; ++ if (is_gimple_debug(use_stmt)) ++ continue; ++ if (!(gimple_bb(use_stmt)->flags & BB_REACHABLE)) ++ continue; ++ return false; ++ } + return true; +} + -+static bool check_undefined_integer_operation(gimple stmt) ++// 3.8.5 mm/page-writeback.c __ilog2_u64(): ret, uint + uintmax; uint -> int; int max ++static bool is_const_plus_unsigned_signed_truncation(const_tree lhs) +{ -+ gimple def_stmt; -+ tree lhs = gimple_get_lhs(stmt); -+ tree rhs1 = gimple_assign_rhs1(stmt); -+ tree rhs1_type = TREE_TYPE(rhs1); -+ tree lhs_type = TREE_TYPE(lhs); ++ tree rhs1, lhs_type, rhs_type, rhs2, not_const_rhs; ++ gimple def_stmt = get_def_stmt(lhs); ++ ++ if (!def_stmt || !gimple_assign_cast_p(def_stmt)) ++ return false; + -+ if (TYPE_MODE(rhs1_type) != TYPE_MODE(lhs_type) || TYPE_UNSIGNED(rhs1_type) == TYPE_UNSIGNED(lhs_type)) ++ rhs1 = gimple_assign_rhs1(def_stmt); ++ rhs_type = TREE_TYPE(rhs1); ++ lhs_type = TREE_TYPE(lhs); ++ if (TYPE_UNSIGNED(lhs_type) || !TYPE_UNSIGNED(rhs_type)) ++ return false; ++ if (TYPE_MODE(lhs_type) != TYPE_MODE(rhs_type)) + return false; + + def_stmt = get_def_stmt(rhs1); -+ if (gimple_code(def_stmt) != GIMPLE_ASSIGN) ++ if (!def_stmt || gimple_code(def_stmt) != GIMPLE_ASSIGN || gimple_num_ops(def_stmt) != 3) + return false; + -+ if (gimple_assign_rhs_code(def_stmt) != MINUS_EXPR) ++ if (gimple_assign_rhs_code(def_stmt) != PLUS_EXPR) + return false; -+ return true; ++ ++ rhs1 = gimple_assign_rhs1(def_stmt); ++ rhs2 = gimple_assign_rhs2(def_stmt); ++ if (!is_gimple_constant(rhs1) && !is_gimple_constant(rhs2)) ++ return false; ++ ++ if (is_gimple_constant(rhs2)) ++ not_const_rhs = rhs1; ++ else ++ not_const_rhs = rhs2; ++ ++ return no_uses(not_const_rhs); +} + -+static tree handle_unary_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple stmt) ++static bool skip_lhs_cast_check(const_gimple stmt) +{ -+ tree size_overflow_type, lhs = gimple_get_lhs(stmt); -+ tree new_rhs1, rhs1 = gimple_assign_rhs1(stmt); -+ tree rhs1_type = TREE_TYPE(rhs1); -+ tree lhs_type = TREE_TYPE(lhs); ++ const_tree rhs = gimple_assign_rhs1(stmt); ++ const_gimple def_stmt = get_def_stmt(rhs); + -+ *potentionally_overflowed = true; ++ // 3.8.2 kernel/futex_compat.c compat_exit_robust_list(): get_user() 64 ulong -> int (compat_long_t), int max ++ if (gimple_code(def_stmt) == GIMPLE_ASM) ++ return true; + -+ new_rhs1 = expand(visited, potentionally_overflowed, rhs1); ++ if (is_const_plus_unsigned_signed_truncation(rhs)) ++ return true; + -+ if (new_rhs1 == NULL_TREE || TREE_CODE(rhs1_type) == POINTER_TYPE) -+ return create_assign(visited, potentionally_overflowed, stmt, lhs, AFTER_STMT); ++ return false; ++} + -+ if (gimple_plf(stmt, MY_STMT)) -+ return lhs; ++static tree create_cast_overflow_check(struct pointer_set_t *visited, tree new_rhs1, gimple stmt) ++{ ++ bool cast_lhs, cast_rhs; ++ tree lhs = gimple_get_lhs(stmt); ++ tree rhs = gimple_assign_rhs1(stmt); ++ const_tree lhs_type = TREE_TYPE(lhs); ++ const_tree rhs_type = TREE_TYPE(rhs); ++ enum machine_mode lhs_mode = TYPE_MODE(lhs_type); ++ enum machine_mode rhs_mode = TYPE_MODE(rhs_type); ++ unsigned int lhs_size = GET_MODE_BITSIZE(lhs_mode); ++ unsigned int rhs_size = GET_MODE_BITSIZE(rhs_mode); ++ ++ static bool check_lhs[3][4] = { ++ // ss su us uu ++ { false, true, true, false }, // lhs > rhs ++ { false, false, false, false }, // lhs = rhs ++ { true, true, true, true }, // lhs < rhs ++ }; + -+ if (gimple_plf(stmt, NO_CAST_CHECK)) { -+ size_overflow_type = get_size_overflow_type(stmt, rhs1); -+ new_rhs1 = cast_to_new_size_overflow_type(stmt, new_rhs1, size_overflow_type, BEFORE_STMT); -+ return dup_assign(visited, potentionally_overflowed, stmt, size_overflow_type, new_rhs1, NULL_TREE, NULL_TREE); -+ } ++ static bool check_rhs[3][4] = { ++ // ss su us uu ++ { true, false, true, true }, // lhs > rhs ++ { true, false, true, true }, // lhs = rhs ++ { true, false, true, true }, // lhs < rhs ++ }; + -+ if (!gimple_assign_cast_p(stmt)) { -+ size_overflow_type = get_size_overflow_type(stmt, lhs); -+ new_rhs1 = cast_to_new_size_overflow_type(stmt, new_rhs1, size_overflow_type, BEFORE_STMT); -+ return dup_assign(visited, potentionally_overflowed, stmt, size_overflow_type, new_rhs1, NULL_TREE, NULL_TREE); -+ } ++ // skip lhs check on signed SI -> HI cast or signed SI -> QI cast !!!! ++ if (rhs_mode == SImode && !TYPE_UNSIGNED(rhs_type) && (lhs_mode == HImode || lhs_mode == QImode)) ++ return create_assign(visited, stmt, lhs, AFTER_STMT); + -+ if (check_undefined_integer_operation(stmt)) { -+ size_overflow_type = get_size_overflow_type(stmt, lhs); -+ new_rhs1 = cast_to_new_size_overflow_type(stmt, new_rhs1, size_overflow_type, BEFORE_STMT); -+ return dup_assign(visited, potentionally_overflowed, stmt, size_overflow_type, new_rhs1, NULL_TREE, NULL_TREE); ++ if (lhs_size > rhs_size) { ++ cast_lhs = check_lhs[0][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)]; ++ cast_rhs = check_rhs[0][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)]; ++ } else if (lhs_size == rhs_size) { ++ cast_lhs = check_lhs[1][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)]; ++ cast_rhs = check_rhs[1][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)]; ++ } else { ++ cast_lhs = check_lhs[2][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)]; ++ cast_rhs = check_rhs[2][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)]; + } + -+ size_overflow_type = get_size_overflow_type(stmt, rhs1); -+ new_rhs1 = cast_to_new_size_overflow_type(stmt, new_rhs1, size_overflow_type, BEFORE_STMT); ++ if (!cast_lhs && !cast_rhs) ++ return dup_assign(visited, stmt, lhs, new_rhs1, NULL_TREE, NULL_TREE); + -+ change_rhs1(stmt, new_rhs1); -+ check_size_overflow(stmt, size_overflow_type, new_rhs1, rhs1, potentionally_overflowed, BEFORE_STMT); ++ if (cast_lhs && !skip_lhs_cast_check(stmt)) ++ check_size_overflow(stmt, TREE_TYPE(new_rhs1), new_rhs1, lhs, BEFORE_STMT); + -+ if (TYPE_UNSIGNED(rhs1_type) != TYPE_UNSIGNED(lhs_type)) -+ return create_assign(visited, potentionally_overflowed, stmt, lhs, AFTER_STMT); ++ if (cast_rhs) ++ check_size_overflow(stmt, TREE_TYPE(new_rhs1), new_rhs1, rhs, BEFORE_STMT); + -+ if (!check_mode_type(stmt)) -+ return create_assign(visited, potentionally_overflowed, stmt, lhs, AFTER_STMT); ++ return dup_assign(visited, stmt, lhs, new_rhs1, NULL_TREE, NULL_TREE); ++} + -+ size_overflow_type = get_size_overflow_type(stmt, lhs); -+ new_rhs1 = cast_to_new_size_overflow_type(stmt, new_rhs1, size_overflow_type, BEFORE_STMT); ++static tree handle_unary_rhs(struct pointer_set_t *visited, gimple stmt) ++{ ++ tree rhs1, new_rhs1, lhs = gimple_get_lhs(stmt); ++ ++ if (gimple_plf(stmt, MY_STMT)) ++ return lhs; ++ ++ rhs1 = gimple_assign_rhs1(stmt); ++ if (TREE_CODE(TREE_TYPE(rhs1)) == POINTER_TYPE) ++ return create_assign(visited, stmt, lhs, AFTER_STMT); ++ ++ new_rhs1 = expand(visited, rhs1); ++ ++ if (new_rhs1 == NULL_TREE) ++ return create_cast_assign(visited, stmt); ++ ++ if (gimple_plf(stmt, NO_CAST_CHECK)) ++ return dup_assign(visited, stmt, lhs, new_rhs1, NULL_TREE, NULL_TREE); ++ ++ if (gimple_assign_rhs_code(stmt) == BIT_NOT_EXPR) { ++ tree size_overflow_type = get_size_overflow_type(stmt, rhs1); ++ ++ new_rhs1 = cast_to_new_size_overflow_type(stmt, new_rhs1, size_overflow_type, BEFORE_STMT); ++ check_size_overflow(stmt, size_overflow_type, new_rhs1, rhs1, BEFORE_STMT); ++ return create_assign(visited, stmt, lhs, AFTER_STMT); ++ } + -+ check_size_overflow(stmt, size_overflow_type, new_rhs1, lhs, potentionally_overflowed, BEFORE_STMT); ++ if (!gimple_assign_cast_p(stmt)) ++ return dup_assign(visited, stmt, lhs, new_rhs1, NULL_TREE, NULL_TREE); + -+ return create_assign(visited, potentionally_overflowed, stmt, lhs, AFTER_STMT); ++ return create_cast_overflow_check(visited, new_rhs1, stmt); +} + -+static tree handle_unary_ops(struct pointer_set_t *visited, bool *potentionally_overflowed, tree lhs) ++static tree handle_unary_ops(struct pointer_set_t *visited, gimple stmt) +{ ++ tree rhs1, lhs = gimple_get_lhs(stmt); + gimple def_stmt = get_def_stmt(lhs); -+ tree rhs1 = gimple_assign_rhs1(def_stmt); ++ ++ gcc_assert(gimple_code(def_stmt) != GIMPLE_NOP); ++ rhs1 = gimple_assign_rhs1(def_stmt); + + if (is_gimple_constant(rhs1)) -+ return create_assign(visited, potentionally_overflowed, def_stmt, lhs, AFTER_STMT); ++ return create_assign(visited, def_stmt, lhs, AFTER_STMT); + -+ gcc_assert(TREE_CODE(rhs1) != COND_EXPR); + switch (TREE_CODE(rhs1)) { + case SSA_NAME: -+ return handle_unary_rhs(visited, potentionally_overflowed, def_stmt); ++ return handle_unary_rhs(visited, def_stmt); + case ARRAY_REF: + case BIT_FIELD_REF: + case ADDR_EXPR: @@ -86276,10 +101227,11 @@ index 0000000..24b6c8e +#if BUILDING_GCC_VERSION >= 4006 + case MEM_REF: +#endif -+ case PARM_DECL: + case TARGET_MEM_REF: ++ return create_assign(visited, def_stmt, lhs, AFTER_STMT); ++ case PARM_DECL: + case VAR_DECL: -+ return create_assign(visited, overflowed, def_stmt, lhs, AFTER_STMT); ++ return create_assign(visited, stmt, lhs, AFTER_STMT); + + default: + debug_gimple_stmt(def_stmt); @@ -86301,7 +101253,7 @@ index 0000000..24b6c8e +static tree create_string_param(tree string) +{ + tree i_type, a_type; -+ int length = TREE_STRING_LENGTH(string); ++ const int length = TREE_STRING_LENGTH(string); + + gcc_assert(length > 0); + @@ -86315,12 +101267,15 @@ index 0000000..24b6c8e + return build1(ADDR_EXPR, ptr_type_node, string); +} + -+static void insert_cond_result(basic_block bb_true, gimple stmt, tree arg, bool min) ++static void insert_cond_result(basic_block bb_true, const_gimple stmt, const_tree arg, bool min) +{ -+ gimple func_stmt, def_stmt; -+ tree current_func, loc_file, loc_line, ssa_name; ++ gimple func_stmt; ++ const_gimple def_stmt; ++ const_tree loc_line; ++ tree loc_file, ssa_name, current_func; + expanded_location xloc; -+ char ssa_name_buf[100]; ++ char *ssa_name_buf; ++ int len; + gimple_stmt_iterator gsi = gsi_start_bb(bb_true); + + def_stmt = get_def_stmt(arg); @@ -86340,11 +101295,12 @@ index 0000000..24b6c8e + current_func = build_string(NAME_LEN(current_function_decl) + 1, NAME(current_function_decl)); + current_func = create_string_param(current_func); + -+ if (min) -+ snprintf(ssa_name_buf, 100, "%s_%u (min)\n", NAME(SSA_NAME_VAR(arg)), SSA_NAME_VERSION(arg)); -+ else -+ snprintf(ssa_name_buf, 100, "%s_%u (max)\n", NAME(SSA_NAME_VAR(arg)), SSA_NAME_VERSION(arg)); -+ ssa_name = build_string(100, ssa_name_buf); ++ gcc_assert(DECL_NAME(SSA_NAME_VAR(arg)) != NULL); ++ call_count++; ++ len = asprintf(&ssa_name_buf, "%s_%u %s, count: %u\n", NAME(SSA_NAME_VAR(arg)), SSA_NAME_VERSION(arg), min ? "min" : "max", call_count); ++ gcc_assert(len > 0); ++ ssa_name = build_string(len + 1, ssa_name_buf); ++ free(ssa_name_buf); + ssa_name = create_string_param(ssa_name); + + // void report_size_overflow(const char *file, unsigned int line, const char *func, const char *ssa_name) @@ -86353,7 +101309,7 @@ index 0000000..24b6c8e + gsi_insert_after(&gsi, func_stmt, GSI_CONTINUE_LINKING); +} + -+static void __unused print_the_code_insertions(gimple stmt) ++static void __unused print_the_code_insertions(const_gimple stmt) +{ + location_t loc = gimple_location(stmt); + @@ -86383,10 +101339,9 @@ index 0000000..24b6c8e + make_edge(cond_bb, join_bb, EDGE_FALSE_VALUE); + make_edge(bb_true, join_bb, EDGE_FALLTHRU); + -+ if (dom_info_available_p(CDI_DOMINATORS)) { -+ set_immediate_dominator(CDI_DOMINATORS, bb_true, cond_bb); -+ set_immediate_dominator(CDI_DOMINATORS, join_bb, cond_bb); -+ } ++ gcc_assert(dom_info_available_p(CDI_DOMINATORS)); ++ set_immediate_dominator(CDI_DOMINATORS, bb_true, cond_bb); ++ set_immediate_dominator(CDI_DOMINATORS, join_bb, cond_bb); + + if (current_loops != NULL) { + gcc_assert(cond_bb->loop_father == join_bb->loop_father); @@ -86399,154 +101354,121 @@ index 0000000..24b6c8e +// print_the_code_insertions(stmt); +} + -+static void check_size_overflow(gimple stmt, tree size_overflow_type, tree cast_rhs, tree rhs, bool *potentionally_overflowed, bool before) ++static void check_size_overflow(gimple stmt, tree size_overflow_type, tree cast_rhs, tree rhs, bool before) +{ -+ tree cast_rhs_type, type_max_type, type_min_type, type_max, type_min, rhs_type = TREE_TYPE(rhs); ++ const_tree rhs_type = TREE_TYPE(rhs); ++ tree cast_rhs_type, type_max_type, type_min_type, type_max, type_min; ++ + gcc_assert(rhs_type != NULL_TREE); -+ gcc_assert(TREE_CODE(rhs_type) == INTEGER_TYPE || TREE_CODE(rhs_type) == BOOLEAN_TYPE || TREE_CODE(rhs_type) == ENUMERAL_TYPE); ++ if (TREE_CODE(rhs_type) == POINTER_TYPE) ++ return; ++ ++ gcc_assert(TREE_CODE(rhs_type) == INTEGER_TYPE || TREE_CODE(rhs_type) == ENUMERAL_TYPE); + -+ if (!*potentionally_overflowed) ++ if (is_const_plus_unsigned_signed_truncation(rhs)) + return; + + type_max = cast_a_tree(size_overflow_type, TYPE_MAX_VALUE(rhs_type)); -+ type_min = cast_a_tree(size_overflow_type, TYPE_MIN_VALUE(rhs_type)); ++ // typemax (-1) < typemin (0) ++ if (TREE_OVERFLOW(type_max)) ++ return; + -+ gcc_assert(!TREE_OVERFLOW(type_max)); ++ type_min = cast_a_tree(size_overflow_type, TYPE_MIN_VALUE(rhs_type)); + + cast_rhs_type = TREE_TYPE(cast_rhs); + type_max_type = TREE_TYPE(type_max); + type_min_type = TREE_TYPE(type_min); -+ gcc_assert(useless_type_conversion_p(cast_rhs_type, type_max_type)); -+ gcc_assert(useless_type_conversion_p(type_max_type, type_min_type)); ++ gcc_assert(types_compatible_p(cast_rhs_type, type_max_type)); ++ gcc_assert(types_compatible_p(type_max_type, type_min_type)); + + insert_check_size_overflow(stmt, GT_EXPR, cast_rhs, type_max, before, false); + insert_check_size_overflow(stmt, LT_EXPR, cast_rhs, type_min, before, true); +} + -+static tree get_handle_const_assign_size_overflow_type(gimple def_stmt, tree var_rhs) ++static bool is_a_constant_overflow(const_gimple stmt, const_tree rhs) +{ -+ gimple var_rhs_def_stmt; -+ tree lhs = gimple_get_lhs(def_stmt); -+ tree lhs_type = TREE_TYPE(lhs); -+ tree rhs1_type = TREE_TYPE(gimple_assign_rhs1(def_stmt)); -+ tree rhs2_type = TREE_TYPE(gimple_assign_rhs2(def_stmt)); -+ -+ if (var_rhs == NULL_TREE) -+ return get_size_overflow_type(def_stmt, lhs); ++ if (gimple_assign_rhs_code(stmt) == MIN_EXPR) ++ return false; ++ if (!is_gimple_constant(rhs)) ++ return false; ++ return true; ++} + -+ var_rhs_def_stmt = get_def_stmt(var_rhs); ++static tree get_def_stmt_rhs(const_tree var) ++{ ++ tree rhs1, def_stmt_rhs1; ++ gimple rhs1_def_stmt, def_stmt_rhs1_def_stmt, def_stmt; + -+ if (TREE_CODE_CLASS(gimple_assign_rhs_code(def_stmt)) == tcc_comparison) -+ return get_size_overflow_type(var_rhs_def_stmt, var_rhs); ++ def_stmt = get_def_stmt(var); ++ gcc_assert(gimple_code(def_stmt) != GIMPLE_NOP && gimple_plf(def_stmt, MY_STMT) && gimple_assign_cast_p(def_stmt)); + -+ if (gimple_assign_rhs_code(def_stmt) == LSHIFT_EXPR) -+ return get_size_overflow_type(var_rhs_def_stmt, var_rhs); ++ rhs1 = gimple_assign_rhs1(def_stmt); ++ rhs1_def_stmt = get_def_stmt(rhs1); ++ if (!gimple_assign_cast_p(rhs1_def_stmt)) ++ return rhs1; + -+ if (gimple_assign_rhs_code(def_stmt) == RSHIFT_EXPR) -+ return get_size_overflow_type(var_rhs_def_stmt, var_rhs); ++ def_stmt_rhs1 = gimple_assign_rhs1(rhs1_def_stmt); ++ def_stmt_rhs1_def_stmt = get_def_stmt(def_stmt_rhs1); + -+ if (!useless_type_conversion_p(lhs_type, rhs1_type) || !useless_type_conversion_p(rhs1_type, rhs2_type)) { -+ debug_gimple_stmt(def_stmt); ++ switch (gimple_code(def_stmt_rhs1_def_stmt)) { ++ case GIMPLE_CALL: ++ case GIMPLE_NOP: ++ case GIMPLE_ASM: ++ case GIMPLE_PHI: ++ return def_stmt_rhs1; ++ case GIMPLE_ASSIGN: ++ return rhs1; ++ default: ++ debug_gimple_stmt(def_stmt_rhs1_def_stmt); + gcc_unreachable(); + } -+ -+ return get_size_overflow_type(def_stmt, lhs); +} + -+static tree handle_const_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple def_stmt, tree var_rhs, tree new_rhs1, tree new_rhs2) ++static tree handle_intentional_overflow(struct pointer_set_t *visited, bool check_overflow, gimple stmt, tree change_rhs, tree new_rhs2) +{ -+ tree new_rhs, size_overflow_type, orig_rhs; ++ tree new_rhs, orig_rhs; + void (*gimple_assign_set_rhs)(gimple, tree); -+ tree rhs1 = gimple_assign_rhs1(def_stmt); -+ tree rhs2 = gimple_assign_rhs2(def_stmt); -+ tree lhs = gimple_get_lhs(def_stmt); ++ tree rhs1 = gimple_assign_rhs1(stmt); ++ tree rhs2 = gimple_assign_rhs2(stmt); ++ tree lhs = gimple_get_lhs(stmt); + -+ if (var_rhs == NULL_TREE) -+ return create_assign(visited, potentionally_overflowed, def_stmt, lhs, AFTER_STMT); ++ if (!check_overflow) ++ return create_assign(visited, stmt, lhs, AFTER_STMT); ++ ++ if (change_rhs == NULL_TREE) ++ return create_assign(visited, stmt, lhs, AFTER_STMT); + + if (new_rhs2 == NULL_TREE) { -+ size_overflow_type = get_handle_const_assign_size_overflow_type(def_stmt, new_rhs1); -+ new_rhs2 = cast_a_tree(size_overflow_type, rhs2); + orig_rhs = rhs1; + gimple_assign_set_rhs = &gimple_assign_set_rhs1; + } else { -+ size_overflow_type = get_handle_const_assign_size_overflow_type(def_stmt, new_rhs2); -+ new_rhs1 = cast_a_tree(size_overflow_type, rhs1); + orig_rhs = rhs2; + gimple_assign_set_rhs = &gimple_assign_set_rhs2; + } + -+ var_rhs = cast_to_new_size_overflow_type(def_stmt, var_rhs, size_overflow_type, BEFORE_STMT); -+ -+ if (gimple_assign_rhs_code(def_stmt) == MIN_EXPR) -+ return dup_assign(visited, potentionally_overflowed, def_stmt, size_overflow_type, new_rhs1, new_rhs2, NULL_TREE); -+ -+ check_size_overflow(def_stmt, size_overflow_type, var_rhs, orig_rhs, potentionally_overflowed, BEFORE_STMT); -+ -+ new_rhs = change_assign_rhs(def_stmt, orig_rhs, var_rhs); -+ gimple_assign_set_rhs(def_stmt, new_rhs); -+ update_stmt(def_stmt); -+ -+ return create_assign(visited, potentionally_overflowed, def_stmt, lhs, AFTER_STMT); -+} -+ -+static tree get_cast_def_stmt_rhs(tree new_rhs) -+{ -+ gimple def_stmt; -+ -+ def_stmt = get_def_stmt(new_rhs); -+ // get_size_overflow_type -+ if (LONG_TYPE_SIZE != GET_MODE_BITSIZE(SImode)) -+ gcc_assert(gimple_assign_cast_p(def_stmt)); -+ return gimple_assign_rhs1(def_stmt); -+} -+ -+static tree cast_to_int_TI_type_and_check(bool *potentionally_overflowed, gimple stmt, tree new_rhs) -+{ -+ gimple_stmt_iterator gsi; -+ gimple cast_stmt, def_stmt; -+ enum machine_mode mode = TYPE_MODE(TREE_TYPE(new_rhs)); -+ -+ if (mode != TImode && mode != DImode) { -+ def_stmt = get_def_stmt(new_rhs); -+ gcc_assert(gimple_assign_cast_p(def_stmt)); -+ new_rhs = gimple_assign_rhs1(def_stmt); -+ mode = TYPE_MODE(TREE_TYPE(new_rhs)); -+ } -+ -+ gcc_assert(mode == TImode || mode == DImode); -+ -+ if (mode == TYPE_MODE(intTI_type_node) && useless_type_conversion_p(TREE_TYPE(new_rhs), intTI_type_node)) -+ return new_rhs; -+ -+ gsi = gsi_for_stmt(stmt); -+ cast_stmt = build_cast_stmt(intTI_type_node, new_rhs, CREATE_NEW_VAR, &gsi, BEFORE_STMT); -+ new_rhs = gimple_get_lhs(cast_stmt); -+ -+ if (mode == DImode) -+ return new_rhs; ++ check_size_overflow(stmt, TREE_TYPE(change_rhs), change_rhs, orig_rhs, BEFORE_STMT); + -+ check_size_overflow(stmt, intTI_type_node, new_rhs, new_rhs, overflowed, BEFORE_STMT); ++ new_rhs = change_assign_rhs(stmt, orig_rhs, change_rhs); ++ gimple_assign_set_rhs(stmt, new_rhs); ++ update_stmt(stmt); + -+ return new_rhs; ++ return create_assign(visited, stmt, lhs, AFTER_STMT); +} + -+static bool is_an_integer_trunction(gimple stmt) ++static bool is_subtraction_special(const_gimple stmt) +{ + gimple rhs1_def_stmt, rhs2_def_stmt; -+ tree rhs1_def_stmt_rhs1, rhs2_def_stmt_rhs1; -+ enum machine_mode rhs1_def_stmt_rhs1_mode, rhs2_def_stmt_rhs1_mode; -+ tree rhs1 = gimple_assign_rhs1(stmt); -+ tree rhs2 = gimple_assign_rhs2(stmt); -+ enum machine_mode rhs1_mode = TYPE_MODE(TREE_TYPE(rhs1)); -+ enum machine_mode rhs2_mode = TYPE_MODE(TREE_TYPE(rhs2)); ++ const_tree rhs1_def_stmt_rhs1, rhs2_def_stmt_rhs1, rhs1_def_stmt_lhs, rhs2_def_stmt_lhs; ++ enum machine_mode rhs1_def_stmt_rhs1_mode, rhs2_def_stmt_rhs1_mode, rhs1_def_stmt_lhs_mode, rhs2_def_stmt_lhs_mode; ++ const_tree rhs1 = gimple_assign_rhs1(stmt); ++ const_tree rhs2 = gimple_assign_rhs2(stmt); + + if (is_gimple_constant(rhs1) || is_gimple_constant(rhs2)) + return false; + + gcc_assert(TREE_CODE(rhs1) == SSA_NAME && TREE_CODE(rhs2) == SSA_NAME); + -+ if (gimple_assign_rhs_code(stmt) != MINUS_EXPR || rhs1_mode != SImode || rhs2_mode != SImode) ++ if (gimple_assign_rhs_code(stmt) != MINUS_EXPR) + return false; + + rhs1_def_stmt = get_def_stmt(rhs1); @@ -86556,9 +101478,15 @@ index 0000000..24b6c8e + + rhs1_def_stmt_rhs1 = gimple_assign_rhs1(rhs1_def_stmt); + rhs2_def_stmt_rhs1 = gimple_assign_rhs1(rhs2_def_stmt); ++ rhs1_def_stmt_lhs = gimple_get_lhs(rhs1_def_stmt); ++ rhs2_def_stmt_lhs = gimple_get_lhs(rhs2_def_stmt); + rhs1_def_stmt_rhs1_mode = TYPE_MODE(TREE_TYPE(rhs1_def_stmt_rhs1)); + rhs2_def_stmt_rhs1_mode = TYPE_MODE(TREE_TYPE(rhs2_def_stmt_rhs1)); -+ if (rhs1_def_stmt_rhs1_mode != DImode || rhs2_def_stmt_rhs1_mode != DImode) ++ rhs1_def_stmt_lhs_mode = TYPE_MODE(TREE_TYPE(rhs1_def_stmt_lhs)); ++ rhs2_def_stmt_lhs_mode = TYPE_MODE(TREE_TYPE(rhs2_def_stmt_lhs)); ++ if (GET_MODE_BITSIZE(rhs1_def_stmt_rhs1_mode) <= GET_MODE_BITSIZE(rhs1_def_stmt_lhs_mode)) ++ return false; ++ if (GET_MODE_BITSIZE(rhs2_def_stmt_rhs1_mode) <= GET_MODE_BITSIZE(rhs2_def_stmt_lhs_mode)) + return false; + + gimple_set_plf(rhs1_def_stmt, NO_CAST_CHECK, true); @@ -86566,48 +101494,55 @@ index 0000000..24b6c8e + return true; +} + -+static tree handle_integer_truncation(struct pointer_set_t *visited, bool *potentionally_overflowed, tree lhs) ++static tree handle_integer_truncation(struct pointer_set_t *visited, const_tree lhs) +{ -+ tree new_rhs1, new_rhs2, size_overflow_type; ++ tree new_rhs1, new_rhs2; + tree new_rhs1_def_stmt_rhs1, new_rhs2_def_stmt_rhs1, new_lhs; -+ tree new_rhs1_def_stmt_rhs1_type, new_rhs2_def_stmt_rhs1_type; + gimple assign, stmt = get_def_stmt(lhs); + tree rhs1 = gimple_assign_rhs1(stmt); + tree rhs2 = gimple_assign_rhs2(stmt); + -+ if (!is_an_integer_trunction(stmt)) -+ return NULL_TREE; -+ -+ new_rhs1 = expand(visited, overflowed, rhs1); -+ new_rhs2 = expand(visited, overflowed, rhs2); -+ -+ if (*overflowed == OVERFLOW_INTENTIONAL) ++ if (!is_subtraction_special(stmt)) + return NULL_TREE; + -+ new_rhs1_def_stmt_rhs1 = get_cast_def_stmt_rhs(new_rhs1); -+ new_rhs2_def_stmt_rhs1 = get_cast_def_stmt_rhs(new_rhs2); ++ new_rhs1 = expand(visited, rhs1); ++ new_rhs2 = expand(visited, rhs2); + -+ new_rhs1_def_stmt_rhs1_type = TREE_TYPE(new_rhs1_def_stmt_rhs1); -+ new_rhs2_def_stmt_rhs1_type = TREE_TYPE(new_rhs2_def_stmt_rhs1); ++ new_rhs1_def_stmt_rhs1 = get_def_stmt_rhs(new_rhs1); ++ new_rhs2_def_stmt_rhs1 = get_def_stmt_rhs(new_rhs2); + -+ if (!useless_type_conversion_p(new_rhs1_def_stmt_rhs1_type, new_rhs2_def_stmt_rhs1_type)) { -+ new_rhs1_def_stmt_rhs1 = cast_to_int_TI_type_and_check(potentionally_overflowed, stmt, new_rhs1_def_stmt_rhs1); -+ new_rhs2_def_stmt_rhs1 = cast_to_int_TI_type_and_check(potentionally_overflowed, stmt, new_rhs2_def_stmt_rhs1); ++ if (!types_compatible_p(TREE_TYPE(new_rhs1_def_stmt_rhs1), TREE_TYPE(new_rhs2_def_stmt_rhs1))) { ++ new_rhs1_def_stmt_rhs1 = cast_to_TI_type(stmt, new_rhs1_def_stmt_rhs1); ++ new_rhs2_def_stmt_rhs1 = cast_to_TI_type(stmt, new_rhs2_def_stmt_rhs1); + } + + assign = create_binary_assign(MINUS_EXPR, stmt, new_rhs1_def_stmt_rhs1, new_rhs2_def_stmt_rhs1); + new_lhs = gimple_get_lhs(assign); -+ check_size_overflow(assign, TREE_TYPE(new_lhs), new_lhs, rhs1, potentionally_overflowed, AFTER_STMT); ++ check_size_overflow(assign, TREE_TYPE(new_lhs), new_lhs, rhs1, AFTER_STMT); ++ ++ return dup_assign(visited, stmt, lhs, new_rhs1, new_rhs2, NULL_TREE); ++} ++ ++static bool is_a_neg_overflow(const_gimple stmt, const_tree rhs) ++{ ++ const_gimple def_stmt; ++ ++ if (TREE_CODE(rhs) != SSA_NAME) ++ return false; ++ ++ if (gimple_assign_rhs_code(stmt) != PLUS_EXPR) ++ return false; + -+ size_overflow_type = get_size_overflow_type(stmt, lhs); -+ new_rhs1 = cast_to_new_size_overflow_type(stmt, new_rhs1, size_overflow_type, BEFORE_STMT); -+ new_rhs2 = cast_to_new_size_overflow_type(stmt, new_rhs2, size_overflow_type, BEFORE_STMT); -+ return dup_assign(visited, potentionally_overflowed, stmt, size_overflow_type, new_rhs1, new_rhs2, NULL_TREE); ++ def_stmt = get_def_stmt(rhs); ++ if (gimple_code(def_stmt) != GIMPLE_ASSIGN || gimple_assign_rhs_code(def_stmt) != BIT_NOT_EXPR) ++ return false; ++ ++ return true; +} + -+static tree handle_binary_ops(struct pointer_set_t *visited, bool *potentionally_overflowed, tree lhs) ++static tree handle_binary_ops(struct pointer_set_t *visited, tree lhs) +{ -+ tree rhs1, rhs2, size_overflow_type, new_lhs; ++ tree rhs1, rhs2, new_lhs; + gimple def_stmt = get_def_stmt(lhs); + tree new_rhs1 = NULL_TREE; + tree new_rhs2 = NULL_TREE; @@ -86629,73 +101564,66 @@ index 0000000..24b6c8e + case EXACT_DIV_EXPR: + case POINTER_PLUS_EXPR: + case BIT_AND_EXPR: -+ return create_assign(visited, potentionally_overflowed, def_stmt, lhs, AFTER_STMT); ++ return create_assign(visited, def_stmt, lhs, AFTER_STMT); + default: + break; + } + -+ *potentionally_overflowed = true; -+ -+ new_lhs = handle_integer_truncation(visited, potentionally_overflowed, lhs); ++ new_lhs = handle_integer_truncation(visited, lhs); + if (new_lhs != NULL_TREE) + return new_lhs; + + if (TREE_CODE(rhs1) == SSA_NAME) -+ new_rhs1 = expand(visited, potentionally_overflowed, rhs1); ++ new_rhs1 = expand(visited, rhs1); + if (TREE_CODE(rhs2) == SSA_NAME) -+ new_rhs2 = expand(visited, potentionally_overflowed, rhs2); ++ new_rhs2 = expand(visited, rhs2); + -+ if (is_gimple_constant(rhs2)) -+ return handle_const_assign(visited, potentionally_overflowed, def_stmt, new_rhs1, new_rhs1, NULL_TREE); ++ if (is_a_neg_overflow(def_stmt, rhs2)) ++ return handle_intentional_overflow(visited, true, def_stmt, new_rhs1, NULL_TREE); ++ if (is_a_neg_overflow(def_stmt, rhs1)) ++ return handle_intentional_overflow(visited, true, def_stmt, new_rhs2, new_rhs2); + -+ if (is_gimple_constant(rhs1)) -+ return handle_const_assign(visited, potentionally_overflowed, def_stmt, new_rhs2, NULL_TREE, new_rhs2); -+ -+ size_overflow_type = get_size_overflow_type(def_stmt, lhs); + -+ new_rhs1 = cast_to_new_size_overflow_type(def_stmt, new_rhs1, size_overflow_type, BEFORE_STMT); -+ new_rhs2 = cast_to_new_size_overflow_type(def_stmt, new_rhs2, size_overflow_type, BEFORE_STMT); ++ if (is_a_constant_overflow(def_stmt, rhs2)) ++ return handle_intentional_overflow(visited, !is_a_cast_and_const_overflow(rhs1), def_stmt, new_rhs1, NULL_TREE); ++ if (is_a_constant_overflow(def_stmt, rhs1)) ++ return handle_intentional_overflow(visited, !is_a_cast_and_const_overflow(rhs2), def_stmt, new_rhs2, new_rhs2); + -+ return dup_assign(visited, potentionally_overflowed, def_stmt, size_overflow_type, new_rhs1, new_rhs2, NULL_TREE); ++ return dup_assign(visited, def_stmt, lhs, new_rhs1, new_rhs2, NULL_TREE); +} + +#if BUILDING_GCC_VERSION >= 4007 -+static tree get_new_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, tree size_overflow_type, tree rhs) ++static tree get_new_rhs(struct pointer_set_t *visited, tree size_overflow_type, tree rhs) +{ + if (is_gimple_constant(rhs)) + return cast_a_tree(size_overflow_type, rhs); + if (TREE_CODE(rhs) != SSA_NAME) + return NULL_TREE; -+ return expand(visited, potentionally_overflowed, rhs); ++ return expand(visited, rhs); +} + -+static tree handle_ternary_ops(struct pointer_set_t *visited, bool *potentionally_overflowed, tree var) ++static tree handle_ternary_ops(struct pointer_set_t *visited, tree lhs) +{ + tree rhs1, rhs2, rhs3, new_rhs1, new_rhs2, new_rhs3, size_overflow_type; -+ gimple def_stmt = get_def_stmt(var); -+ -+ *potentionally_overflowed = true; ++ gimple def_stmt = get_def_stmt(lhs); + -+ size_overflow_type = get_size_overflow_type(def_stmt, var); ++ size_overflow_type = get_size_overflow_type(def_stmt, lhs); + + rhs1 = gimple_assign_rhs1(def_stmt); + rhs2 = gimple_assign_rhs2(def_stmt); + rhs3 = gimple_assign_rhs3(def_stmt); -+ new_rhs1 = get_new_rhs(visited, potentionally_overflowed, size_overflow_type, rhs1); -+ new_rhs2 = get_new_rhs(visited, potentionally_overflowed, size_overflow_type, rhs2); -+ new_rhs3 = get_new_rhs(visited, potentionally_overflowed, size_overflow_type, rhs3); -+ -+ new_rhs1 = cast_to_new_size_overflow_type(def_stmt, new_rhs1, size_overflow_type, BEFORE_STMT); -+ new_rhs2 = cast_to_new_size_overflow_type(def_stmt, new_rhs2, size_overflow_type, BEFORE_STMT); -+ new_rhs3 = cast_to_new_size_overflow_type(def_stmt, new_rhs3, size_overflow_type, BEFORE_STMT); ++ new_rhs1 = get_new_rhs(visited, size_overflow_type, rhs1); ++ new_rhs2 = get_new_rhs(visited, size_overflow_type, rhs2); ++ new_rhs3 = get_new_rhs(visited, size_overflow_type, rhs3); + -+ return dup_assign(visited, potentionally_overflowed, def_stmt, size_overflow_type, new_rhs1, new_rhs2, new_rhs3); ++ return dup_assign(visited, def_stmt, lhs, new_rhs1, new_rhs2, new_rhs3); +} +#endif + -+static tree get_size_overflow_type(gimple stmt, tree node) ++static tree get_size_overflow_type(gimple stmt, const_tree node) +{ -+ tree type; ++ const_tree type; ++ tree new_type; + + gcc_assert(node != NULL_TREE); + @@ -86706,192 +101634,505 @@ index 0000000..24b6c8e + + switch (TYPE_MODE(type)) { + case QImode: -+ return (TYPE_UNSIGNED(type)) ? unsigned_intHI_type_node : intHI_type_node; ++ new_type = intHI_type_node; ++ break; + case HImode: -+ return (TYPE_UNSIGNED(type)) ? unsigned_intSI_type_node : intSI_type_node; ++ new_type = intSI_type_node; ++ break; + case SImode: -+ return (TYPE_UNSIGNED(type)) ? unsigned_intDI_type_node : intDI_type_node; ++ new_type = intDI_type_node; ++ break; + case DImode: + if (LONG_TYPE_SIZE == GET_MODE_BITSIZE(SImode)) -+ return (TYPE_UNSIGNED(type)) ? unsigned_intDI_type_node : intDI_type_node; -+ return (TYPE_UNSIGNED(type)) ? unsigned_intTI_type_node : intTI_type_node; ++ new_type = intDI_type_node; ++ else ++ new_type = intTI_type_node; ++ break; + default: + debug_tree((tree)node); -+ error("get_size_overflow_type: unsupported gcc configuration."); ++ error("%s: unsupported gcc configuration.", __func__); + gcc_unreachable(); + } ++ ++ if (TYPE_QUALS(type) != 0) ++ return build_qualified_type(new_type, TYPE_QUALS(type)); ++ return new_type; +} + +static tree expand_visited(gimple def_stmt) +{ -+ gimple next_stmt; -+ gimple_stmt_iterator gsi = gsi_for_stmt(def_stmt); ++ const_gimple next_stmt; ++ gimple_stmt_iterator gsi; ++ enum gimple_code code = gimple_code(def_stmt); + ++ if (code == GIMPLE_ASM) ++ return NULL_TREE; ++ ++ gsi = gsi_for_stmt(def_stmt); + gsi_next(&gsi); ++ ++ if (gimple_code(def_stmt) == GIMPLE_PHI && gsi_end_p(gsi)) ++ return NULL_TREE; ++ gcc_assert(!gsi_end_p(gsi)); + next_stmt = gsi_stmt(gsi); + -+ switch (gimple_code(next_stmt)) { -+ case GIMPLE_ASSIGN: -+ return gimple_get_lhs(next_stmt); -+ case GIMPLE_PHI: -+ return gimple_phi_result(next_stmt); -+ case GIMPLE_CALL: -+ return gimple_call_lhs(next_stmt); -+ default: ++ if (gimple_code(def_stmt) == GIMPLE_PHI && !gimple_plf((gimple)next_stmt, MY_STMT)) + return NULL_TREE; -+ } ++ gcc_assert(gimple_plf((gimple)next_stmt, MY_STMT)); ++ ++ return get_lhs(next_stmt); +} + -+static tree expand(struct pointer_set_t *visited, bool *potentionally_overflowed, tree var) ++static tree expand(struct pointer_set_t *visited, tree lhs) +{ + gimple def_stmt; -+ enum tree_code code = TREE_CODE(TREE_TYPE(var)); -+ -+ if (is_gimple_constant(var)) -+ return NULL_TREE; + -+ if (TREE_CODE(var) == ADDR_EXPR) ++ if (skip_types(lhs)) + return NULL_TREE; + -+ gcc_assert(code == INTEGER_TYPE || code == POINTER_TYPE || code == BOOLEAN_TYPE || code == ENUMERAL_TYPE); -+ -+ if (TREE_CODE(SSA_NAME_VAR(var)) == PARM_DECL) -+ check_missing_attribute(var); -+ -+ def_stmt = get_def_stmt(var); ++ def_stmt = get_def_stmt(lhs); + -+ if (!def_stmt) ++ if (!def_stmt || gimple_code(def_stmt) == GIMPLE_NOP) + return NULL_TREE; + + if (gimple_plf(def_stmt, MY_STMT)) -+ return var; ++ return lhs; + + if (pointer_set_contains(visited, def_stmt)) + return expand_visited(def_stmt); + + switch (gimple_code(def_stmt)) { -+ case GIMPLE_NOP: -+ check_missing_attribute(var); -+ return NULL_TREE; + case GIMPLE_PHI: -+ return build_new_phi(visited, potentionally_overflowed, var); ++ return handle_phi(visited, lhs); + case GIMPLE_CALL: + case GIMPLE_ASM: -+ return create_assign(visited, potentionally_overflowed, def_stmt, var, AFTER_STMT); ++ return create_assign(visited, def_stmt, lhs, AFTER_STMT); + case GIMPLE_ASSIGN: + switch (gimple_num_ops(def_stmt)) { + case 2: -+ return handle_unary_ops(visited, potentionally_overflowed, var); ++ return handle_unary_ops(visited, def_stmt); + case 3: -+ return handle_binary_ops(visited, potentionally_overflowed, var); ++ return handle_binary_ops(visited, lhs); +#if BUILDING_GCC_VERSION >= 4007 + case 4: -+ return handle_ternary_ops(visited, potentionally_overflowed, var); ++ return handle_ternary_ops(visited, lhs); +#endif + } + default: + debug_gimple_stmt(def_stmt); -+ error("expand: unknown gimple code"); ++ error("%s: unknown gimple code", __func__); + gcc_unreachable(); + } +} + -+static void change_function_arg(gimple stmt, tree origarg, unsigned int argnum, tree newarg) ++static tree get_new_tree(gimple stmt, const_tree orig_node, tree new_node) +{ -+ gimple assign; ++ const_gimple assign; ++ tree orig_type = TREE_TYPE(orig_node); + gimple_stmt_iterator gsi = gsi_for_stmt(stmt); -+ tree origtype = TREE_TYPE(origarg); + -+ gcc_assert(gimple_code(stmt) == GIMPLE_CALL); ++ assign = build_cast_stmt(orig_type, new_node, CREATE_NEW_VAR, &gsi, BEFORE_STMT, false); ++ return gimple_get_lhs(assign); ++} + -+ assign = build_cast_stmt(origtype, newarg, CREATE_NEW_VAR, &gsi, BEFORE_STMT); ++static void change_function_arg(gimple stmt, const_tree orig_arg, unsigned int argnum, tree new_arg) ++{ ++ gimple_call_set_arg(stmt, argnum, get_new_tree(stmt, orig_arg, new_arg)); ++ update_stmt(stmt); ++} + -+ gimple_call_set_arg(stmt, argnum, gimple_get_lhs(assign)); ++static void change_function_return(gimple stmt, const_tree orig_ret, tree new_ret) ++{ ++ gimple_return_set_retval(stmt, get_new_tree(stmt, orig_ret, new_ret)); + update_stmt(stmt); +} + -+static tree get_function_arg(unsigned int argnum, gimple stmt, tree fndecl) ++static bool get_function_arg(unsigned int* argnum, const_tree fndecl) +{ -+ const char *origid; -+ tree arg, origarg; ++ tree arg; ++ const_tree origarg; + -+ if (!DECL_ABSTRACT_ORIGIN(fndecl)) { -+ gcc_assert(gimple_call_num_args(stmt) > argnum); -+ return gimple_call_arg(stmt, argnum); -+ } ++ if (!DECL_ABSTRACT_ORIGIN(fndecl)) ++ return true; + + origarg = DECL_ARGUMENTS(DECL_ABSTRACT_ORIGIN(fndecl)); -+ while (origarg && argnum) { -+ argnum--; ++ while (origarg && *argnum) { ++ (*argnum)--; + origarg = TREE_CHAIN(origarg); + } + -+ gcc_assert(argnum == 0); ++ gcc_assert(*argnum == 0); + + gcc_assert(origarg != NULL_TREE); -+ origid = NAME(origarg); -+ for (arg = DECL_ARGUMENTS(fndecl); arg; arg = TREE_CHAIN(arg)) { -+ if (!strcmp(origid, NAME(arg))) -+ return arg; ++ *argnum = 0; ++ for (arg = DECL_ARGUMENTS(fndecl); arg; arg = TREE_CHAIN(arg), (*argnum)++) ++ if (operand_equal_p(origarg, arg, 0) || !strcmp(NAME(origarg), NAME(arg))) ++ return true; ++ return false; ++} ++ ++static enum mark walk_phi(struct pointer_set_t *visited, bool *search_err_code, const_tree result) ++{ ++ gimple phi = get_def_stmt(result); ++ unsigned int i, n = gimple_phi_num_args(phi); ++ ++ if (!phi) ++ return MARK_NO; ++ ++ pointer_set_insert(visited, phi); ++ for (i = 0; i < n; i++) { ++ enum mark marked; ++ const_tree arg = gimple_phi_arg_def(phi, i); ++ marked = pre_expand(visited, search_err_code, arg); ++ if (marked != MARK_NO) ++ return marked; + } -+ return NULL_TREE; ++ return MARK_NO; +} + -+static void handle_function_arg(gimple stmt, tree fndecl, unsigned int argnum) ++static enum mark walk_unary_ops(struct pointer_set_t *visited, bool *search_err_code, const_tree lhs) ++{ ++ gimple def_stmt = get_def_stmt(lhs); ++ const_tree rhs; ++ ++ if (!def_stmt) ++ return MARK_NO; ++ ++ rhs = gimple_assign_rhs1(def_stmt); ++ ++ def_stmt = get_def_stmt(rhs); ++ if (is_gimple_constant(rhs)) ++ search_err_code[FROM_CONST] = true; ++ ++ return pre_expand(visited, search_err_code, rhs); ++} ++ ++static enum mark walk_binary_ops(struct pointer_set_t *visited, bool *search_err_code, const_tree lhs) ++{ ++ gimple def_stmt = get_def_stmt(lhs); ++ const_tree rhs1, rhs2; ++ enum mark marked; ++ ++ if (!def_stmt) ++ return MARK_NO; ++ ++ search_err_code[CAST_ONLY] = false; ++ ++ rhs1 = gimple_assign_rhs1(def_stmt); ++ rhs2 = gimple_assign_rhs2(def_stmt); ++ marked = pre_expand(visited, search_err_code, rhs1); ++ if (marked != MARK_NO) ++ return marked; ++ return pre_expand(visited, search_err_code, rhs2); ++} ++ ++static const_tree search_field_decl(const_tree comp_ref) ++{ ++ const_tree field = NULL_TREE; ++ unsigned int i, len = TREE_OPERAND_LENGTH(comp_ref); ++ ++ for (i = 0; i < len; i++) { ++ field = TREE_OPERAND(comp_ref, i); ++ if (TREE_CODE(field) == FIELD_DECL) ++ break; ++ } ++ gcc_assert(TREE_CODE(field) == FIELD_DECL); ++ return field; ++} ++ ++static enum mark mark_status(const_tree fndecl, unsigned int argnum) ++{ ++ const_tree attr, p; ++ ++ // mm/filemap.c D.35286_51 = D.35283_46 (file_10(D), mapping_11, pos_1, D.35273_50, D.35285_49, page.14_48, fsdata.15_47); ++ if (fndecl == NULL_TREE) ++ return MARK_NO; ++ ++ attr = lookup_attribute("intentional_overflow", DECL_ATTRIBUTES(fndecl)); ++ if (!attr || !TREE_VALUE(attr)) ++ return MARK_NO; ++ ++ p = TREE_VALUE(attr); ++ if (TREE_INT_CST_HIGH(TREE_VALUE(p)) == -1) ++ return MARK_TURN_OFF; ++ if (!TREE_INT_CST_LOW(TREE_VALUE(p))) ++ return MARK_NOT_INTENTIONAL; ++ if (argnum == 0) { ++ gcc_assert(current_function_decl == fndecl); ++ return MARK_NO; ++ } ++ ++ do { ++ if (argnum == TREE_INT_CST_LOW(TREE_VALUE(p))) ++ return MARK_YES; ++ p = TREE_CHAIN(p); ++ } while (p); ++ ++ return MARK_NO; ++} ++ ++static void print_missing_msg(tree func, unsigned int argnum) ++{ ++ unsigned int new_hash; ++ size_t len; ++ unsigned char tree_codes[CODES_LIMIT]; ++ location_t loc; ++ const char *curfunc; ++ ++ func = get_original_function_decl(func); ++ loc = DECL_SOURCE_LOCATION(func); ++ curfunc = get_asm_name(func); ++ ++ len = get_function_decl(func, tree_codes); ++ new_hash = get_hash_num(curfunc, (const char *) tree_codes, len, 0); ++ inform(loc, "Function %s is missing from the size_overflow hash table +%s+%u+%u+", curfunc, curfunc, argnum, new_hash); ++} ++ ++static unsigned int search_missing_attribute(const_tree arg) ++{ ++ unsigned int argnum; ++ const struct size_overflow_hash *hash; ++ const_tree type = TREE_TYPE(arg); ++ tree func = get_original_function_decl(current_function_decl); ++ ++ gcc_assert(TREE_CODE(arg) != COMPONENT_REF); ++ ++ if (TREE_CODE(type) == POINTER_TYPE) ++ return 0; ++ ++ argnum = find_arg_number(arg, func); ++ if (argnum == 0) ++ return 0; ++ ++ if (lookup_attribute("size_overflow", DECL_ATTRIBUTES(func))) ++ return argnum; ++ ++ hash = get_function_hash(func); ++ if (!hash || !(hash->param & (1U << argnum))) { ++ print_missing_msg(func, argnum); ++ return 0; ++ } ++ return argnum; ++} ++ ++static enum mark is_already_marked(const_tree lhs) ++{ ++ unsigned int argnum; ++ const_tree fndecl; ++ ++ argnum = search_missing_attribute(lhs); ++ fndecl = get_original_function_decl(current_function_decl); ++ if (argnum && mark_status(fndecl, argnum) == MARK_YES) ++ return MARK_YES; ++ return MARK_NO; ++} ++ ++static enum mark pre_expand(struct pointer_set_t *visited, bool *search_err_code, const_tree lhs) ++{ ++ const_gimple def_stmt; ++ ++ if (skip_types(lhs)) ++ return MARK_NO; ++ ++ if (TREE_CODE(lhs) == PARM_DECL) ++ return is_already_marked(lhs); ++ ++ if (TREE_CODE(lhs) == COMPONENT_REF) { ++ const_tree field, attr; ++ ++ field = search_field_decl(lhs); ++ attr = lookup_attribute("intentional_overflow", DECL_ATTRIBUTES(field)); ++ if (!attr || !TREE_VALUE(attr)) ++ return MARK_NO; ++ return MARK_YES; ++ } ++ ++ def_stmt = get_def_stmt(lhs); ++ ++ if (!def_stmt) ++ return MARK_NO; ++ ++ if (pointer_set_contains(visited, def_stmt)) ++ return MARK_NO; ++ ++ switch (gimple_code(def_stmt)) { ++ case GIMPLE_NOP: ++ if (TREE_CODE(SSA_NAME_VAR(lhs)) == PARM_DECL) ++ return is_already_marked(lhs); ++ return MARK_NO; ++ case GIMPLE_PHI: ++ return walk_phi(visited, search_err_code, lhs); ++ case GIMPLE_CALL: ++ if (mark_status((gimple_call_fndecl(def_stmt)), 0) == MARK_TURN_OFF) ++ return MARK_TURN_OFF; ++ check_function_hash(def_stmt); ++ return MARK_NO; ++ case GIMPLE_ASM: ++ search_err_code[CAST_ONLY] = false; ++ return MARK_NO; ++ case GIMPLE_ASSIGN: ++ switch (gimple_num_ops(def_stmt)) { ++ case 2: ++ return walk_unary_ops(visited, search_err_code, lhs); ++ case 3: ++ return walk_binary_ops(visited, search_err_code, lhs); ++ } ++ default: ++ debug_gimple_stmt((gimple)def_stmt); ++ error("%s: unknown gimple code", __func__); ++ gcc_unreachable(); ++ } ++} ++ ++// e.g., 3.8.2, 64, arch/x86/ia32/ia32_signal.c copy_siginfo_from_user32(): compat_ptr() u32 max ++static bool skip_asm(const_tree arg) ++{ ++ gimple def_stmt = get_def_stmt(arg); ++ ++ if (!def_stmt || !gimple_assign_cast_p(def_stmt)) ++ return false; ++ ++ def_stmt = get_def_stmt(gimple_assign_rhs1(def_stmt)); ++ return def_stmt && gimple_code(def_stmt) == GIMPLE_ASM; ++} ++ ++/* ++0</MARK_YES: no dup, search attributes (so, int) ++0/MARK_NOT_INTENTIONAL: no dup, search attribute (int) ++-1/MARK_TURN_OFF: no dup, no search, current_function_decl -> no dup ++*/ ++ ++static bool search_attributes(tree fndecl, const_tree arg, unsigned int argnum, bool where) +{ + struct pointer_set_t *visited; -+ tree arg, newarg; -+ enum overflow_reason overflowed = OVERFLOW_NONE; ++ enum mark is_marked, is_found; + location_t loc; -+ enum marked is_marked; ++ bool search_err_code[2] = {true, false}; + -+ arg = get_function_arg(argnum, stmt, fndecl); -+ if (arg == NULL_TREE) ++ is_marked = mark_status(current_function_decl, 0); ++ if (is_marked == MARK_TURN_OFF) ++ return true; ++ ++ is_marked = mark_status(fndecl, argnum + 1); ++ if (is_marked == MARK_TURN_OFF || is_marked == MARK_NOT_INTENTIONAL) ++ return true; ++ ++ visited = pointer_set_create(); ++ is_found = pre_expand(visited, search_err_code, arg); ++ pointer_set_destroy(visited); ++ ++ if (where == FROM_RET && search_err_code[CAST_ONLY] && search_err_code[FROM_CONST]) ++ return true; ++ ++ if (where == FROM_ARG && skip_asm(arg)) ++ return true; ++ ++ if (is_found == MARK_TURN_OFF) ++ return true; ++ ++ if ((is_found == MARK_YES && is_marked == MARK_YES)) ++ return true; ++ ++ if (is_found == MARK_YES) { ++ loc = DECL_SOURCE_LOCATION(fndecl); ++ inform(loc, "The intentional_overflow attribute is missing from +%s+%u+", get_asm_name(fndecl), argnum + 1); ++ return true; ++ } ++ return false; ++} ++ ++static void handle_function_arg(gimple stmt, tree fndecl, unsigned int argnum) ++{ ++ struct pointer_set_t *visited; ++ tree arg, new_arg; ++ bool match; ++ ++ if (argnum == 0) + return; + -+ if (is_gimple_constant(arg)) ++ argnum--; ++ ++ match = get_function_arg(&argnum, fndecl); ++ if (!match) + return; -+ if (TREE_CODE(arg) != SSA_NAME) ++ gcc_assert(gimple_call_num_args(stmt) > argnum); ++ arg = gimple_call_arg(stmt, argnum); ++ if (arg == NULL_TREE) + return; + -+ check_arg_type(arg); ++ if (skip_types(arg)) ++ return; ++ ++ if (search_attributes(fndecl, arg, argnum, FROM_ARG)) ++ return; + + visited = pointer_set_create(); -+ potentionally_overflowed = false; -+ newarg = expand(visited, &potentionally_overflowed, arg); ++ new_arg = expand(visited, arg); + pointer_set_destroy(visited); + -+ if (newarg == NULL_TREE || !potentionally_overflowed) ++ if (new_arg == NULL_TREE) + return; + -+ change_function_arg(stmt, arg, argnum, newarg); -+ -+ check_size_overflow(stmt, TREE_TYPE(newarg), newarg, arg, &potentionally_overflowed, BEFORE_STMT); ++ change_function_arg(stmt, arg, argnum, new_arg); ++ check_size_overflow(stmt, TREE_TYPE(new_arg), new_arg, arg, BEFORE_STMT); +} + -+static void handle_function_by_attribute(gimple stmt, tree attr, tree fndecl) ++static void handle_function_by_attribute(gimple stmt, const_tree attr, tree fndecl) +{ + tree p = TREE_VALUE(attr); + do { -+ handle_function_arg(stmt, fndecl, TREE_INT_CST_LOW(TREE_VALUE(p))-1); ++ handle_function_arg(stmt, fndecl, TREE_INT_CST_LOW(TREE_VALUE(p))); + p = TREE_CHAIN(p); + } while (p); +} + +static void handle_function_by_hash(gimple stmt, tree fndecl) +{ -+ tree orig_fndecl; + unsigned int num; -+ struct size_overflow_hash *hash; ++ const struct size_overflow_hash *hash; + -+ orig_fndecl = get_original_function_decl(fndecl); -+ hash = get_function_hash(orig_fndecl); ++ hash = get_function_hash(fndecl); + if (!hash) + return; + -+ for (num = 1; num <= MAX_PARAM; num++) ++ for (num = 0; num <= MAX_PARAM; num++) + if (hash->param & (1U << num)) -+ handle_function_arg(stmt, fndecl, num - 1); ++ handle_function_arg(stmt, fndecl, num); ++} ++ ++static bool check_return_value(void) ++{ ++ const struct size_overflow_hash *hash; ++ ++ hash = get_function_hash(current_function_decl); ++ if (!hash || !(hash->param & 1U << 0)) ++ return false; ++ ++ return true; ++} ++ ++static void handle_return_value(gimple ret_stmt) ++{ ++ struct pointer_set_t *visited; ++ tree ret, new_ret; ++ ++ if (gimple_code(ret_stmt) != GIMPLE_RETURN) ++ return; ++ ++ ret = gimple_return_retval(ret_stmt); ++ ++ if (skip_types(ret)) ++ return; ++ ++ if (search_attributes(current_function_decl, ret, 0, FROM_RET)) ++ return; ++ ++ visited = pointer_set_create(); ++ new_ret = expand(visited, ret); ++ pointer_set_destroy(visited); ++ ++ change_function_return(ret_stmt, ret, new_ret); ++ check_size_overflow(ret_stmt, TREE_TYPE(new_ret), new_ret, ret, BEFORE_STMT); +} + +static void set_plf_false(void) @@ -86911,9 +102152,12 @@ index 0000000..24b6c8e +static unsigned int handle_function(void) +{ + basic_block next, bb = ENTRY_BLOCK_PTR->next_bb; ++ bool check_ret; + + set_plf_false(); + ++ check_ret = check_return_value(); ++ + do { + gimple_stmt_iterator gsi; + next = bb->next_bb; @@ -86922,6 +102166,9 @@ index 0000000..24b6c8e + tree fndecl, attr; + gimple stmt = gsi_stmt(gsi); + ++ if (check_ret) ++ handle_return_value(stmt); ++ + if (!(is_gimple_call(stmt))) + continue; + fndecl = gimple_call_fndecl(stmt); @@ -86946,17 +102193,20 @@ index 0000000..24b6c8e + .pass = { + .type = GIMPLE_PASS, + .name = "size_overflow", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = NULL, + .execute = handle_function, + .sub = NULL, + .next = NULL, + .static_pass_number = 0, + .tv_id = TV_NONE, -+ .properties_required = PROP_cfg | PROP_referenced_vars, ++ .properties_required = PROP_cfg, + .properties_provided = 0, + .properties_destroyed = 0, + .todo_flags_start = 0, -+ .todo_flags_finish = TODO_verify_ssa | TODO_verify_stmts | TODO_dump_func | TODO_remove_unused_locals | TODO_update_ssa_no_phi | TODO_cleanup_cfg | TODO_ggc_collect | TODO_verify_flow ++ .todo_flags_finish = TODO_dump_func | TODO_verify_ssa | TODO_verify_stmts | TODO_remove_unused_locals | TODO_update_ssa_no_phi | TODO_cleanup_cfg | TODO_ggc_collect | TODO_verify_flow + } +}; + @@ -87021,12 +102271,12 @@ index 0000000..24b6c8e +} diff --git a/tools/gcc/stackleak_plugin.c b/tools/gcc/stackleak_plugin.c new file mode 100644 -index 0000000..38d2014 +index 0000000..ac2901e --- /dev/null +++ b/tools/gcc/stackleak_plugin.c -@@ -0,0 +1,313 @@ +@@ -0,0 +1,327 @@ +/* -+ * Copyright 2011 by the PaX Team <pageexec@freemail.hu> ++ * Copyright 2011-2013 by the PaX Team <pageexec@freemail.hu> + * Licensed under the GPL v2 + * + * Note: the choice of the license means that the compilation process is @@ -87064,6 +102314,10 @@ index 0000000..38d2014 +#include "rtl.h" +#include "emit-rtl.h" + ++#if BUILDING_GCC_VERSION >= 4008 ++#define TODO_dump_func 0 ++#endif ++ +extern void print_gimple_stmt(FILE *, gimple, int, int); + +int plugin_is_GPL_compatible; @@ -87074,7 +102328,7 @@ index 0000000..38d2014 +static bool init_locals; + +static struct plugin_info stackleak_plugin_info = { -+ .version = "201203140940", ++ .version = "201302112000", + .help = "track-lowest-sp=nn\ttrack sp in functions whose frame size is at least nn bytes\n" +// "initialize-locals\t\tforcibly initialize all stack frames\n" +}; @@ -87087,6 +102341,9 @@ index 0000000..38d2014 + .pass = { + .type = GIMPLE_PASS, + .name = "stackleak_tree_instrument", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = gate_stackleak_track_stack, + .execute = execute_stackleak_tree_instrument, + .sub = NULL, @@ -87105,6 +102362,9 @@ index 0000000..38d2014 + .pass = { + .type = RTL_PASS, + .name = "stackleak_final", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif + .gate = gate_stackleak_track_stack, + .execute = execute_stackleak_final, + .sub = NULL, @@ -87241,7 +102501,7 @@ index 0000000..38d2014 + +static unsigned int execute_stackleak_final(void) +{ -+ rtx insn; ++ rtx insn, next; + + if (cfun->calls_alloca) + return 0; @@ -87251,10 +102511,11 @@ index 0000000..38d2014 + return 0; + + // 1. find pax_track_stack calls -+ for (insn = get_insns(); insn; insn = NEXT_INSN(insn)) { ++ for (insn = get_insns(); insn; insn = next) { + // rtl match: (call_insn 8 7 9 3 (call (mem (symbol_ref ("pax_track_stack") [flags 0x41] <function_decl 0xb7470e80 pax_track_stack>) [0 S1 A8]) (4)) -1 (nil) (nil)) + rtx body; + ++ next = NEXT_INSN(insn); + if (!CALL_P(insn)) + continue; + body = PATTERN(insn); @@ -87270,10 +102531,13 @@ index 0000000..38d2014 + continue; +// warning(0, "track_frame_size: %d %ld %d", cfun->calls_alloca, get_frame_size(), track_frame_size); + // 2. delete call -+ insn = delete_insn_and_edges(insn); ++ delete_insn_and_edges(insn); +#if BUILDING_GCC_VERSION >= 4007 -+ if (GET_CODE(insn) == NOTE && NOTE_KIND(insn) == NOTE_INSN_CALL_ARG_LOCATION) -+ insn = delete_insn_and_edges(insn); ++ if (GET_CODE(next) == NOTE && NOTE_KIND(next) == NOTE_INSN_CALL_ARG_LOCATION) { ++ insn = next; ++ next = NEXT_INSN(insn); ++ delete_insn_and_edges(insn); ++ } +#endif + } + @@ -87338,8 +102602,291 @@ index 0000000..38d2014 + + return 0; +} +diff --git a/tools/gcc/structleak_plugin.c b/tools/gcc/structleak_plugin.c +new file mode 100644 +index 0000000..4fae911 +--- /dev/null ++++ b/tools/gcc/structleak_plugin.c +@@ -0,0 +1,277 @@ ++/* ++ * Copyright 2013 by PaX Team <pageexec@freemail.hu> ++ * Licensed under the GPL v2 ++ * ++ * Note: the choice of the license means that the compilation process is ++ * NOT 'eligible' as defined by gcc's library exception to the GPL v3, ++ * but for the kernel it doesn't matter since it doesn't link against ++ * any of the gcc libraries ++ * ++ * gcc plugin to forcibly initialize certain local variables that could ++ * otherwise leak kernel stack to userland if they aren't properly initialized ++ * by later code ++ * ++ * Homepage: http://pax.grsecurity.net/ ++ * ++ * Usage: ++ * $ # for 4.5/4.6/C based 4.7 ++ * $ gcc -I`gcc -print-file-name=plugin`/include -I`gcc -print-file-name=plugin`/include/c-family -fPIC -shared -O2 -o structleak_plugin.so structleak_plugin.c ++ * $ # for C++ based 4.7/4.8+ ++ * $ g++ -I`g++ -print-file-name=plugin`/include -I`g++ -print-file-name=plugin`/include/c-family -fPIC -shared -O2 -o structleak_plugin.so structleak_plugin.c ++ * $ gcc -fplugin=./structleak_plugin.so test.c -O2 ++ * ++ * TODO: eliminate redundant initializers ++ * increase type coverage ++ */ ++ ++#include "gcc-plugin.h" ++#include "config.h" ++#include "system.h" ++#include "coretypes.h" ++#include "tree.h" ++#include "tree-pass.h" ++#include "intl.h" ++#include "plugin-version.h" ++#include "tm.h" ++#include "toplev.h" ++#include "function.h" ++#include "tree-flow.h" ++#include "plugin.h" ++#include "gimple.h" ++#include "diagnostic.h" ++#include "cfgloop.h" ++#include "langhooks.h" ++ ++#if BUILDING_GCC_VERSION >= 4008 ++#define TODO_dump_func 0 ++#endif ++ ++#define NAME(node) IDENTIFIER_POINTER(DECL_NAME(node)) ++ ++// unused type flag in all versions 4.5-4.8 ++#define TYPE_USERSPACE(TYPE) TYPE_LANG_FLAG_3(TYPE) ++ ++int plugin_is_GPL_compatible; ++void debug_gimple_stmt(gimple gs); ++ ++static struct plugin_info structleak_plugin_info = { ++ .version = "201304082245", ++ .help = "disable\tdo not activate plugin\n", ++}; ++ ++static tree handle_user_attribute(tree *node, tree name, tree args, int flags, bool *no_add_attrs) ++{ ++ *no_add_attrs = true; ++ ++ // check for types? for now accept everything linux has to offer ++ if (TREE_CODE(*node) != FIELD_DECL) ++ return NULL_TREE; ++ ++ *no_add_attrs = false; ++ return NULL_TREE; ++} ++ ++static struct attribute_spec user_attr = { ++ .name = "user", ++ .min_length = 0, ++ .max_length = 0, ++ .decl_required = false, ++ .type_required = false, ++ .function_type_required = false, ++ .handler = handle_user_attribute, ++#if BUILDING_GCC_VERSION >= 4007 ++ .affects_type_identity = true ++#endif ++}; ++ ++static void register_attributes(void *event_data, void *data) ++{ ++ register_attribute(&user_attr); ++// register_attribute(&force_attr); ++} ++ ++static tree get_field_type(tree field) ++{ ++ return strip_array_types(TREE_TYPE(field)); ++} ++ ++static bool is_userspace_type(tree type) ++{ ++ tree field; ++ ++ for (field = TYPE_FIELDS(type); field; field = TREE_CHAIN(field)) { ++ tree fieldtype = get_field_type(field); ++ enum tree_code code = TREE_CODE(fieldtype); ++ ++ if (code == RECORD_TYPE || code == UNION_TYPE) ++ if (is_userspace_type(fieldtype)) ++ return true; ++ ++ if (lookup_attribute("user", DECL_ATTRIBUTES(field))) ++ return true; ++ } ++ return false; ++} ++ ++static void finish_type(void *event_data, void *data) ++{ ++ tree type = (tree)event_data; ++ ++ if (TYPE_USERSPACE(type)) ++ return; ++ ++ if (is_userspace_type(type)) ++ TYPE_USERSPACE(type) = 1; ++} ++ ++static void initialize(tree var) ++{ ++ basic_block bb; ++ gimple_stmt_iterator gsi; ++ tree initializer; ++ gimple init_stmt; ++ ++ // this is the original entry bb before the forced split ++ // TODO: check further BBs in case more splits occured before us ++ bb = ENTRY_BLOCK_PTR->next_bb->next_bb; ++ ++ // first check if the variable is already initialized, warn otherwise ++ for (gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) { ++ gimple stmt = gsi_stmt(gsi); ++ tree rhs1; ++ ++ // we're looking for an assignment of a single rhs... ++ if (!gimple_assign_single_p(stmt)) ++ continue; ++ rhs1 = gimple_assign_rhs1(stmt); ++#if BUILDING_GCC_VERSION >= 4007 ++ // ... of a non-clobbering expression... ++ if (TREE_CLOBBER_P(rhs1)) ++ continue; ++#endif ++ // ... to our variable... ++ if (gimple_get_lhs(stmt) != var) ++ continue; ++ // if it's an initializer then we're good ++ if (TREE_CODE(rhs1) == CONSTRUCTOR) ++ return; ++ } ++ ++ // these aren't the 0days you're looking for ++// inform(DECL_SOURCE_LOCATION(var), "userspace variable will be forcibly initialized"); ++ ++ // build the initializer expression ++ initializer = build_constructor(TREE_TYPE(var), NULL); ++ ++ // build the initializer stmt ++ init_stmt = gimple_build_assign(var, initializer); ++ gsi = gsi_start_bb(ENTRY_BLOCK_PTR->next_bb); ++ gsi_insert_before(&gsi, init_stmt, GSI_NEW_STMT); ++ update_stmt(init_stmt); ++} ++ ++static unsigned int handle_function(void) ++{ ++ basic_block bb; ++ unsigned int ret = 0; ++ tree var; ++ ++#if BUILDING_GCC_VERSION == 4005 ++ tree vars; ++#else ++ unsigned int i; ++#endif ++ ++ // split the first bb where we can put the forced initializers ++ bb = split_block_after_labels(ENTRY_BLOCK_PTR)->dest; ++ if (dom_info_available_p(CDI_DOMINATORS)) ++ set_immediate_dominator(CDI_DOMINATORS, bb, ENTRY_BLOCK_PTR); ++ ++ // enumarate all local variables and forcibly initialize our targets ++#if BUILDING_GCC_VERSION == 4005 ++ for (vars = cfun->local_decls; vars; vars = TREE_CHAIN(vars)) { ++ var = TREE_VALUE(vars); ++#else ++ FOR_EACH_LOCAL_DECL(cfun, i, var) { ++#endif ++ tree type = TREE_TYPE(var); ++ ++ gcc_assert(DECL_P(var)); ++ if (!auto_var_in_fn_p(var, current_function_decl)) ++ continue; ++ ++ // only care about structure types ++ if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) ++ continue; ++ ++ // if the type is of interest, examine the variable ++ if (TYPE_USERSPACE(type)) ++ initialize(var); ++ } ++ ++ return ret; ++} ++ ++static struct gimple_opt_pass structleak_pass = { ++ .pass = { ++ .type = GIMPLE_PASS, ++ .name = "structleak", ++#if BUILDING_GCC_VERSION >= 4008 ++ .optinfo_flags = OPTGROUP_NONE, ++#endif ++ .gate = NULL, ++ .execute = handle_function, ++ .sub = NULL, ++ .next = NULL, ++ .static_pass_number = 0, ++ .tv_id = TV_NONE, ++ .properties_required = PROP_cfg, ++ .properties_provided = 0, ++ .properties_destroyed = 0, ++ .todo_flags_start = 0, ++ .todo_flags_finish = TODO_verify_ssa | TODO_verify_stmts | TODO_dump_func | TODO_remove_unused_locals | TODO_update_ssa | TODO_ggc_collect | TODO_verify_flow ++ } ++}; ++ ++int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) ++{ ++ int i; ++ const char * const plugin_name = plugin_info->base_name; ++ const int argc = plugin_info->argc; ++ const struct plugin_argument * const argv = plugin_info->argv; ++ bool enable = true; ++ ++ struct register_pass_info structleak_pass_info = { ++ .pass = &structleak_pass.pass, ++ .reference_pass_name = "ssa", ++ .ref_pass_instance_number = 1, ++ .pos_op = PASS_POS_INSERT_AFTER ++ }; ++ ++ if (!plugin_default_version_check(version, &gcc_version)) { ++ error(G_("incompatible gcc/plugin versions")); ++ return 1; ++ } ++ ++ if (strcmp(lang_hooks.name, "GNU C")) { ++ inform(UNKNOWN_LOCATION, G_("%s supports C only"), plugin_name); ++ enable = false; ++ } ++ ++ for (i = 0; i < argc; ++i) { ++ if (!strcmp(argv[i].key, "disable")) { ++ enable = false; ++ continue; ++ } ++ error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); ++ } ++ ++ register_callback(plugin_name, PLUGIN_INFO, NULL, &structleak_plugin_info); ++ if (enable) { ++ register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &structleak_pass_info); ++ register_callback(plugin_name, PLUGIN_FINISH_TYPE, finish_type, NULL); ++ } ++ register_callback(plugin_name, PLUGIN_ATTRIBUTES, register_attributes, NULL); ++ ++ return 0; ++} diff --git a/tools/perf/util/include/asm/alternative-asm.h b/tools/perf/util/include/asm/alternative-asm.h -index 6789d78..4afd019 100644 +index 6789d78..4afd019e 100644 --- a/tools/perf/util/include/asm/alternative-asm.h +++ b/tools/perf/util/include/asm/alternative-asm.h @@ -5,4 +5,7 @@ @@ -87350,37 +102897,28 @@ index 6789d78..4afd019 100644 + .endm + #endif -diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c -index af0f22f..9a7d479 100644 ---- a/usr/gen_init_cpio.c -+++ b/usr/gen_init_cpio.c -@@ -303,7 +303,7 @@ static int cpio_mkfile(const char *name, const char *location, - int retval; - int rc = -1; - int namesize; -- int i; -+ unsigned int i; +diff --git a/tools/perf/util/include/linux/compiler.h b/tools/perf/util/include/linux/compiler.h +index 96b919d..c49bb74 100644 +--- a/tools/perf/util/include/linux/compiler.h ++++ b/tools/perf/util/include/linux/compiler.h +@@ -18,4 +18,12 @@ + #define __force + #endif - mode |= S_IFREG; - -@@ -392,9 +392,10 @@ static char *cpio_replace_env(char *new_location) - *env_var = *expanded = '\0'; - strncat(env_var, start + 2, end - start - 2); - strncat(expanded, new_location, start - new_location); -- strncat(expanded, getenv(env_var), PATH_MAX); -- strncat(expanded, end + 1, PATH_MAX); -+ strncat(expanded, getenv(env_var), PATH_MAX - strlen(expanded)); -+ strncat(expanded, end + 1, PATH_MAX - strlen(expanded)); - strncpy(new_location, expanded, PATH_MAX); -+ new_location[PATH_MAX] = 0; - } else - break; - } ++#ifndef __size_overflow ++# define __size_overflow(...) ++#endif ++ ++#ifndef __intentional_overflow ++# define __intentional_overflow(...) ++#endif ++ + #endif diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c -index 9739b53..6d457e3 100644 +index f18013f..90421df 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c -@@ -75,7 +75,7 @@ LIST_HEAD(vm_list); +@@ -75,12 +75,17 @@ LIST_HEAD(vm_list); static cpumask_var_t cpus_hardware_enabled; static int kvm_usage_count = 0; @@ -87389,7 +102927,54 @@ index 9739b53..6d457e3 100644 struct kmem_cache *kvm_vcpu_cache; EXPORT_SYMBOL_GPL(kvm_vcpu_cache); -@@ -2247,7 +2247,7 @@ static void hardware_enable_nolock(void *junk) + +-static __read_mostly struct preempt_ops kvm_preempt_ops; ++static void kvm_sched_in(struct preempt_notifier *pn, int cpu); ++static void kvm_sched_out(struct preempt_notifier *pn, struct task_struct *next); ++static struct preempt_ops kvm_preempt_ops = { ++ .sched_in = kvm_sched_in, ++ .sched_out = kvm_sched_out, ++}; + + struct dentry *kvm_debugfs_dir; + +@@ -769,7 +774,7 @@ int __kvm_set_memory_region(struct kvm *kvm, + /* We can read the guest memory with __xxx_user() later on. */ + if (user_alloc && + ((mem->userspace_addr & (PAGE_SIZE - 1)) || +- !access_ok(VERIFY_WRITE, ++ !__access_ok(VERIFY_WRITE, + (void __user *)(unsigned long)mem->userspace_addr, + mem->memory_size))) + goto out; +@@ -1881,7 +1886,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp) + return 0; + } + +-static struct file_operations kvm_vcpu_fops = { ++static file_operations_no_const kvm_vcpu_fops __read_only = { + .release = kvm_vcpu_release, + .unlocked_ioctl = kvm_vcpu_ioctl, + #ifdef CONFIG_COMPAT +@@ -2402,7 +2407,7 @@ static int kvm_vm_mmap(struct file *file, struct vm_area_struct *vma) + return 0; + } + +-static struct file_operations kvm_vm_fops = { ++static file_operations_no_const kvm_vm_fops __read_only = { + .release = kvm_vm_release, + .unlocked_ioctl = kvm_vm_ioctl, + #ifdef CONFIG_COMPAT +@@ -2500,7 +2505,7 @@ out: + return r; + } + +-static struct file_operations kvm_chardev_ops = { ++static file_operations_no_const kvm_chardev_ops __read_only = { + .unlocked_ioctl = kvm_dev_ioctl, + .compat_ioctl = kvm_dev_ioctl, + .llseek = noop_llseek, +@@ -2526,7 +2531,7 @@ static void hardware_enable_nolock(void *junk) if (r) { cpumask_clear_cpu(cpu, cpus_hardware_enabled); @@ -87398,7 +102983,7 @@ index 9739b53..6d457e3 100644 printk(KERN_INFO "kvm: enabling virtualization on " "CPU%d failed\n", cpu); } -@@ -2301,10 +2301,10 @@ static int hardware_enable_all(void) +@@ -2580,10 +2585,10 @@ static int hardware_enable_all(void) kvm_usage_count++; if (kvm_usage_count == 1) { @@ -87411,7 +102996,7 @@ index 9739b53..6d457e3 100644 hardware_disable_all_nolock(); r = -EBUSY; } -@@ -2667,7 +2667,7 @@ static void kvm_sched_out(struct preempt_notifier *pn, +@@ -2941,7 +2946,7 @@ static void kvm_sched_out(struct preempt_notifier *pn, kvm_arch_vcpu_put(vcpu); } @@ -87420,7 +103005,7 @@ index 9739b53..6d457e3 100644 struct module *module) { int r; -@@ -2730,7 +2730,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, +@@ -2977,7 +2982,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, if (!vcpu_align) vcpu_align = __alignof__(struct kvm_vcpu); kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, vcpu_align, @@ -87429,18 +103014,25 @@ index 9739b53..6d457e3 100644 if (!kvm_vcpu_cache) { r = -ENOMEM; goto out_free_3; -@@ -2740,9 +2740,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, +@@ -2987,9 +2992,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, if (r) goto out_free; -- kvm_chardev_ops.owner = module; -- kvm_vm_fops.owner = module; -- kvm_vcpu_fops.owner = module; + pax_open_kernel(); -+ *(void **)&kvm_chardev_ops.owner = module; -+ *(void **)&kvm_vm_fops.owner = module; -+ *(void **)&kvm_vcpu_fops.owner = module; + kvm_chardev_ops.owner = module; + kvm_vm_fops.owner = module; + kvm_vcpu_fops.owner = module; + pax_close_kernel(); r = misc_register(&kvm_dev); if (r) { +@@ -2999,9 +3006,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, + + register_syscore_ops(&kvm_syscore_ops); + +- kvm_preempt_ops.sched_in = kvm_sched_in; +- kvm_preempt_ops.sched_out = kvm_sched_out; +- + r = kvm_init_debug(); + if (r) { + printk(KERN_ERR "kvm: create debugfs files failed\n"); diff --git a/testing/linux-virt-grsec/ipsec-xfrm-properly-handle-invalid-states-as-an-error.patch b/testing/linux-virt-grsec/ipsec-xfrm-properly-handle-invalid-states-as-an-error.patch new file mode 100644 index 0000000000..7cb0dade7c --- /dev/null +++ b/testing/linux-virt-grsec/ipsec-xfrm-properly-handle-invalid-states-as-an-error.patch @@ -0,0 +1,44 @@ +From patchwork Wed May 22 11:40:47 2013 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: [ipsec] xfrm: properly handle invalid states as an error +Date: Wed, 22 May 2013 01:40:47 -0000 +From: =?utf-8?q?Timo_Ter=C3=A4s?= <timo.teras@iki.fi> +X-Patchwork-Id: 245594 +Message-Id: <1369222847-8542-1-git-send-email-timo.teras@iki.fi> +To: netdev@vger.kernel.org +Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>, + Li RongQing <roy.qing.li@gmail.com>, + Steffen Klassert <steffen.klassert@secunet.com> + +The error exit path needs err explicitly set. Otherwise it +returns success and the only caller, xfrm_output_resume(), +would oops in skb_dst(skb)->ops derefence as skb_dst(skb) is +NULL. + +Bug introduced in commit bb65a9cb (xfrm: removes a superfluous +check and add a statistic). + +Signed-off-by: Timo Teräs <timo.teras@iki.fi> +Cc: Li RongQing <roy.qing.li@gmail.com> +Cc: Steffen Klassert <steffen.klassert@secunet.com> + +--- +Should go also to 3.9-stable. + + net/xfrm/xfrm_output.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c +index bcfda89..0cf003d 100644 +--- a/net/xfrm/xfrm_output.c ++++ b/net/xfrm/xfrm_output.c +@@ -64,6 +64,7 @@ static int xfrm_output_one(struct sk_buff *skb, int err) + + if (unlikely(x->km.state != XFRM_STATE_VALID)) { + XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEINVALID); ++ err = -EINVAL; + goto error; + } + diff --git a/testing/linux-virt-grsec/ipv4-remove-output-route-check-in-ipv4_mtu.patch b/testing/linux-virt-grsec/ipv4-remove-output-route-check-in-ipv4_mtu.patch new file mode 100644 index 0000000000..241f9b3527 --- /dev/null +++ b/testing/linux-virt-grsec/ipv4-remove-output-route-check-in-ipv4_mtu.patch @@ -0,0 +1,38 @@ +From 38d523e2948162776903349c89d65f7b9370dadb Mon Sep 17 00:00:00 2001 +From: Steffen Klassert <steffen.klassert@secunet.com> +Date: Wed, 16 Jan 2013 20:55:01 +0000 +Subject: [PATCH] ipv4: Remove output route check in ipv4_mtu +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf8 +Content-Transfer-Encoding: 8bit + +The output route check was introduced with git commit 261663b0 +(ipv4: Don't use the cached pmtu informations for input routes) +during times when we cached the pmtu informations on the +inetpeer. Now the pmtu informations are back in the routes, +so this check is obsolete. It also had some unwanted side effects, +as reported by Timo Teras and Lukas Tribus. + +Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> +Acked-by: Timo Teräs <timo.teras@iki.fi> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- + net/ipv4/route.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/net/ipv4/route.c b/net/ipv4/route.c +index 844a9ef..6e4a89c 100644 +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -1120,7 +1120,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst) + if (!mtu || time_after_eq(jiffies, rt->dst.expires)) + mtu = dst_metric_raw(dst, RTAX_MTU); + +- if (mtu && rt_is_output_route(rt)) ++ if (mtu) + return mtu; + + mtu = dst->dev->mtu; +-- +1.7.6.5 + diff --git a/testing/linux-virt-grsec/kernelconfig.x86 b/testing/linux-virt-grsec/kernelconfig.x86 index f1633f2625..dc6fae14b3 100644 --- a/testing/linux-virt-grsec/kernelconfig.x86 +++ b/testing/linux-virt-grsec/kernelconfig.x86 @@ -1,18 +1,13 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/i386 3.4.11 Kernel Configuration +# Linux/x86 3.9.3 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y -# CONFIG_X86_64 is not set CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_CLOCKSOURCE_WATCHDOG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y @@ -24,11 +19,8 @@ CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_GPIO=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y -# CONFIG_RWSEM_GENERIC_SPINLOCK is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y CONFIG_GENERIC_CALIBRATE_DELAY=y -# CONFIG_GENERIC_TIME_VSYSCALL is not set CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_DEFAULT_IDLE=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y @@ -47,16 +39,15 @@ CONFIG_X86_32_SMP=y CONFIG_X86_HT=y CONFIG_X86_32_LAZY_GS=y CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx" -CONFIG_KTIME_SCALAR=y CONFIG_ARCH_CPU_PROBE_RELEASE=y +CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_HAVE_IRQ_WORK=y CONFIG_IRQ_WORK=y +CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # -CONFIG_EXPERIMENTAL=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" CONFIG_LOCALVERSION="" @@ -76,13 +67,7 @@ CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y # CONFIG_FHANDLE is not set -CONFIG_TASKSTATS=y -CONFIG_TASK_DELAY_ACCT=y -CONFIG_TASK_XACCT=y -CONFIG_TASK_IO_ACCOUNTING=y # CONFIG_AUDIT is not set CONFIG_HAVE_GENERIC_HARDIRQS=y @@ -93,22 +78,55 @@ CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_IRQ_DOMAIN=y +# CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_KTIME_SCALAR=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y +CONFIG_GENERIC_CMOS_UPDATE=y + +# +# Timers subsystem +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y + +# +# CPU/Task time and stats accounting +# +# CONFIG_TICK_CPU_ACCOUNTING is not set +CONFIG_IRQ_TIME_ACCOUNTING=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_PREEMPT_RCU is not set +CONFIG_RCU_STALL_COMMON=y CONFIG_RCU_FANOUT=32 +CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_RCU_FANOUT_EXACT is not set CONFIG_RCU_FAST_NO_HZ=y # CONFIG_TREE_RCU_TRACE is not set +# CONFIG_RCU_NOCB_CPU is not set CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y +CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y +CONFIG_ARCH_WANTS_PROT_NUMA_PROT_NONE=y CONFIG_CGROUPS=y # CONFIG_CGROUP_DEBUG is not set CONFIG_CGROUP_FREEZER=y @@ -126,7 +144,6 @@ CONFIG_BLK_CGROUP=y CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y -CONFIG_USER_NS=y CONFIG_PID_NS=y CONFIG_NET_NS=y CONFIG_SCHED_AUTOGROUP=y @@ -143,8 +160,10 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_EXPERT=y +CONFIG_HAVE_UID16=y CONFIG_UID16=y CONFIG_SYSCTL_SYSCALL=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y CONFIG_HOTPLUG=y @@ -168,7 +187,6 @@ CONFIG_HAVE_PERF_EVENTS=y # Kernel Performance Events And Counters # CONFIG_PERF_EVENTS=y -CONFIG_PERF_COUNTERS=y # CONFIG_DEBUG_PERF_USE_VMALLOC is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_PCI_QUIRKS=y @@ -182,25 +200,40 @@ CONFIG_HAVE_OPROFILE=y CONFIG_OPROFILE_NMI_TIMER=y # CONFIG_KPROBES is not set # CONFIG_JUMP_LABEL is not set +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KRETPROBES=y CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_KPROBES_ON_FTRACE=y CONFIG_HAVE_ARCH_TRACEHOOK=y CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_DMA_API_DEBUG=y CONFIG_HAVE_HW_BREAKPOINT=y CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y CONFIG_HAVE_USER_RETURN_NOTIFIER=y CONFIG_HAVE_PERF_EVENTS_NMI=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_CMPXCHG_LOCAL=y CONFIG_HAVE_CMPXCHG_DOUBLE=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OLD_SIGACTION=y # # GCOV-based kernel profiling @@ -215,6 +248,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_MODVERSIONS=y # CONFIG_MODULE_SRCVERSION_ALL is not set +# CONFIG_MODULE_SIG is not set CONFIG_STOP_MACHINE=y CONFIG_BLOCK=y CONFIG_LBDAF=y @@ -255,33 +289,12 @@ CONFIG_DEFAULT_DEADLINE=y # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="deadline" CONFIG_PADATA=y -# CONFIG_INLINE_SPIN_TRYLOCK is not set -# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK is not set -# CONFIG_INLINE_SPIN_LOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK_IRQ is not set -# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set -# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_ASN1=m CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_READ_TRYLOCK is not set -# CONFIG_INLINE_READ_LOCK is not set -# CONFIG_INLINE_READ_LOCK_BH is not set -# CONFIG_INLINE_READ_LOCK_IRQ is not set -# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set CONFIG_INLINE_READ_UNLOCK=y -# CONFIG_INLINE_READ_UNLOCK_BH is not set CONFIG_INLINE_READ_UNLOCK_IRQ=y -# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_WRITE_TRYLOCK is not set -# CONFIG_INLINE_WRITE_LOCK is not set -# CONFIG_INLINE_WRITE_LOCK_BH is not set -# CONFIG_INLINE_WRITE_LOCK_IRQ is not set -# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set CONFIG_INLINE_WRITE_UNLOCK=y -# CONFIG_INLINE_WRITE_UNLOCK_BH is not set CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_FREEZER=y @@ -289,27 +302,17 @@ CONFIG_FREEZER=y # Processor type and features # CONFIG_ZONE_DMA=y -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_SMP=y # CONFIG_X86_MPPARSE is not set CONFIG_X86_BIGSMP=y # CONFIG_X86_EXTENDED_PLATFORM is not set +# CONFIG_X86_GOLDFISH is not set +# CONFIG_X86_INTEL_LPSS is not set # CONFIG_X86_32_IRIS is not set CONFIG_SCHED_OMIT_FRAME_POINTER=y CONFIG_PARAVIRT_GUEST=y CONFIG_PARAVIRT_TIME_ACCOUNTING=y -CONFIG_XEN=y -CONFIG_XEN_DOM0=y -CONFIG_XEN_PRIVILEGED_GUEST=y -CONFIG_XEN_PVHVM=y -CONFIG_XEN_MAX_DOMAIN_MEMORY=64 -CONFIG_XEN_SAVE_RESTORE=y -# CONFIG_XEN_DEBUG_FS is not set -CONFIG_KVM_CLOCK=y +# CONFIG_XEN_PRIVILEGED_GUEST is not set CONFIG_KVM_GUEST=y # CONFIG_LGUEST_GUEST is not set CONFIG_PARAVIRT=y @@ -318,7 +321,6 @@ CONFIG_PARAVIRT_CLOCK=y # CONFIG_PARAVIRT_DEBUG is not set CONFIG_NO_BOOTMEM=y # CONFIG_MEMTEST is not set -# CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set CONFIG_M586TSC=y @@ -345,20 +347,13 @@ CONFIG_M586TSC=y # CONFIG_MATOM is not set CONFIG_X86_GENERIC=y CONFIG_X86_INTERNODE_CACHE_SHIFT=6 -CONFIG_X86_CMPXCHG=y CONFIG_X86_L1_CACHE_SHIFT=6 -CONFIG_X86_XADD=y # CONFIG_X86_PPRO_FENCE is not set CONFIG_X86_F00F_BUG=y -CONFIG_X86_WP_WORKS_OK=y -CONFIG_X86_INVLPG=y -CONFIG_X86_BSWAP=y -CONFIG_X86_POPAD_OK=y CONFIG_X86_ALIGNMENT_16=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_TSC=y -CONFIG_X86_CMPXCHG64=y -CONFIG_X86_MINIMUM_CPU_FAMILY=5 +CONFIG_X86_MINIMUM_CPU_FAMILY=4 # CONFIG_PROCESSOR_SELECT is not set CONFIG_CPU_SUP_INTEL=y CONFIG_CPU_SUP_CYRIX_32=y @@ -369,12 +364,9 @@ CONFIG_CPU_SUP_UMC_32=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y CONFIG_DMI=y -CONFIG_SWIOTLB=y -CONFIG_IOMMU_HELPER=y CONFIG_NR_CPUS=32 CONFIG_SCHED_SMT=y CONFIG_SCHED_MC=y -CONFIG_IRQ_TIME_ACCOUNTING=y CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set @@ -390,20 +382,20 @@ CONFIG_MICROCODE=m CONFIG_MICROCODE_INTEL=y CONFIG_MICROCODE_AMD=y CONFIG_MICROCODE_OLD_INTERFACE=y -CONFIG_X86_MSR=m +CONFIG_MICROCODE_INTEL_LIB=y +CONFIG_MICROCODE_INTEL_EARLY=y +CONFIG_MICROCODE_EARLY=y CONFIG_X86_CPUID=m # CONFIG_NOHIGHMEM is not set -# CONFIG_HIGHMEM4G is not set -CONFIG_HIGHMEM64G=y +CONFIG_HIGHMEM4G=y +# CONFIG_HIGHMEM64G is not set CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_3G_OPT is not set # CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_2G_OPT is not set # CONFIG_VMSPLIT_1G is not set CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_HIGHMEM=y -CONFIG_X86_PAE=y -CONFIG_ARCH_PHYS_ADDR_T_64BIT=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -# CONFIG_NUMA is not set CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y @@ -417,19 +409,22 @@ CONFIG_SPARSEMEM_STATIC=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_ARCH_DISCARD_MEMBLOCK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_BALLOON_COMPACTION=y CONFIG_COMPACTION=y CONFIG_MIGRATION=y -CONFIG_PHYS_ADDR_T_64BIT=y +# CONFIG_PHYS_ADDR_T_64BIT is not set CONFIG_ZONE_DMA_FLAG=1 CONFIG_BOUNCE=y CONFIG_VIRT_TO_BUS=y -CONFIG_MMU_NOTIFIER=y CONFIG_KSM=y CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 # CONFIG_TRANSPARENT_HUGEPAGE is not set +CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_CLEANCACHE=y +# CONFIG_FRONTSWAP is not set # CONFIG_HIGHPTE is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set CONFIG_X86_RESERVE_LOW=64 @@ -441,6 +436,7 @@ CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1 CONFIG_X86_PAT=y CONFIG_ARCH_USES_PG_UNCACHED=y CONFIG_ARCH_RANDOM=y +# CONFIG_X86_SMAP is not set # CONFIG_EFI is not set # CONFIG_SECCOMP is not set # CONFIG_CC_STACKPROTECTOR is not set @@ -456,6 +452,8 @@ CONFIG_PHYSICAL_START=0x1000000 # CONFIG_RELOCATABLE is not set CONFIG_PHYSICAL_ALIGN=0x1000000 CONFIG_HOTPLUG_CPU=y +# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set +# CONFIG_DEBUG_HOTPLUG_CPU0 is not set # CONFIG_CMDLINE_BOOL is not set CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y @@ -464,10 +462,11 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y # CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y -CONFIG_HIBERNATE_CALLBACKS=y # CONFIG_HIBERNATION is not set CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y +# CONFIG_PM_AUTOSLEEP is not set +# CONFIG_PM_WAKELOCKS is not set # CONFIG_PM_RUNTIME is not set CONFIG_PM=y # CONFIG_PM_DEBUG is not set @@ -483,21 +482,22 @@ CONFIG_ACPI_BUTTON=m CONFIG_ACPI_VIDEO=m CONFIG_ACPI_FAN=m # CONFIG_ACPI_DOCK is not set +CONFIG_ACPI_I2C=m CONFIG_ACPI_PROCESSOR=m CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_THERMAL=m CONFIG_ACPI_CUSTOM_DSDT_FILE="" # CONFIG_ACPI_CUSTOM_DSDT is not set +# CONFIG_ACPI_INITRD_TABLE_OVERRIDE is not set CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set -CONFIG_ACPI_PCI_SLOT=m +CONFIG_ACPI_PCI_SLOT=y CONFIG_X86_PM_TIMER=y -CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_CONTAINER=y CONFIG_ACPI_SBS=m CONFIG_ACPI_HED=m # CONFIG_ACPI_CUSTOM_METHOD is not set -# CONFIG_ACPI_BGRT is not set CONFIG_ACPI_APEI=y # CONFIG_ACPI_APEI_GHES is not set CONFIG_ACPI_APEI_EINJ=m @@ -510,8 +510,10 @@ CONFIG_ACPI_APEI_ERST_DEBUG=y # # CONFIG_CPU_FREQ is not set CONFIG_CPU_IDLE=y +# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set CONFIG_CPU_IDLE_GOV_LADDER=y CONFIG_CPU_IDLE_GOV_MENU=y +# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set # CONFIG_INTEL_IDLE is not set # @@ -525,7 +527,6 @@ CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y -CONFIG_PCI_XEN=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_CNB20LE_QUIRK=y CONFIG_PCIEPORTBUS=y @@ -541,7 +542,6 @@ CONFIG_PCI_MSI=y # CONFIG_PCI_DEBUG is not set # CONFIG_PCI_REALLOC_ENABLE_AUTO is not set CONFIG_PCI_STUB=m -CONFIG_XEN_PCIDEV_FRONTEND=y CONFIG_HT_IRQ=y CONFIG_PCI_ATS=y CONFIG_PCI_IOV=y @@ -551,16 +551,15 @@ CONFIG_PCI_IOAPIC=y CONFIG_PCI_LABEL=y CONFIG_ISA_DMA_API=y # CONFIG_ISA is not set -# CONFIG_MCA is not set CONFIG_SCx200=m CONFIG_SCx200HR_TIMER=m +# CONFIG_OLPC is not set # CONFIG_ALIX is not set # CONFIG_NET5501 is not set # CONFIG_GEOS is not set CONFIG_AMD_NB=y # CONFIG_PCCARD is not set CONFIG_HOTPLUG_PCI=m -# CONFIG_HOTPLUG_PCI_FAKE is not set # CONFIG_HOTPLUG_PCI_COMPAQ is not set # CONFIG_HOTPLUG_PCI_IBM is not set CONFIG_HOTPLUG_PCI_ACPI=m @@ -577,6 +576,7 @@ CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_HAVE_AOUT=y CONFIG_BINFMT_MISC=m +CONFIG_COREDUMP=y CONFIG_HAVE_ATOMIC_IOMAP=y CONFIG_HAVE_TEXT_POKE_SMP=y CONFIG_NET=y @@ -585,9 +585,11 @@ CONFIG_NET=y # Networking options # CONFIG_PACKET=m +CONFIG_PACKET_DIAG=m CONFIG_UNIX=y CONFIG_UNIX_DIAG=m CONFIG_XFRM=y +CONFIG_XFRM_ALGO=m CONFIG_XFRM_USER=m CONFIG_XFRM_SUB_POLICY=y CONFIG_XFRM_MIGRATE=y @@ -617,6 +619,7 @@ CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_PIMSM_V2=y CONFIG_ARPD=y CONFIG_SYN_COOKIES=y +CONFIG_NET_IPVTI=m CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m @@ -665,6 +668,7 @@ CONFIG_IPV6_SIT=m CONFIG_IPV6_SIT_6RD=y CONFIG_IPV6_NDISC_NODETYPE=y CONFIG_IPV6_TUNNEL=m +CONFIG_IPV6_GRE=m CONFIG_IPV6_MULTIPLE_TABLES=y CONFIG_IPV6_SUBTREES=y CONFIG_IPV6_MROUTE=y @@ -692,6 +696,7 @@ CONFIG_NF_CONNTRACK_PROCFS=y CONFIG_NF_CONNTRACK_EVENTS=y # CONFIG_NF_CONNTRACK_TIMEOUT is not set CONFIG_NF_CONNTRACK_TIMESTAMP=y +CONFIG_NF_CONNTRACK_LABELS=y CONFIG_NF_CT_PROTO_DCCP=m CONFIG_NF_CT_PROTO_GRE=m CONFIG_NF_CT_PROTO_SCTP=m @@ -709,6 +714,18 @@ CONFIG_NF_CONNTRACK_SIP=m CONFIG_NF_CONNTRACK_TFTP=m CONFIG_NF_CT_NETLINK=m # CONFIG_NF_CT_NETLINK_TIMEOUT is not set +CONFIG_NF_CT_NETLINK_HELPER=m +CONFIG_NETFILTER_NETLINK_QUEUE_CT=y +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PROTO_DCCP=m +CONFIG_NF_NAT_PROTO_UDPLITE=m +CONFIG_NF_NAT_PROTO_SCTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_TFTP=m CONFIG_NETFILTER_TPROXY=m CONFIG_NETFILTER_XTABLES=m @@ -729,13 +746,16 @@ CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m CONFIG_NETFILTER_XT_TARGET_CT=m CONFIG_NETFILTER_XT_TARGET_DSCP=m CONFIG_NETFILTER_XT_TARGET_HL=m +CONFIG_NETFILTER_XT_TARGET_HMARK=m CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m CONFIG_NETFILTER_XT_TARGET_LOG=m CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NETMAP=m CONFIG_NETFILTER_XT_TARGET_NFLOG=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_NOTRACK=m CONFIG_NETFILTER_XT_TARGET_RATEEST=m +CONFIG_NETFILTER_XT_TARGET_REDIRECT=m CONFIG_NETFILTER_XT_TARGET_TEE=m CONFIG_NETFILTER_XT_TARGET_TPROXY=m CONFIG_NETFILTER_XT_TARGET_TRACE=m @@ -747,9 +767,11 @@ CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m # Xtables matches # CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_BPF=m CONFIG_NETFILTER_XT_MATCH_CLUSTER=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m @@ -759,7 +781,6 @@ CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ECN=m CONFIG_NETFILTER_XT_MATCH_ESP=m -# CONFIG_NETFILTER_XT_MATCH_GRADM is not set CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m CONFIG_NETFILTER_XT_MATCH_HELPER=m CONFIG_NETFILTER_XT_MATCH_HL=m @@ -848,7 +869,6 @@ CONFIG_IP_VS_PE_SIP=m CONFIG_NF_DEFRAG_IPV4=m CONFIG_NF_CONNTRACK_IPV4=m CONFIG_NF_CONNTRACK_PROC_COMPAT=y -CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_AH=m CONFIG_IP_NF_MATCH_ECN=m @@ -857,23 +877,14 @@ CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_NF_NAT=m -CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_IPV4=m CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_NF_NAT_SNMP_BASIC=m -CONFIG_NF_NAT_PROTO_DCCP=m CONFIG_NF_NAT_PROTO_GRE=m -CONFIG_NF_NAT_PROTO_UDPLITE=m -CONFIG_NF_NAT_PROTO_SCTP=m -CONFIG_NF_NAT_FTP=m -CONFIG_NF_NAT_IRC=m -CONFIG_NF_NAT_TFTP=m -CONFIG_NF_NAT_AMANDA=m CONFIG_NF_NAT_PPTP=m CONFIG_NF_NAT_H323=m -CONFIG_NF_NAT_SIP=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_TARGET_ECN=m @@ -888,7 +899,6 @@ CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_NF_DEFRAG_IPV6=m CONFIG_NF_CONNTRACK_IPV6=m -CONFIG_IP6_NF_QUEUE=m CONFIG_IP6_NF_IPTABLES=m CONFIG_IP6_NF_MATCH_AH=m CONFIG_IP6_NF_MATCH_EUI64=m @@ -904,6 +914,9 @@ CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_REJECT=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_RAW=m +CONFIG_NF_NAT_IPV6=m +CONFIG_IP6_NF_TARGET_MASQUERADE=m +CONFIG_IP6_NF_TARGET_NPT=m # # DECnet: Netfilter Configuration @@ -935,7 +948,7 @@ CONFIG_IP_DCCP=m CONFIG_INET_DCCP_DIAG=m # -# DCCP CCIDs Configuration (EXPERIMENTAL) +# DCCP CCIDs Configuration # # CONFIG_IP_DCCP_CCID2_DEBUG is not set CONFIG_IP_DCCP_CCID3=y @@ -949,15 +962,16 @@ CONFIG_IP_DCCP_TFRC_LIB=y CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set -# CONFIG_SCTP_HMAC_NONE is not set -CONFIG_SCTP_HMAC_SHA1=y -# CONFIG_SCTP_HMAC_MD5 is not set +CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y +# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set +# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set +CONFIG_SCTP_COOKIE_HMAC_MD5=y +CONFIG_SCTP_COOKIE_HMAC_SHA1=y CONFIG_RDS=m # CONFIG_RDS_TCP is not set # CONFIG_RDS_DEBUG is not set CONFIG_TIPC=m -# CONFIG_TIPC_ADVANCED is not set -# CONFIG_TIPC_DEBUG is not set +CONFIG_TIPC_PORTS=8191 CONFIG_ATM=m CONFIG_ATM_CLIP=m # CONFIG_ATM_CLIP_NO_ICMP is not set @@ -971,11 +985,14 @@ CONFIG_L2TP_V3=y CONFIG_L2TP_IP=m CONFIG_L2TP_ETH=m CONFIG_STP=m +CONFIG_MRP=m CONFIG_BRIDGE=m CONFIG_BRIDGE_IGMP_SNOOPING=y -# CONFIG_NET_DSA is not set +CONFIG_BRIDGE_VLAN_FILTERING=y +CONFIG_HAVE_NET_DSA=y CONFIG_VLAN_8021Q=m # CONFIG_VLAN_8021Q_GVRP is not set +CONFIG_VLAN_8021Q_MVRP=y CONFIG_DECNET=m CONFIG_DECNET_ROUTER=y CONFIG_LLC=m @@ -989,10 +1006,10 @@ CONFIG_IPDDP_ENCAP=y CONFIG_IPDDP_DECAP=y CONFIG_X25=m CONFIG_LAPB=m -CONFIG_WAN_ROUTER=m CONFIG_PHONET=m CONFIG_IEEE802154=m CONFIG_IEEE802154_6LOWPAN=m +CONFIG_MAC802154=m CONFIG_NET_SCHED=y # @@ -1016,6 +1033,8 @@ CONFIG_NET_SCH_DRR=m CONFIG_NET_SCH_MQPRIO=m CONFIG_NET_SCH_CHOKE=m CONFIG_NET_SCH_QFQ=m +CONFIG_NET_SCH_CODEL=m +CONFIG_NET_SCH_FQ_CODEL=m CONFIG_NET_SCH_INGRESS=m # CONFIG_NET_SCH_PLUG is not set @@ -1041,6 +1060,7 @@ CONFIG_NET_EMATCH_NBYTE=m CONFIG_NET_EMATCH_U32=m CONFIG_NET_EMATCH_META=m CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_IPSET=m CONFIG_NET_CLS_ACT=y CONFIG_NET_ACT_POLICE=m CONFIG_NET_ACT_GACT=m @@ -1058,6 +1078,8 @@ CONFIG_NET_SCH_FIFO=y CONFIG_DNS_RESOLVER=y # CONFIG_BATMAN_ADV is not set CONFIG_OPENVSWITCH=m +CONFIG_VSOCKETS=m +CONFIG_VMWARE_VMCI_VSOCKETS=m CONFIG_RPS=y CONFIG_RFS_ACCEL=y CONFIG_XPS=y @@ -1101,11 +1123,17 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=m # CONFIG_FIRMWARE_IN_KERNEL is not set CONFIG_EXTRA_FIRMWARE="" +# CONFIG_FW_LOADER_USER_HELPER is not set # CONFIG_DEBUG_DRIVER is not set # CONFIG_DEBUG_DEVRES is not set -CONFIG_SYS_HYPERVISOR=y +# CONFIG_SYS_HYPERVISOR is not set # CONFIG_GENERIC_CPU_DEVICES is not set CONFIG_DMA_SHARED_BUFFER=y +# CONFIG_CMA is not set + +# +# Bus devices +# CONFIG_CONNECTOR=m # CONFIG_MTD is not set CONFIG_PARPORT=m @@ -1141,15 +1169,13 @@ CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_NVME=m CONFIG_BLK_DEV_OSD=m # CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_UB is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_CDROM_PKTCDVD is not set CONFIG_ATA_OVER_ETH=m -CONFIG_XEN_BLKDEV_FRONTEND=y -# CONFIG_XEN_BLKDEV_BACKEND is not set CONFIG_VIRTIO_BLK=m # CONFIG_BLK_DEV_HD is not set CONFIG_BLK_DEV_RBD=m +# CONFIG_BLK_DEV_RSXX is not set # # Misc devices @@ -1162,6 +1188,7 @@ CONFIG_BLK_DEV_RBD=m # CONFIG_SGI_IOC4 is not set # CONFIG_TIFM_CORE is not set # CONFIG_ICS932S401 is not set +# CONFIG_ATMEL_SSC is not set # CONFIG_ENCLOSURE_SERVICES is not set # CONFIG_HP_ILO is not set # CONFIG_APDS9802ALS is not set @@ -1174,7 +1201,7 @@ CONFIG_BLK_DEV_RBD=m # CONFIG_HMC6352 is not set # CONFIG_DS1682 is not set CONFIG_VMWARE_BALLOON=m -# CONFIG_BMP085 is not set +# CONFIG_BMP085_I2C is not set # CONFIG_PCH_PHUB is not set # CONFIG_USB_SWITCH_FSA9480 is not set # CONFIG_C2PORT is not set @@ -1200,6 +1227,8 @@ CONFIG_TI_ST=m # Altera FPGA firmware download module # # CONFIG_ALTERA_STAPL is not set +# CONFIG_INTEL_MEI is not set +CONFIG_VMWARE_VMCI=m CONFIG_HAVE_IDE=y # CONFIG_IDE is not set @@ -1228,7 +1257,6 @@ CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set CONFIG_SCSI_SCAN_ASYNC=y -CONFIG_SCSI_WAIT_SCAN=m # # SCSI Transports @@ -1270,6 +1298,7 @@ CONFIG_ISCSI_BOOT_SYSFS=m # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_MPT3SAS is not set # CONFIG_SCSI_UFSHCD is not set # CONFIG_SCSI_HPTIOP is not set # CONFIG_SCSI_BUSLOGIC is not set @@ -1312,6 +1341,7 @@ CONFIG_SCSI_SYM53C8XX_MMIO=y # CONFIG_SCSI_SRP is not set # CONFIG_SCSI_BFA_FC is not set CONFIG_SCSI_VIRTIO=m +# CONFIG_SCSI_CHELSIO_FCOE is not set CONFIG_SCSI_DH=m CONFIG_SCSI_DH_RDAC=m CONFIG_SCSI_DH_HP_SW=m @@ -1325,6 +1355,7 @@ CONFIG_ATA=y # CONFIG_ATA_NONSTANDARD is not set CONFIG_ATA_VERBOSE_ERROR=y CONFIG_ATA_ACPI=y +# CONFIG_SATA_ZPODD is not set CONFIG_SATA_PMP=y # @@ -1349,6 +1380,7 @@ CONFIG_ATA_BMDMA=y # SATA SFF controllers with BMDMA # CONFIG_ATA_PIIX=y +# CONFIG_SATA_HIGHBANK is not set # CONFIG_SATA_MV is not set # CONFIG_SATA_NV is not set # CONFIG_SATA_PROMISE is not set @@ -1426,18 +1458,20 @@ CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m CONFIG_MD_RAID456=m -# CONFIG_MULTICORE_RAID456 is not set CONFIG_MD_MULTIPATH=m CONFIG_MD_FAULTY=m CONFIG_BLK_DEV_DM=m # CONFIG_DM_DEBUG is not set CONFIG_DM_BUFIO=m +CONFIG_DM_BIO_PRISON=m CONFIG_DM_PERSISTENT_DATA=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_THIN_PROVISIONING=m # CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set -# CONFIG_DM_DEBUG_SPACE_MAPS is not set +CONFIG_DM_CACHE=m +CONFIG_DM_CACHE_MQ=m +CONFIG_DM_CACHE_CLEANER=m CONFIG_DM_MIRROR=m CONFIG_DM_RAID=m CONFIG_DM_LOG_USERSPACE=m @@ -1456,6 +1490,7 @@ CONFIG_TCM_PSCSI=m CONFIG_LOOPBACK_TARGET=m CONFIG_TCM_FC=m CONFIG_ISCSI_TARGET=m +# CONFIG_SBP_TARGET is not set CONFIG_FUSION=y CONFIG_FUSION_SPI=m CONFIG_FUSION_FC=m @@ -1475,7 +1510,6 @@ CONFIG_FIREWIRE_NOSY=m CONFIG_I2O=m CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y CONFIG_I2O_EXT_ADAPTEC=y -CONFIG_I2O_EXT_ADAPTEC_DMA64=y CONFIG_I2O_CONFIG=m CONFIG_I2O_CONFIG_OLD_IOCTL=y CONFIG_I2O_BUS=m @@ -1490,13 +1524,15 @@ CONFIG_DUMMY=m CONFIG_EQUALIZER=m # CONFIG_NET_FC is not set CONFIG_MII=m -# CONFIG_IEEE802154_DRIVERS is not set CONFIG_IFB=m CONFIG_NET_TEAM=m +CONFIG_NET_TEAM_MODE_BROADCAST=m CONFIG_NET_TEAM_MODE_ROUNDROBIN=m CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m +CONFIG_NET_TEAM_MODE_LOADBALANCE=m CONFIG_MACVLAN=m CONFIG_MACVTAP=m +CONFIG_VXLAN=m CONFIG_NETCONSOLE=m CONFIG_NETCONSOLE_DYNAMIC=y CONFIG_NETPOLL=y @@ -1511,6 +1547,15 @@ CONFIG_VIRTIO_NET=m # # CAIF transport drivers # + +# +# Distributed Switch Architecture drivers +# +# CONFIG_NET_DSA_MV88E6XXX is not set +# CONFIG_NET_DSA_MV88E6060 is not set +# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +# CONFIG_NET_DSA_MV88E6131 is not set +# CONFIG_NET_DSA_MV88E6123_61_65 is not set CONFIG_ETHERNET=y # CONFIG_NET_VENDOR_3COM is not set # CONFIG_NET_VENDOR_ADAPTEC is not set @@ -1519,6 +1564,7 @@ CONFIG_NET_VENDOR_AMD=y # CONFIG_AMD8111_ETH is not set CONFIG_PCNET32=m # CONFIG_NET_VENDOR_ATHEROS is not set +# CONFIG_NET_CADENCE is not set # CONFIG_NET_VENDOR_BROADCOM is not set # CONFIG_NET_VENDOR_BROCADE is not set # CONFIG_NET_CALXEDA_XGMAC is not set @@ -1585,6 +1631,7 @@ CONFIG_R8169=m # CONFIG_NET_VENDOR_TEHUTI is not set # CONFIG_NET_VENDOR_TI is not set # CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_NET_SB1000 is not set @@ -1593,6 +1640,7 @@ CONFIG_PHYLIB=m # # MII PHY device drivers # +# CONFIG_AT803X_PHY is not set # CONFIG_AMD_PHY is not set CONFIG_MARVELL_PHY=m CONFIG_DAVICOM_PHY=m @@ -1602,6 +1650,7 @@ CONFIG_CICADA_PHY=m CONFIG_VITESSE_PHY=m CONFIG_SMSC_PHY=m CONFIG_BROADCOM_PHY=m +CONFIG_BCM87XX_PHY=m CONFIG_ICPLUS_PHY=m CONFIG_REALTEK_PHY=m CONFIG_NATIONAL_PHY=m @@ -1613,7 +1662,6 @@ CONFIG_MDIO_GPIO=m # CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set -# CONFIG_TR is not set # # USB Network Adapters @@ -1631,8 +1679,7 @@ CONFIG_MDIO_GPIO=m # Enable WiMAX (Networking options) to see the WiMAX drivers # # CONFIG_WAN is not set -CONFIG_XEN_NETDEV_FRONTEND=y -CONFIG_XEN_NETDEV_BACKEND=m +# CONFIG_IEEE802154_DRIVERS is not set CONFIG_VMXNET3=m CONFIG_HYPERV_NET=m # CONFIG_ISDN is not set @@ -1644,6 +1691,7 @@ CONFIG_INPUT=y # CONFIG_INPUT_FF_MEMLESS is not set CONFIG_INPUT_POLLDEV=m CONFIG_INPUT_SPARSEKMAP=m +CONFIG_INPUT_MATRIXKMAP=m # # Userland interfaces @@ -1672,6 +1720,7 @@ CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_TCA8418 is not set # CONFIG_KEYBOARD_MATRIX is not set # CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_LM8333 is not set # CONFIG_KEYBOARD_MAX7359 is not set # CONFIG_KEYBOARD_MCS is not set # CONFIG_KEYBOARD_MPR121 is not set @@ -1679,13 +1728,13 @@ CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_OPENCORES is not set # CONFIG_KEYBOARD_STOWAWAY is not set # CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_OMAP4 is not set # CONFIG_KEYBOARD_XTKBD is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=m CONFIG_MOUSE_PS2_ALPS=y CONFIG_MOUSE_PS2_LOGIPS2PP=y CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_CYPRESS=y CONFIG_MOUSE_PS2_LIFEBOOK=y CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_PS2_ELANTECH is not set @@ -1694,6 +1743,7 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_APPLETOUCH is not set # CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_CYAPA is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_MOUSE_GPIO is not set # CONFIG_MOUSE_SYNAPTICS_I2C is not set @@ -1722,7 +1772,6 @@ CONFIG_INPUT_MISC=y # CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set # CONFIG_INPUT_ADXL34X is not set # CONFIG_INPUT_CMA3000 is not set -CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y # # Hardware I/O ports @@ -1737,11 +1786,13 @@ CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # CONFIG_SERIO_ALTERA_PS2 is not set # CONFIG_SERIO_PS2MULT is not set +# CONFIG_SERIO_ARC_PS2 is not set # CONFIG_GAMEPORT is not set # # Character devices # +CONFIG_TTY=y CONFIG_VT=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_VT_CONSOLE=y @@ -1760,10 +1811,12 @@ CONFIG_DEVPTS_MULTIPLE_INSTANCES=y # Serial drivers # CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set +CONFIG_SERIAL_8250_PNP=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_FIX_EARLYCON_MEM=y +CONFIG_SERIAL_8250_DMA=y CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_PNP=y CONFIG_SERIAL_8250_NR_UARTS=16 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 CONFIG_SERIAL_8250_EXTENDED=y @@ -1771,6 +1824,7 @@ CONFIG_SERIAL_8250_MANY_PORTS=y CONFIG_SERIAL_8250_SHARE_IRQ=y # CONFIG_SERIAL_8250_DETECT_IRQ is not set CONFIG_SERIAL_8250_RSA=y +# CONFIG_SERIAL_8250_DW is not set # # Non-8250 serial port support @@ -1779,21 +1833,20 @@ CONFIG_SERIAL_MFD_HSU=m CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_JSM=m +# CONFIG_SERIAL_SCCNXP is not set CONFIG_SERIAL_TIMBERDALE=m CONFIG_SERIAL_ALTERA_JTAGUART=m CONFIG_SERIAL_ALTERA_UART=m CONFIG_SERIAL_ALTERA_UART_MAXPORTS=4 CONFIG_SERIAL_ALTERA_UART_BAUDRATE=115200 CONFIG_SERIAL_PCH_UART=m -# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_SERIAL_ARC is not set +# CONFIG_SERIAL_RP2 is not set # CONFIG_TTY_PRINTK is not set CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set CONFIG_PPDEV=m CONFIG_HVC_DRIVER=y -CONFIG_HVC_IRQ=y -CONFIG_HVC_XEN=y -CONFIG_HVC_XEN_FRONTEND=y CONFIG_VIRTIO_CONSOLE=m # CONFIG_IPMI_HANDLER is not set CONFIG_HW_RANDOM=m @@ -1817,7 +1870,6 @@ CONFIG_HPET_MMAP=y CONFIG_HANGCHECK_TIMER=m # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set -# CONFIG_RAMOOPS is not set CONFIG_I2C=m CONFIG_I2C_BOARDINFO=y CONFIG_I2C_COMPAT=y @@ -1847,6 +1899,7 @@ CONFIG_I2C_ALGOBIT=m # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_ISCH is not set +# CONFIG_I2C_ISMT is not set CONFIG_I2C_PIIX4=m # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_SIS5595 is not set @@ -1863,6 +1916,7 @@ CONFIG_I2C_PIIX4=m # # I2C system bus drivers (mostly embedded / system-on-chip) # +# CONFIG_I2C_CBUS_GPIO is not set # CONFIG_I2C_DESIGNWARE_PCI is not set # CONFIG_I2C_EG20T is not set # CONFIG_I2C_GPIO is not set @@ -1885,8 +1939,8 @@ CONFIG_I2C_PIIX4=m # # Other I2C/SMBus bus drivers # -# CONFIG_I2C_STUB is not set # CONFIG_SCx200_ACB is not set +# CONFIG_I2C_STUB is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -1905,12 +1959,13 @@ CONFIG_I2C_PIIX4=m # # PTP clock support # - -# -# Enable Device Drivers -> PPS to see the PTP clock options. -# +# CONFIG_PTP_1588_CLOCK is not set +# CONFIG_DP83640_PHY is not set +# CONFIG_PTP_1588_CLOCK_PCH is not set CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +CONFIG_GPIO_DEVRES=y CONFIG_GPIOLIB=y +CONFIG_GPIO_ACPI=y # CONFIG_DEBUG_GPIO is not set # CONFIG_GPIO_SYSFS is not set @@ -1919,8 +1974,11 @@ CONFIG_GPIOLIB=y # # CONFIG_GPIO_GENERIC_PLATFORM is not set # CONFIG_GPIO_IT8761E is not set +# CONFIG_GPIO_TS5500 is not set # CONFIG_GPIO_SCH is not set +# CONFIG_GPIO_ICH is not set # CONFIG_GPIO_VX855 is not set +# CONFIG_GPIO_LYNXPOINT is not set # # I2C GPIO expanders: @@ -1935,6 +1993,7 @@ CONFIG_GPIOLIB=y # PCI GPIO expanders: # # CONFIG_GPIO_BT8XX is not set +# CONFIG_GPIO_AMD8111 is not set # CONFIG_GPIO_LANGWELL is not set # CONFIG_GPIO_PCH is not set # CONFIG_GPIO_ML_IOH is not set @@ -1952,8 +2011,12 @@ CONFIG_GPIOLIB=y # # MODULbus GPIO expanders: # + +# +# USB GPIO expanders: +# # CONFIG_W1 is not set -CONFIG_POWER_SUPPLY=m +CONFIG_POWER_SUPPLY=y # CONFIG_POWER_SUPPLY_DEBUG is not set # CONFIG_PDA_POWER is not set # CONFIG_TEST_POWER is not set @@ -1967,7 +2030,11 @@ CONFIG_POWER_SUPPLY=m # CONFIG_CHARGER_MAX8903 is not set # CONFIG_CHARGER_LP8727 is not set # CONFIG_CHARGER_GPIO is not set +# CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_SMB347 is not set +# CONFIG_BATTERY_GOLDFISH is not set +# CONFIG_POWER_RESET is not set +# CONFIG_POWER_AVS is not set CONFIG_HWMON=m # CONFIG_HWMON_VID is not set # CONFIG_HWMON_DEBUG_CHIP is not set @@ -1985,6 +2052,7 @@ CONFIG_HWMON=m # CONFIG_SENSORS_ADM1029 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ADT7410 is not set # CONFIG_SENSORS_ADT7411 is not set # CONFIG_SENSORS_ADT7462 is not set # CONFIG_SENSORS_ADT7470 is not set @@ -2006,6 +2074,7 @@ CONFIG_HWMON=m # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_GL520SM is not set # CONFIG_SENSORS_GPIO_FAN is not set +# CONFIG_SENSORS_HIH6130 is not set # CONFIG_SENSORS_CORETEMP is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_JC42 is not set @@ -2031,9 +2100,11 @@ CONFIG_HWMON=m # CONFIG_SENSORS_MAX16065 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_MAX1668 is not set +# CONFIG_SENSORS_MAX197 is not set # CONFIG_SENSORS_MAX6639 is not set # CONFIG_SENSORS_MAX6642 is not set # CONFIG_SENSORS_MAX6650 is not set +# CONFIG_SENSORS_MAX6697 is not set # CONFIG_SENSORS_MCP3021 is not set # CONFIG_SENSORS_NTC_THERMISTOR is not set # CONFIG_SENSORS_PC87360 is not set @@ -2057,6 +2128,8 @@ CONFIG_HWMON=m # CONFIG_SENSORS_ADS1015 is not set # CONFIG_SENSORS_ADS7828 is not set # CONFIG_SENSORS_AMC6821 is not set +# CONFIG_SENSORS_INA209 is not set +# CONFIG_SENSORS_INA2XX is not set # CONFIG_SENSORS_THMC50 is not set # CONFIG_SENSORS_TMP102 is not set # CONFIG_SENSORS_TMP401 is not set @@ -2082,6 +2155,14 @@ CONFIG_HWMON=m CONFIG_SENSORS_ACPI_POWER=m # CONFIG_SENSORS_ATK0110 is not set CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +# CONFIG_THERMAL_GOV_FAIR_SHARE is not set +CONFIG_THERMAL_GOV_STEP_WISE=y +# CONFIG_THERMAL_GOV_USER_SPACE is not set +# CONFIG_THERMAL_EMULATION is not set +# CONFIG_INTEL_POWERCLAMP is not set CONFIG_WATCHDOG=y CONFIG_WATCHDOG_CORE=y # CONFIG_WATCHDOG_NOWAYOUT is not set @@ -2103,6 +2184,7 @@ CONFIG_WATCHDOG_CORE=y # CONFIG_IBMASR is not set # CONFIG_WAFER_WDT is not set CONFIG_I6300ESB_WDT=m +# CONFIG_IE6XX_WDT is not set # CONFIG_ITCO_WDT is not set # CONFIG_IT8712F_WDT is not set # CONFIG_IT87_WDT is not set @@ -2125,7 +2207,6 @@ CONFIG_I6300ESB_WDT=m # CONFIG_W83977F_WDT is not set # CONFIG_MACHZ_WDT is not set # CONFIG_SBC_EPX_C3_WATCHDOG is not set -# CONFIG_XEN_WDT is not set # # PCI-based Watchdog Cards @@ -2147,6 +2228,7 @@ CONFIG_SSB_PCIHOST_POSSIBLE=y # CONFIG_SSB_PCIHOST is not set # CONFIG_SSB_SILENT is not set # CONFIG_SSB_DEBUG is not set +# CONFIG_SSB_DRIVER_GPIO is not set CONFIG_BCMA_POSSIBLE=y # @@ -2159,23 +2241,30 @@ CONFIG_BCMA_POSSIBLE=y # CONFIG_MFD_CORE=m # CONFIG_MFD_SM501 is not set +# CONFIG_MFD_RTSX_PCI is not set +# CONFIG_MFD_TI_AM335X_TSCADC is not set # CONFIG_HTC_PASIC3 is not set # CONFIG_UCB1400_CORE is not set +# CONFIG_MFD_LM3533 is not set # CONFIG_TPS6105X is not set # CONFIG_TPS65010 is not set # CONFIG_TPS6507X is not set # CONFIG_MFD_TPS65217 is not set # CONFIG_MFD_TMIO is not set -# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_ARIZONA_I2C is not set # CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_MC13XXX_I2C is not set # CONFIG_ABX500_CORE is not set # CONFIG_MFD_CS5535 is not set # CONFIG_MFD_TIMBERDALE is not set # CONFIG_LPC_SCH is not set +# CONFIG_LPC_ICH is not set # CONFIG_MFD_RDC321X is not set # CONFIG_MFD_JANZ_CMODIO is not set # CONFIG_MFD_VX855 is not set CONFIG_MFD_WL1273_CORE=m +# CONFIG_MFD_VIPERBOARD is not set +# CONFIG_MFD_RETU is not set # CONFIG_REGULATOR is not set # CONFIG_MEDIA_SUPPORT is not set @@ -2199,17 +2288,18 @@ CONFIG_DRM=m CONFIG_DRM_KMS_HELPER=m # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set CONFIG_DRM_TTM=m -CONFIG_DRM_TDFX=m -CONFIG_DRM_R128=m -CONFIG_DRM_RADEON=m -# CONFIG_DRM_RADEON_KMS is not set -# CONFIG_DRM_NOUVEAU is not set # # I2C encoder or helper chips # # CONFIG_DRM_I2C_CH7006 is not set CONFIG_DRM_I2C_SIL164=m +# CONFIG_DRM_I2C_NXP_TDA998X is not set +CONFIG_DRM_TDFX=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +# CONFIG_DRM_RADEON_UMS is not set +# CONFIG_DRM_NOUVEAU is not set CONFIG_DRM_I810=m CONFIG_DRM_I915=m # CONFIG_DRM_I915_KMS is not set @@ -2218,13 +2308,17 @@ CONFIG_DRM_SIS=m CONFIG_DRM_VIA=m CONFIG_DRM_SAVAGE=m CONFIG_DRM_VMWGFX=m +# CONFIG_DRM_VMWGFX_FBCON is not set CONFIG_DRM_GMA500=m CONFIG_DRM_GMA600=y CONFIG_DRM_GMA3600=y # CONFIG_DRM_UDL is not set -# CONFIG_STUB_POULSBO is not set +# CONFIG_DRM_AST is not set +CONFIG_DRM_MGAG200=m +CONFIG_DRM_CIRRUS_QEMU=m CONFIG_VGASTATE=m CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_HDMI=y CONFIG_FB=m # CONFIG_FIRMWARE_EDID is not set # CONFIG_FB_DDC is not set @@ -2237,7 +2331,7 @@ CONFIG_FB_SYS_FILLRECT=m CONFIG_FB_SYS_COPYAREA=m CONFIG_FB_SYS_IMAGEBLIT=m # CONFIG_FB_FOREIGN_ENDIAN is not set -CONFIG_FB_SYS_FOPS=m +# CONFIG_FB_SYS_FOPS is not set # CONFIG_FB_WMT_GE_ROPS is not set CONFIG_FB_DEFERRED_IO=y # CONFIG_FB_SVGALIB is not set @@ -2285,21 +2379,23 @@ CONFIG_FB_UVESA=m # CONFIG_FB_TMIO is not set # CONFIG_FB_SMSCUFX is not set # CONFIG_FB_UDL is not set +# CONFIG_FB_GOLDFISH is not set # CONFIG_FB_VIRTUAL is not set -CONFIG_XEN_FBDEV_FRONTEND=m # CONFIG_FB_METRONOME is not set # CONFIG_FB_MB862XX is not set # CONFIG_FB_BROADSHEET is not set +# CONFIG_FB_AUO_K190X is not set # CONFIG_EXYNOS_VIDEO is not set CONFIG_BACKLIGHT_LCD_SUPPORT=y # CONFIG_LCD_CLASS_DEVICE is not set CONFIG_BACKLIGHT_CLASS_DEVICE=m # CONFIG_BACKLIGHT_GENERIC is not set -# CONFIG_BACKLIGHT_PROGEAR is not set # CONFIG_BACKLIGHT_APPLE is not set # CONFIG_BACKLIGHT_SAHARA is not set # CONFIG_BACKLIGHT_ADP8860 is not set # CONFIG_BACKLIGHT_ADP8870 is not set +# CONFIG_BACKLIGHT_LM3630 is not set +# CONFIG_BACKLIGHT_LM3639 is not set # CONFIG_BACKLIGHT_LP855X is not set # @@ -2411,7 +2507,6 @@ CONFIG_SND_HDA_INPUT_BEEP_MODE=0 CONFIG_SND_HDA_INPUT_JACK=y # CONFIG_SND_HDA_PATCH_LOADER is not set CONFIG_SND_HDA_CODEC_REALTEK=y -CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS=y CONFIG_SND_HDA_CODEC_ANALOG=y CONFIG_SND_HDA_CODEC_SIGMATEL=y CONFIG_SND_HDA_CODEC_VIA=y @@ -2420,10 +2515,11 @@ CONFIG_SND_HDA_CODEC_CIRRUS=y CONFIG_SND_HDA_CODEC_CONEXANT=y CONFIG_SND_HDA_CODEC_CA0110=y CONFIG_SND_HDA_CODEC_CA0132=y +# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set CONFIG_SND_HDA_CODEC_CMEDIA=y CONFIG_SND_HDA_CODEC_SI3054=y CONFIG_SND_HDA_GENERIC=y -# CONFIG_SND_HDA_POWER_SAVE is not set +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 # CONFIG_SND_HDSP is not set # CONFIG_SND_HDSPM is not set # CONFIG_SND_ICE1712 is not set @@ -2454,23 +2550,14 @@ CONFIG_SND_HDA_GENERIC=y # CONFIG_SND_SOC is not set # CONFIG_SOUND_PRIME is not set CONFIG_AC97_BUS=m -CONFIG_HID_SUPPORT=y -CONFIG_HID=m -# CONFIG_HID_BATTERY_STRENGTH is not set -CONFIG_HIDRAW=y # -# USB Input Devices -# -CONFIG_USB_HID=m -# CONFIG_HID_PID is not set -# CONFIG_USB_HIDDEV is not set - +# HID support # -# USB HID Boot Protocol drivers -# -CONFIG_USB_KBD=m -CONFIG_USB_MOUSE=m +CONFIG_HID=m +CONFIG_HIDRAW=y +CONFIG_UHID=m +CONFIG_HID_GENERIC=m # # Special HID drivers @@ -2478,6 +2565,7 @@ CONFIG_USB_MOUSE=m # CONFIG_HID_A4TECH is not set # CONFIG_HID_ACRUX is not set # CONFIG_HID_APPLE is not set +# CONFIG_HID_AUREAL is not set # CONFIG_HID_BELKIN is not set # CONFIG_HID_CHERRY is not set # CONFIG_HID_CHICONY is not set @@ -2495,6 +2583,7 @@ CONFIG_USB_MOUSE=m # CONFIG_HID_TWINHAN is not set # CONFIG_HID_KENSINGTON is not set # CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LENOVO_TPKBD is not set # CONFIG_HID_LOGITECH is not set # CONFIG_HID_MICROSOFT is not set # CONFIG_HID_MONTEREY is not set @@ -2510,15 +2599,36 @@ CONFIG_USB_MOUSE=m # CONFIG_HID_SAMSUNG is not set # CONFIG_HID_SONY is not set # CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_STEELSERIES is not set # CONFIG_HID_SUNPLUS is not set # CONFIG_HID_GREENASIA is not set CONFIG_HID_HYPERV_MOUSE=m # CONFIG_HID_SMARTJOYPLUS is not set # CONFIG_HID_TIVO is not set # CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THINGM is not set # CONFIG_HID_THRUSTMASTER is not set # CONFIG_HID_ZEROPLUS is not set # CONFIG_HID_ZYDACRON is not set +# CONFIG_HID_SENSOR_HUB is not set + +# +# USB HID support +# +CONFIG_USB_HID=m +# CONFIG_HID_PID is not set +# CONFIG_USB_HIDDEV is not set + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m + +# +# I2C HID support +# +# CONFIG_I2C_HID is not set CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB_ARCH_HAS_EHCI=y CONFIG_USB_ARCH_HAS_XHCI=y @@ -2532,11 +2642,10 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y # # Miscellaneous USB options # -# CONFIG_USB_DEVICEFS is not set -# CONFIG_USB_DEVICE_CLASS is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG_WHITELIST is not set # CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_DWC3 is not set CONFIG_USB_MON=m # CONFIG_USB_WUSB_CBAF is not set @@ -2549,20 +2658,23 @@ CONFIG_USB_XHCI_HCD=m CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_ROOT_HUB_TT is not set # CONFIG_USB_EHCI_TT_NEWSCHED is not set +CONFIG_USB_EHCI_PCI=m # CONFIG_USB_OXU210HP_HCD is not set # CONFIG_USB_ISP116X_HCD is not set # CONFIG_USB_ISP1760_HCD is not set # CONFIG_USB_ISP1362_HCD is not set CONFIG_USB_OHCI_HCD=m CONFIG_USB_OHCI_HCD_SSB=y -# CONFIG_USB_OHCI_HCD_PLATFORM is not set -# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_OHCI_HCD_PLATFORM=y +CONFIG_USB_EHCI_HCD_PLATFORM=m # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=m # CONFIG_USB_SL811_HCD is not set # CONFIG_USB_R8A66597_HCD is not set +CONFIG_USB_HCD_SSB=m +# CONFIG_USB_CHIPIDEA is not set # # USB Device Class drivers @@ -2594,8 +2706,6 @@ CONFIG_USB_STORAGE_ONETOUCH=m CONFIG_USB_STORAGE_KARMA=m CONFIG_USB_STORAGE_CYPRESS_ATACB=m CONFIG_USB_STORAGE_ENE_UB6250=m -# CONFIG_USB_UAS is not set -CONFIG_USB_LIBUSUAL=y # # USB Imaging devices @@ -2632,6 +2742,16 @@ CONFIG_USB_LIBUSUAL=y # CONFIG_USB_TEST is not set # CONFIG_USB_ISIGHTFW is not set # CONFIG_USB_YUREX is not set +# CONFIG_USB_EZUSB_FX2 is not set +# CONFIG_USB_HSIC_USB3503 is not set + +# +# USB Physical Layer drivers +# +# CONFIG_OMAP_USB3 is not set +# CONFIG_OMAP_CONTROL_USB is not set +# CONFIG_USB_ISP1301 is not set +# CONFIG_USB_RCAR_PHY is not set # CONFIG_USB_ATM is not set # CONFIG_USB_GADGET is not set @@ -2650,6 +2770,7 @@ CONFIG_LEDS_CLASS=y # LED drivers # # CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_LM3642 is not set # CONFIG_LEDS_PCA9532 is not set # CONFIG_LEDS_GPIO is not set # CONFIG_LEDS_LP3944 is not set @@ -2662,7 +2783,9 @@ CONFIG_LEDS_CLASS=y # CONFIG_LEDS_INTEL_SS4200 is not set # CONFIG_LEDS_LT3593 is not set # CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_LM355x is not set # CONFIG_LEDS_OT200 is not set +# CONFIG_LEDS_BLINKM is not set # CONFIG_LEDS_TRIGGERS is not set # @@ -2674,6 +2797,7 @@ CONFIG_LEDS_CLASS=y CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_SYSTOHC=y CONFIG_RTC_HCTOSYS_DEVICE="rtc0" # CONFIG_RTC_DEBUG is not set @@ -2698,6 +2822,7 @@ CONFIG_RTC_DRV_RS5C372=m CONFIG_RTC_DRV_ISL1208=m # CONFIG_RTC_DRV_ISL12022 is not set CONFIG_RTC_DRV_X1205=m +# CONFIG_RTC_DRV_PCF8523 is not set CONFIG_RTC_DRV_PCF8563=m CONFIG_RTC_DRV_PCF8583=m CONFIG_RTC_DRV_M41T80=m @@ -2730,10 +2855,16 @@ CONFIG_RTC_DRV_MSM6242=m CONFIG_RTC_DRV_BQ4802=m CONFIG_RTC_DRV_RP5C01=m CONFIG_RTC_DRV_V3020=m +# CONFIG_RTC_DRV_DS2404 is not set # # on-CPU RTC drivers # + +# +# HID Sensor RTC drivers +# +# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set CONFIG_DMADEVICES=y # CONFIG_DMADEVICES_DEBUG is not set @@ -2742,6 +2873,7 @@ CONFIG_DMADEVICES=y # # CONFIG_INTEL_MID_DMAC is not set CONFIG_INTEL_IOATDMA=m +# CONFIG_DW_DMAC is not set CONFIG_TIMB_DMA=m CONFIG_PCH_DMA=m CONFIG_DMA_ENGINE=y @@ -2755,8 +2887,10 @@ CONFIG_NET_DMA=y CONFIG_DCA=m # CONFIG_AUXDISPLAY is not set # CONFIG_UIO is not set +CONFIG_VFIO_IOMMU_TYPE1=m +CONFIG_VFIO=m +CONFIG_VFIO_PCI=m CONFIG_VIRTIO=m -CONFIG_VIRTIO_RING=m # # Virtio drivers @@ -2764,31 +2898,14 @@ CONFIG_VIRTIO_RING=m CONFIG_VIRTIO_PCI=m CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_MMIO=m +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y # # Microsoft Hyper-V guest support # CONFIG_HYPERV=m CONFIG_HYPERV_UTILS=m - -# -# Xen driver support -# -CONFIG_XEN_BALLOON=y -CONFIG_XEN_SELFBALLOONING=y -CONFIG_XEN_SCRUB_PAGES=y -CONFIG_XEN_DEV_EVTCHN=m -CONFIG_XEN_BACKEND=y -CONFIG_XENFS=y -CONFIG_XEN_COMPAT_XENFS=y -CONFIG_XEN_SYS_HYPERVISOR=y -CONFIG_XEN_XENBUS_FRONTEND=y -CONFIG_XEN_GNTDEV=m -CONFIG_XEN_GRANT_DEV_ALLOC=m -CONFIG_SWIOTLB_XEN=y -CONFIG_XEN_TMEM=y -CONFIG_XEN_PCIDEV_BACKEND=m -CONFIG_XEN_PRIVCMD=y +CONFIG_HYPERV_BALLOON=m CONFIG_STAGING=y # CONFIG_ET131X is not set # CONFIG_SLICOSS is not set @@ -2797,16 +2914,11 @@ CONFIG_STAGING=y # CONFIG_COMEDI is not set # CONFIG_ASUS_OLED is not set # CONFIG_PANEL is not set -# CONFIG_RTS_PSTOR is not set # CONFIG_RTS5139 is not set # CONFIG_TRANZPORT is not set # CONFIG_IDE_PHISON is not set # CONFIG_LINE6_USB is not set -# CONFIG_VME_BUS is not set # CONFIG_DX_SEP is not set -# CONFIG_IIO is not set -# CONFIG_ZRAM is not set -# CONFIG_ZCACHE is not set # CONFIG_ZSMALLOC is not set # CONFIG_FB_SM7XX is not set # CONFIG_CRYSTALHD is not set @@ -2822,15 +2934,18 @@ CONFIG_STAGING=y # CONFIG_SPEAKUP is not set # CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set # CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set -# CONFIG_INTEL_MEI is not set # CONFIG_STAGING_MEDIA is not set # # Android # # CONFIG_ANDROID is not set -# CONFIG_PHONE is not set # CONFIG_USB_WPAN_HCD is not set +# CONFIG_WIMAX_GDM72XX is not set +# CONFIG_NET_VENDOR_SILICOM is not set +# CONFIG_CED1401 is not set +# CONFIG_DGRP is not set +# CONFIG_FIREWIRE_SERIAL is not set # CONFIG_X86_PLATFORM_DEVICES is not set # @@ -2839,6 +2954,7 @@ CONFIG_STAGING=y CONFIG_CLKSRC_I8253=y CONFIG_CLKEVT_I8253=y CONFIG_CLKBLD_I8253=y +# CONFIG_MAILBOX is not set CONFIG_IOMMU_API=y CONFIG_IOMMU_SUPPORT=y CONFIG_DMAR_TABLE=y @@ -2847,14 +2963,21 @@ CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_FLOPPY_WA=y # -# Remoteproc drivers (EXPERIMENTAL) +# Remoteproc drivers # +# CONFIG_STE_MODEM_RPROC is not set # -# Rpmsg drivers (EXPERIMENTAL) +# Rpmsg drivers # CONFIG_VIRT_DRIVERS=y # CONFIG_PM_DEVFREQ is not set +# CONFIG_EXTCON is not set +CONFIG_MEMORY=y +# CONFIG_IIO is not set +# CONFIG_VME_BUS is not set +# CONFIG_PWM is not set +# CONFIG_IPACK_BUS is not set # # Firmware Drivers @@ -2883,7 +3006,6 @@ CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_EXT4_FS=m -CONFIG_EXT4_FS_XATTR=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y # CONFIG_EXT4_DEBUG is not set @@ -2990,6 +3112,7 @@ CONFIG_MISC_FILESYSTEMS=y # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set CONFIG_ECRYPT_FS=m +# CONFIG_ECRYPT_FS_MESSAGING is not set CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m # CONFIG_BEFS_FS is not set @@ -3015,18 +3138,26 @@ CONFIG_ROMFS_FS=m CONFIG_ROMFS_BACKED_BY_BLOCK=y CONFIG_ROMFS_ON_BLOCK=y CONFIG_PSTORE=y +# CONFIG_PSTORE_CONSOLE is not set +CONFIG_PSTORE_RAM=m CONFIG_SYSV_FS=m CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set # CONFIG_UFS_DEBUG is not set CONFIG_EXOFS_FS=m # CONFIG_EXOFS_DEBUG is not set +CONFIG_F2FS_FS=m +CONFIG_F2FS_STAT_FS=y +CONFIG_F2FS_FS_XATTR=y +CONFIG_F2FS_FS_POSIX_ACL=y CONFIG_ORE=m CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NFS_FS=m -CONFIG_NFS_V3=y +CONFIG_NFS_V2=m +CONFIG_NFS_V3=m # CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y +CONFIG_NFS_V4=m +CONFIG_NFS_SWAP=y # CONFIG_NFS_V4_1 is not set # CONFIG_NFS_FSCACHE is not set # CONFIG_NFS_USE_LEGACY_DNS is not set @@ -3041,6 +3172,7 @@ CONFIG_LOCKD_V4=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_SWAP=y CONFIG_RPCSEC_GSS_KRB5=m # CONFIG_SUNRPC_DEBUG is not set CONFIG_CEPH_FS=m @@ -3050,10 +3182,12 @@ CONFIG_CIFS=m # CONFIG_CIFS_UPCALL is not set CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y +CONFIG_CIFS_ACL=y +CONFIG_CIFS_DEBUG=y # CONFIG_CIFS_DEBUG2 is not set CONFIG_CIFS_DFS_UPCALL=y +CONFIG_CIFS_SMB2=y # CONFIG_CIFS_FSCACHE is not set -CONFIG_CIFS_ACL=y # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -3099,6 +3233,17 @@ CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m +CONFIG_NLS_MAC_ROMAN=m +CONFIG_NLS_MAC_CELTIC=m +CONFIG_NLS_MAC_CENTEURO=m +CONFIG_NLS_MAC_CROATIAN=m +CONFIG_NLS_MAC_CYRILLIC=m +CONFIG_NLS_MAC_GAELIC=m +CONFIG_NLS_MAC_GREEK=m +CONFIG_NLS_MAC_ICELAND=m +CONFIG_NLS_MAC_INUIT=m +CONFIG_NLS_MAC_ROMANIAN=m +CONFIG_NLS_MAC_TURKISH=m CONFIG_NLS_UTF8=m CONFIG_DLM=m # CONFIG_DLM_DEBUG is not set @@ -3114,6 +3259,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y CONFIG_FRAME_WARN=1024 CONFIG_MAGIC_SYSRQ=y # CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_READABLE_ASM is not set # CONFIG_UNUSED_SYMBOLS is not set CONFIG_DEBUG_FS=y # CONFIG_HEADERS_CHECK is not set @@ -3126,12 +3272,15 @@ CONFIG_HARDLOCKUP_DETECTOR=y CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0 # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 # CONFIG_DETECT_HUNG_TASK is not set CONFIG_SCHED_DEBUG=y CONFIG_SCHEDSTATS=y CONFIG_TIMER_STATS=y # CONFIG_DEBUG_OBJECTS is not set # CONFIG_SLUB_STATS is not set +CONFIG_HAVE_DEBUG_KMEMLEAK=y # CONFIG_DEBUG_KMEMLEAK is not set # CONFIG_DEBUG_RT_MUTEXES is not set # CONFIG_RT_MUTEX_TESTER is not set @@ -3139,7 +3288,6 @@ CONFIG_TIMER_STATS=y # CONFIG_DEBUG_MUTEXES is not set # CONFIG_DEBUG_LOCK_ALLOC is not set # CONFIG_PROVE_LOCKING is not set -# CONFIG_SPARSE_RCU_POINTER is not set # CONFIG_LOCK_STAT is not set # CONFIG_DEBUG_ATOMIC_SLEEP is not set # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set @@ -3161,6 +3309,11 @@ CONFIG_DEBUG_BUGVERBOSE=y CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_FRAME_POINTER=y # CONFIG_BOOT_PRINTK_DELAY is not set + +# +# RCU Debugging +# +# CONFIG_SPARSE_RCU_POINTER is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_RCU_CPU_STALL_INFO is not set @@ -3170,7 +3323,7 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set # CONFIG_DEBUG_PER_CPU_MAPS is not set # CONFIG_LKDTM is not set -# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set # CONFIG_FAULT_INJECTION is not set CONFIG_LATENCYTOP=y # CONFIG_DEBUG_PAGEALLOC is not set @@ -3180,13 +3333,14 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_TRACING_SUPPORT=y # CONFIG_FTRACE is not set -# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set -# CONFIG_FIREWIRE_OHCI_REMOTE_DMA is not set +# CONFIG_RBTREE_TEST is not set +# CONFIG_INTERVAL_TREE_TEST is not set # CONFIG_DYNAMIC_DEBUG is not set # CONFIG_DMA_API_DEBUG is not set # CONFIG_ATOMIC64_SELFTEST is not set @@ -3228,6 +3382,7 @@ CONFIG_DEBUG_NMI_SELFTEST=y # Grsecurity # CONFIG_ARCH_TRACK_EXEC_LIMIT=y +CONFIG_PAX_USERCOPY_SLABS=y CONFIG_GRKERNSEC=y # CONFIG_GRKERNSEC_CONFIG_AUTO is not set CONFIG_GRKERNSEC_CONFIG_CUSTOM=y @@ -3263,6 +3418,7 @@ CONFIG_PAX_EMUTRAMP=y CONFIG_PAX_MPROTECT=y # CONFIG_PAX_MPROTECT_COMPAT is not set # CONFIG_PAX_ELFRELOCS is not set +# CONFIG_PAX_KERNEXEC is not set CONFIG_PAX_KERNEXEC_PLUGIN_METHOD="" # @@ -3278,8 +3434,11 @@ CONFIG_PAX_RANDMMAP=y # # CONFIG_PAX_MEMORY_SANITIZE is not set # CONFIG_PAX_MEMORY_STACKLEAK is not set +CONFIG_PAX_MEMORY_STRUCTLEAK=y +# CONFIG_PAX_MEMORY_UDEREF is not set CONFIG_PAX_REFCOUNT=y -# CONFIG_PAX_USERCOPY is not set +CONFIG_PAX_USERCOPY=y +# CONFIG_PAX_USERCOPY_DEBUG is not set # CONFIG_PAX_SIZE_OVERFLOW is not set # CONFIG_PAX_LATENT_ENTROPY is not set @@ -3298,8 +3457,8 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y # # Role Based Access Control Options # -# CONFIG_GRKERNSEC_NO_RBAC is not set -# CONFIG_GRKERNSEC_ACL_HIDEKERN is not set +CONFIG_GRKERNSEC_NO_RBAC=y +CONFIG_GRKERNSEC_ACL_HIDEKERN=y CONFIG_GRKERNSEC_ACL_MAXTRIES=3 CONFIG_GRKERNSEC_ACL_TIMEOUT=30 @@ -3315,6 +3474,7 @@ CONFIG_GRKERNSEC_LINK=y CONFIG_GRKERNSEC_FIFO=y CONFIG_GRKERNSEC_SYSFS_RESTRICT=y # CONFIG_GRKERNSEC_ROFS is not set +CONFIG_GRKERNSEC_DEVICE_SIDECHANNEL=y CONFIG_GRKERNSEC_CHROOT=y CONFIG_GRKERNSEC_CHROOT_MOUNT=y CONFIG_GRKERNSEC_CHROOT_DOUBLE=y @@ -3361,6 +3521,7 @@ CONFIG_GRKERNSEC_SETXID=y # CONFIG_GRKERNSEC_RANDNET=y # CONFIG_GRKERNSEC_BLACKHOLE is not set +CONFIG_GRKERNSEC_NO_SIMULT_CONNECT=y # CONFIG_GRKERNSEC_SOCKET is not set # @@ -3419,6 +3580,8 @@ CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CRYPTO_CRYPTD=m CONFIG_CRYPTO_AUTHENC=m CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_ABLK_HELPER_X86=m +CONFIG_CRYPTO_GLUE_HELPER_X86=m # # Authenticated Encryption with Associated Data @@ -3450,6 +3613,8 @@ CONFIG_CRYPTO_VMAC=m # CONFIG_CRYPTO_CRC32C=m CONFIG_CRYPTO_CRC32C_INTEL=m +CONFIG_CRYPTO_CRC32=m +# CONFIG_CRYPTO_CRC32_PCLMUL is not set CONFIG_CRYPTO_GHASH=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=y @@ -3467,7 +3632,7 @@ CONFIG_CRYPTO_WP512=m # # Ciphers # -CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_AES=y CONFIG_CRYPTO_AES_586=m CONFIG_CRYPTO_AES_NI_INTEL=m CONFIG_CRYPTO_ANUBIS=m @@ -3475,6 +3640,7 @@ CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_BLOWFISH_COMMON=m CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST_COMMON=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_DES=m @@ -3509,10 +3675,16 @@ CONFIG_CRYPTO_DEV_PADLOCK=m CONFIG_CRYPTO_DEV_PADLOCK_AES=m CONFIG_CRYPTO_DEV_PADLOCK_SHA=m CONFIG_CRYPTO_DEV_GEODE=m +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +CONFIG_ASYMMETRIC_KEY_TYPE=m +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m +CONFIG_PUBLIC_KEY_ALGO_RSA=m +CONFIG_X509_CERTIFICATE_PARSER=m CONFIG_HAVE_KVM=y CONFIG_VIRTUALIZATION=y # CONFIG_KVM is not set # CONFIG_VHOST_NET is not set +# CONFIG_TCM_VHOST is not set # CONFIG_LGUEST is not set # CONFIG_BINARY_PRINTF is not set @@ -3521,6 +3693,8 @@ CONFIG_VIRTUALIZATION=y # CONFIG_RAID6_PQ=m CONFIG_BITREVERSE=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_FIND_FIRST_BIT=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_IOMAP=y @@ -3553,6 +3727,9 @@ CONFIG_XZ_DEC_BCJ=y # CONFIG_XZ_DEC_TEST is not set CONFIG_DECOMPRESS_GZIP=y CONFIG_DECOMPRESS_XZ=y +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_ENC8=y +CONFIG_REED_SOLOMON_DEC8=y CONFIG_TEXTSEARCH=y CONFIG_TEXTSEARCH_KMP=m CONFIG_TEXTSEARCH_BM=m @@ -3564,6 +3741,11 @@ CONFIG_HAS_DMA=y CONFIG_CPU_RMAP=y CONFIG_DQL=y CONFIG_NLATTR=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y CONFIG_LRU_CACHE=m CONFIG_AVERAGE=y +CONFIG_CLZ_TAB=y CONFIG_CORDIC=m +CONFIG_DDR=y +CONFIG_MPILIB=m +CONFIG_OID_REGISTRY=m diff --git a/testing/linux-virt-grsec/kernelconfig.x86_64 b/testing/linux-virt-grsec/kernelconfig.x86_64 index b63baab158..22259116a0 100644 --- a/testing/linux-virt-grsec/kernelconfig.x86_64 +++ b/testing/linux-virt-grsec/kernelconfig.x86_64 @@ -1,19 +1,13 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86_64 3.4.11 Kernel Configuration +# Linux/x86 3.9.3 Kernel Configuration # CONFIG_64BIT=y -# CONFIG_X86_32 is not set CONFIG_X86_64=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf64-x86-64" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_CLOCKSOURCE_WATCHDOG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y @@ -22,15 +16,11 @@ CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_GPIO=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y -# CONFIG_RWSEM_GENERIC_SPINLOCK is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_DEFAULT_IDLE=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y @@ -40,24 +30,24 @@ CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ZONE_DMA32=y -CONFIG_AUDIT_ARCH=y +# CONFIG_ZONE_DMA32 is not set +# CONFIG_AUDIT_ARCH is not set CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_HAVE_INTEL_TXT=y -CONFIG_X86_64_SMP=y +CONFIG_X86_64_SMP CONFIG_X86_HT=y -CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11" -# CONFIG_KTIME_SCALAR is not set +CONFIG_X86_32_LAZY_GS=y +CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx" CONFIG_ARCH_CPU_PROBE_RELEASE=y +CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_HAVE_IRQ_WORK=y CONFIG_IRQ_WORK=y +CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # -CONFIG_EXPERIMENTAL=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" CONFIG_LOCALVERSION="" @@ -77,13 +67,7 @@ CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y # CONFIG_FHANDLE is not set -CONFIG_TASKSTATS=y -CONFIG_TASK_DELAY_ACCT=y -CONFIG_TASK_XACCT=y -CONFIG_TASK_IO_ACCOUNTING=y # CONFIG_AUDIT is not set CONFIG_HAVE_GENERIC_HARDIRQS=y @@ -94,22 +78,55 @@ CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_IRQ_DOMAIN=y +# CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_KTIME_SCALAR=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y +CONFIG_GENERIC_CMOS_UPDATE=y + +# +# Timers subsystem +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y + +# +# CPU/Task time and stats accounting +# +# CONFIG_TICK_CPU_ACCOUNTING is not set +CONFIG_IRQ_TIME_ACCOUNTING=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_PREEMPT_RCU is not set +CONFIG_RCU_STALL_COMMON=y CONFIG_RCU_FANOUT=32 +CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_RCU_FANOUT_EXACT is not set CONFIG_RCU_FAST_NO_HZ=y # CONFIG_TREE_RCU_TRACE is not set +# CONFIG_RCU_NOCB_CPU is not set CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y +CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y +CONFIG_ARCH_WANTS_PROT_NUMA_PROT_NONE=y CONFIG_CGROUPS=y # CONFIG_CGROUP_DEBUG is not set CONFIG_CGROUP_FREEZER=y @@ -127,7 +144,6 @@ CONFIG_BLK_CGROUP=y CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y -CONFIG_USER_NS=y CONFIG_PID_NS=y CONFIG_NET_NS=y CONFIG_SCHED_AUTOGROUP=y @@ -144,8 +160,10 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_EXPERT=y +CONFIG_HAVE_UID16=y CONFIG_UID16=y CONFIG_SYSCTL_SYSCALL=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y CONFIG_HOTPLUG=y @@ -169,7 +187,6 @@ CONFIG_HAVE_PERF_EVENTS=y # Kernel Performance Events And Counters # CONFIG_PERF_EVENTS=y -CONFIG_PERF_COUNTERS=y # CONFIG_DEBUG_PERF_USE_VMALLOC is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_PCI_QUIRKS=y @@ -183,32 +200,45 @@ CONFIG_HAVE_OPROFILE=y CONFIG_OPROFILE_NMI_TIMER=y # CONFIG_KPROBES is not set # CONFIG_JUMP_LABEL is not set +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KRETPROBES=y CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_KPROBES_ON_FTRACE=y CONFIG_HAVE_ARCH_TRACEHOOK=y CONFIG_HAVE_DMA_ATTRS=y CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_DMA_API_DEBUG=y CONFIG_HAVE_HW_BREAKPOINT=y CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y CONFIG_HAVE_USER_RETURN_NOTIFIER=y CONFIG_HAVE_PERF_EVENTS_NMI=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_CMPXCHG_LOCAL=y CONFIG_HAVE_CMPXCHG_DOUBLE=y -CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OLD_SIGACTION=y # # GCOV-based kernel profiling # # CONFIG_GCOV_KERNEL is not set -# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_RT_MUTEXES=y CONFIG_BASE_SMALL=0 CONFIG_MODULES=y @@ -217,8 +247,10 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_MODVERSIONS=y # CONFIG_MODULE_SRCVERSION_ALL is not set +# CONFIG_MODULE_SIG is not set CONFIG_STOP_MACHINE=y CONFIG_BLOCK=y +CONFIG_LBDAF=y CONFIG_BLK_DEV_BSG=y CONFIG_BLK_DEV_BSGLIB=y # CONFIG_BLK_DEV_INTEGRITY is not set @@ -245,7 +277,6 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_KARMA_PARTITION is not set CONFIG_EFI_PARTITION=y # CONFIG_SYSV68_PARTITION is not set -CONFIG_BLOCK_COMPAT=y # # IO Schedulers @@ -257,33 +288,12 @@ CONFIG_DEFAULT_DEADLINE=y # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="deadline" CONFIG_PADATA=y -# CONFIG_INLINE_SPIN_TRYLOCK is not set -# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK is not set -# CONFIG_INLINE_SPIN_LOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK_IRQ is not set -# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set -# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_ASN1=m CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_READ_TRYLOCK is not set -# CONFIG_INLINE_READ_LOCK is not set -# CONFIG_INLINE_READ_LOCK_BH is not set -# CONFIG_INLINE_READ_LOCK_IRQ is not set -# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set CONFIG_INLINE_READ_UNLOCK=y -# CONFIG_INLINE_READ_UNLOCK_BH is not set CONFIG_INLINE_READ_UNLOCK_IRQ=y -# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_WRITE_TRYLOCK is not set -# CONFIG_INLINE_WRITE_LOCK is not set -# CONFIG_INLINE_WRITE_LOCK_BH is not set -# CONFIG_INLINE_WRITE_LOCK_IRQ is not set -# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set CONFIG_INLINE_WRITE_UNLOCK=y -# CONFIG_INLINE_WRITE_UNLOCK_BH is not set CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_FREEZER=y @@ -291,47 +301,65 @@ CONFIG_FREEZER=y # Processor type and features # CONFIG_ZONE_DMA=y -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_SMP=y # CONFIG_X86_MPPARSE is not set +CONFIG_X86_BIGSMP=y # CONFIG_X86_EXTENDED_PLATFORM is not set +# CONFIG_X86_GOLDFISH is not set +# CONFIG_X86_INTEL_LPSS is not set +# CONFIG_X86_32_IRIS is not set CONFIG_SCHED_OMIT_FRAME_POINTER=y CONFIG_PARAVIRT_GUEST=y CONFIG_PARAVIRT_TIME_ACCOUNTING=y CONFIG_XEN=y -CONFIG_XEN_DOM0=y +CONFIG_XEN_DOM0=n CONFIG_XEN_PRIVILEGED_GUEST=y CONFIG_XEN_PVHVM=y -CONFIG_XEN_MAX_DOMAIN_MEMORY=500 +CONFIG_XEN_MAX_DOMAIN_MEMORY=64 CONFIG_XEN_SAVE_RESTORE=y # CONFIG_XEN_DEBUG_FS is not set -CONFIG_KVM_CLOCK=y CONFIG_KVM_GUEST=y +# CONFIG_LGUEST_GUEST is not set CONFIG_PARAVIRT=y CONFIG_PARAVIRT_SPINLOCKS=y CONFIG_PARAVIRT_CLOCK=y # CONFIG_PARAVIRT_DEBUG is not set CONFIG_NO_BOOTMEM=y # CONFIG_MEMTEST is not set +# CONFIG_M486 is not set +# CONFIG_M586 is not set +# CONFIG_M586TSC=y +# CONFIG_M586MMX is not set +# CONFIG_M686 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MPENTIUM4 is not set +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set # CONFIG_MK8 is not set -# CONFIG_MPSC is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MWINCHIPC6 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MELAN is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set # CONFIG_MCORE2 is not set # CONFIG_MATOM is not set CONFIG_GENERIC_CPU=y CONFIG_X86_INTERNODE_CACHE_SHIFT=6 -CONFIG_X86_CMPXCHG=y CONFIG_X86_L1_CACHE_SHIFT=6 -CONFIG_X86_XADD=y -CONFIG_X86_WP_WORKS_OK=y +# CONFIG_X86_PPRO_FENCE is not set +CONFIG_X86_F00F_BUG=y +CONFIG_X86_ALIGNMENT_16=y +CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_TSC=y CONFIG_X86_CMPXCHG64=y -CONFIG_X86_CMOV=y CONFIG_X86_MINIMUM_CPU_FAMILY=64 -CONFIG_X86_DEBUGCTLMSR=y # CONFIG_PROCESSOR_SELECT is not set CONFIG_CPU_SUP_INTEL=y CONFIG_CPU_SUP_AMD=y @@ -339,15 +367,11 @@ CONFIG_CPU_SUP_CENTAUR=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y CONFIG_DMI=y -CONFIG_GART_IOMMU=y -# CONFIG_CALGARY_IOMMU is not set CONFIG_SWIOTLB=y CONFIG_IOMMU_HELPER=y -# CONFIG_MAXSMP is not set CONFIG_NR_CPUS=32 CONFIG_SCHED_SMT=y CONFIG_SCHED_MC=y -CONFIG_IRQ_TIME_ACCOUNTING=y CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set @@ -355,38 +379,42 @@ CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y # CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set # CONFIG_X86_MCE is not set +# CONFIG_TOSHIBA is not set # CONFIG_I8K is not set +# CONFIG_X86_REBOOTFIXUPS is not set CONFIG_MICROCODE=m CONFIG_MICROCODE_INTEL=y CONFIG_MICROCODE_AMD=y CONFIG_MICROCODE_OLD_INTERFACE=y -CONFIG_X86_MSR=m +CONFIG_MICROCODE_INTEL_LIB=y +CONFIG_MICROCODE_INTEL_EARLY=y +CONFIG_MICROCODE_EARLY=y CONFIG_X86_CPUID=m +# CONFIG_NOHIGHMEM is not set +# CONFIG_HIGHMEM4G is not set +# CONFIG_HIGHMEM64G=y +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_1G is not set CONFIG_ARCH_PHYS_ADDR_T_64BIT=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_DIRECT_GBPAGES=y # CONFIG_NUMA is not set +CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_MEMORY_PROBE=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +CONFIG_ILLEGAL_POINTER_VALUE=0 CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_SPARSEMEM_MANUAL=y -CONFIG_SPARSEMEM=y -CONFIG_HAVE_MEMORY_PRESENT=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y -CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_SPARSEMEM_STATIC=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_ARCH_DISCARD_MEMBLOCK=y -CONFIG_MEMORY_HOTPLUG=y -CONFIG_MEMORY_HOTPLUG_SPARSE=y -CONFIG_MEMORY_HOTREMOVE=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_BALLOON_COMPACTION=y CONFIG_COMPACTION=y CONFIG_MIGRATION=y CONFIG_PHYS_ADDR_T_64BIT=y @@ -397,9 +425,13 @@ CONFIG_MMU_NOTIFIER=y CONFIG_KSM=y CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 # CONFIG_TRANSPARENT_HUGEPAGE is not set +CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_CLEANCACHE=y +# CONFIG_FRONTSWAP is not set +# CONFIG_HIGHPTE is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set CONFIG_X86_RESERVE_LOW=64 +# CONFIG_MATH_EMULATION is not set CONFIG_MTRR=y CONFIG_MTRR_SANITIZER=y CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0 @@ -407,6 +439,7 @@ CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1 CONFIG_X86_PAT=y CONFIG_ARCH_USES_PG_UNCACHED=y CONFIG_ARCH_RANDOM=y +# CONFIG_X86_SMAP is not set # CONFIG_EFI is not set # CONFIG_SECCOMP is not set # CONFIG_CC_STACKPROTECTOR is not set @@ -422,9 +455,10 @@ CONFIG_PHYSICAL_START=0x1000000 # CONFIG_RELOCATABLE is not set CONFIG_PHYSICAL_ALIGN=0x1000000 CONFIG_HOTPLUG_CPU=y +# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set +# CONFIG_DEBUG_HOTPLUG_CPU0 is not set # CONFIG_CMDLINE_BOOL is not set CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y # # Power management and ACPI options @@ -435,6 +469,8 @@ CONFIG_HIBERNATE_CALLBACKS=y # CONFIG_HIBERNATION is not set CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y +# CONFIG_PM_AUTOSLEEP is not set +# CONFIG_PM_WAKELOCKS is not set # CONFIG_PM_RUNTIME is not set CONFIG_PM=y # CONFIG_PM_DEBUG is not set @@ -450,46 +486,49 @@ CONFIG_ACPI_BUTTON=m CONFIG_ACPI_VIDEO=m CONFIG_ACPI_FAN=m # CONFIG_ACPI_DOCK is not set +CONFIG_ACPI_I2C=m CONFIG_ACPI_PROCESSOR=m CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_THERMAL=m CONFIG_ACPI_CUSTOM_DSDT_FILE="" # CONFIG_ACPI_CUSTOM_DSDT is not set +# CONFIG_ACPI_INITRD_TABLE_OVERRIDE is not set CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set -CONFIG_ACPI_PCI_SLOT=m +CONFIG_ACPI_PCI_SLOT=y CONFIG_X86_PM_TIMER=y -CONFIG_ACPI_CONTAINER=m -CONFIG_ACPI_HOTPLUG_MEMORY=m +CONFIG_ACPI_CONTAINER=y CONFIG_ACPI_SBS=m CONFIG_ACPI_HED=m # CONFIG_ACPI_CUSTOM_METHOD is not set -# CONFIG_ACPI_BGRT is not set CONFIG_ACPI_APEI=y # CONFIG_ACPI_APEI_GHES is not set CONFIG_ACPI_APEI_EINJ=m CONFIG_ACPI_APEI_ERST_DEBUG=y # CONFIG_SFI is not set +# CONFIG_APM is not set # # CPU Frequency scaling # # CONFIG_CPU_FREQ is not set CONFIG_CPU_IDLE=y +# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set CONFIG_CPU_IDLE_GOV_LADDER=y CONFIG_CPU_IDLE_GOV_MENU=y +# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set # CONFIG_INTEL_IDLE is not set # -# Memory power savings -# -# CONFIG_I7300_IDLE is not set - -# # Bus options (PCI etc.) # CONFIG_PCI=y +# CONFIG_PCI_GOBIOS is not set +# CONFIG_PCI_GOMMCONFIG is not set +# CONFIG_PCI_GODIRECT is not set +CONFIG_PCI_GOANY=y +CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y CONFIG_PCI_XEN=y @@ -517,10 +556,17 @@ CONFIG_PCI_PASID=y CONFIG_PCI_IOAPIC=y CONFIG_PCI_LABEL=y CONFIG_ISA_DMA_API=y +# CONFIG_ISA is not set +CONFIG_SCx200=m +CONFIG_SCx200HR_TIMER=m +# CONFIG_ALIX is not set +# CONFIG_NET5501 is not set +# CONFIG_GEOS is not set CONFIG_AMD_NB=y # CONFIG_PCCARD is not set CONFIG_HOTPLUG_PCI=m -# CONFIG_HOTPLUG_PCI_FAKE is not set +# CONFIG_HOTPLUG_PCI_COMPAQ is not set +# CONFIG_HOTPLUG_PCI_IBM is not set CONFIG_HOTPLUG_PCI_ACPI=m CONFIG_HOTPLUG_PCI_ACPI_IBM=m # CONFIG_HOTPLUG_PCI_CPCI is not set @@ -531,18 +577,12 @@ CONFIG_HOTPLUG_PCI_SHPC=m # Executable file formats / Emulations # CONFIG_BINFMT_ELF=y -CONFIG_COMPAT_BINFMT_ELF=y CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set -# CONFIG_HAVE_AOUT is not set +CONFIG_HAVE_AOUT=y CONFIG_BINFMT_MISC=m -CONFIG_IA32_EMULATION=y -# CONFIG_IA32_AOUT is not set -# CONFIG_X86_X32 is not set -CONFIG_COMPAT=y -CONFIG_COMPAT_FOR_U64_ALIGNMENT=y -CONFIG_SYSVIPC_COMPAT=y -CONFIG_KEYS_COMPAT=y +CONFIG_COREDUMP=y +CONFIG_HAVE_ATOMIC_IOMAP=y CONFIG_HAVE_TEXT_POKE_SMP=y CONFIG_NET=y @@ -550,9 +590,11 @@ CONFIG_NET=y # Networking options # CONFIG_PACKET=m +CONFIG_PACKET_DIAG=m CONFIG_UNIX=y CONFIG_UNIX_DIAG=m CONFIG_XFRM=y +CONFIG_XFRM_ALGO=m CONFIG_XFRM_USER=m CONFIG_XFRM_SUB_POLICY=y CONFIG_XFRM_MIGRATE=y @@ -582,6 +624,7 @@ CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_PIMSM_V2=y CONFIG_ARPD=y CONFIG_SYN_COOKIES=y +CONFIG_NET_IPVTI=m CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m @@ -630,6 +673,7 @@ CONFIG_IPV6_SIT=m CONFIG_IPV6_SIT_6RD=y CONFIG_IPV6_NDISC_NODETYPE=y CONFIG_IPV6_TUNNEL=m +CONFIG_IPV6_GRE=m CONFIG_IPV6_MULTIPLE_TABLES=y CONFIG_IPV6_SUBTREES=y CONFIG_IPV6_MROUTE=y @@ -657,6 +701,7 @@ CONFIG_NF_CONNTRACK_PROCFS=y CONFIG_NF_CONNTRACK_EVENTS=y # CONFIG_NF_CONNTRACK_TIMEOUT is not set CONFIG_NF_CONNTRACK_TIMESTAMP=y +CONFIG_NF_CONNTRACK_LABELS=y CONFIG_NF_CT_PROTO_DCCP=m CONFIG_NF_CT_PROTO_GRE=m CONFIG_NF_CT_PROTO_SCTP=m @@ -674,6 +719,18 @@ CONFIG_NF_CONNTRACK_SIP=m CONFIG_NF_CONNTRACK_TFTP=m CONFIG_NF_CT_NETLINK=m # CONFIG_NF_CT_NETLINK_TIMEOUT is not set +CONFIG_NF_CT_NETLINK_HELPER=m +CONFIG_NETFILTER_NETLINK_QUEUE_CT=y +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PROTO_DCCP=m +CONFIG_NF_NAT_PROTO_UDPLITE=m +CONFIG_NF_NAT_PROTO_SCTP=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_TFTP=m CONFIG_NETFILTER_TPROXY=m CONFIG_NETFILTER_XTABLES=m @@ -694,13 +751,16 @@ CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m CONFIG_NETFILTER_XT_TARGET_CT=m CONFIG_NETFILTER_XT_TARGET_DSCP=m CONFIG_NETFILTER_XT_TARGET_HL=m +CONFIG_NETFILTER_XT_TARGET_HMARK=m CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m CONFIG_NETFILTER_XT_TARGET_LOG=m CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NETMAP=m CONFIG_NETFILTER_XT_TARGET_NFLOG=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_NOTRACK=m CONFIG_NETFILTER_XT_TARGET_RATEEST=m +CONFIG_NETFILTER_XT_TARGET_REDIRECT=m CONFIG_NETFILTER_XT_TARGET_TEE=m CONFIG_NETFILTER_XT_TARGET_TPROXY=m CONFIG_NETFILTER_XT_TARGET_TRACE=m @@ -712,9 +772,11 @@ CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m # Xtables matches # CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_BPF=m CONFIG_NETFILTER_XT_MATCH_CLUSTER=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m @@ -724,7 +786,6 @@ CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ECN=m CONFIG_NETFILTER_XT_MATCH_ESP=m -# CONFIG_NETFILTER_XT_MATCH_GRADM is not set CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m CONFIG_NETFILTER_XT_MATCH_HELPER=m CONFIG_NETFILTER_XT_MATCH_HL=m @@ -813,7 +874,6 @@ CONFIG_IP_VS_PE_SIP=m CONFIG_NF_DEFRAG_IPV4=m CONFIG_NF_CONNTRACK_IPV4=m CONFIG_NF_CONNTRACK_PROC_COMPAT=y -CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_AH=m CONFIG_IP_NF_MATCH_ECN=m @@ -822,23 +882,14 @@ CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_NF_NAT=m -CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_IPV4=m CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_NF_NAT_SNMP_BASIC=m -CONFIG_NF_NAT_PROTO_DCCP=m CONFIG_NF_NAT_PROTO_GRE=m -CONFIG_NF_NAT_PROTO_UDPLITE=m -CONFIG_NF_NAT_PROTO_SCTP=m -CONFIG_NF_NAT_FTP=m -CONFIG_NF_NAT_IRC=m -CONFIG_NF_NAT_TFTP=m -CONFIG_NF_NAT_AMANDA=m CONFIG_NF_NAT_PPTP=m CONFIG_NF_NAT_H323=m -CONFIG_NF_NAT_SIP=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_TARGET_ECN=m @@ -853,7 +904,6 @@ CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_NF_DEFRAG_IPV6=m CONFIG_NF_CONNTRACK_IPV6=m -CONFIG_IP6_NF_QUEUE=m CONFIG_IP6_NF_IPTABLES=m CONFIG_IP6_NF_MATCH_AH=m CONFIG_IP6_NF_MATCH_EUI64=m @@ -869,6 +919,9 @@ CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_REJECT=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_RAW=m +CONFIG_NF_NAT_IPV6=m +CONFIG_IP6_NF_TARGET_MASQUERADE=m +CONFIG_IP6_NF_TARGET_NPT=m # # DECnet: Netfilter Configuration @@ -900,7 +953,7 @@ CONFIG_IP_DCCP=m CONFIG_INET_DCCP_DIAG=m # -# DCCP CCIDs Configuration (EXPERIMENTAL) +# DCCP CCIDs Configuration # # CONFIG_IP_DCCP_CCID2_DEBUG is not set CONFIG_IP_DCCP_CCID3=y @@ -914,15 +967,16 @@ CONFIG_IP_DCCP_TFRC_LIB=y CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set -# CONFIG_SCTP_HMAC_NONE is not set -CONFIG_SCTP_HMAC_SHA1=y -# CONFIG_SCTP_HMAC_MD5 is not set +CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y +# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set +# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set +CONFIG_SCTP_COOKIE_HMAC_MD5=y +CONFIG_SCTP_COOKIE_HMAC_SHA1=y CONFIG_RDS=m # CONFIG_RDS_TCP is not set # CONFIG_RDS_DEBUG is not set CONFIG_TIPC=m -# CONFIG_TIPC_ADVANCED is not set -# CONFIG_TIPC_DEBUG is not set +CONFIG_TIPC_PORTS=8191 CONFIG_ATM=m CONFIG_ATM_CLIP=m # CONFIG_ATM_CLIP_NO_ICMP is not set @@ -936,11 +990,14 @@ CONFIG_L2TP_V3=y CONFIG_L2TP_IP=m CONFIG_L2TP_ETH=m CONFIG_STP=m +CONFIG_MRP=m CONFIG_BRIDGE=m CONFIG_BRIDGE_IGMP_SNOOPING=y -# CONFIG_NET_DSA is not set +CONFIG_BRIDGE_VLAN_FILTERING=y +CONFIG_HAVE_NET_DSA=y CONFIG_VLAN_8021Q=m # CONFIG_VLAN_8021Q_GVRP is not set +CONFIG_VLAN_8021Q_MVRP=y CONFIG_DECNET=m CONFIG_DECNET_ROUTER=y CONFIG_LLC=m @@ -954,10 +1011,10 @@ CONFIG_IPDDP_ENCAP=y CONFIG_IPDDP_DECAP=y CONFIG_X25=m CONFIG_LAPB=m -CONFIG_WAN_ROUTER=m CONFIG_PHONET=m CONFIG_IEEE802154=m CONFIG_IEEE802154_6LOWPAN=m +CONFIG_MAC802154=m CONFIG_NET_SCHED=y # @@ -981,6 +1038,8 @@ CONFIG_NET_SCH_DRR=m CONFIG_NET_SCH_MQPRIO=m CONFIG_NET_SCH_CHOKE=m CONFIG_NET_SCH_QFQ=m +CONFIG_NET_SCH_CODEL=m +CONFIG_NET_SCH_FQ_CODEL=m CONFIG_NET_SCH_INGRESS=m # CONFIG_NET_SCH_PLUG is not set @@ -1006,6 +1065,7 @@ CONFIG_NET_EMATCH_NBYTE=m CONFIG_NET_EMATCH_U32=m CONFIG_NET_EMATCH_META=m CONFIG_NET_EMATCH_TEXT=m +CONFIG_NET_EMATCH_IPSET=m CONFIG_NET_CLS_ACT=y CONFIG_NET_ACT_POLICE=m CONFIG_NET_ACT_GACT=m @@ -1023,13 +1083,13 @@ CONFIG_NET_SCH_FIFO=y CONFIG_DNS_RESOLVER=y # CONFIG_BATMAN_ADV is not set CONFIG_OPENVSWITCH=m +CONFIG_VSOCKETS=m +CONFIG_VMWARE_VMCI_VSOCKETS=m CONFIG_RPS=y CONFIG_RFS_ACCEL=y CONFIG_XPS=y CONFIG_NETPRIO_CGROUP=m CONFIG_BQL=y -CONFIG_HAVE_BPF_JIT=y -CONFIG_BPF_JIT=y # # Network testing @@ -1068,11 +1128,16 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=m # CONFIG_FIRMWARE_IN_KERNEL is not set CONFIG_EXTRA_FIRMWARE="" +# CONFIG_FW_LOADER_USER_HELPER is not set # CONFIG_DEBUG_DRIVER is not set # CONFIG_DEBUG_DEVRES is not set CONFIG_SYS_HYPERVISOR=y # CONFIG_GENERIC_CPU_DEVICES is not set CONFIG_DMA_SHARED_BUFFER=y + +# +# Bus devices +# CONFIG_CONNECTOR=m # CONFIG_MTD is not set CONFIG_PARPORT=m @@ -1108,7 +1173,6 @@ CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_NVME=m CONFIG_BLK_DEV_OSD=m # CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_UB is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_CDROM_PKTCDVD is not set CONFIG_ATA_OVER_ETH=m @@ -1117,6 +1181,7 @@ CONFIG_XEN_BLKDEV_FRONTEND=y CONFIG_VIRTIO_BLK=m # CONFIG_BLK_DEV_HD is not set CONFIG_BLK_DEV_RBD=m +# CONFIG_BLK_DEV_RSXX is not set # # Misc devices @@ -1129,6 +1194,7 @@ CONFIG_BLK_DEV_RBD=m # CONFIG_SGI_IOC4 is not set # CONFIG_TIFM_CORE is not set # CONFIG_ICS932S401 is not set +# CONFIG_ATMEL_SSC is not set # CONFIG_ENCLOSURE_SERVICES is not set # CONFIG_HP_ILO is not set # CONFIG_APDS9802ALS is not set @@ -1141,7 +1207,7 @@ CONFIG_BLK_DEV_RBD=m # CONFIG_HMC6352 is not set # CONFIG_DS1682 is not set CONFIG_VMWARE_BALLOON=m -# CONFIG_BMP085 is not set +# CONFIG_BMP085_I2C is not set # CONFIG_PCH_PHUB is not set # CONFIG_USB_SWITCH_FSA9480 is not set # CONFIG_C2PORT is not set @@ -1167,6 +1233,8 @@ CONFIG_TI_ST=m # Altera FPGA firmware download module # # CONFIG_ALTERA_STAPL is not set +# CONFIG_INTEL_MEI is not set +CONFIG_VMWARE_VMCI=m CONFIG_HAVE_IDE=y # CONFIG_IDE is not set @@ -1195,7 +1263,6 @@ CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set CONFIG_SCSI_SCAN_ASYNC=y -CONFIG_SCSI_WAIT_SCAN=m # # SCSI Transports @@ -1237,6 +1304,7 @@ CONFIG_ISCSI_BOOT_SYSFS=m # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_MPT3SAS is not set # CONFIG_SCSI_UFSHCD is not set # CONFIG_SCSI_HPTIOP is not set # CONFIG_SCSI_BUSLOGIC is not set @@ -1272,12 +1340,14 @@ CONFIG_SCSI_SYM53C8XX_MMIO=y # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # CONFIG_SCSI_PMCRAID is not set # CONFIG_SCSI_PM8001 is not set # CONFIG_SCSI_SRP is not set # CONFIG_SCSI_BFA_FC is not set CONFIG_SCSI_VIRTIO=m +# CONFIG_SCSI_CHELSIO_FCOE is not set CONFIG_SCSI_DH=m CONFIG_SCSI_DH_RDAC=m CONFIG_SCSI_DH_HP_SW=m @@ -1291,6 +1361,7 @@ CONFIG_ATA=y # CONFIG_ATA_NONSTANDARD is not set CONFIG_ATA_VERBOSE_ERROR=y CONFIG_ATA_ACPI=y +# CONFIG_SATA_ZPODD is not set CONFIG_SATA_PMP=y # @@ -1315,6 +1386,7 @@ CONFIG_ATA_BMDMA=y # SATA SFF controllers with BMDMA # CONFIG_ATA_PIIX=y +# CONFIG_SATA_HIGHBANK is not set # CONFIG_SATA_MV is not set # CONFIG_SATA_NV is not set # CONFIG_SATA_PROMISE is not set @@ -1337,6 +1409,7 @@ CONFIG_ATA_PIIX=y # CONFIG_PATA_CMD64X is not set # CONFIG_PATA_CS5520 is not set # CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5535 is not set # CONFIG_PATA_CS5536 is not set # CONFIG_PATA_CYPRESS is not set # CONFIG_PATA_EFAR is not set @@ -1391,18 +1464,20 @@ CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m CONFIG_MD_RAID456=m -# CONFIG_MULTICORE_RAID456 is not set CONFIG_MD_MULTIPATH=m CONFIG_MD_FAULTY=m CONFIG_BLK_DEV_DM=m # CONFIG_DM_DEBUG is not set CONFIG_DM_BUFIO=m +CONFIG_DM_BIO_PRISON=m CONFIG_DM_PERSISTENT_DATA=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_THIN_PROVISIONING=m # CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set -# CONFIG_DM_DEBUG_SPACE_MAPS is not set +CONFIG_DM_CACHE=m +CONFIG_DM_CACHE_MQ=m +CONFIG_DM_CACHE_CLEANER=m CONFIG_DM_MIRROR=m CONFIG_DM_RAID=m CONFIG_DM_LOG_USERSPACE=m @@ -1421,6 +1496,7 @@ CONFIG_TCM_PSCSI=m CONFIG_LOOPBACK_TARGET=m CONFIG_TCM_FC=m CONFIG_ISCSI_TARGET=m +# CONFIG_SBP_TARGET is not set CONFIG_FUSION=y CONFIG_FUSION_SPI=m CONFIG_FUSION_FC=m @@ -1455,13 +1531,15 @@ CONFIG_DUMMY=m CONFIG_EQUALIZER=m # CONFIG_NET_FC is not set CONFIG_MII=m -# CONFIG_IEEE802154_DRIVERS is not set CONFIG_IFB=m CONFIG_NET_TEAM=m +CONFIG_NET_TEAM_MODE_BROADCAST=m CONFIG_NET_TEAM_MODE_ROUNDROBIN=m CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m +CONFIG_NET_TEAM_MODE_LOADBALANCE=m CONFIG_MACVLAN=m CONFIG_MACVTAP=m +CONFIG_VXLAN=m CONFIG_NETCONSOLE=m CONFIG_NETCONSOLE_DYNAMIC=y CONFIG_NETPOLL=y @@ -1476,6 +1554,15 @@ CONFIG_VIRTIO_NET=m # # CAIF transport drivers # + +# +# Distributed Switch Architecture drivers +# +# CONFIG_NET_DSA_MV88E6XXX is not set +# CONFIG_NET_DSA_MV88E6060 is not set +# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +# CONFIG_NET_DSA_MV88E6131 is not set +# CONFIG_NET_DSA_MV88E6123_61_65 is not set CONFIG_ETHERNET=y # CONFIG_NET_VENDOR_3COM is not set # CONFIG_NET_VENDOR_ADAPTEC is not set @@ -1484,6 +1571,7 @@ CONFIG_NET_VENDOR_AMD=y # CONFIG_AMD8111_ETH is not set CONFIG_PCNET32=m # CONFIG_NET_VENDOR_ATHEROS is not set +# CONFIG_NET_CADENCE is not set # CONFIG_NET_VENDOR_BROADCOM is not set # CONFIG_NET_VENDOR_BROCADE is not set # CONFIG_NET_CALXEDA_XGMAC is not set @@ -1550,6 +1638,7 @@ CONFIG_R8169=m # CONFIG_NET_VENDOR_TEHUTI is not set # CONFIG_NET_VENDOR_TI is not set # CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_NET_SB1000 is not set @@ -1558,6 +1647,7 @@ CONFIG_PHYLIB=m # # MII PHY device drivers # +# CONFIG_AT803X_PHY is not set # CONFIG_AMD_PHY is not set CONFIG_MARVELL_PHY=m CONFIG_DAVICOM_PHY=m @@ -1567,6 +1657,7 @@ CONFIG_CICADA_PHY=m CONFIG_VITESSE_PHY=m CONFIG_SMSC_PHY=m CONFIG_BROADCOM_PHY=m +CONFIG_BCM87XX_PHY=m CONFIG_ICPLUS_PHY=m CONFIG_REALTEK_PHY=m CONFIG_NATIONAL_PHY=m @@ -1578,7 +1669,6 @@ CONFIG_MDIO_GPIO=m # CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set -# CONFIG_TR is not set # # USB Network Adapters @@ -1596,6 +1686,7 @@ CONFIG_MDIO_GPIO=m # Enable WiMAX (Networking options) to see the WiMAX drivers # # CONFIG_WAN is not set +# CONFIG_IEEE802154_DRIVERS is not set CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_XEN_NETDEV_BACKEND=m CONFIG_VMXNET3=m @@ -1609,6 +1700,7 @@ CONFIG_INPUT=y # CONFIG_INPUT_FF_MEMLESS is not set CONFIG_INPUT_POLLDEV=m CONFIG_INPUT_SPARSEKMAP=m +CONFIG_INPUT_MATRIXKMAP=m # # Userland interfaces @@ -1637,6 +1729,7 @@ CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_TCA8418 is not set # CONFIG_KEYBOARD_MATRIX is not set # CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_LM8333 is not set # CONFIG_KEYBOARD_MAX7359 is not set # CONFIG_KEYBOARD_MCS is not set # CONFIG_KEYBOARD_MPR121 is not set @@ -1644,13 +1737,13 @@ CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_OPENCORES is not set # CONFIG_KEYBOARD_STOWAWAY is not set # CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_OMAP4 is not set # CONFIG_KEYBOARD_XTKBD is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=m CONFIG_MOUSE_PS2_ALPS=y CONFIG_MOUSE_PS2_LOGIPS2PP=y CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_CYPRESS=y CONFIG_MOUSE_PS2_LIFEBOOK=y CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_PS2_ELANTECH is not set @@ -1659,6 +1752,7 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_APPLETOUCH is not set # CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_CYAPA is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_MOUSE_GPIO is not set # CONFIG_MOUSE_SYNAPTICS_I2C is not set @@ -1674,6 +1768,7 @@ CONFIG_INPUT_MISC=y # CONFIG_INPUT_APANEL is not set # CONFIG_INPUT_GP2A is not set # CONFIG_INPUT_GPIO_TILT_POLLED is not set +# CONFIG_INPUT_WISTRON_BTNS is not set # CONFIG_INPUT_ATLAS_BTNS is not set # CONFIG_INPUT_ATI_REMOTE2 is not set # CONFIG_INPUT_KEYSPAN_REMOTE is not set @@ -1701,11 +1796,13 @@ CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # CONFIG_SERIO_ALTERA_PS2 is not set # CONFIG_SERIO_PS2MULT is not set +# CONFIG_SERIO_ARC_PS2 is not set # CONFIG_GAMEPORT is not set # # Character devices # +CONFIG_TTY=y CONFIG_VT=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_VT_CONSOLE=y @@ -1724,10 +1821,12 @@ CONFIG_DEVPTS_MULTIPLE_INSTANCES=y # Serial drivers # CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set +CONFIG_SERIAL_8250_PNP=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_FIX_EARLYCON_MEM=y +CONFIG_SERIAL_8250_DMA=y CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_PNP=y CONFIG_SERIAL_8250_NR_UARTS=16 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 CONFIG_SERIAL_8250_EXTENDED=y @@ -1735,6 +1834,7 @@ CONFIG_SERIAL_8250_MANY_PORTS=y CONFIG_SERIAL_8250_SHARE_IRQ=y # CONFIG_SERIAL_8250_DETECT_IRQ is not set CONFIG_SERIAL_8250_RSA=y +# CONFIG_SERIAL_8250_DW is not set # # Non-8250 serial port support @@ -1743,13 +1843,15 @@ CONFIG_SERIAL_MFD_HSU=m CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_JSM=m +# CONFIG_SERIAL_SCCNXP is not set CONFIG_SERIAL_TIMBERDALE=m CONFIG_SERIAL_ALTERA_JTAGUART=m CONFIG_SERIAL_ALTERA_UART=m CONFIG_SERIAL_ALTERA_UART_MAXPORTS=4 CONFIG_SERIAL_ALTERA_UART_BAUDRATE=115200 CONFIG_SERIAL_PCH_UART=m -# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_SERIAL_ARC is not set +# CONFIG_SERIAL_RP2 is not set # CONFIG_TTY_PRINTK is not set CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set @@ -1764,19 +1866,23 @@ CONFIG_HW_RANDOM=m # CONFIG_HW_RANDOM_TIMERIOMEM is not set # CONFIG_HW_RANDOM_INTEL is not set # CONFIG_HW_RANDOM_AMD is not set +# CONFIG_HW_RANDOM_GEODE is not set # CONFIG_HW_RANDOM_VIA is not set CONFIG_HW_RANDOM_VIRTIO=m CONFIG_NVRAM=m # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set +# CONFIG_SONYPI is not set # CONFIG_MWAVE is not set +# CONFIG_SCx200_GPIO is not set +# CONFIG_PC8736x_GPIO is not set +# CONFIG_NSC_GPIO is not set # CONFIG_RAW_DRIVER is not set CONFIG_HPET=y CONFIG_HPET_MMAP=y CONFIG_HANGCHECK_TIMER=m # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set -# CONFIG_RAMOOPS is not set CONFIG_I2C=m CONFIG_I2C_BOARDINFO=y CONFIG_I2C_COMPAT=y @@ -1806,6 +1912,7 @@ CONFIG_I2C_ALGOBIT=m # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_ISCH is not set +# CONFIG_I2C_ISMT is not set CONFIG_I2C_PIIX4=m # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_SIS5595 is not set @@ -1822,6 +1929,7 @@ CONFIG_I2C_PIIX4=m # # I2C system bus drivers (mostly embedded / system-on-chip) # +# CONFIG_I2C_CBUS_GPIO is not set # CONFIG_I2C_DESIGNWARE_PCI is not set # CONFIG_I2C_EG20T is not set # CONFIG_I2C_GPIO is not set @@ -1844,6 +1952,7 @@ CONFIG_I2C_PIIX4=m # # Other I2C/SMBus bus drivers # +# CONFIG_SCx200_ACB is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set @@ -1863,12 +1972,13 @@ CONFIG_I2C_PIIX4=m # # PTP clock support # - -# -# Enable Device Drivers -> PPS to see the PTP clock options. -# +# CONFIG_PTP_1588_CLOCK is not set +# CONFIG_DP83640_PHY is not set +# CONFIG_PTP_1588_CLOCK_PCH is not set CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +CONFIG_GPIO_DEVRES=y CONFIG_GPIOLIB=y +CONFIG_GPIO_ACPI=y # CONFIG_DEBUG_GPIO is not set # CONFIG_GPIO_SYSFS is not set @@ -1877,8 +1987,11 @@ CONFIG_GPIOLIB=y # # CONFIG_GPIO_GENERIC_PLATFORM is not set # CONFIG_GPIO_IT8761E is not set +# CONFIG_GPIO_TS5500 is not set # CONFIG_GPIO_SCH is not set +# CONFIG_GPIO_ICH is not set # CONFIG_GPIO_VX855 is not set +# CONFIG_GPIO_LYNXPOINT is not set # # I2C GPIO expanders: @@ -1893,6 +2006,7 @@ CONFIG_GPIOLIB=y # PCI GPIO expanders: # # CONFIG_GPIO_BT8XX is not set +# CONFIG_GPIO_AMD8111 is not set # CONFIG_GPIO_LANGWELL is not set # CONFIG_GPIO_PCH is not set # CONFIG_GPIO_ML_IOH is not set @@ -1910,8 +2024,12 @@ CONFIG_GPIOLIB=y # # MODULbus GPIO expanders: # + +# +# USB GPIO expanders: +# # CONFIG_W1 is not set -CONFIG_POWER_SUPPLY=m +CONFIG_POWER_SUPPLY=y # CONFIG_POWER_SUPPLY_DEBUG is not set # CONFIG_PDA_POWER is not set # CONFIG_TEST_POWER is not set @@ -1925,7 +2043,11 @@ CONFIG_POWER_SUPPLY=m # CONFIG_CHARGER_MAX8903 is not set # CONFIG_CHARGER_LP8727 is not set # CONFIG_CHARGER_GPIO is not set +# CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_SMB347 is not set +# CONFIG_BATTERY_GOLDFISH is not set +# CONFIG_POWER_RESET is not set +# CONFIG_POWER_AVS is not set CONFIG_HWMON=m # CONFIG_HWMON_VID is not set # CONFIG_HWMON_DEBUG_CHIP is not set @@ -1943,6 +2065,7 @@ CONFIG_HWMON=m # CONFIG_SENSORS_ADM1029 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ADT7410 is not set # CONFIG_SENSORS_ADT7411 is not set # CONFIG_SENSORS_ADT7462 is not set # CONFIG_SENSORS_ADT7470 is not set @@ -1964,6 +2087,7 @@ CONFIG_HWMON=m # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_GL520SM is not set # CONFIG_SENSORS_GPIO_FAN is not set +# CONFIG_SENSORS_HIH6130 is not set # CONFIG_SENSORS_CORETEMP is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_JC42 is not set @@ -1989,9 +2113,11 @@ CONFIG_HWMON=m # CONFIG_SENSORS_MAX16065 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_MAX1668 is not set +# CONFIG_SENSORS_MAX197 is not set # CONFIG_SENSORS_MAX6639 is not set # CONFIG_SENSORS_MAX6642 is not set # CONFIG_SENSORS_MAX6650 is not set +# CONFIG_SENSORS_MAX6697 is not set # CONFIG_SENSORS_MCP3021 is not set # CONFIG_SENSORS_NTC_THERMISTOR is not set # CONFIG_SENSORS_PC87360 is not set @@ -2015,6 +2141,8 @@ CONFIG_HWMON=m # CONFIG_SENSORS_ADS1015 is not set # CONFIG_SENSORS_ADS7828 is not set # CONFIG_SENSORS_AMC6821 is not set +# CONFIG_SENSORS_INA209 is not set +# CONFIG_SENSORS_INA2XX is not set # CONFIG_SENSORS_THMC50 is not set # CONFIG_SENSORS_TMP102 is not set # CONFIG_SENSORS_TMP401 is not set @@ -2040,6 +2168,14 @@ CONFIG_HWMON=m CONFIG_SENSORS_ACPI_POWER=m # CONFIG_SENSORS_ATK0110 is not set CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +# CONFIG_THERMAL_GOV_FAIR_SHARE is not set +CONFIG_THERMAL_GOV_STEP_WISE=y +# CONFIG_THERMAL_GOV_USER_SPACE is not set +# CONFIG_THERMAL_EMULATION is not set +# CONFIG_INTEL_POWERCLAMP is not set CONFIG_WATCHDOG=y CONFIG_WATCHDOG_CORE=y # CONFIG_WATCHDOG_NOWAYOUT is not set @@ -2061,15 +2197,18 @@ CONFIG_WATCHDOG_CORE=y # CONFIG_IBMASR is not set # CONFIG_WAFER_WDT is not set CONFIG_I6300ESB_WDT=m +# CONFIG_IE6XX_WDT is not set # CONFIG_ITCO_WDT is not set # CONFIG_IT8712F_WDT is not set # CONFIG_IT87_WDT is not set # CONFIG_HP_WATCHDOG is not set # CONFIG_SC1200_WDT is not set +# CONFIG_SCx200_WDT is not set # CONFIG_PC87413_WDT is not set # CONFIG_NV_TCO is not set # CONFIG_60XX_WDT is not set # CONFIG_SBC8360_WDT is not set +# CONFIG_SBC7240_WDT is not set # CONFIG_CPU5_WDT is not set # CONFIG_SMSC_SCH311X_WDT is not set # CONFIG_SMSC37B787_WDT is not set @@ -2103,6 +2242,7 @@ CONFIG_SSB_PCIHOST_POSSIBLE=y # CONFIG_SSB_PCIHOST is not set # CONFIG_SSB_SILENT is not set # CONFIG_SSB_DEBUG is not set +# CONFIG_SSB_DRIVER_GPIO is not set CONFIG_BCMA_POSSIBLE=y # @@ -2115,23 +2255,30 @@ CONFIG_BCMA_POSSIBLE=y # CONFIG_MFD_CORE=m # CONFIG_MFD_SM501 is not set +# CONFIG_MFD_RTSX_PCI is not set +# CONFIG_MFD_TI_AM335X_TSCADC is not set # CONFIG_HTC_PASIC3 is not set # CONFIG_UCB1400_CORE is not set +# CONFIG_MFD_LM3533 is not set # CONFIG_TPS6105X is not set # CONFIG_TPS65010 is not set # CONFIG_TPS6507X is not set # CONFIG_MFD_TPS65217 is not set # CONFIG_MFD_TMIO is not set -# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_ARIZONA_I2C is not set # CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_MC13XXX_I2C is not set # CONFIG_ABX500_CORE is not set # CONFIG_MFD_CS5535 is not set # CONFIG_MFD_TIMBERDALE is not set # CONFIG_LPC_SCH is not set +# CONFIG_LPC_ICH is not set # CONFIG_MFD_RDC321X is not set # CONFIG_MFD_JANZ_CMODIO is not set # CONFIG_MFD_VX855 is not set CONFIG_MFD_WL1273_CORE=m +# CONFIG_MFD_VIPERBOARD is not set +# CONFIG_MFD_RETU is not set # CONFIG_REGULATOR is not set # CONFIG_MEDIA_SUPPORT is not set @@ -2139,27 +2286,34 @@ CONFIG_MFD_WL1273_CORE=m # Graphics support # CONFIG_AGP=m +# CONFIG_AGP_ALI is not set +# CONFIG_AGP_ATI is not set +# CONFIG_AGP_AMD is not set CONFIG_AGP_AMD64=m CONFIG_AGP_INTEL=m +# CONFIG_AGP_NVIDIA is not set CONFIG_AGP_SIS=m +# CONFIG_AGP_SWORKS is not set CONFIG_AGP_VIA=m +# CONFIG_AGP_EFFICEON is not set # CONFIG_VGA_ARB is not set # CONFIG_VGA_SWITCHEROO is not set CONFIG_DRM=m CONFIG_DRM_KMS_HELPER=m # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set CONFIG_DRM_TTM=m -CONFIG_DRM_TDFX=m -CONFIG_DRM_R128=m -CONFIG_DRM_RADEON=m -# CONFIG_DRM_RADEON_KMS is not set -# CONFIG_DRM_NOUVEAU is not set # # I2C encoder or helper chips # # CONFIG_DRM_I2C_CH7006 is not set CONFIG_DRM_I2C_SIL164=m +# CONFIG_DRM_I2C_NXP_TDA998X is not set +CONFIG_DRM_TDFX=m +CONFIG_DRM_R128=m +CONFIG_DRM_RADEON=m +# CONFIG_DRM_RADEON_UMS is not set +# CONFIG_DRM_NOUVEAU is not set CONFIG_DRM_I810=m CONFIG_DRM_I915=m # CONFIG_DRM_I915_KMS is not set @@ -2168,13 +2322,17 @@ CONFIG_DRM_SIS=m CONFIG_DRM_VIA=m CONFIG_DRM_SAVAGE=m CONFIG_DRM_VMWGFX=m +# CONFIG_DRM_VMWGFX_FBCON is not set CONFIG_DRM_GMA500=m CONFIG_DRM_GMA600=y CONFIG_DRM_GMA3600=y # CONFIG_DRM_UDL is not set -# CONFIG_STUB_POULSBO is not set +# CONFIG_DRM_AST is not set +CONFIG_DRM_MGAG200=m +CONFIG_DRM_CIRRUS_QEMU=m CONFIG_VGASTATE=m CONFIG_VIDEO_OUTPUT_CONTROL=m +CONFIG_HDMI=y CONFIG_FB=m # CONFIG_FIRMWARE_EDID is not set # CONFIG_FB_DDC is not set @@ -2211,6 +2369,7 @@ CONFIG_FB_UVESA=m # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_I740 is not set +# CONFIG_FB_I810 is not set # CONFIG_FB_LE80578 is not set # CONFIG_FB_INTEL is not set # CONFIG_FB_MATROX is not set @@ -2234,21 +2393,24 @@ CONFIG_FB_UVESA=m # CONFIG_FB_TMIO is not set # CONFIG_FB_SMSCUFX is not set # CONFIG_FB_UDL is not set +# CONFIG_FB_GOLDFISH is not set # CONFIG_FB_VIRTUAL is not set CONFIG_XEN_FBDEV_FRONTEND=m # CONFIG_FB_METRONOME is not set # CONFIG_FB_MB862XX is not set # CONFIG_FB_BROADSHEET is not set +# CONFIG_FB_AUO_K190X is not set # CONFIG_EXYNOS_VIDEO is not set CONFIG_BACKLIGHT_LCD_SUPPORT=y # CONFIG_LCD_CLASS_DEVICE is not set CONFIG_BACKLIGHT_CLASS_DEVICE=m # CONFIG_BACKLIGHT_GENERIC is not set -# CONFIG_BACKLIGHT_PROGEAR is not set # CONFIG_BACKLIGHT_APPLE is not set # CONFIG_BACKLIGHT_SAHARA is not set # CONFIG_BACKLIGHT_ADP8860 is not set # CONFIG_BACKLIGHT_ADP8870 is not set +# CONFIG_BACKLIGHT_LM3630 is not set +# CONFIG_BACKLIGHT_LM3639 is not set # CONFIG_BACKLIGHT_LP855X is not set # @@ -2360,7 +2522,6 @@ CONFIG_SND_HDA_INPUT_BEEP_MODE=0 CONFIG_SND_HDA_INPUT_JACK=y # CONFIG_SND_HDA_PATCH_LOADER is not set CONFIG_SND_HDA_CODEC_REALTEK=y -CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS=y CONFIG_SND_HDA_CODEC_ANALOG=y CONFIG_SND_HDA_CODEC_SIGMATEL=y CONFIG_SND_HDA_CODEC_VIA=y @@ -2369,10 +2530,11 @@ CONFIG_SND_HDA_CODEC_CIRRUS=y CONFIG_SND_HDA_CODEC_CONEXANT=y CONFIG_SND_HDA_CODEC_CA0110=y CONFIG_SND_HDA_CODEC_CA0132=y +# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set CONFIG_SND_HDA_CODEC_CMEDIA=y CONFIG_SND_HDA_CODEC_SI3054=y CONFIG_SND_HDA_GENERIC=y -# CONFIG_SND_HDA_POWER_SAVE is not set +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 # CONFIG_SND_HDSP is not set # CONFIG_SND_HDSPM is not set # CONFIG_SND_ICE1712 is not set @@ -2390,6 +2552,7 @@ CONFIG_SND_HDA_GENERIC=y # CONFIG_SND_RME32 is not set # CONFIG_SND_RME96 is not set # CONFIG_SND_RME9652 is not set +# CONFIG_SND_SIS7019 is not set # CONFIG_SND_SONICVIBES is not set # CONFIG_SND_TRIDENT is not set # CONFIG_SND_VIA82XX is not set @@ -2402,23 +2565,14 @@ CONFIG_SND_HDA_GENERIC=y # CONFIG_SND_SOC is not set # CONFIG_SOUND_PRIME is not set CONFIG_AC97_BUS=m -CONFIG_HID_SUPPORT=y -CONFIG_HID=m -# CONFIG_HID_BATTERY_STRENGTH is not set -CONFIG_HIDRAW=y - -# -# USB Input Devices -# -CONFIG_USB_HID=m -# CONFIG_HID_PID is not set -# CONFIG_USB_HIDDEV is not set # -# USB HID Boot Protocol drivers +# HID support # -CONFIG_USB_KBD=m -CONFIG_USB_MOUSE=m +CONFIG_HID=m +CONFIG_HIDRAW=y +CONFIG_UHID=m +CONFIG_HID_GENERIC=m # # Special HID drivers @@ -2426,6 +2580,7 @@ CONFIG_USB_MOUSE=m # CONFIG_HID_A4TECH is not set # CONFIG_HID_ACRUX is not set # CONFIG_HID_APPLE is not set +# CONFIG_HID_AUREAL is not set # CONFIG_HID_BELKIN is not set # CONFIG_HID_CHERRY is not set # CONFIG_HID_CHICONY is not set @@ -2443,6 +2598,7 @@ CONFIG_USB_MOUSE=m # CONFIG_HID_TWINHAN is not set # CONFIG_HID_KENSINGTON is not set # CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LENOVO_TPKBD is not set # CONFIG_HID_LOGITECH is not set # CONFIG_HID_MICROSOFT is not set # CONFIG_HID_MONTEREY is not set @@ -2458,15 +2614,36 @@ CONFIG_USB_MOUSE=m # CONFIG_HID_SAMSUNG is not set # CONFIG_HID_SONY is not set # CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_STEELSERIES is not set # CONFIG_HID_SUNPLUS is not set # CONFIG_HID_GREENASIA is not set CONFIG_HID_HYPERV_MOUSE=m # CONFIG_HID_SMARTJOYPLUS is not set # CONFIG_HID_TIVO is not set # CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THINGM is not set # CONFIG_HID_THRUSTMASTER is not set # CONFIG_HID_ZEROPLUS is not set # CONFIG_HID_ZYDACRON is not set +# CONFIG_HID_SENSOR_HUB is not set + +# +# USB HID support +# +CONFIG_USB_HID=m +# CONFIG_HID_PID is not set +# CONFIG_USB_HIDDEV is not set + +# +# USB HID Boot Protocol drivers +# +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m + +# +# I2C HID support +# +# CONFIG_I2C_HID is not set CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB_ARCH_HAS_EHCI=y CONFIG_USB_ARCH_HAS_XHCI=y @@ -2480,11 +2657,10 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y # # Miscellaneous USB options # -# CONFIG_USB_DEVICEFS is not set -# CONFIG_USB_DEVICE_CLASS is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG_WHITELIST is not set # CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_DWC3 is not set CONFIG_USB_MON=m # CONFIG_USB_WUSB_CBAF is not set @@ -2497,20 +2673,23 @@ CONFIG_USB_XHCI_HCD=m CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_ROOT_HUB_TT is not set # CONFIG_USB_EHCI_TT_NEWSCHED is not set +CONFIG_USB_EHCI_PCI=m # CONFIG_USB_OXU210HP_HCD is not set # CONFIG_USB_ISP116X_HCD is not set # CONFIG_USB_ISP1760_HCD is not set # CONFIG_USB_ISP1362_HCD is not set CONFIG_USB_OHCI_HCD=m CONFIG_USB_OHCI_HCD_SSB=y -# CONFIG_USB_OHCI_HCD_PLATFORM is not set -# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_OHCI_HCD_PLATFORM=y +CONFIG_USB_EHCI_HCD_PLATFORM=m # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=m # CONFIG_USB_SL811_HCD is not set # CONFIG_USB_R8A66597_HCD is not set +CONFIG_USB_HCD_SSB=m +# CONFIG_USB_CHIPIDEA is not set # # USB Device Class drivers @@ -2542,8 +2721,6 @@ CONFIG_USB_STORAGE_ONETOUCH=m CONFIG_USB_STORAGE_KARMA=m CONFIG_USB_STORAGE_CYPRESS_ATACB=m CONFIG_USB_STORAGE_ENE_UB6250=m -# CONFIG_USB_UAS is not set -CONFIG_USB_LIBUSUAL=y # # USB Imaging devices @@ -2580,6 +2757,16 @@ CONFIG_USB_LIBUSUAL=y # CONFIG_USB_TEST is not set # CONFIG_USB_ISIGHTFW is not set # CONFIG_USB_YUREX is not set +# CONFIG_USB_EZUSB_FX2 is not set +# CONFIG_USB_HSIC_USB3503 is not set + +# +# USB Physical Layer drivers +# +# CONFIG_OMAP_USB3 is not set +# CONFIG_OMAP_CONTROL_USB is not set +# CONFIG_USB_ISP1301 is not set +# CONFIG_USB_RCAR_PHY is not set # CONFIG_USB_ATM is not set # CONFIG_USB_GADGET is not set @@ -2598,6 +2785,7 @@ CONFIG_LEDS_CLASS=y # LED drivers # # CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_LM3642 is not set # CONFIG_LEDS_PCA9532 is not set # CONFIG_LEDS_GPIO is not set # CONFIG_LEDS_LP3944 is not set @@ -2610,7 +2798,9 @@ CONFIG_LEDS_CLASS=y # CONFIG_LEDS_INTEL_SS4200 is not set # CONFIG_LEDS_LT3593 is not set # CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_LM355x is not set # CONFIG_LEDS_OT200 is not set +# CONFIG_LEDS_BLINKM is not set # CONFIG_LEDS_TRIGGERS is not set # @@ -2622,6 +2812,7 @@ CONFIG_LEDS_CLASS=y CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_SYSTOHC=y CONFIG_RTC_HCTOSYS_DEVICE="rtc0" # CONFIG_RTC_DEBUG is not set @@ -2646,6 +2837,7 @@ CONFIG_RTC_DRV_RS5C372=m CONFIG_RTC_DRV_ISL1208=m # CONFIG_RTC_DRV_ISL12022 is not set CONFIG_RTC_DRV_X1205=m +# CONFIG_RTC_DRV_PCF8523 is not set CONFIG_RTC_DRV_PCF8563=m CONFIG_RTC_DRV_PCF8583=m CONFIG_RTC_DRV_M41T80=m @@ -2678,10 +2870,16 @@ CONFIG_RTC_DRV_MSM6242=m CONFIG_RTC_DRV_BQ4802=m CONFIG_RTC_DRV_RP5C01=m CONFIG_RTC_DRV_V3020=m +# CONFIG_RTC_DRV_DS2404 is not set # # on-CPU RTC drivers # + +# +# HID Sensor RTC drivers +# +# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set CONFIG_DMADEVICES=y # CONFIG_DMADEVICES_DEBUG is not set @@ -2690,6 +2888,7 @@ CONFIG_DMADEVICES=y # # CONFIG_INTEL_MID_DMAC is not set CONFIG_INTEL_IOATDMA=m +# CONFIG_DW_DMAC is not set CONFIG_TIMB_DMA=m CONFIG_PCH_DMA=m CONFIG_DMA_ENGINE=y @@ -2703,8 +2902,10 @@ CONFIG_NET_DMA=y CONFIG_DCA=m # CONFIG_AUXDISPLAY is not set # CONFIG_UIO is not set +CONFIG_VFIO_IOMMU_TYPE1=m +CONFIG_VFIO=m +CONFIG_VFIO_PCI=m CONFIG_VIRTIO=m -CONFIG_VIRTIO_RING=m # # Virtio drivers @@ -2712,19 +2913,20 @@ CONFIG_VIRTIO_RING=m CONFIG_VIRTIO_PCI=m CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_MMIO=m +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y # # Microsoft Hyper-V guest support # CONFIG_HYPERV=m CONFIG_HYPERV_UTILS=m +CONFIG_HYPERV_BALLOON=m # # Xen driver support # CONFIG_XEN_BALLOON=y CONFIG_XEN_SELFBALLOONING=y -CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y CONFIG_XEN_SCRUB_PAGES=y CONFIG_XEN_DEV_EVTCHN=m CONFIG_XEN_BACKEND=y @@ -2738,6 +2940,7 @@ CONFIG_SWIOTLB_XEN=y CONFIG_XEN_TMEM=y CONFIG_XEN_PCIDEV_BACKEND=m CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_HAVE_PVMMU=y CONFIG_STAGING=y # CONFIG_ET131X is not set # CONFIG_SLICOSS is not set @@ -2746,16 +2949,11 @@ CONFIG_STAGING=y # CONFIG_COMEDI is not set # CONFIG_ASUS_OLED is not set # CONFIG_PANEL is not set -# CONFIG_RTS_PSTOR is not set # CONFIG_RTS5139 is not set # CONFIG_TRANZPORT is not set # CONFIG_IDE_PHISON is not set # CONFIG_LINE6_USB is not set -# CONFIG_VME_BUS is not set # CONFIG_DX_SEP is not set -# CONFIG_IIO is not set -# CONFIG_ZRAM is not set -# CONFIG_ZCACHE is not set # CONFIG_ZSMALLOC is not set # CONFIG_FB_SM7XX is not set # CONFIG_CRYSTALHD is not set @@ -2771,40 +2969,50 @@ CONFIG_STAGING=y # CONFIG_SPEAKUP is not set # CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set # CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set -# CONFIG_INTEL_MEI is not set # CONFIG_STAGING_MEDIA is not set # # Android # # CONFIG_ANDROID is not set -# CONFIG_PHONE is not set # CONFIG_USB_WPAN_HCD is not set +# CONFIG_WIMAX_GDM72XX is not set +# CONFIG_NET_VENDOR_SILICOM is not set +# CONFIG_CED1401 is not set +# CONFIG_DGRP is not set +# CONFIG_FIREWIRE_SERIAL is not set # CONFIG_X86_PLATFORM_DEVICES is not set # # Hardware Spinlock drivers # +CONFIG_CLKSRC_I8253=y CONFIG_CLKEVT_I8253=y CONFIG_CLKBLD_I8253=y +# CONFIG_MAILBOX is not set CONFIG_IOMMU_API=y CONFIG_IOMMU_SUPPORT=y -# CONFIG_AMD_IOMMU is not set CONFIG_DMAR_TABLE=y CONFIG_INTEL_IOMMU=y # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set CONFIG_INTEL_IOMMU_FLOPPY_WA=y -# CONFIG_IRQ_REMAP is not set # -# Remoteproc drivers (EXPERIMENTAL) +# Remoteproc drivers # +# CONFIG_STE_MODEM_RPROC is not set # -# Rpmsg drivers (EXPERIMENTAL) +# Rpmsg drivers # CONFIG_VIRT_DRIVERS=y # CONFIG_PM_DEVFREQ is not set +# CONFIG_EXTCON is not set +CONFIG_MEMORY=y +# CONFIG_IIO is not set +# CONFIG_VME_BUS is not set +# CONFIG_PWM is not set +# CONFIG_IPACK_BUS is not set # # Firmware Drivers @@ -2833,7 +3041,6 @@ CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_EXT4_FS=m -CONFIG_EXT4_FS_XATTR=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y # CONFIG_EXT4_DEBUG is not set @@ -2886,7 +3093,6 @@ CONFIG_QUOTA_TREE=m CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_QUOTACTL=y -CONFIG_QUOTACTL_COMPAT=y CONFIG_AUTOFS4_FS=m CONFIG_FUSE_FS=m # CONFIG_CUSE is not set @@ -2941,6 +3147,7 @@ CONFIG_MISC_FILESYSTEMS=y # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set CONFIG_ECRYPT_FS=m +# CONFIG_ECRYPT_FS_MESSAGING is not set CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m # CONFIG_BEFS_FS is not set @@ -2966,18 +3173,26 @@ CONFIG_ROMFS_FS=m CONFIG_ROMFS_BACKED_BY_BLOCK=y CONFIG_ROMFS_ON_BLOCK=y CONFIG_PSTORE=y +# CONFIG_PSTORE_CONSOLE is not set +CONFIG_PSTORE_RAM=m CONFIG_SYSV_FS=m CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set # CONFIG_UFS_DEBUG is not set CONFIG_EXOFS_FS=m # CONFIG_EXOFS_DEBUG is not set +CONFIG_F2FS_FS=m +CONFIG_F2FS_STAT_FS=y +CONFIG_F2FS_FS_XATTR=y +CONFIG_F2FS_FS_POSIX_ACL=y CONFIG_ORE=m CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NFS_FS=m -CONFIG_NFS_V3=y +CONFIG_NFS_V2=m +CONFIG_NFS_V3=m # CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y +CONFIG_NFS_V4=m +CONFIG_NFS_SWAP=y # CONFIG_NFS_V4_1 is not set # CONFIG_NFS_FSCACHE is not set # CONFIG_NFS_USE_LEGACY_DNS is not set @@ -2992,6 +3207,7 @@ CONFIG_LOCKD_V4=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m +CONFIG_SUNRPC_SWAP=y CONFIG_RPCSEC_GSS_KRB5=m # CONFIG_SUNRPC_DEBUG is not set CONFIG_CEPH_FS=m @@ -3001,10 +3217,12 @@ CONFIG_CIFS=m # CONFIG_CIFS_UPCALL is not set CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y +CONFIG_CIFS_ACL=y +CONFIG_CIFS_DEBUG=y # CONFIG_CIFS_DEBUG2 is not set CONFIG_CIFS_DFS_UPCALL=y +CONFIG_CIFS_SMB2=y # CONFIG_CIFS_FSCACHE is not set -CONFIG_CIFS_ACL=y # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -3050,6 +3268,17 @@ CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m +CONFIG_NLS_MAC_ROMAN=m +CONFIG_NLS_MAC_CELTIC=m +CONFIG_NLS_MAC_CENTEURO=m +CONFIG_NLS_MAC_CROATIAN=m +CONFIG_NLS_MAC_CYRILLIC=m +CONFIG_NLS_MAC_GAELIC=m +CONFIG_NLS_MAC_GREEK=m +CONFIG_NLS_MAC_ICELAND=m +CONFIG_NLS_MAC_INUIT=m +CONFIG_NLS_MAC_ROMANIAN=m +CONFIG_NLS_MAC_TURKISH=m CONFIG_NLS_UTF8=m CONFIG_DLM=m # CONFIG_DLM_DEBUG is not set @@ -3065,6 +3294,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y CONFIG_FRAME_WARN=1024 CONFIG_MAGIC_SYSRQ=y # CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_READABLE_ASM is not set # CONFIG_UNUSED_SYMBOLS is not set CONFIG_DEBUG_FS=y # CONFIG_HEADERS_CHECK is not set @@ -3077,12 +3307,15 @@ CONFIG_HARDLOCKUP_DETECTOR=y CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0 # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 # CONFIG_DETECT_HUNG_TASK is not set CONFIG_SCHED_DEBUG=y CONFIG_SCHEDSTATS=y CONFIG_TIMER_STATS=y # CONFIG_DEBUG_OBJECTS is not set # CONFIG_SLUB_STATS is not set +CONFIG_HAVE_DEBUG_KMEMLEAK=y # CONFIG_DEBUG_KMEMLEAK is not set # CONFIG_DEBUG_RT_MUTEXES is not set # CONFIG_RT_MUTEX_TESTER is not set @@ -3090,13 +3323,13 @@ CONFIG_TIMER_STATS=y # CONFIG_DEBUG_MUTEXES is not set # CONFIG_DEBUG_LOCK_ALLOC is not set # CONFIG_PROVE_LOCKING is not set -# CONFIG_SPARSE_RCU_POINTER is not set # CONFIG_LOCK_STAT is not set # CONFIG_DEBUG_ATOMIC_SLEEP is not set # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set CONFIG_STACKTRACE=y # CONFIG_DEBUG_STACK_USAGE is not set # CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_HIGHMEM is not set CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_VM is not set @@ -3111,6 +3344,11 @@ CONFIG_DEBUG_BUGVERBOSE=y CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_FRAME_POINTER=y # CONFIG_BOOT_PRINTK_DELAY is not set + +# +# RCU Debugging +# +# CONFIG_SPARSE_RCU_POINTER is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_RCU_CPU_STALL_INFO is not set @@ -3120,7 +3358,7 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set # CONFIG_DEBUG_PER_CPU_MAPS is not set # CONFIG_LKDTM is not set -# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set # CONFIG_FAULT_INJECTION is not set CONFIG_LATENCYTOP=y # CONFIG_DEBUG_PAGEALLOC is not set @@ -3130,13 +3368,14 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_TRACING_SUPPORT=y # CONFIG_FTRACE is not set -# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set -# CONFIG_FIREWIRE_OHCI_REMOTE_DMA is not set +# CONFIG_RBTREE_TEST is not set +# CONFIG_INTERVAL_TREE_TEST is not set # CONFIG_DYNAMIC_DEBUG is not set # CONFIG_DMA_API_DEBUG is not set # CONFIG_ATOMIC64_SELFTEST is not set @@ -3152,7 +3391,7 @@ CONFIG_STRICT_DEVMEM=y CONFIG_DEBUG_STACKOVERFLOW=y # CONFIG_X86_PTDUMP is not set CONFIG_DEBUG_NX_TEST=m -# CONFIG_IOMMU_DEBUG is not set +CONFIG_DOUBLEFAULT=y # CONFIG_IOMMU_STRESS is not set CONFIG_HAVE_MMIOTRACE_SUPPORT=y CONFIG_IO_DELAY_TYPE_0X80=0 @@ -3177,7 +3416,8 @@ CONFIG_DEBUG_NMI_SELFTEST=y # # Grsecurity # -CONFIG_TASK_SIZE_MAX_SHIFT=47 +CONFIG_ARCH_TRACK_EXEC_LIMIT=y +CONFIG_PAX_USERCOPY_SLABS=y CONFIG_GRKERNSEC=y # CONFIG_GRKERNSEC_CONFIG_AUTO is not set CONFIG_GRKERNSEC_CONFIG_CUSTOM=y @@ -3208,6 +3448,7 @@ CONFIG_PAX_HAVE_ACL_FLAGS=y # CONFIG_PAX_NOEXEC=y CONFIG_PAX_PAGEEXEC=y +CONFIG_PAX_SEGMEXEC=y CONFIG_PAX_EMUTRAMP=y CONFIG_PAX_MPROTECT=y # CONFIG_PAX_MPROTECT_COMPAT is not set @@ -3227,8 +3468,10 @@ CONFIG_PAX_RANDMMAP=y # # CONFIG_PAX_MEMORY_SANITIZE is not set # CONFIG_PAX_MEMORY_STACKLEAK is not set +CONFIG_PAX_MEMORY_STRUCTLEAK=y CONFIG_PAX_REFCOUNT=y -# CONFIG_PAX_USERCOPY is not set +CONFIG_PAX_USERCOPY=y +# CONFIG_PAX_USERCOPY_DEBUG is not set # CONFIG_PAX_SIZE_OVERFLOW is not set # CONFIG_PAX_LATENT_ENTROPY is not set @@ -3236,6 +3479,7 @@ CONFIG_PAX_REFCOUNT=y # Memory Protections # CONFIG_GRKERNSEC_KMEM=y +# CONFIG_GRKERNSEC_VM86 is not set # CONFIG_GRKERNSEC_IO is not set CONFIG_GRKERNSEC_PROC_MEMMAP=y # CONFIG_GRKERNSEC_BRUTE is not set @@ -3246,8 +3490,8 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y # # Role Based Access Control Options # -# CONFIG_GRKERNSEC_NO_RBAC is not set -# CONFIG_GRKERNSEC_ACL_HIDEKERN is not set +CONFIG_GRKERNSEC_NO_RBAC=y +CONFIG_GRKERNSEC_ACL_HIDEKERN=y CONFIG_GRKERNSEC_ACL_MAXTRIES=3 CONFIG_GRKERNSEC_ACL_TIMEOUT=30 @@ -3263,6 +3507,7 @@ CONFIG_GRKERNSEC_LINK=y CONFIG_GRKERNSEC_FIFO=y CONFIG_GRKERNSEC_SYSFS_RESTRICT=y # CONFIG_GRKERNSEC_ROFS is not set +CONFIG_GRKERNSEC_DEVICE_SIDECHANNEL=y CONFIG_GRKERNSEC_CHROOT=y CONFIG_GRKERNSEC_CHROOT_MOUNT=y CONFIG_GRKERNSEC_CHROOT_DOUBLE=y @@ -3309,6 +3554,7 @@ CONFIG_GRKERNSEC_SETXID=y # CONFIG_GRKERNSEC_RANDNET=y # CONFIG_GRKERNSEC_BLACKHOLE is not set +CONFIG_GRKERNSEC_NO_SIMULT_CONNECT=y # CONFIG_GRKERNSEC_SOCKET is not set # @@ -3367,6 +3613,8 @@ CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CRYPTO_CRYPTD=m CONFIG_CRYPTO_AUTHENC=m CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_ABLK_HELPER_X86=m +CONFIG_CRYPTO_GLUE_HELPER_X86=m # # Authenticated Encryption with Associated Data @@ -3398,6 +3646,8 @@ CONFIG_CRYPTO_VMAC=m # CONFIG_CRYPTO_CRC32C=m CONFIG_CRYPTO_CRC32C_INTEL=m +CONFIG_CRYPTO_CRC32=m +# CONFIG_CRYPTO_CRC32_PCLMUL is not set CONFIG_CRYPTO_GHASH=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=y @@ -3407,17 +3657,15 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA1=m -CONFIG_CRYPTO_SHA1_SSSE3=m CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m -CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m # # Ciphers # -CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_AES=y CONFIG_CRYPTO_AES_X86_64=m CONFIG_CRYPTO_AES_NI_INTEL=m CONFIG_CRYPTO_ANUBIS=m @@ -3427,8 +3675,11 @@ CONFIG_CRYPTO_BLOWFISH_COMMON=m CONFIG_CRYPTO_BLOWFISH_X86_64=m CONFIG_CRYPTO_CAMELLIA=m CONFIG_CRYPTO_CAMELLIA_X86_64=m +CONFIG_CRYPTO_CAST_COMMON=m CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST5_AVX_X86_64=m CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_CAST6_AVX_X86_64=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_FCRYPT=m CONFIG_CRYPTO_KHAZAD=m @@ -3437,11 +3688,13 @@ CONFIG_CRYPTO_SALSA20_X86_64=m CONFIG_CRYPTO_SEED=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m +CONFIG_CRYPTO_SERPENT_AVX_X86_64=m CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_TWOFISH_COMMON=m CONFIG_CRYPTO_TWOFISH_X86_64=m CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m +CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m # # Compression @@ -3461,10 +3714,17 @@ CONFIG_CRYPTO_HW=y CONFIG_CRYPTO_DEV_PADLOCK=m CONFIG_CRYPTO_DEV_PADLOCK_AES=m CONFIG_CRYPTO_DEV_PADLOCK_SHA=m +CONFIG_CRYPTO_DEV_GEODE=m +CONFIG_ASYMMETRIC_KEY_TYPE=m +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m +CONFIG_PUBLIC_KEY_ALGO_RSA=m +CONFIG_X509_CERTIFICATE_PARSER=m CONFIG_HAVE_KVM=y CONFIG_VIRTUALIZATION=y # CONFIG_KVM is not set # CONFIG_VHOST_NET is not set +# CONFIG_TCM_VHOST is not set +# CONFIG_LGUEST is not set # CONFIG_BINARY_PRINTF is not set # @@ -3472,6 +3732,8 @@ CONFIG_VIRTUALIZATION=y # CONFIG_RAID6_PQ=m CONFIG_BITREVERSE=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_FIND_FIRST_BIT=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_IOMAP=y @@ -3504,6 +3766,9 @@ CONFIG_XZ_DEC_BCJ=y # CONFIG_XZ_DEC_TEST is not set CONFIG_DECOMPRESS_GZIP=y CONFIG_DECOMPRESS_XZ=y +CONFIG_REED_SOLOMON=m +CONFIG_REED_SOLOMON_ENC8=y +CONFIG_REED_SOLOMON_DEC8=y CONFIG_TEXTSEARCH=y CONFIG_TEXTSEARCH_KMP=m CONFIG_TEXTSEARCH_BM=m @@ -3515,6 +3780,11 @@ CONFIG_HAS_DMA=y CONFIG_CPU_RMAP=y CONFIG_DQL=y CONFIG_NLATTR=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y CONFIG_LRU_CACHE=m CONFIG_AVERAGE=y +CONFIG_CLZ_TAB=y CONFIG_CORDIC=m +CONFIG_DDR=y +CONFIG_MPILIB=m +CONFIG_OID_REGISTRY=m diff --git a/testing/linux-virt-grsec/leds-leds-gpio-reserve-gpio-before-using-it.patch b/testing/linux-virt-grsec/leds-leds-gpio-reserve-gpio-before-using-it.patch new file mode 100644 index 0000000000..f7af3b2a07 --- /dev/null +++ b/testing/linux-virt-grsec/leds-leds-gpio-reserve-gpio-before-using-it.patch @@ -0,0 +1,114 @@ +From 37e3042c345024aa5e39a1a28a667a00b75fd6ce Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> +Date: Fri, 17 May 2013 09:31:13 +0300 +Subject: [PATCH] leds: leds-gpio: reserve gpio before using it +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit a99d76f (leds: leds-gpio: use gpio_request_one) +and commit 2d7c22f (leds: leds-gpio: set devm_gpio_request_one() +flags param correctly) which was a fix of the first one. + +The conversion to devm_gpio_request in commit e3b1d44c (leds: +leds-gpio: use devm_gpio_request_one) is not reverted. + +The problem is that gpio_cansleep() and gpio_get_value_cansleep() +calls can crash if the gpio is not first reserved. Incidentally this +same bug existed earlier and was fixed similarly in commit d95cbe61 +(leds: Fix potential leds-gpio oops). But the OOPS is real. It happens +when GPIOs are provided by module which is not yet loaded. + +So this fixes the following BUG during my ALIX boot (3.9.2-vanilla): + +BUG: unable to handle kernel NULL pointer dereference at 0000004c +IP: [<c11287d6>] __gpio_cansleep+0xe/0x1a +*pde = 00000000 +Oops: 0000 [#1] SMP +Modules linked in: leds_gpio(+) via_rhine mii cs5535_mfd mfd_core +geode_rng rng_core geode_aes isofs nls_utf8 nls_cp437 vfat fat +ata_generic pata_amd pata_cs5536 pata_acpi libata ehci_pci ehci_hcd +ohci_hcd usb_storage usbcore usb_common sd_mod scsi_mod squashfs loop +Pid: 881, comm: modprobe Not tainted 3.9.2 #1-Alpine +EIP: 0060:[<c11287d6>] EFLAGS: 00010282 CPU: 0 +EIP is at __gpio_cansleep+0xe/0x1a +EAX: 00000000 EBX: cf364018 ECX: c132b8b9 EDX: 00000000 +ESI: c13993a4 EDI: c1399370 EBP: cded9dbc ESP: cded9dbc + DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 +CR0: 8005003b CR2: 0000004c CR3: 0f0c4000 CR4: 00000090 +DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 +DR6: ffff0ff0 DR7: 00000400 +Process modprobe (pid: 881, ti=cded8000 task=cf094aa0 task.ti=cded8000) +Stack: + cded9de0 d09471cb 00000000 c1399260 cf364014 00000000 c1399260 c1399254 + d0949014 cded9df4 c118cd59 c1399260 d0949014 d0949014 cded9e08 c118ba47 + c1399260 d0949014 c1399294 cded9e1c c118bb75 cded9e24 d0949014 00000000 +Call Trace: + [<d09471cb>] gpio_led_probe+0xba/0x203 [leds_gpio] + [<c118cd59>] platform_drv_probe+0x26/0x48 + [<c118ba47>] driver_probe_device+0x75/0x15c + [<c118bb75>] __driver_attach+0x47/0x63 + [<c118a727>] bus_for_each_dev+0x3c/0x66 + [<c118b6f9>] driver_attach+0x14/0x16 + [<c118bb2e>] ? driver_probe_device+0x15c/0x15c + [<c118b3d5>] bus_add_driver+0xbd/0x1bc + [<d08b4000>] ? 0xd08b3fff + [<d08b4000>] ? 0xd08b3fff + [<c118bffc>] driver_register+0x74/0xec + [<d08b4000>] ? 0xd08b3fff + [<c118c8e8>] platform_driver_register+0x38/0x3a + [<d08b400d>] gpio_led_driver_init+0xd/0x1000 [leds_gpio] + [<c100116c>] do_one_initcall+0x6b/0x10f + [<d08b4000>] ? 0xd08b3fff + [<c105e918>] load_module+0x1631/0x1907 + [<c10975d6>] ? insert_vmalloc_vmlist+0x14/0x43 + [<c1098d5b>] ? __vmalloc_node_range+0x13e/0x15f + [<c105ec50>] sys_init_module+0x62/0x77 + [<c1257888>] syscall_call+0x7/0xb +EIP: [<c11287d6>] __gpio_cansleep+0xe/0x1a SS:ESP 0068:cded9dbc +CR2: 000000000000004c + ---[ end trace 5308fb20d2514822 ]--- + +Signed-off-by: Timo Teräs <timo.teras@iki.f> +Cc: Jingoo Han <jg1.han@samsung.com> +Cc: Sachin Kamat <sachin.kamat@linaro.org> +Cc: Raphael Assenat <raph@8d.com> +Cc: Trent Piepho <tpiepho@freescale.com> +Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk> +Cc: Arnaud Patard <arnaud.patard@rtp-net.org> +Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> +--- + drivers/leds/leds-gpio.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c +index a0d931b..b02b679 100644 +--- a/drivers/leds/leds-gpio.c ++++ b/drivers/leds/leds-gpio.c +@@ -107,6 +107,10 @@ static int create_gpio_led(const struct gpio_led *template, + return 0; + } + ++ ret = devm_gpio_request(parent, template->gpio, template->name); ++ if (ret < 0) ++ return ret; ++ + led_dat->cdev.name = template->name; + led_dat->cdev.default_trigger = template->default_trigger; + led_dat->gpio = template->gpio; +@@ -126,10 +130,7 @@ static int create_gpio_led(const struct gpio_led *template, + if (!template->retain_state_suspended) + led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME; + +- ret = devm_gpio_request_one(parent, template->gpio, +- (led_dat->active_low ^ state) ? +- GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, +- template->name); ++ ret = gpio_direction_output(led_dat->gpio, led_dat->active_low ^ state); + if (ret < 0) + return ret; + +-- +1.8.2.3 + + diff --git a/testing/linux-virt-grsec/pax-out-of-tree-workaround.patch b/testing/linux-virt-grsec/pax-out-of-tree-workaround.patch deleted file mode 100644 index f83ca09492..0000000000 --- a/testing/linux-virt-grsec/pax-out-of-tree-workaround.patch +++ /dev/null @@ -1,18 +0,0 @@ -The overflow plugin needed the hunk below but it broke out-of-tree builds -Since we don't use the overflow plugin we revert it. - -diff --git a/Makefile b/Makefile -index 073f74f..b379941 100644 ---- a/Makefile -+++ b/Makefile -@@ -357,8 +358,8 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage - - # Use LINUXINCLUDE when you must reference the include/ directory. - # Needed to be compatible with the O= option --LINUXINCLUDE := -isystem arch/$(hdr-arch)/include \ -- -isystem arch/$(hdr-arch)/include/generated -isystem include \ -+LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \ -+ -Iarch/$(hdr-arch)/include/generated -Iinclude \ - $(if $(KBUILD_SRC), -I$(srctree)/include) \ - -include $(srctree)/include/linux/kconfig.h - diff --git a/testing/linux-virt-grsec/v2-net-next-arp-flush-arp-cache-on-IFF_NOARP-change.patch b/testing/linux-virt-grsec/v2-net-next-arp-flush-arp-cache-on-IFF_NOARP-change.patch new file mode 100644 index 0000000000..0fdafec17e --- /dev/null +++ b/testing/linux-virt-grsec/v2-net-next-arp-flush-arp-cache-on-IFF_NOARP-change.patch @@ -0,0 +1,89 @@ +From patchwork Tue May 21 10:23:44 2013 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: [v2,net-next] arp: flush arp cache on IFF_NOARP change +Date: Tue, 21 May 2013 00:23:44 -0000 +From: =?utf-8?q?Timo_Ter=C3=A4s?= <timo.teras@iki.fi> +X-Patchwork-Id: 245256 +Message-Id: <1369131824-6318-1-git-send-email-timo.teras@iki.fi> +To: David Miller <davem@davemloft.net>, netdev@vger.kernel.org, kaber@trash.net +Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> + +IFF_NOARP affects what kind of neighbor entries are created +(nud NOARP or nud INCOMPLETE). If the flag changes, flush the arp +cache to refresh all entries. + +Signed-off-by: Timo Teräs <timo.teras@iki.fi> + +--- +> This patch makes no sense at all. +> +> The state bit in ->priv_flags is a boolean stating whether the +> notified should do something or not. +> +> But you're setting it to match what IFF_NOARP is. +> +> You should set it any time IFF_NOARP _changes_, and then clear +> the bit when the notifier clears the neighbour entries. + +IFF_NOARP_CHANGED is set according to "changes = dev->flags ^ old_flags;" +which reflect the change. But I agree that the clearing out bit was +misplaced. This is especially true as it seems NETDEV_CHANGE can be +notified from another place too. + +I've updated the if.h comment to state that the bit is valid only during +NETDEV_CHANGE notifier. And __dev_notify_flags is updated to always clear +the bit after notifiers are done. + + include/uapi/linux/if.h | 2 ++ + net/core/dev.c | 6 +++++- + net/ipv4/arp.c | 4 ++++ + 3 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h +index 1ec407b..1be8b35 100644 +--- a/include/uapi/linux/if.h ++++ b/include/uapi/linux/if.h +@@ -83,6 +83,8 @@ + #define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */ + #define IFF_LIVE_ADDR_CHANGE 0x100000 /* device supports hardware address + * change when it's running */ ++#define IFF_NOARP_CHANGED 0x200000 /* Set during NETDEV_CHANGE notifier ++ * if IFF_NOARP has changed */ + + + #define IF_GET_IFACE 0x0001 /* for querying only */ +diff --git a/net/core/dev.c b/net/core/dev.c +index 18e9730..ce30761 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -4699,8 +4699,12 @@ void __dev_notify_flags(struct net_device *dev, unsigned int old_flags) + } + + if (dev->flags & IFF_UP && +- (changes & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI | IFF_VOLATILE))) ++ (changes & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI | IFF_VOLATILE))) { ++ if (changes & IFF_NOARP) ++ dev->priv_flags |= IFF_NOARP_CHANGED; + call_netdevice_notifiers(NETDEV_CHANGE, dev); ++ dev->priv_flags &= ~IFF_NOARP_CHANGED; ++ } + } + + /** +diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c +index 247ec19..375b2f2 100644 +--- a/net/ipv4/arp.c ++++ b/net/ipv4/arp.c +@@ -1241,6 +1241,10 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event, + neigh_changeaddr(&arp_tbl, dev); + rt_cache_flush(dev_net(dev)); + break; ++ case NETDEV_CHANGE: ++ if (dev->priv_flags & IFF_NOARP_CHANGED) ++ neigh_changeaddr(&arp_tbl, dev); ++ break; + default: + break; + } diff --git a/testing/linux-virt-grsec/xen-xsave.patch b/testing/linux-virt-grsec/xen-xsave.patch deleted file mode 100644 index e172d27b1d..0000000000 --- a/testing/linux-virt-grsec/xen-xsave.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ./arch/x86/xen/enlighten.c.orig -+++ ./arch/x86/xen/enlighten.c -@@ -805,6 +805,7 @@ - { - cr4 &= ~X86_CR4_PGE; - cr4 &= ~X86_CR4_PSE; -+ cr4 &= ~X86_CR4_OSXSAVE; - - native_write_cr4(cr4); - } |