summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2013-07-11 19:42:04 -0400
committerAnthony G. Basile <blueness@gentoo.org>2013-07-11 19:42:04 -0400
commitdf4440f92d0f8572c9c728e125ccf97ee6169e80 (patch)
treea12e1438caeb3514cbc8e54e811cce5bd2908ce8
parentGrsec/PaX: 2.9.1-{2.6.32.61,3.2.47,3.9.9}-201307050017 (diff)
downloadhardened-patchset-df4440f92d0f8572c9c728e125ccf97ee6169e80.tar.gz
hardened-patchset-df4440f92d0f8572c9c728e125ccf97ee6169e80.tar.bz2
hardened-patchset-df4440f92d0f8572c9c728e125ccf97ee6169e80.zip
Grsec/PaX: 2.9.1-{2.6.32.61,3.2.48.3.10.0}-20130709222420130709
-rw-r--r--2.6.32/0000_README2
-rw-r--r--2.6.32/4420_grsecurity-2.9.1-2.6.32.61-201307092216.patch (renamed from 2.6.32/4420_grsecurity-2.9.1-2.6.32.61-201307050015.patch)46
-rw-r--r--3.10.0/0000_README (renamed from 3.9.9/0000_README)2
-rw-r--r--3.10.0/4420_grsecurity-2.9.1-3.10.0-201307092224.patch (renamed from 3.9.9/4420_grsecurity-2.9.1-3.9.9-201307050017.patch)8106
-rw-r--r--3.10.0/4425_grsec_remove_EI_PAX.patch (renamed from 3.9.9/4425_grsec_remove_EI_PAX.patch)0
-rw-r--r--3.10.0/4427_force_XATTR_PAX_tmpfs.patch (renamed from 3.9.9/4427_force_XATTR_PAX_tmpfs.patch)0
-rw-r--r--3.10.0/4430_grsec-remove-localversion-grsec.patch (renamed from 3.9.9/4430_grsec-remove-localversion-grsec.patch)0
-rw-r--r--3.10.0/4435_grsec-mute-warnings.patch (renamed from 3.9.9/4435_grsec-mute-warnings.patch)0
-rw-r--r--3.10.0/4440_grsec-remove-protected-paths.patch (renamed from 3.9.9/4440_grsec-remove-protected-paths.patch)0
-rw-r--r--3.10.0/4450_grsec-kconfig-default-gids.patch (renamed from 3.9.9/4450_grsec-kconfig-default-gids.patch)0
-rw-r--r--3.10.0/4465_selinux-avc_audit-log-curr_ip.patch (renamed from 3.9.9/4465_selinux-avc_audit-log-curr_ip.patch)0
-rw-r--r--3.10.0/4470_disable-compat_vdso.patch (renamed from 3.9.9/4470_disable-compat_vdso.patch)0
-rw-r--r--3.10.0/4475_emutramp_default_on.patch (renamed from 3.9.9/4475_emutramp_default_on.patch)0
-rw-r--r--3.2.48/0000_README2
-rw-r--r--3.2.48/4420_grsecurity-2.9.1-3.2.48-201307092217.patch (renamed from 3.2.48/4420_grsecurity-2.9.1-3.2.48-201307050016.patch)11
15 files changed, 4056 insertions, 4113 deletions
diff --git a/2.6.32/0000_README b/2.6.32/0000_README
index 51f219a..0d60549 100644
--- a/2.6.32/0000_README
+++ b/2.6.32/0000_README
@@ -38,7 +38,7 @@ Patch: 1060_linux-2.6.32.61.patch
From: http://www.kernel.org
Desc: Linux 2.6.32.61
-Patch: 4420_grsecurity-2.9.1-2.6.32.61-201307050015.patch
+Patch: 4420_grsecurity-2.9.1-2.6.32.61-201307092216.patch
From: http://www.grsecurity.net
Desc: hardened-sources base patch from upstream grsecurity
diff --git a/2.6.32/4420_grsecurity-2.9.1-2.6.32.61-201307050015.patch b/2.6.32/4420_grsecurity-2.9.1-2.6.32.61-201307092216.patch
index 9f43159..55e1dcb 100644
--- a/2.6.32/4420_grsecurity-2.9.1-2.6.32.61-201307050015.patch
+++ b/2.6.32/4420_grsecurity-2.9.1-2.6.32.61-201307092216.patch
@@ -104751,10 +104751,38 @@ index 53dae4b..9ba3743 100644
EXPORT_SYMBOL_GPL(kgdb_breakpoint);
diff --git a/kernel/kmod.c b/kernel/kmod.c
-index 8ecc509..8eaf7f6 100644
+index 8ecc509..98fcf05 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
-@@ -112,9 +112,8 @@ out:
+@@ -59,7 +59,7 @@ static void free_modprobe_argv(char **argv, char **envp)
+ kfree(argv);
+ }
+
+-static int call_modprobe(char *module_name, int wait)
++static int call_modprobe(char *module_name, char *module_param, int wait)
+ {
+ static char *envp[] = { "HOME=/",
+ "TERM=linux",
+@@ -67,7 +67,7 @@ static int call_modprobe(char *module_name, int wait)
+ NULL };
+ struct subprocess_info *info;
+
+- char **argv = kmalloc(sizeof(char *[5]), GFP_KERNEL);
++ char **argv = kmalloc(sizeof(char *[6]), GFP_KERNEL);
+ if (!argv)
+ goto out;
+
+@@ -79,7 +79,8 @@ static int call_modprobe(char *module_name, int wait)
+ argv[1] = "-q";
+ argv[2] = "--";
+ argv[3] = module_name; /* check free_modprobe_argv() */
+- argv[4] = NULL;
++ argv[4] = module_param;
++ argv[5] = NULL;
+
+ info = call_usermodehelper_setup(argv[0], argv, envp, GFP_ATOMIC);
+ if (!info)
+@@ -112,9 +113,8 @@ out:
* If module auto-loading support is disabled then this function
* becomes a no-operation.
*/
@@ -104765,7 +104793,7 @@ index 8ecc509..8eaf7f6 100644
char module_name[MODULE_NAME_LEN];
unsigned int max_modprobes;
int ret;
-@@ -126,12 +125,24 @@ int __request_module(bool wait, const char *fmt, ...)
+@@ -126,12 +126,24 @@ int __request_module(bool wait, const char *fmt, ...)
if (ret)
return ret;
@@ -104793,7 +104821,13 @@ index 8ecc509..8eaf7f6 100644
/* If modprobe needs a service that is in a module, we get a recursive
* loop. Limit the number of running kmod threads to max_threads/2 or
* MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method
-@@ -165,6 +176,48 @@ int __request_module(bool wait, const char *fmt, ...)
+@@ -160,11 +172,53 @@ int __request_module(bool wait, const char *fmt, ...)
+
+ trace_module_request(module_name, wait, _RET_IP_);
+
+- ret = call_modprobe(module_name, wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC);
++ ret = call_modprobe(module_name, module_param, wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC);
+
atomic_dec(&kmod_concurrent);
return ret;
}
@@ -104842,7 +104876,7 @@ index 8ecc509..8eaf7f6 100644
EXPORT_SYMBOL(__request_module);
#endif /* CONFIG_MODULES */
-@@ -283,7 +336,7 @@ static int wait_for_helper(void *data)
+@@ -283,7 +337,7 @@ static int wait_for_helper(void *data)
*
* Thus the __user pointer cast is valid here.
*/
@@ -104851,7 +104885,7 @@ index 8ecc509..8eaf7f6 100644
/*
* If ret is 0, either ____call_usermodehelper failed and the
-@@ -561,6 +614,11 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info,
+@@ -561,6 +615,11 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info,
validate_creds(sub_info->cred);
helper_lock();
diff --git a/3.9.9/0000_README b/3.10.0/0000_README
index be794cc..7b53411 100644
--- a/3.9.9/0000_README
+++ b/3.10.0/0000_README
@@ -2,7 +2,7 @@ README
-----------------------------------------------------------------------------
Individual Patch Descriptions:
-----------------------------------------------------------------------------
-Patch: 4420_grsecurity-2.9.1-3.9.9-201307050017.patch
+Patch: 4420_grsecurity-2.9.1-3.10.0-201307092224.patch
From: http://www.grsecurity.net
Desc: hardened-sources base patch from upstream grsecurity
diff --git a/3.9.9/4420_grsecurity-2.9.1-3.9.9-201307050017.patch b/3.10.0/4420_grsecurity-2.9.1-3.10.0-201307092224.patch
index 1ae3c82..7c0943d 100644
--- a/3.9.9/4420_grsecurity-2.9.1-3.9.9-201307050017.patch
+++ b/3.10.0/4420_grsecurity-2.9.1-3.10.0-201307092224.patch
@@ -229,10 +229,10 @@ index b89a739..79768fb 100644
+zconf.lex.c
zoffset.h
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 8ccbf27..afffeb4 100644
+index 2fe6e76..3dd8184 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
-@@ -948,6 +948,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -976,6 +976,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0.
Default: 1024
@@ -243,7 +243,7 @@ index 8ccbf27..afffeb4 100644
hashdist= [KNL,NUMA] Large hashes allocated during boot
are distributed across NUMA nodes. Defaults on
for 64-bit NUMA, off otherwise.
-@@ -2147,6 +2151,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -2195,6 +2199,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
the specified number of seconds. This is to be used if
your oopses keep scrolling off the screen.
@@ -263,7 +263,7 @@ index 8ccbf27..afffeb4 100644
pcd. [PARIDE]
diff --git a/Makefile b/Makefile
-index 9591325..1457ef3 100644
+index e5e3ba0..02c9b98 100644
--- a/Makefile
+++ b/Makefile
@@ -241,8 +241,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -364,7 +364,7 @@ index 9591325..1457ef3 100644
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-@@ -780,6 +840,8 @@ endif
+@@ -782,6 +842,8 @@ endif
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
@@ -373,7 +373,7 @@ index 9591325..1457ef3 100644
$(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Handle descending into subdirectories listed in $(vmlinux-dirs)
-@@ -789,7 +851,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
+@@ -791,7 +853,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Error messages still appears in the original language
PHONY += $(vmlinux-dirs)
@@ -382,7 +382,7 @@ index 9591325..1457ef3 100644
$(Q)$(MAKE) $(build)=$@
# Store (new) KERNELRELASE string in include/config/kernel.release
-@@ -833,6 +895,7 @@ prepare0: archprepare FORCE
+@@ -835,6 +897,7 @@ prepare0: archprepare FORCE
$(Q)$(MAKE) $(build)=.
# All the preparing..
@@ -390,7 +390,7 @@ index 9591325..1457ef3 100644
prepare: prepare0
# Generate some files
-@@ -940,6 +1003,8 @@ all: modules
+@@ -942,6 +1005,8 @@ all: modules
# using awk while concatenating to the final file.
PHONY += modules
@@ -399,7 +399,7 @@ index 9591325..1457ef3 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.';
-@@ -955,7 +1020,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+@@ -957,7 +1022,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
# Target to prepare building external modules
PHONY += modules_prepare
@@ -408,7 +408,7 @@ index 9591325..1457ef3 100644
# Target to install modules
PHONY += modules_install
-@@ -1021,7 +1086,7 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
+@@ -1023,7 +1088,7 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
signing_key.priv signing_key.x509 x509.genkey \
extra_certificates signing_key.x509.keyid \
@@ -417,7 +417,7 @@ index 9591325..1457ef3 100644
# clean - Delete most, but leave enough to build external modules
#
-@@ -1061,6 +1126,7 @@ distclean: mrproper
+@@ -1063,6 +1128,7 @@ distclean: mrproper
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' \
@@ -425,7 +425,7 @@ index 9591325..1457ef3 100644
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-type f -print | xargs rm -f
-@@ -1221,6 +1287,8 @@ PHONY += $(module-dirs) modules
+@@ -1223,6 +1289,8 @@ PHONY += $(module-dirs) modules
$(module-dirs): crmodverdir $(objtree)/Module.symvers
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
@@ -434,7 +434,7 @@ index 9591325..1457ef3 100644
modules: $(module-dirs)
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1357,17 +1425,21 @@ else
+@@ -1359,17 +1427,21 @@ else
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif
@@ -460,7 +460,7 @@ index 9591325..1457ef3 100644
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.symtypes: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-@@ -1377,11 +1449,15 @@ endif
+@@ -1379,11 +1451,15 @@ endif
$(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir)
@@ -811,10 +811,10 @@ index 0c4132d..88f0d53 100644
/* Allow reads even for write-only mappings */
if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 70cd012..71b82cd 100644
+index 136f263..f471277 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1860,7 +1860,7 @@ config ALIGNMENT_TRAP
+@@ -1766,7 +1766,7 @@ config ALIGNMENT_TRAP
config UACCESS_WITH_MEMCPY
bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()"
@@ -824,7 +824,7 @@ index 70cd012..71b82cd 100644
help
Implement faster copy_to_user and clear_user methods for CPU
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
-index c79f61f..9ac0642 100644
+index da1c77d..2ee6056 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -17,17 +17,35 @@
@@ -1129,8 +1129,44 @@ index c79f61f..9ac0642 100644
+
#define ATOMIC64_INIT(i) { (i) }
+ #ifdef CONFIG_ARM_LPAE
+@@ -257,6 +452,19 @@ static inline u64 atomic64_read(const atomic64_t *v)
+ return result;
+ }
+
++static inline u64 atomic64_read_unchecked(const atomic64_unchecked_t *v)
++{
++ u64 result;
++
++ __asm__ __volatile__("@ atomic64_read_unchecked\n"
++" ldrd %0, %H0, [%1]"
++ : "=&r" (result)
++ : "r" (&v->counter), "Qo" (v->counter)
++ );
++
++ return result;
++}
++
+ static inline void atomic64_set(atomic64_t *v, u64 i)
+ {
+ __asm__ __volatile__("@ atomic64_set\n"
+@@ -265,6 +473,15 @@ static inline void atomic64_set(atomic64_t *v, u64 i)
+ : "r" (&v->counter), "r" (i)
+ );
+ }
++
++static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, u64 i)
++{
++ __asm__ __volatile__("@ atomic64_set_unchecked\n"
++" strd %2, %H2, [%1]"
++ : "=Qo" (v->counter)
++ : "r" (&v->counter), "r" (i)
++ );
++}
+ #else
static inline u64 atomic64_read(const atomic64_t *v)
-@@ -256,6 +451,19 @@ static inline u64 atomic64_read(const atomic64_t *v)
+ {
+@@ -279,6 +496,19 @@ static inline u64 atomic64_read(const atomic64_t *v)
return result;
}
@@ -1150,10 +1186,11 @@ index c79f61f..9ac0642 100644
static inline void atomic64_set(atomic64_t *v, u64 i)
{
u64 tmp;
-@@ -270,6 +478,20 @@ static inline void atomic64_set(atomic64_t *v, u64 i)
+@@ -292,6 +522,21 @@ static inline void atomic64_set(atomic64_t *v, u64 i)
+ : "r" (&v->counter), "r" (i)
: "cc");
}
-
++
+static inline void atomic64_set_unchecked(atomic64_unchecked_t *v, u64 i)
+{
+ u64 tmp;
@@ -1168,10 +1205,10 @@ index c79f61f..9ac0642 100644
+ : "cc");
+}
+
+ #endif
+
static inline void atomic64_add(u64 i, atomic64_t *v)
- {
- u64 result;
-@@ -278,6 +500,36 @@ static inline void atomic64_add(u64 i, atomic64_t *v)
+@@ -302,6 +547,36 @@ static inline void atomic64_add(u64 i, atomic64_t *v)
__asm__ __volatile__("@ atomic64_add\n"
"1: ldrexd %0, %H0, [%3]\n"
" adds %0, %0, %4\n"
@@ -1208,7 +1245,7 @@ index c79f61f..9ac0642 100644
" adc %H0, %H0, %H4\n"
" strexd %1, %0, %H0, [%3]\n"
" teq %1, #0\n"
-@@ -289,12 +541,49 @@ static inline void atomic64_add(u64 i, atomic64_t *v)
+@@ -313,12 +588,49 @@ static inline void atomic64_add(u64 i, atomic64_t *v)
static inline u64 atomic64_add_return(u64 i, atomic64_t *v)
{
@@ -1260,7 +1297,7 @@ index c79f61f..9ac0642 100644
"1: ldrexd %0, %H0, [%3]\n"
" adds %0, %0, %4\n"
" adc %H0, %H0, %H4\n"
-@@ -318,6 +607,36 @@ static inline void atomic64_sub(u64 i, atomic64_t *v)
+@@ -342,6 +654,36 @@ static inline void atomic64_sub(u64 i, atomic64_t *v)
__asm__ __volatile__("@ atomic64_sub\n"
"1: ldrexd %0, %H0, [%3]\n"
" subs %0, %0, %4\n"
@@ -1297,7 +1334,7 @@ index c79f61f..9ac0642 100644
" sbc %H0, %H0, %H4\n"
" strexd %1, %0, %H0, [%3]\n"
" teq %1, #0\n"
-@@ -329,18 +648,32 @@ static inline void atomic64_sub(u64 i, atomic64_t *v)
+@@ -353,18 +695,32 @@ static inline void atomic64_sub(u64 i, atomic64_t *v)
static inline u64 atomic64_sub_return(u64 i, atomic64_t *v)
{
@@ -1335,7 +1372,7 @@ index c79f61f..9ac0642 100644
: "=&r" (result), "=&r" (tmp), "+Qo" (v->counter)
: "r" (&v->counter), "r" (i)
: "cc");
-@@ -374,6 +707,30 @@ static inline u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old, u64 new)
+@@ -398,6 +754,30 @@ static inline u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old, u64 new)
return oldval;
}
@@ -1366,7 +1403,7 @@ index c79f61f..9ac0642 100644
static inline u64 atomic64_xchg(atomic64_t *ptr, u64 new)
{
u64 result;
-@@ -397,21 +754,34 @@ static inline u64 atomic64_xchg(atomic64_t *ptr, u64 new)
+@@ -421,21 +801,34 @@ static inline u64 atomic64_xchg(atomic64_t *ptr, u64 new)
static inline u64 atomic64_dec_if_positive(atomic64_t *v)
{
@@ -1408,7 +1445,7 @@ index c79f61f..9ac0642 100644
: "=&r" (result), "=&r" (tmp), "+Qo" (v->counter)
: "r" (&v->counter)
: "cc");
-@@ -434,13 +804,25 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
+@@ -458,13 +851,25 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
" teq %0, %5\n"
" teqeq %H0, %H5\n"
" moveq %1, #0\n"
@@ -1437,7 +1474,7 @@ index c79f61f..9ac0642 100644
: "=&r" (val), "+r" (ret), "=&r" (tmp), "+Qo" (v->counter)
: "r" (&v->counter), "r" (u), "r" (a)
: "cc");
-@@ -453,10 +835,13 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
+@@ -477,10 +882,13 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
#define atomic64_inc(v) atomic64_add(1LL, (v))
@@ -1475,7 +1512,7 @@ index 75fe66b..ba3dee4 100644
#endif
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
-index 738fcba..7a43500 100644
+index 17d0ae8..014e350 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -116,7 +116,7 @@ struct cpu_cache_fns {
@@ -2059,7 +2096,7 @@ index d3a22be..3a69ad5 100644
/*
* set platform specific SMP operations
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
-index cddda1f..ff357f7 100644
+index 1995d1a..76693a2 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -77,9 +77,9 @@ struct thread_info {
@@ -2075,20 +2112,20 @@ index cddda1f..ff357f7 100644
.restart_block = { \
.fn = do_no_restart_syscall, \
}, \
-@@ -152,6 +152,12 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
+@@ -152,7 +152,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define TIF_SYSCALL_AUDIT 9
#define TIF_SYSCALL_TRACEPOINT 10
#define TIF_SECCOMP 11 /* seccomp syscall filtering active */
-+
+-#define TIF_NOHZ 12 /* in adaptive nohz mode */
+/* within 8 bits of TIF_SYSCALL_TRACE
+ * to meet flexible second operand requirements
+ */
+#define TIF_GRSEC_SETXID 12
-+
++#define TIF_NOHZ 13 /* in adaptive nohz mode */
#define TIF_USING_IWMMXT 17
#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
#define TIF_RESTORE_SIGMASK 20
-@@ -165,10 +171,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
+@@ -166,10 +170,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
@@ -2322,7 +2359,7 @@ index 60d3b73..e5a0f22 100644
EXPORT_SYMBOL(__get_user_1);
EXPORT_SYMBOL(__get_user_2);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
-index 0f82098..fb3d3d5 100644
+index 582b405..50351b7 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -47,6 +47,87 @@
@@ -2454,7 +2491,7 @@ index 0f82098..fb3d3d5 100644
SPFIX( addeq r2, r2, #4 )
str r3, [sp, #-4]! @ save the "real" r0 copied
@ from the exception stack
-@@ -359,6 +453,9 @@ ENDPROC(__pabt_svc)
+@@ -316,6 +410,9 @@ ENDPROC(__pabt_svc)
.macro usr_entry
UNWIND(.fnstart )
UNWIND(.cantunwind ) @ don't unwind the user space
@@ -2464,7 +2501,7 @@ index 0f82098..fb3d3d5 100644
sub sp, sp, #S_FRAME_SIZE
ARM( stmib sp, {r1 - r12} )
THUMB( stmia sp, {r0 - r12} )
-@@ -456,7 +553,9 @@ __und_usr:
+@@ -414,7 +511,9 @@ __und_usr:
tst r3, #PSR_T_BIT @ Thumb mode?
bne __und_usr_thumb
sub r4, r2, #4 @ ARM instr at LR - 4
@@ -2474,7 +2511,7 @@ index 0f82098..fb3d3d5 100644
#ifdef CONFIG_CPU_ENDIAN_BE8
rev r0, r0 @ little endian instruction
#endif
-@@ -491,10 +590,14 @@ __und_usr_thumb:
+@@ -449,10 +548,14 @@ __und_usr_thumb:
*/
.arch armv6t2
#endif
@@ -2489,7 +2526,7 @@ index 0f82098..fb3d3d5 100644
add r2, r2, #2 @ r2 is PC + 2, make it PC + 4
str r2, [sp, #S_PC] @ it's a 2x16bit instr, update
orr r0, r0, r5, lsl #16
-@@ -733,7 +836,7 @@ ENTRY(__switch_to)
+@@ -690,7 +793,7 @@ ENTRY(__switch_to)
THUMB( stmia ip!, {r4 - sl, fp} ) @ Store most regs on stack
THUMB( str sp, [ip], #4 )
THUMB( str lr, [ip], #4 )
@@ -2498,7 +2535,7 @@ index 0f82098..fb3d3d5 100644
ldr r6, [r2, #TI_CPU_DOMAIN]
#endif
set_tls r3, r4, r5
-@@ -742,7 +845,7 @@ ENTRY(__switch_to)
+@@ -699,7 +802,7 @@ ENTRY(__switch_to)
ldr r8, =__stack_chk_guard
ldr r7, [r7, #TSK_STACK_CANARY]
#endif
@@ -2508,7 +2545,7 @@ index 0f82098..fb3d3d5 100644
#endif
mov r5, r0
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
-index fefd7f9..e6f250e 100644
+index bc5bc0a..d0998ca 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -10,18 +10,46 @@
@@ -2561,7 +2598,7 @@ index fefd7f9..e6f250e 100644
.align 5
/*
* This is the fast syscall return path. We do as little as
-@@ -351,6 +379,7 @@ ENDPROC(ftrace_stub)
+@@ -350,6 +378,7 @@ ENDPROC(ftrace_stub)
.align 5
ENTRY(vector_swi)
@@ -2569,7 +2606,7 @@ index fefd7f9..e6f250e 100644
sub sp, sp, #S_FRAME_SIZE
stmia sp, {r0 - r12} @ Calling r0 - r12
ARM( add r8, sp, #S_PC )
-@@ -400,6 +429,12 @@ ENTRY(vector_swi)
+@@ -399,6 +428,12 @@ ENTRY(vector_swi)
ldr scno, [lr, #-4] @ get SWI instruction
#endif
@@ -2583,10 +2620,10 @@ index fefd7f9..e6f250e 100644
ldr ip, __cr_alignment
ldr ip, [ip]
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
-index 9a8531e..812e287 100644
+index 160f337..db67ee4 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
-@@ -73,9 +73,66 @@
+@@ -73,6 +73,60 @@
msr cpsr_c, \rtemp @ switch back to the SVC mode
.endm
@@ -2645,18 +2682,22 @@ index 9a8531e..812e287 100644
+ .endm
+
#ifndef CONFIG_THUMB2_KERNEL
- .macro svc_exit, rpsr
- msr spsr_cxsf, \rpsr
+ .macro svc_exit, rpsr, irq = 0
+ .if \irq != 0
+@@ -92,6 +146,9 @@
+ blne trace_hardirqs_off
+ #endif
+ .endif
+
+ pax_exit_kernel
+
+ msr spsr_cxsf, \rpsr
#if defined(CONFIG_CPU_V6)
ldr r0, [sp]
- strex r1, r2, [sp] @ clear the exclusive monitor
-@@ -121,6 +178,9 @@
- .endm
- #else /* CONFIG_THUMB2_KERNEL */
- .macro svc_exit, rpsr
+@@ -155,6 +212,9 @@
+ blne trace_hardirqs_off
+ #endif
+ .endif
+
+ pax_exit_kernel
+
@@ -2792,7 +2833,7 @@ index 1f2740e..b36e225 100644
};
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
-index 047d3e4..7e96107 100644
+index 6e8931c..82ec6a5 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -28,7 +28,6 @@
@@ -2803,22 +2844,27 @@ index 047d3e4..7e96107 100644
#include <linux/hw_breakpoint.h>
#include <linux/cpuidle.h>
#include <linux/leds.h>
-@@ -251,9 +250,10 @@ void machine_power_off(void)
- machine_shutdown();
+@@ -223,6 +222,7 @@ void machine_power_off(void)
+
if (pm_power_off)
pm_power_off();
+ BUG();
}
+ /*
+@@ -236,7 +236,7 @@ void machine_power_off(void)
+ * executing pre-reset code, and using RAM that the primary CPU's code wishes
+ * to use. Implementing such co-ordination would be essentially impossible.
+ */
-void machine_restart(char *cmd)
+__noreturn void machine_restart(char *cmd)
{
- machine_shutdown();
+ smp_send_stop();
+
+@@ -258,8 +258,8 @@ void __show_regs(struct pt_regs *regs)
+
+ show_regs_print_info(KERN_DEFAULT);
-@@ -278,8 +278,8 @@ void __show_regs(struct pt_regs *regs)
- init_utsname()->release,
- (int)strcspn(init_utsname()->version, " "),
- init_utsname()->version);
- print_symbol("PC is at %s\n", instruction_pointer(regs));
- print_symbol("LR is at %s\n", regs->ARM_lr);
+ printk("PC is at %pA\n", instruction_pointer(regs));
@@ -2826,7 +2872,7 @@ index 047d3e4..7e96107 100644
printk("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n"
"sp : %08lx ip : %08lx fp : %08lx\n",
regs->ARM_pc, regs->ARM_lr, regs->ARM_cpsr,
-@@ -447,12 +447,6 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -426,12 +426,6 @@ unsigned long get_wchan(struct task_struct *p)
return 0;
}
@@ -2839,14 +2885,17 @@ index 047d3e4..7e96107 100644
#ifdef CONFIG_MMU
/*
* The vectors page is always readable from user space for the
-@@ -465,9 +459,8 @@ static int __init gate_vma_init(void)
- {
- gate_vma.vm_start = 0xffff0000;
- gate_vma.vm_end = 0xffff0000 + PAGE_SIZE;
-- gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
-- gate_vma.vm_flags = VM_READ | VM_EXEC |
-- VM_MAYREAD | VM_MAYEXEC;
-+ gate_vma.vm_flags = VM_NONE;
+@@ -441,12 +435,12 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
+ static struct vm_area_struct gate_vma = {
+ .vm_start = 0xffff0000,
+ .vm_end = 0xffff0000 + PAGE_SIZE,
+- .vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYEXEC,
++ .vm_flags = VM_NONE,
+ };
+
+ static int __init gate_vma_init(void)
+ {
+- gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
+ gate_vma.vm_page_prot = vm_get_page_prot(gate_vma.vm_flags);
return 0;
}
@@ -2889,10 +2938,10 @@ index 03deeff..741ce88 100644
if (secure_computing(scno) == -1)
return -1;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
-index 234e339..81264a1 100644
+index b4b1d39..efdc9be 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
-@@ -96,21 +96,23 @@ EXPORT_SYMBOL(system_serial_high);
+@@ -97,21 +97,23 @@ EXPORT_SYMBOL(system_serial_high);
unsigned int elf_hwcap __read_mostly;
EXPORT_SYMBOL(elf_hwcap);
@@ -2921,7 +2970,7 @@ index 234e339..81264a1 100644
EXPORT_SYMBOL(outer_cache);
#endif
-@@ -235,9 +237,13 @@ static int __get_cpu_architecture(void)
+@@ -236,9 +238,13 @@ static int __get_cpu_architecture(void)
asm("mrc p15, 0, %0, c0, c1, 4"
: "=r" (mmfr0));
if ((mmfr0 & 0x0000000f) >= 0x00000003 ||
@@ -2937,7 +2986,7 @@ index 234e339..81264a1 100644
(mmfr0 & 0x000000f0) == 0x00000020)
cpu_arch = CPU_ARCH_ARMv6;
else
-@@ -478,7 +484,7 @@ static void __init setup_processor(void)
+@@ -479,7 +485,7 @@ static void __init setup_processor(void)
__cpu_architecture = __get_cpu_architecture();
#ifdef MULTI_CPU
@@ -2981,7 +3030,7 @@ index 296786b..a8d4dd5 100644
regs->ARM_r0 = map_sig(ksig->sig);
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
-index 1f2cccc..f40c02e 100644
+index 5919eb4..b5d6dfe 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -70,7 +70,7 @@ enum ipi_msg_type {
@@ -2994,7 +3043,7 @@ index 1f2cccc..f40c02e 100644
void __init smp_set_ops(struct smp_operations *ops)
{
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
-index 1c08911..264f009 100644
+index 18b32e8..b0c8dca 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -57,7 +57,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long);
@@ -3006,7 +3055,7 @@ index 1c08911..264f009 100644
#else
printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
#endif
-@@ -266,6 +266,8 @@ static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
+@@ -259,6 +259,8 @@ static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
static int die_owner = -1;
static unsigned int die_nest_count;
@@ -3015,7 +3064,7 @@ index 1c08911..264f009 100644
static unsigned long oops_begin(void)
{
int cpu;
-@@ -308,6 +310,9 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
+@@ -301,6 +303,9 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
panic("Fatal exception in interrupt");
if (panic_on_oops)
panic("Fatal exception");
@@ -3025,7 +3074,7 @@ index 1c08911..264f009 100644
if (signr)
do_exit(signr);
}
-@@ -601,7 +606,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
+@@ -594,7 +599,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
* The user helper at 0xffff0fe0 must be used instead.
* (see entry-armv.S for details)
*/
@@ -3035,7 +3084,7 @@ index 1c08911..264f009 100644
}
return 0;
-@@ -841,13 +848,10 @@ void __init early_trap_init(void *vectors_base)
+@@ -834,13 +841,10 @@ void __init early_trap_init(void *vectors_base)
*/
kuser_get_tls_init(vectors);
@@ -3055,7 +3104,7 @@ index 1c08911..264f009 100644
+
}
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
-index b571484..4b2fc9b 100644
+index a871b8e..123b00a 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -8,7 +8,11 @@
@@ -3253,10 +3302,10 @@ index 025f742..8432b08 100644
/*
* This test is stubbed out of the main function above to keep
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
-index 49792a0..f192052 100644
+index f389228..592ef66 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
-@@ -150,7 +150,16 @@ static void clk_gate_fn_disable(struct clk_hw *hw)
+@@ -149,7 +149,16 @@ static void clk_gate_fn_disable(struct clk_hw *hw)
clk_gate_ops.disable(hw);
}
@@ -3274,7 +3323,7 @@ index 49792a0..f192052 100644
static struct clk __init *clk_register_gate_fn(struct device *dev,
const char *name,
-@@ -184,14 +193,6 @@ static struct clk __init *clk_register_gate_fn(struct device *dev,
+@@ -183,14 +192,6 @@ static struct clk __init *clk_register_gate_fn(struct device *dev,
gate_fn->fn_en = fn_en;
gate_fn->fn_dis = fn_dis;
@@ -3303,10 +3352,10 @@ index f6eeb87..cc90868 100644
};
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
-index 410e1ba..1d2dd59 100644
+index 6c4da12..d9ca72d 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
-@@ -145,7 +145,6 @@ struct omap3_gpmc_regs {
+@@ -147,7 +147,6 @@ struct omap3_gpmc_regs {
};
static struct gpmc_client_irq gpmc_client_irq[GPMC_NR_IRQ];
@@ -3314,7 +3363,7 @@ index 410e1ba..1d2dd59 100644
static unsigned gpmc_irq_start;
static struct resource gpmc_mem_root;
-@@ -707,6 +706,18 @@ static void gpmc_irq_noop(struct irq_data *data) { }
+@@ -711,6 +710,18 @@ static void gpmc_irq_noop(struct irq_data *data) { }
static unsigned int gpmc_irq_noop_ret(struct irq_data *data) { return 0; }
@@ -3333,7 +3382,7 @@ index 410e1ba..1d2dd59 100644
static int gpmc_setup_irq(void)
{
int i;
-@@ -721,15 +732,6 @@ static int gpmc_setup_irq(void)
+@@ -725,15 +736,6 @@ static int gpmc_setup_irq(void)
return gpmc_irq_start;
}
@@ -3363,7 +3412,7 @@ index f8bb3b9..831e7b8 100644
};
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
-index 381be7a..89b9c7e 100644
+index e6d2307..d057195 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -499,7 +499,7 @@ void omap_device_delete(struct omap_device *od)
@@ -3404,10 +3453,10 @@ index 044c31d..2ee0861 100644
struct omap_device *omap_device_alloc(struct platform_device *pdev,
struct omap_hwmod **ohs, int oh_cnt);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
-index 3a750de..4c9b88f 100644
+index 7341eff..fd75e34 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
-@@ -191,10 +191,10 @@ struct omap_hwmod_soc_ops {
+@@ -194,10 +194,10 @@ struct omap_hwmod_soc_ops {
int (*init_clkdm)(struct omap_hwmod *oh);
void (*update_context_lost)(struct omap_hwmod *oh);
int (*get_context_lost)(struct omap_hwmod *oh);
@@ -3444,10 +3493,23 @@ index d15c7bb..b2d1f0c 100644
pdev = omap_device_build(dev_name, id, oh, &pdata,
sizeof(struct omap_wd_timer_platform_data));
WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
-diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
-index bddce2b..3eb04e2 100644
---- a/arch/arm/mach-ux500/include/mach/setup.h
-+++ b/arch/arm/mach-ux500/include/mach/setup.h
+diff --git a/arch/arm/mach-tegra/cpuidle-tegra20.c b/arch/arm/mach-tegra/cpuidle-tegra20.c
+index 0cdba8d..297993e 100644
+--- a/arch/arm/mach-tegra/cpuidle-tegra20.c
++++ b/arch/arm/mach-tegra/cpuidle-tegra20.c
+@@ -181,7 +181,7 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
+ bool entered_lp2 = false;
+
+ if (tegra_pending_sgi())
+- ACCESS_ONCE(abort_flag) = true;
++ ACCESS_ONCE_RW(abort_flag) = true;
+
+ cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
+
+diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h
+index cad3ca86..1d79e0f 100644
+--- a/arch/arm/mach-ux500/setup.h
++++ b/arch/arm/mach-ux500/setup.h
@@ -37,13 +37,6 @@ extern void ux500_timer_init(void);
.type = MT_DEVICE, \
}
@@ -3463,10 +3525,10 @@ index bddce2b..3eb04e2 100644
extern void ux500_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
-index 4045c49..0263c07 100644
+index 35955b5..b475042 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
-@@ -425,7 +425,7 @@ config CPU_32v5
+@@ -432,7 +432,7 @@ config CPU_32v5
config CPU_32v6
bool
@@ -3475,7 +3537,7 @@ index 4045c49..0263c07 100644
select TLS_REG_EMUL if !CPU_32v6K && !MMU
config CPU_32v6K
-@@ -574,6 +574,7 @@ config CPU_CP15_MPU
+@@ -581,6 +581,7 @@ config CPU_CP15_MPU
config CPU_USE_DOMAINS
bool
@@ -3484,7 +3546,7 @@ index 4045c49..0263c07 100644
This option enables or disables the use of domain switching
via the set_fs() function.
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
-index db26e2e..ee44569 100644
+index 6f4585b..7b6f52b 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -211,10 +211,12 @@ union offset_union {
@@ -3733,7 +3795,7 @@ index cf08bdf..772656c 100644
unsigned long search_exception_table(unsigned long addr);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
-index ad722f1..763fdd3 100644
+index 9a5cdc0..a1182cf 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -30,6 +30,8 @@
@@ -3745,7 +3807,7 @@ index ad722f1..763fdd3 100644
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
-@@ -736,7 +738,46 @@ void free_initmem(void)
+@@ -726,7 +728,46 @@ void free_initmem(void)
{
#ifdef CONFIG_HAVE_TCM
extern char __tcm_start, __tcm_end;
@@ -3790,8 +3852,8 @@ index ad722f1..763fdd3 100644
+
+#ifdef CONFIG_HAVE_TCM
poison_init_mem(&__tcm_start, &__tcm_end - &__tcm_start);
- totalram_pages += free_area(__phys_to_pfn(__pa(&__tcm_start)),
- __phys_to_pfn(__pa(&__tcm_end)),
+ free_reserved_area(&__tcm_start, &__tcm_end, 0, "TCM link");
+ #endif
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 04d9006..c547d85 100644
--- a/arch/arm/mm/ioremap.c
@@ -3921,7 +3983,7 @@ index 10062ce..8695745 100644
mm->unmap_area = arch_unmap_area_topdown;
}
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
-index a84ff76..f221c1d 100644
+index 4d409e6..0015a7b 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -36,6 +36,22 @@
@@ -3947,9 +4009,9 @@ index a84ff76..f221c1d 100644
/*
* empty_zero_page is a special page that is used for
* zero-initialized data and COW.
-@@ -211,10 +227,18 @@ void adjust_cr(unsigned long mask, unsigned long set)
- }
- #endif
+@@ -228,10 +244,18 @@ __setup("noalign", noalign_setup);
+
+ #endif /* ifdef CONFIG_CPU_CP15 / else */
-#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN
+#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY
@@ -3968,7 +4030,7 @@ index a84ff76..f221c1d 100644
[MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */
.prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED |
L_PTE_SHARED,
-@@ -243,16 +267,16 @@ static struct mem_type mem_types[] = {
+@@ -260,16 +284,16 @@ static struct mem_type mem_types[] = {
[MT_UNCACHED] = {
.prot_pte = PROT_PTE_DEVICE,
.prot_l1 = PMD_TYPE_TABLE,
@@ -3988,7 +4050,7 @@ index a84ff76..f221c1d 100644
.domain = DOMAIN_KERNEL,
},
#endif
-@@ -260,36 +284,54 @@ static struct mem_type mem_types[] = {
+@@ -277,36 +301,54 @@ static struct mem_type mem_types[] = {
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
L_PTE_RDONLY,
.prot_l1 = PMD_TYPE_TABLE,
@@ -4052,7 +4114,7 @@ index a84ff76..f221c1d 100644
.domain = DOMAIN_KERNEL,
},
[MT_MEMORY_ITCM] = {
-@@ -299,10 +341,10 @@ static struct mem_type mem_types[] = {
+@@ -316,10 +358,10 @@ static struct mem_type mem_types[] = {
},
[MT_MEMORY_SO] = {
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
@@ -4065,7 +4127,7 @@ index a84ff76..f221c1d 100644
.domain = DOMAIN_KERNEL,
},
[MT_MEMORY_DMA_READY] = {
-@@ -388,9 +430,35 @@ static void __init build_mem_type_table(void)
+@@ -405,9 +447,35 @@ static void __init build_mem_type_table(void)
* to prevent speculative instruction fetches.
*/
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_XN;
@@ -4101,7 +4163,7 @@ index a84ff76..f221c1d 100644
}
if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
/*
-@@ -451,6 +519,9 @@ static void __init build_mem_type_table(void)
+@@ -468,6 +536,9 @@ static void __init build_mem_type_table(void)
* from SVC mode and no access from userspace.
*/
mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
@@ -4111,7 +4173,7 @@ index a84ff76..f221c1d 100644
mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
#endif
-@@ -468,11 +539,17 @@ static void __init build_mem_type_table(void)
+@@ -485,11 +556,17 @@ static void __init build_mem_type_table(void)
mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED;
@@ -4133,7 +4195,7 @@ index a84ff76..f221c1d 100644
}
}
-@@ -483,15 +560,20 @@ static void __init build_mem_type_table(void)
+@@ -500,15 +577,20 @@ static void __init build_mem_type_table(void)
if (cpu_arch >= CPU_ARCH_ARMv6) {
if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
/* Non-cacheable Normal is XCB = 001 */
@@ -4157,7 +4219,7 @@ index a84ff76..f221c1d 100644
}
#ifdef CONFIG_ARM_LPAE
-@@ -507,6 +589,8 @@ static void __init build_mem_type_table(void)
+@@ -524,6 +606,8 @@ static void __init build_mem_type_table(void)
vecs_pgprot |= PTE_EXT_AF;
#endif
@@ -4166,7 +4228,7 @@ index a84ff76..f221c1d 100644
for (i = 0; i < 16; i++) {
pteval_t v = pgprot_val(protection_map[i]);
protection_map[i] = __pgprot(v | user_pgprot);
-@@ -524,10 +608,15 @@ static void __init build_mem_type_table(void)
+@@ -541,10 +625,15 @@ static void __init build_mem_type_table(void)
mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;
@@ -4185,7 +4247,7 @@ index a84ff76..f221c1d 100644
mem_types[MT_ROM].prot_sect |= cp->pmd;
switch (cp->pmd) {
-@@ -1147,18 +1236,15 @@ void __init arm_mm_memblock_reserve(void)
+@@ -1166,18 +1255,15 @@ void __init arm_mm_memblock_reserve(void)
* called function. This means you can't use any function or debugging
* method which may touch any device, otherwise the kernel _will_ crash.
*/
@@ -4208,7 +4270,7 @@ index a84ff76..f221c1d 100644
for (addr = VMALLOC_START; addr; addr += PMD_SIZE)
pmd_clear(pmd_off_k(addr));
-@@ -1198,7 +1284,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
+@@ -1217,7 +1303,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
* location (0xffff0000). If we aren't using high-vectors, also
* create a mapping at the low-vectors virtual address.
*/
@@ -4217,7 +4279,7 @@ index a84ff76..f221c1d 100644
map.virtual = 0xffff0000;
map.length = PAGE_SIZE;
map.type = MT_HIGH_VECTORS;
-@@ -1256,8 +1342,39 @@ static void __init map_lowmem(void)
+@@ -1275,8 +1361,39 @@ static void __init map_lowmem(void)
map.pfn = __phys_to_pfn(start);
map.virtual = __phys_to_virt(start);
map.length = end - start;
@@ -4259,7 +4321,7 @@ index a84ff76..f221c1d 100644
}
}
diff --git a/arch/arm/mm/proc-v7-2level.S b/arch/arm/mm/proc-v7-2level.S
-index 78f520b..31f0cb6 100644
+index 9704097..3e36dde 100644
--- a/arch/arm/mm/proc-v7-2level.S
+++ b/arch/arm/mm/proc-v7-2level.S
@@ -99,6 +99,9 @@ ENTRY(cpu_v7_set_pte_ext)
@@ -4286,10 +4348,10 @@ index a5bc92d..0bb4730 100644
+ pax_close_kernel();
}
diff --git a/arch/arm/plat-samsung/include/plat/dma-ops.h b/arch/arm/plat-samsung/include/plat/dma-ops.h
-index 1141782..0959d64 100644
+index ce6d763..cfea917 100644
--- a/arch/arm/plat-samsung/include/plat/dma-ops.h
+++ b/arch/arm/plat-samsung/include/plat/dma-ops.h
-@@ -48,7 +48,7 @@ struct samsung_dma_ops {
+@@ -47,7 +47,7 @@ struct samsung_dma_ops {
int (*started)(unsigned ch);
int (*flush)(unsigned ch);
int (*stop)(unsigned ch);
@@ -4888,10 +4950,10 @@ index 24603be..948052d 100644
DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp);
}
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
-index 79521d5..43dddff 100644
+index 2b3c2d7..a318d84 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
-@@ -1006,7 +1006,7 @@ static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb,
+@@ -980,7 +980,7 @@ static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}
@@ -4901,10 +4963,10 @@ index 79521d5..43dddff 100644
.notifier_call = palinfo_cpu_callback,
.priority = 0,
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
-index aa527d7..f237752 100644
+index 4bc580a..7767f24 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
-@@ -616,7 +616,7 @@ salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu
+@@ -609,7 +609,7 @@ salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu
return NOTIFY_OK;
}
@@ -5045,7 +5107,7 @@ index 76069c1..c2aa816 100644
}
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
-index 20bc967..a26993e 100644
+index d1fe4b4..2628f37 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -120,6 +120,19 @@ ia64_init_addr_space (void)
@@ -5242,10 +5304,10 @@ index c1f6afa..38cc6e9 100644
#endif /* _ASM_EXEC_H */
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
-index eab99e5..607c98e 100644
+index f59552f..3abe9b9 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
-@@ -96,7 +96,7 @@ extern void copy_user_highpage(struct page *to, struct page *from,
+@@ -95,7 +95,7 @@ extern void copy_user_highpage(struct page *to, struct page *from,
#ifdef CONFIG_CPU_MIPS32
typedef struct { unsigned long pte_low, pte_high; } pte_t;
#define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
@@ -5271,10 +5333,10 @@ index 881d18b..cea38bc 100644
/*
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
-index 178f792..8ebc510 100644
+index 895320e..bf63e10 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
-@@ -111,6 +111,8 @@ register struct thread_info *__current_thread_info __asm__("$28");
+@@ -115,6 +115,8 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_32BIT_ADDR 23 /* 32-bit address space (o32/n32) */
#define TIF_FPUBOUND 24 /* thread bound to FPU-full CPU set */
#define TIF_LOAD_WATCH 25 /* If set, load watch registers */
@@ -5283,7 +5345,7 @@ index 178f792..8ebc510 100644
#define TIF_SYSCALL_TRACE 31 /* syscall trace active */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
-@@ -126,15 +128,18 @@ register struct thread_info *__current_thread_info __asm__("$28");
+@@ -130,15 +132,18 @@ static inline struct thread_info *current_thread_info(void)
#define _TIF_32BIT_ADDR (1<<TIF_32BIT_ADDR)
#define _TIF_FPUBOUND (1<<TIF_FPUBOUND)
#define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH)
@@ -5305,7 +5367,7 @@ index 178f792..8ebc510 100644
#endif /* __KERNEL__ */
diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c
-index e06f777..3244284 100644
+index 1188e00..41cf144 100644
--- a/arch/mips/kernel/binfmt_elfn32.c
+++ b/arch/mips/kernel/binfmt_elfn32.c
@@ -50,6 +50,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
@@ -5323,10 +5385,10 @@ index e06f777..3244284 100644
#include <linux/module.h>
#include <linux/elfcore.h>
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
-index 556a435..b4fd2e3 100644
+index 202e581..689ca79 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
-@@ -52,6 +52,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+@@ -56,6 +56,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
#undef ELF_ET_DYN_BASE
#define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2)
@@ -5341,10 +5403,10 @@ index 556a435..b4fd2e3 100644
/*
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
-index 3be4405..a799827 100644
+index c6a041d..b3e7318 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
-@@ -461,15 +461,3 @@ unsigned long get_wchan(struct task_struct *task)
+@@ -563,15 +563,3 @@ unsigned long get_wchan(struct task_struct *task)
out:
return pc;
}
@@ -5388,7 +5450,7 @@ index 9c6299c..2fb4c22 100644
goto out;
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
-index 9ea2964..c4329c3 100644
+index 9b36424..e7f4154 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -52,7 +52,7 @@ NESTED(handle_sys, PT_SIZE, sp)
@@ -5401,7 +5463,7 @@ index 9ea2964..c4329c3 100644
bnez t0, syscall_trace_entry # -> yes
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
-index 36cfd40..b1436e0 100644
+index 97a5909..59622f8 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -54,7 +54,7 @@ NESTED(handle_sys64, PT_SIZE, sp)
@@ -5414,7 +5476,7 @@ index 36cfd40..b1436e0 100644
and t0, t1, t0
bnez t0, syscall_trace_entry
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
-index 693d60b..ae0ba75 100644
+index edcb659..fb2ab09 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -47,7 +47,7 @@ NESTED(handle_sysn32, PT_SIZE, sp)
@@ -5427,7 +5489,7 @@ index 693d60b..ae0ba75 100644
and t0, t1, t0
bnez t0, n32_syscall_trace_entry
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
-index af8887f..611ccb6 100644
+index 74f485d..47d2c38 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -81,7 +81,7 @@ NESTED(handle_sys, PT_SIZE, sp)
@@ -5635,12 +5697,12 @@ index 4ce7a01..449202a 100644
#endif /* __ASM_OPENRISC_CACHE_H */
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
-index f38e198..4179e38 100644
+index 472886c..00e7df9 100644
--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
-@@ -229,6 +229,16 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
-
- #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
+@@ -252,6 +252,16 @@ static inline long atomic64_dec_if_positive(atomic64_t *v)
+ return dec;
+ }
+#define atomic64_read_unchecked(v) atomic64_read(v)
+#define atomic64_set_unchecked(v, i) atomic64_set((v), (i))
@@ -5942,10 +6004,10 @@ index 5dfd248..64914ac 100644
return addr;
}
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
-index c6ae9f5..e9c3cf4 100644
+index 04e47c6..7a8faf6 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)
+@@ -727,9 +727,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
down_read(&current->mm->mmap_sem);
vma = find_vma(current->mm,regs->iaoq[0]);
@@ -6172,7 +6234,7 @@ index 9e495c9..b6878e5 100644
#define SMP_CACHE_BYTES L1_CACHE_BYTES
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
-index ac9790f..6d30741 100644
+index cc0655a..13eac2e 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -28,8 +28,19 @@
@@ -6197,7 +6259,7 @@ index ac9790f..6d30741 100644
/*
* Our registers are always unsigned longs, whether we're a 32 bit
-@@ -122,10 +133,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
+@@ -123,10 +134,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
(0x7ff >> (PAGE_SHIFT - 12)) : \
(0x3ffff >> (PAGE_SHIFT - 12)))
@@ -6247,7 +6309,7 @@ index 8565c25..2865190 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 f072e97..b436dee 100644
+index 988c812..63c7d70 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -220,8 +220,9 @@ extern long long virt_phys_offset;
@@ -6269,14 +6331,14 @@ index f072e97..b436dee 100644
+#define ktla_ktva(addr) (addr)
+#define ktva_ktla(addr) (addr)
+
+ #ifndef CONFIG_PPC_BOOK3S_64
/*
* 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 cd915d6..c10cee8 100644
+index 88693ce..ac6f9ab 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
-@@ -154,15 +154,18 @@ do { \
+@@ -153,15 +153,18 @@ do { \
* stack by default, so in the absence of a PT_GNU_STACK program header
* we turn execute permission off.
*/
@@ -6298,10 +6360,10 @@ index cd915d6..c10cee8 100644
#include <asm-generic/getorder.h>
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
-index 292725c..f87ae14 100644
+index b66ae72..4a378cd 100644
--- a/arch/powerpc/include/asm/pgalloc-64.h
+++ b/arch/powerpc/include/asm/pgalloc-64.h
-@@ -50,6 +50,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
+@@ -53,6 +53,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
#ifndef CONFIG_PPC_64K_PAGES
#define pgd_populate(MM, PGD, PUD) pgd_set(PGD, PUD)
@@ -6309,7 +6371,7 @@ index 292725c..f87ae14 100644
static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
{
-@@ -67,6 +68,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
+@@ -70,6 +71,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
pud_set(pud, (unsigned long)pmd);
}
@@ -6321,8 +6383,8 @@ index 292725c..f87ae14 100644
#define pmd_populate(mm, pmd, pte_page) \
pmd_populate_kernel(mm, pmd, page_address(pte_page))
#define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, (unsigned long)(pte))
-@@ -76,6 +82,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
- #else /* CONFIG_PPC_64K_PAGES */
+@@ -171,6 +177,7 @@ extern void __tlb_remove_table(void *_table);
+ #endif
#define pud_populate(mm, pud, pmd) pud_set(pud, (unsigned long)pmd)
+#define pud_populate_kernel(mm, pud, pmd) pud_populate((mm), (pud), (pmd))
@@ -6330,7 +6392,7 @@ index 292725c..f87ae14 100644
static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
pte_t *pte)
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
-index a9cbd3b..3b67efa 100644
+index 7aeb955..19f748e 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -2,6 +2,7 @@
@@ -6354,7 +6416,7 @@ 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 3b097a8..8f8c774 100644
+index 4a9e408..724aa59 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -234,6 +234,7 @@
@@ -6366,7 +6428,7 @@ index 3b097a8..8f8c774 100644
#define DSISR_ISSTORE 0x02000000 /* access was a store */
#define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
-index 195ce2a..ab5c614 100644
+index ffbaabe..eabe843 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -50,7 +50,7 @@ struct smp_ops_t {
@@ -6379,36 +6441,36 @@ index 195ce2a..ab5c614 100644
extern void smp_send_debugger_break(void);
extern void start_secondary_resume(void);
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
-index 406b7b9..af63426 100644
+index ba7b197..d292e26 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
-@@ -97,7 +97,6 @@ static inline struct thread_info *current_thread_info(void)
+@@ -93,7 +93,6 @@ static inline struct thread_info *current_thread_info(void)
+ #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
+ TIF_NEED_RESCHED */
+ #define TIF_32BIT 4 /* 32 bit binary */
+-#define TIF_PERFMON_WORK 5 /* work for pfm_handle_work() */
#define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */
#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
#define TIF_SINGLESTEP 8 /* singlestepping active */
--#define TIF_MEMDIE 9 /* is terminating due to OOM killer */
- #define TIF_SECCOMP 10 /* secure computing */
- #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */
- #define TIF_NOERROR 12 /* Force successful syscall return */
-@@ -106,6 +105,9 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */
+@@ -107,6 +106,9 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation
for stack store? */
-+#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
+ #define TIF_MEMDIE 17 /* is terminating due to OOM killer */
++#define TIF_PERFMON_WORK 18 /* work for pfm_handle_work() */
+/* mask must be expressable within 16 bits to satisfy 'andi' instruction reqs */
-+#define TIF_GRSEC_SETXID 9 /* update credentials on syscall entry/exit */
++#define TIF_GRSEC_SETXID 5 /* update credentials on syscall entry/exit */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
-@@ -124,8 +126,10 @@ static inline struct thread_info *current_thread_info(void)
- #define _TIF_UPROBE (1<<TIF_UPROBE)
+@@ -126,9 +128,10 @@ static inline struct thread_info *current_thread_info(void)
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
#define _TIF_EMULATE_STACK_STORE (1<<TIF_EMULATE_STACK_STORE)
+ #define _TIF_NOHZ (1<<TIF_NOHZ)
+#define _TIF_GRSEC_SETXID (1<<TIF_GRSEC_SETXID)
#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
-- _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
-+ _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \
-+ _TIF_GRSEC_SETXID)
+ _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \
+- _TIF_NOHZ)
++ _TIF_NOHZ | _TIF_GRSEC_SETXID)
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
_TIF_NOTIFY_RESUME | _TIF_UPROBE)
@@ -6585,10 +6647,10 @@ index 4db4959..aba5c41 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 ae54553..cf2184d 100644
+index 645170a..6cf0271 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
-@@ -716,6 +716,7 @@ storage_fault_common:
+@@ -757,6 +757,7 @@ storage_fault_common:
std r14,_DAR(r1)
std r15,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD
@@ -6596,7 +6658,7 @@ index ae54553..cf2184d 100644
mr r4,r14
mr r5,r15
ld r14,PACA_EXGEN+EX_R14(r13)
-@@ -724,8 +725,7 @@ storage_fault_common:
+@@ -765,8 +766,7 @@ storage_fault_common:
cmpdi r3,0
bne- 1f
b .ret_from_except_lite
@@ -6607,10 +6669,10 @@ index ae54553..cf2184d 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 644378e..b6f2c26 100644
+index 40e4a17..5a84b37 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
-@@ -1390,10 +1390,10 @@ handle_page_fault:
+@@ -1362,10 +1362,10 @@ handle_page_fault:
11: ld r4,_DAR(r1)
ld r5,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD
@@ -6656,10 +6718,10 @@ index 2e3200c..72095ce 100644
/* Find this entry, or if that fails, the next avail. entry */
while (entry->jump[0]) {
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
-index 0d86c8a..df4c5f2 100644
+index 076d124..6cb2cbf 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
-@@ -871,8 +871,8 @@ void show_regs(struct pt_regs * regs)
+@@ -874,8 +874,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
*/
@@ -6670,7 +6732,7 @@ index 0d86c8a..df4c5f2 100644
#endif
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
printk("PACATMSCRATCH [%llx]\n", get_paca()->tm_scratch);
-@@ -1331,10 +1331,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1335,10 +1335,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
newsp = stack[0];
ip = stack[STACK_FRAME_LR_SAVE];
if (!firstframe || ip != lr) {
@@ -6683,7 +6745,7 @@ index 0d86c8a..df4c5f2 100644
(void *)current->ret_stack[curr_frame].ret);
curr_frame--;
}
-@@ -1354,7 +1354,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1358,7 +1358,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;
@@ -6692,7 +6754,7 @@ index 0d86c8a..df4c5f2 100644
regs->trap, (void *)regs->nip, (void *)lr);
firstframe = 1;
}
-@@ -1396,58 +1396,3 @@ void notrace __ppc64_runlatch_off(void)
+@@ -1394,58 +1394,3 @@ void notrace __ppc64_runlatch_off(void)
mtspr(SPRN_CTRLT, ctrl);
}
#endif /* CONFIG_PPC64 */
@@ -6752,10 +6814,10 @@ index 0d86c8a..df4c5f2 100644
- return ret;
-}
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
-index f9b30c6..d72e7a3 100644
+index 98c2fc1..b73a4ca 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
-@@ -1771,6 +1771,10 @@ long arch_ptrace(struct task_struct *child, long request,
+@@ -1781,6 +1781,10 @@ long arch_ptrace(struct task_struct *child, long request,
return ret;
}
@@ -6766,7 +6828,7 @@ index f9b30c6..d72e7a3 100644
/*
* We must return the syscall number to actually look up in the table.
* This can be -1L to skip running any syscall at all.
-@@ -1781,6 +1785,11 @@ long do_syscall_trace_enter(struct pt_regs *regs)
+@@ -1793,6 +1797,11 @@ long do_syscall_trace_enter(struct pt_regs *regs)
secure_computing_strict(regs->gpr[0]);
@@ -6778,7 +6840,7 @@ index f9b30c6..d72e7a3 100644
if (test_thread_flag(TIF_SYSCALL_TRACE) &&
tracehook_report_syscall_entry(regs))
/*
-@@ -1815,6 +1824,11 @@ void do_syscall_trace_leave(struct pt_regs *regs)
+@@ -1827,6 +1836,11 @@ void do_syscall_trace_leave(struct pt_regs *regs)
{
int step;
@@ -6817,7 +6879,7 @@ index 3459473..2d40783 100644
} else {
err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
-index 3ce1f86..c30e629 100644
+index e68a845..8b140e6 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -522,7 +522,7 @@ static int __cpuinit sysfs_cpu_notify(struct notifier_block *self,
@@ -6830,10 +6892,10 @@ index 3ce1f86..c30e629 100644
};
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
-index bf33ace..e836d8b 100644
+index c0e5caf..68e8305 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
-@@ -142,6 +142,8 @@ static unsigned __kprobes long oops_begin(struct pt_regs *regs)
+@@ -143,6 +143,8 @@ static unsigned __kprobes long oops_begin(struct pt_regs *regs)
return flags;
}
@@ -6842,7 +6904,7 @@ index bf33ace..e836d8b 100644
static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs,
int signr)
{
-@@ -191,6 +193,9 @@ static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs,
+@@ -192,6 +194,9 @@ static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs,
panic("Fatal exception in interrupt");
if (panic_on_oops)
panic("Fatal exception");
@@ -6853,7 +6915,7 @@ index bf33ace..e836d8b 100644
}
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
-index 1b2076f..835e4be 100644
+index d4f463a..8fb7431 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -34,6 +34,7 @@
@@ -6864,7 +6926,7 @@ index 1b2076f..835e4be 100644
#include "setup.h"
-@@ -218,7 +219,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -222,7 +223,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
vdso_base = VDSO32_MBASE;
#endif
@@ -6873,7 +6935,7 @@ index 1b2076f..835e4be 100644
/* vDSO has a problem and was disabled, just don't "enable" it for the
* process
-@@ -238,7 +239,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -242,7 +243,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),
@@ -6918,13 +6980,13 @@ index 5eea6f3..5d10396 100644
EXPORT_SYMBOL(copy_in_user);
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
-index 229951f..cdeca42 100644
+index 8726779..a33c512 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
-@@ -32,6 +32,10 @@
- #include <linux/perf_event.h>
+@@ -33,6 +33,10 @@
#include <linux/magic.h>
#include <linux/ratelimit.h>
+ #include <linux/context_tracking.h>
+#include <linux/slab.h>
+#include <linux/pagemap.h>
+#include <linux/compiler.h>
@@ -6932,7 +6994,7 @@ index 229951f..cdeca42 100644
#include <asm/firmware.h>
#include <asm/page.h>
-@@ -68,6 +72,33 @@ static inline int notify_page_fault(struct pt_regs *regs)
+@@ -69,6 +73,33 @@ static inline int notify_page_fault(struct pt_regs *regs)
}
#endif
@@ -6966,7 +7028,7 @@ index 229951f..cdeca42 100644
/*
* Check whether the instruction at regs->nip is a store using
* an update addressing form which will update r1.
-@@ -213,7 +244,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
+@@ -216,7 +247,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
* indicate errors in DSISR but can validly be set in SRR1.
*/
if (trap == 0x400)
@@ -6975,7 +7037,7 @@ index 229951f..cdeca42 100644
else
is_write = error_code & DSISR_ISSTORE;
#else
-@@ -364,7 +395,7 @@ good_area:
+@@ -371,7 +402,7 @@ good_area:
* "undefined". Of those that can be set, this is the only
* one which seems bad.
*/
@@ -6984,7 +7046,7 @@ index 229951f..cdeca42 100644
/* Guarded storage error. */
goto bad_area;
#endif /* CONFIG_8xx */
-@@ -379,7 +410,7 @@ good_area:
+@@ -386,7 +417,7 @@ good_area:
* processors use the same I/D cache coherency mechanism
* as embedded.
*/
@@ -6993,7 +7055,7 @@ index 229951f..cdeca42 100644
goto bad_area;
#endif /* CONFIG_PPC_STD_MMU */
-@@ -462,6 +493,23 @@ bad_area:
+@@ -471,6 +502,23 @@ bad_area:
bad_area_nosemaphore:
/* User mode accesses cause a SIGSEGV */
if (user_mode(regs)) {
@@ -7015,7 +7077,7 @@ index 229951f..cdeca42 100644
+#endif
+
_exception(SIGSEGV, regs, code, address);
- return 0;
+ goto bail;
}
diff --git a/arch/powerpc/mm/mmap_64.c b/arch/powerpc/mm/mmap_64.c
index 67a42ed..cd463e0 100644
@@ -7069,10 +7131,10 @@ index e779642..e5bb889 100644
};
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
-index 6a252c4..3024d81 100644
+index 88c0425..717feb8 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
-@@ -932,7 +932,7 @@ static void __init *careful_zallocation(int nid, unsigned long size,
+@@ -919,7 +919,7 @@ static void __init *careful_zallocation(int nid, unsigned long size,
return ret;
}
@@ -7082,7 +7144,7 @@ index 6a252c4..3024d81 100644
.priority = 1 /* Must run before sched domains notifier. */
};
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
-index cf9dada..241529f 100644
+index 3e99c14..f00953c 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -103,7 +103,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr,
@@ -7094,52 +7156,20 @@ index cf9dada..241529f 100644
}
static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice)
-@@ -272,7 +272,7 @@ full_search:
- addr = _ALIGN_UP(addr + 1, 1ul << SLICE_HIGH_SHIFT);
- continue;
- }
-- if (!vma || addr + len <= vma->vm_start) {
-+ if (check_heap_stack_gap(vma, addr, len, 0)) {
- /*
- * Remember the place where we stopped the search:
- */
-@@ -329,10 +329,14 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
- }
- }
+@@ -277,6 +277,12 @@ static unsigned long slice_find_area_bottomup(struct mm_struct *mm,
+ info.align_offset = 0;
-- addr = mm->mmap_base;
-- while (addr > len) {
-+ if (mm->mmap_base < len)
-+ addr = -ENOMEM;
-+ else
-+ addr = mm->mmap_base - len;
+ addr = TASK_UNMAPPED_BASE;
+
-+ while (!IS_ERR_VALUE(addr)) {
- /* Go down by chunk size */
-- addr = _ALIGN_DOWN(addr - len, 1ul << pshift);
-+ addr = _ALIGN_DOWN(addr, 1ul << pshift);
-
- /* Check for hit with different page size */
- mask = slice_range_to_mask(addr, len);
-@@ -352,7 +356,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
- * return with success:
- */
- vma = find_vma(mm, addr);
-- if (!vma || (addr + len) <= vma->vm_start) {
-+ if (check_heap_stack_gap(vma, addr, len, 0)) {
- /* remember the address as a hint for next time */
- if (use_cache)
- mm->free_area_cache = addr;
-@@ -364,7 +368,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
- mm->cached_hole_size = vma->vm_start - addr;
-
- /* try just below the current vma->vm_start */
-- addr = vma->vm_start;
-+ addr = skip_heap_stack_gap(vma, len, 0);
- }
-
- /*
-@@ -442,6 +446,11 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
++#ifdef CONFIG_PAX_RANDMMAP
++ if (mm->pax_flags & MF_PAX_RANDMMAP)
++ addr += mm->delta_mmap;
++#endif
++
+ while (addr < TASK_SIZE) {
+ info.low_limit = addr;
+ if (!slice_scan_available(addr, available, 1, &addr))
+@@ -410,6 +416,11 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
if (fixed && addr > (mm->task_size - len))
return -EINVAL;
@@ -7152,10 +7182,10 @@ index cf9dada..241529f 100644
if (!fixed && addr) {
addr = _ALIGN_UP(addr, 1ul << pshift);
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
-index 68c57d3..1fdcfb2 100644
+index 9098692..3d54cd1 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
-@@ -281,9 +281,9 @@ spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+@@ -280,9 +280,9 @@ spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
return VM_FAULT_NOPAGE;
}
@@ -7218,10 +7248,10 @@ index 4d7ccac..d03d0ad 100644
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
-index 1bfdf24..9c9ab2e 100644
+index 78f4f87..598ce39 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
-@@ -160,8 +160,14 @@ extern unsigned int vdso_enabled;
+@@ -162,8 +162,14 @@ extern unsigned int vdso_enabled;
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */
@@ -7238,7 +7268,7 @@ index 1bfdf24..9c9ab2e 100644
/* This yields a mask that user programs can use to figure out what
instruction set this CPU supports. */
-@@ -207,9 +213,6 @@ struct linux_binprm;
+@@ -222,9 +228,6 @@ struct linux_binprm;
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
int arch_setup_additional_pages(struct linux_binprm *, int);
@@ -7378,10 +7408,10 @@ index 7845e15..59c4353 100644
if (r_type == R_390_GOTPC)
rc = apply_rela_bits(loc, val, 1, 32, 0);
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
-index 536d645..4a5bd9e 100644
+index 2bc3edd..ab9d598 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
-@@ -250,39 +250,3 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -236,39 +236,3 @@ unsigned long get_wchan(struct task_struct *p)
}
return 0;
}
@@ -7499,10 +7529,10 @@ index f9f3cd5..58ff438 100644
#endif /* _ASM_SCORE_EXEC_H */
diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c
-index 7956846..5f37677 100644
+index f4c6d02..e9355c3 100644
--- a/arch/score/kernel/process.c
+++ b/arch/score/kernel/process.c
-@@ -134,8 +134,3 @@ unsigned long get_wchan(struct task_struct *task)
+@@ -116,8 +116,3 @@ unsigned long get_wchan(struct task_struct *task)
return task_pt_regs(task)->cp0_epc;
}
@@ -8048,7 +8078,7 @@ index 9689176..63c18ea 100644
unsigned long mask, tmp1, tmp2, result;
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
-index 25849ae..924c54b 100644
+index dd38075..e7cac83 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -49,6 +49,8 @@ struct thread_info {
@@ -8061,7 +8091,7 @@ index 25849ae..924c54b 100644
/*
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
-index 269bd92..e46a9b8 100644
+index d5e5042..9bfee76 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -63,6 +63,8 @@ struct thread_info {
@@ -8218,7 +8248,7 @@ index e562d3c..191f176 100644
ret = copy_to_user_fixup(to, from, size);
return ret;
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
-index 6cf591b..b49e65a 100644
+index d432fb2..6056af1 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -3,7 +3,7 @@
@@ -8231,10 +8261,10 @@ index 6cf591b..b49e65a 100644
extra-y := head_$(BITS).o
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
-index 62eede1..9c5b904 100644
+index fdd819d..5af08c8 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
-@@ -125,14 +125,14 @@ void show_regs(struct pt_regs *r)
+@@ -116,14 +116,14 @@ void show_regs(struct pt_regs *r)
printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n",
r->psr, r->pc, r->npc, r->y, print_tainted());
@@ -8251,7 +8281,7 @@ index 62eede1..9c5b904 100644
printk("%%L: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3],
-@@ -167,7 +167,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
+@@ -160,7 +160,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
rw = (struct reg_window32 *) fp;
pc = rw->ins[7];
printk("[%08lx : ", pc);
@@ -8261,10 +8291,10 @@ index 62eede1..9c5b904 100644
} while (++count < 16);
printk("\n");
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
-index cdb80b2..5ca141d 100644
+index baebab2..9cd13b1 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
-@@ -181,14 +181,14 @@ static void show_regwindow(struct pt_regs *regs)
+@@ -158,7 +158,7 @@ static void show_regwindow(struct pt_regs *regs)
printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n",
rwk->ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]);
if (regs->tstate & TSTATE_PRIV)
@@ -8273,7 +8303,8 @@ index cdb80b2..5ca141d 100644
}
void show_regs(struct pt_regs *regs)
- {
+@@ -167,7 +167,7 @@ void show_regs(struct pt_regs *regs)
+
printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x %s\n", regs->tstate,
regs->tpc, regs->tnpc, regs->y, print_tainted());
- printk("TPC: <%pS>\n", (void *) regs->tpc);
@@ -8281,7 +8312,7 @@ index cdb80b2..5ca141d 100644
printk("g0: %016lx g1: %016lx g2: %016lx g3: %016lx\n",
regs->u_regs[0], regs->u_regs[1], regs->u_regs[2],
regs->u_regs[3]);
-@@ -201,7 +201,7 @@ void show_regs(struct pt_regs *regs)
+@@ -180,7 +180,7 @@ void show_regs(struct pt_regs *regs)
printk("o4: %016lx o5: %016lx sp: %016lx ret_pc: %016lx\n",
regs->u_regs[12], regs->u_regs[13], regs->u_regs[14],
regs->u_regs[15]);
@@ -8290,7 +8321,7 @@ index cdb80b2..5ca141d 100644
show_regwindow(regs);
show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]);
}
-@@ -290,7 +290,7 @@ void arch_trigger_all_cpu_backtrace(void)
+@@ -269,7 +269,7 @@ void arch_trigger_all_cpu_backtrace(void)
((tp && tp->task) ? tp->task->pid : -1));
if (gp->tstate & TSTATE_PRIV) {
@@ -8300,10 +8331,10 @@ index cdb80b2..5ca141d 100644
(void *) gp->o7,
(void *) gp->i7,
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
-index 9f20566..67eb41b 100644
+index 79cc0d1..ec62734 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
-@@ -143,7 +143,7 @@ static int __init prom_common_nextprop(phandle node, char *prev, char *buf)
+@@ -144,7 +144,7 @@ static int __init prom_common_nextprop(phandle node, char *prev, char *buf)
unsigned int prom_early_allocated __initdata;
@@ -8365,7 +8396,7 @@ index 3a8d184..49498a8 100644
info.flags = 0;
info.length = len;
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
-index 708bc29..6bfdfad 100644
+index 2daaaa6..d29bb82 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -90,13 +90,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
@@ -8610,7 +8641,7 @@ index 6629829..036032d 100644
}
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
-index 8d38ca9..845b1d6 100644
+index b3f833a..ac74b2d 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -76,7 +76,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
@@ -8720,7 +8751,7 @@ index 8d38ca9..845b1d6 100644
graph++;
}
}
-@@ -2367,6 +2378,8 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
+@@ -2360,6 +2371,8 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
return (struct reg_window *) (fp + STACK_BIAS);
}
@@ -8729,7 +8760,7 @@ index 8d38ca9..845b1d6 100644
void die_if_kernel(char *str, struct pt_regs *regs)
{
static int die_counter;
-@@ -2395,7 +2408,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
+@@ -2388,7 +2401,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
while (rw &&
count++ < 30 &&
kstack_valid(tp, (unsigned long) rw)) {
@@ -8738,7 +8769,7 @@ index 8d38ca9..845b1d6 100644
(void *) rw->ins[7]);
rw = kernel_stack_up(rw);
-@@ -2408,8 +2421,10 @@ void die_if_kernel(char *str, struct pt_regs *regs)
+@@ -2401,8 +2414,10 @@ void die_if_kernel(char *str, struct pt_regs *regs)
}
user_instruction_dump ((unsigned int __user *) regs->tpc);
}
@@ -8763,117 +8794,8 @@ index 8201c25e..072a2a7 100644
regs->tpc, (void *) regs->tpc);
}
}
-diff --git a/arch/sparc/kernel/us3_cpufreq.c b/arch/sparc/kernel/us3_cpufreq.c
-index eb1624b..55100de 100644
---- a/arch/sparc/kernel/us3_cpufreq.c
-+++ b/arch/sparc/kernel/us3_cpufreq.c
-@@ -18,14 +18,12 @@
- #include <asm/head.h>
- #include <asm/timer.h>
-
--static struct cpufreq_driver *cpufreq_us3_driver;
--
- struct us3_freq_percpu_info {
- struct cpufreq_frequency_table table[4];
- };
-
- /* Indexed by cpu number. */
--static struct us3_freq_percpu_info *us3_freq_table;
-+static struct us3_freq_percpu_info us3_freq_table[NR_CPUS];
-
- /* UltraSPARC-III has three dividers: 1, 2, and 32. These are controlled
- * in the Safari config register.
-@@ -191,12 +189,25 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
-
- static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
- {
-- if (cpufreq_us3_driver)
-- us3_set_cpu_divider_index(policy->cpu, 0);
-+ us3_set_cpu_divider_index(policy->cpu, 0);
-
- return 0;
- }
-
-+static int __init us3_freq_init(void);
-+static void __exit us3_freq_exit(void);
-+
-+static struct cpufreq_driver cpufreq_us3_driver = {
-+ .init = us3_freq_cpu_init,
-+ .verify = us3_freq_verify,
-+ .target = us3_freq_target,
-+ .get = us3_freq_get,
-+ .exit = us3_freq_cpu_exit,
-+ .owner = THIS_MODULE,
-+ .name = "UltraSPARC-III",
-+
-+};
-+
- static int __init us3_freq_init(void)
- {
- unsigned long manuf, impl, ver;
-@@ -213,57 +224,15 @@ static int __init us3_freq_init(void)
- (impl == CHEETAH_IMPL ||
- impl == CHEETAH_PLUS_IMPL ||
- impl == JAGUAR_IMPL ||
-- impl == PANTHER_IMPL)) {
-- struct cpufreq_driver *driver;
--
-- ret = -ENOMEM;
-- driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL);
-- if (!driver)
-- goto err_out;
--
-- us3_freq_table = kzalloc(
-- (NR_CPUS * sizeof(struct us3_freq_percpu_info)),
-- GFP_KERNEL);
-- if (!us3_freq_table)
-- goto err_out;
--
-- driver->init = us3_freq_cpu_init;
-- driver->verify = us3_freq_verify;
-- driver->target = us3_freq_target;
-- driver->get = us3_freq_get;
-- driver->exit = us3_freq_cpu_exit;
-- driver->owner = THIS_MODULE,
-- strcpy(driver->name, "UltraSPARC-III");
--
-- cpufreq_us3_driver = driver;
-- ret = cpufreq_register_driver(driver);
-- if (ret)
-- goto err_out;
--
-- return 0;
--
--err_out:
-- if (driver) {
-- kfree(driver);
-- cpufreq_us3_driver = NULL;
-- }
-- kfree(us3_freq_table);
-- us3_freq_table = NULL;
-- return ret;
-- }
-+ impl == PANTHER_IMPL))
-+ return cpufreq_register_driver(&cpufreq_us3_driver);
-
- return -ENODEV;
- }
-
- static void __exit us3_freq_exit(void)
- {
-- if (cpufreq_us3_driver) {
-- cpufreq_unregister_driver(cpufreq_us3_driver);
-- kfree(cpufreq_us3_driver);
-- cpufreq_us3_driver = NULL;
-- kfree(us3_freq_table);
-- us3_freq_table = NULL;
-- }
-+ cpufreq_unregister_driver(&cpufreq_us3_driver);
- }
-
- MODULE_AUTHOR("David S. Miller <davem@redhat.com>");
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
-index 8410065f2..4fd4ca22 100644
+index dbe119b..089c7c1 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -2,7 +2,7 @@
@@ -10036,20 +9958,6 @@ index d2b5944..bd813f2 100644
return addr;
}
if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/sparc/mm/tlb.c b/arch/sparc/mm/tlb.c
-index 83d89bc..37e7bc4 100644
---- a/arch/sparc/mm/tlb.c
-+++ b/arch/sparc/mm/tlb.c
-@@ -85,8 +85,8 @@ static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr,
- }
-
- if (!tb->active) {
-- global_flush_tlb_page(mm, vaddr);
- flush_tsb_user_page(mm, vaddr);
-+ global_flush_tlb_page(mm, vaddr);
- goto out;
- }
-
diff --git a/arch/tile/include/asm/atomic_64.h b/arch/tile/include/asm/atomic_64.h
index f4500c6..889656c 100644
--- a/arch/tile/include/asm/atomic_64.h
@@ -10090,10 +9998,10 @@ index a9a5299..0fce79e 100644
/* bytes per L2 cache line */
#define L2_CACHE_SHIFT CHIP_L2_LOG_LINE_SIZE()
diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm/uaccess.h
-index 9ab078a..d6635c2 100644
+index 8a082bc..7a6bf87 100644
--- a/arch/tile/include/asm/uaccess.h
+++ b/arch/tile/include/asm/uaccess.h
-@@ -403,9 +403,9 @@ static inline unsigned long __must_check copy_from_user(void *to,
+@@ -408,9 +408,9 @@ static inline unsigned long __must_check copy_from_user(void *to,
const void __user *from,
unsigned long n)
{
@@ -10211,10 +10119,10 @@ index 0032f92..cd151e0 100644
#ifdef CONFIG_64BIT
#define set_pud(pudptr, pudval) set_64bit((u64 *) (pudptr), pud_val(pudval))
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
-index b462b13..e7a19aa 100644
+index bbcef52..6a2a483 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
-@@ -386,22 +386,6 @@ int singlestepping(void * t)
+@@ -367,22 +367,6 @@ int singlestepping(void * t)
return 2;
}
@@ -10255,10 +10163,10 @@ index ad8f795..2c7eec6 100644
/*
* Memory returned by kmalloc() may be used for DMA, so we must make
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
-index de80b33..c0f0899 100644
+index fe120da..24177f7 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -243,7 +243,7 @@ config X86_HT
+@@ -239,7 +239,7 @@ config X86_HT
config X86_32_LAZY_GS
def_bool y
@@ -10267,7 +10175,7 @@ index de80b33..c0f0899 100644
config ARCH_HWEIGHT_CFLAGS
string
-@@ -1076,6 +1076,7 @@ config MICROCODE_EARLY
+@@ -1073,6 +1073,7 @@ config MICROCODE_EARLY
config X86_MSR
tristate "/dev/cpu/*/msr - Model-specific register support"
@@ -10275,7 +10183,7 @@ index de80b33..c0f0899 100644
---help---
This device gives privileged processes access to the x86
Model-Specific Registers (MSRs). It is a character device with
-@@ -1099,7 +1100,7 @@ choice
+@@ -1096,7 +1097,7 @@ choice
config NOHIGHMEM
bool "off"
@@ -10284,7 +10192,7 @@ index de80b33..c0f0899 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
-@@ -1136,7 +1137,7 @@ config NOHIGHMEM
+@@ -1133,7 +1134,7 @@ config NOHIGHMEM
config HIGHMEM4G
bool "4GB"
@@ -10293,7 +10201,7 @@ index de80b33..c0f0899 100644
---help---
Select this if you have a 32-bit processor and between 1 and 4
gigabytes of physical RAM.
-@@ -1189,7 +1190,7 @@ config PAGE_OFFSET
+@@ -1186,7 +1187,7 @@ config PAGE_OFFSET
hex
default 0xB0000000 if VMSPLIT_3G_OPT
default 0x80000000 if VMSPLIT_2G
@@ -10302,7 +10210,7 @@ index de80b33..c0f0899 100644
default 0x40000000 if VMSPLIT_1G
default 0xC0000000
depends on X86_32
-@@ -1587,6 +1588,7 @@ config SECCOMP
+@@ -1584,6 +1585,7 @@ config SECCOMP
config CC_STACKPROTECTOR
bool "Enable -fstack-protector buffer overflow detection"
@@ -10310,7 +10218,7 @@ index de80b33..c0f0899 100644
---help---
This option turns on the -fstack-protector GCC feature. This
feature puts, at the beginning of functions, a canary value on
-@@ -1706,6 +1708,8 @@ config X86_NEED_RELOCS
+@@ -1703,6 +1705,8 @@ config X86_NEED_RELOCS
config PHYSICAL_ALIGN
hex "Alignment value to which kernel should be aligned" if X86_32
default "0x1000000"
@@ -10319,7 +10227,7 @@ index de80b33..c0f0899 100644
range 0x2000 0x1000000
---help---
This value puts the alignment restrictions on physical address
-@@ -1781,9 +1785,10 @@ config DEBUG_HOTPLUG_CPU0
+@@ -1778,9 +1782,10 @@ config DEBUG_HOTPLUG_CPU0
If unsure, say N.
config COMPAT_VDSO
@@ -10363,7 +10271,7 @@ index c026cca..14657ae 100644
config X86_MINIMUM_CPU_FAMILY
int
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
-index b322f12..652d0d9 100644
+index c198b7e..63eea60 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -84,7 +84,7 @@ config X86_PTDUMP
@@ -10384,15 +10292,6 @@ index b322f12..652d0d9 100644
---help---
This option helps catch unintended modifications to loadable
kernel module's text and read-only data. It also prevents execution
-@@ -294,7 +294,7 @@ config OPTIMIZE_INLINING
-
- config DEBUG_STRICT_USER_COPY_CHECKS
- bool "Strict copy size checks"
-- depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
-+ depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING && !PAX_SIZE_OVERFLOW
- ---help---
- Enabling this option turns a certain set of sanity checks for user
- copy operations into compile time failures.
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 5c47726..8c4fa67 100644
--- a/arch/x86/Makefile
@@ -10585,7 +10484,7 @@ index 1e3184f..0d11e2e 100644
jmp 1b
2:
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
-index c1d383d..57ab51c 100644
+index 16f24e6..47491a3 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -97,7 +97,7 @@ ENTRY(startup_32)
@@ -10819,7 +10718,7 @@ index 9105655..5e37f27 100644
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 04b7977..402f223 100644
+index 477e9d7..3ab339f 100644
--- a/arch/x86/crypto/aesni-intel_asm.S
+++ b/arch/x86/crypto/aesni-intel_asm.S
@@ -31,6 +31,7 @@
@@ -10830,7 +10729,7 @@ index 04b7977..402f223 100644
#ifdef __x86_64__
.data
-@@ -1435,6 +1436,7 @@ _return_T_done_decrypt:
+@@ -1441,6 +1442,7 @@ _return_T_done_decrypt:
pop %r14
pop %r13
pop %r12
@@ -10838,7 +10737,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_gcm_dec)
-@@ -1699,6 +1701,7 @@ _return_T_done_encrypt:
+@@ -1705,6 +1707,7 @@ _return_T_done_encrypt:
pop %r14
pop %r13
pop %r12
@@ -10846,7 +10745,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_gcm_enc)
-@@ -1716,6 +1719,7 @@ _key_expansion_256a:
+@@ -1722,6 +1725,7 @@ _key_expansion_256a:
pxor %xmm1, %xmm0
movaps %xmm0, (TKEYP)
add $0x10, TKEYP
@@ -10854,7 +10753,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_key_expansion_128)
ENDPROC(_key_expansion_256a)
-@@ -1742,6 +1746,7 @@ _key_expansion_192a:
+@@ -1748,6 +1752,7 @@ _key_expansion_192a:
shufps $0b01001110, %xmm2, %xmm1
movaps %xmm1, 0x10(TKEYP)
add $0x20, TKEYP
@@ -10862,7 +10761,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_key_expansion_192a)
-@@ -1762,6 +1767,7 @@ _key_expansion_192b:
+@@ -1768,6 +1773,7 @@ _key_expansion_192b:
movaps %xmm0, (TKEYP)
add $0x10, TKEYP
@@ -10870,7 +10769,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_key_expansion_192b)
-@@ -1775,6 +1781,7 @@ _key_expansion_256b:
+@@ -1781,6 +1787,7 @@ _key_expansion_256b:
pxor %xmm1, %xmm2
movaps %xmm2, (TKEYP)
add $0x10, TKEYP
@@ -10878,7 +10777,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_key_expansion_256b)
-@@ -1888,6 +1895,7 @@ ENTRY(aesni_set_key)
+@@ -1894,6 +1901,7 @@ ENTRY(aesni_set_key)
#ifndef __x86_64__
popl KEYP
#endif
@@ -10886,7 +10785,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_set_key)
-@@ -1910,6 +1918,7 @@ ENTRY(aesni_enc)
+@@ -1916,6 +1924,7 @@ ENTRY(aesni_enc)
popl KLEN
popl KEYP
#endif
@@ -10894,7 +10793,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_enc)
-@@ -1968,6 +1977,7 @@ _aesni_enc1:
+@@ -1974,6 +1983,7 @@ _aesni_enc1:
AESENC KEY STATE
movaps 0x70(TKEYP), KEY
AESENCLAST KEY STATE
@@ -10902,7 +10801,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_aesni_enc1)
-@@ -2077,6 +2087,7 @@ _aesni_enc4:
+@@ -2083,6 +2093,7 @@ _aesni_enc4:
AESENCLAST KEY STATE2
AESENCLAST KEY STATE3
AESENCLAST KEY STATE4
@@ -10910,7 +10809,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_aesni_enc4)
-@@ -2100,6 +2111,7 @@ ENTRY(aesni_dec)
+@@ -2106,6 +2117,7 @@ ENTRY(aesni_dec)
popl KLEN
popl KEYP
#endif
@@ -10918,7 +10817,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_dec)
-@@ -2158,6 +2170,7 @@ _aesni_dec1:
+@@ -2164,6 +2176,7 @@ _aesni_dec1:
AESDEC KEY STATE
movaps 0x70(TKEYP), KEY
AESDECLAST KEY STATE
@@ -10926,7 +10825,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_aesni_dec1)
-@@ -2267,6 +2280,7 @@ _aesni_dec4:
+@@ -2273,6 +2286,7 @@ _aesni_dec4:
AESDECLAST KEY STATE2
AESDECLAST KEY STATE3
AESDECLAST KEY STATE4
@@ -10934,7 +10833,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_aesni_dec4)
-@@ -2325,6 +2339,7 @@ ENTRY(aesni_ecb_enc)
+@@ -2331,6 +2345,7 @@ ENTRY(aesni_ecb_enc)
popl KEYP
popl LEN
#endif
@@ -10942,7 +10841,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_ecb_enc)
-@@ -2384,6 +2399,7 @@ ENTRY(aesni_ecb_dec)
+@@ -2390,6 +2405,7 @@ ENTRY(aesni_ecb_dec)
popl KEYP
popl LEN
#endif
@@ -10950,7 +10849,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_ecb_dec)
-@@ -2426,6 +2442,7 @@ ENTRY(aesni_cbc_enc)
+@@ -2432,6 +2448,7 @@ ENTRY(aesni_cbc_enc)
popl LEN
popl IVP
#endif
@@ -10958,7 +10857,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_cbc_enc)
-@@ -2517,6 +2534,7 @@ ENTRY(aesni_cbc_dec)
+@@ -2523,6 +2540,7 @@ ENTRY(aesni_cbc_dec)
popl LEN
popl IVP
#endif
@@ -10966,7 +10865,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(aesni_cbc_dec)
-@@ -2544,6 +2562,7 @@ _aesni_inc_init:
+@@ -2550,6 +2568,7 @@ _aesni_inc_init:
mov $1, TCTR_LOW
MOVQ_R64_XMM TCTR_LOW INC
MOVQ_R64_XMM CTR TCTR_LOW
@@ -10974,7 +10873,7 @@ index 04b7977..402f223 100644
ret
ENDPROC(_aesni_inc_init)
-@@ -2573,6 +2592,7 @@ _aesni_inc:
+@@ -2579,6 +2598,7 @@ _aesni_inc:
.Linc_low:
movaps CTR, IV
PSHUFB_XMM BSWAP_MASK IV
@@ -10982,14 +10881,22 @@ index 04b7977..402f223 100644
ret
ENDPROC(_aesni_inc)
-@@ -2634,6 +2654,7 @@ ENTRY(aesni_ctr_enc)
+@@ -2640,6 +2660,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
+
+@@ -2766,6 +2787,7 @@ ENTRY(aesni_xts_crypt8)
+ pxor INC, STATE4
+ movdqu STATE4, 0x70(OUTP)
+
++ pax_force_retaddr 0, 1
+ ret
+ ENDPROC(aesni_xts_crypt8)
+
diff --git a/arch/x86/crypto/blowfish-x86_64-asm_64.S b/arch/x86/crypto/blowfish-x86_64-asm_64.S
index 246c670..4d1ed00 100644
--- a/arch/x86/crypto/blowfish-x86_64-asm_64.S
@@ -11163,7 +11070,7 @@ index c35fd5d..c1ee236 100644
ret;
ENDPROC(cast5_ctr_16way)
diff --git a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
-index f93b610..c09bf40 100644
+index e3531f8..18ded3a 100644
--- a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
@@ -24,6 +24,7 @@
@@ -11174,7 +11081,7 @@ index f93b610..c09bf40 100644
#include "glue_helper-asm-avx.S"
.file "cast6-avx-x86_64-asm_64.S"
-@@ -293,6 +294,7 @@ __cast6_enc_blk8:
+@@ -295,6 +296,7 @@ __cast6_enc_blk8:
outunpack_blocks(RA1, RB1, RC1, RD1, RTMP, RX, RKRF, RKM);
outunpack_blocks(RA2, RB2, RC2, RD2, RTMP, RX, RKRF, RKM);
@@ -11182,7 +11089,7 @@ index f93b610..c09bf40 100644
ret;
ENDPROC(__cast6_enc_blk8)
-@@ -338,6 +340,7 @@ __cast6_dec_blk8:
+@@ -340,6 +342,7 @@ __cast6_dec_blk8:
outunpack_blocks(RA1, RB1, RC1, RD1, RTMP, RX, RKRF, RKM);
outunpack_blocks(RA2, RB2, RC2, RD2, RTMP, RX, RKRF, RKM);
@@ -11190,7 +11097,7 @@ index f93b610..c09bf40 100644
ret;
ENDPROC(__cast6_dec_blk8)
-@@ -356,6 +359,7 @@ ENTRY(cast6_ecb_enc_8way)
+@@ -358,6 +361,7 @@ ENTRY(cast6_ecb_enc_8way)
store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -11198,7 +11105,7 @@ index f93b610..c09bf40 100644
ret;
ENDPROC(cast6_ecb_enc_8way)
-@@ -374,6 +378,7 @@ ENTRY(cast6_ecb_dec_8way)
+@@ -376,6 +380,7 @@ ENTRY(cast6_ecb_dec_8way)
store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -11206,7 +11113,7 @@ index f93b610..c09bf40 100644
ret;
ENDPROC(cast6_ecb_dec_8way)
-@@ -397,6 +402,7 @@ ENTRY(cast6_cbc_dec_8way)
+@@ -399,6 +404,7 @@ ENTRY(cast6_cbc_dec_8way)
popq %r12;
@@ -11214,13 +11121,29 @@ index f93b610..c09bf40 100644
ret;
ENDPROC(cast6_cbc_dec_8way)
-@@ -422,5 +428,6 @@ ENTRY(cast6_ctr_8way)
+@@ -424,6 +430,7 @@ ENTRY(cast6_ctr_8way)
popq %r12;
+ pax_force_retaddr
ret;
ENDPROC(cast6_ctr_8way)
+
+@@ -446,6 +453,7 @@ ENTRY(cast6_xts_enc_8way)
+ /* dst <= regs xor IVs(in dst) */
+ store_xts_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
+
++ pax_force_retaddr
+ ret;
+ ENDPROC(cast6_xts_enc_8way)
+
+@@ -468,5 +476,6 @@ ENTRY(cast6_xts_dec_8way)
+ /* dst <= regs xor IVs(in dst) */
+ store_xts_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
+
++ pax_force_retaddr
+ ret;
+ ENDPROC(cast6_xts_dec_8way)
diff --git a/arch/x86/crypto/salsa20-x86_64-asm_64.S b/arch/x86/crypto/salsa20-x86_64-asm_64.S
index 9279e0b..9270820 100644
--- a/arch/x86/crypto/salsa20-x86_64-asm_64.S
@@ -11255,10 +11178,10 @@ index 9279e0b..9270820 100644
ret
ENDPROC(salsa20_ivsetup)
diff --git a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
-index 43c9386..a0e2d60 100644
+index 2f202f4..d9164d6 100644
--- a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
-@@ -25,6 +25,7 @@
+@@ -24,6 +24,7 @@
*/
#include <linux/linkage.h>
@@ -11266,7 +11189,7 @@ index 43c9386..a0e2d60 100644
#include "glue_helper-asm-avx.S"
.file "serpent-avx-x86_64-asm_64.S"
-@@ -617,6 +618,7 @@ __serpent_enc_blk8_avx:
+@@ -618,6 +619,7 @@ __serpent_enc_blk8_avx:
write_blocks(RA1, RB1, RC1, RD1, RK0, RK1, RK2);
write_blocks(RA2, RB2, RC2, RD2, RK0, RK1, RK2);
@@ -11274,7 +11197,7 @@ index 43c9386..a0e2d60 100644
ret;
ENDPROC(__serpent_enc_blk8_avx)
-@@ -671,6 +673,7 @@ __serpent_dec_blk8_avx:
+@@ -672,6 +674,7 @@ __serpent_dec_blk8_avx:
write_blocks(RC1, RD1, RB1, RE1, RK0, RK1, RK2);
write_blocks(RC2, RD2, RB2, RE2, RK0, RK1, RK2);
@@ -11282,7 +11205,7 @@ index 43c9386..a0e2d60 100644
ret;
ENDPROC(__serpent_dec_blk8_avx)
-@@ -687,6 +690,7 @@ ENTRY(serpent_ecb_enc_8way_avx)
+@@ -688,6 +691,7 @@ ENTRY(serpent_ecb_enc_8way_avx)
store_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -11290,7 +11213,7 @@ index 43c9386..a0e2d60 100644
ret;
ENDPROC(serpent_ecb_enc_8way_avx)
-@@ -703,6 +707,7 @@ ENTRY(serpent_ecb_dec_8way_avx)
+@@ -704,6 +708,7 @@ ENTRY(serpent_ecb_dec_8way_avx)
store_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2);
@@ -11298,7 +11221,7 @@ index 43c9386..a0e2d60 100644
ret;
ENDPROC(serpent_ecb_dec_8way_avx)
-@@ -719,6 +724,7 @@ ENTRY(serpent_cbc_dec_8way_avx)
+@@ -720,6 +725,7 @@ ENTRY(serpent_cbc_dec_8way_avx)
store_cbc_8way(%rdx, %rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2);
@@ -11306,13 +11229,29 @@ index 43c9386..a0e2d60 100644
ret;
ENDPROC(serpent_cbc_dec_8way_avx)
-@@ -737,5 +743,6 @@ ENTRY(serpent_ctr_8way_avx)
+@@ -738,6 +744,7 @@ ENTRY(serpent_ctr_8way_avx)
store_ctr_8way(%rdx, %rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
+ pax_force_retaddr
ret;
ENDPROC(serpent_ctr_8way_avx)
+
+@@ -758,6 +765,7 @@ ENTRY(serpent_xts_enc_8way_avx)
+ /* dst <= regs xor IVs(in dst) */
+ store_xts_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
+
++ pax_force_retaddr
+ ret;
+ ENDPROC(serpent_xts_enc_8way_avx)
+
+@@ -778,5 +786,6 @@ ENTRY(serpent_xts_dec_8way_avx)
+ /* dst <= regs xor IVs(in dst) */
+ store_xts_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2);
+
++ pax_force_retaddr
+ ret;
+ ENDPROC(serpent_xts_dec_8way_avx)
diff --git a/arch/x86/crypto/serpent-sse2-x86_64-asm_64.S b/arch/x86/crypto/serpent-sse2-x86_64-asm_64.S
index acc066c..1559cc4 100644
--- a/arch/x86/crypto/serpent-sse2-x86_64-asm_64.S
@@ -11368,7 +11307,7 @@ index a410950..3356d42 100644
ENDPROC(\name)
diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
-index 8d3e113..898b161 100644
+index 0505813..63b1d00 100644
--- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
@@ -24,6 +24,7 @@
@@ -11379,7 +11318,7 @@ index 8d3e113..898b161 100644
#include "glue_helper-asm-avx.S"
.file "twofish-avx-x86_64-asm_64.S"
-@@ -282,6 +283,7 @@ __twofish_enc_blk8:
+@@ -284,6 +285,7 @@ __twofish_enc_blk8:
outunpack_blocks(RC1, RD1, RA1, RB1, RK1, RX0, RY0, RK2);
outunpack_blocks(RC2, RD2, RA2, RB2, RK1, RX0, RY0, RK2);
@@ -11387,7 +11326,7 @@ index 8d3e113..898b161 100644
ret;
ENDPROC(__twofish_enc_blk8)
-@@ -322,6 +324,7 @@ __twofish_dec_blk8:
+@@ -324,6 +326,7 @@ __twofish_dec_blk8:
outunpack_blocks(RA1, RB1, RC1, RD1, RK1, RX0, RY0, RK2);
outunpack_blocks(RA2, RB2, RC2, RD2, RK1, RX0, RY0, RK2);
@@ -11395,7 +11334,7 @@ index 8d3e113..898b161 100644
ret;
ENDPROC(__twofish_dec_blk8)
-@@ -340,6 +343,7 @@ ENTRY(twofish_ecb_enc_8way)
+@@ -342,6 +345,7 @@ ENTRY(twofish_ecb_enc_8way)
store_8way(%r11, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2);
@@ -11403,7 +11342,7 @@ index 8d3e113..898b161 100644
ret;
ENDPROC(twofish_ecb_enc_8way)
-@@ -358,6 +362,7 @@ ENTRY(twofish_ecb_dec_8way)
+@@ -360,6 +364,7 @@ ENTRY(twofish_ecb_dec_8way)
store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
@@ -11411,7 +11350,7 @@ index 8d3e113..898b161 100644
ret;
ENDPROC(twofish_ecb_dec_8way)
-@@ -381,6 +386,7 @@ ENTRY(twofish_cbc_dec_8way)
+@@ -383,6 +388,7 @@ ENTRY(twofish_cbc_dec_8way)
popq %r12;
@@ -11419,13 +11358,29 @@ index 8d3e113..898b161 100644
ret;
ENDPROC(twofish_cbc_dec_8way)
-@@ -406,5 +412,6 @@ ENTRY(twofish_ctr_8way)
+@@ -408,6 +414,7 @@ ENTRY(twofish_ctr_8way)
popq %r12;
+ pax_force_retaddr 0, 1
ret;
ENDPROC(twofish_ctr_8way)
+
+@@ -430,6 +437,7 @@ ENTRY(twofish_xts_enc_8way)
+ /* dst <= regs xor IVs(in dst) */
+ store_xts_8way(%r11, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2);
+
++ pax_force_retaddr 0, 1
+ ret;
+ ENDPROC(twofish_xts_enc_8way)
+
+@@ -452,5 +460,6 @@ ENTRY(twofish_xts_dec_8way)
+ /* dst <= regs xor IVs(in dst) */
+ store_xts_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
+
++ pax_force_retaddr 0, 1
+ ret;
+ ENDPROC(twofish_xts_dec_8way)
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
index 1c3b7ce..b365c5e 100644
--- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
@@ -11489,7 +11444,7 @@ index a039d21..29e7615 100644
ret
ENDPROC(twofish_dec_blk)
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
-index 03abf9b..a42ba29 100644
+index 52ff81c..98af645 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -159,6 +159,8 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file,
@@ -11867,7 +11822,7 @@ index 474dc1b..24aaa3e 100644
END(ia32_syscall)
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
-index ad7a20c..1ffa3c1 100644
+index 8e0ceec..af13504 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,
@@ -11881,15 +11836,6 @@ index ad7a20c..1ffa3c1 100644
SET_UID(uid, from_kuid_munged(current_user_ns(), stat->uid));
SET_GID(gid, from_kgid_munged(current_user_ns(), stat->gid));
if (!access_ok(VERIFY_WRITE, ubuf, sizeof(struct stat64)) ||
-@@ -205,7 +205,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd,
- return -EFAULT;
-
- set_fs(KERNEL_DS);
-- ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __user *)&of : NULL,
-+ ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __force_user *)&of : NULL,
- count);
- set_fs(old_fs);
-
diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h
index 372231c..a5aa1a1 100644
--- a/arch/x86/include/asm/alternative-asm.h
@@ -13027,7 +12973,7 @@ index 46fc474..b02b0f9 100644
if (len)
diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
-index 8d871ea..c1a0dc9 100644
+index d47786a..ce1b05d 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -14,8 +14,12 @@ extern void __cmpxchg_wrong_size(void)
@@ -13102,10 +13048,10 @@ index 59c6c40..5e0b22c 100644
struct compat_timespec {
compat_time_t tv_sec;
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
-index 93fe929..90858b7 100644
+index e99ac27..e89e28c 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
-@@ -207,7 +207,7 @@
+@@ -211,7 +211,7 @@
#define X86_FEATURE_BMI1 (9*32+ 3) /* 1st group bit manipulation extensions */
#define X86_FEATURE_HLE (9*32+ 4) /* Hardware Lock Elision */
#define X86_FEATURE_AVX2 (9*32+ 5) /* AVX2 instructions */
@@ -13114,7 +13060,7 @@ index 93fe929..90858b7 100644
#define X86_FEATURE_BMI2 (9*32+ 8) /* 2nd group bit manipulation extensions */
#define X86_FEATURE_ERMS (9*32+ 9) /* Enhanced REP MOVSB/STOSB */
#define X86_FEATURE_INVPCID (9*32+10) /* Invalidate Processor Context ID */
-@@ -377,7 +377,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
+@@ -394,7 +394,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"
@@ -13531,10 +13477,10 @@ index be27ba1..8f13ff9 100644
: "memory"
);
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
-index 10a78c3..cc77143 100644
+index 1da97ef..9c2ebff 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
-@@ -147,8 +147,8 @@ extern void setup_ioapic_dest(void);
+@@ -148,8 +148,8 @@ extern void setup_ioapic_dest(void);
extern void enable_IO_APIC(void);
/* Statistics */
@@ -14075,10 +14021,10 @@ index e3b7819..b257c64 100644
+
#endif /* _ASM_X86_MODULE_H */
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
-index c0fa356..07a498a 100644
+index 86f9301..b365cda 100644
--- a/arch/x86/include/asm/nmi.h
+++ b/arch/x86/include/asm/nmi.h
-@@ -42,11 +42,11 @@ struct nmiaction {
+@@ -40,11 +40,11 @@ struct nmiaction {
nmi_handler_t handler;
unsigned long flags;
const char *name;
@@ -14092,7 +14038,7 @@ index c0fa356..07a498a 100644
.handler = (fn), \
.name = (n), \
.flags = (fg), \
-@@ -54,7 +54,7 @@ struct nmiaction {
+@@ -52,7 +52,7 @@ struct nmiaction {
__register_nmi_handler((t), &fn##_na); \
})
@@ -14130,10 +14076,10 @@ index 0f1ddee..e2fc3d1 100644
unsigned long y = x - __START_KERNEL_map;
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
-index 7361e47..16dc226 100644
+index cfdc9ee..3f7b5d6 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
-@@ -564,7 +564,7 @@ static inline pmd_t __pmd(pmdval_t val)
+@@ -560,7 +560,7 @@ static inline pmd_t __pmd(pmdval_t val)
return (pmd_t) { ret };
}
@@ -14142,7 +14088,7 @@ index 7361e47..16dc226 100644
{
pmdval_t ret;
-@@ -630,6 +630,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
+@@ -626,6 +626,18 @@ static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
val);
}
@@ -14161,7 +14107,7 @@ index 7361e47..16dc226 100644
static inline void pgd_clear(pgd_t *pgdp)
{
set_pgd(pgdp, __pgd(0));
-@@ -714,6 +726,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
+@@ -710,6 +722,21 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
pv_mmu_ops.set_fixmap(idx, phys, flags);
}
@@ -14183,7 +14129,7 @@ index 7361e47..16dc226 100644
#if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT_SPINLOCKS)
static inline int arch_spin_is_locked(struct arch_spinlock *lock)
-@@ -930,7 +957,7 @@ extern void default_banner(void);
+@@ -926,7 +953,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)
@@ -14192,7 +14138,7 @@ index 7361e47..16dc226 100644
#endif
#define INTERRUPT_RETURN \
-@@ -1005,6 +1032,21 @@ extern void default_banner(void);
+@@ -1001,6 +1028,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))
@@ -14215,7 +14161,7 @@ index 7361e47..16dc226 100644
#endif /* __ASSEMBLY__ */
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
-index b3b0ec1..b1cd3eb 100644
+index 0db1fca..52310cc 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -84,7 +84,7 @@ struct pv_init_ops {
@@ -14737,7 +14683,7 @@ index 2d88344..4679fc3 100644
#define EARLY_DYNAMIC_PAGE_TABLES 64
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
-index 567b5d0..bd91d64 100644
+index e642300..0ef8f31 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -16,13 +16,12 @@
@@ -14852,10 +14798,10 @@ index 567b5d0..bd91d64 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 3270116..8d99d82 100644
+index 22224b3..4080dab 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
-@@ -285,7 +285,7 @@ struct tss_struct {
+@@ -282,7 +282,7 @@ struct tss_struct {
} ____cacheline_aligned;
@@ -14864,7 +14810,7 @@ index 3270116..8d99d82 100644
/*
* Save the original ist values for checking stack pointers during debugging
-@@ -826,11 +826,18 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -823,11 +823,18 @@ static inline void spin_lock_prefetch(const void *x)
*/
#define TASK_SIZE PAGE_OFFSET
#define TASK_SIZE_MAX TASK_SIZE
@@ -14885,7 +14831,7 @@ index 3270116..8d99d82 100644
.vm86_info = NULL, \
.sysenter_cs = __KERNEL_CS, \
.io_bitmap_ptr = NULL, \
-@@ -844,7 +851,7 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -841,7 +848,7 @@ static inline void spin_lock_prefetch(const void *x)
*/
#define INIT_TSS { \
.x86_tss = { \
@@ -14894,7 +14840,7 @@ index 3270116..8d99d82 100644
.ss0 = __KERNEL_DS, \
.ss1 = __KERNEL_CS, \
.io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \
-@@ -855,11 +862,7 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -852,11 +859,7 @@ static inline void spin_lock_prefetch(const void *x)
extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long))
@@ -14907,7 +14853,7 @@ index 3270116..8d99d82 100644
/*
* The below -8 is to reserve 8 bytes on top of the ring0 stack.
-@@ -874,7 +877,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+@@ -871,7 +874,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define task_pt_regs(task) \
({ \
struct pt_regs *__regs__; \
@@ -14916,7 +14862,7 @@ index 3270116..8d99d82 100644
__regs__ - 1; \
})
-@@ -884,13 +887,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+@@ -881,13 +884,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
/*
* User space process size. 47bits minus one guard page.
*/
@@ -14932,7 +14878,7 @@ index 3270116..8d99d82 100644
#define TASK_SIZE (test_thread_flag(TIF_ADDR32) ? \
IA32_PAGE_OFFSET : TASK_SIZE_MAX)
-@@ -901,11 +904,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+@@ -898,11 +901,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define STACK_TOP_MAX TASK_SIZE_MAX
#define INIT_THREAD { \
@@ -14946,7 +14892,7 @@ index 3270116..8d99d82 100644
}
/*
-@@ -933,6 +936,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
+@@ -930,6 +933,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
*/
#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
@@ -14957,16 +14903,16 @@ index 3270116..8d99d82 100644
#define KSTK_EIP(task) (task_pt_regs(task)->ip)
/* Get/set a process' ability to use the timestamp counter instruction */
-@@ -993,7 +1000,7 @@ extern bool cpu_has_amd_erratum(const int *);
- #define cpu_has_amd_erratum(x) (false)
- #endif /* CONFIG_CPU_SUP_AMD */
+@@ -970,7 +977,7 @@ unsigned long calc_aperfmperf_ratio(struct aperfmperf *old,
+ return ratio;
+ }
-extern unsigned long arch_align_stack(unsigned long sp);
+#define arch_align_stack(x) ((x) & ~0xfUL)
extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
void default_idle(void);
-@@ -1003,6 +1010,6 @@ bool xen_set_default_idle(void);
+@@ -980,6 +987,6 @@ bool xen_set_default_idle(void);
#define xen_set_default_idle 0
#endif
@@ -15094,7 +15040,7 @@ index a82c4f1..ac45053 100644
extern struct machine_ops machine_ops;
diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h
-index 2dbe4a7..ce1db00 100644
+index cad82c9..2e5c5c1 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)
@@ -15140,9 +15086,9 @@ index 2dbe4a7..ce1db00 100644
+#endif
+
/* adds 0xffff0001, returns the old value */
- " test %1,%1\n\t"
- /* was the count 0 before? */
-@@ -141,6 +165,14 @@ static inline void __up_read(struct rw_semaphore *sem)
+ " test " __ASM_SEL(%w1,%k1) "," __ASM_SEL(%w1,%k1) "\n\t"
+ /* was the active mask 0 before? */
+@@ -155,6 +179,14 @@ static inline void __up_read(struct rw_semaphore *sem)
long tmp;
asm volatile("# beginning __up_read\n\t"
LOCK_PREFIX " xadd %1,(%2)\n\t"
@@ -15157,7 +15103,7 @@ index 2dbe4a7..ce1db00 100644
/* subtracts 1, returns the old value */
" jns 1f\n\t"
" call call_rwsem_wake\n" /* expects old value in %edx */
-@@ -159,6 +191,14 @@ static inline void __up_write(struct rw_semaphore *sem)
+@@ -173,6 +205,14 @@ static inline void __up_write(struct rw_semaphore *sem)
long tmp;
asm volatile("# beginning __up_write\n\t"
LOCK_PREFIX " xadd %1,(%2)\n\t"
@@ -15172,7 +15118,7 @@ index 2dbe4a7..ce1db00 100644
/* subtracts 0xffff0001, returns the old value */
" jns 1f\n\t"
" call call_rwsem_wake\n" /* expects old value in %edx */
-@@ -176,6 +216,14 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
+@@ -190,6 +230,14 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
{
asm volatile("# beginning __downgrade_write\n\t"
LOCK_PREFIX _ASM_ADD "%2,(%1)\n\t"
@@ -15187,7 +15133,7 @@ index 2dbe4a7..ce1db00 100644
/*
* transitions 0xZZZZ0001 -> 0xYYYY0001 (i386)
* 0xZZZZZZZZ00000001 -> 0xYYYYYYYY00000001 (x86_64)
-@@ -194,7 +242,15 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
+@@ -208,7 +256,15 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
*/
static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
{
@@ -15204,7 +15150,7 @@ index 2dbe4a7..ce1db00 100644
: "+m" (sem->count)
: "er" (delta));
}
-@@ -204,7 +260,7 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
+@@ -218,7 +274,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)
{
@@ -15495,7 +15441,7 @@ index 4ec45b3..a4f0a8a 100644
__switch_canary_iparam \
: "memory", "cc" __EXTRA_CLOBBER)
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
-index 2cd056e..0224df8 100644
+index a1df6e8..e002940 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -10,6 +10,7 @@
@@ -15684,7 +15630,7 @@ index 2cd056e..0224df8 100644
#endif
#endif /* !X86_32 */
-@@ -285,5 +257,12 @@ static inline bool is_ia32_task(void)
+@@ -283,5 +255,12 @@ static inline bool is_ia32_task(void)
extern void arch_task_cache_init(void);
extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
extern void arch_release_task_struct(struct task_struct *tsk);
@@ -16640,7 +16586,7 @@ index 230c8ea..f915130 100644
* HP laptops which use a DSDT reporting as HP/SB400/10000,
* which includes some code which overrides all temperature
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
-index 0532f5d..36afc0a 100644
+index b44577b..27d8443 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -74,8 +74,12 @@ int acpi_suspend_lowlevel(void)
@@ -16657,10 +16603,10 @@ index 0532f5d..36afc0a 100644
#endif
initial_code = (unsigned long)wakeup_long64;
diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
-index 13ab720..95d5442 100644
+index d1daa66..59fecba 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
-@@ -30,13 +30,11 @@ wakeup_pmode_return:
+@@ -29,13 +29,11 @@ wakeup_pmode_return:
# and restore the stack ... but you need gdt for this to work
movl saved_context_esp, %esp
@@ -16677,7 +16623,7 @@ index 13ab720..95d5442 100644
bogus_magic:
jmp bogus_magic
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
-index ef5ccca..bd83949 100644
+index c15cf9a..0e63558 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -268,6 +268,13 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
@@ -17035,10 +16981,10 @@ index 794f6eb..67e1db2 100644
.name = "UV large system",
.probe = uv_probe,
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
-index 66b5faf..3442423 100644
+index 53a4e27..038760a 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
-@@ -434,7 +434,7 @@ static DEFINE_MUTEX(apm_mutex);
+@@ -433,7 +433,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.
*/
@@ -17047,7 +16993,7 @@ index 66b5faf..3442423 100644
(unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);
static const char driver_version[] = "1.16ac"; /* no spaces */
-@@ -612,7 +612,10 @@ static long __apm_bios_call(void *_call)
+@@ -611,7 +611,10 @@ static long __apm_bios_call(void *_call)
BUG_ON(cpu != 0);
gdt = get_cpu_gdt_table(cpu);
save_desc_40 = gdt[0x40 / 8];
@@ -17058,7 +17004,7 @@ index 66b5faf..3442423 100644
apm_irq_save(flags);
APM_DO_SAVE_SEGS;
-@@ -621,7 +624,11 @@ static long __apm_bios_call(void *_call)
+@@ -620,7 +623,11 @@ static long __apm_bios_call(void *_call)
&call->esi);
APM_DO_RESTORE_SEGS;
apm_irq_restore(flags);
@@ -17070,7 +17016,7 @@ index 66b5faf..3442423 100644
put_cpu();
return call->eax & 0xff;
-@@ -688,7 +695,10 @@ static long __apm_bios_call_simple(void *_call)
+@@ -687,7 +694,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];
@@ -17081,7 +17027,7 @@ index 66b5faf..3442423 100644
apm_irq_save(flags);
APM_DO_SAVE_SEGS;
-@@ -696,7 +706,11 @@ static long __apm_bios_call_simple(void *_call)
+@@ -695,7 +705,11 @@ static long __apm_bios_call_simple(void *_call)
&call->eax);
APM_DO_RESTORE_SEGS;
apm_irq_restore(flags);
@@ -17093,7 +17039,7 @@ index 66b5faf..3442423 100644
put_cpu();
return error;
}
-@@ -2363,12 +2377,15 @@ static int __init apm_init(void)
+@@ -2362,12 +2376,15 @@ static int __init apm_init(void)
* code to that CPU.
*/
gdt = get_cpu_gdt_table(0);
@@ -17150,10 +17096,10 @@ index 2861082..6d4718e 100644
BLANK();
OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
-index 1b4754f..fbb4227 100644
+index e7c798b..2b2019b 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
-@@ -76,6 +76,7 @@ int main(void)
+@@ -77,6 +77,7 @@ int main(void)
BLANK();
#undef ENTRY
@@ -17162,7 +17108,7 @@ index 1b4754f..fbb4227 100644
BLANK();
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
-index a0e067d..9c7db16 100644
+index b0684e4..22ccfd7 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -8,10 +8,6 @@ CFLAGS_REMOVE_common.o = -pg
@@ -17175,12 +17121,12 @@ index a0e067d..9c7db16 100644
-
obj-y := intel_cacheinfo.o scattered.o topology.o
obj-y += proc.o capflags.o powerflags.o common.o
- obj-y += vmware.o hypervisor.o mshyperv.o
+ obj-y += rdrand.o
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
-index fa96eb0..03efe73 100644
+index 5013a48..0782c53 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -737,7 +737,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c,
+@@ -744,7 +744,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c,
unsigned int size)
{
/* AMD errata T13 (order #21922) */
@@ -17190,7 +17136,7 @@ index fa96eb0..03efe73 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 d814772..c615653 100644
+index 22018f7..bc6f5e3 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -88,60 +88,6 @@ static const struct cpu_dev __cpuinitconst default_cpu = {
@@ -17274,7 +17220,7 @@ index d814772..c615653 100644
/* If the model name is still unset, do table lookup. */
if (!c->x86_model_id[0]) {
const char *p;
-@@ -1065,10 +1015,12 @@ static __init int setup_disablecpuid(char *arg)
+@@ -1069,10 +1019,12 @@ static __init int setup_disablecpuid(char *arg)
}
__setup("clearcpuid=", setup_disablecpuid);
@@ -17289,7 +17235,7 @@ index d814772..c615653 100644
DEFINE_PER_CPU_FIRST(union irq_stack_union,
irq_stack_union) __aligned(PAGE_SIZE);
-@@ -1082,7 +1034,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned =
+@@ -1086,7 +1038,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned =
EXPORT_PER_CPU_SYMBOL(current_task);
DEFINE_PER_CPU(unsigned long, kernel_stack) =
@@ -17298,7 +17244,7 @@ index d814772..c615653 100644
EXPORT_PER_CPU_SYMBOL(kernel_stack);
DEFINE_PER_CPU(char *, irq_stack_ptr) =
-@@ -1227,7 +1179,7 @@ void __cpuinit cpu_init(void)
+@@ -1231,7 +1183,7 @@ void __cpuinit cpu_init(void)
load_ucode_ap();
cpu = stack_smp_processor_id();
@@ -17307,7 +17253,7 @@ index d814772..c615653 100644
oist = &per_cpu(orig_ist, cpu);
#ifdef CONFIG_NUMA
-@@ -1253,7 +1205,7 @@ void __cpuinit cpu_init(void)
+@@ -1257,7 +1209,7 @@ void __cpuinit cpu_init(void)
switch_to_new_gdt(cpu);
loadsegment(fs, 0);
@@ -17316,7 +17262,7 @@ index d814772..c615653 100644
memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8);
syscall_init();
-@@ -1262,7 +1214,6 @@ void __cpuinit cpu_init(void)
+@@ -1266,7 +1218,6 @@ void __cpuinit cpu_init(void)
wrmsrl(MSR_KERNEL_GS_BASE, 0);
barrier();
@@ -17324,7 +17270,7 @@ index d814772..c615653 100644
enable_x2apic();
/*
-@@ -1314,7 +1265,7 @@ void __cpuinit cpu_init(void)
+@@ -1318,7 +1269,7 @@ void __cpuinit cpu_init(void)
{
int cpu = smp_processor_id();
struct task_struct *curr = current;
@@ -17333,19 +17279,6 @@ index d814772..c615653 100644
struct thread_struct *thread = &curr->thread;
show_ucode_info_early();
-diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
-index 1905ce9..a7ac587 100644
---- a/arch/x86/kernel/cpu/intel.c
-+++ b/arch/x86/kernel/cpu/intel.c
-@@ -173,7 +173,7 @@ static void __cpuinit trap_init_f00f_bug(void)
- * Update the IDT descriptor and reload the IDT so that
- * it uses the read-only mapped virtual address.
- */
-- idt_descr.address = fix_to_virt(FIX_F00F_IDT);
-+ idt_descr.address = (struct desc_struct *)fix_to_virt(FIX_F00F_IDT);
- load_idt(&idt_descr);
- }
- #endif
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 7c6f7d5..8cac382 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -17447,7 +17380,7 @@ index 7c6f7d5..8cac382 100644
};
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
-index 7bc1263..bff5686 100644
+index 9239504..b2471ce 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -45,6 +45,7 @@
@@ -17682,10 +17615,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 bf0f01a..9adfee1 100644
+index 1025f3c..824f677 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
-@@ -1305,7 +1305,7 @@ static void __init pmu_check_apic(void)
+@@ -1311,7 +1311,7 @@ static void __init pmu_check_apic(void)
pr_info("no hardware sampling interrupt available.\n");
}
@@ -17694,7 +17627,7 @@ index bf0f01a..9adfee1 100644
.name = "format",
.attrs = NULL,
};
-@@ -1374,7 +1374,7 @@ static struct attribute *events_attr[] = {
+@@ -1410,7 +1410,7 @@ static struct attribute *events_attr[] = {
NULL,
};
@@ -17703,7 +17636,7 @@ index bf0f01a..9adfee1 100644
.name = "events",
.attrs = events_attr,
};
-@@ -1873,7 +1873,7 @@ static unsigned long get_segment_base(unsigned int segment)
+@@ -1920,7 +1920,7 @@ static unsigned long get_segment_base(unsigned int segment)
if (idx > GDT_ENTRIES)
return 0;
@@ -17712,7 +17645,7 @@ index bf0f01a..9adfee1 100644
}
return get_desc_base(desc + idx);
-@@ -1963,7 +1963,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
+@@ -2010,7 +2010,7 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
break;
perf_callchain_store(entry, frame.return_address);
@@ -17722,10 +17655,10 @@ index bf0f01a..9adfee1 100644
}
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
-index 4a0a462..be3b204 100644
+index a9e2207..d70c83a 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
-@@ -1994,10 +1994,10 @@ __init int intel_pmu_init(void)
+@@ -2022,10 +2022,10 @@ __init int intel_pmu_init(void)
* v2 and above have a perf capabilities MSR
*/
if (version > 1) {
@@ -17740,10 +17673,10 @@ index 4a0a462..be3b204 100644
intel_ds_init();
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
-index 3e091f0..d2dc8d6 100644
+index 52441a2..f94fae8 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
-@@ -2428,7 +2428,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types)
+@@ -3093,7 +3093,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types)
static int __init uncore_type_init(struct intel_uncore_type *type)
{
struct intel_uncore_pmu *pmus;
@@ -17752,7 +17685,7 @@ index 3e091f0..d2dc8d6 100644
struct attribute **attrs;
int i, j;
-@@ -2826,7 +2826,7 @@ static int
+@@ -3518,7 +3518,7 @@ static int
return NOTIFY_OK;
}
@@ -17762,10 +17695,10 @@ index 3e091f0..d2dc8d6 100644
/*
* to migrate uncore events, our notifier should be executed
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.h b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
-index e68a455..975a932 100644
+index f952891..4722ad4 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.h
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
-@@ -428,7 +428,7 @@ struct intel_uncore_box {
+@@ -488,7 +488,7 @@ struct intel_uncore_box {
struct uncore_event_desc {
struct kobj_attribute attr;
const char *config;
@@ -17817,7 +17750,7 @@ index afa64ad..dce67dd 100644
return -EFAULT;
}
diff --git a/arch/x86/kernel/doublefault_32.c b/arch/x86/kernel/doublefault_32.c
-index 37250fe..bf2ec74 100644
+index 155a13f..1672b9b 100644
--- a/arch/x86/kernel/doublefault_32.c
+++ b/arch/x86/kernel/doublefault_32.c
@@ -11,7 +11,7 @@
@@ -17832,7 +17765,7 @@ index 37250fe..bf2ec74 100644
@@ -21,7 +21,7 @@ static void doublefault_fn(void)
unsigned long gdt, tss;
- store_gdt(&gdt_desc);
+ native_store_gdt(&gdt_desc);
- gdt = gdt_desc.address;
+ gdt = (unsigned long)gdt_desc.address;
@@ -17852,7 +17785,7 @@ index 37250fe..bf2ec74 100644
.__cr3 = __pa_nodebug(swapper_pg_dir),
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
-index c8797d5..c605e53 100644
+index deb6421..622e0ed 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -2,6 +2,9 @@
@@ -17957,16 +17890,7 @@ index c8797d5..c605e53 100644
}
return (unsigned long)frame;
-@@ -189,7 +188,7 @@ void dump_stack(void)
-
- bp = stack_frame(current, NULL);
- printk("Pid: %d, comm: %.20s %s %s %.*s\n",
-- current->pid, current->comm, print_tainted(),
-+ task_pid_nr(current), current->comm, print_tainted(),
- init_utsname()->release,
- (int)strcspn(init_utsname()->version, " "),
- init_utsname()->version);
-@@ -225,6 +224,8 @@ unsigned __kprobes long oops_begin(void)
+@@ -219,6 +218,8 @@ unsigned __kprobes long oops_begin(void)
}
EXPORT_SYMBOL_GPL(oops_begin);
@@ -17975,7 +17899,7 @@ index c8797d5..c605e53 100644
void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
{
if (regs && kexec_should_crash(current))
-@@ -246,7 +247,10 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
+@@ -240,7 +241,10 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
panic("Fatal exception in interrupt");
if (panic_on_oops)
panic("Fatal exception");
@@ -17987,7 +17911,7 @@ index c8797d5..c605e53 100644
}
int __kprobes __die(const char *str, struct pt_regs *regs, long err)
-@@ -274,7 +278,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
+@@ -268,7 +272,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
print_modules();
show_regs(regs);
#ifdef CONFIG_X86_32
@@ -17996,7 +17920,7 @@ index c8797d5..c605e53 100644
sp = regs->sp;
ss = regs->ss & 0xffff;
} else {
-@@ -302,7 +306,7 @@ void die(const char *str, struct pt_regs *regs, long err)
+@@ -296,7 +300,7 @@ void die(const char *str, struct pt_regs *regs, long err)
unsigned long flags = oops_begin();
int sig = SIGSEGV;
@@ -18006,7 +17930,7 @@ index c8797d5..c605e53 100644
if (__die(str, regs, err))
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
-index 1038a41..db2c12b 100644
+index f2a1770..540657f 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,
@@ -18029,16 +17953,14 @@ index 1038a41..db2c12b 100644
if (ops->stack(data, "IRQ") < 0)
break;
touch_nmi_watchdog();
-@@ -86,7 +84,7 @@ void show_regs(struct pt_regs *regs)
- {
+@@ -87,27 +85,28 @@ void show_regs(struct pt_regs *regs)
int i;
+ show_regs_print_info(KERN_EMERG);
- __show_regs(regs, !user_mode_vm(regs));
+ __show_regs(regs, !user_mode(regs));
- pr_emerg("Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)\n",
- TASK_COMM_LEN, current->comm, task_pid_nr(current),
-@@ -95,21 +93,22 @@ void show_regs(struct pt_regs *regs)
+ /*
* When in-kernel, we also print out the stack and code at the
* time of the fault..
*/
@@ -18064,7 +17986,7 @@ index 1038a41..db2c12b 100644
code_len = code_len - code_prologue + 1;
}
for (i = 0; i < code_len; i++, ip++) {
-@@ -118,7 +117,7 @@ void show_regs(struct pt_regs *regs)
+@@ -116,7 +115,7 @@ void show_regs(struct pt_regs *regs)
pr_cont(" Bad EIP value.");
break;
}
@@ -18073,7 +17995,7 @@ index 1038a41..db2c12b 100644
pr_cont(" <%02x>", c);
else
pr_cont(" %02x", c);
-@@ -131,6 +130,7 @@ int is_valid_bugaddr(unsigned long ip)
+@@ -129,6 +128,7 @@ int is_valid_bugaddr(unsigned long ip)
{
unsigned short ud2;
@@ -18081,7 +18003,7 @@ index 1038a41..db2c12b 100644
if (ip < PAGE_OFFSET)
return 0;
if (probe_kernel_address((unsigned short *)ip, ud2))
-@@ -138,3 +138,15 @@ int is_valid_bugaddr(unsigned long ip)
+@@ -136,3 +136,15 @@ int is_valid_bugaddr(unsigned long ip)
return ud2 == 0x0b0f;
}
@@ -18098,7 +18020,7 @@ index 1038a41..db2c12b 100644
+EXPORT_SYMBOL(pax_check_alloca);
+#endif
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
-index b653675..51cc8c0 100644
+index addb207..99635fa 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -119,9 +119,9 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
@@ -18162,16 +18084,7 @@ index b653675..51cc8c0 100644
put_cpu();
}
EXPORT_SYMBOL(dump_trace);
-@@ -249,7 +253,7 @@ void show_regs(struct pt_regs *regs)
- {
- int i;
- unsigned long sp;
-- const int cpu = smp_processor_id();
-+ const int cpu = raw_smp_processor_id();
- struct task_struct *cur = current;
-
- sp = regs->sp;
-@@ -304,3 +308,50 @@ int is_valid_bugaddr(unsigned long ip)
+@@ -300,3 +304,50 @@ int is_valid_bugaddr(unsigned long ip)
return ud2 == 0x0b0f;
}
@@ -18238,7 +18151,7 @@ index d32abea..74daf4f 100644
static int userdef __initdata;
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
-index 9b9f18b..9fcaa04 100644
+index d15f575..d692043 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -7,6 +7,7 @@
@@ -19010,7 +18923,7 @@ index 8f3e2de..caecc4e 100644
/*
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
-index c1d01e6..a88cf02 100644
+index 7272089..6204f9c5 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -59,6 +59,8 @@
@@ -19746,7 +19659,7 @@ index c1d01e6..a88cf02 100644
.endm
#ifdef CONFIG_SMP
-@@ -1203,12 +1554,22 @@ ENTRY(\sym)
+@@ -1208,12 +1559,22 @@ ENTRY(\sym)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call error_entry
DEFAULT_FRAME 0
@@ -19770,7 +19683,7 @@ index c1d01e6..a88cf02 100644
.endm
.macro paranoidzeroentry sym do_sym
-@@ -1221,15 +1582,25 @@ ENTRY(\sym)
+@@ -1226,15 +1587,25 @@ ENTRY(\sym)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call save_paranoid
TRACE_IRQS_OFF
@@ -19798,7 +19711,7 @@ index c1d01e6..a88cf02 100644
.macro paranoidzeroentry_ist sym do_sym ist
ENTRY(\sym)
INTR_FRAME
-@@ -1240,14 +1611,30 @@ ENTRY(\sym)
+@@ -1245,14 +1616,30 @@ ENTRY(\sym)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call save_paranoid
TRACE_IRQS_OFF_DEBUG
@@ -19830,7 +19743,7 @@ index c1d01e6..a88cf02 100644
.endm
.macro errorentry sym do_sym
-@@ -1259,13 +1646,23 @@ ENTRY(\sym)
+@@ -1264,13 +1651,23 @@ ENTRY(\sym)
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
call error_entry
DEFAULT_FRAME 0
@@ -19855,7 +19768,7 @@ index c1d01e6..a88cf02 100644
.endm
/* error code is on the stack already */
-@@ -1279,13 +1676,23 @@ ENTRY(\sym)
+@@ -1284,13 +1681,23 @@ ENTRY(\sym)
call save_paranoid
DEFAULT_FRAME 0
TRACE_IRQS_OFF
@@ -19880,7 +19793,7 @@ index c1d01e6..a88cf02 100644
.endm
zeroentry divide_error do_divide_error
-@@ -1315,9 +1722,10 @@ gs_change:
+@@ -1320,9 +1727,10 @@ gs_change:
2: mfence /* workaround */
SWAPGS
popfq_cfi
@@ -19892,7 +19805,7 @@ index c1d01e6..a88cf02 100644
_ASM_EXTABLE(gs_change,bad_gs)
.section .fixup,"ax"
-@@ -1345,9 +1753,10 @@ ENTRY(call_softirq)
+@@ -1350,9 +1758,10 @@ ENTRY(call_softirq)
CFI_DEF_CFA_REGISTER rsp
CFI_ADJUST_CFA_OFFSET -8
decl PER_CPU_VAR(irq_count)
@@ -19904,7 +19817,7 @@ index c1d01e6..a88cf02 100644
#ifdef CONFIG_XEN
zeroentry xen_hypervisor_callback xen_do_hypervisor_callback
-@@ -1385,7 +1794,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
+@@ -1390,7 +1799,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
decl PER_CPU_VAR(irq_count)
jmp error_exit
CFI_ENDPROC
@@ -19913,7 +19826,7 @@ index c1d01e6..a88cf02 100644
/*
* Hypervisor uses this for application faults while it executes.
-@@ -1444,7 +1853,7 @@ ENTRY(xen_failsafe_callback)
+@@ -1449,7 +1858,7 @@ ENTRY(xen_failsafe_callback)
SAVE_ALL
jmp error_exit
CFI_ENDPROC
@@ -19922,7 +19835,7 @@ index c1d01e6..a88cf02 100644
apicinterrupt HYPERVISOR_CALLBACK_VECTOR \
xen_hvm_callback_vector xen_evtchn_do_upcall
-@@ -1496,18 +1905,33 @@ ENTRY(paranoid_exit)
+@@ -1501,18 +1910,33 @@ ENTRY(paranoid_exit)
DEFAULT_FRAME
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF_DEBUG
@@ -19958,7 +19871,7 @@ index c1d01e6..a88cf02 100644
jmp irq_return
paranoid_userspace:
GET_THREAD_INFO(%rcx)
-@@ -1536,7 +1960,7 @@ paranoid_schedule:
+@@ -1541,7 +1965,7 @@ paranoid_schedule:
TRACE_IRQS_OFF
jmp paranoid_userspace
CFI_ENDPROC
@@ -19967,7 +19880,7 @@ index c1d01e6..a88cf02 100644
/*
* Exception entry point. This expects an error code/orig_rax on the stack.
-@@ -1563,12 +1987,13 @@ ENTRY(error_entry)
+@@ -1568,12 +1992,13 @@ ENTRY(error_entry)
movq_cfi r14, R14+8
movq_cfi r15, R15+8
xorl %ebx,%ebx
@@ -19982,7 +19895,7 @@ index c1d01e6..a88cf02 100644
ret
/*
-@@ -1595,7 +2020,7 @@ bstep_iret:
+@@ -1600,7 +2025,7 @@ bstep_iret:
movq %rcx,RIP+8(%rsp)
jmp error_swapgs
CFI_ENDPROC
@@ -19991,7 +19904,7 @@ index c1d01e6..a88cf02 100644
/* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */
-@@ -1606,7 +2031,7 @@ ENTRY(error_exit)
+@@ -1611,7 +2036,7 @@ ENTRY(error_exit)
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
GET_THREAD_INFO(%rcx)
@@ -20000,7 +19913,7 @@ index c1d01e6..a88cf02 100644
jne retint_kernel
LOCKDEP_SYS_EXIT_IRQ
movl TI_flags(%rcx),%edx
-@@ -1615,7 +2040,7 @@ ENTRY(error_exit)
+@@ -1620,7 +2045,7 @@ ENTRY(error_exit)
jnz retint_careful
jmp retint_swapgs
CFI_ENDPROC
@@ -20009,7 +19922,7 @@ index c1d01e6..a88cf02 100644
/*
* Test if a given stack is an NMI stack or not.
-@@ -1673,9 +2098,11 @@ ENTRY(nmi)
+@@ -1678,9 +2103,11 @@ ENTRY(nmi)
* If %cs was not the kernel segment, then the NMI triggered in user
* space, which means it is definitely not nested.
*/
@@ -20022,7 +19935,7 @@ index c1d01e6..a88cf02 100644
/*
* Check the special variable on the stack to see if NMIs are
* executing.
-@@ -1709,8 +2136,7 @@ nested_nmi:
+@@ -1714,8 +2141,7 @@ nested_nmi:
1:
/* Set up the interrupted NMIs stack to jump to repeat_nmi */
@@ -20032,7 +19945,7 @@ index c1d01e6..a88cf02 100644
CFI_ADJUST_CFA_OFFSET 1*8
leaq -10*8(%rsp), %rdx
pushq_cfi $__KERNEL_DS
-@@ -1728,6 +2154,7 @@ nested_nmi_out:
+@@ -1733,6 +2159,7 @@ nested_nmi_out:
CFI_RESTORE rdx
/* No need to check faults here */
@@ -20040,7 +19953,7 @@ index c1d01e6..a88cf02 100644
INTERRUPT_RETURN
CFI_RESTORE_STATE
-@@ -1844,6 +2271,8 @@ end_repeat_nmi:
+@@ -1849,6 +2276,8 @@ end_repeat_nmi:
*/
movq %cr2, %r12
@@ -20049,7 +19962,7 @@ index c1d01e6..a88cf02 100644
/* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
movq %rsp,%rdi
movq $-1,%rsi
-@@ -1856,26 +2285,31 @@ end_repeat_nmi:
+@@ -1861,26 +2290,31 @@ end_repeat_nmi:
movq %r12, %cr2
1:
@@ -20152,7 +20065,7 @@ index 42a392a..fbbd930 100644
return -EFAULT;
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
-index 8f3201d..6898c0c 100644
+index 55b6761..a6456fc 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -67,12 +67,12 @@ again:
@@ -20637,7 +20550,7 @@ index 73afd11..d1670f5 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 321d65e..ad8817d 100644
+index 321d65e..863089b 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -20,6 +20,8 @@
@@ -20879,21 +20792,26 @@ index 321d65e..ad8817d 100644
#include "../../x86/xen/xen-head.S"
-
- .section .bss, "aw", @nobits
-+
-+ .section .rodata,"a",@progbits
- .align L1_CACHE_BYTES
- ENTRY(idt_table)
+- .align L1_CACHE_BYTES
+-ENTRY(idt_table)
- .skip IDT_ENTRIES * 16
-+ .fill 512,8,0
- .align L1_CACHE_BYTES
- ENTRY(nmi_idt_table)
+- .align L1_CACHE_BYTES
+-ENTRY(nmi_idt_table)
- .skip IDT_ENTRIES * 16
-+ .fill 512,8,0
-
+-
- __PAGE_ALIGNED_BSS
++ .section .rodata,"a",@progbits
NEXT_PAGE(empty_zero_page)
.skip PAGE_SIZE
++
++ .align L1_CACHE_BYTES
++ENTRY(idt_table)
++ .fill 512,8,0
++
++ .align L1_CACHE_BYTES
++ENTRY(nmi_idt_table)
++ .fill 512,8,0
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 0fa6912..37fce70 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
@@ -21034,7 +20952,7 @@ index 4ddaf66..6292f4e 100644
return -EPERM;
}
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
-index 84b7789..e65e8be 100644
+index ac0631d..ff7cb62 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -18,7 +18,7 @@
@@ -21337,7 +21255,7 @@ index 836f832..a8bda67 100644
}
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
-index 7bfe318..383d238 100644
+index 211bce4..6e2580a 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -119,9 +119,12 @@ static void __kprobes __synthesize_relative_insn(void *from, void *to, u8 op)
@@ -21385,9 +21303,9 @@ index 7bfe318..383d238 100644
#ifdef CONFIG_X86_64
if (insn_rip_relative(&insn)) {
-@@ -355,7 +360,9 @@ int __kprobes __copy_instruction(u8 *dest, u8 *src)
- newdisp = (u8 *) src + (s64) insn.displacement.value - (u8 *) dest;
- BUG_ON((s64) (s32) newdisp != newdisp); /* Sanity check. */
+@@ -359,7 +364,9 @@ int __kprobes __copy_instruction(u8 *dest, u8 *src)
+ return 0;
+ }
disp = (u8 *) dest + insn_offset_displacement(&insn);
+ pax_open_kernel();
*(s32 *) disp = (s32) newdisp;
@@ -21395,7 +21313,7 @@ index 7bfe318..383d238 100644
}
#endif
return insn.length;
-@@ -488,7 +495,7 @@ setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *k
+@@ -498,7 +505,7 @@ setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *k
* nor set current_kprobe, because it doesn't use single
* stepping.
*/
@@ -21404,7 +21322,7 @@ index 7bfe318..383d238 100644
preempt_enable_no_resched();
return;
}
-@@ -505,9 +512,9 @@ setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *k
+@@ -515,9 +522,9 @@ setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *k
regs->flags &= ~X86_EFLAGS_IF;
/* single step inline if the instruction is an int3 */
if (p->opcode == BREAKPOINT_INSTRUCTION)
@@ -21416,7 +21334,7 @@ index 7bfe318..383d238 100644
}
/*
-@@ -586,7 +593,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
+@@ -596,7 +603,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
setup_singlestep(p, regs, kcb, 0);
return 1;
}
@@ -21425,7 +21343,7 @@ index 7bfe318..383d238 100644
/*
* The breakpoint instruction was removed right
* after we hit it. Another cpu has removed
-@@ -632,6 +639,9 @@ static void __used __kprobes kretprobe_trampoline_holder(void)
+@@ -642,6 +649,9 @@ static void __used __kprobes kretprobe_trampoline_holder(void)
" movq %rax, 152(%rsp)\n"
RESTORE_REGS_STRING
" popfq\n"
@@ -21435,7 +21353,7 @@ index 7bfe318..383d238 100644
#else
" pushf\n"
SAVE_REGS_STRING
-@@ -769,7 +779,7 @@ static void __kprobes
+@@ -779,7 +789,7 @@ static void __kprobes
resume_execution(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb)
{
unsigned long *tos = stack_addr(regs);
@@ -21444,7 +21362,7 @@ index 7bfe318..383d238 100644
unsigned long orig_ip = (unsigned long)p->addr;
kprobe_opcode_t *insn = p->ainsn.insn;
-@@ -951,7 +961,7 @@ kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *d
+@@ -961,7 +971,7 @@ kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *d
struct die_args *args = data;
int ret = NOTIFY_DONE;
@@ -21523,10 +21441,10 @@ index 76dc6f0..66bdfc3 100644
reset_current_kprobe();
preempt_enable_no_resched();
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
-index b686a90..60d36fb 100644
+index cd6d9a5..16245a4 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
-@@ -453,7 +453,7 @@ static int __cpuinit kvm_cpu_notify(struct notifier_block *self,
+@@ -455,7 +455,7 @@ static int __cpuinit kvm_cpu_notify(struct notifier_block *self,
return NOTIFY_OK;
}
@@ -21905,7 +21823,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 8bfb335..c1463c6 100644
+index cd6de64..27c6af0 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -55,6 +55,9 @@ u64 _paravirt_ident_64(u64 x)
@@ -21988,7 +21906,7 @@ index 8bfb335..c1463c6 100644
.cpuid = native_cpuid,
.get_debugreg = native_get_debugreg,
.set_debugreg = native_set_debugreg,
-@@ -395,21 +402,26 @@ struct pv_cpu_ops pv_cpu_ops = {
+@@ -394,21 +401,26 @@ struct pv_cpu_ops pv_cpu_ops = {
.end_context_switch = paravirt_nop,
};
@@ -22018,7 +21936,7 @@ index 8bfb335..c1463c6 100644
.read_cr2 = native_read_cr2,
.write_cr2 = native_write_cr2,
-@@ -459,6 +471,7 @@ struct pv_mmu_ops pv_mmu_ops = {
+@@ -458,6 +470,7 @@ struct pv_mmu_ops pv_mmu_ops = {
.make_pud = PTE_IDENT,
.set_pgd = native_set_pgd,
@@ -22026,7 +21944,7 @@ index 8bfb335..c1463c6 100644
#endif
#endif /* PAGETABLE_LEVELS >= 3 */
-@@ -479,6 +492,12 @@ struct pv_mmu_ops pv_mmu_ops = {
+@@ -478,6 +491,12 @@ struct pv_mmu_ops pv_mmu_ops = {
},
.set_fixmap = native_set_fixmap,
@@ -22079,7 +21997,7 @@ index 6c483ba..d10ce2f 100644
static struct dma_map_ops swiotlb_dma_ops = {
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
-index 14ae100..752a4f6 100644
+index 81a5f5e..20f8b58 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -36,7 +36,8 @@
@@ -22110,16 +22028,7 @@ index 14ae100..752a4f6 100644
t->io_bitmap_ptr = NULL;
clear_thread_flag(TIF_IO_BITMAP);
-@@ -136,7 +137,7 @@ void show_regs_common(void)
- board = dmi_get_system_info(DMI_BOARD_NAME);
-
- printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s %s %s%s%s\n",
-- current->pid, current->comm, print_tainted(),
-+ task_pid_nr(current), current->comm, print_tainted(),
- init_utsname()->release,
- (int)strcspn(init_utsname()->version, " "),
- init_utsname()->version,
-@@ -149,6 +150,9 @@ void flush_thread(void)
+@@ -125,6 +126,9 @@ void flush_thread(void)
{
struct task_struct *tsk = current;
@@ -22129,7 +22038,7 @@ index 14ae100..752a4f6 100644
flush_ptrace_hw_breakpoint(tsk);
memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
drop_init_fpu(tsk);
-@@ -295,7 +299,7 @@ static void __exit_idle(void)
+@@ -271,7 +275,7 @@ static void __exit_idle(void)
void exit_idle(void)
{
/* idle loop has pid 0 */
@@ -22138,7 +22047,7 @@ index 14ae100..752a4f6 100644
return;
__exit_idle();
}
-@@ -398,7 +402,7 @@ bool xen_set_default_idle(void)
+@@ -327,7 +331,7 @@ bool xen_set_default_idle(void)
return ret;
}
#endif
@@ -22147,7 +22056,7 @@ index 14ae100..752a4f6 100644
{
local_irq_disable();
/*
-@@ -544,16 +548,37 @@ static int __init idle_setup(char *str)
+@@ -456,16 +460,37 @@ static int __init idle_setup(char *str)
}
early_param("idle", idle_setup);
@@ -22196,7 +22105,7 @@ index 14ae100..752a4f6 100644
+}
+#endif
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
-index b5a8905..d9cacac 100644
+index 7305f7d..22f73d6 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -65,6 +65,7 @@ asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread");
@@ -22207,7 +22116,7 @@ index b5a8905..d9cacac 100644
}
void __show_regs(struct pt_regs *regs, int all)
-@@ -74,21 +75,20 @@ void __show_regs(struct pt_regs *regs, int all)
+@@ -74,19 +75,18 @@ void __show_regs(struct pt_regs *regs, int all)
unsigned long sp;
unsigned short ss, gs;
@@ -22223,8 +22132,6 @@ index b5a8905..d9cacac 100644
}
+ gs = get_user_gs(regs);
- show_regs_common();
-
printk(KERN_DEFAULT "EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n",
(u16)regs->cs, regs->ip, regs->flags,
- smp_processor_id());
@@ -22232,7 +22139,7 @@ index b5a8905..d9cacac 100644
print_symbol("EIP is at %s\n", regs->ip);
printk(KERN_DEFAULT "EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
-@@ -130,20 +130,21 @@ void release_thread(struct task_struct *dead_task)
+@@ -128,20 +128,21 @@ void release_thread(struct task_struct *dead_task)
int copy_thread(unsigned long clone_flags, unsigned long sp,
unsigned long arg, struct task_struct *p)
{
@@ -22258,7 +22165,7 @@ index b5a8905..d9cacac 100644
childregs->fs = __KERNEL_PERCPU;
childregs->bx = sp; /* function */
childregs->bp = arg;
-@@ -250,7 +251,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -248,7 +249,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();
@@ -22267,7 +22174,7 @@ index b5a8905..d9cacac 100644
fpu_switch_t fpu;
/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
-@@ -274,6 +275,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -272,6 +273,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
*/
lazy_save_gs(prev->gs);
@@ -22278,7 +22185,7 @@ index b5a8905..d9cacac 100644
/*
* Load the per-thread Thread-Local Storage descriptor.
*/
-@@ -304,6 +309,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -302,6 +307,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
*/
arch_end_context_switch(next_p);
@@ -22288,7 +22195,7 @@ index b5a8905..d9cacac 100644
/*
* Restore %gs if needed (which is common)
*/
-@@ -312,8 +320,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -310,8 +318,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
switch_fpu_finish(next_p, fpu);
@@ -22297,16 +22204,16 @@ index b5a8905..d9cacac 100644
return prev_p;
}
-@@ -343,4 +349,3 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -341,4 +347,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 0f49677..fcbf88c 100644
+index 355ae06..4530766 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
-@@ -152,10 +152,11 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
+@@ -151,10 +151,11 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
struct pt_regs *childregs;
struct task_struct *me = current;
@@ -22319,7 +22226,7 @@ index 0f49677..fcbf88c 100644
set_tsk_thread_flag(p, TIF_FORK);
p->fpu_counter = 0;
p->thread.io_bitmap_ptr = NULL;
-@@ -274,7 +275,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -273,7 +274,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();
@@ -22328,7 +22235,7 @@ index 0f49677..fcbf88c 100644
unsigned fsindex, gsindex;
fpu_switch_t fpu;
-@@ -356,10 +357,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
+@@ -355,10 +356,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
prev->usersp = this_cpu_read(old_rsp);
this_cpu_write(old_rsp, next->usersp);
this_cpu_write(current_task, next_p);
@@ -22341,7 +22248,7 @@ index 0f49677..fcbf88c 100644
/*
* Now maybe reload the debug registers and handle I/O bitmaps
-@@ -428,12 +428,11 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -427,12 +427,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);
@@ -22649,10 +22556,10 @@ index f2bb9c9..bed145d7 100644
1:
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
-index fae9134..8fcd87c 100644
+index 56f7fcf..fa229f4 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
-@@ -111,6 +111,7 @@
+@@ -110,6 +110,7 @@
#include <asm/mce.h>
#include <asm/alternative.h>
#include <asm/prom.h>
@@ -22660,7 +22567,7 @@ index fae9134..8fcd87c 100644
/*
* max_low_pfn_mapped: highest direct mapped pfn under 4GB
-@@ -447,7 +448,7 @@ static void __init parse_setup_data(void)
+@@ -444,7 +445,7 @@ static void __init parse_setup_data(void)
switch (data->type) {
case SETUP_E820_EXT:
@@ -22669,7 +22576,7 @@ index fae9134..8fcd87c 100644
break;
case SETUP_DTB:
add_dtb(pa_data);
-@@ -774,7 +775,7 @@ static void __init trim_bios_range(void)
+@@ -771,7 +772,7 @@ static void __init trim_bios_range(void)
* area (640->1Mb) as ram even though it is not.
* take them out.
*/
@@ -22678,7 +22585,7 @@ index fae9134..8fcd87c 100644
sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
}
-@@ -782,7 +783,7 @@ static void __init trim_bios_range(void)
+@@ -779,7 +780,7 @@ static void __init trim_bios_range(void)
/* called before trim_bios_range() to spare extra sanitize */
static void __init e820_add_kernel_range(void)
{
@@ -22687,7 +22594,7 @@ index fae9134..8fcd87c 100644
u64 size = __pa_symbol(_end) - start;
/*
-@@ -844,8 +845,12 @@ static void __init trim_low_memory_range(void)
+@@ -841,8 +842,12 @@ static void __init trim_low_memory_range(void)
void __init setup_arch(char **cmdline_p)
{
@@ -22700,7 +22607,7 @@ index fae9134..8fcd87c 100644
early_reserve_initrd();
-@@ -937,14 +942,14 @@ void __init setup_arch(char **cmdline_p)
+@@ -934,14 +939,14 @@ void __init setup_arch(char **cmdline_p)
if (!boot_params.hdr.root_flags)
root_mountflags &= ~MS_RDONLY;
@@ -22888,7 +22795,7 @@ index 48d2b7d..90d328a 100644
.smp_prepare_cpus = native_smp_prepare_cpus,
.smp_cpus_done = native_smp_cpus_done,
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
-index 9f190a2..90a0688 100644
+index bfd348e..4816ad8 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -748,6 +748,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
@@ -23353,7 +23260,7 @@ index 24d3c91..d06b473 100644
return pc;
}
diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c
-index 9d9d2f9..cad418a 100644
+index f7fec09..9991981 100644
--- a/arch/x86/kernel/tls.c
+++ b/arch/x86/kernel/tls.c
@@ -84,6 +84,11 @@ int do_set_thread_area(struct task_struct *p, int idx,
@@ -23368,7 +23275,7 @@ index 9d9d2f9..cad418a 100644
set_tls_desc(p, idx, &info, 1);
return 0;
-@@ -204,7 +209,7 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset,
+@@ -200,7 +205,7 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset,
if (kbuf)
info = kbuf;
@@ -23378,7 +23285,7 @@ index 9d9d2f9..cad418a 100644
else
info = infobuf;
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
-index 68bda7a..3ec7bb7 100644
+index 772e2a8..bad5bf6 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -68,12 +68,6 @@
@@ -23452,7 +23359,7 @@ index 68bda7a..3ec7bb7 100644
regs->ip, regs->sp, error_code);
print_vma_addr(" in ", regs->ip);
pr_cont("\n");
-@@ -266,7 +272,7 @@ do_general_protection(struct pt_regs *regs, long error_code)
+@@ -273,7 +279,7 @@ do_general_protection(struct pt_regs *regs, long error_code)
conditional_sti(regs);
#ifdef CONFIG_X86_32
@@ -23461,7 +23368,7 @@ index 68bda7a..3ec7bb7 100644
local_irq_enable();
handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code);
goto exit;
-@@ -274,18 +280,42 @@ do_general_protection(struct pt_regs *regs, long error_code)
+@@ -281,18 +287,42 @@ do_general_protection(struct pt_regs *regs, long error_code)
#endif
tsk = current;
@@ -23506,7 +23413,7 @@ index 68bda7a..3ec7bb7 100644
tsk->thread.error_code = error_code;
tsk->thread.trap_nr = X86_TRAP_GP;
-@@ -440,7 +470,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
+@@ -450,7 +480,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);
@@ -23515,7 +23422,7 @@ index 68bda7a..3ec7bb7 100644
handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code,
X86_TRAP_DB);
preempt_conditional_cli(regs);
-@@ -455,7 +485,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
+@@ -465,7 +495,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.
*/
@@ -23524,7 +23431,7 @@ index 68bda7a..3ec7bb7 100644
tsk->thread.debugreg6 &= ~DR_STEP;
set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
regs->flags &= ~X86_EFLAGS_TF;
-@@ -487,7 +517,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)
+@@ -497,7 +527,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)
return;
conditional_sti(regs);
@@ -23534,7 +23441,7 @@ index 68bda7a..3ec7bb7 100644
if (!fixup_exception(regs)) {
task->thread.error_code = error_code;
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
-index 0ba4cfb..4596bec 100644
+index 2ed8459..7cf329f 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -629,7 +629,7 @@ int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val,
@@ -23546,6 +23453,15 @@ index 0ba4cfb..4596bec 100644
return NOTIFY_DONE;
switch (val) {
+@@ -719,7 +719,7 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs
+
+ if (ncopied != rasize) {
+ pr_err("uprobe: return address clobbered: pid=%d, %%sp=%#lx, "
+- "%%ip=%#lx\n", current->pid, regs->sp, regs->ip);
++ "%%ip=%#lx\n", task_pid_nr(current), regs->sp, regs->ip);
+
+ force_sig_info(SIGSEGV, SEND_SIG_FORCED, current);
+ }
diff --git a/arch/x86/kernel/verify_cpu.S b/arch/x86/kernel/verify_cpu.S
index b9242ba..50c5edd 100644
--- a/arch/x86/kernel/verify_cpu.S
@@ -23559,7 +23475,7 @@ index b9242ba..50c5edd 100644
* verify_cpu, returns the status of longmode and SSE in register %eax.
* 0: Success 1: Failure
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
-index 3dbdd9c..888b14e 100644
+index e8edcf5..27f9344 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -44,6 +44,7 @@
@@ -23582,34 +23498,33 @@ index 3dbdd9c..888b14e 100644
@@ -214,6 +215,14 @@ SYSCALL_DEFINE1(vm86old, struct vm86_struct __user *, v86)
if (tsk->thread.saved_sp0)
- goto out;
+ return -EPERM;
+
+#ifdef CONFIG_GRKERNSEC_VM86
+ if (!capable(CAP_SYS_RAWIO)) {
+ gr_handle_vm86();
-+ goto out;
++ return -EPERM;
+ }
+#endif
+
tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs,
offsetof(struct kernel_vm86_struct, vm86plus) -
sizeof(info.regs));
-@@ -242,6 +251,14 @@ SYSCALL_DEFINE2(vm86, unsigned long, cmd, unsigned long, arg)
- int tmp, ret;
+@@ -238,6 +247,13 @@ SYSCALL_DEFINE2(vm86, unsigned long, cmd, unsigned long, arg)
+ int tmp;
struct vm86plus_struct __user *v86;
+#ifdef CONFIG_GRKERNSEC_VM86
+ if (!capable(CAP_SYS_RAWIO)) {
+ gr_handle_vm86();
-+ ret = -EPERM;
-+ goto out;
++ return -EPERM;
+ }
+#endif
+
tsk = current;
switch (cmd) {
case VM86_REQUEST_IRQ:
-@@ -329,7 +346,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
+@@ -318,7 +334,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
tsk->thread.saved_fs = info->regs32->fs;
tsk->thread.saved_gs = get_user_gs(info->regs32);
@@ -23618,7 +23533,7 @@ index 3dbdd9c..888b14e 100644
tsk->thread.sp0 = (unsigned long) &info->VM86_TSS_ESP0;
if (cpu_has_sep)
tsk->thread.sysenter_cs = 0;
-@@ -536,7 +553,7 @@ static void do_int(struct kernel_vm86_regs *regs, int i,
+@@ -525,7 +541,7 @@ static void do_int(struct kernel_vm86_regs *regs, int i,
goto cannot_handle;
if (i == 0x21 && is_revectored(AH(regs), &KVM86->int21_revectored))
goto cannot_handle;
@@ -23628,7 +23543,7 @@ index 3dbdd9c..888b14e 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 22a1530..5efafbf 100644
+index 10c4f30..57377c2 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -26,6 +26,13 @@
@@ -23695,9 +23610,9 @@ index 22a1530..5efafbf 100644
+ __LOAD_PHYSICAL_ADDR = . - LOAD_OFFSET + __KERNEL_TEXT_OFFSET;
+ _text = .;
HEAD_TEXT
- #ifdef CONFIG_X86_32
- . = ALIGN(PAGE_SIZE);
-@@ -108,13 +128,48 @@ SECTIONS
+ . = ALIGN(8);
+ _stext = .;
+@@ -104,13 +124,48 @@ SECTIONS
IRQENTRY_TEXT
*(.fixup)
*(.gnu.warning)
@@ -23750,7 +23665,7 @@ index 22a1530..5efafbf 100644
#if defined(CONFIG_DEBUG_RODATA)
/* .text should occupy whole number of pages */
-@@ -126,16 +181,20 @@ SECTIONS
+@@ -122,16 +177,20 @@ SECTIONS
/* Data */
.data : AT(ADDR(.data) - LOAD_OFFSET) {
@@ -23774,7 +23689,7 @@ index 22a1530..5efafbf 100644
PAGE_ALIGNED_DATA(PAGE_SIZE)
-@@ -176,12 +235,19 @@ SECTIONS
+@@ -172,12 +231,19 @@ SECTIONS
#endif /* CONFIG_X86_64 */
/* Init code and data - will be freed after init */
@@ -23797,7 +23712,7 @@ index 22a1530..5efafbf 100644
/*
* percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
* output PHDR, so the next output section - .init.text - should
-@@ -190,12 +256,27 @@ SECTIONS
+@@ -186,12 +252,27 @@ SECTIONS
PERCPU_VADDR(INTERNODE_CACHE_BYTES, 0, :percpu)
#endif
@@ -23830,7 +23745,7 @@ index 22a1530..5efafbf 100644
.x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
__x86_cpu_dev_start = .;
-@@ -257,19 +338,12 @@ SECTIONS
+@@ -253,19 +334,12 @@ SECTIONS
}
. = ALIGN(8);
@@ -23851,7 +23766,7 @@ index 22a1530..5efafbf 100644
PERCPU_SECTION(INTERNODE_CACHE_BYTES)
#endif
-@@ -288,16 +362,10 @@ SECTIONS
+@@ -284,16 +358,10 @@ SECTIONS
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
__smp_locks = .;
*(.smp_locks)
@@ -23869,7 +23784,7 @@ index 22a1530..5efafbf 100644
/* BSS */
. = ALIGN(PAGE_SIZE);
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
-@@ -313,6 +381,7 @@ SECTIONS
+@@ -309,6 +377,7 @@ SECTIONS
__brk_base = .;
. += 64 * 1024; /* 64k alignment slop space */
*(.brk_reservation) /* areas brk users have reserved */
@@ -23877,7 +23792,7 @@ index 22a1530..5efafbf 100644
__brk_limit = .;
}
-@@ -339,13 +408,12 @@ SECTIONS
+@@ -335,13 +404,12 @@ SECTIONS
* for the boot processor.
*/
#define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load
@@ -24060,10 +23975,10 @@ index a20ecb5..d0e2194 100644
out:
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
-index 698eece..776b682 100644
+index 5953dce..f11a7d2 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
-@@ -328,6 +328,7 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt)
+@@ -329,6 +329,7 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt)
#define ____emulate_2op(ctxt, _op, _x, _y, _suffix, _dsttype) \
do { \
@@ -24071,7 +23986,7 @@ index 698eece..776b682 100644
__asm__ __volatile__ ( \
_PRE_EFLAGS("0", "4", "2") \
_op _suffix " %"_x"3,%1; " \
-@@ -342,8 +343,6 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt)
+@@ -343,8 +344,6 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt)
/* Raw emulation: instruction has two explicit operands. */
#define __emulate_2op_nobyte(ctxt,_op,_wx,_wy,_lx,_ly,_qx,_qy) \
do { \
@@ -24080,7 +23995,7 @@ index 698eece..776b682 100644
switch ((ctxt)->dst.bytes) { \
case 2: \
____emulate_2op(ctxt,_op,_wx,_wy,"w",u16); \
-@@ -359,7 +358,6 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt)
+@@ -360,7 +359,6 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt)
#define __emulate_2op(ctxt,_op,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \
do { \
@@ -24089,7 +24004,7 @@ index 698eece..776b682 100644
case 1: \
____emulate_2op(ctxt,_op,_bx,_by,"b",u8); \
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
-index f77df1c..6f20690 100644
+index 0eee2c8..94a32c3 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -55,7 +55,7 @@
@@ -24102,7 +24017,7 @@ index f77df1c..6f20690 100644
#define APIC_LVT_NUM 6
/* 14 is the version for Xeon and Pentium 8.4.8*/
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
-index 105dd5b..1b0ccc2 100644
+index da20860..d19fdf5 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -208,7 +208,7 @@ retry_walk:
@@ -24115,10 +24030,10 @@ index 105dd5b..1b0ccc2 100644
goto error;
walker->ptep_user[walker->level - 1] = ptep_user;
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
-index e1b1ce2..f7b4b43 100644
+index a14a6ea..dc86cf0 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
-@@ -3507,7 +3507,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
+@@ -3493,7 +3493,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);
@@ -24130,7 +24045,7 @@ index e1b1ce2..f7b4b43 100644
load_TR_desc();
}
-@@ -3901,6 +3905,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -3894,6 +3898,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
#endif
#endif
@@ -24142,10 +24057,10 @@ index e1b1ce2..f7b4b43 100644
local_irq_disable();
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
-index 0af1807..06912bb 100644
+index 260a919..65ddd76 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
-@@ -1184,12 +1184,12 @@ static void vmcs_write64(unsigned long field, u64 value)
+@@ -1311,12 +1311,12 @@ static void vmcs_write64(unsigned long field, u64 value)
#endif
}
@@ -24160,7 +24075,7 @@ index 0af1807..06912bb 100644
{
vmcs_writel(field, vmcs_readl(field) | mask);
}
-@@ -1390,7 +1390,11 @@ static void reload_tss(void)
+@@ -1517,7 +1517,11 @@ static void reload_tss(void)
struct desc_struct *descs;
descs = (void *)gdt->address;
@@ -24172,7 +24087,7 @@ index 0af1807..06912bb 100644
load_TR_desc();
}
-@@ -1614,6 +1618,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
+@@ -1741,6 +1745,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
vmcs_writel(HOST_TR_BASE, kvm_read_tr_base()); /* 22.2.4 */
vmcs_writel(HOST_GDTR_BASE, gdt->address); /* 22.2.4 */
@@ -24183,7 +24098,7 @@ index 0af1807..06912bb 100644
rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp);
vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */
vmx->loaded_vmcs->cpu = cpu;
-@@ -2779,8 +2787,11 @@ static __init int hardware_setup(void)
+@@ -2935,8 +2943,11 @@ static __init int hardware_setup(void)
if (!cpu_has_vmx_flexpriority())
flexpriority_enabled = 0;
@@ -24197,22 +24112,27 @@ index 0af1807..06912bb 100644
if (enable_ept && !cpu_has_vmx_ept_2m_page())
kvm_disable_largepages();
-@@ -2792,10 +2803,12 @@ static __init int hardware_setup(void)
- !cpu_has_vmx_virtual_intr_delivery())
- enable_apicv_reg_vid = 0;
+@@ -2947,13 +2958,15 @@ static __init int hardware_setup(void)
+ if (!cpu_has_vmx_apicv())
+ enable_apicv = 0;
+ pax_open_kernel();
- if (enable_apicv_reg_vid)
+ if (enable_apicv)
- kvm_x86_ops->update_cr8_intercept = NULL;
+ *(void **)&kvm_x86_ops->update_cr8_intercept = NULL;
- else
+ else {
- kvm_x86_ops->hwapic_irr_update = NULL;
+- kvm_x86_ops->deliver_posted_interrupt = NULL;
+- kvm_x86_ops->sync_pir_to_irr = vmx_sync_pir_to_irr_dummy;
+ *(void **)&kvm_x86_ops->hwapic_irr_update = NULL;
++ *(void **)&kvm_x86_ops->deliver_posted_interrupt = NULL;
++ *(void **)&kvm_x86_ops->sync_pir_to_irr = vmx_sync_pir_to_irr_dummy;
+ }
+ pax_close_kernel();
if (nested)
nested_vmx_setup_ctls_msrs();
-@@ -3883,7 +3896,10 @@ static void vmx_set_constant_host_state(void)
+@@ -4069,7 +4082,10 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */
vmcs_writel(HOST_CR4, read_cr4()); /* 22.2.3, 22.2.5 */
@@ -24223,16 +24143,16 @@ index 0af1807..06912bb 100644
vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */
#ifdef CONFIG_X86_64
-@@ -3904,7 +3920,7 @@ static void vmx_set_constant_host_state(void)
- native_store_idt(&dt);
+@@ -4091,7 +4107,7 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
vmcs_writel(HOST_IDTR_BASE, dt.address); /* 22.2.4 */
+ vmx->host_idt_base = dt.address;
- vmcs_writel(HOST_RIP, vmx_return); /* 22.2.5 */
+ vmcs_writel(HOST_RIP, ktla_ktva(vmx_return)); /* 22.2.5 */
rdmsr(MSR_IA32_SYSENTER_CS, low32, high32);
vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
-@@ -6580,6 +6596,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7023,6 +7039,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
"jmp 2f \n\t"
"1: " __ex(ASM_VMX_VMRESUME) "\n\t"
"2: "
@@ -24245,7 +24165,7 @@ index 0af1807..06912bb 100644
/* Save guest registers, load host registers, keep flags */
"mov %0, %c[wordsize](%%" _ASM_SP ") \n\t"
"pop %0 \n\t"
-@@ -6632,6 +6654,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7075,6 +7097,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))
@@ -24257,7 +24177,7 @@ index 0af1807..06912bb 100644
: "cc", "memory"
#ifdef CONFIG_X86_64
, "rax", "rbx", "rdi", "rsi"
-@@ -6645,7 +6672,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7088,7 +7115,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
if (debugctlmsr)
update_debugctlmsr(debugctlmsr);
@@ -24266,7 +24186,7 @@ index 0af1807..06912bb 100644
/*
* The sysexit path does not restore ds/es, so we must set them to
* a reasonable value ourselves.
-@@ -6654,8 +6681,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7097,8 +7124,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
* may be executed in interrupt context, which saves and restore segments
* around it, nullifying its effect.
*/
@@ -24288,10 +24208,10 @@ index 0af1807..06912bb 100644
vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
-index 8563b45..272f1fe 100644
+index e8ba99c..ee9d7d9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
-@@ -1685,8 +1685,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
+@@ -1725,8 +1725,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
{
struct kvm *kvm = vcpu->kvm;
int lm = is_long_mode(vcpu);
@@ -24302,7 +24222,7 @@ index 8563b45..272f1fe 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;
-@@ -2566,6 +2566,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
+@@ -2609,6 +2609,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
if (n < msr_list.nmsrs)
goto out;
r = -EFAULT;
@@ -24311,16 +24231,7 @@ index 8563b45..272f1fe 100644
if (copy_to_user(user_msr_list->indices, &msrs_to_save,
num_msrs_to_save * sizeof(u32)))
goto out;
-@@ -2695,7 +2697,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu,
- static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
- struct kvm_interrupt *irq)
- {
-- if (irq->irq < 0 || irq->irq >= KVM_NR_INTERRUPTS)
-+ if (irq->irq >= KVM_NR_INTERRUPTS)
- return -EINVAL;
- if (irqchip_in_kernel(vcpu->kvm))
- return -ENXIO;
-@@ -5246,7 +5248,7 @@ static struct notifier_block pvclock_gtod_notifier = {
+@@ -5297,7 +5299,7 @@ static struct notifier_block pvclock_gtod_notifier = {
};
#endif
@@ -24830,7 +24741,7 @@ index f5cc9eb..51fa319 100644
CFI_ENDPROC
ENDPROC(atomic64_inc_not_zero_cx8)
diff --git a/arch/x86/lib/checksum_32.S b/arch/x86/lib/checksum_32.S
-index 2af5df3..62b1a5a 100644
+index e78b8ee..7e173a8 100644
--- a/arch/x86/lib/checksum_32.S
+++ b/arch/x86/lib/checksum_32.S
@@ -29,7 +29,8 @@
@@ -25648,7 +25559,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 1c273be..da9cc0e 100644
+index 56313a3..aa84a79 100644
--- a/arch/x86/lib/memcpy_64.S
+++ b/arch/x86/lib/memcpy_64.S
@@ -33,6 +33,7 @@
@@ -25739,7 +25650,7 @@ index 1c273be..da9cc0e 100644
CFI_ENDPROC
ENDPROC(memcpy)
diff --git a/arch/x86/lib/memmove_64.S b/arch/x86/lib/memmove_64.S
-index ee16461..c39c199 100644
+index 65268a6..c9518d1 100644
--- a/arch/x86/lib/memmove_64.S
+++ b/arch/x86/lib/memmove_64.S
@@ -61,13 +61,13 @@ ENTRY(memmove)
@@ -26556,7 +26467,7 @@ index a63efd6..ccecad8 100644
ret
CFI_ENDPROC
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
-index f0312d7..9c39d63 100644
+index 3eb18ac..6890bc3 100644
--- a/arch/x86/lib/usercopy_32.c
+++ b/arch/x86/lib/usercopy_32.c
@@ -42,11 +42,13 @@ do { \
@@ -27074,7 +26985,7 @@ index f0312d7..9c39d63 100644
clac();
return n;
}
-@@ -632,66 +743,51 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr
+@@ -632,60 +743,38 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr
if (n > 64 && cpu_has_xmm2)
n = __copy_user_intel_nocache(to, from, n);
else
@@ -27104,13 +27015,29 @@ index f0312d7..9c39d63 100644
- */
-unsigned long
-copy_to_user(void __user *to, const void *from, unsigned long n)
--{
++#ifdef CONFIG_PAX_MEMORY_UDEREF
++void __set_fs(mm_segment_t x)
+ {
- if (access_ok(VERIFY_WRITE, to, n))
- n = __copy_to_user(to, from, n);
- return n;
--}
++ switch (x.seg) {
++ case 0:
++ loadsegment(gs, 0);
++ break;
++ case TASK_SIZE_MAX:
++ loadsegment(gs, __USER_DS);
++ break;
++ case -1UL:
++ loadsegment(gs, __KERNEL_DS);
++ break;
++ default:
++ BUG();
++ }
+ }
-EXPORT_SYMBOL(copy_to_user);
--
++EXPORT_SYMBOL(__set_fs);
+
-/**
- * copy_from_user: - Copy a block of data from user space.
- * @to: Destination address, in kernel space.
@@ -27129,56 +27056,21 @@ index f0312d7..9c39d63 100644
- */
-unsigned long
-_copy_from_user(void *to, const void __user *from, unsigned long n)
--{
++void set_fs(mm_segment_t x)
+ {
- if (access_ok(VERIFY_READ, from, n))
- n = __copy_from_user(to, from, n);
- else
- memset(to, 0, n);
- return 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);
-+
-+#ifdef CONFIG_PAX_MEMORY_UDEREF
-+void __set_fs(mm_segment_t x)
-+{
-+ switch (x.seg) {
-+ case 0:
-+ loadsegment(gs, 0);
-+ break;
-+ case TASK_SIZE_MAX:
-+ loadsegment(gs, __USER_DS);
-+ break;
-+ case -1UL:
-+ loadsegment(gs, __KERNEL_DS);
-+ break;
-+ default:
-+ BUG();
-+ }
-+ return;
-+}
-+EXPORT_SYMBOL(__set_fs);
-+
-+void set_fs(mm_segment_t x)
-+{
+ current_thread_info()->addr_limit = x;
+ __set_fs(x);
-+}
+ }
+-EXPORT_SYMBOL(_copy_from_user);
+EXPORT_SYMBOL(set_fs);
+#endif
diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
-index 906fea3..ee8a097 100644
+index 906fea3..5646695 100644
--- a/arch/x86/lib/usercopy_64.c
+++ b/arch/x86/lib/usercopy_64.c
@@ -39,7 +39,7 @@ unsigned long __clear_user(void __user *addr, unsigned long size)
@@ -27216,22 +27108,6 @@ index 906fea3..ee8a097 100644
{
char c;
unsigned zero_len;
-@@ -87,3 +86,15 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest)
- clac();
- return len;
- }
-+
-+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);
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 903ec1e..c4166b2 100644
--- a/arch/x86/mm/extable.c
@@ -27287,13 +27163,13 @@ index 903ec1e..c4166b2 100644
}
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
-index 0e88336..2bb9777 100644
+index 654be4a..d36985f 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
-@@ -13,12 +13,19 @@
- #include <linux/perf_event.h> /* perf_sw_event */
+@@ -14,11 +14,18 @@
#include <linux/hugetlb.h> /* hstate_index_to_shift */
#include <linux/prefetch.h> /* prefetchw */
+ #include <linux/context_tracking.h> /* exception_enter(), ... */
+#include <linux/unistd.h>
+#include <linux/compiler.h>
@@ -27301,7 +27177,6 @@ index 0e88336..2bb9777 100644
#include <asm/pgalloc.h> /* pgd_*(), ... */
#include <asm/kmemcheck.h> /* kmemcheck_*(), ... */
#include <asm/fixmap.h> /* VSYSCALL_START */
- #include <asm/context_tracking.h> /* exception_enter(), ... */
+#include <asm/tlbflush.h>
+
+#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
@@ -27739,9 +27614,9 @@ index 0e88336..2bb9777 100644
if (unlikely(expand_stack(vma, address))) {
bad_area(regs, error_code, address);
return;
-@@ -1228,3 +1449,292 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
+@@ -1230,3 +1451,292 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
__do_page_fault(regs, error_code);
- exception_exit(regs);
+ exception_exit(prev_state);
}
+
+#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
@@ -28046,7 +27921,7 @@ index dd74e46..7d26398 100644
return 0;
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
-index 6f31ee5..8ee4164 100644
+index 252b8f5..4dcfdc1 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -44,7 +44,11 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
@@ -28170,7 +28045,7 @@ index ae1aa71..d9bea75 100644
#endif /*HAVE_ARCH_HUGETLB_UNMAPPED_AREA*/
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
-index 0c13708..ca05f23 100644
+index 1f34e92..d252637 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -4,6 +4,7 @@
@@ -28190,7 +28065,7 @@ index 0c13708..ca05f23 100644
#include "mm_internal.h"
-@@ -448,7 +451,15 @@ void __init init_mem_mapping(void)
+@@ -465,7 +468,15 @@ void __init init_mem_mapping(void)
early_ioremap_page_table_range_init();
#endif
@@ -28206,7 +28081,7 @@ index 0c13708..ca05f23 100644
__flush_tlb_all();
early_memtest(0, max_pfn_mapped << PAGE_SHIFT);
-@@ -464,10 +475,40 @@ void __init init_mem_mapping(void)
+@@ -481,10 +492,40 @@ void __init init_mem_mapping(void)
* Access has to be given to non-kernel-ram areas as well, these contain the PCI
* mmio resources as well as potential bios/acpi data regions.
*/
@@ -28248,7 +28123,7 @@ index 0c13708..ca05f23 100644
if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
return 0;
if (!page_is_ram(pagenr))
-@@ -524,8 +565,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
+@@ -538,8 +579,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
#endif
}
@@ -28367,7 +28242,7 @@ index 0c13708..ca05f23 100644
(unsigned long)(&__init_begin),
(unsigned long)(&__init_end));
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
-index 2d19001..e549d98 100644
+index 3ac7e31..89611b7 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -62,33 +62,6 @@ static noinline int do_test_wp_bit(void);
@@ -28557,7 +28432,7 @@ index 2d19001..e549d98 100644
prot = PAGE_KERNEL_EXEC;
pages_4k++;
-@@ -482,7 +486,7 @@ void __init native_pagetable_init(void)
+@@ -474,7 +478,7 @@ void __init native_pagetable_init(void)
pud = pud_offset(pgd, va);
pmd = pmd_offset(pud, va);
@@ -28566,7 +28441,7 @@ index 2d19001..e549d98 100644
break;
/* should not be large page here */
-@@ -540,12 +544,10 @@ void __init early_ioremap_page_table_range_init(void)
+@@ -532,12 +536,10 @@ void __init early_ioremap_page_table_range_init(void)
static void __init pagetable_init(void)
{
@@ -28581,7 +28456,7 @@ index 2d19001..e549d98 100644
EXPORT_SYMBOL_GPL(__supported_pte_mask);
/* user-defined highmem size */
-@@ -780,7 +782,7 @@ void __init mem_init(void)
+@@ -772,7 +774,7 @@ void __init mem_init(void)
after_bootmem = 1;
codesize = (unsigned long) &_etext - (unsigned long) &_text;
@@ -28590,7 +28465,7 @@ index 2d19001..e549d98 100644
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, "
-@@ -821,10 +823,10 @@ void __init mem_init(void)
+@@ -813,10 +815,10 @@ void __init mem_init(void)
((unsigned long)&__init_end -
(unsigned long)&__init_begin) >> 10,
@@ -28604,7 +28479,7 @@ index 2d19001..e549d98 100644
((unsigned long)&_etext - (unsigned long)&_text) >> 10);
/*
-@@ -914,6 +916,7 @@ void set_kernel_text_rw(void)
+@@ -906,6 +908,7 @@ void set_kernel_text_rw(void)
if (!kernel_set_to_readonly)
return;
@@ -28612,7 +28487,7 @@ index 2d19001..e549d98 100644
pr_debug("Set kernel text: %lx - %lx for read write\n",
start, start+size);
-@@ -928,6 +931,7 @@ void set_kernel_text_ro(void)
+@@ -920,6 +923,7 @@ void set_kernel_text_ro(void)
if (!kernel_set_to_readonly)
return;
@@ -28620,7 +28495,7 @@ index 2d19001..e549d98 100644
pr_debug("Set kernel text: %lx - %lx for read only\n",
start, start+size);
-@@ -956,6 +960,7 @@ void mark_rodata_ro(void)
+@@ -948,6 +952,7 @@ void mark_rodata_ro(void)
unsigned long start = PFN_ALIGN(_text);
unsigned long size = PFN_ALIGN(_etext) - start;
@@ -28629,10 +28504,10 @@ index 2d19001..e549d98 100644
printk(KERN_INFO "Write protecting the kernel text: %luk\n",
size >> 10);
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
-index 474e28f..f016b6e 100644
+index bb00c46..f31d2f0 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
-@@ -150,7 +150,7 @@ early_param("gbpages", parse_direct_gbpages_on);
+@@ -151,7 +151,7 @@ early_param("gbpages", parse_direct_gbpages_on);
* around without checking the pgd every time.
*/
@@ -28641,7 +28516,7 @@ index 474e28f..f016b6e 100644
EXPORT_SYMBOL_GPL(__supported_pte_mask);
int force_personality32;
-@@ -183,12 +183,22 @@ void sync_global_pgds(unsigned long start, unsigned long end)
+@@ -184,12 +184,22 @@ void sync_global_pgds(unsigned long start, unsigned long end)
for (address = start; address <= end; address += PGDIR_SIZE) {
const pgd_t *pgd_ref = pgd_offset_k(address);
@@ -28664,7 +28539,7 @@ index 474e28f..f016b6e 100644
list_for_each_entry(page, &pgd_list, lru) {
pgd_t *pgd;
spinlock_t *pgt_lock;
-@@ -197,6 +207,7 @@ void sync_global_pgds(unsigned long start, unsigned long end)
+@@ -198,6 +208,7 @@ void sync_global_pgds(unsigned long start, unsigned long end)
/* the pgt_lock only for Xen */
pgt_lock = &pgd_page_get_mm(page)->page_table_lock;
spin_lock(pgt_lock);
@@ -28672,7 +28547,7 @@ index 474e28f..f016b6e 100644
if (pgd_none(*pgd))
set_pgd(pgd, *pgd_ref);
-@@ -204,7 +215,10 @@ void sync_global_pgds(unsigned long start, unsigned long end)
+@@ -205,7 +216,10 @@ void sync_global_pgds(unsigned long start, unsigned long end)
BUG_ON(pgd_page_vaddr(*pgd)
!= pgd_page_vaddr(*pgd_ref));
@@ -28683,7 +28558,7 @@ index 474e28f..f016b6e 100644
}
spin_unlock(&pgd_lock);
}
-@@ -237,7 +251,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
+@@ -238,7 +252,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
{
if (pgd_none(*pgd)) {
pud_t *pud = (pud_t *)spp_getpage();
@@ -28692,7 +28567,7 @@ index 474e28f..f016b6e 100644
if (pud != pud_offset(pgd, 0))
printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
pud, pud_offset(pgd, 0));
-@@ -249,7 +263,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
+@@ -250,7 +264,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
{
if (pud_none(*pud)) {
pmd_t *pmd = (pmd_t *) spp_getpage();
@@ -28701,7 +28576,7 @@ index 474e28f..f016b6e 100644
if (pmd != pmd_offset(pud, 0))
printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
pmd, pmd_offset(pud, 0));
-@@ -278,7 +292,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
+@@ -279,7 +293,9 @@ void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
pmd = fill_pmd(pud, vaddr);
pte = fill_pte(pmd, vaddr);
@@ -28711,7 +28586,7 @@ index 474e28f..f016b6e 100644
/*
* It's enough to flush this one mapping.
-@@ -337,14 +353,12 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size,
+@@ -338,14 +354,12 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size,
pgd = pgd_offset_k((unsigned long)__va(phys));
if (pgd_none(*pgd)) {
pud = (pud_t *) spp_getpage();
@@ -28728,7 +28603,7 @@ index 474e28f..f016b6e 100644
}
pmd = pmd_offset(pud, phys);
BUG_ON(!pmd_none(*pmd));
-@@ -585,7 +599,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
+@@ -586,7 +600,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
prot);
spin_lock(&init_mm.page_table_lock);
@@ -28737,7 +28612,7 @@ index 474e28f..f016b6e 100644
spin_unlock(&init_mm.page_table_lock);
}
__flush_tlb_all();
-@@ -626,7 +640,7 @@ kernel_physical_mapping_init(unsigned long start,
+@@ -627,7 +641,7 @@ kernel_physical_mapping_init(unsigned long start,
page_size_mask);
spin_lock(&init_mm.page_table_lock);
@@ -28746,7 +28621,7 @@ index 474e28f..f016b6e 100644
spin_unlock(&init_mm.page_table_lock);
pgd_changed = true;
}
-@@ -1224,8 +1238,8 @@ int kern_addr_valid(unsigned long addr)
+@@ -1221,8 +1235,8 @@ int kern_addr_valid(unsigned long addr)
static struct vm_area_struct gate_vma = {
.vm_start = VSYSCALL_START,
.vm_end = VSYSCALL_START + (VSYSCALL_MAPPED_PAGES * PAGE_SIZE),
@@ -28757,7 +28632,7 @@ index 474e28f..f016b6e 100644
};
struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-@@ -1259,7 +1273,7 @@ int in_gate_area_no_mm(unsigned long addr)
+@@ -1256,7 +1270,7 @@ int in_gate_area_no_mm(unsigned long addr)
const char *arch_vma_name(struct vm_area_struct *vma)
{
@@ -28783,7 +28658,7 @@ index 7b179b4..6bd17777 100644
return (void *)vaddr;
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
-index 78fe3f1..73b95e2 100644
+index 9a1e658..da003f3 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -97,7 +97,7 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
@@ -28804,7 +28679,7 @@ index 78fe3f1..73b95e2 100644
{
struct vm_struct *p, *o;
-@@ -315,6 +315,9 @@ void *xlate_dev_mem_ptr(unsigned long phys)
+@@ -310,6 +310,9 @@ void *xlate_dev_mem_ptr(unsigned long phys)
/* If page is RAM, we can use __va. Otherwise ioremap and unmap. */
if (page_is_ram(start >> PAGE_SHIFT))
@@ -28814,7 +28689,7 @@ index 78fe3f1..73b95e2 100644
return __va(phys);
addr = (void __force *)ioremap_cache(start, PAGE_SIZE);
-@@ -327,6 +330,9 @@ void *xlate_dev_mem_ptr(unsigned long phys)
+@@ -322,6 +325,9 @@ void *xlate_dev_mem_ptr(unsigned long phys)
void unxlate_dev_mem_ptr(unsigned long phys, void *addr)
{
if (page_is_ram(phys >> PAGE_SHIFT))
@@ -28824,7 +28699,7 @@ index 78fe3f1..73b95e2 100644
return;
iounmap((void __iomem *)((unsigned long)addr & PAGE_MASK));
-@@ -344,7 +350,7 @@ static int __init early_ioremap_debug_setup(char *str)
+@@ -339,7 +345,7 @@ static int __init early_ioremap_debug_setup(char *str)
early_param("early_ioremap_debug", early_ioremap_debug_setup);
static __initdata int after_paging_init;
@@ -28833,7 +28708,7 @@ index 78fe3f1..73b95e2 100644
static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
{
-@@ -381,8 +387,7 @@ void __init early_ioremap_init(void)
+@@ -376,8 +382,7 @@ void __init early_ioremap_init(void)
slot_virt[i] = __fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i);
pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN));
@@ -28994,10 +28869,10 @@ index dc0b727..f612039 100644
might_sleep();
if (is_enabled()) /* recheck and proper locking in *_core() */
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
-index 72fe01e..f1a8daa 100644
+index a71c4e2..301ae44 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
-@@ -477,7 +477,7 @@ static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi)
+@@ -474,7 +474,7 @@ static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi)
return true;
}
@@ -29007,7 +28882,7 @@ index 72fe01e..f1a8daa 100644
unsigned long uninitialized_var(pfn_align);
int i, nid;
diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c
-index 0e38951..4ca8458 100644
+index d0b1773..4c3327c 100644
--- a/arch/x86/mm/pageattr-test.c
+++ b/arch/x86/mm/pageattr-test.c
@@ -36,7 +36,7 @@ enum {
@@ -29020,7 +28895,7 @@ index 0e38951..4ca8458 100644
struct split_state {
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
-index fb4e73e..43f7238 100644
+index bb32480..aef8278 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -261,7 +261,7 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
@@ -29158,6 +29033,19 @@ index 6574388..87e9bef 100644
cattr_name(want_flags),
(unsigned long long)paddr,
(unsigned long long)(paddr + size - 1),
+diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c
+index 415f6c4..d319983 100644
+--- a/arch/x86/mm/pat_rbtree.c
++++ b/arch/x86/mm/pat_rbtree.c
+@@ -160,7 +160,7 @@ success:
+
+ failure:
+ printk(KERN_INFO "%s:%d conflicting memory types "
+- "%Lx-%Lx %s<->%s\n", current->comm, current->pid, start,
++ "%Lx-%Lx %s<->%s\n", current->comm, task_pid_nr(current), start,
+ end, cattr_name(found_type), cattr_name(match->type));
+ return -EBUSY;
+ }
diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c
index 9f0614d..92ae64a 100644
--- a/arch/x86/mm/pf_in.c
@@ -29671,7 +29559,7 @@ index 877b9a1..a8ecf42 100644
+ pax_force_retaddr
ret
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
-index 3cbe4538..003d011 100644
+index f66b540..3e88dfb 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -12,6 +12,7 @@
@@ -29943,9 +29831,9 @@ index 3cbe4538..003d011 100644
}
oldproglen = proglen;
}
-@@ -737,7 +856,10 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
+@@ -732,7 +851,10 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
+ if (image) {
bpf_flush_icache(image, image + proglen);
-
fp->bpf_func = (void *)image;
- }
+ } else
@@ -29955,7 +29843,7 @@ index 3cbe4538..003d011 100644
out:
kfree(addrs);
return;
-@@ -745,18 +867,20 @@ out:
+@@ -740,18 +862,20 @@ out:
static void jit_free_defer(struct work_struct *arg)
{
@@ -30521,10 +30409,10 @@ index 40e4469..0592924 100644
local_irq_restore(efi_rt_eflags);
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
-index 2b20038..eaf558f 100644
+index 39a0e7f1..ecc2f1e 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
-@@ -75,6 +75,11 @@ void __init efi_call_phys_prelog(void)
+@@ -76,6 +76,11 @@ void __init efi_call_phys_prelog(void)
vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);
set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));
}
@@ -30536,7 +30424,7 @@ index 2b20038..eaf558f 100644
__flush_tlb_all();
}
-@@ -88,6 +93,11 @@ void __init efi_call_phys_epilog(void)
+@@ -89,6 +94,11 @@ void __init efi_call_phys_epilog(void)
for (pgd = 0; pgd < n_pgds; pgd++)
set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), save_pgd[pgd]);
kfree(save_pgd);
@@ -30745,7 +30633,7 @@ index 4c07cca..2c8427d 100644
ret
ENDPROC(efi_call6)
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
-index e31bcd8..f12dc46 100644
+index a0a0a43..a48e233 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -78,13 +78,15 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX];
@@ -30780,23 +30668,30 @@ index d6ee929..3637cb5 100644
.getproplen = olpc_dt_getproplen,
.getproperty = olpc_dt_getproperty,
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
-index 3c68768..07e82b8 100644
+index 1cf5b30..fd45732 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
-@@ -134,7 +134,7 @@ static void do_fpu_end(void)
+@@ -137,11 +137,8 @@ static void do_fpu_end(void)
static void fix_processor_context(void)
{
int cpu = smp_processor_id();
- struct tss_struct *t = &per_cpu(init_tss, cpu);
+-#ifdef CONFIG_X86_64
+- struct desc_struct *desc = get_cpu_gdt_table(cpu);
+- tss_desc tss;
+-#endif
+ struct tss_struct *t = init_tss + cpu;
-
++
set_tss_desc(cpu, t); /*
* This just modifies memory; should not be
-@@ -144,8 +144,6 @@ static void fix_processor_context(void)
+ * necessary. But... This is necessary, because
+@@ -150,10 +147,6 @@ static void fix_processor_context(void)
*/
#ifdef CONFIG_X86_64
-- get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9;
+- memcpy(&tss, &desc[GDT_ENTRY_TSS], sizeof(tss_desc));
+- tss.type = 0x9; /* The available 64-bit TSS (see AMD vol 2, pg 91 */
+- write_gdt_entry(desc, GDT_ENTRY_TSS, &tss, DESC_TSS);
-
syscall_init(); /* This sets MSR_*STAR and related */
#endif
@@ -30914,25 +30809,40 @@ index bb360dc..3e5945f 100644
movl %eax, %cr0
/*
+diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile
+index e812034..c747134 100644
+--- a/arch/x86/tools/Makefile
++++ b/arch/x86/tools/Makefile
+@@ -37,7 +37,7 @@ $(obj)/test_get_len.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/in
+
+ $(obj)/insn_sanity.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
+
+-HOST_EXTRACFLAGS += -I$(srctree)/tools/include
++HOST_EXTRACFLAGS += -I$(srctree)/tools/include -ggdb
+ hostprogs-y += relocs
+ relocs-objs := relocs_32.o relocs_64.o relocs_common.o
+ relocs: $(obj)/relocs
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
-index 79d67bd..c7e1b90 100644
+index f7bab68..b6d9886 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
-@@ -12,10 +12,13 @@
- #include <regex.h>
- #include <tools/le_byteshift.h>
+@@ -1,5 +1,7 @@
+ /* This is included from relocs_32/64.c */
+#include "../../../include/generated/autoconf.h"
+
- static void die(char *fmt, ...);
+ #define ElfW(type) _ElfW(ELF_BITS, type)
+ #define _ElfW(bits, type) __ElfW(bits, type)
+ #define __ElfW(bits, type) Elf##bits##_##type
+@@ -11,6 +13,7 @@
+ #define Elf_Sym ElfW(Sym)
+
+ static Elf_Ehdr ehdr;
++static Elf_Phdr *phdr;
- #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
- static Elf32_Ehdr ehdr;
-+static Elf32_Phdr *phdr;
- static unsigned long reloc_count, reloc_idx;
- static unsigned long *relocs;
- static unsigned long reloc16_count, reloc16_idx;
-@@ -330,9 +333,39 @@ static void read_ehdr(FILE *fp)
+ struct relocs {
+ uint32_t *offset;
+@@ -383,9 +386,39 @@ static void read_ehdr(FILE *fp)
}
}
@@ -30940,7 +30850,7 @@ index 79d67bd..c7e1b90 100644
+{
+ unsigned int i;
+
-+ phdr = calloc(ehdr.e_phnum, sizeof(Elf32_Phdr));
++ phdr = calloc(ehdr.e_phnum, sizeof(Elf_Phdr));
+ if (!phdr) {
+ die("Unable to allocate %d program headers\n",
+ ehdr.e_phnum);
@@ -30954,14 +30864,14 @@ index 79d67bd..c7e1b90 100644
+ strerror(errno));
+ }
+ for(i = 0; i < ehdr.e_phnum; i++) {
-+ phdr[i].p_type = elf32_to_cpu(phdr[i].p_type);
-+ phdr[i].p_offset = elf32_to_cpu(phdr[i].p_offset);
-+ phdr[i].p_vaddr = elf32_to_cpu(phdr[i].p_vaddr);
-+ phdr[i].p_paddr = elf32_to_cpu(phdr[i].p_paddr);
-+ phdr[i].p_filesz = elf32_to_cpu(phdr[i].p_filesz);
-+ phdr[i].p_memsz = elf32_to_cpu(phdr[i].p_memsz);
-+ phdr[i].p_flags = elf32_to_cpu(phdr[i].p_flags);
-+ phdr[i].p_align = elf32_to_cpu(phdr[i].p_align);
++ phdr[i].p_type = elf_word_to_cpu(phdr[i].p_type);
++ phdr[i].p_offset = elf_off_to_cpu(phdr[i].p_offset);
++ phdr[i].p_vaddr = elf_addr_to_cpu(phdr[i].p_vaddr);
++ phdr[i].p_paddr = elf_addr_to_cpu(phdr[i].p_paddr);
++ phdr[i].p_filesz = elf_word_to_cpu(phdr[i].p_filesz);
++ phdr[i].p_memsz = elf_word_to_cpu(phdr[i].p_memsz);
++ phdr[i].p_flags = elf_word_to_cpu(phdr[i].p_flags);
++ phdr[i].p_align = elf_word_to_cpu(phdr[i].p_align);
+ }
+
+}
@@ -30970,10 +30880,10 @@ index 79d67bd..c7e1b90 100644
{
- int i;
+ unsigned int i;
- Elf32_Shdr shdr;
+ Elf_Shdr shdr;
secs = calloc(ehdr.e_shnum, sizeof(struct section));
-@@ -367,7 +400,7 @@ static void read_shdrs(FILE *fp)
+@@ -420,7 +453,7 @@ static void read_shdrs(FILE *fp)
static void read_strtabs(FILE *fp)
{
@@ -30982,7 +30892,7 @@ index 79d67bd..c7e1b90 100644
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_STRTAB) {
-@@ -392,7 +425,7 @@ static void read_strtabs(FILE *fp)
+@@ -445,7 +478,7 @@ static void read_strtabs(FILE *fp)
static void read_symtabs(FILE *fp)
{
@@ -30991,7 +30901,7 @@ index 79d67bd..c7e1b90 100644
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_SYMTAB) {
-@@ -423,9 +456,11 @@ static void read_symtabs(FILE *fp)
+@@ -476,9 +509,11 @@ static void read_symtabs(FILE *fp)
}
@@ -31004,8 +30914,8 @@ index 79d67bd..c7e1b90 100644
+
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
- if (sec->shdr.sh_type != SHT_REL) {
-@@ -445,9 +480,22 @@ static void read_relocs(FILE *fp)
+ if (sec->shdr.sh_type != SHT_REL_TYPE) {
+@@ -498,9 +533,22 @@ static void read_relocs(FILE *fp)
die("Cannot read symbol table: %s\n",
strerror(errno));
}
@@ -31022,21 +30932,23 @@ index 79d67bd..c7e1b90 100644
+ }
+#endif
+
- for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Rel); j++) {
- Elf32_Rel *rel = &sec->reltab[j];
-- rel->r_offset = elf32_to_cpu(rel->r_offset);
-+ rel->r_offset = elf32_to_cpu(rel->r_offset) + base;
- rel->r_info = elf32_to_cpu(rel->r_info);
- }
- }
-@@ -456,13 +504,13 @@ static void read_relocs(FILE *fp)
+ for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {
+ Elf_Rel *rel = &sec->reltab[j];
+- rel->r_offset = elf_addr_to_cpu(rel->r_offset);
++ rel->r_offset = elf_addr_to_cpu(rel->r_offset) + base;
+ rel->r_info = elf_xword_to_cpu(rel->r_info);
+ #if (SHT_REL_TYPE == SHT_RELA)
+ rel->r_addend = elf_xword_to_cpu(rel->r_addend);
+@@ -512,7 +560,7 @@ static void read_relocs(FILE *fp)
static void print_absolute_symbols(void)
{
- int i;
+ unsigned int i;
- printf("Absolute symbols\n");
- printf(" Num: Value Size Type Bind Visibility Name\n");
+ const char *format;
+
+ if (ELF_BITS == 64)
+@@ -525,7 +573,7 @@ static void print_absolute_symbols(void)
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
char *sym_strtab;
@@ -31045,76 +30957,76 @@ index 79d67bd..c7e1b90 100644
if (sec->shdr.sh_type != SHT_SYMTAB) {
continue;
-@@ -489,14 +537,14 @@ static void print_absolute_symbols(void)
+@@ -552,7 +600,7 @@ static void print_absolute_symbols(void)
static void print_absolute_relocs(void)
{
- int i, printed = 0;
+ unsigned int i, printed = 0;
+ const char *format;
- for (i = 0; i < ehdr.e_shnum; i++) {
- struct section *sec = &secs[i];
+ if (ELF_BITS == 64)
+@@ -565,7 +613,7 @@ static void print_absolute_relocs(void)
struct section *sec_applies, *sec_symtab;
char *sym_strtab;
- Elf32_Sym *sh_symtab;
+ Elf_Sym *sh_symtab;
- int j;
+ unsigned int j;
- if (sec->shdr.sh_type != SHT_REL) {
+ if (sec->shdr.sh_type != SHT_REL_TYPE) {
continue;
}
-@@ -558,13 +606,13 @@ static void print_absolute_relocs(void)
- static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym),
- int use_real_mode)
+@@ -642,13 +690,13 @@ static void add_reloc(struct relocs *r, uint32_t offset)
+ static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
+ Elf_Sym *sym, const char *symname))
{
- int i;
+ unsigned int i;
/* Walk through the relocations */
for (i = 0; i < ehdr.e_shnum; i++) {
char *sym_strtab;
- Elf32_Sym *sh_symtab;
+ Elf_Sym *sh_symtab;
struct section *sec_applies, *sec_symtab;
- int j;
+ unsigned int j;
struct section *sec = &secs[i];
- if (sec->shdr.sh_type != SHT_REL) {
-@@ -588,6 +636,24 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym),
- sym = &sh_symtab[ELF32_R_SYM(rel->r_info)];
- r_type = ELF32_R_TYPE(rel->r_info);
-
-+ if (!use_real_mode) {
-+ /* Don't relocate actual per-cpu variables, they are absolute indices, not addresses */
-+ if (!strcmp(sec_name(sym->st_shndx), ".data..percpu") && strcmp(sym_name(sym_strtab, sym), "__per_cpu_load"))
-+ continue;
+ if (sec->shdr.sh_type != SHT_REL_TYPE) {
+@@ -812,6 +860,23 @@ static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
+ {
+ unsigned r_type = ELF32_R_TYPE(rel->r_info);
+ int shn_abs = (sym->st_shndx == SHN_ABS) && !is_reloc(S_REL, symname);
++ char *sym_strtab = sec->link->link->strtab;
+
-+#if defined(CONFIG_PAX_KERNEXEC) && defined(CONFIG_X86_32)
-+ /* Don't relocate actual code, they are relocated implicitly by the base address of KERNEL_CS */
-+ if (!strcmp(sec_name(sym->st_shndx), ".text.end") && !strcmp(sym_name(sym_strtab, sym), "_etext"))
-+ continue;
-+ if (!strcmp(sec_name(sym->st_shndx), ".init.text"))
-+ continue;
-+ if (!strcmp(sec_name(sym->st_shndx), ".exit.text"))
-+ continue;
-+ if (!strcmp(sec_name(sym->st_shndx), ".text") && strcmp(sym_name(sym_strtab, sym), "__LOAD_PHYSICAL_ADDR"))
-+ continue;
-+#endif
-+ }
++ /* Don't relocate actual per-cpu variables, they are absolute indices, not addresses */
++ if (!strcmp(sec_name(sym->st_shndx), ".data..percpu") && strcmp(sym_name(sym_strtab, sym), "__per_cpu_load"))
++ return 0;
+
- shn_abs = sym->st_shndx == SHN_ABS;
++#ifdef CONFIG_PAX_KERNEXEC
++ /* Don't relocate actual code, they are relocated implicitly by the base address of KERNEL_CS */
++ if (!strcmp(sec_name(sym->st_shndx), ".text.end") && !strcmp(sym_name(sym_strtab, sym), "_etext"))
++ return 0;
++ if (!strcmp(sec_name(sym->st_shndx), ".init.text"))
++ return 0;
++ if (!strcmp(sec_name(sym->st_shndx), ".exit.text"))
++ return 0;
++ if (!strcmp(sec_name(sym->st_shndx), ".text") && strcmp(sym_name(sym_strtab, sym), "__LOAD_PHYSICAL_ADDR"))
++ return 0;
++#endif
- switch (r_type) {
-@@ -681,7 +747,7 @@ static int write32(unsigned int v, FILE *f)
+ switch (r_type) {
+ case R_386_NONE:
+@@ -950,7 +1015,7 @@ static int write32_as_text(uint32_t v, FILE *f)
static void emit_relocs(int as_text, int use_real_mode)
{
- int i;
+ unsigned int i;
- /* Count how many relocations I have and allocate space for them. */
- reloc_count = 0;
- walk_relocs(count_reloc, use_real_mode);
-@@ -808,10 +874,11 @@ int main(int argc, char **argv)
- fname, strerror(errno));
- }
+ int (*write_reloc)(uint32_t, FILE *) = write32;
+ int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
+ const char *symname);
+@@ -1026,10 +1091,11 @@ void process(FILE *fp, int use_real_mode, int as_text,
+ {
+ regex_init(use_real_mode);
read_ehdr(fp);
+ read_phdrs(fp);
read_shdrs(fp);
@@ -31122,9 +31034,22 @@ index 79d67bd..c7e1b90 100644
read_symtabs(fp);
- read_relocs(fp);
+ read_relocs(fp, use_real_mode);
+ if (ELF_BITS == 64)
+ percpu_init();
if (show_absolute_syms) {
- print_absolute_symbols();
- goto out;
+diff --git a/arch/x86/um/tls_32.c b/arch/x86/um/tls_32.c
+index 80ffa5b..a33bd15 100644
+--- a/arch/x86/um/tls_32.c
++++ b/arch/x86/um/tls_32.c
+@@ -260,7 +260,7 @@ out:
+ if (unlikely(task == current &&
+ !t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].flushed)) {
+ printk(KERN_ERR "get_tls_entry: task with pid %d got here "
+- "without flushed TLS.", current->pid);
++ "without flushed TLS.", task_pid_nr(current));
+ }
+
+ return 0;
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index fd14be1..e3c79c0 100644
--- a/arch/x86/vdso/Makefile
@@ -31298,10 +31223,10 @@ index 431e875..cbb23f3 100644
-}
-__setup("vdso=", vdso_setup);
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
-index cf95e19..17e9f50 100644
+index a492be2..08678da 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
-@@ -100,8 +100,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
+@@ -123,8 +123,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
struct shared_info xen_dummy_shared_info;
@@ -31310,7 +31235,7 @@ index cf95e19..17e9f50 100644
RESERVE_BRK(shared_info_page_brk, PAGE_SIZE);
__read_mostly int xen_have_vector_callback;
EXPORT_SYMBOL_GPL(xen_have_vector_callback);
-@@ -511,8 +509,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
+@@ -542,8 +540,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
{
unsigned long va = dtr->address;
unsigned int size = dtr->size + 1;
@@ -31320,7 +31245,7 @@ index cf95e19..17e9f50 100644
int f;
/*
-@@ -560,8 +557,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
+@@ -591,8 +588,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
{
unsigned long va = dtr->address;
unsigned int size = dtr->size + 1;
@@ -31330,7 +31255,7 @@ index cf95e19..17e9f50 100644
int f;
/*
-@@ -569,7 +565,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
+@@ -600,7 +596,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
* 8-byte entries, or 16 4k pages..
*/
@@ -31339,7 +31264,7 @@ index cf95e19..17e9f50 100644
BUG_ON(va & ~PAGE_MASK);
for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
-@@ -954,7 +950,7 @@ static u32 xen_safe_apic_wait_icr_idle(void)
+@@ -985,7 +981,7 @@ static u32 xen_safe_apic_wait_icr_idle(void)
return 0;
}
@@ -31348,7 +31273,7 @@ index cf95e19..17e9f50 100644
{
apic->read = xen_apic_read;
apic->write = xen_apic_write;
-@@ -1260,30 +1256,30 @@ static const struct pv_apic_ops xen_apic_ops __initconst = {
+@@ -1290,30 +1286,30 @@ static const struct pv_apic_ops xen_apic_ops __initconst = {
#endif
};
@@ -31386,7 +31311,7 @@ index cf95e19..17e9f50 100644
{
if (pm_power_off)
pm_power_off();
-@@ -1385,7 +1381,17 @@ asmlinkage void __init xen_start_kernel(void)
+@@ -1464,7 +1460,17 @@ asmlinkage void __init xen_start_kernel(void)
__userpte_alloc_gfp &= ~__GFP_HIGHMEM;
/* Work out if we support NX */
@@ -31405,7 +31330,7 @@ index cf95e19..17e9f50 100644
xen_setup_features();
-@@ -1416,13 +1422,6 @@ asmlinkage void __init xen_start_kernel(void)
+@@ -1495,13 +1501,6 @@ asmlinkage void __init xen_start_kernel(void)
machine_ops = xen_machine_ops;
@@ -31419,7 +31344,7 @@ index cf95e19..17e9f50 100644
xen_smp_init();
#ifdef CONFIG_ACPI_NUMA
-@@ -1616,7 +1615,7 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,
+@@ -1700,7 +1699,7 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,
return NOTIFY_OK;
}
@@ -31429,7 +31354,7 @@ index cf95e19..17e9f50 100644
};
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
-index e006c18..b9a7d6c 100644
+index fdc3ba2..3daee39 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1894,6 +1894,9 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
@@ -31455,7 +31380,7 @@ index e006c18..b9a7d6c 100644
set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
-@@ -2110,6 +2117,7 @@ static void __init xen_post_allocator_init(void)
+@@ -2108,6 +2115,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;
@@ -31463,7 +31388,7 @@ index e006c18..b9a7d6c 100644
#endif
/* This will work as long as patching hasn't happened yet
-@@ -2188,6 +2196,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
+@@ -2186,6 +2194,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,
@@ -31472,10 +31397,10 @@ index e006c18..b9a7d6c 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 96c4e85..284fded 100644
+index d99cae8..18401e1 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
-@@ -230,11 +230,6 @@ static void __init xen_smp_prepare_boot_cpu(void)
+@@ -240,11 +240,6 @@ static void __init xen_smp_prepare_boot_cpu(void)
{
BUG_ON(smp_processor_id() != 0);
native_smp_prepare_boot_cpu();
@@ -31487,7 +31412,7 @@ index 96c4e85..284fded 100644
xen_filter_cpu_maps();
xen_setup_vcpu_info_placement();
}
-@@ -304,7 +299,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
+@@ -314,7 +309,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
ctxt->user_regs.ss = __KERNEL_DS;
#ifdef CONFIG_X86_32
ctxt->user_regs.fs = __KERNEL_PERCPU;
@@ -31496,7 +31421,7 @@ index 96c4e85..284fded 100644
#else
ctxt->gs_base_kernel = per_cpu_offset(cpu);
#endif
-@@ -314,8 +309,8 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
+@@ -324,8 +319,8 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
{
ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */
@@ -31507,7 +31432,7 @@ index 96c4e85..284fded 100644
xen_copy_trap_info(ctxt->trap_ctxt);
-@@ -360,13 +355,12 @@ static int __cpuinit xen_cpu_up(unsigned int cpu, struct task_struct *idle)
+@@ -370,13 +365,12 @@ static int __cpuinit xen_cpu_up(unsigned int cpu, struct task_struct *idle)
int rc;
per_cpu(current_task, cpu) = idle;
@@ -31523,7 +31448,7 @@ index 96c4e85..284fded 100644
#endif
xen_setup_runstate_info(cpu);
xen_setup_timer(cpu);
-@@ -642,7 +636,7 @@ static const struct smp_ops xen_smp_ops __initconst = {
+@@ -651,7 +645,7 @@ static const struct smp_ops xen_smp_ops __initconst = {
void __init xen_smp_init(void)
{
@@ -31755,7 +31680,7 @@ index 7c668c8..db3521c 100644
err = -EFAULT;
goto out;
diff --git a/block/genhd.c b/block/genhd.c
-index 3c001fb..d15a9e8 100644
+index 20625ee..10aa34d 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -467,21 +467,24 @@ static char *bdevt_str(dev_t devt, char *buf)
@@ -31796,7 +31721,7 @@ index 3c001fb..d15a9e8 100644
/* delay uevents, until we scanned partition table */
dev_set_uevent_suppress(ddev, 1);
diff --git a/block/partitions/efi.c b/block/partitions/efi.c
-index ff5804e..a88acad 100644
+index c85fc89..51e690b 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -234,14 +234,14 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state,
@@ -31813,7 +31738,7 @@ index ff5804e..a88acad 100644
le32_to_cpu(gpt->sizeof_partition_entry);
- if (!count)
- return NULL;
-- pte = kzalloc(count, GFP_KERNEL);
+- pte = kmalloc(count, GFP_KERNEL);
- if (!pte)
- return NULL;
-
@@ -31821,10 +31746,10 @@ index ff5804e..a88acad 100644
(u8 *) pte,
count) < count) {
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
-index 9a87daa..fb17486 100644
+index a5ffcc9..3cedc9c 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
-@@ -223,8 +223,20 @@ EXPORT_SYMBOL(blk_verify_command);
+@@ -224,8 +224,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)
{
@@ -31846,7 +31771,7 @@ index 9a87daa..fb17486 100644
if (blk_verify_command(rq->cmd, mode & FMODE_WRITE))
return -EPERM;
-@@ -433,6 +445,8 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
+@@ -434,6 +446,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];
@@ -31855,7 +31780,7 @@ index 9a87daa..fb17486 100644
if (!sic)
return -EINVAL;
-@@ -466,9 +480,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
+@@ -467,9 +481,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
*/
err = -EFAULT;
rq->cmd_len = cmdlen;
@@ -31948,7 +31873,7 @@ index f220d64..d359ad6 100644
struct apei_exec_context {
u32 ip;
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
-index fefc2ca..12a535d 100644
+index 33dc6a0..4b24b47 100644
--- a/drivers/acpi/apei/cper.c
+++ b/drivers/acpi/apei/cper.c
@@ -39,12 +39,12 @@
@@ -32061,10 +31986,10 @@ index 7586544..636a2f0 100644
if (err)
return err;
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
-index ee255c6..747c68b 100644
+index eb133c7..f571552 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
-@@ -986,7 +986,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
+@@ -994,7 +994,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
{
int i, count = CPUIDLE_DRIVER_STATE_START;
struct acpi_processor_cx *cx;
@@ -32074,10 +31999,10 @@ index ee255c6..747c68b 100644
if (!pr->flags.power_setup_done)
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
-index 41c0504..f8c0836 100644
+index fcae5fa..e9f71ea 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
-@@ -420,11 +420,11 @@ static u32 num_counters;
+@@ -423,11 +423,11 @@ static u32 num_counters;
static struct attribute **all_attrs;
static u32 acpi_gpe_count;
@@ -32092,7 +32017,7 @@ index 41c0504..f8c0836 100644
static void delete_gpe_attr_array(void)
{
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
-index 34c8216..f56c828 100644
+index a70ff15..f1ff44e 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1230,7 +1230,7 @@ int ahci_kick_engine(struct ata_port *ap)
@@ -32105,7 +32030,7 @@ index 34c8216..f56c828 100644
unsigned long timeout_msec)
{
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index 8038ee3..a19a6e6 100644
+index adf002a..39bb8f9 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4792,7 +4792,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
@@ -32146,20 +32071,20 @@ index 8038ee3..a19a6e6 100644
}
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
-index 405022d..fb70e53 100644
+index 7638121..357a965 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
-@@ -864,7 +864,9 @@ static int arasan_cf_probe(struct platform_device *pdev)
+@@ -865,7 +865,9 @@ static int arasan_cf_probe(struct platform_device *pdev)
/* Handle platform specific quirks */
- if (pdata->quirk) {
- if (pdata->quirk & CF_BROKEN_PIO) {
+ if (quirk) {
+ if (quirk & CF_BROKEN_PIO) {
- ap->ops->set_piomode = NULL;
+ pax_open_kernel();
+ *(void **)&ap->ops->set_piomode = NULL;
+ pax_close_kernel();
ap->pio_mask = 0;
}
- if (pdata->quirk & CF_BROKEN_MWDMA)
+ if (quirk & CF_BROKEN_MWDMA)
diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
index f9b983a..887b9d8 100644
--- a/drivers/atm/adummy.c
@@ -32413,7 +32338,7 @@ index 204814e..cede831 100644
fore200e->tx_sat++;
DPRINTK(2, "tx queue of device %s is saturated, PDU dropped - heartbeat is %08x\n",
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
-index d689126..e78e412 100644
+index 507362a..a845e57 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -1698,7 +1698,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
@@ -33170,7 +33095,7 @@ index d78b204..ecc1929 100644
fn(cont, dev, &ic->classdev);
else
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
-index 519865b..e540db3 100644
+index d414331..b4dd4ba 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -1163,7 +1163,7 @@ int subsys_interface_register(struct subsys_interface *sif)
@@ -33192,10 +33117,10 @@ index 519865b..e540db3 100644
subsys_dev_iter_init(&iter, subsys, NULL, NULL);
while ((dev = subsys_dev_iter_next(&iter)))
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
-index 01fc5b0..917801f 100644
+index 7413d06..79155fa 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
-@@ -348,7 +348,7 @@ int devtmpfs_mount(const char *mntdir)
+@@ -354,7 +354,7 @@ int devtmpfs_mount(const char *mntdir)
if (!thread)
return 0;
@@ -33204,7 +33129,7 @@ index 01fc5b0..917801f 100644
if (err)
printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
else
-@@ -373,11 +373,11 @@ static int devtmpfsd(void *p)
+@@ -380,11 +380,11 @@ static int devtmpfsd(void *p)
*err = sys_unshare(CLONE_NEWNS);
if (*err)
goto out;
@@ -33220,10 +33145,10 @@ index 01fc5b0..917801f 100644
while (1) {
spin_lock(&req_lock);
diff --git a/drivers/base/node.c b/drivers/base/node.c
-index fac124a..66bd4ab 100644
+index 7616a77c..8f57f51 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
-@@ -625,7 +625,7 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
+@@ -626,7 +626,7 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
struct node_attr {
struct device_attribute attr;
enum node_states state;
@@ -33233,7 +33158,7 @@ index fac124a..66bd4ab 100644
static ssize_t show_node_state(struct device *dev,
struct device_attribute *attr, char *buf)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index 9a6b05a..2fc8fb9 100644
+index 7072404..76dcebd 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1850,7 +1850,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
@@ -33329,10 +33254,10 @@ index e8d11b6..7b1b36f 100644
}
EXPORT_SYMBOL_GPL(unregister_syscore_ops);
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
-index dadea48..a1f3835 100644
+index 62b6c2c..4a11354 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
-@@ -1184,6 +1184,8 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
+@@ -1189,6 +1189,8 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
int err;
u32 cp;
@@ -33341,7 +33266,7 @@ index dadea48..a1f3835 100644
err = 0;
err |=
copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
-@@ -3005,7 +3007,7 @@ static void start_io(ctlr_info_t *h)
+@@ -3010,7 +3012,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 */
@@ -33350,7 +33275,7 @@ index dadea48..a1f3835 100644
dev_warn(&h->pdev->dev, "fifo full\n");
break;
}
-@@ -3015,7 +3017,7 @@ static void start_io(ctlr_info_t *h)
+@@ -3020,7 +3022,7 @@ static void start_io(ctlr_info_t *h)
h->Qdepth--;
/* Tell the controller execute command */
@@ -33359,7 +33284,7 @@ index dadea48..a1f3835 100644
/* Put job onto the completed Q */
addQ(&h->cmpQ, c);
-@@ -3441,17 +3443,17 @@ startio:
+@@ -3446,17 +3448,17 @@ startio:
static inline unsigned long get_next_completion(ctlr_info_t *h)
{
@@ -33380,7 +33305,7 @@ index dadea48..a1f3835 100644
(h->interrupts_enabled == 0));
}
-@@ -3484,7 +3486,7 @@ static inline u32 next_command(ctlr_info_t *h)
+@@ -3489,7 +3491,7 @@ static inline u32 next_command(ctlr_info_t *h)
u32 a;
if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
@@ -33389,7 +33314,7 @@ index dadea48..a1f3835 100644
if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
a = *(h->reply_pool_head); /* Next cmd in ring buffer */
-@@ -4041,7 +4043,7 @@ static void cciss_put_controller_into_performant_mode(ctlr_info_t *h)
+@@ -4046,7 +4048,7 @@ static void cciss_put_controller_into_performant_mode(ctlr_info_t *h)
trans_support & CFGTBL_Trans_use_short_tags);
/* Change the access methods to the performant access methods */
@@ -33398,7 +33323,7 @@ index dadea48..a1f3835 100644
h->transMethod = CFGTBL_Trans_Performant;
return;
-@@ -4310,7 +4312,7 @@ static int cciss_pci_init(ctlr_info_t *h)
+@@ -4319,7 +4321,7 @@ static int cciss_pci_init(ctlr_info_t *h)
if (prod_index < 0)
return -ENODEV;
h->product_name = products[prod_index].product_name;
@@ -33407,7 +33332,7 @@ index dadea48..a1f3835 100644
if (cciss_board_disabled(h)) {
dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
-@@ -5032,7 +5034,7 @@ reinit_after_soft_reset:
+@@ -5051,7 +5053,7 @@ reinit_after_soft_reset:
}
/* make sure the board interrupts are off */
@@ -33416,7 +33341,7 @@ index dadea48..a1f3835 100644
rc = cciss_request_irq(h, do_cciss_msix_intr, do_cciss_intx);
if (rc)
goto clean2;
-@@ -5082,7 +5084,7 @@ reinit_after_soft_reset:
+@@ -5101,7 +5103,7 @@ reinit_after_soft_reset:
* fake ones to scoop up any residual completions.
*/
spin_lock_irqsave(&h->lock, flags);
@@ -33425,7 +33350,7 @@ index dadea48..a1f3835 100644
spin_unlock_irqrestore(&h->lock, flags);
free_irq(h->intr[h->intr_mode], h);
rc = cciss_request_irq(h, cciss_msix_discard_completions,
-@@ -5102,9 +5104,9 @@ reinit_after_soft_reset:
+@@ -5121,9 +5123,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");
@@ -33437,7 +33362,7 @@ index dadea48..a1f3835 100644
rc = controller_reset_failed(h->cfgtable);
if (rc)
-@@ -5127,7 +5129,7 @@ reinit_after_soft_reset:
+@@ -5146,7 +5148,7 @@ reinit_after_soft_reset:
cciss_scsi_setup(h);
/* Turn the interrupts on so we can service requests */
@@ -33446,7 +33371,7 @@ index dadea48..a1f3835 100644
/* Get the firmware version */
inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
-@@ -5199,7 +5201,7 @@ static void cciss_shutdown(struct pci_dev *pdev)
+@@ -5218,7 +5220,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");
@@ -33469,7 +33394,7 @@ index 7fda30e..eb5dfe0 100644
/* queue and queue Info */
struct list_head reqQ;
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
-index 3f08713..87d4b4a 100644
+index 639d26b..fd6ad1f 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -404,7 +404,7 @@ static int cpqarray_register_ctlr(int i, struct pci_dev *pdev)
@@ -33508,7 +33433,7 @@ index 3f08713..87d4b4a 100644
hba[ctlr]->ctlr = ctlr;
hba[ctlr]->board_id = board_id;
hba[ctlr]->pci_dev = NULL; /* not PCI */
-@@ -980,7 +980,7 @@ static void start_io(ctlr_info_t *h)
+@@ -978,7 +978,7 @@ static void start_io(ctlr_info_t *h)
while((c = h->reqQ) != NULL) {
/* Can't do anything if we're busy */
@@ -33517,7 +33442,7 @@ index 3f08713..87d4b4a 100644
return;
/* Get the first entry from the request Q */
-@@ -988,7 +988,7 @@ static void start_io(ctlr_info_t *h)
+@@ -986,7 +986,7 @@ static void start_io(ctlr_info_t *h)
h->Qdepth--;
/* Tell the controller to do our bidding */
@@ -33526,7 +33451,7 @@ index 3f08713..87d4b4a 100644
/* Get onto the completion Q */
addQ(&h->cmpQ, c);
-@@ -1050,7 +1050,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
+@@ -1048,7 +1048,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
unsigned long flags;
__u32 a,a1;
@@ -33535,7 +33460,7 @@ index 3f08713..87d4b4a 100644
/* Is this interrupt for us? */
if (istat == 0)
return IRQ_NONE;
-@@ -1061,7 +1061,7 @@ static irqreturn_t do_ida_intr(int irq, void *dev_id)
+@@ -1059,7 +1059,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) {
@@ -33544,7 +33469,7 @@ index 3f08713..87d4b4a 100644
a1 = a; a &= ~3;
if ((c = h->cmpQ) == NULL)
{
-@@ -1195,6 +1195,7 @@ out_passthru:
+@@ -1193,6 +1193,7 @@ out_passthru:
ida_pci_info_struct pciinfo;
if (!arg) return -EINVAL;
@@ -33552,7 +33477,7 @@ index 3f08713..87d4b4a 100644
pciinfo.bus = host->pci_dev->bus->number;
pciinfo.dev_fn = host->pci_dev->devfn;
pciinfo.board_id = host->board_id;
-@@ -1449,11 +1450,11 @@ static int sendcmd(
+@@ -1447,11 +1448,11 @@ static int sendcmd(
/*
* Disable interrupt
*/
@@ -33566,7 +33491,7 @@ index 3f08713..87d4b4a 100644
if (temp != 0) {
break;
}
-@@ -1466,7 +1467,7 @@ DBG(
+@@ -1464,7 +1465,7 @@ DBG(
/*
* Send the cmd
*/
@@ -33575,7 +33500,7 @@ index 3f08713..87d4b4a 100644
complete = pollcomplete(ctlr);
pci_unmap_single(info_p->pci_dev, (dma_addr_t) c->req.sg[0].addr,
-@@ -1549,9 +1550,9 @@ static int revalidate_allvol(ctlr_info_t *host)
+@@ -1547,9 +1548,9 @@ static int revalidate_allvol(ctlr_info_t *host)
* we check the new geometry. Then turn interrupts back on when
* we're done.
*/
@@ -33587,7 +33512,7 @@ index 3f08713..87d4b4a 100644
for(i=0; i<NWD; i++) {
struct gendisk *disk = ida_gendisk[ctlr][i];
-@@ -1591,7 +1592,7 @@ static int pollcomplete(int ctlr)
+@@ -1589,7 +1590,7 @@ static int pollcomplete(int ctlr)
/* Wait (up to 2 seconds) for a command to complete */
for (i = 200000; i > 0; i--) {
@@ -33610,7 +33535,7 @@ 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 6b51afa..17e1191 100644
+index f943aac..99bfd19 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -582,7 +582,7 @@ struct drbd_epoch {
@@ -33622,16 +33547,16 @@ index 6b51afa..17e1191 100644
atomic_t active; /* increased on every req. added, and dec on every finished. */
unsigned long flags;
};
-@@ -1011,7 +1011,7 @@ struct drbd_conf {
+@@ -1021,7 +1021,7 @@ struct drbd_conf {
+ unsigned int al_tr_number;
int al_tr_cycle;
- int al_tr_pos; /* position of the next transaction in the journal */
wait_queue_head_t seq_wait;
- atomic_t packet_seq;
+ atomic_unchecked_t packet_seq;
unsigned int peer_seq;
spinlock_t peer_seq_lock;
unsigned int minor;
-@@ -1527,7 +1527,7 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname,
+@@ -1562,7 +1562,7 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname,
char __user *uoptval;
int err;
@@ -33641,7 +33566,7 @@ index 6b51afa..17e1191 100644
set_fs(KERNEL_DS);
if (level == SOL_SOCKET)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
-index 54d03d4..332f311 100644
+index a5dca6a..bb27967 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1317,7 +1317,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,
@@ -33674,10 +33599,10 @@ index 54d03d4..332f311 100644
idr_destroy(&tconn->volumes);
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
-index 2f5fffd..b22a1ae 100644
+index 4222aff..1f79506 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
-@@ -833,7 +833,7 @@ int drbd_connected(struct drbd_conf *mdev)
+@@ -834,7 +834,7 @@ int drbd_connected(struct drbd_conf *mdev)
{
int err;
@@ -33686,7 +33611,7 @@ index 2f5fffd..b22a1ae 100644
mdev->peer_seq = 0;
mdev->state_mutex = mdev->tconn->agreed_pro_version < 100 ?
-@@ -1191,7 +1191,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_tconn *tconn,
+@@ -1193,7 +1193,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_tconn *tconn,
do {
next_epoch = NULL;
@@ -33695,7 +33620,7 @@ index 2f5fffd..b22a1ae 100644
switch (ev & ~EV_CLEANUP) {
case EV_PUT:
-@@ -1231,7 +1231,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_tconn *tconn,
+@@ -1233,7 +1233,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_tconn *tconn,
rv = FE_DESTROYED;
} else {
epoch->flags = 0;
@@ -33704,7 +33629,7 @@ index 2f5fffd..b22a1ae 100644
/* atomic_set(&epoch->active, 0); is already zero */
if (rv == FE_STILL_LIVE)
rv = FE_RECYCLED;
-@@ -1449,7 +1449,7 @@ static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi)
+@@ -1451,7 +1451,7 @@ static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi)
conn_wait_active_ee_empty(tconn);
drbd_flush(tconn);
@@ -33713,7 +33638,7 @@ index 2f5fffd..b22a1ae 100644
epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO);
if (epoch)
break;
-@@ -1462,11 +1462,11 @@ static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi)
+@@ -1464,11 +1464,11 @@ static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi)
}
epoch->flags = 0;
@@ -33727,7 +33652,7 @@ index 2f5fffd..b22a1ae 100644
list_add(&epoch->list, &tconn->current_epoch->list);
tconn->current_epoch = epoch;
tconn->epochs++;
-@@ -2170,7 +2170,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi)
+@@ -2172,7 +2172,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi)
err = wait_for_and_update_peer_seq(mdev, peer_seq);
drbd_send_ack_dp(mdev, P_NEG_ACK, p, pi->size);
@@ -33736,7 +33661,7 @@ index 2f5fffd..b22a1ae 100644
err2 = drbd_drain_block(mdev, pi->size);
if (!err)
err = err2;
-@@ -2204,7 +2204,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi)
+@@ -2206,7 +2206,7 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi)
spin_lock(&tconn->epoch_lock);
peer_req->epoch = tconn->current_epoch;
@@ -33745,7 +33670,7 @@ index 2f5fffd..b22a1ae 100644
atomic_inc(&peer_req->epoch->active);
spin_unlock(&tconn->epoch_lock);
-@@ -4345,7 +4345,7 @@ struct data_cmd {
+@@ -4347,7 +4347,7 @@ struct data_cmd {
int expect_payload;
size_t pkt_size;
int (*fn)(struct drbd_tconn *, struct packet_info *);
@@ -33754,7 +33679,7 @@ index 2f5fffd..b22a1ae 100644
static struct data_cmd drbd_cmd_handler[] = {
[P_DATA] = { 1, sizeof(struct p_data), receive_Data },
-@@ -4465,7 +4465,7 @@ static void conn_disconnect(struct drbd_tconn *tconn)
+@@ -4467,7 +4467,7 @@ static void conn_disconnect(struct drbd_tconn *tconn)
if (!list_empty(&tconn->current_epoch->list))
conn_err(tconn, "ASSERTION FAILED: tconn->current_epoch->list not empty\n");
/* ok, no more ee's on the fly, it is safe to reset the epoch_size */
@@ -33763,7 +33688,7 @@ index 2f5fffd..b22a1ae 100644
tconn->send.seen_any_write_yet = false;
conn_info(tconn, "Connection closed\n");
-@@ -5221,7 +5221,7 @@ static int tconn_finish_peer_reqs(struct drbd_tconn *tconn)
+@@ -5223,7 +5223,7 @@ static int tconn_finish_peer_reqs(struct drbd_tconn *tconn)
struct asender_cmd {
size_t pkt_size;
int (*fn)(struct drbd_tconn *tconn, struct packet_info *);
@@ -33773,20 +33698,20 @@ index 2f5fffd..b22a1ae 100644
static struct asender_cmd asender_tbl[] = {
[P_PING] = { 0, got_Ping },
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index dfe7583..83768bb 100644
+index d92d50f..a7e9d97 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
-@@ -231,7 +231,7 @@ static int __do_lo_send_write(struct file *file,
- mm_segment_t old_fs = get_fs();
+@@ -232,7 +232,7 @@ static int __do_lo_send_write(struct file *file,
+ file_start_write(file);
set_fs(get_ds());
- bw = file->f_op->write(file, buf, len, &pos);
+ bw = file->f_op->write(file, (const char __force_user *)buf, len, &pos);
set_fs(old_fs);
+ file_end_write(file);
if (likely(bw == len))
- return 0;
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
-index 7fecc78..84d217c 100644
+index 037288e..00f80b3 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -714,7 +714,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
@@ -33799,15 +33724,15 @@ index 7fecc78..84d217c 100644
mutex_lock(&nbd->tx_lock);
return PTR_ERR(thread);
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
-index 2e7de7a..ed86dc0 100644
+index f5d0ea1..c62380a 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
-@@ -83,7 +83,7 @@
-
+@@ -84,7 +84,7 @@
#define MAX_SPEED 0xffff
--#define ZONE(sector, pd) (((sector) + (pd)->offset) & ~((pd)->settings.size - 1))
-+#define ZONE(sector, pd) (((sector) + (pd)->offset) & ~((pd)->settings.size - 1UL))
+ #define ZONE(sector, pd) (((sector) + (pd)->offset) & \
+- ~(sector_t)((pd)->settings.size - 1))
++ ~(sector_t)((pd)->settings.size - 1UL))
static DEFINE_MUTEX(pktcdvd_mutex);
static struct pktcdvd_device *pkt_devs[MAX_WRITERS];
@@ -33873,7 +33798,7 @@ index d620b44..d7538c2 100644
return 1;
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
-index d59cdcb..11afddf 100644
+index 4afcb65..a68a32d 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -491,7 +491,6 @@ static struct cdrom_device_ops gdrom_ops = {
@@ -33942,10 +33867,10 @@ index 2e04433..771f2cc 100644
kfree(segment);
return -EFAULT;
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
-index 21cb980..f15107c 100644
+index 4f94375..413694e 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
-@@ -272,6 +272,7 @@ static int gen_rtc_ioctl(struct file *file,
+@@ -273,6 +273,7 @@ static int gen_rtc_ioctl(struct file *file,
switch (cmd) {
case RTC_PLL_GET:
@@ -33980,7 +33905,7 @@ index 86fe45c..c0ea948 100644
}
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
-index 053201b0..8335cce 100644
+index 4445fa1..7c6de37 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -420,7 +420,7 @@ struct ipmi_smi {
@@ -34004,7 +33929,7 @@ index 053201b0..8335cce 100644
static int is_lan_addr(struct ipmi_addr *addr)
{
-@@ -2884,7 +2884,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
+@@ -2883,7 +2883,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
INIT_LIST_HEAD(&intf->cmd_rcvrs);
init_waitqueue_head(&intf->waitq);
for (i = 0; i < IPMI_NUM_STATS; i++)
@@ -34014,7 +33939,7 @@ index 053201b0..8335cce 100644
intf->proc_dir = NULL;
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
-index 0ac9b45..6179fb5 100644
+index af4b23f..79806fc 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -275,7 +275,7 @@ struct smi_info {
@@ -34038,7 +33963,7 @@ index 0ac9b45..6179fb5 100644
#define SI_MAX_PARMS 4
-@@ -3254,7 +3254,7 @@ static int try_smi_init(struct smi_info *new_smi)
+@@ -3258,7 +3258,7 @@ static int try_smi_init(struct smi_info *new_smi)
atomic_set(&new_smi->req_events, 0);
new_smi->run_to_completion = 0;
for (i = 0; i < SI_NUM_STATS; i++)
@@ -34048,7 +33973,7 @@ index 0ac9b45..6179fb5 100644
new_smi->interrupt_disabled = 1;
atomic_set(&new_smi->stop_operation, 0);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
-index 2c644af..4b7aede 100644
+index 1ccbe94..6ad651a 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -18,6 +18,7 @@
@@ -34059,7 +33984,7 @@ index 2c644af..4b7aede 100644
#include <linux/ptrace.h>
#include <linux/device.h>
#include <linux/highmem.h>
-@@ -37,6 +38,10 @@
+@@ -38,6 +39,10 @@
#define DEVPORT_MINOR 4
@@ -34070,7 +33995,7 @@ index 2c644af..4b7aede 100644
static inline unsigned long size_inside_page(unsigned long start,
unsigned long size)
{
-@@ -68,9 +73,13 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
+@@ -69,9 +74,13 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
while (cursor < to) {
if (!devmem_is_allowed(pfn)) {
@@ -34084,7 +34009,7 @@ index 2c644af..4b7aede 100644
return 0;
}
cursor += PAGE_SIZE;
-@@ -78,6 +87,11 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
+@@ -79,6 +88,11 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
}
return 1;
}
@@ -34096,7 +34021,7 @@ index 2c644af..4b7aede 100644
#else
static inline int range_is_allowed(unsigned long pfn, unsigned long size)
{
-@@ -120,6 +134,7 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+@@ -121,6 +135,7 @@ static ssize_t read_mem(struct file *file, char __user *buf,
while (count > 0) {
unsigned long remaining;
@@ -34104,7 +34029,7 @@ index 2c644af..4b7aede 100644
sz = size_inside_page(p, count);
-@@ -135,7 +150,23 @@ static ssize_t read_mem(struct file *file, char __user *buf,
+@@ -136,7 +151,23 @@ static ssize_t read_mem(struct file *file, char __user *buf,
if (!ptr)
return -EFAULT;
@@ -34129,7 +34054,7 @@ index 2c644af..4b7aede 100644
unxlate_dev_mem_ptr(p, ptr);
if (remaining)
return -EFAULT;
-@@ -378,7 +409,7 @@ static ssize_t read_oldmem(struct file *file, char __user *buf,
+@@ -379,7 +410,7 @@ static ssize_t read_oldmem(struct file *file, char __user *buf,
else
csize = count;
@@ -34138,7 +34063,7 @@ index 2c644af..4b7aede 100644
if (rc < 0)
return rc;
buf += csize;
-@@ -398,9 +429,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -399,9 +430,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
unsigned long p = *ppos;
@@ -34149,7 +34074,7 @@ index 2c644af..4b7aede 100644
read = 0;
if (p < (unsigned long) high_memory) {
-@@ -422,6 +452,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -423,6 +453,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
}
#endif
while (low_count > 0) {
@@ -34158,7 +34083,7 @@ index 2c644af..4b7aede 100644
sz = size_inside_page(p, low_count);
/*
-@@ -431,7 +463,22 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
+@@ -432,7 +464,22 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
*/
kbuf = xlate_dev_kmem_ptr((char *)p);
@@ -34182,7 +34107,7 @@ index 2c644af..4b7aede 100644
return -EFAULT;
buf += sz;
p += sz;
-@@ -833,6 +880,9 @@ static const struct memdev {
+@@ -869,6 +916,9 @@ static const struct memdev {
#ifdef CONFIG_CRASH_DUMP
[12] = { "oldmem", 0, &oldmem_fops, NULL },
#endif
@@ -34192,7 +34117,7 @@ index 2c644af..4b7aede 100644
};
static int memory_open(struct inode *inode, struct file *filp)
-@@ -904,7 +954,7 @@ static int __init chr_dev_init(void)
+@@ -940,7 +990,7 @@ static int __init chr_dev_init(void)
continue;
device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor),
@@ -34302,7 +34227,7 @@ index 5c5cc00..ac9edb7 100644
if (cmd != SIOCWANDEV)
diff --git a/drivers/char/random.c b/drivers/char/random.c
-index eccd7cc..98038d5 100644
+index 35487e8..dac8bd1 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -272,8 +272,13 @@
@@ -34468,7 +34393,7 @@ index 84ddc55..1d32f1e 100644
return 0;
}
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
-index ce5f3fc..e2d3e55 100644
+index 1b456fe..2510242 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -679,7 +679,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
@@ -34489,11 +34414,24 @@ index ce5f3fc..e2d3e55 100644
}
static int wait_port_writable(struct port *port, bool nonblock)
+diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
+index a33f46f..a720eed 100644
+--- a/drivers/clk/clk-composite.c
++++ b/drivers/clk/clk-composite.c
+@@ -122,7 +122,7 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
+ struct clk *clk;
+ struct clk_init_data init;
+ struct clk_composite *composite;
+- struct clk_ops *clk_composite_ops;
++ clk_ops_no_const *clk_composite_ops;
+
+ composite = kzalloc(sizeof(*composite), GFP_KERNEL);
+ if (!composite) {
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
-index d7ad425..3e3f81f 100644
+index a2b2541..bc1e7ff 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
-@@ -262,7 +262,7 @@ static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self,
+@@ -264,7 +264,7 @@ static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self,
return NOTIFY_OK;
}
@@ -34516,7 +34454,7 @@ index ade7513..069445f 100644
};
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
-index bb5939b..d9accb7 100644
+index edc089e..bc7c0bc 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -172,7 +172,7 @@ static ssize_t show_global_boost(struct kobject *kobj,
@@ -34528,7 +34466,7 @@ index bb5939b..d9accb7 100644
show_global_boost,
store_global_boost);
-@@ -712,8 +712,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
+@@ -705,8 +705,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
data->acpi_data = per_cpu_ptr(acpi_perf_data, cpu);
per_cpu(acfreq_data, cpu) = data;
@@ -34542,7 +34480,7 @@ index bb5939b..d9accb7 100644
result = acpi_processor_register_performance(data->acpi_data, cpu);
if (result)
-@@ -839,7 +842,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
+@@ -832,7 +835,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
break;
case ACPI_ADR_SPACE_FIXED_HARDWARE:
@@ -34553,7 +34491,7 @@ index bb5939b..d9accb7 100644
policy->cur = get_cur_freq_on_cpu(cpu);
break;
default:
-@@ -850,8 +855,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
+@@ -843,8 +848,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
acpi_processor_notify_smm(THIS_MODULE);
/* Check for APERF/MPERF support in hardware */
@@ -34568,10 +34506,10 @@ index bb5939b..d9accb7 100644
pr_debug("CPU%u - ACPI performance management activated.\n", cpu);
for (i = 0; i < perf->state_count; i++)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
-index b02824d..51e44aa 100644
+index 2d53f47..eb3803e 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
-@@ -1813,7 +1813,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
+@@ -1851,7 +1851,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}
@@ -34580,7 +34518,7 @@ index b02824d..51e44aa 100644
.notifier_call = cpufreq_cpu_callback,
};
-@@ -1845,8 +1845,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
+@@ -1883,8 +1883,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
pr_debug("trying to register driver %s\n", driver_data->name);
@@ -34592,41 +34530,82 @@ index b02824d..51e44aa 100644
+ pax_close_kernel();
+ }
- spin_lock_irqsave(&cpufreq_driver_lock, flags);
+ write_lock_irqsave(&cpufreq_driver_lock, flags);
if (cpufreq_driver) {
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
-index 5a76086..0f4d394 100644
+index dc9b72e..11c0302 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
-@@ -201,8 +201,8 @@ int cpufreq_governor_dbs(struct dbs_data *dbs_data,
- {
+@@ -238,7 +238,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy,
+ struct dbs_data *dbs_data;
struct od_cpu_dbs_info_s *od_dbs_info = NULL;
struct cs_cpu_dbs_info_s *cs_dbs_info = NULL;
-- struct cs_ops *cs_ops = NULL;
- struct od_ops *od_ops = NULL;
-+ const struct cs_ops *cs_ops = NULL;
+ const struct od_ops *od_ops = NULL;
- struct od_dbs_tuners *od_tuners = dbs_data->tuners;
- struct cs_dbs_tuners *cs_tuners = dbs_data->tuners;
+ struct od_dbs_tuners *od_tuners = NULL;
+ struct cs_dbs_tuners *cs_tuners = NULL;
struct cpu_dbs_common_info *cpu_cdbs;
+@@ -301,7 +301,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy,
+
+ if ((cdata->governor == GOV_CONSERVATIVE) &&
+ (!policy->governor->initialized)) {
+- struct cs_ops *cs_ops = dbs_data->cdata->gov_ops;
++ const struct cs_ops *cs_ops = dbs_data->cdata->gov_ops;
+
+ cpufreq_register_notifier(cs_ops->notifier_block,
+ CPUFREQ_TRANSITION_NOTIFIER);
+@@ -318,7 +318,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy,
+
+ if ((dbs_data->cdata->governor == GOV_CONSERVATIVE) &&
+ (policy->governor->initialized == 1)) {
+- struct cs_ops *cs_ops = dbs_data->cdata->gov_ops;
++ const struct cs_ops *cs_ops = dbs_data->cdata->gov_ops;
+
+ cpufreq_unregister_notifier(cs_ops->notifier_block,
+ CPUFREQ_TRANSITION_NOTIFIER);
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
-index cc4bd2f..ad142bc 100644
+index e16a961..0e68927 100644
--- a/drivers/cpufreq/cpufreq_governor.h
+++ b/drivers/cpufreq/cpufreq_governor.h
-@@ -142,7 +142,7 @@ struct dbs_data {
- void (*gov_check_cpu)(int cpu, unsigned int load);
+@@ -204,7 +204,7 @@ struct common_dbs_data {
+ void (*exit)(struct dbs_data *dbs_data);
/* Governor specific ops, see below */
- void *gov_ops;
+ const void *gov_ops;
};
- /* Governor specific ops, will be passed to dbs_data->gov_ops */
+ /* Governer Per policy data */
+diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
+index 93eb5cb..f8ab572 100644
+--- a/drivers/cpufreq/cpufreq_ondemand.c
++++ b/drivers/cpufreq/cpufreq_ondemand.c
+@@ -615,14 +615,18 @@ void od_register_powersave_bias_handler(unsigned int (*f)
+ (struct cpufreq_policy *, unsigned int, unsigned int),
+ unsigned int powersave_bias)
+ {
+- od_ops.powersave_bias_target = f;
++ pax_open_kernel();
++ *(void **)&od_ops.powersave_bias_target = f;
++ pax_close_kernel();
+ od_set_powersave_bias(powersave_bias);
+ }
+ EXPORT_SYMBOL_GPL(od_register_powersave_bias_handler);
+
+ void od_unregister_powersave_bias_handler(void)
+ {
+- od_ops.powersave_bias_target = generic_powersave_bias_target;
++ pax_open_kernel();
++ *(void **)&od_ops.powersave_bias_target = generic_powersave_bias_target;
++ pax_close_kernel();
+ od_set_powersave_bias(0);
+ }
+ EXPORT_SYMBOL_GPL(od_unregister_powersave_bias_handler);
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
-index bfd6273..e39dd63 100644
+index fb65dec..b88254d 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
-@@ -365,7 +365,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
+@@ -366,7 +366,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
}
/* priority=1 so this will get called before cpufreq_remove_dev */
@@ -34636,10 +34615,10 @@ index bfd6273..e39dd63 100644
.priority = 1,
};
diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c
-index 827629c9..0bc6a03 100644
+index 421ef37..e708530c 100644
--- a/drivers/cpufreq/p4-clockmod.c
+++ b/drivers/cpufreq/p4-clockmod.c
-@@ -167,10 +167,14 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
+@@ -160,10 +160,14 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
case 0x0F: /* Core Duo */
case 0x16: /* Celeron Core */
case 0x1C: /* Atom */
@@ -34656,7 +34635,7 @@ index 827629c9..0bc6a03 100644
/* fall through */
case 0x09: /* Pentium M (Banias) */
return speedstep_get_frequency(SPEEDSTEP_CPU_PM);
-@@ -182,7 +186,9 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
+@@ -175,7 +179,9 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
/* on P-4s, the TSC runs with constant frequency independent whether
* throttling is active or not. */
@@ -34667,8 +34646,117 @@ index 827629c9..0bc6a03 100644
if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4M) {
printk(KERN_WARNING PFX "Warning: Pentium 4-M detected. "
+diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c
+index c71ee14..7c2e183 100644
+--- a/drivers/cpufreq/sparc-us3-cpufreq.c
++++ b/drivers/cpufreq/sparc-us3-cpufreq.c
+@@ -18,14 +18,12 @@
+ #include <asm/head.h>
+ #include <asm/timer.h>
+
+-static struct cpufreq_driver *cpufreq_us3_driver;
+-
+ struct us3_freq_percpu_info {
+ struct cpufreq_frequency_table table[4];
+ };
+
+ /* Indexed by cpu number. */
+-static struct us3_freq_percpu_info *us3_freq_table;
++static struct us3_freq_percpu_info us3_freq_table[NR_CPUS];
+
+ /* UltraSPARC-III has three dividers: 1, 2, and 32. These are controlled
+ * in the Safari config register.
+@@ -186,12 +184,25 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
+
+ static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
+ {
+- if (cpufreq_us3_driver)
+- us3_set_cpu_divider_index(policy, 0);
++ us3_set_cpu_divider_index(policy->cpu, 0);
+
+ return 0;
+ }
+
++static int __init us3_freq_init(void);
++static void __exit us3_freq_exit(void);
++
++static struct cpufreq_driver cpufreq_us3_driver = {
++ .init = us3_freq_cpu_init,
++ .verify = us3_freq_verify,
++ .target = us3_freq_target,
++ .get = us3_freq_get,
++ .exit = us3_freq_cpu_exit,
++ .owner = THIS_MODULE,
++ .name = "UltraSPARC-III",
++
++};
++
+ static int __init us3_freq_init(void)
+ {
+ unsigned long manuf, impl, ver;
+@@ -208,57 +219,15 @@ static int __init us3_freq_init(void)
+ (impl == CHEETAH_IMPL ||
+ impl == CHEETAH_PLUS_IMPL ||
+ impl == JAGUAR_IMPL ||
+- impl == PANTHER_IMPL)) {
+- struct cpufreq_driver *driver;
+-
+- ret = -ENOMEM;
+- driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL);
+- if (!driver)
+- goto err_out;
+-
+- us3_freq_table = kzalloc(
+- (NR_CPUS * sizeof(struct us3_freq_percpu_info)),
+- GFP_KERNEL);
+- if (!us3_freq_table)
+- goto err_out;
+-
+- driver->init = us3_freq_cpu_init;
+- driver->verify = us3_freq_verify;
+- driver->target = us3_freq_target;
+- driver->get = us3_freq_get;
+- driver->exit = us3_freq_cpu_exit;
+- driver->owner = THIS_MODULE,
+- strcpy(driver->name, "UltraSPARC-III");
+-
+- cpufreq_us3_driver = driver;
+- ret = cpufreq_register_driver(driver);
+- if (ret)
+- goto err_out;
+-
+- return 0;
+-
+-err_out:
+- if (driver) {
+- kfree(driver);
+- cpufreq_us3_driver = NULL;
+- }
+- kfree(us3_freq_table);
+- us3_freq_table = NULL;
+- return ret;
+- }
++ impl == PANTHER_IMPL))
++ return cpufreq_register_driver(&cpufreq_us3_driver);
+
+ return -ENODEV;
+ }
+
+ static void __exit us3_freq_exit(void)
+ {
+- if (cpufreq_us3_driver) {
+- cpufreq_unregister_driver(cpufreq_us3_driver);
+- kfree(cpufreq_us3_driver);
+- cpufreq_us3_driver = NULL;
+- kfree(us3_freq_table);
+- us3_freq_table = NULL;
+- }
++ cpufreq_unregister_driver(&cpufreq_us3_driver);
+ }
+
+ MODULE_AUTHOR("David S. Miller <davem@redhat.com>");
diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c
-index 3a953d5..f5993f6 100644
+index 618e6f4..e89d915 100644
--- a/drivers/cpufreq/speedstep-centrino.c
+++ b/drivers/cpufreq/speedstep-centrino.c
@@ -353,8 +353,11 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
@@ -34686,10 +34774,10 @@ index 3a953d5..f5993f6 100644
if (policy->cpu != 0)
return -ENODEV;
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
-index eba6929..0f53baf 100644
+index c3a93fe..e808f24 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
-@@ -277,7 +277,7 @@ static int poll_idle(struct cpuidle_device *dev,
+@@ -254,7 +254,7 @@ static int poll_idle(struct cpuidle_device *dev,
static void poll_idle_init(struct cpuidle_driver *drv)
{
@@ -34778,10 +34866,10 @@ index b70709b..1d8d02a 100644
/* Run before NMI debug handler and KGDB */
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
-index 769d92e..a3dcc1e 100644
+index 67610a6..30f8a11 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
-@@ -148,7 +148,7 @@ static const char *edac_caps[] = {
+@@ -148,7 +148,7 @@ static const char * const edac_caps[] = {
struct dev_ch_attribute {
struct device_attribute attr;
int channel;
@@ -34933,22 +35021,8 @@ index 57ea7f4..789e3c3 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 27ac423..13573e8 100644
---- a/drivers/firewire/core-cdev.c
-+++ b/drivers/firewire/core-cdev.c
-@@ -1366,8 +1366,7 @@ static int init_iso_resource(struct client *client,
- int ret;
-
- if ((request->channels == 0 && request->bandwidth == 0) ||
-- request->bandwidth > BANDWIDTH_AVAILABLE_INITIAL ||
-- request->bandwidth < 0)
-+ request->bandwidth > BANDWIDTH_AVAILABLE_INITIAL)
- return -EINVAL;
-
- r = kmalloc(sizeof(*r), GFP_KERNEL);
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
-index 03ce7d9..b70f5da 100644
+index 664a6ff..af13580 100644
--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
@@ -232,7 +232,7 @@ EXPORT_SYMBOL(fw_device_enable_phys_dma);
@@ -34998,10 +35072,10 @@ index 94a58a0..f5eba42 100644
container_of(_dev_attr, struct dmi_device_attribute, dev_attr)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
-index 4cd392d..4b629e1 100644
+index b95159b..841ae55 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
-@@ -490,11 +490,6 @@ void __init dmi_scan_machine(void)
+@@ -497,11 +497,6 @@ void __init dmi_scan_machine(void)
}
}
else {
@@ -35013,7 +35087,7 @@ index 4cd392d..4b629e1 100644
p = dmi_ioremap(0xF0000, 0x10000);
if (p == NULL)
goto error;
-@@ -769,7 +764,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *),
+@@ -786,7 +781,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *),
if (buf == NULL)
return -1;
@@ -35022,22 +35096,39 @@ index 4cd392d..4b629e1 100644
iounmap(buf);
return 0;
-diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
-index f4baa11..7970c3a 100644
---- a/drivers/firmware/efivars.c
-+++ b/drivers/firmware/efivars.c
-@@ -139,7 +139,7 @@ struct efivar_attribute {
+diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
+index 5145fa3..0d3babd 100644
+--- a/drivers/firmware/efi/efi.c
++++ b/drivers/firmware/efi/efi.c
+@@ -65,14 +65,16 @@ static struct attribute_group efi_subsys_attr_group = {
};
- static struct efivars __efivars;
--static struct efivar_operations ops;
-+static efivar_operations_no_const ops __read_only;
+ static struct efivars generic_efivars;
+-static struct efivar_operations generic_ops;
++static efivar_operations_no_const generic_ops __read_only;
+
+ static int generic_ops_register(void)
+ {
+- generic_ops.get_variable = efi.get_variable;
+- generic_ops.set_variable = efi.set_variable;
+- generic_ops.get_next_variable = efi.get_next_variable;
+- generic_ops.query_variable_store = efi_query_variable_store;
++ pax_open_kernel();
++ *(void **)&generic_ops.get_variable = efi.get_variable;
++ *(void **)&generic_ops.set_variable = efi.set_variable;
++ *(void **)&generic_ops.get_next_variable = efi.get_next_variable;
++ *(void **)&generic_ops.query_variable_store = efi_query_variable_store;
++ pax_close_kernel();
- #define PSTORE_EFI_ATTRIBUTES \
- (EFI_VARIABLE_NON_VOLATILE | \
-@@ -1844,7 +1844,7 @@ efivar_create_sysfs_entry(struct efivars *efivars,
+ return efivars_register(&generic_efivars, &generic_ops, efi_kobj);
+ }
+diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
+index 8bd1bb6..c48b0c6 100644
+--- a/drivers/firmware/efi/efivars.c
++++ b/drivers/firmware/efi/efivars.c
+@@ -452,7 +452,7 @@ efivar_create_sysfs_entry(struct efivar_entry *new_var)
static int
- create_efivars_bin_attributes(struct efivars *efivars)
+ create_efivars_bin_attributes(void)
{
- struct bin_attribute *attr;
+ bin_attribute_no_const *attr;
@@ -35060,7 +35151,7 @@ index 2a90ba6..07f3733 100644
ret = sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr);
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
-index de3c317..b7cd029 100644
+index e16d932..f0206ef 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -69,7 +69,7 @@ struct ichx_desc {
@@ -35086,10 +35177,10 @@ index 9902732..64b62dd 100644
return -EINVAL;
}
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
-index 7b2d378..cc947ea 100644
+index ed1334e..ee0dd42 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
-@@ -319,7 +319,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
+@@ -321,7 +321,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
struct drm_crtc *tmp;
int crtc_mask = 1;
@@ -35099,7 +35190,7 @@ index 7b2d378..cc947ea 100644
dev = crtc->dev;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
-index 25f91cd..a376f55 100644
+index 9cc247f..36aa285 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -306,7 +306,7 @@ module_exit(drm_core_exit);
@@ -35114,7 +35205,7 @@ index 25f91cd..a376f55 100644
@@ -376,7 +376,7 @@ long drm_ioctl(struct file *filp,
struct drm_file *file_priv = filp->private_data;
struct drm_device *dev;
- struct drm_ioctl_desc *ioctl;
+ const struct drm_ioctl_desc *ioctl = NULL;
- drm_ioctl_t *func;
+ drm_ioctl_no_const_t func;
unsigned int nr = DRM_IOCTL_NR(cmd);
@@ -35128,29 +35219,7 @@ index 25f91cd..a376f55 100644
+ atomic_inc_unchecked(&dev->counts[_DRM_STAT_IOCTLS]);
++file_priv->ioctl_count;
- DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
-diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c
-index 48c52f7..0cfb60f 100644
---- a/drivers/gpu/drm/drm_encoder_slave.c
-+++ b/drivers/gpu/drm/drm_encoder_slave.c
-@@ -54,16 +54,12 @@ int drm_i2c_encoder_init(struct drm_device *dev,
- struct i2c_adapter *adap,
- const struct i2c_board_info *info)
- {
-- char modalias[sizeof(I2C_MODULE_PREFIX)
-- + I2C_NAME_SIZE];
- struct module *module = NULL;
- struct i2c_client *client;
- struct drm_i2c_encoder_driver *encoder_drv;
- int err = 0;
-
-- snprintf(modalias, sizeof(modalias),
-- "%s%s", I2C_MODULE_PREFIX, info->type);
-- request_module(modalias);
-+ request_module("%s%s", I2C_MODULE_PREFIX, info->type);
-
- client = i2c_new_device(adap, info);
- if (!client) {
+ if ((nr >= DRM_CORE_IOCTL_COUNT) &&
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 429e07d..e681a2c 100644
--- a/drivers/gpu/drm/drm_fops.c
@@ -35417,7 +35486,7 @@ index d752c96..fe08455 100644
if (drm_lock_free(&master->lock, lock->context)) {
/* FIXME: Should really bail out here. */
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
-index 7d30802..42c6cbb 100644
+index 16f3ec5..b28f9ca 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -501,7 +501,7 @@ void drm_unplug_dev(struct drm_device *dev)
@@ -35484,7 +35553,7 @@ index 6e0acad..93c8289 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 7299ea4..5314487 100644
+index e913d32..4d9b351 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -499,7 +499,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data)
@@ -35497,7 +35566,7 @@ index 7299ea4..5314487 100644
if (IS_GEN6(dev) || IS_GEN7(dev)) {
seq_printf(m,
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
-index 4fa6beb..f930fec 100644
+index 3b315ba..aac280f 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1259,7 +1259,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
@@ -35510,10 +35579,10 @@ index 4fa6beb..f930fec 100644
return can_switch;
}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
-index ef99b1c..09ce7fb 100644
+index 9669a0b..bb65176 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -893,7 +893,7 @@ typedef struct drm_i915_private {
+@@ -915,7 +915,7 @@ typedef struct drm_i915_private {
drm_dma_handle_t *status_page_dmah;
struct resource mch_res;
@@ -35522,7 +35591,7 @@ index ef99b1c..09ce7fb 100644
/* protects the irq masks */
spinlock_t irq_lock;
-@@ -1775,7 +1775,7 @@ extern struct i2c_adapter *intel_gmbus_get_adapter(
+@@ -1811,7 +1811,7 @@ extern struct i2c_adapter *intel_gmbus_get_adapter(
struct drm_i915_private *dev_priv, unsigned port);
extern void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed);
extern void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit);
@@ -35532,10 +35601,10 @@ index ef99b1c..09ce7fb 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 9a48e1a..f0cbc3e 100644
+index 117ce38..eefd237 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
-@@ -729,9 +729,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec)
+@@ -727,9 +727,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec)
static int
validate_exec_list(struct drm_i915_gem_exec_object2 *exec,
@@ -35547,15 +35616,6 @@ index 9a48e1a..f0cbc3e 100644
int relocs_total = 0;
int relocs_max = INT_MAX / sizeof(struct drm_i915_gem_relocation_entry);
-@@ -1195,7 +1195,7 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
- return -ENOMEM;
- }
- ret = copy_from_user(exec2_list,
-- (struct drm_i915_relocation_entry __user *)
-+ (struct drm_i915_gem_exec_object2 __user *)
- (uintptr_t) args->buffers_ptr,
- sizeof(*exec2_list) * args->buffer_count);
- if (ret != 0) {
diff --git a/drivers/gpu/drm/i915/i915_ioc32.c b/drivers/gpu/drm/i915/i915_ioc32.c
index 3c59584..500f2e9 100644
--- a/drivers/gpu/drm/i915/i915_ioc32.c
@@ -35592,10 +35652,10 @@ index 3c59584..500f2e9 100644
return ret;
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
-index 3c7bb04..182e049 100644
+index 0aa2ef0..77c03d0 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
-@@ -549,7 +549,7 @@ static irqreturn_t valleyview_irq_handler(int irq, void *arg)
+@@ -679,7 +679,7 @@ static irqreturn_t valleyview_irq_handler(int irq, void *arg)
int pipe;
u32 pipe_stats[I915_MAX_PIPES];
@@ -35604,7 +35664,7 @@ index 3c7bb04..182e049 100644
while (true) {
iir = I915_READ(VLV_IIR);
-@@ -705,7 +705,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg)
+@@ -844,7 +844,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg)
irqreturn_t ret = IRQ_NONE;
int i;
@@ -35613,7 +35673,7 @@ index 3c7bb04..182e049 100644
/* disable master interrupt before clearing iir */
de_ier = I915_READ(DEIER);
-@@ -791,7 +791,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
+@@ -934,7 +934,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
int ret = IRQ_NONE;
u32 de_iir, gt_iir, de_ier, pm_iir, sde_ier;
@@ -35622,7 +35682,7 @@ index 3c7bb04..182e049 100644
/* disable master interrupt before clearing iir */
de_ier = I915_READ(DEIER);
-@@ -1886,7 +1886,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev)
+@@ -2098,7 +2098,7 @@ static void ironlake_irq_preinstall(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -35631,7 +35691,7 @@ index 3c7bb04..182e049 100644
I915_WRITE(HWSTAM, 0xeffe);
-@@ -1912,7 +1912,7 @@ static void valleyview_irq_preinstall(struct drm_device *dev)
+@@ -2133,7 +2133,7 @@ static void valleyview_irq_preinstall(struct drm_device *dev)
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -35640,7 +35700,7 @@ index 3c7bb04..182e049 100644
/* VLV magic */
I915_WRITE(VLV_IMR, 0);
-@@ -2208,7 +2208,7 @@ static void i8xx_irq_preinstall(struct drm_device * dev)
+@@ -2420,7 +2420,7 @@ static void i8xx_irq_preinstall(struct drm_device * dev)
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -35649,7 +35709,7 @@ index 3c7bb04..182e049 100644
for_each_pipe(pipe)
I915_WRITE(PIPESTAT(pipe), 0);
-@@ -2259,7 +2259,7 @@ static irqreturn_t i8xx_irq_handler(int irq, void *arg)
+@@ -2499,7 +2499,7 @@ static irqreturn_t i8xx_irq_handler(int irq, void *arg)
I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT |
I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT;
@@ -35658,7 +35718,7 @@ index 3c7bb04..182e049 100644
iir = I915_READ16(IIR);
if (iir == 0)
-@@ -2344,7 +2344,7 @@ static void i915_irq_preinstall(struct drm_device * dev)
+@@ -2574,7 +2574,7 @@ static void i915_irq_preinstall(struct drm_device * dev)
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -35667,8 +35727,8 @@ index 3c7bb04..182e049 100644
if (I915_HAS_HOTPLUG(dev)) {
I915_WRITE(PORT_HOTPLUG_EN, 0);
-@@ -2448,7 +2448,7 @@ static irqreturn_t i915_irq_handler(int irq, void *arg)
- };
+@@ -2673,7 +2673,7 @@ static irqreturn_t i915_irq_handler(int irq, void *arg)
+ I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT;
int pipe, ret = IRQ_NONE;
- atomic_inc(&dev_priv->irq_received);
@@ -35676,7 +35736,7 @@ index 3c7bb04..182e049 100644
iir = I915_READ(IIR);
do {
-@@ -2574,7 +2574,7 @@ static void i965_irq_preinstall(struct drm_device * dev)
+@@ -2800,7 +2800,7 @@ static void i965_irq_preinstall(struct drm_device * dev)
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe;
@@ -35685,9 +35745,9 @@ index 3c7bb04..182e049 100644
I915_WRITE(PORT_HOTPLUG_EN, 0);
I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT));
-@@ -2690,7 +2690,7 @@ static irqreturn_t i965_irq_handler(int irq, void *arg)
- int irq_received;
- int ret = IRQ_NONE, pipe;
+@@ -2907,7 +2907,7 @@ static irqreturn_t i965_irq_handler(int irq, void *arg)
+ I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT |
+ I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT;
- atomic_inc(&dev_priv->irq_received);
+ atomic_inc_unchecked(&dev_priv->irq_received);
@@ -35695,10 +35755,10 @@ index 3c7bb04..182e049 100644
iir = I915_READ(IIR);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index 2ab65b4..acbd821 100644
+index 56746dc..b5a214f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -8742,13 +8742,13 @@ struct intel_quirk {
+@@ -8919,13 +8919,13 @@ struct intel_quirk {
int subsystem_vendor;
int subsystem_device;
void (*hook)(struct drm_device *dev);
@@ -35714,7 +35774,7 @@ index 2ab65b4..acbd821 100644
static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
{
-@@ -8756,18 +8756,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
+@@ -8933,18 +8933,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
return 1;
}
@@ -35837,7 +35897,7 @@ index 598c281..60d590e 100644
*sequence = cur_fence;
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
-index 50a6dd0..ea66ed8 100644
+index 6aa2137..fe8dc55 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -965,7 +965,7 @@ static int parse_bit_tmds_tbl_entry(struct drm_device *dev, struct nvbios *bios,
@@ -35850,10 +35910,10 @@ index 50a6dd0..ea66ed8 100644
#define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry })
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h
-index 9c39baf..30a22be 100644
+index f2b30f8..d0f9a95 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.h
-@@ -81,7 +81,7 @@ struct nouveau_drm {
+@@ -92,7 +92,7 @@ struct nouveau_drm {
struct drm_global_reference mem_global_ref;
struct ttm_bo_global_ref bo_global_ref;
struct ttm_bo_device bdev;
@@ -35910,6 +35970,71 @@ index 25d3495..d81aaf6 100644
spin_unlock(&dev->count_lock);
return can_switch;
}
+diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
+index 489cb8c..0b8d0d3 100644
+--- a/drivers/gpu/drm/qxl/qxl_ttm.c
++++ b/drivers/gpu/drm/qxl/qxl_ttm.c
+@@ -103,7 +103,7 @@ static void qxl_ttm_global_fini(struct qxl_device *qdev)
+ }
+ }
+
+-static struct vm_operations_struct qxl_ttm_vm_ops;
++static vm_operations_struct_no_const qxl_ttm_vm_ops __read_only;
+ static const struct vm_operations_struct *ttm_vm_ops;
+
+ static int qxl_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+@@ -147,8 +147,10 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
+ return r;
+ if (unlikely(ttm_vm_ops == NULL)) {
+ ttm_vm_ops = vma->vm_ops;
++ pax_open_kernel();
+ qxl_ttm_vm_ops = *ttm_vm_ops;
+ qxl_ttm_vm_ops.fault = &qxl_ttm_fault;
++ pax_close_kernel();
+ }
+ vma->vm_ops = &qxl_ttm_vm_ops;
+ return 0;
+@@ -556,25 +558,23 @@ static int qxl_mm_dump_table(struct seq_file *m, void *data)
+ static int qxl_ttm_debugfs_init(struct qxl_device *qdev)
+ {
+ #if defined(CONFIG_DEBUG_FS)
+- static struct drm_info_list qxl_mem_types_list[QXL_DEBUGFS_MEM_TYPES];
+- static char qxl_mem_types_names[QXL_DEBUGFS_MEM_TYPES][32];
+- unsigned i;
++ static struct drm_info_list qxl_mem_types_list[QXL_DEBUGFS_MEM_TYPES] = {
++ {
++ .name = "qxl_mem_mm",
++ .show = &qxl_mm_dump_table,
++ },
++ {
++ .name = "qxl_surf_mm",
++ .show = &qxl_mm_dump_table,
++ }
++ };
+
+- for (i = 0; i < QXL_DEBUGFS_MEM_TYPES; i++) {
+- if (i == 0)
+- sprintf(qxl_mem_types_names[i], "qxl_mem_mm");
+- else
+- sprintf(qxl_mem_types_names[i], "qxl_surf_mm");
+- qxl_mem_types_list[i].name = qxl_mem_types_names[i];
+- qxl_mem_types_list[i].show = &qxl_mm_dump_table;
+- qxl_mem_types_list[i].driver_features = 0;
+- if (i == 0)
+- qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_VRAM].priv;
+- else
+- qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV0].priv;
++ pax_open_kernel();
++ *(void **)&qxl_mem_types_list[0].data = qdev->mman.bdev.man[TTM_PL_VRAM].priv;
++ *(void **)&qxl_mem_types_list[1].data = qdev->mman.bdev.man[TTM_PL_PRIV0].priv;
++ pax_close_kernel();
+
+- }
+- return qxl_debugfs_add_files(qdev, qxl_mem_types_list, i);
++ return qxl_debugfs_add_files(qdev, qxl_mem_types_list, QXL_DEBUGFS_MEM_TYPES);
+ #else
+ return 0;
+ #endif
diff --git a/drivers/gpu/drm/r128/r128_cce.c b/drivers/gpu/drm/r128/r128_cce.c
index d4660cf..70dbe65 100644
--- a/drivers/gpu/drm/r128/r128_cce.c
@@ -36040,10 +36165,10 @@ 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_device.c b/drivers/gpu/drm/radeon/radeon_device.c
-index 5073665..31d15a6 100644
+index b0dc0b6..a9bfe9c 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
-@@ -976,7 +976,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -1014,7 +1014,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
bool can_switch;
spin_lock(&dev->count_lock);
@@ -36156,7 +36281,7 @@ index 4d20910..6726b6d 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 6c0ce89..66f6d65 100644
+index 6c0ce89..57a2529 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -782,7 +782,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size)
@@ -36179,59 +36304,74 @@ index 6c0ce89..66f6d65 100644
}
vma->vm_ops = &radeon_ttm_vm_ops;
return 0;
-@@ -862,28 +864,33 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
- sprintf(radeon_mem_types_names[i], "radeon_vram_mm");
- else
- sprintf(radeon_mem_types_names[i], "radeon_gtt_mm");
+@@ -853,38 +855,33 @@ static int radeon_mm_dump_table(struct seq_file *m, void *data)
+ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
+ {
+ #if defined(CONFIG_DEBUG_FS)
+- static struct drm_info_list radeon_mem_types_list[RADEON_DEBUGFS_MEM_TYPES+2];
+- static char radeon_mem_types_names[RADEON_DEBUGFS_MEM_TYPES+2][32];
++ static struct drm_info_list radeon_mem_types_list[RADEON_DEBUGFS_MEM_TYPES+2] = {
++ {
++ .name = "radeon_vram_mm",
++ .show = &radeon_mm_dump_table,
++ },
++ {
++ .name = "radeon_gtt_mm",
++ .show = &radeon_mm_dump_table,
++ },
++ {
++ .name = "ttm_page_pool",
++ .show = &ttm_page_alloc_debugfs,
++ },
++ {
++ .name = "ttm_dma_page_pool",
++ .show = &ttm_dma_page_alloc_debugfs,
++ },
++ };
+ unsigned i;
+
+- for (i = 0; i < RADEON_DEBUGFS_MEM_TYPES; i++) {
+- if (i == 0)
+- sprintf(radeon_mem_types_names[i], "radeon_vram_mm");
+- else
+- sprintf(radeon_mem_types_names[i], "radeon_gtt_mm");
- radeon_mem_types_list[i].name = radeon_mem_types_names[i];
- radeon_mem_types_list[i].show = &radeon_mm_dump_table;
- radeon_mem_types_list[i].driver_features = 0;
-+ pax_open_kernel();
-+ *(const char **)&radeon_mem_types_list[i].name = radeon_mem_types_names[i];
-+ *(void **)&radeon_mem_types_list[i].show = &radeon_mm_dump_table;
-+ *(u32 *)&radeon_mem_types_list[i].driver_features = 0;
- if (i == 0)
+- if (i == 0)
- radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_VRAM].priv;
-+ *(void **)&radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_VRAM].priv;
- else
+- else
- radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_TT].priv;
-
-+ *(void **)&radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_TT].priv;
-+ pax_close_kernel();
- }
- /* Add ttm page pool to debugfs */
- sprintf(radeon_mem_types_names[i], "ttm_page_pool");
+- }
+- /* Add ttm page pool to debugfs */
+- sprintf(radeon_mem_types_names[i], "ttm_page_pool");
- radeon_mem_types_list[i].name = radeon_mem_types_names[i];
- radeon_mem_types_list[i].show = &ttm_page_alloc_debugfs;
- radeon_mem_types_list[i].driver_features = 0;
- radeon_mem_types_list[i++].data = NULL;
+ pax_open_kernel();
-+ *(const char **)&radeon_mem_types_list[i].name = radeon_mem_types_names[i];
-+ *(void **)&radeon_mem_types_list[i].show = &ttm_page_alloc_debugfs;
-+ *(u32 *)&radeon_mem_types_list[i].driver_features = 0;
-+ *(void **)&radeon_mem_types_list[i++].data = NULL;
++ *(void **)&radeon_mem_types_list[0].data = rdev->mman.bdev.man[TTM_PL_VRAM].priv;
++ *(void **)&radeon_mem_types_list[1].data = rdev->mman.bdev.man[TTM_PL_TT].priv;
+ pax_close_kernel();
#ifdef CONFIG_SWIOTLB
- if (swiotlb_nr_tbl()) {
- sprintf(radeon_mem_types_names[i], "ttm_dma_page_pool");
+- if (swiotlb_nr_tbl()) {
+- sprintf(radeon_mem_types_names[i], "ttm_dma_page_pool");
- radeon_mem_types_list[i].name = radeon_mem_types_names[i];
- radeon_mem_types_list[i].show = &ttm_dma_page_alloc_debugfs;
- radeon_mem_types_list[i].driver_features = 0;
- radeon_mem_types_list[i++].data = NULL;
-+ pax_open_kernel();
-+ *(const char **)&radeon_mem_types_list[i].name = radeon_mem_types_names[i];
-+ *(void **)&radeon_mem_types_list[i].show = &ttm_dma_page_alloc_debugfs;
-+ *(u32 *)&radeon_mem_types_list[i].driver_features = 0;
-+ *(void **)&radeon_mem_types_list[i++].data = NULL;
-+ pax_close_kernel();
- }
+- }
++ if (swiotlb_nr_tbl())
++ i++;
#endif
return radeon_debugfs_add_files(rdev, radeon_mem_types_list, i);
+
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
-index fad6633..4ff94de 100644
+index 55880d5..9e95342 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
-@@ -304,9 +304,11 @@ static void rs690_crtc_bandwidth_compute(struct radeon_device *rdev,
+@@ -327,9 +327,11 @@ static void rs690_crtc_bandwidth_compute(struct radeon_device *rdev,
if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full &&
rdev->pm.sideport_bandwidth.full)
rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth;
@@ -36283,7 +36423,7 @@ index bd2a3b4..122d9ad 100644
int shrink_pages = sc->nr_to_scan;
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
-index 9f4be3d..cbc9fcc 100644
+index dc0c065..58a0782 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -367,7 +367,6 @@ static int udl_fb_release(struct fb_info *info, int user)
@@ -36501,10 +36641,10 @@ index 8a8725c2..afed796 100644
marker = list_first_entry(&queue->head,
struct vmw_marker, head);
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
-index e6dbf09..3dd2540 100644
+index 264f550..f92dd8c 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
-@@ -2268,7 +2268,7 @@ EXPORT_SYMBOL_GPL(hid_ignore);
+@@ -2269,7 +2269,7 @@ EXPORT_SYMBOL_GPL(hid_ignore);
int hid_add_device(struct hid_device *hdev)
{
@@ -36513,7 +36653,7 @@ index e6dbf09..3dd2540 100644
int ret;
if (WARN_ON(hdev->status & HID_STAT_ADDED))
-@@ -2302,7 +2302,7 @@ int hid_add_device(struct hid_device *hdev)
+@@ -2303,7 +2303,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,
@@ -36551,7 +36691,7 @@ index 0b122f8..b1d8160 100644
ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
if (ret)
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
-index 7311589..861e9ef 100644
+index ae49237..380d4c9 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -112,7 +112,7 @@ static u64 do_hypercall(u64 control, void *input, void *output)
@@ -36616,7 +36756,7 @@ index 6351aba..dc4aaf4 100644
int res = 0;
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
-index b41baff..4953e4d 100644
+index 62c2e32..8f2859a 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -1084,7 +1084,7 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num)
@@ -36657,10 +36797,10 @@ index b25c643..a13460d 100644
{
sysfs_attr_init(&attr->attr);
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
-index 3f1e297..a6cafb5 100644
+index 658ce3a..0d0c2f3 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
-@@ -791,7 +791,7 @@ static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,
+@@ -790,7 +790,7 @@ static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}
@@ -36670,10 +36810,10 @@ index 3f1e297..a6cafb5 100644
};
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
-index a14f634..2916ee2 100644
+index 1429f6e..ee03d59 100644
--- a/drivers/hwmon/ibmaem.c
+++ b/drivers/hwmon/ibmaem.c
-@@ -925,7 +925,7 @@ static int aem_register_sensors(struct aem_data *data,
+@@ -926,7 +926,7 @@ static int aem_register_sensors(struct aem_data *data,
struct aem_rw_sensor_template *rw)
{
struct device *dev = &data->pdev->dev;
@@ -36682,6 +36822,19 @@ index a14f634..2916ee2 100644
int err;
/* Set up read-only sensors */
+diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
+index 52b77af..aed1ddf 100644
+--- a/drivers/hwmon/iio_hwmon.c
++++ b/drivers/hwmon/iio_hwmon.c
+@@ -73,7 +73,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
+ {
+ struct device *dev = &pdev->dev;
+ struct iio_hwmon_state *st;
+- struct sensor_device_attribute *a;
++ sensor_device_attribute_no_const *a;
+ int ret, i;
+ int in_i = 1, temp_i = 1, curr_i = 1;
+ enum iio_chan_type type;
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 9add6092..ee7ba3f 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
@@ -36797,7 +36950,7 @@ index 76f157b..9c0db1b 100644
};
diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c
-index 378fcb5..5e91fa8 100644
+index 07f01ac..d79ad3d 100644
--- a/drivers/i2c/busses/i2c-amd756-s4882.c
+++ b/drivers/i2c/busses/i2c-amd756-s4882.c
@@ -43,7 +43,7 @@
@@ -36810,7 +36963,7 @@ index 378fcb5..5e91fa8 100644
/* Wrapper access functions for multiplexed SMBus */
static DEFINE_MUTEX(amd756_lock);
diff --git a/drivers/i2c/busses/i2c-nforce2-s4985.c b/drivers/i2c/busses/i2c-nforce2-s4985.c
-index 29015eb..af2d8e9 100644
+index 2ca268d..c6acbdf 100644
--- a/drivers/i2c/busses/i2c-nforce2-s4985.c
+++ b/drivers/i2c/busses/i2c-nforce2-s4985.c
@@ -41,7 +41,7 @@
@@ -36836,7 +36989,7 @@ index c3ccdea..5b3dc1a 100644
if (IS_ERR(rdwr_pa[i].buf)) {
res = PTR_ERR(rdwr_pa[i].buf);
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
-index 8126824..55a2798 100644
+index 2ff6204..218c16e 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -768,7 +768,7 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
@@ -36849,7 +37002,7 @@ index 8126824..55a2798 100644
}
}
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
-index 8848f16..f8e6dd8 100644
+index e145931..08bfc59 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -506,7 +506,7 @@ static ssize_t iio_write_channel_info(struct device *dev,
@@ -37076,10 +37229,10 @@ index 9f5ad7c..588cd84 100644
}
}
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
-index 903a92d..9262548 100644
+index 4cb8eb2..146bf60 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,
+@@ -249,7 +249,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
int err;
struct fw_ri_tpte tpt;
u32 stag_idx;
@@ -37088,7 +37241,7 @@ index 903a92d..9262548 100644
if (c4iw_fatal_error(rdev))
return -EIO;
-@@ -139,7 +139,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
+@@ -266,7 +266,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
if (rdev->stats.stag.cur > rdev->stats.stag.max)
rdev->stats.stag.max = rdev->stats.stag.cur;
mutex_unlock(&rdev->stats.lock);
@@ -37492,7 +37645,7 @@ index 4166452..fc952c3 100644
}
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
-index 85cf4d1..05d8e71 100644
+index 49eb511..a774366 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -1273,39 +1273,39 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev,
@@ -37728,10 +37881,10 @@ index 25fc597..558bf3b3 100644
serio->dev.release = serio_release_port;
serio->dev.groups = serio_device_attr_groups;
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
-index b972d43..8943713 100644
+index d8f98b1..f62a640 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
-@@ -554,7 +554,7 @@ static struct notifier_block iommu_bus_nb = {
+@@ -583,7 +583,7 @@ static struct notifier_block iommu_bus_nb = {
static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops)
{
bus_register_notifier(bus, &iommu_bus_nb);
@@ -37771,10 +37924,10 @@ index dcfea4e..f4226b2 100644
bool setup_remapped_irq(int irq, struct irq_cfg *cfg, struct irq_chip *chip)
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
-index fc6aebf..762c5f5 100644
+index 19ceaa6..3625818 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
-@@ -83,7 +83,7 @@ static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
+@@ -84,7 +84,7 @@ static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
* Supported arch specific GIC irq extension.
* Default make them NULL.
*/
@@ -37783,7 +37936,7 @@ index fc6aebf..762c5f5 100644
.irq_eoi = NULL,
.irq_mask = NULL,
.irq_unmask = NULL,
-@@ -332,7 +332,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
+@@ -333,7 +333,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
chained_irq_exit(chip, desc);
}
@@ -37793,7 +37946,7 @@ index fc6aebf..762c5f5 100644
.irq_mask = gic_mask_irq,
.irq_unmask = gic_unmask_irq,
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
-index 89562a8..218999b 100644
+index ac6f72b..81150f2 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -81,8 +81,8 @@ struct capiminor {
@@ -37833,39 +37986,8 @@ index 89562a8..218999b 100644
capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */
capimsg_setu32(skb->data, 12, (u32)(long)skb->data);/* Data32 */
capimsg_setu16(skb->data, 16, len); /* Data length */
-diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c
-index 9b1b274..c123709 100644
---- a/drivers/isdn/capi/kcapi.c
-+++ b/drivers/isdn/capi/kcapi.c
-@@ -93,7 +93,7 @@ capi_ctr_put(struct capi_ctr *ctr)
-
- static inline struct capi_ctr *get_capi_ctr_by_nr(u16 contr)
- {
-- if (contr - 1 >= CAPI_MAXCONTR)
-+ if (contr < 1 || contr - 1 >= CAPI_MAXCONTR)
- return NULL;
-
- return capi_controller[contr - 1];
-@@ -103,7 +103,7 @@ static inline struct capi20_appl *__get_capi_appl_by_nr(u16 applid)
- {
- lockdep_assert_held(&capi_controller_lock);
-
-- if (applid - 1 >= CAPI_MAXAPPL)
-+ if (applid < 1 || applid - 1 >= CAPI_MAXAPPL)
- return NULL;
-
- return capi_applications[applid - 1];
-@@ -111,7 +111,7 @@ static inline struct capi20_appl *__get_capi_appl_by_nr(u16 applid)
-
- static inline struct capi20_appl *get_capi_appl_by_nr(u16 applid)
- {
-- if (applid - 1 >= CAPI_MAXAPPL)
-+ if (applid < 1 || applid - 1 >= CAPI_MAXAPPL)
- return NULL;
-
- return rcu_dereference(capi_applications[applid - 1]);
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
-index e2b5396..c5486dc 100644
+index 600c79b..3752bab 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -130,9 +130,9 @@ static int if_open(struct tty_struct *tty, struct file *filp)
@@ -37893,7 +38015,7 @@ index e2b5396..c5486dc 100644
mutex_unlock(&cs->mutex);
diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
-index 821f7ac..28d4030 100644
+index 4d9b195..455075c 100644
--- a/drivers/isdn/hardware/avm/b1.c
+++ b/drivers/isdn/hardware/avm/b1.c
@@ -176,7 +176,7 @@ int b1_load_t4file(avmcard *card, capiloaddatapart *t4file)
@@ -37915,10 +38037,10 @@ index 821f7ac..28d4030 100644
} else {
memcpy(buf, dp, left);
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
-index ebaebdf..acd4405 100644
+index 3c5f249..5fac4d0 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
-@@ -1511,9 +1511,9 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp)
+@@ -1508,9 +1508,9 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp)
#ifdef ISDN_DEBUG_MODEM_OPEN
printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name,
@@ -37930,7 +38052,7 @@ index ebaebdf..acd4405 100644
port->tty = tty;
/*
* Start up serial port
-@@ -1557,7 +1557,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
+@@ -1554,7 +1554,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
#endif
return;
}
@@ -37939,7 +38061,7 @@ index ebaebdf..acd4405 100644
/*
* Uh, oh. tty->count is 1, which means that the tty
* structure will be freed. Info->count should always
-@@ -1566,15 +1566,15 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
+@@ -1563,15 +1563,15 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
* serial port won't be shutdown.
*/
printk(KERN_ERR "isdn_tty_close: bad port count; tty->count is 1, "
@@ -37961,7 +38083,7 @@ index ebaebdf..acd4405 100644
#ifdef ISDN_DEBUG_MODEM_OPEN
printk(KERN_DEBUG "isdn_tty_close after info->count != 0\n");
#endif
-@@ -1628,7 +1628,7 @@ isdn_tty_hangup(struct tty_struct *tty)
+@@ -1625,7 +1625,7 @@ isdn_tty_hangup(struct tty_struct *tty)
if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_hangup"))
return;
isdn_tty_shutdown(info);
@@ -37970,7 +38092,7 @@ index ebaebdf..acd4405 100644
port->flags &= ~ASYNC_NORMAL_ACTIVE;
port->tty = NULL;
wake_up_interruptible(&port->open_wait);
-@@ -1973,7 +1973,7 @@ isdn_tty_find_icall(int di, int ch, setup_parm *setup)
+@@ -1970,7 +1970,7 @@ isdn_tty_find_icall(int di, int ch, setup_parm *setup)
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
modem_info *info = &dev->mdm.info[i];
@@ -38019,28 +38141,28 @@ index 64e204e..c6bf189 100644
.callback = ss4200_led_dmi_callback,
.ident = "Intel SS4200-E",
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
-index a5ebc00..3de3364 100644
+index 0bf1e4e..b4bf44e 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
-@@ -92,9 +92,17 @@ static __init int map_switcher(void)
- * it's worked so far. The end address needs +1 because __get_vm_area
- * allocates an extra guard page, so we need space for that.
+@@ -97,9 +97,17 @@ static __init int map_switcher(void)
+ * The end address needs +1 because __get_vm_area allocates an
+ * extra guard page, so we need space for that.
*/
+
+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
+ switcher_vma = __get_vm_area(TOTAL_SWITCHER_PAGES * PAGE_SIZE,
-+ VM_ALLOC | VM_KERNEXEC, SWITCHER_ADDR, SWITCHER_ADDR
++ VM_ALLOC | VM_KERNEXEC, switcher_addr, switcher_addr
+ + (TOTAL_SWITCHER_PAGES+1) * PAGE_SIZE);
+#else
switcher_vma = __get_vm_area(TOTAL_SWITCHER_PAGES * PAGE_SIZE,
- VM_ALLOC, SWITCHER_ADDR, SWITCHER_ADDR
+ VM_ALLOC, switcher_addr, switcher_addr
+ (TOTAL_SWITCHER_PAGES+1) * PAGE_SIZE);
+#endif
+
if (!switcher_vma) {
err = -ENOMEM;
printk("lguest: could not map switcher pages high\n");
-@@ -119,7 +127,7 @@ static __init int map_switcher(void)
+@@ -124,7 +132,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 x86/switcher_32.S).
*/
@@ -38050,10 +38172,10 @@ index a5ebc00..3de3364 100644
printk(KERN_INFO "lguest: mapped switcher at %p\n",
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
-index 3b62be16..e33134a 100644
+index 5b9ac32..2ef4f26 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
-@@ -532,7 +532,7 @@ void pin_page(struct lg_cpu *cpu, unsigned long vaddr)
+@@ -559,7 +559,7 @@ void pin_page(struct lg_cpu *cpu, unsigned long vaddr)
/*:*/
#ifdef CONFIG_X86_PAE
@@ -38063,19 +38185,19 @@ index 3b62be16..e33134a 100644
/* If the entry's not present, there's nothing to release. */
if (pmd_flags(*spmd) & _PAGE_PRESENT) {
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
-index 4af12e1..0e89afe 100644
+index f0a3347..f6608b2 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -59,7 +59,7 @@ static struct {
/* Offset from where switcher.S was compiled to where we've copied it */
static unsigned long switcher_offset(void)
{
-- return SWITCHER_ADDR - (unsigned long)start_switcher_text;
-+ return SWITCHER_ADDR - (unsigned long)ktla_ktva(start_switcher_text);
+- return switcher_addr - (unsigned long)start_switcher_text;
++ return switcher_addr - (unsigned long)ktla_ktva(start_switcher_text);
}
- /* This cpu's struct lguest_pages. */
-@@ -100,7 +100,13 @@ static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages)
+ /* This cpu's struct lguest_pages (after the Switcher text page) */
+@@ -99,7 +99,13 @@ static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages)
* These copies are pretty cheap, so we do them unconditionally: */
/* Save the current Host top-level page directory.
*/
@@ -38089,7 +38211,7 @@ index 4af12e1..0e89afe 100644
/*
* Set up the Guest's page tables to see this CPU's pages (and no
* other CPU's pages).
-@@ -476,7 +482,7 @@ void __init lguest_arch_host_init(void)
+@@ -475,7 +481,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++)
@@ -38098,7 +38220,7 @@ index 4af12e1..0e89afe 100644
/*
* Set up the Switcher's per-cpu areas.
-@@ -559,7 +565,7 @@ void __init lguest_arch_host_init(void)
+@@ -558,7 +564,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.
*/
@@ -38169,8 +38291,21 @@ index 40634b0..4f5855e 100644
// Every interrupt can come to us here
// But we must truly tell each apart.
+diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h
+index 0003992..854bbce 100644
+--- a/drivers/md/bcache/closure.h
++++ b/drivers/md/bcache/closure.h
+@@ -622,7 +622,7 @@ static inline void closure_wake_up(struct closure_waitlist *list)
+ static inline void set_closure_fn(struct closure *cl, closure_fn *fn,
+ struct workqueue_struct *wq)
+ {
+- BUG_ON(object_is_on_stack(cl));
++ BUG_ON(object_starts_on_stack(cl));
+ closure_set_ip(cl);
+ cl->fn = fn;
+ cl->wq = wq;
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
-index 4fd9d6a..834fa03 100644
+index 5a2c754..0fa55db 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1779,7 +1779,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
@@ -38196,7 +38331,7 @@ index aa04f02..2a1309e 100644
DMWARN("name not supplied when creating device");
return -EINVAL;
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
-index d053098..05cc375 100644
+index 699b5be..eac0a15 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -40,7 +40,7 @@ enum dm_raid1_error {
@@ -38272,7 +38407,7 @@ index d053098..05cc375 100644
return (test_bit(DM_RAID1_FLUSH_ERROR, &(m->error_type))) ? 'F' :
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
-index 7b8b2b9..9c7d145 100644
+index d907ca6..cfb8384 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -20,7 +20,7 @@ struct stripe {
@@ -38327,7 +38462,7 @@ index 1ff252a..ee384c1 100644
"start=%llu, len=%llu, dev_size=%llu",
dm_device_name(ti->table->md), bdevname(bdev, b),
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
-index 00cee02..b89a29d 100644
+index 60bce43..9b997d0 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -397,7 +397,7 @@ static void __setup_btree_details(struct dm_pool_metadata *pmd)
@@ -38349,7 +38484,7 @@ index 00cee02..b89a29d 100644
pmd->bl_info.value_type.inc = data_block_inc;
pmd->bl_info.value_type.dec = data_block_dec;
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
-index 9a0bdad..4df9543 100644
+index d5370a9..8761bbc 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -169,9 +169,9 @@ struct mapped_device {
@@ -38364,7 +38499,7 @@ index 9a0bdad..4df9543 100644
struct list_head uevent_list;
spinlock_t uevent_lock; /* Protect access to uevent_list */
-@@ -1879,8 +1879,8 @@ static struct mapped_device *alloc_dev(int minor)
+@@ -1877,8 +1877,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);
@@ -38375,7 +38510,7 @@ index 9a0bdad..4df9543 100644
INIT_LIST_HEAD(&md->uevent_list);
spin_lock_init(&md->uevent_lock);
-@@ -2028,7 +2028,7 @@ static void event_callback(void *context)
+@@ -2026,7 +2026,7 @@ static void event_callback(void *context)
dm_send_uevents(&uevents, &disk_to_dev(md->disk)->kobj);
@@ -38384,7 +38519,7 @@ index 9a0bdad..4df9543 100644
wake_up(&md->eventq);
}
-@@ -2685,18 +2685,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
+@@ -2683,18 +2683,18 @@ int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
uint32_t dm_next_uevent_seq(struct mapped_device *md)
{
@@ -38407,10 +38542,10 @@ index 9a0bdad..4df9543 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 a4a93b9..4747b63 100644
+index 9b82377..6b6922d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
-@@ -240,10 +240,10 @@ EXPORT_SYMBOL_GPL(md_trim_bio);
+@@ -234,10 +234,10 @@ EXPORT_SYMBOL_GPL(md_trim_bio);
* start build, activate spare
*/
static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters);
@@ -38423,7 +38558,7 @@ index a4a93b9..4747b63 100644
wake_up(&md_event_waiters);
}
EXPORT_SYMBOL_GPL(md_new_event);
-@@ -253,7 +253,7 @@ EXPORT_SYMBOL_GPL(md_new_event);
+@@ -247,7 +247,7 @@ EXPORT_SYMBOL_GPL(md_new_event);
*/
static void md_new_event_inintr(struct mddev *mddev)
{
@@ -38432,7 +38567,7 @@ index a4a93b9..4747b63 100644
wake_up(&md_event_waiters);
}
-@@ -1507,7 +1507,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
+@@ -1501,7 +1501,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_RESHAPE_ACTIVE) &&
(le32_to_cpu(sb->feature_map) & MD_FEATURE_NEW_OFFSET))
rdev->new_data_offset += (s32)le32_to_cpu(sb->new_offset);
@@ -38441,7 +38576,7 @@ index a4a93b9..4747b63 100644
rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256;
bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1;
-@@ -1751,7 +1751,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev)
+@@ -1745,7 +1745,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev)
else
sb->resync_offset = cpu_to_le64(0);
@@ -38450,7 +38585,7 @@ index a4a93b9..4747b63 100644
sb->raid_disks = cpu_to_le32(mddev->raid_disks);
sb->size = cpu_to_le64(mddev->dev_sectors);
-@@ -2751,7 +2751,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
+@@ -2750,7 +2750,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
static ssize_t
errors_show(struct md_rdev *rdev, char *page)
{
@@ -38459,7 +38594,7 @@ index a4a93b9..4747b63 100644
}
static ssize_t
-@@ -2760,7 +2760,7 @@ errors_store(struct md_rdev *rdev, const char *buf, size_t len)
+@@ -2759,7 +2759,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')) {
@@ -38468,7 +38603,7 @@ index a4a93b9..4747b63 100644
return len;
}
return -EINVAL;
-@@ -3210,8 +3210,8 @@ int md_rdev_init(struct md_rdev *rdev)
+@@ -3207,8 +3207,8 @@ int md_rdev_init(struct md_rdev *rdev)
rdev->sb_loaded = 0;
rdev->bb_page = NULL;
atomic_set(&rdev->nr_pending, 0);
@@ -38479,7 +38614,7 @@ index a4a93b9..4747b63 100644
INIT_LIST_HEAD(&rdev->same_set);
init_waitqueue_head(&rdev->blocked_wait);
-@@ -6994,7 +6994,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
+@@ -7009,7 +7009,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
spin_unlock(&pers_lock);
seq_printf(seq, "\n");
@@ -38488,7 +38623,7 @@ index a4a93b9..4747b63 100644
return 0;
}
if (v == (void*)2) {
-@@ -7097,7 +7097,7 @@ static int md_seq_open(struct inode *inode, struct file *file)
+@@ -7112,7 +7112,7 @@ static int md_seq_open(struct inode *inode, struct file *file)
return error;
seq = file->private_data;
@@ -38497,7 +38632,7 @@ index a4a93b9..4747b63 100644
return error;
}
-@@ -7111,7 +7111,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
+@@ -7126,7 +7126,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
/* always allow read */
mask = POLLIN | POLLRDNORM;
@@ -38506,7 +38641,7 @@ index a4a93b9..4747b63 100644
mask |= POLLERR | POLLPRI;
return mask;
}
-@@ -7155,7 +7155,7 @@ static int is_mddev_idle(struct mddev *mddev, int init)
+@@ -7170,7 +7170,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]) -
@@ -38516,7 +38651,7 @@ index a4a93b9..4747b63 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 d90fb1a..4174a2b 100644
+index 653f992b6..6af6c40 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -94,13 +94,13 @@ struct md_rdev {
@@ -38545,22 +38680,22 @@ index d90fb1a..4174a2b 100644
struct md_personality
diff --git a/drivers/md/persistent-data/dm-space-map.h b/drivers/md/persistent-data/dm-space-map.h
-index 1cbfc6b..56e1dbb 100644
+index 3e6d115..ffecdeb 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);
+@@ -71,6 +71,7 @@ struct dm_space_map {
+ dm_sm_threshold_fn fn,
+ void *context);
};
+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 7116798..c81390c 100644
+index 6e17f81..140f717 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
-@@ -1836,7 +1836,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
+@@ -1822,7 +1822,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)
@@ -38569,7 +38704,7 @@ index 7116798..c81390c 100644
}
sectors -= s;
sect += s;
-@@ -2058,7 +2058,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
+@@ -2042,7 +2042,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)) {
@@ -38579,10 +38714,10 @@ index 7116798..c81390c 100644
"md/raid1:%s: read error corrected "
"(%d sectors at %llu on %s)\n",
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
-index e4ea992..d234520 100644
+index 6ddae25..514caa9 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
-@@ -1942,7 +1942,7 @@ static void end_sync_read(struct bio *bio, int error)
+@@ -1940,7 +1940,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
*/
@@ -38591,7 +38726,7 @@ index e4ea992..d234520 100644
&conf->mirrors[d].rdev->corrected_errors);
/* for reconstruct, we always reschedule after a read.
-@@ -2291,7 +2291,7 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
+@@ -2286,7 +2286,7 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
{
struct timespec cur_time_mon;
unsigned long hours_since_last;
@@ -38600,7 +38735,7 @@ index e4ea992..d234520 100644
ktime_get_ts(&cur_time_mon);
-@@ -2313,9 +2313,9 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
+@@ -2308,9 +2308,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))
@@ -38612,7 +38747,7 @@ index e4ea992..d234520 100644
}
static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
-@@ -2369,8 +2369,8 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
+@@ -2364,8 +2364,8 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
return;
check_decay_read_errors(mddev, rdev);
@@ -38623,7 +38758,7 @@ index e4ea992..d234520 100644
char b[BDEVNAME_SIZE];
bdevname(rdev->bdev, b);
-@@ -2378,7 +2378,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
+@@ -2373,7 +2373,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,
@@ -38632,7 +38767,7 @@ index e4ea992..d234520 100644
printk(KERN_NOTICE
"md/raid10:%s: %s: Failing raid device\n",
mdname(mddev), b);
-@@ -2533,7 +2533,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
+@@ -2528,7 +2528,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
sect +
choose_data_offset(r10_bio, rdev)),
bdevname(rdev->bdev, b));
@@ -38642,10 +38777,10 @@ index e4ea992..d234520 100644
rdev_dec_pending(rdev, mddev);
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
-index 251ab64..ed23a18 100644
+index 05e4a10..48fbe37 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
-@@ -1763,21 +1763,21 @@ static void raid5_end_read_request(struct bio * bi, int error)
+@@ -1764,21 +1764,21 @@ static void raid5_end_read_request(struct bio * bi, int error)
mdname(conf->mddev), STRIPE_SECTORS,
(unsigned long long)s,
bdevname(rdev->bdev, b));
@@ -38671,7 +38806,7 @@ index 251ab64..ed23a18 100644
if (test_bit(R5_ReadRepl, &sh->dev[i].flags))
printk_ratelimited(
KERN_WARNING
-@@ -1805,7 +1805,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
+@@ -1806,7 +1806,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
mdname(conf->mddev),
(unsigned long long)s,
bdn);
@@ -38707,7 +38842,7 @@ index 9b6c3bb..baeb5c7 100644
#if IS_ENABLED(CONFIG_DVB_DIB3000MB)
extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
-index bc78354..42c9459 100644
+index c7a9be1..683f6f8 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -50,9 +50,9 @@ MODULE_VERSION(CX88_VERSION);
@@ -38724,7 +38859,7 @@ index bc78354..42c9459 100644
module_param_array(video_nr, int, NULL, 0444);
module_param_array(vbi_nr, int, NULL, 0444);
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
-index 96c4a17..1305a79 100644
+index d338b19..aae4f9e 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -63,7 +63,6 @@ enum omap_vout_channels {
@@ -38735,7 +38870,7 @@ index 96c4a17..1305a79 100644
/* Variables configurable through module params*/
static u32 video1_numbuffers = 3;
static u32 video2_numbuffers = 3;
-@@ -1012,6 +1011,12 @@ static int omap_vout_open(struct file *file)
+@@ -1015,6 +1014,12 @@ static int omap_vout_open(struct file *file)
{
struct videobuf_queue *q;
struct omap_vout_device *vout = NULL;
@@ -38748,7 +38883,7 @@ index 96c4a17..1305a79 100644
vout = video_drvdata(file);
v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Entering %s\n", __func__);
-@@ -1029,10 +1034,6 @@ static int omap_vout_open(struct file *file)
+@@ -1032,10 +1037,6 @@ static int omap_vout_open(struct file *file)
vout->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
q = &vout->vbq;
@@ -38799,7 +38934,7 @@ index b713403..53cb5ad 100644
if (done && done != layer->shadow_buf)
vb2_buffer_done(&done->vb, VB2_BUF_STATE_DONE);
diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c
-index 82142a2..6de47e8 100644
+index ef0efdf..8c78eb6 100644
--- a/drivers/media/platform/s5p-tv/mixer_video.c
+++ b/drivers/media/platform/s5p-tv/mixer_video.c
@@ -209,7 +209,7 @@ static void mxr_layer_default_geo(struct mxr_layer *layer)
@@ -38853,7 +38988,7 @@ index 82142a2..6de47e8 100644
/* retrieve update selection rectangle */
res.left = target->x_offset;
-@@ -938,13 +938,13 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
+@@ -954,13 +954,13 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
mxr_output_get(mdev);
mxr_layer_update_output(layer);
@@ -38869,7 +39004,7 @@ index 82142a2..6de47e8 100644
mxr_streamer_get(mdev);
return 0;
-@@ -1014,7 +1014,7 @@ static int stop_streaming(struct vb2_queue *vq)
+@@ -1030,7 +1030,7 @@ static int stop_streaming(struct vb2_queue *vq)
spin_unlock_irqrestore(&layer->enq_slock, flags);
/* disabling layer in hardware */
@@ -38878,7 +39013,7 @@ index 82142a2..6de47e8 100644
/* remove one streamer */
mxr_streamer_put(mdev);
/* allow changes in output configuration */
-@@ -1053,8 +1053,8 @@ void mxr_base_layer_unregister(struct mxr_layer *layer)
+@@ -1069,8 +1069,8 @@ void mxr_base_layer_unregister(struct mxr_layer *layer)
void mxr_layer_release(struct mxr_layer *layer)
{
@@ -38889,7 +39024,7 @@ index 82142a2..6de47e8 100644
}
void mxr_base_layer_release(struct mxr_layer *layer)
-@@ -1080,7 +1080,7 @@ struct mxr_layer *mxr_base_layer_create(struct mxr_device *mdev,
+@@ -1096,7 +1096,7 @@ struct mxr_layer *mxr_base_layer_create(struct mxr_device *mdev,
layer->mdev = mdev;
layer->idx = idx;
@@ -38912,10 +39047,10 @@ index 3d13a63..da31bf1 100644
.buffer_set = mxr_vp_buffer_set,
.stream_set = mxr_vp_stream_set,
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
-index 643d80a..56bb96b 100644
+index 545c04c..a14bded 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
-@@ -302,6 +302,8 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo
+@@ -324,6 +324,8 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo
unsigned char readbuf[RDS_BUFFER];
int i = 0;
@@ -38924,7 +39059,7 @@ index 643d80a..56bb96b 100644
mutex_lock(&dev->lock);
if (dev->rdsstat == 0)
cadet_start_rds(dev);
-@@ -317,7 +319,7 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo
+@@ -339,7 +341,7 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo
while (i < count && dev->rdsin != dev->rdsout)
readbuf[i++] = dev->rdsbuf[dev->rdsout++];
@@ -38947,10 +39082,10 @@ index 3940bb0..fb3952a 100644
static int dib7070_set_param_override(struct dvb_frontend *fe)
{
diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
-index 9578a67..31aa652 100644
+index 6e237b6..dc25556 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
-@@ -115,7 +115,7 @@ struct su3000_state {
+@@ -118,7 +118,7 @@ struct su3000_state {
struct s6x0_state {
int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v);
@@ -38960,7 +39095,7 @@ index 9578a67..31aa652 100644
/* debug */
static int dvb_usb_dw2102_debug;
diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
-index 7157af3..139e91a 100644
+index f129551..ecf6514 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -326,7 +326,7 @@ struct v4l2_buffer32 {
@@ -38991,40 +39126,10 @@ index 7157af3..139e91a 100644
return 0;
}
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
-index aa6e7c7..cb5de87 100644
+index 7658586..1079260 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
-@@ -236,7 +236,7 @@ static void v4l_print_format(const void *arg, bool write_only)
- const struct v4l2_vbi_format *vbi;
- const struct v4l2_sliced_vbi_format *sliced;
- const struct v4l2_window *win;
-- const struct v4l2_clip *clip;
-+ const struct v4l2_clip __user *pclip;
- unsigned i;
-
- pr_cont("type=%s", prt_names(p->type, v4l2_type_names));
-@@ -284,12 +284,16 @@ static void v4l_print_format(const void *arg, bool write_only)
- win->w.left, win->w.top,
- prt_names(win->field, v4l2_field_names),
- win->chromakey, win->bitmap, win->global_alpha);
-- clip = win->clips;
-+ pclip = win->clips;
- for (i = 0; i < win->clipcount; i++) {
-+ struct v4l2_clip clip;
-+
-+ if (copy_from_user(&clip, pclip, sizeof clip))
-+ break;
- printk(KERN_DEBUG "clip %u: wxh=%dx%d, x,y=%d,%d\n",
-- i, clip->c.width, clip->c.height,
-- clip->c.left, clip->c.top);
-- clip = clip->next;
-+ i, clip.c.width, clip.c.height,
-+ clip.c.left, clip.c.top);
-+ pclip = clip.next;
- }
- break;
- case V4L2_BUF_TYPE_VBI_CAPTURE:
-@@ -1923,7 +1927,8 @@ struct v4l2_ioctl_info {
+@@ -1995,7 +1995,8 @@ struct v4l2_ioctl_info {
struct file *file, void *fh, void *p);
} u;
void (*debug)(const void *arg, bool write_only);
@@ -39034,7 +39139,7 @@ index aa6e7c7..cb5de87 100644
/* This control needs a priority check */
#define INFO_FL_PRIO (1 << 0)
-@@ -2108,7 +2113,7 @@ static long __video_do_ioctl(struct file *file,
+@@ -2177,7 +2178,7 @@ static long __video_do_ioctl(struct file *file,
struct video_device *vfd = video_devdata(file);
const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
bool write_only = false;
@@ -39043,7 +39148,7 @@ index aa6e7c7..cb5de87 100644
const struct v4l2_ioctl_info *info;
void *fh = file->private_data;
struct v4l2_fh *vfh = NULL;
-@@ -2193,7 +2198,7 @@ done:
+@@ -2251,7 +2252,7 @@ done:
}
static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
@@ -39052,7 +39157,7 @@ index aa6e7c7..cb5de87 100644
{
int ret = 0;
-@@ -2209,7 +2214,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
+@@ -2267,7 +2268,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
ret = -EINVAL;
break;
}
@@ -39061,7 +39166,7 @@ index aa6e7c7..cb5de87 100644
*kernel_ptr = (void *)&buf->m.planes;
*array_size = sizeof(struct v4l2_plane) * buf->length;
ret = 1;
-@@ -2244,7 +2249,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
+@@ -2302,7 +2303,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
ret = -EINVAL;
break;
}
@@ -39071,7 +39176,7 @@ index aa6e7c7..cb5de87 100644
*array_size = sizeof(struct v4l2_ext_control)
* ctrls->count;
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
-index fb69baa..3aeea2e 100644
+index 767ff4d..c69d259 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -6755,8 +6755,13 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v)
@@ -39101,7 +39206,7 @@ index fb69baa..3aeea2e 100644
seq_printf(m, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n",
ioc->reply_sz, ioc->reply_depth, ioc->reply_sz*ioc->reply_depth, sz);
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
-index fa43c39..daeb158 100644
+index dd239bd..689c4f7 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -446,6 +446,23 @@ mptsas_is_end_device(struct mptsas_devinfo * attached)
@@ -39153,7 +39258,7 @@ index fa43c39..daeb158 100644
mptsas_get_port(struct mptsas_phyinfo *phy_info)
{
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
-index 164afa7..b6b2e74 100644
+index 727819c..ad74694 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1271,15 +1271,16 @@ mptscsih_info(struct Scsi_Host *SChost)
@@ -39182,7 +39287,7 @@ index 164afa7..b6b2e74 100644
return h->info_kbuf;
}
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
-index 8001aa6..b137580 100644
+index b7d87cd..9890039 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -255,12 +255,6 @@ static char *scsi_devices[] = {
@@ -39439,7 +39544,7 @@ index 36f5d52..32311c3 100644
if (memcmp(before, after, BREAK_INSTR_SIZE)) {
printk(KERN_CRIT "kgdbts: ERROR kgdb corrupted memory\n");
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
-index 4a87e5c..76bdf5c 100644
+index 4cd4a3d..b48cbc7 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -498,7 +498,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *data)
@@ -39460,7 +39565,7 @@ index 4a87e5c..76bdf5c 100644
return 0;
}
-@@ -617,7 +617,7 @@ static ssize_t lis3lv02d_misc_read(struct file *file, char __user *buf,
+@@ -616,7 +616,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);
@@ -39469,7 +39574,7 @@ index 4a87e5c..76bdf5c 100644
if (data)
break;
-@@ -658,7 +658,7 @@ static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait)
+@@ -657,7 +657,7 @@ static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait)
struct lis3lv02d, miscdev);
poll_wait(file, &lis3->misc_wait, wait);
@@ -39507,7 +39612,7 @@ index 2f30bad..c4c13d0 100644
mcs_op_statistics[op].max = nsec;
}
diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c
-index 950dbe9..eeef0f8 100644
+index 797d796..ae8f01e 100644
--- a/drivers/misc/sgi-gru/gruprocfs.c
+++ b/drivers/misc/sgi-gru/gruprocfs.c
@@ -32,9 +32,9 @@
@@ -39784,21 +39889,21 @@ index 49f04bc..65660c2 100644
/*
* dma onto stack is unsafe/nonportable, but callers to this
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
-index 53b8fd9..615b462 100644
+index 0b74189..818358f 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
-@@ -205,5 +205,5 @@ struct dw_mci_drv_data {
+@@ -202,5 +202,5 @@ struct dw_mci_drv_data {
+ void (*prepare_command)(struct dw_mci *host, u32 *cmdr);
+ void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios);
int (*parse_dt)(struct dw_mci *host);
- int (*setup_bus)(struct dw_mci *host,
- struct device_node *slot_np, u8 bus_width);
-};
+} __do_const;
#endif /* _DW_MMC_H_ */
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
-index 7363efe..681558e 100644
+index c6f6246..60760a8 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
-@@ -720,9 +720,11 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
+@@ -664,9 +664,11 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
* we can use overriding functions instead of default.
*/
if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK) {
@@ -39813,19 +39918,6 @@ index 7363efe..681558e 100644
}
/* It supports additional host capabilities if needed */
-diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
-index a4eb8b5..8c0628f 100644
---- a/drivers/mtd/devices/doc2000.c
-+++ b/drivers/mtd/devices/doc2000.c
-@@ -753,7 +753,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-
-- if (len != 0x200 && eccbuf)
-+ if (len != 0x200)
- printk(KERN_WARNING
- "ECC needs a full sector write (adr: %lx size %lx)\n",
- (long) to, (long) len);
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 0c8bb6b..6f35deb 100644
--- a/drivers/mtd/nand/denali.c
@@ -39851,7 +39943,7 @@ index 51b9d6a..52af9a7 100644
#include <linux/mtd/nand.h>
#include <linux/mtd/nftl.h>
diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c
-index 8dd6ba5..419cc1d 100644
+index f9d5615..99dd95f 100644
--- a/drivers/mtd/sm_ftl.c
+++ b/drivers/mtd/sm_ftl.c
@@ -56,7 +56,7 @@ ssize_t sm_attr_show(struct device *dev, struct device_attribute *attr,
@@ -39864,10 +39956,10 @@ index 8dd6ba5..419cc1d 100644
struct sm_sysfs_attribute *vendor_attribute;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
-index dbbea0e..3f4a0b1 100644
+index f975696..4597e21 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
-@@ -4822,7 +4822,7 @@ static unsigned int bond_get_num_tx_queues(void)
+@@ -4870,7 +4870,7 @@ static unsigned int bond_get_num_tx_queues(void)
return tx_queues;
}
@@ -39876,7 +39968,7 @@ index dbbea0e..3f4a0b1 100644
.kind = "bond",
.priv_size = sizeof(struct bonding),
.setup = bond_setup,
-@@ -4947,8 +4947,8 @@ static void __exit bonding_exit(void)
+@@ -4995,8 +4995,8 @@ static void __exit bonding_exit(void)
bond_destroy_debugfs();
@@ -39904,10 +39996,10 @@ index e1d2643..7f4133b 100644
if (!request_mem_region(mem->start, mem_size, pdev->name)) {
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
-index aee7671..3ca2651 100644
+index 151675d..0139a9d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
-@@ -1093,7 +1093,7 @@ static inline u8 bnx2x_get_path_func_num(struct bnx2x *bp)
+@@ -1112,7 +1112,7 @@ static inline u8 bnx2x_get_path_func_num(struct bnx2x *bp)
static inline void bnx2x_init_bp_objs(struct bnx2x *bp)
{
/* RX_MODE controlling object */
@@ -39917,10 +40009,10 @@ index aee7671..3ca2651 100644
/* multicast configuration controlling object */
bnx2x_init_mcast_obj(bp, &bp->mcast_obj, bp->fp->cl_id, bp->fp->cid,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
-index 7306416..5fb7fb5 100644
+index 32a9609..0b1c53a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
-@@ -2381,15 +2381,14 @@ int bnx2x_config_rx_mode(struct bnx2x *bp,
+@@ -2387,15 +2387,14 @@ int bnx2x_config_rx_mode(struct bnx2x *bp,
return rc;
}
@@ -39942,10 +40034,10 @@ index 7306416..5fb7fb5 100644
}
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
-index ff90760..08d8aed 100644
+index 43c00bc..dd1d03d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
-@@ -1306,8 +1306,7 @@ int bnx2x_vlan_mac_move(struct bnx2x *bp,
+@@ -1321,8 +1321,7 @@ int bnx2x_vlan_mac_move(struct bnx2x *bp,
/********************* RX MODE ****************/
@@ -39956,7 +40048,7 @@ index ff90760..08d8aed 100644
/**
* bnx2x_config_rx_mode - Send and RX_MODE ramrod according to the provided parameters.
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
-index 25309bf..fcfd54c 100644
+index ff6e30e..87e8452 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -147,6 +147,7 @@
@@ -39967,19 +40059,6 @@ index 25309bf..fcfd54c 100644
#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/brocade/bna/bnad_debugfs.c b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
-index 6e8bc9d..94d957d 100644
---- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
-+++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
-@@ -244,7 +244,7 @@ bnad_debugfs_lseek(struct file *file, loff_t offset, int orig)
- file->f_pos += offset;
- break;
- case 2:
-- file->f_pos = debug->buffer_len - offset;
-+ file->f_pos = debug->buffer_len + offset;
- break;
- default:
- return -EINVAL;
diff --git a/drivers/net/ethernet/chelsio/cxgb3/l2t.h b/drivers/net/ethernet/chelsio/cxgb3/l2t.h
index 8cffcdf..aadf043 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/l2t.h
@@ -40016,10 +40095,10 @@ index 4c83003..2a2a5b9 100644
break;
}
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
-index 2886c9b..db71673 100644
+index a0b4be5..d8cb082 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
-@@ -455,7 +455,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val)
+@@ -469,7 +469,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val)
if (wrapped)
newacc += 65536;
@@ -40027,9 +40106,9 @@ index 2886c9b..db71673 100644
+ ACCESS_ONCE_RW(*acc) = newacc;
}
- void be_parse_stats(struct be_adapter *adapter)
+ void populate_erx_stats(struct be_adapter *adapter,
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
-index 7c361d1..57e3ff1 100644
+index 21b85fb..b49e5fc 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -31,6 +31,8 @@
@@ -40042,7 +40121,7 @@ index 7c361d1..57e3ff1 100644
#include "ftgmac100.h"
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
-index b5ea8fb..bd25e9a 100644
+index a6eda8d..935d273 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -31,6 +31,8 @@
@@ -40093,11 +40172,11 @@ index fbe5363..266b4e3 100644
__vxge_hw_mempool_create(vpath->hldev,
fifo->config->memblock_size,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
-index 5c033f2..7bbb0d8 100644
+index 5e7fb1d..f8d1810 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
-@@ -1894,7 +1894,9 @@ int qlcnic_83xx_config_default_opmode(struct qlcnic_adapter *adapter)
- op_mode = QLCRDX(ahw, QLC_83XX_DRV_OP_MODE);
+@@ -1948,7 +1948,9 @@ int qlcnic_83xx_config_default_opmode(struct qlcnic_adapter *adapter)
+ op_mode = QLC_83XX_DEFAULT_OPMODE;
if (op_mode == QLC_83XX_DEFAULT_OPMODE) {
- adapter->nic_ops->init_driver = qlcnic_83xx_init_default_driver;
@@ -40137,10 +40216,10 @@ index b0c3de9..fc5857e 100644
return -EIO;
}
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
-index 54fd2ef..33c8a4f 100644
+index 393f961..d343034 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
-@@ -740,22 +740,22 @@ struct rtl8169_private {
+@@ -753,22 +753,22 @@ struct rtl8169_private {
struct mdio_ops {
void (*write)(struct rtl8169_private *, int, int);
int (*read)(struct rtl8169_private *, int);
@@ -40168,10 +40247,10 @@ index 54fd2ef..33c8a4f 100644
int (*set_speed)(struct net_device *, u8 aneg, u16 sp, u8 dpx, u32 adv);
int (*get_settings)(struct net_device *, struct ethtool_cmd *);
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
-index 3f93624..cf01144 100644
+index 9a95abf..36df7f9 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
-@@ -553,7 +553,7 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
+@@ -535,7 +535,7 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
(u32)((u64)ptp->start.dma_addr >> 32));
/* Clear flag that signals MC ready */
@@ -40231,10 +40310,10 @@ index 0775f0a..d4fb316 100644
/* Ignore return since this msg is optional. */
rndis_filter_send_request(dev, request);
diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
-index 8f1c256..a2991d1 100644
+index bf0d55e..82bcfbd1 100644
--- a/drivers/net/ieee802154/fakehard.c
+++ b/drivers/net/ieee802154/fakehard.c
-@@ -385,7 +385,7 @@ static int ieee802154fake_probe(struct platform_device *pdev)
+@@ -364,7 +364,7 @@ static int ieee802154fake_probe(struct platform_device *pdev)
phy->transmit_power = 0xbf;
dev->netdev_ops = &fake_ops;
@@ -40244,10 +40323,10 @@ index 8f1c256..a2991d1 100644
priv = netdev_priv(dev);
priv->phy = phy;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
-index 011062e..ada88e9 100644
+index 6e91931..2b0ebe7 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
-@@ -892,13 +892,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = {
+@@ -905,13 +905,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = {
int macvlan_link_register(struct rtnl_link_ops *ops)
{
/* common fields */
@@ -40270,7 +40349,7 @@ index 011062e..ada88e9 100644
return rtnl_link_register(ops);
};
-@@ -954,7 +956,7 @@ static int macvlan_device_event(struct notifier_block *unused,
+@@ -967,7 +969,7 @@ static int macvlan_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
@@ -40280,23 +40359,10 @@ index 011062e..ada88e9 100644
};
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
-index acf6450..8f771b7 100644
+index b6dd6a7..5c38a02 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
-@@ -525,8 +525,10 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
- return -EMSGSIZE;
- num_pages = get_user_pages_fast(base, size, 0, &page[i]);
- if (num_pages != size) {
-- for (i = 0; i < num_pages; i++)
-- put_page(page[i]);
-+ int j;
-+
-+ for (j = 0; j < num_pages; j++)
-+ put_page(page[i + j]);
- return -EFAULT;
- }
- truesize = size * PAGE_SIZE;
-@@ -1099,7 +1101,7 @@ static int macvtap_device_event(struct notifier_block *unused,
+@@ -1094,7 +1094,7 @@ static int macvtap_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
@@ -40353,10 +40419,10 @@ index 1252d9c..80e660b 100644
/* We've got a compressed packet; read the change byte */
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
-index 0017b67..ab8f595 100644
+index b305105..8ead6df 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
-@@ -2668,7 +2668,7 @@ static int team_device_event(struct notifier_block *unused,
+@@ -2682,7 +2682,7 @@ static int team_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
@@ -40366,23 +40432,10 @@ index 0017b67..ab8f595 100644
};
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
-index 8ad822e..eb895f1 100644
+index 9c61f87..213609e 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
-@@ -1013,8 +1013,10 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
- return -EMSGSIZE;
- num_pages = get_user_pages_fast(base, size, 0, &page[i]);
- if (num_pages != size) {
-- for (i = 0; i < num_pages; i++)
-- put_page(page[i]);
-+ int j;
-+
-+ for (j = 0; j < num_pages; j++)
-+ put_page(page[i + j]);
- return -EFAULT;
- }
- truesize = size * PAGE_SIZE;
-@@ -1859,7 +1861,7 @@ unlock:
+@@ -1852,7 +1852,7 @@ unlock:
}
static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
@@ -40391,7 +40444,7 @@ index 8ad822e..eb895f1 100644
{
struct tun_file *tfile = file->private_data;
struct tun_struct *tun;
-@@ -1871,6 +1873,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
+@@ -1864,6 +1864,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
int vnet_hdr_sz;
int ret;
@@ -40402,7 +40455,7 @@ index 8ad822e..eb895f1 100644
if (copy_from_user(&ifr, argp, ifreq_len))
return -EFAULT;
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
-index e2dd324..be92fcf 100644
+index cba1d46..f703766 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -71,7 +71,7 @@
@@ -40483,7 +40536,7 @@ index e2dd324..be92fcf 100644
/* Setup and send a ctrl req read on
* port i */
if (!serial->rx_urb_filled[0]) {
-@@ -3066,7 +3065,7 @@ static int hso_resume(struct usb_interface *iface)
+@@ -3057,7 +3056,7 @@ static int hso_resume(struct usb_interface *iface)
/* Start all serial ports */
for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
if (serial_table[i] && (serial_table[i]->interface == iface)) {
@@ -40493,10 +40546,10 @@ index e2dd324..be92fcf 100644
hso_start_serial_device(serial_table[i], GFP_NOIO);
hso_kick_transmit(dev2ser(serial_table[i]));
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
-index a4fe5f1..6c9e77f 100644
+index 57325f3..36b181f 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
-@@ -1454,7 +1454,7 @@ nla_put_failure:
+@@ -1579,7 +1579,7 @@ nla_put_failure:
return -EMSGSIZE;
}
@@ -40506,7 +40559,7 @@ index a4fe5f1..6c9e77f 100644
.maxtype = IFLA_VXLAN_MAX,
.policy = vxlan_policy,
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
-index 5ac5f7a..5f82012 100644
+index 34c8a33..3261fdc 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -353,7 +353,7 @@ static int at76_dfu_get_state(struct usb_device *udev, u8 *state)
@@ -40724,10 +40777,10 @@ index 301bf72..3f5654f 100644
static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads)
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
-index 784e81c..349e01e 100644
+index ae30343..a117806 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -653,7 +653,7 @@ struct ath_hw_private_ops {
+@@ -652,7 +652,7 @@ struct ath_hw_private_ops {
/* ANI */
void (*ani_cache_ini_regs)(struct ath_hw *ah);
@@ -40736,7 +40789,7 @@ index 784e81c..349e01e 100644
/**
* struct ath_spec_scan - parameters for Atheros spectral scan
-@@ -722,7 +722,7 @@ struct ath_hw_ops {
+@@ -721,7 +721,7 @@ struct ath_hw_ops {
struct ath_spec_scan *param);
void (*spectral_scan_trigger)(struct ath_hw *ah);
void (*spectral_scan_wait)(struct ath_hw *ah);
@@ -40746,7 +40799,7 @@ index 784e81c..349e01e 100644
struct ath_nf_limits {
s16 max;
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
-index c353b5f..62aaca2 100644
+index b37a582..680835d 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3639,7 +3639,9 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -40761,7 +40814,7 @@ index c353b5f..62aaca2 100644
D_INFO("*** LOAD DRIVER ***\n");
diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
-index 81d4071..f2071ea 100644
+index d532948..a1cb592 100644
--- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
@@ -203,7 +203,7 @@ static ssize_t iwl_dbgfs_sram_write(struct file *file,
@@ -40863,7 +40916,7 @@ index 81d4071..f2071ea 100644
memset(buf, 0, sizeof(buf));
buf_size = min(count, sizeof(buf) - 1);
-@@ -2256,7 +2256,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
+@@ -2254,7 +2254,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
struct iwl_priv *priv = file->private_data;
u32 event_log_flag;
char buf[8];
@@ -40872,7 +40925,7 @@ index 81d4071..f2071ea 100644
/* check that the interface is up */
if (!iwl_is_ready(priv))
-@@ -2310,7 +2310,7 @@ static ssize_t iwl_dbgfs_calib_disabled_write(struct file *file,
+@@ -2308,7 +2308,7 @@ static ssize_t iwl_dbgfs_calib_disabled_write(struct file *file,
struct iwl_priv *priv = file->private_data;
char buf[8];
u32 calib_disabled;
@@ -40882,10 +40935,10 @@ index 81d4071..f2071ea 100644
memset(buf, 0, sizeof(buf));
buf_size = min(count, sizeof(buf) - 1);
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
-index 12c4f31..484d948 100644
+index 50ba0a4..29424e7 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
-@@ -1328,7 +1328,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file,
+@@ -1329,7 +1329,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file,
struct isr_statistics *isr_stats = &trans_pcie->isr_stats;
char buf[8];
@@ -40894,7 +40947,7 @@ index 12c4f31..484d948 100644
u32 reset_flag;
memset(buf, 0, sizeof(buf));
-@@ -1349,7 +1349,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file,
+@@ -1350,7 +1350,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file,
{
struct iwl_trans *trans = file->private_data;
char buf[8];
@@ -40904,10 +40957,10 @@ index 12c4f31..484d948 100644
memset(buf, 0, sizeof(buf));
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
-index 2b49f48..14fc244 100644
+index cb34c78..9fec0dc 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
-@@ -2143,25 +2143,19 @@ static int __init init_mac80211_hwsim(void)
+@@ -2195,25 +2195,19 @@ static int __init init_mac80211_hwsim(void)
if (channels > 1) {
hwsim_if_comb.num_different_channels = channels;
@@ -40946,48 +40999,8 @@ index 2b49f48..14fc244 100644
}
spin_lock_init(&hwsim_radio_lock);
-diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
-index 753b568..a5f9875 100644
---- a/drivers/net/wireless/mwifiex/debugfs.c
-+++ b/drivers/net/wireless/mwifiex/debugfs.c
-@@ -26,10 +26,17 @@
- static struct dentry *mwifiex_dfs_dir;
-
- static char *bss_modes[] = {
-- "Unknown",
-- "Ad-hoc",
-- "Managed",
-- "Auto"
-+ "UNSPECIFIED",
-+ "ADHOC",
-+ "STATION",
-+ "AP",
-+ "AP_VLAN",
-+ "WDS",
-+ "MONITOR",
-+ "MESH_POINT",
-+ "P2P_CLIENT",
-+ "P2P_GO",
-+ "P2P_DEVICE",
- };
-
- /* size/addr for mwifiex_debug_info */
-@@ -200,7 +207,12 @@ mwifiex_info_read(struct file *file, char __user *ubuf,
- p += sprintf(p, "driver_version = %s", fmt);
- p += sprintf(p, "\nverext = %s", priv->version_str);
- p += sprintf(p, "\ninterface_name=\"%s\"\n", netdev->name);
-- p += sprintf(p, "bss_mode=\"%s\"\n", bss_modes[info.bss_mode]);
-+
-+ if (info.bss_mode >= ARRAY_SIZE(bss_modes))
-+ p += sprintf(p, "bss_mode=\"%d\"\n", info.bss_mode);
-+ else
-+ p += sprintf(p, "bss_mode=\"%s\"\n", bss_modes[info.bss_mode]);
-+
- p += sprintf(p, "media_state=\"%s\"\n",
- (!priv->media_connected ? "Disconnected" : "Connected"));
- p += sprintf(p, "mac_address=\"%pM\"\n", netdev->dev_addr);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
-index 525fd75..6c9f791 100644
+index 8169a85..7fa3b47 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1238,7 +1238,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold)
@@ -41000,10 +41013,10 @@ index 525fd75..6c9f791 100644
tmp = cpu_to_le32(rts_threshold);
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
-index 086abb4..8279c30 100644
+index 7510723..5ba37f5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
-@@ -396,7 +396,7 @@ struct rt2x00_intf {
+@@ -386,7 +386,7 @@ struct rt2x00_intf {
* for hardware which doesn't support hardware
* sequence counting.
*/
@@ -41013,10 +41026,10 @@ index 086abb4..8279c30 100644
static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
-index 4d91795..62fccff 100644
+index 2c12311..7b77f24 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
-@@ -251,9 +251,9 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,
+@@ -252,9 +252,9 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,
* sequence counter given by mac80211.
*/
if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags))
@@ -41029,10 +41042,10 @@ index 4d91795..62fccff 100644
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
hdr->seq_ctrl |= cpu_to_le16(seqno);
diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
-index e57ee48..541cf6c 100644
+index e2b3d9c..67a5184 100644
--- a/drivers/net/wireless/ti/wl1251/sdio.c
+++ b/drivers/net/wireless/ti/wl1251/sdio.c
-@@ -269,13 +269,17 @@ static int wl1251_sdio_probe(struct sdio_func *func,
+@@ -271,13 +271,17 @@ static int wl1251_sdio_probe(struct sdio_func *func,
irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
@@ -41055,7 +41068,7 @@ index e57ee48..541cf6c 100644
wl1251_info("using SDIO interrupt");
}
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
-index 09694e3..24ccec7 100644
+index 1c627da..69f7d17 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -656,7 +656,9 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
@@ -41081,10 +41094,10 @@ index 09694e3..24ccec7 100644
wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER,
WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER,
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
-index da3ef1b..4790b95 100644
+index 9fa692d..b31fee0 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
-@@ -1664,8 +1664,10 @@ static int wl18xx_setup(struct wl1271 *wl)
+@@ -1687,8 +1687,10 @@ static int wl18xx_setup(struct wl1271 *wl)
}
if (!checksum_param) {
@@ -41257,7 +41270,7 @@ index 93404f7..4a313d8 100644
};
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
-index 3f56bc0..707d642 100644
+index 92ed045..62d39bd7 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -64,7 +64,7 @@ static int do_active_device(ctl_table *table, int write,
@@ -41388,10 +41401,10 @@ index 76ba8a1..20ca857 100644
/* initialize our int15 lock */
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
-index 202f4a9..8ee47d0 100644
+index ec20f74..c1d961e 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
-@@ -448,8 +448,10 @@ int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus,
+@@ -441,8 +441,10 @@ int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus,
return -EINVAL;
}
@@ -41418,7 +41431,7 @@ index 7d72c5e..edce02c 100644
int retval = -ENOMEM;
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
-index 9c6e9bb..2916736 100644
+index 5b4a9d9..cd5ac1f 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1071,7 +1071,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
@@ -41449,10 +41462,10 @@ index 9c6e9bb..2916736 100644
if (!sysfs_initialized)
return -EACCES;
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
-index 7346ee6..41520eb 100644
+index d1182c4..2a138ec 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
-@@ -93,7 +93,7 @@ struct pci_vpd_ops {
+@@ -92,7 +92,7 @@ struct pci_vpd_ops {
struct pci_vpd {
unsigned int len;
const struct pci_vpd_ops *ops;
@@ -41460,7 +41473,7 @@ index 7346ee6..41520eb 100644
+ bin_attribute_no_const *attr; /* descriptor for sysfs VPD entry */
};
- extern int pci_vpd_pci22_init(struct pci_dev *dev);
+ int pci_vpd_pci22_init(struct pci_dev *dev);
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index d320df6..ca9a8f6 100644
--- a/drivers/pci/pcie/aspm.c
@@ -41479,7 +41492,7 @@ index d320df6..ca9a8f6 100644
#define ASPM_STATE_ALL (ASPM_STATE_L0S | ASPM_STATE_L1)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
-index 563771f..4e3c368 100644
+index 70f10fa..cb5e917 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -173,7 +173,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
@@ -41492,10 +41505,10 @@ index 563771f..4e3c368 100644
/* No printks while decoding is disabled! */
if (!dev->mmio_always_on) {
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
-index 0b00947..64f7c0a 100644
+index 0812608..b04018c4 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
-@@ -465,7 +465,16 @@ static const struct file_operations proc_bus_pci_dev_operations = {
+@@ -453,7 +453,16 @@ static const struct file_operations proc_bus_pci_dev_operations = {
static int __init pci_proc_init(void)
{
struct pci_dev *dev = NULL;
@@ -41551,10 +41564,10 @@ index 6b22938..bc9700e 100644
/* disable hardware control by fn key */
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
-index 14d4dce..b129917 100644
+index 2ac045f..39c443d 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
-@@ -2465,7 +2465,7 @@ static void sony_nc_gfx_switch_cleanup(struct platform_device *pd)
+@@ -2483,7 +2483,7 @@ static void sony_nc_gfx_switch_cleanup(struct platform_device *pd)
}
/* High speed charging function */
@@ -41564,7 +41577,7 @@ index 14d4dce..b129917 100644
static ssize_t sony_nc_highspeed_charging_store(struct device *dev,
struct device_attribute *attr,
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
-index edec135..59a24a3 100644
+index 54d31c0..3f896d3 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2093,7 +2093,7 @@ static int hotkey_mask_get(void)
@@ -41778,12 +41791,12 @@ index 3e6db1c..1fbbdae 100644
/* check if the resource is reserved */
diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
-index 7df7c5f..bd48c47 100644
+index 0c52e2a..3421ab7 100644
--- a/drivers/power/pda_power.c
+++ b/drivers/power/pda_power.c
@@ -37,7 +37,11 @@ static int polling;
- #ifdef CONFIG_USB_OTG_UTILS
+ #if IS_ENABLED(CONFIG_USB_PHY)
static struct usb_phy *transceiver;
-static struct notifier_block otg_nb;
+static int otg_handle_notification(struct notifier_block *nb,
@@ -41796,7 +41809,7 @@ index 7df7c5f..bd48c47 100644
static struct regulator *ac_draw;
@@ -369,7 +373,6 @@ static int pda_power_probe(struct platform_device *pdev)
- #ifdef CONFIG_USB_OTG_UTILS
+ #if IS_ENABLED(CONFIG_USB_PHY)
if (!IS_ERR_OR_NULL(transceiver) && pdata->use_otg_notifier) {
- otg_nb.notifier_call = otg_handle_notification;
ret = usb_register_notifier(transceiver, &otg_nb);
@@ -41822,7 +41835,7 @@ index cc439fd..8fa30df 100644
#endif /* CONFIG_SYSFS */
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
-index 5deac43..608c5ff 100644
+index 1c517c3..ffa2f17 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -24,7 +24,10 @@
@@ -41835,9 +41848,9 @@ index 5deac43..608c5ff 100644
+ .groups = power_supply_attr_groups,
+};
- static int __power_supply_changed_work(struct device *dev, void *data)
- {
-@@ -393,7 +396,7 @@ static int __init power_supply_class_init(void)
+ static bool __power_supply_is_supplied_by(struct power_supply *supplier,
+ struct power_supply *supply)
+@@ -554,7 +557,7 @@ static int __init power_supply_class_init(void)
return PTR_ERR(power_supply_class);
power_supply_class->dev_uevent = power_supply_uevent;
@@ -41871,7 +41884,7 @@ index 29178f7..c65f324 100644
__power_supply_attrs[i] = &power_supply_attrs[i].attr;
}
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
-index 4d7c635..9860196 100644
+index d428ef9..fdc0357 100644
--- a/drivers/regulator/max8660.c
+++ b/drivers/regulator/max8660.c
@@ -333,8 +333,10 @@ static int max8660_probe(struct i2c_client *client,
@@ -41888,7 +41901,7 @@ index 4d7c635..9860196 100644
/*
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
-index 9a8ea91..c483dd9 100644
+index adb1414..c13e0ce 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -401,9 +401,11 @@ static int max8973_probe(struct i2c_client *client,
@@ -41907,10 +41920,10 @@ index 9a8ea91..c483dd9 100644
max->enable_external_control = pdata->enable_ext_control;
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
-index 9891aec..beb3083 100644
+index b716283..3cc4349 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
-@@ -583,10 +583,12 @@ static int mc13892_regulator_probe(struct platform_device *pdev)
+@@ -582,10 +582,12 @@ static int mc13892_regulator_probe(struct platform_device *pdev)
}
mc13xxx_unlock(mc13892);
@@ -41924,9 +41937,9 @@ index 9891aec..beb3083 100644
+ pax_close_kernel();
mc13xxx_data = mc13xxx_parse_regulators_dt(pdev, mc13892_regulators,
- ARRAY_SIZE(mc13892_regulators),
+ ARRAY_SIZE(mc13892_regulators));
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
-index cc5bea9..689f7d9 100644
+index f1cb706..4c7832a 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -724,7 +724,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
@@ -41962,10 +41975,10 @@ index d049393..bb20be0 100644
case RTC_PIE_ON:
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
-index 970a236..3613169 100644
+index b53992a..776df84 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
-@@ -106,7 +106,7 @@ struct ds1307 {
+@@ -107,7 +107,7 @@ struct ds1307 {
u8 offset; /* register's offset */
u8 regs[11];
u16 nvram_offset;
@@ -42024,32 +42037,6 @@ index 23a90e7..9cf04ee 100644
/*
* Queue element to wait for room in request queue. FIFO order is
-diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c
-index 439c012..b63d534 100644
---- a/drivers/scsi/bfa/bfad_debugfs.c
-+++ b/drivers/scsi/bfa/bfad_debugfs.c
-@@ -186,7 +186,7 @@ bfad_debugfs_lseek(struct file *file, loff_t offset, int orig)
- file->f_pos += offset;
- break;
- case 2:
-- file->f_pos = debug->buffer_len - offset;
-+ file->f_pos = debug->buffer_len + offset;
- break;
- default:
- return -EINVAL;
-diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c
-index adc1f7f..85e1ffd 100644
---- a/drivers/scsi/fnic/fnic_debugfs.c
-+++ b/drivers/scsi/fnic/fnic_debugfs.c
-@@ -174,7 +174,7 @@ static loff_t fnic_trace_debugfs_lseek(struct file *file,
- pos = file->f_pos + offset;
- break;
- case 2:
-- pos = fnic_dbg_prt->buffer_len - offset;
-+ pos = fnic_dbg_prt->buffer_len + offset;
- }
- return (pos < 0 || pos > fnic_dbg_prt->buffer_len) ?
- -EINVAL : (file->f_pos = pos);
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index df0c3c7..b00e1d0 100644
--- a/drivers/scsi/hosts.c
@@ -42213,7 +42200,7 @@ index 9816479..c5d4e97 100644
/* queue and queue Info */
struct list_head reqQ;
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
-index c772d8d..35c362c 100644
+index 8b928c6..9c76300 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -100,12 +100,12 @@ struct fc_exch_mgr {
@@ -42235,7 +42222,7 @@ index c772d8d..35c362c 100644
} stats;
};
-@@ -725,7 +725,7 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport,
+@@ -736,7 +736,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) {
@@ -42244,7 +42231,7 @@ index c772d8d..35c362c 100644
goto out;
}
memset(ep, 0, sizeof(*ep));
-@@ -786,7 +786,7 @@ out:
+@@ -797,7 +797,7 @@ out:
return ep;
err:
spin_unlock_bh(&pool->lock);
@@ -42253,7 +42240,7 @@ index c772d8d..35c362c 100644
mempool_free(ep, mp->ep_pool);
return NULL;
}
-@@ -929,7 +929,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
+@@ -940,7 +940,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) {
@@ -42262,7 +42249,7 @@ index c772d8d..35c362c 100644
reject = FC_RJT_OX_ID;
goto out;
}
-@@ -959,7 +959,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
+@@ -970,7 +970,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
ep = fc_exch_find(mp, xid);
if ((f_ctl & FC_FC_FIRST_SEQ) && fc_sof_is_init(fr_sof(fp))) {
if (ep) {
@@ -42271,7 +42258,7 @@ index c772d8d..35c362c 100644
reject = FC_RJT_RX_ID;
goto rel;
}
-@@ -970,7 +970,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,
}
xid = ep->xid; /* get our XID */
} else if (!ep) {
@@ -42280,7 +42267,7 @@ index c772d8d..35c362c 100644
reject = FC_RJT_RX_ID; /* XID not found */
goto out;
}
-@@ -987,7 +987,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport,
+@@ -998,7 +998,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) {
@@ -42289,7 +42276,7 @@ index c772d8d..35c362c 100644
if (f_ctl & FC_FC_END_SEQ) {
/*
* Update sequence_id based on incoming last
-@@ -1437,22 +1437,22 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
+@@ -1448,22 +1448,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) {
@@ -42316,7 +42303,7 @@ index c772d8d..35c362c 100644
goto rel;
}
sof = fr_sof(fp);
-@@ -1461,7 +1461,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
+@@ -1472,7 +1472,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) {
@@ -42325,7 +42312,7 @@ index c772d8d..35c362c 100644
goto rel;
}
-@@ -1525,9 +1525,9 @@ static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
+@@ -1536,9 +1536,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)
@@ -42337,7 +42324,7 @@ index c772d8d..35c362c 100644
fc_frame_free(fp);
}
-@@ -2174,13 +2174,13 @@ void fc_exch_update_stats(struct fc_lport *lport)
+@@ -2185,13 +2185,13 @@ void fc_exch_update_stats(struct fc_lport *lport)
list_for_each_entry(ema, &lport->ema_list, ema_list) {
mp = ema->mp;
@@ -42358,7 +42345,7 @@ index c772d8d..35c362c 100644
}
EXPORT_SYMBOL(fc_exch_update_stats);
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
-index bdb81cd..d3c7c2c 100644
+index 161c98e..6d563b3 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -554,7 +554,7 @@ static struct ata_port_operations sas_sata_ops = {
@@ -42371,10 +42358,10 @@ index bdb81cd..d3c7c2c 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 7706c99..3b4fc0c 100644
+index bcc56ca..6f4174a 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
-@@ -424,7 +424,7 @@ struct lpfc_vport {
+@@ -431,7 +431,7 @@ struct lpfc_vport {
struct dentry *debug_nodelist;
struct dentry *vport_debugfs_root;
struct lpfc_debugfs_trc *disc_trc;
@@ -42383,7 +42370,7 @@ index 7706c99..3b4fc0c 100644
#endif
uint8_t stat_data_enabled;
uint8_t stat_data_blocked;
-@@ -853,8 +853,8 @@ struct lpfc_hba {
+@@ -865,8 +865,8 @@ struct lpfc_hba {
struct timer_list fabric_block_timer;
unsigned long bit_flags;
#define FABRIC_COMANDS_BLOCKED 0
@@ -42394,7 +42381,7 @@ index 7706c99..3b4fc0c 100644
unsigned long last_rsrc_error_time;
unsigned long last_ramp_down_time;
unsigned long last_ramp_up_time;
-@@ -890,7 +890,7 @@ struct lpfc_hba {
+@@ -902,7 +902,7 @@ struct lpfc_hba {
struct dentry *debug_slow_ring_trc;
struct lpfc_debugfs_trc *slow_ring_trc;
@@ -42404,7 +42391,7 @@ index 7706c99..3b4fc0c 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 f63f5ff..32549a4 100644
+index f525ecb..32549a4 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -106,7 +106,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
@@ -42468,15 +42455,6 @@ index f63f5ff..32549a4 100644
dtp->jif = jiffies;
#endif
return;
-@@ -1178,7 +1178,7 @@ lpfc_debugfs_lseek(struct file *file, loff_t off, int whence)
- pos = file->f_pos + off;
- break;
- case 2:
-- pos = debug->len - off;
-+ pos = debug->len + off;
- }
- return (pos < 0 || pos > debug->len) ? -EINVAL : (file->f_pos = pos);
- }
@@ -4182,7 +4182,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
"slow_ring buffer\n");
goto debug_failed;
@@ -42496,10 +42474,10 @@ index f63f5ff..32549a4 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 314b4f6..7005d10 100644
+index cb465b2..2e7b25f 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
-@@ -10551,8 +10551,10 @@ lpfc_init(void)
+@@ -10950,8 +10950,10 @@ lpfc_init(void)
"misc_register returned with status %d", error);
if (lpfc_enable_npiv) {
@@ -42513,10 +42491,10 @@ index 314b4f6..7005d10 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 98af07c..7625fb5 100644
+index 8523b278e..ce1d812 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
-@@ -325,7 +325,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
+@@ -331,7 +331,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
uint32_t evt_posted;
spin_lock_irqsave(&phba->hbalock, flags);
@@ -42525,7 +42503,7 @@ index 98af07c..7625fb5 100644
phba->last_rsrc_error_time = jiffies;
if ((phba->last_ramp_down_time + QUEUE_RAMP_DOWN_INTERVAL) > jiffies) {
-@@ -366,7 +366,7 @@ lpfc_rampup_queue_depth(struct lpfc_vport *vport,
+@@ -372,7 +372,7 @@ lpfc_rampup_queue_depth(struct lpfc_vport *vport,
unsigned long flags;
struct lpfc_hba *phba = vport->phba;
uint32_t evt_posted;
@@ -42534,7 +42512,7 @@ index 98af07c..7625fb5 100644
if (vport->cfg_lun_queue_depth <= queue_depth)
return;
-@@ -410,8 +410,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
+@@ -416,8 +416,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
unsigned long num_rsrc_err, num_cmd_success;
int i;
@@ -42545,7 +42523,7 @@ index 98af07c..7625fb5 100644
/*
* The error and success command counters are global per
-@@ -439,8 +439,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
+@@ -445,8 +445,8 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
}
}
lpfc_destroy_vport_work_array(phba, vports);
@@ -42556,7 +42534,7 @@ index 98af07c..7625fb5 100644
}
/**
-@@ -474,8 +474,8 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba)
+@@ -480,8 +480,8 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba)
}
}
lpfc_destroy_vport_work_array(phba, vports);
@@ -42568,7 +42546,7 @@ index 98af07c..7625fb5 100644
/**
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
-index b46f5e9..c4c4ccb 100644
+index 8e1b737..50ff510 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -200,8 +200,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev)
@@ -42603,7 +42581,7 @@ index b46f5e9..c4c4ccb 100644
pinstance->num_hrrq;
cmd->cmd_done = pmcraid_io_done;
-@@ -3859,7 +3859,7 @@ static long pmcraid_ioctl_passthrough(
+@@ -3846,7 +3846,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
*/
@@ -42612,7 +42590,7 @@ index b46f5e9..c4c4ccb 100644
pinstance->num_hrrq;
if (request_size) {
-@@ -4497,7 +4497,7 @@ static void pmcraid_worker_function(struct work_struct *workp)
+@@ -4483,7 +4483,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 */
@@ -42621,7 +42599,7 @@ index b46f5e9..c4c4ccb 100644
return;
fw_version = be16_to_cpu(pinstance->inq_data->fw_version);
-@@ -5324,8 +5324,8 @@ static int pmcraid_init_instance(struct pci_dev *pdev, struct Scsi_Host *host,
+@@ -5310,8 +5310,8 @@ static int pmcraid_init_instance(struct pci_dev *pdev, struct Scsi_Host *host,
init_waitqueue_head(&pinstance->reset_wait_q);
atomic_set(&pinstance->outstanding_cmds, 0);
@@ -42632,7 +42610,7 @@ index b46f5e9..c4c4ccb 100644
INIT_LIST_HEAD(&pinstance->free_res_q);
INIT_LIST_HEAD(&pinstance->used_res_q);
-@@ -6038,7 +6038,7 @@ static int pmcraid_probe(struct pci_dev *pdev,
+@@ -6024,7 +6024,7 @@ static int pmcraid_probe(struct pci_dev *pdev,
/* Schedule worker thread to handle CCN and take care of adding and
* removing devices to OS
*/
@@ -42675,10 +42653,10 @@ index e1d150f..6c6df44 100644
/* To indicate add/delete/modify during CCN */
u8 change_detected;
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
-index b3db9dc..c3b1756 100644
+index bf60c63..74d4dce 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
-@@ -1971,7 +1971,7 @@ qla24xx_vport_disable(struct fc_vport *fc_vport, bool disable)
+@@ -2001,7 +2001,7 @@ qla24xx_vport_disable(struct fc_vport *fc_vport, bool disable)
return 0;
}
@@ -42687,7 +42665,7 @@ index b3db9dc..c3b1756 100644
.show_host_node_name = 1,
.show_host_port_name = 1,
-@@ -2018,7 +2018,7 @@ struct fc_function_template qla2xxx_transport_functions = {
+@@ -2048,7 +2048,7 @@ struct fc_function_template qla2xxx_transport_functions = {
.bsg_timeout = qla24xx_bsg_timeout,
};
@@ -42697,10 +42675,10 @@ index b3db9dc..c3b1756 100644
.show_host_node_name = 1,
.show_host_port_name = 1,
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
-index b310fa9..b9b3944 100644
+index 026bfde..90c4018 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
-@@ -523,8 +523,8 @@ extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *);
+@@ -528,8 +528,8 @@ extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *);
struct device_attribute;
extern struct device_attribute *qla2x00_host_attrs[];
struct fc_function_template;
@@ -42712,10 +42690,10 @@ index b310fa9..b9b3944 100644
extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
extern void qla2x00_init_host_attr(scsi_qla_host_t *);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
-index 2c6dd3d..e5ecd82 100644
+index ad72c1d..afc9a98 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
-@@ -1554,8 +1554,10 @@ qla2x00_config_dma_addressing(struct qla_hw_data *ha)
+@@ -1571,8 +1571,10 @@ qla2x00_config_dma_addressing(struct qla_hw_data *ha)
!pci_set_consistent_dma_mask(ha->pdev, DMA_BIT_MASK(64))) {
/* Ok, a 64bit DMA mask is applicable. */
ha->flags.enable_64bit_addressing = 1;
@@ -42729,10 +42707,10 @@ index 2c6dd3d..e5ecd82 100644
}
}
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
-index 129f5dd..ade53e8 100644
+index ddf16a8..80f4dd0 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
-@@ -275,7 +275,7 @@ struct ddb_entry {
+@@ -291,7 +291,7 @@ struct ddb_entry {
* (4000 only) */
atomic_t relogin_timer; /* Max Time to wait for
* relogin to complete */
@@ -42742,10 +42720,10 @@ index 129f5dd..ade53e8 100644
uint32_t default_time2wait; /* Default Min time between
* relogins (+aens) */
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
-index 6142729..b6a85c9 100644
+index 4d231c1..2892c37 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
-@@ -2622,12 +2622,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)
+@@ -2971,12 +2971,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)
*/
if (!iscsi_is_session_online(cls_sess)) {
/* Reset retry relogin timer */
@@ -42760,7 +42738,7 @@ index 6142729..b6a85c9 100644
ddb_entry->default_time2wait + 4));
set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags);
atomic_set(&ddb_entry->retry_relogin_timer,
-@@ -4742,7 +4742,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
+@@ -5081,7 +5081,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);
@@ -42783,10 +42761,10 @@ index 2c0d0ec..4e8681a 100644
/* check if the device is still usable */
if (unlikely(cmd->device->sdev_state == SDEV_DEL)) {
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
-index c31187d..0ead8c3 100644
+index 86d5220..f22c51a 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
-@@ -1459,7 +1459,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
+@@ -1458,7 +1458,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;
@@ -42795,7 +42773,7 @@ index c31187d..0ead8c3 100644
/*
* SCSI request completion path will do scsi_device_unbusy(),
-@@ -1485,9 +1485,9 @@ static void scsi_softirq_done(struct request *rq)
+@@ -1484,9 +1484,9 @@ static void scsi_softirq_done(struct request *rq)
INIT_LIST_HEAD(&cmd->eh_entry);
@@ -42834,10 +42812,10 @@ index 84a1fdf..693b0d6 100644
/*
* TODO: need to fixup sg_tablesize, max_segment_size,
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
-index e894ca7..de9d7660 100644
+index e106c27..11a380e 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
-@@ -498,7 +498,7 @@ static DECLARE_TRANSPORT_CLASS(fc_vport_class,
+@@ -497,7 +497,7 @@ static DECLARE_TRANSPORT_CLASS(fc_vport_class,
* Netlink Infrastructure
*/
@@ -42846,7 +42824,7 @@ index e894ca7..de9d7660 100644
/**
* fc_get_event_number - Obtain the next sequential FC event number
-@@ -511,7 +511,7 @@ static atomic_t fc_event_seq;
+@@ -510,7 +510,7 @@ static atomic_t fc_event_seq;
u32
fc_get_event_number(void)
{
@@ -42855,7 +42833,7 @@ index e894ca7..de9d7660 100644
}
EXPORT_SYMBOL(fc_get_event_number);
-@@ -659,7 +659,7 @@ static __init int fc_transport_init(void)
+@@ -654,7 +654,7 @@ static __init int fc_transport_init(void)
{
int error;
@@ -42864,7 +42842,7 @@ index e894ca7..de9d7660 100644
error = transport_class_register(&fc_host_class);
if (error)
-@@ -849,7 +849,7 @@ static int fc_str_to_dev_loss(const char *buf, unsigned long *val)
+@@ -844,7 +844,7 @@ static int fc_str_to_dev_loss(const char *buf, unsigned long *val)
char *cp;
*val = simple_strtoul(buf, &cp, 0);
@@ -42874,10 +42852,10 @@ index e894ca7..de9d7660 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 0a74b97..fa8d648 100644
+index 133926b..903000d 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
-@@ -79,7 +79,7 @@ struct iscsi_internal {
+@@ -80,7 +80,7 @@ struct iscsi_internal {
struct transport_container session_cont;
};
@@ -42886,7 +42864,7 @@ index 0a74b97..fa8d648 100644
static struct workqueue_struct *iscsi_eh_timer_workq;
static DEFINE_IDA(iscsi_sess_ida);
-@@ -1064,7 +1064,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
+@@ -1738,7 +1738,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
int err;
ihost = shost->shost_data;
@@ -42895,7 +42873,7 @@ index 0a74b97..fa8d648 100644
if (target_id == ISCSI_MAX_TARGET) {
id = ida_simple_get(&iscsi_sess_ida, 0, 0, GFP_KERNEL);
-@@ -2955,7 +2955,7 @@ static __init int iscsi_transport_init(void)
+@@ -3944,7 +3944,7 @@ static __init int iscsi_transport_init(void)
printk(KERN_INFO "Loading iSCSI transport class v%s.\n",
ISCSI_TRANSPORT_VERSION);
@@ -42936,10 +42914,10 @@ index f379c7f..e8fc69c 100644
transport_setup_device(&rport->dev);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
-index 82910cc..7c350ad 100644
+index c1c5552..1cf226c 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
-@@ -2929,7 +2929,7 @@ static int sd_probe(struct device *dev)
+@@ -2918,7 +2918,7 @@ static int sd_probe(struct device *dev)
sdkp->disk = gd;
sdkp->index = index;
atomic_set(&sdkp->openers, 0);
@@ -42949,10 +42927,10 @@ index 82910cc..7c350ad 100644
if (!sdp->request_queue->rq_timeout) {
if (sdp->type != TYPE_MOD)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
-index 9f0c465..47194ee 100644
+index df5e961..df6b97f 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
-@@ -1101,7 +1101,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
+@@ -1102,7 +1102,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
sdp->disk->disk_name,
MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
NULL,
@@ -42962,10 +42940,10 @@ index 9f0c465..47194ee 100644
return blk_trace_startstop(sdp->device->request_queue, 1);
case BLKTRACESTOP:
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
-index 004b10f..7c98d51 100644
+index 32b7bb1..2f1c4bd 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
-@@ -1620,7 +1620,7 @@ int spi_bus_unlock(struct spi_master *master)
+@@ -1631,7 +1631,7 @@ int spi_bus_unlock(struct spi_master *master)
EXPORT_SYMBOL_GPL(spi_bus_unlock);
/* portable code must never pass more than 32 bytes */
@@ -42974,19 +42952,19 @@ index 004b10f..7c98d51 100644
static u8 *buf;
-diff --git a/drivers/staging/iio/iio_hwmon.c b/drivers/staging/iio/iio_hwmon.c
-index 93af756..a4bc5bf 100644
---- a/drivers/staging/iio/iio_hwmon.c
-+++ b/drivers/staging/iio/iio_hwmon.c
-@@ -67,7 +67,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
+diff --git a/drivers/staging/media/solo6x10/solo6x10-core.c b/drivers/staging/media/solo6x10/solo6x10-core.c
+index 3675020..e80d92c 100644
+--- a/drivers/staging/media/solo6x10/solo6x10-core.c
++++ b/drivers/staging/media/solo6x10/solo6x10-core.c
+@@ -434,7 +434,7 @@ static void solo_device_release(struct device *dev)
+
+ static int solo_sysfs_init(struct solo_dev *solo_dev)
{
- struct device *dev = &pdev->dev;
- struct iio_hwmon_state *st;
-- struct sensor_device_attribute *a;
-+ sensor_device_attribute_no_const *a;
- int ret, i;
- int in_i = 1, temp_i = 1, curr_i = 1;
- enum iio_chan_type type;
+- struct bin_attribute *sdram_attr = &solo_dev->sdram_attr;
++ bin_attribute_no_const *sdram_attr = &solo_dev->sdram_attr;
+ struct device *dev = &solo_dev->dev;
+ const char *driver;
+ int i;
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 34afc16..ffe44dd 100644
--- a/drivers/staging/octeon/ethernet-rx.c
@@ -43066,7 +43044,7 @@ index 1f5088b..0e59820 100644
return 0;
diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h
-index 5dddc4d..34fcb2f 100644
+index a863a98..d272795 100644
--- a/drivers/staging/usbip/vhci.h
+++ b/drivers/staging/usbip/vhci.h
@@ -83,7 +83,7 @@ struct vhci_hcd {
@@ -43079,7 +43057,7 @@ index 5dddc4d..34fcb2f 100644
/*
* NOTE:
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
-index f1ca084..7b5c0c3 100644
+index d7974cb..d78076b 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -441,7 +441,7 @@ static void vhci_tx_urb(struct urb *urb)
@@ -43110,10 +43088,10 @@ index f1ca084..7b5c0c3 100644
hcd->power_budget = 0; /* no limit */
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c
-index faf8e60..c46f8ab 100644
+index d07fcb5..358e1e1 100644
--- a/drivers/staging/usbip/vhci_rx.c
+++ b/drivers/staging/usbip/vhci_rx.c
-@@ -76,7 +76,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,
+@@ -80,7 +80,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,
if (!urb) {
pr_err("cannot find a urb of seqnum %u\n", pdu->base.seqnum);
pr_info("max seqnum %d\n",
@@ -43123,10 +43101,10 @@ index faf8e60..c46f8ab 100644
return;
}
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
-index 5f13890..36a044b 100644
+index 8417c2f..ef5ebd6 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
-@@ -73,14 +73,13 @@ static int msglevel =MSG_LEVEL_INFO;
+@@ -69,14 +69,13 @@ static int msglevel = MSG_LEVEL_INFO;
*
*/
@@ -43134,17 +43112,17 @@ index 5f13890..36a044b 100644
+
static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
{
- PSDevice apdev_priv;
+ PSDevice apdev_priv;
struct net_device *dev = pDevice->dev;
int ret;
- const struct net_device_ops apdev_netdev_ops = {
- .ndo_start_xmit = pDevice->tx_80211,
- };
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
-@@ -92,6 +91,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
- *apdev_priv = *pDevice;
+@@ -88,6 +87,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
+ *apdev_priv = *pDevice;
memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN);
+ /* only half broken now */
@@ -43153,7 +43131,7 @@ index 5f13890..36a044b 100644
pDevice->apdev->type = ARPHRD_IEEE80211;
diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c
-index a94e66f..31984d0 100644
+index c699a30..b90a5fd 100644
--- a/drivers/staging/vt6656/hostap.c
+++ b/drivers/staging/vt6656/hostap.c
@@ -60,14 +60,13 @@ static int msglevel =MSG_LEVEL_INFO;
@@ -43183,10 +43161,10 @@ index a94e66f..31984d0 100644
pDevice->apdev->type = ARPHRD_IEEE80211;
diff --git a/drivers/staging/zcache/tmem.c b/drivers/staging/zcache/tmem.c
-index a2b7e03..9ff4bbd 100644
+index d7e51e4..d07eaab 100644
--- a/drivers/staging/zcache/tmem.c
+++ b/drivers/staging/zcache/tmem.c
-@@ -50,7 +50,7 @@
+@@ -51,7 +51,7 @@
* A tmem host implementation must use this function to register callbacks
* for memory allocation.
*/
@@ -43195,7 +43173,7 @@ index a2b7e03..9ff4bbd 100644
static void tmem_objnode_tree_init(void);
-@@ -64,7 +64,7 @@ void tmem_register_hostops(struct tmem_hostops *m)
+@@ -65,7 +65,7 @@ void tmem_register_hostops(struct tmem_hostops *m)
* A tmem host implementation must use this function to register
* callbacks for a page-accessible memory (PAM) implementation.
*/
@@ -43205,7 +43183,7 @@ index a2b7e03..9ff4bbd 100644
void tmem_register_pamops(struct tmem_pamops *m)
{
diff --git a/drivers/staging/zcache/tmem.h b/drivers/staging/zcache/tmem.h
-index adbe5a8..d387359 100644
+index d128ce2..a43980c 100644
--- a/drivers/staging/zcache/tmem.h
+++ b/drivers/staging/zcache/tmem.h
@@ -226,6 +226,7 @@ struct tmem_pamops {
@@ -43225,10 +43203,10 @@ index adbe5a8..d387359 100644
/* core tmem accessor functions */
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
-index 2e4d655..fd72e68 100644
+index 4630481..c26782a 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
-@@ -1414,7 +1414,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
+@@ -1400,7 +1400,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
spin_lock_init(&dev->se_port_lock);
spin_lock_init(&dev->se_tmr_lock);
spin_lock_init(&dev->qf_cmd_lock);
@@ -43238,10 +43216,10 @@ index 2e4d655..fd72e68 100644
spin_lock_init(&dev->t10_wwn.t10_vpd_lock);
INIT_LIST_HEAD(&dev->t10_pr.registration_list);
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
-index fc9a5a0..1d5975e 100644
+index 21e3158..43c6004 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
-@@ -1081,7 +1081,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd)
+@@ -1080,7 +1080,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd)
* Used to determine when ORDERED commands should go from
* Dormant to Active status.
*/
@@ -43251,10 +43229,10 @@ index fc9a5a0..1d5975e 100644
pr_debug("Allocated se_ordered_id: %u for Task Attr: 0x%02x on %s\n",
cmd->se_ordered_id, cmd->sam_task_attr,
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
-index 345bd0e..61d5375 100644
+index 33f83fe..d80f8e1 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
-@@ -1576,10 +1576,10 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
+@@ -1570,10 +1570,10 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
printk(KERN_DEBUG "cyc:cy_open ttyC%d, count = %d\n", info->line,
info->port.count);
#endif
@@ -43267,7 +43245,7 @@ index 345bd0e..61d5375 100644
#endif
/*
-@@ -3978,7 +3978,7 @@ static int cyclades_proc_show(struct seq_file *m, void *v)
+@@ -3972,7 +3972,7 @@ static int cyclades_proc_show(struct seq_file *m, void *v)
for (j = 0; j < cy_card[i].nports; j++) {
info = &cy_card[i].ports[j];
@@ -43549,10 +43527,10 @@ index 8fd72ff..34a0bed 100644
ipwireless_disassociate_network_ttys(network,
ttyj->channel_idx);
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
-index adeac25..787a0a1 100644
+index 1deaca4..c8582d4 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
-@@ -1193,7 +1193,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
+@@ -1189,7 +1189,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
}
ch = &brd->ports[port % MAX_PORTS_PER_BOARD];
@@ -43562,10 +43540,10 @@ index adeac25..787a0a1 100644
tty_port_tty_set(&ch->port, tty);
mutex_lock(&ch->port.mutex);
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
-index 4a43ef5d7..aa71f27 100644
+index 6422390..49003ac8 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
-@@ -1636,7 +1636,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
+@@ -1632,7 +1632,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
spin_lock_init(&dlci->lock);
mutex_init(&dlci->mutex);
dlci->fifo = &dlci->_fifo;
@@ -43574,7 +43552,7 @@ index 4a43ef5d7..aa71f27 100644
kfree(dlci);
return NULL;
}
-@@ -2936,7 +2936,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
+@@ -2932,7 +2932,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
struct gsm_dlci *dlci = tty->driver_data;
struct tty_port *port = &dlci->port;
@@ -43584,10 +43562,10 @@ index 4a43ef5d7..aa71f27 100644
dlci_get(dlci->gsm->dlci[0]);
mux_get(dlci->gsm);
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
-index 1f8cba6..47b06c2 100644
+index 6c7fe90..9241dab 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
-@@ -2205,6 +2205,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
+@@ -2203,6 +2203,7 @@ void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
{
*ops = tty_ldisc_N_TTY;
ops->owner = NULL;
@@ -43597,10 +43575,10 @@ index 1f8cba6..47b06c2 100644
}
EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
-index 74a5e8b..40c36a7 100644
+index abfd990..5ab5da9 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
-@@ -797,8 +797,10 @@ static void __init unix98_pty_init(void)
+@@ -796,8 +796,10 @@ static void __init unix98_pty_init(void)
panic("Couldn't register Unix98 pts driver");
/* Now create the /dev/ptmx special device */
@@ -43613,10 +43591,10 @@ index 74a5e8b..40c36a7 100644
cdev_init(&ptmx_cdev, &ptmx_fops);
if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
-index 1d27003..959f452 100644
+index 354564e..fe50d9a 100644
--- a/drivers/tty/rocket.c
+++ b/drivers/tty/rocket.c
-@@ -923,7 +923,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
+@@ -914,7 +914,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
tty->driver_data = info;
tty_port_tty_set(port, tty);
@@ -43625,7 +43603,7 @@ index 1d27003..959f452 100644
atomic_inc(&rp_num_ports_open);
#ifdef ROCKET_DEBUG_OPEN
-@@ -932,7 +932,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
+@@ -923,7 +923,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
#endif
}
#ifdef ROCKET_DEBUG_OPEN
@@ -43634,7 +43612,7 @@ index 1d27003..959f452 100644
#endif
/*
-@@ -1527,7 +1527,7 @@ static void rp_hangup(struct tty_struct *tty)
+@@ -1515,7 +1515,7 @@ static void rp_hangup(struct tty_struct *tty)
spin_unlock_irqrestore(&info->port.lock, flags);
return;
}
@@ -43750,10 +43728,10 @@ index 1002054..dd644a8 100644
/* This is only available if kgdboc is a built in for early debugging */
static int __init kgdboc_early_init(char *opt)
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
-index 2769a38..f3dbe48 100644
+index 0c8a9fa..234a95f 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
-@@ -451,11 +451,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
+@@ -453,11 +453,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
}
}
@@ -43770,7 +43748,7 @@ index 2769a38..f3dbe48 100644
dbg("s3c24xx_serial_startup: port=%p (%08lx,%p)\n",
port->mapbase, port->membase);
-@@ -1120,10 +1125,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
+@@ -1124,10 +1129,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
/* setup info for port */
port->dev = &platdev->dev;
@@ -43782,7 +43760,7 @@ index 2769a38..f3dbe48 100644
if (cfg->uart_flags & UPF_CONS_FLOW) {
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
-index 8fbb6d2..822a9e6 100644
+index f87dbfd..42ad4b1 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1454,7 +1454,7 @@ static void uart_hangup(struct tty_struct *tty)
@@ -43822,10 +43800,10 @@ index 8fbb6d2..822a9e6 100644
goto end;
}
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
-index 8983276..72a4090 100644
+index 8eaf1ab..85c030d 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
-@@ -3093,7 +3093,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
+@@ -3090,7 +3090,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgsl_close(%s) entry, count=%d\n",
@@ -43834,7 +43812,7 @@ index 8983276..72a4090 100644
if (tty_port_close_start(&info->port, tty, filp) == 0)
goto cleanup;
-@@ -3111,7 +3111,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
+@@ -3108,7 +3108,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
cleanup:
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgsl_close(%s) exit, count=%d\n", __FILE__,__LINE__,
@@ -43843,7 +43821,7 @@ index 8983276..72a4090 100644
} /* end of mgsl_close() */
-@@ -3210,8 +3210,8 @@ static void mgsl_hangup(struct tty_struct *tty)
+@@ -3207,8 +3207,8 @@ static void mgsl_hangup(struct tty_struct *tty)
mgsl_flush_buffer(tty);
shutdown(info);
@@ -43854,7 +43832,7 @@ index 8983276..72a4090 100644
info->port.flags &= ~ASYNC_NORMAL_ACTIVE;
info->port.tty = NULL;
-@@ -3300,12 +3300,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
+@@ -3297,12 +3297,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):block_til_ready before block on %s count=%d\n",
@@ -43869,7 +43847,7 @@ index 8983276..72a4090 100644
}
spin_unlock_irqrestore(&info->irq_spinlock, flags);
port->blocked_open++;
-@@ -3334,7 +3334,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
+@@ -3331,7 +3331,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):block_til_ready blocking on %s count=%d\n",
@@ -43878,7 +43856,7 @@ index 8983276..72a4090 100644
tty_unlock(tty);
schedule();
-@@ -3346,12 +3346,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
+@@ -3343,12 +3343,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
/* FIXME: Racy on hangup during close wait */
if (extra_count)
@@ -43893,7 +43871,7 @@ index 8983276..72a4090 100644
if (!retval)
port->flags |= ASYNC_NORMAL_ACTIVE;
-@@ -3403,7 +3403,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
+@@ -3400,7 +3400,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgsl_open(%s), old ref count = %d\n",
@@ -43902,7 +43880,7 @@ index 8983276..72a4090 100644
/* If port is closing, signal caller to try again */
if (tty_hung_up_p(filp) || info->port.flags & ASYNC_CLOSING){
-@@ -3422,10 +3422,10 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
+@@ -3419,10 +3419,10 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
spin_unlock_irqrestore(&info->netlock, flags);
goto cleanup;
}
@@ -43915,7 +43893,7 @@ index 8983276..72a4090 100644
/* 1st open on this device, init hardware */
retval = startup(info);
if (retval < 0)
-@@ -3449,8 +3449,8 @@ cleanup:
+@@ -3446,8 +3446,8 @@ cleanup:
if (retval) {
if (tty->count == 1)
info->port.tty = NULL; /* tty layer will release tty struct */
@@ -43926,7 +43904,7 @@ index 8983276..72a4090 100644
}
return retval;
-@@ -7668,7 +7668,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
+@@ -7665,7 +7665,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
unsigned short new_crctype;
/* return error if TTY interface open */
@@ -43935,7 +43913,7 @@ index 8983276..72a4090 100644
return -EBUSY;
switch (encoding)
-@@ -7763,7 +7763,7 @@ static int hdlcdev_open(struct net_device *dev)
+@@ -7760,7 +7760,7 @@ static int hdlcdev_open(struct net_device *dev)
/* arbitrate between network and tty opens */
spin_lock_irqsave(&info->netlock, flags);
@@ -43944,7 +43922,7 @@ index 8983276..72a4090 100644
printk(KERN_WARNING "%s: hdlc_open returning busy\n", dev->name);
spin_unlock_irqrestore(&info->netlock, flags);
return -EBUSY;
-@@ -7849,7 +7849,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+@@ -7846,7 +7846,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
printk("%s:hdlcdev_ioctl(%s)\n",__FILE__,dev->name);
/* return error if TTY interface open */
@@ -43954,7 +43932,7 @@ index 8983276..72a4090 100644
if (cmd != SIOCWANDEV)
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
-index aa9eece..d8baaec 100644
+index 1abf946..1ee34fc 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -670,7 +670,7 @@ static int open(struct tty_struct *tty, struct file *filp)
@@ -44072,7 +44050,7 @@ index aa9eece..d8baaec 100644
if (!retval)
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
-index 6d5780c..aa4d8cd 100644
+index ff17138..e38b41e 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -750,7 +750,7 @@ static int open(struct tty_struct *tty, struct file *filp)
@@ -44211,10 +44189,10 @@ index 6d5780c..aa4d8cd 100644
if (!retval)
port->flags |= ASYNC_NORMAL_ACTIVE;
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
-index 3687f0c..6b9b808 100644
+index b51c154..17d55d1 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
-@@ -995,7 +995,7 @@ EXPORT_SYMBOL(unregister_sysrq_key);
+@@ -1022,7 +1022,7 @@ EXPORT_SYMBOL(unregister_sysrq_key);
static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
@@ -44224,10 +44202,10 @@ index 3687f0c..6b9b808 100644
if (get_user(c, buf))
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
-index a9cd0b9..47b9336 100644
+index 6464029..9ff6738 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
-@@ -3398,7 +3398,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
+@@ -3464,7 +3464,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
void tty_default_fops(struct file_operations *fops)
{
@@ -44237,19 +44215,10 @@ index a9cd0b9..47b9336 100644
/*
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
-index d794087..e4f49e5 100644
+index 1afe192..73d2c20 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
-@@ -56,7 +56,7 @@ static void put_ldisc(struct tty_ldisc *ld)
- if (atomic_dec_and_test(&ld->users)) {
- struct tty_ldisc_ops *ldo = ld->ops;
-
-- ldo->refcount--;
-+ atomic_dec(&ldo->refcount);
- module_put(ldo->owner);
- raw_spin_unlock_irqrestore(&tty_ldisc_lock, flags);
-
-@@ -93,7 +93,7 @@ int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc)
+@@ -66,7 +66,7 @@ int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc)
raw_spin_lock_irqsave(&tty_ldisc_lock, flags);
tty_ldiscs[disc] = new_ldisc;
new_ldisc->num = disc;
@@ -44258,7 +44227,7 @@ index d794087..e4f49e5 100644
raw_spin_unlock_irqrestore(&tty_ldisc_lock, flags);
return ret;
-@@ -121,7 +121,7 @@ int tty_unregister_ldisc(int disc)
+@@ -94,7 +94,7 @@ int tty_unregister_ldisc(int disc)
return -EINVAL;
raw_spin_lock_irqsave(&tty_ldisc_lock, flags);
@@ -44267,7 +44236,7 @@ index d794087..e4f49e5 100644
ret = -EBUSY;
else
tty_ldiscs[disc] = NULL;
-@@ -142,7 +142,7 @@ static struct tty_ldisc_ops *get_ldops(int disc)
+@@ -115,7 +115,7 @@ static struct tty_ldisc_ops *get_ldops(int disc)
if (ldops) {
ret = ERR_PTR(-EAGAIN);
if (try_module_get(ldops->owner)) {
@@ -44276,7 +44245,7 @@ index d794087..e4f49e5 100644
ret = ldops;
}
}
-@@ -155,7 +155,7 @@ static void put_ldops(struct tty_ldisc_ops *ldops)
+@@ -128,7 +128,7 @@ static void put_ldops(struct tty_ldisc_ops *ldops)
unsigned long flags;
raw_spin_lock_irqsave(&tty_ldisc_lock, flags);
@@ -44285,20 +44254,29 @@ index d794087..e4f49e5 100644
module_put(ldops->owner);
raw_spin_unlock_irqrestore(&tty_ldisc_lock, flags);
}
+@@ -196,7 +196,7 @@ static inline void tty_ldisc_put(struct tty_ldisc *ld)
+ /* unreleased reader reference(s) will cause this WARN */
+ WARN_ON(!atomic_dec_and_test(&ld->users));
+
+- ld->ops->refcount--;
++ atomic_dec(&ld->ops->refcount);
+ module_put(ld->ops->owner);
+ kfree(ld);
+ raw_spin_unlock_irqrestore(&tty_ldisc_lock, flags);
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
-index b7ff59d..7c6105e 100644
+index 121aeb9..0d2c4b9 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
-@@ -218,7 +218,7 @@ void tty_port_hangup(struct tty_port *port)
+@@ -232,7 +232,7 @@ void tty_port_hangup(struct tty_port *port)
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
- port->count = 0;
+ atomic_set(&port->count, 0);
port->flags &= ~ASYNC_NORMAL_ACTIVE;
- if (port->tty) {
- set_bit(TTY_IO_ERROR, &port->tty->flags);
-@@ -344,7 +344,7 @@ int tty_port_block_til_ready(struct tty_port *port,
+ tty = port->tty;
+ if (tty)
+@@ -391,7 +391,7 @@ int tty_port_block_til_ready(struct tty_port *port,
/* The port lock protects the port counts */
spin_lock_irqsave(&port->lock, flags);
if (!tty_hung_up_p(filp))
@@ -44307,7 +44285,7 @@ index b7ff59d..7c6105e 100644
port->blocked_open++;
spin_unlock_irqrestore(&port->lock, flags);
-@@ -386,7 +386,7 @@ int tty_port_block_til_ready(struct tty_port *port,
+@@ -433,7 +433,7 @@ int tty_port_block_til_ready(struct tty_port *port,
we must not mess that up further */
spin_lock_irqsave(&port->lock, flags);
if (!tty_hung_up_p(filp))
@@ -44316,7 +44294,7 @@ index b7ff59d..7c6105e 100644
port->blocked_open--;
if (retval == 0)
port->flags |= ASYNC_NORMAL_ACTIVE;
-@@ -406,19 +406,19 @@ int tty_port_close_start(struct tty_port *port,
+@@ -467,19 +467,19 @@ int tty_port_close_start(struct tty_port *port,
return 0;
}
@@ -44343,7 +44321,7 @@ index b7ff59d..7c6105e 100644
spin_unlock_irqrestore(&port->lock, flags);
if (port->ops->drop)
port->ops->drop(port);
-@@ -516,7 +516,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
+@@ -565,7 +565,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
{
spin_lock_irq(&port->lock);
if (!tty_hung_up_p(filp))
@@ -44522,7 +44500,7 @@ index 8a7eb77..c00402f 100644
pos += tmp;
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
-index 35f10bf..6a38a0b 100644
+index d3527dd..26effa2 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -333,7 +333,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
@@ -44636,7 +44614,7 @@ index 2a3bbdf..91d72cf 100644
file->f_version = event_count;
return POLLIN | POLLRDNORM;
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
-index f9ec44c..eb5779f 100644
+index d53547d..6a22d02 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1526,7 +1526,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)
@@ -44671,7 +44649,7 @@ index 444d30e..f15c850 100644
__u16 size, int timeout)
{
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
-index 3f81a3d..a3aa993 100644
+index aa38db4..0a08682 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -239,7 +239,7 @@ show_urbnum(struct device *dev, struct device_attribute *attr, char *buf)
@@ -44684,10 +44662,10 @@ index 3f81a3d..a3aa993 100644
static DEVICE_ATTR(urbnum, S_IRUGO, show_urbnum, NULL);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
-index f81b925..78d22ec 100644
+index b10da72..43aa0b2 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
-@@ -388,7 +388,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
+@@ -389,7 +389,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
set_dev_node(&dev->dev, dev_to_node(bus->controller));
dev->state = USB_STATE_ATTACHED;
dev->lpm_disable_count = 1;
@@ -44853,19 +44831,6 @@ index 5f3bcd3..bfca43f 100644
usb_autopm_put_interface(serial->interface);
error_get_interface:
usb_serial_put(serial);
-diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
-index 6c3586a..a94e621 100644
---- a/drivers/usb/storage/realtek_cr.c
-+++ b/drivers/usb/storage/realtek_cr.c
-@@ -429,7 +429,7 @@ static int rts51x_read_status(struct us_data *us,
-
- buf = kmalloc(len, GFP_NOIO);
- if (buf == NULL)
-- return USB_STOR_TRANSPORT_ERROR;
-+ return -ENOMEM;
-
- US_DEBUGP("%s, lun = %d\n", __func__, lun);
-
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 75f70f0..d467e1a 100644
--- a/drivers/usb/storage/usb.h
@@ -44914,6 +44879,19 @@ index 6ef94bc..1b41265 100644
}
/*
+diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
+index 5174eba..86e764a 100644
+--- a/drivers/vhost/vringh.c
++++ b/drivers/vhost/vringh.c
+@@ -800,7 +800,7 @@ static inline int getu16_kern(u16 *val, const u16 *p)
+
+ static inline int putu16_kern(u16 *p, u16 val)
+ {
+- ACCESS_ONCE(*p) = val;
++ ACCESS_ONCE_RW(*p) = val;
+ return 0;
+ }
+
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 8c55011..eed4ae1a 100644
--- a/drivers/video/aty/aty128fb.c
@@ -44972,7 +44950,7 @@ index 95ec042..e6affdd 100644
return 0;
}
diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c
-index 6c5ed6b..b727c88 100644
+index bca6ccc..252107e 100644
--- a/drivers/video/backlight/kb3886_bl.c
+++ b/drivers/video/backlight/kb3886_bl.c
@@ -78,7 +78,7 @@ static struct kb3886bl_machinfo *bl_machinfo;
@@ -45023,7 +45001,7 @@ index 5c3960d..15cf8fc 100644
goto out1;
}
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
-index 86291dc..7cc5962 100644
+index 098bfc6..796841d 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,
@@ -47887,7 +47865,7 @@ index 0d6f2cd..6285b97 100644
ret_code = device_register(&new_dev->dev);
if (ret_code) {
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
-index 76d9053..dec2bfd 100644
+index 05c2dc3..ea1f391 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -881,8 +881,10 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
@@ -47904,10 +47882,10 @@ index 76d9053..dec2bfd 100644
FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA;
break;
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c
-index 97bd662..39fab85 100644
+index b2b33fc..f9f4658 100644
--- a/drivers/video/smscufx.c
+++ b/drivers/video/smscufx.c
-@@ -1171,7 +1171,9 @@ static int ufx_ops_release(struct fb_info *info, int user)
+@@ -1175,7 +1175,9 @@ static int ufx_ops_release(struct fb_info *info, int user)
fb_deferred_io_cleanup(info);
kfree(info->fbdefio);
info->fbdefio = NULL;
@@ -47919,10 +47897,10 @@ index 97bd662..39fab85 100644
pr_debug("released /dev/fb%d user=%d count=%d",
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
-index 86d449e..8e04dc5 100644
+index ec03e72..f578436 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
-@@ -619,11 +619,11 @@ int dlfb_handle_damage(struct dlfb_data *dev, int x, int y,
+@@ -623,11 +623,11 @@ int dlfb_handle_damage(struct dlfb_data *dev, int x, int y,
dlfb_urb_completion(urb);
error:
@@ -47938,7 +47916,7 @@ index 86d449e..8e04dc5 100644
>> 10)), /* Kcycles */
&dev->cpu_kcycles_used);
-@@ -744,11 +744,11 @@ static void dlfb_dpy_deferred_io(struct fb_info *info,
+@@ -748,11 +748,11 @@ static void dlfb_dpy_deferred_io(struct fb_info *info,
dlfb_urb_completion(urb);
error:
@@ -47954,7 +47932,7 @@ index 86d449e..8e04dc5 100644
>> 10)), /* Kcycles */
&dev->cpu_kcycles_used);
}
-@@ -989,7 +989,9 @@ static int dlfb_ops_release(struct fb_info *info, int user)
+@@ -993,7 +993,9 @@ static int dlfb_ops_release(struct fb_info *info, int user)
fb_deferred_io_cleanup(info);
kfree(info->fbdefio);
info->fbdefio = NULL;
@@ -47965,7 +47943,7 @@ index 86d449e..8e04dc5 100644
}
pr_warn("released /dev/fb%d user=%d count=%d\n",
-@@ -1372,7 +1374,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev,
+@@ -1376,7 +1378,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",
@@ -47974,7 +47952,7 @@ index 86d449e..8e04dc5 100644
}
static ssize_t metrics_bytes_identical_show(struct device *fbdev,
-@@ -1380,7 +1382,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev,
+@@ -1384,7 +1386,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",
@@ -47983,7 +47961,7 @@ index 86d449e..8e04dc5 100644
}
static ssize_t metrics_bytes_sent_show(struct device *fbdev,
-@@ -1388,7 +1390,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev,
+@@ -1392,7 +1394,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",
@@ -47992,7 +47970,7 @@ index 86d449e..8e04dc5 100644
}
static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
-@@ -1396,7 +1398,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
+@@ -1400,7 +1402,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",
@@ -48001,7 +47979,7 @@ index 86d449e..8e04dc5 100644
}
static ssize_t edid_show(
-@@ -1456,10 +1458,10 @@ static ssize_t metrics_reset_store(struct device *fbdev,
+@@ -1460,10 +1462,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;
@@ -48017,7 +47995,7 @@ index 86d449e..8e04dc5 100644
return count;
}
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
-index d428445..79a78df 100644
+index e328a61..1b08ecb 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -19,6 +19,7 @@
@@ -48282,10 +48260,10 @@ index fef20db..d28b1ab 100644
return -ENOMEM;
return 0;
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
-index 0ad61c6..f198bd7 100644
+index 055562c..fdfb10d 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
-@@ -185,7 +185,7 @@ static int v9fs_vfs_writepage_locked(struct page *page)
+@@ -186,7 +186,7 @@ static int v9fs_vfs_writepage_locked(struct page *page)
retval = v9fs_file_write_internal(inode,
v9inode->writeback_fid,
@@ -48308,10 +48286,10 @@ index d86edc8..40ff2fb 100644
p9_debug(P9_DEBUG_VFS, " %s %s\n",
dentry->d_name.name, IS_ERR(s) ? "<error>" : s);
diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
-index 0efd152..b5802ad 100644
+index 370b24c..ff0be7b 100644
--- a/fs/Kconfig.binfmt
+++ b/fs/Kconfig.binfmt
-@@ -89,7 +89,7 @@ config HAVE_AOUT
+@@ -103,7 +103,7 @@ config HAVE_AOUT
config BINFMT_AOUT
tristate "Kernel support for a.out and ECOFF binaries"
@@ -48321,10 +48299,10 @@ index 0efd152..b5802ad 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 1dc8786..d3b29e8 100644
+index 2bbcacf..8614116 100644
--- a/fs/aio.c
+++ b/fs/aio.c
-@@ -111,7 +111,7 @@ static int aio_setup_ring(struct kioctx *ctx)
+@@ -160,7 +160,7 @@ static int aio_setup_ring(struct kioctx *ctx)
size += sizeof(struct io_event) * nr_events;
nr_pages = (size + PAGE_SIZE-1) >> PAGE_SHIFT;
@@ -48333,39 +48311,39 @@ index 1dc8786..d3b29e8 100644
return -EINVAL;
nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) / sizeof(struct io_event);
-@@ -1375,18 +1375,19 @@ static ssize_t aio_fsync(struct kiocb *iocb)
- static ssize_t aio_setup_vectored_rw(int type, struct kiocb *kiocb, bool compat)
+@@ -950,6 +950,7 @@ static ssize_t aio_rw_vect_retry(struct kiocb *iocb, int rw, aio_rw_op *rw_op)
+ static ssize_t aio_setup_vectored_rw(int rw, struct kiocb *kiocb, bool compat)
{
ssize_t ret;
+ struct iovec iovstack;
- #ifdef CONFIG_COMPAT
+ kiocb->ki_nr_segs = kiocb->ki_nbytes;
+
+@@ -957,17 +958,22 @@ static ssize_t aio_setup_vectored_rw(int rw, struct kiocb *kiocb, bool compat)
if (compat)
- ret = compat_rw_copy_check_uvector(type,
+ ret = compat_rw_copy_check_uvector(rw,
(struct compat_iovec __user *)kiocb->ki_buf,
-- kiocb->ki_nbytes, 1, &kiocb->ki_inline_vec,
-+ kiocb->ki_nbytes, 1, &iovstack,
+- kiocb->ki_nr_segs, 1, &kiocb->ki_inline_vec,
++ kiocb->ki_nr_segs, 1, &iovstack,
&kiocb->ki_iovec);
else
#endif
- ret = rw_copy_check_uvector(type,
+ ret = rw_copy_check_uvector(rw,
(struct iovec __user *)kiocb->ki_buf,
-- kiocb->ki_nbytes, 1, &kiocb->ki_inline_vec,
-+ kiocb->ki_nbytes, 1, &iovstack,
+- kiocb->ki_nr_segs, 1, &kiocb->ki_inline_vec,
++ kiocb->ki_nr_segs, 1, &iovstack,
&kiocb->ki_iovec);
if (ret < 0)
- goto out;
-@@ -1395,6 +1396,10 @@ static ssize_t aio_setup_vectored_rw(int type, struct kiocb *kiocb, bool compat)
- if (ret < 0)
- goto out;
+ return ret;
+ if (kiocb->ki_iovec == &iovstack) {
+ kiocb->ki_inline_vec = iovstack;
+ kiocb->ki_iovec = &kiocb->ki_inline_vec;
+ }
- kiocb->ki_nr_segs = kiocb->ki_nbytes;
- kiocb->ki_cur_seg = 0;
- /* ki_nbytes/left now reflect bytes instead of segs */
++
+ /* ki_nbytes now reflect bytes instead of segs */
+ kiocb->ki_nbytes = ret;
+ return 0;
diff --git a/fs/attr.c b/fs/attr.c
index 1449adb..a2038c2 100644
--- a/fs/attr.c
@@ -48438,7 +48416,7 @@ index 2722387..c8dd2a7 100644
{
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
-index 8615ee8..388ed68 100644
+index f95dddc..b1e2c1c 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -510,7 +510,7 @@ static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
@@ -48451,7 +48429,7 @@ index 8615ee8..388ed68 100644
kfree(link);
}
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
-index bbc8f88..7c7ac97 100644
+index bce8769..7fc7544 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -16,6 +16,7 @@
@@ -48471,7 +48449,7 @@ index bbc8f88..7c7ac97 100644
fs = get_fs();
set_fs(KERNEL_DS);
has_dumped = 1;
-@@ -70,10 +73,12 @@ static int aout_core_dump(struct coredump_params *cprm)
+@@ -69,10 +72,12 @@ static int aout_core_dump(struct coredump_params *cprm)
/* If the size of the dump file exceeds the rlimit, then see what would happen
if we wrote the stack, but not the data area. */
@@ -48484,7 +48462,7 @@ index bbc8f88..7c7ac97 100644
if ((dump.u_ssize + 1) * PAGE_SIZE > cprm->limit)
dump.u_ssize = 0;
-@@ -234,6 +239,8 @@ static int load_aout_binary(struct linux_binprm * bprm)
+@@ -233,6 +238,8 @@ static int load_aout_binary(struct linux_binprm * bprm)
rlim = rlimit(RLIMIT_DATA);
if (rlim >= RLIM_INFINITY)
rlim = ~0;
@@ -48493,7 +48471,7 @@ index bbc8f88..7c7ac97 100644
if (ex.a_data + ex.a_bss > rlim)
return -ENOMEM;
-@@ -268,6 +275,27 @@ static int load_aout_binary(struct linux_binprm * bprm)
+@@ -267,6 +274,27 @@ static int load_aout_binary(struct linux_binprm * bprm)
install_exec_creds(bprm);
@@ -48521,7 +48499,7 @@ index bbc8f88..7c7ac97 100644
if (N_MAGIC(ex) == OMAGIC) {
unsigned long text_addr, map_size;
loff_t pos;
-@@ -333,7 +361,7 @@ static int load_aout_binary(struct linux_binprm * bprm)
+@@ -324,7 +352,7 @@ static int load_aout_binary(struct linux_binprm * bprm)
}
error = vm_mmap(bprm->file, N_DATADDR(ex), ex.a_data,
@@ -48531,7 +48509,7 @@ index bbc8f88..7c7ac97 100644
fd_offset + ex.a_text);
if (error != N_DATADDR(ex)) {
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
-index 86af964..5d53bf6 100644
+index f8a0b0e..8186af0 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -34,6 +34,7 @@
@@ -48604,16 +48582,16 @@ index 86af964..5d53bf6 100644
get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes));
- u_rand_bytes = (elf_addr_t __user *)
- STACK_ALLOC(p, sizeof(k_rand_bytes));
-+ srandom32(k_rand_bytes[0] ^ random32());
-+ srandom32(k_rand_bytes[1] ^ random32());
-+ srandom32(k_rand_bytes[2] ^ random32());
-+ srandom32(k_rand_bytes[3] ^ random32());
++ prandom_seed(k_rand_bytes[0] ^ prandom_u32());
++ prandom_seed(k_rand_bytes[1] ^ prandom_u32());
++ prandom_seed(k_rand_bytes[2] ^ prandom_u32());
++ prandom_seed(k_rand_bytes[3] ^ prandom_u32());
+ p = STACK_ROUND(p, sizeof(k_rand_bytes));
+ u_rand_bytes = (elf_addr_t __user *) p;
if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes)))
return -EFAULT;
-@@ -315,9 +332,11 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
+@@ -318,9 +335,11 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
return -EFAULT;
current->mm->env_end = p;
@@ -48626,7 +48604,7 @@ index 86af964..5d53bf6 100644
return -EFAULT;
return 0;
}
-@@ -385,15 +404,14 @@ static unsigned long total_mapping_size(struct elf_phdr *cmds, int nr)
+@@ -388,15 +407,14 @@ static unsigned long total_mapping_size(struct elf_phdr *cmds, int nr)
an ELF header */
static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
@@ -48645,7 +48623,7 @@ index 86af964..5d53bf6 100644
unsigned long total_size;
int retval, i, size;
-@@ -439,6 +457,11 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
+@@ -442,6 +460,11 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
goto out_close;
}
@@ -48657,7 +48635,7 @@ index 86af964..5d53bf6 100644
eppnt = elf_phdata;
for (i = 0; i < interp_elf_ex->e_phnum; i++, eppnt++) {
if (eppnt->p_type == PT_LOAD) {
-@@ -462,8 +485,6 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
+@@ -465,8 +488,6 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
map_addr = elf_map(interpreter, load_addr + vaddr,
eppnt, elf_prot, elf_type, total_size);
total_size = 0;
@@ -48666,7 +48644,7 @@ index 86af964..5d53bf6 100644
error = map_addr;
if (BAD_ADDR(map_addr))
goto out_close;
-@@ -482,8 +503,8 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
+@@ -485,8 +506,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 ||
@@ -48677,7 +48655,7 @@ index 86af964..5d53bf6 100644
error = -ENOMEM;
goto out_close;
}
-@@ -535,6 +556,315 @@ out:
+@@ -538,6 +559,315 @@ out:
return error;
}
@@ -48993,7 +48971,7 @@ index 86af964..5d53bf6 100644
/*
* These are the functions used to load ELF style executables and shared
* libraries. There is no binary dependent code anywhere else.
-@@ -551,6 +881,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
+@@ -554,6 +884,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
{
unsigned int random_variable = 0;
@@ -49005,7 +48983,7 @@ index 86af964..5d53bf6 100644
if ((current->flags & PF_RANDOMIZE) &&
!(current->personality & ADDR_NO_RANDOMIZE)) {
random_variable = get_random_int() & STACK_RND_MASK;
-@@ -569,7 +904,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
+@@ -572,7 +907,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
unsigned long load_addr = 0, load_bias = 0;
int load_addr_set = 0;
char * elf_interpreter = NULL;
@@ -49014,7 +48992,7 @@ index 86af964..5d53bf6 100644
struct elf_phdr *elf_ppnt, *elf_phdata;
unsigned long elf_bss, elf_brk;
int retval, i;
-@@ -579,12 +914,12 @@ static int load_elf_binary(struct linux_binprm *bprm)
+@@ -582,12 +917,12 @@ static int load_elf_binary(struct linux_binprm *bprm)
unsigned long start_code, end_code, start_data, end_data;
unsigned long reloc_func_desc __maybe_unused = 0;
int executable_stack = EXSTACK_DEFAULT;
@@ -49028,7 +49006,7 @@ index 86af964..5d53bf6 100644
loc = kmalloc(sizeof(*loc), GFP_KERNEL);
if (!loc) {
-@@ -720,11 +1055,81 @@ static int load_elf_binary(struct linux_binprm *bprm)
+@@ -723,11 +1058,81 @@ static int load_elf_binary(struct linux_binprm *bprm)
goto out_free_dentry;
/* OK, This is the point of no return */
@@ -49111,7 +49089,7 @@ index 86af964..5d53bf6 100644
if (elf_read_implies_exec(loc->elf_ex, executable_stack))
current->personality |= READ_IMPLIES_EXEC;
-@@ -815,6 +1220,20 @@ static int load_elf_binary(struct linux_binprm *bprm)
+@@ -819,6 +1224,20 @@ static int load_elf_binary(struct linux_binprm *bprm)
#else
load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
#endif
@@ -49132,7 +49110,7 @@ index 86af964..5d53bf6 100644
}
error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,
-@@ -847,9 +1266,9 @@ static int load_elf_binary(struct linux_binprm *bprm)
+@@ -851,9 +1270,9 @@ static int load_elf_binary(struct linux_binprm *bprm)
* allowed task size. Note that p_filesz must always be
* <= p_memsz so it is only necessary to check p_memsz.
*/
@@ -49145,7 +49123,7 @@ index 86af964..5d53bf6 100644
/* set_brk can never work. Avoid overflows. */
send_sig(SIGKILL, current, 0);
retval = -EINVAL;
-@@ -888,17 +1307,45 @@ static int load_elf_binary(struct linux_binprm *bprm)
+@@ -892,17 +1311,45 @@ static int load_elf_binary(struct linux_binprm *bprm)
goto out_free_dentry;
}
if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) {
@@ -49197,7 +49175,7 @@ index 86af964..5d53bf6 100644
load_bias);
if (!IS_ERR((void *)elf_entry)) {
/*
-@@ -1120,7 +1567,7 @@ static bool always_dump_vma(struct vm_area_struct *vma)
+@@ -1124,7 +1571,7 @@ static bool always_dump_vma(struct vm_area_struct *vma)
* Decide what to dump of a segment, part, all or none.
*/
static unsigned long vma_dump_size(struct vm_area_struct *vma,
@@ -49206,7 +49184,7 @@ index 86af964..5d53bf6 100644
{
#define FILTER(type) (mm_flags & (1UL << MMF_DUMP_##type))
-@@ -1158,7 +1605,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
+@@ -1162,7 +1609,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
if (vma->vm_file == NULL)
return 0;
@@ -49215,7 +49193,7 @@ index 86af964..5d53bf6 100644
goto whole;
/*
-@@ -1383,9 +1830,9 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm)
+@@ -1387,9 +1834,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;
@@ -49227,7 +49205,7 @@ index 86af964..5d53bf6 100644
fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv);
}
-@@ -1394,7 +1841,7 @@ static void fill_siginfo_note(struct memelfnote *note, user_siginfo_t *csigdata,
+@@ -1398,7 +1845,7 @@ static void fill_siginfo_note(struct memelfnote *note, user_siginfo_t *csigdata,
{
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
@@ -49236,7 +49214,7 @@ index 86af964..5d53bf6 100644
set_fs(old_fs);
fill_note(note, "CORE", NT_SIGINFO, sizeof(*csigdata), csigdata);
}
-@@ -2015,14 +2462,14 @@ static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum,
+@@ -2019,14 +2466,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,
@@ -49253,7 +49231,7 @@ index 86af964..5d53bf6 100644
return size;
}
-@@ -2116,7 +2563,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2119,7 +2566,7 @@ static int elf_core_dump(struct coredump_params *cprm)
dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
@@ -49262,7 +49240,7 @@ index 86af964..5d53bf6 100644
offset += elf_core_extra_data_size();
e_shoff = offset;
-@@ -2130,10 +2577,12 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2133,10 +2580,12 @@ static int elf_core_dump(struct coredump_params *cprm)
offset = dataoff;
size += sizeof(*elf);
@@ -49275,7 +49253,7 @@ index 86af964..5d53bf6 100644
if (size > cprm->limit
|| !dump_write(cprm->file, phdr4note, sizeof(*phdr4note)))
goto end_coredump;
-@@ -2147,7 +2596,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2150,7 +2599,7 @@ static int elf_core_dump(struct coredump_params *cprm)
phdr.p_offset = offset;
phdr.p_vaddr = vma->vm_start;
phdr.p_paddr = 0;
@@ -49284,7 +49262,7 @@ index 86af964..5d53bf6 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;
-@@ -2158,6 +2607,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2161,6 +2610,7 @@ static int elf_core_dump(struct coredump_params *cprm)
phdr.p_align = ELF_EXEC_PAGESIZE;
size += sizeof(phdr);
@@ -49292,7 +49270,7 @@ index 86af964..5d53bf6 100644
if (size > cprm->limit
|| !dump_write(cprm->file, &phdr, sizeof(phdr)))
goto end_coredump;
-@@ -2182,7 +2632,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2185,7 +2635,7 @@ static int elf_core_dump(struct coredump_params *cprm)
unsigned long addr;
unsigned long end;
@@ -49301,7 +49279,7 @@ index 86af964..5d53bf6 100644
for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) {
struct page *page;
-@@ -2191,6 +2641,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2194,6 +2644,7 @@ static int elf_core_dump(struct coredump_params *cprm)
page = get_dump_page(addr);
if (page) {
void *kaddr = kmap(page);
@@ -49309,7 +49287,7 @@ index 86af964..5d53bf6 100644
stop = ((size += PAGE_SIZE) > cprm->limit) ||
!dump_write(cprm->file, kaddr,
PAGE_SIZE);
-@@ -2208,6 +2659,7 @@ static int elf_core_dump(struct coredump_params *cprm)
+@@ -2211,6 +2662,7 @@ static int elf_core_dump(struct coredump_params *cprm)
if (e_phnum == PN_XNUM) {
size += sizeof(*shdr4extnum);
@@ -49317,7 +49295,7 @@ index 86af964..5d53bf6 100644
if (size > cprm->limit
|| !dump_write(cprm->file, shdr4extnum,
sizeof(*shdr4extnum)))
-@@ -2228,6 +2680,97 @@ out:
+@@ -2231,6 +2683,97 @@ out:
#endif /* CONFIG_ELF_CORE */
@@ -49416,10 +49394,10 @@ index 86af964..5d53bf6 100644
{
register_binfmt(&elf_format);
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
-index 2036d21..b0430d0 100644
+index d50bbe5..af3b649 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
-@@ -562,7 +562,9 @@ static int load_flat_file(struct linux_binprm * bprm,
+@@ -566,7 +566,9 @@ static int load_flat_file(struct linux_binprm * bprm,
realdatastart = (unsigned long) -ENOMEM;
printk("Unable to allocate RAM for process data, errno %d\n",
(int)-realdatastart);
@@ -49429,7 +49407,7 @@ index 2036d21..b0430d0 100644
ret = realdatastart;
goto err;
}
-@@ -586,8 +588,10 @@ static int load_flat_file(struct linux_binprm * bprm,
+@@ -590,8 +592,10 @@ static int load_flat_file(struct linux_binprm * bprm,
}
if (IS_ERR_VALUE(result)) {
printk("Unable to read data+bss, errno %d\n", (int)-result);
@@ -49440,7 +49418,7 @@ index 2036d21..b0430d0 100644
ret = result;
goto err;
}
-@@ -654,8 +658,10 @@ static int load_flat_file(struct linux_binprm * bprm,
+@@ -653,8 +657,10 @@ static int load_flat_file(struct linux_binprm * bprm,
}
if (IS_ERR_VALUE(result)) {
printk("Unable to read code+data+bss, errno %d\n",(int)-result);
@@ -49452,10 +49430,10 @@ index 2036d21..b0430d0 100644
goto err;
}
diff --git a/fs/bio.c b/fs/bio.c
-index b96fc6c..431d628 100644
+index 94bbc04..6fe78a4 100644
--- a/fs/bio.c
+++ b/fs/bio.c
-@@ -818,7 +818,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
+@@ -1096,7 +1096,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
/*
* Overflow, abort
*/
@@ -49464,7 +49442,7 @@ index b96fc6c..431d628 100644
return ERR_PTR(-EINVAL);
nr_pages += end - start;
-@@ -952,7 +952,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
+@@ -1230,7 +1230,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
/*
* Overflow, abort
*/
@@ -49473,20 +49451,20 @@ index b96fc6c..431d628 100644
return ERR_PTR(-EINVAL);
nr_pages += end - start;
-@@ -1214,7 +1214,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err)
+@@ -1492,7 +1492,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err)
const int read = bio_data_dir(bio) == READ;
struct bio_map_data *bmd = bio->bi_private;
int i;
- char *p = bmd->sgvecs[0].iov_base;
+ char *p = (char __force_kernel *)bmd->sgvecs[0].iov_base;
- __bio_for_each_segment(bvec, bio, i, 0) {
+ bio_for_each_segment_all(bvec, bio, i) {
char *addr = page_address(bvec->bv_page);
diff --git a/fs/block_dev.c b/fs/block_dev.c
-index aae187a..fd790ba 100644
+index 2091db8..81dafe9 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
-@@ -652,7 +652,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole,
+@@ -651,7 +651,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 */
@@ -49496,10 +49474,10 @@ index aae187a..fd790ba 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 ca9d8f1..8c0142d 100644
+index 02fae7f..48da375 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
-@@ -1036,9 +1036,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
+@@ -1076,9 +1076,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
free_extent_buffer(buf);
add_root_to_dirty_list(root);
} else {
@@ -49516,10 +49494,10 @@ index ca9d8f1..8c0142d 100644
WARN_ON(trans->transid != btrfs_header_generation(parent));
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
-index f49b62f..07834ab 100644
+index 0f81d67..0ad55fe 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
-@@ -3077,9 +3077,12 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
+@@ -3084,9 +3084,12 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
for (i = 0; i < num_types; i++) {
struct btrfs_space_info *tmp;
@@ -49532,7 +49510,7 @@ index f49b62f..07834ab 100644
info = NULL;
rcu_read_lock();
list_for_each_entry_rcu(tmp, &root->fs_info->space_info,
-@@ -3101,10 +3104,7 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
+@@ -3108,10 +3111,7 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
memcpy(dest, &space, sizeof(space));
dest++;
space_args.total_spaces++;
@@ -49544,11 +49522,11 @@ index f49b62f..07834ab 100644
up_read(&info->groups_sem);
}
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
-index f6b8859..54fe8c5 100644
+index f0857e0..e7023c5 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
-@@ -266,7 +266,7 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
- function, line, errstr);
+@@ -265,7 +265,7 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
+ function, line, errstr);
return;
}
- ACCESS_ONCE(trans->transaction->aborted) = errno;
@@ -49698,10 +49676,10 @@ index eccd339..4c1d995 100644
return 0;
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
-index 4809922..aab2c39 100644
+index 317f9ee..3d24511 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
-@@ -965,7 +965,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
+@@ -966,7 +966,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
old_fs = get_fs();
set_fs(KERNEL_DS);
ret = file->f_op->write(
@@ -49709,9 +49687,9 @@ index 4809922..aab2c39 100644
+ file, (const void __force_user *) data, len, &pos);
set_fs(old_fs);
kunmap(page);
- if (ret != len)
+ file_end_write(file);
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
-index 6d797f4..0ace2e5 100644
+index f02d82b..2632cf86 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -243,7 +243,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
@@ -49724,10 +49702,10 @@ index 6d797f4..0ace2e5 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 d9ea6ed..1e6c8ac 100644
+index d597483..747901b 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
-@@ -267,8 +267,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
+@@ -284,8 +284,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
if (c == '1' || c == 'y' || c == 'Y' || c == '0') {
#ifdef CONFIG_CIFS_STATS2
@@ -49738,7 +49716,7 @@ index d9ea6ed..1e6c8ac 100644
#endif /* CONFIG_CIFS_STATS2 */
spin_lock(&cifs_tcp_ses_lock);
list_for_each(tmp1, &cifs_tcp_ses_list) {
-@@ -281,7 +281,7 @@ static ssize_t cifs_stats_proc_write(struct file *file,
+@@ -298,7 +298,7 @@ static ssize_t cifs_stats_proc_write(struct file *file,
tcon = list_entry(tmp3,
struct cifs_tcon,
tcon_list);
@@ -49747,7 +49725,7 @@ index d9ea6ed..1e6c8ac 100644
if (server->ops->clear_stats)
server->ops->clear_stats(tcon);
}
-@@ -313,8 +313,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
+@@ -330,8 +330,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
smBufAllocCount.counter, cifs_min_small);
#ifdef CONFIG_CIFS_STATS2
seq_printf(m, "Total Large %d Small %d Allocations\n",
@@ -49758,7 +49736,7 @@ index d9ea6ed..1e6c8ac 100644
#endif /* CONFIG_CIFS_STATS2 */
seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount));
-@@ -343,7 +343,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
+@@ -360,7 +360,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
if (tcon->need_reconnect)
seq_puts(m, "\tDISCONNECTED ");
seq_printf(m, "\nSMBs: %d",
@@ -49768,11 +49746,11 @@ index d9ea6ed..1e6c8ac 100644
server->ops->print_stats(m, tcon);
}
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
-index 345fc89..b2acae5 100644
+index 3752b9f..8db5569 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
-@@ -1033,7 +1033,7 @@ cifs_init_request_bufs(void)
- /* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */
+@@ -1035,7 +1035,7 @@ cifs_init_request_bufs(void)
+ */
cifs_req_cachep = kmem_cache_create("cifs_request",
CIFSMaxBufSize + max_hdr_size, 0,
- SLAB_HWCACHE_ALIGN, NULL);
@@ -49780,7 +49758,7 @@ index 345fc89..b2acae5 100644
if (cifs_req_cachep == NULL)
return -ENOMEM;
-@@ -1060,7 +1060,7 @@ cifs_init_request_bufs(void)
+@@ -1062,7 +1062,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",
@@ -49789,7 +49767,7 @@ index 345fc89..b2acae5 100644
NULL);
if (cifs_sm_req_cachep == NULL) {
mempool_destroy(cifs_req_poolp);
-@@ -1145,8 +1145,8 @@ init_cifs(void)
+@@ -1147,8 +1147,8 @@ init_cifs(void)
atomic_set(&bufAllocCount, 0);
atomic_set(&smBufAllocCount, 0);
#ifdef CONFIG_CIFS_STATS2
@@ -49885,7 +49863,7 @@ index 4f07f6f..55de8ce 100644
GLOBAL_EXTERN atomic_t smBufAllocCount;
GLOBAL_EXTERN atomic_t midCount;
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
-index 9f6c4c4..8de307a 100644
+index b83c3f5..6437caa 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -616,7 +616,7 @@ symlink_exit:
@@ -49898,7 +49876,7 @@ index 9f6c4c4..8de307a 100644
kfree(p);
}
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
-index 1b15bf8..1ce489e 100644
+index 1bec014..f329411 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -169,7 +169,7 @@ cifs_buf_get(void)
@@ -49920,10 +49898,10 @@ index 1b15bf8..1ce489e 100644
}
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
-index 47bc5a8..10decbe 100644
+index 3efdb9d..e845a5e 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
-@@ -586,27 +586,27 @@ static void
+@@ -591,27 +591,27 @@ static void
cifs_clear_stats(struct cifs_tcon *tcon)
{
#ifdef CONFIG_CIFS_STATS
@@ -49972,7 +49950,7 @@ index 47bc5a8..10decbe 100644
#endif
}
-@@ -615,36 +615,36 @@ cifs_print_stats(struct seq_file *m, struct cifs_tcon *tcon)
+@@ -620,36 +620,36 @@ cifs_print_stats(struct seq_file *m, struct cifs_tcon *tcon)
{
#ifdef CONFIG_CIFS_STATS
seq_printf(m, " Oplocks breaks: %d",
@@ -50029,7 +50007,7 @@ index 47bc5a8..10decbe 100644
}
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
-index bceffe7..cd1ae59 100644
+index f2e76f3..c44fac7 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -274,8 +274,8 @@ smb2_clear_stats(struct cifs_tcon *tcon)
@@ -50151,13 +50129,13 @@ index bceffe7..cd1ae59 100644
}
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
-index 41d9d07..dbb4772 100644
+index 2b95ce2..d079d75 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
-@@ -1761,8 +1761,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
+@@ -1760,8 +1760,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
default:
- cERROR(1, "info level %u isn't supported",
- srch_inf->info_level);
+ cifs_dbg(VFS, "info level %u isn't supported\n",
+ srch_inf->info_level);
- rc = -EINVAL;
- goto qdir_exit;
+ return -EINVAL;
@@ -50213,7 +50191,7 @@ index 1da168c..8bc7ff6 100644
return hit;
diff --git a/fs/compat.c b/fs/compat.c
-index d487985..c9e04b1 100644
+index fc3b55d..7b568ae 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -54,7 +54,7 @@
@@ -50225,7 +50203,7 @@ index d487985..c9e04b1 100644
int compat_printk(const char *fmt, ...)
{
-@@ -490,7 +490,7 @@ compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
+@@ -488,7 +488,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() */
@@ -50234,7 +50212,7 @@ index d487985..c9e04b1 100644
set_fs(oldfs);
/* truncating is ok because it's a user address */
if (!ret)
-@@ -548,7 +548,7 @@ ssize_t compat_rw_copy_check_uvector(int type,
+@@ -546,7 +546,7 @@ ssize_t compat_rw_copy_check_uvector(int type,
goto out;
ret = -EINVAL;
@@ -50243,7 +50221,7 @@ index d487985..c9e04b1 100644
goto out;
if (nr_segs > fast_segs) {
ret = -ENOMEM;
-@@ -835,6 +835,7 @@ struct compat_old_linux_dirent {
+@@ -833,6 +833,7 @@ struct compat_old_linux_dirent {
struct compat_readdir_callback {
struct compat_old_linux_dirent __user *dirent;
@@ -50251,7 +50229,7 @@ index d487985..c9e04b1 100644
int result;
};
-@@ -852,6 +853,10 @@ static int compat_fillonedir(void *__buf, const char *name, int namlen,
+@@ -850,6 +851,10 @@ static int compat_fillonedir(void *__buf, const char *name, int namlen,
buf->result = -EOVERFLOW;
return -EOVERFLOW;
}
@@ -50262,7 +50240,7 @@ index d487985..c9e04b1 100644
buf->result++;
dirent = buf->dirent;
if (!access_ok(VERIFY_WRITE, dirent,
-@@ -882,6 +887,7 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd,
+@@ -880,6 +885,7 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd,
buf.result = 0;
buf.dirent = dirent;
@@ -50270,7 +50248,7 @@ index d487985..c9e04b1 100644
error = vfs_readdir(f.file, compat_fillonedir, &buf);
if (buf.result)
-@@ -901,6 +907,7 @@ struct compat_linux_dirent {
+@@ -899,6 +905,7 @@ struct compat_linux_dirent {
struct compat_getdents_callback {
struct compat_linux_dirent __user *current_dir;
struct compat_linux_dirent __user *previous;
@@ -50278,7 +50256,7 @@ index d487985..c9e04b1 100644
int count;
int error;
};
-@@ -922,6 +929,10 @@ static int compat_filldir(void *__buf, const char *name, int namlen,
+@@ -920,6 +927,10 @@ static int compat_filldir(void *__buf, const char *name, int namlen,
buf->error = -EOVERFLOW;
return -EOVERFLOW;
}
@@ -50289,7 +50267,7 @@ index d487985..c9e04b1 100644
dirent = buf->previous;
if (dirent) {
if (__put_user(offset, &dirent->d_off))
-@@ -967,6 +978,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
+@@ -965,6 +976,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
buf.previous = NULL;
buf.count = count;
buf.error = 0;
@@ -50297,7 +50275,7 @@ index d487985..c9e04b1 100644
error = vfs_readdir(f.file, compat_filldir, &buf);
if (error >= 0)
-@@ -987,6 +999,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
+@@ -985,6 +997,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
struct compat_getdents_callback64 {
struct linux_dirent64 __user *current_dir;
struct linux_dirent64 __user *previous;
@@ -50305,7 +50283,7 @@ index d487985..c9e04b1 100644
int count;
int error;
};
-@@ -1003,6 +1016,10 @@ static int compat_filldir64(void * __buf, const char * name, int namlen, loff_t
+@@ -1001,6 +1014,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;
@@ -50316,7 +50294,7 @@ index d487985..c9e04b1 100644
dirent = buf->previous;
if (dirent) {
-@@ -1052,13 +1069,14 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
+@@ -1050,13 +1067,14 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
buf.previous = NULL;
buf.count = count;
buf.error = 0;
@@ -50351,10 +50329,10 @@ index a81147e..20bf2b5 100644
/*
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
-index 3ced75f..b28d192 100644
+index 996cdc5..15e2f33 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
-@@ -623,7 +623,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd,
+@@ -622,7 +622,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd,
return -EFAULT;
if (__get_user(udata, &ss32->iomem_base))
return -EFAULT;
@@ -50363,7 +50341,7 @@ index 3ced75f..b28d192 100644
if (__get_user(ss.iomem_reg_shift, &ss32->iomem_reg_shift) ||
__get_user(ss.port_high, &ss32->port_high))
return -EFAULT;
-@@ -704,8 +704,8 @@ static int do_i2c_rdwr_ioctl(unsigned int fd, unsigned int cmd,
+@@ -703,8 +703,8 @@ static int do_i2c_rdwr_ioctl(unsigned int fd, unsigned int cmd,
for (i = 0; i < nmsgs; i++) {
if (copy_in_user(&tmsgs[i].addr, &umsgs[i].addr, 3*sizeof(u16)))
return -EFAULT;
@@ -50374,7 +50352,7 @@ index 3ced75f..b28d192 100644
return -EFAULT;
}
return sys_ioctl(fd, cmd, (unsigned long)tdata);
-@@ -798,7 +798,7 @@ static int compat_ioctl_preallocate(struct file *file,
+@@ -797,7 +797,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)) ||
@@ -50383,7 +50361,7 @@ index 3ced75f..b28d192 100644
return -EFAULT;
return ioctl_preallocate(file, p);
-@@ -1620,8 +1620,8 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
+@@ -1619,8 +1619,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;
@@ -50423,7 +50401,7 @@ index 7aabc6a..34c1197 100644
/*
* We'll have a dentry and an inode for
diff --git a/fs/coredump.c b/fs/coredump.c
-index c647965..a77bff3 100644
+index dafafba..10b3b27 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -52,7 +52,7 @@ struct core_name {
@@ -50453,40 +50431,43 @@ index c647965..a77bff3 100644
cn->corename = kmalloc(cn->size, GFP_KERNEL);
cn->used = 0;
-@@ -414,17 +414,17 @@ static void wait_for_dump_helpers(struct file *file)
- pipe = file_inode(file)->i_pipe;
+@@ -435,8 +435,8 @@ static void wait_for_dump_helpers(struct file *file)
+ struct pipe_inode_info *pipe = file->private_data;
pipe_lock(pipe);
- pipe->readers++;
- pipe->writers--;
+ atomic_inc(&pipe->readers);
+ atomic_dec(&pipe->writers);
+ wake_up_interruptible_sync(&pipe->wait);
+ kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
+ pipe_unlock(pipe);
+@@ -445,11 +445,11 @@ static void wait_for_dump_helpers(struct file *file)
+ * We actually want wait_event_freezable() but then we need
+ * to clear TIF_SIGPENDING and improve dump_interrupted().
+ */
+- wait_event_interruptible(pipe->wait, pipe->readers == 1);
++ wait_event_interruptible(pipe->wait, atomic_read(&pipe->readers) == 1);
-- while ((pipe->readers > 1) && (!signal_pending(current))) {
-+ while ((atomic_read(&pipe->readers) > 1) && (!signal_pending(current))) {
- wake_up_interruptible_sync(&pipe->wait);
- kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
- pipe_wait(pipe);
- }
-
+ pipe_lock(pipe);
- pipe->readers--;
- pipe->writers++;
+ atomic_dec(&pipe->readers);
+ atomic_inc(&pipe->writers);
pipe_unlock(pipe);
-
}
-@@ -471,7 +471,8 @@ void do_coredump(siginfo_t *siginfo)
- int ispipe;
+
+@@ -496,7 +496,8 @@ void do_coredump(siginfo_t *siginfo)
struct files_struct *displaced;
bool need_nonrelative = false;
+ bool core_dumped = false;
- static atomic_t core_dump_count = ATOMIC_INIT(0);
+ static atomic_unchecked_t core_dump_count = ATOMIC_INIT(0);
+ long signr = siginfo->si_signo;
struct coredump_params cprm = {
.siginfo = siginfo,
.regs = signal_pt_regs(),
-@@ -484,7 +485,10 @@ void do_coredump(siginfo_t *siginfo)
+@@ -509,7 +510,10 @@ void do_coredump(siginfo_t *siginfo)
.mm_flags = mm->flags,
};
@@ -50498,7 +50479,7 @@ index c647965..a77bff3 100644
binfmt = mm->binfmt;
if (!binfmt || !binfmt->core_dump)
-@@ -508,7 +512,7 @@ void do_coredump(siginfo_t *siginfo)
+@@ -533,7 +537,7 @@ void do_coredump(siginfo_t *siginfo)
need_nonrelative = true;
}
@@ -50507,7 +50488,7 @@ index c647965..a77bff3 100644
if (retval < 0)
goto fail_creds;
-@@ -556,7 +560,7 @@ void do_coredump(siginfo_t *siginfo)
+@@ -576,7 +580,7 @@ void do_coredump(siginfo_t *siginfo)
}
cprm.limit = RLIM_INFINITY;
@@ -50516,7 +50497,7 @@ index c647965..a77bff3 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);
-@@ -583,6 +587,8 @@ void do_coredump(siginfo_t *siginfo)
+@@ -608,6 +612,8 @@ void do_coredump(siginfo_t *siginfo)
} else {
struct inode *inode;
@@ -50525,7 +50506,7 @@ index c647965..a77bff3 100644
if (cprm.limit < binfmt->min_coredump)
goto fail_unlock;
-@@ -640,7 +646,7 @@ close_fail:
+@@ -666,7 +672,7 @@ close_fail:
filp_close(cprm.file, NULL);
fail_dropcount:
if (ispipe)
@@ -50534,20 +50515,20 @@ index c647965..a77bff3 100644
fail_unlock:
kfree(cn.corename);
fail_corename:
-@@ -659,7 +665,7 @@ fail:
- */
- int dump_write(struct file *file, const void *addr, int nr)
+@@ -687,7 +693,7 @@ int dump_write(struct file *file, const void *addr, int nr)
{
-- return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, addr, nr, &file->f_pos) == nr;
-+ return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, (const char __force_user *)addr, nr, &file->f_pos) == nr;
+ return !dump_interrupted() &&
+ access_ok(VERIFY_READ, addr, nr) &&
+- file->f_op->write(file, addr, nr, &file->f_pos) == nr;
++ file->f_op->write(file, (const char __force_user *)addr, nr, &file->f_pos) == nr;
}
EXPORT_SYMBOL(dump_write);
diff --git a/fs/dcache.c b/fs/dcache.c
-index e689268..f36956e 100644
+index f09b908..4dd10d8 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
-@@ -3100,7 +3100,7 @@ void __init vfs_caches_init(unsigned long mempages)
+@@ -3086,7 +3086,7 @@ void __init vfs_caches_init(unsigned long mempages)
mempages -= reserve;
names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0,
@@ -50607,21 +50588,8 @@ index e4141f2..d8263e8 100644
goto out_unlock_msg_ctx;
i += packet_length_size;
if (copy_to_user(&buf[i], msg_ctx->msg, msg_ctx->msg_size))
-diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
-index 6a16053..2155147 100644
---- a/fs/ecryptfs/read_write.c
-+++ b/fs/ecryptfs/read_write.c
-@@ -240,7 +240,7 @@ int ecryptfs_read_lower(char *data, loff_t offset, size_t size,
- return -EIO;
- fs_save = get_fs();
- set_fs(get_ds());
-- rc = vfs_read(lower_file, data, size, &offset);
-+ rc = vfs_read(lower_file, (char __force_user *)data, size, &offset);
- set_fs(fs_save);
- return rc;
- }
diff --git a/fs/exec.c b/fs/exec.c
-index 0d5c76f..3d4585e 100644
+index ffd7a81..e38107f 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -55,8 +55,20 @@
@@ -50748,7 +50716,7 @@ index 0d5c76f..3d4585e 100644
+
+#ifdef CONFIG_PAX_RANDUSTACK
+ if (randomize_va_space)
-+ bprm->p ^= random32() & ~PAGE_MASK;
++ bprm->p ^= prandom_u32() & ~PAGE_MASK;
+#endif
+
return 0;
@@ -50928,7 +50896,7 @@ index 0d5c76f..3d4585e 100644
set_fs(old_fs);
return result;
}
-@@ -1252,7 +1330,7 @@ static int check_unsafe_exec(struct linux_binprm *bprm)
+@@ -1251,7 +1329,7 @@ static int check_unsafe_exec(struct linux_binprm *bprm)
}
rcu_read_unlock();
@@ -50937,7 +50905,7 @@ index 0d5c76f..3d4585e 100644
bprm->unsafe |= LSM_UNSAFE_SHARE;
} else {
res = -EAGAIN;
-@@ -1452,6 +1530,31 @@ int search_binary_handler(struct linux_binprm *bprm)
+@@ -1451,6 +1529,31 @@ int search_binary_handler(struct linux_binprm *bprm)
EXPORT_SYMBOL(search_binary_handler);
@@ -50969,7 +50937,7 @@ index 0d5c76f..3d4585e 100644
/*
* sys_execve() executes a new program.
*/
-@@ -1459,6 +1562,11 @@ static int do_execve_common(const char *filename,
+@@ -1458,6 +1561,11 @@ static int do_execve_common(const char *filename,
struct user_arg_ptr argv,
struct user_arg_ptr envp)
{
@@ -50981,7 +50949,7 @@ index 0d5c76f..3d4585e 100644
struct linux_binprm *bprm;
struct file *file;
struct files_struct *displaced;
-@@ -1466,6 +1574,8 @@ static int do_execve_common(const char *filename,
+@@ -1465,6 +1573,8 @@ static int do_execve_common(const char *filename,
int retval;
const struct cred *cred = current_cred();
@@ -50990,7 +50958,7 @@ index 0d5c76f..3d4585e 100644
/*
* We move the actual failure in case of RLIMIT_NPROC excess from
* set*uid() to execve() because too many poorly written programs
-@@ -1506,12 +1616,22 @@ static int do_execve_common(const char *filename,
+@@ -1505,12 +1615,22 @@ static int do_execve_common(const char *filename,
if (IS_ERR(file))
goto out_unmark;
@@ -51013,7 +50981,7 @@ index 0d5c76f..3d4585e 100644
retval = bprm_mm_init(bprm);
if (retval)
goto out_file;
-@@ -1528,24 +1648,70 @@ static int do_execve_common(const char *filename,
+@@ -1527,24 +1647,70 @@ static int do_execve_common(const char *filename,
if (retval < 0)
goto out;
@@ -51088,7 +51056,7 @@ index 0d5c76f..3d4585e 100644
current->fs->in_exec = 0;
current->in_execve = 0;
acct_update_integrals(current);
-@@ -1554,6 +1720,14 @@ static int do_execve_common(const char *filename,
+@@ -1553,6 +1719,14 @@ static int do_execve_common(const char *filename,
put_files_struct(displaced);
return retval;
@@ -51103,7 +51071,7 @@ index 0d5c76f..3d4585e 100644
out:
if (bprm->mm) {
acct_arg_size(bprm, 0);
-@@ -1702,3 +1876,283 @@ asmlinkage long compat_sys_execve(const char __user * filename,
+@@ -1701,3 +1875,283 @@ asmlinkage long compat_sys_execve(const char __user * filename,
return error;
}
#endif
@@ -51422,25 +51390,25 @@ index 22548f5..41521d8 100644
}
return 1;
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
-index 92e68b3..115d987 100644
+index d0f13ea..4b2dadd 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
-@@ -505,8 +505,8 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi,
+@@ -528,8 +528,8 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi,
/* Hm, nope. Are (enough) root reserved clusters available? */
if (uid_eq(sbi->s_resuid, current_fsuid()) ||
(!gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) && in_group_p(sbi->s_resgid)) ||
- capable(CAP_SYS_RESOURCE) ||
-- (flags & EXT4_MB_USE_ROOT_BLOCKS)) {
-+ (flags & EXT4_MB_USE_ROOT_BLOCKS) ||
+- (flags & EXT4_MB_USE_ROOT_BLOCKS)) {
++ (flags & EXT4_MB_USE_ROOT_BLOCKS) ||
+ capable_nolog(CAP_SYS_RESOURCE)) {
- if (free_clusters >= (nclusters + dirty_clusters))
- return 1;
+ if (free_clusters >= (nclusters + dirty_clusters +
+ resv_clusters))
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
-index 3b83cd6..0f34dcd 100644
+index 5aae3d1..b5da7f8 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
-@@ -1254,19 +1254,19 @@ struct ext4_sb_info {
+@@ -1252,19 +1252,19 @@ struct ext4_sb_info {
unsigned long s_mb_last_start;
/* stats for buddy allocator */
@@ -51471,10 +51439,10 @@ index 3b83cd6..0f34dcd 100644
/* locality groups */
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
-index f3190ab..84ffb21 100644
+index def8408..8253d11 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
-@@ -1754,7 +1754,7 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
+@@ -1865,7 +1865,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)
@@ -51483,7 +51451,7 @@ index f3190ab..84ffb21 100644
break;
}
-@@ -2059,7 +2059,7 @@ repeat:
+@@ -2170,7 +2170,7 @@ repeat:
ac->ac_status = AC_STATUS_CONTINUE;
ac->ac_flags |= EXT4_MB_HINT_FIRST;
cr = 3;
@@ -51492,7 +51460,7 @@ index f3190ab..84ffb21 100644
goto repeat;
}
}
-@@ -2567,25 +2567,25 @@ int ext4_mb_release(struct super_block *sb)
+@@ -2678,25 +2678,25 @@ int ext4_mb_release(struct super_block *sb)
if (sbi->s_mb_stats) {
ext4_msg(sb, KERN_INFO,
"mballoc: %u blocks %u reqs (%u success)",
@@ -51528,7 +51496,7 @@ index f3190ab..84ffb21 100644
}
free_percpu(sbi->s_locality_groups);
-@@ -3039,16 +3039,16 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac)
+@@ -3150,16 +3150,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) {
@@ -51551,7 +51519,7 @@ index f3190ab..84ffb21 100644
}
if (ac->ac_op == EXT4_MB_HISTORY_ALLOC)
-@@ -3448,7 +3448,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)
+@@ -3559,7 +3559,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);
@@ -51560,7 +51528,7 @@ index f3190ab..84ffb21 100644
ei = EXT4_I(ac->ac_inode);
grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
-@@ -3508,7 +3508,7 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac)
+@@ -3619,7 +3619,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);
@@ -51569,7 +51537,7 @@ index f3190ab..84ffb21 100644
grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
lg = ac->ac_lg;
-@@ -3597,7 +3597,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
+@@ -3708,7 +3708,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
* from the bitmap and continue.
*/
}
@@ -51578,7 +51546,7 @@ index f3190ab..84ffb21 100644
return err;
}
-@@ -3615,7 +3615,7 @@ ext4_mb_release_group_pa(struct ext4_buddy *e4b,
+@@ -3726,7 +3726,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);
@@ -51588,7 +51556,7 @@ index f3190ab..84ffb21 100644
return 0;
diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
-index b3b1f7d..cff51d5 100644
+index 214461e..3614c89 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -113,7 +113,7 @@ static int read_mmp_block(struct super_block *sb, struct buffer_head **bh,
@@ -51601,7 +51569,7 @@ index b3b1f7d..cff51d5 100644
"MMP failure info: last update time: %llu, last update "
"node: %s, last update device: %s\n",
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
-index 3beae6a..8cc5637 100644
+index b27c96d..6ed4df2 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -79,12 +79,20 @@ static int verify_group_input(struct super_block *sb,
@@ -51640,10 +51608,10 @@ index 3beae6a..8cc5637 100644
else if (input->reserved_blocks > input->blocks_count / 5)
ext4_warning(sb, "Reserved blocks too high (%u)",
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index febbe0e..d0cdc02 100644
+index 94cc84d..2490974 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
-@@ -1238,7 +1238,7 @@ static ext4_fsblk_t get_sb_block(void **data)
+@@ -1236,7 +1236,7 @@ static ext4_fsblk_t get_sb_block(void **data)
}
#define DEFAULT_JOURNAL_IOPRIO (IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 3))
@@ -51652,15 +51620,15 @@ index febbe0e..d0cdc02 100644
"Contact linux-ext4@vger.kernel.org if you think we should keep it.\n";
#ifdef CONFIG_QUOTA
-@@ -2380,7 +2380,7 @@ struct ext4_attr {
+@@ -2378,7 +2378,7 @@ struct ext4_attr {
ssize_t (*store)(struct ext4_attr *, struct ext4_sb_info *,
const char *, size_t);
int offset;
-};
+} __do_const;
- static int parse_strtoul(const char *buf,
- unsigned long max, unsigned long *value)
+ static int parse_strtoull(const char *buf,
+ unsigned long long max, unsigned long long *value)
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 6599222..e7bf0de 100644
--- a/fs/fcntl.c
@@ -51691,82 +51659,8 @@ index 999ff5c..41f4109 100644
copy_to_user(ufh, handle,
sizeof(struct file_handle) + handle_bytes))
retval = -EFAULT;
-diff --git a/fs/fifo.c b/fs/fifo.c
-index cf6f434..3d7942c 100644
---- a/fs/fifo.c
-+++ b/fs/fifo.c
-@@ -59,10 +59,10 @@ static int fifo_open(struct inode *inode, struct file *filp)
- */
- filp->f_op = &read_pipefifo_fops;
- pipe->r_counter++;
-- if (pipe->readers++ == 0)
-+ if (atomic_inc_return(&pipe->readers) == 1)
- wake_up_partner(inode);
-
-- if (!pipe->writers) {
-+ if (!atomic_read(&pipe->writers)) {
- if ((filp->f_flags & O_NONBLOCK)) {
- /* suppress POLLHUP until we have
- * seen a writer */
-@@ -81,15 +81,15 @@ static int fifo_open(struct inode *inode, struct file *filp)
- * errno=ENXIO when there is no process reading the FIFO.
- */
- ret = -ENXIO;
-- if ((filp->f_flags & O_NONBLOCK) && !pipe->readers)
-+ if ((filp->f_flags & O_NONBLOCK) && !atomic_read(&pipe->readers))
- goto err;
-
- filp->f_op = &write_pipefifo_fops;
- pipe->w_counter++;
-- if (!pipe->writers++)
-+ if (atomic_inc_return(&pipe->writers) == 1)
- wake_up_partner(inode);
-
-- if (!pipe->readers) {
-+ if (!atomic_read(&pipe->readers)) {
- if (wait_for_partner(inode, &pipe->r_counter))
- goto err_wr;
- }
-@@ -104,11 +104,11 @@ static int fifo_open(struct inode *inode, struct file *filp)
- */
- filp->f_op = &rdwr_pipefifo_fops;
-
-- pipe->readers++;
-- pipe->writers++;
-+ atomic_inc(&pipe->readers);
-+ atomic_inc(&pipe->writers);
- pipe->r_counter++;
- pipe->w_counter++;
-- if (pipe->readers == 1 || pipe->writers == 1)
-+ if (atomic_read(&pipe->readers) == 1 || atomic_read(&pipe->writers) == 1)
- wake_up_partner(inode);
- break;
-
-@@ -122,19 +122,19 @@ static int fifo_open(struct inode *inode, struct file *filp)
- return 0;
-
- err_rd:
-- if (!--pipe->readers)
-+ if (atomic_dec_and_test(&pipe->readers))
- wake_up_interruptible(&pipe->wait);
- ret = -ERESTARTSYS;
- goto err;
-
- err_wr:
-- if (!--pipe->writers)
-+ if (atomic_dec_and_test(&pipe->writers))
- wake_up_interruptible(&pipe->wait);
- ret = -ERESTARTSYS;
- goto err;
-
- err:
-- if (!pipe->readers && !pipe->writers)
-+ if (!atomic_read(&pipe->readers) && !atomic_read(&pipe->writers))
- free_pipe_info(inode);
-
- err_nocleanup:
diff --git a/fs/file.c b/fs/file.c
-index 3906d95..5fe379b 100644
+index 4a78f98..9447397 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -16,6 +16,7 @@
@@ -51777,7 +51671,7 @@ index 3906d95..5fe379b 100644
#include <linux/fdtable.h>
#include <linux/bitops.h>
#include <linux/interrupt.h>
-@@ -892,6 +893,7 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags)
+@@ -828,6 +829,7 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags)
if (!file)
return __close_fd(files, fd);
@@ -51785,7 +51679,7 @@ index 3906d95..5fe379b 100644
if (fd >= rlimit(RLIMIT_NOFILE))
return -EBADF;
-@@ -918,6 +920,7 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
+@@ -854,6 +856,7 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
if (unlikely(oldfd == newfd))
return -EINVAL;
@@ -51793,7 +51687,7 @@ index 3906d95..5fe379b 100644
if (newfd >= rlimit(RLIMIT_NOFILE))
return -EBADF;
-@@ -973,6 +976,7 @@ SYSCALL_DEFINE1(dup, unsigned int, fildes)
+@@ -909,6 +912,7 @@ SYSCALL_DEFINE1(dup, unsigned int, fildes)
int f_dupfd(unsigned int from, struct file *file, unsigned flags)
{
int err;
@@ -53277,10 +53171,10 @@ index 40d13c7..ddf52b9 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 6f96a8d..6019bb9 100644
+index aef34b1..59bfd7b 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
-@@ -597,10 +597,12 @@ static int __init cuse_init(void)
+@@ -600,10 +600,12 @@ static int __init cuse_init(void)
INIT_LIST_HEAD(&cuse_conntbl[i]);
/* inherit and extend fuse_dev_operations */
@@ -53298,10 +53192,10 @@ index 6f96a8d..6019bb9 100644
cuse_class = class_create(THIS_MODULE, "cuse");
if (IS_ERR(cuse_class))
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
-index 11dfa0c..6f64416 100644
+index 1d55f94..088da65 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
-@@ -1294,7 +1294,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
+@@ -1339,7 +1339,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
ret = 0;
pipe_lock(pipe);
@@ -53310,8 +53204,17 @@ index 11dfa0c..6f64416 100644
send_sig(SIGPIPE, current, 0);
if (!ret)
ret = -EPIPE;
+@@ -1364,7 +1364,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
+ page_nr++;
+ ret += buf->len;
+
+- if (pipe->files)
++ if (atomic_read(&pipe->files))
+ do_wakeup = 1;
+ }
+
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
-index 185c479..51b9986 100644
+index f3f783d..bf11a8e 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1415,7 +1415,7 @@ static char *read_link(struct dentry *dentry)
@@ -53324,10 +53227,10 @@ index 185c479..51b9986 100644
if (!IS_ERR(link))
free_page((unsigned long) link);
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
-index cc00bd1..3edb692 100644
+index 62b484e..0f9a140 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
-@@ -1500,7 +1500,7 @@ out:
+@@ -1441,7 +1441,7 @@ out:
static void gfs2_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
{
@@ -53387,7 +53290,7 @@ index a3f868a..bb308ae 100644
static int can_do_hugetlb_shm(void)
{
diff --git a/fs/inode.c b/fs/inode.c
-index a898b3d..9b5a214 100644
+index 00d5fc3..98ce7d7 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -878,8 +878,8 @@ unsigned int get_next_ino(void)
@@ -53430,10 +53333,10 @@ index a6597d6..41b30ec 100644
/*
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
-index 2003e83..40db287 100644
+index 788e0a9..8433098 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
-@@ -856,7 +856,7 @@ static int __init init_jfs_fs(void)
+@@ -878,7 +878,7 @@ static int __init init_jfs_fs(void)
jfs_inode_cachep =
kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0,
@@ -53527,7 +53430,7 @@ index cb424a4..850e4dd 100644
lock_flocks();
diff --git a/fs/namei.c b/fs/namei.c
-index 85e40d1..b66744e 100644
+index 9ed9361..2b72db1 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -319,16 +319,32 @@ int generic_permission(struct inode *inode, int mask)
@@ -53642,7 +53545,7 @@ index 85e40d1..b66744e 100644
+ }
+
if (!err && nd->flags & LOOKUP_DIRECTORY) {
- if (!nd->inode->i_op->lookup) {
+ if (!can_lookup(nd->inode)) {
path_put(&nd->path);
@@ -2002,8 +2027,15 @@ static int filename_lookup(int dfd, struct filename *name,
retval = path_lookupat(dfd, name->name,
@@ -54101,10 +54004,10 @@ index 85e40d1..b66744e 100644
out:
return len;
diff --git a/fs/namespace.c b/fs/namespace.c
-index e945b81..fc018e2 100644
+index 7b1ca9b..6faeccf 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
-@@ -1219,6 +1219,9 @@ static int do_umount(struct mount *mnt, int flags)
+@@ -1265,6 +1265,9 @@ static int do_umount(struct mount *mnt, int flags)
if (!(sb->s_flags & MS_RDONLY))
retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
up_write(&sb->s_umount);
@@ -54114,17 +54017,17 @@ index e945b81..fc018e2 100644
return retval;
}
-@@ -1238,6 +1241,9 @@ static int do_umount(struct mount *mnt, int flags)
+@@ -1283,6 +1286,9 @@ static int do_umount(struct mount *mnt, int flags)
+ }
br_write_unlock(&vfsmount_lock);
- up_write(&namespace_sem);
- release_mounts(&umount_list);
+ namespace_unlock();
+
+ gr_log_unmount(mnt->mnt_devname, retval);
+
return retval;
}
-@@ -1257,7 +1263,7 @@ static inline bool may_mount(void)
+@@ -1302,7 +1308,7 @@ static inline bool may_mount(void)
* unixes. Our API is identical to OSF/1 to avoid making a mess of AMD
*/
@@ -54133,7 +54036,7 @@ index e945b81..fc018e2 100644
{
struct path path;
struct mount *mnt;
-@@ -1297,7 +1303,7 @@ out:
+@@ -1342,7 +1348,7 @@ out:
/*
* The 2.0 compatible umount. No flags.
*/
@@ -54142,7 +54045,7 @@ index e945b81..fc018e2 100644
{
return sys_umount(name, 0);
}
-@@ -2267,6 +2273,16 @@ long do_mount(const char *dev_name, const char *dir_name,
+@@ -2313,6 +2319,16 @@ long do_mount(const char *dev_name, const char *dir_name,
MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
MS_STRICTATIME);
@@ -54159,7 +54062,7 @@ index e945b81..fc018e2 100644
if (flags & MS_REMOUNT)
retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
data_page);
-@@ -2281,6 +2297,9 @@ long do_mount(const char *dev_name, const char *dir_name,
+@@ -2327,6 +2343,9 @@ long do_mount(const char *dev_name, const char *dir_name,
dev_name, data_page);
dput_out:
path_put(&path);
@@ -54169,7 +54072,7 @@ index e945b81..fc018e2 100644
return retval;
}
-@@ -2454,8 +2473,8 @@ struct dentry *mount_subtree(struct vfsmount *mnt, const char *name)
+@@ -2500,8 +2519,8 @@ struct dentry *mount_subtree(struct vfsmount *mnt, const char *name)
}
EXPORT_SYMBOL(mount_subtree);
@@ -54180,7 +54083,7 @@ index e945b81..fc018e2 100644
{
int ret;
char *kernel_type;
-@@ -2567,6 +2586,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
+@@ -2614,6 +2633,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
if (error)
goto out2;
@@ -54190,9 +54093,9 @@ index e945b81..fc018e2 100644
+ }
+
get_fs_root(current->fs, &root);
- error = lock_mount(&old);
- if (error)
-@@ -2815,7 +2839,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns)
+ old_mp = lock_mount(&old);
+ error = PTR_ERR(old_mp);
+@@ -2864,7 +2888,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns)
!nsown_capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -54202,10 +54105,10 @@ index e945b81..fc018e2 100644
get_mnt_ns(mnt_ns);
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
-index 5088b57..eabd719 100644
+index cff089a..4c3d57a 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
-@@ -208,7 +208,6 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
+@@ -211,7 +211,6 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
struct svc_rqst *rqstp;
int (*callback_svc)(void *vrqstp);
struct nfs_callback_data *cb_info = &nfs_callback_info[minorversion];
@@ -54213,7 +54116,7 @@ index 5088b57..eabd719 100644
int ret;
nfs_callback_bc_serv(minorversion, xprt, serv);
-@@ -232,10 +231,9 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
+@@ -235,10 +234,9 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
svc_sock_update_bufs(serv);
@@ -54226,7 +54129,7 @@ index 5088b57..eabd719 100644
ret = PTR_ERR(cb_info->task);
svc_exit_thread(cb_info->rqst);
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
-index 59461c9..b17c57e 100644
+index a35582c..ebbdcd5 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -51,7 +51,7 @@ struct callback_op {
@@ -54239,10 +54142,10 @@ index 59461c9..b17c57e 100644
static struct callback_op callback_ops[];
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
-index 1f94167..79c4ce4 100644
+index c1c7a9d..7afa0b8 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
-@@ -1041,16 +1041,16 @@ static int nfs_size_need_update(const struct inode *inode, const struct nfs_fatt
+@@ -1043,16 +1043,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);
}
@@ -54263,10 +54166,10 @@ index 1f94167..79c4ce4 100644
void nfs_fattr_init(struct nfs_fattr *fattr)
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
-index d41a351..7899577 100644
+index 1fab140..73d0f75 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
-@@ -1182,7 +1182,7 @@ void nfs4_schedule_state_manager(struct nfs_client *clp)
+@@ -1194,7 +1194,7 @@ void nfs4_schedule_state_manager(struct nfs_client *clp)
snprintf(buf, sizeof(buf), "%s-manager",
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR));
rcu_read_unlock();
@@ -54276,10 +54179,10 @@ index d41a351..7899577 100644
printk(KERN_ERR "%s: kthread_run: %ld\n",
__func__, PTR_ERR(task));
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
-index d401d01..10b3e62 100644
+index 27d74a2..c4c2a73 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
-@@ -1109,7 +1109,7 @@ struct nfsd4_operation {
+@@ -1126,7 +1126,7 @@ struct nfsd4_operation {
nfsd4op_rsize op_rsize_bop;
stateid_getter op_get_currentstateid;
stateid_setter op_set_currentstateid;
@@ -54289,10 +54192,10 @@ index d401d01..10b3e62 100644
static struct nfsd4_operation nfsd4_ops[];
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
-index 6eb0dc5..29067a9 100644
+index 6cd86e0..0369a36 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
-@@ -1457,7 +1457,7 @@ nfsd4_decode_notsupp(struct nfsd4_compoundargs *argp, void *p)
+@@ -1458,7 +1458,7 @@ nfsd4_decode_notsupp(struct nfsd4_compoundargs *argp, void *p)
typedef __be32(*nfsd4_dec)(struct nfsd4_compoundargs *argp, void *);
@@ -54301,7 +54204,7 @@ index 6eb0dc5..29067a9 100644
[OP_ACCESS] = (nfsd4_dec)nfsd4_decode_access,
[OP_CLOSE] = (nfsd4_dec)nfsd4_decode_close,
[OP_COMMIT] = (nfsd4_dec)nfsd4_decode_commit,
-@@ -1497,7 +1497,7 @@ static nfsd4_dec nfsd4_dec_ops[] = {
+@@ -1498,7 +1498,7 @@ static nfsd4_dec nfsd4_dec_ops[] = {
[OP_RELEASE_LOCKOWNER] = (nfsd4_dec)nfsd4_decode_release_lockowner,
};
@@ -54310,7 +54213,7 @@ index 6eb0dc5..29067a9 100644
[OP_ACCESS] = (nfsd4_dec)nfsd4_decode_access,
[OP_CLOSE] = (nfsd4_dec)nfsd4_decode_close,
[OP_COMMIT] = (nfsd4_dec)nfsd4_decode_commit,
-@@ -1559,7 +1559,7 @@ static nfsd4_dec nfsd41_dec_ops[] = {
+@@ -1560,7 +1560,7 @@ static nfsd4_dec nfsd41_dec_ops[] = {
};
struct nfsd4_minorversion_ops {
@@ -54320,15 +54223,16 @@ index 6eb0dc5..29067a9 100644
};
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
-index ca05f6d..b88c3a7 100644
+index e76244e..9fe8f2f1 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
-@@ -461,13 +461,16 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
+@@ -526,14 +526,17 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
{
struct svc_cacherep *rp = rqstp->rq_cacherep;
struct kvec *resv = &rqstp->rq_res.head[0], *cachv;
- int len;
+ long len;
+ size_t bufsize = 0;
if (!rp)
return;
@@ -54344,7 +54248,7 @@ index ca05f6d..b88c3a7 100644
/* Don't cache excessive amounts of data and XDR failures */
if (!statp || len > (256 >> 2)) {
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
-index 2b2e239..c915b48 100644
+index 84ce601..633d226 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -939,7 +939,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
@@ -54458,10 +54362,10 @@ index e7bc1d7..06bd4bb 100644
}
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
-index 5d84442..2c034ba 100644
+index 6c80083..a1e6299 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
-@@ -121,6 +121,7 @@ static int fill_event_metadata(struct fsnotify_group *group,
+@@ -122,6 +122,7 @@ static int fill_event_metadata(struct fsnotify_group *group,
metadata->event_len = FAN_EVENT_METADATA_LEN;
metadata->metadata_len = FAN_EVENT_METADATA_LEN;
metadata->vers = FANOTIFY_METADATA_VERSION;
@@ -54469,7 +54373,7 @@ index 5d84442..2c034ba 100644
metadata->mask = event->mask & FAN_ALL_OUTGOING_EVENTS;
metadata->pid = pid_vnr(event->tgid);
if (unlikely(event->mask & FAN_Q_OVERFLOW))
-@@ -251,8 +252,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
+@@ -252,8 +253,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
fd = fanotify_event_metadata.fd;
ret = -EFAULT;
@@ -54516,10 +54420,10 @@ index aa411c3..c260a84 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 5b2d4f0..c6de396 100644
+index c5670b8..01a3656 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
-@@ -2242,6 +2242,6 @@ const struct inode_operations ntfs_file_inode_ops = {
+@@ -2241,6 +2241,6 @@ const struct inode_operations ntfs_file_inode_ops = {
#endif /* NTFS_RW */
};
@@ -54659,7 +54563,7 @@ index 01b8516..579c4df 100644
/* Copy the blockcheck stats from the superblock probe */
osb->osb_ecc_stats = *stats;
diff --git a/fs/open.c b/fs/open.c
-index 6835446..eadf09f 100644
+index 8c74100..4239c48 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -32,6 +32,8 @@
@@ -54689,7 +54593,7 @@ index 6835446..eadf09f 100644
if (!error)
error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, f.file);
sb_end_write(inode->i_sb);
-@@ -388,6 +394,9 @@ retry:
+@@ -360,6 +366,9 @@ retry:
if (__mnt_is_readonly(path.mnt))
res = -EROFS;
@@ -54699,7 +54603,7 @@ index 6835446..eadf09f 100644
out_path_release:
path_put(&path);
if (retry_estale(res, lookup_flags)) {
-@@ -419,6 +428,8 @@ retry:
+@@ -391,6 +400,8 @@ retry:
if (error)
goto dput_and_out;
@@ -54708,7 +54612,7 @@ index 6835446..eadf09f 100644
set_fs_pwd(current->fs, &path);
dput_and_out:
-@@ -448,6 +459,13 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd)
+@@ -420,6 +431,13 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd)
goto out_putf;
error = inode_permission(inode, MAY_EXEC | MAY_CHDIR);
@@ -54722,7 +54626,7 @@ index 6835446..eadf09f 100644
if (!error)
set_fs_pwd(current->fs, &f.file->f_path);
out_putf:
-@@ -477,7 +495,13 @@ retry:
+@@ -449,7 +467,13 @@ retry:
if (error)
goto dput_and_out;
@@ -54736,7 +54640,7 @@ index 6835446..eadf09f 100644
error = 0;
dput_and_out:
path_put(&path);
-@@ -499,6 +523,16 @@ static int chmod_common(struct path *path, umode_t mode)
+@@ -471,6 +495,16 @@ static int chmod_common(struct path *path, umode_t mode)
if (error)
return error;
mutex_lock(&inode->i_mutex);
@@ -54753,7 +54657,7 @@ index 6835446..eadf09f 100644
error = security_path_chmod(path, mode);
if (error)
goto out_unlock;
-@@ -559,6 +593,9 @@ static int chown_common(struct path *path, uid_t user, gid_t group)
+@@ -531,6 +565,9 @@ static int chown_common(struct path *path, uid_t user, gid_t group)
uid = make_kuid(current_user_ns(), user);
gid = make_kgid(current_user_ns(), group);
@@ -54763,7 +54667,7 @@ index 6835446..eadf09f 100644
newattrs.ia_valid = ATTR_CTIME;
if (user != (uid_t) -1) {
if (!uid_valid(uid))
-@@ -974,6 +1011,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
+@@ -946,6 +983,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
} else {
fsnotify_open(f);
fd_install(fd, f);
@@ -54772,10 +54676,28 @@ index 6835446..eadf09f 100644
}
putname(tmp);
diff --git a/fs/pipe.c b/fs/pipe.c
-index 2234f3f..f9083a1 100644
+index d2c45e1..009fe1c 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
-@@ -438,9 +438,9 @@ redo:
+@@ -56,7 +56,7 @@ unsigned int pipe_min_size = PAGE_SIZE;
+
+ static void pipe_lock_nested(struct pipe_inode_info *pipe, int subclass)
+ {
+- if (pipe->files)
++ if (atomic_read(&pipe->files))
+ mutex_lock_nested(&pipe->mutex, subclass);
+ }
+
+@@ -71,7 +71,7 @@ EXPORT_SYMBOL(pipe_lock);
+
+ void pipe_unlock(struct pipe_inode_info *pipe)
+ {
+- if (pipe->files)
++ if (atomic_read(&pipe->files))
+ mutex_unlock(&pipe->mutex);
+ }
+ EXPORT_SYMBOL(pipe_unlock);
+@@ -449,9 +449,9 @@ redo:
}
if (bufs) /* More to do? */
continue;
@@ -54787,16 +54709,16 @@ index 2234f3f..f9083a1 100644
/* syscall merging: Usually we must not sleep
* if O_NONBLOCK is set, or if we got some data.
* But if a writer sleeps in kernel space, then
-@@ -504,7 +504,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
- mutex_lock(&inode->i_mutex);
- pipe = inode->i_pipe;
+@@ -513,7 +513,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
+ ret = 0;
+ __pipe_lock(pipe);
- if (!pipe->readers) {
+ if (!atomic_read(&pipe->readers)) {
send_sig(SIGPIPE, current, 0);
ret = -EPIPE;
goto out;
-@@ -553,7 +553,7 @@ redo1:
+@@ -562,7 +562,7 @@ redo1:
for (;;) {
int bufs;
@@ -54805,7 +54727,7 @@ index 2234f3f..f9083a1 100644
send_sig(SIGPIPE, current, 0);
if (!ret)
ret = -EPIPE;
-@@ -644,9 +644,9 @@ redo2:
+@@ -653,9 +653,9 @@ redo2:
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
do_wakeup = 0;
}
@@ -54816,8 +54738,8 @@ index 2234f3f..f9083a1 100644
+ atomic_dec(&pipe->waiting_writers);
}
out:
- mutex_unlock(&inode->i_mutex);
-@@ -716,7 +716,7 @@ pipe_poll(struct file *filp, poll_table *wait)
+ __pipe_unlock(pipe);
+@@ -709,7 +709,7 @@ pipe_poll(struct file *filp, poll_table *wait)
mask = 0;
if (filp->f_mode & FMODE_READ) {
mask = (nrbufs > 0) ? POLLIN | POLLRDNORM : 0;
@@ -54826,7 +54748,7 @@ index 2234f3f..f9083a1 100644
mask |= POLLHUP;
}
-@@ -726,7 +726,7 @@ pipe_poll(struct file *filp, poll_table *wait)
+@@ -719,7 +719,7 @@ pipe_poll(struct file *filp, poll_table *wait)
* Most Unices do not set POLLERR for FIFOs but on Linux they
* behave exactly like pipes for poll().
*/
@@ -54835,52 +54757,30 @@ index 2234f3f..f9083a1 100644
mask |= POLLERR;
}
-@@ -740,10 +740,10 @@ pipe_release(struct inode *inode, int decr, int decw)
+@@ -734,17 +734,17 @@ pipe_release(struct inode *inode, struct file *file)
- mutex_lock(&inode->i_mutex);
- pipe = inode->i_pipe;
-- pipe->readers -= decr;
-- pipe->writers -= decw;
-+ atomic_sub(decr, &pipe->readers);
-+ atomic_sub(decw, &pipe->writers);
-
-- if (!pipe->readers && !pipe->writers) {
-+ if (!atomic_read(&pipe->readers) && !atomic_read(&pipe->writers)) {
- free_pipe_info(inode);
- } else {
- wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP);
-@@ -833,7 +833,7 @@ pipe_read_open(struct inode *inode, struct file *filp)
+ __pipe_lock(pipe);
+ if (file->f_mode & FMODE_READ)
+- pipe->readers--;
++ atomic_dec(&pipe->readers);
+ if (file->f_mode & FMODE_WRITE)
+- pipe->writers--;
++ atomic_dec(&pipe->writers);
- if (inode->i_pipe) {
- ret = 0;
-- inode->i_pipe->readers++;
-+ atomic_inc(&inode->i_pipe->readers);
- }
-
- mutex_unlock(&inode->i_mutex);
-@@ -850,7 +850,7 @@ pipe_write_open(struct inode *inode, struct file *filp)
-
- if (inode->i_pipe) {
- ret = 0;
-- inode->i_pipe->writers++;
-+ atomic_inc(&inode->i_pipe->writers);
+- if (pipe->readers || pipe->writers) {
++ if (atomic_read(&pipe->readers) || atomic_read(&pipe->writers)) {
+ wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP);
+ kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
+ kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
}
-
- mutex_unlock(&inode->i_mutex);
-@@ -871,9 +871,9 @@ pipe_rdwr_open(struct inode *inode, struct file *filp)
- if (inode->i_pipe) {
- ret = 0;
- if (filp->f_mode & FMODE_READ)
-- inode->i_pipe->readers++;
-+ atomic_inc(&inode->i_pipe->readers);
- if (filp->f_mode & FMODE_WRITE)
-- inode->i_pipe->writers++;
-+ atomic_inc(&inode->i_pipe->writers);
+ spin_lock(&inode->i_lock);
+- if (!--pipe->files) {
++ if (atomic_dec_and_test(&pipe->files)) {
+ inode->i_pipe = NULL;
+ kill = 1;
}
-
- mutex_unlock(&inode->i_mutex);
-@@ -965,7 +965,7 @@ void free_pipe_info(struct inode *inode)
- inode->i_pipe = NULL;
+@@ -811,7 +811,7 @@ void free_pipe_info(struct pipe_inode_info *pipe)
+ kfree(pipe);
}
-static struct vfsmount *pipe_mnt __read_mostly;
@@ -54888,16 +54788,109 @@ index 2234f3f..f9083a1 100644
/*
* pipefs_dname() is called from d_path().
-@@ -995,7 +995,8 @@ static struct inode * get_pipe_inode(void)
+@@ -841,8 +841,9 @@ static struct inode * get_pipe_inode(void)
goto fail_iput;
- inode->i_pipe = pipe;
+ inode->i_pipe = pipe;
+- pipe->files = 2;
- pipe->readers = pipe->writers = 1;
++ atomic_set(&pipe->files, 2);
+ atomic_set(&pipe->readers, 1);
+ atomic_set(&pipe->writers, 1);
- inode->i_fop = &rdwr_pipefifo_fops;
+ inode->i_fop = &pipefifo_fops;
/*
+@@ -1022,17 +1023,17 @@ static int fifo_open(struct inode *inode, struct file *filp)
+ spin_lock(&inode->i_lock);
+ if (inode->i_pipe) {
+ pipe = inode->i_pipe;
+- pipe->files++;
++ atomic_inc(&pipe->files);
+ spin_unlock(&inode->i_lock);
+ } else {
+ spin_unlock(&inode->i_lock);
+ pipe = alloc_pipe_info();
+ if (!pipe)
+ return -ENOMEM;
+- pipe->files = 1;
++ atomic_set(&pipe->files, 1);
+ spin_lock(&inode->i_lock);
+ if (unlikely(inode->i_pipe)) {
+- inode->i_pipe->files++;
++ atomic_inc(&inode->i_pipe->files);
+ spin_unlock(&inode->i_lock);
+ free_pipe_info(pipe);
+ pipe = inode->i_pipe;
+@@ -1057,10 +1058,10 @@ static int fifo_open(struct inode *inode, struct file *filp)
+ * opened, even when there is no process writing the FIFO.
+ */
+ pipe->r_counter++;
+- if (pipe->readers++ == 0)
++ if (atomic_inc_return(&pipe->readers) == 1)
+ wake_up_partner(pipe);
+
+- if (!is_pipe && !pipe->writers) {
++ if (!is_pipe && !atomic_read(&pipe->writers)) {
+ if ((filp->f_flags & O_NONBLOCK)) {
+ /* suppress POLLHUP until we have
+ * seen a writer */
+@@ -1079,14 +1080,14 @@ static int fifo_open(struct inode *inode, struct file *filp)
+ * errno=ENXIO when there is no process reading the FIFO.
+ */
+ ret = -ENXIO;
+- if (!is_pipe && (filp->f_flags & O_NONBLOCK) && !pipe->readers)
++ if (!is_pipe && (filp->f_flags & O_NONBLOCK) && !atomic_read(&pipe->readers))
+ goto err;
+
+ pipe->w_counter++;
+- if (!pipe->writers++)
++ if (atomic_inc_return(&pipe->writers) == 1)
+ wake_up_partner(pipe);
+
+- if (!is_pipe && !pipe->readers) {
++ if (!is_pipe && !atomic_read(&pipe->readers)) {
+ if (wait_for_partner(pipe, &pipe->r_counter))
+ goto err_wr;
+ }
+@@ -1100,11 +1101,11 @@ static int fifo_open(struct inode *inode, struct file *filp)
+ * the process can at least talk to itself.
+ */
+
+- pipe->readers++;
+- pipe->writers++;
++ atomic_inc(&pipe->readers);
++ atomic_inc(&pipe->writers);
+ pipe->r_counter++;
+ pipe->w_counter++;
+- if (pipe->readers == 1 || pipe->writers == 1)
++ if (atomic_read(&pipe->readers) == 1 || atomic_read(&pipe->writers) == 1)
+ wake_up_partner(pipe);
+ break;
+
+@@ -1118,20 +1119,20 @@ static int fifo_open(struct inode *inode, struct file *filp)
+ return 0;
+
+ err_rd:
+- if (!--pipe->readers)
++ if (atomic_dec_and_test(&pipe->readers))
+ wake_up_interruptible(&pipe->wait);
+ ret = -ERESTARTSYS;
+ goto err;
+
+ err_wr:
+- if (!--pipe->writers)
++ if (atomic_dec_and_test(&pipe->writers))
+ wake_up_interruptible(&pipe->wait);
+ ret = -ERESTARTSYS;
+ goto err;
+
+ err:
+ spin_lock(&inode->i_lock);
+- if (!--pipe->files) {
++ if (atomic_dec_and_test(&pipe->files)) {
+ inode->i_pipe = NULL;
+ kill = 1;
+ }
diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig
index 15af622..0e9f4467 100644
--- a/fs/proc/Kconfig
@@ -55083,10 +55076,10 @@ index cbd0f1b..adec3f0 100644
static struct pid *
get_children_pid(struct inode *inode, struct pid *pid_prev, loff_t pos)
diff --git a/fs/proc/base.c b/fs/proc/base.c
-index 69078c7..3e12a75 100644
+index c3834da..b402b2b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
-@@ -112,6 +112,14 @@ struct pid_entry {
+@@ -113,6 +113,14 @@ struct pid_entry {
union proc_op op;
};
@@ -55101,7 +55094,7 @@ index 69078c7..3e12a75 100644
#define NOD(NAME, MODE, IOP, FOP, OP) { \
.name = (NAME), \
.len = sizeof(NAME) - 1, \
-@@ -209,6 +217,9 @@ static int proc_pid_cmdline(struct task_struct *task, char * buffer)
+@@ -210,6 +218,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 */
@@ -55111,7 +55104,7 @@ index 69078c7..3e12a75 100644
len = mm->arg_end - mm->arg_start;
if (len > PAGE_SIZE)
-@@ -236,12 +247,28 @@ out:
+@@ -237,12 +248,28 @@ out:
return res;
}
@@ -55140,7 +55133,7 @@ index 69078c7..3e12a75 100644
do {
nwords += 2;
} while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */
-@@ -255,7 +282,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer)
+@@ -256,7 +283,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer)
}
@@ -55149,7 +55142,7 @@ index 69078c7..3e12a75 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.
-@@ -294,7 +321,7 @@ static void unlock_trace(struct task_struct *task)
+@@ -295,7 +322,7 @@ static void unlock_trace(struct task_struct *task)
mutex_unlock(&task->signal->cred_guard_mutex);
}
@@ -55158,7 +55151,7 @@ index 69078c7..3e12a75 100644
#define MAX_STACK_TRACE_DEPTH 64
-@@ -486,7 +513,7 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)
+@@ -518,7 +545,7 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)
return count;
}
@@ -55167,7 +55160,7 @@ index 69078c7..3e12a75 100644
static int proc_pid_syscall(struct task_struct *task, char *buffer)
{
long nr;
-@@ -515,7 +542,7 @@ static int proc_pid_syscall(struct task_struct *task, char *buffer)
+@@ -547,7 +574,7 @@ static int proc_pid_syscall(struct task_struct *task, char *buffer)
/************************************************************************/
/* permission checks */
@@ -55176,7 +55169,7 @@ index 69078c7..3e12a75 100644
{
struct task_struct *task;
int allowed = 0;
-@@ -525,7 +552,10 @@ static int proc_fd_access_allowed(struct inode *inode)
+@@ -557,7 +584,10 @@ static int proc_fd_access_allowed(struct inode *inode)
*/
task = get_proc_task(inode);
if (task) {
@@ -55188,7 +55181,7 @@ index 69078c7..3e12a75 100644
put_task_struct(task);
}
return allowed;
-@@ -556,10 +586,35 @@ static bool has_pid_permissions(struct pid_namespace *pid,
+@@ -588,10 +618,35 @@ static bool has_pid_permissions(struct pid_namespace *pid,
struct task_struct *task,
int hide_pid_min)
{
@@ -55224,7 +55217,7 @@ index 69078c7..3e12a75 100644
return ptrace_may_access(task, PTRACE_MODE_READ);
}
-@@ -577,7 +632,11 @@ static int proc_pid_permission(struct inode *inode, int mask)
+@@ -609,7 +664,11 @@ static int proc_pid_permission(struct inode *inode, int mask)
put_task_struct(task);
if (!has_perms) {
@@ -55236,7 +55229,7 @@ index 69078c7..3e12a75 100644
/*
* Let's make getdents(), stat(), and open()
* consistent with each other. If a process
-@@ -675,6 +734,11 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
+@@ -707,6 +766,11 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
if (!task)
return -ESRCH;
@@ -55248,7 +55241,7 @@ index 69078c7..3e12a75 100644
mm = mm_access(task, mode);
put_task_struct(task);
-@@ -690,6 +754,10 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
+@@ -722,6 +786,10 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
file->private_data = mm;
@@ -55259,7 +55252,7 @@ index 69078c7..3e12a75 100644
return 0;
}
-@@ -711,6 +779,17 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
+@@ -743,6 +811,17 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
ssize_t copied;
char *page;
@@ -55277,7 +55270,7 @@ index 69078c7..3e12a75 100644
if (!mm)
return 0;
-@@ -723,7 +802,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
+@@ -755,7 +834,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
goto free;
while (count > 0) {
@@ -55286,7 +55279,7 @@ index 69078c7..3e12a75 100644
if (write && copy_from_user(page, buf, this_len)) {
copied = -EFAULT;
-@@ -815,6 +894,13 @@ static ssize_t environ_read(struct file *file, char __user *buf,
+@@ -847,6 +926,13 @@ static ssize_t environ_read(struct file *file, char __user *buf,
if (!mm)
return 0;
@@ -55300,7 +55293,7 @@ index 69078c7..3e12a75 100644
page = (char *)__get_free_page(GFP_TEMPORARY);
if (!page)
return -ENOMEM;
-@@ -824,7 +910,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,
+@@ -856,7 +942,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,
goto free;
while (count > 0) {
size_t this_len, max_len;
@@ -55309,7 +55302,7 @@ index 69078c7..3e12a75 100644
if (src >= (mm->env_end - mm->env_start))
break;
-@@ -1430,7 +1516,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
+@@ -1461,7 +1547,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
int error = -EACCES;
/* Are we allowed to snoop on the tasks file descriptors? */
@@ -55318,7 +55311,7 @@ index 69078c7..3e12a75 100644
goto out;
error = PROC_I(inode)->op.proc_get_link(dentry, &path);
-@@ -1474,8 +1560,18 @@ static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int b
+@@ -1505,8 +1591,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? */
@@ -55339,7 +55332,7 @@ index 69078c7..3e12a75 100644
error = PROC_I(inode)->op.proc_get_link(dentry, &path);
if (error)
-@@ -1525,7 +1621,11 @@ struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *t
+@@ -1556,7 +1652,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;
@@ -55351,7 +55344,7 @@ index 69078c7..3e12a75 100644
rcu_read_unlock();
}
security_task_to_inode(task, inode);
-@@ -1561,10 +1661,19 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
+@@ -1592,10 +1692,19 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
return -ENOENT;
}
if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) ||
@@ -55371,7 +55364,7 @@ index 69078c7..3e12a75 100644
}
}
rcu_read_unlock();
-@@ -1602,11 +1711,20 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags)
+@@ -1633,11 +1742,20 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags)
if (task) {
if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) ||
@@ -55392,7 +55385,7 @@ index 69078c7..3e12a75 100644
rcu_read_unlock();
} else {
inode->i_uid = GLOBAL_ROOT_UID;
-@@ -2059,6 +2177,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
+@@ -2196,6 +2314,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
if (!task)
goto out_no_task;
@@ -55402,7 +55395,7 @@ index 69078c7..3e12a75 100644
/*
* Yes, it does not scale. And it should not. Don't add
* new entries into /proc/<tgid>/ without very good reasons.
-@@ -2103,6 +2224,9 @@ static int proc_pident_readdir(struct file *filp,
+@@ -2240,6 +2361,9 @@ static int proc_pident_readdir(struct file *filp,
if (!task)
goto out_no_task;
@@ -55412,7 +55405,7 @@ index 69078c7..3e12a75 100644
ret = 0;
i = filp->f_pos;
switch (i) {
-@@ -2516,7 +2640,7 @@ static const struct pid_entry tgid_base_stuff[] = {
+@@ -2653,7 +2777,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),
@@ -55421,7 +55414,7 @@ index 69078c7..3e12a75 100644
INF("syscall", S_IRUGO, proc_pid_syscall),
#endif
INF("cmdline", S_IRUGO, proc_pid_cmdline),
-@@ -2541,10 +2665,10 @@ static const struct pid_entry tgid_base_stuff[] = {
+@@ -2678,10 +2802,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
@@ -55434,7 +55427,7 @@ index 69078c7..3e12a75 100644
ONE("stack", S_IRUGO, proc_pid_stack),
#endif
#ifdef CONFIG_SCHEDSTATS
-@@ -2578,6 +2702,9 @@ static const struct pid_entry tgid_base_stuff[] = {
+@@ -2715,6 +2839,9 @@ static const struct pid_entry tgid_base_stuff[] = {
#ifdef CONFIG_HARDWALL
INF("hardwall", S_IRUGO, proc_pid_hardwall),
#endif
@@ -55444,7 +55437,7 @@ index 69078c7..3e12a75 100644
#ifdef CONFIG_USER_NS
REG("uid_map", S_IRUGO|S_IWUSR, proc_uid_map_operations),
REG("gid_map", S_IRUGO|S_IWUSR, proc_gid_map_operations),
-@@ -2707,7 +2834,14 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
+@@ -2847,7 +2974,14 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
if (!inode)
goto out;
@@ -55459,7 +55452,7 @@ index 69078c7..3e12a75 100644
inode->i_op = &proc_tgid_base_inode_operations;
inode->i_fop = &proc_tgid_base_operations;
inode->i_flags|=S_IMMUTABLE;
-@@ -2745,7 +2879,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, unsign
+@@ -2885,7 +3019,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, unsign
if (!task)
goto out;
@@ -55471,7 +55464,7 @@ index 69078c7..3e12a75 100644
put_task_struct(task);
out:
return result;
-@@ -2808,6 +2946,8 @@ static int proc_pid_fill_cache(struct file *filp, void *dirent, filldir_t filldi
+@@ -2948,6 +3086,8 @@ static int proc_pid_fill_cache(struct file *filp, void *dirent, filldir_t filldi
static int fake_filldir(void *buf, const char *name, int namelen,
loff_t offset, u64 ino, unsigned d_type)
{
@@ -55480,7 +55473,7 @@ index 69078c7..3e12a75 100644
return 0;
}
-@@ -2859,7 +2999,7 @@ static const struct pid_entry tid_base_stuff[] = {
+@@ -3007,7 +3147,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),
@@ -55489,7 +55482,7 @@ index 69078c7..3e12a75 100644
INF("syscall", S_IRUGO, proc_pid_syscall),
#endif
INF("cmdline", S_IRUGO, proc_pid_cmdline),
-@@ -2886,10 +3026,10 @@ static const struct pid_entry tid_base_stuff[] = {
+@@ -3034,10 +3174,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
@@ -55573,13 +55566,13 @@ index d7a4a28..0201742 100644
}
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
-index 869116c..820cb27 100644
+index 073aea6..0630370 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
-@@ -22,11 +22,17 @@
- #include <linux/seq_file.h>
+@@ -23,11 +23,17 @@
#include <linux/slab.h>
#include <linux/mount.h>
+ #include <linux/magic.h>
+#include <linux/grsecurity.h>
#include <asm/uaccess.h>
@@ -55594,8 +55587,8 @@ index 869116c..820cb27 100644
static void proc_evict_inode(struct inode *inode)
{
struct proc_dir_entry *de;
-@@ -54,6 +60,13 @@ static void proc_evict_inode(struct inode *inode)
- ns = PROC_I(inode)->ns;
+@@ -55,6 +61,13 @@ static void proc_evict_inode(struct inode *inode)
+ ns = PROC_I(inode)->ns.ns;
if (ns_ops && ns)
ns_ops->put(ns);
+
@@ -55608,7 +55601,7 @@ index 869116c..820cb27 100644
}
static struct kmem_cache * proc_inode_cachep;
-@@ -456,7 +469,11 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
+@@ -385,7 +398,11 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
if (de->mode) {
inode->i_mode = de->mode;
inode->i_uid = de->uid;
@@ -55621,24 +55614,24 @@ index 869116c..820cb27 100644
if (de->size)
inode->i_size = de->size;
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
-index 85ff3a4..a512bd8 100644
+index d600fb0..3b495fe 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
-@@ -56,6 +56,9 @@ extern int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
- struct pid *pid, struct task_struct *task);
- extern int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
- struct pid *pid, struct task_struct *task);
+@@ -155,6 +155,9 @@ extern int proc_pid_status(struct seq_file *, struct pid_namespace *,
+ struct pid *, struct task_struct *);
+ extern int proc_pid_statm(struct seq_file *, struct pid_namespace *,
+ struct pid *, struct task_struct *);
+#ifdef CONFIG_GRKERNSEC_PROC_IPADDR
+extern int proc_pid_ipaddr(struct task_struct *task, char *buffer);
+#endif
- extern loff_t mem_lseek(struct file *file, loff_t offset, int orig);
- extern const struct file_operations proc_tid_children_operations;
+ /*
+ * base.c
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
-index eda6f01..006ae24 100644
+index 0a22194..a9fc8c1 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
-@@ -481,9 +481,10 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
+@@ -484,9 +484,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);
@@ -55651,7 +55644,7 @@ index eda6f01..006ae24 100644
while (buflen) {
struct kcore_list *m;
-@@ -512,20 +513,23 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
+@@ -515,20 +516,23 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
kfree(elf_buf);
} else {
if (kern_addr_valid(start)) {
@@ -55686,7 +55679,7 @@ index eda6f01..006ae24 100644
} else {
if (clear_user(buffer, tsz))
return -EFAULT;
-@@ -545,6 +549,9 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
+@@ -548,6 +552,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)
{
@@ -55697,10 +55690,10 @@ index eda6f01..006ae24 100644
return -EPERM;
if (kcore_need_update)
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
-index 1efaaa1..834e49a 100644
+index 5aa847a..f77c8d4 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
-@@ -158,7 +158,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
+@@ -159,7 +159,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
vmi.used >> 10,
vmi.largest_chunk >> 10
#ifdef CONFIG_MEMORY_FAILURE
@@ -55723,7 +55716,7 @@ index ccfd99b..1b7e255 100644
seq_putc(m, '\n');
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
-index b4ac657..0842bd2 100644
+index 986e832..6e8e859 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -23,6 +23,7 @@
@@ -55734,7 +55727,7 @@ index b4ac657..0842bd2 100644
#include "internal.h"
-@@ -105,6 +106,17 @@ static struct net *get_proc_task_net(struct inode *dir)
+@@ -109,6 +110,17 @@ static struct net *get_proc_task_net(struct inode *dir)
struct task_struct *task;
struct nsproxy *ns;
struct net *net = NULL;
@@ -55940,10 +55933,10 @@ index ac05f33..1e6dc7e 100644
kfree(ctl_table_arg);
goto out;
diff --git a/fs/proc/root.c b/fs/proc/root.c
-index 9c7fab1..ed1c8e0 100644
+index 41a6ea9..23eaa92 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
-@@ -180,7 +180,15 @@ void __init proc_root_init(void)
+@@ -182,7 +182,15 @@ void __init proc_root_init(void)
#ifdef CONFIG_PROC_DEVICETREE
proc_device_tree_init();
#endif
@@ -55960,10 +55953,10 @@ index 9c7fab1..ed1c8e0 100644
}
diff --git a/fs/proc/self.c b/fs/proc/self.c
-index aa5cc3b..c91a5d0 100644
+index 6b6a993..807cccc 100644
--- a/fs/proc/self.c
+++ b/fs/proc/self.c
-@@ -37,7 +37,7 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
+@@ -39,7 +39,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)
{
@@ -56194,10 +56187,10 @@ index 56123a6..5a2f6ec 100644
pid_t tid = vm_is_stack(priv->task, vma, is_pid);
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
-index b870f74..e9048df 100644
+index 17f7e08..e4b1529 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
-@@ -98,9 +98,13 @@ static ssize_t read_from_oldmem(char *buf, size_t count,
+@@ -99,9 +99,13 @@ static ssize_t read_from_oldmem(char *buf, size_t count,
nr_bytes = count;
/* If pfn is not ram, return zeros for sparse dump files */
@@ -56214,7 +56207,7 @@ index b870f74..e9048df 100644
tmp = copy_oldmem_page(pfn, buf, nr_bytes,
offset, userbuf);
if (tmp < 0)
-@@ -185,7 +189,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
+@@ -186,7 +190,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
if (tsz > nr_bytes)
tsz = nr_bytes;
@@ -56268,10 +56261,10 @@ index 16e8abb..2dcf914 100644
if (!msg_head) {
printk(KERN_ERR
diff --git a/fs/read_write.c b/fs/read_write.c
-index e6ddc8d..9155227 100644
+index 2cefa41..c7e2fe0 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
-@@ -429,7 +429,7 @@ ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t
+@@ -411,7 +411,7 @@ ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t
old_fs = get_fs();
set_fs(get_ds());
@@ -56396,7 +56389,7 @@ index 2b7882b..1c5ef48 100644
/* balance leaf returns 0 except if combining L R and S into
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
-index 9cc0740a..46bf953 100644
+index 33532f7..4846ade 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -112,7 +112,7 @@ static int show_super(struct seq_file *m, struct super_block *sb)
@@ -56451,7 +56444,7 @@ index 8c1c96c..a0f9b6d 100644
return -EINVAL;
diff --git a/fs/seq_file.c b/fs/seq_file.c
-index 38bb59f..a304f9d 100644
+index 774c1eb..b67582a 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -10,6 +10,7 @@
@@ -56518,10 +56511,10 @@ index 38bb59f..a304f9d 100644
if (op) {
diff --git a/fs/splice.c b/fs/splice.c
-index 29e394e..b13c247 100644
+index d37431d..81c3044 100644
--- a/fs/splice.c
+++ b/fs/splice.c
-@@ -195,7 +195,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
+@@ -196,7 +196,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
pipe_lock(pipe);
for (;;) {
@@ -56530,7 +56523,16 @@ index 29e394e..b13c247 100644
send_sig(SIGPIPE, current, 0);
if (!ret)
ret = -EPIPE;
-@@ -249,9 +249,9 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
+@@ -219,7 +219,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
+ page_nr++;
+ ret += buf->len;
+
+- if (pipe->files)
++ if (atomic_read(&pipe->files))
+ do_wakeup = 1;
+
+ if (!--spd->nr_pages)
+@@ -250,9 +250,9 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
do_wakeup = 0;
}
@@ -56542,7 +56544,7 @@ index 29e394e..b13c247 100644
}
pipe_unlock(pipe);
-@@ -564,7 +564,7 @@ static ssize_t kernel_readv(struct file *file, const struct iovec *vec,
+@@ -565,7 +565,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() */
@@ -56551,7 +56553,7 @@ index 29e394e..b13c247 100644
set_fs(old_fs);
return res;
-@@ -579,7 +579,7 @@ ssize_t kernel_write(struct file *file, const char *buf, size_t count,
+@@ -580,7 +580,7 @@ ssize_t kernel_write(struct file *file, const char *buf, size_t count,
old_fs = get_fs();
set_fs(get_ds());
/* The cast to a user pointer is valid due to the set_fs() */
@@ -56560,7 +56562,7 @@ index 29e394e..b13c247 100644
set_fs(old_fs);
return res;
-@@ -632,7 +632,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
+@@ -633,7 +633,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);
@@ -56569,7 +56571,16 @@ index 29e394e..b13c247 100644
vec[i].iov_len = this_len;
spd.pages[i] = page;
spd.nr_pages++;
-@@ -853,10 +853,10 @@ EXPORT_SYMBOL(splice_from_pipe_feed);
+@@ -829,7 +829,7 @@ int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_desc *sd,
+ ops->release(pipe, buf);
+ pipe->curbuf = (pipe->curbuf + 1) & (pipe->buffers - 1);
+ pipe->nrbufs--;
+- if (pipe->files)
++ if (atomic_read(&pipe->files))
+ sd->need_wakeup = true;
+ }
+
+@@ -854,10 +854,10 @@ EXPORT_SYMBOL(splice_from_pipe_feed);
int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
{
while (!pipe->nrbufs) {
@@ -56582,7 +56593,7 @@ index 29e394e..b13c247 100644
return 0;
if (sd->flags & SPLICE_F_NONBLOCK)
-@@ -1192,7 +1192,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
+@@ -1193,7 +1193,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.
*/
@@ -56591,7 +56602,7 @@ index 29e394e..b13c247 100644
current->splice_pipe = pipe;
}
-@@ -1741,9 +1741,9 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
+@@ -1769,9 +1769,9 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
ret = -ERESTARTSYS;
break;
}
@@ -56603,7 +56614,7 @@ index 29e394e..b13c247 100644
if (flags & SPLICE_F_NONBLOCK) {
ret = -EAGAIN;
break;
-@@ -1775,7 +1775,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
+@@ -1803,7 +1803,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
pipe_lock(pipe);
while (pipe->nrbufs >= pipe->buffers) {
@@ -56612,7 +56623,7 @@ index 29e394e..b13c247 100644
send_sig(SIGPIPE, current, 0);
ret = -EPIPE;
break;
-@@ -1788,9 +1788,9 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
+@@ -1816,9 +1816,9 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
ret = -ERESTARTSYS;
break;
}
@@ -56624,7 +56635,7 @@ index 29e394e..b13c247 100644
}
pipe_unlock(pipe);
-@@ -1826,14 +1826,14 @@ retry:
+@@ -1854,14 +1854,14 @@ retry:
pipe_double_lock(ipipe, opipe);
do {
@@ -56641,7 +56652,7 @@ index 29e394e..b13c247 100644
break;
/*
-@@ -1930,7 +1930,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
+@@ -1958,7 +1958,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
pipe_double_lock(ipipe, opipe);
do {
@@ -56650,7 +56661,7 @@ index 29e394e..b13c247 100644
send_sig(SIGPIPE, current, 0);
if (!ret)
ret = -EPIPE;
-@@ -1975,7 +1975,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
+@@ -2003,7 +2003,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
*/
@@ -56718,7 +56729,7 @@ index 15c68f9..36a8b3e 100644
if (!bb->vm_ops)
return -EINVAL;
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
-index 6f31590..3c87c8a 100644
+index e8e0e71..3ca455a 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -40,7 +40,7 @@ static DEFINE_IDA(sysfs_ino_ida);
@@ -56730,7 +56741,7 @@ index 6f31590..3c87c8a 100644
{
unsigned long hash = init_name_hash();
unsigned int len = strlen(name);
-@@ -685,6 +685,18 @@ static int create_dir(struct kobject *kobj, struct sysfs_dirent *parent_sd,
+@@ -679,6 +679,18 @@ static int create_dir(struct kobject *kobj, struct sysfs_dirent *parent_sd,
struct sysfs_dirent *sd;
int rc;
@@ -57005,20 +57016,20 @@ index 9fbea87..6b19972 100644
struct posix_acl *acl;
struct posix_acl_entry *acl_e;
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
-index b44af92..06073da 100644
+index 8904284..ee0e14b 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
-@@ -192,7 +192,7 @@ xfs_bmap_validate_ret(
- int nmap,
- int ret_nmap);
+@@ -765,7 +765,7 @@ xfs_bmap_validate_ret(
+
#else
+ #define xfs_bmap_check_leaf_extents(cur, ip, whichfork) do { } while (0)
-#define xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap)
-+#define xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap) do {} while (0)
++#define xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap) do { } while (0)
#endif /* DEBUG */
- STATIC int
+ /*
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c
-index 1b9fc3e..e1bdde0 100644
+index 6157424..ac98f6d 100644
--- a/fs/xfs/xfs_dir2_sf.c
+++ b/fs/xfs/xfs_dir2_sf.c
@@ -851,7 +851,15 @@ xfs_dir2_sf_getdents(
@@ -57039,7 +57050,7 @@ index 1b9fc3e..e1bdde0 100644
*offset = off & 0x7fffffff;
return 0;
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
-index d681e34..2a3f5ab 100644
+index 5e99968..45bd327 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -127,7 +127,7 @@ xfs_find_handle(
@@ -67651,10 +67662,10 @@ index a59ff51..2594a70 100644
#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
-index afa12c7..99d4da0 100644
+index eb58d2d..df131bf 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
-@@ -245,6 +245,7 @@
+@@ -239,6 +239,7 @@
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_rodata) = .; \
*(.rodata) *(.rodata.*) \
@@ -67662,7 +67673,7 @@ index afa12c7..99d4da0 100644
*(__vermagic) /* Kernel version magic */ \
. = ALIGN(8); \
VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \
-@@ -755,17 +756,18 @@
+@@ -749,17 +750,18 @@
* section in the linker script will go there too. @phdr should have
* a leading colon.
*
@@ -67699,7 +67710,7 @@ index 418d270..bfd2794 100644
struct crypto_instance {
struct crypto_alg alg;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index f1ce786..086a7a5 100644
+index 63d17ee..716de2b 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -72,6 +72,7 @@
@@ -67725,19 +67736,20 @@ index f1ce786..086a7a5 100644
unsigned long arg);
#define DRM_IOCTL_NR(n) _IOC_NR(n)
-@@ -314,9 +317,9 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
+@@ -314,10 +317,10 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
struct drm_ioctl_desc {
unsigned int cmd;
int flags;
- drm_ioctl_t *func;
+ drm_ioctl_t func;
unsigned int cmd_drv;
+ const char *name;
-};
+} __do_const;
/**
* Creates a driver or general drm_ioctl_desc array entry for the given
-@@ -1014,7 +1017,7 @@ struct drm_info_list {
+@@ -1015,7 +1018,7 @@ struct drm_info_list {
int (*show)(struct seq_file*, void*); /** show callback */
u32 driver_features; /**< Required driver features for this entry */
void *data;
@@ -67746,7 +67758,7 @@ index f1ce786..086a7a5 100644
/**
* debugfs node structure. This structure represents a debugfs file.
-@@ -1087,7 +1090,7 @@ struct drm_device {
+@@ -1088,7 +1091,7 @@ struct drm_device {
/** \name Usage Counters */
/*@{ */
@@ -67755,7 +67767,7 @@ index f1ce786..086a7a5 100644
atomic_t ioctl_count; /**< Outstanding IOCTLs pending */
atomic_t vma_count; /**< Outstanding vma areas open */
int buf_use; /**< Buffers in use -- cannot alloc */
-@@ -1098,7 +1101,7 @@ struct drm_device {
+@@ -1099,7 +1102,7 @@ struct drm_device {
/*@{ */
unsigned long counters;
enum drm_stat_type types[15];
@@ -67826,7 +67838,7 @@ index c1da539..1dcec55 100644
struct atmphy_ops {
int (*start)(struct atm_dev *dev);
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
-index c3a0914..ec5d48a 100644
+index 70cf138..cabb82e 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -73,8 +73,9 @@ struct linux_binfmt {
@@ -67841,10 +67853,10 @@ index c3a0914..ec5d48a 100644
extern void __register_binfmt(struct linux_binfmt *fmt, int insert);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
-index 33f358f..7f2c27f 100644
+index 2fdb4a4..54aad7e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
-@@ -1499,7 +1499,7 @@ struct block_device_operations {
+@@ -1526,7 +1526,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;
@@ -67912,7 +67924,7 @@ index 8609d57..86e4d79 100644
int (*generic_packet) (struct cdrom_device_info *,
struct packet_command *);
diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h
-index 42e55de..1cd0e66 100644
+index 4ce9056..86caac6 100644
--- a/include/linux/cleancache.h
+++ b/include/linux/cleancache.h
@@ -31,7 +31,7 @@ struct cleancache_ops {
@@ -67922,40 +67934,44 @@ index 42e55de..1cd0e66 100644
-};
+} __no_const;
- extern struct cleancache_ops
+ extern struct cleancache_ops *
cleancache_register_ops(struct cleancache_ops *ops);
+diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
+index 1186098..f87e53d 100644
+--- a/include/linux/clk-provider.h
++++ b/include/linux/clk-provider.h
+@@ -132,6 +132,7 @@ struct clk_ops {
+ unsigned long);
+ void (*init)(struct clk_hw *hw);
+ };
++typedef struct clk_ops __no_const clk_ops_no_const;
+
+ /**
+ * struct clk_init_data - holds init data that's common to all clocks and is
diff --git a/include/linux/compat.h b/include/linux/compat.h
-index 377cd8c..2479845 100644
+index 7f0c1dd..b5729c6 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
-@@ -332,14 +332,14 @@ long compat_sys_msgsnd(int first, int second, int third, void __user *uptr);
- long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
- int version, void __user *uptr);
- long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
-- void __user *uptr);
-+ void __user *uptr) __intentional_overflow(0);
- #else
- long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
- long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp,
+@@ -312,7 +312,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
+ compat_size_t __user *len_ptr);
+
+ asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32);
+-asmlinkage long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg);
++asmlinkage long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg) __intentional_overflow(0);
+ asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
+ asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp,
compat_ssize_t msgsz, int msgflg);
- long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp,
- compat_ssize_t msgsz, long msgtyp, int msgflg);
--long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg);
-+long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg) __intentional_overflow(0);
- #endif
- long compat_sys_msgctl(int first, int second, void __user *uptr);
- long compat_sys_shmctl(int first, int second, void __user *uptr);
-@@ -442,7 +442,7 @@ extern int compat_ptrace_request(struct task_struct *child,
+@@ -419,7 +419,7 @@ extern int compat_ptrace_request(struct task_struct *child,
extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
compat_ulong_t addr, compat_ulong_t data);
asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
- compat_long_t addr, compat_long_t data);
+ compat_ulong_t addr, compat_ulong_t data);
+ asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, size_t);
/*
- * epoll (fs/eventpoll.c) compat bits follow ...
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
-index 68b162d..660f5f0 100644
+index 842de22..7f3a41f 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -39,9 +39,29 @@
@@ -67989,7 +68005,7 @@ index 68b162d..660f5f0 100644
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
-index 10b8f23..5e0b083 100644
+index 92669cd..1771a15 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -5,11 +5,14 @@
@@ -68107,7 +68123,7 @@ index 10b8f23..5e0b083 100644
/* Simple shorthand for a section definition */
#ifndef __section
# define __section(S) __attribute__ ((__section__(#S)))
-@@ -349,6 +407,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
+@@ -349,7 +407,8 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
* use is to mediate communication between process-level code and irq/NMI
* handlers, all running on the same CPU.
*/
@@ -68115,7 +68131,8 @@ index 10b8f23..5e0b083 100644
+#define ACCESS_ONCE(x) (*(volatile const typeof(x) *)&(x))
+#define ACCESS_ONCE_RW(x) (*(volatile typeof(x) *)&(x))
- #endif /* __LINUX_COMPILER_H */
+ /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */
+ #ifdef CONFIG_KPROBES
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 33f0280..35c6568 100644
--- a/include/linux/completion.h
@@ -68153,7 +68170,7 @@ index 34025df..d94bbbc 100644
/*
* Users often need to create attribute structures for their configurable
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
-index 714e792..e6130d9 100644
+index 9f3c7e8..a18c7b6 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -115,7 +115,7 @@ enum {
@@ -68166,10 +68183,10 @@ index 714e792..e6130d9 100644
register_cpu_notifier(&fn##_nb); \
}
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
-index a22944c..4e695fe 100644
+index 037d36a..ca5fe6e 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
-@@ -252,7 +252,7 @@ struct cpufreq_driver {
+@@ -262,7 +262,7 @@ struct cpufreq_driver {
int (*suspend) (struct cpufreq_policy *policy);
int (*resume) (struct cpufreq_policy *policy);
struct freq_attr **attr;
@@ -68178,7 +68195,7 @@ index a22944c..4e695fe 100644
/* flags */
-@@ -311,6 +311,7 @@ struct global_attr {
+@@ -321,6 +321,7 @@ struct global_attr {
ssize_t (*store)(struct kobject *a, struct attribute *b,
const char *c, size_t count);
};
@@ -68187,7 +68204,7 @@ index a22944c..4e695fe 100644
#define define_one_global_ro(_name) \
static struct global_attr _name = \
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
-index 480c14d..552896f 100644
+index 8f04062..900239a 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -52,7 +52,8 @@ struct cpuidle_state {
@@ -68200,7 +68217,7 @@ index 480c14d..552896f 100644
/* Idle State Flags */
#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
-@@ -194,7 +195,7 @@ struct cpuidle_governor {
+@@ -191,7 +192,7 @@ struct cpuidle_governor {
void (*reflect) (struct cpuidle_device *dev, int index);
struct module *owner;
@@ -68210,7 +68227,7 @@ index 480c14d..552896f 100644
#ifdef CONFIG_CPU_IDLE
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
-index 0325602..5e9feff 100644
+index d08e4d2..95fad61 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -118,17 +118,17 @@ static inline unsigned int cpumask_first(const struct cpumask *srcp)
@@ -68305,7 +68322,7 @@ index b92eadf..b4ecdc1 100644
#define crt_ablkcipher crt_u.ablkcipher
#define crt_aead crt_u.aead
diff --git a/include/linux/ctype.h b/include/linux/ctype.h
-index 8acfe31..6ffccd63 100644
+index 653589e..4ef254a 100644
--- a/include/linux/ctype.h
+++ b/include/linux/ctype.h
@@ -56,7 +56,7 @@ static inline unsigned char __toupper(unsigned char c)
@@ -68344,10 +68361,10 @@ index fe8c447..bdc1f33 100644
/**
* struct devfreq - Device devfreq structure
diff --git a/include/linux/device.h b/include/linux/device.h
-index 9d6464e..8a5cc92 100644
+index c0a1261..dba7569 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
-@@ -295,7 +295,7 @@ struct subsys_interface {
+@@ -290,7 +290,7 @@ struct subsys_interface {
struct list_head node;
int (*add_dev)(struct device *dev, struct subsys_interface *sif);
int (*remove_dev)(struct device *dev, struct subsys_interface *sif);
@@ -68356,7 +68373,7 @@ index 9d6464e..8a5cc92 100644
int subsys_interface_register(struct subsys_interface *sif);
void subsys_interface_unregister(struct subsys_interface *sif);
-@@ -475,7 +475,7 @@ struct device_type {
+@@ -473,7 +473,7 @@ struct device_type {
void (*release)(struct device *dev);
const struct dev_pm_ops *pm;
@@ -68365,7 +68382,7 @@ index 9d6464e..8a5cc92 100644
/* interface for exporting device attributes */
struct device_attribute {
-@@ -485,11 +485,12 @@ struct device_attribute {
+@@ -483,11 +483,12 @@ struct device_attribute {
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count);
};
@@ -68393,10 +68410,10 @@ index 94af418..b1ca7a2 100644
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index 91ac8da..a841318 100644
+index 96d3e4a..dc36433 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
-@@ -1034,9 +1034,9 @@ struct dma_pinned_list {
+@@ -1035,9 +1035,9 @@ struct dma_pinned_list {
struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len);
void dma_unpin_iovec_pages(struct dma_pinned_list* pinned_list);
@@ -68409,10 +68426,10 @@ index 91ac8da..a841318 100644
unsigned int offset, size_t len);
diff --git a/include/linux/efi.h b/include/linux/efi.h
-index 3d7df3d..301f024 100644
+index 2bc0ad7..3f7b006 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
-@@ -740,6 +740,7 @@ struct efivar_operations {
+@@ -745,6 +745,7 @@ struct efivar_operations {
efi_set_variable_t *set_variable;
efi_query_variable_store_t *query_variable_store;
};
@@ -68473,7 +68490,7 @@ index fcb51c8..bdafcf6 100644
/**
diff --git a/include/linux/fb.h b/include/linux/fb.h
-index 58b9860..58e5516 100644
+index d49c60f..2834fbe 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -304,7 +304,7 @@ struct fb_ops {
@@ -68486,7 +68503,7 @@ index 58b9860..58e5516 100644
#ifdef CONFIG_FB_TILEBLITTING
#define FB_TILE_CURSOR_NONE 0
diff --git a/include/linux/filter.h b/include/linux/filter.h
-index c45eabc..baa0be5 100644
+index f65f5a6..2f4f93a 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -20,6 +20,7 @@ struct compat_sock_fprog {
@@ -68508,7 +68525,7 @@ index c45eabc..baa0be5 100644
struct sock_filter insns[0];
};
diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h
-index 3044254..9767f41 100644
+index 8293262..2b3b8bd 100644
--- a/include/linux/frontswap.h
+++ b/include/linux/frontswap.h
@@ -11,7 +11,7 @@ struct frontswap_ops {
@@ -68519,12 +68536,12 @@ index 3044254..9767f41 100644
+} __no_const;
extern bool frontswap_enabled;
- extern struct frontswap_ops
+ extern struct frontswap_ops *
diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 2c28271..8d3d74c 100644
+index 65c2be2..4c53f6e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -1541,7 +1541,8 @@ struct file_operations {
+@@ -1543,7 +1543,8 @@ struct file_operations {
long (*fallocate)(struct file *file, int mode, loff_t offset,
loff_t len);
int (*show_fdinfo)(struct seq_file *m, struct file *f);
@@ -68534,7 +68551,7 @@ index 2c28271..8d3d74c 100644
struct inode_operations {
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
-@@ -2672,4 +2673,14 @@ static inline void inode_has_no_xattr(struct inode *inode)
+@@ -2688,4 +2689,14 @@ static inline void inode_has_no_xattr(struct inode *inode)
inode->i_flags |= S_NOSEC;
}
@@ -68630,19 +68647,6 @@ index a78680a..87bd73e 100644
}
/*
-diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
-index 13a54d0..c6ce2a7 100644
---- a/include/linux/ftrace_event.h
-+++ b/include/linux/ftrace_event.h
-@@ -274,7 +274,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type,
- extern int trace_add_event_call(struct ftrace_event_call *call);
- extern void trace_remove_event_call(struct ftrace_event_call *call);
-
--#define is_signed_type(type) (((type)(-1)) < (type)0)
-+#define is_signed_type(type) (((type)(-1)) < (type)1)
-
- int trace_set_clr_event(const char *system, const char *event, int set);
-
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 9f3c275..911b591 100644
--- a/include/linux/genhd.h
@@ -69869,17 +69873,17 @@ index 1c7b89a..7f52502 100644
container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
-index d0c4db7..61b3577 100644
+index e988fa9..ff9f17e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
-@@ -369,6 +369,7 @@ struct i2c_algorithm {
+@@ -366,6 +366,7 @@ struct i2c_algorithm {
/* To determine what the adapter supports */
u32 (*functionality) (struct i2c_adapter *);
};
+typedef struct i2c_algorithm __no_const i2c_algorithm_no_const;
- /*
- * i2c_adapter is the structure used to identify a physical i2c bus along
+ /**
+ * struct i2c_bus_recovery_info - I2C bus recovery information
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index d23c3c2..eb63c81 100644
--- a/include/linux/i2o.h
@@ -70021,7 +70025,7 @@ index 5fa5afe..ac55b25 100644
extern void __raise_softirq_irqoff(unsigned int nr);
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
-index ba3b8a9..7e14ed8 100644
+index 3aeb730..2177f39 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -113,7 +113,7 @@ struct iommu_ops {
@@ -70034,7 +70038,7 @@ index ba3b8a9..7e14ed8 100644
#define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */
#define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
-index 85ac9b9b..e5759ab 100644
+index 89b7c24..382af74 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -161,7 +161,7 @@ struct resource *lookup_resource(struct resource *root, resource_size_t start);
@@ -70061,7 +70065,7 @@ index bc4e066..50468a9 100644
/*
* irq_chip specific flags
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
-index 3fd8e42..a73e966 100644
+index 3e203eb..3fe68d0 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -59,9 +59,11 @@
@@ -70154,7 +70158,7 @@ index c6e091b..a940adf 100644
extern struct kgdb_arch arch_kgdb_ops;
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
-index 5398d58..5883a34 100644
+index 0555cc6..b16a7a4 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -34,6 +34,8 @@ extern char modprobe_path[]; /* for sysctl */
@@ -70201,10 +70205,10 @@ index f66b065..c2c29b4 100644
int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
int kobj_ns_type_registered(enum kobj_ns_type type);
diff --git a/include/linux/kref.h b/include/linux/kref.h
-index 7419c02..aa2f02d 100644
+index 484604d..0f6c5b6 100644
--- a/include/linux/kref.h
+++ b/include/linux/kref.h
-@@ -65,7 +65,7 @@ static inline void kref_get(struct kref *kref)
+@@ -68,7 +68,7 @@ static inline void kref_get(struct kref *kref)
static inline int kref_sub(struct kref *kref, unsigned int count,
void (*release)(struct kref *kref))
{
@@ -70214,19 +70218,19 @@ index 7419c02..aa2f02d 100644
if (atomic_sub_and_test((int) count, &kref->refcount)) {
release(kref);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
-index c139582..0b5b102 100644
+index 8db53cf..c21121d 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
-@@ -424,7 +424,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
- int __must_check vcpu_load(struct kvm_vcpu *vcpu);
- void vcpu_put(struct kvm_vcpu *vcpu);
-
+@@ -444,7 +444,7 @@ static inline void kvm_irqfd_exit(void)
+ {
+ }
+ #endif
-int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
+int kvm_init(const void *opaque, unsigned vcpu_size, unsigned vcpu_align,
struct module *module);
void kvm_exit(void);
-@@ -582,7 +582,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
+@@ -616,7 +616,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);
@@ -70249,7 +70253,7 @@ index eae7a05..2cdd875 100644
struct ata_port_info {
unsigned long flags;
diff --git a/include/linux/list.h b/include/linux/list.h
-index 6a1f8df..eaec1ff 100644
+index b83e565..baa6c1d 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -112,6 +112,19 @@ extern void __list_del_entry(struct list_head *entry);
@@ -70282,10 +70286,10 @@ index 6a1f8df..eaec1ff 100644
* list_move - delete from one list and add as another's head
* @list: the entry to move
diff --git a/include/linux/math64.h b/include/linux/math64.h
-index b8ba855..0148090 100644
+index 2913b86..4209244 100644
--- a/include/linux/math64.h
+++ b/include/linux/math64.h
-@@ -14,7 +14,7 @@
+@@ -15,7 +15,7 @@
* This is commonly provided by 32bit archs to provide an optimized 64bit
* divide.
*/
@@ -70294,8 +70298,8 @@ index b8ba855..0148090 100644
{
*remainder = dividend % divisor;
return dividend / divisor;
-@@ -50,7 +50,7 @@ static inline s64 div64_s64(s64 dividend, s64 divisor)
- #define div64_long(x,y) div_s64((x),(y))
+@@ -52,7 +52,7 @@ static inline s64 div64_s64(s64 dividend, s64 divisor)
+ #define div64_ul(x, y) div_u64((x), (y))
#ifndef div_u64_rem
-static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
@@ -70303,7 +70307,7 @@ index b8ba855..0148090 100644
{
*remainder = do_div(dividend, divisor);
return dividend;
-@@ -79,7 +79,7 @@ extern s64 div64_s64(s64 dividend, s64 divisor);
+@@ -81,7 +81,7 @@ extern s64 div64_s64(s64 dividend, s64 divisor);
* divide.
*/
#ifndef div_u64
@@ -70313,10 +70317,10 @@ index b8ba855..0148090 100644
u32 remainder;
return div_u64_rem(dividend, divisor, &remainder);
diff --git a/include/linux/mm.h b/include/linux/mm.h
-index e2091b8..3c7b38c 100644
+index e0c8528..bcf0c29 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
-@@ -101,6 +101,11 @@ extern unsigned int kobjsize(const void *objp);
+@@ -104,6 +104,11 @@ extern unsigned int kobjsize(const void *objp);
#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
#define VM_ARCH_1 0x01000000 /* Architecture-specific flag */
@@ -70328,7 +70332,7 @@ index e2091b8..3c7b38c 100644
#define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */
#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */
-@@ -202,8 +207,8 @@ struct vm_operations_struct {
+@@ -205,8 +210,8 @@ struct vm_operations_struct {
/* called by access_process_vm when get_user_pages() fails, typically
* for use by special VMAs that can switch between memory and hardware
*/
@@ -70339,7 +70343,7 @@ index e2091b8..3c7b38c 100644
#ifdef CONFIG_NUMA
/*
* set_policy() op must add a reference to any non-NULL @new mempolicy
-@@ -233,6 +238,7 @@ struct vm_operations_struct {
+@@ -236,6 +241,7 @@ struct vm_operations_struct {
int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr,
unsigned long size, pgoff_t pgoff);
};
@@ -70347,7 +70351,7 @@ index e2091b8..3c7b38c 100644
struct mmu_gather;
struct inode;
-@@ -970,8 +976,8 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address,
+@@ -980,8 +986,8 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address,
unsigned long *pfn);
int follow_phys(struct vm_area_struct *vma, unsigned long address,
unsigned int flags, unsigned long *prot, resource_size_t *phys);
@@ -70358,7 +70362,7 @@ index e2091b8..3c7b38c 100644
static inline void unmap_shared_mapping_range(struct address_space *mapping,
loff_t const holebegin, loff_t const holelen)
-@@ -1010,9 +1016,9 @@ static inline int fixup_user_fault(struct task_struct *tsk,
+@@ -1020,9 +1026,9 @@ static inline int fixup_user_fault(struct task_struct *tsk,
}
#endif
@@ -70371,7 +70375,7 @@ index e2091b8..3c7b38c 100644
long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, unsigned long nr_pages,
-@@ -1043,34 +1049,6 @@ int set_page_dirty(struct page *page);
+@@ -1053,34 +1059,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);
@@ -70406,7 +70410,7 @@ index e2091b8..3c7b38c 100644
extern pid_t
vm_is_stack(struct task_struct *task, struct vm_area_struct *vma, int in_group);
-@@ -1173,6 +1151,15 @@ static inline void sync_mm_rss(struct mm_struct *mm)
+@@ -1180,6 +1158,15 @@ static inline void sync_mm_rss(struct mm_struct *mm)
}
#endif
@@ -70422,7 +70426,7 @@ index e2091b8..3c7b38c 100644
int vma_wants_writenotify(struct vm_area_struct *vma);
extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
-@@ -1191,8 +1178,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
+@@ -1198,8 +1185,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
{
return 0;
}
@@ -70438,7 +70442,7 @@ index e2091b8..3c7b38c 100644
#endif
#ifdef __PAGETABLE_PMD_FOLDED
-@@ -1201,8 +1195,15 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
+@@ -1208,8 +1202,15 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
{
return 0;
}
@@ -70454,7 +70458,7 @@ index e2091b8..3c7b38c 100644
#endif
int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
-@@ -1220,11 +1221,23 @@ static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long a
+@@ -1227,11 +1228,23 @@ static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long a
NULL: pud_offset(pgd, address);
}
@@ -70478,7 +70482,7 @@ index e2091b8..3c7b38c 100644
#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
#if USE_SPLIT_PTLOCKS
-@@ -1455,6 +1468,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -1517,6 +1530,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
unsigned long len, unsigned long prot, unsigned long flags,
unsigned long pgoff, unsigned long *populate);
extern int do_munmap(struct mm_struct *, unsigned long, size_t);
@@ -70486,7 +70490,7 @@ index e2091b8..3c7b38c 100644
#ifdef CONFIG_MMU
extern int __mm_populate(unsigned long addr, unsigned long len,
-@@ -1483,10 +1497,11 @@ struct vm_unmapped_area_info {
+@@ -1545,10 +1559,11 @@ struct vm_unmapped_area_info {
unsigned long high_limit;
unsigned long align_mask;
unsigned long align_offset;
@@ -70500,7 +70504,7 @@ index e2091b8..3c7b38c 100644
/*
* Search for an unmapped address range.
-@@ -1498,7 +1513,7 @@ extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
+@@ -1560,7 +1575,7 @@ extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
* - satisfies (begin_addr & align_mask) == (align_offset & align_mask)
*/
static inline unsigned long
@@ -70509,7 +70513,7 @@ index e2091b8..3c7b38c 100644
{
if (!(info->flags & VM_UNMAPPED_AREA_TOPDOWN))
return unmapped_area(info);
-@@ -1561,6 +1576,10 @@ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long add
+@@ -1623,6 +1638,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);
@@ -70520,7 +70524,7 @@ index e2091b8..3c7b38c 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)
-@@ -1589,15 +1608,6 @@ static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm,
+@@ -1651,15 +1670,6 @@ static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm,
return vma;
}
@@ -70536,7 +70540,7 @@ index e2091b8..3c7b38c 100644
#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE
unsigned long change_prot_numa(struct vm_area_struct *vma,
unsigned long start, unsigned long end);
-@@ -1649,6 +1659,11 @@ void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
+@@ -1711,6 +1721,11 @@ void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
static inline void vm_stat_account(struct mm_struct *mm,
unsigned long flags, struct file *file, long pages)
{
@@ -70548,7 +70552,7 @@ index e2091b8..3c7b38c 100644
mm->total_vm += pages;
}
#endif /* CONFIG_PROC_FS */
-@@ -1725,7 +1740,7 @@ extern int unpoison_memory(unsigned long pfn);
+@@ -1791,7 +1806,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);
@@ -70557,9 +70561,9 @@ index e2091b8..3c7b38c 100644
extern int soft_offline_page(struct page *page, int flags);
extern void dump_page(struct page *page);
-@@ -1756,5 +1771,11 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; }
- static inline bool page_is_guard(struct page *page) { return false; }
- #endif /* CONFIG_DEBUG_PAGEALLOC */
+@@ -1828,5 +1843,11 @@ void __init setup_nr_node_ids(void);
+ static inline void setup_nr_node_ids(void) {}
+ #endif
+#ifdef CONFIG_ARCH_TRACK_EXEC_LIMIT
+extern void track_exec_limit(struct mm_struct *mm, unsigned long start, unsigned long end, unsigned long prot);
@@ -70630,7 +70634,7 @@ index c5d5278..f0b68c8 100644
}
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index c74092e..b663967 100644
+index 5c76737..61f518e 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -396,7 +396,7 @@ struct zone {
@@ -70643,10 +70647,10 @@ index c74092e..b663967 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 779cf7c..e6768240 100644
+index b508016..237cfe5 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
-@@ -12,7 +12,7 @@
+@@ -13,7 +13,7 @@
typedef unsigned long kernel_ulong_t;
#endif
@@ -70655,7 +70659,7 @@ index 779cf7c..e6768240 100644
struct pci_device_id {
__u32 vendor, device; /* Vendor and device ID or PCI_ANY_ID*/
-@@ -138,7 +138,7 @@ struct usb_device_id {
+@@ -139,7 +139,7 @@ struct usb_device_id {
#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
#define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400
@@ -70664,7 +70668,7 @@ index 779cf7c..e6768240 100644
#define HID_BUS_ANY 0xffff
#define HID_GROUP_ANY 0x0000
-@@ -464,7 +464,7 @@ struct dmi_system_id {
+@@ -465,7 +465,7 @@ struct dmi_system_id {
const char *ident;
struct dmi_strmatch matches[4];
void *driver_data;
@@ -70674,7 +70678,7 @@ index 779cf7c..e6768240 100644
* struct dmi_device_id appears during expansion of
* "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it
diff --git a/include/linux/module.h b/include/linux/module.h
-index ead1b57..81a3b6c 100644
+index 46f1ea0..a34ca37 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -17,9 +17,11 @@
@@ -70896,7 +70900,7 @@ index 5a5ff57..5ae5070 100644
return nd->saved_names[nd->depth];
}
diff --git a/include/linux/net.h b/include/linux/net.h
-index aa16731..514b875 100644
+index 99c9f0c..e1cf296 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -183,7 +183,7 @@ struct net_proto_family {
@@ -70909,10 +70913,10 @@ index aa16731..514b875 100644
struct iovec;
struct kvec;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 6151e90..2e0afb0 100644
+index 96e4c21..9cc8278 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -1028,6 +1028,7 @@ struct net_device_ops {
+@@ -1026,6 +1026,7 @@ struct net_device_ops {
int (*ndo_change_carrier)(struct net_device *dev,
bool new_carrier);
};
@@ -70930,7 +70934,7 @@ index 6151e90..2e0afb0 100644
*/
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
-index ee14284..bc65d63 100644
+index 0060fde..481c6ae 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -82,7 +82,7 @@ struct nf_sockopt_ops {
@@ -70943,10 +70947,10 @@ index ee14284..bc65d63 100644
/* Function to register/unregister hook points. */
int nf_register_hook(struct nf_hook_ops *reg);
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
-index 7958e84..ed74d7a 100644
+index d80e275..c3510b8 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
-@@ -98,7 +98,7 @@ struct ip_set_type_variant {
+@@ -124,7 +124,7 @@ struct ip_set_type_variant {
/* Return true if "b" set is the same as "a"
* according to the create set parameters */
bool (*same_set)(const struct ip_set *a, const struct ip_set *b);
@@ -70956,7 +70960,7 @@ index 7958e84..ed74d7a 100644
/* The core set type structure */
struct ip_set_type {
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
-index ecbb8e4..8a1c4e1 100644
+index cadb740..d7c37c0 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -16,7 +16,7 @@ struct nfnl_callback {
@@ -70997,11 +71001,11 @@ index 5dc635f..35f5e11 100644
/* this value hold the maximum octet of charset */
#define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
-index d65746e..62e72c2 100644
+index d14a4c3..a078786 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
-@@ -51,7 +51,8 @@ struct notifier_block {
- int (*notifier_call)(struct notifier_block *, unsigned long, void *);
+@@ -54,7 +54,8 @@ struct notifier_block {
+ notifier_fn_t notifier_call;
struct notifier_block __rcu *next;
int priority;
-};
@@ -71027,7 +71031,7 @@ index a4c5624..79d6d88 100644
/** create a directory */
struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root,
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
-index 45fc162..01a4068 100644
+index 8db71dc..a76bf2c 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -80,7 +80,8 @@ struct hotplug_slot_ops {
@@ -71041,10 +71045,10 @@ index 45fc162..01a4068 100644
/**
* struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
-index 2f522a3..494e45f 100644
+index c5b6dbf..b124155 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
-@@ -333,8 +333,8 @@ struct perf_event {
+@@ -318,8 +318,8 @@ struct perf_event {
enum perf_event_active_state state;
unsigned int attach_state;
@@ -71055,7 +71059,7 @@ index 2f522a3..494e45f 100644
/*
* These are the total time in nanoseconds that the event
-@@ -385,8 +385,8 @@ struct perf_event {
+@@ -370,8 +370,8 @@ struct perf_event {
* These accumulate total time (in nanoseconds) that children
* events have been enabled and running, respectively.
*/
@@ -71066,7 +71070,7 @@ index 2f522a3..494e45f 100644
/*
* Protect attach/detach and child_list:
-@@ -703,7 +703,7 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64
+@@ -692,7 +692,7 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64
entry->ip[entry->nr++] = ip;
}
@@ -71075,7 +71079,7 @@ index 2f522a3..494e45f 100644
extern int sysctl_perf_event_mlock;
extern int sysctl_perf_event_sample_rate;
-@@ -711,19 +711,24 @@ extern int perf_proc_update_handler(struct ctl_table *table, int write,
+@@ -700,19 +700,24 @@ extern int perf_proc_update_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos);
@@ -71103,7 +71107,7 @@ index 2f522a3..494e45f 100644
}
extern void perf_event_init(void);
-@@ -811,7 +816,7 @@ static inline void perf_restore_debug_store(void) { }
+@@ -806,7 +811,7 @@ static inline void perf_restore_debug_store(void) { }
*/
#define perf_cpu_notifier(fn) \
do { \
@@ -71112,28 +71116,30 @@ index 2f522a3..494e45f 100644
{ .notifier_call = fn, .priority = CPU_PRI_PERF }; \
unsigned long cpu = smp_processor_id(); \
unsigned long flags; \
-@@ -830,7 +835,7 @@ do { \
- struct perf_pmu_events_attr {
+@@ -826,7 +831,7 @@ struct perf_pmu_events_attr {
struct device_attribute attr;
u64 id;
+ const char *event_str;
-};
+} __do_const;
#define PMU_EVENT_ATTR(_name, _var, _id, _show) \
static struct perf_pmu_events_attr _var = { \
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
-index ad1a427..6419649 100644
+index b8809fe..ae4ccd0 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
-@@ -45,9 +45,9 @@ struct pipe_buffer {
- struct pipe_inode_info {
+@@ -47,10 +47,10 @@ struct pipe_inode_info {
+ struct mutex mutex;
wait_queue_head_t wait;
unsigned int nrbufs, curbuf, buffers;
- unsigned int readers;
- unsigned int writers;
+- unsigned int files;
- unsigned int waiting_writers;
+ atomic_t readers;
+ atomic_t writers;
++ atomic_t files;
+ atomic_t waiting_writers;
unsigned int r_counter;
unsigned int w_counter;
@@ -71151,10 +71157,10 @@ index 5f28cae..3d23723 100644
extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd);
-diff --git a/include/linux/platform_data/usb-exynos.h b/include/linux/platform_data/usb-exynos.h
+diff --git a/include/linux/platform_data/usb-ohci-exynos.h b/include/linux/platform_data/usb-ohci-exynos.h
index c256c59..8ea94c7 100644
---- a/include/linux/platform_data/usb-exynos.h
-+++ b/include/linux/platform_data/usb-exynos.h
+--- a/include/linux/platform_data/usb-ohci-exynos.h
++++ b/include/linux/platform_data/usb-ohci-exynos.h
@@ -14,7 +14,7 @@
struct exynos4_ohci_platdata {
int (*phy_init)(struct platform_device *pdev, int type);
@@ -71245,19 +71251,19 @@ index 4ea1d37..80f4b33 100644
/*
* The return value from decompress routine is the length of the
diff --git a/include/linux/printk.h b/include/linux/printk.h
-index 822171f..12b30e8 100644
+index 22c7052..ad3fa0a 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
-@@ -98,6 +98,8 @@ int no_printk(const char *fmt, ...)
- extern asmlinkage __printf(1, 2)
- void early_printk(const char *fmt, ...);
+@@ -106,6 +106,8 @@ static inline __printf(1, 2) __cold
+ void early_printk(const char *s, ...) { }
+ #endif
+extern int kptr_restrict;
+
#ifdef CONFIG_PRINTK
asmlinkage __printf(5, 0)
int vprintk_emit(int facility, int level,
-@@ -132,7 +134,6 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+@@ -140,7 +142,6 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
extern int printk_delay_msec;
extern int dmesg_restrict;
@@ -71266,10 +71272,10 @@ index 822171f..12b30e8 100644
extern void wake_up_klogd(void);
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
-index 94dfb2a..88b9d3b 100644
+index 608e60a..c26f864 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
-@@ -165,6 +165,18 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode,
+@@ -34,6 +34,19 @@ static inline struct proc_dir_entry *proc_create(
return proc_create_data(name, mode, parent, proc_fops, NULL);
}
@@ -71285,23 +71291,28 @@ index 94dfb2a..88b9d3b 100644
+#endif
+}
+
- static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
- umode_t mode, struct proc_dir_entry *base,
- read_proc_t *read_proc, void * data)
-@@ -266,7 +278,7 @@ struct proc_ns_operations {
++
+ extern void proc_set_size(struct proc_dir_entry *, loff_t);
+ extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
+ extern void *PDE_DATA(const struct inode *);
+diff --git a/include/linux/proc_ns.h b/include/linux/proc_ns.h
+index 34a1e10..03a6d03 100644
+--- a/include/linux/proc_ns.h
++++ b/include/linux/proc_ns.h
+@@ -14,7 +14,7 @@ struct proc_ns_operations {
void (*put)(void *ns);
int (*install)(struct nsproxy *nsproxy, void *ns);
unsigned int (*inum)(void *ns);
-};
+} __do_const;
- extern const struct proc_ns_operations netns_operations;
- extern const struct proc_ns_operations utsns_operations;
- extern const struct proc_ns_operations ipcns_operations;
+
+ struct proc_ns {
+ void *ns;
diff --git a/include/linux/random.h b/include/linux/random.h
-index 347ce55..880f97c 100644
+index 3b9377d..61b506a 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
-@@ -39,6 +39,11 @@ void prandom_seed(u32 seed);
+@@ -32,6 +32,11 @@ void prandom_seed(u32 seed);
u32 prandom_u32_state(struct rnd_state *);
void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes);
@@ -71314,7 +71325,7 @@ index 347ce55..880f97c 100644
* Handle minimum values for seeds
*/
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
-index 8089e35..3a0d59a 100644
+index f4b1001..8ddb2b6 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -44,6 +44,9 @@ extern void __list_add_rcu(struct list_head *new,
@@ -71415,10 +71426,10 @@ index 8e0c9fe..ac4d221 100644
/**
* struct user_regset_view - available regsets
diff --git a/include/linux/relay.h b/include/linux/relay.h
-index 91cacc3..b55ff74 100644
+index d7c8359..818daf5 100644
--- a/include/linux/relay.h
+++ b/include/linux/relay.h
-@@ -160,7 +160,7 @@ struct rchan_callbacks
+@@ -157,7 +157,7 @@ struct rchan_callbacks
* The callback should return 0 if successful, negative if not.
*/
int (*remove_buf_file)(struct dentry *dentry);
@@ -71428,10 +71439,10 @@ index 91cacc3..b55ff74 100644
/*
* CONFIG_RELAY kernel API, kernel/relay.c
diff --git a/include/linux/rio.h b/include/linux/rio.h
-index a3e7842..d973ca6 100644
+index 18e0993..8ab5b21 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
-@@ -339,7 +339,7 @@ struct rio_ops {
+@@ -345,7 +345,7 @@ struct rio_ops {
int (*map_inb)(struct rio_mport *mport, dma_addr_t lstart,
u64 rstart, u32 size, u32 flags);
void (*unmap_inb)(struct rio_mport *mport, dma_addr_t lstart);
@@ -71456,7 +71467,7 @@ index 6dacb93..6174423 100644
static inline void anon_vma_merge(struct vm_area_struct *vma,
struct vm_area_struct *next)
diff --git a/include/linux/sched.h b/include/linux/sched.h
-index be4e742..01f1387 100644
+index 178a8d9..52e71a3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -62,6 +62,7 @@ struct bio_list;
@@ -71467,7 +71478,7 @@ index be4e742..01f1387 100644
/*
* List of flags we want to share for kernel threads,
-@@ -315,7 +316,7 @@ extern char __sched_text_start[], __sched_text_end[];
+@@ -303,7 +304,7 @@ extern char __sched_text_start[], __sched_text_end[];
extern int in_sched_functions(unsigned long addr);
#define MAX_SCHEDULE_TIMEOUT LONG_MAX
@@ -71476,8 +71487,8 @@ index be4e742..01f1387 100644
extern signed long schedule_timeout_interruptible(signed long timeout);
extern signed long schedule_timeout_killable(signed long timeout);
extern signed long schedule_timeout_uninterruptible(signed long timeout);
-@@ -329,6 +330,18 @@ struct user_namespace;
- #include <linux/aio.h>
+@@ -314,6 +315,19 @@ struct nsproxy;
+ struct user_namespace;
#ifdef CONFIG_MMU
+
@@ -71492,10 +71503,11 @@ index be4e742..01f1387 100644
+
+extern bool check_heap_stack_gap(const struct vm_area_struct *vma, unsigned long addr, unsigned long len, unsigned long offset);
+extern unsigned long skip_heap_stack_gap(const struct vm_area_struct *vma, unsigned long len, unsigned long offset);
++
extern void arch_pick_mmap_layout(struct mm_struct *mm);
extern unsigned long
arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
-@@ -605,6 +618,17 @@ struct signal_struct {
+@@ -591,6 +605,17 @@ struct signal_struct {
#ifdef CONFIG_TASKSTATS
struct taskstats *stats;
#endif
@@ -71512,8 +71524,8 @@ index be4e742..01f1387 100644
+
#ifdef CONFIG_AUDIT
unsigned audit_tty;
- struct tty_audit_buf *tty_audit_buf;
-@@ -683,6 +707,14 @@ struct user_struct {
+ unsigned audit_tty_log_passwd;
+@@ -671,6 +696,14 @@ struct user_struct {
struct key *session_keyring; /* UID's default session keyring */
#endif
@@ -71528,16 +71540,7 @@ index be4e742..01f1387 100644
/* Hash table maintenance information */
struct hlist_node uidhash_node;
kuid_t uid;
-@@ -1082,7 +1114,7 @@ struct sched_class {
- #ifdef CONFIG_FAIR_GROUP_SCHED
- void (*task_move_group) (struct task_struct *p, int on_rq);
- #endif
--};
-+} __do_const;
-
- struct load_weight {
- unsigned long weight, inv_weight;
-@@ -1323,8 +1355,8 @@ struct task_struct {
+@@ -1158,8 +1191,8 @@ struct task_struct {
struct list_head thread_group;
struct completion *vfork_done; /* for vfork() */
@@ -71548,7 +71551,7 @@ index be4e742..01f1387 100644
cputime_t utime, stime, utimescaled, stimescaled;
cputime_t gtime;
-@@ -1349,11 +1381,6 @@ struct task_struct {
+@@ -1184,11 +1217,6 @@ struct task_struct {
struct task_cputime cputime_expires;
struct list_head cpu_timers[3];
@@ -71560,7 +71563,7 @@ index be4e742..01f1387 100644
char comm[TASK_COMM_LEN]; /* executable name excluding path
- access with [gs]et_task_comm (which lock
it with task_lock())
-@@ -1370,6 +1397,10 @@ struct task_struct {
+@@ -1205,6 +1233,10 @@ struct task_struct {
#endif
/* CPU-specific state of this task */
struct thread_struct thread;
@@ -71571,7 +71574,7 @@ index be4e742..01f1387 100644
/* filesystem information */
struct fs_struct *fs;
/* open file information */
-@@ -1443,6 +1474,10 @@ struct task_struct {
+@@ -1278,6 +1310,10 @@ struct task_struct {
gfp_t lockdep_reclaim_gfp;
#endif
@@ -71582,7 +71585,7 @@ index be4e742..01f1387 100644
/* journalling filesystem info */
void *journal_info;
-@@ -1481,6 +1516,10 @@ struct task_struct {
+@@ -1316,6 +1352,10 @@ struct task_struct {
/* cg_list protected by css_set_lock and tsk->alloc_lock */
struct list_head cg_list;
#endif
@@ -71593,9 +71596,9 @@ index be4e742..01f1387 100644
#ifdef CONFIG_FUTEX
struct robust_list_head __user *robust_list;
#ifdef CONFIG_COMPAT
-@@ -1577,8 +1616,74 @@ struct task_struct {
- #ifdef CONFIG_UPROBES
- struct uprobe_task *utask;
+@@ -1416,8 +1456,74 @@ struct task_struct {
+ unsigned int sequential_io;
+ unsigned int sequential_io_avg;
#endif
+
+#ifdef CONFIG_GRKERNSEC
@@ -71668,7 +71671,7 @@ index be4e742..01f1387 100644
/* Future-safe accessor for struct task_struct's cpus_allowed. */
#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
-@@ -1637,7 +1742,7 @@ struct pid_namespace;
+@@ -1476,7 +1582,7 @@ struct pid_namespace;
pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
struct pid_namespace *ns);
@@ -71677,7 +71680,7 @@ index be4e742..01f1387 100644
{
return tsk->pid;
}
-@@ -2073,7 +2178,9 @@ void yield(void);
+@@ -1919,7 +2025,9 @@ void yield(void);
extern struct exec_domain default_exec_domain;
union thread_union {
@@ -71687,7 +71690,7 @@ index be4e742..01f1387 100644
unsigned long stack[THREAD_SIZE/sizeof(long)];
};
-@@ -2106,6 +2213,7 @@ extern struct pid_namespace init_pid_ns;
+@@ -1952,6 +2060,7 @@ extern struct pid_namespace init_pid_ns;
*/
extern struct task_struct *find_task_by_vpid(pid_t nr);
@@ -71695,7 +71698,7 @@ index be4e742..01f1387 100644
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
struct pid_namespace *ns);
-@@ -2272,7 +2380,7 @@ extern void __cleanup_sighand(struct sighand_struct *);
+@@ -2118,7 +2227,7 @@ extern void __cleanup_sighand(struct sighand_struct *);
extern void exit_itimers(struct signal_struct *);
extern void flush_itimer_signals(void);
@@ -71704,7 +71707,7 @@ index be4e742..01f1387 100644
extern int allow_signal(int);
extern int disallow_signal(int);
-@@ -2463,9 +2571,9 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
+@@ -2309,9 +2418,9 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
#endif
@@ -71729,7 +71732,7 @@ index bf8086b..962b035 100644
extern unsigned int sysctl_sched_latency;
extern unsigned int sysctl_sched_min_granularity;
diff --git a/include/linux/security.h b/include/linux/security.h
-index 032c366..2c1c2dc2 100644
+index 4686491..2bd210e 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -26,6 +26,7 @@
@@ -71741,7 +71744,7 @@ index 032c366..2c1c2dc2 100644
struct linux_binprm;
struct cred;
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
-index 68a04a3..866e6a1 100644
+index 2da29ac..aac448ec 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -26,6 +26,9 @@ struct seq_file {
@@ -71778,10 +71781,10 @@ index 429c199..4d42e38 100644
/* shm_mode upper byte flags */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
-index 1f2803c..4858a3d 100644
+index dec1748..112c1f9 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -599,7 +599,7 @@ extern bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
+@@ -640,7 +640,7 @@ extern bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
extern struct sk_buff *__alloc_skb(unsigned int size,
gfp_t priority, int flags, int node);
extern struct sk_buff *build_skb(void *data, unsigned int frag_size);
@@ -71790,7 +71793,7 @@ index 1f2803c..4858a3d 100644
gfp_t priority)
{
return __alloc_skb(size, priority, 0, NUMA_NO_NODE);
-@@ -709,7 +709,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
+@@ -756,7 +756,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)
{
@@ -71799,7 +71802,7 @@ index 1f2803c..4858a3d 100644
}
/**
-@@ -722,7 +722,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
+@@ -769,7 +769,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)
{
@@ -71808,7 +71811,7 @@ index 1f2803c..4858a3d 100644
}
/**
-@@ -735,7 +735,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
+@@ -782,7 +782,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)
{
@@ -71817,7 +71820,7 @@ index 1f2803c..4858a3d 100644
}
/**
-@@ -1756,7 +1756,7 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
+@@ -1848,7 +1848,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
@@ -71826,7 +71829,7 @@ index 1f2803c..4858a3d 100644
#endif
extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
-@@ -2351,7 +2351,7 @@ extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
+@@ -2443,7 +2443,7 @@ extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
int noblock, int *err);
extern unsigned int datagram_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait);
@@ -71835,7 +71838,7 @@ index 1f2803c..4858a3d 100644
int offset, struct iovec *to,
int size);
extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
-@@ -2641,6 +2641,9 @@ static inline void nf_reset(struct sk_buff *skb)
+@@ -2733,6 +2733,9 @@ static inline void nf_reset(struct sk_buff *skb)
nf_bridge_put(skb->nf_bridge);
skb->nf_bridge = NULL;
#endif
@@ -71846,7 +71849,7 @@ index 1f2803c..4858a3d 100644
static inline void nf_reset_trace(struct sk_buff *skb)
diff --git a/include/linux/slab.h b/include/linux/slab.h
-index 5d168d7..720bff3 100644
+index 0c62175..9ece3d8 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -12,13 +12,20 @@
@@ -71886,9 +71889,18 @@ index 5d168d7..720bff3 100644
- (unsigned long)ZERO_SIZE_PTR)
+#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) - 1 >= (unsigned long)ZERO_SIZE_PTR - 1)
+
+ struct mem_cgroup;
+@@ -132,6 +142,8 @@ void * __must_check krealloc(const void *, size_t, gfp_t);
+ void kfree(const void *);
+ void kzfree(const void *);
+ size_t ksize(const void *);
++const char *check_heap_object(const void *ptr, unsigned long n);
++bool is_usercopy_object(const void *ptr);
+
/*
- * Common fields provided in kmem_cache by all slab allocators
-@@ -112,7 +122,7 @@ struct kmem_cache {
+ * Some archs want to perform DMA into kmalloc caches and need a guaranteed
+@@ -164,7 +176,7 @@ struct kmem_cache {
unsigned int align; /* Alignment as calculated */
unsigned long flags; /* Active flags on the slab */
const char *name; /* Slab name for sysfs */
@@ -71897,16 +71909,27 @@ index 5d168d7..720bff3 100644
void (*ctor)(void *); /* Called on object slot creation */
struct list_head list; /* List of all slab caches on the system */
};
-@@ -232,6 +242,8 @@ void * __must_check krealloc(const void *, size_t, gfp_t);
- void kfree(const void *);
- void kzfree(const void *);
- size_t ksize(const void *);
-+const char *check_heap_object(const void *ptr, unsigned long n);
-+bool is_usercopy_object(const void *ptr);
+@@ -226,6 +238,10 @@ extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
+ extern struct kmem_cache *kmalloc_dma_caches[KMALLOC_SHIFT_HIGH + 1];
+ #endif
++#ifdef CONFIG_PAX_USERCOPY_SLABS
++extern struct kmem_cache *kmalloc_usercopy_caches[KMALLOC_SHIFT_HIGH + 1];
++#endif
++
/*
- * Allocator specific definitions. These are mainly used to establish optimized
-@@ -311,6 +323,7 @@ size_t ksize(const void *);
+ * Figure out which kmalloc slab an allocation of a certain size
+ * belongs to.
+@@ -234,7 +250,7 @@ extern struct kmem_cache *kmalloc_dma_caches[KMALLOC_SHIFT_HIGH + 1];
+ * 2 = 120 .. 192 bytes
+ * n = 2^(n-1) .. 2^n -1
+ */
+-static __always_inline int kmalloc_index(size_t size)
++static __always_inline __size_overflow(1) int kmalloc_index(size_t size)
+ {
+ if (!size)
+ return 0;
+@@ -406,6 +422,7 @@ void print_slabinfo_header(struct seq_file *m);
* for general use, and so are not documented here. For a full list of
* potential flags, always refer to linux/gfp.h.
*/
@@ -71914,7 +71937,7 @@ index 5d168d7..720bff3 100644
static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
{
if (size != 0 && n > SIZE_MAX / size)
-@@ -370,7 +383,7 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
+@@ -465,7 +482,7 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \
(defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) || \
(defined(CONFIG_SLOB) && defined(CONFIG_TRACING))
@@ -71923,7 +71946,7 @@ index 5d168d7..720bff3 100644
#define kmalloc_track_caller(size, flags) \
__kmalloc_track_caller(size, flags, _RET_IP_)
#else
-@@ -390,7 +403,7 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long);
+@@ -485,7 +502,7 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long);
#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \
(defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) || \
(defined(CONFIG_SLOB) && defined(CONFIG_TRACING))
@@ -71933,10 +71956,10 @@ index 5d168d7..720bff3 100644
__kmalloc_node_track_caller(size, flags, node, \
_RET_IP_)
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
-index 8bb6e0e..8eb0dbe 100644
+index cd40158..d9dc02c 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
-@@ -52,7 +52,7 @@ struct kmem_cache {
+@@ -50,7 +50,7 @@ struct kmem_cache {
/* 4) cache creation/removal */
const char *name;
struct list_head list;
@@ -71945,7 +71968,7 @@ index 8bb6e0e..8eb0dbe 100644
int object_size;
int align;
-@@ -68,10 +68,10 @@ struct kmem_cache {
+@@ -66,10 +66,10 @@ struct kmem_cache {
unsigned long node_allocs;
unsigned long node_frees;
unsigned long node_overflow;
@@ -71960,17 +71983,8 @@ index 8bb6e0e..8eb0dbe 100644
/*
* If debugging is enabled, then the allocator can add additional
-@@ -111,11 +111,16 @@ struct cache_sizes {
- #ifdef CONFIG_ZONE_DMA
- struct kmem_cache *cs_dmacachep;
- #endif
-+
-+#ifdef CONFIG_PAX_USERCOPY_SLABS
-+ struct kmem_cache *cs_usercopycachep;
-+#endif
-+
+@@ -103,7 +103,7 @@ struct kmem_cache {
};
- extern struct cache_sizes malloc_sizes[];
void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
-void *__kmalloc(size_t size, gfp_t flags);
@@ -71978,21 +71992,21 @@ index 8bb6e0e..8eb0dbe 100644
#ifdef CONFIG_TRACING
extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t);
-@@ -152,6 +157,13 @@ found:
- cachep = malloc_sizes[i].cs_dmacachep;
+@@ -136,6 +136,13 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
+ cachep = kmalloc_dma_caches[i];
else
#endif
+
+#ifdef CONFIG_PAX_USERCOPY_SLABS
+ if (flags & GFP_USERCOPY)
-+ cachep = malloc_sizes[i].cs_usercopycachep;
++ cachep = kmalloc_usercopy_caches[i];
+ else
+#endif
+
- cachep = malloc_sizes[i].cs_cachep;
+ cachep = kmalloc_caches[i];
ret = kmem_cache_alloc_trace(cachep, flags, size);
-@@ -162,7 +174,7 @@ found:
+@@ -146,7 +153,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
}
#ifdef CONFIG_NUMA
@@ -72001,18 +72015,18 @@ index 8bb6e0e..8eb0dbe 100644
extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
#ifdef CONFIG_TRACING
-@@ -205,6 +217,13 @@ found:
- cachep = malloc_sizes[i].cs_dmacachep;
+@@ -185,6 +192,13 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
+ cachep = kmalloc_dma_caches[i];
else
#endif
+
+#ifdef CONFIG_PAX_USERCOPY_SLABS
+ if (flags & GFP_USERCOPY)
-+ cachep = malloc_sizes[i].cs_usercopycachep;
++ cachep = kmalloc_usercopy_caches[i];
+ else
+#endif
+
- cachep = malloc_sizes[i].cs_cachep;
+ cachep = kmalloc_caches[i];
return kmem_cache_alloc_node_trace(cachep, flags, node, size);
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
@@ -72038,10 +72052,10 @@ index f28e14a..7831211 100644
return kmalloc(size, flags);
}
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
-index 9db4825..ed42fb5 100644
+index 027276f..092bfe8 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
-@@ -91,7 +91,7 @@ struct kmem_cache {
+@@ -80,7 +80,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 */
@@ -72050,17 +72064,8 @@ index 9db4825..ed42fb5 100644
void (*ctor)(void *);
int inuse; /* Offset to metadata */
int align; /* Alignment */
-@@ -156,7 +156,7 @@ extern struct kmem_cache *kmalloc_caches[SLUB_PAGE_SHIFT];
- * Sorry that the following has to be that ugly but some versions of GCC
- * have trouble with constant propagation and loops.
- */
--static __always_inline int kmalloc_index(size_t size)
-+static __always_inline __size_overflow(1) int kmalloc_index(size_t size)
- {
- if (!size)
- return 0;
-@@ -221,7 +221,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
- }
+@@ -105,7 +105,7 @@ struct kmem_cache {
+ };
void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
-void *__kmalloc(size_t size, gfp_t flags);
@@ -72068,7 +72073,7 @@ index 9db4825..ed42fb5 100644
static __always_inline void *
kmalloc_order(size_t size, gfp_t flags, unsigned int order)
-@@ -265,7 +265,7 @@ kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
+@@ -149,7 +149,7 @@ kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
}
#endif
@@ -72077,7 +72082,7 @@ index 9db4825..ed42fb5 100644
{
unsigned int order = get_order(size);
return kmalloc_order_trace(size, flags, order);
-@@ -290,7 +290,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
+@@ -175,7 +175,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
}
#ifdef CONFIG_NUMA
@@ -72087,10 +72092,10 @@ index 9db4825..ed42fb5 100644
#ifdef CONFIG_TRACING
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
-index e8d702e..0a56eb4 100644
+index 54f91d3..be2c379 100644
--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
-@@ -10,7 +10,7 @@ struct sock;
+@@ -11,7 +11,7 @@ struct sock;
struct sock_diag_handler {
__u8 family;
int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
@@ -72147,7 +72152,7 @@ index 07d8e53..dc934c9 100644
#endif /* _LINUX_SUNRPC_ADDR_H */
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
-index 2cf4ffa..470d140 100644
+index bfe11be..12bc8c4 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -96,7 +96,7 @@ struct rpc_procinfo {
@@ -72229,10 +72234,10 @@ index a5ffd32..0935dea 100644
extern dma_addr_t swiotlb_map_page(struct device *dev, struct page *page,
unsigned long offset, size_t size,
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
-index 313a8e0..6b273a9 100644
+index 4147d70..31a1791 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
-@@ -418,11 +418,11 @@ asmlinkage long sys_sync(void);
+@@ -362,11 +362,11 @@ asmlinkage long sys_sync(void);
asmlinkage long sys_fsync(unsigned int fd);
asmlinkage long sys_fdatasync(unsigned int fd);
asmlinkage long sys_bdflush(int func, long data);
@@ -72248,7 +72253,7 @@ index 313a8e0..6b273a9 100644
asmlinkage long sys_truncate(const char __user *path, long length);
asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
asmlinkage long sys_stat(const char __user *filename,
-@@ -634,7 +634,7 @@ asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *);
+@@ -578,7 +578,7 @@ asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *);
asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *);
asmlinkage long sys_send(int, void __user *, size_t, unsigned);
asmlinkage long sys_sendto(int, void __user *, size_t, unsigned,
@@ -72378,7 +72383,7 @@ index e7e0473..7989295 100644
#endif /* _LINUX_THREAD_INFO_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
-index c75d886..04cb148 100644
+index 8780bd2..d1ae08b 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -194,7 +194,7 @@ struct tty_port {
@@ -72390,7 +72395,7 @@ index c75d886..04cb148 100644
wait_queue_head_t open_wait; /* Open waiters */
wait_queue_head_t close_wait; /* Close waiters */
wait_queue_head_t delta_msr_wait; /* Modem status change */
-@@ -515,7 +515,7 @@ extern int tty_port_open(struct tty_port *port,
+@@ -550,7 +550,7 @@ extern int tty_port_open(struct tty_port *port,
struct tty_struct *tty, struct file *filp);
static inline int tty_port_users(struct tty_port *port)
{
@@ -72413,13 +72418,13 @@ index 756a609..b302dd6 100644
struct tty_driver {
int magic; /* magic number for this structure */
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
-index 455a0d7..bf97ff5 100644
+index 58390c7..95e214c 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -146,7 +146,7 @@ struct tty_ldisc_ops {
struct module *owner;
-
+
- int refcount;
+ atomic_t refcount;
};
@@ -72541,10 +72546,10 @@ index 99c1b4d..562e6f3 100644
static inline void put_unaligned_le16(u16 val, void *p)
diff --git a/include/linux/usb.h b/include/linux/usb.h
-index 4d22d0f..8d0e8f8 100644
+index a0bee5a..5533a52 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
-@@ -554,7 +554,7 @@ struct usb_device {
+@@ -552,7 +552,7 @@ struct usb_device {
int maxchild;
u32 quirks;
@@ -72553,7 +72558,7 @@ index 4d22d0f..8d0e8f8 100644
unsigned long active_duration;
-@@ -1604,7 +1604,7 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in,
+@@ -1607,7 +1607,7 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in,
extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
__u8 request, __u8 requesttype, __u16 value, __u16 index,
@@ -72563,7 +72568,7 @@ index 4d22d0f..8d0e8f8 100644
void *data, int len, int *actual_length, int timeout);
extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
-index c5d36c6..108f4f9 100644
+index e452ba6..78f8e80 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -39,7 +39,7 @@ enum {
@@ -72617,10 +72622,10 @@ index 6f8fbcf..8259001 100644
+ MODULE_GRSEC
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
-index 6071e91..4c73b47 100644
+index 7d5773a..541c01c 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 */
+@@ -16,6 +16,11 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */
#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */
#define VM_UNLIST 0x00000020 /* vm_struct is not listed in vmlist */
@@ -72632,7 +72637,7 @@ index 6071e91..4c73b47 100644
/* bits [20..32] reserved for arch specific ioremap internals */
/*
-@@ -62,7 +67,7 @@ extern void *vmalloc_32_user(unsigned long size);
+@@ -75,7 +80,7 @@ extern void *vmalloc_32_user(unsigned long size);
extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
unsigned long start, unsigned long end, gfp_t gfp_mask,
@@ -72641,7 +72646,7 @@ index 6071e91..4c73b47 100644
extern void vfree(const void *addr);
extern void *vmap(struct page **pages, unsigned int count,
-@@ -124,8 +129,8 @@ extern struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes);
+@@ -137,8 +142,8 @@ extern struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes);
extern void free_vm_area(struct vm_struct *area);
/* for /dev/kmem */
@@ -72653,10 +72658,10 @@ index 6071e91..4c73b47 100644
/*
* Internals. Dont't use..
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
-index 5fd71a7..e5ef9a9 100644
+index c586679..f06b389 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
-@@ -95,18 +95,18 @@ static inline void vm_events_fold_cpu(int cpu)
+@@ -90,18 +90,18 @@ static inline void vm_events_fold_cpu(int cpu)
/*
* Zone based page accounting with per cpu differentials.
*/
@@ -72679,7 +72684,7 @@ index 5fd71a7..e5ef9a9 100644
#ifdef CONFIG_SMP
if (x < 0)
x = 0;
-@@ -117,7 +117,7 @@ static inline unsigned long global_page_state(enum zone_stat_item item)
+@@ -112,7 +112,7 @@ static inline unsigned long global_page_state(enum zone_stat_item item)
static inline unsigned long zone_page_state(struct zone *zone,
enum zone_stat_item item)
{
@@ -72688,7 +72693,7 @@ index 5fd71a7..e5ef9a9 100644
#ifdef CONFIG_SMP
if (x < 0)
x = 0;
-@@ -134,7 +134,7 @@ static inline unsigned long zone_page_state(struct zone *zone,
+@@ -129,7 +129,7 @@ static inline unsigned long zone_page_state(struct zone *zone,
static inline unsigned long zone_page_state_snapshot(struct zone *zone,
enum zone_stat_item item)
{
@@ -72697,7 +72702,7 @@ index 5fd71a7..e5ef9a9 100644
#ifdef CONFIG_SMP
int cpu;
-@@ -226,8 +226,8 @@ static inline void __mod_zone_page_state(struct zone *zone,
+@@ -221,8 +221,8 @@ static inline void __mod_zone_page_state(struct zone *zone,
static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
{
@@ -72708,7 +72713,7 @@ index 5fd71a7..e5ef9a9 100644
}
static inline void __inc_zone_page_state(struct page *page,
-@@ -238,8 +238,8 @@ static inline void __inc_zone_page_state(struct page *page,
+@@ -233,8 +233,8 @@ static inline void __inc_zone_page_state(struct page *page,
static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
{
@@ -72776,18 +72781,6 @@ index 95d1c91..6798cca 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 4118ad1..cb7e25f 100644
---- a/include/media/v4l2-ioctl.h
-+++ b/include/media/v4l2-ioctl.h
-@@ -284,7 +284,6 @@ struct v4l2_ioctl_ops {
- bool valid_prio, int cmd, void *arg);
- };
-
--
- /* v4l debugging and diagnostics */
-
- /* Debug bitmask flags to be used on V4L2 */
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index adcbb20..62c2559 100644
--- a/include/net/9p/transport.h
@@ -72802,7 +72795,7 @@ index adcbb20..62c2559 100644
void v9fs_register_trans(struct p9_trans_module *m);
void v9fs_unregister_trans(struct p9_trans_module *m);
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
-index cdd3302..76f8ede 100644
+index fb94cf1..7c0c987 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -551,7 +551,7 @@ struct l2cap_ops {
@@ -72815,7 +72808,7 @@ index cdd3302..76f8ede 100644
struct l2cap_conn {
struct hci_conn *hcon;
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h
-index 9e5425b..8136ffc 100644
+index f2ae33d..c457cf0 100644
--- a/include/net/caif/cfctrl.h
+++ b/include/net/caif/cfctrl.h
@@ -52,7 +52,7 @@ struct cfctrl_rsp {
@@ -72851,10 +72844,10 @@ index 628e11b..4c475df 100644
#endif
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
-index bdfbe68..4402ebe 100644
+index 93024a4..eeb6b6e 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
-@@ -118,7 +118,7 @@ struct genl_ops {
+@@ -119,7 +119,7 @@ struct genl_ops {
struct netlink_callback *cb);
int (*done)(struct netlink_callback *cb);
struct list_head ops_list;
@@ -72877,7 +72870,7 @@ index 734d9b5..48a9a4b 100644
return;
}
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
-index 1832927..ce39aea 100644
+index de2c785..0588a6b 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -62,7 +62,7 @@ struct inet_connection_sock_af_ops {
@@ -72945,10 +72938,10 @@ index e49db91..76a81de 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 fce8e6b..3ca4916 100644
+index 4c062cc..3562c31 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
-@@ -599,7 +599,7 @@ struct ip_vs_conn {
+@@ -612,7 +612,7 @@ struct ip_vs_conn {
struct ip_vs_conn *control; /* Master control connection */
atomic_t n_control; /* Number of controlled ones */
struct ip_vs_dest *dest; /* real server */
@@ -72957,7 +72950,7 @@ index fce8e6b..3ca4916 100644
/* packet transmitter for different forwarding methods. If it
mangles the packet, it must return NF_DROP or better NF_STOLEN,
-@@ -737,7 +737,7 @@ struct ip_vs_dest {
+@@ -761,7 +761,7 @@ struct ip_vs_dest {
__be16 port; /* port number of the server */
union nf_inet_addr addr; /* IP address of the server */
volatile unsigned int flags; /* dest status flags */
@@ -72966,7 +72959,7 @@ index fce8e6b..3ca4916 100644
atomic_t weight; /* server weight */
atomic_t refcnt; /* reference counter */
-@@ -981,11 +981,11 @@ struct netns_ipvs {
+@@ -1013,11 +1013,11 @@ struct netns_ipvs {
/* ip_vs_lblc */
int sysctl_lblc_expiration;
struct ctl_table_header *lblc_ctl_header;
@@ -73073,10 +73066,10 @@ index 567c681..cd73ac0 100644
struct llc_sap_state {
u8 curr_state;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index f7eba13..91ed983 100644
+index 885898a..cdace34 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
-@@ -4119,7 +4119,7 @@ struct rate_control_ops {
+@@ -4205,7 +4205,7 @@ struct rate_control_ops {
void (*add_sta_debugfs)(void *priv, void *priv_sta,
struct dentry *dir);
void (*remove_sta_debugfs)(void *priv, void *priv_sta);
@@ -73099,10 +73092,10 @@ index 7e748ad..5c6229b 100644
struct pneigh_entry {
struct pneigh_entry *next;
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
-index de644bc..dfbcc4c 100644
+index b176978..ea169f4 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
-@@ -115,7 +115,7 @@ struct net {
+@@ -117,7 +117,7 @@ struct net {
#endif
struct netns_ipvs *ipvs;
struct sock *diag_nlsk;
@@ -73111,7 +73104,7 @@ index de644bc..dfbcc4c 100644
};
/*
-@@ -272,7 +272,11 @@ static inline struct net *read_pnet(struct net * const *pnet)
+@@ -274,7 +274,11 @@ static inline struct net *read_pnet(struct net * const *pnet)
#define __net_init __init
#define __net_exit __exit_refok
#define __net_initdata __initdata
@@ -73123,7 +73116,7 @@ index de644bc..dfbcc4c 100644
#endif
struct pernet_operations {
-@@ -282,7 +286,7 @@ struct pernet_operations {
+@@ -284,7 +288,7 @@ struct pernet_operations {
void (*exit_batch)(struct list_head *net_exit_list);
int *id;
size_t size;
@@ -73132,7 +73125,7 @@ index de644bc..dfbcc4c 100644
/*
* Use these carefully. If you implement a network device and it
-@@ -330,12 +334,12 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
+@@ -332,12 +336,12 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
static inline int rt_genid(struct net *net)
{
@@ -73212,6 +73205,19 @@ index 2ba9de8..47bd6c7 100644
#ifdef CONFIG_IP_MROUTE
#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
+diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
+index 005e2c2..023d340 100644
+--- a/include/net/netns/ipv6.h
++++ b/include/net/netns/ipv6.h
+@@ -71,7 +71,7 @@ struct netns_ipv6 {
+ struct fib_rules_ops *mr6_rules_ops;
+ #endif
+ #endif
+- atomic_t dev_addr_genid;
++ atomic_unchecked_t dev_addr_genid;
+ };
+
+ #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 047c047..b9dad15 100644
--- a/include/net/protocol.h
@@ -73235,7 +73241,7 @@ index 047c047..b9dad15 100644
#define INET6_PROTO_NOPOLICY 0x1
#define INET6_PROTO_FINAL 0x2
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
-index 5a15fab..d799ea7 100644
+index 7026648..584cc8c 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -81,7 +81,7 @@ struct rtnl_link_ops {
@@ -73248,7 +73254,7 @@ index 5a15fab..d799ea7 100644
extern int __rtnl_link_register(struct rtnl_link_ops *ops);
extern void __rtnl_link_unregister(struct rtnl_link_ops *ops);
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
-index df85a0c..19ac300 100644
+index cd89510..d67810f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -330,9 +330,9 @@ do { \
@@ -73287,10 +73293,10 @@ index 2a82d13..62a31c2 100644
/* Get the size of a DATA chunk payload. */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
-index 0e0f9d2..cd05ebb 100644
+index 1bd4c41..9250b5b 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
-@@ -517,7 +517,7 @@ struct sctp_pf {
+@@ -516,7 +516,7 @@ struct sctp_pf {
struct sctp_association *asoc);
void (*addr_v4map) (struct sctp_sock *, union sctp_addr *);
struct sctp_af *af;
@@ -73299,20 +73305,8 @@ index 0e0f9d2..cd05ebb 100644
/* Structure to track chunk fragments that have been acked, but peer
-diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h
-index c2e542b..6ca975b 100644
---- a/include/net/secure_seq.h
-+++ b/include/net/secure_seq.h
-@@ -3,6 +3,7 @@
-
- #include <linux/types.h>
-
-+extern void net_secret_init(void);
- extern __u32 secure_ip_id(__be32 daddr);
- extern __u32 secure_ipv6_id(const __be32 daddr[4]);
- extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
diff --git a/include/net/sock.h b/include/net/sock.h
-index 0be480a..586232f 100644
+index 66772cf..25bc45b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -325,7 +325,7 @@ struct sock {
@@ -73324,7 +73318,7 @@ index 0be480a..586232f 100644
int sk_rcvbuf;
struct sk_filter __rcu *sk_filter;
-@@ -1796,7 +1796,7 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags)
+@@ -1797,7 +1797,7 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags)
}
static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
@@ -73333,7 +73327,7 @@ index 0be480a..586232f 100644
int copy, int offset)
{
if (skb->ip_summed == CHECKSUM_NONE) {
-@@ -2055,7 +2055,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk)
+@@ -2056,7 +2056,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk)
}
}
@@ -73343,10 +73337,10 @@ index 0be480a..586232f 100644
/**
* sk_page_frag - return an appropriate page_frag
diff --git a/include/net/tcp.h b/include/net/tcp.h
-index a345480..3c65cf4 100644
+index 5bba80f..8520a82 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
-@@ -529,7 +529,7 @@ extern void tcp_retransmit_timer(struct sock *sk);
+@@ -524,7 +524,7 @@ extern void tcp_retransmit_timer(struct sock *sk);
extern void tcp_xmit_retransmit_queue(struct sock *);
extern void tcp_simple_retransmit(struct sock *);
extern int tcp_trim_head(struct sock *, struct sk_buff *, u32);
@@ -73355,7 +73349,7 @@ index a345480..3c65cf4 100644
extern void tcp_send_probe0(struct sock *);
extern void tcp_send_partial(struct sock *);
-@@ -700,8 +700,8 @@ struct tcp_skb_cb {
+@@ -697,8 +697,8 @@ struct tcp_skb_cb {
struct inet6_skb_parm h6;
#endif
} header; /* For incoming frames */
@@ -73366,7 +73360,7 @@ index a345480..3c65cf4 100644
__u32 when; /* used to compute rtt's */
__u8 tcp_flags; /* TCP header flags. (tcp[13]) */
-@@ -715,7 +715,7 @@ struct tcp_skb_cb {
+@@ -712,7 +712,7 @@ struct tcp_skb_cb {
__u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */
/* 1 byte hole */
@@ -73376,10 +73370,10 @@ index a345480..3c65cf4 100644
#define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0]))
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
-index 24c8886..e6fb816 100644
+index 94ce082..62b278d 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
-@@ -304,7 +304,7 @@ struct xfrm_policy_afinfo {
+@@ -305,7 +305,7 @@ struct xfrm_policy_afinfo {
struct net_device *dev,
const struct flowi *fl);
struct dst_entry *(*blackhole_route)(struct net *net, struct dst_entry *orig);
@@ -73388,7 +73382,7 @@ index 24c8886..e6fb816 100644
extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo);
extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo);
-@@ -340,7 +340,7 @@ struct xfrm_state_afinfo {
+@@ -341,7 +341,7 @@ struct xfrm_state_afinfo {
struct sk_buff *skb);
int (*transport_finish)(struct sk_buff *skb,
int async);
@@ -73397,7 +73391,7 @@ index 24c8886..e6fb816 100644
extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
-@@ -423,7 +423,7 @@ struct xfrm_mode {
+@@ -424,7 +424,7 @@ struct xfrm_mode {
struct module *owner;
unsigned int encap;
int flags;
@@ -73406,7 +73400,7 @@ index 24c8886..e6fb816 100644
/* Flags for xfrm_mode. */
enum {
-@@ -520,7 +520,7 @@ struct xfrm_policy {
+@@ -521,7 +521,7 @@ struct xfrm_policy {
struct timer_list timer;
struct flow_cache_object flo;
@@ -73450,7 +73444,7 @@ index e1379b4..67eafbe 100644
u8 qfull;
enum fc_lport_state state;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
-index a7f9cba..b1f44d0 100644
+index cc64587..608f523 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -171,9 +171,9 @@ struct scsi_device {
@@ -73481,10 +73475,10 @@ index b797e8f..8e2c3aa 100644
/**
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h
-index ff6c741..393815f 100644
+index 9031a26..750d592 100644
--- a/include/sound/compress_driver.h
+++ b/include/sound/compress_driver.h
-@@ -130,7 +130,7 @@ struct snd_compr_ops {
+@@ -128,7 +128,7 @@ struct snd_compr_ops {
struct snd_compr_caps *caps);
int (*get_codec_caps) (struct snd_compr_stream *stream,
struct snd_compr_codec_caps *codec);
@@ -73494,10 +73488,10 @@ index ff6c741..393815f 100644
/**
* struct snd_compr: Compressed device
diff --git a/include/sound/soc.h b/include/sound/soc.h
-index a6a059c..2243336 100644
+index 85c1522..f44bad1 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
-@@ -771,7 +771,7 @@ struct snd_soc_codec_driver {
+@@ -781,7 +781,7 @@ struct snd_soc_codec_driver {
/* probe ordering - for components with runtime dependencies */
int probe_order;
int remove_order;
@@ -73506,7 +73500,7 @@ index a6a059c..2243336 100644
/* SoC platform interface */
struct snd_soc_platform_driver {
-@@ -817,7 +817,7 @@ struct snd_soc_platform_driver {
+@@ -827,7 +827,7 @@ struct snd_soc_platform_driver {
unsigned int (*read)(struct snd_soc_platform *, unsigned int);
int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
int (*bespoke_trigger)(struct snd_pcm_substream *, int);
@@ -73516,10 +73510,10 @@ index a6a059c..2243336 100644
struct snd_soc_platform {
const char *name;
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
-index f8640f3..b72d113 100644
+index 4ea4f98..a63629b 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
-@@ -658,7 +658,7 @@ struct se_device {
+@@ -653,7 +653,7 @@ struct se_device {
spinlock_t stats_lock;
/* Active commands on this virtual SE device */
atomic_t simple_cmds;
@@ -73699,7 +73693,7 @@ index d876736..ccce5c0 100644
#define __cpu_to_le64s(x) do { (void)(x); } while (0)
#define __le64_to_cpus(x) do { (void)(x); } while (0)
diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
-index 8072d35..e77aeb8 100644
+index ef6103b..d4e65dd 100644
--- a/include/uapi/linux/elf.h
+++ b/include/uapi/linux/elf.h
@@ -37,6 +37,17 @@ typedef __s64 Elf64_Sxword;
@@ -73878,10 +73872,10 @@ index 1a91850..28573f8 100644
void *pmi_pal;
u8 *vbe_state_orig; /*
diff --git a/init/Kconfig b/init/Kconfig
-index 5341d72..153f24f 100644
+index 2d9b831..ae4c8ac 100644
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -984,6 +984,7 @@ endif # CGROUPS
+@@ -1029,6 +1029,7 @@ endif # CGROUPS
config CHECKPOINT_RESTORE
bool "Checkpoint/restore support" if EXPERT
@@ -73889,7 +73883,7 @@ index 5341d72..153f24f 100644
default n
help
Enables additional kernel features in a sake of checkpoint/restore.
-@@ -1471,7 +1472,7 @@ config SLUB_DEBUG
+@@ -1516,7 +1517,7 @@ config SLUB_DEBUG
config COMPAT_BRK
bool "Disable heap randomization"
@@ -73898,7 +73892,7 @@ index 5341d72..153f24f 100644
help
Randomizing heap placement makes heap exploits harder, but it
also breaks ancient binaries (including anything libc5 based).
-@@ -1734,7 +1735,7 @@ config INIT_ALL_POSSIBLE
+@@ -1779,7 +1780,7 @@ config INIT_ALL_POSSIBLE
config STOP_MACHINE
bool
default y
@@ -74003,7 +73997,7 @@ index f5b978a..69dbfe8 100644
if (!S_ISBLK(stat.st_mode))
return 0;
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
-index a32ec1c..60a6659 100644
+index 3e0878e..8a9d7a0 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -37,13 +37,13 @@ static int init_linuxrc(struct subprocess_info *info, struct cred *new)
@@ -74024,7 +74018,7 @@ index a32ec1c..60a6659 100644
sys_setsid();
return 0;
}
-@@ -58,8 +58,8 @@ static void __init handle_initrd(void)
+@@ -59,8 +59,8 @@ static void __init handle_initrd(void)
create_dev("/dev/root.old", Root_RAM0);
/* mount initrd on rootfs' /root */
mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY);
@@ -74035,7 +74029,7 @@ index a32ec1c..60a6659 100644
/* try loading default modules from initrd */
load_default_modules();
-@@ -76,31 +76,31 @@ static void __init handle_initrd(void)
+@@ -80,31 +80,31 @@ static void __init handle_initrd(void)
current->flags &= ~PF_FREEZER_SKIP;
/* move initrd to rootfs' /old */
@@ -74074,7 +74068,7 @@ index a32ec1c..60a6659 100644
printk(KERN_NOTICE "Trying to free ramdisk memory ... ");
if (fd < 0) {
error = fd;
-@@ -123,11 +123,11 @@ int __init initrd_load(void)
+@@ -127,11 +127,11 @@ int __init initrd_load(void)
* mounted in the normal path.
*/
if (rd_load_image("/initrd.image") && ROOT_DEV != Root_RAM0) {
@@ -74255,10 +74249,10 @@ index a67ef9d..2d17ed9 100644
#ifdef CONFIG_BLK_DEV_RAM
int fd;
diff --git a/init/main.c b/init/main.c
-index 63534a1..85feae2 100644
+index 9484f4b..4c01430 100644
--- a/init/main.c
+++ b/init/main.c
-@@ -98,6 +98,8 @@ static inline void mark_rodata_ro(void) { }
+@@ -100,6 +100,8 @@ static inline void mark_rodata_ro(void) { }
extern void tc_init(void);
#endif
@@ -74267,7 +74261,7 @@ index 63534a1..85feae2 100644
/*
* Debug helper: via this flag we know that we are in 'early bootup code'
* where only the boot processor is running with IRQ disabled. This means
-@@ -151,6 +153,64 @@ static int __init set_reset_devices(char *str)
+@@ -153,6 +155,64 @@ static int __init set_reset_devices(char *str)
__setup("reset_devices", set_reset_devices);
@@ -74332,7 +74326,16 @@ index 63534a1..85feae2 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;
-@@ -683,6 +743,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
+@@ -655,8 +715,6 @@ static void __init do_ctors(void)
+ bool initcall_debug;
+ core_param(initcall_debug, initcall_debug, bool, 0644);
+
+-static char msgbuf[64];
+-
+ static int __init_or_module do_one_initcall_debug(initcall_t fn)
+ {
+ ktime_t calltime, delta, rettime;
+@@ -679,23 +737,22 @@ int __init_or_module do_one_initcall(initcall_t fn)
{
int count = preempt_count();
int ret;
@@ -74340,11 +74343,13 @@ index 63534a1..85feae2 100644
if (initcall_debug)
ret = do_one_initcall_debug(fn);
-@@ -695,15 +756,15 @@ int __init_or_module do_one_initcall(initcall_t fn)
- sprintf(msgbuf, "error code %d ", ret);
+ else
+ ret = fn();
+- msgbuf[0] = 0;
+-
if (preempt_count() != count) {
-- strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
+- sprintf(msgbuf, "preemption imbalance ");
+ msg1 = " preemption imbalance";
preempt_count() = count;
}
@@ -74353,14 +74358,12 @@ index 63534a1..85feae2 100644
+ msg2 = " disabled interrupts";
local_irq_enable();
}
-- if (msgbuf[0]) {
-- printk("initcall %pF returned with %s\n", fn, msgbuf);
-+ if (msgbuf[0] || *msg1 || *msg2) {
-+ printk("initcall %pF returned with %s%s%s\n", fn, msgbuf, msg1, msg2);
- }
+- WARN(msgbuf[0], "initcall %pF returned with %s\n", fn, msgbuf);
++ WARN(*msg1 || *msg2, "initcall %pF returned with%s%s\n", fn, msg1, msg2);
return ret;
-@@ -757,8 +818,14 @@ static void __init do_initcall_level(int level)
+ }
+@@ -748,8 +805,14 @@ static void __init do_initcall_level(int level)
level, level,
&repair_env_string);
@@ -74376,7 +74379,7 @@ index 63534a1..85feae2 100644
}
static void __init do_initcalls(void)
-@@ -792,8 +859,14 @@ static void __init do_pre_smp_initcalls(void)
+@@ -783,8 +846,14 @@ static void __init do_pre_smp_initcalls(void)
{
initcall_t *fn;
@@ -74392,7 +74395,7 @@ index 63534a1..85feae2 100644
}
/*
-@@ -811,8 +884,8 @@ static int run_init_process(const char *init_filename)
+@@ -802,8 +871,8 @@ static int run_init_process(const char *init_filename)
{
argv_init[0] = init_filename;
return do_execve(init_filename,
@@ -74403,16 +74406,16 @@ index 63534a1..85feae2 100644
}
static noinline void __init kernel_init_freeable(void);
-@@ -890,7 +963,7 @@ static noinline void __init kernel_init_freeable(void)
+@@ -880,7 +949,7 @@ static noinline void __init kernel_init_freeable(void)
do_basic_setup();
/* Open the /dev/console on the rootfs, this should never fail */
- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
+ if (sys_open((const char __force_user *) "/dev/console", O_RDWR, 0) < 0)
- printk(KERN_WARNING "Warning: unable to open an initial console.\n");
+ pr_err("Warning: unable to open an initial console.\n");
(void) sys_dup(0);
-@@ -903,11 +976,13 @@ static noinline void __init kernel_init_freeable(void)
+@@ -893,11 +962,13 @@ static noinline void __init kernel_init_freeable(void)
if (!ramdisk_execute_command)
ramdisk_execute_command = "/init";
@@ -74502,10 +74505,10 @@ index e4e47f6..a85e0ad 100644
if (u->mq_bytes + mq_bytes < u->mq_bytes ||
u->mq_bytes + mq_bytes > rlimit(RLIMIT_MSGQUEUE)) {
diff --git a/ipc/msg.c b/ipc/msg.c
-index fede1d0..9778e0f8 100644
+index d0c6d96..69a893c 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
-@@ -309,18 +309,19 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg)
+@@ -296,18 +296,19 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg)
return security_msg_queue_associate(msq, msgflg);
}
@@ -74531,10 +74534,10 @@ index fede1d0..9778e0f8 100644
msg_params.flg = msgflg;
diff --git a/ipc/sem.c b/ipc/sem.c
-index 58d31f1..cce7a55 100644
+index 70480a3..f4e8262 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
-@@ -364,10 +364,15 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp,
+@@ -460,10 +460,15 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp,
return 0;
}
@@ -74551,7 +74554,7 @@ index 58d31f1..cce7a55 100644
struct ipc_params sem_params;
ns = current->nsproxy->ipc_ns;
-@@ -375,10 +380,6 @@ SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg)
+@@ -471,10 +476,6 @@ SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg)
if (nsems < 0 || nsems > ns->sc_semmsl)
return -EINVAL;
@@ -74657,10 +74660,10 @@ index 7e199fa..180a1ca 100644
shm_unlock(shp);
diff --git a/kernel/acct.c b/kernel/acct.c
-index b9bd7f0..1762b4a 100644
+index 8d6e145..33e0b1e 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
-@@ -550,7 +550,7 @@ static void do_acct_process(struct bsd_acct_struct *acct,
+@@ -556,7 +556,7 @@ static void do_acct_process(struct bsd_acct_struct *acct,
*/
flim = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
@@ -74670,10 +74673,10 @@ index b9bd7f0..1762b4a 100644
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim;
set_fs(fs);
diff --git a/kernel/audit.c b/kernel/audit.c
-index 8a667f10..7375e3f 100644
+index 91e53d0..d9e3ec4 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
-@@ -116,7 +116,7 @@ u32 audit_sig_sid = 0;
+@@ -118,7 +118,7 @@ u32 audit_sig_sid = 0;
3) suppressed due to audit_rate_limit
4) suppressed due to audit_backlog_limit
*/
@@ -74682,7 +74685,7 @@ index 8a667f10..7375e3f 100644
/* The netlink socket. */
static struct sock *audit_sock;
-@@ -238,7 +238,7 @@ void audit_log_lost(const char *message)
+@@ -240,7 +240,7 @@ void audit_log_lost(const char *message)
unsigned long now;
int print;
@@ -74691,7 +74694,7 @@ index 8a667f10..7375e3f 100644
print = (audit_failure == AUDIT_FAIL_PANIC || !audit_rate_limit);
-@@ -257,7 +257,7 @@ void audit_log_lost(const char *message)
+@@ -259,7 +259,7 @@ void audit_log_lost(const char *message)
printk(KERN_WARNING
"audit: audit_lost=%d audit_rate_limit=%d "
"audit_backlog_limit=%d\n",
@@ -74700,7 +74703,7 @@ index 8a667f10..7375e3f 100644
audit_rate_limit,
audit_backlog_limit);
audit_panic(message);
-@@ -681,7 +681,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
+@@ -664,7 +664,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;
@@ -74709,11 +74712,24 @@ index 8a667f10..7375e3f 100644
status_set.backlog = skb_queue_len(&audit_skb_queue);
audit_send_reply(NETLINK_CB(skb).portid, seq, AUDIT_GET, 0, 0,
&status_set, sizeof(status_set));
+diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
+index 6bd4a90..0ee9eff 100644
+--- a/kernel/auditfilter.c
++++ b/kernel/auditfilter.c
+@@ -423,7 +423,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
+ f->lsm_rule = NULL;
+
+ /* Support legacy tests for a valid loginuid */
+- if ((f->type == AUDIT_LOGINUID) && (f->val == 4294967295)) {
++ if ((f->type == AUDIT_LOGINUID) && (f->val == 4294967295U)) {
+ f->type = AUDIT_LOGINUID_SET;
+ f->val = 0;
+ }
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
-index c4b72b0..8654c4e 100644
+index 3c8a601..3a416f6 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
-@@ -2295,7 +2295,7 @@ int auditsc_get_stamp(struct audit_context *ctx,
+@@ -1956,7 +1956,7 @@ int auditsc_get_stamp(struct audit_context *ctx,
}
/* global counter which is incremented every time something logs in */
@@ -74722,7 +74738,7 @@ index c4b72b0..8654c4e 100644
/**
* audit_set_loginuid - set current task's audit_context loginuid
-@@ -2319,7 +2319,7 @@ int audit_set_loginuid(kuid_t loginuid)
+@@ -1980,7 +1980,7 @@ int audit_set_loginuid(kuid_t loginuid)
return -EPERM;
#endif /* CONFIG_AUDIT_LOGINUID_IMMUTABLE */
@@ -74828,10 +74844,10 @@ index f6c2ce5..982c0f9 100644
+ return ns_capable_nolog(ns, cap) && kuid_has_mapping(ns, inode->i_uid);
+}
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
-index a48de6a..df24bfe 100644
+index a7c9e6d..a16aa75 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
-@@ -5567,7 +5567,7 @@ static int cgroup_css_links_read(struct cgroup *cont,
+@@ -5378,7 +5378,7 @@ static int cgroup_css_links_read(struct cgroup *cont,
struct css_set *cg = link->cg;
struct task_struct *task;
int count = 0;
@@ -74841,7 +74857,7 @@ index a48de6a..df24bfe 100644
if (count++ > MAX_TASKS_SHOWN_PER_CSS) {
seq_puts(seq, " ...\n");
diff --git a/kernel/compat.c b/kernel/compat.c
-index 19971d8..02fe2df 100644
+index 0a09e48..f44f3f0 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -13,6 +13,7 @@
@@ -74888,16 +74904,7 @@ index 19971d8..02fe2df 100644
set_fs(old_fs);
if (!ret) {
-@@ -523,7 +524,7 @@ asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru)
- mm_segment_t old_fs = get_fs();
-
- set_fs(KERNEL_DS);
-- ret = sys_getrusage(who, (struct rusage __user *) &r);
-+ ret = sys_getrusage(who, (struct rusage __force_user *) &r);
- set_fs(old_fs);
-
- if (ret)
-@@ -552,8 +553,8 @@ COMPAT_SYSCALL_DEFINE4(wait4,
+@@ -533,8 +534,8 @@ COMPAT_SYSCALL_DEFINE4(wait4,
set_fs (KERNEL_DS);
ret = sys_wait4(pid,
(stat_addr ?
@@ -74908,7 +74915,7 @@ index 19971d8..02fe2df 100644
set_fs (old_fs);
if (ret > 0) {
-@@ -579,8 +580,8 @@ COMPAT_SYSCALL_DEFINE5(waitid,
+@@ -560,8 +561,8 @@ COMPAT_SYSCALL_DEFINE5(waitid,
memset(&info, 0, sizeof(info));
set_fs(KERNEL_DS);
@@ -74919,7 +74926,7 @@ index 19971d8..02fe2df 100644
set_fs(old_fs);
if ((ret < 0) || (info.si_signo == 0))
-@@ -714,8 +715,8 @@ long compat_sys_timer_settime(timer_t timer_id, int flags,
+@@ -695,8 +696,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,
@@ -74930,7 +74937,7 @@ index 19971d8..02fe2df 100644
set_fs(oldfs);
if (!err && old && put_compat_itimerspec(old, &oldts))
return -EFAULT;
-@@ -732,7 +733,7 @@ long compat_sys_timer_gettime(timer_t timer_id,
+@@ -713,7 +714,7 @@ long compat_sys_timer_gettime(timer_t timer_id,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_timer_gettime(timer_id,
@@ -74939,7 +74946,7 @@ index 19971d8..02fe2df 100644
set_fs(oldfs);
if (!err && put_compat_itimerspec(setting, &ts))
return -EFAULT;
-@@ -751,7 +752,7 @@ long compat_sys_clock_settime(clockid_t which_clock,
+@@ -732,7 +733,7 @@ long compat_sys_clock_settime(clockid_t which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_settime(which_clock,
@@ -74948,7 +74955,7 @@ index 19971d8..02fe2df 100644
set_fs(oldfs);
return err;
}
-@@ -766,7 +767,7 @@ long compat_sys_clock_gettime(clockid_t which_clock,
+@@ -747,7 +748,7 @@ long compat_sys_clock_gettime(clockid_t which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_gettime(which_clock,
@@ -74957,7 +74964,7 @@ index 19971d8..02fe2df 100644
set_fs(oldfs);
if (!err && put_compat_timespec(&ts, tp))
return -EFAULT;
-@@ -786,7 +787,7 @@ long compat_sys_clock_adjtime(clockid_t which_clock,
+@@ -767,7 +768,7 @@ long compat_sys_clock_adjtime(clockid_t which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
@@ -74966,7 +74973,7 @@ index 19971d8..02fe2df 100644
set_fs(oldfs);
err = compat_put_timex(utp, &txc);
-@@ -806,7 +807,7 @@ long compat_sys_clock_getres(clockid_t which_clock,
+@@ -787,7 +788,7 @@ long compat_sys_clock_getres(clockid_t which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_getres(which_clock,
@@ -74975,7 +74982,7 @@ index 19971d8..02fe2df 100644
set_fs(oldfs);
if (!err && tp && put_compat_timespec(&ts, tp))
return -EFAULT;
-@@ -818,9 +819,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
+@@ -799,9 +800,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
long err;
mm_segment_t oldfs;
struct timespec tu;
@@ -74987,7 +74994,7 @@ index 19971d8..02fe2df 100644
oldfs = get_fs();
set_fs(KERNEL_DS);
err = clock_nanosleep_restart(restart);
-@@ -852,8 +853,8 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
+@@ -833,8 +834,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,
@@ -74999,7 +75006,7 @@ index 19971d8..02fe2df 100644
if ((err == -ERESTART_RESTARTBLOCK) && rmtp &&
diff --git a/kernel/configs.c b/kernel/configs.c
-index 42e8fa0..9e7406b 100644
+index c18b1f1..b9a0132 100644
--- a/kernel/configs.c
+++ b/kernel/configs.c
@@ -74,8 +74,19 @@ static int __init ikconfig_init(void)
@@ -75165,7 +75172,7 @@ index e0573a4..3874e41 100644
/**
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
-index c26278f..e323fb8 100644
+index 0506d44..2c20034 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -123,7 +123,7 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_lock);
@@ -75251,10 +75258,10 @@ index 00eb8f7..d7e3244 100644
#ifdef CONFIG_MODULE_UNLOAD
{
diff --git a/kernel/events/core.c b/kernel/events/core.c
-index f8ddcfb..77c06ec 100644
+index b391907..a0e2372 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
-@@ -154,8 +154,15 @@ static struct srcu_struct pmus_srcu;
+@@ -156,8 +156,15 @@ static struct srcu_struct pmus_srcu;
* 0 - disallow raw tracepoint access for unpriv
* 1 - disallow cpu events for unpriv
* 2 - disallow kernel profiling for unpriv
@@ -75271,7 +75278,7 @@ index f8ddcfb..77c06ec 100644
/* Minimum for 512 kiB + 1 user control page */
int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */
-@@ -182,7 +189,7 @@ int perf_proc_update_handler(struct ctl_table *table, int write,
+@@ -184,7 +191,7 @@ int perf_proc_update_handler(struct ctl_table *table, int write,
return 0;
}
@@ -75280,7 +75287,7 @@ index f8ddcfb..77c06ec 100644
static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx,
enum event_type_t event_type);
-@@ -2674,7 +2681,7 @@ static void __perf_event_read(void *info)
+@@ -2725,7 +2732,7 @@ static void __perf_event_read(void *info)
static inline u64 perf_event_count(struct perf_event *event)
{
@@ -75289,7 +75296,7 @@ index f8ddcfb..77c06ec 100644
}
static u64 perf_event_read(struct perf_event *event)
-@@ -3020,9 +3027,9 @@ u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running)
+@@ -3071,9 +3078,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 +
@@ -75301,7 +75308,7 @@ index f8ddcfb..77c06ec 100644
list_for_each_entry(child, &event->child_list, child_list) {
total += perf_event_read(child);
-@@ -3408,10 +3415,10 @@ void perf_event_update_userpage(struct perf_event *event)
+@@ -3459,10 +3466,10 @@ void perf_event_update_userpage(struct perf_event *event)
userpg->offset -= local64_read(&event->hw.prev_count);
userpg->time_enabled = enabled +
@@ -75314,7 +75321,7 @@ index f8ddcfb..77c06ec 100644
arch_perf_update_userpage(userpg, now);
-@@ -3961,7 +3968,7 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
+@@ -4012,7 +4019,7 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
/* Data. */
sp = perf_user_stack_pointer(regs);
@@ -75323,7 +75330,7 @@ index f8ddcfb..77c06ec 100644
dyn_size = dump_size - rem;
perf_output_skip(handle, rem);
-@@ -4049,11 +4056,11 @@ static void perf_output_read_one(struct perf_output_handle *handle,
+@@ -4100,11 +4107,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 +
@@ -75337,7 +75344,7 @@ index f8ddcfb..77c06ec 100644
}
if (read_format & PERF_FORMAT_ID)
values[n++] = primary_event_id(event);
-@@ -4801,12 +4808,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
+@@ -4813,12 +4820,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.
*/
@@ -75352,7 +75359,7 @@ index f8ddcfb..77c06ec 100644
if (IS_ERR(name)) {
name = strncpy(tmp, "//toolong", sizeof(tmp));
goto got_name;
-@@ -6242,7 +6249,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
+@@ -6240,7 +6247,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
event->parent = parent_event;
event->ns = get_pid_ns(task_active_pid_ns(current));
@@ -75361,7 +75368,7 @@ index f8ddcfb..77c06ec 100644
event->state = PERF_EVENT_STATE_INACTIVE;
-@@ -6552,6 +6559,11 @@ SYSCALL_DEFINE5(perf_event_open,
+@@ -6550,6 +6557,11 @@ SYSCALL_DEFINE5(perf_event_open,
if (flags & ~PERF_FLAG_ALL)
return -EINVAL;
@@ -75373,7 +75380,7 @@ index f8ddcfb..77c06ec 100644
err = perf_copy_attr(attr_uptr, &attr);
if (err)
return err;
-@@ -6884,10 +6896,10 @@ static void sync_child_event(struct perf_event *child_event,
+@@ -6882,10 +6894,10 @@ static void sync_child_event(struct perf_event *child_event,
/*
* Add back the child's count to the parent's count:
*/
@@ -75426,7 +75433,7 @@ index ca65997..cc8cee4 100644
/* Callchain handling */
extern struct perf_callchain_entry *
diff --git a/kernel/exit.c b/kernel/exit.c
-index 60bc027..ca6d727 100644
+index 7bb73f9..d7978ed 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -172,6 +172,10 @@ void release_task(struct task_struct * p)
@@ -75449,7 +75456,7 @@ index 60bc027..ca6d727 100644
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
return 0;
-@@ -710,6 +714,8 @@ void do_exit(long code)
+@@ -709,6 +713,8 @@ void do_exit(long code)
struct task_struct *tsk = current;
int group_dead;
@@ -75458,7 +75465,7 @@ index 60bc027..ca6d727 100644
profile_task_exit(tsk);
WARN_ON(blk_needs_flush_plug(tsk));
-@@ -726,7 +732,6 @@ void do_exit(long code)
+@@ -725,7 +731,6 @@ void do_exit(long code)
* mm_release()->clear_child_tid() from writing to a user-controlled
* kernel address.
*/
@@ -75466,7 +75473,7 @@ index 60bc027..ca6d727 100644
ptrace_event(PTRACE_EVENT_EXIT, code);
-@@ -785,6 +790,9 @@ void do_exit(long code)
+@@ -784,6 +789,9 @@ void do_exit(long code)
tsk->exit_code = code;
taskstats_exit(tsk, group_dead);
@@ -75486,10 +75493,10 @@ index 60bc027..ca6d727 100644
{
struct signal_struct *sig = current->signal;
diff --git a/kernel/fork.c b/kernel/fork.c
-index 1766d32..c0e44e2 100644
+index 987b28a..60e5ad2 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -318,7 +318,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
+@@ -319,7 +319,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
*stackend = STACK_END_MAGIC; /* for overflow detection */
#ifdef CONFIG_CC_STACKPROTECTOR
@@ -75498,7 +75505,7 @@ index 1766d32..c0e44e2 100644
#endif
/*
-@@ -344,13 +344,81 @@ free_tsk:
+@@ -345,13 +345,81 @@ free_tsk:
}
#ifdef CONFIG_MMU
@@ -75582,7 +75589,7 @@ index 1766d32..c0e44e2 100644
uprobe_start_dup_mmap();
down_write(&oldmm->mmap_sem);
-@@ -364,8 +432,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -365,8 +433,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
mm->locked_vm = 0;
mm->mmap = NULL;
mm->mmap_cache = NULL;
@@ -75593,7 +75600,7 @@ index 1766d32..c0e44e2 100644
mm->map_count = 0;
cpumask_clear(mm_cpumask(mm));
mm->mm_rb = RB_ROOT;
-@@ -381,57 +449,15 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -382,57 +450,15 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
prev = NULL;
for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) {
@@ -75655,7 +75662,7 @@ index 1766d32..c0e44e2 100644
}
/*
-@@ -463,6 +489,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -464,6 +490,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
if (retval)
goto out;
}
@@ -75687,7 +75694,7 @@ index 1766d32..c0e44e2 100644
/* a new mm has just been created */
arch_dup_mmap(oldmm, mm);
retval = 0;
-@@ -472,14 +523,6 @@ out:
+@@ -473,14 +524,6 @@ out:
up_write(&oldmm->mmap_sem);
uprobe_end_dup_mmap();
return retval;
@@ -75702,7 +75709,7 @@ index 1766d32..c0e44e2 100644
}
static inline int mm_alloc_pgd(struct mm_struct *mm)
-@@ -694,8 +737,8 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
+@@ -695,8 +738,8 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
return ERR_PTR(err);
mm = get_task_mm(task);
@@ -75713,7 +75720,7 @@ index 1766d32..c0e44e2 100644
mmput(mm);
mm = ERR_PTR(-EACCES);
}
-@@ -917,13 +960,20 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
+@@ -918,13 +961,20 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
spin_unlock(&fs->lock);
return -EAGAIN;
}
@@ -75735,7 +75742,7 @@ index 1766d32..c0e44e2 100644
return 0;
}
-@@ -1196,6 +1246,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
+@@ -1197,6 +1247,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
#endif
retval = -EAGAIN;
@@ -75745,7 +75752,7 @@ index 1766d32..c0e44e2 100644
if (atomic_read(&p->real_cred->user->processes) >=
task_rlimit(p, RLIMIT_NPROC)) {
if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
-@@ -1441,6 +1494,11 @@ static struct task_struct *copy_process(unsigned long clone_flags,
+@@ -1446,6 +1499,11 @@ static struct task_struct *copy_process(unsigned long clone_flags,
goto bad_fork_free_pid;
}
@@ -75757,7 +75764,7 @@ index 1766d32..c0e44e2 100644
if (clone_flags & CLONE_THREAD) {
current->signal->nr_threads++;
atomic_inc(&current->signal->live);
-@@ -1524,6 +1582,8 @@ bad_fork_cleanup_count:
+@@ -1529,6 +1587,8 @@ bad_fork_cleanup_count:
bad_fork_free:
free_task(p);
fork_out:
@@ -75766,7 +75773,7 @@ index 1766d32..c0e44e2 100644
return ERR_PTR(retval);
}
-@@ -1574,6 +1634,23 @@ long do_fork(unsigned long clone_flags,
+@@ -1579,6 +1639,23 @@ long do_fork(unsigned long clone_flags,
return -EINVAL;
}
@@ -75790,7 +75797,7 @@ index 1766d32..c0e44e2 100644
/*
* Determine whether and which event to report to ptracer. When
* called from kernel_thread or CLONE_UNTRACED is explicitly
-@@ -1608,6 +1685,8 @@ long do_fork(unsigned long clone_flags,
+@@ -1613,6 +1690,8 @@ long do_fork(unsigned long clone_flags,
if (clone_flags & CLONE_PARENT_SETTID)
put_user(nr, parent_tidptr);
@@ -75799,7 +75806,7 @@ index 1766d32..c0e44e2 100644
if (clone_flags & CLONE_VFORK) {
p->vfork_done = &vfork;
init_completion(&vfork);
-@@ -1761,7 +1840,7 @@ static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp)
+@@ -1763,7 +1842,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 */
@@ -75808,7 +75815,7 @@ index 1766d32..c0e44e2 100644
return 0;
*new_fsp = copy_fs_struct(fs);
-@@ -1873,7 +1952,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
+@@ -1875,7 +1954,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
fs = current->fs;
spin_lock(&fs->lock);
current->fs = new_fs;
@@ -75901,10 +75908,10 @@ index 9b22d03..6295b62 100644
prev->next = info->next;
else
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
-index 7ef5556..8247f11 100644
+index fd4b13b..09a5ccb 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
-@@ -1416,7 +1416,7 @@ void hrtimer_peek_ahead_timers(void)
+@@ -1430,7 +1430,7 @@ void hrtimer_peek_ahead_timers(void)
local_irq_restore(flags);
}
@@ -75913,7 +75920,7 @@ index 7ef5556..8247f11 100644
{
struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
-@@ -1758,7 +1758,7 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
+@@ -1772,7 +1772,7 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
return NOTIFY_OK;
}
@@ -75979,7 +75986,7 @@ index 60f48fa..7f3a770 100644
static int
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
-index 2169fee..706ccca 100644
+index 3127ad5..159d880 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -11,6 +11,9 @@
@@ -76055,7 +76062,7 @@ index 2169fee..706ccca 100644
if (all_var)
return is_kernel(addr);
-@@ -470,7 +509,6 @@ static unsigned long get_ksymbol_core(struct kallsym_iter *iter)
+@@ -480,7 +519,6 @@ static unsigned long get_ksymbol_core(struct kallsym_iter *iter)
static void reset_iter(struct kallsym_iter *iter, loff_t new_pos)
{
@@ -76063,7 +76070,7 @@ index 2169fee..706ccca 100644
iter->nameoff = get_symbol_offset(new_pos);
iter->pos = new_pos;
}
-@@ -518,6 +556,11 @@ static int s_show(struct seq_file *m, void *p)
+@@ -528,6 +566,11 @@ static int s_show(struct seq_file *m, void *p)
{
struct kallsym_iter *iter = m->private;
@@ -76075,7 +76082,7 @@ index 2169fee..706ccca 100644
/* Some debugging symbols have no name. Ignore them. */
if (!iter->name[0])
return 0;
-@@ -531,6 +574,7 @@ static int s_show(struct seq_file *m, void *p)
+@@ -541,6 +584,7 @@ static int s_show(struct seq_file *m, void *p)
*/
type = iter->exported ? toupper(iter->type) :
tolower(iter->type);
@@ -76083,7 +76090,7 @@ index 2169fee..706ccca 100644
seq_printf(m, "%pK %c %s\t[%s]\n", (void *)iter->value,
type, iter->name, iter->module_name);
} else
-@@ -556,7 +600,7 @@ static int kallsyms_open(struct inode *inode, struct file *file)
+@@ -566,7 +610,7 @@ static int kallsyms_open(struct inode *inode, struct file *file)
struct kallsym_iter *iter;
int ret;
@@ -76108,10 +76115,10 @@ index e30ac0f..3528cac 100644
/*
diff --git a/kernel/kexec.c b/kernel/kexec.c
-index ffd4e11..c3ff6bf 100644
+index 59f7b55..4022f65 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
-@@ -1048,7 +1048,8 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry,
+@@ -1041,7 +1041,8 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry,
unsigned long flags)
{
struct compat_kexec_segment in;
@@ -76122,7 +76129,7 @@ index ffd4e11..c3ff6bf 100644
/* Don't allow clients that don't understand the native
diff --git a/kernel/kmod.c b/kernel/kmod.c
-index 8985c87..f539dbe 100644
+index 8241906..d625f2c 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -75,7 +75,7 @@ static void free_modprobe_argv(struct subprocess_info *info)
@@ -76132,9 +76139,9 @@ index 8985c87..f539dbe 100644
-static int call_modprobe(char *module_name, int wait)
+static int call_modprobe(char *module_name, char *module_param, int wait)
{
+ struct subprocess_info *info;
static char *envp[] = {
- "HOME=/",
-@@ -84,7 +84,7 @@ static int call_modprobe(char *module_name, int wait)
+@@ -85,7 +85,7 @@ static int call_modprobe(char *module_name, int wait)
NULL
};
@@ -76143,7 +76150,7 @@ index 8985c87..f539dbe 100644
if (!argv)
goto out;
-@@ -96,7 +96,8 @@ static int call_modprobe(char *module_name, int wait)
+@@ -97,7 +97,8 @@ static int call_modprobe(char *module_name, int wait)
argv[1] = "-q";
argv[2] = "--";
argv[3] = module_name; /* check free_modprobe_argv() */
@@ -76151,9 +76158,9 @@ index 8985c87..f539dbe 100644
+ argv[4] = module_param;
+ argv[5] = NULL;
- return call_usermodehelper_fns(modprobe_path, argv, envp,
- wait | UMH_KILLABLE, NULL, free_modprobe_argv, NULL);
-@@ -121,9 +122,8 @@ out:
+ info = call_usermodehelper_setup(modprobe_path, argv, envp, GFP_KERNEL,
+ NULL, free_modprobe_argv, NULL);
+@@ -129,9 +130,8 @@ out:
* If module auto-loading support is disabled then this function
* becomes a no-operation.
*/
@@ -76164,7 +76171,7 @@ index 8985c87..f539dbe 100644
char module_name[MODULE_NAME_LEN];
unsigned int max_modprobes;
int ret;
-@@ -139,9 +139,7 @@ int __request_module(bool wait, const char *fmt, ...)
+@@ -147,9 +147,7 @@ int __request_module(bool wait, const char *fmt, ...)
*/
WARN_ON_ONCE(wait && current_is_async());
@@ -76175,7 +76182,7 @@ index 8985c87..f539dbe 100644
if (ret >= MODULE_NAME_LEN)
return -ENAMETOOLONG;
-@@ -149,6 +147,20 @@ int __request_module(bool wait, const char *fmt, ...)
+@@ -157,6 +155,20 @@ int __request_module(bool wait, const char *fmt, ...)
if (ret)
return ret;
@@ -76196,7 +76203,7 @@ index 8985c87..f539dbe 100644
/* If modprobe needs a service that is in a module, we get a recursive
* loop. Limit the number of running kmod threads to max_threads/2 or
* MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method
-@@ -177,11 +189,52 @@ int __request_module(bool wait, const char *fmt, ...)
+@@ -185,11 +197,52 @@ int __request_module(bool wait, const char *fmt, ...)
trace_module_request(module_name, wait, _RET_IP_);
@@ -76250,7 +76257,7 @@ index 8985c87..f539dbe 100644
EXPORT_SYMBOL(__request_module);
#endif /* CONFIG_MODULES */
-@@ -292,7 +345,7 @@ static int wait_for_helper(void *data)
+@@ -300,7 +353,7 @@ static int wait_for_helper(void *data)
*
* Thus the __user pointer cast is valid here.
*/
@@ -76259,7 +76266,7 @@ index 8985c87..f539dbe 100644
/*
* If ret is 0, either ____call_usermodehelper failed and the
-@@ -649,7 +702,7 @@ EXPORT_SYMBOL(call_usermodehelper_fns);
+@@ -651,7 +704,7 @@ EXPORT_SYMBOL(call_usermodehelper);
static int proc_cap_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
@@ -76269,7 +76276,7 @@ index 8985c87..f539dbe 100644
kernel_cap_t new_cap;
int err, i;
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
-index 3fed7f0..a3f95ed 100644
+index bddf3b2..07b90dd 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)
@@ -76290,7 +76297,7 @@ index 3fed7f0..a3f95ed 100644
kfree(kip);
}
return 1;
-@@ -2073,7 +2073,7 @@ static int __init init_kprobes(void)
+@@ -2083,7 +2083,7 @@ static int __init init_kprobes(void)
{
int i, err = 0;
unsigned long offset = 0, size = 0;
@@ -76299,7 +76306,7 @@ index 3fed7f0..a3f95ed 100644
const char *symbol_name;
void *addr;
struct kprobe_blackpoint *kb;
-@@ -2158,11 +2158,11 @@ static void __kprobes report_probe(struct seq_file *pi, struct kprobe *p,
+@@ -2168,11 +2168,11 @@ static void __kprobes report_probe(struct seq_file *pi, struct kprobe *p,
kprobe_type = "k";
if (sym)
@@ -76313,7 +76320,7 @@ index 3fed7f0..a3f95ed 100644
p->addr, kprobe_type, p->addr);
if (!pp)
-@@ -2199,7 +2199,7 @@ static int __kprobes show_kprobe_addr(struct seq_file *pi, void *v)
+@@ -2209,7 +2209,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;
@@ -76345,10 +76352,10 @@ index 6ada93c..dce7d5d 100644
.name = "notes",
.mode = S_IRUGO,
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
-index 8a0efac..56f1e2d 100644
+index 1f3186b..bb7dbc6 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
-@@ -590,6 +590,10 @@ static int static_obj(void *obj)
+@@ -596,6 +596,10 @@ static int static_obj(void *obj)
end = (unsigned long) &_end,
addr = (unsigned long) obj;
@@ -76359,7 +76366,7 @@ index 8a0efac..56f1e2d 100644
/*
* static variable?
*/
-@@ -730,6 +734,7 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
+@@ -736,6 +740,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");
@@ -76367,7 +76374,7 @@ index 8a0efac..56f1e2d 100644
printk("the code is fine but needs lockdep annotation.\n");
printk("turning off the locking correctness validator.\n");
dump_stack();
-@@ -3078,7 +3083,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
+@@ -3080,7 +3085,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
if (!class)
return 0;
}
@@ -76426,7 +76433,7 @@ index b2c71c5..7b88d63 100644
seq_printf(m, "%40s %14lu %29s %pS\n",
name, stats->contending_point[i],
diff --git a/kernel/module.c b/kernel/module.c
-index 97f202c..109575f 100644
+index cab4bce..2025a6e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -61,6 +61,7 @@
@@ -76492,7 +76499,7 @@ index 97f202c..109575f 100644
}
static struct module_attribute modinfo_initsize =
-@@ -1312,7 +1314,7 @@ resolve_symbol_wait(struct module *mod,
+@@ -1313,7 +1315,7 @@ resolve_symbol_wait(struct module *mod,
*/
#ifdef CONFIG_SYSFS
@@ -76501,7 +76508,7 @@ index 97f202c..109575f 100644
static inline bool sect_empty(const Elf_Shdr *sect)
{
return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size == 0;
-@@ -1452,7 +1454,7 @@ static void add_notes_attrs(struct module *mod, const struct load_info *info)
+@@ -1453,7 +1455,7 @@ static void add_notes_attrs(struct module *mod, const struct load_info *info)
{
unsigned int notes, loaded, i;
struct module_notes_attrs *notes_attrs;
@@ -76510,7 +76517,7 @@ index 97f202c..109575f 100644
/* failed to create section attributes, so can't create notes */
if (!mod->sect_attrs)
-@@ -1564,7 +1566,7 @@ static void del_usage_links(struct module *mod)
+@@ -1565,7 +1567,7 @@ static void del_usage_links(struct module *mod)
static int module_add_modinfo_attrs(struct module *mod)
{
struct module_attribute *attr;
@@ -76519,7 +76526,7 @@ index 97f202c..109575f 100644
int error = 0;
int i;
-@@ -1778,21 +1780,21 @@ static void set_section_ro_nx(void *base,
+@@ -1779,21 +1781,21 @@ static void set_section_ro_nx(void *base,
static void unset_module_core_ro_nx(struct module *mod)
{
@@ -76549,7 +76556,7 @@ index 97f202c..109575f 100644
set_memory_rw);
}
-@@ -1805,14 +1807,14 @@ void set_all_modules_text_rw(void)
+@@ -1806,14 +1808,14 @@ void set_all_modules_text_rw(void)
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
@@ -76570,7 +76577,7 @@ index 97f202c..109575f 100644
set_memory_rw);
}
}
-@@ -1828,14 +1830,14 @@ void set_all_modules_text_ro(void)
+@@ -1829,14 +1831,14 @@ void set_all_modules_text_ro(void)
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
@@ -76591,7 +76598,7 @@ index 97f202c..109575f 100644
set_memory_ro);
}
}
-@@ -1886,16 +1888,19 @@ static void free_module(struct module *mod)
+@@ -1887,16 +1889,19 @@ static void free_module(struct module *mod)
/* This may be NULL, but that's OK */
unset_module_init_ro_nx(mod);
@@ -76614,7 +76621,7 @@ index 97f202c..109575f 100644
#ifdef CONFIG_MPU
update_protections(current->mm);
-@@ -1965,9 +1970,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -1966,9 +1971,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
int ret = 0;
const struct kernel_symbol *ksym;
@@ -76646,7 +76653,7 @@ index 97f202c..109575f 100644
switch (sym[i].st_shndx) {
case SHN_COMMON:
/* We compiled with -fno-common. These are not
-@@ -1988,7 +2015,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -1989,7 +2016,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)) {
@@ -76656,7 +76663,7 @@ index 97f202c..109575f 100644
break;
}
-@@ -2007,11 +2036,20 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -2008,11 +2037,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;
@@ -76677,7 +76684,7 @@ index 97f202c..109575f 100644
return ret;
}
-@@ -2095,22 +2133,12 @@ static void layout_sections(struct module *mod, struct load_info *info)
+@@ -2096,22 +2134,12 @@ static void layout_sections(struct module *mod, struct load_info *info)
|| s->sh_entsize != ~0UL
|| strstarts(sname, ".init"))
continue;
@@ -76704,7 +76711,7 @@ index 97f202c..109575f 100644
}
pr_debug("Init section allocation order:\n");
-@@ -2124,23 +2152,13 @@ static void layout_sections(struct module *mod, struct load_info *info)
+@@ -2125,23 +2153,13 @@ static void layout_sections(struct module *mod, struct load_info *info)
|| s->sh_entsize != ~0UL
|| !strstarts(sname, ".init"))
continue;
@@ -76733,7 +76740,7 @@ index 97f202c..109575f 100644
}
}
-@@ -2313,7 +2331,7 @@ static void layout_symtab(struct module *mod, struct load_info *info)
+@@ -2314,7 +2332,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;
@@ -76742,7 +76749,7 @@ index 97f202c..109575f 100644
info->index.sym) | INIT_OFFSET_MASK;
pr_debug("\t%s\n", info->secstrings + symsect->sh_name);
-@@ -2330,13 +2348,13 @@ static void layout_symtab(struct module *mod, struct load_info *info)
+@@ -2331,13 +2349,13 @@ static void layout_symtab(struct module *mod, struct load_info *info)
}
/* Append room for core symbols at end of core part. */
@@ -76760,7 +76767,7 @@ index 97f202c..109575f 100644
info->index.str) | INIT_OFFSET_MASK;
pr_debug("\t%s\n", info->secstrings + strsect->sh_name);
}
-@@ -2354,12 +2372,14 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
+@@ -2355,12 +2373,14 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
/* Make sure we get permanent strtab: don't use info->strtab. */
mod->strtab = (void *)info->sechdrs[info->index.str].sh_addr;
@@ -76777,7 +76784,7 @@ index 97f202c..109575f 100644
src = mod->symtab;
for (ndst = i = 0; i < mod->num_symtab; i++) {
if (i == 0 ||
-@@ -2371,6 +2391,8 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
+@@ -2372,6 +2392,8 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
}
}
mod->core_num_syms = ndst;
@@ -76786,7 +76793,7 @@ index 97f202c..109575f 100644
}
#else
static inline void layout_symtab(struct module *mod, struct load_info *info)
-@@ -2404,17 +2426,33 @@ void * __weak module_alloc(unsigned long size)
+@@ -2405,17 +2427,33 @@ void * __weak module_alloc(unsigned long size)
return vmalloc_exec(size);
}
@@ -76825,7 +76832,7 @@ index 97f202c..109575f 100644
mutex_unlock(&module_mutex);
}
return ret;
-@@ -2690,8 +2728,14 @@ static struct module *setup_load_info(struct load_info *info, int flags)
+@@ -2691,8 +2729,14 @@ static struct module *setup_load_info(struct load_info *info, int flags)
static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{
const char *modmagic = get_modinfo(info, "vermagic");
@@ -76840,7 +76847,7 @@ index 97f202c..109575f 100644
if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL;
-@@ -2717,7 +2761,7 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
+@@ -2718,7 +2762,7 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
}
/* Set up license info based on the info section */
@@ -76849,7 +76856,7 @@ index 97f202c..109575f 100644
return 0;
}
-@@ -2811,7 +2855,7 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2799,7 +2843,7 @@ static int move_module(struct module *mod, struct load_info *info)
void *ptr;
/* Do the allocs. */
@@ -76858,7 +76865,7 @@ index 97f202c..109575f 100644
/*
* The pointer to this block is stored in the module structure
* which is inside the block. Just mark it as not being a
-@@ -2821,11 +2865,11 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2809,11 +2853,11 @@ static int move_module(struct module *mod, struct load_info *info)
if (!ptr)
return -ENOMEM;
@@ -76874,7 +76881,7 @@ index 97f202c..109575f 100644
/*
* The pointer to this block is stored in the module structure
* which is inside the block. This block doesn't need to be
-@@ -2834,13 +2878,45 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2822,13 +2866,45 @@ static int move_module(struct module *mod, struct load_info *info)
*/
kmemleak_ignore(ptr);
if (!ptr) {
@@ -76924,7 +76931,7 @@ index 97f202c..109575f 100644
/* Transfer each section which specifies SHF_ALLOC */
pr_debug("final section addresses:\n");
-@@ -2851,16 +2927,45 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2839,16 +2915,45 @@ static int move_module(struct module *mod, struct load_info *info)
if (!(shdr->sh_flags & SHF_ALLOC))
continue;
@@ -76977,7 +76984,7 @@ index 97f202c..109575f 100644
pr_debug("\t0x%lx %s\n",
(long)shdr->sh_addr, info->secstrings + shdr->sh_name);
}
-@@ -2917,12 +3022,12 @@ static void flush_module_icache(const struct module *mod)
+@@ -2905,12 +3010,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.
*/
@@ -76996,7 +77003,7 @@ index 97f202c..109575f 100644
set_fs(old_fs);
}
-@@ -2992,8 +3097,10 @@ out:
+@@ -2980,8 +3085,10 @@ out:
static void module_deallocate(struct module *mod, struct load_info *info)
{
percpu_modfree(mod);
@@ -77009,7 +77016,7 @@ index 97f202c..109575f 100644
}
int __weak module_finalize(const Elf_Ehdr *hdr,
-@@ -3006,7 +3113,9 @@ int __weak module_finalize(const Elf_Ehdr *hdr,
+@@ -2994,7 +3101,9 @@ int __weak module_finalize(const Elf_Ehdr *hdr,
static int post_relocation(struct module *mod, const struct load_info *info)
{
/* Sort exception table now relocations are done. */
@@ -77019,7 +77026,7 @@ index 97f202c..109575f 100644
/* Copy relocated percpu area over. */
percpu_modcopy(mod, (void *)info->sechdrs[info->index.pcpu].sh_addr,
-@@ -3060,16 +3169,16 @@ static int do_init_module(struct module *mod)
+@@ -3048,16 +3157,16 @@ static int do_init_module(struct module *mod)
MODULE_STATE_COMING, mod);
/* Set RO and NX regions for core */
@@ -77044,7 +77051,7 @@ index 97f202c..109575f 100644
do_mod_ctors(mod);
/* Start the module */
-@@ -3131,11 +3240,12 @@ static int do_init_module(struct module *mod)
+@@ -3119,11 +3228,12 @@ static int do_init_module(struct module *mod)
mod->strtab = mod->core_strtab;
#endif
unset_module_init_ro_nx(mod);
@@ -77062,7 +77069,7 @@ index 97f202c..109575f 100644
mutex_unlock(&module_mutex);
wake_up_all(&module_wq);
-@@ -3262,9 +3372,38 @@ static int load_module(struct load_info *info, const char __user *uargs,
+@@ -3250,9 +3360,38 @@ static int load_module(struct load_info *info, const char __user *uargs,
if (err)
goto free_unload;
@@ -77101,7 +77108,7 @@ index 97f202c..109575f 100644
/* Fix up syms, so that st_value is a pointer to location. */
err = simplify_symbols(mod, info);
if (err < 0)
-@@ -3280,13 +3419,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
+@@ -3268,13 +3407,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
flush_module_icache(mod);
@@ -77115,7 +77122,7 @@ index 97f202c..109575f 100644
dynamic_debug_setup(info->debug, info->num_debug);
/* Finally it's fully formed, ready to start executing. */
-@@ -3321,11 +3453,10 @@ static int load_module(struct load_info *info, const char __user *uargs,
+@@ -3309,11 +3441,10 @@ static int load_module(struct load_info *info, const char __user *uargs,
ddebug_cleanup:
dynamic_debug_remove(info->debug);
synchronize_sched();
@@ -77128,7 +77135,7 @@ index 97f202c..109575f 100644
free_unload:
module_unload_free(mod);
unlink_mod:
-@@ -3408,10 +3539,16 @@ static const char *get_ksymbol(struct module *mod,
+@@ -3396,10 +3527,16 @@ static const char *get_ksymbol(struct module *mod,
unsigned long nextval;
/* At worse, next value is at end of module */
@@ -77148,7 +77155,7 @@ index 97f202c..109575f 100644
/* Scan for closest preceding symbol, and next symbol. (ELF
starts real symbols at 1). */
-@@ -3664,7 +3801,7 @@ static int m_show(struct seq_file *m, void *p)
+@@ -3652,7 +3789,7 @@ static int m_show(struct seq_file *m, void *p)
return 0;
seq_printf(m, "%s %u",
@@ -77157,7 +77164,7 @@ index 97f202c..109575f 100644
print_unload_info(m, mod);
/* Informative for users. */
-@@ -3673,7 +3810,7 @@ static int m_show(struct seq_file *m, void *p)
+@@ -3661,7 +3798,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. */
@@ -77166,7 +77173,7 @@ index 97f202c..109575f 100644
/* Taints info */
if (mod->taints)
-@@ -3709,7 +3846,17 @@ static const struct file_operations proc_modules_operations = {
+@@ -3697,7 +3834,17 @@ static const struct file_operations proc_modules_operations = {
static int __init proc_modules_init(void)
{
@@ -77184,7 +77191,7 @@ index 97f202c..109575f 100644
return 0;
}
module_init(proc_modules_init);
-@@ -3770,14 +3917,14 @@ struct module *__module_address(unsigned long addr)
+@@ -3758,14 +3905,14 @@ struct module *__module_address(unsigned long addr)
{
struct module *mod;
@@ -77202,7 +77209,7 @@ index 97f202c..109575f 100644
return mod;
}
return NULL;
-@@ -3812,11 +3959,20 @@ bool is_module_text_address(unsigned long addr)
+@@ -3800,11 +3947,20 @@ bool is_module_text_address(unsigned long addr)
*/
struct module *__module_text_address(unsigned long addr)
{
@@ -77275,10 +77282,28 @@ 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 52f2301..73f7528 100644
+index ad53a66..f1bf8bc 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
-@@ -199,7 +199,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
+@@ -134,7 +134,7 @@ void mspin_lock(struct mspin_node **lock, struct mspin_node *node)
+ node->locked = 1;
+ return;
+ }
+- ACCESS_ONCE(prev->next) = node;
++ ACCESS_ONCE_RW(prev->next) = node;
+ smp_wmb();
+ /* Wait until the lock holder passes the lock down */
+ while (!ACCESS_ONCE(node->locked))
+@@ -155,7 +155,7 @@ static void mspin_unlock(struct mspin_node **lock, struct mspin_node *node)
+ while (!(next = ACCESS_ONCE(node->next)))
+ arch_mutex_cpu_relax();
+ }
+- ACCESS_ONCE(next->locked) = 1;
++ ACCESS_ONCE_RW(next->locked) = 1;
+ smp_wmb();
+ }
+
+@@ -341,7 +341,7 @@ slowpath:
spin_lock_mutex(&lock->wait_lock, flags);
debug_mutex_lock_common(lock, &waiter);
@@ -77287,7 +77312,7 @@ index 52f2301..73f7528 100644
/* add waiting tasks to the end of the waitqueue (FIFO): */
list_add_tail(&waiter.list, &lock->wait_list);
-@@ -228,8 +228,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
+@@ -371,8 +371,7 @@ slowpath:
* TASK_UNINTERRUPTIBLE case.)
*/
if (unlikely(signal_pending_state(state, task))) {
@@ -77297,7 +77322,7 @@ index 52f2301..73f7528 100644
mutex_release(&lock->dep_map, 1, ip);
spin_unlock_mutex(&lock->wait_lock, flags);
-@@ -248,7 +247,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
+@@ -391,7 +390,7 @@ slowpath:
done:
lock_acquired(&lock->dep_map, ip);
/* got the lock - rejoice! */
@@ -77363,19 +77388,19 @@ index 2d5cc4c..d9ea600 100644
return -ENOENT;
}
diff --git a/kernel/panic.c b/kernel/panic.c
-index 7c57cc9..28f1b3f 100644
+index 167ec09..0dda5f9 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
-@@ -403,7 +403,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
- const char *board;
-
+@@ -400,7 +400,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
+ unsigned taint, struct slowpath_args *args)
+ {
printk(KERN_WARNING "------------[ cut here ]------------\n");
- printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
+ printk(KERN_WARNING "WARNING: at %s:%d %pA()\n", file, line, caller);
- board = dmi_get_system_info(DMI_PRODUCT_NAME);
- if (board)
- printk(KERN_WARNING "Hardware name: %s\n", board);
-@@ -459,7 +459,8 @@ EXPORT_SYMBOL(warn_slowpath_null);
+
+ if (args)
+ vprintk(args->fmt, args->args);
+@@ -453,7 +453,8 @@ EXPORT_SYMBOL(warn_slowpath_null);
*/
void __stack_chk_fail(void)
{
@@ -77386,7 +77411,7 @@ index 7c57cc9..28f1b3f 100644
}
EXPORT_SYMBOL(__stack_chk_fail);
diff --git a/kernel/pid.c b/kernel/pid.c
-index 047dc62..418d74b 100644
+index 0db3e79..95b9dc2 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -33,6 +33,7 @@
@@ -77397,7 +77422,7 @@ index 047dc62..418d74b 100644
#include <linux/pid_namespace.h>
#include <linux/init_task.h>
#include <linux/syscalls.h>
-@@ -46,7 +47,7 @@ struct pid init_struct_pid = INIT_STRUCT_PID;
+@@ -47,7 +48,7 @@ struct pid init_struct_pid = INIT_STRUCT_PID;
int pid_max = PID_MAX_DEFAULT;
@@ -77406,7 +77431,7 @@ index 047dc62..418d74b 100644
int pid_max_min = RESERVED_PIDS + 1;
int pid_max_max = PID_MAX_LIMIT;
-@@ -440,10 +441,18 @@ EXPORT_SYMBOL(pid_task);
+@@ -442,10 +443,18 @@ EXPORT_SYMBOL(pid_task);
*/
struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns)
{
@@ -77426,7 +77451,7 @@ index 047dc62..418d74b 100644
}
struct task_struct *find_task_by_vpid(pid_t vnr)
-@@ -451,6 +460,14 @@ struct task_struct *find_task_by_vpid(pid_t vnr)
+@@ -453,6 +462,14 @@ struct task_struct *find_task_by_vpid(pid_t vnr)
return find_task_by_pid_ns(vnr, task_active_pid_ns(current));
}
@@ -77442,10 +77467,10 @@ index 047dc62..418d74b 100644
{
struct pid *pid;
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
-index bea15bd..789f3d0 100644
+index 6917e8e..9909aeb 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
-@@ -249,7 +249,7 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int write,
+@@ -247,7 +247,7 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct pid_namespace *pid_ns = task_active_pid_ns(current);
@@ -77455,10 +77480,10 @@ index bea15bd..789f3d0 100644
if (write && !ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN))
return -EPERM;
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
-index 8fd709c..542bf4b 100644
+index 42670e9..8719c2f 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
-@@ -1592,14 +1592,14 @@ struct k_clock clock_posix_cpu = {
+@@ -1636,14 +1636,14 @@ struct k_clock clock_posix_cpu = {
static __init int init_posix_cpu_timers(void)
{
@@ -77476,18 +77501,18 @@ index 8fd709c..542bf4b 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 6edbb2c..334f085 100644
+index 424c2d4..a9194f7 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -43,6 +43,7 @@
- #include <linux/idr.h>
+ #include <linux/hash.h>
#include <linux/posix-clock.h>
#include <linux/posix-timers.h>
+#include <linux/grsecurity.h>
#include <linux/syscalls.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
-@@ -129,7 +130,7 @@ static DEFINE_SPINLOCK(idr_lock);
+@@ -122,7 +123,7 @@ static DEFINE_SPINLOCK(hash_lock);
* which we beg off on and pass to do_sys_settimeofday().
*/
@@ -77496,7 +77521,7 @@ index 6edbb2c..334f085 100644
/*
* These ones are defined below.
-@@ -227,7 +228,7 @@ static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp)
+@@ -275,7 +276,7 @@ static int posix_get_tai(clockid_t which_clock, struct timespec *tp)
*/
static __init int init_posix_timers(void)
{
@@ -77505,7 +77530,7 @@ index 6edbb2c..334f085 100644
.clock_getres = hrtimer_get_res,
.clock_get = posix_clock_realtime_get,
.clock_set = posix_clock_realtime_set,
-@@ -239,7 +240,7 @@ static __init int init_posix_timers(void)
+@@ -287,7 +288,7 @@ static __init int init_posix_timers(void)
.timer_get = common_timer_get,
.timer_del = common_timer_del,
};
@@ -77514,7 +77539,7 @@ index 6edbb2c..334f085 100644
.clock_getres = hrtimer_get_res,
.clock_get = posix_ktime_get_ts,
.nsleep = common_nsleep,
-@@ -249,19 +250,19 @@ static __init int init_posix_timers(void)
+@@ -297,19 +298,19 @@ static __init int init_posix_timers(void)
.timer_get = common_timer_get,
.timer_del = common_timer_del,
};
@@ -77533,12 +77558,21 @@ index 6edbb2c..334f085 100644
.clock_getres = posix_get_coarse_res,
.clock_get = posix_get_monotonic_coarse,
};
+- struct k_clock clock_tai = {
++ static struct k_clock clock_tai = {
+ .clock_getres = hrtimer_get_res,
+ .clock_get = posix_get_tai,
+ .nsleep = common_nsleep,
+@@ -319,7 +320,7 @@ static __init int init_posix_timers(void)
+ .timer_get = common_timer_get,
+ .timer_del = common_timer_del,
+ };
- struct k_clock clock_boottime = {
+ static struct k_clock clock_boottime = {
.clock_getres = hrtimer_get_res,
.clock_get = posix_get_boottime,
.nsleep = common_nsleep,
-@@ -473,7 +474,7 @@ void posix_timers_register_clock(const clockid_t clock_id,
+@@ -531,7 +532,7 @@ void posix_timers_register_clock(const clockid_t clock_id,
return;
}
@@ -77547,7 +77581,7 @@ index 6edbb2c..334f085 100644
}
EXPORT_SYMBOL_GPL(posix_timers_register_clock);
-@@ -519,9 +520,9 @@ static struct k_clock *clockid_to_kclock(const clockid_t id)
+@@ -577,9 +578,9 @@ static struct k_clock *clockid_to_kclock(const clockid_t id)
return (id & CLOCKFD_MASK) == CLOCKFD ?
&clock_posix_dynamic : &clock_posix_cpu;
@@ -77559,7 +77593,7 @@ index 6edbb2c..334f085 100644
}
static int common_timer_create(struct k_itimer *new_timer)
-@@ -964,6 +965,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
+@@ -1011,6 +1012,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
if (copy_from_user(&new_tp, tp, sizeof (*tp)))
return -EFAULT;
@@ -77617,10 +77651,10 @@ index 98088e0..aaf95c0 100644
if (pm_wakeup_pending()) {
diff --git a/kernel/printk.c b/kernel/printk.c
-index 0e4eba6a..d58ebf0 100644
+index 8212c1a..eb61021 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
-@@ -395,6 +395,11 @@ static int check_syslog_permissions(int type, bool from_file)
+@@ -390,6 +390,11 @@ static int check_syslog_permissions(int type, bool from_file)
if (from_file && type != SYSLOG_ACTION_OPEN)
return 0;
@@ -77633,7 +77667,7 @@ index 0e4eba6a..d58ebf0 100644
if (capable(CAP_SYSLOG))
return 0;
diff --git a/kernel/profile.c b/kernel/profile.c
-index dc3384e..0de5b49 100644
+index 0bf4007..6234708 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -37,7 +37,7 @@ struct profile_hit {
@@ -77694,10 +77728,10 @@ index dc3384e..0de5b49 100644
}
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index acbd284..00bb0c9 100644
+index 335a7ae..3bbbceb 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
-@@ -324,7 +324,7 @@ static int ptrace_attach(struct task_struct *task, long request,
+@@ -326,7 +326,7 @@ static int ptrace_attach(struct task_struct *task, long request,
if (seize)
flags |= PT_SEIZED;
rcu_read_lock();
@@ -77706,7 +77740,7 @@ index acbd284..00bb0c9 100644
flags |= PT_PTRACE_CAP;
rcu_read_unlock();
task->ptrace = flags;
-@@ -535,7 +535,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
+@@ -537,7 +537,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
break;
return -EIO;
}
@@ -77715,7 +77749,7 @@ index acbd284..00bb0c9 100644
return -EFAULT;
copied += retval;
src += retval;
-@@ -726,7 +726,7 @@ int ptrace_request(struct task_struct *child, long request,
+@@ -805,7 +805,7 @@ int ptrace_request(struct task_struct *child, long request,
bool seized = child->ptrace & PT_SEIZED;
int ret = -EIO;
siginfo_t siginfo, *si;
@@ -77724,7 +77758,7 @@ index acbd284..00bb0c9 100644
unsigned long __user *datalp = datavp;
unsigned long flags;
-@@ -928,14 +928,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
+@@ -1011,14 +1011,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
goto out;
}
@@ -77747,7 +77781,7 @@ index acbd284..00bb0c9 100644
goto out_put_task_struct;
}
-@@ -963,7 +970,7 @@ int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
+@@ -1046,7 +1053,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;
@@ -77756,7 +77790,7 @@ index acbd284..00bb0c9 100644
}
int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
-@@ -1057,7 +1064,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
+@@ -1140,7 +1147,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
}
asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
@@ -77765,7 +77799,7 @@ index acbd284..00bb0c9 100644
{
struct task_struct *child;
long ret;
-@@ -1073,14 +1080,21 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
+@@ -1156,14 +1163,21 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
goto out;
}