aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-grsec
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-01-24 12:08:07 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-01-24 15:06:09 +0000
commit441cf9f59a263ca7f85b96ec71f0d50b5e223be5 (patch)
tree238d57847db69d5069ff27a1be69d8ad8e06e128 /main/linux-grsec
parent04dd0f555be6ee54c06d08db0516fbccc8a5d8d7 (diff)
downloadaports-441cf9f59a263ca7f85b96ec71f0d50b5e223be5.tar.bz2
aports-441cf9f59a263ca7f85b96ec71f0d50b5e223be5.tar.xz
main/linux-grsec: upgrade to 3.2.1 and update config
- set utf8 as default charset for filesystem NLS and FAT - enable xattr for squashfs - enable latencytop - disable IOMega ZIP drives - disable PCMCIA SCSI drivers - disable CAN subsystem - disable CAIF sysbsystem - disable Power Supply drivers - disable Voltage and regulators - disable Dallas 1-wire support
Diffstat (limited to 'main/linux-grsec')
-rw-r--r--main/linux-grsec/0001-ip_gre-dont-increase-dev-needed_headroom-on-a-live-d.patch50
-rw-r--r--main/linux-grsec/APKBUILD22
-rw-r--r--main/linux-grsec/grsec-timblogiw-noconst.patch13
-rw-r--r--main/linux-grsec/grsecurity-2.2.2-3.2.1-201201221501.patch (renamed from main/linux-grsec/grsecurity-2.2.2-3.0.17-unofficial.patch)17855
-rw-r--r--main/linux-grsec/kernelconfig.x86974
-rw-r--r--main/linux-grsec/kernelconfig.x86_641004
-rw-r--r--main/linux-grsec/net-flow-remove-sleeping-and-deferral-mechanism-from-flow_cache_flush.patch85
7 files changed, 9409 insertions, 10594 deletions
diff --git a/main/linux-grsec/0001-ip_gre-dont-increase-dev-needed_headroom-on-a-live-d.patch b/main/linux-grsec/0001-ip_gre-dont-increase-dev-needed_headroom-on-a-live-d.patch
deleted file mode 100644
index d43160f1fa..0000000000
--- a/main/linux-grsec/0001-ip_gre-dont-increase-dev-needed_headroom-on-a-live-d.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 113ab386c7d6625cff284fb10952ff69a58c18a4 Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <eric.dumazet@gmail.com>
-Date: Fri, 14 Oct 2011 04:57:46 +0000
-Subject: [PATCH] ip_gre: dont increase dev->needed_headroom on a live device
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-It seems ip_gre is able to change dev->needed_headroom on the fly.
-
-Its is not legal unfortunately and triggers a BUG in raw_sendmsg()
-
-skb = sock_alloc_send_skb(sk, ... + LL_ALLOCATED_SPACE(rt->dst.dev)
-
-< another cpu change dev->needed_headromm (making it bigger)
-
-...
-skb_reserve(skb, LL_RESERVED_SPACE(rt->dst.dev));
-
-We end with LL_RESERVED_SPACE() being bigger than LL_ALLOCATED_SPACE()
--> we crash later because skb head is exhausted.
-
-Bug introduced in commit 243aad83 in 2.6.34 (ip_gre: include route
-header_len in max_headroom calculation)
-
-Reported-by: Elmar Vonlanthen <evonlanthen@gmail.com>
-Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
-CC: Timo Teräs <timo.teras@iki.fi>
-CC: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- net/ipv4/ip_gre.c | 2 --
- 1 files changed, 0 insertions(+), 2 deletions(-)
-
-diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
-index d7bb94c..d55110e 100644
---- a/net/ipv4/ip_gre.c
-+++ b/net/ipv4/ip_gre.c
-@@ -835,8 +835,6 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
- if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
- (skb_cloned(skb) && !skb_clone_writable(skb, 0))) {
- struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom);
-- if (max_headroom > dev->needed_headroom)
-- dev->needed_headroom = max_headroom;
- if (!new_skb) {
- ip_rt_put(rt);
- dev->stats.tx_dropped++;
---
-1.7.7
-
diff --git a/main/linux-grsec/APKBUILD b/main/linux-grsec/APKBUILD
index 986a2341f4..8ef503f326 100644
--- a/main/linux-grsec/APKBUILD
+++ b/main/linux-grsec/APKBUILD
@@ -2,8 +2,8 @@
_flavor=grsec
pkgname=linux-${_flavor}
-pkgver=3.0.17
-_kernver=3.0
+pkgver=3.2.1
+_kernver=3.2
pkgrel=0
pkgdesc="Linux kernel with grsecurity"
url=http://grsecurity.net
@@ -14,15 +14,12 @@ _config=${config:-kernelconfig.${CARCH}}
install=
source="ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-$_kernver.tar.bz2
ftp://ftp.kernel.org/pub/linux/kernel/v3.0/patch-$pkgver.bz2
- grsecurity-2.2.2-$pkgver-unofficial.patch
- grsec-timblogiw-noconst.patch
+ grsecurity-2.2.2-3.2.1-201201221501.patch
- 0001-ip_gre-dont-increase-dev-needed_headroom-on-a-live-d.patch
0004-arp-flush-arp-cache-on-device-change.patch
x86-centaur-enable-cx8-for-via-eden-too.patch
linux-3.0.x-regression-with-ipv4-routes-having-mtu.patch
- net-flow-remove-sleeping-and-deferral-mechanism-from-flow_cache_flush.patch
kernelconfig.x86
kernelconfig.x86_64
@@ -142,14 +139,11 @@ dev() {
"$subpkgdir"/lib/modules/${_abi_release}/build
}
-md5sums="398e95866794def22b12dfbc15ce89c0 linux-3.0.tar.bz2
-8beef6d04bfa8b26446378682b332cfe patch-3.0.17.bz2
-3c0fcf923a27a963ae86a3e694cb6bbd grsecurity-2.2.2-3.0.17-unofficial.patch
-c41cf0ee9794f393423c6b2093072260 grsec-timblogiw-noconst.patch
-ebb99ef6ad8cd2d9fd8f49d5c5849057 0001-ip_gre-dont-increase-dev-needed_headroom-on-a-live-d.patch
+md5sums="7ceb61f87c097fc17509844b71268935 linux-3.2.tar.bz2
+31fc34340f11118873463a1d59d47b7f patch-3.2.1.bz2
+2248338d08df062a843a0b601064e781 grsecurity-2.2.2-3.2.1-201201221501.patch
776adeeb5272093574f8836c5037dd7d 0004-arp-flush-arp-cache-on-device-change.patch
f3eda7112ef074a4121ec6de943c63ee x86-centaur-enable-cx8-for-via-eden-too.patch
62cc7d7b5ba7ef05b72ff91c0411c189 linux-3.0.x-regression-with-ipv4-routes-having-mtu.patch
-b25335e8fcbf8c969230d55ac4e75cf8 net-flow-remove-sleeping-and-deferral-mechanism-from-flow_cache_flush.patch
-587b1fb2f6a5c9ba714900b856f57f09 kernelconfig.x86
-99836ffe918bbdef7da1a56a3d075c7a kernelconfig.x86_64"
+c21699aa138e209cd889582c2ef80e61 kernelconfig.x86
+af26ec54258f5cde5fa41c434abae34e kernelconfig.x86_64"
diff --git a/main/linux-grsec/grsec-timblogiw-noconst.patch b/main/linux-grsec/grsec-timblogiw-noconst.patch
deleted file mode 100644
index 0f402aca93..0000000000
--- a/main/linux-grsec/grsec-timblogiw-noconst.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c
-index 45ccd26..8a0916d 100644
---- a/drivers/media/video/timblogiw.c
-+++ b/drivers/media/video/timblogiw.c
-@@ -767,7 +767,7 @@ static __devinitconst v4l2_ioctl_ops_no_const timblogiw_ioctl_ops = {
- .vidioc_enum_framesizes = timblogiw_enum_framesizes,
- };
-
--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,
diff --git a/main/linux-grsec/grsecurity-2.2.2-3.0.17-unofficial.patch b/main/linux-grsec/grsecurity-2.2.2-3.2.1-201201221501.patch
index c4c0b6ef42..ff965370cf 100644
--- a/main/linux-grsec/grsecurity-2.2.2-3.0.17-unofficial.patch
+++ b/main/linux-grsec/grsecurity-2.2.2-3.2.1-201201221501.patch
@@ -1,5 +1,5 @@
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
-index dfa6fc6..cdef560 100644
+index dfa6fc6..0095943 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -5,6 +5,7 @@
@@ -10,7 +10,15 @@ index dfa6fc6..cdef560 100644
*.dsp
*.dvi
*.elf
-@@ -48,9 +49,11 @@
+@@ -14,6 +15,7 @@
+ *.gcov
+ *.gen.S
+ *.gif
++*.gmo
+ *.grep
+ *.grp
+ *.gz
+@@ -48,9 +50,11 @@
*.tab.h
*.tex
*.ver
@@ -22,7 +30,7 @@ index dfa6fc6..cdef560 100644
*_vga16.c
*~
\#*#
-@@ -70,6 +73,7 @@ Kerntypes
+@@ -70,6 +74,7 @@ Kerntypes
Module.markers
Module.symvers
PENDING
@@ -30,7 +38,13 @@ index dfa6fc6..cdef560 100644
SCCS
System.map*
TAGS
-@@ -98,14 +102,18 @@ bzImage*
+@@ -93,19 +98,24 @@ bounds.h
+ bsetup
+ btfixupprep
+ build
++builtin-policy.h
+ bvmlinux
+ bzImage*
capability_names.h
capflags.c
classlist.h*
@@ -49,7 +63,15 @@ index dfa6fc6..cdef560 100644
conmakehash
consolemap_deftbl.c*
cpustr.h
-@@ -126,12 +134,14 @@ fore200e_pca_fw.c*
+@@ -119,6 +129,7 @@ dslm
+ elf2ecoff
+ elfconfig.h*
+ evergreen_reg_safe.h
++exception_policy.conf
+ fixdep
+ flask.h
+ fore200e_mkfirm
+@@ -126,12 +137,15 @@ fore200e_pca_fw.c*
gconf
gconf.glade.h
gen-devlist
@@ -61,10 +83,11 @@ index dfa6fc6..cdef560 100644
genksyms
*_gray256.c
+hash
++hid-example
hpet_example
hugepage-mmap
hugepage-shm
-@@ -146,7 +156,7 @@ int32.c
+@@ -146,7 +160,7 @@ int32.c
int4.c
int8.c
kallsyms
@@ -73,7 +96,7 @@ index dfa6fc6..cdef560 100644
keywords.c
ksym.c*
ksym.h*
-@@ -154,7 +164,6 @@ kxgettext
+@@ -154,7 +168,6 @@ kxgettext
lkc_defs.h
lex.c
lex.*.c
@@ -81,15 +104,16 @@ index dfa6fc6..cdef560 100644
logo_*.c
logo_*_clut224.c
logo_*_mono.c
-@@ -166,7 +175,6 @@ machtypes.h
+@@ -166,14 +179,15 @@ machtypes.h
map
map_hugetlb
maui_boot.h
-media
mconf
++mdp
miboot*
mk_elfconfig
-@@ -174,6 +182,7 @@ mkboot
+ mkboot
mkbugboot
mkcpustr
mkdep
@@ -97,7 +121,7 @@ index dfa6fc6..cdef560 100644
mkprep
mkregtable
mktables
-@@ -209,6 +218,7 @@ r300_reg_safe.h
+@@ -209,6 +223,7 @@ r300_reg_safe.h
r420_reg_safe.h
r600_reg_safe.h
recordmcount
@@ -105,7 +129,7 @@ index dfa6fc6..cdef560 100644
relocs
rlim_names.h
rn50_reg_safe.h
-@@ -219,6 +229,7 @@ setup
+@@ -219,6 +234,7 @@ setup
setup.bin
setup.elf
sImage
@@ -113,7 +137,7 @@ index dfa6fc6..cdef560 100644
sm_tbl*
split-include
syscalltab.h
-@@ -229,6 +240,7 @@ tftpboot.img
+@@ -229,6 +245,7 @@ tftpboot.img
timeconst.h
times.h*
trix_boot.h
@@ -121,7 +145,7 @@ index dfa6fc6..cdef560 100644
utsrelease.h*
vdso-syms.lds
vdso.lds
-@@ -246,7 +258,9 @@ vmlinux
+@@ -246,7 +263,9 @@ vmlinux
vmlinux-*
vmlinux.aout
vmlinux.bin.all
@@ -131,7 +155,7 @@ index dfa6fc6..cdef560 100644
vmlinuz
voffset.h
vsyscall.lds
-@@ -254,6 +268,7 @@ vsyscall_32.lds
+@@ -254,9 +273,11 @@ vsyscall_32.lds
wanxlfw.inc
uImage
unifdef
@@ -139,11 +163,15 @@ index dfa6fc6..cdef560 100644
wakeup.bin
wakeup.elf
wakeup.lds
+ zImage*
+ zconf.hash.c
++zconf.lex.c
+ zoffset.h
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index aa47be7..1fbd18f 100644
+index 81c287f..d456d02 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
-@@ -1883,6 +1883,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -1935,6 +1935,13 @@ 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.
@@ -158,7 +186,7 @@ index aa47be7..1fbd18f 100644
pcd. [PARIDE]
diff --git a/Makefile b/Makefile
-index f4f577b..9e9b120 100644
+index c5edffa..26654d7 100644
--- a/Makefile
+++ b/Makefile
@@ -245,8 +245,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -168,25 +196,12 @@ index f4f577b..9e9b120 100644
-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
-+HOSTCFLAGS += $(call cc-option, -Wno-empty-body)
-+HOSTCXXFLAGS = -O2 -fno-delete-null-pointer-checks
++HOSTCLFAGS += $(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.
-@@ -365,10 +366,12 @@ LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \
- KBUILD_CPPFLAGS := -D__KERNEL__
-
- KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-+ -W -Wno-unused-parameter -Wno-missing-field-initializers \
- -fno-strict-aliasing -fno-common \
- -Werror-implicit-function-declaration \
- -Wno-format-security \
- -fno-delete-null-pointer-checks
-+KBUILD_CFLAGS += $(call cc-option, -Wno-empty-body)
- KBUILD_AFLAGS_KERNEL :=
- KBUILD_CFLAGS_KERNEL :=
- KBUILD_AFLAGS := -D__ASSEMBLY__
-@@ -407,8 +410,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exc
+@@ -407,8 +408,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exc
# Rules shared between *config targets and build targets
# Basic helpers built in scripts/
@@ -197,20 +212,25 @@ index f4f577b..9e9b120 100644
$(Q)$(MAKE) $(build)=scripts/basic
$(Q)rm -f .tmp_quiet_recordmcount
-@@ -564,6 +567,36 @@ else
+@@ -564,6 +565,46 @@ else
KBUILD_CFLAGS += -O2
endif
++ifndef DISABLE_PAX_PLUGINS
+ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(CC)"), y)
++ifndef DISABLE_PAX_CONSTIFY_PLUGIN
+CONSTIFY_PLUGIN := -fplugin=$(objtree)/tools/gcc/constify_plugin.so -DCONSTIFY_PLUGIN
++endif
+ifdef CONFIG_PAX_MEMORY_STACKLEAK
-+STACKLEAK_PLUGIN := -fplugin=$(objtree)/tools/gcc/stackleak_plugin.so -fplugin-arg-stackleak_plugin-track-lowest-sp=100
++STACKLEAK_PLUGIN := -fplugin=$(objtree)/tools/gcc/stackleak_plugin.so -DSTACKLEAK_PLUGIN
++STACKLEAK_PLUGIN += -fplugin-arg-stackleak_plugin-track-lowest-sp=100
+endif
+ifdef CONFIG_KALLOCSTAT_PLUGIN
+KALLOCSTAT_PLUGIN := -fplugin=$(objtree)/tools/gcc/kallocstat_plugin.so
+endif
+ifdef CONFIG_PAX_KERNEXEC_PLUGIN
+KERNEXEC_PLUGIN := -fplugin=$(objtree)/tools/gcc/kernexec_plugin.so
++KERNEXEC_PLUGIN += -fplugin-arg-kernexec_plugin-method=$(CONFIG_PAX_KERNEXEC_PLUGIN_METHOD)
+endif
+ifdef CONFIG_CHECKER_PLUGIN
+ifeq ($(call cc-ifversion, -ge, 0406, y), y)
@@ -219,22 +239,27 @@ index f4f577b..9e9b120 100644
+endif
+GCC_PLUGINS := $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) $(KALLOCSTAT_PLUGIN) $(KERNEXEC_PLUGIN) $(CHECKER_PLUGIN)
+export CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN CHECKER_PLUGIN
++ifeq ($(KBUILD_EXTMOD),)
+gcc-plugins:
+ $(Q)$(MAKE) $(build)=tools/gcc
+else
++gcc-plugins: ;
++endif
++else
+gcc-plugins:
+ifeq ($(call cc-ifversion, -ge, 0405, y), y)
-+ $(error Your gcc installation does not support plugins. If the necessary headers for plugin support are missing, they should be installed. On Debian, apt-get install gcc-<ver>-plugin-dev.))
++ $(error Your gcc installation does not support plugins. If the necessary headers for plugin support are missing, they should be installed. On Debian, apt-get install gcc-<ver>-plugin-dev. If you choose to ignore this error and lessen the improvements provided by this patch, re-run make with the DISABLE_PAX_PLUGINS=y argument.))
+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 constification will be less secure"
++ $(Q)echo "PAX_MEMORY_STACKLEAK and other features will be less secure"
++endif
+endif
+
include $(srctree)/arch/$(SRCARCH)/Makefile
ifneq ($(CONFIG_FRAME_WARN),0)
-@@ -708,7 +741,7 @@ export mod_strip_cmd
+@@ -708,7 +749,7 @@ export mod_strip_cmd
ifeq ($(KBUILD_EXTMOD),)
@@ -243,7 +268,7 @@ index f4f577b..9e9b120 100644
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-@@ -932,6 +965,7 @@ vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE
+@@ -932,6 +973,7 @@ vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
@@ -251,7 +276,7 @@ index f4f577b..9e9b120 100644
$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
# Handle descending into subdirectories listed in $(vmlinux-dirs)
-@@ -941,7 +975,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
+@@ -941,7 +983,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
# Error messages still appears in the original language
PHONY += $(vmlinux-dirs)
@@ -260,15 +285,15 @@ index f4f577b..9e9b120 100644
$(Q)$(MAKE) $(build)=$@
# Store (new) KERNELRELASE string in include/config/kernel.release
-@@ -986,6 +1020,7 @@ prepare0: archprepare FORCE
- $(Q)$(MAKE) $(build)=. missing-syscalls
+@@ -985,6 +1027,7 @@ prepare0: archprepare FORCE
+ $(Q)$(MAKE) $(build)=.
# All the preparing..
+prepare: KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS),$(KBUILD_CFLAGS))
prepare: prepare0
# Generate some files
-@@ -1087,6 +1122,7 @@ all: modules
+@@ -1086,6 +1129,7 @@ all: modules
# using awk while concatenating to the final file.
PHONY += modules
@@ -276,7 +301,7 @@ index f4f577b..9e9b120 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.';
-@@ -1102,7 +1138,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+@@ -1101,7 +1145,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
# Target to prepare building external modules
PHONY += modules_prepare
@@ -285,16 +310,15 @@ index f4f577b..9e9b120 100644
# Target to install modules
PHONY += modules_install
-@@ -1198,7 +1234,7 @@ distclean: mrproper
- @find $(srctree) $(RCS_FIND_IGNORE) \
+@@ -1198,6 +1242,7 @@ distclean: mrproper
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-- -o -name '.*.rej' -o -size 0 \
-+ -o -name '.*.rej' -o -name '*.so' -o -size 0 \
+ -o -name '.*.rej' \
++ -o -name '.*.rej' -o -name '*.so' \
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-type f -print | xargs rm -f
-@@ -1359,6 +1395,7 @@ PHONY += $(module-dirs) modules
+@@ -1358,6 +1403,7 @@ PHONY += $(module-dirs) modules
$(module-dirs): crmodverdir $(objtree)/Module.symvers
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
@@ -302,7 +326,7 @@ index f4f577b..9e9b120 100644
modules: $(module-dirs)
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1485,17 +1522,19 @@ else
+@@ -1484,17 +1530,19 @@ else
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif
@@ -326,7 +350,7 @@ index f4f577b..9e9b120 100644
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.symtypes: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-@@ -1505,11 +1544,13 @@ endif
+@@ -1504,11 +1552,13 @@ endif
$(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir)
@@ -383,10 +407,10 @@ index de98a73..bd4f1f8 100644
#define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x))
diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
-index ebc3c89..20cfa63 100644
+index 2fd00b7..cfd5069 100644
--- a/arch/alpha/kernel/module.c
+++ b/arch/alpha/kernel/module.c
-@@ -182,7 +182,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
+@@ -160,7 +160,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
/* The small sections were sorted to the end of the segment.
The following should definitely cover them. */
@@ -396,10 +420,10 @@ index ebc3c89..20cfa63 100644
for (i = 0; i < n; i++) {
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
-index 326f0a2..baed83e 100644
+index 01e8715..be0e80f 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
-@@ -1145,7 +1145,7 @@ arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
+@@ -1147,7 +1147,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;
@@ -408,7 +432,7 @@ index 326f0a2..baed83e 100644
return addr;
addr = vma->vm_end;
vma = vma->vm_next;
-@@ -1181,6 +1181,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -1183,6 +1183,10 @@ 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? */
@@ -419,7 +443,7 @@ index 326f0a2..baed83e 100644
if (addr) {
addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
if (addr != (unsigned long) -ENOMEM)
-@@ -1188,8 +1192,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -1190,8 +1194,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
}
/* Next, try allocating at TASK_UNMAPPED_BASE. */
@@ -431,7 +455,7 @@ index 326f0a2..baed83e 100644
return addr;
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
-index fadd5f8..3168191 100644
+index fadd5f8..904e73a 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -54,6 +54,124 @@ __load_new_mm_context(struct mm_struct *next_mm)
@@ -541,7 +565,7 @@ index fadd5f8..3168191 100644
+ return 1;
+}
+
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ unsigned long i;
+
@@ -590,6 +614,25 @@ index fadd5f8..3168191 100644
} else if (!cause) {
/* Allow reads even for write-only mappings */
if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
+diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
+index 86976d0..8a57797 100644
+--- a/arch/arm/include/asm/atomic.h
++++ b/arch/arm/include/asm/atomic.h
+@@ -239,6 +239,14 @@ typedef struct {
+ u64 __aligned(8) counter;
+ } atomic64_t;
+
++#ifdef CONFIG_PAX_REFCOUNT
++typedef struct {
++ u64 __aligned(8) counter;
++} atomic64_unchecked_t;
++#else
++typedef atomic64_t atomic64_unchecked_t;
++#endif
++
+ #define ATOMIC64_INIT(i) { (i) }
+
+ static inline u64 atomic64_read(atomic64_t *v)
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
index 0e9ce8d..6ef1e03 100644
--- a/arch/arm/include/asm/elf.h
@@ -693,10 +736,10 @@ index b293616..96310e5 100644
n = __copy_to_user(to, from, n);
return n;
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
-index acca35a..f7debc1 100644
+index 5b0bce6..becd81c 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
-@@ -98,8 +98,8 @@ EXPORT_SYMBOL(__strncpy_from_user);
+@@ -95,8 +95,8 @@ EXPORT_SYMBOL(__strncpy_from_user);
#ifdef CONFIG_MMU
EXPORT_SYMBOL(copy_page);
@@ -708,7 +751,7 @@ index acca35a..f7debc1 100644
EXPORT_SYMBOL(__get_user_1);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
-index 74ae833..8749ecb 100644
+index 3d0c6fb..3dcae52 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -28,7 +28,6 @@
@@ -717,9 +760,9 @@ index 74ae833..8749ecb 100644
#include <linux/uaccess.h>
-#include <linux/random.h>
#include <linux/hw_breakpoint.h>
+ #include <linux/cpuidle.h>
- #include <asm/cacheflush.h>
-@@ -482,12 +481,6 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -484,12 +483,6 @@ unsigned long get_wchan(struct task_struct *p)
return 0;
}
@@ -733,19 +776,19 @@ index 74ae833..8749ecb 100644
/*
* The vectors page is always readable from user space for the
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
-index 6807cb1..552fd48 100644
+index 99a5727..a3d5bb1 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
-@@ -257,6 +257,8 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
+@@ -259,6 +259,8 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
- static DEFINE_SPINLOCK(die_lock);
+ static DEFINE_RAW_SPINLOCK(die_lock);
+extern void gr_handle_kernel_exploit(void);
+
/*
* This function is protected against re-entrancy.
*/
-@@ -284,6 +286,9 @@ void die(const char *str, struct pt_regs *regs, int err)
+@@ -288,6 +290,9 @@ void die(const char *str, struct pt_regs *regs, int err)
panic("Fatal exception in interrupt");
if (panic_on_oops)
panic("Fatal exception");
@@ -867,10 +910,10 @@ index d0ece2a..5ae2f39 100644
.pushsection .fixup,"ax"
.align 0
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
-index 8b9b136..70d5100 100644
+index 025f742..8432b08 100644
--- a/arch/arm/lib/uaccess_with_memcpy.c
+++ b/arch/arm/lib/uaccess_with_memcpy.c
-@@ -103,7 +103,7 @@ out:
+@@ -104,7 +104,7 @@ out:
}
unsigned long
@@ -893,10 +936,10 @@ index 2b2d51c..0127490 100644
static int mbox_show(struct seq_file *s, void *data)
{
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
-index bc0e1d8..9f27107 100644
+index aa33949..b242a2f 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
-@@ -182,6 +182,13 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
+@@ -183,6 +183,13 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
}
#endif
@@ -910,12 +953,12 @@ index bc0e1d8..9f27107 100644
tsk->thread.address = addr;
tsk->thread.error_code = fsr;
tsk->thread.trap_no = 14;
-@@ -379,6 +386,33 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
+@@ -384,6 +391,33 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
}
#endif /* CONFIG_MMU */
+#ifdef CONFIG_PAX_PAGEEXEC
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ long i;
+
@@ -945,10 +988,10 @@ index bc0e1d8..9f27107 100644
* First Level Translation Fault Handler
*
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
-index 74be05f..f605b8c 100644
+index 44b628e..623ee2a 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
-@@ -65,6 +65,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -54,6 +54,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
if (len > TASK_SIZE)
return -ENOMEM;
@@ -959,7 +1002,7 @@ index 74be05f..f605b8c 100644
if (addr) {
if (do_align)
addr = COLOUR_ALIGN(addr, pgoff);
-@@ -72,15 +76,14 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -61,15 +65,14 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
@@ -979,7 +1022,7 @@ index 74be05f..f605b8c 100644
}
/* 8 bits of randomness in 20 address space bits */
if ((current->flags & PF_RANDOMIZE) &&
-@@ -100,14 +103,14 @@ full_search:
+@@ -89,14 +92,14 @@ full_search:
* Start a new search - just in case we missed
* some holes.
*/
@@ -1032,7 +1075,7 @@ index b7f5c68..556135c 100644
#undef D
diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c
-index f7040a1..16169bf 100644
+index f7040a1..db9f300 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)
@@ -1040,7 +1083,7 @@ index f7040a1..16169bf 100644
int exception_trace = 1;
+#ifdef CONFIG_PAX_PAGEEXEC
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ unsigned long i;
+
@@ -1170,7 +1213,7 @@ index 1a97af3..7529d31 100644
#define PAGE_KERNEL __pgprot(__DIRTY_BITS | _PAGE_PL_0 | _PAGE_AR_RWX)
#define PAGE_KERNELRX __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_RX)
diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h
-index 1a91c91..120e693 100644
+index b77768d..e0795eb 100644
--- a/arch/ia64/include/asm/spinlock.h
+++ b/arch/ia64/include/asm/spinlock.h
@@ -72,7 +72,7 @@ static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock)
@@ -1205,10 +1248,10 @@ index 449c8c0..432a3d2 100644
__cu_len; \
})
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
-index 1481b0a..e7d38ff 100644
+index 24603be..948052d 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
-@@ -315,8 +315,7 @@ module_alloc (unsigned long size)
+@@ -307,8 +307,7 @@ plt_target (struct plt_entry *plt)
void
module_free (struct module *mod, void *module_region)
{
@@ -1218,7 +1261,7 @@ index 1481b0a..e7d38ff 100644
unw_remove_unwind_table(mod->arch.init_unw_table);
mod->arch.init_unw_table = NULL;
}
-@@ -502,15 +501,39 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
+@@ -494,15 +493,39 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
}
static inline int
@@ -1260,7 +1303,7 @@ index 1481b0a..e7d38ff 100644
}
static inline int
-@@ -693,7 +716,14 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
+@@ -685,7 +708,14 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
break;
case RV_BDREL:
@@ -1276,7 +1319,7 @@ index 1481b0a..e7d38ff 100644
break;
case RV_LTV:
-@@ -828,15 +858,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
+@@ -820,15 +850,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
* addresses have been selected...
*/
uint64_t gp;
@@ -1346,7 +1389,7 @@ index 53c0ba0..2accdde 100644
* ensure percpu data fits
* into percpu page size
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
-index 20b3593..58762be 100644
+index 20b3593..1ce77f0 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -73,6 +73,23 @@ mapped_kernel_page_is_present (unsigned long address)
@@ -1354,7 +1397,7 @@ index 20b3593..58762be 100644
}
+#ifdef CONFIG_PAX_PAGEEXEC
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ unsigned long i;
+
@@ -1546,10 +1589,10 @@ index ff44823..97f8906 100644
/*
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
-index d2112d3..142ad93 100644
+index c47f96e..661d418 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
-@@ -473,15 +473,3 @@ unsigned long get_wchan(struct task_struct *task)
+@@ -481,15 +481,3 @@ unsigned long get_wchan(struct task_struct *task)
out:
return pc;
}
@@ -1566,7 +1609,7 @@ index d2112d3..142ad93 100644
- return sp & ALMASK;
-}
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
-index 137ee76..1bc42da 100644
+index 937cf33..adb39bb 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -28,6 +28,23 @@
@@ -1574,7 +1617,7 @@ index 137ee76..1bc42da 100644
#include <linux/kdebug.h>
+#ifdef CONFIG_PAX_PAGEEXEC
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ unsigned long i;
+
@@ -1594,13 +1637,13 @@ index 137ee76..1bc42da 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 ae3c20a..8e2402e 100644
+index 302d779..7d35bf8 100644
--- a/arch/mips/mm/mmap.c
+++ b/arch/mips/mm/mmap.c
-@@ -48,14 +48,18 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- do_color_align = 0;
- if (filp || (flags & MAP_SHARED))
+@@ -95,6 +95,11 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
do_color_align = 1;
+
+ /* requesting a specific address */
+
+#ifdef CONFIG_PAX_RANDMMAP
+ if (!(current->mm->pax_flags & MF_PAX_RANDMMAP))
@@ -1609,27 +1652,46 @@ index ae3c20a..8e2402e 100644
if (addr) {
if (do_color_align)
addr = COLOUR_ALIGN(addr, pgoff);
- else
+@@ -102,8 +107,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
addr = PAGE_ALIGN(addr);
- vmm = find_vma(current->mm, addr);
+
+ vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vmm || addr + len <= vmm->vm_start))
+- (!vma || addr + len <= vma->vm_start))
+ if (TASK_SIZE - len >= addr && check_heap_stack_gap(vmm, addr, len))
return addr;
}
- addr = current->mm->mmap_base;
-@@ -68,7 +72,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- /* At this point: (!vmm || addr < vmm->vm_end). */
- if (TASK_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 (do_color_align)
-@@ -93,30 +97,3 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
- mm->get_unmapped_area = arch_get_unmapped_area;
- mm->unmap_area = arch_unmap_area;
+
+@@ -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)
+ mm->unmap_area = arch_unmap_area_topdown;
+ }
}
-
-static inline unsigned long brk_rnd(void)
@@ -1699,7 +1761,7 @@ index 22dadeb..f6c2be4 100644
#define PAGE_KERNEL_EXEC __pgprot(_PAGE_KERNEL_EXEC)
#define PAGE_KERNEL_RWX __pgprot(_PAGE_KERNEL_RWX)
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
-index cedbbb8..f9c332e 100644
+index 5e34ccf..672bc9c 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -98,16 +98,38 @@
@@ -1792,7 +1854,7 @@ index cedbbb8..f9c332e 100644
return (Elf_Addr)fdesc;
}
#endif /* CONFIG_64BIT */
-@@ -857,7 +879,7 @@ register_unwind_table(struct module *me,
+@@ -845,7 +867,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;
@@ -1833,7 +1895,7 @@ index c9b9322..02d8940 100644
if (filp) {
addr = get_shared_area(filp->f_mapping, addr, len, pgoff);
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
-index 8b58bf0..7afff03 100644
+index f19e660..414fe24 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -733,9 +733,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
@@ -1848,7 +1910,7 @@ index 8b58bf0..7afff03 100644
fault_space = regs->iasq[0];
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
-index 18162ce..4d274ba 100644
+index 18162ce..94de376 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -15,6 +15,7 @@
@@ -1966,7 +2028,7 @@ index 18162ce..4d274ba 100644
+ return 1;
+}
+
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ unsigned long i;
+
@@ -2021,7 +2083,7 @@ index 18162ce..4d274ba 100644
/*
* If for any reason at all we couldn't handle the fault, make
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
-index 2b917c6..9859a0c 100644
+index 3bf9cca..e7457d0 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];
@@ -2082,10 +2144,10 @@ index d4a7f64..451de1c 100644
return (vm_flags & VM_SAO) ? __pgprot(_PAGE_SAO) : __pgprot(0);
}
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
-index 2cd664e..1d2e8a7 100644
+index dd9c4fd..a2ced87 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
-@@ -129,8 +129,9 @@ extern phys_addr_t kernstart_addr;
+@@ -141,8 +141,9 @@ extern phys_addr_t kernstart_addr;
* and needs to be executable. This means the whole heap ends
* up being executable.
*/
@@ -2097,21 +2159,21 @@ index 2cd664e..1d2e8a7 100644
#define VM_DATA_DEFAULT_FLAGS64 (VM_READ | VM_WRITE | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-@@ -158,6 +159,9 @@ extern phys_addr_t kernstart_addr;
+@@ -170,6 +171,9 @@ extern phys_addr_t kernstart_addr;
#define is_kernel_addr(x) ((x) >= PAGE_OFFSET)
#endif
+#define ktla_ktva(addr) (addr)
+#define ktva_ktla(addr) (addr)
+
- #ifndef __ASSEMBLY__
-
- #undef STRICT_MM_TYPECHECKS
+ /*
+ * 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 9356262..ea96148 100644
+index fb40ede..d3ce956 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
-@@ -155,15 +155,18 @@ do { \
+@@ -144,15 +144,18 @@ do { \
* stack by default, so in the absence of a PT_GNU_STACK program header
* we turn execute permission off.
*/
@@ -2157,10 +2219,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 c5cae0d..7cd4581 100644
+index 559da19..7e5835c 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
-@@ -209,6 +209,7 @@
+@@ -212,6 +212,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 */
@@ -2169,10 +2231,10 @@ index c5cae0d..7cd4581 100644
#define DSISR_ISSTORE 0x02000000 /* access was a store */
#define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
-index 2dc595d..30cb50d 100644
+index e30a13d..2b7d994 100644
--- a/arch/powerpc/include/asm/system.h
+++ b/arch/powerpc/include/asm/system.h
-@@ -531,7 +531,7 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
+@@ -530,7 +530,7 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
#endif
@@ -2363,10 +2425,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 d24d440..e0c0a37 100644
+index 429983c..7af363b 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
-@@ -567,6 +567,7 @@ storage_fault_common:
+@@ -587,6 +587,7 @@ storage_fault_common:
std r14,_DAR(r1)
std r15,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD
@@ -2374,7 +2436,7 @@ index d24d440..e0c0a37 100644
mr r4,r14
mr r5,r15
ld r14,PACA_EXGEN+EX_R14(r13)
-@@ -576,8 +577,7 @@ storage_fault_common:
+@@ -596,8 +597,7 @@ storage_fault_common:
cmpdi r3,0
bne- 1f
b .ret_from_except_lite
@@ -2385,10 +2447,10 @@ index d24d440..e0c0a37 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 a85f487..6a07bde 100644
+index cf9c69b..ebc9640 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
-@@ -956,10 +956,10 @@ handle_page_fault:
+@@ -1004,10 +1004,10 @@ handle_page_fault:
11: ld r4,_DAR(r1)
ld r5,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD
@@ -2400,51 +2462,8 @@ index a85f487..6a07bde 100644
mr r5,r3
addi r3,r1,STACK_FRAME_OVERHEAD
lwz r4,_DAR(r1)
-diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
-index 49cee9d..e8be236 100644
---- a/arch/powerpc/kernel/module.c
-+++ b/arch/powerpc/kernel/module.c
-@@ -31,11 +31,24 @@
-
- LIST_HEAD(module_bug_list);
-
-+#ifdef CONFIG_PAX_KERNEXEC
- void *module_alloc(unsigned long size)
- {
- if (size == 0)
- return NULL;
-
-+ return vmalloc(size);
-+}
-+
-+void *module_alloc_exec(unsigned long size)
-+#else
-+void *module_alloc(unsigned long size)
-+#endif
-+
-+{
-+ if (size == 0)
-+ return NULL;
-+
- return vmalloc_exec(size);
- }
-
-@@ -45,6 +58,13 @@ void module_free(struct module *mod, void *module_region)
- vfree(module_region);
- }
-
-+#ifdef CONFIG_PAX_KERNEXEC
-+void module_free_exec(struct module *mod, void *module_region)
-+{
-+ module_free(mod, module_region);
-+}
-+#endif
-+
- static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
- const Elf_Shdr *sechdrs,
- const char *name)
diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c
-index f832773..0507238 100644
+index 0b6d796..d760ddb 100644
--- a/arch/powerpc/kernel/module_32.c
+++ b/arch/powerpc/kernel/module_32.c
@@ -162,7 +162,7 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr,
@@ -2456,7 +2475,7 @@ index f832773..0507238 100644
return -ENOEXEC;
}
-@@ -203,11 +203,16 @@ static uint32_t do_plt_call(void *location,
+@@ -192,11 +192,16 @@ static uint32_t do_plt_call(void *location,
DEBUGP("Doing plt for call to 0x%x at 0x%x\n", val, (unsigned int)location);
/* Init, or core PLT? */
@@ -2477,10 +2496,10 @@ index f832773..0507238 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 91e52df..8bfc682 100644
+index 6457574..08b28d3 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
-@@ -676,8 +676,8 @@ void show_regs(struct pt_regs * regs)
+@@ -660,8 +660,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
*/
@@ -2491,7 +2510,7 @@ index 91e52df..8bfc682 100644
#endif
show_stack(current, (unsigned long *) regs->gpr[1]);
if (!user_mode(regs))
-@@ -1183,10 +1183,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1165,10 +1165,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
newsp = stack[0];
ip = stack[STACK_FRAME_LR_SAVE];
if (!firstframe || ip != lr) {
@@ -2504,7 +2523,7 @@ index 91e52df..8bfc682 100644
(void *)current->ret_stack[curr_frame].ret);
curr_frame--;
}
-@@ -1206,7 +1206,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1188,7 +1188,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;
@@ -2513,7 +2532,7 @@ index 91e52df..8bfc682 100644
regs->trap, (void *)regs->nip, (void *)lr);
firstframe = 1;
}
-@@ -1281,58 +1281,3 @@ void thread_info_cache_init(void)
+@@ -1263,58 +1263,3 @@ void thread_info_cache_init(void)
}
#endif /* THREAD_SHIFT < PAGE_SHIFT */
@@ -2573,7 +2592,7 @@ index 91e52df..8bfc682 100644
- return ret;
-}
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
-index 78b76dc..7f232ef 100644
+index 836a5a1..27289a3 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -859,7 +859,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
@@ -2586,10 +2605,10 @@ index 78b76dc..7f232ef 100644
goto badframe;
regs->link = current->mm->context.vdso_base + vdso32_rt_sigtramp;
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
-index e91c736..742ec06 100644
+index a50b5ec..547078a 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,
+@@ -429,7 +429,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
current->thread.fpscr.val = 0;
/* Set up to return from userspace. */
@@ -2599,7 +2618,7 @@ index e91c736..742ec06 100644
} else {
err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
-index 1a01414..ce48876 100644
+index 5459d14..10f8070 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -98,6 +98,8 @@ static void pmac_backlight_unblank(void)
@@ -2621,10 +2640,10 @@ index 1a01414..ce48876 100644
do_exit(err);
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
-index 142ab10..236e61a 100644
+index 7d14bb6..1305601 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
-@@ -36,6 +36,7 @@
+@@ -35,6 +35,7 @@
#include <asm/firmware.h>
#include <asm/vdso.h>
#include <asm/vdso_datapage.h>
@@ -2632,7 +2651,7 @@ index 142ab10..236e61a 100644
#include "setup.h"
-@@ -220,7 +221,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -219,7 +220,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
vdso_base = VDSO32_MBASE;
#endif
@@ -2641,7 +2660,7 @@ index 142ab10..236e61a 100644
/* vDSO has a problem and was disabled, just don't "enable" it for the
* process
-@@ -240,7 +241,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -239,7 +240,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
vdso_base = get_unmapped_area(NULL, vdso_base,
(vdso_pages << PAGE_SHIFT) +
((VDSO_ALIGNMENT - 1) & PAGE_MASK),
@@ -2686,7 +2705,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 ad35f66..a9f6aac 100644
+index 5efe8c9..db9ceef 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -32,6 +32,10 @@
@@ -2723,7 +2742,7 @@ index ad35f66..a9f6aac 100644
+ return 1;
+}
+
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ unsigned long i;
+
@@ -2821,7 +2840,7 @@ index 5a783d8..c23e14b 100644
mm->unmap_area = arch_unmap_area_topdown;
}
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
-index ba51948..23009d9 100644
+index 73709f7..6b90313 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,
@@ -2891,7 +2910,7 @@ index ba51948..23009d9 100644
if (!fixed && addr) {
addr = _ALIGN_UP(addr, 1ul << pshift);
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
-index 64b61bf..7ec1411 100644
+index 547f1a6..3fff354 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -162,8 +162,14 @@ extern unsigned int vdso_enabled;
@@ -2911,7 +2930,7 @@ index 64b61bf..7ec1411 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;
+@@ -211,7 +217,4 @@ struct linux_binprm;
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
int arch_setup_additional_pages(struct linux_binprm *, int);
@@ -2920,10 +2939,10 @@ index 64b61bf..7ec1411 100644
-
#endif
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h
-index d382629..3c80d03 100644
+index ef573c1..75a1ce6 100644
--- a/arch/s390/include/asm/system.h
+++ b/arch/s390/include/asm/system.h
-@@ -255,7 +255,7 @@ extern void (*_machine_restart)(char *command);
+@@ -262,7 +262,7 @@ extern void (*_machine_restart)(char *command);
extern void (*_machine_halt)(void);
extern void (*_machine_power_off)(void);
@@ -2969,10 +2988,10 @@ index 2b23885..e136e31 100644
copy_from_user_overflow();
return n;
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
-index f7167ee..e22b6d5 100644
+index dfcb343..eda788a 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
-@@ -168,11 +168,11 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
+@@ -161,11 +161,11 @@ 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. */
@@ -2989,7 +3008,7 @@ index f7167ee..e22b6d5 100644
return 0;
}
-@@ -258,7 +258,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -242,7 +242,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
if (info->got_initialized == 0) {
Elf_Addr *gotent;
@@ -2998,7 +3017,7 @@ index f7167ee..e22b6d5 100644
info->got_offset;
*gotent = val;
info->got_initialized = 1;
-@@ -282,7 +282,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -266,7 +266,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
else if (r_type == R_390_GOTENT ||
r_type == R_390_GOTPLTENT)
*(unsigned int *) loc =
@@ -3007,7 +3026,7 @@ index f7167ee..e22b6d5 100644
else if (r_type == R_390_GOT64 ||
r_type == R_390_GOTPLT64)
*(unsigned long *) loc = val;
-@@ -296,7 +296,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -280,7 +280,7 @@ 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;
@@ -3016,7 +3035,7 @@ index f7167ee..e22b6d5 100644
info->plt_offset;
#ifndef CONFIG_64BIT
ip[0] = 0x0d105810; /* basr 1,0; l 1,6(1); br 1 */
-@@ -321,7 +321,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -305,7 +305,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
val - loc + 0xffffUL < 0x1ffffeUL) ||
(r_type == R_390_PLT32DBL &&
val - loc + 0xffffffffULL < 0x1fffffffeULL)))
@@ -3025,7 +3044,7 @@ index f7167ee..e22b6d5 100644
me->arch.plt_offset +
info->plt_offset;
val += rela->r_addend - loc;
-@@ -343,7 +343,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -327,7 +327,7 @@ 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 -
@@ -3034,7 +3053,7 @@ index f7167ee..e22b6d5 100644
if (r_type == R_390_GOTOFF16)
*(unsigned short *) loc = val;
else if (r_type == R_390_GOTOFF32)
-@@ -353,7 +353,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+@@ -337,7 +337,7 @@ 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. */
@@ -3044,10 +3063,10 @@ index f7167ee..e22b6d5 100644
if (r_type == R_390_GOTPC)
*(unsigned int *) loc = val;
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
-index 541a750..8739853 100644
+index 9451b21..ed8956f 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
-@@ -319,39 +319,3 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -321,39 +321,3 @@ unsigned long get_wchan(struct task_struct *p)
}
return 0;
}
@@ -3087,24 +3106,11 @@ index 541a750..8739853 100644
- return base;
- return ret;
-}
-diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
-index 0c35dee..540939a 100644
---- a/arch/s390/kernel/setup.c
-+++ b/arch/s390/kernel/setup.c
-@@ -271,7 +271,7 @@ static int __init early_parse_mem(char *p)
- }
- early_param("mem", early_parse_mem);
-
--unsigned int user_mode = HOME_SPACE_MODE;
-+unsigned int user_mode = SECONDARY_SPACE_MODE;
- EXPORT_SYMBOL_GPL(user_mode);
-
- static int set_amode_and_uaccess(unsigned long user_amode,
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
-index c9a9f7f..60d0315 100644
+index f09c748..cf9ec1d 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
-@@ -91,10 +91,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
+@@ -92,10 +92,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
*/
if (mmap_is_legacy()) {
mm->mmap_base = TASK_UNMAPPED_BASE;
@@ -3127,7 +3133,7 @@ index c9a9f7f..60d0315 100644
mm->get_unmapped_area = arch_get_unmapped_area_topdown;
mm->unmap_area = arch_unmap_area_topdown;
}
-@@ -166,10 +178,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
+@@ -167,10 +179,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
*/
if (mmap_is_legacy()) {
mm->mmap_base = TASK_UNMAPPED_BASE;
@@ -3268,7 +3274,7 @@ index ad1fb5d..fc5315b 100644
VMLINUX_MAIN += $(drivers-y) $(net-y)
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h
-index bdb2ff8..0e3008f 100644
+index 9f421df..b81fc12 100644
--- a/arch/sparc/include/asm/atomic_64.h
+++ b/arch/sparc/include/asm/atomic_64.h
@@ -14,18 +14,40 @@
@@ -3353,7 +3359,7 @@ index bdb2ff8..0e3008f 100644
#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
#define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0)
-@@ -59,30 +101,65 @@ extern long atomic64_sub_ret(long, atomic64_t *);
+@@ -59,25 +101,60 @@ extern long atomic64_sub_ret(long, atomic64_t *);
#define atomic64_dec_and_test(v) (atomic64_sub_ret(1, v) == 0)
#define atomic_inc(v) atomic_add(1, v)
@@ -3392,7 +3398,7 @@ index bdb2ff8..0e3008f 100644
+ return xchg(&v->counter, new);
+}
- static inline int atomic_add_unless(atomic_t *v, int a, int u)
+ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
{
- int c, old;
+ int c, old, new;
@@ -3417,13 +3423,7 @@ index bdb2ff8..0e3008f 100644
if (likely(old == c))
break;
c = old;
- }
-- return c != (u);
-+ return c != u;
- }
-
- #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
-@@ -90,20 +167,35 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
+@@ -89,20 +166,35 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
#define atomic64_cmpxchg(v, o, n) \
((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
@@ -3513,7 +3513,7 @@ index 7df8b7f..4946269 100644
#define ELF_HWCAP sparc64_elf_hwcap
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
-index 5b31a8e..1d92567 100644
+index a790cc6..091ed94 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)
@@ -3548,7 +3548,7 @@ index 5b31a8e..1d92567 100644
#ifdef MODULE
diff --git a/arch/sparc/include/asm/pgtsrmmu.h b/arch/sparc/include/asm/pgtsrmmu.h
-index 1407c07..7e10231 100644
+index f6ae2b2..b03ffc7 100644
--- a/arch/sparc/include/asm/pgtsrmmu.h
+++ b/arch/sparc/include/asm/pgtsrmmu.h
@@ -115,6 +115,13 @@
@@ -3800,13 +3800,13 @@ index 3e1449f..5293a0e 100644
{
- 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);
@@ -3825,7 +3825,7 @@ index cb85458..e063f17 100644
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 c8cc461..4e2b1b4 100644
+index f793742..4d880af 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -204,7 +204,7 @@ void __show_backtrace(unsigned long fp)
@@ -3864,7 +3864,7 @@ index c8cc461..4e2b1b4 100644
} while (++count < 16);
printk("\n");
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
-index c158a95..f041966 100644
+index 3739a06..48b2ff0 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -180,14 +180,14 @@ static void show_regwindow(struct pt_regs *regs)
@@ -3925,7 +3925,7 @@ index 42b282f..28ce9f2 100644
addr = vmm->vm_end;
if (flags & MAP_SHARED)
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
-index 908b47a..aa9e584 100644
+index 441521a..b767073 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
@@ -4076,10 +4076,10 @@ index 908b47a..aa9e584 100644
mm->unmap_area = arch_unmap_area_topdown;
}
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
-index c0490c7..84959d1 100644
+index 591f20c..0f1b925 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)
+@@ -45,6 +45,8 @@ static void instruction_dump(unsigned long *pc)
#define __SAVE __asm__ __volatile__("save %sp, -0x40, %sp\n\t")
#define __RESTORE __asm__ __volatile__("restore %g0, %g0, %g0\n\t")
@@ -4088,7 +4088,7 @@ index c0490c7..84959d1 100644
void die_if_kernel(char *str, struct pt_regs *regs)
{
static int die_counter;
-@@ -76,15 +78,17 @@ void die_if_kernel(char *str, struct pt_regs *regs)
+@@ -77,15 +79,17 @@ void die_if_kernel(char *str, struct pt_regs *regs)
count++ < 30 &&
(((unsigned long) rw) >= PAGE_OFFSET) &&
!(((unsigned long) rw) & 0x7)) {
@@ -4250,7 +4250,7 @@ index 0cbdaa4..438e4c9 100644
}
EXPORT_SYMBOL(die_if_kernel);
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c
-index 9043106..22ca20a 100644
+index 76e4ac1..78f8bb1 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)
@@ -4537,7 +4537,7 @@ index 1b30bb3..b4a16c7 100644
/* Atomic bit operations. */
diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile
-index 79836a7..62f47a2 100644
+index 301421c..e2535d1 100644
--- a/arch/sparc/mm/Makefile
+++ b/arch/sparc/mm/Makefile
@@ -2,7 +2,7 @@
@@ -4547,15 +4547,15 @@ index 79836a7..62f47a2 100644
-ccflags-y := -Werror
+#ccflags-y := -Werror
- obj-$(CONFIG_SPARC64) += ultra.o tlb.o tsb.o
+ 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 7543ddb..60a8b0b 100644
+index 8023fd7..c8e89e9 100644
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
-@@ -22,6 +22,9 @@
+@@ -21,6 +21,9 @@
+ #include <linux/perf_event.h>
#include <linux/interrupt.h>
- #include <linux/module.h>
#include <linux/kdebug.h>
+#include <linux/slab.h>
+#include <linux/pagemap.h>
@@ -4563,7 +4563,7 @@ index 7543ddb..60a8b0b 100644
#include <asm/system.h>
#include <asm/page.h>
-@@ -209,6 +212,268 @@ static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault)
+@@ -208,6 +211,268 @@ static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault)
return safe_compute_effective_address(regs, insn);
}
@@ -4813,7 +4813,7 @@ index 7543ddb..60a8b0b 100644
+ return 1;
+}
+
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ unsigned long i;
+
@@ -4832,7 +4832,7 @@ index 7543ddb..60a8b0b 100644
static noinline void do_fault_siginfo(int code, int sig, struct pt_regs *regs,
int text_fault)
{
-@@ -281,6 +546,24 @@ good_area:
+@@ -280,6 +545,24 @@ good_area:
if(!(vma->vm_flags & VM_WRITE))
goto bad_area;
} else {
@@ -4858,7 +4858,7 @@ index 7543ddb..60a8b0b 100644
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 f92ce56..869924b 100644
+index 504c062..6fcb9c6 100644
--- a/arch/sparc/mm/fault_64.c
+++ b/arch/sparc/mm/fault_64.c
@@ -21,6 +21,9 @@
@@ -5319,7 +5319,7 @@ index f92ce56..869924b 100644
+ return 1;
+}
+
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ unsigned long i;
+
@@ -5369,10 +5369,10 @@ index f92ce56..869924b 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 f4e9764..5682724 100644
+index 07e1453..0a7d9e9 100644
--- a/arch/sparc/mm/hugetlbpage.c
+++ b/arch/sparc/mm/hugetlbpage.c
-@@ -68,7 +68,7 @@ full_search:
+@@ -67,7 +67,7 @@ full_search:
}
return -ENOMEM;
}
@@ -5381,7 +5381,7 @@ index f4e9764..5682724 100644
/*
* Remember the place where we stopped the search:
*/
-@@ -107,7 +107,7 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -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);
@@ -5390,7 +5390,7 @@ index f4e9764..5682724 100644
/* remember the address as a hint for next time */
return (mm->free_area_cache = addr-len);
}
-@@ -116,16 +116,17 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -115,16 +115,17 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
if (unlikely(mm->mmap_base < len))
goto bottomup;
@@ -5410,7 +5410,7 @@ index f4e9764..5682724 100644
/* remember the address as a hint for next time */
return (mm->free_area_cache = addr);
}
-@@ -135,8 +136,8 @@ hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -134,8 +135,8 @@ hugetlb_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 */
@@ -5421,7 +5421,7 @@ index f4e9764..5682724 100644
bottomup:
/*
-@@ -182,8 +183,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
+@@ -181,8 +182,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
if (addr) {
addr = ALIGN(addr, HPAGE_SIZE);
vma = find_vma(mm, addr);
@@ -5488,20 +5488,20 @@ index cbef74e..c38fead 100644
page_kernel = pgprot_val(SRMMU_PAGE_KERNEL);
diff --git a/arch/um/Makefile b/arch/um/Makefile
-index fab8121..389e108 100644
+index 7730af6..cce5b19 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
-@@ -49,6 +49,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
+@@ -61,6 +61,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
$(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
- $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64
+ $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include
+ifdef CONSTIFY_PLUGIN
+USER_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify
+endif
+
- include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
-
#This will adjust *FLAGS accordingly to the platform.
+ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
+
diff --git a/arch/um/include/asm/kmap_types.h b/arch/um/include/asm/kmap_types.h
index 6c03acd..a5e0215 100644
--- a/arch/um/include/asm/kmap_types.h
@@ -5515,7 +5515,7 @@ index 6c03acd..a5e0215 100644
};
diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h
-index 4cc9b6c..02e5029 100644
+index 7cfc3ce..cbd1a58 100644
--- a/arch/um/include/asm/page.h
+++ b/arch/um/include/asm/page.h
@@ -14,6 +14,9 @@
@@ -5529,10 +5529,10 @@ index 4cc9b6c..02e5029 100644
struct page;
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
-index fab4371..dfaf1a5 100644
+index c533835..84db18e 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
-@@ -404,22 +404,6 @@ int singlestepping(void * t)
+@@ -406,22 +406,6 @@ int singlestepping(void * t)
return 2;
}
@@ -5555,63 +5555,11 @@ index fab4371..dfaf1a5 100644
unsigned long get_wchan(struct task_struct *p)
{
unsigned long stack_page, sp, ip;
-diff --git a/arch/um/sys-i386/shared/sysdep/system.h b/arch/um/sys-i386/shared/sysdep/system.h
-index d1b93c4..ae1b7fd 100644
---- a/arch/um/sys-i386/shared/sysdep/system.h
-+++ b/arch/um/sys-i386/shared/sysdep/system.h
-@@ -17,7 +17,7 @@
- # define AT_VECTOR_SIZE_ARCH 1
- #endif
-
--extern unsigned long arch_align_stack(unsigned long sp);
-+#define arch_align_stack(x) ((x) & ~0xfUL)
-
- void default_idle(void);
-
-diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c
-index 70ca357..728d1cc 100644
---- a/arch/um/sys-i386/syscalls.c
-+++ b/arch/um/sys-i386/syscalls.c
-@@ -11,6 +11,21 @@
- #include "asm/uaccess.h"
- #include "asm/unistd.h"
-
-+int i386_mmap_check(unsigned long addr, unsigned long len, unsigned long flags)
-+{
-+ unsigned long pax_task_size = TASK_SIZE;
-+
-+#ifdef CONFIG_PAX_SEGMEXEC
-+ if (current->mm->pax_flags & MF_PAX_SEGMEXEC)
-+ pax_task_size = SEGMEXEC_TASK_SIZE;
-+#endif
-+
-+ if (len > pax_task_size || addr > pax_task_size - len)
-+ return -EINVAL;
-+
-+ return 0;
-+}
-+
- /*
- * The prototype on i386 is:
- *
-diff --git a/arch/um/sys-x86_64/shared/sysdep/system.h b/arch/um/sys-x86_64/shared/sysdep/system.h
-index d1b93c4..ae1b7fd 100644
---- a/arch/um/sys-x86_64/shared/sysdep/system.h
-+++ b/arch/um/sys-x86_64/shared/sysdep/system.h
-@@ -17,7 +17,7 @@
- # define AT_VECTOR_SIZE_ARCH 1
- #endif
-
--extern unsigned long arch_align_stack(unsigned long sp);
-+#define arch_align_stack(x) ((x) & ~0xfUL)
-
- void default_idle(void);
-
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
-index 37357a5..a246776 100644
+index efb4294..61bc18c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -229,7 +229,7 @@ config X86_HT
+@@ -235,7 +235,7 @@ config X86_HT
config X86_32_LAZY_GS
def_bool y
@@ -5620,7 +5568,7 @@ index 37357a5..a246776 100644
config ARCH_HWEIGHT_CFLAGS
string
-@@ -1018,7 +1018,7 @@ choice
+@@ -1022,7 +1022,7 @@ choice
config NOHIGHMEM
bool "off"
@@ -5629,7 +5577,7 @@ index 37357a5..a246776 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
-@@ -1055,7 +1055,7 @@ config NOHIGHMEM
+@@ -1059,7 +1059,7 @@ config NOHIGHMEM
config HIGHMEM4G
bool "4GB"
@@ -5638,7 +5586,7 @@ index 37357a5..a246776 100644
---help---
Select this if you have a 32-bit processor and between 1 and 4
gigabytes of physical RAM.
-@@ -1109,7 +1109,7 @@ config PAGE_OFFSET
+@@ -1113,7 +1113,7 @@ config PAGE_OFFSET
hex
default 0xB0000000 if VMSPLIT_3G_OPT
default 0x80000000 if VMSPLIT_2G
@@ -5647,7 +5595,7 @@ index 37357a5..a246776 100644
default 0x40000000 if VMSPLIT_1G
default 0xC0000000
depends on X86_32
-@@ -1483,6 +1483,7 @@ config SECCOMP
+@@ -1496,6 +1496,7 @@ config SECCOMP
config CC_STACKPROTECTOR
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
@@ -5655,7 +5603,7 @@ index 37357a5..a246776 100644
---help---
This option turns on the -fstack-protector GCC feature. This
feature puts, at the beginning of functions, a canary value on
-@@ -1540,6 +1541,7 @@ config KEXEC_JUMP
+@@ -1553,6 +1554,7 @@ config KEXEC_JUMP
config PHYSICAL_START
hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
default "0x1000000"
@@ -5663,7 +5611,7 @@ index 37357a5..a246776 100644
---help---
This gives the physical address where the kernel is loaded.
-@@ -1603,6 +1605,7 @@ config X86_NEED_RELOCS
+@@ -1616,6 +1618,7 @@ config X86_NEED_RELOCS
config PHYSICAL_ALIGN
hex "Alignment value to which kernel should be aligned" if X86_32
default "0x1000000"
@@ -5671,7 +5619,7 @@ index 37357a5..a246776 100644
range 0x2000 0x1000000
---help---
This value puts the alignment restrictions on physical address
-@@ -1634,9 +1637,10 @@ config HOTPLUG_CPU
+@@ -1647,9 +1650,10 @@ config HOTPLUG_CPU
Say N if you want to disable CPU hotplug.
config COMPAT_VDSO
@@ -5684,10 +5632,10 @@ index 37357a5..a246776 100644
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 6a7cfdf..2730244 100644
+index e3ca7e0..b30b28a 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
-@@ -338,7 +338,7 @@ config X86_PPRO_FENCE
+@@ -341,7 +341,7 @@ config X86_PPRO_FENCE
config X86_F00F_BUG
def_bool y
@@ -5696,7 +5644,7 @@ index 6a7cfdf..2730244 100644
config X86_INVD_BUG
def_bool y
-@@ -362,7 +362,7 @@ config X86_POPAD_OK
+@@ -365,7 +365,7 @@ config X86_POPAD_OK
config X86_ALIGNMENT_16
def_bool y
@@ -5705,7 +5653,7 @@ index 6a7cfdf..2730244 100644
config X86_INTEL_USERCOPY
def_bool y
-@@ -408,7 +408,7 @@ config X86_CMPXCHG64
+@@ -411,7 +411,7 @@ config X86_CMPXCHG64
# generates cmov.
config X86_CMOV
def_bool y
@@ -5715,7 +5663,7 @@ index 6a7cfdf..2730244 100644
config X86_MINIMUM_CPU_FAMILY
int
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
-index c0f8a5c..6404f61 100644
+index bf56e17..05f9891 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -81,7 +81,7 @@ config X86_PTDUMP
@@ -5737,17 +5685,17 @@ index c0f8a5c..6404f61 100644
This option helps catch unintended modifications to loadable
kernel module's text and read-only data. It also prevents execution
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
-index b02e509..c1ca0df 100644
+index b02e509..2631e48 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -44,6 +44,7 @@ ifeq ($(CONFIG_X86_32),y)
- else
- BITS := 64
+@@ -46,6 +46,7 @@ else
UTS_MACHINE := x86_64
-+ biarch := $(call cc-option,-m64)
CHECKFLAGS += -D__x86_64__ -m64
++ biarch := $(call cc-option,-m64)
KBUILD_AFLAGS += -m64
+ KBUILD_CFLAGS += -m64
+
@@ -195,3 +196,12 @@ define archhelp
echo ' FDARGS="..." arguments for the booted kernel'
echo ' FDINITRD=file initrd for the booted kernel'
@@ -5762,10 +5710,10 @@ index b02e509..c1ca0df 100644
+archprepare:
+ $(if $(LDFLAGS_BUILD_ID),,$(error $(OLD_LD)))
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
-index f7cb086..69c1acd 100644
+index 95365a8..52f857b 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
-@@ -69,6 +69,9 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
+@@ -63,6 +63,9 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -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)
@@ -6205,7 +6153,7 @@ index 4d3ff03..e4972ff 100644
err = check_flags();
}
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
-index 93e689f..504ba09 100644
+index bdb4d45..0476680 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -224,7 +224,7 @@ setup_data: .quad 0 # 64-bit physical pointer to
@@ -6256,7 +6204,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..eb7f25e 100644
+index 5b577d5..3c1fed4 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 @@
@@ -6272,13 +6220,259 @@ index 5b577d5..eb7f25e 100644
je B192; \
leaq 32(r9),r9;
-+#define ret pax_force_retaddr; ret
++#define ret pax_force_retaddr 0, 1; ret
+
#define epilogue(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 be6d9e3..21fbbca 100644
+--- a/arch/x86/crypto/aesni-intel_asm.S
++++ b/arch/x86/crypto/aesni-intel_asm.S
+@@ -31,6 +31,7 @@
+
+ #include <linux/linkage.h>
+ #include <asm/inst.h>
++#include <asm/alternative-asm.h>
+
+ #ifdef __x86_64__
+ .data
+@@ -1436,7 +1437,9 @@ _return_T_done_decrypt:
+ pop %r14
+ pop %r13
+ pop %r12
++ pax_force_retaddr 0, 1
+ ret
++ENDPROC(aesni_gcm_dec)
+
+
+ /*****************************************************************************
+@@ -1699,7 +1702,9 @@ _return_T_done_encrypt:
+ pop %r14
+ pop %r13
+ pop %r12
++ pax_force_retaddr 0, 1
+ ret
++ENDPROC(aesni_gcm_enc)
+
+ #endif
+
+@@ -1714,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:
+ shufps $0b01001110, %xmm2, %xmm1
+ movaps %xmm1, 0x10(TKEYP)
+ add $0x20, TKEYP
++ pax_force_retaddr_bts
+ ret
+
+ .align 4
+@@ -1757,6 +1764,7 @@ _key_expansion_192b:
+
+ movaps %xmm0, (TKEYP)
+ add $0x10, TKEYP
++ pax_force_retaddr_bts
+ ret
+
+ .align 4
+@@ -1769,6 +1777,7 @@ _key_expansion_256b:
+ pxor %xmm1, %xmm2
+ movaps %xmm2, (TKEYP)
+ add $0x10, TKEYP
++ pax_force_retaddr_bts
+ ret
+
+ /*
+@@ -1881,7 +1890,9 @@ ENTRY(aesni_set_key)
+ #ifndef __x86_64__
+ popl KEYP
+ #endif
++ pax_force_retaddr 0, 1
+ ret
++ENDPROC(aesni_set_key)
+
+ /*
+ * void aesni_enc(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
+@@ -1902,7 +1913,9 @@ ENTRY(aesni_enc)
+ popl KLEN
+ popl KEYP
+ #endif
++ pax_force_retaddr 0, 1
+ ret
++ENDPROC(aesni_enc)
+
+ /*
+ * _aesni_enc1: internal ABI
+@@ -1959,6 +1972,7 @@ _aesni_enc1:
+ AESENC KEY STATE
+ movaps 0x70(TKEYP), KEY
+ AESENCLAST KEY STATE
++ pax_force_retaddr_bts
+ ret
+
+ /*
+@@ -2067,6 +2081,7 @@ _aesni_enc4:
+ AESENCLAST KEY STATE2
+ AESENCLAST KEY STATE3
+ AESENCLAST KEY STATE4
++ pax_force_retaddr_bts
+ ret
+
+ /*
+@@ -2089,7 +2104,9 @@ ENTRY(aesni_dec)
+ popl KLEN
+ popl KEYP
+ #endif
++ pax_force_retaddr 0, 1
+ ret
++ENDPROC(aesni_dec)
+
+ /*
+ * _aesni_dec1: internal ABI
+@@ -2146,6 +2163,7 @@ _aesni_dec1:
+ AESDEC KEY STATE
+ movaps 0x70(TKEYP), KEY
+ AESDECLAST KEY STATE
++ pax_force_retaddr_bts
+ ret
+
+ /*
+@@ -2254,6 +2272,7 @@ _aesni_dec4:
+ AESDECLAST KEY STATE2
+ AESDECLAST KEY STATE3
+ AESDECLAST KEY STATE4
++ pax_force_retaddr_bts
+ ret
+
+ /*
+@@ -2311,7 +2330,9 @@ ENTRY(aesni_ecb_enc)
+ popl KEYP
+ popl LEN
+ #endif
++ pax_force_retaddr 0, 1
+ ret
++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)
+ popl KEYP
+ popl LEN
+ #endif
++ pax_force_retaddr 0, 1
+ ret
++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)
+ popl LEN
+ popl IVP
+ #endif
++ pax_force_retaddr 0, 1
+ ret
++ENDPROC(aesni_cbc_enc)
+
+ /*
+ * void aesni_cbc_dec(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
+@@ -2498,7 +2523,9 @@ ENTRY(aesni_cbc_dec)
+ popl LEN
+ popl IVP
+ #endif
++ pax_force_retaddr 0, 1
+ ret
++ENDPROC(aesni_cbc_dec)
+
+ #ifdef __x86_64__
+ .align 16
+@@ -2524,6 +2551,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
+
+ /*
+@@ -2552,6 +2580,7 @@ _aesni_inc:
+ .Linc_low:
+ movaps CTR, IV
+ PSHUFB_XMM BSWAP_MASK IV
++ pax_force_retaddr_bts
+ ret
+
+ /*
+@@ -2612,5 +2641,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)
+ #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
+--- a/arch/x86/crypto/blowfish-x86_64-asm_64.S
++++ b/arch/x86/crypto/blowfish-x86_64-asm_64.S
+@@ -20,6 +20,8 @@
+ *
+ */
+
++#include <asm/alternative-asm.h>
++
+ .file "blowfish-x86_64-asm.S"
+ .text
+
+@@ -151,9 +153,11 @@ __blowfish_enc_blk:
+ jnz __enc_xor;
+
+ write_block();
++ pax_force_retaddr 0, 1
+ ret;
+ __enc_xor:
+ xor_block();
++ pax_force_retaddr 0, 1
+ ret;
+
+ .align 8
+@@ -188,6 +192,7 @@ blowfish_dec_blk:
+
+ movq %r11, %rbp;
+
++ pax_force_retaddr 0, 1
+ ret;
+
+ /**********************************************************************
+@@ -342,6 +347,7 @@ __blowfish_enc_blk_4way:
+
+ popq %rbx;
+ popq %rbp;
++ pax_force_retaddr 0, 1
+ ret;
+
+ __enc_xor4:
+@@ -349,6 +355,7 @@ __enc_xor4:
+
+ popq %rbx;
+ popq %rbp;
++ pax_force_retaddr 0, 1
+ ret;
+
+ .align 8
+@@ -386,5 +393,6 @@ blowfish_dec_blk_4way:
+ popq %rbx;
+ popq %rbp;
+
++ pax_force_retaddr 0, 1
+ ret;
+
diff --git a/arch/x86/crypto/salsa20-x86_64-asm_64.S b/arch/x86/crypto/salsa20-x86_64-asm_64.S
-index 6214a9b..5c0f959 100644
+index 6214a9b..1f4fc9a 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 @@
@@ -6291,7 +6485,7 @@ index 6214a9b..5c0f959 100644
add %r11,%rsp
mov %rdi,%rax
mov %rsi,%rdx
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
# bytesatleast65:
._bytesatleast65:
@@ -6309,8 +6503,65 @@ index 6214a9b..5c0f959 100644
mov %rsi,%rdx
+ pax_force_retaddr
ret
+diff --git a/arch/x86/crypto/sha1_ssse3_asm.S b/arch/x86/crypto/sha1_ssse3_asm.S
+index b2c2f57..8470cab 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.
+ */
+
++#include <asm/alternative-asm.h>
++
+ #define CTX %rdi // arg1
+ #define BUF %rsi // arg2
+ #define CNT %rdx // arg3
+@@ -104,6 +106,7 @@
+ pop %r12
+ pop %rbp
+ pop %rbx
++ pax_force_retaddr 0, 1
+ ret
+
+ .size \name, .-\name
+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
+--- 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 @@
+ *
+ */
+
++#include <asm/alternative-asm.h>
++
+ .file "twofish-x86_64-asm-3way.S"
+ .text
+
+@@ -260,6 +262,7 @@ __twofish_enc_blk_3way:
+ popq %r13;
+ popq %r14;
+ popq %r15;
++ pax_force_retaddr 0, 1
+ ret;
+
+ __enc_xor3:
+@@ -271,6 +274,7 @@ __enc_xor3:
+ popq %r13;
+ popq %r14;
+ popq %r15;
++ pax_force_retaddr 0, 1
+ ret;
+
+ .global twofish_dec_blk_3way
+@@ -312,5 +316,6 @@ twofish_dec_blk_3way:
+ popq %r13;
+ popq %r14;
+ popq %r15;
++ pax_force_retaddr 0, 1
+ ret;
+
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64.S b/arch/x86/crypto/twofish-x86_64-asm_64.S
-index 573aa10..7289973 100644
+index 7bcf3fc..f53832f 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 @@
@@ -6321,19 +6572,19 @@ index 573aa10..7289973 100644
#define a_offset 0
#define b_offset 4
-@@ -269,6 +270,7 @@ twofish_enc_blk:
+@@ -268,6 +269,7 @@ twofish_enc_blk:
popq R1
movq $1,%rax
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
twofish_dec_blk:
-@@ -321,4 +323,5 @@ twofish_dec_blk:
+@@ -319,4 +321,5 @@ twofish_dec_blk:
popq R1
movq $1,%rax
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index fd84387..0b4af7d 100644
@@ -6349,10 +6600,10 @@ index fd84387..0b4af7d 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 588a7aa..a3468b0 100644
+index 6557769..ef6ae89 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
-@@ -167,7 +167,7 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
+@@ -169,7 +169,7 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
}
seg = get_fs();
set_fs(KERNEL_DS);
@@ -6361,7 +6612,7 @@ index 588a7aa..a3468b0 100644
set_fs(seg);
if (ret >= 0 && uoss_ptr) {
if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)))
-@@ -374,7 +374,7 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
+@@ -370,7 +370,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,
@@ -6370,7 +6621,7 @@ index 588a7aa..a3468b0 100644
{
unsigned long sp;
-@@ -395,7 +395,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
+@@ -391,7 +391,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
if (used_math()) {
sp = sp - sig_xstate_ia32_size;
@@ -6379,7 +6630,7 @@ index 588a7aa..a3468b0 100644
if (save_i387_xstate_ia32(*fpstate) < 0)
return (void __user *) -1L;
}
-@@ -403,7 +403,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
+@@ -399,7 +399,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, 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. */
@@ -6388,7 +6639,7 @@ index 588a7aa..a3468b0 100644
return (void __user *) sp;
}
-@@ -461,7 +461,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
+@@ -457,7 +457,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
* These are actually not used anymore, but left because some
* gdb versions depend on them as a marker.
*/
@@ -6397,7 +6648,7 @@ index 588a7aa..a3468b0 100644
} put_user_catch(err);
if (err)
-@@ -503,7 +503,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
+@@ -499,7 +499,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
0xb8,
__NR_ia32_rt_sigreturn,
0x80cd,
@@ -6406,7 +6657,7 @@ index 588a7aa..a3468b0 100644
};
frame = get_sigframe(ka, regs, sizeof(*frame), &fpstate);
-@@ -533,16 +533,18 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
+@@ -529,16 +529,18 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
if (ka->sa.sa_flags & SA_RESTORER)
restorer = ka->sa.sa_restorer;
@@ -6429,7 +6680,7 @@ index 588a7aa..a3468b0 100644
if (err)
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
-index c1870dd..c60154f 100644
+index a6253ec..4ad2120 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -13,7 +13,9 @@
@@ -6442,11 +6693,12 @@ index c1870dd..c60154f 100644
/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */
#include <linux/elf-em.h>
-@@ -95,6 +97,29 @@ ENTRY(native_irq_enable_sysexit)
+@@ -95,6 +97,32 @@ ENTRY(native_irq_enable_sysexit)
ENDPROC(native_irq_enable_sysexit)
#endif
+ .macro pax_enter_kernel_user
++ pax_set_fptr_mask
+#ifdef CONFIG_PAX_MEMORY_UDEREF
+ call pax_enter_kernel_user
+#endif
@@ -6458,62 +6710,101 @@ index c1870dd..c60154f 100644
+#endif
+#ifdef CONFIG_PAX_RANDKSTACK
+ pushq %rax
++ pushq %r11
+ call pax_randomize_kstack
++ popq %r11
+ popq %rax
+#endif
+ .endm
+
-+ .macro pax_erase_kstack
++.macro pax_erase_kstack
+#ifdef CONFIG_PAX_MEMORY_STACKLEAK
+ call pax_erase_kstack
+#endif
-+ .endm
++.endm
+
/*
* 32bit SYSENTER instruction entry.
*
-@@ -121,7 +146,7 @@ ENTRY(ia32_sysenter_target)
+@@ -121,12 +149,6 @@ ENTRY(ia32_sysenter_target)
CFI_REGISTER rsp,rbp
SWAPGS_UNSAFE_STACK
movq PER_CPU_VAR(kernel_stack), %rsp
- addq $(KERNEL_STACK_OFFSET),%rsp
-+ pax_enter_kernel_user
- /*
- * No need to follow this irqs on/off section: the syscall
- * disabled irqs, here we enable it straight after entry:
-@@ -134,7 +159,8 @@ ENTRY(ia32_sysenter_target)
+- /*
+- * No need to follow this irqs on/off section: the syscall
+- * disabled irqs, here we enable it straight after entry:
+- */
+- ENABLE_INTERRUPTS(CLBR_NONE)
+ movl %ebp,%ebp /* zero extension */
+ pushq_cfi $__USER32_DS
+ /*CFI_REL_OFFSET ss,0*/
+@@ -134,25 +156,39 @@ ENTRY(ia32_sysenter_target)
CFI_REL_OFFSET rsp,0
pushfq_cfi
/*CFI_REL_OFFSET rflags,0*/
- movl 8*3-THREAD_SIZE+TI_sysenter_return(%rsp), %r10d
-+ GET_THREAD_INFO(%r10)
-+ movl TI_sysenter_return(%r10), %r10d
- CFI_REGISTER rip,r10
+- CFI_REGISTER rip,r10
++ orl $X86_EFLAGS_IF,(%rsp)
++ GET_THREAD_INFO(%r11)
++ movl TI_sysenter_return(%r11), %r11d
++ CFI_REGISTER rip,r11
pushq_cfi $__USER32_CS
/*CFI_REL_OFFSET cs,0*/
-@@ -146,6 +172,12 @@ ENTRY(ia32_sysenter_target)
- SAVE_ARGS 0,0,1
+ movl %eax, %eax
+- pushq_cfi %r10
++ pushq_cfi %r11
+ CFI_REL_OFFSET rip,0
+ pushq_cfi %rax
+ cld
+ SAVE_ARGS 0,1,0
++ pax_enter_kernel_user
++ /*
++ * No need to follow this irqs on/off section: the syscall
++ * disabled irqs, here we enable it straight after entry:
++ */
++ ENABLE_INTERRUPTS(CLBR_NONE)
/* no need to do an access_ok check here because rbp has been
32bit zero extended */
+
+#ifdef CONFIG_PAX_MEMORY_UDEREF
-+ mov $PAX_USER_SHADOW_BASE,%r10
-+ add %r10,%rbp
++ mov $PAX_USER_SHADOW_BASE,%r11
++ add %r11,%rbp
+#endif
+
1: movl (%rbp),%ebp
.section __ex_table,"a"
.quad 1b,ia32_badarg
-@@ -168,6 +200,8 @@ sysenter_dispatch:
- testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
+ .previous
+- GET_THREAD_INFO(%r10)
+- orl $TS_COMPAT,TI_status(%r10)
+- testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
++ GET_THREAD_INFO(%r11)
++ orl $TS_COMPAT,TI_status(%r11)
++ testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r11)
+ CFI_REMEMBER_STATE
+ jnz sysenter_tracesys
+ cmpq $(IA32_NR_syscalls-1),%rax
+@@ -162,13 +198,15 @@ sysenter_do_call:
+ sysenter_dispatch:
+ call *ia32_sys_call_table(,%rax,8)
+ movq %rax,RAX-ARGOFFSET(%rsp)
+- GET_THREAD_INFO(%r10)
++ GET_THREAD_INFO(%r11)
+ DISABLE_INTERRUPTS(CLBR_NONE)
+ TRACE_IRQS_OFF
+- testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
++ testl $_TIF_ALLWORK_MASK,TI_flags(%r11)
jnz sysexit_audit
sysexit_from_sys_call:
+- andl $~TS_COMPAT,TI_status(%r10)
+ pax_exit_kernel_user
+ pax_erase_kstack
- andl $~TS_COMPAT,TI_status(%r10)
++ andl $~TS_COMPAT,TI_status(%r11)
/* clear IF, that popfq doesn't enable interrupts early */
andl $~0x200,EFLAGS-R11(%rsp)
-@@ -194,6 +228,9 @@ sysexit_from_sys_call:
+ movl RIP-R11(%rsp),%edx /* User %eip */
+@@ -194,6 +232,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
@@ -6523,7 +6814,40 @@ index c1870dd..c60154f 100644
movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */
cmpq $(IA32_NR_syscalls-1),%rax
ja ia32_badsys
-@@ -246,6 +283,9 @@ sysenter_tracesys:
+@@ -205,7 +246,7 @@ sysexit_from_sys_call:
+ .endm
+
+ .macro auditsys_exit exit
+- testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
++ testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r11)
+ jnz ia32_ret_from_sys_call
+ TRACE_IRQS_ON
+ sti
+@@ -215,12 +256,12 @@ sysexit_from_sys_call:
+ movzbl %al,%edi /* zero-extend that into %edi */
+ inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */
+ call audit_syscall_exit
+- GET_THREAD_INFO(%r10)
++ GET_THREAD_INFO(%r11)
+ movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */
+ movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
+ cli
+ TRACE_IRQS_OFF
+- testl %edi,TI_flags(%r10)
++ testl %edi,TI_flags(%r11)
+ jz \exit
+ CLEAR_RREGS -ARGOFFSET
+ jmp int_with_check
+@@ -238,7 +279,7 @@ sysexit_audit:
+
+ sysenter_tracesys:
+ #ifdef CONFIG_AUDITSYSCALL
+- testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
++ testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r11)
+ jz sysenter_auditsys
+ #endif
+ SAVE_REST
+@@ -246,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
@@ -6533,7 +6857,7 @@ index c1870dd..c60154f 100644
LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
RESTORE_REST
cmpq $(IA32_NR_syscalls-1),%rax
-@@ -277,19 +317,24 @@ ENDPROC(ia32_sysenter_target)
+@@ -277,19 +321,20 @@ ENDPROC(ia32_sysenter_target)
ENTRY(ia32_cstar_target)
CFI_STARTPROC32 simple
CFI_SIGNAL_FRAME
@@ -6545,43 +6869,68 @@ index c1870dd..c60154f 100644
movl %esp,%r8d
CFI_REGISTER rsp,r8
movq PER_CPU_VAR(kernel_stack),%rsp
-+
-+#ifdef CONFIG_PAX_MEMORY_UDEREF
++ SAVE_ARGS 8*6,0,0
+ pax_enter_kernel_user
-+#endif
-+
/*
* No need to follow this irqs on/off section: the syscall
* disabled irqs and here we enable it straight after entry:
*/
ENABLE_INTERRUPTS(CLBR_NONE)
-- SAVE_ARGS 8,1,1
-+ SAVE_ARGS 8*6,1,1
+- SAVE_ARGS 8,0,0
movl %eax,%eax /* zero extension */
movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
movq %rcx,RIP-ARGOFFSET(%rsp)
-@@ -305,6 +350,12 @@ ENTRY(ia32_cstar_target)
+@@ -305,13 +350,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,%r10
-+ add %r10,%r8
++ mov $PAX_USER_SHADOW_BASE,%r11
++ add %r11,%r8
+#endif
+
1: movl (%r8),%r9d
.section __ex_table,"a"
.quad 1b,ia32_badarg
-@@ -327,6 +378,8 @@ cstar_dispatch:
- testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
+ .previous
+- GET_THREAD_INFO(%r10)
+- orl $TS_COMPAT,TI_status(%r10)
+- testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
++ GET_THREAD_INFO(%r11)
++ orl $TS_COMPAT,TI_status(%r11)
++ testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r11)
+ CFI_REMEMBER_STATE
+ jnz cstar_tracesys
+ cmpq $IA32_NR_syscalls-1,%rax
+@@ -321,13 +372,15 @@ cstar_do_call:
+ cstar_dispatch:
+ call *ia32_sys_call_table(,%rax,8)
+ movq %rax,RAX-ARGOFFSET(%rsp)
+- GET_THREAD_INFO(%r10)
++ GET_THREAD_INFO(%r11)
+ DISABLE_INTERRUPTS(CLBR_NONE)
+ TRACE_IRQS_OFF
+- testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
++ testl $_TIF_ALLWORK_MASK,TI_flags(%r11)
jnz sysretl_audit
sysretl_from_sys_call:
+- andl $~TS_COMPAT,TI_status(%r10)
+ pax_exit_kernel_user
+ pax_erase_kstack
- andl $~TS_COMPAT,TI_status(%r10)
- RESTORE_ARGS 1,-ARG_SKIP,1,1,1
++ andl $~TS_COMPAT,TI_status(%r11)
+ RESTORE_ARGS 0,-ARG_SKIP,0,0,0
movl RIP-ARGOFFSET(%rsp),%ecx
+ CFI_REGISTER rip,rcx
+@@ -355,7 +408,7 @@ sysretl_audit:
+
+ cstar_tracesys:
+ #ifdef CONFIG_AUDITSYSCALL
+- testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
++ testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r11)
+ jz cstar_auditsys
+ #endif
+ xchgl %r9d,%ebp
@@ -364,6 +417,9 @@ cstar_tracesys:
movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
movq %rsp,%rdi /* &pt_regs -> arg1 */
@@ -6592,14 +6941,36 @@ index c1870dd..c60154f 100644
LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */
RESTORE_REST
xchgl %ebp,%r9d
-@@ -409,6 +465,7 @@ ENTRY(ia32_syscall)
+@@ -409,20 +465,21 @@ ENTRY(ia32_syscall)
CFI_REL_OFFSET rip,RIP-RIP
PARAVIRT_ADJUST_EXCEPTION_FRAME
SWAPGS
+- /*
+- * No need to follow this irqs on/off section: the syscall
+- * disabled irqs and here we enable it straight after entry:
+- */
+- ENABLE_INTERRUPTS(CLBR_NONE)
+ movl %eax,%eax
+ pushq_cfi %rax
+ cld
+ /* note the registers are not zero extended to the sf.
+ this could be a problem. */
+ SAVE_ARGS 0,1,0
+- GET_THREAD_INFO(%r10)
+- orl $TS_COMPAT,TI_status(%r10)
+- testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
+ pax_enter_kernel_user
- /*
- * No need to follow this irqs on/off section: the syscall
- * disabled irqs and here we enable it straight after entry:
++ /*
++ * No need to follow this irqs on/off section: the syscall
++ * disabled irqs and here we enable it straight after entry:
++ */
++ ENABLE_INTERRUPTS(CLBR_NONE)
++ GET_THREAD_INFO(%r11)
++ orl $TS_COMPAT,TI_status(%r11)
++ testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r11)
+ jnz ia32_tracesys
+ cmpq $(IA32_NR_syscalls-1),%rax
+ ja ia32_badsys
@@ -441,6 +498,9 @@ ia32_tracesys:
movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
movq %rsp,%rdi /* &pt_regs -> arg1 */
@@ -6619,7 +6990,7 @@ index c1870dd..c60154f 100644
CFI_ENDPROC
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
-index 5852519..ac198bc 100644
+index f6f5c53..b358b28 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,
@@ -6690,35 +7061,73 @@ index 5852519..ac198bc 100644
set_fs(old_fs);
diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h
-index 94d420b..f7854e1 100644
+index 091508b..e245ff2 100644
--- a/arch/x86/include/asm/alternative-asm.h
+++ b/arch/x86/include/asm/alternative-asm.h
-@@ -15,6 +15,20 @@
+@@ -4,10 +4,10 @@
+
+ #ifdef CONFIG_SMP
+ .macro LOCK_PREFIX
+-1: lock
++672: lock
+ .section .smp_locks,"a"
+ .balign 4
+- .long 1b - .
++ .long 672b - .
+ .previous
+ .endm
+ #else
+@@ -15,6 +15,45 @@
.endm
#endif
+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+ .macro pax_force_retaddr rip=0
++ .macro pax_force_retaddr_bts rip=0
++ btsq $63,\rip(%rsp)
++ .endm
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS
++ .macro pax_force_retaddr rip=0, reload=0
+ btsq $63,\rip(%rsp)
+ .endm
+ .macro pax_force_fptr ptr
+ btsq $63,\ptr
+ .endm
++ .macro pax_set_fptr_mask
++ .endm
++#endif
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_OR
++ .macro pax_force_retaddr rip=0, reload=0
++ .if \reload
++ pax_set_fptr_mask
++ .endif
++ orq %r10,\rip(%rsp)
++ .endm
++ .macro pax_force_fptr ptr
++ orq %r10,\ptr
++ .endm
++ .macro pax_set_fptr_mask
++ movabs $0x8000000000000000,%r10
++ .endm
++#endif
+#else
-+ .macro pax_force_retaddr rip=0
++ .macro pax_force_retaddr rip=0, reload=0
+ .endm
+ .macro pax_force_fptr ptr
+ .endm
++ .macro pax_force_retaddr_bts rip=0
++ .endm
++ .macro pax_set_fptr_mask
++ .endm
+#endif
+
.macro altinstruction_entry orig alt feature orig_len alt_len
- .align 8
- .quad \orig
+ .long \orig - .
+ .long \alt - .
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
-index bf535f9..ae78f95 100644
+index 37ad100..7d47faa 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
-@@ -93,7 +93,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
+@@ -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" \
@@ -6728,7 +7137,7 @@ index bf535f9..ae78f95 100644
".previous"
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
-index 244ac77..0963a9d 100644
+index 1a6c09a..fec2432 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -45,7 +45,7 @@ static inline void generic_apic_probe(void)
@@ -6763,7 +7172,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 952a826..8a9371d 100644
+index 58cb6d4..ca9010d 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/arch/x86/include/asm/atomic.h
@@ -22,7 +22,18 @@
@@ -7016,54 +7425,51 @@ index 952a826..8a9371d 100644
: "+m" (v->counter), "=qm" (c)
: "ir" (i) : "memory");
return c;
-@@ -180,6 +342,46 @@ static inline int atomic_add_return(int i, atomic_t *v)
+@@ -179,7 +341,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
+ goto no_xadd;
#endif
/* Modern 486+ processor */
- __i = i;
-+ asm volatile(LOCK_PREFIX "xaddl %0, %1\n"
-+
-+#ifdef CONFIG_PAX_REFCOUNT
-+ "jno 0f\n"
-+ "movl %0, %1\n"
-+ "int $4\n0:\n"
-+ _ASM_EXTABLE(0b, 0b)
-+#endif
-+
-+ : "+r" (i), "+m" (v->counter)
-+ : : "memory");
-+ return i + __i;
-+
-+#ifdef CONFIG_M386
-+no_xadd: /* Legacy 386 processor */
-+ local_irq_save(flags);
-+ __i = atomic_read(v);
-+ atomic_set(v, i + __i);
-+ local_irq_restore(flags);
-+ return i + __i;
-+#endif
-+}
-+
-+/**
+- return i + xadd(&v->counter, i);
++ 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
-+ * @v: pointer of type atomic_unchecked_t
+ * @i: integer value to add
++ * @v: pointer of type atomic_unchecked_t
+ *
+ * Atomically adds @i to @v and returns @i + @v
+ */
+static inline int atomic_add_return_unchecked(int i, atomic_unchecked_t *v)
+{
-+ int __i;
+#ifdef CONFIG_M386
++ int __i;
+ unsigned long flags;
+ if (unlikely(boot_cpu_data.x86 <= 3))
+ goto no_xadd;
+#endif
+ /* Modern 486+ processor */
-+ __i = i;
- asm volatile(LOCK_PREFIX "xaddl %0, %1"
- : "+r" (i), "+m" (v->counter)
- : : "memory");
-@@ -208,6 +410,10 @@ static inline int atomic_sub_return(int i, atomic_t *v)
++ 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)
}
#define atomic_inc_return(v) (atomic_add_return(1, v))
@@ -7074,7 +7480,7 @@ index 952a826..8a9371d 100644
#define atomic_dec_return(v) (atomic_sub_return(1, v))
static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
-@@ -215,11 +421,21 @@ 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)
return cmpxchg(&v->counter, old, new);
}
@@ -7094,11 +7500,11 @@ index 952a826..8a9371d 100644
+}
+
/**
- * atomic_add_unless - add unless the number is already a given value
+ * __atomic_add_unless - add unless the number is already a given value
* @v: pointer of type atomic_t
-@@ -231,21 +447,77 @@ static inline int atomic_xchg(atomic_t *v, int new)
+@@ -227,12 +431,25 @@ static inline int atomic_xchg(atomic_t *v, int new)
*/
- static inline int atomic_add_unless(atomic_t *v, int a, int u)
+ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
{
- int c, old;
+ int c, old, new;
@@ -7125,13 +7531,10 @@ index 952a826..8a9371d 100644
if (likely(old == c))
break;
c = old;
- }
-- return c != (u);
-+ return c != u;
+@@ -240,6 +457,48 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
+ return c;
}
- #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
-
+/**
+ * atomic_inc_not_zero_hint - increment if not null
+ * @v: pointer of type atomic_t
@@ -7151,7 +7554,7 @@ index 952a826..8a9371d 100644
+
+ /* sanity test, should be removed by compiler if hint is a constant */
+ if (!hint)
-+ return atomic_inc_not_zero(v);
++ return __atomic_add_unless(v, 1, 0);
+
+ do {
+ asm volatile("incl %0\n"
@@ -7174,12 +7577,11 @@ index 952a826..8a9371d 100644
+
+ return 0;
+}
-+
+
/*
* atomic_dec_if_positive - decrement by 1 if old value positive
- * @v: pointer of type atomic_t
diff --git a/arch/x86/include/asm/atomic64_32.h b/arch/x86/include/asm/atomic64_32.h
-index 2a934aa..42d2411 100644
+index 24098aa..1e37723 100644
--- a/arch/x86/include/asm/atomic64_32.h
+++ b/arch/x86/include/asm/atomic64_32.h
@@ -12,6 +12,14 @@ typedef struct {
@@ -7332,7 +7734,7 @@ index 2a934aa..42d2411 100644
* @i: integer value to subtract
* @v: pointer to type atomic64_t
diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h
-index 49fd1ea..8c58977 100644
+index 0e1cbfc..5623683 100644
--- a/arch/x86/include/asm/atomic64_64.h
+++ b/arch/x86/include/asm/atomic64_64.h
@@ -18,7 +18,19 @@
@@ -7565,23 +7967,11 @@ index 49fd1ea..8c58977 100644
: "=m" (v->counter), "=qm" (c)
: "er" (i), "m" (v->counter) : "memory");
return c;
-@@ -171,7 +317,31 @@ static inline int atomic64_add_negative(long i, atomic64_t *v)
+@@ -170,6 +316,18 @@ static inline int atomic64_add_negative(long i, atomic64_t *v)
+ */
static inline long atomic64_add_return(long i, atomic64_t *v)
{
- long __i = i;
-- asm volatile(LOCK_PREFIX "xaddq %0, %1;"
-+ asm volatile(LOCK_PREFIX "xaddq %0, %1\n"
-+
-+#ifdef CONFIG_PAX_REFCOUNT
-+ "jno 0f\n"
-+ "movq %0, %1\n"
-+ "int $4\n0:\n"
-+ _ASM_EXTABLE(0b, 0b)
-+#endif
-+
-+ : "+r" (i), "+m" (v->counter)
-+ : : "memory");
-+ return i + __i;
++ return i + xadd_check_overflow(&v->counter, i);
+}
+
+/**
@@ -7593,12 +7983,10 @@ index 49fd1ea..8c58977 100644
+ */
+static inline long atomic64_add_return_unchecked(long i, atomic64_unchecked_t *v)
+{
-+ long __i = i;
-+ asm volatile(LOCK_PREFIX "xaddq %0, %1"
- : "+r" (i), "+m" (v->counter)
- : : "memory");
- return i + __i;
-@@ -183,6 +353,10 @@ static inline long atomic64_sub_return(long i, atomic64_t *v)
+ return i + xadd(&v->counter, i);
+ }
+
+@@ -179,6 +337,10 @@ static inline long atomic64_sub_return(long i, atomic64_t *v)
}
#define atomic64_inc_return(v) (atomic64_add_return(1, (v)))
@@ -7609,7 +7997,7 @@ index 49fd1ea..8c58977 100644
#define atomic64_dec_return(v) (atomic64_sub_return(1, (v)))
static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
-@@ -190,6 +364,11 @@ static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
+@@ -186,6 +348,11 @@ static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
return cmpxchg(&v->counter, old, new);
}
@@ -7621,7 +8009,7 @@ index 49fd1ea..8c58977 100644
static inline long atomic64_xchg(atomic64_t *v, long new)
{
return xchg(&v->counter, new);
-@@ -206,17 +385,30 @@ static inline long atomic64_xchg(atomic64_t *v, long new)
+@@ -202,17 +369,30 @@ static inline long atomic64_xchg(atomic64_t *v, long new)
*/
static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
{
@@ -7657,7 +8045,7 @@ index 49fd1ea..8c58977 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 69d5813..0b1900e 100644
+index 1775d6e..b65017f 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -38,7 +38,7 @@
@@ -7760,11 +8148,66 @@ index 46fc474..b02b0f9 100644
len, sum, NULL, err_ptr);
if (len)
+diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
+index 5d3acdf..6447a02 100644
+--- a/arch/x86/include/asm/cmpxchg.h
++++ b/arch/x86/include/asm/cmpxchg.h
+@@ -14,6 +14,8 @@ extern void __cmpxchg_wrong_size(void)
+ __compiletime_error("Bad argument size for cmpxchg");
+ extern void __xadd_wrong_size(void)
+ __compiletime_error("Bad argument size for xadd");
++extern void __xadd_check_overflow_wrong_size(void)
++ __compiletime_error("Bad argument size for xadd_check_overflow");
+
+ /*
+ * Constants for operation sizes. On 32-bit, the 64-bit size it set to
+@@ -195,6 +197,34 @@ extern void __xadd_wrong_size(void)
+ __ret; \
+ })
+
++#define __xadd_check_overflow(ptr, inc, lock) \
++ ({ \
++ __typeof__ (*(ptr)) __ret = (inc); \
++ switch (sizeof(*(ptr))) { \
++ case __X86_CASE_L: \
++ asm volatile (lock "xaddl %0, %1\n" \
++ "jno 0f\n" \
++ "mov %0,%1\n" \
++ "int $4\n0:\n" \
++ _ASM_EXTABLE(0b, 0b) \
++ : "+r" (__ret), "+m" (*(ptr)) \
++ : : "memory", "cc"); \
++ break; \
++ case __X86_CASE_Q: \
++ asm volatile (lock "xaddq %q0, %1\n" \
++ "jno 0f\n" \
++ "mov %0,%1\n" \
++ "int $4\n0:\n" \
++ _ASM_EXTABLE(0b, 0b) \
++ : "+r" (__ret), "+m" (*(ptr)) \
++ : : "memory", "cc"); \
++ break; \
++ default: \
++ __xadd_check_overflow_wrong_size(); \
++ } \
++ __ret; \
++ })
++
+ /*
+ * xadd() adds "inc" to "*ptr" and atomically returns the previous
+ * value of "*ptr".
+@@ -207,4 +237,6 @@ extern void __xadd_wrong_size(void)
+ #define xadd_sync(ptr, inc) __xadd((ptr), (inc), "lock; ")
+ #define xadd_local(ptr, inc) __xadd((ptr), (inc), "")
+
++#define xadd_check_overflow(ptr, inc) __xadd_check_overflow((ptr), (inc), LOCK_PREFIX)
++
+ #endif /* ASM_X86_CMPXCHG_H */
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
-index 71cc380..071cbbb 100644
+index f3444f7..051a196 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
-@@ -358,7 +358,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
+@@ -363,7 +363,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"
@@ -7774,7 +8217,7 @@ index 71cc380..071cbbb 100644
"4:\n"
".previous\n"
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
-index 7b439d9..1b5aa91 100644
+index 41935fa..3b40db8 100644
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -4,6 +4,7 @@
@@ -7986,10 +8429,10 @@ index 908b969..a1f4eb4 100644
#define BIOS_ROM_BASE 0xffe00000
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
-index f2ad216..eb24c96 100644
+index 5f962df..7289f09 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
-@@ -237,7 +237,25 @@ extern int force_personality32;
+@@ -238,7 +238,25 @@ extern int force_personality32;
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. */
@@ -8015,7 +8458,7 @@ index f2ad216..eb24c96 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,
-@@ -290,9 +308,7 @@ do { \
+@@ -291,9 +309,7 @@ do { \
#define ARCH_DLINFO \
do { \
@@ -8026,7 +8469,7 @@ index f2ad216..eb24c96 100644
} while (0)
#define AT_SYSINFO 32
-@@ -303,7 +319,7 @@ do { \
+@@ -304,7 +320,7 @@ do { \
#endif /* !CONFIG_X86_32 */
@@ -8035,14 +8478,16 @@ index f2ad216..eb24c96 100644
#define VDSO_ENTRY \
((unsigned long)VDSO32_SYMBOL(VDSO_CURRENT_BASE, vsyscall))
-@@ -317,7 +333,4 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
+@@ -318,9 +334,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
extern int syscall32_setup_pages(struct linux_binprm *, int exstack);
#define compat_arch_setup_additional_pages syscall32_setup_pages
-extern unsigned long arch_randomize_brk(struct mm_struct *mm);
-#define arch_randomize_brk arch_randomize_brk
-
- #endif /* _ASM_X86_ELF_H */
+ /*
+ * 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
--- a/arch/x86/include/asm/emergency-restart.h
@@ -8118,10 +8563,10 @@ index d09bb03..4ea4194 100644
: "memory"
);
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
-index bb9efe8..c6da984 100644
+index eb92a6e..b98b2f4 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -137,8 +137,8 @@ extern void setup_ioapic_dest(void);
+@@ -136,8 +136,8 @@ extern void setup_ioapic_dest(void);
extern void enable_IO_APIC(void);
/* Statistics */
@@ -8186,10 +8631,10 @@ index c9e09ea..73888df 100644
clts();
}
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
-index d02804d..f0a62d9 100644
+index d8e8eef..99f81ae 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
-@@ -196,6 +196,17 @@ extern void set_iounmap_nonlazy(void);
+@@ -194,6 +194,17 @@ extern void set_iounmap_nonlazy(void);
#include <linux/vmalloc.h>
@@ -8208,10 +8653,10 @@ index d02804d..f0a62d9 100644
* Convert a virtual cached pointer to an uncached pointer
*/
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
-index 5745ce8..949fb75 100644
+index bba3cf8..06bc8da 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
-@@ -140,6 +140,11 @@ static inline unsigned long arch_local_irq_save(void)
+@@ -141,6 +141,11 @@ static inline notrace unsigned long arch_local_irq_save(void)
sti; \
sysexit
@@ -8244,29 +8689,29 @@ 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 d2ac8e2..39db8ad 100644
+index b4973f4..7c4d3fc 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
-@@ -441,7 +441,7 @@ struct kvm_arch {
- unsigned int n_used_mmu_pages;
+@@ -459,7 +459,7 @@ struct kvm_arch {
unsigned int n_requested_mmu_pages;
unsigned int n_max_mmu_pages;
+ unsigned int indirect_shadow_pages;
- atomic_t invlpg_counter;
+ atomic_unchecked_t invlpg_counter;
struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES];
/*
* Hash table of struct kvm_mmu_page.
-@@ -619,7 +619,7 @@ struct kvm_x86_ops {
+@@ -638,7 +638,7 @@ struct kvm_x86_ops {
+ int (*check_intercept)(struct kvm_vcpu *vcpu,
+ struct x86_instruction_info *info,
enum x86_intercept_stage stage);
-
- const struct trace_print_flags *exit_reasons_str;
-};
+} __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 2e99724..e6110cc 100644
+index 9cdae5d..300d20f 100644
--- a/arch/x86/include/asm/local.h
+++ b/arch/x86/include/asm/local.h
@@ -18,26 +18,58 @@ typedef struct {
@@ -8475,7 +8920,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 8b5393e..b6d1178 100644
+index 6902152..399f3a2 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);
@@ -8592,14 +9037,14 @@ index 8b5393e..b6d1178 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..c5ec276 100644
+index 9eae775..c914fea 100644
--- a/arch/x86/include/asm/module.h
+++ b/arch/x86/include/asm/module.h
@@ -5,6 +5,7 @@
@@ -8610,14 +9055,16 @@ index 9eae775..c5ec276 100644
#elif defined CONFIG_M386
#define MODULE_PROC_FAMILY "386 "
#elif defined CONFIG_M486
-@@ -59,8 +60,18 @@
+@@ -59,8 +60,20 @@
#error unknown processor family
#endif
-#ifdef CONFIG_X86_32
-# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
-+#ifdef CONFIG_PAX_KERNEXEC
-+#define MODULE_PAX_KERNEXEC "KERNEXEC "
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS
++#define MODULE_PAX_KERNEXEC "KERNEXEC_BTS "
++#elif defined(CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_OR)
++#define MODULE_PAX_KERNEXEC "KERNEXEC_OR "
+#else
+#define MODULE_PAX_KERNEXEC ""
#endif
@@ -8645,10 +9092,10 @@ index 7639dbf..e08a58c 100644
extern unsigned long __phys_addr(unsigned long);
#define __phys_reloc_hide(x) (x)
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
-index ebbc4d8..38597f4 100644
+index a7d2db9..edb023e 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
-@@ -658,6 +658,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
+@@ -667,6 +667,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
val);
}
@@ -8667,7 +9114,7 @@ index ebbc4d8..38597f4 100644
static inline void pgd_clear(pgd_t *pgdp)
{
set_pgd(pgdp, __pgd(0));
-@@ -739,6 +751,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
+@@ -748,6 +760,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
pv_mmu_ops.set_fixmap(idx, phys, flags);
}
@@ -8689,7 +9136,7 @@ index ebbc4d8..38597f4 100644
#if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT_SPINLOCKS)
static inline int arch_spin_is_locked(struct arch_spinlock *lock)
-@@ -955,7 +982,7 @@ extern void default_banner(void);
+@@ -964,7 +991,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)
@@ -8698,7 +9145,7 @@ index ebbc4d8..38597f4 100644
#endif
#define INTERRUPT_RETURN \
-@@ -1032,6 +1059,21 @@ extern void default_banner(void);
+@@ -1041,6 +1068,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))
@@ -8721,10 +9168,10 @@ index ebbc4d8..38597f4 100644
#endif /* __ASSEMBLY__ */
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
-index 8288509..437d0ff 100644
+index 8e8b9a4..f07d725 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
-@@ -78,19 +78,19 @@ struct pv_init_ops {
+@@ -84,20 +84,20 @@ struct pv_init_ops {
*/
unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
unsigned long addr, unsigned len);
@@ -8741,13 +9188,14 @@ index 8288509..437d0ff 100644
struct pv_time_ops {
unsigned long long (*sched_clock)(void);
+ unsigned long long (*steal_clock)(int cpu);
unsigned long (*get_tsc_khz)(void);
-};
+} __no_const;
struct pv_cpu_ops {
/* hooks for various privileged instructions */
-@@ -186,7 +186,7 @@ struct pv_cpu_ops {
+@@ -193,7 +193,7 @@ struct pv_cpu_ops {
void (*start_context_switch)(struct task_struct *prev);
void (*end_context_switch)(struct task_struct *next);
@@ -8756,7 +9204,7 @@ index 8288509..437d0ff 100644
struct pv_irq_ops {
/*
-@@ -217,7 +217,7 @@ struct pv_apic_ops {
+@@ -224,7 +224,7 @@ struct pv_apic_ops {
unsigned long start_eip,
unsigned long start_esp);
#endif
@@ -8765,7 +9213,7 @@ index 8288509..437d0ff 100644
struct pv_mmu_ops {
unsigned long (*read_cr2)(void);
-@@ -306,6 +306,7 @@ struct pv_mmu_ops {
+@@ -313,6 +313,7 @@ struct pv_mmu_ops {
struct paravirt_callee_save make_pud;
void (*set_pgd)(pgd_t *pudp, pgd_t pgdval);
@@ -8773,7 +9221,7 @@ index 8288509..437d0ff 100644
#endif /* PAGETABLE_LEVELS == 4 */
#endif /* PAGETABLE_LEVELS >= 3 */
-@@ -317,6 +318,12 @@ struct pv_mmu_ops {
+@@ -324,6 +325,12 @@ struct pv_mmu_ops {
an mfn. We can tell which is which from the index. */
void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
phys_addr_t phys, pgprot_t flags);
@@ -8786,7 +9234,7 @@ index 8288509..437d0ff 100644
};
struct arch_spinlock;
-@@ -327,7 +334,7 @@ struct pv_lock_ops {
+@@ -334,7 +341,7 @@ struct pv_lock_ops {
void (*spin_lock_flags)(struct arch_spinlock *lock, unsigned long flags);
int (*spin_trylock)(struct arch_spinlock *lock);
void (*spin_unlock)(struct arch_spinlock *lock);
@@ -9110,14 +9558,15 @@ 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..3a89693 100644
+index 975f709..107976d 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
-@@ -16,10 +16,13 @@
+@@ -16,10 +16,14 @@
extern pud_t level3_kernel_pgt[512];
extern pud_t level3_ident_pgt[512];
-+extern pud_t level3_vmalloc_pgt[512];
++extern pud_t level3_vmalloc_start_pgt[512];
++extern pud_t level3_vmalloc_end_pgt[512];
+extern pud_t level3_vmemmap_pgt[512];
+extern pud_t level2_vmemmap_pgt[512];
extern pmd_t level2_kernel_pgt[512];
@@ -9129,7 +9578,7 @@ index 975f709..3a89693 100644
#define swapper_pg_dir init_level4_pgt
-@@ -61,7 +64,9 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
+@@ -61,7 +65,9 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
{
@@ -9139,7 +9588,7 @@ index 975f709..3a89693 100644
}
static inline void native_pmd_clear(pmd_t *pmd)
-@@ -107,6 +112,13 @@ static inline void native_pud_clear(pud_t *pud)
+@@ -107,6 +113,13 @@ static inline void native_pud_clear(pud_t *pud)
static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd)
{
@@ -9169,7 +9618,7 @@ index 766ea16..5b96cb3 100644
#endif /* _ASM_X86_PGTABLE_64_DEFS_H */
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
-index d56187c..8e16dc8 100644
+index 013286a..8b42f4f 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -16,13 +16,12 @@
@@ -9219,18 +9668,16 @@ index d56187c..8e16dc8 100644
#define __PAGE_KERNEL_EXEC \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
#define __PAGE_KERNEL (__PAGE_KERNEL_EXEC | _PAGE_NX)
-@@ -106,8 +109,8 @@
+@@ -106,7 +109,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)
-#define __PAGE_KERNEL_VSYSCALL (__PAGE_KERNEL_RX | _PAGE_USER)
--#define __PAGE_KERNEL_VSYSCALL_NOCACHE (__PAGE_KERNEL_VSYSCALL | _PAGE_PCD | _PAGE_PWT)
+#define __PAGE_KERNEL_VSYSCALL (__PAGE_KERNEL_RO | _PAGE_USER)
-+#define __PAGE_KERNEL_VSYSCALL_NOCACHE (__PAGE_KERNEL_RO | _PAGE_PCD | _PAGE_PWT | _PAGE_USER)
+ #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)
- #define __PAGE_KERNEL_LARGE_NOCACHE (__PAGE_KERNEL | _PAGE_CACHE_UC | _PAGE_PSE)
- #define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
-@@ -166,8 +169,8 @@
+@@ -168,8 +171,8 @@
* bits are combined, this will alow user to access the high address mapped
* VDSO in the presence of CONFIG_COMPAT_VDSO
*/
@@ -9241,7 +9688,7 @@ index d56187c..8e16dc8 100644
#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */
#endif
-@@ -205,7 +208,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd)
+@@ -207,7 +210,17 @@ static inline pgdval_t pgd_flags(pgd_t pgd)
{
return native_pgd_val(pgd) & PTE_FLAGS_MASK;
}
@@ -9259,7 +9706,7 @@ index d56187c..8e16dc8 100644
#if PAGETABLE_LEVELS > 3
typedef struct { pudval_t pud; } pud_t;
-@@ -219,8 +232,6 @@ static inline pudval_t native_pud_val(pud_t pud)
+@@ -221,8 +234,6 @@ static inline pudval_t native_pud_val(pud_t pud)
return pud.pud;
}
#else
@@ -9268,7 +9715,7 @@ index d56187c..8e16dc8 100644
static inline pudval_t native_pud_val(pud_t pud)
{
return native_pgd_val(pud.pgd);
-@@ -240,8 +251,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
+@@ -242,8 +253,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
return pmd.pmd;
}
#else
@@ -9277,7 +9724,7 @@ index d56187c..8e16dc8 100644
static inline pmdval_t native_pmd_val(pmd_t pmd)
{
return native_pgd_val(pmd.pud.pgd);
-@@ -281,7 +290,6 @@ typedef struct page *pgtable_t;
+@@ -283,7 +292,6 @@ typedef struct page *pgtable_t;
extern pteval_t __supported_pte_mask;
extern void set_nx(void);
@@ -9286,10 +9733,10 @@ index d56187c..8e16dc8 100644
#define pgprot_writecombine pgprot_writecombine
extern pgprot_t pgprot_writecombine(pgprot_t prot);
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
-index 2193715..fa70b92 100644
+index b650435..eefa566 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
-@@ -266,7 +266,7 @@ struct tss_struct {
+@@ -268,7 +268,7 @@ struct tss_struct {
} ____cacheline_aligned;
@@ -9392,10 +9839,10 @@ index 2193715..fa70b92 100644
/* Get/set a process' ability to use the timestamp counter instruction */
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
-index 94e7618..55ac793 100644
+index 3566454..4bdfb8c 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
-@@ -153,28 +153,29 @@ static inline unsigned long regs_return_value(struct pt_regs *regs)
+@@ -156,28 +156,29 @@ static inline unsigned long regs_return_value(struct pt_regs *regs)
}
/*
@@ -9431,8 +9878,27 @@ index 94e7618..55ac793 100644
#endif
}
+@@ -193,15 +194,16 @@ static inline int v8086_mode(struct pt_regs *regs)
+ #ifdef CONFIG_X86_64
+ static inline bool user_64bit_mode(struct pt_regs *regs)
+ {
++ unsigned long cs = regs->cs & 0xffff;
+ #ifndef CONFIG_PARAVIRT
+ /*
+ * On non-paravirt systems, this is the only long mode CPL 3
+ * selector. We do not allow long mode selectors in the LDT.
+ */
+- return regs->cs == __USER_CS;
++ return cs == __USER_CS;
+ #else
+ /* Headers are too twisted for this to go in paravirt.h. */
+- return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs;
++ return cs == __USER_CS || cs == pv_info.extra_user_64bit_cs;
+ #endif
+ }
+ #endif
diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h
-index 3250e3d..20db631 100644
+index 92f29706..a79cbbb 100644
--- a/arch/x86/include/asm/reboot.h
+++ b/arch/x86/include/asm/reboot.h
@@ -6,19 +6,19 @@
@@ -9462,7 +9928,7 @@ index 3250e3d..20db631 100644
#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 df4cd32..27ae072 100644
+index 2dbe4a7..ce1db00 100644
--- a/arch/x86/include/asm/rwsem.h
+++ b/arch/x86/include/asm/rwsem.h
@@ -64,6 +64,14 @@ static inline void __down_read(struct rw_semaphore *sem)
@@ -9572,25 +10038,17 @@ index df4cd32..27ae072 100644
: "+m" (sem->count)
: "er" (delta));
}
-@@ -206,7 +262,15 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
+@@ -204,7 +260,7 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
+ */
+ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
{
- long tmp = delta;
-
-- asm volatile(LOCK_PREFIX "xadd %0,%1"
-+ asm volatile(LOCK_PREFIX "xadd %0,%1\n"
-+
-+#ifdef CONFIG_PAX_REFCOUNT
-+ "jno 0f\n"
-+ "mov %0,%1\n"
-+ "int $4\n0:\n"
-+ _ASM_EXTABLE(0b, 0b)
-+#endif
-+
- : "+r" (tmp), "+m" (sem->count)
- : : "memory");
+- return delta + xadd(&sem->count, delta);
++ return delta + xadd_check_overflow(&sem->count, delta);
+ }
+ #endif /* __KERNEL__ */
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
-index cd84f72..d909986 100644
+index 5e64171..f58957e 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -64,10 +64,15 @@
@@ -9643,7 +10101,7 @@ index cd84f72..d909986 100644
#else
@@ -165,6 +178,8 @@
- #define __USER32_CS (GDT_ENTRY_DEFAULT_USER32_CS * 8 + 3)
+ #define __USER32_CS (GDT_ENTRY_DEFAULT_USER32_CS*8+3)
#define __USER32_DS __USER_DS
+#define GDT_ENTRY_KERNEXEC_KERNEL_CS 7
@@ -9699,17 +10157,17 @@ index 73b11bc..d4a3b63 100644
#endif
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
-index 3089f70..db20eed 100644
+index 972c260..43ab1fd 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
-@@ -249,6 +249,14 @@ static inline int arch_write_can_lock(arch_rwlock_t *lock)
+@@ -188,6 +188,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 " subl $1,(%0)\n\t"
+ asm volatile(LOCK_PREFIX READ_LOCK_SIZE(dec) " (%0)\n\t"
+
+#ifdef CONFIG_PAX_REFCOUNT
+ "jno 0f\n"
-+ LOCK_PREFIX " addl $1,(%0)\n"
++ LOCK_PREFIX READ_LOCK_SIZE(inc) " (%0)\n"
+ "int $4\n0:\n"
+ _ASM_EXTABLE(0b, 0b)
+#endif
@@ -9717,14 +10175,14 @@ index 3089f70..db20eed 100644
"jns 1f\n"
"call __read_lock_failed\n\t"
"1:\n"
-@@ -258,6 +266,14 @@ static inline void arch_read_lock(arch_rwlock_t *rw)
+@@ -197,6 +205,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 " subl %1,(%0)\n\t"
+ asm volatile(LOCK_PREFIX WRITE_LOCK_SUB(%1) "(%0)\n\t"
+
+#ifdef CONFIG_PAX_REFCOUNT
+ "jno 0f\n"
-+ LOCK_PREFIX " addl %1,(%0)\n"
++ LOCK_PREFIX WRITE_LOCK_ADD(%1) "(%0)\n"
+ "int $4\n0:\n"
+ _ASM_EXTABLE(0b, 0b)
+#endif
@@ -9732,36 +10190,36 @@ index 3089f70..db20eed 100644
"jz 1f\n"
"call __write_lock_failed\n\t"
"1:\n"
-@@ -286,12 +302,29 @@ static inline int arch_write_trylock(arch_rwlock_t *lock)
+@@ -226,13 +242,29 @@ static inline int arch_write_trylock(arch_rwlock_t *lock)
static inline void arch_read_unlock(arch_rwlock_t *rw)
{
-- asm volatile(LOCK_PREFIX "incl %0" :"+m" (rw->lock) : : "memory");
-+ asm volatile(LOCK_PREFIX "incl %0\n"
+- asm volatile(LOCK_PREFIX READ_LOCK_SIZE(inc) " %0"
++ asm volatile(LOCK_PREFIX READ_LOCK_SIZE(inc) " %0\n"
+
+#ifdef CONFIG_PAX_REFCOUNT
+ "jno 0f\n"
-+ LOCK_PREFIX "decl %0\n"
++ LOCK_PREFIX READ_LOCK_SIZE(dec) " %0\n"
+ "int $4\n0:\n"
+ _ASM_EXTABLE(0b, 0b)
+#endif
+
-+ :"+m" (rw->lock) : : "memory");
+ :"+m" (rw->lock) : : "memory");
}
static inline void arch_write_unlock(arch_rwlock_t *rw)
{
-- asm volatile(LOCK_PREFIX "addl %1, %0"
-+ asm volatile(LOCK_PREFIX "addl %1, %0\n"
+- asm volatile(LOCK_PREFIX WRITE_LOCK_ADD(%1) "%0"
++ asm volatile(LOCK_PREFIX WRITE_LOCK_ADD(%1) "%0\n"
+
+#ifdef CONFIG_PAX_REFCOUNT
+ "jno 0f\n"
-+ LOCK_PREFIX "subl %1, %0\n"
++ LOCK_PREFIX WRITE_LOCK_SUB(%1) "%0\n"
+ "int $4\n0:\n"
+ _ASM_EXTABLE(0b, 0b)
+#endif
+
- : "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory");
+ : "+m" (rw->write) : "i" (RW_LOCK_BIAS) : "memory");
}
diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h
@@ -9805,7 +10263,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,
@@ -9817,15 +10283,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;
@@ -9854,7 +10311,7 @@ index cb23852..2dde194 100644
asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
-index c2ff2a1..4349184 100644
+index 2d2f01c..f985723 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -129,7 +129,7 @@ do { \
@@ -9884,7 +10341,7 @@ index c2ff2a1..4349184 100644
}
static inline void native_clts(void)
-@@ -397,12 +397,12 @@ void enable_hlt(void);
+@@ -397,13 +397,13 @@ void enable_hlt(void);
void cpu_idle_wait(void);
@@ -9893,6 +10350,7 @@ index c2ff2a1..4349184 100644
extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
void default_idle(void);
+ bool set_pm_idle_to_default(void);
-void stop_this_cpu(void *dummy);
+void stop_this_cpu(void *dummy) __noreturn;
@@ -9900,7 +10358,7 @@ index c2ff2a1..4349184 100644
/*
* Force strict CPU ordering.
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
-index 1f2e61e..05e6f1e 100644
+index a1fe5c1..ee326d8 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -10,6 +10,7 @@
@@ -9912,7 +10370,7 @@ index 1f2e61e..05e6f1e 100644
/*
* low level task data that entry.S needs immediate access to
@@ -24,7 +25,6 @@ struct exec_domain;
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
struct thread_info {
- struct task_struct *task; /* main task structure */
@@ -9949,38 +10407,24 @@ index 1f2e61e..05e6f1e 100644
#define init_stack (init_thread_union.stack)
#else /* !__ASSEMBLY__ */
-@@ -170,6 +164,23 @@ struct thread_info {
+@@ -170,45 +164,40 @@ 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
-
- #define STACK_WARN (THREAD_SIZE/8)
-@@ -180,35 +191,13 @@ struct thread_info {
- */
- #ifndef __ASSEMBLY__
-
+-#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)
-{
@@ -9990,15 +10434,40 @@ index 1f2e61e..05e6f1e 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 percpu_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 */
@@ -10051,7 +10520,7 @@ index 1f2e61e..05e6f1e 100644
#endif
#endif /* _ASM_X86_THREAD_INFO_H */
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
-index 99ddd14..e31427c 100644
+index 36361bf..324f262 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -7,12 +7,15 @@
@@ -10274,22 +10743,20 @@ index 99ddd14..e31427c 100644
#ifdef CONFIG_X86_WP_WORKS_OK
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
-index 566e803..89f1e60 100644
+index 566e803..b9521e9 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
-@@ -43,6 +43,11 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero
+@@ -43,6 +43,9 @@ 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)
{
-+ pax_track_stack();
-+
+ if ((long)n < 0)
+ return n;
+
if (__builtin_constant_p(n)) {
unsigned long ret;
-@@ -61,6 +66,8 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
+@@ -61,6 +64,8 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
return ret;
}
}
@@ -10298,7 +10765,7 @@ index 566e803..89f1e60 100644
return __copy_to_user_ll(to, from, n);
}
-@@ -82,12 +89,16 @@ static __always_inline unsigned long __must_check
+@@ -82,12 +87,16 @@ static __always_inline unsigned long __must_check
__copy_to_user(void __user *to, const void *from, unsigned long n)
{
might_fault();
@@ -10315,20 +10782,18 @@ index 566e803..89f1e60 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 +148,12 @@ static __always_inline unsigned long
+@@ -137,6 +146,10 @@ static __always_inline unsigned long
__copy_from_user(void *to, const void __user *from, unsigned long n)
{
might_fault();
+
-+ pax_track_stack();
-+
+ if ((long)n < 0)
+ return n;
+
if (__builtin_constant_p(n)) {
unsigned long ret;
-@@ -152,6 +169,8 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
+@@ -152,6 +165,8 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
return ret;
}
}
@@ -10337,7 +10802,7 @@ index 566e803..89f1e60 100644
return __copy_from_user_ll(to, from, n);
}
-@@ -159,6 +178,10 @@ static __always_inline unsigned long __copy_from_user_nocache(void *to,
+@@ -159,6 +174,10 @@ static __always_inline unsigned long __copy_from_user_nocache(void *to,
const void __user *from, unsigned long n)
{
might_fault();
@@ -10348,23 +10813,23 @@ index 566e803..89f1e60 100644
if (__builtin_constant_p(n)) {
unsigned long ret;
-@@ -181,15 +204,19 @@ static __always_inline unsigned long
+@@ -181,15 +200,19 @@ static __always_inline unsigned long
__copy_from_user_inatomic_nocache(void *to, const void __user *from,
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")
@@ -10375,7 +10840,7 @@ index 566e803..89f1e60 100644
extern void copy_from_user_overflow(void)
#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
-@@ -199,17 +226,61 @@ extern void copy_from_user_overflow(void)
+@@ -199,17 +222,61 @@ extern void copy_from_user_overflow(void)
#endif
;
@@ -10445,7 +10910,7 @@ index 566e803..89f1e60 100644
}
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
-index 1c66d30..c299480 100644
+index 1c66d30..23ab77d 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -10,6 +10,9 @@
@@ -10458,25 +10923,41 @@ index 1c66d30..c299480 100644
/*
* Copy To/From Userspace
-@@ -36,26 +39,26 @@ copy_user_generic(void *to, const void *from, unsigned len)
+@@ -17,12 +20,12 @@
+
+ /* Handles exceptions in both to and from, but doesn't do access_ok */
+ __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);
+ __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);
+
+ static __always_inline __must_check unsigned long
+-copy_user_generic(void *to, const void *from, unsigned len)
++copy_user_generic(void *to, const void *from, unsigned long len)
+ {
+ unsigned ret;
+
+@@ -36,138 +39,222 @@ copy_user_generic(void *to, const void *from, unsigned len)
return ret;
}
--__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);
+static __always_inline __must_check unsigned long
-+__copy_to_user(void __user *to, const void *from, unsigned len);
++__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 len);
++__copy_from_user(void *to, const void __user *from, unsigned long len);
__must_check unsigned long
- copy_in_user(void __user *to, const void __user *from, unsigned len);
+-_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);
static inline unsigned long __must_check copy_from_user(void *to,
const void __user *from,
-- unsigned long n)
-+ unsigned n)
+ unsigned long n)
{
- int sz = __compiletime_object_size(to);
-
@@ -10490,7 +10971,7 @@ index 1c66d30..c299480 100644
+
+ if (access_ok(VERIFY_READ, from, n))
+ n = __copy_from_user(to, from, n);
-+ else if ((int)n > 0) {
++ else if (n < INT_MAX) {
+ if (!__builtin_constant_p(n))
+ check_object_size(to, n, false);
+ memset(to, 0, n);
@@ -10498,7 +10979,9 @@ index 1c66d30..c299480 100644
return n;
}
-@@ -64,110 +67,198 @@ int copy_to_user(void __user *dst, const void *src, unsigned size)
+ static __always_inline __must_check
+-int copy_to_user(void __user *dst, const void *src, unsigned size)
++int copy_to_user(void __user *dst, const void *src, unsigned long size)
{
might_fault();
@@ -10510,7 +10993,7 @@ index 1c66d30..c299480 100644
static __always_inline __must_check
-int __copy_from_user(void *dst, const void __user *src, unsigned size)
-+unsigned long __copy_from_user(void *dst, const void __user *src, unsigned size)
++unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long size)
{
- int ret = 0;
+ int sz = __compiletime_object_size(dst);
@@ -10520,9 +11003,7 @@ index 1c66d30..c299480 100644
- if (!__builtin_constant_p(size))
- return copy_user_generic(dst, (__force void *)src, size);
+
-+ pax_track_stack();
-+
-+ if ((int)size < 0)
++ if (size > INT_MAX)
+ return size;
+
+#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -10600,7 +11081,7 @@ index 1c66d30..c299480 100644
static __always_inline __must_check
-int __copy_to_user(void __user *dst, const void *src, unsigned size)
-+unsigned long __copy_to_user(void __user *dst, const void *src, unsigned size)
++unsigned long __copy_to_user(void __user *dst, const void *src, unsigned long size)
{
- int ret = 0;
+ int sz = __compiletime_object_size(src);
@@ -10610,9 +11091,7 @@ index 1c66d30..c299480 100644
- if (!__builtin_constant_p(size))
- return copy_user_generic((__force void *)dst, src, size);
+
-+ pax_track_stack();
-+
-+ if ((int)size < 0)
++ if (size > INT_MAX)
+ return size;
+
+#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -10690,7 +11169,7 @@ index 1c66d30..c299480 100644
static __always_inline __must_check
-int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
-+unsigned long __copy_in_user(void __user *dst, const void __user *src, unsigned size)
++unsigned long __copy_in_user(void __user *dst, const void __user *src, unsigned long size)
{
- int ret = 0;
+ unsigned ret = 0;
@@ -10700,7 +11179,7 @@ index 1c66d30..c299480 100644
- return copy_user_generic((__force void *)dst,
- (__force void *)src, size);
+
-+ if ((int)size < 0)
++ if (size > INT_MAX)
+ return size;
+
+#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -10730,7 +11209,7 @@ index 1c66d30..c299480 100644
ret, "b", "b", "=q", 1);
if (likely(!ret))
__put_user_asm(tmp, (u8 __user *)dst,
-@@ -176,7 +267,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
+@@ -176,7 +263,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
}
case 2: {
u16 tmp;
@@ -10739,7 +11218,7 @@ index 1c66d30..c299480 100644
ret, "w", "w", "=r", 2);
if (likely(!ret))
__put_user_asm(tmp, (u16 __user *)dst,
-@@ -186,7 +277,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
+@@ -186,7 +273,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
case 4: {
u32 tmp;
@@ -10748,7 +11227,7 @@ index 1c66d30..c299480 100644
ret, "l", "k", "=r", 4);
if (likely(!ret))
__put_user_asm(tmp, (u32 __user *)dst,
-@@ -195,7 +286,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
+@@ -195,7 +282,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
}
case 8: {
u64 tmp;
@@ -10757,7 +11236,7 @@ index 1c66d30..c299480 100644
ret, "q", "", "=r", 8);
if (likely(!ret))
__put_user_asm(tmp, (u64 __user *)dst,
-@@ -203,8 +294,16 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
+@@ -203,8 +290,16 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
return ret;
}
default:
@@ -10776,14 +11255,15 @@ index 1c66d30..c299480 100644
}
}
-@@ -221,33 +320,72 @@ __must_check unsigned long __clear_user(void __user *mem, unsigned long len);
+@@ -219,35 +314,72 @@ __must_check unsigned long clear_user(void __user *mem, unsigned long len);
+ __must_check unsigned long __clear_user(void __user *mem, unsigned long len);
+
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 size)
++__copy_from_user_inatomic(void *dst, const void __user *src, unsigned long size)
{
- return copy_user_generic(dst, (__force const void *)src, size);
-+ pax_track_stack();
-+
-+ if ((int)size < 0)
++ if (size > INT_MAX)
+ return size;
+
+#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -10798,11 +11278,12 @@ index 1c66d30..c299480 100644
}
-static __must_check __always_inline int
+-__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
+static __must_check __always_inline unsigned long
- __copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
++__copy_to_user_inatomic(void __user *dst, const void *src, unsigned long size)
{
- return copy_user_generic((__force void *)dst, src, size);
-+ if ((int)size < 0)
++ if (size > INT_MAX)
+ return size;
+
+#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -10817,16 +11298,17 @@ index 1c66d30..c299480 100644
}
-extern long __copy_user_nocache(void *dst, const void __user *src,
+- unsigned size, int zerorest);
+extern unsigned long __copy_user_nocache(void *dst, const void __user *src,
- unsigned size, int zerorest);
++ unsigned long size, int zerorest);
-static inline int
-__copy_from_user_nocache(void *dst, const void __user *src, unsigned size)
-+static inline unsigned long __copy_from_user_nocache(void *dst, const void __user *src, unsigned size)
++static inline unsigned long __copy_from_user_nocache(void *dst, const void __user *src, unsigned long size)
{
might_sleep();
+
-+ if ((int)size < 0)
++ if (size > INT_MAX)
+ return size;
+
+#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -10839,10 +11321,11 @@ index 1c66d30..c299480 100644
-static inline int
-__copy_from_user_inatomic_nocache(void *dst, const void __user *src,
+- unsigned size)
+static inline unsigned long __copy_from_user_inatomic_nocache(void *dst, const void __user *src,
- unsigned size)
++ unsigned long size)
{
-+ if ((int)size < 0)
++ if (size > INT_MAX)
+ return size;
+
+#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -10856,7 +11339,7 @@ index 1c66d30..c299480 100644
-unsigned long
-copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest);
+extern unsigned long
-+copy_user_handle_tail(char __user *to, char __user *from, unsigned len, unsigned zerorest);
++copy_user_handle_tail(char __user *to, char __user *from, unsigned long len, unsigned zerorest);
#endif /* _ASM_X86_UACCESS_64_H */
diff --git a/arch/x86/include/asm/vdso.h b/arch/x86/include/asm/vdso.h
@@ -10873,7 +11356,7 @@ index bb05228..d763d5b 100644
#endif
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
-index d3d8590..d296b5f 100644
+index 1971e65..1e3559b 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -28,7 +28,7 @@ struct x86_init_mpparse {
@@ -10975,16 +11458,16 @@ index d3d8590..d296b5f 100644
/**
* struct x86_platform_ops - platform specific runtime functions
-@@ -166,7 +166,7 @@ struct x86_platform_ops {
- bool (*is_untracked_pat_range)(u64 start, u64 end);
+@@ -169,7 +169,7 @@ struct x86_platform_ops {
void (*nmi_init)(void);
+ unsigned char (*get_nmi_reason)(void);
int (*i8042_detect)(void);
-};
+} __no_const;
struct pci_dev;
-@@ -174,7 +174,7 @@ struct x86_msi_ops {
+@@ -177,7 +177,7 @@ struct x86_msi_ops {
int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type);
void (*teardown_msi_irq)(unsigned int irq);
void (*teardown_msi_irqs)(struct pci_dev *dev);
@@ -11100,10 +11583,33 @@ index 13ab720..95d5442 100644
bogus_magic:
jmp bogus_magic
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
-index a81f2d5..f6c90fb 100644
+index 1f84794..e23f862 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
-@@ -313,7 +313,7 @@ static void alternatives_smp_lock(const s32 *start, const s32 *end,
+@@ -276,6 +276,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;
++
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
++ instr += ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++ if (instr < (u8 *)_text || (u8 *)_einittext <= instr)
++ instr -= ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++#endif
++
+ 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,
+ for (poff = start; poff < end; poff++) {
+ u8 *ptr = (u8 *)poff + *poff;
+
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
++ ptr += ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++ if (ptr < (u8 *)_text || (u8 *)_einittext <= ptr)
++ ptr -= ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++#endif
++
if (!*poff || ptr < text || ptr >= text_end)
continue;
/* turn DS segment override prefix into lock prefix */
@@ -11112,7 +11618,16 @@ index a81f2d5..f6c90fb 100644
text_poke(ptr, ((unsigned char []){0xf0}), 1);
};
mutex_unlock(&text_mutex);
-@@ -334,7 +334,7 @@ static void alternatives_smp_unlock(const s32 *start, const s32 *end,
+@@ -328,10 +341,16 @@ static void alternatives_smp_unlock(const s32 *start, const s32 *end,
+ for (poff = start; poff < end; poff++) {
+ u8 *ptr = (u8 *)poff + *poff;
+
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
++ ptr += ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++ if (ptr < (u8 *)_text || (u8 *)_einittext <= ptr)
++ ptr -= ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++#endif
++
if (!*poff || ptr < text || ptr >= text_end)
continue;
/* turn lock prefix into DS segment override prefix */
@@ -11121,7 +11636,7 @@ index a81f2d5..f6c90fb 100644
text_poke(ptr, ((unsigned char []){0x3E}), 1);
};
mutex_unlock(&text_mutex);
-@@ -503,7 +503,7 @@ void __init_or_module apply_paravirt(struct paravirt_patch_site *start,
+@@ -500,7 +519,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 */
@@ -11130,7 +11645,7 @@ index a81f2d5..f6c90fb 100644
used = pv_init_ops.patch(p->instrtype, p->clobbers, insnbuf,
(unsigned long)p->instr, p->len);
-@@ -571,7 +571,7 @@ void __init alternative_instructions(void)
+@@ -568,7 +587,7 @@ void __init alternative_instructions(void)
if (smp_alt_once)
free_init_pages("SMP alternatives",
(unsigned long)__smp_locks,
@@ -11139,7 +11654,7 @@ index a81f2d5..f6c90fb 100644
restart_nmi();
}
-@@ -588,13 +588,17 @@ void __init alternative_instructions(void)
+@@ -585,13 +604,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.
*/
@@ -11159,7 +11674,7 @@ index a81f2d5..f6c90fb 100644
local_irq_restore(flags);
/* Could also do a CLFLUSH here to speed up CPU recovery; but
that causes hangs on some VIA CPUs. */
-@@ -616,36 +620,22 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode,
+@@ -613,36 +636,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)
{
@@ -11205,10 +11720,10 @@ index a81f2d5..f6c90fb 100644
}
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
-index b9338b8..0df3f9d 100644
+index f98d84c..e402a69 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
-@@ -173,7 +173,7 @@ int first_system_vector = 0xfe;
+@@ -174,7 +174,7 @@ int first_system_vector = 0xfe;
/*
* Debug level, exported for io_apic.c
*/
@@ -11217,7 +11732,7 @@ index b9338b8..0df3f9d 100644
int pic_mode;
-@@ -1834,7 +1834,7 @@ void smp_error_interrupt(struct pt_regs *regs)
+@@ -1853,7 +1853,7 @@ void smp_error_interrupt(struct pt_regs *regs)
apic_write(APIC_ESR, 0);
v1 = apic_read(APIC_ESR);
ack_APIC_irq();
@@ -11226,20 +11741,11 @@ index b9338b8..0df3f9d 100644
apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x(%02x)",
smp_processor_id(), v0 , v1);
-@@ -2190,6 +2190,8 @@ static int __cpuinit apic_cluster_num(void)
- u16 *bios_cpu_apicid;
- DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
-
-+ pax_track_stack();
-+
- bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);
- bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
-
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
-index e529339..2457731 100644
+index 6d939d7..0697fcc 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
-@@ -1028,7 +1028,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin,
+@@ -1096,7 +1096,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin,
}
EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
@@ -11248,7 +11754,7 @@ index e529339..2457731 100644
{
/* Used to the online set of cpus does not change
* during assign_irq_vector.
-@@ -1036,7 +1036,7 @@ void lock_vector_lock(void)
+@@ -1104,7 +1104,7 @@ void lock_vector_lock(void)
raw_spin_lock(&vector_lock);
}
@@ -11257,16 +11763,16 @@ index e529339..2457731 100644
{
raw_spin_unlock(&vector_lock);
}
-@@ -2364,7 +2364,7 @@ static void ack_apic_edge(struct irq_data *data)
+@@ -2510,7 +2510,7 @@ static void ack_apic_edge(struct irq_data *data)
ack_APIC_irq();
}
-atomic_t irq_mis_count;
+atomic_unchecked_t irq_mis_count;
- /*
- * IO-APIC versions below 0x20 don't support EOI register.
-@@ -2472,7 +2472,7 @@ static void ack_apic_level(struct irq_data *data)
+ static void ack_apic_level(struct irq_data *data)
+ {
+@@ -2576,7 +2576,7 @@ static void ack_apic_level(struct irq_data *data)
* at the cpu.
*/
if (!(v & (1 << (i & 0x1f)))) {
@@ -11276,10 +11782,10 @@ index e529339..2457731 100644
eoi_ioapic_irq(irq, cfg);
}
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
-index 965a766..3b2cc55 100644
+index a46bd38..6b906d7 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
-@@ -413,7 +413,7 @@ static DEFINE_MUTEX(apm_mutex);
+@@ -411,7 +411,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.
*/
@@ -11288,7 +11794,7 @@ index 965a766..3b2cc55 100644
(unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);
static const char driver_version[] = "1.16ac"; /* no spaces */
-@@ -591,7 +591,10 @@ static long __apm_bios_call(void *_call)
+@@ -589,7 +589,10 @@ static long __apm_bios_call(void *_call)
BUG_ON(cpu != 0);
gdt = get_cpu_gdt_table(cpu);
save_desc_40 = gdt[0x40 / 8];
@@ -11299,7 +11805,7 @@ index 965a766..3b2cc55 100644
apm_irq_save(flags);
APM_DO_SAVE_SEGS;
-@@ -600,7 +603,11 @@ static long __apm_bios_call(void *_call)
+@@ -598,7 +601,11 @@ static long __apm_bios_call(void *_call)
&call->esi);
APM_DO_RESTORE_SEGS;
apm_irq_restore(flags);
@@ -11311,7 +11817,7 @@ index 965a766..3b2cc55 100644
put_cpu();
return call->eax & 0xff;
-@@ -667,7 +674,10 @@ static long __apm_bios_call_simple(void *_call)
+@@ -665,7 +672,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];
@@ -11322,7 +11828,7 @@ index 965a766..3b2cc55 100644
apm_irq_save(flags);
APM_DO_SAVE_SEGS;
-@@ -675,7 +685,11 @@ static long __apm_bios_call_simple(void *_call)
+@@ -673,7 +683,11 @@ static long __apm_bios_call_simple(void *_call)
&call->eax);
APM_DO_RESTORE_SEGS;
apm_irq_restore(flags);
@@ -11334,7 +11840,7 @@ index 965a766..3b2cc55 100644
put_cpu();
return error;
}
-@@ -2349,12 +2363,15 @@ static int __init apm_init(void)
+@@ -2347,12 +2361,15 @@ static int __init apm_init(void)
* code to that CPU.
*/
gdt = get_cpu_gdt_table(0);
@@ -11370,16 +11876,16 @@ index 4f13faf..87db5d2 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();
@@ -11403,7 +11909,7 @@ index e72a119..6e2955d 100644
BLANK();
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
-index 6042981..e638266 100644
+index 25f24dc..4094a7f 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -8,10 +8,6 @@ CFLAGS_REMOVE_common.o = -pg
@@ -11418,10 +11924,10 @@ index 6042981..e638266 100644
obj-y += proc.o capflags.o powerflags.o common.o
obj-y += vmware.o hypervisor.o sched.o mshyperv.o
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
-index b13ed39..603286c 100644
+index 0bab2b1..d0a1bf8 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -647,7 +647,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c,
+@@ -664,7 +664,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c,
unsigned int size)
{
/* AMD errata T13 (order #21922) */
@@ -11431,10 +11937,10 @@ index b13ed39..603286c 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 22a073d..bfb3195 100644
+index aa003b1..47ea638 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
-@@ -83,60 +83,6 @@ static const struct cpu_dev __cpuinitconst default_cpu = {
+@@ -84,60 +84,6 @@ static const struct cpu_dev __cpuinitconst default_cpu = {
static const struct cpu_dev *this_cpu __cpuinitdata = &default_cpu;
@@ -11495,7 +12001,7 @@ index 22a073d..bfb3195 100644
static int __init x86_xsave_setup(char *s)
{
setup_clear_cpu_cap(X86_FEATURE_XSAVE);
-@@ -371,7 +317,7 @@ void switch_to_new_gdt(int cpu)
+@@ -372,7 +318,7 @@ void switch_to_new_gdt(int cpu)
{
struct desc_ptr gdt_descr;
@@ -11504,18 +12010,18 @@ index 22a073d..bfb3195 100644
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
/* Reload the per-cpu base */
-@@ -840,6 +786,10 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
+@@ -844,6 +790,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);
-+#if defined(CONFIG_PAX_SEGMEXEC) || defined(CONFIG_PAX_KERNEXEC) || (defined(CONFIG_PAX_MEMORY_UDEREF) && defined(CONFIG_X86_32))
++#if defined(CONFIG_X86_32) && (defined(CONFIG_PAX_SEGMEXEC) || defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF))
+ setup_clear_cpu_cap(X86_FEATURE_SEP);
+#endif
+
/* If the model name is still unset, do table lookup. */
if (!c->x86_model_id[0]) {
const char *p;
-@@ -1019,6 +969,9 @@ static __init int setup_disablecpuid(char *arg)
+@@ -1024,6 +974,9 @@ static __init int setup_disablecpuid(char *arg)
}
__setup("clearcpuid=", setup_disablecpuid);
@@ -11525,7 +12031,7 @@ index 22a073d..bfb3195 100644
#ifdef CONFIG_X86_64
struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table };
-@@ -1034,7 +987,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned =
+@@ -1039,7 +992,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned =
EXPORT_PER_CPU_SYMBOL(current_task);
DEFINE_PER_CPU(unsigned long, kernel_stack) =
@@ -11534,7 +12040,7 @@ index 22a073d..bfb3195 100644
EXPORT_PER_CPU_SYMBOL(kernel_stack);
DEFINE_PER_CPU(char *, irq_stack_ptr) =
-@@ -1099,7 +1052,7 @@ struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
+@@ -1104,7 +1057,7 @@ struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
{
memset(regs, 0, sizeof(struct pt_regs));
regs->fs = __KERNEL_PERCPU;
@@ -11543,7 +12049,7 @@ index 22a073d..bfb3195 100644
return regs;
}
-@@ -1154,7 +1107,7 @@ void __cpuinit cpu_init(void)
+@@ -1159,7 +1112,7 @@ void __cpuinit cpu_init(void)
int i;
cpu = stack_smp_processor_id();
@@ -11552,7 +12058,7 @@ index 22a073d..bfb3195 100644
oist = &per_cpu(orig_ist, cpu);
#ifdef CONFIG_NUMA
-@@ -1180,7 +1133,7 @@ void __cpuinit cpu_init(void)
+@@ -1185,7 +1138,7 @@ void __cpuinit cpu_init(void)
switch_to_new_gdt(cpu);
loadsegment(fs, 0);
@@ -11561,7 +12067,7 @@ index 22a073d..bfb3195 100644
memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8);
syscall_init();
-@@ -1189,7 +1142,6 @@ void __cpuinit cpu_init(void)
+@@ -1194,7 +1147,6 @@ void __cpuinit cpu_init(void)
wrmsrl(MSR_KERNEL_GS_BASE, 0);
barrier();
@@ -11569,7 +12075,7 @@ index 22a073d..bfb3195 100644
if (cpu != 0)
enable_x2apic();
-@@ -1243,7 +1195,7 @@ void __cpuinit cpu_init(void)
+@@ -1248,7 +1200,7 @@ void __cpuinit cpu_init(void)
{
int cpu = smp_processor_id();
struct task_struct *curr = current;
@@ -11579,10 +12085,10 @@ index 22a073d..bfb3195 100644
if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) {
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
-index ed6086e..a1dcf29 100644
+index 5231312..a78a987 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
-@@ -172,7 +172,7 @@ static void __cpuinit trap_init_f00f_bug(void)
+@@ -174,7 +174,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.
*/
@@ -11591,34 +12097,19 @@ index ed6086e..a1dcf29 100644
load_idt(&idt_descr);
}
#endif
-diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
-index 0ed633c..82cef2a 100644
---- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
-+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
-@@ -215,7 +215,9 @@ static int inject_init(void)
- if (!alloc_cpumask_var(&mce_inject_cpumask, GFP_KERNEL))
- return -ENOMEM;
- printk(KERN_INFO "Machine check injector initialized\n");
-- mce_chrdev_ops.write = mce_write;
-+ pax_open_kernel();
-+ *(void **)&mce_chrdev_ops.write = mce_write;
-+ pax_close_kernel();
- register_die_notifier(&mce_raise_nb);
- return 0;
- }
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
-index ff1ae9b..f2d105b 100644
+index 2af127d..8ff7ac0 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
-@@ -46,6 +46,7 @@
- #include <asm/ipi.h>
+@@ -42,6 +42,7 @@
+ #include <asm/processor.h>
#include <asm/mce.h>
#include <asm/msr.h>
+#include <asm/local.h>
#include "mce-internal.h"
-@@ -208,7 +209,7 @@ static void print_mce(struct mce *m)
+@@ -202,7 +203,7 @@ static void print_mce(struct mce *m)
!(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
m->cs, m->ip);
@@ -11627,7 +12118,7 @@ index ff1ae9b..f2d105b 100644
print_symbol("{%s}", m->ip);
pr_cont("\n");
}
-@@ -236,10 +237,10 @@ static void print_mce(struct mce *m)
+@@ -235,10 +236,10 @@ static void print_mce(struct mce *m)
#define PANIC_TIMEOUT 5 /* 5 seconds */
@@ -11640,7 +12131,7 @@ index ff1ae9b..f2d105b 100644
/* Panic in progress. Enable interrupts and wait for final IPI */
static void wait_for_panic(void)
-@@ -263,7 +264,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
+@@ -262,7 +263,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
/*
* Make sure only one CPU runs in machine check panic
*/
@@ -11649,7 +12140,7 @@ index ff1ae9b..f2d105b 100644
wait_for_panic();
barrier();
-@@ -271,7 +272,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
+@@ -270,7 +271,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
console_verbose();
} else {
/* Don't log too much for fake panic */
@@ -11658,7 +12149,7 @@ index ff1ae9b..f2d105b 100644
return;
}
/* First print corrected ones that are still unlogged */
-@@ -638,7 +639,7 @@ static int mce_timed_out(u64 *t)
+@@ -610,7 +611,7 @@ static int mce_timed_out(u64 *t)
* might have been modified by someone else.
*/
rmb();
@@ -11667,42 +12158,62 @@ index ff1ae9b..f2d105b 100644
wait_for_panic();
if (!monarch_timeout)
goto out;
-@@ -1452,14 +1453,14 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
+@@ -1398,7 +1399,7 @@ static void unexpected_machine_check(struct pt_regs *regs, long error_code)
+ }
+
+ /* Call the installed machine check handler for this CPU setup. */
+-void (*machine_check_vector)(struct pt_regs *, long error_code) =
++void (*machine_check_vector)(struct pt_regs *, long error_code) __read_only =
+ unexpected_machine_check;
+
+ /*
+@@ -1421,7 +1422,9 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
+ return;
+ }
+
++ pax_open_kernel();
+ machine_check_vector = do_machine_check;
++ pax_close_kernel();
+
+ __mcheck_cpu_init_generic();
+ __mcheck_cpu_init_vendor(c);
+@@ -1435,7 +1438,7 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
*/
- static DEFINE_SPINLOCK(mce_state_lock);
--static int open_count; /* #times opened */
-+static local_t open_count; /* #times opened */
- static int open_exclu; /* already open exclusive? */
+ static DEFINE_SPINLOCK(mce_chrdev_state_lock);
+-static int mce_chrdev_open_count; /* #times opened */
++static local_t mce_chrdev_open_count; /* #times opened */
+ static int mce_chrdev_open_exclu; /* already open exclusive? */
- static int mce_open(struct inode *inode, struct file *file)
- {
- spin_lock(&mce_state_lock);
+ static int mce_chrdev_open(struct inode *inode, struct file *file)
+@@ -1443,7 +1446,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
+ spin_lock(&mce_chrdev_state_lock);
-- if (open_exclu || (open_count && (file->f_flags & O_EXCL))) {
-+ if (open_exclu || (local_read(&open_count) && (file->f_flags & O_EXCL))) {
- spin_unlock(&mce_state_lock);
+ if (mce_chrdev_open_exclu ||
+- (mce_chrdev_open_count && (file->f_flags & O_EXCL))) {
++ (local_read(&mce_chrdev_open_count) && (file->f_flags & O_EXCL))) {
+ spin_unlock(&mce_chrdev_state_lock);
return -EBUSY;
-@@ -1467,7 +1468,7 @@ static int mce_open(struct inode *inode, struct file *file)
+@@ -1451,7 +1454,7 @@ static int mce_chrdev_open(struct inode *inode, struct file *file)
if (file->f_flags & O_EXCL)
- open_exclu = 1;
-- open_count++;
-+ local_inc(&open_count);
+ mce_chrdev_open_exclu = 1;
+- mce_chrdev_open_count++;
++ local_inc(&mce_chrdev_open_count);
- spin_unlock(&mce_state_lock);
+ spin_unlock(&mce_chrdev_state_lock);
-@@ -1478,7 +1479,7 @@ static int mce_release(struct inode *inode, struct file *file)
+@@ -1462,7 +1465,7 @@ static int mce_chrdev_release(struct inode *inode, struct file *file)
{
- spin_lock(&mce_state_lock);
+ spin_lock(&mce_chrdev_state_lock);
-- open_count--;
-+ local_dec(&open_count);
- open_exclu = 0;
+- mce_chrdev_open_count--;
++ local_dec(&mce_chrdev_open_count);
+ mce_chrdev_open_exclu = 0;
- spin_unlock(&mce_state_lock);
-@@ -2163,7 +2164,7 @@ struct dentry *mce_get_debugfs_dir(void)
+ spin_unlock(&mce_chrdev_state_lock);
+@@ -2171,7 +2174,7 @@ struct dentry *mce_get_debugfs_dir(void)
static void mce_reset(void)
{
cpu_missing = 0;
@@ -11711,8 +12222,36 @@ index ff1ae9b..f2d105b 100644
atomic_set(&mce_executing, 0);
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 5c0e653..1e82c7c 100644
+--- a/arch/x86/kernel/cpu/mcheck/p5.c
++++ b/arch/x86/kernel/cpu/mcheck/p5.c
+@@ -50,7 +50,9 @@ void intel_p5_mcheck_init(struct cpuinfo_x86 *c)
+ if (!cpu_has(c, X86_FEATURE_MCE))
+ return;
+
++ pax_open_kernel();
+ machine_check_vector = pentium_machine_check;
++ pax_close_kernel();
+ /* Make sure the vector pointer is visible before we enable MCEs: */
+ wmb();
+
+diff --git a/arch/x86/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c
+index 54060f5..e6ba93d 100644
+--- a/arch/x86/kernel/cpu/mcheck/winchip.c
++++ b/arch/x86/kernel/cpu/mcheck/winchip.c
+@@ -24,7 +24,9 @@ void winchip_mcheck_init(struct cpuinfo_x86 *c)
+ {
+ u32 lo, hi;
+
++ pax_open_kernel();
+ machine_check_vector = winchip_machine_check;
++ pax_close_kernel();
+ /* Make sure the vector pointer is visible before we enable MCEs: */
+ wmb();
+
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
-index 3d17bc7..b106841 100644
+index 6b96110..0da73eb 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);
@@ -11738,19 +12277,10 @@ 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 bf6d692..90ee554 100644
+index 2bda212..78cc605 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
-@@ -781,6 +781,8 @@ static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
- int i, j, w, wmax, num = 0;
- struct hw_perf_event *hwc;
-
-+ pax_track_stack();
-+
- bitmap_zero(used_mask, X86_PMC_IDX_MAX);
-
- for (i = 0; i < n; i++) {
-@@ -1875,7 +1877,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
+@@ -1529,7 +1529,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
break;
perf_callchain_store(entry, frame.return_address);
@@ -11760,13 +12290,16 @@ index bf6d692..90ee554 100644
}
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
-index 764c7c2..c5d9c7b 100644
+index 13ad899..f642b9a 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
-@@ -42,7 +42,7 @@ static void kdump_nmi_callback(int cpu, struct die_args *args)
- regs = args->regs;
-
+@@ -36,10 +36,8 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs)
+ {
#ifdef CONFIG_X86_32
+ struct pt_regs fixed_regs;
+-#endif
+
+-#ifdef CONFIG_X86_32
- if (!user_mode_vm(regs)) {
+ if (!user_mode(regs)) {
crash_fixup_ss_esp(&fixed_regs, regs);
@@ -11955,7 +12488,7 @@ index 1aae78f..aab3a3d 100644
if (__die(str, regs, err))
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
-index 3b97a80..2d7ebd5 100644
+index c99f9ed..2a15d80 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,
@@ -12005,14 +12538,14 @@ index 3b97a80..2d7ebd5 100644
}
for (i = 0; i < code_len; i++, ip++) {
@@ -119,7 +118,7 @@ void show_registers(struct pt_regs *regs)
- printk(" Bad EIP value.");
+ printk(KERN_CONT " Bad EIP value.");
break;
}
- if (ip == (u8 *)regs->ip)
+ if (ip == (u8 *)regs->ip + cs_base)
- printk("<%02x> ", c);
+ printk(KERN_CONT "<%02x> ", c);
else
- printk("%02x ", c);
+ printk(KERN_CONT "%02x ", c);
@@ -132,6 +131,7 @@ int is_valid_bugaddr(unsigned long ip)
{
unsigned short ud2;
@@ -12021,11 +12554,27 @@ index 3b97a80..2d7ebd5 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)
+
+ return ud2 == 0x0b0f;
+ }
++
++#ifdef CONFIG_PAX_MEMORY_STACKLEAK
++void pax_check_alloca(unsigned long size)
++{
++ unsigned long sp = (unsigned long)&sp, stack_left;
++
++ /* all kernel stacks are of the same size */
++ stack_left = sp & (THREAD_SIZE - 1);
++ BUG_ON(stack_left < 256 || size >= stack_left - 256);
++}
++EXPORT_SYMBOL(pax_check_alloca);
++#endif
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
-index e71c98d..8d00db8 100644
+index 6d728d9..279514e 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
-@@ -147,9 +147,9 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+@@ -119,9 +119,9 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
unsigned long *irq_stack_end =
(unsigned long *)per_cpu(irq_stack_ptr, cpu);
unsigned used = 0;
@@ -12036,7 +12585,7 @@ index e71c98d..8d00db8 100644
if (!task)
task = current;
-@@ -167,10 +167,10 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+@@ -142,10 +142,10 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
* current stack address. If the stacks consist of nested
* exceptions
*/
@@ -12048,7 +12597,7 @@ index e71c98d..8d00db8 100644
estack_end = in_exception_stack(cpu, (unsigned long)stack,
&used, &id);
-@@ -178,7 +178,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+@@ -153,7 +153,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
if (ops->stack(data, id) < 0)
break;
@@ -12057,7 +12606,7 @@ index e71c98d..8d00db8 100644
data, estack_end, &graph);
ops->stack(data, "<EOE>");
/*
-@@ -197,7 +197,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+@@ -172,7 +172,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
if (in_irq_stack(stack, irq_stack, irq_stack_end)) {
if (ops->stack(data, "IRQ") < 0)
break;
@@ -12066,7 +12615,7 @@ index e71c98d..8d00db8 100644
ops, data, irq_stack_end, &graph);
/*
* We link to the next stack (which would be
-@@ -218,7 +218,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
+@@ -191,7 +191,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
/*
* This handles the process stack:
*/
@@ -12076,8 +12625,59 @@ index e71c98d..8d00db8 100644
put_cpu();
}
EXPORT_SYMBOL(dump_trace);
+@@ -305,3 +306,50 @@ int is_valid_bugaddr(unsigned long ip)
+
+ return ud2 == 0x0b0f;
+ }
++
++#ifdef CONFIG_PAX_MEMORY_STACKLEAK
++void pax_check_alloca(unsigned long size)
++{
++ unsigned long sp = (unsigned long)&sp, stack_start, stack_end;
++ unsigned cpu, used;
++ char *id;
++
++ /* check the process stack first */
++ stack_start = (unsigned long)task_stack_page(current);
++ stack_end = stack_start + THREAD_SIZE;
++ if (likely(stack_start <= sp && sp < stack_end)) {
++ unsigned long stack_left = sp & (THREAD_SIZE - 1);
++ BUG_ON(stack_left < 256 || size >= stack_left - 256);
++ return;
++ }
++
++ cpu = get_cpu();
++
++ /* check the irq stacks */
++ stack_end = (unsigned long)per_cpu(irq_stack_ptr, cpu);
++ stack_start = stack_end - IRQ_STACK_SIZE;
++ if (stack_start <= sp && sp < stack_end) {
++ unsigned long stack_left = sp & (IRQ_STACK_SIZE - 1);
++ put_cpu();
++ BUG_ON(stack_left < 256 || size >= stack_left - 256);
++ return;
++ }
++
++ /* check the exception stacks */
++ used = 0;
++ stack_end = (unsigned long)in_exception_stack(cpu, sp, &used, &id);
++ stack_start = stack_end - EXCEPTION_STKSZ;
++ if (stack_end && stack_start <= sp && sp < stack_end) {
++ unsigned long stack_left = sp & (EXCEPTION_STKSZ - 1);
++ put_cpu();
++ BUG_ON(stack_left < 256 || size >= stack_left - 256);
++ return;
++ }
++
++ put_cpu();
++
++ /* unknown stack */
++ BUG();
++}
++EXPORT_SYMBOL(pax_check_alloca);
++#endif
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
-index cd28a35..2601699 100644
+index cd28a35..c72ed9a 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -7,6 +7,7 @@
@@ -12088,20 +12688,11 @@ index cd28a35..2601699 100644
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/fcntl.h>
-@@ -179,6 +180,8 @@ asmlinkage void early_printk(const char *fmt, ...)
- int n;
- va_list ap;
-
-+ pax_track_stack();
-+
- va_start(ap, fmt);
- n = vscnprintf(buf, sizeof(buf), fmt, ap);
- early_console->write(early_console, buf, n);
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
-index 5c1a9197..6bc1991 100644
+index f3f6f53..0841b66 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
-@@ -185,13 +185,146 @@
+@@ -186,13 +186,146 @@
/*CFI_REL_OFFSET gs, PT_GS*/
.endm
.macro SET_KERNEL_GS reg
@@ -12249,7 +12840,7 @@ index 5c1a9197..6bc1991 100644
cld
PUSH_GS
pushl_cfi %fs
-@@ -214,7 +347,7 @@
+@@ -215,7 +348,7 @@
CFI_REL_OFFSET ecx, 0
pushl_cfi %ebx
CFI_REL_OFFSET ebx, 0
@@ -12258,7 +12849,7 @@ index 5c1a9197..6bc1991 100644
movl %edx, %ds
movl %edx, %es
movl $(__KERNEL_PERCPU), %edx
-@@ -222,6 +355,15 @@
+@@ -223,6 +356,15 @@
SET_KERNEL_GS %edx
.endm
@@ -12274,7 +12865,7 @@ index 5c1a9197..6bc1991 100644
.macro RESTORE_INT_REGS
popl_cfi %ebx
CFI_RESTORE ebx
-@@ -307,7 +449,7 @@ ENTRY(ret_from_fork)
+@@ -308,7 +450,7 @@ ENTRY(ret_from_fork)
popfl_cfi
jmp syscall_exit
CFI_ENDPROC
@@ -12283,7 +12874,7 @@ index 5c1a9197..6bc1991 100644
/*
* Interrupt exit functions should be protected against kprobes
-@@ -332,7 +474,15 @@ check_userspace:
+@@ -333,7 +475,15 @@ check_userspace:
movb PT_CS(%esp), %al
andl $(X86_EFLAGS_VM | SEGMENT_RPL_MASK), %eax
cmpl $USER_RPL, %eax
@@ -12299,7 +12890,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(resume_userspace)
LOCKDEP_SYS_EXIT
-@@ -344,8 +494,8 @@ ENTRY(resume_userspace)
+@@ -345,8 +495,8 @@ ENTRY(resume_userspace)
andl $_TIF_WORK_MASK, %ecx # is there any work to be done on
# int/exception return?
jne work_pending
@@ -12310,7 +12901,7 @@ index 5c1a9197..6bc1991 100644
#ifdef CONFIG_PREEMPT
ENTRY(resume_kernel)
-@@ -360,7 +510,7 @@ need_resched:
+@@ -361,7 +511,7 @@ need_resched:
jz restore_all
call preempt_schedule_irq
jmp need_resched
@@ -12319,7 +12910,7 @@ index 5c1a9197..6bc1991 100644
#endif
CFI_ENDPROC
/*
-@@ -394,23 +544,34 @@ sysenter_past_esp:
+@@ -395,23 +545,34 @@ sysenter_past_esp:
/*CFI_REL_OFFSET cs, 0*/
/*
* Push current_thread_info()->sysenter_return to the stack.
@@ -12357,7 +12948,7 @@ index 5c1a9197..6bc1991 100644
movl %ebp,PT_EBP(%esp)
.section __ex_table,"a"
.align 4
-@@ -433,12 +594,24 @@ sysenter_do_call:
+@@ -434,12 +595,24 @@ sysenter_do_call:
testl $_TIF_ALLWORK_MASK, %ecx
jne sysexit_audit
sysenter_exit:
@@ -12382,7 +12973,7 @@ index 5c1a9197..6bc1991 100644
PTGS_TO_GS
ENABLE_INTERRUPTS_SYSEXIT
-@@ -455,6 +628,9 @@ sysenter_audit:
+@@ -456,6 +629,9 @@ sysenter_audit:
movl %eax,%edx /* 2nd arg: syscall number */
movl $AUDIT_ARCH_I386,%eax /* 1st arg: audit arch */
call audit_syscall_entry
@@ -12392,7 +12983,7 @@ index 5c1a9197..6bc1991 100644
pushl_cfi %ebx
movl PT_EAX(%esp),%eax /* reload syscall number */
jmp sysenter_do_call
-@@ -481,11 +657,17 @@ sysexit_audit:
+@@ -482,11 +658,17 @@ sysexit_audit:
CFI_ENDPROC
.pushsection .fixup,"ax"
@@ -12412,7 +13003,7 @@ index 5c1a9197..6bc1991 100644
.popsection
PTGS_TO_GS_EX
ENDPROC(ia32_sysenter_target)
-@@ -518,6 +700,15 @@ syscall_exit:
+@@ -519,6 +701,15 @@ syscall_exit:
testl $_TIF_ALLWORK_MASK, %ecx # current->work
jne syscall_exit_work
@@ -12428,7 +13019,7 @@ index 5c1a9197..6bc1991 100644
restore_all:
TRACE_IRQS_IRET
restore_all_notrace:
-@@ -577,14 +768,34 @@ ldt_ss:
+@@ -578,14 +769,34 @@ ldt_ss:
* compensating for the offset by changing to the ESPFIX segment with
* a base address that matches for the difference.
*/
@@ -12466,7 +13057,7 @@ index 5c1a9197..6bc1991 100644
pushl_cfi $__ESPFIX_SS
pushl_cfi %eax /* new kernel esp */
/* Disable interrupts, but do not irqtrace this section: we
-@@ -613,34 +824,28 @@ work_resched:
+@@ -614,34 +825,28 @@ work_resched:
movl TI_flags(%ebp), %ecx
andl $_TIF_WORK_MASK, %ecx # is there any work to be done other
# than syscall tracing?
@@ -12506,7 +13097,7 @@ index 5c1a9197..6bc1991 100644
# perform syscall exit tracing
ALIGN
-@@ -648,11 +853,14 @@ syscall_trace_entry:
+@@ -649,11 +854,14 @@ syscall_trace_entry:
movl $-ENOSYS,PT_EAX(%esp)
movl %esp, %eax
call syscall_trace_enter
@@ -12522,7 +13113,7 @@ index 5c1a9197..6bc1991 100644
# perform syscall exit tracing
ALIGN
-@@ -665,20 +873,24 @@ syscall_exit_work:
+@@ -666,20 +874,24 @@ syscall_exit_work:
movl %esp, %eax
call syscall_trace_leave
jmp resume_userspace
@@ -12550,7 +13141,7 @@ index 5c1a9197..6bc1991 100644
CFI_ENDPROC
/*
* End of kprobes section
-@@ -752,6 +964,36 @@ ptregs_clone:
+@@ -753,6 +965,36 @@ ptregs_clone:
CFI_ENDPROC
ENDPROC(ptregs_clone)
@@ -12587,7 +13178,7 @@ index 5c1a9197..6bc1991 100644
.macro FIXUP_ESPFIX_STACK
/*
* Switch back for ESPFIX stack to the normal zerobased stack
-@@ -761,8 +1003,15 @@ ENDPROC(ptregs_clone)
+@@ -762,8 +1004,15 @@ ENDPROC(ptregs_clone)
* normal stack and adjusts ESP with the matching offset.
*/
/* fixup the stack */
@@ -12605,7 +13196,7 @@ index 5c1a9197..6bc1991 100644
shl $16, %eax
addl %esp, %eax /* the adjusted stack pointer */
pushl_cfi $__KERNEL_DS
-@@ -815,7 +1064,7 @@ vector=vector+1
+@@ -816,7 +1065,7 @@ vector=vector+1
.endr
2: jmp common_interrupt
.endr
@@ -12614,7 +13205,7 @@ index 5c1a9197..6bc1991 100644
.previous
END(interrupt)
-@@ -863,7 +1112,7 @@ ENTRY(coprocessor_error)
+@@ -864,7 +1113,7 @@ ENTRY(coprocessor_error)
pushl_cfi $do_coprocessor_error
jmp error_code
CFI_ENDPROC
@@ -12623,7 +13214,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(simd_coprocessor_error)
RING0_INT_FRAME
-@@ -889,7 +1138,7 @@ ENTRY(simd_coprocessor_error)
+@@ -885,7 +1134,7 @@ ENTRY(simd_coprocessor_error)
#endif
jmp error_code
CFI_ENDPROC
@@ -12632,7 +13223,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(device_not_available)
RING0_INT_FRAME
-@@ -897,7 +1146,7 @@ ENTRY(device_not_available)
+@@ -893,7 +1142,7 @@ ENTRY(device_not_available)
pushl_cfi $do_device_not_available
jmp error_code
CFI_ENDPROC
@@ -12641,7 +13232,7 @@ index 5c1a9197..6bc1991 100644
#ifdef CONFIG_PARAVIRT
ENTRY(native_iret)
-@@ -906,12 +1155,12 @@ ENTRY(native_iret)
+@@ -902,12 +1151,12 @@ ENTRY(native_iret)
.align 4
.long native_iret, iret_exc
.previous
@@ -12656,7 +13247,7 @@ index 5c1a9197..6bc1991 100644
#endif
ENTRY(overflow)
-@@ -920,7 +1169,7 @@ ENTRY(overflow)
+@@ -916,7 +1165,7 @@ ENTRY(overflow)
pushl_cfi $do_overflow
jmp error_code
CFI_ENDPROC
@@ -12665,7 +13256,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(bounds)
RING0_INT_FRAME
-@@ -928,7 +1177,7 @@ ENTRY(bounds)
+@@ -924,7 +1173,7 @@ ENTRY(bounds)
pushl_cfi $do_bounds
jmp error_code
CFI_ENDPROC
@@ -12674,7 +13265,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(invalid_op)
RING0_INT_FRAME
-@@ -936,7 +1185,7 @@ ENTRY(invalid_op)
+@@ -932,7 +1181,7 @@ ENTRY(invalid_op)
pushl_cfi $do_invalid_op
jmp error_code
CFI_ENDPROC
@@ -12683,7 +13274,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(coprocessor_segment_overrun)
RING0_INT_FRAME
-@@ -944,35 +1193,35 @@ ENTRY(coprocessor_segment_overrun)
+@@ -940,35 +1189,35 @@ ENTRY(coprocessor_segment_overrun)
pushl_cfi $do_coprocessor_segment_overrun
jmp error_code
CFI_ENDPROC
@@ -12724,7 +13315,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(divide_error)
RING0_INT_FRAME
-@@ -980,7 +1229,7 @@ ENTRY(divide_error)
+@@ -976,7 +1225,7 @@ ENTRY(divide_error)
pushl_cfi $do_divide_error
jmp error_code
CFI_ENDPROC
@@ -12733,7 +13324,7 @@ index 5c1a9197..6bc1991 100644
#ifdef CONFIG_X86_MCE
ENTRY(machine_check)
-@@ -989,7 +1238,7 @@ ENTRY(machine_check)
+@@ -985,7 +1234,7 @@ ENTRY(machine_check)
pushl_cfi machine_check_vector
jmp error_code
CFI_ENDPROC
@@ -12742,7 +13333,7 @@ index 5c1a9197..6bc1991 100644
#endif
ENTRY(spurious_interrupt_bug)
-@@ -998,7 +1247,7 @@ ENTRY(spurious_interrupt_bug)
+@@ -994,7 +1243,7 @@ ENTRY(spurious_interrupt_bug)
pushl_cfi $do_spurious_interrupt_bug
jmp error_code
CFI_ENDPROC
@@ -12751,7 +13342,7 @@ index 5c1a9197..6bc1991 100644
/*
* End of kprobes section
*/
-@@ -1113,7 +1362,7 @@ BUILD_INTERRUPT3(xen_hvm_callback_vector, XEN_HVM_EVTCHN_CALLBACK,
+@@ -1109,7 +1358,7 @@ BUILD_INTERRUPT3(xen_hvm_callback_vector, XEN_HVM_EVTCHN_CALLBACK,
ENTRY(mcount)
ret
@@ -12760,7 +13351,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(ftrace_caller)
cmpl $0, function_trace_stop
-@@ -1142,7 +1391,7 @@ ftrace_graph_call:
+@@ -1138,7 +1387,7 @@ ftrace_graph_call:
.globl ftrace_stub
ftrace_stub:
ret
@@ -12769,7 +13360,7 @@ index 5c1a9197..6bc1991 100644
#else /* ! CONFIG_DYNAMIC_FTRACE */
-@@ -1178,7 +1427,7 @@ trace:
+@@ -1174,7 +1423,7 @@ trace:
popl %ecx
popl %eax
jmp ftrace_stub
@@ -12778,7 +13369,7 @@ index 5c1a9197..6bc1991 100644
#endif /* CONFIG_DYNAMIC_FTRACE */
#endif /* CONFIG_FUNCTION_TRACER */
-@@ -1199,7 +1448,7 @@ ENTRY(ftrace_graph_caller)
+@@ -1195,7 +1444,7 @@ ENTRY(ftrace_graph_caller)
popl %ecx
popl %eax
ret
@@ -12787,7 +13378,7 @@ index 5c1a9197..6bc1991 100644
.globl return_to_handler
return_to_handler:
-@@ -1213,7 +1462,6 @@ return_to_handler:
+@@ -1209,7 +1458,6 @@ return_to_handler:
jmp *%ecx
#endif
@@ -12795,7 +13386,7 @@ index 5c1a9197..6bc1991 100644
#include "syscall_table_32.S"
syscall_table_size=(.-sys_call_table)
-@@ -1259,15 +1507,18 @@ error_code:
+@@ -1255,15 +1503,18 @@ error_code:
movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
REG_TO_PTGS %ecx
SET_KERNEL_GS %ecx
@@ -12816,7 +13407,7 @@ index 5c1a9197..6bc1991 100644
/*
* Debug traps and NMI can happen at the one SYSENTER instruction
-@@ -1309,7 +1560,7 @@ debug_stack_correct:
+@@ -1305,7 +1556,7 @@ debug_stack_correct:
call do_debug
jmp ret_from_exception
CFI_ENDPROC
@@ -12825,7 +13416,7 @@ index 5c1a9197..6bc1991 100644
/*
* NMI is doubly nasty. It can happen _while_ we're handling
-@@ -1346,6 +1597,9 @@ nmi_stack_correct:
+@@ -1342,6 +1593,9 @@ nmi_stack_correct:
xorl %edx,%edx # zero error code
movl %esp,%eax # pt_regs pointer
call do_nmi
@@ -12835,7 +13426,7 @@ index 5c1a9197..6bc1991 100644
jmp restore_all_notrace
CFI_ENDPROC
-@@ -1382,12 +1636,15 @@ nmi_espfix_stack:
+@@ -1378,12 +1632,15 @@ nmi_espfix_stack:
FIXUP_ESPFIX_STACK # %eax == %esp
xorl %edx,%edx # zero error code
call do_nmi
@@ -12852,7 +13443,7 @@ index 5c1a9197..6bc1991 100644
ENTRY(int3)
RING0_INT_FRAME
-@@ -1399,14 +1656,14 @@ ENTRY(int3)
+@@ -1395,14 +1652,14 @@ ENTRY(int3)
call do_int3
jmp ret_from_exception
CFI_ENDPROC
@@ -12869,7 +13460,7 @@ index 5c1a9197..6bc1991 100644
#ifdef CONFIG_KVM_GUEST
ENTRY(async_page_fault)
-@@ -1414,7 +1671,7 @@ ENTRY(async_page_fault)
+@@ -1410,7 +1667,7 @@ ENTRY(async_page_fault)
pushl_cfi $do_async_page_fault
jmp error_code
CFI_ENDPROC
@@ -12879,10 +13470,10 @@ index 5c1a9197..6bc1991 100644
/*
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
-index 8a445a0..f4d3cbd 100644
+index faf8d5e..f58c441 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
-@@ -53,6 +53,8 @@
+@@ -55,6 +55,8 @@
#include <asm/paravirt.h>
#include <asm/ftrace.h>
#include <asm/percpu.h>
@@ -12891,7 +13482,7 @@ index 8a445a0..f4d3cbd 100644
/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */
#include <linux/elf-em.h>
-@@ -66,8 +68,9 @@
+@@ -68,8 +70,9 @@
#ifdef CONFIG_FUNCTION_TRACER
#ifdef CONFIG_DYNAMIC_FTRACE
ENTRY(mcount)
@@ -12902,7 +13493,7 @@ index 8a445a0..f4d3cbd 100644
ENTRY(ftrace_caller)
cmpl $0, function_trace_stop
-@@ -90,8 +93,9 @@ GLOBAL(ftrace_graph_call)
+@@ -92,8 +95,9 @@ GLOBAL(ftrace_graph_call)
#endif
GLOBAL(ftrace_stub)
@@ -12913,7 +13504,7 @@ index 8a445a0..f4d3cbd 100644
#else /* ! CONFIG_DYNAMIC_FTRACE */
ENTRY(mcount)
-@@ -110,6 +114,7 @@ ENTRY(mcount)
+@@ -112,6 +116,7 @@ ENTRY(mcount)
#endif
GLOBAL(ftrace_stub)
@@ -12921,7 +13512,7 @@ index 8a445a0..f4d3cbd 100644
retq
trace:
-@@ -119,12 +124,13 @@ trace:
+@@ -121,12 +126,13 @@ trace:
movq 8(%rbp), %rsi
subq $MCOUNT_INSN_SIZE, %rdi
@@ -12936,7 +13527,7 @@ index 8a445a0..f4d3cbd 100644
#endif /* CONFIG_DYNAMIC_FTRACE */
#endif /* CONFIG_FUNCTION_TRACER */
-@@ -144,8 +150,9 @@ ENTRY(ftrace_graph_caller)
+@@ -146,8 +152,9 @@ ENTRY(ftrace_graph_caller)
MCOUNT_RESTORE_FRAME
@@ -12947,7 +13538,7 @@ index 8a445a0..f4d3cbd 100644
GLOBAL(return_to_handler)
subq $24, %rsp
-@@ -161,6 +168,7 @@ GLOBAL(return_to_handler)
+@@ -163,6 +170,7 @@ GLOBAL(return_to_handler)
movq 8(%rsp), %rdx
movq (%rsp), %rax
addq $24, %rsp
@@ -12955,7 +13546,7 @@ index 8a445a0..f4d3cbd 100644
jmp *%rdi
#endif
-@@ -176,6 +184,269 @@ ENTRY(native_usergs_sysret64)
+@@ -178,6 +186,282 @@ ENTRY(native_usergs_sysret64)
ENDPROC(native_usergs_sysret64)
#endif /* CONFIG_PARAVIRT */
@@ -12974,6 +13565,7 @@ index 8a445a0..f4d3cbd 100644
+ .endm
+
+ .macro pax_enter_kernel
++ pax_set_fptr_mask
+#ifdef CONFIG_PAX_KERNEXEC
+ call pax_enter_kernel
+#endif
@@ -12995,14 +13587,11 @@ index 8a445a0..f4d3cbd 100644
+
+ GET_CR0_INTO_RDI
+ bts $16,%rdi
-+ jnc 1f
++ jnc 3f
+ mov %cs,%edi
+ cmp $__KERNEL_CS,%edi
-+ jz 3f
-+ ljmpq __KERNEL_CS,3f
-+1: ljmpq __KERNEXEC_KERNEL_CS,2f
-+2: SET_RDI_INTO_CR0
-+3:
++ jnz 2f
++1:
+
+#ifdef CONFIG_PARAVIRT
+ PV_RESTORE_REGS(CLBR_RDI)
@@ -13011,6 +13600,11 @@ index 8a445a0..f4d3cbd 100644
+ popq %rdi
+ pax_force_retaddr
+ retq
++
++2: ljmpq __KERNEL_CS,1f
++3: ljmpq __KERNEXEC_KERNEL_CS,4f
++4: SET_RDI_INTO_CR0
++ jmp 1b
+ENDPROC(pax_enter_kernel)
+
+ENTRY(pax_exit_kernel)
@@ -13022,12 +13616,8 @@ index 8a445a0..f4d3cbd 100644
+
+ mov %cs,%rdi
+ cmp $__KERNEXEC_KERNEL_CS,%edi
-+ jnz 2f
-+ GET_CR0_INTO_RDI
-+ btr $16,%rdi
-+ ljmpq __KERNEL_CS,1f
-+1: SET_RDI_INTO_CR0
-+2:
++ jz 2f
++1:
+
+#ifdef CONFIG_PARAVIRT
+ PV_RESTORE_REGS(CLBR_RDI);
@@ -13036,10 +13626,24 @@ index 8a445a0..f4d3cbd 100644
+ popq %rdi
+ pax_force_retaddr
+ retq
++
++2: GET_CR0_INTO_RDI
++ btr $16,%rdi
++ 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
+ENDPROC(pax_exit_kernel)
+#endif
+
+ .macro pax_enter_kernel_user
++ pax_set_fptr_mask
+#ifdef CONFIG_PAX_MEMORY_UDEREF
+ call pax_enter_kernel_user
+#endif
@@ -13050,9 +13654,9 @@ index 8a445a0..f4d3cbd 100644
+ call pax_exit_kernel_user
+#endif
+#ifdef CONFIG_PAX_RANDKSTACK
-+ push %rax
++ pushq %rax
+ call pax_randomize_kstack
-+ pop %rax
++ popq %rax
+#endif
+ .endm
+
@@ -13164,24 +13768,24 @@ index 8a445a0..f4d3cbd 100644
+ENDPROC(pax_exit_kernel_user)
+#endif
+
-+ .macro pax_erase_kstack
++.macro pax_erase_kstack
+#ifdef CONFIG_PAX_MEMORY_STACKLEAK
+ call pax_erase_kstack
+#endif
-+ .endm
++.endm
+
+#ifdef CONFIG_PAX_MEMORY_STACKLEAK
+/*
-+ * r10: thread_info
++ * r11: thread_info
+ * rcx, rdx: can be clobbered
+ */
+ENTRY(pax_erase_kstack)
+ pushq %rdi
+ pushq %rax
-+ pushq %r10
++ pushq %r11
+
-+ GET_THREAD_INFO(%r10)
-+ mov TI_lowest_stack(%r10), %rdi
++ GET_THREAD_INFO(%r11)
++ mov TI_lowest_stack(%r11), %rdi
+ mov $-0xBEEF, %rax
+ std
+
@@ -13211,11 +13815,11 @@ index 8a445a0..f4d3cbd 100644
+ shr $3, %ecx
+ rep stosq
+
-+ mov TI_task_thread_sp0(%r10), %rdi
++ mov TI_task_thread_sp0(%r11), %rdi
+ sub $256, %rdi
-+ mov %rdi, TI_lowest_stack(%r10)
++ mov %rdi, TI_lowest_stack(%r11)
+
-+ popq %r10
++ popq %r11
+ popq %rax
+ popq %rdi
+ pax_force_retaddr
@@ -13225,28 +13829,27 @@ index 8a445a0..f4d3cbd 100644
.macro TRACE_IRQS_IRETQ offset=ARGOFFSET
#ifdef CONFIG_TRACE_IRQFLAGS
-@@ -318,7 +589,7 @@ ENTRY(save_args)
- leaq -RBP+8(%rsp),%rdi /* arg1 for handler */
- movq_cfi rbp, 8 /* push %rbp */
- leaq 8(%rsp), %rbp /* mov %rsp, %ebp */
+@@ -231,8 +515,8 @@ ENDPROC(native_usergs_sysret64)
+ .endm
+
+ .macro UNFAKE_STACK_FRAME
+- addq $8*6, %rsp
+- CFI_ADJUST_CFA_OFFSET -(6*8)
++ addq $8*6 + ARG_SKIP, %rsp
++ CFI_ADJUST_CFA_OFFSET -(6*8 + ARG_SKIP)
+ .endm
+
+ /*
+@@ -319,7 +603,7 @@ ENDPROC(native_usergs_sysret64)
+ movq %rsp, %rsi
+
+ leaq -RBP(%rsp),%rdi /* arg1 for handler */
- testl $3, CS(%rdi)
+ testb $3, CS(%rdi)
je 1f
SWAPGS
/*
-@@ -338,9 +609,10 @@ ENTRY(save_args)
- * We entered an interrupt context - irqs are off:
- */
- 2: TRACE_IRQS_OFF
-+ pax_force_retaddr
- ret
- CFI_ENDPROC
--END(save_args)
-+ENDPROC(save_args)
- .popsection
-
- ENTRY(save_rest)
-@@ -354,9 +626,10 @@ ENTRY(save_rest)
+@@ -355,9 +639,10 @@ ENTRY(save_rest)
movq_cfi r15, R15+16
movq %r11, 8(%rsp) /* return address */
FIXUP_TOP_OF_STACK %r11, 16
@@ -13258,12 +13861,12 @@ index 8a445a0..f4d3cbd 100644
/* save complete stack frame */
.pushsection .kprobes.text, "ax"
-@@ -385,9 +658,10 @@ ENTRY(save_paranoid)
+@@ -386,9 +671,10 @@ ENTRY(save_paranoid)
js 1f /* negative -> in kernel */
SWAPGS
xorl %ebx,%ebx
-1: ret
-+1: pax_force_retaddr
++1: pax_force_retaddr_bts
+ ret
CFI_ENDPROC
-END(save_paranoid)
@@ -13271,7 +13874,7 @@ index 8a445a0..f4d3cbd 100644
.popsection
/*
-@@ -409,7 +683,7 @@ ENTRY(ret_from_fork)
+@@ -410,7 +696,7 @@ ENTRY(ret_from_fork)
RESTORE_REST
@@ -13280,7 +13883,7 @@ index 8a445a0..f4d3cbd 100644
je int_ret_from_sys_call
testl $_TIF_IA32, TI_flags(%rcx) # 32-bit compat task needs IRET
-@@ -419,7 +693,7 @@ ENTRY(ret_from_fork)
+@@ -420,7 +706,7 @@ ENTRY(ret_from_fork)
jmp ret_from_sys_call # go to the SYSRET fastpath
CFI_ENDPROC
@@ -13289,7 +13892,7 @@ index 8a445a0..f4d3cbd 100644
/*
* System call entry. Up to 6 arguments in registers are supported.
-@@ -455,7 +729,7 @@ END(ret_from_fork)
+@@ -456,7 +742,7 @@ END(ret_from_fork)
ENTRY(system_call)
CFI_STARTPROC simple
CFI_SIGNAL_FRAME
@@ -13298,22 +13901,31 @@ index 8a445a0..f4d3cbd 100644
CFI_REGISTER rip,rcx
/*CFI_REGISTER rflags,r11*/
SWAPGS_UNSAFE_STACK
-@@ -468,12 +742,13 @@ ENTRY(system_call_after_swapgs)
+@@ -469,12 +755,13 @@ ENTRY(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
/*
* No need to follow this irqs off/on section - it's straight
* and short:
*/
ENABLE_INTERRUPTS(CLBR_NONE)
-- SAVE_ARGS 8,1
-+ SAVE_ARGS 8*6,1
+- SAVE_ARGS 8,0
movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
movq %rcx,RIP-ARGOFFSET(%rsp)
CFI_REL_OFFSET rip,RIP-ARGOFFSET
-@@ -502,6 +777,8 @@ sysret_check:
+@@ -484,7 +771,7 @@ ENTRY(system_call_after_swapgs)
+ system_call_fastpath:
+ cmpq $__NR_syscall_max,%rax
+ ja badsys
+- movq %r10,%rcx
++ movq R10-ARGOFFSET(%rsp),%rcx
+ call *sys_call_table(,%rax,8) # XXX: rip relative
+ movq %rax,RAX-ARGOFFSET(%rsp)
+ /*
+@@ -503,6 +790,8 @@ sysret_check:
andl %edi,%edx
jnz sysret_careful
CFI_REMEMBER_STATE
@@ -13322,7 +13934,15 @@ index 8a445a0..f4d3cbd 100644
/*
* sysretq will re-enable interrupts:
*/
-@@ -560,6 +837,9 @@ auditsys:
+@@ -554,14 +843,18 @@ badsys:
+ * jump back to the normal fast path.
+ */
+ auditsys:
+- movq %r10,%r9 /* 6th arg: 4th syscall arg */
++ movq R10-ARGOFFSET(%rsp),%r9 /* 6th arg: 4th syscall arg */
+ movq %rdx,%r8 /* 5th arg: 3rd syscall arg */
+ movq %rsi,%rcx /* 4th arg: 2nd syscall arg */
+ movq %rdi,%rdx /* 3rd arg: 1st syscall arg */
movq %rax,%rsi /* 2nd arg: syscall number */
movl $AUDIT_ARCH_X86_64,%edi /* 1st arg: audit arch */
call audit_syscall_entry
@@ -13330,9 +13950,11 @@ index 8a445a0..f4d3cbd 100644
+ pax_erase_kstack
+
LOAD_ARGS 0 /* reload call-clobbered registers */
++ pax_set_fptr_mask
jmp system_call_fastpath
-@@ -590,6 +870,9 @@ tracesys:
+ /*
+@@ -591,16 +884,20 @@ tracesys:
FIXUP_TOP_OF_STACK %rdi
movq %rsp,%rdi
call syscall_trace_enter
@@ -13342,7 +13964,19 @@ index 8a445a0..f4d3cbd 100644
/*
* Reload arg registers from stack in case ptrace changed them.
* We don't reload %rax because syscall_trace_enter() returned
-@@ -611,7 +894,7 @@ tracesys:
+ * the value it wants us to use in the table lookup.
+ */
+ LOAD_ARGS ARGOFFSET, 1
++ pax_set_fptr_mask
+ RESTORE_REST
+ cmpq $__NR_syscall_max,%rax
+ ja int_ret_from_sys_call /* RAX(%rsp) set to -ENOSYS above */
+- movq %r10,%rcx /* fixup for C */
++ movq R10-ARGOFFSET(%rsp),%rcx /* fixup for C */
+ call *sys_call_table(,%rax,8)
+ movq %rax,RAX-ARGOFFSET(%rsp)
+ /* Use IRET because user could have changed frame */
+@@ -612,7 +909,7 @@ tracesys:
GLOBAL(int_ret_from_sys_call)
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
@@ -13351,7 +13985,7 @@ index 8a445a0..f4d3cbd 100644
je retint_restore_args
movl $_TIF_ALLWORK_MASK,%edi
/* edi: mask to check */
-@@ -668,7 +951,7 @@ int_restore_rest:
+@@ -669,7 +966,7 @@ int_restore_rest:
TRACE_IRQS_OFF
jmp int_with_check
CFI_ENDPROC
@@ -13360,7 +13994,7 @@ index 8a445a0..f4d3cbd 100644
/*
* Certain special system calls that need to save a complete full stack frame.
-@@ -684,7 +967,7 @@ ENTRY(\label)
+@@ -685,7 +982,7 @@ ENTRY(\label)
call \func
jmp ptregscall_common
CFI_ENDPROC
@@ -13369,7 +14003,7 @@ index 8a445a0..f4d3cbd 100644
.endm
PTREGSCALL stub_clone, sys_clone, %r8
-@@ -702,9 +985,10 @@ ENTRY(ptregscall_common)
+@@ -703,9 +1000,10 @@ ENTRY(ptregscall_common)
movq_cfi_restore R12+8, r12
movq_cfi_restore RBP+8, rbp
movq_cfi_restore RBX+8, rbx
@@ -13381,7 +14015,7 @@ index 8a445a0..f4d3cbd 100644
ENTRY(stub_execve)
CFI_STARTPROC
-@@ -719,7 +1003,7 @@ ENTRY(stub_execve)
+@@ -720,7 +1018,7 @@ ENTRY(stub_execve)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
@@ -13390,7 +14024,7 @@ index 8a445a0..f4d3cbd 100644
/*
* sigreturn is special because it needs to restore all registers on return.
-@@ -737,7 +1021,7 @@ ENTRY(stub_rt_sigreturn)
+@@ -738,7 +1036,7 @@ ENTRY(stub_rt_sigreturn)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
@@ -13399,7 +14033,7 @@ index 8a445a0..f4d3cbd 100644
/*
* Build the entry stubs and pointer table with some assembler magic.
-@@ -772,7 +1056,7 @@ vector=vector+1
+@@ -773,7 +1071,7 @@ vector=vector+1
2: jmp common_interrupt
.endr
CFI_ENDPROC
@@ -13408,10 +14042,10 @@ index 8a445a0..f4d3cbd 100644
.previous
END(interrupt)
-@@ -793,6 +1077,16 @@ END(interrupt)
+@@ -793,6 +1091,16 @@ END(interrupt)
+ subq $ORIG_RAX-RBP, %rsp
CFI_ADJUST_CFA_OFFSET ORIG_RAX-RBP
- call save_args
- PARTIAL_FRAME 0
+ SAVE_ARGS_IRQ
+#ifdef CONFIG_PAX_MEMORY_UDEREF
+ testb $3, CS(%rdi)
+ jnz 1f
@@ -13425,8 +14059,8 @@ index 8a445a0..f4d3cbd 100644
call \func
.endm
-@@ -825,7 +1119,7 @@ ret_from_intr:
- CFI_ADJUST_CFA_OFFSET -8
+@@ -824,7 +1132,7 @@ ret_from_intr:
+
exit_intr:
GET_THREAD_INFO(%rcx)
- testl $3,CS-ARGOFFSET(%rsp)
@@ -13434,7 +14068,7 @@ index 8a445a0..f4d3cbd 100644
je retint_kernel
/* Interrupt came from user space */
-@@ -847,12 +1141,16 @@ retint_swapgs: /* return to user-space */
+@@ -846,12 +1154,16 @@ retint_swapgs: /* return to user-space */
* The iretq could re-enable interrupts:
*/
DISABLE_INTERRUPTS(CLBR_ANY)
@@ -13451,7 +14085,7 @@ index 8a445a0..f4d3cbd 100644
/*
* The iretq could re-enable interrupts:
*/
-@@ -941,7 +1239,7 @@ ENTRY(retint_kernel)
+@@ -940,7 +1252,7 @@ ENTRY(retint_kernel)
#endif
CFI_ENDPROC
@@ -13460,7 +14094,7 @@ index 8a445a0..f4d3cbd 100644
/*
* End of kprobes section
*/
-@@ -957,7 +1255,7 @@ ENTRY(\sym)
+@@ -956,7 +1268,7 @@ ENTRY(\sym)
interrupt \do_sym
jmp ret_from_intr
CFI_ENDPROC
@@ -13469,7 +14103,7 @@ index 8a445a0..f4d3cbd 100644
.endm
#ifdef CONFIG_SMP
-@@ -1027,12 +1325,22 @@ ENTRY(\sym)
+@@ -1021,12 +1333,22 @@ ENTRY(\sym)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call error_entry
DEFAULT_FRAME 0
@@ -13493,7 +14127,7 @@ index 8a445a0..f4d3cbd 100644
.endm
.macro paranoidzeroentry sym do_sym
-@@ -1044,15 +1352,25 @@ ENTRY(\sym)
+@@ -1038,15 +1360,25 @@ ENTRY(\sym)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call save_paranoid
TRACE_IRQS_OFF
@@ -13521,7 +14155,7 @@ index 8a445a0..f4d3cbd 100644
.macro paranoidzeroentry_ist sym do_sym ist
ENTRY(\sym)
INTR_FRAME
-@@ -1062,14 +1380,30 @@ ENTRY(\sym)
+@@ -1056,14 +1388,30 @@ ENTRY(\sym)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call save_paranoid
TRACE_IRQS_OFF
@@ -13553,7 +14187,7 @@ index 8a445a0..f4d3cbd 100644
.endm
.macro errorentry sym do_sym
-@@ -1080,13 +1414,23 @@ ENTRY(\sym)
+@@ -1074,13 +1422,23 @@ ENTRY(\sym)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call error_entry
DEFAULT_FRAME 0
@@ -13578,7 +14212,7 @@ index 8a445a0..f4d3cbd 100644
.endm
/* error code is on the stack already */
-@@ -1099,13 +1443,23 @@ ENTRY(\sym)
+@@ -1093,13 +1451,23 @@ ENTRY(\sym)
call save_paranoid
DEFAULT_FRAME 0
TRACE_IRQS_OFF
@@ -13603,7 +14237,7 @@ index 8a445a0..f4d3cbd 100644
.endm
zeroentry divide_error do_divide_error
-@@ -1134,9 +1488,10 @@ gs_change:
+@@ -1129,9 +1497,10 @@ gs_change:
2: mfence /* workaround */
SWAPGS
popfq_cfi
@@ -13615,7 +14249,7 @@ index 8a445a0..f4d3cbd 100644
.section __ex_table,"a"
.align 8
-@@ -1158,13 +1513,14 @@ ENTRY(kernel_thread_helper)
+@@ -1153,13 +1522,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.
*/
@@ -13631,9 +14265,11 @@ index 8a445a0..f4d3cbd 100644
/*
* execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
-@@ -1193,9 +1549,10 @@ ENTRY(kernel_execve)
+@@ -1186,11 +1556,11 @@ ENTRY(kernel_execve)
+ RESTORE_REST
+ testq %rax,%rax
je int_ret_from_sys_call
- RESTORE_ARGS
+- RESTORE_ARGS
UNFAKE_STACK_FRAME
+ pax_force_retaddr
ret
@@ -13643,7 +14279,7 @@ index 8a445a0..f4d3cbd 100644
/* Call softirq on interrupt stack. Interrupts are off. */
ENTRY(call_softirq)
-@@ -1213,9 +1570,10 @@ ENTRY(call_softirq)
+@@ -1208,9 +1578,10 @@ ENTRY(call_softirq)
CFI_DEF_CFA_REGISTER rsp
CFI_ADJUST_CFA_OFFSET -8
decl PER_CPU_VAR(irq_count)
@@ -13655,7 +14291,7 @@ index 8a445a0..f4d3cbd 100644
#ifdef CONFIG_XEN
zeroentry xen_hypervisor_callback xen_do_hypervisor_callback
-@@ -1253,7 +1611,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
+@@ -1248,7 +1619,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
decl PER_CPU_VAR(irq_count)
jmp error_exit
CFI_ENDPROC
@@ -13664,7 +14300,7 @@ index 8a445a0..f4d3cbd 100644
/*
* Hypervisor uses this for application faults while it executes.
-@@ -1312,7 +1670,7 @@ ENTRY(xen_failsafe_callback)
+@@ -1307,7 +1678,7 @@ ENTRY(xen_failsafe_callback)
SAVE_ALL
jmp error_exit
CFI_ENDPROC
@@ -13673,7 +14309,7 @@ index 8a445a0..f4d3cbd 100644
apicinterrupt XEN_HVM_EVTCHN_CALLBACK \
xen_hvm_callback_vector xen_evtchn_do_upcall
-@@ -1361,16 +1719,31 @@ ENTRY(paranoid_exit)
+@@ -1356,16 +1727,31 @@ ENTRY(paranoid_exit)
TRACE_IRQS_OFF
testl %ebx,%ebx /* swapgs needed? */
jnz paranoid_restore
@@ -13685,7 +14321,7 @@ index 8a445a0..f4d3cbd 100644
+ TRACE_IRQS_IRETQ 0
+ SWAPGS_UNSAFE_STACK
+ RESTORE_ALL 8
-+ pax_force_retaddr
++ pax_force_retaddr_bts
+ jmp irq_return
+#endif
paranoid_swapgs:
@@ -13702,11 +14338,11 @@ index 8a445a0..f4d3cbd 100644
+ pax_exit_kernel
TRACE_IRQS_IRETQ 0
RESTORE_ALL 8
-+ pax_force_retaddr
++ pax_force_retaddr_bts
jmp irq_return
paranoid_userspace:
GET_THREAD_INFO(%rcx)
-@@ -1399,7 +1772,7 @@ paranoid_schedule:
+@@ -1394,7 +1780,7 @@ paranoid_schedule:
TRACE_IRQS_OFF
jmp paranoid_userspace
CFI_ENDPROC
@@ -13715,7 +14351,7 @@ index 8a445a0..f4d3cbd 100644
/*
* Exception entry point. This expects an error code/orig_rax on the stack.
-@@ -1426,12 +1799,13 @@ ENTRY(error_entry)
+@@ -1421,12 +1807,13 @@ ENTRY(error_entry)
movq_cfi r14, R14+8
movq_cfi r15, R15+8
xorl %ebx,%ebx
@@ -13726,11 +14362,11 @@ index 8a445a0..f4d3cbd 100644
SWAPGS
error_sti:
TRACE_IRQS_OFF
-+ pax_force_retaddr
++ pax_force_retaddr_bts
ret
/*
-@@ -1458,7 +1832,7 @@ bstep_iret:
+@@ -1453,7 +1840,7 @@ bstep_iret:
movq %rcx,RIP+8(%rsp)
jmp error_swapgs
CFI_ENDPROC
@@ -13739,7 +14375,7 @@ index 8a445a0..f4d3cbd 100644
/* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */
-@@ -1478,7 +1852,7 @@ ENTRY(error_exit)
+@@ -1473,7 +1860,7 @@ ENTRY(error_exit)
jnz retint_careful
jmp retint_swapgs
CFI_ENDPROC
@@ -13748,7 +14384,7 @@ index 8a445a0..f4d3cbd 100644
/* runs on exception stack */
-@@ -1490,6 +1864,16 @@ ENTRY(nmi)
+@@ -1485,6 +1872,16 @@ ENTRY(nmi)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call save_paranoid
DEFAULT_FRAME 0
@@ -13765,7 +14401,7 @@ index 8a445a0..f4d3cbd 100644
/* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
movq %rsp,%rdi
movq $-1,%rsi
-@@ -1500,12 +1884,28 @@ ENTRY(nmi)
+@@ -1495,12 +1892,28 @@ ENTRY(nmi)
DISABLE_INTERRUPTS(CLBR_NONE)
testl %ebx,%ebx /* swapgs needed? */
jnz nmi_restore
@@ -13776,7 +14412,7 @@ index 8a445a0..f4d3cbd 100644
+ pax_exit_kernel
+ SWAPGS_UNSAFE_STACK
+ RESTORE_ALL 8
-+ pax_force_retaddr
++ pax_force_retaddr_bts
+ jmp irq_return
+#endif
nmi_swapgs:
@@ -13791,11 +14427,11 @@ index 8a445a0..f4d3cbd 100644
nmi_restore:
+ pax_exit_kernel
RESTORE_ALL 8
-+ pax_force_retaddr
++ pax_force_retaddr_bts
jmp irq_return
nmi_userspace:
GET_THREAD_INFO(%rcx)
-@@ -1534,14 +1934,14 @@ nmi_schedule:
+@@ -1529,14 +1942,14 @@ nmi_schedule:
jmp paranoid_exit
CFI_ENDPROC
#endif
@@ -14333,33 +14969,37 @@ 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 e11e394..d5a4a69 100644
+index e11e394..9aebc5d 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
-@@ -19,6 +19,7 @@
+@@ -19,6 +19,8 @@
#include <asm/cache.h>
#include <asm/processor-flags.h>
#include <asm/percpu.h>
+#include <asm/cpufeature.h>
++#include <asm/alternative-asm.h>
#ifdef CONFIG_PARAVIRT
#include <asm/asm-offsets.h>
-@@ -38,6 +39,10 @@ L4_PAGE_OFFSET = pgd_index(__PAGE_OFFSET)
+@@ -38,6 +40,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)
+L4_VMALLOC_START = pgd_index(VMALLOC_START)
+L3_VMALLOC_START = pud_index(VMALLOC_START)
++L4_VMALLOC_END = pgd_index(VMALLOC_END)
++L3_VMALLOC_END = pud_index(VMALLOC_END)
+L4_VMEMMAP_START = pgd_index(VMEMMAP_START)
+L3_VMEMMAP_START = pud_index(VMEMMAP_START)
.text
__HEAD
-@@ -85,35 +90,22 @@ startup_64:
+@@ -85,35 +93,23 @@ startup_64:
*/
addq %rbp, init_level4_pgt + 0(%rip)
addq %rbp, init_level4_pgt + (L4_PAGE_OFFSET*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)
@@ -14370,8 +15010,12 @@ index e11e394..d5a4a69 100644
- addq %rbp, level3_kernel_pgt + (510*8)(%rip)
- addq %rbp, level3_kernel_pgt + (511*8)(%rip)
--
-- addq %rbp, level2_fixmap_pgt + (506*8)(%rip)
++ addq %rbp, level3_vmemmap_pgt + (L3_VMEMMAP_START*8)(%rip)
++
++ addq %rbp, level3_kernel_pgt + (L3_START_KERNEL*8)(%rip)
++ addq %rbp, level3_kernel_pgt + (L3_START_KERNEL*8+8)(%rip)
+
+ addq %rbp, level2_fixmap_pgt + (506*8)(%rip)
-
- /* Add an Identity mapping if I am above 1G */
- leaq _text(%rip), %rdi
@@ -14381,14 +15025,11 @@ index e11e394..d5a4a69 100644
- 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
@@ -14396,12 +15037,11 @@ index e11e394..d5a4a69 100644
- 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 + (507*8)(%rip)
/*
* Fixup the kernel text+data virtual addresses. Note that
-@@ -160,8 +152,8 @@ ENTRY(secondary_startup_64)
+@@ -160,8 +156,8 @@ ENTRY(secondary_startup_64)
* after the boot processor executes this code.
*/
@@ -14412,7 +15052,7 @@ index e11e394..d5a4a69 100644
movq %rax, %cr4
/* Setup early boot stage 4 level pagetables. */
-@@ -183,9 +175,14 @@ ENTRY(secondary_startup_64)
+@@ -183,9 +179,17 @@ ENTRY(secondary_startup_64)
movl $MSR_EFER, %ecx
rdmsr
btsl $_EFER_SCE, %eax /* Enable System Call */
@@ -14421,14 +15061,25 @@ index e11e394..d5a4a69 100644
jnc 1f
btsl $_EFER_NX, %eax
+ leaq init_level4_pgt(%rip), %rdi
++#ifndef CONFIG_EFI
+ btsq $_PAGE_BIT_NX, 8*L4_PAGE_OFFSET(%rdi)
++#endif
+ btsq $_PAGE_BIT_NX, 8*L4_VMALLOC_START(%rdi)
++ btsq $_PAGE_BIT_NX, 8*L4_VMALLOC_END(%rdi)
+ btsq $_PAGE_BIT_NX, 8*L4_VMEMMAP_START(%rdi)
+ btsq $_PAGE_BIT_NX, __supported_pte_mask(%rip)
1: wrmsr /* Make changes effective */
/* Setup cr0 */
-@@ -269,7 +266,7 @@ ENTRY(secondary_startup_64)
+@@ -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.
+ */
++ 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
@@ -14437,7 +15088,7 @@ index e11e394..d5a4a69 100644
#ifdef CONFIG_EARLY_PRINTK
.globl early_idt_handlers
early_idt_handlers:
-@@ -314,18 +311,23 @@ ENTRY(early_idt_handler)
+@@ -314,18 +319,23 @@ ENTRY(early_idt_handler)
#endif /* EARLY_PRINTK */
1: hlt
jmp 1b
@@ -14454,15 +15105,15 @@ index e11e394..d5a4a69 100644
.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 */
++ .previous
+ #endif /* CONFIG_EARLY_PRINTK */
+- .previous
+ .section .rodata,"a",@progbits
#define NEXT_PAGE(name) \
.balign PAGE_SIZE; \
ENTRY(name)
-@@ -338,7 +340,6 @@ ENTRY(name)
+@@ -338,7 +348,6 @@ ENTRY(name)
i = i + 1 ; \
.endr
@@ -14470,12 +15121,14 @@ index e11e394..d5a4a69 100644
/*
* This default setting generates an ident mapping at address 0x100000
* and a mapping for the kernel that precisely maps virtual address
-@@ -349,13 +350,36 @@ NEXT_PAGE(init_level4_pgt)
+@@ -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
+ .org init_level4_pgt + L4_VMALLOC_START*8, 0
-+ .quad level3_vmalloc_pgt - __START_KERNEL_map + _KERNPG_TABLE
++ .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
@@ -14498,7 +15151,10 @@ index e11e394..d5a4a69 100644
+ .fill 510,8,0
+#endif
+
-+NEXT_PAGE(level3_vmalloc_pgt)
++NEXT_PAGE(level3_vmalloc_start_pgt)
++ .fill 512,8,0
++
++NEXT_PAGE(level3_vmalloc_end_pgt)
+ .fill 512,8,0
+
+NEXT_PAGE(level3_vmemmap_pgt)
@@ -14507,7 +15163,7 @@ index e11e394..d5a4a69 100644
NEXT_PAGE(level3_kernel_pgt)
.fill L3_START_KERNEL,8,0
-@@ -363,20 +387,23 @@ NEXT_PAGE(level3_kernel_pgt)
+@@ -363,20 +400,23 @@ NEXT_PAGE(level3_kernel_pgt)
.quad level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE
.quad level2_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE
@@ -14539,7 +15195,7 @@ index e11e394..d5a4a69 100644
NEXT_PAGE(level2_kernel_pgt)
/*
-@@ -389,33 +416,55 @@ NEXT_PAGE(level2_kernel_pgt)
+@@ -389,33 +429,55 @@ NEXT_PAGE(level2_kernel_pgt)
* If you want to increase this then increase MODULES_VADDR
* too.)
*/
@@ -14631,7 +15287,7 @@ index 9c3bd4a..e1d9b35 100644
+EXPORT_SYMBOL(__LOAD_PHYSICAL_ADDR);
+#endif
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
-index 65b8f5c..a938251 100644
+index 6104852..6114160 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -210,7 +210,7 @@ spurious_8259A_irq:
@@ -14713,10 +15369,10 @@ index 8c96897..be66bfa 100644
return -EPERM;
}
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
-index 6c0802e..bea25ae 100644
+index 429e0c9..17b3ece 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
-@@ -17,7 +17,7 @@
+@@ -18,7 +18,7 @@
#include <asm/mce.h>
#include <asm/hw_irq.h>
@@ -14725,7 +15381,7 @@ index 6c0802e..bea25ae 100644
/* Function pointer for generic interrupt vector handling */
void (*x86_platform_ipi_callback)(void) = NULL;
-@@ -116,9 +116,9 @@ int arch_show_interrupts(struct seq_file *p, int prec)
+@@ -117,9 +117,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
@@ -14737,7 +15393,7 @@ index 6c0802e..bea25ae 100644
#endif
return 0;
}
-@@ -158,10 +158,10 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
+@@ -159,10 +159,10 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
u64 arch_irq_stat(void)
{
@@ -14893,8 +15549,21 @@ index 7209070..cbcd71a 100644
/*
* Shouldn't happen, we returned above if in_interrupt():
*/
+diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
+index 69bca46..0bac999 100644
+--- a/arch/x86/kernel/irq_64.c
++++ b/arch/x86/kernel/irq_64.c
+@@ -38,7 +38,7 @@ static inline void stack_overflow_check(struct pt_regs *regs)
+ #ifdef CONFIG_DEBUG_STACKOVERFLOW
+ u64 curbase = (u64)task_stack_page(current);
+
+- if (user_mode_vm(regs))
++ if (user_mode(regs))
+ return;
+
+ WARN_ONCE(regs->sp >= curbase &&
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
-index 5f9ecff..122d84b 100644
+index faba577..93b9e71 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -124,11 +124,11 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
@@ -14926,9 +15595,9 @@ index 5f9ecff..122d84b 100644
raw_smp_processor_id());
}
-@@ -534,7 +534,7 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd)
- return NOTIFY_DONE;
+@@ -543,7 +543,7 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd)
+ switch (cmd) {
case DIE_DEBUG:
- if (atomic_read(&kgdb_cpu_doing_single_step) != -1) {
+ if (atomic_read_unchecked(&kgdb_cpu_doing_single_step) != -1) {
@@ -14936,10 +15605,10 @@ index 5f9ecff..122d84b 100644
return single_step_cont(regs, args);
break;
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
-index 794bc95..c6e29e9 100644
+index 7da647d..5d3c4c1 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
-@@ -117,8 +117,11 @@ static void __kprobes __synthesize_relative_insn(void *from, void *to, u8 op)
+@@ -118,8 +118,11 @@ static void __kprobes __synthesize_relative_insn(void *from, void *to, u8 op)
} __attribute__((packed)) *insn;
insn = (struct __arch_relative_insn *)from;
@@ -14951,7 +15620,7 @@ index 794bc95..c6e29e9 100644
}
/* Insert a jump instruction at address 'from', which jumps to address 'to'.*/
-@@ -155,7 +158,7 @@ static int __kprobes can_boost(kprobe_opcode_t *opcodes)
+@@ -156,7 +159,7 @@ static int __kprobes can_boost(kprobe_opcode_t *opcodes)
kprobe_opcode_t opcode;
kprobe_opcode_t *orig_opcodes = opcodes;
@@ -14960,7 +15629,7 @@ index 794bc95..c6e29e9 100644
return 0; /* Page fault may occur on this address. */
retry:
-@@ -316,7 +319,9 @@ static int __kprobes __copy_instruction(u8 *dest, u8 *src, int recover)
+@@ -317,7 +320,9 @@ static int __kprobes __copy_instruction(u8 *dest, u8 *src, int recover)
}
}
insn_get_length(&insn);
@@ -14970,7 +15639,7 @@ index 794bc95..c6e29e9 100644
#ifdef CONFIG_X86_64
if (insn_rip_relative(&insn)) {
-@@ -340,7 +345,9 @@ static int __kprobes __copy_instruction(u8 *dest, u8 *src, int recover)
+@@ -341,7 +346,9 @@ static int __kprobes __copy_instruction(u8 *dest, u8 *src, int recover)
(u8 *) dest;
BUG_ON((s64) (s32) newdisp != newdisp); /* Sanity check. */
disp = (u8 *) dest + insn_offset_displacement(&insn);
@@ -14980,7 +15649,7 @@ index 794bc95..c6e29e9 100644
}
#endif
return insn.length;
-@@ -354,12 +361,12 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
+@@ -355,12 +362,12 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
*/
__copy_instruction(p->ainsn.insn, p->addr, 0);
@@ -14995,7 +15664,7 @@ index 794bc95..c6e29e9 100644
}
int __kprobes arch_prepare_kprobe(struct kprobe *p)
-@@ -476,7 +483,7 @@ static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
+@@ -477,7 +484,7 @@ static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
* nor set current_kprobe, because it doesn't use single
* stepping.
*/
@@ -15004,7 +15673,7 @@ index 794bc95..c6e29e9 100644
preempt_enable_no_resched();
return;
}
-@@ -495,7 +502,7 @@ static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
+@@ -496,7 +503,7 @@ static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
if (p->opcode == BREAKPOINT_INSTRUCTION)
regs->ip = (unsigned long)p->addr;
else
@@ -15013,7 +15682,7 @@ index 794bc95..c6e29e9 100644
}
/*
-@@ -574,7 +581,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
+@@ -575,7 +582,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
setup_singlestep(p, regs, kcb, 0);
return 1;
}
@@ -15022,7 +15691,7 @@ index 794bc95..c6e29e9 100644
/*
* The breakpoint instruction was removed right
* after we hit it. Another cpu has removed
-@@ -682,6 +689,9 @@ static void __used __kprobes kretprobe_trampoline_holder(void)
+@@ -683,6 +690,9 @@ static void __used __kprobes kretprobe_trampoline_holder(void)
" movq %rax, 152(%rsp)\n"
RESTORE_REGS_STRING
" popfq\n"
@@ -15032,7 +15701,7 @@ index 794bc95..c6e29e9 100644
#else
" pushf\n"
SAVE_REGS_STRING
-@@ -819,7 +829,7 @@ static void __kprobes resume_execution(struct kprobe *p,
+@@ -820,7 +830,7 @@ static void __kprobes resume_execution(struct kprobe *p,
struct pt_regs *regs, struct kprobe_ctlblk *kcb)
{
unsigned long *tos = stack_addr(regs);
@@ -15041,7 +15710,7 @@ index 794bc95..c6e29e9 100644
unsigned long orig_ip = (unsigned long)p->addr;
kprobe_opcode_t *insn = p->ainsn.insn;
-@@ -1001,7 +1011,7 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
+@@ -1002,7 +1012,7 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
struct die_args *args = data;
int ret = NOTIFY_DONE;
@@ -15050,7 +15719,7 @@ index 794bc95..c6e29e9 100644
return ret;
switch (val) {
-@@ -1383,7 +1393,7 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
+@@ -1384,7 +1394,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.
*/
@@ -15059,7 +15728,7 @@ index 794bc95..c6e29e9 100644
if (abs(rel) > 0x7fffffff)
return -ERANGE;
-@@ -1404,11 +1414,11 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
+@@ -1405,11 +1415,11 @@ int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
synthesize_set_arg1(buf + TMPL_MOVE_IDX, (unsigned long)op);
/* Set probe function call */
@@ -15073,7 +15742,7 @@ index 794bc95..c6e29e9 100644
flush_icache_range((unsigned long) buf,
(unsigned long) buf + TMPL_END_IDX +
-@@ -1430,7 +1440,7 @@ static void __kprobes setup_optimize_kprobe(struct text_poke_param *tprm,
+@@ -1431,7 +1441,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 */
@@ -15083,10 +15752,10 @@ index 794bc95..c6e29e9 100644
insn_buf[0] = RELATIVEJUMP_OPCODE;
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
-index 33c07b0..188cc41 100644
+index a9c2116..a52d4fc 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
-@@ -426,6 +426,7 @@ static void __init paravirt_ops_setup(void)
+@@ -437,6 +437,7 @@ static void __init paravirt_ops_setup(void)
pv_mmu_ops.set_pud = kvm_set_pud;
#if PAGETABLE_LEVELS == 4
pv_mmu_ops.set_pgd = kvm_set_pgd;
@@ -15194,10 +15863,10 @@ index a3fa43b..8966f4c 100644
relocate_kernel_ptr = control_page;
page_list[PA_CONTROL_PAGE] = __pa(control_page);
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c
-index 1a1b606..5c89b55 100644
+index 3ca42d0..7cff8cc 100644
--- a/arch/x86/kernel/microcode_intel.c
+++ b/arch/x86/kernel/microcode_intel.c
-@@ -440,13 +440,13 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device)
+@@ -436,13 +436,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)
{
@@ -15214,10 +15883,10 @@ index 1a1b606..5c89b55 100644
static void microcode_fini_cpu(int cpu)
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
-index 52f256f..8bf1485 100644
+index 925179f..85bec6c 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
-@@ -36,21 +36,66 @@
+@@ -36,15 +36,60 @@
#define DEBUGP(fmt...)
#endif
@@ -15243,12 +15912,6 @@ index 52f256f..8bf1485 100644
+
+}
+
- /* Free memory returned from module_alloc */
- void module_free(struct module *mod, void *module_region)
- {
- vfree(module_region);
- }
-
+#ifdef CONFIG_PAX_KERNEXEC
+#ifdef CONFIG_X86_32
+void *module_alloc_exec(unsigned long size)
@@ -15283,10 +15946,10 @@ index 52f256f..8bf1485 100644
+#endif
+#endif
+
- /* We don't need anything special. */
- int module_frob_arch_sections(Elf_Ehdr *hdr,
- Elf_Shdr *sechdrs,
-@@ -70,14 +115,16 @@ int apply_relocate(Elf32_Shdr *sechdrs,
+ #ifdef CONFIG_X86_32
+ int apply_relocate(Elf32_Shdr *sechdrs,
+ const char *strtab,
+@@ -55,14 +100,16 @@ int apply_relocate(Elf32_Shdr *sechdrs,
unsigned int i;
Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr;
Elf32_Sym *sym;
@@ -15306,7 +15969,7 @@ index 52f256f..8bf1485 100644
/* This is the symbol it is referring to. Note that all
undefined symbols have been resolved. */
sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
-@@ -86,11 +133,15 @@ int apply_relocate(Elf32_Shdr *sechdrs,
+@@ -71,11 +118,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 */
@@ -15324,7 +15987,7 @@ index 52f256f..8bf1485 100644
break;
default:
printk(KERN_ERR "module %s: Unknown relocation: %u\n",
-@@ -146,21 +197,30 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
+@@ -120,21 +171,30 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
case R_X86_64_NONE:
break;
case R_X86_64_64:
@@ -15355,6 +16018,28 @@ index 52f256f..8bf1485 100644
#if 0
if ((s64)val != *(s32 *)loc)
goto overflow;
+diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
+index e88f37b..1353db6 100644
+--- a/arch/x86/kernel/nmi.c
++++ b/arch/x86/kernel/nmi.c
+@@ -408,6 +408,17 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
+ dotraplinkage notrace __kprobes void
+ do_nmi(struct pt_regs *regs, long error_code)
+ {
++
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
++ if (!user_mode(regs)) {
++ unsigned long cs = regs->cs & 0xFFFF;
++ unsigned long ip = ktva_ktla(regs->ip);
++
++ if ((cs == __KERNEL_CS || cs == __KERNEXEC_KERNEL_CS) && ip <= (unsigned long)_etext)
++ regs->ip = ip;
++ }
++#endif
++
+ nmi_enter();
+
+ inc_irq_stat(__nmi_count);
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
@@ -15369,7 +16054,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 869e1ae..2b82740 100644
+index d90272e..6bb013b 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -53,6 +53,9 @@ u64 _paravirt_ident_64(u64 x)
@@ -15382,26 +16067,7 @@ index 869e1ae..2b82740 100644
void __init default_banner(void)
{
-@@ -122,7 +125,7 @@ unsigned paravirt_patch_jmp(void *insnbuf, const void *target,
- * corresponding structure. */
- static void *get_call_destination(u8 type)
- {
-- struct paravirt_patch_template tmpl = {
-+ const struct paravirt_patch_template tmpl = {
- .pv_init_ops = pv_init_ops,
- .pv_time_ops = pv_time_ops,
- .pv_cpu_ops = pv_cpu_ops,
-@@ -133,6 +136,9 @@ static void *get_call_destination(u8 type)
- .pv_lock_ops = pv_lock_ops,
- #endif
- };
-+
-+ pax_track_stack();
-+
- return *((void **)&tmpl + type);
- }
-
-@@ -145,15 +151,19 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
+@@ -145,15 +148,19 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
if (opfunc == NULL)
/* If there's no function, patch it with a ud2a (BUG) */
ret = paravirt_patch_insns(insnbuf, len, ud2a, ud2a+sizeof(ud2a));
@@ -15424,7 +16090,7 @@ index 869e1ae..2b82740 100644
else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) ||
type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) ||
-@@ -178,7 +188,7 @@ unsigned paravirt_patch_insns(void *insnbuf, unsigned len,
+@@ -178,7 +185,7 @@ unsigned paravirt_patch_insns(void *insnbuf, unsigned len,
if (insn_len > len || start == NULL)
insn_len = len;
else
@@ -15433,7 +16099,7 @@ index 869e1ae..2b82740 100644
return insn_len;
}
-@@ -294,22 +304,22 @@ void arch_flush_lazy_mmu_mode(void)
+@@ -302,7 +309,7 @@ void arch_flush_lazy_mmu_mode(void)
preempt_enable();
}
@@ -15442,7 +16108,8 @@ index 869e1ae..2b82740 100644
.name = "bare hardware",
.paravirt_enabled = 0,
.kernel_rpl = 0,
- .shared_kernel_pmd = 1, /* Only used when CONFIG_X86_PAE is set */
+@@ -313,16 +320,16 @@ struct pv_info pv_info = {
+ #endif
};
-struct pv_init_ops pv_init_ops = {
@@ -15453,6 +16120,7 @@ index 869e1ae..2b82740 100644
-struct pv_time_ops pv_time_ops = {
+struct pv_time_ops pv_time_ops __read_only = {
.sched_clock = native_sched_clock,
+ .steal_clock = native_steal_clock,
};
-struct pv_irq_ops pv_irq_ops = {
@@ -15460,7 +16128,7 @@ index 869e1ae..2b82740 100644
.save_fl = __PV_IS_CALLEE_SAVE(native_save_fl),
.restore_fl = __PV_IS_CALLEE_SAVE(native_restore_fl),
.irq_disable = __PV_IS_CALLEE_SAVE(native_irq_disable),
-@@ -321,7 +331,7 @@ struct pv_irq_ops pv_irq_ops = {
+@@ -334,7 +341,7 @@ struct pv_irq_ops pv_irq_ops = {
#endif
};
@@ -15469,7 +16137,7 @@ index 869e1ae..2b82740 100644
.cpuid = native_cpuid,
.get_debugreg = native_get_debugreg,
.set_debugreg = native_set_debugreg,
-@@ -382,21 +392,26 @@ struct pv_cpu_ops pv_cpu_ops = {
+@@ -395,21 +402,26 @@ struct pv_cpu_ops pv_cpu_ops = {
.end_context_switch = paravirt_nop,
};
@@ -15499,7 +16167,7 @@ index 869e1ae..2b82740 100644
.read_cr2 = native_read_cr2,
.write_cr2 = native_write_cr2,
-@@ -446,6 +461,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,
@@ -15507,7 +16175,7 @@ index 869e1ae..2b82740 100644
#endif
#endif /* PAGETABLE_LEVELS >= 3 */
-@@ -465,6 +481,12 @@ struct pv_mmu_ops pv_mmu_ops = {
+@@ -478,6 +491,12 @@ struct pv_mmu_ops pv_mmu_ops = {
},
.set_fixmap = native_set_fixmap,
@@ -15521,7 +16189,7 @@ index 869e1ae..2b82740 100644
EXPORT_SYMBOL_GPL(pv_time_ops);
diff --git a/arch/x86/kernel/pci-iommu_table.c b/arch/x86/kernel/pci-iommu_table.c
-index 35ccf75..67e7d4d 100644
+index 35ccf75..7a15747 100644
--- a/arch/x86/kernel/pci-iommu_table.c
+++ b/arch/x86/kernel/pci-iommu_table.c
@@ -2,7 +2,7 @@
@@ -15533,17 +16201,8 @@ index 35ccf75..67e7d4d 100644
#define DEBUG 1
-@@ -51,6 +51,8 @@ void __init check_iommu_entries(struct iommu_table_entry *start,
- {
- struct iommu_table_entry *p, *q, *x;
-
-+ pax_track_stack();
-+
- /* Simple cyclic dependency checker. */
- for (p = start; p < finish; p++) {
- q = find_dependents_of(start, finish, p);
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
-index e1ba8cb..70a03a0 100644
+index ee5d4fb..426649b 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -48,16 +48,33 @@ void free_thread_xstate(struct task_struct *tsk)
@@ -15551,7 +16210,7 @@ index e1ba8cb..70a03a0 100644
void free_thread_info(struct thread_info *ti)
{
- free_thread_xstate(ti->task);
- free_pages((unsigned long)ti, get_order(THREAD_SIZE));
+ free_pages((unsigned long)ti, THREAD_ORDER);
}
+static struct kmem_cache *task_struct_cachep;
@@ -15626,16 +16285,16 @@ index e1ba8cb..70a03a0 100644
#else
regs.ss = __KERNEL_DS;
#endif
-@@ -403,7 +423,7 @@ void default_idle(void)
- EXPORT_SYMBOL(default_idle);
- #endif
+@@ -411,7 +431,7 @@ bool set_pm_idle_to_default(void)
+ return ret;
+ }
-void stop_this_cpu(void *dummy)
+__noreturn void stop_this_cpu(void *dummy)
{
local_irq_disable();
/*
-@@ -668,16 +688,37 @@ static int __init idle_setup(char *str)
+@@ -653,16 +673,37 @@ static int __init idle_setup(char *str)
}
early_param("idle", idle_setup);
@@ -15684,10 +16343,10 @@ index e1ba8cb..70a03a0 100644
+}
+#endif
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
-index a3d0dc5..6a414ba 100644
+index 795b79f..063767a 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
-@@ -65,6 +65,7 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
+@@ -67,6 +67,7 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
unsigned long thread_saved_pc(struct task_struct *tsk)
{
return ((unsigned long *)tsk->thread.sp)[3];
@@ -15695,7 +16354,7 @@ index a3d0dc5..6a414ba 100644
}
#ifndef CONFIG_SMP
-@@ -126,15 +127,14 @@ void __show_regs(struct pt_regs *regs, int all)
+@@ -130,15 +131,14 @@ void __show_regs(struct pt_regs *regs, int all)
unsigned long sp;
unsigned short ss, gs;
@@ -15713,7 +16372,7 @@ index a3d0dc5..6a414ba 100644
show_regs_common();
-@@ -196,13 +196,14 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
+@@ -200,13 +200,14 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
struct task_struct *tsk;
int err;
@@ -15729,7 +16388,7 @@ index a3d0dc5..6a414ba 100644
p->thread.ip = (unsigned long) ret_from_fork;
-@@ -292,7 +293,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -296,7 +297,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();
@@ -15738,7 +16397,7 @@ index a3d0dc5..6a414ba 100644
bool preload_fpu;
/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
-@@ -327,6 +328,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -331,6 +332,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
*/
lazy_save_gs(prev->gs);
@@ -15749,7 +16408,7 @@ index a3d0dc5..6a414ba 100644
/*
* Load the per-thread Thread-Local Storage descriptor.
*/
-@@ -362,6 +367,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -366,6 +371,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
*/
arch_end_context_switch(next_p);
@@ -15759,7 +16418,7 @@ index a3d0dc5..6a414ba 100644
if (preload_fpu)
__math_state_restore();
-@@ -371,8 +379,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -375,8 +383,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
if (prev->gs | next->gs)
lazy_load_gs(next->gs);
@@ -15768,16 +16427,16 @@ index a3d0dc5..6a414ba 100644
return prev_p;
}
-@@ -402,4 +408,3 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -406,4 +412,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 ca6f7ab..5d3f0e1 100644
+index 3bd7e6e..90b2bcf 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
-@@ -87,7 +87,7 @@ static void __exit_idle(void)
+@@ -89,7 +89,7 @@ static void __exit_idle(void)
void exit_idle(void)
{
/* idle loop has pid 0 */
@@ -15786,7 +16445,7 @@ index ca6f7ab..5d3f0e1 100644
return;
__exit_idle();
}
-@@ -260,8 +260,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
+@@ -264,8 +264,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
struct pt_regs *childregs;
struct task_struct *me = current;
@@ -15796,7 +16455,7 @@ index ca6f7ab..5d3f0e1 100644
*childregs = *regs;
childregs->ax = 0;
-@@ -273,6 +272,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
+@@ -277,6 +276,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
p->thread.sp = (unsigned long) childregs;
p->thread.sp0 = (unsigned long) (childregs+1);
p->thread.usersp = me->thread.usersp;
@@ -15804,7 +16463,7 @@ index ca6f7ab..5d3f0e1 100644
set_tsk_thread_flag(p, TIF_FORK);
-@@ -375,7 +375,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -379,7 +379,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();
@@ -15813,7 +16472,7 @@ index ca6f7ab..5d3f0e1 100644
unsigned fsindex, gsindex;
bool preload_fpu;
-@@ -471,10 +471,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -475,10 +475,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);
@@ -15826,7 +16485,7 @@ index ca6f7ab..5d3f0e1 100644
/*
* Now maybe reload the debug registers and handle I/O bitmaps
-@@ -536,12 +535,11 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -540,12 +539,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);
@@ -15842,10 +16501,10 @@ index ca6f7ab..5d3f0e1 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 807c2a2..6350c3e 100644
+index 8252879..d3219e0 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
-@@ -821,7 +821,7 @@ long arch_ptrace(struct task_struct *child, long request,
+@@ -822,7 +822,7 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
int ret;
@@ -15854,7 +16513,7 @@ index 807c2a2..6350c3e 100644
switch (request) {
/* read the word at location addr in the USER area. */
-@@ -906,14 +906,14 @@ long arch_ptrace(struct task_struct *child, long request,
+@@ -907,14 +907,14 @@ long arch_ptrace(struct task_struct *child, long request,
if ((int) addr < 0)
return -EIO;
ret = do_get_thread_area(child, addr,
@@ -15871,7 +16530,7 @@ index 807c2a2..6350c3e 100644
break;
#endif
-@@ -1330,7 +1330,7 @@ static void fill_sigtrap_info(struct task_struct *tsk,
+@@ -1331,7 +1331,7 @@ static void fill_sigtrap_info(struct task_struct *tsk,
memset(info, 0, sizeof(*info));
info->si_signo = SIGTRAP;
info->si_code = si_code;
@@ -15913,7 +16572,7 @@ index 42eb330..139955c 100644
return ret;
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
-index d4a705f..ef8f1a9 100644
+index 37a458b..e63d183 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -35,7 +35,7 @@ void (*pm_power_off)(void);
@@ -15996,7 +16655,7 @@ index d4a705f..ef8f1a9 100644
}
#ifdef CONFIG_APM_MODULE
EXPORT_SYMBOL(machine_real_restart);
-@@ -532,7 +562,7 @@ void __attribute__((weak)) mach_reboot_fixups(void)
+@@ -540,7 +570,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
*/
@@ -16005,7 +16664,7 @@ index d4a705f..ef8f1a9 100644
{
int i;
int attempt = 0;
-@@ -656,13 +686,13 @@ void native_machine_shutdown(void)
+@@ -664,13 +694,13 @@ void native_machine_shutdown(void)
#endif
}
@@ -16021,7 +16680,7 @@ index d4a705f..ef8f1a9 100644
{
printk("machine restart\n");
-@@ -671,7 +701,7 @@ static void native_machine_restart(char *__unused)
+@@ -679,7 +709,7 @@ static void native_machine_restart(char *__unused)
__machine_emergency_restart(0);
}
@@ -16030,7 +16689,7 @@ index d4a705f..ef8f1a9 100644
{
/* stop other cpus and apics */
machine_shutdown();
-@@ -682,7 +712,7 @@ static void native_machine_halt(void)
+@@ -690,7 +720,7 @@ static void native_machine_halt(void)
stop_this_cpu(NULL);
}
@@ -16039,7 +16698,7 @@ index d4a705f..ef8f1a9 100644
{
if (pm_power_off) {
if (!reboot_force)
-@@ -691,6 +721,7 @@ static void native_machine_power_off(void)
+@@ -699,6 +729,7 @@ static void native_machine_power_off(void)
}
/* a fallback in case there is no PM info available */
tboot_shutdown(TB_SHUTDOWN_HALT);
@@ -16047,8 +16706,36 @@ index d4a705f..ef8f1a9 100644
}
struct machine_ops machine_ops = {
+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
++++ b/arch/x86/kernel/relocate_kernel_64.S
+@@ -11,6 +11,7 @@
+ #include <asm/kexec.h>
+ #include <asm/processor-flags.h>
+ #include <asm/pgtable_types.h>
++#include <asm/alternative-asm.h>
+
+ /*
+ * Must be relocatable PIC code callable as a C function
+@@ -160,13 +161,14 @@ identity_mapped:
+ xorq %rbp, %rbp
+ xorq %r8, %r8
+ xorq %r9, %r9
+- xorq %r10, %r9
++ xorq %r10, %r10
+ xorq %r11, %r11
+ xorq %r12, %r12
+ xorq %r13, %r13
+ xorq %r14, %r14
+ xorq %r15, %r15
+
++ pax_force_retaddr 0, 1
+ ret
+
+ 1:
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
-index afaf384..1a101fe 100644
+index cf0ef98..e3f780b 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -447,7 +447,7 @@ static void __init parse_setup_data(void)
@@ -16157,7 +16844,7 @@ index 71f4727..16dc9f7 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 40a2493..2348ff2 100644
+index 54ddaeb2..22c3bdc 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -198,7 +198,7 @@ static unsigned long align_sigframe(unsigned long sp)
@@ -16225,16 +16912,7 @@ index 40a2493..2348ff2 100644
} put_user_catch(err);
if (err)
-@@ -769,6 +772,8 @@ static void do_signal(struct pt_regs *regs)
- int signr;
- sigset_t *oldset;
-
-+ pax_track_stack();
-+
- /*
- * We want the common case to go fast, which is why we may in certain
- * cases get here from kernel mode. Just return without doing anything
-@@ -776,7 +781,7 @@ static void do_signal(struct pt_regs *regs)
+@@ -769,7 +772,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.
*/
@@ -16242,9 +16920,9 @@ index 40a2493..2348ff2 100644
+ if (!user_mode_novm(regs))
return;
- if (current_thread_info()->status & TS_RESTORE_SIGMASK)
+ signr = get_signal_to_deliver(&info, &ka, regs, NULL);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
-index 9fd3137..290be8c 100644
+index 9f548cb..caf76f7 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -709,17 +709,20 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
@@ -16285,7 +16963,7 @@ index 9fd3137..290be8c 100644
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 7977f0c..6b8651b 100644
+index c346d11..d43b163 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
@@ -16321,15 +16999,6 @@ index 7977f0c..6b8651b 100644
copied = access_process_vm(child, addr, opcode, sizeof(opcode), 0);
for (i = 0; i < copied; i++) {
switch (opcode[i]) {
-@@ -74,7 +78,7 @@ static int is_setting_trap_flag(struct task_struct *child, struct pt_regs *regs)
-
- #ifdef CONFIG_X86_64
- case 0x40 ... 0x4f:
-- if (regs->cs != __USER_CS)
-+ if ((regs->cs & 0xffff) != __USER_CS)
- /* 32-bit mode: register increment */
- return 0;
- /* 64-bit mode: REX prefix */
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
@@ -16346,7 +17015,12 @@ index 0b0cb5f..db6b9ed 100644
- const char *const argv[],
- const char *const envp[])
+int i386_mmap_check(unsigned long addr, unsigned long len, unsigned long flags)
-+{
+ {
+- long __res;
+- asm volatile ("int $0x80"
+- : "=a" (__res)
+- : "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory");
+- return __res;
+ unsigned long pax_task_size = TASK_SIZE;
+
+#ifdef CONFIG_PAX_SEGMEXEC
@@ -16454,12 +17128,7 @@ 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;
@@ -16572,10 +17241,10 @@ index 0b0cb5f..db6b9ed 100644
+ return addr;
}
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
-index ff14a50..35626c3 100644
+index 0514890..3dbebce 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
-@@ -32,8 +32,8 @@ out:
+@@ -95,8 +95,8 @@ out:
return error;
}
@@ -16586,7 +17255,7 @@ index ff14a50..35626c3 100644
{
if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT)) {
unsigned long new_begin;
-@@ -52,7 +52,7 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
+@@ -115,7 +115,7 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
*begin = new_begin;
}
} else {
@@ -16595,7 +17264,7 @@ index ff14a50..35626c3 100644
*end = TASK_SIZE;
}
}
-@@ -69,16 +69,19 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -132,16 +132,19 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
if (flags & MAP_FIXED)
return addr;
@@ -16618,7 +17287,7 @@ index ff14a50..35626c3 100644
return addr;
}
if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32))
-@@ -106,7 +109,7 @@ full_search:
+@@ -172,7 +175,7 @@ full_search:
}
return -ENOMEM;
}
@@ -16627,7 +17296,7 @@ index ff14a50..35626c3 100644
/*
* Remember the place where we stopped the search:
*/
-@@ -128,7 +131,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -195,7 +198,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
{
struct vm_area_struct *vma;
struct mm_struct *mm = current->mm;
@@ -16636,7 +17305,7 @@ index ff14a50..35626c3 100644
/* requested length too big for entire address space */
if (len > TASK_SIZE)
-@@ -141,13 +144,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -208,13 +211,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT))
goto bottomup;
@@ -16659,16 +17328,16 @@ index ff14a50..35626c3 100644
}
/* check if free_area_cache is useful for us */
-@@ -162,7 +170,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- /* make sure it can fit in the remaining address space */
- if (addr > len) {
- vma = find_vma(mm, addr-len);
-- if (!vma || addr <= vma->vm_start)
-+ if (check_heap_stack_gap(vma, addr - len, len))
+@@ -232,7 +240,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+ ALIGN_TOPDOWN);
+
+ vma = find_vma(mm, tmp_addr);
+- if (!vma || tmp_addr + len <= vma->vm_start)
++ if (check_heap_stack_gap(vma, tmp_addr, len))
/* remember the address as a hint for next time */
- return mm->free_area_cache = addr-len;
+ return mm->free_area_cache = tmp_addr;
}
-@@ -179,7 +187,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -251,7 +259,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
* return with success:
*/
vma = find_vma(mm, addr);
@@ -16677,7 +17346,7 @@ index ff14a50..35626c3 100644
/* remember the address as a hint for next time */
return mm->free_area_cache = addr;
-@@ -188,8 +196,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -260,8 +268,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 */
@@ -16688,7 +17357,7 @@ index ff14a50..35626c3 100644
bottomup:
/*
-@@ -198,13 +206,21 @@ bottomup:
+@@ -270,13 +278,21 @@ bottomup:
* can happen with large stack limits and large mmap()
* allocations.
*/
@@ -16713,7 +17382,7 @@ index ff14a50..35626c3 100644
return addr;
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S
-index fbb0a04..357e192 100644
+index 9a0e312..e6f66f2 100644
--- a/arch/x86/kernel/syscall_table_32.S
+++ b/arch/x86/kernel/syscall_table_32.S
@@ -1,3 +1,4 @@
@@ -16722,10 +17391,10 @@ index fbb0a04..357e192 100644
.long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
.long sys_exit
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
-index 30ac65d..0ace0a1 100644
+index e2410e2..4fe3fbc 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
-@@ -217,7 +217,7 @@ static int tboot_setup_sleep(void)
+@@ -219,7 +219,7 @@ static int tboot_setup_sleep(void)
void tboot_shutdown(u32 shutdown_type)
{
@@ -16734,7 +17403,7 @@ index 30ac65d..0ace0a1 100644
if (!tboot_enabled())
return;
-@@ -239,7 +239,7 @@ void tboot_shutdown(u32 shutdown_type)
+@@ -241,7 +241,7 @@ void tboot_shutdown(u32 shutdown_type)
switch_to_tboot_pt();
@@ -16743,7 +17412,7 @@ index 30ac65d..0ace0a1 100644
shutdown();
/* should not reach here */
-@@ -296,7 +296,7 @@ void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
+@@ -298,7 +298,7 @@ void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
tboot_shutdown(acpi_shutdown_map[sleep_state]);
}
@@ -16752,7 +17421,7 @@ index 30ac65d..0ace0a1 100644
static int tboot_wait_for_aps(int num_aps)
{
-@@ -320,9 +320,9 @@ static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb,
+@@ -322,9 +322,9 @@ static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb,
{
switch (action) {
case CPU_DYING:
@@ -16764,7 +17433,7 @@ index 30ac65d..0ace0a1 100644
return NOTIFY_BAD;
break;
}
-@@ -341,7 +341,7 @@ static __init int tboot_late_init(void)
+@@ -343,7 +343,7 @@ static __init int tboot_late_init(void)
tboot_create_trampoline();
@@ -16774,10 +17443,10 @@ index 30ac65d..0ace0a1 100644
return 0;
}
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
-index 00cbb27..472a348 100644
+index dd5fbf4..b7f2232 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
-@@ -30,9 +30,9 @@ unsigned long profile_pc(struct pt_regs *regs)
+@@ -31,9 +31,9 @@ unsigned long profile_pc(struct pt_regs *regs)
{
unsigned long pc = instruction_pointer(regs);
@@ -16789,7 +17458,7 @@ index 00cbb27..472a348 100644
#else
unsigned long *sp =
(unsigned long *)kernel_stack_pointer(regs);
-@@ -41,11 +41,17 @@ unsigned long profile_pc(struct pt_regs *regs)
+@@ -42,11 +42,17 @@ unsigned long profile_pc(struct pt_regs *regs)
* or above a saved flags. Eflags has bits 22-31 zero,
* kernel addresses don't.
*/
@@ -16872,7 +17541,7 @@ index 09ff517..df19fbff 100644
.short 0
.quad 0x00cf9b000000ffff # __KERNEL32_CS
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
-index b9b6716..98109ef 100644
+index a8e3eb8..c9dbd7d 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -70,12 +70,6 @@ asmlinkage int system_call(void);
@@ -16888,7 +17557,7 @@ index b9b6716..98109ef 100644
#endif
DECLARE_BITMAP(used_vectors, NR_VECTORS);
-@@ -117,13 +111,13 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
+@@ -108,13 +102,13 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
}
static void __kprobes
@@ -16904,7 +17573,7 @@ index b9b6716..98109ef 100644
/*
* traps 0, 1, 3, 4, and 5 should be forwarded to vm86.
* On nmi (interrupt 2), do_trap should not be called.
-@@ -134,7 +128,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
+@@ -125,7 +119,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
}
#endif
@@ -16913,7 +17582,7 @@ index b9b6716..98109ef 100644
goto kernel_trap;
#ifdef CONFIG_X86_32
-@@ -157,7 +151,7 @@ trap_signal:
+@@ -148,7 +142,7 @@ trap_signal:
printk_ratelimit()) {
printk(KERN_INFO
"%s[%d] trap %s ip:%lx sp:%lx error:%lx",
@@ -16922,7 +17591,7 @@ index b9b6716..98109ef 100644
regs->ip, regs->sp, error_code);
print_vma_addr(" in ", regs->ip);
printk("\n");
-@@ -174,8 +168,20 @@ kernel_trap:
+@@ -165,8 +159,20 @@ kernel_trap:
if (!fixup_exception(regs)) {
tsk->thread.error_code = error_code;
tsk->thread.trap_no = trapnr;
@@ -16943,7 +17612,7 @@ index b9b6716..98109ef 100644
return;
#ifdef CONFIG_X86_32
-@@ -264,14 +270,30 @@ do_general_protection(struct pt_regs *regs, long error_code)
+@@ -255,14 +261,30 @@ do_general_protection(struct pt_regs *regs, long error_code)
conditional_sti(regs);
#ifdef CONFIG_X86_32
@@ -16976,7 +17645,7 @@ index b9b6716..98109ef 100644
tsk->thread.error_code = error_code;
tsk->thread.trap_no = 13;
-@@ -304,6 +326,13 @@ gp_in_kernel:
+@@ -295,6 +317,13 @@ gp_in_kernel:
if (notify_die(DIE_GPF, "general protection fault", regs,
error_code, 13, SIGSEGV) == NOTIFY_STOP)
return;
@@ -16990,25 +17659,7 @@ index b9b6716..98109ef 100644
die("general protection fault", regs, error_code);
}
-@@ -433,6 +462,17 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
- dotraplinkage notrace __kprobes void
- do_nmi(struct pt_regs *regs, long error_code)
- {
-+
-+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
-+ if (!user_mode(regs)) {
-+ unsigned long cs = regs->cs & 0xFFFF;
-+ unsigned long ip = ktva_ktla(regs->ip);
-+
-+ if ((cs == __KERNEL_CS || cs == __KERNEXEC_KERNEL_CS) && ip <= (unsigned long)_etext)
-+ regs->ip = ip;
-+ }
-+#endif
-+
- nmi_enter();
-
- inc_irq_stat(__nmi_count);
-@@ -569,7 +609,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
+@@ -414,7 +443,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);
@@ -17017,7 +17668,7 @@ index b9b6716..98109ef 100644
handle_vm86_trap((struct kernel_vm86_regs *) regs,
error_code, 1);
preempt_conditional_cli(regs);
-@@ -583,7 +623,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
+@@ -428,7 +457,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.
*/
@@ -17026,7 +17677,7 @@ index b9b6716..98109ef 100644
tsk->thread.debugreg6 &= ~DR_STEP;
set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
regs->flags &= ~X86_EFLAGS_TF;
-@@ -612,7 +652,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)
+@@ -457,7 +486,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)
return;
conditional_sti(regs);
@@ -17035,7 +17686,7 @@ index b9b6716..98109ef 100644
{
if (!fixup_exception(regs)) {
task->thread.error_code = error_code;
-@@ -723,7 +763,7 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
+@@ -568,7 +597,7 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
void __math_state_restore(void)
{
struct thread_info *thread = current_thread_info();
@@ -17044,7 +17695,7 @@ index b9b6716..98109ef 100644
/*
* Paranoid restore. send a SIGSEGV if we fail to restore the state.
-@@ -750,8 +790,7 @@ void __math_state_restore(void)
+@@ -595,8 +624,7 @@ void __math_state_restore(void)
*/
asmlinkage void math_state_restore(void)
{
@@ -17135,7 +17786,7 @@ index 863f875..4307295 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 89aed99..597976c 100644
+index 0f703f1..9e15f64 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -26,6 +26,13 @@
@@ -17152,7 +17803,7 @@ index 89aed99..597976c 100644
#undef i386 /* in case the preprocessor is a 32bit one */
-@@ -69,31 +76,46 @@ jiffies_64 = jiffies;
+@@ -69,30 +76,43 @@ jiffies_64 = jiffies;
PHDRS {
text PT_LOAD FLAGS(5); /* R_E */
@@ -17165,9 +17816,7 @@ index 89aed99..597976c 100644
+ rodata PT_LOAD FLAGS(4); /* R__ */
+#endif
data PT_LOAD FLAGS(6); /* RW_ */
- #ifdef CONFIG_X86_64
- user PT_LOAD FLAGS(5); /* R_E */
-+#endif
+-#ifdef CONFIG_X86_64
+ init.begin PT_LOAD FLAGS(6); /* RW_ */
#ifdef CONFIG_SMP
percpu PT_LOAD FLAGS(6); /* RW_ */
@@ -17206,7 +17855,7 @@ index 89aed99..597976c 100644
HEAD_TEXT
#ifdef CONFIG_X86_32
. = ALIGN(PAGE_SIZE);
-@@ -109,13 +131,47 @@ SECTIONS
+@@ -108,13 +128,47 @@ SECTIONS
IRQENTRY_TEXT
*(.fixup)
*(.gnu.warning)
@@ -17258,7 +17907,7 @@ index 89aed99..597976c 100644
#if defined(CONFIG_DEBUG_RODATA)
/* .text should occupy whole number of pages */
-@@ -127,16 +183,20 @@ SECTIONS
+@@ -126,16 +180,20 @@ SECTIONS
/* Data */
.data : AT(ADDR(.data) - LOAD_OFFSET) {
@@ -17282,7 +17931,7 @@ index 89aed99..597976c 100644
PAGE_ALIGNED_DATA(PAGE_SIZE)
-@@ -208,12 +268,19 @@ SECTIONS
+@@ -176,12 +234,19 @@ SECTIONS
#endif /* CONFIG_X86_64 */
/* Init code and data - will be freed after init */
@@ -17305,7 +17954,7 @@ index 89aed99..597976c 100644
/*
* percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
* output PHDR, so the next output section - .init.text - should
-@@ -222,12 +289,27 @@ SECTIONS
+@@ -190,12 +255,27 @@ SECTIONS
PERCPU_VADDR(INTERNODE_CACHE_BYTES, 0, :percpu)
#endif
@@ -17338,7 +17987,7 @@ index 89aed99..597976c 100644
/*
* Code and data for a variety of lowlevel trampolines, to be
-@@ -301,19 +383,12 @@ SECTIONS
+@@ -269,19 +349,12 @@ SECTIONS
}
. = ALIGN(8);
@@ -17359,7 +18008,7 @@ index 89aed99..597976c 100644
PERCPU_SECTION(INTERNODE_CACHE_BYTES)
#endif
-@@ -332,16 +407,10 @@ SECTIONS
+@@ -300,16 +373,10 @@ SECTIONS
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
__smp_locks = .;
*(.smp_locks)
@@ -17377,7 +18026,7 @@ index 89aed99..597976c 100644
/* BSS */
. = ALIGN(PAGE_SIZE);
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
-@@ -357,6 +426,7 @@ SECTIONS
+@@ -325,6 +392,7 @@ SECTIONS
__brk_base = .;
. += 64 * 1024; /* 64k alignment slop space */
*(.brk_reservation) /* areas brk users have reserved */
@@ -17385,7 +18034,7 @@ index 89aed99..597976c 100644
__brk_limit = .;
}
-@@ -383,13 +453,12 @@ SECTIONS
+@@ -351,13 +419,12 @@ SECTIONS
* for the boot processor.
*/
#define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load
@@ -17401,27 +18050,57 @@ index 89aed99..597976c 100644
#ifdef CONFIG_SMP
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
-index 3e68218..d34500c 100644
+index e4d4a22..47ee71f 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
-@@ -53,7 +53,7 @@ DEFINE_VVAR(int, vgetcpu_mode);
- DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data) =
- {
+@@ -57,15 +57,13 @@ DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data) =
.lock = __SEQLOCK_UNLOCKED(__vsyscall_gtod_data.lock),
-- .sysctl_enabled = 1,
-+ .sysctl_enabled = 0,
};
- void update_vsyscall_tz(void)
-@@ -231,7 +231,7 @@ static long __vsyscall(3) venosys_1(void)
- static ctl_table kernel_table2[] = {
- { .procname = "vsyscall64",
- .data = &vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int),
-- .mode = 0644,
-+ .mode = 0444,
- .proc_handler = proc_dointvec },
- {}
- };
+-static enum { EMULATE, NATIVE, NONE } vsyscall_mode = NATIVE;
++static enum { EMULATE, NONE } vsyscall_mode = EMULATE;
+
+ static int __init vsyscall_setup(char *str)
+ {
+ if (str) {
+ if (!strcmp("emulate", str))
+ vsyscall_mode = EMULATE;
+- else if (!strcmp("native", str))
+- vsyscall_mode = NATIVE;
+ else if (!strcmp("none", str))
+ vsyscall_mode = NONE;
+ else
+@@ -178,7 +176,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);
+
+ switch (vsyscall_nr) {
+ case 0:
+@@ -220,8 +218,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
+ return true;
+
+ sigsegv:
+- force_sig(SIGSEGV, current);
+- return true;
++ do_group_exit(SIGKILL);
+ }
+
+ /*
+@@ -274,10 +271,7 @@ void __init map_vsyscall(void)
+ extern char __vvar_page;
+ unsigned long physaddr_vvar_page = __pa_symbol(&__vvar_page);
+
+- __set_fixmap(VSYSCALL_FIRST_PAGE, physaddr_vsyscall,
+- vsyscall_mode == NATIVE
+- ? PAGE_KERNEL_VSYSCALL
+- : PAGE_KERNEL_VVAR);
++ __set_fixmap(VSYSCALL_FIRST_PAGE, physaddr_vsyscall, PAGE_KERNEL_VVAR);
+ BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_FIRST_PAGE) !=
+ (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
--- a/arch/x86/kernel/x8664_ksyms_64.c
@@ -17467,45 +18146,36 @@ index a391134..d0b63b6e 100644
if (unlikely(err)) {
/*
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
-index adc9867..eb4ab62 100644
+index f1e3be1..588efc8 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
-@@ -96,7 +96,7 @@
- #define Src2ImmByte (2<<29)
- #define Src2One (3<<29)
- #define Src2Imm (4<<29)
--#define Src2Mask (7<<29)
-+#define Src2Mask (7U<<29)
-
- #define X2(x...) x, x
- #define X3(x...) X2(x), x
-@@ -207,6 +207,7 @@ struct gprefix {
-
- #define ____emulate_2op(_op, _src, _dst, _eflags, _x, _y, _suffix, _dsttype) \
+@@ -249,6 +249,7 @@ struct gprefix {
+
+ #define ____emulate_2op(ctxt, _op, _x, _y, _suffix, _dsttype) \
do { \
+ unsigned long _tmp; \
__asm__ __volatile__ ( \
_PRE_EFLAGS("0", "4", "2") \
_op _suffix " %"_x"3,%1; " \
-@@ -220,8 +221,6 @@ struct gprefix {
+@@ -263,8 +264,6 @@ struct gprefix {
/* Raw emulation: instruction has two explicit operands. */
- #define __emulate_2op_nobyte(_op,_src,_dst,_eflags,_wx,_wy,_lx,_ly,_qx,_qy) \
+ #define __emulate_2op_nobyte(ctxt,_op,_wx,_wy,_lx,_ly,_qx,_qy) \
do { \
- unsigned long _tmp; \
- \
- switch ((_dst).bytes) { \
+ switch ((ctxt)->dst.bytes) { \
case 2: \
- ____emulate_2op(_op,_src,_dst,_eflags,_wx,_wy,"w",u16);\
-@@ -237,7 +236,6 @@ struct gprefix {
+ ____emulate_2op(ctxt,_op,_wx,_wy,"w",u16); \
+@@ -280,7 +279,6 @@ struct gprefix {
- #define __emulate_2op(_op,_src,_dst,_eflags,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \
+ #define __emulate_2op(ctxt,_op,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \
do { \
- unsigned long _tmp; \
- switch ((_dst).bytes) { \
+ switch ((ctxt)->dst.bytes) { \
case 1: \
- ____emulate_2op(_op,_src,_dst,_eflags,_bx,_by,"b",u8); \
+ ____emulate_2op(ctxt,_op,_bx,_by,"b",u8); \
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
-index 2b2255b..38f6b7f 100644
+index 54abb40..a192606 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -53,7 +53,7 @@
@@ -17518,10 +18188,10 @@ index 2b2255b..38f6b7f 100644
#define APIC_LVT_NUM 6
/* 14 is the version for Xeon and Pentium 8.4.8*/
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
-index aee3862..fcf787e 100644
+index f1b36cf..af8a124 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
-@@ -3238,7 +3238,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
+@@ -3555,7 +3555,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
pgprintk("%s: gpa %llx bytes %d\n", __func__, gpa, bytes);
@@ -17530,7 +18200,7 @@ index aee3862..fcf787e 100644
/*
* Assume that the pte write on a page table of the same type
-@@ -3270,7 +3270,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
+@@ -3587,7 +3587,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
}
spin_lock(&vcpu->kvm->mmu_lock);
@@ -17540,28 +18210,19 @@ index aee3862..fcf787e 100644
kvm_mmu_free_some_pages(vcpu);
++vcpu->kvm->stat.mmu_pte_write;
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
-index 9d03ad4..e9ee87c 100644
+index 9299410..ade2f9b 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
-@@ -182,7 +182,7 @@ walk:
- break;
- }
+@@ -197,7 +197,7 @@ retry_walk:
+ if (unlikely(kvm_is_error_hva(host_addr)))
+ goto error;
- ptep_user = (pt_element_t __user *)((void *)host_addr + offset);
+ ptep_user = (pt_element_t __force_user *)((void *)host_addr + offset);
- if (unlikely(__copy_from_user(&pte, ptep_user, sizeof(pte)))) {
- present = false;
- break;
-@@ -583,6 +583,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
- unsigned long mmu_seq;
- bool map_writable;
-
-+ pax_track_stack();
-+
- pgprintk("%s: addr %lx err %x\n", __func__, addr, error_code);
+ if (unlikely(__copy_from_user(&pte, ptep_user, sizeof(pte))))
+ goto error;
- r = mmu_topup_memory_caches(vcpu);
-@@ -703,7 +705,7 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
+@@ -705,7 +705,7 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
if (need_flush)
kvm_flush_remote_tlbs(vcpu->kvm);
@@ -17571,10 +18232,10 @@ index 9d03ad4..e9ee87c 100644
spin_unlock(&vcpu->kvm->mmu_lock);
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
-index 506e4fe..e947b49 100644
+index e32243e..a6e6172 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
-@@ -3377,7 +3377,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
+@@ -3400,7 +3400,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);
@@ -17586,7 +18247,7 @@ index 506e4fe..e947b49 100644
load_TR_desc();
}
-@@ -3755,6 +3759,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -3778,6 +3782,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
#endif
#endif
@@ -17598,10 +18259,10 @@ index 506e4fe..e947b49 100644
local_irq_disable();
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
-index d48ec60..21f490a 100644
+index 579a0b5..ed7bbf9 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
-@@ -797,7 +797,11 @@ static void reload_tss(void)
+@@ -1305,7 +1305,11 @@ static void reload_tss(void)
struct desc_struct *descs;
descs = (void *)gdt->address;
@@ -17613,7 +18274,7 @@ index d48ec60..21f490a 100644
load_TR_desc();
}
-@@ -1747,8 +1751,11 @@ static __init int hardware_setup(void)
+@@ -2633,8 +2637,11 @@ static __init int hardware_setup(void)
if (!cpu_has_vmx_flexpriority())
flexpriority_enabled = 0;
@@ -17627,16 +18288,16 @@ index d48ec60..21f490a 100644
if (enable_ept && !cpu_has_vmx_ept_2m_page())
kvm_disable_largepages();
-@@ -2814,7 +2821,7 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
+@@ -3648,7 +3655,7 @@ static void vmx_set_constant_host_state(void)
vmcs_writel(HOST_IDTR_BASE, dt.address); /* 22.2.4 */
- asm("mov $.Lkvm_vmx_return, %0" : "=r"(kvm_vmx_return));
-- vmcs_writel(HOST_RIP, kvm_vmx_return); /* 22.2.5 */
-+ vmcs_writel(HOST_RIP, ktla_ktva(kvm_vmx_return)); /* 22.2.5 */
- vmcs_write32(VM_EXIT_MSR_STORE_COUNT, 0);
- vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, 0);
- vmcs_write64(VM_EXIT_MSR_LOAD_ADDR, __pa(vmx->msr_autoload.host));
-@@ -4211,6 +4218,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+ 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 */
+
+ rdmsr(MSR_IA32_SYSENTER_CS, low32, high32);
+ vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
+@@ -6169,6 +6176,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: "
@@ -17649,7 +18310,7 @@ index d48ec60..21f490a 100644
/* Save guest registers, load host registers, keep flags */
"mov %0, %c[wordsize](%%"R"sp) \n\t"
"pop %0 \n\t"
-@@ -4259,6 +4272,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -6217,6 +6230,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))
@@ -17661,9 +18322,9 @@ index d48ec60..21f490a 100644
: "cc", "memory"
, R"ax", R"bx", R"di", R"si"
#ifdef CONFIG_X86_64
-@@ -4276,7 +4294,16 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
-
- vmx->idt_vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD);
+@@ -6245,7 +6263,16 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+ }
+ }
- asm("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS));
+ asm("mov %0, %%ds; mov %0, %%es; mov %0, %%ss" : : "r"(__KERNEL_DS));
@@ -17676,14 +18337,14 @@ index d48ec60..21f490a 100644
+ __set_fs(current_thread_info()->addr_limit);
+#endif
+
- vmx->launched = 1;
+ vmx->loaded_vmcs->launched = 1;
vmx->exit_reason = vmcs_read32(VM_EXIT_REASON);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
-index 77c9d86..3562941 100644
+index 4c938da..4ddef65 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
-@@ -1313,8 +1313,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
+@@ -1345,8 +1345,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
{
struct kvm *kvm = vcpu->kvm;
int lm = is_long_mode(vcpu);
@@ -17694,7 +18355,7 @@ index 77c9d86..3562941 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;
-@@ -2057,6 +2057,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
+@@ -2165,6 +2165,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
if (n < msr_list.nmsrs)
goto out;
r = -EFAULT;
@@ -17703,7 +18364,7 @@ index 77c9d86..3562941 100644
if (copy_to_user(user_msr_list->indices, &msrs_to_save,
num_msrs_to_save * sizeof(u32)))
goto out;
-@@ -2229,15 +2231,20 @@ static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
+@@ -2340,15 +2342,20 @@ static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries)
{
@@ -17727,7 +18388,7 @@ index 77c9d86..3562941 100644
vcpu->arch.cpuid_nent = cpuid->nent;
kvm_apic_set_version(vcpu);
kvm_x86_ops->cpuid_update(vcpu);
-@@ -2252,15 +2259,19 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
+@@ -2363,15 +2370,19 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries)
{
@@ -17750,7 +18411,7 @@ index 77c9d86..3562941 100644
return 0;
out:
-@@ -2579,7 +2590,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu,
+@@ -2746,7 +2757,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)
{
@@ -17759,9 +18420,9 @@ index 77c9d86..3562941 100644
return -EINVAL;
if (irqchip_in_kernel(vcpu->kvm))
return -ENXIO;
-@@ -4878,7 +4889,7 @@ void kvm_after_handle_nmi(struct kvm_vcpu *vcpu)
+@@ -5162,7 +5173,7 @@ static void kvm_set_mmio_spte_mask(void)
+ kvm_mmu_set_mmio_spte_mask(mask);
}
- EXPORT_SYMBOL_GPL(kvm_after_handle_nmi);
-int kvm_arch_init(void *opaque)
+int kvm_arch_init(const void *opaque)
@@ -17769,10 +18430,10 @@ index 77c9d86..3562941 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 db832fd..7e9e620 100644
+index cf4603b..7cdde38 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
-@@ -1176,9 +1176,10 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
+@@ -1195,9 +1195,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.
*/
@@ -17785,7 +18446,7 @@ index db832fd..7e9e620 100644
/*G:050
diff --git a/arch/x86/lib/atomic64_32.c b/arch/x86/lib/atomic64_32.c
-index 540179e..e9ff0ea 100644
+index 042f682..c92afb6 100644
--- a/arch/x86/lib/atomic64_32.c
+++ b/arch/x86/lib/atomic64_32.c
@@ -8,18 +8,30 @@
@@ -18654,17 +19315,10 @@ 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 6fec2d1..f162fee 100644
+index 01c805b..dccb07f 100644
--- a/arch/x86/lib/copy_page_64.S
+++ b/arch/x86/lib/copy_page_64.S
-@@ -2,12 +2,14 @@
-
- #include <linux/linkage.h>
- #include <asm/dwarf2.h>
-+#include <asm/alternative-asm.h>
-
- ALIGN
- copy_page_c:
+@@ -9,6 +9,7 @@ copy_page_c:
CFI_STARTPROC
movl $4096/8,%ecx
rep movsq
@@ -18672,7 +19326,43 @@ index 6fec2d1..f162fee 100644
ret
CFI_ENDPROC
ENDPROC(copy_page_c)
-@@ -94,6 +96,7 @@ ENTRY(copy_page)
+@@ -39,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
+
+@@ -50,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)
+
+@@ -69,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
+
+@@ -78,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)
+
+@@ -95,6 +96,7 @@ ENTRY(copy_page)
CFI_RESTORE r13
addq $3*8,%rsp
CFI_ADJUST_CFA_OFFSET -3*8
@@ -18680,7 +19370,7 @@ index 6fec2d1..f162fee 100644
ret
.Lcopy_page_end:
CFI_ENDPROC
-@@ -104,7 +107,7 @@ ENDPROC(copy_page)
+@@ -105,7 +107,7 @@ ENDPROC(copy_page)
#include <asm/cpufeature.h>
@@ -18690,7 +19380,7 @@ index 6fec2d1..f162fee 100644
.byte (copy_page_c - 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..416b737 100644
+index 0248402..821c786 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -16,6 +16,7 @@
@@ -18761,6 +19451,30 @@ index 0248402..416b737 100644
ret
CFI_ENDPROC
ENDPROC(bad_from_user)
+@@ -141,19 +115,19 @@ ENTRY(copy_user_generic_unrolled)
+ jz 17f
+ 1: movq (%rsi),%r8
+ 2: movq 1*8(%rsi),%r9
+-3: movq 2*8(%rsi),%r10
++3: movq 2*8(%rsi),%rax
+ 4: movq 3*8(%rsi),%r11
+ 5: movq %r8,(%rdi)
+ 6: movq %r9,1*8(%rdi)
+-7: movq %r10,2*8(%rdi)
++7: movq %rax,2*8(%rdi)
+ 8: movq %r11,3*8(%rdi)
+ 9: movq 4*8(%rsi),%r8
+ 10: movq 5*8(%rsi),%r9
+-11: movq 6*8(%rsi),%r10
++11: movq 6*8(%rsi),%rax
+ 12: movq 7*8(%rsi),%r11
+ 13: movq %r8,4*8(%rdi)
+ 14: movq %r9,5*8(%rdi)
+-15: movq %r10,6*8(%rdi)
++15: movq %rax,6*8(%rdi)
+ 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
jnz 21b
@@ -18786,7 +19500,7 @@ index 0248402..416b737 100644
.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..8433392 100644
+index cb0c112..e3a6895 100644
--- a/arch/x86/lib/copy_user_nocache_64.S
+++ b/arch/x86/lib/copy_user_nocache_64.S
@@ -8,12 +8,14 @@
@@ -18820,6 +19534,30 @@ index cb0c112..8433392 100644
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
+ 2: movq 1*8(%rsi),%r9
+-3: movq 2*8(%rsi),%r10
++3: movq 2*8(%rsi),%rax
+ 4: movq 3*8(%rsi),%r11
+ 5: movnti %r8,(%rdi)
+ 6: movnti %r9,1*8(%rdi)
+-7: movnti %r10,2*8(%rdi)
++7: movnti %rax,2*8(%rdi)
+ 8: movnti %r11,3*8(%rdi)
+ 9: movq 4*8(%rsi),%r8
+ 10: movq 5*8(%rsi),%r9
+-11: movq 6*8(%rsi),%r10
++11: movq 6*8(%rsi),%rax
+ 12: movq 7*8(%rsi),%r11
+ 13: movnti %r8,4*8(%rdi)
+ 14: movnti %r9,5*8(%rdi)
+-15: movnti %r10,6*8(%rdi)
++15: movnti %rax,6*8(%rdi)
+ 16: movnti %r11,7*8(%rdi)
+ leaq 64(%rsi),%rsi
+ leaq 64(%rdi),%rdi
@@ -98,6 +109,7 @@ ENTRY(__copy_user_nocache)
jnz 21b
23: xorl %eax,%eax
@@ -18829,7 +19567,7 @@ index cb0c112..8433392 100644
.section .fixup,"ax"
diff --git a/arch/x86/lib/csum-copy_64.S b/arch/x86/lib/csum-copy_64.S
-index fb903b7..dd8c022 100644
+index fb903b7..c92b7f7 100644
--- a/arch/x86/lib/csum-copy_64.S
+++ b/arch/x86/lib/csum-copy_64.S
@@ -8,6 +8,7 @@
@@ -18844,7 +19582,7 @@ index fb903b7..dd8c022 100644
CFI_RESTORE rbp
addq $7*8, %rsp
CFI_ADJUST_CFA_OFFSET -7*8
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
CFI_RESTORE_STATE
@@ -19010,7 +19748,7 @@ index 51f1504..ddac4c1 100644
CFI_ENDPROC
END(bad_get_user)
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
-index 9f33b98..dfc7678 100644
+index 374562e..a75830b 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -21,6 +21,11 @@
@@ -19023,9 +19761,9 @@ index 9f33b98..dfc7678 100644
+#define ktla_ktva(addr) addr
+#endif
- #define get_next(t, insn) \
- ({t r; r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; })
-@@ -40,8 +45,8 @@
+ /* Verify next sizeof(t) bytes can be on the same instruction */
+ #define validate_next(t, insn, n) \
+@@ -49,8 +54,8 @@
void insn_init(struct insn *insn, const void *kaddr, int x86_64)
{
memset(insn, 0, sizeof(*insn));
@@ -19057,7 +19795,7 @@ index 05a95e7..326f2fa 100644
CFI_ENDPROC
ENDPROC(__iowrite32_copy)
diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
-index efbf2a0..8090894 100644
+index efbf2a0..8893637 100644
--- a/arch/x86/lib/memcpy_64.S
+++ b/arch/x86/lib/memcpy_64.S
@@ -34,6 +34,7 @@
@@ -19076,9 +19814,48 @@ index efbf2a0..8090894 100644
ret
.Lmemcpy_e_e:
.previous
-@@ -141,6 +143,7 @@ ENTRY(memcpy)
+@@ -81,13 +83,13 @@ ENTRY(memcpy)
+ */
+ movq 0*8(%rsi), %r8
+ movq 1*8(%rsi), %r9
+- movq 2*8(%rsi), %r10
++ movq 2*8(%rsi), %rcx
+ movq 3*8(%rsi), %r11
+ leaq 4*8(%rsi), %rsi
+
+ movq %r8, 0*8(%rdi)
+ movq %r9, 1*8(%rdi)
+- movq %r10, 2*8(%rdi)
++ movq %rcx, 2*8(%rdi)
+ movq %r11, 3*8(%rdi)
+ leaq 4*8(%rdi), %rdi
+ jae .Lcopy_forward_loop
+@@ -110,12 +112,12 @@ ENTRY(memcpy)
+ subq $0x20, %rdx
+ movq -1*8(%rsi), %r8
+ movq -2*8(%rsi), %r9
+- movq -3*8(%rsi), %r10
++ movq -3*8(%rsi), %rcx
+ movq -4*8(%rsi), %r11
+ leaq -4*8(%rsi), %rsi
+ movq %r8, -1*8(%rdi)
+ movq %r9, -2*8(%rdi)
+- movq %r10, -3*8(%rdi)
++ movq %rcx, -3*8(%rdi)
+ movq %r11, -4*8(%rdi)
+ leaq -4*8(%rdi), %rdi
+ jae .Lcopy_backward_loop
+@@ -135,12 +137,13 @@ ENTRY(memcpy)
+ */
+ movq 0*8(%rsi), %r8
+ movq 1*8(%rsi), %r9
+- movq -2*8(%rsi, %rdx), %r10
++ movq -2*8(%rsi, %rdx), %rcx
+ movq -1*8(%rsi, %rdx), %r11
+ movq %r8, 0*8(%rdi)
movq %r9, 1*8(%rdi)
- movq %r10, -2*8(%rdi, %rdx)
+- movq %r10, -2*8(%rdi, %rdx)
++ movq %rcx, -2*8(%rdi, %rdx)
movq %r11, -1*8(%rdi, %rdx)
+ pax_force_retaddr
retq
@@ -19109,18 +19886,122 @@ index efbf2a0..8090894 100644
CFI_ENDPROC
ENDPROC(memcpy)
diff --git a/arch/x86/lib/memmove_64.S b/arch/x86/lib/memmove_64.S
-index d0ec9c2..e5d0a9f 100644
+index ee16461..c39c199 100644
--- a/arch/x86/lib/memmove_64.S
+++ b/arch/x86/lib/memmove_64.S
-@@ -9,6 +9,7 @@
- #include <linux/linkage.h>
- #include <asm/dwarf2.h>
- #include <asm/cpufeature.h>
-+#include <asm/alternative-asm.h>
+@@ -61,13 +61,13 @@ ENTRY(memmove)
+ 5:
+ sub $0x20, %rdx
+ movq 0*8(%rsi), %r11
+- movq 1*8(%rsi), %r10
++ movq 1*8(%rsi), %rcx
+ movq 2*8(%rsi), %r9
+ movq 3*8(%rsi), %r8
+ leaq 4*8(%rsi), %rsi
+
+ movq %r11, 0*8(%rdi)
+- movq %r10, 1*8(%rdi)
++ movq %rcx, 1*8(%rdi)
+ movq %r9, 2*8(%rdi)
+ movq %r8, 3*8(%rdi)
+ leaq 4*8(%rdi), %rdi
+@@ -81,10 +81,10 @@ ENTRY(memmove)
+ 4:
+ movq %rdx, %rcx
+ movq -8(%rsi, %rdx), %r11
+- lea -8(%rdi, %rdx), %r10
++ lea -8(%rdi, %rdx), %r9
+ shrq $3, %rcx
+ rep movsq
+- movq %r11, (%r10)
++ movq %r11, (%r9)
+ jmp 13f
+ .Lmemmove_end_forward:
- #undef memmove
+@@ -95,14 +95,14 @@ ENTRY(memmove)
+ 7:
+ movq %rdx, %rcx
+ movq (%rsi), %r11
+- movq %rdi, %r10
++ movq %rdi, %r9
+ leaq -8(%rsi, %rdx), %rsi
+ leaq -8(%rdi, %rdx), %rdi
+ shrq $3, %rcx
+ std
+ rep movsq
+ cld
+- movq %r11, (%r10)
++ movq %r11, (%r9)
+ jmp 13f
-@@ -201,6 +202,7 @@ ENTRY(memmove)
+ /*
+@@ -127,13 +127,13 @@ ENTRY(memmove)
+ 8:
+ subq $0x20, %rdx
+ movq -1*8(%rsi), %r11
+- movq -2*8(%rsi), %r10
++ movq -2*8(%rsi), %rcx
+ movq -3*8(%rsi), %r9
+ movq -4*8(%rsi), %r8
+ leaq -4*8(%rsi), %rsi
+
+ movq %r11, -1*8(%rdi)
+- movq %r10, -2*8(%rdi)
++ movq %rcx, -2*8(%rdi)
+ movq %r9, -3*8(%rdi)
+ movq %r8, -4*8(%rdi)
+ leaq -4*8(%rdi), %rdi
+@@ -151,11 +151,11 @@ ENTRY(memmove)
+ * Move data from 16 bytes to 31 bytes.
+ */
+ movq 0*8(%rsi), %r11
+- movq 1*8(%rsi), %r10
++ movq 1*8(%rsi), %rcx
+ movq -2*8(%rsi, %rdx), %r9
+ movq -1*8(%rsi, %rdx), %r8
+ movq %r11, 0*8(%rdi)
+- movq %r10, 1*8(%rdi)
++ movq %rcx, 1*8(%rdi)
+ movq %r9, -2*8(%rdi, %rdx)
+ movq %r8, -1*8(%rdi, %rdx)
+ jmp 13f
+@@ -167,9 +167,9 @@ ENTRY(memmove)
+ * Move data from 8 bytes to 15 bytes.
+ */
+ movq 0*8(%rsi), %r11
+- movq -1*8(%rsi, %rdx), %r10
++ movq -1*8(%rsi, %rdx), %r9
+ movq %r11, 0*8(%rdi)
+- movq %r10, -1*8(%rdi, %rdx)
++ movq %r9, -1*8(%rdi, %rdx)
+ jmp 13f
+ 10:
+ cmpq $4, %rdx
+@@ -178,9 +178,9 @@ ENTRY(memmove)
+ * Move data from 4 bytes to 7 bytes.
+ */
+ movl (%rsi), %r11d
+- movl -4(%rsi, %rdx), %r10d
++ movl -4(%rsi, %rdx), %r9d
+ movl %r11d, (%rdi)
+- movl %r10d, -4(%rdi, %rdx)
++ movl %r9d, -4(%rdi, %rdx)
+ jmp 13f
+ 11:
+ cmp $2, %rdx
+@@ -189,9 +189,9 @@ ENTRY(memmove)
+ * Move data from 2 bytes to 3 bytes.
+ */
+ movw (%rsi), %r11w
+- movw -2(%rsi, %rdx), %r10w
++ movw -2(%rsi, %rdx), %r9w
+ movw %r11w, (%rdi)
+- movw %r10w, -2(%rdi, %rdx)
++ movw %r9w, -2(%rdi, %rdx)
+ jmp 13f
+ 12:
+ cmp $1, %rdx
+@@ -202,6 +202,7 @@ ENTRY(memmove)
movb (%rsi), %r11b
movb %r11b, (%rdi)
13:
@@ -19128,7 +20009,7 @@ index d0ec9c2..e5d0a9f 100644
retq
CFI_ENDPROC
-@@ -209,6 +211,7 @@ ENTRY(memmove)
+@@ -210,6 +211,7 @@ ENTRY(memmove)
/* Forward moving data. */
movq %rdx, %rcx
rep movsb
@@ -19137,7 +20018,7 @@ index d0ec9c2..e5d0a9f 100644
.Lmemmove_end_forward_efs:
.previous
diff --git a/arch/x86/lib/memset_64.S b/arch/x86/lib/memset_64.S
-index 79bd454..24b3780 100644
+index 79bd454..dff325a 100644
--- a/arch/x86/lib/memset_64.S
+++ b/arch/x86/lib/memset_64.S
@@ -31,6 +31,7 @@
@@ -19156,10 +20037,27 @@ index 79bd454..24b3780 100644
ret
.Lmemset_e_e:
.previous
-@@ -121,6 +123,7 @@ ENTRY(__memset)
+@@ -60,13 +62,13 @@
+ ENTRY(memset)
+ ENTRY(__memset)
+ CFI_STARTPROC
+- movq %rdi,%r10
+ movq %rdx,%r11
+
+ /* expand byte value */
+ movzbl %sil,%ecx
+ movabs $0x0101010101010101,%rax
+ mul %rcx /* with rax, clobbers rdx */
++ movq %rdi,%rdx
+
+ /* align dst */
+ movl %edi,%r9d
+@@ -120,7 +122,8 @@ ENTRY(__memset)
+ jnz .Lloop_1
.Lende:
- movq %r10,%rax
+- movq %r10,%rax
++ movq %rdx,%rax
+ pax_force_retaddr
ret
@@ -19484,7 +20382,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..234ac7f 100644
+index 69fa106..adda88b 100644
--- a/arch/x86/lib/msr-reg.S
+++ b/arch/x86/lib/msr-reg.S
@@ -3,6 +3,7 @@
@@ -19495,8 +20393,34 @@ index 69fa106..234ac7f 100644
#ifdef CONFIG_X86_64
/*
-@@ -37,6 +38,7 @@ ENTRY(native_\op\()_safe_regs)
- movl %edi, 28(%r10)
+@@ -16,7 +17,7 @@ ENTRY(native_\op\()_safe_regs)
+ CFI_STARTPROC
+ pushq_cfi %rbx
+ pushq_cfi %rbp
+- movq %rdi, %r10 /* Save pointer */
++ movq %rdi, %r9 /* Save pointer */
+ xorl %r11d, %r11d /* Return value */
+ movl (%rdi), %eax
+ movl 4(%rdi), %ecx
+@@ -27,16 +28,17 @@ ENTRY(native_\op\()_safe_regs)
+ movl 28(%rdi), %edi
+ CFI_REMEMBER_STATE
+ 1: \op
+-2: movl %eax, (%r10)
++2: movl %eax, (%r9)
+ movl %r11d, %eax /* Return value */
+- movl %ecx, 4(%r10)
+- movl %edx, 8(%r10)
+- movl %ebx, 12(%r10)
+- movl %ebp, 20(%r10)
+- movl %esi, 24(%r10)
+- movl %edi, 28(%r10)
++ movl %ecx, 4(%r9)
++ movl %edx, 8(%r9)
++ movl %ebx, 12(%r9)
++ movl %ebp, 20(%r9)
++ movl %esi, 24(%r9)
++ movl %edi, 28(%r9)
popq_cfi %rbp
popq_cfi %rbx
+ pax_force_retaddr
@@ -19646,39 +20570,93 @@ index 36b0d15..d381858 100644
#endif
xor %eax,%eax
EXIT
-diff --git a/arch/x86/lib/rwlock_64.S b/arch/x86/lib/rwlock_64.S
-index 05ea55f..f81311a 100644
---- a/arch/x86/lib/rwlock_64.S
-+++ b/arch/x86/lib/rwlock_64.S
-@@ -17,6 +17,7 @@ ENTRY(__write_lock_failed)
+diff --git a/arch/x86/lib/rwlock.S b/arch/x86/lib/rwlock.S
+index 1cad221..de671ee 100644
+--- a/arch/x86/lib/rwlock.S
++++ b/arch/x86/lib/rwlock.S
+@@ -16,13 +16,34 @@ ENTRY(__write_lock_failed)
+ FRAME
+ 0: LOCK_PREFIX
+ WRITE_LOCK_ADD($RW_LOCK_BIAS) (%__lock_ptr)
++
++#ifdef CONFIG_PAX_REFCOUNT
++ jno 1234f
++ LOCK_PREFIX
++ WRITE_LOCK_SUB($RW_LOCK_BIAS) (%__lock_ptr)
++ int $4
++1234:
++ _ASM_EXTABLE(1234b, 1234b)
++#endif
++
+ 1: rep; nop
+ cmpl $WRITE_LOCK_CMP, (%__lock_ptr)
+ jne 1b
LOCK_PREFIX
- subl $RW_LOCK_BIAS,(%rdi)
- jnz __write_lock_failed
+ WRITE_LOCK_SUB($RW_LOCK_BIAS) (%__lock_ptr)
++
++#ifdef CONFIG_PAX_REFCOUNT
++ jno 1234f
++ LOCK_PREFIX
++ WRITE_LOCK_ADD($RW_LOCK_BIAS) (%__lock_ptr)
++ int $4
++1234:
++ _ASM_EXTABLE(1234b, 1234b)
++#endif
++
+ jnz 0b
+ ENDFRAME
+ pax_force_retaddr
ret
CFI_ENDPROC
END(__write_lock_failed)
-@@ -33,6 +34,7 @@ ENTRY(__read_lock_failed)
+@@ -32,13 +53,34 @@ ENTRY(__read_lock_failed)
+ FRAME
+ 0: LOCK_PREFIX
+ READ_LOCK_SIZE(inc) (%__lock_ptr)
++
++#ifdef CONFIG_PAX_REFCOUNT
++ jno 1234f
++ LOCK_PREFIX
++ READ_LOCK_SIZE(dec) (%__lock_ptr)
++ int $4
++1234:
++ _ASM_EXTABLE(1234b, 1234b)
++#endif
++
+ 1: rep; nop
+ READ_LOCK_SIZE(cmp) $1, (%__lock_ptr)
+ js 1b
LOCK_PREFIX
- decl (%rdi)
- js __read_lock_failed
+ READ_LOCK_SIZE(dec) (%__lock_ptr)
++
++#ifdef CONFIG_PAX_REFCOUNT
++ jno 1234f
++ LOCK_PREFIX
++ READ_LOCK_SIZE(inc) (%__lock_ptr)
++ int $4
++1234:
++ _ASM_EXTABLE(1234b, 1234b)
++#endif
++
+ js 0b
+ ENDFRAME
+ pax_force_retaddr
ret
CFI_ENDPROC
END(__read_lock_failed)
-diff --git a/arch/x86/lib/rwsem_64.S b/arch/x86/lib/rwsem_64.S
-index 6774397..79f43de 100644
---- a/arch/x86/lib/rwsem_64.S
-+++ b/arch/x86/lib/rwsem_64.S
-@@ -51,6 +51,7 @@ ENTRY(call_rwsem_down_read_failed)
- popq_cfi %rdx
- CFI_RESTORE rdx
+diff --git a/arch/x86/lib/rwsem.S b/arch/x86/lib/rwsem.S
+index 5dff5f0..cadebf4 100644
+--- a/arch/x86/lib/rwsem.S
++++ b/arch/x86/lib/rwsem.S
+@@ -94,6 +94,7 @@ ENTRY(call_rwsem_down_read_failed)
+ __ASM_SIZE(pop,_cfi) %__ASM_REG(dx)
+ CFI_RESTORE __ASM_REG(dx)
restore_common_regs
+ pax_force_retaddr
ret
CFI_ENDPROC
ENDPROC(call_rwsem_down_read_failed)
-@@ -61,6 +62,7 @@ ENTRY(call_rwsem_down_write_failed)
+@@ -104,6 +105,7 @@ ENTRY(call_rwsem_down_write_failed)
movq %rax,%rdi
call rwsem_down_write_failed
restore_common_regs
@@ -19686,7 +20664,7 @@ index 6774397..79f43de 100644
ret
CFI_ENDPROC
ENDPROC(call_rwsem_down_write_failed)
-@@ -73,7 +75,8 @@ ENTRY(call_rwsem_wake)
+@@ -117,7 +119,8 @@ ENTRY(call_rwsem_wake)
movq %rax,%rdi
call rwsem_wake
restore_common_regs
@@ -19696,35 +20674,32 @@ index 6774397..79f43de 100644
CFI_ENDPROC
ENDPROC(call_rwsem_wake)
-@@ -88,6 +91,7 @@ ENTRY(call_rwsem_downgrade_wake)
- popq_cfi %rdx
- CFI_RESTORE rdx
+@@ -131,6 +134,7 @@ ENTRY(call_rwsem_downgrade_wake)
+ __ASM_SIZE(pop,_cfi) %__ASM_REG(dx)
+ CFI_RESTORE __ASM_REG(dx)
restore_common_regs
+ pax_force_retaddr
ret
CFI_ENDPROC
ENDPROC(call_rwsem_downgrade_wake)
diff --git a/arch/x86/lib/thunk_64.S b/arch/x86/lib/thunk_64.S
-index 782b082..d3b6318 100644
+index a63efd6..ccecad8 100644
--- a/arch/x86/lib/thunk_64.S
+++ b/arch/x86/lib/thunk_64.S
-@@ -10,7 +10,8 @@
- #include <asm/dwarf2.h>
- #include <asm/calling.h>
- #include <asm/rwlock.h>
--
-+ #include <asm/alternative-asm.h>
-+
- /* rdi: arg1 ... normal C conventions. rax is saved/restored. */
- .macro thunk name,func
- .globl \name
-@@ -50,5 +51,6 @@
+@@ -8,6 +8,7 @@
+ #include <linux/linkage.h>
+ #include <asm/dwarf2.h>
+ #include <asm/calling.h>
++#include <asm/alternative-asm.h>
+
+ /* rdi: arg1 ... normal C conventions. rax is saved/restored. */
+ .macro THUNK name, func, put_ret_addr_in_rdi=0
+@@ -41,5 +42,6 @@
SAVE_ARGS
restore:
RESTORE_ARGS
-- ret
+ pax_force_retaddr
-+ ret
+ ret
CFI_ENDPROC
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
index e218d5d..35679b4 100644
@@ -20280,16 +21255,13 @@ index e218d5d..35679b4 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.
@@ -20308,23 +21280,30 @@ index e218d5d..35679b4 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);
@@ -20339,8 +21318,7 @@ index e218d5d..35679b4 100644
+ BUG();
+ }
+ return;
- }
--EXPORT_SYMBOL(copy_from_user_overflow);
++}
+EXPORT_SYMBOL(__set_fs);
+
+void set_fs(mm_segment_t x)
@@ -20351,7 +21329,7 @@ index e218d5d..35679b4 100644
+EXPORT_SYMBOL(set_fs);
+#endif
diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
-index b7c2849..5ef0f95 100644
+index b7c2849..8633ad8 100644
--- a/arch/x86/lib/usercopy_64.c
+++ b/arch/x86/lib/usercopy_64.c
@@ -42,6 +42,12 @@ long
@@ -20380,9 +21358,12 @@ index b7c2849..5ef0f95 100644
/* no memory constraint because it doesn't change any memory gcc knows
about */
asm volatile(
-@@ -151,10 +163,18 @@ EXPORT_SYMBOL(strlen_user);
+@@ -149,12 +161,20 @@ long strlen_user(const char __user *s)
+ }
+ EXPORT_SYMBOL(strlen_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 len)
++unsigned long copy_in_user(void __user *to, const void __user *from, unsigned long len)
{
- if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) {
- return copy_user_generic((__force void *)to, (__force void *)from, len);
@@ -20408,7 +21389,7 @@ index b7c2849..5ef0f95 100644
*/
unsigned long
-copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest)
-+copy_user_handle_tail(char __user *to, char __user *from, unsigned len, unsigned zerorest)
++copy_user_handle_tail(char __user *to, char __user *from, unsigned long len, unsigned zerorest)
{
char c;
unsigned zero_len;
@@ -20426,10 +21407,10 @@ index d0474ad..36e9257 100644
extern u32 pnp_bios_is_utter_crap;
pnp_bios_is_utter_crap = 1;
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
-index 2dbf6bf..4a744ee 100644
+index 5db0490..13bd09c 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
-@@ -13,10 +13,18 @@
+@@ -13,11 +13,18 @@
#include <linux/perf_event.h> /* perf_sw_event */
#include <linux/hugetlb.h> /* hstate_index_to_shift */
#include <linux/prefetch.h> /* prefetchw */
@@ -20439,7 +21420,7 @@ index 2dbf6bf..4a744ee 100644
#include <asm/traps.h> /* dotraplinkage, ... */
#include <asm/pgalloc.h> /* pgd_*(), ... */
#include <asm/kmemcheck.h> /* kmemcheck_*(), ... */
-+#include <asm/vsyscall.h>
+ #include <asm/fixmap.h> /* VSYSCALL_START */
+#include <asm/tlbflush.h>
+
+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
@@ -20448,7 +21429,7 @@ index 2dbf6bf..4a744ee 100644
/*
* Page fault error code bits:
-@@ -54,7 +62,7 @@ static inline int __kprobes notify_page_fault(struct pt_regs *regs)
+@@ -55,7 +62,7 @@ static inline int __kprobes notify_page_fault(struct pt_regs *regs)
int ret = 0;
/* kprobe_running() needs smp_processor_id() */
@@ -20457,7 +21438,7 @@ index 2dbf6bf..4a744ee 100644
preempt_disable();
if (kprobe_running() && kprobe_fault_handler(regs, 14))
ret = 1;
-@@ -115,7 +123,10 @@ check_prefetch_opcode(struct pt_regs *regs, unsigned char *instr,
+@@ -116,7 +123,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 */
@@ -20469,7 +21450,7 @@ index 2dbf6bf..4a744ee 100644
return 0;
*prefetch = (instr_lo == 0xF) &&
-@@ -149,7 +160,10 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr)
+@@ -150,7 +160,10 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr)
while (instr < max_instr) {
unsigned char opcode;
@@ -20481,10 +21462,14 @@ index 2dbf6bf..4a744ee 100644
break;
instr++;
-@@ -180,6 +194,30 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address,
+@@ -181,6 +194,34 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address,
force_sig_info(si_signo, &info, tsk);
}
++#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
++static bool pax_is_fetch_fault(struct pt_regs *regs, unsigned long error_code, unsigned long address);
++#endif
++
+#ifdef CONFIG_PAX_EMUTRAMP
+static int pax_handle_fetch_fault(struct pt_regs *regs);
+#endif
@@ -20512,7 +21497,7 @@ index 2dbf6bf..4a744ee 100644
DEFINE_SPINLOCK(pgd_lock);
LIST_HEAD(pgd_list);
-@@ -230,10 +268,22 @@ void vmalloc_sync_all(void)
+@@ -231,10 +272,22 @@ void vmalloc_sync_all(void)
for (address = VMALLOC_START & PMD_MASK;
address >= TASK_SIZE && address < FIXADDR_TOP;
address += PMD_SIZE) {
@@ -20535,7 +21520,7 @@ index 2dbf6bf..4a744ee 100644
spinlock_t *pgt_lock;
pmd_t *ret;
-@@ -241,8 +291,13 @@ void vmalloc_sync_all(void)
+@@ -242,8 +295,13 @@ void vmalloc_sync_all(void)
pgt_lock = &pgd_page_get_mm(page)->page_table_lock;
spin_lock(pgt_lock);
@@ -20550,7 +21535,7 @@ index 2dbf6bf..4a744ee 100644
if (!ret)
break;
-@@ -276,6 +331,11 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
+@@ -277,6 +335,11 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
* an interrupt in the middle of a task switch..
*/
pgd_paddr = read_cr3();
@@ -20562,7 +21547,7 @@ index 2dbf6bf..4a744ee 100644
pmd_k = vmalloc_sync_one(__va(pgd_paddr), address);
if (!pmd_k)
return -1;
-@@ -371,7 +431,14 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
+@@ -372,7 +435,14 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
* happen within a race in page table update. In the later
* case just flush:
*/
@@ -20577,7 +21562,7 @@ index 2dbf6bf..4a744ee 100644
pgd_ref = pgd_offset_k(address);
if (pgd_none(*pgd_ref))
return -1;
-@@ -533,7 +600,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
+@@ -540,7 +610,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
@@ -20586,7 +21571,7 @@ index 2dbf6bf..4a744ee 100644
return 1;
#endif
return 0;
-@@ -560,7 +627,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
+@@ -567,7 +637,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
}
static const char nx_warning[] = KERN_CRIT
@@ -20595,7 +21580,7 @@ index 2dbf6bf..4a744ee 100644
static void
show_fault_oops(struct pt_regs *regs, unsigned long error_code,
-@@ -569,14 +636,25 @@ 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,
if (!oops_may_print())
return;
@@ -20608,8 +21593,8 @@ index 2dbf6bf..4a744ee 100644
if (pte && pte_present(*pte) && !pte_exec(*pte))
- printk(nx_warning, current_uid());
+ printk(nx_warning, 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)
@@ -20618,45 +21603,18 @@ index 2dbf6bf..4a744ee 100644
+ 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());
- }
-+#endif
-
- printk(KERN_ALERT "BUG: unable to handle kernel ");
- if (address < PAGE_SIZE)
-@@ -702,6 +780,66 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
- unsigned long address, int si_code)
- {
- struct task_struct *tsk = current;
-+#if defined(CONFIG_X86_64) || defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
-+ struct mm_struct *mm = tsk->mm;
-+#endif
-+
-+#ifdef CONFIG_X86_64
-+ if (mm && (error_code & PF_INSTR) && mm->context.vdso) {
-+ if (regs->ip == VSYSCALL_ADDR(__NR_vgettimeofday) ||
-+ regs->ip == VSYSCALL_ADDR(__NR_vtime) ||
-+ regs->ip == VSYSCALL_ADDR(__NR_vgetcpu)) {
-+ regs->ip += mm->context.vdso - PAGE_SIZE - VSYSCALL_START;
-+ return;
-+ }
+ }
+#endif
+
+ printk(KERN_ALERT "BUG: unable to handle kernel ");
+ if (address < PAGE_SIZE)
+ printk(KERN_CONT "NULL pointer dereference");
+@@ -739,6 +820,21 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
+ }
+ #endif
+
+#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
-+ if (mm && (error_code & PF_USER)) {
-+ unsigned long ip = regs->ip;
-+
-+ if (v8086_mode(regs))
-+ ip = ((regs->cs & 0xffff) << 4) + (ip & 0xffff);
-+
-+ /*
-+ * It's possible to have interrupts off here:
-+ */
-+ local_irq_enable();
-+
-+#ifdef CONFIG_PAX_PAGEEXEC
-+ if ((mm->pax_flags & MF_PAX_PAGEEXEC) &&
-+ (((__supported_pte_mask & _PAGE_NX) && (error_code & PF_INSTR)) || (!(error_code & (PF_PROT | PF_WRITE)) && ip == address))) {
++ if (pax_is_fetch_fault(regs, error_code, address)) {
+
+#ifdef CONFIG_PAX_EMUTRAMP
+ switch (pax_handle_fetch_fault(regs)) {
@@ -20665,32 +21623,24 @@ index 2dbf6bf..4a744ee 100644
+ }
+#endif
+
-+ pax_report_fault(regs, (void *)ip, (void *)regs->sp);
++ pax_report_fault(regs, (void *)regs->ip, (void *)regs->sp);
+ do_group_exit(SIGKILL);
+ }
+#endif
+
-+#ifdef CONFIG_PAX_SEGMEXEC
-+ if ((mm->pax_flags & MF_PAX_SEGMEXEC) && !(error_code & (PF_PROT | PF_WRITE)) && (ip + SEGMEXEC_TASK_SIZE == address)) {
-+
-+#ifdef CONFIG_PAX_EMUTRAMP
-+ switch (pax_handle_fetch_fault(regs)) {
-+ case 2:
-+ return;
-+ }
-+#endif
-+
-+ pax_report_fault(regs, (void *)ip, (void *)regs->sp);
-+ do_group_exit(SIGKILL);
-+ }
-+#endif
-+
-+ }
-+#endif
+ if (unlikely(show_unhandled_signals))
+ show_signal_msg(regs, error_code, address, tsk);
- /* User mode accesses just cause a SIGSEGV */
- if (error_code & PF_USER) {
-@@ -871,6 +1009,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
+@@ -835,7 +931,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",
+- tsk->comm, tsk->pid, address);
++ tsk->comm, task_pid_nr(tsk), address);
+ code = BUS_MCEERR_AR;
+ }
+ #endif
+@@ -890,6 +986,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
return 1;
}
@@ -20790,7 +21740,7 @@ index 2dbf6bf..4a744ee 100644
/*
* Handle a spurious fault caused by a stale TLB entry.
*
-@@ -943,6 +1174,9 @@ int show_unhandled_signals = 1;
+@@ -962,6 +1151,9 @@ int show_unhandled_signals = 1;
static inline int
access_error(unsigned long error_code, struct vm_area_struct *vma)
{
@@ -20800,7 +21750,7 @@ index 2dbf6bf..4a744ee 100644
if (error_code & PF_WRITE) {
/* write, present and write, not present: */
if (unlikely(!(vma->vm_flags & VM_WRITE)))
-@@ -976,19 +1210,33 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
+@@ -995,18 +1187,32 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
{
struct vm_area_struct *vma;
struct task_struct *tsk;
@@ -20811,7 +21761,11 @@ index 2dbf6bf..4a744ee 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)
@@ -20822,23 +21776,19 @@ index 2dbf6bf..4a744ee 100644
+ }
+ if (address < PAX_USER_SHADOW_BASE) {
+ printk(KERN_ERR "PAX: please report this to pageexec@freemail.hu\n");
-+ printk(KERN_ERR "PAX: faulting IP: %pA\n", (void *)regs->ip);
++ 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;
+ }
+#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.
-@@ -1048,7 +1296,7 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
+@@ -1067,7 +1273,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:
*/
@@ -20847,7 +21797,7 @@ index 2dbf6bf..4a744ee 100644
local_irq_enable();
error_code |= PF_USER;
} else {
-@@ -1103,6 +1351,11 @@ retry:
+@@ -1122,6 +1328,11 @@ retry:
might_sleep();
}
@@ -20859,7 +21809,7 @@ index 2dbf6bf..4a744ee 100644
vma = find_vma(mm, address);
if (unlikely(!vma)) {
bad_area(regs, error_code, address);
-@@ -1114,18 +1367,24 @@ retry:
+@@ -1133,18 +1344,24 @@ retry:
bad_area(regs, error_code, address);
return;
}
@@ -20895,16 +21845,71 @@ index 2dbf6bf..4a744ee 100644
if (unlikely(expand_stack(vma, address))) {
bad_area(regs, error_code, address);
return;
-@@ -1180,3 +1439,199 @@ good_area:
+@@ -1199,3 +1416,292 @@ good_area:
up_read(&mm->mmap_sem);
}
+
++#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
++static bool pax_is_fetch_fault(struct pt_regs *regs, unsigned long error_code, unsigned long address)
++{
++ struct mm_struct *mm = current->mm;
++ unsigned long ip = regs->ip;
++
++ if (v8086_mode(regs))
++ ip = ((regs->cs & 0xffff) << 4) + (ip & 0xffff);
++
++#ifdef CONFIG_PAX_PAGEEXEC
++ if (mm->pax_flags & MF_PAX_PAGEEXEC) {
++ if ((__supported_pte_mask & _PAGE_NX) && (error_code & PF_INSTR))
++ return true;
++ if (!(error_code & (PF_PROT | PF_WRITE)) && ip == address)
++ return true;
++ return false;
++ }
++#endif
++
++#ifdef CONFIG_PAX_SEGMEXEC
++ if (mm->pax_flags & MF_PAX_SEGMEXEC) {
++ if (!(error_code & (PF_PROT | PF_WRITE)) && (ip + SEGMEXEC_TASK_SIZE == address))
++ return true;
++ return false;
++ }
++#endif
++
++ return false;
++}
++#endif
++
+#ifdef CONFIG_PAX_EMUTRAMP
+static int pax_handle_fetch_fault_32(struct pt_regs *regs)
+{
+ int err;
+
++ do { /* PaX: libffi trampoline emulation */
++ unsigned char mov, jmp;
++ unsigned int addr1, addr2;
++
++#ifdef CONFIG_X86_64
++ if ((regs->ip + 9) >> 32)
++ break;
++#endif
++
++ err = get_user(mov, (unsigned char __user *)regs->ip);
++ err |= get_user(addr1, (unsigned int __user *)(regs->ip + 1));
++ err |= get_user(jmp, (unsigned char __user *)(regs->ip + 5));
++ err |= get_user(addr2, (unsigned int __user *)(regs->ip + 6));
++
++ if (err)
++ break;
++
++ if (mov == 0xB8 && jmp == 0xE9) {
++ regs->ax = addr1;
++ regs->ip = (unsigned int)(regs->ip + addr2 + 10);
++ return 2;
++ }
++ } while (0);
++
+ do { /* PaX: gcc trampoline emulation #1 */
+ unsigned char mov1, mov2;
+ unsigned short jmp;
@@ -20964,6 +21969,34 @@ index 2dbf6bf..4a744ee 100644
+{
+ int err;
+
++ do { /* PaX: libffi trampoline emulation */
++ unsigned short mov1, mov2, jmp1;
++ unsigned char stcclc, jmp2;
++ unsigned long addr1, addr2;
++
++ err = get_user(mov1, (unsigned short __user *)regs->ip);
++ err |= get_user(addr1, (unsigned long __user *)(regs->ip + 2));
++ err |= get_user(mov2, (unsigned short __user *)(regs->ip + 10));
++ err |= get_user(addr2, (unsigned long __user *)(regs->ip + 12));
++ err |= get_user(stcclc, (unsigned char __user *)(regs->ip + 20));
++ err |= get_user(jmp1, (unsigned short __user *)(regs->ip + 21));
++ err |= get_user(jmp2, (unsigned char __user *)(regs->ip + 23));
++
++ if (err)
++ break;
++
++ if (mov1 == 0xBB49 && mov2 == 0xBA49 && (stcclc == 0xF8 || stcclc == 0xF9) && jmp1 == 0xFF49 && jmp2 == 0xE3) {
++ regs->r11 = addr1;
++ regs->r10 = addr2;
++ if (stcclc == 0xF8)
++ regs->flags &= ~X86_EFLAGS_CF;
++ else
++ regs->flags |= X86_EFLAGS_CF;
++ regs->ip = addr1;
++ return 2;
++ }
++ } while (0);
++
+ do { /* PaX: gcc trampoline emulation #1 */
+ unsigned short mov1, mov2, jmp1;
+ unsigned char jmp2;
@@ -21041,7 +22074,7 @@ index 2dbf6bf..4a744ee 100644
+#endif
+
+#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
+{
+ long i;
+
@@ -21058,14 +22091,24 @@ index 2dbf6bf..4a744ee 100644
+ printk(KERN_ERR "PAX: bytes at SP-%lu: ", (unsigned long)sizeof(long));
+ for (i = -1; i < 80 / (long)sizeof(long); i++) {
+ unsigned long c;
-+ if (get_user(c, (unsigned long __force_user *)sp+i))
++ if (get_user(c, (unsigned long __force_user *)sp+i)) {
+#ifdef CONFIG_X86_32
+ printk(KERN_CONT "???????? ");
+#else
-+ printk(KERN_CONT "???????????????? ");
++ if ((regs->cs == __USER32_CS || (regs->cs & SEGMENT_LDT)))
++ printk(KERN_CONT "???????? ???????? ");
++ else
++ printk(KERN_CONT "???????????????? ");
+#endif
-+ else
-+ printk(KERN_CONT "%0*lx ", 2 * (int)sizeof(long), c);
++ } else {
++#ifdef CONFIG_X86_64
++ if ((regs->cs == __USER32_CS || (regs->cs & SEGMENT_LDT))) {
++ printk(KERN_CONT "%08x ", (unsigned int)c);
++ printk(KERN_CONT "%08x ", (unsigned int)(c >> 32));
++ } else
++#endif
++ printk(KERN_CONT "%0*lx ", 2 * (int)sizeof(long), c);
++ }
+ }
+ printk("\n");
+}
@@ -21336,10 +22379,18 @@ index f581a18..29efd37 100644
}
if (mm->get_unmapped_area == arch_get_unmapped_area)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
-index 87488b9..9ee65f6 100644
+index 87488b9..a55509f 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
-@@ -31,7 +31,7 @@ int direct_gbpages
+@@ -15,6 +15,7 @@
+ #include <asm/tlbflush.h>
+ #include <asm/tlb.h>
+ #include <asm/proto.h>
++#include <asm/desc.h>
+
+ unsigned long __initdata pgt_buf_start;
+ unsigned long __meminitdata pgt_buf_end;
+@@ -31,7 +32,7 @@ int direct_gbpages
static void __init find_early_table_space(unsigned long end, int use_pse,
int use_gbpages)
{
@@ -21348,11 +22399,10 @@ index 87488b9..9ee65f6 100644
phys_addr_t base;
puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
-@@ -312,12 +312,34 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
+@@ -312,8 +313,29 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
*/
int devmem_is_allowed(unsigned long pagenr)
{
-- if (pagenr <= 256)
+#ifdef CONFIG_GRKERNSEC_KMEM
+ /* allow BDA */
+ if (!pagenr)
@@ -21370,20 +22420,16 @@ index 87488b9..9ee65f6 100644
+#endif
+
+ if ((ISA_START_ADDRESS >> PAGE_SHIFT) <= pagenr && pagenr < (ISA_END_ADDRESS >> PAGE_SHIFT))
- return 1;
++ return 1;
+#ifdef CONFIG_GRKERNSEC_KMEM
+ /* throw out everything else below 1MB */
-+ if (pagenr <= 256)
+ if (pagenr <= 256)
+- return 1;
+ return 0;
+#endif
if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
return 0;
if (!page_is_ram(pagenr))
- return 1;
-+
- return 0;
- }
-
@@ -372,6 +394,86 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
void free_initmem(void)
@@ -21947,19 +22993,19 @@ index d87dd6d..bf3fa66 100644
pte = kmemcheck_pte_lookup(address);
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
-index 1dab519..60a7e5f 100644
+index 4b5ba85..f166ad2 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
-@@ -49,7 +49,7 @@ static unsigned int stack_maxrandom_size(void)
+@@ -52,7 +52,7 @@ static unsigned int stack_maxrandom_size(void)
* Leave an at least ~128 MB hole with possible stack randomization.
*/
#define MIN_GAP (128*1024*1024UL + stack_maxrandom_size())
-#define MAX_GAP (TASK_SIZE/6*5)
+#define MAX_GAP (pax_task_size/6*5)
- /*
- * True on X86_32 or when emulating IA32 on X86_64
-@@ -94,27 +94,40 @@ static unsigned long mmap_rnd(void)
+ static int mmap_is_legacy(void)
+ {
+@@ -82,27 +82,40 @@ static unsigned long mmap_rnd(void)
return rnd << PAGE_SHIFT;
}
@@ -22005,7 +23051,7 @@ index 1dab519..60a7e5f 100644
return TASK_UNMAPPED_BASE + mmap_rnd();
}
-@@ -125,11 +138,23 @@ static unsigned long mmap_legacy_base(void)
+@@ -113,11 +126,23 @@ static unsigned long mmap_legacy_base(void)
void arch_pick_mmap_layout(struct mm_struct *mm)
{
if (mmap_is_legacy()) {
@@ -22032,10 +23078,10 @@ index 1dab519..60a7e5f 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 3adff7d..47e9fe9 100644
+index de54b9b..799051e 100644
--- a/arch/x86/mm/mmio-mod.c
+++ b/arch/x86/mm/mmio-mod.c
-@@ -195,7 +195,7 @@ static void pre(struct kmmio_probe *p, struct pt_regs *regs,
+@@ -194,7 +194,7 @@ static void pre(struct kmmio_probe *p, struct pt_regs *regs,
break;
default:
{
@@ -22044,7 +23090,7 @@ index 3adff7d..47e9fe9 100644
my_trace->opcode = MMIO_UNKNOWN_OP;
my_trace->width = 0;
my_trace->value = (*ip) << 16 | *(ip + 1) << 8 |
-@@ -235,7 +235,7 @@ static void post(struct kmmio_probe *p, unsigned long condition,
+@@ -234,7 +234,7 @@ static void post(struct kmmio_probe *p, unsigned long condition,
static void ioremap_trace_core(resource_size_t offset, unsigned long size,
void __iomem *addr)
{
@@ -22053,7 +23099,7 @@ index 3adff7d..47e9fe9 100644
struct remap_trace *trace = kmalloc(sizeof(*trace), GFP_KERNEL);
/* These are page-unaligned. */
struct mmiotrace_map map = {
-@@ -259,7 +259,7 @@ static void ioremap_trace_core(resource_size_t offset, unsigned long size,
+@@ -258,7 +258,7 @@ static void ioremap_trace_core(resource_size_t offset, unsigned long size,
.private = trace
},
.phys = offset,
@@ -22063,7 +23109,7 @@ index 3adff7d..47e9fe9 100644
map.map_id = trace->id;
diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c
-index e1d1069..2251ff3 100644
+index b008656..773eac2 100644
--- a/arch/x86/mm/pageattr-test.c
+++ b/arch/x86/mm/pageattr-test.c
@@ -36,7 +36,7 @@ enum {
@@ -22282,7 +23328,7 @@ index 8573b83..6372501 100644
+ *dst++ = __pgd((pgd_val(*src++) | (_PAGE_NX & __supported_pte_mask)) & ~_PAGE_USER);
+}
+#endif
-+
+
+#ifdef CONFIG_PAX_PER_CPU_PGD
+void __clone_user_pgds(pgd_t *dst, const pgd_t *src, int count)
+{
@@ -22314,7 +23360,7 @@ index 8573b83..6372501 100644
+#define pyd_offset(mm ,address) pud_offset((mm), (address))
+#define PYD_SIZE PUD_SIZE
+#endif
-
++
+#ifdef CONFIG_PAX_PER_CPU_PGD
+static inline void pgd_ctor(struct mm_struct *mm, pgd_t *pgd) {}
+static inline void pgd_dtor(pgd_t *pgd) {}
@@ -22661,12 +23707,40 @@ index 6687022..ceabcfa 100644
+ pax_force_retaddr
ret
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
-index bfab3fa..e32d0f0 100644
+index 7b65f75..63097f6 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
-@@ -589,7 +589,9 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
- module_free(NULL, image);
- return;
+@@ -117,6 +117,10 @@ static inline void bpf_flush_icache(void *start, void *end)
+ set_fs(old_fs);
+ }
+
++struct bpf_jit_work {
++ struct work_struct work;
++ void *image;
++};
+
+ void bpf_jit_compile(struct sk_filter *fp)
+ {
+@@ -141,6 +145,10 @@ void bpf_jit_compile(struct sk_filter *fp)
+ if (addrs == NULL)
+ return;
+
++ fp->work = kmalloc(sizeof(*fp->work), GFP_KERNEL);
++ if (!fp->work)
++ goto out;
++
+ /* Before first pass, make a rough estimation of addrs[]
+ * each bpf instruction is translated to less than 64 bytes
+ */
+@@ -585,11 +593,12 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
+ if (image) {
+ if (unlikely(proglen + ilen > oldproglen)) {
+ pr_err("bpb_jit_compile fatal error\n");
+- kfree(addrs);
+- module_free(NULL, image);
+- return;
++ module_free_exec(NULL, image);
++ goto out;
}
+ pax_open_kernel();
memcpy(image + proglen, temp, ilen);
@@ -22674,7 +23748,7 @@ index bfab3fa..e32d0f0 100644
}
proglen += ilen;
addrs[i] = proglen;
-@@ -609,7 +611,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
+@@ -609,7 +618,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
break;
}
if (proglen == oldproglen) {
@@ -22683,11 +23757,42 @@ index bfab3fa..e32d0f0 100644
proglen,
sizeof(struct work_struct)));
if (!image)
+@@ -631,24 +640,27 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
+ fp->bpf_func = (void *)image;
+ }
+ out:
++ kfree(fp->work);
+ kfree(addrs);
+ return;
+ }
+
+ static void jit_free_defer(struct work_struct *arg)
+ {
+- module_free(NULL, arg);
++ module_free_exec(NULL, ((struct bpf_jit_work*)arg)->image);
++ kfree(arg);
+ }
+
+ /* run from softirq, we must use a work_struct to call
+- * module_free() from process context
++ * module_free_exec() from process context
+ */
+ void bpf_jit_free(struct sk_filter *fp)
+ {
+ if (fp->bpf_func != sk_run_filter) {
+- struct work_struct *work = (struct work_struct *)fp->bpf_func;
++ struct work_struct *work = &fp->work->work;
+
+ INIT_WORK(work, jit_free_defer);
++ fp->work->image = fp->bpf_func;
+ schedule_work(work);
+ }
+ }
diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
-index 32f78eb..9074017 100644
+index bff89df..377758a 100644
--- a/arch/x86/oprofile/backtrace.c
+++ b/arch/x86/oprofile/backtrace.c
-@@ -83,11 +83,11 @@ dump_user_backtrace_32(struct stack_frame_ia32 *head)
+@@ -46,11 +46,11 @@ dump_user_backtrace_32(struct stack_frame_ia32 *head)
struct stack_frame_ia32 *fp;
unsigned long bytes;
@@ -22701,7 +23806,7 @@ index 32f78eb..9074017 100644
oprofile_add_trace(bufhead[0].return_address);
-@@ -129,7 +129,7 @@ static struct stack_frame *dump_user_backtrace(struct stack_frame *head)
+@@ -92,7 +92,7 @@ static struct stack_frame *dump_user_backtrace(struct stack_frame *head)
struct stack_frame bufhead[2];
unsigned long bytes;
@@ -22710,7 +23815,7 @@ index 32f78eb..9074017 100644
if (bytes != sizeof(bufhead))
return NULL;
-@@ -148,7 +148,7 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
+@@ -111,7 +111,7 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
{
struct stack_frame *head = (struct stack_frame *)frame_pointer(regs);
@@ -22735,7 +23840,7 @@ index cb29191..036766d 100644
return 1;
}
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
-index a5f7d0d..f7a8a1b 100644
+index db0e9a5..8844dea 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -79,50 +79,93 @@ union bios32 {
@@ -22873,7 +23978,7 @@ index a5f7d0d..f7a8a1b 100644
: "memory");
local_irq_restore(flags);
-@@ -188,7 +234,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
+@@ -189,7 +235,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
switch (len) {
case 1:
@@ -22885,7 +23990,7 @@ index a5f7d0d..f7a8a1b 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -197,7 +246,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
+@@ -198,7 +247,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
: "1" (PCIBIOS_READ_CONFIG_BYTE),
"b" (bx),
"D" ((long)reg),
@@ -22895,7 +24000,7 @@ index a5f7d0d..f7a8a1b 100644
/*
* Zero-extend the result beyond 8 bits, do not trust the
* BIOS having done it:
-@@ -205,7 +255,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
+@@ -206,7 +256,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
*value &= 0xff;
break;
case 2:
@@ -22907,7 +24012,7 @@ index a5f7d0d..f7a8a1b 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -214,7 +267,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
+@@ -215,7 +268,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
: "1" (PCIBIOS_READ_CONFIG_WORD),
"b" (bx),
"D" ((long)reg),
@@ -22917,7 +24022,7 @@ index a5f7d0d..f7a8a1b 100644
/*
* Zero-extend the result beyond 16 bits, do not trust the
* BIOS having done it:
-@@ -222,7 +276,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
+@@ -223,7 +277,10 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
*value &= 0xffff;
break;
case 4:
@@ -22929,7 +24034,7 @@ index a5f7d0d..f7a8a1b 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -231,7 +288,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
+@@ -232,7 +289,8 @@ static int pci_bios_read(unsigned int seg, unsigned int bus,
: "1" (PCIBIOS_READ_CONFIG_DWORD),
"b" (bx),
"D" ((long)reg),
@@ -22939,7 +24044,7 @@ index a5f7d0d..f7a8a1b 100644
break;
}
-@@ -254,7 +312,10 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
+@@ -256,7 +314,10 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
switch (len) {
case 1:
@@ -22951,7 +24056,7 @@ index a5f7d0d..f7a8a1b 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -263,10 +324,14 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
+@@ -265,10 +326,14 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
"c" (value),
"b" (bx),
"D" ((long)reg),
@@ -22968,7 +24073,7 @@ index a5f7d0d..f7a8a1b 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -275,10 +340,14 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
+@@ -277,10 +342,14 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
"c" (value),
"b" (bx),
"D" ((long)reg),
@@ -22985,7 +24090,7 @@ index a5f7d0d..f7a8a1b 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -287,7 +356,8 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
+@@ -289,7 +358,8 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
"c" (value),
"b" (bx),
"D" ((long)reg),
@@ -22995,7 +24100,7 @@ index a5f7d0d..f7a8a1b 100644
break;
}
-@@ -392,10 +462,13 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
+@@ -394,10 +464,13 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
DBG("PCI: Fetching IRQ routing table... ");
__asm__("push %%es\n\t"
@@ -23010,7 +24115,7 @@ index a5f7d0d..f7a8a1b 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -406,7 +479,8 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
+@@ -408,7 +481,8 @@ struct irq_routing_table * pcibios_get_irq_routing_table(void)
"1" (0),
"D" ((long) &opt),
"S" (&pci_indirect),
@@ -23020,7 +24125,7 @@ index a5f7d0d..f7a8a1b 100644
: "memory");
DBG("OK ret=%d, size=%d, map=%x\n", ret, opt.size, map);
if (ret & 0xff00)
-@@ -430,7 +504,10 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
+@@ -432,7 +506,10 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
{
int ret;
@@ -23032,7 +24137,7 @@ index a5f7d0d..f7a8a1b 100644
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
-@@ -438,7 +515,8 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
+@@ -440,7 +517,8 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
: "0" (PCIBIOS_SET_PCI_HW_INT),
"b" ((dev->bus->number << 8) | dev->devfn),
"c" ((irq << 8) | (pin + 10)),
@@ -23043,21 +24148,11 @@ index a5f7d0d..f7a8a1b 100644
}
EXPORT_SYMBOL(pcibios_set_irq_routing);
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c
-index 5cab48e..b025f9b 100644
+index 40e4469..1ab536e 100644
--- a/arch/x86/platform/efi/efi_32.c
+++ b/arch/x86/platform/efi/efi_32.c
-@@ -38,70 +38,56 @@
- */
-
- static unsigned long efi_rt_eflags;
--static pgd_t efi_bak_pg_dir_pointer[2];
-+static pgd_t __initdata efi_bak_pg_dir_pointer[KERNEL_PGD_PTRS];
-
--void efi_call_phys_prelog(void)
-+void __init efi_call_phys_prelog(void)
+@@ -44,11 +44,22 @@ void efi_call_phys_prelog(void)
{
-- unsigned long cr4;
-- unsigned long temp;
struct desc_ptr gdt_descr;
+#ifdef CONFIG_PAX_KERNEXEC
@@ -23066,36 +24161,7 @@ index 5cab48e..b025f9b 100644
+
local_irq_save(efi_rt_eflags);
-- /*
-- * If I don't have PAE, I should just duplicate two entries in page
-- * directory. If I have PAE, I just need to duplicate one entry in
-- * page directory.
-- */
-- cr4 = read_cr4_safe();
--
-- if (cr4 & X86_CR4_PAE) {
-- efi_bak_pg_dir_pointer[0].pgd =
-- swapper_pg_dir[pgd_index(0)].pgd;
-- swapper_pg_dir[0].pgd =
-- swapper_pg_dir[pgd_index(PAGE_OFFSET)].pgd;
-- } else {
-- efi_bak_pg_dir_pointer[0].pgd =
-- swapper_pg_dir[pgd_index(0)].pgd;
-- efi_bak_pg_dir_pointer[1].pgd =
-- swapper_pg_dir[pgd_index(0x400000)].pgd;
-- swapper_pg_dir[pgd_index(0)].pgd =
-- swapper_pg_dir[pgd_index(PAGE_OFFSET)].pgd;
-- temp = PAGE_OFFSET + 0x400000;
-- swapper_pg_dir[pgd_index(0x400000)].pgd =
-- swapper_pg_dir[pgd_index(temp)].pgd;
-- }
-+ clone_pgd_range(efi_bak_pg_dir_pointer, swapper_pg_dir, KERNEL_PGD_PTRS);
-+ clone_pgd_range(swapper_pg_dir, swapper_pg_dir + KERNEL_PGD_BOUNDARY,
-+ min_t(unsigned long, KERNEL_PGD_PTRS, KERNEL_PGD_BOUNDARY));
-
- /*
- * After the lock is released, the original page table is restored.
- */
+ load_cr3(initial_page_table);
__flush_tlb_all();
+#ifdef CONFIG_PAX_KERNEXEC
@@ -23108,12 +24174,8 @@ index 5cab48e..b025f9b 100644
gdt_descr.address = __pa(get_cpu_gdt_table(0));
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
- }
-
--void efi_call_phys_epilog(void)
-+void __init efi_call_phys_epilog(void)
+@@ -58,6 +69,14 @@ void efi_call_phys_epilog(void)
{
-- unsigned long cr4;
struct desc_ptr gdt_descr;
+#ifdef CONFIG_PAX_KERNEXEC
@@ -23127,22 +24189,6 @@ index 5cab48e..b025f9b 100644
gdt_descr.address = (unsigned long)get_cpu_gdt_table(0);
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
-
-- cr4 = read_cr4_safe();
--
-- if (cr4 & X86_CR4_PAE) {
-- swapper_pg_dir[pgd_index(0)].pgd =
-- efi_bak_pg_dir_pointer[0].pgd;
-- } else {
-- swapper_pg_dir[pgd_index(0)].pgd =
-- efi_bak_pg_dir_pointer[0].pgd;
-- swapper_pg_dir[pgd_index(0x400000)].pgd =
-- efi_bak_pg_dir_pointer[1].pgd;
-- }
-+ clone_pgd_range(swapper_pg_dir, efi_bak_pg_dir_pointer, KERNEL_PGD_PTRS);
-
- /*
- * After the lock is released, the original page table is restored.
diff --git a/arch/x86/platform/efi/efi_stub_32.S b/arch/x86/platform/efi/efi_stub_32.S
index fbe66e6..c5c0dd2 100644
--- a/arch/x86/platform/efi/efi_stub_32.S
@@ -23256,7 +24302,7 @@ index fbe66e6..c5c0dd2 100644
.long 0
efi_rt_function_ptr:
diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S
-index 4c07cca..3092c81 100644
+index 4c07cca..2c8427d 100644
--- a/arch/x86/platform/efi/efi_stub_64.S
+++ b/arch/x86/platform/efi/efi_stub_64.S
@@ -7,6 +7,7 @@
@@ -23271,7 +24317,7 @@ index 4c07cca..3092c81 100644
call *%rdi
addq $32, %rsp
RESTORE_XMM
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
ENDPROC(efi_call0)
@@ -23279,7 +24325,7 @@ index 4c07cca..3092c81 100644
call *%rdi
addq $32, %rsp
RESTORE_XMM
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
ENDPROC(efi_call1)
@@ -23287,7 +24333,7 @@ index 4c07cca..3092c81 100644
call *%rdi
addq $32, %rsp
RESTORE_XMM
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
ENDPROC(efi_call2)
@@ -23295,7 +24341,7 @@ index 4c07cca..3092c81 100644
call *%rdi
addq $32, %rsp
RESTORE_XMM
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
ENDPROC(efi_call3)
@@ -23303,7 +24349,7 @@ index 4c07cca..3092c81 100644
call *%rdi
addq $32, %rsp
RESTORE_XMM
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
ENDPROC(efi_call4)
@@ -23311,7 +24357,7 @@ index 4c07cca..3092c81 100644
call *%rdi
addq $48, %rsp
RESTORE_XMM
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
ENDPROC(efi_call5)
@@ -23319,50 +24365,41 @@ index 4c07cca..3092c81 100644
call *%rdi
addq $48, %rsp
RESTORE_XMM
-+ pax_force_retaddr
++ pax_force_retaddr 0, 1
ret
ENDPROC(efi_call6)
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
-index fe73276..70fe25a 100644
+index ad4ec1c..686479e 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
-@@ -239,14 +239,16 @@ static int mrst_i8042_detect(void)
- }
+@@ -76,18 +76,20 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX];
+ EXPORT_SYMBOL_GPL(sfi_mrtc_array);
+ int sfi_mrtc_num;
- /* Reboot and power off are handled by the SCU on a MID device */
-static void mrst_power_off(void)
+static __noreturn void mrst_power_off(void)
{
- intel_scu_ipc_simple_command(0xf1, 1);
+ if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT)
+ intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1);
+ BUG();
}
-static void mrst_reboot(void)
+static __noreturn void mrst_reboot(void)
{
- intel_scu_ipc_simple_command(0xf1, 0);
+ if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT)
+ intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0);
+ else
+ intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0);
+ BUG();
}
- /*
-diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
-index 82cff4a..ceceb7c 100644
---- a/arch/x86/platform/uv/tlb_uv.c
-+++ b/arch/x86/platform/uv/tlb_uv.c
-@@ -370,6 +370,8 @@ static void reset_with_ipi(struct bau_targ_hubmask *distribution, int sender)
- cpumask_t mask;
- struct reset_args reset_args;
-
-+ pax_track_stack();
-+
- reset_args.sender = sender;
- cpus_clear(mask);
- /* find a single cpu for each uvhub in this distribution mask */
+ /* parse all the mtimer info to a static mtimer array */
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
-index 87bb35e..eff2da8 100644
+index f10c0af..3ec1f95 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
-@@ -130,7 +130,7 @@ static void do_fpu_end(void)
+@@ -131,7 +131,7 @@ static void do_fpu_end(void)
static void fix_processor_context(void)
{
int cpu = smp_processor_id();
@@ -23371,7 +24408,7 @@ index 87bb35e..eff2da8 100644
set_tss_desc(cpu, t); /*
* This just modifies memory; should not be
-@@ -140,7 +140,9 @@ static void fix_processor_context(void)
+@@ -141,7 +141,9 @@ static void fix_processor_context(void)
*/
#ifdef CONFIG_X86_64
@@ -23382,10 +24419,10 @@ index 87bb35e..eff2da8 100644
syscall_init(); /* This sets MSR_*STAR and related */
#endif
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
-index bef0bc9..8495be8 100644
+index 5d17950..2253fc9 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
-@@ -136,7 +136,7 @@ quiet_cmd_vdso = VDSO $@
+@@ -137,7 +137,7 @@ quiet_cmd_vdso = VDSO $@
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
@@ -23481,100 +24518,67 @@ index 468d591..8e80a0a 100644
return NULL;
}
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
-index 7abd2be..32c057d 100644
+index 153407c..611cba9 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
-@@ -15,18 +15,19 @@
- #include <asm/proto.h>
+@@ -16,8 +16,6 @@
#include <asm/vdso.h>
+ #include <asm/page.h>
-unsigned int __read_mostly vdso_enabled = 1;
-
extern char vdso_start[], vdso_end[];
extern unsigned short vdso_sync_cpuid;
-+extern char __vsyscall_0;
-
- static struct page **vdso_pages;
-+static struct page *vsyscall_page;
- static unsigned vdso_size;
-
- static int __init init_vdso_vars(void)
- {
-- int npages = (vdso_end - vdso_start + PAGE_SIZE - 1) / PAGE_SIZE;
-- int i;
-+ size_t nbytes = vdso_end - vdso_start;
-+ size_t npages = (nbytes + PAGE_SIZE - 1) / PAGE_SIZE;
-+ size_t i;
-
- vdso_size = npages << PAGE_SHIFT;
- vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL);
-@@ -34,19 +35,19 @@ static int __init init_vdso_vars(void)
- goto oom;
- for (i = 0; i < npages; i++) {
- struct page *p;
-- p = alloc_page(GFP_KERNEL);
-+ p = alloc_page(GFP_KERNEL | __GFP_ZERO);
- if (!p)
- goto oom;
- vdso_pages[i] = p;
-- copy_page(page_address(p), vdso_start + i*PAGE_SIZE);
-+ memcpy(page_address(p), vdso_start + i*PAGE_SIZE, nbytes > PAGE_SIZE ? PAGE_SIZE : nbytes);
-+ nbytes -= PAGE_SIZE;
- }
-+ vsyscall_page = pfn_to_page((__pa_symbol(&__vsyscall_0)) >> PAGE_SHIFT);
- return 0;
+@@ -96,7 +94,6 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
+ * unaligned here as a result of stack start randomization.
+ */
+ addr = PAGE_ALIGN(addr);
+- addr = align_addr(addr, NULL, ALIGN_VDSO);
- oom:
-- printk("Cannot allocate vdso\n");
-- vdso_enabled = 0;
-- return -ENOMEM;
-+ panic("Cannot allocate vdso\n");
+ return addr;
}
- subsys_initcall(init_vdso_vars);
-
-@@ -80,37 +81,35 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
- unsigned long addr;
+@@ -106,40 +103,35 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
+ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+ {
+ struct mm_struct *mm = current->mm;
+- unsigned long addr;
++ unsigned long addr = 0;
int ret;
- if (!vdso_enabled)
- return 0;
-
down_write(&mm->mmap_sem);
-- addr = vdso_addr(mm->start_stack, vdso_size);
-- addr = get_unmapped_area(NULL, addr, vdso_size, 0, 0);
-+ addr = vdso_addr(mm->start_stack, vdso_size + PAGE_SIZE);
-+ addr = get_unmapped_area(NULL, addr, vdso_size + PAGE_SIZE, 0, 0);
++
++#ifdef CONFIG_PAX_RANDMMAP
++ if (!(mm->pax_flags & MF_PAX_RANDMMAP))
++#endif
++
+ addr = vdso_addr(mm->start_stack, vdso_size);
++ addr = align_addr(addr, NULL, ALIGN_VDSO);
+ addr = get_unmapped_area(NULL, addr, vdso_size, 0, 0);
if (IS_ERR_VALUE(addr)) {
ret = addr;
goto up_fail;
}
- current->mm->context.vdso = (void *)addr;
-+ mm->context.vdso = addr + PAGE_SIZE;
++ mm->context.vdso = addr;
-- ret = install_special_mapping(mm, addr, vdso_size,
-+ ret = install_special_mapping(mm, addr, PAGE_SIZE,
+ ret = install_special_mapping(mm, addr, vdso_size,
VM_READ|VM_EXEC|
-- VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
-+ VM_MAYREAD|VM_MAYEXEC|
+ VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
VM_ALWAYSDUMP,
-- vdso_pages);
-+ &vsyscall_page);
- if (ret) {
+ vdso_pages);
+- if (ret) {
- current->mm->context.vdso = NULL;
-+ mm->context.vdso = 0;
- goto up_fail;
- }
-
-+ ret = install_special_mapping(mm, addr + PAGE_SIZE, vdso_size,
-+ VM_READ|VM_EXEC|
-+ VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
-+ VM_ALWAYSDUMP,
-+ vdso_pages);
+- goto up_fail;
+- }
++
+ if (ret)
+ mm->context.vdso = 0;
-+
+
up_fail:
up_write(&mm->mmap_sem);
return ret;
@@ -23587,7 +24591,7 @@ index 7abd2be..32c057d 100644
-}
-__setup("vdso=", vdso_setup);
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
-index 0fb662a..0033c99 100644
+index 1f92865..c843b20 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -85,8 +85,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
@@ -23599,7 +24603,7 @@ index 0fb662a..0033c99 100644
RESERVE_BRK(shared_info_page_brk, PAGE_SIZE);
__read_mostly int xen_have_vector_callback;
EXPORT_SYMBOL_GPL(xen_have_vector_callback);
-@@ -1010,7 +1008,7 @@ static const struct pv_apic_ops xen_apic_ops __initconst = {
+@@ -1029,7 +1027,7 @@ static const struct pv_apic_ops xen_apic_ops __initconst = {
#endif
};
@@ -23608,7 +24612,7 @@ index 0fb662a..0033c99 100644
{
struct sched_shutdown r = { .reason = reason };
-@@ -1018,17 +1016,17 @@ static void xen_reboot(int reason)
+@@ -1037,17 +1035,17 @@ static void xen_reboot(int reason)
BUG();
}
@@ -23629,7 +24633,7 @@ index 0fb662a..0033c99 100644
{
xen_reboot(SHUTDOWN_poweroff);
}
-@@ -1134,7 +1132,17 @@ asmlinkage void __init xen_start_kernel(void)
+@@ -1153,7 +1151,17 @@ asmlinkage void __init xen_start_kernel(void)
__userpte_alloc_gfp &= ~__GFP_HIGHMEM;
/* Work out if we support NX */
@@ -23648,7 +24652,7 @@ index 0fb662a..0033c99 100644
xen_setup_features();
-@@ -1165,13 +1173,6 @@ asmlinkage void __init xen_start_kernel(void)
+@@ -1184,13 +1192,6 @@ asmlinkage void __init xen_start_kernel(void)
machine_ops = xen_machine_ops;
@@ -23663,30 +24667,32 @@ index 0fb662a..0033c99 100644
#ifdef CONFIG_ACPI_NUMA
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
-index 5f76c0a..809e8b5 100644
+index 87f6673..e2555a6 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
-@@ -1683,6 +1683,8 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd,
+@@ -1733,6 +1733,9 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd,
convert_pfn_mfn(init_level4_pgt);
convert_pfn_mfn(level3_ident_pgt);
convert_pfn_mfn(level3_kernel_pgt);
-+ convert_pfn_mfn(level3_vmalloc_pgt);
++ convert_pfn_mfn(level3_vmalloc_start_pgt);
++ convert_pfn_mfn(level3_vmalloc_end_pgt);
+ convert_pfn_mfn(level3_vmemmap_pgt);
l3 = m2v(pgd[pgd_index(__START_KERNEL_map)].pgd);
l2 = m2v(l3[pud_index(__START_KERNEL_map)].pud);
-@@ -1701,7 +1703,10 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd,
+@@ -1751,7 +1754,11 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd,
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);
-+ set_page_prot(level3_vmalloc_pgt, PAGE_KERNEL_RO);
++ set_page_prot(level3_vmalloc_start_pgt, PAGE_KERNEL_RO);
++ 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_vmemmap_pgt, PAGE_KERNEL_RO);
set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
-@@ -1913,6 +1918,7 @@ static void __init xen_post_allocator_init(void)
+@@ -1962,6 +1969,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;
@@ -23694,7 +24700,7 @@ index 5f76c0a..809e8b5 100644
#endif
/* This will work as long as patching hasn't happened yet
-@@ -1994,6 +2000,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
+@@ -2043,6 +2051,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,
@@ -23703,7 +24709,7 @@ index 5f76c0a..809e8b5 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 d4fc6d4..117a268 100644
+index 041d4fe..7666b7e 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -194,11 +194,6 @@ static void __init xen_smp_prepare_boot_cpu(void)
@@ -23824,7 +24830,7 @@ index 58916af..9cb880b 100644
struct list_head *list = &__get_cpu_var(blk_cpu_iopoll);
int rearm = 0, budget = blk_iopoll_budget;
diff --git a/block/blk-map.c b/block/blk-map.c
-index 164cd00..6d96fc1 100644
+index 623e1cd..ca1e109 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -302,7 +302,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
@@ -23837,7 +24843,7 @@ index 164cd00..6d96fc1 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 ee9c216..58d410a 100644
+index 1366a89..e17f54b 100644
--- a/block/blk-softirq.c
+++ b/block/blk-softirq.c
@@ -17,7 +17,7 @@ static DEFINE_PER_CPU(struct list_head, blk_cpu_done);
@@ -23850,7 +24856,7 @@ index ee9c216..58d410a 100644
struct list_head *cpu_list, local_list;
diff --git a/block/bsg.c b/block/bsg.c
-index 0c8b64a..0115e08 100644
+index 702f131..37808bf 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,
@@ -23869,7 +24875,7 @@ index 0c8b64a..0115e08 100644
+ } else
+ cmdptr = tmpcmd;
-- if (copy_from_user(rq->cmd, (void *)(unsigned long)hdr->request,
+- if (copy_from_user(rq->cmd, (void __user *)(unsigned long)hdr->request,
+ if (copy_from_user(cmdptr, (void __user *)(unsigned long)hdr->request,
hdr->request_len))
return -EFAULT;
@@ -23880,51 +24886,11 @@ index 0c8b64a..0115e08 100644
if (hdr->subprotocol == BSG_SUB_PROTOCOL_SCSI_CMD) {
if (blk_verify_command(rq->cmd, has_write_perm))
return -EPERM;
-@@ -249,7 +257,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
- struct request *rq, *next_rq = NULL;
- int ret, rw;
- unsigned int dxfer_len;
-- void *dxferp = NULL;
-+ void __user *dxferp = NULL;
- struct bsg_class_device *bcd = &q->bsg_dev;
-
- /* if the LLD has been removed then the bsg_unregister_queue will
-@@ -291,7 +299,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
- rq->next_rq = next_rq;
- next_rq->cmd_type = rq->cmd_type;
-
-- dxferp = (void*)(unsigned long)hdr->din_xferp;
-+ dxferp = (void __user *)(unsigned long)hdr->din_xferp;
- ret = blk_rq_map_user(q, next_rq, NULL, dxferp,
- hdr->din_xfer_len, GFP_KERNEL);
- if (ret)
-@@ -300,10 +308,10 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
-
- if (hdr->dout_xfer_len) {
- dxfer_len = hdr->dout_xfer_len;
-- dxferp = (void*)(unsigned long)hdr->dout_xferp;
-+ dxferp = (void __user *)(unsigned long)hdr->dout_xferp;
- } else if (hdr->din_xfer_len) {
- dxfer_len = hdr->din_xfer_len;
-- dxferp = (void*)(unsigned long)hdr->din_xferp;
-+ dxferp = (void __user *)(unsigned long)hdr->din_xferp;
- } else
- dxfer_len = 0;
-
-@@ -445,7 +453,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
- int len = min_t(unsigned int, hdr->max_response_len,
- rq->sense_len);
-
-- ret = copy_to_user((void*)(unsigned long)hdr->response,
-+ ret = copy_to_user((void __user *)(unsigned long)hdr->response,
- rq->sense, len);
- if (!ret)
- hdr->response_len = len;
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
-index cc3eb78..2ffe28d 100644
+index 7b72502..646105c 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
-@@ -354,7 +354,7 @@ static int compat_fd_ioctl(struct block_device *bdev, fmode_t mode,
+@@ -340,7 +340,7 @@ static int compat_fd_ioctl(struct block_device *bdev, fmode_t mode,
err |= __get_user(f->spec1, &uf->spec1);
err |= __get_user(f->fmt_gap, &uf->fmt_gap);
err |= __get_user(name, &uf->name);
@@ -23934,10 +24900,18 @@ index cc3eb78..2ffe28d 100644
err = -EFAULT;
goto out;
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
-index 4f4230b..0feae9a 100644
+index fbdf0d8..e8f3caf 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
-@@ -222,8 +222,20 @@ EXPORT_SYMBOL(blk_verify_command);
+@@ -24,6 +24,7 @@
+ #include <linux/capability.h>
+ #include <linux/completion.h>
+ #include <linux/cdrom.h>
++#include <linux/ratelimit.h>
+ #include <linux/slab.h>
+ #include <linux/times.h>
+ #include <asm/uaccess.h>
+@@ -222,8 +223,20 @@ EXPORT_SYMBOL(blk_verify_command);
static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
struct sg_io_hdr *hdr, fmode_t mode)
{
@@ -23959,7 +24933,7 @@ index 4f4230b..0feae9a 100644
if (blk_verify_command(rq->cmd, mode & FMODE_WRITE))
return -EPERM;
-@@ -432,6 +444,8 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
+@@ -432,6 +445,8 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
int err;
unsigned int in_len, out_len, bytes, opcode, cmdlen;
char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE];
@@ -23968,7 +24942,7 @@ index 4f4230b..0feae9a 100644
if (!sic)
return -EINVAL;
-@@ -465,9 +479,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
+@@ -465,9 +480,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
*/
err = -EFAULT;
rq->cmd_len = cmdlen;
@@ -23988,6 +24962,64 @@ index 4f4230b..0feae9a 100644
if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
goto error;
+@@ -690,6 +714,57 @@ int scsi_cmd_ioctl(struct request_queue *q, struct gendisk *bd_disk, fmode_t mod
+ }
+ EXPORT_SYMBOL(scsi_cmd_ioctl);
+
++int scsi_verify_blk_ioctl(struct block_device *bd, unsigned int cmd)
++{
++ if (bd && bd == bd->bd_contains)
++ return 0;
++
++ /* Actually none of these is particularly useful on a partition,
++ * but they are safe.
++ */
++ switch (cmd) {
++ case SCSI_IOCTL_GET_IDLUN:
++ case SCSI_IOCTL_GET_BUS_NUMBER:
++ case SCSI_IOCTL_GET_PCI:
++ case SCSI_IOCTL_PROBE_HOST:
++ case SG_GET_VERSION_NUM:
++ case SG_SET_TIMEOUT:
++ case SG_GET_TIMEOUT:
++ case SG_GET_RESERVED_SIZE:
++ case SG_SET_RESERVED_SIZE:
++ case SG_EMULATED_HOST:
++ return 0;
++ case CDROM_GET_CAPABILITY:
++ /* Keep this until we remove the printk below. udev sends it
++ * and we do not want to spam dmesg about it. CD-ROMs do
++ * not have partitions, so we get here only for disks.
++ */
++ return -ENOIOCTLCMD;
++ default:
++ break;
++ }
++
++ /* In particular, rule out all resets and host-specific ioctls. */
++ printk_ratelimited(KERN_WARNING
++ "%s: sending ioctl %x to a partition!\n", current->comm, cmd);
++
++ return capable(CAP_SYS_RAWIO) ? 0 : -ENOIOCTLCMD;
++}
++EXPORT_SYMBOL(scsi_verify_blk_ioctl);
++
++int scsi_cmd_blk_ioctl(struct block_device *bd, fmode_t mode,
++ unsigned int cmd, void __user *arg)
++{
++ int ret;
++
++ ret = scsi_verify_blk_ioctl(bd, cmd);
++ if (ret < 0)
++ return ret;
++
++ return scsi_cmd_ioctl(bd->bd_disk->queue, bd->bd_disk, mode, cmd, arg);
++}
++EXPORT_SYMBOL(scsi_cmd_blk_ioctl);
++
+ static int __init blk_scsi_ioctl_init(void)
+ {
+ blk_set_cmd_filter_defaults(&blk_default_cmd_filter);
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index 671d4d6..5f24030 100644
--- a/crypto/cryptd.c
@@ -24010,41 +25042,6 @@ index 671d4d6..5f24030 100644
static void cryptd_queue_worker(struct work_struct *work);
-diff --git a/crypto/gf128mul.c b/crypto/gf128mul.c
-index df35e4c..5276607 100644
---- a/crypto/gf128mul.c
-+++ b/crypto/gf128mul.c
-@@ -182,7 +182,7 @@ void gf128mul_lle(be128 *r, const be128 *b)
- for (i = 0; i < 7; ++i)
- gf128mul_x_lle(&p[i + 1], &p[i]);
-
-- memset(r, 0, sizeof(r));
-+ memset(r, 0, sizeof(*r));
- for (i = 0;;) {
- u8 ch = ((u8 *)b)[15 - i];
-
-@@ -220,7 +220,7 @@ void gf128mul_bbe(be128 *r, const be128 *b)
- for (i = 0; i < 7; ++i)
- gf128mul_x_bbe(&p[i + 1], &p[i]);
-
-- memset(r, 0, sizeof(r));
-+ memset(r, 0, sizeof(*r));
- for (i = 0;;) {
- u8 ch = ((u8 *)b)[i];
-
-diff --git a/crypto/serpent.c b/crypto/serpent.c
-index b651a55..a9ddd79b 100644
---- a/crypto/serpent.c
-+++ b/crypto/serpent.c
-@@ -224,6 +224,8 @@ static int serpent_setkey(struct crypto_tfm *tfm, const u8 *key,
- u32 r0,r1,r2,r3,r4;
- int i;
-
-+ pax_track_stack();
-+
- /* Copy key, add padding */
-
- for (i = 0; i < keylen; ++i)
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
index 5d41894..22021e4 100644
--- a/drivers/acpi/apei/cper.c
@@ -24067,18 +25064,18 @@ index 5d41894..22021e4 100644
EXPORT_SYMBOL_GPL(cper_next_record_id);
diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
-index 05b4420..f1cc3da 100644
+index 6c47ae9..8ab9132 100644
--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
-@@ -11,6 +11,7 @@
- #include <linux/kernel.h>
+@@ -12,6 +12,7 @@
#include <linux/acpi.h>
#include <linux/debugfs.h>
+ #include <linux/module.h>
+#include <asm/uaccess.h>
#include "internal.h"
MODULE_AUTHOR("Thomas Renninger <trenn@suse.de>");
-@@ -39,7 +40,7 @@ static ssize_t acpi_ec_read_io(struct file *f, char __user *buf,
+@@ -40,7 +41,7 @@ static ssize_t acpi_ec_read_io(struct file *f, char __user *buf,
* struct acpi_ec *ec = ((struct seq_file *)f->private_data)->private;
*/
unsigned int size = EC_SPACE_SIZE;
@@ -24087,7 +25084,7 @@ index 05b4420..f1cc3da 100644
loff_t init_off = *off;
int err = 0;
-@@ -52,9 +53,11 @@ static ssize_t acpi_ec_read_io(struct file *f, char __user *buf,
+@@ -53,9 +54,11 @@ static ssize_t acpi_ec_read_io(struct file *f, char __user *buf,
size = count;
while (size) {
@@ -24100,7 +25097,7 @@ index 05b4420..f1cc3da 100644
*off += 1;
size--;
}
-@@ -70,7 +73,6 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
+@@ -71,7 +74,6 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
unsigned int size = count;
loff_t init_off = *off;
@@ -24108,7 +25105,7 @@ index 05b4420..f1cc3da 100644
int err = 0;
if (*off >= EC_SPACE_SIZE)
-@@ -81,7 +83,9 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
+@@ -82,7 +84,9 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
}
while (size) {
@@ -24120,10 +25117,10 @@ index 05b4420..f1cc3da 100644
if (err)
return err;
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c
-index f5f9869..da87aeb 100644
+index 251c7b62..000462d 100644
--- a/drivers/acpi/proc.c
+++ b/drivers/acpi/proc.c
-@@ -342,19 +342,13 @@ acpi_system_write_wakeup_device(struct file *file,
+@@ -343,19 +343,13 @@ acpi_system_write_wakeup_device(struct file *file,
size_t count, loff_t * ppos)
{
struct list_head *node, *next;
@@ -24148,7 +25145,7 @@ index f5f9869..da87aeb 100644
mutex_lock(&acpi_device_lock);
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
-@@ -363,7 +357,7 @@ acpi_system_write_wakeup_device(struct file *file,
+@@ -364,7 +358,7 @@ acpi_system_write_wakeup_device(struct file *file,
if (!dev->wakeup.flags.valid)
continue;
@@ -24158,7 +25155,7 @@ index f5f9869..da87aeb 100644
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 a4e0f1b..9793b28 100644
+index 9d7bc9f..a6fc091 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -473,7 +473,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
@@ -24171,10 +25168,10 @@ index a4e0f1b..9793b28 100644
/*
* Buggy BIOS check
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index 000d03a..36c5da0 100644
+index c04ad68..0b99473 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
-@@ -4753,7 +4753,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
+@@ -4733,7 +4733,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
struct ata_port *ap;
unsigned int tag;
@@ -24183,7 +25180,7 @@ index 000d03a..36c5da0 100644
ap = qc->ap;
qc->flags = 0;
-@@ -4769,7 +4769,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
+@@ -4749,7 +4749,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
struct ata_port *ap;
struct ata_link *link;
@@ -24192,7 +25189,7 @@ index 000d03a..36c5da0 100644
WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE));
ap = qc->ap;
link = qc->dev->link;
-@@ -5774,6 +5774,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
+@@ -5754,6 +5754,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
return;
spin_lock(&lock);
@@ -24200,7 +25197,7 @@ index 000d03a..36c5da0 100644
for (cur = ops->inherits; cur; cur = cur->inherits) {
void **inherit = (void **)cur;
-@@ -5787,8 +5788,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
+@@ -5767,8 +5768,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
if (IS_ERR(*pp))
*pp = NULL;
@@ -24211,21 +25208,8 @@ index 000d03a..36c5da0 100644
spin_unlock(&lock);
}
-diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
-index 7f099d6..0d42651 100644
---- a/drivers/ata/libata-eh.c
-+++ b/drivers/ata/libata-eh.c
-@@ -2518,6 +2518,8 @@ void ata_eh_report(struct ata_port *ap)
- {
- struct ata_link *link;
-
-+ pax_track_stack();
-+
- ata_for_each_link(link, ap, HOST_FIRST)
- ata_eh_link_report(link);
- }
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
-index 719bb73..79ce858 100644
+index e8574bb..f9f6a72 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)
@@ -24253,7 +25237,7 @@ index f9b983a..887b9d8 100644
return 0;
}
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
-index a5fcb1e..4da3c32 100644
+index f8f41e0..1f987dd 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) {
@@ -24283,7 +25267,7 @@ index a5fcb1e..4da3c32 100644
}
} else {
-@@ -1342,7 +1342,7 @@ static int amb_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
+@@ -1338,7 +1338,7 @@ static int amb_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
}
if (check_area (skb->data, skb->len)) {
@@ -24293,7 +25277,7 @@ index a5fcb1e..4da3c32 100644
}
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
-index 0b06250..9a7e2d8 100644
+index b22d71c..d6e1049 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)
@@ -24346,7 +25330,7 @@ index 0b06250..9a7e2d8 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 3230ea0..ffa1fa1 100644
+index 956e9ac..133516d 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -526,7 +526,7 @@ static int rx_aal0(struct atm_vcc *vcc)
@@ -24385,7 +25369,7 @@ index 3230ea0..ffa1fa1 100644
}
wake_up(&eni_dev->rx_wait);
}
-@@ -1228,7 +1228,7 @@ static void dequeue_tx(struct atm_dev *dev)
+@@ -1229,7 +1229,7 @@ static void dequeue_tx(struct atm_dev *dev)
PCI_DMA_TODEVICE);
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb_irq(skb);
@@ -24394,7 +25378,7 @@ index 3230ea0..ffa1fa1 100644
wake_up(&eni_dev->tx_wait);
dma_complete++;
}
-@@ -1568,7 +1568,7 @@ tx_complete++;
+@@ -1569,7 +1569,7 @@ tx_complete++;
/*--------------------------------- entries ---------------------------------*/
@@ -24404,10 +25388,10 @@ index 3230ea0..ffa1fa1 100644
"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 ef7a658..04b6ef8 100644
+index 5072f8a..fa52520d 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)
+@@ -750,7 +750,7 @@ static void process_txdone_queue (struct fs_dev *dev, struct queue *q)
}
}
@@ -24416,7 +25400,7 @@ index ef7a658..04b6ef8 100644
fs_dprintk (FS_DEBUG_TXMEM, "i");
fs_dprintk (FS_DEBUG_ALLOC, "Free t-skb: %p\n", skb);
-@@ -816,7 +816,7 @@ static void process_incoming (struct fs_dev *dev, struct queue *q)
+@@ -817,7 +817,7 @@ static void process_incoming (struct fs_dev *dev, struct queue *q)
#endif
skb_put (skb, qe->p1 & 0xffff);
ATM_SKB(skb)->vcc = atm_vcc;
@@ -24425,7 +25409,7 @@ index ef7a658..04b6ef8 100644
__net_timestamp(skb);
fs_dprintk (FS_DEBUG_ALLOC, "Free rec-skb: %p (pushed)\n", skb);
atm_vcc->push (atm_vcc, skb);
-@@ -837,12 +837,12 @@ static void process_incoming (struct fs_dev *dev, struct queue *q)
+@@ -838,12 +838,12 @@ static void process_incoming (struct fs_dev *dev, struct queue *q)
kfree (pe);
}
if (atm_vcc)
@@ -24441,7 +25425,7 @@ index ef7a658..04b6ef8 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 bc9e702..ce4742a 100644
+index 361f5ae..7fc552d 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -933,9 +933,9 @@ fore200e_tx_irq(struct fore200e* fore200e)
@@ -24586,10 +25570,10 @@ index 9a51df4..f3bb5f8 100644
return 0;
}
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
-index d58e3fc..92b6e00 100644
+index b812103..e391a49 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
-@@ -1034,7 +1034,7 @@ static void rx_schedule (hrz_dev * dev, int irq) {
+@@ -1035,7 +1035,7 @@ static void rx_schedule (hrz_dev * dev, int irq) {
{
struct atm_vcc * vcc = ATM_SKB(skb)->vcc;
// VC layer stats
@@ -24598,7 +25582,7 @@ index d58e3fc..92b6e00 100644
__net_timestamp(skb);
// end of our responsibility
vcc->push (vcc, skb);
-@@ -1186,7 +1186,7 @@ static void tx_schedule (hrz_dev * const dev, int irq) {
+@@ -1187,7 +1187,7 @@ static void tx_schedule (hrz_dev * const dev, int irq) {
dev->tx_iovec = NULL;
// VC layer stats
@@ -24608,10 +25592,10 @@ index d58e3fc..92b6e00 100644
// free the skb
hrz_kfree_skb (skb);
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
-index 1f8d724..aa37fff 100644
+index 1c05212..c28e200 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
-@@ -811,7 +811,7 @@ drain_scq(struct idt77252_dev *card, struct vc_map *vc)
+@@ -812,7 +812,7 @@ drain_scq(struct idt77252_dev *card, struct vc_map *vc)
else
dev_kfree_skb(skb);
@@ -24620,7 +25604,7 @@ index 1f8d724..aa37fff 100644
}
atomic_dec(&scq->used);
-@@ -1074,13 +1074,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1075,13 +1075,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
if ((sb = dev_alloc_skb(64)) == NULL) {
printk("%s: Can't allocate buffers for aal0.\n",
card->name);
@@ -24636,7 +25620,7 @@ index 1f8d724..aa37fff 100644
dev_kfree_skb(sb);
break;
}
-@@ -1097,7 +1097,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1098,7 +1098,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
ATM_SKB(sb)->vcc = vcc;
__net_timestamp(sb);
vcc->push(vcc, sb);
@@ -24645,7 +25629,7 @@ index 1f8d724..aa37fff 100644
cell += ATM_CELL_PAYLOAD;
}
-@@ -1134,13 +1134,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1135,13 +1135,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
"(CDC: %08x)\n",
card->name, len, rpp->len, readl(SAR_REG_CDC));
recycle_rx_pool_skb(card, rpp);
@@ -24661,7 +25645,7 @@ index 1f8d724..aa37fff 100644
return;
}
if (skb_queue_len(&rpp->queue) > 1) {
-@@ -1151,7 +1151,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1152,7 +1152,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
RXPRINTK("%s: Can't alloc RX skb.\n",
card->name);
recycle_rx_pool_skb(card, rpp);
@@ -24670,7 +25654,7 @@ index 1f8d724..aa37fff 100644
return;
}
if (!atm_charge(vcc, skb->truesize)) {
-@@ -1170,7 +1170,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1171,7 +1171,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
__net_timestamp(skb);
vcc->push(vcc, skb);
@@ -24679,7 +25663,7 @@ index 1f8d724..aa37fff 100644
return;
}
-@@ -1192,7 +1192,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1193,7 +1193,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
__net_timestamp(skb);
vcc->push(vcc, skb);
@@ -24688,7 +25672,7 @@ index 1f8d724..aa37fff 100644
if (skb->truesize > SAR_FB_SIZE_3)
add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
-@@ -1303,14 +1303,14 @@ idt77252_rx_raw(struct idt77252_dev *card)
+@@ -1304,14 +1304,14 @@ idt77252_rx_raw(struct idt77252_dev *card)
if (vcc->qos.aal != ATM_AAL0) {
RPRINTK("%s: raw cell for non AAL0 vc %u.%u\n",
card->name, vpi, vci);
@@ -24705,7 +25689,7 @@ index 1f8d724..aa37fff 100644
goto drop;
}
-@@ -1329,7 +1329,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
+@@ -1330,7 +1330,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
ATM_SKB(sb)->vcc = vcc;
__net_timestamp(sb);
vcc->push(vcc, sb);
@@ -24714,7 +25698,7 @@ index 1f8d724..aa37fff 100644
drop:
skb_pull(queue, 64);
-@@ -1954,13 +1954,13 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
+@@ -1955,13 +1955,13 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
if (vc == NULL) {
printk("%s: NULL connection in send().\n", card->name);
@@ -24730,7 +25714,7 @@ index 1f8d724..aa37fff 100644
dev_kfree_skb(skb);
return -EINVAL;
}
-@@ -1972,14 +1972,14 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
+@@ -1973,14 +1973,14 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
break;
default:
printk("%s: Unsupported AAL: %d\n", card->name, vcc->qos.aal);
@@ -24747,7 +25731,7 @@ index 1f8d724..aa37fff 100644
dev_kfree_skb(skb);
return -EINVAL;
}
-@@ -1987,7 +1987,7 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
+@@ -1988,7 +1988,7 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
err = queue_skb(card, vc, skb, oam);
if (err) {
@@ -24756,7 +25740,7 @@ index 1f8d724..aa37fff 100644
dev_kfree_skb(skb);
return err;
}
-@@ -2010,7 +2010,7 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags)
+@@ -2011,7 +2011,7 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags)
skb = dev_alloc_skb(64);
if (!skb) {
printk("%s: Out of memory in send_oam().\n", card->name);
@@ -24766,10 +25750,10 @@ index 1f8d724..aa37fff 100644
}
atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
-index dee4f01..bec4c50 100644
+index 3d0c2b0..45441fa 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
-@@ -1120,7 +1120,7 @@ static int rx_pkt(struct atm_dev *dev)
+@@ -1146,7 +1146,7 @@ static int rx_pkt(struct atm_dev *dev)
status = (u_short) (buf_desc_ptr->desc_mode);
if (status & (RX_CER | RX_PTE | RX_OFL))
{
@@ -24778,7 +25762,7 @@ index dee4f01..bec4c50 100644
IF_ERR(printk("IA: bad packet, dropping it");)
if (status & RX_CER) {
IF_ERR(printk(" cause: packet CRC error\n");)
-@@ -1143,7 +1143,7 @@ static int rx_pkt(struct atm_dev *dev)
+@@ -1169,7 +1169,7 @@ static int rx_pkt(struct atm_dev *dev)
len = dma_addr - buf_addr;
if (len > iadev->rx_buf_sz) {
printk("Over %d bytes sdu received, dropped!!!\n", iadev->rx_buf_sz);
@@ -24787,7 +25771,7 @@ index dee4f01..bec4c50 100644
goto out_free_desc;
}
-@@ -1293,7 +1293,7 @@ static void rx_dle_intr(struct atm_dev *dev)
+@@ -1319,7 +1319,7 @@ static void rx_dle_intr(struct atm_dev *dev)
ia_vcc = INPH_IA_VCC(vcc);
if (ia_vcc == NULL)
{
@@ -24796,7 +25780,7 @@ index dee4f01..bec4c50 100644
dev_kfree_skb_any(skb);
atm_return(vcc, atm_guess_pdu2truesize(len));
goto INCR_DLE;
-@@ -1305,7 +1305,7 @@ static void rx_dle_intr(struct atm_dev *dev)
+@@ -1331,7 +1331,7 @@ static void rx_dle_intr(struct atm_dev *dev)
if ((length > iadev->rx_buf_sz) || (length >
(skb->len - sizeof(struct cpcs_trailer))))
{
@@ -24805,7 +25789,7 @@ index dee4f01..bec4c50 100644
IF_ERR(printk("rx_dle_intr: Bad AAL5 trailer %d (skb len %d)",
length, skb->len);)
dev_kfree_skb_any(skb);
-@@ -1321,7 +1321,7 @@ static void rx_dle_intr(struct atm_dev *dev)
+@@ -1347,7 +1347,7 @@ static void rx_dle_intr(struct atm_dev *dev)
IF_RX(printk("rx_dle_intr: skb push");)
vcc->push(vcc,skb);
@@ -24814,7 +25798,7 @@ index dee4f01..bec4c50 100644
iadev->rx_pkt_cnt++;
}
INCR_DLE:
-@@ -2801,15 +2801,15 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
+@@ -2827,15 +2827,15 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
{
struct k_sonet_stats *stats;
stats = &PRIV(_ia_dev[board])->sonet_stats;
@@ -24839,7 +25823,7 @@ index dee4f01..bec4c50 100644
}
ia_cmds.status = 0;
break;
-@@ -2914,7 +2914,7 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
+@@ -2940,7 +2940,7 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
if ((desc == 0) || (desc > iadev->num_tx_desc))
{
IF_ERR(printk(DEV_LABEL "invalid desc for send: %d\n", desc);)
@@ -24848,7 +25832,7 @@ index dee4f01..bec4c50 100644
if (vcc->pop)
vcc->pop(vcc, skb);
else
-@@ -3019,14 +3019,14 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
+@@ -3045,14 +3045,14 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
ATM_DESC(skb) = vcc->vci;
skb_queue_tail(&iadev->tx_dma_q, skb);
@@ -24866,7 +25850,7 @@ index dee4f01..bec4c50 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 4e8ba56..900a2ab 100644
+index f556969..0da15eb 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,
@@ -24887,7 +25871,7 @@ index 4e8ba56..900a2ab 100644
out:
lvcc->rx.buf.ptr = end;
cardvcc_write(lvcc, endptr, vcc_rxreadptr);
-@@ -1668,7 +1668,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
+@@ -1667,7 +1667,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
DPRINTK("(itf %d) got RX service entry 0x%X for non-AAL5 "
"vcc %d\n", lanai->number, (unsigned int) s, vci);
lanai->stats.service_rxnotaal5++;
@@ -24896,7 +25880,7 @@ index 4e8ba56..900a2ab 100644
return 0;
}
if (likely(!(s & (SERVICE_TRASH | SERVICE_STREAM | SERVICE_CRCERR)))) {
-@@ -1680,7 +1680,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
+@@ -1679,7 +1679,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
int bytes;
read_unlock(&vcc_sklist_lock);
DPRINTK("got trashed rx pdu on vci %d\n", vci);
@@ -24905,7 +25889,7 @@ index 4e8ba56..900a2ab 100644
lvcc->stats.x.aal5.service_trash++;
bytes = (SERVICE_GET_END(s) * 16) -
(((unsigned long) lvcc->rx.buf.ptr) -
-@@ -1692,7 +1692,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
+@@ -1691,7 +1691,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
}
if (s & SERVICE_STREAM) {
read_unlock(&vcc_sklist_lock);
@@ -24914,7 +25898,7 @@ index 4e8ba56..900a2ab 100644
lvcc->stats.x.aal5.service_stream++;
printk(KERN_ERR DEV_LABEL "(itf %d): Got AAL5 stream "
"PDU on VCI %d!\n", lanai->number, vci);
-@@ -1700,7 +1700,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
+@@ -1699,7 +1699,7 @@ static int handle_service(struct lanai_dev *lanai, u32 s)
return 0;
}
DPRINTK("got rx crc error on vci %d\n", vci);
@@ -24924,7 +25908,7 @@ index 4e8ba56..900a2ab 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 6b313ee..3891287 100644
+index 1c70c45..300718d 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)
@@ -25129,7 +26113,7 @@ index 6b313ee..3891287 100644
}
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
-index 5d1d076..4f31f42 100644
+index 5d1d076..12fbca4 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -714,7 +714,7 @@ void solos_bh(unsigned long card_arg)
@@ -25141,16 +26125,7 @@ index 5d1d076..4f31f42 100644
break;
case PKT_STATUS:
-@@ -899,6 +899,8 @@ static int print_buffer(struct sk_buff *buf)
- char msg[500];
- char item[10];
-
-+ pax_track_stack();
-+
- len = buf->len;
- for (i = 0; i < len; i++){
- if(i % 8 == 0)
-@@ -1008,7 +1010,7 @@ static uint32_t fpga_tx(struct solos_card *card)
+@@ -1008,7 +1008,7 @@ static uint32_t fpga_tx(struct solos_card *card)
vcc = SKB_CB(oldskb)->vcc;
if (vcc) {
@@ -25160,7 +26135,7 @@ index 5d1d076..4f31f42 100644
} else
dev_kfree_skb_irq(oldskb);
diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c
-index 41c56ea..83df600 100644
+index 90f1ccc..04c4a1e 100644
--- a/drivers/atm/suni.c
+++ b/drivers/atm/suni.c
@@ -50,8 +50,8 @@ static DEFINE_SPINLOCK(sunis_lock);
@@ -25175,7 +26150,7 @@ index 41c56ea..83df600 100644
static void suni_hz(unsigned long from_timer)
diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
-index c45ae05..ed6f0c4 100644
+index 5120a96..e2572bd 100644
--- a/drivers/atm/uPD98402.c
+++ b/drivers/atm/uPD98402.c
@@ -42,7 +42,7 @@ static int fetch_stats(struct atm_dev *dev,struct sonet_stats __user *arg,int ze
@@ -25223,10 +26198,10 @@ index c45ae05..ed6f0c4 100644
}
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
-index 6249179..b062f45 100644
+index d889f56..17eb71e 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]);
+@@ -460,7 +460,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]);
}
if (!size) {
dev_kfree_skb_irq(skb);
@@ -25235,7 +26210,7 @@ index 6249179..b062f45 100644
continue;
}
if (!atm_charge(vcc,skb->truesize)) {
-@@ -469,7 +469,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]);
+@@ -470,7 +470,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy[0],dummy[1]);
skb->len = size;
ATM_SKB(skb)->vcc = vcc;
vcc->push(vcc,skb);
@@ -25244,7 +26219,7 @@ index 6249179..b062f45 100644
}
zout(pos & 0xffff,MTA(mbx));
#if 0 /* probably a stupid idea */
-@@ -733,7 +733,7 @@ if (*ZATM_PRV_DSC(skb) != (uPD98401_TXPD_V | uPD98401_TXPD_DP |
+@@ -734,7 +734,7 @@ if (*ZATM_PRV_DSC(skb) != (uPD98401_TXPD_V | uPD98401_TXPD_DP |
skb_queue_head(&zatm_vcc->backlog,skb);
break;
}
@@ -25254,11 +26229,11 @@ index 6249179..b062f45 100644
}
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
-index 82bbb59..f9af954 100644
+index a4760e0..51283cf 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
-@@ -357,7 +357,7 @@ int devtmpfs_mount(const char *mntdir)
- if (!dev_mnt)
+@@ -368,7 +368,7 @@ int devtmpfs_mount(const char *mntdir)
+ if (!thread)
return 0;
- err = sys_mount("devtmpfs", (char *)mntdir, "devtmpfs", MS_SILENT, NULL);
@@ -25267,10 +26242,10 @@ index 82bbb59..f9af954 100644
printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
else
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
-index 84f7c7d..37cfd87 100644
+index caf995f..6f76697 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
-@@ -29,14 +29,14 @@ bool events_check_enabled;
+@@ -30,14 +30,14 @@ bool events_check_enabled;
* They need to be modified together atomically, so it's better to use one
* atomic variable to hold them both.
*/
@@ -25287,7 +26262,7 @@ index 84f7c7d..37cfd87 100644
*cnt = (comb >> IN_PROGRESS_BITS);
*inpr = comb & MAX_IN_PROGRESS;
-@@ -350,7 +350,7 @@ static void wakeup_source_activate(struct wakeup_source *ws)
+@@ -353,7 +353,7 @@ static void wakeup_source_activate(struct wakeup_source *ws)
ws->last_time = ktime_get();
/* Increment the counter of events in progress. */
@@ -25296,7 +26271,7 @@ index 84f7c7d..37cfd87 100644
}
/**
-@@ -440,7 +440,7 @@ static void wakeup_source_deactivate(struct wakeup_source *ws)
+@@ -443,7 +443,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.
*/
@@ -25305,24 +26280,11 @@ index 84f7c7d..37cfd87 100644
}
/**
-diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
-index e086fbb..398e1fe 100644
---- a/drivers/block/DAC960.c
-+++ b/drivers/block/DAC960.c
-@@ -1980,6 +1980,8 @@ static bool DAC960_V1_ReadDeviceConfiguration(DAC960_Controller_T
- unsigned long flags;
- int Channel, TargetID;
-
-+ pax_track_stack();
-+
- if (!init_dma_loaf(Controller->PCIDevice, &local_dma,
- DAC960_V1_MaxChannels*(sizeof(DAC960_V1_DCDB_T) +
- sizeof(DAC960_SCSI_Inquiry_T) +
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
-index c2f9b3e..5911988 100644
+index 587cce5..77b928b 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
-@@ -1179,6 +1179,8 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
+@@ -1198,6 +1198,8 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
int err;
u32 cp;
@@ -25331,7 +26293,28 @@ index c2f9b3e..5911988 100644
err = 0;
err |=
copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
-@@ -2986,7 +2988,7 @@ static void start_io(ctlr_info_t *h)
+@@ -1735,7 +1737,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
+ case CCISS_BIG_PASSTHRU:
+ return cciss_bigpassthru(h, argp);
+
+- /* scsi_cmd_ioctl handles these, below, though some are not */
++ /* scsi_cmd_blk_ioctl handles these, below, though some are not */
+ /* very meaningful for cciss. SG_IO is the main one people want. */
+
+ case SG_GET_VERSION_NUM:
+@@ -1746,9 +1748,9 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
+ case SG_EMULATED_HOST:
+ case SG_IO:
+ case SCSI_IOCTL_SEND_COMMAND:
+- return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp);
++ return scsi_cmd_blk_ioctl(bdev, mode, cmd, argp);
+
+- /* scsi_cmd_ioctl would normally handle these, below, but */
++ /* scsi_cmd_blk_ioctl would normally handle these, below, but */
+ /* they aren't a good fit for cciss, as CD-ROMs are */
+ /* not supported, and we don't have any bus/target/lun */
+ /* which we present to the kernel. */
+@@ -3007,7 +3009,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 */
@@ -25340,7 +26323,7 @@ index c2f9b3e..5911988 100644
dev_warn(&h->pdev->dev, "fifo full\n");
break;
}
-@@ -2996,7 +2998,7 @@ static void start_io(ctlr_info_t *h)
+@@ -3017,7 +3019,7 @@ static void start_io(ctlr_info_t *h)
h->Qdepth--;
/* Tell the controller execute command */
@@ -25349,7 +26332,7 @@ index c2f9b3e..5911988 100644
/* Put job onto the completed Q */
addQ(&h->cmpQ, c);
-@@ -3422,17 +3424,17 @@ startio:
+@@ -3443,17 +3445,17 @@ startio:
static inline unsigned long get_next_completion(ctlr_info_t *h)
{
@@ -25370,7 +26353,7 @@ index c2f9b3e..5911988 100644
(h->interrupts_enabled == 0));
}
-@@ -3465,7 +3467,7 @@ static inline u32 next_command(ctlr_info_t *h)
+@@ -3486,7 +3488,7 @@ static inline u32 next_command(ctlr_info_t *h)
u32 a;
if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
@@ -25379,7 +26362,7 @@ index c2f9b3e..5911988 100644
if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
a = *(h->reply_pool_head); /* Next cmd in ring buffer */
-@@ -4020,7 +4022,7 @@ static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h)
+@@ -4044,7 +4046,7 @@ static void __devinit 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 */
@@ -25388,7 +26371,7 @@ index c2f9b3e..5911988 100644
h->transMethod = CFGTBL_Trans_Performant;
return;
-@@ -4292,7 +4294,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *h)
+@@ -4316,7 +4318,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *h)
if (prod_index < 0)
return -ENODEV;
h->product_name = products[prod_index].product_name;
@@ -25397,7 +26380,7 @@ index c2f9b3e..5911988 100644
if (cciss_board_disabled(h)) {
dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
-@@ -5009,7 +5011,7 @@ reinit_after_soft_reset:
+@@ -5041,7 +5043,7 @@ reinit_after_soft_reset:
}
/* make sure the board interrupts are off */
@@ -25406,16 +26389,16 @@ index c2f9b3e..5911988 100644
rc = cciss_request_irq(h, do_cciss_msix_intr, do_cciss_intx);
if (rc)
goto clean2;
-@@ -5061,7 +5063,7 @@ reinit_after_soft_reset:
+@@ -5093,7 +5095,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, CCISS_INTR_OFF);
+ h->access->set_intr_mask(h, CCISS_INTR_OFF);
spin_unlock_irqrestore(&h->lock, flags);
- free_irq(h->intr[PERF_MODE_INT], h);
+ free_irq(h->intr[h->intr_mode], h);
rc = cciss_request_irq(h, cciss_msix_discard_completions,
-@@ -5081,9 +5083,9 @@ reinit_after_soft_reset:
+@@ -5113,9 +5115,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");
@@ -25427,7 +26410,7 @@ index c2f9b3e..5911988 100644
rc = controller_reset_failed(h->cfgtable);
if (rc)
-@@ -5106,7 +5108,7 @@ reinit_after_soft_reset:
+@@ -5138,7 +5140,7 @@ reinit_after_soft_reset:
cciss_scsi_setup(h);
/* Turn the interrupts on so we can service requests */
@@ -25436,20 +26419,20 @@ index c2f9b3e..5911988 100644
/* Get the firmware version */
inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
-@@ -5178,7 +5180,7 @@ static void cciss_shutdown(struct pci_dev *pdev)
+@@ -5211,7 +5213,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");
- h->access.set_intr_mask(h, CCISS_INTR_OFF);
+ h->access->set_intr_mask(h, CCISS_INTR_OFF);
- free_irq(h->intr[PERF_MODE_INT], h);
+ free_irq(h->intr[h->intr_mode], h);
}
diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
-index c049548..a09cb6e 100644
+index 7fda30e..eb5dfe0 100644
--- a/drivers/block/cciss.h
+++ b/drivers/block/cciss.h
-@@ -100,7 +100,7 @@ struct ctlr_info
+@@ -101,7 +101,7 @@ struct ctlr_info
/* information about each logical volume */
drive_info_struct *drv[CISS_MAX_LUN];
@@ -25459,7 +26442,7 @@ index c049548..a09cb6e 100644
/* queue and queue Info */
struct list_head reqQ;
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
-index b2fceb5..87fec83 100644
+index 9125bbe..eede5c8 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)
@@ -25498,16 +26481,7 @@ index b2fceb5..87fec83 100644
hba[ctlr]->ctlr = ctlr;
hba[ctlr]->board_id = board_id;
hba[ctlr]->pci_dev = NULL; /* not PCI */
-@@ -911,6 +911,8 @@ static void do_ida_request(struct request_queue *q)
- struct scatterlist tmp_sg[SG_MAX];
- int i, dir, seg;
-
-+ pax_track_stack();
-+
- queue_next:
- creq = blk_peek_request(q);
- if (!creq)
-@@ -980,7 +982,7 @@ static void start_io(ctlr_info_t *h)
+@@ -980,7 +980,7 @@ static void start_io(ctlr_info_t *h)
while((c = h->reqQ) != NULL) {
/* Can't do anything if we're busy */
@@ -25516,7 +26490,7 @@ index b2fceb5..87fec83 100644
return;
/* Get the first entry from the request Q */
-@@ -988,7 +990,7 @@ static void start_io(ctlr_info_t *h)
+@@ -988,7 +988,7 @@ static void start_io(ctlr_info_t *h)
h->Qdepth--;
/* Tell the controller to do our bidding */
@@ -25525,7 +26499,7 @@ index b2fceb5..87fec83 100644
/* Get onto the completion Q */
addQ(&h->cmpQ, c);
-@@ -1050,7 +1052,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
+@@ -1050,7 +1050,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
unsigned long flags;
__u32 a,a1;
@@ -25534,7 +26508,7 @@ index b2fceb5..87fec83 100644
/* Is this interrupt for us? */
if (istat == 0)
return IRQ_NONE;
-@@ -1061,7 +1063,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
+@@ -1061,7 +1061,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
*/
spin_lock_irqsave(IDA_LOCK(h->ctlr), flags);
if (istat & FIFO_NOT_EMPTY) {
@@ -25543,7 +26517,7 @@ index b2fceb5..87fec83 100644
a1 = a; a &= ~3;
if ((c = h->cmpQ) == NULL)
{
-@@ -1449,11 +1451,11 @@ static int sendcmd(
+@@ -1449,11 +1449,11 @@ static int sendcmd(
/*
* Disable interrupt
*/
@@ -25557,7 +26531,7 @@ index b2fceb5..87fec83 100644
if (temp != 0) {
break;
}
-@@ -1466,7 +1468,7 @@ DBG(
+@@ -1466,7 +1466,7 @@ DBG(
/*
* Send the cmd
*/
@@ -25566,7 +26540,7 @@ index b2fceb5..87fec83 100644
complete = pollcomplete(ctlr);
pci_unmap_single(info_p->pci_dev, (dma_addr_t) c->req.sg[0].addr,
-@@ -1549,9 +1551,9 @@ static int revalidate_allvol(ctlr_info_t *host)
+@@ -1549,9 +1549,9 @@ static int revalidate_allvol(ctlr_info_t *host)
* we check the new geometry. Then turn interrupts back on when
* we're done.
*/
@@ -25578,7 +26552,7 @@ index b2fceb5..87fec83 100644
for(i=0; i<NWD; i++) {
struct gendisk *disk = ida_gendisk[ctlr][i];
-@@ -1591,7 +1593,7 @@ static int pollcomplete(int ctlr)
+@@ -1591,7 +1591,7 @@ static int pollcomplete(int ctlr)
/* Wait (up to 2 seconds) for a command to complete */
for (i = 200000; i > 0; i--) {
@@ -25601,10 +26575,10 @@ 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 ef2ceed..c9cb18e 100644
+index 9cf2035..bffca95 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
-@@ -737,7 +737,7 @@ struct drbd_request;
+@@ -736,7 +736,7 @@ struct drbd_request;
struct drbd_epoch {
struct list_head list;
unsigned int barrier_nr;
@@ -25613,7 +26587,7 @@ index ef2ceed..c9cb18e 100644
atomic_t active; /* increased on every req. added, and dec on every finished. */
unsigned long flags;
};
-@@ -1109,7 +1109,7 @@ struct drbd_conf {
+@@ -1108,7 +1108,7 @@ struct drbd_conf {
void *int_dig_in;
void *int_dig_vv;
wait_queue_head_t seq_wait;
@@ -25622,7 +26596,7 @@ index ef2ceed..c9cb18e 100644
unsigned int peer_seq;
spinlock_t peer_seq_lock;
unsigned int minor;
-@@ -1618,30 +1618,30 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname,
+@@ -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)
{
@@ -25704,7 +26678,7 @@ index 0358e55..bc33689 100644
mdev->bm_writ_cnt =
mdev->read_cnt =
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
-index 515bcd9..7ff5ae0 100644
+index af2a250..219c74b 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
@@ -25842,10 +26816,10 @@ index 43beaca..4a5b1dd 100644
}
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index 2ebacf0..9d79297 100644
+index 1e888c9..05cf1b0 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
-@@ -283,7 +283,7 @@ static int __do_lo_send_write(struct file *file,
+@@ -227,7 +227,7 @@ static int __do_lo_send_write(struct file *file,
mm_segment_t old_fs = get_fs();
set_fs(get_ds());
@@ -25854,30 +26828,59 @@ index 2ebacf0..9d79297 100644
set_fs(old_fs);
if (likely(bw == len))
return 0;
-diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
-index f533f33..6177bcb 100644
---- a/drivers/block/nbd.c
-+++ b/drivers/block/nbd.c
-@@ -157,6 +157,8 @@ static int sock_xmit(struct nbd_device *lo, int send, void *buf, int size,
- struct kvec iov;
- sigset_t blocked, oldset;
+diff --git a/drivers/block/ub.c b/drivers/block/ub.c
+index 0e376d4..7333b9e 100644
+--- a/drivers/block/ub.c
++++ b/drivers/block/ub.c
+@@ -1744,12 +1744,11 @@ static int ub_bd_release(struct gendisk *disk, fmode_t mode)
+ static int ub_bd_ioctl(struct block_device *bdev, fmode_t mode,
+ unsigned int cmd, unsigned long arg)
+ {
+- struct gendisk *disk = bdev->bd_disk;
+ void __user *usermem = (void __user *) arg;
+ int ret;
-+ pax_track_stack();
-+
- if (unlikely(!sock)) {
- printk(KERN_ERR "%s: Attempted %s on closed socket in sock_xmit\n",
- lo->disk->disk_name, (send ? "send" : "recv"));
-@@ -572,6 +574,8 @@ static void do_nbd_request(struct request_queue *q)
- static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *lo,
- unsigned int cmd, unsigned long arg)
+ mutex_lock(&ub_mutex);
+- ret = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, usermem);
++ ret = scsi_cmd_blk_ioctl(bdev, mode, cmd, usermem);
+ mutex_unlock(&ub_mutex);
+
+ return ret;
+diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
+index 4d0b70a..e46f2f7 100644
+--- a/drivers/block/virtio_blk.c
++++ b/drivers/block/virtio_blk.c
+@@ -243,8 +243,8 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode,
+ if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI))
+ return -ENOTTY;
+
+- return scsi_cmd_ioctl(disk->queue, disk, mode, cmd,
+- (void __user *)data);
++ return scsi_cmd_blk_ioctl(bdev, mode, cmd,
++ (void __user *)data);
+ }
+
+ /* We provide getgeo only to please some old bootloader/partitioning tools */
+diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
+index f997c27..cedb231 100644
+--- a/drivers/cdrom/cdrom.c
++++ b/drivers/cdrom/cdrom.c
+@@ -2747,12 +2747,11 @@ int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev,
{
-+ pax_track_stack();
-+
- switch (cmd) {
- case NBD_DISCONNECT: {
- struct request sreq;
+ void __user *argp = (void __user *)arg;
+ int ret;
+- struct gendisk *disk = bdev->bd_disk;
+
+ /*
+ * Try the generic SCSI command ioctl's first.
+ */
+- ret = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp);
++ ret = scsi_cmd_blk_ioctl(bdev, mode, cmd, argp);
+ if (ret != -ENOTTY)
+ return ret;
+
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
-index 49502bc..7b818aa 100644
+index 4364303..9adf4ee 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -8,7 +8,8 @@ source "drivers/tty/Kconfig"
@@ -25969,7 +26972,7 @@ index f773a9d..65cd683 100644
return -EINVAL;
else
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
-index 34d6a1c..7b38c5b 100644
+index 0833896..cccce52 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -572,7 +572,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets,
@@ -25982,7 +26985,7 @@ index 34d6a1c..7b38c5b 100644
{
struct hpet_timer __iomem *timer;
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
-index 58c0e63..25aed94 100644
+index 58c0e63..46c16bf 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -415,7 +415,7 @@ struct ipmi_smi {
@@ -26015,15 +27018,6 @@ index 58c0e63..25aed94 100644
intf->proc_dir = NULL;
-@@ -4220,6 +4220,8 @@ static void send_panic_events(char *str)
- struct ipmi_smi_msg smi_msg;
- struct ipmi_recv_msg recv_msg;
-
-+ pax_track_stack();
-+
- si = (struct ipmi_system_interface_addr *) &addr;
- si->addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
- si->channel = IPMI_BMC_CHANNEL;
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 9397ab4..d01bee1 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
@@ -26072,7 +27066,7 @@ index 1aeaaba..e018570 100644
.part_num = MBCS_PART_NUM,
.mfg_num = MBCS_MFG_NUM,
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
-index 8fc04b4..f1a9ee2 100644
+index 1451790..f705c30 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -18,6 +18,7 @@
@@ -26083,18 +27077,18 @@ index 8fc04b4..f1a9ee2 100644
#include <linux/ptrace.h>
#include <linux/device.h>
#include <linux/highmem.h>
-@@ -34,6 +35,10 @@
+@@ -35,6 +36,10 @@
# include <linux/efi.h>
#endif
+#if defined(CONFIG_GRKERNSEC) && !defined(CONFIG_GRKERNSEC_NO_RBAC)
-+extern struct file_operations grsec_fops;
++extern const struct file_operations grsec_fops;
+#endif
+
static inline unsigned long size_inside_page(unsigned long start,
unsigned long size)
{
-@@ -65,9 +70,13 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
+@@ -66,9 +71,13 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
while (cursor < to) {
if (!devmem_is_allowed(pfn)) {
@@ -26108,7 +27102,7 @@ index 8fc04b4..f1a9ee2 100644
return 0;
}
cursor += PAGE_SIZE;
-@@ -75,6 +84,11 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
+@@ -76,6 +85,11 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
}
return 1;
}
@@ -26120,7 +27114,7 @@ index 8fc04b4..f1a9ee2 100644
#else
static inline int range_is_allowed(unsigned long pfn, unsigned long size)
{
-@@ -117,6 +131,7 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+@@ -118,6 +132,7 @@ static ssize_t read_mem(struct file *file, char __user *buf,
while (count > 0) {
unsigned long remaining;
@@ -26128,7 +27122,7 @@ index 8fc04b4..f1a9ee2 100644
sz = size_inside_page(p, count);
-@@ -132,7 +147,23 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+@@ -133,7 +148,23 @@ static ssize_t read_mem(struct file *file, char __user *buf,
if (!ptr)
return -EFAULT;
@@ -26153,7 +27147,7 @@ index 8fc04b4..f1a9ee2 100644
unxlate_dev_mem_ptr(p, ptr);
if (remaining)
return -EFAULT;
-@@ -395,9 +426,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -396,9 +427,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
unsigned long p = *ppos;
@@ -26164,7 +27158,7 @@ index 8fc04b4..f1a9ee2 100644
read = 0;
if (p < (unsigned long) high_memory) {
-@@ -419,6 +449,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -420,6 +450,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
}
#endif
while (low_count > 0) {
@@ -26173,7 +27167,7 @@ index 8fc04b4..f1a9ee2 100644
sz = size_inside_page(p, low_count);
/*
-@@ -428,7 +460,22 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -429,7 +461,22 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
*/
kbuf = xlate_dev_kmem_ptr((char *)p);
@@ -26197,7 +27191,7 @@ index 8fc04b4..f1a9ee2 100644
return -EFAULT;
buf += sz;
p += sz;
-@@ -866,6 +913,9 @@ static const struct memdev {
+@@ -867,6 +914,9 @@ static const struct memdev {
#ifdef CONFIG_CRASH_DUMP
[12] = { "oldmem", 0, &oldmem_fops, NULL },
#endif
@@ -26208,10 +27202,10 @@ index 8fc04b4..f1a9ee2 100644
static int memory_open(struct inode *inode, struct file *filp)
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
-index 166f1e7..c579d46 100644
+index da3cfee..a5a6606 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
-@@ -246,7 +246,7 @@ static ssize_t nvram_read(struct file *file, char __user *buf,
+@@ -248,7 +248,7 @@ static ssize_t nvram_read(struct file *file, char __user *buf,
spin_unlock_irq(&rtc_lock);
@@ -26221,7 +27215,7 @@ index 166f1e7..c579d46 100644
*ppos = i;
diff --git a/drivers/char/random.c b/drivers/char/random.c
-index c35a785..6d82202 100644
+index 6035ab8..bdfe4fd 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -261,8 +261,13 @@
@@ -26265,7 +27259,7 @@ index c35a785..6d82202 100644
ret = -EFAULT;
break;
}
-@@ -1214,7 +1226,7 @@ EXPORT_SYMBOL(generate_random_uuid);
+@@ -1228,7 +1240,7 @@ EXPORT_SYMBOL(generate_random_uuid);
#include <linux/sysctl.h>
static int min_read_thresh = 8, min_write_thresh;
@@ -26317,7 +27311,7 @@ index 1ee8ce7..b778bef 100644
return 0;
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
-index b85ee76..4d81778 100644
+index 361a1df..2471eee 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -414,7 +414,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
@@ -26329,15 +27323,6 @@ index b85ee76..4d81778 100644
dev_err(chip->dev, "Operation Canceled\n");
rc = -ECANCELED;
goto out;
-@@ -847,6 +847,8 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
-
- struct tpm_chip *chip = dev_get_drvdata(dev);
-
-+ pax_track_stack();
-+
- tpm_cmd.header.in = tpm_readpubek_header;
- err = transmit_cmd(chip, &tpm_cmd, READ_PUBEK_RESULT_SIZE,
- "attempting to read the PUBEK");
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
@@ -26386,10 +27371,10 @@ index 0636520..169c1d0 100644
acpi_os_unmap_memory(virt, len);
return 0;
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
-index fb68b12..0f6c6ca 100644
+index 8e3c46d..c139b99 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
-@@ -555,7 +555,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
+@@ -563,7 +563,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
if (to_user) {
ssize_t ret;
@@ -26398,7 +27383,7 @@ index fb68b12..0f6c6ca 100644
if (ret)
return -EFAULT;
} else {
-@@ -654,7 +654,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
+@@ -662,7 +662,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
if (!port_has_data(port) && !port->host_connected)
return 0;
@@ -26407,56 +27392,24 @@ index fb68b12..0f6c6ca 100644
}
static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
-diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
-index a84250a..68c725e 100644
---- a/drivers/crypto/hifn_795x.c
-+++ b/drivers/crypto/hifn_795x.c
-@@ -1655,6 +1655,8 @@ static int hifn_test(struct hifn_device *dev, int encdec, u8 snum)
- 0xCA, 0x34, 0x2B, 0x2E};
- struct scatterlist sg;
-
-+ pax_track_stack();
-+
- memset(src, 0, sizeof(src));
- memset(ctx.key, 0, sizeof(ctx.key));
-
-diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
-index db33d30..7823369 100644
---- a/drivers/crypto/padlock-aes.c
-+++ b/drivers/crypto/padlock-aes.c
-@@ -109,6 +109,8 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
- struct crypto_aes_ctx gen_aes;
- int cpu;
-
-+ pax_track_stack();
-+
- if (key_len % 8) {
- *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
- return -EINVAL;
-diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
-index d845dc4..fec8664 100644
---- a/drivers/dma/ioat/dma_v3.c
-+++ b/drivers/dma/ioat/dma_v3.c
-@@ -73,10 +73,10 @@
- /* provide a lookup table for setting the source address in the base or
- * extended descriptor of an xor or pq descriptor
- */
--static const u8 xor_idx_to_desc __read_mostly = 0xd0;
--static const u8 xor_idx_to_field[] __read_mostly = { 1, 4, 5, 6, 7, 0, 1, 2 };
--static const u8 pq_idx_to_desc __read_mostly = 0xf8;
--static const u8 pq_idx_to_field[] __read_mostly = { 1, 4, 5, 0, 1, 2, 4, 5 };
-+static const u8 xor_idx_to_desc = 0xd0;
-+static const u8 xor_idx_to_field[] = { 1, 4, 5, 6, 7, 0, 1, 2 };
-+static const u8 pq_idx_to_desc = 0xf8;
-+static const u8 pq_idx_to_field[] = { 1, 4, 5, 0, 1, 2, 4, 5 };
+diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
+index eb1d864..39ee5a7 100644
+--- a/drivers/dma/dmatest.c
++++ b/drivers/dma/dmatest.c
+@@ -591,7 +591,7 @@ static int dmatest_add_channel(struct dma_chan *chan)
+ }
+ if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
+ cnt = dmatest_add_threads(dtc, DMA_PQ);
+- thread_count += cnt > 0 ?: 0;
++ thread_count += cnt > 0 ? cnt : 0;
+ }
- static dma_addr_t xor_get_src(struct ioat_raw_descriptor *descs[2], int idx)
- {
+ pr_info("dmatest: Started %u threads using %s\n",
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
-index 9a8bebc..b1e4989 100644
+index c9eee6d..f9d5280 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
-@@ -2670,7 +2670,7 @@ static void __devexit amd64_remove_one_instance(struct pci_dev *pdev)
+@@ -2685,7 +2685,7 @@ static void __devexit amd64_remove_one_instance(struct pci_dev *pdev)
* PCI core identifies what devices are on a system during boot, and then
* inquiry this table to see if this driver is for a given device found.
*/
@@ -26657,10 +27610,10 @@ index 74d6ec34..baff517 100644
{0,} /* 0 terminated list. */
};
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
-index a76fe83..15479e6 100644
+index 6104dba..e7ea8e1 100644
--- a/drivers/edac/i7300_edac.c
+++ b/drivers/edac/i7300_edac.c
-@@ -1191,7 +1191,7 @@ static void __devexit i7300_remove_one(struct pci_dev *pdev)
+@@ -1192,7 +1192,7 @@ static void __devexit i7300_remove_one(struct pci_dev *pdev)
*
* Has only 8086:360c PCI ID
*/
@@ -26670,10 +27623,10 @@ index a76fe83..15479e6 100644
{0,} /* 0 terminated list. */
};
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
-index f6cf448..3f612e9 100644
+index 70ad892..178943c 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
-@@ -359,7 +359,7 @@ static const struct pci_id_table pci_dev_table[] = {
+@@ -391,7 +391,7 @@ static const struct pci_id_table pci_dev_table[] = {
/*
* pci_device_id table for which devices we are looking for
*/
@@ -26735,7 +27688,7 @@ index a5da732..983363b 100644
PCI_VEND_DEV(INTEL, 82975_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
I82975X
diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h
-index 795a320..3bbc3d3 100644
+index 0106747..0b40417 100644
--- a/drivers/edac/mce_amd.h
+++ b/drivers/edac/mce_amd.h
@@ -83,7 +83,7 @@ struct amd_decoder_ops {
@@ -26746,7 +27699,7 @@ index 795a320..3bbc3d3 100644
+} __no_const;
void amd_report_gart_errors(bool);
- void amd_register_ecc_decoder(void (*f)(int, struct mce *, u32));
+ void amd_register_ecc_decoder(void (*f)(int, struct mce *));
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index b153674..ad2ba9b 100644
--- a/drivers/edac/r82600_edac.c
@@ -26774,7 +27727,7 @@ index b6f47de..c5acf3a 100644
PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
X38},
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
-index 29d2423..6c48b3a 100644
+index 85661b0..c784559a 100644
--- a/drivers/firewire/core-card.c
+++ b/drivers/firewire/core-card.c
@@ -657,7 +657,7 @@ void fw_card_release(struct kref *kref)
@@ -26787,10 +27740,10 @@ index 29d2423..6c48b3a 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 e6ad3bb..2f89ef8 100644
+index 4799393..37bd3ab 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
-@@ -1313,8 +1313,7 @@ static int init_iso_resource(struct client *client,
+@@ -1331,8 +1331,7 @@ static int init_iso_resource(struct client *client,
int ret;
if ((request->channels == 0 && request->bandwidth == 0) ||
@@ -26801,7 +27754,7 @@ index e6ad3bb..2f89ef8 100644
r = kmalloc(sizeof(*r), GFP_KERNEL);
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
-index 334b82a..ea5261d 100644
+index 855ab3f..11f4bbd 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -37,6 +37,7 @@
@@ -26812,17 +27765,8 @@ index 334b82a..ea5261d 100644
#include <asm/byteorder.h>
-@@ -422,6 +423,8 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
- struct transaction_callback_data d;
- struct fw_transaction t;
-
-+ pax_track_stack();
-+
- init_timer_on_stack(&t.split_timeout_timer);
- init_completion(&d.done);
- d.payload = payload;
diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h
-index 0fe4e4e..1edf73c 100644
+index b45be57..5fad18b 100644
--- a/drivers/firewire/core.h
+++ b/drivers/firewire/core.h
@@ -101,6 +101,7 @@ struct fw_card_driver {
@@ -26834,7 +27778,7 @@ index 0fe4e4e..1edf73c 100644
void fw_card_initialize(struct fw_card *card,
const struct fw_card_driver *driver, struct device *device);
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
-index bcb1126..2cc2121 100644
+index 153980b..4b4d046 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -449,11 +449,6 @@ void __init dmi_scan_machine(void)
@@ -26849,7 +27793,7 @@ index bcb1126..2cc2121 100644
p = dmi_ioremap(0xF0000, 0x10000);
if (p == NULL)
goto error;
-@@ -725,7 +720,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *),
+@@ -723,7 +718,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *),
if (buf == NULL)
return -1;
@@ -26858,10 +27802,10 @@ index bcb1126..2cc2121 100644
iounmap(buf);
return 0;
-diff --git a/drivers/gpio/vr41xx_giu.c b/drivers/gpio/vr41xx_giu.c
-index a365be0..a629755 100644
---- a/drivers/gpio/vr41xx_giu.c
-+++ b/drivers/gpio/vr41xx_giu.c
+diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
+index 98723cb..10ca85b 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)
printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
maskl, pendl, maskh, pendh);
@@ -26872,10 +27816,10 @@ index a365be0..a629755 100644
return -EINVAL;
}
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
-index 1367ced..f2ec98d 100644
+index 8323fc3..5c1d755 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
-@@ -1372,7 +1372,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
+@@ -1379,7 +1379,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
*/
if ((out_resp->count_modes >= mode_count) && mode_count) {
copied = 0;
@@ -26884,7 +27828,7 @@ index 1367ced..f2ec98d 100644
list_for_each_entry(mode, &connector->modes, head) {
drm_crtc_convert_to_umode(&u_mode, mode);
if (copy_to_user(mode_ptr + copied,
-@@ -1387,8 +1387,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
+@@ -1394,8 +1394,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
if ((out_resp->count_props >= props_count) && props_count) {
copied = 0;
@@ -26895,7 +27839,7 @@ index 1367ced..f2ec98d 100644
for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) {
if (connector->property_ids[i] != 0) {
if (put_user(connector->property_ids[i],
-@@ -1410,7 +1410,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
+@@ -1417,7 +1417,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
if ((out_resp->count_encoders >= encoders_count) && encoders_count) {
copied = 0;
@@ -26904,7 +27848,7 @@ index 1367ced..f2ec98d 100644
for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
if (connector->encoder_ids[i] != 0) {
if (put_user(connector->encoder_ids[i],
-@@ -1569,7 +1569,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
+@@ -1576,7 +1576,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
}
for (i = 0; i < crtc_req->count_connectors; i++) {
@@ -26913,7 +27857,7 @@ index 1367ced..f2ec98d 100644
if (get_user(out_id, &set_connectors_ptr[i])) {
ret = -EFAULT;
goto out;
-@@ -1850,7 +1850,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
+@@ -1857,7 +1857,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
fb = obj_to_fb(obj);
num_clips = r->num_clips;
@@ -26922,7 +27866,7 @@ index 1367ced..f2ec98d 100644
if (!num_clips != !clips_ptr) {
ret = -EINVAL;
-@@ -2274,7 +2274,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
+@@ -2283,7 +2283,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
out_resp->flags = property->flags;
if ((out_resp->count_values >= value_count) && value_count) {
@@ -26931,7 +27875,7 @@ index 1367ced..f2ec98d 100644
for (i = 0; i < value_count; i++) {
if (copy_to_user(values_ptr + i, &property->values[i], sizeof(uint64_t))) {
ret = -EFAULT;
-@@ -2287,7 +2287,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
+@@ -2296,7 +2296,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
if (property->flags & DRM_MODE_PROP_ENUM) {
if ((out_resp->count_enum_blobs >= enum_count) && enum_count) {
copied = 0;
@@ -26940,7 +27884,7 @@ index 1367ced..f2ec98d 100644
list_for_each_entry(prop_enum, &property->enum_blob_list, head) {
if (copy_to_user(&enum_ptr[copied].value, &prop_enum->value, sizeof(uint64_t))) {
-@@ -2310,7 +2310,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
+@@ -2319,7 +2319,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
if ((out_resp->count_enum_blobs >= blob_count) && blob_count) {
copied = 0;
blob_id_ptr = (uint32_t *)(unsigned long)out_resp->enum_blob_ptr;
@@ -26949,7 +27893,7 @@ index 1367ced..f2ec98d 100644
list_for_each_entry(prop_blob, &property->enum_blob_list, head) {
if (put_user(prop_blob->base.id, blob_id_ptr + copied)) {
-@@ -2371,7 +2371,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
+@@ -2380,7 +2380,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
struct drm_mode_get_blob *out_resp = data;
struct drm_property_blob *blob;
int ret = 0;
@@ -26958,7 +27902,7 @@ index 1367ced..f2ec98d 100644
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
-@@ -2385,7 +2385,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
+@@ -2394,7 +2394,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
blob = obj_to_blob(obj);
if (out_resp->length == blob->length) {
@@ -26968,10 +27912,10 @@ index 1367ced..f2ec98d 100644
ret = -EFAULT;
goto done;
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
-index 9236965..f9ea6cd 100644
+index d2619d7..bd6bd00 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
-@@ -276,7 +276,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
+@@ -279,7 +279,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
struct drm_crtc *tmp;
int crtc_mask = 1;
@@ -26980,20 +27924,11 @@ index 9236965..f9ea6cd 100644
dev = crtc->dev;
-@@ -343,6 +343,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
- struct drm_encoder *encoder;
- bool ret = true;
-
-+ pax_track_stack();
-+
- crtc->enabled = drm_helper_crtc_in_use(crtc);
- if (!crtc->enabled)
- return true;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
-index 93a112d..c8b065d 100644
+index 40c187c..5746164 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
-@@ -307,7 +307,7 @@ module_exit(drm_core_exit);
+@@ -308,7 +308,7 @@ module_exit(drm_core_exit);
/**
* Copy and IOCTL return string to user space
*/
@@ -27002,7 +27937,7 @@ index 93a112d..c8b065d 100644
{
int len;
-@@ -386,7 +386,7 @@ long drm_ioctl(struct file *filp,
+@@ -387,7 +387,7 @@ long drm_ioctl(struct file *filp,
dev = file_priv->minor->dev;
atomic_inc(&dev->ioctl_count);
@@ -27012,10 +27947,10 @@ index 93a112d..c8b065d 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 2ec7d48..be14bb1 100644
+index 4911e1d..484c8a3 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
-@@ -70,7 +70,7 @@ static int drm_setup(struct drm_device * dev)
+@@ -71,7 +71,7 @@ static int drm_setup(struct drm_device * dev)
}
for (i = 0; i < ARRAY_SIZE(dev->counts); i++)
@@ -27024,7 +27959,7 @@ index 2ec7d48..be14bb1 100644
dev->sigdata.lock = NULL;
-@@ -134,8 +134,8 @@ int drm_open(struct inode *inode, struct file *filp)
+@@ -135,8 +135,8 @@ int drm_open(struct inode *inode, struct file *filp)
retcode = drm_open_helper(inode, filp, dev);
if (!retcode) {
@@ -27035,7 +27970,7 @@ index 2ec7d48..be14bb1 100644
retcode = drm_setup(dev);
}
if (!retcode) {
-@@ -472,7 +472,7 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -473,7 +473,7 @@ int drm_release(struct inode *inode, struct file *filp)
mutex_lock(&drm_global_mutex);
@@ -27044,7 +27979,7 @@ index 2ec7d48..be14bb1 100644
if (dev->driver->preclose)
dev->driver->preclose(dev, file_priv);
-@@ -484,7 +484,7 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -485,7 +485,7 @@ int drm_release(struct inode *inode, struct file *filp)
DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->device),
@@ -27053,7 +27988,7 @@ index 2ec7d48..be14bb1 100644
/* if the master has gone away we can't do anything with the lock */
if (file_priv->minor->master)
-@@ -565,8 +565,8 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -566,8 +566,8 @@ int drm_release(struct inode *inode, struct file *filp)
* End inline drm_release
*/
@@ -27170,10 +28105,10 @@ 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 4a058c7..b42cd92 100644
+index ddd70db..40321e6 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
-@@ -455,7 +455,7 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd,
+@@ -456,7 +456,7 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd,
request = compat_alloc_user_space(nbytes);
if (!access_ok(VERIFY_WRITE, request, nbytes))
return -EFAULT;
@@ -27182,7 +28117,7 @@ index 4a058c7..b42cd92 100644
if (__put_user(count, &request->count)
|| __put_user(list, &request->list))
-@@ -516,7 +516,7 @@ static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
+@@ -517,7 +517,7 @@ static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
request = compat_alloc_user_space(nbytes);
if (!access_ok(VERIFY_WRITE, request, nbytes))
return -EFAULT;
@@ -27268,19 +28203,19 @@ 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 e36efdc..e917798 100644
+index 004b048..7588eba 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
-@@ -497,7 +497,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++) {
- if (IS_GEN6(dev)) {
+ if (IS_GEN6(dev) || IS_GEN7(dev)) {
seq_printf(m, "Graphics Interrupt mask (%s): %08x\n",
-@@ -1147,7 +1147,7 @@ static int i915_opregion(struct seq_file *m, void *unused)
+@@ -1232,7 +1232,7 @@ static int i915_opregion(struct seq_file *m, void *unused)
return ret;
if (opregion->header)
@@ -27290,10 +28225,10 @@ index e36efdc..e917798 100644
mutex_unlock(&dev->struct_mutex);
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
-index 7eef6e1..f8b411e 100644
+index a9ae374..43c1e9e 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -1169,7 +1169,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -1172,7 +1172,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
bool can_switch;
spin_lock(&dev->count_lock);
@@ -27303,10 +28238,10 @@ index 7eef6e1..f8b411e 100644
return can_switch;
}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
-index e0d0e27..f48e37e 100644
+index 554bef7..d24791c 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -219,7 +219,7 @@ struct drm_i915_display_funcs {
+@@ -229,7 +229,7 @@ struct drm_i915_display_funcs {
/* render clock increase/decrease */
/* display clock increase/decrease */
/* pll clock increase/decrease */
@@ -27315,7 +28250,7 @@ index e0d0e27..f48e37e 100644
struct intel_device_info {
u8 gen;
-@@ -300,7 +300,7 @@ typedef struct drm_i915_private {
+@@ -312,7 +312,7 @@ typedef struct drm_i915_private {
int current_page;
int page_flipping;
@@ -27324,7 +28259,7 @@ index e0d0e27..f48e37e 100644
/* protects the irq masks */
spinlock_t irq_lock;
-@@ -875,7 +875,7 @@ struct drm_i915_gem_object {
+@@ -887,7 +887,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.
*/
@@ -27333,7 +28268,7 @@ index e0d0e27..f48e37e 100644
};
#define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
-@@ -1248,7 +1248,7 @@ extern int intel_setup_gmbus(struct drm_device *dev);
+@@ -1267,7 +1267,7 @@ extern int intel_setup_gmbus(struct drm_device *dev);
extern void intel_teardown_gmbus(struct drm_device *dev);
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);
@@ -27343,10 +28278,10 @@ index e0d0e27..f48e37e 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 4934cf8..52e8e83 100644
+index b9da890..cad1d98 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
-@@ -188,7 +188,7 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj,
+@@ -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)
@@ -27355,11 +28290,23 @@ index 4934cf8..52e8e83 100644
/* The actual obj->write_domain will be updated with
* pending_write_domain after we emit the accumulated flush for all
+@@ -882,9 +882,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec)
+
+ static int
+ validate_exec_list(struct drm_i915_gem_exec_object2 *exec,
+- int count)
++ unsigned int count)
+ {
+- int i;
++ unsigned int i;
+
+ for (i = 0; i < count; i++) {
+ char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr;
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
-index 3635647..1ad5700 100644
+index b40004b..7c53a75 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
-@@ -473,7 +473,7 @@ static irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS)
+@@ -475,7 +475,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;
@@ -27368,7 +28315,7 @@ index 3635647..1ad5700 100644
/* disable master interrupt before clearing iir */
de_ier = I915_READ(DEIER);
-@@ -563,7 +563,7 @@ static irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS)
+@@ -566,7 +566,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;
@@ -27377,7 +28324,7 @@ index 3635647..1ad5700 100644
if (IS_GEN6(dev))
bsd_usr_interrupt = GT_GEN6_BSD_USER_INTERRUPT;
-@@ -1227,7 +1227,7 @@ static irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
+@@ -1231,7 +1231,7 @@ static irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
int ret = IRQ_NONE, pipe;
bool blc_event = false;
@@ -27386,7 +28333,7 @@ index 3635647..1ad5700 100644
iir = I915_READ(IIR);
-@@ -1736,7 +1736,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev)
+@@ -1743,7 +1743,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -27395,7 +28342,7 @@ index 3635647..1ad5700 100644
INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-@@ -1900,7 +1900,7 @@ static void i915_driver_irq_preinstall(struct drm_device * dev)
+@@ -1931,7 +1931,7 @@ static void i915_driver_irq_preinstall(struct drm_device * dev)
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -27405,10 +28352,10 @@ index 3635647..1ad5700 100644
INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
INIT_WORK(&dev_priv->error_work, i915_error_work_func);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index fed87d6..f594763 100644
+index daa5743..c0757a9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -1961,7 +1961,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
+@@ -2230,7 +2230,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
wait_event(dev_priv->pending_flip_queue,
atomic_read(&dev_priv->mm.wedged) ||
@@ -27417,7 +28364,7 @@ index fed87d6..f594763 100644
/* Big Hammer, we also need to ensure that any pending
* MI_WAIT_FOR_EVENT inside a user batch buffer on the
-@@ -2550,7 +2550,7 @@ static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
+@@ -2851,7 +2851,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,
@@ -27426,7 +28373,7 @@ index fed87d6..f594763 100644
}
static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
-@@ -6257,7 +6257,7 @@ static void do_intel_finish_page_flip(struct drm_device *dev,
+@@ -6952,7 +6952,7 @@ static void do_intel_finish_page_flip(struct drm_device *dev,
atomic_clear_mask(1 << intel_crtc->plane,
&obj->pending_flip.counter);
@@ -27435,7 +28382,7 @@ index fed87d6..f594763 100644
wake_up(&dev_priv->pending_flip_queue);
schedule_work(&work->work);
-@@ -6546,7 +6546,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
+@@ -7242,7 +7242,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.
*/
@@ -27444,15 +28391,15 @@ index fed87d6..f594763 100644
ret = dev_priv->display.queue_flip(dev, crtc, fb, obj);
if (ret)
-@@ -6559,7 +6559,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
+@@ -7256,7 +7256,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
return 0;
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);
- cleanup_objs:
drm_gem_object_unreference(&work->old_fb_obj->base);
drm_gem_object_unreference(&obj->base);
+ mutex_unlock(&dev->struct_mutex);
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
@@ -27510,10 +28457,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 729d5fd..2d52506 100644
+index 5fc201b..7b032b9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
-@@ -200,7 +200,7 @@ struct methods {
+@@ -201,7 +201,7 @@ struct methods {
const char desc[8];
void (*loadbios)(struct drm_device *, uint8_t *);
const bool rw;
@@ -27522,7 +28469,7 @@ index 729d5fd..2d52506 100644
static struct methods shadow_methods[] = {
{ "PRAMIN", load_vbios_pramin, true },
-@@ -5488,7 +5488,7 @@ parse_bit_displayport_tbl_entry(struct drm_device *dev, struct nvbios *bios,
+@@ -5474,7 +5474,7 @@ parse_bit_U_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 *);
@@ -27532,19 +28479,19 @@ index 729d5fd..2d52506 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 9c56331..3809ea8 100644
+index 4c0be3a..5757582 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
-@@ -227,7 +227,7 @@ struct nouveau_channel {
+@@ -238,7 +238,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;
- /* DMA push buffer */
-@@ -304,7 +304,7 @@ struct nouveau_exec_engine {
+@@ -319,7 +319,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);
@@ -27553,7 +28500,7 @@ index 9c56331..3809ea8 100644
struct nouveau_instmem_engine {
void *priv;
-@@ -325,13 +325,13 @@ struct nouveau_instmem_engine {
+@@ -341,13 +341,13 @@ struct nouveau_instmem_engine {
struct nouveau_mc_engine {
int (*init)(struct drm_device *dev);
void (*takedown)(struct drm_device *dev);
@@ -27569,7 +28516,7 @@ index 9c56331..3809ea8 100644
struct nouveau_fb_engine {
int num_tiles;
-@@ -494,7 +494,7 @@ struct nouveau_vram_engine {
+@@ -558,7 +558,7 @@ struct nouveau_vram_engine {
void (*put)(struct drm_device *, struct nouveau_mem **);
bool (*flags_valid)(struct drm_device *, u32 tile_flags);
@@ -27578,7 +28525,7 @@ index 9c56331..3809ea8 100644
struct nouveau_engine {
struct nouveau_instmem_engine instmem;
-@@ -640,7 +640,7 @@ struct drm_nouveau_private {
+@@ -706,7 +706,7 @@ struct drm_nouveau_private {
struct drm_global_reference mem_global_ref;
struct ttm_bo_global_ref bo_global_ref;
struct ttm_bo_device bdev;
@@ -27588,7 +28535,7 @@ index 9c56331..3809ea8 100644
struct {
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
-index 56f06b0..3d0f7dd 100644
+index 2f6daae..c9d7b9e 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)
@@ -27600,7 +28547,7 @@ index 56f06b0..3d0f7dd 100644
if (chan->fence.sequence_ack == sequence)
goto out;
-@@ -542,7 +542,7 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
+@@ -539,7 +539,7 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
return ret;
}
@@ -27610,10 +28557,10 @@ index 56f06b0..3d0f7dd 100644
}
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
-index b52e460..bb5bb3c 100644
+index 5f0bc57..eb9fac8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
-@@ -249,7 +249,7 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv,
+@@ -314,7 +314,7 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv,
int trycnt = 0;
int ret, i;
@@ -27623,10 +28570,10 @@ index b52e460..bb5bb3c 100644
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 731acea..1b3c064 100644
+index d8831ab..0ba8356 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
-@@ -488,7 +488,7 @@ static bool nouveau_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -542,7 +542,7 @@ static bool nouveau_switcheroo_can_switch(struct pci_dev *pdev)
bool can_switch;
spin_lock(&dev->count_lock);
@@ -27636,10 +28583,10 @@ index 731acea..1b3c064 100644
return can_switch;
}
diff --git a/drivers/gpu/drm/nouveau/nv04_graph.c b/drivers/gpu/drm/nouveau/nv04_graph.c
-index 3626ee7..c60f0db 100644
+index dbdea8e..cd6eeeb 100644
--- a/drivers/gpu/drm/nouveau/nv04_graph.c
+++ b/drivers/gpu/drm/nouveau/nv04_graph.c
-@@ -560,7 +560,7 @@ static int
+@@ -554,7 +554,7 @@ static int
nv04_graph_mthd_set_ref(struct nouveau_channel *chan,
u32 class, u32 mthd, u32 data)
{
@@ -27649,10 +28596,10 @@ index 3626ee7..c60f0db 100644
}
diff --git a/drivers/gpu/drm/r128/r128_cce.c b/drivers/gpu/drm/r128/r128_cce.c
-index 570e190..084a31a 100644
+index bcac90b..53bfc76 100644
--- a/drivers/gpu/drm/r128/r128_cce.c
+++ b/drivers/gpu/drm/r128/r128_cce.c
-@@ -377,7 +377,7 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init)
+@@ -378,7 +378,7 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init)
/* GH: Simple idle check.
*/
@@ -27721,19 +28668,6 @@ index a9e33ce..09edd4b 100644
}
#endif
-diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
-index 9a0aee2..4e5010c 100644
---- a/drivers/gpu/drm/radeon/atom.c
-+++ b/drivers/gpu/drm/radeon/atom.c
-@@ -1254,6 +1254,8 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
- char name[512];
- int i;
-
-+ pax_track_stack();
-+
- ctx->card = card;
- ctx->bios = bios;
-
diff --git a/drivers/gpu/drm/radeon/mkregtable.c b/drivers/gpu/drm/radeon/mkregtable.c
index 5a82b6b..9e69c73 100644
--- a/drivers/gpu/drm/radeon/mkregtable.c
@@ -27756,7 +28690,7 @@ 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 59d72d0..3621b94 100644
+index 8227e76..ce0b195 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -192,7 +192,7 @@ extern int sumo_get_temp(struct radeon_device *rdev);
@@ -27768,7 +28702,16 @@ index 59d72d0..3621b94 100644
uint32_t last_seq;
unsigned long last_jiffies;
unsigned long last_timeout;
-@@ -962,7 +962,7 @@ struct radeon_asic {
+@@ -530,7 +530,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;
+@@ -954,7 +954,7 @@ struct radeon_asic {
void (*pre_page_flip)(struct radeon_device *rdev, int crtc);
u32 (*page_flip)(struct radeon_device *rdev, int crtc, u64 crtc_base);
void (*post_page_flip)(struct radeon_device *rdev, int crtc);
@@ -27777,24 +28720,11 @@ index 59d72d0..3621b94 100644
/*
* Asic structures
-diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
-index 285acc4..f4d909f 100644
---- a/drivers/gpu/drm/radeon/radeon_atombios.c
-+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
-@@ -569,6 +569,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
- struct radeon_gpio_rec gpio;
- struct radeon_hpd hpd;
-
-+ pax_track_stack();
-+
- if (!atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset))
- return false;
-
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
-index 440e6ec..8f7f68b 100644
+index c4d00a1..f0fdc90 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
-@@ -678,7 +678,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -684,7 +684,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
bool can_switch;
spin_lock(&dev->count_lock);
@@ -27803,19 +28733,6 @@ index 440e6ec..8f7f68b 100644
spin_unlock(&dev->count_lock);
return can_switch;
}
-diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
-index ed085ce..dabdad7 100644
---- a/drivers/gpu/drm/radeon/radeon_display.c
-+++ b/drivers/gpu/drm/radeon/radeon_display.c
-@@ -946,6 +946,8 @@ void radeon_compute_pll_legacy(struct radeon_pll *pll,
- uint32_t post_div;
- u32 pll_out_min, pll_out_max;
-
-+ pax_track_stack();
-+
- DRM_DEBUG_KMS("PLL freq %llu %u %u\n", freq, pll->min_ref_div, pll->max_ref_div);
- freq = freq * 1000;
-
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h
index a1b59ca..86f2d44 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.h
@@ -27830,7 +28747,7 @@ index a1b59ca..86f2d44 100644
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 021d2b6..7969575 100644
+index 76ec0e9..6feb1a3 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -78,7 +78,7 @@ int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence)
@@ -27865,7 +28782,7 @@ index 48b7cea..342236f 100644
return -EFAULT;
diff --git a/drivers/gpu/drm/radeon/radeon_irq.c b/drivers/gpu/drm/radeon/radeon_irq.c
-index 465746b..cb2b055 100644
+index 00da384..32f972d 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)
@@ -27889,7 +28806,7 @@ index 465746b..cb2b055 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 92e7ea7..147ffad 100644
+index e8422ae..d22d4a8 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 *
@@ -27911,10 +28828,10 @@ index 92e7ea7..147ffad 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 3e9b41b..8619b10 100644
+index 0b5468b..9c4b308 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
-@@ -649,8 +649,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
+@@ -672,8 +672,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
}
if (unlikely(ttm_vm_ops == NULL)) {
ttm_vm_ops = vma->vm_ops;
@@ -27945,7 +28862,7 @@ index a9049ed..501f284 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 d948575..059a928 100644
+index 727e93d..1565650 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -398,9 +398,9 @@ static int ttm_pool_get_num_unused_pages(void)
@@ -28057,58 +28974,32 @@ 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 10fc01f..b4e9822 100644
+index dc27970..f18b008 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
-@@ -240,7 +240,7 @@ struct vmw_private {
+@@ -260,7 +260,7 @@ struct vmw_private {
* Fencing and IRQs.
*/
-- atomic_t fence_seq;
-+ atomic_unchecked_t fence_seq;
+- atomic_t marker_seq;
++ atomic_unchecked_t marker_seq;
wait_queue_head_t fence_queue;
wait_queue_head_t fifo_queue;
- atomic_t fence_queue_waiters;
-diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
-index 41b95ed..69ea504 100644
---- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
-+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
-@@ -610,7 +610,7 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
- struct drm_vmw_fence_rep fence_rep;
- struct drm_vmw_fence_rep __user *user_fence_rep;
- int ret;
-- void *user_cmd;
-+ void __user *user_cmd;
- void *cmd;
- uint32_t sequence;
- struct vmw_sw_context *sw_context = &dev_priv->ctx;
-diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
-index 61eacc1..ee38ce8 100644
---- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
-+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
-@@ -151,7 +151,7 @@ int vmw_wait_lag(struct vmw_private *dev_priv,
- while (!vmw_lag_lt(queue, us)) {
- spin_lock(&queue->lock);
- if (list_empty(&queue->head))
-- sequence = atomic_read(&dev_priv->fence_seq);
-+ sequence = atomic_read_unchecked(&dev_priv->fence_seq);
- else {
- fence = list_first_entry(&queue->head,
- struct vmw_fence, head);
+ 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 635c0ff..2641bbb 100644
+index a0c2f12..68ae6cb 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)
(unsigned int) min,
(unsigned int) fifo->capabilities);
-- atomic_set(&dev_priv->fence_seq, dev_priv->last_read_sequence);
-+ atomic_set_unchecked(&dev_priv->fence_seq, dev_priv->last_read_sequence);
- iowrite32(dev_priv->last_read_sequence, fifo_mem + SVGA_FIFO_FENCE);
- vmw_fence_queue_init(&fifo->fence_queue);
+- atomic_set(&dev_priv->marker_seq, dev_priv->last_read_seqno);
++ atomic_set_unchecked(&dev_priv->marker_seq, dev_priv->last_read_seqno);
+ iowrite32(dev_priv->last_read_seqno, fifo_mem + SVGA_FIFO_FENCE);
+ vmw_marker_queue_init(&fifo->marker_queue);
return vmw_fifo_send_fence(dev_priv, &dummy);
-@@ -356,7 +356,7 @@ void *vmw_fifo_reserve(struct vmw_private *dev_priv, uint32_t bytes)
+@@ -355,7 +355,7 @@ void *vmw_fifo_reserve(struct vmw_private *dev_priv, uint32_t bytes)
if (reserveable)
iowrite32(bytes, fifo_mem +
SVGA_FIFO_RESERVED);
@@ -28117,51 +29008,64 @@ index 635c0ff..2641bbb 100644
} else {
need_bounce = true;
}
-@@ -476,7 +476,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence)
+@@ -475,7 +475,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *seqno)
fm = vmw_fifo_reserve(dev_priv, bytes);
if (unlikely(fm == NULL)) {
-- *sequence = atomic_read(&dev_priv->fence_seq);
-+ *sequence = atomic_read_unchecked(&dev_priv->fence_seq);
+- *seqno = atomic_read(&dev_priv->marker_seq);
++ *seqno = atomic_read_unchecked(&dev_priv->marker_seq);
ret = -ENOMEM;
- (void)vmw_fallback_wait(dev_priv, false, true, *sequence,
+ (void)vmw_fallback_wait(dev_priv, false, true, *seqno,
false, 3*HZ);
-@@ -484,7 +484,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence)
+@@ -483,7 +483,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *seqno)
}
do {
-- *sequence = atomic_add_return(1, &dev_priv->fence_seq);
-+ *sequence = atomic_add_return_unchecked(1, &dev_priv->fence_seq);
- } while (*sequence == 0);
+- *seqno = atomic_add_return(1, &dev_priv->marker_seq);
++ *seqno = atomic_add_return_unchecked(1, &dev_priv->marker_seq);
+ } while (*seqno == 0);
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 e92298a..f68f2d6 100644
+index cabc95f..14b3d77 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
-@@ -100,7 +100,7 @@ bool vmw_fence_signaled(struct vmw_private *dev_priv,
+@@ -107,7 +107,7 @@ bool vmw_seqno_passed(struct vmw_private *dev_priv,
* emitted. Then the fence is stale and signaled.
*/
-- ret = ((atomic_read(&dev_priv->fence_seq) - sequence)
-+ ret = ((atomic_read_unchecked(&dev_priv->fence_seq) - sequence)
+- ret = ((atomic_read(&dev_priv->marker_seq) - seqno)
++ ret = ((atomic_read_unchecked(&dev_priv->marker_seq) - seqno)
> VMW_FENCE_WRAP);
return ret;
-@@ -131,7 +131,7 @@ int vmw_fallback_wait(struct vmw_private *dev_priv,
+@@ -138,7 +138,7 @@ int vmw_fallback_wait(struct vmw_private *dev_priv,
if (fifo_idle)
down_read(&fifo_state->rwsem);
-- signal_seq = atomic_read(&dev_priv->fence_seq);
-+ signal_seq = atomic_read_unchecked(&dev_priv->fence_seq);
+- signal_seq = atomic_read(&dev_priv->marker_seq);
++ signal_seq = atomic_read_unchecked(&dev_priv->marker_seq);
ret = 0;
for (;;) {
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c b/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c
+index 8a8725c..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,
+ while (!vmw_lag_lt(queue, us)) {
+ spin_lock(&queue->lock);
+ if (list_empty(&queue->head))
+- seqno = atomic_read(&dev_priv->marker_seq);
++ seqno = atomic_read_unchecked(&dev_priv->marker_seq);
+ else {
+ 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 763797d..67a9f78 100644
+index af35384..5ab3c36 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
-@@ -1940,7 +1940,7 @@ static bool hid_ignore(struct hid_device *hdev)
+@@ -2000,7 +2000,7 @@ static bool hid_ignore(struct hid_device *hdev)
int hid_add_device(struct hid_device *hdev)
{
@@ -28170,7 +29074,7 @@ index 763797d..67a9f78 100644
int ret;
if (WARN_ON(hdev->status & HID_STAT_ADDED))
-@@ -1955,7 +1955,7 @@ int hid_add_device(struct hid_device *hdev)
+@@ -2015,7 +2015,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,
@@ -28180,7 +29084,7 @@ index 763797d..67a9f78 100644
hid_debug_register(hdev, dev_name(&hdev->dev));
ret = device_add(&hdev->dev);
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
-index 7c1188b..5a64357 100644
+index 4ef02b2..8a96831 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)
@@ -28192,6 +29096,64 @@ index 7c1188b..5a64357 100644
break;
for (i = 0; i < hid->maxcollection; i++)
+diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
+index 4065374..10ed7dc 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,
+ int ret = 0;
+ int t;
+
+- next_gpadl_handle = atomic_read(&vmbus_connection.next_gpadl_handle);
+- atomic_inc(&vmbus_connection.next_gpadl_handle);
++ next_gpadl_handle = atomic_read_unchecked(&vmbus_connection.next_gpadl_handle);
++ atomic_inc_unchecked(&vmbus_connection.next_gpadl_handle);
+
+ ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
+ if (ret)
+diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
+index 0fb100e..baf87e5 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)
+ u64 output_address = (output) ? virt_to_phys(output) : 0;
+ u32 output_address_hi = output_address >> 32;
+ u32 output_address_lo = output_address & 0xFFFFFFFF;
+- void *hypercall_page = hv_context.hypercall_page;
++ void *hypercall_page = ktva_ktla(hv_context.hypercall_page);
+
+ __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 0aee112..b72d21f 100644
+--- a/drivers/hv/hyperv_vmbus.h
++++ b/drivers/hv/hyperv_vmbus.h
+@@ -556,7 +556,7 @@ enum vmbus_connect_state {
+ struct vmbus_connection {
+ enum vmbus_connect_state conn_state;
+
+- atomic_t next_gpadl_handle;
++ atomic_unchecked_t next_gpadl_handle;
+
+ /*
+ * Represents channel interrupts. Each bit position represents a
+diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
+index d2d0a2a..90b8f4d 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)
+ {
+ int ret = 0;
+
+- static atomic_t device_num = ATOMIC_INIT(0);
++ static atomic_unchecked_t device_num = ATOMIC_INIT(0);
+
+ dev_set_name(&child_device_obj->device, "vmbus_0_%d",
+- atomic_inc_return(&device_num));
++ atomic_inc_return_unchecked(&device_num));
+
+ 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 66f6729..2d6de0a 100644
--- a/drivers/hwmon/acpi_power_meter.c
@@ -28206,7 +29168,7 @@ index 66f6729..2d6de0a 100644
mutex_lock(&resource->lock);
resource->trip[attr->index - 7] = temp;
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
-index cf4330b..8ea6aeb 100644
+index fe4104c..346febb 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -166,7 +166,7 @@ struct sht15_data {
@@ -28257,21 +29219,6 @@ index cf4330b..8ea6aeb 100644
return;
}
-diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c
-index 17cf1ab..8c2844e 100644
---- a/drivers/hwmon/w83791d.c
-+++ b/drivers/hwmon/w83791d.c
-@@ -329,8 +329,8 @@ static int w83791d_detect(struct i2c_client *client,
- struct i2c_board_info *info);
- static int w83791d_remove(struct i2c_client *client);
-
--static int w83791d_read(struct i2c_client *client, u8 register);
--static int w83791d_write(struct i2c_client *client, u8 register, u8 value);
-+static int w83791d_read(struct i2c_client *client, u8 reg);
-+static int w83791d_write(struct i2c_client *client, u8 reg, u8 value);
- static struct w83791d_data *w83791d_update_device(struct device *dev);
-
- #ifdef DEBUG
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
@@ -28416,10 +29363,10 @@ index 5059faf..18d4c85 100644
.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 3be60da..93c1104 100644
+index 847553f..3ffb49d 100644
--- a/drivers/ide/cy82c693.c
+++ b/drivers/ide/cy82c693.c
-@@ -161,7 +161,7 @@ static const struct ide_port_ops cy82c693_port_ops = {
+@@ -163,7 +163,7 @@ static const struct ide_port_ops cy82c693_port_ops = {
.set_dma_mode = cy82c693_set_dma_mode,
};
@@ -28541,10 +29488,10 @@ index 58c51cd..4aec3b8 100644
.name = DRV_NAME,
.init_chipset = init_chipset_hpt366,
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
-index 04b0956..f5b47dc 100644
+index 8126824..55a2798 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
-@@ -769,7 +769,7 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
+@@ -768,7 +768,7 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
alignment = queue_dma_alignment(q) | q->dma_pad_mask;
if ((unsigned long)buf & alignment
|| blk_rq_bytes(rq) & q->dma_pad_mask
@@ -28553,19 +29500,20 @@ index 04b0956..f5b47dc 100644
drive->dma = 0;
}
}
-diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
-index 61fdf54..2834ea6 100644
---- a/drivers/ide/ide-floppy.c
-+++ b/drivers/ide/ide-floppy.c
-@@ -379,6 +379,8 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
- u8 pc_buf[256], header_len, desc_cnt;
- int i, rc = 1, blocks, length;
-
-+ pax_track_stack();
-+
- ide_debug_log(IDE_DBG_FUNC, "enter");
+diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c
+index d267b7a..a22ca84 100644
+--- a/drivers/ide/ide-floppy_ioctl.c
++++ b/drivers/ide/ide-floppy_ioctl.c
+@@ -292,8 +292,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev,
+ * and CDROM_SEND_PACKET (legacy) ioctls
+ */
+ if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND)
+- err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk,
+- mode, cmd, argp);
++ err = scsi_cmd_blk_ioctl(bdev, mode, cmd, argp);
- drive->bios_cyl = 0;
+ if (err == -ENOTTY)
+ err = generic_ide_ioctl(drive, bdev, cmd, arg);
diff --git a/drivers/ide/ide-pci-generic.c b/drivers/ide/ide-pci-generic.c
index a743e68..1cfd674 100644
--- a/drivers/ide/ide-pci-generic.c
@@ -28684,7 +29632,7 @@ index 3a35ec6..5634510 100644
.name = DRV_NAME,
.init_chipset = init_chipset_pdc202xx,
diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c
-index b59d04c..368c2a7 100644
+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 = {
@@ -28748,19 +29696,6 @@ index 35fb8da..24d72ef 100644
{ /* 0: OSB4 */
.name = DRV_NAME,
.init_chipset = init_chipset_svwks,
-diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
-index ab3db61..afed580 100644
---- a/drivers/ide/setup-pci.c
-+++ b/drivers/ide/setup-pci.c
-@@ -542,6 +542,8 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2,
- int ret, i, n_ports = dev2 ? 4 : 2;
- struct ide_hw hw[4], *hws[] = { NULL, NULL, NULL, NULL };
-
-+ pax_track_stack();
-+
- for (i = 0; i < n_ports / 2; i++) {
- ret = ide_setup_pci_controller(pdev[i], d, !i);
- if (ret < 0)
diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c
index ddeda44..46f7e30 100644
--- a/drivers/ide/siimage.c
@@ -28814,10 +29749,10 @@ index 864ffe0..863a5e9 100644
.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 e444d24..ba577de 100644
+index 4799d5c..1794678 100644
--- a/drivers/ide/tc86c001.c
+++ b/drivers/ide/tc86c001.c
-@@ -191,7 +191,7 @@ static const struct ide_dma_ops tc86c001_dma_ops = {
+@@ -192,7 +192,7 @@ static const struct ide_dma_ops tc86c001_dma_ops = {
.dma_sff_read_status = ide_dma_sff_read_status,
};
@@ -28827,7 +29762,7 @@ index e444d24..ba577de 100644
.init_hwif = init_hwif_tc86c001,
.port_ops = &tc86c001_port_ops,
diff --git a/drivers/ide/triflex.c b/drivers/ide/triflex.c
-index e53a1b7..d11aff7 100644
+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 = {
@@ -28865,11 +29800,24 @@ index f46f49c..eb77678 100644
.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 eb0e2cc..14241c7 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;
+
+ priv = netdev_priv(dev);
+ priv->phy = phy;
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
-index fc0f2bd..ac2f8a5 100644
+index 8b72f39..55df4c8 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
-@@ -113,7 +113,7 @@ static char const counter_group_names[CM_COUNTER_GROUPS]
+@@ -114,7 +114,7 @@ static char const counter_group_names[CM_COUNTER_GROUPS]
struct cm_counter_group {
struct kobject obj;
@@ -28878,7 +29826,7 @@ index fc0f2bd..ac2f8a5 100644
};
struct cm_counter_attribute {
-@@ -1387,7 +1387,7 @@ static void cm_dup_req_handler(struct cm_work *work,
+@@ -1394,7 +1394,7 @@ static void cm_dup_req_handler(struct cm_work *work,
struct ib_mad_send_buf *msg = NULL;
int ret;
@@ -28887,7 +29835,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_REQ_COUNTER]);
/* Quick state check to discard duplicate REQs. */
-@@ -1765,7 +1765,7 @@ static void cm_dup_rep_handler(struct cm_work *work)
+@@ -1778,7 +1778,7 @@ static void cm_dup_rep_handler(struct cm_work *work)
if (!cm_id_priv)
return;
@@ -28896,7 +29844,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_REP_COUNTER]);
ret = cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg);
if (ret)
-@@ -1932,7 +1932,7 @@ static int cm_rtu_handler(struct cm_work *work)
+@@ -1945,7 +1945,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);
@@ -28905,7 +29853,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_RTU_COUNTER]);
goto out;
}
-@@ -2115,7 +2115,7 @@ static int cm_dreq_handler(struct cm_work *work)
+@@ -2128,7 +2128,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) {
@@ -28914,7 +29862,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_DREQ_COUNTER]);
cm_issue_drep(work->port, work->mad_recv_wc);
return -EINVAL;
-@@ -2140,7 +2140,7 @@ static int cm_dreq_handler(struct cm_work *work)
+@@ -2153,7 +2153,7 @@ static int cm_dreq_handler(struct cm_work *work)
case IB_CM_MRA_REP_RCVD:
break;
case IB_CM_TIMEWAIT:
@@ -28923,7 +29871,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_DREQ_COUNTER]);
if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg))
goto unlock;
-@@ -2154,7 +2154,7 @@ static int cm_dreq_handler(struct cm_work *work)
+@@ -2167,7 +2167,7 @@ static int cm_dreq_handler(struct cm_work *work)
cm_free_msg(msg);
goto deref;
case IB_CM_DREQ_RCVD:
@@ -28932,7 +29880,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_DREQ_COUNTER]);
goto unlock;
default:
-@@ -2521,7 +2521,7 @@ static int cm_mra_handler(struct cm_work *work)
+@@ -2534,7 +2534,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)
@@ -28941,7 +29889,7 @@ index fc0f2bd..ac2f8a5 100644
counter_group[CM_RECV_DUPLICATES].
counter[CM_MRA_COUNTER]);
goto out;
-@@ -2530,7 +2530,7 @@ static int cm_mra_handler(struct cm_work *work)
+@@ -2543,7 +2543,7 @@ static int cm_mra_handler(struct cm_work *work)
break;
case IB_CM_MRA_REQ_RCVD:
case IB_CM_MRA_REP_RCVD:
@@ -28950,7 +29898,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_MRA_COUNTER]);
/* fall through */
default:
-@@ -2692,7 +2692,7 @@ static int cm_lap_handler(struct cm_work *work)
+@@ -2705,7 +2705,7 @@ static int cm_lap_handler(struct cm_work *work)
case IB_CM_LAP_IDLE:
break;
case IB_CM_MRA_LAP_SENT:
@@ -28959,7 +29907,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_LAP_COUNTER]);
if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg))
goto unlock;
-@@ -2708,7 +2708,7 @@ static int cm_lap_handler(struct cm_work *work)
+@@ -2721,7 +2721,7 @@ static int cm_lap_handler(struct cm_work *work)
cm_free_msg(msg);
goto deref;
case IB_CM_LAP_RCVD:
@@ -28968,7 +29916,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_LAP_COUNTER]);
goto unlock;
default:
-@@ -2992,7 +2992,7 @@ static int cm_sidr_req_handler(struct cm_work *work)
+@@ -3005,7 +3005,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);
@@ -28977,7 +29925,7 @@ index fc0f2bd..ac2f8a5 100644
counter[CM_SIDR_REQ_COUNTER]);
goto out; /* Duplicate message. */
}
-@@ -3204,10 +3204,10 @@ static void cm_send_handler(struct ib_mad_agent *mad_agent,
+@@ -3217,10 +3217,10 @@ static void cm_send_handler(struct ib_mad_agent *mad_agent,
if (!msg->context[0] && (attr_index != CM_REJ_COUNTER))
msg->retries = 1;
@@ -28990,7 +29938,7 @@ index fc0f2bd..ac2f8a5 100644
&port->counter_group[CM_XMIT_RETRIES].
counter[attr_index]);
-@@ -3417,7 +3417,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent,
+@@ -3430,7 +3430,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);
@@ -28999,7 +29947,7 @@ index fc0f2bd..ac2f8a5 100644
counter[attr_id - CM_ATTR_ID_OFFSET]);
work = kmalloc(sizeof *work + sizeof(struct ib_sa_path_rec) * paths,
-@@ -3615,7 +3615,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr,
+@@ -3635,7 +3635,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",
@@ -29009,10 +29957,10 @@ index fc0f2bd..ac2f8a5 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 4507043..14ad522 100644
+index 176c8f9..2627b62 100644
--- a/drivers/infiniband/core/fmr_pool.c
+++ b/drivers/infiniband/core/fmr_pool.c
-@@ -97,8 +97,8 @@ struct ib_fmr_pool {
+@@ -98,8 +98,8 @@ struct ib_fmr_pool {
struct task_struct *thread;
@@ -29023,7 +29971,7 @@ index 4507043..14ad522 100644
wait_queue_head_t force_wait;
};
-@@ -179,10 +179,10 @@ static int ib_fmr_cleanup_thread(void *pool_ptr)
+@@ -180,10 +180,10 @@ static int ib_fmr_cleanup_thread(void *pool_ptr)
struct ib_fmr_pool *pool = pool_ptr;
do {
@@ -29036,7 +29984,7 @@ index 4507043..14ad522 100644
wake_up_interruptible(&pool->force_wait);
if (pool->flush_function)
-@@ -190,7 +190,7 @@ static int ib_fmr_cleanup_thread(void *pool_ptr)
+@@ -191,7 +191,7 @@ static int ib_fmr_cleanup_thread(void *pool_ptr)
}
set_current_state(TASK_INTERRUPTIBLE);
@@ -29045,7 +29993,7 @@ index 4507043..14ad522 100644
!kthread_should_stop())
schedule();
__set_current_state(TASK_RUNNING);
-@@ -282,8 +282,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
+@@ -283,8 +283,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);
@@ -29056,7 +30004,7 @@ index 4507043..14ad522 100644
init_waitqueue_head(&pool->force_wait);
pool->thread = kthread_run(ib_fmr_cleanup_thread,
-@@ -411,11 +411,11 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool)
+@@ -412,11 +412,11 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool)
}
spin_unlock_irq(&pool->pool_lock);
@@ -29070,7 +30018,7 @@ index 4507043..14ad522 100644
return -EINTR;
return 0;
-@@ -525,7 +525,7 @@ int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr)
+@@ -526,7 +526,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) {
@@ -29080,7 +30028,7 @@ index 4507043..14ad522 100644
}
}
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
-index 0347eed..0f0e4b1 100644
+index 40c8353..946b0e4 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,
@@ -29101,19 +30049,6 @@ index 0347eed..0f0e4b1 100644
}
PDBG("%s stag_state 0x%0x type 0x%0x pdid 0x%0x, stag_idx 0x%x\n",
__func__, stag_state, type, pdid, stag_idx);
-diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
-index 31ae1b1..2f5b038 100644
---- a/drivers/infiniband/hw/ipath/ipath_fs.c
-+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
-@@ -113,6 +113,8 @@ static ssize_t atomic_counters_read(struct file *file, char __user *buf,
- struct infinipath_counters counters;
- struct ipath_devdata *dd;
-
-+ pax_track_stack();
-+
- dd = file->f_path.dentry->d_inode->i_private;
- dd->ipath_f_read_counters(dd, &counters);
-
diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c b/drivers/infiniband/hw/ipath/ipath_rc.c
index 79b3dbc..96e5fcc 100644
--- a/drivers/infiniband/hw/ipath/ipath_rc.c
@@ -29169,7 +30104,7 @@ index 1f95bba..9530f87 100644
sdata, wqe->wr.wr.atomic.swap);
goto send_comp;
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
-index 2d668c6..3312bb7 100644
+index 5965b3d..16817fb 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");
@@ -29181,7 +30116,7 @@ index 2d668c6..3312bb7 100644
static unsigned int ee_flsh_adapter;
static unsigned int sysfs_nonidx_addr;
-@@ -275,7 +275,7 @@ static void nes_cqp_rem_ref_callback(struct nes_device *nesdev, struct nes_cqp_r
+@@ -272,7 +272,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;
@@ -29191,10 +30126,10 @@ index 2d668c6..3312bb7 100644
/* Free the control structures */
diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
-index 6fe7987..68637b5 100644
+index 568b4f1..5ea3eff 100644
--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
-@@ -175,17 +175,17 @@ extern unsigned int nes_debug_level;
+@@ -178,17 +178,17 @@ extern unsigned int nes_debug_level;
extern unsigned int wqm_quanta;
extern struct list_head nes_adapter_list;
@@ -29223,7 +30158,7 @@ index 6fe7987..68637b5 100644
extern u32 mh_detected;
extern u32 mh_pauses_sent;
extern u32 cm_packets_sent;
-@@ -194,14 +194,14 @@ extern u32 cm_packets_created;
+@@ -197,16 +197,16 @@ extern u32 cm_packets_created;
extern u32 cm_packets_received;
extern u32 cm_packets_dropped;
extern u32 cm_packets_retrans;
@@ -29237,16 +30172,20 @@ index 6fe7987..68637b5 100644
-extern atomic_t cm_nodes_destroyed;
-extern atomic_t cm_accel_dropped_pkts;
-extern atomic_t cm_resets_recvd;
+-extern atomic_t pau_qps_created;
+-extern atomic_t pau_qps_destroyed;
+extern atomic_unchecked_t cm_loopbacks;
+extern atomic_unchecked_t cm_nodes_created;
+extern atomic_unchecked_t cm_nodes_destroyed;
+extern atomic_unchecked_t cm_accel_dropped_pkts;
+extern atomic_unchecked_t cm_resets_recvd;
++extern atomic_unchecked_t pau_qps_created;
++extern atomic_unchecked_t pau_qps_destroyed;
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 e74cdf9..4b5ca90 100644
+index 0a52d72..0642f36 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;
@@ -29269,9 +30208,9 @@ index e74cdf9..4b5ca90 100644
+atomic_unchecked_t cm_accel_dropped_pkts;
+atomic_unchecked_t cm_resets_recvd;
- static inline int mini_cm_accelerated(struct nes_cm_core *,
- struct nes_cm_node *);
-@@ -151,13 +151,13 @@ static struct nes_cm_ops nes_cm_api = {
+ static inline int mini_cm_accelerated(struct nes_cm_core *, struct nes_cm_node *);
+ static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *, struct nes_vnic *, struct nes_cm_info *);
+@@ -148,13 +148,13 @@ static struct nes_cm_ops nes_cm_api = {
static struct nes_cm_core *g_cm_core;
@@ -29290,9 +30229,9 @@ index e74cdf9..4b5ca90 100644
+atomic_unchecked_t cm_connect_reqs;
+atomic_unchecked_t cm_rejects;
-
- /**
-@@ -1045,7 +1045,7 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core,
+ int nes_add_ref_cm_node(struct nes_cm_node *cm_node)
+ {
+@@ -1271,7 +1271,7 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core,
kfree(listener);
listener = NULL;
ret = 0;
@@ -29301,7 +30240,7 @@ index e74cdf9..4b5ca90 100644
} else {
spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
}
-@@ -1240,7 +1240,7 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
+@@ -1473,7 +1473,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);
@@ -29310,7 +30249,7 @@ index e74cdf9..4b5ca90 100644
return cm_node;
}
-@@ -1298,7 +1298,7 @@ static int rem_ref_cm_node(struct nes_cm_core *cm_core,
+@@ -1531,7 +1531,7 @@ static int rem_ref_cm_node(struct nes_cm_core *cm_core,
}
atomic_dec(&cm_core->node_cnt);
@@ -29319,7 +30258,7 @@ index e74cdf9..4b5ca90 100644
nesqp = cm_node->nesqp;
if (nesqp) {
nesqp->cm_node = NULL;
-@@ -1365,7 +1365,7 @@ static int process_options(struct nes_cm_node *cm_node, u8 *optionsloc,
+@@ -1595,7 +1595,7 @@ static int process_options(struct nes_cm_node *cm_node, u8 *optionsloc,
static void drop_packet(struct sk_buff *skb)
{
@@ -29328,7 +30267,7 @@ index e74cdf9..4b5ca90 100644
dev_kfree_skb_any(skb);
}
-@@ -1428,7 +1428,7 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb,
+@@ -1658,7 +1658,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.. */
@@ -29337,7 +30276,7 @@ index e74cdf9..4b5ca90 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));
-@@ -2057,7 +2057,7 @@ static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core,
+@@ -2299,7 +2299,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;
}
@@ -29346,16 +30285,16 @@ index e74cdf9..4b5ca90 100644
loopbackremotenode->loopbackpartner = cm_node;
loopbackremotenode->tcp_cntxt.rcv_wscale =
NES_CM_DEFAULT_RCV_WND_SCALE;
-@@ -2332,7 +2332,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core,
- add_ref_cm_node(cm_node);
- } else if (cm_node->state == NES_CM_STATE_TSA) {
- rem_ref_cm_node(cm_core, cm_node);
-- atomic_inc(&cm_accel_dropped_pkts);
-+ atomic_inc_unchecked(&cm_accel_dropped_pkts);
- dev_kfree_skb_any(skb);
+@@ -2574,7 +2574,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);
+- atomic_inc(&cm_accel_dropped_pkts);
++ atomic_inc_unchecked(&cm_accel_dropped_pkts);
+ dev_kfree_skb_any(skb);
+ }
break;
- }
-@@ -2638,7 +2638,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
+@@ -2880,7 +2880,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
if ((cm_id) && (cm_id->event_handler)) {
if (issue_disconn) {
@@ -29364,7 +30303,7 @@ index e74cdf9..4b5ca90 100644
cm_event.event = IW_CM_EVENT_DISCONNECT;
cm_event.status = disconn_status;
cm_event.local_addr = cm_id->local_addr;
-@@ -2660,7 +2660,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
+@@ -2902,7 +2902,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
}
if (issue_close) {
@@ -29373,7 +30312,7 @@ index e74cdf9..4b5ca90 100644
nes_disconnect(nesqp, 1);
cm_id->provider_data = nesqp;
-@@ -2791,7 +2791,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
+@@ -3038,7 +3038,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);
@@ -29382,25 +30321,25 @@ index e74cdf9..4b5ca90 100644
nes_debug(NES_DBG_CM, "netdev refcnt = %u.\n",
netdev_refcnt_read(nesvnic->netdev));
-@@ -3001,7 +3001,7 @@ int nes_reject(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
-
+@@ -3240,7 +3240,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;
- atomic_inc(&cm_rejects);
+ atomic_inc_unchecked(&cm_rejects);
- cm_node = (struct nes_cm_node *) cm_id->provider_data;
+ cm_node = (struct nes_cm_node *)cm_id->provider_data;
loopback = cm_node->loopbackpartner;
cm_core = cm_node->cm_core;
-@@ -3067,7 +3067,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));
+@@ -3300,7 +3300,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));
- atomic_inc(&cm_connects);
+ atomic_inc_unchecked(&cm_connects);
nesqp->active_conn = 1;
/* cache the cm_id in the qp */
-@@ -3173,7 +3173,7 @@ int nes_create_listen(struct iw_cm_id *cm_id, int backlog)
+@@ -3406,7 +3406,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;
}
@@ -29409,16 +30348,16 @@ index e74cdf9..4b5ca90 100644
}
cm_id->add_ref(cm_id);
-@@ -3278,7 +3278,7 @@ static void cm_event_connected(struct nes_cm_event *event)
- if (nesqp->destroyed) {
+@@ -3507,7 +3507,7 @@ static void cm_event_connected(struct nes_cm_event *event)
+
+ if (nesqp->destroyed)
return;
- }
- atomic_inc(&cm_connecteds);
+ atomic_inc_unchecked(&cm_connecteds);
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,
-@@ -3493,7 +3493,7 @@ static void cm_event_reset(struct nes_cm_event *event)
+ " local port 0x%04X. jiffies = %lu.\n",
+ nesqp->hwqp.qp_id,
+@@ -3694,7 +3694,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);
@@ -29427,29 +30366,62 @@ index e74cdf9..4b5ca90 100644
cm_event.event = IW_CM_EVENT_CLOSE;
cm_event.status = 0;
cm_event.provider_data = cm_id->provider_data;
-@@ -3529,7 +3529,7 @@ static void cm_event_mpa_req(struct nes_cm_event *event)
+@@ -3730,7 +3730,7 @@ static void cm_event_mpa_req(struct nes_cm_event *event)
return;
cm_id = cm_node->cm_id;
- atomic_inc(&cm_connect_reqs);
+ atomic_inc_unchecked(&cm_connect_reqs);
nes_debug(NES_DBG_CM, "cm_node = %p - cm_id = %p, jiffies = %lu\n",
- cm_node, cm_id, jiffies);
+ cm_node, cm_id, jiffies);
-@@ -3567,7 +3567,7 @@ static void cm_event_mpa_reject(struct nes_cm_event *event)
+@@ -3770,7 +3770,7 @@ static void cm_event_mpa_reject(struct nes_cm_event *event)
return;
cm_id = cm_node->cm_id;
- atomic_inc(&cm_connect_reqs);
+ atomic_inc_unchecked(&cm_connect_reqs);
nes_debug(NES_DBG_CM, "cm_node = %p - cm_id = %p, jiffies = %lu\n",
- cm_node, cm_id, jiffies);
+ cm_node, cm_id, jiffies);
+
+diff --git a/drivers/infiniband/hw/nes/nes_mgt.c b/drivers/infiniband/hw/nes/nes_mgt.c
+index b3b2a24..7bfaf1e 100644
+--- a/drivers/infiniband/hw/nes/nes_mgt.c
++++ b/drivers/infiniband/hw/nes/nes_mgt.c
+@@ -40,8 +40,8 @@
+ #include "nes.h"
+ #include "nes_mgt.h"
+
+-atomic_t pau_qps_created;
+-atomic_t pau_qps_destroyed;
++atomic_unchecked_t pau_qps_created;
++atomic_unchecked_t pau_qps_destroyed;
+
+ static void nes_replenish_mgt_rq(struct nes_vnic_mgt *mgtvnic)
+ {
+@@ -621,7 +621,7 @@ void nes_destroy_pau_qp(struct nes_device *nesdev, struct nes_qp *nesqp)
+ {
+ struct sk_buff *skb;
+ unsigned long flags;
+- atomic_inc(&pau_qps_destroyed);
++ atomic_inc_unchecked(&pau_qps_destroyed);
+
+ /* 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 *
+ cq->cq_vbase[head].cqe_words[NES_NIC_CQE_HASH_RCVNXT]);
+ skb_queue_head_init(&nesqp->pau_list);
+ spin_lock_init(&nesqp->pau_lock);
+- atomic_inc(&pau_qps_created);
++ atomic_inc_unchecked(&pau_qps_created);
+ nes_change_quad_hash(nesdev, mgtvnic->nesvnic, nesqp);
+ }
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
-index d3a1c41..2356add 100644
+index c00d2f3..8834298 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
-@@ -1274,31 +1274,31 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev,
+@@ -1277,39 +1277,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;
@@ -29499,8 +30471,18 @@ index d3a1c41..2356add 100644
target_stat_values[++index] = nesadapter->free_4kpbl;
target_stat_values[++index] = nesadapter->free_256pbl;
target_stat_values[++index] = int_mod_timer_init;
+ target_stat_values[++index] = nesvnic->lro_mgr.stats.aggregated;
+ target_stat_values[++index] = nesvnic->lro_mgr.stats.flushed;
+ target_stat_values[++index] = nesvnic->lro_mgr.stats.no_desc;
+- target_stat_values[++index] = atomic_read(&pau_qps_created);
+- target_stat_values[++index] = atomic_read(&pau_qps_destroyed);
++ target_stat_values[++index] = atomic_read_unchecked(&pau_qps_created);
++ target_stat_values[++index] = atomic_read_unchecked(&pau_qps_destroyed);
+ }
+
+ /**
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
-index 95ca93c..c992848 100644
+index 5095bc4..41e8fff 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -46,9 +46,9 @@
@@ -29516,7 +30498,7 @@ index 95ca93c..c992848 100644
static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev);
-@@ -1141,7 +1141,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
+@@ -1131,7 +1131,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
if (init_attr->create_flags)
return ERR_PTR(-EINVAL);
@@ -29525,9 +30507,9 @@ index 95ca93c..c992848 100644
switch (init_attr->qp_type) {
case IB_QPT_RC:
if (nes_drv_opt & NES_DRV_OPT_NO_INLINE_DATA) {
-@@ -1470,7 +1470,7 @@ static int nes_destroy_qp(struct ib_qp *ibqp)
+@@ -1460,7 +1460,7 @@ static int nes_destroy_qp(struct ib_qp *ibqp)
struct iw_cm_event cm_event;
- int ret;
+ int ret = 0;
- atomic_inc(&sw_qps_destroyed);
+ atomic_inc_unchecked(&sw_qps_destroyed);
@@ -29535,7 +30517,7 @@ index 95ca93c..c992848 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 769a1d9..7807648 100644
+index b881bdc..c2e360c 100644
--- a/drivers/infiniband/hw/qib/qib.h
+++ b/drivers/infiniband/hw/qib/qib.h
@@ -51,6 +51,7 @@
@@ -29547,7 +30529,7 @@ index 769a1d9..7807648 100644
#include "qib_common.h"
#include "qib_verbs.h"
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
-index 5b8f59d..7f36886 100644
+index c351aa4..e6967c2 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -488,14 +488,14 @@ EXPORT_SYMBOL(gameport_set_phys);
@@ -29590,7 +30572,7 @@ index da38d97..2aa0b79 100644
error = device_add(&dev->dev);
if (error)
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
-index b8d8611..15f8d2c 100644
+index b8d8611..7a4a04b 100644
--- a/drivers/input/joystick/sidewinder.c
+++ b/drivers/input/joystick/sidewinder.c
@@ -30,6 +30,7 @@
@@ -29601,20 +30583,11 @@ index b8d8611..15f8d2c 100644
#include <linux/init.h>
#include <linux/input.h>
#include <linux/gameport.h>
-@@ -428,6 +429,8 @@ static int sw_read(struct sw *sw)
- unsigned char buf[SW_LENGTH];
- int i;
-
-+ pax_track_stack();
-+
- i = sw_read_packet(sw->gameport, buf, sw->length, 0);
-
- if (sw->type == SW_ID_3DP && sw->length == 66 && i != 66) { /* Broken packet, try to fix */
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
-index 56abf3d..d8dd85d 100644
+index d728875..844c89b 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
-@@ -689,7 +689,7 @@ static void xpad_led_set(struct led_classdev *led_cdev,
+@@ -710,7 +710,7 @@ static void xpad_led_set(struct led_classdev *led_cdev,
static int xpad_led_probe(struct usb_xpad *xpad)
{
@@ -29623,7 +30596,7 @@ index 56abf3d..d8dd85d 100644
long led_no;
struct xpad_led *led;
struct led_classdev *led_cdev;
-@@ -702,7 +702,7 @@ static int xpad_led_probe(struct usb_xpad *xpad)
+@@ -723,7 +723,7 @@ static int xpad_led_probe(struct usb_xpad *xpad)
if (!led)
return -ENOMEM;
@@ -29722,13 +30695,13 @@ index db621db..825ea1a 100644
cs->tty = NULL;
cs->tty_dev = NULL;
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
-index 6dd3607..b66e23e 100644
+index 212efaf..f187c6b 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -35,6 +35,7 @@
#include <linux/tty_driver.h>
#include <linux/list.h>
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
+#include <asm/local.h>
#define GIG_VERSION {0, 5, 0, 0}
@@ -29743,10 +30716,10 @@ index 6dd3607..b66e23e 100644
struct tasklet_struct if_wake_tasklet;
unsigned control_state;
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
-index e35058b..5898a8b 100644
+index ee0a549..a7c9798 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
-@@ -162,9 +162,7 @@ static int if_open(struct tty_struct *tty, struct file *filp)
+@@ -163,9 +163,7 @@ static int if_open(struct tty_struct *tty, struct file *filp)
}
tty->driver_data = cs;
@@ -29757,7 +30730,7 @@ index e35058b..5898a8b 100644
spin_lock_irqsave(&cs->lock, flags);
cs->tty = tty;
spin_unlock_irqrestore(&cs->lock, flags);
-@@ -192,10 +190,10 @@ static void if_close(struct tty_struct *tty, struct file *filp)
+@@ -193,10 +191,10 @@ static void if_close(struct tty_struct *tty, struct file *filp)
if (!cs->connected)
gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */
@@ -29770,7 +30743,7 @@ index e35058b..5898a8b 100644
spin_lock_irqsave(&cs->lock, flags);
cs->tty = NULL;
spin_unlock_irqrestore(&cs->lock, flags);
-@@ -230,7 +228,7 @@ static int if_ioctl(struct tty_struct *tty,
+@@ -231,7 +229,7 @@ static int if_ioctl(struct tty_struct *tty,
if (!cs->connected) {
gig_dbg(DEBUG_IF, "not connected");
retval = -ENODEV;
@@ -29779,7 +30752,7 @@ index e35058b..5898a8b 100644
dev_warn(cs->dev, "%s: device not opened\n", __func__);
else {
retval = 0;
-@@ -360,7 +358,7 @@ static int if_write(struct tty_struct *tty, const unsigned char *buf, int count)
+@@ -361,7 +359,7 @@ static int if_write(struct tty_struct *tty, const unsigned char *buf, int count)
retval = -ENODEV;
goto done;
}
@@ -29788,7 +30761,7 @@ index e35058b..5898a8b 100644
dev_warn(cs->dev, "%s: device not opened\n", __func__);
retval = -ENODEV;
goto done;
-@@ -413,7 +411,7 @@ static int if_write_room(struct tty_struct *tty)
+@@ -414,7 +412,7 @@ static int if_write_room(struct tty_struct *tty)
if (!cs->connected) {
gig_dbg(DEBUG_IF, "not connected");
retval = -ENODEV;
@@ -29797,7 +30770,7 @@ index e35058b..5898a8b 100644
dev_warn(cs->dev, "%s: device not opened\n", __func__);
else if (cs->mstate != MS_LOCKED) {
dev_warn(cs->dev, "can't write to unlocked device\n");
-@@ -443,7 +441,7 @@ static int if_chars_in_buffer(struct tty_struct *tty)
+@@ -444,7 +442,7 @@ static int if_chars_in_buffer(struct tty_struct *tty)
if (!cs->connected)
gig_dbg(DEBUG_IF, "not connected");
@@ -29806,7 +30779,7 @@ index e35058b..5898a8b 100644
dev_warn(cs->dev, "%s: device not opened\n", __func__);
else if (cs->mstate != MS_LOCKED)
dev_warn(cs->dev, "can't write to unlocked device\n");
-@@ -471,7 +469,7 @@ static void if_throttle(struct tty_struct *tty)
+@@ -472,7 +470,7 @@ static void if_throttle(struct tty_struct *tty)
if (!cs->connected)
gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */
@@ -29815,7 +30788,7 @@ index e35058b..5898a8b 100644
dev_warn(cs->dev, "%s: device not opened\n", __func__);
else
gig_dbg(DEBUG_IF, "%s: not implemented\n", __func__);
-@@ -495,7 +493,7 @@ static void if_unthrottle(struct tty_struct *tty)
+@@ -496,7 +494,7 @@ static void if_unthrottle(struct tty_struct *tty)
if (!cs->connected)
gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */
@@ -29824,7 +30797,7 @@ index e35058b..5898a8b 100644
dev_warn(cs->dev, "%s: device not opened\n", __func__);
else
gig_dbg(DEBUG_IF, "%s: not implemented\n", __func__);
-@@ -526,7 +524,7 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
+@@ -527,7 +525,7 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
goto out;
}
@@ -29855,57 +30828,6 @@ index 2a57da59..e7a12ed 100644
return -EFAULT;
} else {
memcpy(buf, dp, left);
-diff --git a/drivers/isdn/hardware/eicon/capidtmf.c b/drivers/isdn/hardware/eicon/capidtmf.c
-index f130724..c373c68 100644
---- a/drivers/isdn/hardware/eicon/capidtmf.c
-+++ b/drivers/isdn/hardware/eicon/capidtmf.c
-@@ -498,6 +498,7 @@ void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word leng
- byte goertzel_result_buffer[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
- short windowed_sample_buffer[CAPIDTMF_RECV_WINDOWED_SAMPLES];
-
-+ pax_track_stack();
-
- if (p_state->recv.state & CAPIDTMF_RECV_STATE_DTMF_ACTIVE)
- {
-diff --git a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c
-index 4d425c6..a9be6c4 100644
---- a/drivers/isdn/hardware/eicon/capifunc.c
-+++ b/drivers/isdn/hardware/eicon/capifunc.c
-@@ -1055,6 +1055,8 @@ static int divacapi_connect_didd(void)
- IDI_SYNC_REQ req;
- DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
-
-+ pax_track_stack();
-+
- DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
-
- for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff --git a/drivers/isdn/hardware/eicon/diddfunc.c b/drivers/isdn/hardware/eicon/diddfunc.c
-index 3029234..ef0d9e2 100644
---- a/drivers/isdn/hardware/eicon/diddfunc.c
-+++ b/drivers/isdn/hardware/eicon/diddfunc.c
-@@ -54,6 +54,8 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
- IDI_SYNC_REQ req;
- DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
-
-+ pax_track_stack();
-+
- DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
-
- for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff --git a/drivers/isdn/hardware/eicon/divasfunc.c b/drivers/isdn/hardware/eicon/divasfunc.c
-index 0bbee78..a0d0a01 100644
---- a/drivers/isdn/hardware/eicon/divasfunc.c
-+++ b/drivers/isdn/hardware/eicon/divasfunc.c
-@@ -160,6 +160,8 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
- IDI_SYNC_REQ req;
- DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
-
-+ pax_track_stack();
-+
- DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
-
- for (x = 0; x < MAX_DESCRIPTORS; x++) {
diff --git a/drivers/isdn/hardware/eicon/divasync.h b/drivers/isdn/hardware/eicon/divasync.h
index 85784a7..a19ca98 100644
--- a/drivers/isdn/hardware/eicon/divasync.h
@@ -29919,72 +30841,6 @@ index 85784a7..a19ca98 100644
typedef struct _diva_didd_read_adapter_array {
void * buffer;
dword length;
-diff --git a/drivers/isdn/hardware/eicon/idifunc.c b/drivers/isdn/hardware/eicon/idifunc.c
-index db87d51..7d09acf 100644
---- a/drivers/isdn/hardware/eicon/idifunc.c
-+++ b/drivers/isdn/hardware/eicon/idifunc.c
-@@ -188,6 +188,8 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
- IDI_SYNC_REQ req;
- DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
-
-+ pax_track_stack();
-+
- DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
-
- for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
-index a339598..b6a8bfc 100644
---- a/drivers/isdn/hardware/eicon/message.c
-+++ b/drivers/isdn/hardware/eicon/message.c
-@@ -4886,6 +4886,8 @@ static void sig_ind(PLCI *plci)
- dword d;
- word w;
-
-+ pax_track_stack();
-+
- a = plci->adapter;
- Id = ((word)plci->Id<<8)|a->Id;
- PUT_WORD(&SS_Ind[4],0x0000);
-@@ -7480,6 +7482,8 @@ static word add_b1(PLCI *plci, API_PARSE *bp, word b_channel_info,
- word j, n, w;
- dword d;
-
-+ pax_track_stack();
-+
-
- for(i=0;i<8;i++) bp_parms[i].length = 0;
- for(i=0;i<2;i++) global_config[i].length = 0;
-@@ -7954,6 +7958,8 @@ static word add_b23(PLCI *plci, API_PARSE *bp)
- const byte llc3[] = {4,3,2,2,6,6,0};
- const byte header[] = {0,2,3,3,0,0,0};
-
-+ pax_track_stack();
-+
- for(i=0;i<8;i++) bp_parms[i].length = 0;
- for(i=0;i<6;i++) b2_config_parms[i].length = 0;
- for(i=0;i<5;i++) b3_config_parms[i].length = 0;
-@@ -14741,6 +14747,8 @@ static void group_optimization(DIVA_CAPI_ADAPTER * a, PLCI * plci)
- word appl_number_group_type[MAX_APPL];
- PLCI *auxplci;
-
-+ pax_track_stack();
-+
- set_group_ind_mask (plci); /* all APPLs within this inc. call are allowed to dial in */
-
- if(!a->group_optimization_enabled)
-diff --git a/drivers/isdn/hardware/eicon/mntfunc.c b/drivers/isdn/hardware/eicon/mntfunc.c
-index a564b75..f3cf8b5 100644
---- a/drivers/isdn/hardware/eicon/mntfunc.c
-+++ b/drivers/isdn/hardware/eicon/mntfunc.c
-@@ -79,6 +79,8 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
- IDI_SYNC_REQ req;
- DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
-
-+ pax_track_stack();
-+
- DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
-
- for (x = 0; x < MAX_DESCRIPTORS; x++) {
diff --git a/drivers/isdn/hardware/eicon/xdi_adapter.h b/drivers/isdn/hardware/eicon/xdi_adapter.h
index a3bd163..8956575 100644
--- a/drivers/isdn/hardware/eicon/xdi_adapter.h
@@ -29998,19 +30854,6 @@ index a3bd163..8956575 100644
typedef struct _diva_os_xdi_adapter {
struct list_head link;
-diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
-index 6ed82ad..b05ac05 100644
---- a/drivers/isdn/i4l/isdn_common.c
-+++ b/drivers/isdn/i4l/isdn_common.c
-@@ -1286,6 +1286,8 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
- } iocpar;
- void __user *argp = (void __user *)arg;
-
-+ pax_track_stack();
-+
- #define name iocpar.name
- #define bname iocpar.bname
- #define iocts iocpar.iocts
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
index 1f355bb..43f1fea 100644
--- a/drivers/isdn/icn/icn.c
@@ -30025,7 +30868,7 @@ index 1f355bb..43f1fea 100644
} else
memcpy(msg, buf, count);
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
-index efa2024..2e18d14 100644
+index b5fdcb7..5b6c59f 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -92,9 +92,17 @@ static __init int map_switcher(void)
@@ -30048,7 +30891,7 @@ index efa2024..2e18d14 100644
printk("lguest: could not map switcher pages high\n");
@@ -119,7 +127,7 @@ static __init int map_switcher(void)
* Now the Switcher is mapped at the right address, we can't fail!
- * Copy in the compiled-in Switcher code (from <arch>_switcher.S).
+ * Copy in the compiled-in Switcher code (from x86/switcher_32.S).
*/
- memcpy(switcher_vma->addr, start_switcher_text,
+ memcpy(switcher_vma->addr, ktla_ktva(start_switcher_text),
@@ -30056,7 +30899,7 @@ index efa2024..2e18d14 100644
printk(KERN_INFO "lguest: mapped switcher at %p\n",
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
-index 9f1659c..5352032 100644
+index 65af42f..530c87a 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -59,7 +59,7 @@ static struct {
@@ -30082,7 +30925,7 @@ index 9f1659c..5352032 100644
/*
* Set up the Guest's page tables to see this CPU's pages (and no
* other CPU's pages).
-@@ -547,7 +553,7 @@ void __init lguest_arch_host_init(void)
+@@ -472,7 +478,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++)
@@ -30091,7 +30934,7 @@ index 9f1659c..5352032 100644
/*
* Set up the Switcher's per-cpu areas.
-@@ -630,7 +636,7 @@ void __init lguest_arch_host_init(void)
+@@ -555,7 +561,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.
*/
@@ -30176,10 +31019,10 @@ index 4daf9e5..b8d1d0f 100644
.device = PCI_ANY_ID,
.subvendor = PCI_ANY_ID,
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
-index 4cacdad..9b5929d 100644
+index 31c2dc2..a2de7a6 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
-@@ -1551,7 +1551,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param)
+@@ -1589,7 +1589,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param)
cmd == DM_LIST_VERSIONS_CMD)
return 0;
@@ -30307,10 +31150,10 @@ index 3d80cf0..b77cc47 100644
schedule_work(&sc->trigger_event);
}
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
-index ebdae6e..cc57e52 100644
+index 8e91321..fd17aef 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,
+@@ -391,7 +391,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
if (!dev_size)
return 0;
@@ -30319,11 +31162,33 @@ index ebdae6e..cc57e52 100644
DMWARN("%s: %s too small for target: "
"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 59c4f04..4c7b661 100644
+--- a/drivers/md/dm-thin-metadata.c
++++ b/drivers/md/dm-thin-metadata.c
+@@ -431,7 +431,7 @@ static int init_pmd(struct dm_pool_metadata *pmd,
+
+ pmd->info.tm = 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;
+@@ -450,7 +450,7 @@ static int init_pmd(struct dm_pool_metadata *pmd,
+
+ pmd->bl_info.tm = 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;
+ pmd->bl_info.value_type.size = sizeof(__le64);
+ 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 41abc6d..1c6194f 100644
+index 4720f68..78d1df7 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
-@@ -164,9 +164,9 @@ struct mapped_device {
+@@ -177,9 +177,9 @@ struct mapped_device {
/*
* Event handling.
*/
@@ -30335,7 +31200,7 @@ index 41abc6d..1c6194f 100644
struct list_head uevent_list;
spinlock_t uevent_lock; /* Protect access to uevent_list */
-@@ -1842,8 +1842,8 @@ static struct mapped_device *alloc_dev(int minor)
+@@ -1845,8 +1845,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);
@@ -30346,7 +31211,7 @@ index 41abc6d..1c6194f 100644
INIT_LIST_HEAD(&md->uevent_list);
spin_lock_init(&md->uevent_lock);
-@@ -1977,7 +1977,7 @@ static void event_callback(void *context)
+@@ -1980,7 +1980,7 @@ static void event_callback(void *context)
dm_send_uevents(&uevents, &disk_to_dev(md->disk)->kobj);
@@ -30355,7 +31220,7 @@ index 41abc6d..1c6194f 100644
wake_up(&md->eventq);
}
-@@ -2553,18 +2553,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
+@@ -2622,18 +2622,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
uint32_t dm_next_uevent_seq(struct mapped_device *md)
{
@@ -30378,32 +31243,32 @@ index 41abc6d..1c6194f 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 bc83428..f605840 100644
+index f47f1f8..b7f559e 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
-@@ -231,10 +231,10 @@ EXPORT_SYMBOL_GPL(bio_clone_mddev);
+@@ -278,10 +278,10 @@ EXPORT_SYMBOL_GPL(md_trim_bio);
* start build, activate spare
*/
static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters);
-static atomic_t md_event_count;
+static atomic_unchecked_t md_event_count;
- void md_new_event(mddev_t *mddev)
+ void md_new_event(struct mddev *mddev)
{
- atomic_inc(&md_event_count);
+ atomic_inc_unchecked(&md_event_count);
wake_up(&md_event_waiters);
}
EXPORT_SYMBOL_GPL(md_new_event);
-@@ -244,7 +244,7 @@ EXPORT_SYMBOL_GPL(md_new_event);
+@@ -291,7 +291,7 @@ EXPORT_SYMBOL_GPL(md_new_event);
*/
- static void md_new_event_inintr(mddev_t *mddev)
+ static void md_new_event_inintr(struct mddev *mddev)
{
- atomic_inc(&md_event_count);
+ atomic_inc_unchecked(&md_event_count);
wake_up(&md_event_waiters);
}
-@@ -1475,7 +1475,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
+@@ -1525,7 +1525,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);
@@ -30412,7 +31277,7 @@ index bc83428..f605840 100644
rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256;
bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1;
-@@ -1653,7 +1653,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
+@@ -1742,7 +1742,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev)
else
sb->resync_offset = cpu_to_le64(0);
@@ -30421,16 +31286,16 @@ index bc83428..f605840 100644
sb->raid_disks = cpu_to_le32(mddev->raid_disks);
sb->size = cpu_to_le64(mddev->dev_sectors);
-@@ -2446,7 +2446,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
+@@ -2639,7 +2639,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
static ssize_t
- errors_show(mdk_rdev_t *rdev, char *page)
+ errors_show(struct md_rdev *rdev, char *page)
{
- return sprintf(page, "%d\n", atomic_read(&rdev->corrected_errors));
+ return sprintf(page, "%d\n", atomic_read_unchecked(&rdev->corrected_errors));
}
static ssize_t
-@@ -2455,7 +2455,7 @@ errors_store(mdk_rdev_t *rdev, const char *buf, size_t len)
+@@ -2648,7 +2648,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')) {
@@ -30439,9 +31304,9 @@ index bc83428..f605840 100644
return len;
}
return -EINVAL;
-@@ -2811,8 +2811,8 @@ void md_rdev_init(mdk_rdev_t *rdev)
- rdev->last_read_error.tv_sec = 0;
- rdev->last_read_error.tv_nsec = 0;
+@@ -3039,8 +3039,8 @@ int md_rdev_init(struct md_rdev *rdev)
+ rdev->sb_loaded = 0;
+ rdev->bb_page = NULL;
atomic_set(&rdev->nr_pending, 0);
- atomic_set(&rdev->read_errors, 0);
- atomic_set(&rdev->corrected_errors, 0);
@@ -30450,16 +31315,16 @@ index bc83428..f605840 100644
INIT_LIST_HEAD(&rdev->same_set);
init_waitqueue_head(&rdev->blocked_wait);
-@@ -6440,7 +6440,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
+@@ -6683,7 +6683,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
spin_unlock(&pers_lock);
seq_printf(seq, "\n");
-- mi->event = atomic_read(&md_event_count);
-+ mi->event = atomic_read_unchecked(&md_event_count);
+- seq->poll_event = atomic_read(&md_event_count);
++ seq->poll_event = atomic_read_unchecked(&md_event_count);
return 0;
}
if (v == (void*)2) {
-@@ -6529,7 +6529,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
+@@ -6772,7 +6772,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
chunk_kb ? "KB" : "B");
if (bitmap->file) {
seq_printf(seq, ", file: ");
@@ -30468,25 +31333,25 @@ index bc83428..f605840 100644
}
seq_printf(seq, "\n");
-@@ -6563,7 +6563,7 @@ static int md_seq_open(struct inode *inode, struct file *file)
- else {
- struct seq_file *p = file->private_data;
- p->private = mi;
-- mi->event = atomic_read(&md_event_count);
-+ mi->event = atomic_read_unchecked(&md_event_count);
- }
+@@ -6803,7 +6803,7 @@ static int md_seq_open(struct inode *inode, struct file *file)
+ return error;
+
+ seq = file->private_data;
+- seq->poll_event = atomic_read(&md_event_count);
++ seq->poll_event = atomic_read_unchecked(&md_event_count);
return error;
}
-@@ -6579,7 +6579,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
+
+@@ -6817,7 +6817,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
/* always allow read */
mask = POLLIN | POLLRDNORM;
-- if (mi->event != atomic_read(&md_event_count))
-+ if (mi->event != atomic_read_unchecked(&md_event_count))
+- if (seq->poll_event != atomic_read(&md_event_count))
++ if (seq->poll_event != atomic_read_unchecked(&md_event_count))
mask |= POLLERR | POLLPRI;
return mask;
}
-@@ -6623,7 +6623,7 @@ static int is_mddev_idle(mddev_t *mddev, int init)
+@@ -6861,7 +6861,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]) -
@@ -30496,10 +31361,10 @@ index bc83428..f605840 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 ce4e328..93770e9 100644
+index cf742d9..7c7c745 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
-@@ -97,13 +97,13 @@ struct mdk_rdev_s
+@@ -120,13 +120,13 @@ struct md_rdev {
* only maintained for arrays that
* support hot removal
*/
@@ -30515,7 +31380,7 @@ index ce4e328..93770e9 100644
* for reporting to userspace and storing
* in superblock.
*/
-@@ -344,7 +344,7 @@ static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev)
+@@ -410,7 +410,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)
{
@@ -30523,43 +31388,94 @@ index ce4e328..93770e9 100644
+ atomic_add_unchecked(nr_sectors, &bdev->bd_contains->bd_disk->sync_io);
}
- struct mdk_personality
+ 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 50ed53b..4f29d7d 100644
+--- a/drivers/md/persistent-data/dm-space-map-checker.c
++++ b/drivers/md/persistent-data/dm-space-map-checker.c
+@@ -159,7 +159,7 @@ static void ca_destroy(struct count_array *ca)
+ /*----------------------------------------------------------------*/
+
+ 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 fc469ba..2d91555 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
++++ b/drivers/md/persistent-data/dm-space-map.h
+@@ -60,6 +60,7 @@ struct dm_space_map {
+ int (*root_size)(struct dm_space_map *sm, size_t *result);
+ int (*copy_root)(struct dm_space_map *sm, void *copy_to_here_le, size_t len);
+ };
++typedef struct dm_space_map __no_const dm_space_map_no_const;
+
+ /*----------------------------------------------------------------*/
+
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
-index 3a9e59f..6ffbdd3 100644
+index ede2461..9c4c691 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
-@@ -1263,7 +1263,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
- rdev_dec_pending(rdev, mddev);
- md_error(mddev, rdev);
- } else
+@@ -1559,7 +1559,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)
- atomic_add(s, &rdev->corrected_errors);
+ atomic_add_unchecked(s, &rdev->corrected_errors);
}
- d = start;
- while (d != r1_bio->read_disk) {
-@@ -1492,7 +1492,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
- /* Well, this device is dead */
- md_error(mddev, rdev);
- else {
+ sectors -= s;
+ sect += s;
+@@ -1772,7 +1772,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)) {
- atomic_add(s, &rdev->corrected_errors);
+ atomic_add_unchecked(s, &rdev->corrected_errors);
printk(KERN_INFO
"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 17cb6ab..f448b35 100644
+index 685ddf3..955b087 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
-@@ -1186,7 +1186,7 @@ static void end_sync_read(struct bio *bio, int error)
- if (test_bit(BIO_UPTODATE, &bio->bi_flags))
- set_bit(R10BIO_Uptodate, &r10_bio->state);
- else {
+@@ -1440,7 +1440,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
+ */
- atomic_add(r10_bio->sectors,
+ atomic_add_unchecked(r10_bio->sectors,
&conf->mirrors[d].rdev->corrected_errors);
- if (!test_bit(MD_RECOVERY_SYNC, &conf->mddev->recovery))
- md_error(r10_bio->mddev,
-@@ -1394,7 +1394,7 @@ static void check_decay_read_errors(mddev_t *mddev, mdk_rdev_t *rdev)
+
+ /* for reconstruct, we always reschedule after a read.
+@@ -1740,7 +1740,7 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
{
struct timespec cur_time_mon;
unsigned long hours_since_last;
@@ -30568,7 +31484,7 @@ index 17cb6ab..f448b35 100644
ktime_get_ts(&cur_time_mon);
-@@ -1416,9 +1416,9 @@ static void check_decay_read_errors(mddev_t *mddev, mdk_rdev_t *rdev)
+@@ -1762,9 +1762,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))
@@ -30579,8 +31495,8 @@ index 17cb6ab..f448b35 100644
+ atomic_set_unchecked(&rdev->read_errors, read_errors >> hours_since_last);
}
- /*
-@@ -1448,8 +1448,8 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
+ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
+@@ -1814,8 +1814,8 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
return;
check_decay_read_errors(mddev, rdev);
@@ -30591,7 +31507,7 @@ index 17cb6ab..f448b35 100644
char b[BDEVNAME_SIZE];
bdevname(rdev->bdev, b);
-@@ -1457,7 +1457,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
+@@ -1823,7 +1823,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,
@@ -30600,29 +31516,25 @@ index 17cb6ab..f448b35 100644
printk(KERN_NOTICE
"md/raid10:%s: %s: Failing raid device\n",
mdname(mddev), b);
-@@ -1520,7 +1520,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
- test_bit(In_sync, &rdev->flags)) {
- atomic_inc(&rdev->nr_pending);
- rcu_read_unlock();
+@@ -1968,7 +1968,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
+ (unsigned long long)(
+ sect + rdev->data_offset),
+ bdevname(rdev->bdev, b));
- atomic_add(s, &rdev->corrected_errors);
+ atomic_add_unchecked(s, &rdev->corrected_errors);
- if (sync_page_io(rdev,
- r10_bio->devs[sl].addr +
- sect,
+ }
+
+ rdev_dec_pending(rdev, mddev);
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
-index 1f6c68d..c384765 100644
+index 858fdbb..b2dac95 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
-@@ -550,7 +550,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
- bi->bi_next = NULL;
- if ((rw & WRITE) &&
- test_bit(R5_ReWrite, &sh->dev[i].flags))
-- atomic_add(STRIPE_SECTORS,
-+ atomic_add_unchecked(STRIPE_SECTORS,
- &rdev->corrected_errors);
- generic_make_request(bi);
- } else {
-@@ -1596,15 +1596,15 @@ static void raid5_end_read_request(struct bio * bi, int error)
+@@ -1610,19 +1610,19 @@ static void raid5_end_read_request(struct bio * bi, int error)
+ (unsigned long long)(sh->sector
+ + rdev->data_offset),
+ 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);
}
@@ -30639,71 +31551,35 @@ index 1f6c68d..c384765 100644
- atomic_inc(&rdev->read_errors);
+ atomic_inc_unchecked(&rdev->read_errors);
if (conf->mddev->degraded >= conf->max_degraded)
- printk_rl(KERN_WARNING
- "md/raid:%s: read error not correctable "
-@@ -1622,7 +1622,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
- (unsigned long long)(sh->sector
- + rdev->data_offset),
- bdn);
+ printk_ratelimited(
+ KERN_WARNING
+@@ -1642,7 +1642,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
+ (unsigned long long)(sh->sector
+ + rdev->data_offset),
+ bdn);
- 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",
-@@ -1945,6 +1945,7 @@ static sector_t compute_blocknr(struct stripe_head *sh, int i, int previous)
- sector_t r_sector;
- struct stripe_head sh2;
-
-+ pax_track_stack();
-
- chunk_offset = sector_div(new_sector, sectors_per_chunk);
- stripe = new_sector;
-diff --git a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c
-index 1d1d8d2..6c6837a 100644
---- a/drivers/media/common/saa7146_hlp.c
-+++ b/drivers/media/common/saa7146_hlp.c
-@@ -353,6 +353,8 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa
-
- int x[32], y[32], w[32], h[32];
-
-+ pax_track_stack();
-+
- /* clear out memory */
- memset(&line_list[0], 0x00, sizeof(u32)*32);
- memset(&pixel_list[0], 0x00, sizeof(u32)*32);
-diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
-index 7ea517b..252fe54 100644
---- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
-+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
-@@ -590,6 +590,8 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
- u8 buf[HOST_LINK_BUF_SIZE];
- int i;
-
-+ pax_track_stack();
-+
- dprintk("%s\n", __func__);
-
- /* check if we have space for a link buf in the rx_buffer */
-@@ -1285,6 +1287,8 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
- unsigned long timeout;
- int written;
-
-+ pax_track_stack();
-+
- dprintk("%s\n", __func__);
-
- /* Incoming packet has a 2 byte header. hdr[0] = slot_id, hdr[1] = connection_id */
+diff --git a/drivers/media/dvb/ddbridge/ddbridge-core.c b/drivers/media/dvb/ddbridge/ddbridge-core.c
+index ba9a643..e474ab5 100644
+--- a/drivers/media/dvb/ddbridge/ddbridge-core.c
++++ b/drivers/media/dvb/ddbridge/ddbridge-core.c
+@@ -1678,7 +1678,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..8fee34d 100644
+index a7d876f..8c21b61 100644
--- a/drivers/media/dvb/dvb-core/dvb_demux.h
+++ b/drivers/media/dvb/dvb-core/dvb_demux.h
-@@ -68,12 +68,12 @@ struct dvb_demux_feed {
- union {
- struct dmx_ts_feed ts;
- struct dmx_section_feed sec;
-- } feed;
-+ } __no_const feed;
-
+@@ -73,7 +73,7 @@ struct dvb_demux_feed {
union {
dmx_ts_cb ts;
dmx_section_cb sec;
@@ -30726,10 +31602,10 @@ index f732877..d38c35a 100644
int minor;
int id;
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
-index acb5fb2..2413f1d 100644
+index 9f2a02c..5920f88 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
-@@ -1059,7 +1059,7 @@ static struct dib0070_config dib7070p_dib0070_config = {
+@@ -1069,7 +1069,7 @@ static struct dib0070_config dib7070p_dib0070_config = {
struct dib0700_adapter_state {
int (*set_param_save) (struct dvb_frontend *,
struct dvb_frontend_parameters *);
@@ -30738,34 +31614,8 @@ index acb5fb2..2413f1d 100644
static int dib7070_set_param_override(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep)
-diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
-index a224e94..503b76a 100644
---- a/drivers/media/dvb/dvb-usb/dib0700_core.c
-+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
-@@ -478,6 +478,8 @@ int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw
- if (!buf)
- return -ENOMEM;
-
-+ pax_track_stack();
-+
- while ((ret = dvb_usb_get_hexline(fw, &hx, &pos)) > 0) {
- deb_fwdata("writing to address 0x%08x (buffer: 0x%02x %02x)\n",
- hx.addr, hx.len, hx.chk);
-diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h
-index e47c321..b18237b 100644
---- a/drivers/media/dvb/dvb-usb/dibusb.h
-+++ b/drivers/media/dvb/dvb-usb/dibusb.h
-@@ -97,7 +97,7 @@
- #define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x02
-
- struct dibusb_state {
-- struct dib_fe_xfer_ops ops;
-+ dib_fe_xfer_ops_no_const ops;
- int mt2060_present;
- u8 tuner_addr;
- };
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c
-index 058b231..183d2b3 100644
+index f103ec1..5e8968b 100644
--- a/drivers/media/dvb/dvb-usb/dw2102.c
+++ b/drivers/media/dvb/dvb-usb/dw2102.c
@@ -95,7 +95,7 @@ struct su3000_state {
@@ -30777,88 +31627,37 @@ index 058b231..183d2b3 100644
/* debug */
static int dvb_usb_dw2102_debug;
-diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c
-index 37b1469..28a6f6f 100644
---- a/drivers/media/dvb/dvb-usb/lmedm04.c
-+++ b/drivers/media/dvb/dvb-usb/lmedm04.c
-@@ -742,6 +742,7 @@ static int lme2510_download_firmware(struct usb_device *dev,
- usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
- 0x06, 0x80, 0x0200, 0x00, data, 0x0109, 1000);
-
-+ pax_track_stack();
-
- data[0] = 0x8a;
- len_in = 1;
-@@ -764,6 +765,8 @@ static void lme_coldreset(struct usb_device *dev)
- int ret = 0, len_in;
- u8 data[512] = {0};
-
-+ pax_track_stack();
-+
- data[0] = 0x0a;
- len_in = 1;
- info("FRM Firmware Cold Reset");
diff --git a/drivers/media/dvb/frontends/dib3000.h b/drivers/media/dvb/frontends/dib3000.h
-index ba91735..547ac27 100644
+index 404f63a..4796533 100644
--- a/drivers/media/dvb/frontends/dib3000.h
+++ b/drivers/media/dvb/frontends/dib3000.h
-@@ -40,10 +40,11 @@ struct dib_fe_xfer_ops
+@@ -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);
int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl);
- };
-+typedef struct dib_fe_xfer_ops __no_const dib_fe_xfer_ops_no_const;
+-};
++} __no_const;
#if defined(CONFIG_DVB_DIB3000MB) || (defined(CONFIG_DVB_DIB3000MB_MODULE) && defined(MODULE))
extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
-- struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops);
-+ struct i2c_adapter* i2c, dib_fe_xfer_ops_no_const *xfer_ops);
- #else
- static inline struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
- struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops)
-diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
-index e80c597..0fd3f2c 100644
---- a/drivers/media/dvb/frontends/dib3000mb.c
-+++ b/drivers/media/dvb/frontends/dib3000mb.c
-@@ -756,7 +756,7 @@ static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_
- static struct dvb_frontend_ops dib3000mb_ops;
-
- struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
-- struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops)
-+ struct i2c_adapter* i2c, dib_fe_xfer_ops_no_const *xfer_ops)
- {
- struct dib3000_state* state = NULL;
-
-diff --git a/drivers/media/dvb/frontends/mb86a16.c b/drivers/media/dvb/frontends/mb86a16.c
-index c283112..7f367a7 100644
---- a/drivers/media/dvb/frontends/mb86a16.c
-+++ b/drivers/media/dvb/frontends/mb86a16.c
-@@ -1060,6 +1060,8 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
- int ret = -1;
- int sync;
-
-+ pax_track_stack();
-+
- dprintk(verbose, MB86A16_INFO, 1, "freq=%d Mhz, symbrt=%d Ksps", state->frequency, state->srate);
-
- fcp = 3000;
-diff --git a/drivers/media/dvb/frontends/or51211.c b/drivers/media/dvb/frontends/or51211.c
-index c709ce6..b3fe620 100644
---- a/drivers/media/dvb/frontends/or51211.c
-+++ b/drivers/media/dvb/frontends/or51211.c
-@@ -113,6 +113,8 @@ static int or51211_load_firmware (struct dvb_frontend* fe,
- u8 tudata[585];
- int i;
-
-+ pax_track_stack();
-+
- dprintk("Firmware is %zd bytes\n",fw->size);
+diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c
+index 90bf573..e8463da 100644
+--- a/drivers/media/dvb/frontends/ds3000.c
++++ b/drivers/media/dvb/frontends/ds3000.c
+@@ -1210,7 +1210,7 @@ static int ds3000_set_frontend(struct dvb_frontend *fe,
+
+ for (i = 0; i < 30 ; i++) {
+ ds3000_read_status(fe, &status);
+- if (status && FE_HAS_LOCK)
++ if (status & FE_HAS_LOCK)
+ break;
- /* Get eprom data */
+ msleep(10);
diff --git a/drivers/media/dvb/ngene/ngene-cards.c b/drivers/media/dvb/ngene/ngene-cards.c
-index fcf4be9..6e5393b 100644
+index 0564192..75b16f5 100644
--- a/drivers/media/dvb/ngene/ngene-cards.c
+++ b/drivers/media/dvb/ngene/ngene-cards.c
-@@ -379,7 +379,7 @@ static struct ngene_info ngene_info_m780 = {
+@@ -477,7 +477,7 @@ static struct ngene_info ngene_info_m780 = {
/****************************************************************************/
@@ -30867,37 +31666,50 @@ index fcf4be9..6e5393b 100644
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/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
-index 9e2f870..22e3a08 100644
---- a/drivers/media/video/cx18/cx18-driver.c
-+++ b/drivers/media/video/cx18/cx18-driver.c
-@@ -327,6 +327,8 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv)
- struct i2c_client c;
- u8 eedata[256];
-
-+ pax_track_stack();
-+
- memset(&c, 0, sizeof(c));
- strlcpy(c.name, "cx18 tveeprom tmp", sizeof(c.name));
- c.adapter = &cx->i2c_adap[0];
-diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
-index e97cafd..33db7bc 100644
---- a/drivers/media/video/cx23885/cx23885-input.c
-+++ b/drivers/media/video/cx23885/cx23885-input.c
-@@ -53,6 +53,8 @@ static void cx23885_input_process_measurements(struct cx23885_dev *dev,
- bool handle = false;
- struct ir_raw_event ir_core_event[64];
-
-+ pax_track_stack();
-+
- do {
- num = 0;
- v4l2_subdev_call(dev->sd_ir, ir, rx_read, (u8 *) ir_core_event,
+diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
+index 16a089f..ab1667d 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;
+diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
+index 61287fc..8b08712 100644
+--- a/drivers/media/rc/redrat3.c
++++ b/drivers/media/rc/redrat3.c
+@@ -905,7 +905,7 @@ static int redrat3_set_tx_carrier(struct rc_dev *dev, u32 carrier)
+ return carrier;
+ }
+
+-static int redrat3_transmit_ir(struct rc_dev *rcdev, int *txbuf, u32 n)
++static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, u32 n)
+ {
+ struct redrat3_dev *rr3 = rcdev->priv;
+ struct device *dev = rr3->dev;
+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/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
-index 423c1af..1070601 100644
+index 68d1240..46b32eb 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
-@@ -764,7 +764,7 @@ static struct snd_kcontrol_new snd_cx88_alc_switch = {
+@@ -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
*/
@@ -30906,56 +31718,21 @@ index 423c1af..1070601 100644
{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/pvrusb2/pvrusb2-eeprom.c b/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
-index 9515f3a..c9ecb85 100644
---- a/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
-+++ b/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
-@@ -120,6 +120,8 @@ int pvr2_eeprom_analyze(struct pvr2_hdw *hdw)
- u8 *eeprom;
- struct tveeprom tvdata;
-
-+ pax_track_stack();
-+
- memset(&tvdata,0,sizeof(tvdata));
-
- eeprom = pvr2_eeprom_fetch(hdw);
-diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c
-index f9f29cc..5a2e330 100644
---- a/drivers/media/video/saa7134/saa6752hs.c
-+++ b/drivers/media/video/saa7134/saa6752hs.c
-@@ -682,6 +682,8 @@ static int saa6752hs_init(struct v4l2_subdev *sd, u32 leading_null_bytes)
- unsigned char localPAT[256];
- unsigned char localPMT[256];
-
-+ pax_track_stack();
-+
- /* Set video format - must be done first as it resets other settings */
- set_reg8(client, 0x41, h->video_format);
-
-diff --git a/drivers/media/video/saa7164/saa7164-cmd.c b/drivers/media/video/saa7164/saa7164-cmd.c
-index 62fac7f..f29e0b9 100644
---- a/drivers/media/video/saa7164/saa7164-cmd.c
-+++ b/drivers/media/video/saa7164/saa7164-cmd.c
-@@ -88,6 +88,8 @@ int saa7164_irq_dequeue(struct saa7164_dev *dev)
- u8 tmp[512];
- dprintk(DBGLVL_CMD, "%s()\n", __func__);
-
-+ pax_track_stack();
-+
- /* While any outstand message on the bus exists... */
- do {
-
-@@ -141,6 +143,8 @@ int saa7164_cmd_dequeue(struct saa7164_dev *dev)
- u8 tmp[512];
- dprintk(DBGLVL_CMD, "%s()\n", __func__);
-
-+ pax_track_stack();
-+
- while (loop) {
-
- struct tmComResInfo tRsp = { 0, 0, 0, 0, 0, 0 };
+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 fc611eb..45ccd26 100644
+index a0895bf..b7ebb1b 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)
@@ -30967,37 +31744,20 @@ index fc611eb..45ccd26 100644
.vidioc_querycap = timblogiw_querycap,
.vidioc_enum_fmt_vid_cap = timblogiw_enum_fmt,
.vidioc_g_fmt_vid_cap = timblogiw_g_fmt,
-diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
-index f344411..6ae9974 100644
---- a/drivers/media/video/usbvision/usbvision-core.c
-+++ b/drivers/media/video/usbvision/usbvision-core.c
-@@ -707,6 +707,8 @@ static enum parse_state usbvision_parse_compress(struct usb_usbvision *usbvision
- unsigned char rv, gv, bv;
- static unsigned char *Y, *U, *V;
-
-+ pax_track_stack();
-+
- frame = usbvision->cur_frame;
- image_size = frame->frmwidth * frame->frmheight;
- if ((frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) ||
-diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
-index ddb8f4b..35fce12 100644
---- a/drivers/media/video/videobuf-dma-sg.c
-+++ b/drivers/media/video/videobuf-dma-sg.c
-@@ -606,6 +606,8 @@ void *videobuf_sg_alloc(size_t size)
- {
- struct videobuf_queue q;
-
-+ pax_track_stack();
-+
- /* Required to make generic handler to call __videobuf_alloc */
- q.int_ops = &sg_ops;
+@@ -767,7 +767,7 @@ static __devinitconst struct v4l2_ioctl_ops timblogiw_ioctl_ops = {
+ .vidioc_enum_framesizes = timblogiw_enum_framesizes,
+ };
+-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,
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
-index 7956a10..f39232f 100644
+index e9c6a60..daf6a33 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
-@@ -6681,8 +6681,13 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v)
+@@ -6753,8 +6753,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);
@@ -31012,10 +31772,10 @@ index 7956a10..f39232f 100644
* Rounding UP to nearest 4-kB boundary here...
*/
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
-index 7596aec..f7ae9aa 100644
+index 9d95042..b808101 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
-@@ -439,6 +439,23 @@ mptsas_is_end_device(struct mptsas_devinfo * attached)
+@@ -446,6 +446,23 @@ mptsas_is_end_device(struct mptsas_devinfo * attached)
return 0;
}
@@ -31039,7 +31799,7 @@ index 7596aec..f7ae9aa 100644
/* no mutex */
static void
mptsas_port_delete(MPT_ADAPTER *ioc, struct mptsas_portinfo_details * port_details)
-@@ -477,23 +494,6 @@ mptsas_get_rphy(struct mptsas_phyinfo *phy_info)
+@@ -484,23 +501,6 @@ mptsas_get_rphy(struct mptsas_phyinfo *phy_info)
return NULL;
}
@@ -31064,10 +31824,10 @@ index 7596aec..f7ae9aa 100644
mptsas_get_port(struct mptsas_phyinfo *phy_info)
{
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
-index a1d4ee6..341d381 100644
+index 0c3ced7..1fe34ec 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
-@@ -1268,15 +1268,16 @@ mptscsih_info(struct Scsi_Host *SChost)
+@@ -1270,15 +1270,16 @@ mptscsih_info(struct Scsi_Host *SChost)
h = shost_priv(SChost);
@@ -31092,19 +31852,6 @@ index a1d4ee6..341d381 100644
return h->info_kbuf;
}
-diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
-index 098de2b..fbb922c 100644
---- a/drivers/message/i2o/i2o_config.c
-+++ b/drivers/message/i2o/i2o_config.c
-@@ -781,6 +781,8 @@ static int i2o_cfg_passthru(unsigned long arg)
- struct i2o_message *msg;
- unsigned int iop;
-
-+ pax_track_stack();
-+
- if (get_user(iop, &cmd->iop) || get_user(user_msg, &cmd->msg))
- return -EFAULT;
-
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 07dbeaf..5533142 100644
--- a/drivers/message/i2o/i2o_proc.c
@@ -31196,7 +31943,7 @@ index 07dbeaf..5533142 100644
return 0;
}
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c
-index 090d2a3..5f24ef8 100644
+index a8c08f3..155fe3d 100644
--- a/drivers/message/i2o/iop.c
+++ b/drivers/message/i2o/iop.c
@@ -111,10 +111,10 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr)
@@ -31222,24 +31969,11 @@ index 090d2a3..5f24ef8 100644
INIT_LIST_HEAD(&c->context_list);
#endif
-diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
-index a20e1c4..4f57255 100644
---- a/drivers/mfd/ab3100-core.c
-+++ b/drivers/mfd/ab3100-core.c
-@@ -809,7 +809,7 @@ struct ab_family_id {
- char *name;
- };
-
--static const struct ab_family_id ids[] __devinitdata = {
-+static const struct ab_family_id ids[] __devinitconst = {
- /* AB3100 */
- {
- .id = 0xc0,
diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c
-index f12720d..3c251fd 100644
+index 7ce65f4..e66e9bc 100644
--- a/drivers/mfd/abx500-core.c
+++ b/drivers/mfd/abx500-core.c
-@@ -14,7 +14,7 @@ static LIST_HEAD(abx500_list);
+@@ -15,7 +15,7 @@ static LIST_HEAD(abx500_list);
struct abx500_device_entry {
struct list_head list;
@@ -31260,64 +31994,51 @@ index 5c2a06a..8fa077c 100644
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
-diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c
-index 5fe5de1..af64f53 100644
---- a/drivers/mfd/wm8350-i2c.c
-+++ b/drivers/mfd/wm8350-i2c.c
-@@ -44,6 +44,8 @@ static int wm8350_i2c_write_device(struct wm8350 *wm8350, char reg,
- u8 msg[(WM8350_MAX_REGISTER << 1) + 1];
- int ret;
-
-+ pax_track_stack();
-+
- if (bytes > ((WM8350_MAX_REGISTER << 1) + 1))
- return -EINVAL;
-
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
-index 8b51cd6..f628f8d 100644
+index 29d12a7..f900ba4 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
-@@ -437,7 +437,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *dummy)
+@@ -464,7 +464,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.
*/
-- atomic_inc(&lis3_dev.count);
-+ atomic_inc_unchecked(&lis3_dev.count);
+- atomic_inc(&lis3->count);
++ atomic_inc_unchecked(&lis3->count);
- wake_up_interruptible(&lis3_dev.misc_wait);
- kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN);
-@@ -520,7 +520,7 @@ static int lis3lv02d_misc_open(struct inode *inode, struct file *file)
- if (lis3_dev.pm_dev)
- pm_runtime_get_sync(lis3_dev.pm_dev);
+ wake_up_interruptible(&lis3->misc_wait);
+ kill_fasync(&lis3->async_queue, SIGIO, POLL_IN);
+@@ -550,7 +550,7 @@ static int lis3lv02d_misc_open(struct inode *inode, struct file *file)
+ if (lis3->pm_dev)
+ pm_runtime_get_sync(lis3->pm_dev);
-- atomic_set(&lis3_dev.count, 0);
-+ atomic_set_unchecked(&lis3_dev.count, 0);
+- atomic_set(&lis3->count, 0);
++ atomic_set_unchecked(&lis3->count, 0);
return 0;
}
-@@ -547,7 +547,7 @@ static ssize_t lis3lv02d_misc_read(struct file *file, char __user *buf,
- add_wait_queue(&lis3_dev.misc_wait, &wait);
+@@ -583,7 +583,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);
-- data = atomic_xchg(&lis3_dev.count, 0);
-+ data = atomic_xchg_unchecked(&lis3_dev.count, 0);
+- data = atomic_xchg(&lis3->count, 0);
++ data = atomic_xchg_unchecked(&lis3->count, 0);
if (data)
break;
-@@ -585,7 +585,7 @@ out:
- static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait)
- {
- poll_wait(file, &lis3_dev.misc_wait, wait);
-- if (atomic_read(&lis3_dev.count))
-+ if (atomic_read_unchecked(&lis3_dev.count))
+@@ -624,7 +624,7 @@ static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait)
+ struct lis3lv02d, miscdev);
+
+ poll_wait(file, &lis3->misc_wait, wait);
+- if (atomic_read(&lis3->count))
++ if (atomic_read_unchecked(&lis3->count))
return POLLIN | POLLRDNORM;
return 0;
}
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h
-index a193958..4d7ecd2 100644
+index 2b1482a..5d33616 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.h
+++ b/drivers/misc/lis3lv02d/lis3lv02d.h
-@@ -265,7 +265,7 @@ struct lis3lv02d {
+@@ -266,7 +266,7 @@ struct lis3lv02d {
struct input_polled_dev *idev; /* input device */
struct platform_device *pdev; /* platform device */
struct regulator_bulk_data regulators[2];
@@ -31427,31 +32148,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;
@@ -31503,10 +32199,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;
@@ -31599,10 +32318,10 @@ index 8d082b4..aa749ae 100644
/*
* Timer function to enforce the timelimit on the partition disengage.
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
-index 936bbca..8ade4516 100644
+index 6878a94..fe5c5f1 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
-@@ -524,7 +524,7 @@ static const struct sdhci_pci_fixes sdhci_via = {
+@@ -673,7 +673,7 @@ static const struct sdhci_pci_fixes sdhci_via = {
.probe = via_probe,
};
@@ -31611,91 +32330,11 @@ index 936bbca..8ade4516 100644
{
.vendor = PCI_VENDOR_ID_RICOH,
.device = PCI_DEVICE_ID_RICOH_R5C822,
-diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
-index e1e122f..d99a6ea 100644
---- a/drivers/mtd/chips/cfi_cmdset_0001.c
-+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
-@@ -757,6 +757,8 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
- struct cfi_pri_intelext *cfip = cfi->cmdset_priv;
- unsigned long timeo = jiffies + HZ;
-
-+ pax_track_stack();
-+
- /* Prevent setting state FL_SYNCING for chip in suspended state. */
- if (mode == FL_SYNCING && chip->oldstate != FL_READY)
- goto sleep;
-@@ -1653,6 +1655,8 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
- unsigned long initial_adr;
- int initial_len = len;
-
-+ pax_track_stack();
-+
- wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
- adr += chip->start;
- initial_adr = adr;
-@@ -1871,6 +1875,8 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
- int retries = 3;
- int ret;
-
-+ pax_track_stack();
-+
- adr += chip->start;
-
- retry:
-diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
-index 179814a..abe9d60 100644
---- a/drivers/mtd/chips/cfi_cmdset_0020.c
-+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
-@@ -255,6 +255,8 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
- unsigned long cmd_addr;
- struct cfi_private *cfi = map->fldrv_priv;
-
-+ pax_track_stack();
-+
- adr += chip->start;
-
- /* Ensure cmd read/writes are aligned. */
-@@ -429,6 +431,8 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
- DECLARE_WAITQUEUE(wait, current);
- int wbufsize, z;
-
-+ pax_track_stack();
-+
- /* M58LW064A requires bus alignment for buffer wriets -- saw */
- if (adr & (map_bankwidth(map)-1))
- return -EINVAL;
-@@ -743,6 +747,8 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u
- DECLARE_WAITQUEUE(wait, current);
- int ret = 0;
-
-+ pax_track_stack();
-+
- adr += chip->start;
-
- /* Let's determine this according to the interleave only once */
-@@ -1048,6 +1054,8 @@ static inline int do_lock_oneblock(struct map_info *map, struct flchip *chip, un
- unsigned long timeo = jiffies + HZ;
- DECLARE_WAITQUEUE(wait, current);
-
-+ pax_track_stack();
-+
- adr += chip->start;
-
- /* Let's determine this according to the interleave only once */
-@@ -1197,6 +1205,8 @@ static inline int do_unlock_oneblock(struct map_info *map, struct flchip *chip,
- unsigned long timeo = jiffies + HZ;
- DECLARE_WAITQUEUE(wait, current);
-
-+ pax_track_stack();
-+
- adr += chip->start;
-
- /* Let's determine this according to the interleave only once */
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
-index f7fbf60..9866457 100644
+index e9fad91..0a7a16a 100644
--- a/drivers/mtd/devices/doc2000.c
+++ b/drivers/mtd/devices/doc2000.c
-@@ -776,7 +776,7 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
+@@ -773,7 +773,7 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
/* The ECC will not be calculated correctly if less than 512 is written */
/* DBB-
@@ -31705,10 +32344,10 @@ index f7fbf60..9866457 100644
"ECC needs a full sector write (adr: %lx size %lx)\n",
(long) to, (long) len);
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c
-index 241192f..d0c35a3 100644
+index a3f7a27..234016e 100644
--- a/drivers/mtd/devices/doc2001.c
+++ b/drivers/mtd/devices/doc2001.c
-@@ -393,7 +393,7 @@ static int doc_read (struct mtd_info *mtd, loff_t from, size_t len,
+@@ -392,7 +392,7 @@ static int doc_read (struct mtd_info *mtd, loff_t from, size_t len,
struct Nand *mychip = &this->chips[from >> (this->chipshift)];
/* Don't allow read past end of device */
@@ -31717,73 +32356,8 @@ index 241192f..d0c35a3 100644
return -EINVAL;
/* Don't allow a single read to cross a 512-byte block boundary */
-diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
-index 037b399..225a71d 100644
---- a/drivers/mtd/ftl.c
-+++ b/drivers/mtd/ftl.c
-@@ -474,6 +474,8 @@ static int copy_erase_unit(partition_t *part, uint16_t srcunit,
- loff_t offset;
- uint16_t srcunitswap = cpu_to_le16(srcunit);
-
-+ pax_track_stack();
-+
- eun = &part->EUNInfo[srcunit];
- xfer = &part->XferInfo[xferunit];
- DEBUG(2, "ftl_cs: copying block 0x%x to 0x%x\n",
-diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
-index d7592e6..31c505c 100644
---- a/drivers/mtd/inftlcore.c
-+++ b/drivers/mtd/inftlcore.c
-@@ -259,6 +259,8 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
- struct inftl_oob oob;
- size_t retlen;
-
-+ pax_track_stack();
-+
- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d,"
- "pending=%d)\n", inftl, thisVUC, pendingblock);
-
-diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
-index 104052e..6232be5 100644
---- a/drivers/mtd/inftlmount.c
-+++ b/drivers/mtd/inftlmount.c
-@@ -53,6 +53,8 @@ static int find_boot_record(struct INFTLrecord *inftl)
- struct INFTLPartition *ip;
- size_t retlen;
-
-+ pax_track_stack();
-+
- DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=%p)\n", inftl);
-
- /*
-diff --git a/drivers/mtd/lpddr/qinfo_probe.c b/drivers/mtd/lpddr/qinfo_probe.c
-index dbfe17b..c7b0918 100644
---- a/drivers/mtd/lpddr/qinfo_probe.c
-+++ b/drivers/mtd/lpddr/qinfo_probe.c
-@@ -106,6 +106,8 @@ static int lpddr_pfow_present(struct map_info *map, struct lpddr_private *lpddr)
- {
- map_word pfow_val[4];
-
-+ pax_track_stack();
-+
- /* Check identification string */
- pfow_val[0] = map_read(map, map->pfow_base + PFOW_QUERY_STRING_P);
- pfow_val[1] = map_read(map, map->pfow_base + PFOW_QUERY_STRING_F);
-diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
-index 9f8658e..caf1155 100644
---- a/drivers/mtd/mtdchar.c
-+++ b/drivers/mtd/mtdchar.c
-@@ -554,6 +554,8 @@ static int mtd_ioctl(struct file *file, u_int cmd, u_long arg)
- u_long size;
- struct mtd_info_user info;
-
-+ pax_track_stack();
-+
- DEBUG(MTD_DEBUG_LEVEL0, "MTD_ioctl\n");
-
- size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
-index d527621..2491fab 100644
+index 3984d48..28aa897 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -26,6 +26,7 @@
@@ -31794,21 +32368,8 @@ index d527621..2491fab 100644
#include "denali.h"
-diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
-index b155666..611b801 100644
---- a/drivers/mtd/nftlcore.c
-+++ b/drivers/mtd/nftlcore.c
-@@ -264,6 +264,8 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
- int inplace = 1;
- size_t retlen;
-
-+ pax_track_stack();
-+
- memset(BlockMap, 0xff, sizeof(BlockMap));
- memset(BlockFreeFound, 0, sizeof(BlockFreeFound));
-
diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c
-index e3cd1ff..0ea79a3 100644
+index ac40925..483b753 100644
--- a/drivers/mtd/nftlmount.c
+++ b/drivers/mtd/nftlmount.c
@@ -24,6 +24,7 @@
@@ -31819,20 +32380,11 @@ index e3cd1ff..0ea79a3 100644
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/nftl.h>
-@@ -45,6 +46,8 @@ static int find_boot_record(struct NFTLrecord *nftl)
- struct mtd_info *mtd = nftl->mbd.mtd;
- unsigned int i;
-
-+ pax_track_stack();
-+
- /* Assume logical EraseSize == physical erasesize for starting the scan.
- We'll sort it out later if we find a MediaHeader which says otherwise */
- /* Actually, we won't. The new DiskOnChip driver has already scanned
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
-index 65626c1..e1c2102 100644
+index 6c3fb5a..c542a81 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
-@@ -1287,7 +1287,7 @@ module_exit(ubi_exit);
+@@ -1311,7 +1311,7 @@ module_exit(ubi_exit);
static int __init bytes_str_to_int(const char *str)
{
char *endp;
@@ -31841,7 +32393,7 @@ index 65626c1..e1c2102 100644
result = simple_strtoul(str, &endp, 0);
if (str == endp || result >= INT_MAX) {
-@@ -1298,11 +1298,11 @@ static int __init bytes_str_to_int(const char *str)
+@@ -1322,11 +1322,11 @@ static int __init bytes_str_to_int(const char *str)
switch (*endp) {
case 'G':
@@ -31856,7 +32408,7 @@ index 65626c1..e1c2102 100644
if (endp[1] == 'i' && endp[2] == 'B')
endp += 2;
case '\0':
-@@ -1313,7 +1313,13 @@ static int __init bytes_str_to_int(const char *str)
+@@ -1337,7 +1337,13 @@ static int __init bytes_str_to_int(const char *str)
return -EINVAL;
}
@@ -31871,11 +32423,11 @@ index 65626c1..e1c2102 100644
}
/**
-diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
-index 16249e9..6b7a15b 100644
---- a/drivers/net/atlx/atl2.c
-+++ b/drivers/net/atlx/atl2.c
-@@ -2840,7 +2840,7 @@ static void atl2_force_ps(struct atl2_hw *hw)
+diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
+index 1feae59..c2a61d2 100644
+--- a/drivers/net/ethernet/atheros/atlx/atl2.c
++++ b/drivers/net/ethernet/atheros/atlx/atl2.c
+@@ -2857,7 +2857,7 @@ static void atl2_force_ps(struct atl2_hw *hw)
*/
#define ATL2_PARAM(X, desc) \
@@ -31884,184 +32436,35 @@ index 16249e9..6b7a15b 100644
MODULE_PARM(X, "1-" __MODULE_STRING(ATL2_MAX_NIC) "i"); \
MODULE_PARM_DESC(X, desc);
#else
-diff --git a/drivers/net/bna/bfa_ioc_ct.c b/drivers/net/bna/bfa_ioc_ct.c
-index 87aecdf..ec23470 100644
---- a/drivers/net/bna/bfa_ioc_ct.c
-+++ b/drivers/net/bna/bfa_ioc_ct.c
-@@ -48,7 +48,21 @@ static void bfa_ioc_ct_sync_ack(struct bfa_ioc *ioc);
- static bool bfa_ioc_ct_sync_complete(struct bfa_ioc *ioc);
- static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode);
-
--static struct bfa_ioc_hwif nw_hwif_ct;
-+static struct bfa_ioc_hwif nw_hwif_ct = {
-+ .ioc_pll_init = bfa_ioc_ct_pll_init,
-+ .ioc_firmware_lock = bfa_ioc_ct_firmware_lock,
-+ .ioc_firmware_unlock = bfa_ioc_ct_firmware_unlock,
-+ .ioc_reg_init = bfa_ioc_ct_reg_init,
-+ .ioc_map_port = bfa_ioc_ct_map_port,
-+ .ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set,
-+ .ioc_notify_fail = bfa_ioc_ct_notify_fail,
-+ .ioc_ownership_reset = bfa_ioc_ct_ownership_reset,
-+ .ioc_sync_start = bfa_ioc_ct_sync_start,
-+ .ioc_sync_join = bfa_ioc_ct_sync_join,
-+ .ioc_sync_leave = bfa_ioc_ct_sync_leave,
-+ .ioc_sync_ack = bfa_ioc_ct_sync_ack,
-+ .ioc_sync_complete = bfa_ioc_ct_sync_complete
-+};
-
- /**
- * Called from bfa_ioc_attach() to map asic specific calls.
-@@ -56,20 +70,6 @@ static struct bfa_ioc_hwif nw_hwif_ct;
- void
- bfa_nw_ioc_set_ct_hwif(struct bfa_ioc *ioc)
- {
-- nw_hwif_ct.ioc_pll_init = bfa_ioc_ct_pll_init;
-- nw_hwif_ct.ioc_firmware_lock = bfa_ioc_ct_firmware_lock;
-- nw_hwif_ct.ioc_firmware_unlock = bfa_ioc_ct_firmware_unlock;
-- nw_hwif_ct.ioc_reg_init = bfa_ioc_ct_reg_init;
-- nw_hwif_ct.ioc_map_port = bfa_ioc_ct_map_port;
-- nw_hwif_ct.ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set;
-- nw_hwif_ct.ioc_notify_fail = bfa_ioc_ct_notify_fail;
-- nw_hwif_ct.ioc_ownership_reset = bfa_ioc_ct_ownership_reset;
-- nw_hwif_ct.ioc_sync_start = bfa_ioc_ct_sync_start;
-- nw_hwif_ct.ioc_sync_join = bfa_ioc_ct_sync_join;
-- nw_hwif_ct.ioc_sync_leave = bfa_ioc_ct_sync_leave;
-- nw_hwif_ct.ioc_sync_ack = bfa_ioc_ct_sync_ack;
-- nw_hwif_ct.ioc_sync_complete = bfa_ioc_ct_sync_complete;
--
- ioc->ioc_hwif = &nw_hwif_ct;
- }
-
-diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
-index 44e219c..7e9838d 100644
---- a/drivers/net/bna/bnad.c
-+++ b/drivers/net/bna/bnad.c
-@@ -1681,7 +1681,14 @@ bnad_setup_tx(struct bnad *bnad, uint tx_id)
- struct bna_intr_info *intr_info =
- &res_info[BNA_TX_RES_INTR_T_TXCMPL].res_u.intr_info;
- struct bna_tx_config *tx_config = &bnad->tx_config[tx_id];
-- struct bna_tx_event_cbfn tx_cbfn;
-+ static struct bna_tx_event_cbfn tx_cbfn = {
-+ /* Initialize the tx event handlers */
-+ .tcb_setup_cbfn = bnad_cb_tcb_setup,
-+ .tcb_destroy_cbfn = bnad_cb_tcb_destroy,
-+ .tx_stall_cbfn = bnad_cb_tx_stall,
-+ .tx_resume_cbfn = bnad_cb_tx_resume,
-+ .tx_cleanup_cbfn = bnad_cb_tx_cleanup
-+ };
- struct bna_tx *tx;
- unsigned long flags;
-
-@@ -1690,13 +1697,6 @@ bnad_setup_tx(struct bnad *bnad, uint tx_id)
- tx_config->txq_depth = bnad->txq_depth;
- tx_config->tx_type = BNA_TX_T_REGULAR;
-
-- /* Initialize the tx event handlers */
-- tx_cbfn.tcb_setup_cbfn = bnad_cb_tcb_setup;
-- tx_cbfn.tcb_destroy_cbfn = bnad_cb_tcb_destroy;
-- tx_cbfn.tx_stall_cbfn = bnad_cb_tx_stall;
-- tx_cbfn.tx_resume_cbfn = bnad_cb_tx_resume;
-- tx_cbfn.tx_cleanup_cbfn = bnad_cb_tx_cleanup;
--
- /* Get BNA's resource requirement for one tx object */
- spin_lock_irqsave(&bnad->bna_lock, flags);
- bna_tx_res_req(bnad->num_txq_per_tx,
-@@ -1827,21 +1827,21 @@ bnad_setup_rx(struct bnad *bnad, uint rx_id)
- struct bna_intr_info *intr_info =
- &res_info[BNA_RX_RES_T_INTR].res_u.intr_info;
- struct bna_rx_config *rx_config = &bnad->rx_config[rx_id];
-- struct bna_rx_event_cbfn rx_cbfn;
-+ static struct bna_rx_event_cbfn rx_cbfn = {
-+ /* Initialize the Rx event handlers */
-+ .rcb_setup_cbfn = bnad_cb_rcb_setup,
-+ .rcb_destroy_cbfn = bnad_cb_rcb_destroy,
-+ .ccb_setup_cbfn = bnad_cb_ccb_setup,
-+ .ccb_destroy_cbfn = bnad_cb_ccb_destroy,
-+ .rx_cleanup_cbfn = bnad_cb_rx_cleanup,
-+ .rx_post_cbfn = bnad_cb_rx_post
-+ };
- struct bna_rx *rx;
- unsigned long flags;
-
- /* Initialize the Rx object configuration */
- bnad_init_rx_config(bnad, rx_config);
-
-- /* Initialize the Rx event handlers */
-- rx_cbfn.rcb_setup_cbfn = bnad_cb_rcb_setup;
-- rx_cbfn.rcb_destroy_cbfn = bnad_cb_rcb_destroy;
-- rx_cbfn.ccb_setup_cbfn = bnad_cb_ccb_setup;
-- rx_cbfn.ccb_destroy_cbfn = bnad_cb_ccb_destroy;
-- rx_cbfn.rx_cleanup_cbfn = bnad_cb_rx_cleanup;
-- rx_cbfn.rx_post_cbfn = bnad_cb_rx_post;
--
- /* Get BNA's resource requirement for one Rx object */
- spin_lock_irqsave(&bnad->bna_lock, flags);
- bna_rx_res_req(rx_config, res_info);
-diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
-index 74580bb..a293e8f 100644
---- a/drivers/net/bnx2.c
-+++ b/drivers/net/bnx2.c
-@@ -5831,6 +5831,8 @@ bnx2_test_nvram(struct bnx2 *bp)
- int rc = 0;
- u32 magic, csum;
-
-+ pax_track_stack();
-+
- if ((rc = bnx2_nvram_read(bp, 0, data, 4)) != 0)
- goto test_nvram_done;
-
-diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
-index 727fe89..1d404ee 100644
---- a/drivers/net/bnx2x/bnx2x_ethtool.c
-+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
-@@ -1705,6 +1705,8 @@ static int bnx2x_test_nvram(struct bnx2x *bp)
- int i, rc;
- u32 magic, crc;
-
-+ pax_track_stack();
-+
- if (BP_NOMCP(bp))
- return 0;
-
-diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
-index 92feac6..4cc6f44 100644
---- a/drivers/net/can/mscan/mscan.c
-+++ b/drivers/net/can/mscan/mscan.c
-@@ -261,11 +261,13 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev)
- void __iomem *data = &regs->tx.dsr1_0;
- u16 *payload = (u16 *)frame->data;
-
-- /* It is safe to write into dsr[dlc+1] */
-- for (i = 0; i < (frame->can_dlc + 1) / 2; i++) {
-+ for (i = 0; i < frame->can_dlc / 2; i++) {
- out_be16(data, *payload++);
- data += 2 + _MSCAN_RESERVED_DSR_SIZE;
- }
-+ /* write remaining byte if necessary */
-+ if (frame->can_dlc & 1)
-+ out_8(data, frame->data[frame->can_dlc - 1]);
- }
+diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
+index 9a517c2..a50cfcb 100644
+--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
+@@ -449,7 +449,7 @@ struct bnx2x_rx_mode_obj {
+
+ int (*wait_comp)(struct bnx2x *bp,
+ struct bnx2x_rx_mode_ramrod_params *p);
+-};
++} __no_const;
- out_8(&regs->tx.dlr, frame->can_dlc);
-@@ -330,10 +332,13 @@ static void mscan_get_rx_frame(struct net_device *dev, struct can_frame *frame)
- void __iomem *data = &regs->rx.dsr1_0;
- u16 *payload = (u16 *)frame->data;
+ /********************** Set multicast group ***********************************/
-- for (i = 0; i < (frame->can_dlc + 1) / 2; i++) {
-+ for (i = 0; i < frame->can_dlc / 2; i++) {
- *payload++ = in_be16(data);
- data += 2 + _MSCAN_RESERVED_DSR_SIZE;
- }
-+ /* read remaining byte if necessary */
-+ if (frame->can_dlc & 1)
-+ frame->data[frame->can_dlc - 1] = in_8(data);
- }
-
- out_8(&regs->canrflg, MSCAN_RXF);
-diff --git a/drivers/net/cxgb3/l2t.h b/drivers/net/cxgb3/l2t.h
-index c4dd066..f49b7cf 100644
---- a/drivers/net/cxgb3/l2t.h
-+++ b/drivers/net/cxgb3/l2t.h
+diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
+index 94b4bd0..73c02de 100644
+--- a/drivers/net/ethernet/broadcom/tg3.h
++++ b/drivers/net/ethernet/broadcom/tg3.h
+@@ -134,6 +134,7 @@
+ #define CHIPREV_ID_5750_A0 0x4000
+ #define CHIPREV_ID_5750_A1 0x4001
+ #define CHIPREV_ID_5750_A3 0x4003
++#define CHIPREV_ID_5750_C1 0x4201
+ #define CHIPREV_ID_5750_C2 0x4202
+ #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 c5f5479..2e8c260 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,
*/
struct l2t_skb_cb {
@@ -32071,71 +32474,132 @@ index c4dd066..f49b7cf 100644
#define L2T_SKB_CB(skb) ((struct l2t_skb_cb *)(skb)->cb)
-diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
-index 7e3cfbe..da1b61a 100644
---- a/drivers/net/cxgb4/cxgb4_main.c
-+++ b/drivers/net/cxgb4/cxgb4_main.c
-@@ -3396,6 +3396,8 @@ static int __devinit enable_msix(struct adapter *adap)
- unsigned int nchan = adap->params.nports;
- struct msix_entry entries[MAX_INGQ + 1];
+diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
+index 871bcaa..4043505 100644
+--- a/drivers/net/ethernet/dec/tulip/de4x5.c
++++ b/drivers/net/ethernet/dec/tulip/de4x5.c
+@@ -5397,7 +5397,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+ for (i=0; i<ETH_ALEN; i++) {
+ tmp.addr[i] = dev->dev_addr[i];
+ }
+- if (copy_to_user(ioc->data, tmp.addr, ioc->len)) return -EFAULT;
++ if (ioc->len > sizeof tmp.addr || copy_to_user(ioc->data, tmp.addr, ioc->len)) return -EFAULT;
+ break;
-+ pax_track_stack();
-+
- for (i = 0; i < ARRAY_SIZE(entries); ++i)
- entries[i].entry = i;
+ case DE4X5_SET_HWADDR: /* Set the hardware address */
+@@ -5437,7 +5437,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+ spin_lock_irqsave(&lp->lock, flags);
+ memcpy(&statbuf, &lp->pktStats, ioc->len);
+ spin_unlock_irqrestore(&lp->lock, flags);
+- if (copy_to_user(ioc->data, &statbuf, ioc->len))
++ if (ioc->len > sizeof statbuf || copy_to_user(ioc->data, &statbuf, ioc->len))
+ return -EFAULT;
+ break;
+ }
+diff --git a/drivers/net/ethernet/dec/tulip/eeprom.c b/drivers/net/ethernet/dec/tulip/eeprom.c
+index 14d5b61..1398636 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}};
-diff --git a/drivers/net/cxgb4/t4_hw.c b/drivers/net/cxgb4/t4_hw.c
-index d1ec111..12735bc 100644
---- a/drivers/net/cxgb4/t4_hw.c
-+++ b/drivers/net/cxgb4/t4_hw.c
-@@ -362,6 +362,8 @@ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
- u8 vpd[VPD_LEN], csum;
- unsigned int vpdr_len, kw_offset, id_len;
-+ pax_track_stack();
-+
- ret = pci_read_vpd(adapter->pdev, VPD_BASE, sizeof(vpd), vpd);
- if (ret < 0)
- return ret;
-diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
-index 8295f21..9a2a54b 100644
---- a/drivers/net/e1000e/82571.c
-+++ b/drivers/net/e1000e/82571.c
-@@ -239,7 +239,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+-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 4d01219..b58d26d 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 dcd7f7a..ecb7fb3 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 bf266a0..e024af7 100644
+--- a/drivers/net/ethernet/emulex/benet/be_main.c
++++ b/drivers/net/ethernet/emulex/benet/be_main.c
+@@ -397,7 +397,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val)
+
+ if (wrapped)
+ newacc += 65536;
+- ACCESS_ONCE(*acc) = newacc;
++ ACCESS_ONCE_RW(*acc) = newacc;
+ }
+
+ void be_parse_stats(struct be_adapter *adapter)
+diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c
+index 61d2bdd..7f1154a 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/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+index e1159e5..e18684d 100644
+--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
++++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+@@ -205,7 +205,7 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
struct e1000_mac_info *mac = &hw->mac;
- struct e1000_mac_operations *func = &mac->ops;
+ e1000_mac_operations_no_const *func = &mac->ops;
- u32 swsm = 0;
- u32 swsm2 = 0;
- bool force_clear_smbi = false;
-diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
-index f4bbeb2..e0c338a 100644
---- a/drivers/net/e1000e/es2lan.c
-+++ b/drivers/net/e1000e/es2lan.c
-@@ -205,7 +205,7 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+
+ /* Set media type */
+ switch (adapter->pdev->device) {
+diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
+index a3e65fd..f451444 100644
+--- a/drivers/net/ethernet/intel/e1000e/82571.c
++++ b/drivers/net/ethernet/intel/e1000e/82571.c
+@@ -239,7 +239,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
struct e1000_mac_info *mac = &hw->mac;
- struct e1000_mac_operations *func = &mac->ops;
+ e1000_mac_operations_no_const *func = &mac->ops;
-
- /* Set media type */
- switch (adapter->pdev->device) {
-diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
-index 6c2fa83..268930d 100644
---- a/drivers/net/e1000e/hw.h
-+++ b/drivers/net/e1000e/hw.h
-@@ -776,6 +776,7 @@ struct e1000_mac_operations {
+ u32 swsm = 0;
+ u32 swsm2 = 0;
+ bool force_clear_smbi = false;
+diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
+index 2967039..ca8c40c 100644
+--- a/drivers/net/ethernet/intel/e1000e/hw.h
++++ b/drivers/net/ethernet/intel/e1000e/hw.h
+@@ -778,6 +778,7 @@ struct e1000_mac_operations {
void (*write_vfta)(struct e1000_hw *, u32, u32);
s32 (*read_mac_addr)(struct e1000_hw *);
};
+typedef struct e1000_mac_operations __no_const e1000_mac_operations_no_const;
- /* Function pointers for the PHY. */
- struct e1000_phy_operations {
-@@ -799,6 +800,7 @@ struct e1000_phy_operations {
+ /*
+ * When to use various PHY register access functions:
+@@ -818,6 +819,7 @@ struct e1000_phy_operations {
void (*power_up)(struct e1000_hw *);
void (*power_down)(struct e1000_hw *);
};
@@ -32143,7 +32607,7 @@ index 6c2fa83..268930d 100644
/* Function pointers for the NVM. */
struct e1000_nvm_operations {
-@@ -810,9 +812,10 @@ struct e1000_nvm_operations {
+@@ -829,9 +831,10 @@ struct e1000_nvm_operations {
s32 (*validate)(struct e1000_hw *);
s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
};
@@ -32155,7 +32619,7 @@ index 6c2fa83..268930d 100644
u8 addr[ETH_ALEN];
u8 perm_addr[ETH_ALEN];
-@@ -853,7 +856,7 @@ struct e1000_mac_info {
+@@ -872,7 +875,7 @@ struct e1000_mac_info {
};
struct e1000_phy_info {
@@ -32164,7 +32628,7 @@ index 6c2fa83..268930d 100644
enum e1000_phy_type type;
-@@ -887,7 +890,7 @@ struct e1000_phy_info {
+@@ -906,7 +909,7 @@ struct e1000_phy_info {
};
struct e1000_nvm_info {
@@ -32173,36 +32637,10 @@ index 6c2fa83..268930d 100644
enum e1000_nvm_type type;
enum e1000_nvm_override override;
-diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
-index dd54abe..fafe1ed2 100644
---- a/drivers/net/fealnx.c
-+++ b/drivers/net/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/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
-index 0d28378..816c05c 100644
---- a/drivers/net/hamradio/6pack.c
-+++ b/drivers/net/hamradio/6pack.c
-@@ -463,6 +463,8 @@ static void sixpack_receive_buf(struct tty_struct *tty,
- unsigned char buf[512];
- int count1;
-
-+ pax_track_stack();
-+
- if (!count)
- return;
-
-diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
-index 27153e8..c83eccc 100644
---- a/drivers/net/igb/e1000_hw.h
-+++ b/drivers/net/igb/e1000_hw.h
+diff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h
+index 4519a13..f97fcd0 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 *);
@@ -32271,10 +32709,10 @@ index 27153e8..c83eccc 100644
struct e1000_mbx_stats stats;
u32 timeout;
u32 usec_delay;
-diff --git a/drivers/net/igbvf/vf.h b/drivers/net/igbvf/vf.h
+diff --git a/drivers/net/ethernet/intel/igbvf/vf.h b/drivers/net/ethernet/intel/igbvf/vf.h
index d7ed58f..64cde36 100644
---- a/drivers/net/igbvf/vf.h
-+++ b/drivers/net/igbvf/vf.h
+--- 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);
@@ -32304,38 +32742,11 @@ index d7ed58f..64cde36 100644
struct e1000_mbx_stats stats;
u32 timeout;
u32 usec_delay;
-diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
-index 6a130eb..1aeb9e4 100644
---- a/drivers/net/ixgb/ixgb_main.c
-+++ b/drivers/net/ixgb/ixgb_main.c
-@@ -1070,6 +1070,8 @@ ixgb_set_multi(struct net_device *netdev)
- u32 rctl;
- int i;
-
-+ pax_track_stack();
-+
- /* Check for Promiscuous and All Multicast modes */
-
- rctl = IXGB_READ_REG(hw, RCTL);
-diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
-index dd7fbeb..44b9bbf 100644
---- a/drivers/net/ixgb/ixgb_param.c
-+++ b/drivers/net/ixgb/ixgb_param.c
-@@ -261,6 +261,9 @@ void __devinit
- ixgb_check_options(struct ixgb_adapter *adapter)
- {
- int bd = adapter->bd_number;
-+
-+ pax_track_stack();
-+
- if (bd >= IXGB_MAX_NIC) {
- pr_notice("Warning: no configuration for board #%i\n", bd);
- pr_notice("Using defaults for all values\n");
-diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
-index fa43f25..4ead8f7 100644
---- a/drivers/net/ixgbe/ixgbe_type.h
-+++ b/drivers/net/ixgbe/ixgbe_type.h
-@@ -2584,6 +2584,7 @@ struct ixgbe_eeprom_operations {
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+index 6c5cca8..de8ef63 100644
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+@@ -2708,6 +2708,7 @@ struct ixgbe_eeprom_operations {
s32 (*update_checksum)(struct ixgbe_hw *);
u16 (*calc_checksum)(struct ixgbe_hw *);
};
@@ -32343,15 +32754,15 @@ index fa43f25..4ead8f7 100644
struct ixgbe_mac_operations {
s32 (*init_hw)(struct ixgbe_hw *);
-@@ -2639,6 +2640,7 @@ struct ixgbe_mac_operations {
- /* Flow Control */
- s32 (*fc_enable)(struct ixgbe_hw *, s32);
+@@ -2769,6 +2770,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;
struct ixgbe_phy_operations {
s32 (*identify)(struct ixgbe_hw *);
-@@ -2658,9 +2660,10 @@ struct ixgbe_phy_operations {
+@@ -2788,9 +2790,10 @@ struct ixgbe_phy_operations {
s32 (*write_i2c_eeprom)(struct ixgbe_hw *, u8, u8);
s32 (*check_overtemp)(struct ixgbe_hw *);
};
@@ -32363,7 +32774,7 @@ index fa43f25..4ead8f7 100644
enum ixgbe_eeprom_type type;
u32 semaphore_delay;
u16 word_size;
-@@ -2670,7 +2673,7 @@ struct ixgbe_eeprom_info {
+@@ -2800,7 +2803,7 @@ struct ixgbe_eeprom_info {
#define IXGBE_FLAGS_DOUBLE_RESET_REQUIRED 0x01
struct ixgbe_mac_info {
@@ -32372,7 +32783,7 @@ index fa43f25..4ead8f7 100644
enum ixgbe_mac_type type;
u8 addr[IXGBE_ETH_LENGTH_OF_ADDRESS];
u8 perm_addr[IXGBE_ETH_LENGTH_OF_ADDRESS];
-@@ -2698,7 +2701,7 @@ struct ixgbe_mac_info {
+@@ -2828,7 +2831,7 @@ struct ixgbe_mac_info {
};
struct ixgbe_phy_info {
@@ -32381,7 +32792,7 @@ index fa43f25..4ead8f7 100644
struct mdio_if_info mdio;
enum ixgbe_phy_type type;
u32 id;
-@@ -2726,6 +2729,7 @@ struct ixgbe_mbx_operations {
+@@ -2856,6 +2859,7 @@ struct ixgbe_mbx_operations {
s32 (*check_for_ack)(struct ixgbe_hw *, u16);
s32 (*check_for_rst)(struct ixgbe_hw *, u16);
};
@@ -32389,7 +32800,7 @@ index fa43f25..4ead8f7 100644
struct ixgbe_mbx_stats {
u32 msgs_tx;
-@@ -2737,7 +2741,7 @@ struct ixgbe_mbx_stats {
+@@ -2867,7 +2871,7 @@ struct ixgbe_mbx_stats {
};
struct ixgbe_mbx_info {
@@ -32398,10 +32809,10 @@ index fa43f25..4ead8f7 100644
struct ixgbe_mbx_stats stats;
u32 timeout;
u32 usec_delay;
-diff --git a/drivers/net/ixgbevf/vf.h b/drivers/net/ixgbevf/vf.h
+diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.h b/drivers/net/ethernet/intel/ixgbevf/vf.h
index 10306b4..28df758 100644
---- a/drivers/net/ixgbevf/vf.h
-+++ b/drivers/net/ixgbevf/vf.h
+--- 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);
@@ -32436,23 +32847,10 @@ index 10306b4..28df758 100644
struct ixgbe_mbx_stats stats;
u32 timeout;
u32 udelay;
-diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
-index 41ea592..358ca61 100644
---- a/drivers/net/ksz884x.c
-+++ b/drivers/net/ksz884x.c
-@@ -6534,6 +6534,8 @@ static void netdev_get_ethtool_stats(struct net_device *dev,
- int rc;
- u64 counter[TOTAL_PORT_COUNTER_NUM];
-
-+ pax_track_stack();
-+
- mutex_lock(&hw_priv->lock);
- n = SWITCH_PORT_NUM;
- for (i = 0, p = port->first_port; i < port->mib_port_cnt; i++, p++) {
-diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
-index 3814fc9..7333446 100644
---- a/drivers/net/mlx4/main.c
-+++ b/drivers/net/mlx4/main.c
+diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
+index 94bbc85..78c12e6 100644
+--- a/drivers/net/ethernet/mellanox/mlx4/main.c
++++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -40,6 +40,7 @@
#include <linux/dma-mapping.h>
#include <linux/slab.h>
@@ -32461,681 +32859,37 @@ index 3814fc9..7333446 100644
#include <linux/mlx4/device.h>
#include <linux/mlx4/doorbell.h>
-@@ -764,6 +765,8 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
- u64 icm_size;
- int err;
+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;
-+ pax_track_stack();
-+
- err = mlx4_QUERY_FW(dev);
- if (err) {
- if (err == -EACCES)
-diff --git a/drivers/net/niu.c b/drivers/net/niu.c
-index 2f8c351..6a733b3 100644
---- a/drivers/net/niu.c
-+++ b/drivers/net/niu.c
-@@ -9056,6 +9056,8 @@ static void __devinit niu_try_msix(struct niu *np, u8 *ldg_num_map)
- int i, num_irqs, err;
- u8 first_ldg;
-
-+ pax_track_stack();
-+
- first_ldg = (NIU_NUM_LDG / parent->num_ports) * np->port;
- for (i = 0; i < (NIU_NUM_LDG / parent->num_ports); i++)
- ldg_num_map[i] = first_ldg + i;
-diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
-index b48aba9..8dfaf74 100644
---- a/drivers/net/pcnet32.c
-+++ b/drivers/net/pcnet32.c
-@@ -82,7 +82,7 @@ static int cards_found;
/*
- * VLB I/O addresses
- */
--static unsigned int pcnet32_portlist[] __initdata =
-+static unsigned int pcnet32_portlist[] __devinitdata =
- { 0x300, 0x320, 0x340, 0x360, 0 };
-
- static int pcnet32_debug;
-@@ -270,7 +270,7 @@ struct pcnet32_private {
- struct sk_buff **rx_skbuff;
- dma_addr_t *tx_dma_addr;
- dma_addr_t *rx_dma_addr;
-- struct pcnet32_access a;
-+ struct pcnet32_access *a;
- spinlock_t lock; /* Guard lock */
- unsigned int cur_rx, cur_tx; /* The next free ring entry */
- unsigned int rx_ring_size; /* current rx ring size */
-@@ -460,9 +460,9 @@ static void pcnet32_netif_start(struct net_device *dev)
- u16 val;
-
- netif_wake_queue(dev);
-- val = lp->a.read_csr(ioaddr, CSR3);
-+ val = lp->a->read_csr(ioaddr, CSR3);
- val &= 0x00ff;
-- lp->a.write_csr(ioaddr, CSR3, val);
-+ lp->a->write_csr(ioaddr, CSR3, val);
- napi_enable(&lp->napi);
- }
-
-@@ -730,7 +730,7 @@ static u32 pcnet32_get_link(struct net_device *dev)
- r = mii_link_ok(&lp->mii_if);
- } else if (lp->chip_version >= PCNET32_79C970A) {
- ulong ioaddr = dev->base_addr; /* card base I/O address */
-- r = (lp->a.read_bcr(ioaddr, 4) != 0xc0);
-+ r = (lp->a->read_bcr(ioaddr, 4) != 0xc0);
- } else { /* can not detect link on really old chips */
- r = 1;
- }
-@@ -792,7 +792,7 @@ static int pcnet32_set_ringparam(struct net_device *dev,
- pcnet32_netif_stop(dev);
-
- spin_lock_irqsave(&lp->lock, flags);
-- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
-
- size = min(ering->tx_pending, (unsigned int)TX_MAX_RING_SIZE);
-
-@@ -868,7 +868,7 @@ static void pcnet32_ethtool_test(struct net_device *dev,
- static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
- {
- struct pcnet32_private *lp = netdev_priv(dev);
-- struct pcnet32_access *a = &lp->a; /* access to registers */
-+ struct pcnet32_access *a = lp->a; /* access to registers */
- ulong ioaddr = dev->base_addr; /* card base I/O address */
- struct sk_buff *skb; /* sk buff */
- int x, i; /* counters */
-@@ -888,21 +888,21 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
- pcnet32_netif_stop(dev);
-
- spin_lock_irqsave(&lp->lock, flags);
-- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */
-
- numbuffs = min(numbuffs, (int)min(lp->rx_ring_size, lp->tx_ring_size));
-
- /* Reset the PCNET32 */
-- lp->a.reset(ioaddr);
-- lp->a.write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
-+ lp->a->reset(ioaddr);
-+ lp->a->write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
-
- /* switch pcnet32 to 32bit mode */
-- lp->a.write_bcr(ioaddr, 20, 2);
-+ lp->a->write_bcr(ioaddr, 20, 2);
-
- /* purge & init rings but don't actually restart */
- pcnet32_restart(dev, 0x0000);
-
-- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
-
- /* Initialize Transmit buffers. */
- size = data_len + 15;
-@@ -947,10 +947,10 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
-
- /* set int loopback in CSR15 */
- x = a->read_csr(ioaddr, CSR15) & 0xfffc;
-- lp->a.write_csr(ioaddr, CSR15, x | 0x0044);
-+ lp->a->write_csr(ioaddr, CSR15, x | 0x0044);
-
- teststatus = cpu_to_le16(0x8000);
-- lp->a.write_csr(ioaddr, CSR0, CSR0_START); /* Set STRT bit */
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_START); /* Set STRT bit */
-
- /* Check status of descriptors */
- for (x = 0; x < numbuffs; x++) {
-@@ -969,7 +969,7 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
- }
- }
-
-- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP); /* Set STOP bit */
- wmb();
- if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) {
- netdev_printk(KERN_DEBUG, dev, "RX loopback packets:\n");
-@@ -1015,7 +1015,7 @@ clean_up:
- pcnet32_restart(dev, CSR0_NORMAL);
- } else {
- pcnet32_purge_rx_ring(dev);
-- lp->a.write_bcr(ioaddr, 20, 4); /* return to 16bit mode */
-+ lp->a->write_bcr(ioaddr, 20, 4); /* return to 16bit mode */
- }
- spin_unlock_irqrestore(&lp->lock, flags);
-
-@@ -1026,7 +1026,7 @@ static int pcnet32_set_phys_id(struct net_device *dev,
- enum ethtool_phys_id_state state)
- {
- struct pcnet32_private *lp = netdev_priv(dev);
-- struct pcnet32_access *a = &lp->a;
-+ struct pcnet32_access *a = lp->a;
- ulong ioaddr = dev->base_addr;
- unsigned long flags;
- int i;
-@@ -1067,7 +1067,7 @@ static int pcnet32_suspend(struct net_device *dev, unsigned long *flags,
- {
- int csr5;
- struct pcnet32_private *lp = netdev_priv(dev);
-- struct pcnet32_access *a = &lp->a;
-+ struct pcnet32_access *a = lp->a;
- ulong ioaddr = dev->base_addr;
- int ticks;
-
-@@ -1324,8 +1324,8 @@ static int pcnet32_poll(struct napi_struct *napi, int budget)
- spin_lock_irqsave(&lp->lock, flags);
- if (pcnet32_tx(dev)) {
- /* reset the chip to clear the error condition, then restart */
-- lp->a.reset(ioaddr);
-- lp->a.write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
-+ lp->a->reset(ioaddr);
-+ lp->a->write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
- pcnet32_restart(dev, CSR0_START);
- netif_wake_queue(dev);
- }
-@@ -1337,12 +1337,12 @@ static int pcnet32_poll(struct napi_struct *napi, int budget)
- __napi_complete(napi);
-
- /* clear interrupt masks */
-- val = lp->a.read_csr(ioaddr, CSR3);
-+ val = lp->a->read_csr(ioaddr, CSR3);
- val &= 0x00ff;
-- lp->a.write_csr(ioaddr, CSR3, val);
-+ lp->a->write_csr(ioaddr, CSR3, val);
-
- /* Set interrupt enable. */
-- lp->a.write_csr(ioaddr, CSR0, CSR0_INTEN);
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_INTEN);
-
- spin_unlock_irqrestore(&lp->lock, flags);
- }
-@@ -1365,7 +1365,7 @@ static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
- int i, csr0;
- u16 *buff = ptr;
- struct pcnet32_private *lp = netdev_priv(dev);
-- struct pcnet32_access *a = &lp->a;
-+ struct pcnet32_access *a = lp->a;
- ulong ioaddr = dev->base_addr;
- unsigned long flags;
-
-@@ -1401,9 +1401,9 @@ static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
- for (j = 0; j < PCNET32_MAX_PHYS; j++) {
- if (lp->phymask & (1 << j)) {
- for (i = 0; i < PCNET32_REGS_PER_PHY; i++) {
-- lp->a.write_bcr(ioaddr, 33,
-+ lp->a->write_bcr(ioaddr, 33,
- (j << 5) | i);
-- *buff++ = lp->a.read_bcr(ioaddr, 34);
-+ *buff++ = lp->a->read_bcr(ioaddr, 34);
- }
- }
- }
-@@ -1785,7 +1785,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
- ((cards_found >= MAX_UNITS) || full_duplex[cards_found]))
- lp->options |= PCNET32_PORT_FD;
-
-- lp->a = *a;
-+ lp->a = a;
-
- /* prior to register_netdev, dev->name is not yet correct */
- if (pcnet32_alloc_ring(dev, pci_name(lp->pci_dev))) {
-@@ -1844,7 +1844,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
- if (lp->mii) {
- /* lp->phycount and lp->phymask are set to 0 by memset above */
-
-- lp->mii_if.phy_id = ((lp->a.read_bcr(ioaddr, 33)) >> 5) & 0x1f;
-+ lp->mii_if.phy_id = ((lp->a->read_bcr(ioaddr, 33)) >> 5) & 0x1f;
- /* scan for PHYs */
- for (i = 0; i < PCNET32_MAX_PHYS; i++) {
- unsigned short id1, id2;
-@@ -1864,7 +1864,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
- pr_info("Found PHY %04x:%04x at address %d\n",
- id1, id2, i);
- }
-- lp->a.write_bcr(ioaddr, 33, (lp->mii_if.phy_id) << 5);
-+ lp->a->write_bcr(ioaddr, 33, (lp->mii_if.phy_id) << 5);
- if (lp->phycount > 1)
- lp->options |= PCNET32_PORT_MII;
- }
-@@ -2020,10 +2020,10 @@ static int pcnet32_open(struct net_device *dev)
- }
-
- /* Reset the PCNET32 */
-- lp->a.reset(ioaddr);
-+ lp->a->reset(ioaddr);
-
- /* switch pcnet32 to 32bit mode */
-- lp->a.write_bcr(ioaddr, 20, 2);
-+ lp->a->write_bcr(ioaddr, 20, 2);
-
- netif_printk(lp, ifup, KERN_DEBUG, dev,
- "%s() irq %d tx/rx rings %#x/%#x init %#x\n",
-@@ -2032,14 +2032,14 @@ static int pcnet32_open(struct net_device *dev)
- (u32) (lp->init_dma_addr));
-
- /* set/reset autoselect bit */
-- val = lp->a.read_bcr(ioaddr, 2) & ~2;
-+ val = lp->a->read_bcr(ioaddr, 2) & ~2;
- if (lp->options & PCNET32_PORT_ASEL)
- val |= 2;
-- lp->a.write_bcr(ioaddr, 2, val);
-+ lp->a->write_bcr(ioaddr, 2, val);
-
- /* handle full duplex setting */
- if (lp->mii_if.full_duplex) {
-- val = lp->a.read_bcr(ioaddr, 9) & ~3;
-+ val = lp->a->read_bcr(ioaddr, 9) & ~3;
- if (lp->options & PCNET32_PORT_FD) {
- val |= 1;
- if (lp->options == (PCNET32_PORT_FD | PCNET32_PORT_AUI))
-@@ -2049,14 +2049,14 @@ static int pcnet32_open(struct net_device *dev)
- if (lp->chip_version == 0x2627)
- val |= 3;
- }
-- lp->a.write_bcr(ioaddr, 9, val);
-+ lp->a->write_bcr(ioaddr, 9, val);
- }
-
- /* set/reset GPSI bit in test register */
-- val = lp->a.read_csr(ioaddr, 124) & ~0x10;
-+ val = lp->a->read_csr(ioaddr, 124) & ~0x10;
- if ((lp->options & PCNET32_PORT_PORTSEL) == PCNET32_PORT_GPSI)
- val |= 0x10;
-- lp->a.write_csr(ioaddr, 124, val);
-+ lp->a->write_csr(ioaddr, 124, val);
-
- /* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */
- if (pdev && pdev->subsystem_vendor == PCI_VENDOR_ID_AT &&
-@@ -2075,24 +2075,24 @@ static int pcnet32_open(struct net_device *dev)
- * duplex, and/or enable auto negotiation, and clear DANAS
- */
- if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) {
-- lp->a.write_bcr(ioaddr, 32,
-- lp->a.read_bcr(ioaddr, 32) | 0x0080);
-+ lp->a->write_bcr(ioaddr, 32,
-+ lp->a->read_bcr(ioaddr, 32) | 0x0080);
- /* disable Auto Negotiation, set 10Mpbs, HD */
-- val = lp->a.read_bcr(ioaddr, 32) & ~0xb8;
-+ val = lp->a->read_bcr(ioaddr, 32) & ~0xb8;
- if (lp->options & PCNET32_PORT_FD)
- val |= 0x10;
- if (lp->options & PCNET32_PORT_100)
- val |= 0x08;
-- lp->a.write_bcr(ioaddr, 32, val);
-+ lp->a->write_bcr(ioaddr, 32, val);
- } else {
- if (lp->options & PCNET32_PORT_ASEL) {
-- lp->a.write_bcr(ioaddr, 32,
-- lp->a.read_bcr(ioaddr,
-+ lp->a->write_bcr(ioaddr, 32,
-+ lp->a->read_bcr(ioaddr,
- 32) | 0x0080);
- /* enable auto negotiate, setup, disable fd */
-- val = lp->a.read_bcr(ioaddr, 32) & ~0x98;
-+ val = lp->a->read_bcr(ioaddr, 32) & ~0x98;
- val |= 0x20;
-- lp->a.write_bcr(ioaddr, 32, val);
-+ lp->a->write_bcr(ioaddr, 32, val);
- }
- }
- } else {
-@@ -2105,10 +2105,10 @@ static int pcnet32_open(struct net_device *dev)
- * There is really no good other way to handle multiple PHYs
- * other than turning off all automatics
- */
-- val = lp->a.read_bcr(ioaddr, 2);
-- lp->a.write_bcr(ioaddr, 2, val & ~2);
-- val = lp->a.read_bcr(ioaddr, 32);
-- lp->a.write_bcr(ioaddr, 32, val & ~(1 << 7)); /* stop MII manager */
-+ val = lp->a->read_bcr(ioaddr, 2);
-+ lp->a->write_bcr(ioaddr, 2, val & ~2);
-+ val = lp->a->read_bcr(ioaddr, 32);
-+ lp->a->write_bcr(ioaddr, 32, val & ~(1 << 7)); /* stop MII manager */
-
- if (!(lp->options & PCNET32_PORT_ASEL)) {
- /* setup ecmd */
-@@ -2118,7 +2118,7 @@ static int pcnet32_open(struct net_device *dev)
- ethtool_cmd_speed_set(&ecmd,
- (lp->options & PCNET32_PORT_100) ?
- SPEED_100 : SPEED_10);
-- bcr9 = lp->a.read_bcr(ioaddr, 9);
-+ bcr9 = lp->a->read_bcr(ioaddr, 9);
-
- if (lp->options & PCNET32_PORT_FD) {
- ecmd.duplex = DUPLEX_FULL;
-@@ -2127,7 +2127,7 @@ static int pcnet32_open(struct net_device *dev)
- ecmd.duplex = DUPLEX_HALF;
- bcr9 |= ~(1 << 0);
- }
-- lp->a.write_bcr(ioaddr, 9, bcr9);
-+ lp->a->write_bcr(ioaddr, 9, bcr9);
- }
-
- for (i = 0; i < PCNET32_MAX_PHYS; i++) {
-@@ -2158,9 +2158,9 @@ static int pcnet32_open(struct net_device *dev)
-
- #ifdef DO_DXSUFLO
- if (lp->dxsuflo) { /* Disable transmit stop on underflow */
-- val = lp->a.read_csr(ioaddr, CSR3);
-+ val = lp->a->read_csr(ioaddr, CSR3);
- val |= 0x40;
-- lp->a.write_csr(ioaddr, CSR3, val);
-+ lp->a->write_csr(ioaddr, CSR3, val);
- }
- #endif
-
-@@ -2176,11 +2176,11 @@ static int pcnet32_open(struct net_device *dev)
- napi_enable(&lp->napi);
-
- /* Re-initialize the PCNET32, and start it when done. */
-- lp->a.write_csr(ioaddr, 1, (lp->init_dma_addr & 0xffff));
-- lp->a.write_csr(ioaddr, 2, (lp->init_dma_addr >> 16));
-+ lp->a->write_csr(ioaddr, 1, (lp->init_dma_addr & 0xffff));
-+ lp->a->write_csr(ioaddr, 2, (lp->init_dma_addr >> 16));
-
-- lp->a.write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
-- lp->a.write_csr(ioaddr, CSR0, CSR0_INIT);
-+ lp->a->write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_INIT);
-
- netif_start_queue(dev);
-
-@@ -2192,19 +2192,19 @@ static int pcnet32_open(struct net_device *dev)
-
- i = 0;
- while (i++ < 100)
-- if (lp->a.read_csr(ioaddr, CSR0) & CSR0_IDON)
-+ if (lp->a->read_csr(ioaddr, CSR0) & CSR0_IDON)
- break;
- /*
- * We used to clear the InitDone bit, 0x0100, here but Mark Stockton
- * reports that doing so triggers a bug in the '974.
- */
-- lp->a.write_csr(ioaddr, CSR0, CSR0_NORMAL);
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_NORMAL);
-
- netif_printk(lp, ifup, KERN_DEBUG, dev,
- "pcnet32 open after %d ticks, init block %#x csr0 %4.4x\n",
- i,
- (u32) (lp->init_dma_addr),
-- lp->a.read_csr(ioaddr, CSR0));
-+ lp->a->read_csr(ioaddr, CSR0));
-
- spin_unlock_irqrestore(&lp->lock, flags);
-
-@@ -2218,7 +2218,7 @@ err_free_ring:
- * Switch back to 16bit mode to avoid problems with dumb
- * DOS packet driver after a warm reboot
- */
-- lp->a.write_bcr(ioaddr, 20, 4);
-+ lp->a->write_bcr(ioaddr, 20, 4);
-
- err_free_irq:
- spin_unlock_irqrestore(&lp->lock, flags);
-@@ -2323,7 +2323,7 @@ static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
-
- /* wait for stop */
- for (i = 0; i < 100; i++)
-- if (lp->a.read_csr(ioaddr, CSR0) & CSR0_STOP)
-+ if (lp->a->read_csr(ioaddr, CSR0) & CSR0_STOP)
- break;
-
- if (i >= 100)
-@@ -2335,13 +2335,13 @@ static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
- return;
-
- /* ReInit Ring */
-- lp->a.write_csr(ioaddr, CSR0, CSR0_INIT);
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_INIT);
- i = 0;
- while (i++ < 1000)
-- if (lp->a.read_csr(ioaddr, CSR0) & CSR0_IDON)
-+ if (lp->a->read_csr(ioaddr, CSR0) & CSR0_IDON)
- break;
-
-- lp->a.write_csr(ioaddr, CSR0, csr0_bits);
-+ lp->a->write_csr(ioaddr, CSR0, csr0_bits);
- }
-
- static void pcnet32_tx_timeout(struct net_device *dev)
-@@ -2353,8 +2353,8 @@ static void pcnet32_tx_timeout(struct net_device *dev)
- /* Transmitter timeout, serious problems. */
- if (pcnet32_debug & NETIF_MSG_DRV)
- pr_err("%s: transmit timed out, status %4.4x, resetting\n",
-- dev->name, lp->a.read_csr(ioaddr, CSR0));
-- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
-+ dev->name, lp->a->read_csr(ioaddr, CSR0));
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
- dev->stats.tx_errors++;
- if (netif_msg_tx_err(lp)) {
- int i;
-@@ -2397,7 +2397,7 @@ static netdev_tx_t pcnet32_start_xmit(struct sk_buff *skb,
-
- netif_printk(lp, tx_queued, KERN_DEBUG, dev,
- "%s() called, csr0 %4.4x\n",
-- __func__, lp->a.read_csr(ioaddr, CSR0));
-+ __func__, lp->a->read_csr(ioaddr, CSR0));
-
- /* Default status -- will not enable Successful-TxDone
- * interrupt when that option is available to us.
-@@ -2427,7 +2427,7 @@ static netdev_tx_t pcnet32_start_xmit(struct sk_buff *skb,
- dev->stats.tx_bytes += skb->len;
-
- /* Trigger an immediate send poll. */
-- lp->a.write_csr(ioaddr, CSR0, CSR0_INTEN | CSR0_TXPOLL);
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_INTEN | CSR0_TXPOLL);
-
- if (lp->tx_ring[(entry + 1) & lp->tx_mod_mask].base != 0) {
- lp->tx_full = 1;
-@@ -2452,16 +2452,16 @@ pcnet32_interrupt(int irq, void *dev_id)
-
- spin_lock(&lp->lock);
-
-- csr0 = lp->a.read_csr(ioaddr, CSR0);
-+ csr0 = lp->a->read_csr(ioaddr, CSR0);
- while ((csr0 & 0x8f00) && --boguscnt >= 0) {
- if (csr0 == 0xffff)
- break; /* PCMCIA remove happened */
- /* Acknowledge all of the current interrupt sources ASAP. */
-- lp->a.write_csr(ioaddr, CSR0, csr0 & ~0x004f);
-+ lp->a->write_csr(ioaddr, CSR0, csr0 & ~0x004f);
-
- netif_printk(lp, intr, KERN_DEBUG, dev,
- "interrupt csr0=%#2.2x new csr=%#2.2x\n",
-- csr0, lp->a.read_csr(ioaddr, CSR0));
-+ csr0, lp->a->read_csr(ioaddr, CSR0));
-
- /* Log misc errors. */
- if (csr0 & 0x4000)
-@@ -2488,19 +2488,19 @@ pcnet32_interrupt(int irq, void *dev_id)
- if (napi_schedule_prep(&lp->napi)) {
- u16 val;
- /* set interrupt masks */
-- val = lp->a.read_csr(ioaddr, CSR3);
-+ val = lp->a->read_csr(ioaddr, CSR3);
- val |= 0x5f00;
-- lp->a.write_csr(ioaddr, CSR3, val);
-+ lp->a->write_csr(ioaddr, CSR3, val);
-
- __napi_schedule(&lp->napi);
- break;
- }
-- csr0 = lp->a.read_csr(ioaddr, CSR0);
-+ csr0 = lp->a->read_csr(ioaddr, CSR0);
- }
-
- netif_printk(lp, intr, KERN_DEBUG, dev,
- "exiting interrupt, csr0=%#4.4x\n",
-- lp->a.read_csr(ioaddr, CSR0));
-+ lp->a->read_csr(ioaddr, CSR0));
-
- spin_unlock(&lp->lock);
-
-@@ -2520,20 +2520,20 @@ static int pcnet32_close(struct net_device *dev)
-
- spin_lock_irqsave(&lp->lock, flags);
-
-- dev->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112);
-+ dev->stats.rx_missed_errors = lp->a->read_csr(ioaddr, 112);
-
- netif_printk(lp, ifdown, KERN_DEBUG, dev,
- "Shutting down ethercard, status was %2.2x\n",
-- lp->a.read_csr(ioaddr, CSR0));
-+ lp->a->read_csr(ioaddr, CSR0));
-
- /* We stop the PCNET32 here -- it occasionally polls memory if we don't. */
-- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
-
- /*
- * Switch back to 16bit mode to avoid problems with dumb
- * DOS packet driver after a warm reboot
- */
-- lp->a.write_bcr(ioaddr, 20, 4);
-+ lp->a->write_bcr(ioaddr, 20, 4);
-
- spin_unlock_irqrestore(&lp->lock, flags);
-
-@@ -2556,7 +2556,7 @@ static struct net_device_stats *pcnet32_get_stats(struct net_device *dev)
- unsigned long flags;
-
- spin_lock_irqsave(&lp->lock, flags);
-- dev->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112);
-+ dev->stats.rx_missed_errors = lp->a->read_csr(ioaddr, 112);
- spin_unlock_irqrestore(&lp->lock, flags);
-
- return &dev->stats;
-@@ -2578,10 +2578,10 @@ static void pcnet32_load_multicast(struct net_device *dev)
- if (dev->flags & IFF_ALLMULTI) {
- ib->filter[0] = cpu_to_le32(~0U);
- ib->filter[1] = cpu_to_le32(~0U);
-- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER, 0xffff);
-- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+1, 0xffff);
-- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+2, 0xffff);
-- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+3, 0xffff);
-+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER, 0xffff);
-+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+1, 0xffff);
-+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+2, 0xffff);
-+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+3, 0xffff);
- return;
- }
- /* clear the multicast filter */
-@@ -2601,7 +2601,7 @@ static void pcnet32_load_multicast(struct net_device *dev)
- mcast_table[crc >> 4] |= cpu_to_le16(1 << (crc & 0xf));
- }
- for (i = 0; i < 4; i++)
-- lp->a.write_csr(ioaddr, PCNET32_MC_FILTER + i,
-+ lp->a->write_csr(ioaddr, PCNET32_MC_FILTER + i,
- le16_to_cpu(mcast_table[i]));
- }
-
-@@ -2616,28 +2616,28 @@ static void pcnet32_set_multicast_list(struct net_device *dev)
-
- spin_lock_irqsave(&lp->lock, flags);
- suspended = pcnet32_suspend(dev, &flags, 0);
-- csr15 = lp->a.read_csr(ioaddr, CSR15);
-+ csr15 = lp->a->read_csr(ioaddr, CSR15);
- if (dev->flags & IFF_PROMISC) {
- /* Log any net taps. */
- netif_info(lp, hw, dev, "Promiscuous mode enabled\n");
- lp->init_block->mode =
- cpu_to_le16(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) <<
- 7);
-- lp->a.write_csr(ioaddr, CSR15, csr15 | 0x8000);
-+ lp->a->write_csr(ioaddr, CSR15, csr15 | 0x8000);
- } else {
- lp->init_block->mode =
- cpu_to_le16((lp->options & PCNET32_PORT_PORTSEL) << 7);
-- lp->a.write_csr(ioaddr, CSR15, csr15 & 0x7fff);
-+ lp->a->write_csr(ioaddr, CSR15, csr15 & 0x7fff);
- pcnet32_load_multicast(dev);
- }
-
- if (suspended) {
- int csr5;
- /* clear SUSPEND (SPND) - CSR5 bit 0 */
-- csr5 = lp->a.read_csr(ioaddr, CSR5);
-- lp->a.write_csr(ioaddr, CSR5, csr5 & (~CSR5_SUSPEND));
-+ csr5 = lp->a->read_csr(ioaddr, CSR5);
-+ lp->a->write_csr(ioaddr, CSR5, csr5 & (~CSR5_SUSPEND));
- } else {
-- lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
-+ lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
- pcnet32_restart(dev, CSR0_NORMAL);
- netif_wake_queue(dev);
- }
-@@ -2655,8 +2655,8 @@ static int mdio_read(struct net_device *dev, int phy_id, int reg_num)
- if (!lp->mii)
- return 0;
-
-- lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
-- val_out = lp->a.read_bcr(ioaddr, 34);
-+ lp->a->write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
-+ val_out = lp->a->read_bcr(ioaddr, 34);
-
- return val_out;
- }
-@@ -2670,8 +2670,8 @@ static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val)
- if (!lp->mii)
- return;
-
-- lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
-- lp->a.write_bcr(ioaddr, 34, val);
-+ lp->a->write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
-+ lp->a->write_bcr(ioaddr, 34, val);
- }
-
- static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-@@ -2748,7 +2748,7 @@ static void pcnet32_check_media(struct net_device *dev, int verbose)
- curr_link = mii_link_ok(&lp->mii_if);
- } else {
- ulong ioaddr = dev->base_addr; /* card base I/O address */
-- curr_link = (lp->a.read_bcr(ioaddr, 4) != 0xc0);
-+ curr_link = (lp->a->read_bcr(ioaddr, 4) != 0xc0);
- }
- if (!curr_link) {
- if (prev_link || verbose) {
-@@ -2771,13 +2771,13 @@ static void pcnet32_check_media(struct net_device *dev, int verbose)
- (ecmd.duplex == DUPLEX_FULL)
- ? "full" : "half");
- }
-- bcr9 = lp->a.read_bcr(dev->base_addr, 9);
-+ bcr9 = lp->a->read_bcr(dev->base_addr, 9);
- if ((bcr9 & (1 << 0)) != lp->mii_if.full_duplex) {
- if (lp->mii_if.full_duplex)
- bcr9 |= (1 << 0);
- else
- bcr9 &= ~(1 << 0);
-- lp->a.write_bcr(dev->base_addr, 9, bcr9);
-+ lp->a->write_bcr(dev->base_addr, 9, bcr9);
- }
- } else {
- netif_info(lp, link, dev, "link up\n");
-diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
-index 4609bc0..b0e9d0a 100644
---- a/drivers/net/ppp_generic.c
-+++ b/drivers/net/ppp_generic.c
-@@ -987,7 +987,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;
-- char *vers;
-
- switch (cmd) {
- case SIOCGPPPSTATS:
-@@ -1009,8 +1008,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
- break;
+ * 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;
- case SIOCGPPPVER:
-- vers = PPP_VERSION;
-- if (copy_to_user(addr, vers, strlen(vers) + 1))
-+ if (copy_to_user(addr, PPP_VERSION, sizeof(PPP_VERSION)))
- break;
- err = 0;
- break;
-diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
-index 5f838ef..0ecfabe 100644
---- a/drivers/net/r8169.c
-+++ b/drivers/net/r8169.c
-@@ -645,12 +645,12 @@ struct rtl8169_private {
+ #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath) \
+ ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next)
+diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
+index c8f47f1..5da9840 100644
+--- a/drivers/net/ethernet/realtek/r8169.c
++++ b/drivers/net/ethernet/realtek/r8169.c
+@@ -698,17 +698,17 @@ struct rtl8169_private {
struct mdio_ops {
void (*write)(void __iomem *, int, int);
int (*read)(void __iomem *, int);
@@ -33148,13 +32902,19 @@ index 5f838ef..0ecfabe 100644
- } pll_power_ops;
+ } __no_const pll_power_ops;
+ struct jumbo_ops {
+ void (*enable)(struct rtl8169_private *);
+ void (*disable)(struct rtl8169_private *);
+- } jumbo_ops;
++ } __no_const jumbo_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/sis190.c b/drivers/net/sis190.c
-index f6d26ab..054113f 100644
---- a/drivers/net/sis190.c
-+++ b/drivers/net/sis190.c
-@@ -1623,7 +1623,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
+diff --git a/drivers/net/ethernet/sis/sis190.c b/drivers/net/ethernet/sis/sis190.c
+index 1b4658c..a30dabb 100644
+--- a/drivers/net/ethernet/sis/sis190.c
++++ b/drivers/net/ethernet/sis/sis190.c
+@@ -1624,7 +1624,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)
{
@@ -33163,31 +32923,28 @@ index f6d26ab..054113f 100644
struct sis190_private *tp = netdev_priv(dev);
struct pci_dev *isa_bridge;
u8 reg, tmp8;
-diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
-index 4793df8..44c9849 100644
---- a/drivers/net/sundance.c
-+++ b/drivers/net/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/tg3.h b/drivers/net/tg3.h
-index 5b3d2f3..fd324d8 100644
---- a/drivers/net/tg3.h
-+++ b/drivers/net/tg3.h
-@@ -134,6 +134,7 @@
- #define CHIPREV_ID_5750_A0 0x4000
- #define CHIPREV_ID_5750_A1 0x4001
- #define CHIPREV_ID_5750_A3 0x4003
-+#define CHIPREV_ID_5750_C1 0x4201
- #define CHIPREV_ID_5750_C2 0x4202
- #define CHIPREV_ID_5752_A0_HW 0x5000
- #define CHIPREV_ID_5752_A0 0x6000
+diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
+index edfa15d..002bfa9 100644
+--- a/drivers/net/ppp/ppp_generic.c
++++ b/drivers/net/ppp/ppp_generic.c
+@@ -987,7 +987,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;
+- char *vers;
+
+ switch (cmd) {
+ case SIOCGPPPSTATS:
+@@ -1009,8 +1008,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ break;
+
+ case SIOCGPPPVER:
+- vers = PPP_VERSION;
+- if (copy_to_user(addr, vers, strlen(vers) + 1))
++ if (copy_to_user(addr, PPP_VERSION, sizeof(PPP_VERSION)))
+ break;
+ err = 0;
+ break;
diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c
index 515f122..41dd273 100644
--- a/drivers/net/tokenring/abyss.c
@@ -33209,7 +32966,7 @@ index 515f122..41dd273 100644
return pci_register_driver(&abyss_driver);
}
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
-index 2bedc0a..2bb69d3 100644
+index 6153cfd..cf69c1c 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -744,9 +744,11 @@ static struct mca_driver madgemc_driver = {
@@ -33265,67 +33022,6 @@ index 46db5c5..37c1536 100644
err = platform_driver_register(&sk_isa_driver);
if (err)
-diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
-index e2f6923..b9398d8 100644
---- a/drivers/net/tulip/de2104x.c
-+++ b/drivers/net/tulip/de2104x.c
-@@ -1794,6 +1794,8 @@ static void __devinit de21041_get_srom_info (struct de_private *de)
- struct de_srom_info_leaf *il;
- void *bufp;
-
-+ pax_track_stack();
-+
- /* download entire eeprom */
- for (i = 0; i < DE_EEPROM_WORDS; i++)
- ((__le16 *)ee_data)[i] =
-diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
-index efaa1d6..f763636 100644
---- a/drivers/net/tulip/de4x5.c
-+++ b/drivers/net/tulip/de4x5.c
-@@ -5401,7 +5401,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
- for (i=0; i<ETH_ALEN; i++) {
- tmp.addr[i] = dev->dev_addr[i];
- }
-- if (copy_to_user(ioc->data, tmp.addr, ioc->len)) return -EFAULT;
-+ if (ioc->len > sizeof tmp.addr || copy_to_user(ioc->data, tmp.addr, ioc->len)) return -EFAULT;
- break;
-
- case DE4X5_SET_HWADDR: /* Set the hardware address */
-@@ -5441,7 +5441,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
- spin_lock_irqsave(&lp->lock, flags);
- memcpy(&statbuf, &lp->pktStats, ioc->len);
- spin_unlock_irqrestore(&lp->lock, flags);
-- if (copy_to_user(ioc->data, &statbuf, ioc->len))
-+ if (ioc->len > sizeof statbuf || copy_to_user(ioc->data, &statbuf, ioc->len))
- return -EFAULT;
- break;
- }
-diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
-index fa5eee9..e074432 100644
---- a/drivers/net/tulip/eeprom.c
-+++ b/drivers/net/tulip/eeprom.c
-@@ -81,7 +81,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/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
-index 862eadf..3eee1e6 100644
---- a/drivers/net/tulip/winbond-840.c
-+++ b/drivers/net/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/usb/hso.c b/drivers/net/usb/hso.c
index 304fe78..db112fa 100644
--- a/drivers/net/usb/hso.c
@@ -33427,10 +33123,10 @@ index 304fe78..db112fa 100644
hso_start_serial_device(serial_table[i], GFP_NOIO);
hso_kick_transmit(dev2ser(serial_table[i]));
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
-index dc959fe..5eb190d 100644
+index e662cbc..8d4a102 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
-@@ -594,8 +594,7 @@ vmxnet3_set_rss_indir(struct net_device *netdev,
+@@ -601,8 +601,7 @@ vmxnet3_set_rss_indir(struct net_device *netdev,
* Return with error code if any of the queue indices
* is out of range
*/
@@ -33440,172 +33136,11 @@ index dc959fe..5eb190d 100644
return -EINVAL;
}
-diff --git a/drivers/net/vxge/vxge-config.h b/drivers/net/vxge/vxge-config.h
-index 359b9b9..404aea6 100644
---- a/drivers/net/vxge/vxge-config.h
-+++ b/drivers/net/vxge/vxge-config.h
-@@ -512,7 +512,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/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
-index 8ab870a..91b9e61 100644
---- a/drivers/net/vxge/vxge-main.c
-+++ b/drivers/net/vxge/vxge-main.c
-@@ -98,6 +98,8 @@ static inline void VXGE_COMPLETE_VPATH_TX(struct vxge_fifo *fifo)
- struct sk_buff *completed[NR_SKB_COMPLETED];
- int more;
-
-+ pax_track_stack();
-+
- do {
- more = 0;
- skb_ptr = completed;
-@@ -1920,6 +1922,8 @@ static enum vxge_hw_status vxge_rth_configure(struct vxgedev *vdev)
- u8 mtable[256] = {0}; /* CPU to vpath mapping */
- int index;
-
-+ pax_track_stack();
-+
- /*
- * Filling
- * - itable with bucket numbers
-diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h
-index 4a518a3..936b334 100644
---- a/drivers/net/vxge/vxge-traffic.h
-+++ b/drivers/net/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)
-diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c
-index cf9e15f..9789469 100644
---- a/drivers/net/wan/cycx_x25.c
-+++ b/drivers/net/wan/cycx_x25.c
-@@ -1018,6 +1018,8 @@ static void hex_dump(char *msg, unsigned char *p, int len)
- unsigned char hex[1024],
- * phex = hex;
-
-+ pax_track_stack();
-+
- if (len >= (sizeof(hex) / 2))
- len = (sizeof(hex) / 2) - 1;
-
-diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
-index 70527e5..02eedb6 100644
---- a/drivers/net/wan/hdlc_x25.c
-+++ b/drivers/net/wan/hdlc_x25.c
-@@ -136,16 +136,16 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev)
-
- static int x25_open(struct net_device *dev)
- {
-- struct lapb_register_struct cb;
-+ static struct lapb_register_struct cb = {
-+ .connect_confirmation = x25_connected,
-+ .connect_indication = x25_connected,
-+ .disconnect_confirmation = x25_disconnected,
-+ .disconnect_indication = x25_disconnected,
-+ .data_indication = x25_data_indication,
-+ .data_transmit = x25_data_transmit
-+ };
- int result;
-
-- cb.connect_confirmation = x25_connected;
-- cb.connect_indication = x25_connected;
-- cb.disconnect_confirmation = x25_disconnected;
-- cb.disconnect_indication = x25_disconnected;
-- cb.data_indication = x25_data_indication;
-- cb.data_transmit = x25_data_transmit;
--
- result = lapb_register(dev, &cb);
- if (result != LAPB_OK)
- return result;
-diff --git a/drivers/net/wimax/i2400m/usb-fw.c b/drivers/net/wimax/i2400m/usb-fw.c
-index 1fda46c..f2858f2 100644
---- a/drivers/net/wimax/i2400m/usb-fw.c
-+++ b/drivers/net/wimax/i2400m/usb-fw.c
-@@ -287,6 +287,8 @@ ssize_t i2400mu_bus_bm_wait_for_ack(struct i2400m *i2400m,
- int do_autopm = 1;
- DECLARE_COMPLETION_ONSTACK(notif_completion);
-
-+ pax_track_stack();
-+
- d_fnstart(8, dev, "(i2400m %p ack %p size %zu)\n",
- i2400m, ack, ack_size);
- BUG_ON(_ack == i2400m->bm_ack_buf);
-diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
-index e1b3e3c..e413f18 100644
---- a/drivers/net/wireless/airo.c
-+++ b/drivers/net/wireless/airo.c
-@@ -3003,6 +3003,8 @@ static void airo_process_scan_results (struct airo_info *ai) {
- BSSListElement * loop_net;
- BSSListElement * tmp_net;
-
-+ pax_track_stack();
-+
- /* Blow away current list of scan results */
- list_for_each_entry_safe (loop_net, tmp_net, &ai->network_list, list) {
- list_move_tail (&loop_net->list, &ai->network_free_list);
-@@ -3794,6 +3796,8 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
- WepKeyRid wkr;
- int rc;
-
-+ pax_track_stack();
-+
- memset( &mySsid, 0, sizeof( mySsid ) );
- kfree (ai->flash);
- ai->flash = NULL;
-@@ -4753,6 +4757,8 @@ static int proc_stats_rid_open( struct inode *inode,
- __le32 *vals = stats.vals;
- int len;
-
-+ pax_track_stack();
-+
- if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
- return -ENOMEM;
- data = file->private_data;
-@@ -5476,6 +5482,8 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
- /* If doLoseSync is not 1, we won't do a Lose Sync */
- int doLoseSync = -1;
-
-+ pax_track_stack();
-+
- if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
- return -ENOMEM;
- data = file->private_data;
-@@ -7181,6 +7189,8 @@ static int airo_get_aplist(struct net_device *dev,
- int i;
- int loseSync = capable(CAP_NET_ADMIN) ? 1: -1;
-
-+ pax_track_stack();
-+
- qual = kmalloc(IW_MAX_AP * sizeof(*qual), GFP_KERNEL);
- if (!qual)
- return -ENOMEM;
-@@ -7741,6 +7751,8 @@ static void airo_read_wireless_stats(struct airo_info *local)
- CapabilityRid cap_rid;
- __le32 *vals = stats_rid.vals;
-
-+ pax_track_stack();
-+
- /* Get stats out of the card */
- clear_bit(JOB_WSTATS, &local->jobs);
- if (local->power.event) {
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
-index 7cf4317..0db3a44 100644
+index 0f9ee46..e2d6e65 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
-@@ -121,6 +121,7 @@ struct ath_ops {
+@@ -119,6 +119,7 @@ struct ath_ops {
void (*write_flush) (void *);
u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr);
};
@@ -33613,184 +33148,216 @@ index 7cf4317..0db3a44 100644
struct ath_common;
struct ath_bus_ops;
-diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
-index 0bf7313..f232bfc 100644
---- a/drivers/net/wireless/ath/ath5k/debug.c
-+++ b/drivers/net/wireless/ath/ath5k/debug.c
-@@ -204,6 +204,8 @@ static ssize_t read_file_beacon(struct file *file, char __user *user_buf,
- unsigned int v;
- u64 tsf;
-
-+ pax_track_stack();
-+
- v = ath5k_hw_reg_read(sc->ah, AR5K_BEACON);
- len += snprintf(buf+len, sizeof(buf)-len,
- "%-24s0x%08x\tintval: %d\tTIM: 0x%x\n",
-@@ -323,6 +325,8 @@ static ssize_t read_file_debug(struct file *file, char __user *user_buf,
- unsigned int len = 0;
- unsigned int i;
-
-+ pax_track_stack();
-+
- len += snprintf(buf+len, sizeof(buf)-len,
- "DEBUG LEVEL: 0x%08x\n\n", sc->debug.level);
-
-@@ -384,6 +388,8 @@ static ssize_t read_file_antenna(struct file *file, char __user *user_buf,
- unsigned int i;
- unsigned int v;
-
-+ pax_track_stack();
-+
- len += snprintf(buf+len, sizeof(buf)-len, "antenna mode\t%d\n",
- sc->ah->ah_ant_mode);
- len += snprintf(buf+len, sizeof(buf)-len, "default antenna\t%d\n",
-@@ -494,6 +500,8 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
- unsigned int len = 0;
- u32 filt = ath5k_hw_get_rx_filter(sc->ah);
-
-+ pax_track_stack();
-+
- len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
- sc->bssidmask);
- len += snprintf(buf+len, sizeof(buf)-len, "filter-flags: 0x%x ",
-@@ -550,6 +558,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
- unsigned int len = 0;
- int i;
-
-+ pax_track_stack();
-+
- len += snprintf(buf+len, sizeof(buf)-len,
- "RX\n---------------------\n");
- len += snprintf(buf+len, sizeof(buf)-len, "CRC\t%u\t(%u%%)\n",
-@@ -667,6 +677,8 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf,
- char buf[700];
- unsigned int len = 0;
-
-+ pax_track_stack();
-+
- len += snprintf(buf+len, sizeof(buf)-len,
- "HW has PHY error counters:\t%s\n",
- sc->ah->ah_capabilities.cap_has_phyerr_counters ?
-@@ -827,6 +839,8 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
- struct ath5k_buf *bf, *bf0;
- int i, n;
-
-+ pax_track_stack();
-+
- len += snprintf(buf+len, sizeof(buf)-len,
- "available txbuffers: %d\n", sc->txbuf_len);
-
-diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
-index 7c2aaad..ad14dee 100644
---- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
-@@ -758,6 +758,8 @@ static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah)
- int i, im, j;
- int nmeasurement;
-
-+ pax_track_stack();
-+
- for (i = 0; i < AR9300_MAX_CHAINS; i++) {
- if (ah->txchainmask & (1 << i))
- num_chains++;
-diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-index e4d6a87..8ed13ba 100644
---- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
-@@ -356,6 +356,8 @@ static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)
- int theta_low_bin = 0;
- int i;
+diff --git a/drivers/net/wireless/ath/ath9k/ar9002_mac.c b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
+index b592016..fe47870 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)
+ ads->ds_txstatus6 = ads->ds_txstatus7 = 0;
+ ads->ds_txstatus8 = ads->ds_txstatus9 = 0;
+
+- ACCESS_ONCE(ads->ds_link) = i->link;
+- ACCESS_ONCE(ads->ds_data) = i->buf_addr[0];
++ ACCESS_ONCE_RW(ads->ds_link) = i->link;
++ ACCESS_ONCE_RW(ads->ds_data) = i->buf_addr[0];
+
+ 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)
+
+ if ((i->is_first || i->is_last) &&
+ i->aggr != AGGR_BUF_MIDDLE && i->aggr != AGGR_BUF_LAST) {
+- ACCESS_ONCE(ads->ds_ctl2) = set11nTries(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ds_ctl2) = set11nTries(i->rates, 0)
+ | set11nTries(i->rates, 1)
+ | set11nTries(i->rates, 2)
+ | set11nTries(i->rates, 3)
+ | (i->dur_update ? AR_DurUpdateEna : 0)
+ | SM(0, AR_BurstDur);
+
+- ACCESS_ONCE(ads->ds_ctl3) = set11nRate(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ds_ctl3) = set11nRate(i->rates, 0)
+ | set11nRate(i->rates, 1)
+ | set11nRate(i->rates, 2)
+ | set11nRate(i->rates, 3);
+ } else {
+- ACCESS_ONCE(ads->ds_ctl2) = 0;
+- ACCESS_ONCE(ads->ds_ctl3) = 0;
++ ACCESS_ONCE_RW(ads->ds_ctl2) = 0;
++ ACCESS_ONCE_RW(ads->ds_ctl3) = 0;
+ }
+
+ if (!i->is_first) {
+- ACCESS_ONCE(ads->ds_ctl0) = 0;
+- ACCESS_ONCE(ads->ds_ctl1) = ctl1;
+- ACCESS_ONCE(ads->ds_ctl6) = ctl6;
++ ACCESS_ONCE_RW(ads->ds_ctl0) = 0;
++ ACCESS_ONCE_RW(ads->ds_ctl1) = ctl1;
++ ACCESS_ONCE_RW(ads->ds_ctl6) = ctl6;
+ return;
+ }
-+ pax_track_stack();
-+
- /* disregard any bin that contains <= 16 samples */
- thresh_accum_cnt = 16;
- scale_factor = 5;
-diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
-index d55ffd7..f7935a9 100644
---- a/drivers/net/wireless/ath/ath9k/debug.c
-+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -337,6 +337,8 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
- char buf[512];
- unsigned int len = 0;
-
-+ pax_track_stack();
-+
- if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
- len += snprintf(buf + len, sizeof(buf) - len,
- "%8s: %10u\n", "RXLP", sc->debug.stats.istats.rxlp);
-@@ -427,6 +429,8 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
- u8 addr[ETH_ALEN];
- u32 tmp;
-
-+ pax_track_stack();
-+
- len += snprintf(buf + len, sizeof(buf) - len,
- "%s (chan=%d center-freq: %d MHz channel-type: %d (%s))\n",
- wiphy_name(sc->hw->wiphy),
-diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
-index aa48b3a..947f9fa 100644
---- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
-+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
-@@ -31,6 +31,8 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
- unsigned int len = 0;
- int ret = 0;
+@@ -242,7 +242,7 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
+ break;
+ }
-+ pax_track_stack();
-+
- memset(&cmd_rsp, 0, sizeof(cmd_rsp));
+- ACCESS_ONCE(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
++ ACCESS_ONCE_RW(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
+ | (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)
+ | (i->flags & ATH9K_TXDESC_RTSENA ? AR_RTSEnable :
+ (i->flags & ATH9K_TXDESC_CTSENA ? AR_CTSEnable : 0));
- ath9k_htc_ps_wakeup(priv);
-@@ -89,6 +91,8 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf,
- unsigned int len = 0;
- int ret = 0;
+- ACCESS_ONCE(ads->ds_ctl1) = ctl1;
+- ACCESS_ONCE(ads->ds_ctl6) = ctl6;
++ ACCESS_ONCE_RW(ads->ds_ctl1) = ctl1;
++ ACCESS_ONCE_RW(ads->ds_ctl6) = ctl6;
-+ pax_track_stack();
-+
- memset(&cmd_rsp, 0, sizeof(cmd_rsp));
+ if (i->aggr == AGGR_BUF_MIDDLE || i->aggr == AGGR_BUF_LAST)
+ return;
- ath9k_htc_ps_wakeup(priv);
-@@ -159,6 +163,8 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf,
- unsigned int len = 0;
- int ret = 0;
+- ACCESS_ONCE(ads->ds_ctl4) = set11nPktDurRTSCTS(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ds_ctl4) = set11nPktDurRTSCTS(i->rates, 0)
+ | set11nPktDurRTSCTS(i->rates, 1);
+
+- ACCESS_ONCE(ads->ds_ctl5) = set11nPktDurRTSCTS(i->rates, 2)
++ ACCESS_ONCE_RW(ads->ds_ctl5) = set11nPktDurRTSCTS(i->rates, 2)
+ | set11nPktDurRTSCTS(i->rates, 3);
+
+- ACCESS_ONCE(ads->ds_ctl7) = set11nRateFlags(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ds_ctl7) = set11nRateFlags(i->rates, 0)
+ | set11nRateFlags(i->rates, 1)
+ | 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 ccde784..db012b3 100644
+--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+@@ -35,47 +35,47 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
+ (i->qcu << AR_TxQcuNum_S) | 0x17;
+
+ checksum += val;
+- ACCESS_ONCE(ads->info) = val;
++ ACCESS_ONCE_RW(ads->info) = val;
+
+ checksum += i->link;
+- ACCESS_ONCE(ads->link) = i->link;
++ ACCESS_ONCE_RW(ads->link) = i->link;
+
+ checksum += i->buf_addr[0];
+- ACCESS_ONCE(ads->data0) = i->buf_addr[0];
++ ACCESS_ONCE_RW(ads->data0) = i->buf_addr[0];
+ checksum += i->buf_addr[1];
+- ACCESS_ONCE(ads->data1) = i->buf_addr[1];
++ ACCESS_ONCE_RW(ads->data1) = i->buf_addr[1];
+ checksum += i->buf_addr[2];
+- ACCESS_ONCE(ads->data2) = i->buf_addr[2];
++ ACCESS_ONCE_RW(ads->data2) = i->buf_addr[2];
+ checksum += i->buf_addr[3];
+- ACCESS_ONCE(ads->data3) = i->buf_addr[3];
++ ACCESS_ONCE_RW(ads->data3) = i->buf_addr[3];
+
+ checksum += (val = (i->buf_len[0] << AR_BufLen_S) & AR_BufLen);
+- ACCESS_ONCE(ads->ctl3) = val;
++ ACCESS_ONCE_RW(ads->ctl3) = val;
+ checksum += (val = (i->buf_len[1] << AR_BufLen_S) & AR_BufLen);
+- ACCESS_ONCE(ads->ctl5) = val;
++ ACCESS_ONCE_RW(ads->ctl5) = val;
+ checksum += (val = (i->buf_len[2] << AR_BufLen_S) & AR_BufLen);
+- ACCESS_ONCE(ads->ctl7) = val;
++ ACCESS_ONCE_RW(ads->ctl7) = val;
+ checksum += (val = (i->buf_len[3] << AR_BufLen_S) & AR_BufLen);
+- ACCESS_ONCE(ads->ctl9) = val;
++ ACCESS_ONCE_RW(ads->ctl9) = val;
+
+ checksum = (u16) (((checksum & 0xffff) + (checksum >> 16)) & 0xffff);
+- ACCESS_ONCE(ads->ctl10) = checksum;
++ ACCESS_ONCE_RW(ads->ctl10) = checksum;
+
+ if (i->is_first || i->is_last) {
+- ACCESS_ONCE(ads->ctl13) = set11nTries(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ctl13) = set11nTries(i->rates, 0)
+ | set11nTries(i->rates, 1)
+ | set11nTries(i->rates, 2)
+ | set11nTries(i->rates, 3)
+ | (i->dur_update ? AR_DurUpdateEna : 0)
+ | SM(0, AR_BurstDur);
+
+- ACCESS_ONCE(ads->ctl14) = set11nRate(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ctl14) = set11nRate(i->rates, 0)
+ | set11nRate(i->rates, 1)
+ | set11nRate(i->rates, 2)
+ | set11nRate(i->rates, 3);
+ } else {
+- ACCESS_ONCE(ads->ctl13) = 0;
+- ACCESS_ONCE(ads->ctl14) = 0;
++ ACCESS_ONCE_RW(ads->ctl13) = 0;
++ ACCESS_ONCE_RW(ads->ctl14) = 0;
+ }
+
+ ads->ctl20 = 0;
+@@ -84,17 +84,17 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
+
+ ctl17 = SM(i->keytype, AR_EncrType);
+ if (!i->is_first) {
+- ACCESS_ONCE(ads->ctl11) = 0;
+- ACCESS_ONCE(ads->ctl12) = i->is_last ? 0 : AR_TxMore;
+- ACCESS_ONCE(ads->ctl15) = 0;
+- ACCESS_ONCE(ads->ctl16) = 0;
+- ACCESS_ONCE(ads->ctl17) = ctl17;
+- ACCESS_ONCE(ads->ctl18) = 0;
+- ACCESS_ONCE(ads->ctl19) = 0;
++ ACCESS_ONCE_RW(ads->ctl11) = 0;
++ ACCESS_ONCE_RW(ads->ctl12) = i->is_last ? 0 : AR_TxMore;
++ ACCESS_ONCE_RW(ads->ctl15) = 0;
++ ACCESS_ONCE_RW(ads->ctl16) = 0;
++ ACCESS_ONCE_RW(ads->ctl17) = ctl17;
++ ACCESS_ONCE_RW(ads->ctl18) = 0;
++ ACCESS_ONCE_RW(ads->ctl19) = 0;
+ return;
+ }
-+ pax_track_stack();
-+
- memset(&cmd_rsp, 0, sizeof(cmd_rsp));
+- ACCESS_ONCE(ads->ctl11) = (i->pkt_len & AR_FrameLen)
++ ACCESS_ONCE_RW(ads->ctl11) = (i->pkt_len & AR_FrameLen)
+ | (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
+ | SM(i->txpower, AR_XmitPower)
+ | (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
+@@ -130,22 +130,22 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
+ val = (i->flags & ATH9K_TXDESC_PAPRD) >> ATH9K_TXDESC_PAPRD_S;
+ ctl12 |= SM(val, AR_PAPRDChainMask);
- ath9k_htc_ps_wakeup(priv);
-@@ -203,6 +209,8 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
- char buf[512];
- unsigned int len = 0;
+- ACCESS_ONCE(ads->ctl12) = ctl12;
+- ACCESS_ONCE(ads->ctl17) = ctl17;
++ ACCESS_ONCE_RW(ads->ctl12) = ctl12;
++ ACCESS_ONCE_RW(ads->ctl17) = ctl17;
-+ pax_track_stack();
-+
- len += snprintf(buf + len, sizeof(buf) - len,
- "%20s : %10u\n", "Buffers queued",
- priv->debug.tx_stats.buf_queued);
-@@ -376,6 +384,8 @@ static ssize_t read_file_slot(struct file *file, char __user *user_buf,
- char buf[512];
- unsigned int len = 0;
+- ACCESS_ONCE(ads->ctl15) = set11nPktDurRTSCTS(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ctl15) = set11nPktDurRTSCTS(i->rates, 0)
+ | set11nPktDurRTSCTS(i->rates, 1);
-+ pax_track_stack();
-+
- spin_lock_bh(&priv->tx.tx_lock);
+- ACCESS_ONCE(ads->ctl16) = set11nPktDurRTSCTS(i->rates, 2)
++ ACCESS_ONCE_RW(ads->ctl16) = set11nPktDurRTSCTS(i->rates, 2)
+ | set11nPktDurRTSCTS(i->rates, 3);
- len += snprintf(buf + len, sizeof(buf) - len, "TX slot bitmap : ");
-@@ -411,6 +421,8 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
- char buf[512];
- unsigned int len = 0;
+- ACCESS_ONCE(ads->ctl18) = set11nRateFlags(i->rates, 0)
++ ACCESS_ONCE_RW(ads->ctl18) = set11nRateFlags(i->rates, 0)
+ | set11nRateFlags(i->rates, 1)
+ | set11nRateFlags(i->rates, 2)
+ | set11nRateFlags(i->rates, 3)
+ | SM(i->rtscts_rate, AR_RTSCTSRate);
-+ pax_track_stack();
-+
- len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
- "Mgmt endpoint", skb_queue_len(&priv->tx.mgmt_ep_queue));
+- ACCESS_ONCE(ads->ctl19) = AR_Not_Sounding;
++ ACCESS_ONCE_RW(ads->ctl19) = AR_Not_Sounding;
+ }
+ 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 939cc9d..67a3943 100644
+index f389b3c..7359e18 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -585,7 +585,7 @@ struct ath_hw_private_ops {
+@@ -605,7 +605,7 @@ struct ath_hw_private_ops {
/* ANI */
void (*ani_cache_ini_regs)(struct ath_hw *ah);
@@ -33799,7 +33366,7 @@ index 939cc9d..67a3943 100644
/**
* struct ath_hw_ops - callbacks used by hardware code and driver code
-@@ -637,7 +637,7 @@ struct ath_hw_ops {
+@@ -635,7 +635,7 @@ struct ath_hw_ops {
void (*antdiv_comb_conf_set)(struct ath_hw *ah,
struct ath_hw_antcomb_conf *antconf);
@@ -33808,8 +33375,8 @@ index 939cc9d..67a3943 100644
struct ath_nf_limits {
s16 max;
-@@ -650,7 +650,7 @@ struct ath_nf_limits {
- #define AH_UNPLUGGED 0x2 /* The card has been physically removed. */
+@@ -655,7 +655,7 @@ enum ath_cal_list {
+ #define AH_FASTCC 0x4
struct ath_hw {
- struct ath_ops reg_ops;
@@ -33817,46 +33384,24 @@ index 939cc9d..67a3943 100644
struct ieee80211_hw *hw;
struct ath_common common;
-diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
-index 4430775..a509155 100644
---- a/drivers/net/wireless/ipw2x00/ipw2100.c
-+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
-@@ -2100,6 +2100,8 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
- int err;
- DECLARE_SSID_BUF(ssid);
-
-+ pax_track_stack();
-+
- IPW_DEBUG_HC("SSID: '%s'\n", print_ssid(ssid, essid, ssid_len));
-
- if (ssid_len)
-@@ -5449,6 +5451,8 @@ static int ipw2100_set_key(struct ipw2100_priv *priv,
- struct ipw2100_wep_key *wep_key = (void *)cmd.host_command_parameters;
- int err;
-
-+ pax_track_stack();
-+
- IPW_DEBUG_HC("WEP_KEY_INFO: index = %d, len = %d/%d\n",
- idx, keylen, len);
-
-diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
-index e5ad76c..c8bd5b4 100644
---- a/drivers/net/wireless/ipw2x00/libipw_rx.c
-+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
-@@ -1565,6 +1565,8 @@ static void libipw_process_probe_response(struct libipw_device
- unsigned long flags;
- DECLARE_SSID_BUF(ssid);
+diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
+index bea8524..c677c06 100644
+--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
++++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
+@@ -547,7 +547,7 @@ struct phy_func_ptr {
+ void (*carrsuppr)(struct brcms_phy *);
+ s32 (*rxsigpwr)(struct brcms_phy *, s32);
+ void (*detach)(struct brcms_phy *);
+-};
++} __no_const;
-+ pax_track_stack();
-+
- LIBIPW_DEBUG_SCAN("'%s' (%pM"
- "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
- print_ssid(ssid, info_element->data, info_element->len),
+ struct brcms_phy {
+ struct brcms_phy_pub pubpi_ro;
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
-index 421d5c8..b66312e 100644
+index b282d86..bee832f 100644
--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
-@@ -3962,7 +3962,9 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
+@@ -3686,7 +3686,9 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
*/
if (iwl3945_mod_params.disable_hw_scan) {
IWL_DEBUG_INFO(priv, "Disabling hw_scan\n");
@@ -33867,83 +33412,26 @@ index 421d5c8..b66312e 100644
}
IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
-diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
-index 592b0cf..890faad 100644
---- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
-+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
-@@ -910,6 +910,8 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
- struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
- struct iwl_rxon_context *ctx = sta_priv->common.ctx;
-
-+ pax_track_stack();
-+
- IWL_DEBUG_RATE_LIMIT(priv, "get frame ack response, update rate scale window\n");
-
- /* Treat uninitialized rate scaling data same as non-existing. */
-@@ -2918,6 +2920,8 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
- container_of(lq_sta, struct iwl_station_priv, lq_sta);
- struct iwl_link_quality_cmd *lq_cmd = &lq_sta->lq;
-
-+ pax_track_stack();
-+
- /* Override starting rate (index 0) if needed for debug purposes */
- rs_dbgfs_set_mcs(lq_sta, &new_rate, index);
-
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
-index 2824ccb..b5630ca 100644
+index 69a77e2..552b42c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
-@@ -68,8 +68,8 @@ do { \
+@@ -71,8 +71,8 @@ do { \
} while (0)
#else
--#define IWL_DEBUG(__priv, level, fmt, args...)
--#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...)
-+#define IWL_DEBUG(__priv, level, fmt, args...) do {} while (0)
-+#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) do {} while (0)
- static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
- const void *p, u32 len)
- {}
-diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
-index 0e6a04b..39636b6 100644
---- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
-+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
-@@ -548,6 +548,8 @@ static ssize_t iwl_dbgfs_status_read(struct file *file,
- int pos = 0;
- const size_t bufsz = sizeof(buf);
-
-+ pax_track_stack();
-+
- pos += scnprintf(buf + pos, bufsz - pos, "STATUS_HCMD_ACTIVE:\t %d\n",
- test_bit(STATUS_HCMD_ACTIVE, &priv->status));
- pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INT_ENABLED:\t %d\n",
-@@ -680,6 +682,8 @@ static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf,
- char buf[256 * NUM_IWL_RXON_CTX];
- const size_t bufsz = sizeof(buf);
-
-+ pax_track_stack();
-+
- for_each_context(priv, ctx) {
- pos += scnprintf(buf + pos, bufsz - pos, "context %d:\n",
- ctx->ctxid);
-diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c
-index 0a0cc96..fd49ad8 100644
---- a/drivers/net/wireless/iwmc3200wifi/debugfs.c
-+++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c
-@@ -327,6 +327,8 @@ static ssize_t iwm_debugfs_fw_err_read(struct file *filp,
- int buf_len = 512;
- size_t len = 0;
-
-+ pax_track_stack();
-+
- if (*ppos != 0)
- return 0;
- if (count < sizeof(buf))
+-#define IWL_DEBUG(m, level, fmt, args...)
+-#define IWL_DEBUG_LIMIT(m, level, fmt, args...)
++#define IWL_DEBUG(m, level, fmt, args...) do {} while (0)
++#define IWL_DEBUG_LIMIT(m, level, fmt, args...) do {} while (0)
+ #define iwl_print_hex_dump(m, level, p, len)
+ #endif /* CONFIG_IWLWIFI_DEBUG */
+
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
-index 9d4a40e..add74dd 100644
+index 523ad55..f8c5dc5 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
-@@ -1260,9 +1260,11 @@ static int __init init_mac80211_hwsim(void)
+@@ -1678,9 +1678,11 @@ static int __init init_mac80211_hwsim(void)
return -EINVAL;
if (fake_hw_scan) {
@@ -33958,11 +33446,24 @@ index 9d4a40e..add74dd 100644
}
spin_lock_init(&hwsim_radio_lock);
+diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
+index 30f138b..c904585 100644
+--- a/drivers/net/wireless/mwifiex/main.h
++++ b/drivers/net/wireless/mwifiex/main.h
+@@ -543,7 +543,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 29f9389..f6d2ce0 100644
+index 0c13840..a5c3ed6 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
-@@ -1277,7 +1277,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold)
+@@ -1275,7 +1275,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold)
netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold);
@@ -33971,19 +33472,6 @@ index 29f9389..f6d2ce0 100644
rts_threshold = 2347;
tmp = cpu_to_le32(rts_threshold);
-diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
-index d2cc815..9579e62 100644
---- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
-+++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
-@@ -837,6 +837,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
- u8 rfpath;
- u8 num_total_rfpath = rtlphy->num_total_rfpath;
-
-+ pax_track_stack();
-+
- precommoncmdcnt = 0;
- _rtl92c_phy_set_sw_chnl_cmdarray(precommoncmd, precommoncmdcnt++,
- MAX_PRECMD_CNT,
diff --git a/drivers/net/wireless/wl1251/wl1251.h b/drivers/net/wireless/wl1251/wl1251.h
index a77f1bb..c608b2b 100644
--- a/drivers/net/wireless/wl1251/wl1251.h
@@ -33997,19 +33485,6 @@ index a77f1bb..c608b2b 100644
struct wl1251 {
struct ieee80211_hw *hw;
-diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c
-index 51662bb..354cd39 100644
---- a/drivers/net/wireless/wl12xx/spi.c
-+++ b/drivers/net/wireless/wl12xx/spi.c
-@@ -280,6 +280,8 @@ static void wl1271_spi_raw_write(struct wl1271 *wl, int addr, void *buf,
- u32 chunk_len;
- int i;
-
-+ pax_track_stack();
-+
- WARN_ON(len > WL1271_AGGR_BUFFER_SIZE);
-
- spi_message_init(&m);
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index f34b5b2..b5abb9f 100644
--- a/drivers/oprofile/buffer_sync.c
@@ -34050,7 +33525,7 @@ index f34b5b2..b5abb9f 100644
}
release_mm(mm);
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c
-index dd87e86..bc0148c 100644
+index c0cc4e7..44d4e54 100644
--- a/drivers/oprofile/event_buffer.c
+++ b/drivers/oprofile/event_buffer.c
@@ -53,7 +53,7 @@ void add_event_entry(unsigned long value)
@@ -34097,11 +33572,11 @@ index 917d28e..d62d981 100644
diff --git a/drivers/oprofile/oprofile_stats.h b/drivers/oprofile/oprofile_stats.h
-index 0b54e46..a37c527 100644
+index 38b6fc0..b5cbfce 100644
--- a/drivers/oprofile/oprofile_stats.h
+++ b/drivers/oprofile/oprofile_stats.h
@@ -13,11 +13,11 @@
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
struct oprofile_stat_struct {
- atomic_t sample_lost_no_mm;
@@ -34118,10 +33593,10 @@ index 0b54e46..a37c527 100644
extern struct oprofile_stat_struct oprofile_stats;
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
-index e9ff6f7..28e259a 100644
+index 2f0aa0f..90fab02 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
-@@ -186,7 +186,7 @@ static const struct file_operations atomic_ro_fops = {
+@@ -193,7 +193,7 @@ static const struct file_operations atomic_ro_fops = {
int oprofilefs_create_ro_atomic(struct super_block *sb, struct dentry *root,
@@ -34184,7 +33659,7 @@ index 76ba8a1..20ca857 100644
/* initialize our int15 lock */
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
-index 6892601..65aaa93 100644
+index cbfbab1..6a9fced 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -27,9 +27,9 @@
@@ -34201,10 +33676,10 @@ index 6892601..65aaa93 100644
#define ASPM_STATE_ALL (ASPM_STATE_L0S | ASPM_STATE_L1)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
-index bafb3c3..5f91c5f 100644
+index 04e74f4..a960176 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
-@@ -129,7 +129,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
+@@ -136,7 +136,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
u32 l, sz, mask;
u16 orig_cmd;
@@ -34234,57 +33709,8 @@ index 27911b5..5b6db88 100644
proc_create("devices", 0, proc_bus_pci_dir,
&proc_bus_pci_dev_operations);
proc_initialized = 1;
-diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
-index d4e7a10..0790107 100644
---- a/drivers/pci/xen-pcifront.c
-+++ b/drivers/pci/xen-pcifront.c
-@@ -187,6 +187,8 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
- struct pcifront_sd *sd = bus->sysdata;
- struct pcifront_device *pdev = pcifront_get_pdev(sd);
-
-+ pax_track_stack();
-+
- if (verbose_request)
- dev_info(&pdev->xdev->dev,
- "read dev=%04x:%02x:%02x.%01x - offset %x size %d\n",
-@@ -226,6 +228,8 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn,
- struct pcifront_sd *sd = bus->sysdata;
- struct pcifront_device *pdev = pcifront_get_pdev(sd);
-
-+ pax_track_stack();
-+
- if (verbose_request)
- dev_info(&pdev->xdev->dev,
- "write dev=%04x:%02x:%02x.%01x - "
-@@ -258,6 +262,8 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,
- struct pcifront_device *pdev = pcifront_get_pdev(sd);
- struct msi_desc *entry;
-
-+ pax_track_stack();
-+
- if (nvec > SH_INFO_MAX_VEC) {
- dev_err(&dev->dev, "too much vector for pci frontend: %x."
- " Increase SH_INFO_MAX_VEC.\n", nvec);
-@@ -309,6 +315,8 @@ static void pci_frontend_disable_msix(struct pci_dev *dev)
- struct pcifront_sd *sd = dev->bus->sysdata;
- struct pcifront_device *pdev = pcifront_get_pdev(sd);
-
-+ pax_track_stack();
-+
- err = do_pci_op(pdev, &op);
-
- /* What should do for error ? */
-@@ -328,6 +336,8 @@ static int pci_frontend_enable_msi(struct pci_dev *dev, int vector[])
- struct pcifront_sd *sd = dev->bus->sysdata;
- struct pcifront_device *pdev = pcifront_get_pdev(sd);
-
-+ pax_track_stack();
-+
- err = do_pci_op(pdev, &op);
- if (likely(!err)) {
- vector[0] = op.value;
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
-index 26c5b11..fa93a8b 100644
+index 7b82868..b9344c9 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)
@@ -34296,6 +33722,125 @@ index 26c5b11..fa93a8b 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)
+ }
+ }
+
+-static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
+- struct tp_nvram_state *newn,
+- const u32 event_mask)
+-{
+-
+ #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,
+ tpacpi_hotkey_send_key(__scancode); \
+ } while (0)
+
+- void issue_volchange(const unsigned int oldvol,
+- const unsigned int newvol)
+- {
+- unsigned int i = oldvol;
++static void issue_volchange(const unsigned int oldvol,
++ const unsigned int newvol,
++ const u32 event_mask)
++{
++ unsigned int i = oldvol;
+
+- while (i > newvol) {
+- TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEDOWN);
+- i--;
+- }
+- while (i < newvol) {
+- TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP);
+- i++;
+- }
++ while (i > newvol) {
++ TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEDOWN);
++ i--;
+ }
++ while (i < newvol) {
++ TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP);
++ i++;
++ }
++}
+
+- void issue_brightnesschange(const unsigned int oldbrt,
+- const unsigned int newbrt)
+- {
+- unsigned int i = oldbrt;
++static void issue_brightnesschange(const unsigned int oldbrt,
++ const unsigned int newbrt,
++ const u32 event_mask)
++{
++ unsigned int i = oldbrt;
+
+- while (i > newbrt) {
+- TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNEND);
+- i--;
+- }
+- while (i < newbrt) {
+- TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME);
+- i++;
+- }
++ while (i > newbrt) {
++ TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNEND);
++ i--;
++ }
++ while (i < newbrt) {
++ TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME);
++ i++;
+ }
++}
+
++static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
++ struct tp_nvram_state *newn,
++ const u32 event_mask)
++{
+ 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,
+ oldn->volume_level != newn->volume_level) {
+ /* recently muted, or repeated mute keypress, or
+ * multiple presses ending in mute */
+- issue_volchange(oldn->volume_level, newn->volume_level);
++ issue_volchange(oldn->volume_level, newn->volume_level, event_mask);
+ 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,
+ TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP);
+ }
+ if (oldn->volume_level != newn->volume_level) {
+- issue_volchange(oldn->volume_level, newn->volume_level);
++ issue_volchange(oldn->volume_level, newn->volume_level, event_mask);
+ } 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,
+ /* handle brightness */
+ if (oldn->brightness_level != newn->brightness_level) {
+ issue_brightnesschange(oldn->brightness_level,
+- newn->brightness_level);
++ newn->brightness_level,
++ event_mask);
+ } 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,
+ && !tp_features.bright_unkfw)
+ TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME);
+ }
++}
+
+ #undef TPACPI_COMPARE_KEY
+ #undef TPACPI_MAY_SEND_KEY
+-}
+
+ /*
+ * Polling driver
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index b859d16..5cc6b1a 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
@@ -34409,10 +33954,10 @@ index 33f5d9a..d957d3f 100644
/*
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
-index 3285d41..ab7c22a 100644
+index 023d17d..74ef35b 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
-@@ -564,10 +564,12 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
+@@ -565,10 +565,12 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
}
mc13xxx_unlock(mc13892);
@@ -34448,19 +33993,6 @@ index cace6d3..f623fda 100644
return rtc_set_time(rtc, &tm);
case RTC_PIE_ON:
-diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
-index f66c33b..7ae5823 100644
---- a/drivers/scsi/BusLogic.c
-+++ b/drivers/scsi/BusLogic.c
-@@ -962,6 +962,8 @@ static int __init BusLogic_InitializeFlashPointProbeInfo(struct BusLogic_HostAda
- static void __init BusLogic_InitializeProbeInfoList(struct BusLogic_HostAdapter
- *PrototypeHostAdapter)
- {
-+ pax_track_stack();
-+
- /*
- If a PCI BIOS is present, interrogate it for MultiMaster and FlashPoint
- Host Adapters; otherwise, default to the standard ISA MultiMaster probe.
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index ffb5878..e6d785c 100644
--- a/drivers/scsi/aacraid/aacraid.h
@@ -34474,20 +34006,8 @@ index ffb5878..e6d785c 100644
/*
* Define which interrupt handler needs to be installed
-diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
-index 8a0b330..b4286de 100644
---- a/drivers/scsi/aacraid/commctrl.c
-+++ b/drivers/scsi/aacraid/commctrl.c
-@@ -482,6 +482,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
- u32 actual_fibsize64, actual_fibsize = 0;
- int i;
-
-+ pax_track_stack();
-
- if (dev->in_reset) {
- dprintk((KERN_DEBUG"aacraid: send raw srb -EBUSY\n"));
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
-index c7b6fed..4db0569 100644
+index 705e13e..91c873c 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) = {
@@ -34513,58 +34033,66 @@ index d5ff142..49c0ebb 100644
{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 7be6b5a..8f4ca40 100644
+index a796de9..1ef20e1 100644
--- a/drivers/scsi/bfa/bfa.h
+++ b/drivers/scsi/bfa/bfa.h
-@@ -238,7 +238,7 @@ struct bfa_hwif_s {
- u32 *nvecs, u32 *maxvec);
- void (*hw_msix_get_rme_range) (struct bfa_s *bfa, u32 *start,
+@@ -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_iocfc_s {
-diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
-index 1d6be8c..38ceebc 100644
---- a/drivers/scsi/bfa/bfa_fcs_lport.c
-+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
-@@ -1559,6 +1559,8 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
- u16 len, count;
- u16 templen;
-
-+ pax_track_stack();
-+
- /*
- * get hba attributes
- */
-@@ -1836,6 +1838,8 @@ bfa_fcs_lport_fdmi_build_portattr_block(struct bfa_fcs_lport_fdmi_s *fdmi,
- u8 count = 0;
- u16 templen;
-
-+ pax_track_stack();
-+
- /*
- * get port attributes
- */
-diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
-index caaee6f..efce56b 100644
---- a/drivers/scsi/bfa/bfa_fcs_rport.c
-+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
-@@ -1844,6 +1844,8 @@ bfa_fcs_rport_process_rpsc(struct bfa_fcs_rport_s *rport,
- struct fc_rpsc_speed_info_s speeds;
- struct bfa_port_attr_s pport_attr;
-
-+ pax_track_stack();
-+
- bfa_trc(port->fcs, rx_fchs->s_id);
- bfa_trc(port->fcs, rx_fchs->d_id);
-
+ struct bfa_faa_cbfn_s {
+diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
+index e07bd47..cd1bbbb 100644
+--- a/drivers/scsi/bfa/bfa_fcpim.c
++++ b/drivers/scsi/bfa/bfa_fcpim.c
+@@ -4121,7 +4121,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,
+@@ -4179,7 +4179,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;
+diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
+index 1080bcb..a3b39e3 100644
+--- a/drivers/scsi/bfa/bfa_fcpim.h
++++ b/drivers/scsi/bfa/bfa_fcpim.h
+@@ -37,6 +37,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;
+
+ void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
+ void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
+@@ -149,7 +150,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 c85182a..fc0d4c0 100644
+index 546d46b..642fa5b 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
-@@ -196,7 +196,7 @@ struct bfa_ioc_cbfn_s {
+@@ -258,7 +258,7 @@ struct bfa_ioc_cbfn_s {
bfa_ioc_disable_cbfn_t disable_cbfn;
bfa_ioc_hbfail_cbfn_t hbfail_cbfn;
bfa_ioc_reset_cbfn_t reset_cbfn;
@@ -34572,141 +34100,16 @@ index c85182a..fc0d4c0 100644
+} __no_const;
/*
- * Heartbeat failure notification queue element.
-@@ -268,7 +268,7 @@ struct bfa_ioc_hwif_s {
- void (*ioc_sync_leave) (struct bfa_ioc_s *ioc);
+ * IOC event notification mechanism.
+@@ -346,7 +346,7 @@ struct bfa_ioc_hwif_s {
void (*ioc_sync_ack) (struct bfa_ioc_s *ioc);
bfa_boolean_t (*ioc_sync_complete) (struct bfa_ioc_s *ioc);
+ bfa_boolean_t (*ioc_lpu_read_stat) (struct bfa_ioc_s *ioc);
-};
+} __no_const;
- #define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func)
- #define bfa_ioc_devid(__ioc) ((__ioc)->pcidev.device_id)
-diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
-index 59b5e9b..03a2bc1 100644
---- a/drivers/scsi/bfa/bfad.c
-+++ b/drivers/scsi/bfa/bfad.c
-@@ -1032,6 +1032,8 @@ bfad_start_ops(struct bfad_s *bfad) {
- struct bfad_vport_s *vport, *vport_new;
- struct bfa_fcs_driver_info_s driver_info;
-
-+ pax_track_stack();
-+
- /* Fill the driver_info info to fcs*/
- memset(&driver_info, 0, sizeof(driver_info));
- strncpy(driver_info.version, BFAD_DRIVER_VERSION,
-diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
-index b4f6c9a..0eb1938 100644
---- a/drivers/scsi/dpt_i2o.c
-+++ b/drivers/scsi/dpt_i2o.c
-@@ -1811,6 +1811,8 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
- dma_addr_t addr;
- ulong flags = 0;
-
-+ pax_track_stack();
-+
- memset(&msg, 0, MAX_MESSAGE_SIZE*4);
- // get user msg size in u32s
- if(get_user(size, &user_msg[0])){
-@@ -2317,6 +2319,8 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
- s32 rcode;
- dma_addr_t addr;
-
-+ pax_track_stack();
-+
- memset(msg, 0 , sizeof(msg));
- len = scsi_bufflen(cmd);
- direction = 0x00000000;
-diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
-index 94de889..ca4f0cf 100644
---- a/drivers/scsi/eata.c
-+++ b/drivers/scsi/eata.c
-@@ -1087,6 +1087,8 @@ static int port_detect(unsigned long port_base, unsigned int j,
- struct hostdata *ha;
- char name[16];
-
-+ pax_track_stack();
-+
- sprintf(name, "%s%d", driver_name, j);
-
- if (!request_region(port_base, REGION_SIZE, driver_name)) {
-diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
-index c74c4b8..c41ca3f 100644
---- a/drivers/scsi/fcoe/fcoe_ctlr.c
-+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
-@@ -2503,6 +2503,8 @@ static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *fip, struct sk_buff *skb)
- } buf;
- int rc;
-
-+ pax_track_stack();
-+
- fiph = (struct fip_header *)skb->data;
- sub = fiph->fip_subcode;
-
-diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
-index 3242bca..45a83e7 100644
---- a/drivers/scsi/gdth.c
-+++ b/drivers/scsi/gdth.c
-@@ -4107,6 +4107,8 @@ static int ioc_lockdrv(void __user *arg)
- unsigned long flags;
- gdth_ha_str *ha;
-
-+ pax_track_stack();
-+
- if (copy_from_user(&ldrv, arg, sizeof(gdth_ioctl_lockdrv)))
- return -EFAULT;
- ha = gdth_find_ha(ldrv.ionode);
-@@ -4139,6 +4141,8 @@ static int ioc_resetdrv(void __user *arg, char *cmnd)
- gdth_ha_str *ha;
- int rval;
-
-+ pax_track_stack();
-+
- if (copy_from_user(&res, arg, sizeof(gdth_ioctl_reset)) ||
- res.number >= MAX_HDRIVES)
- return -EFAULT;
-@@ -4174,6 +4178,8 @@ static int ioc_general(void __user *arg, char *cmnd)
- gdth_ha_str *ha;
- int rval;
-
-+ pax_track_stack();
-+
- if (copy_from_user(&gen, arg, sizeof(gdth_ioctl_general)))
- return -EFAULT;
- ha = gdth_find_ha(gen.ionode);
-@@ -4642,6 +4648,9 @@ static void gdth_flush(gdth_ha_str *ha)
- int i;
- gdth_cmd_str gdtcmd;
- char cmnd[MAX_COMMAND_SIZE];
-+
-+ pax_track_stack();
-+
- memset(cmnd, 0xff, MAX_COMMAND_SIZE);
-
- TRACE2(("gdth_flush() hanum %d\n", ha->hanum));
-diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
-index 6527543..81e4fe2 100644
---- a/drivers/scsi/gdth_proc.c
-+++ b/drivers/scsi/gdth_proc.c
-@@ -47,6 +47,9 @@ static int gdth_set_asc_info(struct Scsi_Host *host, char *buffer,
- u64 paddr;
-
- char cmnd[MAX_COMMAND_SIZE];
-+
-+ pax_track_stack();
-+
- memset(cmnd, 0xff, 12);
- memset(&gdtcmd, 0, sizeof(gdth_cmd_str));
-
-@@ -175,6 +178,8 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
- gdth_hget_str *phg;
- char cmnd[MAX_COMMAND_SIZE];
-
-+ pax_track_stack();
-+
- gdtcmd = kmalloc(sizeof(*gdtcmd), GFP_KERNEL);
- estr = kmalloc(sizeof(*estr), GFP_KERNEL);
- if (!gdtcmd || !estr)
+ /*
+ * 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 351dc0b..951dc32 100644
--- a/drivers/scsi/hosts.c
@@ -34730,10 +34133,10 @@ index 351dc0b..951dc32 100644
/* These three are default values which can be overridden */
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
-index 56a9f3f..a51d0fb 100644
+index 865d452..e9b7fa7 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
-@@ -499,7 +499,7 @@ static inline u32 next_command(struct ctlr_info *h)
+@@ -505,7 +505,7 @@ static inline u32 next_command(struct ctlr_info *h)
u32 a;
if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
@@ -34742,7 +34145,7 @@ index 56a9f3f..a51d0fb 100644
if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
a = *(h->reply_pool_head); /* Next cmd in ring buffer */
-@@ -2956,7 +2956,7 @@ static void start_io(struct ctlr_info *h)
+@@ -2989,7 +2989,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 */
@@ -34751,7 +34154,7 @@ index 56a9f3f..a51d0fb 100644
dev_warn(&h->pdev->dev, "fifo full\n");
break;
}
-@@ -2966,7 +2966,7 @@ static void start_io(struct ctlr_info *h)
+@@ -2999,7 +2999,7 @@ static void start_io(struct ctlr_info *h)
h->Qdepth--;
/* Tell the controller execute command */
@@ -34760,7 +34163,7 @@ index 56a9f3f..a51d0fb 100644
/* Put job onto the completed Q */
addQ(&h->cmpQ, c);
-@@ -2975,17 +2975,17 @@ static void start_io(struct ctlr_info *h)
+@@ -3008,17 +3008,17 @@ static void start_io(struct ctlr_info *h)
static inline unsigned long get_next_completion(struct ctlr_info *h)
{
@@ -34781,7 +34184,7 @@ index 56a9f3f..a51d0fb 100644
(h->interrupts_enabled == 0);
}
-@@ -3882,7 +3882,7 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
+@@ -3917,7 +3917,7 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
if (prod_index < 0)
return -ENODEV;
h->product_name = products[prod_index].product_name;
@@ -34790,7 +34193,16 @@ index 56a9f3f..a51d0fb 100644
if (hpsa_board_disabled(h->pdev)) {
dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
-@@ -4163,7 +4163,7 @@ reinit_after_soft_reset:
+@@ -4162,7 +4162,7 @@ static void controller_lockup_detected(struct ctlr_info *h)
+
+ assert_spin_locked(&lockup_detector_lock);
+ remove_ctlr_from_lockup_detector_list(h);
+- h->access.set_intr_mask(h, HPSA_INTR_OFF);
++ h->access->set_intr_mask(h, HPSA_INTR_OFF);
+ spin_lock_irqsave(&h->lock, flags);
+ h->lockup_detected = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
+ spin_unlock_irqrestore(&h->lock, flags);
+@@ -4340,7 +4340,7 @@ reinit_after_soft_reset:
}
/* make sure the board interrupts are off */
@@ -34799,7 +34211,7 @@ index 56a9f3f..a51d0fb 100644
if (hpsa_request_irq(h, do_hpsa_intr_msi, do_hpsa_intr_intx))
goto clean2;
-@@ -4197,7 +4197,7 @@ reinit_after_soft_reset:
+@@ -4374,7 +4374,7 @@ reinit_after_soft_reset:
* fake ones to scoop up any residual completions.
*/
spin_lock_irqsave(&h->lock, flags);
@@ -34808,7 +34220,7 @@ index 56a9f3f..a51d0fb 100644
spin_unlock_irqrestore(&h->lock, flags);
free_irq(h->intr[h->intr_mode], h);
rc = hpsa_request_irq(h, hpsa_msix_discard_completions,
-@@ -4216,9 +4216,9 @@ reinit_after_soft_reset:
+@@ -4393,9 +4393,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");
@@ -34820,7 +34232,7 @@ index 56a9f3f..a51d0fb 100644
rc = controller_reset_failed(h->cfgtable);
if (rc)
-@@ -4239,7 +4239,7 @@ reinit_after_soft_reset:
+@@ -4416,7 +4416,7 @@ reinit_after_soft_reset:
}
/* Turn the interrupts on so we can service requests */
@@ -34829,7 +34241,7 @@ index 56a9f3f..a51d0fb 100644
hpsa_hba_inquiry(h);
hpsa_register_scsi(h); /* hook ourselves into SCSI subsystem */
-@@ -4292,7 +4292,7 @@ static void hpsa_shutdown(struct pci_dev *pdev)
+@@ -4468,7 +4468,7 @@ static void hpsa_shutdown(struct pci_dev *pdev)
* To write all data in the battery backed cache to disks
*/
hpsa_flush_cache(h);
@@ -34838,7 +34250,7 @@ index 56a9f3f..a51d0fb 100644
free_irq(h->intr[h->intr_mode], h);
#ifdef CONFIG_PCI_MSI
if (h->msix_vector)
-@@ -4455,7 +4455,7 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h,
+@@ -4632,7 +4632,7 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h,
return;
}
/* Change the access methods to the performant access methods */
@@ -34848,7 +34260,7 @@ index 56a9f3f..a51d0fb 100644
}
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
-index 7f53cea..a8c7188 100644
+index 91edafb..a9b88ec 100644
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -73,7 +73,7 @@ struct ctlr_info {
@@ -34874,7 +34286,7 @@ index f2df059..a3a9930 100644
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 3b8a645..8455110 100644
+index 9de9db2..1e09660 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -105,12 +105,12 @@ struct fc_exch_mgr {
@@ -34896,7 +34308,7 @@ index 3b8a645..8455110 100644
} stats;
};
-@@ -700,7 +700,7 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport,
+@@ -719,7 +719,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) {
@@ -34905,7 +34317,7 @@ index 3b8a645..8455110 100644
goto out;
}
memset(ep, 0, sizeof(*ep));
-@@ -761,7 +761,7 @@ out:
+@@ -780,7 +780,7 @@ out:
return ep;
err:
spin_unlock_bh(&pool->lock);
@@ -34914,7 +34326,7 @@ index 3b8a645..8455110 100644
mempool_free(ep, mp->ep_pool);
return NULL;
}
-@@ -906,7 +906,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
+@@ -923,7 +923,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) {
@@ -34923,7 +34335,7 @@ index 3b8a645..8455110 100644
reject = FC_RJT_OX_ID;
goto out;
}
-@@ -936,7 +936,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
+@@ -953,7 +953,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) {
@@ -34932,7 +34344,7 @@ index 3b8a645..8455110 100644
reject = FC_RJT_RX_ID;
goto rel;
}
-@@ -947,7 +947,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
+@@ -964,7 +964,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
}
xid = ep->xid; /* get our XID */
} else if (!ep) {
@@ -34941,16 +34353,16 @@ index 3b8a645..8455110 100644
reject = FC_RJT_RX_ID; /* XID not found */
goto out;
}
-@@ -964,7 +964,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
+@@ -981,7 +981,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) {
- atomic_inc(&mp->stats.seq_not_found);
+ atomic_inc_unchecked(&mp->stats.seq_not_found);
- reject = FC_RJT_SEQ_ID; /* sequence/exch should exist */
- goto rel;
- }
-@@ -1392,22 +1392,22 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
+ 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)
ep = fc_exch_find(mp, ntohs(fh->fh_ox_id));
if (!ep) {
@@ -34977,7 +34389,7 @@ index 3b8a645..8455110 100644
goto rel;
}
sof = fr_sof(fp);
-@@ -1416,7 +1416,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
+@@ -1455,7 +1455,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) {
@@ -34986,7 +34398,7 @@ index 3b8a645..8455110 100644
goto rel;
}
-@@ -1480,9 +1480,9 @@ static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
+@@ -1519,9 +1519,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)
@@ -35012,7 +34424,7 @@ index db9238f..4378ed2 100644
.qc_issue = sas_ata_qc_issue,
.qc_fill_rtf = sas_ata_qc_fill_rtf,
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
-index 0441361..f2564e4 100644
+index bb4c8e0..f33d849 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -425,7 +425,7 @@ struct lpfc_vport {
@@ -35024,7 +34436,7 @@ index 0441361..f2564e4 100644
#endif
uint8_t stat_data_enabled;
uint8_t stat_data_blocked;
-@@ -832,8 +832,8 @@ struct lpfc_hba {
+@@ -835,8 +835,8 @@ struct lpfc_hba {
struct timer_list fabric_block_timer;
unsigned long bit_flags;
#define FABRIC_COMANDS_BLOCKED 0
@@ -35035,8 +34447,8 @@ index 0441361..f2564e4 100644
unsigned long last_rsrc_error_time;
unsigned long last_ramp_down_time;
unsigned long last_ramp_up_time;
-@@ -847,7 +847,7 @@ struct lpfc_hba {
- struct dentry *debug_dumpDif; /* BlockGuard BPL*/
+@@ -866,7 +866,7 @@ struct lpfc_hba {
+
struct dentry *debug_slow_ring_trc;
struct lpfc_debugfs_trc *slow_ring_trc;
- atomic_t slow_ring_trc_cnt;
@@ -35045,10 +34457,10 @@ index 0441361..f2564e4 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 ffe82d1..108b526 100644
+index 2838259..a07cfb5 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
-@@ -104,7 +104,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
+@@ -106,7 +106,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
#include <linux/debugfs.h>
@@ -35057,7 +34469,7 @@ index ffe82d1..108b526 100644
static unsigned long lpfc_debugfs_start_time = 0L;
/* iDiag */
-@@ -141,7 +141,7 @@ lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
+@@ -147,7 +147,7 @@ lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
lpfc_debugfs_enable = 0;
len = 0;
@@ -35066,7 +34478,7 @@ index ffe82d1..108b526 100644
(lpfc_debugfs_max_disc_trc - 1);
for (i = index; i < lpfc_debugfs_max_disc_trc; i++) {
dtp = vport->disc_trc + i;
-@@ -202,7 +202,7 @@ lpfc_debugfs_slow_ring_trc_data(struct lpfc_hba *phba, char *buf, int size)
+@@ -213,7 +213,7 @@ lpfc_debugfs_slow_ring_trc_data(struct lpfc_hba *phba, char *buf, int size)
lpfc_debugfs_enable = 0;
len = 0;
@@ -35075,16 +34487,7 @@ index ffe82d1..108b526 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;
-@@ -380,6 +380,8 @@ lpfc_debugfs_dumpHBASlim_data(struct lpfc_hba *phba, char *buf, int size)
- uint32_t *ptr;
- char buffer[1024];
-
-+ pax_track_stack();
-+
- off = 0;
- spin_lock_irq(&phba->hbalock);
-
-@@ -617,14 +619,14 @@ lpfc_debugfs_disc_trc(struct lpfc_vport *vport, int mask, char *fmt,
+@@ -636,14 +636,14 @@ lpfc_debugfs_disc_trc(struct lpfc_vport *vport, int mask, char *fmt,
!vport || !vport->disc_trc)
return;
@@ -35101,7 +34504,7 @@ index ffe82d1..108b526 100644
dtp->jif = jiffies;
#endif
return;
-@@ -655,14 +657,14 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_hba *phba, char *fmt,
+@@ -674,14 +674,14 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_hba *phba, char *fmt,
!phba || !phba->slow_ring_trc)
return;
@@ -35118,7 +34521,7 @@ index ffe82d1..108b526 100644
dtp->jif = jiffies;
#endif
return;
-@@ -2606,7 +2608,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
+@@ -3986,7 +3986,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
"slow_ring buffer\n");
goto debug_failed;
}
@@ -35127,7 +34530,7 @@ index ffe82d1..108b526 100644
memset(phba->slow_ring_trc, 0,
(sizeof(struct lpfc_debugfs_trc) *
lpfc_debugfs_max_slow_ring_trc));
-@@ -2652,7 +2654,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
+@@ -4032,7 +4032,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
"buffer\n");
goto debug_failed;
}
@@ -35137,10 +34540,10 @@ index ffe82d1..108b526 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 027b797..8c56376 100644
+index 55bc4fc..a2a109c 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
-@@ -9971,8 +9971,10 @@ lpfc_init(void)
+@@ -10027,8 +10027,10 @@ lpfc_init(void)
printk(LPFC_COPYRIGHT "\n");
if (lpfc_enable_npiv) {
@@ -35154,10 +34557,10 @@ index 027b797..8c56376 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 eadd241..26c8e0f 100644
+index 2e1e54e..1af0a0d 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
-@@ -297,7 +297,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
+@@ -305,7 +305,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
uint32_t evt_posted;
spin_lock_irqsave(&phba->hbalock, flags);
@@ -35166,7 +34569,7 @@ index eadd241..26c8e0f 100644
phba->last_rsrc_error_time = jiffies;
if ((phba->last_ramp_down_time + QUEUE_RAMP_DOWN_INTERVAL) > jiffies) {
-@@ -338,7 +338,7 @@ lpfc_rampup_queue_depth(struct lpfc_vport *vport,
+@@ -346,7 +346,7 @@ lpfc_rampup_queue_depth(struct lpfc_vport *vport,
unsigned long flags;
struct lpfc_hba *phba = vport->phba;
uint32_t evt_posted;
@@ -35175,7 +34578,7 @@ index eadd241..26c8e0f 100644
if (vport->cfg_lun_queue_depth <= queue_depth)
return;
-@@ -382,8 +382,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
+@@ -390,8 +390,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
unsigned long num_rsrc_err, num_cmd_success;
int i;
@@ -35186,7 +34589,7 @@ index eadd241..26c8e0f 100644
vports = lpfc_create_vport_work_array(phba);
if (vports != NULL)
-@@ -403,8 +403,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
+@@ -411,8 +411,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
}
}
lpfc_destroy_vport_work_array(phba, vports);
@@ -35197,7 +34600,7 @@ index eadd241..26c8e0f 100644
}
/**
-@@ -438,8 +438,8 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba)
+@@ -446,8 +446,8 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba)
}
}
lpfc_destroy_vport_work_array(phba, vports);
@@ -35208,37 +34611,11 @@ index eadd241..26c8e0f 100644
}
/**
-diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
-index 2e6619e..fa64494 100644
---- a/drivers/scsi/megaraid/megaraid_mbox.c
-+++ b/drivers/scsi/megaraid/megaraid_mbox.c
-@@ -3503,6 +3503,8 @@ megaraid_cmm_register(adapter_t *adapter)
- int rval;
- int i;
-
-+ pax_track_stack();
-+
- // Allocate memory for the base list of scb for management module.
- adapter->uscb_list = kcalloc(MBOX_MAX_USER_CMDS, sizeof(scb_t), GFP_KERNEL);
-
-diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
-index 86afb13f..c912398 100644
---- a/drivers/scsi/osd/osd_initiator.c
-+++ b/drivers/scsi/osd/osd_initiator.c
-@@ -97,6 +97,8 @@ static int _osd_get_print_system_info(struct osd_dev *od,
- int nelem = ARRAY_SIZE(get_attrs), a = 0;
- int ret;
-
-+ pax_track_stack();
-+
- or = osd_start_request(od, GFP_KERNEL);
- if (!or)
- return -ENOMEM;
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
-index d079f9a..d26072c 100644
+index 5163edb..7b142bc 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
-@@ -201,8 +201,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev)
+@@ -200,8 +200,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev)
res->scsi_dev = scsi_dev;
scsi_dev->hostdata = res;
res->change_detected = 0;
@@ -35249,7 +34626,7 @@ index d079f9a..d26072c 100644
rc = 0;
}
spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags);
-@@ -2677,9 +2677,9 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd)
+@@ -2676,9 +2676,9 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd)
/* If this was a SCSI read/write command keep count of errors */
if (SCSI_CMD_TYPE(scsi_cmd->cmnd[0]) == SCSI_READ_CMD)
@@ -35261,7 +34638,7 @@ index d079f9a..d26072c 100644
if (!RES_IS_GSCSI(res->cfg_entry) &&
masked_ioasc != PMCRAID_IOASC_HW_DEVICE_BUS_STATUS_ERROR) {
-@@ -3535,7 +3535,7 @@ static int pmcraid_queuecommand_lck(
+@@ -3534,7 +3534,7 @@ static int pmcraid_queuecommand_lck(
* block of scsi_cmd which is re-used (e.g. cancel/abort), which uses
* hrrq_id assigned here in queuecommand
*/
@@ -35270,7 +34647,7 @@ index d079f9a..d26072c 100644
pinstance->num_hrrq;
cmd->cmd_done = pmcraid_io_done;
-@@ -3860,7 +3860,7 @@ static long pmcraid_ioctl_passthrough(
+@@ -3859,7 +3859,7 @@ static long pmcraid_ioctl_passthrough(
* block of scsi_cmd which is re-used (e.g. cancel/abort), which uses
* hrrq_id assigned here in queuecommand
*/
@@ -35279,7 +34656,7 @@ index d079f9a..d26072c 100644
pinstance->num_hrrq;
if (request_size) {
-@@ -4498,7 +4498,7 @@ static void pmcraid_worker_function(struct work_struct *workp)
+@@ -4497,7 +4497,7 @@ static void pmcraid_worker_function(struct work_struct *workp)
pinstance = container_of(workp, struct pmcraid_instance, worker_q);
/* add resources only after host is added into system */
@@ -35288,7 +34665,7 @@ index d079f9a..d26072c 100644
return;
fw_version = be16_to_cpu(pinstance->inq_data->fw_version);
-@@ -5332,8 +5332,8 @@ static int __devinit pmcraid_init_instance(
+@@ -5331,8 +5331,8 @@ static int __devinit pmcraid_init_instance(
init_waitqueue_head(&pinstance->reset_wait_q);
atomic_set(&pinstance->outstanding_cmds, 0);
@@ -35299,7 +34676,7 @@ index d079f9a..d26072c 100644
INIT_LIST_HEAD(&pinstance->free_res_q);
INIT_LIST_HEAD(&pinstance->used_res_q);
-@@ -6048,7 +6048,7 @@ static int __devinit pmcraid_probe(
+@@ -6047,7 +6047,7 @@ static int __devinit pmcraid_probe(
/* Schedule worker thread to handle CCN and take care of adding and
* removing devices to OS
*/
@@ -35309,10 +34686,10 @@ index d079f9a..d26072c 100644
return rc;
diff --git a/drivers/scsi/pmcraid.h b/drivers/scsi/pmcraid.h
-index f920baf..4417389 100644
+index ca496c7..9c791d5 100644
--- a/drivers/scsi/pmcraid.h
+++ b/drivers/scsi/pmcraid.h
-@@ -749,7 +749,7 @@ struct pmcraid_instance {
+@@ -748,7 +748,7 @@ struct pmcraid_instance {
struct pmcraid_isr_param hrrq_vector[PMCRAID_NUM_MSIX_VECTORS];
/* Message id as filled in last fired IOARCB, used to identify HRRQ */
@@ -35321,7 +34698,7 @@ index f920baf..4417389 100644
/* configuration table */
struct pmcraid_config_table *cfg_table;
-@@ -778,7 +778,7 @@ struct pmcraid_instance {
+@@ -777,7 +777,7 @@ struct pmcraid_instance {
atomic_t outstanding_cmds;
/* should add/delete resources to mid-layer now ?*/
@@ -35330,7 +34707,7 @@ index f920baf..4417389 100644
-@@ -814,8 +814,8 @@ struct pmcraid_resource_entry {
+@@ -813,8 +813,8 @@ struct pmcraid_resource_entry {
struct pmcraid_config_table_entry_ext cfg_entry_ext;
};
struct scsi_device *scsi_dev; /* Link scsi_device structure */
@@ -35342,7 +34719,7 @@ index f920baf..4417389 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 cc5a792..033f807 100644
+index fcf052c..a8025a4 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2244,7 +2244,7 @@ struct isp_operations {
@@ -35355,60 +34732,46 @@ index cc5a792..033f807 100644
/* MSI-X Support *************************************************************/
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
-index 473c5c8..4e2f24a 100644
+index fd5edc6..4906148 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
-@@ -256,7 +256,7 @@ struct ddb_entry {
- atomic_t retry_relogin_timer; /* Min Time between relogins
- * (4000 only) */
- atomic_t relogin_timer; /* Max Time to wait for relogin to complete */
-- atomic_t relogin_retry_count; /* Num of times relogin has been
-+ atomic_unchecked_t relogin_retry_count; /* Num of times relogin has been
- * retried */
-
- uint16_t port;
-diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
-index 42ed5db..0262f9e 100644
---- a/drivers/scsi/qla4xxx/ql4_init.c
-+++ b/drivers/scsi/qla4xxx/ql4_init.c
-@@ -680,7 +680,7 @@ static struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha,
- ddb_entry->fw_ddb_index = fw_ddb_index;
+@@ -258,7 +258,7 @@ struct ddb_entry {
+ * (4000 only) */
+ atomic_t relogin_timer; /* Max Time to wait for
+ * relogin to complete */
+- atomic_t relogin_retry_count; /* Num of times relogin has been
++ atomic_unchecked_t relogin_retry_count; /* Num of times relogin has been
+ * retried */
+ 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 4169c8b..a8b896b 100644
+--- a/drivers/scsi/qla4xxx/ql4_os.c
++++ b/drivers/scsi/qla4xxx/ql4_os.c
+@@ -2104,12 +2104,12 @@ void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)
+ */
+ if (!iscsi_is_session_online(cls_sess)) {
+ /* Reset retry relogin timer */
+- atomic_inc(&ddb_entry->relogin_retry_count);
++ atomic_inc_unchecked(&ddb_entry->relogin_retry_count);
+ DEBUG2(ql4_printk(KERN_INFO, ha,
+ "%s: index[%d] relogin timed out-retrying"
+ " relogin (%d), retry (%d)\n", __func__,
+ ddb_entry->fw_ddb_index,
+- atomic_read(&ddb_entry->relogin_retry_count),
++ atomic_read_unchecked(&ddb_entry->relogin_retry_count),
+ ddb_entry->default_time2wait + 4));
+ set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags);
+ atomic_set(&ddb_entry->retry_relogin_timer,
+@@ -3835,7 +3835,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);
- atomic_set(&ddb_entry->relogin_retry_count, 0);
+ atomic_set_unchecked(&ddb_entry->relogin_retry_count, 0);
- atomic_set(&ddb_entry->state, DDB_STATE_ONLINE);
- list_add_tail(&ddb_entry->list, &ha->ddb_list);
- ha->fw_ddb_index_map[fw_ddb_index] = ddb_entry;
-@@ -1433,7 +1433,7 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
- if ((ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) &&
- (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE)) {
- atomic_set(&ddb_entry->state, DDB_STATE_ONLINE);
-- atomic_set(&ddb_entry->relogin_retry_count, 0);
-+ atomic_set_unchecked(&ddb_entry->relogin_retry_count, 0);
- atomic_set(&ddb_entry->relogin_timer, 0);
- clear_bit(DF_RELOGIN, &ddb_entry->flags);
- iscsi_unblock_session(ddb_entry->sess);
-diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
-index f2364ec..44c42b1 100644
---- a/drivers/scsi/qla4xxx/ql4_os.c
-+++ b/drivers/scsi/qla4xxx/ql4_os.c
-@@ -811,13 +811,13 @@ static void qla4xxx_timer(struct scsi_qla_host *ha)
- ddb_entry->fw_ddb_device_state ==
- DDB_DS_SESSION_FAILED) {
- /* Reset retry relogin timer */
-- atomic_inc(&ddb_entry->relogin_retry_count);
-+ atomic_inc_unchecked(&ddb_entry->relogin_retry_count);
- DEBUG2(printk("scsi%ld: ddb [%d] relogin"
- " timed out-retrying"
- " relogin (%d)\n",
- ha->host_no,
- ddb_entry->fw_ddb_index,
-- atomic_read(&ddb_entry->
-+ atomic_read_unchecked(&ddb_entry->
- relogin_retry_count))
- );
- start_dpc++;
+
+ ddb_entry->default_relogin_timeout =
+ le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout);
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 2aeb2e9..46e3925 100644
--- a/drivers/scsi/scsi.c
@@ -35422,33 +34785,11 @@ index 2aeb2e9..46e3925 100644
/* check if the device is still usable */
if (unlikely(cmd->device->sdev_state == SDEV_DEL)) {
-diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
-index 6888b2c..45befa1 100644
---- a/drivers/scsi/scsi_debug.c
-+++ b/drivers/scsi/scsi_debug.c
-@@ -1493,6 +1493,8 @@ static int resp_mode_select(struct scsi_cmnd * scp, int mselect6,
- unsigned char arr[SDEBUG_MAX_MSELECT_SZ];
- unsigned char *cmd = (unsigned char *)scp->cmnd;
-
-+ pax_track_stack();
-+
- if ((errsts = check_readiness(scp, 1, devip)))
- return errsts;
- memset(arr, 0, sizeof(arr));
-@@ -1590,6 +1592,8 @@ static int resp_log_sense(struct scsi_cmnd * scp,
- unsigned char arr[SDEBUG_MAX_LSENSE_SZ];
- unsigned char *cmd = (unsigned char *)scp->cmnd;
-
-+ pax_track_stack();
-+
- if ((errsts = check_readiness(scp, 1, devip)))
- return errsts;
- memset(arr, 0, sizeof(arr));
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
-index 72ab1e6..ad69062 100644
+index f85cfa6..a57c9e8 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
-@@ -1414,7 +1414,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
+@@ -1416,7 +1416,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;
@@ -35457,7 +34798,7 @@ index 72ab1e6..ad69062 100644
/*
* SCSI request completion path will do scsi_device_unbusy(),
-@@ -1440,9 +1440,9 @@ static void scsi_softirq_done(struct request *rq)
+@@ -1442,9 +1442,9 @@ static void scsi_softirq_done(struct request *rq)
INIT_LIST_HEAD(&cmd->eh_entry);
@@ -35470,10 +34811,10 @@ index 72ab1e6..ad69062 100644
disposition = scsi_decide_disposition(cmd);
if (disposition != SUCCESS &&
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
-index e0bd3f7..816b8a6 100644
+index 04c2a27..9d8bd66 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
-@@ -622,7 +622,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \
+@@ -660,7 +660,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \
char *buf) \
{ \
struct scsi_device *sdev = to_scsi_device(dev); \
@@ -35536,28 +34877,28 @@ index 1b21491..1b7f60e 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 3fd16d7..ba0871f 100644
+index 96029e6..4d77fa0 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
-@@ -83,7 +83,7 @@ struct iscsi_internal {
- struct device_attribute *session_attrs[ISCSI_SESSION_ATTRS + 1];
+@@ -79,7 +79,7 @@ struct iscsi_internal {
+ struct transport_container session_cont;
};
-static atomic_t iscsi_session_nr; /* sysfs session id for next new session */
+static atomic_unchecked_t iscsi_session_nr; /* sysfs session id for next new session */
static struct workqueue_struct *iscsi_eh_timer_workq;
- /*
-@@ -761,7 +761,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
+ static DEFINE_IDA(iscsi_sess_ida);
+@@ -1062,7 +1062,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
int err;
ihost = shost->shost_data;
- session->sid = atomic_add_return(1, &iscsi_session_nr);
+ session->sid = atomic_add_return_unchecked(1, &iscsi_session_nr);
- if (id == ISCSI_MAX_TARGET) {
- for (id = 0; id < ISCSI_MAX_TARGET; id++) {
-@@ -2200,7 +2200,7 @@ static __init int iscsi_transport_init(void)
+ if (target_id == ISCSI_MAX_TARGET) {
+ id = ida_simple_get(&iscsi_sess_ida, 0, 0, GFP_KERNEL);
+@@ -2663,7 +2663,7 @@ static __init int iscsi_transport_init(void)
printk(KERN_INFO "Loading iSCSI transport class v%s.\n",
ISCSI_TRANSPORT_VERSION);
@@ -35597,11 +34938,56 @@ 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 fa3a591..fd96409 100644
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -1074,6 +1074,10 @@ static int sd_ioctl(struct block_device *bdev, fmode_t mode,
+ SCSI_LOG_IOCTL(1, sd_printk(KERN_INFO, sdkp, "sd_ioctl: disk=%s, "
+ "cmd=0x%x\n", disk->disk_name, cmd));
+
++ error = scsi_verify_blk_ioctl(bdev, cmd);
++ if (error < 0)
++ return error;
++
+ /*
+ * If we are in the middle of error recovery, don't let anyone
+ * else try and use this device. Also, if error recovery fails, it
+@@ -1096,7 +1100,7 @@ static int sd_ioctl(struct block_device *bdev, fmode_t mode,
+ error = scsi_ioctl(sdp, cmd, p);
+ break;
+ default:
+- error = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, p);
++ error = scsi_cmd_blk_ioctl(bdev, mode, cmd, p);
+ if (error != -ENOTTY)
+ break;
+ error = scsi_ioctl(sdp, cmd, p);
+@@ -1266,6 +1270,11 @@ static int sd_compat_ioctl(struct block_device *bdev, fmode_t mode,
+ unsigned int cmd, unsigned long arg)
+ {
+ struct scsi_device *sdev = scsi_disk(bdev->bd_disk)->device;
++ int ret;
++
++ ret = scsi_verify_blk_ioctl(bdev, cmd);
++ if (ret < 0)
++ return ret;
+
+ /*
+ * If we are in the middle of error recovery, don't let anyone
+@@ -1277,8 +1286,6 @@ static int sd_compat_ioctl(struct block_device *bdev, fmode_t mode,
+ return -ENODEV;
+
+ if (sdev->host->hostt->compat_ioctl) {
+- int ret;
+-
+ ret = sdev->host->hostt->compat_ioctl(sdev, cmd, (void __user *)arg);
+
+ return ret;
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
-index 909ed9e..1ae290a 100644
+index 441a1c5..07cece7 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
-@@ -1075,7 +1075,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
+@@ -1077,7 +1077,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
sdp->disk->disk_name,
MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
NULL,
@@ -35610,7 +34996,7 @@ index 909ed9e..1ae290a 100644
case BLKTRACESTART:
return blk_trace_startstop(sdp->device->request_queue, 1);
case BLKTRACESTOP:
-@@ -2310,7 +2310,7 @@ struct sg_proc_leaf {
+@@ -2312,7 +2312,7 @@ struct sg_proc_leaf {
const struct file_operations * fops;
};
@@ -35619,7 +35005,7 @@ index 909ed9e..1ae290a 100644
{"allow_dio", &adio_fops},
{"debug", &debug_fops},
{"def_reserved_size", &dressz_fops},
-@@ -2325,7 +2325,7 @@ sg_proc_init(void)
+@@ -2327,7 +2327,7 @@ sg_proc_init(void)
{
int k, mask;
int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr);
@@ -35628,37 +35014,11 @@ index 909ed9e..1ae290a 100644
sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL);
if (!sg_proc_sgp)
-diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
-index b4543f5..e1b34b8 100644
---- a/drivers/scsi/sym53c8xx_2/sym_glue.c
-+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
-@@ -1756,6 +1756,8 @@ static int __devinit sym2_probe(struct pci_dev *pdev,
- int do_iounmap = 0;
- int do_disable_device = 1;
-
-+ pax_track_stack();
-+
- memset(&sym_dev, 0, sizeof(sym_dev));
- memset(&nvram, 0, sizeof(nvram));
- sym_dev.pdev = pdev;
-diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
-index a18996d..fe993cb 100644
---- a/drivers/scsi/vmw_pvscsi.c
-+++ b/drivers/scsi/vmw_pvscsi.c
-@@ -447,6 +447,8 @@ static void pvscsi_setup_all_rings(const struct pvscsi_adapter *adapter)
- dma_addr_t base;
- unsigned i;
-
-+ pax_track_stack();
-+
- cmd.ringsStatePPN = adapter->ringStatePA >> PAGE_SHIFT;
- cmd.reqRingNumPages = adapter->req_pages;
- cmd.cmpRingNumPages = adapter->cmp_pages;
-diff --git a/drivers/spi/dw_spi_pci.c b/drivers/spi/dw_spi_pci.c
-index ad260aa..42becbe 100644
---- a/drivers/spi/dw_spi_pci.c
-+++ b/drivers/spi/dw_spi_pci.c
-@@ -148,7 +148,7 @@ static int spi_resume(struct pci_dev *pdev)
+diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c
+index f64250e..1ee3049 100644
+--- a/drivers/spi/spi-dw-pci.c
++++ b/drivers/spi/spi-dw-pci.c
+@@ -149,7 +149,7 @@ static int spi_resume(struct pci_dev *pdev)
#define spi_resume NULL
#endif
@@ -35668,10 +35028,10 @@ index ad260aa..42becbe 100644
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0800) },
{},
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
-index 2e13a14..50d2130 100644
+index 77eae99..b7cdcc9 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
-@@ -1023,7 +1023,7 @@ int spi_bus_unlock(struct spi_master *master)
+@@ -1024,7 +1024,7 @@ int spi_bus_unlock(struct spi_master *master)
EXPORT_SYMBOL_GPL(spi_bus_unlock);
/* portable code must never pass more than 32 bytes */
@@ -35680,216 +35040,33 @@ index 2e13a14..50d2130 100644
static u8 *buf;
-diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
-index 62487a7..ceca52a 100644
---- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
-+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
-@@ -362,7 +362,7 @@ static struct ar_cookie s_ar_cookie_mem[MAX_COOKIE_NUM];
- (((ar)->arTargetType == TARGET_TYPE_AR6003) ? AR6003_HOST_INTEREST_ITEM_ADDRESS(item) : 0))
-
-
--static struct net_device_ops ar6000_netdev_ops = {
-+static net_device_ops_no_const ar6000_netdev_ops = {
- .ndo_init = NULL,
- .ndo_open = ar6000_open,
- .ndo_stop = ar6000_close,
-diff --git a/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h b/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
-index 39e0873..0925710 100644
---- a/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
-+++ b/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
-@@ -30,7 +30,7 @@ typedef bool (*ar6k_pal_recv_pkt_t)(void *pHciPalInfo, void *skb);
- typedef struct ar6k_pal_config_s
- {
- ar6k_pal_recv_pkt_t fpar6k_pal_recv_pkt;
--}ar6k_pal_config_t;
-+} __no_const ar6k_pal_config_t;
-
- void register_pal_cb(ar6k_pal_config_t *palConfig_p);
- #endif /* _AR6K_PAL_H_ */
-diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
-index f356c56..5c63ac9 100644
---- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
-+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
-@@ -853,14 +853,14 @@ static void dhd_op_if(dhd_if_t *ifp)
- free_netdev(ifp->net);
- }
- /* Allocate etherdev, including space for private structure */
-- ifp->net = alloc_etherdev(sizeof(dhd));
-+ ifp->net = alloc_etherdev(sizeof(*dhd));
- if (!ifp->net) {
- DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
- ret = -ENOMEM;
- }
- if (ret == 0) {
- strcpy(ifp->net->name, ifp->name);
-- memcpy(netdev_priv(ifp->net), &dhd, sizeof(dhd));
-+ memcpy(netdev_priv(ifp->net), dhd, sizeof(*dhd));
- err = dhd_net_attach(&dhd->pub, ifp->idx);
- if (err != 0) {
- DHD_ERROR(("%s: dhd_net_attach failed, "
-@@ -1872,7 +1872,7 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
- strcpy(nv_path, nvram_path);
-
- /* Allocate etherdev, including space for private structure */
-- net = alloc_etherdev(sizeof(dhd));
-+ net = alloc_etherdev(sizeof(*dhd));
- if (!net) {
- DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
- goto fail;
-@@ -1888,7 +1888,7 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
- /*
- * Save the dhd_info into the priv
- */
-- memcpy(netdev_priv(net), &dhd, sizeof(dhd));
-+ memcpy(netdev_priv(net), dhd, sizeof(*dhd));
-
- /* Set network interface name if it was provided as module parameter */
- if (iface_name[0]) {
-@@ -2004,7 +2004,7 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
- /*
- * Save the dhd_info into the priv
- */
-- memcpy(netdev_priv(net), &dhd, sizeof(dhd));
-+ memcpy(netdev_priv(net), dhd, sizeof(*dhd));
-
- #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
- g_bus = bus;
-diff --git a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h
-index 10cbf52..ec1cef9 100644
---- a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h
-+++ b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h
-@@ -593,7 +593,7 @@ struct phy_func_ptr {
- initfn_t carrsuppr;
- rxsigpwrfn_t rxsigpwr;
- detachfn_t detach;
--};
-+} __no_const;
- typedef struct phy_func_ptr phy_func_ptr_t;
-
- struct phy_info {
-diff --git a/drivers/staging/brcm80211/include/bcmsdh.h b/drivers/staging/brcm80211/include/bcmsdh.h
-index 3b57dc1..ea9849d 100644
---- a/drivers/staging/brcm80211/include/bcmsdh.h
-+++ b/drivers/staging/brcm80211/include/bcmsdh.h
-@@ -185,7 +185,7 @@ typedef struct {
- u16 func, uint bustype, void *regsva, void *param);
- /* detach from device */
- void (*detach) (void *ch);
--} bcmsdh_driver_t;
-+} __no_const bcmsdh_driver_t;
-
- /* platform specific/high level functions */
- extern int bcmsdh_register(bcmsdh_driver_t *driver);
-diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
-index 4241d2a..cd3b543 100644
---- a/drivers/staging/et131x/et1310_tx.c
-+++ b/drivers/staging/et131x/et1310_tx.c
-@@ -635,11 +635,11 @@ inline void et131x_free_send_packet(struct et131x_adapter *etdev,
- struct net_device_stats *stats = &etdev->net_stats;
-
- if (tcb->flags & fMP_DEST_BROAD)
-- atomic_inc(&etdev->Stats.brdcstxmt);
-+ atomic_inc_unchecked(&etdev->Stats.brdcstxmt);
- else if (tcb->flags & fMP_DEST_MULTI)
-- atomic_inc(&etdev->Stats.multixmt);
-+ atomic_inc_unchecked(&etdev->Stats.multixmt);
- else
-- atomic_inc(&etdev->Stats.unixmt);
-+ atomic_inc_unchecked(&etdev->Stats.unixmt);
-
- if (tcb->skb) {
- stats->tx_bytes += tcb->skb->len;
-diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h
-index c852f86..3d0b007 100644
---- a/drivers/staging/et131x/et131x_adapter.h
-+++ b/drivers/staging/et131x/et131x_adapter.h
-@@ -110,11 +110,11 @@ typedef struct _ce_stats_t {
- * operations
- */
- u32 unircv; /* # multicast packets received */
-- atomic_t unixmt; /* # multicast packets for Tx */
-+ atomic_unchecked_t unixmt; /* # multicast packets for Tx */
- u32 multircv; /* # multicast packets received */
-- atomic_t multixmt; /* # multicast packets for Tx */
-+ atomic_unchecked_t multixmt; /* # multicast packets for Tx */
- u32 brdcstrcv; /* # broadcast packets received */
-- atomic_t brdcstxmt; /* # broadcast packets for Tx */
-+ atomic_unchecked_t brdcstxmt; /* # broadcast packets for Tx */
- u32 norcvbuf; /* # Rx packets discarded */
- u32 noxmtbuf; /* # Tx packets discarded */
-
-diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
-index d971bab..af9804b 100644
---- a/drivers/staging/hv/channel.c
-+++ b/drivers/staging/hv/channel.c
-@@ -433,8 +433,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
- int ret = 0;
- int t;
-
-- next_gpadl_handle = atomic_read(&vmbus_connection.next_gpadl_handle);
-- atomic_inc(&vmbus_connection.next_gpadl_handle);
-+ next_gpadl_handle = atomic_read_unchecked(&vmbus_connection.next_gpadl_handle);
-+ atomic_inc_unchecked(&vmbus_connection.next_gpadl_handle);
-
- ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
- if (ret)
-diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
-index a2cc091..0f09c39 100644
---- a/drivers/staging/hv/hv.c
-+++ b/drivers/staging/hv/hv.c
-@@ -132,7 +132,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;
-- volatile void *hypercall_page = hv_context.hypercall_page;
-+ volatile void *hypercall_page = ktva_ktla(hv_context.hypercall_page);
-
- __asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
- "=a"(hv_status_lo) : "d" (control_hi),
-diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
-index 359e737..62de2d1 100644
---- a/drivers/staging/hv/hv_mouse.c
-+++ b/drivers/staging/hv/hv_mouse.c
-@@ -879,8 +879,10 @@ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
- if (hid_dev) {
- DPRINT_INFO(INPUTVSC_DRV, "hid_device created");
-
-- hid_dev->ll_driver->open = mousevsc_hid_open;
-- hid_dev->ll_driver->close = mousevsc_hid_close;
-+ pax_open_kernel();
-+ *(void **)&hid_dev->ll_driver->open = mousevsc_hid_open;
-+ *(void **)&hid_dev->ll_driver->close = mousevsc_hid_close;
-+ pax_close_kernel();
-
- hid_dev->bus = BUS_VIRTUAL;
- hid_dev->vendor = input_device_ctx->device_info.vendor;
-diff --git a/drivers/staging/hv/hyperv_vmbus.h b/drivers/staging/hv/hyperv_vmbus.h
-index bf30a42..f546434 100644
---- a/drivers/staging/hv/hyperv_vmbus.h
-+++ b/drivers/staging/hv/hyperv_vmbus.h
-@@ -559,7 +559,7 @@ enum vmbus_connect_state {
- struct vmbus_connection {
- enum vmbus_connect_state conn_state;
-
-- atomic_t next_gpadl_handle;
-+ atomic_unchecked_t next_gpadl_handle;
-
- /*
- * Represents channel interrupts. Each bit position represents a
+diff --git a/drivers/staging/gma500/power.c b/drivers/staging/gma500/power.c
+index 436fe97..4082570 100644
+--- a/drivers/staging/gma500/power.c
++++ b/drivers/staging/gma500/power.c
+@@ -266,7 +266,7 @@ bool gma_power_begin(struct drm_device *dev, bool force_on)
+ ret = gma_resume_pci(dev->pdev);
+ if (ret == 0) {
+ /* FIXME: we want to defer this for Medfield/Oaktrail */
+- gma_resume_display(dev);
++ gma_resume_display(dev->pdev);
+ psb_irq_preinstall(dev);
+ psb_irq_postinstall(dev);
+ pm_runtime_get(&dev->pdev->dev);
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
-index b47ebb3..f8bc62d 100644
+index bafccb3..e3ac78d 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
-@@ -43,7 +43,7 @@ struct rndis_device {
+@@ -42,7 +42,7 @@ struct rndis_device {
enum rndis_device_state state;
- u32 link_stat;
+ bool link_state;
- atomic_t new_req_id;
+ atomic_unchecked_t new_req_id;
spinlock_t request_lock;
struct list_head req_list;
-@@ -117,7 +117,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
+@@ -116,7 +116,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
* template
*/
set = &rndis_msg->msg.set_req;
@@ -35898,7 +35075,7 @@ index b47ebb3..f8bc62d 100644
/* Add to the request list */
spin_lock_irqsave(&dev->request_lock, flags);
-@@ -637,7 +637,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
+@@ -646,7 +646,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
/* Setup the rndis set */
halt = &request->request_msg.msg.halt_req;
@@ -35907,42 +35084,24 @@ index b47ebb3..f8bc62d 100644
/* Ignore return since this msg is optional. */
rndis_filter_send_request(dev, request);
-diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
-index ec1d38c..d7b474b 100644
---- a/drivers/staging/hv/vmbus_drv.c
-+++ b/drivers/staging/hv/vmbus_drv.c
-@@ -668,11 +668,11 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
- {
- int ret = 0;
-
-- static atomic_t device_num = ATOMIC_INIT(0);
-+ static atomic_unchecked_t device_num = ATOMIC_INIT(0);
-
- /* Set the device name. Otherwise, device_register() will fail. */
- dev_set_name(&child_device_obj->device, "vmbus_0_%d",
-- atomic_inc_return(&device_num));
-+ atomic_inc_return_unchecked(&device_num));
-
- /* The new device belongs to this bus */
- child_device_obj->device.bus = &hv_bus; /* device->dev.bus; */
-diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
-index 3f26f71..fb5c787 100644
---- a/drivers/staging/iio/ring_generic.h
-+++ b/drivers/staging/iio/ring_generic.h
-@@ -62,7 +62,7 @@ struct iio_ring_access_funcs {
-
- int (*is_enabled)(struct iio_ring_buffer *ring);
- int (*enable)(struct iio_ring_buffer *ring);
+diff --git a/drivers/staging/iio/buffer_generic.h b/drivers/staging/iio/buffer_generic.h
+index 9e8f010..af9efb5 100644
+--- a/drivers/staging/iio/buffer_generic.h
++++ b/drivers/staging/iio/buffer_generic.h
+@@ -64,7 +64,7 @@ struct iio_buffer_access_funcs {
+
+ int (*is_enabled)(struct iio_buffer *buffer);
+ int (*enable)(struct iio_buffer *buffer);
-};
+} __no_const;
- struct iio_ring_setup_ops {
- int (*preenable)(struct iio_dev *);
+ /**
+ * struct iio_buffer_setup_ops - buffer setup related callbacks
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
-index cb38f9e..6b137b2 100644
+index 8b307b4..a97ac91 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
-@@ -417,11 +417,11 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
+@@ -420,11 +420,11 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
/* Increment RX stats for virtual ports */
if (work->ipprt >= CVMX_PIP_NUM_INPUT_PORTS) {
#ifdef CONFIG_64BIT
@@ -35958,7 +35117,7 @@ index cb38f9e..6b137b2 100644
#endif
}
netif_receive_skb(skb);
-@@ -433,9 +433,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
+@@ -436,9 +436,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
dev->name);
*/
#ifdef CONFIG_64BIT
@@ -35971,7 +35130,7 @@ index cb38f9e..6b137b2 100644
dev_kfree_skb_irq(skb);
}
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
-index a8f780e..aef1098 100644
+index 076f866..2308070 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -258,11 +258,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
@@ -35991,10 +35150,10 @@ index a8f780e..aef1098 100644
}
diff --git a/drivers/staging/pohmelfs/inode.c b/drivers/staging/pohmelfs/inode.c
-index c0f0ac7..d214d36 100644
+index 7a19555..466456d 100644
--- a/drivers/staging/pohmelfs/inode.c
+++ b/drivers/staging/pohmelfs/inode.c
-@@ -1856,7 +1856,7 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
+@@ -1861,7 +1861,7 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
mutex_init(&psb->mcache_lock);
psb->mcache_root = RB_ROOT;
psb->mcache_timeout = msecs_to_jiffies(5000);
@@ -36003,7 +35162,7 @@ index c0f0ac7..d214d36 100644
psb->trans_max_pages = 100;
-@@ -1871,7 +1871,7 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
+@@ -1876,7 +1876,7 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
INIT_LIST_HEAD(&psb->crypto_ready_list);
INIT_LIST_HEAD(&psb->crypto_active_list);
@@ -36047,7 +35206,7 @@ index 985b6b7..7699e05 100644
unsigned int crypto_attached_size;
unsigned int crypto_align_size;
diff --git a/drivers/staging/pohmelfs/trans.c b/drivers/staging/pohmelfs/trans.c
-index 36a2535..0591bf4 100644
+index 06c1a74..866eebc 100644
--- a/drivers/staging/pohmelfs/trans.c
+++ b/drivers/staging/pohmelfs/trans.c
@@ -492,7 +492,7 @@ int netfs_trans_finish(struct netfs_trans *t, struct pohmelfs_sb *psb)
@@ -36060,10 +35219,10 @@ index 36a2535..0591bf4 100644
cmd->size = t->iovec.iov_len - sizeof(struct netfs_cmd) +
t->attached_size + t->attached_pages * sizeof(struct netfs_cmd);
diff --git a/drivers/staging/rtl8712/rtl871x_io.h b/drivers/staging/rtl8712/rtl871x_io.h
-index b70cb2b..4db41a7 100644
+index 86308a0..feaa925 100644
--- a/drivers/staging/rtl8712/rtl871x_io.h
+++ b/drivers/staging/rtl8712/rtl871x_io.h
-@@ -83,7 +83,7 @@ struct _io_ops {
+@@ -108,7 +108,7 @@ struct _io_ops {
u8 *pmem);
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
u8 *pmem);
@@ -36085,24 +35244,11 @@ index c7b5e8b..783d6cb 100644
return -EFAULT;
return 0;
-diff --git a/drivers/staging/tty/stallion.c b/drivers/staging/tty/stallion.c
-index 4fff5cd..8e5762a 100644
---- a/drivers/staging/tty/stallion.c
-+++ b/drivers/staging/tty/stallion.c
-@@ -2406,6 +2406,8 @@ static int stl_getportstruct(struct stlport __user *arg)
- struct stlport stl_dummyport;
- struct stlport *portp;
-
-+ pax_track_stack();
-+
- if (copy_from_user(&stl_dummyport, arg, sizeof(struct stlport)))
- return -EFAULT;
- portp = stl_getport(stl_dummyport.brdnr, stl_dummyport.panelnr,
diff --git a/drivers/staging/usbip/usbip_common.h b/drivers/staging/usbip/usbip_common.h
-index 4a641c5..a3ed832 100644
+index be21617..0954e45 100644
--- a/drivers/staging/usbip/usbip_common.h
+++ b/drivers/staging/usbip/usbip_common.h
-@@ -315,7 +315,7 @@ struct usbip_device {
+@@ -289,7 +289,7 @@ struct usbip_device {
void (*shutdown)(struct usbip_device *);
void (*reset)(struct usbip_device *);
void (*unusable)(struct usbip_device *);
@@ -36110,12 +35256,12 @@ index 4a641c5..a3ed832 100644
+ } __no_const eh_ops;
};
- void usbip_pack_pdu(struct usbip_header *pdu, struct urb *urb, int cmd,
+ #if 0
diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h
-index d5bc8e7..3c0b221 100644
+index 88b3298..3783eee 100644
--- a/drivers/staging/usbip/vhci.h
+++ b/drivers/staging/usbip/vhci.h
-@@ -94,7 +94,7 @@ struct vhci_hcd {
+@@ -88,7 +88,7 @@ struct vhci_hcd {
unsigned resuming:1;
unsigned long re_timeout;
@@ -36125,10 +35271,10 @@ index d5bc8e7..3c0b221 100644
/*
* NOTE:
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
-index 76d7485..ab8524a 100644
+index 2ee97e2..0420b86 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
-@@ -511,7 +511,7 @@ static void vhci_tx_urb(struct urb *urb)
+@@ -527,7 +527,7 @@ static void vhci_tx_urb(struct urb *urb)
return;
}
@@ -36137,7 +35283,7 @@ index 76d7485..ab8524a 100644
if (priv->seqnum == 0xffff)
dev_info(&urb->dev->dev, "seqnum max\n");
-@@ -765,7 +765,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
+@@ -779,7 +779,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
return -ENOMEM;
}
@@ -36146,7 +35292,7 @@ index 76d7485..ab8524a 100644
if (unlink->seqnum == 0xffff)
pr_info("seqnum max\n");
-@@ -955,7 +955,7 @@ static int vhci_start(struct usb_hcd *hcd)
+@@ -969,7 +969,7 @@ static int vhci_start(struct usb_hcd *hcd)
vdev->rhport = rhport;
}
@@ -36156,7 +35302,7 @@ index 76d7485..ab8524a 100644
hcd->power_budget = 0; /* no limit */
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c
-index 5c4b5d9..fdfc7bf1 100644
+index 3872b8c..fe6d2f4 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,
@@ -36242,7 +35388,7 @@ index 7843dfd..3db105f 100644
static int
hfa384x_usbctlx_complete_sync(hfa384x_t *hw,
diff --git a/drivers/staging/zcache/tmem.c b/drivers/staging/zcache/tmem.c
-index e954d40..a04d842 100644
+index 1ca66ea..76f1343 100644
--- a/drivers/staging/zcache/tmem.c
+++ b/drivers/staging/zcache/tmem.c
@@ -39,7 +39,7 @@
@@ -36264,18 +35410,18 @@ index e954d40..a04d842 100644
void tmem_register_pamops(struct tmem_pamops *m)
{
diff --git a/drivers/staging/zcache/tmem.h b/drivers/staging/zcache/tmem.h
-index 2e07e21..6507d31 100644
+index ed147c4..94fc3c6 100644
--- a/drivers/staging/zcache/tmem.h
+++ b/drivers/staging/zcache/tmem.h
-@@ -171,6 +171,7 @@ struct tmem_pamops {
- int (*get_data)(struct page *, void *, struct tmem_pool *);
- void (*free)(void *, struct tmem_pool *);
+@@ -180,6 +180,7 @@ struct tmem_pamops {
+ void (*new_obj)(struct tmem_obj *);
+ int (*replace_in_obj)(void *, struct tmem_obj *);
};
+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 */
-@@ -180,6 +181,7 @@ struct tmem_hostops {
+@@ -189,6 +190,7 @@ struct tmem_hostops {
struct tmem_objnode *(*objnode_alloc)(struct tmem_pool *);
void (*objnode_free)(struct tmem_objnode *, struct tmem_pool *);
};
@@ -36283,121 +35429,55 @@ index 2e07e21..6507d31 100644
extern void tmem_register_hostops(struct tmem_hostops *m);
/* core tmem accessor functions */
-diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
-index 86b3660..48c1b66 100644
---- a/drivers/target/target_core_alua.c
-+++ b/drivers/target/target_core_alua.c
-@@ -695,6 +695,8 @@ static int core_alua_update_tpg_primary_metadata(
- char path[ALUA_METADATA_PATH_LEN];
- int len;
-
-+ pax_track_stack();
-+
- memset(path, 0, ALUA_METADATA_PATH_LEN);
-
- len = snprintf(md_buf, tg_pt_gp->tg_pt_gp_md_buf_len,
-@@ -958,6 +960,8 @@ static int core_alua_update_tpg_secondary_metadata(
- char path[ALUA_METADATA_PATH_LEN], wwn[ALUA_SECONDARY_METADATA_WWN_LEN];
- int len;
-
-+ pax_track_stack();
-+
- memset(path, 0, ALUA_METADATA_PATH_LEN);
- memset(wwn, 0, ALUA_SECONDARY_METADATA_WWN_LEN);
-
-diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
-index 7f19c8b..5f21663 100644
---- a/drivers/target/target_core_cdb.c
-+++ b/drivers/target/target_core_cdb.c
-@@ -838,6 +838,8 @@ target_emulate_modesense(struct se_cmd *cmd, int ten)
- int length = 0;
- unsigned char buf[SE_MODE_PAGE_BUF];
-
-+ pax_track_stack();
-+
- memset(buf, 0, SE_MODE_PAGE_BUF);
-
- switch (cdb[2] & 0x3f) {
-diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
-index 25c1f49..68cdbd0 100644
---- a/drivers/target/target_core_configfs.c
-+++ b/drivers/target/target_core_configfs.c
-@@ -1276,6 +1276,8 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
- ssize_t len = 0;
- int reg_count = 0, prf_isid;
-
-+ pax_track_stack();
-+
- if (!(su_dev->se_dev_ptr))
- return -ENODEV;
-
-diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
-index b662db3..d5e2e48 100644
---- a/drivers/target/target_core_pr.c
-+++ b/drivers/target/target_core_pr.c
-@@ -918,6 +918,8 @@ static int __core_scsi3_check_aptpl_registration(
- unsigned char t_port[PR_APTPL_MAX_TPORT_LEN];
- u16 tpgt;
-
-+ pax_track_stack();
-+
- memset(i_port, 0, PR_APTPL_MAX_IPORT_LEN);
- memset(t_port, 0, PR_APTPL_MAX_TPORT_LEN);
- /*
-@@ -1861,6 +1863,8 @@ static int __core_scsi3_update_aptpl_buf(
- ssize_t len = 0;
- int reg_count = 0;
-
-+ pax_track_stack();
-+
- memset(buf, 0, pr_aptpl_buf_len);
- /*
- * Called to clear metadata once APTPL has been deactivated.
-@@ -1983,6 +1987,8 @@ static int __core_scsi3_write_aptpl_to_file(
- char path[512];
- int ret;
-
-+ pax_track_stack();
-+
- memset(iov, 0, sizeof(struct iovec));
- memset(path, 0, 512);
-
+diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
+index 8599545..7761358 100644
+--- a/drivers/target/iscsi/iscsi_target.c
++++ b/drivers/target/iscsi/iscsi_target.c
+@@ -1364,7 +1364,7 @@ static int iscsit_handle_data_out(struct iscsi_conn *conn, unsigned char *buf)
+ * outstanding_r2ts reaches zero, go ahead and send the delayed
+ * TASK_ABORTED status.
+ */
+- if (atomic_read(&se_cmd->t_transport_aborted) != 0) {
++ if (atomic_read_unchecked(&se_cmd->t_transport_aborted) != 0) {
+ if (hdr->flags & ISCSI_FLAG_CMD_FINAL)
+ if (--cmd->outstanding_r2ts < 1) {
+ iscsit_stop_dataout_timer(cmd);
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
-index 179063d..7baed53 100644
+index 6845228..df77141 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
-@@ -269,7 +269,7 @@ int core_tmr_lun_reset(
- CMD_TFO(cmd)->get_task_tag(cmd), cmd->pr_res_key,
- T_TASK(cmd)->t_task_cdbs,
- atomic_read(&T_TASK(cmd)->t_task_cdbs_left),
-- atomic_read(&T_TASK(cmd)->t_task_cdbs_sent),
-+ atomic_read_unchecked(&T_TASK(cmd)->t_task_cdbs_sent),
- atomic_read(&T_TASK(cmd)->t_transport_active),
- atomic_read(&T_TASK(cmd)->t_transport_stop),
- atomic_read(&T_TASK(cmd)->t_transport_sent));
-@@ -311,7 +311,7 @@ int core_tmr_lun_reset(
- DEBUG_LR("LUN_RESET: got t_transport_active = 1 for"
+@@ -250,7 +250,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),
+ atomic_read(&cmd->t_transport_active),
+ atomic_read(&cmd->t_transport_stop),
+ atomic_read(&cmd->t_transport_sent));
+@@ -281,7 +281,7 @@ static void core_tmr_drain_task_list(
+ pr_debug("LUN_RESET: got t_transport_active = 1 for"
" task: %p, t_fe_count: %d dev: %p\n", task,
fe_count, dev);
-- atomic_set(&T_TASK(cmd)->t_transport_aborted, 1);
-+ atomic_set_unchecked(&T_TASK(cmd)->t_transport_aborted, 1);
- spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock,
- flags);
+- atomic_set(&cmd->t_transport_aborted, 1);
++ atomic_set_unchecked(&cmd->t_transport_aborted, 1);
+ spin_unlock_irqrestore(&cmd->t_state_lock, flags);
+
core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
-@@ -321,7 +321,7 @@ int core_tmr_lun_reset(
+@@ -289,7 +289,7 @@ static void core_tmr_drain_task_list(
}
- DEBUG_LR("LUN_RESET: Got t_transport_active = 0 for task: %p,"
+ pr_debug("LUN_RESET: Got t_transport_active = 0 for task: %p,"
" t_fe_count: %d dev: %p\n", task, fe_count, dev);
-- atomic_set(&T_TASK(cmd)->t_transport_aborted, 1);
-+ atomic_set_unchecked(&T_TASK(cmd)->t_transport_aborted, 1);
- spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock, flags);
- core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
+- atomic_set(&cmd->t_transport_aborted, 1);
++ atomic_set_unchecked(&cmd->t_transport_aborted, 1);
+ spin_unlock_irqrestore(&cmd->t_state_lock, flags);
+ core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
-index 1340ffd..610981a 100644
+index 0257658..09433d5 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
-@@ -1681,7 +1681,7 @@ struct se_device *transport_add_device_to_core_hba(
+@@ -1343,7 +1343,7 @@ struct se_device *transport_add_device_to_core_hba(
dev->queue_depth = dev_limits->queue_depth;
atomic_set(&dev->depth_left, dev->queue_depth);
@@ -36406,87 +35486,65 @@ index 1340ffd..610981a 100644
se_dev_set_default_attribs(dev, dev_limits);
-@@ -1882,7 +1882,7 @@ static int transport_check_alloc_task_attr(struct se_cmd *cmd)
+@@ -1530,7 +1530,7 @@ static int 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(&SE_DEV(cmd)->dev_ordered_id);
-+ cmd->se_ordered_id = atomic_inc_return_unchecked(&SE_DEV(cmd)->dev_ordered_id);
+- 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);
smp_mb__after_atomic_inc();
- DEBUG_STA("Allocated se_ordered_id: %u for Task Attr: 0x%02x on %s\n",
+ pr_debug("Allocated se_ordered_id: %u for Task Attr: 0x%02x on %s\n",
cmd->se_ordered_id, cmd->sam_task_attr,
-@@ -2169,7 +2169,7 @@ static void transport_generic_request_failure(
+@@ -1800,7 +1800,7 @@ static void transport_generic_request_failure(struct se_cmd *cmd)
" t_transport_active: %d t_transport_stop: %d"
- " t_transport_sent: %d\n", T_TASK(cmd)->t_task_cdbs,
- atomic_read(&T_TASK(cmd)->t_task_cdbs_left),
-- atomic_read(&T_TASK(cmd)->t_task_cdbs_sent),
-+ atomic_read_unchecked(&T_TASK(cmd)->t_task_cdbs_sent),
- atomic_read(&T_TASK(cmd)->t_task_cdbs_ex_left),
- atomic_read(&T_TASK(cmd)->t_transport_active),
- atomic_read(&T_TASK(cmd)->t_transport_stop),
-@@ -2673,9 +2673,9 @@ check_depth:
- spin_lock_irqsave(&T_TASK(cmd)->t_state_lock, flags);
- atomic_set(&task->task_active, 1);
- atomic_set(&task->task_sent, 1);
-- atomic_inc(&T_TASK(cmd)->t_task_cdbs_sent);
-+ atomic_inc_unchecked(&T_TASK(cmd)->t_task_cdbs_sent);
-
-- if (atomic_read(&T_TASK(cmd)->t_task_cdbs_sent) ==
-+ if (atomic_read_unchecked(&T_TASK(cmd)->t_task_cdbs_sent) ==
- T_TASK(cmd)->t_task_cdbs)
- atomic_set(&cmd->transport_sent, 1);
-
-@@ -5573,7 +5573,7 @@ static void transport_generic_wait_for_tasks(
- atomic_set(&T_TASK(cmd)->transport_lun_stop, 0);
- }
- if (!atomic_read(&T_TASK(cmd)->t_transport_active) ||
-- atomic_read(&T_TASK(cmd)->t_transport_aborted))
-+ atomic_read_unchecked(&T_TASK(cmd)->t_transport_aborted))
- goto remove;
-
- atomic_set(&T_TASK(cmd)->t_transport_stop, 1);
-@@ -5802,7 +5802,7 @@ int transport_check_aborted_status(struct se_cmd *cmd, int send_status)
+ " t_transport_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),
+ atomic_read(&cmd->t_transport_active),
+ atomic_read(&cmd->t_transport_stop),
+@@ -2089,9 +2089,9 @@ check_depth:
+
+ 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)
+ atomic_set(&cmd->t_transport_sent, 1);
+
+@@ -4260,7 +4260,7 @@ bool transport_wait_for_tasks(struct se_cmd *cmd)
+ atomic_set(&cmd->transport_lun_stop, 0);
+ }
+ if (!atomic_read(&cmd->t_transport_active) ||
+- atomic_read(&cmd->t_transport_aborted)) {
++ atomic_read_unchecked(&cmd->t_transport_aborted)) {
+ spin_unlock_irqrestore(&cmd->t_state_lock, flags);
+ return false;
+ }
+@@ -4495,7 +4495,7 @@ int transport_check_aborted_status(struct se_cmd *cmd, int send_status)
{
int ret = 0;
-- if (atomic_read(&T_TASK(cmd)->t_transport_aborted) != 0) {
-+ if (atomic_read_unchecked(&T_TASK(cmd)->t_transport_aborted) != 0) {
- if (!(send_status) ||
+- if (atomic_read(&cmd->t_transport_aborted) != 0) {
++ if (atomic_read_unchecked(&cmd->t_transport_aborted) != 0) {
+ if (!send_status ||
(cmd->se_cmd_flags & SCF_SENT_DELAYED_TAS))
return 1;
-@@ -5830,7 +5830,7 @@ void transport_send_task_abort(struct se_cmd *cmd)
+@@ -4532,7 +4532,7 @@ void transport_send_task_abort(struct se_cmd *cmd)
*/
if (cmd->data_direction == DMA_TO_DEVICE) {
- if (CMD_TFO(cmd)->write_pending_status(cmd) != 0) {
-- atomic_inc(&T_TASK(cmd)->t_transport_aborted);
-+ atomic_inc_unchecked(&T_TASK(cmd)->t_transport_aborted);
+ if (cmd->se_tfo->write_pending_status(cmd) != 0) {
+- atomic_inc(&cmd->t_transport_aborted);
++ atomic_inc_unchecked(&cmd->t_transport_aborted);
smp_mb__after_atomic_inc();
- cmd->scsi_status = SAM_STAT_TASK_ABORTED;
- transport_new_cmd_failure(cmd);
-@@ -5954,7 +5954,7 @@ static void transport_processing_shutdown(struct se_device *dev)
- CMD_TFO(cmd)->get_task_tag(cmd),
- T_TASK(cmd)->t_task_cdbs,
- atomic_read(&T_TASK(cmd)->t_task_cdbs_left),
-- atomic_read(&T_TASK(cmd)->t_task_cdbs_sent),
-+ atomic_read_unchecked(&T_TASK(cmd)->t_task_cdbs_sent),
- atomic_read(&T_TASK(cmd)->t_transport_active),
- atomic_read(&T_TASK(cmd)->t_transport_stop),
- atomic_read(&T_TASK(cmd)->t_transport_sent));
-diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
-index d5f923b..9c78228 100644
---- a/drivers/telephony/ixj.c
-+++ b/drivers/telephony/ixj.c
-@@ -4976,6 +4976,8 @@ static int ixj_daa_cid_read(IXJ *j)
- bool mContinue;
- char *pIn, *pOut;
-
-+ pax_track_stack();
-+
- if (!SCI_Prepare(j))
- return 0;
-
+ }
+ }
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
-index 4c8b665..1d931eb 100644
+index b9040be..e3f5aab 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -83,6 +83,7 @@
@@ -36718,12 +35776,12 @@ index ef92869..f4ebd88 100644
ipwireless_disassociate_network_ttys(network,
ttyj->channel_idx);
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
-index c0d34ad..67a388f 100644
+index fc7bbba..9527e93 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
-@@ -1589,7 +1589,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
- return NULL;
- spin_lock_init(&dlci->lock);
+@@ -1629,7 +1629,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
+ kref_init(&dlci->ref);
+ mutex_init(&dlci->mutex);
dlci->fifo = &dlci->_fifo;
- if (kfifo_alloc(&dlci->_fifo, 4096, GFP_KERNEL) < 0) {
+ if (kfifo_alloc(&dlci->_fifo, 4096, GFP_KERNEL)) {
@@ -36731,7 +35789,7 @@ index c0d34ad..67a388f 100644
return NULL;
}
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
-index c3954fb..674952c 100644
+index 39d6ab6..eb97f41 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2123,6 +2123,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
@@ -36759,24 +35817,11 @@ index e18604b..a7d5a11 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 13043e8..19f322b 100644
---- a/drivers/tty/rocket.c
-+++ b/drivers/tty/rocket.c
-@@ -1277,6 +1277,8 @@ static int get_ports(struct r_port *info, struct rocket_ports __user *retports)
- struct rocket_ports tmp;
- int board;
-
-+ pax_track_stack();
-+
- if (!retports)
- return -EFAULT;
- memset(&tmp, 0, sizeof (tmp));
diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
-index 87e7e6c..89744e0 100644
+index 2b42a01..32a2ed3 100644
--- a/drivers/tty/serial/kgdboc.c
+++ b/drivers/tty/serial/kgdboc.c
-@@ -23,8 +23,9 @@
+@@ -24,8 +24,9 @@
#define MAX_CONFIG_LEN 40
static struct kgdb_io kgdboc_io_ops;
@@ -36787,7 +35832,7 @@ index 87e7e6c..89744e0 100644
static int configured = -1;
static char config[MAX_CONFIG_LEN];
-@@ -147,6 +148,8 @@ static void cleanup_kgdboc(void)
+@@ -148,6 +149,8 @@ static void cleanup_kgdboc(void)
kgdboc_unregister_kbd();
if (configured == 1)
kgdb_unregister_io_module(&kgdboc_io_ops);
@@ -36796,7 +35841,7 @@ index 87e7e6c..89744e0 100644
}
static int configure_kgdboc(void)
-@@ -156,13 +159,13 @@ static int configure_kgdboc(void)
+@@ -157,13 +160,13 @@ static int configure_kgdboc(void)
int err;
char *cptr = config;
struct console *cons;
@@ -36811,7 +35856,7 @@ index 87e7e6c..89744e0 100644
kgdb_tty_driver = NULL;
kgdboc_use_kms = 0;
-@@ -183,7 +186,7 @@ static int configure_kgdboc(void)
+@@ -184,7 +187,7 @@ static int configure_kgdboc(void)
int idx;
if (cons->device && cons->device(cons, &idx) == p &&
idx == tty_line) {
@@ -36820,7 +35865,7 @@ index 87e7e6c..89744e0 100644
break;
}
cons = cons->next;
-@@ -193,12 +196,16 @@ static int configure_kgdboc(void)
+@@ -194,12 +197,16 @@ static int configure_kgdboc(void)
kgdb_tty_line = tty_line;
do_register:
@@ -36840,7 +35885,7 @@ index 87e7e6c..89744e0 100644
return 0;
noconfig:
-@@ -212,7 +219,7 @@ noconfig:
+@@ -213,7 +220,7 @@ noconfig:
static int __init init_kgdboc(void)
{
/* Already configured? */
@@ -36849,7 +35894,7 @@ index 87e7e6c..89744e0 100644
return 0;
return configure_kgdboc();
-@@ -261,7 +268,7 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp)
+@@ -262,7 +269,7 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp)
if (config[len - 1] == '\n')
config[len - 1] = '\0';
@@ -36858,7 +35903,7 @@ index 87e7e6c..89744e0 100644
cleanup_kgdboc();
/* Go and configure with the new params. */
-@@ -301,6 +308,15 @@ static struct kgdb_io kgdboc_io_ops = {
+@@ -302,6 +309,15 @@ static struct kgdb_io kgdboc_io_ops = {
.post_exception = kgdboc_post_exp_handler,
};
@@ -36874,37 +35919,11 @@ index 87e7e6c..89744e0 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/mfd.c b/drivers/tty/serial/mfd.c
-index cab52f4..29fc6aa 100644
---- a/drivers/tty/serial/mfd.c
-+++ b/drivers/tty/serial/mfd.c
-@@ -1423,7 +1423,7 @@ static void serial_hsu_remove(struct pci_dev *pdev)
- }
-
- /* First 3 are UART ports, and the 4th is the DMA */
--static const struct pci_device_id pci_ids[] __devinitdata = {
-+static const struct pci_device_id pci_ids[] __devinitconst = {
- { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081B) },
- { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081C) },
- { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081D) },
-diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c
-index 23bc743..d425c07 100644
---- a/drivers/tty/serial/mrst_max3110.c
-+++ b/drivers/tty/serial/mrst_max3110.c
-@@ -393,6 +393,8 @@ static void max3110_con_receive(struct uart_max3110 *max)
- int loop = 1, num, total = 0;
- u8 recv_buf[512], *pbuf;
-
-+ pax_track_stack();
-+
- pbuf = recv_buf;
- do {
- num = max3110_read_multi(max, pbuf);
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
-index b44aef0..c5ad11d 100644
+index 05085be..67eadb0 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
-@@ -3238,7 +3238,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
+@@ -3240,7 +3240,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
void tty_default_fops(struct file_operations *fops)
{
@@ -36914,7 +35933,7 @@ index b44aef0..c5ad11d 100644
/*
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
-index a76c808..ecbc743 100644
+index 8e0924f..4204eb4 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -75,7 +75,7 @@ static void put_ldisc(struct tty_ldisc *ld)
@@ -36963,10 +35982,10 @@ index a76c808..ecbc743 100644
spin_unlock_irqrestore(&tty_ldisc_lock, flags);
}
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
-index 3761ccf..2c613b3 100644
+index a605549..6bd3c96 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
-@@ -656,6 +656,16 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag)
+@@ -657,6 +657,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 */
@@ -36983,19 +36002,6 @@ index 3761ccf..2c613b3 100644
fn_handler[value](vc);
}
-diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
-index b3915b7..e716839 100644
---- a/drivers/tty/vt/vt.c
-+++ b/drivers/tty/vt/vt.c
-@@ -259,7 +259,7 @@ EXPORT_SYMBOL_GPL(unregister_vt_notifier);
-
- static void notify_write(struct vc_data *vc, unsigned int unicode)
- {
-- struct vt_notifier_param param = { .vc = vc, unicode = unicode };
-+ struct vt_notifier_param param = { .vc = vc, .c = unicode };
- atomic_notifier_call_chain(&vt_notifier_list, VT_WRITE, &param);
- }
-
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index 5e096f4..0da1363 100644
--- a/drivers/tty/vt/vt_ioctl.c
@@ -37041,7 +36047,7 @@ index 5e096f4..0da1363 100644
ret = -EPERM;
goto reterr;
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
-index d2efe82..9440ab6 100644
+index a783d53..cb30d94 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -25,6 +25,7 @@
@@ -37126,7 +36132,7 @@ index d2efe82..9440ab6 100644
}
static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-@@ -823,7 +824,7 @@ int __uio_register_device(struct module *owner,
+@@ -821,7 +822,7 @@ int __uio_register_device(struct module *owner,
idev->owner = owner;
idev->info = info;
init_waitqueue_head(&idev->wait);
@@ -37149,10 +36155,10 @@ index a845f8b..4f54072 100644
pos += tmp;
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
-index 989e16e..32c4bc7 100644
+index d3448ca..d2864ca 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
-@@ -332,7 +332,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
+@@ -333,7 +333,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
if (printk_ratelimit())
atm_warn(instance, "%s: OAM not supported (vpi %d, vci %d)!\n",
__func__, vpi, vci);
@@ -37161,7 +36167,7 @@ index 989e16e..32c4bc7 100644
return;
}
-@@ -360,7 +360,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
+@@ -361,7 +361,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
if (length > ATM_MAX_AAL5_PDU) {
atm_rldbg(instance, "%s: bogus length %u (vcc: 0x%p)!\n",
__func__, length, vcc);
@@ -37170,7 +36176,7 @@ index 989e16e..32c4bc7 100644
goto out;
}
-@@ -369,14 +369,14 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
+@@ -370,14 +370,14 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
if (sarb->len < pdu_length) {
atm_rldbg(instance, "%s: bogus pdu_length %u (sarb->len: %u, vcc: 0x%p)!\n",
__func__, pdu_length, sarb->len, vcc);
@@ -37187,7 +36193,7 @@ index 989e16e..32c4bc7 100644
goto out;
}
-@@ -386,7 +386,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
+@@ -387,7 +387,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);
@@ -37196,7 +36202,7 @@ index 989e16e..32c4bc7 100644
goto out;
}
-@@ -411,7 +411,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
+@@ -412,7 +412,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
vcc->push(vcc, skb);
@@ -37205,7 +36211,7 @@ index 989e16e..32c4bc7 100644
out:
skb_trim(sarb, 0);
}
-@@ -614,7 +614,7 @@ static void usbatm_tx_process(unsigned long data)
+@@ -615,7 +615,7 @@ static void usbatm_tx_process(unsigned long data)
struct atm_vcc *vcc = UDSL_SKB(skb)->atm.vcc;
usbatm_pop(vcc, skb);
@@ -37232,7 +36238,7 @@ index 989e16e..32c4bc7 100644
if (!left--) {
if (instance->disconnected)
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
-index 0149c09..f108812 100644
+index d956965..4179a77 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -126,7 +126,7 @@ static const char format_endpt[] =
@@ -37263,7 +36269,7 @@ index 0149c09..f108812 100644
file->f_version = event_count;
return POLLIN | POLLRDNORM;
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
-index 0b5ec23..0da3d76 100644
+index b3bdfed..a9460e0 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -869,8 +869,8 @@ char *usb_cache_string(struct usb_device *udev, int index)
@@ -37318,19 +36324,6 @@ index 1fc8f12..20647c1 100644
return 0;
}
-diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
-index ffeee57..22ca548 100644
---- a/drivers/usb/host/xhci-mem.c
-+++ b/drivers/usb/host/xhci-mem.c
-@@ -1685,6 +1685,8 @@ static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci, gfp_t mem_flags)
- unsigned int num_tests;
- int i, ret;
-
-+ pax_track_stack();
-+
- num_tests = ARRAY_SIZE(simple_test_vector);
- for (i = 0; i < num_tests; i++) {
- ret = xhci_test_trb_in_td(xhci,
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
@@ -37354,10 +36347,10 @@ index d6bea3e..60b250e 100644
/**
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c
-index 6ccd93a..8aad238 100644
+index 57c01ab..8a05959 100644
--- a/drivers/usb/wusbcore/wa-xfer.c
+++ b/drivers/usb/wusbcore/wa-xfer.c
-@@ -294,7 +294,7 @@ out:
+@@ -296,7 +296,7 @@ out:
*/
static void wa_xfer_id_init(struct wa_xfer *xfer)
{
@@ -37367,11 +36360,11 @@ index 6ccd93a..8aad238 100644
/*
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
-index ea966b3..7b64792 100644
+index c14c42b..f955cc2 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
-@@ -589,7 +589,7 @@ static int init_used(struct vhost_virtqueue *vq,
- return get_user(vq->last_used_idx, &used->idx);
+@@ -629,7 +629,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)
@@ -37407,7 +36400,7 @@ index 5c3960d..15cf8fc 100644
goto out1;
}
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
-index ad93629..ca6a218 100644
+index ad93629..e020fc3 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,
@@ -37428,25 +36421,7 @@ index ad93629..ca6a218 100644
info->fbops->fb_imageblit(info, image);
image->dy -= image->height + 8;
}
-@@ -939,6 +939,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
- int flags = info->flags;
- int ret = 0;
-
-+ pax_track_stack();
-+
- if (var->activate & FB_ACTIVATE_INV_MODE) {
- struct fb_videomode mode1, mode2;
-
-@@ -1064,6 +1066,8 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
- void __user *argp = (void __user *)arg;
- long ret = 0;
-
-+ pax_track_stack();
-+
- switch (cmd) {
- case FBIOGET_VSCREENINFO:
- if (!lock_fb_info(info))
-@@ -1143,7 +1147,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
+@@ -1143,7 +1143,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;
@@ -37469,7 +36444,7 @@ index 5a5d092..265c5ed 100644
{ 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 896e53d..4d87d0b 100644
+index 0fad23f..0e9afa4 100644
--- a/drivers/video/gxt4500.c
+++ b/drivers/video/gxt4500.c
@@ -156,7 +156,7 @@ struct gxt4500_par {
@@ -40258,10 +39233,10 @@ 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
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
-index 816a4fd..5f1c678 100644
+index 3473e75..c930142 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
-@@ -586,11 +586,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:
@@ -40277,7 +39252,7 @@ index 816a4fd..5f1c678 100644
>> 10)), /* Kcycles */
&dev->cpu_kcycles_used);
-@@ -711,11 +711,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:
@@ -40293,7 +39268,7 @@ index 816a4fd..5f1c678 100644
>> 10)), /* Kcycles */
&dev->cpu_kcycles_used);
}
-@@ -1307,7 +1307,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev,
+@@ -1368,7 +1368,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",
@@ -40302,7 +39277,7 @@ index 816a4fd..5f1c678 100644
}
static ssize_t metrics_bytes_identical_show(struct device *fbdev,
-@@ -1315,7 +1315,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev,
+@@ -1376,7 +1376,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",
@@ -40311,7 +39286,7 @@ index 816a4fd..5f1c678 100644
}
static ssize_t metrics_bytes_sent_show(struct device *fbdev,
-@@ -1323,7 +1323,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev,
+@@ -1384,7 +1384,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",
@@ -40320,7 +39295,7 @@ index 816a4fd..5f1c678 100644
}
static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
-@@ -1331,7 +1331,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
+@@ -1392,7 +1392,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",
@@ -40329,7 +39304,7 @@ index 816a4fd..5f1c678 100644
}
static ssize_t edid_show(
-@@ -1388,10 +1388,10 @@ static ssize_t metrics_reset_store(struct device *fbdev,
+@@ -1449,10 +1449,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;
@@ -40542,24 +39517,34 @@ index 88714ae..16c2e11 100644
static inline u32 get_pll_internal_frequency(u32 ref_freq,
-diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
-index e058ace..2424d93 100644
---- a/drivers/virtio/virtio_balloon.c
-+++ b/drivers/virtio/virtio_balloon.c
-@@ -174,6 +174,8 @@ static void update_balloon_stats(struct virtio_balloon *vb)
- struct sysinfo i;
- int idx = 0;
-
-+ pax_track_stack();
-+
- all_vm_events(events);
- si_meminfo(&i);
-
+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/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
-index c72e20c..b8a3f73 100644
+index 879ed88..bc03a01 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
-@@ -1264,7 +1264,7 @@ static void *v9fs_vfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+@@ -1286,7 +1286,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)
{
@@ -40582,7 +39567,7 @@ index 79e2ca7..5828ad1 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 e29ec48..f083e5e 100644
+index 78c514c..22ac304 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -119,7 +119,7 @@ static int aio_setup_ring(struct kioctx *ctx)
@@ -40594,16 +39579,7 @@ index e29ec48..f083e5e 100644
return -EINVAL;
nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) / sizeof(struct io_event);
-@@ -1088,6 +1088,8 @@ static int read_events(struct kioctx *ctx,
- struct aio_timeout to;
- int retry = 0;
-
-+ pax_track_stack();
-+
- /* needed to zero any padding within an entry (there shouldn't be
- * any, but C is fun!
- */
-@@ -1381,22 +1383,27 @@ static ssize_t aio_fsync(struct kiocb *iocb)
+@@ -1454,22 +1454,27 @@ 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;
@@ -40615,14 +39591,14 @@ index e29ec48..f083e5e 100644
(struct compat_iovec __user *)kiocb->ki_buf,
- kiocb->ki_nbytes, 1, &kiocb->ki_inline_vec,
+ kiocb->ki_nbytes, 1, &iovstack,
- &kiocb->ki_iovec);
+ &kiocb->ki_iovec, 1);
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);
+ &kiocb->ki_iovec, 1);
if (ret < 0)
goto out;
@@ -40634,10 +39610,10 @@ index e29ec48..f083e5e 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 caf2aa5..bb3ef8c 100644
+index 7ee7ba4..0c61a60 100644
--- a/fs/attr.c
+++ b/fs/attr.c
-@@ -98,6 +98,7 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset)
+@@ -99,6 +99,7 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset)
unsigned long limit;
limit = rlimit(RLIMIT_FSIZE);
@@ -40646,7 +39622,7 @@ index caf2aa5..bb3ef8c 100644
goto out_sig;
if (offset > inode->i_sb->s_maxbytes)
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
-index 2543598..3707be9 100644
+index e1fbdee..cd5ea56 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -60,7 +60,7 @@ static int autofs4_write(struct file *file, const void *addr, int bytes)
@@ -40659,7 +39635,7 @@ index 2543598..3707be9 100644
/** WARNING: this is not safe for writing more than PIPE_BUF bytes! **/
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
-index 720d885..012e7f0 100644
+index 8342ca6..82fd192 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -503,7 +503,7 @@ static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
@@ -40752,10 +39728,18 @@ index a6395bd..a5b24c4 100644
fd_offset + ex.a_text);
up_write(&current->mm->mmap_sem);
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
-index 9ba2ac7..4c69f25 100644
+index 21ac5ee..c1090ea 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
-@@ -51,6 +51,10 @@ static int elf_core_dump(struct coredump_params *cprm);
+@@ -32,6 +32,7 @@
+ #include <linux/elf.h>
+ #include <linux/utsname.h>
+ #include <linux/coredump.h>
++#include <linux/xattr.h>
+ #include <asm/uaccess.h>
+ #include <asm/param.h>
+ #include <asm/page.h>
+@@ -51,6 +52,10 @@ static int elf_core_dump(struct coredump_params *cprm);
#define elf_core_dump NULL
#endif
@@ -40766,7 +39750,7 @@ index 9ba2ac7..4c69f25 100644
#if ELF_EXEC_PAGESIZE > PAGE_SIZE
#define ELF_MIN_ALIGN ELF_EXEC_PAGESIZE
#else
-@@ -70,6 +74,11 @@ static struct linux_binfmt elf_format = {
+@@ -70,6 +75,11 @@ static struct linux_binfmt elf_format = {
.load_binary = load_elf_binary,
.load_shlib = load_elf_library,
.core_dump = elf_core_dump,
@@ -40778,7 +39762,7 @@ index 9ba2ac7..4c69f25 100644
.min_coredump = ELF_EXEC_PAGESIZE,
};
-@@ -77,6 +86,8 @@ static struct linux_binfmt elf_format = {
+@@ -77,6 +87,8 @@ static struct linux_binfmt elf_format = {
static int set_brk(unsigned long start, unsigned long end)
{
@@ -40787,7 +39771,7 @@ index 9ba2ac7..4c69f25 100644
start = ELF_PAGEALIGN(start);
end = ELF_PAGEALIGN(end);
if (end > start) {
-@@ -87,7 +98,7 @@ static int set_brk(unsigned long start, unsigned long end)
+@@ -87,7 +99,7 @@ static int set_brk(unsigned long start, unsigned long end)
if (BAD_ADDR(addr))
return addr;
}
@@ -40796,7 +39780,7 @@ index 9ba2ac7..4c69f25 100644
return 0;
}
-@@ -148,12 +159,15 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
+@@ -148,12 +160,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;
@@ -40808,12 +39792,10 @@ index 9ba2ac7..4c69f25 100644
const struct cred *cred = current_cred();
struct vm_area_struct *vma;
+ unsigned long saved_auxv[AT_VECTOR_SIZE];
-+
-+ pax_track_stack();
/*
* In some cases (e.g. Hyper-Threading), we want to avoid L1
-@@ -195,8 +209,12 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
+@@ -195,8 +208,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));
@@ -40828,7 +39810,7 @@ index 9ba2ac7..4c69f25 100644
if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes)))
return -EFAULT;
-@@ -308,9 +326,11 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
+@@ -308,9 +325,11 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
return -EFAULT;
current->mm->env_end = p;
@@ -40841,7 +39823,7 @@ index 9ba2ac7..4c69f25 100644
return -EFAULT;
return 0;
}
-@@ -381,10 +401,10 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
+@@ -381,10 +400,10 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
{
struct elf_phdr *elf_phdata;
struct elf_phdr *eppnt;
@@ -40854,7 +39836,7 @@ index 9ba2ac7..4c69f25 100644
unsigned long total_size;
int retval, i, size;
-@@ -430,6 +450,11 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
+@@ -430,6 +449,11 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
goto out_close;
}
@@ -40866,7 +39848,7 @@ index 9ba2ac7..4c69f25 100644
eppnt = elf_phdata;
for (i = 0; i < interp_elf_ex->e_phnum; i++, eppnt++) {
if (eppnt->p_type == PT_LOAD) {
-@@ -473,8 +498,8 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
+@@ -473,8 +497,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 ||
@@ -40877,15 +39859,16 @@ index 9ba2ac7..4c69f25 100644
error = -ENOMEM;
goto out_close;
}
-@@ -528,6 +553,193 @@ out:
+@@ -528,6 +552,348 @@ out:
return error;
}
-+#if (defined(CONFIG_PAX_EI_PAX) || defined(CONFIG_PAX_PT_PAX_FLAGS)) && defined(CONFIG_PAX_SOFTMODE)
-+static unsigned long pax_parse_softmode(const struct elf_phdr * const elf_phdata)
++static unsigned long pax_parse_pt_pax_softmode(const struct elf_phdr * const elf_phdata)
+{
+ unsigned long pax_flags = 0UL;
+
++#ifdef CONFIG_PAX_PT_PAX_FLAGS
++
+#ifdef CONFIG_PAX_PAGEEXEC
+ if (elf_phdata->p_flags & PF_PAGEEXEC)
+ pax_flags |= MF_PAX_PAGEEXEC;
@@ -40920,15 +39903,17 @@ index 9ba2ac7..4c69f25 100644
+ pax_flags |= MF_PAX_RANDMMAP;
+#endif
+
++#endif
++
+ return pax_flags;
+}
-+#endif
+
-+#ifdef CONFIG_PAX_PT_PAX_FLAGS
-+static unsigned long pax_parse_hardmode(const struct elf_phdr * const elf_phdata)
++static unsigned long pax_parse_pt_pax_hardmode(const struct elf_phdr * const elf_phdata)
+{
+ unsigned long pax_flags = 0UL;
+
++#ifdef CONFIG_PAX_PT_PAX_FLAGS
++
+#ifdef CONFIG_PAX_PAGEEXEC
+ if (!(elf_phdata->p_flags & PF_NOPAGEEXEC))
+ pax_flags |= MF_PAX_PAGEEXEC;
@@ -40963,15 +39948,17 @@ index 9ba2ac7..4c69f25 100644
+ pax_flags |= MF_PAX_RANDMMAP;
+#endif
+
++#endif
++
+ return pax_flags;
+}
-+#endif
+
-+#ifdef CONFIG_PAX_EI_PAX
+static unsigned long pax_parse_ei_pax(const struct elfhdr * const elf_ex)
+{
+ unsigned long pax_flags = 0UL;
+
++#ifdef CONFIG_PAX_EI_PAX
++
+#ifdef CONFIG_PAX_PAGEEXEC
+ if (!(elf_ex->e_ident[EI_PAX] & EF_PAX_PAGEEXEC))
+ pax_flags |= MF_PAX_PAGEEXEC;
@@ -41006,25 +39993,38 @@ index 9ba2ac7..4c69f25 100644
+ pax_flags |= MF_PAX_RANDMMAP;
+#endif
+
-+ return pax_flags;
-+}
++#else
++
++#ifdef CONFIG_PAX_PAGEEXEC
++ pax_flags |= MF_PAX_PAGEEXEC;
+#endif
+
-+#if defined(CONFIG_PAX_EI_PAX) || defined(CONFIG_PAX_PT_PAX_FLAGS)
-+static long pax_parse_elf_flags(const struct elfhdr * const elf_ex, const struct elf_phdr * const elf_phdata)
-+{
-+ unsigned long pax_flags = 0UL;
++#ifdef CONFIG_PAX_MPROTECT
++ pax_flags |= MF_PAX_MPROTECT;
++#endif
+
-+#ifdef CONFIG_PAX_PT_PAX_FLAGS
-+ unsigned long i;
-+ int found_flags = 0;
++#ifdef CONFIG_PAX_RANDMMAP
++ pax_flags |= MF_PAX_RANDMMAP;
++#endif
++
++#ifdef CONFIG_PAX_SEGMEXEC
++ if (!(__supported_pte_mask & _PAGE_NX)) {
++ pax_flags &= ~MF_PAX_PAGEEXEC;
++ pax_flags |= MF_PAX_SEGMEXEC;
++ }
+#endif
+
-+#ifdef CONFIG_PAX_EI_PAX
-+ pax_flags = pax_parse_ei_pax(elf_ex);
+#endif
+
++ return pax_flags;
++}
++
++static unsigned long pax_parse_pt_pax(const struct elfhdr * const elf_ex, const struct elf_phdr * const elf_phdata)
++{
++
+#ifdef CONFIG_PAX_PT_PAX_FLAGS
++ unsigned long i;
++
+ for (i = 0UL; i < elf_ex->e_phnum; i++)
+ if (elf_phdata[i].p_type == PT_PAX_FLAGS) {
+ if (((elf_phdata[i].p_flags & PF_PAGEEXEC) && (elf_phdata[i].p_flags & PF_NOPAGEEXEC)) ||
@@ -41032,34 +40032,171 @@ index 9ba2ac7..4c69f25 100644
+ ((elf_phdata[i].p_flags & PF_EMUTRAMP) && (elf_phdata[i].p_flags & PF_NOEMUTRAMP)) ||
+ ((elf_phdata[i].p_flags & PF_MPROTECT) && (elf_phdata[i].p_flags & PF_NOMPROTECT)) ||
+ ((elf_phdata[i].p_flags & PF_RANDMMAP) && (elf_phdata[i].p_flags & PF_NORANDMMAP)))
-+ return -EINVAL;
++ return ~0UL;
+
+#ifdef CONFIG_PAX_SOFTMODE
+ if (pax_softmode)
-+ pax_flags = pax_parse_softmode(&elf_phdata[i]);
++ return pax_parse_pt_pax_softmode(&elf_phdata[i]);
+ else
+#endif
+
-+ pax_flags = pax_parse_hardmode(&elf_phdata[i]);
-+ found_flags = 1;
++ return pax_parse_pt_pax_hardmode(&elf_phdata[i]);
+ break;
+ }
+#endif
+
-+#if !defined(CONFIG_PAX_EI_PAX) && defined(CONFIG_PAX_PT_PAX_FLAGS)
-+ if (found_flags == 0) {
-+ struct elf_phdr phdr;
-+ memset(&phdr, 0, sizeof(phdr));
-+ phdr.p_flags = PF_NOEMUTRAMP;
-+#ifdef CONFIG_PAX_SOFTMODE
-+ if (pax_softmode)
-+ pax_flags = pax_parse_softmode(&phdr);
++ return ~0UL;
++}
++
++static unsigned long pax_parse_xattr_pax_softmode(unsigned long pax_flags_softmode)
++{
++ unsigned long pax_flags = 0UL;
++
++#ifdef CONFIG_PAX_PAGEEXEC
++ if (pax_flags_softmode & MF_PAX_PAGEEXEC)
++ pax_flags |= MF_PAX_PAGEEXEC;
++#endif
++
++#ifdef CONFIG_PAX_SEGMEXEC
++ if (pax_flags_softmode & MF_PAX_SEGMEXEC)
++ pax_flags |= MF_PAX_SEGMEXEC;
++#endif
++
++#if defined(CONFIG_PAX_PAGEEXEC) && defined(CONFIG_PAX_SEGMEXEC)
++ if ((pax_flags & (MF_PAX_PAGEEXEC | MF_PAX_SEGMEXEC)) == (MF_PAX_PAGEEXEC | MF_PAX_SEGMEXEC)) {
++ if ((__supported_pte_mask & _PAGE_NX))
++ pax_flags &= ~MF_PAX_SEGMEXEC;
+ else
++ pax_flags &= ~MF_PAX_PAGEEXEC;
++ }
++#endif
++
++#ifdef CONFIG_PAX_EMUTRAMP
++ if (pax_flags_softmode & MF_PAX_EMUTRAMP)
++ pax_flags |= MF_PAX_EMUTRAMP;
+#endif
-+ pax_flags = pax_parse_hardmode(&phdr);
++
++#ifdef CONFIG_PAX_MPROTECT
++ if (pax_flags_softmode & MF_PAX_MPROTECT)
++ pax_flags |= MF_PAX_MPROTECT;
++#endif
++
++#if defined(CONFIG_PAX_RANDMMAP) || defined(CONFIG_PAX_RANDUSTACK)
++ if (randomize_va_space && (pax_flags_softmode & MF_PAX_RANDMMAP))
++ pax_flags |= MF_PAX_RANDMMAP;
++#endif
++
++ return pax_flags;
++}
++
++static unsigned long pax_parse_xattr_pax_hardmode(unsigned long pax_flags_hardmode)
++{
++ unsigned long pax_flags = 0UL;
++
++#ifdef CONFIG_PAX_PAGEEXEC
++ if (!(pax_flags_hardmode & MF_PAX_PAGEEXEC))
++ pax_flags |= MF_PAX_PAGEEXEC;
++#endif
++
++#ifdef CONFIG_PAX_SEGMEXEC
++ if (!(pax_flags_hardmode & MF_PAX_SEGMEXEC))
++ pax_flags |= MF_PAX_SEGMEXEC;
++#endif
++
++#if defined(CONFIG_PAX_PAGEEXEC) && defined(CONFIG_PAX_SEGMEXEC)
++ if ((pax_flags & (MF_PAX_PAGEEXEC | MF_PAX_SEGMEXEC)) == (MF_PAX_PAGEEXEC | MF_PAX_SEGMEXEC)) {
++ if ((__supported_pte_mask & _PAGE_NX))
++ pax_flags &= ~MF_PAX_SEGMEXEC;
++ else
++ pax_flags &= ~MF_PAX_PAGEEXEC;
+ }
+#endif
+
++#ifdef CONFIG_PAX_EMUTRAMP
++ if (!(pax_flags_hardmode & MF_PAX_EMUTRAMP))
++ pax_flags |= MF_PAX_EMUTRAMP;
++#endif
++
++#ifdef CONFIG_PAX_MPROTECT
++ if (!(pax_flags_hardmode & MF_PAX_MPROTECT))
++ pax_flags |= MF_PAX_MPROTECT;
++#endif
++
++#if defined(CONFIG_PAX_RANDMMAP) || defined(CONFIG_PAX_RANDUSTACK)
++ if (randomize_va_space && !(pax_flags_hardmode & MF_PAX_RANDMMAP))
++ pax_flags |= MF_PAX_RANDMMAP;
++#endif
++
++ return pax_flags;
++}
++
++static unsigned long pax_parse_xattr_pax(struct file * const file)
++{
++
++#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
++ ssize_t xattr_size, i;
++ unsigned char xattr_value[5];
++ 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)
++ return ~0UL;
++
++ for (i = 0; i < xattr_size; i++)
++ switch (xattr_value[i]) {
++ default:
++ return ~0UL;
++
++#define parse_flag(option1, option2, flag) \
++ case option1: \
++ pax_flags_hardmode |= MF_PAX_##flag; \
++ break; \
++ case option2: \
++ pax_flags_softmode |= MF_PAX_##flag; \
++ break;
++
++ parse_flag('p', 'P', PAGEEXEC);
++ parse_flag('e', 'E', EMUTRAMP);
++ parse_flag('m', 'M', MPROTECT);
++ parse_flag('r', 'R', RANDMMAP);
++ parse_flag('s', 'S', SEGMEXEC);
++
++#undef parse_flag
++ }
++
++ if (pax_flags_hardmode & pax_flags_softmode)
++ return ~0UL;
++
++#ifdef CONFIG_PAX_SOFTMODE
++ if (pax_softmode)
++ return pax_parse_xattr_pax_softmode(pax_flags_softmode);
++ else
++#endif
++
++ return pax_parse_xattr_pax_hardmode(pax_flags_hardmode);
++#else
++ return ~0UL;
++#endif
++}
++
++#if defined(CONFIG_PAX_EI_PAX) || defined(CONFIG_PAX_PT_PAX_FLAGS) || defined(CONFIG_PAX_XATTR_PAX_FLAGS)
++static long pax_parse_pax_flags(const struct elfhdr * const elf_ex, const struct elf_phdr * const elf_phdata, struct file * const file)
++{
++ unsigned long pax_flags, pt_pax_flags, xattr_pax_flags;
++
++ pax_flags = pax_parse_ei_pax(elf_ex);
++ pt_pax_flags = pax_parse_pt_pax(elf_ex, elf_phdata);
++ xattr_pax_flags = pax_parse_xattr_pax(file);
++
++ if (pt_pax_flags == ~0UL)
++ pt_pax_flags = xattr_pax_flags;
++ else if (xattr_pax_flags == ~0UL)
++ xattr_pax_flags = pt_pax_flags;
++ if (pt_pax_flags != xattr_pax_flags)
++ return -EINVAL;
++ if (pt_pax_flags != ~0UL)
++ pax_flags = pt_pax_flags;
++
+ if (0 > pax_check_flags(&pax_flags))
+ return -EINVAL;
+
@@ -41071,7 +40208,7 @@ index 9ba2ac7..4c69f25 100644
/*
* These are the functions used to load ELF style executables and shared
* libraries. There is no binary dependent code anywhere else.
-@@ -544,6 +756,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
+@@ -544,6 +910,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
{
unsigned int random_variable = 0;
@@ -41083,7 +40220,7 @@ index 9ba2ac7..4c69f25 100644
if ((current->flags & PF_RANDOMIZE) &&
!(current->personality & ADDR_NO_RANDOMIZE)) {
random_variable = get_random_int() & STACK_RND_MASK;
-@@ -562,7 +779,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -562,7 +933,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
unsigned long load_addr = 0, load_bias = 0;
int load_addr_set = 0;
char * elf_interpreter = NULL;
@@ -41092,7 +40229,7 @@ index 9ba2ac7..4c69f25 100644
struct elf_phdr *elf_ppnt, *elf_phdata;
unsigned long elf_bss, elf_brk;
int retval, i;
-@@ -572,11 +789,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -572,11 +943,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
unsigned long start_code, end_code, start_data, end_data;
unsigned long reloc_func_desc __maybe_unused = 0;
int executable_stack = EXSTACK_DEFAULT;
@@ -41105,7 +40242,7 @@ index 9ba2ac7..4c69f25 100644
loc = kmalloc(sizeof(*loc), GFP_KERNEL);
if (!loc) {
-@@ -714,11 +931,81 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -713,11 +1084,81 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
/* OK, This is the point of no return */
current->flags &= ~PF_FORKNOEXEC;
@@ -41130,8 +40267,8 @@ index 9ba2ac7..4c69f25 100644
+
+ current->mm->def_flags = 0;
+
-+#if defined(CONFIG_PAX_EI_PAX) || defined(CONFIG_PAX_PT_PAX_FLAGS)
-+ if (0 > pax_parse_elf_flags(&loc->elf_ex, elf_phdata)) {
++#if defined(CONFIG_PAX_EI_PAX) || defined(CONFIG_PAX_PT_PAX_FLAGS) || defined(CONFIG_PAX_XATTR_PAX_FLAGS)
++ if (0 > pax_parse_pax_flags(&loc->elf_ex, elf_phdata, bprm->file)) {
+ send_sig(SIGKILL, current, 0);
+ goto out_free_dentry;
+ }
@@ -41188,7 +40325,7 @@ index 9ba2ac7..4c69f25 100644
if (elf_read_implies_exec(loc->elf_ex, executable_stack))
current->personality |= READ_IMPLIES_EXEC;
-@@ -809,6 +1096,20 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -808,6 +1249,20 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
#else
load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
#endif
@@ -41209,7 +40346,7 @@ index 9ba2ac7..4c69f25 100644
}
error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,
-@@ -841,9 +1142,9 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -840,9 +1295,9 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
* allowed task size. Note that p_filesz must always be
* <= p_memsz so it is only necessary to check p_memsz.
*/
@@ -41222,7 +40359,7 @@ index 9ba2ac7..4c69f25 100644
/* set_brk can never work. Avoid overflows. */
send_sig(SIGKILL, current, 0);
retval = -EINVAL;
-@@ -871,6 +1172,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -870,6 +1325,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
start_data += load_bias;
end_data += load_bias;
@@ -41234,7 +40371,7 @@ index 9ba2ac7..4c69f25 100644
/* Calling set_brk effectively mmaps the pages that we need
* for the bss and break sections. We must do this before
* mapping in the interpreter, to make sure it doesn't wind
-@@ -882,9 +1188,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -881,9 +1341,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
goto out_free_dentry;
}
if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) {
@@ -41249,7 +40386,7 @@ index 9ba2ac7..4c69f25 100644
}
if (elf_interpreter) {
-@@ -1099,7 +1407,7 @@ out:
+@@ -1098,7 +1560,7 @@ out:
* Decide what to dump of a segment, part, all or none.
*/
static unsigned long vma_dump_size(struct vm_area_struct *vma,
@@ -41258,7 +40395,7 @@ index 9ba2ac7..4c69f25 100644
{
#define FILTER(type) (mm_flags & (1UL << MMF_DUMP_##type))
-@@ -1133,7 +1441,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
+@@ -1132,7 +1594,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
if (vma->vm_file == NULL)
return 0;
@@ -41267,7 +40404,7 @@ index 9ba2ac7..4c69f25 100644
goto whole;
/*
-@@ -1355,9 +1663,9 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm)
+@@ -1354,9 +1816,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;
@@ -41279,7 +40416,7 @@ index 9ba2ac7..4c69f25 100644
fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv);
}
-@@ -1863,14 +2171,14 @@ static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum,
+@@ -1862,14 +2324,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,
@@ -41296,7 +40433,7 @@ index 9ba2ac7..4c69f25 100644
return size;
}
-@@ -1964,7 +2272,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -1963,7 +2425,7 @@ static int elf_core_dump(struct coredump_params *cprm)
dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
@@ -41305,7 +40442,7 @@ index 9ba2ac7..4c69f25 100644
offset += elf_core_extra_data_size();
e_shoff = offset;
-@@ -1978,10 +2286,12 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -1977,10 +2439,12 @@ static int elf_core_dump(struct coredump_params *cprm)
offset = dataoff;
size += sizeof(*elf);
@@ -41318,7 +40455,7 @@ index 9ba2ac7..4c69f25 100644
if (size > cprm->limit
|| !dump_write(cprm->file, phdr4note, sizeof(*phdr4note)))
goto end_coredump;
-@@ -1995,7 +2305,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -1994,7 +2458,7 @@ static int elf_core_dump(struct coredump_params *cprm)
phdr.p_offset = offset;
phdr.p_vaddr = vma->vm_start;
phdr.p_paddr = 0;
@@ -41327,7 +40464,7 @@ index 9ba2ac7..4c69f25 100644
phdr.p_memsz = vma->vm_end - vma->vm_start;
offset += phdr.p_filesz;
phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0;
-@@ -2006,6 +2316,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2005,6 +2469,7 @@ static int elf_core_dump(struct coredump_params *cprm)
phdr.p_align = ELF_EXEC_PAGESIZE;
size += sizeof(phdr);
@@ -41335,7 +40472,7 @@ index 9ba2ac7..4c69f25 100644
if (size > cprm->limit
|| !dump_write(cprm->file, &phdr, sizeof(phdr)))
goto end_coredump;
-@@ -2030,7 +2341,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2029,7 +2494,7 @@ static int elf_core_dump(struct coredump_params *cprm)
unsigned long addr;
unsigned long end;
@@ -41344,7 +40481,7 @@ index 9ba2ac7..4c69f25 100644
for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) {
struct page *page;
-@@ -2039,6 +2350,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2038,6 +2503,7 @@ static int elf_core_dump(struct coredump_params *cprm)
page = get_dump_page(addr);
if (page) {
void *kaddr = kmap(page);
@@ -41352,7 +40489,7 @@ index 9ba2ac7..4c69f25 100644
stop = ((size += PAGE_SIZE) > cprm->limit) ||
!dump_write(cprm->file, kaddr,
PAGE_SIZE);
-@@ -2056,6 +2368,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2055,6 +2521,7 @@ static int elf_core_dump(struct coredump_params *cprm)
if (e_phnum == PN_XNUM) {
size += sizeof(*shdr4extnum);
@@ -41360,7 +40497,7 @@ index 9ba2ac7..4c69f25 100644
if (size > cprm->limit
|| !dump_write(cprm->file, shdr4extnum,
sizeof(*shdr4extnum)))
-@@ -2076,6 +2389,97 @@ out:
+@@ -2075,6 +2542,97 @@ out:
#endif /* CONFIG_ELF_CORE */
@@ -41495,7 +40632,7 @@ index 1bffbe0..c8c283e 100644
goto err;
}
diff --git a/fs/bio.c b/fs/bio.c
-index 9bfade8..782f3b9 100644
+index b1fe82c..84da0a9 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1233,7 +1233,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err)
@@ -41508,10 +40645,10 @@ index 9bfade8..782f3b9 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 34503ba..183ea30 100644
+index b07f1da..9efcb92 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
-@@ -671,7 +671,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole,
+@@ -681,7 +681,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 */
@@ -41521,10 +40658,10 @@ index 34503ba..183ea30 100644
else if (whole->bd_holder != NULL)
return false; /* is a partition of a held device */
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
-index 2e66786..528df52 100644
+index dede441..f2a2507 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
-@@ -454,9 +454,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
+@@ -488,9 +488,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
free_extent_buffer(buf);
add_root_to_dirty_list(root);
} else {
@@ -41541,10 +40678,10 @@ index 2e66786..528df52 100644
WARN_ON(trans->transid != btrfs_header_generation(parent));
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
-index d42e6bf..13fc60e 100644
+index fd1a06d..6e9033d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
-@@ -6896,7 +6896,7 @@ fail:
+@@ -6895,7 +6895,7 @@ fail:
return -ENOMEM;
}
@@ -41553,7 +40690,7 @@ index d42e6bf..13fc60e 100644
struct dentry *dentry, struct kstat *stat)
{
struct inode *inode = dentry->d_inode;
-@@ -6908,6 +6908,14 @@ static int btrfs_getattr(struct vfsmount *mnt,
+@@ -6909,6 +6909,14 @@ static int btrfs_getattr(struct vfsmount *mnt,
return 0;
}
@@ -41561,7 +40698,7 @@ index d42e6bf..13fc60e 100644
+
+dev_t get_btrfs_dev_from_inode(struct inode *inode)
+{
-+ return BTRFS_I(inode)->root->anon_super.s_dev;
++ return BTRFS_I(inode)->root->anon_dev;
+}
+EXPORT_SYMBOL(get_btrfs_dev_from_inode);
+
@@ -41569,10 +40706,10 @@ index d42e6bf..13fc60e 100644
* 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 a3c4751..62d648b 100644
+index c04f02c..f5c9e2e 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
-@@ -2676,9 +2676,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
+@@ -2733,9 +2733,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;
@@ -41585,7 +40722,7 @@ index a3c4751..62d648b 100644
info = NULL;
rcu_read_lock();
list_for_each_entry_rcu(tmp, &root->fs_info->space_info,
-@@ -2700,15 +2703,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
+@@ -2757,15 +2760,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
memcpy(dest, &space, sizeof(space));
dest++;
space_args.total_spaces++;
@@ -41603,10 +40740,10 @@ index a3c4751..62d648b 100644
if (copy_to_user(user_dest, dest_orig, alloc_size))
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
-index 5e0a3dc..65b3c8f 100644
+index cfb5543..1ae7347 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
-@@ -1242,7 +1242,7 @@ static int __update_reloc_root(struct btrfs_root *root, int del)
+@@ -1244,7 +1244,7 @@ static int __update_reloc_root(struct btrfs_root *root, int del)
}
spin_unlock(&rc->reloc_root_tree.lock);
@@ -41616,7 +40753,7 @@ index 5e0a3dc..65b3c8f 100644
if (!del) {
spin_lock(&rc->reloc_root_tree.lock);
diff --git a/fs/cachefiles/bind.c b/fs/cachefiles/bind.c
-index a2603e7..4c28e75 100644
+index 622f469..e8d2d55 100644
--- a/fs/cachefiles/bind.c
+++ b/fs/cachefiles/bind.c
@@ -39,13 +39,11 @@ int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args)
@@ -41770,10 +40907,10 @@ index 0e3c092..818480e 100644
kunmap(page);
if (ret != len)
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
-index ef8f08c..143819d 100644
+index 9895400..fa40a7d 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
-@@ -226,7 +226,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
+@@ -244,7 +244,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);
@@ -41783,7 +40920,7 @@ index ef8f08c..143819d 100644
u32 ftype;
struct ceph_mds_reply_info_parsed *rinfo;
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
-index 2fe3cf1..6b1cf93 100644
+index 84e8c07..6170d31 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,
@@ -41916,10 +41053,10 @@ index 2fe3cf1..6b1cf93 100644
}
}
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
-index 53e7d72..aebb461 100644
+index 8f1fe32..38f9e27 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
-@@ -996,7 +996,7 @@ cifs_init_request_bufs(void)
+@@ -989,7 +989,7 @@ cifs_init_request_bufs(void)
cifs_req_cachep = kmem_cache_create("cifs_request",
CIFSMaxBufSize +
MAX_CIFS_HDR_SIZE, 0,
@@ -41928,7 +41065,7 @@ index 53e7d72..aebb461 100644
if (cifs_req_cachep == NULL)
return -ENOMEM;
-@@ -1023,7 +1023,7 @@ cifs_init_request_bufs(void)
+@@ -1016,7 +1016,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",
@@ -41937,7 +41074,7 @@ index 53e7d72..aebb461 100644
NULL);
if (cifs_sm_req_cachep == NULL) {
mempool_destroy(cifs_req_poolp);
-@@ -1108,8 +1108,8 @@ init_cifs(void)
+@@ -1101,8 +1101,8 @@ init_cifs(void)
atomic_set(&bufAllocCount, 0);
atomic_set(&smBufAllocCount, 0);
#ifdef CONFIG_CIFS_STATS2
@@ -41949,10 +41086,10 @@ index 53e7d72..aebb461 100644
atomic_set(&midCount, 0);
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
-index 6255fa8..9473e98 100644
+index 8238aa1..0347196 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
-@@ -381,28 +381,28 @@ struct cifs_tcon {
+@@ -392,28 +392,28 @@ struct cifs_tcon {
__u16 Flags; /* optional support bits */
enum statusEnum tidStatus;
#ifdef CONFIG_CIFS_STATS
@@ -42003,7 +41140,7 @@ index 6255fa8..9473e98 100644
#ifdef CONFIG_CIFS_STATS2
unsigned long long time_writes;
unsigned long long time_reads;
-@@ -613,7 +613,7 @@ convert_delimiter(char *path, char delim)
+@@ -628,7 +628,7 @@ convert_delimiter(char *path, char delim)
}
#ifdef CONFIG_CIFS_STATS
@@ -42012,7 +41149,7 @@ index 6255fa8..9473e98 100644
static inline void cifs_stats_bytes_written(struct cifs_tcon *tcon,
unsigned int bytes)
-@@ -911,8 +911,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
+@@ -985,8 +985,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
/* Various Debug counters */
GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */
#ifdef CONFIG_CIFS_STATS2
@@ -42024,10 +41161,10 @@ index 6255fa8..9473e98 100644
GLOBAL_EXTERN atomic_t smBufAllocCount;
GLOBAL_EXTERN atomic_t midCount;
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
-index 556b1a0..f449af5 100644
+index 6b0e064..94e6c3c 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
-@@ -587,7 +587,7 @@ symlink_exit:
+@@ -600,7 +600,7 @@ symlink_exit:
void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie)
{
@@ -42037,7 +41174,7 @@ index 556b1a0..f449af5 100644
kfree(p);
}
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
-index 03a1f49..43bfa57 100644
+index 703ef5c..2a44ed5 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -156,7 +156,7 @@ cifs_buf_get(void)
@@ -42107,10 +41244,10 @@ index 6901578..d402eb5 100644
return hit;
diff --git a/fs/compat.c b/fs/compat.c
-index 0ea0083..e831a79 100644
+index c987875..08771ca 100644
--- a/fs/compat.c
+++ b/fs/compat.c
-@@ -133,8 +133,8 @@ asmlinkage long compat_sys_utimes(const char __user *filename, struct compat_tim
+@@ -132,8 +132,8 @@ asmlinkage long compat_sys_utimes(const char __user *filename, struct compat_tim
static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
{
compat_ino_t ino = stat->ino;
@@ -42121,7 +41258,7 @@ index 0ea0083..e831a79 100644
int err;
SET_UID(uid, stat->uid);
-@@ -508,7 +508,7 @@ compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
+@@ -504,7 +504,7 @@ compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
set_fs(KERNEL_DS);
/* The __user pointer cast is valid because of the set_fs() */
@@ -42130,7 +41267,7 @@ index 0ea0083..e831a79 100644
set_fs(oldfs);
/* truncating is ok because it's a user address */
if (!ret)
-@@ -566,7 +566,7 @@ ssize_t compat_rw_copy_check_uvector(int type,
+@@ -562,7 +562,7 @@ ssize_t compat_rw_copy_check_uvector(int type,
goto out;
ret = -EINVAL;
@@ -42139,7 +41276,7 @@ index 0ea0083..e831a79 100644
goto out;
if (nr_segs > fast_segs) {
ret = -ENOMEM;
-@@ -848,6 +848,7 @@ struct compat_old_linux_dirent {
+@@ -845,6 +845,7 @@ struct compat_old_linux_dirent {
struct compat_readdir_callback {
struct compat_old_linux_dirent __user *dirent;
@@ -42147,7 +41284,7 @@ index 0ea0083..e831a79 100644
int result;
};
-@@ -865,6 +866,10 @@ static int compat_fillonedir(void *__buf, const char *name, int namlen,
+@@ -862,6 +863,10 @@ static int compat_fillonedir(void *__buf, const char *name, int namlen,
buf->result = -EOVERFLOW;
return -EOVERFLOW;
}
@@ -42158,7 +41295,7 @@ index 0ea0083..e831a79 100644
buf->result++;
dirent = buf->dirent;
if (!access_ok(VERIFY_WRITE, dirent,
-@@ -897,6 +902,7 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd,
+@@ -894,6 +899,7 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd,
buf.result = 0;
buf.dirent = dirent;
@@ -42166,7 +41303,7 @@ index 0ea0083..e831a79 100644
error = vfs_readdir(file, compat_fillonedir, &buf);
if (buf.result)
-@@ -917,6 +923,7 @@ struct compat_linux_dirent {
+@@ -914,6 +920,7 @@ struct compat_linux_dirent {
struct compat_getdents_callback {
struct compat_linux_dirent __user *current_dir;
struct compat_linux_dirent __user *previous;
@@ -42174,7 +41311,7 @@ index 0ea0083..e831a79 100644
int count;
int error;
};
-@@ -938,6 +945,10 @@ static int compat_filldir(void *__buf, const char *name, int namlen,
+@@ -935,6 +942,10 @@ static int compat_filldir(void *__buf, const char *name, int namlen,
buf->error = -EOVERFLOW;
return -EOVERFLOW;
}
@@ -42185,7 +41322,7 @@ index 0ea0083..e831a79 100644
dirent = buf->previous;
if (dirent) {
if (__put_user(offset, &dirent->d_off))
-@@ -985,6 +996,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
+@@ -982,6 +993,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
buf.previous = NULL;
buf.count = count;
buf.error = 0;
@@ -42193,7 +41330,7 @@ index 0ea0083..e831a79 100644
error = vfs_readdir(file, compat_filldir, &buf);
if (error >= 0)
-@@ -1006,6 +1018,7 @@ out:
+@@ -1003,6 +1015,7 @@ out:
struct compat_getdents_callback64 {
struct linux_dirent64 __user *current_dir;
struct linux_dirent64 __user *previous;
@@ -42201,7 +41338,7 @@ index 0ea0083..e831a79 100644
int count;
int error;
};
-@@ -1022,6 +1035,10 @@ static int compat_filldir64(void * __buf, const char * name, int namlen, loff_t
+@@ -1019,6 +1032,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;
@@ -42212,7 +41349,7 @@ index 0ea0083..e831a79 100644
dirent = buf->previous;
if (dirent) {
-@@ -1073,13 +1090,14 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
+@@ -1070,13 +1087,14 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
buf.previous = NULL;
buf.count = count;
buf.error = 0;
@@ -42228,24 +41365,6 @@ index 0ea0083..e831a79 100644
if (__put_user_unaligned(d_off, &lastdirent->d_off))
error = -EFAULT;
else
-@@ -1446,6 +1464,8 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp,
- struct fdtable *fdt;
- long stack_fds[SELECT_STACK_ALLOC/sizeof(long)];
-
-+ pax_track_stack();
-+
- if (n < 0)
- goto out_nofds;
-
-@@ -1904,7 +1924,7 @@ asmlinkage long compat_sys_nfsservctl(int cmd,
- oldfs = get_fs();
- set_fs(KERNEL_DS);
- /* The __user pointer casts are valid because of the set_fs() */
-- err = sys_nfsservctl(cmd, (void __user *) karg, (void __user *) kres);
-+ err = sys_nfsservctl(cmd, (void __force_user *) karg, (void __force_user *) kres);
- set_fs(oldfs);
-
- if (err)
diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c
index 112e45a..b59845b 100644
--- a/fs/compat_binfmt_elf.c
@@ -42265,10 +41384,10 @@ index 112e45a..b59845b 100644
/*
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
-index 61abb63..8db5637 100644
+index 51352de..93292ff 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
-@@ -208,6 +208,8 @@ static int do_video_set_spu_palette(unsigned int fd, unsigned int cmd,
+@@ -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);
@@ -42277,7 +41396,7 @@ index 61abb63..8db5637 100644
up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
err = put_user(compat_ptr(palp), &up_native->palette);
-@@ -619,7 +621,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd,
+@@ -621,7 +623,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd,
return -EFAULT;
if (__get_user(udata, &ss32->iomem_base))
return -EFAULT;
@@ -42286,7 +41405,7 @@ index 61abb63..8db5637 100644
if (__get_user(ss.iomem_reg_shift, &ss32->iomem_reg_shift) ||
__get_user(ss.port_high, &ss32->port_high))
return -EFAULT;
-@@ -794,7 +796,7 @@ static int compat_ioctl_preallocate(struct file *file,
+@@ -796,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)) ||
@@ -42295,7 +41414,7 @@ index 61abb63..8db5637 100644
return -EFAULT;
return ioctl_preallocate(file, p);
-@@ -1638,8 +1640,8 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
+@@ -1644,8 +1646,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;
@@ -42335,10 +41454,10 @@ index 9a37a9b..35792b6 100644
/*
* We'll have a dentry and an inode for
diff --git a/fs/dcache.c b/fs/dcache.c
-index d2f8feb..f2a208a 100644
+index 89509b5..d33331b 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
-@@ -3106,7 +3106,7 @@ void __init vfs_caches_init(unsigned long mempages)
+@@ -3056,7 +3056,7 @@ void __init vfs_caches_init(unsigned long mempages)
mempages -= reserve;
names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0,
@@ -42348,10 +41467,10 @@ index d2f8feb..f2a208a 100644
dcache_init();
inode_init();
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
-index 4a4fad7..4969114 100644
+index 32f90a3..0be89e0 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
-@@ -704,7 +704,7 @@ static int ecryptfs_readlink_lower(struct dentry *dentry, char **buf,
+@@ -691,7 +691,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,
@@ -42360,7 +41479,7 @@ index 4a4fad7..4969114 100644
lower_bufsiz);
set_fs(old_fs);
if (rc < 0)
-@@ -750,7 +750,7 @@ static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+@@ -737,7 +737,7 @@ static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd)
}
old_fs = get_fs();
set_fs(get_ds());
@@ -42369,7 +41488,7 @@ index 4a4fad7..4969114 100644
set_fs(old_fs);
if (rc < 0) {
kfree(buf);
-@@ -765,7 +765,7 @@ out:
+@@ -752,7 +752,7 @@ out:
static void
ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr)
{
@@ -42414,10 +41533,10 @@ index 3745f7c..89cc7a3 100644
return rc;
}
diff --git a/fs/exec.c b/fs/exec.c
-index 044c13f..717b6af 100644
+index 3625464..8dcadcf 100644
--- a/fs/exec.c
+++ b/fs/exec.c
-@@ -55,12 +55,24 @@
+@@ -55,12 +55,28 @@
#include <linux/pipe_fs_i.h>
#include <linux/oom.h>
#include <linux/compat.h>
@@ -42434,6 +41553,10 @@ index 044c13f..717b6af 100644
#include <asm/tlb.h>
#include "internal.h"
++#ifndef CONFIG_PAX_HAVE_ACL_FLAGS
++void __weak pax_set_initial_flags(struct linux_binprm *bprm) {}
++#endif
++
+#ifdef CONFIG_PAX_HOOK_ACL_FLAGS
+void (*pax_set_initial_flags_func)(struct linux_binprm *bprm);
+EXPORT_SYMBOL(pax_set_initial_flags_func);
@@ -42442,7 +41565,7 @@ index 044c13f..717b6af 100644
int core_uses_pid;
char core_pattern[CORENAME_MAX_SIZE] = "core";
unsigned int core_pipe_limit;
-@@ -70,7 +82,7 @@ struct core_name {
+@@ -70,7 +86,7 @@ struct core_name {
char *corename;
int used, size;
};
@@ -42451,16 +41574,7 @@ index 044c13f..717b6af 100644
/* The maximal length of core_pattern is also specified in sysctl.c */
-@@ -116,7 +128,7 @@ SYSCALL_DEFINE1(uselib, const char __user *, library)
- char *tmp = getname(library);
- int error = PTR_ERR(tmp);
- static const struct open_flags uselib_flags = {
-- .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC,
-+ .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC | FMODE_GREXEC,
- .acc_mode = MAY_READ | MAY_EXEC | MAY_OPEN,
- .intent = LOOKUP_OPEN
- };
-@@ -195,18 +207,10 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
+@@ -188,18 +204,10 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
int write)
{
struct page *page;
@@ -42482,7 +41596,7 @@ index 044c13f..717b6af 100644
return NULL;
if (write) {
-@@ -281,6 +285,11 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
+@@ -274,6 +282,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;
@@ -42494,7 +41608,7 @@ index 044c13f..717b6af 100644
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
INIT_LIST_HEAD(&vma->anon_vma_chain);
-@@ -295,6 +304,12 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
+@@ -288,6 +301,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 *);
@@ -42507,7 +41621,7 @@ index 044c13f..717b6af 100644
return 0;
err:
up_write(&mm->mmap_sem);
-@@ -403,19 +418,7 @@ err:
+@@ -396,19 +415,7 @@ err:
return err;
}
@@ -42528,7 +41642,7 @@ index 044c13f..717b6af 100644
{
const char __user *native;
-@@ -424,14 +427,14 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr)
+@@ -417,14 +424,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))
@@ -42545,7 +41659,7 @@ index 044c13f..717b6af 100644
return native;
}
-@@ -450,7 +453,7 @@ static int count(struct user_arg_ptr argv, int max)
+@@ -443,7 +450,7 @@ static int count(struct user_arg_ptr argv, int max)
if (!p)
break;
@@ -42554,7 +41668,7 @@ index 044c13f..717b6af 100644
return -EFAULT;
if (i++ >= max)
-@@ -484,7 +487,7 @@ static int copy_strings(int argc, struct user_arg_ptr argv,
+@@ -477,7 +484,7 @@ static int copy_strings(int argc, struct user_arg_ptr argv,
ret = -EFAULT;
str = get_user_arg_ptr(argv, argc);
@@ -42563,7 +41677,7 @@ index 044c13f..717b6af 100644
goto out;
len = strnlen_user(str, MAX_ARG_STRLEN);
-@@ -566,7 +569,7 @@ int copy_strings_kernel(int argc, const char *const *__argv,
+@@ -559,7 +566,7 @@ int copy_strings_kernel(int argc, const char *const *__argv,
int r;
mm_segment_t oldfs = get_fs();
struct user_arg_ptr argv = {
@@ -42572,7 +41686,7 @@ index 044c13f..717b6af 100644
};
set_fs(KERNEL_DS);
-@@ -601,7 +604,8 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
+@@ -594,7 +601,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;
@@ -42582,7 +41696,7 @@ index 044c13f..717b6af 100644
/*
* ensure there are no vmas between where we want to go
-@@ -610,6 +614,10 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
+@@ -603,6 +611,10 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
if (vma != find_vma(mm, new_start))
return -EFAULT;
@@ -42593,7 +41707,7 @@ index 044c13f..717b6af 100644
/*
* cover the whole range: [new_start, old_end)
*/
-@@ -690,10 +698,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
+@@ -683,10 +695,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
stack_top = arch_align_stack(stack_top);
stack_top = PAGE_ALIGN(stack_top);
@@ -42604,7 +41718,7 @@ index 044c13f..717b6af 100644
stack_shift = vma->vm_end - stack_top;
bprm->p -= stack_shift;
-@@ -705,8 +709,28 @@ int setup_arg_pages(struct linux_binprm *bprm,
+@@ -698,8 +706,28 @@ int setup_arg_pages(struct linux_binprm *bprm,
bprm->exec -= stack_shift;
down_write(&mm->mmap_sem);
@@ -42633,7 +41747,7 @@ index 044c13f..717b6af 100644
/*
* Adjust stack execute permissions; explicitly enable for
* EXSTACK_ENABLE_X, disable for EXSTACK_DISABLE_X and leave alone
-@@ -725,13 +749,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
+@@ -718,13 +746,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
goto out_unlock;
BUG_ON(prev != vma);
@@ -42647,16 +41761,7 @@ index 044c13f..717b6af 100644
/* mprotect_fixup is overkill to remove the temporary stack flags */
vma->vm_flags &= ~VM_STACK_INCOMPLETE_SETUP;
-@@ -771,7 +788,7 @@ struct file *open_exec(const char *name)
- struct file *file;
- int err;
- static const struct open_flags open_exec_flags = {
-- .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC,
-+ .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC | FMODE_GREXEC,
- .acc_mode = MAY_EXEC | MAY_OPEN,
- .intent = LOOKUP_OPEN
- };
-@@ -812,7 +829,7 @@ int kernel_read(struct file *file, loff_t offset,
+@@ -805,7 +826,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() */
@@ -42665,7 +41770,7 @@ index 044c13f..717b6af 100644
set_fs(old_fs);
return result;
}
-@@ -1236,7 +1253,7 @@ int check_unsafe_exec(struct linux_binprm *bprm)
+@@ -1247,7 +1268,7 @@ int check_unsafe_exec(struct linux_binprm *bprm)
}
rcu_read_unlock();
@@ -42674,7 +41779,7 @@ index 044c13f..717b6af 100644
bprm->unsafe |= LSM_UNSAFE_SHARE;
} else {
res = -EAGAIN;
-@@ -1430,11 +1447,35 @@ static int do_execve_common(const char *filename,
+@@ -1450,6 +1471,11 @@ static int do_execve_common(const char *filename,
struct user_arg_ptr envp,
struct pt_regs *regs)
{
@@ -42686,31 +41791,16 @@ index 044c13f..717b6af 100644
struct linux_binprm *bprm;
struct file *file;
struct files_struct *displaced;
- bool clear_in_exec;
+@@ -1457,6 +1483,8 @@ static int do_execve_common(const char *filename,
int retval;
-+ const struct cred *cred = current_cred();
-+
+ const struct cred *cred = current_cred();
+
+ gr_learn_resource(current, RLIMIT_NPROC, atomic_read(&current->cred->user->processes), 1);
+
-+ /*
-+ * We move the actual failure in case of RLIMIT_NPROC excess from
-+ * set*uid() to execve() because too many poorly written programs
-+ * don't check setuid() return code. Here we additionally recheck
-+ * whether NPROC limit is still exceeded.
-+ */
-+ if ((current->flags & PF_NPROC_EXCEEDED) &&
-+ atomic_read(&cred->user->processes) > rlimit(RLIMIT_NPROC)) {
-+ retval = -EAGAIN;
-+ goto out_ret;
-+ }
-+
-+ /* We're below the limit (still or again), so we don't want to make
-+ * further execve() calls fail. */
-+ current->flags &= ~PF_NPROC_EXCEEDED;
-
- retval = unshare_files(&displaced);
- if (retval)
-@@ -1466,6 +1507,16 @@ static int do_execve_common(const char *filename,
+ /*
+ * We move the actual failure in case of RLIMIT_NPROC excess from
+ * set*uid() to execve() because too many poorly written programs
+@@ -1503,6 +1531,16 @@ static int do_execve_common(const char *filename,
bprm->filename = filename;
bprm->interp = filename;
@@ -42727,7 +41817,7 @@ index 044c13f..717b6af 100644
retval = bprm_mm_init(bprm);
if (retval)
goto out_file;
-@@ -1495,9 +1546,40 @@ static int do_execve_common(const char *filename,
+@@ -1532,9 +1570,40 @@ static int do_execve_common(const char *filename,
if (retval < 0)
goto out;
@@ -42769,7 +41859,7 @@ index 044c13f..717b6af 100644
/* execve succeeded */
current->fs->in_exec = 0;
-@@ -1508,6 +1590,14 @@ static int do_execve_common(const char *filename,
+@@ -1545,6 +1614,14 @@ static int do_execve_common(const char *filename,
put_files_struct(displaced);
return retval;
@@ -42784,7 +41874,7 @@ index 044c13f..717b6af 100644
out:
if (bprm->mm) {
acct_arg_size(bprm, 0);
-@@ -1581,7 +1671,7 @@ static int expand_corename(struct core_name *cn)
+@@ -1618,7 +1695,7 @@ static int expand_corename(struct core_name *cn)
{
char *old_corename = cn->corename;
@@ -42793,7 +41883,7 @@ index 044c13f..717b6af 100644
cn->corename = krealloc(old_corename, cn->size, GFP_KERNEL);
if (!cn->corename) {
-@@ -1669,7 +1759,7 @@ static int format_corename(struct core_name *cn, long signr)
+@@ -1715,7 +1792,7 @@ static int format_corename(struct core_name *cn, long signr)
int pid_in_pattern = 0;
int err = 0;
@@ -42802,7 +41892,7 @@ index 044c13f..717b6af 100644
cn->corename = kmalloc(cn->size, GFP_KERNEL);
cn->used = 0;
-@@ -1760,6 +1850,219 @@ out:
+@@ -1812,6 +1889,218 @@ out:
return ispipe;
}
@@ -42925,7 +42015,7 @@ index 044c13f..717b6af 100644
+ task_uid(tsk), task_euid(tsk), pc, sp);
+ free_page((unsigned long)buffer_exec);
+ free_page((unsigned long)buffer_fault);
-+ pax_report_insns(pc, sp);
++ pax_report_insns(regs, pc, sp);
+ do_coredump(SIGKILL, SIGKILL, regs);
+}
+#endif
@@ -42993,7 +42083,6 @@ index 044c13f..717b6af 100644
+#endif
+}
+
-+
+NORET_TYPE void pax_report_usercopy(const void *ptr, unsigned long len, bool to, const char *type)
+{
+ if (current->signal->curr_ip)
@@ -43022,7 +42111,7 @@ index 044c13f..717b6af 100644
static int zap_process(struct task_struct *start, int exit_code)
{
struct task_struct *t;
-@@ -1971,17 +2274,17 @@ static void wait_for_dump_helpers(struct file *file)
+@@ -2023,17 +2312,17 @@ static void wait_for_dump_helpers(struct file *file)
pipe = file->f_path.dentry->d_inode->i_pipe;
pipe_lock(pipe);
@@ -43045,7 +42134,7 @@ index 044c13f..717b6af 100644
pipe_unlock(pipe);
}
-@@ -2042,7 +2345,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
+@@ -2094,7 +2383,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
int retval = 0;
int flag = 0;
int ispipe;
@@ -43054,7 +42143,7 @@ index 044c13f..717b6af 100644
struct coredump_params cprm = {
.signr = signr,
.regs = regs,
-@@ -2057,6 +2360,9 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
+@@ -2109,6 +2398,9 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
audit_core_dumps(signr);
@@ -43064,16 +42153,7 @@ index 044c13f..717b6af 100644
binfmt = mm->binfmt;
if (!binfmt || !binfmt->core_dump)
goto fail;
-@@ -2097,6 +2403,8 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
- goto fail_corename;
- }
-
-+ gr_learn_resource(current, RLIMIT_CORE, binfmt->min_coredump, 1);
-+
- if (ispipe) {
- int dump_count;
- char **helper_argv;
-@@ -2124,7 +2432,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
+@@ -2176,7 +2468,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
}
cprm.limit = RLIM_INFINITY;
@@ -43082,7 +42162,16 @@ index 044c13f..717b6af 100644
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);
-@@ -2194,7 +2502,7 @@ close_fail:
+@@ -2203,6 +2495,8 @@ 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;
+
+@@ -2246,7 +2540,7 @@ close_fail:
filp_close(cprm.file, NULL);
fail_dropcount:
if (ispipe)
@@ -43091,7 +42180,7 @@ index 044c13f..717b6af 100644
fail_unlock:
kfree(cn.corename);
fail_corename:
-@@ -2213,7 +2521,7 @@ fail:
+@@ -2265,7 +2559,7 @@ fail:
*/
int dump_write(struct file *file, const void *addr, int nr)
{
@@ -43101,7 +42190,7 @@ index 044c13f..717b6af 100644
EXPORT_SYMBOL(dump_write);
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
-index 8f44cef..cb07120 100644
+index a8cbe1b..fed04cb 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)
@@ -43114,60 +42203,42 @@ index 8f44cef..cb07120 100644
(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
return 0;
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
-index fe52297..298e7dc 100644
+index a203892..4e64db5 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
-@@ -1441,7 +1441,7 @@ static int ext3_has_free_blocks(struct ext3_sb_info *sbi)
+@@ -1446,9 +1446,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 && !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 &&
+ !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)) {
return 0;
-diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
-index f4090bd..c7f4394 100644
---- a/fs/ext3/ioctl.c
-+++ b/fs/ext3/ioctl.c
-@@ -285,7 +285,7 @@ group_add_out:
- if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
-
-- if (copy_from_user(&range, (struct fstrim_range *)arg,
-+ if (copy_from_user(&range, (struct fstrim_range __user *)arg,
- sizeof(range)))
- return -EFAULT;
-
-@@ -293,7 +293,7 @@ group_add_out:
- if (ret < 0)
- return ret;
-
-- if (copy_to_user((struct fstrim_range *)arg, &range,
-+ if (copy_to_user((struct fstrim_range __user *)arg, &range,
- sizeof(range)))
- return -EFAULT;
-
+ }
+ return 1;
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
-index 264f694..4100ab7 100644
+index 12ccacd..a6035fce0 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
-@@ -394,8 +394,8 @@ static int ext4_has_free_blocks(struct ext4_sb_info *sbi,
- /* Hm, nope. Are (enough) root reserved blocks available? */
+@@ -436,8 +436,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)) ||
- capable(CAP_SYS_RESOURCE) ||
- (flags & EXT4_MB_USE_ROOT_BLOCKS)) {
-+ (flags & EXT4_MB_USE_ROOT_BLOCKS) ||
-+ capable_nolog(CAP_SYS_RESOURCE)) {
++ (flags & EXT4_MB_USE_ROOT_BLOCKS) ||
++ capable_nolog(CAP_SYS_RESOURCE)) {
- if (free_blocks >= (nblocks + dirty_blocks))
+ if (free_clusters >= (nclusters + dirty_clusters))
return 1;
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
-index 1a34c1c..0cbd418 100644
+index 5b0e26a..0aa002d 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
-@@ -1177,19 +1177,19 @@ struct ext4_sb_info {
+@@ -1208,19 +1208,19 @@ struct ext4_sb_info {
unsigned long s_mb_last_start;
/* stats for buddy allocator */
@@ -43197,48 +42268,11 @@ index 1a34c1c..0cbd418 100644
atomic_t s_lock_busy;
/* locality groups */
-diff --git a/fs/ext4/file.c b/fs/ext4/file.c
-index 2c09723..0a9b79e 100644
---- a/fs/ext4/file.c
-+++ b/fs/ext4/file.c
-@@ -181,8 +181,8 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
- path.dentry = mnt->mnt_root;
- cp = d_path(&path, buf, sizeof(buf));
- if (!IS_ERR(cp)) {
-- memcpy(sbi->s_es->s_last_mounted, cp,
-- sizeof(sbi->s_es->s_last_mounted));
-+ strlcpy(sbi->s_es->s_last_mounted, cp,
-+ sizeof(sbi->s_es->s_last_mounted));
- ext4_mark_super_dirty(sb);
- }
- }
-diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
-index 808c554..46008d7 100644
---- a/fs/ext4/ioctl.c
-+++ b/fs/ext4/ioctl.c
-@@ -344,7 +344,7 @@ mext_out:
- if (!blk_queue_discard(q))
- return -EOPNOTSUPP;
-
-- if (copy_from_user(&range, (struct fstrim_range *)arg,
-+ if (copy_from_user(&range, (struct fstrim_range __user *)arg,
- sizeof(range)))
- return -EFAULT;
-
-@@ -354,7 +354,7 @@ mext_out:
- if (ret < 0)
- return ret;
-
-- if (copy_to_user((struct fstrim_range *)arg, &range,
-+ if (copy_to_user((struct fstrim_range __user *)arg, &range,
- sizeof(range)))
- return -EFAULT;
-
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
-index 0f1be7f..b795315 100644
+index e2d8be8..c7f0ce9 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
-@@ -1793,7 +1793,7 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
+@@ -1794,7 +1794,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)
@@ -43247,7 +42281,7 @@ index 0f1be7f..b795315 100644
break;
}
-@@ -2087,7 +2087,7 @@ repeat:
+@@ -2088,7 +2088,7 @@ repeat:
ac->ac_status = AC_STATUS_CONTINUE;
ac->ac_flags |= EXT4_MB_HINT_FIRST;
cr = 3;
@@ -43256,28 +42290,19 @@ index 0f1be7f..b795315 100644
goto repeat;
}
}
-@@ -2130,6 +2130,8 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
- ext4_grpblk_t counters[16];
- } sg;
-
-+ pax_track_stack();
-+
- group--;
- if (group == 0)
- seq_printf(seq, "#%-5s: %-5s %-5s %-5s "
-@@ -2553,25 +2555,25 @@ int ext4_mb_release(struct super_block *sb)
+@@ -2592,25 +2592,25 @@ int ext4_mb_release(struct super_block *sb)
if (sbi->s_mb_stats) {
- printk(KERN_INFO
- "EXT4-fs: mballoc: %u blocks %u reqs (%u success)\n",
+ ext4_msg(sb, KERN_INFO,
+ "mballoc: %u blocks %u reqs (%u success)",
- atomic_read(&sbi->s_bal_allocated),
- atomic_read(&sbi->s_bal_reqs),
- atomic_read(&sbi->s_bal_success));
+ atomic_read_unchecked(&sbi->s_bal_allocated),
+ atomic_read_unchecked(&sbi->s_bal_reqs),
+ atomic_read_unchecked(&sbi->s_bal_success));
- printk(KERN_INFO
- "EXT4-fs: mballoc: %u extents scanned, %u goal hits, "
- "%u 2^N hits, %u breaks, %u lost\n",
+ ext4_msg(sb, KERN_INFO,
+ "mballoc: %u extents scanned, %u goal hits, "
+ "%u 2^N hits, %u breaks, %u lost",
- atomic_read(&sbi->s_bal_ex_scanned),
- atomic_read(&sbi->s_bal_goals),
- atomic_read(&sbi->s_bal_2orders),
@@ -43288,12 +42313,12 @@ index 0f1be7f..b795315 100644
+ atomic_read_unchecked(&sbi->s_bal_2orders),
+ atomic_read_unchecked(&sbi->s_bal_breaks),
+ atomic_read_unchecked(&sbi->s_mb_lost_chunks));
- printk(KERN_INFO
- "EXT4-fs: mballoc: %lu generated and it took %Lu\n",
- sbi->s_mb_buddies_generated++,
+ ext4_msg(sb, KERN_INFO,
+ "mballoc: %lu generated and it took %Lu",
+ sbi->s_mb_buddies_generated,
sbi->s_mb_generation_time);
- printk(KERN_INFO
- "EXT4-fs: mballoc: %u preallocated, %u discarded\n",
+ ext4_msg(sb, KERN_INFO,
+ "mballoc: %u preallocated, %u discarded",
- atomic_read(&sbi->s_mb_preallocated),
- atomic_read(&sbi->s_mb_discarded));
+ atomic_read_unchecked(&sbi->s_mb_preallocated),
@@ -43301,7 +42326,7 @@ index 0f1be7f..b795315 100644
}
free_percpu(sbi->s_locality_groups);
-@@ -3041,16 +3043,16 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac)
+@@ -3096,16 +3096,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) {
@@ -43324,16 +42349,16 @@ index 0f1be7f..b795315 100644
}
if (ac->ac_op == EXT4_MB_HISTORY_ALLOC)
-@@ -3448,7 +3450,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)
+@@ -3509,7 +3509,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);
-- atomic_add(pa->pa_free, &EXT4_SB(sb)->s_mb_preallocated);
-+ atomic_add_unchecked(pa->pa_free, &EXT4_SB(sb)->s_mb_preallocated);
+- atomic_add(pa->pa_free, &sbi->s_mb_preallocated);
++ atomic_add_unchecked(pa->pa_free, &sbi->s_mb_preallocated);
ei = EXT4_I(ac->ac_inode);
grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
-@@ -3508,7 +3510,7 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac)
+@@ -3569,7 +3569,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);
@@ -43342,7 +42367,7 @@ index 0f1be7f..b795315 100644
grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
lg = ac->ac_lg;
-@@ -3595,7 +3597,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
+@@ -3658,7 +3658,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
* from the bitmap and continue.
*/
}
@@ -43351,7 +42376,7 @@ index 0f1be7f..b795315 100644
return err;
}
-@@ -3613,7 +3615,7 @@ ext4_mb_release_group_pa(struct ext4_buddy *e4b,
+@@ -3676,7 +3676,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);
@@ -43361,7 +42386,7 @@ index 0f1be7f..b795315 100644
return 0;
diff --git a/fs/fcntl.c b/fs/fcntl.c
-index 22764c7..227cfc5 100644
+index 22764c7..86372c9 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,
@@ -43402,23 +42427,6 @@ index 22764c7..227cfc5 100644
if (arg >= rlimit(RLIMIT_NOFILE))
break;
err = alloc_fd(arg, cmd == F_DUPFD_CLOEXEC ? O_CLOEXEC : 0);
-@@ -835,14 +841,14 @@ static int __init fcntl_init(void)
- * Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY
- * is defined as O_NONBLOCK on some platforms and not on others.
- */
-- BUILD_BUG_ON(19 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
-+ BUILD_BUG_ON(20 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
- O_RDONLY | O_WRONLY | O_RDWR |
- O_CREAT | O_EXCL | O_NOCTTY |
- O_TRUNC | O_APPEND | /* O_NONBLOCK | */
- __O_SYNC | O_DSYNC | FASYNC |
- O_DIRECT | O_LARGEFILE | O_DIRECTORY |
- O_NOFOLLOW | O_NOATIME | O_CLOEXEC |
-- __FMODE_EXEC | O_PATH
-+ __FMODE_EXEC | O_PATH | FMODE_GREXEC
- ));
-
- fasync_cache = kmem_cache_create("fasync_cache",
diff --git a/fs/fifo.c b/fs/fifo.c
index b1a524d..4ee270e 100644
--- a/fs/fifo.c
@@ -43761,13 +42769,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;
@@ -43776,7 +42797,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;
@@ -43787,84 +42816,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;
@@ -43875,7 +42826,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;
@@ -43886,35 +42847,66 @@ 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_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_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_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;
@@ -43924,7 +42916,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;
@@ -44590,13 +43586,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;
@@ -44605,7 +43615,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;
@@ -44616,85 +43634,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;
@@ -44705,7 +43644,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;
@@ -44716,35 +43665,66 @@ 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_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_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_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;
@@ -44754,7 +43734,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;
@@ -44953,10 +43937,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 b6cca47..ec782c3 100644
+index 3426521..3b75162 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
-@@ -586,10 +586,12 @@ static int __init cuse_init(void)
+@@ -587,10 +587,12 @@ static int __init cuse_init(void)
INIT_LIST_HEAD(&cuse_conntbl[i]);
/* inherit and extend fuse_dev_operations */
@@ -44987,10 +43971,10 @@ index 2aaf3ea..8e50863 100644
if (!ret)
ret = -EPIPE;
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
-index d5016071..c46675a 100644
+index 9f63e49..d8a64c0 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
-@@ -1148,7 +1148,7 @@ static char *read_link(struct dentry *dentry)
+@@ -1147,7 +1147,7 @@ static char *read_link(struct dentry *dentry)
return link;
}
@@ -45000,10 +43984,10 @@ index d5016071..c46675a 100644
if (!IS_ERR(link))
free_page((unsigned long) link);
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
-index 03e0c52..f9d0602 100644
+index cfd4959..a780959 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
-@@ -1525,7 +1525,7 @@ out:
+@@ -1490,7 +1490,7 @@ out:
static void gfs2_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
{
@@ -45012,112 +43996,11 @@ index 03e0c52..f9d0602 100644
if (!IS_ERR(s))
kfree(s);
}
-diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
-index b4ba1b3..6295691 100644
---- a/fs/hfsplus/catalog.c
-+++ b/fs/hfsplus/catalog.c
-@@ -179,6 +179,8 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid,
- int err;
- u16 type;
-
-+ pax_track_stack();
-+
- hfsplus_cat_build_key(sb, fd->search_key, cnid, NULL);
- err = hfs_brec_read(fd, &tmp, sizeof(hfsplus_cat_entry));
- if (err)
-@@ -210,6 +212,8 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir,
- int entry_size;
- int err;
-
-+ pax_track_stack();
-+
- dprint(DBG_CAT_MOD, "create_cat: %s,%u(%d)\n",
- str->name, cnid, inode->i_nlink);
- hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
-@@ -349,6 +353,8 @@ int hfsplus_rename_cat(u32 cnid,
- int entry_size, type;
- int err = 0;
-
-+ pax_track_stack();
-+
- dprint(DBG_CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n",
- cnid, src_dir->i_ino, src_name->name,
- dst_dir->i_ino, dst_name->name);
-diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
-index 4df5059..00a2dcd 100644
---- a/fs/hfsplus/dir.c
-+++ b/fs/hfsplus/dir.c
-@@ -129,6 +129,8 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
- struct hfsplus_readdir_data *rd;
- u16 type;
-
-+ pax_track_stack();
-+
- if (filp->f_pos >= inode->i_size)
- return 0;
-
-diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
-index b248a6cf..2a81d50 100644
---- a/fs/hfsplus/inode.c
-+++ b/fs/hfsplus/inode.c
-@@ -489,6 +489,8 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)
- int res = 0;
- u16 type;
-
-+ pax_track_stack();
-+
- type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset);
-
- HFSPLUS_I(inode)->linkid = 0;
-@@ -552,6 +554,8 @@ int hfsplus_cat_write_inode(struct inode *inode)
- struct hfs_find_data fd;
- hfsplus_cat_entry entry;
-
-+ pax_track_stack();
-+
- if (HFSPLUS_IS_RSRC(inode))
- main_inode = HFSPLUS_I(inode)->rsrc_inode;
-
-diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
-index fbaa669..c548cd0 100644
---- a/fs/hfsplus/ioctl.c
-+++ b/fs/hfsplus/ioctl.c
-@@ -122,6 +122,8 @@ int hfsplus_setxattr(struct dentry *dentry, const char *name,
- struct hfsplus_cat_file *file;
- int res;
-
-+ pax_track_stack();
-+
- if (!S_ISREG(inode->i_mode) || HFSPLUS_IS_RSRC(inode))
- return -EOPNOTSUPP;
-
-@@ -166,6 +168,8 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
- struct hfsplus_cat_file *file;
- ssize_t res = 0;
-
-+ pax_track_stack();
-+
- if (!S_ISREG(inode->i_mode) || HFSPLUS_IS_RSRC(inode))
- return -EOPNOTSUPP;
-
-diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
-index c3a76fd..2fec62e 100644
---- a/fs/hfsplus/super.c
-+++ b/fs/hfsplus/super.c
-@@ -340,6 +340,8 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
- struct nls_table *nls = NULL;
- int err;
-
-+ pax_track_stack();
-+
- err = -EINVAL;
- sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
- if (!sbi)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
-index 7aafeb8..8d823ef 100644
+index 0be5a78..9cfb853 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
-@@ -914,7 +914,7 @@ static struct file_system_type hugetlbfs_fs_type = {
+@@ -915,7 +915,7 @@ static struct file_system_type hugetlbfs_fs_type = {
.kill_sb = kill_litter_super,
};
@@ -45127,10 +44010,10 @@ index 7aafeb8..8d823ef 100644
static int can_do_hugetlb_shm(void)
{
diff --git a/fs/inode.c b/fs/inode.c
-index 43566d1..ed49029 100644
+index ee4e66b..0451521 100644
--- a/fs/inode.c
+++ b/fs/inode.c
-@@ -829,8 +829,8 @@ unsigned int get_next_ino(void)
+@@ -787,8 +787,8 @@ unsigned int get_next_ino(void)
#ifdef CONFIG_SMP
if (unlikely((res & (LAST_INO_BATCH-1)) == 0)) {
@@ -45141,54 +44024,6 @@ index 43566d1..ed49029 100644
res = next - LAST_INO_BATCH;
}
-diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
-index e4b87bc..37402f7 100644
---- a/fs/jbd/checkpoint.c
-+++ b/fs/jbd/checkpoint.c
-@@ -350,6 +350,8 @@ int log_do_checkpoint(journal_t *journal)
- tid_t this_tid;
- int result;
-
-+ pax_track_stack();
-+
- jbd_debug(1, "Start checkpoint\n");
-
- /*
-diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c
-index 16a5047..88ff6ca 100644
---- a/fs/jffs2/compr_rtime.c
-+++ b/fs/jffs2/compr_rtime.c
-@@ -37,6 +37,8 @@ static int jffs2_rtime_compress(unsigned char *data_in,
- int outpos = 0;
- int pos=0;
-
-+ pax_track_stack();
-+
- memset(positions,0,sizeof(positions));
-
- while (pos < (*sourcelen) && outpos <= (*dstlen)-2) {
-@@ -78,6 +80,8 @@ static int jffs2_rtime_decompress(unsigned char *data_in,
- int outpos = 0;
- int pos=0;
-
-+ pax_track_stack();
-+
- memset(positions,0,sizeof(positions));
-
- while (outpos<destlen) {
-diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
-index 9e7cec8..4713089 100644
---- a/fs/jffs2/compr_rubin.c
-+++ b/fs/jffs2/compr_rubin.c
-@@ -314,6 +314,8 @@ static int jffs2_dynrubin_compress(unsigned char *data_in,
- int ret;
- uint32_t mysrclen, mydstlen;
-
-+ pax_track_stack();
-+
- mysrclen = *sourcelen;
- mydstlen = *dstlen - 8;
-
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index e513f19..2ab1351 100644
--- a/fs/jffs2/erase.c
@@ -45204,10 +44039,10 @@ index e513f19..2ab1351 100644
jffs2_prealloc_raw_node_refs(c, jeb, 1);
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
-index 4515bea..178f2d6 100644
+index b09e51d..e482afa 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
-@@ -1012,7 +1012,8 @@ static const struct jffs2_unknown_node oob_cleanmarker =
+@@ -1011,7 +1011,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),
@@ -45217,24 +44052,11 @@ index 4515bea..178f2d6 100644
};
/*
-diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
-index 3e93cdd..c8a80e1 100644
---- a/fs/jffs2/xattr.c
-+++ b/fs/jffs2/xattr.c
-@@ -773,6 +773,8 @@ void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c)
-
- BUG_ON(!(c->flags & JFFS2_SB_FLAG_BUILDING));
-
-+ pax_track_stack();
-+
- /* Phase.1 : Merge same xref */
- for (i=0; i < XREF_TMPHASH_SIZE; i++)
- xref_tmphash[i] = NULL;
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
-index 06c8a67..589dbbd 100644
+index a44eff0..462e07d 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
-@@ -803,7 +803,7 @@ static int __init init_jfs_fs(void)
+@@ -802,7 +802,7 @@ static int __init init_jfs_fs(void)
jfs_inode_cachep =
kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0,
@@ -45244,10 +44066,10 @@ index 06c8a67..589dbbd 100644
if (jfs_inode_cachep == NULL)
return -ENOMEM;
diff --git a/fs/libfs.c b/fs/libfs.c
-index 275ca474..4cf2811 100644
+index f6d411e..e82a08d 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
-@@ -163,6 +163,9 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
+@@ -165,6 +165,9 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
struct dentry *next;
@@ -45257,7 +44079,7 @@ index 275ca474..4cf2811 100644
next = list_entry(p, struct dentry, d_u.d_child);
spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
if (!simple_positive(next)) {
-@@ -172,7 +175,12 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
+@@ -174,7 +177,12 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
spin_unlock(&next->d_lock);
spin_unlock(&dentry->d_lock);
@@ -45272,7 +44094,7 @@ index 275ca474..4cf2811 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 e374050..972f4de 100644
+index 8392cb8..80d6193 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -36,11 +36,11 @@ static const struct rpc_call_ops nlmclnt_cancel_ops;
@@ -45289,20 +44111,11 @@ index e374050..972f4de 100644
memcpy(c->data, &cookie, 4);
c->len=4;
-@@ -620,6 +620,8 @@ nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl)
- struct nlm_rqst reqst, *req;
- int status;
-
-+ pax_track_stack();
-+
- req = &reqst;
- memset(req, 0, sizeof(*req));
- locks_init_lock(&req->a_args.lock.fl);
diff --git a/fs/locks.c b/fs/locks.c
-index b286539..d73d4af 100644
+index 637694b..f84a121 100644
--- a/fs/locks.c
+++ b/fs/locks.c
-@@ -2043,16 +2043,16 @@ void locks_remove_flock(struct file *filp)
+@@ -2074,16 +2074,16 @@ void locks_remove_flock(struct file *filp)
return;
if (filp->f_op && filp->f_op->flock) {
@@ -45323,72 +44136,62 @@ index b286539..d73d4af 100644
}
lock_flocks();
-diff --git a/fs/logfs/super.c b/fs/logfs/super.c
-index ce03a18..ac8c14f 100644
---- a/fs/logfs/super.c
-+++ b/fs/logfs/super.c
-@@ -266,6 +266,8 @@ static int logfs_recover_sb(struct super_block *sb)
- struct logfs_disk_super _ds1, *ds1 = &_ds1;
- int err, valid0, valid1;
-
-+ pax_track_stack();
-+
- /* read first superblock */
- err = wbuf_read(sb, super->s_sb_ofs[0], sizeof(*ds0), ds0);
- if (err)
diff --git a/fs/namei.c b/fs/namei.c
-index f7593c0..581e14f 100644
+index 5008f01..90328a7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
-@@ -239,21 +239,23 @@ int generic_permission(struct inode *inode, int mask, unsigned int flags,
+@@ -279,16 +279,32 @@ int generic_permission(struct inode *inode, int mask)
+ if (ret != -EACCES)
return ret;
++#ifdef CONFIG_GRKERNSEC
++ /* we'll block if we have to log due to a denied capability use */
++ if (mask & MAY_NOT_BLOCK)
++ return -ECHILD;
++#endif
++
+ if (S_ISDIR(inode->i_mode)) {
+ /* DACs are overridable for directories */
+- if (ns_capable(inode_userns(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))
+ return 0;
++ if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
++ return 0;
+ return -EACCES;
+ }
/*
-- * Read/write DACs are always overridable.
-- * Executable DACs are overridable for all directories and
-- * for non-directories that have least one exec bit set.
+ * Searching includes executable on directories, else just read.
- */
-- if (!(mask & MAY_EXEC) || execute_ok(inode))
-- if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
++ */
+ mask &= MAY_READ | MAY_WRITE | MAY_EXEC;
-+ if (mask == MAY_READ || (S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE))) {
-+ if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
++ if (mask == MAY_READ)
++ if (ns_capable_nolog(inode_userns(inode), CAP_DAC_OVERRIDE) ||
++ ns_capable(inode_userns(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.
+@@ -297,14 +313,6 @@ int generic_permission(struct inode *inode, int mask)
+ if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
return 0;
-+ }
- /*
+- /*
- * Searching includes executable on directories, else just read.
-+ * Read/write DACs are always overridable.
-+ * Executable DACs are overridable for all directories and
-+ * for non-directories that have least one exec bit set.
- */
+- */
- mask &= MAY_READ | MAY_WRITE | MAY_EXEC;
-- if (mask == MAY_READ || (S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE)))
+- if (mask == MAY_READ)
- if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
-+ if (!(mask & MAY_EXEC) || execute_ok(inode)) {
-+ if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
- return 0;
-+ }
-
+- return 0;
+-
return -EACCES;
}
-@@ -595,9 +597,12 @@ static inline int exec_permission(struct inode *inode, unsigned int flags)
- if (ret == -ECHILD)
- return ret;
-
-- if (ns_capable(ns, CAP_DAC_OVERRIDE) ||
-- ns_capable(ns, CAP_DAC_READ_SEARCH))
-+ if (ns_capable_nolog(ns, CAP_DAC_OVERRIDE))
- goto ok;
-+ else {
-+ if (ns_capable(ns, CAP_DAC_READ_SEARCH) || ns_capable(ns, CAP_DAC_OVERRIDE))
-+ goto ok;
-+ }
- return ret;
- ok:
-@@ -705,11 +710,19 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
+@@ -653,11 +661,19 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
return error;
}
@@ -45409,132 +44212,68 @@ index f7593c0..581e14f 100644
error = 0;
if (s)
error = __vfs_follow_link(nd, s);
-@@ -1606,6 +1619,12 @@ static int path_lookupat(int dfd, const char *name,
+@@ -1622,6 +1638,21 @@ static int path_lookupat(int dfd, const char *name,
if (!err)
err = complete_walk(nd);
-+ if (!(nd->flags & LOOKUP_PARENT) && !gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
-+ if (!err)
-+ path_put(&nd->path);
-+ err = -ENOENT;
++ if (!(nd->flags & LOOKUP_PARENT)) {
++#ifdef CONFIG_GRKERNSEC
++ if (flags & LOOKUP_RCU) {
++ if (!err)
++ path_put(&nd->path);
++ err = -ECHILD;
++ } else
++#endif
++ if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
++ if (!err)
++ path_put(&nd->path);
++ err = -ENOENT;
++ }
+ }
+
if (!err && nd->flags & LOOKUP_DIRECTORY) {
if (!nd->inode->i_op->lookup) {
path_put(&nd->path);
-@@ -1633,6 +1652,9 @@ static int do_path_lookup(int dfd, const char *name,
+@@ -1649,6 +1680,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 && !gr_chroot_fchdir(nd->path.dentry, nd->path.mnt))
-+ return -ENOENT;
++ 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))
++ return -ENOENT;
++ }
+
if (unlikely(!audit_dummy_context())) {
if (nd->path.dentry && nd->inode)
audit_inode(name, nd->path.dentry);
-@@ -1949,6 +1971,30 @@ int vfs_create(struct inode *dir, struct dentry *dentry, int mode,
- return error;
- }
+@@ -2046,6 +2086,13 @@ static int may_open(struct path *path, int acc_mode, int flag)
+ if (flag & O_NOATIME && !inode_owner_or_capable(inode))
+ return -EPERM;
-+/*
-+ * Note that while the flag value (low two bits) for sys_open means:
-+ * 00 - read-only
-+ * 01 - write-only
-+ * 10 - read-write
-+ * 11 - special
-+ * it is changed into
-+ * 00 - no permissions needed
-+ * 01 - read-permission
-+ * 10 - write-permission
-+ * 11 - read-write
-+ * for the internal routines (ie open_namei()/follow_link() etc)
-+ * This is more logical, and also allows the 00 "no perm needed"
-+ * to be used for symlinks (where the permissions are checked
-+ * later).
-+ *
-+*/
-+static inline int open_to_namei_flags(int flag)
-+{
-+ if ((flag+1) & O_ACCMODE)
-+ flag++;
-+ return flag;
-+}
-+
- static int may_open(struct path *path, int acc_mode, int flag)
- {
- struct dentry *dentry = path->dentry;
-@@ -2001,7 +2047,27 @@ static int may_open(struct path *path, int acc_mode, int flag)
- /*
- * Ensure there are no outstanding leases on the file.
- */
-- return break_lease(inode, flag);
-+ error = break_lease(inode, flag);
-+
-+ if (error)
-+ return error;
-+
-+ if (gr_handle_rofs_blockwrite(dentry, path->mnt, acc_mode)) {
-+ error = -EPERM;
-+ goto exit;
-+ }
-+
-+ if (gr_handle_rawio(inode)) {
-+ error = -EPERM;
-+ goto exit;
-+ }
++ if (gr_handle_rofs_blockwrite(dentry, path->mnt, acc_mode))
++ return -EPERM;
++ if (gr_handle_rawio(inode))
++ return -EPERM;
++ if (!gr_acl_handle_open(dentry, path->mnt, acc_mode))
++ return -EACCES;
+
-+ if (!gr_acl_handle_open(dentry, path->mnt, open_to_namei_flags(flag))) {
-+ error = -EACCES;
-+ goto exit;
-+ }
-+exit:
-+ return error;
- }
-
- static int handle_truncate(struct file *filp)
-@@ -2027,30 +2093,6 @@ static int handle_truncate(struct file *filp)
+ return 0;
}
- /*
-- * Note that while the flag value (low two bits) for sys_open means:
-- * 00 - read-only
-- * 01 - write-only
-- * 10 - read-write
-- * 11 - special
-- * it is changed into
-- * 00 - no permissions needed
-- * 01 - read-permission
-- * 10 - write-permission
-- * 11 - read-write
-- * for the internal routines (ie open_namei()/follow_link() etc)
-- * This is more logical, and also allows the 00 "no perm needed"
-- * to be used for symlinks (where the permissions are checked
-- * later).
-- *
--*/
--static inline int open_to_namei_flags(int flag)
--{
-- if ((flag+1) & O_ACCMODE)
-- flag++;
-- return flag;
--}
--
--/*
- * Handle the last step of open()
- */
- static struct file *do_last(struct nameidata *nd, struct path *path,
-@@ -2059,6 +2101,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
- struct dentry *dir = nd->path.dentry;
- struct dentry *dentry;
- int open_flag = op->open_flag;
-+ int flag = open_to_namei_flags(open_flag);
- int will_truncate = open_flag & O_TRUNC;
- int want_write = 0;
- int acc_mode = op->acc_mode;
-@@ -2079,6 +2122,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
+@@ -2107,6 +2154,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;
++ }
++#endif
+ if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
+ error = -ENOENT;
+ goto exit;
@@ -45542,10 +44281,16 @@ index f7593c0..581e14f 100644
audit_inode(pathname, nd->path.dentry);
if (open_flag & O_CREAT) {
error = -EISDIR;
-@@ -2089,6 +2136,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
+@@ -2117,6 +2174,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;
++ }
++#endif
+ if (!gr_acl_handle_hidden_file(dir, nd->path.mnt)) {
+ error = -ENOENT;
+ goto exit;
@@ -45553,24 +44298,29 @@ index f7593c0..581e14f 100644
audit_inode(pathname, dir);
goto ok;
}
-@@ -2111,6 +2162,11 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
+@@ -2138,6 +2205,16 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
+ error = complete_walk(nd);
if (error)
return ERR_PTR(-ECHILD);
-
++#ifdef CONFIG_GRKERNSEC
++ if (nd->flags & LOOKUP_RCU) {
++ error = -ECHILD;
++ goto exit;
++ }
++#endif
+ if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
+ error = -ENOENT;
+ goto exit;
+ }
-+
+
error = -ENOTDIR;
if (nd->flags & LOOKUP_DIRECTORY) {
- if (!nd->inode->i_op->lookup)
-@@ -2150,6 +2206,12 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
+@@ -2178,6 +2255,12 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
/* Negative dentry, just create the file */
if (!dentry->d_inode) {
int mode = op->mode;
+
-+ if (!gr_acl_handle_creat(path->dentry, nd->path.dentry, path->mnt, flag, mode)) {
++ if (!gr_acl_handle_creat(path->dentry, nd->path.dentry, path->mnt, open_flag, acc_mode, mode)) {
+ error = -EACCES;
+ goto exit_mutex_unlock;
+ }
@@ -45578,7 +44328,7 @@ index f7593c0..581e14f 100644
if (!IS_POSIXACL(dir->d_inode))
mode &= ~current_umask();
/*
-@@ -2173,6 +2235,8 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
+@@ -2201,6 +2284,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;
@@ -45587,7 +44337,7 @@ index f7593c0..581e14f 100644
mutex_unlock(&dir->d_inode->i_mutex);
dput(nd->path.dentry);
nd->path.dentry = dentry;
-@@ -2182,6 +2246,19 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
+@@ -2210,6 +2295,19 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
/*
* It already exists.
*/
@@ -45599,7 +44349,7 @@ index f7593c0..581e14f 100644
+
+ /* 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, flag, acc_mode)) {
++ if (gr_handle_fifo(path->dentry, path->mnt, dir, open_flag, acc_mode)) {
+ error = -EACCES;
+ goto exit_mutex_unlock;
+ }
@@ -45607,69 +44357,90 @@ index f7593c0..581e14f 100644
mutex_unlock(&dir->d_inode->i_mutex);
audit_inode(pathname, path->dentry);
-@@ -2398,6 +2475,10 @@ struct dentry *lookup_create(struct nameidata *nd, int is_dir)
- }
+@@ -2422,6 +2520,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)) {
++ if (!gr_acl_handle_hidden_file(dentry, nd.path.mnt)) {
+ dput(dentry);
-+ return ERR_PTR(-ENOENT);
++ dentry = ERR_PTR(-ENOENT);
++ goto fail;
+ }
dput(dentry);
dentry = ERR_PTR(-EEXIST);
fail:
-@@ -2475,6 +2556,17 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
- error = may_mknod(mode);
+@@ -2444,6 +2547,20 @@ struct dentry *user_path_create(int dfd, const char __user *pathname, struct pat
+ }
+ 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)
++{
++ char *tmp = getname(pathname);
++ struct dentry *res;
++ if (IS_ERR(tmp))
++ return ERR_CAST(tmp);
++ res = kern_path_create(dfd, tmp, path, is_dir);
++ if (IS_ERR(res))
++ putname(tmp);
++ else
++ *to = tmp;
++ return res;
++}
++
+ int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
+ {
+ int error = may_create(dir, dentry);
+@@ -2511,6 +2628,17 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
+ error = mnt_want_write(path.mnt);
if (error)
goto out_dput;
+
-+ if (gr_handle_chroot_mknod(dentry, nd.path.mnt, mode)) {
++ if (gr_handle_chroot_mknod(dentry, path.mnt, mode)) {
+ error = -EPERM;
-+ goto out_dput;
++ goto out_drop_write;
+ }
+
-+ if (!gr_acl_handle_mknod(dentry, nd.path.dentry, nd.path.mnt, mode)) {
++ if (!gr_acl_handle_mknod(dentry, path.dentry, path.mnt, mode)) {
+ error = -EACCES;
-+ goto out_dput;
++ goto out_drop_write;
+ }
+
- error = mnt_want_write(nd.path.mnt);
+ error = security_path_mknod(&path, dentry, mode, dev);
if (error)
- goto out_dput;
-@@ -2495,6 +2587,9 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
+ goto out_drop_write;
+@@ -2528,6 +2656,9 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
}
out_drop_write:
- mnt_drop_write(nd.path.mnt);
+ mnt_drop_write(path.mnt);
+
+ if (!error)
-+ gr_handle_create(dentry, nd.path.mnt);
++ gr_handle_create(dentry, path.mnt);
out_dput:
dput(dentry);
- out_unlock:
-@@ -2547,6 +2642,11 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode)
- if (IS_ERR(dentry))
- goto out_unlock;
-
-+ if (!gr_acl_handle_mkdir(dentry, nd.path.dentry, nd.path.mnt)) {
+ mutex_unlock(&path.dentry->d_inode->i_mutex);
+@@ -2577,12 +2708,21 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode)
+ error = mnt_want_write(path.mnt);
+ if (error)
+ goto out_dput;
++
++ if (!gr_acl_handle_mkdir(dentry, path.dentry, path.mnt)) {
+ error = -EACCES;
-+ goto out_dput;
++ goto out_drop_write;
+ }
+
- if (!IS_POSIXACL(nd.path.dentry->d_inode))
- mode &= ~current_umask();
- error = mnt_want_write(nd.path.mnt);
-@@ -2558,6 +2658,10 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode)
- error = vfs_mkdir(nd.path.dentry->d_inode, dentry, mode);
+ 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(nd.path.mnt);
+ mnt_drop_write(path.mnt);
+
+ if (!error)
-+ gr_handle_create(dentry, nd.path.mnt);
-+
++ gr_handle_create(dentry, path.mnt);
out_dput:
dput(dentry);
- out_unlock:
-@@ -2640,6 +2744,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
+ mutex_unlock(&path.dentry->d_inode->i_mutex);
+@@ -2662,6 +2802,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
char * name;
struct dentry *dentry;
struct nameidata nd;
@@ -45678,7 +44449,7 @@ index f7593c0..581e14f 100644
error = user_path_parent(dfd, pathname, &nd, &name);
if (error)
-@@ -2668,6 +2774,15 @@ static long do_rmdir(int dfd, const char __user *pathname)
+@@ -2690,6 +2832,15 @@ static long do_rmdir(int dfd, const char __user *pathname)
error = -ENOENT;
goto exit3;
}
@@ -45694,7 +44465,7 @@ index f7593c0..581e14f 100644
error = mnt_want_write(nd.path.mnt);
if (error)
goto exit3;
-@@ -2675,6 +2790,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
+@@ -2697,6 +2848,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
if (error)
goto exit4;
error = vfs_rmdir(nd.path.dentry->d_inode, dentry);
@@ -45703,7 +44474,7 @@ index f7593c0..581e14f 100644
exit4:
mnt_drop_write(nd.path.mnt);
exit3:
-@@ -2737,6 +2854,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
+@@ -2759,6 +2912,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
struct dentry *dentry;
struct nameidata nd;
struct inode *inode = NULL;
@@ -45712,7 +44483,7 @@ index f7593c0..581e14f 100644
error = user_path_parent(dfd, pathname, &nd, &name);
if (error)
-@@ -2759,6 +2878,16 @@ static long do_unlinkat(int dfd, const char __user *pathname)
+@@ -2781,6 +2936,16 @@ static long do_unlinkat(int dfd, const char __user *pathname)
if (!inode)
goto slashes;
ihold(inode);
@@ -45729,7 +44500,7 @@ index f7593c0..581e14f 100644
error = mnt_want_write(nd.path.mnt);
if (error)
goto exit2;
-@@ -2766,6 +2895,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
+@@ -2788,6 +2953,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
if (error)
goto exit3;
error = vfs_unlink(nd.path.dentry->d_inode, dentry);
@@ -45738,67 +44509,74 @@ index f7593c0..581e14f 100644
exit3:
mnt_drop_write(nd.path.mnt);
exit2:
-@@ -2843,6 +2974,11 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
- if (IS_ERR(dentry))
- goto out_unlock;
-
-+ if (!gr_acl_handle_symlink(dentry, nd.path.dentry, nd.path.mnt, from)) {
+@@ -2863,10 +3030,18 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
+ error = mnt_want_write(path.mnt);
+ if (error)
+ goto out_dput;
++
++ if (!gr_acl_handle_symlink(dentry, path.dentry, path.mnt, from)) {
+ error = -EACCES;
-+ goto out_dput;
++ goto out_drop_write;
+ }
+
- error = mnt_want_write(nd.path.mnt);
- if (error)
- goto out_dput;
-@@ -2850,6 +2986,8 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
+ error = security_path_symlink(&path, dentry, from);
if (error)
goto out_drop_write;
- error = vfs_symlink(nd.path.dentry->d_inode, dentry, from);
+ error = vfs_symlink(path.dentry->d_inode, dentry, from);
+ if (!error)
-+ gr_handle_create(dentry, nd.path.mnt);
++ gr_handle_create(dentry, path.mnt);
out_drop_write:
- mnt_drop_write(nd.path.mnt);
+ mnt_drop_write(path.mnt);
out_dput:
-@@ -2958,6 +3096,20 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+@@ -2938,6 +3113,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+ {
+ struct dentry *new_dentry;
+ struct path old_path, new_path;
++ char *to = NULL;
+ int how = 0;
+ int error;
+
+@@ -2961,7 +3137,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+ 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);
error = PTR_ERR(new_dentry);
if (IS_ERR(new_dentry))
- goto out_unlock;
+ goto out;
+@@ -2972,13 +3148,30 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+ error = mnt_want_write(new_path.mnt);
+ if (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_dput;
++ goto out_drop_write;
+ }
+
-+ if (!gr_acl_handle_link(new_dentry, nd.path.dentry, nd.path.mnt,
++ if (!gr_acl_handle_link(new_dentry, new_path.dentry, new_path.mnt,
+ old_path.dentry, old_path.mnt, to)) {
+ error = -EACCES;
-+ goto out_dput;
++ goto out_drop_write;
+ }
+
- error = mnt_want_write(nd.path.mnt);
- if (error)
- goto out_dput;
-@@ -2965,6 +3117,8 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+ error = security_path_link(old_path.dentry, &new_path, new_dentry);
if (error)
goto out_drop_write;
- error = vfs_link(old_path.dentry, nd.path.dentry->d_inode, new_dentry);
+ error = vfs_link(old_path.dentry, new_path.dentry->d_inode, new_dentry);
+ if (!error)
-+ gr_handle_create(new_dentry, nd.path.mnt);
++ gr_handle_create(new_dentry, new_path.mnt);
out_drop_write:
- mnt_drop_write(nd.path.mnt);
+ mnt_drop_write(new_path.mnt);
out_dput:
-@@ -3142,6 +3296,8 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
- char *to;
- int error;
-
-+ pax_track_stack();
-+
- error = user_path_parent(olddfd, oldname, &oldnd, &from);
- if (error)
- goto exit;
-@@ -3198,6 +3354,12 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
++ putname(to);
+ dput(new_dentry);
+ mutex_unlock(&new_path.dentry->d_inode->i_mutex);
+ path_put(&new_path);
+@@ -3206,6 +3399,12 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
if (new_dentry == trap)
goto exit5;
@@ -45811,7 +44589,7 @@ index f7593c0..581e14f 100644
error = mnt_want_write(oldnd.path.mnt);
if (error)
goto exit5;
-@@ -3207,6 +3369,9 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
+@@ -3215,6 +3414,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);
@@ -45821,7 +44599,7 @@ index f7593c0..581e14f 100644
exit6:
mnt_drop_write(oldnd.path.mnt);
exit5:
-@@ -3232,6 +3397,8 @@ SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newna
+@@ -3240,6 +3442,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)
{
@@ -45830,7 +44608,7 @@ index f7593c0..581e14f 100644
int len;
len = PTR_ERR(link);
-@@ -3241,7 +3408,14 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const c
+@@ -3249,7 +3453,14 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const c
len = strlen(link);
if (len > (unsigned) buflen)
len = buflen;
@@ -45847,7 +44625,7 @@ index f7593c0..581e14f 100644
out:
return len;
diff --git a/fs/namespace.c b/fs/namespace.c
-index edc1c4a..b208120 100644
+index cfc6d44..b4632a5 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1326,6 +1326,9 @@ static int do_umount(struct vfsmount *mnt, int flags)
@@ -45897,7 +44675,7 @@ index edc1c4a..b208120 100644
return retval;
}
-@@ -2573,6 +2592,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
+@@ -2605,6 +2624,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
if (error)
goto out2;
@@ -45909,70 +44687,21 @@ index edc1c4a..b208120 100644
get_fs_root(current->fs, &root);
error = lock_mount(&old);
if (error)
-diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
-index 9c51f62..503b252 100644
---- a/fs/ncpfs/dir.c
-+++ b/fs/ncpfs/dir.c
-@@ -299,6 +299,8 @@ ncp_lookup_validate(struct dentry *dentry, struct nameidata *nd)
- int res, val = 0, len;
- __u8 __name[NCP_MAXPATHLEN + 1];
-
-+ pax_track_stack();
-+
- if (dentry == dentry->d_sb->s_root)
- return 1;
-
-@@ -844,6 +846,8 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, struc
- int error, res, len;
- __u8 __name[NCP_MAXPATHLEN + 1];
-
-+ pax_track_stack();
-+
- error = -EIO;
- if (!ncp_conn_valid(server))
- goto finished;
-@@ -931,6 +935,8 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode,
- PPRINTK("ncp_create_new: creating %s/%s, mode=%x\n",
- dentry->d_parent->d_name.name, dentry->d_name.name, mode);
-
-+ pax_track_stack();
-+
- ncp_age_dentry(server, dentry);
- len = sizeof(__name);
- error = ncp_io2vol(server, __name, &len, dentry->d_name.name,
-@@ -992,6 +998,8 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode)
- int error, len;
- __u8 __name[NCP_MAXPATHLEN + 1];
-
-+ pax_track_stack();
-+
- DPRINTK("ncp_mkdir: making %s/%s\n",
- dentry->d_parent->d_name.name, dentry->d_name.name);
-
-@@ -1140,6 +1148,8 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
- int old_len, new_len;
- __u8 __old_name[NCP_MAXPATHLEN + 1], __new_name[NCP_MAXPATHLEN + 1];
-
-+ pax_track_stack();
-+
- DPRINTK("ncp_rename: %s/%s to %s/%s\n",
- old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
- new_dentry->d_parent->d_name.name, new_dentry->d_name.name);
-diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
-index 202f370..9d4565e 100644
---- a/fs/ncpfs/inode.c
-+++ b/fs/ncpfs/inode.c
-@@ -461,6 +461,8 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
- #endif
- struct ncp_entry_info finfo;
-
-+ pax_track_stack();
-+
- memset(&data, 0, sizeof(data));
- server = kzalloc(sizeof(struct ncp_server), GFP_KERNEL);
- if (!server)
+diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
+index 281ae95..dd895b9 100644
+--- a/fs/nfs/blocklayout/blocklayout.c
++++ b/fs/nfs/blocklayout/blocklayout.c
+@@ -90,7 +90,7 @@ static int is_writable(struct pnfs_block_extent *be, sector_t isect)
+ */
+ struct parallel_io {
+ struct kref refcnt;
+- struct rpc_call_ops call_ops;
++ rpc_call_ops_no_const call_ops;
+ void (*pnfs_callback) (void *data);
+ void *data;
+ };
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
-index c48f9f6..17c27ce 100644
+index 50a15fa..ca113f9 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -150,7 +150,7 @@ static void nfs_zap_caches_locked(struct inode *inode)
@@ -45984,7 +44713,7 @@ index c48f9f6..17c27ce 100644
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
-@@ -1000,16 +1000,16 @@ static int nfs_size_need_update(const struct inode *inode, const struct nfs_fatt
+@@ -1002,16 +1002,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);
}
@@ -46004,37 +44733,11 @@ index c48f9f6..17c27ce 100644
}
void nfs_fattr_init(struct nfs_fattr *fattr)
-diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
-index ecd8152..88c2e01 100644
---- a/fs/nfsd/nfs4state.c
-+++ b/fs/nfsd/nfs4state.c
-@@ -3804,6 +3804,8 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
- unsigned int strhashval;
- int err;
-
-+ pax_track_stack();
-+
- dprintk("NFSD: nfsd4_lock: start=%Ld length=%Ld\n",
- (long long) lock->lk_offset,
- (long long) lock->lk_length);
-diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
-index 6c74097..4c3d4c8 100644
---- a/fs/nfsd/nfs4xdr.c
-+++ b/fs/nfsd/nfs4xdr.c
-@@ -1800,6 +1800,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
- .dentry = dentry,
- };
-
-+ pax_track_stack();
-+
- BUG_ON(bmval1 & NFSD_WRITEONLY_ATTRS_WORD1);
- BUG_ON(bmval0 & ~nfsd_suppattrs0(minorversion));
- BUG_ON(bmval1 & ~nfsd_suppattrs1(minorversion));
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
-index acf88ae..4fd6245 100644
+index 7a2e442..8e544cc 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
-@@ -896,7 +896,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
+@@ -914,7 +914,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
} else {
oldfs = get_fs();
set_fs(KERNEL_DS);
@@ -46043,7 +44746,7 @@ index acf88ae..4fd6245 100644
set_fs(oldfs);
}
-@@ -1000,7 +1000,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
+@@ -1018,7 +1018,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);
@@ -46052,7 +44755,7 @@ index acf88ae..4fd6245 100644
set_fs(oldfs);
if (host_err < 0)
goto out_nfserr;
-@@ -1535,7 +1535,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
+@@ -1553,7 +1553,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
*/
oldfs = get_fs(); set_fs(KERNEL_DS);
@@ -46075,8 +44778,34 @@ index 9fde1c0..14e8827 100644
fanotify_event_metadata.event_len))
goto out_kill_access_response;
+diff --git a/fs/notify/mark.c b/fs/notify/mark.c
+index e14587d..f104d56 100644
+--- a/fs/notify/mark.c
++++ b/fs/notify/mark.c
+@@ -135,9 +135,6 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
+
+ mark->flags &= ~FSNOTIFY_MARK_FLAG_ALIVE;
+
+- /* 1 from caller and 1 for being on i_list/g_list */
+- BUG_ON(atomic_read(&mark->refcnt) < 2);
+-
+ spin_lock(&group->mark_lock);
+
+ if (mark->flags & FSNOTIFY_MARK_FLAG_INODE) {
+@@ -182,6 +179,11 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
+ iput(inode);
+
+ /*
++ * We don't necessarily have a ref on mark from caller so the above iput
++ * may have already destroyed it. Don't touch from now on.
++ */
++
++ /*
+ * it's possible that this group tried to destroy itself, but this
+ * this mark was simultaneously being freed by inode. If that's the
+ * case, we finish freeing the group here.
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
-index f39260f..79e6b04 100644
+index ee18815..7aa5d01 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -57,7 +57,7 @@ static struct kmem_cache *fsnotify_event_holder_cachep;
@@ -46098,7 +44827,7 @@ index f39260f..79e6b04 100644
EXPORT_SYMBOL_GPL(fsnotify_get_cookie);
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
-index 0f48e7c..3cba773 100644
+index 99e3610..02c1068 100644
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -1329,7 +1329,7 @@ find_next_index_buffer:
@@ -46111,10 +44840,10 @@ index 0f48e7c..3cba773 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 f4b1057..a0e2493 100644
+index c587e2d..3641eaa 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
-@@ -2222,6 +2222,6 @@ const struct inode_operations ntfs_file_inode_ops = {
+@@ -2229,6 +2229,6 @@ const struct inode_operations ntfs_file_inode_ops = {
#endif /* NTFS_RW */
};
@@ -46136,21 +44865,8 @@ index 210c352..a174f83 100644
bail:
if (handle)
-diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
-index e5d738c..318da56 100644
---- a/fs/ocfs2/namei.c
-+++ b/fs/ocfs2/namei.c
-@@ -1063,6 +1063,8 @@ static int ocfs2_rename(struct inode *old_dir,
- struct ocfs2_dir_lookup_result orphan_insert = { NULL, };
- struct ocfs2_dir_lookup_result target_insert = { NULL, };
-
-+ pax_track_stack();
-+
- /* At some point it might be nice to break this function up a
- * bit. */
-
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
-index 4092858..51c70ff 100644
+index d355e6e..578d905 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -235,11 +235,11 @@ enum ocfs2_vol_state
@@ -46229,10 +44945,10 @@ index ba5d97e..c77db25 100644
}
}
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
-index 56f6102..1433c29 100644
+index 4994f8b..eaab8eb 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
-@@ -300,11 +300,11 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len)
+@@ -301,11 +301,11 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len)
"%10s => GlobalAllocs: %d LocalAllocs: %d "
"SubAllocs: %d LAWinMoves: %d SAExtends: %d\n",
"Stats",
@@ -46249,7 +44965,7 @@ index 56f6102..1433c29 100644
out += snprintf(buf + out, len - out,
"%10s => State: %u Descriptor: %llu Size: %u bits "
-@@ -2112,11 +2112,11 @@ static int ocfs2_initialize_super(struct super_block *sb,
+@@ -2119,11 +2119,11 @@ static int ocfs2_initialize_super(struct super_block *sb,
spin_lock_init(&osb->osb_xattr_lock);
ocfs2_init_steal_slots(osb);
@@ -46280,7 +44996,7 @@ index 5d22872..523db20 100644
kfree(link);
}
diff --git a/fs/open.c b/fs/open.c
-index b52cf01..b0a28a8 100644
+index 22c41b5..695cb17 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -112,6 +112,10 @@ static long do_sys_truncate(const char __user *pathname, loff_t length)
@@ -46341,59 +45057,24 @@ index b52cf01..b0a28a8 100644
error = 0;
dput_and_out:
path_put(&path);
-@@ -466,12 +488,25 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode)
- err = mnt_want_write_file(file);
- if (err)
- goto out_putf;
-+
- mutex_lock(&inode->i_mutex);
-+
-+ if (!gr_acl_handle_fchmod(dentry, file->f_vfsmnt, mode)) {
-+ err = -EACCES;
-+ goto out_unlock;
-+ }
-+
- err = security_path_chmod(dentry, file->f_vfsmnt, mode);
- if (err)
- goto out_unlock;
- if (mode == (mode_t) -1)
- mode = inode->i_mode;
-+
-+ if (gr_handle_chroot_chmod(dentry, file->f_vfsmnt, mode)) {
-+ err = -EACCES;
-+ goto out_unlock;
-+ }
-+
- newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
- newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
- err = notify_change(dentry, &newattrs);
-@@ -499,12 +534,25 @@ SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode)
- error = mnt_want_write(path.mnt);
+@@ -456,6 +478,16 @@ static int chmod_common(struct path *path, umode_t mode)
if (error)
- goto dput_and_out;
-+
+ return error;
mutex_lock(&inode->i_mutex);
+
-+ if (!gr_acl_handle_chmod(path.dentry, path.mnt, mode)) {
++ if (!gr_acl_handle_fchmod(path->dentry, path->mnt, mode)) {
+ error = -EACCES;
+ goto out_unlock;
+ }
-+
- error = security_path_chmod(path.dentry, path.mnt, mode);
- if (error)
- goto out_unlock;
- if (mode == (mode_t) -1)
- mode = inode->i_mode;
-+
-+ if (gr_handle_chroot_chmod(path.dentry, path.mnt, mode)) {
++ if (gr_handle_chroot_chmod(path->dentry, path->mnt, mode)) {
+ error = -EACCES;
+ goto out_unlock;
+ }
+
- newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
- newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
- error = notify_change(path.dentry, &newattrs);
-@@ -528,6 +576,9 @@ static int chown_common(struct path *path, uid_t user, gid_t group)
+ error = security_path_chmod(path->dentry, path->mnt, mode);
+ if (error)
+ goto out_unlock;
+@@ -506,6 +538,9 @@ static int chown_common(struct path *path, uid_t user, gid_t group)
int error;
struct iattr newattrs;
@@ -46403,31 +45084,36 @@ index b52cf01..b0a28a8 100644
newattrs.ia_valid = ATTR_CTIME;
if (user != (uid_t) -1) {
newattrs.ia_valid |= ATTR_UID;
-@@ -998,7 +1049,10 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
- if (!IS_ERR(tmp)) {
- fd = get_unused_fd_flags(flags);
- if (fd >= 0) {
-- struct file *f = do_filp_open(dfd, tmp, &op, lookup);
-+ struct file *f;
-+ /* don't allow to be set by userland */
-+ flags &= ~FMODE_GREXEC;
-+ f = do_filp_open(dfd, tmp, &op, lookup);
- if (IS_ERR(f)) {
- put_unused_fd(fd);
- fd = PTR_ERR(f);
+diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c
+index 6296b40..417c00f 100644
+--- a/fs/partitions/efi.c
++++ b/fs/partitions/efi.c
+@@ -234,14 +234,14 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state,
+ if (!gpt)
+ return NULL;
+
++ if (!le32_to_cpu(gpt->num_partition_entries))
++ 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 (!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/fs/partitions/ldm.c b/fs/partitions/ldm.c
-index af9fdf0..6096bd6 100644
+index bd8ae78..539d250 100644
--- a/fs/partitions/ldm.c
+++ b/fs/partitions/ldm.c
-@@ -1311,6 +1311,7 @@ static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags)
- ldm_error ("A VBLK claims to have %d parts.", num);
- return false;
- }
-+
- if (rec >= num) {
- ldm_error("REC value (%d) exceeds NUM value (%d)", rec, num);
- return false;
-@@ -1322,7 +1323,7 @@ static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags)
+@@ -1324,7 +1324,7 @@ static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags)
goto found;
}
@@ -46437,7 +45123,7 @@ index af9fdf0..6096bd6 100644
ldm_crit ("Out of memory.");
return false;
diff --git a/fs/pipe.c b/fs/pipe.c
-index da42f7d..315f4e2 100644
+index 4065f07..68c0706 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -420,9 +420,9 @@ redo:
@@ -46595,7 +45281,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 9b45ee8..7389026 100644
+index 3a1dafd..d41fc37 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -60,6 +60,7 @@
@@ -46653,20 +45339,7 @@ index 9b45ee8..7389026 100644
static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task, int whole)
{
-@@ -375,9 +406,11 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
- cputime_t cutime, cstime, utime, stime;
- cputime_t cgtime, gtime;
- unsigned long rsslim = 0;
-- char tcomm[sizeof(task->comm)];
-+ char tcomm[sizeof(task->comm)] = { 0 };
- unsigned long flags;
-
-+ pax_track_stack();
-+
- state = *get_task_state(task);
- vsize = eip = esp = 0;
- permitted = ptrace_may_access(task, PTRACE_MODE_READ);
-@@ -449,6 +482,19 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
+@@ -449,6 +480,19 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
gtime = task->gtime;
}
@@ -46686,7 +45359,7 @@ index 9b45ee8..7389026 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);
-@@ -489,9 +535,15 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
+@@ -489,9 +533,15 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
vsize,
mm ? get_mm_rss(mm) : 0,
rsslim,
@@ -46702,7 +45375,7 @@ index 9b45ee8..7389026 100644
esp,
eip,
/* The signal information here is obsolete.
-@@ -544,3 +596,18 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
+@@ -544,3 +594,18 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
return 0;
}
@@ -46722,7 +45395,7 @@ index 9b45ee8..7389026 100644
+}
+#endif
diff --git a/fs/proc/base.c b/fs/proc/base.c
-index f039017..9d2507b 100644
+index 851ba3d..813fd0b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -107,6 +107,22 @@ struct pid_entry {
@@ -46748,17 +45421,102 @@ index f039017..9d2507b 100644
#define NOD(NAME, MODE, IOP, FOP, OP) { \
.name = (NAME), \
.len = sizeof(NAME) - 1, \
-@@ -209,6 +225,9 @@ static struct mm_struct *__check_mem_permission(struct task_struct *task)
- if (task == current)
- return mm;
+@@ -194,65 +210,7 @@ static int proc_root_link(struct inode *inode, struct path *path)
+ return result;
+ }
+
+-static struct mm_struct *__check_mem_permission(struct task_struct *task)
+-{
+- struct mm_struct *mm;
+-
+- mm = get_task_mm(task);
+- if (!mm)
+- return ERR_PTR(-EINVAL);
+-
+- /*
+- * A task can always look at itself, in case it chooses
+- * to use system calls instead of load instructions.
+- */
+- if (task == current)
+- return mm;
+-
+- /*
+- * If current is actively ptrace'ing, and would also be
+- * permitted to freshly attach with ptrace now, permit it.
+- */
+- if (task_is_stopped_or_traced(task)) {
+- int match;
+- rcu_read_lock();
+- match = (ptrace_parent(task) == current);
+- rcu_read_unlock();
+- if (match && ptrace_may_access(task, PTRACE_MODE_ATTACH))
+- return mm;
+- }
+-
+- /*
+- * No one else is allowed.
+- */
+- mmput(mm);
+- return ERR_PTR(-EPERM);
+-}
+-
+-/*
+- * If current may access user memory in @task return a reference to the
+- * corresponding mm, otherwise ERR_PTR.
+- */
+-static struct mm_struct *check_mem_permission(struct task_struct *task)
+-{
+- struct mm_struct *mm;
+- int err;
+-
+- /*
+- * Avoid racing if task exec's as we might get a new mm but validate
+- * against old credentials.
+- */
+- err = mutex_lock_killable(&task->signal->cred_guard_mutex);
+- if (err)
+- return ERR_PTR(err);
+-
+- mm = __check_mem_permission(task);
+- mutex_unlock(&task->signal->cred_guard_mutex);
+-
+- return mm;
+-}
+-
+-struct mm_struct *mm_for_maps(struct task_struct *task)
++static struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
+ {
+ struct mm_struct *mm;
+ int err;
+@@ -262,16 +220,23 @@ struct mm_struct *mm_for_maps(struct task_struct *task)
+ return ERR_PTR(err);
+
+ mm = get_task_mm(task);
+- if (mm && mm != current->mm &&
+- !ptrace_may_access(task, PTRACE_MODE_READ)) {
+- mmput(mm);
+- mm = ERR_PTR(-EACCES);
++ if (mm) {
++ if ((mm != current->mm && !ptrace_may_access(task, mode)) ||
++ (mode == PTRACE_MODE_ATTACH && (gr_handle_proc_ptrace(task) || gr_acl_handle_procpidmem(task)))) {
++ mmput(mm);
++ mm = ERR_PTR(-EACCES);
++ }
+ }
+ mutex_unlock(&task->signal->cred_guard_mutex);
+
+ return mm;
+ }
-+ if (gr_handle_proc_ptrace(task) || gr_acl_handle_procpidmem(task))
-+ return ERR_PTR(-EPERM);
++struct mm_struct *mm_for_maps(struct task_struct *task)
++{
++ return mm_access(task, PTRACE_MODE_READ);
++}
+
- /*
- * If current is actively ptrace'ing, and would also be
- * permitted to freshly attach with ptrace now, permit it.
-@@ -282,6 +301,9 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer)
+ static int proc_pid_cmdline(struct task_struct *task, char * buffer)
+ {
+ int res = 0;
+@@ -282,6 +247,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 */
@@ -46768,7 +45526,7 @@ index f039017..9d2507b 100644
len = mm->arg_end - mm->arg_start;
if (len > PAGE_SIZE)
-@@ -309,12 +331,28 @@ out:
+@@ -309,12 +277,28 @@ out:
return res;
}
@@ -46797,7 +45555,7 @@ index f039017..9d2507b 100644
do {
nwords += 2;
} while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */
-@@ -328,7 +366,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer)
+@@ -328,7 +312,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer)
}
@@ -46806,7 +45564,7 @@ index f039017..9d2507b 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.
-@@ -367,7 +405,7 @@ static void unlock_trace(struct task_struct *task)
+@@ -367,7 +351,7 @@ static void unlock_trace(struct task_struct *task)
mutex_unlock(&task->signal->cred_guard_mutex);
}
@@ -46815,7 +45573,7 @@ index f039017..9d2507b 100644
#define MAX_STACK_TRACE_DEPTH 64
-@@ -558,7 +596,7 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)
+@@ -558,7 +542,7 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)
return count;
}
@@ -46824,7 +45582,7 @@ index f039017..9d2507b 100644
static int proc_pid_syscall(struct task_struct *task, char *buffer)
{
long nr;
-@@ -587,7 +625,7 @@ static int proc_pid_syscall(struct task_struct *task, char *buffer)
+@@ -587,7 +571,7 @@ static int proc_pid_syscall(struct task_struct *task, char *buffer)
/************************************************************************/
/* permission checks */
@@ -46833,7 +45591,7 @@ index f039017..9d2507b 100644
{
struct task_struct *task;
int allowed = 0;
-@@ -597,7 +635,10 @@ static int proc_fd_access_allowed(struct inode *inode)
+@@ -597,7 +581,10 @@ static int proc_fd_access_allowed(struct inode *inode)
*/
task = get_proc_task(inode);
if (task) {
@@ -46845,7 +45603,154 @@ index f039017..9d2507b 100644
put_task_struct(task);
}
return allowed;
-@@ -978,6 +1019,9 @@ static ssize_t environ_read(struct file *file, char __user *buf,
+@@ -816,38 +803,39 @@ static const struct file_operations proc_single_file_operations = {
+
+ static int mem_open(struct inode* inode, struct file* file)
+ {
+- file->private_data = (void*)((long)current->self_exec_id);
++ struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
++ struct mm_struct *mm;
++
++ if (!task)
++ return -ESRCH;
++
++ mm = mm_access(task, PTRACE_MODE_ATTACH);
++ put_task_struct(task);
++
++ if (IS_ERR(mm))
++ return PTR_ERR(mm);
++
+ /* OK to pass negative loff_t, we can catch out-of-range */
+ file->f_mode |= FMODE_UNSIGNED_OFFSET;
++ file->private_data = mm;
++
+ return 0;
+ }
+
+ static ssize_t mem_read(struct file * file, char __user * buf,
+ size_t count, loff_t *ppos)
+ {
+- struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
++ int ret;
+ char *page;
+ unsigned long src = *ppos;
+- int ret = -ESRCH;
+- struct mm_struct *mm;
++ struct mm_struct *mm = file->private_data;
+
+- if (!task)
+- goto out_no_task;
++ if (!mm)
++ return 0;
+
+- ret = -ENOMEM;
+ page = (char *)__get_free_page(GFP_TEMPORARY);
+ if (!page)
+- goto out;
+-
+- mm = check_mem_permission(task);
+- ret = PTR_ERR(mm);
+- if (IS_ERR(mm))
+- goto out_free;
+-
+- ret = -EIO;
+-
+- if (file->private_data != (void*)((long)current->self_exec_id))
+- goto out_put;
++ return -ENOMEM;
+
+ ret = 0;
+
+@@ -874,42 +862,28 @@ static ssize_t mem_read(struct file * file, char __user * buf,
+ }
+ *ppos = src;
+
+-out_put:
+- mmput(mm);
+-out_free:
+ free_page((unsigned long) page);
+-out:
+- put_task_struct(task);
+-out_no_task:
+ return ret;
+ }
+
++#define mem_write NULL
++
++#ifndef mem_write
++/* They were right the first time */
+ static ssize_t mem_write(struct file * file, const char __user *buf,
+ size_t count, loff_t *ppos)
+ {
+ int copied;
+ char *page;
+- struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
+ unsigned long dst = *ppos;
+- struct mm_struct *mm;
++ struct mm_struct *mm = file->private_data;
+
+- copied = -ESRCH;
+- if (!task)
+- goto out_no_task;
++ if (!mm)
++ return 0;
+
+- copied = -ENOMEM;
+ page = (char *)__get_free_page(GFP_TEMPORARY);
+ if (!page)
+- goto out_task;
+-
+- mm = check_mem_permission(task);
+- copied = PTR_ERR(mm);
+- if (IS_ERR(mm))
+- goto out_free;
+-
+- copied = -EIO;
+- if (file->private_data != (void *)((long)current->self_exec_id))
+- goto out_mm;
++ return -ENOMEM;
+
+ copied = 0;
+ while (count > 0) {
+@@ -933,15 +907,10 @@ static ssize_t mem_write(struct file * file, const char __user *buf,
+ }
+ *ppos = dst;
+
+-out_mm:
+- mmput(mm);
+-out_free:
+ free_page((unsigned long) page);
+-out_task:
+- put_task_struct(task);
+-out_no_task:
+ return copied;
+ }
++#endif
+
+ loff_t mem_lseek(struct file *file, loff_t offset, int orig)
+ {
+@@ -959,11 +928,20 @@ loff_t mem_lseek(struct file *file, loff_t offset, int orig)
+ return file->f_pos;
+ }
+
++static int mem_release(struct inode *inode, struct file *file)
++{
++ struct mm_struct *mm = file->private_data;
++
++ mmput(mm);
++ return 0;
++}
++
+ static const struct file_operations proc_mem_operations = {
+ .llseek = mem_lseek,
+ .read = mem_read,
+ .write = mem_write,
+ .open = mem_open,
++ .release = mem_release,
+ };
+
+ static ssize_t environ_read(struct file *file, char __user *buf,
+@@ -978,6 +956,9 @@ static ssize_t environ_read(struct file *file, char __user *buf,
if (!task)
goto out_no_task;
@@ -46855,7 +45760,7 @@ index f039017..9d2507b 100644
ret = -ENOMEM;
page = (char *)__get_free_page(GFP_TEMPORARY);
if (!page)
-@@ -1614,7 +1658,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
+@@ -1600,7 +1581,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
path_put(&nd->path);
/* Are we allowed to snoop on the tasks file descriptors? */
@@ -46864,7 +45769,7 @@ index f039017..9d2507b 100644
goto out;
error = PROC_I(inode)->op.proc_get_link(inode, &nd->path);
-@@ -1653,8 +1697,18 @@ static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int b
+@@ -1639,8 +1620,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? */
@@ -46885,7 +45790,7 @@ index f039017..9d2507b 100644
error = PROC_I(inode)->op.proc_get_link(inode, &path);
if (error)
-@@ -1719,7 +1773,11 @@ struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *t
+@@ -1705,7 +1696,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;
@@ -46897,7 +45802,7 @@ index f039017..9d2507b 100644
rcu_read_unlock();
}
security_task_to_inode(task, inode);
-@@ -1737,6 +1795,9 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
+@@ -1723,6 +1718,9 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
struct inode *inode = dentry->d_inode;
struct task_struct *task;
const struct cred *cred;
@@ -46907,7 +45812,7 @@ index f039017..9d2507b 100644
generic_fillattr(inode, stat);
-@@ -1744,13 +1805,41 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
+@@ -1730,13 +1728,41 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
stat->uid = 0;
stat->gid = 0;
task = pid_task(proc_pid(inode), PIDTYPE_PID);
@@ -46940,17 +45845,17 @@ index f039017..9d2507b 100644
+#else
stat->gid = cred->egid;
+#endif
-+ }
+ }
+#if defined(CONFIG_GRKERNSEC_PROC_USER) || defined(CONFIG_GRKERNSEC_PROC_USERGROUP)
+ } else {
+ rcu_read_unlock();
+ return -ENOENT;
- }
++ }
+#endif
}
rcu_read_unlock();
return 0;
-@@ -1787,11 +1876,20 @@ int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
+@@ -1773,11 +1799,20 @@ int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
if (task) {
if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) ||
@@ -46971,7 +45876,7 @@ index f039017..9d2507b 100644
rcu_read_unlock();
} else {
inode->i_uid = 0;
-@@ -1909,7 +2007,8 @@ static int proc_fd_info(struct inode *inode, struct path *path, char *info)
+@@ -1895,7 +1930,8 @@ static int proc_fd_info(struct inode *inode, struct path *path, char *info)
int fd = proc_fd(inode);
if (task) {
@@ -46981,12 +45886,12 @@ index f039017..9d2507b 100644
put_task_struct(task);
}
if (files) {
-@@ -2177,11 +2276,21 @@ static const struct file_operations proc_fd_operations = {
+@@ -2163,11 +2199,21 @@ static const struct file_operations proc_fd_operations = {
*/
- static int proc_fd_permission(struct inode *inode, int mask, unsigned int flags)
+ static int proc_fd_permission(struct inode *inode, int mask)
{
+ struct task_struct *task;
- int rv = generic_permission(inode, mask, flags, NULL);
+ int rv = generic_permission(inode, mask);
- if (rv == 0)
- return 0;
+
@@ -47005,7 +45910,7 @@ index f039017..9d2507b 100644
return rv;
}
-@@ -2291,6 +2400,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
+@@ -2277,6 +2323,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
if (!task)
goto out_no_task;
@@ -47015,7 +45920,7 @@ index f039017..9d2507b 100644
/*
* Yes, it does not scale. And it should not. Don't add
* new entries into /proc/<tgid>/ without very good reasons.
-@@ -2335,6 +2447,9 @@ static int proc_pident_readdir(struct file *filp,
+@@ -2321,6 +2370,9 @@ static int proc_pident_readdir(struct file *filp,
if (!task)
goto out_no_task;
@@ -47025,7 +45930,7 @@ index f039017..9d2507b 100644
ret = 0;
i = filp->f_pos;
switch (i) {
-@@ -2605,7 +2720,7 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
+@@ -2591,7 +2643,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)
{
@@ -47034,15 +45939,7 @@ index f039017..9d2507b 100644
if (!IS_ERR(s))
__putname(s);
}
-@@ -2664,6 +2779,7 @@ static struct dentry *proc_base_instantiate(struct inode *dir,
- if (p->fop)
- inode->i_fop = p->fop;
- ei->op = p->op;
-+
- d_add(dentry, inode);
- error = NULL;
- out:
-@@ -2803,7 +2919,7 @@ static const struct pid_entry tgid_base_stuff[] = {
+@@ -2789,7 +2841,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),
@@ -47051,7 +45948,7 @@ index f039017..9d2507b 100644
INF("syscall", S_IRUGO, proc_pid_syscall),
#endif
INF("cmdline", S_IRUGO, proc_pid_cmdline),
-@@ -2828,10 +2944,10 @@ static const struct pid_entry tgid_base_stuff[] = {
+@@ -2814,10 +2866,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
@@ -47064,7 +45961,7 @@ index f039017..9d2507b 100644
ONE("stack", S_IRUGO, proc_pid_stack),
#endif
#ifdef CONFIG_SCHEDSTATS
-@@ -2865,6 +2981,9 @@ static const struct pid_entry tgid_base_stuff[] = {
+@@ -2851,6 +2903,9 @@ static const struct pid_entry tgid_base_stuff[] = {
#ifdef CONFIG_HARDWALL
INF("hardwall", S_IRUGO, proc_pid_hardwall),
#endif
@@ -47074,7 +45971,7 @@ index f039017..9d2507b 100644
};
static int proc_tgid_base_readdir(struct file * filp,
-@@ -2990,7 +3109,14 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
+@@ -2976,7 +3031,14 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
if (!inode)
goto out;
@@ -47089,13 +45986,10 @@ index f039017..9d2507b 100644
inode->i_op = &proc_tgid_base_inode_operations;
inode->i_fop = &proc_tgid_base_operations;
inode->i_flags|=S_IMMUTABLE;
-@@ -3032,7 +3158,14 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
+@@ -3018,7 +3080,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
if (!task)
goto out;
-+ if (!has_group_leader_pid(task))
-+ goto out_put_task;
-+
+ if (gr_pid_is_chrooted(task) || gr_check_hidden_task(task))
+ goto out_put_task;
+
@@ -47104,7 +45998,7 @@ index f039017..9d2507b 100644
put_task_struct(task);
out:
return result;
-@@ -3097,6 +3230,11 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
+@@ -3083,6 +3149,11 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
{
unsigned int nr;
struct task_struct *reaper;
@@ -47116,7 +46010,7 @@ index f039017..9d2507b 100644
struct tgid_iter iter;
struct pid_namespace *ns;
-@@ -3120,8 +3258,27 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
+@@ -3106,8 +3177,27 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
for (iter = next_tgid(ns, iter);
iter.task;
iter.tgid += 1, iter = next_tgid(ns, iter)) {
@@ -47145,7 +46039,7 @@ index f039017..9d2507b 100644
put_task_struct(iter.task);
goto out;
}
-@@ -3149,7 +3306,7 @@ static const struct pid_entry tid_base_stuff[] = {
+@@ -3135,7 +3225,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),
@@ -47154,7 +46048,7 @@ index f039017..9d2507b 100644
INF("syscall", S_IRUGO, proc_pid_syscall),
#endif
INF("cmdline", S_IRUGO, proc_pid_cmdline),
-@@ -3173,10 +3330,10 @@ static const struct pid_entry tid_base_stuff[] = {
+@@ -3159,10 +3249,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
@@ -47200,7 +46094,7 @@ index b143471..bb105e5 100644
}
module_init(proc_devices_init);
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
-index 74b48cf..6542979 100644
+index 7737c54..7172574 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -18,12 +18,18 @@
@@ -47263,19 +46157,10 @@ index 7838e5c..ff92cbc 100644
extern const struct file_operations proc_maps_operations;
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
-index d245cb2..7e645bd 100644
+index d245cb2..f4e8498 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
-@@ -321,6 +321,8 @@ static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff)
- off_t offset = 0;
- struct kcore_list *m;
-
-+ pax_track_stack();
-+
- /* setup ELF header */
- elf = (struct elfhdr *) bufp;
- bufp += sizeof(struct elfhdr);
-@@ -478,9 +480,10 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
+@@ -478,9 +478,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);
@@ -47288,12 +46173,14 @@ index d245cb2..7e645bd 100644
while (buflen) {
struct kcore_list *m;
-@@ -509,20 +512,23 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
+@@ -509,20 +510,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 distingush between fault on source
@@ -47304,9 +46191,6 @@ index d245cb2..7e645bd 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;
@@ -47324,7 +46208,7 @@ index d245cb2..7e645bd 100644
} else {
if (clear_user(buffer, tsz))
return -EFAULT;
-@@ -542,6 +548,9 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
+@@ -542,6 +546,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)
{
@@ -47335,19 +46219,10 @@ index d245cb2..7e645bd 100644
return -EPERM;
if (kcore_need_update)
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
-index a962827..2963d5b 100644
+index 80e4645..53e5fcf 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
-@@ -29,6 +29,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
- unsigned long pages[NR_LRU_LISTS];
- int lru;
-
-+ pax_track_stack();
-+
- /*
- * display in kilobytes.
- */
-@@ -158,7 +160,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
+@@ -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
@@ -47370,7 +46245,7 @@ index b1822dd..df622cb 100644
seq_putc(m, '\n');
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
-index 9020ac1..15a7335 100644
+index f738024..876984a 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)
@@ -47392,10 +46267,10 @@ index 9020ac1..15a7335 100644
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 d167de3..0ede166 100644
+index a6b6217..3d0953c 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
-@@ -8,11 +8,13 @@
+@@ -9,11 +9,13 @@
#include <linux/namei.h>
#include "internal.h"
@@ -47409,9 +46284,9 @@ index d167de3..0ede166 100644
-static const struct inode_operations proc_sys_dir_operations;
+const struct inode_operations proc_sys_dir_operations;
- static struct inode *proc_sys_make_inode(struct super_block *sb,
- struct ctl_table_header *head, struct ctl_table *table)
-@@ -121,8 +123,14 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
+ void proc_sys_poll_notify(struct ctl_table_poll *poll)
+ {
+@@ -131,8 +133,14 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
err = NULL;
d_set_d_op(dentry, &proc_sys_dentry_operations);
@@ -47426,7 +46301,7 @@ index d167de3..0ede166 100644
out:
sysctl_head_finish(head);
return err;
-@@ -202,6 +210,9 @@ static int proc_sys_fill_cache(struct file *filp, void *dirent,
+@@ -245,6 +253,9 @@ static int proc_sys_fill_cache(struct file *filp, void *dirent,
return -ENOMEM;
} else {
d_set_d_op(child, &proc_sys_dentry_operations);
@@ -47436,7 +46311,7 @@ index d167de3..0ede166 100644
d_add(child, inode);
}
} else {
-@@ -230,6 +241,9 @@ static int scan(struct ctl_table_header *head, ctl_table *table,
+@@ -273,6 +284,9 @@ static int scan(struct ctl_table_header *head, ctl_table *table,
if (*pos < file->f_pos)
continue;
@@ -47446,7 +46321,7 @@ index d167de3..0ede166 100644
res = proc_sys_fill_cache(file, dirent, filldir, head, table);
if (res)
return res;
-@@ -355,6 +369,9 @@ static int proc_sys_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
+@@ -398,6 +412,9 @@ static int proc_sys_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
if (IS_ERR(head))
return PTR_ERR(head);
@@ -47456,7 +46331,7 @@ index d167de3..0ede166 100644
generic_fillattr(inode, stat);
if (table)
stat->mode = (stat->mode & S_IFMT) | table->mode;
-@@ -374,13 +391,13 @@ static const struct file_operations proc_sys_dir_file_operations = {
+@@ -420,13 +437,13 @@ static const struct file_operations proc_sys_dir_file_operations = {
.llseek = generic_file_llseek,
};
@@ -47473,10 +46348,10 @@ index d167de3..0ede166 100644
.permission = proc_sys_permission,
.setattr = proc_sys_setattr,
diff --git a/fs/proc/root.c b/fs/proc/root.c
-index d6c3b41..539f3bf 100644
+index 03102d9..4ae347e 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
-@@ -123,7 +123,15 @@ void __init proc_root_init(void)
+@@ -121,7 +121,15 @@ void __init proc_root_init(void)
#ifdef CONFIG_PROC_DEVICETREE
proc_device_tree_init();
#endif
@@ -47493,10 +46368,10 @@ index d6c3b41..539f3bf 100644
}
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index c7d4ee6..41c5564 100644
+index e418c5a..e66a99c 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
-@@ -51,8 +51,13 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
+@@ -52,8 +52,13 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
"VmExe:\t%8lu kB\n"
"VmLib:\t%8lu kB\n"
"VmPTE:\t%8lu kB\n"
@@ -47511,8 +46386,8 @@ index c7d4ee6..41c5564 100644
+ ,hiwater_vm << (PAGE_SHIFT-10),
(total_vm - mm->reserved_vm) << (PAGE_SHIFT-10),
mm->locked_vm << (PAGE_SHIFT-10),
- hiwater_rss << (PAGE_SHIFT-10),
-@@ -60,7 +65,13 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
+ mm->pinned_vm << (PAGE_SHIFT-10),
+@@ -62,7 +67,13 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
data << (PAGE_SHIFT-10),
mm->stack_vm << (PAGE_SHIFT-10), text, lib,
(PTRS_PER_PTE*sizeof(pte_t)*mm->nr_ptes) >> 10,
@@ -47527,7 +46402,7 @@ index c7d4ee6..41c5564 100644
}
unsigned long task_vsize(struct mm_struct *mm)
-@@ -207,6 +218,12 @@ static int do_maps_open(struct inode *inode, struct file *file,
+@@ -209,6 +220,12 @@ static int do_maps_open(struct inode *inode, struct file *file,
return ret;
}
@@ -47540,7 +46415,7 @@ index c7d4ee6..41c5564 100644
static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
{
struct mm_struct *mm = vma->vm_mm;
-@@ -225,13 +242,13 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
+@@ -227,13 +244,13 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
}
@@ -47559,7 +46434,7 @@ index c7d4ee6..41c5564 100644
seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
start,
-@@ -240,7 +257,11 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
+@@ -242,7 +259,11 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
flags & VM_WRITE ? 'w' : '-',
flags & VM_EXEC ? 'x' : '-',
flags & VM_MAYSHARE ? 's' : 'p',
@@ -47571,7 +46446,7 @@ index c7d4ee6..41c5564 100644
MAJOR(dev), MINOR(dev), ino, &len);
/*
-@@ -249,7 +270,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
+@@ -251,7 +272,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
*/
if (file) {
pad_len_spaces(m, len);
@@ -47580,7 +46455,7 @@ index c7d4ee6..41c5564 100644
} else {
const char *name = arch_vma_name(vma);
if (!name) {
-@@ -257,8 +278,9 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
+@@ -259,8 +280,9 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
if (vma->vm_start <= mm->brk &&
vma->vm_end >= mm->start_brk) {
name = "[heap]";
@@ -47592,7 +46467,7 @@ index c7d4ee6..41c5564 100644
name = "[stack]";
}
} else {
-@@ -433,11 +455,16 @@ static int show_smap(struct seq_file *m, void *v)
+@@ -435,11 +457,16 @@ static int show_smap(struct seq_file *m, void *v)
};
memset(&mss, 0, sizeof mss);
@@ -47614,7 +46489,7 @@ index c7d4ee6..41c5564 100644
show_map_vma(m, vma);
seq_printf(m,
-@@ -455,7 +482,11 @@ static int show_smap(struct seq_file *m, void *v)
+@@ -457,7 +484,11 @@ static int show_smap(struct seq_file *m, void *v)
"KernelPageSize: %8lu kB\n"
"MMUPageSize: %8lu kB\n"
"Locked: %8lu kB\n",
@@ -47626,7 +46501,7 @@ index c7d4ee6..41c5564 100644
mss.resident >> 10,
(unsigned long)(mss.pss >> (10 + PSS_SHIFT)),
mss.shared_clean >> 10,
-@@ -1031,7 +1062,7 @@ static int show_numa_map(struct seq_file *m, void *v)
+@@ -1033,7 +1064,7 @@ static int show_numa_map(struct seq_file *m, void *v)
if (file) {
seq_printf(m, " file=");
@@ -47781,19 +46656,6 @@ index 356f715..c918d38 100644
if (__put_user(d_off, &lastdirent->d_off))
error = -EFAULT;
else
-diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
-index 198dabf..94f661b 100644
---- a/fs/reiserfs/dir.c
-+++ b/fs/reiserfs/dir.c
-@@ -66,6 +66,8 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent,
- struct reiserfs_dir_entry de;
- int ret = 0;
-
-+ pax_track_stack();
-+
- reiserfs_write_lock(inode->i_sb);
-
- reiserfs_check_lock_depth(inode->i_sb, "readdir");
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index 60c0804..d814f98 100644
--- a/fs/reiserfs/do_balan.c
@@ -47807,34 +46669,8 @@ index 60c0804..d814f98 100644
do_balance_starts(tb);
/* balance leaf returns 0 except if combining L R and S into
-diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
-index c5e82ec..1b37b0c 100644
---- a/fs/reiserfs/journal.c
-+++ b/fs/reiserfs/journal.c
-@@ -2299,6 +2299,8 @@ static struct buffer_head *reiserfs_breada(struct block_device *dev,
- struct buffer_head *bh;
- int i, j;
-
-+ pax_track_stack();
-+
- bh = __getblk(dev, block, bufsize);
- if (buffer_uptodate(bh))
- return (bh);
-diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
-index 1186626..6a281dc 100644
---- a/fs/reiserfs/namei.c
-+++ b/fs/reiserfs/namei.c
-@@ -1225,6 +1225,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
- unsigned long savelink = 1;
- struct timespec ctime;
-
-+ pax_track_stack();
-+
- /* three balancings: (1) old name removal, (2) new name insertion
- and (3) maybe "save" link insertion
- stat data updates: (1) old directory,
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
-index 7a99811..2c9286f 100644
+index 7a99811..a7c96c4 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -113,7 +113,7 @@ static int show_super(struct seq_file *m, struct super_block *sb)
@@ -47846,79 +46682,8 @@ index 7a99811..2c9286f 100644
SF(s_disk_reads), SF(s_disk_writes), SF(s_fix_nodes),
SF(s_do_balance), SF(s_unneeded_left_neighbor),
SF(s_good_search_by_key_reada), SF(s_bmaps),
-@@ -299,6 +299,8 @@ static int show_journal(struct seq_file *m, struct super_block *sb)
- struct journal_params *jp = &rs->s_v1.s_journal;
- char b[BDEVNAME_SIZE];
-
-+ pax_track_stack();
-+
- seq_printf(m, /* on-disk fields */
- "jp_journal_1st_block: \t%i\n"
- "jp_journal_dev: \t%s[%x]\n"
-diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
-index 313d39d..3a5811b 100644
---- a/fs/reiserfs/stree.c
-+++ b/fs/reiserfs/stree.c
-@@ -1196,6 +1196,8 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
- int iter = 0;
- #endif
-
-+ pax_track_stack();
-+
- BUG_ON(!th->t_trans_id);
-
- init_tb_struct(th, &s_del_balance, sb, path,
-@@ -1333,6 +1335,8 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
- int retval;
- int quota_cut_bytes = 0;
-
-+ pax_track_stack();
-+
- BUG_ON(!th->t_trans_id);
-
- le_key2cpu_key(&cpu_key, key);
-@@ -1562,6 +1566,8 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
- int quota_cut_bytes;
- loff_t tail_pos = 0;
-
-+ pax_track_stack();
-+
- BUG_ON(!th->t_trans_id);
-
- init_tb_struct(th, &s_cut_balance, inode->i_sb, path,
-@@ -1957,6 +1963,8 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
- int retval;
- int fs_gen;
-
-+ pax_track_stack();
-+
- BUG_ON(!th->t_trans_id);
-
- fs_gen = get_generation(inode->i_sb);
-@@ -2045,6 +2053,8 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
- int fs_gen = 0;
- int quota_bytes = 0;
-
-+ pax_track_stack();
-+
- BUG_ON(!th->t_trans_id);
-
- if (inode) { /* Do we count quotas for item? */
-diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
-index aa91089..c321513 100644
---- a/fs/reiserfs/super.c
-+++ b/fs/reiserfs/super.c
-@@ -927,6 +927,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
- {.option_name = NULL}
- };
-
-+ pax_track_stack();
-+
- *blocks = 0;
- if (!options || !*options)
- /* use default configuration: create tails, journaling on, no
diff --git a/fs/select.c b/fs/select.c
-index d33418f..f8e06bc 100644
+index d33418f..2a5345e 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -20,6 +20,7 @@
@@ -47929,30 +46694,10 @@ index d33418f..f8e06bc 100644
#include <linux/personality.h> /* for STICKY_TIMEOUTS */
#include <linux/file.h>
#include <linux/fdtable.h>
-@@ -403,6 +404,8 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
- int retval, i, timed_out = 0;
- unsigned long slack = 0;
-
-+ pax_track_stack();
-+
- rcu_read_lock();
- retval = max_select_fd(n, fds);
- rcu_read_unlock();
-@@ -528,6 +531,8 @@ int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
- /* Allocate small arguments on the stack to save memory and be faster */
- long stack_fds[SELECT_STACK_ALLOC/sizeof(long)];
-
-+ pax_track_stack();
-+
- ret = -EINVAL;
- if (n < 0)
- goto out_nofds;
-@@ -837,6 +842,9 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
+@@ -837,6 +838,7 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
struct poll_list *walk = head;
unsigned long todo = nfds;
-+ pax_track_stack();
-+
+ gr_learn_resource(current, RLIMIT_NOFILE, nfds, 1);
if (nfds > rlimit(RLIMIT_NOFILE))
return -EINVAL;
@@ -48011,7 +46756,7 @@ index dba43c3..a99fb63 100644
if (op) {
diff --git a/fs/splice.c b/fs/splice.c
-index aa866d3..757e92d 100644
+index fa2defa..8601650 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -194,7 +194,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
@@ -48035,16 +46780,7 @@ index aa866d3..757e92d 100644
}
pipe_unlock(pipe);
-@@ -320,6 +320,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
- .spd_release = spd_release_page,
- };
-
-+ pax_track_stack();
-+
- if (splice_grow_spd(pipe, &spd))
- return -ENOMEM;
-
-@@ -560,7 +562,7 @@ static ssize_t kernel_readv(struct file *file, const struct iovec *vec,
+@@ -560,7 +560,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() */
@@ -48053,7 +46789,7 @@ index aa866d3..757e92d 100644
set_fs(old_fs);
return res;
-@@ -575,7 +577,7 @@ static ssize_t kernel_write(struct file *file, const char *buf, size_t count,
+@@ -575,7 +575,7 @@ static 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() */
@@ -48062,16 +46798,7 @@ index aa866d3..757e92d 100644
set_fs(old_fs);
return res;
-@@ -603,6 +605,8 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
- .spd_release = spd_release_page,
- };
-
-+ pax_track_stack();
-+
- if (splice_grow_spd(pipe, &spd))
- return -ENOMEM;
-
-@@ -626,7 +630,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
+@@ -626,7 +626,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);
@@ -48080,7 +46807,7 @@ index aa866d3..757e92d 100644
vec[i].iov_len = this_len;
spd.pages[i] = page;
spd.nr_pages++;
-@@ -846,10 +850,10 @@ EXPORT_SYMBOL(splice_from_pipe_feed);
+@@ -846,10 +846,10 @@ EXPORT_SYMBOL(splice_from_pipe_feed);
int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
{
while (!pipe->nrbufs) {
@@ -48093,7 +46820,7 @@ index aa866d3..757e92d 100644
return 0;
if (sd->flags & SPLICE_F_NONBLOCK)
-@@ -1182,7 +1186,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
+@@ -1182,7 +1182,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.
*/
@@ -48102,16 +46829,7 @@ index aa866d3..757e92d 100644
current->splice_pipe = pipe;
}
-@@ -1619,6 +1623,8 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov,
- };
- long ret;
-
-+ pax_track_stack();
-+
- pipe = get_pipe_info(file);
- if (!pipe)
- return -EBADF;
-@@ -1734,9 +1740,9 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
+@@ -1734,9 +1734,9 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
ret = -ERESTARTSYS;
break;
}
@@ -48123,7 +46841,7 @@ index aa866d3..757e92d 100644
if (flags & SPLICE_F_NONBLOCK) {
ret = -EAGAIN;
break;
-@@ -1768,7 +1774,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
+@@ -1768,7 +1768,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
pipe_lock(pipe);
while (pipe->nrbufs >= pipe->buffers) {
@@ -48132,7 +46850,7 @@ index aa866d3..757e92d 100644
send_sig(SIGPIPE, current, 0);
ret = -EPIPE;
break;
-@@ -1781,9 +1787,9 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
+@@ -1781,9 +1781,9 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
ret = -ERESTARTSYS;
break;
}
@@ -48144,7 +46862,7 @@ index aa866d3..757e92d 100644
}
pipe_unlock(pipe);
-@@ -1819,14 +1825,14 @@ retry:
+@@ -1819,14 +1819,14 @@ retry:
pipe_double_lock(ipipe, opipe);
do {
@@ -48161,7 +46879,7 @@ index aa866d3..757e92d 100644
break;
/*
-@@ -1923,7 +1929,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
+@@ -1923,7 +1923,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
pipe_double_lock(ipipe, opipe);
do {
@@ -48170,7 +46888,7 @@ index aa866d3..757e92d 100644
send_sig(SIGPIPE, current, 0);
if (!ret)
ret = -EPIPE;
-@@ -1968,7 +1974,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
+@@ -1968,7 +1968,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
*/
@@ -48180,7 +46898,7 @@ index aa866d3..757e92d 100644
pipe_unlock(ipipe);
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
-index 1ad8c93..6633545 100644
+index d4e6080b..0e58b99 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -37,7 +37,7 @@ static DEFINE_SPINLOCK(sysfs_open_dirent_lock);
@@ -48257,24 +46975,11 @@ index a7ac78f..02158e1 100644
if (!IS_ERR(page))
free_page((unsigned long)page);
}
-diff --git a/fs/udf/inode.c b/fs/udf/inode.c
-index 1d1358e..408bedb 100644
---- a/fs/udf/inode.c
-+++ b/fs/udf/inode.c
-@@ -560,6 +560,8 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
- int goal = 0, pgoal = iinfo->i_location.logicalBlockNum;
- int lastblock = 0;
-
-+ pax_track_stack();
-+
- prev_epos.offset = udf_file_entry_alloc_offset(inode);
- prev_epos.block = iinfo->i_location;
- prev_epos.bh = NULL;
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
-index 9215700..bf1f68e 100644
+index c175b4d..8f36a16 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
-@@ -286,7 +286,7 @@ void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum,
+@@ -289,7 +289,7 @@ void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum,
u8 udf_tag_checksum(const struct tag *t)
{
@@ -48309,10 +47014,10 @@ 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 f060663..def7007 100644
+index 67583de..c5aad14 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
-@@ -254,7 +254,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
+@@ -315,7 +315,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
* Extended attribute SET operations
*/
static long
@@ -48321,7 +47026,7 @@ index f060663..def7007 100644
size_t size, int flags)
{
int error;
-@@ -278,7 +278,13 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
+@@ -339,7 +339,13 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
return PTR_ERR(kvalue);
}
@@ -48336,7 +47041,7 @@ index f060663..def7007 100644
kfree(kvalue);
return error;
}
-@@ -295,7 +301,7 @@ SYSCALL_DEFINE5(setxattr, const char __user *, pathname,
+@@ -356,7 +362,7 @@ SYSCALL_DEFINE5(setxattr, const char __user *, pathname,
return error;
error = mnt_want_write(path.mnt);
if (!error) {
@@ -48345,7 +47050,7 @@ index f060663..def7007 100644
mnt_drop_write(path.mnt);
}
path_put(&path);
-@@ -314,7 +320,7 @@ SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,
+@@ -375,7 +381,7 @@ SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,
return error;
error = mnt_want_write(path.mnt);
if (!error) {
@@ -48354,7 +47059,7 @@ index f060663..def7007 100644
mnt_drop_write(path.mnt);
}
path_put(&path);
-@@ -325,17 +331,15 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
+@@ -386,17 +392,15 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
const void __user *,value, size_t, size, int, flags)
{
struct file *f;
@@ -48389,49 +47094,11 @@ index 8d5a506..7f62712 100644
int count;
struct posix_acl *acl;
struct posix_acl_entry *acl_e;
-diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
-index acca2c5..5c67296 100644
---- a/fs/xfs/linux-2.6/xfs_ioctl.c
-+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
-@@ -128,7 +128,7 @@ xfs_find_handle(
- }
-
- error = -EFAULT;
-- if (copy_to_user(hreq->ohandle, &handle, hsize) ||
-+ if (hsize > sizeof handle || copy_to_user(hreq->ohandle, &handle, hsize) ||
- copy_to_user(hreq->ohandlen, &hsize, sizeof(__s32)))
- goto out_put;
-
-diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c
-index 54e623b..5c3fd7a 100644
---- a/fs/xfs/linux-2.6/xfs_ioctl32.c
-+++ b/fs/xfs/linux-2.6/xfs_ioctl32.c
-@@ -73,6 +73,7 @@ xfs_compat_ioc_fsgeometry_v1(
- xfs_fsop_geom_t fsgeo;
- int error;
-
-+ memset(&fsgeo, 0, sizeof(fsgeo));
- error = xfs_fs_geometry(mp, &fsgeo, 3);
- if (error)
- return -error;
-diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
-index f5b697b..a8de28d 100644
---- a/fs/xfs/linux-2.6/xfs_iops.c
-+++ b/fs/xfs/linux-2.6/xfs_iops.c
-@@ -445,7 +445,7 @@ xfs_vn_put_link(
- struct nameidata *nd,
- void *p)
- {
-- char *s = nd_get_link(nd);
-+ const char *s = nd_get_link(nd);
-
- if (!IS_ERR(s))
- kfree(s);
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
-index a175933..36cd8dd 100644
+index d0ab788..827999b 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
-@@ -253,7 +253,7 @@ xfs_bmap_validate_ret(
+@@ -190,7 +190,7 @@ xfs_bmap_validate_ret(
int nmap,
int ret_nmap);
#else
@@ -48441,13 +47108,13 @@ index a175933..36cd8dd 100644
STATIC int
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c
-index b1bae6b..5aa3993 100644
+index 79d05e8..e3e5861 100644
--- a/fs/xfs/xfs_dir2_sf.c
+++ b/fs/xfs/xfs_dir2_sf.c
-@@ -780,7 +780,15 @@ xfs_dir2_sf_getdents(
+@@ -852,7 +852,15 @@ xfs_dir2_sf_getdents(
}
- ino = xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep));
+ ino = xfs_dir2_sfe_get_ino(sfp, sfep);
- if (filldir(dirent, (char *)sfep->name, sfep->namelen,
+ if (dp->i_df.if_u1.if_data == dp->i_df.if_u2.if_inline_data) {
+ char name[sfep->namelen];
@@ -48461,12 +47128,38 @@ index b1bae6b..5aa3993 100644
off & 0x7fffffff, ino, DT_UNKNOWN)) {
*offset = off & 0x7fffffff;
return 0;
+diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
+index d99a905..9f88202 100644
+--- a/fs/xfs/xfs_ioctl.c
++++ b/fs/xfs/xfs_ioctl.c
+@@ -128,7 +128,7 @@ xfs_find_handle(
+ }
+
+ error = -EFAULT;
+- if (copy_to_user(hreq->ohandle, &handle, hsize) ||
++ if (hsize > sizeof handle || copy_to_user(hreq->ohandle, &handle, hsize) ||
+ copy_to_user(hreq->ohandlen, &hsize, sizeof(__s32)))
+ goto out_put;
+
+diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
+index 23ce927..e274cc1 100644
+--- a/fs/xfs/xfs_iops.c
++++ b/fs/xfs/xfs_iops.c
+@@ -447,7 +447,7 @@ xfs_vn_put_link(
+ struct nameidata *nd,
+ void *p)
+ {
+- char *s = nd_get_link(nd);
++ const char *s = nd_get_link(nd);
+
+ if (!IS_ERR(s))
+ kfree(s);
diff --git a/grsecurity/Kconfig b/grsecurity/Kconfig
new file mode 100644
-index 0000000..9629731
+index 0000000..4639511
--- /dev/null
+++ b/grsecurity/Kconfig
-@@ -0,0 +1,1037 @@
+@@ -0,0 +1,1051 @@
+#
+# grecurity configuration
+#
@@ -48601,6 +47294,7 @@ index 0000000..9629731
+ select GRKERNSEC_PROC_ADD
+ select GRKERNSEC_CHROOT_CHMOD
+ select GRKERNSEC_CHROOT_NICE
++ select GRKERNSEC_SETXID
+ select GRKERNSEC_AUDIT_MOUNT
+ select GRKERNSEC_MODHARDEN if (MODULES)
+ select GRKERNSEC_HARDEN_PTRACE
@@ -49266,6 +47960,19 @@ index 0000000..9629731
+ option is enabled, a sysctl option with name "harden_ptrace" is
+ created.
+
++config GRKERNSEC_SETXID
++ bool "Enforce consistent multithreaded privileges"
++ help
++ If you say Y here, a change from a root uid to a non-root uid
++ in a multithreaded application will cause the resulting uids,
++ gids, supplementary groups, and capabilities in that thread
++ to be propagated to the other threads of the process. In most
++ cases this is unnecessary, as glibc will emulate this behavior
++ on behalf of the application. Other libcs do not act in the
++ same way, allowing the other threads of the process to continue
++ running with root privileges. If the sysctl option is enabled,
++ a sysctl option with name "consistent_setxid" is created.
++
+config GRKERNSEC_TPE
+ bool "Trusted Path Execution (TPE)"
+ help
@@ -49548,10 +48255,10 @@ index 0000000..be9ae3a
+endif
diff --git a/grsecurity/gracl.c b/grsecurity/gracl.c
new file mode 100644
-index 0000000..8397b5f
+index 0000000..09258e0
--- /dev/null
+++ b/grsecurity/gracl.c
-@@ -0,0 +1,4155 @@
+@@ -0,0 +1,4156 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/sched.h>
@@ -53410,6 +52117,7 @@ index 0000000..8397b5f
+
+ if (retmode & GR_PTRACERD) {
+ switch (request) {
++ case PTRACE_SEIZE:
+ case PTRACE_POKETEXT:
+ case PTRACE_POKEDATA:
+ case PTRACE_POKEUSR:
@@ -53927,10 +52635,10 @@ index 0000000..955ddfb
+
diff --git a/grsecurity/gracl_fs.c b/grsecurity/gracl_fs.c
new file mode 100644
-index 0000000..8ab588d
+index 0000000..4eda5c3
--- /dev/null
+++ b/grsecurity/gracl_fs.c
-@@ -0,0 +1,431 @@
+@@ -0,0 +1,433 @@
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/types.h>
@@ -53967,7 +52675,7 @@ index 0000000..8ab588d
+
+__u32
+gr_acl_handle_open(const struct dentry * dentry, const struct vfsmount * mnt,
-+ const int fmode)
++ int acc_mode)
+{
+ __u32 reqmode = GR_FIND;
+ __u32 mode;
@@ -53975,14 +52683,13 @@ index 0000000..8ab588d
+ if (unlikely(!dentry->d_inode))
+ return reqmode;
+
-+ if (unlikely(fmode & O_APPEND))
++ if (acc_mode & MAY_APPEND)
+ reqmode |= GR_APPEND;
-+ else if (unlikely(fmode & FMODE_WRITE))
++ else if (acc_mode & MAY_WRITE)
+ reqmode |= GR_WRITE;
-+ if (likely((fmode & FMODE_READ) && !(fmode & O_DIRECTORY)))
++ if ((acc_mode & MAY_READ) && !S_ISDIR(dentry->d_inode->i_mode))
+ reqmode |= GR_READ;
-+ if ((fmode & FMODE_GREXEC) && (fmode & __FMODE_EXEC))
-+ reqmode &= ~GR_READ;
++
+ mode =
+ gr_search_file(dentry, reqmode | to_gr_audit(reqmode) | GR_SUPPRESS,
+ mnt);
@@ -54010,17 +52717,20 @@ index 0000000..8ab588d
+__u32
+gr_acl_handle_creat(const struct dentry * dentry,
+ const struct dentry * p_dentry,
-+ const struct vfsmount * p_mnt, const int fmode,
++ const struct vfsmount * p_mnt, int open_flags, int acc_mode,
+ const int imode)
+{
+ __u32 reqmode = GR_WRITE | GR_CREATE;
+ __u32 mode;
+
-+ if (unlikely(fmode & O_APPEND))
++ if (acc_mode & MAY_APPEND)
+ reqmode |= GR_APPEND;
-+ if (unlikely((fmode & FMODE_READ) && !(fmode & O_DIRECTORY)))
++ // if a directory was required or the directory already exists, then
++ // don't count this open as a read
++ if ((acc_mode & MAY_READ) &&
++ !((open_flags & O_DIRECTORY) || (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode))))
+ reqmode |= GR_READ;
-+ if (unlikely((fmode & O_CREAT) && (imode & (S_ISUID | S_ISGID))))
++ if ((open_flags & O_CREAT) && (imode & (S_ISUID | S_ISGID)))
+ reqmode |= GR_SETID;
+
+ mode =
@@ -55771,7 +54481,7 @@ index 0000000..a2dc675
+}
diff --git a/grsecurity/grsec_disabled.c b/grsecurity/grsec_disabled.c
new file mode 100644
-index 0000000..7cf9c87
+index 0000000..d81a586
--- /dev/null
+++ b/grsecurity/grsec_disabled.c
@@ -0,0 +1,439 @@
@@ -55969,7 +54679,7 @@ index 0000000..7cf9c87
+
+__u32
+gr_acl_handle_open(const struct dentry * dentry, const struct vfsmount * mnt,
-+ const int fmode)
++ int acc_mode)
+{
+ return 1;
+}
@@ -56138,7 +54848,7 @@ index 0000000..7cf9c87
+__u32
+gr_acl_handle_creat(const struct dentry * dentry,
+ const struct dentry * p_dentry,
-+ const struct vfsmount * p_mnt, const int fmode,
++ const struct vfsmount * p_mnt, int open_flags, int acc_mode,
+ const int imode)
+{
+ return 1;
@@ -56427,10 +55137,10 @@ index 0000000..8ca18bf
+}
diff --git a/grsecurity/grsec_init.c b/grsecurity/grsec_init.c
new file mode 100644
-index 0000000..356ef00
+index 0000000..cb8e5a1
--- /dev/null
+++ b/grsecurity/grsec_init.c
-@@ -0,0 +1,269 @@
+@@ -0,0 +1,273 @@
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
@@ -56440,6 +55150,7 @@ index 0000000..356ef00
+#include <linux/percpu.h>
+#include <linux/module.h>
+
++int grsec_enable_setxid;
+int grsec_enable_brute;
+int grsec_enable_link;
+int grsec_enable_dmesg;
@@ -56620,6 +55331,9 @@ index 0000000..356ef00
+#ifdef CONFIG_GRKERNSEC_EXECLOG
+ grsec_enable_execlog = 1;
+#endif
++#ifdef CONFIG_GRKERNSEC_SETXID
++ grsec_enable_setxid = 1;
++#endif
+#ifdef CONFIG_GRKERNSEC_SIGNAL
+ grsec_enable_signal = 1;
+#endif
@@ -57248,10 +55962,10 @@ index 0000000..472c1d6
+}
diff --git a/grsecurity/grsec_sig.c b/grsecurity/grsec_sig.c
new file mode 100644
-index 0000000..cf090b3
+index 0000000..7a5b2de
--- /dev/null
+++ b/grsecurity/grsec_sig.c
-@@ -0,0 +1,206 @@
+@@ -0,0 +1,207 @@
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
@@ -57286,7 +56000,8 @@ index 0000000..cf090b3
+gr_handle_signal(const struct task_struct *p, const int sig)
+{
+#ifdef CONFIG_GRKERNSEC
-+ if (current->pid > 1 && gr_check_protected_task(p)) {
++ /* ignore the 0 signal for protected task checks */
++ if (current->pid > 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)) {
@@ -57710,10 +56425,10 @@ index 0000000..4030d57
+}
diff --git a/grsecurity/grsec_sysctl.c b/grsecurity/grsec_sysctl.c
new file mode 100644
-index 0000000..174668f
+index 0000000..bceef2f
--- /dev/null
+++ b/grsecurity/grsec_sysctl.c
-@@ -0,0 +1,433 @@
+@@ -0,0 +1,442 @@
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/sysctl.h>
@@ -57777,6 +56492,15 @@ index 0000000..174668f
+ .proc_handler = &proc_dointvec,
+ },
+#endif
++#ifdef CONFIG_GRKERNSEC_SETXID
++ {
++ .procname = "consistent_setxid",
++ .data = &grsec_enable_setxid,
++ .maxlen = sizeof(int),
++ .mode = 0600,
++ .proc_handler = &proc_dointvec,
++ },
++#endif
+#ifdef CONFIG_GRKERNSEC_BLACKHOLE
+ {
+ .procname = "ip_blackhole",
@@ -58598,6 +57322,34 @@ index b7babf0..71e4e74 100644
+#endif
+
#endif /* _ASM_GENERIC_ATOMIC_LONG_H */
+diff --git a/include/asm-generic/atomic64.h b/include/asm-generic/atomic64.h
+index b18ce4f..2ee2843 100644
+--- a/include/asm-generic/atomic64.h
++++ b/include/asm-generic/atomic64.h
+@@ -16,6 +16,8 @@ typedef struct {
+ long long counter;
+ } atomic64_t;
+
++typedef atomic64_t atomic64_unchecked_t;
++
+ #define ATOMIC64_INIT(i) { (i) }
+
+ extern long long atomic64_read(const atomic64_t *v);
+@@ -39,4 +41,14 @@ extern int atomic64_add_unless(atomic64_t *v, long long a, long long u);
+ #define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0)
+ #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1LL, 0LL)
+
++#define atomic64_read_unchecked(v) atomic64_read(v)
++#define atomic64_set_unchecked(v, i) atomic64_set((v), (i))
++#define atomic64_add_unchecked(a, v) atomic64_add((a), (v))
++#define atomic64_add_return_unchecked(a, v) atomic64_add_return((a), (v))
++#define atomic64_sub_unchecked(a, v) atomic64_sub((a), (v))
++#define atomic64_inc_unchecked(v) atomic64_inc(v)
++#define atomic64_inc_return_unchecked(v) atomic64_inc_return(v)
++#define atomic64_dec_unchecked(v) atomic64_dec(v)
++#define atomic64_cmpxchg_unchecked(v, o, n) atomic64_cmpxchg((v), (o), (n))
++
+ #endif /* _ASM_GENERIC_ATOMIC64_H */
diff --git a/include/asm-generic/cache.h b/include/asm-generic/cache.h
index 1bfcfe5..e04c5c9 100644
--- a/include/asm-generic/cache.h
@@ -58749,7 +57501,7 @@ index 76bff2b..c7a14e2 100644
#endif /* _ASM_GENERIC_PGTABLE_H */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
-index db22d13..1f2e3e1 100644
+index b5e2e4c..6a5373e 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -217,6 +217,7 @@
@@ -58760,7 +57512,7 @@ index db22d13..1f2e3e1 100644
*(__vermagic) /* Kernel version magic */ \
. = ALIGN(8); \
VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \
-@@ -723,17 +724,18 @@
+@@ -722,17 +723,18 @@
* section in the linker script will go there too. @phdr should have
* a leading colon.
*
@@ -58784,10 +57536,10 @@ index db22d13..1f2e3e1 100644
/**
* PERCPU_SECTION - define output section for percpu area, simple version
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index 738b3a5..eb6ba6f 100644
+index 1f9e951..14ef517 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
-@@ -73,6 +73,7 @@
+@@ -72,6 +72,7 @@
#include <linux/workqueue.h>
#include <linux/poll.h>
#include <asm/pgalloc.h>
@@ -58795,7 +57547,7 @@ index 738b3a5..eb6ba6f 100644
#include "drm.h"
#include <linux/idr.h>
-@@ -1033,7 +1034,7 @@ struct drm_device {
+@@ -1038,7 +1039,7 @@ struct drm_device {
/** \name Usage Counters */
/*@{ */
@@ -58804,7 +57556,7 @@ index 738b3a5..eb6ba6f 100644
atomic_t ioctl_count; /**< Outstanding IOCTLs pending */
atomic_t vma_count; /**< Outstanding vma areas open */
int buf_use; /**< Buffers in use -- cannot alloc */
-@@ -1044,7 +1045,7 @@ struct drm_device {
+@@ -1049,7 +1050,7 @@ struct drm_device {
/*@{ */
unsigned long counters;
enum drm_stat_type types[15];
@@ -58836,7 +57588,7 @@ index 73b0712..0b7ef2f 100644
struct drm_connector_helper_funcs {
int (*get_modes)(struct drm_connector *connector);
diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h
-index b199170..6f9e64c 100644
+index 26c1f78..6722682 100644
--- a/include/drm/ttm/ttm_memory.h
+++ b/include/drm/ttm/ttm_memory.h
@@ -47,7 +47,7 @@
@@ -58868,7 +57620,7 @@ index e86dfca..40cc55f 100644
#define N_MAGIC(exec) ((exec).a_info & 0xffff)
#endif
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
-index 381f4ce..6e875a6 100644
+index 49a83ca..df96b54 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -237,7 +237,7 @@ struct compat_atm_iobuf {
@@ -58881,7 +57633,7 @@ index 381f4ce..6e875a6 100644
#undef __HANDLE_ITEM
};
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
-index 8845613..e36114a 100644
+index fd88a39..f4d0bad 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -88,6 +88,7 @@ struct linux_binfmt {
@@ -58893,10 +57645,20 @@ index 8845613..e36114a 100644
};
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
-index 1a23722..83a14fd 100644
+index 94acd81..3ab569b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
-@@ -1308,7 +1308,7 @@ struct block_device_operations {
+@@ -675,6 +675,9 @@ extern int blk_insert_cloned_request(struct request_queue *q,
+ struct request *rq);
+ extern void blk_delay_queue(struct request_queue *, unsigned long);
+ extern void blk_recount_segments(struct request_queue *, struct bio *);
++extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int);
++extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t,
++ unsigned int, void __user *);
+ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
+ unsigned int, void __user *);
+ extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
+@@ -1312,7 +1315,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;
@@ -58906,10 +57668,10 @@ index 1a23722..83a14fd 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 8c7c2de..390e06f 100644
+index 4d1a074..88f929a 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
-@@ -161,7 +161,7 @@ struct blk_trace {
+@@ -162,7 +162,7 @@ struct blk_trace {
struct dentry *dir;
struct dentry *dropped_file;
struct dentry *msg_file;
@@ -59002,10 +57764,10 @@ 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 c421123..e343179 100644
+index a63d13d..069bfd5 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
-@@ -547,6 +547,9 @@ extern bool capable(int cap);
+@@ -548,6 +548,9 @@ extern bool capable(int cap);
extern bool ns_capable(struct user_namespace *ns, int cap);
extern bool task_ns_capable(struct task_struct *t, int cap);
extern bool nsown_capable(int cap);
@@ -59194,11 +57956,25 @@ index e9eaec5..bfeb9bb 100644
}
static inline void set_mems_allowed(nodemask_t nodemask)
+diff --git a/include/linux/cred.h b/include/linux/cred.h
+index 4030896..8d6f342 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)
+ static inline void validate_process_creds(void)
+ {
+ }
++static inline void validate_task_creds(struct task_struct *task)
++{
++}
+ #endif
+
+ /**
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
-index a6a7a1c..d4364d4 100644
+index 8a94217..15d49e3 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
-@@ -361,7 +361,7 @@ struct cipher_tfm {
+@@ -365,7 +365,7 @@ struct cipher_tfm {
const u8 *key, unsigned int keylen);
void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
@@ -59207,7 +57983,7 @@ index a6a7a1c..d4364d4 100644
struct hash_tfm {
int (*init)(struct hash_desc *desc);
-@@ -382,13 +382,13 @@ struct compress_tfm {
+@@ -386,13 +386,13 @@ struct compress_tfm {
int (*cot_decompress)(struct crypto_tfm *tfm,
const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen);
@@ -59237,12 +58013,12 @@ index 7925bf0..d5143d2 100644
#define large_malloc(a) vmalloc(a)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
-index ba8319a..10d593f 100644
+index e13117c..e9fc938 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
-@@ -50,7 +50,7 @@ struct dma_map_ops {
- int (*dma_supported)(struct device *dev, u64 mask);
- int (*set_dma_mask)(struct device *dev, u64 mask);
+@@ -46,7 +46,7 @@ struct dma_map_ops {
+ u64 (*get_required_mask)(struct device *dev);
+ #endif
int is_phys;
-};
+} __do_const;
@@ -59250,10 +58026,10 @@ index ba8319a..10d593f 100644
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
diff --git a/include/linux/efi.h b/include/linux/efi.h
-index e376270..5c2338b 100644
+index 2362a0b..cfaf8fcc 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
-@@ -410,7 +410,7 @@ struct efivar_operations {
+@@ -446,7 +446,7 @@ struct efivar_operations {
efi_get_variable_t *get_variable;
efi_get_next_variable_t *get_next_variable;
efi_set_variable_t *set_variable;
@@ -59263,7 +58039,7 @@ index e376270..5c2338b 100644
struct efivars {
/*
diff --git a/include/linux/elf.h b/include/linux/elf.h
-index 110821c..cb14c08 100644
+index 31f0508..5421c01 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -49,6 +49,17 @@ typedef __s64 Elf64_Sxword;
@@ -59322,7 +58098,7 @@ index 110821c..cb14c08 100644
#define ELFMAG0 0x7f /* EI_MAG */
#define ELFMAG1 'E'
#define ELFMAG2 'L'
-@@ -422,6 +450,7 @@ extern Elf32_Dyn _DYNAMIC [];
+@@ -423,6 +451,7 @@ extern Elf32_Dyn _DYNAMIC [];
#define elf_note elf32_note
#define elf_addr_t Elf32_Off
#define Elf_Half Elf32_Half
@@ -59330,7 +58106,7 @@ index 110821c..cb14c08 100644
#else
-@@ -432,6 +461,7 @@ extern Elf64_Dyn _DYNAMIC [];
+@@ -433,6 +462,7 @@ extern Elf64_Dyn _DYNAMIC [];
#define elf_note elf64_note
#define elf_addr_t Elf64_Off
#define Elf_Half Elf64_Half
@@ -59338,8 +58114,30 @@ index 110821c..cb14c08 100644
#endif
+diff --git a/include/linux/filter.h b/include/linux/filter.h
+index 8eeb205..d59bfa2 100644
+--- a/include/linux/filter.h
++++ b/include/linux/filter.h
+@@ -134,6 +134,7 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
+
+ struct sk_buff;
+ struct sock;
++struct bpf_jit_work;
+
+ struct sk_filter
+ {
+@@ -141,6 +142,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);
++#ifdef CONFIG_BPF_JIT
++ struct bpf_jit_work *work;
++#endif
+ struct rcu_head rcu;
+ struct sock_filter insns[0];
+ };
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
-index 5e6f427..953d4f8 100644
+index 84ccf8e..2e9b14c 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -428,7 +428,7 @@ struct fw_iso_context {
@@ -59352,22 +58150,10 @@ index 5e6f427..953d4f8 100644
};
diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 7b17db7..f586116 100644
+index e0bc4ff..d79c2fa 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -109,6 +109,11 @@ struct inodes_stat_t {
- /* File was opened by fanotify and shouldn't generate fanotify events */
- #define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
-
-+/* Hack for grsec so as not to require read permission simply to execute
-+ * a binary
-+ */
-+#define FMODE_GREXEC ((__force fmode_t)0x2000000)
-+
- /*
- * The below are the various read and write types that we support. Some of
- * them include behavioral modifiers that send information down to the
-@@ -1571,7 +1576,8 @@ struct file_operations {
+@@ -1608,7 +1608,8 @@ struct file_operations {
int (*setlease)(struct file *, long, struct file_lock **);
long (*fallocate)(struct file *file, int mode, loff_t offset,
loff_t len);
@@ -59375,8 +58161,8 @@ index 7b17db7..f586116 100644
+} __do_const;
+typedef struct file_operations __no_const file_operations_no_const;
- #define IPERM_FLAG_RCU 0x0001
-
+ struct inode_operations {
+ struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 003dc0f..3c4ea97 100644
--- a/include/linux/fs_struct.h
@@ -59391,7 +58177,7 @@ index 003dc0f..3c4ea97 100644
seqcount_t seq;
int umask;
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
-index af095b5..cf1220c 100644
+index ce31408..b1ad003 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -102,7 +102,7 @@ struct fscache_operation {
@@ -59425,11 +58211,23 @@ index 2a53f10..0187fdf 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 59d3ef1..a581c4f 100644
+index c3da42d..c70e0df 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
-@@ -96,7 +96,7 @@ struct trace_event_functions {
+@@ -97,7 +97,7 @@ struct trace_event_functions {
trace_print_func raw;
trace_print_func hex;
trace_print_func binary;
@@ -59438,7 +58236,7 @@ index 59d3ef1..a581c4f 100644
struct trace_event {
struct hlist_node node;
-@@ -247,7 +247,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type,
+@@ -254,7 +254,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);
@@ -59448,10 +58246,10 @@ index 59d3ef1..a581c4f 100644
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 300d758..3cf72e8 100644
+index 6d18f35..ab71e2c 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
-@@ -184,7 +184,7 @@ struct gendisk {
+@@ -185,7 +185,7 @@ struct gendisk {
struct kobject *slave_dir;
struct timer_rand_state *random;
@@ -60286,10 +59084,10 @@ index 0000000..9d5fd4a
+#define GR_INIT_TRANSFER_MSG "persistent special role transferred privilege to init by "
diff --git a/include/linux/grsecurity.h b/include/linux/grsecurity.h
new file mode 100644
-index 0000000..9a067c3
+index 0000000..4620f36
--- /dev/null
+++ b/include/linux/grsecurity.h
-@@ -0,0 +1,228 @@
+@@ -0,0 +1,231 @@
+#ifndef GR_SECURITY_H
+#define GR_SECURITY_H
+#include <linux/fs.h>
@@ -60447,11 +59245,11 @@ index 0000000..9a067c3
+__u32 gr_acl_handle_hidden_file(const struct dentry *dentry,
+ const struct vfsmount *mnt);
+__u32 gr_acl_handle_open(const struct dentry *dentry,
-+ const struct vfsmount *mnt, const int fmode);
++ const struct vfsmount *mnt, int acc_mode);
+__u32 gr_acl_handle_creat(const struct dentry *dentry,
+ const struct dentry *p_dentry,
-+ const struct vfsmount *p_mnt, const int fmode,
-+ const int imode);
++ const struct vfsmount *p_mnt,
++ int open_flags, int acc_mode, const int imode);
+void gr_handle_create(const struct dentry *dentry,
+ const struct vfsmount *mnt);
+void gr_handle_proc_create(const struct dentry *dentry,
@@ -60515,6 +59313,9 @@ index 0000000..9a067c3
+#ifdef CONFIG_GRKERNSEC_CHROOT_FINDTASK
+extern int grsec_enable_chroot_findtask;
+#endif
++#ifdef CONFIG_GRKERNSEC_SETXID
++extern int grsec_enable_setxid;
++#endif
+#endif
+
+#endif
@@ -60544,10 +59345,10 @@ index 0000000..e7ffaaf
+
+#endif
diff --git a/include/linux/hid.h b/include/linux/hid.h
-index 42f7e2f..da8098f 100644
+index c235e4e..f0cf7a0 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
-@@ -675,7 +675,7 @@ struct hid_ll_driver {
+@@ -679,7 +679,7 @@ struct hid_ll_driver {
unsigned int code, int value);
int (*parse)(struct hid_device *hdev);
@@ -60580,10 +59381,10 @@ index 3a93f73..b19d0b3 100644
unsigned start1, unsigned end1,
unsigned start2, unsigned end2)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
-index a6c652e..1f5878f 100644
+index 07d103a..04ec65b 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
-@@ -346,6 +346,7 @@ struct i2c_algorithm {
+@@ -364,6 +364,7 @@ struct i2c_algorithm {
/* To determine what the adapter supports */
u32 (*functionality) (struct i2c_adapter *);
};
@@ -60625,12 +59426,12 @@ index 9146f39..885354d 100644
void cleanup_module(void) __attribute__((alias(#exitfn)));
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
-index 580f70c..7213e59 100644
+index 32574ee..00d4ef1 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
-@@ -126,6 +126,12 @@ extern struct cred init_cred;
- # define INIT_PERF_EVENTS(tsk)
- #endif
+@@ -128,6 +128,12 @@ extern struct cred init_cred;
+
+ #define INIT_TASK_COMM "swapper"
+#ifdef CONFIG_X86
+#define INIT_TASK_THREAD_INFO .tinfo = INIT_THREAD_INFO,
@@ -60641,16 +59442,16 @@ index 580f70c..7213e59 100644
/*
* INIT_TASK is used to set up the first task table, touch at
* your own risk!. Base=0, limit=0x1fffff (=2MB)
-@@ -164,6 +170,7 @@ extern struct cred init_cred;
+@@ -166,6 +172,7 @@ extern struct cred init_cred;
RCU_INIT_POINTER(.cred, &init_cred), \
- .comm = "swapper", \
+ .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 9310c69..6ebb244 100644
+index e6ca56d..8583707 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -296,7 +296,7 @@ struct iommu_flush {
@@ -60663,10 +59464,10 @@ index 9310c69..6ebb244 100644
enum {
SR_DMAR_FECTL_REG,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
-index b9490bf..f924abb 100644
+index a64b00e..464d8bc 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
-@@ -425,7 +425,7 @@ enum
+@@ -441,7 +441,7 @@ enum
/* map softirq index to softirq name. update 'softirq_to_name' in
* kernel/softirq.c when adding a new softirq.
*/
@@ -60675,7 +59476,7 @@ index b9490bf..f924abb 100644
/* softirq mask and active fields moved to irq_cpustat_t in
* asm/hardirq.h to get better cache usage. KAO
-@@ -433,12 +433,12 @@ extern char *softirq_to_name[NR_SOFTIRQS];
+@@ -449,12 +449,12 @@ extern char *softirq_to_name[NR_SOFTIRQS];
struct softirq_action
{
@@ -60691,7 +59492,7 @@ index b9490bf..f924abb 100644
static inline void __raise_softirq_irqoff(unsigned int nr)
{
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
-index 0df513b..fe901a2 100644
+index 3875719..4cd454c 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -15,7 +15,8 @@
@@ -60709,7 +59510,7 @@ index 0df513b..fe901a2 100644
#define __print_symbol(fmt, addr)
#endif /*CONFIG_KALLSYMS*/
+#else /* when included by kallsyms.c, vsnprintf.c, or
-+ arch/x86/kernel/dumpstack.c, with HIDESYM enabled */
++ arch/x86/kernel/dumpstack.c, with HIDESYM enabled */
+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);
@@ -60720,9 +59521,9 @@ index 0df513b..fe901a2 100644
+#endif
/* This macro allows us to keep printk typechecking */
- static void __check_printsym_format(const char *fmt, ...)
+ static __printf(1, 2)
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
-index 10ca03d..b8377b8 100644
+index fa39183..40160be 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -53,7 +53,7 @@ extern int kgdb_connected;
@@ -60753,23 +59554,23 @@ index 10ca03d..b8377b8 100644
extern struct kgdb_arch arch_kgdb_ops;
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
-index 0da38cf..d23f05f 100644
+index b16f653..eb908f4 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -34,6 +34,8 @@ extern char modprobe_path[]; /* for sysctl */
* usually useless though. */
- extern int __request_module(bool wait, const char *name, ...) \
- __attribute__((format(printf, 2, 3)));
-+extern int ___request_module(bool wait, char *param_name, const char *name, ...) \
-+ __attribute__((format(printf, 3, 4)));
+ extern __printf(2, 3)
+ int __request_module(bool wait, const char *name, ...);
++extern __printf(3, 4)
++int ___request_module(bool wait, char *param_name, const char *name, ...);
#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/kvm_host.h b/include/linux/kvm_host.h
-index 31ebb59..ac2ba16 100644
+index d526231..086e89b 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
-@@ -307,7 +307,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
+@@ -308,7 +308,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
void vcpu_load(struct kvm_vcpu *vcpu);
void vcpu_put(struct kvm_vcpu *vcpu);
@@ -60778,7 +59579,7 @@ index 31ebb59..ac2ba16 100644
struct module *module);
void kvm_exit(void);
-@@ -446,7 +446,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
+@@ -454,7 +454,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);
@@ -60788,10 +59589,10 @@ index 31ebb59..ac2ba16 100644
int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu);
diff --git a/include/linux/libata.h b/include/linux/libata.h
-index 5a9926b..a65f599 100644
+index cafc09a..d7e7829 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
-@@ -899,7 +899,7 @@ struct ata_port_operations {
+@@ -909,7 +909,7 @@ struct ata_port_operations {
* fields must be pointers.
*/
const struct ata_port_operations *inherits;
@@ -60827,10 +59628,10 @@ index 935699b..11042cc 100644
/*
* 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 896b5e4..1159ad0 100644
+index 9970337..9444122 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
-@@ -234,6 +234,7 @@ struct abx500_ops {
+@@ -188,6 +188,7 @@ struct abx500_ops {
int (*event_registers_startup_state_get) (struct device *, u8 *);
int (*startup_irq_enabled) (struct device *, unsigned int);
};
@@ -60839,10 +59640,10 @@ index 896b5e4..1159ad0 100644
int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
void abx500_remove_ops(struct device *dev);
diff --git a/include/linux/mm.h b/include/linux/mm.h
-index 18eea05..9f9aec0 100644
+index 4baadd1..2e0b45e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
-@@ -113,7 +113,14 @@ extern unsigned int kobjsize(const void *objp);
+@@ -115,7 +115,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 */
@@ -60857,7 +59658,7 @@ index 18eea05..9f9aec0 100644
#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */
#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */
-@@ -1008,34 +1015,6 @@ int set_page_dirty(struct page *page);
+@@ -1012,34 +1019,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);
@@ -60892,9 +59693,9 @@ index 18eea05..9f9aec0 100644
extern unsigned long move_page_tables(struct vm_area_struct *vma,
unsigned long old_addr, struct vm_area_struct *new_vma,
unsigned long new_addr, unsigned long len);
-@@ -1168,6 +1147,15 @@ struct shrinker {
- extern void register_shrinker(struct shrinker *);
- extern void unregister_shrinker(struct shrinker *);
+@@ -1134,6 +1113,15 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
+ }
+ #endif
+#ifdef CONFIG_MMU
+pgprot_t vm_get_page_prot(vm_flags_t vm_flags);
@@ -60908,7 +59709,7 @@ index 18eea05..9f9aec0 100644
int vma_wants_writenotify(struct vm_area_struct *vma);
extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
-@@ -1451,6 +1439,7 @@ out:
+@@ -1419,6 +1407,7 @@ out:
}
extern int do_munmap(struct mm_struct *, unsigned long, size_t);
@@ -60916,7 +59717,7 @@ index 18eea05..9f9aec0 100644
extern unsigned long do_brk(unsigned long, unsigned long);
-@@ -1509,6 +1498,10 @@ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long add
+@@ -1476,6 +1465,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);
@@ -60927,7 +59728,7 @@ index 18eea05..9f9aec0 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)
-@@ -1525,15 +1518,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
+@@ -1492,15 +1485,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
}
@@ -60943,7 +59744,7 @@ index 18eea05..9f9aec0 100644
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);
-@@ -1646,7 +1630,7 @@ extern int unpoison_memory(unsigned long pfn);
+@@ -1614,7 +1598,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);
@@ -60952,7 +59753,7 @@ index 18eea05..9f9aec0 100644
extern int soft_offline_page(struct page *page, int flags);
extern void dump_page(struct page *page);
-@@ -1660,5 +1644,11 @@ extern void copy_user_huge_page(struct page *dst, struct page *src,
+@@ -1628,5 +1612,11 @@ extern void copy_user_huge_page(struct page *dst, struct page *src,
unsigned int pages_per_huge_page);
#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
@@ -60965,10 +59766,10 @@ index 18eea05..9f9aec0 100644
#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index 059839c..221ca49 100644
+index 5b42f1b..759e4b4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
-@@ -198,6 +198,8 @@ struct vm_area_struct {
+@@ -253,6 +253,8 @@ struct vm_area_struct {
#ifdef CONFIG_NUMA
struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif
@@ -60977,12 +59778,12 @@ index 059839c..221ca49 100644
};
struct core_thread {
-@@ -330,6 +332,24 @@ struct mm_struct {
+@@ -389,6 +391,24 @@ struct mm_struct {
#ifdef CONFIG_CPUMASK_OFFSTACK
struct cpumask cpumask_allocation;
#endif
+
-+#if defined(CONFIG_PAX_EI_PAX) || defined(CONFIG_PAX_PT_PAX_FLAGS) || defined(CONFIG_PAX_NOEXEC) || defined(CONFIG_PAX_ASLR)
++#if defined(CONFIG_PAX_NOEXEC) || defined(CONFIG_PAX_ASLR)
+ unsigned long pax_flags;
+#endif
+
@@ -61023,10 +59824,10 @@ index 1d1b1e1..2a13c78 100644
#define pmdp_clear_flush_notify(__vma, __address, __pmdp) \
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index 9f7c3eb..6d94953 100644
+index 188cb2f..d78409b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
-@@ -350,7 +350,7 @@ struct zone {
+@@ -369,7 +369,7 @@ struct zone {
unsigned long flags; /* zone flags, see below */
/* Zone statistics */
@@ -61036,7 +59837,7 @@ index 9f7c3eb..6d94953 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 ae28e93..1ac2233 100644
+index 468819c..17b9db3 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -12,7 +12,7 @@
@@ -61058,18 +59859,18 @@ index ae28e93..1ac2233 100644
struct hid_device_id {
__u16 bus;
diff --git a/include/linux/module.h b/include/linux/module.h
-index d9ca2d5..ff42270 100644
+index 3cb7839..511cb87 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
-@@ -16,6 +16,7 @@
- #include <linux/kobject.h>
+@@ -17,6 +17,7 @@
#include <linux/moduleparam.h>
#include <linux/tracepoint.h>
+ #include <linux/export.h>
+#include <linux/fs.h>
#include <linux/percpu.h>
#include <asm/module.h>
-@@ -325,19 +326,16 @@ struct module
+@@ -261,19 +262,16 @@ struct module
int (*init)(void);
/* If this is non-NULL, vfree after init() returns */
@@ -61093,7 +59894,7 @@ index d9ca2d5..ff42270 100644
/* Arch-specific module values */
struct mod_arch_specific arch;
-@@ -393,6 +391,10 @@ struct module
+@@ -329,6 +327,10 @@ struct module
#ifdef CONFIG_EVENT_TRACING
struct ftrace_event_call **trace_events;
unsigned int num_trace_events;
@@ -61104,7 +59905,7 @@ index d9ca2d5..ff42270 100644
#endif
#ifdef CONFIG_FTRACE_MCOUNT_RECORD
unsigned int num_ftrace_callsites;
-@@ -443,16 +445,46 @@ bool is_module_address(unsigned long addr);
+@@ -379,16 +381,46 @@ bool is_module_address(unsigned long addr);
bool is_module_percpu_address(unsigned long addr);
bool is_module_text_address(unsigned long addr);
@@ -61156,10 +59957,10 @@ index d9ca2d5..ff42270 100644
/* Search for module by name: must hold module_mutex. */
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
-index c1f40c2..682ca53 100644
+index b2be02e..6a9fdb1 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
-@@ -20,9 +20,21 @@ unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section);
+@@ -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);
@@ -61182,10 +59983,10 @@ index c1f40c2..682ca53 100644
or 0. */
int apply_relocate(Elf_Shdr *sechdrs,
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
-index ddaae98..3c70938 100644
+index 7939f63..ec6df57 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
-@@ -255,7 +255,7 @@ static inline void __kernel_param_unlock(void)
+@@ -260,7 +260,7 @@ static inline void __kernel_param_unlock(void)
* @len is usually just sizeof(string).
*/
#define module_param_string(name, string, len, perm) \
@@ -61194,7 +59995,7 @@ index ddaae98..3c70938 100644
= { len, string }; \
__module_param_call(MODULE_PARAM_PREFIX, name, \
&param_ops_string, \
-@@ -370,7 +370,7 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp);
+@@ -395,7 +395,7 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp);
* module_param_named() for why this might be necessary.
*/
#define module_param_array_named(name, array, type, nump, perm) \
@@ -61204,7 +60005,7 @@ index ddaae98..3c70938 100644
.ops = &param_ops_##type, \
.elemsize = sizeof(array[0]), .elem = array }; \
diff --git a/include/linux/namei.h b/include/linux/namei.h
-index 82ab16b..b8b7507 100644
+index ffc0213..2c1f2cb 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -24,7 +24,7 @@ struct nameidata {
@@ -61216,7 +60017,7 @@ index 82ab16b..b8b7507 100644
/* Intent data */
union {
-@@ -93,12 +93,12 @@ extern int follow_up(struct path *);
+@@ -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 *);
@@ -61232,10 +60033,10 @@ index 82ab16b..b8b7507 100644
return nd->saved_names[nd->depth];
}
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 33b5968..f54dcc2 100644
+index a82ad4d..be68b4b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -979,6 +979,7 @@ struct net_device_ops {
+@@ -949,6 +949,7 @@ struct net_device_ops {
int (*ndo_set_features)(struct net_device *dev,
u32 features);
};
@@ -61272,7 +60073,7 @@ index c65a18a..0c05f3a 100644
extern void *prom_early_alloc(unsigned long size);
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
-index 7f5cfd3..972690a 100644
+index a4c5624..79d6d88 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -139,9 +139,9 @@ int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root,
@@ -61301,10 +60102,10 @@ index 4633b2f..988bc08 100644
atomic_t refcnt;
unsigned int max_seq_nr;
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
-index e0786e3..4bd9d78 100644
+index b1f8912..c955bff 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
-@@ -761,8 +761,8 @@ struct perf_event {
+@@ -748,8 +748,8 @@ struct perf_event {
enum perf_event_active_state state;
unsigned int attach_state;
@@ -61315,7 +60116,7 @@ index e0786e3..4bd9d78 100644
/*
* These are the total time in nanoseconds that the event
-@@ -813,8 +813,8 @@ struct perf_event {
+@@ -800,8 +800,8 @@ struct perf_event {
* These accumulate total time (in nanoseconds) that children
* events have been enabled and running, respectively.
*/
@@ -61344,10 +60145,10 @@ index 77257c9..51d473a 100644
unsigned int w_counter;
struct page *tmp_page;
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index 878cf84..cd967ec 100644
+index d3085e7..fd01052 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
-@@ -94,7 +94,7 @@ static inline bool pm_runtime_callbacks_present(struct device *dev)
+@@ -95,7 +95,7 @@ static inline bool pm_runtime_callbacks_present(struct device *dev)
static inline void pm_runtime_mark_last_busy(struct device *dev)
{
@@ -61357,7 +60158,7 @@ index 878cf84..cd967ec 100644
#else /* !CONFIG_PM_RUNTIME */
diff --git a/include/linux/poison.h b/include/linux/poison.h
-index 2110a81..13a11bb 100644
+index 79159de..f1233a9 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -19,8 +19,8 @@
@@ -61372,10 +60173,10 @@ index 2110a81..13a11bb 100644
/********** include/linux/timer.h **********/
/*
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
-index 2e681d9..7f461b6 100644
+index 58969b2..ead129b 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
-@@ -115,7 +115,7 @@ struct preempt_ops {
+@@ -123,7 +123,7 @@ struct preempt_ops {
void (*sched_in)(struct preempt_notifier *notifier, int cpu);
void (*sched_out)(struct preempt_notifier *notifier,
struct task_struct *next);
@@ -61385,7 +60186,7 @@ index 2e681d9..7f461b6 100644
/**
* preempt_notifier - key for installing preemption notifiers
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
-index e7576cf..2453391 100644
+index 643b96c..ef55a9c 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -155,6 +155,19 @@ static inline struct proc_dir_entry *proc_create(const char *name, mode_t mode,
@@ -61418,10 +60219,10 @@ index e7576cf..2453391 100644
struct ctl_table_header;
struct ctl_table;
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
-index 9178d5c..ff0a136 100644
+index 800f113..e9ee2e3 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
-@@ -115,10 +115,10 @@ extern void __ptrace_unlink(struct task_struct *child);
+@@ -129,10 +129,12 @@ extern void __ptrace_unlink(struct task_struct *child);
extern void exit_ptrace(struct task_struct *tracer);
#define PTRACE_MODE_READ 1
#define PTRACE_MODE_ATTACH 2
@@ -61431,11 +60232,13 @@ index 9178d5c..ff0a136 100644
extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
+/* Returns true on success, false on denial. */
+extern bool ptrace_may_access_log(struct task_struct *task, unsigned int mode);
++/* Returns true on success, false on denial. */
++extern bool ptrace_may_access_nolock(struct task_struct *task, unsigned int mode);
static inline int ptrace_reparented(struct task_struct *child)
{
diff --git a/include/linux/random.h b/include/linux/random.h
-index d13059f..2eaafaa 100644
+index 8f74538..02a1012 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -69,12 +69,17 @@ void srandom32(u32 seed);
@@ -61458,10 +60261,10 @@ index d13059f..2eaafaa 100644
/**
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
-index 3005d5a..77c2dba 100644
+index e0879a7..a12f962 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
-@@ -47,9 +47,9 @@ extern int unregister_reboot_notifier(struct notifier_block *);
+@@ -52,9 +52,9 @@ extern int unregister_reboot_notifier(struct notifier_block *);
* Architecture-specific implementations of sys_reboot commands.
*/
@@ -61474,7 +60277,7 @@ index 3005d5a..77c2dba 100644
extern void machine_shutdown(void);
struct pt_regs;
-@@ -60,9 +60,9 @@ extern void machine_crash_shutdown(struct pt_regs *);
+@@ -65,9 +65,9 @@ extern void machine_crash_shutdown(struct pt_regs *);
*/
extern void kernel_restart_prepare(char *cmd);
@@ -61487,7 +60290,7 @@ index 3005d5a..77c2dba 100644
extern int C_A_D; /* for sysctl */
void ctrl_alt_del(void);
-@@ -76,7 +76,7 @@ extern int orderly_poweroff(bool force);
+@@ -81,7 +81,7 @@ extern int orderly_poweroff(bool force);
* Emergency restart, callable from an interrupt handler.
*/
@@ -61497,7 +60300,7 @@ index 3005d5a..77c2dba 100644
#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
-index eca75df..97897d4 100644
+index 96d465f..b084e05 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1406,7 +1406,7 @@ static inline loff_t max_reiserfs_offset(struct inode *inode)
@@ -61547,6 +60350,19 @@ index c6c6084..5bf1212 100644
#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
/**
+diff --git a/include/linux/rio.h b/include/linux/rio.h
+index 4d50611..c6858a2 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);
+-};
++} __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 2148b12..519b820 100644
--- a/include/linux/rmap.h
@@ -61563,10 +60379,10 @@ index 2148b12..519b820 100644
static inline void anon_vma_merge(struct vm_area_struct *vma,
diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 4ef452b..f9c902f 100644
+index 1c4f3e9..e96dced 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -100,6 +100,7 @@ struct bio_list;
+@@ -101,6 +101,7 @@ struct bio_list;
struct fs_struct;
struct perf_event_context;
struct blk_plug;
@@ -61618,7 +60434,7 @@ index 4ef452b..f9c902f 100644
/* Hash table maintenance information */
struct hlist_node uidhash_node;
uid_t uid;
-@@ -1340,8 +1360,8 @@ struct task_struct {
+@@ -1337,8 +1357,8 @@ struct task_struct {
struct list_head thread_group;
struct completion *vfork_done; /* for vfork() */
@@ -61629,7 +60445,7 @@ index 4ef452b..f9c902f 100644
cputime_t utime, stime, utimescaled, stimescaled;
cputime_t gtime;
-@@ -1357,13 +1377,6 @@ struct task_struct {
+@@ -1354,13 +1374,6 @@ struct task_struct {
struct task_cputime cputime_expires;
struct list_head cpu_timers[3];
@@ -61643,7 +60459,7 @@ index 4ef452b..f9c902f 100644
char comm[TASK_COMM_LEN]; /* executable name excluding path
- access with [gs]et_task_comm (which lock
it with task_lock())
-@@ -1380,8 +1393,16 @@ struct task_struct {
+@@ -1377,8 +1390,16 @@ struct task_struct {
#endif
/* CPU-specific state of this task */
struct thread_struct thread;
@@ -61660,7 +60476,7 @@ index 4ef452b..f9c902f 100644
/* open file information */
struct files_struct *files;
/* namespaces */
-@@ -1428,6 +1449,11 @@ struct task_struct {
+@@ -1425,6 +1446,11 @@ struct task_struct {
struct rt_mutex_waiter *pi_blocked_on;
#endif
@@ -61672,13 +60488,14 @@ index 4ef452b..f9c902f 100644
#ifdef CONFIG_DEBUG_MUTEXES
/* mutex deadlock detection */
struct mutex_waiter *blocked_on;
-@@ -1538,6 +1564,21 @@ struct task_struct {
+@@ -1540,6 +1566,22 @@ struct task_struct {
unsigned long default_timer_slack_ns;
struct list_head *scm_work_list;
+
+#ifdef CONFIG_GRKERNSEC
+ /* grsecurity */
++ const struct cred *delayed_cred;
+ struct dentry *gr_chroot_dentry;
+ struct acl_subject_label *acl;
+ struct acl_role_label *role;
@@ -61694,7 +60511,7 @@ index 4ef452b..f9c902f 100644
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
/* Index of current stored address in ret_stack */
int curr_ret_stack;
-@@ -1572,6 +1613,57 @@ struct task_struct {
+@@ -1574,6 +1616,51 @@ struct task_struct {
#endif
};
@@ -61739,28 +60556,14 @@ index 4ef452b..f9c902f 100644
+#endif
+
+extern void pax_report_fault(struct pt_regs *regs, void *pc, void *sp);
-+extern void pax_report_insns(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 NORET_TYPE void pax_report_usercopy(const void *ptr, unsigned long len, bool to, const char *type) ATTRIB_NORET;
+
-+#ifdef CONFIG_PAX_MEMORY_STACKLEAK
-+extern void pax_track_stack(void);
-+#else
-+static inline void pax_track_stack(void) {}
-+#endif
-+
/* Future-safe accessor for struct task_struct's cpus_allowed. */
#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
-@@ -1768,6 +1860,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
- #define PF_DUMPCORE 0x00000200 /* dumped core */
- #define PF_SIGNALED 0x00000400 /* killed by a signal */
- #define PF_MEMALLOC 0x00000800 /* Allocating memory */
-+#define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */
- #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
- #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
- #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
-@@ -2055,7 +2148,9 @@ void yield(void);
+@@ -2081,7 +2168,9 @@ void yield(void);
extern struct exec_domain default_exec_domain;
union thread_union {
@@ -61770,7 +60573,7 @@ index 4ef452b..f9c902f 100644
unsigned long stack[THREAD_SIZE/sizeof(long)];
};
-@@ -2088,6 +2183,7 @@ extern struct pid_namespace init_pid_ns;
+@@ -2114,6 +2203,7 @@ extern struct pid_namespace init_pid_ns;
*/
extern struct task_struct *find_task_by_vpid(pid_t nr);
@@ -61778,7 +60581,7 @@ index 4ef452b..f9c902f 100644
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
struct pid_namespace *ns);
-@@ -2224,7 +2320,7 @@ extern void __cleanup_sighand(struct sighand_struct *);
+@@ -2251,7 +2341,7 @@ extern void __cleanup_sighand(struct sighand_struct *);
extern void exit_itimers(struct signal_struct *);
extern void flush_itimer_signals(void);
@@ -61787,7 +60590,7 @@ index 4ef452b..f9c902f 100644
extern void daemonize(const char *, ...);
extern int allow_signal(int);
-@@ -2392,13 +2488,17 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
+@@ -2416,13 +2506,17 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
#endif
@@ -61822,22 +60625,22 @@ index 899fbb4..1cb4138 100644
#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */
diff --git a/include/linux/security.h b/include/linux/security.h
-index 8ce59ef..09f5fc3 100644
+index e8c619d..e0cbd1c 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
-@@ -36,6 +36,7 @@
- #include <linux/key.h>
+@@ -37,6 +37,7 @@
#include <linux/xfrm.h>
#include <linux/slab.h>
+ #include <linux/xattr.h>
+#include <linux/grsecurity.h>
#include <net/flow.h>
/* Maximum number of letters for an LSM name string */
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
-index 03c0232..54a4671 100644
+index 0b69a46..e9e5538 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
-@@ -32,6 +32,7 @@ struct seq_operations {
+@@ -33,6 +33,7 @@ struct seq_operations {
void * (*next) (struct seq_file *m, void *v, loff_t *pos);
int (*show) (struct seq_file *m, void *v);
};
@@ -61846,13 +60649,13 @@ index 03c0232..54a4671 100644
#define SEQ_SKIP 1
diff --git a/include/linux/shm.h b/include/linux/shm.h
-index eca6235..c7417ed 100644
+index 92808b8..c28cac4 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
-@@ -95,6 +95,10 @@ struct shmid_kernel /* private to the kernel */
- pid_t shm_cprid;
- pid_t shm_lprid;
- struct user_struct *mlock_user;
+@@ -98,6 +98,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;
+#ifdef CONFIG_GRKERNSEC
+ time_t shm_createtime;
+ pid_t shm_lapid;
@@ -61860,24 +60663,11 @@ index eca6235..c7417ed 100644
};
/* shm_mode upper byte flags */
-diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
-index aa08fa8..a533701 100644
---- a/include/linux/shmem_fs.h
-+++ b/include/linux/shmem_fs.h
-@@ -10,7 +10,7 @@
-
- #define SHMEM_NR_DIRECT 16
-
--#define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t))
-+#define SHMEM_SYMLINK_INLINE_LEN 64
-
- struct shmem_inode_info {
- spinlock_t lock;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
-index b920a72..05c678b 100644
+index fe86488..1563c1c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -592,7 +592,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
+@@ -642,7 +642,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)
{
@@ -61886,7 +60676,7 @@ index b920a72..05c678b 100644
}
/**
-@@ -605,7 +605,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
+@@ -655,7 +655,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)
{
@@ -61895,7 +60685,7 @@ index b920a72..05c678b 100644
}
/**
-@@ -618,7 +618,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
+@@ -668,7 +668,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)
{
@@ -61904,7 +60694,7 @@ index b920a72..05c678b 100644
}
/**
-@@ -1440,7 +1440,7 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
+@@ -1523,7 +1523,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
@@ -61914,7 +60704,7 @@ index b920a72..05c678b 100644
extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
diff --git a/include/linux/slab.h b/include/linux/slab.h
-index ad4dd1c..0e42601 100644
+index 573c809..e84c132 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -11,12 +11,20 @@
@@ -61955,7 +60745,7 @@ index ad4dd1c..0e42601 100644
/*
* struct kmem_cache related prototypes
-@@ -141,6 +152,7 @@ void * __must_check krealloc(const void *, size_t, gfp_t);
+@@ -161,6 +172,7 @@ void * __must_check krealloc(const void *, size_t, gfp_t);
void kfree(const void *);
void kzfree(const void *);
size_t ksize(const void *);
@@ -61963,7 +60753,7 @@ index ad4dd1c..0e42601 100644
/*
* Allocator specific definitions. These are mainly used to establish optimized
-@@ -333,4 +345,59 @@ static inline void *kzalloc_node(size_t size, gfp_t flags, int node)
+@@ -353,4 +365,59 @@ static inline void *kzalloc_node(size_t size, gfp_t flags, int node)
void __init kmem_cache_init_late(void);
@@ -62024,10 +60814,10 @@ index ad4dd1c..0e42601 100644
+
#endif /* _LINUX_SLAB_H */
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
-index 83203ae..855726b 100644
+index d00e0ba..1b3bf7b 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
-@@ -96,10 +96,10 @@ struct kmem_cache {
+@@ -68,10 +68,10 @@ struct kmem_cache {
unsigned long node_allocs;
unsigned long node_frees;
unsigned long node_overflow;
@@ -62043,10 +60833,10 @@ index 83203ae..855726b 100644
/*
* If debugging is enabled, then the allocator can add additional
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
-index c8668d1..39dd7c2 100644
+index a32bcfd..53b71f4 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
-@@ -82,7 +82,7 @@ struct kmem_cache {
+@@ -89,7 +89,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 */
@@ -62055,7 +60845,7 @@ index c8668d1..39dd7c2 100644
void (*ctor)(void *);
int inuse; /* Offset to metadata */
int align; /* Alignment */
-@@ -218,7 +218,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
+@@ -215,7 +215,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
}
void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
@@ -62065,11 +60855,11 @@ index c8668d1..39dd7c2 100644
static __always_inline void *
kmalloc_order(size_t size, gfp_t flags, unsigned int order)
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
-index 67ad11f..0bbd8af 100644
+index de8832d..0147b46 100644
--- a/include/linux/sonet.h
+++ b/include/linux/sonet.h
@@ -61,7 +61,7 @@ struct sonet_stats {
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
struct k_sonet_stats {
-#define __HANDLE_ITEM(i) atomic_t i
@@ -62078,10 +60868,10 @@ index 67ad11f..0bbd8af 100644
#undef __HANDLE_ITEM
};
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
-index db7bcaf..1aca77e 100644
+index 3d8f9c4..69f1c0a 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
-@@ -169,9 +169,9 @@ static inline unsigned short rpc_get_port(const struct sockaddr *sap)
+@@ -172,9 +172,9 @@ static inline unsigned short rpc_get_port(const struct sockaddr *sap)
{
switch (sap->sa_family) {
case AF_INET:
@@ -62093,7 +60883,7 @@ index db7bcaf..1aca77e 100644
}
return 0;
}
-@@ -204,7 +204,7 @@ static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1,
+@@ -207,7 +207,7 @@ static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1,
static inline bool __rpc_copy_addr4(struct sockaddr *dst,
const struct sockaddr *src)
{
@@ -62102,7 +60892,7 @@ index db7bcaf..1aca77e 100644
struct sockaddr_in *dsin = (struct sockaddr_in *) dst;
dsin->sin_family = ssin->sin_family;
-@@ -301,7 +301,7 @@ static inline u32 rpc_get_scope_id(const struct sockaddr *sa)
+@@ -310,7 +310,7 @@ static inline u32 rpc_get_scope_id(const struct sockaddr *sa)
if (sa->sa_family != AF_INET6)
return 0;
@@ -62111,6 +60901,18 @@ index db7bcaf..1aca77e 100644
}
#endif /* __KERNEL__ */
+diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
+index e775689..9e206d9 100644
+--- a/include/linux/sunrpc/sched.h
++++ b/include/linux/sunrpc/sched.h
+@@ -105,6 +105,7 @@ struct rpc_call_ops {
+ void (*rpc_call_done)(struct rpc_task *, void *);
+ void (*rpc_release)(void *);
+ };
++typedef struct rpc_call_ops __no_const rpc_call_ops_no_const;
+
+ struct rpc_task_setup {
+ struct rpc_task *task;
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index c14fe86..393245e 100644
--- a/include/linux/sunrpc/svc_rdma.h
@@ -62141,7 +60943,7 @@ index c14fe86..393245e 100644
#define RPCRDMA_VERSION 1
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
-index 11684d9..0d245eb 100644
+index 703cfa3..0b8ca72ac 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -155,7 +155,11 @@ enum
@@ -62157,7 +60959,7 @@ index 11684d9..0d245eb 100644
/* CTL_VM names: */
enum
-@@ -967,6 +971,8 @@ typedef int proc_handler (struct ctl_table *ctl, int write,
+@@ -968,6 +972,8 @@ typedef int proc_handler (struct ctl_table *ctl, int write,
extern int proc_dostring(struct ctl_table *, int,
void __user *, size_t *, loff_t *);
@@ -62180,7 +60982,7 @@ index ff7dc08..893e1bd 100644
struct tty_ldisc {
diff --git a/include/linux/types.h b/include/linux/types.h
-index 176da8c..e45e473 100644
+index 57a9723..dbe234a 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -213,10 +213,26 @@ typedef struct {
@@ -62272,11 +61074,33 @@ index 99c1b4d..bb94261 100644
}
static inline void put_unaligned_le16(u16 val, void *p)
+diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
+index e5a40c3..20ab0f6 100644
+--- a/include/linux/usb/renesas_usbhs.h
++++ b/include/linux/usb/renesas_usbhs.h
+@@ -39,7 +39,7 @@ enum {
+ */
+ struct renesas_usbhs_driver_callback {
+ int (*notify_hotplug)(struct platform_device *pdev);
+-};
++} __no_const;
+
+ /*
+ * callback functions for platform
+@@ -89,7 +89,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 cf97b5b..64d2a0a 100644
+index 6f8fbcf..8259001 100644
--- a/include/linux/vermagic.h
+++ b/include/linux/vermagic.h
-@@ -26,9 +26,28 @@
+@@ -25,9 +25,35 @@
#define MODULE_ARCH_VERMAGIC ""
#endif
@@ -62292,6 +61116,12 @@ index cf97b5b..64d2a0a 100644
+#define MODULE_CONSTIFY_PLUGIN ""
+#endif
+
++#ifdef STACKLEAK_PLUGIN
++#define MODULE_STACKLEAK_PLUGIN "STACKLEAK_PLUGIN "
++#else
++#define MODULE_STACKLEAK_PLUGIN ""
++#endif
++
+#ifdef CONFIG_GRKERNSEC
+#define MODULE_GRSEC "GRSEC "
+#else
@@ -62304,10 +61134,11 @@ index cf97b5b..64d2a0a 100644
MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \
- MODULE_ARCH_VERMAGIC
+ MODULE_ARCH_VERMAGIC \
-+ MODULE_PAX_REFCOUNT MODULE_CONSTIFY_PLUGIN MODULE_GRSEC
++ MODULE_PAX_REFCOUNT MODULE_CONSTIFY_PLUGIN MODULE_STACKLEAK_PLUGIN \
++ MODULE_GRSEC
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
-index 687fb11..546e710 100644
+index 4bde182..aec92c1 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 */
@@ -62316,7 +61147,7 @@ index 687fb11..546e710 100644
#define VM_UNLIST 0x00000020 /* vm_struct is not listed in vmlist */
+
+#if defined(CONFIG_MODULES) && defined(CONFIG_X86) && defined(CONFIG_PAX_KERNEXEC)
-+#define VM_KERNEXEC 0x00000040 /* allocate from executable kernel memory range */
++#define VM_KERNEXEC 0x00000040 /* allocate from executable kernel memory range */
+#endif
+
/* bits [20..32] reserved for arch specific ioremap internals */
@@ -62427,7 +61258,7 @@ index 687fb11..546e710 100644
+
#endif /* _LINUX_VMALLOC_H */
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
-index bcd942f..729957b 100644
+index 65efb92..137adbb 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -87,18 +87,18 @@ static inline void vm_events_fold_cpu(int cpu)
@@ -62493,6 +61324,22 @@ index bcd942f..729957b 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
+--- 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
+
++/* 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__
+
+ #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
@@ -62528,17 +61375,31 @@ index c7c40f1..4f01585 100644
/*
* Newer version of video_device, handled by videodev2.c
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
-index dd9f1e7..6376334 100644
+index 4d1c74a..65e1221 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
-@@ -272,6 +272,7 @@ struct v4l2_ioctl_ops {
+@@ -274,7 +274,7 @@ struct v4l2_ioctl_ops {
long (*vidioc_default) (struct file *file, void *fh,
bool valid_prio, int cmd, void *arg);
};
+-
+typedef struct v4l2_ioctl_ops __no_const v4l2_ioctl_ops_no_const;
-
/* v4l debugging and diagnostics */
+
+diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h
+index 8d55251..dfe5b0a 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);
+-};
++} __no_const;
+
+ /* Structure implemented by HSI device. */
+ struct cfhsi_dev {
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h
index 9e5425b..8136ffc 100644
--- a/include/net/caif/cfctrl.h
@@ -62564,22 +61425,22 @@ 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 32359fd..684c65f 100644
+index 57f15a7..0de26c6 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
-@@ -207,6 +207,6 @@ extern struct flow_cache_object *flow_cache_lookup(
- u8 dir, flow_resolve_t resolver, void *ctx);
+@@ -208,6 +208,6 @@ extern struct flow_cache_object *flow_cache_lookup(
extern void flow_cache_flush(void);
+ extern void flow_cache_flush_deferred(void);
-extern atomic_t flow_cache_genid;
+extern atomic_unchecked_t flow_cache_genid;
#endif
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
-index 8a159cc..0defcc9 100644
+index e9ff3fc..9d3e5c7 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
-@@ -43,8 +43,8 @@ struct inet_peer {
+@@ -48,8 +48,8 @@ struct inet_peer {
*/
union {
struct {
@@ -62589,16 +61450,21 @@ index 8a159cc..0defcc9 100644
+ atomic_unchecked_t ip_id_count; /* IP ID for the next packet */
__u32 tcp_ts;
__u32 tcp_ts_stamp;
- u32 metrics[RTAX_MAX];
-@@ -108,7 +108,7 @@ static inline __u16 inet_getid(struct inet_peer *p, int more)
- {
+ };
+@@ -113,11 +113,11 @@ static inline int inet_getid(struct inet_peer *p, int more)
more++;
inet_peer_refcheck(p);
-- return atomic_add_return(more, &p->ip_id_count) - more;
-+ return atomic_add_return_unchecked(more, &p->ip_id_count) - more;
+ do {
+- old = atomic_read(&p->ip_id_count);
++ old = atomic_read_unchecked(&p->ip_id_count);
+ new = old + more;
+ if (!new)
+ new = 1;
+- } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
++ } while (atomic_cmpxchg_unchecked(&p->ip_id_count, old, new) != old);
+ return new;
}
- #endif /* _NET_INETPEER_H */
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 10422ef..662570f 100644
--- a/include/net/ip_fib.h
@@ -62613,7 +61479,7 @@ 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 481f856..1cc73c4 100644
+index e5a7b9a..f4fc44b 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -509,7 +509,7 @@ struct ip_vs_conn {
@@ -62671,10 +61537,10 @@ index 59ba38bc..d515662 100644
/* 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 f82a1e8..82d81e8 100644
+index f2419cf..473679f 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
-@@ -87,7 +87,7 @@ struct iucv_sock {
+@@ -139,7 +139,7 @@ struct iucv_sock {
struct iucv_sock_list {
struct hlist_head head;
rwlock_t lock;
@@ -62683,37 +61549,24 @@ index f82a1e8..82d81e8 100644
};
unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
-diff --git a/include/net/lapb.h b/include/net/lapb.h
-index 96cb5dd..25e8d4f 100644
---- a/include/net/lapb.h
-+++ b/include/net/lapb.h
-@@ -95,7 +95,7 @@ struct lapb_cb {
- struct sk_buff_head write_queue;
- struct sk_buff_head ack_queue;
- unsigned char window;
-- struct lapb_register_struct callbacks;
-+ struct lapb_register_struct *callbacks;
-
- /* FRMR control information */
- struct lapb_frame frmr_data;
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
-index 4014b62..b68661b 100644
+index 2720884..3aa5c25 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
-@@ -124,7 +124,7 @@ struct neigh_ops {
- int (*connected_output)(struct sk_buff*);
- int (*hh_output)(struct sk_buff*);
- int (*queue_xmit)(struct sk_buff*);
+@@ -122,7 +122,7 @@ struct neigh_ops {
+ void (*error_report)(struct neighbour *, struct sk_buff *);
+ int (*output)(struct neighbour *, struct sk_buff *);
+ int (*connected_output)(struct neighbour *, struct sk_buff *);
-};
+} __do_const;
struct pneigh_entry {
struct pneigh_entry *next;
diff --git a/include/net/netlink.h b/include/net/netlink.h
-index 02740a9..7aff1af 100644
+index cb1f350..3279d2c 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
-@@ -562,7 +562,7 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb)
+@@ -569,7 +569,7 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb)
static inline void nlmsg_trim(struct sk_buff *skb, const void *mark)
{
if (mark)
@@ -62738,10 +61591,10 @@ index d786b4f..4c3dd41 100644
#ifdef CONFIG_IP_MROUTE
#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
-index b2c2366..10a2a1d 100644
+index 6a72a58..e6a127d 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
-@@ -315,9 +315,9 @@ do { \
+@@ -318,9 +318,9 @@ do { \
#else /* SCTP_DEBUG */
@@ -62755,7 +61608,7 @@ index b2c2366..10a2a1d 100644
#define SCTP_DISABLE_DEBUG
#define SCTP_ASSERT(expr, str, func)
diff --git a/include/net/sock.h b/include/net/sock.h
-index c0b938c..13ef493 100644
+index 32e3937..87a1dbc 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -277,7 +277,7 @@ struct sock {
@@ -62767,7 +61620,7 @@ index c0b938c..13ef493 100644
int sk_rcvbuf;
struct sk_filter __rcu *sk_filter;
-@@ -1390,7 +1390,7 @@ static inline void sk_nocaps_add(struct sock *sk, int flags)
+@@ -1402,7 +1402,7 @@ static inline void sk_nocaps_add(struct sock *sk, int flags)
}
static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
@@ -62777,32 +61630,28 @@ index c0b938c..13ef493 100644
{
if (skb->ip_summed == CHECKSUM_NONE) {
diff --git a/include/net/tcp.h b/include/net/tcp.h
-index cda30ea..7b6e226 100644
+index bb18c4d..bb87972 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
-@@ -1374,8 +1374,8 @@ enum tcp_seq_states {
- struct tcp_seq_afinfo {
- char *name;
- sa_family_t family;
-- struct file_operations seq_fops;
-- struct seq_operations seq_ops;
-+ file_operations_no_const seq_fops;
-+ seq_operations_no_const seq_ops;
+@@ -1409,7 +1409,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 67ea6fc..e42aee8 100644
+index 3b285f4..0219639 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
-@@ -234,8 +234,8 @@ struct udp_seq_afinfo {
- char *name;
- sa_family_t family;
- struct udp_table *udp_table;
-- struct file_operations seq_fops;
-- struct seq_operations seq_ops;
-+ file_operations_no_const seq_fops;
-+ seq_operations_no_const seq_ops;
+@@ -237,7 +237,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 {
@@ -62820,10 +61669,10 @@ index b203e14..1df3991 100644
u32 index;
struct xfrm_mark mark;
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
-index 2d0191c..a55797d 100644
+index 1a046b1..ee0bef0 100644
--- a/include/rdma/iw_cm.h
+++ b/include/rdma/iw_cm.h
-@@ -120,7 +120,7 @@ struct iw_cm_verbs {
+@@ -122,7 +122,7 @@ struct iw_cm_verbs {
int backlog);
int (*destroy_listen)(struct iw_cm_id *cm_id);
@@ -62833,10 +61682,10 @@ index 2d0191c..a55797d 100644
/**
* iw_create_cm_id - Create an IW CM identifier.
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
-index a3cbda4..9dd465d 100644
+index 5d1a758..1dbf795 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
-@@ -750,6 +750,7 @@ struct libfc_function_template {
+@@ -748,6 +748,7 @@ struct libfc_function_template {
*/
void (*disc_stop_final) (struct fc_lport *);
};
@@ -62844,7 +61693,7 @@ index a3cbda4..9dd465d 100644
/**
* struct fc_disc - Discovery context
-@@ -853,7 +854,7 @@ struct fc_lport {
+@@ -851,7 +852,7 @@ struct fc_lport {
struct fc_vport *vport;
/* Operational Information */
@@ -62854,7 +61703,7 @@ index a3cbda4..9dd465d 100644
u8 qfull;
enum fc_lport_state state;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
-index dd82e02..3c94df0 100644
+index 5591ed5..13eb457 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -161,9 +161,9 @@ struct scsi_device {
@@ -62910,7 +61759,7 @@ index 8c05e47..2b5df97 100644
struct snd_hwdep {
struct snd_card *card;
diff --git a/include/sound/info.h b/include/sound/info.h
-index 4e94cf1..76748b1 100644
+index 5492cc4..1a65278 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -44,7 +44,7 @@ struct snd_info_entry_text {
@@ -62923,7 +61772,7 @@ index 4e94cf1..76748b1 100644
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 e1bad11..692830c 100644
+index 0cf91b2..b70cae4 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -81,6 +81,7 @@ struct snd_pcm_ops {
@@ -62948,13 +61797,13 @@ index af1b49e..a5d55a5 100644
/*
* CSP private data
diff --git a/include/sound/soc.h b/include/sound/soc.h
-index 3a4bd3a..63bde9b 100644
+index 11cfb59..e3f93f4 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
-@@ -636,7 +636,7 @@ struct snd_soc_platform_driver {
-
- /* platform stream ops */
- struct snd_pcm_ops *ops;
+@@ -683,7 +683,7 @@ struct snd_soc_platform_driver {
+ /* platform IO - used for platform DAPM */
+ unsigned int (*read)(struct snd_soc_platform *, unsigned int);
+ int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
-};
+} __do_const;
@@ -62974,22 +61823,22 @@ index 444cd6b..3327cc5 100644
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 561ac99..948a9c8 100644
+index 6873c7d..b1e8009 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
-@@ -364,7 +364,7 @@ struct t10_reservation_ops {
+@@ -345,7 +345,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_template {
+ struct t10_reservation {
/* Reservation effects all target ports */
-@@ -432,8 +432,8 @@ struct se_transport_task {
+@@ -464,8 +464,8 @@ 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_timeout_left;
- atomic_t t_task_cdbs_sent;
- atomic_t t_transport_aborted;
+ atomic_unchecked_t t_task_cdbs_sent;
@@ -62997,15 +61846,15 @@ index 561ac99..948a9c8 100644
atomic_t t_transport_active;
atomic_t t_transport_complete;
atomic_t t_transport_queue_active;
-@@ -774,7 +774,7 @@ struct se_device {
- atomic_t active_cmds;
+@@ -703,7 +703,7 @@ struct se_device {
+ /* Active commands on this virtual SE device */
atomic_t simple_cmds;
atomic_t depth_left;
- atomic_t dev_ordered_id;
+ atomic_unchecked_t dev_ordered_id;
- atomic_t dev_tur_active;
atomic_t execute_tasks;
- atomic_t dev_status_thr_count;
+ atomic_t dev_ordered_sync;
+ atomic_t dev_qf_count;
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 1c09820..7f5ec79 100644
--- a/include/trace/events/irq.h
@@ -63029,12 +61878,12 @@ index 1c09820..7f5ec79 100644
TP_ARGS(irq, action, ret),
diff --git a/include/video/udlfb.h b/include/video/udlfb.h
-index 69d485a..dd0bee7 100644
+index c41f308..6918de3 100644
--- a/include/video/udlfb.h
+++ b/include/video/udlfb.h
-@@ -51,10 +51,10 @@ struct dlfb_data {
- int base8;
+@@ -52,10 +52,10 @@ struct dlfb_data {
u32 pseudo_palette[256];
+ int blank_mode; /*one of FB_BLANK_ */
/* blit-only rendering path metrics, exposed through sysfs */
- atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */
- atomic_t bytes_identical; /* saved effort with backbuffer comparison */
@@ -63060,10 +61909,10 @@ index 0993a22..32ba2fe 100644
void *pmi_pal;
u8 *vbe_state_orig; /*
diff --git a/init/Kconfig b/init/Kconfig
-index 412c21b..13e4618 100644
+index 43298f9..2f56c12 100644
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1195,7 +1195,7 @@ config SLUB_DEBUG
+@@ -1214,7 +1214,7 @@ config SLUB_DEBUG
config COMPAT_BRK
bool "Disable heap randomization"
@@ -63073,10 +61922,10 @@ index 412c21b..13e4618 100644
Randomizing heap placement makes heap exploits harder, but it
also breaks ancient binaries (including anything libc5 based).
diff --git a/init/do_mounts.c b/init/do_mounts.c
-index c0851a8..4f8977d 100644
+index 0f6e1d9..89d0af4 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
-@@ -287,11 +287,11 @@ static void __init get_fs_names(char *page)
+@@ -325,11 +325,11 @@ static void __init get_fs_names(char *page)
static int __init do_mount_root(char *name, char *fs, int flags, void *data)
{
@@ -63090,7 +61939,7 @@ index c0851a8..4f8977d 100644
ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev;
printk(KERN_INFO
"VFS: Mounted root (%s filesystem)%s on device %u:%u.\n",
-@@ -383,18 +383,18 @@ void __init change_floppy(char *fmt, ...)
+@@ -421,18 +421,18 @@ void __init change_floppy(char *fmt, ...)
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
@@ -63112,7 +61961,7 @@ index c0851a8..4f8977d 100644
termios.c_lflag |= ICANON;
sys_ioctl(fd, TCSETSF, (long)&termios);
sys_close(fd);
-@@ -488,6 +488,6 @@ void __init prepare_namespace(void)
+@@ -526,6 +526,6 @@ void __init prepare_namespace(void)
mount_root();
out:
devtmpfs_mount("dev");
@@ -63375,7 +62224,7 @@ index 2531811..040d4d4 100644
next_state = Reset;
return 0;
diff --git a/init/main.c b/init/main.c
-index d7211fa..4ba6d60 100644
+index 217ed23..32e5731 100644
--- a/init/main.c
+++ b/init/main.c
@@ -96,6 +96,8 @@ static inline void mark_rodata_ro(void) { }
@@ -63437,7 +62286,7 @@ index d7211fa..4ba6d60 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;
-@@ -667,6 +712,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
+@@ -681,6 +726,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
{
int count = preempt_count();
int ret;
@@ -63445,7 +62294,7 @@ index d7211fa..4ba6d60 100644
if (initcall_debug)
ret = do_one_initcall_debug(fn);
-@@ -679,15 +725,15 @@ int __init_or_module do_one_initcall(initcall_t fn)
+@@ -693,15 +739,15 @@ int __init_or_module do_one_initcall(initcall_t fn)
sprintf(msgbuf, "error code %d ", ret);
if (preempt_count() != count) {
@@ -63465,7 +62314,7 @@ index d7211fa..4ba6d60 100644
}
return ret;
-@@ -805,7 +851,7 @@ static int __init kernel_init(void * unused)
+@@ -820,7 +866,7 @@ static int __init kernel_init(void * unused)
do_basic_setup();
/* Open the /dev/console on the rootfs, this should never fail */
@@ -63474,7 +62323,7 @@ index d7211fa..4ba6d60 100644
printk(KERN_WARNING "Warning: unable to open an initial console.\n");
(void) sys_dup(0);
-@@ -818,11 +864,13 @@ static int __init kernel_init(void * unused)
+@@ -833,11 +879,13 @@ static int __init kernel_init(void * unused)
if (!ramdisk_execute_command)
ramdisk_execute_command = "/init";
@@ -63490,7 +62339,7 @@ index d7211fa..4ba6d60 100644
* Ok, we have completed the initial bootup, and
* we're essentially up and running. Get rid of the
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
-index ed049ea..6442f7f 100644
+index 5b4293d..f179875 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -156,6 +156,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
@@ -63531,10 +62380,10 @@ index 7385de2..a8180e0 100644
msg_params.flg = msgflg;
diff --git a/ipc/sem.c b/ipc/sem.c
-index e68a8f5..798131e 100644
+index 5215a81..cfc0cac 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
-@@ -318,10 +318,15 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp,
+@@ -364,10 +364,15 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp,
return 0;
}
@@ -63551,7 +62400,7 @@ index e68a8f5..798131e 100644
struct ipc_params sem_params;
ns = current->nsproxy->ipc_ns;
-@@ -329,10 +334,6 @@ SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg)
+@@ -375,10 +380,6 @@ SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg)
if (nsems < 0 || nsems > ns->sc_semmsl)
return -EINVAL;
@@ -63562,26 +62411,8 @@ index e68a8f5..798131e 100644
sem_params.key = key;
sem_params.flg = semflg;
sem_params.u.nsems = nsems;
-@@ -854,6 +855,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
- int nsems;
- struct list_head tasks;
-
-+ pax_track_stack();
-+
- sma = sem_lock_check(ns, semid);
- if (IS_ERR(sma))
- return PTR_ERR(sma);
-@@ -1301,6 +1304,8 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
- struct ipc_namespace *ns;
- struct list_head tasks;
-
-+ pax_track_stack();
-+
- ns = current->nsproxy->ipc_ns;
-
- if (nsops < 1 || semid < 0)
diff --git a/ipc/shm.c b/ipc/shm.c
-index ab3385a..ce64482 100644
+index 02ecf2c..be05b1e 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);
@@ -63599,7 +62430,7 @@ index ab3385a..ce64482 100644
void shm_init_ns(struct ipc_namespace *ns)
{
ns->shm_ctlmax = SHMMAX;
-@@ -401,6 +409,14 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
+@@ -508,6 +516,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();
@@ -63614,7 +62445,7 @@ index ab3385a..ce64482 100644
shp->shm_segsz = size;
shp->shm_nattch = 0;
shp->shm_file = file;
-@@ -451,18 +467,19 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp,
+@@ -559,18 +575,19 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp,
return 0;
}
@@ -63639,7 +62470,7 @@ index ab3385a..ce64482 100644
shm_params.key = key;
shm_params.flg = shmflg;
shm_params.u.size = size;
-@@ -762,8 +779,6 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
+@@ -870,8 +887,6 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
case SHM_LOCK:
case SHM_UNLOCK:
{
@@ -63648,7 +62479,20 @@ index ab3385a..ce64482 100644
lru_add_drain_all(); /* drain pagevecs to lru lists */
shp = shm_lock_check(ns, shmid);
-@@ -896,9 +911,21 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
+@@ -981,6 +996,12 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
+ f_mode = FMODE_READ | FMODE_WRITE;
+ }
+ if (shmflg & SHM_EXEC) {
++
++#ifdef CONFIG_PAX_MPROTECT
++ if (current->mm->pax_flags & MF_PAX_MPROTECT)
++ goto out;
++#endif
++
+ prot |= PROT_EXEC;
+ acc_mode |= S_IXUGO;
+ }
+@@ -1004,9 +1025,21 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
if (err)
goto out_unlock;
@@ -63684,10 +62528,10 @@ index fa7eb3d..7faf116 100644
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim;
set_fs(fs);
diff --git a/kernel/audit.c b/kernel/audit.c
-index 9395003..7b0479e 100644
+index 09fae26..ed71d5b 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
-@@ -112,7 +112,7 @@ u32 audit_sig_sid = 0;
+@@ -115,7 +115,7 @@ u32 audit_sig_sid = 0;
3) suppressed due to audit_rate_limit
4) suppressed due to audit_backlog_limit
*/
@@ -63696,7 +62540,7 @@ index 9395003..7b0479e 100644
/* The netlink socket. */
static struct sock *audit_sock;
-@@ -234,7 +234,7 @@ void audit_log_lost(const char *message)
+@@ -237,7 +237,7 @@ void audit_log_lost(const char *message)
unsigned long now;
int print;
@@ -63705,7 +62549,7 @@ index 9395003..7b0479e 100644
print = (audit_failure == AUDIT_FAIL_PANIC || !audit_rate_limit);
-@@ -253,7 +253,7 @@ void audit_log_lost(const char *message)
+@@ -256,7 +256,7 @@ void audit_log_lost(const char *message)
printk(KERN_WARNING
"audit: audit_lost=%d audit_rate_limit=%d "
"audit_backlog_limit=%d\n",
@@ -63714,7 +62558,7 @@ index 9395003..7b0479e 100644
audit_rate_limit,
audit_backlog_limit);
audit_panic(message);
-@@ -686,7 +686,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
+@@ -689,7 +689,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;
@@ -63723,10 +62567,37 @@ index 9395003..7b0479e 100644
status_set.backlog = skb_queue_len(&audit_skb_queue);
audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_GET, 0, 0,
&status_set, sizeof(status_set));
+@@ -1260,12 +1260,13 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
+ avail = audit_expand(ab,
+ max_t(unsigned, AUDIT_BUFSIZ, 1+len-avail));
+ if (!avail)
+- goto out;
++ goto out_va_end;
+ len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2);
+ }
+- va_end(args2);
+ if (len > 0)
+ skb_put(skb, len);
++out_va_end:
++ va_end(args2);
+ out:
+ return;
+ }
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
-index 00d79df..e67a996 100644
+index 47b7fc1..c003c33 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
+@@ -1166,8 +1166,8 @@ static void audit_log_execve_info(struct audit_context *context,
+ struct audit_buffer **ab,
+ struct audit_aux_data_execve *axi)
+ {
+- int i;
+- size_t len, len_sent = 0;
++ int i, len;
++ size_t len_sent = 0;
+ const char __user *p;
+ char *buf;
+
@@ -2118,7 +2118,7 @@ int auditsc_get_stamp(struct audit_context *ctx,
}
@@ -63746,7 +62617,7 @@ index 00d79df..e67a996 100644
if (context && context->in_syscall) {
diff --git a/kernel/capability.c b/kernel/capability.c
-index 283c529..36ac81e 100644
+index b463871..fa3ea1f 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)
@@ -63809,21 +62680,8 @@ index 283c529..36ac81e 100644
/**
* nsown_capable - Check superior capability to one's own user_ns
* @cap: The capability in question
-diff --git a/kernel/cgroup.c b/kernel/cgroup.c
-index 2731d11..467225f 100644
---- a/kernel/cgroup.c
-+++ b/kernel/cgroup.c
-@@ -593,6 +593,8 @@ static struct css_set *find_css_set(
- struct hlist_head *hhead;
- struct cg_cgroup_link *link;
-
-+ pax_track_stack();
-+
- /* First see if we already have a cgroup group that matches
- * the desired set */
- read_lock(&css_set_lock);
diff --git a/kernel/compat.c b/kernel/compat.c
-index fc9eb093..bce8e4b 100644
+index f346ced..aa2b1f4 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -13,6 +13,7 @@
@@ -63834,7 +62692,7 @@ index fc9eb093..bce8e4b 100644
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/signal.h>
-@@ -166,7 +167,7 @@ static long compat_nanosleep_restart(struct restart_block *restart)
+@@ -168,7 +169,7 @@ static long compat_nanosleep_restart(struct restart_block *restart)
mm_segment_t oldfs;
long ret;
@@ -63843,7 +62701,7 @@ index fc9eb093..bce8e4b 100644
oldfs = get_fs();
set_fs(KERNEL_DS);
ret = hrtimer_nanosleep_restart(restart);
-@@ -198,7 +199,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
+@@ -200,7 +201,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
oldfs = get_fs();
set_fs(KERNEL_DS);
ret = hrtimer_nanosleep(&tu,
@@ -63852,7 +62710,7 @@ index fc9eb093..bce8e4b 100644
HRTIMER_MODE_REL, CLOCK_MONOTONIC);
set_fs(oldfs);
-@@ -307,7 +308,7 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
+@@ -309,7 +310,7 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
@@ -63861,7 +62719,7 @@ index fc9eb093..bce8e4b 100644
set_fs(old_fs);
if (ret == 0)
ret = put_user(s, set);
-@@ -330,8 +331,8 @@ asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
+@@ -332,8 +333,8 @@ asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
old_fs = get_fs();
set_fs(KERNEL_DS);
ret = sys_sigprocmask(how,
@@ -63872,7 +62730,7 @@ index fc9eb093..bce8e4b 100644
set_fs(old_fs);
if (ret == 0)
if (oset)
-@@ -368,7 +369,7 @@ asmlinkage long compat_sys_old_getrlimit(unsigned int resource,
+@@ -370,7 +371,7 @@ asmlinkage long compat_sys_old_getrlimit(unsigned int resource,
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
@@ -63881,7 +62739,7 @@ index fc9eb093..bce8e4b 100644
set_fs(old_fs);
if (!ret) {
-@@ -440,7 +441,7 @@ asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru)
+@@ -442,7 +443,7 @@ asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru)
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
@@ -63890,7 +62748,7 @@ index fc9eb093..bce8e4b 100644
set_fs(old_fs);
if (ret)
-@@ -467,8 +468,8 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options,
+@@ -469,8 +470,8 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options,
set_fs (KERNEL_DS);
ret = sys_wait4(pid,
(stat_addr ?
@@ -63901,7 +62759,7 @@ index fc9eb093..bce8e4b 100644
set_fs (old_fs);
if (ret > 0) {
-@@ -493,8 +494,8 @@ asmlinkage long compat_sys_waitid(int which, compat_pid_t pid,
+@@ -495,8 +496,8 @@ asmlinkage long compat_sys_waitid(int which, compat_pid_t pid,
memset(&info, 0, sizeof(info));
set_fs(KERNEL_DS);
@@ -63912,7 +62770,7 @@ index fc9eb093..bce8e4b 100644
set_fs(old_fs);
if ((ret < 0) || (info.si_signo == 0))
-@@ -624,8 +625,8 @@ long compat_sys_timer_settime(timer_t timer_id, int flags,
+@@ -626,8 +627,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,
@@ -63923,7 +62781,7 @@ index fc9eb093..bce8e4b 100644
set_fs(oldfs);
if (!err && old && put_compat_itimerspec(old, &oldts))
return -EFAULT;
-@@ -642,7 +643,7 @@ long compat_sys_timer_gettime(timer_t timer_id,
+@@ -644,7 +645,7 @@ long compat_sys_timer_gettime(timer_t timer_id,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_timer_gettime(timer_id,
@@ -63932,7 +62790,7 @@ index fc9eb093..bce8e4b 100644
set_fs(oldfs);
if (!err && put_compat_itimerspec(setting, &ts))
return -EFAULT;
-@@ -661,7 +662,7 @@ long compat_sys_clock_settime(clockid_t which_clock,
+@@ -663,7 +664,7 @@ long compat_sys_clock_settime(clockid_t which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_settime(which_clock,
@@ -63941,7 +62799,7 @@ index fc9eb093..bce8e4b 100644
set_fs(oldfs);
return err;
}
-@@ -676,7 +677,7 @@ long compat_sys_clock_gettime(clockid_t which_clock,
+@@ -678,7 +679,7 @@ long compat_sys_clock_gettime(clockid_t which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_gettime(which_clock,
@@ -63950,7 +62808,7 @@ index fc9eb093..bce8e4b 100644
set_fs(oldfs);
if (!err && put_compat_timespec(&ts, tp))
return -EFAULT;
-@@ -696,7 +697,7 @@ long compat_sys_clock_adjtime(clockid_t which_clock,
+@@ -698,7 +699,7 @@ long compat_sys_clock_adjtime(clockid_t which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
@@ -63959,7 +62817,7 @@ index fc9eb093..bce8e4b 100644
set_fs(oldfs);
err = compat_put_timex(utp, &txc);
-@@ -716,7 +717,7 @@ long compat_sys_clock_getres(clockid_t which_clock,
+@@ -718,7 +719,7 @@ long compat_sys_clock_getres(clockid_t which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_getres(which_clock,
@@ -63968,7 +62826,7 @@ index fc9eb093..bce8e4b 100644
set_fs(oldfs);
if (!err && tp && put_compat_timespec(&ts, tp))
return -EFAULT;
-@@ -728,9 +729,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
+@@ -730,9 +731,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
long err;
mm_segment_t oldfs;
struct timespec tu;
@@ -63980,7 +62838,7 @@ index fc9eb093..bce8e4b 100644
oldfs = get_fs();
set_fs(KERNEL_DS);
err = clock_nanosleep_restart(restart);
-@@ -762,8 +763,8 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
+@@ -764,8 +765,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,
@@ -63992,7 +62850,7 @@ index fc9eb093..bce8e4b 100644
if ((err == -ERESTART_RESTARTBLOCK) && rmtp &&
diff --git a/kernel/configs.c b/kernel/configs.c
-index b4066b4..c2e76b1 100644
+index 42e8fa0..9e7406b 100644
--- a/kernel/configs.c
+++ b/kernel/configs.c
@@ -74,8 +74,19 @@ static int __init ikconfig_init(void)
@@ -64016,82 +62874,35 @@ index b4066b4..c2e76b1 100644
return -ENOMEM;
diff --git a/kernel/cred.c b/kernel/cred.c
-index 174fa84..f63d997 100644
+index 5791612..a3c04dc 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
-@@ -158,6 +158,8 @@ static void put_cred_rcu(struct rcu_head *rcu)
- */
- void __put_cred(struct cred *cred)
- {
-+ pax_track_stack();
-+
- kdebug("__put_cred(%p{%d,%d})", cred,
- atomic_read(&cred->usage),
- read_cred_subscribers(cred));
-@@ -182,6 +184,8 @@ void exit_creds(struct task_struct *tsk)
- {
- struct cred *cred;
-
-+ pax_track_stack();
-+
- kdebug("exit_creds(%u,%p,%p,{%d,%d})", tsk->pid, tsk->real_cred, tsk->cred,
- atomic_read(&tsk->cred->usage),
- read_cred_subscribers(tsk->cred));
-@@ -220,6 +224,8 @@ const struct cred *get_task_cred(struct task_struct *task)
- {
- const struct cred *cred;
-
-+ pax_track_stack();
+@@ -204,6 +204,15 @@ void exit_creds(struct task_struct *tsk)
+ validate_creds(cred);
+ put_cred(cred);
+ }
+
- rcu_read_lock();
++#ifdef CONFIG_GRKERNSEC_SETXID
++ cred = (struct cred *) tsk->delayed_cred;
++ if (cred) {
++ tsk->delayed_cred = NULL;
++ validate_creds(cred);
++ put_cred(cred);
++ }
++#endif
+ }
- do {
-@@ -239,6 +245,8 @@ struct cred *cred_alloc_blank(void)
+ /**
+@@ -470,7 +479,7 @@ error_put:
+ * Always returns 0 thus allowing this function to be tail-called at the end
+ * of, say, sys_setgid().
+ */
+-int commit_creds(struct cred *new)
++static int __commit_creds(struct cred *new)
{
- struct cred *new;
-
-+ pax_track_stack();
-+
- new = kmem_cache_zalloc(cred_jar, GFP_KERNEL);
- if (!new)
- return NULL;
-@@ -287,6 +295,8 @@ struct cred *prepare_creds(void)
- const struct cred *old;
- struct cred *new;
-
-+ pax_track_stack();
-+
- validate_process_creds();
-
- new = kmem_cache_alloc(cred_jar, GFP_KERNEL);
-@@ -333,6 +343,8 @@ struct cred *prepare_exec_creds(void)
- struct thread_group_cred *tgcred = NULL;
- struct cred *new;
-
-+ pax_track_stack();
-+
- #ifdef CONFIG_KEYS
- tgcred = kmalloc(sizeof(*tgcred), GFP_KERNEL);
- if (!tgcred)
-@@ -385,6 +397,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
- struct cred *new;
- int ret;
-
-+ pax_track_stack();
-+
- if (
- #ifdef CONFIG_KEYS
- !p->cred->thread_keyring &&
-@@ -475,6 +489,8 @@ int commit_creds(struct cred *new)
struct task_struct *task = current;
const struct cred *old = task->real_cred;
-
-+ pax_track_stack();
-+
- kdebug("commit_creds(%p{%d,%d})", new,
- atomic_read(&new->usage),
- read_cred_subscribers(new));
-@@ -489,6 +505,8 @@ int commit_creds(struct cred *new)
+@@ -489,6 +498,8 @@ int commit_creds(struct cred *new)
get_cred(new); /* we will require a ref for the subj creds too */
@@ -64100,75 +62911,101 @@ index 174fa84..f63d997 100644
/* dumpability changes */
if (old->euid != new->euid ||
old->egid != new->egid ||
-@@ -508,10 +526,8 @@ int commit_creds(struct cred *new)
- key_fsgid_changed(task);
-
- /* do it
-- * - What if a process setreuid()'s and this brings the
-- * new uid over his NPROC rlimit? We can check this now
-- * cheaply with the new uid cache, so if it matters
-- * we should be checking for it. -DaveM
-+ * RLIMIT_NPROC limits on user->processes have already been checked
-+ * in set_user().
- */
- alter_cred_subscribers(new, 2);
- if (new->user != old->user)
-@@ -551,6 +567,8 @@ EXPORT_SYMBOL(commit_creds);
- */
- void abort_creds(struct cred *new)
- {
-+ pax_track_stack();
+@@ -538,6 +549,92 @@ int commit_creds(struct cred *new)
+ put_cred(old);
+ return 0;
+ }
++#ifdef CONFIG_GRKERNSEC_SETXID
++extern int set_user(struct cred *new);
+
- kdebug("abort_creds(%p{%d,%d})", new,
- atomic_read(&new->usage),
- read_cred_subscribers(new));
-@@ -574,6 +592,8 @@ const struct cred *override_creds(const struct cred *new)
- {
- const struct cred *old = current->cred;
-
-+ pax_track_stack();
++void gr_delayed_cred_worker(void)
++{
++ const struct cred *new = current->delayed_cred;
++ struct cred *ncred;
+
- kdebug("override_creds(%p{%d,%d})", new,
- atomic_read(&new->usage),
- read_cred_subscribers(new));
-@@ -603,6 +623,8 @@ void revert_creds(const struct cred *old)
- {
- const struct cred *override = current->cred;
-
-+ pax_track_stack();
++ current->delayed_cred = NULL;
+
- kdebug("revert_creds(%p{%d,%d})", old,
- atomic_read(&old->usage),
- read_cred_subscribers(old));
-@@ -649,6 +671,8 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
- const struct cred *old;
- struct cred *new;
-
-+ pax_track_stack();
++ if (current_uid() && new != NULL) {
++ // from doing get_cred on it when queueing this
++ put_cred(new);
++ return;
++ } else if (new == NULL)
++ return;
+
- new = kmem_cache_alloc(cred_jar, GFP_KERNEL);
- if (!new)
- return NULL;
-@@ -703,6 +727,8 @@ EXPORT_SYMBOL(prepare_kernel_cred);
- */
- int set_security_override(struct cred *new, u32 secid)
- {
-+ pax_track_stack();
++ ncred = prepare_creds();
++ if (!ncred)
++ goto die;
++ // uids
++ ncred->uid = new->uid;
++ ncred->euid = new->euid;
++ ncred->suid = new->suid;
++ ncred->fsuid = new->fsuid;
++ // gids
++ ncred->gid = new->gid;
++ ncred->egid = new->egid;
++ ncred->sgid = new->sgid;
++ ncred->fsgid = new->fsgid;
++ // groups
++ if (set_groups(ncred, new->group_info) < 0) {
++ abort_creds(ncred);
++ goto die;
++ }
++ // caps
++ ncred->securebits = new->securebits;
++ ncred->cap_inheritable = new->cap_inheritable;
++ ncred->cap_permitted = new->cap_permitted;
++ ncred->cap_effective = new->cap_effective;
++ ncred->cap_bset = new->cap_bset;
++
++ if (set_user(ncred)) {
++ abort_creds(ncred);
++ goto die;
++ }
+
- return security_kernel_act_as(new, secid);
- }
- EXPORT_SYMBOL(set_security_override);
-@@ -722,6 +748,8 @@ int set_security_override_from_ctx(struct cred *new, const char *secctx)
- u32 secid;
- int ret;
-
-+ pax_track_stack();
++ // from doing get_cred on it when queueing this
++ put_cred(new);
+
- ret = security_secctx_to_secid(secctx, strlen(secctx), &secid);
- if (ret < 0)
- return ret;
++ __commit_creds(ncred);
++ return;
++die:
++ // from doing get_cred on it when queueing this
++ put_cred(new);
++ do_group_exit(SIGKILL);
++}
++#endif
++
++int commit_creds(struct cred *new)
++{
++#ifdef CONFIG_GRKERNSEC_SETXID
++ struct task_struct *t;
++
++ /* we won't get called with tasklist_lock held for writing
++ and interrupts disabled as the cred struct in that case is
++ init_cred
++ */
++ if (grsec_enable_setxid && !current_is_single_threaded() &&
++ !current_uid() && new->uid) {
++ rcu_read_lock();
++ read_lock(&tasklist_lock);
++ for (t = next_thread(current); t != current;
++ t = next_thread(t)) {
++ if (t->delayed_cred == NULL) {
++ t->delayed_cred = get_cred(new);
++ set_tsk_need_resched(t);
++ }
++ }
++ read_unlock(&tasklist_lock);
++ rcu_read_unlock();
++ }
++#endif
++ return __commit_creds(new);
++}
++
+ EXPORT_SYMBOL(commit_creds);
+
+ /**
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
-index bad6786..3d85c2a 100644
+index 0d7c087..01b8cef 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -119,7 +119,7 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_lock);
@@ -64232,7 +63069,7 @@ index bad6786..3d85c2a 100644
}
EXPORT_SYMBOL_GPL(kgdb_schedule_breakpoint);
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
-index be14779..27edaaa 100644
+index 63786e7..0780cac 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1980,7 +1980,7 @@ static int kdb_lsmod(int argc, const char **argv)
@@ -64254,10 +63091,10 @@ index be14779..27edaaa 100644
#ifdef CONFIG_MODULE_UNLOAD
{
diff --git a/kernel/events/core.c b/kernel/events/core.c
-index 32a6151..54b12b2 100644
+index 58690af..d903d75 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
-@@ -170,7 +170,7 @@ int perf_proc_update_handler(struct ctl_table *table, int write,
+@@ -173,7 +173,7 @@ int perf_proc_update_handler(struct ctl_table *table, int write,
return 0;
}
@@ -64266,7 +63103,7 @@ index 32a6151..54b12b2 100644
static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx,
enum event_type_t event_type);
-@@ -2488,7 +2488,7 @@ static void __perf_event_read(void *info)
+@@ -2540,7 +2540,7 @@ static void __perf_event_read(void *info)
static inline u64 perf_event_count(struct perf_event *event)
{
@@ -64275,7 +63112,7 @@ index 32a6151..54b12b2 100644
}
static u64 perf_event_read(struct perf_event *event)
-@@ -3023,9 +3023,9 @@ u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running)
+@@ -3065,9 +3065,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 +
@@ -64287,20 +63124,20 @@ index 32a6151..54b12b2 100644
list_for_each_entry(child, &event->child_list, child_list) {
total += perf_event_read(child);
-@@ -3388,10 +3388,10 @@ void perf_event_update_userpage(struct perf_event *event)
+@@ -3474,10 +3474,10 @@ void perf_event_update_userpage(struct perf_event *event)
userpg->offset -= local64_read(&event->hw.prev_count);
- userpg->time_enabled = event->total_time_enabled +
+ userpg->time_enabled = enabled +
- atomic64_read(&event->child_total_time_enabled);
+ atomic64_read_unchecked(&event->child_total_time_enabled);
- userpg->time_running = event->total_time_running +
+ userpg->time_running = running +
- atomic64_read(&event->child_total_time_running);
+ atomic64_read_unchecked(&event->child_total_time_running);
barrier();
++userpg->lock;
-@@ -4188,11 +4188,11 @@ static void perf_output_read_one(struct perf_output_handle *handle,
+@@ -3906,11 +3906,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 +
@@ -64314,7 +63151,7 @@ index 32a6151..54b12b2 100644
}
if (read_format & PERF_FORMAT_ID)
values[n++] = primary_event_id(event);
-@@ -4833,12 +4833,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
+@@ -4561,12 +4561,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.
*/
@@ -64329,7 +63166,7 @@ index 32a6151..54b12b2 100644
if (IS_ERR(name)) {
name = strncpy(tmp, "//toolong", sizeof(tmp));
goto got_name;
-@@ -6190,7 +6190,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
+@@ -5921,7 +5921,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
event->parent = parent_event;
event->ns = get_pid_ns(current->nsproxy->pid_ns);
@@ -64338,7 +63175,7 @@ index 32a6151..54b12b2 100644
event->state = PERF_EVENT_STATE_INACTIVE;
-@@ -6713,10 +6713,10 @@ static void sync_child_event(struct perf_event *child_event,
+@@ -6443,10 +6443,10 @@ static void sync_child_event(struct perf_event *child_event,
/*
* Add back the child's count to the parent's count:
*/
@@ -64353,7 +63190,7 @@ index 32a6151..54b12b2 100644
/*
diff --git a/kernel/exit.c b/kernel/exit.c
-index f2b321b..4935c0d 100644
+index e6e01b9..619f837 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -57,6 +57,10 @@
@@ -64367,7 +63204,7 @@ index f2b321b..4935c0d 100644
static void exit_mm(struct task_struct * tsk);
static void __unhash_process(struct task_struct *p, bool group_dead)
-@@ -169,6 +173,10 @@ void release_task(struct task_struct * p)
+@@ -168,6 +172,10 @@ void release_task(struct task_struct * p)
struct task_struct *leader;
int zap_leader;
repeat:
@@ -64375,33 +63212,10 @@ index f2b321b..4935c0d 100644
+ gr_del_task_from_ip_table(p);
+#endif
+
- tracehook_prepare_release_task(p);
/* 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 */
-@@ -338,11 +346,22 @@ static void reparent_to_kthreadd(void)
- {
- write_lock_irq(&tasklist_lock);
-
-+#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
-+
- ptrace_unlink(current);
- /* Reparent to init */
- current->real_parent = current->parent = kthreadd_task;
- list_move_tail(&current->sibling, &current->real_parent->children);
-
-+ gr_set_kernel_label(current);
-+
- /* Set the exit signal to SIGCHLD so we signal init on exit */
- current->exit_signal = SIGCHLD;
-
-@@ -394,7 +413,7 @@ int allow_signal(int sig)
+ rcu_read_lock();
+@@ -380,7 +388,7 @@ int allow_signal(int sig)
* know it'll be handled, so that they don't get converted to
* SIGKILL or just silently dropped.
*/
@@ -64410,7 +63224,7 @@ index f2b321b..4935c0d 100644
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
return 0;
-@@ -430,6 +449,17 @@ void daemonize(const char *name, ...)
+@@ -416,6 +424,17 @@ void daemonize(const char *name, ...)
vsnprintf(current->comm, sizeof(current->comm), name, args);
va_end(args);
@@ -64428,38 +63242,24 @@ index f2b321b..4935c0d 100644
/*
* 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
-@@ -904,15 +934,8 @@ NORET_TYPE void do_exit(long code)
+@@ -893,6 +912,8 @@ NORET_TYPE void do_exit(long code)
struct task_struct *tsk = current;
int group_dead;
-- profile_task_exit(tsk);
--
-- WARN_ON(atomic_read(&tsk->fs_excl));
-- WARN_ON(blk_needs_flush_plug(tsk));
--
- if (unlikely(in_interrupt()))
- panic("Aiee, killing interrupt handler!");
-- if (unlikely(!tsk->pid))
-- panic("Attempted to kill the idle task!");
++ set_fs(USER_DS);
++
+ profile_task_exit(tsk);
- /*
- * If do_exit is called because this processes oopsed, it's possible
-@@ -923,6 +946,14 @@ NORET_TYPE void do_exit(long code)
+ WARN_ON(blk_needs_flush_plug(tsk));
+@@ -909,7 +930,6 @@ NORET_TYPE void do_exit(long code)
+ * mm_release()->clear_child_tid() from writing to a user-controlled
+ * kernel address.
*/
- set_fs(USER_DS);
+- set_fs(USER_DS);
-+ profile_task_exit(tsk);
-+
-+ WARN_ON(atomic_read(&tsk->fs_excl));
-+ WARN_ON(blk_needs_flush_plug(tsk));
-+
-+ if (unlikely(!tsk->pid))
-+ panic("Attempted to kill the idle task!");
-+
- tracehook_report_exit(&code);
+ ptrace_event(PTRACE_EVENT_EXIT, code);
- validate_creds_for_do_exit(tsk);
-@@ -983,6 +1014,9 @@ NORET_TYPE void do_exit(long code)
+@@ -971,6 +991,9 @@ NORET_TYPE void do_exit(long code)
tsk->exit_code = code;
taskstats_exit(tsk, group_dead);
@@ -64470,10 +63270,10 @@ index f2b321b..4935c0d 100644
if (group_dead)
diff --git a/kernel/fork.c b/kernel/fork.c
-index 0276c30..5a97262 100644
+index da4a6a1..c04943c 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -286,7 +286,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
+@@ -280,7 +280,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
*stackend = STACK_END_MAGIC; /* for overflow detection */
#ifdef CONFIG_CC_STACKPROTECTOR
@@ -64481,8 +63281,8 @@ index 0276c30..5a97262 100644
+ tsk->stack_canary = pax_get_random_long();
#endif
- /* One for us, one for whoever does the "release_task()" (usually parent) */
-@@ -308,13 +308,77 @@ out:
+ /*
+@@ -304,13 +304,77 @@ out:
}
#ifdef CONFIG_MMU
@@ -64562,7 +63362,7 @@ index 0276c30..5a97262 100644
down_write(&oldmm->mmap_sem);
flush_cache_dup_mm(oldmm);
-@@ -326,8 +390,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -322,8 +386,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
mm->locked_vm = 0;
mm->mmap = NULL;
mm->mmap_cache = NULL;
@@ -64573,7 +63373,7 @@ index 0276c30..5a97262 100644
mm->map_count = 0;
cpumask_clear(mm_cpumask(mm));
mm->mm_rb = RB_ROOT;
-@@ -343,8 +407,6 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -339,8 +403,6 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
prev = NULL;
for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) {
@@ -64582,7 +63382,7 @@ index 0276c30..5a97262 100644
if (mpnt->vm_flags & VM_DONTCOPY) {
long pages = vma_pages(mpnt);
mm->total_vm -= pages;
-@@ -352,55 +414,13 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -348,53 +410,11 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
-pages);
continue;
}
@@ -64592,7 +63392,11 @@ index 0276c30..5a97262 100644
- if (security_vm_enough_memory(len))
- goto fail_nomem;
- charge = len;
-- }
++ tmp = dup_vma(mm, mpnt);
++ if (!tmp) {
++ retval = -ENOMEM;
++ goto out;
+ }
- tmp = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
- if (!tmp)
- goto fail_nomem;
@@ -64624,25 +63428,19 @@ index 0276c30..5a97262 100644
- vma_prio_tree_add(tmp, mpnt);
- flush_dcache_mmap_unlock(mapping);
- mutex_unlock(&mapping->i_mmap_mutex);
-+ tmp = dup_vma(mm, mpnt);
-+ if (!tmp) {
-+ retval = -ENOMEM;
-+ goto out;
- }
-
- /*
+- }
+-
+- /*
- * 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;
-@@ -421,6 +441,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -417,6 +437,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
if (retval)
goto out;
}
@@ -64674,7 +63472,7 @@ index 0276c30..5a97262 100644
/* a new mm has just been created */
arch_dup_mmap(oldmm, mm);
retval = 0;
-@@ -429,14 +474,6 @@ out:
+@@ -425,14 +470,6 @@ out:
flush_tlb_mm(oldmm);
up_write(&oldmm->mmap_sem);
return retval;
@@ -64688,8 +63486,8 @@ index 0276c30..5a97262 100644
- goto out;
}
- static inline int mm_alloc_pgd(struct mm_struct * mm)
-@@ -836,13 +873,14 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
+ static inline int mm_alloc_pgd(struct mm_struct *mm)
+@@ -829,13 +866,14 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
spin_unlock(&fs->lock);
return -EAGAIN;
}
@@ -64705,7 +63503,7 @@ index 0276c30..5a97262 100644
return 0;
}
-@@ -1104,12 +1142,16 @@ static struct task_struct *copy_process(unsigned long clone_flags,
+@@ -1097,6 +1135,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
#endif
retval = -EAGAIN;
@@ -64714,17 +63512,8 @@ index 0276c30..5a97262 100644
+
if (atomic_read(&p->real_cred->user->processes) >=
task_rlimit(p, RLIMIT_NPROC)) {
-- if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
-- p->real_cred->user != INIT_USER)
-+ if (p->real_cred->user != INIT_USER &&
-+ !capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE))
- goto bad_fork_free;
- }
-+ current->flags &= ~PF_NPROC_EXCEEDED;
-
- retval = copy_creds(p, clone_flags);
- if (retval < 0)
-@@ -1250,6 +1292,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
+ if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
+@@ -1256,6 +1297,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
if (clone_flags & CLONE_THREAD)
p->tgid = current->tgid;
@@ -64733,7 +63522,7 @@ index 0276c30..5a97262 100644
p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL;
/*
* Clear TID on mm_release()?
-@@ -1414,6 +1458,8 @@ bad_fork_cleanup_count:
+@@ -1418,6 +1461,8 @@ bad_fork_cleanup_count:
bad_fork_free:
free_task(p);
fork_out:
@@ -64742,7 +63531,7 @@ index 0276c30..5a97262 100644
return ERR_PTR(retval);
}
-@@ -1502,6 +1548,8 @@ long do_fork(unsigned long clone_flags,
+@@ -1518,6 +1563,8 @@ long do_fork(unsigned long clone_flags,
if (clone_flags & CLONE_PARENT_SETTID)
put_user(nr, parent_tidptr);
@@ -64751,7 +63540,7 @@ index 0276c30..5a97262 100644
if (clone_flags & CLONE_VFORK) {
p->vfork_done = &vfork;
init_completion(&vfork);
-@@ -1610,7 +1658,7 @@ static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp)
+@@ -1627,7 +1674,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 */
@@ -64760,7 +63549,7 @@ index 0276c30..5a97262 100644
return 0;
*new_fsp = copy_fs_struct(fs);
-@@ -1697,7 +1745,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
+@@ -1716,7 +1763,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
fs = current->fs;
spin_lock(&fs->lock);
current->fs = new_fs;
@@ -64771,7 +63560,7 @@ index 0276c30..5a97262 100644
else
new_fs = fs;
diff --git a/kernel/futex.c b/kernel/futex.c
-index 8b6da25..eddb90e 100644
+index 1614be2..37abc7e 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -54,6 +54,7 @@
@@ -64780,7 +63569,7 @@ index 8b6da25..eddb90e 100644
#include <linux/syscalls.h>
+#include <linux/ptrace.h>
#include <linux/signal.h>
- #include <linux/module.h>
+ #include <linux/export.h>
#include <linux/magic.h>
@@ -238,6 +239,11 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
struct page *page, *page_head;
@@ -64794,54 +63583,18 @@ index 8b6da25..eddb90e 100644
/*
* The futex address must be "naturally" aligned.
*/
-@@ -1863,6 +1869,8 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val,
- struct futex_q q = futex_q_init;
- int ret;
-
-+ pax_track_stack();
-+
- if (!bitset)
- return -EINVAL;
- q.bitset = bitset;
-@@ -2259,6 +2267,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
- struct futex_q q = futex_q_init;
- int res, ret;
-
-+ pax_track_stack();
-+
- if (!bitset)
- return -EINVAL;
-
-@@ -2431,7 +2441,9 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
- {
- struct robust_list_head __user *head;
- unsigned long ret;
-+#ifndef CONFIG_GRKERNSEC_PROC_MEMMAP
- const struct cred *cred = current_cred(), *pcred;
-+#endif
-
- if (!futex_cmpxchg_enabled)
- return -ENOSYS;
-@@ -2447,6 +2459,10 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
+@@ -2459,6 +2465,10 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
if (!p)
goto err_unlock;
ret = -EPERM;
+#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP
+ if (!ptrace_may_access(p, PTRACE_MODE_READ))
+ goto err_unlock;
-+#else
++#endif
pcred = __task_cred(p);
/* If victim is in different user_ns, then uids are not
comparable, so we must have CAP_SYS_PTRACE */
-@@ -2461,6 +2477,7 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
- !ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
- goto err_unlock;
- ok:
-+#endif
- head = p->robust_list;
- rcu_read_unlock();
- }
-@@ -2712,6 +2729,7 @@ static int __init futex_init(void)
+@@ -2724,6 +2734,7 @@ static int __init futex_init(void)
{
u32 curval;
int i;
@@ -64849,7 +63602,7 @@ index 8b6da25..eddb90e 100644
/*
* This will fail and we want it. Some arch implementations do
-@@ -2723,8 +2741,11 @@ static int __init futex_init(void)
+@@ -2735,8 +2746,11 @@ static int __init futex_init(void)
* implementation, the non-functional ones will return
* -ENOSYS.
*/
@@ -64860,9 +63613,9 @@ index 8b6da25..eddb90e 100644
+ set_fs(oldfs);
for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
- plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
+ plist_head_init(&futex_queues[i].chain);
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
-index 5f9e689..03afa21 100644
+index 5f9e689..582d46d 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -10,6 +10,7 @@
@@ -64873,37 +63626,27 @@ index 5f9e689..03afa21 100644
#include <asm/uaccess.h>
-@@ -136,7 +137,10 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
+@@ -136,7 +137,8 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
{
struct compat_robust_list_head __user *head;
unsigned long ret;
- const struct cred *cred = current_cred(), *pcred;
-+#ifndef CONFIG_GRKERNSEC_PROC_MEMMAP
+ const struct cred *cred = current_cred();
+ const struct cred *pcred;
-+#endif
if (!futex_cmpxchg_enabled)
return -ENOSYS;
-@@ -152,6 +156,10 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
+@@ -152,6 +154,10 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
if (!p)
goto err_unlock;
ret = -EPERM;
+#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP
+ if (!ptrace_may_access(p, PTRACE_MODE_READ))
+ goto err_unlock;
-+#else
++#endif
pcred = __task_cred(p);
/* If victim is in different user_ns, then uids are not
comparable, so we must have CAP_SYS_PTRACE */
-@@ -166,6 +174,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
- !ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE))
- goto err_unlock;
- ok:
-+#endif
- head = p->compat_robust_list;
- rcu_read_unlock();
- }
diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c
index 9b22d03..6295b62 100644
--- a/kernel/gcov/base.c
@@ -64930,7 +63673,7 @@ index 9b22d03..6295b62 100644
prev->next = info->next;
else
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
-index 2043c08..ec81a69 100644
+index ae34bf5..4e2f3d0 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1393,7 +1393,7 @@ void hrtimer_peek_ahead_timers(void)
@@ -64943,7 +63686,7 @@ index 2043c08..ec81a69 100644
hrtimer_peek_ahead_timers();
}
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
-index e6f1f24..6c19597 100644
+index 66ff710..05a5128 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -55,7 +55,9 @@ jump_label_sort_entries(struct jump_entry *start, struct jump_entry *stop)
@@ -64956,7 +63699,7 @@ index e6f1f24..6c19597 100644
}
static void jump_label_update(struct jump_label_key *key, int enable);
-@@ -298,10 +300,12 @@ static void jump_label_invalidate_module_init(struct module *mod)
+@@ -303,10 +305,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;
@@ -65076,10 +63819,10 @@ index 079f1d3..a407562 100644
return -ENOMEM;
reset_iter(iter, 0);
diff --git a/kernel/kexec.c b/kernel/kexec.c
-index 8d814cb..20e6552 100644
+index dc7bc08..4601964 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
-@@ -1033,7 +1033,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;
@@ -65090,7 +63833,7 @@ index 8d814cb..20e6552 100644
/* Don't allow clients that don't understand the native
diff --git a/kernel/kmod.c b/kernel/kmod.c
-index fabfe54..eac5a21 100644
+index a4bea97..7a1ae9a 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -73,13 +73,12 @@ char modprobe_path[KMOD_PATH_LEN] = "/sbin/modprobe";
@@ -65199,7 +63942,7 @@ index fabfe54..eac5a21 100644
/*
* If ret is 0, either ____call_usermodehelper failed and the
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
-index 7798181..2fcc39d 100644
+index e5d8464..4cc8cf0 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)
@@ -65220,7 +63963,7 @@ index 7798181..2fcc39d 100644
kfree(kip);
}
return 1;
-@@ -1936,7 +1936,7 @@ static int __init init_kprobes(void)
+@@ -1949,7 +1949,7 @@ static int __init init_kprobes(void)
{
int i, err = 0;
unsigned long offset = 0, size = 0;
@@ -65229,7 +63972,7 @@ index 7798181..2fcc39d 100644
const char *symbol_name;
void *addr;
struct kprobe_blackpoint *kb;
-@@ -2062,7 +2062,7 @@ static int __kprobes show_kprobe_addr(struct seq_file *pi, void *v)
+@@ -2075,7 +2075,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;
@@ -65239,10 +63982,10 @@ index 7798181..2fcc39d 100644
head = &kprobe_table[i];
preempt_disable();
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
-index 298c927..0a5cd2a 100644
+index b2e08c9..01d8049 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
-@@ -583,6 +583,10 @@ static int static_obj(void *obj)
+@@ -592,6 +592,10 @@ static int static_obj(void *obj)
end = (unsigned long) &_end,
addr = (unsigned long) obj;
@@ -65253,7 +63996,7 @@ index 298c927..0a5cd2a 100644
/*
* static variable?
*/
-@@ -718,6 +722,7 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
+@@ -731,6 +735,7 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
if (!static_obj(lock->key)) {
debug_locks_off();
printk("INFO: trying to register non-static key.\n");
@@ -65261,7 +64004,7 @@ index 298c927..0a5cd2a 100644
printk("the code is fine but needs lockdep annotation.\n");
printk("turning off the locking correctness validator.\n");
dump_stack();
-@@ -2936,7 +2941,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
+@@ -3042,7 +3047,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
if (!class)
return 0;
}
@@ -65271,7 +64014,7 @@ index 298c927..0a5cd2a 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 71edd2f..e0542a5 100644
+index 91c32a0..b2c71c5 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)
@@ -65284,7 +64027,7 @@ index 71edd2f..e0542a5 100644
if (!name) {
diff --git a/kernel/module.c b/kernel/module.c
-index 795bdc7..485cd3a 100644
+index 178333c..04e3408 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -58,6 +58,7 @@
@@ -65332,7 +64075,7 @@ index 795bdc7..485cd3a 100644
printk(KERN_WARNING "%s: per-cpu alignment %li > %li\n",
mod->name, align, PAGE_SIZE);
align = PAGE_SIZE;
-@@ -1166,7 +1168,7 @@ resolve_symbol_wait(struct module *mod,
+@@ -1183,7 +1185,7 @@ resolve_symbol_wait(struct module *mod,
*/
#ifdef CONFIG_SYSFS
@@ -65341,7 +64084,7 @@ index 795bdc7..485cd3a 100644
static inline bool sect_empty(const Elf_Shdr *sect)
{
return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size == 0;
-@@ -1632,21 +1634,21 @@ static void set_section_ro_nx(void *base,
+@@ -1649,21 +1651,21 @@ static void set_section_ro_nx(void *base,
static void unset_module_core_ro_nx(struct module *mod)
{
@@ -65371,7 +64114,7 @@ index 795bdc7..485cd3a 100644
set_memory_rw);
}
-@@ -1657,14 +1659,14 @@ void set_all_modules_text_rw(void)
+@@ -1674,14 +1676,14 @@ void set_all_modules_text_rw(void)
mutex_lock(&module_mutex);
list_for_each_entry_rcu(mod, &modules, list) {
@@ -65392,7 +64135,7 @@ index 795bdc7..485cd3a 100644
set_memory_rw);
}
}
-@@ -1678,14 +1680,14 @@ void set_all_modules_text_ro(void)
+@@ -1695,14 +1697,14 @@ void set_all_modules_text_ro(void)
mutex_lock(&module_mutex);
list_for_each_entry_rcu(mod, &modules, list) {
@@ -65413,7 +64156,7 @@ index 795bdc7..485cd3a 100644
set_memory_ro);
}
}
-@@ -1722,16 +1724,19 @@ static void free_module(struct module *mod)
+@@ -1748,16 +1750,19 @@ static void free_module(struct module *mod)
/* This may be NULL, but that's OK */
unset_module_init_ro_nx(mod);
@@ -65436,7 +64179,7 @@ index 795bdc7..485cd3a 100644
#ifdef CONFIG_MPU
update_protections(current->mm);
-@@ -1800,10 +1805,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -1826,10 +1831,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
unsigned int i;
int ret = 0;
const struct kernel_symbol *ksym;
@@ -65468,7 +64211,7 @@ index 795bdc7..485cd3a 100644
switch (sym[i].st_shndx) {
case SHN_COMMON:
/* We compiled with -fno-common. These are not
-@@ -1824,7 +1850,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -1850,7 +1876,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)) {
@@ -65478,7 +64221,7 @@ index 795bdc7..485cd3a 100644
break;
}
-@@ -1843,11 +1871,20 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -1869,11 +1897,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;
@@ -65499,7 +64242,7 @@ index 795bdc7..485cd3a 100644
return ret;
}
-@@ -1931,22 +1968,12 @@ static void layout_sections(struct module *mod, struct load_info *info)
+@@ -1977,22 +2014,12 @@ static void layout_sections(struct module *mod, struct load_info *info)
|| s->sh_entsize != ~0UL
|| strstarts(sname, ".init"))
continue;
@@ -65526,7 +64269,7 @@ index 795bdc7..485cd3a 100644
}
DEBUGP("Init section allocation order:\n");
-@@ -1960,23 +1987,13 @@ static void layout_sections(struct module *mod, struct load_info *info)
+@@ -2006,23 +2033,13 @@ static void layout_sections(struct module *mod, struct load_info *info)
|| s->sh_entsize != ~0UL
|| !strstarts(sname, ".init"))
continue;
@@ -65555,7 +64298,7 @@ index 795bdc7..485cd3a 100644
}
}
-@@ -2141,7 +2158,7 @@ static void layout_symtab(struct module *mod, struct load_info *info)
+@@ -2187,7 +2204,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;
@@ -65564,7 +64307,7 @@ index 795bdc7..485cd3a 100644
info->index.sym) | INIT_OFFSET_MASK;
DEBUGP("\t%s\n", info->secstrings + symsect->sh_name);
-@@ -2158,19 +2175,19 @@ static void layout_symtab(struct module *mod, struct load_info *info)
+@@ -2204,19 +2221,19 @@ static void layout_symtab(struct module *mod, struct load_info *info)
}
/* Append room for core symbols at end of core part. */
@@ -65589,7 +64332,7 @@ index 795bdc7..485cd3a 100644
}
static void add_kallsyms(struct module *mod, const struct load_info *info)
-@@ -2186,11 +2203,13 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
+@@ -2232,11 +2249,13 @@ 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;
@@ -65604,7 +64347,7 @@ index 795bdc7..485cd3a 100644
src = mod->symtab;
*dst = *src;
for (ndst = i = 1; i < mod->num_symtab; ++i, ++src) {
-@@ -2203,10 +2222,12 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
+@@ -2249,10 +2268,12 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
}
mod->core_num_syms = ndst;
@@ -65618,8 +64361,8 @@ index 795bdc7..485cd3a 100644
}
#else
static inline void layout_symtab(struct module *mod, struct load_info *info)
-@@ -2235,17 +2256,33 @@ static void dynamic_debug_remove(struct _ddebug *debug)
- ddebug_remove_module(debug->modname);
+@@ -2286,17 +2307,33 @@ void * __weak module_alloc(unsigned long size)
+ return size == 0 ? NULL : vmalloc_exec(size);
}
-static void *module_alloc_update_bounds(unsigned long size)
@@ -65657,7 +64400,31 @@ index 795bdc7..485cd3a 100644
mutex_unlock(&module_mutex);
}
return ret;
-@@ -2538,7 +2575,7 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2474,8 +2511,14 @@ static struct module *setup_load_info(struct load_info *info)
+ static int check_modinfo(struct module *mod, struct load_info *info)
+ {
+ const char *modmagic = get_modinfo(info, "vermagic");
++ const char *license = get_modinfo(info, "license");
+ int err;
+
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_OR
++ if (!license || !license_is_gpl_compatible(license))
++ return -ENOEXEC;
++#endif
++
+ /* This is allowed: modprobe --force will invalidate it. */
+ if (!modmagic) {
+ err = try_to_force_load(mod, "bad vermagic");
+@@ -2498,7 +2541,7 @@ static int check_modinfo(struct module *mod, struct load_info *info)
+ }
+
+ /* Set up license info based on the info section */
+- set_license(mod, get_modinfo(info, "license"));
++ set_license(mod, license);
+
+ return 0;
+ }
+@@ -2592,7 +2635,7 @@ static int move_module(struct module *mod, struct load_info *info)
void *ptr;
/* Do the allocs. */
@@ -65666,7 +64433,7 @@ index 795bdc7..485cd3a 100644
/*
* The pointer to this block is stored in the module structure
* which is inside the block. Just mark it as not being a
-@@ -2548,23 +2585,50 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2602,23 +2645,50 @@ static int move_module(struct module *mod, struct load_info *info)
if (!ptr)
return -ENOMEM;
@@ -65725,7 +64492,7 @@ index 795bdc7..485cd3a 100644
/* Transfer each section which specifies SHF_ALLOC */
DEBUGP("final section addresses:\n");
-@@ -2575,16 +2639,45 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2629,16 +2699,45 @@ static int move_module(struct module *mod, struct load_info *info)
if (!(shdr->sh_flags & SHF_ALLOC))
continue;
@@ -65778,7 +64545,7 @@ index 795bdc7..485cd3a 100644
DEBUGP("\t0x%lx %s\n",
shdr->sh_addr, info->secstrings + shdr->sh_name);
}
-@@ -2635,12 +2728,12 @@ static void flush_module_icache(const struct module *mod)
+@@ -2689,12 +2788,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.
*/
@@ -65797,7 +64564,7 @@ index 795bdc7..485cd3a 100644
set_fs(old_fs);
}
-@@ -2712,8 +2805,10 @@ static void module_deallocate(struct module *mod, struct load_info *info)
+@@ -2774,8 +2873,10 @@ static void module_deallocate(struct module *mod, struct load_info *info)
{
kfree(info->strmap);
percpu_modfree(mod);
@@ -65809,8 +64576,8 @@ index 795bdc7..485cd3a 100644
+ module_free(mod, mod->module_core_rw);
}
- static int post_relocation(struct module *mod, const struct load_info *info)
-@@ -2770,9 +2865,38 @@ static struct module *load_module(void __user *umod,
+ int __weak module_finalize(const Elf_Ehdr *hdr,
+@@ -2839,9 +2940,38 @@ static struct module *load_module(void __user *umod,
if (err)
goto free_unload;
@@ -65849,7 +64616,7 @@ index 795bdc7..485cd3a 100644
/* Fix up syms, so that st_value is a pointer to location. */
err = simplify_symbols(mod, &info);
if (err < 0)
-@@ -2788,13 +2912,6 @@ static struct module *load_module(void __user *umod,
+@@ -2857,13 +2987,6 @@ static struct module *load_module(void __user *umod,
flush_module_icache(mod);
@@ -65863,7 +64630,7 @@ index 795bdc7..485cd3a 100644
/* Mark state as coming so strong_try_module_get() ignores us. */
mod->state = MODULE_STATE_COMING;
-@@ -2854,11 +2971,10 @@ static struct module *load_module(void __user *umod,
+@@ -2921,11 +3044,10 @@ static struct module *load_module(void __user *umod,
unlock:
mutex_unlock(&module_mutex);
synchronize_sched();
@@ -65876,7 +64643,7 @@ index 795bdc7..485cd3a 100644
free_unload:
module_unload_free(mod);
free_module:
-@@ -2899,16 +3015,16 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
+@@ -2966,16 +3088,16 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
MODULE_STATE_COMING, mod);
/* Set RO and NX regions for core */
@@ -65901,7 +64668,7 @@ index 795bdc7..485cd3a 100644
do_mod_ctors(mod);
/* Start the module */
-@@ -2954,11 +3070,12 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
+@@ -3021,11 +3143,12 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
mod->strtab = mod->core_strtab;
#endif
unset_module_init_ro_nx(mod);
@@ -65919,7 +64686,7 @@ index 795bdc7..485cd3a 100644
mutex_unlock(&module_mutex);
return 0;
-@@ -2989,10 +3106,16 @@ static const char *get_ksymbol(struct module *mod,
+@@ -3056,10 +3179,16 @@ static const char *get_ksymbol(struct module *mod,
unsigned long nextval;
/* At worse, next value is at end of module */
@@ -65939,7 +64706,7 @@ index 795bdc7..485cd3a 100644
/* Scan for closest preceding symbol, and next symbol. (ELF
starts real symbols at 1). */
-@@ -3238,7 +3361,7 @@ static int m_show(struct seq_file *m, void *p)
+@@ -3307,7 +3436,7 @@ static int m_show(struct seq_file *m, void *p)
char buf[8];
seq_printf(m, "%s %u",
@@ -65948,7 +64715,7 @@ index 795bdc7..485cd3a 100644
print_unload_info(m, mod);
/* Informative for users. */
-@@ -3247,7 +3370,7 @@ static int m_show(struct seq_file *m, void *p)
+@@ -3316,7 +3445,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. */
@@ -65957,7 +64724,7 @@ index 795bdc7..485cd3a 100644
/* Taints info */
if (mod->taints)
-@@ -3283,7 +3406,17 @@ static const struct file_operations proc_modules_operations = {
+@@ -3352,7 +3481,17 @@ static const struct file_operations proc_modules_operations = {
static int __init proc_modules_init(void)
{
@@ -65975,7 +64742,7 @@ index 795bdc7..485cd3a 100644
return 0;
}
module_init(proc_modules_init);
-@@ -3342,12 +3475,12 @@ struct module *__module_address(unsigned long addr)
+@@ -3411,12 +3550,12 @@ struct module *__module_address(unsigned long addr)
{
struct module *mod;
@@ -65991,7 +64758,7 @@ index 795bdc7..485cd3a 100644
return mod;
return NULL;
}
-@@ -3381,11 +3514,20 @@ bool is_module_text_address(unsigned long addr)
+@@ -3450,11 +3589,20 @@ bool is_module_text_address(unsigned long addr)
*/
struct module *__module_text_address(unsigned long addr)
{
@@ -66016,7 +64783,7 @@ index 795bdc7..485cd3a 100644
}
return mod;
diff --git a/kernel/mutex-debug.c b/kernel/mutex-debug.c
-index 73da83a..fe46e99 100644
+index 7e3443f..b2a1e6b 100644
--- a/kernel/mutex-debug.c
+++ b/kernel/mutex-debug.c
@@ -49,21 +49,21 @@ void debug_mutex_free_waiter(struct mutex_waiter *waiter)
@@ -66064,7 +64831,7 @@ 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 d607ed5..58d0a52 100644
+index 89096dd..f91ebc5 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -198,7 +198,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
@@ -66096,7 +64863,7 @@ index d607ed5..58d0a52 100644
/* set it to 0 if there are no waiters left: */
diff --git a/kernel/padata.c b/kernel/padata.c
-index b91941d..0871d60 100644
+index b452599..5d68f4e 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -132,10 +132,10 @@ int padata_do_parallel(struct padata_instance *pinst,
@@ -66123,10 +64890,23 @@ index b91941d..0871d60 100644
atomic_set(&pd->refcnt, 0);
pd->pinst = pinst;
diff --git a/kernel/panic.c b/kernel/panic.c
-index 6923167..40233c5 100644
+index b2659360..5972a0f 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
-@@ -369,7 +369,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
+@@ -78,7 +78,11 @@ NORET_TYPE void panic(const char * fmt, ...)
+ va_end(args);
+ printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
+ #ifdef CONFIG_DEBUG_BUGVERBOSE
+- dump_stack();
++ /*
++ * Avoid nested stack-dumping if a panic occurs during oops processing
++ */
++ if (!oops_in_progress)
++ dump_stack();
+ #endif
+
+ /*
+@@ -373,7 +377,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
const char *board;
printk(KERN_WARNING "------------[ cut here ]------------\n");
@@ -66135,7 +64915,7 @@ index 6923167..40233c5 100644
board = dmi_get_system_info(DMI_PRODUCT_NAME);
if (board)
printk(KERN_WARNING "Hardware name: %s\n", board);
-@@ -424,7 +424,8 @@ EXPORT_SYMBOL(warn_slowpath_null);
+@@ -428,7 +432,8 @@ EXPORT_SYMBOL(warn_slowpath_null);
*/
void __stack_chk_fail(void)
{
@@ -66146,7 +64926,7 @@ index 6923167..40233c5 100644
}
EXPORT_SYMBOL(__stack_chk_fail);
diff --git a/kernel/pid.c b/kernel/pid.c
-index 57a8346..bf76ba3 100644
+index fa5f722..0c93e57 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -33,6 +33,7 @@
@@ -66166,14 +64946,17 @@ index 57a8346..bf76ba3 100644
int pid_max_min = RESERVED_PIDS + 1;
int pid_max_max = PID_MAX_LIMIT;
-@@ -419,8 +420,15 @@ EXPORT_SYMBOL(pid_task);
+@@ -418,10 +419,18 @@ EXPORT_SYMBOL(pid_task);
*/
struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns)
{
+ struct task_struct *task;
+
- rcu_lockdep_assert(rcu_read_lock_held());
+ rcu_lockdep_assert(rcu_read_lock_held(),
+ "find_task_by_pid_ns() needs rcu_read_lock()"
+ " protection");
- return pid_task(find_pid_ns(nr, ns), PIDTYPE_PID);
++
+ task = pid_task(find_pid_ns(nr, ns), PIDTYPE_PID);
+
+ if (gr_pid_is_chrooted(task))
@@ -66183,13 +64966,15 @@ index 57a8346..bf76ba3 100644
}
struct task_struct *find_task_by_vpid(pid_t vnr)
-@@ -428,6 +436,12 @@ struct task_struct *find_task_by_vpid(pid_t vnr)
+@@ -429,6 +438,14 @@ struct task_struct *find_task_by_vpid(pid_t vnr)
return find_task_by_pid_ns(vnr, current->nsproxy->pid_ns);
}
+struct task_struct *find_task_by_vpid_unrestricted(pid_t vnr)
+{
-+ rcu_lockdep_assert(rcu_read_lock_held());
++ 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);
+}
+
@@ -66197,7 +64982,7 @@ index 57a8346..bf76ba3 100644
{
struct pid *pid;
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
-index 640ded8..3dafb85 100644
+index e7cb76d..75eceb3 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -6,6 +6,7 @@
@@ -66226,7 +65011,7 @@ index 640ded8..3dafb85 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 4556182..9335419 100644
+index 69185ae..cc2847a 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -43,6 +43,7 @@
@@ -66288,16 +65073,7 @@ index 4556182..9335419 100644
.clock_getres = hrtimer_get_res,
.clock_get = posix_get_boottime,
.nsleep = common_nsleep,
-@@ -272,6 +273,8 @@ static __init int init_posix_timers(void)
- .timer_del = common_timer_del,
- };
-
-+ pax_track_stack();
-+
- posix_timers_register_clock(CLOCK_REALTIME, &clock_realtime);
- posix_timers_register_clock(CLOCK_MONOTONIC, &clock_monotonic);
- posix_timers_register_clock(CLOCK_MONOTONIC_RAW, &clock_monotonic_raw);
-@@ -473,7 +476,7 @@ void posix_timers_register_clock(const clockid_t clock_id,
+@@ -473,7 +474,7 @@ void posix_timers_register_clock(const clockid_t clock_id,
return;
}
@@ -66306,7 +65082,7 @@ index 4556182..9335419 100644
}
EXPORT_SYMBOL_GPL(posix_timers_register_clock);
-@@ -519,9 +522,9 @@ static struct k_clock *clockid_to_kclock(const clockid_t id)
+@@ -519,9 +520,9 @@ static struct k_clock *clockid_to_kclock(const clockid_t id)
return (id & CLOCKFD_MASK) == CLOCKFD ?
&clock_posix_dynamic : &clock_posix_cpu;
@@ -66318,7 +65094,7 @@ index 4556182..9335419 100644
}
static int common_timer_create(struct k_itimer *new_timer)
-@@ -959,6 +962,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
+@@ -959,6 +960,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
if (copy_from_user(&new_tp, tp, sizeof (*tp)))
return -EFAULT;
@@ -66346,7 +65122,7 @@ index d523593..68197a4 100644
register_sysrq_key('o', &sysrq_poweroff_op);
return 0;
diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 0cf3a27..5481be4 100644
+index addbbe5..f9e32e0 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -41,6 +41,7 @@ static int try_to_freeze_tasks(bool sig_only)
@@ -66392,10 +65168,10 @@ index 0cf3a27..5481be4 100644
if (pm_wakeup_pending()) {
diff --git a/kernel/printk.c b/kernel/printk.c
-index 084982f..1b753ad 100644
+index 7982a0a..2095fdc 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
-@@ -313,12 +313,17 @@ static int check_syslog_permissions(int type, bool from_file)
+@@ -313,6 +313,11 @@ static int check_syslog_permissions(int type, bool from_file)
if (from_file && type != SYSLOG_ACTION_OPEN)
return 0;
@@ -66407,15 +65183,8 @@ index 084982f..1b753ad 100644
if (syslog_action_restricted(type)) {
if (capable(CAP_SYSLOG))
return 0;
- /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */
- if (capable(CAP_SYS_ADMIN)) {
-- WARN_ONCE(1, "Attempt to access syslog with CAP_SYS_ADMIN "
-+ printk_once(KERN_WARNING "Attempt to access syslog with CAP_SYS_ADMIN "
- "but no CAP_SYSLOG (deprecated).\n");
- return 0;
- }
diff --git a/kernel/profile.c b/kernel/profile.c
-index 961b389..c451353 100644
+index 76b8e77..a2930e8 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -39,7 +39,7 @@ struct profile_hit {
@@ -66476,10 +65245,10 @@ index 961b389..c451353 100644
}
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index 2df1157..34df1b0 100644
+index 78ab24a..332c915 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
-@@ -132,7 +132,8 @@ int ptrace_check_attach(struct task_struct *child, int kill)
+@@ -172,7 +172,8 @@ int ptrace_check_attach(struct task_struct *child, bool ignore_state)
return ret;
}
@@ -66489,7 +65258,7 @@ index 2df1157..34df1b0 100644
{
const struct cred *cred = current_cred(), *tcred;
-@@ -158,7 +159,8 @@ int __ptrace_may_access(struct task_struct *task, unsigned int mode)
+@@ -198,7 +199,8 @@ int __ptrace_may_access(struct task_struct *task, unsigned int mode)
cred->gid == tcred->sgid &&
cred->gid == tcred->gid))
goto ok;
@@ -66499,7 +65268,7 @@ index 2df1157..34df1b0 100644
goto ok;
rcu_read_unlock();
return -EPERM;
-@@ -167,7 +169,9 @@ ok:
+@@ -207,7 +209,9 @@ ok:
smp_rmb();
if (task->mm)
dumpable = get_dumpable(task->mm);
@@ -66510,7 +65279,7 @@ index 2df1157..34df1b0 100644
return -EPERM;
return security_ptrace_access_check(task, mode);
-@@ -177,7 +181,16 @@ bool ptrace_may_access(struct task_struct *task, unsigned int mode)
+@@ -217,7 +221,21 @@ bool ptrace_may_access(struct task_struct *task, unsigned int mode)
{
int err;
task_lock(task);
@@ -66520,6 +65289,11 @@ index 2df1157..34df1b0 100644
+ return !err;
+}
+
++bool ptrace_may_access_nolock(struct task_struct *task, unsigned int mode)
++{
++ return __ptrace_may_access(task, mode, 0);
++}
++
+bool ptrace_may_access_log(struct task_struct *task, unsigned int mode)
+{
+ int err;
@@ -66528,7 +65302,7 @@ index 2df1157..34df1b0 100644
task_unlock(task);
return !err;
}
-@@ -205,7 +218,7 @@ static int ptrace_attach(struct task_struct *task)
+@@ -262,7 +280,7 @@ static int ptrace_attach(struct task_struct *task, long request,
goto out;
task_lock(task);
@@ -66537,25 +65311,16 @@ index 2df1157..34df1b0 100644
task_unlock(task);
if (retval)
goto unlock_creds;
-@@ -218,7 +231,7 @@ static int ptrace_attach(struct task_struct *task)
- goto unlock_tasklist;
-
+@@ -277,7 +295,7 @@ static int ptrace_attach(struct task_struct *task, long request,
task->ptrace = PT_PTRACED;
+ if (seize)
+ task->ptrace |= PT_SEIZED;
- if (task_ns_capable(task, CAP_SYS_PTRACE))
+ if (task_ns_capable_nolog(task, CAP_SYS_PTRACE))
task->ptrace |= PT_PTRACE_CAP;
__ptrace_link(task, current);
-@@ -406,6 +419,8 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
- {
- int copied = 0;
-
-+ pax_track_stack();
-+
- while (len > 0) {
- char buf[128];
- int this_len, retval;
-@@ -417,7 +432,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
+@@ -483,7 +501,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
break;
return -EIO;
}
@@ -66564,29 +65329,16 @@ index 2df1157..34df1b0 100644
return -EFAULT;
copied += retval;
src += retval;
-@@ -431,6 +446,8 @@ int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long ds
- {
- int copied = 0;
-
-+ pax_track_stack();
-+
- while (len > 0) {
- char buf[128];
- int this_len, retval;
-@@ -613,9 +630,11 @@ int ptrace_request(struct task_struct *child, long request,
- {
+@@ -680,7 +698,7 @@ int ptrace_request(struct task_struct *child, long request,
+ bool seized = child->ptrace & PT_SEIZED;
int ret = -EIO;
- siginfo_t siginfo;
+ siginfo_t siginfo, *si;
- void __user *datavp = (void __user *) data;
+ void __user *datavp = (__force void __user *) data;
unsigned long __user *datalp = datavp;
+ unsigned long flags;
-+ pax_track_stack();
-+
- switch (request) {
- case PTRACE_PEEKTEXT:
- case PTRACE_PEEKDATA:
-@@ -761,14 +780,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
+@@ -882,14 +900,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
goto out;
}
@@ -66595,8 +65347,8 @@ index 2df1157..34df1b0 100644
+ goto out_put_task_struct;
+ }
+
- if (request == PTRACE_ATTACH) {
- ret = ptrace_attach(child);
+ if (request == PTRACE_ATTACH || request == PTRACE_SEIZE) {
+ ret = ptrace_attach(child, request, data);
/*
* Some architectures need to do book-keeping after
* a ptrace attach.
@@ -66609,7 +65361,7 @@ index 2df1157..34df1b0 100644
goto out_put_task_struct;
}
-@@ -793,7 +819,7 @@ int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
+@@ -915,7 +940,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;
@@ -66618,16 +65370,7 @@ index 2df1157..34df1b0 100644
}
int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
-@@ -816,6 +842,8 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
- siginfo_t siginfo;
- int ret;
-
-+ pax_track_stack();
-+
- switch (request) {
- case PTRACE_PEEKTEXT:
- case PTRACE_PEEKDATA:
-@@ -903,14 +931,21 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
+@@ -1025,14 +1050,21 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
goto out;
}
@@ -66636,8 +65379,8 @@ index 2df1157..34df1b0 100644
+ goto out_put_task_struct;
+ }
+
- if (request == PTRACE_ATTACH) {
- ret = ptrace_attach(child);
+ if (request == PTRACE_ATTACH || request == PTRACE_SEIZE) {
+ ret = ptrace_attach(child, request, data);
/*
* Some architectures need to do book-keeping after
* a ptrace attach.
@@ -66651,7 +65394,7 @@ index 2df1157..34df1b0 100644
}
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
-index 2e138db..781b267 100644
+index 764825c..3aa6ac4 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -138,12 +138,12 @@ static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count) =
@@ -66714,7 +65457,7 @@ index 2e138db..781b267 100644
if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) {
rp->rtort_mbtest = 0;
list_del(&rp->rtort_free);
-@@ -882,7 +882,7 @@ rcu_torture_writer(void *arg)
+@@ -872,7 +872,7 @@ rcu_torture_writer(void *arg)
i = old_rp->rtort_pipe_count;
if (i > RCU_TORTURE_PIPE_LEN)
i = RCU_TORTURE_PIPE_LEN;
@@ -66723,7 +65466,7 @@ index 2e138db..781b267 100644
old_rp->rtort_pipe_count++;
cur_ops->deferred_free(old_rp);
}
-@@ -951,7 +951,7 @@ static void rcu_torture_timer(unsigned long unused)
+@@ -940,7 +940,7 @@ static void rcu_torture_timer(unsigned long unused)
return;
}
if (p->rtort_mbtest == 0)
@@ -66732,7 +65475,7 @@ index 2e138db..781b267 100644
spin_lock(&rand_lock);
cur_ops->read_delay(&rand);
n_rcu_torture_timers++;
-@@ -1013,7 +1013,7 @@ rcu_torture_reader(void *arg)
+@@ -1001,7 +1001,7 @@ rcu_torture_reader(void *arg)
continue;
}
if (p->rtort_mbtest == 0)
@@ -66741,7 +65484,7 @@ index 2e138db..781b267 100644
cur_ops->read_delay(&rand);
preempt_disable();
pipe_count = p->rtort_pipe_count;
-@@ -1072,16 +1072,16 @@ rcu_torture_printk(char *page)
+@@ -1060,16 +1060,16 @@ rcu_torture_printk(char *page)
rcu_torture_current,
rcu_torture_current_version,
list_empty(&rcu_torture_freelist),
@@ -66763,7 +65506,7 @@ index 2e138db..781b267 100644
n_rcu_torture_boost_ktrerror != 0 ||
n_rcu_torture_boost_rterror != 0 ||
n_rcu_torture_boost_failure != 0)
-@@ -1089,7 +1089,7 @@ rcu_torture_printk(char *page)
+@@ -1077,7 +1077,7 @@ rcu_torture_printk(char *page)
cnt += sprintf(&page[cnt], "\n%s%s ", torture_type, TORTURE_FLAG);
if (i > 1) {
cnt += sprintf(&page[cnt], "!!! ");
@@ -66772,7 +65515,7 @@ index 2e138db..781b267 100644
WARN_ON_ONCE(1);
}
cnt += sprintf(&page[cnt], "Reader Pipe: ");
-@@ -1103,7 +1103,7 @@ rcu_torture_printk(char *page)
+@@ -1091,7 +1091,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",
@@ -66781,7 +65524,7 @@ index 2e138db..781b267 100644
}
cnt += sprintf(&page[cnt], "\n");
if (cur_ops->stats)
-@@ -1412,7 +1412,7 @@ rcu_torture_cleanup(void)
+@@ -1401,7 +1401,7 @@ rcu_torture_cleanup(void)
if (cur_ops->cleanup)
cur_ops->cleanup();
@@ -66790,7 +65533,7 @@ index 2e138db..781b267 100644
rcu_torture_print_module_parms(cur_ops, "End of test: FAILURE");
else
rcu_torture_print_module_parms(cur_ops, "End of test: SUCCESS");
-@@ -1476,17 +1476,17 @@ rcu_torture_init(void)
+@@ -1465,17 +1465,17 @@ rcu_torture_init(void)
rcu_torture_current = NULL;
rcu_torture_current_version = 0;
@@ -66815,11 +65558,11 @@ index 2e138db..781b267 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 ba06207..85d8ba8 100644
+index 6b76d81..7afc1b3 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
-@@ -356,9 +356,9 @@ void rcu_enter_nohz(void)
- }
+@@ -367,9 +367,9 @@ void rcu_enter_nohz(void)
+ trace_rcu_dyntick("Start");
/* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */
smp_mb__before_atomic_inc(); /* See above. */
- atomic_inc(&rdtp->dynticks);
@@ -66828,9 +65571,9 @@ index ba06207..85d8ba8 100644
- WARN_ON_ONCE(atomic_read(&rdtp->dynticks) & 0x1);
+ WARN_ON_ONCE(atomic_read_unchecked(&rdtp->dynticks) & 0x1);
local_irq_restore(flags);
+ }
- /* If the interrupt queued a callback, get out of dyntick mode. */
-@@ -387,10 +387,10 @@ void rcu_exit_nohz(void)
+@@ -391,10 +391,10 @@ void rcu_exit_nohz(void)
return;
}
smp_mb__before_atomic_inc(); /* Force ordering w/previous sojourn. */
@@ -66840,10 +65583,10 @@ index ba06207..85d8ba8 100644
smp_mb__after_atomic_inc(); /* See above. */
- WARN_ON_ONCE(!(atomic_read(&rdtp->dynticks) & 0x1));
+ WARN_ON_ONCE(!(atomic_read_unchecked(&rdtp->dynticks) & 0x1));
+ trace_rcu_dyntick("End");
local_irq_restore(flags);
}
-
-@@ -406,14 +406,14 @@ void rcu_nmi_enter(void)
+@@ -411,14 +411,14 @@ void rcu_nmi_enter(void)
struct rcu_dynticks *rdtp = &__get_cpu_var(rcu_dynticks);
if (rdtp->dynticks_nmi_nesting == 0 &&
@@ -66861,7 +65604,7 @@ index ba06207..85d8ba8 100644
}
/**
-@@ -432,9 +432,9 @@ void rcu_nmi_exit(void)
+@@ -437,9 +437,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. */
@@ -66873,7 +65616,7 @@ index ba06207..85d8ba8 100644
}
/**
-@@ -469,7 +469,7 @@ void rcu_irq_exit(void)
+@@ -474,7 +474,7 @@ void rcu_irq_exit(void)
*/
static int dyntick_save_progress_counter(struct rcu_data *rdp)
{
@@ -66882,26 +65625,26 @@ index ba06207..85d8ba8 100644
return 0;
}
-@@ -484,7 +484,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
- unsigned long curr;
- unsigned long snap;
+@@ -489,7 +489,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
+ unsigned int curr;
+ unsigned int snap;
-- curr = (unsigned long)atomic_add_return(0, &rdp->dynticks->dynticks);
-+ curr = (unsigned long)atomic_add_return_unchecked(0, &rdp->dynticks->dynticks);
- snap = (unsigned long)rdp->dynticks_snap;
+- curr = (unsigned int)atomic_add_return(0, &rdp->dynticks->dynticks);
++ curr = (unsigned int)atomic_add_return_unchecked(0, &rdp->dynticks->dynticks);
+ snap = (unsigned int)rdp->dynticks_snap;
/*
-@@ -1470,7 +1470,7 @@ __rcu_process_callbacks(struct rcu_state *rsp, struct rcu_data *rdp)
+@@ -1552,7 +1552,7 @@ __rcu_process_callbacks(struct rcu_state *rsp, struct rcu_data *rdp)
/*
- * Do softirq processing for the current CPU.
+ * 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,
- &__get_cpu_var(rcu_sched_data));
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
-index 01b2ccd..4f5d80a 100644
+index 849ce9e..74bc9de 100644
--- a/kernel/rcutree.h
+++ b/kernel/rcutree.h
@@ -86,7 +86,7 @@
@@ -66914,10 +65657,10 @@ index 01b2ccd..4f5d80a 100644
/* RCU's kthread states for tracing. */
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
-index 8aafbb8..754d4ad 100644
+index 4b9b9f8..2326053 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
-@@ -822,7 +822,7 @@ void synchronize_rcu_expedited(void)
+@@ -842,7 +842,7 @@ void synchronize_rcu_expedited(void)
/* Clean up and exit. */
smp_mb(); /* ensure expedited GP seen before counter increment. */
@@ -66926,7 +65669,7 @@ index 8aafbb8..754d4ad 100644
unlock_mb_ret:
mutex_unlock(&sync_rcu_preempt_exp_mutex);
mb_ret:
-@@ -1774,8 +1774,8 @@ EXPORT_SYMBOL_GPL(synchronize_sched_expedited);
+@@ -1815,8 +1815,8 @@ EXPORT_SYMBOL_GPL(synchronize_sched_expedited);
#else /* #ifndef CONFIG_SMP */
@@ -66937,7 +65680,7 @@ index 8aafbb8..754d4ad 100644
static int synchronize_sched_expedited_cpu_stop(void *data)
{
-@@ -1830,7 +1830,7 @@ void synchronize_sched_expedited(void)
+@@ -1871,7 +1871,7 @@ void synchronize_sched_expedited(void)
int firstsnap, s, snap, trycount = 0;
/* Note that atomic_inc_return() implies full memory barrier. */
@@ -66946,7 +65689,7 @@ index 8aafbb8..754d4ad 100644
get_online_cpus();
/*
-@@ -1851,7 +1851,7 @@ void synchronize_sched_expedited(void)
+@@ -1892,7 +1892,7 @@ void synchronize_sched_expedited(void)
}
/* Check to see if someone else did our work for us. */
@@ -66955,7 +65698,7 @@ index 8aafbb8..754d4ad 100644
if (UINT_CMP_GE((unsigned)s, (unsigned)firstsnap)) {
smp_mb(); /* ensure test happens before caller kfree */
return;
-@@ -1866,7 +1866,7 @@ void synchronize_sched_expedited(void)
+@@ -1907,7 +1907,7 @@ void synchronize_sched_expedited(void)
* grace period works for us.
*/
get_online_cpus();
@@ -66964,7 +65707,7 @@ index 8aafbb8..754d4ad 100644
smp_mb(); /* ensure read is before try_stop_cpus(). */
}
-@@ -1877,12 +1877,12 @@ void synchronize_sched_expedited(void)
+@@ -1918,12 +1918,12 @@ void synchronize_sched_expedited(void)
* than we did beat us to the punch.
*/
do {
@@ -66979,21 +65722,39 @@ index 8aafbb8..754d4ad 100644
put_online_cpus();
}
-diff --git a/kernel/relay.c b/kernel/relay.c
-index 859ea5a..096e2fe 100644
---- a/kernel/relay.c
-+++ b/kernel/relay.c
-@@ -1236,6 +1236,8 @@ static ssize_t subbuf_splice_actor(struct file *in,
- };
- ssize_t ret;
-
-+ pax_track_stack();
-+
- if (rbuf->subbufs_produced == rbuf->subbufs_consumed)
- return 0;
- if (splice_grow_spd(pipe, &spd))
+@@ -1985,7 +1985,7 @@ int rcu_needs_cpu(int cpu)
+ for_each_online_cpu(thatcpu) {
+ if (thatcpu == cpu)
+ continue;
+- snap = atomic_add_return(0, &per_cpu(rcu_dynticks,
++ snap = atomic_add_return_unchecked(0, &per_cpu(rcu_dynticks,
+ thatcpu).dynticks);
+ smp_mb(); /* Order sampling of snap with end of grace period. */
+ if ((snap & 0x1) != 0) {
+diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
+index 9feffa4..54058df 100644
+--- a/kernel/rcutree_trace.c
++++ b/kernel/rcutree_trace.c
+@@ -69,7 +69,7 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp)
+ rdp->qs_pending);
+ #ifdef CONFIG_NO_HZ
+ seq_printf(m, " dt=%d/%d/%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);
+@@ -143,7 +143,7 @@ static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp)
+ rdp->qs_pending);
+ #ifdef CONFIG_NO_HZ
+ seq_printf(m, ",%d,%d,%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);
diff --git a/kernel/resource.c b/kernel/resource.c
-index 3ff4017..72d77ae 100644
+index 7640b3a..5879283 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -141,8 +141,18 @@ static const struct file_operations proc_iomem_operations = {
@@ -67016,7 +65777,7 @@ index 3ff4017..72d77ae 100644
}
__initcall(ioresources_init);
diff --git a/kernel/rtmutex-tester.c b/kernel/rtmutex-tester.c
-index 5c9ccd3..a35e22b 100644
+index 3d9f31c..7fefc9e 100644
--- a/kernel/rtmutex-tester.c
+++ b/kernel/rtmutex-tester.c
@@ -20,7 +20,7 @@
@@ -67110,19 +65871,39 @@ index 5c9ccd3..a35e22b 100644
default:
diff --git a/kernel/sched.c b/kernel/sched.c
-index 063d7a4..cee15b0 100644
+index d6b149c..896cbb8 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
-@@ -4227,6 +4227,8 @@ static void __sched __schedule(void)
- struct rq *rq;
- int cpu;
+@@ -4389,6 +4389,19 @@ pick_next_task(struct rq *rq)
+ BUG(); /* the idle class will always have a runnable task */
+ }
+
++#ifdef CONFIG_GRKERNSEC_SETXID
++extern void gr_delayed_cred_worker(void);
++static inline void gr_cred_schedule(void)
++{
++ if (unlikely(current->delayed_cred))
++ gr_delayed_cred_worker();
++}
++#else
++static inline void gr_cred_schedule(void)
++{
++}
++#endif
++
+ /*
+ * __schedule() is the main scheduler function.
+ */
+@@ -4408,6 +4421,8 @@ need_resched:
+
+ schedule_debug(prev);
-+ pax_track_stack();
++ gr_cred_schedule();
+
- need_resched:
- preempt_disable();
- cpu = smp_processor_id();
-@@ -4920,6 +4922,8 @@ int can_nice(const struct task_struct *p, const int nice)
+ if (sched_feat(HRTICK))
+ hrtick_clear(rq);
+
+@@ -5098,6 +5113,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;
@@ -67131,7 +65912,7 @@ index 063d7a4..cee15b0 100644
return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
capable(CAP_SYS_NICE));
}
-@@ -4953,7 +4957,8 @@ SYSCALL_DEFINE1(nice, int, increment)
+@@ -5131,7 +5148,8 @@ SYSCALL_DEFINE1(nice, int, increment)
if (nice > 19)
nice = 19;
@@ -67141,7 +65922,7 @@ index 063d7a4..cee15b0 100644
return -EPERM;
retval = security_task_setnice(current, nice);
-@@ -5097,6 +5102,7 @@ recheck:
+@@ -5288,6 +5306,7 @@ recheck:
unsigned long rlim_rtprio =
task_rlimit(p, RLIMIT_RTPRIO);
@@ -67172,10 +65953,10 @@ index 429242f..d7cca82 100644
#ifdef CONFIG_RT_GROUP_SCHED
/*
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
-index c768588..f6c5ce6 100644
+index 8a39fa3..34f3dbc 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
-@@ -4050,7 +4050,7 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) { }
+@@ -4801,7 +4801,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).
*/
@@ -67185,7 +65966,7 @@ index c768588..f6c5ce6 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 43fee1c..03a4485 100644
+index 2065515..aed2987 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -45,12 +45,12 @@ static struct kmem_cache *sigqueue_cachep;
@@ -67212,7 +65993,7 @@ index 43fee1c..03a4485 100644
handler = sig_handler(t, sig);
-@@ -320,6 +320,9 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
+@@ -364,6 +364,9 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
atomic_inc(&user->sigpending);
rcu_read_unlock();
@@ -67222,7 +66003,7 @@ index 43fee1c..03a4485 100644
if (override_rlimit ||
atomic_read(&user->sigpending) <=
task_rlimit(t, RLIMIT_SIGPENDING)) {
-@@ -444,7 +447,7 @@ flush_signal_handlers(struct task_struct *t, int force_default)
+@@ -488,7 +491,7 @@ flush_signal_handlers(struct task_struct *t, int force_default)
int unhandled_signal(struct task_struct *tsk, int sig)
{
@@ -67231,7 +66012,7 @@ index 43fee1c..03a4485 100644
if (is_global_init(tsk))
return 1;
if (handler != SIG_IGN && handler != SIG_DFL)
-@@ -770,6 +773,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,
}
}
@@ -67245,7 +66026,7 @@ index 43fee1c..03a4485 100644
return security_task_kill(t, info, sig, 0);
}
-@@ -1092,7 +1102,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
+@@ -1165,7 +1175,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
return send_signal(sig, info, p, 1);
}
@@ -67254,7 +66035,7 @@ index 43fee1c..03a4485 100644
specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
{
return send_signal(sig, info, t, 0);
-@@ -1129,6 +1139,7 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
+@@ -1202,6 +1212,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;
@@ -67262,7 +66043,7 @@ index 43fee1c..03a4485 100644
spin_lock_irqsave(&t->sighand->siglock, flags);
action = &t->sighand->action[sig-1];
-@@ -1143,9 +1154,18 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
+@@ -1216,9 +1227,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;
@@ -67281,7 +66062,7 @@ index 43fee1c..03a4485 100644
return ret;
}
-@@ -1212,8 +1232,11 @@ int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
+@@ -1285,8 +1305,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();
@@ -67294,16 +66075,7 @@ index 43fee1c..03a4485 100644
return ret;
}
-@@ -1839,6 +1862,8 @@ void ptrace_notify(int exit_code)
- {
- siginfo_t info;
-
-+ pax_track_stack();
-+
- BUG_ON((exit_code & (0x7f | ~0xffff)) != SIGTRAP);
-
- memset(&info, 0, sizeof info);
-@@ -2637,7 +2662,15 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info)
+@@ -2754,7 +2777,15 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info)
int error = -ESRCH;
rcu_read_lock();
@@ -67321,7 +66093,7 @@ index 43fee1c..03a4485 100644
error = check_kill_permission(sig, info, p);
/*
diff --git a/kernel/smp.c b/kernel/smp.c
-index fb67dfa..f819e2e 100644
+index db197d6..17aef0b 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)
@@ -67352,7 +66124,7 @@ index fb67dfa..f819e2e 100644
raw_spin_unlock_irq(&call_function.lock);
}
diff --git a/kernel/softirq.c b/kernel/softirq.c
-index fca82c3..1db9690 100644
+index 2c71d91..1021f81 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
@@ -67406,7 +66178,7 @@ index fca82c3..1db9690 100644
struct tasklet_struct *list;
diff --git a/kernel/sys.c b/kernel/sys.c
-index f88dadc..9061ebd 100644
+index 481611f..0754d86 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)
@@ -67422,7 +66194,7 @@ index f88dadc..9061ebd 100644
no_nice = security_task_setnice(p, niceval);
if (no_nice) {
error = no_nice;
-@@ -541,6 +547,9 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid)
+@@ -572,6 +578,9 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid)
goto error;
}
@@ -67432,7 +66204,7 @@ index f88dadc..9061ebd 100644
if (rgid != (gid_t) -1 ||
(egid != (gid_t) -1 && egid != old->gid))
new->sgid = new->egid;
-@@ -570,6 +579,10 @@ SYSCALL_DEFINE1(setgid, gid_t, gid)
+@@ -601,6 +610,10 @@ SYSCALL_DEFINE1(setgid, gid_t, gid)
old = current_cred();
retval = -EPERM;
@@ -67443,30 +66215,16 @@ index f88dadc..9061ebd 100644
if (nsown_capable(CAP_SETGID))
new->gid = new->egid = new->sgid = new->fsgid = gid;
else if (gid == old->gid || gid == old->sgid)
-@@ -595,11 +608,18 @@ static int set_user(struct cred *new)
- if (!new_user)
- return -EAGAIN;
-
-+ /*
-+ * We don't fail in case of NPROC limit excess here because too many
-+ * poorly written programs don't check set*uid() return code, assuming
-+ * it never fails if called by root. We may still enforce NPROC limit
-+ * for programs doing set*uid()+execve() by harmlessly deferring the
-+ * failure to the execve() stage.
-+ */
- if (atomic_read(&new_user->processes) >= rlimit(RLIMIT_NPROC) &&
-- new_user != INIT_USER) {
-- free_uid(new_user);
-- return -EAGAIN;
-- }
-+ new_user != INIT_USER)
-+ current->flags |= PF_NPROC_EXCEEDED;
-+ else
-+ current->flags &= ~PF_NPROC_EXCEEDED;
+@@ -618,7 +631,7 @@ error:
+ /*
+ * change the user struct in a credentials set to match the new UID
+ */
+-static int set_user(struct cred *new)
++int set_user(struct cred *new)
+ {
+ struct user_struct *new_user;
- free_uid(new->user);
- new->user = new_user;
-@@ -650,6 +670,9 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
+@@ -688,6 +701,9 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
goto error;
}
@@ -67476,7 +66234,7 @@ index f88dadc..9061ebd 100644
if (new->uid != old->uid) {
retval = set_user(new);
if (retval < 0)
-@@ -694,6 +717,12 @@ SYSCALL_DEFINE1(setuid, uid_t, uid)
+@@ -732,6 +748,12 @@ SYSCALL_DEFINE1(setuid, uid_t, uid)
old = current_cred();
retval = -EPERM;
@@ -67489,7 +66247,7 @@ index f88dadc..9061ebd 100644
if (nsown_capable(CAP_SETUID)) {
new->suid = new->uid = uid;
if (uid != old->uid) {
-@@ -748,6 +777,9 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
+@@ -786,6 +808,9 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
goto error;
}
@@ -67499,7 +66257,7 @@ index f88dadc..9061ebd 100644
if (ruid != (uid_t) -1) {
new->uid = ruid;
if (ruid != old->uid) {
-@@ -812,6 +844,9 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
+@@ -850,6 +875,9 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
goto error;
}
@@ -67509,7 +66267,7 @@ index f88dadc..9061ebd 100644
if (rgid != (gid_t) -1)
new->gid = rgid;
if (egid != (gid_t) -1)
-@@ -858,6 +893,9 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
+@@ -896,6 +924,9 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
old = current_cred();
old_fsuid = old->fsuid;
@@ -67519,7 +66277,7 @@ index f88dadc..9061ebd 100644
if (uid == old->uid || uid == old->euid ||
uid == old->suid || uid == old->fsuid ||
nsown_capable(CAP_SETUID)) {
-@@ -868,6 +906,7 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
+@@ -906,6 +937,7 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
}
}
@@ -67527,7 +66285,7 @@ index f88dadc..9061ebd 100644
abort_creds(new);
return old_fsuid;
-@@ -894,12 +933,16 @@ SYSCALL_DEFINE1(setfsgid, gid_t, gid)
+@@ -932,12 +964,16 @@ SYSCALL_DEFINE1(setfsgid, gid_t, gid)
if (gid == old->gid || gid == old->egid ||
gid == old->sgid || gid == old->fsgid ||
nsown_capable(CAP_SETGID)) {
@@ -67544,7 +66302,19 @@ index f88dadc..9061ebd 100644
abort_creds(new);
return old_fsgid;
-@@ -1205,19 +1248,19 @@ SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
+@@ -1189,7 +1225,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;
+ }
+@@ -1243,19 +1282,19 @@ SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
return -EFAULT;
down_read(&uts_sem);
@@ -67569,7 +66339,7 @@ index f88dadc..9061ebd 100644
__OLD_UTS_LEN);
error |= __put_user(0, name->machine + __OLD_UTS_LEN);
up_read(&uts_sem);
-@@ -1680,7 +1723,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
+@@ -1720,7 +1759,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
error = get_dumpable(me->mm);
break;
case PR_SET_DUMPABLE:
@@ -67579,10 +66349,10 @@ index f88dadc..9061ebd 100644
break;
}
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
-index f175d98..87202ca 100644
+index ae27196..7506d69 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
-@@ -85,6 +85,13 @@
+@@ -86,6 +86,13 @@
#if defined(CONFIG_SYSCTL)
@@ -67596,7 +66366,7 @@ index f175d98..87202ca 100644
/* External variables not in a header file. */
extern int sysctl_overcommit_memory;
-@@ -197,6 +204,7 @@ static int sysrq_sysctl_handler(ctl_table *table, int write,
+@@ -191,6 +198,7 @@ static int sysrq_sysctl_handler(ctl_table *table, int write,
}
#endif
@@ -67604,7 +66374,7 @@ index f175d98..87202ca 100644
static struct ctl_table root_table[];
static struct ctl_table_root sysctl_table_root;
-@@ -226,6 +234,20 @@ extern struct ctl_table epoll_table[];
+@@ -220,6 +228,20 @@ extern struct ctl_table epoll_table[];
int sysctl_legacy_va_layout;
#endif
@@ -67625,7 +66395,7 @@ index f175d98..87202ca 100644
/* The default sysctl tables: */
static struct ctl_table root_table[] = {
-@@ -272,6 +294,22 @@ static int max_extfrag_threshold = 1000;
+@@ -266,6 +288,22 @@ static int max_extfrag_threshold = 1000;
#endif
static struct ctl_table kern_table[] = {
@@ -67648,7 +66418,7 @@ index f175d98..87202ca 100644
{
.procname = "sched_child_runs_first",
.data = &sysctl_sched_child_runs_first,
-@@ -546,7 +584,7 @@ static struct ctl_table kern_table[] = {
+@@ -550,7 +588,7 @@ static struct ctl_table kern_table[] = {
.data = &modprobe_path,
.maxlen = KMOD_PATH_LEN,
.mode = 0644,
@@ -67657,7 +66427,7 @@ index f175d98..87202ca 100644
},
{
.procname = "modules_disabled",
-@@ -713,16 +751,20 @@ static struct ctl_table kern_table[] = {
+@@ -717,16 +755,20 @@ static struct ctl_table kern_table[] = {
.extra1 = &zero,
.extra2 = &one,
},
@@ -67679,7 +66449,7 @@ index f175d98..87202ca 100644
{
.procname = "ngroups_max",
.data = &ngroups_max,
-@@ -1205,6 +1247,13 @@ static struct ctl_table vm_table[] = {
+@@ -1216,6 +1258,13 @@ static struct ctl_table vm_table[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
},
@@ -67693,7 +66463,7 @@ index f175d98..87202ca 100644
#else
{
.procname = "nr_trim_pages",
-@@ -1714,6 +1763,17 @@ static int test_perm(int mode, int op)
+@@ -1720,6 +1769,17 @@ static int test_perm(int mode, int op)
int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op)
{
int mode;
@@ -67711,7 +66481,7 @@ index f175d98..87202ca 100644
if (root->permissions)
mode = root->permissions(root, current->nsproxy, table);
-@@ -2118,6 +2178,16 @@ int proc_dostring(struct ctl_table *table, int write,
+@@ -2124,6 +2184,16 @@ int proc_dostring(struct ctl_table *table, int write,
buffer, lenp, ppos);
}
@@ -67728,7 +66498,7 @@ index f175d98..87202ca 100644
static size_t proc_skip_spaces(char **buf)
{
size_t ret;
-@@ -2223,6 +2293,8 @@ static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
+@@ -2229,6 +2299,8 @@ static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
len = strlen(tmp);
if (len > *size)
len = *size;
@@ -67737,7 +66507,7 @@ index f175d98..87202ca 100644
if (copy_to_user(*buf, tmp, len))
return -EFAULT;
*size -= len;
-@@ -2539,8 +2611,11 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
+@@ -2545,8 +2617,11 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
*i = val;
} else {
val = convdiv * (*i) / convmul;
@@ -67750,7 +66520,7 @@ index f175d98..87202ca 100644
err = proc_put_long(&buffer, &left, val, false);
if (err)
break;
-@@ -2935,6 +3010,12 @@ int proc_dostring(struct ctl_table *table, int write,
+@@ -2941,6 +3016,12 @@ int proc_dostring(struct ctl_table *table, int write,
return -ENOSYS;
}
@@ -67763,7 +66533,7 @@ index f175d98..87202ca 100644
int proc_dointvec(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
-@@ -2991,6 +3072,7 @@ EXPORT_SYMBOL(proc_dointvec_minmax);
+@@ -2997,6 +3078,7 @@ EXPORT_SYMBOL(proc_dointvec_minmax);
EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
EXPORT_SYMBOL(proc_dointvec_ms_jiffies);
EXPORT_SYMBOL(proc_dostring);
@@ -67772,7 +66542,7 @@ index f175d98..87202ca 100644
EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);
EXPORT_SYMBOL(register_sysctl_table);
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
-index 3b8e028..ec43594 100644
+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,
@@ -67839,7 +66609,7 @@ index 3b8e028..ec43594 100644
if (result < 0)
goto out;
diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c
-index 4e4932a..be244da 100644
+index 362da65..ab8ef8c 100644
--- a/kernel/sysctl_check.c
+++ b/kernel/sysctl_check.c
@@ -129,6 +129,7 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
@@ -67851,7 +66621,7 @@ index 4e4932a..be244da 100644
(table->proc_handler == proc_dointvec_minmax) ||
(table->proc_handler == proc_dointvec_jiffies) ||
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
-index 8d597b1..6eab856 100644
+index e660464..c8b9e67 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -27,9 +27,12 @@
@@ -67860,14 +66630,14 @@ index 8d597b1..6eab856 100644
#include <linux/file.h>
+#include <linux/grsecurity.h>
#include <net/genetlink.h>
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
+extern int gr_is_taskstats_denied(int pid);
+
/*
* Maximum length of a cpumask that can be specified in
* the TASKSTATS_CMD_ATTR_REGISTER/DEREGISTER_CPUMASK attribute
-@@ -558,6 +561,9 @@ err:
+@@ -556,6 +559,9 @@ err:
static int taskstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
{
@@ -67878,7 +66648,7 @@ index 8d597b1..6eab856 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 d776062..fa8d186 100644
+index 73e416d..cfc6f69 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)
@@ -67894,11 +66664,11 @@ index d776062..fa8d186 100644
sys_tz = *tz;
update_vsyscall_tz();
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
-index 8b70c76..923e9f5 100644
+index 8a46f5d..bbe6f9c 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
-@@ -693,7 +693,7 @@ static int __init alarmtimer_init(void)
- {
+@@ -773,7 +773,7 @@ static int __init alarmtimer_init(void)
+ struct platform_device *pdev;
int error = 0;
int i;
- struct k_clock alarm_clock = {
@@ -67907,7 +66677,7 @@ index 8b70c76..923e9f5 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 7a90d02..6d8585a 100644
+index fd4a7b1..fae5c2a 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)
@@ -67920,7 +66690,7 @@ index 7a90d02..6d8585a 100644
cpumask_clear_cpu(cpu, tick_get_broadcast_mask());
tick_broadcast_clear_oneshot(cpu);
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
-index 5f45831..a62c75e 100644
+index 2378413..be455fd 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -14,6 +14,7 @@
@@ -67986,7 +66756,7 @@ index 3258455..f35227d 100644
return -ENOMEM;
return 0;
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c
-index a5d0a3a..60c7948 100644
+index 0b537f2..9e71eca 100644
--- a/kernel/time/timer_stats.c
+++ b/kernel/time/timer_stats.c
@@ -116,7 +116,7 @@ static ktime_t time_start, time_stop;
@@ -68058,7 +66828,7 @@ index a5d0a3a..60c7948 100644
return -ENOMEM;
return 0;
diff --git a/kernel/timer.c b/kernel/timer.c
-index 8cff361..0fb5cd8 100644
+index 9c3c62b..441690e 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1304,7 +1304,7 @@ void update_process_times(int user_tick)
@@ -68071,10 +66841,10 @@ index 8cff361..0fb5cd8 100644
struct tvec_base *base = __this_cpu_read(tvec_bases);
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
-index 6957aa2..915e96e 100644
+index 16fc34a..efd8bb8 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
-@@ -321,7 +321,7 @@ static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
+@@ -324,7 +324,7 @@ static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
struct blk_trace *bt = filp->private_data;
char buf[16];
@@ -68083,7 +66853,7 @@ index 6957aa2..915e96e 100644
return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));
}
-@@ -386,7 +386,7 @@ static int blk_subbuf_start_callback(struct rchan_buf *buf, void *subbuf,
+@@ -389,7 +389,7 @@ static int blk_subbuf_start_callback(struct rchan_buf *buf, void *subbuf,
return 1;
bt = buf->chan->private_data;
@@ -68092,7 +66862,7 @@ index 6957aa2..915e96e 100644
return 0;
}
-@@ -487,7 +487,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
+@@ -490,7 +490,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
bt->dir = dir;
bt->dev = dev;
@@ -68102,10 +66872,10 @@ index 6957aa2..915e96e 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 ef9271b..e4e7c1c 100644
+index b1e8943..369e4ff 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
-@@ -1566,12 +1566,17 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec)
+@@ -1587,12 +1587,17 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec)
if (unlikely(ftrace_disabled))
return 0;
@@ -68125,7 +66895,7 @@ index ef9271b..e4e7c1c 100644
}
/*
-@@ -2570,7 +2575,7 @@ static void ftrace_free_entry_rcu(struct rcu_head *rhp)
+@@ -2609,7 +2614,7 @@ static void ftrace_free_entry_rcu(struct rcu_head *rhp)
int
register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
@@ -68135,28 +66905,10 @@ index ef9271b..e4e7c1c 100644
struct ftrace_func_probe *entry;
struct ftrace_page *pg;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
-index 0731e81a..91f8a79 100644
+index f2bd275..adaf3a2 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
-@@ -3339,6 +3339,8 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
- size_t rem;
- unsigned int i;
-
-+ pax_track_stack();
-+
- if (splice_grow_spd(pipe, &spd))
- return -ENOMEM;
-
-@@ -3822,6 +3824,8 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
- int entries, size, i;
- size_t ret;
-
-+ pax_track_stack();
-+
- if (splice_grow_spd(pipe, &spd))
- return -ENOMEM;
-
-@@ -3990,10 +3994,9 @@ static const struct file_operations tracing_dyn_info_fops = {
+@@ -4201,10 +4201,9 @@ static const struct file_operations tracing_dyn_info_fops = {
};
#endif
@@ -68168,7 +66920,7 @@ index 0731e81a..91f8a79 100644
static int once;
if (d_tracer)
-@@ -4013,10 +4016,9 @@ struct dentry *tracing_init_dentry(void)
+@@ -4224,10 +4223,9 @@ struct dentry *tracing_init_dentry(void)
return d_tracer;
}
@@ -68181,10 +66933,10 @@ index 0731e81a..91f8a79 100644
struct dentry *d_tracer;
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
-index 2d04936..7d78f18 100644
+index c212a7f..7b02394 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
-@@ -1317,10 +1317,6 @@ static LIST_HEAD(ftrace_module_file_list);
+@@ -1299,10 +1299,6 @@ static LIST_HEAD(ftrace_module_file_list);
struct ftrace_module_file_ops {
struct list_head list;
struct module *mod;
@@ -68195,7 +66947,7 @@ index 2d04936..7d78f18 100644
};
static struct ftrace_module_file_ops *
-@@ -1341,17 +1337,12 @@ trace_create_file_ops(struct module *mod)
+@@ -1323,17 +1319,12 @@ trace_create_file_ops(struct module *mod)
file_ops->mod = mod;
@@ -68219,7 +66971,7 @@ index 2d04936..7d78f18 100644
list_add(&file_ops->list, &ftrace_module_file_list);
-@@ -1375,8 +1366,8 @@ static void trace_module_add_events(struct module *mod)
+@@ -1357,8 +1348,8 @@ static void trace_module_add_events(struct module *mod)
for_each_event(call, start, end) {
__trace_add_event_call(*call, mod,
@@ -68231,7 +66983,7 @@ index 2d04936..7d78f18 100644
}
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
-index 27d13b3..4f310a9 100644
+index 00d527c..7c5b1a3 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,
@@ -68271,7 +67023,7 @@ index 27d13b3..4f310a9 100644
} 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 017fa37..39f50bc 100644
+index fd3c8aa..5f324a6 100644
--- a/kernel/trace/trace_mmiotrace.c
+++ b/kernel/trace/trace_mmiotrace.c
@@ -24,7 +24,7 @@ struct header_iter {
@@ -68311,7 +67063,7 @@ index 017fa37..39f50bc 100644
}
entry = ring_buffer_event_data(event);
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
-index e37de49..981a7c2 100644
+index 5199930..26c73a0 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, struct path *path)
@@ -68324,7 +67076,7 @@ index e37de49..981a7c2 100644
s->len = p - s->buffer;
return 1;
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
-index b0b53b8..fbfd580 100644
+index 77575b3..6e623d1 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -50,7 +50,7 @@ static inline void check_stack(void)
@@ -68368,44 +67120,44 @@ index 209b379..7f76423 100644
put_task_struct(tsk);
}
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
-index dd373c8..111fdb1 100644
+index 82928f5..92da771 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
-@@ -1088,6 +1088,7 @@ config LATENCYTOP
+@@ -1103,6 +1103,7 @@ config LATENCYTOP
depends on DEBUG_KERNEL
depends on STACKTRACE_SUPPORT
depends on PROC_FS
+ depends on !GRKERNSEC_HIDESYM
- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE
+ select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND
select KALLSYMS
select KALLSYMS_ALL
diff --git a/lib/bitmap.c b/lib/bitmap.c
-index 3f3b681..6c5ef68 100644
+index 0d4a127..33a06c7 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
-@@ -421,7 +421,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
+@@ -419,7 +419,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
{
int c, old_c, totaldigits, ndigits, nchunks, nbits;
u32 chunk;
-- const char __user *ubuf = buf;
+- const char __user __force *ubuf = (const char __user __force *)buf;
+ const char __user *ubuf = (const char __force_user *)buf;
bitmap_zero(maskp, nmaskbits);
-@@ -506,7 +506,7 @@ int bitmap_parse_user(const char __user *ubuf,
+@@ -504,7 +504,7 @@ int bitmap_parse_user(const char __user *ubuf,
{
if (!access_ok(VERIFY_READ, ubuf, ulen))
return -EFAULT;
-- return __bitmap_parse((const char *)ubuf, ulen, 1, maskp, nmaskbits);
-+ return __bitmap_parse((const char __force_kernel *)ubuf, ulen, 1, maskp, nmaskbits);
- }
- EXPORT_SYMBOL(bitmap_parse_user);
+- return __bitmap_parse((const char __force *)ubuf,
++ return __bitmap_parse((const char __force_kernel *)ubuf,
+ ulen, 1, maskp, nmaskbits);
+ }
@@ -596,7 +596,7 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen,
{
unsigned a, b;
int c, old_c, totaldigits;
-- const char __user *ubuf = buf;
+- const char __user __force *ubuf = (const char __user __force *)buf;
+ const char __user *ubuf = (const char __force_user *)buf;
int exp_digit, in_range;
@@ -68414,7 +67166,7 @@ index 3f3b681..6c5ef68 100644
{
if (!access_ok(VERIFY_READ, ubuf, ulen))
return -EFAULT;
-- return __bitmap_parselist((const char *)ubuf,
+- return __bitmap_parselist((const char __force *)ubuf,
+ return __bitmap_parselist((const char __force_kernel *)ubuf,
ulen, 1, maskp, nmaskbits);
}
@@ -68446,18 +67198,18 @@ index a78b7c6..2c73084 100644
return;
diff --git a/lib/devres.c b/lib/devres.c
-index 6efddf5..89df310 100644
+index 7c0e953..f642b5c 100644
--- a/lib/devres.c
+++ b/lib/devres.c
-@@ -81,7 +81,7 @@ void devm_iounmap(struct device *dev, void __iomem *addr)
+@@ -80,7 +80,7 @@ EXPORT_SYMBOL(devm_ioremap_nocache);
+ void devm_iounmap(struct device *dev, void __iomem *addr)
{
- iounmap(addr);
WARN_ON(devres_destroy(dev, devm_ioremap_release, devm_ioremap_match,
- (void *)addr));
+ (void __force *)addr));
+ iounmap(addr);
}
EXPORT_SYMBOL(devm_iounmap);
-
@@ -141,7 +141,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr)
{
ioport_unmap(addr);
@@ -68468,10 +67220,10 @@ index 6efddf5..89df310 100644
EXPORT_SYMBOL(devm_ioport_unmap);
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
-index db07bfd..719b5ab 100644
+index fea790a..ebb0e82 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
-@@ -870,7 +870,7 @@ out:
+@@ -925,7 +925,7 @@ out:
static void check_for_stack(struct device *dev, void *addr)
{
@@ -68516,6 +67268,20 @@ index 013a761..c28f3fc 100644
#define free(a) kfree(a)
#endif
+diff --git a/lib/is_single_threaded.c b/lib/is_single_threaded.c
+index bd2bea9..6b3c95e 100644
+--- a/lib/is_single_threaded.c
++++ b/lib/is_single_threaded.c
+@@ -22,6 +22,9 @@ bool current_is_single_threaded(void)
+ struct task_struct *p, *t;
+ bool ret;
+
++ if (!mm)
++ return true;
++
+ if (atomic_read(&task->signal->live) != 1)
+ return false;
+
diff --git a/lib/kref.c b/lib/kref.c
index 3efb882..8492f4c 100644
--- a/lib/kref.c
@@ -68530,7 +67296,7 @@ index 3efb882..8492f4c 100644
if (atomic_dec_and_test(&kref->refcount)) {
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
-index 7ea2e03..cabda0f 100644
+index d9df745..e73c2fe 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -80,7 +80,7 @@ struct radix_tree_preload {
@@ -68543,7 +67309,7 @@ index 7ea2e03..cabda0f 100644
static inline void *ptr_to_indirect(void *ptr)
{
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
-index 4365df3..c8c7105 100644
+index 993599e..84dc70e 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -16,6 +16,9 @@
@@ -68556,7 +67322,7 @@ index 4365df3..c8c7105 100644
#include <stdarg.h>
#include <linux/module.h>
#include <linux/types.h>
-@@ -435,7 +438,7 @@ char *symbol_string(char *buf, char *end, void *ptr,
+@@ -413,7 +416,7 @@ char *symbol_string(char *buf, char *end, void *ptr,
char sym[KSYM_SYMBOL_LEN];
if (ext == 'B')
sprint_backtrace(sym, value);
@@ -68565,7 +67331,7 @@ index 4365df3..c8c7105 100644
sprint_symbol(sym, value);
else
kallsyms_lookup(value, NULL, NULL, NULL, sym);
-@@ -799,7 +802,11 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
+@@ -777,7 +780,11 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
return string(buf, end, uuid, spec);
}
@@ -68577,7 +67343,7 @@ index 4365df3..c8c7105 100644
/*
* Show a '%p' thing. A kernel extension is that the '%p' is followed
-@@ -813,6 +820,8 @@ int kptr_restrict __read_mostly;
+@@ -791,6 +798,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
@@ -68586,7 +67352,7 @@ index 4365df3..c8c7105 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
-@@ -857,12 +866,12 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
+@@ -835,12 +844,12 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
{
if (!ptr && *fmt != 'K') {
/*
@@ -68601,7 +67367,7 @@ index 4365df3..c8c7105 100644
}
switch (*fmt) {
-@@ -872,6 +881,13 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
+@@ -850,6 +859,13 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
/* Fallthrough */
case 'S':
case 's':
@@ -68615,7 +67381,7 @@ index 4365df3..c8c7105 100644
case 'B':
return symbol_string(buf, end, ptr, spec, *fmt);
case 'R':
-@@ -1631,11 +1647,11 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
+@@ -1608,11 +1624,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)); \
@@ -68630,7 +67396,7 @@ index 4365df3..c8c7105 100644
} \
args += sizeof(type); \
value; \
-@@ -1698,7 +1714,7 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
+@@ -1675,7 +1691,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;
@@ -68647,23 +67413,28 @@ index 0000000..7cd6065
@@ -0,0 +1 @@
+-grsec
diff --git a/mm/Kconfig b/mm/Kconfig
-index 8ca47a5..77ebfaa 100644
+index 011b110..b492af2 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
-@@ -240,7 +240,7 @@ config KSM
+@@ -241,10 +241,10 @@ config KSM
+ root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
+
config DEFAULT_MMAP_MIN_ADDR
- int "Low address space to protect from user allocation"
+- int "Low address space to protect from user allocation"
++ int "Low address space to protect from user allocation"
depends on MMU
- default 4096
-+ default 65536
- help
+- help
++ default 65536
++ help
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.
diff --git a/mm/filemap.c b/mm/filemap.c
-index a8251a8..33d52b0 100644
+index 5f0a3c9..4f87f0c 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
-@@ -1763,7 +1763,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
+@@ -1784,7 +1784,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)
@@ -68672,7 +67443,7 @@ index a8251a8..33d52b0 100644
file_accessed(file);
vma->vm_ops = &generic_file_vm_ops;
vma->vm_flags |= VM_CAN_NONLINEAR;
-@@ -2169,6 +2169,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
+@@ -2190,6 +2190,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) {
@@ -68681,10 +67452,10 @@ index a8251a8..33d52b0 100644
send_sig(SIGXFSZ, current, 0);
return -EFBIG;
diff --git a/mm/fremap.c b/mm/fremap.c
-index b8e0e2d..076e171 100644
+index 9ed4fd4..c42648d 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
-@@ -156,6 +156,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+@@ -155,6 +155,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
retry:
vma = find_vma(mm, start);
@@ -68697,7 +67468,7 @@ index b8e0e2d..076e171 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 693394d..fc807e2 100644
+index 57d82c6..e9e0552 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -125,9 +125,10 @@ static void flush_all_zero_pkmaps(void)
@@ -68726,10 +67497,10 @@ index 693394d..fc807e2 100644
set_page_address(page, (void *)vaddr);
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
-index cc5acf9..fd56cc0 100644
+index 36b3d98..584cb54 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
-@@ -702,7 +702,7 @@ out:
+@@ -703,7 +703,7 @@ out:
* run pte_offset_map on the pmd, if an huge pmd could
* materialize from under us from a different thread.
*/
@@ -68739,10 +67510,10 @@ index cc5acf9..fd56cc0 100644
/* 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 80936a1..c060d53 100644
+index 2316840..b418671 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
-@@ -2340,6 +2340,27 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2347,6 +2347,27 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
return 1;
}
@@ -68770,7 +67541,7 @@ index 80936a1..c060d53 100644
/*
* Hugetlb_cow() should be called with page lock of the original hugepage held.
*/
-@@ -2443,6 +2464,11 @@ retry_avoidcopy:
+@@ -2450,6 +2471,11 @@ retry_avoidcopy:
make_huge_pte(vma, new_page, 1));
page_remove_rmap(old_page);
hugepage_add_new_anon_rmap(new_page, vma, address);
@@ -68782,7 +67553,7 @@ index 80936a1..c060d53 100644
/* Make the old page be freed below */
new_page = old_page;
mmu_notifier_invalidate_range_end(mm,
-@@ -2594,6 +2620,10 @@ retry:
+@@ -2601,6 +2627,10 @@ retry:
&& (vma->vm_flags & VM_SHARED)));
set_huge_pte_at(mm, address, ptep, new_pte);
@@ -68793,7 +67564,7 @@ index 80936a1..c060d53 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);
-@@ -2623,6 +2653,10 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2630,6 +2660,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);
@@ -68804,7 +67575,7 @@ index 80936a1..c060d53 100644
ptep = huge_pte_offset(mm, address);
if (ptep) {
entry = huge_ptep_get(ptep);
-@@ -2634,6 +2668,26 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2641,6 +2675,26 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
VM_FAULT_SET_HINDEX(h - hstates);
}
@@ -68844,7 +67615,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 aacee45..ece1c1e 100644
+index f3b2a00..61da94d 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -357,7 +357,7 @@ static void print_unreferenced(struct seq_file *seq,
@@ -68857,7 +67628,7 @@ index aacee45..ece1c1e 100644
}
diff --git a/mm/maccess.c b/mm/maccess.c
-index 4cee182..e00511d 100644
+index d53adf9..03a24bf 100644
--- a/mm/maccess.c
+++ b/mm/maccess.c
@@ -26,7 +26,7 @@ long __probe_kernel_read(void *dst, const void *src, size_t size)
@@ -68879,7 +67650,7 @@ index 4cee182..e00511d 100644
set_fs(old_fs);
diff --git a/mm/madvise.c b/mm/madvise.c
-index 2221491..b8ee2d8 100644
+index 74bf193..feb6fd3 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -45,6 +45,10 @@ static long madvise_behavior(struct vm_area_struct * vma,
@@ -68959,10 +67730,10 @@ index 2221491..b8ee2d8 100644
if (end == start)
goto out;
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
-index 740c4f5..eb38047 100644
+index 06d3479..0778eef 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
-@@ -59,7 +59,7 @@ int sysctl_memory_failure_early_kill __read_mostly = 0;
+@@ -61,7 +61,7 @@ int sysctl_memory_failure_early_kill __read_mostly = 0;
int sysctl_memory_failure_recovery __read_mostly = 1;
@@ -68971,7 +67742,7 @@ index 740c4f5..eb38047 100644
#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
-@@ -200,7 +200,7 @@ static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno,
+@@ -202,7 +202,7 @@ static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno,
si.si_signo = SIGBUS;
si.si_errno = 0;
si.si_code = BUS_MCEERR_AO;
@@ -68980,7 +67751,7 @@ index 740c4f5..eb38047 100644
#ifdef __ARCH_SI_TRAPNO
si.si_trapno = trapno;
#endif
-@@ -1008,7 +1008,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
+@@ -1010,7 +1010,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
}
nr_pages = 1 << compound_trans_order(hpage);
@@ -68989,7 +67760,7 @@ index 740c4f5..eb38047 100644
/*
* We need/can do nothing about count=0 pages.
-@@ -1038,7 +1038,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
+@@ -1040,7 +1040,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
if (!PageHWPoison(hpage)
|| (hwpoison_filter(p) && TestClearPageHWPoison(p))
|| (p != hpage && TestSetPageHWPoison(hpage))) {
@@ -68998,7 +67769,7 @@ index 740c4f5..eb38047 100644
return 0;
}
set_page_hwpoison_huge_page(hpage);
-@@ -1096,7 +1096,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
+@@ -1098,7 +1098,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
}
if (hwpoison_filter(p)) {
if (TestClearPageHWPoison(p))
@@ -69007,7 +67778,7 @@ index 740c4f5..eb38047 100644
unlock_page(hpage);
put_page(hpage);
return 0;
-@@ -1222,7 +1222,7 @@ int unpoison_memory(unsigned long pfn)
+@@ -1315,7 +1315,7 @@ int unpoison_memory(unsigned long pfn)
return 0;
}
if (TestClearPageHWPoison(p))
@@ -69016,7 +67787,7 @@ index 740c4f5..eb38047 100644
pr_info("MCE: Software-unpoisoned free page %#lx\n", pfn);
return 0;
}
-@@ -1236,7 +1236,7 @@ int unpoison_memory(unsigned long pfn)
+@@ -1329,7 +1329,7 @@ int unpoison_memory(unsigned long pfn)
*/
if (TestClearPageHWPoison(page)) {
pr_info("MCE: Software-unpoisoned page %#lx\n", pfn);
@@ -69025,7 +67796,7 @@ index 740c4f5..eb38047 100644
freeit = 1;
if (PageHuge(page))
clear_page_hwpoison_huge_page(page);
-@@ -1349,7 +1349,7 @@ static int soft_offline_huge_page(struct page *page, int flags)
+@@ -1442,7 +1442,7 @@ static int soft_offline_huge_page(struct page *page, int flags)
}
done:
if (!PageHWPoison(hpage))
@@ -69034,7 +67805,7 @@ index 740c4f5..eb38047 100644
set_page_hwpoison_huge_page(hpage);
dequeue_hwpoisoned_huge_page(hpage);
/* keep elevated page count for bad page */
-@@ -1480,7 +1480,7 @@ int soft_offline_page(struct page *page, int flags)
+@@ -1573,7 +1573,7 @@ int soft_offline_page(struct page *page, int flags)
return ret;
done:
@@ -69044,7 +67815,7 @@ index 740c4f5..eb38047 100644
/* keep elevated page count for bad page */
return ret;
diff --git a/mm/memory.c b/mm/memory.c
-index 95a7799..4b036fe 100644
+index 829d437..3d3926a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -457,8 +457,12 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
@@ -69073,7 +67844,7 @@ index 95a7799..4b036fe 100644
}
/*
-@@ -1577,12 +1584,6 @@ no_page_table:
+@@ -1566,12 +1573,6 @@ no_page_table:
return page;
}
@@ -69086,7 +67857,7 @@ index 95a7799..4b036fe 100644
/**
* __get_user_pages() - pin user pages in memory
* @tsk: task_struct of target task
-@@ -1655,10 +1656,10 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
+@@ -1644,10 +1645,10 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
(VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);
i = 0;
@@ -69099,7 +67870,7 @@ index 95a7799..4b036fe 100644
if (!vma && in_gate_area(mm, start)) {
unsigned long pg = start & PAGE_MASK;
pgd_t *pgd;
-@@ -1706,7 +1707,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
+@@ -1695,7 +1696,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
goto next_page;
}
@@ -69108,7 +67879,7 @@ index 95a7799..4b036fe 100644
(vma->vm_flags & (VM_IO | VM_PFNMAP)) ||
!(vm_flags & vma->vm_flags))
return i ? : -EFAULT;
-@@ -1733,11 +1734,6 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
+@@ -1722,11 +1723,6 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
int ret;
unsigned int fault_flags = 0;
@@ -69120,7 +67891,7 @@ index 95a7799..4b036fe 100644
if (foll_flags & FOLL_WRITE)
fault_flags |= FAULT_FLAG_WRITE;
if (nonblocking)
-@@ -1811,7 +1807,7 @@ next_page:
+@@ -1800,7 +1796,7 @@ next_page:
start += PAGE_SIZE;
nr_pages--;
} while (nr_pages && start < vma->vm_end);
@@ -69129,7 +67900,7 @@ index 95a7799..4b036fe 100644
return i;
}
EXPORT_SYMBOL(__get_user_pages);
-@@ -2018,6 +2014,10 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
+@@ -2007,6 +2003,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));
@@ -69140,7 +67911,7 @@ index 95a7799..4b036fe 100644
retval = 0;
pte_unmap_unlock(pte, ptl);
return retval;
-@@ -2052,10 +2052,22 @@ out:
+@@ -2041,10 +2041,22 @@ out:
int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,
struct page *page)
{
@@ -69163,7 +67934,7 @@ index 95a7799..4b036fe 100644
vma->vm_flags |= VM_INSERTPAGE;
return insert_page(vma, addr, page, vma->vm_page_prot);
}
-@@ -2141,6 +2153,7 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
+@@ -2130,6 +2142,7 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
unsigned long pfn)
{
BUG_ON(!(vma->vm_flags & VM_MIXEDMAP));
@@ -69171,7 +67942,7 @@ index 95a7799..4b036fe 100644
if (addr < vma->vm_start || addr >= vma->vm_end)
return -EFAULT;
-@@ -2456,6 +2469,186 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo
+@@ -2445,6 +2458,186 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo
copy_user_highpage(dst, src, va, vma);
}
@@ -69358,7 +68129,7 @@ index 95a7799..4b036fe 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
-@@ -2667,6 +2860,12 @@ gotten:
+@@ -2656,6 +2849,12 @@ gotten:
*/
page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
if (likely(pte_same(*page_table, orig_pte))) {
@@ -69371,7 +68142,7 @@ index 95a7799..4b036fe 100644
if (old_page) {
if (!PageAnon(old_page)) {
dec_mm_counter_fast(mm, MM_FILEPAGES);
-@@ -2718,6 +2917,10 @@ gotten:
+@@ -2707,6 +2906,10 @@ gotten:
page_remove_rmap(old_page);
}
@@ -69382,7 +68153,7 @@ index 95a7799..4b036fe 100644
/* Free the old page.. */
new_page = old_page;
ret |= VM_FAULT_WRITE;
-@@ -2997,6 +3200,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2986,6 +3189,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);
@@ -69394,7 +68165,7 @@ index 95a7799..4b036fe 100644
unlock_page(page);
if (swapcache) {
/*
-@@ -3020,6 +3228,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3009,6 +3217,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);
@@ -69406,7 +68177,7 @@ index 95a7799..4b036fe 100644
unlock:
pte_unmap_unlock(page_table, ptl);
out:
-@@ -3039,40 +3252,6 @@ out_release:
+@@ -3028,40 +3241,6 @@ out_release:
}
/*
@@ -69447,7 +68218,7 @@ index 95a7799..4b036fe 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.
-@@ -3081,27 +3260,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3070,27 +3249,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)
{
@@ -69480,7 +68251,7 @@ index 95a7799..4b036fe 100644
if (unlikely(anon_vma_prepare(vma)))
goto oom;
page = alloc_zeroed_user_highpage_movable(vma, address);
-@@ -3120,6 +3295,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3109,6 +3284,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
if (!pte_none(*page_table))
goto release;
@@ -69492,7 +68263,7 @@ index 95a7799..4b036fe 100644
inc_mm_counter_fast(mm, MM_ANONPAGES);
page_add_new_anon_rmap(page, vma, address);
setpte:
-@@ -3127,6 +3307,12 @@ setpte:
+@@ -3116,6 +3296,12 @@ setpte:
/* No need to invalidate - it was non-present before */
update_mmu_cache(vma, address, page_table);
@@ -69505,7 +68276,7 @@ index 95a7799..4b036fe 100644
unlock:
pte_unmap_unlock(page_table, ptl);
return 0;
-@@ -3264,6 +3450,12 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3259,6 +3445,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))) {
@@ -69518,7 +68289,7 @@ index 95a7799..4b036fe 100644
flush_icache_page(vma, page);
entry = mk_pte(page, vma->vm_page_prot);
if (flags & FAULT_FLAG_WRITE)
-@@ -3283,6 +3475,14 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3278,6 +3470,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);
@@ -69531,9 +68302,9 @@ index 95a7799..4b036fe 100644
+#endif
+
} else {
- if (charged)
- mem_cgroup_uncharge_page(page);
-@@ -3430,6 +3630,12 @@ int handle_pte_fault(struct mm_struct *mm,
+ if (cow_page)
+ mem_cgroup_uncharge_page(cow_page);
+@@ -3431,6 +3631,12 @@ int handle_pte_fault(struct mm_struct *mm,
if (flags & FAULT_FLAG_WRITE)
flush_tlb_fix_spurious_fault(vma, address);
}
@@ -69546,7 +68317,7 @@ index 95a7799..4b036fe 100644
unlock:
pte_unmap_unlock(pte, ptl);
return 0;
-@@ -3446,6 +3652,10 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3447,6 +3653,10 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
pmd_t *pmd;
pte_t *pte;
@@ -69557,7 +68328,7 @@ index 95a7799..4b036fe 100644
__set_current_state(TASK_RUNNING);
count_vm_event(PGFAULT);
-@@ -3457,6 +3667,34 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3458,6 +3668,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);
@@ -69592,7 +68363,7 @@ index 95a7799..4b036fe 100644
pgd = pgd_offset(mm, address);
pud = pud_alloc(mm, pgd, address);
if (!pud)
-@@ -3486,7 +3724,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3487,7 +3725,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.
*/
@@ -69601,7 +68372,7 @@ index 95a7799..4b036fe 100644
return VM_FAULT_OOM;
/* if an huge pmd materialized from under us just retry later */
if (unlikely(pmd_trans_huge(*pmd)))
-@@ -3590,7 +3828,7 @@ static int __init gate_vma_init(void)
+@@ -3591,7 +3829,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;
@@ -69611,10 +68382,10 @@ index 95a7799..4b036fe 100644
* Make sure the vDSO gets into every core dump.
* Dumping its contents makes post-mortem fully interpretable later
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
-index e7fb9d2..fb233ed 100644
+index c3fdbcb..2e8ef90 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
-@@ -639,6 +639,10 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
+@@ -640,6 +640,10 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
unsigned long vmstart;
unsigned long vmend;
@@ -69625,7 +68396,7 @@ index e7fb9d2..fb233ed 100644
vma = find_vma_prev(mm, start, &prev);
if (!vma || vma->vm_start > start)
return -EFAULT;
-@@ -669,6 +673,16 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
+@@ -678,6 +682,16 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
err = policy_vma(vma, new_pol);
if (err)
goto out;
@@ -69642,7 +68413,7 @@ index e7fb9d2..fb233ed 100644
}
out:
-@@ -1102,6 +1116,17 @@ static long do_mbind(unsigned long start, unsigned long len,
+@@ -1111,6 +1125,17 @@ static long do_mbind(unsigned long start, unsigned long len,
if (end < start)
return -EINVAL;
@@ -69660,7 +68431,7 @@ index e7fb9d2..fb233ed 100644
if (end == start)
return 0;
-@@ -1320,6 +1345,14 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
+@@ -1329,6 +1354,14 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
if (!mm)
goto out;
@@ -69675,7 +68446,7 @@ index e7fb9d2..fb233ed 100644
/*
* Check if this process has the right to modify the specified
* process. The right exists if the process has administrative
-@@ -1329,8 +1362,7 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
+@@ -1338,8 +1371,7 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
rcu_read_lock();
tcred = __task_cred(task);
if (cred->euid != tcred->suid && cred->euid != tcred->uid &&
@@ -69686,19 +68457,10 @@ index e7fb9d2..fb233ed 100644
err = -EPERM;
goto out;
diff --git a/mm/migrate.c b/mm/migrate.c
-index 14d0a6a..81ffe69 100644
+index 177aca4..ab3a744 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
-@@ -1124,6 +1124,8 @@ static int do_pages_move(struct mm_struct *mm, struct task_struct *task,
- unsigned long chunk_start;
- int err;
-
-+ pax_track_stack();
-+
- task_nodes = cpuset_mems_allowed(task);
-
- err = -ENOMEM;
-@@ -1308,6 +1310,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
+@@ -1313,6 +1313,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
if (!mm)
return -EINVAL;
@@ -69713,7 +68475,7 @@ index 14d0a6a..81ffe69 100644
/*
* Check if this process has the right to modify the specified
* process. The right exists if the process has administrative
-@@ -1317,8 +1327,7 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
+@@ -1322,8 +1330,7 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
rcu_read_lock();
tcred = __task_cred(task);
if (cred->euid != tcred->suid && cred->euid != tcred->uid &&
@@ -69724,7 +68486,7 @@ index 14d0a6a..81ffe69 100644
err = -EPERM;
goto out;
diff --git a/mm/mlock.c b/mm/mlock.c
-index 048260c..57f4a4e 100644
+index 4f4f53b..9511904 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -13,6 +13,7 @@
@@ -69733,9 +68495,9 @@ index 048260c..57f4a4e 100644
#include <linux/syscalls.h>
+#include <linux/security.h>
#include <linux/sched.h>
- #include <linux/module.h>
+ #include <linux/export.h>
#include <linux/rmap.h>
-@@ -377,6 +378,9 @@ static int do_mlock(unsigned long start, size_t len, int on)
+@@ -385,6 +386,9 @@ static int do_mlock(unsigned long start, size_t len, int on)
return -EINVAL;
if (end == start)
return 0;
@@ -69745,7 +68507,7 @@ index 048260c..57f4a4e 100644
vma = find_vma_prev(current->mm, start, &prev);
if (!vma || vma->vm_start > start)
return -ENOMEM;
-@@ -387,6 +391,11 @@ static int do_mlock(unsigned long start, size_t len, int on)
+@@ -395,6 +399,11 @@ static int do_mlock(unsigned long start, size_t len, int on)
for (nstart = start ; ; ) {
vm_flags_t newflags;
@@ -69757,7 +68519,7 @@ index 048260c..57f4a4e 100644
/* Here we know that vma->vm_start <= nstart < vma->vm_end. */
newflags = vma->vm_flags | VM_LOCKED;
-@@ -492,6 +501,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
+@@ -500,6 +509,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
lock_limit >>= PAGE_SHIFT;
/* check against resource limits */
@@ -69765,7 +68527,7 @@ index 048260c..57f4a4e 100644
if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
error = do_mlock(start, len, 1);
up_write(&current->mm->mmap_sem);
-@@ -515,17 +525,23 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
+@@ -523,17 +533,23 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
static int do_mlockall(int flags)
{
struct vm_area_struct * vma, * prev = NULL;
@@ -69792,7 +68554,7 @@ index 048260c..57f4a4e 100644
newflags = vma->vm_flags | VM_LOCKED;
if (!(flags & MCL_CURRENT))
newflags &= ~VM_LOCKED;
-@@ -557,6 +573,7 @@ SYSCALL_DEFINE1(mlockall, int, flags)
+@@ -566,6 +582,7 @@ SYSCALL_DEFINE1(mlockall, int, flags)
lock_limit >>= PAGE_SHIFT;
ret = -ENOMEM;
@@ -69801,7 +68563,7 @@ index 048260c..57f4a4e 100644
capable(CAP_IPC_LOCK))
ret = do_mlockall(flags);
diff --git a/mm/mmap.c b/mm/mmap.c
-index d49736f..b7db41b 100644
+index eae90af..51ca80b 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -46,6 +46,16 @@
@@ -69857,7 +68619,7 @@ index d49736f..b7db41b 100644
/*
* Make sure vm_committed_as in one cacheline and not cacheline shared with
* other variables. It can be updated by several CPUs frequently.
-@@ -236,6 +256,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
+@@ -228,6 +248,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
struct vm_area_struct *next = vma->vm_next;
might_sleep();
@@ -69865,7 +68627,7 @@ index d49736f..b7db41b 100644
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file) {
-@@ -280,6 +301,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
+@@ -272,6 +293,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
* not page aligned -Ram Gupta
*/
rlim = rlimit(RLIMIT_DATA);
@@ -69873,7 +68635,7 @@ index d49736f..b7db41b 100644
if (rlim < RLIM_INFINITY && (brk - mm->start_brk) +
(mm->end_data - mm->start_data) > rlim)
goto out;
-@@ -697,6 +719,12 @@ static int
+@@ -689,6 +711,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)
{
@@ -69886,7 +68648,7 @@ index d49736f..b7db41b 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)
-@@ -716,6 +744,12 @@ static int
+@@ -708,6 +736,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)
{
@@ -69899,7 +68661,7 @@ index d49736f..b7db41b 100644
if (is_mergeable_vma(vma, file, vm_flags) &&
is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) {
pgoff_t vm_pglen;
-@@ -758,13 +792,20 @@ can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
+@@ -750,13 +784,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,
@@ -69921,7 +68683,7 @@ index d49736f..b7db41b 100644
/*
* We later require that vma->vm_flags == vm_flags,
* so this tests vma->vm_flags & VM_SPECIAL, too.
-@@ -780,6 +821,15 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
+@@ -772,6 +813,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;
@@ -69937,7 +68699,7 @@ index d49736f..b7db41b 100644
/*
* Can it merge with the predecessor?
*/
-@@ -799,9 +849,24 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
+@@ -791,9 +841,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);
@@ -69963,7 +68725,7 @@ index d49736f..b7db41b 100644
if (err)
return NULL;
khugepaged_enter_vma_merge(prev);
-@@ -815,12 +880,27 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
+@@ -807,12 +872,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)) {
@@ -69993,7 +68755,7 @@ index d49736f..b7db41b 100644
if (err)
return NULL;
khugepaged_enter_vma_merge(area);
-@@ -929,14 +1009,11 @@ none:
+@@ -921,14 +1001,11 @@ none:
void vm_stat_account(struct mm_struct *mm, unsigned long flags,
struct file *file, long pages)
{
@@ -70009,7 +68771,7 @@ index d49736f..b7db41b 100644
mm->stack_vm += pages;
if (flags & (VM_RESERVED|VM_IO))
mm->reserved_vm += pages;
-@@ -963,7 +1040,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -955,7 +1032,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.)
*/
@@ -70018,7 +68780,7 @@ index d49736f..b7db41b 100644
if (!(file && (file->f_path.mnt->mnt_flags & MNT_NOEXEC)))
prot |= PROT_EXEC;
-@@ -989,7 +1066,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -981,7 +1058,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.
*/
@@ -70027,7 +68789,7 @@ index d49736f..b7db41b 100644
if (addr & ~PAGE_MASK)
return addr;
-@@ -1000,6 +1077,36 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -992,6 +1069,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;
@@ -70064,7 +68826,7 @@ index d49736f..b7db41b 100644
if (flags & MAP_LOCKED)
if (!can_do_mlock())
return -EPERM;
-@@ -1011,6 +1118,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -1003,6 +1110,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;
@@ -70072,7 +68834,7 @@ index d49736f..b7db41b 100644
if (locked > lock_limit && !capable(CAP_IPC_LOCK))
return -EAGAIN;
}
-@@ -1081,6 +1189,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -1073,6 +1181,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
if (error)
return error;
@@ -70082,7 +68844,7 @@ index d49736f..b7db41b 100644
return mmap_region(file, addr, len, flags, vm_flags, pgoff);
}
EXPORT_SYMBOL(do_mmap_pgoff);
-@@ -1161,7 +1272,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
+@@ -1153,7 +1264,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 */
@@ -70091,7 +68853,7 @@ index d49736f..b7db41b 100644
return 0;
/* The backer wishes to know when pages are first written to? */
-@@ -1210,14 +1321,24 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
+@@ -1202,14 +1313,24 @@ 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;
@@ -70118,7 +68880,7 @@ index d49736f..b7db41b 100644
}
/* Check against address space limit. */
-@@ -1266,6 +1387,16 @@ munmap_back:
+@@ -1258,6 +1379,16 @@ munmap_back:
goto unacct_error;
}
@@ -70135,7 +68897,7 @@ index d49736f..b7db41b 100644
vma->vm_mm = mm;
vma->vm_start = addr;
vma->vm_end = addr + len;
-@@ -1289,6 +1420,19 @@ munmap_back:
+@@ -1281,6 +1412,19 @@ munmap_back:
error = file->f_op->mmap(file, vma);
if (error)
goto unmap_and_free_vma;
@@ -70155,7 +68917,7 @@ index d49736f..b7db41b 100644
if (vm_flags & VM_EXECUTABLE)
added_exe_file_vma(mm);
-@@ -1324,6 +1468,11 @@ munmap_back:
+@@ -1316,6 +1460,11 @@ munmap_back:
vma_link(mm, vma, prev, rb_link, rb_parent);
file = vma->vm_file;
@@ -70167,7 +68929,7 @@ index d49736f..b7db41b 100644
/* Once vma denies write, undo our temporary denial count */
if (correct_wcount)
atomic_inc(&inode->i_writecount);
-@@ -1332,6 +1481,7 @@ out:
+@@ -1324,6 +1473,7 @@ out:
mm->total_vm += len >> PAGE_SHIFT;
vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
@@ -70175,7 +68937,7 @@ index d49736f..b7db41b 100644
if (vm_flags & VM_LOCKED) {
if (!mlock_vma_pages_range(vma, addr, addr + len))
mm->locked_vm += (len >> PAGE_SHIFT);
-@@ -1349,6 +1499,12 @@ unmap_and_free_vma:
+@@ -1341,6 +1491,12 @@ unmap_and_free_vma:
unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
charged = 0;
free_vma:
@@ -70188,7 +68950,7 @@ index d49736f..b7db41b 100644
kmem_cache_free(vm_area_cachep, vma);
unacct_error:
if (charged)
-@@ -1356,6 +1512,44 @@ unacct_error:
+@@ -1348,6 +1504,44 @@ unacct_error:
return error;
}
@@ -70233,7 +68995,7 @@ index d49736f..b7db41b 100644
/* Get an address range which is currently unmapped.
* For shmat() with addr=0.
*
-@@ -1382,18 +1576,23 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -1374,18 +1568,23 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
if (flags & MAP_FIXED)
return addr;
@@ -70264,7 +69026,7 @@ index d49736f..b7db41b 100644
}
full_search:
-@@ -1404,34 +1603,40 @@ full_search:
+@@ -1396,34 +1595,40 @@ full_search:
* Start a new search - just in case we missed
* some holes.
*/
@@ -70316,7 +69078,7 @@ index d49736f..b7db41b 100644
mm->free_area_cache = addr;
mm->cached_hole_size = ~0UL;
}
-@@ -1449,7 +1654,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1441,7 +1646,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
{
struct vm_area_struct *vma;
struct mm_struct *mm = current->mm;
@@ -70325,7 +69087,7 @@ index d49736f..b7db41b 100644
/* requested length too big for entire address space */
if (len > TASK_SIZE)
-@@ -1458,13 +1663,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1450,13 +1655,18 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
if (flags & MAP_FIXED)
return addr;
@@ -70348,7 +69110,7 @@ index d49736f..b7db41b 100644
}
/* check if free_area_cache is useful for us */
-@@ -1479,7 +1689,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1471,7 +1681,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
/* make sure it can fit in the remaining address space */
if (addr > len) {
vma = find_vma(mm, addr-len);
@@ -70357,7 +69119,7 @@ index d49736f..b7db41b 100644
/* remember the address as a hint for next time */
return (mm->free_area_cache = addr-len);
}
-@@ -1496,7 +1706,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1488,7 +1698,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
* return with success:
*/
vma = find_vma(mm, addr);
@@ -70366,7 +69128,7 @@ index d49736f..b7db41b 100644
/* remember the address as a hint for next time */
return (mm->free_area_cache = addr);
-@@ -1505,8 +1715,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1497,8 +1707,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 */
@@ -70377,7 +69139,7 @@ index d49736f..b7db41b 100644
bottomup:
/*
-@@ -1515,13 +1725,21 @@ bottomup:
+@@ -1507,13 +1717,21 @@ bottomup:
* can happen with large stack limits and large mmap()
* allocations.
*/
@@ -70401,7 +69163,7 @@ index d49736f..b7db41b 100644
mm->cached_hole_size = ~0UL;
return addr;
-@@ -1530,6 +1748,12 @@ bottomup:
+@@ -1522,6 +1740,12 @@ bottomup:
void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
{
@@ -70414,7 +69176,7 @@ index d49736f..b7db41b 100644
/*
* Is this a new hole at the highest possible address?
*/
-@@ -1537,8 +1761,10 @@ void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
+@@ -1529,8 +1753,10 @@ void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
mm->free_area_cache = addr;
/* dont allow allocations above current base */
@@ -70426,7 +69188,7 @@ index d49736f..b7db41b 100644
}
unsigned long
-@@ -1646,6 +1872,28 @@ out:
+@@ -1638,6 +1864,28 @@ out:
return prev ? prev->vm_next : vma;
}
@@ -70455,7 +69217,7 @@ index d49736f..b7db41b 100644
/*
* Verify that the stack growth is acceptable and
* update accounting. This is shared with both the
-@@ -1662,6 +1910,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
+@@ -1654,6 +1902,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
return -ENOMEM;
/* Stack limit test */
@@ -70463,7 +69225,7 @@ index d49736f..b7db41b 100644
if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))
return -ENOMEM;
-@@ -1672,6 +1921,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
+@@ -1664,6 +1913,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;
@@ -70471,7 +69233,7 @@ index d49736f..b7db41b 100644
if (locked > limit && !capable(CAP_IPC_LOCK))
return -ENOMEM;
}
-@@ -1702,37 +1952,48 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
+@@ -1694,37 +1944,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.
*/
@@ -70529,7 +69291,7 @@ index d49736f..b7db41b 100644
unsigned long size, grow;
size = address - vma->vm_start;
-@@ -1747,6 +2008,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
+@@ -1739,6 +2000,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
}
}
}
@@ -70538,7 +69300,7 @@ index d49736f..b7db41b 100644
vma_unlock_anon_vma(vma);
khugepaged_enter_vma_merge(vma);
return error;
-@@ -1760,6 +2023,8 @@ int expand_downwards(struct vm_area_struct *vma,
+@@ -1752,6 +2015,8 @@ int expand_downwards(struct vm_area_struct *vma,
unsigned long address)
{
int error;
@@ -70547,7 +69309,7 @@ index d49736f..b7db41b 100644
/*
* We must make sure the anon_vma is allocated
-@@ -1773,6 +2038,15 @@ int expand_downwards(struct vm_area_struct *vma,
+@@ -1765,6 +2030,15 @@ int expand_downwards(struct vm_area_struct *vma,
if (error)
return error;
@@ -70563,7 +69325,7 @@ index d49736f..b7db41b 100644
vma_lock_anon_vma(vma);
/*
-@@ -1782,9 +2056,17 @@ int expand_downwards(struct vm_area_struct *vma,
+@@ -1774,9 +2048,17 @@ int expand_downwards(struct vm_area_struct *vma,
*/
/* Somebody else might have raced and expanded it already */
@@ -70582,7 +69344,7 @@ index d49736f..b7db41b 100644
size = vma->vm_end - address;
grow = (vma->vm_start - address) >> PAGE_SHIFT;
-@@ -1794,11 +2076,22 @@ int expand_downwards(struct vm_area_struct *vma,
+@@ -1786,11 +2068,22 @@ int expand_downwards(struct vm_area_struct *vma,
if (!error) {
vma->vm_start = address;
vma->vm_pgoff -= grow;
@@ -70605,7 +69367,7 @@ index d49736f..b7db41b 100644
khugepaged_enter_vma_merge(vma);
return error;
}
-@@ -1868,6 +2161,13 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma)
+@@ -1860,6 +2153,13 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma)
do {
long nrpages = vma_pages(vma);
@@ -70619,7 +69381,7 @@ index d49736f..b7db41b 100644
mm->total_vm -= nrpages;
vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
vma = remove_vma(vma);
-@@ -1913,6 +2213,16 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -1905,6 +2205,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 {
@@ -70636,7 +69398,7 @@ index d49736f..b7db41b 100644
rb_erase(&vma->vm_rb, &mm->mm_rb);
mm->map_count--;
tail_vma = vma;
-@@ -1941,14 +2251,33 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -1933,14 +2243,33 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
struct vm_area_struct *new;
int err = -ENOMEM;
@@ -70670,7 +69432,7 @@ index d49736f..b7db41b 100644
/* most fields are the same, copy all, and then fixup */
*new = *vma;
-@@ -1961,6 +2290,22 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -1953,6 +2282,22 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
new->vm_pgoff += ((addr - vma->vm_start) >> PAGE_SHIFT);
}
@@ -70693,7 +69455,7 @@ index d49736f..b7db41b 100644
pol = mpol_dup(vma_policy(vma));
if (IS_ERR(pol)) {
err = PTR_ERR(pol);
-@@ -1986,6 +2331,42 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -1978,6 +2323,42 @@ 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);
@@ -70736,7 +69498,7 @@ index d49736f..b7db41b 100644
/* Success. */
if (!err)
return 0;
-@@ -1998,10 +2379,18 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -1990,10 +2371,18 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
removed_exe_file_vma(mm);
fput(new->vm_file);
}
@@ -70756,7 +69518,7 @@ index d49736f..b7db41b 100644
kmem_cache_free(vm_area_cachep, new);
out_err:
return err;
-@@ -2014,6 +2403,15 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -2006,6 +2395,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)
{
@@ -70772,7 +69534,7 @@ index d49736f..b7db41b 100644
if (mm->map_count >= sysctl_max_map_count)
return -ENOMEM;
-@@ -2025,11 +2423,30 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2017,11 +2415,30 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
* work. This now handles partial unmappings.
* Jeremy Fitzhardinge <jeremy@goop.org>
*/
@@ -70803,7 +69565,7 @@ index d49736f..b7db41b 100644
if ((start & ~PAGE_MASK) || start > TASK_SIZE || len > TASK_SIZE-start)
return -EINVAL;
-@@ -2104,6 +2521,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
+@@ -2096,6 +2513,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);
@@ -70812,7 +69574,7 @@ index d49736f..b7db41b 100644
return 0;
}
-@@ -2116,22 +2535,18 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
+@@ -2108,22 +2527,18 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
profile_munmap(addr);
@@ -70841,7 +69603,7 @@ index d49736f..b7db41b 100644
/*
* this is really a simplified "do_mmap". it only handles
* anonymous maps. eventually we may be able to do some
-@@ -2145,6 +2560,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2137,6 +2552,7 @@ 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;
@@ -70849,7 +69611,7 @@ index d49736f..b7db41b 100644
len = PAGE_ALIGN(len);
if (!len)
-@@ -2156,16 +2572,30 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2148,16 +2564,30 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
@@ -70881,7 +69643,7 @@ index d49736f..b7db41b 100644
locked += mm->locked_vm;
lock_limit = rlimit(RLIMIT_MEMLOCK);
lock_limit >>= PAGE_SHIFT;
-@@ -2182,22 +2612,22 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2174,22 +2604,22 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
/*
* Clear old maps. this also does some error checking for us
*/
@@ -70908,7 +69670,7 @@ index d49736f..b7db41b 100644
return -ENOMEM;
/* Can we just expand an old private anonymous mapping? */
-@@ -2211,7 +2641,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2203,7 +2633,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
*/
vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
if (!vma) {
@@ -70917,7 +69679,7 @@ index d49736f..b7db41b 100644
return -ENOMEM;
}
-@@ -2225,11 +2655,12 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2217,11 +2647,12 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
vma_link(mm, vma, prev, rb_link, rb_parent);
out:
perf_event_mmap(vma);
@@ -70932,7 +69694,7 @@ index d49736f..b7db41b 100644
return addr;
}
-@@ -2276,8 +2707,10 @@ void exit_mmap(struct mm_struct *mm)
+@@ -2268,8 +2699,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.
*/
@@ -70944,7 +69706,7 @@ index d49736f..b7db41b 100644
BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
}
-@@ -2291,6 +2724,13 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
+@@ -2283,6 +2716,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;
@@ -70958,7 +69720,7 @@ index d49736f..b7db41b 100644
/*
* The vm_pgoff of a purely anonymous vma should be irrelevant
* until its first write fault, when page's anon_vma and index
-@@ -2313,7 +2753,22 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
+@@ -2305,7 +2745,22 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
if ((vma->vm_flags & VM_ACCOUNT) &&
security_vm_enough_memory_mm(mm, vma_pages(vma)))
return -ENOMEM;
@@ -70981,7 +69743,7 @@ index d49736f..b7db41b 100644
return 0;
}
-@@ -2331,6 +2786,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+@@ -2323,6 +2778,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
struct rb_node **rb_link, *rb_parent;
struct mempolicy *pol;
@@ -70990,7 +69752,7 @@ index d49736f..b7db41b 100644
/*
* If anonymous vma has not yet been faulted, update new pgoff
* to match new location, to increase its chance of merging.
-@@ -2381,6 +2838,39 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+@@ -2373,6 +2830,39 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
return NULL;
}
@@ -71030,7 +69792,7 @@ index d49736f..b7db41b 100644
/*
* Return true if the calling process may expand its vm space by the passed
* number of pages
-@@ -2391,7 +2881,7 @@ int may_expand_vm(struct mm_struct *mm, unsigned long npages)
+@@ -2383,7 +2873,7 @@ int may_expand_vm(struct mm_struct *mm, unsigned long npages)
unsigned long lim;
lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT;
@@ -71039,7 +69801,7 @@ index d49736f..b7db41b 100644
if (cur + npages > lim)
return 0;
return 1;
-@@ -2462,6 +2952,22 @@ int install_special_mapping(struct mm_struct *mm,
+@@ -2454,6 +2944,22 @@ int install_special_mapping(struct mm_struct *mm,
vma->vm_start = addr;
vma->vm_end = addr + len;
@@ -71293,12 +70055,12 @@ index 5a688a2..27e031c 100644
if (nstart < prev->vm_end)
diff --git a/mm/mremap.c b/mm/mremap.c
-index 506fa44..ccc0ba9 100644
+index d6959cb..18a402a 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
-@@ -113,6 +113,12 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
+@@ -106,6 +106,12 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
continue;
- pte = ptep_clear_flush(vma, old_addr, old_pte);
+ pte = ptep_get_and_clear(mm, old_addr, old_pte);
pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr);
+
+#ifdef CONFIG_ARCH_TRACK_EXEC_LIMIT
@@ -71309,7 +70071,7 @@ index 506fa44..ccc0ba9 100644
set_pte_at(mm, new_addr, new_pte, pte);
}
-@@ -272,6 +278,11 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr,
+@@ -290,6 +296,11 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr,
if (is_vm_hugetlb_page(vma))
goto Einval;
@@ -71321,7 +70083,7 @@ index 506fa44..ccc0ba9 100644
/* We can't remap across vm area boundaries */
if (old_len > vma->vm_end - addr)
goto Efault;
-@@ -328,20 +339,25 @@ static unsigned long mremap_to(unsigned long addr,
+@@ -346,20 +357,25 @@ static unsigned long mremap_to(unsigned long addr,
unsigned long ret = -EINVAL;
unsigned long charged = 0;
unsigned long map_flags;
@@ -71352,7 +70114,7 @@ index 506fa44..ccc0ba9 100644
goto out;
ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1);
-@@ -413,6 +429,7 @@ unsigned long do_mremap(unsigned long addr,
+@@ -431,6 +447,7 @@ unsigned long do_mremap(unsigned long addr,
struct vm_area_struct *vma;
unsigned long ret = -EINVAL;
unsigned long charged = 0;
@@ -71360,7 +70122,7 @@ index 506fa44..ccc0ba9 100644
if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE))
goto out;
-@@ -431,6 +448,17 @@ unsigned long do_mremap(unsigned long addr,
+@@ -449,6 +466,17 @@ unsigned long do_mremap(unsigned long addr,
if (!new_len)
goto out;
@@ -71378,7 +70140,7 @@ index 506fa44..ccc0ba9 100644
if (flags & MREMAP_FIXED) {
if (flags & MREMAP_MAYMOVE)
ret = mremap_to(addr, old_len, new_addr, new_len);
-@@ -480,6 +508,7 @@ unsigned long do_mremap(unsigned long addr,
+@@ -498,6 +526,7 @@ unsigned long do_mremap(unsigned long addr,
addr + new_len);
}
ret = addr;
@@ -71386,7 +70148,7 @@ index 506fa44..ccc0ba9 100644
goto out;
}
}
-@@ -506,7 +535,13 @@ unsigned long do_mremap(unsigned long addr,
+@@ -524,7 +553,13 @@ unsigned long do_mremap(unsigned long addr,
ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1);
if (ret)
goto out;
@@ -71401,7 +70163,7 @@ index 506fa44..ccc0ba9 100644
out:
if (ret & ~PAGE_MASK)
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
-index 6e93dc7..c98df0c 100644
+index 7fa41b4..6087460 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -110,19 +110,30 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end)
@@ -71438,10 +70200,10 @@ index 6e93dc7..c98df0c 100644
return count;
}
diff --git a/mm/nommu.c b/mm/nommu.c
-index 9edc897..955be3d 100644
+index b982290..7d73f53 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
-@@ -63,7 +63,6 @@ int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
+@@ -62,7 +62,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;
@@ -71449,7 +70211,7 @@ index 9edc897..955be3d 100644
atomic_long_t mmap_pages_allocated;
-@@ -826,15 +825,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
+@@ -825,15 +824,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
EXPORT_SYMBOL(find_vma);
/*
@@ -71465,7 +70227,7 @@ index 9edc897..955be3d 100644
* expand a stack to a given address
* - not supported under NOMMU conditions
*/
-@@ -1554,6 +1544,7 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -1553,6 +1543,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;
@@ -71474,10 +70236,10 @@ index 9edc897..955be3d 100644
new->vm_region = region;
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 8439d2a..b5e8c8c 100644
+index 2b8ba3a..386d603 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -340,7 +340,7 @@ out:
+@@ -341,7 +341,7 @@ out:
* This usage means that zero-order pages may not be compound.
*/
@@ -71486,7 +70248,7 @@ index 8439d2a..b5e8c8c 100644
{
__free_pages_ok(page, compound_order(page));
}
-@@ -653,6 +653,10 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
+@@ -654,6 +654,10 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
int i;
int bad = 0;
@@ -71497,7 +70259,7 @@ index 8439d2a..b5e8c8c 100644
trace_mm_page_free_direct(page, order);
kmemcheck_free_shadow(page, order);
-@@ -668,6 +672,12 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
+@@ -669,6 +673,12 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
debug_check_no_obj_freed(page_address(page),
PAGE_SIZE << order);
}
@@ -71510,7 +70272,7 @@ index 8439d2a..b5e8c8c 100644
arch_free_page(page, order);
kernel_map_pages(page, 1 << order, 0);
-@@ -783,8 +793,10 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags)
+@@ -784,8 +794,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);
@@ -71521,16 +70283,7 @@ index 8439d2a..b5e8c8c 100644
if (order && (gfp_flags & __GFP_COMP))
prep_compound_page(page, order);
-@@ -2557,6 +2569,8 @@ void show_free_areas(unsigned int filter)
- int cpu;
- struct zone *zone;
-
-+ pax_track_stack();
-+
- for_each_populated_zone(zone) {
- if (skip_free_areas_node(filter, zone_to_nid(zone)))
- continue;
-@@ -3368,7 +3382,13 @@ static int pageblock_is_reserved(unsigned long start_pfn, unsigned long end_pfn)
+@@ -3357,7 +3369,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++) {
@@ -71545,7 +70298,7 @@ index 8439d2a..b5e8c8c 100644
}
return 0;
diff --git a/mm/percpu.c b/mm/percpu.c
-index 93b5a7c..28d642c 100644
+index 716eb4a..8d10419 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -121,7 +121,7 @@ static unsigned int pcpu_low_unit_cpu __read_mostly;
@@ -71557,11 +70310,57 @@ index 93b5a7c..28d642c 100644
EXPORT_SYMBOL_GPL(pcpu_base_addr);
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 e920aa3..c19184f0 100644
+--- a/mm/process_vm_access.c
++++ b/mm/process_vm_access.c
+@@ -13,6 +13,7 @@
+ #include <linux/uio.h>
+ #include <linux/sched.h>
+ #include <linux/highmem.h>
++#include <linux/security.h>
+ #include <linux/ptrace.h>
+ #include <linux/slab.h>
+ #include <linux/syscalls.h>
+@@ -264,13 +265,11 @@ static ssize_t process_vm_rw_core(pid_t pid, const struct iovec *lvec,
+ */
+ for (i = 0; i < riovcnt; i++) {
+ iov_len = rvec[i].iov_len;
+- if (iov_len > 0) {
+- nr_pages_iov = ((unsigned long)rvec[i].iov_base
+- + iov_len)
+- / PAGE_SIZE - (unsigned long)rvec[i].iov_base
+- / PAGE_SIZE + 1;
+- nr_pages = max(nr_pages, nr_pages_iov);
+- }
++ if (iov_len <= 0)
++ continue;
++ nr_pages_iov = ((unsigned long)rvec[i].iov_base + iov_len) / PAGE_SIZE -
++ (unsigned long)rvec[i].iov_base / PAGE_SIZE + 1;
++ nr_pages = max(nr_pages, nr_pages_iov);
+ }
+
+ if (nr_pages == 0)
+@@ -298,8 +297,13 @@ static ssize_t process_vm_rw_core(pid_t pid, const struct iovec *lvec,
+ goto free_proc_pages;
+ }
+
++ if (gr_handle_ptrace(task, vm_write ? PTRACE_POKETEXT : PTRACE_ATTACH)) {
++ rc = -EPERM;
++ goto put_task_struct;
++ }
++
+ task_lock(task);
+- if (__ptrace_may_access(task, PTRACE_MODE_ATTACH)) {
++ if (ptrace_may_access_nolock(task, PTRACE_MODE_ATTACH)) {
+ task_unlock(task);
+ rc = -EPERM;
+ goto put_task_struct;
diff --git a/mm/rmap.c b/mm/rmap.c
-index 23295f6..1a390d5 100644
+index a4fd368..e0ffec7 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
-@@ -153,6 +153,10 @@ int anon_vma_prepare(struct vm_area_struct *vma)
+@@ -152,6 +152,10 @@ int anon_vma_prepare(struct vm_area_struct *vma)
struct anon_vma *anon_vma = vma->anon_vma;
struct anon_vma_chain *avc;
@@ -71572,7 +70371,7 @@ index 23295f6..1a390d5 100644
might_sleep();
if (unlikely(!anon_vma)) {
struct mm_struct *mm = vma->vm_mm;
-@@ -162,6 +166,12 @@ int anon_vma_prepare(struct vm_area_struct *vma)
+@@ -161,6 +165,12 @@ int anon_vma_prepare(struct vm_area_struct *vma)
if (!avc)
goto out_enomem;
@@ -71585,7 +70384,7 @@ index 23295f6..1a390d5 100644
anon_vma = find_mergeable_anon_vma(vma);
allocated = NULL;
if (!anon_vma) {
-@@ -175,6 +185,21 @@ int anon_vma_prepare(struct vm_area_struct *vma)
+@@ -174,6 +184,21 @@ 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)) {
@@ -71607,7 +70406,7 @@ index 23295f6..1a390d5 100644
vma->anon_vma = anon_vma;
avc->anon_vma = anon_vma;
avc->vma = vma;
-@@ -188,12 +213,24 @@ int anon_vma_prepare(struct vm_area_struct *vma)
+@@ -187,12 +212,24 @@ int anon_vma_prepare(struct vm_area_struct *vma)
if (unlikely(allocated))
put_anon_vma(allocated);
@@ -71632,7 +70431,7 @@ index 23295f6..1a390d5 100644
anon_vma_chain_free(avc);
out_enomem:
return -ENOMEM;
-@@ -244,7 +281,7 @@ static void anon_vma_chain_link(struct vm_area_struct *vma,
+@@ -243,7 +280,7 @@ static void anon_vma_chain_link(struct vm_area_struct *vma,
* Attach the anon_vmas from src to dst.
* Returns 0 on success, -ENOMEM on failure.
*/
@@ -71641,7 +70440,7 @@ index 23295f6..1a390d5 100644
{
struct anon_vma_chain *avc, *pavc;
struct anon_vma *root = NULL;
-@@ -277,7 +314,7 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)
+@@ -276,7 +313,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.
*/
@@ -71651,11 +70450,11 @@ index 23295f6..1a390d5 100644
struct anon_vma_chain *avc;
struct anon_vma *anon_vma;
diff --git a/mm/shmem.c b/mm/shmem.c
-index fcedf54..af577ae 100644
+index d672250..2b233c1 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -31,7 +31,7 @@
- #include <linux/percpu_counter.h>
+ #include <linux/export.h>
#include <linux/swap.h>
-static struct vfsmount *shm_mnt;
@@ -71663,25 +70462,16 @@ index fcedf54..af577ae 100644
#ifdef CONFIG_SHMEM
/*
-@@ -1101,6 +1101,8 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
- goto unlock;
- }
- entry = shmem_swp_entry(info, index, NULL);
-+ if (!entry)
-+ goto unlock;
- if (entry->val) {
- /*
- * The more uptodate page coming down from a stacked
-@@ -1172,6 +1174,8 @@ static struct page *shmem_swapin(swp_entry_t entry, gfp_t gfp,
- struct vm_area_struct pvma;
- struct page *page;
+@@ -74,7 +74,7 @@ static struct vfsmount *shm_mnt;
+ #define BOGO_DIRENT_SIZE 20
-+ pax_track_stack();
-+
- spol = mpol_cond_copy(&mpol,
- mpol_shared_policy_lookup(&info->policy, idx));
+ /* Symlink up to this size is kmalloc'ed instead of using a swappable page */
+-#define SHORT_SYMLINK_LEN 128
++#define SHORT_SYMLINK_LEN 64
-@@ -2568,8 +2572,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
+ struct shmem_xattr {
+ struct list_head list; /* anchored by shmem_inode_info->xattr_list */
+@@ -2155,8 +2155,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 */
@@ -71692,7 +70482,7 @@ index fcedf54..af577ae 100644
return -ENOMEM;
diff --git a/mm/slab.c b/mm/slab.c
-index d96e223..9a48434 100644
+index 83311c9a..fcf8f86 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -151,7 +151,7 @@
@@ -71755,7 +70545,7 @@ index d96e223..9a48434 100644
#undef CACHE
};
-@@ -1530,7 +1530,7 @@ void __init kmem_cache_init(void)
+@@ -1572,7 +1572,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,
@@ -71764,7 +70554,7 @@ index d96e223..9a48434 100644
NULL);
if (INDEX_AC != INDEX_L3) {
-@@ -1538,7 +1538,7 @@ void __init kmem_cache_init(void)
+@@ -1580,7 +1580,7 @@ void __init kmem_cache_init(void)
kmem_cache_create(names[INDEX_L3].name,
sizes[INDEX_L3].cs_size,
ARCH_KMALLOC_MINALIGN,
@@ -71773,7 +70563,7 @@ index d96e223..9a48434 100644
NULL);
}
-@@ -1556,7 +1556,7 @@ void __init kmem_cache_init(void)
+@@ -1598,7 +1598,7 @@ void __init kmem_cache_init(void)
sizes->cs_cachep = kmem_cache_create(names->name,
sizes->cs_size,
ARCH_KMALLOC_MINALIGN,
@@ -71782,7 +70572,7 @@ index d96e223..9a48434 100644
NULL);
}
#ifdef CONFIG_ZONE_DMA
-@@ -4272,10 +4272,10 @@ static int s_show(struct seq_file *m, void *p)
+@@ -4322,10 +4322,10 @@ static int s_show(struct seq_file *m, void *p)
}
/* cpu stats */
{
@@ -71797,21 +70587,12 @@ index d96e223..9a48434 100644
seq_printf(m, " : cpustat %6lu %6lu %6lu %6lu",
allochit, allocmiss, freehit, freemiss);
-@@ -4532,15 +4532,66 @@ static const struct file_operations proc_slabstats_operations = {
-
- static int __init slab_proc_init(void)
+@@ -4584,13 +4584,62 @@ static int __init slab_proc_init(void)
{
-- proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
-+ mode_t gr_mode = S_IRUGO;
-+
-+#ifdef CONFIG_GRKERNSEC_PROC_ADD
-+ gr_mode = S_IRUSR;
-+#endif
-+
-+ proc_create("slabinfo",S_IWUSR|gr_mode,NULL,&proc_slabinfo_operations);
+ 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", gr_mode, NULL, &proc_slabstats_operations);
++ proc_create("slab_allocators", S_IRUSR, NULL, &proc_slabstats_operations);
#endif
return 0;
}
@@ -71827,10 +70608,12 @@ index d96e223..9a48434 100644
+ struct slab *slabp;
+ unsigned int objnr;
+ unsigned long offset;
++ const char *type;
+
+ if (!n)
+ return;
+
++ type = "<null>";
+ if (ZERO_OR_NULL_PTR(ptr))
+ goto report;
+
@@ -71839,6 +70622,7 @@ index d96e223..9a48434 100644
+
+ page = virt_to_head_page(ptr);
+
++ type = "<process stack>";
+ if (!PageSlab(page)) {
+ if (object_is_on_stack(ptr, n) == -1)
+ goto report;
@@ -71846,6 +70630,7 @@ index d96e223..9a48434 100644
+ }
+
+ cachep = page_get_cache(page);
++ type = cachep->name;
+ if (!(cachep->flags & SLAB_USERCOPY))
+ goto report;
+
@@ -71857,7 +70642,7 @@ index d96e223..9a48434 100644
+ return;
+
+report:
-+ pax_report_usercopy(ptr, n, to, cachep ? cachep->name : NULL);
++ pax_report_usercopy(ptr, n, to, type);
+#endif
+
+}
@@ -71867,7 +70652,7 @@ index d96e223..9a48434 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 46e0aee..8539ef7 100644
+index 8105be4..579da9d 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -29,7 +29,7 @@
@@ -71975,8 +70760,8 @@ index 46e0aee..8539ef7 100644
+ slob_t *m;
void *ret;
- lockdep_trace_alloc(gfp);
-@@ -492,7 +494,10 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
+ gfp &= gfp_allowed_mask;
+@@ -494,7 +496,10 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
if (!m)
return NULL;
@@ -71988,7 +70773,7 @@ index 46e0aee..8539ef7 100644
ret = (void *)m + align;
trace_kmalloc_node(_RET_IP_, ret,
-@@ -504,16 +509,25 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
+@@ -506,16 +511,25 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
gfp |= __GFP_COMP;
ret = slob_new_pages(gfp, order, node);
if (ret) {
@@ -72018,7 +70803,7 @@ index 46e0aee..8539ef7 100644
return ret;
}
EXPORT_SYMBOL(__kmalloc_node);
-@@ -531,13 +545,88 @@ void kfree(const void *block)
+@@ -533,13 +547,92 @@ void kfree(const void *block)
sp = slob_page(block);
if (is_slob_page(sp)) {
int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
@@ -72044,16 +70829,19 @@ index 46e0aee..8539ef7 100644
+ const slob_t *free;
+ const void *base;
+ unsigned long flags;
++ const char *type;
+
+ if (!n)
+ return;
+
++ type = "<null>";
+ if (ZERO_OR_NULL_PTR(ptr))
+ goto report;
+
+ if (!virt_addr_valid(ptr))
+ return;
+
++ type = "<process stack>";
+ sp = slob_page(ptr);
+ if (!PageSlab((struct page*)sp)) {
+ if (object_is_on_stack(ptr, n) == -1)
@@ -72061,6 +70849,7 @@ index 46e0aee..8539ef7 100644
+ return;
+ }
+
++ type = "<slob>";
+ if (sp->size) {
+ base = page_address(&sp->page);
+ if (base <= ptr && n <= sp->size - (ptr - base))
@@ -72101,7 +70890,7 @@ index 46e0aee..8539ef7 100644
+
+ spin_unlock_irqrestore(&slob_lock, flags);
+report:
-+ pax_report_usercopy(ptr, n, to, NULL);
++ pax_report_usercopy(ptr, n, to, type);
+#endif
+
+}
@@ -72110,7 +70899,7 @@ index 46e0aee..8539ef7 100644
/* can't use ksize for kmem_cache_alloc memory, only kmalloc */
size_t ksize(const void *block)
{
-@@ -550,10 +639,10 @@ size_t ksize(const void *block)
+@@ -552,10 +645,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);
@@ -72124,7 +70913,7 @@ index 46e0aee..8539ef7 100644
}
EXPORT_SYMBOL(ksize);
-@@ -569,8 +658,13 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
+@@ -571,8 +664,13 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
{
struct kmem_cache *c;
@@ -72138,9 +70927,9 @@ index 46e0aee..8539ef7 100644
if (c) {
c->name = name;
-@@ -608,17 +702,25 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node)
- {
- void *b;
+@@ -614,17 +712,25 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node)
+
+ lockdep_trace_alloc(flags);
+#ifdef CONFIG_PAX_USERCOPY
+ b = __kmalloc_node_align(c->size, flags, node, c->align);
@@ -72164,7 +70953,7 @@ index 46e0aee..8539ef7 100644
if (c->ctor)
c->ctor(b);
-@@ -630,10 +732,16 @@ EXPORT_SYMBOL(kmem_cache_alloc_node);
+@@ -636,10 +742,16 @@ EXPORT_SYMBOL(kmem_cache_alloc_node);
static void __kmem_cache_free(void *b, int size)
{
@@ -72183,7 +70972,7 @@ index 46e0aee..8539ef7 100644
}
static void kmem_rcu_free(struct rcu_head *head)
-@@ -646,17 +754,31 @@ static void kmem_rcu_free(struct rcu_head *head)
+@@ -652,17 +764,31 @@ static void kmem_rcu_free(struct rcu_head *head)
void kmem_cache_free(struct kmem_cache *c, void *b)
{
@@ -72219,10 +71008,10 @@ index 46e0aee..8539ef7 100644
EXPORT_SYMBOL(kmem_cache_free);
diff --git a/mm/slub.c b/mm/slub.c
-index 35f351f..2b60d47 100644
+index ed3334d..1739c9b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
-@@ -200,7 +200,7 @@ struct track {
+@@ -208,7 +208,7 @@ struct track {
enum track_item { TRACK_ALLOC, TRACK_FREE };
@@ -72231,16 +71020,28 @@ index 35f351f..2b60d47 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 *);
-@@ -442,7 +442,7 @@ static void print_track(const char *s, struct track *t)
+@@ -530,7 +530,7 @@ static void print_track(const char *s, struct track *t)
if (!t->addr)
return;
- printk(KERN_ERR "INFO: %s in %pS age=%lu cpu=%u pid=%d\n",
+ printk(KERN_ERR "INFO: %s in %pA age=%lu cpu=%u pid=%d\n",
s, (void *)t->addr, jiffies - t->when, t->cpu, t->pid);
- }
+ #ifdef CONFIG_STACKTRACE
+ {
+@@ -2166,6 +2166,11 @@ redo:
+ goto new_slab;
+ }
-@@ -2137,6 +2137,8 @@ void kmem_cache_free(struct kmem_cache *s, void *x)
++ /* must check again c->freelist in case of cpu migration or IRQ */
++ object = c->freelist;
++ if (object)
++ goto load_freelist;
++
+ stat(s, ALLOC_SLOWPATH);
+
+ do {
+@@ -2554,6 +2559,8 @@ void kmem_cache_free(struct kmem_cache *s, void *x)
page = virt_to_head_page(x);
@@ -72249,7 +71050,7 @@ index 35f351f..2b60d47 100644
slab_free(s, page, x, _RET_IP_);
trace_kmem_cache_free(_RET_IP_, x);
-@@ -2170,7 +2172,7 @@ static int slub_min_objects;
+@@ -2587,7 +2594,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.)
*/
@@ -72258,16 +71059,16 @@ index 35f351f..2b60d47 100644
/*
* Calculate the order of allocation given an slab object size.
-@@ -2594,7 +2596,7 @@ static int kmem_cache_open(struct kmem_cache *s,
- * list to avoid pounding the page allocator excessively.
- */
- set_min_partial(s, ilog2(s->size));
+@@ -3037,7 +3044,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
-@@ -2699,8 +2701,7 @@ static inline int kmem_cache_close(struct kmem_cache *s)
+@@ -3141,8 +3148,7 @@ static inline int kmem_cache_close(struct kmem_cache *s)
void kmem_cache_destroy(struct kmem_cache *s)
{
down_write(&slub_lock);
@@ -72275,9 +71076,9 @@ index 35f351f..2b60d47 100644
- if (!s->refcount) {
+ if (atomic_dec_and_test(&s->refcount)) {
list_del(&s->list);
+ up_write(&slub_lock);
if (kmem_cache_close(s)) {
- printk(KERN_ERR "SLUB %s: %s called for cache that "
-@@ -2910,6 +2911,46 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
+@@ -3353,6 +3359,50 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
EXPORT_SYMBOL(__kmalloc_node);
#endif
@@ -72288,10 +71089,12 @@ index 35f351f..2b60d47 100644
+ struct page *page;
+ struct kmem_cache *s = NULL;
+ unsigned long offset;
++ const char *type;
+
+ if (!n)
+ return;
+
++ type = "<null>";
+ if (ZERO_OR_NULL_PTR(ptr))
+ goto report;
+
@@ -72300,6 +71103,7 @@ index 35f351f..2b60d47 100644
+
+ page = virt_to_head_page(ptr);
+
++ type = "<process stack>";
+ if (!PageSlab(page)) {
+ if (object_is_on_stack(ptr, n) == -1)
+ goto report;
@@ -72307,6 +71111,7 @@ index 35f351f..2b60d47 100644
+ }
+
+ s = page->slab;
++ type = s->name;
+ if (!(s->flags & SLAB_USERCOPY))
+ goto report;
+
@@ -72315,7 +71120,7 @@ index 35f351f..2b60d47 100644
+ return;
+
+report:
-+ pax_report_usercopy(ptr, n, to, s ? s->name : NULL);
++ pax_report_usercopy(ptr, n, to, type);
+#endif
+
+}
@@ -72324,7 +71129,7 @@ index 35f351f..2b60d47 100644
size_t ksize(const void *object)
{
struct page *page;
-@@ -3154,7 +3195,7 @@ static void __init kmem_cache_bootstrap_fixup(struct kmem_cache *s)
+@@ -3627,7 +3677,7 @@ static void __init kmem_cache_bootstrap_fixup(struct kmem_cache *s)
int node;
list_add(&s->list, &slab_caches);
@@ -72333,7 +71138,7 @@ index 35f351f..2b60d47 100644
for_each_node_state(node, N_NORMAL_MEMORY) {
struct kmem_cache_node *n = get_node(s, node);
-@@ -3271,17 +3312,17 @@ void __init kmem_cache_init(void)
+@@ -3744,17 +3794,17 @@ void __init kmem_cache_init(void)
/* Caches that are not of the two-to-the-power-of size */
if (KMALLOC_MIN_SIZE <= 32) {
@@ -72354,7 +71159,7 @@ index 35f351f..2b60d47 100644
caches++;
}
-@@ -3349,7 +3390,7 @@ static int slab_unmergeable(struct kmem_cache *s)
+@@ -3822,7 +3872,7 @@ static int slab_unmergeable(struct kmem_cache *s)
/*
* We may have set a slab to be unmergeable during bootstrap.
*/
@@ -72363,7 +71168,7 @@ index 35f351f..2b60d47 100644
return 1;
return 0;
-@@ -3408,7 +3449,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
+@@ -3881,7 +3931,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);
if (s) {
@@ -72372,7 +71177,7 @@ index 35f351f..2b60d47 100644
/*
* Adjust the object sizes so that we clear
* the complete object on kzalloc.
-@@ -3417,7 +3458,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
+@@ -3890,7 +3940,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *)));
if (sysfs_slab_alias(s, name)) {
@@ -72381,7 +71186,7 @@ index 35f351f..2b60d47 100644
goto err;
}
up_write(&slub_lock);
-@@ -3545,7 +3586,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
+@@ -4018,7 +4068,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
}
#endif
@@ -72390,7 +71195,7 @@ index 35f351f..2b60d47 100644
static int count_inuse(struct page *page)
{
return page->inuse;
-@@ -3935,12 +3976,12 @@ static void resiliency_test(void)
+@@ -4405,12 +4455,12 @@ static void resiliency_test(void)
validate_slab_cache(kmalloc_caches[9]);
}
#else
@@ -72405,7 +71210,7 @@ index 35f351f..2b60d47 100644
enum slab_stat_type {
SL_ALL, /* All slabs */
SL_PARTIAL, /* Only partially allocated slabs */
-@@ -4150,7 +4191,7 @@ SLAB_ATTR_RO(ctor);
+@@ -4651,7 +4701,7 @@ SLAB_ATTR_RO(ctor);
static ssize_t aliases_show(struct kmem_cache *s, char *buf)
{
@@ -72414,7 +71219,7 @@ index 35f351f..2b60d47 100644
}
SLAB_ATTR_RO(aliases);
-@@ -4662,6 +4703,7 @@ static char *create_unique_id(struct kmem_cache *s)
+@@ -5218,6 +5268,7 @@ static char *create_unique_id(struct kmem_cache *s)
return name;
}
@@ -72422,7 +71227,7 @@ index 35f351f..2b60d47 100644
static int sysfs_slab_add(struct kmem_cache *s)
{
int err;
-@@ -4724,6 +4766,7 @@ static void sysfs_slab_remove(struct kmem_cache *s)
+@@ -5280,6 +5331,7 @@ static void sysfs_slab_remove(struct kmem_cache *s)
kobject_del(&s->kobj);
kobject_put(&s->kobj);
}
@@ -72430,7 +71235,7 @@ index 35f351f..2b60d47 100644
/*
* Need to buffer aliases during bootup until sysfs becomes
-@@ -4737,6 +4780,7 @@ struct saved_alias {
+@@ -5293,6 +5345,7 @@ struct saved_alias {
static struct saved_alias *alias_list;
@@ -72438,7 +71243,7 @@ index 35f351f..2b60d47 100644
static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
{
struct saved_alias *al;
-@@ -4759,6 +4803,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
+@@ -5315,6 +5368,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
alias_list = al;
return 0;
}
@@ -72446,23 +71251,8 @@ index 35f351f..2b60d47 100644
static int __init slab_sysfs_init(void)
{
-@@ -4894,7 +4939,13 @@ static const struct file_operations proc_slabinfo_operations = {
-
- static int __init slab_proc_init(void)
- {
-- proc_create("slabinfo", S_IRUGO, NULL, &proc_slabinfo_operations);
-+ mode_t gr_mode = S_IRUGO;
-+
-+#ifdef CONFIG_GRKERNSEC_PROC_ADD
-+ gr_mode = S_IRUSR;
-+#endif
-+
-+ proc_create("slabinfo", gr_mode, NULL, &proc_slabinfo_operations);
- return 0;
- }
- module_init(slab_proc_init);
diff --git a/mm/swap.c b/mm/swap.c
-index 87627f1..8a9eb34 100644
+index a91caf7..b887e735 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -31,6 +31,7 @@
@@ -72483,10 +71273,10 @@ index 87627f1..8a9eb34 100644
}
diff --git a/mm/swapfile.c b/mm/swapfile.c
-index ff8dc1a..fdc301a 100644
+index b1cd120..aaae885 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
-@@ -62,7 +62,7 @@ static DEFINE_MUTEX(swapon_mutex);
+@@ -61,7 +61,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 */
@@ -72495,7 +71285,7 @@ index ff8dc1a..fdc301a 100644
static inline unsigned char swap_count(unsigned char ent)
{
-@@ -1671,7 +1671,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
+@@ -1670,7 +1670,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
}
filp_close(swap_file, NULL);
err = 0;
@@ -72504,27 +71294,27 @@ index ff8dc1a..fdc301a 100644
wake_up_interruptible(&proc_poll_wait);
out_dput:
-@@ -1692,8 +1692,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait)
+@@ -1686,8 +1686,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait)
poll_wait(file, &proc_poll_wait, wait);
-- if (s->event != atomic_read(&proc_poll_event)) {
-- s->event = atomic_read(&proc_poll_event);
-+ if (s->event != atomic_read_unchecked(&proc_poll_event)) {
-+ s->event = atomic_read_unchecked(&proc_poll_event);
+- if (seq->poll_event != atomic_read(&proc_poll_event)) {
+- seq->poll_event = atomic_read(&proc_poll_event);
++ if (seq->poll_event != atomic_read_unchecked(&proc_poll_event)) {
++ seq->poll_event = atomic_read_unchecked(&proc_poll_event);
return POLLIN | POLLRDNORM | POLLERR | POLLPRI;
}
-@@ -1799,7 +1799,7 @@ static int swaps_open(struct inode *inode, struct file *file)
- }
+@@ -1785,7 +1785,7 @@ static int swaps_open(struct inode *inode, struct file *file)
+ return ret;
- s->seq.private = s;
-- s->event = atomic_read(&proc_poll_event);
-+ s->event = atomic_read_unchecked(&proc_poll_event);
- return ret;
+ seq = file->private_data;
+- seq->poll_event = atomic_read(&proc_poll_event);
++ seq->poll_event = atomic_read_unchecked(&proc_poll_event);
+ return 0;
}
-@@ -2133,7 +2133,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
+@@ -2123,7 +2123,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
(p->flags & SWP_DISCARDABLE) ? "D" : "");
mutex_unlock(&swapon_mutex);
@@ -72534,7 +71324,7 @@ index ff8dc1a..fdc301a 100644
if (S_ISREG(inode->i_mode))
diff --git a/mm/util.c b/mm/util.c
-index 88ea1bd..0f1dfdb 100644
+index 136ac4f..5117eef 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -114,6 +114,7 @@ EXPORT_SYMBOL(memdup_user);
@@ -72567,7 +71357,7 @@ index 88ea1bd..0f1dfdb 100644
mm->unmap_area = arch_unmap_area;
}
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
-index 43b44db..5361145 100644
+index 27be2f0..0aef2c2 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)
@@ -72673,7 +71463,7 @@ index 43b44db..5361145 100644
if (!pmd_none(*pmd)) {
pte_t *ptep, pte;
-@@ -1308,6 +1348,16 @@ static struct vm_struct *__get_vm_area_node(unsigned long size,
+@@ -1294,6 +1334,16 @@ static struct vm_struct *__get_vm_area_node(unsigned long size,
struct vm_struct *area;
BUG_ON(in_interrupt());
@@ -72690,7 +71480,7 @@ index 43b44db..5361145 100644
if (flags & VM_IOREMAP) {
int bit = fls(size);
-@@ -1540,6 +1590,11 @@ void *vmap(struct page **pages, unsigned int count,
+@@ -1526,6 +1576,11 @@ void *vmap(struct page **pages, unsigned int count,
if (count > totalram_pages)
return NULL;
@@ -72702,21 +71492,21 @@ index 43b44db..5361145 100644
area = get_vm_area_caller((count << PAGE_SHIFT), flags,
__builtin_return_address(0));
if (!area)
-@@ -1641,6 +1696,13 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
+@@ -1627,6 +1682,13 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
if (!size || (size >> PAGE_SHIFT) > totalram_pages)
- return NULL;
+ goto fail;
+#if defined(CONFIG_MODULES) && defined(CONFIG_X86) && defined(CONFIG_PAX_KERNEXEC)
+ if (!(pgprot_val(prot) & _PAGE_NX))
-+ area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST | VM_KERNEXEC, VMALLOC_START, VMALLOC_END,
-+ node, gfp_mask, caller);
++ area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST | VM_KERNEXEC,
++ VMALLOC_START, VMALLOC_END, node, gfp_mask, caller);
+ else
+#endif
+
area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST,
start, end, node, gfp_mask, caller);
-
-@@ -1688,6 +1750,7 @@ static void *__vmalloc_node(unsigned long size, unsigned long align,
+ if (!area)
+@@ -1679,6 +1741,7 @@ static void *__vmalloc_node(unsigned long size, unsigned long align,
gfp_mask, prot, node, caller);
}
@@ -72724,7 +71514,7 @@ index 43b44db..5361145 100644
void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
{
return __vmalloc_node(size, 1, gfp_mask, prot, -1,
-@@ -1711,6 +1774,7 @@ static inline void *__vmalloc_node_flags(unsigned long size,
+@@ -1702,6 +1765,7 @@ static inline void *__vmalloc_node_flags(unsigned long size,
* For tight control over page level allocator and protection flags
* use __vmalloc() instead.
*/
@@ -72732,7 +71522,7 @@ index 43b44db..5361145 100644
void *vmalloc(unsigned long size)
{
return __vmalloc_node_flags(size, -1, GFP_KERNEL | __GFP_HIGHMEM);
-@@ -1727,6 +1791,7 @@ EXPORT_SYMBOL(vmalloc);
+@@ -1718,6 +1782,7 @@ EXPORT_SYMBOL(vmalloc);
* For tight control over page level allocator and protection flags
* use __vmalloc() instead.
*/
@@ -72740,7 +71530,7 @@ index 43b44db..5361145 100644
void *vzalloc(unsigned long size)
{
return __vmalloc_node_flags(size, -1,
-@@ -1741,6 +1806,7 @@ EXPORT_SYMBOL(vzalloc);
+@@ -1732,6 +1797,7 @@ EXPORT_SYMBOL(vzalloc);
* The resulting memory area is zeroed so it can be mapped to userspace
* without leaking data.
*/
@@ -72748,7 +71538,7 @@ index 43b44db..5361145 100644
void *vmalloc_user(unsigned long size)
{
struct vm_struct *area;
-@@ -1768,6 +1834,7 @@ EXPORT_SYMBOL(vmalloc_user);
+@@ -1759,6 +1825,7 @@ EXPORT_SYMBOL(vmalloc_user);
* For tight control over page level allocator and protection flags
* use __vmalloc() instead.
*/
@@ -72756,7 +71546,7 @@ index 43b44db..5361145 100644
void *vmalloc_node(unsigned long size, int node)
{
return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL,
-@@ -1787,6 +1854,7 @@ EXPORT_SYMBOL(vmalloc_node);
+@@ -1778,6 +1845,7 @@ EXPORT_SYMBOL(vmalloc_node);
* For tight control over page level allocator and protection flags
* use __vmalloc_node() instead.
*/
@@ -72764,7 +71554,7 @@ index 43b44db..5361145 100644
void *vzalloc_node(unsigned long size, int node)
{
return __vmalloc_node_flags(size, node,
-@@ -1809,10 +1877,10 @@ EXPORT_SYMBOL(vzalloc_node);
+@@ -1800,10 +1868,10 @@ EXPORT_SYMBOL(vzalloc_node);
* For tight control over page level allocator and protection flags
* use __vmalloc() instead.
*/
@@ -72777,7 +71567,7 @@ index 43b44db..5361145 100644
-1, __builtin_return_address(0));
}
-@@ -1831,6 +1899,7 @@ void *vmalloc_exec(unsigned long size)
+@@ -1822,6 +1890,7 @@ void *vmalloc_exec(unsigned long size)
* Allocate enough 32bit PA addressable pages to cover @size from the
* page level allocator and map them into contiguous kernel virtual space.
*/
@@ -72785,7 +71575,7 @@ index 43b44db..5361145 100644
void *vmalloc_32(unsigned long size)
{
return __vmalloc_node(size, 1, GFP_VMALLOC32, PAGE_KERNEL,
-@@ -1845,6 +1914,7 @@ EXPORT_SYMBOL(vmalloc_32);
+@@ -1836,6 +1905,7 @@ EXPORT_SYMBOL(vmalloc_32);
* The resulting memory area is 32bit addressable and zeroed so it can be
* mapped to userspace without leaking data.
*/
@@ -72793,7 +71583,7 @@ index 43b44db..5361145 100644
void *vmalloc_32_user(unsigned long size)
{
struct vm_struct *area;
-@@ -2107,6 +2177,8 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
+@@ -2098,6 +2168,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;
@@ -72803,15 +71593,15 @@ index 43b44db..5361145 100644
return -EINVAL;
diff --git a/mm/vmstat.c b/mm/vmstat.c
-index 20c18b7..f6eb92a 100644
+index 8fd603b..cf0d930 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -78,7 +78,7 @@ void vm_events_fold_cpu(int cpu)
*
* vm_stat contains the global counters
*/
--atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
-+atomic_long_unchecked_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
+-atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS] __cacheline_aligned_in_smp;
++atomic_long_unchecked_t vm_stat[NR_VM_ZONE_STAT_ITEMS] __cacheline_aligned_in_smp;
EXPORT_SYMBOL(vm_stat);
#ifdef CONFIG_SMP
@@ -72833,7 +71623,7 @@ index 20c18b7..f6eb92a 100644
}
#endif
-@@ -1207,10 +1207,20 @@ static int __init setup_vmstat(void)
+@@ -1208,10 +1208,20 @@ static int __init setup_vmstat(void)
start_cpu_timer(cpu);
#endif
#ifdef CONFIG_PROC_FS
@@ -72859,10 +71649,10 @@ index 20c18b7..f6eb92a 100644
return 0;
}
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
-index 917ecb9..b0eeef8 100644
+index 5471628..cef8398 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
-@@ -591,8 +591,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
+@@ -588,8 +588,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
err = -EPERM;
if (!capable(CAP_NET_ADMIN))
break;
@@ -72885,30 +71675,8 @@ index fdfdb57..38d368c 100644
set_fs(oldfs);
if (ret <= 0 && ret != -ERESTARTSYS && ret != -EAGAIN)
-diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
-index e317583..3c8aeaf 100644
---- a/net/9p/trans_virtio.c
-+++ b/net/9p/trans_virtio.c
-@@ -327,7 +327,7 @@ req_retry_pinned:
- } else {
- char *pbuf;
- if (req->tc->pubuf)
-- pbuf = (__force char *) req->tc->pubuf;
-+ pbuf = (char __force_kernel *) req->tc->pubuf;
- else
- pbuf = req->tc->pkbuf;
- outp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, pbuf,
-@@ -357,7 +357,7 @@ req_retry_pinned:
- } else {
- char *pbuf;
- if (req->tc->pubuf)
-- pbuf = (__force char *) req->tc->pubuf;
-+ pbuf = (char __force_kernel *) req->tc->pubuf;
- else
- pbuf = req->tc->pkbuf;
-
diff --git a/net/atm/atm_misc.c b/net/atm/atm_misc.c
-index fc63526..7777a58 100644
+index f41f026..fe76ea8 100644
--- a/net/atm/atm_misc.c
+++ b/net/atm/atm_misc.c
@@ -17,7 +17,7 @@ int atm_charge(struct atm_vcc *vcc, int truesize)
@@ -72973,21 +71741,8 @@ index 0919a88..a23d54e 100644
};
-diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
-index d1b2d9a..7cc2219 100644
---- a/net/atm/mpoa_caches.c
-+++ b/net/atm/mpoa_caches.c
-@@ -255,6 +255,8 @@ static void check_resolving_entries(struct mpoa_client *client)
- struct timeval now;
- struct k_message msg;
-
-+ pax_track_stack();
-+
- do_gettimeofday(&now);
-
- read_lock_bh(&client->ingress_lock);
diff --git a/net/atm/proc.c b/net/atm/proc.c
-index be3afde..ec5e87e 100644
+index 0d020de..011c7bb 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,
@@ -73025,11 +71780,42 @@ index 23f45ce..c748f1a 100644
__AAL_STAT_ITEMS
#undef __HANDLE_ITEM
}
+diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
+index 3512e25..2b33401 100644
+--- a/net/batman-adv/bat_iv_ogm.c
++++ b/net/batman-adv/bat_iv_ogm.c
+@@ -541,7 +541,7 @@ void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes)
+
+ /* 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));
+
+ batman_ogm_packet->ttvn = atomic_read(&bat_priv->ttvn);
+ batman_ogm_packet->tt_crc = htons((uint16_t)
+@@ -561,7 +561,7 @@ void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes)
+ else
+ batman_ogm_packet->gw_flags = NO_FLAGS;
+
+- atomic_inc(&hard_iface->seqno);
++ atomic_inc_unchecked(&hard_iface->seqno);
+
+ slide_own_bcast_window(hard_iface);
+ bat_ogm_queue_add(bat_priv, hard_iface->packet_buff,
+@@ -922,7 +922,7 @@ static void bat_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);
+
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
-index dfbfccc..9588715 100644
+index 7704df4..beb4e16 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
-@@ -351,8 +351,8 @@ int hardif_enable_interface(struct hard_iface *hard_iface, char *iface_name)
+@@ -326,8 +326,8 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
hard_iface->batman_adv_ptype.dev = hard_iface->net_dev;
dev_add_pack(&hard_iface->batman_adv_ptype);
@@ -73040,65 +71826,30 @@ index dfbfccc..9588715 100644
bat_info(hard_iface->soft_iface, "Adding interface: %s\n",
hard_iface->net_dev->name);
-diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
-index bb1c3ec..e279654 100644
---- a/net/batman-adv/routing.c
-+++ b/net/batman-adv/routing.c
-@@ -627,7 +627,7 @@ void receive_bat_packet(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_packet->flags & DIRECTLINK ? 1 : 0);
-
-diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
-index 3377927..96f64f1 100644
---- a/net/batman-adv/send.c
-+++ b/net/batman-adv/send.c
-@@ -279,7 +279,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
-
- /* change sequence number to network order */
- batman_packet->seqno =
-- htonl((uint32_t)atomic_read(&hard_iface->seqno));
-+ htonl((uint32_t)atomic_read_unchecked(&hard_iface->seqno));
-
- if (vis_server == VIS_TYPE_SERVER_SYNC)
- batman_packet->flags |= VIS_SERVER;
-@@ -293,7 +293,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
- else
- batman_packet->gw_flags = 0;
-
-- atomic_inc(&hard_iface->seqno);
-+ atomic_inc_unchecked(&hard_iface->seqno);
-
- slide_own_bcast_window(hard_iface);
- send_time = own_send_time(bat_priv);
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
-index d5aa609..8b4df33 100644
+index f9cc957..efd9dae 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
-@@ -628,7 +628,7 @@ int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
+@@ -634,7 +634,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
/* 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);
+ add_bcast_packet_to_list(bat_priv, skb, 1);
-@@ -830,7 +830,7 @@ struct net_device *softif_create(char *name)
+@@ -828,7 +828,7 @@ struct net_device *softif_create(const char *name)
atomic_set(&bat_priv->batman_queue_left, BATMAN_QUEUE_LEN);
atomic_set(&bat_priv->mesh_state, MESH_INACTIVE);
- atomic_set(&bat_priv->bcast_seqno, 1);
+ atomic_set_unchecked(&bat_priv->bcast_seqno, 1);
- atomic_set(&bat_priv->tt_local_changed, 0);
-
- bat_priv->primary_if = NULL;
+ atomic_set(&bat_priv->ttvn, 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 fab70e8..f8c9be3 100644
+index ab8d0fe..ceba3fd 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -38,8 +38,8 @@ struct hard_iface {
@@ -73112,7 +71863,7 @@ index fab70e8..f8c9be3 100644
unsigned char *packet_buff;
int packet_len;
struct kobject *hardif_obj;
-@@ -142,7 +142,7 @@ struct bat_priv {
+@@ -154,7 +154,7 @@ struct bat_priv {
atomic_t orig_interval; /* uint */
atomic_t hop_penalty; /* uint */
atomic_t log_level; /* uint */
@@ -73120,12 +71871,12 @@ index fab70e8..f8c9be3 100644
+ atomic_unchecked_t bcast_seqno;
atomic_t bcast_queue_left;
atomic_t batman_queue_left;
- char num_ifaces;
+ atomic_t ttvn; /* translation table version number */
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
-index 19c3daf..254d326 100644
+index 07d1c1d..7e9bea9 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
-@@ -265,7 +265,7 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+@@ -264,7 +264,7 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
frag1->flags = UNI_FRAG_HEAD | large_tail;
frag2->flags = large_tail;
@@ -73134,8 +71885,51 @@ index 19c3daf..254d326 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 c1c597e..05ebb40 100644
+--- a/net/bluetooth/hci_conn.c
++++ b/net/bluetooth/hci_conn.c
+@@ -234,7 +234,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));
+
+ hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
+ }
+diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
+index 17b5b1c..826d872 100644
+--- a/net/bluetooth/l2cap_core.c
++++ b/net/bluetooth/l2cap_core.c
+@@ -2176,8 +2176,10 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, voi
+ break;
+
+ case L2CAP_CONF_RFC:
+- if (olen == sizeof(rfc))
+- memcpy(&rfc, (void *)val, olen);
++ if (olen != sizeof(rfc))
++ break;
++
++ memcpy(&rfc, (void *)val, olen);
+
+ if (test_bit(CONF_STATE2_DEVICE, &chan->conf_state) &&
+ rfc.mode != chan->mode)
+@@ -2265,8 +2267,10 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len)
+
+ 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;
+ }
+ }
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
-index 995cbe0..c056d6c 100644
+index a5f4e57..910ee6d 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1485,7 +1485,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
@@ -73148,10 +71942,10 @@ index 995cbe0..c056d6c 100644
/* Okay, we found ICMPv6 header */
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
-index 2b5ca1a..fab7122 100644
+index 5864cc4..121f3a3 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
-@@ -1512,7 +1512,7 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
+@@ -1513,7 +1513,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);
@@ -73160,15 +71954,6 @@ index 2b5ca1a..fab7122 100644
BUGPRINT("c2u Didn't work\n");
ret = -EFAULT;
break;
-@@ -1780,6 +1780,8 @@ static int compat_copy_everything_to_user(struct ebt_table *t,
- int ret;
- void __user *pos;
-
-+ pax_track_stack();
-+
- memset(&tinfo, 0, sizeof(tinfo));
-
- if (cmd == EBT_SO_GET_ENTRIES) {
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index a986280..13444a1 100644
--- a/net/caif/caif_socket.c
@@ -73303,7 +72088,7 @@ index a986280..13444a1 100644
if (!IS_ERR(debugfsdir)) {
diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
-index e22671b..6598ea0 100644
+index 5cf5222..6f704ad 100644
--- a/net/caif/cfctrl.c
+++ b/net/caif/cfctrl.c
@@ -9,6 +9,7 @@
@@ -73314,9 +72099,9 @@ index e22671b..6598ea0 100644
#include <net/caif/caif_layer.h>
#include <net/caif/cfpkt.h>
#include <net/caif/cfctrl.h>
-@@ -45,8 +46,8 @@ struct cflayer *cfctrl_create(void)
+@@ -42,8 +43,8 @@ struct cflayer *cfctrl_create(void)
+ memset(&dev_info, 0, sizeof(dev_info));
dev_info.id = 0xff;
- memset(this, 0, sizeof(*this));
cfsrvl_init(&this->serv, 0, &dev_info, false);
- atomic_set(&this->req_seq_no, 1);
- atomic_set(&this->rsp_seq_no, 1);
@@ -73325,7 +72110,7 @@ index e22671b..6598ea0 100644
this->serv.layer.receive = cfctrl_recv;
sprintf(this->serv.layer.name, "ctrl");
this->serv.layer.ctrlcmd = cfctrl_ctrlcmd;
-@@ -132,8 +133,8 @@ static void cfctrl_insert_req(struct cfctrl *ctrl,
+@@ -129,8 +130,8 @@ static void cfctrl_insert_req(struct cfctrl *ctrl,
struct cfctrl_request_info *req)
{
spin_lock_bh(&ctrl->info_list_lock);
@@ -73336,7 +72121,7 @@ index e22671b..6598ea0 100644
list_add_tail(&req->list, &ctrl->list);
spin_unlock_bh(&ctrl->info_list_lock);
}
-@@ -151,7 +152,7 @@ static struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl,
+@@ -148,7 +149,7 @@ static struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl,
if (p != first)
pr_warn("Requests are not received in order\n");
@@ -73345,19 +72130,24 @@ index e22671b..6598ea0 100644
p->sequence_no);
list_del(&p->list);
goto out;
-@@ -364,6 +365,7 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
- struct cfctrl *cfctrl = container_obj(layer);
- struct cfctrl_request_info rsp, *req;
+diff --git a/net/can/gw.c b/net/can/gw.c
+index 3d79b12..8de85fa 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;
+ };
-+ pax_track_stack();
- cfpkt_extr_head(pkt, &cmdrsp, 1);
- cmd = cmdrsp & CFCTRL_CMD_MASK;
diff --git a/net/compat.c b/net/compat.c
-index c578d93..257fab7 100644
+index 6def90e..c6992fa 100644
--- a/net/compat.c
+++ b/net/compat.c
-@@ -70,9 +70,9 @@ int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg)
+@@ -71,9 +71,9 @@ int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg)
__get_user(kmsg->msg_controllen, &umsg->msg_controllen) ||
__get_user(kmsg->msg_flags, &umsg->msg_flags))
return -EFAULT;
@@ -73370,7 +72160,7 @@ index c578d93..257fab7 100644
return 0;
}
-@@ -84,7 +84,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
+@@ -85,7 +85,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
if (kern_msg->msg_namelen) {
if (mode == VERIFY_READ) {
@@ -73379,7 +72169,7 @@ index c578d93..257fab7 100644
kern_msg->msg_namelen,
kern_address);
if (err < 0)
-@@ -95,7 +95,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
+@@ -96,7 +96,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
kern_msg->msg_name = NULL;
tot_len = iov_from_user_compat_to_kern(kern_iov,
@@ -73388,7 +72178,7 @@ index c578d93..257fab7 100644
kern_msg->msg_iovlen);
if (tot_len >= 0)
kern_msg->msg_iov = kern_iov;
-@@ -115,20 +115,20 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
+@@ -116,20 +116,20 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
#define CMSG_COMPAT_FIRSTHDR(msg) \
(((msg)->msg_controllen) >= sizeof(struct compat_cmsghdr) ? \
@@ -73412,7 +72202,7 @@ index c578d93..257fab7 100644
msg->msg_controllen)
return NULL;
return (struct compat_cmsghdr __user *)ptr;
-@@ -220,7 +220,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
+@@ -221,7 +221,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
{
struct compat_timeval ctv;
struct compat_timespec cts[3];
@@ -73421,7 +72211,7 @@ index c578d93..257fab7 100644
struct compat_cmsghdr cmhdr;
int cmlen;
-@@ -272,7 +272,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
+@@ -273,7 +273,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm)
{
@@ -73430,7 +72220,7 @@ index c578d93..257fab7 100644
int fdmax = (kmsg->msg_controllen - sizeof(struct compat_cmsghdr)) / sizeof(int);
int fdnum = scm->fp->count;
struct file **fp = scm->fp->fp;
-@@ -369,7 +369,7 @@ static int do_set_sock_timeout(struct socket *sock, int level,
+@@ -370,7 +370,7 @@ static int do_set_sock_timeout(struct socket *sock, int level,
return -EFAULT;
old_fs = get_fs();
set_fs(KERNEL_DS);
@@ -73439,7 +72229,7 @@ index c578d93..257fab7 100644
set_fs(old_fs);
return err;
-@@ -430,7 +430,7 @@ static int do_get_sock_timeout(struct socket *sock, int level, int optname,
+@@ -431,7 +431,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);
@@ -73448,7 +72238,7 @@ index c578d93..257fab7 100644
set_fs(old_fs);
if (!err) {
-@@ -565,7 +565,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
+@@ -566,7 +566,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
case MCAST_JOIN_GROUP:
case MCAST_LEAVE_GROUP:
{
@@ -73457,7 +72247,7 @@ index c578d93..257fab7 100644
struct group_req __user *kgr =
compat_alloc_user_space(sizeof(struct group_req));
u32 interface;
-@@ -586,7 +586,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
+@@ -587,7 +587,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
case MCAST_BLOCK_SOURCE:
case MCAST_UNBLOCK_SOURCE:
{
@@ -73466,7 +72256,7 @@ index c578d93..257fab7 100644
struct group_source_req __user *kgsr = compat_alloc_user_space(
sizeof(struct group_source_req));
u32 interface;
-@@ -607,7 +607,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
+@@ -608,7 +608,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
}
case MCAST_MSFILTER:
{
@@ -73475,7 +72265,7 @@ index c578d93..257fab7 100644
struct group_filter __user *kgf;
u32 interface, fmode, numsrc;
-@@ -645,7 +645,7 @@ int compat_mc_getsockopt(struct sock *sock, int level, int optname,
+@@ -646,7 +646,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 *))
{
@@ -73485,7 +72275,7 @@ index c578d93..257fab7 100644
int __user *koptlen;
u32 interface, fmode, numsrc;
diff --git a/net/core/datagram.c b/net/core/datagram.c
-index 18ac112..fe95ed9 100644
+index 68bbf9f..5ef0d12 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -285,7 +285,7 @@ int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags)
@@ -73498,10 +72288,10 @@ index 18ac112..fe95ed9 100644
return err;
diff --git a/net/core/dev.c b/net/core/dev.c
-index f14f601..4641d8b 100644
+index 5a13edf..1bc016b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -1125,10 +1125,14 @@ void dev_load(struct net *net, const char *name)
+@@ -1139,10 +1139,14 @@ 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)) {
@@ -73516,7 +72306,7 @@ index f14f601..4641d8b 100644
}
}
EXPORT_SYMBOL(dev_load);
-@@ -1959,7 +1963,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
+@@ -2036,7 +2040,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
struct dev_gso_cb {
void (*destructor)(struct sk_buff *skb);
@@ -73525,7 +72315,7 @@ index f14f601..4641d8b 100644
#define DEV_GSO_CB(skb) ((struct dev_gso_cb *)(skb)->cb)
-@@ -2912,7 +2916,7 @@ int netif_rx_ni(struct sk_buff *skb)
+@@ -3044,7 +3048,7 @@ int netif_rx_ni(struct sk_buff *skb)
}
EXPORT_SYMBOL(netif_rx_ni);
@@ -73534,7 +72324,7 @@ index f14f601..4641d8b 100644
{
struct softnet_data *sd = &__get_cpu_var(softnet_data);
-@@ -3761,7 +3765,7 @@ void netif_napi_del(struct napi_struct *napi)
+@@ -3891,7 +3895,7 @@ void netif_napi_del(struct napi_struct *napi)
}
EXPORT_SYMBOL(netif_napi_del);
@@ -73544,10 +72334,10 @@ index f14f601..4641d8b 100644
struct softnet_data *sd = &__get_cpu_var(softnet_data);
unsigned long time_limit = jiffies + 2;
diff --git a/net/core/flow.c b/net/core/flow.c
-index a6bda2a..0829c68 100644
+index e318c7e..168b1d0 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
-@@ -60,7 +60,7 @@ struct flow_cache {
+@@ -61,7 +61,7 @@ struct flow_cache {
struct timer_list rnd_timer;
};
@@ -73556,7 +72346,7 @@ index a6bda2a..0829c68 100644
EXPORT_SYMBOL(flow_cache_genid);
static struct flow_cache flow_cache_global;
static struct kmem_cache *flow_cachep __read_mostly;
-@@ -85,7 +85,7 @@ static void flow_cache_new_hashrnd(unsigned long arg)
+@@ -86,7 +86,7 @@ static void flow_cache_new_hashrnd(unsigned long arg)
static int flow_entry_valid(struct flow_cache_entry *fle)
{
@@ -73565,7 +72355,7 @@ index a6bda2a..0829c68 100644
return 0;
if (fle->object && !fle->object->ops->check(fle->object))
return 0;
-@@ -256,7 +256,7 @@ flow_cache_lookup(struct net *net, const struct flowi *key, u16 family, u8 dir,
+@@ -259,7 +259,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++;
}
@@ -73574,7 +72364,7 @@ index a6bda2a..0829c68 100644
flo = fle->object;
if (!flo)
goto ret_object;
-@@ -277,7 +277,7 @@ nocache:
+@@ -280,7 +280,7 @@ nocache:
}
flo = resolver(net, key, family, dir, flo, ctx);
if (fle) {
@@ -73606,23 +72396,23 @@ index c40f27e..7f49254 100644
m->msg_iov = iov;
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
-index abd936d..c31a426 100644
+index 9083e82..1673203 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
-@@ -56,7 +56,7 @@
- struct rtnl_link {
+@@ -57,7 +57,7 @@ struct rtnl_link {
rtnl_doit_func doit;
rtnl_dumpit_func dumpit;
+ rtnl_calcit_func calcit;
-};
+} __no_const;
static DEFINE_MUTEX(rtnl_mutex);
-
+ static u16 min_ifinfo_dump_size;
diff --git a/net/core/scm.c b/net/core/scm.c
-index 811b53f..5d6c343 100644
+index ff52ad0..aff1c0f 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
-@@ -218,7 +218,7 @@ EXPORT_SYMBOL(__scm_send);
+@@ -220,7 +220,7 @@ EXPORT_SYMBOL(__scm_send);
int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
{
struct cmsghdr __user *cm
@@ -73631,7 +72421,7 @@ index 811b53f..5d6c343 100644
struct cmsghdr cmhdr;
int cmlen = CMSG_LEN(len);
int err;
-@@ -241,7 +241,7 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
+@@ -243,7 +243,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;
@@ -73640,7 +72430,7 @@ index 811b53f..5d6c343 100644
goto out;
cmlen = CMSG_SPACE(len);
if (msg->msg_controllen < cmlen)
-@@ -257,7 +257,7 @@ EXPORT_SYMBOL(put_cmsg);
+@@ -259,7 +259,7 @@ EXPORT_SYMBOL(put_cmsg);
void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
{
struct cmsghdr __user *cm
@@ -73649,7 +72439,7 @@ index 811b53f..5d6c343 100644
int fdmax = 0;
int fdnum = scm->fp->count;
-@@ -277,7 +277,7 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
+@@ -279,7 +279,7 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
if (fdnum < fdmax)
fdmax = fdnum;
@@ -73658,33 +72448,20 @@ index 811b53f..5d6c343 100644
i++, cmfptr++)
{
int new_fd;
-diff --git a/net/core/skbuff.c b/net/core/skbuff.c
-index 46cbd28..f5ce81a 100644
---- a/net/core/skbuff.c
-+++ b/net/core/skbuff.c
-@@ -1543,6 +1543,8 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
- struct sock *sk = skb->sk;
- int ret = 0;
-
-+ pax_track_stack();
-+
- if (splice_grow_spd(pipe, &spd))
- return -ENOMEM;
-
diff --git a/net/core/sock.c b/net/core/sock.c
-index aebb419..be941ff 100644
+index b23f174..b9a0d26 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
-@@ -291,7 +291,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
- */
- if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
- (unsigned)sk->sk_rcvbuf) {
+@@ -289,7 +289,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) {
- atomic_inc(&sk->sk_drops);
+ atomic_inc_unchecked(&sk->sk_drops);
+ trace_sock_rcvqueue_full(sk, skb);
return -ENOMEM;
}
-
-@@ -300,7 +300,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+@@ -299,7 +299,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
return err;
if (!sk_rmem_schedule(sk, skb->truesize)) {
@@ -73693,7 +72470,7 @@ index aebb419..be941ff 100644
return -ENOBUFS;
}
-@@ -320,7 +320,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+@@ -319,7 +319,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
skb_dst_force(skb);
spin_lock_irqsave(&list->lock, flags);
@@ -73702,7 +72479,7 @@ index aebb419..be941ff 100644
__skb_queue_tail(list, skb);
spin_unlock_irqrestore(&list->lock, flags);
-@@ -340,7 +340,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
+@@ -339,7 +339,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
skb->dev = NULL;
if (sk_rcvqueues_full(sk, skb)) {
@@ -73711,7 +72488,7 @@ index aebb419..be941ff 100644
goto discard_and_relse;
}
if (nested)
-@@ -358,7 +358,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
+@@ -357,7 +357,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)) {
bh_unlock_sock(sk);
@@ -73720,7 +72497,7 @@ index aebb419..be941ff 100644
goto discard_and_relse;
}
-@@ -921,7 +921,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
+@@ -917,7 +917,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);
@@ -73729,7 +72506,7 @@ index aebb419..be941ff 100644
return -EFAULT;
goto lenout;
}
-@@ -934,7 +934,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
+@@ -930,7 +930,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
return -ENOTCONN;
if (lv < len)
return -EINVAL;
@@ -73738,7 +72515,7 @@ index aebb419..be941ff 100644
return -EFAULT;
goto lenout;
}
-@@ -967,7 +967,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
+@@ -963,7 +963,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
if (len > lv)
len = lv;
@@ -73747,7 +72524,7 @@ index aebb419..be941ff 100644
return -EFAULT;
lenout:
if (put_user(len, optlen))
-@@ -2024,7 +2024,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
+@@ -2020,7 +2020,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
*/
smp_wmb();
atomic_set(&sk->sk_refcnt, 1);
@@ -73757,10 +72534,10 @@ index aebb419..be941ff 100644
EXPORT_SYMBOL(sock_init_data);
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
-index 28f8b5e..2e2c4f4 100644
+index 02e75d1..9a57a7c 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
-@@ -173,7 +173,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
+@@ -174,7 +174,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
if (len > *lenp) len = *lenp;
@@ -73769,7 +72546,7 @@ index 28f8b5e..2e2c4f4 100644
return -EFAULT;
*lenp = len;
-@@ -236,7 +236,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
+@@ -237,7 +237,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
if (len > *lenp) len = *lenp;
@@ -73792,7 +72569,7 @@ index 39a2d29..f39c0fe 100644
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/fib_frontend.c b/net/ipv4/fib_frontend.c
-index 2252471..c176a83 100644
+index 92fc5f6..b790d91 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -970,12 +970,12 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
@@ -73820,10 +72597,10 @@ index 2252471..c176a83 100644
break;
case NETDEV_DOWN:
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
-index 33e2c35..6b07352 100644
+index 80106d8..232e898 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
-@@ -691,7 +691,7 @@ __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh)
+@@ -699,7 +699,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);
@@ -73833,7 +72610,7 @@ index 33e2c35..6b07352 100644
return nh->nh_saddr;
}
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
-index 3267d38..76443f1 100644
+index ccee270..db23c3c 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -114,8 +114,14 @@ static int inet_csk_diag_fill(struct sock *sk,
@@ -73851,7 +72628,7 @@ index 3267d38..76443f1 100644
r->id.idiag_sport = inet->inet_sport;
r->id.idiag_dport = inet->inet_dport;
-@@ -201,8 +207,15 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
+@@ -210,8 +216,15 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
r->idiag_family = tw->tw_family;
r->idiag_retrans = 0;
r->id.idiag_if = tw->tw_bound_dev_if;
@@ -73867,7 +72644,7 @@ index 3267d38..76443f1 100644
r->id.idiag_sport = tw->tw_sport;
r->id.idiag_dport = tw->tw_dport;
r->id.idiag_src[0] = tw->tw_rcv_saddr;
-@@ -285,12 +298,14 @@ static int inet_diag_get_exact(struct sk_buff *in_skb,
+@@ -294,12 +307,14 @@ static int inet_diag_get_exact(struct sk_buff *in_skb,
if (sk == NULL)
goto unlock;
@@ -73882,7 +72659,7 @@ index 3267d38..76443f1 100644
err = -ENOMEM;
rep = alloc_skb(NLMSG_SPACE((sizeof(struct inet_diag_msg) +
-@@ -580,8 +595,14 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
+@@ -589,8 +604,14 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
r->idiag_retrans = req->retrans;
r->id.idiag_if = sk->sk_bound_dev_if;
@@ -73927,34 +72704,25 @@ 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 6877645..d97d6de 100644
+index 86f13c67..59a35b5 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
-@@ -481,6 +481,8 @@ struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create)
- unsigned int sequence;
- int invalidated, newrefcnt = 0;
-
-+ pax_track_stack();
-+
- /* Look up for the address quickly, lockless.
- * Because of a concurrent writer, we might not find an existing entry.
- */
-@@ -517,8 +519,8 @@ found: /* The existing node has been found.
+@@ -436,8 +436,8 @@ relookup:
if (p) {
p->daddr = *daddr;
atomic_set(&p->refcnt, 1);
- atomic_set(&p->rid, 0);
-- atomic_set(&p->ip_id_count, secure_ip_id(daddr->addr.a4));
+- atomic_set(&p->ip_id_count,
+ atomic_set_unchecked(&p->rid, 0);
-+ atomic_set_unchecked(&p->ip_id_count, secure_ip_id(daddr->addr.a4));
- p->tcp_ts_stamp = 0;
- p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW;
- p->rate_tokens = 0;
++ atomic_set_unchecked(&p->ip_id_count,
+ (daddr->family == AF_INET) ?
+ 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 0ad6035..8bc7467 100644
+index fdaabf2..0ec3205 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
-@@ -315,7 +315,7 @@ static inline int ip_frag_too_far(struct ipq *qp)
+@@ -316,7 +316,7 @@ static inline int ip_frag_too_far(struct ipq *qp)
return 0;
start = qp->rid;
@@ -73964,19 +72732,10 @@ index 0ad6035..8bc7467 100644
rc = qp->q.fragments && (end - start) > max;
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
-index ab0c9ef..e321f44 100644
+index 09ff51b..d3968eb 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
-@@ -1073,6 +1073,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
- int val;
- int len;
-
-+ pax_track_stack();
-+
- if (level != SOL_IP)
- return -EOPNOTSUPP;
-
-@@ -1110,7 +1112,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
+@@ -1111,7 +1111,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;
@@ -73986,20 +72745,20 @@ index ab0c9ef..e321f44 100644
return -EFAULT;
return 0;
}
-@@ -1238,7 +1241,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
+@@ -1239,7 +1240,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
if (sk->sk_type != SOCK_STREAM)
return -ENOPROTOOPT;
- msg.msg_control = optval;
+ msg.msg_control = (void __force_kernel *)optval;
msg.msg_controllen = len;
- msg.msg_flags = 0;
+ msg.msg_flags = flags;
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
-index ab7e554..d9b5ae6 100644
+index 99ec116..c5628fe 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
-@@ -313,7 +313,7 @@ static int __init ic_devinet_ioctl(unsigned int cmd, struct ifreq *arg)
+@@ -318,7 +318,7 @@ static int __init ic_devinet_ioctl(unsigned int cmd, struct ifreq *arg)
mm_segment_t oldfs = get_fs();
set_fs(get_ds());
@@ -74008,7 +72767,7 @@ index ab7e554..d9b5ae6 100644
set_fs(oldfs);
return res;
}
-@@ -324,7 +324,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg)
+@@ -329,7 +329,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg)
mm_segment_t oldfs = get_fs();
set_fs(get_ds());
@@ -74017,7 +72776,7 @@ index ab7e554..d9b5ae6 100644
set_fs(oldfs);
return res;
}
-@@ -335,7 +335,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg)
+@@ -340,7 +340,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg)
mm_segment_t oldfs = get_fs();
set_fs(get_ds());
@@ -74027,7 +72786,7 @@ index ab7e554..d9b5ae6 100644
return res;
}
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
-index 8812a02..c4cdb5a 100644
+index 2133c30..5c4b40b 100644
--- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
@@ -399,7 +399,7 @@ static unsigned char asn1_octets_decode(struct asn1_ctx *ctx,
@@ -74036,14 +72795,14 @@ index 8812a02..c4cdb5a 100644
- *octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC);
+ *octets = kmalloc((eoc - ctx->pointer), GFP_ATOMIC);
- if (*octets == NULL) {
- if (net_ratelimit())
- pr_notice("OOM in bsalg (%d)\n", __LINE__);
+ if (*octets == NULL)
+ return 0;
+
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
-index 39b403f..8e6a0a8 100644
+index 43d4c3b..1914409 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
-@@ -837,7 +837,7 @@ static void ping_format_sock(struct sock *sp, struct seq_file *f,
+@@ -836,7 +836,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),
atomic_read(&sp->sk_refcnt), sp,
@@ -74053,10 +72812,10 @@ index 39b403f..8e6a0a8 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 c9893d4..5513bcb 100644
+index 007e2eb..85a18a0 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
-@@ -302,7 +302,7 @@ static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb)
+@@ -303,7 +303,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)) {
@@ -74065,7 +72824,7 @@ index c9893d4..5513bcb 100644
kfree_skb(skb);
return NET_RX_DROP;
}
-@@ -736,16 +736,20 @@ static int raw_init(struct sock *sk)
+@@ -738,16 +738,20 @@ static int raw_init(struct sock *sk)
static int raw_seticmpfilter(struct sock *sk, char __user *optval, int optlen)
{
@@ -74087,19 +72846,18 @@ index c9893d4..5513bcb 100644
if (get_user(len, optlen))
goto out;
-@@ -755,8 +759,9 @@ static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *o
+@@ -757,8 +761,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;
- if (put_user(len, optlen) ||
- copy_to_user(optval, &raw_sk(sk)->filter, len))
+ filter = raw_sk(sk)->filter;
-+ if (put_user(len, optlen) || len > sizeof filter ||
-+ copy_to_user(optval, &filter, len))
++ if (put_user(len, optlen) || len > sizeof filter || copy_to_user(optval, &filter, len))
goto out;
ret = 0;
out: return ret;
-@@ -984,7 +989,13 @@ static void raw_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
+@@ -986,7 +990,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),
@@ -74115,10 +72873,10 @@ index c9893d4..5513bcb 100644
static int raw_seq_show(struct seq_file *seq, void *v)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
-index 75ef66f..458c43f 100644
+index 94cdbc5..0cb0063 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
-@@ -304,7 +304,7 @@ static inline unsigned int rt_hash(__be32 daddr, __be32 saddr, int idx,
+@@ -313,7 +313,7 @@ static inline unsigned int rt_hash(__be32 daddr, __be32 saddr, int idx,
static inline int rt_genid(struct net *net)
{
@@ -74127,16 +72885,16 @@ index 75ef66f..458c43f 100644
}
#ifdef CONFIG_PROC_FS
-@@ -832,7 +832,7 @@ static void rt_cache_invalidate(struct net *net)
+@@ -937,7 +937,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);
+ redirect_genid++;
}
- /*
-@@ -2832,7 +2832,7 @@ static int rt_fill_info(struct net *net,
+@@ -3022,7 +3022,7 @@ static int rt_fill_info(struct net *net,
error = rt->dst.error;
if (peer) {
inet_peer_refcheck(rt->peer);
@@ -74145,30 +72903,8 @@ index 75ef66f..458c43f 100644
if (peer->tcp_ts_stamp) {
ts = peer->tcp_ts;
tsage = get_seconds() - peer->tcp_ts_stamp;
-diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
-index 46febca..98b73a4 100644
---- a/net/ipv4/tcp.c
-+++ b/net/ipv4/tcp.c
-@@ -2122,6 +2122,8 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
- int val;
- int err = 0;
-
-+ pax_track_stack();
-+
- /* These are data/string values, all the others are ints */
- switch (optname) {
- case TCP_CONGESTION: {
-@@ -2501,6 +2503,8 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
- struct tcp_sock *tp = tcp_sk(sk);
- int val, len;
-
-+ pax_track_stack();
-+
- if (get_user(len, optlen))
- return -EFAULT;
-
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
-index 69790aa..e6cabd4 100644
+index a9db4b1..3c03301 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -87,6 +87,9 @@ int sysctl_tcp_tw_reuse __read_mostly;
@@ -74181,7 +72917,7 @@ index 69790aa..e6cabd4 100644
#ifdef CONFIG_TCP_MD5SIG
static struct tcp_md5sig_key *tcp_v4_md5_do_lookup(struct sock *sk,
-@@ -1610,6 +1613,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -1627,6 +1630,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
return 0;
reset:
@@ -74191,7 +72927,7 @@ index 69790aa..e6cabd4 100644
tcp_v4_send_reset(rsk, skb);
discard:
kfree_skb(skb);
-@@ -1672,12 +1678,19 @@ int tcp_v4_rcv(struct sk_buff *skb)
+@@ -1689,12 +1695,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);
@@ -74214,7 +72950,7 @@ index 69790aa..e6cabd4 100644
if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
-@@ -1727,6 +1740,10 @@ no_tcp_socket:
+@@ -1744,6 +1757,10 @@ no_tcp_socket:
bad_packet:
TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
} else {
@@ -74225,7 +72961,7 @@ index 69790aa..e6cabd4 100644
tcp_v4_send_reset(NULL, skb);
}
-@@ -2391,7 +2408,11 @@ static void get_openreq4(struct sock *sk, struct request_sock *req,
+@@ -2404,7 +2421,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),
@@ -74237,7 +72973,7 @@ index 69790aa..e6cabd4 100644
len);
}
-@@ -2441,7 +2462,12 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len)
+@@ -2454,7 +2475,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),
@@ -74251,7 +72987,7 @@ index 69790aa..e6cabd4 100644
jiffies_to_clock_t(icsk->icsk_rto),
jiffies_to_clock_t(icsk->icsk_ack.ato),
(icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong,
-@@ -2469,7 +2495,13 @@ static void get_timewait4_sock(struct inet_timewait_sock *tw,
+@@ -2482,7 +2508,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,
@@ -74267,7 +73003,7 @@ index 69790aa..e6cabd4 100644
#define TMPSZ 150
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
-index 80b1f80..9501f25 100644
+index 66363b6..b0654a3 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -27,6 +27,10 @@
@@ -74281,7 +73017,7 @@ index 80b1f80..9501f25 100644
int sysctl_tcp_syncookies __read_mostly = 1;
EXPORT_SYMBOL(sysctl_tcp_syncookies);
-@@ -745,6 +749,10 @@ listen_overflow:
+@@ -751,6 +755,10 @@ listen_overflow:
embryonic_reset:
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
@@ -74292,19 +73028,6 @@ index 80b1f80..9501f25 100644
if (!(flg & TCP_FLAG_RST))
req->rsk_ops->send_reset(sk, skb);
-diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
-index 882e0b0..2eba47f 100644
---- a/net/ipv4/tcp_output.c
-+++ b/net/ipv4/tcp_output.c
-@@ -2421,6 +2421,8 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
- int mss;
- int s_data_desired = 0;
-
-+ pax_track_stack();
-+
- if (cvp != NULL && cvp->s_data_constant && cvp->s_data_desired)
- s_data_desired = cvp->s_data_desired;
- skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC);
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 85ee7eb..53277ab 100644
--- a/net/ipv4/tcp_probe.c
@@ -74319,7 +73042,7 @@ index 85ee7eb..53277ab 100644
cnt += width;
}
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
-index ecd44b0..b32fba6 100644
+index 2e0f0af..e2948bf 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -22,6 +22,10 @@
@@ -74348,7 +73071,7 @@ index ecd44b0..b32fba6 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 198f75b..91d9905 100644
+index 5a65eea..bd913a1 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -86,6 +86,7 @@
@@ -74359,8 +73082,8 @@ index 198f75b..91d9905 100644
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/igmp.h>
-@@ -107,6 +108,10 @@
- #include <net/xfrm.h>
+@@ -108,6 +109,10 @@
+ #include <trace/events/udp.h>
#include "udp_impl.h"
+#ifdef CONFIG_GRKERNSEC_BLACKHOLE
@@ -74370,7 +73093,7 @@ index 198f75b..91d9905 100644
struct udp_table udp_table __read_mostly;
EXPORT_SYMBOL(udp_table);
-@@ -564,6 +569,9 @@ found:
+@@ -565,6 +570,9 @@ found:
return s;
}
@@ -74380,7 +73103,7 @@ index 198f75b..91d9905 100644
/*
* This routine is called by the ICMP module when it gets some
* sort of error condition. If err < 0 then the socket should
-@@ -855,9 +863,18 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
+@@ -856,9 +864,18 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
dport = usin->sin_port;
if (dport == 0)
return -EINVAL;
@@ -74399,7 +73122,7 @@ index 198f75b..91d9905 100644
daddr = inet->inet_daddr;
dport = inet->inet_dport;
/* Open fast path for connected socket.
-@@ -1098,7 +1115,7 @@ static unsigned int first_packet_length(struct sock *sk)
+@@ -1099,7 +1116,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));
@@ -74408,7 +73131,7 @@ index 198f75b..91d9905 100644
__skb_unlink(skb, rcvq);
__skb_queue_tail(&list_kill, skb);
}
-@@ -1184,6 +1201,10 @@ try_again:
+@@ -1185,6 +1202,10 @@ try_again:
if (!skb)
goto out;
@@ -74417,9 +73140,9 @@ index 198f75b..91d9905 100644
+ goto out_free;
+
ulen = skb->len - sizeof(struct udphdr);
- if (len > ulen)
- len = ulen;
-@@ -1483,7 +1504,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+ copied = len;
+ if (copied > ulen)
+@@ -1487,7 +1508,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);
@@ -74428,7 +73151,7 @@ index 198f75b..91d9905 100644
kfree_skb(skb);
return -1;
}
-@@ -1502,7 +1523,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
+@@ -1506,7 +1527,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
if (!skb1) {
@@ -74437,7 +73160,7 @@ index 198f75b..91d9905 100644
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
IS_UDPLITE(sk));
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
-@@ -1671,6 +1692,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
+@@ -1675,6 +1696,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);
@@ -74464,10 +73187,10 @@ index 198f75b..91d9905 100644
int udp4_seq_show(struct seq_file *seq, void *v)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
-index 498b927..79ba352 100644
+index 36806de..b86f74c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
-@@ -2072,7 +2072,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
+@@ -2149,7 +2149,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
p.iph.ihl = 5;
p.iph.protocol = IPPROTO_IPV6;
p.iph.ttl = 64;
@@ -74477,7 +73200,7 @@ index 498b927..79ba352 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 8a58e8c..8b5e631 100644
+index 1567fb1..29af910 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,
@@ -74499,28 +73222,10 @@ index 8a58e8c..8b5e631 100644
dst = NULL;
}
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
-index 147ede38..fb01709 100644
+index 26cb08c..8af9877 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
-@@ -129,6 +129,8 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
- int val, valbool;
- int retv = -ENOPROTOOPT;
-
-+ pax_track_stack();
-+
- if (optval == NULL)
- val=0;
- else {
-@@ -919,6 +921,8 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
- int len;
- int val;
-
-+ pax_track_stack();
-+
- if (ip6_mroute_opt(optname))
- return ip6_mroute_getsockopt(sk, optname, optval, optlen);
-
-@@ -960,7 +964,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
+@@ -960,7 +960,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
if (sk->sk_type != SOCK_STREAM)
return -ENOPROTOOPT;
@@ -74530,19 +73235,19 @@ index 147ede38..fb01709 100644
msg.msg_flags = flags;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
-index cc7313b..e91945a 100644
+index 331af3b..7789844 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
-@@ -376,7 +376,7 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb)
+@@ -377,7 +377,7 @@ static inline int rawv6_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
- if ((raw6_sk(sk)->checksum || rcu_dereference_raw(sk->sk_filter)) &&
+ if ((raw6_sk(sk)->checksum || rcu_access_pointer(sk->sk_filter)) &&
skb_checksum_complete(skb)) {
- atomic_inc(&sk->sk_drops);
+ atomic_inc_unchecked(&sk->sk_drops);
kfree_skb(skb);
return NET_RX_DROP;
}
-@@ -403,7 +403,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -404,7 +404,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)) {
@@ -74551,7 +73256,7 @@ index cc7313b..e91945a 100644
kfree_skb(skb);
return NET_RX_DROP;
}
-@@ -427,7 +427,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -428,7 +428,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
if (inet->hdrincl) {
if (skb_checksum_complete(skb)) {
@@ -74569,16 +73274,7 @@ index cc7313b..e91945a 100644
struct flowi6 *fl6, struct dst_entry **dstp,
unsigned int flags)
{
-@@ -742,6 +742,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
- u16 proto;
- int err;
-
-+ pax_track_stack();
-+
- /* Rough check on arithmetic overflow,
- better check is made in ip6_append_data().
- */
-@@ -909,12 +911,15 @@ do_confirm:
+@@ -909,12 +909,15 @@ do_confirm:
static int rawv6_seticmpfilter(struct sock *sk, int level, int optname,
char __user *optval, int optlen)
{
@@ -74595,7 +73291,7 @@ index cc7313b..e91945a 100644
return 0;
default:
return -ENOPROTOOPT;
-@@ -927,6 +932,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
+@@ -927,6 +930,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
int len;
@@ -74603,7 +73299,7 @@ index cc7313b..e91945a 100644
switch (optname) {
case ICMPV6_FILTER:
-@@ -938,7 +944,8 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
+@@ -938,7 +942,8 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
len = sizeof(struct icmp6_filter);
if (put_user(len, optlen))
return -EFAULT;
@@ -74613,7 +73309,7 @@ index cc7313b..e91945a 100644
return -EFAULT;
return 0;
default:
-@@ -1252,7 +1259,13 @@ static void raw6_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
+@@ -1245,7 +1250,13 @@ static void raw6_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
0, 0L, 0,
sock_i_uid(sp), 0,
sock_i_ino(sp),
@@ -74629,7 +73325,7 @@ index cc7313b..e91945a 100644
static int raw6_seq_show(struct seq_file *seq, void *v)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
-index 296510a..1866589 100644
+index 2dea4bb..dca8ac5 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -93,6 +93,10 @@ static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(struct sock *sk,
@@ -74643,7 +73339,7 @@ index 296510a..1866589 100644
static void tcp_v6_hash(struct sock *sk)
{
if (sk->sk_state != TCP_CLOSE) {
-@@ -1667,6 +1671,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -1651,6 +1655,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
return 0;
reset:
@@ -74653,7 +73349,7 @@ index 296510a..1866589 100644
tcp_v6_send_reset(sk, skb);
discard:
if (opt_skb)
-@@ -1746,12 +1753,20 @@ static int tcp_v6_rcv(struct sk_buff *skb)
+@@ -1730,12 +1737,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);
@@ -74676,7 +73372,7 @@ index 296510a..1866589 100644
if (hdr->hop_limit < inet6_sk(sk)->min_hopcount) {
NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
-@@ -1799,6 +1814,10 @@ no_tcp_socket:
+@@ -1783,6 +1798,10 @@ no_tcp_socket:
bad_packet:
TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
} else {
@@ -74687,7 +73383,7 @@ index 296510a..1866589 100644
tcp_v6_send_reset(NULL, skb);
}
-@@ -2059,7 +2078,13 @@ static void get_openreq6(struct seq_file *seq,
+@@ -2043,7 +2062,13 @@ static void get_openreq6(struct seq_file *seq,
uid,
0, /* non standard timer */
0, /* open_requests have no inode */
@@ -74702,7 +73398,7 @@ index 296510a..1866589 100644
}
static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
-@@ -2109,7 +2134,12 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
+@@ -2093,7 +2118,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),
@@ -74716,7 +73412,7 @@ index 296510a..1866589 100644
jiffies_to_clock_t(icsk->icsk_rto),
jiffies_to_clock_t(icsk->icsk_ack.ato),
(icsk->icsk_ack.quick << 1 ) | icsk->icsk_ack.pingpong,
-@@ -2144,7 +2174,13 @@ static void get_timewait6_sock(struct seq_file *seq,
+@@ -2128,7 +2158,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,
@@ -74732,7 +73428,7 @@ index 296510a..1866589 100644
static int tcp6_seq_show(struct seq_file *seq, void *v)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
-index 0d920c5..72a51d9 100644
+index 8c25419..47a51ae 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -50,6 +50,10 @@
@@ -74746,7 +73442,7 @@ index 0d920c5..72a51d9 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;
-@@ -548,7 +552,7 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
+@@ -549,7 +553,7 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
return 0;
drop:
@@ -74755,7 +73451,7 @@ index 0d920c5..72a51d9 100644
drop_no_sk_drops_inc:
UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
kfree_skb(skb);
-@@ -624,7 +628,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
+@@ -625,7 +629,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
continue;
}
drop:
@@ -74764,7 +73460,7 @@ index 0d920c5..72a51d9 100644
UDP6_INC_STATS_BH(sock_net(sk),
UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk));
UDP6_INC_STATS_BH(sock_net(sk),
-@@ -779,6 +783,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
+@@ -780,6 +784,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
UDP6_INC_STATS_BH(net, UDP_MIB_NOPORTS,
proto == IPPROTO_UDPLITE);
@@ -74774,7 +73470,7 @@ index 0d920c5..72a51d9 100644
icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0);
kfree_skb(skb);
-@@ -795,7 +802,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
+@@ -796,7 +803,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)) {
@@ -74783,7 +73479,7 @@ index 0d920c5..72a51d9 100644
bh_unlock_sock(sk);
sock_put(sk);
goto discard;
-@@ -1408,8 +1415,13 @@ static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket
+@@ -1407,8 +1414,13 @@ static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket
0, 0L, 0,
sock_i_uid(sp), 0,
sock_i_ino(sp),
@@ -74800,7 +73496,7 @@ index 0d920c5..72a51d9 100644
int udp6_seq_show(struct seq_file *seq, void *v)
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
-index b3cc8b3..baa02d0 100644
+index 253695d..9481ce8 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -282,16 +282,16 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
@@ -74926,10 +73622,10 @@ index b3cc8b3..baa02d0 100644
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 e2013e4..edfc1e3 100644
+index 274d150..656a144 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
-@@ -648,10 +648,10 @@ static int iucv_sock_autobind(struct sock *sk)
+@@ -787,10 +787,10 @@ static int iucv_sock_autobind(struct sock *sk)
write_lock_bh(&iucv_sk_list.lock);
@@ -74943,19 +73639,10 @@ index e2013e4..edfc1e3 100644
write_unlock_bh(&iucv_sk_list.lock);
diff --git a/net/key/af_key.c b/net/key/af_key.c
-index 8f92cf8..7f40167 100644
+index 1e733e9..3d73c9f 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
-@@ -2481,6 +2481,8 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
- struct xfrm_migrate m[XFRM_MAX_DEPTH];
- struct xfrm_kmaddress k;
-
-+ pax_track_stack();
-+
- if (!present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC - 1],
- ext_hdrs[SADB_EXT_ADDRESS_DST - 1]) ||
- !ext_hdrs[SADB_X_EXT_POLICY - 1]) {
-@@ -3016,10 +3018,10 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struc
+@@ -3016,10 +3016,10 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struc
static u32 get_acqseq(void)
{
u32 res;
@@ -74968,97 +73655,8 @@ index 8f92cf8..7f40167 100644
} while (!res);
return res;
}
-diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
-index d5d8d55..f50d18f 100644
---- a/net/lapb/lapb_iface.c
-+++ b/net/lapb/lapb_iface.c
-@@ -158,7 +158,7 @@ int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks
- goto out;
-
- lapb->dev = dev;
-- lapb->callbacks = *callbacks;
-+ lapb->callbacks = callbacks;
-
- __lapb_insert_cb(lapb);
-
-@@ -380,32 +380,32 @@ int lapb_data_received(struct net_device *dev, struct sk_buff *skb)
-
- void lapb_connect_confirmation(struct lapb_cb *lapb, int reason)
- {
-- if (lapb->callbacks.connect_confirmation)
-- lapb->callbacks.connect_confirmation(lapb->dev, reason);
-+ if (lapb->callbacks->connect_confirmation)
-+ lapb->callbacks->connect_confirmation(lapb->dev, reason);
- }
-
- void lapb_connect_indication(struct lapb_cb *lapb, int reason)
- {
-- if (lapb->callbacks.connect_indication)
-- lapb->callbacks.connect_indication(lapb->dev, reason);
-+ if (lapb->callbacks->connect_indication)
-+ lapb->callbacks->connect_indication(lapb->dev, reason);
- }
-
- void lapb_disconnect_confirmation(struct lapb_cb *lapb, int reason)
- {
-- if (lapb->callbacks.disconnect_confirmation)
-- lapb->callbacks.disconnect_confirmation(lapb->dev, reason);
-+ if (lapb->callbacks->disconnect_confirmation)
-+ lapb->callbacks->disconnect_confirmation(lapb->dev, reason);
- }
-
- void lapb_disconnect_indication(struct lapb_cb *lapb, int reason)
- {
-- if (lapb->callbacks.disconnect_indication)
-- lapb->callbacks.disconnect_indication(lapb->dev, reason);
-+ if (lapb->callbacks->disconnect_indication)
-+ lapb->callbacks->disconnect_indication(lapb->dev, reason);
- }
-
- int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *skb)
- {
-- if (lapb->callbacks.data_indication)
-- return lapb->callbacks.data_indication(lapb->dev, skb);
-+ if (lapb->callbacks->data_indication)
-+ return lapb->callbacks->data_indication(lapb->dev, skb);
-
- kfree_skb(skb);
- return NET_RX_SUCCESS; /* For now; must be != NET_RX_DROP */
-@@ -415,8 +415,8 @@ int lapb_data_transmit(struct lapb_cb *lapb, struct sk_buff *skb)
- {
- int used = 0;
-
-- if (lapb->callbacks.data_transmit) {
-- lapb->callbacks.data_transmit(lapb->dev, skb);
-+ if (lapb->callbacks->data_transmit) {
-+ lapb->callbacks->data_transmit(lapb->dev, skb);
- used = 1;
- }
-
-diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
-index a01d213..6a1f1ab 100644
---- a/net/mac80211/debugfs_sta.c
-+++ b/net/mac80211/debugfs_sta.c
-@@ -140,6 +140,8 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
- struct tid_ampdu_rx *tid_rx;
- struct tid_ampdu_tx *tid_tx;
-
-+ pax_track_stack();
-+
- rcu_read_lock();
-
- p += scnprintf(p, sizeof(buf) + buf - p, "next dialog_token: %#02x\n",
-@@ -240,6 +242,8 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
- struct sta_info *sta = file->private_data;
- struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap;
-
-+ pax_track_stack();
-+
- p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n",
- htc->ht_supported ? "" : "not ");
- if (htc->ht_supported) {
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
-index 3fdac77..9b3e137 100644
+index ea10a51..9a4f0cc 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -27,6 +27,7 @@
@@ -75069,7 +73667,7 @@ index 3fdac77..9b3e137 100644
#include "key.h"
#include "sta_info.h"
-@@ -723,7 +724,7 @@ struct ieee80211_local {
+@@ -761,7 +762,7 @@ struct ieee80211_local {
/* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
spinlock_t queue_stop_reason_lock;
@@ -75079,7 +73677,7 @@ index 3fdac77..9b3e137 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 895eec1..00beb81 100644
+index 30d7355..e260095 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -211,7 +211,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
@@ -75118,7 +73716,7 @@ index 895eec1..00beb81 100644
drv_stop(local);
err_del_bss:
sdata->bss = NULL;
-@@ -475,7 +475,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+@@ -472,7 +472,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
}
if (going_down)
@@ -75127,7 +73725,7 @@ index 895eec1..00beb81 100644
switch (sdata->vif.type) {
case NL80211_IFTYPE_AP_VLAN:
-@@ -534,7 +534,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+@@ -531,7 +531,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
ieee80211_recalc_ps(local, -1);
@@ -75137,7 +73735,7 @@ index 895eec1..00beb81 100644
napi_disable(&local->napi);
ieee80211_clear_tx_pending(local);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
-index 866f269..3cf46ed 100644
+index cae4435..76e3372 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -209,7 +209,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
@@ -75149,24 +73747,20 @@ index 866f269..3cf46ed 100644
ret = drv_config(local, changed);
/*
* Goal:
-diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
-index 1563250..d5d448e 100644
---- a/net/mac80211/mlme.c
-+++ b/net/mac80211/mlme.c
-@@ -1447,6 +1447,8 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
- bool have_higher_than_11mbit = false;
- u16 ap_ht_cap_flags;
-
-+ pax_track_stack();
-+
- /* AssocResp and ReassocResp have identical structure */
-
- aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
-index 730778a..be868e2 100644
+index 9ee7164..56c5061 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
-@@ -47,7 +47,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
+@@ -34,7 +34,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
+ struct ieee80211_sub_if_data *sdata;
+ struct sta_info *sta;
+
+- 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)
cancel_work_sync(&local->dynamic_ps_enable_work);
del_timer_sync(&local->dynamic_ps_timer);
@@ -75174,8 +73768,8 @@ index 730778a..be868e2 100644
+ local->wowlan = wowlan && local_read(&local->open_count);
if (local->wowlan) {
int err = drv_suspend(local, wowlan);
- if (err) {
-@@ -111,7 +111,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
+ if (err < 0) {
+@@ -129,7 +129,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
}
/* stop hardware - this must stop RX */
@@ -75185,10 +73779,10 @@ index 730778a..be868e2 100644
suspend:
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
-index 3d5a2cb..b17ad48 100644
+index 5a5a776..9600b11 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
-@@ -371,7 +371,7 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
+@@ -401,7 +401,7 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
ASSERT_RTNL();
@@ -75198,10 +73792,10 @@ index 3d5a2cb..b17ad48 100644
if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
diff --git a/net/mac80211/rc80211_pid_debugfs.c b/net/mac80211/rc80211_pid_debugfs.c
-index 4851e9e..d860e05 100644
+index c97a065..ff61928 100644
--- a/net/mac80211/rc80211_pid_debugfs.c
+++ b/net/mac80211/rc80211_pid_debugfs.c
-@@ -192,7 +192,7 @@ static ssize_t rate_control_pid_events_read(struct file *file, char __user *buf,
+@@ -193,7 +193,7 @@ static ssize_t rate_control_pid_events_read(struct file *file, char __user *buf,
spin_unlock_irqrestore(&events->lock, status);
@@ -75211,23 +73805,23 @@ index 4851e9e..d860e05 100644
return p;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
-index 2124db8..8718fc2 100644
+index d5230ec..c604b21 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
-@@ -1151,7 +1151,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
- #endif
+@@ -1000,7 +1000,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+ drv_set_coverage_class(local, hw->wiphy->coverage_class);
- /* restart hardware */
-- if (local->open_count) {
-+ if (local_read(&local->open_count)) {
- /*
- * Upon resume hardware can sometimes be goofy due to
- * various platform / driver / bus issues, so restarting
+ /* everything else happens only if HW was up & running */
+- if (!local->open_count)
++ if (!local_read(&local->open_count))
+ goto wake_up;
+
+ /*
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
-index 32bff6d..d0cf986 100644
+index d5597b7..ab6d39c 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
-@@ -781,6 +781,16 @@ config NETFILTER_XT_MATCH_ESP
+@@ -779,6 +779,16 @@ config NETFILTER_XT_MATCH_ESP
To compile it as a module, choose M here. If unsure, say N.
@@ -75257,7 +73851,7 @@ index 1a02853..5d8c22e 100644
obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o
obj-$(CONFIG_NETFILTER_XT_MATCH_HL) += xt_hl.o
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
-index 782db27..d1d9882 100644
+index 29fa5ba..8debc79 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)
@@ -75288,10 +73882,10 @@ index 782db27..d1d9882 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 24c28d2..800b45a 100644
+index 093cc32..9209ae1 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
-@@ -563,7 +563,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
+@@ -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);
/* do not touch skb anymore */
@@ -75300,7 +73894,7 @@ index 24c28d2..800b45a 100644
ip_vs_conn_put(cp);
return ret;
}
-@@ -1613,7 +1613,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
+@@ -1611,7 +1611,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
@@ -75310,10 +73904,10 @@ index 24c28d2..800b45a 100644
if ((ipvs->sync_state & IP_VS_STATE_MASTER) &&
cp->protocol == IPPROTO_SCTP) {
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
-index a178cb3..9b0e607 100644
+index e1a66cf..0910076 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
-@@ -782,7 +782,7 @@ __ip_vs_update_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest,
+@@ -788,7 +788,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);
}
@@ -75322,7 +73916,7 @@ index a178cb3..9b0e607 100644
/* bind the service */
if (!dest->svc) {
-@@ -2027,7 +2027,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
+@@ -2028,7 +2028,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),
@@ -75331,7 +73925,7 @@ index a178cb3..9b0e607 100644
atomic_read(&dest->weight),
atomic_read(&dest->activeconns),
atomic_read(&dest->inactconns));
-@@ -2038,7 +2038,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
+@@ -2039,7 +2039,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),
@@ -75340,16 +73934,7 @@ index a178cb3..9b0e607 100644
atomic_read(&dest->weight),
atomic_read(&dest->activeconns),
atomic_read(&dest->inactconns));
-@@ -2284,6 +2284,8 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
- struct ip_vs_dest_user *udest_compat;
- struct ip_vs_dest_user_kern udest;
-
-+ pax_track_stack();
-+
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
-
-@@ -2498,7 +2500,7 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get,
+@@ -2509,7 +2509,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;
@@ -75358,7 +73943,7 @@ index a178cb3..9b0e607 100644
entry.weight = atomic_read(&dest->weight);
entry.u_threshold = dest->u_threshold;
entry.l_threshold = dest->l_threshold;
-@@ -3026,7 +3028,7 @@ static int ip_vs_genl_fill_dest(struct sk_buff *skb, struct ip_vs_dest *dest)
+@@ -3042,7 +3042,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,
@@ -75368,10 +73953,10 @@ index a178cb3..9b0e607 100644
NLA_PUT_U32(skb, IPVS_DEST_ATTR_U_THRESH, dest->u_threshold);
NLA_PUT_U32(skb, IPVS_DEST_ATTR_L_THRESH, dest->l_threshold);
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
-index e292e5b..be111b3 100644
+index 2b6678c0..aaa41fc 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
-@@ -648,7 +648,7 @@ control:
+@@ -649,7 +649,7 @@ control:
* i.e only increment in_pkts for Templates.
*/
if (cp->flags & IP_VS_CONN_F_TEMPLATE) {
@@ -75380,7 +73965,7 @@ index e292e5b..be111b3 100644
if (pkts % sysctl_sync_period(ipvs) != 1)
return;
-@@ -794,7 +794,7 @@ static void ip_vs_proc_conn(struct net *net, struct ip_vs_conn_param *param,
+@@ -795,7 +795,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));
@@ -75390,7 +73975,7 @@ index e292e5b..be111b3 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 ee319a4..8a285ee 100644
+index aa2d720..d8aa111 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,
@@ -75412,7 +73997,7 @@ index ee319a4..8a285ee 100644
}
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
-index 2e7ccbb..3aa1aa7 100644
+index 66b2c54..c7884e3 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -70,7 +70,7 @@ struct nfulnl_instance {
@@ -75424,7 +74009,7 @@ index 2e7ccbb..3aa1aa7 100644
#define INSTANCE_BUCKETS 16
static struct hlist_head instance_table[INSTANCE_BUCKETS];
-@@ -505,7 +505,7 @@ __build_packet_message(struct nfulnl_instance *inst,
+@@ -502,7 +502,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,
@@ -75433,37 +74018,6 @@ index 2e7ccbb..3aa1aa7 100644
if (data_len) {
struct nlattr *nla;
-diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
-index fdd2faf..384c533 100644
---- a/net/netfilter/nfnetlink_queue.c
-+++ b/net/netfilter/nfnetlink_queue.c
-@@ -58,7 +58,7 @@ struct nfqnl_instance {
- */
- spinlock_t lock;
- unsigned int queue_total;
-- atomic_t id_sequence; /* 'sequence' of pkt ids */
-+ atomic_unchecked_t id_sequence; /* 'sequence' of pkt ids */
- struct list_head queue_list; /* packets in queue */
- };
-
-@@ -272,7 +272,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
- nfmsg->version = NFNETLINK_V0;
- nfmsg->res_id = htons(queue->queue_num);
-
-- entry->id = atomic_inc_return(&queue->id_sequence);
-+ entry->id = atomic_inc_return_unchecked(&queue->id_sequence);
- pmsg.packet_id = htonl(entry->id);
- pmsg.hw_protocol = entskb->protocol;
- pmsg.hook = entry->hook;
-@@ -870,7 +870,7 @@ static int seq_show(struct seq_file *s, void *v)
- inst->peer_pid, inst->queue_total,
- inst->copy_mode, inst->copy_range,
- inst->queue_dropped, inst->queue_user_dropped,
-- atomic_read(&inst->id_sequence), 1);
-+ atomic_read_unchecked(&inst->id_sequence), 1);
- }
-
- static const struct seq_operations nfqnl_seq_ops = {
diff --git a/net/netfilter/xt_gradm.c b/net/netfilter/xt_gradm.c
new file mode 100644
index 0000000..6905327
@@ -75522,11 +74076,11 @@ index 0000000..6905327
+MODULE_ALIAS("ipt_gradm");
+MODULE_ALIAS("ip6t_gradm");
diff --git a/net/netfilter/xt_statistic.c b/net/netfilter/xt_statistic.c
-index 42ecb71..8d687c0 100644
+index 4fe4fb4..87a89e5 100644
--- a/net/netfilter/xt_statistic.c
+++ b/net/netfilter/xt_statistic.c
-@@ -18,7 +18,7 @@
- #include <linux/netfilter/x_tables.h>
+@@ -19,7 +19,7 @@
+ #include <linux/module.h>
struct xt_statistic_priv {
- atomic_t count;
@@ -75534,7 +74088,7 @@ index 42ecb71..8d687c0 100644
} ____cacheline_aligned_in_smp;
MODULE_LICENSE("GPL");
-@@ -41,9 +41,9 @@ statistic_mt(const struct sk_buff *skb, struct xt_action_param *par)
+@@ -42,9 +42,9 @@ statistic_mt(const struct sk_buff *skb, struct xt_action_param *par)
break;
case XT_STATISTIC_MODE_NTH:
do {
@@ -75546,7 +74100,7 @@ index 42ecb71..8d687c0 100644
if (nval == 0)
ret = !ret;
break;
-@@ -63,7 +63,7 @@ static int statistic_mt_check(const struct xt_mtchk_param *par)
+@@ -64,7 +64,7 @@ static int statistic_mt_check(const struct xt_mtchk_param *par)
info->master = kzalloc(sizeof(*info->master), GFP_KERNEL);
if (info->master == NULL)
return -ENOMEM;
@@ -75556,7 +74110,7 @@ index 42ecb71..8d687c0 100644
return 0;
}
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
-index 6ef64ad..a3fc29d 100644
+index 1201b6d..bcff8c6 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -742,7 +742,7 @@ static void netlink_overrun(struct sock *sk)
@@ -75568,7 +74122,7 @@ index 6ef64ad..a3fc29d 100644
}
static struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid)
-@@ -1994,7 +1994,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
+@@ -1999,7 +1999,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
sk_wmem_alloc_get(s),
nlk->cb,
atomic_read(&s->sk_refcnt),
@@ -75598,10 +74152,10 @@ index 732152f..60bb09e 100644
*uaddr_len = sizeof(struct sockaddr_ax25);
}
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
-index fafb968..effffa1 100644
+index d9d4970..d5a6a68 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
-@@ -647,7 +647,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
+@@ -1675,7 +1675,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
spin_lock(&sk->sk_receive_queue.lock);
po->stats.tp_packets++;
@@ -75610,7 +74164,7 @@ index fafb968..effffa1 100644
__skb_queue_tail(&sk->sk_receive_queue, skb);
spin_unlock(&sk->sk_receive_queue.lock);
sk->sk_data_ready(sk, skb->len);
-@@ -656,7 +656,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
+@@ -1684,7 +1684,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++;
@@ -75619,7 +74173,7 @@ index fafb968..effffa1 100644
spin_unlock(&sk->sk_receive_queue.lock);
drop_n_restore:
-@@ -2171,7 +2171,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
+@@ -3266,7 +3266,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
case PACKET_HDRLEN:
if (len > sizeof(int))
len = sizeof(int);
@@ -75628,7 +74182,7 @@ index fafb968..effffa1 100644
return -EFAULT;
switch (val) {
case TPACKET_V1:
-@@ -2209,7 +2209,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
+@@ -3316,7 +3316,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
if (put_user(len, optlen))
return -EFAULT;
@@ -75638,7 +74192,7 @@ index fafb968..effffa1 100644
return 0;
}
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
-index c6fffd9..a7ffa0c 100644
+index bf10ea8..aeb4c3e 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)
@@ -75660,10 +74214,10 @@ index c6fffd9..a7ffa0c 100644
err = proto_register(pp->prot, 1);
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
-index f17fd84..edffce8 100644
+index 2ba6e9f..409573f 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
-@@ -387,7 +387,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -388,7 +388,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
case PNS_PEP_CTRL_REQ:
if (skb_queue_len(&pn->ctrlreq_queue) >= PNPIPE_CTRLREQ_MAX) {
@@ -75672,7 +74226,7 @@ index f17fd84..edffce8 100644
break;
}
__skb_pull(skb, 4);
-@@ -408,7 +408,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -409,7 +409,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
}
if (pn->rx_credits == 0) {
@@ -75681,7 +74235,7 @@ index f17fd84..edffce8 100644
err = -ENOBUFS;
break;
}
-@@ -556,7 +556,7 @@ static int pipe_handler_do_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -557,7 +557,7 @@ static int pipe_handler_do_rcv(struct sock *sk, struct sk_buff *skb)
}
if (pn->rx_credits == 0) {
@@ -75691,10 +74245,10 @@ index f17fd84..edffce8 100644
break;
}
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
-index ab07711..9d4ac5d 100644
+index 3f8d0b1..74635e0 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
-@@ -612,8 +612,13 @@ static int pn_sock_seq_show(struct seq_file *seq, void *v)
+@@ -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),
@@ -75711,10 +74265,10 @@ index ab07711..9d4ac5d 100644
seq_printf(seq, "%*s\n", 127 - len, "");
return 0;
diff --git a/net/rds/cong.c b/net/rds/cong.c
-index 6daaa49..fbf6af5 100644
+index e5b65ac..f3b6fb7 100644
--- a/net/rds/cong.c
+++ b/net/rds/cong.c
-@@ -77,7 +77,7 @@
+@@ -78,7 +78,7 @@
* finds that the saved generation number is smaller than the global generation
* number, it wakes up the process.
*/
@@ -75723,7 +74277,7 @@ index 6daaa49..fbf6af5 100644
/*
* Congestion monitoring
-@@ -232,7 +232,7 @@ void rds_cong_map_updated(struct rds_cong_map *map, uint64_t portmask)
+@@ -233,7 +233,7 @@ void rds_cong_map_updated(struct rds_cong_map *map, uint64_t portmask)
rdsdebug("waking map %p for %pI4\n",
map, &map->m_addr);
rds_stats_inc(s_cong_update_received);
@@ -75732,7 +74286,7 @@ index 6daaa49..fbf6af5 100644
if (waitqueue_active(&map->m_waitq))
wake_up(&map->m_waitq);
if (waitqueue_active(&rds_poll_waitq))
-@@ -258,7 +258,7 @@ EXPORT_SYMBOL_GPL(rds_cong_map_updated);
+@@ -259,7 +259,7 @@ EXPORT_SYMBOL_GPL(rds_cong_map_updated);
int rds_cong_updated_since(unsigned long *recent)
{
@@ -75742,10 +74296,10 @@ index 6daaa49..fbf6af5 100644
if (likely(*recent == gen))
return 0;
diff --git a/net/rds/ib.h b/net/rds/ib.h
-index 4297d92..fec3cd4 100644
+index edfaaaf..8c89879 100644
--- a/net/rds/ib.h
+++ b/net/rds/ib.h
-@@ -127,7 +127,7 @@ struct rds_ib_connection {
+@@ -128,7 +128,7 @@ struct rds_ib_connection {
/* sending acks */
unsigned long i_ack_flags;
#ifdef KERNEL_HAS_ATOMIC64
@@ -75755,10 +74309,10 @@ index 4297d92..fec3cd4 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 fd453dd..6c9f095 100644
+index 51c8689..36c555f 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
-@@ -720,7 +720,7 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
+@@ -718,7 +718,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
@@ -75790,10 +74344,10 @@ index e29e0ca..fa3a6a3 100644
#endif
diff --git a/net/rds/iw.h b/net/rds/iw.h
-index 9015192..39f60c0 100644
+index 04ce3b1..48119a6 100644
--- a/net/rds/iw.h
+++ b/net/rds/iw.h
-@@ -133,7 +133,7 @@ struct rds_iw_connection {
+@@ -134,7 +134,7 @@ struct rds_iw_connection {
/* sending acks */
unsigned long i_ack_flags;
#ifdef KERNEL_HAS_ATOMIC64
@@ -75803,10 +74357,10 @@ index 9015192..39f60c0 100644
spinlock_t i_ack_lock; /* protect i_ack_next */
u64 i_ack_next; /* next ACK to send */
diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c
-index c12db66..3c24d8a 100644
+index 9556d28..f046d0e 100644
--- a/net/rds/iw_cm.c
+++ b/net/rds/iw_cm.c
-@@ -664,7 +664,7 @@ void rds_iw_conn_shutdown(struct rds_connection *conn)
+@@ -663,7 +663,7 @@ void rds_iw_conn_shutdown(struct rds_connection *conn)
/* Clear the ACK state */
clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
#ifdef KERNEL_HAS_ATOMIC64
@@ -75815,19 +74369,6 @@ index c12db66..3c24d8a 100644
#else
ic->i_ack_next = 0;
#endif
-diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c
-index 6deaa77..df475d9 100644
---- a/net/rds/iw_rdma.c
-+++ b/net/rds/iw_rdma.c
-@@ -182,6 +182,8 @@ int rds_iw_update_cm_id(struct rds_iw_device *rds_iwdev, struct rdma_cm_id *cm_i
- struct rdma_cm_id *pcm_id;
- int rc;
-
-+ pax_track_stack();
-+
- src_addr = (struct sockaddr_in *)&cm_id->route.addr.src_addr;
- dst_addr = (struct sockaddr_in *)&cm_id->route.addr.dst_addr;
-
diff --git a/net/rds/iw_recv.c b/net/rds/iw_recv.c
index 5e57347..3916042 100644
--- a/net/rds/iw_recv.c
@@ -75851,10 +74392,10 @@ index 5e57347..3916042 100644
#endif
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
-index 8e0a320..ee8e38f 100644
+index edac9ef..16bcb98 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
-@@ -58,7 +58,7 @@ void rds_tcp_nonagle(struct socket *sock)
+@@ -59,7 +59,7 @@ void rds_tcp_nonagle(struct socket *sock)
int val = 1;
set_fs(KERNEL_DS);
@@ -75890,7 +74431,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 f99cfce..3682692 100644
+index f99cfce..cc529dd 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)
@@ -75929,16 +74470,7 @@ index f99cfce..3682692 100644
_proto("Rx ACK %%%u { m=%hu f=#%u p=#%u s=%%%u r=%s n=%u }",
latest,
-@@ -842,6 +842,8 @@ void rxrpc_process_call(struct work_struct *work)
- u32 abort_code = RX_PROTOCOL_ERROR;
- u8 *acks = NULL;
-
-+ pax_track_stack();
-+
- //printk("\n--------------------\n");
- _enter("{%d,%s,%lx} [%lu]",
- call->debug_id, rxrpc_call_states[call->state], call->events,
-@@ -1161,7 +1163,7 @@ void rxrpc_process_call(struct work_struct *work)
+@@ -1161,7 +1161,7 @@ void rxrpc_process_call(struct work_struct *work)
goto maybe_reschedule;
send_ACK_with_skew:
@@ -75947,7 +74479,7 @@ index f99cfce..3682692 100644
ntohl(ack.serial));
send_ACK:
mtu = call->conn->trans->peer->if_mtu;
-@@ -1173,7 +1175,7 @@ send_ACK:
+@@ -1173,7 +1173,7 @@ send_ACK:
ackinfo.rxMTU = htonl(5692);
ackinfo.jumbo_max = htonl(4);
@@ -75956,7 +74488,7 @@ index f99cfce..3682692 100644
_proto("Tx ACK %%%u { m=%hu f=#%u p=#%u s=%%%u r=%s n=%u }",
ntohl(hdr.serial),
ntohs(ack.maxSkew),
-@@ -1191,7 +1193,7 @@ send_ACK:
+@@ -1191,7 +1191,7 @@ send_ACK:
send_message:
_debug("send message");
@@ -76067,10 +74599,10 @@ index 87f7135..74d3703 100644
}
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
-index 5f22e26..e5bd20f 100644
+index 338d793..47391d0 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
-@@ -681,9 +681,9 @@ static int rxrpc_send_data(struct kiocb *iocb,
+@@ -682,9 +682,9 @@ static int rxrpc_send_data(struct kiocb *iocb,
sp->hdr.cid = call->cid;
sp->hdr.callNumber = call->call_id;
sp->hdr.seq =
@@ -76124,28 +74656,10 @@ 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..5000b71 100644
+index 7635107..4670276 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
-@@ -211,6 +211,8 @@ static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call,
- u16 check;
- int nsg;
-
-+ pax_track_stack();
-+
- sp = rxrpc_skb(skb);
-
- _enter("");
-@@ -338,6 +340,8 @@ static int rxkad_verify_packet_auth(const struct rxrpc_call *call,
- u16 check;
- int nsg;
-
-+ pax_track_stack();
-+
- _enter("");
-
- sp = rxrpc_skb(skb);
-@@ -610,7 +614,7 @@ static int rxkad_issue_challenge(struct rxrpc_connection *conn)
+@@ -610,7 +610,7 @@ static int rxkad_issue_challenge(struct rxrpc_connection *conn)
len = iov[0].iov_len + iov[1].iov_len;
@@ -76154,7 +74668,7 @@ index 7635107..5000b71 100644
_proto("Tx CHALLENGE %%%u", ntohl(hdr.serial));
ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 2, len);
-@@ -660,7 +664,7 @@ static int rxkad_send_response(struct rxrpc_connection *conn,
+@@ -660,7 +660,7 @@ static int rxkad_send_response(struct rxrpc_connection *conn,
len = iov[0].iov_len + iov[1].iov_len + iov[2].iov_len;
@@ -76164,10 +74678,10 @@ index 7635107..5000b71 100644
ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 3, len);
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
-index 05a6ce2..c8bf836 100644
+index 1e2eee8..ce3967e 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
-@@ -318,7 +318,8 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
+@@ -319,7 +319,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 ",
@@ -76178,10 +74692,10 @@ index 05a6ce2..c8bf836 100644
assoc->assoc_id,
assoc->sndbuf_used,
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
-index d3ccf79..e7f4687 100644
+index 54a7cd2..944edae 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
-@@ -4452,7 +4452,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
+@@ -4574,7 +4574,7 @@ 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;
@@ -76191,7 +74705,7 @@ index d3ccf79..e7f4687 100644
to += addrlen;
cnt++;
diff --git a/net/socket.c b/net/socket.c
-index 1ad42d3..df6cb46 100644
+index 2877647..08e2fde 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -88,6 +88,7 @@
@@ -76344,16 +74858,7 @@ index 1ad42d3..df6cb46 100644
err =
security_socket_connect(sock, (struct sockaddr *)&address, addrlen);
if (err)
-@@ -1890,6 +1950,8 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
- unsigned char *ctl_buf = ctl;
- int err, ctl_len, iov_size, total_len;
-
-+ pax_track_stack();
-+
- err = -EFAULT;
- if (MSG_CMSG_COMPAT & flags) {
- if (get_compat_msghdr(msg_sys, msg_compat))
-@@ -1950,7 +2012,7 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
+@@ -1950,7 +2010,7 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
* checking falls down on this.
*/
if (copy_from_user(ctl_buf,
@@ -76362,7 +74867,7 @@ index 1ad42d3..df6cb46 100644
ctl_len))
goto out_freectl;
msg_sys->msg_control = ctl_buf;
-@@ -2120,7 +2182,7 @@ static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
+@@ -2120,7 +2180,7 @@ static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
* kernel msghdr to use the kernel address space)
*/
@@ -76371,7 +74876,7 @@ index 1ad42d3..df6cb46 100644
uaddr_len = COMPAT_NAMELEN(msg);
if (MSG_CMSG_COMPAT & flags) {
err = verify_compat_iovec(msg_sys, iov,
-@@ -2748,7 +2810,7 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
+@@ -2748,7 +2808,7 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
}
ifr = compat_alloc_user_space(buf_size);
@@ -76380,7 +74885,7 @@ index 1ad42d3..df6cb46 100644
if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
return -EFAULT;
-@@ -2772,12 +2834,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
+@@ -2772,12 +2832,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,
@@ -76397,7 +74902,7 @@ index 1ad42d3..df6cb46 100644
copy_in_user(&rxnfc->rule_cnt, &compat_rxnfc->rule_cnt,
sizeof(rxnfc->rule_cnt)))
return -EFAULT;
-@@ -2789,12 +2851,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
+@@ -2789,12 +2849,12 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
if (convert_out) {
if (copy_in_user(compat_rxnfc, rxnfc,
@@ -76414,7 +74919,7 @@ index 1ad42d3..df6cb46 100644
copy_in_user(&compat_rxnfc->rule_cnt, &rxnfc->rule_cnt,
sizeof(rxnfc->rule_cnt)))
return -EFAULT;
-@@ -2864,7 +2926,7 @@ static int bond_ioctl(struct net *net, unsigned int cmd,
+@@ -2864,7 +2924,7 @@ static int bond_ioctl(struct net *net, unsigned int cmd,
old_fs = get_fs();
set_fs(KERNEL_DS);
err = dev_ioctl(net, cmd,
@@ -76423,7 +74928,7 @@ index 1ad42d3..df6cb46 100644
set_fs(old_fs);
return err;
-@@ -2973,7 +3035,7 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd,
+@@ -2973,7 +3033,7 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd,
old_fs = get_fs();
set_fs(KERNEL_DS);
@@ -76432,7 +74937,7 @@ index 1ad42d3..df6cb46 100644
set_fs(old_fs);
if (cmd == SIOCGIFMAP && !err) {
-@@ -3078,7 +3140,7 @@ static int routing_ioctl(struct net *net, struct socket *sock,
+@@ -3078,7 +3138,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);
@@ -76441,7 +74946,7 @@ index 1ad42d3..df6cb46 100644
devname[15] = 0;
} else
r4.rt_dev = NULL;
-@@ -3318,8 +3380,8 @@ int kernel_getsockopt(struct socket *sock, int level, int optname,
+@@ -3318,8 +3378,8 @@ int kernel_getsockopt(struct socket *sock, int level, int optname,
int __user *uoptlen;
int err;
@@ -76452,7 +74957,7 @@ index 1ad42d3..df6cb46 100644
set_fs(KERNEL_DS);
if (level == SOL_SOCKET)
-@@ -3339,7 +3401,7 @@ int kernel_setsockopt(struct socket *sock, int level, int optname,
+@@ -3339,7 +3399,7 @@ int kernel_setsockopt(struct socket *sock, int level, int optname,
char __user *uoptval;
int err;
@@ -76462,10 +74967,10 @@ index 1ad42d3..df6cb46 100644
set_fs(KERNEL_DS);
if (level == SOL_SOCKET)
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
-index 4814e24..be718fe 100644
+index 00a1a2a..6a0138a 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
-@@ -234,9 +234,9 @@ static int rpc_wait_bit_killable(void *word)
+@@ -238,9 +238,9 @@ static int rpc_wait_bit_killable(void *word)
#ifdef RPC_DEBUG
static void rpc_task_set_debuginfo(struct rpc_task *task)
{
@@ -76478,10 +74983,10 @@ index 4814e24..be718fe 100644
#else
static inline void rpc_task_set_debuginfo(struct rpc_task *task)
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
-index af04f77..964044e 100644
+index 71bed1c..5dff36d 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
-@@ -392,7 +392,7 @@ static int svc_partial_recvfrom(struct svc_rqst *rqstp,
+@@ -396,7 +396,7 @@ static int svc_partial_recvfrom(struct svc_rqst *rqstp,
int buflen, unsigned int base)
{
size_t save_iovlen;
@@ -76646,10 +75151,10 @@ index 249a835..fb2794b 100644
goto err;
return 0;
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
-index c3c232a..298b1b8 100644
+index ba1296d..0fec1a5 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
-@@ -298,7 +298,7 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
+@@ -300,7 +300,7 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
return;
ib_req_notify_cq(xprt->sc_rq_cq, IB_CQ_NEXT_COMP);
@@ -76658,7 +75163,7 @@ index c3c232a..298b1b8 100644
while ((ret = ib_poll_cq(xprt->sc_rq_cq, 1, &wc)) > 0) {
ctxt = (struct svc_rdma_op_ctxt *)(unsigned long)wc.wr_id;
-@@ -320,7 +320,7 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
+@@ -322,7 +322,7 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
}
if (ctxt)
@@ -76667,7 +75172,7 @@ index c3c232a..298b1b8 100644
set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags);
/*
-@@ -392,7 +392,7 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
+@@ -394,7 +394,7 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
return;
ib_req_notify_cq(xprt->sc_sq_cq, IB_CQ_NEXT_COMP);
@@ -76676,7 +75181,7 @@ index c3c232a..298b1b8 100644
while ((ret = ib_poll_cq(cq, 1, &wc)) > 0) {
if (wc.status != IB_WC_SUCCESS)
/* Close the transport */
-@@ -410,7 +410,7 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
+@@ -412,7 +412,7 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
}
if (ctxt)
@@ -76685,7 +75190,7 @@ index c3c232a..298b1b8 100644
}
static void sq_comp_handler(struct ib_cq *cq, void *cq_context)
-@@ -1272,7 +1272,7 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr)
+@@ -1274,7 +1274,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);
@@ -76695,10 +75200,10 @@ index c3c232a..298b1b8 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 ca84212..3aa338f 100644
+index e758139..d29ea47 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
-@@ -46,7 +46,7 @@ static int net_ctl_permissions(struct ctl_table_root *root,
+@@ -47,7 +47,7 @@ static int net_ctl_permissions(struct ctl_table_root *root,
struct ctl_table *table)
{
/* Allow network administrator to have same access as root. */
@@ -76708,10 +75213,10 @@ index ca84212..3aa338f 100644
return (mode << 6) | (mode << 3) | mode;
}
diff --git a/net/tipc/link.c b/net/tipc/link.c
-index 5ed4b4f..40edcb7 100644
+index ae98a72..7bb6056 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
-@@ -1170,7 +1170,7 @@ static int link_send_sections_long(struct tipc_port *sender,
+@@ -1203,7 +1203,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;
@@ -76720,7 +75225,7 @@ index 5ed4b4f..40edcb7 100644
int curr_sect;
u32 fragm_no;
-@@ -1214,7 +1214,7 @@ again:
+@@ -1247,7 +1247,7 @@ again:
if (!sect_rest) {
sect_rest = msg_sect[++curr_sect].iov_len;
@@ -76729,7 +75234,7 @@ index 5ed4b4f..40edcb7 100644
}
if (sect_rest < fragm_rest)
-@@ -1233,7 +1233,7 @@ error:
+@@ -1266,7 +1266,7 @@ error:
}
} else
skb_copy_to_linear_data_offset(buf, fragm_crs,
@@ -76739,10 +75244,10 @@ index 5ed4b4f..40edcb7 100644
sect_rest -= sz;
fragm_crs += sz;
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
-index 03e57bf..62331b6 100644
+index 83d5096..dcba497 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
-@@ -101,7 +101,7 @@ int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect,
+@@ -99,7 +99,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,
@@ -76752,7 +75257,7 @@ index 03e57bf..62331b6 100644
pos += msg_sect[cnt].iov_len;
}
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
-index 6cf7268..7a488ce 100644
+index 1983717..4d6102c 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -101,7 +101,7 @@ static void subscr_send_event(struct subscription *sub,
@@ -76765,7 +75270,7 @@ index 6cf7268..7a488ce 100644
sub->evt.event = htohl(event, sub->swap);
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
-index 0722a25..ded9e9b 100644
+index b595a3d..b1cd354 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -767,6 +767,12 @@ static struct sock *unix_find_other(struct net *net,
@@ -76795,27 +75300,27 @@ index 0722a25..ded9e9b 100644
if (dentry)
touch_atime(unix_sk(u)->mnt, dentry);
} else
-@@ -872,11 +885,18 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
- err = security_path_mknod(&nd.path, dentry, mode, 0);
+@@ -869,11 +882,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;
-+ if (!gr_acl_handle_mknod(dentry, nd.path.dentry, nd.path.mnt, mode)) {
++ if (!gr_acl_handle_mknod(dentry, path.dentry, path.mnt, mode)) {
+ err = -EACCES;
+ goto out_mknod_drop_write;
+ }
- err = vfs_mknod(nd.path.dentry->d_inode, dentry, mode, 0);
+ err = vfs_mknod(path.dentry->d_inode, dentry, mode, 0);
out_mknod_drop_write:
- mnt_drop_write(nd.path.mnt);
+ mnt_drop_write(path.mnt);
if (err)
goto out_mknod_dput;
+
-+ gr_handle_create(dentry, nd.path.mnt);
++ gr_handle_create(dentry, path.mnt);
+
- mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
- dput(nd.path.dentry);
- nd.path.dentry = dentry;
+ 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 a570ff9..d209909 100644
+index b9ec306..b4a563e 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -27,7 +27,7 @@ struct cfg80211_registered_device {
@@ -76828,10 +75333,10 @@ index a570ff9..d209909 100644
struct work_struct rfkill_sync;
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
-index fdbc23c..212d53e 100644
+index 0af7f54..c916d2f 100644
--- a/net/wireless/wext-core.c
+++ b/net/wireless/wext-core.c
-@@ -746,8 +746,7 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
+@@ -747,8 +747,7 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
*/
/* Support for very large requests */
@@ -76841,7 +75346,7 @@ index fdbc23c..212d53e 100644
/* Allow userspace to GET more than max so
* we can support any size GET requests.
* There is still a limit : -ENOMEM.
-@@ -784,22 +783,6 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
+@@ -785,22 +784,6 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
}
}
@@ -76865,7 +75370,7 @@ index fdbc23c..212d53e 100644
iwp->length += essid_compat;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
-index 5ce74a3..670e6b2 100644
+index 9049a5c..cfa6f5c 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)
@@ -76886,7 +75391,7 @@ index 5ce74a3..670e6b2 100644
if (delpol)
__xfrm_policy_unlink(delpol, dir);
policy->index = delpol ? delpol->index : xfrm_gen_index(net, dir);
-@@ -1528,7 +1528,7 @@ free_dst:
+@@ -1530,7 +1530,7 @@ free_dst:
goto out;
}
@@ -76895,7 +75400,7 @@ index 5ce74a3..670e6b2 100644
xfrm_dst_alloc_copy(void **target, const void *src, int size)
{
if (!*target) {
-@@ -1540,7 +1540,7 @@ xfrm_dst_alloc_copy(void **target, const void *src, int size)
+@@ -1542,7 +1542,7 @@ xfrm_dst_alloc_copy(void **target, const void *src, int size)
return 0;
}
@@ -76904,7 +75409,7 @@ index 5ce74a3..670e6b2 100644
xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel)
{
#ifdef CONFIG_XFRM_SUB_POLICY
-@@ -1552,7 +1552,7 @@ xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel)
+@@ -1554,7 +1554,7 @@ xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel)
#endif
}
@@ -76913,7 +75418,7 @@ index 5ce74a3..670e6b2 100644
xfrm_dst_update_origin(struct dst_entry *dst, const struct flowi *fl)
{
#ifdef CONFIG_XFRM_SUB_POLICY
-@@ -1646,7 +1646,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
+@@ -1648,7 +1648,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);
@@ -76922,7 +75427,7 @@ index 5ce74a3..670e6b2 100644
return xdst;
}
-@@ -2333,7 +2333,7 @@ static int xfrm_bundle_ok(struct xfrm_dst *first)
+@@ -2345,7 +2345,7 @@ static int xfrm_bundle_ok(struct xfrm_dst *first)
if (xdst->xfrm_genid != dst->xfrm->genid)
return 0;
if (xdst->num_pols > 0 &&
@@ -76931,7 +75436,7 @@ index 5ce74a3..670e6b2 100644
return 0;
mtu = dst_mtu(dst->child);
-@@ -2861,7 +2861,7 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol,
+@@ -2882,7 +2882,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 */
@@ -76940,30 +75445,8 @@ index 5ce74a3..670e6b2 100644
}
}
-diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
-index c658cb3..96c6847 100644
---- a/net/xfrm/xfrm_user.c
-+++ b/net/xfrm/xfrm_user.c
-@@ -1394,6 +1394,8 @@ static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb)
- struct xfrm_user_tmpl vec[XFRM_MAX_DEPTH];
- int i;
-
-+ pax_track_stack();
-+
- if (xp->xfrm_nr == 0)
- return 0;
-
-@@ -2062,6 +2064,8 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
- int err;
- int n = 0;
-
-+ pax_track_stack();
-+
- if (attrs[XFRMA_MIGRATE] == NULL)
- return -EINVAL;
-
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
-index a0fd502..a8e6e83 100644
+index d2b366c..51ff91e 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -109,7 +109,7 @@ endif
@@ -77010,7 +75493,7 @@ index 1ac414f..a1c1451 100644
host-cobjs := $(filter-out %.so,$(host-cobjs))
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
-index 291228e..6c55203 100644
+index cb1f50c..cef2a7c 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)
@@ -77047,7 +75530,7 @@ index 291228e..6c55203 100644
const char *p, *q;
for (; m < end; m++) {
-@@ -405,7 +405,7 @@ static void print_deps(void)
+@@ -406,7 +406,7 @@ static void print_deps(void)
static void traps(void)
{
static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
@@ -77058,14 +75541,14 @@ index 291228e..6c55203 100644
fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
diff --git a/scripts/gcc-plugin.sh b/scripts/gcc-plugin.sh
new file mode 100644
-index 0000000..a0ef3e4
+index 0000000..8729101
--- /dev/null
+++ b/scripts/gcc-plugin.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
-+echo "#include \"gcc-plugin.h\"\n#include \"rtl.h\"" | $1 -x c -shared - -o /dev/null -I`$2 -print-file-name=plugin`/include >/dev/null 2>&1 && echo "y"
++echo -e "#include \"gcc-plugin.h\"\n#include \"tree.h\"\n#include \"tm.h\"\n#include \"rtl.h\"" | $1 -x c -shared - -o /dev/null -I`$2 -print-file-name=plugin`/include >/dev/null 2>&1 && echo "y"
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
-index e26e2fb..f84937b 100644
+index f936d1f..a66d95f 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -72,7 +72,7 @@ static void device_id_check(const char *modname, const char *device_id,
@@ -77122,7 +75605,7 @@ index e26e2fb..f84937b 100644
buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"pnp:d%s*\");\n", id);
-@@ -786,7 +786,7 @@ static void dmi_ascii_filter(char *d, const char *s)
+@@ -807,7 +807,7 @@ static void dmi_ascii_filter(char *d, const char *s)
static int do_dmi_entry(const char *filename, struct dmi_system_id *id,
char *alias)
{
@@ -77132,10 +75615,10 @@ index e26e2fb..f84937b 100644
sprintf(alias, "dmi*");
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
-index 413c536..db536ed 100644
+index 2bd594e..d43245e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
-@@ -892,6 +892,7 @@ enum mismatch {
+@@ -919,6 +919,7 @@ enum mismatch {
ANY_INIT_TO_ANY_EXIT,
ANY_EXIT_TO_ANY_INIT,
EXPORT_TO_INIT_EXIT,
@@ -77143,7 +75626,7 @@ index 413c536..db536ed 100644
};
struct sectioncheck {
-@@ -1000,6 +1001,12 @@ const struct sectioncheck sectioncheck[] = {
+@@ -1027,6 +1028,12 @@ const struct sectioncheck sectioncheck[] = {
.tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
.mismatch = EXPORT_TO_INIT_EXIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
@@ -77156,7 +75639,7 @@ index 413c536..db536ed 100644
}
};
-@@ -1122,10 +1129,10 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr,
+@@ -1149,10 +1156,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;
@@ -77169,7 +75652,7 @@ index 413c536..db536ed 100644
if (d < 0)
d = addr - sym->st_value;
if (d < distance) {
-@@ -1404,6 +1411,14 @@ static void report_sec_mismatch(const char *modname,
+@@ -1431,6 +1438,14 @@ static void report_sec_mismatch(const char *modname,
tosym, prl_to, prl_to, tosym);
free(prl_to);
break;
@@ -77184,7 +75667,7 @@ index 413c536..db536ed 100644
}
fprintf(stderr, "\n");
}
-@@ -1629,7 +1644,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
+@@ -1656,7 +1671,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)
{
@@ -77193,7 +75676,7 @@ index 413c536..db536ed 100644
Elf_Shdr *sechdrs = elf->sechdrs;
/* Walk through all sections */
-@@ -1727,7 +1742,7 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf,
+@@ -1754,7 +1769,7 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf,
va_end(ap);
}
@@ -77202,7 +75685,7 @@ index 413c536..db536ed 100644
{
if (buf->size - buf->pos < len) {
buf->size += len + SZ;
-@@ -1939,7 +1954,7 @@ static void write_if_changed(struct buffer *b, const char *fname)
+@@ -1972,7 +1987,7 @@ static void write_if_changed(struct buffer *b, const char *fname)
if (fstat(fileno(file), &st) < 0)
goto close_write;
@@ -77278,10 +75761,10 @@ index 5c11312..72742b5 100644
write_hex_cnt = 0;
for (i = 0; i < logo_clutsize; i++) {
diff --git a/security/Kconfig b/security/Kconfig
-index e0f08b5..9ace91e 100644
+index 51bd5a0..8465ae6 100644
--- a/security/Kconfig
+++ b/security/Kconfig
-@@ -4,6 +4,558 @@
+@@ -4,6 +4,626 @@
menu "Security options"
@@ -77321,12 +75804,11 @@ index e0f08b5..9ace91e 100644
+
+config PAX_SOFTMODE
+ bool 'Support soft mode'
-+ select PAX_PT_PAX_FLAGS
+ help
+ Enabling this option will allow you to run PaX in soft mode, that
+ is, PaX features will not be enforced by default, only on executables
-+ marked explicitly. You must also enable PT_PAX_FLAGS support as it
-+ is the only way to mark executables for soft mode use.
++ marked explicitly. You must also enable PT_PAX_FLAGS or XATTR_PAX_FLAGS
++ support as they are the only way to mark executables for soft mode use.
+
+ Soft mode can be activated by using the "pax_softmode=1" kernel command
+ line option on boot. Furthermore you can control various PaX features
@@ -77341,10 +75823,15 @@ index e0f08b5..9ace91e 100644
+ an otherwise reserved part of the ELF header. This marking has
+ numerous drawbacks (no support for soft-mode, toolchain does not
+ know about the non-standard use of the ELF header) therefore it
-+ has been deprecated in favour of PT_PAX_FLAGS support.
++ has been deprecated in favour of PT_PAX_FLAGS and XATTR_PAX_FLAGS
++ support.
++
++ If you have applications not marked by the PT_PAX_FLAGS ELF program
++ header and you cannot use XATTR_PAX_FLAGS then you MUST enable this
++ option otherwise they will not get any protection.
+
-+ Note that if you enable PT_PAX_FLAGS marking support as well,
-+ the PT_PAX_FLAG marks will override the legacy EI_PAX marks.
++ Note that if you enable PT_PAX_FLAGS or XATTR_PAX_FLAGS marking
++ support as well, they will override the legacy EI_PAX marks.
+
+config PAX_PT_PAX_FLAGS
+ bool 'Use ELF program header marking'
@@ -77357,12 +75844,49 @@ index e0f08b5..9ace91e 100644
+ integrated into the toolchain (the binutils patch is available
+ from http://pax.grsecurity.net).
+
-+ If your toolchain does not support PT_PAX_FLAGS markings,
-+ you can create one in most cases with 'paxctl -C'.
++ If you have applications not marked by the PT_PAX_FLAGS ELF program
++ header then you MUST enable either XATTR_PAX_FLAGS or EI_PAX marking
++ support otherwise they will not get any protection.
++
++ If you enable both PT_PAX_FLAGS and XATTR_PAX_FLAGS support then you
++ must make sure that the marks are the same if a binary has both marks.
+
+ Note that if you enable the legacy EI_PAX marking support as well,
+ the EI_PAX marks will be overridden by the PT_PAX_FLAGS marks.
+
++config PAX_XATTR_PAX_FLAGS
++ bool 'Use filesystem extended attributes marking'
++ depends on EXPERT
++ select CIFS_XATTR if CIFS
++ select EXT2_FS_XATTR if EXT2_FS
++ select EXT3_FS_XATTR if EXT3_FS
++ select EXT4_FS_XATTR if EXT4_FS
++ select JFFS2_FS_XATTR if JFFS2_FS
++ select REISERFS_FS_XATTR if REISERFS_FS
++ select SQUASHFS_XATTR if SQUASHFS
++ select TMPFS_XATTR if TMPFS
++ select UBIFS_FS_XATTR if UBIFS_FS
++ help
++ Enabling this option will allow you to control PaX features on
++ a per executable basis via the 'setfattr' utility. The control
++ flags will be read from the user.pax.flags extended attribute of
++ the file. This marking has the benefit of supporting binary-only
++ applications that self-check themselves (e.g., skype) and would
++ not tolerate chpax/paxctl changes. The main drawback is that
++ extended attributes are not supported by some filesystems (e.g.,
++ isofs, udf, vfat) so copying files through such filesystems will
++ lose the extended attributes and these PaX markings.
++
++ If you have applications not marked by the PT_PAX_FLAGS ELF program
++ header then you MUST enable either XATTR_PAX_FLAGS or EI_PAX marking
++ support otherwise they will not get any protection.
++
++ If you enable both PT_PAX_FLAGS and XATTR_PAX_FLAGS support then you
++ must make sure that the marks are the same if a binary has both marks.
++
++ Note that if you enable the legacy EI_PAX marking support as well,
++ the EI_PAX marks will be overridden by the XATTR_PAX_FLAGS marks.
++
+choice
+ prompt 'MAC system integration'
+ default PAX_HAVE_ACL_FLAGS
@@ -77394,7 +75918,7 @@ index e0f08b5..9ace91e 100644
+
+config PAX_NOEXEC
+ bool "Enforce non-executable pages"
-+ depends on (PAX_EI_PAX || PAX_PT_PAX_FLAGS || PAX_HAVE_ACL_FLAGS || PAX_HOOK_ACL_FLAGS) && (ALPHA || (ARM && (CPU_V6 || CPU_V7)) || IA64 || MIPS || PARISC || PPC || S390 || SPARC || X86)
++ depends on ALPHA || (ARM && (CPU_V6 || CPU_V7)) || IA64 || MIPS || PARISC || PPC || S390 || SPARC || X86
+ help
+ By design some architectures do not allow for protecting memory
+ pages against execution or even if they do, Linux does not make
@@ -77614,6 +76138,34 @@ index e0f08b5..9ace91e 100644
+ 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
++ depends on PAX_KERNEXEC_PLUGIN
++ help
++ Select the method used to instrument function pointer dereferences.
++ Note that binary modules cannot be instrumented by this approach.
++
++ config PAX_KERNEXEC_PLUGIN_METHOD_BTS
++ bool "bts"
++ help
++ This method is compatible with binary only modules but has
++ a higher runtime overhead.
++
++ config PAX_KERNEXEC_PLUGIN_METHOD_OR
++ bool "or"
++ depends on !PARAVIRT
++ help
++ This method is incompatible with binary only modules but has
++ a lower runtime overhead.
++endchoice
++
++config PAX_KERNEXEC_PLUGIN_METHOD
++ string
++ default "bts" if PAX_KERNEXEC_PLUGIN_METHOD_BTS
++ default "or" if PAX_KERNEXEC_PLUGIN_METHOD_OR
++ default ""
++
+config PAX_KERNEXEC_MODULE_TEXT
+ int "Minimum amount of memory reserved for module code"
+ default "4"
@@ -77641,7 +76193,6 @@ index e0f08b5..9ace91e 100644
+
+config PAX_ASLR
+ bool "Address Space Layout Randomization"
-+ depends on PAX_EI_PAX || PAX_PT_PAX_FLAGS || PAX_HAVE_ACL_FLAGS || PAX_HOOK_ACL_FLAGS
+ help
+ Many if not most exploit techniques rely on the knowledge of
+ certain addresses in the attacked program. The following options
@@ -77761,10 +76312,10 @@ index e0f08b5..9ace91e 100644
+ 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 (cross compilation
-+ is not supported). 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.
++ 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.
+
+config PAX_MEMORY_UDEREF
+ bool "Prevent invalid userland pointer dereference"
@@ -77840,7 +76391,7 @@ index e0f08b5..9ace91e 100644
config KEYS
bool "Enable access key retention support"
help
-@@ -167,7 +719,7 @@ config INTEL_TXT
+@@ -169,7 +789,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
@@ -77863,7 +76414,7 @@ index 3783202..1852837 100644
.ptrace_access_check = apparmor_ptrace_access_check,
diff --git a/security/commoncap.c b/security/commoncap.c
-index a93b3b7..4410df9 100644
+index ee4f848..a320c64 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -28,6 +28,7 @@
@@ -77883,7 +76434,7 @@ index a93b3b7..4410df9 100644
return -EPERM;
return 0;
}
-@@ -575,6 +576,9 @@ int cap_bprm_secureexec(struct linux_binprm *bprm)
+@@ -579,6 +580,9 @@ int cap_bprm_secureexec(struct linux_binprm *bprm)
{
const struct cred *cred = current_cred();
@@ -77894,10 +76445,10 @@ index a93b3b7..4410df9 100644
if (bprm->cap_effective)
return 1;
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
-index 08408bd..67e6e78 100644
+index 3ccf7ac..d73ad64 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
-@@ -85,8 +85,8 @@ void ima_add_violation(struct inode *inode, const unsigned char *filename,
+@@ -86,8 +86,8 @@ void ima_add_violation(struct inode *inode, const unsigned char *filename,
extern spinlock_t ima_queue_lock;
struct ima_h_table {
@@ -77909,7 +76460,7 @@ index 08408bd..67e6e78 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 da36d2c..e1e1965 100644
+index 0d50df0..e94dd2a 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,
@@ -77921,8 +76472,27 @@ index da36d2c..e1e1965 100644
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
if (!entry) {
+diff --git a/security/integrity/ima/ima_audit.c b/security/integrity/ima/ima_audit.c
+index c5c5a72..2ad942f 100644
+--- a/security/integrity/ima/ima_audit.c
++++ b/security/integrity/ima/ima_audit.c
+@@ -56,9 +56,11 @@ void integrity_audit_msg(int audit_msgno, struct inode *inode,
+ audit_log_format(ab, " name=");
+ audit_log_untrustedstring(ab, fname);
+ }
+- if (inode)
+- audit_log_format(ab, " dev=%s ino=%lu",
+- inode->i_sb->s_id, inode->i_ino);
++ if (inode) {
++ audit_log_format(ab, " dev=");
++ audit_log_untrustedstring(ab, inode->i_sb->s_id);
++ audit_log_format(ab, " ino=%lu", inode->i_ino);
++ }
+ audit_log_format(ab, " res=%d", !result ? 0 : 1);
+ audit_log_end(ab);
+ }
diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c
-index ef21b96..d53e674 100644
+index e1aa2b4..52027bf 100644
--- a/security/integrity/ima/ima_fs.c
+++ b/security/integrity/ima/ima_fs.c
@@ -28,12 +28,12 @@
@@ -77954,7 +76524,7 @@ index 8e28f04..d5951b1 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 338b510..a235861 100644
+index 4c48e13..7abdac9 100644
--- a/security/keys/compat.c
+++ b/security/keys/compat.c
@@ -44,7 +44,7 @@ long compat_keyctl_instantiate_key_iov(
@@ -77967,7 +76537,7 @@ index 338b510..a235861 100644
if (iov != iovstack)
kfree(iov);
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
-index eca5191..da9c7f0 100644
+index 0b3f5d7..892c8a6 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -921,7 +921,7 @@ static int keyctl_change_reqkey_auth(struct key *key)
@@ -78007,10 +76577,10 @@ index eca5191..da9c7f0 100644
if (iov != iovstack)
kfree(iov);
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
-index a06ffab..beb11e8 100644
+index 37a7f3b..86dc19f 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
-@@ -215,15 +215,15 @@ static long keyring_read(const struct key *keyring,
+@@ -214,15 +214,15 @@ static long keyring_read(const struct key *keyring,
ret = -EFAULT;
for (loop = 0; loop < klist->nkeys; loop++) {
@@ -78029,6 +76599,54 @@ index a06ffab..beb11e8 100644
goto error;
buflen -= tmp;
+diff --git a/security/lsm_audit.c b/security/lsm_audit.c
+index 893af8a..ba9237c 100644
+--- a/security/lsm_audit.c
++++ b/security/lsm_audit.c
+@@ -234,10 +234,11 @@ static void dump_common_audit_data(struct audit_buffer *ab,
+ audit_log_d_path(ab, "path=", &a->u.path);
+
+ inode = a->u.path.dentry->d_inode;
+- if (inode)
+- audit_log_format(ab, " dev=%s ino=%lu",
+- inode->i_sb->s_id,
+- inode->i_ino);
++ if (inode) {
++ audit_log_format(ab, " dev=");
++ audit_log_untrustedstring(ab, inode->i_sb->s_id);
++ audit_log_format(ab, " ino=%lu", inode->i_ino);
++ }
+ break;
+ }
+ case LSM_AUDIT_DATA_DENTRY: {
+@@ -247,10 +248,11 @@ static void dump_common_audit_data(struct audit_buffer *ab,
+ audit_log_untrustedstring(ab, a->u.dentry->d_name.name);
+
+ inode = a->u.dentry->d_inode;
+- if (inode)
+- audit_log_format(ab, " dev=%s ino=%lu",
+- inode->i_sb->s_id,
+- inode->i_ino);
++ if (inode) {
++ audit_log_format(ab, " dev=");
++ audit_log_untrustedstring(ab, inode->i_sb->s_id);
++ audit_log_format(ab, " ino=%lu", inode->i_ino);
++ }
+ break;
+ }
+ case LSM_AUDIT_DATA_INODE: {
+@@ -265,8 +267,9 @@ static void dump_common_audit_data(struct audit_buffer *ab,
+ dentry->d_name.name);
+ dput(dentry);
+ }
+- audit_log_format(ab, " dev=%s ino=%lu", inode->i_sb->s_id,
+- inode->i_ino);
++ audit_log_format(ab, " dev=");
++ audit_log_untrustedstring(ab, inode->i_sb->s_id);
++ audit_log_format(ab, " ino=%lu", inode->i_ino);
+ break;
+ }
+ case LSM_AUDIT_DATA_TASK:
diff --git a/security/min_addr.c b/security/min_addr.c
index f728728..6457a0c 100644
--- a/security/min_addr.c
@@ -78050,12 +76668,12 @@ index f728728..6457a0c 100644
/*
diff --git a/security/security.c b/security/security.c
-index 4ba6d4c..74efea7 100644
+index e2f684a..8d62ef5 100644
--- a/security/security.c
+++ b/security/security.c
-@@ -25,8 +25,8 @@ static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
- /* things that live in capability.c */
- extern void __init security_fixup_ops(struct security_operations *ops);
+@@ -26,8 +26,8 @@
+ static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
+ CONFIG_DEFAULT_SECURITY;
-static struct security_operations *security_ops;
-static struct security_operations default_security_ops = {
@@ -78064,7 +76682,7 @@ index 4ba6d4c..74efea7 100644
.name = "default",
};
-@@ -67,7 +67,9 @@ int __init security_init(void)
+@@ -68,7 +68,9 @@ int __init security_init(void)
void reset_security_ops(void)
{
@@ -78075,18 +76693,19 @@ index 4ba6d4c..74efea7 100644
/* Save user chosen LSM */
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
-index 20219ef..0bff933 100644
+index 1126c10..effb32b 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
-@@ -93,7 +93,6 @@
+@@ -94,8 +94,6 @@
+
#define NUM_SEL_MNT_OPTS 5
- extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm);
-extern struct security_operations *security_ops;
-
+-
/* SECMARK reference count */
- atomic_t selinux_secmark_refcount = ATOMIC_INIT(0);
-@@ -5454,7 +5453,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer)
+ static atomic_t selinux_secmark_refcount = ATOMIC_INIT(0);
+
+@@ -5449,7 +5447,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer)
#endif
@@ -78108,24 +76727,11 @@ index b43813c..74be837 100644
}
#else
static inline int selinux_xfrm_enabled(void)
-diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
-index 973e00e..3f979e9 100644
---- a/security/selinux/ss/services.c
-+++ b/security/selinux/ss/services.c
-@@ -1814,6 +1814,8 @@ int security_load_policy(void *data, size_t len)
- int rc = 0;
- struct policy_file file = { data, len }, *fp = &file;
-
-+ pax_track_stack();
-+
- if (!ss_initialized) {
- avtab_cache_init();
- rc = policydb_read(&policydb, fp);
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index 9831a39..351e82a 100644
+index 7db62b4..ee4d949 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
-@@ -3392,7 +3392,7 @@ static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
+@@ -3481,7 +3481,7 @@ static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
return 0;
}
@@ -78135,10 +76741,10 @@ index 9831a39..351e82a 100644
.ptrace_access_check = smack_ptrace_access_check,
diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c
-index 95d3f95..1786602 100644
+index 4b327b6..646c57a 100644
--- a/security/tomoyo/tomoyo.c
+++ b/security/tomoyo/tomoyo.c
-@@ -240,7 +240,7 @@ static int tomoyo_sb_pivotroot(struct path *old_path, struct path *new_path)
+@@ -504,7 +504,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.
*/
@@ -78148,7 +76754,7 @@ index 95d3f95..1786602 100644
.cred_alloc_blank = tomoyo_cred_alloc_blank,
.cred_prepare = tomoyo_cred_prepare,
diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
-index 3687a6c..652565e 100644
+index 762af68..7103453 100644
--- a/sound/aoa/codecs/onyx.c
+++ b/sound/aoa/codecs/onyx.c
@@ -54,7 +54,7 @@ struct onyx {
@@ -78192,7 +76798,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 23c34a0..a2673a5 100644
+index 3cc4b86..af0a951 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
@@ -78280,10 +76886,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 1c6be91..c761a59 100644
+index 25ed9fe..24c46e9 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,
+@@ -2765,11 +2765,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,
@@ -78298,10 +76904,10 @@ index 1c6be91..c761a59 100644
default:
result = -EINVAL;
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
-index 1f99767..14636533 100644
+index 5cf8d65..912a79c 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
-@@ -63,7 +63,7 @@ struct ops_list {
+@@ -64,7 +64,7 @@ struct ops_list {
int argsize; /* argument size */
/* operators */
@@ -78310,7 +76916,7 @@ index 1f99767..14636533 100644
/* registred devices */
struct list_head dev_list; /* list of devices */
-@@ -332,7 +332,7 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry,
+@@ -333,7 +333,7 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry,
mutex_lock(&ops->reg_mutex);
/* copy driver operators */
@@ -78319,7 +76925,7 @@ index 1f99767..14636533 100644
ops->driver |= DRIVER_LOADED;
ops->argsize = argsize;
-@@ -462,7 +462,7 @@ static int init_device(struct snd_seq_device *dev, struct ops_list *ops)
+@@ -463,7 +463,7 @@ static int init_device(struct snd_seq_device *dev, struct ops_list *ops)
dev->name, ops->id, ops->argsize, dev->argsize);
return -EINVAL;
}
@@ -78328,7 +76934,7 @@ index 1f99767..14636533 100644
dev->status = SNDRV_SEQ_DEVICE_REGISTERED;
ops->num_init_devices++;
} else {
-@@ -489,7 +489,7 @@ static int free_device(struct snd_seq_device *dev, struct ops_list *ops)
+@@ -490,7 +490,7 @@ static int free_device(struct snd_seq_device *dev, struct ops_list *ops)
dev->name, ops->id, ops->argsize, dev->argsize);
return -EINVAL;
}
@@ -78338,10 +76944,10 @@ index 1f99767..14636533 100644
dev->driver_data = NULL;
ops->num_init_devices--;
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c
-index 8539ab0..be8a121 100644
+index f24bf9a..1f7b67c 100644
--- a/sound/drivers/mts64.c
+++ b/sound/drivers/mts64.c
-@@ -28,6 +28,7 @@
+@@ -29,6 +29,7 @@
#include <sound/initval.h>
#include <sound/rawmidi.h>
#include <sound/control.h>
@@ -78349,7 +76955,7 @@ index 8539ab0..be8a121 100644
#define CARD_NAME "Miditerminal 4140"
#define DRIVER_NAME "MTS64"
-@@ -66,7 +67,7 @@ struct mts64 {
+@@ -67,7 +68,7 @@ struct mts64 {
struct pardevice *pardev;
int pardev_claimed;
@@ -78358,7 +76964,7 @@ index 8539ab0..be8a121 100644
int current_midi_output_port;
int current_midi_input_port;
u8 mode[MTS64_NUM_INPUT_PORTS];
-@@ -696,7 +697,7 @@ static int snd_mts64_rawmidi_open(struct snd_rawmidi_substream *substream)
+@@ -697,7 +698,7 @@ static int snd_mts64_rawmidi_open(struct snd_rawmidi_substream *substream)
{
struct mts64 *mts = substream->rmidi->private_data;
@@ -78367,7 +76973,7 @@ index 8539ab0..be8a121 100644
/* We don't need a spinlock here, because this is just called
if the device has not been opened before.
So there aren't any IRQs from the device */
-@@ -704,7 +705,7 @@ static int snd_mts64_rawmidi_open(struct snd_rawmidi_substream *substream)
+@@ -705,7 +706,7 @@ static int snd_mts64_rawmidi_open(struct snd_rawmidi_substream *substream)
msleep(50);
}
@@ -78376,7 +76982,7 @@ index 8539ab0..be8a121 100644
return 0;
}
-@@ -714,8 +715,7 @@ static int snd_mts64_rawmidi_close(struct snd_rawmidi_substream *substream)
+@@ -715,8 +716,7 @@ static int snd_mts64_rawmidi_close(struct snd_rawmidi_substream *substream)
struct mts64 *mts = substream->rmidi->private_data;
unsigned long flags;
@@ -78386,7 +76992,7 @@ index 8539ab0..be8a121 100644
/* We need the spinlock_irqsave here because we can still
have IRQs at this point */
spin_lock_irqsave(&mts->lock, flags);
-@@ -724,8 +724,8 @@ static int snd_mts64_rawmidi_close(struct snd_rawmidi_substream *substream)
+@@ -725,8 +725,8 @@ static int snd_mts64_rawmidi_close(struct snd_rawmidi_substream *substream)
msleep(500);
@@ -78398,10 +77004,10 @@ index 8539ab0..be8a121 100644
return 0;
}
diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c
-index f07e38d..7aae69a 100644
+index b953fb4..1999c01 100644
--- a/sound/drivers/opl4/opl4_lib.c
+++ b/sound/drivers/opl4/opl4_lib.c
-@@ -28,7 +28,7 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
+@@ -29,7 +29,7 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
MODULE_DESCRIPTION("OPL4 driver");
MODULE_LICENSE("GPL");
@@ -78411,10 +77017,10 @@ index f07e38d..7aae69a 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 f2b0ba2..429efc5 100644
+index f664823..590c745 100644
--- a/sound/drivers/portman2x4.c
+++ b/sound/drivers/portman2x4.c
-@@ -47,6 +47,7 @@
+@@ -48,6 +48,7 @@
#include <sound/initval.h>
#include <sound/rawmidi.h>
#include <sound/control.h>
@@ -78422,7 +77028,7 @@ index f2b0ba2..429efc5 100644
#define CARD_NAME "Portman 2x4"
#define DRIVER_NAME "portman"
-@@ -84,7 +85,7 @@ struct portman {
+@@ -85,7 +86,7 @@ struct portman {
struct pardevice *pardev;
int pardev_claimed;
@@ -78467,10 +77073,10 @@ index 537a9cb..8e8c8e9 100644
/**
diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c
-index 4400308..261e9f3 100644
+index cd094ec..eca1277 100644
--- a/sound/firewire/isight.c
+++ b/sound/firewire/isight.c
-@@ -97,7 +97,7 @@ static void isight_update_pointers(struct isight *isight, unsigned int count)
+@@ -96,7 +96,7 @@ static void isight_update_pointers(struct isight *isight, unsigned int count)
ptr += count;
if (ptr >= runtime->buffer_size)
ptr -= runtime->buffer_size;
@@ -78479,7 +77085,7 @@ index 4400308..261e9f3 100644
isight->period_counter += count;
if (isight->period_counter >= runtime->period_size) {
-@@ -308,7 +308,7 @@ static int isight_hw_params(struct snd_pcm_substream *substream,
+@@ -307,7 +307,7 @@ static int isight_hw_params(struct snd_pcm_substream *substream,
if (err < 0)
return err;
@@ -78488,7 +77094,7 @@ index 4400308..261e9f3 100644
return 0;
}
-@@ -341,7 +341,7 @@ static int isight_hw_free(struct snd_pcm_substream *substream)
+@@ -340,7 +340,7 @@ static int isight_hw_free(struct snd_pcm_substream *substream)
{
struct isight *isight = substream->private_data;
@@ -78497,7 +77103,7 @@ index 4400308..261e9f3 100644
mutex_lock(&isight->mutex);
isight_stop_streaming(isight);
-@@ -434,10 +434,10 @@ static int isight_trigger(struct snd_pcm_substream *substream, int cmd)
+@@ -433,10 +433,10 @@ static int isight_trigger(struct snd_pcm_substream *substream, int cmd)
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
@@ -78511,7 +77117,7 @@ index 4400308..261e9f3 100644
default:
return -EINVAL;
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
-index fe79a16..4d9714e 100644
+index c94578d..0794ac1 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -172,7 +172,7 @@ struct snd_cmi8330 {
@@ -78575,10 +77181,10 @@ 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 59c9730..91ef96e 100644
+index 5644711..a2aebc1 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
-@@ -615,7 +615,7 @@ struct hda_bus_ops {
+@@ -611,7 +611,7 @@ struct hda_bus_ops {
/* notify power-up/down from codec to controller */
void (*pm_notify)(struct hda_bus *bus);
#endif
@@ -78636,10 +77242,10 @@ index 0da778a..bc38b84 100644
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
-index c94c051..be0abd1 100644
+index 03ee4e3..be86b46 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
-@@ -202,8 +202,8 @@ static void snd_ymfpci_hw_stop(struct snd_ymfpci *chip)
+@@ -203,8 +203,8 @@ static void snd_ymfpci_hw_stop(struct snd_ymfpci *chip)
if ((snd_ymfpci_readl(chip, YDSXGR_STATUS) & 2) == 0)
break;
}
@@ -78650,7 +77256,7 @@ index c94c051..be0abd1 100644
wake_up(&chip->interrupt_sleep);
}
__end:
-@@ -787,7 +787,7 @@ static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip)
+@@ -788,7 +788,7 @@ static void snd_ymfpci_irq_wait(struct snd_ymfpci *chip)
continue;
init_waitqueue_entry(&wait, current);
add_wait_queue(&chip->interrupt_sleep, &wait);
@@ -78659,7 +77265,7 @@ index c94c051..be0abd1 100644
schedule_timeout_uninterruptible(msecs_to_jiffies(50));
remove_wait_queue(&chip->interrupt_sleep, &wait);
}
-@@ -825,8 +825,8 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id)
+@@ -826,8 +826,8 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id)
snd_ymfpci_writel(chip, YDSXGR_MODE, mode);
spin_unlock(&chip->reg_lock);
@@ -78670,7 +77276,7 @@ index c94c051..be0abd1 100644
wake_up(&chip->interrupt_sleep);
}
}
-@@ -2363,7 +2363,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card,
+@@ -2382,7 +2382,7 @@ int __devinit 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);
@@ -78679,29 +77285,21 @@ index c94c051..be0abd1 100644
chip->card = card;
chip->pci = pci;
chip->irq = -1;
-diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
-index 493ae7c..c0f5892 100644
---- a/sound/soc/soc-core.c
-+++ b/sound/soc/soc-core.c
-@@ -1021,7 +1021,7 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
+diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
+index ee15337..e2187a6 100644
+--- a/sound/soc/soc-pcm.c
++++ b/sound/soc/soc-pcm.c
+@@ -583,7 +583,7 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
}
/* ASoC PCM operations */
-static struct snd_pcm_ops soc_pcm_ops = {
+static snd_pcm_ops_no_const soc_pcm_ops = {
.open = soc_pcm_open,
- .close = soc_codec_close,
+ .close = soc_pcm_close,
.hw_params = soc_pcm_hw_params,
-@@ -2129,6 +2129,7 @@ static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
- rtd->pcm = pcm;
- pcm->private_data = rtd;
- if (platform->driver->ops) {
-+ /* this whole logic is broken... */
- soc_pcm_ops.mmap = platform->driver->ops->mmap;
- soc_pcm_ops.pointer = platform->driver->ops->pointer;
- soc_pcm_ops.ioctl = platform->driver->ops->ioctl;
diff --git a/sound/usb/card.h b/sound/usb/card.h
-index ae4251d..0961361 100644
+index a39edcc..1014050 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -44,6 +44,7 @@ struct snd_urb_ops {
@@ -78717,20 +77315,20 @@ index ae4251d..0961361 100644
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) */
++ snd_urb_ops_no_const ops; /* callbacks (must be filled at init) */
+ int last_frame_number; /* stored frame number */
+ int last_delay; /* stored delay */
};
-
- struct snd_usb_stream {
diff --git a/tools/gcc/Makefile b/tools/gcc/Makefile
new file mode 100644
-index 0000000..1e75733
+index 0000000..b044b80
--- /dev/null
+++ b/tools/gcc/Makefile
@@ -0,0 +1,21 @@
+#CC := gcc
+#PLUGIN_SOURCE_FILES := pax_plugin.c
+#PLUGIN_OBJECT_FILES := $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
-+GCCPLUGINS_DIR := $(shell $(HOSTCC) -print-file-name=plugin)
++GCCPLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
+#CFLAGS += -I$(GCCPLUGINS_DIR)/include -fPIC -O2 -Wall -W
+
+HOST_EXTRACFLAGS += -I$(GCCPLUGINS_DIR)/include
@@ -78743,17 +77341,17 @@ index 0000000..1e75733
+
+always := $(hostlibs-y)
+
-+stackleak_plugin-objs := stackleak_plugin.o
+constify_plugin-objs := constify_plugin.o
++stackleak_plugin-objs := stackleak_plugin.o
+kallocstat_plugin-objs := kallocstat_plugin.o
+kernexec_plugin-objs := kernexec_plugin.o
+checker_plugin-objs := checker_plugin.o
diff --git a/tools/gcc/checker_plugin.c b/tools/gcc/checker_plugin.c
new file mode 100644
-index 0000000..2fd48e0
+index 0000000..d41b5af
--- /dev/null
+++ b/tools/gcc/checker_plugin.c
-@@ -0,0 +1,169 @@
+@@ -0,0 +1,171 @@
+/*
+ * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
+ * Licensed under the GPL v2
@@ -78777,17 +77375,19 @@ index 0000000..2fd48e0
+#include "coretypes.h"
+#include "tree.h"
+#include "tree-pass.h"
++#include "flags.h"
+#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++//#include "expr.h" where are you...
++#include "diagnostic.h"
+#include "plugin-version.h"
+#include "tm.h"
-+#include "toplev.h"
++#include "function.h"
+#include "basic-block.h"
+#include "gimple.h"
-+//#include "expr.h" where are you...
-+#include "diagnostic.h"
+#include "rtl.h"
+#include "emit-rtl.h"
-+#include "function.h"
+#include "tree-flow.h"
+#include "target.h"
+
@@ -78804,7 +77404,7 @@ index 0000000..2fd48e0
+int plugin_is_GPL_compatible;
+
+static struct plugin_info checker_plugin_info = {
-+ .version = "201110031940",
++ .version = "201111150100",
+};
+
+#define ADDR_SPACE_KERNEL 0
@@ -78919,16 +77519,16 @@ index 0000000..2fd48e0
+ if (TARGET_64BIT == 0)
+ return 0;
+
-+ register_callback (plugin_name, PLUGIN_PRAGMAS, register_checker_address_spaces, NULL);
++ register_callback(plugin_name, PLUGIN_PRAGMAS, register_checker_address_spaces, NULL);
+
+ return 0;
+}
diff --git a/tools/gcc/constify_plugin.c b/tools/gcc/constify_plugin.c
new file mode 100644
-index 0000000..e565ec3
+index 0000000..704a564
--- /dev/null
+++ b/tools/gcc/constify_plugin.c
-@@ -0,0 +1,293 @@
+@@ -0,0 +1,303 @@
+/*
+ * Copyright 2011 by Emese Revfy <re.emese@gmail.com>
+ * Copyright 2011 by PaX Team <pageexec@freemail.hu>
@@ -78950,22 +77550,26 @@ index 0000000..e565ec3
+#include "coretypes.h"
+#include "tree.h"
+#include "tree-pass.h"
++#include "flags.h"
+#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++#include "diagnostic.h"
+#include "plugin-version.h"
+#include "tm.h"
-+#include "toplev.h"
+#include "function.h"
++#include "basic-block.h"
++#include "gimple.h"
++#include "rtl.h"
++#include "emit-rtl.h"
+#include "tree-flow.h"
-+#include "plugin.h"
-+#include "diagnostic.h"
-+//#include "c-tree.h"
+
+#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE)
+
+int plugin_is_GPL_compatible;
+
+static struct plugin_info const_plugin_info = {
-+ .version = "20110826",
++ .version = "201111150100",
+ .help = "no-constify\tturn off constification\n",
+};
+
@@ -79059,7 +77663,10 @@ index 0000000..e565ec3
+ .decl_required = false,
+ .type_required = false,
+ .function_type_required = false,
-+ .handler = handle_no_const_attribute
++ .handler = handle_no_const_attribute,
++#if BUILDING_GCC_VERSION >= 4007
++ .affects_type_identity = true
++#endif
+};
+
+static struct attribute_spec do_const_attr = {
@@ -79069,7 +77676,10 @@ index 0000000..e565ec3
+ .decl_required = false,
+ .type_required = false,
+ .function_type_required = false,
-+ .handler = handle_do_const_attribute
++ .handler = handle_do_const_attribute,
++#if BUILDING_GCC_VERSION >= 4007
++ .affects_type_identity = true
++#endif
+};
+
+static void register_attributes(void *event_data, void *data)
@@ -79155,7 +77765,7 @@ index 0000000..e565ec3
+ tree var;
+ referenced_var_iterator rvi;
+
-+#if __GNUC__ == 4 && __GNUC_MINOR__ == 5
++#if BUILDING_GCC_VERSION == 4005
+ FOR_EACH_REFERENCED_VAR(var, rvi) {
+#else
+ FOR_EACH_REFERENCED_VAR(cfun, var, rvi) {
@@ -79224,10 +77834,10 @@ index 0000000..e565ec3
+}
diff --git a/tools/gcc/kallocstat_plugin.c b/tools/gcc/kallocstat_plugin.c
new file mode 100644
-index 0000000..9fc9bbd
+index 0000000..a5eabce
--- /dev/null
+++ b/tools/gcc/kallocstat_plugin.c
-@@ -0,0 +1,165 @@
+@@ -0,0 +1,167 @@
+/*
+ * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
+ * Licensed under the GPL v2
@@ -79250,17 +77860,19 @@ index 0000000..9fc9bbd
+#include "coretypes.h"
+#include "tree.h"
+#include "tree-pass.h"
++#include "flags.h"
+#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++//#include "expr.h" where are you...
++#include "diagnostic.h"
+#include "plugin-version.h"
+#include "tm.h"
-+#include "toplev.h"
++#include "function.h"
+#include "basic-block.h"
+#include "gimple.h"
-+//#include "expr.h" where are you...
-+#include "diagnostic.h"
+#include "rtl.h"
+#include "emit-rtl.h"
-+#include "function.h"
+
+extern void print_gimple_stmt(FILE *, gimple, int, int);
+
@@ -79279,7 +77891,7 @@ index 0000000..9fc9bbd
+};
+
+static struct plugin_info kallocstat_plugin_info = {
-+ .version = "201109121100",
++ .version = "201111150100",
+};
+
+static unsigned int execute_kallocstat(void);
@@ -79395,10 +78007,10 @@ index 0000000..9fc9bbd
+}
diff --git a/tools/gcc/kernexec_plugin.c b/tools/gcc/kernexec_plugin.c
new file mode 100644
-index 0000000..4c69034
+index 0000000..51f747e
--- /dev/null
+++ b/tools/gcc/kernexec_plugin.c
-@@ -0,0 +1,273 @@
+@@ -0,0 +1,348 @@
+/*
+ * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
+ * Licensed under the GPL v2
@@ -79421,17 +78033,19 @@ index 0000000..4c69034
+#include "coretypes.h"
+#include "tree.h"
+#include "tree-pass.h"
++#include "flags.h"
+#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++//#include "expr.h" where are you...
++#include "diagnostic.h"
+#include "plugin-version.h"
+#include "tm.h"
-+#include "toplev.h"
++#include "function.h"
+#include "basic-block.h"
+#include "gimple.h"
-+//#include "expr.h" where are you...
-+#include "diagnostic.h"
+#include "rtl.h"
+#include "emit-rtl.h"
-+#include "function.h"
+#include "tree-flow.h"
+
+extern void print_gimple_stmt(FILE *, gimple, int, int);
@@ -79440,13 +78054,17 @@ index 0000000..4c69034
+int plugin_is_GPL_compatible;
+
+static struct plugin_info kernexec_plugin_info = {
-+ .version = "201110032145",
++ .version = "201111291120",
++ .help = "method=[bts|or]\tinstrumentation method\n"
+};
+
+static unsigned int execute_kernexec_fptr(void);
+static unsigned int execute_kernexec_retaddr(void);
+static bool kernexec_cmodel_check(void);
+
++static void (*kernexec_instrument_fptr)(gimple_stmt_iterator);
++static void (*kernexec_instrument_retaddr)(rtx);
++
+static struct gimple_opt_pass kernexec_fptr_pass = {
+ .pass = {
+ .type = GIMPLE_PASS,
@@ -79490,7 +78108,7 @@ index 0000000..4c69034
+ if (ix86_cmodel != CM_KERNEL)
+ return false;
+
-+ section = lookup_attribute("__section__", DECL_ATTRIBUTES(current_function_decl));
++ section = lookup_attribute("section", DECL_ATTRIBUTES(current_function_decl));
+ if (!section || !TREE_VALUE(section))
+ return true;
+
@@ -79505,7 +78123,7 @@ index 0000000..4c69034
+ * add special KERNEXEC instrumentation: force MSB of fptr to 1, which will produce
+ * a non-canonical address from a userland ptr and will just trigger a GPF on dereference
+ */
-+static void kernexec_instrument_fptr(gimple_stmt_iterator gsi)
++static void kernexec_instrument_fptr_bts(gimple_stmt_iterator gsi)
+{
+ gimple assign_intptr, assign_new_fptr, call_stmt;
+ tree intptr, old_fptr, new_fptr, kernexec_mask;
@@ -79514,27 +78132,59 @@ index 0000000..4c69034
+ old_fptr = gimple_call_fn(call_stmt);
+
+ // create temporary unsigned long variable used for bitops and cast fptr to it
-+ intptr = create_tmp_var(long_unsigned_type_node, NULL);
++ intptr = create_tmp_var(long_unsigned_type_node, "kernexec_bts");
+ add_referenced_var(intptr);
+ mark_sym_for_renaming(intptr);
+ assign_intptr = gimple_build_assign(intptr, fold_convert(long_unsigned_type_node, old_fptr));
-+ update_stmt(assign_intptr);
+ gsi_insert_before(&gsi, assign_intptr, GSI_SAME_STMT);
++ update_stmt(assign_intptr);
+
+ // apply logical or to temporary unsigned long and bitmask
+ kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0x8000000000000000LL);
+// kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0xffffffff80000000LL);
+ assign_intptr = gimple_build_assign(intptr, fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask));
-+ update_stmt(assign_intptr);
+ gsi_insert_before(&gsi, assign_intptr, GSI_SAME_STMT);
++ update_stmt(assign_intptr);
+
+ // cast temporary unsigned long back to a temporary fptr variable
-+ new_fptr = create_tmp_var(TREE_TYPE(old_fptr), NULL);
++ new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec");
+ add_referenced_var(new_fptr);
+ mark_sym_for_renaming(new_fptr);
+ assign_new_fptr = gimple_build_assign(new_fptr, fold_convert(TREE_TYPE(old_fptr), intptr));
-+ update_stmt(assign_new_fptr);
+ gsi_insert_before(&gsi, assign_new_fptr, GSI_SAME_STMT);
++ update_stmt(assign_new_fptr);
++
++ // replace call stmt fn with the new fptr
++ gimple_call_set_fn(call_stmt, new_fptr);
++ update_stmt(call_stmt);
++}
++
++static void kernexec_instrument_fptr_or(gimple_stmt_iterator gsi)
++{
++ gimple asm_or_stmt, call_stmt;
++ tree old_fptr, new_fptr, input, output;
++ VEC(tree, gc) *inputs = NULL;
++ VEC(tree, gc) *outputs = NULL;
++
++ 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");
++ add_referenced_var(new_fptr);
++ mark_sym_for_renaming(new_fptr);
++
++ // 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));
++ VEC_safe_push(tree, gc, inputs, input);
++ VEC_safe_push(tree, gc, outputs, output);
++ 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);
++ update_stmt(asm_or_stmt);
+
+ // replace call stmt fn with the new fptr
+ gimple_call_set_fn(call_stmt, new_fptr);
@@ -79588,7 +78238,7 @@ index 0000000..4c69034
+}
+
+// add special KERNEXEC instrumentation: btsq $63,(%rsp) just before retn
-+static void kernexec_instrument_retaddr(rtx insn)
++static void kernexec_instrument_retaddr_bts(rtx insn)
+{
+ rtx btsq;
+ rtvec argvec, constraintvec, labelvec;
@@ -79601,10 +78251,28 @@ index 0000000..4c69034
+ line = expand_location(RTL_LOCATION(insn)).line;
+ btsq = gen_rtx_ASM_OPERANDS(VOIDmode, "btsq $63,(%%rsp)", empty_string, 0, argvec, constraintvec, labelvec, line);
+ MEM_VOLATILE_P(btsq) = 1;
-+ RTX_FRAME_RELATED_P(btsq) = 1;
++// RTX_FRAME_RELATED_P(btsq) = 1; // not for ASM_OPERANDS
+ emit_insn_before(btsq, insn);
+}
+
++// add special KERNEXEC instrumentation: orq %r10,(%rsp) just before retn
++static void kernexec_instrument_retaddr_or(rtx insn)
++{
++ rtx orq;
++ rtvec argvec, constraintvec, labelvec;
++ int line;
++
++ // create asm volatile("orq %%r10,(%%rsp)":::)
++ argvec = rtvec_alloc(0);
++ constraintvec = rtvec_alloc(0);
++ labelvec = rtvec_alloc(0);
++ line = expand_location(RTL_LOCATION(insn)).line;
++ orq = gen_rtx_ASM_OPERANDS(VOIDmode, "orq %%r10,(%%rsp)", empty_string, 0, argvec, constraintvec, labelvec, line);
++ MEM_VOLATILE_P(orq) = 1;
++// RTX_FRAME_RELATED_P(orq) = 1; // not for ASM_OPERANDS
++ emit_insn_before(orq, insn);
++}
++
+/*
+ * find all asm level function returns and forcibly set the highest bit of the return address
+ */
@@ -79661,12 +78329,31 @@ index 0000000..4c69034
+
+ register_callback(plugin_name, PLUGIN_INFO, NULL, &kernexec_plugin_info);
+
-+ for (i = 0; i < argc; ++i)
-+ error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
-+
+ if (TARGET_64BIT == 0)
+ return 0;
+
++ for (i = 0; i < argc; ++i) {
++ if (!strcmp(argv[i].key, "method")) {
++ if (!argv[i].value) {
++ error(G_("no value supplied for option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
++ continue;
++ }
++ if (!strcmp(argv[i].value, "bts")) {
++ kernexec_instrument_fptr = kernexec_instrument_fptr_bts;
++ kernexec_instrument_retaddr = kernexec_instrument_retaddr_bts;
++ } else if (!strcmp(argv[i].value, "or")) {
++ kernexec_instrument_fptr = kernexec_instrument_fptr_or;
++ kernexec_instrument_retaddr = kernexec_instrument_retaddr_or;
++ fix_register("r10", 1, 1);
++ } else
++ error(G_("invalid option argument '-fplugin-arg-%s-%s=%s'"), plugin_name, argv[i].key, argv[i].value);
++ continue;
++ }
++ error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
++ }
++ if (!kernexec_instrument_fptr || !kernexec_instrument_retaddr)
++ error(G_("no instrumentation method was selected via '-fplugin-arg-%s-method'"), plugin_name);
++
+ register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &kernexec_fptr_pass_info);
+ register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &kernexec_retaddr_pass_info);
+
@@ -79674,10 +78361,10 @@ index 0000000..4c69034
+}
diff --git a/tools/gcc/stackleak_plugin.c b/tools/gcc/stackleak_plugin.c
new file mode 100644
-index 0000000..8bd7ab4
+index 0000000..d44f37c
--- /dev/null
+++ b/tools/gcc/stackleak_plugin.c
-@@ -0,0 +1,251 @@
+@@ -0,0 +1,291 @@
+/*
+ * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
+ * Licensed under the GPL v2
@@ -79703,26 +78390,31 @@ index 0000000..8bd7ab4
+#include "coretypes.h"
+#include "tree.h"
+#include "tree-pass.h"
++#include "flags.h"
+#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++//#include "expr.h" where are you...
++#include "diagnostic.h"
+#include "plugin-version.h"
+#include "tm.h"
-+#include "toplev.h"
++#include "function.h"
+#include "basic-block.h"
+#include "gimple.h"
-+//#include "expr.h" where are you...
-+#include "diagnostic.h"
+#include "rtl.h"
+#include "emit-rtl.h"
-+#include "function.h"
++
++extern void print_gimple_stmt(FILE *, gimple, int, int);
+
+int plugin_is_GPL_compatible;
+
+static int track_frame_size = -1;
+static const char track_function[] = "pax_track_stack";
++static const char check_function[] = "pax_check_alloca";
+static bool init_locals;
+
+static struct plugin_info stackleak_plugin_info = {
-+ .version = "201109112100",
++ .version = "201111150100",
+ .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"
+};
@@ -79745,7 +78437,7 @@ index 0000000..8bd7ab4
+ .properties_provided = 0,
+ .properties_destroyed = 0,
+ .todo_flags_start = 0, //TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts,
-+ .todo_flags_finish = TODO_verify_stmts | TODO_dump_func
++ .todo_flags_finish = TODO_verify_ssa | TODO_verify_stmts | TODO_dump_func | TODO_update_ssa
+ }
+};
+
@@ -79772,63 +78464,94 @@ index 0000000..8bd7ab4
+ return track_frame_size >= 0;
+}
+
-+static void stackleak_add_instrumentation(gimple_stmt_iterator *gsi, bool before)
++static void stackleak_check_alloca(gimple_stmt_iterator gsi)
++{
++ gimple check_alloca;
++ tree fndecl, fntype, alloca_size;
++
++ // insert call to void pax_check_alloca(unsigned long size)
++ fntype = build_function_type_list(void_type_node, long_unsigned_type_node, NULL_TREE);
++ fndecl = build_fn_decl(check_function, fntype);
++ DECL_ASSEMBLER_NAME(fndecl); // for LTO
++ alloca_size = gimple_call_arg(gsi_stmt(gsi), 0);
++ check_alloca = gimple_build_call(fndecl, 1, alloca_size);
++ gsi_insert_before(&gsi, check_alloca, GSI_CONTINUE_LINKING);
++}
++
++static void stackleak_add_instrumentation(gimple_stmt_iterator gsi)
+{
-+ gimple call;
-+ tree fndecl, type;
++ gimple track_stack;
++ tree fndecl, fntype;
+
+ // insert call to void pax_track_stack(void)
-+ type = build_function_type_list(void_type_node, NULL_TREE);
-+ fndecl = build_fn_decl(track_function, type);
++ fntype = build_function_type_list(void_type_node, NULL_TREE);
++ fndecl = build_fn_decl(track_function, fntype);
+ DECL_ASSEMBLER_NAME(fndecl); // for LTO
-+ call = gimple_build_call(fndecl, 0);
-+ if (before)
-+ gsi_insert_before(gsi, call, GSI_CONTINUE_LINKING);
-+ else
-+ gsi_insert_after(gsi, call, GSI_CONTINUE_LINKING);
++ track_stack = gimple_build_call(fndecl, 0);
++ gsi_insert_after(&gsi, track_stack, GSI_CONTINUE_LINKING);
++}
++
++#if BUILDING_GCC_VERSION == 4005
++static bool gimple_call_builtin_p(gimple stmt, enum built_in_function code)
++{
++ tree fndecl;
++
++ if (!is_gimple_call(stmt))
++ return false;
++ fndecl = gimple_call_fndecl(stmt);
++ if (!fndecl)
++ return false;
++ if (DECL_BUILT_IN_CLASS(fndecl) != BUILT_IN_NORMAL)
++ return false;
++// print_node(stderr, "pax", fndecl, 4);
++ return DECL_FUNCTION_CODE(fndecl) == code;
++}
++#endif
++
++static bool is_alloca(gimple stmt)
++{
++ if (gimple_call_builtin_p(stmt, BUILT_IN_ALLOCA))
++ return true;
++
++#if BUILDING_GCC_VERSION >= 4007
++ if (gimple_call_builtin_p(stmt, BUILT_IN_ALLOCA_WITH_ALIGN))
++ return true;
++#endif
++
++ return false;
+}
+
+static unsigned int execute_stackleak_tree_instrument(void)
+{
+ basic_block bb, entry_bb;
-+ gimple_stmt_iterator gsi;
+ bool prologue_instrumented = false;
+
+ entry_bb = ENTRY_BLOCK_PTR_FOR_FUNCTION(cfun)->next_bb;
+
+ // 1. loop through BBs and GIMPLE statements
+ FOR_EACH_BB(bb) {
++ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) {
+ // gimple match: align 8 built-in BUILT_IN_NORMAL:BUILT_IN_ALLOCA attributes <tree_list 0xb7576450>
-+ tree fndecl;
-+ gimple stmt = gsi_stmt(gsi);
-+
-+ if (!is_gimple_call(stmt))
-+ continue;
-+ fndecl = gimple_call_fndecl(stmt);
-+ if (!fndecl)
-+ continue;
-+ if (TREE_CODE(fndecl) != FUNCTION_DECL)
-+ continue;
-+ if (!DECL_BUILT_IN(fndecl))
-+ continue;
-+ if (DECL_BUILT_IN_CLASS(fndecl) != BUILT_IN_NORMAL)
-+ continue;
-+ if (DECL_FUNCTION_CODE(fndecl) != BUILT_IN_ALLOCA)
++ if (!is_alloca(gsi_stmt(gsi)))
+ continue;
+
-+ // 2. insert track call after each __builtin_alloca call
-+ stackleak_add_instrumentation(&gsi, false);
++ // 2. insert stack overflow check before each __builtin_alloca call
++ stackleak_check_alloca(gsi);
++
++ // 3. insert track call after each __builtin_alloca call
++ stackleak_add_instrumentation(gsi);
+ if (bb == entry_bb)
+ prologue_instrumented = true;
-+// print_node(stderr, "pax", fndecl, 4);
+ }
+ }
+
-+ // 3. insert track call at the beginning
++ // 4. insert track call at the beginning
+ if (!prologue_instrumented) {
-+ gsi = gsi_start_bb(entry_bb);
-+ stackleak_add_instrumentation(&gsi, true);
++ 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);
++ stackleak_add_instrumentation(gsi_start_bb(bb));
+ }
+
+ return 0;
@@ -79865,7 +78588,11 @@ index 0000000..8bd7ab4
+ continue;
+// warning(0, "track_frame_size: %d %ld %d", cfun->calls_alloca, get_frame_size(), track_frame_size);
+ // 2. delete call
-+ delete_insn_and_edges(insn);
++ 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);
++#endif
+ }
+
+// print_simple_rtl(stderr, get_insns());
@@ -79930,14 +78657,14 @@ index 0000000..8bd7ab4
+ return 0;
+}
diff --git a/tools/perf/util/include/asm/alternative-asm.h b/tools/perf/util/include/asm/alternative-asm.h
-index 6789d78..4b653fc 100644
+index 6789d78..4afd019 100644
--- a/tools/perf/util/include/asm/alternative-asm.h
+++ b/tools/perf/util/include/asm/alternative-asm.h
@@ -5,4 +5,7 @@
#define altinstruction_entry #
-+ .macro pax_force_retaddr rip=0
++ .macro pax_force_retaddr rip=0, reload=0
+ .endm
+
#endif
@@ -79968,10 +78695,10 @@ index af0f22f..9a7d479 100644
break;
}
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
-index 96ebc06..b6f830e 100644
+index d9cfb78..4f27c10 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
-@@ -73,7 +73,7 @@ LIST_HEAD(vm_list);
+@@ -75,7 +75,7 @@ LIST_HEAD(vm_list);
static cpumask_var_t cpus_hardware_enabled;
static int kvm_usage_count = 0;
@@ -79980,7 +78707,7 @@ index 96ebc06..b6f830e 100644
struct kmem_cache *kvm_vcpu_cache;
EXPORT_SYMBOL_GPL(kvm_vcpu_cache);
-@@ -2176,7 +2176,7 @@ static void hardware_enable_nolock(void *junk)
+@@ -2268,7 +2268,7 @@ static void hardware_enable_nolock(void *junk)
if (r) {
cpumask_clear_cpu(cpu, cpus_hardware_enabled);
@@ -79989,7 +78716,7 @@ index 96ebc06..b6f830e 100644
printk(KERN_INFO "kvm: enabling virtualization on "
"CPU%d failed\n", cpu);
}
-@@ -2230,10 +2230,10 @@ static int hardware_enable_all(void)
+@@ -2322,10 +2322,10 @@ static int hardware_enable_all(void)
kvm_usage_count++;
if (kvm_usage_count == 1) {
@@ -80002,7 +78729,7 @@ index 96ebc06..b6f830e 100644
hardware_disable_all_nolock();
r = -EBUSY;
}
-@@ -2498,7 +2498,7 @@ static void kvm_sched_out(struct preempt_notifier *pn,
+@@ -2676,7 +2676,7 @@ static void kvm_sched_out(struct preempt_notifier *pn,
kvm_arch_vcpu_put(vcpu);
}
@@ -80011,7 +78738,7 @@ index 96ebc06..b6f830e 100644
struct module *module)
{
int r;
-@@ -2561,7 +2561,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
+@@ -2739,7 +2739,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,
@@ -80020,7 +78747,7 @@ index 96ebc06..b6f830e 100644
if (!kvm_vcpu_cache) {
r = -ENOMEM;
goto out_free_3;
-@@ -2571,9 +2571,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
+@@ -2749,9 +2749,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
if (r)
goto out_free;
diff --git a/main/linux-grsec/kernelconfig.x86 b/main/linux-grsec/kernelconfig.x86
index 526d956762..9711293865 100644
--- a/main/linux-grsec/kernelconfig.x86
+++ b/main/linux-grsec/kernelconfig.x86
@@ -1,6 +1,6 @@
#
-# Automatically generated make config: don't edit
-# Linux/i386 3.0.9 Kernel Configuration
+# Automatically generated file; DO NOT EDIT.
+# Linux/i386 3.2.1 Kernel Configuration
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
@@ -18,7 +18,7 @@ CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
-# CONFIG_NEED_DMA_MAP_STATE is not set
+CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
@@ -37,7 +37,6 @@ CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
-# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# CONFIG_ZONE_DMA32 is not set
@@ -45,6 +44,7 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
# 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_32_SMP=y
CONFIG_X86_HT=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx"
@@ -95,8 +95,9 @@ CONFIG_HAVE_SPARSE_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_IRQ_FORCED_THREADING=y
-# CONFIG_SPARSE_IRQ is not set
+CONFIG_SPARSE_IRQ=y
#
# RCU Subsystem
@@ -122,6 +123,7 @@ CONFIG_CGROUP_CPUACCT=y
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_CFS_BANDWIDTH is not set
CONFIG_RT_GROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
@@ -148,11 +150,13 @@ CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
+CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
@@ -169,6 +173,7 @@ CONFIG_HAVE_PERF_EVENTS=y
#
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
# CONFIG_SLUB_DEBUG is not set
@@ -200,6 +205,7 @@ CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
#
# GCOV-based kernel profiling
@@ -218,6 +224,7 @@ 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
# CONFIG_BLK_DEV_THROTTLING is not set
@@ -271,16 +278,19 @@ 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=y
CONFIG_X86_BIGSMP=y
CONFIG_X86_EXTENDED_PLATFORM=y
+CONFIG_X86_WANT_INTEL_MID=y
# CONFIG_X86_MRST is not set
# CONFIG_X86_RDC321X is not set
# CONFIG_X86_32_NON_STANDARD is not set
# CONFIG_X86_32_IRIS is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_PARAVIRT_GUEST=y
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
# CONFIG_XEN_PRIVILEGED_GUEST is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
@@ -288,6 +298,7 @@ CONFIG_KVM_GUEST=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_SPINLOCKS is not set
CONFIG_PARAVIRT_CLOCK=y
+# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_NO_BOOTMEM=y
# CONFIG_MEMTEST is not set
# CONFIG_M386 is not set
@@ -319,6 +330,7 @@ CONFIG_X86_GENERIC=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_CMPXCHG_LOCAL=y
+CONFIG_CMPXCHG_DOUBLE=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
# CONFIG_X86_PPRO_FENCE is not set
@@ -341,7 +353,6 @@ CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
# CONFIG_IOMMU_HELPER is not set
-# CONFIG_IOMMU_API is not set
CONFIG_NR_CPUS=32
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
@@ -411,6 +422,7 @@ CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
+CONFIG_ARCH_RANDOM=y
# CONFIG_EFI is not set
# CONFIG_SECCOMP is not set
# CONFIG_HZ_100 is not set
@@ -466,7 +478,7 @@ CONFIG_ACPI_SBS=m
CONFIG_ACPI_HED=m
# CONFIG_ACPI_CUSTOM_METHOD is not set
CONFIG_ACPI_APEI=y
-CONFIG_ACPI_APEI_GHES=m
+# CONFIG_ACPI_APEI_GHES is not set
CONFIG_ACPI_APEI_EINJ=m
CONFIG_ACPI_APEI_ERST_DEBUG=y
# CONFIG_SFI is not set
@@ -531,7 +543,6 @@ CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_CNB20LE_QUIRK=y
-# CONFIG_DMAR is not set
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
# CONFIG_PCIEAER is not set
@@ -539,9 +550,13 @@ CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
+# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_STUB=m
CONFIG_HT_IRQ=y
-# CONFIG_PCI_IOV is not set
+CONFIG_PCI_ATS=y
+CONFIG_PCI_IOV=y
+CONFIG_PCI_PRI=y
+CONFIG_PCI_PASID=y
CONFIG_PCI_IOAPIC=y
CONFIG_PCI_LABEL=y
CONFIG_ISA_DMA_API=y
@@ -550,6 +565,7 @@ CONFIG_ISA_DMA_API=y
CONFIG_SCx200=m
CONFIG_SCx200HR_TIMER=m
# CONFIG_OLPC is not set
+CONFIG_ALIX=y
CONFIG_AMD_NB=y
CONFIG_PCCARD=m
CONFIG_PCMCIA=m
@@ -678,7 +694,6 @@ CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
-CONFIG_NETLABEL=y
CONFIG_NETWORK_SECMARK=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
@@ -763,7 +778,6 @@ CONFIG_NETFILTER_XT_MATCH_DCCP=m
CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_ESP=m
-CONFIG_NETFILTER_XT_MATCH_GRADM=m
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_HL=m
@@ -802,6 +816,7 @@ CONFIG_IP_SET_HASH_IPPORTIP=m
CONFIG_IP_SET_HASH_IPPORTNET=m
CONFIG_IP_SET_HASH_NET=m
CONFIG_IP_SET_HASH_NETPORT=m
+CONFIG_IP_SET_HASH_NETIFACE=m
CONFIG_IP_SET_LIST_SET=m
CONFIG_IP_VS=m
CONFIG_IP_VS_IPV6=y
@@ -876,7 +891,6 @@ CONFIG_IP_NF_TARGET_CLUSTERIP=m
CONFIG_IP_NF_TARGET_ECN=m
CONFIG_IP_NF_TARGET_TTL=m
CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_SECURITY=m
CONFIG_IP_NF_ARPTABLES=m
CONFIG_IP_NF_ARPFILTER=m
CONFIG_IP_NF_ARP_MANGLE=m
@@ -902,7 +916,6 @@ CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_MANGLE=m
CONFIG_IP6_NF_RAW=m
-CONFIG_IP6_NF_SECURITY=m
#
# DECnet: Netfilter Configuration
@@ -940,6 +953,12 @@ CONFIG_INET_DCCP_DIAG=m
CONFIG_IP_DCCP_CCID3=y
# CONFIG_IP_DCCP_CCID3_DEBUG is not set
CONFIG_IP_DCCP_TFRC_LIB=y
+
+#
+# DCCP Kernel Hacking
+#
+# CONFIG_IP_DCCP_DEBUG is not set
+# CONFIG_NET_DCCPPROBE is not set
CONFIG_IP_SCTP=m
CONFIG_NET_SCTPPROBE=m
# CONFIG_SCTP_DBG_MSG is not set
@@ -988,6 +1007,7 @@ CONFIG_LAPB=m
CONFIG_WAN_ROUTER=m
CONFIG_PHONET=m
CONFIG_IEEE802154=m
+CONFIG_IEEE802154_6LOWPAN=m
CONFIG_NET_SCHED=y
#
@@ -1061,35 +1081,7 @@ CONFIG_XPS=y
CONFIG_NET_PKTGEN=m
CONFIG_NET_TCPPROBE=m
# CONFIG_HAMRADIO is not set
-CONFIG_CAN=m
-CONFIG_CAN_RAW=m
-CONFIG_CAN_BCM=m
-
-#
-# CAN Device Drivers
-#
-CONFIG_CAN_VCAN=m
-CONFIG_CAN_SLCAN=m
-CONFIG_CAN_DEV=m
-# CONFIG_CAN_CALC_BITTIMING is not set
-CONFIG_CAN_MCP251X=m
-CONFIG_CAN_JANZ_ICAN3=m
-# CONFIG_PCH_CAN is not set
-CONFIG_CAN_SJA1000=m
-CONFIG_CAN_SJA1000_PLATFORM=m
-CONFIG_CAN_EMS_PCI=m
-CONFIG_CAN_KVASER_PCI=m
-CONFIG_CAN_PLX_PCI=m
-# CONFIG_CAN_C_CAN is not set
-
-#
-# CAN USB interfaces
-#
-# CONFIG_CAN_EMS_USB is not set
-# CONFIG_CAN_ESD_USB2 is not set
-CONFIG_CAN_SOFTING=m
-CONFIG_CAN_SOFTING_CS=m
-# CONFIG_CAN_DEBUG_DEVICES is not set
+# CONFIG_CAN is not set
CONFIG_IRDA=m
#
@@ -1220,16 +1212,15 @@ CONFIG_WIMAX_DEBUG_LEVEL=8
CONFIG_RFKILL=m
CONFIG_RFKILL_LEDS=y
# CONFIG_RFKILL_INPUT is not set
-CONFIG_RFKILL_REGULATOR=m
CONFIG_NET_9P=m
CONFIG_NET_9P_VIRTIO=m
CONFIG_NET_9P_RDMA=m
# CONFIG_NET_9P_DEBUG is not set
-CONFIG_CAIF=m
-# CONFIG_CAIF_DEBUG is not set
-CONFIG_CAIF_NETDEV=m
+# CONFIG_CAIF is not set
CONFIG_CEPH_LIB=m
# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
+# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set
+# CONFIG_NFC is not set
#
# Device Drivers
@@ -1245,10 +1236,14 @@ CONFIG_STANDALONE=y
CONFIG_FW_LOADER=m
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+CONFIG_DEBUG_DEVRES=y
# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=m
+CONFIG_REGMAP_SPI=m
CONFIG_CONNECTOR=m
CONFIG_MTD=m
-# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_TESTS=m
CONFIG_MTD_REDBOOT_PARTS=m
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
@@ -1350,6 +1345,7 @@ CONFIG_MTD_BLOCK2MTD=m
CONFIG_MTD_DOC2000=m
CONFIG_MTD_DOC2001=m
CONFIG_MTD_DOC2001PLUS=m
+# CONFIG_MTD_DOCG3 is not set
CONFIG_MTD_DOCPROBE=m
CONFIG_MTD_DOCECC=m
CONFIG_MTD_DOCPROBE_ADVANCED=y
@@ -1420,6 +1416,7 @@ CONFIG_BLK_DEV_DAC960=m
CONFIG_BLK_DEV_UMEM=m
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
CONFIG_BLK_DEV_CRYPTOLOOP=m
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=m
@@ -1467,6 +1464,7 @@ CONFIG_TI_DAC7512=m
CONFIG_VMWARE_BALLOON=m
CONFIG_BMP085=m
CONFIG_PCH_PHUB=m
+# CONFIG_USB_SWITCH_FSA9480 is not set
CONFIG_C2PORT=m
CONFIG_C2PORT_DURAMAR_2150=m
@@ -1478,6 +1476,7 @@ CONFIG_EEPROM_AT25=m
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
+CONFIG_EEPROM_93XX46=m
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
@@ -1490,6 +1489,11 @@ CONFIG_IWMC3200TOP=m
#
CONFIG_TI_ST=m
CONFIG_SENSORS_LIS3_I2C=m
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set
@@ -1541,7 +1545,7 @@ CONFIG_SCSI_CXGB3_ISCSI=m
CONFIG_SCSI_CXGB4_ISCSI=m
CONFIG_SCSI_BNX2_ISCSI=m
CONFIG_SCSI_BNX2X_FCOE=m
-# CONFIG_BE2ISCSI is not set
+CONFIG_BE2ISCSI=m
CONFIG_BLK_DEV_3W_XXXX_RAID=m
CONFIG_SCSI_HPSA=m
CONFIG_SCSI_3W_9XXX=m
@@ -1567,6 +1571,8 @@ CONFIG_SCSI_AIC94XX=m
# CONFIG_AIC94XX_DEBUG is not set
CONFIG_SCSI_MVSAS=m
CONFIG_SCSI_MVSAS_DEBUG=y
+CONFIG_SCSI_MVSAS_TASKLET=y
+CONFIG_SCSI_MVUMI=m
CONFIG_SCSI_DPT_I2O=m
CONFIG_SCSI_ADVANSYS=m
CONFIG_SCSI_ARCMSR=m
@@ -1597,10 +1603,8 @@ CONFIG_SCSI_ISCI=m
CONFIG_SCSI_IPS=m
CONFIG_SCSI_INITIO=m
CONFIG_SCSI_INIA100=m
-CONFIG_SCSI_PPA=m
-CONFIG_SCSI_IMM=m
-# CONFIG_SCSI_IZIP_EPP16 is not set
-# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+# CONFIG_SCSI_PPA is not set
+# CONFIG_SCSI_IMM is not set
CONFIG_SCSI_STEX=m
CONFIG_SCSI_SYM53C8XX_2=m
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
@@ -1623,12 +1627,7 @@ CONFIG_SCSI_DEBUG=m
CONFIG_SCSI_PM8001=m
CONFIG_SCSI_SRP=m
# CONFIG_SCSI_BFA_FC is not set
-CONFIG_SCSI_LOWLEVEL_PCMCIA=y
-CONFIG_PCMCIA_AHA152X=m
-CONFIG_PCMCIA_FDOMAIN=m
-# CONFIG_PCMCIA_NINJA_SCSI is not set
-CONFIG_PCMCIA_QLOGIC=m
-CONFIG_PCMCIA_SYM53C500=m
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
CONFIG_SCSI_DH=m
CONFIG_SCSI_DH_RDAC=m
CONFIG_SCSI_DH_HP_SW=m
@@ -1750,8 +1749,13 @@ 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_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_MIRROR=m
CONFIG_DM_RAID=m
CONFIG_DM_LOG_USERSPACE=m
@@ -1767,8 +1771,8 @@ CONFIG_TCM_IBLOCK=m
CONFIG_TCM_FILEIO=m
CONFIG_TCM_PSCSI=m
CONFIG_LOOPBACK_TARGET=m
-# CONFIG_LOOPBACK_TARGET_CDB_DEBUG is not set
CONFIG_TCM_FC=m
+CONFIG_ISCSI_TARGET=m
CONFIG_FUSION=y
CONFIG_FUSION_SPI=m
CONFIG_FUSION_FC=m
@@ -1797,15 +1801,26 @@ CONFIG_I2O_SCSI=m
CONFIG_I2O_PROC=m
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
-CONFIG_IFB=m
-CONFIG_DUMMY=m
+CONFIG_NET_CORE=y
CONFIG_BONDING=m
+CONFIG_DUMMY=m
+CONFIG_EQUALIZER=m
+# CONFIG_NET_FC is not set
+CONFIG_MII=m
+CONFIG_IEEE802154_DRIVERS=m
+CONFIG_IEEE802154_FAKEHARD=m
+CONFIG_IFB=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
-CONFIG_EQUALIZER=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=m
CONFIG_VETH=m
-CONFIG_NET_SB1000=m
+CONFIG_VIRTIO_NET=m
+CONFIG_SUNGEM_PHY=m
CONFIG_ARCNET=m
CONFIG_ARCNET_1201=m
CONFIG_ARCNET_1051=m
@@ -1816,39 +1831,83 @@ CONFIG_ARCNET_COM90xxIO=m
CONFIG_ARCNET_RIM_I=m
CONFIG_ARCNET_COM20020=m
CONFIG_ARCNET_COM20020_PCI=m
-CONFIG_MII=m
-CONFIG_PHYLIB=m
+CONFIG_ARCNET_COM20020_CS=m
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_DUMMY=m
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_NICSTAR=m
+# CONFIG_ATM_NICSTAR_USE_SUNI is not set
+# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_IA=m
+# CONFIG_ATM_IA_DEBUG is not set
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_FORE200E_USE_TASKLET=y
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_ATM_SOLOS=m
#
-# MII PHY device drivers
+# CAIF transport drivers
#
-CONFIG_MARVELL_PHY=m
-CONFIG_DAVICOM_PHY=m
-CONFIG_QSEMI_PHY=m
-CONFIG_LXT_PHY=m
-CONFIG_CICADA_PHY=m
-CONFIG_VITESSE_PHY=m
-CONFIG_SMSC_PHY=m
-CONFIG_BROADCOM_PHY=m
-CONFIG_ICPLUS_PHY=m
-CONFIG_REALTEK_PHY=m
-CONFIG_NATIONAL_PHY=m
-CONFIG_STE10XP=m
-CONFIG_LSI_ET1011C_PHY=m
-CONFIG_MICREL_PHY=m
-CONFIG_MDIO_BITBANG=m
-CONFIG_MDIO_GPIO=m
-CONFIG_NET_ETHERNET=y
-CONFIG_HAPPYMEAL=m
-CONFIG_SUNGEM=m
-CONFIG_CASSINI=m
+CONFIG_ETHERNET=y
+CONFIG_MDIO=m
CONFIG_NET_VENDOR_3COM=y
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_3C589=m
CONFIG_VORTEX=m
CONFIG_TYPHOON=m
-CONFIG_ENC28J60=m
-# CONFIG_ENC28J60_WRITEVERIFY is not set
-CONFIG_ETHOC=m
+CONFIG_NET_VENDOR_ADAPTEC=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_NET_VENDOR_ALTEON=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_NET_VENDOR_AMD=y
+CONFIG_AMD8111_ETH=m
+CONFIG_PCNET32=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_NET_VENDOR_ATHEROS=y
+CONFIG_ATL2=m
+CONFIG_ATL1=m
+CONFIG_ATL1E=m
+CONFIG_ATL1C=m
+CONFIG_NET_VENDOR_BROADCOM=y
+CONFIG_B44=m
+CONFIG_B44_PCI_AUTOSELECT=y
+CONFIG_B44_PCICORE_AUTOSELECT=y
+CONFIG_B44_PCI=y
+CONFIG_BNX2=m
+CONFIG_CNIC=m
+CONFIG_TIGON3=m
+CONFIG_BNX2X=m
+CONFIG_NET_VENDOR_BROCADE=y
+CONFIG_BNA=m
+CONFIG_NET_VENDOR_CHELSIO=y
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T3=m
+CONFIG_CHELSIO_T4=m
+CONFIG_CHELSIO_T4VF=m
+CONFIG_NET_VENDOR_CISCO=y
+CONFIG_ENIC=m
CONFIG_DNET=m
+CONFIG_NET_VENDOR_DEC=y
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_DE2104X_DSL=0
@@ -1861,115 +1920,209 @@ CONFIG_WINBOND_840=m
CONFIG_DM9102=m
CONFIG_ULI526X=m
CONFIG_PCMCIA_XIRCOM=m
-CONFIG_HP100=m
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
-# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
-# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
-CONFIG_NET_PCI=y
-CONFIG_PCNET32=m
-CONFIG_AMD8111_ETH=m
-CONFIG_ADAPTEC_STARFIRE=m
-CONFIG_KSZ884X_PCI=m
-CONFIG_B44=m
-CONFIG_B44_PCI_AUTOSELECT=y
-CONFIG_B44_PCICORE_AUTOSELECT=y
-CONFIG_B44_PCI=y
-CONFIG_FORCEDETH=m
-CONFIG_E100=m
-CONFIG_FEALNX=m
-CONFIG_NATSEMI=m
-CONFIG_NE2K_PCI=m
-CONFIG_8139CP=m
-CONFIG_8139TOO=m
-CONFIG_8139TOO_PIO=y
-# CONFIG_8139TOO_TUNE_TWISTER is not set
-# CONFIG_8139TOO_8129 is not set
-# CONFIG_8139_OLD_RX_RESET is not set
-CONFIG_R6040=m
-CONFIG_SIS900=m
-CONFIG_EPIC100=m
-CONFIG_SMSC9420=m
-CONFIG_SUNDANCE=m
-# CONFIG_SUNDANCE_MMIO is not set
-CONFIG_TLAN=m
-CONFIG_KS8842=m
-CONFIG_KS8851=m
-CONFIG_KS8851_MLL=m
-CONFIG_VIA_RHINE=m
-# CONFIG_VIA_RHINE_MMIO is not set
-CONFIG_SC92031=m
-CONFIG_NET_POCKET=y
-CONFIG_ATP=m
+CONFIG_NET_VENDOR_DLINK=y
CONFIG_DE600=m
CONFIG_DE620=m
-CONFIG_ATL2=m
-CONFIG_NETDEV_1000=y
-CONFIG_ACENIC=m
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
CONFIG_DL2K=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_NET_VENDOR_EMULEX=y
+CONFIG_BE2NET=m
+CONFIG_NET_VENDOR_EXAR=y
+CONFIG_S2IO=m
+CONFIG_VXGE=m
+# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
+CONFIG_NET_VENDOR_FUJITSU=y
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_NET_VENDOR_HP=y
+CONFIG_HP100=m
+CONFIG_NET_VENDOR_INTEL=y
+CONFIG_E100=m
CONFIG_E1000=m
CONFIG_E1000E=m
-CONFIG_IP1000=m
CONFIG_IGB=m
CONFIG_IGB_DCA=y
CONFIG_IGBVF=m
-CONFIG_NS83820=m
-CONFIG_HAMACHI=m
-CONFIG_YELLOWFIN=m
-CONFIG_R8169=m
-CONFIG_SIS190=m
+CONFIG_IXGB=m
+CONFIG_IXGBE=m
+CONFIG_IXGBE_DCA=y
+# CONFIG_IXGBEVF is not set
+CONFIG_NET_VENDOR_I825XX=y
+# CONFIG_ZNET is not set
+CONFIG_IP1000=m
+CONFIG_JME=m
+CONFIG_NET_VENDOR_MARVELL=y
CONFIG_SKGE=m
# CONFIG_SKGE_DEBUG is not set
+CONFIG_SKGE_GENESIS=y
CONFIG_SKY2=m
# CONFIG_SKY2_DEBUG is not set
-CONFIG_VIA_VELOCITY=m
-CONFIG_TIGON3=m
-CONFIG_BNX2=m
-CONFIG_CNIC=m
-CONFIG_QLA3XXX=m
-CONFIG_ATL1=m
-CONFIG_ATL1E=m
-CONFIG_ATL1C=m
-CONFIG_JME=m
-CONFIG_STMMAC_ETH=m
-# CONFIG_STMMAC_DA is not set
-# CONFIG_STMMAC_DUAL_MAC is not set
-CONFIG_PCH_GBE=m
-CONFIG_NETDEV_10000=y
-CONFIG_MDIO=m
-CONFIG_CHELSIO_T1=m
-CONFIG_CHELSIO_T1_1G=y
-CONFIG_CHELSIO_T3=m
-CONFIG_CHELSIO_T4=m
-CONFIG_CHELSIO_T4VF=m
-CONFIG_ENIC=m
-CONFIG_IXGBE=m
-CONFIG_IXGBE_DCA=y
-# CONFIG_IXGBEVF is not set
-CONFIG_IXGB=m
-CONFIG_S2IO=m
-CONFIG_VXGE=m
-# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
-CONFIG_MYRI10GE=m
-CONFIG_MYRI10GE_DCA=y
-CONFIG_NETXEN_NIC=m
-CONFIG_NIU=m
+CONFIG_NET_VENDOR_MELLANOX=y
CONFIG_MLX4_EN=m
CONFIG_MLX4_CORE=m
CONFIG_MLX4_DEBUG=y
-CONFIG_TEHUTI=m
-CONFIG_BNX2X=m
+CONFIG_NET_VENDOR_MICREL=y
+CONFIG_KS8842=m
+CONFIG_KS8851=m
+CONFIG_KS8851_MLL=m
+CONFIG_KSZ884X_PCI=m
+CONFIG_NET_VENDOR_MICROCHIP=y
+CONFIG_ENC28J60=m
+# CONFIG_ENC28J60_WRITEVERIFY is not set
+CONFIG_NET_VENDOR_MYRI=y
+CONFIG_MYRI10GE=m
+CONFIG_MYRI10GE_DCA=y
+CONFIG_FEALNX=m
+CONFIG_NET_VENDOR_NATSEMI=y
+CONFIG_NATSEMI=m
+CONFIG_NS83820=m
+CONFIG_NET_VENDOR_8390=y
+CONFIG_PCMCIA_AXNET=m
+CONFIG_NE2K_PCI=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_NET_VENDOR_NVIDIA=y
+CONFIG_FORCEDETH=m
+CONFIG_NET_VENDOR_OKI=y
+CONFIG_PCH_GBE=m
+CONFIG_ETHOC=m
+CONFIG_NET_PACKET_ENGINE=y
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_NET_VENDOR_QLOGIC=y
+CONFIG_QLA3XXX=m
CONFIG_QLCNIC=m
CONFIG_QLGE=m
-CONFIG_BNA=m
+CONFIG_NETXEN_NIC=m
+CONFIG_NET_VENDOR_REALTEK=y
+CONFIG_ATP=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_R8169=m
+CONFIG_NET_VENDOR_RDC=y
+CONFIG_R6040=m
+CONFIG_NET_VENDOR_SEEQ=y
+CONFIG_SEEQ8005=m
+CONFIG_NET_VENDOR_SILAN=y
+CONFIG_SC92031=m
+CONFIG_NET_VENDOR_SIS=y
+CONFIG_SIS900=m
+CONFIG_SIS190=m
CONFIG_SFC=m
CONFIG_SFC_MTD=y
-CONFIG_BE2NET=m
+CONFIG_NET_VENDOR_SMSC=y
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_EPIC100=m
+CONFIG_SMSC9420=m
+CONFIG_NET_VENDOR_STMICRO=y
+CONFIG_STMMAC_ETH=m
+# CONFIG_STMMAC_DEBUG_FS is not set
+# CONFIG_STMMAC_DA is not set
+CONFIG_STMMAC_RING=y
+# CONFIG_STMMAC_CHAINED is not set
+CONFIG_NET_VENDOR_SUN=y
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_CASSINI=m
+CONFIG_NIU=m
+CONFIG_NET_VENDOR_TEHUTI=y
+CONFIG_TEHUTI=m
+CONFIG_NET_VENDOR_TI=y
+CONFIG_TLAN=m
+CONFIG_NET_VENDOR_VIA=y
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_VIA_VELOCITY=m
+CONFIG_NET_VENDOR_XIRCOM=y
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+# CONFIG_DEFXX_MMIO is not set
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_NET_SB1000=m
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+CONFIG_VITESSE_PHY=m
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+CONFIG_ICPLUS_PHY=m
+CONFIG_REALTEK_PHY=m
+CONFIG_NATIONAL_PHY=m
+CONFIG_STE10XP=m
+CONFIG_LSI_ET1011C_PHY=m
+CONFIG_MICREL_PHY=m
+CONFIG_MDIO_BITBANG=m
+CONFIG_MDIO_GPIO=m
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_MPPE=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPPOATM=m
+CONFIG_PPPOE=m
+CONFIG_PPTP=m
+CONFIG_PPPOL2TP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_SLIP=m
+CONFIG_SLHC=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
# CONFIG_TR is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_CDC_EEM=m
+CONFIG_USB_NET_CDC_NCM=m
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_NET_CX82310_ETH=m
+CONFIG_USB_NET_KALMIA=m
+CONFIG_USB_HSO=m
+CONFIG_USB_NET_INT51X1=m
+CONFIG_USB_CDC_PHONET=m
+CONFIG_USB_IPHETH=m
+CONFIG_USB_SIERRA_NET=m
+CONFIG_USB_VL600=m
CONFIG_WLAN=y
CONFIG_PCMCIA_RAYCS=m
CONFIG_LIBERTAS_THINFIRM=m
@@ -2008,7 +2161,11 @@ CONFIG_ATH9K_HTC=m
CONFIG_CARL9170=m
CONFIG_CARL9170_LEDS=y
CONFIG_CARL9170_WPC=y
+CONFIG_CARL9170_HWRNG=y
+CONFIG_ATH6KL=m
+CONFIG_ATH6KL_DEBUG=y
CONFIG_B43=m
+CONFIG_B43_SSB=y
CONFIG_B43_PCI_AUTOSELECT=y
CONFIG_B43_PCICORE_AUTOSELECT=y
CONFIG_B43_PCMCIA=y
@@ -2016,6 +2173,7 @@ CONFIG_B43_SDIO=y
CONFIG_B43_PIO=y
CONFIG_B43_PHY_N=y
CONFIG_B43_PHY_LP=y
+CONFIG_B43_PHY_HT=y
CONFIG_B43_LEDS=y
CONFIG_B43_HWRNG=y
# CONFIG_B43_DEBUG is not set
@@ -2030,6 +2188,8 @@ CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
# CONFIG_B43LEGACY_DMA_MODE is not set
# CONFIG_B43LEGACY_PIO_MODE is not set
+# CONFIG_BRCMSMAC is not set
+# CONFIG_BRCMFMAC is not set
CONFIG_HOSTAP=m
CONFIG_HOSTAP_FIRMWARE=y
CONFIG_HOSTAP_FIRMWARE_NVRAM=y
@@ -2047,14 +2207,13 @@ CONFIG_IPW2200_QOS=y
# CONFIG_IPW2200_DEBUG is not set
CONFIG_LIBIPW=m
# CONFIG_LIBIPW_DEBUG is not set
-CONFIG_IWLAGN=m
+CONFIG_IWLWIFI=m
#
# Debugging Options
#
# CONFIG_IWLWIFI_DEBUG is not set
# CONFIG_IWLWIFI_DEVICE_SVTOOL is not set
-# CONFIG_IWL_P2P is not set
CONFIG_IWLWIFI_LEGACY=m
#
@@ -2112,6 +2271,7 @@ CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG is not set
CONFIG_RTL8192CE=m
CONFIG_RTL8192SE=m
+CONFIG_RTL8192DE=m
CONFIG_RTL8192CU=m
CONFIG_RTLWIFI=m
CONFIG_RTL8192C_COMMON=m
@@ -2120,7 +2280,6 @@ CONFIG_WL1251_SPI=m
CONFIG_WL1251_SDIO=m
CONFIG_WL12XX_MENU=m
CONFIG_WL12XX=m
-CONFIG_WL12XX_HT=y
CONFIG_WL12XX_SPI=m
CONFIG_WL12XX_SDIO=m
CONFIG_WL12XX_SDIO_TEST=m
@@ -2129,6 +2288,7 @@ CONFIG_ZD1211RW=m
# CONFIG_ZD1211RW_DEBUG is not set
CONFIG_MWIFIEX=m
CONFIG_MWIFIEX_SDIO=m
+CONFIG_MWIFIEX_PCIE=m
#
# WiMAX Wireless Broadband devices
@@ -2138,53 +2298,6 @@ CONFIG_WIMAX_I2400M_USB=m
CONFIG_WIMAX_I2400M_SDIO=m
CONFIG_WIMAX_IWMC3200_SDIO=y
CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8
-
-#
-# USB Network Adapters
-#
-CONFIG_USB_CATC=m
-CONFIG_USB_KAWETH=m
-CONFIG_USB_PEGASUS=m
-CONFIG_USB_RTL8150=m
-CONFIG_USB_USBNET=m
-CONFIG_USB_NET_AX8817X=m
-CONFIG_USB_NET_CDCETHER=m
-CONFIG_USB_NET_CDC_EEM=m
-CONFIG_USB_NET_CDC_NCM=m
-CONFIG_USB_NET_DM9601=m
-CONFIG_USB_NET_SMSC75XX=m
-CONFIG_USB_NET_SMSC95XX=m
-CONFIG_USB_NET_GL620A=m
-CONFIG_USB_NET_NET1080=m
-CONFIG_USB_NET_PLUSB=m
-CONFIG_USB_NET_MCS7830=m
-CONFIG_USB_NET_RNDIS_HOST=m
-CONFIG_USB_NET_CDC_SUBSET=m
-CONFIG_USB_ALI_M5632=y
-CONFIG_USB_AN2720=y
-CONFIG_USB_BELKIN=y
-CONFIG_USB_ARMLINUX=y
-CONFIG_USB_EPSON2888=y
-CONFIG_USB_KC2190=y
-CONFIG_USB_NET_ZAURUS=m
-CONFIG_USB_NET_CX82310_ETH=m
-CONFIG_USB_NET_KALMIA=m
-CONFIG_USB_HSO=m
-CONFIG_USB_NET_INT51X1=m
-CONFIG_USB_CDC_PHONET=m
-CONFIG_USB_IPHETH=m
-CONFIG_USB_SIERRA_NET=m
-CONFIG_USB_VL600=m
-CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_3C589=m
-CONFIG_PCMCIA_3C574=m
-CONFIG_PCMCIA_FMVJ18X=m
-CONFIG_PCMCIA_PCNET=m
-CONFIG_PCMCIA_NMCLAN=m
-CONFIG_PCMCIA_SMC91C92=m
-CONFIG_PCMCIA_XIRC2PS=m
-CONFIG_PCMCIA_AXNET=m
-CONFIG_ARCNET_COM20020_CS=m
CONFIG_WAN=y
CONFIG_LANMEDIA=m
CONFIG_HDLC=m
@@ -2211,77 +2324,6 @@ CONFIG_LAPBETHER=m
CONFIG_X25_ASY=m
CONFIG_SBNI=m
CONFIG_SBNI_MULTILINE=y
-CONFIG_ATM_DRIVERS=y
-CONFIG_ATM_DUMMY=m
-CONFIG_ATM_TCP=m
-CONFIG_ATM_LANAI=m
-CONFIG_ATM_ENI=m
-# CONFIG_ATM_ENI_DEBUG is not set
-# CONFIG_ATM_ENI_TUNE_BURST is not set
-CONFIG_ATM_FIRESTREAM=m
-CONFIG_ATM_ZATM=m
-# CONFIG_ATM_ZATM_DEBUG is not set
-CONFIG_ATM_NICSTAR=m
-# CONFIG_ATM_NICSTAR_USE_SUNI is not set
-# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
-CONFIG_ATM_IDT77252=m
-# CONFIG_ATM_IDT77252_DEBUG is not set
-# CONFIG_ATM_IDT77252_RCV_ALL is not set
-CONFIG_ATM_IDT77252_USE_SUNI=y
-CONFIG_ATM_AMBASSADOR=m
-# CONFIG_ATM_AMBASSADOR_DEBUG is not set
-CONFIG_ATM_HORIZON=m
-# CONFIG_ATM_HORIZON_DEBUG is not set
-CONFIG_ATM_IA=m
-# CONFIG_ATM_IA_DEBUG is not set
-CONFIG_ATM_FORE200E=m
-CONFIG_ATM_FORE200E_USE_TASKLET=y
-CONFIG_ATM_FORE200E_TX_RETRY=16
-CONFIG_ATM_FORE200E_DEBUG=0
-CONFIG_ATM_HE=m
-CONFIG_ATM_HE_USE_SUNI=y
-CONFIG_ATM_SOLOS=m
-CONFIG_IEEE802154_DRIVERS=m
-CONFIG_IEEE802154_FAKEHARD=m
-
-#
-# CAIF transport drivers
-#
-CONFIG_CAIF_TTY=m
-CONFIG_CAIF_SPI_SLAVE=m
-# CONFIG_CAIF_SPI_SYNC is not set
-CONFIG_FDDI=y
-CONFIG_DEFXX=m
-# CONFIG_DEFXX_MMIO is not set
-CONFIG_SKFP=m
-CONFIG_HIPPI=y
-CONFIG_ROADRUNNER=m
-# CONFIG_ROADRUNNER_LARGE_RINGS is not set
-CONFIG_PLIP=m
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPP_MPPE=m
-CONFIG_PPPOE=m
-CONFIG_PPTP=m
-CONFIG_PPPOATM=m
-CONFIG_PPPOL2TP=m
-CONFIG_SLIP=m
-CONFIG_SLIP_COMPRESSED=y
-CONFIG_SLHC=m
-CONFIG_SLIP_SMART=y
-CONFIG_SLIP_MODE_SLIP6=y
-# CONFIG_NET_FC is not set
-CONFIG_NETCONSOLE=m
-CONFIG_NETCONSOLE_DYNAMIC=y
-CONFIG_NETPOLL=y
-# CONFIG_NETPOLL_TRAP is not set
-CONFIG_NET_POLL_CONTROLLER=y
-CONFIG_VIRTIO_NET=m
CONFIG_VMXNET3=m
CONFIG_ISDN=y
# CONFIG_ISDN_I4L is not set
@@ -2443,6 +2485,7 @@ CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_USB_NEXIO=y
CONFIG_TOUCHSCREEN_TOUCHIT213=m
+CONFIG_TOUCHSCREEN_TSC_SERIO=m
# CONFIG_TOUCHSCREEN_TSC2005 is not set
CONFIG_TOUCHSCREEN_TSC2007=m
CONFIG_TOUCHSCREEN_ST1232=m
@@ -2451,13 +2494,18 @@ CONFIG_INPUT_MISC=y
CONFIG_INPUT_AD714X=m
CONFIG_INPUT_AD714X_I2C=m
CONFIG_INPUT_AD714X_SPI=m
+# CONFIG_INPUT_BMA150 is not set
CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_MC13783_PWRBUTTON is not set
+CONFIG_INPUT_MMA8450=m
+CONFIG_INPUT_MPU3050=m
CONFIG_INPUT_APANEL=m
# CONFIG_INPUT_WISTRON_BTNS is not set
CONFIG_INPUT_ATLAS_BTNS=m
-CONFIG_INPUT_ATI_REMOTE=m
CONFIG_INPUT_ATI_REMOTE2=m
CONFIG_INPUT_KEYSPAN_REMOTE=m
+CONFIG_INPUT_KXTJ9=m
+# CONFIG_INPUT_KXTJ9_POLLED_MODE is not set
CONFIG_INPUT_POWERMATE=m
CONFIG_INPUT_YEALINK=m
CONFIG_INPUT_CM109=m
@@ -2492,6 +2540,7 @@ CONFIG_SERIO_PS2MULT=m
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
@@ -2645,6 +2694,7 @@ CONFIG_I2C_SCMI=m
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
+# CONFIG_I2C_DESIGNWARE_PCI is not set
CONFIG_I2C_GPIO=m
CONFIG_I2C_INTEL_MID=m
CONFIG_I2C_OCORES=m
@@ -2672,6 +2722,7 @@ CONFIG_I2C_STUB=m
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
#
@@ -2714,14 +2765,14 @@ CONFIG_SPI_TLE62X0=m
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
CONFIG_GPIO_MAX730X=m
#
# Memory mapped GPIO drivers:
#
-CONFIG_GPIO_BASIC_MMIO_CORE=m
-CONFIG_GPIO_BASIC_MMIO=m
+# CONFIG_GPIO_GENERIC_PLATFORM is not set
CONFIG_GPIO_IT8761E=m
CONFIG_GPIO_SCH=m
CONFIG_GPIO_VX855=m
@@ -2762,48 +2813,21 @@ CONFIG_GPIO_74X164=m
# MODULbus GPIO expanders:
#
CONFIG_GPIO_JANZ_TTL=m
-CONFIG_W1=m
-CONFIG_W1_CON=y
-
-#
-# 1-wire Bus Masters
-#
-CONFIG_W1_MASTER_MATROX=m
-CONFIG_W1_MASTER_DS2490=m
-CONFIG_W1_MASTER_DS2482=m
-CONFIG_W1_MASTER_DS1WM=m
-CONFIG_W1_MASTER_GPIO=m
-
-#
-# 1-wire Slaves
-#
-CONFIG_W1_SLAVE_THERM=m
-CONFIG_W1_SLAVE_SMEM=m
-CONFIG_W1_SLAVE_DS2408=m
-CONFIG_W1_SLAVE_DS2423=m
-CONFIG_W1_SLAVE_DS2431=m
-CONFIG_W1_SLAVE_DS2433=m
-# CONFIG_W1_SLAVE_DS2433_CRC is not set
-CONFIG_W1_SLAVE_DS2760=m
-CONFIG_W1_SLAVE_DS2780=m
-CONFIG_W1_SLAVE_BQ27000=m
-CONFIG_POWER_SUPPLY=y
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
# CONFIG_POWER_SUPPLY_DEBUG is not set
-CONFIG_PDA_POWER=m
-CONFIG_TEST_POWER=m
-CONFIG_BATTERY_DS2760=m
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
# CONFIG_BATTERY_DS2780 is not set
-CONFIG_BATTERY_DS2782=m
-CONFIG_BATTERY_BQ20Z75=m
-CONFIG_BATTERY_BQ27x00=m
-# CONFIG_BATTERY_BQ27X00_I2C is not set
-# CONFIG_BATTERY_BQ27X00_PLATFORM is not set
-CONFIG_BATTERY_MAX17040=m
-CONFIG_BATTERY_MAX17042=m
-CONFIG_CHARGER_PCF50633=m
-CONFIG_CHARGER_ISP1704=m
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_PCF50633 is not set
+# CONFIG_CHARGER_ISP1704 is not set
# CONFIG_CHARGER_MAX8903 is not set
-CONFIG_CHARGER_GPIO=m
+# CONFIG_CHARGER_GPIO is not set
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set
@@ -2813,6 +2837,7 @@ CONFIG_HWMON_VID=m
#
CONFIG_SENSORS_ABITUGURU=m
CONFIG_SENSORS_ABITUGURU3=m
+CONFIG_SENSORS_AD7314=m
CONFIG_SENSORS_AD7414=m
CONFIG_SENSORS_AD7418=m
CONFIG_SENSORS_ADCXX=m
@@ -2867,23 +2892,29 @@ CONFIG_SENSORS_LTC4215=m
CONFIG_SENSORS_LTC4245=m
CONFIG_SENSORS_LTC4261=m
CONFIG_SENSORS_LM95241=m
+CONFIG_SENSORS_LM95245=m
CONFIG_SENSORS_MAX1111=m
CONFIG_SENSORS_MAX16065=m
CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_MAX1668=m
CONFIG_SENSORS_MAX6639=m
CONFIG_SENSORS_MAX6642=m
CONFIG_SENSORS_MAX6650=m
+CONFIG_SENSORS_NTC_THERMISTOR=m
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_PC87427=m
CONFIG_SENSORS_PCF8591=m
CONFIG_PMBUS=m
CONFIG_SENSORS_PMBUS=m
CONFIG_SENSORS_ADM1275=m
+CONFIG_SENSORS_LM25066=m
+CONFIG_SENSORS_LTC2978=m
CONFIG_SENSORS_MAX16064=m
CONFIG_SENSORS_MAX34440=m
CONFIG_SENSORS_MAX8688=m
CONFIG_SENSORS_UCD9000=m
CONFIG_SENSORS_UCD9200=m
+CONFIG_SENSORS_ZL6100=m
CONFIG_SENSORS_SHT15=m
CONFIG_SENSORS_SHT21=m
CONFIG_SENSORS_SIS5595=m
@@ -2895,7 +2926,9 @@ CONFIG_SENSORS_EMC6W201=m
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_SMSC47M192=m
CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SCH56XX_COMMON=m
CONFIG_SENSORS_SCH5627=m
+CONFIG_SENSORS_SCH5636=m
CONFIG_SENSORS_ADS1015=m
CONFIG_SENSORS_ADS7828=m
CONFIG_SENSORS_ADS7871=m
@@ -2928,6 +2961,7 @@ CONFIG_SENSORS_ACPI_POWER=m
CONFIG_SENSORS_ATK0110=m
CONFIG_THERMAL=y
CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
#
@@ -3006,7 +3040,10 @@ CONFIG_BCMA_POSSIBLE=y
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set
-CONFIG_MFD_SUPPORT=y
+
+#
+# Multifunction device drivers
+#
CONFIG_MFD_CORE=m
CONFIG_MFD_SM501=m
# CONFIG_MFD_SM501_GPIO is not set
@@ -3015,6 +3052,7 @@ CONFIG_UCB1400_CORE=m
# CONFIG_TPS6105X is not set
CONFIG_TPS65010=m
CONFIG_TPS6507X=m
+# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TMIO is not set
CONFIG_MFD_WM8400=m
# CONFIG_MFD_WM831X_SPI is not set
@@ -3033,29 +3071,7 @@ CONFIG_MFD_RDC321X=m
CONFIG_MFD_JANZ_CMODIO=m
CONFIG_MFD_VX855=m
CONFIG_MFD_WL1273_CORE=m
-CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
-# CONFIG_REGULATOR_DUMMY is not set
-# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
-CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
-CONFIG_REGULATOR_USERSPACE_CONSUMER=m
-CONFIG_REGULATOR_BQ24022=m
-CONFIG_REGULATOR_MAX1586=m
-CONFIG_REGULATOR_MAX8649=m
-CONFIG_REGULATOR_MAX8660=m
-CONFIG_REGULATOR_MAX8952=m
-CONFIG_REGULATOR_WM8400=m
-CONFIG_REGULATOR_PCF50633=m
-CONFIG_REGULATOR_LP3971=m
-CONFIG_REGULATOR_LP3972=m
-CONFIG_REGULATOR_MC13XXX_CORE=m
-CONFIG_REGULATOR_MC13783=m
-CONFIG_REGULATOR_MC13892=m
-# CONFIG_REGULATOR_TPS65023 is not set
-# CONFIG_REGULATOR_TPS6507X is not set
-CONFIG_REGULATOR_ISL6271A=m
-# CONFIG_REGULATOR_AD5398 is not set
-CONFIG_REGULATOR_TPS6524X=m
+# CONFIG_REGULATOR is not set
CONFIG_MEDIA_SUPPORT=m
#
@@ -3066,6 +3082,7 @@ CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_COMMON=m
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_DVB_CORE=m
+CONFIG_DVB_NET=y
CONFIG_VIDEO_MEDIA=m
#
@@ -3082,7 +3099,9 @@ CONFIG_IR_RC6_DECODER=m
CONFIG_IR_JVC_DECODER=m
CONFIG_IR_SONY_DECODER=m
CONFIG_IR_RC5_SZ_DECODER=m
+CONFIG_IR_MCE_KBD_DECODER=m
CONFIG_IR_LIRC_CODEC=m
+CONFIG_RC_ATI_REMOTE=m
# CONFIG_IR_ENE is not set
CONFIG_IR_IMON=m
# CONFIG_IR_MCEUSB is not set
@@ -3110,6 +3129,7 @@ CONFIG_MEDIA_TUNER_MT2131=m
CONFIG_MEDIA_TUNER_QT1010=m
CONFIG_MEDIA_TUNER_XC2028=m
CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_XC4000=m
CONFIG_MEDIA_TUNER_MXL5005S=m
CONFIG_MEDIA_TUNER_MXL5007T=m
CONFIG_MEDIA_TUNER_MC44S803=m
@@ -3128,6 +3148,7 @@ CONFIG_VIDEO_TUNER=m
CONFIG_V4L2_MEM2MEM_DEV=m
CONFIG_VIDEOBUF2_CORE=m
CONFIG_VIDEOBUF2_MEMOPS=m
+CONFIG_VIDEOBUF2_DMA_CONTIG=m
CONFIG_VIDEOBUF2_VMALLOC=m
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
@@ -3201,9 +3222,20 @@ CONFIG_VIDEO_AK881X=m
# Camera sensor devices
#
CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_MT9P031=m
+CONFIG_VIDEO_MT9T001=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_MT9V032=m
CONFIG_VIDEO_TCM825X=m
+# CONFIG_VIDEO_SR030PC30 is not set
+CONFIG_VIDEO_NOON010PC30=m
+# CONFIG_VIDEO_M5MOLS is not set
+# CONFIG_VIDEO_S5K6AA is not set
+
+#
+# Flash devices
+#
+# CONFIG_VIDEO_ADP1653 is not set
#
# Video improvement chips
@@ -3247,6 +3279,7 @@ CONFIG_VIDEO_CX88_MPEG=m
CONFIG_VIDEO_CX88_VP3054=m
CONFIG_VIDEO_CX23885=m
# CONFIG_MEDIA_ALTERA_CI is not set
+# CONFIG_VIDEO_CX25821 is not set
CONFIG_VIDEO_AU0828=m
CONFIG_VIDEO_IVTV=m
CONFIG_VIDEO_FB_IVTV=m
@@ -3254,10 +3287,7 @@ CONFIG_VIDEO_CX18=m
CONFIG_VIDEO_CX18_ALSA=m
CONFIG_VIDEO_SAA7164=m
CONFIG_VIDEO_CAFE_CCIC=m
-# CONFIG_VIDEO_SR030PC30 is not set
# CONFIG_VIDEO_VIA_CAMERA is not set
-CONFIG_VIDEO_NOON010PC30=m
-# CONFIG_VIDEO_M5MOLS is not set
CONFIG_SOC_CAMERA=m
# CONFIG_SOC_CAMERA_IMX074 is not set
CONFIG_SOC_CAMERA_MT9M001=m
@@ -3269,6 +3299,7 @@ CONFIG_SOC_CAMERA_RJ54N1=m
CONFIG_SOC_CAMERA_TW9910=m
CONFIG_SOC_CAMERA_PLATFORM=m
CONFIG_SOC_CAMERA_OV2640=m
+# CONFIG_SOC_CAMERA_OV5642 is not set
# CONFIG_SOC_CAMERA_OV6650 is not set
CONFIG_SOC_CAMERA_OV772X=m
CONFIG_SOC_CAMERA_OV9640=m
@@ -3297,6 +3328,7 @@ CONFIG_USB_GSPCA_OV534_9=m
CONFIG_USB_GSPCA_PAC207=m
CONFIG_USB_GSPCA_PAC7302=m
CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SE401=m
CONFIG_USB_GSPCA_SN9C2028=m
CONFIG_USB_GSPCA_SN9C20X=m
CONFIG_USB_GSPCA_SONIXB=m
@@ -3315,6 +3347,7 @@ CONFIG_USB_GSPCA_STK014=m
CONFIG_USB_GSPCA_STV0680=m
CONFIG_USB_GSPCA_SUNPLUS=m
CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TOPRO=m
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_VICAM=m
@@ -3328,11 +3361,13 @@ CONFIG_VIDEO_HDPVR=m
CONFIG_VIDEO_EM28XX=m
CONFIG_VIDEO_EM28XX_ALSA=m
CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_EM28XX_RC=y
CONFIG_VIDEO_TLG2300=m
CONFIG_VIDEO_CX231XX=m
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VIDEO_CX231XX_ALSA=m
CONFIG_VIDEO_CX231XX_DVB=m
+# CONFIG_VIDEO_TM6000 is not set
CONFIG_VIDEO_USBVISION=m
CONFIG_USB_ET61X251=m
CONFIG_USB_SN9C102=m
@@ -3400,6 +3435,7 @@ CONFIG_DVB_USB_DTT200U=m
CONFIG_DVB_USB_OPERA1=m
CONFIG_DVB_USB_AF9005=m
CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_USB_PCTV452E=m
CONFIG_DVB_USB_DW2102=m
CONFIG_DVB_USB_CINERGY_T2=m
CONFIG_DVB_USB_ANYSEE=m
@@ -3411,6 +3447,8 @@ CONFIG_DVB_USB_EC168=m
CONFIG_DVB_USB_AZ6027=m
# CONFIG_DVB_USB_LME2510 is not set
CONFIG_DVB_USB_TECHNISAT_USB2=m
+CONFIG_DVB_USB_IT913X=m
+CONFIG_DVB_USB_MXL111SF=m
CONFIG_DVB_TTUSB_BUDGET=m
CONFIG_DVB_TTUSB_DEC=m
CONFIG_SMS_SIANO_MDTV=m
@@ -3468,6 +3506,11 @@ CONFIG_DVB_HOPPER=m
CONFIG_DVB_NGENE=m
#
+# Supported ddbridge ('Octopus') Adapters
+#
+CONFIG_DVB_DDBRIDGE=m
+
+#
# Supported DVB Frontends
#
# CONFIG_DVB_FE_CUSTOMISE is not set
@@ -3481,6 +3524,12 @@ CONFIG_DVB_STV090x=m
CONFIG_DVB_STV6110x=m
#
+# Multistandard (cable + terrestrial) frontends
+#
+CONFIG_DVB_DRXK=m
+CONFIG_DVB_TDA18271C2DD=m
+
+#
# DVB-S (satellite) frontends
#
CONFIG_DVB_CX24110=m
@@ -3506,6 +3555,7 @@ CONFIG_DVB_CX24116=m
CONFIG_DVB_SI21XX=m
CONFIG_DVB_DS3000=m
CONFIG_DVB_MB86A16=m
+CONFIG_DVB_TDA10071=m
#
# DVB-T (terrestrial) frontends
@@ -3569,12 +3619,15 @@ CONFIG_DVB_TUNER_DIB0090=m
# SEC control devices for DVB-S
#
CONFIG_DVB_LNBP21=m
+CONFIG_DVB_LNBP22=m
CONFIG_DVB_ISL6405=m
CONFIG_DVB_ISL6421=m
CONFIG_DVB_ISL6423=m
+CONFIG_DVB_A8293=m
CONFIG_DVB_LGS8GXX=m
CONFIG_DVB_ATBM8830=m
CONFIG_DVB_TDA665x=m
+CONFIG_DVB_IT913X_FE=m
#
# Tools to develop new frontends
@@ -3611,6 +3664,7 @@ CONFIG_DRM_MGA=m
CONFIG_DRM_SIS=m
CONFIG_DRM_VIA=m
CONFIG_DRM_SAVAGE=m
+CONFIG_DRM_VMWGFX=m
# CONFIG_STUB_POULSBO is not set
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -3712,6 +3766,7 @@ CONFIG_FB_GEODE_GX1=m
CONFIG_FB_TMIO=m
CONFIG_FB_TMIO_ACCELL=y
CONFIG_FB_SM501=m
+# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_VIRTUAL is not set
CONFIG_FB_METRONOME=m
@@ -3730,6 +3785,7 @@ CONFIG_LCD_VGG2432A4=m
CONFIG_LCD_PLATFORM=m
CONFIG_LCD_S6E63M0=m
# CONFIG_LCD_LD9040 is not set
+CONFIG_LCD_AMS369FG06=m
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_GENERIC=m
CONFIG_BACKLIGHT_PROGEAR=m
@@ -3810,6 +3866,7 @@ CONFIG_SND_AC97_POWER_SAVE=y
CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0
CONFIG_SND_SB_COMMON=m
CONFIG_SND_SB16_DSP=m
+CONFIG_SND_TEA575X=m
CONFIG_SND_PCI=y
CONFIG_SND_AD1889=m
CONFIG_SND_ALS300=m
@@ -3859,8 +3916,8 @@ CONFIG_SND_ES1968_INPUT=y
CONFIG_SND_ES1968_RADIO=y
CONFIG_SND_FM801=m
# CONFIG_SND_FM801_TEA575X_BOOL is not set
-CONFIG_SND_TEA575X=m
CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDA_PREALLOC_SIZE=4096
CONFIG_SND_HDA_HWDEP=y
# CONFIG_SND_HDA_RECONFIG is not set
CONFIG_SND_HDA_INPUT_BEEP=y
@@ -3868,6 +3925,7 @@ 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
@@ -3875,6 +3933,7 @@ CONFIG_SND_HDA_CODEC_HDMI=y
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_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
@@ -3929,6 +3988,8 @@ CONFIG_SND_SOC_WM_HUBS=m
CONFIG_SND_SOC_AD1836=m
CONFIG_SND_SOC_AD193X=m
CONFIG_SND_SOC_AD73311=m
+CONFIG_SND_SOC_ADAU1373=m
+CONFIG_SND_SOC_ADAV80X=m
CONFIG_SND_SOC_ADS117X=m
CONFIG_SND_SOC_AK4104=m
CONFIG_SND_SOC_AK4535=m
@@ -3940,6 +4001,7 @@ CONFIG_SND_SOC_CS42L51=m
CONFIG_SND_SOC_CS4270=m
CONFIG_SND_SOC_CS4271=m
CONFIG_SND_SOC_CX20442=m
+CONFIG_SND_SOC_JZ4740_CODEC=m
CONFIG_SND_SOC_L3=m
CONFIG_SND_SOC_DA7210=m
CONFIG_SND_SOC_DFBMCS320=m
@@ -3947,18 +4009,21 @@ CONFIG_SND_SOC_MAX98088=m
CONFIG_SND_SOC_MAX98095=m
CONFIG_SND_SOC_MAX9850=m
CONFIG_SND_SOC_PCM3008=m
+CONFIG_SND_SOC_RT5631=m
CONFIG_SND_SOC_SGTL5000=m
CONFIG_SND_SOC_SPDIF=m
CONFIG_SND_SOC_SSM2602=m
+CONFIG_SND_SOC_STA32X=m
CONFIG_SND_SOC_TLV320AIC23=m
CONFIG_SND_SOC_TLV320AIC26=m
-CONFIG_SND_SOC_TVL320AIC32X4=m
+CONFIG_SND_SOC_TLV320AIC32X4=m
CONFIG_SND_SOC_TLV320AIC3X=m
CONFIG_SND_SOC_TLV320DAC33=m
CONFIG_SND_SOC_UDA134X=m
CONFIG_SND_SOC_UDA1380=m
CONFIG_SND_SOC_WL1273=m
CONFIG_SND_SOC_WM1250_EV1=m
+CONFIG_SND_SOC_WM5100=m
CONFIG_SND_SOC_WM8400=m
CONFIG_SND_SOC_WM8510=m
CONFIG_SND_SOC_WM8523=m
@@ -3973,11 +4038,11 @@ CONFIG_SND_SOC_WM8750=m
CONFIG_SND_SOC_WM8753=m
CONFIG_SND_SOC_WM8770=m
CONFIG_SND_SOC_WM8776=m
+CONFIG_SND_SOC_WM8782=m
CONFIG_SND_SOC_WM8804=m
CONFIG_SND_SOC_WM8900=m
CONFIG_SND_SOC_WM8903=m
CONFIG_SND_SOC_WM8904=m
-CONFIG_SND_SOC_WM8915=m
CONFIG_SND_SOC_WM8940=m
CONFIG_SND_SOC_WM8955=m
CONFIG_SND_SOC_WM8960=m
@@ -3986,12 +4051,14 @@ CONFIG_SND_SOC_WM8962=m
CONFIG_SND_SOC_WM8971=m
CONFIG_SND_SOC_WM8974=m
CONFIG_SND_SOC_WM8978=m
+CONFIG_SND_SOC_WM8983=m
CONFIG_SND_SOC_WM8985=m
CONFIG_SND_SOC_WM8988=m
CONFIG_SND_SOC_WM8990=m
CONFIG_SND_SOC_WM8991=m
CONFIG_SND_SOC_WM8993=m
CONFIG_SND_SOC_WM8995=m
+CONFIG_SND_SOC_WM8996=m
CONFIG_SND_SOC_WM9081=m
CONFIG_SND_SOC_LM4857=m
CONFIG_SND_SOC_MAX9877=m
@@ -4032,6 +4099,7 @@ CONFIG_HID_PRODIKEYS=m
# CONFIG_HID_EMS_FF is not set
# CONFIG_HID_ELECOM is not set
# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_HOLTEK is not set
CONFIG_HID_KEYTOUCH=m
# CONFIG_HID_KYE is not set
# CONFIG_HID_UCLOGIC is not set
@@ -4054,6 +4122,7 @@ CONFIG_HID_PICOLCD_FB=y
CONFIG_HID_PICOLCD_BACKLIGHT=y
CONFIG_HID_PICOLCD_LCD=y
CONFIG_HID_PICOLCD_LEDS=y
+CONFIG_HID_PRIMAX=m
CONFIG_HID_QUANTA=m
CONFIG_HID_ROCCAT=m
CONFIG_HID_ROCCAT_COMMON=m
@@ -4064,18 +4133,22 @@ CONFIG_HID_ROCCAT_KOVAPLUS=m
# CONFIG_HID_ROCCAT_PYRA is not set
# CONFIG_HID_SAMSUNG is not set
CONFIG_HID_SONY=m
+CONFIG_HID_SPEEDLINK=m
# CONFIG_HID_SUNPLUS is not set
# CONFIG_HID_GREENASIA is not set
# CONFIG_HID_SMARTJOYPLUS is not set
# CONFIG_HID_TOPSEED is not set
# CONFIG_HID_THRUSTMASTER is not set
# CONFIG_HID_WACOM is not set
+# CONFIG_HID_WIIMOTE is not set
# CONFIG_HID_ZEROPLUS is not set
CONFIG_HID_ZYDACRON=m
CONFIG_USB_SUPPORT=y
+CONFIG_USB_COMMON=m
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB_ARCH_HAS_XHCI=y
CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -4088,6 +4161,7 @@ CONFIG_USB_DEVICE_CLASS=y
# 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=m
CONFIG_USB_WUSB_CBAF=m
@@ -4121,10 +4195,6 @@ CONFIG_USB_WHCI_HCD=m
CONFIG_USB_HWA_HCD=m
#
-# Enable Host or Gadget support to see Inventra options
-#
-
-#
# USB Device Class drivers
#
CONFIG_USB_ACM=m
@@ -4314,18 +4384,15 @@ CONFIG_LEDS_CLASS=y
#
CONFIG_LEDS_LM3530=m
CONFIG_LEDS_NET5501=m
-CONFIG_LEDS_ALIX2=m
CONFIG_LEDS_PCA9532=m
# CONFIG_LEDS_PCA9532_GPIO is not set
CONFIG_LEDS_GPIO=m
-CONFIG_LEDS_GPIO_PLATFORM=y
CONFIG_LEDS_LP3944=m
# CONFIG_LEDS_LP5521 is not set
# CONFIG_LEDS_LP5523 is not set
CONFIG_LEDS_CLEVO_MAIL=m
CONFIG_LEDS_PCA955X=m
CONFIG_LEDS_DAC124S085=m
-CONFIG_LEDS_REGULATOR=m
CONFIG_LEDS_BD2802=m
CONFIG_LEDS_INTEL_SS4200=m
CONFIG_LEDS_LT3593=m
@@ -4345,7 +4412,6 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
#
# iptables trigger is under Netfilter config (LED target)
#
-# CONFIG_NFC_DEVICES is not set
CONFIG_ACCESSIBILITY=y
# CONFIG_A11Y_BRAILLE_CONSOLE is not set
CONFIG_INFINIBAND=m
@@ -4476,19 +4542,18 @@ CONFIG_UIO_AEC=m
CONFIG_UIO_SERCOS3=m
CONFIG_UIO_PCI_GENERIC=m
CONFIG_UIO_NETX=m
+CONFIG_VIRTIO=m
+CONFIG_VIRTIO_RING=m
+
+#
+# Virtio drivers
+#
+CONFIG_VIRTIO_PCI=m
+CONFIG_VIRTIO_BALLOON=m
+CONFIG_VIRTIO_MMIO=m
CONFIG_STAGING=y
-CONFIG_STALLION=m
-CONFIG_ISTALLION=m
-CONFIG_DIGIEPCA=m
-CONFIG_RISCOM8=m
-CONFIG_SPECIALIX=m
-CONFIG_COMPUTONE=m
# CONFIG_ET131X is not set
# CONFIG_SLICOSS is not set
-# CONFIG_VIDEO_GO7007 is not set
-# CONFIG_VIDEO_CX25821 is not set
-# CONFIG_VIDEO_TM6000 is not set
-# CONFIG_DVB_CXD2099 is not set
CONFIG_USBIP_CORE=m
CONFIG_USBIP_VHCI_HCD=m
CONFIG_USBIP_HOST=m
@@ -4496,9 +4561,6 @@ CONFIG_USBIP_HOST=m
# CONFIG_W35UND is not set
# CONFIG_PRISM2_USB is not set
# CONFIG_ECHO is not set
-# CONFIG_BRCMUTIL is not set
-# CONFIG_BRCMSMAC is not set
-# CONFIG_BRCMFMAC is not set
# CONFIG_COMEDI is not set
# CONFIG_ASUS_OLED is not set
# CONFIG_PANEL is not set
@@ -4507,11 +4569,11 @@ CONFIG_USBIP_HOST=m
# CONFIG_RTL8192E is not set
# CONFIG_R8712U is not set
# CONFIG_RTS_PSTOR is not set
+# CONFIG_RTS5139 is not set
# CONFIG_TRANZPORT is not set
# CONFIG_POHMELFS is not set
# CONFIG_IDE_PHISON is not set
# CONFIG_LINE6_USB is not set
-CONFIG_DRM_VMWGFX=m
CONFIG_DRM_NOUVEAU=m
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
CONFIG_DRM_NOUVEAU_DEBUG=y
@@ -4525,32 +4587,22 @@ CONFIG_DRM_I2C_SIL164=m
# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
# CONFIG_VT6655 is not set
# CONFIG_VT6656 is not set
-CONFIG_HYPERV=m
CONFIG_HYPERV_STORAGE=m
-CONFIG_HYPERV_BLOCK=m
CONFIG_HYPERV_NET=m
-CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_MOUSE=m
# CONFIG_VME_BUS is not set
# CONFIG_DX_SEP is not set
# CONFIG_IIO is not set
-# CONFIG_CS5535_GPIO is not set
# CONFIG_XVMALLOC is not set
# CONFIG_ZRAM is not set
# CONFIG_WLAGS49_H2 is not set
# CONFIG_WLAGS49_H25 is not set
# CONFIG_FB_SM7XX is not set
-# CONFIG_VIDEO_DT3155 is not set
# CONFIG_CRYSTALHD is not set
# CONFIG_CXT1E1 is not set
# CONFIG_FB_XGI is not set
-# CONFIG_LIRC_STAGING is not set
-# CONFIG_EASYCAP is not set
-# CONFIG_SOLO6X10 is not set
# CONFIG_ACPI_QUICKSTART is not set
-CONFIG_MACH_NO_WESTBRIDGE=y
# CONFIG_SBE_2T3E3 is not set
-# CONFIG_ATH6K_LEGACY is not set
# CONFIG_USB_ENESTORAGE is not set
# CONFIG_BCM_WIMAX is not set
# CONFIG_FT1000 is not set
@@ -4562,12 +4614,8 @@ CONFIG_MACH_NO_WESTBRIDGE=y
# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
# CONFIG_DRM_PSB is not set
-
-#
-# Altera FPGA firmware download module
-#
-# CONFIG_ALTERA_STAPL is not set
# CONFIG_INTEL_MEI is not set
+# CONFIG_STAGING_MEDIA is not set
CONFIG_X86_PLATFORM_DEVICES=y
CONFIG_ACER_WMI=m
CONFIG_ACERHDF=m
@@ -4612,7 +4660,25 @@ CONFIG_XO15_EBOOK=m
# CONFIG_SAMSUNG_LAPTOP is not set
CONFIG_MXM_WMI=m
CONFIG_INTEL_OAKTRAIL=m
+# CONFIG_SAMSUNG_Q10 is not set
+
+#
+# Hardware Spinlock drivers
+#
CONFIG_CLKSRC_I8253=y
+CONFIG_CLKEVT_I8253=y
+CONFIG_I8253_LOCK=y
+CONFIG_CLKBLD_I8253=y
+CONFIG_IOMMU_API=y
+CONFIG_IOMMU_SUPPORT=y
+CONFIG_DMAR_TABLE=y
+CONFIG_INTEL_IOMMU=y
+# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
+CONFIG_INTEL_IOMMU_FLOPPY_WA=y
+CONFIG_VIRT_DRIVERS=y
+CONFIG_HYPERV=m
+CONFIG_HYPERV_UTILS=m
+# CONFIG_PM_DEVFREQ is not set
#
# Firmware Drivers
@@ -4726,7 +4792,7 @@ CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y
@@ -4778,9 +4844,11 @@ CONFIG_UBIFS_FS_ZLIB=y
CONFIG_LOGFS=m
CONFIG_CRAMFS=m
CONFIG_SQUASHFS=m
-# CONFIG_SQUASHFS_XATTR is not set
+CONFIG_SQUASHFS_XATTR=y
+CONFIG_SQUASHFS_ZLIB=y
# CONFIG_SQUASHFS_LZO is not set
CONFIG_SQUASHFS_XZ=y
+# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
@@ -4800,6 +4868,7 @@ CONFIG_UFS_FS=m
# CONFIG_UFS_DEBUG is not set
CONFIG_EXOFS_FS=m
# CONFIG_EXOFS_DEBUG is not set
+CONFIG_ORE=m
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
@@ -4811,7 +4880,6 @@ CONFIG_NFS_V4=y
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_USE_NEW_IDMAPPER is not set
CONFIG_NFSD=m
-CONFIG_NFSD_DEPRECATED=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
CONFIG_NFSD_V4=y
@@ -4832,7 +4900,7 @@ CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_DFS_UPCALL=y
# CONFIG_CIFS_FSCACHE is not set
-# CONFIG_CIFS_ACL 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
@@ -4860,7 +4928,7 @@ CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y
# CONFIG_SYSV68_PARTITION is not set
CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=m
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
@@ -4917,17 +4985,62 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
-# CONFIG_DEBUG_KERNEL is not set
-# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_HARDLOCKUP_DETECTOR=y
+# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_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_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# 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
+# CONFIG_DEBUG_VIRTUAL is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=60
+# CONFIG_KPROBES_SANITY_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# 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_FAULT_INJECTION is not set
+CONFIG_LATENCYTOP=y
CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
@@ -4949,14 +5062,19 @@ CONFIG_TRACING_SUPPORT=y
# CONFIG_ASYNC_RAID6_TEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_TEST_KSTRTOX=m
CONFIG_STRICT_DEVMEM=y
# CONFIG_X86_VERBOSE_BOOTUP is not set
# CONFIG_EARLY_PRINTK is not set
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_X86_PTDUMP is not set
+CONFIG_DEBUG_NX_TEST=m
CONFIG_DOUBLEFAULT=y
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+CONFIG_X86_DECODER_SELFTEST=y
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
@@ -4966,7 +5084,10 @@ CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=0
+CONFIG_DEBUG_BOOT_PARAMS=y
+# CONFIG_CPA_DEBUG is not set
# CONFIG_OPTIMIZE_INLINING is not set
+# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
#
# Security options
@@ -4996,7 +5117,7 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y
#
# Role Based Access Control Options
#
-# CONFIG_GRKERNSEC_NO_RBAC is not set
+CONFIG_GRKERNSEC_NO_RBAC=y
CONFIG_GRKERNSEC_ACL_HIDEKERN=y
CONFIG_GRKERNSEC_ACL_MAXTRIES=3
CONFIG_GRKERNSEC_ACL_TIMEOUT=30
@@ -5050,6 +5171,7 @@ CONFIG_GRKERNSEC_PROC_IPADDR=y
#
# CONFIG_GRKERNSEC_DMESG is not set
CONFIG_GRKERNSEC_HARDEN_PTRACE=y
+CONFIG_GRKERNSEC_SETXID=y
# CONFIG_GRKERNSEC_TPE is not set
#
@@ -5083,6 +5205,7 @@ CONFIG_PAX=y
CONFIG_PAX_SOFTMODE=y
# CONFIG_PAX_EI_PAX is not set
CONFIG_PAX_PT_PAX_FLAGS=y
+# CONFIG_PAX_XATTR_PAX_FLAGS is not set
# CONFIG_PAX_NO_ACL_FLAGS is not set
CONFIG_PAX_HAVE_ACL_FLAGS=y
# CONFIG_PAX_HOOK_ACL_FLAGS is not set
@@ -5098,6 +5221,7 @@ 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=""
#
# Address Space Layout Randomization
@@ -5119,13 +5243,9 @@ CONFIG_TRUSTED_KEYS=m
CONFIG_ENCRYPTED_KEYS=m
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
-CONFIG_SECURITY=y
+# CONFIG_SECURITY is not set
CONFIG_SECURITYFS=y
-# CONFIG_SECURITY_NETWORK is not set
-# CONFIG_SECURITY_PATH is not set
-# CONFIG_SECURITY_TOMOYO is not set
-# CONFIG_SECURITY_APPARMOR is not set
-# CONFIG_IMA is not set
+# CONFIG_INTEL_TXT is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_XOR_BLOCKS=m
@@ -5155,6 +5275,7 @@ CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=m
CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_USER=m
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
@@ -5217,6 +5338,7 @@ CONFIG_CRYPTO_AES_NI_INTEL=m
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_BLOWFISH_COMMON=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
@@ -5265,10 +5387,6 @@ CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_VHOST_NET=m
# CONFIG_LGUEST is not set
-CONFIG_VIRTIO=m
-CONFIG_VIRTIO_RING=m
-CONFIG_VIRTIO_PCI=m
-CONFIG_VIRTIO_BALLOON=m
# CONFIG_BINARY_PRINTF is not set
#
@@ -5284,9 +5402,10 @@ CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
+CONFIG_CRC8=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
-CONFIG_LZO_COMPRESS=m
+CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
@@ -5317,3 +5436,4 @@ CONFIG_CHECK_SIGNATURE=y
CONFIG_CPU_RMAP=y
CONFIG_NLATTR=y
CONFIG_AVERAGE=y
+CONFIG_CORDIC=m
diff --git a/main/linux-grsec/kernelconfig.x86_64 b/main/linux-grsec/kernelconfig.x86_64
index 44fb3e04be..433702e715 100644
--- a/main/linux-grsec/kernelconfig.x86_64
+++ b/main/linux-grsec/kernelconfig.x86_64
@@ -1,6 +1,6 @@
#
-# Automatically generated make config: don't edit
-# Linux/x86_64 3.0.12 Kernel Configuration
+# Automatically generated file; DO NOT EDIT.
+# Linux/x86_64 3.2.1 Kernel Configuration
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
@@ -12,6 +12,7 @@ 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
@@ -38,7 +39,6 @@ CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
-CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
@@ -97,8 +97,9 @@ CONFIG_HAVE_SPARSE_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_IRQ_FORCED_THREADING=y
-# CONFIG_SPARSE_IRQ is not set
+CONFIG_SPARSE_IRQ=y
#
# RCU Subsystem
@@ -126,6 +127,7 @@ CONFIG_RESOURCE_COUNTERS=y
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
@@ -152,11 +154,13 @@ CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
+CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
@@ -173,6 +177,7 @@ CONFIG_HAVE_PERF_EVENTS=y
#
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
# CONFIG_SLUB_DEBUG is not set
@@ -204,6 +209,7 @@ CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
#
# GCOV-based kernel profiling
@@ -221,6 +227,7 @@ CONFIG_MODVERSIONS=y
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_BSGLIB=y
# CONFIG_BLK_DEV_INTEGRITY is not set
# CONFIG_BLK_DEV_THROTTLING is not set
CONFIG_BLOCK_COMPAT=y
@@ -275,12 +282,15 @@ 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_X2APIC=y
CONFIG_X86_MPPARSE=y
CONFIG_X86_EXTENDED_PLATFORM=y
# CONFIG_X86_VSMP is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_PARAVIRT_GUEST=y
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
@@ -288,12 +298,12 @@ CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=128
CONFIG_XEN_SAVE_RESTORE=y
# CONFIG_XEN_DEBUG_FS is not set
-# CONFIG_XEN_DEBUG is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_SPINLOCKS is not set
CONFIG_PARAVIRT_CLOCK=y
+# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_NO_BOOTMEM=y
# CONFIG_MEMTEST is not set
# CONFIG_MK8 is not set
@@ -304,6 +314,7 @@ CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_CMPXCHG_LOCAL=y
+CONFIG_CMPXCHG_DOUBLE=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
@@ -321,10 +332,9 @@ CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
# CONFIG_CALGARY_IOMMU is not set
-# CONFIG_AMD_IOMMU is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
-CONFIG_IOMMU_API=y
+# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS=32
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
@@ -384,6 +394,7 @@ CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
+CONFIG_ARCH_RANDOM=y
# CONFIG_EFI is not set
# CONFIG_SECCOMP is not set
# CONFIG_CC_STACKPROTECTOR is not set
@@ -441,7 +452,7 @@ CONFIG_ACPI_SBS=m
CONFIG_ACPI_HED=m
# CONFIG_ACPI_CUSTOM_METHOD is not set
CONFIG_ACPI_APEI=y
-CONFIG_ACPI_APEI_GHES=m
+# CONFIG_ACPI_APEI_GHES is not set
CONFIG_ACPI_APEI_EINJ=m
CONFIG_ACPI_APEI_ERST_DEBUG=y
# CONFIG_SFI is not set
@@ -485,7 +496,8 @@ CONFIG_INTEL_IDLE=y
#
# Memory power savings
#
-# CONFIG_I7300_IDLE is not set
+CONFIG_I7300_IDLE_IOAT_CHANNEL=y
+CONFIG_I7300_IDLE=m
#
# Bus options (PCI etc.)
@@ -496,10 +508,6 @@ CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_XEN=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_CNB20LE_QUIRK=y
-CONFIG_DMAR=y
-# CONFIG_DMAR_DEFAULT_ON is not set
-CONFIG_DMAR_FLOPPY_WA=y
-# CONFIG_INTR_REMAP is not set
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
# CONFIG_PCIEAER is not set
@@ -507,10 +515,14 @@ CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
+# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_STUB=m
-CONFIG_XEN_PCIDEV_FRONTEND=y
+CONFIG_XEN_PCIDEV_FRONTEND=m
CONFIG_HT_IRQ=y
-# CONFIG_PCI_IOV is not set
+CONFIG_PCI_ATS=y
+CONFIG_PCI_IOV=y
+CONFIG_PCI_PRI=y
+CONFIG_PCI_PASID=y
CONFIG_PCI_IOAPIC=y
CONFIG_PCI_LABEL=y
CONFIG_ISA_DMA_API=y
@@ -647,7 +659,6 @@ CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
-CONFIG_NETLABEL=y
CONFIG_NETWORK_SECMARK=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
@@ -732,7 +743,6 @@ CONFIG_NETFILTER_XT_MATCH_DCCP=m
CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_ESP=m
-CONFIG_NETFILTER_XT_MATCH_GRADM=m
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_HL=m
@@ -771,6 +781,7 @@ CONFIG_IP_SET_HASH_IPPORTIP=m
CONFIG_IP_SET_HASH_IPPORTNET=m
CONFIG_IP_SET_HASH_NET=m
CONFIG_IP_SET_HASH_NETPORT=m
+CONFIG_IP_SET_HASH_NETIFACE=m
CONFIG_IP_SET_LIST_SET=m
CONFIG_IP_VS=m
CONFIG_IP_VS_IPV6=y
@@ -845,7 +856,6 @@ CONFIG_IP_NF_TARGET_CLUSTERIP=m
CONFIG_IP_NF_TARGET_ECN=m
CONFIG_IP_NF_TARGET_TTL=m
CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_SECURITY=m
CONFIG_IP_NF_ARPTABLES=m
CONFIG_IP_NF_ARPFILTER=m
CONFIG_IP_NF_ARP_MANGLE=m
@@ -871,7 +881,6 @@ CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_MANGLE=m
CONFIG_IP6_NF_RAW=m
-CONFIG_IP6_NF_SECURITY=m
#
# DECnet: Netfilter Configuration
@@ -909,6 +918,12 @@ CONFIG_INET_DCCP_DIAG=m
CONFIG_IP_DCCP_CCID3=y
# CONFIG_IP_DCCP_CCID3_DEBUG is not set
CONFIG_IP_DCCP_TFRC_LIB=y
+
+#
+# DCCP Kernel Hacking
+#
+# CONFIG_IP_DCCP_DEBUG is not set
+# CONFIG_NET_DCCPPROBE is not set
CONFIG_IP_SCTP=m
CONFIG_NET_SCTPPROBE=m
# CONFIG_SCTP_DBG_MSG is not set
@@ -957,6 +972,7 @@ CONFIG_LAPB=m
CONFIG_WAN_ROUTER=m
CONFIG_PHONET=m
CONFIG_IEEE802154=m
+CONFIG_IEEE802154_6LOWPAN=m
CONFIG_NET_SCHED=y
#
@@ -1032,35 +1048,7 @@ CONFIG_BPF_JIT=y
CONFIG_NET_PKTGEN=m
CONFIG_NET_TCPPROBE=m
# CONFIG_HAMRADIO is not set
-CONFIG_CAN=m
-CONFIG_CAN_RAW=m
-CONFIG_CAN_BCM=m
-
-#
-# CAN Device Drivers
-#
-CONFIG_CAN_VCAN=m
-CONFIG_CAN_SLCAN=m
-CONFIG_CAN_DEV=m
-# CONFIG_CAN_CALC_BITTIMING is not set
-CONFIG_CAN_MCP251X=m
-CONFIG_CAN_JANZ_ICAN3=m
-# CONFIG_PCH_CAN is not set
-CONFIG_CAN_SJA1000=m
-CONFIG_CAN_SJA1000_PLATFORM=m
-CONFIG_CAN_EMS_PCI=m
-CONFIG_CAN_KVASER_PCI=m
-CONFIG_CAN_PLX_PCI=m
-# CONFIG_CAN_C_CAN is not set
-
-#
-# CAN USB interfaces
-#
-# CONFIG_CAN_EMS_USB is not set
-# CONFIG_CAN_ESD_USB2 is not set
-CONFIG_CAN_SOFTING=m
-CONFIG_CAN_SOFTING_CS=m
-# CONFIG_CAN_DEBUG_DEVICES is not set
+# CONFIG_CAN is not set
CONFIG_IRDA=m
#
@@ -1146,7 +1134,8 @@ CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
-# CONFIG_BT_MRVL is not set
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
CONFIG_BT_ATH3K=m
CONFIG_BT_WILINK=m
CONFIG_AF_RXRPC=m
@@ -1190,16 +1179,15 @@ CONFIG_WIMAX_DEBUG_LEVEL=8
CONFIG_RFKILL=m
CONFIG_RFKILL_LEDS=y
# CONFIG_RFKILL_INPUT is not set
-CONFIG_RFKILL_REGULATOR=m
CONFIG_NET_9P=m
CONFIG_NET_9P_VIRTIO=m
CONFIG_NET_9P_RDMA=m
# CONFIG_NET_9P_DEBUG is not set
-CONFIG_CAIF=m
-# CONFIG_CAIF_DEBUG is not set
-CONFIG_CAIF_NETDEV=m
+# CONFIG_CAIF is not set
CONFIG_CEPH_LIB=m
# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
+# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set
+# CONFIG_NFC is not set
#
# Device Drivers
@@ -1215,10 +1203,14 @@ CONFIG_STANDALONE=y
CONFIG_FW_LOADER=m
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+CONFIG_DEBUG_DEVRES=y
CONFIG_SYS_HYPERVISOR=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=m
+CONFIG_REGMAP_SPI=m
CONFIG_CONNECTOR=m
CONFIG_MTD=m
-# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_TESTS=m
CONFIG_MTD_REDBOOT_PARTS=m
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
@@ -1319,6 +1311,7 @@ CONFIG_MTD_BLOCK2MTD=m
CONFIG_MTD_DOC2000=m
CONFIG_MTD_DOC2001=m
CONFIG_MTD_DOC2001PLUS=m
+# CONFIG_MTD_DOCG3 is not set
CONFIG_MTD_DOCPROBE=m
CONFIG_MTD_DOCECC=m
CONFIG_MTD_DOCPROBE_ADVANCED=y
@@ -1388,6 +1381,7 @@ CONFIG_BLK_DEV_DAC960=m
CONFIG_BLK_DEV_UMEM=m
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
CONFIG_BLK_DEV_CRYPTOLOOP=m
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=m
@@ -1437,6 +1431,7 @@ CONFIG_TI_DAC7512=m
CONFIG_VMWARE_BALLOON=m
CONFIG_BMP085=m
CONFIG_PCH_PHUB=m
+# CONFIG_USB_SWITCH_FSA9480 is not set
CONFIG_C2PORT=m
CONFIG_C2PORT_DURAMAR_2150=m
@@ -1448,6 +1443,7 @@ CONFIG_EEPROM_AT25=m
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
+CONFIG_EEPROM_93XX46=m
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
@@ -1460,6 +1456,11 @@ CONFIG_IWMC3200TOP=m
#
CONFIG_TI_ST=m
CONFIG_SENSORS_LIS3_I2C=m
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set
@@ -1511,7 +1512,7 @@ CONFIG_SCSI_CXGB3_ISCSI=m
CONFIG_SCSI_CXGB4_ISCSI=m
CONFIG_SCSI_BNX2_ISCSI=m
CONFIG_SCSI_BNX2X_FCOE=m
-# CONFIG_BE2ISCSI is not set
+CONFIG_BE2ISCSI=m
CONFIG_BLK_DEV_3W_XXXX_RAID=m
CONFIG_SCSI_HPSA=m
CONFIG_SCSI_3W_9XXX=m
@@ -1537,6 +1538,8 @@ CONFIG_SCSI_AIC94XX=m
# CONFIG_AIC94XX_DEBUG is not set
CONFIG_SCSI_MVSAS=m
CONFIG_SCSI_MVSAS_DEBUG=y
+CONFIG_SCSI_MVSAS_TASKLET=y
+CONFIG_SCSI_MVUMI=m
CONFIG_SCSI_DPT_I2O=m
CONFIG_SCSI_ADVANSYS=m
CONFIG_SCSI_ARCMSR=m
@@ -1566,10 +1569,8 @@ CONFIG_SCSI_ISCI=m
CONFIG_SCSI_IPS=m
CONFIG_SCSI_INITIO=m
CONFIG_SCSI_INIA100=m
-CONFIG_SCSI_PPA=m
-CONFIG_SCSI_IMM=m
-# CONFIG_SCSI_IZIP_EPP16 is not set
-# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+# CONFIG_SCSI_PPA is not set
+# CONFIG_SCSI_IMM is not set
CONFIG_SCSI_STEX=m
CONFIG_SCSI_SYM53C8XX_2=m
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
@@ -1591,11 +1592,7 @@ CONFIG_SCSI_DEBUG=m
CONFIG_SCSI_PM8001=m
CONFIG_SCSI_SRP=m
# CONFIG_SCSI_BFA_FC is not set
-CONFIG_SCSI_LOWLEVEL_PCMCIA=y
-CONFIG_PCMCIA_AHA152X=m
-CONFIG_PCMCIA_FDOMAIN=m
-CONFIG_PCMCIA_QLOGIC=m
-CONFIG_PCMCIA_SYM53C500=m
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
CONFIG_SCSI_DH=m
CONFIG_SCSI_DH_RDAC=m
CONFIG_SCSI_DH_HP_SW=m
@@ -1716,8 +1713,13 @@ 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_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_MIRROR=m
CONFIG_DM_RAID=m
CONFIG_DM_LOG_USERSPACE=m
@@ -1733,8 +1735,8 @@ CONFIG_TCM_IBLOCK=m
CONFIG_TCM_FILEIO=m
CONFIG_TCM_PSCSI=m
CONFIG_LOOPBACK_TARGET=m
-# CONFIG_LOOPBACK_TARGET_CDB_DEBUG is not set
CONFIG_TCM_FC=m
+CONFIG_ISCSI_TARGET=m
CONFIG_FUSION=y
CONFIG_FUSION_SPI=m
CONFIG_FUSION_FC=m
@@ -1764,15 +1766,26 @@ CONFIG_I2O_SCSI=m
CONFIG_I2O_PROC=m
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
-CONFIG_IFB=m
-CONFIG_DUMMY=m
+CONFIG_NET_CORE=y
CONFIG_BONDING=m
+CONFIG_DUMMY=m
+CONFIG_EQUALIZER=m
+# CONFIG_NET_FC is not set
+CONFIG_MII=m
+CONFIG_IEEE802154_DRIVERS=m
+CONFIG_IEEE802154_FAKEHARD=m
+CONFIG_IFB=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
-CONFIG_EQUALIZER=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=m
CONFIG_VETH=m
-CONFIG_NET_SB1000=m
+CONFIG_VIRTIO_NET=m
+CONFIG_SUNGEM_PHY=m
CONFIG_ARCNET=m
CONFIG_ARCNET_1201=m
CONFIG_ARCNET_1051=m
@@ -1783,39 +1796,83 @@ CONFIG_ARCNET_COM90xxIO=m
CONFIG_ARCNET_RIM_I=m
CONFIG_ARCNET_COM20020=m
CONFIG_ARCNET_COM20020_PCI=m
-CONFIG_MII=m
-CONFIG_PHYLIB=m
+CONFIG_ARCNET_COM20020_CS=m
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_DUMMY=m
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_NICSTAR=m
+# CONFIG_ATM_NICSTAR_USE_SUNI is not set
+# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_IA=m
+# CONFIG_ATM_IA_DEBUG is not set
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_FORE200E_USE_TASKLET=y
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_ATM_SOLOS=m
#
-# MII PHY device drivers
+# CAIF transport drivers
#
-CONFIG_MARVELL_PHY=m
-CONFIG_DAVICOM_PHY=m
-CONFIG_QSEMI_PHY=m
-CONFIG_LXT_PHY=m
-CONFIG_CICADA_PHY=m
-CONFIG_VITESSE_PHY=m
-CONFIG_SMSC_PHY=m
-CONFIG_BROADCOM_PHY=m
-CONFIG_ICPLUS_PHY=m
-CONFIG_REALTEK_PHY=m
-CONFIG_NATIONAL_PHY=m
-CONFIG_STE10XP=m
-CONFIG_LSI_ET1011C_PHY=m
-CONFIG_MICREL_PHY=m
-CONFIG_MDIO_BITBANG=m
-CONFIG_MDIO_GPIO=m
-CONFIG_NET_ETHERNET=y
-CONFIG_HAPPYMEAL=m
-CONFIG_SUNGEM=m
-CONFIG_CASSINI=m
+CONFIG_ETHERNET=y
+CONFIG_MDIO=m
CONFIG_NET_VENDOR_3COM=y
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_3C589=m
CONFIG_VORTEX=m
CONFIG_TYPHOON=m
-CONFIG_ENC28J60=m
-# CONFIG_ENC28J60_WRITEVERIFY is not set
-CONFIG_ETHOC=m
+CONFIG_NET_VENDOR_ADAPTEC=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_NET_VENDOR_ALTEON=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_NET_VENDOR_AMD=y
+CONFIG_AMD8111_ETH=m
+CONFIG_PCNET32=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_NET_VENDOR_ATHEROS=y
+CONFIG_ATL2=m
+CONFIG_ATL1=m
+CONFIG_ATL1E=m
+CONFIG_ATL1C=m
+CONFIG_NET_VENDOR_BROADCOM=y
+CONFIG_B44=m
+CONFIG_B44_PCI_AUTOSELECT=y
+CONFIG_B44_PCICORE_AUTOSELECT=y
+CONFIG_B44_PCI=y
+CONFIG_BNX2=m
+CONFIG_CNIC=m
+CONFIG_TIGON3=m
+CONFIG_BNX2X=m
+CONFIG_NET_VENDOR_BROCADE=y
+CONFIG_BNA=m
+CONFIG_NET_VENDOR_CHELSIO=y
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T3=m
+CONFIG_CHELSIO_T4=m
+CONFIG_CHELSIO_T4VF=m
+CONFIG_NET_VENDOR_CISCO=y
+CONFIG_ENIC=m
CONFIG_DNET=m
+CONFIG_NET_VENDOR_DEC=y
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_DE2104X_DSL=0
@@ -1828,115 +1885,209 @@ CONFIG_WINBOND_840=m
CONFIG_DM9102=m
CONFIG_ULI526X=m
CONFIG_PCMCIA_XIRCOM=m
-CONFIG_HP100=m
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
-# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
-# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
-CONFIG_NET_PCI=y
-CONFIG_PCNET32=m
-CONFIG_AMD8111_ETH=m
-CONFIG_ADAPTEC_STARFIRE=m
-CONFIG_KSZ884X_PCI=m
-CONFIG_B44=m
-CONFIG_B44_PCI_AUTOSELECT=y
-CONFIG_B44_PCICORE_AUTOSELECT=y
-CONFIG_B44_PCI=y
-CONFIG_FORCEDETH=m
-CONFIG_E100=m
-CONFIG_FEALNX=m
-CONFIG_NATSEMI=m
-CONFIG_NE2K_PCI=m
-CONFIG_8139CP=m
-CONFIG_8139TOO=m
-CONFIG_8139TOO_PIO=y
-# CONFIG_8139TOO_TUNE_TWISTER is not set
-# CONFIG_8139TOO_8129 is not set
-# CONFIG_8139_OLD_RX_RESET is not set
-CONFIG_R6040=m
-CONFIG_SIS900=m
-CONFIG_EPIC100=m
-CONFIG_SMSC9420=m
-CONFIG_SUNDANCE=m
-# CONFIG_SUNDANCE_MMIO is not set
-CONFIG_TLAN=m
-CONFIG_KS8842=m
-CONFIG_KS8851=m
-CONFIG_KS8851_MLL=m
-CONFIG_VIA_RHINE=m
-# CONFIG_VIA_RHINE_MMIO is not set
-CONFIG_SC92031=m
-CONFIG_NET_POCKET=y
-CONFIG_ATP=m
+CONFIG_NET_VENDOR_DLINK=y
CONFIG_DE600=m
CONFIG_DE620=m
-CONFIG_ATL2=m
-CONFIG_NETDEV_1000=y
-CONFIG_ACENIC=m
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
CONFIG_DL2K=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_NET_VENDOR_EMULEX=y
+CONFIG_BE2NET=m
+CONFIG_NET_VENDOR_EXAR=y
+CONFIG_S2IO=m
+CONFIG_VXGE=m
+# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
+CONFIG_NET_VENDOR_FUJITSU=y
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_NET_VENDOR_HP=y
+CONFIG_HP100=m
+CONFIG_NET_VENDOR_INTEL=y
+CONFIG_E100=m
CONFIG_E1000=m
CONFIG_E1000E=m
-CONFIG_IP1000=m
CONFIG_IGB=m
CONFIG_IGB_DCA=y
CONFIG_IGBVF=m
-CONFIG_NS83820=m
-CONFIG_HAMACHI=m
-CONFIG_YELLOWFIN=m
-CONFIG_R8169=m
-CONFIG_SIS190=m
+CONFIG_IXGB=m
+CONFIG_IXGBE=m
+CONFIG_IXGBE_DCA=y
+# CONFIG_IXGBEVF is not set
+CONFIG_NET_VENDOR_I825XX=y
+# CONFIG_ZNET is not set
+CONFIG_IP1000=m
+CONFIG_JME=m
+CONFIG_NET_VENDOR_MARVELL=y
CONFIG_SKGE=m
# CONFIG_SKGE_DEBUG is not set
+CONFIG_SKGE_GENESIS=y
CONFIG_SKY2=m
# CONFIG_SKY2_DEBUG is not set
-CONFIG_VIA_VELOCITY=m
-CONFIG_TIGON3=m
-CONFIG_BNX2=m
-CONFIG_CNIC=m
-CONFIG_QLA3XXX=m
-CONFIG_ATL1=m
-CONFIG_ATL1E=m
-CONFIG_ATL1C=m
-CONFIG_JME=m
-CONFIG_STMMAC_ETH=m
-# CONFIG_STMMAC_DA is not set
-# CONFIG_STMMAC_DUAL_MAC is not set
-CONFIG_PCH_GBE=m
-CONFIG_NETDEV_10000=y
-CONFIG_MDIO=m
-CONFIG_CHELSIO_T1=m
-CONFIG_CHELSIO_T1_1G=y
-CONFIG_CHELSIO_T3=m
-CONFIG_CHELSIO_T4=m
-CONFIG_CHELSIO_T4VF=m
-CONFIG_ENIC=m
-CONFIG_IXGBE=m
-CONFIG_IXGBE_DCA=y
-# CONFIG_IXGBEVF is not set
-CONFIG_IXGB=m
-CONFIG_S2IO=m
-CONFIG_VXGE=m
-# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
-CONFIG_MYRI10GE=m
-CONFIG_MYRI10GE_DCA=y
-CONFIG_NETXEN_NIC=m
-CONFIG_NIU=m
+CONFIG_NET_VENDOR_MELLANOX=y
CONFIG_MLX4_EN=m
CONFIG_MLX4_CORE=m
CONFIG_MLX4_DEBUG=y
-CONFIG_TEHUTI=m
-CONFIG_BNX2X=m
+CONFIG_NET_VENDOR_MICREL=y
+CONFIG_KS8842=m
+CONFIG_KS8851=m
+CONFIG_KS8851_MLL=m
+CONFIG_KSZ884X_PCI=m
+CONFIG_NET_VENDOR_MICROCHIP=y
+CONFIG_ENC28J60=m
+# CONFIG_ENC28J60_WRITEVERIFY is not set
+CONFIG_NET_VENDOR_MYRI=y
+CONFIG_MYRI10GE=m
+CONFIG_MYRI10GE_DCA=y
+CONFIG_FEALNX=m
+CONFIG_NET_VENDOR_NATSEMI=y
+CONFIG_NATSEMI=m
+CONFIG_NS83820=m
+CONFIG_NET_VENDOR_8390=y
+CONFIG_PCMCIA_AXNET=m
+CONFIG_NE2K_PCI=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_NET_VENDOR_NVIDIA=y
+CONFIG_FORCEDETH=m
+CONFIG_NET_VENDOR_OKI=y
+CONFIG_PCH_GBE=m
+CONFIG_ETHOC=m
+CONFIG_NET_PACKET_ENGINE=y
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_NET_VENDOR_QLOGIC=y
+CONFIG_QLA3XXX=m
CONFIG_QLCNIC=m
CONFIG_QLGE=m
-CONFIG_BNA=m
+CONFIG_NETXEN_NIC=m
+CONFIG_NET_VENDOR_REALTEK=y
+CONFIG_ATP=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_R8169=m
+CONFIG_NET_VENDOR_RDC=y
+CONFIG_R6040=m
+CONFIG_NET_VENDOR_SEEQ=y
+CONFIG_SEEQ8005=m
+CONFIG_NET_VENDOR_SILAN=y
+CONFIG_SC92031=m
+CONFIG_NET_VENDOR_SIS=y
+CONFIG_SIS900=m
+CONFIG_SIS190=m
CONFIG_SFC=m
CONFIG_SFC_MTD=y
-CONFIG_BE2NET=m
+CONFIG_NET_VENDOR_SMSC=y
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_EPIC100=m
+CONFIG_SMSC9420=m
+CONFIG_NET_VENDOR_STMICRO=y
+CONFIG_STMMAC_ETH=m
+# CONFIG_STMMAC_DEBUG_FS is not set
+# CONFIG_STMMAC_DA is not set
+CONFIG_STMMAC_RING=y
+# CONFIG_STMMAC_CHAINED is not set
+CONFIG_NET_VENDOR_SUN=y
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_CASSINI=m
+CONFIG_NIU=m
+CONFIG_NET_VENDOR_TEHUTI=y
+CONFIG_TEHUTI=m
+CONFIG_NET_VENDOR_TI=y
+CONFIG_TLAN=m
+CONFIG_NET_VENDOR_VIA=y
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_VIA_VELOCITY=m
+CONFIG_NET_VENDOR_XIRCOM=y
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+# CONFIG_DEFXX_MMIO is not set
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_NET_SB1000=m
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+CONFIG_VITESSE_PHY=m
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+CONFIG_ICPLUS_PHY=m
+CONFIG_REALTEK_PHY=m
+CONFIG_NATIONAL_PHY=m
+CONFIG_STE10XP=m
+CONFIG_LSI_ET1011C_PHY=m
+CONFIG_MICREL_PHY=m
+CONFIG_MDIO_BITBANG=m
+CONFIG_MDIO_GPIO=m
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_MPPE=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPPOATM=m
+CONFIG_PPPOE=m
+CONFIG_PPTP=m
+CONFIG_PPPOL2TP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_SLIP=m
+CONFIG_SLHC=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
# CONFIG_TR is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_CDC_EEM=m
+CONFIG_USB_NET_CDC_NCM=m
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_NET_CX82310_ETH=m
+CONFIG_USB_NET_KALMIA=m
+CONFIG_USB_HSO=m
+CONFIG_USB_NET_INT51X1=m
+CONFIG_USB_CDC_PHONET=m
+CONFIG_USB_IPHETH=m
+CONFIG_USB_SIERRA_NET=m
+CONFIG_USB_VL600=m
CONFIG_WLAN=y
CONFIG_PCMCIA_RAYCS=m
CONFIG_LIBERTAS_THINFIRM=m
@@ -1975,7 +2126,11 @@ CONFIG_ATH9K_HTC=m
CONFIG_CARL9170=m
CONFIG_CARL9170_LEDS=y
CONFIG_CARL9170_WPC=y
+CONFIG_CARL9170_HWRNG=y
+CONFIG_ATH6KL=m
+CONFIG_ATH6KL_DEBUG=y
CONFIG_B43=m
+CONFIG_B43_SSB=y
CONFIG_B43_PCI_AUTOSELECT=y
CONFIG_B43_PCICORE_AUTOSELECT=y
CONFIG_B43_PCMCIA=y
@@ -1983,6 +2138,7 @@ CONFIG_B43_SDIO=y
CONFIG_B43_PIO=y
CONFIG_B43_PHY_N=y
CONFIG_B43_PHY_LP=y
+CONFIG_B43_PHY_HT=y
CONFIG_B43_LEDS=y
CONFIG_B43_HWRNG=y
# CONFIG_B43_DEBUG is not set
@@ -1997,6 +2153,8 @@ CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
# CONFIG_B43LEGACY_DMA_MODE is not set
# CONFIG_B43LEGACY_PIO_MODE is not set
+# CONFIG_BRCMSMAC is not set
+# CONFIG_BRCMFMAC is not set
CONFIG_HOSTAP=m
CONFIG_HOSTAP_FIRMWARE=y
CONFIG_HOSTAP_FIRMWARE_NVRAM=y
@@ -2014,14 +2172,13 @@ CONFIG_IPW2200_QOS=y
# CONFIG_IPW2200_DEBUG is not set
CONFIG_LIBIPW=m
# CONFIG_LIBIPW_DEBUG is not set
-CONFIG_IWLAGN=m
+CONFIG_IWLWIFI=m
#
# Debugging Options
#
# CONFIG_IWLWIFI_DEBUG is not set
# CONFIG_IWLWIFI_DEVICE_SVTOOL is not set
-# CONFIG_IWL_P2P is not set
CONFIG_IWLWIFI_LEGACY=m
#
@@ -2079,6 +2236,7 @@ CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG is not set
CONFIG_RTL8192CE=m
CONFIG_RTL8192SE=m
+CONFIG_RTL8192DE=m
CONFIG_RTL8192CU=m
CONFIG_RTLWIFI=m
CONFIG_RTL8192C_COMMON=m
@@ -2087,7 +2245,6 @@ CONFIG_WL1251_SPI=m
CONFIG_WL1251_SDIO=m
CONFIG_WL12XX_MENU=m
CONFIG_WL12XX=m
-CONFIG_WL12XX_HT=y
CONFIG_WL12XX_SPI=m
CONFIG_WL12XX_SDIO=m
CONFIG_WL12XX_SDIO_TEST=m
@@ -2096,6 +2253,7 @@ CONFIG_ZD1211RW=m
# CONFIG_ZD1211RW_DEBUG is not set
CONFIG_MWIFIEX=m
CONFIG_MWIFIEX_SDIO=m
+CONFIG_MWIFIEX_PCIE=m
#
# WiMAX Wireless Broadband devices
@@ -2105,53 +2263,6 @@ CONFIG_WIMAX_I2400M_USB=m
CONFIG_WIMAX_I2400M_SDIO=m
CONFIG_WIMAX_IWMC3200_SDIO=y
CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8
-
-#
-# USB Network Adapters
-#
-CONFIG_USB_CATC=m
-CONFIG_USB_KAWETH=m
-CONFIG_USB_PEGASUS=m
-CONFIG_USB_RTL8150=m
-CONFIG_USB_USBNET=m
-CONFIG_USB_NET_AX8817X=m
-CONFIG_USB_NET_CDCETHER=m
-CONFIG_USB_NET_CDC_EEM=m
-CONFIG_USB_NET_CDC_NCM=m
-CONFIG_USB_NET_DM9601=m
-CONFIG_USB_NET_SMSC75XX=m
-CONFIG_USB_NET_SMSC95XX=m
-CONFIG_USB_NET_GL620A=m
-CONFIG_USB_NET_NET1080=m
-CONFIG_USB_NET_PLUSB=m
-CONFIG_USB_NET_MCS7830=m
-CONFIG_USB_NET_RNDIS_HOST=m
-CONFIG_USB_NET_CDC_SUBSET=m
-CONFIG_USB_ALI_M5632=y
-CONFIG_USB_AN2720=y
-CONFIG_USB_BELKIN=y
-CONFIG_USB_ARMLINUX=y
-CONFIG_USB_EPSON2888=y
-CONFIG_USB_KC2190=y
-CONFIG_USB_NET_ZAURUS=m
-CONFIG_USB_NET_CX82310_ETH=m
-CONFIG_USB_NET_KALMIA=m
-CONFIG_USB_HSO=m
-CONFIG_USB_NET_INT51X1=m
-CONFIG_USB_CDC_PHONET=m
-CONFIG_USB_IPHETH=m
-CONFIG_USB_SIERRA_NET=m
-CONFIG_USB_VL600=m
-CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_3C589=m
-CONFIG_PCMCIA_3C574=m
-CONFIG_PCMCIA_FMVJ18X=m
-CONFIG_PCMCIA_PCNET=m
-CONFIG_PCMCIA_NMCLAN=m
-CONFIG_PCMCIA_SMC91C92=m
-CONFIG_PCMCIA_XIRC2PS=m
-CONFIG_PCMCIA_AXNET=m
-CONFIG_ARCNET_COM20020_CS=m
CONFIG_WAN=y
CONFIG_LANMEDIA=m
CONFIG_HDLC=m
@@ -2178,79 +2289,8 @@ CONFIG_LAPBETHER=m
CONFIG_X25_ASY=m
CONFIG_SBNI=m
CONFIG_SBNI_MULTILINE=y
-CONFIG_ATM_DRIVERS=y
-CONFIG_ATM_DUMMY=m
-CONFIG_ATM_TCP=m
-CONFIG_ATM_LANAI=m
-CONFIG_ATM_ENI=m
-# CONFIG_ATM_ENI_DEBUG is not set
-# CONFIG_ATM_ENI_TUNE_BURST is not set
-CONFIG_ATM_FIRESTREAM=m
-CONFIG_ATM_ZATM=m
-# CONFIG_ATM_ZATM_DEBUG is not set
-CONFIG_ATM_NICSTAR=m
-# CONFIG_ATM_NICSTAR_USE_SUNI is not set
-# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
-CONFIG_ATM_IDT77252=m
-# CONFIG_ATM_IDT77252_DEBUG is not set
-# CONFIG_ATM_IDT77252_RCV_ALL is not set
-CONFIG_ATM_IDT77252_USE_SUNI=y
-CONFIG_ATM_AMBASSADOR=m
-# CONFIG_ATM_AMBASSADOR_DEBUG is not set
-CONFIG_ATM_HORIZON=m
-# CONFIG_ATM_HORIZON_DEBUG is not set
-CONFIG_ATM_IA=m
-# CONFIG_ATM_IA_DEBUG is not set
-CONFIG_ATM_FORE200E=m
-CONFIG_ATM_FORE200E_USE_TASKLET=y
-CONFIG_ATM_FORE200E_TX_RETRY=16
-CONFIG_ATM_FORE200E_DEBUG=0
-CONFIG_ATM_HE=m
-CONFIG_ATM_HE_USE_SUNI=y
-CONFIG_ATM_SOLOS=m
-CONFIG_IEEE802154_DRIVERS=m
-CONFIG_IEEE802154_FAKEHARD=m
-
-#
-# CAIF transport drivers
-#
-CONFIG_CAIF_TTY=m
-CONFIG_CAIF_SPI_SLAVE=m
-# CONFIG_CAIF_SPI_SYNC is not set
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_XEN_NETDEV_BACKEND=m
-CONFIG_FDDI=y
-CONFIG_DEFXX=m
-# CONFIG_DEFXX_MMIO is not set
-CONFIG_SKFP=m
-CONFIG_HIPPI=y
-CONFIG_ROADRUNNER=m
-# CONFIG_ROADRUNNER_LARGE_RINGS is not set
-CONFIG_PLIP=m
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPP_MPPE=m
-CONFIG_PPPOE=m
-CONFIG_PPTP=m
-CONFIG_PPPOATM=m
-CONFIG_PPPOL2TP=m
-CONFIG_SLIP=m
-CONFIG_SLIP_COMPRESSED=y
-CONFIG_SLHC=m
-CONFIG_SLIP_SMART=y
-CONFIG_SLIP_MODE_SLIP6=y
-# CONFIG_NET_FC is not set
-CONFIG_NETCONSOLE=m
-CONFIG_NETCONSOLE_DYNAMIC=y
-CONFIG_NETPOLL=y
-# CONFIG_NETPOLL_TRAP is not set
-CONFIG_NET_POLL_CONTROLLER=y
-CONFIG_VIRTIO_NET=m
CONFIG_VMXNET3=m
CONFIG_ISDN=y
# CONFIG_ISDN_I4L is not set
@@ -2412,6 +2452,7 @@ CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_USB_NEXIO=y
CONFIG_TOUCHSCREEN_TOUCHIT213=m
+CONFIG_TOUCHSCREEN_TSC_SERIO=m
# CONFIG_TOUCHSCREEN_TSC2005 is not set
CONFIG_TOUCHSCREEN_TSC2007=m
CONFIG_TOUCHSCREEN_ST1232=m
@@ -2420,12 +2461,17 @@ CONFIG_INPUT_MISC=y
CONFIG_INPUT_AD714X=m
CONFIG_INPUT_AD714X_I2C=m
CONFIG_INPUT_AD714X_SPI=m
+# CONFIG_INPUT_BMA150 is not set
CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_MC13783_PWRBUTTON is not set
+CONFIG_INPUT_MMA8450=m
+CONFIG_INPUT_MPU3050=m
CONFIG_INPUT_APANEL=m
CONFIG_INPUT_ATLAS_BTNS=m
-CONFIG_INPUT_ATI_REMOTE=m
CONFIG_INPUT_ATI_REMOTE2=m
CONFIG_INPUT_KEYSPAN_REMOTE=m
+CONFIG_INPUT_KXTJ9=m
+# CONFIG_INPUT_KXTJ9_POLLED_MODE is not set
CONFIG_INPUT_POWERMATE=m
CONFIG_INPUT_YEALINK=m
CONFIG_INPUT_CM109=m
@@ -2461,6 +2507,7 @@ CONFIG_SERIO_PS2MULT=m
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
@@ -2611,6 +2658,7 @@ CONFIG_I2C_SCMI=m
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
+# CONFIG_I2C_DESIGNWARE_PCI is not set
CONFIG_I2C_GPIO=m
CONFIG_I2C_INTEL_MID=m
CONFIG_I2C_OCORES=m
@@ -2637,6 +2685,7 @@ CONFIG_I2C_STUB=m
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
#
@@ -2678,14 +2727,14 @@ CONFIG_SPI_TLE62X0=m
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
CONFIG_GPIO_MAX730X=m
#
# Memory mapped GPIO drivers:
#
-CONFIG_GPIO_BASIC_MMIO_CORE=m
-CONFIG_GPIO_BASIC_MMIO=m
+# CONFIG_GPIO_GENERIC_PLATFORM is not set
CONFIG_GPIO_IT8761E=m
CONFIG_GPIO_SCH=m
CONFIG_GPIO_VX855=m
@@ -2726,48 +2775,21 @@ CONFIG_GPIO_74X164=m
# MODULbus GPIO expanders:
#
CONFIG_GPIO_JANZ_TTL=m
-CONFIG_W1=m
-CONFIG_W1_CON=y
-
-#
-# 1-wire Bus Masters
-#
-CONFIG_W1_MASTER_MATROX=m
-CONFIG_W1_MASTER_DS2490=m
-CONFIG_W1_MASTER_DS2482=m
-CONFIG_W1_MASTER_DS1WM=m
-CONFIG_W1_MASTER_GPIO=m
-
-#
-# 1-wire Slaves
-#
-CONFIG_W1_SLAVE_THERM=m
-CONFIG_W1_SLAVE_SMEM=m
-CONFIG_W1_SLAVE_DS2408=m
-CONFIG_W1_SLAVE_DS2423=m
-CONFIG_W1_SLAVE_DS2431=m
-CONFIG_W1_SLAVE_DS2433=m
-# CONFIG_W1_SLAVE_DS2433_CRC is not set
-CONFIG_W1_SLAVE_DS2760=m
-CONFIG_W1_SLAVE_DS2780=m
-CONFIG_W1_SLAVE_BQ27000=m
-CONFIG_POWER_SUPPLY=y
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
# CONFIG_POWER_SUPPLY_DEBUG is not set
-CONFIG_PDA_POWER=m
-CONFIG_TEST_POWER=m
-CONFIG_BATTERY_DS2760=m
-CONFIG_BATTERY_DS2780=m
-CONFIG_BATTERY_DS2782=m
-CONFIG_BATTERY_BQ20Z75=m
-CONFIG_BATTERY_BQ27x00=m
-# CONFIG_BATTERY_BQ27X00_I2C is not set
-# CONFIG_BATTERY_BQ27X00_PLATFORM is not set
-CONFIG_BATTERY_MAX17040=m
-CONFIG_BATTERY_MAX17042=m
-CONFIG_CHARGER_PCF50633=m
-CONFIG_CHARGER_ISP1704=m
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_PCF50633 is not set
+# CONFIG_CHARGER_ISP1704 is not set
# CONFIG_CHARGER_MAX8903 is not set
-CONFIG_CHARGER_GPIO=m
+# CONFIG_CHARGER_GPIO is not set
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set
@@ -2777,6 +2799,7 @@ CONFIG_HWMON_VID=m
#
CONFIG_SENSORS_ABITUGURU=m
CONFIG_SENSORS_ABITUGURU3=m
+CONFIG_SENSORS_AD7314=m
CONFIG_SENSORS_AD7414=m
CONFIG_SENSORS_AD7418=m
CONFIG_SENSORS_ADCXX=m
@@ -2831,23 +2854,29 @@ CONFIG_SENSORS_LTC4215=m
CONFIG_SENSORS_LTC4245=m
CONFIG_SENSORS_LTC4261=m
CONFIG_SENSORS_LM95241=m
+CONFIG_SENSORS_LM95245=m
CONFIG_SENSORS_MAX1111=m
CONFIG_SENSORS_MAX16065=m
CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_MAX1668=m
CONFIG_SENSORS_MAX6639=m
CONFIG_SENSORS_MAX6642=m
CONFIG_SENSORS_MAX6650=m
+CONFIG_SENSORS_NTC_THERMISTOR=m
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_PC87427=m
CONFIG_SENSORS_PCF8591=m
CONFIG_PMBUS=m
CONFIG_SENSORS_PMBUS=m
CONFIG_SENSORS_ADM1275=m
+CONFIG_SENSORS_LM25066=m
+CONFIG_SENSORS_LTC2978=m
CONFIG_SENSORS_MAX16064=m
CONFIG_SENSORS_MAX34440=m
CONFIG_SENSORS_MAX8688=m
CONFIG_SENSORS_UCD9000=m
CONFIG_SENSORS_UCD9200=m
+CONFIG_SENSORS_ZL6100=m
CONFIG_SENSORS_SHT15=m
CONFIG_SENSORS_SHT21=m
CONFIG_SENSORS_SIS5595=m
@@ -2859,7 +2888,9 @@ CONFIG_SENSORS_EMC6W201=m
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_SMSC47M192=m
CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SCH56XX_COMMON=m
CONFIG_SENSORS_SCH5627=m
+CONFIG_SENSORS_SCH5636=m
CONFIG_SENSORS_ADS1015=m
CONFIG_SENSORS_ADS7828=m
CONFIG_SENSORS_ADS7871=m
@@ -2892,6 +2923,7 @@ CONFIG_SENSORS_ACPI_POWER=m
CONFIG_SENSORS_ATK0110=m
CONFIG_THERMAL=y
CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
#
@@ -2969,7 +3001,10 @@ CONFIG_BCMA_POSSIBLE=y
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set
-CONFIG_MFD_SUPPORT=y
+
+#
+# Multifunction device drivers
+#
CONFIG_MFD_CORE=m
CONFIG_MFD_SM501=m
# CONFIG_MFD_SM501_GPIO is not set
@@ -2978,6 +3013,7 @@ CONFIG_UCB1400_CORE=m
# CONFIG_TPS6105X is not set
CONFIG_TPS65010=m
CONFIG_TPS6507X=m
+# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TMIO is not set
CONFIG_MFD_WM8400=m
# CONFIG_MFD_WM831X_SPI is not set
@@ -2996,29 +3032,7 @@ CONFIG_MFD_RDC321X=m
CONFIG_MFD_JANZ_CMODIO=m
CONFIG_MFD_VX855=m
CONFIG_MFD_WL1273_CORE=m
-CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
-# CONFIG_REGULATOR_DUMMY is not set
-# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
-CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
-CONFIG_REGULATOR_USERSPACE_CONSUMER=m
-CONFIG_REGULATOR_BQ24022=m
-CONFIG_REGULATOR_MAX1586=m
-CONFIG_REGULATOR_MAX8649=m
-CONFIG_REGULATOR_MAX8660=m
-CONFIG_REGULATOR_MAX8952=m
-CONFIG_REGULATOR_WM8400=m
-CONFIG_REGULATOR_PCF50633=m
-CONFIG_REGULATOR_LP3971=m
-CONFIG_REGULATOR_LP3972=m
-CONFIG_REGULATOR_MC13XXX_CORE=m
-CONFIG_REGULATOR_MC13783=m
-CONFIG_REGULATOR_MC13892=m
-# CONFIG_REGULATOR_TPS65023 is not set
-# CONFIG_REGULATOR_TPS6507X is not set
-CONFIG_REGULATOR_ISL6271A=m
-# CONFIG_REGULATOR_AD5398 is not set
-CONFIG_REGULATOR_TPS6524X=m
+# CONFIG_REGULATOR is not set
CONFIG_MEDIA_SUPPORT=m
#
@@ -3029,6 +3043,7 @@ CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_COMMON=m
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_DVB_CORE=m
+CONFIG_DVB_NET=y
CONFIG_VIDEO_MEDIA=m
#
@@ -3045,7 +3060,9 @@ CONFIG_IR_RC6_DECODER=m
CONFIG_IR_JVC_DECODER=m
CONFIG_IR_SONY_DECODER=m
CONFIG_IR_RC5_SZ_DECODER=m
+CONFIG_IR_MCE_KBD_DECODER=m
CONFIG_IR_LIRC_CODEC=m
+CONFIG_RC_ATI_REMOTE=m
# CONFIG_IR_ENE is not set
CONFIG_IR_IMON=m
# CONFIG_IR_MCEUSB is not set
@@ -3073,6 +3090,7 @@ CONFIG_MEDIA_TUNER_MT2131=m
CONFIG_MEDIA_TUNER_QT1010=m
CONFIG_MEDIA_TUNER_XC2028=m
CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_XC4000=m
CONFIG_MEDIA_TUNER_MXL5005S=m
CONFIG_MEDIA_TUNER_MXL5007T=m
CONFIG_MEDIA_TUNER_MC44S803=m
@@ -3091,6 +3109,7 @@ CONFIG_VIDEO_TUNER=m
CONFIG_V4L2_MEM2MEM_DEV=m
CONFIG_VIDEOBUF2_CORE=m
CONFIG_VIDEOBUF2_MEMOPS=m
+CONFIG_VIDEOBUF2_DMA_CONTIG=m
CONFIG_VIDEOBUF2_VMALLOC=m
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
@@ -3164,9 +3183,20 @@ CONFIG_VIDEO_AK881X=m
# Camera sensor devices
#
CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_MT9P031=m
+CONFIG_VIDEO_MT9T001=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_MT9V032=m
CONFIG_VIDEO_TCM825X=m
+# CONFIG_VIDEO_SR030PC30 is not set
+CONFIG_VIDEO_NOON010PC30=m
+# CONFIG_VIDEO_M5MOLS is not set
+CONFIG_VIDEO_S5K6AA=m
+
+#
+# Flash devices
+#
+# CONFIG_VIDEO_ADP1653 is not set
#
# Video improvement chips
@@ -3210,6 +3240,7 @@ CONFIG_VIDEO_CX88_MPEG=m
CONFIG_VIDEO_CX88_VP3054=m
CONFIG_VIDEO_CX23885=m
# CONFIG_MEDIA_ALTERA_CI is not set
+# CONFIG_VIDEO_CX25821 is not set
CONFIG_VIDEO_AU0828=m
CONFIG_VIDEO_IVTV=m
CONFIG_VIDEO_FB_IVTV=m
@@ -3217,10 +3248,7 @@ CONFIG_VIDEO_CX18=m
CONFIG_VIDEO_CX18_ALSA=m
CONFIG_VIDEO_SAA7164=m
CONFIG_VIDEO_CAFE_CCIC=m
-# CONFIG_VIDEO_SR030PC30 is not set
# CONFIG_VIDEO_VIA_CAMERA is not set
-CONFIG_VIDEO_NOON010PC30=m
-# CONFIG_VIDEO_M5MOLS is not set
CONFIG_SOC_CAMERA=m
# CONFIG_SOC_CAMERA_IMX074 is not set
CONFIG_SOC_CAMERA_MT9M001=m
@@ -3232,6 +3260,7 @@ CONFIG_SOC_CAMERA_RJ54N1=m
CONFIG_SOC_CAMERA_TW9910=m
CONFIG_SOC_CAMERA_PLATFORM=m
CONFIG_SOC_CAMERA_OV2640=m
+# CONFIG_SOC_CAMERA_OV5642 is not set
# CONFIG_SOC_CAMERA_OV6650 is not set
CONFIG_SOC_CAMERA_OV772X=m
CONFIG_SOC_CAMERA_OV9640=m
@@ -3260,6 +3289,7 @@ CONFIG_USB_GSPCA_OV534_9=m
CONFIG_USB_GSPCA_PAC207=m
CONFIG_USB_GSPCA_PAC7302=m
CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SE401=m
CONFIG_USB_GSPCA_SN9C2028=m
CONFIG_USB_GSPCA_SN9C20X=m
CONFIG_USB_GSPCA_SONIXB=m
@@ -3278,6 +3308,7 @@ CONFIG_USB_GSPCA_STK014=m
CONFIG_USB_GSPCA_STV0680=m
CONFIG_USB_GSPCA_SUNPLUS=m
CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TOPRO=m
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_VICAM=m
@@ -3291,11 +3322,13 @@ CONFIG_VIDEO_HDPVR=m
CONFIG_VIDEO_EM28XX=m
CONFIG_VIDEO_EM28XX_ALSA=m
CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_EM28XX_RC=y
CONFIG_VIDEO_TLG2300=m
CONFIG_VIDEO_CX231XX=m
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VIDEO_CX231XX_ALSA=m
CONFIG_VIDEO_CX231XX_DVB=m
+# CONFIG_VIDEO_TM6000 is not set
CONFIG_VIDEO_USBVISION=m
CONFIG_USB_ET61X251=m
CONFIG_USB_SN9C102=m
@@ -3363,6 +3396,7 @@ CONFIG_DVB_USB_DTT200U=m
CONFIG_DVB_USB_OPERA1=m
CONFIG_DVB_USB_AF9005=m
CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_USB_PCTV452E=m
CONFIG_DVB_USB_DW2102=m
CONFIG_DVB_USB_CINERGY_T2=m
CONFIG_DVB_USB_ANYSEE=m
@@ -3374,6 +3408,8 @@ CONFIG_DVB_USB_EC168=m
CONFIG_DVB_USB_AZ6027=m
# CONFIG_DVB_USB_LME2510 is not set
CONFIG_DVB_USB_TECHNISAT_USB2=m
+CONFIG_DVB_USB_IT913X=m
+CONFIG_DVB_USB_MXL111SF=m
CONFIG_DVB_TTUSB_BUDGET=m
CONFIG_DVB_TTUSB_DEC=m
CONFIG_SMS_SIANO_MDTV=m
@@ -3431,6 +3467,11 @@ CONFIG_DVB_HOPPER=m
CONFIG_DVB_NGENE=m
#
+# Supported ddbridge ('Octopus') Adapters
+#
+CONFIG_DVB_DDBRIDGE=m
+
+#
# Supported DVB Frontends
#
# CONFIG_DVB_FE_CUSTOMISE is not set
@@ -3444,6 +3485,12 @@ CONFIG_DVB_STV090x=m
CONFIG_DVB_STV6110x=m
#
+# Multistandard (cable + terrestrial) frontends
+#
+CONFIG_DVB_DRXK=m
+CONFIG_DVB_TDA18271C2DD=m
+
+#
# DVB-S (satellite) frontends
#
CONFIG_DVB_CX24110=m
@@ -3469,6 +3516,7 @@ CONFIG_DVB_CX24116=m
CONFIG_DVB_SI21XX=m
CONFIG_DVB_DS3000=m
CONFIG_DVB_MB86A16=m
+CONFIG_DVB_TDA10071=m
#
# DVB-T (terrestrial) frontends
@@ -3532,12 +3580,15 @@ CONFIG_DVB_TUNER_DIB0090=m
# SEC control devices for DVB-S
#
CONFIG_DVB_LNBP21=m
+CONFIG_DVB_LNBP22=m
CONFIG_DVB_ISL6405=m
CONFIG_DVB_ISL6421=m
CONFIG_DVB_ISL6423=m
+CONFIG_DVB_A8293=m
CONFIG_DVB_LGS8GXX=m
CONFIG_DVB_ATBM8830=m
CONFIG_DVB_TDA665x=m
+CONFIG_DVB_IT913X_FE=m
#
# Tools to develop new frontends
@@ -3568,6 +3619,7 @@ CONFIG_DRM_MGA=m
CONFIG_DRM_SIS=m
CONFIG_DRM_VIA=m
CONFIG_DRM_SAVAGE=m
+CONFIG_DRM_VMWGFX=m
# CONFIG_STUB_POULSBO is not set
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -3668,6 +3720,7 @@ CONFIG_FB_GEODE_GX1=m
CONFIG_FB_TMIO=m
CONFIG_FB_TMIO_ACCELL=y
CONFIG_FB_SM501=m
+# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_VIRTUAL is not set
CONFIG_XEN_FBDEV_FRONTEND=m
@@ -3687,6 +3740,7 @@ CONFIG_LCD_VGG2432A4=m
CONFIG_LCD_PLATFORM=m
CONFIG_LCD_S6E63M0=m
# CONFIG_LCD_LD9040 is not set
+CONFIG_LCD_AMS369FG06=m
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_GENERIC=m
CONFIG_BACKLIGHT_PROGEAR=m
@@ -3767,6 +3821,7 @@ CONFIG_SND_AC97_POWER_SAVE=y
CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0
CONFIG_SND_SB_COMMON=m
CONFIG_SND_SB16_DSP=m
+CONFIG_SND_TEA575X=m
CONFIG_SND_PCI=y
CONFIG_SND_AD1889=m
CONFIG_SND_ALS300=m
@@ -3816,8 +3871,8 @@ CONFIG_SND_ES1968_INPUT=y
CONFIG_SND_ES1968_RADIO=y
CONFIG_SND_FM801=m
# CONFIG_SND_FM801_TEA575X_BOOL is not set
-CONFIG_SND_TEA575X=m
CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDA_PREALLOC_SIZE=4096
CONFIG_SND_HDA_HWDEP=y
# CONFIG_SND_HDA_RECONFIG is not set
CONFIG_SND_HDA_INPUT_BEEP=y
@@ -3825,6 +3880,7 @@ 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
@@ -3832,6 +3888,7 @@ CONFIG_SND_HDA_CODEC_HDMI=y
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_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
@@ -3885,6 +3942,8 @@ CONFIG_SND_SOC_WM_HUBS=m
CONFIG_SND_SOC_AD1836=m
CONFIG_SND_SOC_AD193X=m
CONFIG_SND_SOC_AD73311=m
+CONFIG_SND_SOC_ADAU1373=m
+CONFIG_SND_SOC_ADAV80X=m
CONFIG_SND_SOC_ADS117X=m
CONFIG_SND_SOC_AK4104=m
CONFIG_SND_SOC_AK4535=m
@@ -3896,6 +3955,7 @@ CONFIG_SND_SOC_CS42L51=m
CONFIG_SND_SOC_CS4270=m
CONFIG_SND_SOC_CS4271=m
CONFIG_SND_SOC_CX20442=m
+CONFIG_SND_SOC_JZ4740_CODEC=m
CONFIG_SND_SOC_L3=m
CONFIG_SND_SOC_DA7210=m
CONFIG_SND_SOC_DFBMCS320=m
@@ -3903,18 +3963,21 @@ CONFIG_SND_SOC_MAX98088=m
CONFIG_SND_SOC_MAX98095=m
CONFIG_SND_SOC_MAX9850=m
CONFIG_SND_SOC_PCM3008=m
+CONFIG_SND_SOC_RT5631=m
CONFIG_SND_SOC_SGTL5000=m
CONFIG_SND_SOC_SPDIF=m
CONFIG_SND_SOC_SSM2602=m
+CONFIG_SND_SOC_STA32X=m
CONFIG_SND_SOC_TLV320AIC23=m
CONFIG_SND_SOC_TLV320AIC26=m
-CONFIG_SND_SOC_TVL320AIC32X4=m
+CONFIG_SND_SOC_TLV320AIC32X4=m
CONFIG_SND_SOC_TLV320AIC3X=m
CONFIG_SND_SOC_TLV320DAC33=m
CONFIG_SND_SOC_UDA134X=m
CONFIG_SND_SOC_UDA1380=m
CONFIG_SND_SOC_WL1273=m
CONFIG_SND_SOC_WM1250_EV1=m
+CONFIG_SND_SOC_WM5100=m
CONFIG_SND_SOC_WM8400=m
CONFIG_SND_SOC_WM8510=m
CONFIG_SND_SOC_WM8523=m
@@ -3929,11 +3992,11 @@ CONFIG_SND_SOC_WM8750=m
CONFIG_SND_SOC_WM8753=m
CONFIG_SND_SOC_WM8770=m
CONFIG_SND_SOC_WM8776=m
+CONFIG_SND_SOC_WM8782=m
CONFIG_SND_SOC_WM8804=m
CONFIG_SND_SOC_WM8900=m
CONFIG_SND_SOC_WM8903=m
CONFIG_SND_SOC_WM8904=m
-CONFIG_SND_SOC_WM8915=m
CONFIG_SND_SOC_WM8940=m
CONFIG_SND_SOC_WM8955=m
CONFIG_SND_SOC_WM8960=m
@@ -3942,12 +4005,14 @@ CONFIG_SND_SOC_WM8962=m
CONFIG_SND_SOC_WM8971=m
CONFIG_SND_SOC_WM8974=m
CONFIG_SND_SOC_WM8978=m
+CONFIG_SND_SOC_WM8983=m
CONFIG_SND_SOC_WM8985=m
CONFIG_SND_SOC_WM8988=m
CONFIG_SND_SOC_WM8990=m
CONFIG_SND_SOC_WM8991=m
CONFIG_SND_SOC_WM8993=m
CONFIG_SND_SOC_WM8995=m
+CONFIG_SND_SOC_WM8996=m
CONFIG_SND_SOC_WM9081=m
CONFIG_SND_SOC_LM4857=m
CONFIG_SND_SOC_MAX9877=m
@@ -3988,6 +4053,7 @@ CONFIG_HID_PRODIKEYS=m
# CONFIG_HID_EMS_FF is not set
# CONFIG_HID_ELECOM is not set
# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_HOLTEK is not set
CONFIG_HID_KEYTOUCH=m
# CONFIG_HID_KYE is not set
# CONFIG_HID_UCLOGIC is not set
@@ -4010,6 +4076,7 @@ CONFIG_HID_PICOLCD_FB=y
CONFIG_HID_PICOLCD_BACKLIGHT=y
CONFIG_HID_PICOLCD_LCD=y
CONFIG_HID_PICOLCD_LEDS=y
+CONFIG_HID_PRIMAX=m
CONFIG_HID_QUANTA=m
CONFIG_HID_ROCCAT=m
CONFIG_HID_ROCCAT_COMMON=m
@@ -4020,18 +4087,22 @@ CONFIG_HID_ROCCAT_KOVAPLUS=m
# CONFIG_HID_ROCCAT_PYRA is not set
# CONFIG_HID_SAMSUNG is not set
CONFIG_HID_SONY=m
+CONFIG_HID_SPEEDLINK=m
# CONFIG_HID_SUNPLUS is not set
# CONFIG_HID_GREENASIA is not set
# CONFIG_HID_SMARTJOYPLUS is not set
# CONFIG_HID_TOPSEED is not set
# CONFIG_HID_THRUSTMASTER is not set
# CONFIG_HID_WACOM is not set
+# CONFIG_HID_WIIMOTE is not set
# CONFIG_HID_ZEROPLUS is not set
CONFIG_HID_ZYDACRON=m
CONFIG_USB_SUPPORT=y
+CONFIG_USB_COMMON=m
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB_ARCH_HAS_XHCI=y
CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -4044,6 +4115,7 @@ CONFIG_USB_DEVICE_CLASS=y
# 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=m
CONFIG_USB_WUSB_CBAF=m
@@ -4077,10 +4149,6 @@ CONFIG_USB_WHCI_HCD=m
CONFIG_USB_HWA_HCD=m
#
-# Enable Host or Gadget support to see Inventra options
-#
-
-#
# USB Device Class drivers
#
CONFIG_USB_ACM=m
@@ -4110,7 +4178,7 @@ 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_UAS=m
CONFIG_USB_LIBUSUAL=y
#
@@ -4271,18 +4339,15 @@ CONFIG_LEDS_CLASS=y
#
CONFIG_LEDS_LM3530=m
CONFIG_LEDS_NET5501=m
-CONFIG_LEDS_ALIX2=m
CONFIG_LEDS_PCA9532=m
# CONFIG_LEDS_PCA9532_GPIO is not set
CONFIG_LEDS_GPIO=m
-CONFIG_LEDS_GPIO_PLATFORM=y
CONFIG_LEDS_LP3944=m
# CONFIG_LEDS_LP5521 is not set
# CONFIG_LEDS_LP5523 is not set
CONFIG_LEDS_CLEVO_MAIL=m
CONFIG_LEDS_PCA955X=m
CONFIG_LEDS_DAC124S085=m
-CONFIG_LEDS_REGULATOR=m
CONFIG_LEDS_BD2802=m
CONFIG_LEDS_INTEL_SS4200=m
CONFIG_LEDS_LT3593=m
@@ -4302,7 +4367,6 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
#
# iptables trigger is under Netfilter config (LED target)
#
-# CONFIG_NFC_DEVICES is not set
CONFIG_ACCESSIBILITY=y
# CONFIG_A11Y_BRAILLE_CONSOLE is not set
CONFIG_INFINIBAND=m
@@ -4433,37 +4497,36 @@ CONFIG_UIO_PDRV=m
CONFIG_UIO_PDRV_GENIRQ=m
CONFIG_UIO_AEC=m
CONFIG_UIO_SERCOS3=m
-# CONFIG_UIO_PCI_GENERIC is not set
+CONFIG_UIO_PCI_GENERIC=m
CONFIG_UIO_NETX=m
+CONFIG_VIRTIO=m
+CONFIG_VIRTIO_RING=m
+
+#
+# Virtio drivers
+#
+CONFIG_VIRTIO_PCI=m
+CONFIG_VIRTIO_BALLOON=m
+CONFIG_VIRTIO_MMIO=m
#
# Xen driver support
#
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y
-CONFIG_XEN_DEV_EVTCHN=y
+CONFIG_XEN_DEV_EVTCHN=m
CONFIG_XEN_BACKEND=y
-CONFIG_XENFS=y
+CONFIG_XENFS=m
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_XEN_PLATFORM_PCI=m
CONFIG_SWIOTLB_XEN=y
+CONFIG_XEN_PCIDEV_BACKEND=m
CONFIG_STAGING=y
-CONFIG_STALLION=m
-CONFIG_ISTALLION=m
-CONFIG_DIGIEPCA=m
-CONFIG_RISCOM8=m
-CONFIG_SPECIALIX=m
-CONFIG_COMPUTONE=m
# CONFIG_ET131X is not set
# CONFIG_SLICOSS is not set
-# CONFIG_VIDEO_GO7007 is not set
-# CONFIG_VIDEO_CX25821 is not set
-# CONFIG_VIDEO_TM6000 is not set
-# CONFIG_DVB_CXD2099 is not set
CONFIG_USBIP_CORE=m
CONFIG_USBIP_VHCI_HCD=m
CONFIG_USBIP_HOST=m
@@ -4471,9 +4534,6 @@ CONFIG_USBIP_HOST=m
# CONFIG_W35UND is not set
# CONFIG_PRISM2_USB is not set
# CONFIG_ECHO is not set
-# CONFIG_BRCMUTIL is not set
-# CONFIG_BRCMSMAC is not set
-# CONFIG_BRCMFMAC is not set
# CONFIG_COMEDI is not set
# CONFIG_ASUS_OLED is not set
# CONFIG_PANEL is not set
@@ -4482,11 +4542,11 @@ CONFIG_USBIP_HOST=m
# CONFIG_RTL8192E is not set
# CONFIG_R8712U is not set
# CONFIG_RTS_PSTOR is not set
+# CONFIG_RTS5139 is not set
# CONFIG_TRANZPORT is not set
# CONFIG_POHMELFS is not set
# CONFIG_IDE_PHISON is not set
# CONFIG_LINE6_USB is not set
-CONFIG_DRM_VMWGFX=m
CONFIG_DRM_NOUVEAU=m
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
CONFIG_DRM_NOUVEAU_DEBUG=y
@@ -4500,11 +4560,8 @@ CONFIG_DRM_I2C_SIL164=m
# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
# CONFIG_VT6655 is not set
# CONFIG_VT6656 is not set
-CONFIG_HYPERV=m
CONFIG_HYPERV_STORAGE=m
-CONFIG_HYPERV_BLOCK=m
CONFIG_HYPERV_NET=m
-CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_MOUSE=m
# CONFIG_VME_BUS is not set
# CONFIG_DX_SEP is not set
@@ -4514,17 +4571,11 @@ CONFIG_HYPERV_MOUSE=m
# CONFIG_WLAGS49_H2 is not set
# CONFIG_WLAGS49_H25 is not set
# CONFIG_FB_SM7XX is not set
-# CONFIG_VIDEO_DT3155 is not set
# CONFIG_CRYSTALHD is not set
# CONFIG_CXT1E1 is not set
# CONFIG_FB_XGI is not set
-# CONFIG_LIRC_STAGING is not set
-# CONFIG_EASYCAP is not set
-# CONFIG_SOLO6X10 is not set
# CONFIG_ACPI_QUICKSTART is not set
-CONFIG_MACH_NO_WESTBRIDGE=y
# CONFIG_SBE_2T3E3 is not set
-# CONFIG_ATH6K_LEGACY is not set
# CONFIG_USB_ENESTORAGE is not set
# CONFIG_BCM_WIMAX is not set
# CONFIG_FT1000 is not set
@@ -4536,12 +4587,8 @@ CONFIG_MACH_NO_WESTBRIDGE=y
# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
# CONFIG_DRM_PSB is not set
-
-#
-# Altera FPGA firmware download module
-#
-# CONFIG_ALTERA_STAPL is not set
# CONFIG_INTEL_MEI is not set
+# CONFIG_STAGING_MEDIA is not set
CONFIG_X86_PLATFORM_DEVICES=y
CONFIG_ACER_WMI=m
CONFIG_ACERHDF=m
@@ -4558,7 +4605,7 @@ CONFIG_PANASONIC_LAPTOP=m
CONFIG_COMPAL_LAPTOP=m
CONFIG_SONY_LAPTOP=m
# CONFIG_SONYPI_COMPAT is not set
-# CONFIG_IDEAPAD_LAPTOP is not set
+CONFIG_IDEAPAD_LAPTOP=m
CONFIG_THINKPAD_ACPI=m
CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y
# CONFIG_THINKPAD_ACPI_DEBUGFACILITIES is not set
@@ -4585,6 +4632,27 @@ CONFIG_XO15_EBOOK=m
# CONFIG_SAMSUNG_LAPTOP is not set
CONFIG_MXM_WMI=m
CONFIG_INTEL_OAKTRAIL=m
+# CONFIG_SAMSUNG_Q10 is not set
+
+#
+# Hardware Spinlock drivers
+#
+CONFIG_CLKEVT_I8253=y
+CONFIG_I8253_LOCK=y
+CONFIG_CLKBLD_I8253=y
+CONFIG_IOMMU_API=y
+CONFIG_IOMMU_SUPPORT=y
+CONFIG_AMD_IOMMU=y
+CONFIG_AMD_IOMMU_STATS=y
+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=y
+CONFIG_VIRT_DRIVERS=y
+CONFIG_HYPERV=m
+CONFIG_HYPERV_UTILS=m
+# CONFIG_PM_DEVFREQ is not set
#
# Firmware Drivers
@@ -4699,7 +4767,7 @@ CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y
@@ -4751,9 +4819,11 @@ CONFIG_UBIFS_FS_ZLIB=y
CONFIG_LOGFS=m
CONFIG_CRAMFS=m
CONFIG_SQUASHFS=m
-# CONFIG_SQUASHFS_XATTR is not set
+CONFIG_SQUASHFS_XATTR=y
+CONFIG_SQUASHFS_ZLIB=y
# CONFIG_SQUASHFS_LZO is not set
CONFIG_SQUASHFS_XZ=y
+# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
@@ -4773,6 +4843,7 @@ CONFIG_UFS_FS=m
# CONFIG_UFS_DEBUG is not set
CONFIG_EXOFS_FS=m
# CONFIG_EXOFS_DEBUG is not set
+CONFIG_ORE=m
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
@@ -4784,7 +4855,6 @@ CONFIG_NFS_V4=y
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_USE_NEW_IDMAPPER is not set
CONFIG_NFSD=m
-CONFIG_NFSD_DEPRECATED=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
CONFIG_NFSD_V4=y
@@ -4805,7 +4875,7 @@ CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_DFS_UPCALL=y
# CONFIG_CIFS_FSCACHE is not set
-# CONFIG_CIFS_ACL 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
@@ -4833,7 +4903,7 @@ CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y
# CONFIG_SYSV68_PARTITION is not set
CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=m
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
@@ -4890,17 +4960,61 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
-# CONFIG_DEBUG_KERNEL is not set
-# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_HARDLOCKUP_DETECTOR=y
+# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_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_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# 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_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_VIRTUAL is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=60
+# CONFIG_KPROBES_SANITY_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# 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_FAULT_INJECTION is not set
+CONFIG_LATENCYTOP=y
CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
@@ -4922,13 +5036,19 @@ CONFIG_TRACING_SUPPORT=y
# CONFIG_ASYNC_RAID6_TEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_TEST_KSTRTOX=m
CONFIG_STRICT_DEVMEM=y
# CONFIG_X86_VERBOSE_BOOTUP is not set
# CONFIG_EARLY_PRINTK is not set
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_X86_PTDUMP is not set
+CONFIG_DEBUG_NX_TEST=m
+# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+CONFIG_X86_DECODER_SELFTEST=y
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
@@ -4938,7 +5058,10 @@ CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=0
+CONFIG_DEBUG_BOOT_PARAMS=y
+# CONFIG_CPA_DEBUG is not set
# CONFIG_OPTIMIZE_INLINING is not set
+# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
#
# Security options
@@ -4967,7 +5090,7 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y
#
# Role Based Access Control Options
#
-# CONFIG_GRKERNSEC_NO_RBAC is not set
+CONFIG_GRKERNSEC_NO_RBAC=y
CONFIG_GRKERNSEC_ACL_HIDEKERN=y
CONFIG_GRKERNSEC_ACL_MAXTRIES=3
CONFIG_GRKERNSEC_ACL_TIMEOUT=30
@@ -5021,6 +5144,7 @@ CONFIG_GRKERNSEC_PROC_IPADDR=y
#
# CONFIG_GRKERNSEC_DMESG is not set
CONFIG_GRKERNSEC_HARDEN_PTRACE=y
+CONFIG_GRKERNSEC_SETXID=y
# CONFIG_GRKERNSEC_TPE is not set
#
@@ -5054,6 +5178,7 @@ CONFIG_PAX=y
CONFIG_PAX_SOFTMODE=y
# CONFIG_PAX_EI_PAX is not set
CONFIG_PAX_PT_PAX_FLAGS=y
+# CONFIG_PAX_XATTR_PAX_FLAGS is not set
# CONFIG_PAX_NO_ACL_FLAGS is not set
CONFIG_PAX_HAVE_ACL_FLAGS=y
# CONFIG_PAX_HOOK_ACL_FLAGS is not set
@@ -5067,6 +5192,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_PLUGIN_METHOD=""
#
# Address Space Layout Randomization
@@ -5088,14 +5214,9 @@ CONFIG_TRUSTED_KEYS=m
CONFIG_ENCRYPTED_KEYS=m
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
-CONFIG_SECURITY=y
+# CONFIG_SECURITY is not set
CONFIG_SECURITYFS=y
-# CONFIG_SECURITY_NETWORK is not set
-# CONFIG_SECURITY_PATH is not set
# CONFIG_INTEL_TXT is not set
-# CONFIG_SECURITY_TOMOYO is not set
-# CONFIG_SECURITY_APPARMOR is not set
-# CONFIG_IMA is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_XOR_BLOCKS=m
@@ -5125,6 +5246,7 @@ CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=m
CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_USER=m
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
@@ -5173,6 +5295,7 @@ 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
@@ -5188,6 +5311,8 @@ CONFIG_CRYPTO_AES_NI_INTEL=m
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_BLOWFISH_COMMON=m
+CONFIG_CRYPTO_BLOWFISH_X86_64=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
@@ -5202,6 +5327,7 @@ 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
#
# Compression
@@ -5221,8 +5347,6 @@ CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=m
CONFIG_CRYPTO_DEV_PADLOCK_AES=m
CONFIG_CRYPTO_DEV_PADLOCK_SHA=m
-CONFIG_CRYPTO_DEV_HIFN_795X=m
-CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_EVENTFD=y
@@ -5234,10 +5358,6 @@ CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_VHOST_NET=m
-CONFIG_VIRTIO=m
-CONFIG_VIRTIO_RING=m
-CONFIG_VIRTIO_PCI=m
-CONFIG_VIRTIO_BALLOON=m
# CONFIG_BINARY_PRINTF is not set
#
@@ -5253,9 +5373,10 @@ CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
+CONFIG_CRC8=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
-CONFIG_LZO_COMPRESS=m
+CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
@@ -5286,3 +5407,4 @@ CONFIG_CHECK_SIGNATURE=y
CONFIG_CPU_RMAP=y
CONFIG_NLATTR=y
CONFIG_AVERAGE=y
+CONFIG_CORDIC=m
diff --git a/main/linux-grsec/net-flow-remove-sleeping-and-deferral-mechanism-from-flow_cache_flush.patch b/main/linux-grsec/net-flow-remove-sleeping-and-deferral-mechanism-from-flow_cache_flush.patch
deleted file mode 100644
index 8eaadf9429..0000000000
--- a/main/linux-grsec/net-flow-remove-sleeping-and-deferral-mechanism-from-flow_cache_flush.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-Based on http://patchwork.ozlabs.org/patch/132353/
-
-diff --git a/net/core/flow.c b/net/core/flow.c
-index 8ae42de..e318c7e 100644
---- a/net/core/flow.c
-+++ b/net/core/flow.c
-@@ -358,6 +358,18 @@ void flow_cache_flush(void)
- put_online_cpus();
- }
-
-+static void flow_cache_flush_task(struct work_struct *work)
-+{
-+ flow_cache_flush();
-+}
-+
-+static DECLARE_WORK(flow_cache_flush_work, flow_cache_flush_task);
-+
-+void flow_cache_flush_deferred(void)
-+{
-+ schedule_work(&flow_cache_flush_work);
-+}
-+
- static int __cpuinit flow_cache_cpu_prepare(struct flow_cache *fc, int cpu)
- {
- struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu);
-diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
-index 2118d64..9049a5c 100644
---- a/net/xfrm/xfrm_policy.c
-+++ b/net/xfrm/xfrm_policy.c
-@@ -2276,8 +2276,6 @@ static void __xfrm_garbage_collect(struct net *net)
- {
- struct dst_entry *head, *next;
-
-- flow_cache_flush();
--
- spin_lock_bh(&xfrm_policy_sk_bundle_lock);
- head = xfrm_policy_sk_bundles;
- xfrm_policy_sk_bundles = NULL;
-@@ -2290,6 +2288,18 @@ static void __xfrm_garbage_collect(struct net *net)
- }
- }
-
-+static void xfrm_garbage_collect(struct net *net)
-+{
-+ flow_cache_flush();
-+ __xfrm_garbage_collect(net);
-+}
-+
-+static void xfrm_garbage_collect_deferred(struct net *net)
-+{
-+ flow_cache_flush_deferred();
-+ __xfrm_garbage_collect(net);
-+}
-+
- static void xfrm_init_pmtu(struct dst_entry *dst)
- {
- do {
-@@ -2422,7 +2432,7 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
- 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;
-+ afinfo->garbage_collect = xfrm_garbage_collect_deferred;
- xfrm_policy_afinfo[afinfo->family] = afinfo;
- }
- write_unlock_bh(&xfrm_policy_afinfo_lock);
-@@ -2516,7 +2526,7 @@ static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void
-
- switch (event) {
- case NETDEV_DOWN:
-- __xfrm_garbage_collect(dev_net(dev));
-+ xfrm_garbage_collect(dev_net(dev));
- }
- return NOTIFY_DONE;
- }
---- ./include/net/flow.h.orig
-+++ ./include/net/flow.h
-@@ -207,6 +207,7 @@
- u8 dir, flow_resolve_t resolver, void *ctx);
-
- extern void flow_cache_flush(void);
-+extern void flow_cache_flush_deferred(void);
- extern atomic_unchecked_t flow_cache_genid;
-
- #endif