zconf.hash.c
+zconf.lex.c
zoffset.h
+diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
+index 764f599..c600e2f 100644
+--- a/Documentation/kbuild/makefiles.txt
++++ b/Documentation/kbuild/makefiles.txt
+@@ -23,10 +23,11 @@ This document describes the Linux kernel Makefiles.
+ === 4 Host Program support
+ --- 4.1 Simple Host Program
+ --- 4.2 Composite Host Programs
+- --- 4.3 Using C++ for host programs
+- --- 4.4 Controlling compiler options for host programs
+- --- 4.5 When host programs are actually built
+- --- 4.6 Using hostprogs-$(CONFIG_FOO)
++ --- 4.3 Defining shared libraries
++ --- 4.4 Using C++ for host programs
++ --- 4.5 Controlling compiler options for host programs
++ --- 4.6 When host programs are actually built
++ --- 4.7 Using hostprogs-$(CONFIG_FOO)
+
+ === 5 Kbuild clean infrastructure
+
+@@ -642,7 +643,29 @@ Both possibilities are described in the following.
+ Finally, the two .o files are linked to the executable, lxdialog.
+ Note: The syntax <executable>-y is not permitted for host-programs.
+
+---- 4.3 Using C++ for host programs
++--- 4.3 Defining shared libraries
++
++ Objects with extension .so are considered shared libraries, and
++ will be compiled as position independent objects.
++ Kbuild provides support for shared libraries, but the usage
++ shall be restricted.
++ In the following example the libkconfig.so shared library is used
++ to link the executable conf.
++
++ Example:
++ #scripts/kconfig/Makefile
++ hostprogs-y := conf
++ conf-objs := conf.o libkconfig.so
++ libkconfig-objs := expr.o type.o
++
++ Shared libraries always require a corresponding -objs line, and
++ in the example above the shared library libkconfig is composed by
++ the two objects expr.o and type.o.
++ expr.o and type.o will be built as position independent code and
++ linked as a shared library libkconfig.so. C++ is not supported for
++ shared libraries.
++
++--- 4.4 Using C++ for host programs
+
+ kbuild offers support for host programs written in C++. This was
+ introduced solely to support kconfig, and is not recommended
+@@ -665,7 +688,7 @@ Both possibilities are described in the following.
+ qconf-cxxobjs := qconf.o
+ qconf-objs := check.o
+
+---- 4.4 Controlling compiler options for host programs
++--- 4.5 Controlling compiler options for host programs
+
+ When compiling host programs, it is possible to set specific flags.
+ The programs will always be compiled utilising $(HOSTCC) passed
+@@ -693,7 +716,7 @@ Both possibilities are described in the following.
+ When linking qconf, it will be passed the extra option
+ "-L$(QTDIR)/lib".
+
+---- 4.5 When host programs are actually built
++--- 4.6 When host programs are actually built
+
+ Kbuild will only build host-programs when they are referenced
+ as a prerequisite.
+@@ -724,7 +747,7 @@ Both possibilities are described in the following.
+ This will tell kbuild to build lxdialog even if not referenced in
+ any rule.
+
+---- 4.6 Using hostprogs-$(CONFIG_FOO)
++--- 4.7 Using hostprogs-$(CONFIG_FOO)
+
+ A typical pattern in a Kbuild file looks like this:
+
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index b7fa2f5..90cd9f8 100644
+index 1edd5fd..84fd32e 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
-@@ -1138,6 +1138,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -1155,6 +1155,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0.
Default: 1024
hashdist= [KNL,NUMA] Large hashes allocated during boot
are distributed across NUMA nodes. Defaults on
for 64-bit NUMA, off otherwise.
-@@ -2141,6 +2145,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -2175,6 +2179,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
noexec=on: enable non-executable mappings (default)
noexec=off: disable non-executable mappings
nosmap [X86]
Disable SMAP (Supervisor Mode Access Prevention)
even if it is supported by processor.
-@@ -2418,6 +2426,25 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -2467,6 +2475,25 @@ 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.
pcbit= [HW,ISDN]
pcd. [PARIDE]
-diff --git a/Documentation/networking/filter.txt b/Documentation/networking/filter.txt
-index ee78eba..a06b48d 100644
---- a/Documentation/networking/filter.txt
-+++ b/Documentation/networking/filter.txt
-@@ -277,11 +277,10 @@ Possible BPF extensions are shown in the following table:
- mark skb->mark
- queue skb->queue_mapping
- hatype skb->dev->type
-- rxhash skb->hash
-+ rxhash skb->rxhash
- cpu raw_smp_processor_id()
- vlan_tci vlan_tx_tag_get(skb)
- vlan_pr vlan_tx_tag_present(skb)
-- rand prandom_u32()
-
- These extensions can also be prefixed with '#'.
- Examples for low-level BPF:
-@@ -309,18 +308,6 @@ Examples for low-level BPF:
- ret #-1
- drop: ret #0
-
--** icmp random packet sampling, 1 in 4
-- ldh [12]
-- jne #0x800, drop
-- ldb [23]
-- jneq #1, drop
-- # get a random uint32 number
-- ld rand
-- mod #4
-- jneq #1, drop
-- ret #-1
-- drop: ret #0
--
- ** SECCOMP filter example:
-
- ld [4] /* offsetof(struct seccomp_data, arch) */
-@@ -559,456 +546,6 @@ ffffffffa0069c8f + <x>:
- For BPF JIT developers, bpf_jit_disasm, bpf_asm and bpf_dbg provides a useful
- toolchain for developing and testing the kernel's JIT compiler.
-
--BPF kernel internals
----------------------
--Internally, for the kernel interpreter, a different instruction set
--format with similar underlying principles from BPF described in previous
--paragraphs is being used. However, the instruction set format is modelled
--closer to the underlying architecture to mimic native instruction sets, so
--that a better performance can be achieved (more details later). This new
--ISA is called 'eBPF' or 'internal BPF' interchangeably. (Note: eBPF which
--originates from [e]xtended BPF is not the same as BPF extensions! While
--eBPF is an ISA, BPF extensions date back to classic BPF's 'overloading'
--of BPF_LD | BPF_{B,H,W} | BPF_ABS instruction.)
--
--It is designed to be JITed with one to one mapping, which can also open up
--the possibility for GCC/LLVM compilers to generate optimized eBPF code through
--an eBPF backend that performs almost as fast as natively compiled code.
--
--The new instruction set was originally designed with the possible goal in
--mind to write programs in "restricted C" and compile into eBPF with a optional
--GCC/LLVM backend, so that it can just-in-time map to modern 64-bit CPUs with
--minimal performance overhead over two steps, that is, C -> eBPF -> native code.
--
--Currently, the new format is being used for running user BPF programs, which
--includes seccomp BPF, classic socket filters, cls_bpf traffic classifier,
--team driver's classifier for its load-balancing mode, netfilter's xt_bpf
--extension, PTP dissector/classifier, and much more. They are all internally
--converted by the kernel into the new instruction set representation and run
--in the eBPF interpreter. For in-kernel handlers, this all works transparently
--by using sk_unattached_filter_create() for setting up the filter, resp.
--sk_unattached_filter_destroy() for destroying it. The macro
--SK_RUN_FILTER(filter, ctx) transparently invokes eBPF interpreter or JITed
--code to run the filter. 'filter' is a pointer to struct sk_filter that we
--got from sk_unattached_filter_create(), and 'ctx' the given context (e.g.
--skb pointer). All constraints and restrictions from sk_chk_filter() apply
--before a conversion to the new layout is being done behind the scenes!
--
--Currently, the classic BPF format is being used for JITing on most of the
--architectures. Only x86-64 performs JIT compilation from eBPF instruction set,
--however, future work will migrate other JIT compilers as well, so that they
--will profit from the very same benefits.
--
--Some core changes of the new internal format:
--
--- Number of registers increase from 2 to 10:
--
-- The old format had two registers A and X, and a hidden frame pointer. The
-- new layout extends this to be 10 internal registers and a read-only frame
-- pointer. Since 64-bit CPUs are passing arguments to functions via registers
-- the number of args from eBPF program to in-kernel function is restricted
-- to 5 and one register is used to accept return value from an in-kernel
-- function. Natively, x86_64 passes first 6 arguments in registers, aarch64/
-- sparcv9/mips64 have 7 - 8 registers for arguments; x86_64 has 6 callee saved
-- registers, and aarch64/sparcv9/mips64 have 11 or more callee saved registers.
--
-- Therefore, eBPF calling convention is defined as:
--
-- * R0 - return value from in-kernel function, and exit value for eBPF program
-- * R1 - R5 - arguments from eBPF program to in-kernel function
-- * R6 - R9 - callee saved registers that in-kernel function will preserve
-- * R10 - read-only frame pointer to access stack
--
-- Thus, all eBPF registers map one to one to HW registers on x86_64, aarch64,
-- etc, and eBPF calling convention maps directly to ABIs used by the kernel on
-- 64-bit architectures.
--
-- On 32-bit architectures JIT may map programs that use only 32-bit arithmetic
-- and may let more complex programs to be interpreted.
--
-- R0 - R5 are scratch registers and eBPF program needs spill/fill them if
-- necessary across calls. Note that there is only one eBPF program (== one
-- eBPF main routine) and it cannot call other eBPF functions, it can only
-- call predefined in-kernel functions, though.
--
--- Register width increases from 32-bit to 64-bit:
--
-- Still, the semantics of the original 32-bit ALU operations are preserved
-- via 32-bit subregisters. All eBPF registers are 64-bit with 32-bit lower
-- subregisters that zero-extend into 64-bit if they are being written to.
-- That behavior maps directly to x86_64 and arm64 subregister definition, but
-- makes other JITs more difficult.
--
-- 32-bit architectures run 64-bit internal BPF programs via interpreter.
-- Their JITs may convert BPF programs that only use 32-bit subregisters into
-- native instruction set and let the rest being interpreted.
--
-- Operation is 64-bit, because on 64-bit architectures, pointers are also
-- 64-bit wide, and we want to pass 64-bit values in/out of kernel functions,
-- so 32-bit eBPF registers would otherwise require to define register-pair
-- ABI, thus, there won't be able to use a direct eBPF register to HW register
-- mapping and JIT would need to do combine/split/move operations for every
-- register in and out of the function, which is complex, bug prone and slow.
-- Another reason is the use of atomic 64-bit counters.
--
--- Conditional jt/jf targets replaced with jt/fall-through:
--
-- While the original design has constructs such as "if (cond) jump_true;
-- else jump_false;", they are being replaced into alternative constructs like
-- "if (cond) jump_true; /* else fall-through */".
--
--- Introduces bpf_call insn and register passing convention for zero overhead
-- calls from/to other kernel functions:
--
-- Before an in-kernel function call, the internal BPF program needs to
-- place function arguments into R1 to R5 registers to satisfy calling
-- convention, then the interpreter will take them from registers and pass
-- to in-kernel function. If R1 - R5 registers are mapped to CPU registers
-- that are used for argument passing on given architecture, the JIT compiler
-- doesn't need to emit extra moves. Function arguments will be in the correct
-- registers and BPF_CALL instruction will be JITed as single 'call' HW
-- instruction. This calling convention was picked to cover common call
-- situations without performance penalty.
--
-- After an in-kernel function call, R1 - R5 are reset to unreadable and R0 has
-- a return value of the function. Since R6 - R9 are callee saved, their state
-- is preserved across the call.
--
-- For example, consider three C functions:
--
-- u64 f1() { return (*_f2)(1); }
-- u64 f2(u64 a) { return f3(a + 1, a); }
-- u64 f3(u64 a, u64 b) { return a - b; }
--
-- GCC can compile f1, f3 into x86_64:
--
-- f1:
-- movl $1, %edi
-- movq _f2(%rip), %rax
-- jmp *%rax
-- f3:
-- movq %rdi, %rax
-- subq %rsi, %rax
-- ret
--
-- Function f2 in eBPF may look like:
--
-- f2:
-- bpf_mov R2, R1
-- bpf_add R1, 1
-- bpf_call f3
-- bpf_exit
--
-- If f2 is JITed and the pointer stored to '_f2'. The calls f1 -> f2 -> f3 and
-- returns will be seamless. Without JIT, __sk_run_filter() interpreter needs to
-- be used to call into f2.
--
-- For practical reasons all eBPF programs have only one argument 'ctx' which is
-- already placed into R1 (e.g. on __sk_run_filter() startup) and the programs
-- can call kernel functions with up to 5 arguments. Calls with 6 or more arguments
-- are currently not supported, but these restrictions can be lifted if necessary
-- in the future.
--
-- On 64-bit architectures all register map to HW registers one to one. For
-- example, x86_64 JIT compiler can map them as ...
--
-- R0 - rax
-- R1 - rdi
-- R2 - rsi
-- R3 - rdx
-- R4 - rcx
-- R5 - r8
-- R6 - rbx
-- R7 - r13
-- R8 - r14
-- R9 - r15
-- R10 - rbp
--
-- ... since x86_64 ABI mandates rdi, rsi, rdx, rcx, r8, r9 for argument passing
-- and rbx, r12 - r15 are callee saved.
--
-- Then the following internal BPF pseudo-program:
--
-- bpf_mov R6, R1 /* save ctx */
-- bpf_mov R2, 2
-- bpf_mov R3, 3
-- bpf_mov R4, 4
-- bpf_mov R5, 5
-- bpf_call foo
-- bpf_mov R7, R0 /* save foo() return value */
-- bpf_mov R1, R6 /* restore ctx for next call */
-- bpf_mov R2, 6
-- bpf_mov R3, 7
-- bpf_mov R4, 8
-- bpf_mov R5, 9
-- bpf_call bar
-- bpf_add R0, R7
-- bpf_exit
--
-- After JIT to x86_64 may look like:
--
-- push %rbp
-- mov %rsp,%rbp
-- sub $0x228,%rsp
-- mov %rbx,-0x228(%rbp)
-- mov %r13,-0x220(%rbp)
-- mov %rdi,%rbx
-- mov $0x2,%esi
-- mov $0x3,%edx
-- mov $0x4,%ecx
-- mov $0x5,%r8d
-- callq foo
-- mov %rax,%r13
-- mov %rbx,%rdi
-- mov $0x2,%esi
-- mov $0x3,%edx
-- mov $0x4,%ecx
-- mov $0x5,%r8d
-- callq bar
-- add %r13,%rax
-- mov -0x228(%rbp),%rbx
-- mov -0x220(%rbp),%r13
-- leaveq
-- retq
--
-- Which is in this example equivalent in C to:
--
-- u64 bpf_filter(u64 ctx)
-- {
-- return foo(ctx, 2, 3, 4, 5) + bar(ctx, 6, 7, 8, 9);
-- }
--
-- In-kernel functions foo() and bar() with prototype: u64 (*)(u64 arg1, u64
-- arg2, u64 arg3, u64 arg4, u64 arg5); will receive arguments in proper
-- registers and place their return value into '%rax' which is R0 in eBPF.
-- Prologue and epilogue are emitted by JIT and are implicit in the
-- interpreter. R0-R5 are scratch registers, so eBPF program needs to preserve
-- them across the calls as defined by calling convention.
--
-- For example the following program is invalid:
--
-- bpf_mov R1, 1
-- bpf_call foo
-- bpf_mov R0, R1
-- bpf_exit
--
-- After the call the registers R1-R5 contain junk values and cannot be read.
-- In the future an eBPF verifier can be used to validate internal BPF programs.
--
--Also in the new design, eBPF is limited to 4096 insns, which means that any
--program will terminate quickly and will only call a fixed number of kernel
--functions. Original BPF and the new format are two operand instructions,
--which helps to do one-to-one mapping between eBPF insn and x86 insn during JIT.
--
--The input context pointer for invoking the interpreter function is generic,
--its content is defined by a specific use case. For seccomp register R1 points
--to seccomp_data, for converted BPF filters R1 points to a skb.
--
--A program, that is translated internally consists of the following elements:
--
-- op:16, jt:8, jf:8, k:32 ==> op:8, dst_reg:4, src_reg:4, off:16, imm:32
--
--So far 87 internal BPF instructions were implemented. 8-bit 'op' opcode field
--has room for new instructions. Some of them may use 16/24/32 byte encoding. New
--instructions must be multiple of 8 bytes to preserve backward compatibility.
--
--Internal BPF is a general purpose RISC instruction set. Not every register and
--every instruction are used during translation from original BPF to new format.
--For example, socket filters are not using 'exclusive add' instruction, but
--tracing filters may do to maintain counters of events, for example. Register R9
--is not used by socket filters either, but more complex filters may be running
--out of registers and would have to resort to spill/fill to stack.
--
--Internal BPF can used as generic assembler for last step performance
--optimizations, socket filters and seccomp are using it as assembler. Tracing
--filters may use it as assembler to generate code from kernel. In kernel usage
--may not be bounded by security considerations, since generated internal BPF code
--may be optimizing internal code path and not being exposed to the user space.
--Safety of internal BPF can come from a verifier (TBD). In such use cases as
--described, it may be used as safe instruction set.
--
--Just like the original BPF, the new format runs within a controlled environment,
--is deterministic and the kernel can easily prove that. The safety of the program
--can be determined in two steps: first step does depth-first-search to disallow
--loops and other CFG validation; second step starts from the first insn and
--descends all possible paths. It simulates execution of every insn and observes
--the state change of registers and stack.
--
--eBPF opcode encoding
----------------------
--
--eBPF is reusing most of the opcode encoding from classic to simplify conversion
--of classic BPF to eBPF. For arithmetic and jump instructions the 8-bit 'code'
--field is divided into three parts:
--
-- +----------------+--------+--------------------+
-- | 4 bits | 1 bit | 3 bits |
-- | operation code | source | instruction class |
-- +----------------+--------+--------------------+
-- (MSB) (LSB)
--
--Three LSB bits store instruction class which is one of:
--
-- Classic BPF classes: eBPF classes:
--
-- BPF_LD 0x00 BPF_LD 0x00
-- BPF_LDX 0x01 BPF_LDX 0x01
-- BPF_ST 0x02 BPF_ST 0x02
-- BPF_STX 0x03 BPF_STX 0x03
-- BPF_ALU 0x04 BPF_ALU 0x04
-- BPF_JMP 0x05 BPF_JMP 0x05
-- BPF_RET 0x06 [ class 6 unused, for future if needed ]
-- BPF_MISC 0x07 BPF_ALU64 0x07
--
--When BPF_CLASS(code) == BPF_ALU or BPF_JMP, 4th bit encodes source operand ...
--
-- BPF_K 0x00
-- BPF_X 0x08
--
-- * in classic BPF, this means:
--
-- BPF_SRC(code) == BPF_X - use register X as source operand
-- BPF_SRC(code) == BPF_K - use 32-bit immediate as source operand
--
-- * in eBPF, this means:
--
-- BPF_SRC(code) == BPF_X - use 'src_reg' register as source operand
-- BPF_SRC(code) == BPF_K - use 32-bit immediate as source operand
--
--... and four MSB bits store operation code.
--
--If BPF_CLASS(code) == BPF_ALU or BPF_ALU64 [ in eBPF ], BPF_OP(code) is one of:
--
-- BPF_ADD 0x00
-- BPF_SUB 0x10
-- BPF_MUL 0x20
-- BPF_DIV 0x30
-- BPF_OR 0x40
-- BPF_AND 0x50
-- BPF_LSH 0x60
-- BPF_RSH 0x70
-- BPF_NEG 0x80
-- BPF_MOD 0x90
-- BPF_XOR 0xa0
-- BPF_MOV 0xb0 /* eBPF only: mov reg to reg */
-- BPF_ARSH 0xc0 /* eBPF only: sign extending shift right */
-- BPF_END 0xd0 /* eBPF only: endianness conversion */
--
--If BPF_CLASS(code) == BPF_JMP, BPF_OP(code) is one of:
--
-- BPF_JA 0x00
-- BPF_JEQ 0x10
-- BPF_JGT 0x20
-- BPF_JGE 0x30
-- BPF_JSET 0x40
-- BPF_JNE 0x50 /* eBPF only: jump != */
-- BPF_JSGT 0x60 /* eBPF only: signed '>' */
-- BPF_JSGE 0x70 /* eBPF only: signed '>=' */
-- BPF_CALL 0x80 /* eBPF only: function call */
-- BPF_EXIT 0x90 /* eBPF only: function return */
--
--So BPF_ADD | BPF_X | BPF_ALU means 32-bit addition in both classic BPF
--and eBPF. There are only two registers in classic BPF, so it means A += X.
--In eBPF it means dst_reg = (u32) dst_reg + (u32) src_reg; similarly,
--BPF_XOR | BPF_K | BPF_ALU means A ^= imm32 in classic BPF and analogous
--src_reg = (u32) src_reg ^ (u32) imm32 in eBPF.
--
--Classic BPF is using BPF_MISC class to represent A = X and X = A moves.
--eBPF is using BPF_MOV | BPF_X | BPF_ALU code instead. Since there are no
--BPF_MISC operations in eBPF, the class 7 is used as BPF_ALU64 to mean
--exactly the same operations as BPF_ALU, but with 64-bit wide operands
--instead. So BPF_ADD | BPF_X | BPF_ALU64 means 64-bit addition, i.e.:
--dst_reg = dst_reg + src_reg
--
--Classic BPF wastes the whole BPF_RET class to represent a single 'ret'
--operation. Classic BPF_RET | BPF_K means copy imm32 into return register
--and perform function exit. eBPF is modeled to match CPU, so BPF_JMP | BPF_EXIT
--in eBPF means function exit only. The eBPF program needs to store return
--value into register R0 before doing a BPF_EXIT. Class 6 in eBPF is currently
--unused and reserved for future use.
--
--For load and store instructions the 8-bit 'code' field is divided as:
--
-- +--------+--------+-------------------+
-- | 3 bits | 2 bits | 3 bits |
-- | mode | size | instruction class |
-- +--------+--------+-------------------+
-- (MSB) (LSB)
--
--Size modifier is one of ...
--
-- BPF_W 0x00 /* word */
-- BPF_H 0x08 /* half word */
-- BPF_B 0x10 /* byte */
-- BPF_DW 0x18 /* eBPF only, double word */
--
--... which encodes size of load/store operation:
--
-- B - 1 byte
-- H - 2 byte
-- W - 4 byte
-- DW - 8 byte (eBPF only)
--
--Mode modifier is one of:
--
-- BPF_IMM 0x00 /* classic BPF only, reserved in eBPF */
-- BPF_ABS 0x20
-- BPF_IND 0x40
-- BPF_MEM 0x60
-- BPF_LEN 0x80 /* classic BPF only, reserved in eBPF */
-- BPF_MSH 0xa0 /* classic BPF only, reserved in eBPF */
-- BPF_XADD 0xc0 /* eBPF only, exclusive add */
--
--eBPF has two non-generic instructions: (BPF_ABS | <size> | BPF_LD) and
--(BPF_IND | <size> | BPF_LD) which are used to access packet data.
--
--They had to be carried over from classic to have strong performance of
--socket filters running in eBPF interpreter. These instructions can only
--be used when interpreter context is a pointer to 'struct sk_buff' and
--have seven implicit operands. Register R6 is an implicit input that must
--contain pointer to sk_buff. Register R0 is an implicit output which contains
--the data fetched from the packet. Registers R1-R5 are scratch registers
--and must not be used to store the data across BPF_ABS | BPF_LD or
--BPF_IND | BPF_LD instructions.
--
--These instructions have implicit program exit condition as well. When
--eBPF program is trying to access the data beyond the packet boundary,
--the interpreter will abort the execution of the program. JIT compilers
--therefore must preserve this property. src_reg and imm32 fields are
--explicit inputs to these instructions.
--
--For example:
--
-- BPF_IND | BPF_W | BPF_LD means:
--
-- R0 = ntohl(*(u32 *) (((struct sk_buff *) R6)->data + src_reg + imm32))
-- and R1 - R5 were scratched.
--
--Unlike classic BPF instruction set, eBPF has generic load/store operations:
--
--BPF_MEM | <size> | BPF_STX: *(size *) (dst_reg + off) = src_reg
--BPF_MEM | <size> | BPF_ST: *(size *) (dst_reg + off) = imm32
--BPF_MEM | <size> | BPF_LDX: dst_reg = *(size *) (src_reg + off)
--BPF_XADD | BPF_W | BPF_STX: lock xadd *(u32 *)(dst_reg + off16) += src_reg
--BPF_XADD | BPF_DW | BPF_STX: lock xadd *(u64 *)(dst_reg + off16) += src_reg
--
--Where size is one of: BPF_B or BPF_H or BPF_W or BPF_DW. Note that 1 and
--2 byte atomic increments are not supported.
--
--Testing
---------
--
--Next to the BPF toolchain, the kernel also ships a test module that contains
--various test cases for classic and internal BPF that can be executed against
--the BPF interpreter and JIT compiler. It can be found in lib/test_bpf.c and
--enabled via Kconfig:
--
-- CONFIG_TEST_BPF=m
--
--After the module has been built and installed, the test suite can be executed
--via insmod or modprobe against 'test_bpf' module. Results of the test cases
--including timings in nsec can be found in the kernel log (dmesg).
--
- Misc
- ----
-
-@@ -1024,4 +561,3 @@ the underlying architecture.
-
- Jay Schulist <jschlst@samba.org>
- Daniel Borkmann <dborkman@redhat.com>
--Alexei Starovoitov <ast@plumgrid.com>
diff --git a/Makefile b/Makefile
-index c261752..7b9958b 100644
+index 4669409..95d8745 100644
--- a/Makefile
+++ b/Makefile
@@ -303,8 +303,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
-@@ -449,8 +450,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
+@@ -450,8 +451,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
# Rules shared between *config targets and build targets
# Basic helpers built in scripts/
$(Q)$(MAKE) $(build)=scripts/basic
$(Q)rm -f .tmp_quiet_recordmcount
-@@ -621,6 +622,75 @@ else
- KBUILD_CFLAGS += -O2
- endif
+@@ -625,6 +626,72 @@ endif
+ # Tell gcc to never replace conditional load with a non-conditional one
+ KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
-+# Tell gcc to never replace conditional load with a non-conditional one
-+KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
-+
+ifndef DISABLE_PAX_PLUGINS
+ifeq ($(call cc-ifversion, -ge, 0408, y), y)
+PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCXX)" "$(HOSTCXX)" "$(CC)")
ifdef CONFIG_READABLE_ASM
# Disable optimizations that make assembler listings hard to read.
# reorder blocks reorders the control in the function
-@@ -839,7 +909,7 @@ export mod_sign_cmd
+@@ -717,7 +784,7 @@ KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
+ else
+ KBUILD_CFLAGS += -g
+ endif
+-KBUILD_AFLAGS += -Wa,-gdwarf-2
++KBUILD_AFLAGS += -Wa,--gdwarf-2
+ endif
+ ifdef CONFIG_DEBUG_INFO_DWARF4
+ KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
+@@ -867,7 +934,7 @@ export mod_sign_cmd
ifeq ($(KBUILD_EXTMOD),)
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-@@ -888,6 +958,8 @@ endif
+@@ -916,6 +983,8 @@ endif
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
$(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Handle descending into subdirectories listed in $(vmlinux-dirs)
-@@ -897,7 +969,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
+@@ -925,7 +994,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Error messages still appears in the original language
PHONY += $(vmlinux-dirs)
$(Q)$(MAKE) $(build)=$@
define filechk_kernel.release
-@@ -940,10 +1012,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
+@@ -968,10 +1037,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
archprepare: archheaders archscripts prepare1 scripts_basic
prepare: prepare0
# Generate some files
-@@ -1051,6 +1126,8 @@ all: modules
+@@ -1086,6 +1158,8 @@ all: modules
# using awk while concatenating to the final file.
PHONY += modules
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.';
-@@ -1066,7 +1143,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+@@ -1101,7 +1175,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
# Target to prepare building external modules
PHONY += modules_prepare
# Target to install modules
PHONY += modules_install
-@@ -1132,7 +1209,10 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
+@@ -1167,7 +1241,10 @@ 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 \
# clean - Delete most, but leave enough to build external modules
#
-@@ -1171,7 +1251,7 @@ distclean: mrproper
+@@ -1206,7 +1283,7 @@ distclean: mrproper
@find $(srctree) $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-type f -print | xargs rm -f
-@@ -1332,6 +1412,8 @@ PHONY += $(module-dirs) modules
+@@ -1372,6 +1449,8 @@ PHONY += $(module-dirs) modules
$(module-dirs): crmodverdir $(objtree)/Module.symvers
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
modules: $(module-dirs)
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1471,17 +1553,21 @@ else
+@@ -1512,17 +1591,21 @@ else
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.symtypes: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-@@ -1491,11 +1577,15 @@ endif
+@@ -1532,11 +1615,15 @@ endif
$(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir)
} else if (!cause) {
/* Allow reads even for write-only mappings */
if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
+diff --git a/arch/arc/kernel/kgdb.c b/arch/arc/kernel/kgdb.c
+index a2ff5c5..ecf6a78 100644
+--- a/arch/arc/kernel/kgdb.c
++++ b/arch/arc/kernel/kgdb.c
+@@ -158,11 +158,6 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
+ return -1;
+ }
+
+-unsigned long kgdb_arch_pc(int exception, struct pt_regs *regs)
+-{
+- return instruction_pointer(regs);
+-}
+-
+ int kgdb_arch_init(void)
+ {
+ single_step_data.armed = 0;
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 290f02ee..a639059 100644
+index 32cbbd5..c102df9 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -1787,7 +1787,7 @@ config ALIGNMENT_TRAP
+@@ -1719,7 +1719,7 @@ config ALIGNMENT_TRAP
config UACCESS_WITH_MEMCPY
bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()"
default y if CPU_FEROCEON
help
Implement faster copy_to_user and clear_user methods for CPU
-@@ -2051,6 +2051,7 @@ config XIP_PHYS_ADDR
+@@ -1983,6 +1983,7 @@ config XIP_PHYS_ADDR
config KEXEC
bool "Kexec system call (EXPERIMENTAL)"
depends on (!SMP || PM_SLEEP_SMP)
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
-index 3040359..89b3dfc 100644
+index 3040359..cf3bab0 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -18,17 +18,35 @@
" sbc %R0, %R0, %R4\n"
" strexd %1, %0, %H0, [%3]\n"
" teq %1, #0\n"
-@@ -371,16 +731,29 @@ static inline long long atomic64_sub_return(long long i, atomic64_t *v)
+@@ -371,10 +731,25 @@ static inline long long atomic64_sub_return(long long i, atomic64_t *v)
__asm__ __volatile__("@ atomic64_sub_return\n"
"1: ldrexd %0, %H0, [%3]\n"
" subs %Q0, %Q0, %Q4\n"
: "=&r" (result), "=&r" (tmp), "+Qo" (v->counter)
: "r" (&v->counter), "r" (i)
: "cc");
-
-- smp_mb();
--
- return result;
- }
-
-@@ -410,6 +783,31 @@ static inline long long atomic64_cmpxchg(atomic64_t *ptr, long long old,
+@@ -410,6 +785,31 @@ static inline long long atomic64_cmpxchg(atomic64_t *ptr, long long old,
return oldval;
}
static inline long long atomic64_xchg(atomic64_t *ptr, long long new)
{
long long result;
-@@ -435,21 +833,35 @@ static inline long long atomic64_xchg(atomic64_t *ptr, long long new)
+@@ -435,21 +835,35 @@ static inline long long atomic64_xchg(atomic64_t *ptr, long long new)
static inline long long atomic64_dec_if_positive(atomic64_t *v)
{
long long result;
: "=&r" (result), "=&r" (tmp), "+Qo" (v->counter)
: "r" (&v->counter)
: "cc");
-@@ -473,13 +885,25 @@ static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u)
+@@ -473,13 +887,25 @@ static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u)
" teq %0, %5\n"
" teqeq %H0, %H5\n"
" moveq %1, #0\n"
: "=&r" (val), "+r" (ret), "=&r" (tmp), "+Qo" (v->counter)
: "r" (&v->counter), "r" (u), "r" (a)
: "cc");
-@@ -492,10 +916,13 @@ static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u)
+@@ -492,10 +918,13 @@ static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u)
#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
#define atomic64_inc(v) atomic64_add(1LL, (v))
#endif
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
-index fd43f7f..a817f5a 100644
+index 10e78d0..dc8505d 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -116,7 +116,7 @@ struct cpu_cache_fns {
static inline void set_domain(unsigned val) { }
static inline void modify_domain(unsigned dom, unsigned type) { }
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
-index f4b46d3..abc9b2b 100644
+index afb9caf..9a0bac0 100644
--- a/arch/arm/include/asm/elf.h
+++ b/arch/arm/include/asm/elf.h
-@@ -114,7 +114,14 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
+@@ -115,7 +115,14 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
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. */
/* When the program starts, a1 contains a pointer to a function to be
registered with atexit, as per the SVR4 ABI. A value of 0 means we
-@@ -124,10 +131,6 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
+@@ -125,10 +132,6 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
extern void elf_set_personality(const struct elf32_hdr *);
#define SET_PERSONALITY(ex) elf_set_personality(&(ex))
* These are the memory types, defined to be compatible with
* pre-ARMv6 CPUs cacheable and bufferable bits: XXCB
diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h
-index 626989f..9d67a33 100644
+index 9fd61c7..f8f1cff 100644
--- a/arch/arm/include/asm/pgtable-3level-hwdef.h
+++ b/arch/arm/include/asm/pgtable-3level-hwdef.h
-@@ -75,6 +75,7 @@
+@@ -76,6 +76,7 @@
#define PTE_EXT_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */
#define PTE_EXT_AF (_AT(pteval_t, 1) << 10) /* Access Flag */
#define PTE_EXT_NG (_AT(pteval_t, 1) << 11) /* nG */
/*
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
-index 85c60ad..b0bbd7e 100644
+index 06e0bc0..e60c2d3 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
-@@ -82,6 +82,7 @@
- #define L_PTE_RDONLY (_AT(pteval_t, 1) << 7) /* AP[2] */
+@@ -81,6 +81,7 @@
+ #define L_PTE_USER (_AT(pteval_t, 1) << 6) /* AP[1] */
#define L_PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */
#define L_PTE_YOUNG (_AT(pteval_t, 1) << 10) /* AF */
+#define L_PTE_PXN (_AT(pteval_t, 1) << 53) /* PXN */
#define L_PTE_XN (_AT(pteval_t, 1) << 54) /* XN */
- #define L_PTE_DIRTY (_AT(pteval_t, 1) << 55) /* unused */
- #define L_PTE_SPECIAL (_AT(pteval_t, 1) << 56) /* unused */
-@@ -95,6 +96,7 @@
+ #define L_PTE_DIRTY (_AT(pteval_t, 1) << 55)
+ #define L_PTE_SPECIAL (_AT(pteval_t, 1) << 56)
+@@ -96,6 +97,7 @@
/*
* To be used in assembly code with the upper page attributes.
*/
#define L_PTE_DIRTY_HIGH (1 << (55 - 32))
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
-index 5478e5d..f5b5cb3 100644
+index 01baef0..73c156e 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -33,6 +33,9 @@
*/
#define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG
-@@ -265,7 +313,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
+@@ -269,7 +317,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{
const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER |
struct of_cpu_method {
const char *method;
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
-index e4e4208..086684a 100644
+index fc44d37..acc63c4 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
-@@ -88,9 +88,9 @@ struct thread_info {
+@@ -89,9 +89,9 @@ struct thread_info {
.flags = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
.addr_limit = KERNEL_DS, \
.restart_block = { \
.fn = do_no_restart_syscall, \
}, \
-@@ -164,7 +164,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
+@@ -165,7 +165,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_USING_IWMMXT 17
#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
#define TIF_RESTORE_SIGMASK 20
-@@ -178,10 +182,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
+@@ -179,10 +183,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)
/*
* Change these and you break ASM code in entry-common.S
+diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
+index 5f833f7..76e6644 100644
+--- a/arch/arm/include/asm/tls.h
++++ b/arch/arm/include/asm/tls.h
+@@ -3,6 +3,7 @@
+
+ #include <linux/compiler.h>
+ #include <asm/thread_info.h>
++#include <asm/pgtable.h>
+
+ #ifdef __ASSEMBLY__
+ #include <asm/asm-offsets.h>
+@@ -89,7 +90,9 @@ static inline void set_tls(unsigned long val)
+ * at 0xffff0fe0 must be used instead. (see
+ * entry-armv.S for details)
+ */
++ pax_open_kernel();
+ *((unsigned int *)0xffff0ff0) = val;
++ pax_close_kernel();
+ #endif
+ }
+
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
-index 75d9579..b5b40e4 100644
+index 4767eb9..bf00668 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -18,6 +18,7 @@
#define __addr_ok(addr) ({ \
unsigned long flag; \
__asm__("cmp %2, %0; movlo %0, #0" \
-@@ -150,8 +178,12 @@ extern int __get_user_4(void *);
+@@ -198,8 +226,12 @@ extern int __get_user_64t_4(void *);
#define get_user(x,p) \
({ \
})
extern int __put_user_1(void *, unsigned int);
-@@ -196,8 +228,12 @@ extern int __put_user_8(void *, unsigned long long);
+@@ -244,8 +276,12 @@ extern int __put_user_8(void *, unsigned long long);
#define put_user(x,p) \
({ \
})
#else /* CONFIG_MMU */
-@@ -221,6 +257,7 @@ static inline void set_fs(mm_segment_t fs)
+@@ -269,6 +305,7 @@ static inline void set_fs(mm_segment_t fs)
#endif /* CONFIG_MMU */
#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
#define user_addr_max() \
-@@ -238,13 +275,17 @@ static inline void set_fs(mm_segment_t fs)
+@@ -286,13 +323,17 @@ static inline void set_fs(mm_segment_t fs)
#define __get_user(x,ptr) \
({ \
long __gu_err = 0; \
(void) 0; \
})
-@@ -320,13 +361,17 @@ do { \
+@@ -368,13 +409,17 @@ do { \
#define __put_user(x,ptr) \
({ \
long __pu_err = 0; \
(void) 0; \
})
-@@ -426,11 +471,44 @@ do { \
+@@ -474,11 +519,44 @@ do { \
#ifdef CONFIG_MMU
#else
#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0)
#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0)
-@@ -439,6 +517,9 @@ extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned l
+@@ -487,6 +565,9 @@ extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned l
static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)
{
if (access_ok(VERIFY_READ, from, n))
n = __copy_from_user(to, from, n);
else /* security hole - plug it */
-@@ -448,6 +529,9 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u
+@@ -496,6 +577,9 @@ static inline unsigned long __must_check copy_from_user(void *to, const void __u
static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)
{
#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
-index f7b450f..f5364c5 100644
+index a88671c..1cc895e 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -55,7 +55,7 @@ EXPORT_SYMBOL(arm_delay_ops);
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 52a949a..d8bbcab 100644
+index 36276cd..9d7b13b 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -47,6 +47,87 @@
-4: str r4, [sp, #S_PC] @ retry current instruction
+4: pax_close_userland
+ str r4, [sp, #S_PC] @ retry current instruction
- mov pc, r9
+ ret r9
.popsection
.pushsection __ex_table,"a"
@@ -698,7 +802,7 @@ ENTRY(__switch_to)
#endif
mov r5, r0
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
-index 7139d4a..feaf37f 100644
+index e52fe5a..1b0a924 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
-@@ -10,18 +10,46 @@
-
+@@ -11,18 +11,46 @@
+ #include <asm/assembler.h>
#include <asm/unistd.h>
#include <asm/ftrace.h>
+#include <asm/domain.h>
.align 5
/*
* This is the fast syscall return path. We do as little as
-@@ -405,6 +433,12 @@ ENTRY(vector_swi)
+@@ -406,6 +434,12 @@ ENTRY(vector_swi)
USER( ldr scno, [lr, #-4] ) @ get SWI instruction
#endif
#if defined(CONFIG_OABI_COMPAT)
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
-index 5d702f8..f5fc51a 100644
+index 2fdf867..6e909e4 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -188,6 +188,60 @@
+ pax_exit_kernel
+
msr spsr_cxsf, \rpsr
- #if defined(CONFIG_CPU_V6)
- ldr r0, [sp]
-@@ -265,6 +322,9 @@
+ #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K)
+ @ We must avoid clrex due to Cortex-A15 erratum #830321
+@@ -254,6 +311,9 @@
blne trace_hardirqs_off
#endif
.endif
+
ldr lr, [sp, #S_SP] @ top of the stack
ldrd r0, r1, [sp, #S_LR] @ calling lr and pc
- clrex @ clear the exclusive monitor
+
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index 918875d..cd5fa27 100644
--- a/arch/arm/kernel/fiq.c
flush_icache_range((unsigned long)base + offset, offset +
length);
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
-index 2c35f0f..7747ee6 100644
+index 664eee8..f470938 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -437,7 +437,7 @@ __enable_mmu:
mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
#endif
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
-index 45e4781..8eac93d 100644
+index 6a4dffe..4a86a70 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -38,12 +38,39 @@
flush_icache_range((uintptr_t)(addr),
(uintptr_t)(addr) + size);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
-index 81ef686..f4130b8 100644
+index a35f6eb..7af43a0 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -212,6 +212,7 @@ void machine_power_off(void)
printk("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n"
"sp : %08lx ip : %08lx fp : %08lx\n",
regs->ARM_pc, regs->ARM_lr, regs->ARM_cpsr,
-@@ -425,12 +426,6 @@ unsigned long get_wchan(struct task_struct *p)
+@@ -427,12 +428,6 @@ unsigned long get_wchan(struct task_struct *p)
return 0;
}
#ifdef CONFIG_MMU
#ifdef CONFIG_KUSER_HELPERS
/*
-@@ -446,7 +441,7 @@ static struct vm_area_struct gate_vma = {
+@@ -448,7 +443,7 @@ static struct vm_area_struct gate_vma = {
static int __init gate_vma_init(void)
{
return 0;
}
arch_initcall(gate_vma_init);
-@@ -472,41 +467,16 @@ int in_gate_area_no_mm(unsigned long addr)
+@@ -474,41 +469,16 @@ int in_gate_area_no_mm(unsigned long addr)
const char *arch_vma_name(struct vm_area_struct *vma)
{
if (secure_computing(scno) == -1)
return -1;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
-index 8a16ee5..4f560e5 100644
+index 84db893d..bd8213a 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -104,21 +104,23 @@ EXPORT_SYMBOL(elf_hwcap);
- return page;
-}
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
-index 7c4fada..8581286 100644
+index bbe22fc..d7737f5 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
-@@ -73,7 +73,7 @@ enum ipi_msg_type {
+@@ -76,7 +76,7 @@ enum ipi_msg_type {
static DECLARE_COMPLETION(cpu_running);
start, end);
itcm_present = true;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
-index abd2fc0..895dbb6 100644
+index a964c9f..cf2a5b1 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
-@@ -62,7 +62,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long);
+@@ -64,7 +64,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long);
void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame)
{
#ifdef CONFIG_KALLSYMS
#else
printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
#endif
-@@ -264,6 +264,8 @@ static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
+@@ -266,6 +266,8 @@ static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
static int die_owner = -1;
static unsigned int die_nest_count;
static unsigned long oops_begin(void)
{
int cpu;
-@@ -306,6 +308,9 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
+@@ -308,6 +310,9 @@ static void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
panic("Fatal exception in interrupt");
if (panic_on_oops)
panic("Fatal exception");
if (signr)
do_exit(signr);
}
-@@ -643,7 +648,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
- * The user helper at 0xffff0fe0 must be used instead.
- * (see entry-armv.S for details)
- */
-+ pax_open_kernel();
- *((unsigned int *)0xffff0ff0) = regs->ARM_r0;
-+ pax_close_kernel();
- }
- return 0;
-
-@@ -900,7 +907,11 @@ void __init early_trap_init(void *vectors_base)
+@@ -887,7 +892,11 @@ void __init early_trap_init(void *vectors_base)
kuser_init(vectors_base);
flush_icache_range(vectors, vectors + PAGE_SIZE * 2);
/*
* on V7-M there is no need to copy the vector table to a dedicated
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
-index 7bcee5c..e2f3249 100644
+index 6f57cb9..645f8c4 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -8,7 +8,11 @@
__data_loc = .;
#endif
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
-index 3c82b37..69fa3d2 100644
+index a99e0cd..ab56421d 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -57,7 +57,7 @@ static unsigned long hyp_default_vectors;
static u8 kvm_next_vmid;
static DEFINE_SPINLOCK(kvm_vmid_lock);
-@@ -409,7 +409,7 @@ void force_vm_exit(const cpumask_t *mask)
+@@ -372,7 +372,7 @@ void force_vm_exit(const cpumask_t *mask)
*/
static bool need_new_vmid_gen(struct kvm *kvm)
{
}
/**
-@@ -442,7 +442,7 @@ static void update_vttbr(struct kvm *kvm)
+@@ -405,7 +405,7 @@ static void update_vttbr(struct kvm *kvm)
/* First user of a new VMID generation? */
if (unlikely(kvm_next_vmid == 0)) {
kvm_next_vmid = 1;
/*
-@@ -459,7 +459,7 @@ static void update_vttbr(struct kvm *kvm)
+@@ -422,7 +422,7 @@ static void update_vttbr(struct kvm *kvm)
kvm_call_hyp(__kvm_flush_vm_context);
}
kvm->arch.vmid = kvm_next_vmid;
kvm_next_vmid++;
-@@ -1034,7 +1034,7 @@ static void check_kvm_target_cpu(void *ret)
+@@ -997,7 +997,7 @@ static void check_kvm_target_cpu(void *ret)
/**
* Initialize Hyp-mode and memory mappings on all CPUs.
*/
#include "csumpartialcopygeneric.S"
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
-index 5306de3..aed6d03 100644
+index 312d43e..21d2322 100644
--- a/arch/arm/lib/delay.c
+++ b/arch/arm/lib/delay.c
-@@ -28,7 +28,7 @@
+@@ -29,7 +29,7 @@
/*
* Default to the loop-based delay implementation.
*/
pr_info("AT91: sram at 0x%lx of 0x%x mapped at 0x%lx\n",
base, length, desc->virtual);
-diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
-index 255f33a..507b157 100644
---- a/arch/arm/mach-kirkwood/common.c
-+++ b/arch/arm/mach-kirkwood/common.c
-@@ -157,7 +157,16 @@ static void clk_gate_fn_disable(struct clk_hw *hw)
- clk_gate_ops.disable(hw);
- }
-
--static struct clk_ops clk_gate_fn_ops;
-+static int clk_gate_fn_is_enabled(struct clk_hw *hw)
-+{
-+ return clk_gate_ops.is_enabled(hw);
-+}
-+
-+static struct clk_ops clk_gate_fn_ops = {
-+ .enable = clk_gate_fn_enable,
-+ .disable = clk_gate_fn_disable,
-+ .is_enabled = clk_gate_fn_is_enabled,
-+};
-
- static struct clk __init *clk_register_gate_fn(struct device *dev,
- const char *name,
-@@ -191,14 +200,6 @@ static struct clk __init *clk_register_gate_fn(struct device *dev,
- gate_fn->fn_en = fn_en;
- gate_fn->fn_dis = fn_dis;
-
-- /* ops is the gate ops, but with our enable/disable functions */
-- if (clk_gate_fn_ops.enable != clk_gate_fn_enable ||
-- clk_gate_fn_ops.disable != clk_gate_fn_disable) {
-- clk_gate_fn_ops = clk_gate_ops;
-- clk_gate_fn_ops.enable = clk_gate_fn_enable;
-- clk_gate_fn_ops.disable = clk_gate_fn_disable;
-- }
--
- clk = clk_register(dev, &gate_fn->gate.hw);
-
- if (IS_ERR(clk))
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index 2bdc323..cf1c607 100644
--- a/arch/arm/mach-mvebu/coherency.c
};
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
-index 8bc1338..8b28b69 100644
+index 2f97228..6ce10e1 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -151,7 +151,6 @@ struct omap3_gpmc_regs {
};
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
-index 01ef59d..32ae28a8 100644
+index d22c30d..23697a1 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -510,7 +510,7 @@ void omap_device_delete(struct omap_device *od)
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 da1b256..ab2a327 100644
+index 9e91a4e..357ed0d 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -194,10 +194,10 @@ struct omap_hwmod_soc_ops {
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-tegra/cpuidle-tegra20.c b/arch/arm/mach-tegra/cpuidle-tegra20.c
-index b82dcae..44ee5b6 100644
+index b30bf5c..d0825bf 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra20.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra20.c
@@ -180,7 +180,7 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
extern void ux500_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
-index c348eae..456a1a4 100644
+index ae69809..2665202 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -446,6 +446,7 @@ config CPU_32v5
If all of the binaries and libraries which run on your platform
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
-index b8cb1a2..6a5624a 100644
+index 83792f4..c25d36b 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
-@@ -214,10 +214,12 @@ union offset_union {
+@@ -216,10 +216,12 @@ union offset_union {
#define __get16_unaligned_check(ins,val,addr) \
do { \
unsigned int err = 0, v, a = addr; \
if (err) \
goto fault; \
} while (0)
-@@ -231,6 +233,7 @@ union offset_union {
+@@ -233,6 +235,7 @@ union offset_union {
#define __get32_unaligned_check(ins,val,addr) \
do { \
unsigned int err = 0, v, a = addr; \
__get8_unaligned_check(ins,v,a,err); \
val = v << ((BE) ? 24 : 0); \
__get8_unaligned_check(ins,v,a,err); \
-@@ -239,6 +242,7 @@ union offset_union {
+@@ -241,6 +244,7 @@ union offset_union {
val |= v << ((BE) ? 8 : 16); \
__get8_unaligned_check(ins,v,a,err); \
val |= v << ((BE) ? 0 : 24); \
if (err) \
goto fault; \
} while (0)
-@@ -252,6 +256,7 @@ union offset_union {
+@@ -254,6 +258,7 @@ union offset_union {
#define __put16_unaligned_check(ins,val,addr) \
do { \
unsigned int err = 0, v = val, a = addr; \
__asm__( FIRST_BYTE_16 \
ARM( "1: "ins" %1, [%2], #1\n" ) \
THUMB( "1: "ins" %1, [%2]\n" ) \
-@@ -271,6 +276,7 @@ union offset_union {
+@@ -273,6 +278,7 @@ union offset_union {
" .popsection\n" \
: "=r" (err), "=&r" (v), "=&r" (a) \
: "0" (err), "1" (v), "2" (a)); \
if (err) \
goto fault; \
} while (0)
-@@ -284,6 +290,7 @@ union offset_union {
+@@ -286,6 +292,7 @@ union offset_union {
#define __put32_unaligned_check(ins,val,addr) \
do { \
unsigned int err = 0, v = val, a = addr; \
__asm__( FIRST_BYTE_32 \
ARM( "1: "ins" %1, [%2], #1\n" ) \
THUMB( "1: "ins" %1, [%2]\n" ) \
-@@ -313,6 +320,7 @@ union offset_union {
+@@ -315,6 +322,7 @@ union offset_union {
" .popsection\n" \
: "=r" (err), "=&r" (v), "=&r" (a) \
: "0" (err), "1" (v), "2" (a)); \
goto fault; \
} while (0)
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
-index 7c3fb41..bfb87d8 100644
+index 5f2c988..221412d 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -41,7 +41,7 @@ struct l2c_init_data {
}
}
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
-index 6e3ba8d..9cbb4d7 100644
+index 8348ed6..b73a807 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -40,6 +40,22 @@
}
}
+diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
+index a37b989..5c9ae75 100644
+--- a/arch/arm/net/bpf_jit_32.c
++++ b/arch/arm/net/bpf_jit_32.c
+@@ -71,7 +71,11 @@ struct jit_ctx {
+ #endif
+ };
+
++#ifdef CONFIG_GRKERNSEC_BPF_HARDEN
++int bpf_jit_enable __read_only;
++#else
+ int bpf_jit_enable __read_mostly;
++#endif
+
+ static u64 jit_get_skb_b(struct sk_buff *skb, unsigned offset)
+ {
+@@ -930,5 +934,6 @@ void bpf_jit_free(struct bpf_prog *fp)
+ {
+ if (fp->jited)
+ module_free(NULL, fp->bpf_func);
+- kfree(fp);
++
++ bpf_prog_unlock_free(fp);
+ }
diff --git a/arch/arm/plat-iop/setup.c b/arch/arm/plat-iop/setup.c
index 5b217f4..c23f40e 100644
--- a/arch/arm/plat-iop/setup.c
if (!(addr & ~PAGE_MASK))
goto success;
diff --git a/arch/hexagon/include/asm/cache.h b/arch/hexagon/include/asm/cache.h
-index f4ca594..adc72fd6 100644
+index 2635117..fa223cb 100644
--- a/arch/hexagon/include/asm/cache.h
+++ b/arch/hexagon/include/asm/cache.h
@@ -21,9 +21,11 @@
#define __cacheline_aligned __aligned(L1_CACHE_BYTES)
#define ____cacheline_aligned __aligned(L1_CACHE_BYTES)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
-index 2f3abcf..e63c7fa 100644
+index c84c88b..2a6e1ba 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
-@@ -547,6 +547,7 @@ source "drivers/sn/Kconfig"
+@@ -549,6 +549,7 @@ source "drivers/sn/Kconfig"
config KEXEC
bool "kexec system call"
depends on !IA64_HP_SIM && (!SMP || HOTPLUG_CPU)
help
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
+diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
+index 5441b14..039a446 100644
+--- a/arch/ia64/Makefile
++++ b/arch/ia64/Makefile
+@@ -99,5 +99,6 @@ endef
+ archprepare: make_nr_irqs_h FORCE
+ PHONY += make_nr_irqs_h FORCE
+
++make_nr_irqs_h: KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
+ make_nr_irqs_h: FORCE
+ $(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
diff --git a/arch/ia64/include/asm/atomic.h b/arch/ia64/include/asm/atomic.h
index 0f8bf48..40ea950 100644
--- a/arch/ia64/include/asm/atomic.h
}
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
-index 25c3502..560dae7 100644
+index 6b33457..88b5124 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -120,6 +120,19 @@ ia64_init_addr_space (void)
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
down_write(¤t->mm->mmap_sem);
if (insert_vm_struct(current->mm, vma)) {
+@@ -286,7 +299,7 @@ static int __init gate_vma_init(void)
+ gate_vma.vm_start = FIXADDR_USER_START;
+ gate_vma.vm_end = FIXADDR_USER_END;
+ gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
+- gate_vma.vm_page_prot = __P101;
++ gate_vma.vm_page_prot = vm_get_page_prot(gate_vma.vm_flags);
+
+ return 0;
+ }
diff --git a/arch/m32r/include/asm/cache.h b/arch/m32r/include/asm/cache.h
index 40b3ee9..8c2c112 100644
--- a/arch/m32r/include/asm/cache.h
#define smp_load_acquire(p) \
diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c
-index 3c52fa6..11b2ad8 100644
+index 3c32075..ae0ae75 100644
--- a/arch/metag/mm/hugetlbpage.c
+++ b/arch/metag/mm/hugetlbpage.c
@@ -200,6 +200,7 @@ hugetlb_get_unmapped_area_new_pmd(unsigned long len)
#define SMP_CACHE_BYTES L1_CACHE_BYTES
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
-index 4e238e6..7c9ed92 100644
+index 574c430..470200d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -2392,6 +2392,7 @@ source "kernel/Kconfig.preempt"
+@@ -2399,6 +2399,7 @@ source "kernel/Kconfig.preempt"
config KEXEC
bool "Kexec system call"
#define SMP_CACHE_SHIFT L1_CACHE_SHIFT
#define SMP_CACHE_BYTES L1_CACHE_BYTES
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
-index d414405..6bb4ba2 100644
+index 1d38fe0..9beabc9 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
-@@ -398,13 +398,16 @@ extern const char *__elf_platform;
+@@ -381,13 +381,16 @@ extern const char *__elf_platform;
#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
#endif
/**
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
-index 5699ec3..95def83 100644
+index 3be8180..c4798d5 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -120,7 +120,7 @@ extern void copy_user_highpage(struct page *to, struct page *from,
/*
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
-index 539ddd1..8783f9a 100644
+index df49a30..c0d3dd6 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -20,6 +20,9 @@
#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 7faf5f2..f3d3cf4 100644
+index 9287678..f870e47 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -70,6 +70,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
#include <asm/processor.h>
- /*
+ #include <linux/module.h>
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 50b3648..c2f3cec 100644
--- a/arch/mips/kernel/i8259.c
}
#else
diff --git a/arch/mips/kernel/pm-cps.c b/arch/mips/kernel/pm-cps.c
-index c4c2069..bde8051 100644
+index 0614717..002fa43 100644
--- a/arch/mips/kernel/pm-cps.c
+++ b/arch/mips/kernel/pm-cps.c
-@@ -168,7 +168,7 @@ int cps_pm_enter_state(enum cps_pm_state state)
+@@ -172,7 +172,7 @@ int cps_pm_enter_state(enum cps_pm_state state)
nc_core_ready_count = nc_addr;
/* Ensure ready_count is zero-initialised before the assembly runs */
/* Run the generated entry code */
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
-index 0a1ec0f..d9e93b6 100644
+index 636b074..8fbb91f 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
-@@ -572,15 +572,3 @@ unsigned long get_wchan(struct task_struct *task)
+@@ -520,15 +520,3 @@ unsigned long get_wchan(struct task_struct *task)
out:
return pc;
}
- return sp & ALMASK;
-}
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
-index f639ccd..e4b110d 100644
+index 645b3c4..909c75a 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
-@@ -630,6 +630,10 @@ long arch_ptrace(struct task_struct *child, long request,
+@@ -761,6 +761,10 @@ long arch_ptrace(struct task_struct *child, long request,
return ret;
}
/*
* Notification of system call entry/exit
* - triggered by current->work.syscall_trace
-@@ -646,6 +650,11 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
+@@ -777,6 +781,11 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
tracehook_report_syscall_entry(regs))
ret = -1;
}
/* Arrange for an interrupt in a short while */
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
-index 51706d6..ec1178c 100644
+index 22b19c2..c5cc8c4 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
-@@ -687,7 +687,18 @@ asmlinkage void do_ov(struct pt_regs *regs)
+@@ -688,7 +688,18 @@ asmlinkage void do_ov(struct pt_regs *regs)
siginfo_t info;
prev_state = exception_enter();
info.si_code = FPE_INTOVF;
info.si_signo = SIGFPE;
-diff --git a/arch/mips/kvm/kvm_mips.c b/arch/mips/kvm/kvm_mips.c
-index f3c56a1..6a2f01c 100644
---- a/arch/mips/kvm/kvm_mips.c
-+++ b/arch/mips/kvm/kvm_mips.c
-@@ -841,7 +841,7 @@ long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
+diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
+index cd71141..e02c4df 100644
+--- a/arch/mips/kvm/mips.c
++++ b/arch/mips/kvm/mips.c
+@@ -839,7 +839,7 @@ long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
return r;
}
-int kvm_arch_init(void *opaque)
+int kvm_arch_init(const void *opaque)
{
- int ret;
-
+ if (kvm_mips_callbacks) {
+ kvm_err("kvm: module already exists\n");
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index becc42b..9e43d4b 100644
--- a/arch/mips/mm/fault.c
int __virt_addr_valid(const volatile void *kaddr)
{
return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
+diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
+index 9f7ecbd..6e370fc 100644
+--- a/arch/mips/net/bpf_jit.c
++++ b/arch/mips/net/bpf_jit.c
+@@ -1428,5 +1428,6 @@ void bpf_jit_free(struct bpf_prog *fp)
+ {
+ if (fp->jited)
+ module_free(NULL, fp->bpf_func);
+- kfree(fp);
++
++ bpf_prog_unlock_free(fp);
+ }
diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c
index 59cccd9..f39ac2f 100644
--- a/arch/mips/pci/pci-octeon.c
/*
* If for any reason at all we couldn't handle the fault, make
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
-index 80b94b0..a3274fb 100644
+index 4bc7b62..107e0b2 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
-@@ -398,6 +398,7 @@ config PPC64_SUPPORTS_MEMORY_FAILURE
+@@ -399,6 +399,7 @@ config PPC64_SUPPORTS_MEMORY_FAILURE
config KEXEC
bool "kexec system call"
depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP))
#define smp_load_acquire(p) \
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
-index ed0afc1..0332825 100644
+index 34a05a1..a1f2c67 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
-@@ -3,6 +3,7 @@
-
+@@ -4,6 +4,7 @@
#ifdef __KERNEL__
+ #include <asm/reg.h>
+#include <linux/const.h>
/* bytes per L1 cache line */
#if defined(CONFIG_8xx) || defined(CONFIG_403GCX)
-@@ -22,7 +23,7 @@
+@@ -23,7 +24,7 @@
#define L1_CACHE_SHIFT 7
#endif
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 32e4e21..62afb12 100644
+index 26fe1ae..987ffc5 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
-@@ -230,8 +230,9 @@ extern long long virt_phys_offset;
+@@ -227,8 +227,9 @@ extern long long virt_phys_offset;
* and needs to be executable. This means the whole heap ends
* up being executable.
*/
#define VM_DATA_DEFAULT_FLAGS64 (VM_READ | VM_WRITE | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-@@ -259,6 +260,9 @@ extern long long virt_phys_offset;
+@@ -256,6 +257,9 @@ extern long long virt_phys_offset;
#define is_kernel_addr(x) ((x) >= PAGE_OFFSET)
#endif
#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 bffd89d..a6641ed 100644
+index 0c05059..7e056e4 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -251,6 +251,7 @@
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 a7d36b1..53af150 100644
+index 050f79a..f385bfe 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
-@@ -1637,10 +1637,10 @@ handle_page_fault:
+@@ -1593,10 +1593,10 @@ handle_page_fault:
11: ld r4,_DAR(r1)
ld r5,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD
addi r3,r1,STACK_FRAME_OVERHEAD
lwz r4,_DAR(r1)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
-index 248ee7e..1eb60dd 100644
+index 4c5891d..a5d88bb 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
-@@ -447,6 +447,8 @@ void migrate_irqs(void)
+@@ -461,6 +461,8 @@ void migrate_irqs(void)
}
#endif
static inline void check_stack_overflow(void)
{
#ifdef CONFIG_DEBUG_STACKOVERFLOW
-@@ -459,6 +461,7 @@ static inline void check_stack_overflow(void)
+@@ -473,6 +475,7 @@ static inline void check_stack_overflow(void)
printk("do_IRQ: stack overflow: %ld\n",
sp - sizeof(struct thread_info));
dump_stack();
sechdrs, module);
#endif
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
-index be99774..9879c82 100644
+index bf44ae9..6d2ce71 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1039,8 +1039,8 @@ void show_regs(struct pt_regs * regs)
#endif
show_stack(current, (unsigned long *) regs->gpr[1]);
if (!user_mode(regs))
-@@ -1554,10 +1554,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1558,10 +1558,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
newsp = stack[0];
ip = stack[STACK_FRAME_LR_SAVE];
if (!firstframe || ip != lr) {
(void *)current->ret_stack[curr_frame].ret);
curr_frame--;
}
-@@ -1577,7 +1577,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
+@@ -1581,7 +1581,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;
-- printk("--- Exception: %lx at %pS\n LR = %pS\n",
-+ printk("--- Exception: %lx at %pA\n LR = %pA\n",
+- printk("--- interrupt: %lx at %pS\n LR = %pS\n",
++ printk("--- interrupt: %lx at %pA\n LR = %pA\n",
regs->trap, (void *)regs->nip, (void *)lr);
firstframe = 1;
}
-@@ -1613,58 +1613,3 @@ void notrace __ppc64_runlatch_off(void)
+@@ -1617,58 +1617,3 @@ void notrace __ppc64_runlatch_off(void)
mtspr(SPRN_CTRLT, ctrl);
}
#endif /* CONFIG_PPC64 */
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
-index 1bc5a17..910d3f3 100644
+index b171001..4ac7ac5 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
-@@ -1012,7 +1012,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
+@@ -1011,7 +1011,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
/* Save user registers on the stack */
frame = &rt_sf->uc.uc_mcontext;
addr = frame;
tramp = current->mm->context.vdso_base + vdso32_rt_sigtramp;
} else {
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
-index 97c1e4b..f427f81 100644
+index 2cb0c94..c0c0bc9 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
-@@ -755,7 +755,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
+@@ -754,7 +754,7 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs
current->thread.fp_state.fpscr = 0;
/* Set up to return from userspace. */
} else {
err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
-index 239f1cd..5359f76 100644
+index 0dc43f9..7893068 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)
}
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
-index ce74c33..0803371 100644
+index f174351..5722009 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -35,6 +35,7 @@
rc = vdso_base;
goto fail_mmapsem;
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
-index 61c738a..b1092d6 100644
+index 4c79284..0e462c3 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
-@@ -1195,7 +1195,7 @@ void kvmppc_init_lpid(unsigned long nr_lpids_param)
+@@ -1338,7 +1338,7 @@ void kvmppc_init_lpid(unsigned long nr_lpids_param)
}
EXPORT_SYMBOL_GPL(kvmppc_init_lpid);
/* If hint, make sure it matches our alignment restrictions */
if (!fixed && addr) {
addr = _ALIGN_UP(addr, 1ul << pshift);
+diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
+index 3afa6f4..40c53ff 100644
+--- a/arch/powerpc/net/bpf_jit_comp.c
++++ b/arch/powerpc/net/bpf_jit_comp.c
+@@ -697,5 +697,6 @@ void bpf_jit_free(struct bpf_prog *fp)
+ {
+ if (fp->jited)
+ module_free(NULL, fp->bpf_func);
+- kfree(fp);
++
++ bpf_prog_unlock_free(fp);
+ }
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
index 4278acf..67fd0e6 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c
static void pciex_clear_intr_all(unsigned int __iomem *base)
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
-index 9098692..3d54cd1 100644
+index d966bbe..372124a 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -280,9 +280,9 @@ spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
mm->get_unmapped_area = s390_get_unmapped_area_topdown;
}
}
+diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
+index 61e45b7..f2833c5 100644
+--- a/arch/s390/net/bpf_jit_comp.c
++++ b/arch/s390/net/bpf_jit_comp.c
+@@ -887,5 +887,5 @@ void bpf_jit_free(struct bpf_prog *fp)
+ module_free(NULL, header);
+
+ free_filter:
+- kfree(fp);
++ bpf_prog_unlock_free(fp);
+ }
diff --git a/arch/score/include/asm/cache.h b/arch/score/include/asm/cache.h
index ae3d59f..f65f075 100644
--- a/arch/score/include/asm/cache.h
extern unsigned long sparc64_elf_hwcap;
#define ELF_HWCAP sparc64_elf_hwcap
+diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h
+index f346824..2e3a4ad 100644
+--- a/arch/sparc/include/asm/oplib_64.h
++++ b/arch/sparc/include/asm/oplib_64.h
+@@ -62,7 +62,8 @@ struct linux_mem_p1275 {
+ /* You must call prom_init() before using any of the library services,
+ * preferably as early as possible. Pass it the romvec pointer.
+ */
+-void prom_init(void *cif_handler, void *cif_stack);
++void prom_init(void *cif_handler);
++void prom_init_report(void);
+
+ /* Boot argument acquisition, returns the boot command line string. */
+ char *prom_getbootargs(void);
diff --git a/arch/sparc/include/asm/pgalloc_32.h b/arch/sparc/include/asm/pgalloc_32.h
index a3890da..f6a408e 100644
--- a/arch/sparc/include/asm/pgalloc_32.h
SRMMU_DIRTY | SRMMU_REF)
diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h
-index f5fffd8..a0669f0 100644
+index f5fffd8..4272fe8 100644
--- a/arch/sparc/include/asm/setup.h
+++ b/arch/sparc/include/asm/setup.h
-@@ -53,8 +53,8 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs);
+@@ -48,13 +48,15 @@ unsigned long safe_compute_effective_address(struct pt_regs *, unsigned int);
+ #endif
+
+ #ifdef CONFIG_SPARC64
++void __init start_early_boot(void);
++
+ /* unaligned_64.c */
+ int handle_ldf_stq(u32 insn, struct pt_regs *regs);
void handle_ld_nf(u32 insn, struct pt_regs *regs);
/* init_64.c */
/*
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
-index a5f01ac..703b554 100644
+index a5f01ac..a8811dd 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 {
+@@ -63,7 +63,10 @@ struct thread_info {
struct pt_regs *kern_una_regs;
unsigned int kern_una_insn;
+- unsigned long fpregs[0] __attribute__ ((aligned(64)));
+ unsigned long lowest_stack;
+
- unsigned long fpregs[0] __attribute__ ((aligned(64)));
++ unsigned long fpregs[(7 * 256) / sizeof(unsigned long)]
++ __attribute__ ((aligned(64)));
};
-@@ -188,12 +190,13 @@ register struct thread_info *current_thread_info_reg asm("g6");
+ #endif /* !(__ASSEMBLY__) */
+@@ -188,12 +191,13 @@ register struct thread_info *current_thread_info_reg asm("g6");
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
/* flag bit 4 is available */
#define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */
/* NOTE: Thread flags >= 12 should be ones we have no interest
* in using in assembly, else we can't use the mask as
* an immediate value in instructions such as andcc.
-@@ -213,12 +216,18 @@ register struct thread_info *current_thread_info_reg asm("g6");
+@@ -213,12 +217,18 @@ register struct thread_info *current_thread_info_reg asm("g6");
#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
extra-y := head_$(BITS).o
+diff --git a/arch/sparc/kernel/entry.h b/arch/sparc/kernel/entry.h
+index ebaba61..88d322b 100644
+--- a/arch/sparc/kernel/entry.h
++++ b/arch/sparc/kernel/entry.h
+@@ -65,13 +65,10 @@ struct pause_patch_entry {
+ extern struct pause_patch_entry __pause_3insn_patch,
+ __pause_3insn_patch_end;
+
+-void __init per_cpu_patch(void);
+ void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *,
+ struct sun4v_1insn_patch_entry *);
+ void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *,
+ struct sun4v_2insn_patch_entry *);
+-void __init sun4v_patch(void);
+-void __init boot_cpu_id_too_large(int cpu);
+ extern unsigned int dcache_parity_tl1_occurred;
+ extern unsigned int icache_parity_tl1_occurred;
+
+diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
+index 452f04fe..fbea0ac 100644
+--- a/arch/sparc/kernel/head_64.S
++++ b/arch/sparc/kernel/head_64.S
+@@ -660,14 +660,12 @@ tlb_fixup_done:
+ sethi %hi(init_thread_union), %g6
+ or %g6, %lo(init_thread_union), %g6
+ ldx [%g6 + TI_TASK], %g4
+- mov %sp, %l6
+
+ wr %g0, ASI_P, %asi
+ mov 1, %g1
+ sllx %g1, THREAD_SHIFT, %g1
+ sub %g1, (STACKFRAME_SZ + STACK_BIAS), %g1
+ add %g6, %g1, %sp
+- mov 0, %fp
+
+ /* Set per-cpu pointer initially to zero, this makes
+ * the boot-cpu use the in-kernel-image per-cpu areas
+@@ -694,44 +692,14 @@ tlb_fixup_done:
+ nop
+ #endif
+
+- mov %l6, %o1 ! OpenPROM stack
+ call prom_init
+ mov %l7, %o0 ! OpenPROM cif handler
+
+- /* Initialize current_thread_info()->cpu as early as possible.
+- * In order to do that accurately we have to patch up the get_cpuid()
+- * assembler sequences. And that, in turn, requires that we know
+- * if we are on a Starfire box or not. While we're here, patch up
+- * the sun4v sequences as well.
++ /* To create a one-register-window buffer between the kernel's
++ * initial stack and the last stack frame we use from the firmware,
++ * do the rest of the boot from a C helper function.
+ */
+- call check_if_starfire
+- nop
+- call per_cpu_patch
+- nop
+- call sun4v_patch
+- nop
+-
+-#ifdef CONFIG_SMP
+- call hard_smp_processor_id
+- nop
+- cmp %o0, NR_CPUS
+- blu,pt %xcc, 1f
+- nop
+- call boot_cpu_id_too_large
+- nop
+- /* Not reached... */
+-
+-1:
+-#else
+- mov 0, %o0
+-#endif
+- sth %o0, [%g6 + TI_CPU]
+-
+- call prom_init_report
+- nop
+-
+- /* Off we go.... */
+- call start_kernel
++ call start_early_boot
+ nop
+ /* Not reached... */
+
+diff --git a/arch/sparc/kernel/hvtramp.S b/arch/sparc/kernel/hvtramp.S
+index b7ddcdd..cdbfec2 100644
+--- a/arch/sparc/kernel/hvtramp.S
++++ b/arch/sparc/kernel/hvtramp.S
+@@ -109,7 +109,6 @@ hv_cpu_startup:
+ sllx %g5, THREAD_SHIFT, %g5
+ sub %g5, (STACKFRAME_SZ + STACK_BIAS), %g5
+ add %g6, %g5, %sp
+- mov 0, %fp
+
+ call init_irqwork_curcpu
+ nop
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index 50e7b62..79fae35 100644
--- a/arch/sparc/kernel/process_32.c
} while (++count < 16);
printk("\n");
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
-index 027e099..6d4178f 100644
+index 0be7bf9..2b1cba8 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -161,7 +161,7 @@ static void show_regwindow(struct pt_regs *regs)
audit_syscall_exit(regs);
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
+diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
+index 3fdb455..949f773 100644
+--- a/arch/sparc/kernel/setup_64.c
++++ b/arch/sparc/kernel/setup_64.c
+@@ -30,6 +30,7 @@
+ #include <linux/cpu.h>
+ #include <linux/initrd.h>
+ #include <linux/module.h>
++#include <linux/start_kernel.h>
+
+ #include <asm/io.h>
+ #include <asm/processor.h>
+@@ -174,7 +175,7 @@ char reboot_command[COMMAND_LINE_SIZE];
+
+ static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 };
+
+-void __init per_cpu_patch(void)
++static void __init per_cpu_patch(void)
+ {
+ struct cpuid_patch_entry *p;
+ unsigned long ver;
+@@ -266,7 +267,7 @@ void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *start,
+ }
+ }
+
+-void __init sun4v_patch(void)
++static void __init sun4v_patch(void)
+ {
+ extern void sun4v_hvapi_init(void);
+
+@@ -335,14 +336,25 @@ static void __init pause_patch(void)
+ }
+ }
+
+-#ifdef CONFIG_SMP
+-void __init boot_cpu_id_too_large(int cpu)
++void __init start_early_boot(void)
+ {
+- prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n",
+- cpu, NR_CPUS);
+- prom_halt();
++ int cpu;
++
++ check_if_starfire();
++ per_cpu_patch();
++ sun4v_patch();
++
++ cpu = hard_smp_processor_id();
++ if (cpu >= NR_CPUS) {
++ prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n",
++ cpu, NR_CPUS);
++ prom_halt();
++ }
++ current_thread_info()->cpu = cpu;
++
++ prom_init_report();
++ start_kernel();
+ }
+-#endif
+
+ /* On Ultra, we support all of the v8 capabilities. */
+ unsigned long sparc64_elf_hwcap = (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR |
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
-index 41aa247..eadfb74 100644
+index f7ba875..b65677e 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -883,7 +883,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
2:
+diff --git a/arch/sparc/kernel/trampoline_64.S b/arch/sparc/kernel/trampoline_64.S
+index 737f8cb..88ede1d 100644
+--- a/arch/sparc/kernel/trampoline_64.S
++++ b/arch/sparc/kernel/trampoline_64.S
+@@ -109,10 +109,13 @@ startup_continue:
+ brnz,pn %g1, 1b
+ nop
+
+- sethi %hi(p1275buf), %g2
+- or %g2, %lo(p1275buf), %g2
+- ldx [%g2 + 0x10], %l2
+- add %l2, -(192 + 128), %sp
++ /* Get onto temporary stack which will be in the locked
++ * kernel image.
++ */
++ sethi %hi(tramp_stack), %g1
++ or %g1, %lo(tramp_stack), %g1
++ add %g1, TRAMP_STACK_SIZE, %g1
++ sub %g1, STACKFRAME_SZ + STACK_BIAS + 256, %sp
+ flushw
+
+ /* Setup the loop variables:
+@@ -394,7 +397,6 @@ after_lock_tlb:
+ sllx %g5, THREAD_SHIFT, %g5
+ sub %g5, (STACKFRAME_SZ + STACK_BIAS), %g5
+ add %g6, %g5, %sp
+- mov 0, %fp
+
+ rdpr %pstate, %o1
+ or %o1, PSTATE_IE, %o1
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 6fd386c5..6907d81 100644
--- a/arch/sparc/kernel/traps_32.c
/* Pure DTLB misses do not tell us whether the fault causing
* load/store/atomic was a write or not, it only says that there
* was no match. So in such a case we (carefully) read the
+diff --git a/arch/sparc/mm/gup.c b/arch/sparc/mm/gup.c
+index 1aed043..ae6ce38 100644
+--- a/arch/sparc/mm/gup.c
++++ b/arch/sparc/mm/gup.c
+@@ -160,6 +160,36 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end,
+ return 1;
+ }
+
++int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
++ struct page **pages)
++{
++ struct mm_struct *mm = current->mm;
++ unsigned long addr, len, end;
++ unsigned long next, flags;
++ pgd_t *pgdp;
++ int nr = 0;
++
++ start &= PAGE_MASK;
++ addr = start;
++ len = (unsigned long) nr_pages << PAGE_SHIFT;
++ end = start + len;
++
++ local_irq_save(flags);
++ pgdp = pgd_offset(mm, addr);
++ do {
++ pgd_t pgd = *pgdp;
++
++ next = pgd_addr_end(addr, end);
++ if (pgd_none(pgd))
++ break;
++ if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
++ break;
++ } while (pgdp++, addr = next, addr != end);
++ local_irq_restore(flags);
++
++ return nr;
++}
++
+ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
+ struct page **pages)
+ {
diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
index d329537..2c3746a 100644
--- a/arch/sparc/mm/hugetlbpage.c
pte_t *huge_pte_alloc(struct mm_struct *mm,
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
-index 2cfb0f2..e917d9f 100644
+index 98ac8e8..ba7dd39 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
-@@ -189,9 +189,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
+@@ -190,9 +190,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
int num_kernel_image_mappings;
#ifdef CONFIG_DEBUG_DCFLUSH
#endif
#endif
-@@ -199,7 +199,7 @@ inline void flush_dcache_page_impl(struct page *page)
+@@ -200,7 +200,7 @@ inline void flush_dcache_page_impl(struct page *page)
{
BUG_ON(tlb_type == hypervisor);
#ifdef CONFIG_DEBUG_DCFLUSH
#endif
#ifdef DCACHE_ALIASING_POSSIBLE
-@@ -471,10 +471,10 @@ void mmu_info(struct seq_file *m)
+@@ -472,10 +472,10 @@ void mmu_info(struct seq_file *m)
#ifdef CONFIG_DEBUG_DCFLUSH
seq_printf(m, "DCPageFlushes\t: %d\n",
#endif /* CONFIG_SMP */
#endif /* CONFIG_DEBUG_DCFLUSH */
}
+diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c
+index ece4af0..f04b862 100644
+--- a/arch/sparc/net/bpf_jit_comp.c
++++ b/arch/sparc/net/bpf_jit_comp.c
+@@ -823,5 +823,6 @@ void bpf_jit_free(struct bpf_prog *fp)
+ {
+ if (fp->jited)
+ module_free(NULL, fp->bpf_func);
+- kfree(fp);
++
++ bpf_prog_unlock_free(fp);
+ }
+diff --git a/arch/sparc/prom/cif.S b/arch/sparc/prom/cif.S
+index 9c86b4b..8050f38 100644
+--- a/arch/sparc/prom/cif.S
++++ b/arch/sparc/prom/cif.S
+@@ -11,11 +11,10 @@
+ .text
+ .globl prom_cif_direct
+ prom_cif_direct:
++ save %sp, -192, %sp
+ sethi %hi(p1275buf), %o1
+ or %o1, %lo(p1275buf), %o1
+- ldx [%o1 + 0x0010], %o2 ! prom_cif_stack
+- save %o2, -192, %sp
+- ldx [%i1 + 0x0008], %l2 ! prom_cif_handler
++ ldx [%o1 + 0x0008], %l2 ! prom_cif_handler
+ mov %g4, %l0
+ mov %g5, %l1
+ mov %g6, %l3
+diff --git a/arch/sparc/prom/init_64.c b/arch/sparc/prom/init_64.c
+index d95db75..110b0d7 100644
+--- a/arch/sparc/prom/init_64.c
++++ b/arch/sparc/prom/init_64.c
+@@ -26,13 +26,13 @@ phandle prom_chosen_node;
+ * It gets passed the pointer to the PROM vector.
+ */
+
+-extern void prom_cif_init(void *, void *);
++extern void prom_cif_init(void *);
+
+-void __init prom_init(void *cif_handler, void *cif_stack)
++void __init prom_init(void *cif_handler)
+ {
+ phandle node;
+
+- prom_cif_init(cif_handler, cif_stack);
++ prom_cif_init(cif_handler);
+
+ prom_chosen_node = prom_finddevice(prom_chosen_path);
+ if (!prom_chosen_node || (s32)prom_chosen_node == -1)
+diff --git a/arch/sparc/prom/p1275.c b/arch/sparc/prom/p1275.c
+index e58b817..c27c30e4 100644
+--- a/arch/sparc/prom/p1275.c
++++ b/arch/sparc/prom/p1275.c
+@@ -19,7 +19,6 @@
+ struct {
+ long prom_callback; /* 0x00 */
+ void (*prom_cif_handler)(long *); /* 0x08 */
+- unsigned long prom_cif_stack; /* 0x10 */
+ } p1275buf;
+
+ extern void prom_world(int);
+@@ -51,5 +50,4 @@ void p1275_cmd_direct(unsigned long *args)
+ void prom_cif_init(void *cif_handler, void *cif_stack)
+ {
+ p1275buf.prom_cif_handler = (void (*)(long *))cif_handler;
+- p1275buf.prom_cif_stack = (unsigned long)cif_stack;
+ }
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
-index 4f3006b..453f625f 100644
+index 7fcd492..1311074 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
-@@ -192,6 +192,7 @@ source "kernel/Kconfig.hz"
+@@ -191,6 +191,7 @@ source "kernel/Kconfig.hz"
config KEXEC
bool "kexec system call"
#endif
diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h
-index 5ff53d9..5850cdf 100644
+index 71c5d13..4c7b9f1 100644
--- a/arch/um/include/asm/page.h
+++ b/arch/um/include/asm/page.h
@@ -14,6 +14,9 @@
/*
* Memory returned by kmalloc() may be used for DMA, so we must make
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
-index 27adfd9..bc3551d 100644
+index 3632743..630a8bb 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -128,7 +128,7 @@ config X86
+@@ -130,7 +130,7 @@ config X86
select RTC_LIB
select HAVE_DEBUG_STACKOVERFLOW
select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64
select GENERIC_CPU_AUTOPROBE
select HAVE_ARCH_AUDITSYSCALL
select ARCH_SUPPORTS_ATOMIC_RMW
-@@ -253,7 +253,7 @@ config X86_HT
+@@ -258,7 +258,7 @@ config X86_HT
config X86_32_LAZY_GS
def_bool y
config ARCH_HWEIGHT_CFLAGS
string
-@@ -549,6 +549,7 @@ config SCHED_OMIT_FRAME_POINTER
+@@ -555,6 +555,7 @@ config SCHED_OMIT_FRAME_POINTER
menuconfig HYPERVISOR_GUEST
bool "Linux guest support"
---help---
Say Y here to enable options for running Linux under various hyper-
visors. This option enables basic hypervisor detection and platform
-@@ -1076,6 +1077,7 @@ choice
+@@ -1083,6 +1084,7 @@ choice
config NOHIGHMEM
bool "off"
---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
-@@ -1112,6 +1114,7 @@ config NOHIGHMEM
+@@ -1119,6 +1121,7 @@ config NOHIGHMEM
config HIGHMEM4G
bool "4GB"
---help---
Select this if you have a 32-bit processor and between 1 and 4
gigabytes of physical RAM.
-@@ -1164,7 +1167,7 @@ config PAGE_OFFSET
+@@ -1171,7 +1174,7 @@ config PAGE_OFFSET
hex
default 0xB0000000 if VMSPLIT_3G_OPT
default 0x80000000 if VMSPLIT_2G
default 0x40000000 if VMSPLIT_1G
default 0xC0000000
depends on X86_32
-@@ -1578,6 +1581,7 @@ source kernel/Kconfig.hz
+@@ -1586,6 +1589,7 @@ source kernel/Kconfig.hz
config KEXEC
bool "kexec system call"
---help---
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
-@@ -1728,7 +1732,9 @@ config X86_NEED_RELOCS
+@@ -1771,7 +1775,9 @@ config X86_NEED_RELOCS
config PHYSICAL_ALIGN
hex "Alignment value to which kernel should be aligned"
range 0x2000 0x1000000 if X86_32
range 0x200000 0x1000000 if X86_64
---help---
-@@ -1811,6 +1817,7 @@ config COMPAT_VDSO
+@@ -1854,6 +1860,7 @@ config COMPAT_VDSO
def_bool n
prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
depends on X86_32 || IA32_EMULATION
This option helps catch unintended modifications to loadable
kernel module's text and read-only data. It also prevents execution
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
-index 33f71b0..c2cefa2 100644
+index 60087ca..9d9500e 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
-@@ -71,9 +71,6 @@ ifeq ($(CONFIG_X86_32),y)
+@@ -68,9 +68,6 @@ ifeq ($(CONFIG_X86_32),y)
# CPU-specific tuning. Anything which can be shared with UML should go here.
include $(srctree)/arch/x86/Makefile_32.cpu
KBUILD_CFLAGS += $(cflags-y)
else
BITS := 64
UTS_MACHINE := x86_64
-@@ -114,6 +111,9 @@ else
+@@ -111,6 +108,9 @@ else
KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args)
endif
# Make sure compiler does not have buggy stack-protector support.
ifdef CONFIG_CC_STACKPROTECTOR
cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh
-@@ -271,3 +271,12 @@ define archhelp
+@@ -184,6 +184,7 @@ archheaders:
+ $(Q)$(MAKE) $(build)=arch/x86/syscalls all
+
+ archprepare:
++ $(if $(LDFLAGS_BUILD_ID),,$(error $(OLD_LD)))
+ ifeq ($(CONFIG_KEXEC_FILE),y)
+ $(Q)$(MAKE) $(build)=arch/x86/purgatory arch/x86/purgatory/kexec-purgatory.c
+ endif
+@@ -274,3 +275,9 @@ define archhelp
echo ' FDINITRD=file initrd for the booted kernel'
echo ' kvmconfig - Enable additional options for guest kernel support'
endef
+*** ${VERSION}.${PATCHLEVEL} PaX kernels no longer build correctly with old versions of binutils.
+*** Please upgrade your binutils to 2.18 or newer
+endef
-+
-+archprepare:
-+ $(if $(LDFLAGS_BUILD_ID),,$(error $(OLD_LD)))
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index dbe8dd2..2f0a98f 100644
--- a/arch/x86/boot/Makefile
err = check_cpuflags();
} else if (err == 0x01 &&
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
-index 7a6d43a..edf6e40 100644
+index 16ef025..91e033b 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -438,10 +438,14 @@ setup_data: .quad 0 # 64-bit physical pointer to
ret;
ENDPROC(cast6_xts_dec_8way)
diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
-index dbc4339..de6e120 100644
+index 26d49eb..c0a8c84 100644
--- a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
+++ b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
@@ -45,6 +45,7 @@
## ISCSI CRC 32 Implementation with crc32 and pclmulqdq Instruction
-@@ -312,6 +313,7 @@ do_return:
+@@ -309,6 +310,7 @@ do_return:
popq %rsi
popq %rdi
popq %rbx
set_fs(KERNEL_DS);
has_dumped = 1;
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
-index f9e181a..b0df8b3 100644
+index f9e181a..db313b5 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -218,7 +218,7 @@ asmlinkage long sys32_sigreturn(void)
return (void __user *) sp;
}
-@@ -386,7 +386,7 @@ int ia32_setup_frame(int sig, struct ksignal *ksig,
- restorer = current->mm->context.vdso +
- selected_vdso32->sym___kernel_sigreturn;
+@@ -383,10 +383,10 @@ int ia32_setup_frame(int sig, struct ksignal *ksig,
+ } else {
+ /* Return stub is in 32bit vsyscall page */
+ if (current->mm->context.vdso)
+- restorer = current->mm->context.vdso +
+- selected_vdso32->sym___kernel_sigreturn;
++ restorer = (void __force_user *)(current->mm->context.vdso +
++ selected_vdso32->sym___kernel_sigreturn);
else
- restorer = &frame->retcode;
+ restorer = frame->retcode;
.long \orig - .
.long \alt - .
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
-index 0a3f9c9..c9d081d 100644
+index 473bdbe..b1e3377 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -106,7 +106,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
ALTINSTR_REPLACEMENT(newinstr2, feature2, 2) \
".popsection"
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
-index 19b0eba..12254cd 100644
+index 465b309..ab7e51f 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -45,7 +45,7 @@ static inline void generic_apic_probe(void)
#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
-index 5c7198c..44180b5 100644
+index 0f4460b..fa1ee19 100644
--- a/arch/x86/include/asm/barrier.h
+++ b/arch/x86/include/asm/barrier.h
@@ -107,7 +107,7 @@
#define smp_load_acquire(p) \
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
-index afcd35d..141b32d 100644
+index cfe3b95..d01b118 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -50,7 +50,7 @@
clac();
return ret;
diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
-index d47786a..2d8883e 100644
+index 99c105d7..2f667ac 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)
+@@ -16,8 +16,12 @@ extern void __cmpxchg_wrong_size(void)
__compiletime_error("Bad argument size for cmpxchg");
extern void __xadd_wrong_size(void)
__compiletime_error("Bad argument size for xadd");
/*
* Constants for operation sizes. On 32-bit, the 64-bit size it set to
-@@ -67,6 +71,38 @@ extern void __add_wrong_size(void)
+@@ -69,6 +73,38 @@ extern void __add_wrong_size(void)
__ret; \
})
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 e265ff9..72c253b 100644
+index bb9b258..5fad1bf 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
-@@ -203,7 +203,7 @@
- #define X86_FEATURE_DECODEASSISTS (8*32+12) /* AMD Decode Assists support */
- #define X86_FEATURE_PAUSEFILTER (8*32+13) /* AMD filtered pause intercept */
- #define X86_FEATURE_PFTHRESHOLD (8*32+14) /* AMD pause filter threshold */
+@@ -203,14 +203,14 @@
+ #define X86_FEATURE_PAUSEFILTER ( 8*32+13) /* AMD filtered pause intercept */
+ #define X86_FEATURE_PFTHRESHOLD ( 8*32+14) /* AMD pause filter threshold */
+
-
+#define X86_FEATURE_STRONGUDEREF (8*32+31) /* PaX PCID based strong UDEREF */
-
/* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */
- #define X86_FEATURE_FSGSBASE (9*32+ 0) /* {RD/WR}{FS/GS}BASE instructions*/
-@@ -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 */
--#define X86_FEATURE_SMEP (9*32+ 7) /* Supervisor Mode Execution Protection */
-+#define X86_FEATURE_SMEP (9*32+ 7) /* Supervisor Mode Execution Prevention */
- #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 */
-@@ -359,6 +359,7 @@ extern const char * const x86_power_flags[32];
+ #define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* {RD/WR}{FS/GS}BASE instructions*/
+ #define X86_FEATURE_TSC_ADJUST ( 9*32+ 1) /* TSC adjustment MSR 0x3b */
+ #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 */
+-#define X86_FEATURE_SMEP ( 9*32+ 7) /* Supervisor Mode Execution Protection */
++#define X86_FEATURE_SMEP ( 9*32+ 7) /* Supervisor Mode Execution Prevention */
+ #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 */
+@@ -370,6 +370,7 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
#undef cpu_has_centaur_mcr
#define cpu_has_centaur_mcr 0
#endif /* CONFIG_X86_64 */
#if __GNUC__ >= 4
-@@ -411,7 +412,8 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
+@@ -422,7 +423,8 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
#ifdef CONFIG_X86_DEBUG_STATIC_CPU_HAS
t_warn:
return false;
#endif
-@@ -431,7 +433,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
+@@ -442,7 +444,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"
"3: movb $1,%0\n"
"4:\n"
".previous\n"
-@@ -468,7 +470,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -479,7 +481,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
" .byte 2b - 1b\n" /* src len */
" .byte 4f - 3f\n" /* repl len */
".previous\n"
"3: .byte 0xe9\n .long %l[t_no] - 2b\n"
"4:\n"
".previous\n"
-@@ -501,7 +503,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -512,7 +514,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
".section .discard,\"aw\",@progbits\n"
" .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */
".previous\n"
"3: movb $0,%0\n"
"4:\n"
".previous\n"
-@@ -515,7 +517,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
+@@ -526,7 +528,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
".section .discard,\"aw\",@progbits\n"
" .byte 0xff + (6f-5f) - (4b-3b)\n" /* size check */
".previous\n"
union {
u64 v64;
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
-index 1a055c8..a1701de 100644
+index 1a055c8..1a5082a 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -75,9 +75,6 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
#if defined(CONFIG_X86_32) || defined(CONFIG_COMPAT)
extern unsigned int vdso32_enabled;
#endif
-@@ -248,7 +245,25 @@ extern int force_personality32;
+@@ -160,8 +157,9 @@ do { \
+ #define elf_check_arch(x) \
+ ((x)->e_machine == EM_X86_64)
+
+-#define compat_elf_check_arch(x) \
+- (elf_check_arch_ia32(x) || (x)->e_machine == EM_X86_64)
++#define compat_elf_check_arch(x) \
++ (elf_check_arch_ia32(x) || \
++ (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
+
+ #if __USER32_DS != __USER_DS
+ # error "The following code assumes __USER32_DS == __USER_DS"
+@@ -248,7 +246,25 @@ extern int force_personality32;
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */
/* This yields a mask that user programs can use to figure out what
instruction set this CPU supports. This could be done in user space,
-@@ -297,17 +312,13 @@ do { \
+@@ -297,17 +313,13 @@ do { \
#define ARCH_DLINFO \
do { \
} while (0)
#define AT_SYSINFO 32
-@@ -322,10 +333,10 @@ else \
+@@ -322,10 +334,10 @@ else \
#endif /* !CONFIG_X86_32 */
selected_vdso32->sym___kernel_vsyscall)
struct linux_binprm;
-@@ -337,9 +348,6 @@ extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
+@@ -337,9 +349,6 @@ extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
int uses_interp);
#define compat_arch_setup_additional_pages compat_arch_setup_additional_pages
};
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h
-index 115e368..76ecf6c 100644
+index 412ecec..c1ea43a 100644
--- a/arch/x86/include/asm/fpu-internal.h
+++ b/arch/x86/include/asm/fpu-internal.h
@@ -124,8 +124,11 @@ static inline void sanitize_i387_state(struct task_struct *tsk)
/* EISA */
extern void eisa_set_level_irq(unsigned int irq);
diff --git a/arch/x86/include/asm/i8259.h b/arch/x86/include/asm/i8259.h
-index a203659..9889f1c 100644
+index ccffa53..3c90c87 100644
--- a/arch/x86/include/asm/i8259.h
+++ b/arch/x86/include/asm/i8259.h
@@ -62,7 +62,7 @@ struct legacy_pic {
#define flush_insn_slot(p) do { } while (0)
+diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
+index 7c492ed..d16311f 100644
+--- a/arch/x86/include/asm/kvm_host.h
++++ b/arch/x86/include/asm/kvm_host.h
+@@ -990,6 +990,20 @@ static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code)
+ kvm_queue_exception_e(vcpu, GP_VECTOR, error_code);
+ }
+
++static inline u64 get_canonical(u64 la)
++{
++ return ((int64_t)la << 16) >> 16;
++}
++
++static inline bool is_noncanonical_address(u64 la)
++{
++#ifdef CONFIG_X86_64
++ return get_canonical(la) != la;
++#else
++ return false;
++#endif
++}
++
+ #define TSS_IOPB_BASE_OFFSET 0x66
+ #define TSS_BASE_SIZE 0x68
+ #define TSS_IOPB_SIZE (65536 / 8)
+@@ -1048,7 +1062,7 @@ int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
+ void kvm_vcpu_reset(struct kvm_vcpu *vcpu);
+
+ void kvm_define_shared_msr(unsigned index, u32 msr);
+-void kvm_set_shared_msr(unsigned index, u64 val, u64 mask);
++int kvm_set_shared_msr(unsigned index, u64 val, u64 mask);
+
+ bool kvm_is_linear_rip(struct kvm_vcpu *vcpu, unsigned long linear_rip);
+
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
index 4ad6560..75c7bdd 100644
--- a/arch/x86/include/asm/local.h
#ifdef CONFIG_SMP
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
-index be12c53..07fd3ca 100644
+index 166af2a..648c200 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
-@@ -24,6 +24,20 @@ void destroy_context(struct mm_struct *mm);
+@@ -28,6 +28,20 @@ void destroy_context(struct mm_struct *mm);
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
#ifdef CONFIG_SMP
if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK)
this_cpu_write(cpu_tlbstate.state, TLBSTATE_LAZY);
-@@ -34,16 +48,59 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
+@@ -38,16 +52,59 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
{
unsigned cpu = smp_processor_id();
+#else
load_cr3(next->pgd);
+#endif
+ trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
/* Stop flush ipis for the previous mm */
- cpumask_clear_cpu(cpu, mm_cpumask(prev));
-@@ -51,9 +108,67 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
+@@ -56,9 +113,67 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
/* Load the LDT, if the LDT is different: */
if (unlikely(prev->context.ldt != next->context.ldt))
load_LDT_nolock(&next->context);
this_cpu_write(cpu_tlbstate.state, TLBSTATE_OK);
BUG_ON(this_cpu_read(cpu_tlbstate.active_mm) != next);
-@@ -70,11 +185,28 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
+@@ -75,12 +190,29 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
* tlb flush IPI delivery. We must reload CR3
* to make sure to use no freed page tables.
*/
+
+#ifndef CONFIG_PAX_PER_CPU_PGD
load_cr3(next->pgd);
+ trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
+#endif
+
load_LDT_nolock(&next->context);
void unregister_nmi_handler(unsigned int, const char *);
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
-index 775873d..04cd306 100644
+index 802dde3..9183e68 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -52,6 +52,7 @@ static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
#include <asm-generic/memory_model.h>
diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
-index 0f1ddee..e2fc3d1 100644
+index f408caf..4a0455e 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -7,9 +7,9 @@
/*
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
-index aa97a07..f169e5b 100644
+index aa97a07..5c53c32 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -46,6 +46,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
#define pgd_clear(pgd) native_pgd_clear(pgd)
#endif
-@@ -83,12 +84,51 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
+@@ -83,12 +84,53 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
#define arch_end_context_switch(prev) do {} while(0)
+ cr0 = read_cr0() ^ X86_CR0_WP;
+ BUG_ON(cr0 & X86_CR0_WP);
+ write_cr0(cr0);
++ barrier();
+ return cr0 ^ X86_CR0_WP;
+}
+
+{
+ unsigned long cr0;
+
++ barrier();
+ cr0 = read_cr0() ^ X86_CR0_WP;
+ BUG_ON(!(cr0 & X86_CR0_WP));
+ write_cr0(cr0);
static inline int pte_dirty(pte_t pte)
{
return pte_flags(pte) & _PAGE_DIRTY;
-@@ -155,6 +195,11 @@ static inline unsigned long pud_pfn(pud_t pud)
+@@ -155,6 +197,11 @@ static inline unsigned long pud_pfn(pud_t pud)
return (pud_val(pud) & PTE_PFN_MASK) >> PAGE_SHIFT;
}
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
static inline int pmd_large(pmd_t pte)
-@@ -208,9 +253,29 @@ static inline pte_t pte_wrprotect(pte_t pte)
+@@ -208,9 +255,29 @@ static inline pte_t pte_wrprotect(pte_t pte)
return pte_clear_flags(pte, _PAGE_RW);
}
}
static inline pte_t pte_mkdirty(pte_t pte)
-@@ -440,6 +505,16 @@ pte_t *populate_extra_pte(unsigned long vaddr);
+@@ -440,6 +507,16 @@ pte_t *populate_extra_pte(unsigned long vaddr);
#endif
#ifndef __ASSEMBLY__
#include <linux/mm_types.h>
#include <linux/mmdebug.h>
#include <linux/log2.h>
-@@ -586,7 +661,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
+@@ -586,7 +663,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
* Currently stuck as a macro due to indirect forward reference to
* linux/mmzone.h's __section_mem_map_addr() definition:
*/
/* Find an entry in the second-level page table.. */
static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
-@@ -626,7 +701,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
+@@ -626,7 +703,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
* Currently stuck as a macro due to indirect forward reference to
* linux/mmzone.h's __section_mem_map_addr() definition:
*/
/* to find an entry in a page-table-directory. */
static inline unsigned long pud_index(unsigned long address)
-@@ -641,7 +716,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
+@@ -641,7 +718,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
static inline int pgd_bad(pgd_t pgd)
{
}
static inline int pgd_none(pgd_t pgd)
-@@ -664,7 +739,12 @@ static inline int pgd_none(pgd_t pgd)
+@@ -664,7 +741,12 @@ static inline int pgd_none(pgd_t pgd)
* pgd_offset() returns a (pgd_t *)
* pgd_index() is used get the offset into the pgd page's array of pgd_t's;
*/
/*
* a shortcut which implies the use of the kernel's pgd, instead
* of a process's
-@@ -675,6 +755,23 @@ static inline int pgd_none(pgd_t pgd)
+@@ -675,6 +757,23 @@ static inline int pgd_none(pgd_t pgd)
#define KERNEL_PGD_BOUNDARY pgd_index(PAGE_OFFSET)
#define KERNEL_PGD_PTRS (PTRS_PER_PGD - KERNEL_PGD_BOUNDARY)
#ifndef __ASSEMBLY__
extern int direct_gbpages;
-@@ -841,11 +938,24 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
+@@ -841,11 +940,24 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
* dst and src can be on the same page, but the range must not overlap,
* and must not cross a page boundary.
*/
#define MODULES_END VMALLOC_END
#define MODULES_LEN (MODULES_VADDR - MODULES_END)
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
-index 5be9063..d62185b 100644
+index 3874693..d7906ac 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
-@@ -16,10 +16,14 @@
+@@ -16,11 +16,16 @@
extern pud_t level3_kernel_pgt[512];
extern pud_t level3_ident_pgt[512];
extern pmd_t level2_kernel_pgt[512];
extern pmd_t level2_fixmap_pgt[512];
-extern pmd_t level2_ident_pgt[512];
--extern pgd_t init_level4_pgt[];
+extern pmd_t level2_ident_pgt[512*2];
+ extern pte_t level1_fixmap_pgt[512];
+-extern pgd_t init_level4_pgt[];
++extern pte_t level1_vsyscall_pgt[512];
+extern pgd_t init_level4_pgt[512];
#define swapper_pg_dir init_level4_pgt
-@@ -61,7 +65,9 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
+@@ -62,7 +67,9 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
{
}
static inline void native_pmd_clear(pmd_t *pmd)
-@@ -97,7 +103,9 @@ static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp)
+@@ -98,7 +105,9 @@ static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp)
static inline void native_set_pud(pud_t *pudp, pud_t pud)
{
}
static inline void native_pud_clear(pud_t *pud)
-@@ -107,6 +115,13 @@ static inline void native_pud_clear(pud_t *pud)
+@@ -108,6 +117,13 @@ static inline void native_pud_clear(pud_t *pud)
static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd)
{
/*
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
-index a4ea023..33aa874 100644
+index eb71ec7..f06532a 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
-@@ -128,7 +128,7 @@ struct cpuinfo_x86 {
+@@ -127,7 +127,7 @@ struct cpuinfo_x86 {
/* Index into per_cpu list: */
u16 cpu_index;
u32 microcode;
#define X86_VENDOR_INTEL 0
#define X86_VENDOR_CYRIX 1
-@@ -199,9 +199,21 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
+@@ -198,9 +198,21 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
: "memory");
}
+#define INVPCID_SINGLE_ADDRESS 0UL
+#define INVPCID_SINGLE_CONTEXT 1UL
+#define INVPCID_ALL_GLOBAL 2UL
-+#define INVPCID_ALL_MONGLOBAL 3UL
++#define INVPCID_ALL_NONGLOBAL 3UL
+
+#define PCID_KERNEL 0UL
+#define PCID_USER 1UL
}
#ifdef CONFIG_X86_32
-@@ -283,7 +295,7 @@ struct tss_struct {
+@@ -282,7 +294,7 @@ struct tss_struct {
} ____cacheline_aligned;
/*
* Save the original ist values for checking stack pointers during debugging
-@@ -479,6 +491,7 @@ struct thread_struct {
+@@ -478,6 +490,7 @@ struct thread_struct {
unsigned short ds;
unsigned short fsindex;
unsigned short gsindex;
#endif
#ifdef CONFIG_X86_32
unsigned long ip;
-@@ -588,29 +601,8 @@ static inline void load_sp0(struct tss_struct *tss,
+@@ -587,29 +600,8 @@ static inline void load_sp0(struct tss_struct *tss,
extern unsigned long mmu_cr4_features;
extern u32 *trampoline_cr4_features;
typedef struct {
unsigned long seg;
-@@ -836,11 +828,18 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -837,11 +829,18 @@ static inline void spin_lock_prefetch(const void *x)
*/
#define TASK_SIZE PAGE_OFFSET
#define TASK_SIZE_MAX TASK_SIZE
.vm86_info = NULL, \
.sysenter_cs = __KERNEL_CS, \
.io_bitmap_ptr = NULL, \
-@@ -854,7 +853,7 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -855,7 +854,7 @@ static inline void spin_lock_prefetch(const void *x)
*/
#define INIT_TSS { \
.x86_tss = { \
.ss0 = __KERNEL_DS, \
.ss1 = __KERNEL_CS, \
.io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \
-@@ -865,11 +864,7 @@ static inline void spin_lock_prefetch(const void *x)
+@@ -866,11 +865,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))
/*
* The below -8 is to reserve 8 bytes on top of the ring0 stack.
-@@ -884,7 +879,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+@@ -885,7 +880,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define task_pt_regs(task) \
({ \
struct pt_regs *__regs__; \
__regs__ - 1; \
})
-@@ -894,13 +889,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+@@ -895,13 +890,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
/*
* User space process size. 47bits minus one guard page.
*/
#define TASK_SIZE (test_thread_flag(TIF_ADDR32) ? \
IA32_PAGE_OFFSET : TASK_SIZE_MAX)
-@@ -911,11 +906,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
+@@ -912,11 +907,11 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define STACK_TOP_MAX TASK_SIZE_MAX
#define INIT_THREAD { \
}
/*
-@@ -943,6 +938,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
+@@ -944,6 +939,10 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
*/
#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
#define KSTK_EIP(task) (task_pt_regs(task)->ip)
/* Get/set a process' ability to use the timestamp counter instruction */
-@@ -969,7 +968,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
+@@ -970,7 +969,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
return 0;
}
extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
void default_idle(void);
-@@ -979,6 +978,6 @@ bool xen_set_default_idle(void);
+@@ -980,6 +979,6 @@ bool xen_set_default_idle(void);
#define xen_set_default_idle 0
#endif
return *(unsigned long *)((unsigned long)regs + offset);
}
diff --git a/arch/x86/include/asm/qrwlock.h b/arch/x86/include/asm/qrwlock.h
-index 70f46f0..adfbdb4 100644
+index ae0e241..e80b10b 100644
--- a/arch/x86/include/asm/qrwlock.h
+++ b/arch/x86/include/asm/qrwlock.h
@@ -7,8 +7,8 @@
#endif
#endif /* _ASM_X86_THREAD_INFO_H */
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
-index 04905bf..49203ca 100644
+index 04905bf..1178cdf 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -17,18 +17,44 @@
+ u64 descriptor[2];
+
+ descriptor[0] = PCID_KERNEL;
-+ asm volatile(__ASM_INVPCID : : "d"(&descriptor), "a"(INVPCID_ALL_MONGLOBAL) : "memory");
++ asm volatile(__ASM_INVPCID : : "d"(&descriptor), "a"(INVPCID_ALL_NONGLOBAL) : "memory");
+ return;
+ }
+
unsigned long mfn;
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
-index d949ef2..479b9d1 100644
+index 7e7a79a..0824666 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
-@@ -82,8 +82,11 @@ static inline int xsave_user(struct xsave_struct __user *buf)
+@@ -228,12 +228,16 @@ static inline int xsave_user(struct xsave_struct __user *buf)
if (unlikely(err))
return -EFAULT;
+ pax_open_userland();
__asm__ __volatile__(ASM_STAC "\n"
-- "1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
+- "1:"XSAVE"\n"
+ "1:"
+ __copyuser_seg
-+ ".byte " REX_PREFIX "0x0f,0xae,0x27\n"
++ XSAVE"\n"
"2: " ASM_CLAC "\n"
- ".section .fixup,\"ax\"\n"
- "3: movl $-1,%[err]\n"
-@@ -93,18 +96,22 @@ static inline int xsave_user(struct xsave_struct __user *buf)
- : [err] "=r" (err)
+ xstate_fault
: "D" (buf), "a" (-1), "d" (-1), "0" (0)
: "memory");
+ pax_close_userland();
return err;
}
+@@ -243,16 +247,20 @@ static inline int xsave_user(struct xsave_struct __user *buf)
static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
{
- int err;
+ int err = 0;
- struct xsave_struct *xstate = ((__force struct xsave_struct *)buf);
+ struct xsave_struct *xstate = ((__force_kernel struct xsave_struct *)buf);
u32 lmask = mask;
+ pax_open_userland();
__asm__ __volatile__(ASM_STAC "\n"
-- "1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n"
+- "1:"XRSTOR"\n"
+ "1:"
+ __copyuser_seg
-+ ".byte " REX_PREFIX "0x0f,0xae,0x2f\n"
++ XRSTOR"\n"
"2: " ASM_CLAC "\n"
- ".section .fixup,\"ax\"\n"
- "3: movl $-1,%[err]\n"
-@@ -114,6 +121,7 @@ static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
- : [err] "=r" (err)
+ xstate_fault
: "D" (xstate), "a" (lmask), "d" (hmask), "0" (0)
: "memory"); /* memory required? */
+ pax_close_userland();
#endif /* __ASSEMBLY__ */
/* top of stack page */
+diff --git a/arch/x86/include/uapi/asm/vmx.h b/arch/x86/include/uapi/asm/vmx.h
+index 0e79420..990a2fe 100644
+--- a/arch/x86/include/uapi/asm/vmx.h
++++ b/arch/x86/include/uapi/asm/vmx.h
+@@ -67,6 +67,7 @@
+ #define EXIT_REASON_EPT_MISCONFIG 49
+ #define EXIT_REASON_INVEPT 50
+ #define EXIT_REASON_PREEMPTION_TIMER 52
++#define EXIT_REASON_INVVPID 53
+ #define EXIT_REASON_WBINVD 54
+ #define EXIT_REASON_XSETBV 55
+ #define EXIT_REASON_APIC_WRITE 56
+@@ -114,6 +115,7 @@
+ { EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \
+ { EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \
+ { EXIT_REASON_INVD, "INVD" }, \
++ { EXIT_REASON_INVVPID, "INVVPID" }, \
+ { EXIT_REASON_INVPCID, "INVPCID" }
+
+ #endif /* _UAPIVMX_H */
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
-index 047f9ff..4ba5ea6 100644
+index ada2e2d..ca69e16 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -24,7 +24,7 @@ obj-y += time.o ioport.o ldt.o dumpstack.o nmi.o
obj-$(CONFIG_X86_64) += mcount_64.o
obj-y += syscall_$(BITS).o vsyscall_gtod.o
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
-index 86281ff..e046fc2 100644
+index b436fc7..1ba7044 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
-@@ -1296,7 +1296,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
+@@ -1272,7 +1272,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
* If your system is blacklisted here, but you find that acpi=force
* works for you, please contact linux-acpi@vger.kernel.org
*/
/*
* Boxes that need ACPI disabled
*/
-@@ -1371,7 +1371,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
+@@ -1347,7 +1347,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
};
/* second table for DMI checks that should run after early-quirks */
bp_int3_handler = handler;
bp_int3_addr = (u8 *)addr + sizeof(int3);
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
-index ad28db7..c538b2c 100644
+index 6776027..972266c 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -201,7 +201,7 @@ int first_system_vector = 0xfe;
int pic_mode;
-@@ -2000,7 +2000,7 @@ static inline void __smp_error_interrupt(struct pt_regs *regs)
+@@ -1989,7 +1989,7 @@ static inline void __smp_error_interrupt(struct pt_regs *regs)
apic_write(APIC_ESR, 0);
v = apic_read(APIC_ESR);
ack_APIC_irq();
apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x",
smp_processor_id(), v);
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
-index 7c1b294..e71d27f 100644
+index de918c4..32eed23 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -154,7 +154,7 @@ static int flat_probe(void)
.name = "flat",
.probe = flat_probe,
.acpi_madt_oem_check = flat_acpi_madt_oem_check,
-@@ -268,7 +268,7 @@ static int physflat_probe(void)
+@@ -260,7 +260,7 @@ static int physflat_probe(void)
return 0;
}
.name = "physical flat",
.probe = physflat_probe,
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
-index 8c7c982..a225910 100644
+index b205cdb..d8503ff 100644
--- a/arch/x86/kernel/apic/apic_noop.c
+++ b/arch/x86/kernel/apic/apic_noop.c
-@@ -118,7 +118,7 @@ static void noop_apic_write(u32 reg, u32 v)
+@@ -108,7 +108,7 @@ static void noop_apic_write(u32 reg, u32 v)
WARN_ON_ONCE(cpu_has_apic && !disable_apic);
}
.probe = noop_probe,
.acpi_madt_oem_check = NULL,
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
-index e4840aa..e7d9dac 100644
+index c4a8d63..fe893ac 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
-@@ -152,7 +152,7 @@ static int probe_bigsmp(void)
+@@ -147,7 +147,7 @@ static int probe_bigsmp(void)
return dmi_bigsmp;
}
.name = "bigsmp",
.probe = probe_bigsmp,
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
-index 81e08ef..abc77e5 100644
+index 337ce5a..c8d98b4 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
-@@ -1042,7 +1042,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin,
+@@ -1230,7 +1230,7 @@ out:
}
EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
{
/* Used to the online set of cpus does not change
* during assign_irq_vector.
-@@ -1050,7 +1050,7 @@ void lock_vector_lock(void)
+@@ -1238,7 +1238,7 @@ void lock_vector_lock(void)
raw_spin_lock(&vector_lock);
}
{
raw_spin_unlock(&vector_lock);
}
-@@ -2349,7 +2349,7 @@ static void ack_apic_edge(struct irq_data *data)
+@@ -2465,7 +2465,7 @@ static void ack_apic_edge(struct irq_data *data)
ack_APIC_irq();
}
#ifdef CONFIG_GENERIC_PENDING_IRQ
static bool io_apic_level_ack_pending(struct irq_cfg *cfg)
-@@ -2490,7 +2490,7 @@ static void ack_apic_level(struct irq_data *data)
+@@ -2606,7 +2606,7 @@ static void ack_apic_level(struct irq_data *data)
* at the cpu.
*/
if (!(v & (1 << (i & 0x1f)))) {
eoi_ioapic_irq(irq, cfg);
}
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
-index cceb352..a635fd8 100644
+index bda4886..f9c7195 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -72,7 +72,7 @@ static int probe_default(void)
.name = "default",
.probe = probe_default,
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
-index e66766b..1c008ba 100644
+index 6ce600f..cb44af8 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
@@ -182,7 +182,7 @@ update_clusterinfo(struct notifier_block *nfb, unsigned long action, void *hcpu)
.name = "cluster x2apic",
.probe = x2apic_cluster_probe,
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
-index 6d600eb..0300c00 100644
+index 6fae733..5ca17af 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -88,7 +88,7 @@ static int x2apic_phys_probe(void)
.name = "physical x2apic",
.probe = x2apic_phys_probe,
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
-index 293b41d..4df25fd 100644
+index 004f017..8fbc8b5 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -350,7 +350,7 @@ static int uv_probe(void)
obj-y += proc.o capflags.o powerflags.o common.o
obj-y += rdrand.o
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
-index ce8b8ff..d7d8851 100644
+index 60e5497..8efbd2f 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
-@@ -728,7 +728,7 @@ static void init_amd(struct cpuinfo_x86 *c)
+@@ -711,7 +711,7 @@ static void init_amd(struct cpuinfo_x86 *c)
static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
{
/* AMD errata T13 (order #21922) */
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 ef1b93f..150db65 100644
+index e4ab2b4..d487ba5 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -90,60 +90,6 @@ static const struct cpu_dev default_cpu = {
static int __init x86_xsave_setup(char *s)
{
setup_clear_cpu_cap(X86_FEATURE_XSAVE);
-@@ -295,6 +241,59 @@ static __always_inline void setup_smap(struct cpuinfo_x86 *c)
+@@ -303,6 +249,59 @@ static __always_inline void setup_smap(struct cpuinfo_x86 *c)
}
}
/*
* Some CPU features depend on higher CPUID levels, which may not always
* be available due to CPUID level capping or broken virtualization
-@@ -395,7 +394,7 @@ void switch_to_new_gdt(int cpu)
+@@ -403,7 +402,7 @@ void switch_to_new_gdt(int cpu)
{
struct desc_ptr gdt_descr;
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
/* Reload the per-cpu base */
-@@ -885,6 +884,10 @@ static void identify_cpu(struct cpuinfo_x86 *c)
+@@ -893,6 +892,10 @@ static void identify_cpu(struct cpuinfo_x86 *c)
setup_smep(c);
setup_smap(c);
/*
* The vendor-specific functions might have changed features.
* Now we do "generic changes."
-@@ -893,6 +896,10 @@ static void identify_cpu(struct cpuinfo_x86 *c)
+@@ -901,6 +904,10 @@ static void identify_cpu(struct cpuinfo_x86 *c)
/* Filter out anything that depends on CPUID levels we don't have */
filter_cpuid_features(c, true);
/* If the model name is still unset, do table lookup. */
if (!c->x86_model_id[0]) {
const char *p;
-@@ -973,7 +980,7 @@ static void syscall32_cpu_init(void)
+@@ -981,7 +988,7 @@ static void syscall32_cpu_init(void)
void enable_sep_cpu(void)
{
int cpu = get_cpu();
if (!boot_cpu_has(X86_FEATURE_SEP)) {
put_cpu();
-@@ -1113,14 +1120,16 @@ static __init int setup_disablecpuid(char *arg)
+@@ -1121,14 +1128,16 @@ static __init int setup_disablecpuid(char *arg)
}
__setup("clearcpuid=", setup_disablecpuid);
DEFINE_PER_CPU_FIRST(union irq_stack_union,
irq_stack_union) __aligned(PAGE_SIZE) __visible;
-@@ -1283,7 +1292,7 @@ void cpu_init(void)
+@@ -1291,7 +1300,7 @@ void cpu_init(void)
load_ucode_ap();
cpu = stack_smp_processor_id();
oist = &per_cpu(orig_ist, cpu);
#ifdef CONFIG_NUMA
-@@ -1318,7 +1327,6 @@ void cpu_init(void)
+@@ -1326,7 +1335,6 @@ void cpu_init(void)
wrmsrl(MSR_KERNEL_GS_BASE, 0);
barrier();
enable_x2apic();
/*
-@@ -1370,7 +1378,7 @@ void cpu_init(void)
+@@ -1378,7 +1386,7 @@ void cpu_init(void)
{
int cpu = smp_processor_id();
struct task_struct *curr = current;
show_ucode_info_early();
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
-index 9c8f739..902a9c5 100644
+index c703507..28535e3 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -1026,6 +1026,22 @@ static struct attribute *default_attrs[] = {
"index%1lu", i);
if (unlikely(retval)) {
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
-index 9a79c8d..158c2f1 100644
+index bd9ccda..38314e7 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -45,6 +45,7 @@
mce_chrdev_open_exclu = 0;
spin_unlock(&mce_chrdev_state_lock);
-@@ -2414,7 +2417,7 @@ static __init void mce_init_banks(void)
+@@ -2413,7 +2416,7 @@ static __init void mce_init_banks(void)
for (i = 0; i < mca_cfg.banks; i++) {
struct mce_bank *b = &mce_banks[i];
sysfs_attr_init(&a->attr);
a->attr.name = b->attrname;
-@@ -2521,7 +2524,7 @@ struct dentry *mce_get_debugfs_dir(void)
+@@ -2520,7 +2523,7 @@ struct dentry *mce_get_debugfs_dir(void)
static void mce_reset(void)
{
cpu_missing = 0;
.attrs = NULL, /* patched at runtime */
};
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
-index ae6552a..b5be2d3 100644
+index 0939f86..69730af 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
-@@ -3694,7 +3694,7 @@ static void __init uncore_types_exit(struct intel_uncore_type **types)
+@@ -3691,7 +3691,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;
.notifier_call = cpuid_class_cpu_callback,
};
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
-index 507de80..ebaae2a 100644
+index a618fcd..200e95b 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
-@@ -58,7 +58,7 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs)
+@@ -104,7 +104,7 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs)
#ifdef CONFIG_X86_32
struct pt_regs fixed_regs;
.__cr3 = __pa_nodebug(swapper_pg_dir),
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
-index b74ebc7..6dbb0c5 100644
+index b74ebc7..2c95874 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -2,6 +2,9 @@
#include <linux/kallsyms.h>
#include <linux/kprobes.h>
#include <linux/uaccess.h>
-@@ -40,16 +43,14 @@ void printk_address(unsigned long address)
+@@ -33,23 +36,21 @@ static void printk_stack_address(unsigned long address, int reliable)
+
+ void printk_address(unsigned long address)
+ {
+- pr_cont(" [<%p>] %pS\n", (void *)address, (void *)address);
++ pr_cont(" [<%p>] %pA\n", (void *)address, (void *)address);
+ }
+
+ #ifdef CONFIG_FUNCTION_GRAPH_TRACER
static void
print_ftrace_graph_addr(unsigned long addr, void *data,
const struct stacktrace_ops *ops,
#include <asm/processor.h>
#include <asm/fcntl.h>
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
-index 0d0c9d4..f65b4f6 100644
+index 4b0e1df..884b67e 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -177,13 +177,153 @@
sysenter_badsys:
movl $-ENOSYS,%eax
jmp sysenter_after_call
--END(syscall_badsys)
+-END(sysenter_badsys)
+ENDPROC(sysenter_badsys)
CFI_ENDPROC
.macro FIXUP_ESPFIX_STACK
-@@ -696,8 +928,15 @@ END(syscall_badsys)
+@@ -696,8 +928,15 @@ END(sysenter_badsys)
*/
#ifdef CONFIG_X86_ESPFIX32
/* fixup the stack */
+ENDPROC(mcount)
ENTRY(ftrace_caller)
- cmpl $0, function_trace_stop
-@@ -1089,7 +1328,7 @@ ftrace_graph_call:
+ pushl %eax
+@@ -1086,7 +1325,7 @@ ftrace_graph_call:
.globl ftrace_stub
ftrace_stub:
ret
ENTRY(ftrace_regs_caller)
pushf /* push flags before compare (in cs location) */
-@@ -1193,7 +1432,7 @@ trace:
+@@ -1184,7 +1423,7 @@ trace:
popl %ecx
popl %eax
jmp ftrace_stub
#endif /* CONFIG_DYNAMIC_FTRACE */
#endif /* CONFIG_FUNCTION_TRACER */
-@@ -1211,7 +1450,7 @@ ENTRY(ftrace_graph_caller)
+@@ -1202,7 +1441,7 @@ ENTRY(ftrace_graph_caller)
popl %ecx
popl %eax
ret
.globl return_to_handler
return_to_handler:
-@@ -1272,15 +1511,18 @@ error_code:
+@@ -1263,15 +1502,18 @@ error_code:
movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
REG_TO_PTGS %ecx
SET_KERNEL_GS %ecx
/*
* Debug traps and NMI can happen at the one SYSENTER instruction
-@@ -1323,7 +1565,7 @@ debug_stack_correct:
+@@ -1314,7 +1556,7 @@ debug_stack_correct:
call do_debug
jmp ret_from_exception
CFI_ENDPROC
/*
* NMI is doubly nasty. It can happen _while_ we're handling
-@@ -1363,6 +1605,9 @@ nmi_stack_correct:
+@@ -1354,6 +1596,9 @@ nmi_stack_correct:
xorl %edx,%edx # zero error code
movl %esp,%eax # pt_regs pointer
call do_nmi
jmp restore_all_notrace
CFI_ENDPROC
-@@ -1400,13 +1645,16 @@ nmi_espfix_stack:
+@@ -1391,13 +1636,16 @@ nmi_espfix_stack:
FIXUP_ESPFIX_STACK # %eax == %esp
xorl %edx,%edx # zero error code
call do_nmi
ENTRY(int3)
RING0_INT_FRAME
-@@ -1419,14 +1667,14 @@ ENTRY(int3)
+@@ -1410,14 +1658,14 @@ ENTRY(int3)
call do_int3
jmp ret_from_exception
CFI_ENDPROC
#ifdef CONFIG_KVM_GUEST
ENTRY(async_page_fault)
-@@ -1435,6 +1683,6 @@ ENTRY(async_page_fault)
+@@ -1426,6 +1674,6 @@ ENTRY(async_page_fault)
pushl_cfi $do_async_page_fault
jmp error_code
CFI_ENDPROC
#endif
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
-index c844f08..b07ea0e 100644
+index 2fac134..b020fca 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -59,6 +59,8 @@
/*
* initial frame state for interrupts (and exceptions without error code)
*/
-@@ -242,25 +647,26 @@ ENDPROC(native_usergs_sysret64)
+@@ -241,25 +646,26 @@ ENDPROC(native_usergs_sysret64)
/* save partial stack frame */
.macro SAVE_ARGS_IRQ
cld
je 1f
SWAPGS
/*
-@@ -280,6 +686,18 @@ ENDPROC(native_usergs_sysret64)
+@@ -279,6 +685,18 @@ ENDPROC(native_usergs_sysret64)
0x06 /* DW_OP_deref */, \
0x08 /* DW_OP_const1u */, SS+8-RBP, \
0x22 /* DW_OP_plus */
/* We entered an interrupt context - irqs are off: */
TRACE_IRQS_OFF
.endm
-@@ -309,9 +727,52 @@ ENTRY(save_paranoid)
+@@ -308,9 +726,52 @@ ENTRY(save_paranoid)
js 1f /* negative -> in kernel */
SWAPGS
xorl %ebx,%ebx
/*
* A newly forked process directly context switches into this address.
-@@ -332,7 +793,7 @@ ENTRY(ret_from_fork)
+@@ -331,7 +792,7 @@ ENTRY(ret_from_fork)
RESTORE_REST
jz 1f
testl $_TIF_IA32, TI_flags(%rcx) # 32-bit compat task needs IRET
-@@ -342,15 +803,13 @@ ENTRY(ret_from_fork)
+@@ -341,15 +802,13 @@ ENTRY(ret_from_fork)
jmp ret_from_sys_call # go to the SYSRET fastpath
1:
/*
* System call entry. Up to 6 arguments in registers are supported.
-@@ -387,7 +846,7 @@ END(ret_from_fork)
+@@ -386,7 +845,7 @@ END(ret_from_fork)
ENTRY(system_call)
CFI_STARTPROC simple
CFI_SIGNAL_FRAME
CFI_REGISTER rip,rcx
/*CFI_REGISTER rflags,r11*/
SWAPGS_UNSAFE_STACK
-@@ -400,16 +859,23 @@ GLOBAL(system_call_after_swapgs)
+@@ -399,16 +858,23 @@ GLOBAL(system_call_after_swapgs)
movq %rsp,PER_CPU_VAR(old_rsp)
movq PER_CPU_VAR(kernel_stack),%rsp
jnz tracesys
system_call_fastpath:
#if __SYSCALL_MASK == ~0
-@@ -433,10 +899,13 @@ sysret_check:
+@@ -432,10 +898,13 @@ sysret_check:
LOCKDEP_SYS_EXIT
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
/*
* sysretq will re-enable interrupts:
*/
-@@ -495,6 +964,9 @@ auditsys:
+@@ -494,6 +963,9 @@ auditsys:
movq %rax,%rsi /* 2nd arg: syscall number */
movl $AUDIT_ARCH_X86_64,%edi /* 1st arg: audit arch */
call __audit_syscall_entry
LOAD_ARGS 0 /* reload call-clobbered registers */
jmp system_call_fastpath
-@@ -516,7 +988,7 @@ sysret_audit:
+@@ -515,7 +987,7 @@ sysret_audit:
/* Do syscall tracing */
tracesys:
#ifdef CONFIG_AUDITSYSCALL
jz auditsys
#endif
SAVE_REST
-@@ -524,12 +996,15 @@ tracesys:
+@@ -523,12 +995,15 @@ tracesys:
FIXUP_TOP_OF_STACK %rdi
movq %rsp,%rdi
call syscall_trace_enter
RESTORE_REST
#if __SYSCALL_MASK == ~0
cmpq $__NR_syscall_max,%rax
-@@ -559,7 +1034,9 @@ GLOBAL(int_with_check)
+@@ -558,7 +1033,9 @@ GLOBAL(int_with_check)
andl %edi,%edx
jnz int_careful
andl $~TS_COMPAT,TI_status(%rcx)
/* Either reschedule or signal or syscall exit tracking needed. */
/* First do a reschedule test. */
-@@ -605,7 +1082,7 @@ int_restore_rest:
+@@ -604,7 +1081,7 @@ int_restore_rest:
TRACE_IRQS_OFF
jmp int_with_check
CFI_ENDPROC
.macro FORK_LIKE func
ENTRY(stub_\func)
-@@ -618,9 +1095,10 @@ ENTRY(stub_\func)
+@@ -617,9 +1094,10 @@ ENTRY(stub_\func)
DEFAULT_FRAME 0 8 /* offset 8: return address */
call sys_\func
RESTORE_TOP_OF_STACK %r11, 8
.endm
.macro FIXED_FRAME label,func
-@@ -630,9 +1108,10 @@ ENTRY(\label)
+@@ -629,9 +1107,10 @@ ENTRY(\label)
FIXUP_TOP_OF_STACK %r11, 8-ARGOFFSET
call \func
RESTORE_TOP_OF_STACK %r11, 8-ARGOFFSET
.endm
FORK_LIKE clone
-@@ -640,19 +1119,6 @@ END(\label)
+@@ -639,19 +1118,6 @@ END(\label)
FORK_LIKE vfork
FIXED_FRAME stub_iopl, sys_iopl
ENTRY(stub_execve)
CFI_STARTPROC
addq $8, %rsp
-@@ -664,7 +1130,7 @@ ENTRY(stub_execve)
+@@ -663,7 +1129,7 @@ ENTRY(stub_execve)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
/*
* sigreturn is special because it needs to restore all registers on return.
-@@ -681,7 +1147,7 @@ ENTRY(stub_rt_sigreturn)
+@@ -680,7 +1146,7 @@ ENTRY(stub_rt_sigreturn)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
#ifdef CONFIG_X86_X32_ABI
ENTRY(stub_x32_rt_sigreturn)
-@@ -695,7 +1161,7 @@ ENTRY(stub_x32_rt_sigreturn)
+@@ -694,7 +1160,7 @@ ENTRY(stub_x32_rt_sigreturn)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
ENTRY(stub_x32_execve)
CFI_STARTPROC
-@@ -709,7 +1175,7 @@ ENTRY(stub_x32_execve)
+@@ -708,7 +1174,7 @@ ENTRY(stub_x32_execve)
RESTORE_REST
jmp int_ret_from_sys_call
CFI_ENDPROC
#endif
-@@ -746,7 +1212,7 @@ vector=vector+1
+@@ -745,7 +1211,7 @@ vector=vector+1
2: jmp common_interrupt
.endr
CFI_ENDPROC
.previous
END(interrupt)
-@@ -763,8 +1229,8 @@ END(interrupt)
+@@ -762,8 +1228,8 @@ END(interrupt)
/* 0(%rsp): ~(interrupt number) */
.macro interrupt func
/* reserve pt_regs for scratch regs and rbp */
SAVE_ARGS_IRQ
call \func
.endm
-@@ -787,14 +1253,14 @@ ret_from_intr:
+@@ -786,14 +1252,14 @@ ret_from_intr:
/* Restore saved previous stack */
popq %rsi
je retint_kernel
/* Interrupt came from user space */
-@@ -816,12 +1282,16 @@ retint_swapgs: /* return to user-space */
+@@ -815,12 +1281,35 @@ retint_swapgs: /* return to user-space */
* The iretq could re-enable interrupts:
*/
DISABLE_INTERRUPTS(CLBR_ANY)
retint_restore_args: /* return to kernel space */
DISABLE_INTERRUPTS(CLBR_ANY)
+ pax_exit_kernel
++
++#if defined(CONFIG_EFI) && defined(CONFIG_PAX_KERNEXEC)
++ /* This is a quirk to allow IRQs/NMIs/MCEs during early EFI setup,
++ * namely calling EFI runtime services with a phys mapping. We're
++ * starting off with NOPs and patch in the real instrumentation
++ * (BTS/OR) before starting any userland process; even before starting
++ * up the APs.
++ */
++ .pushsection .altinstr_replacement, "a"
++ 601: pax_force_retaddr (RIP-ARGOFFSET)
++ 602:
++ .popsection
++ 603: .fill 602b-601b, 1, 0x90
++ .pushsection .altinstructions, "a"
++ altinstruction_entry 603b, 601b, X86_FEATURE_ALWAYS, 602b-601b, 602b-601b
++ .popsection
++#else
+ pax_force_retaddr (RIP-ARGOFFSET)
++#endif
++
/*
* The iretq could re-enable interrupts:
*/
-@@ -934,7 +1404,7 @@ ENTRY(retint_kernel)
+@@ -933,7 +1422,7 @@ ENTRY(retint_kernel)
jmp exit_intr
#endif
CFI_ENDPROC
/*
* If IRET takes a fault on the espfix stack, then we
-@@ -956,13 +1426,13 @@ __do_double_fault:
+@@ -955,13 +1444,13 @@ __do_double_fault:
cmpq $native_irq_return_iret,%rax
jne do_double_fault /* This shouldn't happen... */
movq PER_CPU_VAR(kernel_stack),%rax
#else
# define __do_double_fault do_double_fault
#endif
-@@ -979,7 +1449,7 @@ ENTRY(\sym)
+@@ -978,7 +1467,7 @@ ENTRY(\sym)
interrupt \do_sym
jmp ret_from_intr
CFI_ENDPROC
.endm
#ifdef CONFIG_TRACING
-@@ -1052,7 +1522,7 @@ apicinterrupt IRQ_WORK_VECTOR \
+@@ -1051,7 +1540,7 @@ apicinterrupt IRQ_WORK_VECTOR \
/*
* Exception entry points.
*/
.macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
ENTRY(\sym)
-@@ -1103,6 +1573,12 @@ ENTRY(\sym)
+@@ -1102,6 +1591,12 @@ ENTRY(\sym)
.endif
.if \shift_ist != -1
subq $EXCEPTION_STKSZ, INIT_TSS_IST(\shift_ist)
.endif
-@@ -1119,7 +1595,7 @@ ENTRY(\sym)
+@@ -1118,7 +1613,7 @@ ENTRY(\sym)
.endif
CFI_ENDPROC
.endm
#ifdef CONFIG_TRACING
-@@ -1160,9 +1636,10 @@ gs_change:
+@@ -1159,9 +1654,10 @@ gs_change:
2: mfence /* workaround */
SWAPGS
popfq_cfi
_ASM_EXTABLE(gs_change,bad_gs)
.section .fixup,"ax"
-@@ -1190,9 +1667,10 @@ ENTRY(do_softirq_own_stack)
+@@ -1189,9 +1685,10 @@ ENTRY(do_softirq_own_stack)
CFI_DEF_CFA_REGISTER rsp
CFI_ADJUST_CFA_OFFSET -8
decl PER_CPU_VAR(irq_count)
#ifdef CONFIG_XEN
idtentry xen_hypervisor_callback xen_do_hypervisor_callback has_error_code=0
-@@ -1230,7 +1708,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
+@@ -1229,7 +1726,7 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
decl PER_CPU_VAR(irq_count)
jmp error_exit
CFI_ENDPROC
/*
* Hypervisor uses this for application faults while it executes.
-@@ -1289,7 +1767,7 @@ ENTRY(xen_failsafe_callback)
+@@ -1288,7 +1785,7 @@ ENTRY(xen_failsafe_callback)
SAVE_ALL
jmp error_exit
CFI_ENDPROC
apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
xen_hvm_callback_vector xen_evtchn_do_upcall
-@@ -1336,18 +1814,33 @@ ENTRY(paranoid_exit)
+@@ -1335,18 +1832,33 @@ ENTRY(paranoid_exit)
DEFAULT_FRAME
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF_DEBUG
jmp irq_return
paranoid_userspace:
GET_THREAD_INFO(%rcx)
-@@ -1376,7 +1869,7 @@ paranoid_schedule:
+@@ -1375,7 +1887,7 @@ paranoid_schedule:
TRACE_IRQS_OFF
jmp paranoid_userspace
CFI_ENDPROC
/*
* Exception entry point. This expects an error code/orig_rax on the stack.
-@@ -1403,12 +1896,23 @@ ENTRY(error_entry)
- movq_cfi r14, R14+8
- movq_cfi r15, R15+8
+@@ -1402,12 +1914,23 @@ ENTRY(error_entry)
+ movq %r14, R14+8(%rsp)
+ movq %r15, R15+8(%rsp)
xorl %ebx,%ebx
- testl $3,CS+8(%rsp)
+ testb $3,CS+8(%rsp)
ret
/*
-@@ -1435,7 +1939,7 @@ bstep_iret:
+@@ -1435,7 +1958,7 @@ bstep_iret:
movq %rcx,RIP+8(%rsp)
jmp error_swapgs
CFI_ENDPROC
/* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */
-@@ -1446,7 +1950,7 @@ ENTRY(error_exit)
+@@ -1446,7 +1969,7 @@ ENTRY(error_exit)
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
GET_THREAD_INFO(%rcx)
jne retint_kernel
LOCKDEP_SYS_EXIT_IRQ
movl TI_flags(%rcx),%edx
-@@ -1455,7 +1959,7 @@ ENTRY(error_exit)
+@@ -1455,7 +1978,7 @@ ENTRY(error_exit)
jnz retint_careful
jmp retint_swapgs
CFI_ENDPROC
/*
* Test if a given stack is an NMI stack or not.
-@@ -1513,9 +2017,11 @@ ENTRY(nmi)
+@@ -1513,9 +2036,11 @@ ENTRY(nmi)
* If %cs was not the kernel segment, then the NMI triggered in user
* space, which means it is definitely not nested.
*/
/*
* Check the special variable on the stack to see if NMIs are
* executing.
-@@ -1549,8 +2055,7 @@ nested_nmi:
+@@ -1549,8 +2074,7 @@ nested_nmi:
1:
/* Set up the interrupted NMIs stack to jump to repeat_nmi */
CFI_ADJUST_CFA_OFFSET 1*8
leaq -10*8(%rsp), %rdx
pushq_cfi $__KERNEL_DS
-@@ -1568,6 +2073,7 @@ nested_nmi_out:
+@@ -1568,6 +2092,7 @@ nested_nmi_out:
CFI_RESTORE rdx
/* No need to check faults here */
INTERRUPT_RETURN
CFI_RESTORE_STATE
-@@ -1664,13 +2170,13 @@ end_repeat_nmi:
+@@ -1664,13 +2189,13 @@ end_repeat_nmi:
subq $ORIG_RAX-R15, %rsp
CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
/*
DEFAULT_FRAME 0
/*
-@@ -1680,9 +2186,9 @@ end_repeat_nmi:
+@@ -1680,9 +2205,9 @@ end_repeat_nmi:
* NMI itself takes a page fault, the page fault that was preempted
* will read the information from the NMI page fault and not the
* origin fault. Save it off and restore it if it changes.
/* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
movq %rsp,%rdi
-@@ -1691,29 +2197,34 @@ end_repeat_nmi:
+@@ -1691,29 +2216,34 @@ end_repeat_nmi:
/* Did the NMI take a page fault? Restore cr2 if it did */
movq %cr2, %rcx
unlock_done:
mutex_unlock(&espfix_init_mutex);
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
-index cbc4a91..b38ee45 100644
+index 3386dc9..28bdf81 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -88,7 +88,7 @@ static unsigned long text_ip_addr(unsigned long ip)
+ .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 a468c0a..c7dec74 100644
+index a468c0a..8b5a879 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -20,6 +20,8 @@
/*
* Set up the identity mapping for the switchover. These
-@@ -177,8 +198,8 @@ ENTRY(secondary_startup_64)
+@@ -174,11 +195,12 @@ ENTRY(secondary_startup_64)
+ * after the boot processor executes this code.
+ */
+
++ orq $-1, %rbp
movq $(init_level4_pgt - __START_KERNEL_map), %rax
1:
movq %rcx, %cr4
/* Setup early boot stage 4 level pagetables. */
-@@ -199,10 +220,19 @@ ENTRY(secondary_startup_64)
+@@ -199,10 +221,19 @@ ENTRY(secondary_startup_64)
movl $MSR_EFER, %ecx
rdmsr
btsl $_EFER_SCE, %eax /* Enable System Call */
+ btl $(X86_FEATURE_NX & 31),%edi /* No Execute supported? */
jnc 1f
btsl $_EFER_NX, %eax
++ cmpq $-1, %rbp
++ je 1f
btsq $_PAGE_BIT_NX,early_pmd_flags(%rip)
-+#ifndef CONFIG_EFI
+ btsq $_PAGE_BIT_NX, init_level4_pgt + 8*L4_PAGE_OFFSET(%rip)
-+#endif
+ btsq $_PAGE_BIT_NX, init_level4_pgt + 8*L4_VMALLOC_START(%rip)
+ btsq $_PAGE_BIT_NX, init_level4_pgt + 8*L4_VMALLOC_END(%rip)
+ btsq $_PAGE_BIT_NX, init_level4_pgt + 8*L4_VMEMMAP_START(%rip)
1: wrmsr /* Make changes effective */
/* Setup cr0 */
-@@ -282,6 +312,7 @@ ENTRY(secondary_startup_64)
+@@ -282,6 +313,7 @@ ENTRY(secondary_startup_64)
* REX.W + FF /5 JMP m16:64 Jump far, absolute indirect,
* address given in m16:64.
*/
movq initial_code(%rip),%rax
pushq $0 # fake return address to stop unwinder
pushq $__KERNEL_CS # set correct cs
-@@ -313,7 +344,7 @@ ENDPROC(start_cpu0)
+@@ -313,7 +345,7 @@ ENDPROC(start_cpu0)
.quad INIT_PER_CPU_VAR(irq_stack_union)
GLOBAL(stack_start)
.word 0
__FINITDATA
-@@ -391,7 +422,7 @@ ENTRY(early_idt_handler)
+@@ -391,7 +423,7 @@ ENTRY(early_idt_handler)
call dump_stack
#ifdef CONFIG_KALLSYMS
leaq early_idt_ripmsg(%rip),%rdi
call __print_symbol
#endif
#endif /* EARLY_PRINTK */
-@@ -420,6 +451,7 @@ ENDPROC(early_idt_handler)
+@@ -420,6 +452,7 @@ ENDPROC(early_idt_handler)
early_recursion_flag:
.long 0
#ifdef CONFIG_EARLY_PRINTK
early_idt_msg:
.asciz "PANIC: early exception %02lx rip %lx:%lx error %lx cr2 %lx\n"
-@@ -447,29 +479,52 @@ NEXT_PAGE(early_level4_pgt)
+@@ -447,29 +480,52 @@ NEXT_PAGE(early_level4_pgt)
NEXT_PAGE(early_dynamic_pgts)
.fill 512*EARLY_DYNAMIC_PAGE_TABLES,8,0
NEXT_PAGE(level3_kernel_pgt)
.fill L3_START_KERNEL,8,0
-@@ -477,6 +532,9 @@ NEXT_PAGE(level3_kernel_pgt)
+@@ -477,6 +533,9 @@ NEXT_PAGE(level3_kernel_pgt)
.quad level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE
.quad level2_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE
NEXT_PAGE(level2_kernel_pgt)
/*
* 512 MB kernel mapping. We spend a full page on this pagetable
-@@ -494,28 +552,64 @@ NEXT_PAGE(level2_kernel_pgt)
+@@ -494,28 +553,64 @@ NEXT_PAGE(level2_kernel_pgt)
NEXT_PAGE(level2_fixmap_pgt)
.fill 506,8,0
.quad level1_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE
+EXPORT_SYMBOL(cpu_pgd);
+#endif
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
-index d5dd808..b6432cf 100644
+index a9a4229..6f4d476 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -51,7 +51,7 @@ static inline bool interrupted_kernel_fpu_idle(void)
if (val == DIE_GPF) {
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c
-index f304773..551e63c 100644
+index f1314d0..15f3154 100644
--- a/arch/x86/kernel/kprobes/opt.c
+++ b/arch/x86/kernel/kprobes/opt.c
@@ -79,6 +79,7 @@ found:
*/
- rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE;
+ rel = (long)op->optinsn.insn - ktla_ktva((long)op->kp.addr) + RELATIVEJUMP_SIZE;
- if (abs(rel) > 0x7fffffff)
+ if (abs(rel) > 0x7fffffff) {
+ __arch_remove_optimized_kprobe(op, 0);
return -ERANGE;
-
-@@ -352,16 +354,18 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
+@@ -354,16 +356,18 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
op->optinsn.size = ret;
/* Copy arch-dep-instance from template */
(u8 *)op->kp.addr + op->optinsn.size);
flush_icache_range((unsigned long) buf,
-@@ -386,7 +390,7 @@ void arch_optimize_kprobes(struct list_head *oplist)
+@@ -388,7 +392,7 @@ void arch_optimize_kprobes(struct list_head *oplist)
WARN_ON(kprobe_disabled(&op->kp));
/* Backup instructions which will be replaced by jump address */
RELATIVE_ADDR_SIZE);
insn_buf[0] = RELATIVEJUMP_OPCODE;
-@@ -434,7 +438,7 @@ int setup_detour_execution(struct kprobe *p, struct pt_regs *regs, int reenter)
+@@ -436,7 +440,7 @@ int setup_detour_execution(struct kprobe *p, struct pt_regs *regs, int reenter)
/* This kprobe is really able to run optimized path. */
op = container_of(p, struct optimized_kprobe, kp);
/* Detour through copied instructions */
relocate_kernel_ptr = control_page;
page_list[PA_CONTROL_PAGE] = __pa(control_page);
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S
-index c050a01..5774072 100644
+index c73aecf..4c63630 100644
--- a/arch/x86/kernel/mcount_64.S
+++ b/arch/x86/kernel/mcount_64.S
@@ -7,7 +7,7 @@
/* skip is set if stack has been adjusted */
.macro ftrace_caller_setup skip=0
-@@ -66,8 +67,9 @@ GLOBAL(ftrace_graph_call)
+@@ -62,8 +63,9 @@ GLOBAL(ftrace_graph_call)
#endif
GLOBAL(ftrace_stub)
ENTRY(ftrace_regs_caller)
/* Save the current flags before compare (in SS location)*/
-@@ -135,7 +137,7 @@ ftrace_restore_flags:
+@@ -127,7 +129,7 @@ GLOBAL(ftrace_regs_call)
popfq
jmp ftrace_stub
#else /* ! CONFIG_DYNAMIC_FTRACE */
-@@ -156,6 +158,7 @@ ENTRY(function_hook)
+@@ -145,6 +147,7 @@ ENTRY(function_hook)
#endif
GLOBAL(ftrace_stub)
retq
trace:
-@@ -169,12 +172,13 @@ trace:
+@@ -158,12 +161,13 @@ trace:
#endif
subq $MCOUNT_INSN_SIZE, %rdi
#endif /* CONFIG_DYNAMIC_FTRACE */
#endif /* CONFIG_FUNCTION_TRACER */
-@@ -196,8 +200,9 @@ ENTRY(ftrace_graph_caller)
+@@ -185,8 +189,9 @@ ENTRY(ftrace_graph_caller)
MCOUNT_RESTORE_FRAME
GLOBAL(return_to_handler)
subq $24, %rsp
-@@ -213,5 +218,7 @@ GLOBAL(return_to_handler)
+@@ -202,5 +207,7 @@ GLOBAL(return_to_handler)
movq 8(%rsp), %rdx
movq (%rsp), %rax
addq $24, %rsp
CFI_ENDPROC
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
-index 4505e2a..ae28b0d 100644
+index f804dc9..7c62095 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -36,7 +36,8 @@
__alignof__(union thread_xstate),
- SLAB_PANIC | SLAB_NOTRACK, NULL);
+ SLAB_PANIC | SLAB_NOTRACK | SLAB_USERCOPY, NULL);
+ setup_xstate_comp();
}
- /*
-@@ -105,7 +106,7 @@ void exit_thread(void)
+@@ -106,7 +107,7 @@ void exit_thread(void)
unsigned long *bp = t->io_bitmap_ptr;
if (bp) {
t->io_bitmap_ptr = NULL;
clear_thread_flag(TIF_IO_BITMAP);
-@@ -125,6 +126,9 @@ void flush_thread(void)
+@@ -126,6 +127,9 @@ void flush_thread(void)
{
struct task_struct *tsk = current;
flush_ptrace_hw_breakpoint(tsk);
memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
drop_init_fpu(tsk);
-@@ -271,7 +275,7 @@ static void __exit_idle(void)
+@@ -272,7 +276,7 @@ static void __exit_idle(void)
void exit_idle(void)
{
/* idle loop has pid 0 */
return;
__exit_idle();
}
-@@ -324,7 +328,7 @@ bool xen_set_default_idle(void)
+@@ -325,7 +329,7 @@ bool xen_set_default_idle(void)
return ret;
}
#endif
{
local_irq_disable();
/*
-@@ -453,16 +457,37 @@ static int __init idle_setup(char *str)
+@@ -454,16 +458,37 @@ static int __init idle_setup(char *str)
}
early_param("idle", idle_setup);
return ret;
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
-index 52b1157..c6e67c4 100644
+index 17962e6..47f55db 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
-@@ -68,6 +68,11 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
+@@ -69,6 +69,11 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
void __noreturn machine_real_restart(unsigned int type)
{
local_irq_disable();
/*
-@@ -95,7 +100,29 @@ void __noreturn machine_real_restart(unsigned int type)
+@@ -96,7 +101,29 @@ void __noreturn machine_real_restart(unsigned int type)
/* Jump to the identity-mapped low memory code */
#ifdef CONFIG_X86_32
"rm" (real_mode_header->machine_real_restart_asm),
"a" (type));
#else
-@@ -486,7 +513,7 @@ void __attribute__((weak)) mach_reboot_fixups(void)
+@@ -500,7 +527,7 @@ void __attribute__((weak)) mach_reboot_fixups(void)
* This means that this function can never return, it can misbehave
* by not rebooting properly and hanging.
*/
{
int i;
int attempt = 0;
-@@ -610,13 +637,13 @@ void native_machine_shutdown(void)
+@@ -620,13 +647,13 @@ void native_machine_shutdown(void)
#endif
}
{
pr_notice("machine restart\n");
-@@ -625,7 +652,7 @@ static void native_machine_restart(char *__unused)
+@@ -635,7 +662,7 @@ static void native_machine_restart(char *__unused)
__machine_emergency_restart(0);
}
{
/* Stop other cpus and apics */
machine_shutdown();
-@@ -635,7 +662,7 @@ static void native_machine_halt(void)
+@@ -645,7 +672,7 @@ static void native_machine_halt(void)
stop_this_cpu(NULL);
}
{
if (pm_power_off) {
if (!reboot_force)
-@@ -644,9 +671,10 @@ static void native_machine_power_off(void)
+@@ -654,9 +681,10 @@ static void native_machine_power_off(void)
}
/* A fallback in case there is no PM info available */
tboot_shutdown(TB_SHUTDOWN_HALT);
identity_mapped:
/* set return address to 0 if not preserving context */
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
-index 78a0e62..5c2e510 100644
+index 41ead8d..7ccde23 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -110,6 +110,7 @@
.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 5492798..a3bd4f2 100644
+index 42a2dca..35a07aa 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
-@@ -230,14 +230,17 @@ static void notrace start_secondary(void *unused)
+@@ -226,14 +226,17 @@ static void notrace start_secondary(void *unused)
enable_start_cpu0 = 0;
/*
* Check TSC synchronization with the BP:
*/
-@@ -764,8 +767,9 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
+@@ -760,8 +763,9 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
alternatives_enable_smp();
idle->thread.sp = (unsigned long) (((struct pt_regs *)
#ifdef CONFIG_X86_32
/* Stack for startup_32 can be just as for start_secondary onwards */
-@@ -774,10 +778,10 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
+@@ -770,10 +774,10 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
clear_tsk_thread_flag(idle, TIF_FORK);
initial_gs = per_cpu_offset(cpu);
#endif
initial_code = (unsigned long)start_secondary;
stack_start = idle->thread.sp;
-@@ -923,6 +927,15 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
+@@ -919,6 +923,15 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
/* the FPU context is blank, nobody can own it */
__cpu_disable_lazy_restore(cpu);
#ifdef CONFIG_DEBUG_FS
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
-index bf7ef5c..59d0ac9 100644
+index 0fa2960..91eabbe 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
@@ -30,9 +30,9 @@ unsigned long profile_pc(struct pt_regs *regs)
if (!fixup_exception(regs)) {
task->thread.error_code = error_code;
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
-index ea03031..34a5cdda 100644
+index b6025f9..0cc6a1d 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -150,7 +150,7 @@ static void cyc2ns_write_end(int cpu, struct cyc2ns_data *data)
.read = native_io_apic_read,
.write = native_io_apic_write,
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
-index a4b451c..8dfe1ad 100644
+index 940b142..0ad3a10 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
-@@ -164,18 +164,18 @@ static inline int save_xstate_epilog(void __user *buf, int ia32_frame)
+@@ -167,18 +167,18 @@ static inline int save_xstate_epilog(void __user *buf, int ia32_frame)
/* Setup the bytes not touched by the [f]xsave and reserved for SW. */
sw_bytes = ia32_frame ? &fx_sw_reserved_ia32 : &fx_sw_reserved;
/*
* For legacy compatible, we always set FP/SSE bits in the bit
-@@ -190,7 +190,7 @@ static inline int save_xstate_epilog(void __user *buf, int ia32_frame)
+@@ -193,7 +193,7 @@ static inline int save_xstate_epilog(void __user *buf, int ia32_frame)
*/
xstate_bv |= XSTATE_FPSSE;
return err;
}
-@@ -199,6 +199,7 @@ static inline int save_user_xstate(struct xsave_struct __user *buf)
+@@ -202,6 +202,7 @@ static inline int save_user_xstate(struct xsave_struct __user *buf)
{
int err;
if (use_xsave())
err = xsave_user(buf);
else if (use_fxsr())
-@@ -311,6 +312,7 @@ sanitize_restored_xstate(struct task_struct *tsk,
+@@ -314,6 +315,7 @@ sanitize_restored_xstate(struct task_struct *tsk,
*/
static inline int restore_user_xstate(void __user *buf, u64 xbv, int fx_only)
{
return 0;
out:
+diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
+index 03954f7..48daa1a 100644
+--- a/arch/x86/kvm/emulate.c
++++ b/arch/x86/kvm/emulate.c
+@@ -504,11 +504,6 @@ static void rsp_increment(struct x86_emulate_ctxt *ctxt, int inc)
+ masked_increment(reg_rmw(ctxt, VCPU_REGS_RSP), stack_mask(ctxt), inc);
+ }
+
+-static inline void jmp_rel(struct x86_emulate_ctxt *ctxt, int rel)
+-{
+- register_address_increment(ctxt, &ctxt->_eip, rel);
+-}
+-
+ static u32 desc_limit_scaled(struct desc_struct *desc)
+ {
+ u32 limit = get_desc_limit(desc);
+@@ -568,6 +563,38 @@ static int emulate_nm(struct x86_emulate_ctxt *ctxt)
+ return emulate_exception(ctxt, NM_VECTOR, 0, false);
+ }
+
++static inline int assign_eip_far(struct x86_emulate_ctxt *ctxt, ulong dst,
++ int cs_l)
++{
++ switch (ctxt->op_bytes) {
++ case 2:
++ ctxt->_eip = (u16)dst;
++ break;
++ case 4:
++ ctxt->_eip = (u32)dst;
++ break;
++ case 8:
++ if ((cs_l && is_noncanonical_address(dst)) ||
++ (!cs_l && (dst & ~(u32)-1)))
++ return emulate_gp(ctxt, 0);
++ ctxt->_eip = dst;
++ break;
++ default:
++ WARN(1, "unsupported eip assignment size\n");
++ }
++ return X86EMUL_CONTINUE;
++}
++
++static inline int assign_eip_near(struct x86_emulate_ctxt *ctxt, ulong dst)
++{
++ return assign_eip_far(ctxt, dst, ctxt->mode == X86EMUL_MODE_PROT64);
++}
++
++static inline int jmp_rel(struct x86_emulate_ctxt *ctxt, int rel)
++{
++ return assign_eip_near(ctxt, ctxt->_eip + rel);
++}
++
+ static u16 get_segment_selector(struct x86_emulate_ctxt *ctxt, unsigned seg)
+ {
+ u16 selector;
+@@ -750,8 +777,10 @@ static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)
+ static __always_inline int do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt,
+ unsigned size)
+ {
+- if (unlikely(ctxt->fetch.end - ctxt->fetch.ptr < size))
+- return __do_insn_fetch_bytes(ctxt, size);
++ unsigned done_size = ctxt->fetch.end - ctxt->fetch.ptr;
++
++ if (unlikely(done_size < size))
++ return __do_insn_fetch_bytes(ctxt, size - done_size);
+ else
+ return X86EMUL_CONTINUE;
+ }
+@@ -1415,7 +1444,9 @@ static int write_segment_descriptor(struct x86_emulate_ctxt *ctxt,
+
+ /* Does not support long mode */
+ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
+- u16 selector, int seg, u8 cpl, bool in_task_switch)
++ u16 selector, int seg, u8 cpl,
++ bool in_task_switch,
++ struct desc_struct *desc)
+ {
+ struct desc_struct seg_desc, old_desc;
+ u8 dpl, rpl;
+@@ -1547,6 +1578,8 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
+ }
+ load:
+ ctxt->ops->set_segment(ctxt, selector, &seg_desc, base3, seg);
++ if (desc)
++ *desc = seg_desc;
+ return X86EMUL_CONTINUE;
+ exception:
+ emulate_exception(ctxt, err_vec, err_code, true);
+@@ -1557,7 +1590,7 @@ static int load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
+ u16 selector, int seg)
+ {
+ u8 cpl = ctxt->ops->cpl(ctxt);
+- return __load_segment_descriptor(ctxt, selector, seg, cpl, false);
++ return __load_segment_descriptor(ctxt, selector, seg, cpl, false, NULL);
+ }
+
+ static void write_register_operand(struct operand *op)
+@@ -1951,17 +1984,31 @@ static int em_iret(struct x86_emulate_ctxt *ctxt)
+ static int em_jmp_far(struct x86_emulate_ctxt *ctxt)
+ {
+ int rc;
+- unsigned short sel;
++ unsigned short sel, old_sel;
++ struct desc_struct old_desc, new_desc;
++ const struct x86_emulate_ops *ops = ctxt->ops;
++ u8 cpl = ctxt->ops->cpl(ctxt);
++
++ /* Assignment of RIP may only fail in 64-bit mode */
++ if (ctxt->mode == X86EMUL_MODE_PROT64)
++ ops->get_segment(ctxt, &old_sel, &old_desc, NULL,
++ VCPU_SREG_CS);
+
+ memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2);
+
+- rc = load_segment_descriptor(ctxt, sel, VCPU_SREG_CS);
++ rc = __load_segment_descriptor(ctxt, sel, VCPU_SREG_CS, cpl, false,
++ &new_desc);
+ if (rc != X86EMUL_CONTINUE)
+ return rc;
+
+- ctxt->_eip = 0;
+- memcpy(&ctxt->_eip, ctxt->src.valptr, ctxt->op_bytes);
+- return X86EMUL_CONTINUE;
++ rc = assign_eip_far(ctxt, ctxt->src.val, new_desc.l);
++ if (rc != X86EMUL_CONTINUE) {
++ WARN_ON(!ctxt->mode != X86EMUL_MODE_PROT64);
++ /* assigning eip failed; restore the old cs */
++ ops->set_segment(ctxt, old_sel, &old_desc, 0, VCPU_SREG_CS);
++ return rc;
++ }
++ return rc;
+ }
+
+ static int em_grp45(struct x86_emulate_ctxt *ctxt)
+@@ -1972,13 +2019,15 @@ static int em_grp45(struct x86_emulate_ctxt *ctxt)
+ case 2: /* call near abs */ {
+ long int old_eip;
+ old_eip = ctxt->_eip;
+- ctxt->_eip = ctxt->src.val;
++ rc = assign_eip_near(ctxt, ctxt->src.val);
++ if (rc != X86EMUL_CONTINUE)
++ break;
+ ctxt->src.val = old_eip;
+ rc = em_push(ctxt);
+ break;
+ }
+ case 4: /* jmp abs */
+- ctxt->_eip = ctxt->src.val;
++ rc = assign_eip_near(ctxt, ctxt->src.val);
+ break;
+ case 5: /* jmp far */
+ rc = em_jmp_far(ctxt);
+@@ -2013,30 +2062,47 @@ static int em_cmpxchg8b(struct x86_emulate_ctxt *ctxt)
+
+ static int em_ret(struct x86_emulate_ctxt *ctxt)
+ {
+- ctxt->dst.type = OP_REG;
+- ctxt->dst.addr.reg = &ctxt->_eip;
+- ctxt->dst.bytes = ctxt->op_bytes;
+- return em_pop(ctxt);
++ int rc;
++ unsigned long eip;
++
++ rc = emulate_pop(ctxt, &eip, ctxt->op_bytes);
++ if (rc != X86EMUL_CONTINUE)
++ return rc;
++
++ return assign_eip_near(ctxt, eip);
+ }
+
+ static int em_ret_far(struct x86_emulate_ctxt *ctxt)
+ {
+ int rc;
+- unsigned long cs;
++ unsigned long eip, cs;
++ u16 old_cs;
+ int cpl = ctxt->ops->cpl(ctxt);
++ struct desc_struct old_desc, new_desc;
++ const struct x86_emulate_ops *ops = ctxt->ops;
+
+- rc = emulate_pop(ctxt, &ctxt->_eip, ctxt->op_bytes);
++ if (ctxt->mode == X86EMUL_MODE_PROT64)
++ ops->get_segment(ctxt, &old_cs, &old_desc, NULL,
++ VCPU_SREG_CS);
++
++ rc = emulate_pop(ctxt, &eip, ctxt->op_bytes);
+ if (rc != X86EMUL_CONTINUE)
+ return rc;
+- if (ctxt->op_bytes == 4)
+- ctxt->_eip = (u32)ctxt->_eip;
+ rc = emulate_pop(ctxt, &cs, ctxt->op_bytes);
+ if (rc != X86EMUL_CONTINUE)
+ return rc;
+ /* Outer-privilege level return is not implemented */
+ if (ctxt->mode >= X86EMUL_MODE_PROT16 && (cs & 3) > cpl)
+ return X86EMUL_UNHANDLEABLE;
+- rc = load_segment_descriptor(ctxt, (u16)cs, VCPU_SREG_CS);
++ rc = __load_segment_descriptor(ctxt, (u16)cs, VCPU_SREG_CS, 0, false,
++ &new_desc);
++ if (rc != X86EMUL_CONTINUE)
++ return rc;
++ rc = assign_eip_far(ctxt, eip, new_desc.l);
++ if (rc != X86EMUL_CONTINUE) {
++ WARN_ON(!ctxt->mode != X86EMUL_MODE_PROT64);
++ ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS);
++ }
+ return rc;
+ }
+
+@@ -2297,7 +2363,7 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
+ {
+ const struct x86_emulate_ops *ops = ctxt->ops;
+ struct desc_struct cs, ss;
+- u64 msr_data;
++ u64 msr_data, rcx, rdx;
+ int usermode;
+ u16 cs_sel = 0, ss_sel = 0;
+
+@@ -2313,6 +2379,9 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
+ else
+ usermode = X86EMUL_MODE_PROT32;
+
++ rcx = reg_read(ctxt, VCPU_REGS_RCX);
++ rdx = reg_read(ctxt, VCPU_REGS_RDX);
++
+ cs.dpl = 3;
+ ss.dpl = 3;
+ ops->get_msr(ctxt, MSR_IA32_SYSENTER_CS, &msr_data);
+@@ -2330,6 +2399,9 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
+ ss_sel = cs_sel + 8;
+ cs.d = 0;
+ cs.l = 1;
++ if (is_noncanonical_address(rcx) ||
++ is_noncanonical_address(rdx))
++ return emulate_gp(ctxt, 0);
+ break;
+ }
+ cs_sel |= SELECTOR_RPL_MASK;
+@@ -2338,8 +2410,8 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
+ ops->set_segment(ctxt, cs_sel, &cs, 0, VCPU_SREG_CS);
+ ops->set_segment(ctxt, ss_sel, &ss, 0, VCPU_SREG_SS);
+
+- ctxt->_eip = reg_read(ctxt, VCPU_REGS_RDX);
+- *reg_write(ctxt, VCPU_REGS_RSP) = reg_read(ctxt, VCPU_REGS_RCX);
++ ctxt->_eip = rdx;
++ *reg_write(ctxt, VCPU_REGS_RSP) = rcx;
+
+ return X86EMUL_CONTINUE;
+ }
+@@ -2457,19 +2529,24 @@ static int load_state_from_tss16(struct x86_emulate_ctxt *ctxt,
+ * Now load segment descriptors. If fault happens at this stage
+ * it is handled in a context of new task
+ */
+- ret = __load_segment_descriptor(ctxt, tss->ldt, VCPU_SREG_LDTR, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->ldt, VCPU_SREG_LDTR, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+
+@@ -2594,25 +2671,32 @@ static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt,
+ * Now load segment descriptors. If fault happenes at this stage
+ * it is handled in a context of new task
+ */
+- ret = __load_segment_descriptor(ctxt, tss->ldt_selector, VCPU_SREG_LDTR, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->ldt_selector, VCPU_SREG_LDTR,
++ cpl, true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->es, VCPU_SREG_ES, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->cs, VCPU_SREG_CS, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->ss, VCPU_SREG_SS, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->ds, VCPU_SREG_DS, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->fs, VCPU_SREG_FS, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->fs, VCPU_SREG_FS, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+- ret = __load_segment_descriptor(ctxt, tss->gs, VCPU_SREG_GS, cpl, true);
++ ret = __load_segment_descriptor(ctxt, tss->gs, VCPU_SREG_GS, cpl,
++ true, NULL);
+ if (ret != X86EMUL_CONTINUE)
+ return ret;
+
+@@ -2880,10 +2964,13 @@ static int em_aad(struct x86_emulate_ctxt *ctxt)
+
+ static int em_call(struct x86_emulate_ctxt *ctxt)
+ {
++ int rc;
+ long rel = ctxt->src.val;
+
+ ctxt->src.val = (unsigned long)ctxt->_eip;
+- jmp_rel(ctxt, rel);
++ rc = jmp_rel(ctxt, rel);
++ if (rc != X86EMUL_CONTINUE)
++ return rc;
+ return em_push(ctxt);
+ }
+
+@@ -2892,34 +2979,50 @@ static int em_call_far(struct x86_emulate_ctxt *ctxt)
+ u16 sel, old_cs;
+ ulong old_eip;
+ int rc;
++ struct desc_struct old_desc, new_desc;
++ const struct x86_emulate_ops *ops = ctxt->ops;
++ int cpl = ctxt->ops->cpl(ctxt);
+
+- old_cs = get_segment_selector(ctxt, VCPU_SREG_CS);
+ old_eip = ctxt->_eip;
++ ops->get_segment(ctxt, &old_cs, &old_desc, NULL, VCPU_SREG_CS);
+
+ memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2);
+- if (load_segment_descriptor(ctxt, sel, VCPU_SREG_CS))
++ rc = __load_segment_descriptor(ctxt, sel, VCPU_SREG_CS, cpl, false,
++ &new_desc);
++ if (rc != X86EMUL_CONTINUE)
+ return X86EMUL_CONTINUE;
+
+- ctxt->_eip = 0;
+- memcpy(&ctxt->_eip, ctxt->src.valptr, ctxt->op_bytes);
++ rc = assign_eip_far(ctxt, ctxt->src.val, new_desc.l);
++ if (rc != X86EMUL_CONTINUE)
++ goto fail;
+
+ ctxt->src.val = old_cs;
+ rc = em_push(ctxt);
+ if (rc != X86EMUL_CONTINUE)
+- return rc;
++ goto fail;
+
+ ctxt->src.val = old_eip;
+- return em_push(ctxt);
++ rc = em_push(ctxt);
++ /* If we failed, we tainted the memory, but the very least we should
++ restore cs */
++ if (rc != X86EMUL_CONTINUE)
++ goto fail;
++ return rc;
++fail:
++ ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS);
++ return rc;
++
+ }
+
+ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt)
+ {
+ int rc;
++ unsigned long eip;
+
+- ctxt->dst.type = OP_REG;
+- ctxt->dst.addr.reg = &ctxt->_eip;
+- ctxt->dst.bytes = ctxt->op_bytes;
+- rc = emulate_pop(ctxt, &ctxt->dst.val, ctxt->op_bytes);
++ rc = emulate_pop(ctxt, &eip, ctxt->op_bytes);
++ if (rc != X86EMUL_CONTINUE)
++ return rc;
++ rc = assign_eip_near(ctxt, eip);
+ if (rc != X86EMUL_CONTINUE)
+ return rc;
+ rsp_increment(ctxt, ctxt->src.val);
+@@ -3250,20 +3353,24 @@ static int em_lmsw(struct x86_emulate_ctxt *ctxt)
+
+ static int em_loop(struct x86_emulate_ctxt *ctxt)
+ {
++ int rc = X86EMUL_CONTINUE;
++
+ register_address_increment(ctxt, reg_rmw(ctxt, VCPU_REGS_RCX), -1);
+ if ((address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) != 0) &&
+ (ctxt->b == 0xe2 || test_cc(ctxt->b ^ 0x5, ctxt->eflags)))
+- jmp_rel(ctxt, ctxt->src.val);
++ rc = jmp_rel(ctxt, ctxt->src.val);
+
+- return X86EMUL_CONTINUE;
++ return rc;
+ }
+
+ static int em_jcxz(struct x86_emulate_ctxt *ctxt)
+ {
++ int rc = X86EMUL_CONTINUE;
++
+ if (address_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) == 0)
+- jmp_rel(ctxt, ctxt->src.val);
++ rc = jmp_rel(ctxt, ctxt->src.val);
+
+- return X86EMUL_CONTINUE;
++ return rc;
+ }
+
+ static int em_in(struct x86_emulate_ctxt *ctxt)
+@@ -3351,6 +3458,12 @@ static int em_bswap(struct x86_emulate_ctxt *ctxt)
+ return X86EMUL_CONTINUE;
+ }
+
++static int em_clflush(struct x86_emulate_ctxt *ctxt)
++{
++ /* emulating clflush regardless of cpuid */
++ return X86EMUL_CONTINUE;
++}
++
+ static bool valid_cr(int nr)
+ {
+ switch (nr) {
+@@ -3683,6 +3796,16 @@ static const struct opcode group11[] = {
+ X7(D(Undefined)),
+ };
+
++static const struct gprefix pfx_0f_ae_7 = {
++ I(SrcMem | ByteOp, em_clflush), N, N, N,
++};
++
++static const struct group_dual group15 = { {
++ N, N, N, N, N, N, N, GP(0, &pfx_0f_ae_7),
++}, {
++ N, N, N, N, N, N, N, N,
++} };
++
+ static const struct gprefix pfx_0f_6f_0f_7f = {
+ I(Mmx, em_mov), I(Sse | Aligned, em_mov), N, I(Sse | Unaligned, em_mov),
+ };
+@@ -3887,10 +4010,11 @@ static const struct opcode twobyte_table[256] = {
+ N, I(ImplicitOps | EmulateOnUD, em_syscall),
+ II(ImplicitOps | Priv, em_clts, clts), N,
+ DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N,
+- N, D(ImplicitOps | ModRM), N, N,
++ N, D(ImplicitOps | ModRM | SrcMem | NoAccess), N, N,
+ /* 0x10 - 0x1F */
+ N, N, N, N, N, N, N, N,
+- D(ImplicitOps | ModRM), N, N, N, N, N, N, D(ImplicitOps | ModRM),
++ D(ImplicitOps | ModRM | SrcMem | NoAccess),
++ N, N, N, N, N, N, D(ImplicitOps | ModRM | SrcMem | NoAccess),
+ /* 0x20 - 0x2F */
+ DIP(ModRM | DstMem | Priv | Op3264 | NoMod, cr_read, check_cr_read),
+ DIP(ModRM | DstMem | Priv | Op3264 | NoMod, dr_read, check_dr_read),
+@@ -3942,7 +4066,7 @@ static const struct opcode twobyte_table[256] = {
+ F(DstMem | SrcReg | ModRM | BitOp | Lock | PageTable, em_bts),
+ F(DstMem | SrcReg | Src2ImmByte | ModRM, em_shrd),
+ F(DstMem | SrcReg | Src2CL | ModRM, em_shrd),
+- D(ModRM), F(DstReg | SrcMem | ModRM, em_imul),
++ GD(0, &group15), F(DstReg | SrcMem | ModRM, em_imul),
+ /* 0xB0 - 0xB7 */
+ I2bv(DstMem | SrcReg | ModRM | Lock | PageTable, em_cmpxchg),
+ I(DstReg | SrcMemFAddr | ModRM | Src2SS, em_lseg),
+@@ -4458,10 +4582,10 @@ done_prefixes:
+ /* Decode and fetch the destination operand: register or memory. */
+ rc = decode_operand(ctxt, &ctxt->dst, (ctxt->d >> DstShift) & OpMask);
+
+-done:
+ if (ctxt->rip_relative)
+ ctxt->memopp->addr.mem.ea += ctxt->_eip;
+
++done:
+ return (rc != X86EMUL_CONTINUE) ? EMULATION_FAILED : EMULATION_OK;
+ }
+
+@@ -4711,7 +4835,7 @@ special_insn:
+ break;
+ case 0x70 ... 0x7f: /* jcc (short) */
+ if (test_cc(ctxt->b, ctxt->eflags))
+- jmp_rel(ctxt, ctxt->src.val);
++ rc = jmp_rel(ctxt, ctxt->src.val);
+ break;
+ case 0x8d: /* lea r16/r32, m */
+ ctxt->dst.val = ctxt->src.addr.mem.ea;
+@@ -4741,7 +4865,7 @@ special_insn:
+ break;
+ case 0xe9: /* jmp rel */
+ case 0xeb: /* jmp rel short */
+- jmp_rel(ctxt, ctxt->src.val);
++ rc = jmp_rel(ctxt, ctxt->src.val);
+ ctxt->dst.type = OP_NONE; /* Disable writeback. */
+ break;
+ case 0xf4: /* hlt */
+@@ -4864,13 +4988,11 @@ twobyte_insn:
+ break;
+ case 0x80 ... 0x8f: /* jnz rel, etc*/
+ if (test_cc(ctxt->b, ctxt->eflags))
+- jmp_rel(ctxt, ctxt->src.val);
++ rc = jmp_rel(ctxt, ctxt->src.val);
+ break;
+ case 0x90 ... 0x9f: /* setcc r/m8 */
+ ctxt->dst.val = test_cc(ctxt->b, ctxt->eflags);
+ break;
+- case 0xae: /* clflush */
+- break;
+ case 0xb6 ... 0xb7: /* movzx */
+ ctxt->dst.bytes = ctxt->op_bytes;
+ ctxt->dst.val = (ctxt->src.bytes == 1) ? (u8) ctxt->src.val
+diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
+index 518d864..298781d 100644
+--- a/arch/x86/kvm/i8254.c
++++ b/arch/x86/kvm/i8254.c
+@@ -262,8 +262,10 @@ void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu)
+ return;
+
+ timer = &pit->pit_state.timer;
++ mutex_lock(&pit->pit_state.lock);
+ if (hrtimer_cancel(timer))
+ hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
++ mutex_unlock(&pit->pit_state.lock);
+ }
+
+ static void destroy_pit_timer(struct kvm_pit *pit)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
-index 453e5fb..214168f 100644
+index 08e8a89..0e9183e 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -55,7 +55,7 @@
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 b5e994a..35b5866 100644
+index ddf7427..fd84599 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
-@@ -3541,7 +3541,11 @@ static void reload_tss(struct kvm_vcpu *vcpu)
+@@ -3234,7 +3234,7 @@ static int wrmsr_interception(struct vcpu_svm *svm)
+ msr.host_initiated = false;
+
+ svm->next_rip = kvm_rip_read(&svm->vcpu) + 2;
+- if (svm_set_msr(&svm->vcpu, &msr)) {
++ if (kvm_set_msr(&svm->vcpu, &msr)) {
+ trace_kvm_msr_write_ex(ecx, data);
+ kvm_inject_gp(&svm->vcpu, 0);
+ } else {
+@@ -3534,9 +3534,9 @@ static int handle_exit(struct kvm_vcpu *vcpu)
+
+ if (exit_code >= ARRAY_SIZE(svm_exit_handlers)
+ || !svm_exit_handlers[exit_code]) {
+- kvm_run->exit_reason = KVM_EXIT_UNKNOWN;
+- kvm_run->hw.hardware_exit_reason = exit_code;
+- return 0;
++ WARN_ONCE(1, "vmx: unexpected exit reason 0x%x\n", exit_code);
++ kvm_queue_exception(vcpu, UD_VECTOR);
++ return 1;
+ }
+
+ return svm_exit_handlers[exit_code](svm);
+@@ -3547,7 +3547,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);
load_TR_desc();
}
-@@ -3942,6 +3946,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -3948,6 +3952,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
#endif
#endif
local_irq_disable();
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
-index 801332e..eeff1cc 100644
+index bfe11cf..deb3959 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
-@@ -1339,12 +1339,12 @@ static void vmcs_write64(unsigned long field, u64 value)
+@@ -453,6 +453,7 @@ struct vcpu_vmx {
+ int gs_ldt_reload_needed;
+ int fs_reload_needed;
+ u64 msr_host_bndcfgs;
++ unsigned long vmcs_host_cr4; /* May not match real cr4 */
+ } host_state;
+ struct {
+ int vm86_active;
+@@ -1340,12 +1341,12 @@ static void vmcs_write64(unsigned long field, u64 value)
#endif
}
{
vmcs_writel(field, vmcs_readl(field) | mask);
}
-@@ -1604,7 +1604,11 @@ static void reload_tss(void)
+@@ -1605,7 +1606,11 @@ static void reload_tss(void)
struct desc_struct *descs;
descs = (void *)gdt->address;
load_TR_desc();
}
-@@ -1832,6 +1836,10 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
+@@ -1833,6 +1838,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 */
rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp);
vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */
vmx->loaded_vmcs->cpu = cpu;
-@@ -2121,7 +2129,7 @@ static void setup_msrs(struct vcpu_vmx *vmx)
+@@ -2122,7 +2131,7 @@ static void setup_msrs(struct vcpu_vmx *vmx)
* reads and returns guest's timestamp counter "register"
* guest_tsc = host_tsc + tsc_offset -- 21.3
*/
{
u64 host_tsc, tsc_offset;
-@@ -3093,8 +3101,11 @@ static __init int hardware_setup(void)
+@@ -2631,12 +2640,15 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
+ default:
+ msr = find_msr_entry(vmx, msr_index);
+ if (msr) {
++ u64 old_msr_data = msr->data;
+ msr->data = data;
+ if (msr - vmx->guest_msrs < vmx->save_nmsrs) {
+ preempt_disable();
+- kvm_set_shared_msr(msr->index, msr->data,
+- msr->mask);
++ ret = kvm_set_shared_msr(msr->index, msr->data,
++ msr->mask);
+ preempt_enable();
++ if (ret)
++ msr->data = old_msr_data;
+ }
+ break;
+ }
+@@ -3110,8 +3122,11 @@ static __init int hardware_setup(void)
if (!cpu_has_vmx_flexpriority())
flexpriority_enabled = 0;
if (enable_ept && !cpu_has_vmx_ept_2m_page())
kvm_disable_largepages();
-@@ -3105,13 +3116,15 @@ static __init int hardware_setup(void)
+@@ -3122,13 +3137,15 @@ static __init int hardware_setup(void)
if (!cpu_has_vmx_apicv())
enable_apicv = 0;
if (nested)
nested_vmx_setup_ctls_msrs();
-@@ -4221,7 +4234,10 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
+@@ -4235,10 +4252,17 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
+ u32 low32, high32;
+ unsigned long tmpl;
+ struct desc_ptr dt;
++ unsigned long cr4;
vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */
- vmcs_writel(HOST_CR4, read_cr4()); /* 22.2.3, 22.2.5 */
-+
+- vmcs_writel(HOST_CR4, read_cr4()); /* 22.2.3, 22.2.5 */
+#ifndef CONFIG_PAX_PER_CPU_PGD
vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */
+#endif
++
++ /* Save the most likely value for this task's CR4 in the VMCS. */
++ cr4 = read_cr4();
++ vmcs_writel(HOST_CR4, cr4); /* 22.2.3, 22.2.5 */
++ vmx->host_state.vmcs_host_cr4 = cr4;
vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */
#ifdef CONFIG_X86_64
-@@ -4243,7 +4259,7 @@ static void vmx_set_constant_host_state(struct vcpu_vmx *vmx)
+@@ -4260,7 +4284,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;
rdmsr(MSR_IA32_SYSENTER_CS, low32, high32);
vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
-@@ -7413,6 +7429,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -5257,7 +5281,7 @@ static int handle_wrmsr(struct kvm_vcpu *vcpu)
+ msr.data = data;
+ msr.index = ecx;
+ msr.host_initiated = false;
+- if (vmx_set_msr(vcpu, &msr) != 0) {
++ if (kvm_set_msr(vcpu, &msr) != 0) {
+ trace_kvm_msr_write_ex(ecx, data);
+ kvm_inject_gp(vcpu, 0);
+ return 1;
+@@ -6630,6 +6654,12 @@ static int handle_invept(struct kvm_vcpu *vcpu)
+ return 1;
+ }
+
++static int handle_invvpid(struct kvm_vcpu *vcpu)
++{
++ kvm_queue_exception(vcpu, UD_VECTOR);
++ return 1;
++}
++
+ /*
+ * The exit handlers return 1 if the exit was handled fully and guest execution
+ * may resume. Otherwise they set the kvm_run parameter to indicate what needs
+@@ -6675,6 +6705,7 @@ static int (*const kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu) = {
+ [EXIT_REASON_MWAIT_INSTRUCTION] = handle_mwait,
+ [EXIT_REASON_MONITOR_INSTRUCTION] = handle_monitor,
+ [EXIT_REASON_INVEPT] = handle_invept,
++ [EXIT_REASON_INVVPID] = handle_invvpid,
+ };
+
+ static const int kvm_vmx_max_exit_handlers =
+@@ -6908,7 +6939,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
+ case EXIT_REASON_VMPTRST: case EXIT_REASON_VMREAD:
+ case EXIT_REASON_VMRESUME: case EXIT_REASON_VMWRITE:
+ case EXIT_REASON_VMOFF: case EXIT_REASON_VMON:
+- case EXIT_REASON_INVEPT:
++ case EXIT_REASON_INVEPT: case EXIT_REASON_INVVPID:
+ /*
+ * VMX instructions trap unconditionally. This allows L1 to
+ * emulate them for its L2 guest, i.e., allows 3-level nesting!
+@@ -7049,10 +7080,10 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
+ && kvm_vmx_exit_handlers[exit_reason])
+ return kvm_vmx_exit_handlers[exit_reason](vcpu);
+ else {
+- vcpu->run->exit_reason = KVM_EXIT_UNKNOWN;
+- vcpu->run->hw.hardware_exit_reason = exit_reason;
++ WARN_ONCE(1, "vmx: unexpected exit reason 0x%x\n", exit_reason);
++ kvm_queue_exception(vcpu, UD_VECTOR);
++ return 1;
+ }
+- return 0;
+ }
+
+ static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr)
+@@ -7376,7 +7407,7 @@ static void atomic_switch_perf_msrs(struct vcpu_vmx *vmx)
+ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+ {
+ struct vcpu_vmx *vmx = to_vmx(vcpu);
+- unsigned long debugctlmsr;
++ unsigned long debugctlmsr, cr4;
+
+ /* Record the guest's net vcpu time for enforced NMI injections. */
+ if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked))
+@@ -7397,6 +7428,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+ if (test_bit(VCPU_REGS_RIP, (unsigned long *)&vcpu->arch.regs_dirty))
+ vmcs_writel(GUEST_RIP, vcpu->arch.regs[VCPU_REGS_RIP]);
+
++ cr4 = read_cr4();
++ if (unlikely(cr4 != vmx->host_state.vmcs_host_cr4)) {
++ vmcs_writel(HOST_CR4, cr4);
++ vmx->host_state.vmcs_host_cr4 = cr4;
++ }
++
+ /* When single-stepping over STI and MOV SS, we must clear the
+ * corresponding interruptibility bits in the guest state. Otherwise
+ * vmentry fails as it then expects bit 14 (BS) in pending debug
+@@ -7453,6 +7490,12 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
"jmp 2f \n\t"
"1: " __ex(ASM_VMX_VMRESUME) "\n\t"
"2: "
/* Save guest registers, load host registers, keep flags */
"mov %0, %c[wordsize](%%" _ASM_SP ") \n\t"
"pop %0 \n\t"
-@@ -7465,6 +7487,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7505,6 +7548,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))
: "cc", "memory"
#ifdef CONFIG_X86_64
, "rax", "rbx", "rdi", "rsi"
-@@ -7478,7 +7505,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7518,7 +7566,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
if (debugctlmsr)
update_debugctlmsr(debugctlmsr);
/*
* The sysexit path does not restore ds/es, so we must set them to
* a reasonable value ourselves.
-@@ -7487,8 +7514,18 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
+@@ -7527,8 +7575,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.
*/
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 ef432f8..a630659 100644
+index 8f1e22d..c23d3c5 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
-@@ -1808,8 +1808,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
+@@ -229,20 +229,25 @@ static void kvm_shared_msr_cpu_online(void)
+ shared_msr_update(i, shared_msrs_global.msrs[i]);
+ }
+
+-void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask)
++int kvm_set_shared_msr(unsigned slot, u64 value, u64 mask)
+ {
+ unsigned int cpu = smp_processor_id();
+ struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);
++ int err;
+
+ if (((value ^ smsr->values[slot].curr) & mask) == 0)
+- return;
++ return 0;
+ smsr->values[slot].curr = value;
+- wrmsrl(shared_msrs_global.msrs[slot], value);
++ err = wrmsrl_safe(shared_msrs_global.msrs[slot], value);
++ if (err)
++ return 1;
++
+ if (!smsr->registered) {
+ smsr->urn.on_user_return = kvm_on_user_return;
+ user_return_notifier_register(&smsr->urn);
+ smsr->registered = true;
+ }
++ return 0;
+ }
+ EXPORT_SYMBOL_GPL(kvm_set_shared_msr);
+
+@@ -984,7 +989,6 @@ void kvm_enable_efer_bits(u64 mask)
+ }
+ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits);
+
+-
+ /*
+ * Writes msr value into into the appropriate "register".
+ * Returns 0 on success, non-0 otherwise.
+@@ -992,8 +996,34 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits);
+ */
+ int kvm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
+ {
++ switch (msr->index) {
++ case MSR_FS_BASE:
++ case MSR_GS_BASE:
++ case MSR_KERNEL_GS_BASE:
++ case MSR_CSTAR:
++ case MSR_LSTAR:
++ if (is_noncanonical_address(msr->data))
++ return 1;
++ break;
++ case MSR_IA32_SYSENTER_EIP:
++ case MSR_IA32_SYSENTER_ESP:
++ /*
++ * IA32_SYSENTER_ESP and IA32_SYSENTER_EIP cause #GP if
++ * non-canonical address is written on Intel but not on
++ * AMD (which ignores the top 32-bits, because it does
++ * not implement 64-bit SYSENTER).
++ *
++ * 64-bit code should hence be able to write a non-canonical
++ * value on AMD. Making the address canonical ensures that
++ * vmentry does not fail on Intel after writing a non-canonical
++ * value, and that something deterministic happens if the guest
++ * invokes 64-bit SYSENTER.
++ */
++ msr->data = get_canonical(msr->data);
++ }
+ return kvm_x86_ops->set_msr(vcpu, msr);
+ }
++EXPORT_SYMBOL_GPL(kvm_set_msr);
+
+ /*
+ * Adapt set_msr() to msr_io()'s calling convention
+@@ -1827,8 +1857,8 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
{
struct kvm *kvm = vcpu->kvm;
int lm = is_long_mode(vcpu);
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;
-@@ -2729,6 +2729,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
+@@ -2749,6 +2779,8 @@ long kvm_arch_dev_ioctl(struct file *filp,
if (n < msr_list.nmsrs)
goto out;
r = -EFAULT;
if (copy_to_user(user_msr_list->indices, &msrs_to_save,
num_msrs_to_save * sizeof(u32)))
goto out;
-@@ -5567,7 +5569,7 @@ static struct notifier_block pvclock_gtod_notifier = {
+@@ -5609,7 +5641,7 @@ static struct notifier_block pvclock_gtod_notifier = {
};
#endif
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 e78b8ee..7e173a8 100644
+index e78b8eee..7e173a8 100644
--- a/arch/x86/lib/checksum_32.S
+++ b/arch/x86/lib/checksum_32.S
@@ -29,7 +29,8 @@
}
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
-index 3664279..c6a7830 100644
+index a241946..d7a04cf 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -14,12 +14,19 @@
return 1;
#endif
return 0;
-@@ -576,7 +660,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
+@@ -576,9 +660,9 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
}
static const char nx_warning[] = KERN_CRIT
-"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n";
+"kernel tried to execute NX-protected page - exploit attempt? (uid: %d, task: %s, pid: %d)\n";
+ static const char smep_warning[] = KERN_CRIT
+-"unable to execute userspace code (SMEP?) (uid: %d)\n";
++"unable to execute userspace code (SMEP?) (uid: %d, task: %s, pid: %d)\n";
static void
show_fault_oops(struct pt_regs *regs, unsigned long error_code,
-@@ -585,7 +669,7 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,
+@@ -587,7 +671,7 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,
if (!oops_may_print())
return;
unsigned int level;
pgd_t *pgd;
pte_t *pte;
-@@ -596,9 +680,21 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,
+@@ -598,13 +682,25 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,
pte = lookup_address_in_pgd(pgd, address, &level);
if (pte && pte_present(*pte) && !pte_exec(*pte))
- printk(nx_warning, from_kuid(&init_user_ns, current_uid()));
+ printk(nx_warning, from_kuid_munged(&init_user_ns, current_uid()), current->comm, task_pid_nr(current));
+ if (pte && pte_present(*pte) && pte_exec(*pte) &&
+ (pgd_flags(*pgd) & _PAGE_USER) &&
+ (read_cr4() & X86_CR4_SMEP))
+- printk(smep_warning, from_kuid(&init_user_ns, current_uid()));
++ printk(smep_warning, from_kuid(&init_user_ns, current_uid()), current->comm, task_pid_nr(current));
}
+#ifdef CONFIG_PAX_KERNEXEC
printk(KERN_ALERT "BUG: unable to handle kernel ");
if (address < PAGE_SIZE)
printk(KERN_CONT "NULL pointer dereference");
-@@ -779,6 +875,22 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
+@@ -785,6 +881,22 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
return;
}
#endif
/* Kernel addresses are always protection faults: */
if (address >= TASK_SIZE)
error_code |= PF_PROT;
-@@ -864,7 +976,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
+@@ -870,7 +982,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
printk(KERN_ERR
"MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n",
code = BUS_MCEERR_AR;
}
#endif
-@@ -918,6 +1030,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
+@@ -924,6 +1036,99 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
return 1;
}
/*
* Handle a spurious fault caused by a stale TLB entry.
*
-@@ -985,6 +1190,9 @@ int show_unhandled_signals = 1;
+@@ -991,6 +1196,9 @@ int show_unhandled_signals = 1;
static inline int
access_error(unsigned long error_code, struct vm_area_struct *vma)
{
if (error_code & PF_WRITE) {
/* write, present and write, not present: */
if (unlikely(!(vma->vm_flags & VM_WRITE)))
-@@ -1019,7 +1227,7 @@ static inline bool smap_violation(int error_code, struct pt_regs *regs)
+@@ -1025,7 +1233,7 @@ static inline bool smap_violation(int error_code, struct pt_regs *regs)
if (error_code & PF_USER)
return false;
return false;
return true;
-@@ -1047,6 +1255,22 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
+@@ -1053,6 +1261,22 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
tsk = current;
mm = tsk->mm;
/*
* Detect and handle instructions that would cause a page fault for
* both a tracked kernel page and a userspace page.
-@@ -1124,7 +1348,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
+@@ -1130,7 +1354,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
* User-mode registers count as a user access even for any
* potential system fault or CPU buglet:
*/
local_irq_enable();
error_code |= PF_USER;
flags |= FAULT_FLAG_USER;
-@@ -1171,6 +1395,11 @@ retry:
+@@ -1177,6 +1401,11 @@ retry:
might_sleep();
}
vma = find_vma(mm, address);
if (unlikely(!vma)) {
bad_area(regs, error_code, address);
-@@ -1182,18 +1411,24 @@ retry:
+@@ -1188,18 +1417,24 @@ retry:
bad_area(regs, error_code, address);
return;
}
if (unlikely(expand_stack(vma, address))) {
bad_area(regs, error_code, address);
return;
-@@ -1309,3 +1544,292 @@ trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
+@@ -1316,3 +1551,292 @@ trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
}
NOKPROBE_SYMBOL(trace_do_page_fault);
#endif /* CONFIG_TRACING */
#endif /* CONFIG_HUGETLB_PAGE */
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
-index f971306..e83e0f6 100644
+index 66dba36..f8082ec 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -4,6 +4,7 @@
+#include <asm/desc.h>
+#include <asm/bios_ebda.h>
- #include "mm_internal.h"
-
-@@ -563,7 +566,18 @@ void __init init_mem_mapping(void)
+ /*
+ * We need to define the tracepoints somewhere, and tlb.c
+@@ -570,7 +573,18 @@ void __init init_mem_mapping(void)
early_ioremap_page_table_range_init();
#endif
__flush_tlb_all();
early_memtest(0, max_pfn_mapped << PAGE_SHIFT);
-@@ -579,10 +593,40 @@ void __init init_mem_mapping(void)
+@@ -586,10 +600,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.
*/
if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
return 0;
if (!page_is_ram(pagenr))
-@@ -628,8 +672,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
+@@ -635,8 +679,117 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
#endif
}
(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 e395048..cd38278 100644
+index 7d05565..bfc5338 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);
((unsigned long)&_etext - (unsigned long)&_text) >> 10);
/*
-@@ -883,6 +885,7 @@ void set_kernel_text_rw(void)
+@@ -884,6 +886,7 @@ void set_kernel_text_rw(void)
if (!kernel_set_to_readonly)
return;
pr_debug("Set kernel text: %lx - %lx for read write\n",
start, start+size);
-@@ -897,6 +900,7 @@ void set_kernel_text_ro(void)
+@@ -898,6 +901,7 @@ void set_kernel_text_ro(void)
if (!kernel_set_to_readonly)
return;
pr_debug("Set kernel text: %lx - %lx for read only\n",
start, start+size);
-@@ -925,6 +929,7 @@ void mark_rodata_ro(void)
+@@ -926,6 +930,7 @@ void mark_rodata_ro(void)
unsigned long start = PFN_ALIGN(_text);
unsigned long size = PFN_ALIGN(_etext) - start;
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 df1a992..94c272c 100644
+index 5621c47..5e17b7390 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -151,7 +151,7 @@ early_param("gbpages", parse_direct_gbpages_on);
spin_unlock(&init_mm.page_table_lock);
pgd_changed = true;
}
-@@ -1195,8 +1216,8 @@ static struct vm_operations_struct gate_vma_ops = {
+@@ -1196,8 +1217,8 @@ static struct vm_operations_struct gate_vma_ops = {
static struct vm_area_struct gate_vma = {
.vm_start = VSYSCALL_ADDR,
.vm_end = VSYSCALL_ADDR + PAGE_SIZE,
};
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c
-index 7b179b4..6bd17777 100644
+index 7b179b49..6bd17777 100644
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -64,7 +64,11 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot)
pte = kmemcheck_pte_lookup(address);
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
-index 25e7e13..1964579 100644
+index 919b912..9267313 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -52,7 +52,7 @@ static unsigned int stack_maxrandom_size(void)
}
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
-index dd8dda1..9e9b0f6 100644
+index ee61c36..e6fedeb 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -48,7 +48,11 @@ void leave_mm(int cpu)
load_cr3(swapper_pg_dir);
+#endif
+
- }
- }
- EXPORT_SYMBOL_GPL(leave_mm);
+ /*
+ * This gets called in the idle path where RCU
+ * functions differently. Tracing normally
diff --git a/arch/x86/mm/uderef_64.c b/arch/x86/mm/uderef_64.c
new file mode 100644
index 0000000..dace51c
+EXPORT_SYMBOL(__pax_close_userland);
+#endif
diff --git a/arch/x86/net/bpf_jit.S b/arch/x86/net/bpf_jit.S
-index 6440221..f746de8 100644
+index 6440221..f84b5c7 100644
--- a/arch/x86/net/bpf_jit.S
+++ b/arch/x86/net/bpf_jit.S
-@@ -9,19 +9,17 @@
+@@ -9,6 +9,7 @@
*/
#include <linux/linkage.h>
#include <asm/dwarf2.h>
/*
* Calling convention :
-- * rbx : skb pointer (callee saved)
-+ * rdi : skb pointer
- * esi : offset of byte(s) to fetch in skb (can be scratched)
-- * r10 : copy of skb->data
-+ * r8 : copy of skb->data
- * r9d : hlen = skb->len - skb->data_len
- */
--#define SKBDATA %r10
-+#define SKBDATA %r8
- #define SKF_MAX_NEG_OFF $(-0x200000) /* SKF_LL_OFF from filter.h */
--#define MAX_BPF_STACK (512 /* from filter.h */ + \
-- 32 /* space for rbx,r13,r14,r15 */ + \
-- 8 /* space for skb_copy_bits */)
-
- sk_load_word:
- .globl sk_load_word
-@@ -38,6 +36,7 @@ sk_load_word_positive_offset:
+@@ -38,6 +39,7 @@ sk_load_word_positive_offset:
jle bpf_slow_path_word
mov (SKBDATA,%rsi),%eax
bswap %eax /* ntohl() */
ret
sk_load_half:
-@@ -55,6 +54,7 @@ sk_load_half_positive_offset:
+@@ -55,6 +57,7 @@ sk_load_half_positive_offset:
jle bpf_slow_path_half
movzwl (SKBDATA,%rsi),%eax
rol $8,%ax # ntohs()
ret
sk_load_byte:
-@@ -69,45 +69,83 @@ sk_load_byte_positive_offset:
+@@ -69,6 +72,7 @@ sk_load_byte_positive_offset:
cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte */
jle bpf_slow_path_byte
movzbl (SKBDATA,%rsi),%eax
-+ pax_force_retaddr
-+ ret
-+
-+/**
-+ * sk_load_byte_msh - BPF_S_LDX_B_MSH helper
-+ *
-+ * Implements BPF_S_LDX_B_MSH : ldxb 4*([offset]&0xf)
-+ * Must preserve A accumulator (%eax)
-+ * Inputs : %esi is the offset value
-+ */
-+sk_load_byte_msh:
-+ .globl sk_load_byte_msh
-+ test %esi,%esi
-+ js bpf_slow_path_byte_msh_neg
-+
-+sk_load_byte_msh_positive_offset:
-+ .globl sk_load_byte_msh_positive_offset
-+ cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte_msh */
-+ jle bpf_slow_path_byte_msh
-+ movzbl (SKBDATA,%rsi),%ebx
-+ and $15,%bl
-+ shl $2,%bl
+ pax_force_retaddr
ret
/* rsi contains offset and can be scratched */
- #define bpf_slow_path_common(LEN) \
-- mov %rbx, %rdi; /* arg1 == skb */ \
-+ push %rdi; /* save skb */ \
- push %r9; \
- push SKBDATA; \
- /* rsi already has offset */ \
- mov $LEN,%ecx; /* len */ \
-- lea - MAX_BPF_STACK + 32(%rbp),%rdx; \
-+ lea -12(%rbp),%rdx; \
- call skb_copy_bits; \
- test %eax,%eax; \
- pop SKBDATA; \
-- pop %r9;
-+ pop %r9; \
-+ pop %rdi
-
-
- bpf_slow_path_word:
- bpf_slow_path_common(4)
+@@ -90,6 +94,7 @@ bpf_slow_path_word:
js bpf_error
-- mov - MAX_BPF_STACK + 32(%rbp),%eax
-+ mov -12(%rbp),%eax
+ mov - MAX_BPF_STACK + 32(%rbp),%eax
bswap %eax
+ pax_force_retaddr
ret
bpf_slow_path_half:
- bpf_slow_path_common(2)
- js bpf_error
-- mov - MAX_BPF_STACK + 32(%rbp),%ax
-+ mov -12(%rbp),%ax
+@@ -98,12 +103,14 @@ bpf_slow_path_half:
+ mov - MAX_BPF_STACK + 32(%rbp),%ax
rol $8,%ax
movzwl %ax,%eax
+ pax_force_retaddr
bpf_slow_path_byte:
bpf_slow_path_common(1)
js bpf_error
-- movzbl - MAX_BPF_STACK + 32(%rbp),%eax
-+ movzbl -12(%rbp),%eax
-+ pax_force_retaddr
-+ ret
-+
-+bpf_slow_path_byte_msh:
-+ xchg %eax,%ebx /* dont lose A , X is about to be scratched */
-+ bpf_slow_path_common(1)
-+ js bpf_error
-+ movzbl -12(%rbp),%eax
-+ and $15,%al
-+ shl $2,%al
-+ xchg %eax,%ebx
+ movzbl - MAX_BPF_STACK + 32(%rbp),%eax
+ pax_force_retaddr
ret
#define sk_negative_common(SIZE) \
-- mov %rbx, %rdi; /* arg1 == skb */ \
-+ push %rdi; /* save skb */ \
- push %r9; \
- push SKBDATA; \
- /* rsi already has offset */ \
-@@ -116,8 +154,10 @@ bpf_slow_path_byte:
- test %rax,%rax; \
- pop SKBDATA; \
- pop %r9; \
-+ pop %rdi; \
- jz bpf_error
-
-+
- bpf_slow_path_word_neg:
- cmp SKF_MAX_NEG_OFF, %esi /* test range */
- jl bpf_error /* offset lower -> error */
-@@ -126,6 +166,7 @@ sk_load_word_negative_offset:
+@@ -126,6 +133,7 @@ sk_load_word_negative_offset:
sk_negative_common(4)
mov (%rax), %eax
bswap %eax
ret
bpf_slow_path_half_neg:
-@@ -137,6 +178,7 @@ sk_load_half_negative_offset:
+@@ -137,6 +145,7 @@ sk_load_half_negative_offset:
mov (%rax),%ax
rol $8,%ax
movzwl %ax,%eax
ret
bpf_slow_path_byte_neg:
-@@ -146,14 +188,27 @@ sk_load_byte_negative_offset:
+@@ -146,6 +155,7 @@ sk_load_byte_negative_offset:
.globl sk_load_byte_negative_offset
sk_negative_common(1)
movzbl (%rax), %eax
-+ pax_force_retaddr
-+ ret
-+
-+bpf_slow_path_byte_msh_neg:
-+ cmp SKF_MAX_NEG_OFF, %esi
-+ jl bpf_error
-+sk_load_byte_msh_negative_offset:
-+ .globl sk_load_byte_msh_negative_offset
-+ xchg %eax,%ebx /* dont lose A , X is about to be scratched */
-+ sk_negative_common(1)
-+ movzbl (%rax),%eax
-+ and $15,%al
-+ shl $2,%al
-+ xchg %eax,%ebx
+ pax_force_retaddr
ret
bpf_error:
- # force a return 0 from jit handler
-- xor %eax,%eax
-- mov - MAX_BPF_STACK(%rbp),%rbx
-- mov - MAX_BPF_STACK + 8(%rbp),%r13
-- mov - MAX_BPF_STACK + 16(%rbp),%r14
-- mov - MAX_BPF_STACK + 24(%rbp),%r15
-+ xor %eax,%eax
-+ mov -8(%rbp),%rbx
+@@ -156,4 +166,5 @@ bpf_error:
+ mov - MAX_BPF_STACK + 16(%rbp),%r14
+ mov - MAX_BPF_STACK + 24(%rbp),%r15
leaveq
+ pax_force_retaddr
ret
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
-index 99bef86..bdfb5c6 100644
+index 5c8cb80..728d0cd 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
-@@ -1,7 +1,6 @@
- /* bpf_jit_comp.c : BPF JIT compiler
- *
- * Copyright (C) 2011-2013 Eric Dumazet (eric.dumazet@gmail.com)
-- * Internal BPF Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
-@@ -15,16 +14,28 @@
+@@ -15,7 +15,11 @@
#include <linux/if_vlan.h>
#include <linux/random.h>
-+/*
-+ * Conventions :
-+ * EAX : BPF A accumulator
-+ * EBX : BPF X accumulator
-+ * RDI : pointer to skb (first argument given to JIT function)
-+ * RBP : frame pointer (even if CONFIG_FRAME_POINTER=n)
-+ * ECX,EDX,ESI : scratch registers
-+ * r9d : skb->len - skb->data_len (headlen)
-+ * r8 : skb->data
-+ * -8(RBP) : saved RBX value
-+ * -16(RBP)..-80(RBP) : BPF_MEMWORDS values
-+ */
++#ifdef CONFIG_GRKERNSEC_BPF_HARDEN
++int bpf_jit_enable __read_only;
++#else
int bpf_jit_enable __read_mostly;
++#endif
/*
* assembly code in arch/x86/net/bpf_jit.S
- */
--extern u8 sk_load_word[], sk_load_half[], sk_load_byte[];
-+extern u8 sk_load_word[], sk_load_half[], sk_load_byte[], sk_load_byte_msh[];
- extern u8 sk_load_word_positive_offset[], sk_load_half_positive_offset[];
--extern u8 sk_load_byte_positive_offset[];
-+extern u8 sk_load_byte_positive_offset[], sk_load_byte_msh_positive_offset[];
- extern u8 sk_load_word_negative_offset[], sk_load_half_negative_offset[];
--extern u8 sk_load_byte_negative_offset[];
-+extern u8 sk_load_byte_negative_offset[], sk_load_byte_msh_negative_offset[];
-
- static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len)
- {
-@@ -39,50 +50,113 @@ static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len)
- return ptr + len;
- }
-
-+#ifdef CONFIG_GRKERNSEC_JIT_HARDEN
-+#define MAX_INSTR_CODE_SIZE 96
-+#else
-+#define MAX_INSTR_CODE_SIZE 64
-+#endif
-+
- #define EMIT(bytes, len) do { prog = emit_code(prog, bytes, len); } while (0)
-
- #define EMIT1(b1) EMIT(b1, 1)
- #define EMIT2(b1, b2) EMIT((b1) + ((b2) << 8), 2)
- #define EMIT3(b1, b2, b3) EMIT((b1) + ((b2) << 8) + ((b3) << 16), 3)
- #define EMIT4(b1, b2, b3, b4) EMIT((b1) + ((b2) << 8) + ((b3) << 16) + ((b4) << 24), 4)
--#define EMIT1_off32(b1, off) \
-- do {EMIT1(b1); EMIT(off, 4); } while (0)
--#define EMIT2_off32(b1, b2, off) \
-- do {EMIT2(b1, b2); EMIT(off, 4); } while (0)
--#define EMIT3_off32(b1, b2, b3, off) \
-- do {EMIT3(b1, b2, b3); EMIT(off, 4); } while (0)
--#define EMIT4_off32(b1, b2, b3, b4, off) \
-- do {EMIT4(b1, b2, b3, b4); EMIT(off, 4); } while (0)
-+
-+#ifdef CONFIG_GRKERNSEC_JIT_HARDEN
-+/* original constant will appear in ecx */
-+#define DILUTE_CONST_SEQUENCE(_off, _key) \
-+do { \
-+ /* mov ecx, randkey */ \
-+ EMIT1(0xb9); \
-+ EMIT(_key, 4); \
-+ /* xor ecx, randkey ^ off */ \
-+ EMIT2(0x81, 0xf1); \
-+ EMIT((_key) ^ (_off), 4); \
-+} while (0)
-+
-+#define EMIT1_off32(b1, _off) \
-+do { \
-+ switch (b1) { \
-+ case 0x05: /* add eax, imm32 */ \
-+ case 0x2d: /* sub eax, imm32 */ \
-+ case 0x25: /* and eax, imm32 */ \
-+ case 0x0d: /* or eax, imm32 */ \
-+ case 0xb8: /* mov eax, imm32 */ \
-+ case 0x35: /* xor eax, imm32 */ \
-+ case 0x3d: /* cmp eax, imm32 */ \
-+ case 0xa9: /* test eax, imm32 */ \
-+ DILUTE_CONST_SEQUENCE(_off, randkey); \
-+ EMIT2((b1) - 4, 0xc8); /* convert imm instruction to eax, ecx */\
-+ break; \
-+ case 0xbb: /* mov ebx, imm32 */ \
-+ DILUTE_CONST_SEQUENCE(_off, randkey); \
-+ /* mov ebx, ecx */ \
-+ EMIT2(0x89, 0xcb); \
-+ break; \
-+ case 0xbe: /* mov esi, imm32 */ \
-+ DILUTE_CONST_SEQUENCE(_off, randkey); \
-+ /* mov esi, ecx */ \
-+ EMIT2(0x89, 0xce); \
-+ break; \
-+ case 0xe8: /* call rel imm32, always to known funcs */ \
-+ EMIT1(b1); \
-+ EMIT(_off, 4); \
-+ break; \
-+ case 0xe9: /* jmp rel imm32 */ \
-+ EMIT1(b1); \
-+ EMIT(_off, 4); \
-+ /* prevent fall-through, we're not called if off = 0 */ \
-+ EMIT(0xcccccccc, 4); \
-+ EMIT(0xcccccccc, 4); \
-+ break; \
-+ default: \
-+ BUILD_BUG(); \
-+ } \
-+} while (0)
-+
-+#define EMIT2_off32(b1, b2, _off) \
-+do { \
-+ if ((b1) == 0x8d && (b2) == 0xb3) { /* lea esi, [rbx+imm32] */ \
-+ EMIT2(0x8d, 0xb3); /* lea esi, [rbx+randkey] */ \
-+ EMIT(randkey, 4); \
-+ EMIT2(0x8d, 0xb6); /* lea esi, [esi+off-randkey] */ \
-+ EMIT((_off) - randkey, 4); \
-+ } else if ((b1) == 0x69 && (b2) == 0xc0) { /* imul eax, imm32 */\
-+ DILUTE_CONST_SEQUENCE(_off, randkey); \
-+ /* imul eax, ecx */ \
-+ EMIT3(0x0f, 0xaf, 0xc1); \
-+ } else { \
-+ BUILD_BUG(); \
-+ } \
-+} while (0)
-+#else
-+#define EMIT1_off32(b1, off) do { EMIT1(b1); EMIT(off, 4);} while (0)
-+#define EMIT2_off32(b1, b2, off) do { EMIT2(b1, b2); EMIT(off, 4);} while (0)
-+#endif
-+
-+#define CLEAR_A() EMIT2(0x31, 0xc0) /* xor %eax,%eax */
-+#define CLEAR_X() EMIT2(0x31, 0xdb) /* xor %ebx,%ebx */
-
- static inline bool is_imm8(int value)
- {
- return value <= 127 && value >= -128;
- }
-
--static inline bool is_simm32(s64 value)
-+static inline bool is_near(int offset)
- {
-- return value == (s64) (s32) value;
-+ return offset <= 127 && offset >= -128;
- }
-
--/* mov dst, src */
--#define EMIT_mov(DST, SRC) \
-- do {if (DST != SRC) \
-- EMIT3(add_2mod(0x48, DST, SRC), 0x89, add_2reg(0xC0, DST, SRC)); \
-- } while (0)
--
--static int bpf_size_to_x86_bytes(int bpf_size)
--{
-- if (bpf_size == BPF_W)
-- return 4;
-- else if (bpf_size == BPF_H)
-- return 2;
-- else if (bpf_size == BPF_B)
-- return 1;
-- else if (bpf_size == BPF_DW)
-- return 4; /* imm32 */
-- else
-- return 0;
--}
-+#define EMIT_JMP(offset) \
-+do { \
-+ if (offset) { \
-+ if (is_near(offset)) \
-+ EMIT2(0xeb, offset); /* jmp .+off8 */ \
-+ else \
-+ EMIT1_off32(0xe9, offset); /* jmp .+off32 */ \
-+ } \
-+} while (0)
-
- /* list of x86 cond jumps opcodes (. + s8)
- * Add 0x10 (and an extra 0x0f) to generate far jumps (. + s32)
-@@ -93,8 +167,46 @@ static int bpf_size_to_x86_bytes(int bpf_size)
- #define X86_JNE 0x75
- #define X86_JBE 0x76
- #define X86_JA 0x77
--#define X86_JGE 0x7D
--#define X86_JG 0x7F
-+
-+#ifdef CONFIG_GRKERNSEC_JIT_HARDEN
-+#define APPEND_FLOW_VERIFY() \
-+do { \
-+ /* mov ecx, randkey */ \
-+ EMIT1(0xb9); \
-+ EMIT(randkey, 4); \
-+ /* cmp ecx, randkey */ \
-+ EMIT2(0x81, 0xf9); \
-+ EMIT(randkey, 4); \
-+ /* jz after 8 int 3s */ \
-+ EMIT2(0x74, 0x08); \
-+ EMIT(0xcccccccc, 4); \
-+ EMIT(0xcccccccc, 4); \
-+} while (0)
-+#else
-+#define APPEND_FLOW_VERIFY() do { } while (0)
-+#endif
-+
-+#define EMIT_COND_JMP(op, offset) \
-+do { \
-+ if (is_near(offset)) \
-+ EMIT2(op, offset); /* jxx .+off8 */ \
-+ else { \
-+ EMIT2(0x0f, op + 0x10); \
-+ EMIT(offset, 4); /* jxx .+off32 */ \
-+ APPEND_FLOW_VERIFY(); \
-+ } \
-+} while (0)
-+
-+#define COND_SEL(CODE, TOP, FOP) \
-+ case CODE: \
-+ t_op = TOP; \
-+ f_op = FOP; \
-+ goto cond_branch
-+
-+
-+#define SEEN_DATAREF 1 /* might call external helpers */
-+#define SEEN_XREG 2 /* ebx is used */
-+#define SEEN_MEM 4 /* use mem[] for temporary storage */
-
- static inline void bpf_flush_icache(void *start, void *end)
- {
-@@ -109,804 +221,646 @@ static inline void bpf_flush_icache(void *start, void *end)
+@@ -109,36 +113,32 @@ static inline void bpf_flush_icache(void *start, void *end)
#define CHOOSE_LOAD_FUNC(K, func) \
((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset)
- */
- u8 image[];
-};
-+/* Helper to find the offset of pkt_type in sk_buff
-+ * We want to make sure its still a 3bit field starting at a byte boundary.
-+ */
-+#define PKT_TYPE_MAX 7
-+static int pkt_type_offset(void)
-+{
-+ struct sk_buff skb_probe = {
-+ .pkt_type = ~0,
-+ };
-+ char *ct = (char *)&skb_probe;
-+ unsigned int off;
-
+-
-static struct bpf_binary_header *bpf_alloc_binary(unsigned int proglen,
-+ for (off = 0; off < sizeof(struct sk_buff); off++) {
-+ if (ct[off] == PKT_TYPE_MAX)
-+ return off;
-+ }
-+ pr_err_once("Please fix pkt_type_offset(), as pkt_type couldn't be found\n");
-+ return -1;
-+}
-+
+/* Note : for security reasons, bpf code will follow a randomly
+ * sized amount of int3 instructions
+ */
return header;
}
--/* pick a register outside of BPF range for JIT internal work */
--#define AUX_REG (MAX_BPF_REG + 1)
--
--/* the following table maps BPF registers to x64 registers.
-- * x64 register r12 is unused, since if used as base address register
-- * in load/store instructions, it always needs an extra byte of encoding
-- */
--static const int reg2hex[] = {
-- [BPF_REG_0] = 0, /* rax */
-- [BPF_REG_1] = 7, /* rdi */
-- [BPF_REG_2] = 6, /* rsi */
-- [BPF_REG_3] = 2, /* rdx */
-- [BPF_REG_4] = 1, /* rcx */
-- [BPF_REG_5] = 0, /* r8 */
-- [BPF_REG_6] = 3, /* rbx callee saved */
-- [BPF_REG_7] = 5, /* r13 callee saved */
-- [BPF_REG_8] = 6, /* r14 callee saved */
-- [BPF_REG_9] = 7, /* r15 callee saved */
-- [BPF_REG_FP] = 5, /* rbp readonly */
-- [AUX_REG] = 3, /* r11 temp register */
--};
--
--/* is_ereg() == true if BPF register 'reg' maps to x64 r8..r15
-- * which need extra byte of encoding.
-- * rax,rcx,...,rbp have simpler encoding
-- */
--static inline bool is_ereg(u32 reg)
--{
-- if (reg == BPF_REG_5 || reg == AUX_REG ||
-- (reg >= BPF_REG_7 && reg <= BPF_REG_9))
-- return true;
-- else
-- return false;
--}
--
--/* add modifiers if 'reg' maps to x64 registers r8..r15 */
--static inline u8 add_1mod(u8 byte, u32 reg)
--{
-- if (is_ereg(reg))
-- byte |= 1;
-- return byte;
--}
--
--static inline u8 add_2mod(u8 byte, u32 r1, u32 r2)
--{
-- if (is_ereg(r1))
-- byte |= 1;
-- if (is_ereg(r2))
-- byte |= 4;
-- return byte;
--}
--
--/* encode 'dst_reg' register into x64 opcode 'byte' */
--static inline u8 add_1reg(u8 byte, u32 dst_reg)
--{
-- return byte + reg2hex[dst_reg];
--}
--
--/* encode 'dst_reg' and 'src_reg' registers into x64 opcode 'byte' */
--static inline u8 add_2reg(u8 byte, u32 dst_reg, u32 src_reg)
--{
-- return byte + reg2hex[dst_reg] + (reg2hex[src_reg] << 3);
--}
--
--struct jit_context {
-- unsigned int cleanup_addr; /* epilogue code offset */
-- bool seen_ld_abs;
--};
--
--static int do_jit(struct sk_filter *bpf_prog, int *addrs, u8 *image,
-- int oldproglen, struct jit_context *ctx)
--{
-- struct sock_filter_int *insn = bpf_prog->insnsi;
-- int insn_cnt = bpf_prog->len;
-- u8 temp[64];
-- int i;
-- int proglen = 0;
-- u8 *prog = temp;
-- int stacksize = MAX_BPF_STACK +
-- 32 /* space for rbx, r13, r14, r15 */ +
-- 8 /* space for skb_copy_bits() buffer */;
--
-- EMIT1(0x55); /* push rbp */
-- EMIT3(0x48, 0x89, 0xE5); /* mov rbp,rsp */
--
-- /* sub rsp, stacksize */
-- EMIT3_off32(0x48, 0x81, 0xEC, stacksize);
--
-- /* all classic BPF filters use R6(rbx) save it */
--
-- /* mov qword ptr [rbp-X],rbx */
-- EMIT3_off32(0x48, 0x89, 0x9D, -stacksize);
--
-- /* sk_convert_filter() maps classic BPF register X to R7 and uses R8
-- * as temporary, so all tcpdump filters need to spill/fill R7(r13) and
-- * R8(r14). R9(r15) spill could be made conditional, but there is only
-- * one 'bpf_error' return path out of helper functions inside bpf_jit.S
-- * The overhead of extra spill is negligible for any filter other
-- * than synthetic ones. Therefore not worth adding complexity.
-- */
--
-- /* mov qword ptr [rbp-X],r13 */
-- EMIT3_off32(0x4C, 0x89, 0xAD, -stacksize + 8);
-- /* mov qword ptr [rbp-X],r14 */
-- EMIT3_off32(0x4C, 0x89, 0xB5, -stacksize + 16);
-- /* mov qword ptr [rbp-X],r15 */
-- EMIT3_off32(0x4C, 0x89, 0xBD, -stacksize + 24);
--
-- /* clear A and X registers */
-- EMIT2(0x31, 0xc0); /* xor eax, eax */
-- EMIT3(0x4D, 0x31, 0xED); /* xor r13, r13 */
--
-- if (ctx->seen_ld_abs) {
-- /* r9d : skb->len - skb->data_len (headlen)
-- * r10 : skb->data
-- */
-- if (is_imm8(offsetof(struct sk_buff, len)))
-- /* mov %r9d, off8(%rdi) */
-- EMIT4(0x44, 0x8b, 0x4f,
-- offsetof(struct sk_buff, len));
-- else
-- /* mov %r9d, off32(%rdi) */
-- EMIT3_off32(0x44, 0x8b, 0x8f,
-- offsetof(struct sk_buff, len));
--
-- if (is_imm8(offsetof(struct sk_buff, data_len)))
-- /* sub %r9d, off8(%rdi) */
-- EMIT4(0x44, 0x2b, 0x4f,
-- offsetof(struct sk_buff, data_len));
-- else
-- EMIT3_off32(0x44, 0x2b, 0x8f,
-- offsetof(struct sk_buff, data_len));
--
-- if (is_imm8(offsetof(struct sk_buff, data)))
-- /* mov %r10, off8(%rdi) */
-- EMIT4(0x4c, 0x8b, 0x57,
-- offsetof(struct sk_buff, data));
-- else
-- /* mov %r10, off32(%rdi) */
-- EMIT3_off32(0x4c, 0x8b, 0x97,
-- offsetof(struct sk_buff, data));
-- }
--
-- for (i = 0; i < insn_cnt; i++, insn++) {
-- const s32 imm32 = insn->imm;
-- u32 dst_reg = insn->dst_reg;
-- u32 src_reg = insn->src_reg;
-- u8 b1 = 0, b2 = 0, b3 = 0;
-- s64 jmp_offset;
-- u8 jmp_cond;
-- int ilen;
-- u8 *func;
--
-- switch (insn->code) {
-- /* ALU */
-- case BPF_ALU | BPF_ADD | BPF_X:
-- case BPF_ALU | BPF_SUB | BPF_X:
-- case BPF_ALU | BPF_AND | BPF_X:
-- case BPF_ALU | BPF_OR | BPF_X:
-- case BPF_ALU | BPF_XOR | BPF_X:
-- case BPF_ALU64 | BPF_ADD | BPF_X:
-- case BPF_ALU64 | BPF_SUB | BPF_X:
-- case BPF_ALU64 | BPF_AND | BPF_X:
-- case BPF_ALU64 | BPF_OR | BPF_X:
-- case BPF_ALU64 | BPF_XOR | BPF_X:
-- switch (BPF_OP(insn->code)) {
-- case BPF_ADD: b2 = 0x01; break;
-- case BPF_SUB: b2 = 0x29; break;
-- case BPF_AND: b2 = 0x21; break;
-- case BPF_OR: b2 = 0x09; break;
-- case BPF_XOR: b2 = 0x31; break;
-- }
-- if (BPF_CLASS(insn->code) == BPF_ALU64)
-- EMIT1(add_2mod(0x48, dst_reg, src_reg));
-- else if (is_ereg(dst_reg) || is_ereg(src_reg))
-- EMIT1(add_2mod(0x40, dst_reg, src_reg));
-- EMIT2(b2, add_2reg(0xC0, dst_reg, src_reg));
-- break;
--
-- /* mov dst, src */
-- case BPF_ALU64 | BPF_MOV | BPF_X:
-- EMIT_mov(dst_reg, src_reg);
-- break;
--
-- /* mov32 dst, src */
-- case BPF_ALU | BPF_MOV | BPF_X:
-- if (is_ereg(dst_reg) || is_ereg(src_reg))
-- EMIT1(add_2mod(0x40, dst_reg, src_reg));
-- EMIT2(0x89, add_2reg(0xC0, dst_reg, src_reg));
-- break;
--
-- /* neg dst */
-- case BPF_ALU | BPF_NEG:
-- case BPF_ALU64 | BPF_NEG:
-- if (BPF_CLASS(insn->code) == BPF_ALU64)
-- EMIT1(add_1mod(0x48, dst_reg));
-- else if (is_ereg(dst_reg))
-- EMIT1(add_1mod(0x40, dst_reg));
-- EMIT2(0xF7, add_1reg(0xD8, dst_reg));
-- break;
--
-- case BPF_ALU | BPF_ADD | BPF_K:
-- case BPF_ALU | BPF_SUB | BPF_K:
-- case BPF_ALU | BPF_AND | BPF_K:
-- case BPF_ALU | BPF_OR | BPF_K:
-- case BPF_ALU | BPF_XOR | BPF_K:
-- case BPF_ALU64 | BPF_ADD | BPF_K:
-- case BPF_ALU64 | BPF_SUB | BPF_K:
-- case BPF_ALU64 | BPF_AND | BPF_K:
-- case BPF_ALU64 | BPF_OR | BPF_K:
-- case BPF_ALU64 | BPF_XOR | BPF_K:
-- if (BPF_CLASS(insn->code) == BPF_ALU64)
-- EMIT1(add_1mod(0x48, dst_reg));
-- else if (is_ereg(dst_reg))
-- EMIT1(add_1mod(0x40, dst_reg));
--
-- switch (BPF_OP(insn->code)) {
-- case BPF_ADD: b3 = 0xC0; break;
-- case BPF_SUB: b3 = 0xE8; break;
-- case BPF_AND: b3 = 0xE0; break;
-- case BPF_OR: b3 = 0xC8; break;
-- case BPF_XOR: b3 = 0xF0; break;
-- }
--
-- if (is_imm8(imm32))
-- EMIT3(0x83, add_1reg(b3, dst_reg), imm32);
-- else
-- EMIT2_off32(0x81, add_1reg(b3, dst_reg), imm32);
-- break;
--
-- case BPF_ALU64 | BPF_MOV | BPF_K:
-- /* optimization: if imm32 is positive,
-- * use 'mov eax, imm32' (which zero-extends imm32)
-- * to save 2 bytes
-- */
-- if (imm32 < 0) {
-- /* 'mov rax, imm32' sign extends imm32 */
-- b1 = add_1mod(0x48, dst_reg);
-- b2 = 0xC7;
-- b3 = 0xC0;
-- EMIT3_off32(b1, b2, add_1reg(b3, dst_reg), imm32);
-- break;
-- }
--
-- case BPF_ALU | BPF_MOV | BPF_K:
-- /* mov %eax, imm32 */
-- if (is_ereg(dst_reg))
-- EMIT1(add_1mod(0x40, dst_reg));
-- EMIT1_off32(add_1reg(0xB8, dst_reg), imm32);
-- break;
--
-- /* dst %= src, dst /= src, dst %= imm32, dst /= imm32 */
-- case BPF_ALU | BPF_MOD | BPF_X:
-- case BPF_ALU | BPF_DIV | BPF_X:
-- case BPF_ALU | BPF_MOD | BPF_K:
-- case BPF_ALU | BPF_DIV | BPF_K:
-- case BPF_ALU64 | BPF_MOD | BPF_X:
-- case BPF_ALU64 | BPF_DIV | BPF_X:
-- case BPF_ALU64 | BPF_MOD | BPF_K:
-- case BPF_ALU64 | BPF_DIV | BPF_K:
-- EMIT1(0x50); /* push rax */
-- EMIT1(0x52); /* push rdx */
--
-- if (BPF_SRC(insn->code) == BPF_X)
-- /* mov r11, src_reg */
-- EMIT_mov(AUX_REG, src_reg);
-- else
-- /* mov r11, imm32 */
-- EMIT3_off32(0x49, 0xC7, 0xC3, imm32);
--
-- /* mov rax, dst_reg */
-- EMIT_mov(BPF_REG_0, dst_reg);
--
-- /* xor edx, edx
-- * equivalent to 'xor rdx, rdx', but one byte less
-- */
-- EMIT2(0x31, 0xd2);
--
-- if (BPF_SRC(insn->code) == BPF_X) {
-- /* if (src_reg == 0) return 0 */
--
-- /* cmp r11, 0 */
-- EMIT4(0x49, 0x83, 0xFB, 0x00);
--
-- /* jne .+9 (skip over pop, pop, xor and jmp) */
-- EMIT2(X86_JNE, 1 + 1 + 2 + 5);
-- EMIT1(0x5A); /* pop rdx */
-- EMIT1(0x58); /* pop rax */
-- EMIT2(0x31, 0xc0); /* xor eax, eax */
--
-- /* jmp cleanup_addr
-- * addrs[i] - 11, because there are 11 bytes
-- * after this insn: div, mov, pop, pop, mov
-- */
-- jmp_offset = ctx->cleanup_addr - (addrs[i] - 11);
-- EMIT1_off32(0xE9, jmp_offset);
-- }
--
-- if (BPF_CLASS(insn->code) == BPF_ALU64)
-- /* div r11 */
-- EMIT3(0x49, 0xF7, 0xF3);
-- else
-- /* div r11d */
-- EMIT3(0x41, 0xF7, 0xF3);
--
-- if (BPF_OP(insn->code) == BPF_MOD)
-- /* mov r11, rdx */
-- EMIT3(0x49, 0x89, 0xD3);
-- else
-- /* mov r11, rax */
-- EMIT3(0x49, 0x89, 0xC3);
--
-- EMIT1(0x5A); /* pop rdx */
-- EMIT1(0x58); /* pop rax */
--
-- /* mov dst_reg, r11 */
-- EMIT_mov(dst_reg, AUX_REG);
-- break;
--
-- case BPF_ALU | BPF_MUL | BPF_K:
-- case BPF_ALU | BPF_MUL | BPF_X:
-- case BPF_ALU64 | BPF_MUL | BPF_K:
-- case BPF_ALU64 | BPF_MUL | BPF_X:
-- EMIT1(0x50); /* push rax */
-- EMIT1(0x52); /* push rdx */
--
-- /* mov r11, dst_reg */
-- EMIT_mov(AUX_REG, dst_reg);
--
-- if (BPF_SRC(insn->code) == BPF_X)
-- /* mov rax, src_reg */
-- EMIT_mov(BPF_REG_0, src_reg);
-- else
-- /* mov rax, imm32 */
-- EMIT3_off32(0x48, 0xC7, 0xC0, imm32);
--
-- if (BPF_CLASS(insn->code) == BPF_ALU64)
-- EMIT1(add_1mod(0x48, AUX_REG));
-- else if (is_ereg(AUX_REG))
-- EMIT1(add_1mod(0x40, AUX_REG));
-- /* mul(q) r11 */
-- EMIT2(0xF7, add_1reg(0xE0, AUX_REG));
--
-- /* mov r11, rax */
-- EMIT_mov(AUX_REG, BPF_REG_0);
--
-- EMIT1(0x5A); /* pop rdx */
-- EMIT1(0x58); /* pop rax */
--
-- /* mov dst_reg, r11 */
-- EMIT_mov(dst_reg, AUX_REG);
-- break;
--
-- /* shifts */
-- case BPF_ALU | BPF_LSH | BPF_K:
-- case BPF_ALU | BPF_RSH | BPF_K:
-- case BPF_ALU | BPF_ARSH | BPF_K:
-- case BPF_ALU64 | BPF_LSH | BPF_K:
-- case BPF_ALU64 | BPF_RSH | BPF_K:
-- case BPF_ALU64 | BPF_ARSH | BPF_K:
-- if (BPF_CLASS(insn->code) == BPF_ALU64)
-- EMIT1(add_1mod(0x48, dst_reg));
-- else if (is_ereg(dst_reg))
-- EMIT1(add_1mod(0x40, dst_reg));
--
-- switch (BPF_OP(insn->code)) {
-- case BPF_LSH: b3 = 0xE0; break;
-- case BPF_RSH: b3 = 0xE8; break;
-- case BPF_ARSH: b3 = 0xF8; break;
-- }
-- EMIT3(0xC1, add_1reg(b3, dst_reg), imm32);
-- break;
--
-- case BPF_ALU | BPF_END | BPF_FROM_BE:
-- switch (imm32) {
-- case 16:
-- /* emit 'ror %ax, 8' to swap lower 2 bytes */
-- EMIT1(0x66);
-- if (is_ereg(dst_reg))
-- EMIT1(0x41);
-- EMIT3(0xC1, add_1reg(0xC8, dst_reg), 8);
-- break;
-- case 32:
-- /* emit 'bswap eax' to swap lower 4 bytes */
-- if (is_ereg(dst_reg))
-- EMIT2(0x41, 0x0F);
-- else
-- EMIT1(0x0F);
-- EMIT1(add_1reg(0xC8, dst_reg));
-- break;
-- case 64:
-- /* emit 'bswap rax' to swap 8 bytes */
-- EMIT3(add_1mod(0x48, dst_reg), 0x0F,
-- add_1reg(0xC8, dst_reg));
-- break;
-- }
-- break;
--
-- case BPF_ALU | BPF_END | BPF_FROM_LE:
-- break;
--
-- /* ST: *(u8*)(dst_reg + off) = imm */
-- case BPF_ST | BPF_MEM | BPF_B:
-- if (is_ereg(dst_reg))
-- EMIT2(0x41, 0xC6);
-- else
-- EMIT1(0xC6);
-- goto st;
-- case BPF_ST | BPF_MEM | BPF_H:
-- if (is_ereg(dst_reg))
-- EMIT3(0x66, 0x41, 0xC7);
-- else
-- EMIT2(0x66, 0xC7);
-- goto st;
-- case BPF_ST | BPF_MEM | BPF_W:
-- if (is_ereg(dst_reg))
-- EMIT2(0x41, 0xC7);
-- else
-- EMIT1(0xC7);
-- goto st;
-- case BPF_ST | BPF_MEM | BPF_DW:
-- EMIT2(add_1mod(0x48, dst_reg), 0xC7);
--
--st: if (is_imm8(insn->off))
-- EMIT2(add_1reg(0x40, dst_reg), insn->off);
-- else
-- EMIT1_off32(add_1reg(0x80, dst_reg), insn->off);
--
-- EMIT(imm32, bpf_size_to_x86_bytes(BPF_SIZE(insn->code)));
-- break;
--
-- /* STX: *(u8*)(dst_reg + off) = src_reg */
-- case BPF_STX | BPF_MEM | BPF_B:
-- /* emit 'mov byte ptr [rax + off], al' */
-- if (is_ereg(dst_reg) || is_ereg(src_reg) ||
-- /* have to add extra byte for x86 SIL, DIL regs */
-- src_reg == BPF_REG_1 || src_reg == BPF_REG_2)
-- EMIT2(add_2mod(0x40, dst_reg, src_reg), 0x88);
-- else
-- EMIT1(0x88);
-- goto stx;
-- case BPF_STX | BPF_MEM | BPF_H:
-- if (is_ereg(dst_reg) || is_ereg(src_reg))
-- EMIT3(0x66, add_2mod(0x40, dst_reg, src_reg), 0x89);
-- else
-- EMIT2(0x66, 0x89);
-- goto stx;
-- case BPF_STX | BPF_MEM | BPF_W:
-- if (is_ereg(dst_reg) || is_ereg(src_reg))
-- EMIT2(add_2mod(0x40, dst_reg, src_reg), 0x89);
-- else
-- EMIT1(0x89);
-- goto stx;
-- case BPF_STX | BPF_MEM | BPF_DW:
-- EMIT2(add_2mod(0x48, dst_reg, src_reg), 0x89);
--stx: if (is_imm8(insn->off))
-- EMIT2(add_2reg(0x40, dst_reg, src_reg), insn->off);
-- else
-- EMIT1_off32(add_2reg(0x80, dst_reg, src_reg),
-- insn->off);
-- break;
--
-- /* LDX: dst_reg = *(u8*)(src_reg + off) */
-- case BPF_LDX | BPF_MEM | BPF_B:
-- /* emit 'movzx rax, byte ptr [rax + off]' */
-- EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB6);
-- goto ldx;
-- case BPF_LDX | BPF_MEM | BPF_H:
-- /* emit 'movzx rax, word ptr [rax + off]' */
-- EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB7);
-- goto ldx;
-- case BPF_LDX | BPF_MEM | BPF_W:
-- /* emit 'mov eax, dword ptr [rax+0x14]' */
-- if (is_ereg(dst_reg) || is_ereg(src_reg))
-- EMIT2(add_2mod(0x40, src_reg, dst_reg), 0x8B);
-- else
-- EMIT1(0x8B);
-- goto ldx;
-- case BPF_LDX | BPF_MEM | BPF_DW:
-- /* emit 'mov rax, qword ptr [rax+0x14]' */
-- EMIT2(add_2mod(0x48, src_reg, dst_reg), 0x8B);
--ldx: /* if insn->off == 0 we can save one extra byte, but
-- * special case of x86 r13 which always needs an offset
-- * is not worth the hassle
-- */
-- if (is_imm8(insn->off))
-- EMIT2(add_2reg(0x40, src_reg, dst_reg), insn->off);
-- else
-- EMIT1_off32(add_2reg(0x80, src_reg, dst_reg),
-- insn->off);
-- break;
--
-- /* STX XADD: lock *(u32*)(dst_reg + off) += src_reg */
-- case BPF_STX | BPF_XADD | BPF_W:
-- /* emit 'lock add dword ptr [rax + off], eax' */
-- if (is_ereg(dst_reg) || is_ereg(src_reg))
-- EMIT3(0xF0, add_2mod(0x40, dst_reg, src_reg), 0x01);
-- else
-- EMIT2(0xF0, 0x01);
-- goto xadd;
-- case BPF_STX | BPF_XADD | BPF_DW:
-- EMIT3(0xF0, add_2mod(0x48, dst_reg, src_reg), 0x01);
--xadd: if (is_imm8(insn->off))
-- EMIT2(add_2reg(0x40, dst_reg, src_reg), insn->off);
-- else
-- EMIT1_off32(add_2reg(0x80, dst_reg, src_reg),
-- insn->off);
-- break;
--
-- /* call */
-- case BPF_JMP | BPF_CALL:
-- func = (u8 *) __bpf_call_base + imm32;
-- jmp_offset = func - (image + addrs[i]);
-- if (ctx->seen_ld_abs) {
-- EMIT2(0x41, 0x52); /* push %r10 */
-- EMIT2(0x41, 0x51); /* push %r9 */
-- /* need to adjust jmp offset, since
-- * pop %r9, pop %r10 take 4 bytes after call insn
-- */
-- jmp_offset += 4;
-- }
-- if (!imm32 || !is_simm32(jmp_offset)) {
-- pr_err("unsupported bpf func %d addr %p image %p\n",
-- imm32, func, image);
-- return -EINVAL;
-- }
-- EMIT1_off32(0xE8, jmp_offset);
-- if (ctx->seen_ld_abs) {
-- EMIT2(0x41, 0x59); /* pop %r9 */
-- EMIT2(0x41, 0x5A); /* pop %r10 */
-- }
-- break;
--
-- /* cond jump */
-- case BPF_JMP | BPF_JEQ | BPF_X:
-- case BPF_JMP | BPF_JNE | BPF_X:
-- case BPF_JMP | BPF_JGT | BPF_X:
-- case BPF_JMP | BPF_JGE | BPF_X:
-- case BPF_JMP | BPF_JSGT | BPF_X:
-- case BPF_JMP | BPF_JSGE | BPF_X:
-- /* cmp dst_reg, src_reg */
-- EMIT3(add_2mod(0x48, dst_reg, src_reg), 0x39,
-- add_2reg(0xC0, dst_reg, src_reg));
-- goto emit_cond_jmp;
--
-- case BPF_JMP | BPF_JSET | BPF_X:
-- /* test dst_reg, src_reg */
-- EMIT3(add_2mod(0x48, dst_reg, src_reg), 0x85,
-- add_2reg(0xC0, dst_reg, src_reg));
-- goto emit_cond_jmp;
--
-- case BPF_JMP | BPF_JSET | BPF_K:
-- /* test dst_reg, imm32 */
-- EMIT1(add_1mod(0x48, dst_reg));
-- EMIT2_off32(0xF7, add_1reg(0xC0, dst_reg), imm32);
-- goto emit_cond_jmp;
--
-- case BPF_JMP | BPF_JEQ | BPF_K:
-- case BPF_JMP | BPF_JNE | BPF_K:
-- case BPF_JMP | BPF_JGT | BPF_K:
-- case BPF_JMP | BPF_JGE | BPF_K:
-- case BPF_JMP | BPF_JSGT | BPF_K:
-- case BPF_JMP | BPF_JSGE | BPF_K:
-- /* cmp dst_reg, imm8/32 */
-- EMIT1(add_1mod(0x48, dst_reg));
--
-- if (is_imm8(imm32))
-- EMIT3(0x83, add_1reg(0xF8, dst_reg), imm32);
-- else
-- EMIT2_off32(0x81, add_1reg(0xF8, dst_reg), imm32);
--
--emit_cond_jmp: /* convert BPF opcode to x86 */
-- switch (BPF_OP(insn->code)) {
-- case BPF_JEQ:
-- jmp_cond = X86_JE;
-- break;
-- case BPF_JSET:
-- case BPF_JNE:
-- jmp_cond = X86_JNE;
-- break;
-- case BPF_JGT:
-- /* GT is unsigned '>', JA in x86 */
-- jmp_cond = X86_JA;
-- break;
-- case BPF_JGE:
-- /* GE is unsigned '>=', JAE in x86 */
-- jmp_cond = X86_JAE;
-- break;
-- case BPF_JSGT:
-- /* signed '>', GT in x86 */
-- jmp_cond = X86_JG;
-- break;
-- case BPF_JSGE:
-- /* signed '>=', GE in x86 */
-- jmp_cond = X86_JGE;
-- break;
-- default: /* to silence gcc warning */
-- return -EFAULT;
-- }
-- jmp_offset = addrs[i + insn->off] - addrs[i];
-- if (is_imm8(jmp_offset)) {
-- EMIT2(jmp_cond, jmp_offset);
-- } else if (is_simm32(jmp_offset)) {
-- EMIT2_off32(0x0F, jmp_cond + 0x10, jmp_offset);
-- } else {
-- pr_err("cond_jmp gen bug %llx\n", jmp_offset);
-- return -EFAULT;
-- }
--
-- break;
--
-- case BPF_JMP | BPF_JA:
-- jmp_offset = addrs[i + insn->off] - addrs[i];
-- if (!jmp_offset)
-- /* optimize out nop jumps */
-- break;
--emit_jmp:
-- if (is_imm8(jmp_offset)) {
-- EMIT2(0xEB, jmp_offset);
-- } else if (is_simm32(jmp_offset)) {
-- EMIT1_off32(0xE9, jmp_offset);
-- } else {
-- pr_err("jmp gen bug %llx\n", jmp_offset);
-- return -EFAULT;
-- }
-- break;
--
-- case BPF_LD | BPF_IND | BPF_W:
-- func = sk_load_word;
-- goto common_load;
-- case BPF_LD | BPF_ABS | BPF_W:
-- func = CHOOSE_LOAD_FUNC(imm32, sk_load_word);
--common_load: ctx->seen_ld_abs = true;
-- jmp_offset = func - (image + addrs[i]);
-- if (!func || !is_simm32(jmp_offset)) {
-- pr_err("unsupported bpf func %d addr %p image %p\n",
-- imm32, func, image);
-- return -EINVAL;
-- }
-- if (BPF_MODE(insn->code) == BPF_ABS) {
-- /* mov %esi, imm32 */
-- EMIT1_off32(0xBE, imm32);
-- } else {
-- /* mov %rsi, src_reg */
-- EMIT_mov(BPF_REG_2, src_reg);
-- if (imm32) {
-- if (is_imm8(imm32))
-- /* add %esi, imm8 */
-- EMIT3(0x83, 0xC6, imm32);
-- else
-- /* add %esi, imm32 */
-- EMIT2_off32(0x81, 0xC6, imm32);
-- }
-- }
-- /* skb pointer is in R6 (%rbx), it will be copied into
-- * %rdi if skb_copy_bits() call is necessary.
-- * sk_load_* helpers also use %r10 and %r9d.
-- * See bpf_jit.S
-- */
-- EMIT1_off32(0xE8, jmp_offset); /* call */
-- break;
--
-- case BPF_LD | BPF_IND | BPF_H:
-- func = sk_load_half;
-- goto common_load;
-- case BPF_LD | BPF_ABS | BPF_H:
-- func = CHOOSE_LOAD_FUNC(imm32, sk_load_half);
-- goto common_load;
-- case BPF_LD | BPF_IND | BPF_B:
-- func = sk_load_byte;
-- goto common_load;
-- case BPF_LD | BPF_ABS | BPF_B:
-- func = CHOOSE_LOAD_FUNC(imm32, sk_load_byte);
-- goto common_load;
--
-- case BPF_JMP | BPF_EXIT:
-- if (i != insn_cnt - 1) {
-- jmp_offset = ctx->cleanup_addr - addrs[i];
-- goto emit_jmp;
-- }
-- /* update cleanup_addr */
-- ctx->cleanup_addr = proglen;
-- /* mov rbx, qword ptr [rbp-X] */
-- EMIT3_off32(0x48, 0x8B, 0x9D, -stacksize);
-- /* mov r13, qword ptr [rbp-X] */
-- EMIT3_off32(0x4C, 0x8B, 0xAD, -stacksize + 8);
-- /* mov r14, qword ptr [rbp-X] */
-- EMIT3_off32(0x4C, 0x8B, 0xB5, -stacksize + 16);
-- /* mov r15, qword ptr [rbp-X] */
-- EMIT3_off32(0x4C, 0x8B, 0xBD, -stacksize + 24);
--
-- EMIT1(0xC9); /* leave */
-- EMIT1(0xC3); /* ret */
-- break;
--
-- default:
-- /* By design x64 JIT should support all BPF instructions
-- * This error will be seen if new instruction was added
-- * to interpreter, but not to JIT
-- * or if there is junk in sk_filter
-- */
-- pr_err("bpf_jit: unknown opcode %02x\n", insn->code);
-- return -EINVAL;
-- }
--
-- ilen = prog - temp;
-- if (image) {
-- if (unlikely(proglen + ilen > oldproglen)) {
-- pr_err("bpf_jit_compile fatal error\n");
-- return -EFAULT;
-- }
-- memcpy(image + proglen, temp, ilen);
-- }
-- proglen += ilen;
-- addrs[i] = proglen;
-- prog = temp;
-- }
-- return proglen;
--}
--
--void bpf_jit_compile(struct sk_filter *prog)
--{
--}
--
--void bpf_int_jit_compile(struct sk_filter *prog)
--{
-- struct bpf_binary_header *header = NULL;
-- int proglen, oldproglen = 0;
-- struct jit_context ctx = {};
-+void bpf_jit_compile(struct sk_filter *fp)
-+{
-+ u8 temp[MAX_INSTR_CODE_SIZE];
-+ u8 *prog;
-+ unsigned int proglen, oldproglen = 0;
-+ int ilen, i;
-+ int t_offset, f_offset;
-+ u8 t_op, f_op, seen = 0, pass;
- u8 *image = NULL;
-- int *addrs;
-- int pass;
-- int i;
-+ u8 *header = NULL;
-+ u8 *func;
-+ int pc_ret0 = -1; /* bpf index of first RET #0 instruction (if any) */
-+ unsigned int cleanup_addr; /* epilogue code offset */
-+ unsigned int *addrs;
-+ const struct sock_filter *filter = fp->insns;
-+ int flen = fp->len;
-+#ifdef CONFIG_GRKERNSEC_JIT_HARDEN
-+ unsigned int randkey;
-+#endif
-
- if (!bpf_jit_enable)
- return;
-
-- if (!prog || !prog->len)
-- return;
--
-- addrs = kmalloc(prog->len * sizeof(*addrs), GFP_KERNEL);
-- if (!addrs)
-+ addrs = kmalloc(flen * sizeof(*addrs), GFP_KERNEL);
-+ if (addrs == NULL)
- return;
-
- /* Before first pass, make a rough estimation of addrs[]
-- * each bpf instruction is translated to less than 64 bytes
-+ * each bpf instruction is translated to less than MAX_INSTR_CODE_SIZE bytes
- */
-- for (proglen = 0, i = 0; i < prog->len; i++) {
-- proglen += 64;
-+ for (proglen = 0, i = 0; i < flen; i++) {
-+ proglen += MAX_INSTR_CODE_SIZE;
+@@ -853,7 +853,9 @@ common_load: ctx->seen_ld_abs = true;
+ pr_err("bpf_jit_compile fatal error\n");
+ return -EFAULT;
+ }
++ pax_open_kernel();
+ memcpy(image + proglen, temp, ilen);
++ pax_close_kernel();
+ }
+ proglen += ilen;
addrs[i] = proglen;
- }
-- ctx.cleanup_addr = proglen;
-+ cleanup_addr = proglen; /* epilogue address */
+@@ -868,7 +870,7 @@ void bpf_jit_compile(struct bpf_prog *prog)
- for (pass = 0; pass < 10; pass++) {
-- proglen = do_jit(prog, addrs, image, oldproglen, &ctx);
-- if (proglen <= 0) {
-- image = NULL;
-- if (header)
+ void bpf_int_jit_compile(struct bpf_prog *prog)
+ {
+- struct bpf_binary_header *header = NULL;
++ u8 *header = NULL;
+ int proglen, oldproglen = 0;
+ struct jit_context ctx = {};
+ u8 *image = NULL;
+@@ -900,7 +902,7 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
+ if (proglen <= 0) {
+ image = NULL;
+ if (header)
- module_free(NULL, header);
-- goto out;
-+ u8 seen_or_pass0 = (pass == 0) ? (SEEN_XREG | SEEN_DATAREF | SEEN_MEM) : seen;
-+ /* no prologue/epilogue for trivial filters (RET something) */
-+ proglen = 0;
-+ prog = temp;
-+
-+ if (seen_or_pass0) {
-+ EMIT4(0x55, 0x48, 0x89, 0xe5); /* push %rbp; mov %rsp,%rbp */
-+ EMIT4(0x48, 0x83, 0xec, 96); /* subq $96,%rsp */
-+ /* note : must save %rbx in case bpf_error is hit */
-+ if (seen_or_pass0 & (SEEN_XREG | SEEN_DATAREF))
-+ EMIT4(0x48, 0x89, 0x5d, 0xf8); /* mov %rbx, -8(%rbp) */
-+ if (seen_or_pass0 & SEEN_XREG)
-+ CLEAR_X(); /* make sure we dont leek kernel memory */
-+
-+ /*
-+ * If this filter needs to access skb data,
-+ * loads r9 and r8 with :
-+ * r9 = skb->len - skb->data_len
-+ * r8 = skb->data
-+ */
-+ if (seen_or_pass0 & SEEN_DATAREF) {
-+ if (offsetof(struct sk_buff, len) <= 127)
-+ /* mov off8(%rdi),%r9d */
-+ EMIT4(0x44, 0x8b, 0x4f, offsetof(struct sk_buff, len));
-+ else {
-+ /* mov off32(%rdi),%r9d */
-+ EMIT3(0x44, 0x8b, 0x8f);
-+ EMIT(offsetof(struct sk_buff, len), 4);
-+ }
-+ if (is_imm8(offsetof(struct sk_buff, data_len)))
-+ /* sub off8(%rdi),%r9d */
-+ EMIT4(0x44, 0x2b, 0x4f, offsetof(struct sk_buff, data_len));
-+ else {
-+ EMIT3(0x44, 0x2b, 0x8f);
-+ EMIT(offsetof(struct sk_buff, data_len), 4);
-+ }
-+
-+ if (is_imm8(offsetof(struct sk_buff, data)))
-+ /* mov off8(%rdi),%r8 */
-+ EMIT4(0x4c, 0x8b, 0x47, offsetof(struct sk_buff, data));
-+ else {
-+ /* mov off32(%rdi),%r8 */
-+ EMIT3(0x4c, 0x8b, 0x87);
-+ EMIT(offsetof(struct sk_buff, data), 4);
-+ }
-+ }
++ module_free_exec(NULL, image);
+ goto out;
}
-+
-+ switch (filter[0].code) {
-+ case BPF_S_RET_K:
-+ case BPF_S_LD_W_LEN:
-+ case BPF_S_ANC_PROTOCOL:
-+ case BPF_S_ANC_IFINDEX:
-+ case BPF_S_ANC_MARK:
-+ case BPF_S_ANC_RXHASH:
-+ case BPF_S_ANC_CPU:
-+ case BPF_S_ANC_VLAN_TAG:
-+ case BPF_S_ANC_VLAN_TAG_PRESENT:
-+ case BPF_S_ANC_QUEUE:
-+ case BPF_S_ANC_PKTTYPE:
-+ case BPF_S_LD_W_ABS:
-+ case BPF_S_LD_H_ABS:
-+ case BPF_S_LD_B_ABS:
-+ /* first instruction sets A register (or is RET 'constant') */
-+ break;
-+ default:
-+ /* make sure we dont leak kernel information to user */
-+ CLEAR_A(); /* A = 0 */
-+ }
-+
-+ for (i = 0; i < flen; i++) {
-+ unsigned int K = filter[i].k;
-+
-+#ifdef CONFIG_GRKERNSEC_JIT_HARDEN
-+ randkey = prandom_u32();
-+#endif
-+
-+ switch (filter[i].code) {
-+ case BPF_S_ALU_ADD_X: /* A += X; */
-+ seen |= SEEN_XREG;
-+ EMIT2(0x01, 0xd8); /* add %ebx,%eax */
-+ break;
-+ case BPF_S_ALU_ADD_K: /* A += K; */
-+ if (!K)
-+ break;
-+ if (is_imm8(K))
-+ EMIT3(0x83, 0xc0, K); /* add imm8,%eax */
-+ else
-+ EMIT1_off32(0x05, K); /* add imm32,%eax */
-+ break;
-+ case BPF_S_ALU_SUB_X: /* A -= X; */
-+ seen |= SEEN_XREG;
-+ EMIT2(0x29, 0xd8); /* sub %ebx,%eax */
-+ break;
-+ case BPF_S_ALU_SUB_K: /* A -= K */
-+ if (!K)
-+ break;
-+ if (is_imm8(K))
-+ EMIT3(0x83, 0xe8, K); /* sub imm8,%eax */
-+ else
-+ EMIT1_off32(0x2d, K); /* sub imm32,%eax */
-+ break;
-+ case BPF_S_ALU_MUL_X: /* A *= X; */
-+ seen |= SEEN_XREG;
-+ EMIT3(0x0f, 0xaf, 0xc3); /* imul %ebx,%eax */
-+ break;
-+ case BPF_S_ALU_MUL_K: /* A *= K */
-+ if (is_imm8(K))
-+ EMIT3(0x6b, 0xc0, K); /* imul imm8,%eax,%eax */
-+ else
-+ EMIT2_off32(0x69, 0xc0, K); /* imul imm32,%eax */
-+ break;
-+ case BPF_S_ALU_DIV_X: /* A /= X; */
-+ seen |= SEEN_XREG;
-+ EMIT2(0x85, 0xdb); /* test %ebx,%ebx */
-+ if (pc_ret0 > 0) {
-+ /* addrs[pc_ret0 - 1] is start address of target
-+ * (addrs[i] - 4) is the address following this jmp
-+ * ("xor %edx,%edx; div %ebx" being 4 bytes long)
-+ */
-+ EMIT_COND_JMP(X86_JE, addrs[pc_ret0 - 1] -
-+ (addrs[i] - 4));
-+ } else {
-+ EMIT_COND_JMP(X86_JNE, 2 + 5);
-+ CLEAR_A();
-+ EMIT1_off32(0xe9, cleanup_addr - (addrs[i] - 4)); /* jmp .+off32 */
-+ }
-+ EMIT4(0x31, 0xd2, 0xf7, 0xf3); /* xor %edx,%edx; div %ebx */
-+ break;
-+ case BPF_S_ALU_MOD_X: /* A %= X; */
-+ seen |= SEEN_XREG;
-+ EMIT2(0x85, 0xdb); /* test %ebx,%ebx */
-+ if (pc_ret0 > 0) {
-+ /* addrs[pc_ret0 - 1] is start address of target
-+ * (addrs[i] - 6) is the address following this jmp
-+ * ("xor %edx,%edx; div %ebx;mov %edx,%eax" being 6 bytes long)
-+ */
-+ EMIT_COND_JMP(X86_JE, addrs[pc_ret0 - 1] -
-+ (addrs[i] - 6));
-+ } else {
-+ EMIT_COND_JMP(X86_JNE, 2 + 5);
-+ CLEAR_A();
-+ EMIT1_off32(0xe9, cleanup_addr - (addrs[i] - 6)); /* jmp .+off32 */
-+ }
-+ EMIT2(0x31, 0xd2); /* xor %edx,%edx */
-+ EMIT2(0xf7, 0xf3); /* div %ebx */
-+ EMIT2(0x89, 0xd0); /* mov %edx,%eax */
-+ break;
-+ case BPF_S_ALU_MOD_K: /* A %= K; */
-+ if (K == 1) {
-+ CLEAR_A();
-+ break;
-+ }
-+ EMIT2(0x31, 0xd2); /* xor %edx,%edx */
-+#ifdef CONFIG_GRKERNSEC_JIT_HARDEN
-+ DILUTE_CONST_SEQUENCE(K, randkey);
-+#else
-+ EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */
-+#endif
-+ EMIT2(0xf7, 0xf1); /* div %ecx */
-+ EMIT2(0x89, 0xd0); /* mov %edx,%eax */
-+ break;
-+ case BPF_S_ALU_DIV_K: /* A /= K */
-+ if (K == 1)
-+ break;
-+ EMIT2(0x31, 0xd2); /* xor %edx,%edx */
-+#ifdef CONFIG_GRKERNSEC_JIT_HARDEN
-+ DILUTE_CONST_SEQUENCE(K, randkey);
-+#else
-+ EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */
-+#endif
-+ EMIT2(0xf7, 0xf1); /* div %ecx */
-+ break;
-+ case BPF_S_ALU_AND_X:
-+ seen |= SEEN_XREG;
-+ EMIT2(0x21, 0xd8); /* and %ebx,%eax */
-+ break;
-+ case BPF_S_ALU_AND_K:
-+ if (K >= 0xFFFFFF00) {
-+ EMIT2(0x24, K & 0xFF); /* and imm8,%al */
-+ } else if (K >= 0xFFFF0000) {
-+ EMIT2(0x66, 0x25); /* and imm16,%ax */
-+ EMIT(K, 2);
-+ } else {
-+ EMIT1_off32(0x25, K); /* and imm32,%eax */
-+ }
-+ break;
-+ case BPF_S_ALU_OR_X:
-+ seen |= SEEN_XREG;
-+ EMIT2(0x09, 0xd8); /* or %ebx,%eax */
-+ break;
-+ case BPF_S_ALU_OR_K:
-+ if (is_imm8(K))
-+ EMIT3(0x83, 0xc8, K); /* or imm8,%eax */
-+ else
-+ EMIT1_off32(0x0d, K); /* or imm32,%eax */
-+ break;
-+ case BPF_S_ANC_ALU_XOR_X: /* A ^= X; */
-+ case BPF_S_ALU_XOR_X:
-+ seen |= SEEN_XREG;
-+ EMIT2(0x31, 0xd8); /* xor %ebx,%eax */
-+ break;
-+ case BPF_S_ALU_XOR_K: /* A ^= K; */
-+ if (K == 0)
-+ break;
-+ if (is_imm8(K))
-+ EMIT3(0x83, 0xf0, K); /* xor imm8,%eax */
-+ else
-+ EMIT1_off32(0x35, K); /* xor imm32,%eax */
-+ break;
-+ case BPF_S_ALU_LSH_X: /* A <<= X; */
-+ seen |= SEEN_XREG;
-+ EMIT4(0x89, 0xd9, 0xd3, 0xe0); /* mov %ebx,%ecx; shl %cl,%eax */
-+ break;
-+ case BPF_S_ALU_LSH_K:
-+ if (K == 0)
-+ break;
-+ else if (K == 1)
-+ EMIT2(0xd1, 0xe0); /* shl %eax */
-+ else
-+ EMIT3(0xc1, 0xe0, K);
-+ break;
-+ case BPF_S_ALU_RSH_X: /* A >>= X; */
-+ seen |= SEEN_XREG;
-+ EMIT4(0x89, 0xd9, 0xd3, 0xe8); /* mov %ebx,%ecx; shr %cl,%eax */
-+ break;
-+ case BPF_S_ALU_RSH_K: /* A >>= K; */
-+ if (K == 0)
-+ break;
-+ else if (K == 1)
-+ EMIT2(0xd1, 0xe8); /* shr %eax */
-+ else
-+ EMIT3(0xc1, 0xe8, K);
-+ break;
-+ case BPF_S_ALU_NEG:
-+ EMIT2(0xf7, 0xd8); /* neg %eax */
-+ break;
-+ case BPF_S_RET_K:
-+ if (!K) {
-+ if (pc_ret0 == -1)
-+ pc_ret0 = i;
-+ CLEAR_A();
-+ } else {
-+ EMIT1_off32(0xb8, K); /* mov $imm32,%eax */
-+ }
-+ /* fallinto */
-+ case BPF_S_RET_A:
-+ if (seen_or_pass0) {
-+ if (i != flen - 1) {
-+ EMIT_JMP(cleanup_addr - addrs[i]);
-+ break;
-+ }
-+ if (seen_or_pass0 & SEEN_XREG)
-+ EMIT4(0x48, 0x8b, 0x5d, 0xf8); /* mov -8(%rbp),%rbx */
-+ EMIT1(0xc9); /* leaveq */
-+ }
-+ EMIT1(0xc3); /* ret */
-+ break;
-+ case BPF_S_MISC_TAX: /* X = A */
-+ seen |= SEEN_XREG;
-+ EMIT2(0x89, 0xc3); /* mov %eax,%ebx */
-+ break;
-+ case BPF_S_MISC_TXA: /* A = X */
-+ seen |= SEEN_XREG;
-+ EMIT2(0x89, 0xd8); /* mov %ebx,%eax */
-+ break;
-+ case BPF_S_LD_IMM: /* A = K */
-+ if (!K)
-+ CLEAR_A();
-+ else
-+ EMIT1_off32(0xb8, K); /* mov $imm32,%eax */
-+ break;
-+ case BPF_S_LDX_IMM: /* X = K */
-+ seen |= SEEN_XREG;
-+ if (!K)
-+ CLEAR_X();
-+ else
-+ EMIT1_off32(0xbb, K); /* mov $imm32,%ebx */
-+ break;
-+ case BPF_S_LD_MEM: /* A = mem[K] : mov off8(%rbp),%eax */
-+ seen |= SEEN_MEM;
-+ EMIT3(0x8b, 0x45, 0xf0 - K*4);
-+ break;
-+ case BPF_S_LDX_MEM: /* X = mem[K] : mov off8(%rbp),%ebx */
-+ seen |= SEEN_XREG | SEEN_MEM;
-+ EMIT3(0x8b, 0x5d, 0xf0 - K*4);
-+ break;
-+ case BPF_S_ST: /* mem[K] = A : mov %eax,off8(%rbp) */
-+ seen |= SEEN_MEM;
-+ EMIT3(0x89, 0x45, 0xf0 - K*4);
-+ break;
-+ case BPF_S_STX: /* mem[K] = X : mov %ebx,off8(%rbp) */
-+ seen |= SEEN_XREG | SEEN_MEM;
-+ EMIT3(0x89, 0x5d, 0xf0 - K*4);
-+ break;
-+ case BPF_S_LD_W_LEN: /* A = skb->len; */
-+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4);
-+ if (is_imm8(offsetof(struct sk_buff, len)))
-+ /* mov off8(%rdi),%eax */
-+ EMIT3(0x8b, 0x47, offsetof(struct sk_buff, len));
-+ else {
-+ EMIT2(0x8b, 0x87);
-+ EMIT(offsetof(struct sk_buff, len), 4);
-+ }
-+ break;
-+ case BPF_S_LDX_W_LEN: /* X = skb->len; */
-+ seen |= SEEN_XREG;
-+ if (is_imm8(offsetof(struct sk_buff, len)))
-+ /* mov off8(%rdi),%ebx */
-+ EMIT3(0x8b, 0x5f, offsetof(struct sk_buff, len));
-+ else {
-+ EMIT2(0x8b, 0x9f);
-+ EMIT(offsetof(struct sk_buff, len), 4);
-+ }
-+ break;
-+ case BPF_S_ANC_PROTOCOL: /* A = ntohs(skb->protocol); */
-+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, protocol) != 2);
-+ if (is_imm8(offsetof(struct sk_buff, protocol))) {
-+ /* movzwl off8(%rdi),%eax */
-+ EMIT4(0x0f, 0xb7, 0x47, offsetof(struct sk_buff, protocol));
-+ } else {
-+ EMIT3(0x0f, 0xb7, 0x87); /* movzwl off32(%rdi),%eax */
-+ EMIT(offsetof(struct sk_buff, protocol), 4);
-+ }
-+ EMIT2(0x86, 0xc4); /* ntohs() : xchg %al,%ah */
-+ break;
-+ case BPF_S_ANC_IFINDEX:
-+ if (is_imm8(offsetof(struct sk_buff, dev))) {
-+ /* movq off8(%rdi),%rax */
-+ EMIT4(0x48, 0x8b, 0x47, offsetof(struct sk_buff, dev));
-+ } else {
-+ EMIT3(0x48, 0x8b, 0x87); /* movq off32(%rdi),%rax */
-+ EMIT(offsetof(struct sk_buff, dev), 4);
-+ }
-+ EMIT3(0x48, 0x85, 0xc0); /* test %rax,%rax */
-+ EMIT_COND_JMP(X86_JE, cleanup_addr - (addrs[i] - 6));
-+ BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, ifindex) != 4);
-+ EMIT2(0x8b, 0x80); /* mov off32(%rax),%eax */
-+ EMIT(offsetof(struct net_device, ifindex), 4);
-+ break;
-+ case BPF_S_ANC_MARK:
-+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, mark) != 4);
-+ if (is_imm8(offsetof(struct sk_buff, mark))) {
-+ /* mov off8(%rdi),%eax */
-+ EMIT3(0x8b, 0x47, offsetof(struct sk_buff, mark));
-+ } else {
-+ EMIT2(0x8b, 0x87);
-+ EMIT(offsetof(struct sk_buff, mark), 4);
-+ }
-+ break;
-+ case BPF_S_ANC_RXHASH:
-+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
-+ if (is_imm8(offsetof(struct sk_buff, hash))) {
-+ /* mov off8(%rdi),%eax */
-+ EMIT3(0x8b, 0x47, offsetof(struct sk_buff, hash));
-+ } else {
-+ EMIT2(0x8b, 0x87);
-+ EMIT(offsetof(struct sk_buff, hash), 4);
-+ }
-+ break;
-+ case BPF_S_ANC_QUEUE:
-+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, queue_mapping) != 2);
-+ if (is_imm8(offsetof(struct sk_buff, queue_mapping))) {
-+ /* movzwl off8(%rdi),%eax */
-+ EMIT4(0x0f, 0xb7, 0x47, offsetof(struct sk_buff, queue_mapping));
-+ } else {
-+ EMIT3(0x0f, 0xb7, 0x87); /* movzwl off32(%rdi),%eax */
-+ EMIT(offsetof(struct sk_buff, queue_mapping), 4);
-+ }
-+ break;
-+ case BPF_S_ANC_CPU:
-+#ifdef CONFIG_SMP
-+ EMIT4(0x65, 0x8b, 0x04, 0x25); /* mov %gs:off32,%eax */
-+ EMIT((u32)(unsigned long)&cpu_number, 4); /* A = smp_processor_id(); */
-+#else
-+ CLEAR_A();
-+#endif
-+ break;
-+ case BPF_S_ANC_VLAN_TAG:
-+ case BPF_S_ANC_VLAN_TAG_PRESENT:
-+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2);
-+ if (is_imm8(offsetof(struct sk_buff, vlan_tci))) {
-+ /* movzwl off8(%rdi),%eax */
-+ EMIT4(0x0f, 0xb7, 0x47, offsetof(struct sk_buff, vlan_tci));
-+ } else {
-+ EMIT3(0x0f, 0xb7, 0x87); /* movzwl off32(%rdi),%eax */
-+ EMIT(offsetof(struct sk_buff, vlan_tci), 4);
-+ }
-+ BUILD_BUG_ON(VLAN_TAG_PRESENT != 0x1000);
-+ if (filter[i].code == BPF_S_ANC_VLAN_TAG) {
-+ EMIT3(0x80, 0xe4, 0xef); /* and $0xef,%ah */
-+ } else {
-+ EMIT3(0xc1, 0xe8, 0x0c); /* shr $0xc,%eax */
-+ EMIT3(0x83, 0xe0, 0x01); /* and $0x1,%eax */
-+ }
-+ break;
-+ case BPF_S_ANC_PKTTYPE:
-+ {
-+ int off = pkt_type_offset();
-+
-+ if (off < 0)
-+ goto out;
-+ if (is_imm8(off)) {
-+ /* movzbl off8(%rdi),%eax */
-+ EMIT4(0x0f, 0xb6, 0x47, off);
-+ } else {
-+ /* movbl off32(%rdi),%eax */
-+ EMIT3(0x0f, 0xb6, 0x87);
-+ EMIT(off, 4);
-+ }
-+ EMIT3(0x83, 0xe0, PKT_TYPE_MAX); /* and $0x7,%eax */
-+ break;
-+ }
-+ case BPF_S_LD_W_ABS:
-+ func = CHOOSE_LOAD_FUNC(K, sk_load_word);
-+common_load: seen |= SEEN_DATAREF;
-+ t_offset = func - (image + addrs[i]);
-+ EMIT1_off32(0xbe, K); /* mov imm32,%esi */
-+ EMIT1_off32(0xe8, t_offset); /* call */
-+ break;
-+ case BPF_S_LD_H_ABS:
-+ func = CHOOSE_LOAD_FUNC(K, sk_load_half);
-+ goto common_load;
-+ case BPF_S_LD_B_ABS:
-+ func = CHOOSE_LOAD_FUNC(K, sk_load_byte);
-+ goto common_load;
-+ case BPF_S_LDX_B_MSH:
-+ func = CHOOSE_LOAD_FUNC(K, sk_load_byte_msh);
-+ seen |= SEEN_DATAREF | SEEN_XREG;
-+ t_offset = func - (image + addrs[i]);
-+ EMIT1_off32(0xbe, K); /* mov imm32,%esi */
-+ EMIT1_off32(0xe8, t_offset); /* call sk_load_byte_msh */
-+ break;
-+ case BPF_S_LD_W_IND:
-+ func = sk_load_word;
-+common_load_ind: seen |= SEEN_DATAREF | SEEN_XREG;
-+ t_offset = func - (image + addrs[i]);
-+ if (K) {
-+ if (is_imm8(K)) {
-+ EMIT3(0x8d, 0x73, K); /* lea imm8(%rbx), %esi */
-+ } else {
-+ EMIT2_off32(0x8d, 0xb3, K); /* lea imm32(%rbx),%esi */
-+ }
-+ } else {
-+ EMIT2(0x89,0xde); /* mov %ebx,%esi */
-+ }
-+ EMIT1_off32(0xe8, t_offset); /* call sk_load_xxx_ind */
-+ break;
-+ case BPF_S_LD_H_IND:
-+ func = sk_load_half;
-+ goto common_load_ind;
-+ case BPF_S_LD_B_IND:
-+ func = sk_load_byte;
-+ goto common_load_ind;
-+ case BPF_S_JMP_JA:
-+ t_offset = addrs[i + K] - addrs[i];
-+ EMIT_JMP(t_offset);
-+ break;
-+ COND_SEL(BPF_S_JMP_JGT_K, X86_JA, X86_JBE);
-+ COND_SEL(BPF_S_JMP_JGE_K, X86_JAE, X86_JB);
-+ COND_SEL(BPF_S_JMP_JEQ_K, X86_JE, X86_JNE);
-+ COND_SEL(BPF_S_JMP_JSET_K,X86_JNE, X86_JE);
-+ COND_SEL(BPF_S_JMP_JGT_X, X86_JA, X86_JBE);
-+ COND_SEL(BPF_S_JMP_JGE_X, X86_JAE, X86_JB);
-+ COND_SEL(BPF_S_JMP_JEQ_X, X86_JE, X86_JNE);
-+ COND_SEL(BPF_S_JMP_JSET_X,X86_JNE, X86_JE);
-+
-+cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
-+ t_offset = addrs[i + filter[i].jt] - addrs[i];
-+
-+ /* same targets, can avoid doing the test :) */
-+ if (filter[i].jt == filter[i].jf) {
-+ EMIT_JMP(t_offset);
-+ break;
-+ }
-+
-+ switch (filter[i].code) {
-+ case BPF_S_JMP_JGT_X:
-+ case BPF_S_JMP_JGE_X:
-+ case BPF_S_JMP_JEQ_X:
-+ seen |= SEEN_XREG;
-+ EMIT2(0x39, 0xd8); /* cmp %ebx,%eax */
-+ break;
-+ case BPF_S_JMP_JSET_X:
-+ seen |= SEEN_XREG;
-+ EMIT2(0x85, 0xd8); /* test %ebx,%eax */
-+ break;
-+ case BPF_S_JMP_JEQ_K:
-+ if (K == 0) {
-+ EMIT2(0x85, 0xc0); /* test %eax,%eax */
-+ break;
-+ }
-+ case BPF_S_JMP_JGT_K:
-+ case BPF_S_JMP_JGE_K:
-+ if (K <= 127)
-+ EMIT3(0x83, 0xf8, K); /* cmp imm8,%eax */
-+ else
-+ EMIT1_off32(0x3d, K); /* cmp imm32,%eax */
-+ break;
-+ case BPF_S_JMP_JSET_K:
-+ if (K <= 0xFF)
-+ EMIT2(0xa8, K); /* test imm8,%al */
-+ else if (!(K & 0xFFFF00FF))
-+ EMIT3(0xf6, 0xc4, K >> 8); /* test imm8,%ah */
-+ else if (K <= 0xFFFF) {
-+ EMIT2(0x66, 0xa9); /* test imm16,%ax */
-+ EMIT(K, 2);
-+ } else {
-+ EMIT1_off32(0xa9, K); /* test imm32,%eax */
-+ }
-+ break;
-+ }
-+ if (filter[i].jt != 0) {
-+ if (filter[i].jf && f_offset)
-+ t_offset += is_near(f_offset) ? 2 : 5;
-+ EMIT_COND_JMP(t_op, t_offset);
-+ if (filter[i].jf)
-+ EMIT_JMP(f_offset);
-+ break;
-+ }
-+ EMIT_COND_JMP(f_op, f_offset);
-+ break;
-+ default:
-+ /* hmm, too complex filter, give up with jit compiler */
-+ goto out;
-+ }
-+ ilen = prog - temp;
-+ if (image) {
-+ if (unlikely(proglen + ilen > oldproglen)) {
-+ pr_err("bpb_jit_compile fatal error\n");
-+ kfree(addrs);
-+ module_free_exec(NULL, image);
-+ return;
-+ }
-+ pax_open_kernel();
-+ memcpy(image + proglen, temp, ilen);
-+ pax_close_kernel();
-+ }
-+ proglen += ilen;
-+ addrs[i] = proglen;
-+ prog = temp;
-+ }
-+ /* last bpf instruction is always a RET :
-+ * use it to give the cleanup instruction(s) addr
-+ */
-+ cleanup_addr = proglen - 1; /* ret */
-+ if (seen_or_pass0)
-+ cleanup_addr -= 1; /* leaveq */
-+ if (seen_or_pass0 & SEEN_XREG)
-+ cleanup_addr -= 4; /* mov -8(%rbp),%rbx */
-+
if (image) {
- if (proglen != oldproglen)
-- pr_err("bpf_jit: proglen=%d != oldproglen=%d\n",
-- proglen, oldproglen);
-+ pr_err("bpb_jit_compile proglen=%u != oldproglen=%u\n", proglen, oldproglen);
- break;
- }
- if (proglen == oldproglen) {
-@@ -918,32 +872,30 @@ void bpf_int_jit_compile(struct sk_filter *prog)
- }
-
- if (bpf_jit_enable > 1)
-- bpf_jit_dump(prog->len, proglen, 0, image);
-+ bpf_jit_dump(flen, proglen, pass, image);
+@@ -922,7 +924,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
if (image) {
bpf_flush_icache(header, image + proglen);
- set_memory_ro((unsigned long)header, header->pages);
-- prog->bpf_func = (void *)image;
-- prog->jited = 1;
-+ fp->bpf_func = (void *)image;
+ prog->bpf_func = (void *)image;
+ prog->jited = 1;
}
- out:
+@@ -930,23 +931,16 @@ out:
kfree(addrs);
-+ return;
}
- static void bpf_jit_free_deferred(struct work_struct *work)
- {
- struct sk_filter *fp = container_of(work, struct sk_filter, work);
- unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;
+-static void bpf_jit_free_deferred(struct work_struct *work)
+-{
+- struct bpf_prog *fp = container_of(work, struct bpf_prog, work);
+- unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;
- struct bpf_binary_header *header = (void *)addr;
-
+-
- set_memory_rw(addr, header->pages);
- module_free(NULL, header);
+- kfree(fp);
+-}
+-
+ void bpf_jit_free(struct bpf_prog *fp)
+ {
+- if (fp->jited) {
+- INIT_WORK(&fp->work, bpf_jit_free_deferred);
+- schedule_work(&fp->work);
+- } else {
+- kfree(fp);
+- }
++ unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;
++
++ if (!fp->jited)
++ goto free_filter;
++
+ set_memory_rw(addr, 1);
+ module_free_exec(NULL, (void *)addr);
- kfree(fp);
++
++free_filter:
++ bpf_prog_unlock_free(fp);
}
-
- void bpf_jit_free(struct sk_filter *fp)
- {
-- if (fp->jited) {
-+ if (fp->bpf_func != sk_run_filter) {
- INIT_WORK(&fp->work, bpf_jit_free_deferred);
- schedule_work(&fp->work);
- } else {
diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
index 5d04be5..2beeaa2 100644
--- a/arch/x86/oprofile/backtrace.c
struct op_counter_config;
diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
-index 84b9d67..260e5ff 100644
+index b9958c3..24229ab 100644
--- a/arch/x86/pci/intel_mid_pci.c
+++ b/arch/x86/pci/intel_mid_pci.c
-@@ -245,7 +245,7 @@ int __init intel_mid_pci_init(void)
- pr_info("Intel MID platform detected, using MID PCI ops\n");
+@@ -250,7 +250,7 @@ int __init intel_mid_pci_init(void)
pci_mmcfg_late_init();
pcibios_enable_irq = intel_mid_pci_irq_enable;
+ pcibios_disable_irq = intel_mid_pci_irq_disable;
- pci_root_ops = intel_mid_pci_ops;
+ memcpy((void *)&pci_root_ops, &intel_mid_pci_ops, sizeof pci_root_ops);
pci_soc_mode = 1;
/* Continue with standard init */
return 1;
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
-index 84112f5..6334d60 100644
+index eb500c2..eab9e70 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
-@@ -50,7 +50,7 @@ struct irq_router {
+@@ -51,7 +51,7 @@ struct irq_router {
struct irq_router_handler {
u16 vendor;
int (*probe)(struct irq_router *r, struct pci_dev *router, u16 device);
+} __do_const;
int (*pcibios_enable_irq)(struct pci_dev *dev) = pirq_enable_irq;
- void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
-@@ -790,7 +790,7 @@ static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router
+ void (*pcibios_disable_irq)(struct pci_dev *dev) = pirq_disable_irq;
+@@ -791,7 +791,7 @@ static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router
return 0;
}
{ PCI_VENDOR_ID_INTEL, intel_router_probe },
{ PCI_VENDOR_ID_AL, ali_router_probe },
{ PCI_VENDOR_ID_ITE, ite_router_probe },
-@@ -817,7 +817,7 @@ static struct pci_dev *pirq_router_dev;
+@@ -818,7 +818,7 @@ static struct pci_dev *pirq_router_dev;
static void __init pirq_find_router(struct irq_router *r)
{
struct irq_routing_table *rt = pirq_table;
#ifdef CONFIG_PCI_BIOS
if (!rt->signature) {
-@@ -1090,7 +1090,7 @@ static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d)
+@@ -1091,7 +1091,7 @@ static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d)
return 0;
}
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 290d397..3906bcd 100644
+index 290d397..e09d270 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -99,6 +99,11 @@ void __init efi_call_phys_prelog(void)
__flush_tlb_all();
local_irq_restore(efi_flags);
early_code_mapping_set_exec(0);
+@@ -146,8 +156,23 @@ int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
+ unsigned npages;
+ pgd_t *pgd;
+
+- if (efi_enabled(EFI_OLD_MEMMAP))
++ if (efi_enabled(EFI_OLD_MEMMAP)) {
++ /* PaX: We need to disable the NX bit in the PGD, otherwise we won't be
++ * able to execute the EFI services.
++ */
++ if (__supported_pte_mask & _PAGE_NX) {
++ unsigned long addr = (unsigned long) __va(0);
++ pgd_t pe = __pgd(pgd_val(*pgd_offset_k(addr)) & ~_PAGE_NX);
++
++ pr_alert("PAX: Disabling NX protection for low memory map. Try booting without \"efi=old_map\"\n");
++#ifdef CONFIG_PAX_PER_CPU_PGD
++ set_pgd(pgd_offset_cpu(0, kernel, addr), pe);
++#endif
++ set_pgd(pgd_offset_k(addr), pe);
++ }
++
+ return 0;
++ }
+
+ efi_scratch.efi_pgt = (pgd_t *)(unsigned long)real_mode_header->trampoline_pgd;
+ pgd = __va(efi_scratch.efi_pgt);
diff --git a/arch/x86/platform/efi/efi_stub_32.S b/arch/x86/platform/efi/efi_stub_32.S
index fbe66e6..eae5e38 100644
--- a/arch/x86/platform/efi/efi_stub_32.S
.long 0
efi_rt_function_ptr:
diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S
-index 5fcda72..b9d1d65 100644
+index 5fcda72..cd4dc41 100644
--- a/arch/x86/platform/efi/efi_stub_64.S
+++ b/arch/x86/platform/efi/efi_stub_64.S
@@ -11,6 +11,7 @@
ret
ENDPROC(efi_call)
+@@ -245,8 +247,8 @@ efi_gdt64:
+ .long 0 /* Filled out by user */
+ .word 0
+ .quad 0x0000000000000000 /* NULL descriptor */
+- .quad 0x00af9a000000ffff /* __KERNEL_CS */
+- .quad 0x00cf92000000ffff /* __KERNEL_DS */
++ .quad 0x00af9b000000ffff /* __KERNEL_CS */
++ .quad 0x00cf93000000ffff /* __KERNEL_DS */
+ .quad 0x0080890000000000 /* TS descriptor */
+ .quad 0x0000000000000000 /* TS continued */
+ efi_gdt64_end:
diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c
index 1bbedc4..eb795b5 100644
--- a/arch/x86/platform/intel-mid/intel-mid.c
}
static unsigned long __init intel_mid_calibrate_tsc(void)
+diff --git a/arch/x86/platform/intel-mid/intel_mid_weak_decls.h b/arch/x86/platform/intel-mid/intel_mid_weak_decls.h
+index 46aa25c..59a68ed 100644
+--- a/arch/x86/platform/intel-mid/intel_mid_weak_decls.h
++++ b/arch/x86/platform/intel-mid/intel_mid_weak_decls.h
+@@ -10,10 +10,9 @@
+ */
+
+
+-/* __attribute__((weak)) makes these declarations overridable */
+ /* For every CPU addition a new get_<cpuname>_ops interface needs
+ * to be added.
+ */
+-extern void *get_penwell_ops(void) __attribute__((weak));
+-extern void *get_cloverview_ops(void) __attribute__((weak));
+-extern void *get_tangier_ops(void) __attribute__((weak));
++extern const void *get_penwell_ops(void);
++extern const void *get_cloverview_ops(void);
++extern const void *get_tangier_ops(void);
+diff --git a/arch/x86/platform/intel-mid/mfld.c b/arch/x86/platform/intel-mid/mfld.c
+index 23381d2..8ddc10e 100644
+--- a/arch/x86/platform/intel-mid/mfld.c
++++ b/arch/x86/platform/intel-mid/mfld.c
+@@ -64,12 +64,12 @@ static void __init penwell_arch_setup(void)
+ pm_power_off = mfld_power_off;
+ }
+
+-void *get_penwell_ops(void)
++const void *get_penwell_ops(void)
+ {
+ return &penwell_ops;
+ }
+
+-void *get_cloverview_ops(void)
++const void *get_cloverview_ops(void)
+ {
+ return &penwell_ops;
+ }
+diff --git a/arch/x86/platform/intel-mid/mrfl.c b/arch/x86/platform/intel-mid/mrfl.c
+index aaca917..66eadbc 100644
+--- a/arch/x86/platform/intel-mid/mrfl.c
++++ b/arch/x86/platform/intel-mid/mrfl.c
+@@ -97,7 +97,7 @@ static struct intel_mid_ops tangier_ops = {
+ .arch_setup = tangier_arch_setup,
+ };
+
+-void *get_tangier_ops(void)
++const void *get_tangier_ops(void)
+ {
+ return &tangier_ops;
+ }
diff --git a/arch/x86/platform/olpc/olpc_dt.c b/arch/x86/platform/olpc/olpc_dt.c
index d6ee929..3637cb5 100644
--- a/arch/x86/platform/olpc/olpc_dt.c
.getproplen = olpc_dt_getproplen,
.getproperty = olpc_dt_getproperty,
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
-index 424f4c9..f2a2988 100644
+index 6ec7910..ecdbb11 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -137,11 +137,8 @@ static void do_fpu_end(void)
return 0;
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
-index 61b04fe..3134230 100644
+index 5a4affe..9e2d522 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
-@@ -170,7 +170,7 @@ quiet_cmd_vdso = VDSO $@
+@@ -174,7 +174,7 @@ quiet_cmd_vdso = VDSO $@
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
GCOV_PROFILE := n
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
-index e4f7781..ab5ab26 100644
+index e904c27..b9eaa03 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -14,6 +14,7 @@
#ifdef CONFIG_COMPAT_VDSO
#define VDSO_DEFAULT 0
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
-index 5a5176d..e570acd 100644
+index 970463b..da82d3e 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -16,10 +16,9 @@
+
if (calculate_addr) {
addr = vdso_addr(current->mm->start_stack,
- image->sym_end_mapping);
-@@ -110,13 +114,13 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
-
+ image->size - image->sym_vvar_start);
+@@ -111,14 +115,14 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
down_write(&mm->mmap_sem);
-- addr = get_unmapped_area(NULL, addr, image->sym_end_mapping, 0, 0);
-+ addr = get_unmapped_area(NULL, addr, image->sym_end_mapping, 0, MAP_EXECUTABLE);
+ addr = get_unmapped_area(NULL, addr,
+- image->size - image->sym_vvar_start, 0, 0);
++ image->size - image->sym_vvar_start, 0, MAP_EXECUTABLE);
if (IS_ERR_VALUE(addr)) {
ret = addr;
goto up_fail;
}
-- current->mm->context.vdso = (void __user *)addr;
-+ mm->context.vdso = addr;
+ text_start = addr - image->sym_vvar_start;
+- current->mm->context.vdso = (void __user *)text_start;
++ mm->context.vdso = text_start;
/*
* MAYWRITE to allow gdb to COW and set breakpoints
-@@ -161,15 +165,12 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
+@@ -163,15 +167,12 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
hpet_address >> PAGE_SHIFT,
PAGE_SIZE,
pgprot_noncached(PAGE_READONLY));
up_write(&mm->mmap_sem);
return ret;
-@@ -189,8 +190,8 @@ static int load_vdso32(void)
+@@ -191,8 +192,8 @@ static int load_vdso32(void)
if (selected_vdso32->sym_VDSO32_SYSENTER_RETURN)
current_thread_info()->sysenter_return =
return 0;
}
-@@ -199,9 +200,6 @@ static int load_vdso32(void)
+@@ -201,9 +202,6 @@ static int load_vdso32(void)
#ifdef CONFIG_X86_64
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
{
return map_vdso(&vdso_image_64, true);
}
-@@ -210,12 +208,8 @@ int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
+@@ -212,12 +210,8 @@ int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
int uses_interp)
{
#ifdef CONFIG_X86_X32_ABI
#endif
return load_vdso32();
-@@ -227,12 +221,3 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+@@ -229,12 +223,3 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
return load_vdso32();
}
#endif
This is the Linux Xen port. Enabling this will allow the
kernel to boot in a paravirtualized environment under the
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
-index ffb101e..98c0ecf 100644
+index c0cb11f..bed56ff 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -123,8 +123,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
#ifdef CONFIG_ACPI_NUMA
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
-index e8a1201..046c66c 100644
+index 16fb009..02b7801 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -379,7 +379,7 @@ static pteval_t pte_mfn_to_pfn(pteval_t val)
{
if (val & _PAGE_PRESENT) {
unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
-@@ -1904,6 +1904,9 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
- /* L3_k[510] -> level2_kernel_pgt
- * L3_i[511] -> level2_fixmap_pgt */
+@@ -1904,7 +1904,11 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
+ * L3_k[511] -> level2_fixmap_pgt */
convert_pfn_mfn(level3_kernel_pgt);
+
+ convert_pfn_mfn(level3_vmalloc_start_pgt);
+ convert_pfn_mfn(level3_vmalloc_end_pgt);
+ convert_pfn_mfn(level3_vmemmap_pgt);
+ /* L3_k[511][506] -> level1_fixmap_pgt */
++ /* L3_k[511][507] -> level1_vsyscall_pgt */
+ convert_pfn_mfn(level2_fixmap_pgt);
}
/* We get [511][511] and have Xen's version of level2_kernel_pgt */
- l3 = m2v(pgd[pgd_index(__START_KERNEL_map)].pgd);
-@@ -1933,8 +1936,12 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
+@@ -1929,11 +1933,16 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);
set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
+ set_page_prot(level2_vmemmap_pgt, PAGE_KERNEL_RO);
set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
+ set_page_prot(level1_fixmap_pgt, PAGE_KERNEL_RO);
++ set_page_prot(level1_vsyscall_pgt, PAGE_KERNEL_RO);
-@@ -2120,6 +2127,7 @@ static void __init xen_post_allocator_init(void)
+ /* Pin down new L4 */
+ pin_pagetable_pfn(MMUEXT_PIN_L4_TABLE,
+@@ -2117,6 +2126,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;
#endif
/* This will work as long as patching hasn't happened yet
-@@ -2198,6 +2206,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
+@@ -2195,6 +2205,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,
mov %rsi,xen_start_info
mov $init_thread_union+THREAD_SIZE,%rsp
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
-index 97d8765..c4526ec 100644
+index 28c7e0b..2acfec7 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -10,8 +10,6 @@
#define XCHAL_ICACHE_SIZE 32768 /* I-cache size in bytes or 0 */
#define XCHAL_DCACHE_SIZE 32768 /* D-cache size in bytes or 0 */
diff --git a/block/bio.c b/block/bio.c
-index 0ec61c9..93b94060 100644
+index 3e6331d..f970433 100644
--- a/block/bio.c
+++ b/block/bio.c
-@@ -1159,7 +1159,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
+@@ -1160,7 +1160,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
/*
* Overflow, abort
*/
return ERR_PTR(-EINVAL);
nr_pages += end - start;
-@@ -1293,7 +1293,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
+@@ -1294,7 +1294,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
/*
* Overflow, abort
*/
return ERR_PTR(-EINVAL);
nr_pages += end - start;
-@@ -1555,7 +1555,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err)
+@@ -1556,7 +1556,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;
bio_for_each_segment_all(bvec, bio, i) {
char *addr = page_address(bvec->bv_page);
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
-index 28d227c..d4c0bad 100644
+index e17da94..e01cce1 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -822,7 +822,7 @@ static void blkcg_css_free(struct cgroup_subsys_state *css)
if (blk_verify_command(rq->cmd, has_write_perm))
return -EPERM;
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
-index a0926a6..b2b14b2 100644
+index 18b282c..050dbe5 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -156,7 +156,7 @@ static int compat_cdrom_generic_command(struct block_device *bdev, fmode_t mode,
err = -EFAULT;
goto out;
diff --git a/block/genhd.c b/block/genhd.c
-index 791f419..89f21c4 100644
+index e6723bd..703e4ac 100644
--- a/block/genhd.c
+++ b/block/genhd.c
-@@ -467,21 +467,24 @@ static char *bdevt_str(dev_t devt, char *buf)
+@@ -469,21 +469,24 @@ static char *bdevt_str(dev_t devt, char *buf)
/*
* Register device numbers dev..(dev+range-1)
EXPORT_SYMBOL(blk_unregister_region);
diff --git a/block/partitions/efi.c b/block/partitions/efi.c
-index dc51f46..d5446a8 100644
+index 56d08fd..2e07090 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -293,14 +293,14 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state,
(u8 *) pte, count) < count) {
kfree(pte);
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
-index 14695c6..27a4636 100644
+index 9b8eaec..c20279a 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -67,7 +67,7 @@ static int scsi_get_bus(struct request_queue *q, int __user *p)
{
return jiffies_to_clock_t(q->sg_timeout);
}
-@@ -220,8 +220,20 @@ EXPORT_SYMBOL(blk_verify_command);
+@@ -227,8 +227,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)
{
if (blk_verify_command(rq->cmd, mode & FMODE_WRITE))
return -EPERM;
-@@ -413,6 +425,8 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
+@@ -432,6 +444,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];
if (!sic)
return -EINVAL;
-@@ -446,9 +460,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
+@@ -470,9 +484,18 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
*/
err = -EFAULT;
rq->cmd_len = cmdlen;
goto error;
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
-index 7bdd61b..afec999 100644
+index e592c90..c566114 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -63,7 +63,7 @@ struct cryptd_blkcipher_ctx {
static void cryptd_queue_worker(struct work_struct *work);
+diff --git a/crypto/cts.c b/crypto/cts.c
+index 042223f..133f087 100644
+--- a/crypto/cts.c
++++ b/crypto/cts.c
+@@ -202,7 +202,8 @@ static int cts_cbc_decrypt(struct crypto_cts_ctx *ctx,
+ /* 5. Append the tail (BB - Ln) bytes of Xn (tmp) to Cn to create En */
+ memcpy(s + bsize + lastn, tmp + lastn, bsize - lastn);
+ /* 6. Decrypt En to create Pn-1 */
+- memset(iv, 0, sizeof(iv));
++ memzero_explicit(iv, sizeof(iv));
++
+ sg_set_buf(&sgsrc[0], s + bsize, bsize);
+ sg_set_buf(&sgdst[0], d, bsize);
+ err = crypto_blkcipher_decrypt_iv(&lcldesc, sgdst, sgsrc, bsize);
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index 309d345..1632720 100644
--- a/crypto/pcrypt.c
if (!ret)
kobject_uevent(&pinst->kobj, KOBJ_ADD);
+diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c
+index 4279480..7bb0474 100644
+--- a/crypto/sha1_generic.c
++++ b/crypto/sha1_generic.c
+@@ -64,7 +64,7 @@ int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
+ src = data + done;
+ } while (done + SHA1_BLOCK_SIZE <= len);
+
+- memset(temp, 0, sizeof(temp));
++ memzero_explicit(temp, sizeof(temp));
+ partial = 0;
+ }
+ memcpy(sctx->buffer + partial, src, len - done);
+diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c
+index 5433667..32c5e5e 100644
+--- a/crypto/sha256_generic.c
++++ b/crypto/sha256_generic.c
+@@ -210,10 +210,9 @@ static void sha256_transform(u32 *state, const u8 *input)
+
+ /* clear any sensitive info... */
+ a = b = c = d = e = f = g = h = t1 = t2 = 0;
+- memset(W, 0, 64 * sizeof(u32));
++ memzero_explicit(W, 64 * sizeof(u32));
+ }
+
+-
+ static int sha224_init(struct shash_desc *desc)
+ {
+ struct sha256_state *sctx = shash_desc_ctx(desc);
+@@ -316,7 +315,7 @@ static int sha224_final(struct shash_desc *desc, u8 *hash)
+ sha256_final(desc, D);
+
+ memcpy(hash, D, SHA224_DIGEST_SIZE);
+- memset(D, 0, SHA256_DIGEST_SIZE);
++ memzero_explicit(D, SHA256_DIGEST_SIZE);
+
+ return 0;
+ }
+diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
+index 6ed124f..04d295a 100644
+--- a/crypto/sha512_generic.c
++++ b/crypto/sha512_generic.c
+@@ -238,7 +238,7 @@ static int sha384_final(struct shash_desc *desc, u8 *hash)
+ sha512_final(desc, D);
+
+ memcpy(hash, D, 48);
+- memset(D, 0, 64);
++ memzero_explicit(D, 64);
+
+ return 0;
+ }
+diff --git a/crypto/tgr192.c b/crypto/tgr192.c
+index 8740355..3c7af0d 100644
+--- a/crypto/tgr192.c
++++ b/crypto/tgr192.c
+@@ -612,7 +612,7 @@ static int tgr160_final(struct shash_desc *desc, u8 * out)
+
+ tgr192_final(desc, D);
+ memcpy(out, D, TGR160_DIGEST_SIZE);
+- memset(D, 0, TGR192_DIGEST_SIZE);
++ memzero_explicit(D, TGR192_DIGEST_SIZE);
+
+ return 0;
+ }
+@@ -623,7 +623,7 @@ static int tgr128_final(struct shash_desc *desc, u8 * out)
+
+ tgr192_final(desc, D);
+ memcpy(out, D, TGR128_DIGEST_SIZE);
+- memset(D, 0, TGR192_DIGEST_SIZE);
++ memzero_explicit(D, TGR192_DIGEST_SIZE);
+
+ return 0;
+ }
+diff --git a/crypto/vmac.c b/crypto/vmac.c
+index 2eb11a3..d84c24b 100644
+--- a/crypto/vmac.c
++++ b/crypto/vmac.c
+@@ -613,7 +613,7 @@ static int vmac_final(struct shash_desc *pdesc, u8 *out)
+ }
+ mac = vmac(ctx->partial, ctx->partial_size, nonce, NULL, ctx);
+ memcpy(out, &mac, sizeof(vmac_t));
+- memset(&mac, 0, sizeof(vmac_t));
++ memzero_explicit(&mac, sizeof(vmac_t));
+ memset(&ctx->__vmac_ctx, 0, sizeof(struct vmac_ctx));
+ ctx->partial_size = 0;
+ return 0;
+diff --git a/crypto/wp512.c b/crypto/wp512.c
+index 180f1d6..ec64e77 100644
+--- a/crypto/wp512.c
++++ b/crypto/wp512.c
+@@ -1102,8 +1102,8 @@ static int wp384_final(struct shash_desc *desc, u8 *out)
+ u8 D[64];
+
+ wp512_final(desc, D);
+- memcpy (out, D, WP384_DIGEST_SIZE);
+- memset (D, 0, WP512_DIGEST_SIZE);
++ memcpy(out, D, WP384_DIGEST_SIZE);
++ memzero_explicit(D, WP512_DIGEST_SIZE);
+
+ return 0;
+ }
+@@ -1113,8 +1113,8 @@ static int wp256_final(struct shash_desc *desc, u8 *out)
+ u8 D[64];
+
+ wp512_final(desc, D);
+- memcpy (out, D, WP256_DIGEST_SIZE);
+- memset (D, 0, WP512_DIGEST_SIZE);
++ memcpy(out, D, WP256_DIGEST_SIZE);
++ memzero_explicit(D, WP512_DIGEST_SIZE);
+
+ return 0;
+ }
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index 6921c7f..78e1af7 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
/*
diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
-index e5bcd91..74f050d 100644
+index 16129c7..8b675cd 100644
--- a/drivers/acpi/apei/apei-internal.h
+++ b/drivers/acpi/apei/apei-internal.h
@@ -19,7 +19,7 @@ typedef int (*apei_exec_ins_func_t)(struct apei_exec_context *ctx,
struct apei_exec_context {
u32 ip;
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
-index dab7cb7..f0d2994 100644
+index fc5f780..e5ac91a 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
-@@ -500,7 +500,7 @@ static void __ghes_print_estatus(const char *pfx,
+@@ -478,7 +478,7 @@ static void __ghes_print_estatus(const char *pfx,
const struct acpi_hest_generic *generic,
- const struct acpi_generic_status *estatus)
+ const struct acpi_hest_generic_status *estatus)
{
- static atomic_t seqno;
+ static atomic_unchecked_t seqno;
unsigned int curr_seqno;
char pfx_seq[64];
-@@ -511,7 +511,7 @@ static void __ghes_print_estatus(const char *pfx,
+@@ -489,7 +489,7 @@ static void __ghes_print_estatus(const char *pfx,
else
pfx = KERN_ERR;
}
bgrt_kobj = kobject_create_and_add("bgrt", acpi_kobj);
if (!bgrt_kobj)
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
-index 3d8413d..95f638c 100644
+index 36eb42e..3b2f47e 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -51,7 +51,7 @@ struct acpi_blacklist_item {
/* parse the table header to get the table length */
if (count <= sizeof(struct acpi_table_header))
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
-index 3dca36d..abaf070 100644
+index 17f9ec5..d9a455e 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -952,7 +952,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
static void delete_gpe_attr_array(void)
{
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
-index d72ce04..d6ab3c2 100644
+index b784e9d..a69a049 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
-@@ -1257,7 +1257,7 @@ int ahci_kick_engine(struct ata_port *ap)
+@@ -1252,7 +1252,7 @@ int ahci_kick_engine(struct ata_port *ap)
}
EXPORT_SYMBOL_GPL(ahci_kick_engine);
unsigned long timeout_msec)
{
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index 677c0c1..354b89b 100644
+index 6f67490..f951ead 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
-@@ -98,7 +98,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
+@@ -99,7 +99,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
static void ata_dev_xfermask(struct ata_device *dev);
static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
struct ata_force_param {
const char *name;
-@@ -4863,7 +4863,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
+@@ -4797,7 +4797,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
struct ata_port *ap;
unsigned int tag;
ap = qc->ap;
qc->flags = 0;
-@@ -4879,7 +4879,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
+@@ -4813,7 +4813,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
struct ata_port *ap;
struct ata_link *link;
WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE));
ap = qc->ap;
link = qc->dev->link;
-@@ -5983,6 +5983,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
+@@ -5917,6 +5917,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
return;
spin_lock(&lock);
for (cur = ops->inherits; cur; cur = cur->inherits) {
void **inherit = (void **)cur;
-@@ -5996,8 +5997,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
+@@ -5930,8 +5931,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops)
if (IS_ERR(*pp))
*pp = NULL;
spin_unlock(&lock);
}
-@@ -6193,7 +6195,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
+@@ -6127,7 +6129,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
/* give ports names and add SCSI hosts */
for (i = 0; i < host->n_ports; i++) {
}
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
-index 72691fd..ad104c0 100644
+index 0586f66..1a8f74a 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4151,7 +4151,7 @@ int ata_sas_port_init(struct ata_port *ap)
}
EXPORT_SYMBOL_GPL(ata_sas_port_init);
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
-index 45b5ab3..98446b8 100644
+index 5f4e0cc..ff2c347 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -53,7 +53,7 @@ enum {
}
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
-index 0e3f8f9..765a7a5 100644
+index 480fa6f..947067c 100644
--- a/drivers/atm/atmtcp.c
+++ b/drivers/atm/atmtcp.c
@@ -206,7 +206,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
return 0;
}
-@@ -299,7 +299,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
- out_vcc = find_vcc(dev, ntohs(hdr->vpi), ntohs(hdr->vci));
+@@ -300,7 +300,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
read_unlock(&vcc_sklist_lock);
if (!out_vcc) {
+ result = -EUNATCH;
- atomic_inc(&vcc->stats->tx_err);
+ atomic_inc_unchecked(&vcc->stats->tx_err);
goto done;
}
skb_pull(skb,sizeof(struct atmtcp_hdr));
-@@ -311,8 +311,8 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
+@@ -312,8 +312,8 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
__net_timestamp(new_skb);
skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
out_vcc->push(out_vcc,new_skb);
if (vcc->pop) vcc->pop(vcc,skb);
else dev_kfree_skb(skb);
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
-index b1955ba..b179940 100644
+index d65975a..0b87e20 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -522,7 +522,7 @@ static int rx_aal0(struct atm_vcc *vcc)
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 aa6be26..f70a785 100644
+index c39702b..785b73b 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
-@@ -1690,7 +1690,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
+@@ -1689,7 +1689,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
if (RBRQ_HBUF_ERR(he_dev->rbrq_head)) {
hprintk("HBUF_ERR! (cid 0x%x)\n", cid);
goto return_host_buffers;
}
-@@ -1717,7 +1717,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
+@@ -1716,7 +1716,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
RBRQ_LEN_ERR(he_dev->rbrq_head)
? "LEN_ERR" : "",
vcc->vpi, vcc->vci);
goto return_host_buffers;
}
-@@ -1769,7 +1769,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
+@@ -1768,7 +1768,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
vcc->push(vcc, skb);
spin_lock(&he_dev->global_lock);
return_host_buffers:
++pdus_assembled;
-@@ -2095,7 +2095,7 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
+@@ -2094,7 +2094,7 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
tpd->vcc->pop(tpd->vcc, tpd->skb);
else
dev_kfree_skb_any(tpd->skb);
}
pci_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status));
return;
-@@ -2507,7 +2507,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
+@@ -2506,7 +2506,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
vcc->pop(vcc, skb);
else
dev_kfree_skb_any(skb);
return -EINVAL;
}
-@@ -2518,7 +2518,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
+@@ -2517,7 +2517,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
vcc->pop(vcc, skb);
else
dev_kfree_skb_any(skb);
return -EINVAL;
}
#endif
-@@ -2530,7 +2530,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
+@@ -2529,7 +2529,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
vcc->pop(vcc, skb);
else
dev_kfree_skb_any(skb);
spin_unlock_irqrestore(&he_dev->global_lock, flags);
return -ENOMEM;
}
-@@ -2572,7 +2572,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
+@@ -2571,7 +2571,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
vcc->pop(vcc, skb);
else
dev_kfree_skb_any(skb);
spin_unlock_irqrestore(&he_dev->global_lock, flags);
return -ENOMEM;
}
-@@ -2603,7 +2603,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
+@@ -2602,7 +2602,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
__enqueue_tpd(he_dev, tpd, cid);
spin_unlock_irqrestore(&he_dev->global_lock, flags);
// free the skb
hrz_kfree_skb (skb);
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
-index b621f56..1e3a799 100644
+index 2b24ed0..b3d6acc 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
-@@ -812,7 +812,7 @@ drain_scq(struct idt77252_dev *card, struct vc_map *vc)
+@@ -810,7 +810,7 @@ drain_scq(struct idt77252_dev *card, struct vc_map *vc)
else
dev_kfree_skb(skb);
}
atomic_dec(&scq->used);
-@@ -1075,13 +1075,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1072,13 +1072,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
if ((sb = dev_alloc_skb(64)) == NULL) {
printk("%s: Can't allocate buffers for aal0.\n",
card->name);
dev_kfree_skb(sb);
break;
}
-@@ -1098,7 +1098,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1095,7 +1095,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
ATM_SKB(sb)->vcc = vcc;
__net_timestamp(sb);
vcc->push(vcc, sb);
cell += ATM_CELL_PAYLOAD;
}
-@@ -1135,13 +1135,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1132,13 +1132,13 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
"(CDC: %08x)\n",
card->name, len, rpp->len, readl(SAR_REG_CDC));
recycle_rx_pool_skb(card, rpp);
return;
}
if (skb_queue_len(&rpp->queue) > 1) {
-@@ -1152,7 +1152,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1149,7 +1149,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
RXPRINTK("%s: Can't alloc RX skb.\n",
card->name);
recycle_rx_pool_skb(card, rpp);
return;
}
if (!atm_charge(vcc, skb->truesize)) {
-@@ -1171,7 +1171,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1168,7 +1168,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
__net_timestamp(skb);
vcc->push(vcc, skb);
return;
}
-@@ -1193,7 +1193,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
+@@ -1190,7 +1190,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
__net_timestamp(skb);
vcc->push(vcc, skb);
if (skb->truesize > SAR_FB_SIZE_3)
add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
-@@ -1304,14 +1304,14 @@ idt77252_rx_raw(struct idt77252_dev *card)
+@@ -1301,14 +1301,14 @@ idt77252_rx_raw(struct idt77252_dev *card)
if (vcc->qos.aal != ATM_AAL0) {
RPRINTK("%s: raw cell for non AAL0 vc %u.%u\n",
card->name, vpi, vci);
goto drop;
}
-@@ -1330,7 +1330,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
+@@ -1327,7 +1327,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
ATM_SKB(sb)->vcc = vcc;
__net_timestamp(sb);
vcc->push(vcc, sb);
drop:
skb_pull(queue, 64);
-@@ -1955,13 +1955,13 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
+@@ -1952,13 +1952,13 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
if (vc == NULL) {
printk("%s: NULL connection in send().\n", card->name);
dev_kfree_skb(skb);
return -EINVAL;
}
-@@ -1973,14 +1973,14 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
+@@ -1970,14 +1970,14 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
break;
default:
printk("%s: Unsupported AAL: %d\n", card->name, vcc->qos.aal);
dev_kfree_skb(skb);
return -EINVAL;
}
-@@ -1988,7 +1988,7 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
+@@ -1985,7 +1985,7 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
err = queue_skb(card, vc, skb, oam);
if (err) {
dev_kfree_skb(skb);
return err;
}
-@@ -2011,7 +2011,7 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags)
+@@ -2008,7 +2008,7 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags)
skb = dev_alloc_skb(64);
if (!skb) {
printk("%s: Out of memory in send_oam().\n", card->name);
}
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
-index 943cf0d..37d15d5 100644
+index 7652e8d..db45069 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -838,7 +838,7 @@ static void solos_bh(unsigned long card_arg)
while (1) {
spin_lock(&req_lock);
diff --git a/drivers/base/node.c b/drivers/base/node.c
-index 8f7ed99..700dd0c 100644
+index d51c49c..28908df 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
-@@ -624,7 +624,7 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
+@@ -623,7 +623,7 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
struct node_attr {
struct device_attribute attr;
enum node_states state;
}
EXPORT_SYMBOL_GPL(unregister_syscore_ops);
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
-index 4595c22..d4f6c54 100644
+index ff20f19..018f1da 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
-@@ -3011,7 +3011,7 @@ static void start_io(ctlr_info_t *h)
+@@ -3008,7 +3008,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 */
dev_warn(&h->pdev->dev, "fifo full\n");
break;
}
-@@ -3021,7 +3021,7 @@ static void start_io(ctlr_info_t *h)
+@@ -3018,7 +3018,7 @@ static void start_io(ctlr_info_t *h)
h->Qdepth--;
/* Tell the controller execute command */
/* Put job onto the completed Q */
addQ(&h->cmpQ, c);
-@@ -3447,17 +3447,17 @@ startio:
+@@ -3444,17 +3444,17 @@ startio:
static inline unsigned long get_next_completion(ctlr_info_t *h)
{
(h->interrupts_enabled == 0));
}
-@@ -3490,7 +3490,7 @@ static inline u32 next_command(ctlr_info_t *h)
+@@ -3487,7 +3487,7 @@ static inline u32 next_command(ctlr_info_t *h)
u32 a;
if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
a = *(h->reply_pool_head); /* Next cmd in ring buffer */
-@@ -4047,7 +4047,7 @@ static void cciss_put_controller_into_performant_mode(ctlr_info_t *h)
+@@ -4044,7 +4044,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 */
h->transMethod = CFGTBL_Trans_Performant;
return;
-@@ -4321,7 +4321,7 @@ static int cciss_pci_init(ctlr_info_t *h)
+@@ -4318,7 +4318,7 @@ static int cciss_pci_init(ctlr_info_t *h)
if (prod_index < 0)
return -ENODEV;
h->product_name = products[prod_index].product_name;
if (cciss_board_disabled(h)) {
dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
-@@ -5053,7 +5053,7 @@ reinit_after_soft_reset:
+@@ -5050,7 +5050,7 @@ reinit_after_soft_reset:
}
/* make sure the board interrupts are off */
rc = cciss_request_irq(h, do_cciss_msix_intr, do_cciss_intx);
if (rc)
goto clean2;
-@@ -5103,7 +5103,7 @@ reinit_after_soft_reset:
+@@ -5100,7 +5100,7 @@ reinit_after_soft_reset:
* fake ones to scoop up any residual completions.
*/
spin_lock_irqsave(&h->lock, flags);
spin_unlock_irqrestore(&h->lock, flags);
free_irq(h->intr[h->intr_mode], h);
rc = cciss_request_irq(h, cciss_msix_discard_completions,
-@@ -5123,9 +5123,9 @@ reinit_after_soft_reset:
+@@ -5120,9 +5120,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");
rc = controller_reset_failed(h->cfgtable);
if (rc)
-@@ -5148,7 +5148,7 @@ reinit_after_soft_reset:
+@@ -5145,7 +5145,7 @@ reinit_after_soft_reset:
cciss_scsi_setup(h);
/* Turn the interrupts on so we can service requests */
/* Get the firmware version */
inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
-@@ -5220,7 +5220,7 @@ static void cciss_shutdown(struct pci_dev *pdev)
+@@ -5217,7 +5217,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");
cmdlist_t *reqQ;
cmdlist_t *cmpQ;
+diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
+index 426c97a..8c58607 100644
+--- a/drivers/block/drbd/drbd_bitmap.c
++++ b/drivers/block/drbd/drbd_bitmap.c
+@@ -1036,7 +1036,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho
+ submit_bio(rw, bio);
+ /* this should not count as user activity and cause the
+ * resync to throttle -- see drbd_rs_should_slow_down(). */
+- atomic_add(len >> 9, &device->rs_sect_ev);
++ atomic_add_unchecked(len >> 9, &device->rs_sect_ev);
+ }
+ }
+
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
-index a76ceb3..3c1a9fd 100644
+index 1a00001..c0d4253 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
-@@ -331,7 +331,7 @@ struct drbd_epoch {
+@@ -387,7 +387,7 @@ struct drbd_epoch {
struct drbd_connection *connection;
struct list_head list;
unsigned int barrier_nr;
atomic_t active; /* increased on every req. added, and dec on every finished. */
unsigned long flags;
};
-@@ -797,7 +797,7 @@ struct drbd_device {
+@@ -948,7 +948,7 @@ struct drbd_device {
unsigned int al_tr_number;
int al_tr_cycle;
wait_queue_head_t seq_wait;
+ atomic_unchecked_t packet_seq;
unsigned int peer_seq;
spinlock_t peer_seq_lock;
- unsigned int minor;
-@@ -1407,7 +1407,7 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname,
+ unsigned long comm_bm_set; /* communicated number of set bits. */
+@@ -957,8 +957,8 @@ struct drbd_device {
+ struct mutex own_state_mutex;
+ struct mutex *state_mutex; /* either own_state_mutex or first_peer_device(device)->connection->cstate_mutex */
+ char congestion_reason; /* Why we where congested... */
+- atomic_t rs_sect_in; /* for incoming resync data rate, SyncTarget */
+- atomic_t rs_sect_ev; /* for submitted resync data rate, both */
++ atomic_unchecked_t rs_sect_in; /* for incoming resync data rate, SyncTarget */
++ atomic_unchecked_t rs_sect_ev; /* for submitted resync data rate, both */
+ int rs_last_sect_ev; /* counter to compare with */
+ int rs_last_events; /* counter of read or write "events" (unit sectors)
+ * on the lower level device when we last looked. */
+@@ -1569,7 +1569,7 @@ static inline int drbd_setsockopt(struct socket *sock, int level, int optname,
char __user *uoptval;
int err;
/**
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
-index 960645c..6c2724a 100644
+index 9b465bb..00034ecf 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
-@@ -1322,7 +1322,7 @@ static int _drbd_send_ack(struct drbd_peer_device *peer_device, enum drbd_packet
+@@ -1328,7 +1328,7 @@ static int _drbd_send_ack(struct drbd_peer_device *peer_device, enum drbd_packet
p->sector = sector;
p->block_id = block_id;
p->blksize = blksize;
return drbd_send_command(peer_device, sock, cmd, sizeof(*p), NULL, 0);
}
-@@ -1628,7 +1628,7 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *
+@@ -1634,7 +1634,7 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *
return -EIO;
p->sector = cpu_to_be64(req->i.sector);
p->block_id = (unsigned long)req;
dp_flags = bio_flags_to_wire(peer_device->connection, req->master_bio->bi_rw);
if (device->state.conn >= C_SYNC_SOURCE &&
device->state.conn <= C_PAUSED_SYNC_T)
-@@ -2670,8 +2670,8 @@ void drbd_destroy_connection(struct kref *kref)
+@@ -1915,8 +1915,8 @@ void drbd_init_set_defaults(struct drbd_device *device)
+ atomic_set(&device->unacked_cnt, 0);
+ atomic_set(&device->local_cnt, 0);
+ atomic_set(&device->pp_in_use_by_net, 0);
+- atomic_set(&device->rs_sect_in, 0);
+- atomic_set(&device->rs_sect_ev, 0);
++ atomic_set_unchecked(&device->rs_sect_in, 0);
++ atomic_set_unchecked(&device->rs_sect_ev, 0);
+ atomic_set(&device->ap_in_flight, 0);
+ atomic_set(&device->md_io.in_use, 0);
+
+@@ -2688,8 +2688,8 @@ void drbd_destroy_connection(struct kref *kref)
struct drbd_connection *connection = container_of(kref, struct drbd_connection, kref);
struct drbd_resource *resource = connection->resource;
idr_destroy(&connection->peer_devices);
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
-index 3f2e167..d3170e4 100644
+index 1cd47df..57c53c0 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
-@@ -3616,7 +3616,7 @@ finish:
+@@ -3645,13 +3645,13 @@ finish:
void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib)
{
struct sk_buff *msg;
struct drbd_genlmsghdr *d_out;
unsigned seq;
-@@ -3629,7 +3629,7 @@ void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib)
- return;
- }
+ int err = -ENOMEM;
- seq = atomic_inc_return(&drbd_genl_seq);
+ seq = atomic_inc_return_unchecked(&drbd_genl_seq);
if (!msg)
goto failed;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
-index 5b17ec8..6c21e6b 100644
+index 9342b8d..b6a6825 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
-@@ -834,7 +834,7 @@ int drbd_connected(struct drbd_peer_device *peer_device)
+@@ -870,7 +870,7 @@ int drbd_connected(struct drbd_peer_device *peer_device)
struct drbd_device *device = peer_device->device;
int err;
device->peer_seq = 0;
device->state_mutex = peer_device->connection->agreed_pro_version < 100 ?
-@@ -1199,7 +1199,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connectio
+@@ -1233,7 +1233,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connectio
do {
next_epoch = NULL;
switch (ev & ~EV_CLEANUP) {
case EV_PUT:
-@@ -1239,7 +1239,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connectio
+@@ -1273,7 +1273,7 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connectio
rv = FE_DESTROYED;
} else {
epoch->flags = 0;
/* atomic_set(&epoch->active, 0); is already zero */
if (rv == FE_STILL_LIVE)
rv = FE_RECYCLED;
-@@ -1490,7 +1490,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
+@@ -1550,7 +1550,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
conn_wait_active_ee_empty(connection);
drbd_flush(connection);
epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO);
if (epoch)
break;
-@@ -1503,11 +1503,11 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
+@@ -1564,11 +1564,11 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
}
epoch->flags = 0;
list_add(&epoch->list, &connection->current_epoch->list);
connection->current_epoch = epoch;
connection->epochs++;
-@@ -2224,7 +2224,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
+@@ -1802,7 +1802,7 @@ static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t secto
+ list_add_tail(&peer_req->w.list, &device->sync_ee);
+ spin_unlock_irq(&device->resource->req_lock);
+
+- atomic_add(pi->size >> 9, &device->rs_sect_ev);
++ atomic_add_unchecked(pi->size >> 9, &device->rs_sect_ev);
+ if (drbd_submit_peer_request(device, peer_req, WRITE, DRBD_FAULT_RS_WR) == 0)
+ return 0;
+
+@@ -1900,7 +1900,7 @@ static int receive_RSDataReply(struct drbd_connection *connection, struct packet
+ drbd_send_ack_dp(peer_device, P_NEG_ACK, p, pi->size);
+ }
+
+- atomic_add(pi->size >> 9, &device->rs_sect_in);
++ atomic_add_unchecked(pi->size >> 9, &device->rs_sect_in);
+
+ return err;
+ }
+@@ -2290,7 +2290,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
err = wait_for_and_update_peer_seq(peer_device, peer_seq);
drbd_send_ack_dp(peer_device, P_NEG_ACK, p, pi->size);
err2 = drbd_drain_block(peer_device, pi->size);
if (!err)
err = err2;
-@@ -2266,7 +2266,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
+@@ -2334,7 +2334,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
spin_lock(&connection->epoch_lock);
peer_req->epoch = connection->current_epoch;
atomic_inc(&peer_req->epoch->active);
spin_unlock(&connection->epoch_lock);
-@@ -4461,7 +4461,7 @@ struct data_cmd {
+@@ -2479,7 +2479,7 @@ bool drbd_rs_c_min_rate_throttle(struct drbd_device *device)
+
+ curr_events = (int)part_stat_read(&disk->part0, sectors[0]) +
+ (int)part_stat_read(&disk->part0, sectors[1]) -
+- atomic_read(&device->rs_sect_ev);
++ atomic_read_unchecked(&device->rs_sect_ev);
+
+ if (atomic_read(&device->ap_actlog_cnt)
+ || !device->rs_last_events || curr_events - device->rs_last_events > 64) {
+@@ -2618,7 +2618,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
+ device->use_csums = true;
+ } else if (pi->cmd == P_OV_REPLY) {
+ /* track progress, we may need to throttle */
+- atomic_add(size >> 9, &device->rs_sect_in);
++ atomic_add_unchecked(size >> 9, &device->rs_sect_in);
+ peer_req->w.cb = w_e_end_ov_reply;
+ dec_rs_pending(device);
+ /* drbd_rs_begin_io done when we sent this request,
+@@ -2691,7 +2691,7 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
+ goto out_free_e;
+
+ submit_for_resync:
+- atomic_add(size >> 9, &device->rs_sect_ev);
++ atomic_add_unchecked(size >> 9, &device->rs_sect_ev);
+
+ submit:
+ update_receiver_timing_details(connection, drbd_submit_peer_request);
+@@ -4564,7 +4564,7 @@ struct data_cmd {
int expect_payload;
size_t pkt_size;
int (*fn)(struct drbd_connection *, struct packet_info *);
static struct data_cmd drbd_cmd_handler[] = {
[P_DATA] = { 1, sizeof(struct p_data), receive_Data },
-@@ -4572,7 +4572,7 @@ static void conn_disconnect(struct drbd_connection *connection)
+@@ -4678,7 +4678,7 @@ static void conn_disconnect(struct drbd_connection *connection)
if (!list_empty(&connection->current_epoch->list))
drbd_err(connection, "ASSERTION FAILED: connection->current_epoch->list not empty\n");
/* ok, no more ee's on the fly, it is safe to reset the epoch_size */
connection->send.seen_any_write_yet = false;
drbd_info(connection, "Connection closed\n");
-@@ -5364,7 +5364,7 @@ static int connection_finish_peer_reqs(struct drbd_connection *connection)
+@@ -5182,7 +5182,7 @@ static int got_IsInSync(struct drbd_connection *connection, struct packet_info *
+ put_ldev(device);
+ }
+ dec_rs_pending(device);
+- atomic_add(blksize >> 9, &device->rs_sect_in);
++ atomic_add_unchecked(blksize >> 9, &device->rs_sect_in);
+
+ return 0;
+ }
+@@ -5470,7 +5470,7 @@ static int connection_finish_peer_reqs(struct drbd_connection *connection)
struct asender_cmd {
size_t pkt_size;
int (*fn)(struct drbd_connection *connection, struct packet_info *);
static struct asender_cmd asender_tbl[] = {
[P_PING] = { 0, got_Ping },
+diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
+index 50776b3..1477c3f 100644
+--- a/drivers/block/drbd/drbd_worker.c
++++ b/drivers/block/drbd/drbd_worker.c
+@@ -408,7 +408,7 @@ static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector,
+ list_add_tail(&peer_req->w.list, &device->read_ee);
+ spin_unlock_irq(&device->resource->req_lock);
+
+- atomic_add(size >> 9, &device->rs_sect_ev);
++ atomic_add_unchecked(size >> 9, &device->rs_sect_ev);
+ if (drbd_submit_peer_request(device, peer_req, READ, DRBD_FAULT_RS_RD) == 0)
+ return 0;
+
+@@ -553,7 +553,7 @@ static int drbd_rs_number_requests(struct drbd_device *device)
+ unsigned int sect_in; /* Number of sectors that came in since the last turn */
+ int number, mxb;
+
+- sect_in = atomic_xchg(&device->rs_sect_in, 0);
++ sect_in = atomic_xchg_unchecked(&device->rs_sect_in, 0);
+ device->rs_in_flight -= sect_in;
+
+ rcu_read_lock();
+@@ -1594,8 +1594,8 @@ void drbd_rs_controller_reset(struct drbd_device *device)
+ {
+ struct fifo_buffer *plan;
+
+- atomic_set(&device->rs_sect_in, 0);
+- atomic_set(&device->rs_sect_ev, 0);
++ atomic_set_unchecked(&device->rs_sect_in, 0);
++ atomic_set_unchecked(&device->rs_sect_ev, 0);
+ device->rs_in_flight = 0;
+
+ /* Updating the RCU protected object in place is necessary since
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 6cb1beb..bf490f7 100644
--- a/drivers/block/loop.c
kfree(usegment);
kfree(ksegment);
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
-index b297033..fa217ca 100644
+index 09f17eb..8531d2f 100644
--- a/drivers/char/agp/frontend.c
+++ b/drivers/char/agp/frontend.c
-@@ -819,7 +819,7 @@ static int agpioc_reserve_wrap(struct agp_file_private *priv, void __user *arg)
+@@ -806,7 +806,7 @@ static int agpioc_reserve_wrap(struct agp_file_private *priv, void __user *arg)
if (copy_from_user(&reserve, arg, sizeof(struct agp_region)))
return -EFAULT;
return -EFAULT;
client = agp_find_client_by_pid(reserve.pid);
-@@ -849,7 +849,7 @@ static int agpioc_reserve_wrap(struct agp_file_private *priv, void __user *arg)
+@@ -836,7 +836,7 @@ static int agpioc_reserve_wrap(struct agp_file_private *priv, void __user *arg)
if (segment == NULL)
return -ENOMEM;
*ppos = i;
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
-index 8320abd..ec48108 100644
+index 0ea9986..e7b07e4 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
-@@ -2345,9 +2345,9 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp)
+@@ -2345,7 +2345,7 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp)
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgslpc_close(%s) entry, count=%d\n",
- __FILE__, __LINE__, info->device_name, port->count);
+ __FILE__, __LINE__, info->device_name, atomic_read(&port->count));
-- WARN_ON(!port->count);
-+ WARN_ON(!atomic_read(&port->count));
-
if (tty_port_close_start(port, tty, filp) == 0)
goto cleanup;
-@@ -2365,7 +2365,7 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp)
+@@ -2363,7 +2363,7 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp)
cleanup:
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgslpc_close(%s) exit, count=%d\n", __FILE__, __LINE__,
}
/* Wait until the transmitter is empty.
-@@ -2507,7 +2507,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
+@@ -2505,7 +2505,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgslpc_open(%s), old ref count = %d\n",
+ __FILE__, __LINE__, tty->driver->name, atomic_read(&port->count));
/* If port is closing, signal caller to try again */
- if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING){
-@@ -2527,11 +2527,11 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
+ if (port->flags & ASYNC_CLOSING){
+@@ -2525,11 +2525,11 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
goto cleanup;
}
spin_lock(&port->lock);
/* 1st open on this device, init hardware */
retval = startup(info, tty);
if (retval < 0)
-@@ -3920,7 +3920,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
+@@ -3918,7 +3918,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
unsigned short new_crctype;
/* return error if TTY interface open */
return -EBUSY;
switch (encoding)
-@@ -4024,7 +4024,7 @@ static int hdlcdev_open(struct net_device *dev)
+@@ -4022,7 +4022,7 @@ static int hdlcdev_open(struct net_device *dev)
/* arbitrate between network and tty opens */
spin_lock_irqsave(&info->netlock, flags);
printk(KERN_WARNING "%s: hdlc_open returning busy\n", dev->name);
spin_unlock_irqrestore(&info->netlock, flags);
return -EBUSY;
-@@ -4114,7 +4114,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+@@ -4112,7 +4112,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
printk("%s:hdlcdev_ioctl(%s)\n", __FILE__, dev->name);
/* return error if TTY interface open */
if (cmd != SIOCWANDEV)
diff --git a/drivers/char/random.c b/drivers/char/random.c
-index 71529e1..822b036 100644
+index c18d41d..7c499f3 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
-@@ -284,9 +284,6 @@
+@@ -289,9 +289,6 @@
/*
* To allow fractional bits to be tracked, the entropy_count field is
* denominated in units of 1/8th bits.
*/
#define ENTROPY_SHIFT 3
#define ENTROPY_BITS(r) ((r)->entropy_count >> ENTROPY_SHIFT)
-@@ -433,9 +430,9 @@ struct entropy_store {
+@@ -439,9 +436,9 @@ struct entropy_store {
};
static void push_to_pool(struct work_struct *work);
static struct entropy_store input_pool = {
.poolinfo = &poolinfo_table[0],
-@@ -524,8 +521,8 @@ static void _mix_pool_bytes(struct entropy_store *r, const void *in,
- input_rotate = (input_rotate + (i ? 7 : 14)) & 31;
- }
-
-- ACCESS_ONCE(r->input_rotate) = input_rotate;
-- ACCESS_ONCE(r->add_ptr) = i;
-+ ACCESS_ONCE_RW(r->input_rotate) = input_rotate;
-+ ACCESS_ONCE_RW(r->add_ptr) = i;
- smp_wmb();
-
- if (out)
-@@ -632,7 +629,7 @@ retry:
+@@ -635,7 +632,7 @@ retry:
/* The +2 corresponds to the /4 in the denominator */
do {
unsigned int add =
((pool_size - entropy_count)*anfrac*3) >> s;
-@@ -1177,7 +1174,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
+@@ -1106,7 +1103,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
+ __mix_pool_bytes(r, hash.w, sizeof(hash.w));
+ spin_unlock_irqrestore(&r->lock, flags);
+
+- memset(workspace, 0, sizeof(workspace));
++ memzero_explicit(workspace, sizeof(workspace));
+
+ /*
+ * In case the hash function has some recognizable output
+@@ -1118,7 +1115,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
+ hash.w[2] ^= rol32(hash.w[2], 16);
+
+ memcpy(out, &hash, EXTRACT_SIZE);
+- memset(&hash, 0, sizeof(hash));
++ memzero_explicit(&hash, sizeof(hash));
+ }
+
+ /*
+@@ -1175,7 +1172,7 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
+ }
+
+ /* Wipe data just returned from memory */
+- memset(tmp, 0, sizeof(tmp));
++ memzero_explicit(tmp, sizeof(tmp));
+
+ return ret;
+ }
+@@ -1207,7 +1204,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
extract_buf(r, tmp);
i = min_t(int, nbytes, EXTRACT_SIZE);
ret = -EFAULT;
break;
}
-@@ -1567,7 +1564,7 @@ static char sysctl_bootid[16];
+@@ -1218,7 +1215,7 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
+ }
+
+ /* Wipe data just returned from memory */
+- memset(tmp, 0, sizeof(tmp));
++ memzero_explicit(tmp, sizeof(tmp));
+
+ return ret;
+ }
+@@ -1590,7 +1587,7 @@ static char sysctl_bootid[16];
static int proc_do_uuid(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
unsigned char buf[64], tmp_uuid[16], *uuid;
uuid = table->data;
-@@ -1597,7 +1594,7 @@ static int proc_do_uuid(struct ctl_table *table, int write,
+@@ -1620,7 +1617,7 @@ static int proc_do_uuid(struct ctl_table *table, int write,
static int proc_do_entropy(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
acpi_os_unmap_iomem(virt, len);
return 0;
diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c
-index 59f7cb2..bac8b6d 100644
+index 3a56a13..f8cbd25 100644
--- a/drivers/char/tpm/tpm_eventlog.c
+++ b/drivers/char/tpm/tpm_eventlog.c
@@ -95,7 +95,7 @@ static void *tpm_bios_measurements_start(struct seq_file *m, loff_t *pos)
return 0;
}
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
-index 60aafb8..10c08e0 100644
+index b585b47..488f43e 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -684,7 +684,7 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
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 57a078e..c17cde8 100644
+index b9355da..9611f4e 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
-@@ -146,7 +146,7 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
+@@ -191,7 +191,7 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
struct clk *clk;
struct clk_init_data init;
struct clk_composite *composite;
cpu_notifier_register_begin();
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
-index 6f02485..13684ae 100644
+index 61190f6..fcd899a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
-@@ -2100,7 +2100,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor)
+@@ -2095,7 +2095,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor)
}
mutex_lock(&cpufreq_governor_mutex);
mutex_unlock(&cpufreq_governor_mutex);
return;
}
-@@ -2316,7 +2316,7 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb,
+@@ -2311,7 +2311,7 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}
.notifier_call = cpufreq_cpu_callback,
};
-@@ -2356,13 +2356,17 @@ int cpufreq_boost_trigger_state(int state)
+@@ -2351,13 +2351,17 @@ int cpufreq_boost_trigger_state(int state)
return 0;
write_lock_irqsave(&cpufreq_driver_lock, flags);
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
pr_err("%s: Cannot %s BOOST\n",
-@@ -2419,8 +2423,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
+@@ -2414,8 +2418,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
pr_debug("trying to register driver %s\n", driver_data->name);
write_lock_irqsave(&cpufreq_driver_lock, flags);
if (cpufreq_driver) {
-@@ -2435,8 +2442,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
+@@ -2430,8 +2437,11 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
* Check if driver provides function to enable boost -
* if not, use cpufreq_boost_set_sw as default
*/
struct cs_ops {
struct notifier_block *notifier_block;
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
-index 18d4091..434be15 100644
+index ad3f38f..8f086cd 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
-@@ -521,7 +521,7 @@ static void od_exit(struct dbs_data *dbs_data)
+@@ -524,7 +524,7 @@ static void od_exit(struct dbs_data *dbs_data)
define_get_cpu_dbs_routines(od_cpu_dbs_info);
.powersave_bias_init_cpu = ondemand_powersave_bias_init_cpu,
.powersave_bias_target = generic_powersave_bias_target,
.freq_increase = dbs_freq_increase,
-@@ -576,14 +576,18 @@ void od_register_powersave_bias_handler(unsigned int (*f)
+@@ -579,14 +579,18 @@ void od_register_powersave_bias_handler(unsigned int (*f)
(struct cpufreq_policy *, unsigned int, unsigned int),
unsigned int powersave_bias)
{
}
EXPORT_SYMBOL_GPL(od_unregister_powersave_bias_handler);
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
-index 86631cb..c34ec78 100644
+index 0668b38..2f3ea18 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
-@@ -121,10 +121,10 @@ struct pstate_funcs {
+@@ -120,10 +120,10 @@ struct pstate_funcs {
struct cpu_defaults {
struct pstate_adjust_policy pid_policy;
struct pstate_funcs funcs;
struct perf_limits {
int no_turbo;
-@@ -526,7 +526,7 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)
+@@ -527,17 +527,17 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)
cpu->pstate.current_pstate = pstate;
+ pstate_funcs->set(cpu, pstate);
}
- static inline void intel_pstate_pstate_increase(struct cpudata *cpu, int steps)
-@@ -546,12 +546,12 @@ static inline void intel_pstate_pstate_decrease(struct cpudata *cpu, int steps)
-
static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)
{
- cpu->pstate.min_pstate = pstate_funcs.get_min();
intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate);
}
-@@ -838,9 +838,9 @@ static int intel_pstate_msrs_not_valid(void)
+@@ -810,9 +810,9 @@ static int intel_pstate_msrs_not_valid(void)
rdmsrl(MSR_IA32_APERF, aperf);
rdmsrl(MSR_IA32_MPERF, mperf);
- if (!pstate_funcs.get_max() ||
-- !pstate_funcs.get_min() ||
-- !pstate_funcs.get_turbo())
+- !pstate_funcs.get_min() ||
+- !pstate_funcs.get_turbo())
+ if (!pstate_funcs->get_max() ||
-+ !pstate_funcs->get_min() ||
-+ !pstate_funcs->get_turbo())
++ !pstate_funcs->get_min() ||
++ !pstate_funcs->get_turbo())
return -ENODEV;
rdmsrl(MSR_IA32_APERF, tmp);
-@@ -854,7 +854,7 @@ static int intel_pstate_msrs_not_valid(void)
+@@ -826,7 +826,7 @@ static int intel_pstate_msrs_not_valid(void)
return 0;
}
{
pid_params.sample_rate_ms = policy->sample_rate_ms;
pid_params.p_gain_pct = policy->p_gain_pct;
-@@ -866,11 +866,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy)
+@@ -838,11 +838,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy)
static void copy_cpu_funcs(struct pstate_funcs *funcs)
{
if (policy->cpu != 0)
return -ENODEV;
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
-index 9634f20..e1499c7 100644
+index e431d11..d0b997e 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
-@@ -205,7 +205,7 @@ static int poll_idle(struct cpuidle_device *dev,
+@@ -194,7 +194,7 @@ static int poll_idle(struct cpuidle_device *dev,
static void poll_idle_init(struct cpuidle_driver *drv)
{
cpuidle_curr_governor->rating < gov->rating)
cpuidle_switch_governor(gov);
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
-index efe2f17..b8124f9 100644
+index 97c5903..023ad23 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -135,7 +135,7 @@ static struct attribute *cpuidle_switch_attrs[] = {
.name = "cpuidle",
};
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
-index 12fea3e..1e28f47 100644
+index 8d2a772..33826c9 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -51,7 +51,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
mutex_unlock(&devfreq_list_lock);
diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
-index b35007e..55ad549 100644
+index 42d4974..2714f36 100644
--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
-@@ -267,8 +267,8 @@ static int shdma_alloc_chan_resources(struct dma_chan *chan)
+@@ -228,8 +228,8 @@ static int shdma_alloc_chan_resources(struct dma_chan *chan)
schan->slave_id = -EINVAL;
}
ret = -ENOMEM;
goto edescalloc;
diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
-index 146d5df..3c14970 100644
+index 58eb857..d7e42c8 100644
--- a/drivers/dma/sh/shdmac.c
+++ b/drivers/dma/sh/shdmac.c
-@@ -514,7 +514,7 @@ static int sh_dmae_nmi_handler(struct notifier_block *self,
+@@ -513,7 +513,7 @@ static int sh_dmae_nmi_handler(struct notifier_block *self,
return ret;
}
EXPORT_SYMBOL_GPL(edac_device_alloc_index);
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
-index 01fae82..1dd8289 100644
+index a6cd361..7bdbf53 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
-@@ -152,7 +152,7 @@ static const char * const edac_caps[] = {
+@@ -154,7 +154,7 @@ static const char * const edac_caps[] = {
struct dev_ch_attribute {
struct device_attribute attr;
int channel;
#define DEVICE_CHANNEL(_name, _mode, _show, _store, _var) \
struct dev_ch_attribute dev_attr_legacy_##_name = \
-@@ -1009,14 +1009,16 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
+@@ -1011,14 +1011,16 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
}
if (mci->set_sdram_scrub_rate || mci->get_sdram_scrub_rate) {
dmi_unmap(buf);
return 0;
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
-index 1491dd4..aa910db 100644
+index 5b53d61..72cee96 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
-@@ -41,12 +41,12 @@
+@@ -44,12 +44,12 @@ static char rcd_decode_str[CPER_REC_LEN];
*/
u64 cper_next_record_id(void)
{
EXPORT_SYMBOL_GPL(cper_next_record_id);
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
-index dc79346..b39bd69 100644
+index 64ecbb5..d921eb3 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
-@@ -122,14 +122,16 @@ static struct attribute_group efi_subsys_attr_group = {
+@@ -126,14 +126,16 @@ static struct attribute_group efi_subsys_attr_group = {
};
static struct efivars generic_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 463c565..02a5640 100644
+index f256ecd..387dcb1 100644
--- a/drivers/firmware/efi/efivars.c
+++ b/drivers/firmware/efi/efivars.c
-@@ -588,7 +588,7 @@ efivar_create_sysfs_entry(struct efivar_entry *new_var)
+@@ -589,7 +589,7 @@ efivar_create_sysfs_entry(struct efivar_entry *new_var)
static int
create_efivars_bin_attributes(void)
{
}
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
-index cde3605..8b69df7 100644
+index fe49ec3..1ade794 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -278,7 +278,7 @@ static int em_gio_probe(struct platform_device *pdev)
int ret;
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
-index 7030422..42a3fe9 100644
+index 3784e81..73637b5 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -94,7 +94,7 @@ struct ichx_desc {
static struct {
spinlock_t lock;
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
-index b6ae89e..ac7349c 100644
+index bf6c094..6573caf 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -357,7 +357,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
const char *name = dev_name(dev);
int ret;
diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
-index 66cbcc1..0c5e622 100644
+index dbf28fa..04dad4e 100644
--- a/drivers/gpio/gpio-vr41xx.c
+++ b/drivers/gpio/gpio-vr41xx.c
@@ -224,7 +224,7 @@ static int giu_get_irq(unsigned int irq)
return -EINVAL;
}
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index 2ebc907..01bdd6e 100644
+index c68d037..2f4f9a9 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
-@@ -1482,8 +1482,10 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
+@@ -529,8 +529,10 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
}
if (gpiochip->irqchip) {
gpiochip->irqchip = NULL;
}
}
-@@ -1549,8 +1551,11 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
+@@ -596,8 +598,11 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
gpiochip->irqchip = NULL;
return -EINVAL;
}
/*
* Prepare the mapping since the irqchip shall be orthogonal to
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
-index fe94cc1..5e697b3 100644
+index 90e7730..3b41807 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
-@@ -3584,7 +3584,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
+@@ -3861,7 +3861,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
goto done;
}
ret = -EFAULT;
goto done;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
-index 8218078..9960928a 100644
+index 3242e20..7e4f621 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
-@@ -233,7 +233,7 @@ module_exit(drm_core_exit);
- /**
- * Copy and IOCTL return string to user space
- */
--static int drm_copy_field(char *buf, size_t *buf_len, const char *value)
-+static int drm_copy_field(char __user *buf, size_t *buf_len, const char *value)
- {
- int len;
+@@ -463,7 +463,7 @@ void drm_unplug_dev(struct drm_device *dev)
-@@ -342,7 +342,7 @@ long drm_ioctl(struct file *filp,
- struct drm_file *file_priv = filp->private_data;
- struct drm_device *dev;
- const struct drm_ioctl_desc *ioctl = NULL;
-- drm_ioctl_t *func;
-+ drm_ioctl_no_const_t func;
- unsigned int nr = DRM_IOCTL_NR(cmd);
- int retcode = -EINVAL;
- char stack_kdata[128];
+ drm_device_set_unplugged(dev);
+
+- if (dev->open_count == 0) {
++ if (local_read(&dev->open_count) == 0) {
+ drm_put_dev(dev);
+ }
+ mutex_unlock(&drm_global_mutex);
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
-index 021fe5d..abc9ce6 100644
+index 79d5221..7ff73496 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
-@@ -88,7 +88,7 @@ int drm_open(struct inode *inode, struct file *filp)
+@@ -89,7 +89,7 @@ int drm_open(struct inode *inode, struct file *filp)
return PTR_ERR(minor);
dev = minor->dev;
need_setup = 1;
/* share address_space across all char-devs of a single device */
-@@ -105,7 +105,7 @@ int drm_open(struct inode *inode, struct file *filp)
+@@ -106,7 +106,7 @@ int drm_open(struct inode *inode, struct file *filp)
return 0;
err_undo:
drm_minor_release(minor);
return retcode;
}
-@@ -427,7 +427,7 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -384,7 +384,7 @@ int drm_release(struct inode *inode, struct file *filp)
mutex_lock(&drm_global_mutex);
- DRM_DEBUG("open_count = %d\n", dev->open_count);
+ DRM_DEBUG("open_count = %ld\n", local_read(&dev->open_count));
- if (dev->driver->preclose)
- dev->driver->preclose(dev, file_priv);
-@@ -436,10 +436,10 @@ int drm_release(struct inode *inode, struct file *filp)
+ mutex_lock(&dev->struct_mutex);
+ list_del(&file_priv->lhead);
+@@ -397,10 +397,10 @@ int drm_release(struct inode *inode, struct file *filp)
* Begin inline drm_release
*/
/* Release any auth tokens that might point to this file_priv,
(do that under the drm_global_mutex) */
-@@ -540,7 +540,7 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -471,7 +471,7 @@ int drm_release(struct inode *inode, struct file *filp)
* End inline drm_release
*/
item->object = NULL;
}
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
-index 86feedd..cba70f5 100644
+index ecaf0fa..a49cee9 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -73,10 +73,13 @@ int drm_vm_info(struct seq_file *m, void *data)
else
ret = drm_ioctl(filp, cmd, arg);
-diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
-index 14d1646..99f9d49 100644
---- a/drivers/gpu/drm/drm_stub.c
-+++ b/drivers/gpu/drm/drm_stub.c
-@@ -455,7 +455,7 @@ void drm_unplug_dev(struct drm_device *dev)
-
- drm_device_set_unplugged(dev);
-
-- if (dev->open_count == 0) {
-+ if (local_read(&dev->open_count) == 0) {
- drm_put_dev(dev);
- }
- mutex_unlock(&drm_global_mutex);
-diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
-index 369b262..09ea3ab 100644
---- a/drivers/gpu/drm/drm_sysfs.c
-+++ b/drivers/gpu/drm/drm_sysfs.c
-@@ -505,7 +505,7 @@ static void drm_sysfs_release(struct device *dev)
- */
- int drm_sysfs_device_add(struct drm_minor *minor)
- {
-- char *minor_str;
-+ const char *minor_str;
- int r;
-
- if (minor->type == DRM_MINOR_CONTROL)
+diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
+index 40be746..fd78faf 100644
+--- a/drivers/gpu/drm/drm_ioctl.c
++++ b/drivers/gpu/drm/drm_ioctl.c
+@@ -642,7 +642,7 @@ long drm_ioctl(struct file *filp,
+ struct drm_file *file_priv = filp->private_data;
+ struct drm_device *dev;
+ const struct drm_ioctl_desc *ioctl = NULL;
+- drm_ioctl_t *func;
++ drm_ioctl_no_const_t func;
+ unsigned int nr = DRM_IOCTL_NR(cmd);
+ int retcode = -EINVAL;
+ char stack_kdata[128];
diff --git a/drivers/gpu/drm/i810/i810_drv.h b/drivers/gpu/drm/i810/i810_drv.h
index d4d16ed..8fb0b51 100644
--- a/drivers/gpu/drm/i810/i810_drv.h
int front_offset;
} drm_i810_private_t;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
-index d443441..ab091dd 100644
+index 9933c26..32cc097 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -1290,7 +1290,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -1292,7 +1292,7 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
* locking inversion with the driver load path. And the access here is
* completely racy anyway. So don't bother with locking for now.
*/
static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
-index 3a30133..ef4a743 100644
+index 60998fc..3b244bc 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -891,9 +891,9 @@ i915_gem_check_execbuffer(struct drm_i915_gem_execbuffer2 *exec)
return ret;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index f0be855..94e82d9 100644
+index d8324c6..fc9b704 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -11604,13 +11604,13 @@ struct intel_quirk {
+@@ -12437,13 +12437,13 @@ struct intel_quirk {
int subsystem_vendor;
int subsystem_device;
void (*hook)(struct drm_device *dev);
static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
{
-@@ -11618,18 +11618,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
+@@ -12451,18 +12451,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
return 1;
}
*sequence = cur_fence;
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
-index 8268a4c..5105708 100644
+index dae2c96..324dbe4 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,
+@@ -963,7 +963,7 @@ static int parse_bit_tmds_tbl_entry(struct drm_device *dev, struct nvbios *bios,
struct bit_table {
const char id;
int (* const parse_fn)(struct drm_device *, struct nvbios *, struct bit_entry *);
#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 7efbafa..19f8087 100644
+index b02b024..aed7bad 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.h
-@@ -97,7 +97,6 @@ struct nouveau_drm {
+@@ -119,7 +119,6 @@ struct nouveau_drm {
struct drm_global_reference mem_global_ref;
struct ttm_bo_global_ref bo_global_ref;
struct ttm_bo_device bdev;
if (nr < DRM_COMMAND_BASE)
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
-index ab0228f..20b756b 100644
+index 53874b7..1db0a68 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
-@@ -130,11 +130,11 @@ nouveau_vram_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
+@@ -127,11 +127,11 @@ nouveau_vram_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
}
const struct ttm_mem_type_manager_func nouveau_vram_manager = {
};
static int
-@@ -199,11 +199,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
+@@ -196,11 +196,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
}
const struct ttm_mem_type_manager_func nouveau_gart_manager = {
+ .debug = nouveau_gart_manager_debug
};
- #include <core/subdev/vm/nv04.h>
-@@ -271,11 +271,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
+ /*XXX*/
+@@ -270,11 +270,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
}
const struct ttm_mem_type_manager_func nv04_gart_manager = {
int
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
-index 4f4c3fe..2cce716 100644
+index c7592ec..dd45ebc 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
-@@ -70,7 +70,7 @@ nouveau_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -72,7 +72,7 @@ nouveau_switcheroo_can_switch(struct pci_dev *pdev)
* locking inversion with the driver load path. And the access here is
* completely racy anyway. So don't bother with locking for now.
*/
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 697add2..9860f5b 100644
+index 12c8329..a69e2e8 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
-@@ -1169,7 +1169,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
+@@ -1213,7 +1213,7 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev)
* locking inversion with the driver load path. And the access here is
* completely racy anyway. So don't bother with locking for now.
*/
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 c8a8a51..219dacc 100644
+index 72afe82..056a57a 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
-@@ -797,7 +797,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size)
+@@ -801,7 +801,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size)
man->size = size >> PAGE_SHIFT;
}
static const struct vm_operations_struct *ttm_vm_ops = NULL;
static int radeon_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-@@ -838,8 +838,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
+@@ -842,8 +842,10 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
}
if (unlikely(ttm_vm_ops == NULL)) {
ttm_vm_ops = vma->vm_ops;
vma->vm_ops = &radeon_ttm_vm_ops;
return 0;
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
-index ef40381..347463e 100644
+index 6553fd2..aecd29c 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
-@@ -1173,7 +1173,7 @@ static int tegra_dc_debugfs_init(struct tegra_dc *dc, struct drm_minor *minor)
+@@ -1243,7 +1243,7 @@ static int tegra_dc_debugfs_init(struct tegra_dc *dc, struct drm_minor *minor)
}
for (i = 0; i < ARRAY_SIZE(debugfs_files); i++)
err = drm_debugfs_create_files(dc->debugfs_files,
ARRAY_SIZE(debugfs_files),
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
-index bd56f2a..255af4b 100644
+index f787445..2df2c65 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -41,7 +41,7 @@ struct tegra_dsi {
struct dentry *debugfs;
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
-index ba067bb..23afbbd 100644
+index ffe2654..03c7b1c 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -60,7 +60,7 @@ struct tegra_hdmi {
struct dentry *debugfs;
};
diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
-index bd850c9..d9f3573 100644
+index 9e103a48..0e117f3 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
-@@ -146,10 +146,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
+@@ -147,10 +147,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
}
const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
if (unlikely(ret != 0)) {
kobject_put(&zone->kobj);
return ret;
-diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
-index 863bef9..cba15cf 100644
---- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
-+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
-@@ -391,9 +391,9 @@ out:
- static unsigned long
- ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
- {
-- static atomic_t start_pool = ATOMIC_INIT(0);
-+ static atomic_unchecked_t start_pool = ATOMIC_INIT(0);
- unsigned i;
-- unsigned pool_offset = atomic_add_return(1, &start_pool);
-+ unsigned pool_offset = atomic_add_return_unchecked(1, &start_pool);
- struct ttm_page_pool *pool;
- int shrink_pages = sc->nr_to_scan;
- unsigned long freed = 0;
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
-index 3771763..883f206 100644
+index d1da339..829235e 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)
case VIA_IRQ_ABSOLUTE:
break;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
-index 6b252a8..5975dfe 100644
+index 99f7317..33a835b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
-@@ -437,7 +437,7 @@ struct vmw_private {
+@@ -447,7 +447,7 @@ struct vmw_private {
* Fencing and IRQs.
*/
wait_queue_head_t fifo_queue;
int fence_queue_waiters; /* Protected by hw_mutex */
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
-index 6ccd993..618d592 100644
+index 6eae14d..aa311b3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -154,7 +154,7 @@ int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)
iowrite32(dev_priv->last_read_seqno, fifo_mem + SVGA_FIFO_FENCE);
vmw_marker_queue_init(&fifo->marker_queue);
return vmw_fifo_send_fence(dev_priv, &dummy);
-@@ -372,7 +372,7 @@ void *vmw_fifo_reserve(struct vmw_private *dev_priv, uint32_t bytes)
+@@ -373,7 +373,7 @@ void *vmw_fifo_reserve(struct vmw_private *dev_priv, uint32_t bytes)
if (reserveable)
iowrite32(bytes, fifo_mem +
SVGA_FIFO_RESERVED);
} else {
need_bounce = true;
}
-@@ -492,7 +492,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *seqno)
+@@ -493,7 +493,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *seqno)
fm = vmw_fifo_reserve(dev_priv, bytes);
if (unlikely(fm == NULL)) {
ret = -ENOMEM;
(void)vmw_fallback_wait(dev_priv, false, true, *seqno,
false, 3*HZ);
-@@ -500,7 +500,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *seqno)
+@@ -501,7 +501,7 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *seqno)
}
do {
if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE)) {
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
-index b1273e8..9c274fd 100644
+index 26f8bdd..90a0008 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
-@@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
+@@ -165,9 +165,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
}
const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
for (;;) {
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c b/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c
-index 8a8725c2..afed796 100644
+index efd1ffd..0ae13ca 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c
-@@ -151,7 +151,7 @@ int vmw_wait_lag(struct vmw_private *dev_priv,
+@@ -135,7 +135,7 @@ int vmw_wait_lag(struct vmw_private *dev_priv,
while (!vmw_lag_lt(queue, us)) {
spin_lock(&queue->lock);
if (list_empty(&queue->head))
marker = list_first_entry(&queue->head,
struct vmw_marker, head);
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
-index 6866448..2ad2b34 100644
+index 37ac7b5..d52a5c9 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -644,7 +644,7 @@ static int vga_switcheroo_runtime_resume(struct device *dev)
{
/* copy over all the bus versions */
if (dev->bus && dev->bus->pm) {
-@@ -689,7 +689,7 @@ static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
+@@ -695,7 +695,7 @@ static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
return ret;
}
/* copy over all the bus versions */
if (dev->bus && dev->bus->pm) {
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
-index 8ed66fd..38ff772 100644
+index 12b6e67..ddd983c 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
-@@ -2488,7 +2488,7 @@ EXPORT_SYMBOL_GPL(hid_ignore);
+@@ -2500,7 +2500,7 @@ EXPORT_SYMBOL_GPL(hid_ignore);
int hid_add_device(struct hid_device *hdev)
{
int ret;
if (WARN_ON(hdev->status & HID_STAT_ADDED))
-@@ -2530,7 +2530,7 @@ int hid_add_device(struct hid_device *hdev)
+@@ -2542,7 +2542,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,
hid_debug_register(hdev, dev_name(&hdev->dev));
ret = device_add(&hdev->dev);
-diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
-index ecc2cbf..29a74c1 100644
---- a/drivers/hid/hid-magicmouse.c
-+++ b/drivers/hid/hid-magicmouse.c
-@@ -290,6 +290,11 @@ static int magicmouse_raw_event(struct hid_device *hdev,
- if (size < 4 || ((size - 4) % 9) != 0)
- return 0;
- npoints = (size - 4) / 9;
-+ if (npoints > 15) {
-+ hid_warn(hdev, "invalid size value (%d) for TRACKPAD_REPORT_ID\n",
-+ size);
-+ return 0;
-+ }
- msc->ntouches = 0;
- for (ii = 0; ii < npoints; ii++)
- magicmouse_emit_touch(msc, ii, data + ii * 9 + 4);
-@@ -307,6 +312,11 @@ static int magicmouse_raw_event(struct hid_device *hdev,
- if (size < 6 || ((size - 6) % 8) != 0)
- return 0;
- npoints = (size - 6) / 8;
-+ if (npoints > 15) {
-+ hid_warn(hdev, "invalid size value (%d) for MOUSE_REPORT_ID\n",
-+ size);
-+ return 0;
-+ }
- msc->ntouches = 0;
- for (ii = 0; ii < npoints; ii++)
- magicmouse_emit_touch(msc, ii, data + ii * 8 + 6);
-diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c
-index acbb0210..020df3c 100644
---- a/drivers/hid/hid-picolcd_core.c
-+++ b/drivers/hid/hid-picolcd_core.c
-@@ -350,6 +350,12 @@ static int picolcd_raw_event(struct hid_device *hdev,
- if (!data)
- return 1;
-
-+ if (size > 64) {
-+ hid_warn(hdev, "invalid size value (%d) for picolcd raw event\n",
-+ size);
-+ return 0;
+diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
+index 9bf8637..f462416 100644
+--- a/drivers/hid/hid-logitech-dj.c
++++ b/drivers/hid/hid-logitech-dj.c
+@@ -682,6 +682,12 @@ static int logi_dj_raw_event(struct hid_device *hdev,
+ * device (via hid_input_report() ) and return 1 so hid-core does not do
+ * anything else with it.
+ */
++ if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||
++ (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {
++ dev_err(&hdev->dev, "%s: invalid device index:%d\n",
++ __func__, dj_report->device_index);
++ return false;
+ }
-+
- if (report->id == REPORT_KEY_STATE) {
- if (data->input_keys)
- ret = picolcd_raw_keypad(data, report, raw_data+1, size-1);
+
+ /* case 1) */
+ if (data[0] != REPORT_ID_DJ_SHORT)
diff --git a/drivers/hid/hid-wiimote-debug.c b/drivers/hid/hid-wiimote-debug.c
index c13fb5b..55a3802 100644
--- a/drivers/hid/hid-wiimote-debug.c
if (atomic_read(&uhid->report_done))
goto unlock;
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
-index 284cf66..084c627 100644
+index 531a593..0b43a69 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -365,8 +365,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
for (grp = groups; grp->format; grp++) {
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
-index ae208f6..48b6c5b 100644
+index cccef87..06ce8ec 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -147,10 +147,10 @@ MODULE_DEVICE_TABLE(acpi, atk_ids);
};
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
-index 632f1dc..57e6a58 100644
+index 7a8a6fb..015c1fd 100644
--- a/drivers/hwmon/ibmaem.c
+++ b/drivers/hwmon/ibmaem.c
-@@ -926,7 +926,7 @@ static int aem_register_sensors(struct aem_data *data,
+@@ -924,7 +924,7 @@ static int aem_register_sensors(struct aem_data *data,
struct aem_rw_sensor_template *rw)
{
struct device *dev = &data->pdev->dev;
int i, j, count;
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
-index 59d9a3f..2298fa4 100644
+index 504cbdd..35d6f25 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
-@@ -944,10 +944,10 @@ static struct attribute_group *
+@@ -943,10 +943,10 @@ static struct attribute_group *
nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
int repeat)
{
}
}
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
-index 4b1f375..770b95f 100644
+index af3e76d..96dfe5e 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
-@@ -551,7 +551,7 @@ static ssize_t iio_write_channel_info(struct device *dev,
+@@ -555,7 +555,7 @@ static ssize_t iio_write_channel_info(struct device *dev,
}
static
struct iio_chan_spec const *chan,
ssize_t (*readfunc)(struct device *dev,
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
-index c323917..6ddea8b 100644
+index e28a494..f7c2671 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -115,7 +115,7 @@ static char const counter_group_names[CM_COUNTER_GROUPS]
sdata, wqe->wr.wr.atomic.swap);
goto send_comp;
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
-index 287ad05..5ae7b44d 100644
+index 82a7dd8..8fb6ba6 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -98,7 +98,7 @@ __be64 mlx4_ib_gen_node_guid(void)
ctx->mcg_wq = create_singlethread_workqueue(name);
if (!ctx->mcg_wq)
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
-index 369da3c..223e6e9 100644
+index 6eb743f..a7b0f6d 100644
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -426,7 +426,7 @@ struct mlx4_ib_demux_ctx {
/**
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
-index 218dd35..97ce31d 100644
+index fef067c..6a25ccd 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -46,9 +46,9 @@
#include <linux/gameport.h>
#include <linux/jiffies.h>
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
-index 603fe0d..f63decc 100644
+index 177602c..ec78499 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
-@@ -737,7 +737,7 @@ static void xpad_led_set(struct led_classdev *led_cdev,
+@@ -850,7 +850,7 @@ static void xpad_led_set(struct led_classdev *led_cdev,
static int xpad_led_probe(struct usb_xpad *xpad)
{
long led_no;
struct xpad_led *led;
struct led_classdev *led_cdev;
-@@ -750,7 +750,7 @@ static int xpad_led_probe(struct usb_xpad *xpad)
+@@ -863,7 +863,7 @@ static int xpad_led_probe(struct usb_xpad *xpad)
if (!led)
return -ENOMEM;
kref_init(&serio_raw->kref);
INIT_LIST_HEAD(&serio_raw->client_list);
init_waitqueue_head(&serio_raw->wait);
-diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
-index e5555fc..937986d 100644
---- a/drivers/iommu/iommu.c
-+++ b/drivers/iommu/iommu.c
-@@ -588,7 +588,7 @@ static struct notifier_block iommu_bus_nb = {
- static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops)
- {
- bus_register_notifier(bus, &iommu_bus_nb);
-- bus_for_each_dev(bus, NULL, ops, add_iommu_group);
-+ bus_for_each_dev(bus, NULL, (void *)ops, add_iommu_group);
- }
+diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
+index a83cc2a..64462e6 100644
+--- a/drivers/iommu/arm-smmu.c
++++ b/drivers/iommu/arm-smmu.c
+@@ -921,7 +921,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
+ cfg->irptndx = cfg->cbndx;
+ }
+
+- ACCESS_ONCE(smmu_domain->smmu) = smmu;
++ ACCESS_ONCE_RW(smmu_domain->smmu) = smmu;
+ arm_smmu_init_context_bank(smmu_domain);
+ spin_unlock_irqrestore(&smmu_domain->lock, flags);
- /**
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 33c4395..e06447e 100644
--- a/drivers/iommu/irq_remapping.c
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 7c131cf..035129b 100644
+index dda6dbc..f9adebb 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
-@@ -85,7 +85,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.
*/
.irq_eoi = NULL,
.irq_mask = NULL,
.irq_unmask = NULL,
-@@ -337,7 +337,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
+@@ -312,7 +312,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
chained_irq_exit(chip, desc);
}
int ret;
int k;
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
-index f9a87ed..3fdd854 100644
+index 6a2df32..dc962f1 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -81,8 +81,8 @@ struct capiminor {
};
/* The following should better go into a dedicated source file such that
-diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
-index 62f0688..38ceac5 100644
---- a/drivers/isdn/i4l/isdn_ppp.c
-+++ b/drivers/isdn/i4l/isdn_ppp.c
-@@ -378,15 +378,10 @@ isdn_ppp_release(int min, struct file *file)
- is->slcomp = NULL;
- #endif
- #ifdef CONFIG_IPPP_FILTER
-- if (is->pass_filter) {
-- sk_unattached_filter_destroy(is->pass_filter);
-- is->pass_filter = NULL;
-- }
--
-- if (is->active_filter) {
-- sk_unattached_filter_destroy(is->active_filter);
-- is->active_filter = NULL;
-- }
-+ kfree(is->pass_filter);
-+ is->pass_filter = NULL;
-+ kfree(is->active_filter);
-+ is->active_filter = NULL;
- #endif
-
- /* TODO: if this was the previous master: link the stuff to the new master */
-@@ -442,7 +437,7 @@ static int get_filter(void __user *arg, struct sock_filter **p)
- {
- struct sock_fprog uprog;
- struct sock_filter *code = NULL;
-- int len;
-+ int len, err;
-
- if (copy_from_user(&uprog, arg, sizeof(uprog)))
- return -EFAULT;
-@@ -458,6 +453,12 @@ static int get_filter(void __user *arg, struct sock_filter **p)
- if (IS_ERR(code))
- return PTR_ERR(code);
-
-+ err = sk_chk_filter(code, uprog.len);
-+ if (err) {
-+ kfree(code);
-+ return err;
-+ }
-+
- *p = code;
- return uprog.len;
- }
-@@ -628,53 +629,25 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
- #ifdef CONFIG_IPPP_FILTER
- case PPPIOCSPASS:
- {
-- struct sock_fprog_kern fprog;
- struct sock_filter *code;
-- int err, len = get_filter(argp, &code);
--
-+ int len = get_filter(argp, &code);
- if (len < 0)
- return len;
--
-- fprog.len = len;
-- fprog.filter = code;
--
-- if (is->pass_filter) {
-- sk_unattached_filter_destroy(is->pass_filter);
-- is->pass_filter = NULL;
-- }
-- if (fprog.filter != NULL)
-- err = sk_unattached_filter_create(&is->pass_filter,
-- &fprog);
-- else
-- err = 0;
-- kfree(code);
--
-- return err;
-+ kfree(is->pass_filter);
-+ is->pass_filter = code;
-+ is->pass_len = len;
-+ break;
- }
- case PPPIOCSACTIVE:
- {
-- struct sock_fprog_kern fprog;
- struct sock_filter *code;
-- int err, len = get_filter(argp, &code);
--
-+ int len = get_filter(argp, &code);
- if (len < 0)
- return len;
--
-- fprog.len = len;
-- fprog.filter = code;
--
-- if (is->active_filter) {
-- sk_unattached_filter_destroy(is->active_filter);
-- is->active_filter = NULL;
-- }
-- if (fprog.filter != NULL)
-- err = sk_unattached_filter_create(&is->active_filter,
-- &fprog);
-- else
-- err = 0;
-- kfree(code);
--
-- return err;
-+ kfree(is->active_filter);
-+ is->active_filter = code;
-+ is->active_len = len;
-+ break;
- }
- #endif /* CONFIG_IPPP_FILTER */
- default:
-@@ -1174,14 +1147,14 @@ isdn_ppp_push_higher(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *
- }
-
- if (is->pass_filter
-- && SK_RUN_FILTER(is->pass_filter, skb) == 0) {
-+ && sk_run_filter(skb, is->pass_filter) == 0) {
- if (is->debug & 0x2)
- printk(KERN_DEBUG "IPPP: inbound frame filtered.\n");
- kfree_skb(skb);
- return;
- }
- if (!(is->active_filter
-- && SK_RUN_FILTER(is->active_filter, skb) == 0)) {
-+ && sk_run_filter(skb, is->active_filter) == 0)) {
- if (is->debug & 0x2)
- printk(KERN_DEBUG "IPPP: link-active filter: resetting huptimer.\n");
- lp->huptimer = 0;
-@@ -1320,14 +1293,14 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
- }
-
- if (ipt->pass_filter
-- && SK_RUN_FILTER(ipt->pass_filter, skb) == 0) {
-+ && sk_run_filter(skb, ipt->pass_filter) == 0) {
- if (ipt->debug & 0x4)
- printk(KERN_DEBUG "IPPP: outbound frame filtered.\n");
- kfree_skb(skb);
- goto unlock;
- }
- if (!(ipt->active_filter
-- && SK_RUN_FILTER(ipt->active_filter, skb) == 0)) {
-+ && sk_run_filter(skb, ipt->active_filter) == 0)) {
- if (ipt->debug & 0x4)
- printk(KERN_DEBUG "IPPP: link-active filter: resetting huptimer.\n");
- lp->huptimer = 0;
-@@ -1517,9 +1490,9 @@ int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
- }
-
- drop |= is->pass_filter
-- && SK_RUN_FILTER(is->pass_filter, skb) == 0;
-+ && sk_run_filter(skb, is->pass_filter) == 0;
- drop |= is->active_filter
-- && SK_RUN_FILTER(is->active_filter, skb) == 0;
-+ && sk_run_filter(skb, is->active_filter) == 0;
-
- skb_push(skb, IPPP_MAX_HEADER - 4);
- return drop;
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 3c5f249..5fac4d0 100644
--- a/drivers/isdn/i4l/isdn_tty.c
.callback = clevo_mail_led_dmi_callback,
.ident = "Clevo D410J",
diff --git a/drivers/leds/leds-ss4200.c b/drivers/leds/leds-ss4200.c
-index 2eb3ef6..295891f 100644
+index 046cb70..6b20d39 100644
--- a/drivers/leds/leds-ss4200.c
+++ b/drivers/leds/leds-ss4200.c
@@ -91,7 +91,7 @@ MODULE_PARM_DESC(nodetect, "Skip DMI-based hardware detection");
.callback = ss4200_led_dmi_callback,
.ident = "Intel SS4200-E",
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
-index 0bf1e4e..b4bf44e 100644
+index 6590558..a74c5dd 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
-@@ -97,9 +97,17 @@ static __init int map_switcher(void)
+@@ -96,9 +96,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 (!switcher_vma) {
err = -ENOMEM;
printk("lguest: could not map switcher pages high\n");
-@@ -124,7 +132,7 @@ static __init int map_switcher(void)
+@@ -121,7 +129,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).
*/
schedule_work(&sc->trigger_event);
}
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
-index 5f59f1e..01bd02e 100644
+index f9c6cb8..e272df6 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -274,7 +274,7 @@ static struct dm_dev_internal *find_device(struct list_head *l, dev_t dev)
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 32fc19c..cb6eba3 100644
+index 1294238..a442227 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -194,10 +194,10 @@ EXPORT_SYMBOL_GPL(bio_clone_mddev);
/*----------------------------------------------------------------*/
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
-index 56e24c0..e1c8e1f 100644
+index 55de4f6..b1c57fe 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
-@@ -1931,7 +1931,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
+@@ -1936,7 +1936,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)
}
sectors -= s;
sect += s;
-@@ -2165,7 +2165,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
- test_bit(In_sync, &rdev->flags)) {
+@@ -2170,7 +2170,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
+ !test_bit(Faulty, &rdev->flags)) {
if (r1_sync_page_io(rdev, sect, s,
conf->tmppage, READ)) {
- atomic_add(s, &rdev->corrected_errors);
"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 cb882aa..cb8aeca 100644
+index 6703751..187af1e 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
-@@ -1949,7 +1949,7 @@ static void end_sync_read(struct bio *bio, int error)
+@@ -1948,7 +1948,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
*/
&conf->mirrors[d].rdev->corrected_errors);
/* for reconstruct, we always reschedule after a read.
-@@ -2307,7 +2307,7 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
+@@ -2306,7 +2306,7 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
{
struct timespec cur_time_mon;
unsigned long hours_since_last;
ktime_get_ts(&cur_time_mon);
-@@ -2329,9 +2329,9 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
+@@ -2328,9 +2328,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))
}
static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
-@@ -2385,8 +2385,8 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
+@@ -2384,8 +2384,8 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
return;
check_decay_read_errors(mddev, rdev);
char b[BDEVNAME_SIZE];
bdevname(rdev->bdev, b);
-@@ -2394,7 +2394,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
+@@ -2393,7 +2393,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,
printk(KERN_NOTICE
"md/raid10:%s: %s: Failing raid device\n",
mdname(mddev), b);
-@@ -2549,7 +2549,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
+@@ -2548,7 +2548,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));
}
rdev_dec_pending(rdev, mddev);
-@@ -2954,6 +2954,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
- */
- if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) {
- end_reshape(conf);
-+ close_sync(conf);
- return 0;
- }
-
-@@ -4411,7 +4412,7 @@ read_more:
- read_bio->bi_private = r10_bio;
- read_bio->bi_end_io = end_sync_read;
- read_bio->bi_rw = READ;
-- read_bio->bi_flags &= ~(BIO_POOL_MASK - 1);
-+ read_bio->bi_flags &= (~0UL << BIO_RESET_BITS);
- read_bio->bi_flags |= 1 << BIO_UPTODATE;
- read_bio->bi_vcnt = 0;
- read_bio->bi_iter.bi_size = 0;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
-index 6234b2e..4990801 100644
+index 9f0fbec..991e7a1 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
-@@ -1731,6 +1731,10 @@ static int grow_one_stripe(struct r5conf *conf, int hash)
+@@ -1735,6 +1735,10 @@ static int grow_one_stripe(struct r5conf *conf, int hash)
return 1;
}
static int grow_stripes(struct r5conf *conf, int num)
{
struct kmem_cache *sc;
-@@ -1742,7 +1746,11 @@ static int grow_stripes(struct r5conf *conf, int num)
+@@ -1746,7 +1750,11 @@ static int grow_stripes(struct r5conf *conf, int num)
"raid%d-%s", conf->level, mdname(conf->mddev));
else
sprintf(conf->cache_name[0],
sprintf(conf->cache_name[1], "%s-alt", conf->cache_name[0]);
conf->active_name = 0;
-@@ -2018,21 +2026,21 @@ static void raid5_end_read_request(struct bio * bi, int error)
+@@ -2022,21 +2030,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));
if (test_bit(R5_ReadRepl, &sh->dev[i].flags))
printk_ratelimited(
KERN_WARNING
-@@ -2060,7 +2068,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
+@@ -2064,7 +2072,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
mdname(conf->mddev),
(unsigned long long)s,
bdn);
> conf->max_nr_stripes)
printk(KERN_WARNING
"md/raid:%s: Too many read errors, failing device %s.\n",
-@@ -3817,6 +3825,8 @@ static void handle_stripe(struct stripe_head *sh)
- set_bit(R5_Wantwrite, &dev->flags);
- if (prexor)
- continue;
-+ if (s.failed > 1)
-+ continue;
- if (!test_bit(R5_Insync, &dev->flags) ||
- ((i == sh->pd_idx || i == sh->qd_idx) &&
- s.failed == 0))
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 983db75..ef9248c 100644
--- a/drivers/media/dvb-core/dvbdev.c
#if IS_ENABLED(CONFIG_DVB_DIB3000MB)
extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
+diff --git a/drivers/media/dvb-frontends/dib7000p.h b/drivers/media/dvb-frontends/dib7000p.h
+index 1fea0e9..321ce8f 100644
+--- a/drivers/media/dvb-frontends/dib7000p.h
++++ b/drivers/media/dvb-frontends/dib7000p.h
+@@ -64,7 +64,7 @@ struct dib7000p_ops {
+ int (*get_adc_power)(struct dvb_frontend *fe);
+ int (*slave_reset)(struct dvb_frontend *fe);
+ struct dvb_frontend *(*init)(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib7000p_config *cfg);
+-};
++} __no_const;
+
+ #if IS_ENABLED(CONFIG_DVB_DIB7000P)
+ void *dib7000p_attach(struct dib7000p_ops *ops);
+diff --git a/drivers/media/dvb-frontends/dib8000.h b/drivers/media/dvb-frontends/dib8000.h
+index 84cc103..5780c54 100644
+--- a/drivers/media/dvb-frontends/dib8000.h
++++ b/drivers/media/dvb-frontends/dib8000.h
+@@ -61,7 +61,7 @@ struct dib8000_ops {
+ int (*pid_filter_ctrl)(struct dvb_frontend *fe, u8 onoff);
+ int (*pid_filter)(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff);
+ struct dvb_frontend *(*init)(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib8000_config *cfg);
+-};
++} __no_const;
+
+ #if IS_ENABLED(CONFIG_DVB_DIB8000)
+ void *dib8000_attach(struct dib8000_ops *ops);
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index ed8cb90..5ef7f79 100644
--- a/drivers/media/pci/cx88/cx88-video.c
/* Parameter declarations */
static int cardtype[IVTV_MAX_CARDS];
+diff --git a/drivers/media/pci/solo6x10/solo6x10-core.c b/drivers/media/pci/solo6x10/solo6x10-core.c
+index 172583d..0f806f4 100644
+--- a/drivers/media/pci/solo6x10/solo6x10-core.c
++++ b/drivers/media/pci/solo6x10/solo6x10-core.c
+@@ -430,7 +430,7 @@ static void solo_device_release(struct device *dev)
+
+ static int solo_sysfs_init(struct solo_dev *solo_dev)
+ {
+- 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/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
+index c7141f2..5301fec 100644
+--- a/drivers/media/pci/solo6x10/solo6x10-g723.c
++++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
+@@ -351,7 +351,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
+
+ int solo_g723_init(struct solo_dev *solo_dev)
+ {
+- static struct snd_device_ops ops = { NULL };
++ static struct snd_device_ops ops = { };
+ struct snd_card *card;
+ struct snd_kcontrol_new kctl;
+ char name[32];
+diff --git a/drivers/media/pci/solo6x10/solo6x10-p2m.c b/drivers/media/pci/solo6x10/solo6x10-p2m.c
+index 8c84846..27b4f83 100644
+--- a/drivers/media/pci/solo6x10/solo6x10-p2m.c
++++ b/drivers/media/pci/solo6x10/solo6x10-p2m.c
+@@ -73,7 +73,7 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev,
+
+ /* Get next ID. According to Softlogic, 6110 has problems on !=0 P2M */
+ if (solo_dev->type != SOLO_DEV_6110 && multi_p2m) {
+- p2m_id = atomic_inc_return(&solo_dev->p2m_count) % SOLO_NR_P2M;
++ p2m_id = atomic_inc_return_unchecked(&solo_dev->p2m_count) % SOLO_NR_P2M;
+ if (p2m_id < 0)
+ p2m_id = -p2m_id;
+ }
+diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h
+index c6154b0..73e4ae9 100644
+--- a/drivers/media/pci/solo6x10/solo6x10.h
++++ b/drivers/media/pci/solo6x10/solo6x10.h
+@@ -219,7 +219,7 @@ struct solo_dev {
+
+ /* P2M DMA Engine */
+ struct solo_p2m_dev p2m_dev[SOLO_NR_P2M];
+- atomic_t p2m_count;
++ atomic_unchecked_t p2m_count;
+ int p2m_jiffies;
+ unsigned int p2m_timeouts;
+
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
-index 9a726ea..f5e9b52 100644
+index 2d177fa..5b925a1 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 {
/* Variables configurable through module params*/
static u32 video1_numbuffers = 3;
static u32 video2_numbuffers = 3;
-@@ -1015,6 +1014,12 @@ static int omap_vout_open(struct file *file)
+@@ -1014,6 +1013,12 @@ static int omap_vout_open(struct file *file)
{
struct videobuf_queue *q;
struct omap_vout_device *vout = NULL;
vout = video_drvdata(file);
v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Entering %s\n", __func__);
-@@ -1032,10 +1037,6 @@ static int omap_vout_open(struct file *file)
+@@ -1031,10 +1036,6 @@ static int omap_vout_open(struct file *file)
vout->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
q = &vout->vbq;
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 8a8dbc8..b74c62d 100644
+index b4d2696..91df48e 100644
--- a/drivers/media/platform/s5p-tv/mixer_video.c
+++ b/drivers/media/platform/s5p-tv/mixer_video.c
@@ -210,7 +210,7 @@ static void mxr_layer_default_geo(struct mxr_layer *layer)
.buffer_set = mxr_vp_buffer_set,
.stream_set = mxr_vp_stream_set,
diff --git a/drivers/media/platform/vivi.c b/drivers/media/platform/vivi.c
-index d00bf3d..1301a0c 100644
+index 8033371..de5bca0 100644
--- a/drivers/media/platform/vivi.c
+++ b/drivers/media/platform/vivi.c
@@ -58,8 +58,8 @@ MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol");
static unsigned n_devs = 1;
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
-index d719e59..63f3470 100644
+index 82affae..42833ec 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -333,6 +333,8 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo
static int shark_write_reg(struct radio_tea5777 *tea, u64 reg)
{
diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c
-index 2fd9009..278cc1e 100644
+index 633022b..7f10754 100644
--- a/drivers/media/radio/radio-si476x.c
+++ b/drivers/media/radio/radio-si476x.c
@@ -1445,7 +1445,7 @@ static int si476x_radio_probe(struct platform_device *pdev)
radio = devm_kzalloc(&pdev->dev, sizeof(*radio), GFP_KERNEL);
if (!radio)
-diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
-index a1c641e..3007da9 100644
---- a/drivers/media/usb/dvb-usb/cxusb.c
-+++ b/drivers/media/usb/dvb-usb/cxusb.c
-@@ -1112,7 +1112,7 @@ static struct dib0070_config dib7070p_dib0070_config = {
-
- struct dib0700_adapter_state {
- int (*set_param_save) (struct dvb_frontend *);
--};
-+} __no_const;
+diff --git a/drivers/media/usb/dvb-usb/cinergyT2-core.c b/drivers/media/usb/dvb-usb/cinergyT2-core.c
+index 9fd1527..8927230 100644
+--- a/drivers/media/usb/dvb-usb/cinergyT2-core.c
++++ b/drivers/media/usb/dvb-usb/cinergyT2-core.c
+@@ -50,29 +50,73 @@ static struct dvb_usb_device_properties cinergyt2_properties;
+
+ static int cinergyt2_streaming_ctrl(struct dvb_usb_adapter *adap, int enable)
+ {
+- char buf[] = { CINERGYT2_EP1_CONTROL_STREAM_TRANSFER, enable ? 1 : 0 };
+- char result[64];
+- return dvb_usb_generic_rw(adap->dev, buf, sizeof(buf), result,
+- sizeof(result), 0);
++ char *buf;
++ char *result;
++ int retval;
++
++ buf = kmalloc(2, GFP_KERNEL);
++ if (buf == NULL)
++ return -ENOMEM;
++ result = kmalloc(64, GFP_KERNEL);
++ if (result == NULL) {
++ kfree(buf);
++ return -ENOMEM;
++ }
++
++ buf[0] = CINERGYT2_EP1_CONTROL_STREAM_TRANSFER;
++ buf[1] = enable ? 1 : 0;
++
++ retval = dvb_usb_generic_rw(adap->dev, buf, 2, result, 64, 0);
++
++ kfree(buf);
++ kfree(result);
++ return retval;
+ }
+
+ static int cinergyt2_power_ctrl(struct dvb_usb_device *d, int enable)
+ {
+- char buf[] = { CINERGYT2_EP1_SLEEP_MODE, enable ? 0 : 1 };
+- char state[3];
+- return dvb_usb_generic_rw(d, buf, sizeof(buf), state, sizeof(state), 0);
++ char *buf;
++ char *state;
++ int retval;
++
++ buf = kmalloc(2, GFP_KERNEL);
++ if (buf == NULL)
++ return -ENOMEM;
++ state = kmalloc(3, GFP_KERNEL);
++ if (state == NULL) {
++ kfree(buf);
++ return -ENOMEM;
++ }
++
++ buf[0] = CINERGYT2_EP1_SLEEP_MODE;
++ buf[1] = enable ? 1 : 0;
++
++ retval = dvb_usb_generic_rw(d, buf, 2, state, 3, 0);
++
++ kfree(buf);
++ kfree(state);
++ return retval;
+ }
+
+ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap)
+ {
+- char query[] = { CINERGYT2_EP1_GET_FIRMWARE_VERSION };
+- char state[3];
++ char *query;
++ char *state;
+ int ret;
++ query = kmalloc(1, GFP_KERNEL);
++ if (query == NULL)
++ return -ENOMEM;
++ state = kmalloc(3, GFP_KERNEL);
++ if (state == NULL) {
++ kfree(query);
++ return -ENOMEM;
++ }
++
++ query[0] = CINERGYT2_EP1_GET_FIRMWARE_VERSION;
+
+ adap->fe_adap[0].fe = cinergyt2_fe_attach(adap->dev);
+
+- ret = dvb_usb_generic_rw(adap->dev, query, sizeof(query), state,
+- sizeof(state), 0);
++ ret = dvb_usb_generic_rw(adap->dev, query, 1, state, 3, 0);
+ if (ret < 0) {
+ deb_rc("cinergyt2_power_ctrl() Failed to retrieve sleep "
+ "state info\n");
+@@ -80,7 +124,8 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap)
+
+ /* Copy this pointer as we are gonna need it in the release phase */
+ cinergyt2_usb_device = adap->dev;
+-
++ kfree(query);
++ kfree(state);
+ return 0;
+ }
+
+@@ -141,12 +186,23 @@ static int repeatable_keys[] = {
+ static int cinergyt2_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
+ {
+ struct cinergyt2_state *st = d->priv;
+- u8 key[5] = {0, 0, 0, 0, 0}, cmd = CINERGYT2_EP1_GET_RC_EVENTS;
++ u8 *key, *cmd;
+ int i;
+
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -EINVAL;
++ key = kzalloc(5, GFP_KERNEL);
++ if (key == NULL) {
++ kfree(cmd);
++ return -EINVAL;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_RC_EVENTS;
++
+ *state = REMOTE_NO_KEY_PRESSED;
+
+- dvb_usb_generic_rw(d, &cmd, 1, key, sizeof(key), 0);
++ dvb_usb_generic_rw(d, cmd, 1, key, 5, 0);
+ if (key[4] == 0xff) {
+ /* key repeat */
+ st->rc_counter++;
+@@ -157,12 +213,12 @@ static int cinergyt2_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
+ *event = d->last_event;
+ deb_rc("repeat key, event %x\n",
+ *event);
+- return 0;
++ goto out;
+ }
+ }
+ deb_rc("repeated key (non repeatable)\n");
+ }
+- return 0;
++ goto out;
+ }
+
+ /* hack to pass checksum on the custom field */
+@@ -174,6 +230,9 @@ static int cinergyt2_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
+
+ deb_rc("key: %*ph\n", 5, key);
+ }
++out:
++ kfree(cmd);
++ kfree(key);
+ return 0;
+ }
+
+diff --git a/drivers/media/usb/dvb-usb/cinergyT2-fe.c b/drivers/media/usb/dvb-usb/cinergyT2-fe.c
+index c890fe4..f9b2ae6 100644
+--- a/drivers/media/usb/dvb-usb/cinergyT2-fe.c
++++ b/drivers/media/usb/dvb-usb/cinergyT2-fe.c
+@@ -145,103 +145,176 @@ static int cinergyt2_fe_read_status(struct dvb_frontend *fe,
+ fe_status_t *status)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg result;
+- u8 cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *result;
++ u8 *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (u8 *)&result,
+- sizeof(result), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ result = kmalloc(sizeof(*result), GFP_KERNEL);
++ if (result == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (u8 *)result,
++ sizeof(*result), 0);
+ if (ret < 0)
+- return ret;
++ goto out;
+
+ *status = 0;
+
+- if (0xffff - le16_to_cpu(result.gain) > 30)
++ if (0xffff - le16_to_cpu(result->gain) > 30)
+ *status |= FE_HAS_SIGNAL;
+- if (result.lock_bits & (1 << 6))
++ if (result->lock_bits & (1 << 6))
+ *status |= FE_HAS_LOCK;
+- if (result.lock_bits & (1 << 5))
++ if (result->lock_bits & (1 << 5))
+ *status |= FE_HAS_SYNC;
+- if (result.lock_bits & (1 << 4))
++ if (result->lock_bits & (1 << 4))
+ *status |= FE_HAS_CARRIER;
+- if (result.lock_bits & (1 << 1))
++ if (result->lock_bits & (1 << 1))
+ *status |= FE_HAS_VITERBI;
+
+ if ((*status & (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC)) !=
+ (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC))
+ *status &= ~FE_HAS_LOCK;
+
+- return 0;
++out:
++ kfree(cmd);
++ kfree(result);
++ return ret;
+ }
- static int dib7070_set_param_override(struct dvb_frontend *fe)
+ static int cinergyt2_fe_read_ber(struct dvb_frontend *fe, u32 *ber)
{
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg status;
+- char cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *status;
++ char *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (char *)&status,
+- sizeof(status), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ status = kmalloc(sizeof(*status), GFP_KERNEL);
++ if (status == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (char *)status,
++ sizeof(*status), 0);
+ if (ret < 0)
+- return ret;
++ goto out;
+
+- *ber = le32_to_cpu(status.viterbi_error_rate);
++ *ber = le32_to_cpu(status->viterbi_error_rate);
++out:
++ kfree(cmd);
++ kfree(status);
+ return 0;
+ }
+
+ static int cinergyt2_fe_read_unc_blocks(struct dvb_frontend *fe, u32 *unc)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg status;
+- u8 cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *status;
++ u8 *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (u8 *)&status,
+- sizeof(status), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ status = kmalloc(sizeof(*status), GFP_KERNEL);
++ if (status == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (u8 *)status,
++ sizeof(*status), 0);
+ if (ret < 0) {
+ err("cinergyt2_fe_read_unc_blocks() Failed! (Error=%d)\n",
+ ret);
+- return ret;
++ goto out;
+ }
+- *unc = le32_to_cpu(status.uncorrected_block_count);
+- return 0;
++ *unc = le32_to_cpu(status->uncorrected_block_count);
++
++out:
++ kfree(cmd);
++ kfree(status);
++ return ret;
+ }
+
+ static int cinergyt2_fe_read_signal_strength(struct dvb_frontend *fe,
+ u16 *strength)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg status;
+- char cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *status;
++ char *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (char *)&status,
+- sizeof(status), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ status = kmalloc(sizeof(*status), GFP_KERNEL);
++ if (status == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (char *)status,
++ sizeof(*status), 0);
+ if (ret < 0) {
+ err("cinergyt2_fe_read_signal_strength() Failed!"
+ " (Error=%d)\n", ret);
+- return ret;
++ goto out;
+ }
+- *strength = (0xffff - le16_to_cpu(status.gain));
++ *strength = (0xffff - le16_to_cpu(status->gain));
++
++out:
++ kfree(cmd);
++ kfree(status);
+ return 0;
+ }
+
+ static int cinergyt2_fe_read_snr(struct dvb_frontend *fe, u16 *snr)
+ {
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_get_status_msg status;
+- char cmd[] = { CINERGYT2_EP1_GET_TUNER_STATUS };
++ struct dvbt_get_status_msg *status;
++ char *cmd;
+ int ret;
+
+- ret = dvb_usb_generic_rw(state->d, cmd, sizeof(cmd), (char *)&status,
+- sizeof(status), 0);
++ cmd = kmalloc(1, GFP_KERNEL);
++ if (cmd == NULL)
++ return -ENOMEM;
++ status = kmalloc(sizeof(*status), GFP_KERNEL);
++ if (status == NULL) {
++ kfree(cmd);
++ return -ENOMEM;
++ }
++
++ cmd[0] = CINERGYT2_EP1_GET_TUNER_STATUS;
++
++ ret = dvb_usb_generic_rw(state->d, cmd, 1, (char *)status,
++ sizeof(*status), 0);
+ if (ret < 0) {
+ err("cinergyt2_fe_read_snr() Failed! (Error=%d)\n", ret);
+- return ret;
++ goto out;
+ }
+- *snr = (status.snr << 8) | status.snr;
+- return 0;
++ *snr = (status->snr << 8) | status->snr;
++
++out:
++ kfree(cmd);
++ kfree(status);
++ return ret;
+ }
+
+ static int cinergyt2_fe_init(struct dvb_frontend *fe)
+@@ -266,35 +339,46 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe)
+ {
+ struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
+ struct cinergyt2_fe_state *state = fe->demodulator_priv;
+- struct dvbt_set_parameters_msg param;
+- char result[2];
++ struct dvbt_set_parameters_msg *param;
++ char *result;
+ int err;
+
+- param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
+- param.tps = cpu_to_le16(compute_tps(fep));
+- param.freq = cpu_to_le32(fep->frequency / 1000);
+- param.flags = 0;
++ result = kmalloc(2, GFP_KERNEL);
++ if (result == NULL)
++ return -ENOMEM;
++ param = kmalloc(sizeof(*param), GFP_KERNEL);
++ if (param == NULL) {
++ kfree(result);
++ return -ENOMEM;
++ }
++
++ param->cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
++ param->tps = cpu_to_le16(compute_tps(fep));
++ param->freq = cpu_to_le32(fep->frequency / 1000);
++ param->flags = 0;
+
+ switch (fep->bandwidth_hz) {
+ default:
+ case 8000000:
+- param.bandwidth = 8;
++ param->bandwidth = 8;
+ break;
+ case 7000000:
+- param.bandwidth = 7;
++ param->bandwidth = 7;
+ break;
+ case 6000000:
+- param.bandwidth = 6;
++ param->bandwidth = 6;
+ break;
+ }
+
+ err = dvb_usb_generic_rw(state->d,
+- (char *)¶m, sizeof(param),
+- result, sizeof(result), 0);
++ (char *)param, sizeof(*param),
++ result, 2, 0);
+ if (err < 0)
+ err("cinergyt2_fe_set_frontend() Failed! err=%d\n", err);
+
+- return (err < 0) ? err : 0;
++ kfree(result);
++ kfree(param);
++ return err;
+ }
+
+ static void cinergyt2_fe_release(struct dvb_frontend *fe)
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-firmware.c b/drivers/media/usb/dvb-usb/dvb-usb-firmware.c
index 733a7ff..f8b52e3 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-firmware.c
}
EXPORT_SYMBOL(usb_cypress_load_firmware);
diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
-index ae0f56a..ec71784 100644
+index 2add8c5..c33b854 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -118,7 +118,7 @@ struct su3000_state {
/* debug */
static int dvb_usb_dw2102_debug;
diff --git a/drivers/media/usb/dvb-usb/technisat-usb2.c b/drivers/media/usb/dvb-usb/technisat-usb2.c
-index d947e03..87fef42 100644
+index 6b0b8b6b..4038398 100644
--- a/drivers/media/usb/dvb-usb/technisat-usb2.c
+++ b/drivers/media/usb/dvb-usb/technisat-usb2.c
@@ -87,8 +87,11 @@ struct technisat_usb2_state {
}
diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
-index 7e2411c..cef73ca 100644
+index cca6c2f..77b9a18 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -328,7 +328,7 @@ struct v4l2_buffer32 {
if (get_user(p, &up->m.planes))
return -EFAULT;
uplane32 = compat_ptr(p);
-@@ -552,7 +552,7 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
- get_user(kp->capability, &up->capability) ||
- get_user(kp->flags, &up->flags))
+@@ -562,7 +562,7 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
+ get_user(kp->flags, &up->flags) ||
+ copy_from_user(&kp->fmt, &up->fmt, sizeof(up->fmt)))
return -EFAULT;
- kp->base = compat_ptr(tmp);
+ kp->base = (void __force_kernel *)compat_ptr(tmp);
- get_v4l2_pix_format(&kp->fmt, &up->fmt);
return 0;
}
-@@ -658,7 +658,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
+
+@@ -667,7 +667,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
n * sizeof(struct v4l2_ext_control32)))
return -EFAULT;
kcontrols = compat_alloc_user_space(n * sizeof(struct v4l2_ext_control));
while (--n >= 0) {
if (copy_in_user(kcontrols, ucontrols, sizeof(*ucontrols)))
return -EFAULT;
-@@ -680,7 +680,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
+@@ -689,7 +689,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext_controls32 __user *up)
{
struct v4l2_ext_control32 __user *ucontrols;
int n = kp->count;
compat_caddr_t p;
-@@ -774,7 +774,7 @@ static int put_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up)
+@@ -783,7 +783,7 @@ static int put_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up)
put_user(kp->start_block, &up->start_block) ||
put_user(kp->blocks, &up->blocks) ||
put_user(tmp, &up->edid) ||
return -EFAULT;
return 0;
}
-diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
-index 55c6832..a91c7a6 100644
---- a/drivers/media/v4l2-core/v4l2-ctrls.c
-+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
-@@ -1431,8 +1431,8 @@ static int validate_new(const struct v4l2_ctrl *ctrl,
- return 0;
-
- case V4L2_CTRL_TYPE_STRING:
-- len = strlen(c->string);
-- if (len < ctrl->minimum)
-+ len = strlen_user(c->string);
-+ if (!len || len < ctrl->minimum)
- return -ERANGE;
- if ((len - ctrl->minimum) % ctrl->step)
- return -ERANGE;
diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c
index 015f92a..59e311e 100644
--- a/drivers/media/v4l2-core/v4l2-device.c
if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
-index 16bffd8..3ab516a 100644
+index d15e167..337f374 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
-@@ -2003,7 +2003,8 @@ struct v4l2_ioctl_info {
+@@ -2142,7 +2142,8 @@ struct v4l2_ioctl_info {
struct file *file, void *fh, void *p);
} u;
void (*debug)(const void *arg, bool write_only);
/* This control needs a priority check */
#define INFO_FL_PRIO (1 << 0)
-@@ -2186,7 +2187,7 @@ static long __video_do_ioctl(struct file *file,
+@@ -2326,7 +2327,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;
const struct v4l2_ioctl_info *info;
void *fh = file->private_data;
struct v4l2_fh *vfh = NULL;
-@@ -2276,7 +2277,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
+@@ -2413,7 +2414,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
ret = -EINVAL;
break;
}
*kernel_ptr = (void **)&buf->m.planes;
*array_size = sizeof(struct v4l2_plane) * buf->length;
ret = 1;
-@@ -2293,7 +2294,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
+@@ -2430,7 +2431,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
ret = -EINVAL;
break;
}
*kernel_ptr = (void **)&edid->edid;
*array_size = edid->blocks * 128;
ret = 1;
-@@ -2311,7 +2312,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
+@@ -2448,7 +2449,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
ret = -EINVAL;
break;
}
*kernel_ptr = (void **)&ctrls->controls;
*array_size = sizeof(struct v4l2_ext_control)
* ctrls->count;
-@@ -2412,7 +2413,7 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
+@@ -2549,7 +2550,7 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
}
if (has_array_args) {
err = -EFAULT;
goto out_array_args;
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
-index ebc0af7..baed058 100644
+index a896d94..a5d56b1 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)
+@@ -6752,8 +6752,13 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v)
seq_printf(m, " MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth);
seq_printf(m, " MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize);
/*
* Rounding UP to nearest 4-kB boundary here...
*/
-@@ -6769,7 +6774,11 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v)
+@@ -6766,7 +6771,11 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v)
ioc->facts.GlobalCredits);
seq_printf(m, " Frames @ 0x%p (Dma @ 0x%p)\n",
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 711fcb5..5da1fb0 100644
+index 0707fa2..70ca794 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)
static inline struct sas_port *
mptsas_get_port(struct mptsas_phyinfo *phy_info)
{
-diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
-index 2a1c6f2..a04c6a2 100644
---- a/drivers/message/fusion/mptscsih.c
-+++ b/drivers/message/fusion/mptscsih.c
-@@ -1271,15 +1271,16 @@ mptscsih_info(struct Scsi_Host *SChost)
-
- h = shost_priv(SChost);
-
-- if (h) {
-- if (h->info_kbuf == NULL)
-- if ((h->info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL)
-- return h->info_kbuf;
-- h->info_kbuf[0] = '\0';
-+ if (!h)
-+ return NULL;
-
-- mpt_print_ioc_summary(h->ioc, h->info_kbuf, &size, 0, 0);
-- h->info_kbuf[size-1] = '\0';
-- }
-+ if (h->info_kbuf == NULL)
-+ if ((h->info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL)
-+ return h->info_kbuf;
-+ h->info_kbuf[0] = '\0';
-+
-+ mpt_print_ioc_summary(h->ioc, h->info_kbuf, &size, 0, 0);
-+ h->info_kbuf[size-1] = '\0';
-
- return h->info_kbuf;
- }
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index b7d87cd..3fb36da 100644
--- a/drivers/message/i2o/i2o_proc.c
#endif
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
-index d1a22aa..d0f7bf7 100644
+index b2c7e3b..85aa4764 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -100,7 +100,7 @@ static int irq_last;
static u8 avg_sample = SAMPLE_16;
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
-index a83eed5..62a58a9 100644
+index ecbe78e..b2ca870 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -152,7 +152,7 @@ static int max8925_probe(struct i2c_client *client,
if (node && !pdata) {
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
-index f9e42ea..614d240 100644
+index f243e75..322176c 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -230,7 +230,7 @@ static int tps65910_irq_init(struct tps65910 *tps65910, int irq,
if (!irq) {
dev_warn(tps65910->dev, "No interrupt support, no core IRQ\n");
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
-index 596b1f6..5b6ab74 100644
+index b1dabba..24a88f2 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -34,6 +34,7 @@
break;
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
-index 452782b..0c10e40 100644
+index ede41f0..744fbd9 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -574,7 +574,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
/*
* 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 738fa24..1568451 100644
+index 08fd956..370487a 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
-@@ -257,5 +257,5 @@ struct dw_mci_drv_data {
+@@ -262,5 +262,5 @@ struct dw_mci_drv_data {
int (*parse_dt)(struct dw_mci *host);
int (*execute_tuning)(struct dw_mci_slot *slot, u32 opcode,
struct dw_mci_tuning_data *tuning_data);
+} __do_const;
#endif /* _DW_MMC_H_ */
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
-index 249ab80..9314ce1 100644
+index e4d4707..28262a3 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
-@@ -1507,7 +1507,9 @@ static int mmci_probe(struct amba_device *dev,
+@@ -1612,7 +1612,9 @@ static int mmci_probe(struct amba_device *dev,
mmc->caps |= MMC_CAP_CMD23;
if (variant->busy_detect) {
if (!ECCBUF_SIZE) {
/* We should fall back to a general writev implementation.
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
-index 9f2012a..a81c720 100644
+index 0b071a3..8ec3d5b 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -24,6 +24,7 @@
#include "denali.h"
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
-index f638cd8..2cbf586 100644
+index 959cb9b..8520fe5 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
-@@ -387,7 +387,7 @@ void prepare_data_dma(struct gpmi_nand_data *this, enum dma_data_direction dr)
+@@ -386,7 +386,7 @@ void prepare_data_dma(struct gpmi_nand_data *this, enum dma_data_direction dr)
/* first try to map the upper buffer directly */
if (virt_addr_valid(this->upper_buf) &&
struct sm_sysfs_attribute *vendor_attribute;
char *vendor;
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
-index 5ab3c18..5c3a836 100644
+index d163e11..f517018 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
-@@ -542,7 +542,7 @@ nla_put_failure:
+@@ -548,7 +548,7 @@ nla_put_failure:
return -EMSGSIZE;
}
/* Scatter/gather IO is not supported,
* so it is turned off
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-common.h b/drivers/net/ethernet/amd/xgbe/xgbe-common.h
-index bf462ee8..18b8375 100644
+index cc25a3a..c8d72d3 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-common.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-common.h
-@@ -986,14 +986,14 @@ do { \
+@@ -1083,14 +1083,14 @@ do { \
* operations, everything works on mask values.
*/
#define XMDIO_READ(_pdata, _mmd, _reg) \
MII_ADDR_C45 | (_mmd << 16) | ((_reg) & 0xffff), (_val)))
#define XMDIO_WRITE_BITS(_pdata, _mmd, _reg, _mask, _val) \
-diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
-index 6bb76d5..ded47a8 100644
---- a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
-+++ b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
-@@ -273,7 +273,7 @@ static ssize_t xpcs_reg_value_read(struct file *filp, char __user *buffer,
- struct xgbe_prv_data *pdata = filp->private_data;
- unsigned int value;
-
-- value = pdata->hw_if.read_mmd_regs(pdata, pdata->debugfs_xpcs_mmd,
-+ value = pdata->hw_if->read_mmd_regs(pdata, pdata->debugfs_xpcs_mmd,
- pdata->debugfs_xpcs_reg);
-
- return xgbe_common_read(buffer, count, ppos, value);
-@@ -291,7 +291,7 @@ static ssize_t xpcs_reg_value_write(struct file *filp,
- if (len < 0)
- return len;
+diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dcb.c b/drivers/net/ethernet/amd/xgbe/xgbe-dcb.c
+index 7d6a49b..e6d403b 100644
+--- a/drivers/net/ethernet/amd/xgbe/xgbe-dcb.c
++++ b/drivers/net/ethernet/amd/xgbe/xgbe-dcb.c
+@@ -188,7 +188,7 @@ static int xgbe_dcb_ieee_setets(struct net_device *netdev,
-- pdata->hw_if.write_mmd_regs(pdata, pdata->debugfs_xpcs_mmd,
-+ pdata->hw_if->write_mmd_regs(pdata, pdata->debugfs_xpcs_mmd,
- pdata->debugfs_xpcs_reg, value);
+ memcpy(pdata->ets, ets, sizeof(*pdata->ets));
- return len;
+- pdata->hw_if.config_dcb_tc(pdata);
++ pdata->hw_if->config_dcb_tc(pdata);
+
+ return 0;
+ }
+@@ -227,7 +227,7 @@ static int xgbe_dcb_ieee_setpfc(struct net_device *netdev,
+
+ memcpy(pdata->pfc, pfc, sizeof(*pdata->pfc));
+
+- pdata->hw_if.config_dcb_pfc(pdata);
++ pdata->hw_if->config_dcb_pfc(pdata);
+
+ return 0;
+ }
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
-index 6f1c859..e96ac1a 100644
+index 1c5d62e..8e14d54 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
@@ -236,7 +236,7 @@ err_ring:
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_ring_desc *rdesc;
-@@ -496,7 +496,7 @@ err_out:
+@@ -506,7 +506,7 @@ err_out:
static void xgbe_realloc_skb(struct xgbe_channel *channel)
{
struct xgbe_prv_data *pdata = channel->pdata;
struct xgbe_ring *ring = channel->rx_ring;
struct xgbe_ring_data *rdata;
struct sk_buff *skb = NULL;
-@@ -540,17 +540,12 @@ static void xgbe_realloc_skb(struct xgbe_channel *channel)
+@@ -550,17 +550,12 @@ static void xgbe_realloc_skb(struct xgbe_channel *channel)
DBGPR("<--xgbe_realloc_skb\n");
}
+ .wrapper_rx_desc_init = xgbe_wrapper_rx_descriptor_init,
+};
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
-index 002293b..5ced1dd 100644
+index ea27383..d695e45 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
-@@ -2030,7 +2030,7 @@ static void xgbe_powerdown_rx(struct xgbe_prv_data *pdata)
+@@ -2463,7 +2463,7 @@ static void xgbe_powerdown_rx(struct xgbe_prv_data *pdata)
static int xgbe_init(struct xgbe_prv_data *pdata)
{
int ret;
DBGPR("-->xgbe_init\n");
-@@ -2096,87 +2096,82 @@ static int xgbe_init(struct xgbe_prv_data *pdata)
+@@ -2525,101 +2525,96 @@ static int xgbe_init(struct xgbe_prv_data *pdata)
return 0;
}
-
- hw_if->set_promiscuous_mode = xgbe_set_promiscuous_mode;
- hw_if->set_all_multicast_mode = xgbe_set_all_multicast_mode;
-- hw_if->set_addn_mac_addrs = xgbe_set_addn_mac_addrs;
+- hw_if->add_mac_addresses = xgbe_add_mac_addresses;
- hw_if->set_mac_address = xgbe_set_mac_address;
-
- hw_if->enable_rx_csum = xgbe_enable_rx_csum;
-
- hw_if->enable_rx_vlan_stripping = xgbe_enable_rx_vlan_stripping;
- hw_if->disable_rx_vlan_stripping = xgbe_disable_rx_vlan_stripping;
+- hw_if->enable_rx_vlan_filtering = xgbe_enable_rx_vlan_filtering;
+- hw_if->disable_rx_vlan_filtering = xgbe_disable_rx_vlan_filtering;
+- hw_if->update_vlan_hash_table = xgbe_update_vlan_hash_table;
-
- hw_if->read_mmd_regs = xgbe_read_mmd_regs;
- hw_if->write_mmd_regs = xgbe_write_mmd_regs;
+
+ .set_promiscuous_mode = xgbe_set_promiscuous_mode,
+ .set_all_multicast_mode = xgbe_set_all_multicast_mode,
-+ .set_addn_mac_addrs = xgbe_set_addn_mac_addrs,
++ .add_mac_addresses = xgbe_add_mac_addresses,
+ .set_mac_address = xgbe_set_mac_address,
+
+ .enable_rx_csum = xgbe_enable_rx_csum,
+
+ .enable_rx_vlan_stripping = xgbe_enable_rx_vlan_stripping,
+ .disable_rx_vlan_stripping = xgbe_disable_rx_vlan_stripping,
++ .enable_rx_vlan_filtering = xgbe_enable_rx_vlan_filtering,
++ .disable_rx_vlan_filtering = xgbe_disable_rx_vlan_filtering,
++ .update_vlan_hash_table = xgbe_update_vlan_hash_table,
+
+ .read_mmd_regs = xgbe_read_mmd_regs,
+ .write_mmd_regs = xgbe_write_mmd_regs,
- hw_if->tx_mmc_int = xgbe_tx_mmc_int;
- hw_if->rx_mmc_int = xgbe_rx_mmc_int;
- hw_if->read_mmc_stats = xgbe_read_mmc_stats;
--
-- DBGPR("<--xgbe_init_function_ptrs\n");
--}
+ .tx_mmc_int = xgbe_tx_mmc_int,
+ .rx_mmc_int = xgbe_rx_mmc_int,
+ .read_mmc_stats = xgbe_read_mmc_stats,
+
+ /* For PTP config */
+- hw_if->config_tstamp = xgbe_config_tstamp;
+- hw_if->update_tstamp_addend = xgbe_update_tstamp_addend;
+- hw_if->set_tstamp_time = xgbe_set_tstamp_time;
+- hw_if->get_tstamp_time = xgbe_get_tstamp_time;
+- hw_if->get_tx_tstamp = xgbe_get_tx_tstamp;
++ .config_tstamp = xgbe_config_tstamp,
++ .update_tstamp_addend = xgbe_update_tstamp_addend,
++ .set_tstamp_time = xgbe_set_tstamp_time,
++ .get_tstamp_time = xgbe_get_tstamp_time,
++ .get_tx_tstamp = xgbe_get_tx_tstamp,
+
+ /* For Data Center Bridging config */
+- hw_if->config_dcb_tc = xgbe_config_dcb_tc;
+- hw_if->config_dcb_pfc = xgbe_config_dcb_pfc;
+-
+- DBGPR("<--xgbe_init_function_ptrs\n");
+-}
++ .config_dcb_tc = xgbe_config_dcb_tc,
++ .config_dcb_pfc = xgbe_config_dcb_pfc
+};
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
-index cfe3d93..07a78ae 100644
+index b26d758..b0d1c3b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
-@@ -153,7 +153,7 @@ static int xgbe_calc_rx_buf_size(struct net_device *netdev, unsigned int mtu)
+@@ -155,7 +155,7 @@ static int xgbe_calc_rx_buf_size(struct net_device *netdev, unsigned int mtu)
static void xgbe_enable_rx_tx_ints(struct xgbe_prv_data *pdata)
{
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
struct xgbe_channel *channel;
+ enum xgbe_int int_id;
unsigned int i;
-
-@@ -170,7 +170,7 @@ static void xgbe_enable_rx_tx_ints(struct xgbe_prv_data *pdata)
+@@ -177,7 +177,7 @@ static void xgbe_enable_rx_tx_ints(struct xgbe_prv_data *pdata)
static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *pdata)
{
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
struct xgbe_channel *channel;
+ enum xgbe_int int_id;
unsigned int i;
-
-@@ -188,7 +188,7 @@ static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *pdata)
+@@ -200,7 +200,7 @@ static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *pdata)
static irqreturn_t xgbe_isr(int irq, void *data)
{
struct xgbe_prv_data *pdata = data;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
struct xgbe_channel *channel;
unsigned int dma_isr, dma_ch_isr;
- unsigned int mac_isr;
-@@ -403,7 +403,7 @@ static void xgbe_napi_disable(struct xgbe_prv_data *pdata)
+ unsigned int mac_isr, mac_tssr;
+@@ -447,7 +447,7 @@ static void xgbe_napi_disable(struct xgbe_prv_data *pdata, unsigned int del)
void xgbe_init_tx_coalesce(struct xgbe_prv_data *pdata)
{
DBGPR("-->xgbe_init_tx_coalesce\n");
-@@ -417,7 +417,7 @@ void xgbe_init_tx_coalesce(struct xgbe_prv_data *pdata)
+@@ -461,7 +461,7 @@ void xgbe_init_tx_coalesce(struct xgbe_prv_data *pdata)
void xgbe_init_rx_coalesce(struct xgbe_prv_data *pdata)
{
DBGPR("-->xgbe_init_rx_coalesce\n");
-@@ -431,7 +431,7 @@ void xgbe_init_rx_coalesce(struct xgbe_prv_data *pdata)
+@@ -475,7 +475,7 @@ void xgbe_init_rx_coalesce(struct xgbe_prv_data *pdata)
static void xgbe_free_tx_skbuff(struct xgbe_prv_data *pdata)
{
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_ring_data *rdata;
-@@ -456,7 +456,7 @@ static void xgbe_free_tx_skbuff(struct xgbe_prv_data *pdata)
+@@ -500,7 +500,7 @@ static void xgbe_free_tx_skbuff(struct xgbe_prv_data *pdata)
static void xgbe_free_rx_skbuff(struct xgbe_prv_data *pdata)
{
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_ring_data *rdata;
-@@ -482,7 +482,7 @@ static void xgbe_free_rx_skbuff(struct xgbe_prv_data *pdata)
+@@ -526,7 +526,7 @@ static void xgbe_free_rx_skbuff(struct xgbe_prv_data *pdata)
+ static void xgbe_adjust_link(struct net_device *netdev)
+ {
+ struct xgbe_prv_data *pdata = netdev_priv(netdev);
+- struct xgbe_hw_if *hw_if = &pdata->hw_if;
++ struct xgbe_hw_if *hw_if = pdata->hw_if;
+ struct phy_device *phydev = pdata->phydev;
+ int new_state = 0;
+
+@@ -634,7 +634,7 @@ static void xgbe_phy_exit(struct xgbe_prv_data *pdata)
int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
unsigned long flags;
DBGPR("-->xgbe_powerdown\n");
-@@ -520,7 +520,7 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
+@@ -672,7 +672,7 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
int xgbe_powerup(struct net_device *netdev, unsigned int caller)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
unsigned long flags;
DBGPR("-->xgbe_powerup\n");
-@@ -557,7 +557,7 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller)
+@@ -709,7 +709,7 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller)
static int xgbe_start(struct xgbe_prv_data *pdata)
{
struct net_device *netdev = pdata->netdev;
DBGPR("-->xgbe_start\n");
-@@ -583,7 +583,7 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
+@@ -735,7 +735,7 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
static void xgbe_stop(struct xgbe_prv_data *pdata)
{
struct net_device *netdev = pdata->netdev;
DBGPR("-->xgbe_stop\n");
-@@ -603,7 +603,7 @@ static void xgbe_stop(struct xgbe_prv_data *pdata)
+@@ -755,7 +755,7 @@ static void xgbe_stop(struct xgbe_prv_data *pdata)
static void xgbe_restart_dev(struct xgbe_prv_data *pdata, unsigned int reset)
{
DBGPR("-->xgbe_restart_dev\n");
-@@ -741,8 +741,8 @@ static void xgbe_packet_info(struct xgbe_ring *ring, struct sk_buff *skb,
+@@ -952,7 +952,7 @@ static int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata,
+ return -ERANGE;
+ }
+
+- pdata->hw_if.config_tstamp(pdata, mac_tscr);
++ pdata->hw_if->config_tstamp(pdata, mac_tscr);
+
+ memcpy(&pdata->tstamp_config, &config, sizeof(config));
+
+@@ -1090,8 +1090,8 @@ static void xgbe_packet_info(struct xgbe_prv_data *pdata,
static int xgbe_open(struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
int ret;
DBGPR("-->xgbe_open\n");
-@@ -804,8 +804,8 @@ err_clk:
+@@ -1171,8 +1171,8 @@ err_phy_init:
static int xgbe_close(struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
DBGPR("-->xgbe_close\n");
-@@ -835,8 +835,8 @@ static int xgbe_close(struct net_device *netdev)
+@@ -1206,8 +1206,8 @@ static int xgbe_close(struct net_device *netdev)
static int xgbe_xmit(struct sk_buff *skb, struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
struct xgbe_channel *channel;
struct xgbe_ring *ring;
struct xgbe_packet_data *packet;
-@@ -903,7 +903,7 @@ tx_netdev_return:
+@@ -1276,7 +1276,7 @@ tx_netdev_return:
static void xgbe_set_rx_mode(struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
unsigned int pr_mode, am_mode;
DBGPR("-->xgbe_set_rx_mode\n");
-@@ -930,7 +930,7 @@ static void xgbe_set_rx_mode(struct net_device *netdev)
+@@ -1295,7 +1295,7 @@ static void xgbe_set_rx_mode(struct net_device *netdev)
static int xgbe_set_mac_address(struct net_device *netdev, void *addr)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
struct sockaddr *saddr = addr;
DBGPR("-->xgbe_set_mac_address\n");
-@@ -976,7 +976,7 @@ static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
+@@ -1362,7 +1362,7 @@ static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
DBGPR("-->%s\n", __func__);
s->rx_packets = pstats->rxframecount_gb;
s->rx_bytes = pstats->rxoctetcount_gb;
-@@ -1020,7 +1020,7 @@ static int xgbe_set_features(struct net_device *netdev,
+@@ -1389,7 +1389,7 @@ static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto,
+ u16 vid)
+ {
+ struct xgbe_prv_data *pdata = netdev_priv(netdev);
+- struct xgbe_hw_if *hw_if = &pdata->hw_if;
++ struct xgbe_hw_if *hw_if = pdata->hw_if;
+
+ DBGPR("-->%s\n", __func__);
+
+@@ -1405,7 +1405,7 @@ static int xgbe_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto,
+ u16 vid)
+ {
+ struct xgbe_prv_data *pdata = netdev_priv(netdev);
+- struct xgbe_hw_if *hw_if = &pdata->hw_if;
++ struct xgbe_hw_if *hw_if = pdata->hw_if;
+
+ DBGPR("-->%s\n", __func__);
+
+@@ -1465,7 +1465,7 @@ static int xgbe_set_features(struct net_device *netdev,
netdev_features_t features)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
- unsigned int rxcsum_enabled, rxvlan_enabled;
+ unsigned int rxcsum, rxvlan, rxvlan_filter;
- rxcsum_enabled = !!(pdata->netdev_features & NETIF_F_RXCSUM);
-@@ -1072,8 +1072,8 @@ struct net_device_ops *xgbe_get_netdev_ops(void)
+ rxcsum = pdata->netdev_features & NETIF_F_RXCSUM;
+@@ -1521,7 +1521,7 @@ struct net_device_ops *xgbe_get_netdev_ops(void)
+ static void xgbe_rx_refresh(struct xgbe_channel *channel)
+ {
+ struct xgbe_prv_data *pdata = channel->pdata;
+- struct xgbe_desc_if *desc_if = &pdata->desc_if;
++ struct xgbe_desc_if *desc_if = pdata->desc_if;
+ struct xgbe_ring *ring = channel->rx_ring;
+ struct xgbe_ring_data *rdata;
+
+@@ -1537,8 +1537,8 @@ static void xgbe_rx_refresh(struct xgbe_channel *channel)
static int xgbe_tx_poll(struct xgbe_channel *channel)
{
struct xgbe_prv_data *pdata = channel->pdata;
struct xgbe_ring *ring = channel->tx_ring;
struct xgbe_ring_data *rdata;
struct xgbe_ring_desc *rdesc;
-@@ -1124,8 +1124,8 @@ static int xgbe_tx_poll(struct xgbe_channel *channel)
+@@ -1590,7 +1590,7 @@ static int xgbe_tx_poll(struct xgbe_channel *channel)
static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
{
struct xgbe_prv_data *pdata = channel->pdata;
- struct xgbe_hw_if *hw_if = &pdata->hw_if;
-- struct xgbe_desc_if *desc_if = &pdata->desc_if;
+ struct xgbe_hw_if *hw_if = pdata->hw_if;
-+ struct xgbe_desc_if *desc_if = pdata->desc_if;
struct xgbe_ring *ring = channel->rx_ring;
struct xgbe_ring_data *rdata;
struct xgbe_packet_data *packet;
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
-index 8909f2b..719e767 100644
+index 46f6130..f37dde3 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
-@@ -202,7 +202,7 @@ static void xgbe_get_ethtool_stats(struct net_device *netdev,
+@@ -203,7 +203,7 @@ static void xgbe_get_ethtool_stats(struct net_device *netdev,
DBGPR("-->%s\n", __func__);
for (i = 0; i < XGBE_STATS_COUNT; i++) {
stat = (u8 *)pdata + xgbe_gstring_stats[i].stat_offset;
*data++ = *(u64 *)stat;
-@@ -387,7 +387,7 @@ static int xgbe_get_coalesce(struct net_device *netdev,
+@@ -378,7 +378,7 @@ static int xgbe_get_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
unsigned int riwt;
DBGPR("-->xgbe_get_coalesce\n");
-@@ -410,7 +410,7 @@ static int xgbe_set_coalesce(struct net_device *netdev,
+@@ -401,7 +401,7 @@ static int xgbe_set_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
unsigned int tx_frames, tx_usecs;
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
-index 5a1891f..1b7888e 100644
+index bdf9cfa..340aea1 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -210,12 +210,6 @@ static void xgbe_default_config(struct xgbe_prv_data *pdata)
static int xgbe_probe(struct platform_device *pdev)
{
struct xgbe_prv_data *pdata;
-@@ -306,9 +300,8 @@ static int xgbe_probe(struct platform_device *pdev)
+@@ -328,9 +322,8 @@ static int xgbe_probe(struct platform_device *pdev)
netdev->base_addr = (unsigned long)pdata->xgmac_regs;
/* Set all the function pointers */
/* Issue software reset to device */
hw_if->exit(pdata);
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
-index ea7a5d6..d10a742 100644
+index 6d2221e..47d1325 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
-@@ -128,7 +128,7 @@
+@@ -127,7 +127,7 @@
static int xgbe_mdio_read(struct mii_bus *mii, int prtad, int mmd_reg)
{
struct xgbe_prv_data *pdata = mii->priv;
int mmd_data;
DBGPR_MDIO("-->xgbe_mdio_read: prtad=%#x mmd_reg=%#x\n",
-@@ -145,7 +145,7 @@ static int xgbe_mdio_write(struct mii_bus *mii, int prtad, int mmd_reg,
+@@ -144,7 +144,7 @@ static int xgbe_mdio_write(struct mii_bus *mii, int prtad, int mmd_reg,
u16 mmd_val)
{
struct xgbe_prv_data *pdata = mii->priv;
int mmd_data = mmd_val;
DBGPR_MDIO("-->xgbe_mdio_write: prtad=%#x mmd_reg=%#x mmd_data=%#x\n",
-@@ -161,7 +161,7 @@ static int xgbe_mdio_write(struct mii_bus *mii, int prtad, int mmd_reg,
- static void xgbe_adjust_link(struct net_device *netdev)
- {
- struct xgbe_prv_data *pdata = netdev_priv(netdev);
-- struct xgbe_hw_if *hw_if = &pdata->hw_if;
-+ struct xgbe_hw_if *hw_if = pdata->hw_if;
- struct phy_device *phydev = pdata->phydev;
- unsigned long flags;
- int new_state = 0;
+diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
+index 37e64cf..c3b61cf 100644
+--- a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
++++ b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
+@@ -130,7 +130,7 @@ static cycle_t xgbe_cc_read(const struct cyclecounter *cc)
+ tstamp_cc);
+ u64 nsec;
+
+- nsec = pdata->hw_if.get_tstamp_time(pdata);
++ nsec = pdata->hw_if->get_tstamp_time(pdata);
+
+ return nsec;
+ }
+@@ -159,7 +159,7 @@ static int xgbe_adjfreq(struct ptp_clock_info *info, s32 delta)
+
+ spin_lock_irqsave(&pdata->tstamp_lock, flags);
+
+- pdata->hw_if.update_tstamp_addend(pdata, addend);
++ pdata->hw_if->update_tstamp_addend(pdata, addend);
+
+ spin_unlock_irqrestore(&pdata->tstamp_lock, flags);
+
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
-index ab06271..a560fa7 100644
+index e9fe6e6..875fbaf 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
-@@ -527,8 +527,8 @@ struct xgbe_prv_data {
+@@ -585,8 +585,8 @@ struct xgbe_prv_data {
int irq_number;
+ const struct xgbe_hw_if *hw_if;
+ const struct xgbe_desc_if *desc_if;
- /* Rings for Tx/Rx on a DMA channel */
- struct xgbe_channel *channel;
-@@ -611,6 +611,9 @@ struct xgbe_prv_data {
+ /* AXI DMA settings */
+ unsigned int axdomain;
+@@ -699,6 +699,9 @@ struct xgbe_prv_data {
#endif
};
/**
* 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 461acca..2b546ba 100644
+index 31c9f82..e65e986 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -150,6 +150,7 @@
};
static void bna_attr_init(struct bna_ioceth *ioceth)
+diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
+index ffc92a4..40edc77 100644
+--- a/drivers/net/ethernet/brocade/bna/bnad.c
++++ b/drivers/net/ethernet/brocade/bna/bnad.c
+@@ -552,6 +552,7 @@ bnad_cq_setup_skb_frags(struct bna_rcb *rcb, struct sk_buff *skb,
+
+ len = (vec == nvecs) ?
+ last_fraglen : unmap->vector.len;
++ skb->truesize += unmap->vector.len;
+ totlen += len;
+
+ skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
+@@ -563,7 +564,6 @@ bnad_cq_setup_skb_frags(struct bna_rcb *rcb, struct sk_buff *skb,
+
+ skb->len += totlen;
+ skb->data_len += totlen;
+- skb->truesize += totlen;
+ }
+
+ static inline void
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
#define L2T_SKB_CB(skb) ((struct l2t_skb_cb *)(skb)->cb)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
-index a83271c..cf00874 100644
+index e5be511..16cb55c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
-@@ -2174,7 +2174,7 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
+@@ -2355,7 +2355,7 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
int i;
struct adapter *ap = netdev2adap(dev);
if (is_t4(ap->params.chip)) {
diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
-index c05b66d..ed69872 100644
+index cf8b6ff..274271e 100644
--- a/drivers/net/ethernet/dec/tulip/de4x5.c
+++ b/drivers/net/ethernet/dec/tulip/de4x5.c
-@@ -5388,7 +5388,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+@@ -5387,7 +5387,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
for (i=0; i<ETH_ALEN; i++) {
tmp.addr[i] = dev->dev_addr[i];
}
break;
case DE4X5_SET_HWADDR: /* Set the hardware address */
-@@ -5428,7 +5428,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+@@ -5427,7 +5427,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
spin_lock_irqsave(&lp->lock, flags);
memcpy(&statbuf, &lp->pktStats, ioc->len);
spin_unlock_irqrestore(&lp->lock, flags);
break;
}
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
-index 1e187fb..d024547 100644
+index 93ff8ef..01e0537 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -533,7 +533,7 @@ static void accumulate_16bit_val(u32 *acc, u16 val)
#include "ftmac100.h"
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
-index 101f439..59e7ec6 100644
+index 537b621..07f87ce 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -401,7 +401,7 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
}
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
-index 68f87ec..241dbe3 100644
+index 5fd4b52..87aa34b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
-@@ -792,7 +792,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
+@@ -794,7 +794,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
}
/* update the base incval used to calculate frequency adjustment */
smp_mb();
/* need lock to prevent incorrect read while modifying cyclecounter */
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+index c14d4d8..66da603 100644
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+@@ -1259,6 +1259,9 @@ int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting)
+ struct ixgbe_hw *hw = &adapter->hw;
+ u32 regval;
+
++ if (vf >= adapter->num_vfs)
++ return -EINVAL;
++
+ adapter->vfinfo[vf].spoofchk_enabled = setting;
+
+ regval = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg));
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
index 2bbd01f..e8baa64 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
fifo->mempool =
__vxge_hw_mempool_create(vpath->hldev,
fifo->config->memblock_size,
-diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
-index 73e6683..464e910 100644
---- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
-+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
-@@ -120,6 +120,10 @@ static void pch_gbe_mdio_write(struct net_device *netdev, int addr, int reg,
- int data);
- static void pch_gbe_set_multi(struct net_device *netdev);
-
-+static struct sock_filter ptp_filter[] = {
-+ PTP_FILTER
-+};
-+
- static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)
- {
- u8 *data = skb->data;
-@@ -127,7 +131,7 @@ static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)
- u16 *hi, *id;
- u32 lo;
-
-- if (ptp_classify_raw(skb) == PTP_CLASS_NONE)
-+ if (sk_run_filter(skb, ptp_filter) == PTP_CLASS_NONE)
- return 0;
-
- offset = ETH_HLEN + IPV4_HLEN(data) + UDP_HLEN;
-@@ -2631,6 +2635,11 @@ static int pch_gbe_probe(struct pci_dev *pdev,
-
- adapter->ptp_pdev = pci_get_bus_and_slot(adapter->pdev->bus->number,
- PCI_DEVFN(12, 4));
-+ if (ptp_filter_init(ptp_filter, ARRAY_SIZE(ptp_filter))) {
-+ dev_err(&pdev->dev, "Bad ptp filter\n");
-+ ret = -EINVAL;
-+ goto err_free_netdev;
-+ }
-
- netdev->netdev_ops = &pch_gbe_netdev_ops;
- netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
-index f33559b..c7f50ac 100644
+index 3172cdf..d01ab34 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
-@@ -2176,7 +2176,9 @@ int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter)
+@@ -2190,7 +2190,9 @@ int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter)
max_tx_rings = QLCNIC_MAX_VNIC_TX_RINGS;
} else if (ret == QLC_83XX_DEFAULT_OPMODE) {
ahw->nic_mode = QLCNIC_DEFAULT_MODE;
default:
dev_err(&adapter->pdev->dev, "Invalid Virtual NIC opmode\n");
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
-index e46fc39..abe135b 100644
+index c9f57fb..208bdc1 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
-@@ -1228,7 +1228,7 @@ flash_temp:
+@@ -1285,7 +1285,7 @@ flash_temp:
int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
{
struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump;
u32 entry_offset, dump, no_entries, buf_offset = 0;
int i, k, ops_cnt, ops_index, dump_size = 0;
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
-index 61623e9..ac97c27 100644
+index 0921302..927f761 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
-@@ -759,22 +759,22 @@ struct rtl8169_private {
+@@ -744,22 +744,22 @@ struct rtl8169_private {
struct mdio_ops {
void (*write)(struct rtl8169_private *, int, int);
int (*read)(struct rtl8169_private *, int);
MC_CMD_PTP_IN_SYNCHRONIZE_LEN);
EFX_BUG_ON_PARANOID(rc);
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
-index 50617c5..b13724c 100644
+index 08c483b..2c4a553 100644
--- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
@@ -140,8 +140,8 @@ void dwmac_mmc_ctrl(void __iomem *ioaddr, unsigned int mode)
}
/* To mask all all interrupts.*/
-diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
-index 6b56f85..50e285f 100644
---- a/drivers/net/ethernet/ti/cpts.c
-+++ b/drivers/net/ethernet/ti/cpts.c
-@@ -33,6 +33,10 @@
-
- #ifdef CONFIG_TI_CPTS
-
-+static struct sock_filter ptp_filter[] = {
-+ PTP_FILTER
-+};
-+
- #define cpts_read32(c, r) __raw_readl(&c->reg->r)
- #define cpts_write32(c, v, r) __raw_writel(v, &c->reg->r)
-
-@@ -296,7 +300,7 @@ static u64 cpts_find_ts(struct cpts *cpts, struct sk_buff *skb, int ev_type)
- u64 ns = 0;
- struct cpts_event *event;
- struct list_head *this, *next;
-- unsigned int class = ptp_classify_raw(skb);
-+ unsigned int class = sk_run_filter(skb, ptp_filter);
- unsigned long flags;
- u16 seqid;
- u8 mtype;
-@@ -367,6 +371,10 @@ int cpts_register(struct device *dev, struct cpts *cpts,
- int err, i;
- unsigned long flags;
-
-+ if (ptp_filter_init(ptp_filter, ARRAY_SIZE(ptp_filter))) {
-+ pr_err("cpts: bad ptp filter\n");
-+ return -EINVAL;
-+ }
- cpts->info = cpts_info;
- cpts->clock = ptp_clock_register(&cpts->info, dev);
- if (IS_ERR(cpts->clock)) {
-diff --git a/drivers/net/ethernet/xscale/Kconfig b/drivers/net/ethernet/xscale/Kconfig
-index b81bc9f..3f43101 100644
---- a/drivers/net/ethernet/xscale/Kconfig
-+++ b/drivers/net/ethernet/xscale/Kconfig
-@@ -23,7 +23,6 @@ config IXP4XX_ETH
- tristate "Intel IXP4xx Ethernet support"
- depends on ARM && ARCH_IXP4XX && IXP4XX_NPE && IXP4XX_QMGR
- select PHYLIB
-- select NET_PTP_CLASSIFY
- ---help---
- Say Y here if you want to use built-in Ethernet ports
- on IXP4xx processor.
-diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
-index f7e0f0f..25283f1 100644
---- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
-+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
-@@ -256,6 +256,10 @@ static int ports_open;
- static struct port *npe_port_tab[MAX_NPES];
- static struct dma_pool *dma_pool;
-
-+static struct sock_filter ptp_filter[] = {
-+ PTP_FILTER
-+};
-+
- static int ixp_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)
- {
- u8 *data = skb->data;
-@@ -263,7 +267,7 @@ static int ixp_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)
- u16 *hi, *id;
- u32 lo;
-
-- if (ptp_classify_raw(skb) != PTP_CLASS_V1_IPV4)
-+ if (sk_run_filter(skb, ptp_filter) != PTP_CLASS_V1_IPV4)
- return 0;
-
- offset = ETH_HLEN + IPV4_HLEN(data) + UDP_HLEN;
-@@ -1409,6 +1413,11 @@ static int eth_init_one(struct platform_device *pdev)
- char phy_id[MII_BUS_ID_SIZE + 3];
- int err;
-
-+ if (ptp_filter_init(ptp_filter, ARRAY_SIZE(ptp_filter))) {
-+ pr_err("ixp4xx_eth: bad ptp filter\n");
-+ return -EINVAL;
-+ }
-+
- if (!(dev = alloc_etherdev(sizeof(struct port))))
- return -ENOMEM;
-
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
-index 6cc37c1..fdd9d77 100644
+index d5e07de..e3bf20a 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
-@@ -170,7 +170,7 @@ struct rndis_device {
-
+@@ -171,7 +171,7 @@ struct rndis_device {
enum rndis_device_state state;
bool link_state;
+ bool link_change;
- atomic_t new_req_id;
+ atomic_unchecked_t new_req_id;
spinlock_t request_lock;
struct list_head req_list;
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 0fcb5e7..148fda3 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -556,6 +556,7 @@ do_lso:
+ do_send:
+ /* Start filling in the page buffers with the rndis hdr */
+ rndis_msg->msg_len += rndis_msg_size;
++ packet->total_data_buflen = rndis_msg->msg_len;
+ packet->page_buf_cnt = init_page_array(rndis_msg, rndis_msg_size,
+ skb, &packet->page_buf[0]);
+
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
-index 99c527a..6a2ce38 100644
+index 2b86f0b..ecc996f 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -102,7 +102,7 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
/* Add to the request list */
spin_lock_irqsave(&dev->request_lock, flags);
-@@ -930,7 +930,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
+@@ -911,7 +911,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
/* Setup the rndis set */
halt = &request->request_msg.msg.halt_req;
/* 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 78f18be..1d19c62 100644
+index 9ce854f..e43fa17 100644
--- a/drivers/net/ieee802154/fakehard.c
+++ b/drivers/net/ieee802154/fakehard.c
-@@ -364,7 +364,7 @@ static int ieee802154fake_probe(struct platform_device *pdev)
+@@ -365,7 +365,7 @@ static int ieee802154fake_probe(struct platform_device *pdev)
phy->transmit_power = 0xbf;
dev->netdev_ops = &fake_ops;
priv = netdev_priv(dev);
priv->phy = phy;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
-index ef8a5c2..76877d6 100644
+index 726edab..8939092 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -264,7 +264,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port,
}
/* called under rcu_read_lock() from netif_receive_skb */
-@@ -1134,13 +1134,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = {
+@@ -1144,13 +1144,15 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = {
int macvlan_link_register(struct rtnl_link_ops *ops)
{
/* common fields */
return rtnl_link_register(ops);
};
-@@ -1220,7 +1222,7 @@ static int macvlan_device_event(struct notifier_block *unused,
+@@ -1230,7 +1232,7 @@ static int macvlan_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
};
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
-index 3381c4f..dea5fd5 100644
+index 0c6adaa..0784e3f 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
-@@ -1020,7 +1020,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
+@@ -1018,7 +1018,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
}
ret = 0;
put_user(q->flags, &ifr->ifr_flags))
ret = -EFAULT;
macvtap_put_vlan(vlan);
-@@ -1190,7 +1190,7 @@ static int macvtap_device_event(struct notifier_block *unused,
+@@ -1188,7 +1188,7 @@ static int macvtap_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
.notifier_call = macvtap_device_event,
};
-diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
-index 9408157..d53b924 100644
---- a/drivers/net/phy/dp83640.c
-+++ b/drivers/net/phy/dp83640.c
-@@ -27,7 +27,6 @@
- #include <linux/module.h>
- #include <linux/net_tstamp.h>
- #include <linux/netdevice.h>
--#include <linux/if_vlan.h>
- #include <linux/phy.h>
- #include <linux/ptp_classify.h>
- #include <linux/ptp_clock_kernel.h>
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
-index d5b77ef..72ff14b 100644
+index fa0d717..bab8c01 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
-@@ -143,8 +143,9 @@ struct ppp {
- struct sk_buff_head mrq; /* MP: receive reconstruction queue */
- #endif /* CONFIG_PPP_MULTILINK */
- #ifdef CONFIG_PPP_FILTER
-- struct sk_filter *pass_filter; /* filter for packets to pass */
-- struct sk_filter *active_filter;/* filter for pkts to reset idle */
-+ struct sock_filter *pass_filter; /* filter for packets to pass */
-+ struct sock_filter *active_filter;/* filter for pkts to reset idle */
-+ unsigned pass_len, active_len;
- #endif /* CONFIG_PPP_FILTER */
- struct net *ppp_net; /* the net we belong to */
- struct ppp_link_stats stats64; /* 64 bit network stats */
-@@ -539,7 +540,7 @@ static int get_filter(void __user *arg, struct sock_filter **p)
- {
- struct sock_fprog uprog;
- struct sock_filter *code = NULL;
-- int len;
-+ int len, err;
-
- if (copy_from_user(&uprog, arg, sizeof(uprog)))
- return -EFAULT;
-@@ -554,6 +555,12 @@ static int get_filter(void __user *arg, struct sock_filter **p)
- if (IS_ERR(code))
- return PTR_ERR(code);
-
-+ err = sk_chk_filter(code, uprog.len);
-+ if (err) {
-+ kfree(code);
-+ return err;
-+ }
-+
- *p = code;
- return uprog.len;
- }
-@@ -748,52 +755,28 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
- case PPPIOCSPASS:
- {
- struct sock_filter *code;
--
- err = get_filter(argp, &code);
- if (err >= 0) {
-- struct sock_fprog_kern fprog = {
-- .len = err,
-- .filter = code,
-- };
--
- ppp_lock(ppp);
-- if (ppp->pass_filter) {
-- sk_unattached_filter_destroy(ppp->pass_filter);
-- ppp->pass_filter = NULL;
-- }
-- if (fprog.filter != NULL)
-- err = sk_unattached_filter_create(&ppp->pass_filter,
-- &fprog);
-- else
-- err = 0;
-- kfree(code);
-+ kfree(ppp->pass_filter);
-+ ppp->pass_filter = code;
-+ ppp->pass_len = err;
- ppp_unlock(ppp);
-+ err = 0;
+@@ -594,7 +594,7 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+ if (file == ppp->owner)
+ ppp_shutdown_interface(ppp);
}
- break;
- }
- case PPPIOCSACTIVE:
- {
- struct sock_filter *code;
--
- err = get_filter(argp, &code);
- if (err >= 0) {
-- struct sock_fprog_kern fprog = {
-- .len = err,
-- .filter = code,
-- };
--
- ppp_lock(ppp);
-- if (ppp->active_filter) {
-- sk_unattached_filter_destroy(ppp->active_filter);
-- ppp->active_filter = NULL;
-- }
-- if (fprog.filter != NULL)
-- err = sk_unattached_filter_create(&ppp->active_filter,
-- &fprog);
-- else
-- err = 0;
-- kfree(code);
-+ kfree(ppp->active_filter);
-+ ppp->active_filter = code;
-+ ppp->active_len = err;
- ppp_unlock(ppp);
-+ err = 0;
- }
- break;
- }
-@@ -1201,7 +1184,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
- a four-byte PPP header on each packet */
- *skb_push(skb, 2) = 1;
- if (ppp->pass_filter &&
-- SK_RUN_FILTER(ppp->pass_filter, skb) == 0) {
-+ sk_run_filter(skb, ppp->pass_filter) == 0) {
- if (ppp->debug & 1)
- netdev_printk(KERN_DEBUG, ppp->dev,
- "PPP: outbound frame "
-@@ -1211,7 +1194,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
- }
- /* if this packet passes the active filter, record the time */
- if (!(ppp->active_filter &&
-- SK_RUN_FILTER(ppp->active_filter, skb) == 0))
-+ sk_run_filter(skb, ppp->active_filter) == 0))
- ppp->last_xmit = jiffies;
- skb_pull(skb, 2);
- #else
-@@ -1835,7 +1818,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
-
- *skb_push(skb, 2) = 0;
- if (ppp->pass_filter &&
-- SK_RUN_FILTER(ppp->pass_filter, skb) == 0) {
-+ sk_run_filter(skb, ppp->pass_filter) == 0) {
- if (ppp->debug & 1)
- netdev_printk(KERN_DEBUG, ppp->dev,
- "PPP: inbound frame "
-@@ -1844,7 +1827,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
- return;
- }
- if (!(ppp->active_filter &&
-- SK_RUN_FILTER(ppp->active_filter, skb) == 0))
-+ sk_run_filter(skb, ppp->active_filter) == 0))
- ppp->last_recv = jiffies;
- __skb_pull(skb, 2);
+- if (atomic_long_read(&file->f_count) <= 2) {
++ if (atomic_long_read(&file->f_count) < 2) {
+ ppp_release(NULL, file);
+ err = 0;
} else
-@@ -2689,10 +2672,6 @@ ppp_create_interface(struct net *net, int unit, int *retp)
- ppp->minseq = -1;
- skb_queue_head_init(&ppp->mrq);
- #endif /* CONFIG_PPP_MULTILINK */
--#ifdef CONFIG_PPP_FILTER
-- ppp->pass_filter = NULL;
-- ppp->active_filter = NULL;
--#endif /* CONFIG_PPP_FILTER */
+@@ -1020,7 +1020,6 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ void __user *addr = (void __user *) ifr->ifr_ifru.ifru_data;
+ struct ppp_stats stats;
+ struct ppp_comp_stats cstats;
+- char *vers;
- /*
- * drum roll: don't forget to set
-@@ -2823,15 +2802,10 @@ static void ppp_destroy_interface(struct ppp *ppp)
- skb_queue_purge(&ppp->mrq);
- #endif /* CONFIG_PPP_MULTILINK */
- #ifdef CONFIG_PPP_FILTER
-- if (ppp->pass_filter) {
-- sk_unattached_filter_destroy(ppp->pass_filter);
-- ppp->pass_filter = NULL;
-- }
--
-- if (ppp->active_filter) {
-- sk_unattached_filter_destroy(ppp->active_filter);
-- ppp->active_filter = NULL;
-- }
-+ kfree(ppp->pass_filter);
-+ ppp->pass_filter = NULL;
-+ kfree(ppp->active_filter);
-+ ppp->active_filter = NULL;
- #endif /* CONFIG_PPP_FILTER */
+ switch (cmd) {
+ case SIOCGPPPSTATS:
+@@ -1042,8 +1041,7 @@ ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ break;
- kfree_skb(ppp->xmit_pending);
+ case SIOCGPPPVER:
+- vers = PPP_VERSION;
+- if (copy_to_user(addr, vers, strlen(vers) + 1))
++ if (copy_to_user(addr, PPP_VERSION, sizeof(PPP_VERSION)))
+ break;
+ err = 0;
+ break;
diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c
-index 1252d9c..80e660b 100644
+index 079f7ad..b2a2bfa7 100644
--- a/drivers/net/slip/slhc.c
+++ b/drivers/net/slip/slhc.c
-@@ -488,7 +488,7 @@ slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize)
+@@ -487,7 +487,7 @@ slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize)
register struct tcphdr *thp;
register struct iphdr *ip;
register struct cstate *cs;
/* 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 b4958c7..277cb96 100644
+index 1f76c2ea..9681171 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
-@@ -2868,7 +2868,7 @@ static int team_device_event(struct notifier_block *unused,
+@@ -2862,7 +2862,7 @@ static int team_device_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
.notifier_call = team_device_event,
};
-diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
-index a58dfeb..dbde341 100644
---- a/drivers/net/team/team_mode_loadbalance.c
-+++ b/drivers/net/team/team_mode_loadbalance.c
-@@ -49,7 +49,7 @@ struct lb_port_mapping {
- struct lb_priv_ex {
- struct team *team;
- struct lb_port_mapping tx_hash_to_port_mapping[LB_TX_HASHTABLE_SIZE];
-- struct sock_fprog_kern *orig_fprog;
-+ struct sock_fprog *orig_fprog;
- struct {
- unsigned int refresh_interval; /* in tenths of second */
- struct delayed_work refresh_dw;
-@@ -241,15 +241,15 @@ static int lb_bpf_func_get(struct team *team, struct team_gsetter_ctx *ctx)
- return 0;
- }
-
--static int __fprog_create(struct sock_fprog_kern **pfprog, u32 data_len,
-+static int __fprog_create(struct sock_fprog **pfprog, u32 data_len,
- const void *data)
- {
-- struct sock_fprog_kern *fprog;
-+ struct sock_fprog *fprog;
- struct sock_filter *filter = (struct sock_filter *) data;
-
- if (data_len % sizeof(struct sock_filter))
- return -EINVAL;
-- fprog = kmalloc(sizeof(*fprog), GFP_KERNEL);
-+ fprog = kmalloc(sizeof(struct sock_fprog), GFP_KERNEL);
- if (!fprog)
- return -ENOMEM;
- fprog->filter = kmemdup(filter, data_len, GFP_KERNEL);
-@@ -262,7 +262,7 @@ static int __fprog_create(struct sock_fprog_kern **pfprog, u32 data_len,
- return 0;
- }
-
--static void __fprog_destroy(struct sock_fprog_kern *fprog)
-+static void __fprog_destroy(struct sock_fprog *fprog)
- {
- kfree(fprog->filter);
- kfree(fprog);
-@@ -273,7 +273,7 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
- struct lb_priv *lb_priv = get_lb_priv(team);
- struct sk_filter *fp = NULL;
- struct sk_filter *orig_fp;
-- struct sock_fprog_kern *fprog = NULL;
-+ struct sock_fprog *fprog = NULL;
- int err;
-
- if (ctx->data.bin_val.len) {
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
-index 98bad1f..f197d7a 100644
+index acaaf67..a33483d 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
-@@ -1854,7 +1854,7 @@ unlock:
+@@ -1855,7 +1855,7 @@ unlock:
}
static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
{
struct tun_file *tfile = file->private_data;
struct tun_struct *tun;
-@@ -1867,6 +1867,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
+@@ -1868,6 +1868,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
unsigned int ifindex;
int ret;
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 a4272ed..cdd69ff 100644
+index babda7d..e40c90a 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -71,7 +71,7 @@
#define MOD_AUTHOR "Option Wireless"
#define MOD_DESCRIPTION "USB High Speed Option driver"
-@@ -1177,7 +1177,7 @@ static void put_rxbuf_data_and_resubmit_ctrl_urb(struct hso_serial *serial)
+@@ -1178,7 +1178,7 @@ static void put_rxbuf_data_and_resubmit_ctrl_urb(struct hso_serial *serial)
struct urb *urb;
urb = serial->rx_urb[0];
count = put_rxbuf_data(urb, serial);
if (count == -1)
return;
-@@ -1215,7 +1215,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
+@@ -1216,7 +1216,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
DUMP1(urb->transfer_buffer, urb->actual_length);
/* Anyone listening? */
return;
if (serial->parent->port_spec & HSO_INFO_CRC_BUG)
-@@ -1277,8 +1277,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
+@@ -1278,8 +1278,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
tty_port_tty_set(&serial->port, tty);
/* check for port already opened, if not set the termios */
serial->rx_state = RX_IDLE;
/* Force default termio settings */
_hso_serial_set_termios(tty, NULL);
-@@ -1288,7 +1287,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
+@@ -1289,7 +1288,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
result = hso_start_serial_device(serial->parent, GFP_KERNEL);
if (result) {
hso_stop_serial_device(serial->parent);
kref_put(&serial->parent->ref, hso_serial_ref_free);
}
} else {
-@@ -1325,10 +1324,10 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
+@@ -1326,10 +1325,10 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
/* reset the rts and dtr */
/* do the actual close */
tty_port_tty_set(&serial->port, NULL);
if (!usb_gone)
hso_stop_serial_device(serial->parent);
-@@ -1403,7 +1402,7 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
+@@ -1404,7 +1403,7 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
/* the actual setup */
spin_lock_irqsave(&serial->serial_lock, flags);
_hso_serial_set_termios(tty, old);
else
tty->termios = *old;
-@@ -1872,7 +1871,7 @@ static void intr_callback(struct urb *urb)
+@@ -1873,7 +1872,7 @@ static void intr_callback(struct urb *urb)
D1("Pending read interrupt on port %d\n", i);
spin_lock(&serial->serial_lock);
if (serial->rx_state == RX_IDLE &&
/* Setup and send a ctrl req read on
* port i */
if (!serial->rx_urb_filled[0]) {
-@@ -3045,7 +3044,7 @@ static int hso_resume(struct usb_interface *iface)
+@@ -3047,7 +3046,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)) {
hso_start_serial_device(serial_table[i], GFP_NOIO);
hso_kick_transmit(dev2ser(serial_table[i]));
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
-index 3eab74c..fb6097c 100644
+index 604ef21..d1f49a1 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -567,7 +567,7 @@ struct r8152 {
+@@ -575,7 +575,7 @@ struct r8152 {
void (*up)(struct r8152 *);
void (*down)(struct r8152 *);
void (*unload)(struct r8152 *);
/* we will have to manufacture ethernet headers, prepare template */
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
-index 7d9f84a..7f690da 100644
+index 59caa06..de191b3 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
-@@ -47,7 +47,7 @@ module_param(gso, bool, 0444);
+@@ -48,7 +48,7 @@ module_param(gso, bool, 0444);
#define RECEIVE_AVG_WEIGHT 64
/* Minimum alignment for mergeable packet buffers. */
#define VIRTNET_DRIVER_VERSION "1.0.0"
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
-index 9f79192..838cf95 100644
+index beb377b..b5bbf08 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
-@@ -2838,7 +2838,7 @@ nla_put_failure:
+@@ -1440,9 +1440,6 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb)
+ if (!in6_dev)
+ goto out;
+
+- if (!pskb_may_pull(skb, skb->len))
+- goto out;
+-
+ iphdr = ipv6_hdr(skb);
+ saddr = &iphdr->saddr;
+ daddr = &iphdr->daddr;
+@@ -1717,6 +1714,8 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan,
+ struct pcpu_sw_netstats *tx_stats, *rx_stats;
+ union vxlan_addr loopback;
+ union vxlan_addr *remote_ip = &dst_vxlan->default_dst.remote_ip;
++ struct net_device *dev = skb->dev;
++ int len = skb->len;
+
+ tx_stats = this_cpu_ptr(src_vxlan->dev->tstats);
+ rx_stats = this_cpu_ptr(dst_vxlan->dev->tstats);
+@@ -1740,16 +1739,16 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan,
+
+ u64_stats_update_begin(&tx_stats->syncp);
+ tx_stats->tx_packets++;
+- tx_stats->tx_bytes += skb->len;
++ tx_stats->tx_bytes += len;
+ u64_stats_update_end(&tx_stats->syncp);
+
+ if (netif_rx(skb) == NET_RX_SUCCESS) {
+ u64_stats_update_begin(&rx_stats->syncp);
+ rx_stats->rx_packets++;
+- rx_stats->rx_bytes += skb->len;
++ rx_stats->rx_bytes += len;
+ u64_stats_update_end(&rx_stats->syncp);
+ } else {
+- skb->dev->stats.rx_dropped++;
++ dev->stats.rx_dropped++;
+ }
+ }
+
+@@ -1927,7 +1926,8 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
+ return arp_reduce(dev, skb);
+ #if IS_ENABLED(CONFIG_IPV6)
+ else if (ntohs(eth->h_proto) == ETH_P_IPV6 &&
+- skb->len >= sizeof(struct ipv6hdr) + sizeof(struct nd_msg) &&
++ pskb_may_pull(skb, sizeof(struct ipv6hdr)
++ + sizeof(struct nd_msg)) &&
+ ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) {
+ struct nd_msg *msg;
+
+@@ -2750,7 +2750,7 @@ nla_put_failure:
return -EMSGSIZE;
}
.kind = "vxlan",
.maxtype = IFLA_VXLAN_MAX,
.policy = vxlan_policy,
-@@ -2885,7 +2885,7 @@ static int vxlan_lowerdev_event(struct notifier_block *unused,
+@@ -2797,7 +2797,7 @@ static int vxlan_lowerdev_event(struct notifier_block *unused,
return NOTIFY_DONE;
}
if (rd == NULL) {
result = -ENOMEM;
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
-index 64747d4..17c4cf3 100644
+index e71a2ce..2268d61 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -7846,7 +7846,7 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) {
/* Only super-user can write RIDs */
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
-index d48776e..373d049 100644
+index da92bfa..5a9001a 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)
return msecs_to_jiffies((s->poll_timeout[2] << 16)
| (s->poll_timeout[1] << 8)
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
-index e493db4..2c1853a 100644
+index 5fdc40d..3975205 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
-@@ -840,7 +840,10 @@ void ath10k_htc_stop(struct ath10k_htc *htc)
+@@ -856,7 +856,10 @@ void ath10k_htc_stop(struct ath10k_htc *htc)
/* registered target arrival callback from the HIF layer */
int ath10k_htc_init(struct ath10k *ar)
{
struct ath10k_htc_ep *ep = NULL;
struct ath10k_htc *htc = &ar->htc;
-@@ -850,8 +853,6 @@ int ath10k_htc_init(struct ath10k *ar)
+@@ -866,8 +869,6 @@ int ath10k_htc_init(struct ath10k *ar)
ath10k_htc_reset_endpoint_states(htc);
/* setup HIF layer callbacks */
/* service connection information */
struct ath10k_htc_svc_conn_req {
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_mac.c b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
-index 741b38d..b7ae41b 100644
+index 59af9f9..5f3564f 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
@@ -220,8 +220,8 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
- ACCESS_ONCE(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
+ ACCESS_ONCE_RW(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
| (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
- | SM(i->txpower, AR_XmitPower)
+ | SM(i->txpower, AR_XmitPower0)
| (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
-@@ -289,19 +289,19 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
+@@ -289,27 +289,27 @@ ar9002_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
| (i->flags & ATH9K_TXDESC_RTSENA ? AR_RTSEnable :
(i->flags & ATH9K_TXDESC_CTSENA ? AR_CTSEnable : 0));
| set11nRateFlags(i->rates, 1)
| set11nRateFlags(i->rates, 2)
| set11nRateFlags(i->rates, 3)
+ | SM(i->rtscts_rate, AR_RTSCTSRate);
+
+- ACCESS_ONCE(ads->ds_ctl9) = SM(i->txpower, AR_XmitPower1);
+- ACCESS_ONCE(ads->ds_ctl10) = SM(i->txpower, AR_XmitPower2);
+- ACCESS_ONCE(ads->ds_ctl11) = SM(i->txpower, AR_XmitPower3);
++ ACCESS_ONCE_RW(ads->ds_ctl9) = SM(i->txpower, AR_XmitPower1);
++ ACCESS_ONCE_RW(ads->ds_ctl10) = SM(i->txpower, AR_XmitPower2);
++ ACCESS_ONCE_RW(ads->ds_ctl11) = SM(i->txpower, AR_XmitPower3);
+ }
+
+ static int ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
-index 729ffbf..49f50e3 100644
+index 71e38e8..5ac96ca 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -39,47 +39,47 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
- ACCESS_ONCE(ads->ctl11) = (i->pkt_len & AR_FrameLen)
+ ACCESS_ONCE_RW(ads->ctl11) = (i->pkt_len & AR_FrameLen)
| (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
- | SM(i->txpower, AR_XmitPower)
+ | SM(i->txpower, AR_XmitPower0)
| (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
-@@ -135,22 +135,22 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
+@@ -135,26 +135,26 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i)
val = (i->flags & ATH9K_TXDESC_PAPRD) >> ATH9K_TXDESC_PAPRD_S;
ctl12 |= SM(val, AR_PAPRDChainMask);
- ACCESS_ONCE(ads->ctl19) = AR_Not_Sounding;
+ ACCESS_ONCE_RW(ads->ctl19) = AR_Not_Sounding;
+
+- ACCESS_ONCE(ads->ctl20) = SM(i->txpower, AR_XmitPower1);
+- ACCESS_ONCE(ads->ctl21) = SM(i->txpower, AR_XmitPower2);
+- ACCESS_ONCE(ads->ctl22) = SM(i->txpower, AR_XmitPower3);
++ ACCESS_ONCE_RW(ads->ctl20) = SM(i->txpower, AR_XmitPower1);
++ ACCESS_ONCE_RW(ads->ctl21) = SM(i->txpower, AR_XmitPower2);
++ ACCESS_ONCE_RW(ads->ctl22) = SM(i->txpower, AR_XmitPower3);
}
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 0acd4b5..0591c91 100644
+index 51b4ebe..d1929dd 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -629,7 +629,7 @@ struct ath_hw_private_ops {
struct ath_nf_limits {
s16 max;
+diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
+index 4b148bb..ac738fa 100644
+--- a/drivers/net/wireless/ath/ath9k/main.c
++++ b/drivers/net/wireless/ath/ath9k/main.c
+@@ -2592,16 +2592,18 @@ void ath9k_fill_chanctx_ops(void)
+ if (!ath9k_use_chanctx)
+ return;
+
+- ath9k_ops.hw_scan = ath9k_hw_scan;
+- ath9k_ops.cancel_hw_scan = ath9k_cancel_hw_scan;
+- ath9k_ops.remain_on_channel = ath9k_remain_on_channel;
+- ath9k_ops.cancel_remain_on_channel = ath9k_cancel_remain_on_channel;
+- ath9k_ops.add_chanctx = ath9k_add_chanctx;
+- ath9k_ops.remove_chanctx = ath9k_remove_chanctx;
+- ath9k_ops.change_chanctx = ath9k_change_chanctx;
+- ath9k_ops.assign_vif_chanctx = ath9k_assign_vif_chanctx;
+- ath9k_ops.unassign_vif_chanctx = ath9k_unassign_vif_chanctx;
+- ath9k_ops.mgd_prepare_tx = ath9k_chanctx_force_active;
++ pax_open_kernel();
++ *(void **)&ath9k_ops.hw_scan = ath9k_hw_scan;
++ *(void **)&ath9k_ops.cancel_hw_scan = ath9k_cancel_hw_scan;
++ *(void **)&ath9k_ops.remain_on_channel = ath9k_remain_on_channel;
++ *(void **)&ath9k_ops.cancel_remain_on_channel = ath9k_cancel_remain_on_channel;
++ *(void **)&ath9k_ops.add_chanctx = ath9k_add_chanctx;
++ *(void **)&ath9k_ops.remove_chanctx = ath9k_remove_chanctx;
++ *(void **)&ath9k_ops.change_chanctx = ath9k_change_chanctx;
++ *(void **)&ath9k_ops.assign_vif_chanctx = ath9k_assign_vif_chanctx;
++ *(void **)&ath9k_ops.unassign_vif_chanctx = ath9k_unassign_vif_chanctx;
++ *(void **)&ath9k_ops.mgd_prepare_tx = ath9k_chanctx_force_active;
++ pax_close_kernel();
+ }
+
+ struct ieee80211_ops ath9k_ops = {
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 92190da..f3a4c4c 100644
--- a/drivers/net/wireless/b43/phy_lp.c
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 788085b..0bc852a 100644
+index 06e04aa..d5e1f0d 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
-@@ -1598,7 +1598,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file,
+@@ -1684,7 +1684,7 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file,
struct isr_statistics *isr_stats = &trans_pcie->isr_stats;
char buf[8];
u32 reset_flag;
memset(buf, 0, sizeof(buf));
-@@ -1619,7 +1619,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file,
+@@ -1705,7 +1705,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file,
{
struct iwl_trans *trans = file->private_data;
char buf[8];
memset(buf, 0, sizeof(buf));
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
-index a312c65..162b13a 100644
+index 1326f61..9e56010f 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
-@@ -2573,20 +2573,20 @@ static int __init init_mac80211_hwsim(void)
+@@ -2575,20 +2575,20 @@ static int __init init_mac80211_hwsim(void)
if (channels < 1)
return -EINVAL;
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 5642ccc..01f03eb 100644
+index 8e68f87..c35ba29 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -250,9 +250,9 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,
wl1251_info("using SDIO interrupt");
}
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
-index d50dfac..0a6f5be3 100644
+index 0bccf12..3d95068 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)
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 de5b4fa..7996ec6 100644
+index 7af1936..128bb35 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
-@@ -1900,8 +1900,10 @@ static int wl18xx_setup(struct wl1271 *wl)
+@@ -1916,8 +1916,10 @@ static int wl18xx_setup(struct wl1271 *wl)
}
if (!checksum_param) {
mutex_lock(&pci_hp_mutex);
/*
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
-index a2297db..7c7d161 100644
+index 07aa722..84514b4 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -92,7 +92,7 @@ static int init_slot(struct controller *ctrl)
int retval = -ENOMEM;
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
-index 13f3d30..363cb44 100644
+index 5a40516..136d5a7 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
-@@ -523,8 +523,8 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
+@@ -507,8 +507,8 @@ static int populate_msi_sysfs(struct pci_dev *pdev)
{
struct attribute **msi_attrs;
struct attribute *msi_attr;
const struct attribute_group **msi_irq_groups;
struct msi_desc *entry;
int ret = -ENOMEM;
-@@ -584,7 +584,7 @@ error_attrs:
+@@ -568,7 +568,7 @@ error_attrs:
count = 0;
msi_attr = msi_attrs[count];
while (msi_attr) {
#define ASPM_STATE_ALL (ASPM_STATE_L0S | ASPM_STATE_L1)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
-index e3cf8a2..be1baf0 100644
+index 4170113..7cc5339 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -176,7 +176,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
&proc_bus_pci_dev_operations);
proc_initialized = 1;
diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
-index 7f1a2e2..bc4b405 100644
+index d866db8..c827d1f 100644
--- a/drivers/platform/chrome/chromeos_laptop.c
+++ b/drivers/platform/chrome/chromeos_laptop.c
-@@ -395,7 +395,7 @@ static struct chromeos_laptop cr48 = {
+@@ -479,7 +479,7 @@ static struct chromeos_laptop cr48 = {
.callback = chromeos_laptop_dmi_matched, \
.driver_data = (void *)&board_
.ident = "Samsung Series 5 550",
.matches = {
diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
-index 297b664..ab91e39 100644
+index c5af23b..3d62d5e 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
-@@ -133,7 +133,7 @@ struct wmax_led_args {
+@@ -150,7 +150,7 @@ struct wmax_led_args {
} __packed;
static struct platform_device *platform_device;
static struct attribute **zone_attrs;
static struct platform_zone *zone_data;
-@@ -144,7 +144,7 @@ static struct platform_driver platform_driver = {
+@@ -161,7 +161,7 @@ static struct platform_driver platform_driver = {
}
};
};
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
-index 3c6cced..12e0771 100644
+index 21fc932..ee9394a 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
-@@ -1592,6 +1592,10 @@ static int show_dsts(struct seq_file *m, void *data)
+@@ -1590,6 +1590,10 @@ static int show_dsts(struct seq_file *m, void *data)
int err;
u32 retval = -1;
err = asus_wmi_get_devstate(asus, asus->debug.dev_id, &retval);
if (err < 0)
-@@ -1608,6 +1612,10 @@ static int show_devs(struct seq_file *m, void *data)
+@@ -1606,6 +1610,10 @@ static int show_devs(struct seq_file *m, void *data)
int err;
u32 retval = -1;
err = asus_wmi_set_devstate(asus->debug.dev_id, asus->debug.ctrl_param,
&retval);
-@@ -1632,6 +1640,10 @@ static int show_call(struct seq_file *m, void *data)
+@@ -1630,6 +1638,10 @@ static int show_call(struct seq_file *m, void *data)
union acpi_object *obj;
acpi_status status;
acpi_status status;
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
-index 9c5a074..06c976a 100644
+index 26ad9ff..7c52909 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -2527,7 +2527,7 @@ static void sony_nc_gfx_switch_cleanup(struct platform_device *pd)
static ssize_t sony_nc_smart_conn_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 d82f196..5458f34 100644
+index 3bbc6eb..7760460 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2094,7 +2094,7 @@ static int hotkey_mask_get(void)
#endif /* CONFIG_SYSFS */
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
-index 5a5a24e..f7a3754 100644
+index 078afd6..fbac9da 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -28,7 +28,10 @@ EXPORT_SYMBOL_GPL(power_supply_class);
static bool __power_supply_is_supplied_by(struct power_supply *supplier,
struct power_supply *supply)
-@@ -639,7 +642,7 @@ static int __init power_supply_class_init(void)
+@@ -640,7 +643,7 @@ static int __init power_supply_class_init(void)
return PTR_ERR(power_supply_class);
power_supply_class->dev_uevent = power_supply_uevent;
return 0;
}
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
-index 44420d1..967126e 100644
+index 750a202..99c8f4b 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
-@@ -230,17 +230,15 @@ static struct attribute_group power_supply_attr_group = {
+@@ -234,17 +234,15 @@ static struct attribute_group power_supply_attr_group = {
.is_visible = power_supply_attr_is_visible,
};
power_zone->zone_dev_attrs[count++] =
&dev_attr_energy_uj.attr;
}
-diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
-index ee3de34..bec7285 100644
---- a/drivers/ptp/Kconfig
-+++ b/drivers/ptp/Kconfig
-@@ -8,7 +8,6 @@ config PTP_1588_CLOCK
- tristate "PTP clock support"
- depends on NET
- select PPS
-- select NET_PTP_CLASSIFY
- help
- The IEEE 1588 standard defines a method to precisely
- synchronize distributed clocks over Ethernet networks. The
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index 9c5d414..c7900ce 100644
--- a/drivers/ptp/ptp_private.h
da->attr.name = info->pin_config[i].name;
da->attr.mode = 0644;
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
-index 4c1f999..11078c9 100644
+index a3c3785..c901e3a 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
-@@ -3391,7 +3391,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
+@@ -3481,7 +3481,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
{
const struct regulation_constraints *constraints = NULL;
const struct regulator_init_data *init_data;
struct regulator_dev *rdev;
struct device *dev;
int ret, i;
-@@ -3461,7 +3461,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
+@@ -3551,7 +3551,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
rdev->dev.of_node = of_node_get(config->of_node);
rdev->dev.parent = dev;
dev_set_name(&rdev->dev, "regulator.%d",
void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
-index a3ab5cc..8143622 100644
+index 0f19455..ef7adb5 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -38,10 +38,21 @@ struct bfa_fcs_mod_s {
/*
* fcs_port_sm FCS logical port state machine
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
-index 2e28392..9d865b6 100644
+index a38aafa0..fe8f03b 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -258,7 +258,7 @@ struct bfa_ioc_cbfn_s {
error = bus_register(&fcoe_bus_type);
if (error)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
-index 3cbb57a..95e47a3 100644
+index 6de80e3..a11e0ac 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -42,7 +42,7 @@
static void scsi_host_cls_release(struct device *dev)
-@@ -369,7 +369,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
+@@ -392,7 +392,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
* subtract one because we increment first then return, but we need to
* know what the next host number was before increment
*/
/* These three are default values which can be overridden */
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
-index 489e83b..193815b 100644
+index 6b35d0d..2880305 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -701,10 +701,10 @@ static inline u32 next_command(struct ctlr_info *h, u8 q)
if ((rq->head[rq->current_entry] & 1) == rq->wraparound) {
a = rq->head[rq->current_entry];
-@@ -5455,7 +5455,7 @@ static void start_io(struct ctlr_info *h, unsigned long *flags)
+@@ -5454,7 +5454,7 @@ static void start_io(struct ctlr_info *h, unsigned long *flags)
while (!list_empty(&h->reqQ)) {
c = list_entry(h->reqQ.next, struct CommandList, list);
/* can't do anything if fifo is full */
h->fifo_recently_full = 1;
dev_warn(&h->pdev->dev, "fifo full\n");
break;
-@@ -5477,7 +5477,7 @@ static void start_io(struct ctlr_info *h, unsigned long *flags)
+@@ -5476,7 +5476,7 @@ static void start_io(struct ctlr_info *h, unsigned long *flags)
/* Tell the controller execute command */
spin_unlock_irqrestore(&h->lock, *flags);
spin_lock_irqsave(&h->lock, *flags);
}
}
-@@ -5493,17 +5493,17 @@ static void lock_and_start_io(struct ctlr_info *h)
+@@ -5492,17 +5492,17 @@ static void lock_and_start_io(struct ctlr_info *h)
static inline unsigned long get_next_completion(struct ctlr_info *h, u8 q)
{
(h->interrupts_enabled == 0);
}
-@@ -6459,7 +6459,7 @@ static int hpsa_pci_init(struct ctlr_info *h)
+@@ -6458,7 +6458,7 @@ static int hpsa_pci_init(struct ctlr_info *h)
if (prod_index < 0)
return -ENODEV;
h->product_name = products[prod_index].product_name;
pci_disable_link_state(h->pdev, PCIE_LINK_STATE_L0S |
PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM);
-@@ -6781,7 +6781,7 @@ static void controller_lockup_detected(struct ctlr_info *h)
+@@ -6780,7 +6780,7 @@ static void controller_lockup_detected(struct ctlr_info *h)
unsigned long flags;
u32 lockup_detected;
spin_lock_irqsave(&h->lock, flags);
lockup_detected = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
if (!lockup_detected) {
-@@ -7022,7 +7022,7 @@ reinit_after_soft_reset:
+@@ -7027,7 +7027,7 @@ reinit_after_soft_reset:
}
/* make sure the board interrupts are off */
if (hpsa_request_irq(h, do_hpsa_intr_msi, do_hpsa_intr_intx))
goto clean2;
-@@ -7057,7 +7057,7 @@ reinit_after_soft_reset:
+@@ -7062,7 +7062,7 @@ reinit_after_soft_reset:
* fake ones to scoop up any residual completions.
*/
spin_lock_irqsave(&h->lock, flags);
spin_unlock_irqrestore(&h->lock, flags);
free_irqs(h);
rc = hpsa_request_irq(h, hpsa_msix_discard_completions,
-@@ -7076,9 +7076,9 @@ reinit_after_soft_reset:
+@@ -7081,9 +7081,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");
rc = controller_reset_failed(h->cfgtable);
if (rc)
-@@ -7104,7 +7104,7 @@ reinit_after_soft_reset:
+@@ -7109,7 +7109,7 @@ reinit_after_soft_reset:
h->drv_req_rescan = 0;
/* Turn the interrupts on so we can service requests */
hpsa_hba_inquiry(h);
hpsa_register_scsi(h); /* hook ourselves into SCSI subsystem */
-@@ -7169,7 +7169,7 @@ static void hpsa_shutdown(struct pci_dev *pdev)
+@@ -7174,7 +7174,7 @@ static void hpsa_shutdown(struct pci_dev *pdev)
* To write all data in the battery backed cache to disks
*/
hpsa_flush_cache(h);
hpsa_free_irqs_and_disable_msix(h);
}
-@@ -7287,7 +7287,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
+@@ -7292,7 +7292,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
CFGTBL_Trans_enable_directed_msix |
(trans_support & (CFGTBL_Trans_io_accel1 |
CFGTBL_Trans_io_accel2));
/* This is a bit complicated. There are 8 registers on
* the controller which we write to to tell it 8 different
-@@ -7329,7 +7329,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
+@@ -7334,7 +7334,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
* perform the superfluous readl() after each command submission.
*/
if (trans_support & (CFGTBL_Trans_io_accel1 | CFGTBL_Trans_io_accel2))
/* Controller spec: zero out this buffer. */
for (i = 0; i < h->nreply_queues; i++)
-@@ -7359,12 +7359,12 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
+@@ -7364,12 +7364,12 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
* enable outbound interrupt coalescing in accelerator mode;
*/
if (trans_support & CFGTBL_Trans_io_accel1) {
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 06f9a5b..82812092 100644
+index a5769a9..718ecc7 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
-@@ -11296,8 +11296,10 @@ lpfc_init(void)
+@@ -11299,8 +11299,10 @@ lpfc_init(void)
"misc_register returned with status %d", error);
if (lpfc_enable_npiv) {
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 2df11da..e660a2c 100644
+index 7862c55..5aa65df 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -382,7 +382,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
/**
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
-index 5055f92..376cd98 100644
+index dd46101..ca80eb9 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
-@@ -1557,7 +1557,7 @@ _scsih_get_resync(struct device *dev)
+@@ -1559,7 +1559,7 @@ _scsih_get_resync(struct device *dev)
{
struct scsi_device *sdev = to_scsi_device(dev);
struct MPT2SAS_ADAPTER *ioc = shost_priv(sdev->host);
unsigned long flags;
Mpi2RaidVolPage0_t vol_pg0;
Mpi2ConfigReply_t mpi_reply;
-@@ -1609,7 +1609,7 @@ _scsih_get_state(struct device *dev)
+@@ -1611,7 +1611,7 @@ _scsih_get_state(struct device *dev)
{
struct scsi_device *sdev = to_scsi_device(dev);
struct MPT2SAS_ADAPTER *ioc = shost_priv(sdev->host);
unsigned long flags;
Mpi2RaidVolPage0_t vol_pg0;
Mpi2ConfigReply_t mpi_reply;
-@@ -6631,7 +6631,7 @@ _scsih_sas_ir_operation_status_event(struct MPT2SAS_ADAPTER *ioc,
- struct fw_event_work *fw_event)
- {
- Mpi2EventDataIrOperationStatus_t *event_data = fw_event->event_data;
+@@ -6648,7 +6648,7 @@ _scsih_sas_ir_operation_status_event(struct MPT2SAS_ADAPTER *ioc,
+ Mpi2EventDataIrOperationStatus_t *event_data =
+ (Mpi2EventDataIrOperationStatus_t *)
+ fw_event->event_data;
- static struct _raid_device *raid_device;
+ struct _raid_device *raid_device;
unsigned long flags;
u16 handle;
-@@ -7102,7 +7102,7 @@ _scsih_scan_for_devices_after_reset(struct MPT2SAS_ADAPTER *ioc)
+@@ -7119,7 +7119,7 @@ _scsih_scan_for_devices_after_reset(struct MPT2SAS_ADAPTER *ioc)
u64 sas_address;
struct _sas_device *sas_device;
struct _sas_node *expander_device;
unsigned long flags;
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
-index be8ce54..94ed33a 100644
+index 6f3275d..fa5e6b6 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)
.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 d48dea8..0845f78 100644
+index d646540..5b13554 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -569,8 +569,8 @@ extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *);
extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *, bool);
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 d96bfb5..d7afe90 100644
+index be9698d..a328a41 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
-@@ -1490,8 +1490,10 @@ qla2x00_config_dma_addressing(struct qla_hw_data *ha)
+@@ -1493,8 +1493,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;
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 3202063..f9f0ff6 100644
+index 199fcf7..3c3a918 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
-@@ -4494,12 +4494,12 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess)
+@@ -4496,12 +4496,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 */
ddb_entry->default_time2wait + 4));
set_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags);
atomic_set(&ddb_entry->retry_relogin_timer,
-@@ -6607,7 +6607,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
+@@ -6609,7 +6609,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);
ddb_entry->default_relogin_timeout =
(def_timeout > LOGIN_TOV) && (def_timeout < LOGIN_TOV * 10) ?
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
-index 88d46fe..7351be5 100644
+index d81f3cc..0093e5b 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
-@@ -640,7 +640,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
+@@ -645,7 +645,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
struct Scsi_Host *host = cmd->device->host;
int rtn = 0;
/* 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 3f50dfc..86af487 100644
+index aaea4b9..c64408d 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
-@@ -1423,7 +1423,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
+@@ -1581,7 +1581,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;
/*
* SCSI request completion path will do scsi_device_unbusy(),
-@@ -1449,9 +1449,9 @@ static void scsi_softirq_done(struct request *rq)
+@@ -1604,9 +1604,9 @@ static void scsi_softirq_done(struct request *rq)
INIT_LIST_HEAD(&cmd->eh_entry);
disposition = scsi_decide_disposition(cmd);
if (disposition != SUCCESS &&
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
-index 074e8cc..f612e5c 100644
+index 8b4105a..1f58363 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
-@@ -780,7 +780,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \
+@@ -805,7 +805,7 @@ show_iostat_##field(struct device *dev, struct device_attribute *attr, \
char *buf) \
{ \
struct scsi_device *sdev = to_scsi_device(dev); \
return snprintf(buf, 20, "0x%llx\n", count); \
} \
static DEVICE_ATTR(field, S_IRUGO, show_iostat_##field, NULL)
-diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
-index e51add0..1e06a96 100644
---- a/drivers/scsi/scsi_tgt_lib.c
-+++ b/drivers/scsi/scsi_tgt_lib.c
-@@ -363,7 +363,7 @@ static int scsi_map_user_pages(struct scsi_tgt_cmd *tcmd, struct scsi_cmnd *cmd,
- int err;
-
- dprintk("%lx %u\n", uaddr, len);
-- err = blk_rq_map_user(q, rq, NULL, (void *)uaddr, len, GFP_KERNEL);
-+ err = blk_rq_map_user(q, rq, NULL, (void __user *)uaddr, len, GFP_KERNEL);
- if (err) {
- /*
- * 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 521f583..6b15966 100644
+index 5d6f348..18778a6b 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,
+@@ -501,7 +501,7 @@ static DECLARE_TRANSPORT_CLASS(fc_vport_class,
* Netlink Infrastructure
*/
/**
* fc_get_event_number - Obtain the next sequential FC event number
-@@ -511,7 +511,7 @@ static atomic_t fc_event_seq;
+@@ -514,7 +514,7 @@ static atomic_t fc_event_seq;
u32
fc_get_event_number(void)
{
}
EXPORT_SYMBOL(fc_get_event_number);
-@@ -655,7 +655,7 @@ static __init int fc_transport_init(void)
+@@ -658,7 +658,7 @@ static __init int fc_transport_init(void)
{
int error;
error = transport_class_register(&fc_host_class);
if (error)
-@@ -845,7 +845,7 @@ static int fc_str_to_dev_loss(const char *buf, unsigned long *val)
+@@ -848,7 +848,7 @@ static int fc_str_to_dev_loss(const char *buf, unsigned long *val)
char *cp;
*val = simple_strtoul(buf, &cp, 0);
/*
* 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 0102a2d..cc3f8e9 100644
+index 67d43e3..8cee73c 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -79,7 +79,7 @@ struct iscsi_internal {
if (target_id == ISCSI_MAX_TARGET) {
id = ida_simple_get(&iscsi_sess_ida, 0, 0, GFP_KERNEL);
-@@ -4511,7 +4511,7 @@ static __init int iscsi_transport_init(void)
+@@ -4515,7 +4515,7 @@ static __init int iscsi_transport_init(void)
printk(KERN_INFO "Loading iSCSI transport class v%s.\n",
ISCSI_TRANSPORT_VERSION);
err = class_register(&iscsi_transport_class);
if (err)
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
-index 13e8983..d306a68 100644
+index ae45bd9..c32a586 100644
--- a/drivers/scsi/scsi_transport_srp.c
+++ b/drivers/scsi/scsi_transport_srp.c
-@@ -36,7 +36,7 @@
- #include "scsi_transport_srp_internal.h"
+@@ -35,7 +35,7 @@
+ #include "scsi_priv.h"
struct srp_host_attrs {
- atomic_t next_port_id;
};
#define to_srp_host_attrs(host) ((struct srp_host_attrs *)(host)->shost_data)
-@@ -101,7 +101,7 @@ static int srp_host_setup(struct transport_container *tc, struct device *dev,
+@@ -100,7 +100,7 @@ static int srp_host_setup(struct transport_container *tc, struct device *dev,
struct Scsi_Host *shost = dev_to_shost(dev);
struct srp_host_attrs *srp_host = to_srp_host_attrs(shost);
transport_setup_device(&rport->dev);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
-index 6825eda..be470c4 100644
+index 2c2041c..9d94085 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
-@@ -2954,7 +2954,7 @@ static int sd_probe(struct device *dev)
+@@ -3002,7 +3002,7 @@ static int sd_probe(struct device *dev)
sdkp->disk = gd;
sdkp->index = index;
atomic_set(&sdkp->openers, 0);
if (!sdp->request_queue->rq_timeout) {
if (sdp->type != TYPE_MOD)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
-index 53268aab..17c2764 100644
+index 01cf888..59e0475 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
-@@ -1102,7 +1102,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
+@@ -1138,7 +1138,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
sdp->disk->disk_name,
MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
NULL,
return blk_trace_startstop(sdp->device->request_queue, 1);
case BLKTRACESTOP:
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
-index d4f9670..d37b662 100644
+index ca935df..ae8a3dc 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
-@@ -2204,7 +2204,7 @@ int spi_bus_unlock(struct spi_master *master)
+@@ -2210,7 +2210,7 @@ int spi_bus_unlock(struct spi_master *master)
EXPORT_SYMBOL_GPL(spi_bus_unlock);
/* portable code must never pass more than 32 bytes */
static u8 *buf;
diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c
-index c341ac1..bf9799f 100644
+index b41429f..2de5373 100644
--- a/drivers/staging/android/timed_output.c
+++ b/drivers/staging/android/timed_output.c
@@ -25,7 +25,7 @@
static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
char *buf)
-@@ -63,7 +63,7 @@ static int create_timed_output_class(void)
+@@ -65,7 +65,7 @@ static int create_timed_output_class(void)
timed_output_class = class_create(THIS_MODULE, "timed_output");
if (IS_ERR(timed_output_class))
return PTR_ERR(timed_output_class);
timed_output_class->dev_groups = timed_output_groups;
}
-@@ -81,7 +81,7 @@ int timed_output_dev_register(struct timed_output_dev *tdev)
+@@ -83,7 +83,7 @@ int timed_output_dev_register(struct timed_output_dev *tdev)
if (ret < 0)
return ret;
MKDEV(0, tdev->index), NULL, "%s", tdev->name);
if (IS_ERR(tdev->dev))
diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
-index fe47cd3..19a1bd1 100644
+index 001348c..cfaac8a 100644
--- a/drivers/staging/gdm724x/gdm_tty.c
+++ b/drivers/staging/gdm724x/gdm_tty.c
@@ -44,7 +44,7 @@
static struct tty_driver *gdm_driver[TTY_MAX_COUNT];
static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR];
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
-index def8280..e3fd96a 100644
+index 6b22106..6c6e641 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -355,7 +355,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
imx_drm_crtc = kzalloc(sizeof(*imx_drm_crtc), GFP_KERNEL);
diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
-index 3f8020c..649fded 100644
+index bcce919..f30fcf9 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -488,13 +488,11 @@ brw_server_handle(struct srpc_server_rpc *rpc)
srpc_service_t brw_test_service;
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
-index 050723a..fa6fdf1 100644
+index 7e83dff..1f9a545 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
-@@ -1635,12 +1635,10 @@ static srpc_service_t sfw_services[] =
+@@ -1633,12 +1633,10 @@ static srpc_service_t sfw_services[] =
extern sfw_test_client_ops_t ping_test_client;
extern srpc_service_t ping_test_service;
extern void brw_init_test_service(void);
-@@ -1684,12 +1682,10 @@ sfw_startup (void)
+@@ -1682,12 +1680,10 @@ sfw_startup (void)
INIT_LIST_HEAD(&sfw_data.fw_zombie_rpcs);
INIT_LIST_HEAD(&sfw_data.fw_zombie_sessions);
srpc_service_t ping_test_service;
void ping_init_test_service(void)
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h
-index 0c6b784..c64235c 100644
+index 30b1812f..9e5bd0b 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -1141,7 +1141,7 @@ struct ldlm_callback_suite {
/* ldlm_lockd.c */
int ldlm_del_waiting_lock(struct ldlm_lock *lock);
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
-index d5c4613..a341678 100644
+index 489bdd3..65058081 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
-@@ -1439,7 +1439,7 @@ struct md_ops {
+@@ -1438,7 +1438,7 @@ struct md_ops {
* lprocfs_alloc_md_stats() in obdclass/lprocfs_status.c. Also, add a
* wrapper function in include/linux/obd_class.h.
*/
struct lsm_operations {
void (*lsm_free)(struct lov_stripe_md *);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
-index 986bf38..eab2558f 100644
+index b798daa..b28ca8f 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
-@@ -259,7 +259,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
+@@ -258,7 +258,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
int added = (mode == LCK_NL);
int overlaps = 0;
int splitted = 0;
- const struct ldlm_callback_suite null_cbs = { NULL };
+ const struct ldlm_callback_suite null_cbs = { };
- CDEBUG(D_DLMTRACE, "flags %#llx owner "LPU64" pid %u mode %u start "
- LPU64" end "LPU64"\n", *flags,
+ CDEBUG(D_DLMTRACE, "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
+ *flags, new->l_policy_data.l_flock.owner,
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
-index e947b91..f408990 100644
+index 13a9266..3439390 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
-@@ -217,7 +217,7 @@ DECLARE_PROC_HANDLER(proc_debug_mb)
- int LL_PROC_PROTO(proc_console_max_delay_cs)
+@@ -235,7 +235,7 @@ int proc_console_max_delay_cs(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc, max_delay_cs;
-- ctl_table_t dummy = *table;
+- struct ctl_table dummy = *table;
+ ctl_table_no_const dummy = *table;
- cfs_duration_t d;
+ long d;
dummy.data = &max_delay_cs;
-@@ -248,7 +248,7 @@ int LL_PROC_PROTO(proc_console_max_delay_cs)
- int LL_PROC_PROTO(proc_console_min_delay_cs)
+@@ -267,7 +267,7 @@ int proc_console_min_delay_cs(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc, min_delay_cs;
-- ctl_table_t dummy = *table;
+- struct ctl_table dummy = *table;
+ ctl_table_no_const dummy = *table;
- cfs_duration_t d;
+ long d;
dummy.data = &min_delay_cs;
-@@ -279,7 +279,7 @@ int LL_PROC_PROTO(proc_console_min_delay_cs)
- int LL_PROC_PROTO(proc_console_backoff)
+@@ -299,7 +299,7 @@ int proc_console_backoff(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc, backoff;
-- ctl_table_t dummy = *table;
+- struct ctl_table dummy = *table;
+ ctl_table_no_const dummy = *table;
dummy.data = &backoff;
dummy.proc_handler = &proc_dointvec;
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
-index b16ee08..a3db5c6 100644
+index 3396858..c0bd996 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -314,11 +314,11 @@ out:
extern int insert_proc(void);
diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
-index ae6f61a..03c3d5d 100644
+index efa2faf..03a9836 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
-@@ -660,7 +660,7 @@ int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump,
+@@ -659,7 +659,7 @@ int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump,
int mode;
int err;
op_data = ll_prep_md_op_data(NULL, dir, NULL, filename,
strlen(filename), mode, LUSTRE_OPC_MKDIR,
lump);
-diff --git a/drivers/staging/media/solo6x10/solo6x10-core.c b/drivers/staging/media/solo6x10/solo6x10-core.c
-index f670469..03b7438 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 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/media/solo6x10/solo6x10-g723.c b/drivers/staging/media/solo6x10/solo6x10-g723.c
-index 74f037b..5b5bb76 100644
---- a/drivers/staging/media/solo6x10/solo6x10-g723.c
-+++ b/drivers/staging/media/solo6x10/solo6x10-g723.c
-@@ -355,7 +355,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
-
- int solo_g723_init(struct solo_dev *solo_dev)
- {
-- static struct snd_device_ops ops = { NULL };
-+ static struct snd_device_ops ops = { };
- struct snd_card *card;
- struct snd_kcontrol_new kctl;
- char name[32];
-diff --git a/drivers/staging/media/solo6x10/solo6x10-p2m.c b/drivers/staging/media/solo6x10/solo6x10-p2m.c
-index 7f2f247..d999137 100644
---- a/drivers/staging/media/solo6x10/solo6x10-p2m.c
-+++ b/drivers/staging/media/solo6x10/solo6x10-p2m.c
-@@ -77,7 +77,7 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev,
-
- /* Get next ID. According to Softlogic, 6110 has problems on !=0 P2M */
- if (solo_dev->type != SOLO_DEV_6110 && multi_p2m) {
-- p2m_id = atomic_inc_return(&solo_dev->p2m_count) % SOLO_NR_P2M;
-+ p2m_id = atomic_inc_return_unchecked(&solo_dev->p2m_count) % SOLO_NR_P2M;
- if (p2m_id < 0)
- p2m_id = -p2m_id;
- }
-diff --git a/drivers/staging/media/solo6x10/solo6x10.h b/drivers/staging/media/solo6x10/solo6x10.h
-index 8964f8b..36eb087 100644
---- a/drivers/staging/media/solo6x10/solo6x10.h
-+++ b/drivers/staging/media/solo6x10/solo6x10.h
-@@ -237,7 +237,7 @@ struct solo_dev {
-
- /* P2M DMA Engine */
- struct solo_p2m_dev p2m_dev[SOLO_NR_P2M];
-- atomic_t p2m_count;
-+ atomic_unchecked_t p2m_count;
- int p2m_jiffies;
- unsigned int p2m_timeouts;
-
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index a0f4868..139f1fb 100644
--- a/drivers/staging/octeon/ethernet-rx.c
dev_kfree_skb_irq(skb);
}
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
-index da9dd6b..8e3e0f5 100644
+index 2aa7235..ba3c205 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -247,11 +247,11 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
}
diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h b/drivers/staging/rtl8188eu/include/hal_intf.h
-index c59fccd..79f8fc2 100644
+index 56d5c50..a14f4db 100644
--- a/drivers/staging/rtl8188eu/include/hal_intf.h
+++ b/drivers/staging/rtl8188eu/include/hal_intf.h
-@@ -267,7 +267,7 @@ struct hal_ops {
- s32 (*c2h_handler)(struct adapter *padapter,
- struct c2h_evt_hdr *c2h_evt);
- c2h_id_filter c2h_id_filter_ccx;
+@@ -234,7 +234,7 @@ struct hal_ops {
+
+ void (*hal_notch_filter)(struct adapter *adapter, bool enable);
+ void (*hal_reset_security_engine)(struct adapter *adapter);
-};
+} __no_const;
enum rt_eeprom_type {
EEPROM_93C46,
-diff --git a/drivers/staging/rtl8188eu/include/rtw_io.h b/drivers/staging/rtl8188eu/include/rtw_io.h
-index e8790f8..b4a5980 100644
---- a/drivers/staging/rtl8188eu/include/rtw_io.h
-+++ b/drivers/staging/rtl8188eu/include/rtw_io.h
-@@ -124,7 +124,7 @@ struct _io_ops {
- u32 (*_write_scsi)(struct intf_hdl *pintfhdl, u32 cnt, u8 *pmem);
- void (*_read_port_cancel)(struct intf_hdl *pintfhdl);
- void (*_write_port_cancel)(struct intf_hdl *pintfhdl);
--};
-+} __no_const;
-
- struct io_req {
- struct list_head list;
diff --git a/drivers/staging/rtl8712/rtl871x_io.h b/drivers/staging/rtl8712/rtl871x_io.h
index dc23395..cf7e9b1 100644
--- a/drivers/staging/rtl8712/rtl871x_io.h
struct io_req {
struct list_head list;
-diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h
-index a863a98..d272795 100644
---- a/drivers/staging/usbip/vhci.h
-+++ b/drivers/staging/usbip/vhci.h
-@@ -83,7 +83,7 @@ struct vhci_hcd {
- unsigned resuming:1;
- unsigned long re_timeout;
-
-- atomic_t seqnum;
-+ atomic_unchecked_t seqnum;
-
- /*
- * NOTE:
-diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
-index 0007d30..c06a693 100644
---- a/drivers/staging/usbip/vhci_hcd.c
-+++ b/drivers/staging/usbip/vhci_hcd.c
-@@ -439,7 +439,7 @@ static void vhci_tx_urb(struct urb *urb)
-
- spin_lock(&vdev->priv_lock);
-
-- priv->seqnum = atomic_inc_return(&the_controller->seqnum);
-+ priv->seqnum = atomic_inc_return_unchecked(&the_controller->seqnum);
- if (priv->seqnum == 0xffff)
- dev_info(&urb->dev->dev, "seqnum max\n");
-
-@@ -686,7 +686,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
- return -ENOMEM;
- }
-
-- unlink->seqnum = atomic_inc_return(&the_controller->seqnum);
-+ unlink->seqnum = atomic_inc_return_unchecked(&the_controller->seqnum);
- if (unlink->seqnum == 0xffff)
- pr_info("seqnum max\n");
-
-@@ -891,7 +891,7 @@ static int vhci_start(struct usb_hcd *hcd)
- vdev->rhport = rhport;
- }
-
-- atomic_set(&vhci->seqnum, 0);
-+ atomic_set_unchecked(&vhci->seqnum, 0);
- spin_lock_init(&vhci->lock);
-
- hcd->power_budget = 0; /* no limit */
-diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c
-index d07fcb5..358e1e1 100644
---- a/drivers/staging/usbip/vhci_rx.c
-+++ b/drivers/staging/usbip/vhci_rx.c
-@@ -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",
-- atomic_read(&the_controller->seqnum));
-+ atomic_read_unchecked(&the_controller->seqnum));
- usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
- return;
- }
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
-index 317c2a8..ffeb4ef 100644
+index 164136b..7244df5 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
@@ -68,14 +68,13 @@ static int msglevel = MSG_LEVEL_INFO;
tz->get_temp = NULL;
tz->get_trend = NULL;
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
-index a57bb5a..1f727d33 100644
+index fd66f57..48e6376 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -1570,10 +1570,10 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
pr_devel("HVSI@%x: Handshaking started\n", pv->termno);
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
-index 17ee3bf..8d2520d 100644
+index 345cebb..d5a1e9e 100644
--- a/drivers/tty/ipwireless/tty.c
+++ b/drivers/tty/ipwireless/tty.c
@@ -28,6 +28,7 @@
#include "tty.h"
#include "network.h"
-@@ -98,10 +99,10 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)
- mutex_unlock(&tty->ipw_tty_mutex);
+@@ -93,10 +94,10 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)
return -ENODEV;
- }
+
+ mutex_lock(&tty->ipw_tty_mutex);
- if (tty->port.count == 0)
+ if (atomic_read(&tty->port.count) == 0)
tty->tx_bytes_queued = 0;
tty->port.tty = linux_tty;
linux_tty->driver_data = tty;
-@@ -117,9 +118,7 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)
+@@ -112,9 +113,7 @@ static int ipw_open(struct tty_struct *linux_tty, struct file *filp)
static void do_ipw_close(struct ipw_tty *tty)
{
struct tty_struct *linux_tty = tty->port.tty;
if (linux_tty != NULL) {
-@@ -140,7 +139,7 @@ static void ipw_hangup(struct tty_struct *linux_tty)
+@@ -135,7 +134,7 @@ static void ipw_hangup(struct tty_struct *linux_tty)
return;
mutex_lock(&tty->ipw_tty_mutex);
mutex_unlock(&tty->ipw_tty_mutex);
return;
}
-@@ -163,7 +162,7 @@ void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data,
+@@ -158,7 +157,7 @@ void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data,
mutex_lock(&tty->ipw_tty_mutex);
mutex_unlock(&tty->ipw_tty_mutex);
return;
}
-@@ -202,7 +201,7 @@ static int ipw_write(struct tty_struct *linux_tty,
+@@ -197,7 +196,7 @@ static int ipw_write(struct tty_struct *linux_tty,
return -ENODEV;
mutex_lock(&tty->ipw_tty_mutex);
mutex_unlock(&tty->ipw_tty_mutex);
return -EINVAL;
}
-@@ -242,7 +241,7 @@ static int ipw_write_room(struct tty_struct *linux_tty)
+@@ -237,7 +236,7 @@ static int ipw_write_room(struct tty_struct *linux_tty)
if (!tty)
return -ENODEV;
return -EINVAL;
room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued;
-@@ -284,7 +283,7 @@ static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
+@@ -279,7 +278,7 @@ static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
if (!tty)
return 0;
return 0;
return tty->tx_bytes_queued;
-@@ -365,7 +364,7 @@ static int ipw_tiocmget(struct tty_struct *linux_tty)
+@@ -360,7 +359,7 @@ static int ipw_tiocmget(struct tty_struct *linux_tty)
if (!tty)
return -ENODEV;
return -EINVAL;
return get_control_lines(tty);
-@@ -381,7 +380,7 @@ ipw_tiocmset(struct tty_struct *linux_tty,
+@@ -376,7 +375,7 @@ ipw_tiocmset(struct tty_struct *linux_tty,
if (!tty)
return -ENODEV;
return -EINVAL;
return set_control_lines(tty, set, clear);
-@@ -395,7 +394,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty,
+@@ -390,7 +389,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty,
if (!tty)
return -ENODEV;
return -EINVAL;
/* FIXME: Exactly how is the tty object locked here .. */
-@@ -551,7 +550,7 @@ void ipwireless_tty_free(struct ipw_tty *tty)
+@@ -546,7 +545,7 @@ void ipwireless_tty_free(struct ipw_tty *tty)
* are gone */
mutex_lock(&ttyj->ipw_tty_mutex);
}
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 2ebe47b..3205833 100644
+index c434376..114ce13 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -1644,7 +1644,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr)
kfree(dlci);
return NULL;
}
-@@ -2954,7 +2954,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
+@@ -2958,7 +2958,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;
}
EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
-index 25c9bc7..24077b7 100644
+index 9bbdb1d..dc514ee 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
-@@ -790,8 +790,10 @@ static void __init unix98_pty_init(void)
+@@ -789,8 +789,10 @@ static void __init unix98_pty_init(void)
panic("Couldn't register Unix98 pts driver");
/* Now create the /dev/ptmx special device */
clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
spin_unlock_irqrestore(&info->port.lock, flags);
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
-index 1274499..f541382 100644
+index aa28209..e08fb85 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -437,7 +437,7 @@ struct ioc4_soft {
this_mir = this_ir = pending_intrs(soft, intr_type);
diff --git a/drivers/tty/serial/kgdb_nmi.c b/drivers/tty/serial/kgdb_nmi.c
-index cfadf29..8cf4595 100644
+index 6ec7501..265bcbf 100644
--- a/drivers/tty/serial/kgdb_nmi.c
+++ b/drivers/tty/serial/kgdb_nmi.c
@@ -51,7 +51,9 @@ static int kgdb_nmi_console_setup(struct console *co, char *options)
/* 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/msm_serial.c b/drivers/tty/serial/msm_serial.c
-index 72000a6..a190bc4 100644
+index 0da0b54..80ae306 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
-@@ -981,7 +981,7 @@ static struct uart_driver msm_uart_driver = {
+@@ -989,7 +989,7 @@ static struct uart_driver msm_uart_driver = {
.cons = MSM_CONSOLE,
};
static const struct of_device_id msm_uartdm_table[] = {
{ .compatible = "qcom,msm-uartdm-v1.1", .data = (void *)UARTDM_1P1 },
-@@ -1000,7 +1000,7 @@ static int msm_serial_probe(struct platform_device *pdev)
+@@ -1008,7 +1008,7 @@ static int msm_serial_probe(struct platform_device *pdev)
int irq;
if (pdev->id == -1)
if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
return -ENXIO;
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
-index c1d3ebd..f618a93 100644
+index c78f43a..22b1dab 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
-@@ -486,11 +486,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
+@@ -478,11 +478,16 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
}
}
dbg("s3c24xx_serial_startup: port=%p (%08llx,%p)\n",
port, (unsigned long long)port->mapbase, port->membase);
-@@ -1164,10 +1169,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
+@@ -1155,10 +1160,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
/* setup info for port */
port->dev = &platdev->dev;
if (cfg->uart_flags & UPF_CONS_FLOW) {
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
-index ef2fb36..238d80c 100644
+index 29a7be4..0144e62 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
-@@ -1336,7 +1336,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
+@@ -1343,7 +1343,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
pr_debug("uart_close(%d) called\n", uport ? uport->line : -1);
return;
/*
-@@ -1463,7 +1463,7 @@ static void uart_hangup(struct tty_struct *tty)
+@@ -1470,7 +1470,7 @@ static void uart_hangup(struct tty_struct *tty)
uart_flush_buffer(tty);
uart_shutdown(tty, state);
spin_lock_irqsave(&port->lock, flags);
clear_bit(ASYNCB_NORMAL_ACTIVE, &port->flags);
spin_unlock_irqrestore(&port->lock, flags);
tty_port_tty_set(port, NULL);
-@@ -1561,7 +1561,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
+@@ -1568,7 +1568,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
goto end;
}
if (!state->uart_port || state->uart_port->flags & UPF_DEAD) {
retval = -ENXIO;
goto err_dec_count;
-@@ -1601,7 +1601,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
+@@ -1600,7 +1600,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
end:
return retval;
err_dec_count:
goto end;
}
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
-index d48e040..0f52764 100644
+index b799170..87dafd5 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -3090,7 +3090,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
info->port.flags &= ~ASYNC_NORMAL_ACTIVE;
info->port.tty = NULL;
-@@ -3297,12 +3297,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
+@@ -3296,10 +3296,10 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):block_til_ready before block on %s count=%d\n",
+ __FILE__,__LINE__, tty->driver->name, atomic_read(&port->count));
spin_lock_irqsave(&info->irq_spinlock, flags);
- if (!tty_hung_up_p(filp)) {
- extra_count = true;
-- port->count--;
-+ atomic_dec(&port->count);
- }
+- port->count--;
++ atomic_dec(&port->count);
spin_unlock_irqrestore(&info->irq_spinlock, flags);
port->blocked_open++;
-@@ -3331,7 +3331,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
+
+@@ -3327,7 +3327,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",
tty_unlock(tty);
schedule();
-@@ -3343,12 +3343,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
+@@ -3339,12 +3339,12 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
/* FIXME: Racy on hangup during close wait */
- if (extra_count)
+ if (!tty_hung_up_p(filp))
- port->count++;
+ atomic_inc(&port->count);
port->blocked_open--;
if (!retval)
port->flags |= ASYNC_NORMAL_ACTIVE;
-@@ -3400,7 +3400,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
+@@ -3396,7 +3396,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgsl_open(%s), old ref count = %d\n",
+ __FILE__,__LINE__,tty->driver->name, atomic_read(&info->port.count));
/* If port is closing, signal caller to try again */
- if (tty_hung_up_p(filp) || info->port.flags & ASYNC_CLOSING){
-@@ -3419,10 +3419,10 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
+ if (info->port.flags & ASYNC_CLOSING){
+@@ -3415,10 +3415,10 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
spin_unlock_irqrestore(&info->netlock, flags);
goto cleanup;
}
/* 1st open on this device, init hardware */
retval = startup(info);
if (retval < 0)
-@@ -3446,8 +3446,8 @@ cleanup:
+@@ -3442,8 +3442,8 @@ cleanup:
if (retval) {
if (tty->count == 1)
info->port.tty = NULL; /* tty layer will release tty struct */
}
return retval;
-@@ -7665,7 +7665,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
+@@ -7661,7 +7661,7 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
unsigned short new_crctype;
/* return error if TTY interface open */
return -EBUSY;
switch (encoding)
-@@ -7760,7 +7760,7 @@ static int hdlcdev_open(struct net_device *dev)
+@@ -7756,7 +7756,7 @@ static int hdlcdev_open(struct net_device *dev)
/* arbitrate between network and tty opens */
spin_lock_irqsave(&info->netlock, flags);
printk(KERN_WARNING "%s: hdlc_open returning busy\n", dev->name);
spin_unlock_irqrestore(&info->netlock, flags);
return -EBUSY;
-@@ -7846,7 +7846,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+@@ -7842,7 +7842,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
printk("%s:hdlcdev_ioctl(%s)\n",__FILE__,dev->name);
/* return error if TTY interface open */
if (cmd != SIOCWANDEV)
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
-index c359a91..959fc26 100644
+index 0e8c39b..e0cb171 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)
+ DBGINFO(("%s open, old ref count = %d\n", info->device_name, atomic_read(&info->port.count)));
/* If port is closing, signal caller to try again */
- if (tty_hung_up_p(filp) || info->port.flags & ASYNC_CLOSING){
+ if (info->port.flags & ASYNC_CLOSING){
@@ -691,10 +691,10 @@ static int open(struct tty_struct *tty, struct file *filp)
mutex_unlock(&info->port.mutex);
goto cleanup;
port->pending_bh && !port->bh_running &&
!port->bh_requested) {
DBGISR(("%s bh queued\n", port->device_name));
-@@ -3302,7 +3302,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
+@@ -3299,7 +3299,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
+ add_wait_queue(&port->open_wait, &wait);
+
spin_lock_irqsave(&info->lock, flags);
- if (!tty_hung_up_p(filp)) {
- extra_count = true;
-- port->count--;
-+ atomic_dec(&port->count);
- }
+- port->count--;
++ atomic_dec(&port->count);
spin_unlock_irqrestore(&info->lock, flags);
port->blocked_open++;
-@@ -3339,7 +3339,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
+
+@@ -3335,7 +3335,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
remove_wait_queue(&port->open_wait, &wait);
- if (extra_count)
+ if (!tty_hung_up_p(filp))
- port->count++;
+ atomic_inc(&port->count);
port->blocked_open--;
if (!retval)
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
-index 53ba853..3c30f6d 100644
+index c3f9091..abe4601 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)
+ __FILE__,__LINE__,tty->driver->name, atomic_read(&info->port.count));
/* If port is closing, signal caller to try again */
- if (tty_hung_up_p(filp) || info->port.flags & ASYNC_CLOSING){
+ if (info->port.flags & ASYNC_CLOSING){
@@ -769,10 +769,10 @@ static int open(struct tty_struct *tty, struct file *filp)
spin_unlock_irqrestore(&info->netlock, flags);
goto cleanup;
port->pending_bh && !port->bh_running &&
!port->bh_requested ) {
if ( debug_level >= DEBUG_LEVEL_ISR )
-@@ -3319,12 +3319,12 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
+@@ -3318,10 +3318,10 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):%s block_til_ready() before block, count=%d\n",
+ __FILE__,__LINE__, tty->driver->name, atomic_read(&port->count));
spin_lock_irqsave(&info->lock, flags);
- if (!tty_hung_up_p(filp)) {
- extra_count = true;
-- port->count--;
-+ atomic_dec(&port->count);
- }
+- port->count--;
++ atomic_dec(&port->count);
spin_unlock_irqrestore(&info->lock, flags);
port->blocked_open++;
-@@ -3353,7 +3353,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
+
+@@ -3349,7 +3349,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):%s block_til_ready() count=%d\n",
tty_unlock(tty);
schedule();
-@@ -3364,12 +3364,12 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
+@@ -3359,12 +3359,12 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
+ set_current_state(TASK_RUNNING);
remove_wait_queue(&port->open_wait, &wait);
-
- if (extra_count)
+ if (!tty_hung_up_p(filp))
- port->count++;
+ atomic_inc(&port->count);
port->blocked_open--;
if (!retval)
port->flags |= ASYNC_NORMAL_ACTIVE;
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
-index 454b658..57b1430 100644
+index 42bad18..447d7a2 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -1084,7 +1084,7 @@ EXPORT_SYMBOL(unregister_sysrq_key);
if (get_user(c, buf))
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
-index 3411071..86f2cf2 100644
+index 8fbad34..0db0a39 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
-@@ -3475,7 +3475,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)
{
raw_spin_unlock_irqrestore(&tty_ldiscs_lock, flags);
}
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
-index 3f746c8..2f2fcaa 100644
+index 1b93357..ea9f82c 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
-@@ -235,7 +235,7 @@ void tty_port_hangup(struct tty_port *port)
+@@ -237,7 +237,7 @@ void tty_port_hangup(struct tty_port *port)
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
port->flags &= ~ASYNC_NORMAL_ACTIVE;
tty = port->tty;
if (tty)
-@@ -393,7 +393,7 @@ int tty_port_block_til_ready(struct tty_port *port,
+@@ -399,7 +399,7 @@ int tty_port_block_til_ready(struct tty_port *port,
+
/* The port lock protects the port counts */
spin_lock_irqsave(&port->lock, flags);
- if (!tty_hung_up_p(filp))
-- port->count--;
-+ atomic_dec(&port->count);
+- port->count--;
++ atomic_dec(&port->count);
port->blocked_open++;
spin_unlock_irqrestore(&port->lock, flags);
-@@ -435,7 +435,7 @@ int tty_port_block_til_ready(struct tty_port *port,
+@@ -441,7 +441,7 @@ int tty_port_block_til_ready(struct tty_port *port,
we must not mess that up further */
spin_lock_irqsave(&port->lock, flags);
if (!tty_hung_up_p(filp))
port->blocked_open--;
if (retval == 0)
port->flags |= ASYNC_NORMAL_ACTIVE;
-@@ -469,19 +469,19 @@ int tty_port_close_start(struct tty_port *port,
+@@ -479,19 +479,19 @@ int tty_port_close_start(struct tty_port *port,
return 0;
}
spin_unlock_irqrestore(&port->lock, flags);
return 0;
}
-@@ -563,7 +563,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
+@@ -592,7 +592,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
+ struct file *filp)
{
spin_lock_irq(&port->lock);
- if (!tty_hung_up_p(filp))
-- ++port->count;
-+ atomic_inc(&port->count);
+- ++port->count;
++ atomic_inc(&port->count);
spin_unlock_irq(&port->lock);
tty_port_tty_set(port, tty);
dev->rawdescriptors[i] + (*ppos - pos),
min(len, alloclen))) {
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
-index bec31e2..b8091cd 100644
+index 487abcf..06226dc 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
-@@ -1554,7 +1554,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)
+@@ -1550,7 +1550,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)
*/
usb_get_urb(urb);
atomic_inc(&urb->use_count);
usbmon_urb_submit(&hcd->self, urb);
/* NOTE requirements on root-hub callers (usbfs and the hub
-@@ -1581,7 +1581,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)
+@@ -1577,7 +1577,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags)
urb->hcpriv = NULL;
INIT_LIST_HEAD(&urb->urb_list);
atomic_dec(&urb->use_count);
wake_up(&usb_kill_urb_queue);
usb_put_urb(urb);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
-index 27f2171..e3dfc22 100644
+index dc84915..cdb6624 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -27,6 +27,7 @@
#include <asm/uaccess.h>
#include <asm/byteorder.h>
-@@ -4644,6 +4645,10 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
+@@ -4662,6 +4663,10 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
goto done;
return;
}
static DEVICE_ATTR_RO(urbnum);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
-index 4d11449..f4ccabf 100644
+index 2dd2362..1135437 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -433,7 +433,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
INIT_LIST_HEAD(&dev->ep0.urb_list);
dev->ep0.desc.bLength = USB_DT_ENDPOINT_SIZE;
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
-index dab7927..6f53afc 100644
+index 490a6ca..1f8364d 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -615,8 +615,6 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
return 0;
}
-diff --git a/drivers/usb/gadget/f_uac1.c b/drivers/usb/gadget/f_uac1.c
+diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 2b4c82d..06a8ee6 100644
---- a/drivers/usb/gadget/f_uac1.c
-+++ b/drivers/usb/gadget/f_uac1.c
+--- a/drivers/usb/gadget/function/f_uac1.c
++++ b/drivers/usb/gadget/function/f_uac1.c
@@ -13,6 +13,7 @@
#include <linux/kernel.h>
#include <linux/device.h>
#include "u_uac1.h"
-diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
+diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
index ad0aca8..8ff84865 100644
---- a/drivers/usb/gadget/u_serial.c
-+++ b/drivers/usb/gadget/u_serial.c
+--- a/drivers/usb/gadget/function/u_serial.c
++++ b/drivers/usb/gadget/function/u_serial.c
@@ -733,9 +733,9 @@ static int gs_open(struct tty_struct *tty, struct file *file)
spin_lock_irq(&port->port_lock);
gs_buf_free(&port->port_write_buf);
gs_free_requests(gser->out, &port->read_pool, NULL);
gs_free_requests(gser->out, &port->read_queue, NULL);
-diff --git a/drivers/usb/gadget/u_uac1.c b/drivers/usb/gadget/u_uac1.c
+diff --git a/drivers/usb/gadget/function/u_uac1.c b/drivers/usb/gadget/function/u_uac1.c
index 7a55fea..cc0ed4f 100644
---- a/drivers/usb/gadget/u_uac1.c
-+++ b/drivers/usb/gadget/u_uac1.c
+--- a/drivers/usb/gadget/function/u_uac1.c
++++ b/drivers/usb/gadget/function/u_uac1.c
@@ -16,6 +16,7 @@
#include <linux/ctype.h>
#include <linux/random.h>
/* Dynamic bitflag definitions (us->dflags): used in set_bit() etc. */
+diff --git a/drivers/usb/usbip/vhci.h b/drivers/usb/usbip/vhci.h
+index a863a98..d272795 100644
+--- a/drivers/usb/usbip/vhci.h
++++ b/drivers/usb/usbip/vhci.h
+@@ -83,7 +83,7 @@ struct vhci_hcd {
+ unsigned resuming:1;
+ unsigned long re_timeout;
+
+- atomic_t seqnum;
++ atomic_unchecked_t seqnum;
+
+ /*
+ * NOTE:
+diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
+index c02374b..32d47a9 100644
+--- a/drivers/usb/usbip/vhci_hcd.c
++++ b/drivers/usb/usbip/vhci_hcd.c
+@@ -439,7 +439,7 @@ static void vhci_tx_urb(struct urb *urb)
+
+ spin_lock(&vdev->priv_lock);
+
+- priv->seqnum = atomic_inc_return(&the_controller->seqnum);
++ priv->seqnum = atomic_inc_return_unchecked(&the_controller->seqnum);
+ if (priv->seqnum == 0xffff)
+ dev_info(&urb->dev->dev, "seqnum max\n");
+
+@@ -686,7 +686,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
+ return -ENOMEM;
+ }
+
+- unlink->seqnum = atomic_inc_return(&the_controller->seqnum);
++ unlink->seqnum = atomic_inc_return_unchecked(&the_controller->seqnum);
+ if (unlink->seqnum == 0xffff)
+ pr_info("seqnum max\n");
+
+@@ -891,7 +891,7 @@ static int vhci_start(struct usb_hcd *hcd)
+ vdev->rhport = rhport;
+ }
+
+- atomic_set(&vhci->seqnum, 0);
++ atomic_set_unchecked(&vhci->seqnum, 0);
+ spin_lock_init(&vhci->lock);
+
+ hcd->power_budget = 0; /* no limit */
+diff --git a/drivers/usb/usbip/vhci_rx.c b/drivers/usb/usbip/vhci_rx.c
+index 00e4a54..d676f85 100644
+--- a/drivers/usb/usbip/vhci_rx.c
++++ b/drivers/usb/usbip/vhci_rx.c
+@@ -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",
+- atomic_read(&the_controller->seqnum));
++ atomic_read_unchecked(&the_controller->seqnum));
+ usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
+ return;
+ }
diff --git a/drivers/usb/wusbcore/wa-hc.h b/drivers/usb/wusbcore/wa-hc.h
index f2a8d29..7bc3fe7 100644
--- a/drivers/usb/wusbcore/wa-hc.h
for (index = 0; index < WA_MAX_BUF_IN_URBS; ++index)
usb_init_urb(&(wa->buf_in_urbs[index]));
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c
-index 3e2e4ed..060c9b8 100644
+index e279015..c2d0dae 100644
--- a/drivers/usb/wusbcore/wa-xfer.c
+++ b/drivers/usb/wusbcore/wa-xfer.c
@@ -314,7 +314,7 @@ static void wa_xfer_completion(struct wa_xfer *xfer)
err = -ENOSPC;
}
diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c
-index 52108be..c7c110d 100644
+index ff60701..814b973 100644
--- a/drivers/video/fbdev/aty/aty128fb.c
+++ b/drivers/video/fbdev/aty/aty128fb.c
@@ -149,7 +149,7 @@ enum {
"PCI",
"PRO AGP",
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
-index c3d0074..0b9077e 100644
+index 37ec09b..98f8862 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -1326,10 +1326,14 @@ static int atyfb_set_par(struct fb_info *info)
data = (__u32) (unsigned long) fix->smem_start;
err |= put_user(data, &fix32->smem_start);
diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
-index e23392e..8a77540 100644
+index 4254336..282567e 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
-@@ -235,7 +235,7 @@ static uint screen_fb_size;
+@@ -240,7 +240,7 @@ static uint screen_fb_size;
static inline int synthvid_send(struct hv_device *hdev,
struct synthvid_msg *msg)
{
int ret;
msg->pipe_hdr.type = PIPE_MSG_DATA;
-@@ -243,7 +243,7 @@ static inline int synthvid_send(struct hv_device *hdev,
+@@ -248,7 +248,7 @@ static inline int synthvid_send(struct hv_device *hdev,
ret = vmbus_sendpacket(hdev->channel, msg,
msg->vid_hdr.size + sizeof(struct pipe_msg_hdr),
&data);
if (!inode) {
diff --git a/fs/aio.c b/fs/aio.c
-index 1c9c5f0..c935d6e 100644
+index 7337500..2058af6 100644
--- a/fs/aio.c
+++ b/fs/aio.c
-@@ -141,6 +141,7 @@ struct kioctx {
-
- struct {
- unsigned tail;
-+ unsigned completed_events;
- spinlock_t completion_lock;
- } ____cacheline_aligned_in_smp;
-
-@@ -380,7 +381,7 @@ static int aio_setup_ring(struct kioctx *ctx)
+@@ -380,7 +380,7 @@ static int aio_setup_ring(struct kioctx *ctx)
size += sizeof(struct io_event) * nr_events;
nr_pages = PFN_UP(size);
return -EINVAL;
file = aio_private_file(ctx, nr_pages);
-@@ -880,6 +881,68 @@ out:
- return ret;
- }
-
-+/* refill_reqs_available
-+ * Updates the reqs_available reference counts used for tracking the
-+ * number of free slots in the completion ring. This can be called
-+ * from aio_complete() (to optimistically update reqs_available) or
-+ * from aio_get_req() (the we're out of events case). It must be
-+ * called holding ctx->completion_lock.
-+ */
-+static void refill_reqs_available(struct kioctx *ctx, unsigned head,
-+ unsigned tail)
-+{
-+ unsigned events_in_ring, completed;
-+
-+ /* Clamp head since userland can write to it. */
-+ head %= ctx->nr_events;
-+ if (head <= tail)
-+ events_in_ring = tail - head;
-+ else
-+ events_in_ring = ctx->nr_events - (head - tail);
-+
-+ completed = ctx->completed_events;
-+ if (events_in_ring < completed)
-+ completed -= events_in_ring;
-+ else
-+ completed = 0;
-+
-+ if (!completed)
-+ return;
-+
-+ ctx->completed_events -= completed;
-+ put_reqs_available(ctx, completed);
-+}
-+
-+/* user_refill_reqs_available
-+ * Called to refill reqs_available when aio_get_req() encounters an
-+ * out of space in the completion ring.
-+ */
-+static void user_refill_reqs_available(struct kioctx *ctx)
-+{
-+ spin_lock_irq(&ctx->completion_lock);
-+ if (ctx->completed_events) {
-+ struct aio_ring *ring;
-+ unsigned head;
-+
-+ /* Access of ring->head may race with aio_read_events_ring()
-+ * here, but that's okay since whether we read the old version
-+ * or the new version, and either will be valid. The important
-+ * part is that head cannot pass tail since we prevent
-+ * aio_complete() from updating tail by holding
-+ * ctx->completion_lock. Even if head is invalid, the check
-+ * against ctx->completed_events below will make sure we do the
-+ * safe/right thing.
-+ */
-+ ring = kmap_atomic(ctx->ring_pages[0]);
-+ head = ring->head;
-+ kunmap_atomic(ring);
-+
-+ refill_reqs_available(ctx, head, ctx->tail);
-+ }
-+
-+ spin_unlock_irq(&ctx->completion_lock);
-+}
-+
- /* aio_get_req
- * Allocate a slot for an aio request.
- * Returns NULL if no requests are free.
-@@ -888,8 +951,11 @@ static inline struct kiocb *aio_get_req(struct kioctx *ctx)
- {
- struct kiocb *req;
-
-- if (!get_reqs_available(ctx))
-- return NULL;
-+ if (!get_reqs_available(ctx)) {
-+ user_refill_reqs_available(ctx);
-+ if (!get_reqs_available(ctx))
-+ return NULL;
-+ }
-
- req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL|__GFP_ZERO);
- if (unlikely(!req))
-@@ -948,8 +1014,8 @@ void aio_complete(struct kiocb *iocb, long res, long res2)
- struct kioctx *ctx = iocb->ki_ctx;
- struct aio_ring *ring;
- struct io_event *ev_page, *event;
-+ unsigned tail, pos, head;
- unsigned long flags;
-- unsigned tail, pos;
-
- /*
- * Special case handling for sync iocbs:
-@@ -1010,10 +1076,14 @@ void aio_complete(struct kiocb *iocb, long res, long res2)
- ctx->tail = tail;
-
- ring = kmap_atomic(ctx->ring_pages[0]);
-+ head = ring->head;
- ring->tail = tail;
- kunmap_atomic(ring);
- flush_dcache_page(ctx->ring_pages[0]);
-
-+ ctx->completed_events++;
-+ if (ctx->completed_events > 1)
-+ refill_reqs_available(ctx, head, tail);
- spin_unlock_irqrestore(&ctx->completion_lock, flags);
-
- pr_debug("added to ring %p at [%u]\n", iocb, tail);
-@@ -1028,7 +1098,6 @@ void aio_complete(struct kiocb *iocb, long res, long res2)
-
- /* everything turned out well, dispose of the aiocb. */
- kiocb_free(iocb);
-- put_reqs_available(ctx, 1);
-
- /*
- * We have to order our ring_info tail store above and test
-@@ -1065,6 +1134,12 @@ static long aio_read_events_ring(struct kioctx *ctx,
- tail = ring->tail;
- kunmap_atomic(ring);
-
-+ /*
-+ * Ensure that once we've read the current tail pointer, that
-+ * we also see the events that were stored up to the tail.
-+ */
-+ smp_rmb();
-+
- pr_debug("h%u t%u m%u\n", head, tail, ctx->nr_events);
-
- if (head == tail)
diff --git a/fs/attr.c b/fs/attr.c
index 6530ced..4a827e2 100644
--- a/fs/attr.c
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 aeab453..48dbafc 100644
+index 44ee5d2..8b23e53 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1184,9 +1184,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
spin_lock_init(&delayed_root->lock);
init_waitqueue_head(&delayed_root->wait);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
-index 47aceb4..7d28b1c 100644
+index 8a8e298..9f904ad 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
-@@ -3965,9 +3965,12 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
+@@ -3939,9 +3939,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;
info = NULL;
rcu_read_lock();
list_for_each_entry_rcu(tmp, &root->fs_info->space_info,
-@@ -3989,10 +3992,7 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
+@@ -3963,10 +3966,7 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
memcpy(dest, &space, sizeof(space));
dest++;
space_args.total_spaces++;
up_read(&info->groups_sem);
}
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
-index 8e16bca..6eabd9e 100644
+index c4124de..d7613eb6 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -270,7 +270,7 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
wake_up(&root->fs_info->transaction_wait);
wake_up(&root->fs_info->transaction_blocked_wait);
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
-index 7869936..7e153dc 100644
+index 12e5355..cdf30c6 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -475,7 +475,7 @@ static int addrm_unknown_feature_attrs(struct btrfs_fs_info *fs_info, bool add)
.attrs = attrs,
};
diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h
-index 7f5b41b..e589c13 100644
+index e2e798a..f454c18 100644
--- a/fs/btrfs/tree-log.h
+++ b/fs/btrfs/tree-log.h
@@ -41,7 +41,7 @@ static inline void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx)
static inline int btrfs_need_log_full_commit(struct btrfs_fs_info *fs_info,
diff --git a/fs/buffer.c b/fs/buffer.c
-index eba6e4f..af1182c 100644
+index 3588a80..3d038a9 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
-@@ -3429,7 +3429,7 @@ void __init buffer_init(void)
+@@ -2318,6 +2318,11 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
+ err = 0;
+
+ balance_dirty_pages_ratelimited(mapping);
++
++ if (unlikely(fatal_signal_pending(current))) {
++ err = -EINTR;
++ goto out;
++ }
+ }
+
+ /* page covers the boundary, find the boundary offset */
+@@ -3424,7 +3429,7 @@ void __init buffer_init(void)
bh_cachep = kmem_cache_create("buffer_head",
sizeof(struct buffer_head), 0,
(SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
/*
diff --git a/fs/cachefiles/bind.c b/fs/cachefiles/bind.c
-index d749731..dd333a6 100644
+index fbb08e9..0fda764 100644
--- a/fs/cachefiles/bind.c
+++ b/fs/cachefiles/bind.c
@@ -39,13 +39,11 @@ int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args)
cache->brun_percent < 100);
diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c
-index b078d30..db23012 100644
+index ce1b115..4a6852c 100644
--- a/fs/cachefiles/daemon.c
+++ b/fs/cachefiles/daemon.c
@@ -196,7 +196,7 @@ static ssize_t cachefiles_daemon_read(struct file *file, char __user *_buffer,
cache->bstop_percent = bstop;
diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h
-index 3d50998..0550d67 100644
+index 8c52472..c4e3a69 100644
--- a/fs/cachefiles/internal.h
+++ b/fs/cachefiles/internal.h
@@ -66,7 +66,7 @@ struct cachefiles_cache {
#else
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
-index 5bf2b41..85b93f9 100644
+index dad7d95..07475af 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -312,7 +312,7 @@ try_again:
return 0;
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
-index 4b1fb5c..0d2a699 100644
+index 25e745b..220e604 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
-@@ -943,7 +943,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
+@@ -937,7 +937,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(
int err;
u32 ftype;
struct ceph_mds_reply_info_parsed *rinfo;
+diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
+index a822a6e..4644256 100644
+--- a/fs/ceph/ioctl.c
++++ b/fs/ceph/ioctl.c
+@@ -41,7 +41,7 @@ static long __validate_layout(struct ceph_mds_client *mdsc,
+ /* validate striping parameters */
+ if ((l->object_size & ~PAGE_MASK) ||
+ (l->stripe_unit & ~PAGE_MASK) ||
+- (l->stripe_unit != 0 &&
++ ((unsigned)l->stripe_unit != 0 &&
+ ((unsigned)l->object_size % (unsigned)l->stripe_unit)))
+ return -EINVAL;
+
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
-index 06150fd..192061b 100644
+index f6e1237..796ffd1 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -895,7 +895,7 @@ static int ceph_compare_super(struct super_block *sb, void *data)
sb->s_bdi = &fsc->backing_dev_info;
return err;
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
-index f3ac415..3d2420c 100644
+index 44ec726..bcb06a3 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -286,8 +286,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
server->ops->print_stats(m, tcon);
}
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
-index 8883980..c8ade72 100644
+index 889b984..fcb8431 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
-@@ -1072,7 +1072,7 @@ cifs_init_request_bufs(void)
+@@ -1092,7 +1092,7 @@ cifs_init_request_bufs(void)
*/
cifs_req_cachep = kmem_cache_create("cifs_request",
CIFSMaxBufSize + max_hdr_size, 0,
if (cifs_req_cachep == NULL)
return -ENOMEM;
-@@ -1099,7 +1099,7 @@ cifs_init_request_bufs(void)
+@@ -1119,7 +1119,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",
NULL);
if (cifs_sm_req_cachep == NULL) {
mempool_destroy(cifs_req_poolp);
-@@ -1184,8 +1184,8 @@ init_cifs(void)
+@@ -1204,8 +1204,8 @@ init_cifs(void)
atomic_set(&bufAllocCount, 0);
atomic_set(&smBufAllocCount, 0);
#ifdef CONFIG_CIFS_STATS2
atomic_set(&midCount, 0);
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
-index de6aed8..a0a76fd 100644
+index 25b8392..01e46dc 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
-@@ -807,35 +807,35 @@ struct cifs_tcon {
+@@ -821,35 +821,35 @@ struct cifs_tcon {
__u16 Flags; /* optional support bits */
enum statusEnum tidStatus;
#ifdef CONFIG_CIFS_STATS
} smb2_stats;
#endif /* CONFIG_CIFS_SMB2 */
} stats;
-@@ -1172,7 +1172,7 @@ convert_delimiter(char *path, char delim)
+@@ -1190,7 +1190,7 @@ convert_delimiter(char *path, char delim)
}
#ifdef CONFIG_CIFS_STATS
static inline void cifs_stats_bytes_written(struct cifs_tcon *tcon,
unsigned int bytes)
-@@ -1538,8 +1538,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
+@@ -1557,8 +1557,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
/* Various Debug counters */
GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */
#ifdef CONFIG_CIFS_STATS2
GLOBAL_EXTERN atomic_t smBufAllocCount;
GLOBAL_EXTERN atomic_t midCount;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
-index e90a1e9..908699d 100644
+index 5f29354..359bc0d 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
-@@ -1900,10 +1900,14 @@ static int cifs_writepages(struct address_space *mapping,
+@@ -2056,10 +2056,14 @@ static int cifs_writepages(struct address_space *mapping,
index = mapping->writeback_index; /* Start from prev offset */
end = -1;
} else {
+ }
scanned = true;
}
- retry:
+ server = cifs_sb_master_tcon(cifs_sb)->ses->server;
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
-index 3b0c62e..f7d090c 100644
+index b7415d5..3984ec0 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -170,7 +170,7 @@ cifs_buf_get(void)
}
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
-index d1fdfa8..94558f8 100644
+index 52131d8..fd79e97 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -626,27 +626,27 @@ static void
}
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
-index 787844b..8e7bc7d 100644
+index f522193..586121b 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
-@@ -364,8 +364,8 @@ smb2_clear_stats(struct cifs_tcon *tcon)
+@@ -414,8 +414,8 @@ smb2_clear_stats(struct cifs_tcon *tcon)
#ifdef CONFIG_CIFS_STATS
int i;
for (i = 0; i < NUMBER_OF_SMB2_COMMANDS; i++) {
}
#endif
}
-@@ -405,65 +405,65 @@ static void
+@@ -455,65 +455,65 @@ static void
smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon)
{
#ifdef CONFIG_CIFS_STATS
}
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
-index b0b260d..c8927e1 100644
+index 74b3a66..0c709f3 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
-@@ -2105,8 +2105,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
+@@ -2143,8 +2143,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
default:
cifs_dbg(VFS, "info level %u isn't supported\n",
srch_inf->info_level);
req->FileIndex = cpu_to_le32(index);
diff --git a/fs/coda/cache.c b/fs/coda/cache.c
-index 1da168c..8bc7ff6 100644
+index 278f8fd..e69c52d 100644
--- a/fs/coda/cache.c
+++ b/fs/coda/cache.c
@@ -24,7 +24,7 @@
/*
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
-index e822890..fed89d9 100644
+index afec645..9c65620 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -621,7 +621,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd,
return 0;
while (nr) {
diff --git a/fs/dcache.c b/fs/dcache.c
-index 06f6585..f95a6d1 100644
+index cb25a1a..8060de0 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
-@@ -1445,7 +1445,7 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
+@@ -478,7 +478,7 @@ static void __dentry_kill(struct dentry *dentry)
+ * dentry_iput drops the locks, at which point nobody (except
+ * transient RCU lookups) can reach this dentry.
+ */
+- BUG_ON((int)dentry->d_lockref.count > 0);
++ BUG_ON((int)__lockref_read(&dentry->d_lockref) > 0);
+ this_cpu_dec(nr_dentry);
+ if (dentry->d_op && dentry->d_op->d_release)
+ dentry->d_op->d_release(dentry);
+@@ -531,7 +531,7 @@ static inline struct dentry *lock_parent(struct dentry *dentry)
+ struct dentry *parent = dentry->d_parent;
+ if (IS_ROOT(dentry))
+ return NULL;
+- if (unlikely((int)dentry->d_lockref.count < 0))
++ if (unlikely((int)__lockref_read(&dentry->d_lockref) < 0))
+ return NULL;
+ if (likely(spin_trylock(&parent->d_lock)))
+ return parent;
+@@ -608,7 +608,7 @@ repeat:
+ dentry->d_flags |= DCACHE_REFERENCED;
+ dentry_lru_add(dentry);
+
+- dentry->d_lockref.count--;
++ __lockref_dec(&dentry->d_lockref);
+ spin_unlock(&dentry->d_lock);
+ return;
+
+@@ -663,7 +663,7 @@ int d_invalidate(struct dentry * dentry)
+ * We also need to leave mountpoints alone,
+ * directory or not.
+ */
+- if (dentry->d_lockref.count > 1 && dentry->d_inode) {
++ if (__lockref_read(&dentry->d_lockref) > 1 && dentry->d_inode) {
+ if (S_ISDIR(dentry->d_inode->i_mode) || d_mountpoint(dentry)) {
+ spin_unlock(&dentry->d_lock);
+ return -EBUSY;
+@@ -679,7 +679,7 @@ EXPORT_SYMBOL(d_invalidate);
+ /* This must be called with d_lock held */
+ static inline void __dget_dlock(struct dentry *dentry)
+ {
+- dentry->d_lockref.count++;
++ __lockref_inc(&dentry->d_lockref);
+ }
+
+ static inline void __dget(struct dentry *dentry)
+@@ -720,8 +720,8 @@ repeat:
+ goto repeat;
+ }
+ rcu_read_unlock();
+- BUG_ON(!ret->d_lockref.count);
+- ret->d_lockref.count++;
++ BUG_ON(!__lockref_read(&ret->d_lockref));
++ __lockref_inc(&ret->d_lockref);
+ spin_unlock(&ret->d_lock);
+ return ret;
+ }
+@@ -798,7 +798,7 @@ restart:
+ spin_lock(&inode->i_lock);
+ hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
+ spin_lock(&dentry->d_lock);
+- if (!dentry->d_lockref.count) {
++ if (!__lockref_read(&dentry->d_lockref)) {
+ /*
+ * inform the fs via d_prune that this dentry
+ * is about to be unhashed and destroyed.
+@@ -841,7 +841,7 @@ static void shrink_dentry_list(struct list_head *list)
+ * We found an inuse dentry which was not removed from
+ * the LRU because of laziness during lookup. Do not free it.
+ */
+- if ((int)dentry->d_lockref.count > 0) {
++ if ((int)__lockref_read(&dentry->d_lockref) > 0) {
+ spin_unlock(&dentry->d_lock);
+ if (parent)
+ spin_unlock(&parent->d_lock);
+@@ -879,8 +879,8 @@ static void shrink_dentry_list(struct list_head *list)
+ dentry = parent;
+ while (dentry && !lockref_put_or_lock(&dentry->d_lockref)) {
+ parent = lock_parent(dentry);
+- if (dentry->d_lockref.count != 1) {
+- dentry->d_lockref.count--;
++ if (__lockref_read(&dentry->d_lockref) != 1) {
++ __lockref_inc(&dentry->d_lockref);
+ spin_unlock(&dentry->d_lock);
+ if (parent)
+ spin_unlock(&parent->d_lock);
+@@ -920,7 +920,7 @@ dentry_lru_isolate(struct list_head *item, spinlock_t *lru_lock, void *arg)
+ * counts, just remove them from the LRU. Otherwise give them
+ * another pass through the LRU.
+ */
+- if (dentry->d_lockref.count) {
++ if (__lockref_read(&dentry->d_lockref) > 0) {
+ d_lru_isolate(dentry);
+ spin_unlock(&dentry->d_lock);
+ return LRU_REMOVED;
+@@ -1255,7 +1255,7 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry)
+ } else {
+ if (dentry->d_flags & DCACHE_LRU_LIST)
+ d_lru_del(dentry);
+- if (!dentry->d_lockref.count) {
++ if (!__lockref_read(&dentry->d_lockref)) {
+ d_shrink_add(dentry, &data->dispose);
+ data->found++;
+ }
+@@ -1303,7 +1303,7 @@ static enum d_walk_ret umount_check(void *_data, struct dentry *dentry)
+ return D_WALK_CONTINUE;
+
+ /* root with refcount 1 is fine */
+- if (dentry == _data && dentry->d_lockref.count == 1)
++ if (dentry == _data && __lockref_read(&dentry->d_lockref) == 1)
+ return D_WALK_CONTINUE;
+
+ printk(KERN_ERR "BUG: Dentry %p{i=%lx,n=%pd} "
+@@ -1312,7 +1312,7 @@ static enum d_walk_ret umount_check(void *_data, struct dentry *dentry)
+ dentry->d_inode ?
+ dentry->d_inode->i_ino : 0UL,
+ dentry,
+- dentry->d_lockref.count,
++ __lockref_read(&dentry->d_lockref),
+ dentry->d_sb->s_type->name,
+ dentry->d_sb->s_id);
+ WARN_ON(1);
+@@ -1438,7 +1438,7 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
*/
dentry->d_iname[DNAME_INLINE_LEN-1] = 0;
if (name->len > DNAME_INLINE_LEN-1) {
if (!dname) {
kmem_cache_free(dentry_cache, dentry);
return NULL;
-@@ -3413,7 +3413,8 @@ void __init vfs_caches_init(unsigned long mempages)
+@@ -1456,7 +1456,7 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
+ smp_wmb();
+ dentry->d_name.name = dname;
+
+- dentry->d_lockref.count = 1;
++ __lockref_set(&dentry->d_lockref, 1);
+ dentry->d_flags = 0;
+ spin_lock_init(&dentry->d_lock);
+ seqcount_init(&dentry->d_seq);
+@@ -2196,7 +2196,7 @@ struct dentry *__d_lookup(const struct dentry *parent, const struct qstr *name)
+ goto next;
+ }
+
+- dentry->d_lockref.count++;
++ __lockref_inc(&dentry->d_lockref);
+ found = dentry;
+ spin_unlock(&dentry->d_lock);
+ break;
+@@ -2295,7 +2295,7 @@ again:
+ spin_lock(&dentry->d_lock);
+ inode = dentry->d_inode;
+ isdir = S_ISDIR(inode->i_mode);
+- if (dentry->d_lockref.count == 1) {
++ if (__lockref_read(&dentry->d_lockref) == 1) {
+ if (!spin_trylock(&inode->i_lock)) {
+ spin_unlock(&dentry->d_lock);
+ cpu_relax();
+@@ -2675,11 +2675,13 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
+ if (!IS_ROOT(new)) {
+ spin_unlock(&inode->i_lock);
+ dput(new);
++ iput(inode);
+ return ERR_PTR(-EIO);
+ }
+ if (d_ancestor(new, dentry)) {
+ spin_unlock(&inode->i_lock);
+ dput(new);
++ iput(inode);
+ return ERR_PTR(-EIO);
+ }
+ write_seqlock(&rename_lock);
+@@ -3300,7 +3302,7 @@ static enum d_walk_ret d_genocide_kill(void *data, struct dentry *dentry)
+
+ if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
+ dentry->d_flags |= DCACHE_GENOCIDE;
+- dentry->d_lockref.count--;
++ __lockref_dec(&dentry->d_lockref);
+ }
+ }
+ return D_WALK_CONTINUE;
+@@ -3416,7 +3418,8 @@ void __init vfs_caches_init(unsigned long mempages)
mempages -= reserve;
names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0,
dcache_init();
inode_init();
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
-index 16a46b6..41696fd 100644
+index 1e3b99d..6512101 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -416,7 +416,11 @@ EXPORT_SYMBOL_GPL(debugfs_create_file);
i += packet_length_size;
if (copy_to_user(&buf[i], msg_ctx->msg, msg_ctx->msg_size))
diff --git a/fs/exec.c b/fs/exec.c
-index a3d33fe..49e9bc9 100644
+index a2b42a9..1e924b3 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -56,8 +56,20 @@
return 0;
err:
up_write(&mm->mmap_sem);
-@@ -399,7 +440,7 @@ struct user_arg_ptr {
+@@ -395,7 +436,7 @@ struct user_arg_ptr {
} ptr;
};
{
const char __user *native;
-@@ -408,14 +449,14 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr)
+@@ -404,14 +445,14 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr)
compat_uptr_t compat;
if (get_user(compat, argv.ptr.compat + nr))
return native;
}
-@@ -434,7 +475,7 @@ static int count(struct user_arg_ptr argv, int max)
+@@ -430,7 +471,7 @@ static int count(struct user_arg_ptr argv, int max)
if (!p)
break;
return -EFAULT;
if (i >= max)
-@@ -469,7 +510,7 @@ static int copy_strings(int argc, struct user_arg_ptr argv,
+@@ -465,7 +506,7 @@ static int copy_strings(int argc, struct user_arg_ptr argv,
ret = -EFAULT;
str = get_user_arg_ptr(argv, argc);
goto out;
len = strnlen_user(str, MAX_ARG_STRLEN);
-@@ -551,7 +592,7 @@ int copy_strings_kernel(int argc, const char *const *__argv,
+@@ -547,7 +588,7 @@ int copy_strings_kernel(int argc, const char *const *__argv,
int r;
mm_segment_t oldfs = get_fs();
struct user_arg_ptr argv = {
};
set_fs(KERNEL_DS);
-@@ -586,7 +627,8 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
+@@ -582,7 +623,8 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
unsigned long new_end = old_end - shift;
struct mmu_gather tlb;
/*
* ensure there are no vmas between where we want to go
-@@ -595,6 +637,10 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
+@@ -591,6 +633,10 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
if (vma != find_vma(mm, new_start))
return -EFAULT;
/*
* cover the whole range: [new_start, old_end)
*/
-@@ -675,10 +721,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
+@@ -671,10 +717,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
stack_top = arch_align_stack(stack_top);
stack_top = PAGE_ALIGN(stack_top);
stack_shift = vma->vm_end - stack_top;
bprm->p -= stack_shift;
-@@ -690,8 +732,28 @@ int setup_arg_pages(struct linux_binprm *bprm,
+@@ -686,8 +728,28 @@ int setup_arg_pages(struct linux_binprm *bprm,
bprm->exec -= stack_shift;
down_write(&mm->mmap_sem);
/*
* Adjust stack execute permissions; explicitly enable for
* EXSTACK_ENABLE_X, disable for EXSTACK_DISABLE_X and leave alone
-@@ -710,13 +772,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
+@@ -706,13 +768,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
goto out_unlock;
BUG_ON(prev != vma);
/* mprotect_fixup is overkill to remove the temporary stack flags */
vma->vm_flags &= ~VM_STACK_INCOMPLETE_SETUP;
-@@ -740,6 +795,27 @@ int setup_arg_pages(struct linux_binprm *bprm,
+@@ -736,6 +791,27 @@ int setup_arg_pages(struct linux_binprm *bprm,
#endif
current->mm->start_stack = bprm->p;
ret = expand_stack(vma, stack_base);
if (ret)
ret = -EFAULT;
-@@ -775,6 +851,8 @@ static struct file *do_open_exec(struct filename *name)
+@@ -771,6 +847,8 @@ static struct file *do_open_exec(struct filename *name)
fsnotify_open(file);
err = deny_write_access(file);
if (err)
goto exit;
-@@ -804,7 +882,7 @@ int kernel_read(struct file *file, loff_t offset,
+@@ -800,7 +878,7 @@ int kernel_read(struct file *file, loff_t offset,
old_fs = get_fs();
set_fs(get_ds());
/* The cast to a user pointer is valid due to the set_fs() */
set_fs(old_fs);
return result;
}
-@@ -849,6 +927,7 @@ static int exec_mmap(struct mm_struct *mm)
+@@ -845,6 +923,7 @@ static int exec_mmap(struct mm_struct *mm)
tsk->mm = mm;
tsk->active_mm = mm;
activate_mm(active_mm, mm);
tsk->mm->vmacache_seqnum = 0;
vmacache_flush(tsk);
task_unlock(tsk);
-@@ -1247,7 +1326,7 @@ static void check_unsafe_exec(struct linux_binprm *bprm)
+@@ -1243,7 +1322,7 @@ static void check_unsafe_exec(struct linux_binprm *bprm)
}
rcu_read_unlock();
bprm->unsafe |= LSM_UNSAFE_SHARE;
else
p->fs->in_exec = 1;
-@@ -1423,6 +1502,31 @@ static int exec_binprm(struct linux_binprm *bprm)
+@@ -1419,6 +1498,31 @@ static int exec_binprm(struct linux_binprm *bprm)
return ret;
}
/*
* sys_execve() executes a new program.
*/
-@@ -1430,6 +1534,11 @@ static int do_execve_common(struct filename *filename,
+@@ -1426,6 +1530,11 @@ static int do_execve_common(struct filename *filename,
struct user_arg_ptr argv,
struct user_arg_ptr envp)
{
struct linux_binprm *bprm;
struct file *file;
struct files_struct *displaced;
-@@ -1438,6 +1547,8 @@ static int do_execve_common(struct filename *filename,
+@@ -1434,6 +1543,8 @@ static int do_execve_common(struct filename *filename,
if (IS_ERR(filename))
return PTR_ERR(filename);
/*
* We move the actual failure in case of RLIMIT_NPROC excess from
* set*uid() to execve() because too many poorly written programs
-@@ -1475,11 +1586,21 @@ static int do_execve_common(struct filename *filename,
+@@ -1471,11 +1582,21 @@ static int do_execve_common(struct filename *filename,
if (IS_ERR(file))
goto out_unmark;
retval = bprm_mm_init(bprm);
if (retval)
goto out_unmark;
-@@ -1496,24 +1617,70 @@ static int do_execve_common(struct filename *filename,
+@@ -1492,24 +1613,70 @@ static int do_execve_common(struct filename *filename,
if (retval < 0)
goto out;
current->fs->in_exec = 0;
current->in_execve = 0;
acct_update_integrals(current);
-@@ -1524,6 +1691,14 @@ static int do_execve_common(struct filename *filename,
+@@ -1520,6 +1687,14 @@ static int do_execve_common(struct filename *filename,
put_files_struct(displaced);
return retval;
out:
if (bprm->mm) {
acct_arg_size(bprm, 0);
-@@ -1615,3 +1790,312 @@ COMPAT_SYSCALL_DEFINE3(execve, const char __user *, filename,
+@@ -1611,3 +1786,312 @@ COMPAT_SYSCALL_DEFINE3(execve, const char __user *, filename,
return compat_do_execve(getname(filename), argv, envp);
}
#endif
static int
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
-index fca3820..e1ea241 100644
+index 581ef40..cec52d7 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -553,8 +553,8 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi,
if (free_clusters >= (nclusters + dirty_clusters +
resv_clusters))
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
-index 1bbe7c3..c7442e2 100644
+index b0c225c..0e69bd7 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
-@@ -1276,19 +1276,19 @@ struct ext4_sb_info {
+@@ -1275,19 +1275,19 @@ struct ext4_sb_info {
unsigned long s_mb_last_start;
/* stats for buddy allocator */
/* locality groups */
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
-index c3e7418..f62cab3 100644
+index 8b0f9ef..cb9f620 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1901,7 +1901,7 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
}
free_percpu(sbi->s_locality_groups);
-@@ -3191,16 +3191,16 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac)
+@@ -3192,16 +3192,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) {
}
if (ac->ac_op == EXT4_MB_HISTORY_ALLOC)
-@@ -3627,7 +3627,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)
+@@ -3628,7 +3628,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);
ei = EXT4_I(ac->ac_inode);
grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
-@@ -3687,7 +3687,7 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac)
+@@ -3688,7 +3688,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);
grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
lg = ac->ac_lg;
-@@ -3776,7 +3776,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
+@@ -3777,7 +3777,7 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
* from the bitmap and continue.
*/
}
return err;
}
-@@ -3794,7 +3794,7 @@ ext4_mb_release_group_pa(struct ext4_buddy *e4b,
+@@ -3795,7 +3795,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);
"MMP failure info: last update time: %llu, last update "
"node: %s, last update device: %s\n",
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index beeb5c4..998c28d 100644
+index 0b28b36..b85d0f53 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1276,7 +1276,7 @@ static ext4_fsblk_t get_sb_block(void **data)
"Contact linux-ext4@vger.kernel.org if you think we should keep it.\n";
#ifdef CONFIG_QUOTA
-@@ -2464,7 +2464,7 @@ struct ext4_attr {
+@@ -2460,7 +2460,7 @@ struct ext4_attr {
int offset;
int deprecated_val;
} u;
static int
diff --git a/fs/fcntl.c b/fs/fcntl.c
-index 72c82f6..a18b263 100644
+index 22d1c3d..600cf7e 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
-@@ -106,6 +106,11 @@ int __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
+@@ -107,6 +107,11 @@ int __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
if (err)
return err;
.seq = SEQCNT_ZERO(init_fs.seq),
.umask = 0022,
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
-index aec01be..cf81ff9 100644
+index 89acec7..a575262 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -19,7 +19,7 @@
/* Only permit invalidation of data files. Invalidating an index will
* require the caller to release all its attachments to the tree rooted
-@@ -477,10 +477,10 @@ void __fscache_update_cookie(struct fscache_cookie *cookie)
+@@ -476,10 +476,10 @@ void __fscache_update_cookie(struct fscache_cookie *cookie)
{
struct fscache_object *object;
_leave(" [no cookie]");
return;
}
-@@ -581,12 +581,12 @@ EXPORT_SYMBOL(__fscache_disable_cookie);
+@@ -580,12 +580,12 @@ EXPORT_SYMBOL(__fscache_disable_cookie);
*/
void __fscache_relinquish_cookie(struct fscache_cookie *cookie, bool retire)
{
_leave(" [no cookie]");
return;
}
-@@ -687,7 +687,7 @@ int __fscache_check_consistency(struct fscache_cookie *cookie)
+@@ -686,7 +686,7 @@ int __fscache_check_consistency(struct fscache_cookie *cookie)
if (test_bit(FSCACHE_IOERROR, &object->cache->flags))
goto inconsistent;
__fscache_use_cookie(cookie);
if (fscache_submit_op(object, op) < 0)
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
-index bc6c08f..09c0d96 100644
+index 7872a62..d91b19f 100644
--- a/fs/fscache/internal.h
+++ b/fs/fscache/internal.h
-@@ -139,8 +139,8 @@ extern void fscache_operation_gc(struct work_struct *);
+@@ -137,8 +137,8 @@ extern void fscache_operation_gc(struct work_struct *);
extern int fscache_wait_for_deferred_lookup(struct fscache_cookie *);
extern int fscache_wait_for_operation_activation(struct fscache_object *,
struct fscache_operation *,
void (*)(struct fscache_operation *));
extern void fscache_invalidate_writes(struct fscache_cookie *);
-@@ -159,101 +159,101 @@ extern void fscache_proc_cleanup(void);
+@@ -157,101 +157,101 @@ extern void fscache_proc_cleanup(void);
* stats.c
*/
#ifdef CONFIG_FSCACHE_STATS
extern atomic_t fscache_n_cop_alloc_object;
extern atomic_t fscache_n_cop_lookup_object;
-@@ -278,6 +278,11 @@ static inline void fscache_stat(atomic_t *stat)
+@@ -276,6 +276,11 @@ static inline void fscache_stat(atomic_t *stat)
atomic_inc(stat);
}
static inline void fscache_stat_d(atomic_t *stat)
{
atomic_dec(stat);
-@@ -290,6 +295,7 @@ extern const struct file_operations fscache_stats_fops;
+@@ -288,6 +293,7 @@ extern const struct file_operations fscache_stats_fops;
#define __fscache_stat(stat) (NULL)
#define fscache_stat(stat) do {} while (0)
#endif
diff --git a/fs/fscache/object.c b/fs/fscache/object.c
-index d3b4539..ed0c659 100644
+index da032da..0076ce7 100644
--- a/fs/fscache/object.c
+++ b/fs/fscache/object.c
@@ -454,7 +454,7 @@ static const struct fscache_state *fscache_look_up_object(struct fscache_object
break;
default:
-@@ -992,7 +992,7 @@ static const struct fscache_state *fscache_invalidate_object(struct fscache_obje
+@@ -993,7 +993,7 @@ static const struct fscache_state *fscache_invalidate_object(struct fscache_obje
{
const struct fscache_state *s;
fscache_stat(&fscache_n_cop_invalidate_object);
s = _fscache_invalidate_object(object, event);
fscache_stat_d(&fscache_n_cop_invalidate_object);
-@@ -1007,7 +1007,7 @@ static const struct fscache_state *fscache_update_object(struct fscache_object *
+@@ -1008,7 +1008,7 @@ static const struct fscache_state *fscache_update_object(struct fscache_object *
{
_enter("{OBJ%x},%d", object->debug_id, event);
ASSERTCMP(atomic_read(&op->usage), ==, 0);
ASSERTCMP(op->state, ==, FSCACHE_OP_ST_DEAD);
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
-index ed70714..67f4982 100644
+index de33b3f..8be4d29 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
-@@ -61,7 +61,7 @@ try_again:
+@@ -74,7 +74,7 @@ try_again:
val = radix_tree_lookup(&cookie->stores, page->index);
if (!val) {
rcu_read_unlock();
__fscache_uncache_page(cookie, page);
return true;
}
-@@ -91,11 +91,11 @@ try_again:
+@@ -104,11 +104,11 @@ try_again:
spin_unlock(&cookie->stores_lock);
if (xpage) {
}
wake_up_bit(&cookie->flags, 0);
-@@ -110,11 +110,11 @@ page_busy:
+@@ -123,11 +123,11 @@ page_busy:
* sleeping on memory allocation, so we may need to impose a timeout
* too. */
if (!(gfp & __GFP_WAIT) || !(gfp & __GFP_FS)) {
- fscache_stat(&fscache_n_store_vmscan_wait);
+ fscache_stat_unchecked(&fscache_n_store_vmscan_wait);
- __fscache_wait_on_page_write(cookie, page);
- gfp &= ~__GFP_WAIT;
- goto try_again;
-@@ -140,7 +140,7 @@ static void fscache_end_page_write(struct fscache_object *object,
+ if (!release_page_wait_timeout(cookie, page))
+ _debug("fscache writeout timeout page: %p{%lx}",
+ page, page->index);
+@@ -156,7 +156,7 @@ static void fscache_end_page_write(struct fscache_object *object,
FSCACHE_COOKIE_STORING_TAG);
if (!radix_tree_tag_get(&cookie->stores, page->index,
FSCACHE_COOKIE_PENDING_TAG)) {
xpage = radix_tree_delete(&cookie->stores, page->index);
}
spin_unlock(&cookie->stores_lock);
-@@ -161,7 +161,7 @@ static void fscache_attr_changed_op(struct fscache_operation *op)
+@@ -177,7 +177,7 @@ static void fscache_attr_changed_op(struct fscache_operation *op)
_enter("{OBJ%x OP%x}", object->debug_id, op->debug_id);
if (fscache_object_is_active(object)) {
fscache_stat(&fscache_n_cop_attr_changed);
-@@ -188,11 +188,11 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
+@@ -204,11 +204,11 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX);
_leave(" = -ENOMEM");
return -ENOMEM;
}
-@@ -214,7 +214,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
+@@ -230,7 +230,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
if (fscache_submit_exclusive_op(object, op) < 0)
- goto nobufs;
+ goto nobufs_dec;
spin_unlock(&cookie->lock);
- fscache_stat(&fscache_n_attr_changed_ok);
+ fscache_stat_unchecked(&fscache_n_attr_changed_ok);
fscache_put_operation(op);
_leave(" = 0");
return 0;
-@@ -225,7 +225,7 @@ nobufs:
+@@ -242,7 +242,7 @@ nobufs:
kfree(op);
if (wake_cookie)
__fscache_wake_unused_cookie(cookie);
_leave(" = %d", -ENOBUFS);
return -ENOBUFS;
}
-@@ -264,7 +264,7 @@ static struct fscache_retrieval *fscache_alloc_retrieval(
+@@ -281,7 +281,7 @@ static struct fscache_retrieval *fscache_alloc_retrieval(
/* allocate a retrieval operation and attempt to submit it */
op = kzalloc(sizeof(*op), GFP_NOIO);
if (!op) {
return NULL;
}
-@@ -294,13 +294,13 @@ int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie)
+@@ -311,12 +311,12 @@ int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie)
return 0;
}
jif = jiffies;
if (wait_on_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP,
- fscache_wait_bit_interruptible,
TASK_INTERRUPTIBLE) != 0) {
- fscache_stat(&fscache_n_retrievals_intr);
+ fscache_stat_unchecked(&fscache_n_retrievals_intr);
_leave(" = -ERESTARTSYS");
return -ERESTARTSYS;
}
-@@ -329,8 +329,8 @@ static void fscache_do_cancel_retrieval(struct fscache_operation *_op)
+@@ -345,8 +345,8 @@ static void fscache_do_cancel_retrieval(struct fscache_operation *_op)
*/
int fscache_wait_for_operation_activation(struct fscache_object *object,
struct fscache_operation *op,
void (*do_cancel)(struct fscache_operation *))
{
int ret;
-@@ -340,7 +340,7 @@ int fscache_wait_for_operation_activation(struct fscache_object *object,
+@@ -356,7 +356,7 @@ int fscache_wait_for_operation_activation(struct fscache_object *object,
_debug(">>> WT");
if (stat_op_waits)
- fscache_stat(stat_op_waits);
+ fscache_stat_unchecked(stat_op_waits);
if (wait_on_bit(&op->flags, FSCACHE_OP_WAITING,
- fscache_wait_bit_interruptible,
TASK_INTERRUPTIBLE) != 0) {
-@@ -358,7 +358,7 @@ int fscache_wait_for_operation_activation(struct fscache_object *object,
+ ret = fscache_cancel_op(op, do_cancel);
+@@ -373,7 +373,7 @@ int fscache_wait_for_operation_activation(struct fscache_object *object,
check_if_dead:
if (op->state == FSCACHE_OP_ST_CANCELLED) {
if (stat_object_dead)
_leave(" = -ENOBUFS [cancelled]");
return -ENOBUFS;
}
-@@ -366,7 +366,7 @@ check_if_dead:
+@@ -381,7 +381,7 @@ check_if_dead:
pr_err("%s() = -ENOBUFS [obj dead %d]\n", __func__, op->state);
fscache_cancel_op(op, do_cancel);
if (stat_object_dead)
return -ENOBUFS;
}
return 0;
-@@ -394,7 +394,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
+@@ -409,7 +409,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
_enter("%p,%p,,,", cookie, page);
if (hlist_empty(&cookie->backing_objects))
goto nobufs;
-@@ -436,7 +436,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
+@@ -451,7 +451,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
goto nobufs_unlock_dec;
spin_unlock(&cookie->lock);
/* pin the netfs read context in case we need to do the actual netfs
* read because we've encountered a cache read failure */
-@@ -467,15 +467,15 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
+@@ -482,15 +482,15 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
error:
if (ret == -ENOMEM)
fscache_put_retrieval(op);
_leave(" = %d", ret);
-@@ -490,7 +490,7 @@ nobufs_unlock:
+@@ -505,7 +505,7 @@ nobufs_unlock:
__fscache_wake_unused_cookie(cookie);
kfree(op);
nobufs:
_leave(" = -ENOBUFS");
return -ENOBUFS;
}
-@@ -529,7 +529,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
+@@ -544,7 +544,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
_enter("%p,,%d,,,", cookie, *nr_pages);
if (hlist_empty(&cookie->backing_objects))
goto nobufs;
-@@ -567,7 +567,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
+@@ -582,7 +582,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
goto nobufs_unlock_dec;
spin_unlock(&cookie->lock);
/* pin the netfs read context in case we need to do the actual netfs
* read because we've encountered a cache read failure */
-@@ -598,15 +598,15 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
+@@ -613,15 +613,15 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
error:
if (ret == -ENOMEM)
fscache_put_retrieval(op);
_leave(" = %d", ret);
-@@ -621,7 +621,7 @@ nobufs_unlock:
+@@ -636,7 +636,7 @@ nobufs_unlock:
if (wake_cookie)
__fscache_wake_unused_cookie(cookie);
nobufs:
_leave(" = -ENOBUFS");
return -ENOBUFS;
}
-@@ -646,7 +646,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
+@@ -661,7 +661,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
_enter("%p,%p,,,", cookie, page);
if (hlist_empty(&cookie->backing_objects))
goto nobufs;
-@@ -680,7 +680,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
+@@ -695,7 +695,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
goto nobufs_unlock_dec;
spin_unlock(&cookie->lock);
ret = fscache_wait_for_operation_activation(
object, &op->op,
-@@ -697,11 +697,11 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
+@@ -712,11 +712,11 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
error:
if (ret == -ERESTARTSYS)
fscache_put_retrieval(op);
_leave(" = %d", ret);
-@@ -715,7 +715,7 @@ nobufs_unlock:
+@@ -730,7 +730,7 @@ nobufs_unlock:
if (wake_cookie)
__fscache_wake_unused_cookie(cookie);
nobufs:
_leave(" = -ENOBUFS");
return -ENOBUFS;
}
-@@ -791,7 +791,7 @@ static void fscache_write_op(struct fscache_operation *_op)
+@@ -806,7 +806,7 @@ static void fscache_write_op(struct fscache_operation *_op)
spin_lock(&cookie->stores_lock);
/* find a page to store */
page = NULL;
-@@ -802,7 +802,7 @@ static void fscache_write_op(struct fscache_operation *_op)
+@@ -817,7 +817,7 @@ static void fscache_write_op(struct fscache_operation *_op)
page = results[0];
_debug("gang %d [%lx]", n, page->index);
if (page->index > op->store_limit) {
goto superseded;
}
-@@ -814,7 +814,7 @@ static void fscache_write_op(struct fscache_operation *_op)
+@@ -829,7 +829,7 @@ static void fscache_write_op(struct fscache_operation *_op)
spin_unlock(&cookie->stores_lock);
spin_unlock(&object->lock);
fscache_stat(&fscache_n_cop_write_page);
ret = object->cache->ops->write_page(op, page);
fscache_stat_d(&fscache_n_cop_write_page);
-@@ -918,7 +918,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
+@@ -933,7 +933,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX);
ASSERT(PageFsCache(page));
if (test_bit(FSCACHE_COOKIE_INVALIDATING, &cookie->flags)) {
_leave(" = -ENOBUFS [invalidating]");
-@@ -977,7 +977,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
+@@ -992,7 +992,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
spin_unlock(&cookie->stores_lock);
spin_unlock(&object->lock);
op->store_limit = object->store_limit;
__fscache_use_cookie(cookie);
-@@ -986,8 +986,8 @@ int __fscache_write_page(struct fscache_cookie *cookie,
+@@ -1001,8 +1001,8 @@ int __fscache_write_page(struct fscache_cookie *cookie,
spin_unlock(&cookie->lock);
radix_tree_preload_end();
/* the work queue now carries its own ref on the object */
fscache_put_operation(&op->op);
-@@ -995,14 +995,14 @@ int __fscache_write_page(struct fscache_cookie *cookie,
+@@ -1010,14 +1010,14 @@ int __fscache_write_page(struct fscache_cookie *cookie,
return 0;
already_queued:
_leave(" = 0");
return 0;
-@@ -1024,14 +1024,14 @@ nobufs:
+@@ -1039,14 +1039,14 @@ nobufs:
kfree(op);
if (wake_cookie)
__fscache_wake_unused_cookie(cookie);
_leave(" = -ENOMEM");
return -ENOMEM;
}
-@@ -1049,7 +1049,7 @@ void __fscache_uncache_page(struct fscache_cookie *cookie, struct page *page)
+@@ -1064,7 +1064,7 @@ void __fscache_uncache_page(struct fscache_cookie *cookie, struct page *page)
ASSERTCMP(cookie->def->type, !=, FSCACHE_COOKIE_TYPE_INDEX);
ASSERTCMP(page, !=, NULL);
/* cache withdrawal may beat us to it */
if (!PageFsCache(page))
-@@ -1100,7 +1100,7 @@ void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page)
+@@ -1115,7 +1115,7 @@ void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page)
struct fscache_cookie *cookie = op->op.object->cookie;
#ifdef CONFIG_FSCACHE_STATS
}
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
-index 0c60482..025724f 100644
+index de1d84a..fd69c0c 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
-@@ -1485,7 +1485,7 @@ static char *read_link(struct dentry *dentry)
+@@ -1479,7 +1479,7 @@ static char *read_link(struct dentry *dentry)
return link;
}
if (!IS_ERR(link))
free_page((unsigned long) link);
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
-index bb529f3..454c253 100644
+index fd62cae..3494dfa 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
-@@ -898,7 +898,7 @@ static void *hostfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+@@ -908,7 +908,7 @@ static void *hostfs_follow_link(struct dentry *dentry, struct nameidata *nd)
static void hostfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
{
static int can_do_hugetlb_shm(void)
{
diff --git a/fs/inode.c b/fs/inode.c
-index 6eecb7f..abec305 100644
+index 26753ba..d19eb34 100644
--- a/fs/inode.c
+++ b/fs/inode.c
-@@ -839,16 +839,20 @@ unsigned int get_next_ino(void)
+@@ -840,16 +840,20 @@ unsigned int get_next_ino(void)
unsigned int *p = &get_cpu_var(last_ino);
unsigned int res = *p;
unsigned long hash = init_name_hash();
unsigned int len = strlen(name);
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
-index d895b4b..0b8af77 100644
+index 4429d6d..9831f52 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -34,7 +34,7 @@ static DEFINE_MUTEX(kernfs_open_file_mutex);
memcpy(c->data, &cookie, 4);
c->len=4;
diff --git a/fs/locks.c b/fs/locks.c
-index 717fbc4..74628c3 100644
+index bb08857..f65e8bf 100644
--- a/fs/locks.c
+++ b/fs/locks.c
-@@ -2327,7 +2327,7 @@ void locks_remove_file(struct file *filp)
- locks_remove_posix(filp, (fl_owner_t)filp);
+@@ -2350,7 +2350,7 @@ void locks_remove_file(struct file *filp)
+ locks_remove_posix(filp, filp);
if (filp->f_op->flock) {
- struct file_lock fl = {
+ struct file_lock flock = {
- .fl_owner = (fl_owner_t)filp,
+ .fl_owner = filp,
.fl_pid = current->tgid,
.fl_file = filp,
-@@ -2335,9 +2335,9 @@ void locks_remove_file(struct file *filp)
+@@ -2358,9 +2358,9 @@ void locks_remove_file(struct file *filp)
.fl_type = F_UNLCK,
.fl_end = OFFSET_MAX,
};
spin_lock(&inode->i_lock);
diff --git a/fs/mount.h b/fs/mount.h
-index d55297f..f5b28c5 100644
+index 6740a62..ccb472f 100644
--- a/fs/mount.h
+++ b/fs/mount.h
@@ -11,7 +11,7 @@ struct mnt_namespace {
int mnt_count;
@@ -57,7 +57,7 @@ struct mount {
int mnt_expiry_mark; /* true if marked for expiry */
- int mnt_pinned;
+ struct hlist_head mnt_pins;
struct path mnt_ex_mountpoint;
-};
+} __randomize_layout;
#define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */
diff --git a/fs/namei.c b/fs/namei.c
-index 9eb787e..5f520b67 100644
+index a7b05bf..9b251d4 100644
--- a/fs/namei.c
+++ b/fs/namei.c
-@@ -330,17 +330,32 @@ int generic_permission(struct inode *inode, int mask)
+@@ -331,17 +331,32 @@ int generic_permission(struct inode *inode, int mask)
if (ret != -EACCES)
return ret;
* Read/write DACs are always overridable.
* Executable DACs are overridable when there is
* at least one exec bit set.
-@@ -349,14 +364,6 @@ int generic_permission(struct inode *inode, int mask)
+@@ -350,14 +365,6 @@ int generic_permission(struct inode *inode, int mask)
if (capable_wrt_inode_uidgid(inode, CAP_DAC_OVERRIDE))
return 0;
return -EACCES;
}
EXPORT_SYMBOL(generic_permission);
-@@ -824,7 +831,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
+@@ -823,7 +830,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
{
struct dentry *dentry = link->dentry;
int error;
BUG_ON(nd->flags & LOOKUP_RCU);
-@@ -845,6 +852,12 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
+@@ -844,6 +851,12 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
if (error)
goto out_put_nd_path;
nd->last_type = LAST_BIND;
*p = dentry->d_inode->i_op->follow_link(dentry, nd);
error = PTR_ERR(*p);
-@@ -1596,6 +1609,8 @@ static inline int nested_symlink(struct path *path, struct nameidata *nd)
+@@ -1607,6 +1620,8 @@ static inline int nested_symlink(struct path *path, struct nameidata *nd)
if (res)
break;
res = walk_component(nd, path, LOOKUP_FOLLOW);
put_link(nd, &link, cookie);
} while (res > 0);
-@@ -1669,7 +1684,7 @@ EXPORT_SYMBOL(full_name_hash);
- static inline unsigned long hash_name(const char *name, unsigned int *hashp)
+@@ -1679,7 +1694,7 @@ EXPORT_SYMBOL(full_name_hash);
+ static inline u64 hash_name(const char *name)
{
unsigned long a, b, adata, bdata, mask, hash, len;
- const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
hash = a = 0;
len = -sizeof(unsigned long);
-@@ -1953,6 +1968,8 @@ static int path_lookupat(int dfd, const char *name,
+@@ -1968,6 +1983,8 @@ static int path_lookupat(int dfd, const char *name,
if (err)
break;
err = lookup_last(nd, &path);
put_link(nd, &link, cookie);
}
}
-@@ -1960,6 +1977,13 @@ static int path_lookupat(int dfd, const char *name,
+@@ -1975,6 +1992,13 @@ static int path_lookupat(int dfd, const char *name,
if (!err)
err = complete_walk(nd);
if (!err && nd->flags & LOOKUP_DIRECTORY) {
if (!d_can_lookup(nd->path.dentry)) {
path_put(&nd->path);
-@@ -1987,8 +2011,15 @@ static int filename_lookup(int dfd, struct filename *name,
+@@ -2002,8 +2026,15 @@ static int filename_lookup(int dfd, struct filename *name,
retval = path_lookupat(dfd, name->name,
flags | LOOKUP_REVAL, nd);
return retval;
}
-@@ -2570,6 +2601,13 @@ static int may_open(struct path *path, int acc_mode, int flag)
+@@ -2585,6 +2616,13 @@ static int may_open(struct path *path, int acc_mode, int flag)
if (flag & O_NOATIME && !inode_owner_or_capable(inode))
return -EPERM;
return 0;
}
-@@ -2801,7 +2839,7 @@ looked_up:
+@@ -2816,7 +2854,7 @@ looked_up:
* cleared otherwise prior to returning.
*/
static int lookup_open(struct nameidata *nd, struct path *path,
const struct open_flags *op,
bool got_write, int *opened)
{
-@@ -2836,6 +2874,17 @@ static int lookup_open(struct nameidata *nd, struct path *path,
+@@ -2851,6 +2889,17 @@ static int lookup_open(struct nameidata *nd, struct path *path,
/* Negative dentry, just create the file */
if (!dentry->d_inode && (op->open_flag & O_CREAT)) {
umode_t mode = op->mode;
if (!IS_POSIXACL(dir->d_inode))
mode &= ~current_umask();
/*
-@@ -2857,6 +2906,8 @@ static int lookup_open(struct nameidata *nd, struct path *path,
+@@ -2872,6 +2921,8 @@ static int lookup_open(struct nameidata *nd, struct path *path,
nd->flags & LOOKUP_EXCL);
if (error)
goto out_dput;
}
out_no_open:
path->dentry = dentry;
-@@ -2871,7 +2922,7 @@ out_dput:
+@@ -2886,7 +2937,7 @@ out_dput:
/*
* Handle the last step of open()
*/
struct file *file, const struct open_flags *op,
int *opened, struct filename *name)
{
-@@ -2921,6 +2972,15 @@ static int do_last(struct nameidata *nd, struct path *path,
+@@ -2936,6 +2987,15 @@ static int do_last(struct nameidata *nd, struct path *path,
if (error)
return error;
audit_inode(name, dir, LOOKUP_PARENT);
error = -EISDIR;
/* trailing slashes? */
-@@ -2940,7 +3000,7 @@ retry_lookup:
+@@ -2955,7 +3015,7 @@ retry_lookup:
*/
}
mutex_lock(&dir->d_inode->i_mutex);
mutex_unlock(&dir->d_inode->i_mutex);
if (error <= 0) {
-@@ -2964,11 +3024,28 @@ retry_lookup:
+@@ -2979,11 +3039,28 @@ retry_lookup:
goto finish_open_created;
}
/*
* If atomic_open() acquired write access it is dropped now due to
-@@ -3009,6 +3086,11 @@ finish_lookup:
+@@ -3024,6 +3101,11 @@ finish_lookup:
}
}
BUG_ON(inode != path->dentry->d_inode);
return 1;
}
-@@ -3018,7 +3100,6 @@ finish_lookup:
+@@ -3033,7 +3115,6 @@ finish_lookup:
save_parent.dentry = nd->path.dentry;
save_parent.mnt = mntget(path->mnt);
nd->path.dentry = path->dentry;
}
nd->inode = inode;
/* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */
-@@ -3028,7 +3109,18 @@ finish_open:
+@@ -3043,7 +3124,18 @@ finish_open:
path_put(&save_parent);
return error;
}
error = -EISDIR;
if ((open_flag & O_CREAT) && d_is_dir(nd->path.dentry))
goto out;
-@@ -3191,7 +3283,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
+@@ -3206,7 +3298,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
if (unlikely(error))
goto out;
while (unlikely(error > 0)) { /* trailing symlink */
struct path link = path;
void *cookie;
-@@ -3209,7 +3301,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
+@@ -3224,7 +3316,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
error = follow_link(&link, nd, &cookie);
if (unlikely(error))
break;
put_link(nd, &link, cookie);
}
out:
-@@ -3309,9 +3401,11 @@ struct dentry *kern_path_create(int dfd, const char *pathname,
+@@ -3324,9 +3416,11 @@ struct dentry *kern_path_create(int dfd, const char *pathname,
goto unlock;
error = -EEXIST;
/*
* Special case - lookup gave negative, but... we had foo/bar/
* From the vfs_mknod() POV we just have a negative dentry -
-@@ -3363,6 +3457,20 @@ struct dentry *user_path_create(int dfd, const char __user *pathname,
+@@ -3378,6 +3472,20 @@ struct dentry *user_path_create(int dfd, const char __user *pathname,
}
EXPORT_SYMBOL(user_path_create);
int vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev)
{
int error = may_create(dir, dentry);
-@@ -3426,6 +3534,17 @@ retry:
+@@ -3441,6 +3549,17 @@ retry:
if (!IS_POSIXACL(path.dentry->d_inode))
mode &= ~current_umask();
error = security_path_mknod(&path, dentry, mode, dev);
if (error)
goto out;
-@@ -3442,6 +3561,8 @@ retry:
+@@ -3456,6 +3575,8 @@ retry:
+ error = vfs_mknod(path.dentry->d_inode,dentry,mode,0);
break;
}
- out:
+ if (!error)
+ gr_handle_create(dentry, path.mnt);
+ out:
done_path_create(&path, dentry);
if (retry_estale(error, lookup_flags)) {
- lookup_flags |= LOOKUP_REVAL;
-@@ -3495,9 +3616,16 @@ retry:
+@@ -3510,9 +3631,16 @@ retry:
if (!IS_POSIXACL(path.dentry->d_inode))
mode &= ~current_umask();
done_path_create(&path, dentry);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
-@@ -3580,6 +3708,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
+@@ -3595,6 +3723,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
struct filename *name;
struct dentry *dentry;
struct nameidata nd;
unsigned int lookup_flags = 0;
retry:
name = user_path_parent(dfd, pathname, &nd, lookup_flags);
-@@ -3612,10 +3742,21 @@ retry:
+@@ -3627,10 +3757,21 @@ retry:
error = -ENOENT;
goto exit3;
}
exit3:
dput(dentry);
exit2:
-@@ -3706,6 +3847,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
+@@ -3721,6 +3862,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
struct nameidata nd;
struct inode *inode = NULL;
struct inode *delegated_inode = NULL;
unsigned int lookup_flags = 0;
retry:
name = user_path_parent(dfd, pathname, &nd, lookup_flags);
-@@ -3732,10 +3875,22 @@ retry_deleg:
+@@ -3747,10 +3890,22 @@ retry_deleg:
if (d_is_negative(dentry))
goto slashes;
ihold(inode);
exit2:
dput(dentry);
}
-@@ -3824,9 +3979,17 @@ retry:
+@@ -3839,9 +3994,17 @@ retry:
if (IS_ERR(dentry))
goto out_putname;
done_path_create(&path, dentry);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
-@@ -3930,6 +4093,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+@@ -3945,6 +4108,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
struct dentry *new_dentry;
struct path old_path, new_path;
struct inode *delegated_inode = NULL;
int how = 0;
int error;
-@@ -3953,7 +4117,7 @@ retry:
+@@ -3968,7 +4132,7 @@ retry:
if (error)
return error;
(how & LOOKUP_REVAL));
error = PTR_ERR(new_dentry);
if (IS_ERR(new_dentry))
-@@ -3965,11 +4129,28 @@ retry:
+@@ -3980,11 +4144,28 @@ retry:
error = may_linkat(&old_path);
if (unlikely(error))
goto out_dput;
done_path_create(&new_path, new_dentry);
if (delegated_inode) {
error = break_deleg_wait(&delegated_inode);
-@@ -4279,6 +4460,12 @@ retry_deleg:
+@@ -4295,6 +4476,12 @@ retry_deleg:
if (new_dentry == trap)
goto exit5;
error = security_path_rename(&oldnd.path, old_dentry,
&newnd.path, new_dentry, flags);
if (error)
-@@ -4286,6 +4473,9 @@ retry_deleg:
+@@ -4302,6 +4489,9 @@ retry_deleg:
error = vfs_rename(old_dir->d_inode, old_dentry,
new_dir->d_inode, new_dentry,
&delegated_inode, flags);
exit5:
dput(new_dentry);
exit4:
-@@ -4328,14 +4518,24 @@ SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newna
+@@ -4344,14 +4534,24 @@ SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newna
int readlink_copy(char __user *buffer, int buflen, const char *link)
{
out:
return len;
diff --git a/fs/namespace.c b/fs/namespace.c
-index 182bc41..72e3cf1 100644
+index ef42d9b..b8dfe4f 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
-@@ -1348,6 +1348,9 @@ static int do_umount(struct mount *mnt, int flags)
+@@ -1360,6 +1360,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);
return retval;
}
-@@ -1370,6 +1373,9 @@ static int do_umount(struct mount *mnt, int flags)
+@@ -1382,6 +1385,9 @@ static int do_umount(struct mount *mnt, int flags)
}
unlock_mount_hash();
namespace_unlock();
return retval;
}
-@@ -1389,7 +1395,7 @@ static inline bool may_mount(void)
+@@ -1401,7 +1407,7 @@ static inline bool may_mount(void)
* unixes. Our API is identical to OSF/1 to avoid making a mess of AMD
*/
{
struct path path;
struct mount *mnt;
-@@ -1431,7 +1437,7 @@ out:
+@@ -1443,7 +1449,7 @@ out:
/*
* The 2.0 compatible umount. No flags.
*/
{
return sys_umount(name, 0);
}
-@@ -2440,6 +2446,16 @@ long do_mount(const char *dev_name, const char *dir_name,
+@@ -2492,6 +2498,16 @@ long do_mount(const char *dev_name, const char *dir_name,
MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
MS_STRICTATIME);
if (flags & MS_REMOUNT)
retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
data_page);
-@@ -2454,6 +2470,9 @@ long do_mount(const char *dev_name, const char *dir_name,
+@@ -2506,6 +2522,9 @@ long do_mount(const char *dev_name, const char *dir_name,
dev_name, data_page);
dput_out:
path_put(&path);
return retval;
}
-@@ -2471,7 +2490,7 @@ static void free_mnt_ns(struct mnt_namespace *ns)
+@@ -2523,7 +2542,7 @@ static void free_mnt_ns(struct mnt_namespace *ns)
* number incrementing at 10Ghz will take 12,427 years to wrap which
* is effectively never, so we can ignore the possibility.
*/
static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
{
-@@ -2486,7 +2505,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
+@@ -2538,7 +2557,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
kfree(new_ns);
return ERR_PTR(ret);
}
atomic_set(&new_ns->count, 1);
new_ns->root = NULL;
INIT_LIST_HEAD(&new_ns->list);
-@@ -2496,7 +2515,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
+@@ -2548,7 +2567,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
return new_ns;
}
struct user_namespace *user_ns, struct fs_struct *new_fs)
{
struct mnt_namespace *new_ns;
-@@ -2617,8 +2636,8 @@ struct dentry *mount_subtree(struct vfsmount *mnt, const char *name)
+@@ -2669,8 +2688,8 @@ struct dentry *mount_subtree(struct vfsmount *mnt, const char *name)
}
EXPORT_SYMBOL(mount_subtree);
{
int ret;
char *kernel_type;
-@@ -2731,6 +2750,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
+@@ -2783,6 +2802,11 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
if (error)
goto out2;
get_fs_root(current->fs, &root);
old_mp = lock_mount(&old);
error = PTR_ERR(old_mp);
-@@ -2999,7 +3023,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns)
+@@ -2820,6 +2844,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
+ /* make sure we can reach put_old from new_root */
+ if (!is_path_reachable(old_mnt, old.dentry, &new))
+ goto out4;
++ /* make certain new is below the root */
++ if (!is_path_reachable(new_mnt, new.dentry, &root))
++ goto out4;
+ root_mp->m_count++; /* pin it so it won't go away */
+ lock_mount_hash();
+ detach_mnt(new_mnt, &parent_path);
+@@ -3051,7 +3078,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns)
!ns_capable(current_user_ns(), CAP_SYS_ADMIN))
return -EPERM;
static struct callback_op callback_ops[];
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
-index 9927913..faffc5c 100644
+index 577a36f..1cde799 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
-@@ -1219,16 +1219,16 @@ static int nfs_size_need_update(const struct inode *inode, const struct nfs_fatt
+@@ -1228,16 +1228,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);
}
void nfs_fattr_init(struct nfs_fattr *fattr)
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
-index 8f029db..3688b84 100644
+index 5e0dc52..64681bc 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
-@@ -1157,7 +1157,7 @@ struct nfsd4_operation {
+@@ -1155,7 +1155,7 @@ struct nfsd4_operation {
nfsd4op_rsize op_rsize_bop;
stateid_getter op_get_currentstateid;
stateid_setter op_set_currentstateid;
static struct nfsd4_operation nfsd4_ops[];
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
-index 944275c..6fc40a7 100644
+index b01f6e1..4aab09a 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
-@@ -1539,7 +1539,7 @@ nfsd4_decode_notsupp(struct nfsd4_compoundargs *argp, void *p)
+@@ -1534,7 +1534,7 @@ nfsd4_decode_notsupp(struct nfsd4_compoundargs *argp, void *p)
typedef __be32(*nfsd4_dec)(struct nfsd4_compoundargs *argp, void *);
[OP_CLOSE] = (nfsd4_dec)nfsd4_decode_close,
[OP_COMMIT] = (nfsd4_dec)nfsd4_decode_commit,
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
-index 6040da8..4348565 100644
+index ff95676..96cf3f62 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
-@@ -518,17 +518,20 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
+@@ -527,17 +527,20 @@ 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;
nfsd_reply_cache_free(rp);
return;
}
-@@ -536,7 +539,7 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
+@@ -545,7 +548,7 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
switch (cachetype) {
case RC_REPLSTAT:
if (len != 1)
break;
case RC_REPLBUFF:
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
-index 140c496..e9cbf14 100644
+index f501a9b..8155556 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
-@@ -855,7 +855,7 @@ int nfsd_readv(struct file *file, loff_t offset, struct kvec *vec, int vlen,
+@@ -855,7 +855,7 @@ __be32 nfsd_readv(struct file *file, loff_t offset, struct kvec *vec, int vlen,
oldfs = get_fs();
set_fs(KERNEL_DS);
set_fs(oldfs);
if (host_err < 0)
goto out_nfserr;
-@@ -1482,7 +1482,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
+@@ -1485,7 +1485,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp)
*/
oldfs = get_fs(); set_fs(KERNEL_DS);
}
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
-index 3fdc8a3..5888623 100644
+index b13992a..536c8d8 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -216,8 +216,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
goto out_close_fd;
#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
+diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
+index 0f88bc0..7d888d7 100644
+--- a/fs/notify/inotify/inotify_fsnotify.c
++++ b/fs/notify/inotify/inotify_fsnotify.c
+@@ -165,8 +165,10 @@ static void inotify_free_group_priv(struct fsnotify_group *group)
+ /* ideally the idr is empty and we won't hit the BUG in the callback */
+ idr_for_each(&group->inotify_data.idr, idr_callback, group);
+ idr_destroy(&group->inotify_data.idr);
+- atomic_dec(&group->inotify_data.user->inotify_devs);
+- free_uid(group->inotify_data.user);
++ if (group->inotify_data.user) {
++ atomic_dec(&group->inotify_data.user->inotify_devs);
++ free_uid(group->inotify_data.user);
++ }
+ }
+
+ static void inotify_free_event(struct fsnotify_event *fsn_event)
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
-index 1e58402..bb2d6f4 100644
+index a95d8e0..a91a5fd 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -48,7 +48,7 @@
"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 5c9e2c8..96e4ba0 100644
+index f5ec1ce..807fd78 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
-@@ -1282,7 +1282,7 @@ static inline size_t ntfs_copy_from_user(struct page **pages,
+@@ -1279,7 +1279,7 @@ static inline size_t ntfs_copy_from_user(struct page **pages,
char *addr;
size_t total = 0;
unsigned len;
}
}
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
-index ddb662b..f701c83 100644
+index 4142546..69375a9 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -300,11 +300,11 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len)
help
Various /proc files exist to monitor process memory utilization:
diff --git a/fs/proc/array.c b/fs/proc/array.c
-index 64db2bc..a8185d6 100644
+index cd3653e..9b9b79a 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -60,6 +60,7 @@
#include <linux/proc_fs.h>
#include <linux/ioport.h>
#include <linux/uaccess.h>
-@@ -356,6 +357,21 @@ static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
+@@ -347,6 +348,21 @@ static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
seq_putc(m, '\n');
}
int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task)
{
-@@ -374,9 +390,24 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
+@@ -365,9 +381,24 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
task_cpus_allowed(m, task);
cpuset_task_status_allowed(m, task);
task_context_switch_counts(m, task);
static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task, int whole)
{
-@@ -398,6 +429,13 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
+@@ -389,6 +420,13 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
char tcomm[sizeof(task->comm)];
unsigned long flags;
state = *get_task_state(task);
vsize = eip = esp = 0;
permitted = ptrace_may_access(task, PTRACE_MODE_READ | PTRACE_MODE_NOAUDIT);
-@@ -468,6 +506,19 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
+@@ -459,6 +497,19 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
gtime = task_gtime(task);
}
/* scale priority and nice values from timeslices to -20..20 */
/* to make it look like a "normal" Unix priority/nice value */
priority = task_prio(task);
-@@ -504,9 +555,15 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
+@@ -490,9 +541,15 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
seq_put_decimal_ull(m, ' ', vsize);
seq_put_decimal_ull(m, ' ', mm ? get_mm_rss(mm) : 0);
seq_put_decimal_ull(m, ' ', rsslim);
seq_put_decimal_ull(m, ' ', esp);
seq_put_decimal_ull(m, ' ', eip);
/* The signal information here is obsolete.
-@@ -528,7 +585,11 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
+@@ -514,7 +571,11 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
seq_put_decimal_ull(m, ' ', cputime_to_clock_t(gtime));
seq_put_decimal_ll(m, ' ', cputime_to_clock_t(cgtime));
seq_put_decimal_ull(m, ' ', mm->start_data);
seq_put_decimal_ull(m, ' ', mm->end_data);
seq_put_decimal_ull(m, ' ', mm->start_brk);
-@@ -566,8 +627,15 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
+@@ -552,8 +613,15 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task)
{
unsigned long size = 0, resident = 0, shared = 0, text = 0, data = 0;
if (mm) {
size = task_statm(mm, &shared, &text, &data, &resident);
mmput(mm);
-@@ -590,6 +658,13 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
+@@ -576,6 +644,20 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
return 0;
}
+#ifdef CONFIG_GRKERNSEC_PROC_IPADDR
-+int proc_pid_ipaddr(struct task_struct *task, char *buffer)
++int proc_pid_ipaddr(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task)
+{
-+ return sprintf(buffer, "%pI4\n", &task->signal->curr_ip);
++ unsigned long flags;
++ u32 curr_ip = 0;
++
++ if (lock_task_sighand(task, &flags)) {
++ curr_ip = task->signal->curr_ip;
++ unlock_task_sighand(task, &flags);
++ }
++ return seq_printf(m, "%pI4\n", &curr_ip);
+}
+#endif
+
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 2d696b0..b9da447 100644
+index baf852b..03fe930 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -113,6 +113,14 @@ struct pid_entry {
#define NOD(NAME, MODE, IOP, FOP, OP) { \
.name = (NAME), \
.len = sizeof(NAME) - 1, \
-@@ -205,12 +213,28 @@ static int proc_pid_cmdline(struct task_struct *task, char *buffer)
- return get_cmdline(task, buffer, PAGE_SIZE);
+@@ -208,12 +216,28 @@ static int proc_pid_cmdline(struct seq_file *m, struct pid_namespace *ns,
+ return 0;
}
+#ifdef CONFIG_GRKERNSEC_PROC_MEMMAP
+ _mm->pax_flags & MF_PAX_SEGMEXEC))
+#endif
+
- static int proc_pid_auxv(struct task_struct *task, char *buffer)
+ static int proc_pid_auxv(struct seq_file *m, struct pid_namespace *ns,
+ struct pid *pid, struct task_struct *task)
{
struct mm_struct *mm = mm_access(task, PTRACE_MODE_READ);
- int res = PTR_ERR(mm);
if (mm && !IS_ERR(mm)) {
unsigned int nwords = 0;
+
do {
nwords += 2;
} while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */
-@@ -224,7 +248,7 @@ static int proc_pid_auxv(struct task_struct *task, char *buffer)
+@@ -225,7 +249,7 @@ static int proc_pid_auxv(struct seq_file *m, struct pid_namespace *ns,
}
/*
* 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.
-@@ -263,7 +287,7 @@ static void unlock_trace(struct task_struct *task)
+@@ -265,7 +289,7 @@ static void unlock_trace(struct task_struct *task)
mutex_unlock(&task->signal->cred_guard_mutex);
}
#define MAX_STACK_TRACE_DEPTH 64
-@@ -486,7 +510,7 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)
- return count;
+@@ -487,7 +511,7 @@ static int proc_pid_limits(struct seq_file *m, struct pid_namespace *ns,
+ return 0;
}
-#ifdef CONFIG_HAVE_ARCH_TRACEHOOK
+#if defined(CONFIG_HAVE_ARCH_TRACEHOOK) && !defined(CONFIG_GRKERNSEC_PROC_MEMMAP)
- static int proc_pid_syscall(struct task_struct *task, char *buffer)
+ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns,
+ struct pid *pid, struct task_struct *task)
{
- long nr;
-@@ -515,7 +539,7 @@ static int proc_pid_syscall(struct task_struct *task, char *buffer)
+@@ -517,7 +541,7 @@ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns,
/************************************************************************/
/* permission checks */
{
struct task_struct *task;
int allowed = 0;
-@@ -525,7 +549,10 @@ static int proc_fd_access_allowed(struct inode *inode)
+@@ -527,7 +551,10 @@ static int proc_fd_access_allowed(struct inode *inode)
*/
task = get_proc_task(inode);
if (task) {
put_task_struct(task);
}
return allowed;
-@@ -556,10 +583,35 @@ static bool has_pid_permissions(struct pid_namespace *pid,
+@@ -558,10 +585,35 @@ static bool has_pid_permissions(struct pid_namespace *pid,
struct task_struct *task,
int hide_pid_min)
{
return ptrace_may_access(task, PTRACE_MODE_READ);
}
-@@ -577,7 +629,11 @@ static int proc_pid_permission(struct inode *inode, int mask)
+@@ -579,7 +631,11 @@ static int proc_pid_permission(struct inode *inode, int mask)
put_task_struct(task);
if (!has_perms) {
/*
* Let's make getdents(), stat(), and open()
* consistent with each other. If a process
-@@ -675,6 +731,11 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
+@@ -640,6 +696,11 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
if (!task)
return -ESRCH;
mm = mm_access(task, mode);
put_task_struct(task);
-@@ -690,6 +751,10 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
+@@ -655,6 +716,10 @@ static int __mem_open(struct inode *inode, struct file *file, unsigned int mode)
file->private_data = mm;
return 0;
}
-@@ -711,6 +776,17 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
+@@ -676,6 +741,17 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
ssize_t copied;
char *page;
if (!mm)
return 0;
-@@ -723,7 +799,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
+@@ -688,7 +764,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
goto free;
while (count > 0) {
if (write && copy_from_user(page, buf, this_len)) {
copied = -EFAULT;
-@@ -815,6 +891,13 @@ static ssize_t environ_read(struct file *file, char __user *buf,
+@@ -780,6 +856,13 @@ static ssize_t environ_read(struct file *file, char __user *buf,
if (!mm)
return 0;
page = (char *)__get_free_page(GFP_TEMPORARY);
if (!page)
return -ENOMEM;
-@@ -824,7 +907,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,
+@@ -789,7 +872,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,
goto free;
while (count > 0) {
size_t this_len, max_len;
if (src >= (mm->env_end - mm->env_start))
break;
-@@ -1438,7 +1521,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
+@@ -1403,7 +1486,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? */
goto out;
error = PROC_I(inode)->op.proc_get_link(dentry, &path);
-@@ -1482,8 +1565,18 @@ static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int b
+@@ -1447,8 +1530,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? */
error = PROC_I(inode)->op.proc_get_link(dentry, &path);
if (error)
-@@ -1533,7 +1626,11 @@ struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *t
+@@ -1498,7 +1591,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;
rcu_read_unlock();
}
security_task_to_inode(task, inode);
-@@ -1569,10 +1666,19 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
+@@ -1534,10 +1631,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)) ||
}
}
rcu_read_unlock();
-@@ -1610,11 +1716,20 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags)
+@@ -1575,11 +1681,20 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags)
if (task) {
if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) ||
rcu_read_unlock();
} else {
inode->i_uid = GLOBAL_ROOT_UID;
-@@ -2149,6 +2264,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
+@@ -2114,6 +2229,9 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
if (!task)
goto out_no_task;
/*
* Yes, it does not scale. And it should not. Don't add
* new entries into /proc/<tgid>/ without very good reasons.
-@@ -2179,6 +2297,9 @@ static int proc_pident_readdir(struct file *file, struct dir_context *ctx,
+@@ -2144,6 +2262,9 @@ static int proc_pident_readdir(struct file *file, struct dir_context *ctx,
if (!task)
return -ENOENT;
if (!dir_emit_dots(file, ctx))
goto out;
-@@ -2568,7 +2689,7 @@ static const struct pid_entry tgid_base_stuff[] = {
+@@ -2535,7 +2656,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),
-#ifdef CONFIG_HAVE_ARCH_TRACEHOOK
+#if defined(CONFIG_HAVE_ARCH_TRACEHOOK) && !defined(CONFIG_GRKERNSEC_PROC_MEMMAP)
- INF("syscall", S_IRUSR, proc_pid_syscall),
+ ONE("syscall", S_IRUSR, proc_pid_syscall),
#endif
- INF("cmdline", S_IRUGO, proc_pid_cmdline),
-@@ -2593,10 +2714,10 @@ static const struct pid_entry tgid_base_stuff[] = {
+ ONE("cmdline", S_IRUGO, proc_pid_cmdline),
+@@ -2560,10 +2681,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
-#ifdef CONFIG_KALLSYMS
+#if defined(CONFIG_KALLSYMS) && !defined(CONFIG_GRKERNSEC_HIDESYM)
- INF("wchan", S_IRUGO, proc_pid_wchan),
+ ONE("wchan", S_IRUGO, proc_pid_wchan),
#endif
-#ifdef CONFIG_STACKTRACE
+#if defined(CONFIG_STACKTRACE) && !defined(CONFIG_GRKERNSEC_HIDESYM)
ONE("stack", S_IRUSR, proc_pid_stack),
#endif
#ifdef CONFIG_SCHEDSTATS
-@@ -2630,6 +2751,9 @@ static const struct pid_entry tgid_base_stuff[] = {
+@@ -2597,6 +2718,9 @@ static const struct pid_entry tgid_base_stuff[] = {
#ifdef CONFIG_HARDWALL
- INF("hardwall", S_IRUGO, proc_pid_hardwall),
+ ONE("hardwall", S_IRUGO, proc_pid_hardwall),
#endif
+#ifdef CONFIG_GRKERNSEC_PROC_IPADDR
-+ INF("ipaddr", S_IRUSR, proc_pid_ipaddr),
++ ONE("ipaddr", S_IRUSR, proc_pid_ipaddr),
+#endif
#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),
-@@ -2760,7 +2884,14 @@ static int proc_pid_instantiate(struct inode *dir,
+@@ -2727,7 +2851,14 @@ static int proc_pid_instantiate(struct inode *dir,
if (!inode)
goto out;
inode->i_op = &proc_tgid_base_inode_operations;
inode->i_fop = &proc_tgid_base_operations;
inode->i_flags|=S_IMMUTABLE;
-@@ -2798,7 +2929,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, unsign
+@@ -2765,7 +2896,11 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, unsign
if (!task)
goto out;
put_task_struct(task);
out:
return ERR_PTR(result);
-@@ -2904,7 +3039,7 @@ static const struct pid_entry tid_base_stuff[] = {
+@@ -2879,7 +3014,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),
-#ifdef CONFIG_HAVE_ARCH_TRACEHOOK
+#if defined(CONFIG_HAVE_ARCH_TRACEHOOK) && !defined(CONFIG_GRKERNSEC_PROC_MEMMAP)
- INF("syscall", S_IRUSR, proc_pid_syscall),
+ ONE("syscall", S_IRUSR, proc_pid_syscall),
#endif
- INF("cmdline", S_IRUGO, proc_pid_cmdline),
-@@ -2931,10 +3066,10 @@ static const struct pid_entry tid_base_stuff[] = {
+ ONE("cmdline", S_IRUGO, proc_pid_cmdline),
+@@ -2906,10 +3041,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
-#ifdef CONFIG_KALLSYMS
+#if defined(CONFIG_KALLSYMS) && !defined(CONFIG_GRKERNSEC_HIDESYM)
- INF("wchan", S_IRUGO, proc_pid_wchan),
+ ONE("wchan", S_IRUGO, proc_pid_wchan),
#endif
-#ifdef CONFIG_STACKTRACE
+#if defined(CONFIG_STACKTRACE) && !defined(CONFIG_GRKERNSEC_HIDESYM)
}
fs_initcall(proc_devices_init);
diff --git a/fs/proc/fd.c b/fs/proc/fd.c
-index 0788d09..9cc1385 100644
+index 955bb55..71948bd 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -26,7 +26,8 @@ static int seq_show(struct seq_file *m, void *v)
}
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
-index b7f268e..3bea6b7 100644
+index 317b726..e329aed 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -23,6 +23,7 @@
struct proc_dir_entry *parent,
const struct file_operations *proc_fops,
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
-index 0adbc02..bee4d0b 100644
+index 333080d..0a35ec4 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -23,11 +23,17 @@
if (de->size)
inode->i_size = de->size;
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
-index 3ab6d14..b26174e 100644
+index 7da13e4..68d0981 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -46,9 +46,10 @@ struct proc_dir_entry {
union proc_op {
int (*proc_get_link)(struct dentry *, struct path *);
-@@ -67,7 +68,7 @@ struct proc_inode {
+@@ -66,7 +67,7 @@ struct proc_inode {
struct ctl_table *sysctl_entry;
struct proc_ns ns;
struct inode vfs_inode;
/*
* General functions
-@@ -155,6 +156,9 @@ extern int proc_pid_status(struct seq_file *, struct pid_namespace *,
+@@ -154,6 +155,10 @@ 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);
++extern int proc_pid_ipaddr(struct seq_file *, struct pid_namespace *,
++ struct pid *, struct task_struct *);
+#endif
/*
* base.c
-@@ -181,9 +185,11 @@ extern bool proc_fill_cache(struct file *, struct dir_context *, const char *, i
- extern spinlock_t proc_subdir_lock;
-
+@@ -178,9 +183,11 @@ extern bool proc_fill_cache(struct file *, struct dir_context *, const char *, i
+ * generic.c
+ */
extern struct dentry *proc_lookup(struct inode *, struct dentry *, unsigned int);
+extern struct dentry *proc_lookup_restrict(struct inode *, struct dentry *, unsigned int);
extern struct dentry *proc_lookup_de(struct proc_dir_entry *, struct inode *,
}
fs_initcall(proc_interrupts_init);
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
-index 39e6ef3..2f9cb5e 100644
+index 6df8d07..3321060 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -483,9 +483,10 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
return -EPERM;
if (kcore_need_update)
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
-index 7445af0..7c5113c 100644
+index aa1eee0..03dda72 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -187,7 +187,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
seq_putc(m, '\n');
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
-index 4677bb7..dad3045 100644
+index a63af3e..b4f262a 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -23,9 +23,27 @@
net = get_proc_net(inode);
if (net == NULL)
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
-index 7129046..6914844 100644
+index f92d5dd..26398ac 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -11,13 +11,21 @@
d_add(child, inode);
}
} else {
-@@ -641,6 +677,9 @@ static int scan(struct ctl_table_header *head, ctl_table *table,
+@@ -641,6 +677,9 @@ static int scan(struct ctl_table_header *head, struct ctl_table *table,
if ((*pos)++ < ctx->pos)
return true;
kfree(ctl_table_arg);
goto out;
diff --git a/fs/proc/root.c b/fs/proc/root.c
-index 5dbadec..473af2f 100644
+index 094e44d..085a877 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
-@@ -185,7 +185,15 @@ void __init proc_root_init(void)
+@@ -188,7 +188,15 @@ void __init proc_root_init(void)
proc_mkdir("openprom", NULL);
#endif
proc_tty_init();
seq_printf(p, "softirq %llu", (unsigned long long)sum_softirq);
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index cfa63ee..fce112e 100644
+index c341568..75852a2 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -13,12 +13,19 @@
mss.resident >> 10,
(unsigned long)(mss.pss >> (10 + PSS_SHIFT)),
mss.shared_clean >> 10,
-@@ -1398,6 +1449,13 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
+@@ -1422,6 +1473,13 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
char buffer[64];
int nid;
if (!mm)
return 0;
-@@ -1415,11 +1473,15 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
+@@ -1439,11 +1497,15 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
mpol_to_str(buffer, sizeof(buffer), pol);
mpol_cond_put(pol);
pid_t tid = vm_is_stack(priv->task, vma, is_pid);
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
-index 382aa89..6b03974 100644
+index a90d6d35..d08047c 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -105,9 +105,13 @@ static ssize_t read_from_oldmem(char *buf, size_t count,
/*
diff --git a/fs/qnx6/qnx6.h b/fs/qnx6/qnx6.h
-index b00fcc9..e0c6381 100644
+index d3fb2b6..43a8140 100644
--- a/fs/qnx6/qnx6.h
+++ b/fs/qnx6/qnx6.h
@@ -74,7 +74,7 @@ enum {
if (sbi->s_bytesex == BYTESEX_LE)
return le32_to_cpu((__force __le32)n);
diff --git a/fs/quota/netlink.c b/fs/quota/netlink.c
-index 72d2917..c917c12 100644
+index bb2869f..d34ada8 100644
--- a/fs/quota/netlink.c
+++ b/fs/quota/netlink.c
-@@ -45,7 +45,7 @@ static struct genl_family quota_genl_family = {
+@@ -44,7 +44,7 @@ static struct genl_family quota_genl_family = {
void quota_send_warning(struct kqid qid, dev_t dev,
const char warntype)
{
struct sk_buff *skb;
void *msg_head;
int ret;
-@@ -61,7 +61,7 @@ void quota_send_warning(struct kqid qid, dev_t dev,
+@@ -60,7 +60,7 @@ void quota_send_warning(struct kqid qid, dev_t dev,
"VFS: Not enough memory to send quota warning.\n");
return;
}
if (error >= 0)
error = buf.error;
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
-index 54fdf19..987862b 100644
+index 9c02d96..6562c10 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
-@@ -1872,7 +1872,7 @@ void do_balance(struct tree_balance *tb, struct item_head *ih,
+@@ -1887,7 +1887,7 @@ void do_balance(struct tree_balance *tb, struct item_head *ih,
return;
}
/*
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
-index cfaee91..b9d0d60 100644
+index aca73dd..e3c558d 100644
--- a/fs/reiserfs/item_ops.c
+++ b/fs/reiserfs/item_ops.c
@@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
#if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
-index 02b0b7d..c85018b 100644
+index 621b9f3..af527fd 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -114,7 +114,7 @@ static int show_super(struct seq_file *m, void *unused)
SF(s_do_balance), SF(s_unneeded_left_neighbor),
SF(s_good_search_by_key_reada), SF(s_bmaps),
diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h
-index bf53888..227f5ae 100644
+index 735c2c2..81b91af 100644
--- a/fs/reiserfs/reiserfs.h
+++ b/fs/reiserfs/reiserfs.h
@@ -573,7 +573,7 @@ struct reiserfs_sb_info {
generic_fillattr(inode, stat);
return 0;
+diff --git a/fs/super.c b/fs/super.c
+index b9a214d..6f8c954 100644
+--- a/fs/super.c
++++ b/fs/super.c
+@@ -80,6 +80,8 @@ static unsigned long super_cache_scan(struct shrinker *shrink,
+ inodes = list_lru_count_node(&sb->s_inode_lru, sc->nid);
+ dentries = list_lru_count_node(&sb->s_dentry_lru, sc->nid);
+ total_objects = dentries + inodes + fs_objects + 1;
++ if (!total_objects)
++ total_objects = 1;
+
+ /* proportion the scan between the caches */
+ dentries = mult_frac(sc->nr_to_scan, dentries, total_objects);
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 0b45ff4..847de5b 100644
--- a/fs/sysfs/dir.c
if (sbi->s_bytesex == BYTESEX_PDP)
return PDP_swab((__force __u32)n);
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c
-index 2290d58..7791371 100644
+index fb08b0c..65fcc7e 100644
--- a/fs/ubifs/io.c
+++ b/fs/ubifs/io.c
@@ -155,7 +155,7 @@ int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len)
mnt_drop_write_file(f.file);
}
fdput(f);
-diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
-index 75c3fe5..b0f6bbe 100644
---- a/fs/xfs/xfs_bmap.c
-+++ b/fs/xfs/xfs_bmap.c
+diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
+index 86df952..ac430d6 100644
+--- a/fs/xfs/libxfs/xfs_bmap.c
++++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -583,7 +583,7 @@ xfs_bmap_validate_ret(
#else
/*
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
-index 48e99af..54ebae3 100644
+index f1b69ed..3d0222f 100644
--- a/fs/xfs/xfs_dir2_readdir.c
+++ b/fs/xfs/xfs_dir2_readdir.c
@@ -159,7 +159,12 @@ xfs_dir2_sf_getdents(
return 0;
sfep = dp->d_ops->sf_nextentry(sfp, sfep);
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
-index 8bc1bbc..0d6911b 100644
+index 3799695..0ddc953 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -122,7 +122,7 @@ xfs_find_handle(
diff --git a/grsecurity/Kconfig b/grsecurity/Kconfig
new file mode 100644
-index 0000000..27cec32
+index 0000000..f27264e
--- /dev/null
+++ b/grsecurity/Kconfig
@@ -0,0 +1,1166 @@
+ you may not be able to boot into a graphical environment with this
+ option enabled. In this case, you should use the RBAC system instead.
+
-+config GRKERNSEC_JIT_HARDEN
-+ bool "Harden BPF JIT against spray attacks"
++config GRKERNSEC_BPF_HARDEN
++ bool "Harden BPF interpreter"
+ default y if GRKERNSEC_CONFIG_AUTO
-+ depends on BPF_JIT && X86
+ help
-+ If you say Y here, the native code generated by the kernel's Berkeley
-+ Packet Filter (BPF) JIT engine will be hardened against JIT-spraying
-+ attacks that attempt to fit attacker-beneficial instructions in
-+ 32bit immediate fields of JIT-generated native instructions. The
-+ attacker will generally aim to cause an unintended instruction sequence
-+ of JIT-generated native code to execute by jumping into the middle of
-+ a generated instruction. This feature effectively randomizes the 32bit
-+ immediate constants present in the generated code to thwart such attacks.
++ Unlike previous versions of grsecurity that hardened both the BPF
++ interpreted code against corruption at rest as well as the JIT code
++ against JIT-spray attacks and attacker-controlled immediate values
++ for ROP, this feature will enforce disabling of the new eBPF JIT engine
++ and will ensure the interpreted code is read-only at rest. This feature
++ may be removed at a later time when eBPF stabilizes to entirely revert
++ back to the more secure pre-3.16 BPF interpreter/JIT.
+
+ If you're using KERNEXEC, it's recommended that you enable this option
+ to supplement the hardening of the kernel.
+ If you say Y here, neither TCP resets nor ICMP
+ destination-unreachable packets will be sent in response to packets
+ sent to ports for which no associated listening process exists.
++ It will also prevent the sending of ICMP protocol unreachable packets
++ in response to packets with unknown protocols.
+ This feature supports both IPV4 and IPV6 and exempts the
+ loopback interface from blackholing. Enabling this feature
+ makes a host more resilient to DoS attacks and reduces network
+endif
diff --git a/grsecurity/gracl.c b/grsecurity/gracl.c
new file mode 100644
-index 0000000..58223f6
+index 0000000..6ae3aa0
--- /dev/null
+++ b/grsecurity/gracl.c
-@@ -0,0 +1,2702 @@
+@@ -0,0 +1,2703 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+ __u8 whr, chr;
+ __u8 wmin, cmin;
+ __u8 wsec, csec;
-+ struct timespec timeval;
++ struct timespec curtime, starttime;
+
+ if (unlikely(!(gr_status & GR_READY) || !task->acl ||
+ !(task->acl->mode & GR_PROCACCT)))
+ return;
-+
-+ do_posix_clock_monotonic_gettime(&timeval);
-+ runtime = timeval.tv_sec - task->start_time.tv_sec;
++
++ curtime = ns_to_timespec(ktime_get_ns());
++ starttime = ns_to_timespec(task->start_time);
++ runtime = curtime.tv_sec - starttime.tv_sec;
+ wday = runtime / (60 * 60 * 24);
+ runtime -= wday * (60 * 60 * 24);
+ whr = runtime / (60 * 60);
+}
diff --git a/grsecurity/gracl_shm.c b/grsecurity/gracl_shm.c
new file mode 100644
-index 0000000..98011b0
+index 0000000..6b0c9cc
--- /dev/null
+++ b/grsecurity/gracl_shm.c
@@ -0,0 +1,40 @@
+
+int
+gr_handle_shmat(const pid_t shm_cprid, const pid_t shm_lapid,
-+ const time_t shm_createtime, const kuid_t cuid, const int shmid)
++ const u64 shm_createtime, const kuid_t cuid, const int shmid)
+{
+ struct task_struct *task;
+
+ if (unlikely(!task))
+ task = find_task_by_vpid(shm_lapid);
+
-+ if (unlikely(task && (time_before_eq((unsigned long)task->start_time.tv_sec, (unsigned long)shm_createtime) ||
++ if (unlikely(task && (time_before_eq64(task->start_time, shm_createtime) ||
+ (task_pid_nr(task) == shm_lapid)) &&
+ (task->acl->mode & GR_PROTSHM) &&
+ (task->acl != current->acl))) {
+}
diff --git a/grsecurity/grsec_chroot.c b/grsecurity/grsec_chroot.c
new file mode 100644
-index 0000000..baa635c
+index 0000000..6d99cec
--- /dev/null
+++ b/grsecurity/grsec_chroot.c
-@@ -0,0 +1,387 @@
+@@ -0,0 +1,385 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+
+int
+gr_chroot_shmat(const pid_t shm_cprid, const pid_t shm_lapid,
-+ const time_t shm_createtime)
++ const u64 shm_createtime)
+{
+#ifdef CONFIG_GRKERNSEC_CHROOT_SHMAT
+ struct task_struct *p;
-+ time_t starttime;
+
+ if (unlikely(!grsec_enable_chroot_shmat))
+ return 1;
+ read_lock(&tasklist_lock);
+
+ if ((p = find_task_by_vpid_unrestricted(shm_cprid))) {
-+ starttime = p->start_time.tv_sec;
-+ if (time_before_eq((unsigned long)starttime, (unsigned long)shm_createtime)) {
++ if (time_before_eq64(p->start_time, shm_createtime)) {
+ if (have_same_root(current, p)) {
+ goto allow;
+ } else {
+}
diff --git a/grsecurity/grsec_disabled.c b/grsecurity/grsec_disabled.c
new file mode 100644
-index 0000000..2d3bcb7
+index 0000000..0f9ac91
--- /dev/null
+++ b/grsecurity/grsec_disabled.c
@@ -0,0 +1,440 @@
+
+int
+gr_handle_shmat(const pid_t shm_cprid, const pid_t shm_lapid,
-+ const time_t shm_createtime, const kuid_t cuid, const int shmid)
++ const u64 shm_createtime, const kuid_t cuid, const int shmid)
+{
+ return 1;
+}
+}
diff --git a/grsecurity/grsec_sock.c b/grsecurity/grsec_sock.c
new file mode 100644
-index 0000000..c0aef3a
+index 0000000..e3650b6
--- /dev/null
+++ b/grsecurity/grsec_sock.c
@@ -0,0 +1,244 @@
+
+#endif
+
-+void gr_update_task_in_ip_table(struct task_struct *task, const struct inet_sock *inet)
++void gr_update_task_in_ip_table(const struct inet_sock *inet)
+{
+#ifdef CONFIG_GRKERNSEC
-+ struct signal_struct *sig = task->signal;
++ struct signal_struct *sig = current->signal;
+ struct conn_table_entry *newent;
+
+ newent = kmalloc(sizeof(struct conn_table_entry), GFP_ATOMIC);
+
#endif /* __ASM_GENERIC_UACCESS_H */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
-index c1c0b0c..05c9588 100644
+index 5ba0360..e85c934 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -231,6 +231,7 @@
*(__vermagic) /* Kernel version magic */ \
. = ALIGN(8); \
VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \
-@@ -719,17 +720,18 @@
+@@ -722,17 +723,18 @@
* section in the linker script will go there too. @phdr should have
* a leading colon.
*
/**
* PERCPU_SECTION - define output section for percpu area, simple version
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
-index 016c2f1..c4baa98 100644
+index 623a59c..1e79ab9 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -34,7 +34,7 @@ struct crypto_type {
struct crypto_instance {
struct crypto_alg alg;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
-index 8af71a8..7fe6c19 100644
+index 1968907..7d9ed9f 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -68,6 +68,7 @@
#include <drm/drm.h>
#include <drm/drm_sarea.h>
#include <drm/drm_vma_manager.h>
-@@ -261,10 +262,12 @@ do { \
+@@ -260,10 +261,12 @@ do { \
* \param cmd command.
* \param arg argument.
*/
unsigned long arg);
#define DRM_IOCTL_NR(n) _IOC_NR(n)
-@@ -280,10 +283,10 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
+@@ -279,10 +282,10 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
struct drm_ioctl_desc {
unsigned int cmd;
int flags;
/**
* Creates a driver or general drm_ioctl_desc array entry for the given
-@@ -983,7 +986,8 @@ struct drm_info_list {
+@@ -946,7 +949,8 @@ struct drm_info_list {
int (*show)(struct seq_file*, void*); /** show callback */
u32 driver_features; /**< Required driver features for this entry */
void *data;
/**
* debugfs node structure. This structure represents a debugfs file.
-@@ -1067,7 +1071,7 @@ struct drm_device {
+@@ -1030,7 +1034,7 @@ struct drm_device {
/** \name Usage Counters */
/*@{ */
struct atmphy_ops {
int (*start)(struct atm_dev *dev);
diff --git a/include/linux/audit.h b/include/linux/audit.h
-index 22cfddb..ab759e8 100644
+index 22cfddb..1514eef 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
+@@ -86,7 +86,7 @@ extern unsigned compat_dir_class[];
+ extern unsigned compat_chattr_class[];
+ extern unsigned compat_signal_class[];
+
+-extern int __weak audit_classify_compat_syscall(int abi, unsigned syscall);
++extern int audit_classify_compat_syscall(int abi, unsigned syscall);
+
+ /* audit_names->type values */
+ #define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */
@@ -210,7 +210,7 @@ static inline void audit_ptrace(struct task_struct *t)
extern unsigned int audit_serial(void);
extern int auditsc_get_stamp(struct audit_context *ctx,
if (sizeof(l) == 4)
return fls(l);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
-index 8699bcf..279485d 100644
+index 518b465..11953e6 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
-@@ -1625,7 +1625,7 @@ struct block_device_operations {
+@@ -1627,7 +1627,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;
#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
#endif
diff --git a/include/linux/capability.h b/include/linux/capability.h
-index 84b13ad..172cdee 100644
+index aa93e5e..985a1b0 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
-@@ -211,9 +211,14 @@ extern bool has_ns_capability_noaudit(struct task_struct *t,
+@@ -214,9 +214,14 @@ extern bool has_ns_capability_noaudit(struct task_struct *t,
extern bool capable(int cap);
extern bool ns_capable(struct user_namespace *ns, int cap);
extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
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 0c287db..5efa775 100644
+index 411dd7e..ee38878 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -180,6 +180,7 @@ struct clk_ops {
/**
* struct clk_init_data - holds init data that's common to all clocks and is
+diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
+index 653f0e2..abcafaa 100644
+--- a/include/linux/clocksource.h
++++ b/include/linux/clocksource.h
+@@ -287,7 +287,7 @@ extern struct clocksource* clocksource_get_next(void);
+ extern void clocksource_change_rating(struct clocksource *cs, int rating);
+ extern void clocksource_suspend(void);
+ extern void clocksource_resume(void);
+-extern struct clocksource * __init __weak clocksource_default_clock(void);
++extern struct clocksource * __init clocksource_default_clock(void);
+ extern void clocksource_mark_unstable(struct clocksource *cs);
+
+ extern u64
diff --git a/include/linux/compat.h b/include/linux/compat.h
index e649426..a74047b 100644
--- a/include/linux/compat.h
/*
* Users often need to create attribute structures for their configurable
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
-index 8f8ae95..b9b0e6d 100644
+index 7d1955a..d86a3ca 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
-@@ -202,6 +202,7 @@ struct global_attr {
+@@ -203,6 +203,7 @@ struct global_attr {
ssize_t (*store)(struct kobject *a, struct attribute *b,
const char *c, size_t count);
};
#define define_one_global_ro(_name) \
static struct global_attr _name = \
-@@ -268,7 +269,7 @@ struct cpufreq_driver {
+@@ -269,7 +270,7 @@ struct cpufreq_driver {
bool boost_supported;
bool boost_enabled;
int (*set_boost) (int state);
int cpumask_any_but(const struct cpumask *mask, unsigned int cpu);
int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp);
+diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
+index 72ab536..3849fce 100644
+--- a/include/linux/crash_dump.h
++++ b/include/linux/crash_dump.h
+@@ -14,14 +14,13 @@
+ extern unsigned long long elfcorehdr_addr;
+ extern unsigned long long elfcorehdr_size;
+
+-extern int __weak elfcorehdr_alloc(unsigned long long *addr,
+- unsigned long long *size);
+-extern void __weak elfcorehdr_free(unsigned long long addr);
+-extern ssize_t __weak elfcorehdr_read(char *buf, size_t count, u64 *ppos);
+-extern ssize_t __weak elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos);
+-extern int __weak remap_oldmem_pfn_range(struct vm_area_struct *vma,
+- unsigned long from, unsigned long pfn,
+- unsigned long size, pgprot_t prot);
++extern int elfcorehdr_alloc(unsigned long long *addr, unsigned long long *size);
++extern void elfcorehdr_free(unsigned long long addr);
++extern ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos);
++extern ssize_t elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos);
++extern int remap_oldmem_pfn_range(struct vm_area_struct *vma,
++ unsigned long from, unsigned long pfn,
++ unsigned long size, pgprot_t prot);
+
+ extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
+ unsigned long, int);
diff --git a/include/linux/cred.h b/include/linux/cred.h
-index f61d6c8..d372d95 100644
+index b2d0820..2ecafd3 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -35,7 +35,7 @@ struct group_info {
#endif
/**
-@@ -322,6 +325,7 @@ static inline void put_cred(const struct cred *_cred)
+@@ -331,6 +334,7 @@ static inline void put_cred(const struct cred *_cred)
#define task_uid(task) (task_cred_xxx((task), uid))
#define task_euid(task) (task_cred_xxx((task), euid))
#define current_cred_xxx(xxx) \
({ \
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
-index b92eadf..b4ecdc1 100644
+index d45e949..51cf5ea 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -373,7 +373,7 @@ struct cipher_tfm {
return c | 0x20;
}
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
-index 3c7ec32..4ca97cc 100644
+index 75a227c..1456987 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
-@@ -133,7 +133,7 @@ struct dentry {
+@@ -134,7 +134,7 @@ struct dentry {
} d_u;
struct list_head d_subdirs; /* our children */
struct hlist_node d_alias; /* inode alias list */
/**
* struct devfreq - Device devfreq structure
diff --git a/include/linux/device.h b/include/linux/device.h
-index af424ac..fd46ddf 100644
+index 43d183a..03b6ba2 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -310,7 +310,7 @@ struct subsys_interface {
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
-index d2c5cc7..d193394 100644
+index 1f9e642..39e4263 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1147,9 +1147,9 @@ struct dma_pinned_list {
unsigned int offset, size_t len);
diff --git a/include/linux/efi.h b/include/linux/efi.h
-index 41bbf8b..bd3a718 100644
+index 45cb4ff..c9b4912 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
-@@ -1027,6 +1027,7 @@ struct efivar_operations {
+@@ -1036,6 +1036,7 @@ struct efivar_operations {
efi_set_variable_t *set_variable;
efi_query_variable_store_t *query_variable_store;
};
/**
diff --git a/include/linux/fb.h b/include/linux/fb.h
-index b6bfda9..1f13487 100644
+index 09bb7a1..d98870a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -305,7 +305,7 @@ struct fb_ops {
int iterate_fd(struct files_struct *, unsigned,
int (*)(const void *, struct file *, unsigned),
diff --git a/include/linux/filter.h b/include/linux/filter.h
-index a7e3c48..e568c8e 100644
+index a5227ab..c789945 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
-@@ -9,330 +9,28 @@
+@@ -9,6 +9,11 @@
+ #include <linux/skbuff.h>
#include <linux/workqueue.h>
#include <uapi/linux/filter.h>
++#include <asm/cacheflush.h>
++
++struct sk_buff;
++struct sock;
++struct seccomp_data;
--/* Internally used and optimized filter representation with extended
-- * instruction set based on top of classic BPF.
-- */
--
--/* instruction classes */
--#define BPF_ALU64 0x07 /* alu mode in double word width */
--
--/* ld/ldx fields */
--#define BPF_DW 0x18 /* double word */
--#define BPF_XADD 0xc0 /* exclusive add */
--
--/* alu/jmp fields */
--#define BPF_MOV 0xb0 /* mov reg to reg */
--#define BPF_ARSH 0xc0 /* sign extending arithmetic shift right */
--
--/* change endianness of a register */
--#define BPF_END 0xd0 /* flags for endianness conversion: */
--#define BPF_TO_LE 0x00 /* convert to little-endian */
--#define BPF_TO_BE 0x08 /* convert to big-endian */
--#define BPF_FROM_LE BPF_TO_LE
--#define BPF_FROM_BE BPF_TO_BE
--
--#define BPF_JNE 0x50 /* jump != */
--#define BPF_JSGT 0x60 /* SGT is signed '>', GT in x86 */
--#define BPF_JSGE 0x70 /* SGE is signed '>=', GE in x86 */
--#define BPF_CALL 0x80 /* function call */
--#define BPF_EXIT 0x90 /* function return */
--
--/* Register numbers */
--enum {
-- BPF_REG_0 = 0,
-- BPF_REG_1,
-- BPF_REG_2,
-- BPF_REG_3,
-- BPF_REG_4,
-- BPF_REG_5,
-- BPF_REG_6,
-- BPF_REG_7,
-- BPF_REG_8,
-- BPF_REG_9,
-- BPF_REG_10,
-- __MAX_BPF_REG,
--};
--
--/* BPF has 10 general purpose 64-bit registers and stack frame. */
--#define MAX_BPF_REG __MAX_BPF_REG
--
--/* ArgX, context and stack frame pointer register positions. Note,
-- * Arg1, Arg2, Arg3, etc are used as argument mappings of function
-- * calls in BPF_CALL instruction.
-- */
--#define BPF_REG_ARG1 BPF_REG_1
--#define BPF_REG_ARG2 BPF_REG_2
--#define BPF_REG_ARG3 BPF_REG_3
--#define BPF_REG_ARG4 BPF_REG_4
--#define BPF_REG_ARG5 BPF_REG_5
--#define BPF_REG_CTX BPF_REG_6
--#define BPF_REG_FP BPF_REG_10
--
--/* Additional register mappings for converted user programs. */
--#define BPF_REG_A BPF_REG_0
--#define BPF_REG_X BPF_REG_7
--#define BPF_REG_TMP BPF_REG_8
--
--/* BPF program can access up to 512 bytes of stack space. */
--#define MAX_BPF_STACK 512
--
--/* Helper macros for filter block array initializers. */
--
--/* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */
--
--#define BPF_ALU64_REG(OP, DST, SRC) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = 0, \
-- .imm = 0 })
--
--#define BPF_ALU32_REG(OP, DST, SRC) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = 0, \
-- .imm = 0 })
--
--/* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */
--
--#define BPF_ALU64_IMM(OP, DST, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \
-- .dst_reg = DST, \
-- .src_reg = 0, \
-- .off = 0, \
-- .imm = IMM })
--
--#define BPF_ALU32_IMM(OP, DST, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
-- .dst_reg = DST, \
-- .src_reg = 0, \
-- .off = 0, \
-- .imm = IMM })
--
--/* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */
--
--#define BPF_ENDIAN(TYPE, DST, LEN) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \
-- .dst_reg = DST, \
-- .src_reg = 0, \
-- .off = 0, \
-- .imm = LEN })
--
--/* Short form of mov, dst_reg = src_reg */
--
--#define BPF_MOV64_REG(DST, SRC) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU64 | BPF_MOV | BPF_X, \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = 0, \
-- .imm = 0 })
--
--#define BPF_MOV32_REG(DST, SRC) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU | BPF_MOV | BPF_X, \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = 0, \
-- .imm = 0 })
--
--/* Short form of mov, dst_reg = imm32 */
--
--#define BPF_MOV64_IMM(DST, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU64 | BPF_MOV | BPF_K, \
-- .dst_reg = DST, \
-- .src_reg = 0, \
-- .off = 0, \
-- .imm = IMM })
--
--#define BPF_MOV32_IMM(DST, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU | BPF_MOV | BPF_K, \
-- .dst_reg = DST, \
-- .src_reg = 0, \
-- .off = 0, \
-- .imm = IMM })
--
--/* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */
--
--#define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = 0, \
-- .imm = IMM })
--
--#define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = 0, \
-- .imm = IMM })
--
--/* Direct packet access, R0 = *(uint *) (skb->data + imm32) */
--
--#define BPF_LD_ABS(SIZE, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \
-- .dst_reg = 0, \
-- .src_reg = 0, \
-- .off = 0, \
-- .imm = IMM })
--
--/* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */
--
--#define BPF_LD_IND(SIZE, SRC, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \
-- .dst_reg = 0, \
-- .src_reg = SRC, \
-- .off = 0, \
-- .imm = IMM })
--
--/* Memory load, dst_reg = *(uint *) (src_reg + off16) */
--
--#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \
-- ((struct sock_filter_int) { \
-- .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = OFF, \
-- .imm = 0 })
--
--/* Memory store, *(uint *) (dst_reg + off16) = src_reg */
--
--#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \
-- ((struct sock_filter_int) { \
-- .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = OFF, \
-- .imm = 0 })
--
--/* Memory store, *(uint *) (dst_reg + off16) = imm32 */
--
--#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \
-- ((struct sock_filter_int) { \
-- .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \
-- .dst_reg = DST, \
-- .src_reg = 0, \
-- .off = OFF, \
-- .imm = IMM })
--
--/* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */
--
--#define BPF_JMP_REG(OP, DST, SRC, OFF) \
-- ((struct sock_filter_int) { \
-- .code = BPF_JMP | BPF_OP(OP) | BPF_X, \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = OFF, \
-- .imm = 0 })
--
--/* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */
--
--#define BPF_JMP_IMM(OP, DST, IMM, OFF) \
-- ((struct sock_filter_int) { \
-- .code = BPF_JMP | BPF_OP(OP) | BPF_K, \
-- .dst_reg = DST, \
-- .src_reg = 0, \
-- .off = OFF, \
-- .imm = IMM })
--
--/* Function call */
--
--#define BPF_EMIT_CALL(FUNC) \
-- ((struct sock_filter_int) { \
-- .code = BPF_JMP | BPF_CALL, \
-- .dst_reg = 0, \
-- .src_reg = 0, \
-- .off = 0, \
-- .imm = ((FUNC) - __bpf_call_base) })
--
--/* Raw code statement block */
--
--#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \
-- ((struct sock_filter_int) { \
-- .code = CODE, \
-- .dst_reg = DST, \
-- .src_reg = SRC, \
-- .off = OFF, \
-- .imm = IMM })
--
--/* Program exit */
--
--#define BPF_EXIT_INSN() \
-- ((struct sock_filter_int) { \
-- .code = BPF_JMP | BPF_EXIT, \
-- .dst_reg = 0, \
-- .src_reg = 0, \
-- .off = 0, \
-- .imm = 0 })
--
--#define bytes_to_bpf_size(bytes) \
--({ \
-- int bpf_size = -EINVAL; \
-- \
-- if (bytes == sizeof(u8)) \
-- bpf_size = BPF_B; \
-- else if (bytes == sizeof(u16)) \
-- bpf_size = BPF_H; \
-- else if (bytes == sizeof(u32)) \
-- bpf_size = BPF_W; \
-- else if (bytes == sizeof(u64)) \
-- bpf_size = BPF_DW; \
-- \
-- bpf_size; \
--})
--
--/* Macro to invoke filter function. */
--#define SK_RUN_FILTER(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi)
--
--struct sock_filter_int {
-- __u8 code; /* opcode */
-- __u8 dst_reg:4; /* dest register */
-- __u8 src_reg:4; /* source register */
-- __s16 off; /* signed offset */
-- __s32 imm; /* signed immediate constant */
--};
--
- #ifdef CONFIG_COMPAT
--/* A struct sock_filter is architecture independent. */
-+/*
-+ * A struct sock_filter is architecture independent.
-+ */
- struct compat_sock_fprog {
- u16 len;
-- compat_uptr_t filter; /* struct sock_filter * */
-+ compat_uptr_t filter; /* struct sock_filter * */
+ /* Internally used and optimized filter representation with extended
+ * instruction set based on top of classic BPF.
+@@ -320,20 +325,23 @@ struct sock_fprog_kern {
+ struct sock_filter *filter;
};
- #endif
--struct sock_fprog_kern {
-- u16 len;
-- struct sock_filter *filter;
--};
--
- struct sk_buff;
- struct sock;
+-struct sk_buff;
+-struct sock;
-struct seccomp_data;
++struct bpf_work_struct {
++ struct bpf_prog *prog;
++ struct work_struct work;
++};
--struct sk_filter {
-+struct sk_filter
-+{
- atomic_t refcnt;
-- u32 jited:1, /* Is our filter JIT'ed? */
-- len:31; /* Number of filter blocks */
-- struct sock_fprog_kern *orig_prog; /* Original BPF program */
-+ unsigned int len; /* Number of filter blocks */
- struct rcu_head rcu;
+ struct bpf_prog {
++ u32 pages; /* Number of allocated pages */
+ u32 jited:1, /* Is our filter JIT'ed? */
+ len:31; /* Number of filter blocks */
+ struct sock_fprog_kern *orig_prog; /* Original BPF program */
++ struct bpf_work_struct *work; /* Deferred free work struct */
unsigned int (*bpf_func)(const struct sk_buff *skb,
-- const struct sock_filter_int *filter);
-+ const struct sock_filter *filter);
+ const struct bpf_insn *filter);
++ /* Instructions for interpreter */
union {
-- struct sock_filter insns[0];
-- struct sock_filter_int insnsi[0];
-+ struct sock_filter insns[0];
- struct work_struct work;
+ struct sock_filter insns[0];
+ struct bpf_insn insnsi[0];
+- struct work_struct work;
};
};
-@@ -343,76 +41,25 @@ static inline unsigned int sk_filter_size(unsigned int proglen)
- offsetof(struct sk_filter, insns[proglen]));
- }
--#define sk_filter_proglen(fprog) \
-- (fprog->len * sizeof(fprog->filter[0]))
--
--int sk_filter(struct sock *sk, struct sk_buff *skb);
--
--void sk_filter_select_runtime(struct sk_filter *fp);
--void sk_filter_free(struct sk_filter *fp);
--
--int sk_convert_filter(struct sock_filter *prog, int len,
-- struct sock_filter_int *new_prog, int *new_len);
--
--int sk_unattached_filter_create(struct sk_filter **pfp,
-- struct sock_fprog_kern *fprog);
--void sk_unattached_filter_destroy(struct sk_filter *fp);
--
--int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
--int sk_detach_filter(struct sock *sk);
--
--int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
--int sk_get_filter(struct sock *sk, struct sock_filter __user *filter,
-- unsigned int len);
--
--void sk_filter_charge(struct sock *sk, struct sk_filter *fp);
--void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp);
--
--u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
--void bpf_int_jit_compile(struct sk_filter *fp);
--
--#define BPF_ANC BIT(15)
--
--static inline u16 bpf_anc_helper(const struct sock_filter *ftest)
--{
-- BUG_ON(ftest->code & BPF_ANC);
--
-- switch (ftest->code) {
-- case BPF_LD | BPF_W | BPF_ABS:
-- case BPF_LD | BPF_H | BPF_ABS:
-- case BPF_LD | BPF_B | BPF_ABS:
--#define BPF_ANCILLARY(CODE) case SKF_AD_OFF + SKF_AD_##CODE: \
-- return BPF_ANC | SKF_AD_##CODE
-- switch (ftest->k) {
-- BPF_ANCILLARY(PROTOCOL);
-- BPF_ANCILLARY(PKTTYPE);
-- BPF_ANCILLARY(IFINDEX);
-- BPF_ANCILLARY(NLATTR);
-- BPF_ANCILLARY(NLATTR_NEST);
-- BPF_ANCILLARY(MARK);
-- BPF_ANCILLARY(QUEUE);
-- BPF_ANCILLARY(HATYPE);
-- BPF_ANCILLARY(RXHASH);
-- BPF_ANCILLARY(CPU);
-- BPF_ANCILLARY(ALU_XOR_X);
-- BPF_ANCILLARY(VLAN_TAG);
-- BPF_ANCILLARY(VLAN_TAG_PRESENT);
-- BPF_ANCILLARY(PAY_OFFSET);
-- BPF_ANCILLARY(RANDOM);
-- }
-- /* Fallthrough. */
-- default:
-- return ftest->code;
-- }
--}
-+extern int sk_filter(struct sock *sk, struct sk_buff *skb);
-+extern unsigned int sk_run_filter(const struct sk_buff *skb,
-+ const struct sock_filter *filter);
-+extern int sk_unattached_filter_create(struct sk_filter **pfp,
-+ struct sock_fprog *fprog);
-+extern void sk_unattached_filter_destroy(struct sk_filter *fp);
-+extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
-+extern int sk_detach_filter(struct sock *sk);
-+extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
-+extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len);
-+extern void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to);
-
- #ifdef CONFIG_BPF_JIT
- #include <stdarg.h>
- #include <linux/linkage.h>
- #include <linux/printk.h>
+@@ -353,6 +361,26 @@ static inline unsigned int bpf_prog_size(unsigned int proglen)
--void bpf_jit_compile(struct sk_filter *fp);
--void bpf_jit_free(struct sk_filter *fp);
-+extern void bpf_jit_compile(struct sk_filter *fp);
-+extern void bpf_jit_free(struct sk_filter *fp);
+ #define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0]))
- static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
- u32 pass, void *image)
-@@ -423,22 +70,90 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
- print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET,
- 16, 1, image, proglen, false);
- }
-+#define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns)
- #else
- #include <linux/slab.h>
--
- static inline void bpf_jit_compile(struct sk_filter *fp)
- {
- }
--
- static inline void bpf_jit_free(struct sk_filter *fp)
- {
- kfree(fp);
- }
--#endif /* CONFIG_BPF_JIT */
-+#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns)
-+#endif
++#ifdef CONFIG_DEBUG_SET_MODULE_RONX
++static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
++{
++ set_memory_ro((unsigned long)fp, fp->pages);
++}
++
++static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
++{
++ set_memory_rw((unsigned long)fp, fp->pages);
++}
++#else
++static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
++{
++}
++
++static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
++{
++}
++#endif /* CONFIG_DEBUG_SET_MODULE_RONX */
++
+ int sk_filter(struct sock *sk, struct sk_buff *skb);
+
+ void bpf_prog_select_runtime(struct bpf_prog *fp);
+@@ -361,6 +389,17 @@ void bpf_prog_free(struct bpf_prog *fp);
+ int bpf_convert_filter(struct sock_filter *prog, int len,
+ struct bpf_insn *new_prog, int *new_len);
+
++struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags);
++struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
++ gfp_t gfp_extra_flags);
++void __bpf_prog_free(struct bpf_prog *fp);
++
++static inline void bpf_prog_unlock_free(struct bpf_prog *fp)
++{
++ bpf_prog_unlock_ro(fp);
++ __bpf_prog_free(fp);
++}
++
+ int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog);
+ void bpf_prog_destroy(struct bpf_prog *fp);
+
+@@ -450,7 +489,7 @@ static inline void bpf_jit_compile(struct bpf_prog *fp)
- static inline int bpf_tell_extensions(void)
+ static inline void bpf_jit_free(struct bpf_prog *fp)
{
- return SKF_AD_MAX;
+- kfree(fp);
++ bpf_prog_unlock_free(fp);
}
+ #endif /* CONFIG_BPF_JIT */
-+enum {
-+ BPF_S_RET_K = 1,
-+ BPF_S_RET_A,
-+ BPF_S_ALU_ADD_K,
-+ BPF_S_ALU_ADD_X,
-+ BPF_S_ALU_SUB_K,
-+ BPF_S_ALU_SUB_X,
-+ BPF_S_ALU_MUL_K,
-+ BPF_S_ALU_MUL_X,
-+ BPF_S_ALU_DIV_X,
-+ BPF_S_ALU_MOD_K,
-+ BPF_S_ALU_MOD_X,
-+ BPF_S_ALU_AND_K,
-+ BPF_S_ALU_AND_X,
-+ BPF_S_ALU_OR_K,
-+ BPF_S_ALU_OR_X,
-+ BPF_S_ALU_XOR_K,
-+ BPF_S_ALU_XOR_X,
-+ BPF_S_ALU_LSH_K,
-+ BPF_S_ALU_LSH_X,
-+ BPF_S_ALU_RSH_K,
-+ BPF_S_ALU_RSH_X,
-+ BPF_S_ALU_NEG,
-+ BPF_S_LD_W_ABS,
-+ BPF_S_LD_H_ABS,
-+ BPF_S_LD_B_ABS,
-+ BPF_S_LD_W_LEN,
-+ BPF_S_LD_W_IND,
-+ BPF_S_LD_H_IND,
-+ BPF_S_LD_B_IND,
-+ BPF_S_LD_IMM,
-+ BPF_S_LDX_W_LEN,
-+ BPF_S_LDX_B_MSH,
-+ BPF_S_LDX_IMM,
-+ BPF_S_MISC_TAX,
-+ BPF_S_MISC_TXA,
-+ BPF_S_ALU_DIV_K,
-+ BPF_S_LD_MEM,
-+ BPF_S_LDX_MEM,
-+ BPF_S_ST,
-+ BPF_S_STX,
-+ BPF_S_JMP_JA,
-+ BPF_S_JMP_JEQ_K,
-+ BPF_S_JMP_JEQ_X,
-+ BPF_S_JMP_JGE_K,
-+ BPF_S_JMP_JGE_X,
-+ BPF_S_JMP_JGT_K,
-+ BPF_S_JMP_JGT_X,
-+ BPF_S_JMP_JSET_K,
-+ BPF_S_JMP_JSET_X,
-+ /* Ancillary data */
-+ BPF_S_ANC_PROTOCOL,
-+ BPF_S_ANC_PKTTYPE,
-+ BPF_S_ANC_IFINDEX,
-+ BPF_S_ANC_NLATTR,
-+ BPF_S_ANC_NLATTR_NEST,
-+ BPF_S_ANC_MARK,
-+ BPF_S_ANC_QUEUE,
-+ BPF_S_ANC_HATYPE,
-+ BPF_S_ANC_RXHASH,
-+ BPF_S_ANC_CPU,
-+ BPF_S_ANC_ALU_XOR_X,
-+ BPF_S_ANC_SECCOMP_LD_W,
-+ BPF_S_ANC_VLAN_TAG,
-+ BPF_S_ANC_VLAN_TAG_PRESENT,
-+ BPF_S_ANC_PAY_OFFSET,
-+};
-+
- #endif /* __LINUX_FILTER_H__ */
diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h
index 8293262..2b3b8bd 100644
--- a/include/linux/frontswap.h
extern bool frontswap_enabled;
extern struct frontswap_ops *
diff --git a/include/linux/fs.h b/include/linux/fs.h
-index e11d60c..901317a 100644
+index 9418772..0155807 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -401,7 +401,7 @@ struct address_space {
/*
* Radix-tree tags, for tagging dirty and writeback pages within the pagecache
-@@ -588,7 +588,7 @@ struct inode {
+@@ -613,7 +613,7 @@ struct inode {
#endif
void *i_private; /* fs or device private pointer */
static inline int inode_unhashed(struct inode *inode)
{
-@@ -781,7 +781,7 @@ struct file {
+@@ -806,7 +806,7 @@ struct file {
struct list_head f_tfile_llink;
#endif /* #ifdef CONFIG_EPOLL */
struct address_space *f_mapping;
struct file_handle {
__u32 handle_bytes;
-@@ -909,7 +909,7 @@ struct file_lock {
+@@ -934,7 +934,7 @@ struct file_lock {
int state; /* state of grant or error if -ve */
} afs;
} fl_u;
/* The following constant reflects the upper bound of the file/locking space */
#ifndef OFFSET_MAX
-@@ -1258,7 +1258,7 @@ struct super_block {
+@@ -1284,7 +1284,7 @@ struct super_block {
struct list_lru s_dentry_lru ____cacheline_aligned_in_smp;
struct list_lru s_inode_lru ____cacheline_aligned_in_smp;
struct rcu_head rcu;
extern struct timespec current_fs_time(struct super_block *sb);
-@@ -1484,7 +1484,8 @@ struct file_operations {
+@@ -1510,7 +1510,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);
struct inode_operations {
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
-@@ -2769,4 +2770,14 @@ static inline bool dir_relax(struct inode *inode)
+@@ -2796,4 +2797,14 @@ static inline bool dir_relax(struct inode *inode)
return !IS_DEADDIR(inode);
}
};
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
-index 6eb1fb3..30fe7e4 100644
+index 5e7219d..b1ed627 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -34,6 +34,13 @@ struct vm_area_struct;
+
+#endif
diff --git a/include/linux/hash.h b/include/linux/hash.h
-index bd1754c..8240892 100644
+index d0494c3..69b7715 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
-@@ -83,7 +83,7 @@ static inline u32 hash32_ptr(const void *ptr)
+@@ -87,7 +87,7 @@ static inline u32 hash32_ptr(const void *ptr)
struct fast_hash_ops {
u32 (*hash)(const void *data, u32 len, u32 seed);
u32 (*hash2)(const u32 *data, u32 len, u32 seed);
/**
* arch_fast_hash - Caclulates a hash over a given buffer that can have
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
-index 7fb31da..08b5114 100644
+index 9286a46..373f27f 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -189,6 +189,18 @@ static inline void clear_highpage(struct page *page)
#define __meminitconst __constsection(.meminit.rodata)
#define __memexit __section(.memexit.text) __exitused __cold notrace
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
-index 6df7f9f..d0bf699 100644
+index 2bb4c4f3..e0fac69 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
-@@ -156,6 +156,12 @@ extern struct task_group root_task_group;
+@@ -149,6 +149,12 @@ extern struct task_group root_task_group;
#define INIT_TASK_COMM "swapper"
#ifdef CONFIG_RT_MUTEXES
# define INIT_RT_MUTEXES(tsk) \
.pi_waiters = RB_ROOT, \
-@@ -203,6 +209,7 @@ extern struct task_group root_task_group;
+@@ -196,6 +202,7 @@ extern struct task_group root_task_group;
RCU_POINTER_INITIALIZER(cred, &init_cred), \
.comm = INIT_TASK_COMM, \
.thread = INIT_THREAD, \
extern void __raise_softirq_irqoff(unsigned int nr);
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
-index b96a5b2..2732d1c 100644
+index 20f9a52..63ee2e3 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -131,7 +131,7 @@ struct iommu_ops {
#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 5e3a906..3131d0f 100644
+index 142ec54..873e033 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);
extern struct ipc_namespace init_ipc_ns;
extern atomic_t nr_ipc_ns;
diff --git a/include/linux/irq.h b/include/linux/irq.h
-index 0d998d8..3a1c782 100644
+index 62af592..cc3b0d0 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -344,7 +344,8 @@ struct irq_chip {
void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
u32 offset, struct device_node *);
-diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
-index 8e10f57..d5f62bc 100644
---- a/include/linux/isdn_ppp.h
-+++ b/include/linux/isdn_ppp.h
-@@ -180,8 +180,9 @@ struct ippp_struct {
- struct slcompress *slcomp;
- #endif
- #ifdef CONFIG_IPPP_FILTER
-- struct sk_filter *pass_filter; /* filter for packets to pass */
-- struct sk_filter *active_filter; /* filter for pkts to reset idle */
-+ struct sock_filter *pass_filter; /* filter for packets to pass */
-+ struct sock_filter *active_filter; /* filter for pkts to reset idle */
-+ unsigned pass_len, active_len;
- #endif
- unsigned long debug;
- struct isdn_ppp_compressor *compressor,*decompressor;
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
-index 1f44466..b481806 100644
+index c367cbd..c9b79e6 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
-@@ -292,20 +292,20 @@ extern unsigned long preset_lpj;
+@@ -280,20 +280,20 @@ extern unsigned long preset_lpj;
/*
* Convert various time units to each other:
*/
/* This macro allows us to keep printk typechecking */
static __printf(1, 2)
diff --git a/include/linux/key-type.h b/include/linux/key-type.h
-index a74c3a8..28d3f21 100644
+index 44792ee..6172f2a 100644
--- a/include/linux/key-type.h
+++ b/include/linux/key-type.h
-@@ -131,7 +131,7 @@ struct key_type {
+@@ -132,7 +132,7 @@ struct key_type {
/* internal fields */
struct list_head link; /* link in types list */
struct lock_class_key lock_class; /* key->sem lock class */
extern struct key_type key_type_keyring;
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
-index 6b06d37..c134867 100644
+index 6b06d37..19f605f 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -52,7 +52,7 @@ extern int kgdb_connected;
/**
* struct kgdb_io - Describe the interface for an I/O driver to talk with KGDB.
-@@ -279,7 +279,7 @@ struct kgdb_io {
+@@ -279,11 +279,11 @@ struct kgdb_io {
void (*pre_exception) (void);
void (*post_exception) (void);
int is_console;
extern struct kgdb_arch arch_kgdb_ops;
+-extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs);
++extern unsigned long kgdb_arch_pc(int exception, struct pt_regs *regs);
+
+ #ifdef CONFIG_SERIAL_KGDB_NMI
+ extern int kgdb_register_nmi_console(void);
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 0555cc6..40116ce 100644
--- a/include/linux/kmod.h
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 ec4e3bd..14db03a 100644
+index a4c33b3..e854710 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
-@@ -468,7 +468,7 @@ static inline void kvm_irqfd_exit(void)
+@@ -452,7 +452,7 @@ static inline void kvm_irqfd_exit(void)
{
}
#endif
struct module *module);
void kvm_exit(void);
-@@ -634,7 +634,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
+@@ -618,7 +618,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);
/*
diff --git a/include/linux/list.h b/include/linux/list.h
-index ef95941..82db65a 100644
+index cbbb96f..602d023 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -112,6 +112,19 @@ extern void __list_del_entry(struct list_head *entry);
/**
* list_move - delete from one list and add as another's head
* @list: the entry to move
+diff --git a/include/linux/lockref.h b/include/linux/lockref.h
+index 4bfde0e..d6e2e09 100644
+--- a/include/linux/lockref.h
++++ b/include/linux/lockref.h
+@@ -47,4 +47,36 @@ static inline int __lockref_is_dead(const struct lockref *l)
+ return ((int)l->count < 0);
+ }
+
++static inline unsigned int __lockref_read(struct lockref *lockref)
++{
++ return lockref->count;
++}
++
++static inline void __lockref_set(struct lockref *lockref, unsigned int count)
++{
++ lockref->count = count;
++}
++
++static inline void __lockref_inc(struct lockref *lockref)
++{
++
++#ifdef CONFIG_PAX_REFCOUNT
++ atomic_inc((atomic_t *)&lockref->count);
++#else
++ lockref->count++;
++#endif
++
++}
++
++static inline void __lockref_dec(struct lockref *lockref)
++{
++
++#ifdef CONFIG_PAX_REFCOUNT
++ atomic_dec((atomic_t *)&lockref->count);
++#else
++ lockref->count--;
++#endif
++
++}
++
+ #endif /* __LINUX_LOCKREF_H */
diff --git a/include/linux/math64.h b/include/linux/math64.h
index c45c089..298841c 100644
--- a/include/linux/math64.h
{
u32 remainder;
return div_u64_rem(dividend, divisor, &remainder);
+diff --git a/include/linux/memory.h b/include/linux/memory.h
+index bb7384e..8b8d8d1 100644
+--- a/include/linux/memory.h
++++ b/include/linux/memory.h
+@@ -35,7 +35,7 @@ struct memory_block {
+ };
+
+ int arch_get_memory_phys_device(unsigned long start_pfn);
+-unsigned long __weak memory_block_size_bytes(void);
++unsigned long memory_block_size_bytes(void);
+
+ /* These states are exposed to userspace as text strings in sysfs */
+ #define MEM_ONLINE (1<<0) /* exposed to userspace */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index f230a97..714c006 100644
--- a/include/linux/mempolicy.h
static inline int
vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
diff --git a/include/linux/mm.h b/include/linux/mm.h
-index e03dd29..eaf923c 100644
+index 8981cc8..76fd8c2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -127,6 +127,11 @@ extern unsigned int kobjsize(const void *objp);
mm->total_vm += pages;
}
#endif /* CONFIG_PROC_FS */
-@@ -2078,7 +2093,7 @@ extern int unpoison_memory(unsigned long pfn);
+@@ -2085,7 +2100,7 @@ extern int unpoison_memory(unsigned long pfn);
extern int sysctl_memory_failure_early_kill;
extern int sysctl_memory_failure_recovery;
extern void shake_page(struct page *p, int access);
extern int soft_offline_page(struct page *page, int flags);
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS)
-@@ -2113,5 +2128,11 @@ void __init setup_nr_node_ids(void);
+@@ -2120,5 +2135,11 @@ void __init setup_nr_node_ids(void);
static inline void setup_nr_node_ids(void) {}
#endif
#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index 96c5750..15668ba 100644
+index 6e0b286..90d9c0d 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -308,7 +308,9 @@ struct vm_area_struct {
}
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index 6cbd1b6..b1d2f99 100644
+index 318df70..b74ec01 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
-@@ -412,7 +412,7 @@ struct zone {
- unsigned long flags; /* zone flags, see below */
+@@ -518,7 +518,7 @@ struct zone {
+ ZONE_PADDING(_pad3_)
/* Zone statistics */
- atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
+ atomic_long_unchecked_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
+ } ____cacheline_internodealigned_in_smp;
- /*
- * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on
+ typedef enum {
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 44eeef0..a92d3f9 100644
--- a/include/linux/mod_devicetable.h
* 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 f520a76..5f898ef 100644
+index 71f282a..b2387e2 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -17,9 +17,11 @@
#ifndef MODULE_ARCH_INIT
#define MODULE_ARCH_INIT {}
#endif
-@@ -396,16 +400,46 @@ bool is_module_address(unsigned long addr);
+@@ -396,18 +400,48 @@ bool is_module_address(unsigned long addr);
bool is_module_percpu_address(unsigned long addr);
bool is_module_text_address(unsigned long addr);
+ return within_module_range(addr, mod->module_init_rw, mod->init_size_rw);
+}
+
- static inline int within_module_core(unsigned long addr, const struct module *mod)
+ static inline bool within_module_core(unsigned long addr,
+ const struct module *mod)
{
- return (unsigned long)mod->module_core <= addr &&
- addr < (unsigned long)mod->module_core + mod->core_size;
+ return within_module_core_rx(addr, mod) || within_module_core_rw(addr, mod);
}
- static inline int within_module_init(unsigned long addr, const struct module *mod)
+ static inline bool within_module_init(unsigned long addr,
+ const struct module *mod)
{
- return (unsigned long)mod->module_init <= addr &&
- addr < (unsigned long)mod->module_init + mod->init_size;
+ return within_module_init_rx(addr, mod) || within_module_init_rw(addr, mod);
}
- /* Search for module by name: must hold module_mutex. */
+ static inline bool within_module(unsigned long addr, const struct module *mod)
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
-index 560ca53..ef621ef 100644
+index 7eeb9bb..68f37e0 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -25,9 +25,21 @@ unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section);
/*
* Apply the given relocation to the (simplified) ELF. Return -error
* or 0.
-@@ -45,7 +57,9 @@ static inline int apply_relocate(Elf_Shdr *sechdrs,
+@@ -45,8 +57,10 @@ static inline int apply_relocate(Elf_Shdr *sechdrs,
unsigned int relsec,
struct module *me)
{
+#ifdef CONFIG_MODULES
- printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
+ printk(KERN_ERR "module %s: REL relocation unsupported\n",
+ module_name(me));
+#endif
return -ENOEXEC;
}
#endif
-@@ -67,7 +81,9 @@ static inline int apply_relocate_add(Elf_Shdr *sechdrs,
+@@ -68,8 +82,10 @@ static inline int apply_relocate_add(Elf_Shdr *sechdrs,
unsigned int relsec,
struct module *me)
{
+#ifdef CONFIG_MODULES
- printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
+ printk(KERN_ERR "module %s: REL relocation unsupported\n",
+ module_name(me));
+#endif
return -ENOEXEC;
}
#endif
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
-index b1990c5..2a6e611 100644
+index 494f99e..5059f63 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -293,7 +293,7 @@ static inline void __kernel_param_unlock(void)
= { len, string }; \
__module_param_call(MODULE_PARAM_PREFIX, name, \
¶m_ops_string, \
-@@ -432,7 +432,7 @@ extern int param_set_bint(const char *val, const struct kernel_param *kp);
+@@ -437,7 +437,7 @@ extern int param_set_bint(const char *val, const struct kernel_param *kp);
*/
#define module_param_array_named(name, array, type, nump, perm) \
param_check_##type(name, &(array)[0]); \
.ops = ¶m_ops_##type, \
.elemsize = sizeof(array[0]), .elem = array }; \
diff --git a/include/linux/mount.h b/include/linux/mount.h
-index 839bac2..a96b37c 100644
+index 9262e4b..0a45f98 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
-@@ -59,7 +59,7 @@ struct vfsmount {
+@@ -66,7 +66,7 @@ struct vfsmount {
struct dentry *mnt_root; /* root of the mounted tree */
struct super_block *mnt_sb; /* pointer to superblock */
int mnt_flags;
+} __randomize_layout;
struct file; /* forward dec */
-
+ struct path;
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 492de72..1bddcd4 100644
--- a/include/linux/namei.h
struct iovec;
struct kvec;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 66f9a04..056078d 100644
+index c8e388e..5d8cd9b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -1145,6 +1145,7 @@ struct net_device_ops {
+@@ -1147,6 +1147,7 @@ struct net_device_ops {
void *priv);
int (*ndo_get_lock_subclass)(struct net_device *dev);
};
/**
* enum net_device_priv_flags - &struct net_device priv_flags
-@@ -1312,11 +1313,11 @@ struct net_device {
+@@ -1485,10 +1486,10 @@ struct net_device {
+
struct net_device_stats stats;
- /* dropped packets by core network, Do not use this in drivers */
- atomic_long_t rx_dropped;
- atomic_long_t tx_dropped;
+ atomic_long_unchecked_t rx_dropped;
+ atomic_long_unchecked_t tx_dropped;
- /* Stats to monitor carrier on<->off transitions */
- atomic_t carrier_changes;
+ atomic_unchecked_t carrier_changes;
#ifdef CONFIG_WIRELESS_EXT
- /* List of functions to handle Wireless Extensions (instead of ioctl).
+ const struct iw_handler_def * wireless_handlers;
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
-index 2077489..a15e561 100644
+index 2517ece..0bbfcfb 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
-@@ -84,7 +84,7 @@ struct nf_sockopt_ops {
+@@ -85,7 +85,7 @@ struct nf_sockopt_ops {
#endif
/* Use the module struct to lock set/get code in place */
struct module *owner;
#define PMU_EVENT_ATTR(_name, _var, _id, _show) \
static struct perf_pmu_events_attr _var = { \
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
-index 7246ef3..1539ea4 100644
+index 1997ffc..4f1f44d 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
-@@ -43,7 +43,7 @@ struct pid_namespace {
+@@ -44,7 +44,7 @@ struct pid_namespace {
int hide_pid;
int reboot; /* group exit code if this pidns was rebooted */
unsigned int proc_inum;
/*
* The PM_EVENT_ messages are also used by drivers implementing the legacy
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 7c1d252..0e7061d 100644
+index ebc4c76..7fab7b0 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -44,11 +44,11 @@ struct gpd_dev_ops {
struct generic_pm_domain {
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
-index 43fd671..08c96ee 100644
+index 367f49b..d2f5a14 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
-@@ -118,7 +118,7 @@ static inline bool pm_runtime_callbacks_present(struct device *dev)
+@@ -125,7 +125,7 @@ static inline bool pm_runtime_callbacks_present(struct device *dev)
static inline void pm_runtime_mark_last_busy(struct device *dev)
{
#define preempt_set_need_resched() \
do { \
diff --git a/include/linux/printk.h b/include/linux/printk.h
-index 319ff7e..608849a 100644
+index d78125f..7f36596 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
-@@ -121,6 +121,8 @@ static inline __printf(1, 2) __cold
+@@ -124,6 +124,8 @@ static inline __printf(1, 2) __cold
void early_printk(const char *s, ...) { }
#endif
#ifdef CONFIG_PRINTK
asmlinkage __printf(5, 0)
int vprintk_emit(int facility, int level,
-@@ -155,7 +157,6 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+@@ -158,7 +160,6 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
extern int printk_delay_msec;
extern int dmesg_restrict;
struct proc_ns {
void *ns;
-diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
-index 7dfed71..1dc420b 100644
---- a/include/linux/ptp_classify.h
-+++ b/include/linux/ptp_classify.h
-@@ -23,8 +23,15 @@
- #ifndef _PTP_CLASSIFY_H_
- #define _PTP_CLASSIFY_H_
-
-+#include <linux/if_ether.h>
-+#include <linux/if_vlan.h>
- #include <linux/ip.h>
--#include <linux/skbuff.h>
-+#include <linux/filter.h>
-+#ifdef __KERNEL__
-+#include <linux/in.h>
-+#else
-+#include <netinet/in.h>
-+#endif
-
- #define PTP_CLASS_NONE 0x00 /* not a PTP event message */
- #define PTP_CLASS_V1 0x01 /* protocol version 1 */
-@@ -37,7 +44,7 @@
- #define PTP_CLASS_PMASK 0xf0 /* mask for the packet type field */
-
- #define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4)
--#define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6) /* probably DNE */
-+#define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6) /*probably DNE*/
- #define PTP_CLASS_V2_IPV4 (PTP_CLASS_V2 | PTP_CLASS_IPV4)
- #define PTP_CLASS_V2_IPV6 (PTP_CLASS_V2 | PTP_CLASS_IPV6)
- #define PTP_CLASS_V2_L2 (PTP_CLASS_V2 | PTP_CLASS_L2)
-@@ -46,34 +53,88 @@
- #define PTP_EV_PORT 319
- #define PTP_GEN_BIT 0x08 /* indicates general message, if set in message type */
-
-+#define OFF_ETYPE 12
-+#define OFF_IHL 14
-+#define OFF_FRAG 20
-+#define OFF_PROTO4 23
-+#define OFF_NEXT 6
-+#define OFF_UDP_DST 2
-+
- #define OFF_PTP_SOURCE_UUID 22 /* PTPv1 only */
- #define OFF_PTP_SEQUENCE_ID 30
- #define OFF_PTP_CONTROL 32 /* PTPv1 only */
-
--/* Below defines should actually be removed at some point in time. */
-+#define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2)
-+
- #define IP6_HLEN 40
- #define UDP_HLEN 8
--#define OFF_IHL 14
-+
-+#define RELOFF_DST4 (ETH_HLEN + OFF_UDP_DST)
-+#define OFF_DST6 (ETH_HLEN + IP6_HLEN + OFF_UDP_DST)
- #define OFF_PTP6 (ETH_HLEN + IP6_HLEN + UDP_HLEN)
--#define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2)
-
--#if defined(CONFIG_NET_PTP_CLASSIFY)
--/**
-- * ptp_classify_raw - classify a PTP packet
-- * @skb: buffer
-- *
-- * Runs a minimal BPF dissector to classify a network packet to
-- * determine the PTP class. In case the skb does not contain any
-- * PTP protocol data, PTP_CLASS_NONE will be returned, otherwise
-- * PTP_CLASS_V1_IPV{4,6}, PTP_CLASS_V2_IPV{4,6} or
-- * PTP_CLASS_V2_{L2,VLAN}, depending on the packet content.
-- */
--unsigned int ptp_classify_raw(const struct sk_buff *skb);
-+#define OP_AND (BPF_ALU | BPF_AND | BPF_K)
-+#define OP_JEQ (BPF_JMP | BPF_JEQ | BPF_K)
-+#define OP_JSET (BPF_JMP | BPF_JSET | BPF_K)
-+#define OP_LDB (BPF_LD | BPF_B | BPF_ABS)
-+#define OP_LDH (BPF_LD | BPF_H | BPF_ABS)
-+#define OP_LDHI (BPF_LD | BPF_H | BPF_IND)
-+#define OP_LDX (BPF_LDX | BPF_B | BPF_MSH)
-+#define OP_OR (BPF_ALU | BPF_OR | BPF_K)
-+#define OP_RETA (BPF_RET | BPF_A)
-+#define OP_RETK (BPF_RET | BPF_K)
-
--void __init ptp_classifier_init(void);
--#else
--static inline void ptp_classifier_init(void)
-+static inline int ptp_filter_init(struct sock_filter *f, int len)
- {
-+ if (OP_LDH == f[0].code)
-+ return sk_chk_filter(f, len);
-+ else
-+ return 0;
- }
-+
-+#define PTP_FILTER \
-+ {OP_LDH, 0, 0, OFF_ETYPE }, /* */ \
-+ {OP_JEQ, 0, 12, ETH_P_IP }, /* f goto L20 */ \
-+ {OP_LDB, 0, 0, OFF_PROTO4 }, /* */ \
-+ {OP_JEQ, 0, 9, IPPROTO_UDP }, /* f goto L10 */ \
-+ {OP_LDH, 0, 0, OFF_FRAG }, /* */ \
-+ {OP_JSET, 7, 0, 0x1fff }, /* t goto L11 */ \
-+ {OP_LDX, 0, 0, OFF_IHL }, /* */ \
-+ {OP_LDHI, 0, 0, RELOFF_DST4 }, /* */ \
-+ {OP_JEQ, 0, 4, PTP_EV_PORT }, /* f goto L12 */ \
-+ {OP_LDHI, 0, 0, ETH_HLEN + UDP_HLEN }, /* */ \
-+ {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
-+ {OP_OR, 0, 0, PTP_CLASS_IPV4 }, /* */ \
-+ {OP_RETA, 0, 0, 0 }, /* */ \
-+/*L1x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
-+/*L20*/ {OP_JEQ, 0, 9, ETH_P_IPV6 }, /* f goto L40 */ \
-+ {OP_LDB, 0, 0, ETH_HLEN + OFF_NEXT }, /* */ \
-+ {OP_JEQ, 0, 6, IPPROTO_UDP }, /* f goto L30 */ \
-+ {OP_LDH, 0, 0, OFF_DST6 }, /* */ \
-+ {OP_JEQ, 0, 4, PTP_EV_PORT }, /* f goto L31 */ \
-+ {OP_LDH, 0, 0, OFF_PTP6 }, /* */ \
-+ {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
-+ {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \
-+ {OP_RETA, 0, 0, 0 }, /* */ \
-+/*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
-+/*L40*/ {OP_JEQ, 0, 9, ETH_P_8021Q }, /* f goto L50 */ \
-+ {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \
-+ {OP_JEQ, 0, 15, ETH_P_1588 }, /* f goto L60 */ \
-+ {OP_LDB, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
-+ {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
-+ {OP_JEQ, 0, 12, 0 }, /* f goto L6x */ \
-+ {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
-+ {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
-+ {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \
-+ {OP_RETA, 0, 0, 0 }, /* */ \
-+/*L50*/ {OP_JEQ, 0, 7, ETH_P_1588 }, /* f goto L61 */ \
-+ {OP_LDB, 0, 0, ETH_HLEN }, /* */ \
-+ {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
-+ {OP_JEQ, 0, 4, 0 }, /* f goto L6x */ \
-+ {OP_LDH, 0, 0, ETH_HLEN }, /* */ \
-+ {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
-+ {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \
-+ {OP_RETA, 0, 0, 0 }, /* */ \
-+/*L6x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE },
-+
- #endif
--#endif /* _PTP_CLASSIFY_H_ */
diff --git a/include/linux/quota.h b/include/linux/quota.h
-index 0f3c5d3..bc559e3 100644
+index 80d345a..9e89a9a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -70,7 +70,7 @@ struct kqid { /* Type in which we store the quota identifier */
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
-index 8183b46..a388711 100644
+index 372ad5e..d4373f8 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -29,8 +29,8 @@
static inline void anon_vma_merge(struct vm_area_struct *vma,
struct vm_area_struct *next)
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
-index a964f72..b475afb 100644
+index ed8f9e7..999bc96 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -1,6 +1,7 @@
}
diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 0376b05..82054c2 100644
+index b867a4d..84f03ad 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -131,6 +131,7 @@ struct fs_struct;
+@@ -132,6 +132,7 @@ struct fs_struct;
struct perf_event_context;
struct blk_plug;
struct filename;
atomic_t usage;
unsigned int flags; /* per process flags, defined below */
unsigned int ptrace;
-@@ -1349,8 +1385,8 @@ struct task_struct {
+@@ -1345,8 +1381,8 @@ struct task_struct {
struct list_head thread_node;
struct completion *vfork_done; /* for vfork() */
cputime_t utime, stime, utimescaled, stimescaled;
cputime_t gtime;
-@@ -1375,11 +1411,6 @@ struct task_struct {
+@@ -1371,11 +1407,6 @@ struct task_struct {
struct task_cputime cputime_expires;
struct list_head cpu_timers[3];
char comm[TASK_COMM_LEN]; /* executable name excluding path
- access with [gs]et_task_comm (which lock
it with task_lock())
-@@ -1396,6 +1427,10 @@ struct task_struct {
+@@ -1393,6 +1424,10 @@ struct task_struct {
#endif
/* CPU-specific state of this task */
struct thread_struct thread;
/* filesystem information */
struct fs_struct *fs;
/* open file information */
-@@ -1472,6 +1507,10 @@ struct task_struct {
+@@ -1467,6 +1502,10 @@ struct task_struct {
gfp_t lockdep_reclaim_gfp;
#endif
/* journalling filesystem info */
void *journal_info;
-@@ -1510,6 +1549,10 @@ struct task_struct {
+@@ -1505,6 +1544,10 @@ struct task_struct {
/* cg_list protected by css_set_lock and tsk->alloc_lock */
struct list_head cg_list;
#endif
#ifdef CONFIG_FUTEX
struct robust_list_head __user *robust_list;
#ifdef CONFIG_COMPAT
-@@ -1655,7 +1698,78 @@ struct task_struct {
+@@ -1644,7 +1687,78 @@ struct task_struct {
unsigned int sequential_io;
unsigned int sequential_io_avg;
#endif
/* Future-safe accessor for struct task_struct's cpus_allowed. */
#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
-@@ -1737,7 +1851,7 @@ struct pid_namespace;
+@@ -1726,7 +1840,7 @@ struct pid_namespace;
pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
struct pid_namespace *ns);
{
return tsk->pid;
}
-@@ -2084,6 +2198,25 @@ extern u64 sched_clock_cpu(int cpu);
+@@ -2095,6 +2209,25 @@ extern u64 sched_clock_cpu(int cpu);
extern void sched_clock_init(void);
#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
static inline void sched_clock_tick(void)
{
-@@ -2217,7 +2350,9 @@ void yield(void);
+@@ -2228,7 +2361,9 @@ void yield(void);
extern struct exec_domain default_exec_domain;
union thread_union {
unsigned long stack[THREAD_SIZE/sizeof(long)];
};
-@@ -2250,6 +2385,7 @@ extern struct pid_namespace init_pid_ns;
+@@ -2261,6 +2396,7 @@ extern struct pid_namespace init_pid_ns;
*/
extern struct task_struct *find_task_by_vpid(pid_t nr);
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
struct pid_namespace *ns);
-@@ -2412,7 +2548,7 @@ extern void __cleanup_sighand(struct sighand_struct *);
+@@ -2425,7 +2561,7 @@ extern void __cleanup_sighand(struct sighand_struct *);
extern void exit_itimers(struct signal_struct *);
extern void flush_itimer_signals(void);
extern int do_execve(struct filename *,
const char __user * const __user *,
-@@ -2614,9 +2750,9 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
+@@ -2640,9 +2776,9 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
#endif
extern unsigned int sysctl_sched_latency;
extern unsigned int sysctl_sched_min_granularity;
-diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
-index 4054b09..6f19cfd 100644
---- a/include/linux/seccomp.h
-+++ b/include/linux/seccomp.h
-@@ -76,6 +76,7 @@ static inline int seccomp_mode(struct seccomp *s)
- #ifdef CONFIG_SECCOMP_FILTER
- extern void put_seccomp_filter(struct task_struct *tsk);
- extern void get_seccomp_filter(struct task_struct *tsk);
-+extern u32 seccomp_bpf_load(int off);
- #else /* CONFIG_SECCOMP_FILTER */
- static inline void put_seccomp_filter(struct task_struct *tsk)
- {
diff --git a/include/linux/security.h b/include/linux/security.h
-index 9c6b972..7e7c704 100644
+index 623f90e..90b39da 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -27,6 +27,7 @@
#ifdef CONFIG_MMU
extern unsigned long mmap_min_addr;
extern unsigned long dac_mmap_min_addr;
-@@ -1719,7 +1718,7 @@ struct security_operations {
+@@ -1729,7 +1728,7 @@ struct security_operations {
struct audit_context *actx);
void (*audit_rule_free) (void *lsmrule);
#endif /* CONFIG_AUDIT */
int single_release(struct inode *, struct file *);
void *__seq_open_private(struct file *, const struct seq_operations *, int);
diff --git a/include/linux/shm.h b/include/linux/shm.h
-index 57d7770..0936af6 100644
+index 6fb8016..ab4465e 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
-@@ -20,6 +20,10 @@ struct shmid_kernel /* private to the kernel */
-
+@@ -22,6 +22,10 @@ struct shmid_kernel /* private to the kernel */
/* The task created the shm object. NULL if the task is dead. */
struct task_struct *shm_creator;
+ struct list_head shm_clist; /* list by creator */
+#ifdef CONFIG_GRKERNSEC
-+ time_t shm_createtime;
++ u64 shm_createtime;
+ pid_t shm_lapid;
+#endif
};
/* shm_mode upper byte flags */
diff --git a/include/linux/signal.h b/include/linux/signal.h
-index c9e6536..923b302 100644
+index 750196f..ae7a3a4 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
-@@ -293,7 +293,7 @@ static inline void allow_signal(int sig)
+@@ -292,7 +292,7 @@ static inline void allow_signal(int sig)
* know it'll be handled, so that they don't get converted to
* SIGKILL or just silently dropped.
*/
static inline void disallow_signal(int sig)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
-index ec89301..4fd29a6 100644
+index abde271..bc9ece1 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -725,7 +725,7 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
+@@ -728,7 +728,7 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int flags,
int node);
struct sk_buff *build_skb(void *data, unsigned int frag_size);
gfp_t priority)
{
return __alloc_skb(size, priority, 0, NUMA_NO_NODE);
-@@ -1839,7 +1839,7 @@ static inline u32 skb_inner_network_header_len(const struct sk_buff *skb)
+@@ -1845,7 +1845,7 @@ static inline u32 skb_inner_network_header_len(const struct sk_buff *skb)
return skb->inner_transport_header - skb->inner_network_header;
}
{
return skb_network_header(skb) - skb->data;
}
-@@ -1911,7 +1911,7 @@ static inline void skb_pop_rcv_encapsulation(struct sk_buff *skb)
+@@ -1917,7 +1917,7 @@ static inline void skb_pop_rcv_encapsulation(struct sk_buff *skb)
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
*/
#ifndef NET_SKB_PAD
#endif
int ___pskb_trim(struct sk_buff *skb, unsigned int len);
-@@ -2518,7 +2518,7 @@ struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
+@@ -2524,7 +2524,7 @@ struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
int *err);
unsigned int datagram_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait);
struct iovec *to, int size);
int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen,
struct iovec *iov);
-@@ -2664,6 +2664,8 @@ static inline ktime_t net_invalid_timestamp(void)
- return ktime_set(0, 0);
- }
-
-+void skb_timestamping_init(void);
-+
- #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING
-
- void skb_clone_tx_timestamp(struct sk_buff *skb);
-@@ -2907,6 +2909,9 @@ static inline void nf_reset(struct sk_buff *skb)
+@@ -2918,6 +2918,9 @@ static inline void nf_reset(struct sk_buff *skb)
nf_bridge_put(skb->nf_bridge);
skb->nf_bridge = NULL;
#endif
__SONET_ITEMS
#undef __HANDLE_ITEM
};
+diff --git a/include/linux/string.h b/include/linux/string.h
+index d36977e..3b42b37 100644
+--- a/include/linux/string.h
++++ b/include/linux/string.h
+@@ -132,7 +132,7 @@ int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4);
+ #endif
+
+ extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
+- const void *from, size_t available);
++ const void *from, size_t available);
+
+ /**
+ * strstarts - does @str start with @prefix?
+@@ -144,7 +144,8 @@ static inline bool strstarts(const char *str, const char *prefix)
+ return strncmp(str, prefix, strlen(prefix)) == 0;
+ }
+
+-extern size_t memweight(const void *ptr, size_t bytes);
++size_t memweight(const void *ptr, size_t bytes);
++void memzero_explicit(void *s, size_t count);
+
+ /**
+ * kbasename - return the last part of a pathname.
diff --git a/include/linux/sunrpc/addr.h b/include/linux/sunrpc/addr.h
index 07d8e53..dc934c9 100644
--- a/include/linux/sunrpc/addr.h
#ifdef __KERNEL__
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
-index 1bc7cd0..7912dc2 100644
+index cf61ecd..a4a9bc0 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -417,7 +417,7 @@ struct svc_procedure {
/*
* Function prototypes.
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
-index 5cf99a0..c0a1b98 100644
+index 975da75..318c083 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -53,15 +53,15 @@ extern unsigned int svcrdma_ord;
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 b0881a0..559a440 100644
+index 0f86d85..dff3419 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -98,10 +98,16 @@ struct sigaltstack;
#define __SC_CAST(t, a) (t) a
#define __SC_ARGS(t, a) a
#define __SC_TEST(t, a) (void)BUILD_BUG_ON_ZERO(!__TYPE_IS_LL(t) && sizeof(t) > sizeof(long))
-@@ -379,11 +385,11 @@ asmlinkage long sys_sync(void);
+@@ -383,11 +389,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);
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,
-@@ -595,7 +601,7 @@ asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *);
+@@ -599,7 +605,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,
extern void register_syscore_ops(struct syscore_ops *ops);
extern void unregister_syscore_ops(struct syscore_ops *ops);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
-index 14a8ff2..fa95f3a 100644
+index b7361f8..341a15a 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
-@@ -34,13 +34,13 @@ struct ctl_table_root;
- struct ctl_table_header;
- struct ctl_dir;
-
--typedef struct ctl_table ctl_table;
--
- typedef int proc_handler (struct ctl_table *ctl, int write,
- void __user *buffer, size_t *lenp, loff_t *ppos);
+@@ -39,6 +39,8 @@ typedef int proc_handler (struct ctl_table *ctl, int write,
extern int proc_dostring(struct ctl_table *, int,
void __user *, size_t *, loff_t *);
extern int proc_dointvec(struct ctl_table *, int,
void __user *, size_t *, loff_t *);
extern int proc_dointvec_minmax(struct ctl_table *, int,
-@@ -115,7 +115,9 @@ struct ctl_table
+@@ -113,7 +115,8 @@ struct ctl_table
struct ctl_table_poll *poll;
void *extra1;
void *extra2;
-};
+} __do_const __randomize_layout;
+typedef struct ctl_table __no_const ctl_table_no_const;
-+typedef struct ctl_table ctl_table;
struct ctl_node {
struct rb_node node;
#endif /* _LINUX_THREAD_INFO_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
-index 1c3316a..ae83b9f 100644
+index 8413294..44391c7 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -202,7 +202,7 @@ struct tty_port {
/* Each of a tty's open files has private_data pointing to tty_file_private */
struct tty_file_private {
-@@ -550,7 +550,7 @@ extern int tty_port_open(struct tty_port *port,
+@@ -548,7 +548,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)
{
extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
-index 756a609..89db85e 100644
+index e48c608..6a19af2 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
-@@ -285,7 +285,7 @@ struct tty_operations {
+@@ -287,7 +287,7 @@ struct tty_operations {
void (*poll_put_char)(struct tty_driver *driver, int line, char ch);
#endif
const struct file_operations *proc_fops;
struct tty_driver {
int magic; /* magic number for this structure */
-@@ -319,7 +319,7 @@ struct tty_driver {
+@@ -321,7 +321,7 @@ struct tty_driver {
const struct tty_operations *ops;
struct list_head tty_drivers;
}
static inline void put_unaligned_le16(u16 val, void *p)
+diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
+index 4f844c6..60beb5d 100644
+--- a/include/linux/uprobes.h
++++ b/include/linux/uprobes.h
+@@ -98,11 +98,11 @@ struct uprobes_state {
+ struct xol_area *xol_area;
+ };
+
+-extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
+-extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
+-extern bool __weak is_swbp_insn(uprobe_opcode_t *insn);
+-extern bool __weak is_trap_insn(uprobe_opcode_t *insn);
+-extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs);
++extern int set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
++extern int set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
++extern bool is_swbp_insn(uprobe_opcode_t *insn);
++extern bool is_trap_insn(uprobe_opcode_t *insn);
++extern unsigned long uprobe_get_swbp_addr(struct pt_regs *regs);
+ extern unsigned long uprobe_get_trap_addr(struct pt_regs *regs);
+ extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t);
+ extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
+@@ -128,8 +128,8 @@ extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk);
+ extern int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data);
+ extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs);
+ extern unsigned long arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs *regs);
+-extern bool __weak arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs *regs);
+-extern void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
++extern bool arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs *regs);
++extern void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
+ void *src, unsigned long len);
+ #else /* !CONFIG_UPROBES */
+ struct uprobes_state {
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d2465bc..5256de4 100644
--- a/include/linux/usb.h
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 e452ba6..78f8e80 100644
+index d5952bb..9a626d4 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -39,7 +39,7 @@ enum {
/*
* callback functions for platform
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
-index 4836ba3..603f6ee 100644
+index e953726..8edb26a 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -33,7 +33,7 @@ struct user_namespace {
+ MODULE_GRSEC MODULE_RANDSTRUCT_PLUGIN
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
-index 502073a..a7de024 100644
+index b483abd..af305ad 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
-@@ -63,8 +63,8 @@ int vga_switcheroo_get_client_state(struct pci_dev *dev);
+@@ -63,9 +63,9 @@ int vga_switcheroo_get_client_state(struct pci_dev *dev);
void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic);
-int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain);
--int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain);
+int vga_switcheroo_init_domain_pm_ops(struct device *dev, dev_pm_domain_no_const *domain);
+ void vga_switcheroo_fini_domain_pm_ops(struct device *dev);
+-int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain);
+int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, dev_pm_domain_no_const *domain);
#else
static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {}
-@@ -81,8 +81,8 @@ static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return
+@@ -82,9 +82,9 @@ static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return
static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {}
-static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
--static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
+static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, dev_pm_domain_no_const *domain) { return -EINVAL; }
+ static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {}
+-static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
+static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, dev_pm_domain_no_const *domain) { return -EINVAL; }
#endif
#endif /* _LINUX_VGA_SWITCHEROO_H_ */
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
-index 4b8a891..e9a2863 100644
+index b87696f..1d11de7 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -16,6 +16,11 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */
ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
int __vfs_setxattr_noperm(struct dentry *, const char *, const void *, size_t, int);
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
-index 9c5a6b4..09c9438 100644
+index 92dbbd3..13ab0b3 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -31,6 +31,7 @@
Returns the number of bytes that needs to be allocated for a per-
stream workspace with the specified parameters. A pointer to this
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
-index eec6e46..82d5641 100644
+index eb76cfd..9fd0e7c 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
-@@ -77,7 +77,7 @@ struct v4l2_file_operations {
+@@ -75,7 +75,7 @@ struct v4l2_file_operations {
int (*mmap) (struct file *, struct vm_area_struct *);
int (*open) (struct file *);
int (*release) (struct file *);
#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))
#define UNIXSID(skb) (&UNIXCB((skb)).secid)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
-index 4abdcb2..945c5cc 100644
+index 8df15ad..837fbedd 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
-@@ -601,7 +601,7 @@ struct l2cap_ops {
- long (*get_sndtimeo) (struct l2cap_chan *chan);
- struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
- unsigned long len, int nb);
+@@ -608,7 +608,7 @@ struct l2cap_ops {
+ unsigned char *kdata,
+ struct iovec *iov,
+ int len);
-};
+} __do_const;
#endif
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
-index 93695f0..766d71c 100644
+index af10c2c..a431cc5 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -120,7 +120,7 @@ struct genl_ops {
return;
}
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
-index 7a43138..bc76865 100644
+index 5fbe656..9ed3d8b 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
-@@ -62,7 +62,7 @@ struct inet_connection_sock_af_ops {
- void (*addr2sockaddr)(struct sock *sk, struct sockaddr *);
+@@ -63,7 +63,7 @@ struct inet_connection_sock_af_ops {
int (*bind_conflict)(const struct sock *sk,
const struct inet_bind_bucket *tb, bool relax);
+ void (*mtu_reduced)(struct sock *sk);
-};
+} __do_const;
struct rcu_head rcu;
struct inet_peer *gc_next;
diff --git a/include/net/ip.h b/include/net/ip.h
-index 7596eb2..f7f5fad 100644
+index db4a771..965a42a 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
-@@ -309,7 +309,7 @@ static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
+@@ -316,7 +316,7 @@ static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
}
}
struct llc_sap_state {
u8 curr_state;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index 421b6ec..5a03729 100644
+index dae2e24..89336e6 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
-@@ -4588,7 +4588,7 @@ struct rate_control_ops {
+@@ -4650,7 +4650,7 @@ struct rate_control_ops {
void (*remove_sta_debugfs)(void *priv, void *priv_sta);
u32 (*get_expected_throughput)(void *priv_sta);
static inline int neigh_parms_family(struct neigh_parms *p)
{
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
-index 361d260..903d15f 100644
+index e0d6466..e2f3003 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -129,8 +129,8 @@ struct net {
/*
* Use these carefully. If you implement a network device and it
-@@ -344,23 +348,23 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
+@@ -344,12 +348,12 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
static inline int rt_genid_ipv4(struct net *net)
{
+ atomic_inc_unchecked(&net->ipv4.rt_genid);
}
- #if IS_ENABLED(CONFIG_IPV6)
- static inline int rt_genid_ipv6(struct net *net)
- {
-- return atomic_read(&net->ipv6.rt_genid);
-+ return atomic_read_unchecked(&net->ipv6.rt_genid);
- }
-
- static inline void rt_genid_bump_ipv6(struct net *net)
- {
-- atomic_inc(&net->ipv6.rt_genid);
-+ atomic_inc_unchecked(&net->ipv6.rt_genid);
- }
- #else
- static inline int rt_genid_ipv6(struct net *net)
-@@ -390,12 +394,12 @@ static inline void rt_genid_bump_all(struct net *net)
+ extern void (*__fib6_flush_trees)(struct net *net);
+@@ -376,12 +380,12 @@ static inline void rt_genid_bump_all(struct net *net)
static inline int fnhe_genid(struct net *net)
{
size_t len, struct dma_pinned_list *pinned_list);
diff --git a/include/net/netlink.h b/include/net/netlink.h
-index 2b47eaa..6d5bcc2 100644
+index 6c10762..3e5de0c 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -521,7 +521,7 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb)
/**
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
-index 773cce3..6a11852 100644
+index 29d6a94..235d3d8 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
-@@ -13,10 +13,10 @@ struct nf_conntrack_ecache;
+@@ -14,10 +14,10 @@ struct nf_conntrack_ecache;
struct nf_proto_net {
#ifdef CONFIG_SYSCTL
struct ctl_table_header *ctl_table_header;
#endif
#endif
unsigned int users;
-@@ -59,7 +59,7 @@ struct nf_ip_net {
+@@ -60,7 +60,7 @@ struct nf_ip_net {
struct nf_icmp_net icmpv6;
#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
struct ctl_table_header *ctl_table_header;
};
#endif
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
-index 19d3446..3c87195 100644
+index eade27a..42894dd 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
-@@ -74,8 +74,8 @@ struct netns_ipv6 {
+@@ -75,8 +75,8 @@ struct netns_ipv6 {
struct fib_rules_ops *mr6_rules_ops;
#endif
#endif
#define INET6_PROTO_NOPOLICY 0x1
#define INET6_PROTO_FINAL 0x2
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
-index 72240e5..8c14bef 100644
+index e21b9f9..0191ef0 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -93,7 +93,7 @@ struct rtnl_link_ops {
/* Get the size of a DATA chunk payload. */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
-index f38588bf..94c1795 100644
+index 4ff3f67..89ae38e 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
-@@ -507,7 +507,7 @@ struct sctp_pf {
- struct sctp_association *asoc);
- void (*addr_v4map) (struct sctp_sock *, union sctp_addr *);
+@@ -509,7 +509,7 @@ struct sctp_pf {
+ void (*to_sk_saddr)(union sctp_addr *, struct sock *sk);
+ void (*to_sk_daddr)(union sctp_addr *, struct sock *sk);
struct sctp_af *af;
-};
+} __do_const;
/* Structure to track chunk fragments that have been acked, but peer
diff --git a/include/net/sock.h b/include/net/sock.h
-index 1563507..20d5d0e 100644
+index b9a5bd0..dcd5f3c 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
-@@ -349,7 +349,7 @@ struct sock {
+@@ -356,7 +356,7 @@ struct sock {
unsigned int sk_napi_id;
unsigned int sk_ll_usec;
#endif
int sk_rcvbuf;
struct sk_filter __rcu *sk_filter;
-@@ -1038,7 +1038,7 @@ struct proto {
+@@ -1053,7 +1053,7 @@ struct proto {
void (*destroy_cgroup)(struct mem_cgroup *memcg);
struct cg_proto *(*proto_cgroup)(struct mem_cgroup *memcg);
#endif
/*
* Bits in struct cg_proto.flags
-@@ -1225,7 +1225,7 @@ static inline u64 memcg_memory_allocated_read(struct cg_proto *prot)
+@@ -1240,7 +1240,7 @@ static inline u64 memcg_memory_allocated_read(struct cg_proto *prot)
return ret >> PAGE_SHIFT;
}
sk_memory_allocated(const struct sock *sk)
{
struct proto *prot = sk->sk_prot;
-@@ -1370,7 +1370,7 @@ struct sock_iocb {
+@@ -1385,7 +1385,7 @@ struct sock_iocb {
struct scm_cookie *scm;
struct msghdr *msg, async_msg;
struct kiocb *kiocb;
static inline struct sock_iocb *kiocb_to_siocb(struct kiocb *iocb)
{
-@@ -1623,6 +1623,33 @@ void sk_common_release(struct sock *sk);
- /* Initialise core socket variables */
- void sock_init_data(struct socket *sock, struct sock *sk);
-
-+void sk_filter_release_rcu(struct rcu_head *rcu);
-+
-+/**
-+ * sk_filter_release - release a socket filter
-+ * @fp: filter to remove
-+ *
-+ * Remove a filter from a socket and release its resources.
-+ */
-+
-+static inline void sk_filter_release(struct sk_filter *fp)
-+{
-+ if (atomic_dec_and_test(&fp->refcnt))
-+ call_rcu(&fp->rcu, sk_filter_release_rcu);
-+}
-+
-+static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
-+{
-+ atomic_sub(sk_filter_size(fp->len), &sk->sk_omem_alloc);
-+ sk_filter_release(fp);
-+}
-+
-+static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
-+{
-+ atomic_inc(&fp->refcnt);
-+ atomic_add(sk_filter_size(fp->len), &sk->sk_omem_alloc);
-+}
-+
- /*
- * Socket reference counting postulates.
- *
-@@ -1805,7 +1832,7 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags)
+@@ -1820,7 +1820,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,
int copy, int offset)
{
if (skb->ip_summed == CHECKSUM_NONE) {
-@@ -2067,7 +2094,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk)
+@@ -2091,7 +2091,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk)
}
}
/**
* sk_page_frag - return an appropriate page_frag
diff --git a/include/net/tcp.h b/include/net/tcp.h
-index 7286db8..f1aa7dc 100644
+index 590e01a..76498f3 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
-@@ -535,7 +535,7 @@ void tcp_retransmit_timer(struct sock *sk);
+@@ -523,7 +523,7 @@ void tcp_retransmit_timer(struct sock *sk);
void tcp_xmit_retransmit_queue(struct sock *);
void tcp_simple_retransmit(struct sock *);
int tcp_trim_head(struct sock *, struct sk_buff *, u32);
void tcp_send_probe0(struct sock *);
void tcp_send_partial(struct sock *);
-@@ -708,8 +708,8 @@ struct tcp_skb_cb {
+@@ -696,8 +696,8 @@ struct tcp_skb_cb {
struct inet6_skb_parm h6;
#endif
} header; /* For incoming frames */
__u32 when; /* used to compute rtt's */
__u8 tcp_flags; /* TCP header flags. (tcp[13]) */
-@@ -723,7 +723,7 @@ struct tcp_skb_cb {
+@@ -713,7 +713,7 @@ struct tcp_skb_cb {
__u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */
/* 1 byte hole */
u8 qfull;
enum fc_lport_state state;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
-index 27ab310..60dc245 100644
+index 1a0d184..4fb841f 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
-@@ -187,9 +187,9 @@ struct scsi_device {
+@@ -185,9 +185,9 @@ struct scsi_device {
unsigned int max_device_blocked; /* what device_blocked counts down from */
#define SCSI_DEFAULT_DEVICE_BLOCKED 3
struct device sdev_gendev,
sdev_dev;
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
-index 8c79980..723f6f9 100644
+index 007a0bc..7188db8 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
-@@ -752,7 +752,8 @@ struct fc_function_template {
+@@ -756,7 +756,8 @@ struct fc_function_template {
unsigned long show_host_system_hostname:1;
unsigned long disable_target_scan:1;
/**
* struct snd_compr: Compressed device
diff --git a/include/sound/soc.h b/include/sound/soc.h
-index ed9e2d7..aad0887 100644
+index c83a334..27c8038 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
-@@ -798,7 +798,7 @@ struct snd_soc_codec_driver {
+@@ -817,7 +817,7 @@ struct snd_soc_codec_driver {
/* probe ordering - for components with runtime dependencies */
int probe_order;
int remove_order;
/* SoC platform interface */
struct snd_soc_platform_driver {
-@@ -845,7 +845,7 @@ struct snd_soc_platform_driver {
+@@ -861,7 +861,7 @@ struct snd_soc_platform_driver {
unsigned int (*read)(struct snd_soc_platform *, unsigned int);
int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
int (*bespoke_trigger)(struct snd_pcm_substream *, int);
-};
+} __do_const;
- struct snd_soc_platform {
+ struct snd_soc_dai_link_component {
const char *name;
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 9ec9864..e2ee1ee 100644
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
-index 1c09820..7f5ec79 100644
+index 3608beb..df39d8a 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -36,7 +36,7 @@ struct softirq_action;
#ifdef __HAVE_BUILTIN_BSWAP64__
return __builtin_bswap64(val);
diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
-index 6d67213..552fdd9 100644
+index 43aaba1..1c30b48 100644
--- a/include/uapi/linux/sysctl.h
+++ b/include/uapi/linux/sysctl.h
@@ -155,8 +155,6 @@ enum
enum
{
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
-index 168ff50..a921df2 100644
+index 778a329..1416ffb 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
-@@ -1253,7 +1253,7 @@ struct v4l2_ext_control {
+@@ -1285,7 +1285,7 @@ struct v4l2_ext_control {
union {
__s32 value;
__s64 value64;
- char *string;
+ char __user *string;
- };
- } __attribute__ ((packed));
-
+ __u8 *p_u8;
+ __u16 *p_u16;
+ __u32 *p_u32;
diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h
-index c38355c..17a57bc 100644
+index 1590c49..5eab462 100644
--- a/include/uapi/linux/xattr.h
+++ b/include/uapi/linux/xattr.h
@@ -73,5 +73,9 @@
void *pmi_pal;
u8 *vbe_state_orig; /*
diff --git a/init/Kconfig b/init/Kconfig
-index 9d76b99..d378b1e 100644
+index 80a6907..baf7d53 100644
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1105,6 +1105,7 @@ endif # CGROUPS
+@@ -1150,6 +1150,7 @@ endif # CGROUPS
config CHECKPOINT_RESTORE
bool "Checkpoint/restore support" if EXPERT
default n
help
Enables additional kernel features in a sake of checkpoint/restore.
-@@ -1589,7 +1590,7 @@ config SLUB_DEBUG
+@@ -1635,7 +1636,7 @@ config SLUB_DEBUG
config COMPAT_BRK
bool "Disable heap randomization"
help
Randomizing heap placement makes heap exploits harder, but it
also breaks ancient binaries (including anything libc5 based).
-@@ -1877,7 +1878,7 @@ config INIT_ALL_POSSIBLE
+@@ -1923,7 +1924,7 @@ config INIT_ALL_POSSIBLE
config STOP_MACHINE
bool
default y
{ INIT_THREAD_INFO(init_task) };
+#endif
diff --git a/init/initramfs.c b/init/initramfs.c
-index a8497fa..35b3c90 100644
+index bece48c..e911bd8 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
-@@ -84,7 +84,7 @@ static void __init free_hash(void)
+@@ -25,7 +25,7 @@ static ssize_t __init xwrite(int fd, const char *p, size_t count)
+
+ /* sys_write only can write MAX_RW_COUNT aka 2G-4K bytes at most */
+ while (count) {
+- ssize_t rv = sys_write(fd, p, count);
++ ssize_t rv = sys_write(fd, (char __force_user *)p, count);
+
+ if (rv < 0) {
+ if (rv == -EINTR || rv == -EAGAIN)
+@@ -107,7 +107,7 @@ static void __init free_hash(void)
}
}
{
struct timespec t[2];
-@@ -119,7 +119,7 @@ static void __init dir_utime(void)
+@@ -142,7 +142,7 @@ static void __init dir_utime(void)
struct dir_entry *de, *tmp;
list_for_each_entry_safe(de, tmp, &dir_list, list) {
list_del(&de->list);
kfree(de->name);
kfree(de);
}
-@@ -281,7 +281,7 @@ static int __init maybe_link(void)
+@@ -304,7 +304,7 @@ static int __init maybe_link(void)
if (nlink >= 2) {
char *old = find_link(major, minor, ino, mode, collected);
if (old)
}
return 0;
}
-@@ -290,11 +290,11 @@ static void __init clean_path(char *path, umode_t mode)
+@@ -313,11 +313,11 @@ static void __init clean_path(char *path, umode_t mode)
{
struct stat st;
}
}
-@@ -315,7 +315,7 @@ static int __init do_name(void)
+@@ -338,7 +338,7 @@ static int __init do_name(void)
int openflags = O_WRONLY|O_CREAT;
if (ml != 1)
openflags |= O_TRUNC;
if (wfd >= 0) {
sys_fchown(wfd, uid, gid);
-@@ -327,17 +327,17 @@ static int __init do_name(void)
+@@ -350,17 +350,17 @@ static int __init do_name(void)
}
}
} else if (S_ISDIR(mode)) {
}
}
return 0;
-@@ -346,15 +346,15 @@ static int __init do_name(void)
- static int __init do_copy(void)
- {
- if (count >= body_len) {
-- sys_write(wfd, victim, body_len);
-+ sys_write(wfd, (char __force_user *)victim, body_len);
+@@ -372,7 +372,7 @@ static int __init do_copy(void)
+ if (xwrite(wfd, victim, body_len) != body_len)
+ error("write error");
sys_close(wfd);
- do_utime(vcollected, mtime);
+ do_utime((char __force_user *)vcollected, mtime);
kfree(vcollected);
eat(body_len);
state = SkipIt;
- return 0;
- } else {
-- sys_write(wfd, victim, count);
-+ sys_write(wfd, (char __force_user *)victim, count);
- body_len -= count;
- eat(count);
- return 1;
-@@ -365,9 +365,9 @@ static int __init do_symlink(void)
+@@ -390,9 +390,9 @@ static int __init do_symlink(void)
{
collected[N_ALIGN(name_len) + body_len] = '\0';
clean_path(collected, 0);
next_state = Reset;
return 0;
diff --git a/init/main.c b/init/main.c
-index e8ae1fe..f60f98c 100644
+index bb1aed9..64f9745 100644
--- a/init/main.c
+++ b/init/main.c
@@ -98,6 +98,8 @@ extern void radix_tree_init(void);
+__setup("pax_softmode=", setup_pax_softmode);
+#endif
+
- 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 *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;
-@@ -727,7 +798,7 @@ static bool __init_or_module initcall_blacklisted(initcall_t fn)
+@@ -728,7 +799,7 @@ static bool __init_or_module initcall_blacklisted(initcall_t fn)
struct blacklist_entry *entry;
char *fn_name;
if (!fn_name)
return false;
-@@ -779,7 +850,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
+@@ -780,7 +851,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
{
int count = preempt_count();
int ret;
if (initcall_blacklisted(fn))
return -EPERM;
-@@ -789,18 +860,17 @@ int __init_or_module do_one_initcall(initcall_t fn)
+@@ -790,18 +861,17 @@ int __init_or_module do_one_initcall(initcall_t fn)
else
ret = fn();
return ret;
}
-@@ -907,8 +977,8 @@ static int run_init_process(const char *init_filename)
+@@ -908,8 +978,8 @@ static int run_init_process(const char *init_filename)
{
argv_init[0] = init_filename;
return do_execve(getname_kernel(init_filename),
}
static int try_to_run_init_process(const char *init_filename)
-@@ -925,6 +995,10 @@ static int try_to_run_init_process(const char *init_filename)
+@@ -926,6 +996,10 @@ static int try_to_run_init_process(const char *init_filename)
return ret;
}
static noinline void __init kernel_init_freeable(void);
static int __ref kernel_init(void *unused)
-@@ -949,6 +1023,11 @@ static int __ref kernel_init(void *unused)
+@@ -950,6 +1024,11 @@ static int __ref kernel_init(void *unused)
ramdisk_execute_command, ret);
}
/*
* We try each of these until one succeeds.
*
-@@ -1004,7 +1083,7 @@ static noinline void __init kernel_init_freeable(void)
+@@ -1005,7 +1084,7 @@ static noinline void __init kernel_init_freeable(void)
do_basic_setup();
/* Open the /dev/console on the rootfs, this should never fail */
pr_err("Warning: unable to open an initial console.\n");
(void) sys_dup(0);
-@@ -1017,11 +1096,13 @@ static noinline void __init kernel_init_freeable(void)
+@@ -1018,11 +1097,13 @@ static noinline void __init kernel_init_freeable(void)
if (!ramdisk_execute_command)
ramdisk_execute_command = "/init";
if (u->mq_bytes + mq_bytes < u->mq_bytes ||
u->mq_bytes + mq_bytes > rlimit(RLIMIT_MSGQUEUE)) {
diff --git a/ipc/shm.c b/ipc/shm.c
-index 89fc354..cf56786 100644
+index 7fc9f9f..95e201f 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -72,6 +72,14 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp);
+#ifdef CONFIG_GRKERNSEC
+extern int gr_handle_shmat(const pid_t shm_cprid, const pid_t shm_lapid,
-+ const time_t shm_createtime, const kuid_t cuid,
++ const u64 shm_createtime, const kuid_t cuid,
+ const int shmid);
+extern int gr_chroot_shmat(const pid_t shm_cprid, const pid_t shm_lapid,
-+ const time_t shm_createtime);
++ const u64 shm_createtime);
+#endif
+
void shm_init_ns(struct ipc_namespace *ns)
{
ns->shm_ctlmax = SHMMAX;
-@@ -557,6 +565,14 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
+@@ -559,6 +567,9 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
shp->shm_lprid = 0;
shp->shm_atim = shp->shm_dtim = 0;
shp->shm_ctim = get_seconds();
+#ifdef CONFIG_GRKERNSEC
-+ {
-+ struct timespec timeval;
-+ do_posix_clock_monotonic_gettime(&timeval);
-+
-+ shp->shm_createtime = timeval.tv_sec;
-+ }
++ shp->shm_createtime = ktime_get_ns();
+#endif
shp->shm_segsz = size;
shp->shm_nattch = 0;
shp->shm_file = file;
-@@ -1092,6 +1108,12 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
+@@ -1095,6 +1106,12 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
f_mode = FMODE_READ | FMODE_WRITE;
}
if (shmflg & SHM_EXEC) {
prot |= PROT_EXEC;
acc_mode |= S_IXUGO;
}
-@@ -1116,6 +1138,15 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
+@@ -1119,6 +1136,15 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
if (err)
goto out_unlock;
ipc_lock_object(&shp->shm_perm);
/* check if shm_destroy() is tearing down shp */
-@@ -1128,6 +1159,9 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
+@@ -1131,6 +1157,9 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
path = shp->shm_file->f_path;
path_get(&path);
shp->shm_nattch++;
/* is there some bit set in requested_mode but not in granted_mode? */
if ((requested_mode & ~granted_mode & 0007) &&
!ns_capable(ns->user_ns, CAP_IPC_OWNER))
-diff --git a/kernel/acct.c b/kernel/acct.c
-index 808a86f..da69695 100644
---- a/kernel/acct.c
-+++ b/kernel/acct.c
-@@ -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;
-- file->f_op->write(file, (char *)&ac,
-+ file->f_op->write(file, (char __force_user *)&ac,
- sizeof(acct_t), &file->f_pos);
- current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim;
- set_fs(fs);
diff --git a/kernel/audit.c b/kernel/audit.c
-index 3ef2e0e..8873765 100644
+index ba2ff5a..c6c0deb 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -122,7 +122,7 @@ u32 audit_sig_sid = 0;
task->sessionid = sessionid;
task->loginuid = loginuid;
+diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
+index 7f0dbcb..b54bb2c 100644
+--- a/kernel/bpf/core.c
++++ b/kernel/bpf/core.c
+@@ -22,6 +22,7 @@
+ */
+ #include <linux/filter.h>
+ #include <linux/skbuff.h>
++#include <linux/vmalloc.h>
+ #include <asm/unaligned.h>
+
+ /* Registers */
+@@ -63,6 +64,67 @@ void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, int k, uns
+ return NULL;
+ }
+
++struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags)
++{
++ gfp_t gfp_flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO |
++ gfp_extra_flags;
++ struct bpf_work_struct *ws;
++ struct bpf_prog *fp;
++
++ size = round_up(size, PAGE_SIZE);
++ fp = __vmalloc(size, gfp_flags, PAGE_KERNEL);
++ if (fp == NULL)
++ return NULL;
++
++ ws = kmalloc(sizeof(*ws), GFP_KERNEL | gfp_extra_flags);
++ if (ws == NULL) {
++ vfree(fp);
++ return NULL;
++ }
++
++ fp->pages = size / PAGE_SIZE;
++ fp->work = ws;
++
++ return fp;
++}
++EXPORT_SYMBOL_GPL(bpf_prog_alloc);
++
++struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
++ gfp_t gfp_extra_flags)
++{
++ gfp_t gfp_flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO |
++ gfp_extra_flags;
++ struct bpf_prog *fp;
++
++ BUG_ON(fp_old == NULL);
++
++ size = round_up(size, PAGE_SIZE);
++ if (size <= fp_old->pages * PAGE_SIZE)
++ return fp_old;
++
++ fp = __vmalloc(size, gfp_flags, PAGE_KERNEL);
++ if (fp != NULL) {
++ memcpy(fp, fp_old, fp_old->pages * PAGE_SIZE);
++ fp->pages = size / PAGE_SIZE;
++
++ /* We keep fp->work from fp_old around in the new
++ * reallocated structure.
++ */
++ fp_old->work = NULL;
++ __bpf_prog_free(fp_old);
++ }
++
++ return fp;
++}
++EXPORT_SYMBOL_GPL(bpf_prog_realloc);
++
++void __bpf_prog_free(struct bpf_prog *fp)
++{
++ kfree(fp->work);
++ vfree(fp);
++}
++EXPORT_SYMBOL_GPL(__bpf_prog_free);
++
+ /* Base function for offset calculation. Needs to go into .text section,
+ * therefore keeping it non-static as well; will also be used by JITs
+ * anyway later on, so do not let the compiler omit it.
+@@ -523,12 +585,26 @@ void bpf_prog_select_runtime(struct bpf_prog *fp)
+
+ /* Probe if internal BPF can be JITed */
+ bpf_int_jit_compile(fp);
++ /* Lock whole bpf_prog as read-only */
++ bpf_prog_lock_ro(fp);
+ }
+ EXPORT_SYMBOL_GPL(bpf_prog_select_runtime);
+
+-/* free internal BPF program */
++static void bpf_prog_free_deferred(struct work_struct *work)
++{
++ struct bpf_work_struct *ws;
++
++ ws = container_of(work, struct bpf_work_struct, work);
++ bpf_jit_free(ws->prog);
++}
++
++/* Free internal BPF program */
+ void bpf_prog_free(struct bpf_prog *fp)
+ {
+- bpf_jit_free(fp);
++ struct bpf_work_struct *ws = fp->work;
++
++ INIT_WORK(&ws->work, bpf_prog_free_deferred);
++ ws->prog = fp;
++ schedule_work(&ws->work);
+ }
+ EXPORT_SYMBOL_GPL(bpf_prog_free);
diff --git a/kernel/capability.c b/kernel/capability.c
-index a5cf13c..07a2647 100644
+index 989f5bf..d317ca0 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -192,6 +192,9 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
if (copy_to_user(dataptr, kdata, tocopy
* sizeof(struct __user_cap_data_struct))) {
return -EFAULT;
-@@ -293,10 +296,11 @@ bool has_ns_capability(struct task_struct *t,
+@@ -297,10 +300,11 @@ bool has_ns_capability(struct task_struct *t,
int ret;
rcu_read_lock();
}
/**
-@@ -333,10 +337,10 @@ bool has_ns_capability_noaudit(struct task_struct *t,
+@@ -337,10 +341,10 @@ bool has_ns_capability_noaudit(struct task_struct *t,
int ret;
rcu_read_lock();
}
/**
-@@ -374,7 +378,7 @@ bool ns_capable(struct user_namespace *ns, int cap)
+@@ -378,7 +382,7 @@ bool ns_capable(struct user_namespace *ns, int cap)
BUG();
}
current->flags |= PF_SUPERPRIV;
return true;
}
-@@ -382,6 +386,21 @@ bool ns_capable(struct user_namespace *ns, int cap)
+@@ -386,6 +390,21 @@ bool ns_capable(struct user_namespace *ns, int cap)
}
EXPORT_SYMBOL(ns_capable);
/**
* file_ns_capable - Determine if the file's opener had a capability in effect
* @file: The file we want to check
-@@ -423,6 +442,12 @@ bool capable(int cap)
+@@ -427,6 +446,12 @@ bool capable(int cap)
}
EXPORT_SYMBOL(capable);
/**
* capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped
* @inode: The inode in question
-@@ -440,3 +465,12 @@ bool capable_wrt_inode_uidgid(const struct inode *inode, int cap)
+@@ -444,3 +469,12 @@ bool capable_wrt_inode_uidgid(const struct inode *inode, int cap)
kgid_has_mapping(ns, inode->i_gid);
}
EXPORT_SYMBOL(capable_wrt_inode_uidgid);
+}
+EXPORT_SYMBOL(capable_wrt_inode_uidgid_nolog);
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
-index 70776ae..09c4988 100644
+index 3a73f99..4f29fea 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
-@@ -5146,6 +5146,14 @@ static void cgroup_release_agent(struct work_struct *work)
+@@ -5341,6 +5341,14 @@ static void cgroup_release_agent(struct work_struct *work)
release_list);
list_del_init(&cgrp->release_list);
raw_spin_unlock(&release_list_lock);
pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
if (!pathbuf)
goto continue_free;
-@@ -5336,7 +5344,7 @@ static int cgroup_css_links_read(struct seq_file *seq, void *v)
+@@ -5539,7 +5547,7 @@ static int cgroup_css_links_read(struct seq_file *seq, void *v)
struct task_struct *task;
int count = 0;
list_for_each_entry(task, &cset->tasks, cg_list) {
if (count++ > MAX_TASKS_SHOWN_PER_CSS)
diff --git a/kernel/compat.c b/kernel/compat.c
-index 633394f..bdfa969 100644
+index ebb3c36..1df606e 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -13,6 +13,7 @@
HRTIMER_MODE_REL, CLOCK_MONOTONIC);
set_fs(oldfs);
-@@ -361,7 +362,7 @@ COMPAT_SYSCALL_DEFINE1(sigpending, compat_old_sigset_t __user *, set)
+@@ -379,7 +380,7 @@ COMPAT_SYSCALL_DEFINE1(sigpending, compat_old_sigset_t __user *, set)
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
set_fs(old_fs);
if (ret == 0)
ret = put_user(s, set);
-@@ -451,7 +452,7 @@ COMPAT_SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
+@@ -469,7 +470,7 @@ COMPAT_SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
set_fs(old_fs);
if (!ret) {
-@@ -533,8 +534,8 @@ COMPAT_SYSCALL_DEFINE4(wait4,
+@@ -551,8 +552,8 @@ COMPAT_SYSCALL_DEFINE4(wait4,
set_fs (KERNEL_DS);
ret = sys_wait4(pid,
(stat_addr ?
set_fs (old_fs);
if (ret > 0) {
-@@ -560,8 +561,8 @@ COMPAT_SYSCALL_DEFINE5(waitid,
+@@ -578,8 +579,8 @@ COMPAT_SYSCALL_DEFINE5(waitid,
memset(&info, 0, sizeof(info));
set_fs(KERNEL_DS);
set_fs(old_fs);
if ((ret < 0) || (info.si_signo == 0))
-@@ -695,8 +696,8 @@ COMPAT_SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
+@@ -713,8 +714,8 @@ COMPAT_SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_timer_settime(timer_id, flags,
set_fs(oldfs);
if (!err && old && put_compat_itimerspec(old, &oldts))
return -EFAULT;
-@@ -713,7 +714,7 @@ COMPAT_SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
+@@ -731,7 +732,7 @@ COMPAT_SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_timer_gettime(timer_id,
set_fs(oldfs);
if (!err && put_compat_itimerspec(setting, &ts))
return -EFAULT;
-@@ -732,7 +733,7 @@ COMPAT_SYSCALL_DEFINE2(clock_settime, clockid_t, which_clock,
+@@ -750,7 +751,7 @@ COMPAT_SYSCALL_DEFINE2(clock_settime, clockid_t, which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_settime(which_clock,
set_fs(oldfs);
return err;
}
-@@ -747,7 +748,7 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,
+@@ -765,7 +766,7 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_gettime(which_clock,
set_fs(oldfs);
if (!err && compat_put_timespec(&ts, tp))
return -EFAULT;
-@@ -767,7 +768,7 @@ COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock,
+@@ -785,7 +786,7 @@ COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
set_fs(oldfs);
err = compat_put_timex(utp, &txc);
-@@ -787,7 +788,7 @@ COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock,
+@@ -805,7 +806,7 @@ COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_getres(which_clock,
set_fs(oldfs);
if (!err && tp && compat_put_timespec(&ts, tp))
return -EFAULT;
-@@ -801,7 +802,7 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
+@@ -819,7 +820,7 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
struct timespec tu;
struct compat_timespec __user *rmtp = restart->nanosleep.compat_rmtp;
oldfs = get_fs();
set_fs(KERNEL_DS);
err = clock_nanosleep_restart(restart);
-@@ -833,8 +834,8 @@ COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags,
+@@ -851,8 +852,8 @@ COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags,
oldfs = get_fs();
set_fs(KERNEL_DS);
err = sys_clock_nanosleep(which_clock, flags,
set_fs(oldfs);
if ((err == -ERESTART_RESTARTBLOCK) && rmtp &&
-@@ -1128,7 +1129,7 @@ COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval,
+@@ -1146,7 +1147,7 @@ COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval,
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
}
EXPORT_SYMBOL_GPL(kgdb_schedule_breakpoint);
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
-index 2f7c760..95b6a66 100644
+index 379650b..30c5180 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1977,7 +1977,7 @@ static int kdb_lsmod(int argc, const char **argv)
#ifdef CONFIG_MODULE_UNLOAD
{
diff --git a/kernel/events/core.c b/kernel/events/core.c
-index 6b17ac1..00fd505 100644
+index 963bf13..a78dd3e 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
-@@ -160,8 +160,15 @@ static struct srcu_struct pmus_srcu;
+@@ -161,8 +161,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
/* Minimum for 512 kiB + 1 user control page */
int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */
-@@ -187,7 +194,7 @@ void update_perf_cpu_limits(void)
+@@ -188,7 +195,7 @@ void update_perf_cpu_limits(void)
tmp *= sysctl_perf_cpu_time_max_percent;
do_div(tmp, 100);
}
static int perf_rotate_context(struct perf_cpu_context *cpuctx);
-@@ -293,7 +300,7 @@ void perf_sample_event_took(u64 sample_len_ns)
+@@ -294,7 +301,7 @@ void perf_sample_event_took(u64 sample_len_ns)
}
}
static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx,
enum event_type_t event_type);
-@@ -3023,7 +3030,7 @@ static void __perf_event_read(void *info)
+@@ -3034,7 +3041,7 @@ static void __perf_event_read(void *info)
static inline u64 perf_event_count(struct perf_event *event)
{
}
static u64 perf_event_read(struct perf_event *event)
-@@ -3399,9 +3406,9 @@ u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running)
+@@ -3410,9 +3417,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 +
list_for_each_entry(child, &event->child_list, child_list) {
total += perf_event_read(child);
-@@ -3830,10 +3837,10 @@ void perf_event_update_userpage(struct perf_event *event)
+@@ -3861,10 +3868,10 @@ void perf_event_update_userpage(struct perf_event *event)
userpg->offset -= local64_read(&event->hw.prev_count);
userpg->time_enabled = enabled +
arch_perf_update_userpage(userpg, now);
-@@ -4397,7 +4404,7 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
+@@ -4428,7 +4435,7 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
/* Data. */
sp = perf_user_stack_pointer(regs);
dyn_size = dump_size - rem;
perf_output_skip(handle, rem);
-@@ -4488,11 +4495,11 @@ static void perf_output_read_one(struct perf_output_handle *handle,
+@@ -4519,11 +4526,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 +
}
if (read_format & PERF_FORMAT_ID)
values[n++] = primary_event_id(event);
-@@ -6801,7 +6808,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
+@@ -6838,7 +6845,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));
event->state = PERF_EVENT_STATE_INACTIVE;
-@@ -7080,6 +7087,11 @@ SYSCALL_DEFINE5(perf_event_open,
+@@ -7117,6 +7124,11 @@ SYSCALL_DEFINE5(perf_event_open,
if (flags & ~PERF_FLAG_ALL)
return -EINVAL;
err = perf_copy_attr(attr_uptr, &attr);
if (err)
return err;
-@@ -7432,10 +7444,10 @@ static void sync_child_event(struct perf_event *child_event,
+@@ -7469,10 +7481,10 @@ static void sync_child_event(struct perf_event *child_event,
/*
* Add back the child's count to the parent's count:
*/
/* Callchain handling */
extern struct perf_callchain_entry *
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
-index 6f3254e..e4c1fe4 100644
+index 1d0af8a..9913530 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
-@@ -1670,7 +1670,7 @@ static int is_trap_at_addr(struct mm_struct *mm, unsigned long vaddr)
+@@ -1671,7 +1671,7 @@ static int is_trap_at_addr(struct mm_struct *mm, unsigned long vaddr)
{
struct page *page;
uprobe_opcode_t opcode;
pagefault_disable();
result = __copy_from_user_inatomic(&opcode, (void __user*)vaddr,
diff --git a/kernel/exit.c b/kernel/exit.c
-index e5c4668..592d2e5 100644
+index 32c58f7..9eb6907 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
-@@ -173,6 +173,10 @@ void release_task(struct task_struct * p)
+@@ -173,6 +173,10 @@ void release_task(struct task_struct *p)
struct task_struct *leader;
int zap_leader;
repeat:
/* don't need to get the RCU readlock here - the process is dead and
* can't be modifying its own credentials. But shut RCU-lockdep up */
rcu_read_lock();
-@@ -664,6 +668,8 @@ void do_exit(long code)
+@@ -668,6 +672,8 @@ void do_exit(long code)
struct task_struct *tsk = current;
int group_dead;
profile_task_exit(tsk);
WARN_ON(blk_needs_flush_plug(tsk));
-@@ -680,7 +686,6 @@ void do_exit(long code)
+@@ -684,7 +690,6 @@ void do_exit(long code)
* mm_release()->clear_child_tid() from writing to a user-controlled
* kernel address.
*/
ptrace_event(PTRACE_EVENT_EXIT, code);
-@@ -739,6 +744,9 @@ void do_exit(long code)
+@@ -742,6 +747,9 @@ void do_exit(long code)
tsk->exit_code = code;
taskstats_exit(tsk, group_dead);
exit_mm(tsk);
if (group_dead)
-@@ -858,7 +866,7 @@ SYSCALL_DEFINE1(exit, int, error_code)
+@@ -859,7 +867,7 @@ SYSCALL_DEFINE1(exit, int, error_code)
* Take down every thread in the group. This is called by fatal signals
* as well as by sys_exit_group (below).
*/
{
struct signal_struct *sig = current->signal;
diff --git a/kernel/fork.c b/kernel/fork.c
-index 6a13c46..a623c8e 100644
+index a91e47d..71c9064 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -183,6 +183,48 @@ void thread_info_cache_init(void)
+#ifdef CONFIG_GRKERNSEC_KSTACKOVERFLOW
+ tsk->lowmem_stack = lowmem_stack;
+#endif
-
- setup_thread_stack(tsk, orig);
- clear_user_return_notifier(tsk);
-@@ -323,7 +373,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
+ #ifdef CONFIG_SECCOMP
+ /*
+ * We must handle setting up seccomp filters once we're under
+@@ -332,7 +382,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
*stackend = STACK_END_MAGIC; /* for overflow detection */
#ifdef CONFIG_CC_STACKPROTECTOR
#endif
/*
-@@ -337,24 +387,92 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
+@@ -346,24 +396,92 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
tsk->splice_pipe = NULL;
tsk->task_frag.page = NULL;
+ atomic_dec(&inode->i_writecount);
+ mutex_lock(&mapping->i_mmap_mutex);
+ if (tmp->vm_flags & VM_SHARED)
-+ mapping->i_mmap_writable++;
++ atomic_inc(&mapping->i_mmap_writable);
+ flush_dcache_mmap_lock(mapping);
+ /* insert tmp into the share list, just after mpnt */
+ if (unlikely(tmp->vm_flags & VM_NONLINEAR))
uprobe_start_dup_mmap();
down_write(&oldmm->mmap_sem);
-@@ -383,55 +501,15 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -391,55 +509,15 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
prev = NULL;
for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) {
- atomic_dec(&inode->i_writecount);
- mutex_lock(&mapping->i_mmap_mutex);
- if (tmp->vm_flags & VM_SHARED)
-- mapping->i_mmap_writable++;
+- atomic_inc(&mapping->i_mmap_writable);
- flush_dcache_mmap_lock(mapping);
- /* insert tmp into the share list, just after mpnt */
- if (unlikely(tmp->vm_flags & VM_NONLINEAR))
}
/*
-@@ -463,6 +541,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
+@@ -471,6 +549,31 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
if (retval)
goto out;
}
/* a new mm has just been created */
arch_dup_mmap(oldmm, mm);
retval = 0;
-@@ -472,14 +575,6 @@ out:
+@@ -480,14 +583,6 @@ out:
up_write(&oldmm->mmap_sem);
uprobe_end_dup_mmap();
return retval;
}
static inline int mm_alloc_pgd(struct mm_struct *mm)
-@@ -698,8 +793,8 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
+@@ -729,8 +824,8 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
return ERR_PTR(err);
mm = get_task_mm(task);
mmput(mm);
mm = ERR_PTR(-EACCES);
}
-@@ -918,13 +1013,20 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
+@@ -933,13 +1028,20 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
spin_unlock(&fs->lock);
return -EAGAIN;
}
return 0;
}
-@@ -1133,7 +1235,7 @@ init_task_pid(struct task_struct *task, enum pid_type type, struct pid *pid)
+@@ -1173,7 +1275,7 @@ init_task_pid(struct task_struct *task, enum pid_type type, struct pid *pid)
* parts of the process environment (as per the clone
* flags). The actual kick-off is left to the caller.
*/
unsigned long stack_start,
unsigned long stack_size,
int __user *child_tidptr,
-@@ -1205,6 +1307,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
+@@ -1244,6 +1346,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
#endif
retval = -EAGAIN;
if (atomic_read(&p->real_cred->user->processes) >=
task_rlimit(p, RLIMIT_NPROC)) {
if (p->real_cred->user != INIT_USER &&
-@@ -1452,6 +1557,11 @@ static struct task_struct *copy_process(unsigned long clone_flags,
+@@ -1493,6 +1598,11 @@ static struct task_struct *copy_process(unsigned long clone_flags,
goto bad_fork_free_pid;
}
if (likely(p->pid)) {
ptrace_init_task(p, (clone_flags & CLONE_PTRACE) || trace);
-@@ -1541,6 +1651,8 @@ bad_fork_cleanup_count:
+@@ -1583,6 +1693,8 @@ bad_fork_cleanup_count:
bad_fork_free:
free_task(p);
fork_out:
return ERR_PTR(retval);
}
-@@ -1602,6 +1714,7 @@ long do_fork(unsigned long clone_flags,
+@@ -1644,6 +1756,7 @@ long do_fork(unsigned long clone_flags,
p = copy_process(clone_flags, stack_start, stack_size,
child_tidptr, NULL, trace);
/*
* Do this prior waking up the new thread - the thread pointer
* might get invalid after that point, if the thread exits quickly.
-@@ -1618,6 +1731,8 @@ long do_fork(unsigned long clone_flags,
+@@ -1660,6 +1773,8 @@ long do_fork(unsigned long clone_flags,
if (clone_flags & CLONE_PARENT_SETTID)
put_user(nr, parent_tidptr);
if (clone_flags & CLONE_VFORK) {
p->vfork_done = &vfork;
init_completion(&vfork);
-@@ -1736,7 +1851,7 @@ void __init proc_caches_init(void)
+@@ -1778,7 +1893,7 @@ void __init proc_caches_init(void)
mm_cachep = kmem_cache_create("mm_struct",
sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN,
SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL);
mmap_init();
nsproxy_cache_init();
}
-@@ -1776,7 +1891,7 @@ static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp)
+@@ -1818,7 +1933,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 */
return 0;
*new_fsp = copy_fs_struct(fs);
-@@ -1883,7 +1998,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
+@@ -1930,7 +2045,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
fs = current->fs;
spin_lock(&fs->lock);
current->fs = new_fs;
else
new_fs = fs;
diff --git a/kernel/futex.c b/kernel/futex.c
-index b632b5f..ca00da9 100644
+index 815d7af..3d0743b 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -202,7 +202,7 @@ struct futex_pi_state {
static const struct futex_q futex_q_init = {
/* list gets initialized in queue_me()*/
-@@ -394,6 +394,11 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
+@@ -343,6 +343,8 @@ static void get_futex_key_refs(union futex_key *key)
+ case FUT_OFF_MMSHARED:
+ futex_get_mm(key); /* implies MB (B) */
+ break;
++ default:
++ smp_mb(); /* explicit MB (B) */
+ }
+ }
+
+@@ -394,6 +396,11 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
struct page *page, *page_head;
int err, ro = 0;
/*
* The futex address must be "naturally" aligned.
*/
-@@ -593,7 +598,7 @@ static int cmpxchg_futex_value_locked(u32 *curval, u32 __user *uaddr,
+@@ -593,7 +600,7 @@ static int cmpxchg_futex_value_locked(u32 *curval, u32 __user *uaddr,
static int get_futex_value_locked(u32 *dest, u32 __user *from)
{
pagefault_disable();
ret = __copy_from_user_inatomic(dest, from, sizeof(u32));
-@@ -3033,6 +3038,7 @@ static void __init futex_detect_cmpxchg(void)
+@@ -2998,6 +3005,7 @@ static void __init futex_detect_cmpxchg(void)
{
#ifndef CONFIG_HAVE_FUTEX_CMPXCHG
u32 curval;
/*
* This will fail and we want it. Some arch implementations do
-@@ -3044,8 +3050,11 @@ static void __init futex_detect_cmpxchg(void)
+@@ -3009,8 +3017,11 @@ static void __init futex_detect_cmpxchg(void)
* implementation, the non-functional ones will return
* -ENOSYS.
*/
gcov_info_unlink(prev, info);
if (gcov_events_enabled)
gcov_event(GCOV_REMOVE, info);
-diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
-index 3ab2899..c6ad010 100644
---- a/kernel/hrtimer.c
-+++ b/kernel/hrtimer.c
-@@ -1449,7 +1449,7 @@ void hrtimer_peek_ahead_timers(void)
- local_irq_restore(flags);
- }
-
--static void run_hrtimer_softirq(struct softirq_action *h)
-+static __latent_entropy void run_hrtimer_softirq(void)
- {
- hrtimer_peek_ahead_timers();
- }
-diff --git a/kernel/irq_work.c b/kernel/irq_work.c
-index a82170e..5b01e7f 100644
---- a/kernel/irq_work.c
-+++ b/kernel/irq_work.c
-@@ -191,12 +191,13 @@ static int irq_work_cpu_notify(struct notifier_block *self,
- return NOTIFY_OK;
- }
-
--static struct notifier_block cpu_notify;
-+static struct notifier_block cpu_notify = {
-+ .notifier_call = irq_work_cpu_notify,
-+ .priority = 0,
-+};
-
- static __init int irq_work_init_cpu_notifier(void)
- {
-- cpu_notify.notifier_call = irq_work_cpu_notify;
-- cpu_notify.priority = 0;
- register_cpu_notifier(&cpu_notify);
- return 0;
- }
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index 9019f15..9a3c42e 100644
--- a/kernel/jump_label.c
static int
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
-index cb0cf37..b69e161 100644
+index ae51670..c1a9796 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -11,6 +11,9 @@
return -ENOMEM;
reset_iter(iter, 0);
diff --git a/kernel/kcmp.c b/kernel/kcmp.c
-index e30ac0f..3528cac 100644
+index 0aa69ea..a7fcafb 100644
--- a/kernel/kcmp.c
+++ b/kernel/kcmp.c
-@@ -99,6 +99,10 @@ SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
+@@ -100,6 +100,10 @@ SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
struct task_struct *task1, *task2;
int ret;
/*
diff --git a/kernel/kexec.c b/kernel/kexec.c
-index 4b8f0c9..fffd0df 100644
+index 2bee072..8979af8 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
-@@ -1045,7 +1045,8 @@ COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry,
+@@ -1349,7 +1349,8 @@ COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry,
compat_ulong_t, flags)
{
struct compat_kexec_segment in;
kernel_cap_t new_cap;
int err, i;
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
-index 734e9a7..0a313b8 100644
+index 3995f54..e247879 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -31,6 +31,9 @@
}
struct kprobe_insn_cache kprobe_insn_slots = {
-@@ -2176,11 +2179,11 @@ static void report_probe(struct seq_file *pi, struct kprobe *p,
+@@ -2187,11 +2190,11 @@ static void report_probe(struct seq_file *pi, struct kprobe *p,
kprobe_type = "k";
if (sym)
.name = "notes",
.mode = S_IRUGO,
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
-index d24e433..fa04fb8 100644
+index 88d0d44..e9ce0ee 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
-@@ -597,6 +597,10 @@ static int static_obj(void *obj)
+@@ -599,6 +599,10 @@ static int static_obj(void *obj)
end = (unsigned long) &_end,
addr = (unsigned long) obj;
/*
* static variable?
*/
-@@ -738,6 +742,7 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
+@@ -740,6 +744,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");
printk("the code is fine but needs lockdep annotation.\n");
printk("turning off the locking correctness validator.\n");
dump_stack();
-@@ -3079,7 +3084,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
+@@ -3081,7 +3086,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
if (!class)
return 0;
}
seq_printf(m, "%40s %14lu %29s %pS\n",
name, stats->contending_point[i],
diff --git a/kernel/locking/mcs_spinlock.c b/kernel/locking/mcs_spinlock.c
-index be9ee15..39d6233 100644
+index 9887a90..0cd2b1d 100644
--- a/kernel/locking/mcs_spinlock.c
+++ b/kernel/locking/mcs_spinlock.c
-@@ -102,7 +102,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
+@@ -100,7 +100,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
prev = decode_cpu(old);
node->prev = prev;
/*
* Normally @prev is untouchable after the above store; because at that
-@@ -174,8 +174,8 @@ unqueue:
+@@ -172,8 +172,8 @@ unqueue:
* it will wait in Step-A.
*/
return false;
}
-@@ -197,13 +197,13 @@ void osq_unlock(struct optimistic_spin_queue *lock)
+@@ -195,13 +195,13 @@ void osq_unlock(struct optimistic_spin_queue *lock)
node = this_cpu_ptr(&osq_node);
next = xchg(&node->next, NULL);
if (next) {
#endif
diff --git a/kernel/locking/mcs_spinlock.h b/kernel/locking/mcs_spinlock.h
-index 74356dc..48dd5e1 100644
+index 23e89c5..8558eac 100644
--- a/kernel/locking/mcs_spinlock.h
+++ b/kernel/locking/mcs_spinlock.h
@@ -81,7 +81,7 @@ void mcs_spin_lock(struct mcs_spinlock **lock, struct mcs_spinlock *node)
extern void debug_mutex_init(struct mutex *lock, const char *name,
struct lock_class_key *key);
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
-index acca2c1..ddeaea8 100644
+index ae712b2..d0d4a41 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
-@@ -490,7 +490,7 @@ slowpath:
+@@ -486,7 +486,7 @@ slowpath:
goto skip_wait;
debug_mutex_lock_common(lock, &waiter);
/* add waiting tasks to the end of the waitqueue (FIFO): */
list_add_tail(&waiter.list, &lock->wait_list);
-@@ -534,7 +534,7 @@ slowpath:
+@@ -531,7 +531,7 @@ slowpath:
schedule_preempt_disabled();
spin_lock_mutex(&lock->wait_lock, flags);
}
/* set it to 0 if there are no waiters left: */
if (likely(list_empty(&lock->wait_list)))
atomic_set(&lock->count, 0);
-@@ -571,7 +571,7 @@ skip_wait:
+@@ -568,7 +568,7 @@ skip_wait:
return 0;
err:
default:
diff --git a/kernel/module.c b/kernel/module.c
-index 81e727c..a8ea6f9 100644
+index 03214bd2..6242887 100644
--- a/kernel/module.c
+++ b/kernel/module.c
-@@ -61,6 +61,7 @@
+@@ -60,6 +60,7 @@
+ #include <linux/jump_label.h>
#include <linux/pfn.h>
#include <linux/bsearch.h>
- #include <linux/fips.h>
+#include <linux/grsecurity.h>
#include <uapi/linux/module.h>
#include "module-internal.h"
-@@ -157,7 +158,8 @@ static BLOCKING_NOTIFIER_HEAD(module_notify_list);
+@@ -156,7 +157,8 @@ static BLOCKING_NOTIFIER_HEAD(module_notify_list);
/* Bounds of module allocation, for speeding __module_address.
* Protected by module_mutex. */
int register_module_notifier(struct notifier_block * nb)
{
-@@ -324,7 +326,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
+@@ -323,7 +325,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
return true;
list_for_each_entry_rcu(mod, &modules, list) {
{ mod->syms, mod->syms + mod->num_syms, mod->crcs,
NOT_GPL_ONLY, false },
{ mod->gpl_syms, mod->gpl_syms + mod->num_gpl_syms,
-@@ -349,7 +351,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
+@@ -348,7 +350,7 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
if (mod->state == MODULE_STATE_UNFORMED)
continue;
return true;
}
return false;
-@@ -489,7 +491,7 @@ static int percpu_modalloc(struct module *mod, struct load_info *info)
+@@ -488,7 +490,7 @@ static int percpu_modalloc(struct module *mod, struct load_info *info)
if (!pcpusec->sh_size)
return 0;
pr_warn("%s: per-cpu alignment %li > %li\n",
mod->name, align, PAGE_SIZE);
align = PAGE_SIZE;
-@@ -1061,7 +1063,7 @@ struct module_attribute module_uevent =
+@@ -1060,7 +1062,7 @@ struct module_attribute module_uevent =
static ssize_t show_coresize(struct module_attribute *mattr,
struct module_kobject *mk, char *buffer)
{
}
static struct module_attribute modinfo_coresize =
-@@ -1070,7 +1072,7 @@ static struct module_attribute modinfo_coresize =
+@@ -1069,7 +1071,7 @@ static struct module_attribute modinfo_coresize =
static ssize_t show_initsize(struct module_attribute *mattr,
struct module_kobject *mk, char *buffer)
{
}
static struct module_attribute modinfo_initsize =
-@@ -1162,12 +1164,29 @@ static int check_version(Elf_Shdr *sechdrs,
+@@ -1161,12 +1163,29 @@ static int check_version(Elf_Shdr *sechdrs,
goto bad_version;
}
return 0;
}
-@@ -1283,7 +1302,7 @@ resolve_symbol_wait(struct module *mod,
+@@ -1282,7 +1301,7 @@ resolve_symbol_wait(struct module *mod,
*/
#ifdef CONFIG_SYSFS
static inline bool sect_empty(const Elf_Shdr *sect)
{
return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size == 0;
-@@ -1423,7 +1442,7 @@ static void add_notes_attrs(struct module *mod, const struct load_info *info)
+@@ -1422,7 +1441,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;
/* failed to create section attributes, so can't create notes */
if (!mod->sect_attrs)
-@@ -1535,7 +1554,7 @@ static void del_usage_links(struct module *mod)
+@@ -1534,7 +1553,7 @@ static void del_usage_links(struct module *mod)
static int module_add_modinfo_attrs(struct module *mod)
{
struct module_attribute *attr;
int error = 0;
int i;
-@@ -1756,21 +1775,21 @@ static void set_section_ro_nx(void *base,
+@@ -1755,21 +1774,21 @@ static void set_section_ro_nx(void *base,
static void unset_module_core_ro_nx(struct module *mod)
{
set_memory_rw);
}
-@@ -1783,14 +1802,14 @@ void set_all_modules_text_rw(void)
+@@ -1782,14 +1801,14 @@ void set_all_modules_text_rw(void)
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
set_memory_rw);
}
}
-@@ -1806,14 +1825,14 @@ void set_all_modules_text_ro(void)
+@@ -1805,14 +1824,14 @@ void set_all_modules_text_ro(void)
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
set_memory_ro);
}
}
-@@ -1864,16 +1883,19 @@ static void free_module(struct module *mod)
+@@ -1842,7 +1861,9 @@ static void free_module(struct module *mod)
+
+ /* We leave it in list to prevent duplicate loads, but make sure
+ * that noone uses it while it's being deconstructed. */
++ mutex_lock(&module_mutex);
+ mod->state = MODULE_STATE_UNFORMED;
++ mutex_unlock(&module_mutex);
+
+ /* Remove dynamic debug info */
+ ddebug_remove_module(mod->name);
+@@ -1863,16 +1884,19 @@ static void free_module(struct module *mod)
/* This may be NULL, but that's OK */
unset_module_init_ro_nx(mod);
#ifdef CONFIG_MPU
update_protections(current->mm);
-@@ -1942,9 +1964,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -1941,9 +1965,31 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
int ret = 0;
const struct kernel_symbol *ksym;
switch (sym[i].st_shndx) {
case SHN_COMMON:
/* Ignore common symbols */
-@@ -1969,7 +2013,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -1968,7 +2014,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)) {
break;
}
-@@ -1988,11 +2034,20 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
+@@ -1987,11 +2035,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;
return ret;
}
-@@ -2076,22 +2131,12 @@ static void layout_sections(struct module *mod, struct load_info *info)
+@@ -2075,22 +2132,12 @@ static void layout_sections(struct module *mod, struct load_info *info)
|| s->sh_entsize != ~0UL
|| strstarts(sname, ".init"))
continue;
}
pr_debug("Init section allocation order:\n");
-@@ -2105,23 +2150,13 @@ static void layout_sections(struct module *mod, struct load_info *info)
+@@ -2104,23 +2151,13 @@ static void layout_sections(struct module *mod, struct load_info *info)
|| s->sh_entsize != ~0UL
|| !strstarts(sname, ".init"))
continue;
}
}
-@@ -2294,7 +2329,7 @@ static void layout_symtab(struct module *mod, struct load_info *info)
+@@ -2293,7 +2330,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;
info->index.sym) | INIT_OFFSET_MASK;
pr_debug("\t%s\n", info->secstrings + symsect->sh_name);
-@@ -2311,13 +2346,13 @@ static void layout_symtab(struct module *mod, struct load_info *info)
+@@ -2310,13 +2347,13 @@ static void layout_symtab(struct module *mod, struct load_info *info)
}
/* Append room for core symbols at end of core part. */
info->index.str) | INIT_OFFSET_MASK;
pr_debug("\t%s\n", info->secstrings + strsect->sh_name);
}
-@@ -2335,12 +2370,14 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
+@@ -2334,12 +2371,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;
src = mod->symtab;
for (ndst = i = 0; i < mod->num_symtab; i++) {
if (i == 0 ||
-@@ -2352,6 +2389,8 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
+@@ -2351,6 +2390,8 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
}
}
mod->core_num_syms = ndst;
}
#else
static inline void layout_symtab(struct module *mod, struct load_info *info)
-@@ -2385,17 +2424,33 @@ void * __weak module_alloc(unsigned long size)
+@@ -2384,17 +2425,33 @@ void * __weak module_alloc(unsigned long size)
return vmalloc_exec(size);
}
mutex_unlock(&module_mutex);
}
return ret;
-@@ -2652,7 +2707,15 @@ static struct module *setup_load_info(struct load_info *info, int flags)
+@@ -2648,7 +2705,15 @@ static struct module *setup_load_info(struct load_info *info, int flags)
mod = (void *)info->sechdrs[info->index.mod].sh_addr;
if (info->index.sym == 0) {
return ERR_PTR(-ENOEXEC);
}
-@@ -2668,8 +2731,14 @@ static struct module *setup_load_info(struct load_info *info, int flags)
+@@ -2664,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");
if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL;
-@@ -2694,7 +2763,7 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
+@@ -2690,7 +2761,7 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
}
/* Set up license info based on the info section */
return 0;
}
-@@ -2788,7 +2857,7 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2784,7 +2855,7 @@ static int move_module(struct module *mod, struct load_info *info)
void *ptr;
/* Do the allocs. */
/*
* The pointer to this block is stored in the module structure
* which is inside the block. Just mark it as not being a
-@@ -2798,11 +2867,11 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2794,11 +2865,11 @@ static int move_module(struct module *mod, struct load_info *info)
if (!ptr)
return -ENOMEM;
/*
* The pointer to this block is stored in the module structure
* which is inside the block. This block doesn't need to be
-@@ -2811,13 +2880,45 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2807,13 +2878,45 @@ static int move_module(struct module *mod, struct load_info *info)
*/
kmemleak_ignore(ptr);
if (!ptr) {
/* Transfer each section which specifies SHF_ALLOC */
pr_debug("final section addresses:\n");
-@@ -2828,16 +2929,45 @@ static int move_module(struct module *mod, struct load_info *info)
+@@ -2824,16 +2927,45 @@ static int move_module(struct module *mod, struct load_info *info)
if (!(shdr->sh_flags & SHF_ALLOC))
continue;
pr_debug("\t0x%lx %s\n",
(long)shdr->sh_addr, info->secstrings + shdr->sh_name);
}
-@@ -2894,12 +3024,12 @@ static void flush_module_icache(const struct module *mod)
+@@ -2890,12 +3022,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.
*/
set_fs(old_fs);
}
-@@ -2956,8 +3086,10 @@ static struct module *layout_and_allocate(struct load_info *info, int flags)
+@@ -2952,8 +3084,10 @@ static struct module *layout_and_allocate(struct load_info *info, int flags)
static void module_deallocate(struct module *mod, struct load_info *info)
{
percpu_modfree(mod);
}
int __weak module_finalize(const Elf_Ehdr *hdr,
-@@ -2970,7 +3102,9 @@ int __weak module_finalize(const Elf_Ehdr *hdr,
+@@ -2966,7 +3100,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. */
/* Copy relocated percpu area over. */
percpu_modcopy(mod, (void *)info->sechdrs[info->index.pcpu].sh_addr,
-@@ -3079,11 +3213,12 @@ static int do_init_module(struct module *mod)
+@@ -3075,11 +3211,12 @@ static int do_init_module(struct module *mod)
mod->strtab = mod->core_strtab;
#endif
unset_module_init_ro_nx(mod);
mutex_unlock(&module_mutex);
wake_up_all(&module_wq);
-@@ -3151,16 +3286,16 @@ static int complete_formation(struct module *mod, struct load_info *info)
+@@ -3147,16 +3284,16 @@ static int complete_formation(struct module *mod, struct load_info *info)
module_bug_finalize(info->hdr, info->sechdrs, mod);
/* Set RO and NX regions for core */
/* Mark state as coming so strong_try_module_get() ignores us,
* but kallsyms etc. can see us. */
-@@ -3244,9 +3379,38 @@ static int load_module(struct load_info *info, const char __user *uargs,
+@@ -3240,9 +3377,38 @@ static int load_module(struct load_info *info, const char __user *uargs,
if (err)
goto free_unload;
/* Fix up syms, so that st_value is a pointer to location. */
err = simplify_symbols(mod, info);
if (err < 0)
-@@ -3262,13 +3426,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
+@@ -3258,13 +3424,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
flush_module_icache(mod);
dynamic_debug_setup(info->debug, info->num_debug);
/* Ftrace init must be called in the MODULE_STATE_UNFORMED state */
-@@ -3311,11 +3468,10 @@ static int load_module(struct load_info *info, const char __user *uargs,
+@@ -3312,11 +3471,10 @@ static int load_module(struct load_info *info, const char __user *uargs,
ddebug_cleanup:
dynamic_debug_remove(info->debug);
synchronize_sched();
free_unload:
module_unload_free(mod);
unlink_mod:
-@@ -3398,10 +3554,16 @@ static const char *get_ksymbol(struct module *mod,
+@@ -3401,10 +3559,16 @@ static const char *get_ksymbol(struct module *mod,
unsigned long nextval;
/* At worse, next value is at end of module */
/* Scan for closest preceding symbol, and next symbol. (ELF
starts real symbols at 1). */
-@@ -3652,7 +3814,7 @@ static int m_show(struct seq_file *m, void *p)
+@@ -3652,7 +3816,7 @@ static int m_show(struct seq_file *m, void *p)
return 0;
seq_printf(m, "%s %u",
print_unload_info(m, mod);
/* Informative for users. */
-@@ -3661,7 +3823,7 @@ static int m_show(struct seq_file *m, void *p)
+@@ -3661,7 +3825,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. */
/* Taints info */
if (mod->taints)
-@@ -3697,7 +3859,17 @@ static const struct file_operations proc_modules_operations = {
+@@ -3697,7 +3861,17 @@ static const struct file_operations proc_modules_operations = {
static int __init proc_modules_init(void)
{
return 0;
}
module_init(proc_modules_init);
-@@ -3758,14 +3930,14 @@ struct module *__module_address(unsigned long addr)
+@@ -3758,7 +3932,8 @@ struct module *__module_address(unsigned long addr)
{
struct module *mod;
return NULL;
list_for_each_entry_rcu(mod, &modules, list) {
- if (mod->state == MODULE_STATE_UNFORMED)
- continue;
-- if (within_module_core(addr, mod)
-- || within_module_init(addr, mod))
-+ if (within_module_init(addr, mod) || within_module_core(addr, mod))
- return mod;
- }
- return NULL;
-@@ -3800,11 +3972,20 @@ bool is_module_text_address(unsigned long addr)
+@@ -3799,11 +3974,20 @@ bool is_module_text_address(unsigned long addr)
*/
struct module *__module_text_address(unsigned long addr)
{
atomic_set(&pd->refcnt, 0);
pd->pinst = pinst;
diff --git a/kernel/panic.c b/kernel/panic.c
-index 62e16ce..9db5047b 100644
+index d09dc5c..9abbdff 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -53,7 +53,7 @@ EXPORT_SYMBOL(panic_blink);
{
while (1)
cpu_relax();
-@@ -420,7 +420,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
+@@ -421,7 +421,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
disable_trace_on_warning();
pr_warn("------------[ cut here ]------------\n");
raw_smp_processor_id(), current->pid, file, line, caller);
if (args)
-@@ -474,7 +474,8 @@ EXPORT_SYMBOL(warn_slowpath_null);
+@@ -475,7 +475,8 @@ EXPORT_SYMBOL(warn_slowpath_null);
*/
__visible void __stack_chk_fail(void)
{
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 3b89464..5e38379 100644
---- a/kernel/posix-cpu-timers.c
-+++ b/kernel/posix-cpu-timers.c
-@@ -1464,14 +1464,14 @@ struct k_clock clock_posix_cpu = {
-
- static __init int init_posix_cpu_timers(void)
- {
-- struct k_clock process = {
-+ static struct k_clock process = {
- .clock_getres = process_cpu_clock_getres,
- .clock_get = process_cpu_clock_get,
- .timer_create = process_cpu_timer_create,
- .nsleep = process_cpu_nsleep,
- .nsleep_restart = process_cpu_nsleep_restart,
- };
-- struct k_clock thread = {
-+ static struct k_clock thread = {
- .clock_getres = thread_cpu_clock_getres,
- .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 424c2d4..679242f 100644
---- a/kernel/posix-timers.c
-+++ b/kernel/posix-timers.c
-@@ -43,6 +43,7 @@
- #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>
-@@ -122,7 +123,7 @@ static DEFINE_SPINLOCK(hash_lock);
- * which we beg off on and pass to do_sys_settimeofday().
- */
-
--static struct k_clock posix_clocks[MAX_CLOCKS];
-+static struct k_clock *posix_clocks[MAX_CLOCKS];
-
- /*
- * These ones are defined below.
-@@ -275,7 +276,7 @@ static int posix_get_tai(clockid_t which_clock, struct timespec *tp)
- */
- static __init int init_posix_timers(void)
- {
-- struct k_clock clock_realtime = {
-+ static struct k_clock clock_realtime = {
- .clock_getres = hrtimer_get_res,
- .clock_get = posix_clock_realtime_get,
- .clock_set = posix_clock_realtime_set,
-@@ -287,7 +288,7 @@ static __init int init_posix_timers(void)
- .timer_get = common_timer_get,
- .timer_del = common_timer_del,
- };
-- struct k_clock clock_monotonic = {
-+ static struct k_clock clock_monotonic = {
- .clock_getres = hrtimer_get_res,
- .clock_get = posix_ktime_get_ts,
- .nsleep = common_nsleep,
-@@ -297,19 +298,19 @@ static __init int init_posix_timers(void)
- .timer_get = common_timer_get,
- .timer_del = common_timer_del,
- };
-- struct k_clock clock_monotonic_raw = {
-+ static struct k_clock clock_monotonic_raw = {
- .clock_getres = hrtimer_get_res,
- .clock_get = posix_get_monotonic_raw,
- };
-- struct k_clock clock_realtime_coarse = {
-+ static struct k_clock clock_realtime_coarse = {
- .clock_getres = posix_get_coarse_res,
- .clock_get = posix_get_realtime_coarse,
- };
-- struct k_clock clock_monotonic_coarse = {
-+ static struct k_clock clock_monotonic_coarse = {
- .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,
-@@ -531,7 +532,7 @@ void posix_timers_register_clock(const clockid_t clock_id,
- return;
- }
-
-- posix_clocks[clock_id] = *new_clock;
-+ posix_clocks[clock_id] = new_clock;
- }
- EXPORT_SYMBOL_GPL(posix_timers_register_clock);
-
-@@ -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;
-
-- if (id >= MAX_CLOCKS || !posix_clocks[id].clock_getres)
-+ if (id >= MAX_CLOCKS || !posix_clocks[id] || !posix_clocks[id]->clock_getres)
- return NULL;
-- return &posix_clocks[id];
-+ return posix_clocks[id];
- }
-
- static int common_timer_create(struct k_itimer *new_timer)
-@@ -597,7 +598,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
- struct k_clock *kc = clockid_to_kclock(which_clock);
- struct k_itimer *new_timer;
- int error, new_timer_id;
-- sigevent_t event;
-+ sigevent_t event = { };
- int it_id_set = IT_ID_NOT_SET;
-
- if (!kc)
-@@ -1011,6 +1012,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
- if (copy_from_user(&new_tp, tp, sizeof (*tp)))
- return -EFAULT;
-
-+ /* only the CLOCK_REALTIME clock can be set, all other clocks
-+ have their clock_set fptr set to a nosettime dummy function
-+ CLOCK_REALTIME has a NULL clock_set fptr which causes it to
-+ call common_clock_set, which calls do_sys_settimeofday, which
-+ we hook
-+ */
-+
- return kc->clock_set(which_clock, &new_tp);
- }
-
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
-index 9a83d78..128bfc0 100644
+index e4e4121..71faf14 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -24,6 +24,8 @@ config HIBERNATE_CALLBACKS
if (pm_wakeup_pending()) {
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
-index 13e839d..8a71f12 100644
+index 1ce7706..3b07c49 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -480,6 +480,11 @@ static int check_syslog_permissions(int type, bool from_file)
+@@ -490,6 +490,11 @@ static int check_syslog_permissions(int type, bool from_file)
if (from_file && type != SYSLOG_ACTION_OPEN)
return 0;
}
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index adf9862..9d86345 100644
+index 54e7522..5b82dd6 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
-@@ -327,7 +327,7 @@ static int ptrace_attach(struct task_struct *task, long request,
+@@ -321,7 +321,7 @@ static int ptrace_attach(struct task_struct *task, long request,
if (seize)
flags |= PT_SEIZED;
rcu_read_lock();
flags |= PT_PTRACE_CAP;
rcu_read_unlock();
task->ptrace = flags;
-@@ -538,7 +538,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
+@@ -532,7 +532,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst
break;
return -EIO;
}
return -EFAULT;
copied += retval;
src += retval;
-@@ -806,7 +806,7 @@ int ptrace_request(struct task_struct *child, long request,
+@@ -800,7 +800,7 @@ int ptrace_request(struct task_struct *child, long request,
bool seized = child->ptrace & PT_SEIZED;
int ret = -EIO;
siginfo_t siginfo, *si;
unsigned long __user *datalp = datavp;
unsigned long flags;
-@@ -1052,14 +1052,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
+@@ -1046,14 +1046,21 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
goto out;
}
goto out_put_task_struct;
}
-@@ -1087,7 +1094,7 @@ int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
+@@ -1081,7 +1088,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;
}
int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
-@@ -1181,7 +1188,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
+@@ -1175,7 +1182,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
}
COMPAT_SYSCALL_DEFINE4(ptrace, compat_long_t, request, compat_long_t, pid,
{
struct task_struct *child;
long ret;
-@@ -1197,14 +1204,21 @@ COMPAT_SYSCALL_DEFINE4(ptrace, compat_long_t, request, compat_long_t, pid,
+@@ -1191,14 +1198,21 @@ COMPAT_SYSCALL_DEFINE4(ptrace, compat_long_t, request, compat_long_t, pid,
goto out;
}
for_each_possible_cpu(cpu) {
for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
per_cpu(rcu_torture_count, cpu)[i] = 0;
-diff --git a/kernel/rcu/srcu.c b/kernel/rcu/srcu.c
-index c639556..cf0a0d5 100644
---- a/kernel/rcu/srcu.c
-+++ b/kernel/rcu/srcu.c
-@@ -298,9 +298,9 @@ int __srcu_read_lock(struct srcu_struct *sp)
-
- idx = ACCESS_ONCE(sp->completed) & 0x1;
- preempt_disable();
-- ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->c[idx]) += 1;
-+ ACCESS_ONCE_RW(this_cpu_ptr(sp->per_cpu_ref)->c[idx]) += 1;
- smp_mb(); /* B */ /* Avoid leaking the critical section. */
-- ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->seq[idx]) += 1;
-+ ACCESS_ONCE_RW(this_cpu_ptr(sp->per_cpu_ref)->seq[idx]) += 1;
- preempt_enable();
- return idx;
- }
diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c
index d9efcc1..ea543e9 100644
--- a/kernel/rcu/tiny.c
static void check_cpu_stalls(void)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
-index 625d0b0..0bce4d6 100644
+index 1b70cb6..ea62b0a 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -263,7 +263,7 @@ static void rcu_momentary_dyntick_idle(void)
rsp->jiffies_resched = j + j1 / 2;
}
-@@ -1052,7 +1052,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
+@@ -1049,7 +1049,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
raw_spin_unlock_irqrestore(&rnp->lock, flags);
return;
}
raw_spin_unlock_irqrestore(&rnp->lock, flags);
/*
-@@ -1130,7 +1130,7 @@ static void print_cpu_stall(struct rcu_state *rsp)
+@@ -1126,7 +1126,7 @@ static void print_cpu_stall(struct rcu_state *rsp)
raw_spin_lock_irqsave(&rnp->lock, flags);
if (ULONG_CMP_GE(jiffies, ACCESS_ONCE(rsp->jiffies_stall)))
3 * rcu_jiffies_till_stall_check() + 3;
raw_spin_unlock_irqrestore(&rnp->lock, flags);
-@@ -1214,7 +1214,7 @@ void rcu_cpu_stall_reset(void)
+@@ -1210,7 +1210,7 @@ void rcu_cpu_stall_reset(void)
struct rcu_state *rsp;
for_each_rcu_flavor(rsp)
}
/*
-@@ -1594,7 +1594,7 @@ static int rcu_gp_init(struct rcu_state *rsp)
+@@ -1596,7 +1596,7 @@ static int rcu_gp_init(struct rcu_state *rsp)
raw_spin_unlock_irq(&rnp->lock);
return 0;
}
if (WARN_ON_ONCE(rcu_gp_in_progress(rsp))) {
/*
-@@ -1635,9 +1635,9 @@ static int rcu_gp_init(struct rcu_state *rsp)
+@@ -1637,9 +1637,9 @@ static int rcu_gp_init(struct rcu_state *rsp)
rdp = this_cpu_ptr(rsp->rda);
rcu_preempt_check_blocked_tasks(rnp);
rnp->qsmask = rnp->qsmaskinit;
if (rnp == rdp->mynode)
(void)__note_gp_changes(rsp, rnp, rdp);
rcu_preempt_boost_start_gp(rnp);
-@@ -1687,7 +1687,7 @@ static int rcu_gp_fqs(struct rcu_state *rsp, int fqs_state_in)
+@@ -1684,7 +1684,7 @@ static int rcu_gp_fqs(struct rcu_state *rsp, int fqs_state_in)
if (ACCESS_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) {
raw_spin_lock_irq(&rnp->lock);
smp_mb__after_unlock_lock();
raw_spin_unlock_irq(&rnp->lock);
}
return fqs_state;
-@@ -1732,7 +1732,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
+@@ -1729,7 +1729,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
rcu_for_each_node_breadth_first(rsp, rnp) {
raw_spin_lock_irq(&rnp->lock);
smp_mb__after_unlock_lock();
rdp = this_cpu_ptr(rsp->rda);
if (rnp == rdp->mynode)
needgp = __note_gp_changes(rsp, rnp, rdp) || needgp;
-@@ -1747,14 +1747,14 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
+@@ -1744,14 +1744,14 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
rcu_nocb_gp_set(rnp, nocb);
/* Declare grace period done. */
trace_rcu_grace_period(rsp->name,
ACCESS_ONCE(rsp->gpnum),
TPS("newreq"));
-@@ -1879,7 +1879,7 @@ rcu_start_gp_advanced(struct rcu_state *rsp, struct rcu_node *rnp,
+@@ -1876,7 +1876,7 @@ rcu_start_gp_advanced(struct rcu_state *rsp, struct rcu_node *rnp,
*/
return false;
}
trace_rcu_grace_period(rsp->name, ACCESS_ONCE(rsp->gpnum),
TPS("newreq"));
-@@ -2100,7 +2100,7 @@ rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp,
+@@ -2097,7 +2097,7 @@ rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp,
rsp->qlen += rdp->qlen;
rdp->n_cbs_orphaned += rdp->qlen;
rdp->qlen_lazy = 0;
}
/*
-@@ -2347,7 +2347,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
+@@ -2344,7 +2344,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
}
smp_mb(); /* List handling before counting for rcu_barrier(). */
rdp->qlen_lazy -= count_lazy;
-- ACCESS_ONCE(rdp->qlen) -= count;
-+ ACCESS_ONCE_RW(rdp->qlen) -= count;
+- ACCESS_ONCE(rdp->qlen) = rdp->qlen - count;
++ ACCESS_ONCE_RW(rdp->qlen) = rdp->qlen - count;
rdp->n_cbs_invoked += count;
/* Reinstate batch limit if we have worked down the excess. */
-@@ -2492,7 +2492,7 @@ static void force_quiescent_state(struct rcu_state *rsp)
- if (rnp_old != NULL)
- raw_spin_unlock(&rnp_old->fqslock);
- if (ret) {
-- ACCESS_ONCE(rsp->n_force_qs_lh)++;
-+ ACCESS_ONCE_RW(rsp->n_force_qs_lh)++;
- return;
- }
- rnp_old = rnp;
-@@ -2504,11 +2504,11 @@ static void force_quiescent_state(struct rcu_state *rsp)
- smp_mb__after_unlock_lock();
- raw_spin_unlock(&rnp_old->fqslock);
- if (ACCESS_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) {
-- ACCESS_ONCE(rsp->n_force_qs_lh)++;
-+ ACCESS_ONCE_RW(rsp->n_force_qs_lh)++;
+@@ -2505,7 +2505,7 @@ static void force_quiescent_state(struct rcu_state *rsp)
raw_spin_unlock_irqrestore(&rnp_old->lock, flags);
return; /* Someone beat us to it. */
}
raw_spin_unlock_irqrestore(&rnp_old->lock, flags);
wake_up(&rsp->gp_wq); /* Memory barrier implied by wake_up() path. */
}
-@@ -2553,7 +2553,7 @@ __rcu_process_callbacks(struct rcu_state *rsp)
+@@ -2550,7 +2550,7 @@ __rcu_process_callbacks(struct rcu_state *rsp)
/*
* Do RCU core processing for the current CPU.
*/
{
struct rcu_state *rsp;
-@@ -2665,7 +2665,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
- WARN_ON_ONCE((unsigned long)head & 0x3); /* Misaligned rcu_head! */
+@@ -2662,7 +2662,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
+ WARN_ON_ONCE((unsigned long)head & 0x1); /* Misaligned rcu_head! */
if (debug_rcu_head_queue(head)) {
/* Probable double call_rcu(), so leak the callback. */
- ACCESS_ONCE(head->func) = rcu_leak_callback;
WARN_ONCE(1, "__call_rcu(): Leaked duplicate callback\n");
return;
}
-@@ -2693,7 +2693,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
+@@ -2690,7 +2690,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
local_irq_restore(flags);
return;
}
-- ACCESS_ONCE(rdp->qlen)++;
-+ ACCESS_ONCE_RW(rdp->qlen)++;
+- ACCESS_ONCE(rdp->qlen) = rdp->qlen + 1;
++ ACCESS_ONCE_RW(rdp->qlen) = rdp->qlen + 1;
if (lazy)
rdp->qlen_lazy++;
else
-@@ -2968,11 +2968,11 @@ void synchronize_sched_expedited(void)
+@@ -2965,11 +2965,11 @@ void synchronize_sched_expedited(void)
* counter wrap on a 32-bit system. Quite a few more CPUs would of
* course be required on a 64-bit system.
*/
return;
}
-@@ -2980,7 +2980,7 @@ void synchronize_sched_expedited(void)
+@@ -2977,7 +2977,7 @@ void synchronize_sched_expedited(void)
* Take a ticket. Note that atomic_inc_return() implies a
* full memory barrier.
*/
firstsnap = snap;
get_online_cpus();
WARN_ON_ONCE(cpu_is_offline(raw_smp_processor_id()));
-@@ -2993,14 +2993,14 @@ void synchronize_sched_expedited(void)
+@@ -2990,14 +2990,14 @@ void synchronize_sched_expedited(void)
synchronize_sched_expedited_cpu_stop,
NULL) == -EAGAIN) {
put_online_cpus();
return;
}
-@@ -3009,7 +3009,7 @@ void synchronize_sched_expedited(void)
+@@ -3006,7 +3006,7 @@ void synchronize_sched_expedited(void)
udelay(trycount * num_online_cpus());
} else {
wait_rcu_gp(call_rcu_sched);
return;
}
-@@ -3018,7 +3018,7 @@ void synchronize_sched_expedited(void)
+@@ -3015,7 +3015,7 @@ void synchronize_sched_expedited(void)
if (ULONG_CMP_GE((ulong)s, (ulong)firstsnap)) {
/* ensure test happens before caller kfree */
smp_mb__before_atomic(); /* ^^^ */
return;
}
-@@ -3030,10 +3030,10 @@ void synchronize_sched_expedited(void)
+@@ -3027,10 +3027,10 @@ void synchronize_sched_expedited(void)
* period works for us.
*/
get_online_cpus();
/*
* Everyone up to our most recent fetch is covered by our grace
-@@ -3042,16 +3042,16 @@ void synchronize_sched_expedited(void)
+@@ -3039,16 +3039,16 @@ void synchronize_sched_expedited(void)
* than we did already did their update.
*/
do {
put_online_cpus();
}
-@@ -3257,7 +3257,7 @@ static void _rcu_barrier(struct rcu_state *rsp)
+@@ -3254,7 +3254,7 @@ static void _rcu_barrier(struct rcu_state *rsp)
* ACCESS_ONCE() to prevent the compiler from speculating
* the increment to precede the early-exit check.
*/
-- ACCESS_ONCE(rsp->n_barrier_done)++;
-+ ACCESS_ONCE_RW(rsp->n_barrier_done)++;
+- ACCESS_ONCE(rsp->n_barrier_done) = rsp->n_barrier_done + 1;
++ ACCESS_ONCE_RW(rsp->n_barrier_done) = rsp->n_barrier_done + 1;
WARN_ON_ONCE((rsp->n_barrier_done & 0x1) != 1);
_rcu_barrier_trace(rsp, "Inc1", -1, rsp->n_barrier_done);
smp_mb(); /* Order ->n_barrier_done increment with below mechanism. */
-@@ -3307,7 +3307,7 @@ static void _rcu_barrier(struct rcu_state *rsp)
+@@ -3304,7 +3304,7 @@ static void _rcu_barrier(struct rcu_state *rsp)
/* Increment ->n_barrier_done to prevent duplicate work. */
smp_mb(); /* Keep increment after above mechanism. */
-- ACCESS_ONCE(rsp->n_barrier_done)++;
-+ ACCESS_ONCE_RW(rsp->n_barrier_done)++;
+- ACCESS_ONCE(rsp->n_barrier_done) = rsp->n_barrier_done + 1;
++ ACCESS_ONCE_RW(rsp->n_barrier_done) = rsp->n_barrier_done + 1;
WARN_ON_ONCE((rsp->n_barrier_done & 0x1) != 0);
_rcu_barrier_trace(rsp, "Inc2", -1, rsp->n_barrier_done);
smp_mb(); /* Keep increment before caller's subsequent code. */
-@@ -3352,10 +3352,10 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp)
+@@ -3349,10 +3349,10 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp)
rdp->grpmask = 1UL << (cpu - rdp->mynode->grplo);
init_callback_list(rdp);
rdp->qlen_lazy = 0;
rdp->cpu = cpu;
rdp->rsp = rsp;
rcu_boot_init_nocb_percpu_data(rdp);
-@@ -3388,8 +3388,8 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp)
+@@ -3385,8 +3385,8 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp)
init_callback_list(rdp); /* Re-enable callbacks on this CPU. */
rdp->dynticks->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
rcu_sysidle_init_percpu_data(rdp->dynticks);
/* Add CPU to rcu_node bitmasks. */
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
-index 0f69a79..c85c2dc 100644
+index 6a86eb7..022b506 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -87,11 +87,11 @@ struct rcu_dynticks {
/* "Idle" excludes userspace execution. */
unsigned long dynticks_idle_jiffies;
/* End of last non-NMI non-idle period. */
-@@ -435,17 +435,17 @@ struct rcu_state {
+@@ -461,17 +461,17 @@ struct rcu_state {
/* _rcu_barrier(). */
/* End of fields guarded by barrier_mutex. */
unsigned long jiffies_force_qs; /* Time at which to invoke */
/* force_quiescent_state(). */
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
-index 02ac0fb..4aa4a36 100644
+index a7997e2..9787c9e 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -735,7 +735,7 @@ static int rcu_preempted_readers_exp(struct rcu_node *rnp)
unlock_mb_ret:
mutex_unlock(&sync_rcu_preempt_exp_mutex);
mb_ret:
-@@ -1447,7 +1447,7 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu)
+@@ -1452,7 +1452,7 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu)
free_cpumask_var(cm);
}
.store = &rcu_cpu_kthread_task,
.thread_should_run = rcu_cpu_kthread_should_run,
.thread_fn = rcu_cpu_kthread,
-@@ -1926,7 +1926,7 @@ static void print_cpu_stall_info(struct rcu_state *rsp, int cpu)
+@@ -1932,7 +1932,7 @@ static void print_cpu_stall_info(struct rcu_state *rsp, int cpu)
print_cpu_stall_fast_no_hz(fast_no_hz, cpu);
pr_err("\t%d: (%lu %s) idle=%03x/%llx/%d softirq=%u/%u %s\n",
cpu, ticks_value, ticks_title,
rdtp->dynticks_nesting, rdtp->dynticks_nmi_nesting,
rdp->softirq_snap, kstat_softirqs_cpu(RCU_SOFTIRQ, cpu),
fast_no_hz);
-@@ -2079,7 +2079,7 @@ static void __call_rcu_nocb_enqueue(struct rcu_data *rdp,
+@@ -2076,7 +2076,7 @@ static void wake_nocb_leader(struct rcu_data *rdp, bool force)
+ return;
+ if (ACCESS_ONCE(rdp_leader->nocb_leader_sleep) || force) {
+ /* Prior xchg orders against prior callback enqueue. */
+- ACCESS_ONCE(rdp_leader->nocb_leader_sleep) = false;
++ ACCESS_ONCE_RW(rdp_leader->nocb_leader_sleep) = false;
+ wake_up(&rdp_leader->nocb_wq);
+ }
+ }
+@@ -2101,7 +2101,7 @@ static void __call_rcu_nocb_enqueue(struct rcu_data *rdp,
/* Enqueue the callback on the nocb list and update counts. */
old_rhpp = xchg(&rdp->nocb_tail, rhtp);
atomic_long_add(rhcount, &rdp->nocb_q_count);
atomic_long_add(rhcount_lazy, &rdp->nocb_q_count_lazy);
-@@ -2255,12 +2255,12 @@ static int rcu_nocb_kthread(void *arg)
- * Extract queued callbacks, update counts, and wait
- * for a grace period to elapse.
- */
+@@ -2272,7 +2272,7 @@ wait_again:
+ continue; /* No CBs here, try next follower. */
+
+ /* Move callbacks to wait-for-GP list, which is empty. */
- ACCESS_ONCE(rdp->nocb_head) = NULL;
+ ACCESS_ONCE_RW(rdp->nocb_head) = NULL;
- tail = xchg(&rdp->nocb_tail, &rdp->nocb_head);
- c = atomic_long_xchg(&rdp->nocb_q_count, 0);
- cl = atomic_long_xchg(&rdp->nocb_q_count_lazy, 0);
-- ACCESS_ONCE(rdp->nocb_p_count) += c;
-- ACCESS_ONCE(rdp->nocb_p_count_lazy) += cl;
-+ ACCESS_ONCE_RW(rdp->nocb_p_count) += c;
-+ ACCESS_ONCE_RW(rdp->nocb_p_count_lazy) += cl;
- rcu_nocb_wait_gp(rdp);
-
- /* Each pass through the following loop invokes a callback. */
-@@ -2286,8 +2286,8 @@ static int rcu_nocb_kthread(void *arg)
+ rdp->nocb_gp_tail = xchg(&rdp->nocb_tail, &rdp->nocb_head);
+ rdp->nocb_gp_count = atomic_long_xchg(&rdp->nocb_q_count, 0);
+ rdp->nocb_gp_count_lazy =
+@@ -2398,7 +2398,7 @@ static int rcu_nocb_kthread(void *arg)
+ list = ACCESS_ONCE(rdp->nocb_follower_head);
+ BUG_ON(!list);
+ trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, "WokeNonEmpty");
+- ACCESS_ONCE(rdp->nocb_follower_head) = NULL;
++ ACCESS_ONCE_RW(rdp->nocb_follower_head) = NULL;
+ tail = xchg(&rdp->nocb_follower_tail, &rdp->nocb_follower_head);
+ c = atomic_long_xchg(&rdp->nocb_follower_count, 0);
+ cl = atomic_long_xchg(&rdp->nocb_follower_count_lazy, 0);
+@@ -2428,8 +2428,8 @@ static int rcu_nocb_kthread(void *arg)
list = next;
}
trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1);
rdp->n_nocbs_invoked += c;
}
return 0;
-@@ -2304,7 +2304,7 @@ static void do_nocb_deferred_wakeup(struct rcu_data *rdp)
+@@ -2446,7 +2446,7 @@ static void do_nocb_deferred_wakeup(struct rcu_data *rdp)
{
if (!rcu_nocb_need_deferred_wakeup(rdp))
return;
- ACCESS_ONCE(rdp->nocb_defer_wakeup) = false;
+ ACCESS_ONCE_RW(rdp->nocb_defer_wakeup) = false;
- wake_up(&rdp->nocb_wq);
+ wake_nocb_leader(rdp, false);
trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, TPS("DeferredWakeEmpty"));
}
-@@ -2330,7 +2330,7 @@ static void __init rcu_spawn_nocb_kthreads(struct rcu_state *rsp)
+@@ -2510,7 +2510,7 @@ static void __init rcu_spawn_nocb_kthreads(struct rcu_state *rsp)
t = kthread_run(rcu_nocb_kthread, rdp,
"rcuo%c/%d", rsp->abbr, cpu);
BUG_ON(IS_ERR(t));
}
}
-@@ -2461,11 +2461,11 @@ static void rcu_sysidle_enter(struct rcu_dynticks *rdtp, int irq)
+@@ -2641,11 +2641,11 @@ static void rcu_sysidle_enter(struct rcu_dynticks *rdtp, int irq)
/* Record start of fully idle period. */
j = jiffies;
}
/*
-@@ -2530,9 +2530,9 @@ static void rcu_sysidle_exit(struct rcu_dynticks *rdtp, int irq)
+@@ -2710,9 +2710,9 @@ static void rcu_sysidle_exit(struct rcu_dynticks *rdtp, int irq)
/* Record end of idle period. */
smp_mb__before_atomic();
/*
* If we are the timekeeping CPU, we are permitted to be non-idle
-@@ -2573,7 +2573,7 @@ static void rcu_sysidle_check_cpu(struct rcu_data *rdp, bool *isidle,
+@@ -2753,7 +2753,7 @@ static void rcu_sysidle_check_cpu(struct rcu_data *rdp, bool *isidle,
WARN_ON_ONCE(smp_processor_id() != tick_do_timer_cpu);
/* Pick up current idle and NMI-nesting counter and check. */
if (cur & 0x1) {
*isidle = false; /* We are not idle! */
return;
-@@ -2622,7 +2622,7 @@ static void rcu_sysidle(unsigned long j)
+@@ -2802,7 +2802,7 @@ static void rcu_sysidle(unsigned long j)
case RCU_SYSIDLE_NOT:
/* First time all are idle, so note a short idle period. */
break;
case RCU_SYSIDLE_SHORT:
-@@ -2660,7 +2660,7 @@ static void rcu_sysidle_cancel(void)
+@@ -2840,7 +2840,7 @@ static void rcu_sysidle_cancel(void)
{
smp_mb();
if (full_sysidle_state > RCU_SYSIDLE_SHORT)
}
/*
-@@ -2708,7 +2708,7 @@ static void rcu_sysidle_cb(struct rcu_head *rhp)
+@@ -2888,7 +2888,7 @@ static void rcu_sysidle_cb(struct rcu_head *rhp)
smp_mb(); /* grace period precedes setting inuse. */
rshp = container_of(rhp, struct rcu_sysidle_head, rh);
}
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
-index bc78835..7691a45 100644
+index 4056d79..c11741a 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
-@@ -311,10 +311,10 @@ int rcu_jiffies_till_stall_check(void)
+@@ -308,10 +308,10 @@ int rcu_jiffies_till_stall_check(void)
* for CONFIG_RCU_CPU_STALL_TIMEOUT.
*/
if (till_stall_check < 3) {
}
return till_stall_check * HZ + RCU_STALL_DELAY_DELTA;
diff --git a/kernel/resource.c b/kernel/resource.c
-index 3c2237a..4568d96 100644
+index 60c5a38..ed77193 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
-@@ -152,8 +152,18 @@ static const struct file_operations proc_iomem_operations = {
+@@ -161,8 +161,18 @@ static const struct file_operations proc_iomem_operations = {
static int __init ioresources_init(void)
{
unsigned long timeout)
{
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
-index 0acf96b..80ba955 100644
+index ec1a286..6b516b8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -1849,7 +1849,7 @@ void set_numabalancing_state(bool enabled)
+@@ -1857,7 +1857,7 @@ void set_numabalancing_state(bool enabled)
int sysctl_numa_balancing(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int err;
int state = numabalancing_enabled;
-@@ -2312,8 +2312,10 @@ context_switch(struct rq *rq, struct task_struct *prev,
+@@ -2320,8 +2320,10 @@ context_switch(struct rq *rq, struct task_struct *prev,
next->active_mm = oldmm;
atomic_inc(&oldmm->mm_count);
enter_lazy_tlb(oldmm, next);
if (!prev->mm) {
prev->active_mm = NULL;
-@@ -3081,6 +3083,8 @@ int can_nice(const struct task_struct *p, const int nice)
+@@ -3103,6 +3105,8 @@ int can_nice(const struct task_struct *p, const int nice)
/* convert nice value [19,-20] to rlimit style value [1,40] */
int nice_rlim = nice_to_rlimit(nice);
return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
capable(CAP_SYS_NICE));
}
-@@ -3107,7 +3111,8 @@ SYSCALL_DEFINE1(nice, int, increment)
+@@ -3129,7 +3133,8 @@ SYSCALL_DEFINE1(nice, int, increment)
nice = task_nice(current) + increment;
nice = clamp_val(nice, MIN_NICE, MAX_NICE);
return -EPERM;
retval = security_task_setnice(current, nice);
-@@ -3380,6 +3385,7 @@ recheck:
+@@ -3408,6 +3413,7 @@ recheck:
if (policy != p->policy && !rlim_rtprio)
return -EPERM;
/* can't increase priority */
if (attr->sched_priority > p->rt_priority &&
attr->sched_priority > rlim_rtprio)
-@@ -4772,6 +4778,7 @@ void idle_task_exit(void)
+@@ -4797,6 +4803,7 @@ void idle_task_exit(void)
if (mm != &init_mm) {
switch_mm(mm, &init_mm, current);
finish_arch_post_lock_switch();
}
mmdrop(mm);
-@@ -4867,7 +4874,7 @@ static void migrate_tasks(unsigned int dead_cpu)
+@@ -4892,7 +4899,7 @@ static void migrate_tasks(unsigned int dead_cpu)
#if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_SYSCTL)
{
.procname = "sched_domain",
.mode = 0555,
-@@ -4884,17 +4891,17 @@ static struct ctl_table sd_ctl_root[] = {
+@@ -4909,17 +4916,17 @@ static struct ctl_table sd_ctl_root[] = {
{}
};
/*
* In the intermediate directories, both the child directory and
-@@ -4902,22 +4909,25 @@ static void sd_free_ctl_entry(struct ctl_table **tablep)
+@@ -4927,22 +4934,25 @@ static void sd_free_ctl_entry(struct ctl_table **tablep)
* will always be set. In the lowest directory the names are
* static strings and all have proc handlers.
*/
const char *procname, void *data, int maxlen,
umode_t mode, proc_handler *proc_handler,
bool load_idx)
-@@ -4937,7 +4947,7 @@ set_table_entry(struct ctl_table *entry,
+@@ -4962,7 +4972,7 @@ set_table_entry(struct ctl_table *entry,
static struct ctl_table *
sd_alloc_ctl_domain_table(struct sched_domain *sd)
{
if (table == NULL)
return NULL;
-@@ -4975,9 +4985,9 @@ sd_alloc_ctl_domain_table(struct sched_domain *sd)
+@@ -5000,9 +5010,9 @@ sd_alloc_ctl_domain_table(struct sched_domain *sd)
return table;
}
struct sched_domain *sd;
int domain_num = 0, i;
char buf[32];
-@@ -5004,11 +5014,13 @@ static struct ctl_table_header *sd_sysctl_header;
+@@ -5029,11 +5039,13 @@ static struct ctl_table_header *sd_sysctl_header;
static void register_sched_domain_sysctl(void)
{
int i, cpu_num = num_possible_cpus();
if (entry == NULL)
return;
-@@ -5031,8 +5043,12 @@ static void unregister_sched_domain_sysctl(void)
+@@ -5056,8 +5068,12 @@ static void unregister_sched_domain_sysctl(void)
if (sd_sysctl_header)
unregister_sysctl_table(sd_sysctl_header);
sd_sysctl_header = NULL;
#else
static void register_sched_domain_sysctl(void)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
-index fea7d33..84faa94 100644
+index bfa3c86..e58767c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
-@@ -1857,7 +1857,7 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags)
+@@ -1873,7 +1873,7 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags)
static void reset_ptenuma_scan(struct task_struct *p)
{
p->mm->numa_scan_offset = 0;
}
-@@ -7289,7 +7289,7 @@ static void nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) { }
+@@ -7339,7 +7339,7 @@ static void nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) { }
* run_rebalance_domains is triggered when needed from the scheduler tick.
* Also triggered for nohz idle balancing (with nohz_balancing_kick set).
*/
struct rq *this_rq = this_rq();
enum cpu_idle_type idle = this_rq->idle_balance ?
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
-index 31cc02e..734fb85 100644
+index 579712f..a338a9d 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
-@@ -1153,7 +1153,7 @@ struct sched_class {
+@@ -1146,7 +1146,7 @@ struct sched_class {
#ifdef CONFIG_FAIR_GROUP_SCHED
void (*task_move_group) (struct task_struct *p, int on_rq);
#endif
static inline void put_prev_task(struct rq *rq, struct task_struct *prev)
{
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
-index 301bbc2..eda2da3 100644
+index 44eb005..84922be 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
-@@ -39,7 +39,7 @@
- * is only needed for handling filters shared across tasks.
- * @prev: points to a previously installed, or inherited, filter
- * @len: the number of instructions in the program
-- * @insnsi: the BPF program instructions to evaluate
-+ * @insns: the BPF program instructions to evaluate
- *
- * seccomp_filter objects are organized in a tree linked via the @prev
- * pointer. For any task, it appears to be a singly-linked list starting
-@@ -54,32 +54,61 @@
- struct seccomp_filter {
- atomic_t usage;
- struct seccomp_filter *prev;
-- struct sk_filter *prog;
-+ unsigned short len; /* Instruction count */
-+ struct sock_filter insns[];
- };
-
- /* Limit any path through the tree to 256KB worth of instructions. */
- #define MAX_INSNS_PER_PATH ((1 << 18) / sizeof(struct sock_filter))
-
--/*
-+/**
-+ * get_u32 - returns a u32 offset into data
-+ * @data: a unsigned 64 bit value
-+ * @index: 0 or 1 to return the first or second 32-bits
-+ *
-+ * This inline exists to hide the length of unsigned long. If a 32-bit
-+ * unsigned long is passed in, it will be extended and the top 32-bits will be
-+ * 0. If it is a 64-bit unsigned long, then whatever data is resident will be
-+ * properly returned.
-+ *
- * Endianness is explicitly ignored and left for BPF program authors to manage
- * as per the specific architecture.
- */
--static void populate_seccomp_data(struct seccomp_data *sd)
-+static inline u32 get_u32(u64 data, int index)
- {
-- struct task_struct *task = current;
-- struct pt_regs *regs = task_pt_regs(task);
-- unsigned long args[6];
-+ return ((u32 *)&data)[index];
-+}
-
-- sd->nr = syscall_get_nr(task, regs);
-- sd->arch = syscall_get_arch();
-- syscall_get_arguments(task, regs, 0, 6, args);
-- sd->args[0] = args[0];
-- sd->args[1] = args[1];
-- sd->args[2] = args[2];
-- sd->args[3] = args[3];
-- sd->args[4] = args[4];
-- sd->args[5] = args[5];
-- sd->instruction_pointer = KSTK_EIP(task);
-+/* Helper for bpf_load below. */
-+#define BPF_DATA(_name) offsetof(struct seccomp_data, _name)
-+/**
-+ * bpf_load: checks and returns a pointer to the requested offset
-+ * @off: offset into struct seccomp_data to load from
-+ *
-+ * Returns the requested 32-bits of data.
-+ * seccomp_check_filter() should assure that @off is 32-bit aligned
-+ * and not out of bounds. Failure to do so is a BUG.
-+ */
-+u32 seccomp_bpf_load(int off)
-+{
-+ struct pt_regs *regs = task_pt_regs(current);
-+ if (off == BPF_DATA(nr))
-+ return syscall_get_nr(current, regs);
-+ if (off == BPF_DATA(arch))
-+ return syscall_get_arch();
-+ if (off >= BPF_DATA(args[0]) && off < BPF_DATA(args[6])) {
-+ unsigned long value;
-+ int arg = (off - BPF_DATA(args[0])) / sizeof(u64);
-+ int index = !!(off % sizeof(u64));
-+ syscall_get_arguments(current, regs, arg, 1, &value);
-+ return get_u32(value, index);
-+ }
-+ if (off == BPF_DATA(instruction_pointer))
-+ return get_u32(KSTK_EIP(current), 0);
-+ if (off == BPF_DATA(instruction_pointer) + sizeof(u32))
-+ return get_u32(KSTK_EIP(current), 1);
-+ /* seccomp_check_filter should make this impossible. */
-+ BUG();
- }
-
- /**
-@@ -103,59 +132,59 @@ static int seccomp_check_filter(struct sock_filter *filter, unsigned int flen)
- u32 k = ftest->k;
-
- switch (code) {
-- case BPF_LD | BPF_W | BPF_ABS:
-- ftest->code = BPF_LDX | BPF_W | BPF_ABS;
-+ case BPF_S_LD_W_ABS:
-+ ftest->code = BPF_S_ANC_SECCOMP_LD_W;
- /* 32-bit aligned and not out of bounds. */
- if (k >= sizeof(struct seccomp_data) || k & 3)
- return -EINVAL;
- continue;
-- case BPF_LD | BPF_W | BPF_LEN:
-- ftest->code = BPF_LD | BPF_IMM;
-+ case BPF_S_LD_W_LEN:
-+ ftest->code = BPF_S_LD_IMM;
- ftest->k = sizeof(struct seccomp_data);
- continue;
-- case BPF_LDX | BPF_W | BPF_LEN:
-- ftest->code = BPF_LDX | BPF_IMM;
-+ case BPF_S_LDX_W_LEN:
-+ ftest->code = BPF_S_LDX_IMM;
- ftest->k = sizeof(struct seccomp_data);
- continue;
- /* Explicitly include allowed calls. */
-- case BPF_RET | BPF_K:
-- case BPF_RET | BPF_A:
-- case BPF_ALU | BPF_ADD | BPF_K:
-- case BPF_ALU | BPF_ADD | BPF_X:
-- case BPF_ALU | BPF_SUB | BPF_K:
-- case BPF_ALU | BPF_SUB | BPF_X:
-- case BPF_ALU | BPF_MUL | BPF_K:
-- case BPF_ALU | BPF_MUL | BPF_X:
-- case BPF_ALU | BPF_DIV | BPF_K:
-- case BPF_ALU | BPF_DIV | BPF_X:
-- case BPF_ALU | BPF_AND | BPF_K:
-- case BPF_ALU | BPF_AND | BPF_X:
-- case BPF_ALU | BPF_OR | BPF_K:
-- case BPF_ALU | BPF_OR | BPF_X:
-- case BPF_ALU | BPF_XOR | BPF_K:
-- case BPF_ALU | BPF_XOR | BPF_X:
-- case BPF_ALU | BPF_LSH | BPF_K:
-- case BPF_ALU | BPF_LSH | BPF_X:
-- case BPF_ALU | BPF_RSH | BPF_K:
-- case BPF_ALU | BPF_RSH | BPF_X:
-- case BPF_ALU | BPF_NEG:
-- case BPF_LD | BPF_IMM:
-- case BPF_LDX | BPF_IMM:
-- case BPF_MISC | BPF_TAX:
-- case BPF_MISC | BPF_TXA:
-- case BPF_LD | BPF_MEM:
-- case BPF_LDX | BPF_MEM:
-- case BPF_ST:
-- case BPF_STX:
-- case BPF_JMP | BPF_JA:
-- case BPF_JMP | BPF_JEQ | BPF_K:
-- case BPF_JMP | BPF_JEQ | BPF_X:
-- case BPF_JMP | BPF_JGE | BPF_K:
-- case BPF_JMP | BPF_JGE | BPF_X:
-- case BPF_JMP | BPF_JGT | BPF_K:
-- case BPF_JMP | BPF_JGT | BPF_X:
-- case BPF_JMP | BPF_JSET | BPF_K:
-- case BPF_JMP | BPF_JSET | BPF_X:
-+ case BPF_S_RET_K:
-+ case BPF_S_RET_A:
-+ case BPF_S_ALU_ADD_K:
-+ case BPF_S_ALU_ADD_X:
-+ case BPF_S_ALU_SUB_K:
-+ case BPF_S_ALU_SUB_X:
-+ case BPF_S_ALU_MUL_K:
-+ case BPF_S_ALU_MUL_X:
-+ case BPF_S_ALU_DIV_X:
-+ case BPF_S_ALU_AND_K:
-+ case BPF_S_ALU_AND_X:
-+ case BPF_S_ALU_OR_K:
-+ case BPF_S_ALU_OR_X:
-+ case BPF_S_ALU_XOR_K:
-+ case BPF_S_ALU_XOR_X:
-+ case BPF_S_ALU_LSH_K:
-+ case BPF_S_ALU_LSH_X:
-+ case BPF_S_ALU_RSH_K:
-+ case BPF_S_ALU_RSH_X:
-+ case BPF_S_ALU_NEG:
-+ case BPF_S_LD_IMM:
-+ case BPF_S_LDX_IMM:
-+ case BPF_S_MISC_TAX:
-+ case BPF_S_MISC_TXA:
-+ case BPF_S_ALU_DIV_K:
-+ case BPF_S_LD_MEM:
-+ case BPF_S_LDX_MEM:
-+ case BPF_S_ST:
-+ case BPF_S_STX:
-+ case BPF_S_JMP_JA:
-+ case BPF_S_JMP_JEQ_K:
-+ case BPF_S_JMP_JEQ_X:
-+ case BPF_S_JMP_JGE_K:
-+ case BPF_S_JMP_JGE_X:
-+ case BPF_S_JMP_JGT_K:
-+ case BPF_S_JMP_JGT_X:
-+ case BPF_S_JMP_JSET_K:
-+ case BPF_S_JMP_JSET_X:
- continue;
- default:
- return -EINVAL;
-@@ -173,22 +202,18 @@ static int seccomp_check_filter(struct sock_filter *filter, unsigned int flen)
- static u32 seccomp_run_filters(int syscall)
- {
- struct seccomp_filter *f;
-- struct seccomp_data sd;
- u32 ret = SECCOMP_RET_ALLOW;
-
- /* Ensure unexpected behavior doesn't result in failing open. */
- if (WARN_ON(current->seccomp.filter == NULL))
- return SECCOMP_RET_KILL;
-
-- populate_seccomp_data(&sd);
--
- /*
- * All filters in the list are evaluated and the lowest BPF return
- * value always takes priority (ignoring the DATA).
- */
- for (f = current->seccomp.filter; f; f = f->prev) {
-- u32 cur_ret = SK_RUN_FILTER(f->prog, (void *)&sd);
--
-+ u32 cur_ret = sk_run_filter(NULL, f->insns);
- if ((cur_ret & SECCOMP_RET_ACTION) < (ret & SECCOMP_RET_ACTION))
- ret = cur_ret;
- }
-@@ -206,20 +231,18 @@ static long seccomp_attach_filter(struct sock_fprog *fprog)
- struct seccomp_filter *filter;
- unsigned long fp_size = fprog->len * sizeof(struct sock_filter);
- unsigned long total_insns = fprog->len;
-- struct sock_filter *fp;
-- int new_len;
- long ret;
-
- if (fprog->len == 0 || fprog->len > BPF_MAXINSNS)
- return -EINVAL;
-
- for (filter = current->seccomp.filter; filter; filter = filter->prev)
-- total_insns += filter->prog->len + 4; /* include a 4 instr penalty */
-+ total_insns += filter->len + 4; /* include a 4 instr penalty */
- if (total_insns > MAX_INSNS_PER_PATH)
- return -ENOMEM;
-
- /*
-- * Installing a seccomp filter requires that the task has
-+ * Installing a seccomp filter requires that the task have
- * CAP_SYS_ADMIN in its namespace or be running with no_new_privs.
- * This avoids scenarios where unprivileged tasks can affect the
- * behavior of privileged children.
-@@ -229,51 +252,28 @@ static long seccomp_attach_filter(struct sock_fprog *fprog)
- CAP_SYS_ADMIN) != 0)
- return -EACCES;
-
-- fp = kzalloc(fp_size, GFP_KERNEL|__GFP_NOWARN);
-- if (!fp)
-- return -ENOMEM;
--
-- /* Copy the instructions from fprog. */
-- ret = -EFAULT;
-- if (copy_from_user(fp, fprog->filter, fp_size))
-- goto free_prog;
--
-- /* Check and rewrite the fprog via the skb checker */
-- ret = sk_chk_filter(fp, fprog->len);
-- if (ret)
-- goto free_prog;
--
-- /* Check and rewrite the fprog for seccomp use */
-- ret = seccomp_check_filter(fp, fprog->len);
-- if (ret)
-- goto free_prog;
--
-- /* Convert 'sock_filter' insns to 'sock_filter_int' insns */
-- ret = sk_convert_filter(fp, fprog->len, NULL, &new_len);
-- if (ret)
-- goto free_prog;
--
- /* Allocate a new seccomp_filter */
-- ret = -ENOMEM;
-- filter = kzalloc(sizeof(struct seccomp_filter),
-+ filter = kzalloc(sizeof(struct seccomp_filter) + fp_size,
- GFP_KERNEL|__GFP_NOWARN);
+@@ -395,16 +395,15 @@ static struct seccomp_filter *seccomp_prepare_filter(struct sock_fprog *fprog)
if (!filter)
-- goto free_prog;
--
-- filter->prog = kzalloc(sk_filter_size(new_len),
+ goto free_prog;
+
+- filter->prog = kzalloc(bpf_prog_size(new_len),
- GFP_KERNEL|__GFP_NOWARN);
-- if (!filter->prog)
-- goto free_filter;
--
-- ret = sk_convert_filter(fp, fprog->len, filter->prog->insnsi, &new_len);
-- if (ret)
-- goto free_filter_prog;
++ filter->prog = bpf_prog_alloc(bpf_prog_size(new_len), __GFP_NOWARN);
+ if (!filter->prog)
+ goto free_filter;
+
+ ret = bpf_convert_filter(fp, fprog->len, filter->prog->insnsi, &new_len);
+ if (ret)
+ goto free_filter_prog;
- kfree(fp);
--
-+ return -ENOMEM;
+
++ kfree(fp);
atomic_set(&filter->usage, 1);
-- filter->prog->len = new_len;
-+ filter->len = fprog->len;
+ filter->prog->len = new_len;
-- sk_filter_select_runtime(filter->prog);
-+ /* Copy the instructions from fprog. */
-+ ret = -EFAULT;
-+ if (copy_from_user(filter->insns, fprog->filter, fp_size))
-+ goto fail;
-+
-+ /* Check and rewrite the fprog via the skb checker */
-+ ret = sk_chk_filter(filter->insns, filter->len);
-+ if (ret)
-+ goto fail;
-+
-+ /* Check and rewrite the fprog for seccomp use */
-+ ret = seccomp_check_filter(filter->insns, filter->len);
-+ if (ret)
-+ goto fail;
+@@ -413,7 +412,7 @@ static struct seccomp_filter *seccomp_prepare_filter(struct sock_fprog *fprog)
+ return filter;
- /*
- * If there is an existing filter, make it the prev and don't drop its
-@@ -282,13 +282,8 @@ static long seccomp_attach_filter(struct sock_fprog *fprog)
- filter->prev = current->seccomp.filter;
- current->seccomp.filter = filter;
- return 0;
--
--free_filter_prog:
+ free_filter_prog:
- kfree(filter->prog);
--free_filter:
-+fail:
++ __bpf_prog_free(filter->prog);
+ free_filter:
kfree(filter);
--free_prog:
-- kfree(fp);
- return ret;
- }
-
-@@ -298,7 +293,7 @@ free_prog:
- *
- * Returns 0 on success and non-zero otherwise.
- */
--static long seccomp_attach_user_filter(char __user *user_filter)
-+long seccomp_attach_user_filter(char __user *user_filter)
- {
- struct sock_fprog fprog;
- long ret = -EFAULT;
-@@ -337,7 +332,6 @@ void put_seccomp_filter(struct task_struct *tsk)
- while (orig && atomic_dec_and_test(&orig->usage)) {
- struct seccomp_filter *freeme = orig;
- orig = orig->prev;
-- sk_filter_free(freeme->prog);
- kfree(freeme);
- }
- }
+ free_prog:
diff --git a/kernel/signal.c b/kernel/signal.c
-index a4077e9..f0d4e5c 100644
+index 8f0876f..1153a5a 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -53,12 +53,12 @@ static struct kmem_cache *sigqueue_cachep;
return ret;
}
-@@ -1296,8 +1316,11 @@ int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
+@@ -1300,8 +1320,11 @@ int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
ret = check_kill_permission(sig, info, p);
rcu_read_unlock();
.thread_should_run = ksoftirqd_should_run,
.thread_fn = run_ksoftirqd,
diff --git a/kernel/sys.c b/kernel/sys.c
-index 66a751e..a42497e 100644
+index ce81291..df2ca85 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -148,6 +148,12 @@ static int set_one_prio(struct task_struct *p, int niceval, int error)
if (!retval) {
if (old_rlim)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
-index 75b22e2..65c0ac8 100644
+index 75875a7..cd8e838 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -94,7 +94,6 @@
#endif
+#ifdef CONFIG_PAX_SOFTMODE
-+static ctl_table pax_table[] = {
++static struct ctl_table pax_table[] = {
+ {
+ .procname = "softmode",
+ .data = &pax_softmode,
},
{
.procname = "perf_event_mlock_kb",
-@@ -1338,6 +1379,13 @@ static struct ctl_table vm_table[] = {
+@@ -1335,6 +1376,13 @@ static struct ctl_table vm_table[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
},
#else
{
.procname = "nr_trim_pages",
-@@ -1827,6 +1875,16 @@ int proc_dostring(struct ctl_table *table, int write,
+@@ -1824,6 +1872,16 @@ int proc_dostring(struct ctl_table *table, int write,
(char __user *)buffer, lenp, ppos);
}
static size_t proc_skip_spaces(char **buf)
{
size_t ret;
-@@ -1932,6 +1990,8 @@ static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
+@@ -1929,6 +1987,8 @@ static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
len = strlen(tmp);
if (len > *size)
len = *size;
if (copy_to_user(*buf, tmp, len))
return -EFAULT;
*size -= len;
-@@ -2109,7 +2169,7 @@ int proc_dointvec(struct ctl_table *table, int write,
+@@ -2106,7 +2166,7 @@ int proc_dointvec(struct ctl_table *table, int write,
static int proc_taint(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
unsigned long tmptaint = get_taint();
int err;
-@@ -2137,7 +2197,6 @@ static int proc_taint(struct ctl_table *table, int write,
+@@ -2134,7 +2194,6 @@ static int proc_taint(struct ctl_table *table, int write,
return err;
}
static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
-@@ -2146,7 +2205,6 @@ static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
+@@ -2143,7 +2202,6 @@ static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
}
struct do_proc_dointvec_minmax_conv_param {
int *min;
-@@ -2706,6 +2764,12 @@ int proc_dostring(struct ctl_table *table, int write,
+@@ -2703,6 +2761,12 @@ int proc_dostring(struct ctl_table *table, int write,
return -ENOSYS;
}
int proc_dointvec(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
-@@ -2762,5 +2826,6 @@ EXPORT_SYMBOL(proc_dointvec_minmax);
+@@ -2759,5 +2823,6 @@ EXPORT_SYMBOL(proc_dointvec_minmax);
EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
EXPORT_SYMBOL(proc_dointvec_ms_jiffies);
EXPORT_SYMBOL(proc_dostring);
if (info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK])
return cmd_attr_register_cpumask(info);
else if (info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK])
-diff --git a/kernel/time.c b/kernel/time.c
-index 7c7964c..2a0d412 100644
---- a/kernel/time.c
-+++ b/kernel/time.c
-@@ -172,6 +172,11 @@ int do_sys_settimeofday(const struct timespec *tv, const struct timezone *tz)
- return error;
-
- if (tz) {
-+ /* we log in do_settimeofday called below, so don't log twice
-+ */
-+ if (!tv)
-+ gr_log_timechange();
-+
- sys_tz = *tz;
- update_vsyscall_tz();
- if (firsttime) {
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
-index fe75444..190c528 100644
+index a7077d3..dd48a49 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
-@@ -811,7 +811,7 @@ static int __init alarmtimer_init(void)
+@@ -823,7 +823,7 @@ static int __init alarmtimer_init(void)
struct platform_device *pdev;
int error = 0;
int i;
.clock_getres = alarm_clock_getres,
.clock_get = alarm_clock_get,
.timer_create = alarm_timer_create,
+diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
+index 1c2fe7d..ce7483d 100644
+--- a/kernel/time/hrtimer.c
++++ b/kernel/time/hrtimer.c
+@@ -1399,7 +1399,7 @@ void hrtimer_peek_ahead_timers(void)
+ local_irq_restore(flags);
+ }
+
+-static void run_hrtimer_softirq(struct softirq_action *h)
++static __latent_entropy void run_hrtimer_softirq(void)
+ {
+ hrtimer_peek_ahead_timers();
+ }
+diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
+index 3b89464..5e38379 100644
+--- a/kernel/time/posix-cpu-timers.c
++++ b/kernel/time/posix-cpu-timers.c
+@@ -1464,14 +1464,14 @@ struct k_clock clock_posix_cpu = {
+
+ static __init int init_posix_cpu_timers(void)
+ {
+- struct k_clock process = {
++ static struct k_clock process = {
+ .clock_getres = process_cpu_clock_getres,
+ .clock_get = process_cpu_clock_get,
+ .timer_create = process_cpu_timer_create,
+ .nsleep = process_cpu_nsleep,
+ .nsleep_restart = process_cpu_nsleep_restart,
+ };
+- struct k_clock thread = {
++ static struct k_clock thread = {
+ .clock_getres = thread_cpu_clock_getres,
+ .clock_get = thread_cpu_clock_get,
+ .timer_create = thread_cpu_timer_create,
+diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
+index 42b463a..a6b008f 100644
+--- a/kernel/time/posix-timers.c
++++ b/kernel/time/posix-timers.c
+@@ -43,6 +43,7 @@
+ #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>
+@@ -124,7 +125,7 @@ static DEFINE_SPINLOCK(hash_lock);
+ * which we beg off on and pass to do_sys_settimeofday().
+ */
+
+-static struct k_clock posix_clocks[MAX_CLOCKS];
++static struct k_clock *posix_clocks[MAX_CLOCKS];
+
+ /*
+ * These ones are defined below.
+@@ -277,7 +278,7 @@ static int posix_get_tai(clockid_t which_clock, struct timespec *tp)
+ */
+ static __init int init_posix_timers(void)
+ {
+- struct k_clock clock_realtime = {
++ static struct k_clock clock_realtime = {
+ .clock_getres = hrtimer_get_res,
+ .clock_get = posix_clock_realtime_get,
+ .clock_set = posix_clock_realtime_set,
+@@ -289,7 +290,7 @@ static __init int init_posix_timers(void)
+ .timer_get = common_timer_get,
+ .timer_del = common_timer_del,
+ };
+- struct k_clock clock_monotonic = {
++ static struct k_clock clock_monotonic = {
+ .clock_getres = hrtimer_get_res,
+ .clock_get = posix_ktime_get_ts,
+ .nsleep = common_nsleep,
+@@ -299,19 +300,19 @@ static __init int init_posix_timers(void)
+ .timer_get = common_timer_get,
+ .timer_del = common_timer_del,
+ };
+- struct k_clock clock_monotonic_raw = {
++ static struct k_clock clock_monotonic_raw = {
+ .clock_getres = hrtimer_get_res,
+ .clock_get = posix_get_monotonic_raw,
+ };
+- struct k_clock clock_realtime_coarse = {
++ static struct k_clock clock_realtime_coarse = {
+ .clock_getres = posix_get_coarse_res,
+ .clock_get = posix_get_realtime_coarse,
+ };
+- struct k_clock clock_monotonic_coarse = {
++ static struct k_clock clock_monotonic_coarse = {
+ .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,
+@@ -321,7 +322,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,
+@@ -533,7 +534,7 @@ void posix_timers_register_clock(const clockid_t clock_id,
+ return;
+ }
+
+- posix_clocks[clock_id] = *new_clock;
++ posix_clocks[clock_id] = new_clock;
+ }
+ EXPORT_SYMBOL_GPL(posix_timers_register_clock);
+
+@@ -579,9 +580,9 @@ static struct k_clock *clockid_to_kclock(const clockid_t id)
+ return (id & CLOCKFD_MASK) == CLOCKFD ?
+ &clock_posix_dynamic : &clock_posix_cpu;
+
+- if (id >= MAX_CLOCKS || !posix_clocks[id].clock_getres)
++ if (id >= MAX_CLOCKS || !posix_clocks[id] || !posix_clocks[id]->clock_getres)
+ return NULL;
+- return &posix_clocks[id];
++ return posix_clocks[id];
+ }
+
+ static int common_timer_create(struct k_itimer *new_timer)
+@@ -599,7 +600,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
+ struct k_clock *kc = clockid_to_kclock(which_clock);
+ struct k_itimer *new_timer;
+ int error, new_timer_id;
+- sigevent_t event;
++ sigevent_t event = { };
+ int it_id_set = IT_ID_NOT_SET;
+
+ if (!kc)
+@@ -1013,6 +1014,13 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
+ if (copy_from_user(&new_tp, tp, sizeof (*tp)))
+ return -EFAULT;
+
++ /* only the CLOCK_REALTIME clock can be set, all other clocks
++ have their clock_set fptr set to a nosettime dummy function
++ CLOCK_REALTIME has a NULL clock_set fptr which causes it to
++ call common_clock_set, which calls do_sys_settimeofday, which
++ we hook
++ */
++
+ return kc->clock_set(which_clock, &new_tp);
+ }
+
+diff --git a/kernel/time/time.c b/kernel/time/time.c
+index a9ae20f..d3fbde7 100644
+--- a/kernel/time/time.c
++++ b/kernel/time/time.c
+@@ -173,6 +173,11 @@ int do_sys_settimeofday(const struct timespec *tv, const struct timezone *tz)
+ return error;
+
+ if (tz) {
++ /* we log in do_settimeofday called below, so don't log twice
++ */
++ if (!tv)
++ gr_log_timechange();
++
+ sys_tz = *tz;
+ update_vsyscall_tz();
+ if (firsttime) {
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
-index 32d8d6a..11486af 100644
+index ec1791f..6a086cd 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -15,6 +15,7 @@
#include <linux/syscore_ops.h>
#include <linux/clocksource.h>
#include <linux/jiffies.h>
-@@ -502,6 +503,8 @@ int do_settimeofday(const struct timespec *tv)
+@@ -717,6 +718,8 @@ int do_settimeofday(const struct timespec *tv)
if (!timespec_valid_strict(tv))
return -EINVAL;
+ gr_log_timechange();
+
raw_spin_lock_irqsave(&timekeeper_lock, flags);
- write_seqcount_begin(&timekeeper_seq);
+ write_seqcount_begin(&tk_core.seq);
+diff --git a/kernel/time/timer.c b/kernel/time/timer.c
+index 9bbb834..3caa8ed 100644
+--- a/kernel/time/timer.c
++++ b/kernel/time/timer.c
+@@ -1394,7 +1394,7 @@ void update_process_times(int user_tick)
+ /*
+ * This function runs timers and the timer-tq in bottom half context.
+ */
+-static void run_timer_softirq(struct softirq_action *h)
++static __latent_entropy void run_timer_softirq(void)
+ {
+ struct tvec_base *base = __this_cpu_read(tvec_bases);
+
+@@ -1457,7 +1457,7 @@ static void process_timeout(unsigned long __data)
+ *
+ * In all cases the return value is guaranteed to be non-negative.
+ */
+-signed long __sched schedule_timeout(signed long timeout)
++signed long __sched __intentional_overflow(-1) schedule_timeout(signed long timeout)
+ {
+ struct timer_list timer;
+ unsigned long expire;
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index 61ed862..3b52c65 100644
--- a/kernel/time/timer_list.c
if (!pe)
return -ENOMEM;
return 0;
-diff --git a/kernel/timer.c b/kernel/timer.c
-index 3bb01a3..0e7760e 100644
---- a/kernel/timer.c
-+++ b/kernel/timer.c
-@@ -1393,7 +1393,7 @@ void update_process_times(int user_tick)
- /*
- * This function runs timers and the timer-tq in bottom half context.
- */
--static void run_timer_softirq(struct softirq_action *h)
-+static __latent_entropy void run_timer_softirq(void)
- {
- struct tvec_base *base = __this_cpu_read(tvec_bases);
-
-@@ -1456,7 +1456,7 @@ static void process_timeout(unsigned long __data)
- *
- * In all cases the return value is guaranteed to be non-negative.
- */
--signed long __sched schedule_timeout(signed long timeout)
-+signed long __sched __intentional_overflow(-1) schedule_timeout(signed long timeout)
- {
- struct timer_list timer;
- unsigned long expire;
diff --git a/kernel/torture.c b/kernel/torture.c
-index 40bb511..91190b9 100644
+index d600af2..27a4e9d 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -484,7 +484,7 @@ static int torture_shutdown_notify(struct notifier_block *unused1,
ret = -EIO;
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
-index ac9d1da..ce98b35 100644
+index 5916a8e..5cd3b1f 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
-@@ -1920,12 +1920,17 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec)
+@@ -2128,12 +2128,17 @@ ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec)
if (unlikely(ftrace_disabled))
return 0;
}
/*
-@@ -4126,8 +4131,10 @@ static int ftrace_process_locs(struct module *mod,
+@@ -4458,8 +4463,10 @@ static int ftrace_process_locs(struct module *mod,
if (!count)
return 0;
start_pg = ftrace_allocate_pages(count);
if (!start_pg)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
-index ff70271..4242e69 100644
+index 2d75c94..5ef6d32 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -352,9 +352,9 @@ struct buffer_data_page {
local_t dropped_events;
local_t committing;
local_t commits;
-@@ -626,8 +626,22 @@ int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu,
- work = &cpu_buffer->irq_work;
- }
-
-- work->waiters_pending = true;
- poll_wait(filp, &work->waiters, poll_table);
-+ work->waiters_pending = true;
-+ /*
-+ * There's a tight race between setting the waiters_pending and
-+ * checking if the ring buffer is empty. Once the waiters_pending bit
-+ * is set, the next event will wake the task up, but we can get stuck
-+ * if there's only a single event in.
-+ *
-+ * FIXME: Ideally, we need a memory barrier on the writer side as well,
-+ * but adding a memory barrier to all events will cause too much of a
-+ * performance hit in the fast path. We only need a memory barrier when
-+ * the buffer goes from empty to having content. But as this race is
-+ * extremely small, and it's not a problem if another event comes in, we
-+ * will fix it later.
-+ */
-+ smp_mb();
-
- if ((cpu == RING_BUFFER_ALL_CPUS && !ring_buffer_empty(buffer)) ||
- (cpu != RING_BUFFER_ALL_CPUS && !ring_buffer_empty_cpu(buffer, cpu)))
-@@ -991,8 +1005,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -1005,8 +1005,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
*
* We add a counter to the write field to denote this.
*/
/*
* Just make sure we have seen our old_write and synchronize
-@@ -1020,8 +1034,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -1034,8 +1034,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
* cmpxchg to only update if an interrupt did not already
* do it for us. If the cmpxchg fails, we don't care.
*/
/*
* No need to worry about races with clearing out the commit.
-@@ -1388,12 +1402,12 @@ static void rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer);
+@@ -1402,12 +1402,12 @@ static void rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer);
static inline unsigned long rb_page_entries(struct buffer_page *bpage)
{
}
static int
-@@ -1488,7 +1502,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned int nr_pages)
+@@ -1502,7 +1502,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned int nr_pages)
* bytes consumed in ring buffer from here.
* Increment overrun to account for the lost events.
*/
local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes);
}
-@@ -2066,7 +2080,7 @@ rb_handle_head_page(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2064,7 +2064,7 @@ rb_handle_head_page(struct ring_buffer_per_cpu *cpu_buffer,
* it is our responsibility to update
* the counters.
*/
local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes);
/*
-@@ -2216,7 +2230,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2214,7 +2214,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
if (tail == BUF_PAGE_SIZE)
tail_page->real_end = 0;
return;
}
-@@ -2251,7 +2265,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2249,7 +2249,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
rb_event_set_padding(event);
/* Set the write back to the previous setting */
return;
}
-@@ -2263,7 +2277,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2261,7 +2261,7 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
/* Set write to end of buffer */
length = (tail + length) - BUF_PAGE_SIZE;
}
/*
-@@ -2289,7 +2303,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2287,7 +2287,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,
* about it.
*/
if (unlikely(next_page == commit_page)) {
goto out_reset;
}
-@@ -2345,7 +2359,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2343,7 +2343,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,
cpu_buffer->tail_page) &&
(cpu_buffer->commit_page ==
cpu_buffer->reader_page))) {
goto out_reset;
}
}
-@@ -2393,7 +2407,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2391,7 +2391,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
length += RB_LEN_TIME_EXTEND;
tail_page = cpu_buffer->tail_page;
/* set write to only the index of the write */
write &= RB_WRITE_MASK;
-@@ -2417,7 +2431,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2415,7 +2415,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
kmemcheck_annotate_bitfield(event, bitfield);
rb_update_event(cpu_buffer, event, length, add_timestamp, delta);
/*
* If this is the first commit on the page, then update
-@@ -2450,7 +2464,7 @@ rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2448,7 +2448,7 @@ rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer,
if (bpage->page == (void *)addr && rb_page_write(bpage) == old_index) {
unsigned long write_mask =
unsigned long event_length = rb_event_length(event);
/*
* This is on the tail page. It is possible that
-@@ -2460,7 +2474,7 @@ rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2458,7 +2458,7 @@ rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer,
*/
old_index += write_mask;
new_index += write_mask;
if (index == old_index) {
/* update counters */
local_sub(event_length, &cpu_buffer->entries_bytes);
-@@ -2852,7 +2866,7 @@ rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2850,7 +2850,7 @@ rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer,
/* Do the likely case first */
if (likely(bpage->page == (void *)addr)) {
return;
}
-@@ -2864,7 +2878,7 @@ rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer,
+@@ -2862,7 +2862,7 @@ rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer,
start = bpage;
do {
if (bpage->page == (void *)addr) {
return;
}
rb_inc_page(cpu_buffer, &bpage);
-@@ -3148,7 +3162,7 @@ static inline unsigned long
+@@ -3146,7 +3146,7 @@ static inline unsigned long
rb_num_of_entries(struct ring_buffer_per_cpu *cpu_buffer)
{
return local_read(&cpu_buffer->entries) -
}
/**
-@@ -3237,7 +3251,7 @@ unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu)
+@@ -3235,7 +3235,7 @@ unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu)
return 0;
cpu_buffer = buffer->buffers[cpu];
return ret;
}
-@@ -3260,7 +3274,7 @@ ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu)
+@@ -3258,7 +3258,7 @@ ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu)
return 0;
cpu_buffer = buffer->buffers[cpu];
return ret;
}
-@@ -3345,7 +3359,7 @@ unsigned long ring_buffer_overruns(struct ring_buffer *buffer)
+@@ -3343,7 +3343,7 @@ unsigned long ring_buffer_overruns(struct ring_buffer *buffer)
/* if you care about this being correct, lock the buffer */
for_each_buffer_cpu(buffer, cpu) {
cpu_buffer = buffer->buffers[cpu];
}
return overruns;
-@@ -3521,8 +3535,8 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
+@@ -3514,8 +3514,8 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
/*
* Reset the reader page to size zero.
*/
local_set(&cpu_buffer->reader_page->page->commit, 0);
cpu_buffer->reader_page->real_end = 0;
-@@ -3556,7 +3570,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
+@@ -3549,7 +3549,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
* want to compare with the last_overrun.
*/
smp_mb();
/*
* Here's the tricky part.
-@@ -4126,8 +4140,8 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)
+@@ -4121,8 +4121,8 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)
cpu_buffer->head_page
= list_entry(cpu_buffer->pages, struct buffer_page, list);
local_set(&cpu_buffer->head_page->page->commit, 0);
cpu_buffer->head_page->read = 0;
-@@ -4137,14 +4151,14 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)
+@@ -4132,14 +4132,14 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)
INIT_LIST_HEAD(&cpu_buffer->reader_page->list);
INIT_LIST_HEAD(&cpu_buffer->new_pages);
local_set(&cpu_buffer->dropped_events, 0);
local_set(&cpu_buffer->entries, 0);
local_set(&cpu_buffer->committing, 0);
-@@ -4549,8 +4563,8 @@ int ring_buffer_read_page(struct ring_buffer *buffer,
+@@ -4544,8 +4544,8 @@ int ring_buffer_read_page(struct ring_buffer *buffer,
rb_init_page(bpage);
bpage = reader->page;
reader->page = *data_page;
*data_page = bpage;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
-index 291397e..db3836d 100644
+index 8a52839..dd6d7c8 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
-@@ -3510,7 +3510,7 @@ int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set)
+@@ -3487,7 +3487,7 @@ int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set)
return 0;
}
/* do nothing if flag is already set */
if (!!(trace_flags & mask) == !!enabled)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
-index 9258f5a..9b1e41e 100644
+index 385391f..8d2250f 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
-@@ -1278,7 +1278,7 @@ extern const char *__stop___tracepoint_str[];
+@@ -1280,7 +1280,7 @@ extern const char *__stop___tracepoint_str[];
void trace_printk_init_buffers(void);
void trace_printk_start_comm(void);
int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set);
+ return atomic64_inc_return_unchecked(&trace_counter);
}
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
-index 2de5362..c4c7003 100644
+index ef06ce7..3ea161d 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
-@@ -1722,7 +1722,6 @@ __trace_early_add_new_event(struct ftrace_event_call *call,
+@@ -1720,7 +1720,6 @@ __trace_early_add_new_event(struct ftrace_event_call *call,
return 0;
}
}
entry = ring_buffer_event_data(event);
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
-index f3dad80..d291d61 100644
+index c6977d5..d243785 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
-@@ -322,7 +322,7 @@ int trace_seq_path(struct trace_seq *s, const struct path *path)
-
- p = d_path(path, s->buffer + s->len, PAGE_SIZE - s->len);
- if (!IS_ERR(p)) {
-- p = mangle_path(s->buffer + s->len, p, "\n");
-+ p = mangle_path(s->buffer + s->len, p, "\n\\");
- if (p) {
- s->len = p - s->buffer;
- return 1;
-@@ -980,14 +980,16 @@ int register_ftrace_event(struct trace_event *event)
+@@ -712,14 +712,16 @@ int register_ftrace_event(struct trace_event *event)
goto out;
}
key = event->type & (EVENT_HASHSIZE - 1);
+diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c
+index 1f24ed9..10407ec 100644
+--- a/kernel/trace/trace_seq.c
++++ b/kernel/trace/trace_seq.c
+@@ -367,7 +367,7 @@ int trace_seq_path(struct trace_seq *s, const struct path *path)
+
+ p = d_path(path, s->buffer + s->len, PAGE_SIZE - s->len);
+ if (!IS_ERR(p)) {
+- p = mangle_path(s->buffer + s->len, p, "\n");
++ p = mangle_path(s->buffer + s->len, p, "\n\\");
+ if (p) {
+ s->len = p - s->buffer;
+ return 1;
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index 8a4e5cb..64f270d 100644
--- a/kernel/trace/trace_stack.c
local_irq_save(flags);
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
-index fcc0256..aee880f 100644
+index aa312b0..395f343 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -82,6 +82,21 @@ int create_user_ns(struct cred *new)
memcpy(&uts_table, table, sizeof(uts_table));
uts_table.data = get_uts(table, write);
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
-index c3319bd..67efc3c 100644
+index a8d6914..8fbdb13 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
-@@ -518,7 +518,7 @@ static int watchdog_nmi_enable(unsigned int cpu) { return 0; }
+@@ -521,7 +521,7 @@ static int watchdog_nmi_enable(unsigned int cpu) { return 0; }
static void watchdog_nmi_disable(unsigned int cpu) { return; }
#endif /* CONFIG_HARDLOCKUP_DETECTOR */
.thread_should_run = watchdog_should_run,
.thread_fn = watchdog,
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
-index 35974ac..43c9e87 100644
+index 5dbe22a..872413c 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
-@@ -4576,7 +4576,7 @@ static void rebind_workers(struct worker_pool *pool)
+@@ -4507,7 +4507,7 @@ static void rebind_workers(struct worker_pool *pool)
WARN_ON_ONCE(!(worker_flags & WORKER_UNBOUND));
worker_flags |= WORKER_REBOUND;
worker_flags &= ~WORKER_UNBOUND;
spin_unlock_irq(&pool->lock);
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
-index 7a638aa..20db901 100644
+index a285900..5e3b26b 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
-@@ -858,7 +858,7 @@ config DEBUG_MUTEXES
+@@ -882,7 +882,7 @@ config DEBUG_MUTEXES
config DEBUG_WW_MUTEX_SLOWPATH
bool "Wait/wound mutex debugging: Slowpath testing"
select DEBUG_LOCK_ALLOC
select DEBUG_SPINLOCK
select DEBUG_MUTEXES
-@@ -871,7 +871,7 @@ config DEBUG_WW_MUTEX_SLOWPATH
+@@ -899,7 +899,7 @@ config DEBUG_WW_MUTEX_SLOWPATH
config DEBUG_LOCK_ALLOC
bool "Lock debugging: detect incorrect freeing of live locks"
select DEBUG_SPINLOCK
select DEBUG_MUTEXES
select LOCKDEP
-@@ -885,7 +885,7 @@ config DEBUG_LOCK_ALLOC
+@@ -913,7 +913,7 @@ config DEBUG_LOCK_ALLOC
config PROVE_LOCKING
bool "Lock debugging: prove locking correctness"
select LOCKDEP
select DEBUG_SPINLOCK
select DEBUG_MUTEXES
-@@ -936,7 +936,7 @@ config LOCKDEP
+@@ -964,7 +964,7 @@ config LOCKDEP
config LOCK_STAT
bool "Lock usage statistics"
select LOCKDEP
select DEBUG_SPINLOCK
select DEBUG_MUTEXES
-@@ -1418,6 +1418,7 @@ config LATENCYTOP
+@@ -1437,6 +1437,7 @@ config LATENCYTOP
depends on DEBUG_KERNEL
depends on STACKTRACE_SUPPORT
depends on PROC_FS
select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC
select KALLSYMS
select KALLSYMS_ALL
-@@ -1434,7 +1435,7 @@ config ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
+@@ -1453,7 +1454,7 @@ config ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
config DEBUG_STRICT_USER_COPY_CHECKS
bool "Strict user copy size checks"
depends on ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
help
Enabling this option turns a certain set of sanity checks for user
copy operations into compile time failures.
-@@ -1554,7 +1555,7 @@ endmenu # runtime tests
+@@ -1581,7 +1582,7 @@ endmenu # runtime tests
config PROVIDE_OHCI1394_DMA_INIT
bool "Remote debugging over FireWire early on boot"
If you want to debug problems which hang or crash the kernel early
on boot and the crashing machine has a FireWire port, you can use
diff --git a/lib/Makefile b/lib/Makefile
-index ba967a1..2cc869a 100644
+index d6b4bc4..a3724eb 100644
--- a/lib/Makefile
+++ b/lib/Makefile
-@@ -33,7 +33,6 @@ obj-y += kstrtox.o
- obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
- obj-$(CONFIG_TEST_MODULE) += test_module.o
- obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o
--obj-$(CONFIG_TEST_BPF) += test_bpf.o
-
- ifeq ($(CONFIG_DEBUG_KOBJECT),y)
- CFLAGS_kobject.o += -DDEBUG
-@@ -54,7 +53,7 @@ obj-$(CONFIG_BTREE) += btree.o
+@@ -55,7 +55,7 @@ obj-$(CONFIG_BTREE) += btree.o
obj-$(CONFIG_INTERVAL_TREE) += interval_tree.o
obj-$(CONFIG_ASSOCIATIVE_ARRAY) += assoc_array.o
obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o
obj-$(CONFIG_DEBUG_OBJECTS) += debugobjects.o
ifneq ($(CONFIG_HAVE_DEC_LOCK),y)
-diff --git a/lib/assoc_array.c b/lib/assoc_array.c
-index c0b1007..ae146f0 100644
---- a/lib/assoc_array.c
-+++ b/lib/assoc_array.c
-@@ -1735,7 +1735,7 @@ ascend_old_tree:
- gc_complete:
- edit->set[0].to = new_root;
- assoc_array_apply_edit(edit);
-- edit->array->nr_leaves_on_tree = nr_leaves_on_tree;
-+ array->nr_leaves_on_tree = nr_leaves_on_tree;
- return 0;
-
- enomem:
diff --git a/lib/average.c b/lib/average.c
index 114d1be..ab0350c 100644
--- a/lib/average.c
(val << avg->factor)) >> avg->weight :
(val << avg->factor);
diff --git a/lib/bitmap.c b/lib/bitmap.c
-index 06f7e4f..f3cf2b0 100644
+index 1e031f2..a53eb90 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
-@@ -422,7 +422,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
+@@ -429,7 +429,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen,
{
int c, old_c, totaldigits, ndigits, nchunks, nbits;
u32 chunk;
bitmap_zero(maskp, nmaskbits);
-@@ -507,7 +507,7 @@ int bitmap_parse_user(const char __user *ubuf,
+@@ -514,7 +514,7 @@ int bitmap_parse_user(const char __user *ubuf,
{
if (!access_ok(VERIFY_READ, ubuf, ulen))
return -EFAULT;
ulen, 1, maskp, nmaskbits);
}
-@@ -598,7 +598,7 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen,
+@@ -605,7 +605,7 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen,
{
unsigned a, b;
int c, old_c, totaldigits;
int exp_digit, in_range;
totaldigits = c = 0;
-@@ -698,7 +698,7 @@ int bitmap_parselist_user(const char __user *ubuf,
+@@ -700,7 +700,7 @@ int bitmap_parselist_user(const char __user *ubuf,
{
if (!access_ok(VERIFY_READ, ubuf, ulen))
return -EFAULT;
+ pax_close_kernel();
+}
+EXPORT_SYMBOL(pax_list_del_rcu);
+diff --git a/lib/lockref.c b/lib/lockref.c
+index d2233de..fa1a2f6 100644
+--- a/lib/lockref.c
++++ b/lib/lockref.c
+@@ -48,13 +48,13 @@
+ void lockref_get(struct lockref *lockref)
+ {
+ CMPXCHG_LOOP(
+- new.count++;
++ __lockref_inc(&new);
+ ,
+ return;
+ );
+
+ spin_lock(&lockref->lock);
+- lockref->count++;
++ __lockref_inc(lockref);
+ spin_unlock(&lockref->lock);
+ }
+ EXPORT_SYMBOL(lockref_get);
+@@ -69,7 +69,7 @@ int lockref_get_not_zero(struct lockref *lockref)
+ int retval;
+
+ CMPXCHG_LOOP(
+- new.count++;
++ __lockref_inc(&new);
+ if (!old.count)
+ return 0;
+ ,
+@@ -79,7 +79,7 @@ int lockref_get_not_zero(struct lockref *lockref)
+ spin_lock(&lockref->lock);
+ retval = 0;
+ if (lockref->count) {
+- lockref->count++;
++ __lockref_inc(lockref);
+ retval = 1;
+ }
+ spin_unlock(&lockref->lock);
+@@ -96,7 +96,7 @@ EXPORT_SYMBOL(lockref_get_not_zero);
+ int lockref_get_or_lock(struct lockref *lockref)
+ {
+ CMPXCHG_LOOP(
+- new.count++;
++ __lockref_inc(&new);
+ if (!old.count)
+ break;
+ ,
+@@ -106,7 +106,7 @@ int lockref_get_or_lock(struct lockref *lockref)
+ spin_lock(&lockref->lock);
+ if (!lockref->count)
+ return 0;
+- lockref->count++;
++ __lockref_inc(lockref);
+ spin_unlock(&lockref->lock);
+ return 1;
+ }
+@@ -120,7 +120,7 @@ EXPORT_SYMBOL(lockref_get_or_lock);
+ int lockref_put_or_lock(struct lockref *lockref)
+ {
+ CMPXCHG_LOOP(
+- new.count--;
++ __lockref_dec(&new);
+ if (old.count <= 1)
+ break;
+ ,
+@@ -130,7 +130,7 @@ int lockref_put_or_lock(struct lockref *lockref)
+ spin_lock(&lockref->lock);
+ if (lockref->count <= 1)
+ return 0;
+- lockref->count--;
++ __lockref_dec(lockref);
+ spin_unlock(&lockref->lock);
+ return 1;
+ }
+@@ -157,7 +157,7 @@ int lockref_get_not_dead(struct lockref *lockref)
+ int retval;
+
+ CMPXCHG_LOOP(
+- new.count++;
++ __lockref_inc(&new);
+ if ((int)old.count < 0)
+ return 0;
+ ,
+@@ -167,7 +167,7 @@ int lockref_get_not_dead(struct lockref *lockref)
+ spin_lock(&lockref->lock);
+ retval = 0;
+ if ((int) lockref->count >= 0) {
+- lockref->count++;
++ __lockref_inc(lockref);
+ retval = 1;
+ }
+ spin_unlock(&lockref->lock);
diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c
-index 963b703..438bc51 100644
+index a89cf09..1a42c2d 100644
--- a/lib/percpu-refcount.c
+++ b/lib/percpu-refcount.c
@@ -29,7 +29,7 @@
-#define PCPU_COUNT_BIAS (1U << 31)
+#define PCPU_COUNT_BIAS (1U << 30)
- /**
- * percpu_ref_init - initialize a percpu refcount
+ static unsigned __percpu *pcpu_count_ptr(struct percpu_ref *ref)
+ {
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 3291a8e..346a91e 100644
--- a/lib/radix-tree.c
static inline void *ptr_to_indirect(void *ptr)
{
diff --git a/lib/random32.c b/lib/random32.c
-index fa5da61..35fe9af 100644
+index c9b6bf3..4752c6d4 100644
--- a/lib/random32.c
+++ b/lib/random32.c
-@@ -42,7 +42,7 @@
- static void __init prandom_state_selftest(void);
+@@ -46,7 +46,7 @@ static inline void prandom_state_selftest(void)
+ }
#endif
-static DEFINE_PER_CPU(struct rnd_state, net_rand_state);
/**
* prandom_u32_state - seeded pseudo-random number generator.
diff --git a/lib/rbtree.c b/lib/rbtree.c
-index 65f4eff..2cfa167 100644
+index c16c81a..4dcbda1 100644
--- a/lib/rbtree.c
+++ b/lib/rbtree.c
@@ -380,7 +380,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
+ printk("%lu pages hwpoisoned\n", atomic_long_read_unchecked(&num_poisoned_pages));
#endif
}
+diff --git a/lib/string.c b/lib/string.c
+index f3c6ff5..70db57a 100644
+--- a/lib/string.c
++++ b/lib/string.c
+@@ -604,6 +604,22 @@ void *memset(void *s, int c, size_t count)
+ EXPORT_SYMBOL(memset);
+ #endif
+
++/**
++ * memzero_explicit - Fill a region of memory (e.g. sensitive
++ * keying data) with 0s.
++ * @s: Pointer to the start of the area.
++ * @count: The size of the area.
++ *
++ * memzero_explicit() doesn't need an arch-specific version as
++ * it just invokes the one of memset() implicitly.
++ */
++void memzero_explicit(void *s, size_t count)
++{
++ memset(s, 0, count);
++ OPTIMIZER_HIDE_VAR(s);
++}
++EXPORT_SYMBOL(memzero_explicit);
++
+ #ifndef __HAVE_ARCH_MEMCPY
+ /**
+ * memcpy - Copy one area of memory to another
diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c
index bb2b201..46abaf9 100644
--- a/lib/strncpy_from_user.c
phys_addr_t paddr = dma_to_phys(hwdev, dev_addr);
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
-deleted file mode 100644
-index c579e0f..0000000
+index 89e0345..3347efe 100644
--- a/lib/test_bpf.c
-+++ /dev/null
-@@ -1,1929 +0,0 @@
--/*
-- * Testsuite for BPF interpreter and BPF JIT compiler
-- *
-- * Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
-- *
-- * This program is free software; you can redistribute it and/or
-- * modify it under the terms of version 2 of the GNU General Public
-- * License as published by the Free Software Foundation.
-- *
-- * This program is distributed in the hope that it will be useful, but
-- * WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * General Public License for more details.
-- */
--
--#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
--
--#include <linux/init.h>
--#include <linux/module.h>
--#include <linux/filter.h>
--#include <linux/skbuff.h>
--#include <linux/netdevice.h>
--#include <linux/if_vlan.h>
--
--/* General test specific settings */
--#define MAX_SUBTESTS 3
--#define MAX_TESTRUNS 10000
--#define MAX_DATA 128
--#define MAX_INSNS 512
--#define MAX_K 0xffffFFFF
--
--/* Few constants used to init test 'skb' */
--#define SKB_TYPE 3
--#define SKB_MARK 0x1234aaaa
--#define SKB_HASH 0x1234aaab
--#define SKB_QUEUE_MAP 123
--#define SKB_VLAN_TCI 0xffff
--#define SKB_DEV_IFINDEX 577
--#define SKB_DEV_TYPE 588
--
--/* Redefine REGs to make tests less verbose */
--#define R0 BPF_REG_0
--#define R1 BPF_REG_1
--#define R2 BPF_REG_2
--#define R3 BPF_REG_3
--#define R4 BPF_REG_4
--#define R5 BPF_REG_5
--#define R6 BPF_REG_6
--#define R7 BPF_REG_7
--#define R8 BPF_REG_8
--#define R9 BPF_REG_9
--#define R10 BPF_REG_10
--
--/* Flags that can be passed to test cases */
--#define FLAG_NO_DATA BIT(0)
--#define FLAG_EXPECTED_FAIL BIT(1)
--
--enum {
-- CLASSIC = BIT(6), /* Old BPF instructions only. */
-- INTERNAL = BIT(7), /* Extended instruction set. */
--};
--
--#define TEST_TYPE_MASK (CLASSIC | INTERNAL)
--
--struct bpf_test {
-- const char *descr;
-- union {
-- struct sock_filter insns[MAX_INSNS];
-- struct sock_filter_int insns_int[MAX_INSNS];
-- } u;
-- __u8 aux;
-- __u8 data[MAX_DATA];
-- struct {
-- int data_size;
-- __u32 result;
-- } test[MAX_SUBTESTS];
--};
--
--static struct bpf_test tests[] = {
-- {
-- "TAX",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_ALU | BPF_NEG, 0), /* A == -3 */
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_LEN, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0), /* X == len - 3 */
-- BPF_STMT(BPF_LD | BPF_B | BPF_IND, 1),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { 10, 20, 30, 40, 50 },
-- { { 2, 10 }, { 3, 20 }, { 4, 30 } },
-- },
-- {
-- "TXA",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0) /* A == len * 2 */
-- },
-- CLASSIC,
-- { 10, 20, 30, 40, 50 },
-- { { 1, 2 }, { 3, 6 }, { 4, 8 } },
-- },
-- {
-- "ADD_SUB_MUL_K",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, 1),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 2),
-- BPF_STMT(BPF_LDX | BPF_IMM, 3),
-- BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0xffffffff),
-- BPF_STMT(BPF_ALU | BPF_MUL | BPF_K, 3),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC | FLAG_NO_DATA,
-- { },
-- { { 0, 0xfffffffd } }
-- },
-- {
-- "DIV_KX",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, 8),
-- BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 2),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-- BPF_STMT(BPF_ALU | BPF_DIV | BPF_X, 0),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-- BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x70000000),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC | FLAG_NO_DATA,
-- { },
-- { { 0, 0x40000001 } }
-- },
-- {
-- "AND_OR_LSH_K",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, 0xff),
-- BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf0),
-- BPF_STMT(BPF_ALU | BPF_LSH | BPF_K, 27),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_IMM, 0xf),
-- BPF_STMT(BPF_ALU | BPF_OR | BPF_K, 0xf0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC | FLAG_NO_DATA,
-- { },
-- { { 0, 0x800000ff }, { 1, 0x800000ff } },
-- },
-- {
-- "LD_IMM_0",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, 0), /* ld #0 */
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 0),
-- BPF_STMT(BPF_RET | BPF_K, 1),
-- },
-- CLASSIC,
-- { },
-- { { 1, 1 } },
-- },
-- {
-- "LD_IND",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_IND, MAX_K),
-- BPF_STMT(BPF_RET | BPF_K, 1)
-- },
-- CLASSIC,
-- { },
-- { { 1, 0 }, { 10, 0 }, { 60, 0 } },
-- },
-- {
-- "LD_ABS",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS, 1000),
-- BPF_STMT(BPF_RET | BPF_K, 1)
-- },
-- CLASSIC,
-- { },
-- { { 1, 0 }, { 10, 0 }, { 60, 0 } },
-- },
-- {
-- "LD_ABS_LL",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_LL_OFF),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_LL_OFF + 1),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { 1, 2, 3 },
-- { { 1, 0 }, { 2, 3 } },
-- },
-- {
-- "LD_IND_LL",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, SKF_LL_OFF - 1),
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_B | BPF_IND, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { 1, 2, 3, 0xff },
-- { { 1, 1 }, { 3, 3 }, { 4, 0xff } },
-- },
-- {
-- "LD_ABS_NET",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_NET_OFF),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_NET_OFF + 1),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 },
-- { { 15, 0 }, { 16, 3 } },
-- },
-- {
-- "LD_IND_NET",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, SKF_NET_OFF - 15),
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_B | BPF_IND, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 },
-- { { 14, 0 }, { 15, 1 }, { 17, 3 } },
-- },
-- {
-- "LD_PKTTYPE",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PKTTYPE),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 1),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PKTTYPE),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 1),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PKTTYPE),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 1),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 1, 3 }, { 10, 3 } },
-- },
-- {
-- "LD_MARK",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_MARK),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 1, SKB_MARK}, { 10, SKB_MARK} },
-- },
-- {
-- "LD_RXHASH",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_RXHASH),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 1, SKB_HASH}, { 10, SKB_HASH} },
-- },
-- {
-- "LD_QUEUE",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_QUEUE),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 1, SKB_QUEUE_MAP }, { 10, SKB_QUEUE_MAP } },
-- },
-- {
-- "LD_PROTOCOL",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 1),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 20, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 0),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PROTOCOL),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 30, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 0),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { 10, 20, 30 },
-- { { 10, ETH_P_IP }, { 100, ETH_P_IP } },
-- },
-- {
-- "LD_VLAN_TAG",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_VLAN_TAG),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- {
-- { 1, SKB_VLAN_TCI & ~VLAN_TAG_PRESENT },
-- { 10, SKB_VLAN_TCI & ~VLAN_TAG_PRESENT }
-- },
-- },
-- {
-- "LD_VLAN_TAG_PRESENT",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- {
-- { 1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) },
-- { 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }
-- },
-- },
-- {
-- "LD_IFINDEX",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_IFINDEX),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 1, SKB_DEV_IFINDEX }, { 10, SKB_DEV_IFINDEX } },
-- },
-- {
-- "LD_HATYPE",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_HATYPE),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 1, SKB_DEV_TYPE }, { 10, SKB_DEV_TYPE } },
-- },
-- {
-- "LD_CPU",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_CPU),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_CPU),
-- BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 1, 0 }, { 10, 0 } },
-- },
-- {
-- "LD_NLATTR",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_IMM, 2),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_LDX | BPF_IMM, 3),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
--#ifdef __BIG_ENDIAN
-- { 0xff, 0xff, 0, 4, 0, 2, 0, 4, 0, 3 },
--#else
-- { 0xff, 0xff, 4, 0, 2, 0, 4, 0, 3, 0 },
--#endif
-- { { 4, 0 }, { 20, 6 } },
-- },
-- {
-- "LD_NLATTR_NEST",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_LDX | BPF_IMM, 3),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
--#ifdef __BIG_ENDIAN
-- { 0xff, 0xff, 0, 12, 0, 1, 0, 4, 0, 2, 0, 4, 0, 3 },
--#else
-- { 0xff, 0xff, 12, 0, 1, 0, 4, 0, 2, 0, 4, 0, 3, 0 },
--#endif
-- { { 4, 0 }, { 20, 10 } },
-- },
-- {
-- "LD_PAYLOAD_OFF",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- /* 00:00:00:00:00:00 > 00:00:00:00:00:00, ethtype IPv4 (0x0800),
-- * length 98: 127.0.0.1 > 127.0.0.1: ICMP echo request,
-- * id 9737, seq 1, length 64
-- */
-- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-- 0x08, 0x00,
-- 0x45, 0x00, 0x00, 0x54, 0xac, 0x8b, 0x40, 0x00, 0x40,
-- 0x01, 0x90, 0x1b, 0x7f, 0x00, 0x00, 0x01 },
-- { { 30, 0 }, { 100, 42 } },
-- },
-- {
-- "LD_ANC_XOR",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, 10),
-- BPF_STMT(BPF_LDX | BPF_IMM, 300),
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_ALU_XOR_X),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 4, 10 ^ 300 }, { 20, 10 ^ 300 } },
-- },
-- {
-- "SPILL_FILL",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_LD | BPF_IMM, 2),
-- BPF_STMT(BPF_ALU | BPF_RSH, 1),
-- BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-- BPF_STMT(BPF_ST, 1), /* M1 = 1 ^ len */
-- BPF_STMT(BPF_ALU | BPF_XOR | BPF_K, 0x80000000),
-- BPF_STMT(BPF_ST, 2), /* M2 = 1 ^ len ^ 0x80000000 */
-- BPF_STMT(BPF_STX, 15), /* M3 = len */
-- BPF_STMT(BPF_LDX | BPF_MEM, 1),
-- BPF_STMT(BPF_LD | BPF_MEM, 2),
-- BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 15),
-- BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { { 1, 0x80000001 }, { 2, 0x80000002 }, { 60, 0x80000000 ^ 60 } }
-- },
-- {
-- "JEQ",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0, 0, 1),
-- BPF_STMT(BPF_RET | BPF_K, 1),
-- BPF_STMT(BPF_RET | BPF_K, MAX_K)
-- },
-- CLASSIC,
-- { 3, 3, 3, 3, 3 },
-- { { 1, 0 }, { 3, 1 }, { 4, MAX_K } },
-- },
-- {
-- "JGT",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-- BPF_JUMP(BPF_JMP | BPF_JGT | BPF_X, 0, 0, 1),
-- BPF_STMT(BPF_RET | BPF_K, 1),
-- BPF_STMT(BPF_RET | BPF_K, MAX_K)
-- },
-- CLASSIC,
-- { 4, 4, 4, 3, 3 },
-- { { 2, 0 }, { 3, 1 }, { 4, MAX_K } },
-- },
-- {
-- "JGE",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_LD | BPF_B | BPF_IND, MAX_K),
-- BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 1, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 10),
-- BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 2, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 20),
-- BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 3, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 30),
-- BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 4, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 40),
-- BPF_STMT(BPF_RET | BPF_K, MAX_K)
-- },
-- CLASSIC,
-- { 1, 2, 3, 4, 5 },
-- { { 1, 20 }, { 3, 40 }, { 5, MAX_K } },
-- },
-- {
-- "JSET",
-- .u.insns = {
-- BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-- BPF_JUMP(BPF_JMP | BPF_JA, 1, 1, 1),
-- BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-- BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-- BPF_STMT(BPF_LDX | BPF_LEN, 0),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_SUB | BPF_K, 4),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_LD | BPF_W | BPF_IND, 0),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 1, 0, 1),
-- BPF_STMT(BPF_RET | BPF_K, 10),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x80000000, 0, 1),
-- BPF_STMT(BPF_RET | BPF_K, 20),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 30),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 30),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 30),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 30),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 30),
-- BPF_STMT(BPF_RET | BPF_K, MAX_K)
-- },
-- CLASSIC,
-- { 0, 0xAA, 0x55, 1 },
-- { { 4, 10 }, { 5, 20 }, { 6, MAX_K } },
-- },
-- {
-- "tcpdump port 22",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x86dd, 0, 8), /* IPv6 */
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 20),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x84, 2, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 1, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x11, 0, 17),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 54),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 14, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 56),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 12, 13),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x0800, 0, 12), /* IPv4 */
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 23),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x84, 2, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 1, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x11, 0, 8),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 20),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x1fff, 6, 0),
-- BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-- BPF_STMT(BPF_LD | BPF_H | BPF_IND, 14),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 2, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_IND, 16),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 0, 1),
-- BPF_STMT(BPF_RET | BPF_K, 0xffff),
-- BPF_STMT(BPF_RET | BPF_K, 0),
-- },
-- CLASSIC,
-- /* 3c:07:54:43:e5:76 > 10:bf:48:d6:43:d6, ethertype IPv4(0x0800)
-- * length 114: 10.1.1.149.49700 > 10.1.2.10.22: Flags [P.],
-- * seq 1305692979:1305693027, ack 3650467037, win 65535,
-- * options [nop,nop,TS val 2502645400 ecr 3971138], length 48
-- */
-- { 0x10, 0xbf, 0x48, 0xd6, 0x43, 0xd6,
-- 0x3c, 0x07, 0x54, 0x43, 0xe5, 0x76,
-- 0x08, 0x00,
-- 0x45, 0x10, 0x00, 0x64, 0x75, 0xb5,
-- 0x40, 0x00, 0x40, 0x06, 0xad, 0x2e, /* IP header */
-- 0x0a, 0x01, 0x01, 0x95, /* ip src */
-- 0x0a, 0x01, 0x02, 0x0a, /* ip dst */
-- 0xc2, 0x24,
-- 0x00, 0x16 /* dst port */ },
-- { { 10, 0 }, { 30, 0 }, { 100, 65535 } },
-- },
-- {
-- "tcpdump complex",
-- .u.insns = {
-- /* tcpdump -nei eth0 'tcp port 22 and (((ip[2:2] -
-- * ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) and
-- * (len > 115 or len < 30000000000)' -d
-- */
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x86dd, 30, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x800, 0, 29),
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 23),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 0, 27),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 20),
-- BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x1fff, 25, 0),
-- BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-- BPF_STMT(BPF_LD | BPF_H | BPF_IND, 14),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 2, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_IND, 16),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 0, 20),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 16),
-- BPF_STMT(BPF_ST, 1),
-- BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 14),
-- BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf),
-- BPF_STMT(BPF_ALU | BPF_LSH | BPF_K, 2),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0x5), /* libpcap emits K on TAX */
-- BPF_STMT(BPF_LD | BPF_MEM, 1),
-- BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-- BPF_STMT(BPF_ST, 5),
-- BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-- BPF_STMT(BPF_LD | BPF_B | BPF_IND, 26),
-- BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf0),
-- BPF_STMT(BPF_ALU | BPF_RSH | BPF_K, 2),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0x9), /* libpcap emits K on TAX */
-- BPF_STMT(BPF_LD | BPF_MEM, 5),
-- BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0, 4, 0),
-- BPF_STMT(BPF_LD | BPF_LEN, 0),
-- BPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, 0x73, 1, 0),
-- BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 0xfc23ac00, 1, 0),
-- BPF_STMT(BPF_RET | BPF_K, 0xffff),
-- BPF_STMT(BPF_RET | BPF_K, 0),
-- },
-- CLASSIC,
-- { 0x10, 0xbf, 0x48, 0xd6, 0x43, 0xd6,
-- 0x3c, 0x07, 0x54, 0x43, 0xe5, 0x76,
-- 0x08, 0x00,
-- 0x45, 0x10, 0x00, 0x64, 0x75, 0xb5,
-- 0x40, 0x00, 0x40, 0x06, 0xad, 0x2e, /* IP header */
-- 0x0a, 0x01, 0x01, 0x95, /* ip src */
-- 0x0a, 0x01, 0x02, 0x0a, /* ip dst */
-- 0xc2, 0x24,
-- 0x00, 0x16 /* dst port */ },
-- { { 10, 0 }, { 30, 0 }, { 100, 65535 } },
-- },
-- {
-- "RET_A",
-- .u.insns = {
-- /* check that unitialized X and A contain zeros */
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0)
-- },
-- CLASSIC,
-- { },
-- { {1, 0}, {2, 0} },
-- },
-- {
-- "INT: ADD trivial",
-- .u.insns_int = {
-- BPF_ALU64_IMM(BPF_MOV, R1, 1),
-- BPF_ALU64_IMM(BPF_ADD, R1, 2),
-- BPF_ALU64_IMM(BPF_MOV, R2, 3),
-- BPF_ALU64_REG(BPF_SUB, R1, R2),
-- BPF_ALU64_IMM(BPF_ADD, R1, -1),
-- BPF_ALU64_IMM(BPF_MUL, R1, 3),
-- BPF_ALU64_REG(BPF_MOV, R0, R1),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 0xfffffffd } }
-- },
-- {
-- "INT: MUL_X",
-- .u.insns_int = {
-- BPF_ALU64_IMM(BPF_MOV, R0, -1),
-- BPF_ALU64_IMM(BPF_MOV, R1, -1),
-- BPF_ALU64_IMM(BPF_MOV, R2, 3),
-- BPF_ALU64_REG(BPF_MUL, R1, R2),
-- BPF_JMP_IMM(BPF_JEQ, R1, 0xfffffffd, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_IMM(BPF_MOV, R0, 1),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 1 } }
-- },
-- {
-- "INT: MUL_X2",
-- .u.insns_int = {
-- BPF_ALU32_IMM(BPF_MOV, R0, -1),
-- BPF_ALU32_IMM(BPF_MOV, R1, -1),
-- BPF_ALU32_IMM(BPF_MOV, R2, 3),
-- BPF_ALU64_REG(BPF_MUL, R1, R2),
-- BPF_ALU64_IMM(BPF_RSH, R1, 8),
-- BPF_JMP_IMM(BPF_JEQ, R1, 0x2ffffff, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_IMM(BPF_MOV, R0, 1),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 1 } }
-- },
-- {
-- "INT: MUL32_X",
-- .u.insns_int = {
-- BPF_ALU32_IMM(BPF_MOV, R0, -1),
-- BPF_ALU64_IMM(BPF_MOV, R1, -1),
-- BPF_ALU32_IMM(BPF_MOV, R2, 3),
-- BPF_ALU32_REG(BPF_MUL, R1, R2),
-- BPF_ALU64_IMM(BPF_RSH, R1, 8),
-- BPF_JMP_IMM(BPF_JEQ, R1, 0xffffff, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_IMM(BPF_MOV, R0, 1),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 1 } }
-- },
-- {
-- /* Have to test all register combinations, since
-- * JITing of different registers will produce
-- * different asm code.
-- */
-- "INT: ADD 64-bit",
-- .u.insns_int = {
-- BPF_ALU64_IMM(BPF_MOV, R0, 0),
-- BPF_ALU64_IMM(BPF_MOV, R1, 1),
-- BPF_ALU64_IMM(BPF_MOV, R2, 2),
-- BPF_ALU64_IMM(BPF_MOV, R3, 3),
-- BPF_ALU64_IMM(BPF_MOV, R4, 4),
-- BPF_ALU64_IMM(BPF_MOV, R5, 5),
-- BPF_ALU64_IMM(BPF_MOV, R6, 6),
-- BPF_ALU64_IMM(BPF_MOV, R7, 7),
-- BPF_ALU64_IMM(BPF_MOV, R8, 8),
-- BPF_ALU64_IMM(BPF_MOV, R9, 9),
-- BPF_ALU64_IMM(BPF_ADD, R0, 20),
-- BPF_ALU64_IMM(BPF_ADD, R1, 20),
-- BPF_ALU64_IMM(BPF_ADD, R2, 20),
-- BPF_ALU64_IMM(BPF_ADD, R3, 20),
-- BPF_ALU64_IMM(BPF_ADD, R4, 20),
-- BPF_ALU64_IMM(BPF_ADD, R5, 20),
-- BPF_ALU64_IMM(BPF_ADD, R6, 20),
-- BPF_ALU64_IMM(BPF_ADD, R7, 20),
-- BPF_ALU64_IMM(BPF_ADD, R8, 20),
-- BPF_ALU64_IMM(BPF_ADD, R9, 20),
-- BPF_ALU64_IMM(BPF_SUB, R0, 10),
-- BPF_ALU64_IMM(BPF_SUB, R1, 10),
-- BPF_ALU64_IMM(BPF_SUB, R2, 10),
-- BPF_ALU64_IMM(BPF_SUB, R3, 10),
-- BPF_ALU64_IMM(BPF_SUB, R4, 10),
-- BPF_ALU64_IMM(BPF_SUB, R5, 10),
-- BPF_ALU64_IMM(BPF_SUB, R6, 10),
-- BPF_ALU64_IMM(BPF_SUB, R7, 10),
-- BPF_ALU64_IMM(BPF_SUB, R8, 10),
-- BPF_ALU64_IMM(BPF_SUB, R9, 10),
-- BPF_ALU64_REG(BPF_ADD, R0, R0),
-- BPF_ALU64_REG(BPF_ADD, R0, R1),
-- BPF_ALU64_REG(BPF_ADD, R0, R2),
-- BPF_ALU64_REG(BPF_ADD, R0, R3),
-- BPF_ALU64_REG(BPF_ADD, R0, R4),
-- BPF_ALU64_REG(BPF_ADD, R0, R5),
-- BPF_ALU64_REG(BPF_ADD, R0, R6),
-- BPF_ALU64_REG(BPF_ADD, R0, R7),
-- BPF_ALU64_REG(BPF_ADD, R0, R8),
-- BPF_ALU64_REG(BPF_ADD, R0, R9), /* R0 == 155 */
-- BPF_JMP_IMM(BPF_JEQ, R0, 155, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R1, R0),
-- BPF_ALU64_REG(BPF_ADD, R1, R1),
-- BPF_ALU64_REG(BPF_ADD, R1, R2),
-- BPF_ALU64_REG(BPF_ADD, R1, R3),
-- BPF_ALU64_REG(BPF_ADD, R1, R4),
-- BPF_ALU64_REG(BPF_ADD, R1, R5),
-- BPF_ALU64_REG(BPF_ADD, R1, R6),
-- BPF_ALU64_REG(BPF_ADD, R1, R7),
-- BPF_ALU64_REG(BPF_ADD, R1, R8),
-- BPF_ALU64_REG(BPF_ADD, R1, R9), /* R1 == 456 */
-- BPF_JMP_IMM(BPF_JEQ, R1, 456, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R2, R0),
-- BPF_ALU64_REG(BPF_ADD, R2, R1),
-- BPF_ALU64_REG(BPF_ADD, R2, R2),
-- BPF_ALU64_REG(BPF_ADD, R2, R3),
-- BPF_ALU64_REG(BPF_ADD, R2, R4),
-- BPF_ALU64_REG(BPF_ADD, R2, R5),
-- BPF_ALU64_REG(BPF_ADD, R2, R6),
-- BPF_ALU64_REG(BPF_ADD, R2, R7),
-- BPF_ALU64_REG(BPF_ADD, R2, R8),
-- BPF_ALU64_REG(BPF_ADD, R2, R9), /* R2 == 1358 */
-- BPF_JMP_IMM(BPF_JEQ, R2, 1358, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R3, R0),
-- BPF_ALU64_REG(BPF_ADD, R3, R1),
-- BPF_ALU64_REG(BPF_ADD, R3, R2),
-- BPF_ALU64_REG(BPF_ADD, R3, R3),
-- BPF_ALU64_REG(BPF_ADD, R3, R4),
-- BPF_ALU64_REG(BPF_ADD, R3, R5),
-- BPF_ALU64_REG(BPF_ADD, R3, R6),
-- BPF_ALU64_REG(BPF_ADD, R3, R7),
-- BPF_ALU64_REG(BPF_ADD, R3, R8),
-- BPF_ALU64_REG(BPF_ADD, R3, R9), /* R3 == 4063 */
-- BPF_JMP_IMM(BPF_JEQ, R3, 4063, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R4, R0),
-- BPF_ALU64_REG(BPF_ADD, R4, R1),
-- BPF_ALU64_REG(BPF_ADD, R4, R2),
-- BPF_ALU64_REG(BPF_ADD, R4, R3),
-- BPF_ALU64_REG(BPF_ADD, R4, R4),
-- BPF_ALU64_REG(BPF_ADD, R4, R5),
-- BPF_ALU64_REG(BPF_ADD, R4, R6),
-- BPF_ALU64_REG(BPF_ADD, R4, R7),
-- BPF_ALU64_REG(BPF_ADD, R4, R8),
-- BPF_ALU64_REG(BPF_ADD, R4, R9), /* R4 == 12177 */
-- BPF_JMP_IMM(BPF_JEQ, R4, 12177, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R5, R0),
-- BPF_ALU64_REG(BPF_ADD, R5, R1),
-- BPF_ALU64_REG(BPF_ADD, R5, R2),
-- BPF_ALU64_REG(BPF_ADD, R5, R3),
-- BPF_ALU64_REG(BPF_ADD, R5, R4),
-- BPF_ALU64_REG(BPF_ADD, R5, R5),
-- BPF_ALU64_REG(BPF_ADD, R5, R6),
-- BPF_ALU64_REG(BPF_ADD, R5, R7),
-- BPF_ALU64_REG(BPF_ADD, R5, R8),
-- BPF_ALU64_REG(BPF_ADD, R5, R9), /* R5 == 36518 */
-- BPF_JMP_IMM(BPF_JEQ, R5, 36518, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R6, R0),
-- BPF_ALU64_REG(BPF_ADD, R6, R1),
-- BPF_ALU64_REG(BPF_ADD, R6, R2),
-- BPF_ALU64_REG(BPF_ADD, R6, R3),
-- BPF_ALU64_REG(BPF_ADD, R6, R4),
-- BPF_ALU64_REG(BPF_ADD, R6, R5),
-- BPF_ALU64_REG(BPF_ADD, R6, R6),
-- BPF_ALU64_REG(BPF_ADD, R6, R7),
-- BPF_ALU64_REG(BPF_ADD, R6, R8),
-- BPF_ALU64_REG(BPF_ADD, R6, R9), /* R6 == 109540 */
-- BPF_JMP_IMM(BPF_JEQ, R6, 109540, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R7, R0),
-- BPF_ALU64_REG(BPF_ADD, R7, R1),
-- BPF_ALU64_REG(BPF_ADD, R7, R2),
-- BPF_ALU64_REG(BPF_ADD, R7, R3),
-- BPF_ALU64_REG(BPF_ADD, R7, R4),
-- BPF_ALU64_REG(BPF_ADD, R7, R5),
-- BPF_ALU64_REG(BPF_ADD, R7, R6),
-- BPF_ALU64_REG(BPF_ADD, R7, R7),
-- BPF_ALU64_REG(BPF_ADD, R7, R8),
-- BPF_ALU64_REG(BPF_ADD, R7, R9), /* R7 == 328605 */
-- BPF_JMP_IMM(BPF_JEQ, R7, 328605, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R8, R0),
-- BPF_ALU64_REG(BPF_ADD, R8, R1),
-- BPF_ALU64_REG(BPF_ADD, R8, R2),
-- BPF_ALU64_REG(BPF_ADD, R8, R3),
-- BPF_ALU64_REG(BPF_ADD, R8, R4),
-- BPF_ALU64_REG(BPF_ADD, R8, R5),
-- BPF_ALU64_REG(BPF_ADD, R8, R6),
-- BPF_ALU64_REG(BPF_ADD, R8, R7),
-- BPF_ALU64_REG(BPF_ADD, R8, R8),
-- BPF_ALU64_REG(BPF_ADD, R8, R9), /* R8 == 985799 */
-- BPF_JMP_IMM(BPF_JEQ, R8, 985799, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_ADD, R9, R0),
-- BPF_ALU64_REG(BPF_ADD, R9, R1),
-- BPF_ALU64_REG(BPF_ADD, R9, R2),
-- BPF_ALU64_REG(BPF_ADD, R9, R3),
-- BPF_ALU64_REG(BPF_ADD, R9, R4),
-- BPF_ALU64_REG(BPF_ADD, R9, R5),
-- BPF_ALU64_REG(BPF_ADD, R9, R6),
-- BPF_ALU64_REG(BPF_ADD, R9, R7),
-- BPF_ALU64_REG(BPF_ADD, R9, R8),
-- BPF_ALU64_REG(BPF_ADD, R9, R9), /* R9 == 2957380 */
-- BPF_ALU64_REG(BPF_MOV, R0, R9),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 2957380 } }
-- },
-- {
-- "INT: ADD 32-bit",
-- .u.insns_int = {
-- BPF_ALU32_IMM(BPF_MOV, R0, 20),
-- BPF_ALU32_IMM(BPF_MOV, R1, 1),
-- BPF_ALU32_IMM(BPF_MOV, R2, 2),
-- BPF_ALU32_IMM(BPF_MOV, R3, 3),
-- BPF_ALU32_IMM(BPF_MOV, R4, 4),
-- BPF_ALU32_IMM(BPF_MOV, R5, 5),
-- BPF_ALU32_IMM(BPF_MOV, R6, 6),
-- BPF_ALU32_IMM(BPF_MOV, R7, 7),
-- BPF_ALU32_IMM(BPF_MOV, R8, 8),
-- BPF_ALU32_IMM(BPF_MOV, R9, 9),
-- BPF_ALU64_IMM(BPF_ADD, R1, 10),
-- BPF_ALU64_IMM(BPF_ADD, R2, 10),
-- BPF_ALU64_IMM(BPF_ADD, R3, 10),
-- BPF_ALU64_IMM(BPF_ADD, R4, 10),
-- BPF_ALU64_IMM(BPF_ADD, R5, 10),
-- BPF_ALU64_IMM(BPF_ADD, R6, 10),
-- BPF_ALU64_IMM(BPF_ADD, R7, 10),
-- BPF_ALU64_IMM(BPF_ADD, R8, 10),
-- BPF_ALU64_IMM(BPF_ADD, R9, 10),
-- BPF_ALU32_REG(BPF_ADD, R0, R1),
-- BPF_ALU32_REG(BPF_ADD, R0, R2),
-- BPF_ALU32_REG(BPF_ADD, R0, R3),
-- BPF_ALU32_REG(BPF_ADD, R0, R4),
-- BPF_ALU32_REG(BPF_ADD, R0, R5),
-- BPF_ALU32_REG(BPF_ADD, R0, R6),
-- BPF_ALU32_REG(BPF_ADD, R0, R7),
-- BPF_ALU32_REG(BPF_ADD, R0, R8),
-- BPF_ALU32_REG(BPF_ADD, R0, R9), /* R0 == 155 */
-- BPF_JMP_IMM(BPF_JEQ, R0, 155, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R1, R0),
-- BPF_ALU32_REG(BPF_ADD, R1, R1),
-- BPF_ALU32_REG(BPF_ADD, R1, R2),
-- BPF_ALU32_REG(BPF_ADD, R1, R3),
-- BPF_ALU32_REG(BPF_ADD, R1, R4),
-- BPF_ALU32_REG(BPF_ADD, R1, R5),
-- BPF_ALU32_REG(BPF_ADD, R1, R6),
-- BPF_ALU32_REG(BPF_ADD, R1, R7),
-- BPF_ALU32_REG(BPF_ADD, R1, R8),
-- BPF_ALU32_REG(BPF_ADD, R1, R9), /* R1 == 456 */
-- BPF_JMP_IMM(BPF_JEQ, R1, 456, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R2, R0),
-- BPF_ALU32_REG(BPF_ADD, R2, R1),
-- BPF_ALU32_REG(BPF_ADD, R2, R2),
-- BPF_ALU32_REG(BPF_ADD, R2, R3),
-- BPF_ALU32_REG(BPF_ADD, R2, R4),
-- BPF_ALU32_REG(BPF_ADD, R2, R5),
-- BPF_ALU32_REG(BPF_ADD, R2, R6),
-- BPF_ALU32_REG(BPF_ADD, R2, R7),
-- BPF_ALU32_REG(BPF_ADD, R2, R8),
-- BPF_ALU32_REG(BPF_ADD, R2, R9), /* R2 == 1358 */
-- BPF_JMP_IMM(BPF_JEQ, R2, 1358, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R3, R0),
-- BPF_ALU32_REG(BPF_ADD, R3, R1),
-- BPF_ALU32_REG(BPF_ADD, R3, R2),
-- BPF_ALU32_REG(BPF_ADD, R3, R3),
-- BPF_ALU32_REG(BPF_ADD, R3, R4),
-- BPF_ALU32_REG(BPF_ADD, R3, R5),
-- BPF_ALU32_REG(BPF_ADD, R3, R6),
-- BPF_ALU32_REG(BPF_ADD, R3, R7),
-- BPF_ALU32_REG(BPF_ADD, R3, R8),
-- BPF_ALU32_REG(BPF_ADD, R3, R9), /* R3 == 4063 */
-- BPF_JMP_IMM(BPF_JEQ, R3, 4063, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R4, R0),
-- BPF_ALU32_REG(BPF_ADD, R4, R1),
-- BPF_ALU32_REG(BPF_ADD, R4, R2),
-- BPF_ALU32_REG(BPF_ADD, R4, R3),
-- BPF_ALU32_REG(BPF_ADD, R4, R4),
-- BPF_ALU32_REG(BPF_ADD, R4, R5),
-- BPF_ALU32_REG(BPF_ADD, R4, R6),
-- BPF_ALU32_REG(BPF_ADD, R4, R7),
-- BPF_ALU32_REG(BPF_ADD, R4, R8),
-- BPF_ALU32_REG(BPF_ADD, R4, R9), /* R4 == 12177 */
-- BPF_JMP_IMM(BPF_JEQ, R4, 12177, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R5, R0),
-- BPF_ALU32_REG(BPF_ADD, R5, R1),
-- BPF_ALU32_REG(BPF_ADD, R5, R2),
-- BPF_ALU32_REG(BPF_ADD, R5, R3),
-- BPF_ALU32_REG(BPF_ADD, R5, R4),
-- BPF_ALU32_REG(BPF_ADD, R5, R5),
-- BPF_ALU32_REG(BPF_ADD, R5, R6),
-- BPF_ALU32_REG(BPF_ADD, R5, R7),
-- BPF_ALU32_REG(BPF_ADD, R5, R8),
-- BPF_ALU32_REG(BPF_ADD, R5, R9), /* R5 == 36518 */
-- BPF_JMP_IMM(BPF_JEQ, R5, 36518, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R6, R0),
-- BPF_ALU32_REG(BPF_ADD, R6, R1),
-- BPF_ALU32_REG(BPF_ADD, R6, R2),
-- BPF_ALU32_REG(BPF_ADD, R6, R3),
-- BPF_ALU32_REG(BPF_ADD, R6, R4),
-- BPF_ALU32_REG(BPF_ADD, R6, R5),
-- BPF_ALU32_REG(BPF_ADD, R6, R6),
-- BPF_ALU32_REG(BPF_ADD, R6, R7),
-- BPF_ALU32_REG(BPF_ADD, R6, R8),
-- BPF_ALU32_REG(BPF_ADD, R6, R9), /* R6 == 109540 */
-- BPF_JMP_IMM(BPF_JEQ, R6, 109540, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R7, R0),
-- BPF_ALU32_REG(BPF_ADD, R7, R1),
-- BPF_ALU32_REG(BPF_ADD, R7, R2),
-- BPF_ALU32_REG(BPF_ADD, R7, R3),
-- BPF_ALU32_REG(BPF_ADD, R7, R4),
-- BPF_ALU32_REG(BPF_ADD, R7, R5),
-- BPF_ALU32_REG(BPF_ADD, R7, R6),
-- BPF_ALU32_REG(BPF_ADD, R7, R7),
-- BPF_ALU32_REG(BPF_ADD, R7, R8),
-- BPF_ALU32_REG(BPF_ADD, R7, R9), /* R7 == 328605 */
-- BPF_JMP_IMM(BPF_JEQ, R7, 328605, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R8, R0),
-- BPF_ALU32_REG(BPF_ADD, R8, R1),
-- BPF_ALU32_REG(BPF_ADD, R8, R2),
-- BPF_ALU32_REG(BPF_ADD, R8, R3),
-- BPF_ALU32_REG(BPF_ADD, R8, R4),
-- BPF_ALU32_REG(BPF_ADD, R8, R5),
-- BPF_ALU32_REG(BPF_ADD, R8, R6),
-- BPF_ALU32_REG(BPF_ADD, R8, R7),
-- BPF_ALU32_REG(BPF_ADD, R8, R8),
-- BPF_ALU32_REG(BPF_ADD, R8, R9), /* R8 == 985799 */
-- BPF_JMP_IMM(BPF_JEQ, R8, 985799, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU32_REG(BPF_ADD, R9, R0),
-- BPF_ALU32_REG(BPF_ADD, R9, R1),
-- BPF_ALU32_REG(BPF_ADD, R9, R2),
-- BPF_ALU32_REG(BPF_ADD, R9, R3),
-- BPF_ALU32_REG(BPF_ADD, R9, R4),
-- BPF_ALU32_REG(BPF_ADD, R9, R5),
-- BPF_ALU32_REG(BPF_ADD, R9, R6),
-- BPF_ALU32_REG(BPF_ADD, R9, R7),
-- BPF_ALU32_REG(BPF_ADD, R9, R8),
-- BPF_ALU32_REG(BPF_ADD, R9, R9), /* R9 == 2957380 */
-- BPF_ALU32_REG(BPF_MOV, R0, R9),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 2957380 } }
-- },
-- { /* Mainly checking JIT here. */
-- "INT: SUB",
-- .u.insns_int = {
-- BPF_ALU64_IMM(BPF_MOV, R0, 0),
-- BPF_ALU64_IMM(BPF_MOV, R1, 1),
-- BPF_ALU64_IMM(BPF_MOV, R2, 2),
-- BPF_ALU64_IMM(BPF_MOV, R3, 3),
-- BPF_ALU64_IMM(BPF_MOV, R4, 4),
-- BPF_ALU64_IMM(BPF_MOV, R5, 5),
-- BPF_ALU64_IMM(BPF_MOV, R6, 6),
-- BPF_ALU64_IMM(BPF_MOV, R7, 7),
-- BPF_ALU64_IMM(BPF_MOV, R8, 8),
-- BPF_ALU64_IMM(BPF_MOV, R9, 9),
-- BPF_ALU64_REG(BPF_SUB, R0, R0),
-- BPF_ALU64_REG(BPF_SUB, R0, R1),
-- BPF_ALU64_REG(BPF_SUB, R0, R2),
-- BPF_ALU64_REG(BPF_SUB, R0, R3),
-- BPF_ALU64_REG(BPF_SUB, R0, R4),
-- BPF_ALU64_REG(BPF_SUB, R0, R5),
-- BPF_ALU64_REG(BPF_SUB, R0, R6),
-- BPF_ALU64_REG(BPF_SUB, R0, R7),
-- BPF_ALU64_REG(BPF_SUB, R0, R8),
-- BPF_ALU64_REG(BPF_SUB, R0, R9),
-- BPF_ALU64_IMM(BPF_SUB, R0, 10),
-- BPF_JMP_IMM(BPF_JEQ, R0, -55, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R1, R0),
-- BPF_ALU64_REG(BPF_SUB, R1, R2),
-- BPF_ALU64_REG(BPF_SUB, R1, R3),
-- BPF_ALU64_REG(BPF_SUB, R1, R4),
-- BPF_ALU64_REG(BPF_SUB, R1, R5),
-- BPF_ALU64_REG(BPF_SUB, R1, R6),
-- BPF_ALU64_REG(BPF_SUB, R1, R7),
-- BPF_ALU64_REG(BPF_SUB, R1, R8),
-- BPF_ALU64_REG(BPF_SUB, R1, R9),
-- BPF_ALU64_IMM(BPF_SUB, R1, 10),
-- BPF_ALU64_REG(BPF_SUB, R2, R0),
-- BPF_ALU64_REG(BPF_SUB, R2, R1),
-- BPF_ALU64_REG(BPF_SUB, R2, R3),
-- BPF_ALU64_REG(BPF_SUB, R2, R4),
-- BPF_ALU64_REG(BPF_SUB, R2, R5),
-- BPF_ALU64_REG(BPF_SUB, R2, R6),
-- BPF_ALU64_REG(BPF_SUB, R2, R7),
-- BPF_ALU64_REG(BPF_SUB, R2, R8),
-- BPF_ALU64_REG(BPF_SUB, R2, R9),
-- BPF_ALU64_IMM(BPF_SUB, R2, 10),
-- BPF_ALU64_REG(BPF_SUB, R3, R0),
-- BPF_ALU64_REG(BPF_SUB, R3, R1),
-- BPF_ALU64_REG(BPF_SUB, R3, R2),
-- BPF_ALU64_REG(BPF_SUB, R3, R4),
-- BPF_ALU64_REG(BPF_SUB, R3, R5),
-- BPF_ALU64_REG(BPF_SUB, R3, R6),
-- BPF_ALU64_REG(BPF_SUB, R3, R7),
-- BPF_ALU64_REG(BPF_SUB, R3, R8),
-- BPF_ALU64_REG(BPF_SUB, R3, R9),
-- BPF_ALU64_IMM(BPF_SUB, R3, 10),
-- BPF_ALU64_REG(BPF_SUB, R4, R0),
-- BPF_ALU64_REG(BPF_SUB, R4, R1),
-- BPF_ALU64_REG(BPF_SUB, R4, R2),
-- BPF_ALU64_REG(BPF_SUB, R4, R3),
-- BPF_ALU64_REG(BPF_SUB, R4, R5),
-- BPF_ALU64_REG(BPF_SUB, R4, R6),
-- BPF_ALU64_REG(BPF_SUB, R4, R7),
-- BPF_ALU64_REG(BPF_SUB, R4, R8),
-- BPF_ALU64_REG(BPF_SUB, R4, R9),
-- BPF_ALU64_IMM(BPF_SUB, R4, 10),
-- BPF_ALU64_REG(BPF_SUB, R5, R0),
-- BPF_ALU64_REG(BPF_SUB, R5, R1),
-- BPF_ALU64_REG(BPF_SUB, R5, R2),
-- BPF_ALU64_REG(BPF_SUB, R5, R3),
-- BPF_ALU64_REG(BPF_SUB, R5, R4),
-- BPF_ALU64_REG(BPF_SUB, R5, R6),
-- BPF_ALU64_REG(BPF_SUB, R5, R7),
-- BPF_ALU64_REG(BPF_SUB, R5, R8),
-- BPF_ALU64_REG(BPF_SUB, R5, R9),
-- BPF_ALU64_IMM(BPF_SUB, R5, 10),
-- BPF_ALU64_REG(BPF_SUB, R6, R0),
-- BPF_ALU64_REG(BPF_SUB, R6, R1),
-- BPF_ALU64_REG(BPF_SUB, R6, R2),
-- BPF_ALU64_REG(BPF_SUB, R6, R3),
-- BPF_ALU64_REG(BPF_SUB, R6, R4),
-- BPF_ALU64_REG(BPF_SUB, R6, R5),
-- BPF_ALU64_REG(BPF_SUB, R6, R7),
-- BPF_ALU64_REG(BPF_SUB, R6, R8),
-- BPF_ALU64_REG(BPF_SUB, R6, R9),
-- BPF_ALU64_IMM(BPF_SUB, R6, 10),
-- BPF_ALU64_REG(BPF_SUB, R7, R0),
-- BPF_ALU64_REG(BPF_SUB, R7, R1),
-- BPF_ALU64_REG(BPF_SUB, R7, R2),
-- BPF_ALU64_REG(BPF_SUB, R7, R3),
-- BPF_ALU64_REG(BPF_SUB, R7, R4),
-- BPF_ALU64_REG(BPF_SUB, R7, R5),
-- BPF_ALU64_REG(BPF_SUB, R7, R6),
-- BPF_ALU64_REG(BPF_SUB, R7, R8),
-- BPF_ALU64_REG(BPF_SUB, R7, R9),
-- BPF_ALU64_IMM(BPF_SUB, R7, 10),
-- BPF_ALU64_REG(BPF_SUB, R8, R0),
-- BPF_ALU64_REG(BPF_SUB, R8, R1),
-- BPF_ALU64_REG(BPF_SUB, R8, R2),
-- BPF_ALU64_REG(BPF_SUB, R8, R3),
-- BPF_ALU64_REG(BPF_SUB, R8, R4),
-- BPF_ALU64_REG(BPF_SUB, R8, R5),
-- BPF_ALU64_REG(BPF_SUB, R8, R6),
-- BPF_ALU64_REG(BPF_SUB, R8, R7),
-- BPF_ALU64_REG(BPF_SUB, R8, R9),
-- BPF_ALU64_IMM(BPF_SUB, R8, 10),
-- BPF_ALU64_REG(BPF_SUB, R9, R0),
-- BPF_ALU64_REG(BPF_SUB, R9, R1),
-- BPF_ALU64_REG(BPF_SUB, R9, R2),
-- BPF_ALU64_REG(BPF_SUB, R9, R3),
-- BPF_ALU64_REG(BPF_SUB, R9, R4),
-- BPF_ALU64_REG(BPF_SUB, R9, R5),
-- BPF_ALU64_REG(BPF_SUB, R9, R6),
-- BPF_ALU64_REG(BPF_SUB, R9, R7),
-- BPF_ALU64_REG(BPF_SUB, R9, R8),
-- BPF_ALU64_IMM(BPF_SUB, R9, 10),
-- BPF_ALU64_IMM(BPF_SUB, R0, 10),
-- BPF_ALU64_IMM(BPF_NEG, R0, 0),
-- BPF_ALU64_REG(BPF_SUB, R0, R1),
-- BPF_ALU64_REG(BPF_SUB, R0, R2),
-- BPF_ALU64_REG(BPF_SUB, R0, R3),
-- BPF_ALU64_REG(BPF_SUB, R0, R4),
-- BPF_ALU64_REG(BPF_SUB, R0, R5),
-- BPF_ALU64_REG(BPF_SUB, R0, R6),
-- BPF_ALU64_REG(BPF_SUB, R0, R7),
-- BPF_ALU64_REG(BPF_SUB, R0, R8),
-- BPF_ALU64_REG(BPF_SUB, R0, R9),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 11 } }
-- },
-- { /* Mainly checking JIT here. */
-- "INT: XOR",
-- .u.insns_int = {
-- BPF_ALU64_REG(BPF_SUB, R0, R0),
-- BPF_ALU64_REG(BPF_XOR, R1, R1),
-- BPF_JMP_REG(BPF_JEQ, R0, R1, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_IMM(BPF_MOV, R0, 10),
-- BPF_ALU64_IMM(BPF_MOV, R1, -1),
-- BPF_ALU64_REG(BPF_SUB, R1, R1),
-- BPF_ALU64_REG(BPF_XOR, R2, R2),
-- BPF_JMP_REG(BPF_JEQ, R1, R2, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R2, R2),
-- BPF_ALU64_REG(BPF_XOR, R3, R3),
-- BPF_ALU64_IMM(BPF_MOV, R0, 10),
-- BPF_ALU64_IMM(BPF_MOV, R1, -1),
-- BPF_JMP_REG(BPF_JEQ, R2, R3, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R3, R3),
-- BPF_ALU64_REG(BPF_XOR, R4, R4),
-- BPF_ALU64_IMM(BPF_MOV, R2, 1),
-- BPF_ALU64_IMM(BPF_MOV, R5, -1),
-- BPF_JMP_REG(BPF_JEQ, R3, R4, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R4, R4),
-- BPF_ALU64_REG(BPF_XOR, R5, R5),
-- BPF_ALU64_IMM(BPF_MOV, R3, 1),
-- BPF_ALU64_IMM(BPF_MOV, R7, -1),
-- BPF_JMP_REG(BPF_JEQ, R5, R4, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_IMM(BPF_MOV, R5, 1),
-- BPF_ALU64_REG(BPF_SUB, R5, R5),
-- BPF_ALU64_REG(BPF_XOR, R6, R6),
-- BPF_ALU64_IMM(BPF_MOV, R1, 1),
-- BPF_ALU64_IMM(BPF_MOV, R8, -1),
-- BPF_JMP_REG(BPF_JEQ, R5, R6, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R6, R6),
-- BPF_ALU64_REG(BPF_XOR, R7, R7),
-- BPF_JMP_REG(BPF_JEQ, R7, R6, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R7, R7),
-- BPF_ALU64_REG(BPF_XOR, R8, R8),
-- BPF_JMP_REG(BPF_JEQ, R7, R8, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R8, R8),
-- BPF_ALU64_REG(BPF_XOR, R9, R9),
-- BPF_JMP_REG(BPF_JEQ, R9, R8, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R9, R9),
-- BPF_ALU64_REG(BPF_XOR, R0, R0),
-- BPF_JMP_REG(BPF_JEQ, R9, R0, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_SUB, R1, R1),
-- BPF_ALU64_REG(BPF_XOR, R0, R0),
-- BPF_JMP_REG(BPF_JEQ, R9, R0, 2),
-- BPF_ALU64_IMM(BPF_MOV, R0, 0),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_IMM(BPF_MOV, R0, 1),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 1 } }
-- },
-- { /* Mainly checking JIT here. */
-- "INT: MUL",
-- .u.insns_int = {
-- BPF_ALU64_IMM(BPF_MOV, R0, 11),
-- BPF_ALU64_IMM(BPF_MOV, R1, 1),
-- BPF_ALU64_IMM(BPF_MOV, R2, 2),
-- BPF_ALU64_IMM(BPF_MOV, R3, 3),
-- BPF_ALU64_IMM(BPF_MOV, R4, 4),
-- BPF_ALU64_IMM(BPF_MOV, R5, 5),
-- BPF_ALU64_IMM(BPF_MOV, R6, 6),
-- BPF_ALU64_IMM(BPF_MOV, R7, 7),
-- BPF_ALU64_IMM(BPF_MOV, R8, 8),
-- BPF_ALU64_IMM(BPF_MOV, R9, 9),
-- BPF_ALU64_REG(BPF_MUL, R0, R0),
-- BPF_ALU64_REG(BPF_MUL, R0, R1),
-- BPF_ALU64_REG(BPF_MUL, R0, R2),
-- BPF_ALU64_REG(BPF_MUL, R0, R3),
-- BPF_ALU64_REG(BPF_MUL, R0, R4),
-- BPF_ALU64_REG(BPF_MUL, R0, R5),
-- BPF_ALU64_REG(BPF_MUL, R0, R6),
-- BPF_ALU64_REG(BPF_MUL, R0, R7),
-- BPF_ALU64_REG(BPF_MUL, R0, R8),
-- BPF_ALU64_REG(BPF_MUL, R0, R9),
-- BPF_ALU64_IMM(BPF_MUL, R0, 10),
-- BPF_JMP_IMM(BPF_JEQ, R0, 439084800, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_MUL, R1, R0),
-- BPF_ALU64_REG(BPF_MUL, R1, R2),
-- BPF_ALU64_REG(BPF_MUL, R1, R3),
-- BPF_ALU64_REG(BPF_MUL, R1, R4),
-- BPF_ALU64_REG(BPF_MUL, R1, R5),
-- BPF_ALU64_REG(BPF_MUL, R1, R6),
-- BPF_ALU64_REG(BPF_MUL, R1, R7),
-- BPF_ALU64_REG(BPF_MUL, R1, R8),
-- BPF_ALU64_REG(BPF_MUL, R1, R9),
-- BPF_ALU64_IMM(BPF_MUL, R1, 10),
-- BPF_ALU64_REG(BPF_MOV, R2, R1),
-- BPF_ALU64_IMM(BPF_RSH, R2, 32),
-- BPF_JMP_IMM(BPF_JEQ, R2, 0x5a924, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_IMM(BPF_LSH, R1, 32),
-- BPF_ALU64_IMM(BPF_ARSH, R1, 32),
-- BPF_JMP_IMM(BPF_JEQ, R1, 0xebb90000, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_REG(BPF_MUL, R2, R0),
-- BPF_ALU64_REG(BPF_MUL, R2, R1),
-- BPF_ALU64_REG(BPF_MUL, R2, R3),
-- BPF_ALU64_REG(BPF_MUL, R2, R4),
-- BPF_ALU64_REG(BPF_MUL, R2, R5),
-- BPF_ALU64_REG(BPF_MUL, R2, R6),
-- BPF_ALU64_REG(BPF_MUL, R2, R7),
-- BPF_ALU64_REG(BPF_MUL, R2, R8),
-- BPF_ALU64_REG(BPF_MUL, R2, R9),
-- BPF_ALU64_IMM(BPF_MUL, R2, 10),
-- BPF_ALU64_IMM(BPF_RSH, R2, 32),
-- BPF_ALU64_REG(BPF_MOV, R0, R2),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, 0x35d97ef2 } }
-- },
-- {
-- "INT: ALU MIX",
-- .u.insns_int = {
-- BPF_ALU64_IMM(BPF_MOV, R0, 11),
-- BPF_ALU64_IMM(BPF_ADD, R0, -1),
-- BPF_ALU64_IMM(BPF_MOV, R2, 2),
-- BPF_ALU64_IMM(BPF_XOR, R2, 3),
-- BPF_ALU64_REG(BPF_DIV, R0, R2),
-- BPF_JMP_IMM(BPF_JEQ, R0, 10, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_IMM(BPF_MOD, R0, 3),
-- BPF_JMP_IMM(BPF_JEQ, R0, 1, 1),
-- BPF_EXIT_INSN(),
-- BPF_ALU64_IMM(BPF_MOV, R0, -1),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { },
-- { { 0, -1 } }
-- },
-- {
-- "INT: DIV + ABS",
-- .u.insns_int = {
-- BPF_ALU64_REG(BPF_MOV, R6, R1),
-- BPF_LD_ABS(BPF_B, 3),
-- BPF_ALU64_IMM(BPF_MOV, R2, 2),
-- BPF_ALU32_REG(BPF_DIV, R0, R2),
-- BPF_ALU64_REG(BPF_MOV, R8, R0),
-- BPF_LD_ABS(BPF_B, 4),
-- BPF_ALU64_REG(BPF_ADD, R8, R0),
-- BPF_LD_IND(BPF_B, R8, -70),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { 10, 20, 30, 40, 50 },
-- { { 4, 0 }, { 5, 10 } }
-- },
-- {
-- "INT: DIV by zero",
-- .u.insns_int = {
-- BPF_ALU64_REG(BPF_MOV, R6, R1),
-- BPF_ALU64_IMM(BPF_MOV, R7, 0),
-- BPF_LD_ABS(BPF_B, 3),
-- BPF_ALU32_REG(BPF_DIV, R0, R7),
-- BPF_EXIT_INSN(),
-- },
-- INTERNAL,
-- { 10, 20, 30, 40, 50 },
-- { { 3, 0 }, { 4, 0 } }
-- },
-- {
-- "check: missing ret",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_IMM, 1),
-- },
-- CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-- { },
-- { }
-- },
-- {
-- "check: div_k_0",
-- .u.insns = {
-- BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0),
-- BPF_STMT(BPF_RET | BPF_K, 0)
-- },
-- CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-- { },
-- { }
-- },
-- {
-- "check: unknown insn",
-- .u.insns = {
-- /* seccomp insn, rejected in socket filter */
-- BPF_STMT(BPF_LDX | BPF_W | BPF_ABS, 0),
-- BPF_STMT(BPF_RET | BPF_K, 0)
-- },
-- CLASSIC | FLAG_EXPECTED_FAIL,
-- { },
-- { }
-- },
-- {
-- "check: out of range spill/fill",
-- .u.insns = {
-- BPF_STMT(BPF_STX, 16),
-- BPF_STMT(BPF_RET | BPF_K, 0)
-- },
-- CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-- { },
-- { }
-- },
-- {
-- "JUMPS + HOLES",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 15),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90c2894d, 3, 4),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90c2894d, 1, 2),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_JUMP(BPF_JMP | BPF_JGE, 0, 14, 15),
-- BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 14),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ, 0x2ac28349, 2, 3),
-- BPF_JUMP(BPF_JMP | BPF_JEQ, 0x2ac28349, 1, 2),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_JUMP(BPF_JMP | BPF_JGE, 0, 14, 15),
-- BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 14),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90d2ff41, 2, 3),
-- BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90d2ff41, 1, 2),
-- BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0),
-- },
-- CLASSIC,
-- { 0x00, 0x1b, 0x21, 0x3c, 0x9d, 0xf8,
-- 0x90, 0xe2, 0xba, 0x0a, 0x56, 0xb4,
-- 0x08, 0x00,
-- 0x45, 0x00, 0x00, 0x28, 0x00, 0x00,
-- 0x20, 0x00, 0x40, 0x11, 0x00, 0x00, /* IP header */
-- 0xc0, 0xa8, 0x33, 0x01,
-- 0xc0, 0xa8, 0x33, 0x02,
-- 0xbb, 0xb6,
-- 0xa9, 0xfa,
-- 0x00, 0x14, 0x00, 0x00,
-- 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-- 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-- 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-- 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-- 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-- 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-- 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-- 0xcc, 0xcc, 0xcc, 0xcc },
-- { { 88, 0x001b } }
-- },
-- {
-- "check: RET X",
-- .u.insns = {
-- BPF_STMT(BPF_RET | BPF_X, 0),
-- },
-- CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-- { },
-- { },
-- },
-- {
-- "check: LDX + RET X",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_IMM, 42),
-- BPF_STMT(BPF_RET | BPF_X, 0),
-- },
-- CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-- { },
-- { },
-- },
-- { /* Mainly checking JIT here. */
-- "M[]: alt STX + LDX",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_IMM, 100),
-- BPF_STMT(BPF_STX, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 0),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 1),
-- BPF_STMT(BPF_LDX | BPF_MEM, 1),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 2),
-- BPF_STMT(BPF_LDX | BPF_MEM, 2),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 3),
-- BPF_STMT(BPF_LDX | BPF_MEM, 3),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 4),
-- BPF_STMT(BPF_LDX | BPF_MEM, 4),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 5),
-- BPF_STMT(BPF_LDX | BPF_MEM, 5),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 6),
-- BPF_STMT(BPF_LDX | BPF_MEM, 6),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 7),
-- BPF_STMT(BPF_LDX | BPF_MEM, 7),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 8),
-- BPF_STMT(BPF_LDX | BPF_MEM, 8),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 9),
-- BPF_STMT(BPF_LDX | BPF_MEM, 9),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 10),
-- BPF_STMT(BPF_LDX | BPF_MEM, 10),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 11),
-- BPF_STMT(BPF_LDX | BPF_MEM, 11),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 12),
-- BPF_STMT(BPF_LDX | BPF_MEM, 12),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 13),
-- BPF_STMT(BPF_LDX | BPF_MEM, 13),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 14),
-- BPF_STMT(BPF_LDX | BPF_MEM, 14),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_STX, 15),
-- BPF_STMT(BPF_LDX | BPF_MEM, 15),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-- BPF_STMT(BPF_MISC | BPF_TAX, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0),
-- },
-- CLASSIC | FLAG_NO_DATA,
-- { },
-- { { 0, 116 } },
-- },
-- { /* Mainly checking JIT here. */
-- "M[]: full STX + full LDX",
-- .u.insns = {
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xbadfeedb),
-- BPF_STMT(BPF_STX, 0),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xecabedae),
-- BPF_STMT(BPF_STX, 1),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xafccfeaf),
-- BPF_STMT(BPF_STX, 2),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xbffdcedc),
-- BPF_STMT(BPF_STX, 3),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xfbbbdccb),
-- BPF_STMT(BPF_STX, 4),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xfbabcbda),
-- BPF_STMT(BPF_STX, 5),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xaedecbdb),
-- BPF_STMT(BPF_STX, 6),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xadebbade),
-- BPF_STMT(BPF_STX, 7),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xfcfcfaec),
-- BPF_STMT(BPF_STX, 8),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xbcdddbdc),
-- BPF_STMT(BPF_STX, 9),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xfeefdfac),
-- BPF_STMT(BPF_STX, 10),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xcddcdeea),
-- BPF_STMT(BPF_STX, 11),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xaccfaebb),
-- BPF_STMT(BPF_STX, 12),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xbdcccdcf),
-- BPF_STMT(BPF_STX, 13),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xaaedecde),
-- BPF_STMT(BPF_STX, 14),
-- BPF_STMT(BPF_LDX | BPF_IMM, 0xfaeacdad),
-- BPF_STMT(BPF_STX, 15),
-- BPF_STMT(BPF_LDX | BPF_MEM, 0),
-- BPF_STMT(BPF_MISC | BPF_TXA, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 1),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 2),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 3),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 4),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 5),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 6),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 7),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 8),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 9),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 10),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 11),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 12),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 13),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 14),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_LDX | BPF_MEM, 15),
-- BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-- BPF_STMT(BPF_RET | BPF_A, 0),
-- },
-- CLASSIC | FLAG_NO_DATA,
-- { },
-- { { 0, 0x2a5a5e5 } },
-- },
-- {
-- "check: SKF_AD_MAX",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF + SKF_AD_MAX),
-- BPF_STMT(BPF_RET | BPF_A, 0),
-- },
-- CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-- { },
-- { },
-- },
-- { /* Passes checker but fails during runtime. */
-- "LD [SKF_AD_OFF-1]",
-- .u.insns = {
-- BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-- SKF_AD_OFF - 1),
-- BPF_STMT(BPF_RET | BPF_K, 1),
-- },
-- CLASSIC,
-- { },
-- { { 1, 0 } },
-- },
--};
--
--static struct net_device dev;
--
--static struct sk_buff *populate_skb(char *buf, int size)
--{
-- struct sk_buff *skb;
--
-- if (size >= MAX_DATA)
-- return NULL;
--
-- skb = alloc_skb(MAX_DATA, GFP_KERNEL);
-- if (!skb)
-- return NULL;
--
-- memcpy(__skb_put(skb, size), buf, size);
--
-- /* Initialize a fake skb with test pattern. */
-- skb_reset_mac_header(skb);
-- skb->protocol = htons(ETH_P_IP);
-- skb->pkt_type = SKB_TYPE;
-- skb->mark = SKB_MARK;
-- skb->hash = SKB_HASH;
-- skb->queue_mapping = SKB_QUEUE_MAP;
-- skb->vlan_tci = SKB_VLAN_TCI;
-- skb->dev = &dev;
-- skb->dev->ifindex = SKB_DEV_IFINDEX;
-- skb->dev->type = SKB_DEV_TYPE;
-- skb_set_network_header(skb, min(size, ETH_HLEN));
--
-- return skb;
--}
--
--static void *generate_test_data(struct bpf_test *test, int sub)
--{
-- if (test->aux & FLAG_NO_DATA)
-- return NULL;
--
-- /* Test case expects an skb, so populate one. Various
-- * subtests generate skbs of different sizes based on
-- * the same data.
-- */
-- return populate_skb(test->data, test->test[sub].data_size);
--}
--
--static void release_test_data(const struct bpf_test *test, void *data)
--{
-- if (test->aux & FLAG_NO_DATA)
-- return;
--
-- kfree_skb(data);
--}
--
--static int probe_filter_length(struct sock_filter *fp)
--{
-- int len = 0;
--
-- for (len = MAX_INSNS - 1; len > 0; --len)
-- if (fp[len].code != 0 || fp[len].k != 0)
-- break;
--
-- return len + 1;
--}
--
--static struct sk_filter *generate_filter(int which, int *err)
--{
-- struct sk_filter *fp;
-- struct sock_fprog_kern fprog;
-- unsigned int flen = probe_filter_length(tests[which].u.insns);
-- __u8 test_type = tests[which].aux & TEST_TYPE_MASK;
--
-- switch (test_type) {
-- case CLASSIC:
-- fprog.filter = tests[which].u.insns;
-- fprog.len = flen;
--
-- *err = sk_unattached_filter_create(&fp, &fprog);
-- if (tests[which].aux & FLAG_EXPECTED_FAIL) {
-- if (*err == -EINVAL) {
-- pr_cont("PASS\n");
-- /* Verifier rejected filter as expected. */
-- *err = 0;
-- return NULL;
-- } else {
-- pr_cont("UNEXPECTED_PASS\n");
-- /* Verifier didn't reject the test that's
-- * bad enough, just return!
-- */
-- *err = -EINVAL;
-- return NULL;
-- }
-- }
-- /* We don't expect to fail. */
-- if (*err) {
-- pr_cont("FAIL to attach err=%d len=%d\n",
-- *err, fprog.len);
-- return NULL;
-- }
-- break;
--
-- case INTERNAL:
-- fp = kzalloc(sk_filter_size(flen), GFP_KERNEL);
-- if (fp == NULL) {
-- pr_cont("UNEXPECTED_FAIL no memory left\n");
-- *err = -ENOMEM;
-- return NULL;
-- }
--
-- fp->len = flen;
-- memcpy(fp->insnsi, tests[which].u.insns_int,
-- fp->len * sizeof(struct sock_filter_int));
--
-- sk_filter_select_runtime(fp);
-- break;
-- }
--
-- *err = 0;
-- return fp;
--}
--
--static void release_filter(struct sk_filter *fp, int which)
--{
-- __u8 test_type = tests[which].aux & TEST_TYPE_MASK;
--
-- switch (test_type) {
-- case CLASSIC:
-- sk_unattached_filter_destroy(fp);
-- break;
-- case INTERNAL:
-- sk_filter_free(fp);
-- break;
-- }
--}
--
--static int __run_one(const struct sk_filter *fp, const void *data,
-- int runs, u64 *duration)
--{
-- u64 start, finish;
-- int ret, i;
--
-- start = ktime_to_us(ktime_get());
--
-- for (i = 0; i < runs; i++)
-- ret = SK_RUN_FILTER(fp, data);
--
-- finish = ktime_to_us(ktime_get());
--
-- *duration = (finish - start) * 1000ULL;
-- do_div(*duration, runs);
--
-- return ret;
--}
--
--static int run_one(const struct sk_filter *fp, struct bpf_test *test)
--{
-- int err_cnt = 0, i, runs = MAX_TESTRUNS;
--
-- for (i = 0; i < MAX_SUBTESTS; i++) {
-- void *data;
-- u64 duration;
-- u32 ret;
--
-- if (test->test[i].data_size == 0 &&
-- test->test[i].result == 0)
-- break;
--
-- data = generate_test_data(test, i);
-- ret = __run_one(fp, data, runs, &duration);
-- release_test_data(test, data);
--
-- if (ret == test->test[i].result) {
-- pr_cont("%lld ", duration);
-- } else {
-- pr_cont("ret %d != %d ", ret,
-- test->test[i].result);
-- err_cnt++;
-- }
-- }
--
-- return err_cnt;
--}
--
--static __init int test_bpf(void)
--{
-- int i, err_cnt = 0, pass_cnt = 0;
--
-- for (i = 0; i < ARRAY_SIZE(tests); i++) {
-- struct sk_filter *fp;
-- int err;
--
-- pr_info("#%d %s ", i, tests[i].descr);
--
-- fp = generate_filter(i, &err);
-- if (fp == NULL) {
-- if (err == 0) {
-- pass_cnt++;
-- continue;
-- }
--
-- return err;
-- }
-- err = run_one(fp, &tests[i]);
-- release_filter(fp, i);
--
-- if (err) {
-- pr_cont("FAIL (%d times)\n", err);
-- err_cnt++;
-- } else {
-- pr_cont("PASS\n");
-- pass_cnt++;
-- }
-- }
--
-- pr_info("Summary: %d PASSED, %d FAILED\n", pass_cnt, err_cnt);
-- return err_cnt ? -EINVAL : 0;
--}
--
--static int __init test_bpf_init(void)
--{
-- return test_bpf();
--}
--
--static void __exit test_bpf_exit(void)
--{
--}
--
--module_init(test_bpf_init);
--module_exit(test_bpf_exit);
--
--MODULE_LICENSE("GPL");
++++ b/lib/test_bpf.c
+@@ -1798,7 +1798,7 @@ static struct bpf_prog *generate_filter(int which, int *err)
+ break;
+
+ case INTERNAL:
+- fp = kzalloc(bpf_prog_size(flen), GFP_KERNEL);
++ fp = bpf_prog_alloc(bpf_prog_size(flen), 0);
+ if (fp == NULL) {
+ pr_cont("UNEXPECTED_FAIL no memory left\n");
+ *err = -ENOMEM;
diff --git a/lib/usercopy.c b/lib/usercopy.c
index 4f5b1dd..7cab418 100644
--- a/lib/usercopy.c
@@ -0,0 +1 @@
+-grsec
diff --git a/mm/Kconfig b/mm/Kconfig
-index 3e9977a..205074f 100644
+index 886db21..f514de2 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -333,10 +333,11 @@ config KSM
bdi_destroy(bdi);
return err;
diff --git a/mm/filemap.c b/mm/filemap.c
-index 900edfa..ff056b1 100644
+index 90effcd..539aa64 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
-@@ -2074,7 +2074,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
+@@ -2092,7 +2092,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
struct address_space *mapping = file->f_mapping;
if (!mapping->a_ops->readpage)
file_accessed(file);
vma->vm_ops = &generic_file_vm_ops;
return 0;
-@@ -2252,6 +2252,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
+@@ -2270,6 +2270,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
*pos = i_size_read(inode);
if (limit != RLIM_INFINITY) {
* Make sure the vma is shared, that it supports prefaulting,
* and that the remapped range is valid and fully within
diff --git a/mm/gup.c b/mm/gup.c
-index cc5a9e7..d496acf 100644
+index 91d044b..a58ecf6 100644
--- a/mm/gup.c
+++ b/mm/gup.c
-@@ -265,11 +265,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
+@@ -270,11 +270,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
unsigned int fault_flags = 0;
int ret;
if (*flags & FOLL_WRITE)
fault_flags |= FAULT_FLAG_WRITE;
if (nonblocking)
-@@ -424,14 +419,14 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
+@@ -436,14 +431,14 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
if (!(gup_flags & FOLL_FORCE))
gup_flags |= FOLL_NUMA;
if (!vma && in_gate_area(mm, start)) {
int ret;
ret = get_gate_page(mm, start & PAGE_MASK,
-@@ -443,7 +438,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
+@@ -455,7 +450,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
goto next_page;
}
return i ? : -EFAULT;
if (is_vm_hugetlb_page(vma)) {
i = follow_hugetlb_page(mm, vma, pages, vmas,
-@@ -498,7 +493,7 @@ next_page:
+@@ -510,7 +505,7 @@ next_page:
i += page_increm;
start += page_increm * PAGE_SIZE;
nr_pages -= page_increm;
}
EXPORT_SYMBOL(__get_user_pages);
diff --git a/mm/highmem.c b/mm/highmem.c
-index b32b70c..e512eb0 100644
+index 123bcd3..0de52ba 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
-@@ -138,8 +138,9 @@ static void flush_all_zero_pkmaps(void)
+@@ -195,8 +195,9 @@ static void flush_all_zero_pkmaps(void)
* So no dangers, even with speculative execution.
*/
page = pte_page(pkmap_page_table[i]);
set_page_address(page, NULL);
need_flush = 1;
}
-@@ -198,9 +199,11 @@ start:
+@@ -259,9 +260,11 @@ start:
}
}
vaddr = PKMAP_ADDR(last_pkmap_nr);
set_page_address(page, (void *)vaddr);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
-index 7a0a73d..d583cca 100644
+index eeceeeb..a209d58 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
-@@ -2250,6 +2250,7 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
+@@ -2258,6 +2258,7 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
+ struct ctl_table *table, int write,
+ void __user *buffer, size_t *length, loff_t *ppos)
+ {
++ ctl_table_no_const t;
struct hstate *h = &default_hstate;
- unsigned long tmp;
+ unsigned long tmp = h->max_huge_pages;
int ret;
-+ ctl_table_no_const hugetlb_table;
-
+@@ -2265,9 +2266,10 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
if (!hugepages_supported())
return -ENOTSUPP;
-@@ -2259,9 +2260,10 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
- if (write && hstate_is_gigantic(h) && !gigantic_page_supported())
- return -EINVAL;
- table->data = &tmp;
- table->maxlen = sizeof(unsigned long);
- ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
-+ hugetlb_table = *table;
-+ hugetlb_table.data = &tmp;
-+ hugetlb_table.maxlen = sizeof(unsigned long);
-+ ret = proc_doulongvec_minmax(&hugetlb_table, write, buffer, length, ppos);
++ t = *table;
++ t.data = &tmp;
++ t.maxlen = sizeof(unsigned long);
++ ret = proc_doulongvec_minmax(&t, write, buffer, length, ppos);
if (ret)
goto out;
-@@ -2306,6 +2308,7 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
+@@ -2302,6 +2304,7 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
struct hstate *h = &default_hstate;
unsigned long tmp;
int ret;
if (!hugepages_supported())
return -ENOTSUPP;
-@@ -2315,9 +2318,10 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
+@@ -2311,9 +2314,10 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
if (write && hstate_is_gigantic(h))
return -EINVAL;
if (ret)
goto out;
-@@ -2798,6 +2802,27 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
- return 1;
+@@ -2792,6 +2796,27 @@ static void unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
+ mutex_unlock(&mapping->i_mmap_mutex);
}
+#ifdef CONFIG_PAX_SEGMEXEC
/*
* Hugetlb_cow() should be called with page lock of the original hugepage held.
* Called with hugetlb_instantiation_mutex held and pte_page locked so we
-@@ -2915,6 +2940,11 @@ retry_avoidcopy:
+@@ -2903,6 +2928,11 @@ retry_avoidcopy:
make_huge_pte(vma, new_page, 1));
page_remove_rmap(old_page);
hugepage_add_new_anon_rmap(new_page, vma, address);
/* Make the old page be freed below */
new_page = old_page;
}
-@@ -3074,6 +3104,10 @@ retry:
+@@ -3063,6 +3093,10 @@ retry:
&& (vma->vm_flags & VM_SHARED)));
set_huge_pte_at(mm, address, ptep, new_pte);
if ((flags & FAULT_FLAG_WRITE) && !(vma->vm_flags & VM_SHARED)) {
/* Optimization, do the COW without a second fault */
ret = hugetlb_cow(mm, vma, address, ptep, new_pte, page, ptl);
-@@ -3140,6 +3174,10 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3129,6 +3163,10 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
struct hstate *h = hstate_vma(vma);
struct address_space *mapping;
address &= huge_page_mask(h);
ptep = huge_pte_offset(mm, address);
-@@ -3153,6 +3191,26 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3142,6 +3180,26 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
VM_FAULT_SET_HINDEX(hstate_index(h));
}
if (!ptep)
return VM_FAULT_OOM;
diff --git a/mm/internal.h b/mm/internal.h
-index 7f22a11f..f3c207f 100644
+index a1b651b..f688570 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -109,6 +109,7 @@ extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address);
extern void set_pageblock_order(void);
unsigned long reclaim_clean_pages_from_list(struct zone *zone,
diff --git a/mm/iov_iter.c b/mm/iov_iter.c
-index 7b5dbd1..af0e329 100644
+index 9a09f20..6ef0515 100644
--- a/mm/iov_iter.c
+++ b/mm/iov_iter.c
@@ -173,7 +173,7 @@ static size_t __iovec_copy_from_user_inatomic(char *vaddr,
set_fs(old_fs);
diff --git a/mm/madvise.c b/mm/madvise.c
-index a402f8f..f5e5daa 100644
+index 0938b30..199abe8 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -51,6 +51,10 @@ static long madvise_behavior(struct vm_area_struct *vma,
return 0;
}
-@@ -491,6 +522,16 @@ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
+@@ -488,6 +519,16 @@ SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
if (end < start)
return error;
if (end == start)
return error;
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
-index a013bc9..a897a14 100644
+index 44c6bd2..60369dc3 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -61,7 +61,7 @@ int sysctl_memory_failure_early_kill __read_mostly = 0;
unlock_page(hpage);
return 0;
}
-@@ -1186,14 +1186,14 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
+@@ -1196,14 +1196,14 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
*/
if (!PageHWPoison(p)) {
printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn);
unlock_page(hpage);
put_page(hpage);
return 0;
-@@ -1423,7 +1423,7 @@ int unpoison_memory(unsigned long pfn)
+@@ -1433,7 +1433,7 @@ int unpoison_memory(unsigned long pfn)
return 0;
}
if (TestClearPageHWPoison(p))
pr_info("MCE: Software-unpoisoned free page %#lx\n", pfn);
return 0;
}
-@@ -1437,7 +1437,7 @@ int unpoison_memory(unsigned long pfn)
+@@ -1447,7 +1447,7 @@ int unpoison_memory(unsigned long pfn)
*/
if (TestClearPageHWPoison(page)) {
pr_info("MCE: Software-unpoisoned page %#lx\n", pfn);
freeit = 1;
if (PageHuge(page))
clear_page_hwpoison_huge_page(page);
-@@ -1562,11 +1562,11 @@ static int soft_offline_huge_page(struct page *page, int flags)
+@@ -1572,11 +1572,11 @@ static int soft_offline_huge_page(struct page *page, int flags)
if (PageHuge(page)) {
set_page_hwpoison_huge_page(hpage);
dequeue_hwpoisoned_huge_page(hpage);
}
}
return ret;
-@@ -1605,7 +1605,7 @@ static int __soft_offline_page(struct page *page, int flags)
+@@ -1615,7 +1615,7 @@ static int __soft_offline_page(struct page *page, int flags)
put_page(page);
pr_info("soft_offline: %#lx: invalidated\n", pfn);
SetPageHWPoison(page);
return 0;
}
-@@ -1656,7 +1656,7 @@ static int __soft_offline_page(struct page *page, int flags)
+@@ -1666,7 +1666,7 @@ static int __soft_offline_page(struct page *page, int flags)
if (!is_free_buddy_page(page))
pr_info("soft offline: %#lx: page leaked\n",
pfn);
}
} else {
pr_info("soft offline: %#lx: isolation failed: %d, page count %d, type %lx\n",
-@@ -1726,11 +1726,11 @@ int soft_offline_page(struct page *page, int flags)
+@@ -1736,11 +1736,11 @@ int soft_offline_page(struct page *page, int flags)
if (PageHuge(page)) {
set_page_hwpoison_huge_page(hpage);
dequeue_hwpoisoned_huge_page(hpage);
}
unset_migratetype_isolate(page, MIGRATE_MOVABLE);
diff --git a/mm/memory.c b/mm/memory.c
-index 0a21f3d..babeaec 100644
+index e229970..68218aa 100644
--- a/mm/memory.c
+++ b/mm/memory.c
-@@ -413,6 +413,7 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
+@@ -415,6 +415,7 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
free_pte_range(tlb, pmd, addr);
} while (pmd++, addr = next, addr != end);
start &= PUD_MASK;
if (start < floor)
return;
-@@ -427,6 +428,8 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
+@@ -429,6 +430,8 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
pmd = pmd_offset(pud, start);
pud_clear(pud);
pmd_free_tlb(tlb, pmd, start);
}
static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
-@@ -446,6 +449,7 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
+@@ -448,6 +451,7 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
free_pmd_range(tlb, pud, addr, next, floor, ceiling);
} while (pud++, addr = next, addr != end);
start &= PGDIR_MASK;
if (start < floor)
return;
-@@ -460,6 +464,8 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
+@@ -462,6 +466,8 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
pud = pud_offset(pgd, start);
pgd_clear(pgd);
pud_free_tlb(tlb, pud, start);
}
/*
-@@ -1500,6 +1506,10 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
+@@ -691,10 +697,10 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,
+ * Choose text because data symbols depend on CONFIG_KALLSYMS_ALL=y
+ */
+ if (vma->vm_ops)
+- printk(KERN_ALERT "vma->vm_ops->fault: %pSR\n",
++ printk(KERN_ALERT "vma->vm_ops->fault: %pAR\n",
+ vma->vm_ops->fault);
+ if (vma->vm_file)
+- printk(KERN_ALERT "vma->vm_file->f_op->mmap: %pSR\n",
++ printk(KERN_ALERT "vma->vm_file->f_op->mmap: %pAR\n",
+ vma->vm_file->f_op->mmap);
+ dump_stack();
+ add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
+@@ -1147,6 +1153,7 @@ again:
+ print_bad_pte(vma, addr, ptent, page);
+ if (unlikely(!__tlb_remove_page(tlb, page))) {
+ force_flush = 1;
++ addr += PAGE_SIZE;
+ break;
+ }
+ continue;
+@@ -1500,6 +1507,10 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
page_add_file_rmap(page);
set_pte_at(mm, addr, pte, mk_pte(page, prot));
retval = 0;
pte_unmap_unlock(pte, ptl);
return retval;
-@@ -1544,9 +1554,21 @@ int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,
+@@ -1544,9 +1555,21 @@ int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,
if (!page_count(page))
return -EINVAL;
if (!(vma->vm_flags & VM_MIXEDMAP)) {
}
return insert_page(vma, addr, page, vma->vm_page_prot);
}
-@@ -1629,6 +1651,7 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
+@@ -1629,6 +1652,7 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
unsigned long pfn)
{
BUG_ON(!(vma->vm_flags & VM_MIXEDMAP));
if (addr < vma->vm_start || addr >= vma->vm_end)
return -EFAULT;
-@@ -1876,7 +1899,9 @@ static int apply_to_pmd_range(struct mm_struct *mm, pud_t *pud,
+@@ -1876,7 +1900,9 @@ static int apply_to_pmd_range(struct mm_struct *mm, pud_t *pud,
BUG_ON(pud_huge(*pud));
if (!pmd)
return -ENOMEM;
do {
-@@ -1896,7 +1921,9 @@ static int apply_to_pud_range(struct mm_struct *mm, pgd_t *pgd,
+@@ -1896,7 +1922,9 @@ static int apply_to_pud_range(struct mm_struct *mm, pgd_t *pgd,
unsigned long next;
int err;
if (!pud)
return -ENOMEM;
do {
-@@ -2018,6 +2045,186 @@ static int do_page_mkwrite(struct vm_area_struct *vma, struct page *page,
+@@ -2018,6 +2046,186 @@ static int do_page_mkwrite(struct vm_area_struct *vma, struct page *page,
return ret;
}
/*
* This routine handles present pages, when users try to write
* to a shared page. It is done by copying the page to a new address
-@@ -2215,6 +2422,12 @@ gotten:
+@@ -2216,6 +2424,12 @@ gotten:
*/
page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
if (likely(pte_same(*page_table, orig_pte))) {
if (old_page) {
if (!PageAnon(old_page)) {
dec_mm_counter_fast(mm, MM_FILEPAGES);
-@@ -2266,6 +2479,10 @@ gotten:
+@@ -2269,6 +2483,10 @@ gotten:
page_remove_rmap(old_page);
}
/* Free the old page.. */
new_page = old_page;
ret |= VM_FAULT_WRITE;
-@@ -2539,6 +2756,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2543,6 +2761,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
swap_free(entry);
if (vm_swap_full() || (vma->vm_flags & VM_LOCKED) || PageMlocked(page))
try_to_free_swap(page);
unlock_page(page);
if (page != swapcache) {
/*
-@@ -2562,6 +2784,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2566,6 +2789,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
/* No need to invalidate - it was non-present before */
update_mmu_cache(vma, address, page_table);
unlock:
pte_unmap_unlock(page_table, ptl);
out:
-@@ -2581,40 +2808,6 @@ out_release:
+@@ -2585,40 +2813,6 @@ out_release:
}
/*
* We enter with non-exclusive mmap_sem (to exclude vma changes,
* but allow concurrent faults), and pte mapped but not yet locked.
* We return with mmap_sem still held, but pte unmapped and unlocked.
-@@ -2623,27 +2816,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
- unsigned long address, pte_t *page_table, pmd_t *pmd,
+@@ -2628,27 +2822,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
unsigned int flags)
{
+ struct mem_cgroup *memcg;
- struct page *page;
+ struct page *page = NULL;
spinlock_t *ptl;
if (unlikely(anon_vma_prepare(vma)))
goto oom;
page = alloc_zeroed_user_highpage_movable(vma, address);
-@@ -2667,6 +2856,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2672,6 +2862,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
if (!pte_none(*page_table))
goto release;
+
inc_mm_counter_fast(mm, MM_ANONPAGES);
page_add_new_anon_rmap(page, vma, address);
- setpte:
-@@ -2674,6 +2868,12 @@ setpte:
+ mem_cgroup_commit_charge(page, memcg, false);
+@@ -2681,6 +2876,12 @@ setpte:
/* No need to invalidate - it was non-present before */
update_mmu_cache(vma, address, page_table);
unlock:
pte_unmap_unlock(page_table, ptl);
return 0;
-@@ -2905,6 +3105,11 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2911,6 +3112,11 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
return ret;
}
do_set_pte(vma, address, fault_page, pte, false, false);
unlock_page(fault_page);
unlock_out:
pte_unmap_unlock(pte, ptl);
-@@ -2946,7 +3151,18 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2953,7 +3159,18 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma,
page_cache_release(fault_page);
goto uncharge_out;
}
+ pax_mirror_anon_pte(vma, address, new_page, ptl);
+#endif
+
+ mem_cgroup_commit_charge(new_page, memcg, false);
+ lru_cache_add_active_or_unevictable(new_page, vma);
pte_unmap_unlock(pte, ptl);
- unlock_page(fault_page);
- page_cache_release(fault_page);
-@@ -2994,6 +3210,11 @@ static int do_shared_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3003,6 +3220,11 @@ static int do_shared_fault(struct mm_struct *mm, struct vm_area_struct *vma,
return ret;
}
do_set_pte(vma, address, fault_page, pte, true, false);
pte_unmap_unlock(pte, ptl);
if (set_page_dirty(fault_page))
-@@ -3224,6 +3445,12 @@ static int handle_pte_fault(struct mm_struct *mm,
+@@ -3244,6 +3466,12 @@ static int handle_pte_fault(struct mm_struct *mm,
if (flags & FAULT_FLAG_WRITE)
flush_tlb_fix_spurious_fault(vma, address);
}
unlock:
pte_unmap_unlock(pte, ptl);
return 0;
-@@ -3240,9 +3467,41 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3263,9 +3491,41 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
pmd_t *pmd;
pte_t *pte;
pgd = pgd_offset(mm, address);
pud = pud_alloc(mm, pgd, address);
if (!pud)
-@@ -3370,6 +3629,23 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
+@@ -3399,6 +3659,23 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
spin_unlock(&mm->page_table_lock);
return 0;
}
#endif /* __PAGETABLE_PUD_FOLDED */
#ifndef __PAGETABLE_PMD_FOLDED
-@@ -3400,6 +3676,30 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
+@@ -3429,6 +3706,30 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
spin_unlock(&mm->page_table_lock);
return 0;
}
+}
#endif /* __PAGETABLE_PMD_FOLDED */
- #if !defined(__HAVE_ARCH_GATE_AREA)
-@@ -3413,7 +3713,7 @@ static int __init gate_vma_init(void)
- gate_vma.vm_start = FIXADDR_USER_START;
- gate_vma.vm_end = FIXADDR_USER_END;
- gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
-- gate_vma.vm_page_prot = __P101;
-+ gate_vma.vm_page_prot = vm_get_page_prot(gate_vma.vm_flags);
-
- return 0;
- }
-@@ -3547,8 +3847,8 @@ out:
+ static int __follow_pte(struct mm_struct *mm, unsigned long address,
+@@ -3538,8 +3839,8 @@ out:
return ret;
}
{
resource_size_t phys_addr;
unsigned long prot = 0;
-@@ -3574,8 +3874,8 @@ EXPORT_SYMBOL_GPL(generic_access_phys);
+@@ -3565,8 +3866,8 @@ EXPORT_SYMBOL_GPL(generic_access_phys);
* Access another process' address space as given in mm. If non-NULL, use the
* given task for page fault accounting.
*/
{
struct vm_area_struct *vma;
void *old_buf = buf;
-@@ -3583,7 +3883,7 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
+@@ -3574,7 +3875,7 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
down_read(&mm->mmap_sem);
/* ignore errors, just check how much was successfully transferred */
while (len) {
void *maddr;
struct page *page = NULL;
-@@ -3642,8 +3942,8 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
+@@ -3635,8 +3936,8 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
*
* The caller must hold a reference on @mm.
*/
{
return __access_remote_vm(NULL, mm, addr, buf, len, write);
}
-@@ -3653,11 +3953,11 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr,
+@@ -3646,11 +3947,11 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr,
* Source/target buffer must be kernel space,
* Do not walk the page table directly, use get_user_pages
*/
capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
diff --git a/mm/migrate.c b/mm/migrate.c
-index be6dbf9..febb8ec 100644
+index 2740360..d20a37d 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
-@@ -1506,8 +1506,7 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
+@@ -1503,8 +1503,7 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
*/
tcred = __task_cred(task);
if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) &&
err = -EPERM;
goto out;
diff --git a/mm/mlock.c b/mm/mlock.c
-index b1eb536..091d154 100644
+index ce84cb0..6d5a9aa 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -14,6 +14,7 @@
#include <linux/sched.h>
#include <linux/export.h>
#include <linux/rmap.h>
-@@ -606,7 +607,7 @@ static int do_mlock(unsigned long start, size_t len, int on)
+@@ -613,7 +614,7 @@ static int do_mlock(unsigned long start, size_t len, int on)
{
unsigned long nstart, end, tmp;
struct vm_area_struct * vma, * prev;
VM_BUG_ON(start & ~PAGE_MASK);
VM_BUG_ON(len != PAGE_ALIGN(len));
-@@ -615,6 +616,9 @@ static int do_mlock(unsigned long start, size_t len, int on)
+@@ -622,6 +623,9 @@ static int do_mlock(unsigned long start, size_t len, int on)
return -EINVAL;
if (end == start)
return 0;
vma = find_vma(current->mm, start);
if (!vma || vma->vm_start > start)
return -ENOMEM;
-@@ -626,6 +630,11 @@ static int do_mlock(unsigned long start, size_t len, int on)
+@@ -633,6 +637,11 @@ static int do_mlock(unsigned long start, size_t len, int on)
for (nstart = start ; ; ) {
vm_flags_t newflags;
/* Here we know that vma->vm_start <= nstart < vma->vm_end. */
newflags = vma->vm_flags & ~VM_LOCKED;
-@@ -739,6 +748,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
+@@ -746,6 +755,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
locked += current->mm->locked_vm;
/* check against resource limits */
if ((locked <= lock_limit) || capable(CAP_IPC_LOCK))
error = do_mlock(start, len, 1);
-@@ -776,6 +786,11 @@ static int do_mlockall(int flags)
+@@ -783,6 +793,11 @@ static int do_mlockall(int flags)
for (vma = current->mm->mmap; vma ; vma = prev->vm_next) {
vm_flags_t newflags;
newflags = vma->vm_flags & ~VM_LOCKED;
if (flags & MCL_CURRENT)
newflags |= VM_LOCKED;
-@@ -807,8 +822,10 @@ SYSCALL_DEFINE1(mlockall, int, flags)
+@@ -814,8 +829,10 @@ SYSCALL_DEFINE1(mlockall, int, flags)
lock_limit >>= PAGE_SHIFT;
ret = -ENOMEM;
capable(CAP_IPC_LOCK))
ret = do_mlockall(flags);
diff --git a/mm/mmap.c b/mm/mmap.c
-index 129b847..fbed804 100644
+index c0a3637..c760814 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
-@@ -40,6 +40,7 @@
+@@ -41,6 +41,7 @@
#include <linux/notifier.h>
#include <linux/memory.h>
#include <linux/printk.h>
#include <asm/uaccess.h>
#include <asm/cacheflush.h>
-@@ -56,6 +57,16 @@
+@@ -57,6 +58,16 @@
#define arch_rebalance_pgtables(addr, len) (addr)
#endif
static void unmap_region(struct mm_struct *mm,
struct vm_area_struct *vma, struct vm_area_struct *prev,
unsigned long start, unsigned long end);
-@@ -75,16 +86,25 @@ static void unmap_region(struct mm_struct *mm,
+@@ -76,16 +87,25 @@ static void unmap_region(struct mm_struct *mm,
* x: (no) no x: (no) yes x: (no) yes x: (yes) yes
*
*/
}
EXPORT_SYMBOL(vm_get_page_prot);
-@@ -94,6 +114,7 @@ unsigned long sysctl_overcommit_kbytes __read_mostly;
+@@ -95,6 +115,7 @@ unsigned long sysctl_overcommit_kbytes __read_mostly;
int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
unsigned long sysctl_user_reserve_kbytes __read_mostly = 1UL << 17; /* 128MB */
unsigned long sysctl_admin_reserve_kbytes __read_mostly = 1UL << 13; /* 8MB */
/*
* Make sure vm_committed_as in one cacheline and not cacheline shared with
* other variables. It can be updated by several CPUs frequently.
-@@ -250,6 +271,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
+@@ -255,6 +276,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
struct vm_area_struct *next = vma->vm_next;
might_sleep();
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
-@@ -294,6 +316,12 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
+@@ -299,6 +321,12 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
* not page aligned -Ram Gupta
*/
rlim = rlimit(RLIMIT_DATA);
if (rlim < RLIM_INFINITY && (brk - mm->start_brk) +
(mm->end_data - mm->start_data) > rlim)
goto out;
-@@ -944,6 +972,12 @@ static int
+@@ -949,6 +977,12 @@ static int
can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags,
struct anon_vma *anon_vma, struct file *file, pgoff_t vm_pgoff)
{
if (is_mergeable_vma(vma, file, vm_flags) &&
is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) {
if (vma->vm_pgoff == vm_pgoff)
-@@ -963,6 +997,12 @@ static int
+@@ -968,6 +1002,12 @@ static int
can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
struct anon_vma *anon_vma, struct file *file, pgoff_t vm_pgoff)
{
if (is_mergeable_vma(vma, file, vm_flags) &&
is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) {
pgoff_t vm_pglen;
-@@ -1005,13 +1045,20 @@ can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
+@@ -1010,13 +1050,20 @@ can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
struct vm_area_struct *vma_merge(struct mm_struct *mm,
struct vm_area_struct *prev, unsigned long addr,
unsigned long end, unsigned long vm_flags,
/*
* We later require that vma->vm_flags == vm_flags,
* so this tests vma->vm_flags & VM_SPECIAL, too.
-@@ -1027,6 +1074,15 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
+@@ -1032,6 +1079,15 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
if (next && next->vm_end == end) /* cases 6, 7, 8 */
next = next->vm_next;
/*
* Can it merge with the predecessor?
*/
-@@ -1046,9 +1102,24 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
+@@ -1051,9 +1107,24 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
/* cases 1, 6 */
err = vma_adjust(prev, prev->vm_start,
next->vm_end, prev->vm_pgoff, NULL);
if (err)
return NULL;
khugepaged_enter_vma_merge(prev);
-@@ -1062,12 +1133,27 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
+@@ -1067,12 +1138,27 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
mpol_equal(policy, vma_policy(next)) &&
can_vma_merge_before(next, vm_flags,
anon_vma, file, pgoff+pglen)) {
if (err)
return NULL;
khugepaged_enter_vma_merge(area);
-@@ -1176,8 +1262,10 @@ none:
+@@ -1181,8 +1267,10 @@ none:
void vm_stat_account(struct mm_struct *mm, unsigned long flags,
struct file *file, long pages)
{
mm->total_vm += pages;
-@@ -1185,7 +1273,7 @@ void vm_stat_account(struct mm_struct *mm, unsigned long flags,
+@@ -1190,7 +1278,7 @@ void vm_stat_account(struct mm_struct *mm, unsigned long flags,
mm->shared_vm += pages;
if ((flags & (VM_EXEC|VM_WRITE)) == VM_EXEC)
mm->exec_vm += pages;
mm->stack_vm += pages;
}
#endif /* CONFIG_PROC_FS */
-@@ -1215,6 +1303,7 @@ static inline int mlock_future_check(struct mm_struct *mm,
+@@ -1220,6 +1308,7 @@ static inline int mlock_future_check(struct mm_struct *mm,
locked += mm->locked_vm;
lock_limit = rlimit(RLIMIT_MEMLOCK);
lock_limit >>= PAGE_SHIFT;
if (locked > lock_limit && !capable(CAP_IPC_LOCK))
return -EAGAIN;
}
-@@ -1241,7 +1330,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -1246,7 +1335,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
* (the exception is when the underlying filesystem is noexec
* mounted, in which case we dont add PROT_EXEC.)
*/
if (!(file && (file->f_path.mnt->mnt_flags & MNT_NOEXEC)))
prot |= PROT_EXEC;
-@@ -1267,7 +1356,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -1272,7 +1361,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
/* Obtain the address to map to. we verify (or select) it and ensure
* that it represents a valid section of the address space.
*/
if (addr & ~PAGE_MASK)
return addr;
-@@ -1278,6 +1367,43 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -1283,6 +1372,43 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) |
mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
if (flags & MAP_LOCKED)
if (!can_do_mlock())
return -EPERM;
-@@ -1365,6 +1491,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -1370,6 +1496,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
vm_flags |= VM_NORESERVE;
}
addr = mmap_region(file, addr, len, vm_flags, pgoff);
if (!IS_ERR_VALUE(addr) &&
((vm_flags & VM_LOCKED) ||
-@@ -1458,7 +1587,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
+@@ -1463,7 +1592,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
vm_flags_t vm_flags = vma->vm_flags;
/* If it was private or non-writable, the write bit is already clear */
return 0;
/* The backer wishes to know when pages are first written to? */
-@@ -1504,7 +1633,22 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
+@@ -1509,7 +1638,22 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
struct rb_node **rb_link, *rb_parent;
unsigned long charged = 0;
if (!may_expand_vm(mm, len >> PAGE_SHIFT)) {
unsigned long nr_pages;
-@@ -1523,11 +1667,10 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
+@@ -1528,11 +1672,10 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
/* Clear old maps */
error = -ENOMEM;
}
/*
-@@ -1558,6 +1701,16 @@ munmap_back:
+@@ -1563,6 +1706,16 @@ munmap_back:
goto unacct_error;
}
vma->vm_mm = mm;
vma->vm_start = addr;
vma->vm_end = addr + len;
-@@ -1577,6 +1730,13 @@ munmap_back:
+@@ -1593,6 +1746,13 @@ munmap_back:
if (error)
goto unmap_and_free_vma;
/* Can addr have changed??
*
* Answer: Yes, several device drivers can do it in their
-@@ -1610,6 +1770,12 @@ munmap_back:
+@@ -1626,6 +1786,12 @@ munmap_back:
}
vma_link(mm, vma, prev, rb_link, rb_parent);
+#endif
+
/* Once vma denies write, undo our temporary denial count */
- if (vm_flags & VM_DENYWRITE)
- allow_write_access(file);
-@@ -1618,6 +1784,7 @@ out:
+ if (file) {
+ if (vm_flags & VM_SHARED)
+@@ -1638,6 +1804,7 @@ out:
perf_event_mmap(vma);
vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
if (vm_flags & VM_LOCKED) {
if (!((vm_flags & VM_SPECIAL) || is_vm_hugetlb_page(vma) ||
vma == get_gate_vma(current->mm)))
-@@ -1650,6 +1817,12 @@ unmap_and_free_vma:
- unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
- charged = 0;
+@@ -1673,6 +1840,12 @@ allow_write_and_free_vma:
+ if (vm_flags & VM_DENYWRITE)
+ allow_write_access(file);
free_vma:
+
+#ifdef CONFIG_PAX_SEGMEXEC
kmem_cache_free(vm_area_cachep, vma);
unacct_error:
if (charged)
-@@ -1657,7 +1830,63 @@ unacct_error:
+@@ -1680,7 +1853,63 @@ unacct_error:
return error;
}
{
/*
* We implement the search by looking for an rbtree node that
-@@ -1705,11 +1934,29 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
+@@ -1728,11 +1957,29 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
}
}
if (gap_end >= low_limit && gap_end - gap_start >= length)
goto found;
-@@ -1759,7 +2006,7 @@ found:
+@@ -1782,7 +2029,7 @@ found:
return gap_start;
}
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
-@@ -1813,6 +2060,24 @@ check_current:
+@@ -1836,6 +2083,24 @@ check_current:
gap_end = vma->vm_start;
if (gap_end < low_limit)
return -ENOMEM;
if (gap_start <= high_limit && gap_end - gap_start >= length)
goto found;
-@@ -1876,6 +2141,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -1899,6 +2164,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct vm_unmapped_area_info info;
if (len > TASK_SIZE - mmap_min_addr)
return -ENOMEM;
-@@ -1883,11 +2149,15 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -1906,11 +2172,15 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
if (flags & MAP_FIXED)
return addr;
return addr;
}
-@@ -1896,6 +2166,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -1919,6 +2189,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
info.low_limit = mm->mmap_base;
info.high_limit = TASK_SIZE;
info.align_mask = 0;
return vm_unmapped_area(&info);
}
#endif
-@@ -1914,6 +2185,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1937,6 +2208,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
struct mm_struct *mm = current->mm;
unsigned long addr = addr0;
struct vm_unmapped_area_info info;
/* requested length too big for entire address space */
if (len > TASK_SIZE - mmap_min_addr)
-@@ -1922,12 +2194,16 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1945,12 +2217,16 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
if (flags & MAP_FIXED)
return addr;
return addr;
}
-@@ -1936,6 +2212,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1959,6 +2235,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
info.low_limit = max(PAGE_SIZE, mmap_min_addr);
info.high_limit = mm->mmap_base;
info.align_mask = 0;
addr = vm_unmapped_area(&info);
/*
-@@ -1948,6 +2225,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -1971,6 +2248,12 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
VM_BUG_ON(addr != -ENOMEM);
info.flags = 0;
info.low_limit = TASK_UNMAPPED_BASE;
info.high_limit = TASK_SIZE;
addr = vm_unmapped_area(&info);
}
-@@ -2048,6 +2331,28 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
+@@ -2071,6 +2354,28 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
return vma;
}
/*
* Verify that the stack growth is acceptable and
* update accounting. This is shared with both the
-@@ -2064,6 +2369,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
+@@ -2087,6 +2392,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
return -ENOMEM;
/* Stack limit test */
if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))
return -ENOMEM;
-@@ -2074,6 +2380,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
+@@ -2097,6 +2403,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
locked = mm->locked_vm + grow;
limit = ACCESS_ONCE(rlim[RLIMIT_MEMLOCK].rlim_cur);
limit >>= PAGE_SHIFT;
if (locked > limit && !capable(CAP_IPC_LOCK))
return -ENOMEM;
}
-@@ -2103,37 +2410,48 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
+@@ -2126,37 +2433,48 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
* PA-RISC uses this for its stack; IA64 for its Register Backing Store.
* vma is the last one with address > vma->vm_end. Have to extend vma.
*/
unsigned long size, grow;
size = address - vma->vm_start;
-@@ -2168,6 +2486,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
+@@ -2191,6 +2509,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
}
}
}
vma_unlock_anon_vma(vma);
khugepaged_enter_vma_merge(vma);
validate_mm(vma->vm_mm);
-@@ -2182,6 +2502,8 @@ int expand_downwards(struct vm_area_struct *vma,
+@@ -2205,6 +2525,8 @@ int expand_downwards(struct vm_area_struct *vma,
unsigned long address)
{
int error;
/*
* We must make sure the anon_vma is allocated
-@@ -2195,6 +2517,15 @@ int expand_downwards(struct vm_area_struct *vma,
+@@ -2218,6 +2540,15 @@ int expand_downwards(struct vm_area_struct *vma,
if (error)
return error;
vma_lock_anon_vma(vma);
/*
-@@ -2204,9 +2535,17 @@ int expand_downwards(struct vm_area_struct *vma,
+@@ -2227,9 +2558,17 @@ int expand_downwards(struct vm_area_struct *vma,
*/
/* Somebody else might have raced and expanded it already */
size = vma->vm_end - address;
grow = (vma->vm_start - address) >> PAGE_SHIFT;
-@@ -2231,13 +2570,27 @@ int expand_downwards(struct vm_area_struct *vma,
+@@ -2254,13 +2593,27 @@ int expand_downwards(struct vm_area_struct *vma,
vma->vm_pgoff -= grow;
anon_vma_interval_tree_post_update_vma(vma);
vma_gap_update(vma);
khugepaged_enter_vma_merge(vma);
validate_mm(vma->vm_mm);
return error;
-@@ -2335,6 +2688,13 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma)
+@@ -2358,6 +2711,13 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma)
do {
long nrpages = vma_pages(vma);
if (vma->vm_flags & VM_ACCOUNT)
nr_accounted += nrpages;
vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
-@@ -2379,6 +2739,16 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2402,6 +2762,16 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
insertion_point = (prev ? &prev->vm_next : &mm->mmap);
vma->vm_prev = NULL;
do {
vma_rb_erase(vma, &mm->mm_rb);
mm->map_count--;
tail_vma = vma;
-@@ -2406,14 +2776,33 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -2429,14 +2799,33 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
struct vm_area_struct *new;
int err = -ENOMEM;
/* most fields are the same, copy all, and then fixup */
*new = *vma;
-@@ -2426,6 +2815,22 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -2449,6 +2838,22 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
new->vm_pgoff += ((addr - vma->vm_start) >> PAGE_SHIFT);
}
err = vma_dup_policy(vma, new);
if (err)
goto out_free_vma;
-@@ -2445,6 +2850,38 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -2468,6 +2873,38 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
else
err = vma_adjust(vma, vma->vm_start, addr, vma->vm_pgoff, new);
/* Success. */
if (!err)
return 0;
-@@ -2454,10 +2891,18 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -2477,10 +2914,18 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
new->vm_ops->close(new);
if (new->vm_file)
fput(new->vm_file);
kmem_cache_free(vm_area_cachep, new);
out_err:
return err;
-@@ -2470,6 +2915,15 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
+@@ -2493,6 +2938,15 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
unsigned long addr, int new_below)
{
if (mm->map_count >= sysctl_max_map_count)
return -ENOMEM;
-@@ -2481,11 +2935,30 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2504,11 +2958,30 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
* work. This now handles partial unmappings.
* Jeremy Fitzhardinge <jeremy@goop.org>
*/
if ((start & ~PAGE_MASK) || start > TASK_SIZE || len > TASK_SIZE-start)
return -EINVAL;
-@@ -2560,6 +3033,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
+@@ -2583,6 +3056,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
/* Fix up all other VM information */
remove_vma_list(mm, vma);
return 0;
}
-@@ -2568,6 +3043,13 @@ int vm_munmap(unsigned long start, size_t len)
+@@ -2591,6 +3066,13 @@ int vm_munmap(unsigned long start, size_t len)
int ret;
struct mm_struct *mm = current->mm;
down_write(&mm->mmap_sem);
ret = do_munmap(mm, start, len);
up_write(&mm->mmap_sem);
-@@ -2581,16 +3063,6 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
+@@ -2604,16 +3086,6 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
return vm_munmap(addr, len);
}
/*
* this is really a simplified "do_mmap". it only handles
* anonymous maps. eventually we may be able to do some
-@@ -2604,6 +3076,7 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2627,6 +3099,7 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
struct rb_node ** rb_link, * rb_parent;
pgoff_t pgoff = addr >> PAGE_SHIFT;
int error;
len = PAGE_ALIGN(len);
if (!len)
-@@ -2611,10 +3084,24 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2634,10 +3107,24 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
error = mlock_future_check(mm, mm->def_flags, len);
if (error)
return error;
-@@ -2628,21 +3115,20 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2651,21 +3138,20 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
/*
* Clear old maps. this also does some error checking for us
*/
return -ENOMEM;
/* Can we just expand an old private anonymous mapping? */
-@@ -2656,7 +3142,7 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2679,7 +3165,7 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
*/
vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
if (!vma) {
return -ENOMEM;
}
-@@ -2670,10 +3156,11 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
+@@ -2693,10 +3179,11 @@ static unsigned long do_brk(unsigned long addr, unsigned long len)
vma_link(mm, vma, prev, rb_link, rb_parent);
out:
perf_event_mmap(vma);
return addr;
}
-@@ -2735,6 +3222,7 @@ void exit_mmap(struct mm_struct *mm)
+@@ -2758,6 +3245,7 @@ void exit_mmap(struct mm_struct *mm)
while (vma) {
if (vma->vm_flags & VM_ACCOUNT)
nr_accounted += vma_pages(vma);
vma = remove_vma(vma);
}
vm_unacct_memory(nr_accounted);
-@@ -2752,6 +3240,13 @@ int insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
+@@ -2775,6 +3263,13 @@ int insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
struct vm_area_struct *prev;
struct rb_node **rb_link, *rb_parent;
/*
* The vm_pgoff of a purely anonymous vma should be irrelevant
* until its first write fault, when page's anon_vma and index
-@@ -2775,7 +3270,21 @@ int insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
+@@ -2798,7 +3293,21 @@ int insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
security_vm_enough_memory_mm(mm, vma_pages(vma)))
return -ENOMEM;
return 0;
}
-@@ -2794,6 +3303,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+@@ -2817,6 +3326,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
struct rb_node **rb_link, *rb_parent;
bool faulted_in_anon_vma = true;
/*
* If anonymous vma has not yet been faulted, update new pgoff
* to match new location, to increase its chance of merging.
-@@ -2858,6 +3369,39 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+@@ -2881,6 +3392,39 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
return NULL;
}
/*
* Return true if the calling process may expand its vm space by the passed
* number of pages
-@@ -2869,6 +3413,7 @@ int may_expand_vm(struct mm_struct *mm, unsigned long npages)
+@@ -2892,6 +3436,7 @@ int may_expand_vm(struct mm_struct *mm, unsigned long npages)
lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT;
if (cur + npages > lim)
return 0;
return 1;
-@@ -2951,6 +3496,22 @@ static struct vm_area_struct *__install_special_mapping(
+@@ -2974,6 +3519,22 @@ static struct vm_area_struct *__install_special_mapping(
vma->vm_start = addr;
vma->vm_end = addr + len;
out:
if (ret & ~PAGE_MASK)
diff --git a/mm/nommu.c b/mm/nommu.c
-index 4a852f6..4371a6b 100644
+index a881d96..e5932cd 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -70,7 +70,6 @@ int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
*region = *vma->vm_region;
new->vm_region = region;
-@@ -2007,8 +1998,8 @@ int generic_file_remap_pages(struct vm_area_struct *vma, unsigned long addr,
+@@ -2002,8 +1993,8 @@ int generic_file_remap_pages(struct vm_area_struct *vma, unsigned long addr,
}
EXPORT_SYMBOL(generic_file_remap_pages);
{
struct vm_area_struct *vma;
-@@ -2049,8 +2040,8 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
+@@ -2044,8 +2035,8 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
*
* The caller must hold a reference on @mm.
*/
{
return __access_remote_vm(NULL, mm, addr, buf, len, write);
}
-@@ -2059,7 +2050,7 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr,
+@@ -2054,7 +2045,7 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr,
* Access another process' address space.
* - source/target buffer must be kernel space
*/
struct mm_struct *mm;
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
-index e0c9430..3c6bf79 100644
+index 91d73ef..0e564d2 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
-@@ -667,7 +667,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
+@@ -664,7 +664,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
* card's bdi_dirty may rush to many times higher than bdi_setpoint.
* - the bdi dirty thresh drops quickly due to change of JBOD workload
*/
unsigned long bg_thresh,
unsigned long dirty,
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index ef44ad7..1056bc7 100644
+index eee9619..155d328 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -61,6 +61,7 @@
{
__free_pages_ok(page, compound_order(page));
}
-@@ -745,6 +746,10 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
+@@ -751,6 +752,10 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
int i;
int bad = 0;
trace_mm_page_free(page, order);
kmemcheck_free_shadow(page, order);
-@@ -761,6 +766,12 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
+@@ -767,6 +772,12 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
debug_check_no_obj_freed(page_address(page),
PAGE_SIZE << order);
}
arch_free_page(page, order);
kernel_map_pages(page, 1 << order, 0);
-@@ -784,6 +795,20 @@ static void __free_pages_ok(struct page *page, unsigned int order)
+@@ -790,6 +801,20 @@ static void __free_pages_ok(struct page *page, unsigned int order)
local_irq_restore(flags);
}
void __init __free_pages_bootmem(struct page *page, unsigned int order)
{
unsigned int nr_pages = 1 << order;
-@@ -799,6 +824,19 @@ void __init __free_pages_bootmem(struct page *page, unsigned int order)
+@@ -805,6 +830,19 @@ void __init __free_pages_bootmem(struct page *page, unsigned int order)
__ClearPageReserved(p);
set_page_count(p, 0);
page_zone(page)->managed_pages += nr_pages;
set_page_refcounted(page);
__free_pages(page, order);
-@@ -927,8 +965,10 @@ static int prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags)
+@@ -933,8 +971,10 @@ static int prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags)
arch_alloc_page(page, order);
kernel_map_pages(page, 1 << order, 1);
if (order && (gfp_flags & __GFP_COMP))
prep_compound_page(page, order);
-@@ -2427,7 +2467,7 @@ static void reset_alloc_batches(struct zonelist *zonelist,
- continue;
+@@ -1612,7 +1652,7 @@ again:
+ }
+
+ __mod_zone_page_state(zone, NR_ALLOC_BATCH, -(1 << order));
+- if (atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]) <= 0 &&
++ if (atomic_long_read_unchecked(&zone->vm_stat[NR_ALLOC_BATCH]) <= 0 &&
+ !zone_is_fair_depleted(zone))
+ zone_set_flag(zone, ZONE_FAIR_DEPLETED);
+
+@@ -1933,7 +1973,7 @@ static void reset_alloc_batches(struct zone *preferred_zone)
+ do {
mod_zone_page_state(zone, NR_ALLOC_BATCH,
high_wmark_pages(zone) - low_wmark_pages(zone) -
- atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]));
+ atomic_long_read_unchecked(&zone->vm_stat[NR_ALLOC_BATCH]));
- }
+ zone_clear_flag(zone, ZONE_FAIR_DEPLETED);
+ } while (zone++ != preferred_zone);
}
+@@ -5702,7 +5742,7 @@ static void __setup_per_zone_wmarks(void)
+
+ __mod_zone_page_state(zone, NR_ALLOC_BATCH,
+ high_wmark_pages(zone) - low_wmark_pages(zone) -
+- atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]));
++ atomic_long_read_unchecked(&zone->vm_stat[NR_ALLOC_BATCH]));
+ setup_zone_migrate_reserve(zone);
+ spin_unlock_irqrestore(&zone->lock, flags);
diff --git a/mm/percpu.c b/mm/percpu.c
-index 2ddf9a9..f8fc075 100644
+index da997f9..19040e9 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -123,7 +123,7 @@ static unsigned int pcpu_low_unit_cpu __read_mostly;
EXPORT_SYMBOL_GPL(pcpu_base_addr);
static const int *pcpu_unit_map __read_mostly; /* cpu -> unit */
-diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
-index a8b9199..dfb79e0 100644
---- a/mm/pgtable-generic.c
-+++ b/mm/pgtable-generic.c
-@@ -195,7 +195,7 @@ void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
- pmd_t entry = *pmdp;
- if (pmd_numa(entry))
- entry = pmd_mknonnuma(entry);
-- set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(*pmdp));
-+ set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(entry));
- flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
- }
- #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c
index 5077afc..846c9ef 100644
--- a/mm/process_vm_access.c
if (!mm || IS_ERR(mm)) {
rc = IS_ERR(mm) ? PTR_ERR(mm) : -ESRCH;
diff --git a/mm/rmap.c b/mm/rmap.c
-index 22a4a76..9551288 100644
+index 3e8491c..02abccc 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -164,6 +164,10 @@ int anon_vma_prepare(struct vm_area_struct *vma)
/*
diff --git a/mm/shmem.c b/mm/shmem.c
-index af68b15..1227320 100644
+index 469f90d..34a09ee 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -33,7 +33,7 @@
#ifdef CONFIG_SHMEM
/*
-@@ -77,7 +77,7 @@ static struct vfsmount *shm_mnt;
+@@ -80,7 +80,7 @@ static struct vfsmount *shm_mnt;
#define BOGO_DIRENT_SIZE 20
/* Symlink up to this size is kmalloc'ed instead of using a swappable page */
/*
* shmem_fallocate communicates with shmem_fault or shmem_writepage via
-@@ -2219,6 +2219,11 @@ static const struct xattr_handler *shmem_xattr_handlers[] = {
+@@ -2524,6 +2524,11 @@ static const struct xattr_handler *shmem_xattr_handlers[] = {
static int shmem_xattr_validate(const char *name)
{
struct { const char *prefix; size_t len; } arr[] = {
{ XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN },
{ XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN }
};
-@@ -2274,6 +2279,15 @@ static int shmem_setxattr(struct dentry *dentry, const char *name,
+@@ -2579,6 +2584,15 @@ static int shmem_setxattr(struct dentry *dentry, const char *name,
if (err)
return err;
return simple_xattr_set(&info->xattrs, name, value, size, flags);
}
-@@ -2586,8 +2600,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
+@@ -2962,8 +2976,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
int err = -ENOMEM;
/* Round up to L1_CACHE_BYTES to resist false sharing */
return -ENOMEM;
diff --git a/mm/slab.c b/mm/slab.c
-index 3070b92..bcfff83 100644
+index 7c52b38..dc55dcb 100644
--- a/mm/slab.c
+++ b/mm/slab.c
-@@ -311,10 +311,12 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent)
+@@ -316,10 +316,12 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent)
if ((x)->max_freeable < i) \
(x)->max_freeable = i; \
} while (0)
#else
#define STATS_INC_ACTIVE(x) do { } while (0)
#define STATS_DEC_ACTIVE(x) do { } while (0)
-@@ -331,6 +333,8 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent)
+@@ -336,6 +338,8 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent)
#define STATS_INC_ALLOCMISS(x) do { } while (0)
#define STATS_INC_FREEHIT(x) do { } while (0)
#define STATS_INC_FREEMISS(x) do { } while (0)
#endif
#if DEBUG
-@@ -447,7 +451,7 @@ static inline void *index_to_obj(struct kmem_cache *cache, struct page *page,
+@@ -452,7 +456,7 @@ static inline void *index_to_obj(struct kmem_cache *cache, struct page *page,
* reciprocal_divide(offset, cache->reciprocal_buffer_size)
*/
static inline unsigned int obj_to_index(const struct kmem_cache *cache,
{
u32 offset = (obj - page->s_mem);
return reciprocal_divide(offset, cache->reciprocal_buffer_size);
-@@ -1558,12 +1562,12 @@ void __init kmem_cache_init(void)
+@@ -1462,12 +1466,12 @@ void __init kmem_cache_init(void)
*/
kmalloc_caches[INDEX_AC] = create_kmalloc_cache("kmalloc-ac",
slab_early_init = 0;
-@@ -3512,6 +3516,21 @@ static inline void __cache_free(struct kmem_cache *cachep, void *objp,
+@@ -3384,6 +3388,21 @@ static inline void __cache_free(struct kmem_cache *cachep, void *objp,
struct array_cache *ac = cpu_cache_get(cachep);
check_irq_off();
kmemleak_free_recursive(objp, cachep->flags);
objp = cache_free_debugcheck(cachep, objp, caller);
-@@ -3735,6 +3754,7 @@ void kfree(const void *objp)
+@@ -3607,6 +3626,7 @@ void kfree(const void *objp)
if (unlikely(ZERO_OR_NULL_PTR(objp)))
return;
local_irq_save(flags);
kfree_debugcheck(objp);
c = virt_to_cache(objp);
-@@ -4176,14 +4196,22 @@ void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *cachep)
+@@ -4056,14 +4076,22 @@ void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *cachep)
}
/* cpu stats */
{
#endif
}
-@@ -4404,13 +4432,69 @@ static const struct file_operations proc_slabstats_operations = {
+@@ -4281,13 +4309,69 @@ static const struct file_operations proc_slabstats_operations = {
static int __init slab_proc_init(void)
{
#ifdef CONFIG_DEBUG_SLAB_LEAK
* ksize - get the actual amount of memory allocated for a given object
* @objp: Pointer to the object
diff --git a/mm/slab.h b/mm/slab.h
-index 961a3fb..6b12514 100644
+index 0e0fdd3..c61c735 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -32,6 +32,15 @@ extern struct list_head slab_caches;
if (slab_equal_or_root(cachep, s))
return cachep;
diff --git a/mm/slab_common.c b/mm/slab_common.c
-index d31c4ba..1121296 100644
+index d319502..9eb3eb5 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
-@@ -23,11 +23,22 @@
+@@ -25,11 +25,22 @@
#include "slab.h"
#ifdef CONFIG_DEBUG_VM
static int kmem_cache_sanity_check(const char *name, size_t size)
{
-@@ -158,7 +169,7 @@ do_kmem_cache_create(char *name, size_t object_size, size_t size, size_t align,
+@@ -160,7 +171,7 @@ do_kmem_cache_create(char *name, size_t object_size, size_t size, size_t align,
if (err)
goto out_free_cache;
list_add(&s->list, &slab_caches);
out:
if (err)
-@@ -339,8 +350,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
+@@ -341,8 +352,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
mutex_lock(&slab_mutex);
goto out_unlock;
if (memcg_cleanup_cache_params(s) != 0)
-@@ -360,7 +370,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
+@@ -362,7 +372,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
rcu_barrier();
memcg_free_cache_params(s);
sysfs_slab_remove(s);
#else
slab_kmem_cache_release(s);
-@@ -416,7 +426,7 @@ void __init create_boot_cache(struct kmem_cache *s, const char *name, size_t siz
+@@ -418,7 +428,7 @@ void __init create_boot_cache(struct kmem_cache *s, const char *name, size_t siz
panic("Creation of kmalloc slab %s size=%zu failed. Reason %d\n",
name, size, err);
}
struct kmem_cache *__init create_kmalloc_cache(const char *name, size_t size,
-@@ -429,7 +439,7 @@ struct kmem_cache *__init create_kmalloc_cache(const char *name, size_t size,
+@@ -431,7 +441,7 @@ struct kmem_cache *__init create_kmalloc_cache(const char *name, size_t size,
create_boot_cache(s, name, size, flags);
list_add(&s->list, &slab_caches);
return s;
}
-@@ -441,6 +451,11 @@ struct kmem_cache *kmalloc_dma_caches[KMALLOC_SHIFT_HIGH + 1];
+@@ -443,6 +453,11 @@ struct kmem_cache *kmalloc_dma_caches[KMALLOC_SHIFT_HIGH + 1];
EXPORT_SYMBOL(kmalloc_dma_caches);
#endif
/*
* Conversion table for small slabs sizes / 8 to the index in the
* kmalloc array. This is necessary for slabs < 192 since we have non power
-@@ -505,6 +520,13 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
+@@ -507,6 +522,13 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
return kmalloc_dma_caches[index];
#endif
return kmalloc_caches[index];
}
-@@ -561,7 +583,7 @@ void __init create_kmalloc_caches(unsigned long flags)
+@@ -563,7 +585,7 @@ void __init create_kmalloc_caches(unsigned long flags)
for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) {
if (!kmalloc_caches[i]) {
kmalloc_caches[i] = create_kmalloc_cache(NULL,
}
/*
-@@ -570,10 +592,10 @@ void __init create_kmalloc_caches(unsigned long flags)
+@@ -572,10 +594,10 @@ void __init create_kmalloc_caches(unsigned long flags)
* earlier power of two caches
*/
if (KMALLOC_MIN_SIZE <= 32 && !kmalloc_caches[1] && i == 6)
}
/* Kmalloc array is now usable */
-@@ -606,6 +628,23 @@ void __init create_kmalloc_caches(unsigned long flags)
+@@ -608,6 +630,23 @@ void __init create_kmalloc_caches(unsigned long flags)
}
}
#endif
}
#endif /* !CONFIG_SLOB */
-@@ -664,6 +703,9 @@ void print_slabinfo_header(struct seq_file *m)
+@@ -666,6 +705,9 @@ void print_slabinfo_header(struct seq_file *m)
seq_puts(m, " : globalstat <listallocs> <maxobjs> <grown> <reaped> "
"<error> <maxfreeable> <nodeallocs> <remotefrees> <alienoverflow>");
seq_puts(m, " : cpustat <allochit> <allocmiss> <freehit> <freemiss>");
EXPORT_SYMBOL(kmem_cache_free);
diff --git a/mm/slub.c b/mm/slub.c
-index 7300480..cb92846 100644
+index 3e8afcc..68c99031 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -207,7 +207,7 @@ struct track {
static int sysfs_slab_add(struct kmem_cache *);
static int sysfs_slab_alias(struct kmem_cache *, const char *);
static void memcg_propagate_slab_attrs(struct kmem_cache *s);
-@@ -546,7 +546,7 @@ static void print_track(const char *s, struct track *t)
+@@ -545,7 +545,7 @@ static void print_track(const char *s, struct track *t)
if (!t->addr)
return;
s, (void *)t->addr, jiffies - t->when, t->cpu, t->pid);
#ifdef CONFIG_STACKTRACE
{
-@@ -2673,6 +2673,14 @@ static __always_inline void slab_free(struct kmem_cache *s,
+@@ -2643,6 +2643,14 @@ static __always_inline void slab_free(struct kmem_cache *s,
slab_free_hook(s, x);
redo:
/*
* Determine the currently cpus per cpu slab.
-@@ -2740,7 +2748,7 @@ static int slub_min_objects;
+@@ -2710,7 +2718,7 @@ static int slub_min_objects;
* Merge control. If this is set then no merging of slab caches will occur.
* (Could be removed. This was introduced to pacify the merge skeptics.)
*/
/*
* Calculate the order of allocation given an slab object size.
-@@ -3019,6 +3027,9 @@ static int calculate_sizes(struct kmem_cache *s, int forced_order)
+@@ -2986,6 +2994,9 @@ static int calculate_sizes(struct kmem_cache *s, int forced_order)
s->inuse = size;
if (((flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON)) ||
s->ctor)) {
/*
* Relocate free pointer after the object if it is not
-@@ -3347,6 +3358,59 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
+@@ -3313,6 +3324,59 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
EXPORT_SYMBOL(__kmalloc_node);
#endif
size_t ksize(const void *object)
{
struct page *page;
-@@ -3375,6 +3439,7 @@ void kfree(const void *x)
+@@ -3341,6 +3405,7 @@ void kfree(const void *x)
if (unlikely(ZERO_OR_NULL_PTR(x)))
return;
page = virt_to_head_page(x);
if (unlikely(!PageSlab(page))) {
BUG_ON(!PageCompound(page));
-@@ -3680,7 +3745,7 @@ static int slab_unmergeable(struct kmem_cache *s)
+@@ -3642,7 +3707,7 @@ static int slab_unmergeable(struct kmem_cache *s)
/*
* We may have set a slab to be unmergeable during bootstrap.
*/
return 1;
return 0;
-@@ -3737,7 +3802,7 @@ __kmem_cache_alias(const char *name, size_t size, size_t align,
+@@ -3699,7 +3764,7 @@ __kmem_cache_alias(const char *name, size_t size, size_t align,
int i;
struct kmem_cache *c;
/*
* Adjust the object sizes so that we clear
-@@ -3756,7 +3821,7 @@ __kmem_cache_alias(const char *name, size_t size, size_t align,
+@@ -3718,7 +3783,7 @@ __kmem_cache_alias(const char *name, size_t size, size_t align,
}
if (sysfs_slab_alias(s, name)) {
s = NULL;
}
}
-@@ -3873,7 +3938,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
+@@ -3835,7 +3900,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
}
#endif
static int count_inuse(struct page *page)
{
return page->inuse;
-@@ -4156,7 +4221,11 @@ static int list_locations(struct kmem_cache *s, char *buf,
+@@ -4116,7 +4181,11 @@ static int list_locations(struct kmem_cache *s, char *buf,
len += sprintf(buf + len, "%7ld ", l->count);
if (l->addr)
else
len += sprintf(buf + len, "<not-available>");
-@@ -4258,12 +4327,12 @@ static void resiliency_test(void)
+@@ -4218,12 +4287,12 @@ static void __init resiliency_test(void)
validate_slab_cache(kmalloc_caches[9]);
}
#else
enum slab_stat_type {
SL_ALL, /* All slabs */
SL_PARTIAL, /* Only partially allocated slabs */
-@@ -4503,13 +4572,17 @@ static ssize_t ctor_show(struct kmem_cache *s, char *buf)
+@@ -4460,13 +4529,17 @@ static ssize_t ctor_show(struct kmem_cache *s, char *buf)
{
if (!s->ctor)
return 0;
static ssize_t aliases_show(struct kmem_cache *s, char *buf)
{
-- return sprintf(buf, "%d\n", s->refcount - 1);
-+ return sprintf(buf, "%d\n", atomic_read(&s->refcount) - 1);
+- return sprintf(buf, "%d\n", s->refcount < 0 ? 0 : s->refcount - 1);
++ return sprintf(buf, "%d\n", atomic_read(&s->refcount) < 0 ? 0 : atomic_read(&s->refcount) - 1);
}
SLAB_ATTR_RO(aliases);
-@@ -4597,6 +4670,14 @@ static ssize_t cache_dma_show(struct kmem_cache *s, char *buf)
+@@ -4554,6 +4627,14 @@ static ssize_t cache_dma_show(struct kmem_cache *s, char *buf)
SLAB_ATTR_RO(cache_dma);
#endif
static ssize_t destroy_by_rcu_show(struct kmem_cache *s, char *buf)
{
return sprintf(buf, "%d\n", !!(s->flags & SLAB_DESTROY_BY_RCU));
-@@ -4931,6 +5012,9 @@ static struct attribute *slab_attrs[] = {
+@@ -4888,6 +4969,9 @@ static struct attribute *slab_attrs[] = {
#ifdef CONFIG_ZONE_DMA
&cache_dma_attr.attr,
#endif
#ifdef CONFIG_NUMA
&remote_node_defrag_ratio_attr.attr,
#endif
-@@ -5181,6 +5265,7 @@ static char *create_unique_id(struct kmem_cache *s)
+@@ -5132,6 +5216,7 @@ static char *create_unique_id(struct kmem_cache *s)
return name;
}
static int sysfs_slab_add(struct kmem_cache *s)
{
int err;
-@@ -5254,6 +5339,7 @@ void sysfs_slab_remove(struct kmem_cache *s)
+@@ -5205,6 +5290,7 @@ void sysfs_slab_remove(struct kmem_cache *s)
kobject_del(&s->kobj);
kobject_put(&s->kobj);
}
/*
* Need to buffer aliases during bootup until sysfs becomes
-@@ -5267,6 +5353,7 @@ struct saved_alias {
+@@ -5218,6 +5304,7 @@ struct saved_alias {
static struct saved_alias *alias_list;
static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
{
struct saved_alias *al;
-@@ -5289,6 +5376,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
+@@ -5240,6 +5327,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
alias_list = al;
return 0;
}
}
}
diff --git a/mm/swap.c b/mm/swap.c
-index 9e8e347..3c22e0f 100644
+index 6b2dc38..46b79ba 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -31,6 +31,7 @@
#include "internal.h"
-@@ -76,6 +77,8 @@ static void __put_compound_page(struct page *page)
+@@ -77,6 +78,8 @@ static void __put_compound_page(struct page *page)
__page_cache_release(page);
dtor = get_compound_page_dtor(page);
}
diff --git a/mm/swapfile.c b/mm/swapfile.c
-index 4c524f7..f7601f17 100644
+index 8798b2e..348f9dd 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -84,7 +84,7 @@ static DEFINE_MUTEX(swapon_mutex);
static inline unsigned char swap_count(unsigned char ent)
{
-@@ -1945,7 +1945,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
+@@ -1944,7 +1944,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
spin_unlock(&swap_lock);
err = 0;
wake_up_interruptible(&proc_poll_wait);
out_dput:
-@@ -1962,8 +1962,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait)
+@@ -1961,8 +1961,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait)
poll_wait(file, &proc_poll_wait, wait);
return POLLIN | POLLRDNORM | POLLERR | POLLPRI;
}
-@@ -2061,7 +2061,7 @@ static int swaps_open(struct inode *inode, struct file *file)
+@@ -2060,7 +2060,7 @@ static int swaps_open(struct inode *inode, struct file *file)
return ret;
seq = file->private_data;
return 0;
}
-@@ -2521,7 +2521,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
+@@ -2520,7 +2520,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
(frontswap_map) ? "FS" : "");
mutex_unlock(&swapon_mutex);
if (S_ISREG(inode->i_mode))
diff --git a/mm/util.c b/mm/util.c
-index 33e9f44..be026b2 100644
+index 093c973..b70a268 100644
--- a/mm/util.c
+++ b/mm/util.c
-@@ -296,6 +296,12 @@ done:
+@@ -202,6 +202,12 @@ done:
void arch_pick_mmap_layout(struct mm_struct *mm)
{
mm->mmap_base = TASK_UNMAPPED_BASE;
mm->get_unmapped_area = arch_get_unmapped_area;
}
#endif
-@@ -472,6 +478,9 @@ int get_cmdline(struct task_struct *task, char *buffer, int buflen)
+@@ -378,6 +384,9 @@ int get_cmdline(struct task_struct *task, char *buffer, int buflen)
if (!mm->arg_end)
goto out_mm; /* Shh! No looking before we're done */
if (len > buflen)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
-index f64632b..e8c52e7 100644
+index 2b0aa54..b451f74 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -40,6 +40,21 @@ struct vfree_deferred {
}
/* Import existing vmlist entries. */
-@@ -1318,6 +1397,16 @@ static struct vm_struct *__get_vm_area_node(unsigned long size,
+@@ -1314,6 +1393,16 @@ static struct vm_struct *__get_vm_area_node(unsigned long size,
struct vm_struct *area;
BUG_ON(in_interrupt());
if (flags & VM_IOREMAP)
align = 1ul << clamp(fls(size), PAGE_SHIFT, IOREMAP_MAX_ORDER);
-@@ -1523,6 +1612,23 @@ void vunmap(const void *addr)
+@@ -1519,6 +1608,23 @@ void vunmap(const void *addr)
}
EXPORT_SYMBOL(vunmap);
/**
* vmap - map an array of pages into virtually contiguous space
* @pages: array of page pointers
-@@ -1543,6 +1649,11 @@ void *vmap(struct page **pages, unsigned int count,
+@@ -1539,6 +1645,11 @@ void *vmap(struct page **pages, unsigned int count,
if (count > totalram_pages)
return NULL;
area = get_vm_area_caller((count << PAGE_SHIFT), flags,
__builtin_return_address(0));
if (!area)
-@@ -1643,6 +1754,13 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
+@@ -1641,6 +1752,13 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
if (!size || (size >> PAGE_SHIFT) > totalram_pages)
goto fail;
area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNINITIALIZED,
start, end, node, gfp_mask, caller);
if (!area)
-@@ -1819,10 +1937,9 @@ EXPORT_SYMBOL(vzalloc_node);
+@@ -1817,10 +1935,9 @@ EXPORT_SYMBOL(vzalloc_node);
* For tight control over page level allocator and protection flags
* use __vmalloc() instead.
*/
NUMA_NO_NODE, __builtin_return_address(0));
}
-@@ -2129,6 +2246,8 @@ int remap_vmalloc_range_partial(struct vm_area_struct *vma, unsigned long uaddr,
+@@ -2127,6 +2244,8 @@ int remap_vmalloc_range_partial(struct vm_area_struct *vma, unsigned long uaddr,
{
struct vm_struct *area;
size = PAGE_ALIGN(size);
if (!PAGE_ALIGNED(uaddr) || !PAGE_ALIGNED(kaddr))
-@@ -2611,7 +2730,11 @@ static int s_show(struct seq_file *m, void *p)
+@@ -2609,7 +2728,11 @@ static int s_show(struct seq_file *m, void *p)
v->addr, v->addr + v->size, v->size);
if (v->caller)
if (v->nr_pages)
seq_printf(m, " pages=%d", v->nr_pages);
diff --git a/mm/vmstat.c b/mm/vmstat.c
-index b37bd49..4d7b3da 100644
+index e9ab104..de275bd 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -20,6 +20,7 @@
}
}
#endif
-@@ -1162,10 +1163,22 @@ static void *vmstat_start(struct seq_file *m, loff_t *pos)
+@@ -1163,10 +1164,22 @@ static void *vmstat_start(struct seq_file *m, loff_t *pos)
stat_items_size += sizeof(struct vm_event_state);
#endif
for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
v[i] = global_page_state(i);
v += NR_VM_ZONE_STAT_ITEMS;
-@@ -1314,10 +1327,16 @@ static int __init setup_vmstat(void)
+@@ -1315,10 +1328,16 @@ static int __init setup_vmstat(void)
cpu_notifier_register_done();
#endif
#ifdef CONFIG_PROC_FS
return 0;
}
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
-index 44ebd5c..1f732bae 100644
+index 64c6bed..b79a5de 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
-@@ -475,7 +475,7 @@ out:
+@@ -481,7 +481,7 @@ out:
return NOTIFY_DONE;
}
.notifier_call = vlan_device_event,
};
-@@ -550,8 +550,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
+@@ -556,8 +556,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
err = -EPERM;
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
break;
vn = net_generic(net, vlan_net_id);
diff --git a/net/9p/client.c b/net/9p/client.c
-index 0004cba..feba240 100644
+index e86a9bea..e91f70e 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -596,7 +596,7 @@ static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
if (err) {
err = -EFAULT;
goto out_err;
-@@ -1571,7 +1571,7 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
+@@ -1570,7 +1570,7 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
kernel_buf = 1;
indata = data;
} else
/*
* response header len is 11
* PDU Header(7) + IO Size (4)
-@@ -1646,7 +1646,7 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
+@@ -1645,7 +1645,7 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
kernel_buf = 1;
odata = data;
} else
set_fs(oldfs);
if (ret <= 0 && ret != -ERESTARTSYS && ret != -EAGAIN)
-diff --git a/net/Kconfig b/net/Kconfig
-index d92afe4..ab63892 100644
---- a/net/Kconfig
-+++ b/net/Kconfig
-@@ -89,12 +89,8 @@ config NETWORK_SECMARK
- to nfmark, but designated for security purposes.
- If you are unsure how to answer this question, answer N.
-
--config NET_PTP_CLASSIFY
-- def_bool n
--
- config NETWORK_PHY_TIMESTAMPING
- bool "Timestamping in PHY devices"
-- select NET_PTP_CLASSIFY
- help
- This allows timestamping of network packets by PHYs with
- hardware timestamping capabilities. This option adds some
-@@ -269,7 +265,7 @@ config BQL
- config BPF_JIT
- bool "enable BPF Just In Time compiler"
- depends on HAVE_BPF_JIT
-- depends on MODULES
-+ depends on MODULES && X86
- ---help---
- Berkeley Packet Filter filtering capabilities are normally handled
- by an interpreter. This option allows kernel to generate a native
diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
index af46bc4..f9adfcd 100644
--- a/net/appletalk/atalk_proc.c
#undef __HANDLE_ITEM
}
diff --git a/net/atm/lec.c b/net/atm/lec.c
-index 4c5b8ba..95f7005 100644
+index 4b98f89..5a2f6cb 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
table = kmemdup(ax25_param_table, sizeof(ax25_param_table), GFP_KERNEL);
if (!table)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
-index f04224c..f326579 100644
+index 1e80539..676c37a 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
-@@ -312,7 +312,7 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
+@@ -313,7 +313,7 @@ static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
/* randomize initial seqno to avoid collision */
get_random_bytes(&random_seqno, sizeof(random_seqno));
hard_iface->bat_iv.ogm_buff_len = BATADV_OGM_HLEN;
ogm_buff = kmalloc(hard_iface->bat_iv.ogm_buff_len, GFP_ATOMIC);
-@@ -917,9 +917,9 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface)
+@@ -918,9 +918,9 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface)
batadv_ogm_packet->tvlv_len = htons(tvlv_len);
/* change sequence number to network order */
batadv_iv_ogm_slide_own_bcast_window(hard_iface);
-@@ -1596,7 +1596,7 @@ static void batadv_iv_ogm_process(const struct sk_buff *skb, int ogm_offset,
+@@ -1597,7 +1597,7 @@ static void batadv_iv_ogm_process(const struct sk_buff *skb, int ogm_offset,
return;
/* could be changed by schedule_own_packet() */
if (ogm_packet->flags & BATADV_DIRECTLINK)
has_directlink_flag = true;
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
-index 022d18a..919daff 100644
+index fc1835c..eead856 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -450,7 +450,7 @@ bool batadv_frag_send_packet(struct sk_buff *skb,
frag_header.no = 0;
frag_header.total_size = htons(skb->len);
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
-index cbd677f..b783347 100644
+index 5467955..30cc771 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -296,7 +296,7 @@ send:
atomic_t batman_queue_left;
char num_ifaces;
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
-index 80d25c1..aa99a98 100644
+index 115f149..f0ba286 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
-@@ -1044,7 +1044,7 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname,
+@@ -1067,7 +1067,7 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname,
uf.event_mask[1] = *((u32 *) f->event_mask + 1);
}
err = -EFAULT;
break;
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
-index 323f23c..5e27529 100644
+index 46547b9..f5defc1 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
-@@ -3548,8 +3548,10 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len,
+@@ -3569,8 +3569,10 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len,
break;
case L2CAP_CONF_RFC:
if (test_bit(CONF_STATE2_DEVICE, &chan->conf_state) &&
rfc.mode != chan->mode)
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
-index e137869..33f3ebd 100644
+index 1884f72..b3b71f9 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
-@@ -628,7 +628,8 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname,
+@@ -629,7 +629,8 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname,
struct sock *sk = sock->sk;
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
struct l2cap_options opts;
u32 opt;
BT_DBG("sk %p", sk);
-@@ -655,7 +656,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname,
+@@ -656,7 +657,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname,
opts.max_tx = chan->max_tx;
opts.txwin_size = chan->tx_win;
if (copy_from_user((char *) &opts, optval, len)) {
err = -EFAULT;
break;
-@@ -742,7 +743,8 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
+@@ -743,7 +744,8 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
struct bt_security sec;
struct bt_power pwr;
struct l2cap_conn *conn;
u32 opt;
BT_DBG("sk %p", sk);
-@@ -766,7 +768,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
+@@ -767,7 +769,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
sec.level = BT_SECURITY_LOW;
if (copy_from_user((char *) &sec, optval, len)) {
err = -EFAULT;
break;
-@@ -861,7 +863,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
+@@ -862,7 +864,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
pwr.force_active = BT_POWER_FORCE_ACTIVE_ON;
err = -EFAULT;
break;
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
-index c603a5e..7f08991 100644
+index 8bbbb5e..6fc0950 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -687,7 +687,7 @@ static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, c
tty_port_close(&dev->port, tty, filp);
}
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
-index 1059ed3..d70846a 100644
+index 6d69631..b8fdc85 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
-@@ -1524,7 +1524,7 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
+@@ -1518,7 +1518,7 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
tmp.valid_hooks = t->table->valid_hooks;
}
mutex_unlock(&ebt_mutex);
BUGPRINT("c2u Didn't work\n");
ret = -EFAULT;
break;
-@@ -2330,7 +2330,7 @@ static int compat_do_ebt_get_ctl(struct sock *sk, int cmd,
+@@ -2324,7 +2324,7 @@ static int compat_do_ebt_get_ctl(struct sock *sk, int cmd,
goto out;
tmp.valid_hooks = t->valid_hooks;
ret = -EFAULT;
break;
}
-@@ -2341,7 +2341,7 @@ static int compat_do_ebt_get_ctl(struct sock *sk, int cmd,
+@@ -2335,7 +2335,7 @@ static int compat_do_ebt_get_ctl(struct sock *sk, int cmd,
tmp.entries_size = t->table->entries_size;
tmp.valid_hooks = t->table->valid_hooks;
break;
}
diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
-index 0f45522..dab651f 100644
+index f5afda1..dcf770a 100644
--- a/net/caif/cfctrl.c
+++ b/net/caif/cfctrl.c
@@ -10,6 +10,7 @@
if (!can_dir) {
printk(KERN_INFO "can: failed to create /proc/net/can . "
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
-index 1948d59..9e854d5 100644
+index b2f571d..b584643 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
-@@ -187,7 +187,7 @@ static void con_fault(struct ceph_connection *con);
+@@ -188,7 +188,7 @@ static void con_fault(struct ceph_connection *con);
#define MAX_ADDR_STR_LEN 64 /* 54 is enough */
static char addr_str[ADDR_STR_COUNT][MAX_ADDR_STR_LEN];
static struct page *zero_page; /* used in certain error cases */
-@@ -198,7 +198,7 @@ const char *ceph_pr_addr(const struct sockaddr_storage *ss)
+@@ -199,7 +199,7 @@ const char *ceph_pr_addr(const struct sockaddr_storage *ss)
struct sockaddr_in *in4 = (struct sockaddr_in *) ss;
struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) ss;
return -EFAULT;
a0 = a[0];
a1 = a[1];
-diff --git a/net/core/Makefile b/net/core/Makefile
-index 71093d9..a8a035b 100644
---- a/net/core/Makefile
-+++ b/net/core/Makefile
-@@ -21,6 +21,5 @@ obj-$(CONFIG_FIB_RULES) += fib_rules.o
- obj-$(CONFIG_TRACEPOINTS) += net-traces.o
- obj-$(CONFIG_NET_DROP_MONITOR) += drop_monitor.o
- obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += timestamping.o
--obj-$(CONFIG_NET_PTP_CLASSIFY) += ptp_classifier.o
- obj-$(CONFIG_CGROUP_NET_PRIO) += netprio_cgroup.o
- obj-$(CONFIG_CGROUP_NET_CLASSID) += netclassid_cgroup.o
diff --git a/net/core/datagram.c b/net/core/datagram.c
-index 488dd1a..7179f0f 100644
+index fdbc9a8..cd6972c 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -301,7 +301,7 @@ int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags)
return err;
diff --git a/net/core/dev.c b/net/core/dev.c
-index 367a586..ef2fe17 100644
+index cf8a95f..2837211 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -1672,14 +1672,14 @@ int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
+@@ -1683,14 +1683,14 @@ int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
{
if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
if (skb_copy_ubufs(skb, GFP_ATOMIC)) {
kfree_skb(skb);
return NET_RX_DROP;
}
-@@ -2476,7 +2476,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
+@@ -2487,7 +2487,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
struct dev_gso_cb {
void (*destructor)(struct sk_buff *skb);
#define DEV_GSO_CB(skb) ((struct dev_gso_cb *)(skb)->cb)
-@@ -2932,7 +2932,7 @@ recursion_alert:
+@@ -2952,7 +2952,7 @@ recursion_alert:
rc = -ENETDOWN;
rcu_read_unlock_bh();
kfree_skb(skb);
return rc;
out:
-@@ -3276,7 +3276,7 @@ enqueue:
+@@ -3296,7 +3296,7 @@ enqueue:
local_irq_restore(flags);
kfree_skb(skb);
return NET_RX_DROP;
}
-@@ -3353,7 +3353,7 @@ int netif_rx_ni(struct sk_buff *skb)
+@@ -3373,7 +3373,7 @@ int netif_rx_ni(struct sk_buff *skb)
}
EXPORT_SYMBOL(netif_rx_ni);
{
struct softnet_data *sd = &__get_cpu_var(softnet_data);
-@@ -3686,7 +3686,7 @@ ncls:
+@@ -3706,7 +3706,7 @@ ncls:
ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
} else {
drop:
kfree_skb(skb);
/* Jamal, now you will not able to escape explaining
* me how you were going to use this. :-)
-@@ -4406,7 +4406,7 @@ void netif_napi_del(struct napi_struct *napi)
+@@ -4426,7 +4426,7 @@ void netif_napi_del(struct napi_struct *napi)
}
EXPORT_SYMBOL(netif_napi_del);
{
struct softnet_data *sd = &__get_cpu_var(softnet_data);
unsigned long time_limit = jiffies + 2;
-@@ -6403,8 +6403,8 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
+@@ -6480,8 +6480,8 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
} else {
netdev_stats_to_stats64(storage, &dev->stats);
}
}
EXPORT_SYMBOL(dev_load);
diff --git a/net/core/filter.c b/net/core/filter.c
-index 1dbf646..0f95703 100644
+index d814b8a..b5ab778 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
-@@ -1,16 +1,11 @@
- /*
- * Linux Socket Filter - Kernel level socket filtering
- *
-- * Based on the design of the Berkeley Packet Filter. The new
-- * internal format has been designed by PLUMgrid:
-+ * Author:
-+ * Jay Schulist <jschlst@samba.org>
- *
-- * Copyright (c) 2011 - 2014 PLUMgrid, http://plumgrid.com
-- *
-- * Authors:
-- *
-- * Jay Schulist <jschlst@samba.org>
-- * Alexei Starovoitov <ast@plumgrid.com>
-- * Daniel Borkmann <dborkman@redhat.com>
-+ * Based on the design of:
-+ * - The Berkeley Packet Filter
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
-@@ -45,27 +40,6 @@
- #include <linux/seccomp.h>
- #include <linux/if_vlan.h>
-
--/* Registers */
--#define BPF_R0 regs[BPF_REG_0]
--#define BPF_R1 regs[BPF_REG_1]
--#define BPF_R2 regs[BPF_REG_2]
--#define BPF_R3 regs[BPF_REG_3]
--#define BPF_R4 regs[BPF_REG_4]
--#define BPF_R5 regs[BPF_REG_5]
--#define BPF_R6 regs[BPF_REG_6]
--#define BPF_R7 regs[BPF_REG_7]
--#define BPF_R8 regs[BPF_REG_8]
--#define BPF_R9 regs[BPF_REG_9]
--#define BPF_R10 regs[BPF_REG_10]
--
--/* Named registers */
--#define DST regs[insn->dst_reg]
--#define SRC regs[insn->src_reg]
--#define FP regs[BPF_REG_FP]
--#define ARG1 regs[BPF_REG_ARG1]
--#define CTX regs[BPF_REG_CTX]
--#define IMM insn->imm
--
- /* No hurry in this branch
- *
- * Exported for the bpf jit load helper.
-@@ -78,9 +52,9 @@ void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, int k, uns
- ptr = skb_network_header(skb) + k - SKF_NET_OFF;
- else if (k >= SKF_LL_OFF)
- ptr = skb_mac_header(skb) + k - SKF_LL_OFF;
-+
- if (ptr >= skb->head && ptr + size <= skb_tail_pointer(skb))
- return ptr;
--
- return NULL;
- }
-
-@@ -89,7 +63,6 @@ static inline void *load_pointer(const struct sk_buff *skb, int k,
- {
- if (k >= 0)
- return skb_header_pointer(skb, k, size, buffer);
--
- return bpf_internal_load_pointer_neg_helper(skb, k, size);
- }
-
-@@ -135,960 +108,309 @@ int sk_filter(struct sock *sk, struct sk_buff *skb)
- }
- EXPORT_SYMBOL(sk_filter);
-
--/* Base function for offset calculation. Needs to go into .text section,
-- * therefore keeping it non-static as well; will also be used by JITs
-- * anyway later on, so do not let the compiler omit it.
-- */
--noinline u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
--{
-- return 0;
--}
--
- /**
-- * __sk_run_filter - run a filter on a given context
-- * @ctx: buffer to run the filter on
-- * @insn: filter to apply
-+ * sk_run_filter - run a filter on a socket
-+ * @skb: buffer to run the filter on
-+ * @fentry: filter to apply
- *
-- * Decode and apply filter instructions to the skb->data. Return length to
-- * keep, 0 for none. @ctx is the data we are operating on, @insn is the
-- * array of filter instructions.
-+ * Decode and apply filter instructions to the skb->data.
-+ * Return length to keep, 0 for none. @skb is the data we are
-+ * filtering, @filter is the array of filter instructions.
-+ * Because all jumps are guaranteed to be before last instruction,
-+ * and last instruction guaranteed to be a RET, we dont need to check
-+ * flen. (We used to pass to this function the length of filter)
- */
--static unsigned int __sk_run_filter(void *ctx, const struct sock_filter_int *insn)
-+unsigned int sk_run_filter(const struct sk_buff *skb,
-+ const struct sock_filter *fentry)
- {
-- u64 stack[MAX_BPF_STACK / sizeof(u64)];
-- u64 regs[MAX_BPF_REG], tmp;
-- static const void *jumptable[256] = {
-- [0 ... 255] = &&default_label,
-- /* Now overwrite non-defaults ... */
-- /* 32 bit ALU operations */
-- [BPF_ALU | BPF_ADD | BPF_X] = &&ALU_ADD_X,
-- [BPF_ALU | BPF_ADD | BPF_K] = &&ALU_ADD_K,
-- [BPF_ALU | BPF_SUB | BPF_X] = &&ALU_SUB_X,
-- [BPF_ALU | BPF_SUB | BPF_K] = &&ALU_SUB_K,
-- [BPF_ALU | BPF_AND | BPF_X] = &&ALU_AND_X,
-- [BPF_ALU | BPF_AND | BPF_K] = &&ALU_AND_K,
-- [BPF_ALU | BPF_OR | BPF_X] = &&ALU_OR_X,
-- [BPF_ALU | BPF_OR | BPF_K] = &&ALU_OR_K,
-- [BPF_ALU | BPF_LSH | BPF_X] = &&ALU_LSH_X,
-- [BPF_ALU | BPF_LSH | BPF_K] = &&ALU_LSH_K,
-- [BPF_ALU | BPF_RSH | BPF_X] = &&ALU_RSH_X,
-- [BPF_ALU | BPF_RSH | BPF_K] = &&ALU_RSH_K,
-- [BPF_ALU | BPF_XOR | BPF_X] = &&ALU_XOR_X,
-- [BPF_ALU | BPF_XOR | BPF_K] = &&ALU_XOR_K,
-- [BPF_ALU | BPF_MUL | BPF_X] = &&ALU_MUL_X,
-- [BPF_ALU | BPF_MUL | BPF_K] = &&ALU_MUL_K,
-- [BPF_ALU | BPF_MOV | BPF_X] = &&ALU_MOV_X,
-- [BPF_ALU | BPF_MOV | BPF_K] = &&ALU_MOV_K,
-- [BPF_ALU | BPF_DIV | BPF_X] = &&ALU_DIV_X,
-- [BPF_ALU | BPF_DIV | BPF_K] = &&ALU_DIV_K,
-- [BPF_ALU | BPF_MOD | BPF_X] = &&ALU_MOD_X,
-- [BPF_ALU | BPF_MOD | BPF_K] = &&ALU_MOD_K,
-- [BPF_ALU | BPF_NEG] = &&ALU_NEG,
-- [BPF_ALU | BPF_END | BPF_TO_BE] = &&ALU_END_TO_BE,
-- [BPF_ALU | BPF_END | BPF_TO_LE] = &&ALU_END_TO_LE,
-- /* 64 bit ALU operations */
-- [BPF_ALU64 | BPF_ADD | BPF_X] = &&ALU64_ADD_X,
-- [BPF_ALU64 | BPF_ADD | BPF_K] = &&ALU64_ADD_K,
-- [BPF_ALU64 | BPF_SUB | BPF_X] = &&ALU64_SUB_X,
-- [BPF_ALU64 | BPF_SUB | BPF_K] = &&ALU64_SUB_K,
-- [BPF_ALU64 | BPF_AND | BPF_X] = &&ALU64_AND_X,
-- [BPF_ALU64 | BPF_AND | BPF_K] = &&ALU64_AND_K,
-- [BPF_ALU64 | BPF_OR | BPF_X] = &&ALU64_OR_X,
-- [BPF_ALU64 | BPF_OR | BPF_K] = &&ALU64_OR_K,
-- [BPF_ALU64 | BPF_LSH | BPF_X] = &&ALU64_LSH_X,
-- [BPF_ALU64 | BPF_LSH | BPF_K] = &&ALU64_LSH_K,
-- [BPF_ALU64 | BPF_RSH | BPF_X] = &&ALU64_RSH_X,
-- [BPF_ALU64 | BPF_RSH | BPF_K] = &&ALU64_RSH_K,
-- [BPF_ALU64 | BPF_XOR | BPF_X] = &&ALU64_XOR_X,
-- [BPF_ALU64 | BPF_XOR | BPF_K] = &&ALU64_XOR_K,
-- [BPF_ALU64 | BPF_MUL | BPF_X] = &&ALU64_MUL_X,
-- [BPF_ALU64 | BPF_MUL | BPF_K] = &&ALU64_MUL_K,
-- [BPF_ALU64 | BPF_MOV | BPF_X] = &&ALU64_MOV_X,
-- [BPF_ALU64 | BPF_MOV | BPF_K] = &&ALU64_MOV_K,
-- [BPF_ALU64 | BPF_ARSH | BPF_X] = &&ALU64_ARSH_X,
-- [BPF_ALU64 | BPF_ARSH | BPF_K] = &&ALU64_ARSH_K,
-- [BPF_ALU64 | BPF_DIV | BPF_X] = &&ALU64_DIV_X,
-- [BPF_ALU64 | BPF_DIV | BPF_K] = &&ALU64_DIV_K,
-- [BPF_ALU64 | BPF_MOD | BPF_X] = &&ALU64_MOD_X,
-- [BPF_ALU64 | BPF_MOD | BPF_K] = &&ALU64_MOD_K,
-- [BPF_ALU64 | BPF_NEG] = &&ALU64_NEG,
-- /* Call instruction */
-- [BPF_JMP | BPF_CALL] = &&JMP_CALL,
-- /* Jumps */
-- [BPF_JMP | BPF_JA] = &&JMP_JA,
-- [BPF_JMP | BPF_JEQ | BPF_X] = &&JMP_JEQ_X,
-- [BPF_JMP | BPF_JEQ | BPF_K] = &&JMP_JEQ_K,
-- [BPF_JMP | BPF_JNE | BPF_X] = &&JMP_JNE_X,
-- [BPF_JMP | BPF_JNE | BPF_K] = &&JMP_JNE_K,
-- [BPF_JMP | BPF_JGT | BPF_X] = &&JMP_JGT_X,
-- [BPF_JMP | BPF_JGT | BPF_K] = &&JMP_JGT_K,
-- [BPF_JMP | BPF_JGE | BPF_X] = &&JMP_JGE_X,
-- [BPF_JMP | BPF_JGE | BPF_K] = &&JMP_JGE_K,
-- [BPF_JMP | BPF_JSGT | BPF_X] = &&JMP_JSGT_X,
-- [BPF_JMP | BPF_JSGT | BPF_K] = &&JMP_JSGT_K,
-- [BPF_JMP | BPF_JSGE | BPF_X] = &&JMP_JSGE_X,
-- [BPF_JMP | BPF_JSGE | BPF_K] = &&JMP_JSGE_K,
-- [BPF_JMP | BPF_JSET | BPF_X] = &&JMP_JSET_X,
-- [BPF_JMP | BPF_JSET | BPF_K] = &&JMP_JSET_K,
-- /* Program return */
-- [BPF_JMP | BPF_EXIT] = &&JMP_EXIT,
-- /* Store instructions */
-- [BPF_STX | BPF_MEM | BPF_B] = &&STX_MEM_B,
-- [BPF_STX | BPF_MEM | BPF_H] = &&STX_MEM_H,
-- [BPF_STX | BPF_MEM | BPF_W] = &&STX_MEM_W,
-- [BPF_STX | BPF_MEM | BPF_DW] = &&STX_MEM_DW,
-- [BPF_STX | BPF_XADD | BPF_W] = &&STX_XADD_W,
-- [BPF_STX | BPF_XADD | BPF_DW] = &&STX_XADD_DW,
-- [BPF_ST | BPF_MEM | BPF_B] = &&ST_MEM_B,
-- [BPF_ST | BPF_MEM | BPF_H] = &&ST_MEM_H,
-- [BPF_ST | BPF_MEM | BPF_W] = &&ST_MEM_W,
-- [BPF_ST | BPF_MEM | BPF_DW] = &&ST_MEM_DW,
-- /* Load instructions */
-- [BPF_LDX | BPF_MEM | BPF_B] = &&LDX_MEM_B,
-- [BPF_LDX | BPF_MEM | BPF_H] = &&LDX_MEM_H,
-- [BPF_LDX | BPF_MEM | BPF_W] = &&LDX_MEM_W,
-- [BPF_LDX | BPF_MEM | BPF_DW] = &&LDX_MEM_DW,
-- [BPF_LD | BPF_ABS | BPF_W] = &&LD_ABS_W,
-- [BPF_LD | BPF_ABS | BPF_H] = &&LD_ABS_H,
-- [BPF_LD | BPF_ABS | BPF_B] = &&LD_ABS_B,
-- [BPF_LD | BPF_IND | BPF_W] = &&LD_IND_W,
-- [BPF_LD | BPF_IND | BPF_H] = &&LD_IND_H,
-- [BPF_LD | BPF_IND | BPF_B] = &&LD_IND_B,
-- };
- void *ptr;
-- int off;
--
--#define CONT ({ insn++; goto select_insn; })
--#define CONT_JMP ({ insn++; goto select_insn; })
--
-- FP = (u64) (unsigned long) &stack[ARRAY_SIZE(stack)];
-- ARG1 = (u64) (unsigned long) ctx;
--
-- /* Registers used in classic BPF programs need to be reset first. */
-- regs[BPF_REG_A] = 0;
-- regs[BPF_REG_X] = 0;
--
--select_insn:
-- goto *jumptable[insn->code];
--
-- /* ALU */
--#define ALU(OPCODE, OP) \
-- ALU64_##OPCODE##_X: \
-- DST = DST OP SRC; \
-- CONT; \
-- ALU_##OPCODE##_X: \
-- DST = (u32) DST OP (u32) SRC; \
-- CONT; \
-- ALU64_##OPCODE##_K: \
-- DST = DST OP IMM; \
-- CONT; \
-- ALU_##OPCODE##_K: \
-- DST = (u32) DST OP (u32) IMM; \
-- CONT;
--
-- ALU(ADD, +)
-- ALU(SUB, -)
-- ALU(AND, &)
-- ALU(OR, |)
-- ALU(LSH, <<)
-- ALU(RSH, >>)
-- ALU(XOR, ^)
-- ALU(MUL, *)
--#undef ALU
-- ALU_NEG:
-- DST = (u32) -DST;
-- CONT;
-- ALU64_NEG:
-- DST = -DST;
-- CONT;
-- ALU_MOV_X:
-- DST = (u32) SRC;
-- CONT;
-- ALU_MOV_K:
-- DST = (u32) IMM;
-- CONT;
-- ALU64_MOV_X:
-- DST = SRC;
-- CONT;
-- ALU64_MOV_K:
-- DST = IMM;
-- CONT;
-- ALU64_ARSH_X:
-- (*(s64 *) &DST) >>= SRC;
-- CONT;
-- ALU64_ARSH_K:
-- (*(s64 *) &DST) >>= IMM;
-- CONT;
-- ALU64_MOD_X:
-- if (unlikely(SRC == 0))
-- return 0;
-- tmp = DST;
-- DST = do_div(tmp, SRC);
-- CONT;
-- ALU_MOD_X:
-- if (unlikely(SRC == 0))
-- return 0;
-- tmp = (u32) DST;
-- DST = do_div(tmp, (u32) SRC);
-- CONT;
-- ALU64_MOD_K:
-- tmp = DST;
-- DST = do_div(tmp, IMM);
-- CONT;
-- ALU_MOD_K:
-- tmp = (u32) DST;
-- DST = do_div(tmp, (u32) IMM);
-- CONT;
-- ALU64_DIV_X:
-- if (unlikely(SRC == 0))
-- return 0;
-- do_div(DST, SRC);
-- CONT;
-- ALU_DIV_X:
-- if (unlikely(SRC == 0))
-- return 0;
-- tmp = (u32) DST;
-- do_div(tmp, (u32) SRC);
-- DST = (u32) tmp;
-- CONT;
-- ALU64_DIV_K:
-- do_div(DST, IMM);
-- CONT;
-- ALU_DIV_K:
-- tmp = (u32) DST;
-- do_div(tmp, (u32) IMM);
-- DST = (u32) tmp;
-- CONT;
-- ALU_END_TO_BE:
-- switch (IMM) {
-- case 16:
-- DST = (__force u16) cpu_to_be16(DST);
-- break;
-- case 32:
-- DST = (__force u32) cpu_to_be32(DST);
-- break;
-- case 64:
-- DST = (__force u64) cpu_to_be64(DST);
-- break;
-- }
-- CONT;
-- ALU_END_TO_LE:
-- switch (IMM) {
-- case 16:
-- DST = (__force u16) cpu_to_le16(DST);
-- break;
-- case 32:
-- DST = (__force u32) cpu_to_le32(DST);
-- break;
-- case 64:
-- DST = (__force u64) cpu_to_le64(DST);
-- break;
-- }
-- CONT;
--
-- /* CALL */
-- JMP_CALL:
-- /* Function call scratches BPF_R1-BPF_R5 registers,
-- * preserves BPF_R6-BPF_R9, and stores return value
-- * into BPF_R0.
-- */
-- BPF_R0 = (__bpf_call_base + insn->imm)(BPF_R1, BPF_R2, BPF_R3,
-- BPF_R4, BPF_R5);
-- CONT;
--
-- /* JMP */
-- JMP_JA:
-- insn += insn->off;
-- CONT;
-- JMP_JEQ_X:
-- if (DST == SRC) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JEQ_K:
-- if (DST == IMM) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JNE_X:
-- if (DST != SRC) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JNE_K:
-- if (DST != IMM) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JGT_X:
-- if (DST > SRC) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JGT_K:
-- if (DST > IMM) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JGE_X:
-- if (DST >= SRC) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JGE_K:
-- if (DST >= IMM) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JSGT_X:
-- if (((s64) DST) > ((s64) SRC)) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JSGT_K:
-- if (((s64) DST) > ((s64) IMM)) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JSGE_X:
-- if (((s64) DST) >= ((s64) SRC)) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JSGE_K:
-- if (((s64) DST) >= ((s64) IMM)) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JSET_X:
-- if (DST & SRC) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_JSET_K:
-- if (DST & IMM) {
-- insn += insn->off;
-- CONT_JMP;
-- }
-- CONT;
-- JMP_EXIT:
-- return BPF_R0;
--
-- /* STX and ST and LDX*/
--#define LDST(SIZEOP, SIZE) \
-- STX_MEM_##SIZEOP: \
-- *(SIZE *)(unsigned long) (DST + insn->off) = SRC; \
-- CONT; \
-- ST_MEM_##SIZEOP: \
-- *(SIZE *)(unsigned long) (DST + insn->off) = IMM; \
-- CONT; \
-- LDX_MEM_##SIZEOP: \
-- DST = *(SIZE *)(unsigned long) (SRC + insn->off); \
-- CONT;
--
-- LDST(B, u8)
-- LDST(H, u16)
-- LDST(W, u32)
-- LDST(DW, u64)
--#undef LDST
-- STX_XADD_W: /* lock xadd *(u32 *)(dst_reg + off16) += src_reg */
-- atomic_add((u32) SRC, (atomic_t *)(unsigned long)
-- (DST + insn->off));
-- CONT;
-- STX_XADD_DW: /* lock xadd *(u64 *)(dst_reg + off16) += src_reg */
-- atomic64_add((u64) SRC, (atomic64_t *)(unsigned long)
-- (DST + insn->off));
-- CONT;
-- LD_ABS_W: /* BPF_R0 = ntohl(*(u32 *) (skb->data + imm32)) */
-- off = IMM;
--load_word:
-- /* BPF_LD + BPD_ABS and BPF_LD + BPF_IND insns are
-- * only appearing in the programs where ctx ==
-- * skb. All programs keep 'ctx' in regs[BPF_REG_CTX]
-- * == BPF_R6, sk_convert_filter() saves it in BPF_R6,
-- * internal BPF verifier will check that BPF_R6 ==
-- * ctx.
-- *
-- * BPF_ABS and BPF_IND are wrappers of function calls,
-- * so they scratch BPF_R1-BPF_R5 registers, preserve
-- * BPF_R6-BPF_R9, and store return value into BPF_R0.
-- *
-- * Implicit input:
-- * ctx == skb == BPF_R6 == CTX
-- *
-- * Explicit input:
-- * SRC == any register
-- * IMM == 32-bit immediate
-- *
-- * Output:
-- * BPF_R0 - 8/16/32-bit skb data converted to cpu endianness
-- */
--
-- ptr = load_pointer((struct sk_buff *) (unsigned long) CTX, off, 4, &tmp);
-- if (likely(ptr != NULL)) {
-- BPF_R0 = get_unaligned_be32(ptr);
-- CONT;
-- }
--
-- return 0;
-- LD_ABS_H: /* BPF_R0 = ntohs(*(u16 *) (skb->data + imm32)) */
-- off = IMM;
--load_half:
-- ptr = load_pointer((struct sk_buff *) (unsigned long) CTX, off, 2, &tmp);
-- if (likely(ptr != NULL)) {
-- BPF_R0 = get_unaligned_be16(ptr);
-- CONT;
-- }
--
-- return 0;
-- LD_ABS_B: /* BPF_R0 = *(u8 *) (skb->data + imm32) */
-- off = IMM;
--load_byte:
-- ptr = load_pointer((struct sk_buff *) (unsigned long) CTX, off, 1, &tmp);
-- if (likely(ptr != NULL)) {
-- BPF_R0 = *(u8 *)ptr;
-- CONT;
-- }
--
-- return 0;
-- LD_IND_W: /* BPF_R0 = ntohl(*(u32 *) (skb->data + src_reg + imm32)) */
-- off = IMM + SRC;
-- goto load_word;
-- LD_IND_H: /* BPF_R0 = ntohs(*(u16 *) (skb->data + src_reg + imm32)) */
-- off = IMM + SRC;
-- goto load_half;
-- LD_IND_B: /* BPF_R0 = *(u8 *) (skb->data + src_reg + imm32) */
-- off = IMM + SRC;
-- goto load_byte;
--
-- default_label:
-- /* If we ever reach this, we have a bug somewhere. */
-- WARN_RATELIMIT(1, "unknown opcode %02x\n", insn->code);
-- return 0;
--}
--
--/* Helper to find the offset of pkt_type in sk_buff structure. We want
-- * to make sure its still a 3bit field starting at a byte boundary;
-- * taken from arch/x86/net/bpf_jit_comp.c.
-- */
--#ifdef __BIG_ENDIAN_BITFIELD
--#define PKT_TYPE_MAX (7 << 5)
-+ u32 A = 0; /* Accumulator */
-+ u32 X = 0; /* Index Register */
-+ u32 mem[BPF_MEMWORDS] = {}; /* Scratch Memory Store */
-+ u32 tmp;
-+ int k;
-+
-+ /*
-+ * Process array of filter instructions.
-+ */
-+ for (;; fentry++) {
-+#if defined(CONFIG_X86_32)
-+#define K (fentry->k)
- #else
--#define PKT_TYPE_MAX 7
-+ const u32 K = fentry->k;
- #endif
--static unsigned int pkt_type_offset(void)
--{
-- struct sk_buff skb_probe = { .pkt_type = ~0, };
-- u8 *ct = (u8 *) &skb_probe;
-- unsigned int off;
+@@ -559,7 +559,11 @@ do_pass:
-- for (off = 0; off < sizeof(struct sk_buff); off++) {
-- if (ct[off] == PKT_TYPE_MAX)
-- return off;
-- }
--
-- pr_err_once("Please fix %s, as pkt_type couldn't be found!\n", __func__);
-- return -1;
--}
--
--static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
--{
-- return __skb_get_poff((struct sk_buff *)(unsigned long) ctx);
--}
--
--static u64 __skb_get_nlattr(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
--{
-- struct sk_buff *skb = (struct sk_buff *)(unsigned long) ctx;
-- struct nlattr *nla;
--
-- if (skb_is_nonlinear(skb))
-- return 0;
--
-- if (skb->len < sizeof(struct nlattr))
-- return 0;
--
-- if (a > skb->len - sizeof(struct nlattr))
-- return 0;
--
-- nla = nla_find((struct nlattr *) &skb->data[a], skb->len - a, x);
-- if (nla)
-- return (void *) nla - (void *) skb->data;
--
-- return 0;
--}
--
--static u64 __skb_get_nlattr_nest(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
--{
-- struct sk_buff *skb = (struct sk_buff *)(unsigned long) ctx;
-- struct nlattr *nla;
--
-- if (skb_is_nonlinear(skb))
-- return 0;
--
-- if (skb->len < sizeof(struct nlattr))
-- return 0;
--
-- if (a > skb->len - sizeof(struct nlattr))
-- return 0;
--
-- nla = (struct nlattr *) &skb->data[a];
-- if (nla->nla_len > skb->len - a)
-- return 0;
--
-- nla = nla_find_nested(nla, x);
-- if (nla)
-- return (void *) nla - (void *) skb->data;
--
-- return 0;
--}
--
--static u64 __get_raw_cpu_id(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
--{
-- return raw_smp_processor_id();
--}
--
--/* note that this only generates 32-bit random numbers */
--static u64 __get_random_u32(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
--{
-- return prandom_u32();
--}
--
--static bool convert_bpf_extensions(struct sock_filter *fp,
-- struct sock_filter_int **insnp)
--{
-- struct sock_filter_int *insn = *insnp;
--
-- switch (fp->k) {
-- case SKF_AD_OFF + SKF_AD_PROTOCOL:
-- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, protocol) != 2);
--
-- /* A = *(u16 *) (CTX + offsetof(protocol)) */
-- *insn++ = BPF_LDX_MEM(BPF_H, BPF_REG_A, BPF_REG_CTX,
-- offsetof(struct sk_buff, protocol));
-- /* A = ntohs(A) [emitting a nop or swap16] */
-- *insn = BPF_ENDIAN(BPF_FROM_BE, BPF_REG_A, 16);
-- break;
--
-- case SKF_AD_OFF + SKF_AD_PKTTYPE:
-- *insn = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
-- pkt_type_offset());
-- if (insn->off < 0)
-- return false;
-- insn++;
-- *insn = BPF_ALU32_IMM(BPF_AND, BPF_REG_A, PKT_TYPE_MAX);
--#ifdef __BIG_ENDIAN_BITFIELD
-- insn++;
-- *insn = BPF_ALU32_IMM(BPF_RSH, BPF_REG_A, 5);
--#endif
-- break;
--
-- case SKF_AD_OFF + SKF_AD_IFINDEX:
-- case SKF_AD_OFF + SKF_AD_HATYPE:
-- BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, ifindex) != 4);
-- BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, type) != 2);
-- BUILD_BUG_ON(bytes_to_bpf_size(FIELD_SIZEOF(struct sk_buff, dev)) < 0);
--
-- *insn++ = BPF_LDX_MEM(bytes_to_bpf_size(FIELD_SIZEOF(struct sk_buff, dev)),
-- BPF_REG_TMP, BPF_REG_CTX,
-- offsetof(struct sk_buff, dev));
-- /* if (tmp != 0) goto pc + 1 */
-- *insn++ = BPF_JMP_IMM(BPF_JNE, BPF_REG_TMP, 0, 1);
-- *insn++ = BPF_EXIT_INSN();
-- if (fp->k == SKF_AD_OFF + SKF_AD_IFINDEX)
-- *insn = BPF_LDX_MEM(BPF_W, BPF_REG_A, BPF_REG_TMP,
-- offsetof(struct net_device, ifindex));
-- else
-- *insn = BPF_LDX_MEM(BPF_H, BPF_REG_A, BPF_REG_TMP,
-- offsetof(struct net_device, type));
-- break;
--
-- case SKF_AD_OFF + SKF_AD_MARK:
-- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, mark) != 4);
--
-- *insn = BPF_LDX_MEM(BPF_W, BPF_REG_A, BPF_REG_CTX,
-- offsetof(struct sk_buff, mark));
-- break;
--
-- case SKF_AD_OFF + SKF_AD_RXHASH:
-- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
--
-- *insn = BPF_LDX_MEM(BPF_W, BPF_REG_A, BPF_REG_CTX,
-- offsetof(struct sk_buff, hash));
-- break;
--
-- case SKF_AD_OFF + SKF_AD_QUEUE:
-- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, queue_mapping) != 2);
--
-- *insn = BPF_LDX_MEM(BPF_H, BPF_REG_A, BPF_REG_CTX,
-- offsetof(struct sk_buff, queue_mapping));
-- break;
--
-- case SKF_AD_OFF + SKF_AD_VLAN_TAG:
-- case SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT:
-- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2);
-- BUILD_BUG_ON(VLAN_TAG_PRESENT != 0x1000);
--
-- /* A = *(u16 *) (CTX + offsetof(vlan_tci)) */
-- *insn++ = BPF_LDX_MEM(BPF_H, BPF_REG_A, BPF_REG_CTX,
-- offsetof(struct sk_buff, vlan_tci));
-- if (fp->k == SKF_AD_OFF + SKF_AD_VLAN_TAG) {
-- *insn = BPF_ALU32_IMM(BPF_AND, BPF_REG_A,
-- ~VLAN_TAG_PRESENT);
-- } else {
-- /* A >>= 12 */
-- *insn++ = BPF_ALU32_IMM(BPF_RSH, BPF_REG_A, 12);
-- /* A &= 1 */
-- *insn = BPF_ALU32_IMM(BPF_AND, BPF_REG_A, 1);
-- }
-- break;
--
-- case SKF_AD_OFF + SKF_AD_PAY_OFFSET:
-- case SKF_AD_OFF + SKF_AD_NLATTR:
-- case SKF_AD_OFF + SKF_AD_NLATTR_NEST:
-- case SKF_AD_OFF + SKF_AD_CPU:
-- case SKF_AD_OFF + SKF_AD_RANDOM:
-- /* arg1 = CTX */
-- *insn++ = BPF_MOV64_REG(BPF_REG_ARG1, BPF_REG_CTX);
-- /* arg2 = A */
-- *insn++ = BPF_MOV64_REG(BPF_REG_ARG2, BPF_REG_A);
-- /* arg3 = X */
-- *insn++ = BPF_MOV64_REG(BPF_REG_ARG3, BPF_REG_X);
-- /* Emit call(arg1=CTX, arg2=A, arg3=X) */
-- switch (fp->k) {
-- case SKF_AD_OFF + SKF_AD_PAY_OFFSET:
-- *insn = BPF_EMIT_CALL(__skb_get_pay_offset);
-- break;
-- case SKF_AD_OFF + SKF_AD_NLATTR:
-- *insn = BPF_EMIT_CALL(__skb_get_nlattr);
-- break;
-- case SKF_AD_OFF + SKF_AD_NLATTR_NEST:
-- *insn = BPF_EMIT_CALL(__skb_get_nlattr_nest);
-- break;
-- case SKF_AD_OFF + SKF_AD_CPU:
-- *insn = BPF_EMIT_CALL(__get_raw_cpu_id);
-- break;
-- case SKF_AD_OFF + SKF_AD_RANDOM:
-- *insn = BPF_EMIT_CALL(__get_random_u32);
-- break;
-- }
-- break;
--
-- case SKF_AD_OFF + SKF_AD_ALU_XOR_X:
-- /* A ^= X */
-- *insn = BPF_ALU32_REG(BPF_XOR, BPF_REG_A, BPF_REG_X);
-- break;
--
-- default:
-- /* This is just a dummy call to avoid letting the compiler
-- * evict __bpf_call_base() as an optimization. Placed here
-- * where no-one bothers.
-- */
-- BUG_ON(__bpf_call_base(0, 0, 0, 0, 0) != 0);
-- return false;
-- }
--
-- *insnp = insn;
-- return true;
--}
--
--/**
-- * sk_convert_filter - convert filter program
-- * @prog: the user passed filter program
-- * @len: the length of the user passed filter program
-- * @new_prog: buffer where converted program will be stored
-- * @new_len: pointer to store length of converted program
-- *
-- * Remap 'sock_filter' style BPF instruction set to 'sock_filter_ext' style.
-- * Conversion workflow:
-- *
-- * 1) First pass for calculating the new program length:
-- * sk_convert_filter(old_prog, old_len, NULL, &new_len)
-- *
-- * 2) 2nd pass to remap in two passes: 1st pass finds new
-- * jump offsets, 2nd pass remapping:
-- * new_prog = kmalloc(sizeof(struct sock_filter_int) * new_len);
-- * sk_convert_filter(old_prog, old_len, new_prog, &new_len);
-- *
-- * User BPF's register A is mapped to our BPF register 6, user BPF
-- * register X is mapped to BPF register 7; frame pointer is always
-- * register 10; Context 'void *ctx' is stored in register 1, that is,
-- * for socket filters: ctx == 'struct sk_buff *', for seccomp:
-- * ctx == 'struct seccomp_data *'.
-- */
--int sk_convert_filter(struct sock_filter *prog, int len,
-- struct sock_filter_int *new_prog, int *new_len)
--{
-- int new_flen = 0, pass = 0, target, i;
-- struct sock_filter_int *new_insn;
-- struct sock_filter *fp;
-- int *addrs = NULL;
-- u8 bpf_src;
--
-- BUILD_BUG_ON(BPF_MEMWORDS * sizeof(u32) > MAX_BPF_STACK);
-- BUILD_BUG_ON(BPF_REG_FP + 1 != MAX_BPF_REG);
--
-- if (len <= 0 || len > BPF_MAXINSNS)
-- return -EINVAL;
--
-- if (new_prog) {
-- addrs = kcalloc(len, sizeof(*addrs), GFP_KERNEL);
-- if (!addrs)
-- return -ENOMEM;
-- }
--
--do_pass:
-- new_insn = new_prog;
-- fp = prog;
--
-- if (new_insn)
-- *new_insn = BPF_MOV64_REG(BPF_REG_CTX, BPF_REG_ARG1);
-- new_insn++;
--
-- for (i = 0; i < len; fp++, i++) {
-- struct sock_filter_int tmp_insns[6] = { };
-- struct sock_filter_int *insn = tmp_insns;
--
-- if (addrs)
-- addrs[i] = new_insn - new_prog;
--
-- switch (fp->code) {
-- /* All arithmetic insns and skb loads map as-is. */
-- case BPF_ALU | BPF_ADD | BPF_X:
-- case BPF_ALU | BPF_ADD | BPF_K:
-- case BPF_ALU | BPF_SUB | BPF_X:
-- case BPF_ALU | BPF_SUB | BPF_K:
-- case BPF_ALU | BPF_AND | BPF_X:
-- case BPF_ALU | BPF_AND | BPF_K:
-- case BPF_ALU | BPF_OR | BPF_X:
-- case BPF_ALU | BPF_OR | BPF_K:
-- case BPF_ALU | BPF_LSH | BPF_X:
-- case BPF_ALU | BPF_LSH | BPF_K:
-- case BPF_ALU | BPF_RSH | BPF_X:
-- case BPF_ALU | BPF_RSH | BPF_K:
-- case BPF_ALU | BPF_XOR | BPF_X:
-- case BPF_ALU | BPF_XOR | BPF_K:
-- case BPF_ALU | BPF_MUL | BPF_X:
-- case BPF_ALU | BPF_MUL | BPF_K:
-- case BPF_ALU | BPF_DIV | BPF_X:
-- case BPF_ALU | BPF_DIV | BPF_K:
-- case BPF_ALU | BPF_MOD | BPF_X:
-- case BPF_ALU | BPF_MOD | BPF_K:
-- case BPF_ALU | BPF_NEG:
-- case BPF_LD | BPF_ABS | BPF_W:
-- case BPF_LD | BPF_ABS | BPF_H:
-- case BPF_LD | BPF_ABS | BPF_B:
-- case BPF_LD | BPF_IND | BPF_W:
-- case BPF_LD | BPF_IND | BPF_H:
-- case BPF_LD | BPF_IND | BPF_B:
-- /* Check for overloaded BPF extension and
-- * directly convert it if found, otherwise
-- * just move on with mapping.
-- */
-- if (BPF_CLASS(fp->code) == BPF_LD &&
-- BPF_MODE(fp->code) == BPF_ABS &&
-- convert_bpf_extensions(fp, &insn))
-- break;
--
-- *insn = BPF_RAW_INSN(fp->code, BPF_REG_A, BPF_REG_X, 0, fp->k);
-- break;
--
-- /* Jump transformation cannot use BPF block macros
-- * everywhere as offset calculation and target updates
-- * require a bit more work than the rest, i.e. jump
-- * opcodes map as-is, but offsets need adjustment.
-- */
--
--#define BPF_EMIT_JMP \
-- do { \
-- if (target >= len || target < 0) \
-- goto err; \
-- insn->off = addrs ? addrs[target] - addrs[i] - 1 : 0; \
-- /* Adjust pc relative offset for 2nd or 3rd insn. */ \
-- insn->off -= insn - tmp_insns; \
-- } while (0)
--
-- case BPF_JMP | BPF_JA:
-- target = i + fp->k + 1;
-- insn->code = fp->code;
-- BPF_EMIT_JMP;
-- break;
--
-- case BPF_JMP | BPF_JEQ | BPF_K:
-- case BPF_JMP | BPF_JEQ | BPF_X:
-- case BPF_JMP | BPF_JSET | BPF_K:
-- case BPF_JMP | BPF_JSET | BPF_X:
-- case BPF_JMP | BPF_JGT | BPF_K:
-- case BPF_JMP | BPF_JGT | BPF_X:
-- case BPF_JMP | BPF_JGE | BPF_K:
-- case BPF_JMP | BPF_JGE | BPF_X:
-- if (BPF_SRC(fp->code) == BPF_K && (int) fp->k < 0) {
-- /* BPF immediates are signed, zero extend
-- * immediate into tmp register and use it
-- * in compare insn.
-- */
-- *insn++ = BPF_MOV32_IMM(BPF_REG_TMP, fp->k);
--
-- insn->dst_reg = BPF_REG_A;
-- insn->src_reg = BPF_REG_TMP;
-- bpf_src = BPF_X;
-- } else {
-- insn->dst_reg = BPF_REG_A;
-- insn->src_reg = BPF_REG_X;
-- insn->imm = fp->k;
-- bpf_src = BPF_SRC(fp->code);
-+ switch (fentry->code) {
-+ case BPF_S_ALU_ADD_X:
-+ A += X;
-+ continue;
-+ case BPF_S_ALU_ADD_K:
-+ A += K;
-+ continue;
-+ case BPF_S_ALU_SUB_X:
-+ A -= X;
-+ continue;
-+ case BPF_S_ALU_SUB_K:
-+ A -= K;
-+ continue;
-+ case BPF_S_ALU_MUL_X:
-+ A *= X;
-+ continue;
-+ case BPF_S_ALU_MUL_K:
-+ A *= K;
-+ continue;
-+ case BPF_S_ALU_DIV_X:
-+ if (X == 0)
-+ return 0;
-+ A /= X;
-+ continue;
-+ case BPF_S_ALU_DIV_K:
-+ A /= K;
-+ continue;
-+ case BPF_S_ALU_MOD_X:
-+ if (X == 0)
-+ return 0;
-+ A %= X;
-+ continue;
-+ case BPF_S_ALU_MOD_K:
-+ A %= K;
-+ continue;
-+ case BPF_S_ALU_AND_X:
-+ A &= X;
-+ continue;
-+ case BPF_S_ALU_AND_K:
-+ A &= K;
-+ continue;
-+ case BPF_S_ALU_OR_X:
-+ A |= X;
-+ continue;
-+ case BPF_S_ALU_OR_K:
-+ A |= K;
-+ continue;
-+ case BPF_S_ANC_ALU_XOR_X:
-+ case BPF_S_ALU_XOR_X:
-+ A ^= X;
-+ continue;
-+ case BPF_S_ALU_XOR_K:
-+ A ^= K;
-+ continue;
-+ case BPF_S_ALU_LSH_X:
-+ A <<= X;
-+ continue;
-+ case BPF_S_ALU_LSH_K:
-+ A <<= K;
-+ continue;
-+ case BPF_S_ALU_RSH_X:
-+ A >>= X;
-+ continue;
-+ case BPF_S_ALU_RSH_K:
-+ A >>= K;
-+ continue;
-+ case BPF_S_ALU_NEG:
-+ A = -A;
-+ continue;
-+ case BPF_S_JMP_JA:
-+ fentry += K;
-+ continue;
-+ case BPF_S_JMP_JGT_K:
-+ fentry += (A > K) ? fentry->jt : fentry->jf;
-+ continue;
-+ case BPF_S_JMP_JGE_K:
-+ fentry += (A >= K) ? fentry->jt : fentry->jf;
-+ continue;
-+ case BPF_S_JMP_JEQ_K:
-+ fentry += (A == K) ? fentry->jt : fentry->jf;
-+ continue;
-+ case BPF_S_JMP_JSET_K:
-+ fentry += (A & K) ? fentry->jt : fentry->jf;
-+ continue;
-+ case BPF_S_JMP_JGT_X:
-+ fentry += (A > X) ? fentry->jt : fentry->jf;
-+ continue;
-+ case BPF_S_JMP_JGE_X:
-+ fentry += (A >= X) ? fentry->jt : fentry->jf;
-+ continue;
-+ case BPF_S_JMP_JEQ_X:
-+ fentry += (A == X) ? fentry->jt : fentry->jf;
-+ continue;
-+ case BPF_S_JMP_JSET_X:
-+ fentry += (A & X) ? fentry->jt : fentry->jf;
-+ continue;
-+ case BPF_S_LD_W_ABS:
-+ k = K;
-+load_w:
-+ ptr = load_pointer(skb, k, 4, &tmp);
-+ if (ptr != NULL) {
-+ A = get_unaligned_be32(ptr);
-+ continue;
- }
--
-- /* Common case where 'jump_false' is next insn. */
-- if (fp->jf == 0) {
-- insn->code = BPF_JMP | BPF_OP(fp->code) | bpf_src;
-- target = i + fp->jt + 1;
-- BPF_EMIT_JMP;
-- break;
-+ return 0;
-+ case BPF_S_LD_H_ABS:
-+ k = K;
-+load_h:
-+ ptr = load_pointer(skb, k, 2, &tmp);
-+ if (ptr != NULL) {
-+ A = get_unaligned_be16(ptr);
-+ continue;
- }
--
-- /* Convert JEQ into JNE when 'jump_true' is next insn. */
-- if (fp->jt == 0 && BPF_OP(fp->code) == BPF_JEQ) {
-- insn->code = BPF_JMP | BPF_JNE | bpf_src;
-- target = i + fp->jf + 1;
-- BPF_EMIT_JMP;
-- break;
-+ return 0;
-+ case BPF_S_LD_B_ABS:
-+ k = K;
-+load_b:
-+ ptr = load_pointer(skb, k, 1, &tmp);
-+ if (ptr != NULL) {
-+ A = *(u8 *)ptr;
-+ continue;
- }
--
-- /* Other jumps are mapped into two insns: Jxx and JA. */
-- target = i + fp->jt + 1;
-- insn->code = BPF_JMP | BPF_OP(fp->code) | bpf_src;
-- BPF_EMIT_JMP;
-- insn++;
--
-- insn->code = BPF_JMP | BPF_JA;
-- target = i + fp->jf + 1;
-- BPF_EMIT_JMP;
-- break;
--
-- /* ldxb 4 * ([14] & 0xf) is remaped into 6 insns. */
-- case BPF_LDX | BPF_MSH | BPF_B:
-- /* tmp = A */
-- *insn++ = BPF_MOV64_REG(BPF_REG_TMP, BPF_REG_A);
-- /* A = BPF_R0 = *(u8 *) (skb->data + K) */
-- *insn++ = BPF_LD_ABS(BPF_B, fp->k);
-- /* A &= 0xf */
-- *insn++ = BPF_ALU32_IMM(BPF_AND, BPF_REG_A, 0xf);
-- /* A <<= 2 */
-- *insn++ = BPF_ALU32_IMM(BPF_LSH, BPF_REG_A, 2);
-- /* X = A */
-- *insn++ = BPF_MOV64_REG(BPF_REG_X, BPF_REG_A);
-- /* A = tmp */
-- *insn = BPF_MOV64_REG(BPF_REG_A, BPF_REG_TMP);
-- break;
--
-- /* RET_K, RET_A are remaped into 2 insns. */
-- case BPF_RET | BPF_A:
-- case BPF_RET | BPF_K:
-- *insn++ = BPF_MOV32_RAW(BPF_RVAL(fp->code) == BPF_K ?
-- BPF_K : BPF_X, BPF_REG_0,
-- BPF_REG_A, fp->k);
-- *insn = BPF_EXIT_INSN();
-- break;
--
-- /* Store to stack. */
-- case BPF_ST:
-- case BPF_STX:
-- *insn = BPF_STX_MEM(BPF_W, BPF_REG_FP, BPF_CLASS(fp->code) ==
-- BPF_ST ? BPF_REG_A : BPF_REG_X,
-- -(BPF_MEMWORDS - fp->k) * 4);
-- break;
--
-- /* Load from stack. */
-- case BPF_LD | BPF_MEM:
-- case BPF_LDX | BPF_MEM:
-- *insn = BPF_LDX_MEM(BPF_W, BPF_CLASS(fp->code) == BPF_LD ?
-- BPF_REG_A : BPF_REG_X, BPF_REG_FP,
-- -(BPF_MEMWORDS - fp->k) * 4);
-- break;
--
-- /* A = K or X = K */
-- case BPF_LD | BPF_IMM:
-- case BPF_LDX | BPF_IMM:
-- *insn = BPF_MOV32_IMM(BPF_CLASS(fp->code) == BPF_LD ?
-- BPF_REG_A : BPF_REG_X, fp->k);
-- break;
--
-- /* X = A */
-- case BPF_MISC | BPF_TAX:
-- *insn = BPF_MOV64_REG(BPF_REG_X, BPF_REG_A);
-- break;
--
-- /* A = X */
-- case BPF_MISC | BPF_TXA:
-- *insn = BPF_MOV64_REG(BPF_REG_A, BPF_REG_X);
-- break;
--
-- /* A = skb->len or X = skb->len */
-- case BPF_LD | BPF_W | BPF_LEN:
-- case BPF_LDX | BPF_W | BPF_LEN:
-- *insn = BPF_LDX_MEM(BPF_W, BPF_CLASS(fp->code) == BPF_LD ?
-- BPF_REG_A : BPF_REG_X, BPF_REG_CTX,
-- offsetof(struct sk_buff, len));
-- break;
--
-- /* Access seccomp_data fields. */
-- case BPF_LDX | BPF_ABS | BPF_W:
-- /* A = *(u32 *) (ctx + K) */
-- *insn = BPF_LDX_MEM(BPF_W, BPF_REG_A, BPF_REG_CTX, fp->k);
-- break;
--
-- /* Unkown instruction. */
-+ return 0;
-+ case BPF_S_LD_W_LEN:
-+ A = skb->len;
-+ continue;
-+ case BPF_S_LDX_W_LEN:
-+ X = skb->len;
-+ continue;
-+ case BPF_S_LD_W_IND:
-+ k = X + K;
-+ goto load_w;
-+ case BPF_S_LD_H_IND:
-+ k = X + K;
-+ goto load_h;
-+ case BPF_S_LD_B_IND:
-+ k = X + K;
-+ goto load_b;
-+ case BPF_S_LDX_B_MSH:
-+ ptr = load_pointer(skb, K, 1, &tmp);
-+ if (ptr != NULL) {
-+ X = (*(u8 *)ptr & 0xf) << 2;
-+ continue;
-+ }
-+ return 0;
-+ case BPF_S_LD_IMM:
-+ A = K;
-+ continue;
-+ case BPF_S_LDX_IMM:
-+ X = K;
-+ continue;
-+ case BPF_S_LD_MEM:
-+ A = mem[K&15];
-+ continue;
-+ case BPF_S_LDX_MEM:
-+ X = mem[K&15];
-+ continue;
-+ case BPF_S_MISC_TAX:
-+ X = A;
-+ continue;
-+ case BPF_S_MISC_TXA:
-+ A = X;
-+ continue;
-+ case BPF_S_RET_K:
-+ return K;
-+ case BPF_S_RET_A:
-+ return A;
-+ case BPF_S_ST:
-+ mem[K&15] = A;
-+ continue;
-+ case BPF_S_STX:
-+ mem[K&15] = X;
-+ continue;
-+ case BPF_S_ANC_PROTOCOL:
-+ A = ntohs(skb->protocol);
-+ continue;
-+ case BPF_S_ANC_PKTTYPE:
-+ A = skb->pkt_type;
-+ continue;
-+ case BPF_S_ANC_IFINDEX:
-+ if (!skb->dev)
-+ return 0;
-+ A = skb->dev->ifindex;
-+ continue;
-+ case BPF_S_ANC_MARK:
-+ A = skb->mark;
-+ continue;
-+ case BPF_S_ANC_QUEUE:
-+ A = skb->queue_mapping;
-+ continue;
-+ case BPF_S_ANC_HATYPE:
-+ if (!skb->dev)
-+ return 0;
-+ A = skb->dev->type;
-+ continue;
-+ case BPF_S_ANC_RXHASH:
-+ A = skb->hash;
-+ continue;
-+ case BPF_S_ANC_CPU:
-+ A = raw_smp_processor_id();
-+ continue;
-+ case BPF_S_ANC_VLAN_TAG:
-+ A = vlan_tx_tag_get(skb);
-+ continue;
-+ case BPF_S_ANC_VLAN_TAG_PRESENT:
-+ A = !!vlan_tx_tag_present(skb);
-+ continue;
-+ case BPF_S_ANC_PAY_OFFSET:
-+ A = __skb_get_poff(skb);
-+ continue;
-+ case BPF_S_ANC_NLATTR: {
-+ struct nlattr *nla;
-+
-+ if (skb_is_nonlinear(skb))
-+ return 0;
-+ if (skb->len < sizeof(struct nlattr))
-+ return 0;
-+ if (A > skb->len - sizeof(struct nlattr))
-+ return 0;
-+
-+ nla = nla_find((struct nlattr *)&skb->data[A],
-+ skb->len - A, X);
-+ if (nla)
-+ A = (void *)nla - (void *)skb->data;
-+ else
-+ A = 0;
-+ continue;
-+ }
-+ case BPF_S_ANC_NLATTR_NEST: {
-+ struct nlattr *nla;
-+
-+ if (skb_is_nonlinear(skb))
-+ return 0;
-+ if (skb->len < sizeof(struct nlattr))
-+ return 0;
-+ if (A > skb->len - sizeof(struct nlattr))
-+ return 0;
-+
-+ nla = (struct nlattr *)&skb->data[A];
-+ if (nla->nla_len > skb->len - A)
-+ return 0;
-+
-+ nla = nla_find_nested(nla, X);
-+ if (nla)
-+ A = (void *)nla - (void *)skb->data;
-+ else
-+ A = 0;
-+ continue;
-+ }
-+#ifdef CONFIG_SECCOMP_FILTER
-+ case BPF_S_ANC_SECCOMP_LD_W:
-+ A = seccomp_bpf_load(fentry->k);
-+ continue;
-+#endif
+ /* Unkown instruction. */
default:
- goto err;
+ WARN(1, KERN_ALERT "Unknown sock filter code:%u jt:%u tf:%u k:%u\n",
-+ fentry->code, fentry->jt,
-+ fentry->jf, fentry->k);
++ fp->code, fp->jt, fp->jf, fp->k);
++ kfree(addrs);
+ BUG();
-+ return 0;
++ return -EINVAL;
}
--
-- insn++;
-- if (new_prog)
-- memcpy(new_insn, tmp_insns,
-- sizeof(*insn) * (insn - tmp_insns));
-- new_insn += insn - tmp_insns;
-- }
--
-- if (!new_prog) {
-- /* Only calculating new length. */
-- *new_len = new_insn - new_prog;
-- return 0;
-- }
--
-- pass++;
-- if (new_flen != new_insn - new_prog) {
-- new_flen = new_insn - new_prog;
-- if (pass > 2)
-- goto err;
-- goto do_pass;
- }
-- kfree(addrs);
-- BUG_ON(*new_len != new_flen);
- return 0;
--err:
-- kfree(addrs);
-- return -EINVAL;
- }
-+EXPORT_SYMBOL(sk_run_filter);
-
--/* Security:
-- *
-+/*
-+ * Security :
- * A BPF program is able to use 16 cells of memory to store intermediate
-- * values (check u32 mem[BPF_MEMWORDS] in sk_run_filter()).
-- *
-+ * values (check u32 mem[BPF_MEMWORDS] in sk_run_filter())
- * As we dont want to clear mem[] array for each packet going through
- * sk_run_filter(), we check that filter loaded by user never try to read
- * a cell if not previously written, and we check all branches to be sure
-@@ -1096,46 +418,44 @@ err:
- */
- static int check_load_and_stores(struct sock_filter *filter, int flen)
- {
-- u16 *masks, memvalid = 0; /* One bit per cell, 16 cells */
-+ u16 *masks, memvalid = 0; /* one bit per cell, 16 cells */
+ insn++;
+@@ -606,7 +610,7 @@ static int check_load_and_stores(const struct sock_filter *filter, int flen)
+ u16 *masks, memvalid = 0; /* One bit per cell, 16 cells */
int pc, ret = 0;
- BUILD_BUG_ON(BPF_MEMWORDS > 16);
--
-- masks = kmalloc_array(flen, sizeof(*masks), GFP_KERNEL);
+ BUILD_BUG_ON(BPF_MEMWORDS != 16);
-+ masks = kmalloc(flen * sizeof(*masks), GFP_KERNEL);
- if (!masks)
- return -ENOMEM;
--
- memset(masks, 0xff, flen * sizeof(*masks));
- for (pc = 0; pc < flen; pc++) {
- memvalid &= masks[pc];
-
- switch (filter[pc].code) {
-- case BPF_ST:
-- case BPF_STX:
-+ case BPF_S_ST:
-+ case BPF_S_STX:
- memvalid |= (1 << filter[pc].k);
- break;
-- case BPF_LD | BPF_MEM:
-- case BPF_LDX | BPF_MEM:
-+ case BPF_S_LD_MEM:
-+ case BPF_S_LDX_MEM:
- if (!(memvalid & (1 << filter[pc].k))) {
- ret = -EINVAL;
- goto error;
- }
- break;
-- case BPF_JMP | BPF_JA:
-- /* A jump must set masks on target */
-+ case BPF_S_JMP_JA:
-+ /* a jump must set masks on target */
- masks[pc + 1 + filter[pc].k] &= memvalid;
- memvalid = ~0;
- break;
-- case BPF_JMP | BPF_JEQ | BPF_K:
-- case BPF_JMP | BPF_JEQ | BPF_X:
-- case BPF_JMP | BPF_JGE | BPF_K:
-- case BPF_JMP | BPF_JGE | BPF_X:
-- case BPF_JMP | BPF_JGT | BPF_K:
-- case BPF_JMP | BPF_JGT | BPF_X:
-- case BPF_JMP | BPF_JSET | BPF_K:
-- case BPF_JMP | BPF_JSET | BPF_X:
-- /* A jump must set masks on targets */
-+ case BPF_S_JMP_JEQ_K:
-+ case BPF_S_JMP_JEQ_X:
-+ case BPF_S_JMP_JGE_K:
-+ case BPF_S_JMP_JGE_X:
-+ case BPF_S_JMP_JGT_K:
-+ case BPF_S_JMP_JGT_X:
-+ case BPF_S_JMP_JSET_X:
-+ case BPF_S_JMP_JSET_K:
-+ /* a jump must set masks on targets */
- masks[pc + 1 + filter[pc].jt] &= memvalid;
- masks[pc + 1 + filter[pc].jf] &= memvalid;
- memvalid = ~0;
-@@ -1147,72 +467,6 @@ error:
- return ret;
- }
-
--static bool chk_code_allowed(u16 code_to_probe)
--{
-- static const bool codes[] = {
-- /* 32 bit ALU operations */
-- [BPF_ALU | BPF_ADD | BPF_K] = true,
-- [BPF_ALU | BPF_ADD | BPF_X] = true,
-- [BPF_ALU | BPF_SUB | BPF_K] = true,
-- [BPF_ALU | BPF_SUB | BPF_X] = true,
-- [BPF_ALU | BPF_MUL | BPF_K] = true,
-- [BPF_ALU | BPF_MUL | BPF_X] = true,
-- [BPF_ALU | BPF_DIV | BPF_K] = true,
-- [BPF_ALU | BPF_DIV | BPF_X] = true,
-- [BPF_ALU | BPF_MOD | BPF_K] = true,
-- [BPF_ALU | BPF_MOD | BPF_X] = true,
-- [BPF_ALU | BPF_AND | BPF_K] = true,
-- [BPF_ALU | BPF_AND | BPF_X] = true,
-- [BPF_ALU | BPF_OR | BPF_K] = true,
-- [BPF_ALU | BPF_OR | BPF_X] = true,
-- [BPF_ALU | BPF_XOR | BPF_K] = true,
-- [BPF_ALU | BPF_XOR | BPF_X] = true,
-- [BPF_ALU | BPF_LSH | BPF_K] = true,
-- [BPF_ALU | BPF_LSH | BPF_X] = true,
-- [BPF_ALU | BPF_RSH | BPF_K] = true,
-- [BPF_ALU | BPF_RSH | BPF_X] = true,
-- [BPF_ALU | BPF_NEG] = true,
-- /* Load instructions */
-- [BPF_LD | BPF_W | BPF_ABS] = true,
-- [BPF_LD | BPF_H | BPF_ABS] = true,
-- [BPF_LD | BPF_B | BPF_ABS] = true,
-- [BPF_LD | BPF_W | BPF_LEN] = true,
-- [BPF_LD | BPF_W | BPF_IND] = true,
-- [BPF_LD | BPF_H | BPF_IND] = true,
-- [BPF_LD | BPF_B | BPF_IND] = true,
-- [BPF_LD | BPF_IMM] = true,
-- [BPF_LD | BPF_MEM] = true,
-- [BPF_LDX | BPF_W | BPF_LEN] = true,
-- [BPF_LDX | BPF_B | BPF_MSH] = true,
-- [BPF_LDX | BPF_IMM] = true,
-- [BPF_LDX | BPF_MEM] = true,
-- /* Store instructions */
-- [BPF_ST] = true,
-- [BPF_STX] = true,
-- /* Misc instructions */
-- [BPF_MISC | BPF_TAX] = true,
-- [BPF_MISC | BPF_TXA] = true,
-- /* Return instructions */
-- [BPF_RET | BPF_K] = true,
-- [BPF_RET | BPF_A] = true,
-- /* Jump instructions */
-- [BPF_JMP | BPF_JA] = true,
-- [BPF_JMP | BPF_JEQ | BPF_K] = true,
-- [BPF_JMP | BPF_JEQ | BPF_X] = true,
-- [BPF_JMP | BPF_JGE | BPF_K] = true,
-- [BPF_JMP | BPF_JGE | BPF_X] = true,
-- [BPF_JMP | BPF_JGT | BPF_K] = true,
-- [BPF_JMP | BPF_JGT | BPF_X] = true,
-- [BPF_JMP | BPF_JSET | BPF_K] = true,
-- [BPF_JMP | BPF_JSET | BPF_X] = true,
-- };
--
-- if (code_to_probe >= ARRAY_SIZE(codes))
-- return false;
--
-- return codes[code_to_probe];
--}
--
- /**
- * sk_chk_filter - verify socket filter code
- * @filter: filter to verify
-@@ -1229,303 +483,187 @@ static bool chk_code_allowed(u16 code_to_probe)
- */
- int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
- {
-- bool anc_found;
-+ /*
-+ * Valid instructions are initialized to non-0.
-+ * Invalid instructions are initialized to 0.
-+ */
-+ static const u8 codes[] = {
-+ [BPF_ALU|BPF_ADD|BPF_K] = BPF_S_ALU_ADD_K,
-+ [BPF_ALU|BPF_ADD|BPF_X] = BPF_S_ALU_ADD_X,
-+ [BPF_ALU|BPF_SUB|BPF_K] = BPF_S_ALU_SUB_K,
-+ [BPF_ALU|BPF_SUB|BPF_X] = BPF_S_ALU_SUB_X,
-+ [BPF_ALU|BPF_MUL|BPF_K] = BPF_S_ALU_MUL_K,
-+ [BPF_ALU|BPF_MUL|BPF_X] = BPF_S_ALU_MUL_X,
-+ [BPF_ALU|BPF_DIV|BPF_X] = BPF_S_ALU_DIV_X,
-+ [BPF_ALU|BPF_MOD|BPF_K] = BPF_S_ALU_MOD_K,
-+ [BPF_ALU|BPF_MOD|BPF_X] = BPF_S_ALU_MOD_X,
-+ [BPF_ALU|BPF_AND|BPF_K] = BPF_S_ALU_AND_K,
-+ [BPF_ALU|BPF_AND|BPF_X] = BPF_S_ALU_AND_X,
-+ [BPF_ALU|BPF_OR|BPF_K] = BPF_S_ALU_OR_K,
-+ [BPF_ALU|BPF_OR|BPF_X] = BPF_S_ALU_OR_X,
-+ [BPF_ALU|BPF_XOR|BPF_K] = BPF_S_ALU_XOR_K,
-+ [BPF_ALU|BPF_XOR|BPF_X] = BPF_S_ALU_XOR_X,
-+ [BPF_ALU|BPF_LSH|BPF_K] = BPF_S_ALU_LSH_K,
-+ [BPF_ALU|BPF_LSH|BPF_X] = BPF_S_ALU_LSH_X,
-+ [BPF_ALU|BPF_RSH|BPF_K] = BPF_S_ALU_RSH_K,
-+ [BPF_ALU|BPF_RSH|BPF_X] = BPF_S_ALU_RSH_X,
-+ [BPF_ALU|BPF_NEG] = BPF_S_ALU_NEG,
-+ [BPF_LD|BPF_W|BPF_ABS] = BPF_S_LD_W_ABS,
-+ [BPF_LD|BPF_H|BPF_ABS] = BPF_S_LD_H_ABS,
-+ [BPF_LD|BPF_B|BPF_ABS] = BPF_S_LD_B_ABS,
-+ [BPF_LD|BPF_W|BPF_LEN] = BPF_S_LD_W_LEN,
-+ [BPF_LD|BPF_W|BPF_IND] = BPF_S_LD_W_IND,
-+ [BPF_LD|BPF_H|BPF_IND] = BPF_S_LD_H_IND,
-+ [BPF_LD|BPF_B|BPF_IND] = BPF_S_LD_B_IND,
-+ [BPF_LD|BPF_IMM] = BPF_S_LD_IMM,
-+ [BPF_LDX|BPF_W|BPF_LEN] = BPF_S_LDX_W_LEN,
-+ [BPF_LDX|BPF_B|BPF_MSH] = BPF_S_LDX_B_MSH,
-+ [BPF_LDX|BPF_IMM] = BPF_S_LDX_IMM,
-+ [BPF_MISC|BPF_TAX] = BPF_S_MISC_TAX,
-+ [BPF_MISC|BPF_TXA] = BPF_S_MISC_TXA,
-+ [BPF_RET|BPF_K] = BPF_S_RET_K,
-+ [BPF_RET|BPF_A] = BPF_S_RET_A,
-+ [BPF_ALU|BPF_DIV|BPF_K] = BPF_S_ALU_DIV_K,
-+ [BPF_LD|BPF_MEM] = BPF_S_LD_MEM,
-+ [BPF_LDX|BPF_MEM] = BPF_S_LDX_MEM,
-+ [BPF_ST] = BPF_S_ST,
-+ [BPF_STX] = BPF_S_STX,
-+ [BPF_JMP|BPF_JA] = BPF_S_JMP_JA,
-+ [BPF_JMP|BPF_JEQ|BPF_K] = BPF_S_JMP_JEQ_K,
-+ [BPF_JMP|BPF_JEQ|BPF_X] = BPF_S_JMP_JEQ_X,
-+ [BPF_JMP|BPF_JGE|BPF_K] = BPF_S_JMP_JGE_K,
-+ [BPF_JMP|BPF_JGE|BPF_X] = BPF_S_JMP_JGE_X,
-+ [BPF_JMP|BPF_JGT|BPF_K] = BPF_S_JMP_JGT_K,
-+ [BPF_JMP|BPF_JGT|BPF_X] = BPF_S_JMP_JGT_X,
-+ [BPF_JMP|BPF_JSET|BPF_K] = BPF_S_JMP_JSET_K,
-+ [BPF_JMP|BPF_JSET|BPF_X] = BPF_S_JMP_JSET_X,
-+ };
- int pc;
-+ bool anc_found;
-
- if (flen == 0 || flen > BPF_MAXINSNS)
+ masks = kmalloc_array(flen, sizeof(*masks), GFP_KERNEL);
+ if (!masks)
+@@ -933,7 +937,7 @@ static struct bpf_prog *bpf_migrate_filter(struct bpf_prog *fp)
+
+ /* Expand fp for appending the new filter representation. */
+ old_fp = fp;
+- fp = krealloc(old_fp, bpf_prog_size(new_len), GFP_KERNEL);
++ fp = bpf_prog_realloc(old_fp, bpf_prog_size(new_len), 0);
+ if (!fp) {
+ /* The old_fp is still around in case we couldn't
+ * allocate new memory, so uncharge on that one.
+@@ -1013,11 +1017,11 @@ int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog)
+ if (fprog->filter == NULL)
return -EINVAL;
-- /* Check the filter code now */
-+ /* check the filter code now */
- for (pc = 0; pc < flen; pc++) {
- struct sock_filter *ftest = &filter[pc];
-+ u16 code = ftest->code;
-
-- /* May we actually operate on this code? */
-- if (!chk_code_allowed(ftest->code))
-+ if (code >= ARRAY_SIZE(codes))
-+ return -EINVAL;
-+ code = codes[code];
-+ if (!code)
- return -EINVAL;
--
- /* Some instructions need special checks */
-- switch (ftest->code) {
-- case BPF_ALU | BPF_DIV | BPF_K:
-- case BPF_ALU | BPF_MOD | BPF_K:
-- /* Check for division by zero */
-+ switch (code) {
-+ case BPF_S_ALU_DIV_K:
-+ case BPF_S_ALU_MOD_K:
-+ /* check for division by zero */
- if (ftest->k == 0)
- return -EINVAL;
- break;
-- case BPF_LD | BPF_MEM:
-- case BPF_LDX | BPF_MEM:
-- case BPF_ST:
-- case BPF_STX:
-- /* Check for invalid memory addresses */
-+ case BPF_S_LD_MEM:
-+ case BPF_S_LDX_MEM:
-+ case BPF_S_ST:
-+ case BPF_S_STX:
-+ /* check for invalid memory addresses */
- if (ftest->k >= BPF_MEMWORDS)
- return -EINVAL;
- break;
-- case BPF_JMP | BPF_JA:
-- /* Note, the large ftest->k might cause loops.
-+ case BPF_S_JMP_JA:
-+ /*
-+ * Note, the large ftest->k might cause loops.
- * Compare this with conditional jumps below,
- * where offsets are limited. --ANK (981016)
- */
-- if (ftest->k >= (unsigned int)(flen - pc - 1))
-+ if (ftest->k >= (unsigned int)(flen-pc-1))
- return -EINVAL;
- break;
-- case BPF_JMP | BPF_JEQ | BPF_K:
-- case BPF_JMP | BPF_JEQ | BPF_X:
-- case BPF_JMP | BPF_JGE | BPF_K:
-- case BPF_JMP | BPF_JGE | BPF_X:
-- case BPF_JMP | BPF_JGT | BPF_K:
-- case BPF_JMP | BPF_JGT | BPF_X:
-- case BPF_JMP | BPF_JSET | BPF_K:
-- case BPF_JMP | BPF_JSET | BPF_X:
-- /* Both conditionals must be safe */
-+ case BPF_S_JMP_JEQ_K:
-+ case BPF_S_JMP_JEQ_X:
-+ case BPF_S_JMP_JGE_K:
-+ case BPF_S_JMP_JGE_X:
-+ case BPF_S_JMP_JGT_K:
-+ case BPF_S_JMP_JGT_X:
-+ case BPF_S_JMP_JSET_X:
-+ case BPF_S_JMP_JSET_K:
-+ /* for conditionals both must be safe */
- if (pc + ftest->jt + 1 >= flen ||
- pc + ftest->jf + 1 >= flen)
- return -EINVAL;
- break;
-- case BPF_LD | BPF_W | BPF_ABS:
-- case BPF_LD | BPF_H | BPF_ABS:
-- case BPF_LD | BPF_B | BPF_ABS:
-+ case BPF_S_LD_W_ABS:
-+ case BPF_S_LD_H_ABS:
-+ case BPF_S_LD_B_ABS:
- anc_found = false;
-- if (bpf_anc_helper(ftest) & BPF_ANC)
-- anc_found = true;
-- /* Ancillary operation unknown or unsupported */
-+#define ANCILLARY(CODE) case SKF_AD_OFF + SKF_AD_##CODE: \
-+ code = BPF_S_ANC_##CODE; \
-+ anc_found = true; \
-+ break
-+ switch (ftest->k) {
-+ ANCILLARY(PROTOCOL);
-+ ANCILLARY(PKTTYPE);
-+ ANCILLARY(IFINDEX);
-+ ANCILLARY(NLATTR);
-+ ANCILLARY(NLATTR_NEST);
-+ ANCILLARY(MARK);
-+ ANCILLARY(QUEUE);
-+ ANCILLARY(HATYPE);
-+ ANCILLARY(RXHASH);
-+ ANCILLARY(CPU);
-+ ANCILLARY(ALU_XOR_X);
-+ ANCILLARY(VLAN_TAG);
-+ ANCILLARY(VLAN_TAG_PRESENT);
-+ ANCILLARY(PAY_OFFSET);
-+ }
-+
-+ /* ancillary operation unknown or unsupported */
- if (anc_found == false && ftest->k >= SKF_AD_OFF)
- return -EINVAL;
- }
-+ ftest->code = code;
- }
-
-- /* Last instruction must be a RET code */
-+ /* last instruction must be a RET code */
- switch (filter[flen - 1].code) {
-- case BPF_RET | BPF_K:
-- case BPF_RET | BPF_A:
-+ case BPF_S_RET_K:
-+ case BPF_S_RET_A:
- return check_load_and_stores(filter, flen);
- }
--
- return -EINVAL;
- }
- EXPORT_SYMBOL(sk_chk_filter);
-
--static int sk_store_orig_filter(struct sk_filter *fp,
-- const struct sock_fprog *fprog)
--{
-- unsigned int fsize = sk_filter_proglen(fprog);
-- struct sock_fprog_kern *fkprog;
--
-- fp->orig_prog = kmalloc(sizeof(*fkprog), GFP_KERNEL);
-- if (!fp->orig_prog)
-- return -ENOMEM;
--
-- fkprog = fp->orig_prog;
-- fkprog->len = fprog->len;
-- fkprog->filter = kmemdup(fp->insns, fsize, GFP_KERNEL);
-- if (!fkprog->filter) {
-- kfree(fp->orig_prog);
-- return -ENOMEM;
-- }
--
-- return 0;
--}
--
--static void sk_release_orig_filter(struct sk_filter *fp)
--{
-- struct sock_fprog_kern *fprog = fp->orig_prog;
--
-- if (fprog) {
-- kfree(fprog->filter);
-- kfree(fprog);
-- }
--}
--
- /**
- * sk_filter_release_rcu - Release a socket filter by rcu_head
- * @rcu: rcu_head that contains the sk_filter to free
- */
--static void sk_filter_release_rcu(struct rcu_head *rcu)
-+void sk_filter_release_rcu(struct rcu_head *rcu)
- {
- struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
-
-- sk_release_orig_filter(fp);
-- sk_filter_free(fp);
--}
--
--/**
-- * sk_filter_release - release a socket filter
-- * @fp: filter to remove
-- *
-- * Remove a filter from a socket and release its resources.
-- */
--static void sk_filter_release(struct sk_filter *fp)
--{
-- if (atomic_dec_and_test(&fp->refcnt))
-- call_rcu(&fp->rcu, sk_filter_release_rcu);
--}
--
--void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
--{
-- atomic_sub(sk_filter_size(fp->len), &sk->sk_omem_alloc);
-- sk_filter_release(fp);
--}
--
--void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
--{
-- atomic_inc(&fp->refcnt);
-- atomic_add(sk_filter_size(fp->len), &sk->sk_omem_alloc);
--}
--
--static struct sk_filter *__sk_migrate_realloc(struct sk_filter *fp,
-- struct sock *sk,
-- unsigned int len)
--{
-- struct sk_filter *fp_new;
--
-- if (sk == NULL)
-- return krealloc(fp, len, GFP_KERNEL);
--
-- fp_new = sock_kmalloc(sk, len, GFP_KERNEL);
-- if (fp_new) {
-- *fp_new = *fp;
-- /* As we're keeping orig_prog in fp_new along,
-- * we need to make sure we're not evicting it
-- * from the old fp.
-- */
-- fp->orig_prog = NULL;
-- sk_filter_uncharge(sk, fp);
-- }
--
-- return fp_new;
--}
--
--static struct sk_filter *__sk_migrate_filter(struct sk_filter *fp,
-- struct sock *sk)
--{
-- struct sock_filter *old_prog;
-- struct sk_filter *old_fp;
-- int err, new_len, old_len = fp->len;
--
-- /* We are free to overwrite insns et al right here as it
-- * won't be used at this point in time anymore internally
-- * after the migration to the internal BPF instruction
-- * representation.
-- */
-- BUILD_BUG_ON(sizeof(struct sock_filter) !=
-- sizeof(struct sock_filter_int));
--
-- /* Conversion cannot happen on overlapping memory areas,
-- * so we need to keep the user BPF around until the 2nd
-- * pass. At this time, the user BPF is stored in fp->insns.
-- */
-- old_prog = kmemdup(fp->insns, old_len * sizeof(struct sock_filter),
-- GFP_KERNEL);
-- if (!old_prog) {
-- err = -ENOMEM;
-- goto out_err;
-- }
--
-- /* 1st pass: calculate the new program length. */
-- err = sk_convert_filter(old_prog, old_len, NULL, &new_len);
-- if (err)
-- goto out_err_free;
--
-- /* Expand fp for appending the new filter representation. */
-- old_fp = fp;
-- fp = __sk_migrate_realloc(old_fp, sk, sk_filter_size(new_len));
-- if (!fp) {
-- /* The old_fp is still around in case we couldn't
-- * allocate new memory, so uncharge on that one.
-- */
-- fp = old_fp;
-- err = -ENOMEM;
-- goto out_err_free;
-- }
--
-- fp->len = new_len;
--
-- /* 2nd pass: remap sock_filter insns into sock_filter_int insns. */
-- err = sk_convert_filter(old_prog, old_len, fp->insnsi, &new_len);
-- if (err)
-- /* 2nd sk_convert_filter() can fail only if it fails
-- * to allocate memory, remapping must succeed. Note,
-- * that at this time old_fp has already been released
-- * by __sk_migrate_realloc().
-- */
-- goto out_err_free;
--
-- sk_filter_select_runtime(fp);
--
-- kfree(old_prog);
-- return fp;
--
--out_err_free:
-- kfree(old_prog);
--out_err:
-- /* Rollback filter setup. */
-- if (sk != NULL)
-- sk_filter_uncharge(sk, fp);
-- else
-- kfree(fp);
-- return ERR_PTR(err);
--}
--
--void __weak bpf_int_jit_compile(struct sk_filter *prog)
--{
--}
--
--/**
-- * sk_filter_select_runtime - select execution runtime for BPF program
-- * @fp: sk_filter populated with internal BPF program
-- *
-- * try to JIT internal BPF program, if JIT is not available select interpreter
-- * BPF program will be executed via SK_RUN_FILTER() macro
-- */
--void sk_filter_select_runtime(struct sk_filter *fp)
--{
-- fp->bpf_func = (void *) __sk_run_filter;
--
-- /* Probe if internal BPF can be JITed */
-- bpf_int_jit_compile(fp);
--}
--EXPORT_SYMBOL_GPL(sk_filter_select_runtime);
--
--/* free internal BPF program */
--void sk_filter_free(struct sk_filter *fp)
--{
- bpf_jit_free(fp);
- }
--EXPORT_SYMBOL_GPL(sk_filter_free);
-+EXPORT_SYMBOL(sk_filter_release_rcu);
-
--static struct sk_filter *__sk_prepare_filter(struct sk_filter *fp,
-- struct sock *sk)
-+static int __sk_prepare_filter(struct sk_filter *fp)
- {
- int err;
-
-- fp->bpf_func = NULL;
-- fp->jited = 0;
-+ fp->bpf_func = sk_run_filter;
-
- err = sk_chk_filter(fp->insns, fp->len);
-- if (err) {
-- if (sk != NULL)
-- sk_filter_uncharge(sk, fp);
-- else
-- kfree(fp);
-- return ERR_PTR(err);
-- }
-+ if (err)
-+ return err;
-
-- /* Probe if we can JIT compile the filter and if so, do
-- * the compilation of the filter.
-- */
- bpf_jit_compile(fp);
--
-- /* JIT compiler couldn't process this filter, so do the
-- * internal BPF translation for the optimized interpreter.
-- */
-- if (!fp->jited)
-- fp = __sk_migrate_filter(fp, sk);
--
-- return fp;
-+ return 0;
- }
-
- /**
- * sk_unattached_filter_create - create an unattached filter
-+ * @fprog: the filter program
- * @pfp: the unattached filter that is created
-- * @fprog: the filter program
- *
- * Create a filter independent of any socket. We first run some
- * sanity checks on it to make sure it does not explode on us later.
-@@ -1533,10 +671,11 @@ static struct sk_filter *__sk_prepare_filter(struct sk_filter *fp,
- * a negative errno code is returned. On success the return is zero.
- */
- int sk_unattached_filter_create(struct sk_filter **pfp,
-- struct sock_fprog_kern *fprog)
-+ struct sock_fprog *fprog)
- {
-- unsigned int fsize = sk_filter_proglen(fprog);
- struct sk_filter *fp;
-+ unsigned int fsize = sizeof(struct sock_filter) * fprog->len;
-+ int err;
-
- /* Make sure new filter is there and in the right amounts. */
- if (fprog->filter == NULL)
-@@ -1545,26 +684,20 @@ int sk_unattached_filter_create(struct sk_filter **pfp,
- fp = kmalloc(sk_filter_size(fprog->len), GFP_KERNEL);
+- fp = kmalloc(bpf_prog_size(fprog->len), GFP_KERNEL);
++ fp = bpf_prog_alloc(bpf_prog_size(fprog->len), 0);
if (!fp)
return -ENOMEM;
--
+
- memcpy(fp->insns, fprog->filter, fsize);
+ memcpy(fp->insns, (void __force_kernel *)fprog->filter, fsize);
- atomic_set(&fp->refcnt, 1);
fp->len = fprog->len;
-- /* Since unattached filters are not copied back to user
-- * space through sk_get_filter(), we do not need to hold
-- * a copy here, and can spare us the work.
-- */
-- fp->orig_prog = NULL;
-
-- /* __sk_prepare_filter() already takes care of uncharging
-- * memory in case something goes wrong.
-- */
-- fp = __sk_prepare_filter(fp, NULL);
-- if (IS_ERR(fp))
-- return PTR_ERR(fp);
-+ err = __sk_prepare_filter(fp);
-+ if (err)
-+ goto free_mem;
-
- *pfp = fp;
- return 0;
-+free_mem:
-+ kfree(fp);
-+ return err;
- }
- EXPORT_SYMBOL_GPL(sk_unattached_filter_create);
-
-@@ -1587,7 +720,7 @@ EXPORT_SYMBOL_GPL(sk_unattached_filter_destroy);
- int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
- {
- struct sk_filter *fp, *old_fp;
-- unsigned int fsize = sk_filter_proglen(fprog);
-+ unsigned int fsize = sizeof(struct sock_filter) * fprog->len;
- unsigned int sk_fsize = sk_filter_size(fprog->len);
- int err;
+ /* Since unattached filters are not copied back to user
+@@ -1069,12 +1073,12 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
+ if (fprog->filter == NULL)
+ return -EINVAL;
-@@ -1601,7 +734,6 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
- fp = sock_kmalloc(sk, sk_fsize, GFP_KERNEL);
- if (!fp)
+- prog = kmalloc(bpf_fsize, GFP_KERNEL);
++ prog = bpf_prog_alloc(bpf_fsize, 0);
+ if (!prog)
return -ENOMEM;
--
- if (copy_from_user(fp->insns, fprog->filter, fsize)) {
- sock_kfree_s(sk, fp, sk_fsize);
- return -EFAULT;
-@@ -1610,26 +742,18 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
- atomic_set(&fp->refcnt, 1);
- fp->len = fprog->len;
-- err = sk_store_orig_filter(fp, fprog);
-+ err = __sk_prepare_filter(fp);
- if (err) {
- sk_filter_uncharge(sk, fp);
-- return -ENOMEM;
-+ return err;
+ if (copy_from_user(prog->insns, fprog->filter, fsize)) {
+- kfree(prog);
++ __bpf_prog_free(prog);
+ return -EFAULT;
}
-- /* __sk_prepare_filter() already takes care of uncharging
-- * memory in case something goes wrong.
-- */
-- fp = __sk_prepare_filter(fp, sk);
-- if (IS_ERR(fp))
-- return PTR_ERR(fp);
--
- old_fp = rcu_dereference_protected(sk->sk_filter,
- sock_owned_by_user(sk));
- rcu_assign_pointer(sk->sk_filter, fp);
+@@ -1082,7 +1086,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
- if (old_fp)
- sk_filter_uncharge(sk, old_fp);
--
- return 0;
- }
- EXPORT_SYMBOL_GPL(sk_attach_filter);
-@@ -1649,46 +773,116 @@ int sk_detach_filter(struct sock *sk)
- sk_filter_uncharge(sk, filter);
- ret = 0;
+ err = bpf_prog_store_orig_filter(prog, fprog);
+ if (err) {
+- kfree(prog);
++ __bpf_prog_free(prog);
+ return -ENOMEM;
}
--
- return ret;
- }
- EXPORT_SYMBOL_GPL(sk_detach_filter);
-
--int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf,
-- unsigned int len)
-+void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to)
-+{
-+ static const u16 decodes[] = {
-+ [BPF_S_ALU_ADD_K] = BPF_ALU|BPF_ADD|BPF_K,
-+ [BPF_S_ALU_ADD_X] = BPF_ALU|BPF_ADD|BPF_X,
-+ [BPF_S_ALU_SUB_K] = BPF_ALU|BPF_SUB|BPF_K,
-+ [BPF_S_ALU_SUB_X] = BPF_ALU|BPF_SUB|BPF_X,
-+ [BPF_S_ALU_MUL_K] = BPF_ALU|BPF_MUL|BPF_K,
-+ [BPF_S_ALU_MUL_X] = BPF_ALU|BPF_MUL|BPF_X,
-+ [BPF_S_ALU_DIV_X] = BPF_ALU|BPF_DIV|BPF_X,
-+ [BPF_S_ALU_MOD_K] = BPF_ALU|BPF_MOD|BPF_K,
-+ [BPF_S_ALU_MOD_X] = BPF_ALU|BPF_MOD|BPF_X,
-+ [BPF_S_ALU_AND_K] = BPF_ALU|BPF_AND|BPF_K,
-+ [BPF_S_ALU_AND_X] = BPF_ALU|BPF_AND|BPF_X,
-+ [BPF_S_ALU_OR_K] = BPF_ALU|BPF_OR|BPF_K,
-+ [BPF_S_ALU_OR_X] = BPF_ALU|BPF_OR|BPF_X,
-+ [BPF_S_ALU_XOR_K] = BPF_ALU|BPF_XOR|BPF_K,
-+ [BPF_S_ALU_XOR_X] = BPF_ALU|BPF_XOR|BPF_X,
-+ [BPF_S_ALU_LSH_K] = BPF_ALU|BPF_LSH|BPF_K,
-+ [BPF_S_ALU_LSH_X] = BPF_ALU|BPF_LSH|BPF_X,
-+ [BPF_S_ALU_RSH_K] = BPF_ALU|BPF_RSH|BPF_K,
-+ [BPF_S_ALU_RSH_X] = BPF_ALU|BPF_RSH|BPF_X,
-+ [BPF_S_ALU_NEG] = BPF_ALU|BPF_NEG,
-+ [BPF_S_LD_W_ABS] = BPF_LD|BPF_W|BPF_ABS,
-+ [BPF_S_LD_H_ABS] = BPF_LD|BPF_H|BPF_ABS,
-+ [BPF_S_LD_B_ABS] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_PROTOCOL] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_PKTTYPE] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_IFINDEX] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_NLATTR] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_NLATTR_NEST] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_MARK] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_QUEUE] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_HATYPE] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_RXHASH] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_CPU] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_ALU_XOR_X] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_SECCOMP_LD_W] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_VLAN_TAG] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_VLAN_TAG_PRESENT] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_ANC_PAY_OFFSET] = BPF_LD|BPF_B|BPF_ABS,
-+ [BPF_S_LD_W_LEN] = BPF_LD|BPF_W|BPF_LEN,
-+ [BPF_S_LD_W_IND] = BPF_LD|BPF_W|BPF_IND,
-+ [BPF_S_LD_H_IND] = BPF_LD|BPF_H|BPF_IND,
-+ [BPF_S_LD_B_IND] = BPF_LD|BPF_B|BPF_IND,
-+ [BPF_S_LD_IMM] = BPF_LD|BPF_IMM,
-+ [BPF_S_LDX_W_LEN] = BPF_LDX|BPF_W|BPF_LEN,
-+ [BPF_S_LDX_B_MSH] = BPF_LDX|BPF_B|BPF_MSH,
-+ [BPF_S_LDX_IMM] = BPF_LDX|BPF_IMM,
-+ [BPF_S_MISC_TAX] = BPF_MISC|BPF_TAX,
-+ [BPF_S_MISC_TXA] = BPF_MISC|BPF_TXA,
-+ [BPF_S_RET_K] = BPF_RET|BPF_K,
-+ [BPF_S_RET_A] = BPF_RET|BPF_A,
-+ [BPF_S_ALU_DIV_K] = BPF_ALU|BPF_DIV|BPF_K,
-+ [BPF_S_LD_MEM] = BPF_LD|BPF_MEM,
-+ [BPF_S_LDX_MEM] = BPF_LDX|BPF_MEM,
-+ [BPF_S_ST] = BPF_ST,
-+ [BPF_S_STX] = BPF_STX,
-+ [BPF_S_JMP_JA] = BPF_JMP|BPF_JA,
-+ [BPF_S_JMP_JEQ_K] = BPF_JMP|BPF_JEQ|BPF_K,
-+ [BPF_S_JMP_JEQ_X] = BPF_JMP|BPF_JEQ|BPF_X,
-+ [BPF_S_JMP_JGE_K] = BPF_JMP|BPF_JGE|BPF_K,
-+ [BPF_S_JMP_JGE_X] = BPF_JMP|BPF_JGE|BPF_X,
-+ [BPF_S_JMP_JGT_K] = BPF_JMP|BPF_JGT|BPF_K,
-+ [BPF_S_JMP_JGT_X] = BPF_JMP|BPF_JGT|BPF_X,
-+ [BPF_S_JMP_JSET_K] = BPF_JMP|BPF_JSET|BPF_K,
-+ [BPF_S_JMP_JSET_X] = BPF_JMP|BPF_JSET|BPF_X,
-+ };
-+ u16 code;
-+
-+ code = filt->code;
-+
-+ to->code = decodes[code];
-+ to->jt = filt->jt;
-+ to->jf = filt->jf;
-+ to->k = filt->k;
-+}
-+
-+int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf, unsigned int len)
- {
-- struct sock_fprog_kern *fprog;
- struct sk_filter *filter;
-- int ret = 0;
-+ int i, ret;
-
- lock_sock(sk);
- filter = rcu_dereference_protected(sk->sk_filter,
-- sock_owned_by_user(sk));
-+ sock_owned_by_user(sk));
-+ ret = 0;
- if (!filter)
- goto out;
--
-- /* We're copying the filter that has been originally attached,
-- * so no conversion/decode needed anymore.
-- */
-- fprog = filter->orig_prog;
--
-- ret = fprog->len;
-+ ret = filter->len;
- if (!len)
-- /* User space only enquires number of filter blocks. */
- goto out;
--
- ret = -EINVAL;
-- if (len < fprog->len)
-+ if (len < filter->len)
- goto out;
- ret = -EFAULT;
-- if (copy_to_user(ubuf, fprog->filter, sk_filter_proglen(fprog)))
-- goto out;
-+ for (i = 0; i < filter->len; i++) {
-+ struct sock_filter fb;
-
-- /* Instead of bytes, the API requests to return the number
-- * of filter blocks.
-- */
-- ret = fprog->len;
-+ sk_decode_filter(&filter->insns[i], &fb);
-+ if (copy_to_user(&ubuf[i], &fb, sizeof(fb)))
-+ goto out;
-+ }
-+
-+ ret = filter->len;
- out:
- release_sock(sk);
- return ret;
diff --git a/net/core/flow.c b/net/core/flow.c
index a0348fd..6951c76 100644
--- a/net/core/flow.c
return 0;
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
-index 1cac29e..fb482f3 100644
+index 9dd0669..c52fb1b 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
-@@ -259,7 +259,7 @@ static ssize_t carrier_changes_show(struct device *dev,
+@@ -278,7 +278,7 @@ static ssize_t carrier_changes_show(struct device *dev,
{
struct net_device *netdev = to_net_dev(dev);
return sprintf(buf, fmt_dec,
static DEVICE_ATTR_RO(carrier_changes);
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
-index 85b6269..fc77ea0 100644
+index 7c6b51a..e9dd57f 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
-@@ -443,7 +443,7 @@ static int __register_pernet_operations(struct list_head *list,
+@@ -445,7 +445,7 @@ static int __register_pernet_operations(struct list_head *list,
int error;
LIST_HEAD(net_exit_list);
if (ops->init || (ops->id && ops->size)) {
for_each_net(net) {
error = ops_init(ops, net);
-@@ -456,7 +456,7 @@ static int __register_pernet_operations(struct list_head *list,
+@@ -458,7 +458,7 @@ static int __register_pernet_operations(struct list_head *list,
out_undo:
/* If I have an error cleanup all namespaces I initialized */
ops_exit_list(ops, &net_exit_list);
ops_free_list(ops, &net_exit_list);
return error;
-@@ -467,7 +467,7 @@ static void __unregister_pernet_operations(struct pernet_operations *ops)
+@@ -469,7 +469,7 @@ static void __unregister_pernet_operations(struct pernet_operations *ops)
struct net *net;
LIST_HEAD(net_exit_list);
for_each_net(net)
list_add_tail(&net->exit_list, &net_exit_list);
ops_exit_list(ops, &net_exit_list);
-@@ -601,7 +601,7 @@ int register_pernet_device(struct pernet_operations *ops)
+@@ -603,7 +603,7 @@ int register_pernet_device(struct pernet_operations *ops)
mutex_lock(&net_mutex);
error = register_pernet_operations(&pernet_list, ops);
if (!error && (first_device == &pernet_list))
return error;
}
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
-index e33937f..b2b4981 100644
+index 907fb5e..8260f040b 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -382,7 +382,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
iph->ttl = 64;
iph->protocol = IPPROTO_UDP;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
-index fc17a9d..d4a3d88 100644
+index 8b849dd..cd88bfc 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
-@@ -3725,7 +3725,7 @@ static int __net_init pg_net_init(struct net *net)
+@@ -3723,7 +3723,7 @@ static int __net_init pg_net_init(struct net *net)
pn->net = net;
INIT_LIST_HEAD(&pn->pktgen_threads);
pn->pktgen_exiting = false;
if (!pn->proc_dir) {
pr_warn("cannot create /proc/net/%s\n", PG_PROC_DIR);
return -ENODEV;
-diff --git a/net/core/ptp_classifier.c b/net/core/ptp_classifier.c
-deleted file mode 100644
-index d3027a7..0000000
---- a/net/core/ptp_classifier.c
-+++ /dev/null
-@@ -1,141 +0,0 @@
--/* PTP classifier
-- *
-- * This program is free software; you can redistribute it and/or
-- * modify it under the terms of version 2 of the GNU General Public
-- * License as published by the Free Software Foundation.
-- *
-- * This program is distributed in the hope that it will be useful, but
-- * WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * General Public License for more details.
-- */
--
--/* The below program is the bpf_asm (tools/net/) representation of
-- * the opcode array in the ptp_filter structure.
-- *
-- * For convenience, this can easily be altered and reviewed with
-- * bpf_asm and bpf_dbg, e.g. `./bpf_asm -c prog` where prog is a
-- * simple file containing the below program:
-- *
-- * ldh [12] ; load ethertype
-- *
-- * ; PTP over UDP over IPv4 over Ethernet
-- * test_ipv4:
-- * jneq #0x800, test_ipv6 ; ETH_P_IP ?
-- * ldb [23] ; load proto
-- * jneq #17, drop_ipv4 ; IPPROTO_UDP ?
-- * ldh [20] ; load frag offset field
-- * jset #0x1fff, drop_ipv4 ; don't allow fragments
-- * ldxb 4*([14]&0xf) ; load IP header len
-- * ldh [x + 16] ; load UDP dst port
-- * jneq #319, drop_ipv4 ; is port PTP_EV_PORT ?
-- * ldh [x + 22] ; load payload
-- * and #0xf ; mask PTP_CLASS_VMASK
-- * or #0x10 ; PTP_CLASS_IPV4
-- * ret a ; return PTP class
-- * drop_ipv4: ret #0x0 ; PTP_CLASS_NONE
-- *
-- * ; PTP over UDP over IPv6 over Ethernet
-- * test_ipv6:
-- * jneq #0x86dd, test_8021q ; ETH_P_IPV6 ?
-- * ldb [20] ; load proto
-- * jneq #17, drop_ipv6 ; IPPROTO_UDP ?
-- * ldh [56] ; load UDP dst port
-- * jneq #319, drop_ipv6 ; is port PTP_EV_PORT ?
-- * ldh [62] ; load payload
-- * and #0xf ; mask PTP_CLASS_VMASK
-- * or #0x20 ; PTP_CLASS_IPV6
-- * ret a ; return PTP class
-- * drop_ipv6: ret #0x0 ; PTP_CLASS_NONE
-- *
-- * ; PTP over 802.1Q over Ethernet
-- * test_8021q:
-- * jneq #0x8100, test_ieee1588 ; ETH_P_8021Q ?
-- * ldh [16] ; load inner type
-- * jneq #0x88f7, drop_ieee1588 ; ETH_P_1588 ?
-- * ldb [18] ; load payload
-- * and #0x8 ; as we don't have ports here, test
-- * jneq #0x0, drop_ieee1588 ; for PTP_GEN_BIT and drop these
-- * ldh [18] ; reload payload
-- * and #0xf ; mask PTP_CLASS_VMASK
-- * or #0x40 ; PTP_CLASS_V2_VLAN
-- * ret a ; return PTP class
-- *
-- * ; PTP over Ethernet
-- * test_ieee1588:
-- * jneq #0x88f7, drop_ieee1588 ; ETH_P_1588 ?
-- * ldb [14] ; load payload
-- * and #0x8 ; as we don't have ports here, test
-- * jneq #0x0, drop_ieee1588 ; for PTP_GEN_BIT and drop these
-- * ldh [14] ; reload payload
-- * and #0xf ; mask PTP_CLASS_VMASK
-- * or #0x30 ; PTP_CLASS_L2
-- * ret a ; return PTP class
-- * drop_ieee1588: ret #0x0 ; PTP_CLASS_NONE
-- */
--
--#include <linux/skbuff.h>
--#include <linux/filter.h>
--#include <linux/ptp_classify.h>
--
--static struct sk_filter *ptp_insns __read_mostly;
--
--unsigned int ptp_classify_raw(const struct sk_buff *skb)
--{
-- return SK_RUN_FILTER(ptp_insns, skb);
--}
--EXPORT_SYMBOL_GPL(ptp_classify_raw);
--
--void __init ptp_classifier_init(void)
--{
-- static struct sock_filter ptp_filter[] __initdata = {
-- { 0x28, 0, 0, 0x0000000c },
-- { 0x15, 0, 12, 0x00000800 },
-- { 0x30, 0, 0, 0x00000017 },
-- { 0x15, 0, 9, 0x00000011 },
-- { 0x28, 0, 0, 0x00000014 },
-- { 0x45, 7, 0, 0x00001fff },
-- { 0xb1, 0, 0, 0x0000000e },
-- { 0x48, 0, 0, 0x00000010 },
-- { 0x15, 0, 4, 0x0000013f },
-- { 0x48, 0, 0, 0x00000016 },
-- { 0x54, 0, 0, 0x0000000f },
-- { 0x44, 0, 0, 0x00000010 },
-- { 0x16, 0, 0, 0x00000000 },
-- { 0x06, 0, 0, 0x00000000 },
-- { 0x15, 0, 9, 0x000086dd },
-- { 0x30, 0, 0, 0x00000014 },
-- { 0x15, 0, 6, 0x00000011 },
-- { 0x28, 0, 0, 0x00000038 },
-- { 0x15, 0, 4, 0x0000013f },
-- { 0x28, 0, 0, 0x0000003e },
-- { 0x54, 0, 0, 0x0000000f },
-- { 0x44, 0, 0, 0x00000020 },
-- { 0x16, 0, 0, 0x00000000 },
-- { 0x06, 0, 0, 0x00000000 },
-- { 0x15, 0, 9, 0x00008100 },
-- { 0x28, 0, 0, 0x00000010 },
-- { 0x15, 0, 15, 0x000088f7 },
-- { 0x30, 0, 0, 0x00000012 },
-- { 0x54, 0, 0, 0x00000008 },
-- { 0x15, 0, 12, 0x00000000 },
-- { 0x28, 0, 0, 0x00000012 },
-- { 0x54, 0, 0, 0x0000000f },
-- { 0x44, 0, 0, 0x00000040 },
-- { 0x16, 0, 0, 0x00000000 },
-- { 0x15, 0, 7, 0x000088f7 },
-- { 0x30, 0, 0, 0x0000000e },
-- { 0x54, 0, 0, 0x00000008 },
-- { 0x15, 0, 4, 0x00000000 },
-- { 0x28, 0, 0, 0x0000000e },
-- { 0x54, 0, 0, 0x0000000f },
-- { 0x44, 0, 0, 0x00000030 },
-- { 0x16, 0, 0, 0x00000000 },
-- { 0x06, 0, 0, 0x00000000 },
-- };
-- struct sock_fprog_kern ptp_prog = {
-- .len = ARRAY_SIZE(ptp_filter), .filter = ptp_filter,
-- };
--
-- BUG_ON(sk_unattached_filter_create(&ptp_insns, &ptp_prog));
--}
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
-index 1063996..0729c19 100644
+index f0493e3..0f43f7a 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -58,7 +58,7 @@ struct rtnl_link {
static DEFINE_MUTEX(rtnl_mutex);
-@@ -299,10 +299,13 @@ int __rtnl_link_register(struct rtnl_link_ops *ops)
- if (rtnl_link_ops_get(ops->kind))
- return -EEXIST;
-
-- if (!ops->dellink)
+@@ -304,10 +304,13 @@ int __rtnl_link_register(struct rtnl_link_ops *ops)
+ * to use the ops for creating device. So do not
+ * fill up dellink as well. That disables rtnl_dellink.
+ */
+- if (ops->setup && !ops->dellink)
- ops->dellink = unregister_netdevice_queue;
-+ if (!ops->dellink) {
++ if (ops->setup && !ops->dellink) {
+ pax_open_kernel();
+ *(void **)&ops->dellink = unregister_netdevice_queue;
+ pax_close_kernel();
return 0;
}
EXPORT_SYMBOL_GPL(__rtnl_link_register);
-@@ -349,7 +352,7 @@ void __rtnl_link_unregister(struct rtnl_link_ops *ops)
+@@ -354,7 +357,7 @@ void __rtnl_link_unregister(struct rtnl_link_ops *ops)
for_each_net(net) {
__rtnl_kill_links(net, ops);
}
}
EXPORT_SYMBOL_GPL(__rtnl_link_unregister);
-@@ -1008,7 +1011,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
+@@ -1014,7 +1017,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
(dev->ifalias &&
nla_put_string(skb, IFLA_IFALIAS, dev->ifalias)) ||
nla_put_u32(skb, IFLA_CARRIER_CHANGES,
{
struct socket *sock;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
-index 58ff88e..af9b458 100644
+index 8d28969..4d36260 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
-@@ -2010,7 +2010,7 @@ EXPORT_SYMBOL(__skb_checksum);
+@@ -360,18 +360,29 @@ refill:
+ goto end;
+ }
+ nc->frag.size = PAGE_SIZE << order;
+-recycle:
+- atomic_set(&nc->frag.page->_count, NETDEV_PAGECNT_MAX_BIAS);
++ /* Even if we own the page, we do not use atomic_set().
++ * This would break get_page_unless_zero() users.
++ */
++ atomic_add(NETDEV_PAGECNT_MAX_BIAS - 1,
++ &nc->frag.page->_count);
+ nc->pagecnt_bias = NETDEV_PAGECNT_MAX_BIAS;
+ nc->frag.offset = 0;
+ }
+
+ if (nc->frag.offset + fragsz > nc->frag.size) {
+- /* avoid unnecessary locked operations if possible */
+- if ((atomic_read(&nc->frag.page->_count) == nc->pagecnt_bias) ||
+- atomic_sub_and_test(nc->pagecnt_bias, &nc->frag.page->_count))
+- goto recycle;
+- goto refill;
++ if (atomic_read(&nc->frag.page->_count) != nc->pagecnt_bias) {
++ if (!atomic_sub_and_test(nc->pagecnt_bias,
++ &nc->frag.page->_count))
++ goto refill;
++ /* OK, page count is 0, we can safely set it */
++ atomic_set(&nc->frag.page->_count,
++ NETDEV_PAGECNT_MAX_BIAS);
++ } else {
++ atomic_add(NETDEV_PAGECNT_MAX_BIAS - nc->pagecnt_bias,
++ &nc->frag.page->_count);
++ }
++ nc->pagecnt_bias = NETDEV_PAGECNT_MAX_BIAS;
++ nc->frag.offset = 0;
+ }
+
+ data = page_address(nc->frag.page) + nc->frag.offset;
+@@ -2011,7 +2022,7 @@ EXPORT_SYMBOL(__skb_checksum);
__wsum skb_checksum(const struct sk_buff *skb, int offset,
int len, __wsum csum)
{
.update = csum_partial_ext,
.combine = csum_block_add_ext,
};
-@@ -3233,13 +3233,15 @@ void __init skb_init(void)
+@@ -3237,13 +3248,15 @@ void __init skb_init(void)
skbuff_head_cache = kmem_cache_create("skbuff_head_cache",
sizeof(struct sk_buff),
0,
}
diff --git a/net/core/sock.c b/net/core/sock.c
-index 026e01f..f54f908 100644
+index 9c3f823..bd8c884 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -442,7 +442,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
@@ -492,7 +492,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
skb->dev = NULL;
- if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) {
+ if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) {
- atomic_inc(&sk->sk_drops);
+ atomic_inc_unchecked(&sk->sk_drops);
goto discard_and_relse;
goto discard_and_relse;
}
-@@ -998,12 +998,12 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
+@@ -999,12 +999,12 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
struct timeval tm;
} v;
return -EINVAL;
memset(&v, 0, sizeof(v));
-@@ -1155,11 +1155,11 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
+@@ -1142,11 +1142,11 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
case SO_PEERNAME:
{
return -EINVAL;
if (copy_to_user(optval, address, len))
return -EFAULT;
-@@ -1240,7 +1240,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
+@@ -1227,7 +1227,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
if (len > lv)
len = lv;
return -EFAULT;
lenout:
if (put_user(len, optlen))
-@@ -2375,7 +2375,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
+@@ -1723,6 +1723,8 @@ EXPORT_SYMBOL(sock_kmalloc);
+ */
+ void sock_kfree_s(struct sock *sk, void *mem, int size)
+ {
++ if (WARN_ON_ONCE(!mem))
++ return;
+ kfree(mem);
+ atomic_sub(size, &sk->sk_omem_alloc);
+ }
+@@ -2369,7 +2371,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
*/
smp_wmb();
atomic_set(&sk->sk_refcnt, 1);
}
EXPORT_SYMBOL(sock_init_data);
-@@ -2503,6 +2503,7 @@ void sock_enable_timestamp(struct sock *sk, int flag)
+@@ -2497,6 +2499,7 @@ void sock_enable_timestamp(struct sock *sk, int flag)
int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
int level, int type)
{
struct sock_exterr_skb *serr;
struct sk_buff *skb, *skb2;
int copied, err;
-@@ -2524,7 +2525,8 @@ int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
+@@ -2518,7 +2521,8 @@ int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
sock_recv_timestamp(msg, sk, skb);
serr = SKB_EXT_ERR(skb);
msg->msg_flags |= MSG_ERRQUEUE;
err = copied;
diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
-index a4216a4..773e3d7 100644
+index ad704c7..ca48aff 100644
--- a/net/core/sock_diag.c
+++ b/net/core/sock_diag.c
@@ -9,26 +9,33 @@
}
EXPORT_SYMBOL_GPL(sock_diag_save_cookie);
-@@ -52,10 +59,9 @@ EXPORT_SYMBOL_GPL(sock_diag_put_meminfo);
- int sock_diag_put_filterinfo(bool may_report_filterinfo, struct sock *sk,
- struct sk_buff *skb, int attrtype)
- {
-- struct sock_fprog_kern *fprog;
-- struct sk_filter *filter;
- struct nlattr *attr;
-- unsigned int flen;
-+ struct sk_filter *filter;
-+ unsigned int len;
- int err = 0;
-
- if (!may_report_filterinfo) {
-@@ -64,20 +70,24 @@ int sock_diag_put_filterinfo(bool may_report_filterinfo, struct sock *sk,
- }
-
- rcu_read_lock();
-+
- filter = rcu_dereference(sk->sk_filter);
-- if (!filter)
-- goto out;
-+ len = filter ? filter->len * sizeof(struct sock_filter) : 0;
-
-- fprog = filter->orig_prog;
-- flen = sk_filter_proglen(fprog);
--
-- attr = nla_reserve(skb, attrtype, flen);
-+ attr = nla_reserve(skb, attrtype, len);
- if (attr == NULL) {
- err = -EMSGSIZE;
- goto out;
- }
-
-- memcpy(nla_data(attr), fprog->filter, flen);
-+ if (filter) {
-+ struct sock_filter *fb = (struct sock_filter *)nla_data(attr);
-+ int i;
-+
-+ for (i = 0; i < filter->len; i++, fb++)
-+ sk_decode_filter(&filter->insns[i], fb);
-+ }
-+
- out:
- rcu_read_unlock();
- return err;
-@@ -110,8 +120,11 @@ int sock_diag_register(const struct sock_diag_handler *hndl)
+@@ -110,8 +117,11 @@ int sock_diag_register(const struct sock_diag_handler *hndl)
mutex_lock(&sock_diag_table_mutex);
if (sock_diag_handlers[hndl->family])
err = -EBUSY;
mutex_unlock(&sock_diag_table_mutex);
return err;
-@@ -127,7 +140,9 @@ void sock_diag_unregister(const struct sock_diag_handler *hnld)
+@@ -127,7 +137,9 @@ void sock_diag_unregister(const struct sock_diag_handler *hnld)
mutex_lock(&sock_diag_table_mutex);
BUG_ON(sock_diag_handlers[family] != hnld);
}
EXPORT_SYMBOL_GPL(sock_diag_unregister);
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
-index cf9cd13..8b56af3 100644
+index cf9cd13..50683950 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -32,7 +32,7 @@ static int rps_sock_flow_sysctl(struct ctl_table *table, int write,
.data = id,
.maxlen = IFNAMSIZ,
};
+@@ -263,7 +263,7 @@ static struct ctl_table net_core_table[] = {
+ .mode = 0644,
+ .proc_handler = proc_dointvec
+ },
+-#ifdef CONFIG_BPF_JIT
++#if defined(CONFIG_BPF_JIT) && !defined(CONFIG_GRKERNSEC_BPF_HARDEN)
+ {
+ .procname = "bpf_jit_enable",
+ .data = &bpf_jit_enable,
@@ -379,13 +379,12 @@ static struct ctl_table netns_core_table[] = {
static __net_init int sysctl_core_net_init(struct net *net)
.init = sysctl_core_net_init,
.exit = sysctl_core_net_exit,
};
-diff --git a/net/core/timestamping.c b/net/core/timestamping.c
-index 6521dfd..661b5a4 100644
---- a/net/core/timestamping.c
-+++ b/net/core/timestamping.c
-@@ -23,11 +23,16 @@
- #include <linux/skbuff.h>
- #include <linux/export.h>
-
-+static struct sock_filter ptp_filter[] = {
-+ PTP_FILTER
-+};
-+
- static unsigned int classify(const struct sk_buff *skb)
- {
-- if (likely(skb->dev && skb->dev->phydev &&
-+ if (likely(skb->dev &&
-+ skb->dev->phydev &&
- skb->dev->phydev->drv))
-- return ptp_classify_raw(skb);
-+ return sk_run_filter(skb, ptp_filter);
- else
- return PTP_CLASS_NONE;
- }
-@@ -55,13 +60,11 @@ void skb_clone_tx_timestamp(struct sk_buff *skb)
- if (likely(phydev->drv->txtstamp)) {
- if (!atomic_inc_not_zero(&sk->sk_refcnt))
- return;
--
- clone = skb_clone(skb, GFP_ATOMIC);
- if (!clone) {
- sock_put(sk);
- return;
- }
--
- clone->sk = sk;
- phydev->drv->txtstamp(phydev, clone, type);
- }
-@@ -86,15 +89,12 @@ void skb_complete_tx_timestamp(struct sk_buff *skb,
- }
-
- *skb_hwtstamps(skb) = *hwtstamps;
--
- serr = SKB_EXT_ERR(skb);
- memset(serr, 0, sizeof(*serr));
- serr->ee.ee_errno = ENOMSG;
- serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING;
- skb->sk = NULL;
--
- err = sock_queue_err_skb(sk, skb);
--
- sock_put(sk);
- if (err)
- kfree_skb(skb);
-@@ -132,3 +132,8 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb)
- return false;
- }
- EXPORT_SYMBOL_GPL(skb_defer_rx_timestamp);
-+
-+void __init skb_timestamping_init(void)
-+{
-+ BUG_ON(sk_chk_filter(ptp_filter, ARRAY_SIZE(ptp_filter)));
-+}
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index ae011b4..d2d18bf 100644
--- a/net/decnet/af_decnet.c
*lenp = len;
diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c
-index 6f1428c..9586b83 100644
+index 32755cb..236d827 100644
--- a/net/ieee802154/reassembly.c
+++ b/net/ieee802154/reassembly.c
-@@ -438,14 +438,13 @@ static struct ctl_table lowpan_frags_ctl_table[] = {
+@@ -433,14 +433,13 @@ static struct ctl_table lowpan_frags_ctl_table[] = {
static int __net_init lowpan_frags_ns_sysctl_register(struct net *net)
{
GFP_KERNEL);
if (table == NULL)
goto err_alloc;
-@@ -458,9 +457,9 @@ static int __net_init lowpan_frags_ns_sysctl_register(struct net *net)
+@@ -455,9 +454,9 @@ static int __net_init lowpan_frags_ns_sysctl_register(struct net *net)
/* Don't export sysctls to unprivileged users */
if (net->user_ns != &init_user_ns)
table[0].procname = NULL;
if (hdr == NULL)
goto err_reg;
-@@ -468,8 +467,7 @@ static int __net_init lowpan_frags_ns_sysctl_register(struct net *net)
+@@ -465,8 +464,7 @@ static int __net_init lowpan_frags_ns_sysctl_register(struct net *net)
return 0;
err_reg:
return -ENOMEM;
}
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
-index e944937..368fe78 100644
+index 214882e..f958b50 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
-@@ -1540,7 +1540,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
+@@ -1548,7 +1548,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
idx = 0;
head = &net->dev_index_head[h];
rcu_read_lock();
net->dev_base_seq;
hlist_for_each_entry_rcu(dev, head, index_hlist) {
if (idx < s_idx)
-@@ -1858,7 +1858,7 @@ static int inet_netconf_dump_devconf(struct sk_buff *skb,
+@@ -1866,7 +1866,7 @@ static int inet_netconf_dump_devconf(struct sk_buff *skb,
idx = 0;
head = &net->dev_index_head[h];
rcu_read_lock();
net->dev_base_seq;
hlist_for_each_entry_rcu(dev, head, index_hlist) {
if (idx < s_idx)
-@@ -2093,7 +2093,7 @@ static int ipv4_doint_and_flush(struct ctl_table *ctl, int write,
+@@ -2101,7 +2101,7 @@ static int ipv4_doint_and_flush(struct ctl_table *ctl, int write,
#define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \
DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush)
struct ctl_table_header *sysctl_header;
struct ctl_table devinet_vars[__IPV4_DEVCONF_MAX];
} devinet_sysctl = {
-@@ -2215,7 +2215,7 @@ static __net_init int devinet_init_net(struct net *net)
+@@ -2233,7 +2233,7 @@ static __net_init int devinet_init_net(struct net *net)
int err;
struct ipv4_devconf *all, *dflt;
#ifdef CONFIG_SYSCTL
struct ctl_table_header *forw_hdr;
#endif
-@@ -2233,7 +2233,7 @@ static __net_init int devinet_init_net(struct net *net)
+@@ -2251,7 +2251,7 @@ static __net_init int devinet_init_net(struct net *net)
goto err_alloc_dflt;
#ifdef CONFIG_SYSCTL
if (tbl == NULL)
goto err_alloc_ctl;
-@@ -2253,7 +2253,10 @@ static __net_init int devinet_init_net(struct net *net)
+@@ -2271,7 +2271,10 @@ static __net_init int devinet_init_net(struct net *net)
goto err_reg_dflt;
err = -ENOMEM;
if (forw_hdr == NULL)
goto err_reg_ctl;
net->ipv4.forw_hdr = forw_hdr;
-@@ -2269,8 +2272,7 @@ err_reg_ctl:
+@@ -2287,8 +2290,7 @@ err_reg_ctl:
err_reg_dflt:
__devinet_sysctl_unregister(all);
err_reg_all:
return nh->nh_saddr;
}
+diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
+index 6556263..db77807 100644
+--- a/net/ipv4/gre_offload.c
++++ b/net/ipv4/gre_offload.c
+@@ -59,13 +59,13 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
+ if (csum)
+ skb->encap_hdr_csum = 1;
+
+- if (unlikely(!pskb_may_pull(skb, ghl)))
+- goto out;
+-
+ /* setup inner skb. */
+ skb->protocol = greh->protocol;
+ skb->encapsulation = 0;
+
++ if (unlikely(!pskb_may_pull(skb, ghl)))
++ goto out;
++
+ __skb_pull(skb, ghl);
+ skb_reset_mac_header(skb);
+ skb_set_network_header(skb, skb_inner_network_offset(skb));
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
-index 43116e8..e3e6159 100644
+index 43116e8..ba0916a8 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -18,6 +18,7 @@
return inet_ehashfn(net, laddr, lport, faddr, fport);
}
-+extern void gr_update_task_in_ip_table(struct task_struct *task, const struct inet_sock *inet);
++extern void gr_update_task_in_ip_table(const struct inet_sock *inet);
+
/*
* Allocate and initialize a new local port bind bucket.
twrefcnt += inet_twsk_bind_unhash(tw, hinfo);
spin_unlock(&head->lock);
-+ gr_update_task_in_ip_table(current, inet_sk(sk));
++ gr_update_task_in_ip_table(inet_sk(sk));
+
if (tw) {
inet_twsk_deschedule(tw, death_row);
p->rate_tokens = 0;
/* 60*HZ is arbitrary, but chosen enough high so that the first
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
-index ed32313..3762abe 100644
+index 15f0e2b..8cf8177 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
-@@ -284,7 +284,7 @@ static inline int ip_frag_too_far(struct ipq *qp)
+@@ -268,7 +268,7 @@ static inline int ip_frag_too_far(struct ipq *qp)
return 0;
start = qp->rid;
qp->rid = end;
rc = qp->q.fragments && (end - start) > max;
-@@ -761,12 +761,11 @@ static struct ctl_table ip4_frags_ctl_table[] = {
+@@ -746,12 +746,11 @@ static struct ctl_table ip4_frags_ctl_table[] = {
static int __net_init ip4_frags_ns_ctl_register(struct net *net)
{
if (table == NULL)
goto err_alloc;
-@@ -777,9 +776,10 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net)
+@@ -765,9 +764,10 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net)
/* Don't export sysctls to unprivileged users */
if (net->user_ns != &init_user_ns)
table[0].procname = NULL;
if (hdr == NULL)
goto err_reg;
-@@ -787,8 +787,7 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net)
+@@ -775,8 +775,7 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net)
return 0;
err_reg:
.kind = "gretap",
.maxtype = IFLA_GRE_MAX,
.policy = ipgre_policy,
+diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
+index 3d4da2c..40f9c29 100644
+--- a/net/ipv4/ip_input.c
++++ b/net/ipv4/ip_input.c
+@@ -147,6 +147,10 @@
+ #include <linux/mroute.h>
+ #include <linux/netlink.h>
+
++#ifdef CONFIG_GRKERNSEC_BLACKHOLE
++extern int grsec_enable_blackhole;
++#endif
++
+ /*
+ * Process Router Attention IP option (RFC 2113)
+ */
+@@ -223,6 +227,9 @@ static int ip_local_deliver_finish(struct sk_buff *skb)
+ if (!raw) {
+ if (xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
+ IP_INC_STATS_BH(net, IPSTATS_MIB_INUNKNOWNPROTOS);
++#ifdef CONFIG_GRKERNSEC_BLACKHOLE
++ if (!grsec_enable_blackhole || (skb->dev->flags & IFF_LOOPBACK))
++#endif
+ icmp_send(skb, ICMP_DEST_UNREACH,
+ ICMP_PROT_UNREACH, 0);
+ }
+diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
+index 215af2b..73cbbe1 100644
+--- a/net/ipv4/ip_output.c
++++ b/net/ipv4/ip_output.c
+@@ -231,7 +231,7 @@ static int ip_finish_output_gso(struct sk_buff *skb)
+ */
+ features = netif_skb_features(skb);
+ segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
+- if (IS_ERR(segs)) {
++ if (IS_ERR_OR_NULL(segs)) {
+ kfree_skb(skb);
+ return -ENOMEM;
+ }
+@@ -1533,6 +1533,7 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
+ struct sk_buff *nskb;
+ struct sock *sk;
+ struct inet_sock *inet;
++ int err;
+
+ if (ip_options_echo(&replyopts.opt.opt, skb))
+ return;
+@@ -1572,8 +1573,13 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
+ sock_net_set(sk, net);
+ __skb_queue_head_init(&sk->sk_write_queue);
+ sk->sk_sndbuf = sysctl_wmem_default;
+- ip_append_data(sk, &fl4, ip_reply_glue_bits, arg->iov->iov_base, len, 0,
+- &ipc, &rt, MSG_DONTWAIT);
++ err = ip_append_data(sk, &fl4, ip_reply_glue_bits, arg->iov->iov_base,
++ len, 0, &ipc, &rt, MSG_DONTWAIT);
++ if (unlikely(err)) {
++ ip_flush_pending_frames(sk);
++ goto out;
++ }
++
+ nskb = skb_peek(&sk->sk_write_queue);
+ if (nskb) {
+ if (arg->csumoffset >= 0)
+@@ -1585,7 +1591,7 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
+ skb_set_queue_mapping(nskb, skb_get_queue_mapping(skb));
+ ip_push_pending_frames(sk, &fl4);
+ }
+-
++out:
+ put_cpu_var(unicast_sock);
+
+ ip_rt_put(rt);
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
-index 64741b9..6f334a2 100644
+index 5cb830c..81a7a56 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -1188,7 +1188,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
if (sk->sk_type != SOCK_STREAM)
return -ENOPROTOOPT;
-- msg.msg_control = optval;
-+ msg.msg_control = (void __force_kernel *)optval;
+- msg.msg_control = (__force void *) optval;
++ msg.msg_control = (__force_kernel void *) optval;
msg.msg_controllen = len;
msg.msg_flags = flags;
+diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
+index f4c987b..88c386c 100644
+--- a/net/ipv4/ip_tunnel_core.c
++++ b/net/ipv4/ip_tunnel_core.c
+@@ -91,11 +91,12 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto)
+ skb_pull_rcsum(skb, hdr_len);
+
+ if (inner_proto == htons(ETH_P_TEB)) {
+- struct ethhdr *eh = (struct ethhdr *)skb->data;
++ struct ethhdr *eh;
+
+ if (unlikely(!pskb_may_pull(skb, ETH_HLEN)))
+ return -ENOMEM;
+
++ eh = (struct ethhdr *)skb->data;
+ if (likely(ntohs(eh->h_proto) >= ETH_P_802_3_MIN))
+ skb->protocol = eh->h_proto;
+ else
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
-index b8960f3..0f025db 100644
+index e453cb7..3c8d952 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -45,7 +45,7 @@
.maxtype = IFLA_VTI_MAX,
.policy = vti_policy,
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
-index b3e86ea..18ce98c 100644
+index 5bbef4f..5bc4fb6 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
-@@ -334,7 +334,7 @@ static int __init ic_devinet_ioctl(unsigned int cmd, struct ifreq *arg)
+@@ -332,7 +332,7 @@ static int __init ic_devinet_ioctl(unsigned int cmd, struct ifreq *arg)
mm_segment_t oldfs = get_fs();
set_fs(get_ds());
set_fs(oldfs);
return res;
}
-@@ -345,7 +345,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg)
+@@ -343,7 +343,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg)
mm_segment_t oldfs = get_fs();
set_fs(get_ds());
set_fs(oldfs);
return res;
}
-@@ -356,7 +356,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg)
+@@ -354,7 +354,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg)
mm_segment_t oldfs = get_fs();
set_fs(get_ds());
pr_err("Unable to proc dir entry\n");
return -ENOMEM;
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
-index 044a0dd..3399751 100644
+index a3c59a0..ec620a50 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -59,7 +59,7 @@ struct ping_table {
static int ping_v4_seq_show(struct seq_file *seq, void *v)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
-index 2c65160..213ecdf 100644
+index 739db31..74f0210 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
-@@ -311,7 +311,7 @@ static int raw_rcv_skb(struct sock *sk, struct sk_buff *skb)
+@@ -314,7 +314,7 @@ static int raw_rcv_skb(struct sock *sk, struct sk_buff *skb)
int raw_rcv(struct sock *sk, struct sk_buff *skb)
{
if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) {
kfree_skb(skb);
return NET_RX_DROP;
}
-@@ -748,16 +748,20 @@ static int raw_init(struct sock *sk)
+@@ -755,16 +755,20 @@ static int raw_init(struct sock *sk)
static int raw_seticmpfilter(struct sock *sk, char __user *optval, int optlen)
{
if (get_user(len, optlen))
goto out;
-@@ -767,8 +771,8 @@ static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *o
+@@ -774,8 +778,8 @@ static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *o
if (len > sizeof(struct icmp_filter))
len = sizeof(struct icmp_filter);
ret = -EFAULT;
goto out;
ret = 0;
out: return ret;
-@@ -997,7 +1001,7 @@ static void raw_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
+@@ -1004,7 +1008,7 @@ static void raw_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
0, 0L, 0,
from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)),
0, sock_i_ino(sp),
static int raw_seq_show(struct seq_file *seq, void *v)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
-index 1901998..a9a850a 100644
+index cbadb94..691f99e 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -228,7 +228,7 @@ static const struct seq_operations rt_cache_seq_ops = {
}
EXPORT_SYMBOL(ip_idents_reserve);
-@@ -2625,34 +2625,34 @@ static struct ctl_table ipv4_route_flush_table[] = {
+@@ -2623,34 +2623,34 @@ static struct ctl_table ipv4_route_flush_table[] = {
.maxlen = sizeof(int),
.mode = 0200,
.proc_handler = ipv4_sysctl_rtcache_flush,
err_dup:
return -ENOMEM;
}
-@@ -2675,8 +2675,8 @@ static __net_initdata struct pernet_operations sysctl_route_ops = {
+@@ -2673,8 +2673,8 @@ static __net_initdata struct pernet_operations sysctl_route_ops = {
static __net_init int rt_genid_init(struct net *net)
{
get_random_bytes(&net->ipv4.dev_addr_genid,
sizeof(net->ipv4.dev_addr_genid));
return 0;
-@@ -2719,11 +2719,7 @@ int __init ip_rt_init(void)
+@@ -2717,11 +2717,7 @@ int __init ip_rt_init(void)
{
int rc = 0;
goto err_reg;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
-index 40639c2..dfc86b2 100644
+index a906e02..f3b6a0f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
-@@ -754,7 +754,7 @@ static void tcp_update_pacing_rate(struct sock *sk)
+@@ -755,7 +755,7 @@ static void tcp_update_pacing_rate(struct sock *sk)
* without any lock. We want to make sure compiler wont store
* intermediate values in this location.
*/
sk->sk_max_pacing_rate);
}
-@@ -4478,7 +4478,7 @@ static struct sk_buff *tcp_collapse_one(struct sock *sk, struct sk_buff *skb,
+@@ -4488,7 +4488,7 @@ static struct sk_buff *tcp_collapse_one(struct sock *sk, struct sk_buff *skb,
* simplifies code)
*/
static void
struct sk_buff *head, struct sk_buff *tail,
u32 start, u32 end)
{
-@@ -5536,6 +5536,7 @@ discard:
+@@ -5546,6 +5546,7 @@ discard:
tcp_paws_reject(&tp->rx_opt, 0))
goto discard_and_undo;
if (th->syn) {
/* We see SYN without ACK. It is attempt of
* simultaneous connect with crossed SYNs.
-@@ -5586,6 +5587,7 @@ discard:
+@@ -5596,6 +5597,7 @@ discard:
goto discard;
#endif
}
/* "fifth, if neither of the SYN or RST bits is set then
* drop the segment and return."
*/
-@@ -5632,7 +5634,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
+@@ -5642,7 +5644,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
goto discard;
if (th->syn) {
if (icsk->icsk_af_ops->conn_request(sk, skb) < 0)
return 1;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
-index 77cccda..10122c4 100644
+index cd17f00..1e1f252 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -91,6 +91,10 @@ int sysctl_tcp_low_latency __read_mostly;
#ifdef CONFIG_TCP_MD5SIG
static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key,
__be32 daddr, __be32 saddr, const struct tcphdr *th);
-@@ -1591,6 +1595,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -1487,6 +1491,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
return 0;
reset:
tcp_v4_send_reset(rsk, skb);
discard:
kfree_skb(skb);
-@@ -1737,12 +1744,19 @@ int tcp_v4_rcv(struct sk_buff *skb)
+@@ -1633,12 +1640,19 @@ int tcp_v4_rcv(struct sk_buff *skb)
TCP_SKB_CB(skb)->sacked = 0;
sk = __inet_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest);
if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
-@@ -1796,6 +1810,10 @@ csum_error:
+@@ -1704,6 +1718,10 @@ csum_error:
bad_packet:
TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
} else {
}
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
-index e68e0d4..0334263 100644
+index 1649988..6251843 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -27,6 +27,10 @@
cnt += width;
}
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
-index 286227a..c495a76 100644
+index df90cd1..9ab2c9b 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -22,6 +22,10 @@
syn_set ? 0 : icsk->icsk_user_timeout, syn_set)) {
/* Has it gone just too far? */
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
-index 7d5a866..4874211 100644
+index f57c0e4..cf24bd0 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -87,6 +87,7 @@
struct udp_table udp_table __read_mostly;
EXPORT_SYMBOL(udp_table);
-@@ -615,6 +620,9 @@ found:
- return s;
+@@ -594,6 +599,9 @@ static inline bool __udp_is_mcast_sock(struct net *net, struct sock *sk,
+ return true;
}
+extern int gr_search_udp_recvmsg(struct sock *sk, const struct sk_buff *skb);
/*
* This routine is called by the ICMP module when it gets some
* sort of error condition. If err < 0 then the socket should
-@@ -952,9 +960,18 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
+@@ -931,9 +939,18 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
dport = usin->sin_port;
if (dport == 0)
return -EINVAL;
daddr = inet->inet_daddr;
dport = inet->inet_dport;
/* Open fast path for connected socket.
-@@ -1202,7 +1219,7 @@ static unsigned int first_packet_length(struct sock *sk)
+@@ -1181,7 +1198,7 @@ static unsigned int first_packet_length(struct sock *sk)
IS_UDPLITE(sk));
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
IS_UDPLITE(sk));
__skb_unlink(skb, rcvq);
__skb_queue_tail(&list_kill, skb);
}
-@@ -1282,6 +1299,10 @@ try_again:
+@@ -1261,6 +1278,10 @@ try_again:
if (!skb)
goto out;
ulen = skb->len - sizeof(struct udphdr);
copied = len;
if (copied > ulen)
-@@ -1315,7 +1336,7 @@ try_again:
+@@ -1294,7 +1315,7 @@ try_again:
if (unlikely(err)) {
trace_kfree_skb(skb, udp_recvmsg);
if (!peeked) {
UDP_INC_STATS_USER(sock_net(sk),
UDP_MIB_INERRORS, is_udplite);
}
-@@ -1612,7 +1633,7 @@ csum_error:
+@@ -1591,7 +1612,7 @@ csum_error:
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite);
drop:
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
kfree_skb(skb);
return -1;
}
-@@ -1631,7 +1652,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
+@@ -1610,7 +1631,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
if (!skb1) {
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
IS_UDPLITE(sk));
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
-@@ -1817,6 +1838,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
+@@ -1807,6 +1828,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
goto csum_error;
UDP_INC_STATS_BH(net, UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE);
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
/*
-@@ -2403,7 +2427,7 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
+@@ -2393,7 +2417,7 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
from_kuid_munged(seq_user_ns(f), sock_i_uid(sp)),
0, sock_i_ino(sp),
atomic_read(&sp->sk_refcnt), sp,
return -ENOMEM;
}
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
-index 5667b30..2044f61 100644
+index 3e118df..27b16cf 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
-@@ -593,7 +593,7 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb,
+@@ -604,7 +604,7 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb,
idx = 0;
head = &net->dev_index_head[h];
rcu_read_lock();
net->dev_base_seq;
hlist_for_each_entry_rcu(dev, head, index_hlist) {
if (idx < s_idx)
-@@ -2390,7 +2390,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
+@@ -2396,7 +2396,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
p.iph.ihl = 5;
p.iph.protocol = IPPROTO_IPV6;
p.iph.ttl = 64;
if (ops->ndo_do_ioctl) {
mm_segment_t oldfs = get_fs();
-@@ -3516,16 +3516,23 @@ static const struct file_operations if6_fops = {
+@@ -3531,16 +3531,23 @@ static const struct file_operations if6_fops = {
.release = seq_release_net,
};
}
static struct pernet_operations if6_proc_net_ops = {
-@@ -4141,7 +4148,7 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
+@@ -4156,7 +4163,7 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
s_ip_idx = ip_idx = cb->args[2];
rcu_read_lock();
for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) {
idx = 0;
head = &net->dev_index_head[h];
-@@ -4741,11 +4748,8 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
-
- rt = rt6_lookup(dev_net(dev), &ifp->peer_addr, NULL,
- dev->ifindex, 1);
-- if (rt) {
-- dst_hold(&rt->dst);
-- if (ip6_del_rt(rt))
-- dst_free(&rt->dst);
-- }
-+ if (rt && ip6_del_rt(rt))
-+ dst_free(&rt->dst);
- }
- dst_hold(&ifp->rt->dst);
-
-@@ -4753,7 +4757,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
- dst_free(&ifp->rt->dst);
+@@ -4784,7 +4791,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
+ rt_genid_bump_ipv6(net);
break;
}
- atomic_inc(&net->ipv6.dev_addr_genid);
+ atomic_inc_unchecked(&net->ipv6.dev_addr_genid);
- rt_genid_bump_ipv6(net);
}
-@@ -4774,7 +4778,7 @@ int addrconf_sysctl_forward(struct ctl_table *ctl, int write,
+ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
+@@ -4804,7 +4811,7 @@ int addrconf_sysctl_forward(struct ctl_table *ctl, int write,
int *valp = ctl->data;
int val = *valp;
loff_t pos = *ppos;
int ret;
/*
-@@ -4859,7 +4863,7 @@ int addrconf_sysctl_disable(struct ctl_table *ctl, int write,
+@@ -4889,7 +4896,7 @@ int addrconf_sysctl_disable(struct ctl_table *ctl, int write,
int *valp = ctl->data;
int val = *valp;
loff_t pos = *ppos;
/*
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
-index 7cb4392..dc96d28 100644
+index 2daa3a1..341066c 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
-@@ -765,7 +765,7 @@ static int __net_init inet6_net_init(struct net *net)
- net->ipv6.sysctl.bindv6only = 0;
+@@ -766,7 +766,7 @@ static int __net_init inet6_net_init(struct net *net)
net->ipv6.sysctl.icmpv6_time = 1*HZ;
net->ipv6.sysctl.flowlabel_consistency = 1;
+ net->ipv6.sysctl.auto_flowlabels = 0;
- atomic_set(&net->ipv6.rt_genid, 0);
+ atomic_set_unchecked(&net->ipv6.rt_genid, 0);
err = ipv6_init_mibs(net);
if (err)
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
-index c3bf2d2..1f00573 100644
+index 2753319..b7e625c 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
-@@ -938,5 +938,5 @@ void ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp,
+@@ -939,5 +939,5 @@ void ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp,
0,
sock_i_ino(sp),
atomic_read(&sp->sk_refcnt), sp,
+ atomic_read_unchecked(&sp->sk_drops));
}
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
-index f6c84a6..9f2084e 100644
+index 06ba3e5..5c08d38 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
-@@ -990,7 +990,7 @@ static struct ctl_table ipv6_icmp_table_template[] = {
+@@ -993,7 +993,7 @@ static struct ctl_table ipv6_icmp_table_template[] = {
struct ctl_table * __net_init ipv6_icmp_sysctl_init(struct net *net)
{
table = kmemdup(ipv6_icmp_table_template,
sizeof(ipv6_icmp_table_template),
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
-index 3873181..220ad3f 100644
+index 97299d7..c8e6894 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -71,8 +71,8 @@ struct ip6gre_net {
static int ip6gre_tunnel_init(struct net_device *dev);
static void ip6gre_tunnel_setup(struct net_device *dev);
static void ip6gre_tunnel_link(struct ip6gre_net *ign, struct ip6_tnl *t);
-@@ -1280,7 +1280,7 @@ static void ip6gre_fb_tunnel_init(struct net_device *dev)
+@@ -1286,7 +1286,7 @@ static void ip6gre_fb_tunnel_init(struct net_device *dev)
}
.handler = ip6gre_rcv,
.err_handler = ip6gre_err,
.flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
-@@ -1638,7 +1638,7 @@ static const struct nla_policy ip6gre_policy[IFLA_GRE_MAX + 1] = {
+@@ -1645,7 +1645,7 @@ static const struct nla_policy ip6gre_policy[IFLA_GRE_MAX + 1] = {
[IFLA_GRE_FLAGS] = { .type = NLA_U32 },
};
.kind = "ip6gre",
.maxtype = IFLA_GRE_MAX,
.policy = ip6gre_policy,
-@@ -1652,7 +1652,7 @@ static struct rtnl_link_ops ip6gre_link_ops __read_mostly = {
+@@ -1659,7 +1659,7 @@ static struct rtnl_link_ops ip6gre_link_ops __read_mostly = {
.fill_info = ip6gre_fill_info,
};
.kind = "ip6gretap",
.maxtype = IFLA_GRE_MAX,
.policy = ip6gre_policy,
+diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
+index 65eda2a..620a102 100644
+--- a/net/ipv6/ip6_offload.c
++++ b/net/ipv6/ip6_offload.c
+@@ -46,6 +46,7 @@ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
+ if (unlikely(!pskb_may_pull(skb, len)))
+ break;
+
++ opth = (void *)skb->data;
+ proto = opth->nexthdr;
+ __skb_pull(skb, len);
+ }
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
-index afa0824..04ba530 100644
+index 69a84b4..881c319 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -86,7 +86,7 @@ static u32 HASH(const struct in6_addr *addr1, const struct in6_addr *addr2)
static int ip6_tnl_net_id __read_mostly;
struct ip6_tnl_net {
-@@ -1708,7 +1708,7 @@ static const struct nla_policy ip6_tnl_policy[IFLA_IPTUN_MAX + 1] = {
+@@ -1714,7 +1714,7 @@ static const struct nla_policy ip6_tnl_policy[IFLA_IPTUN_MAX + 1] = {
[IFLA_IPTUN_PROTO] = { .type = NLA_U8 },
};
.maxtype = IFLA_IPTUN_MAX,
.policy = ip6_tnl_policy,
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
-index 9aaa6bb..5c13e57 100644
+index 5833a22..6631377 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -62,7 +62,7 @@ static u32 HASH(const struct in6_addr *addr1, const struct in6_addr *addr2)
static int vti6_net_id __read_mostly;
struct vti6_net {
-@@ -977,7 +977,7 @@ static const struct nla_policy vti6_policy[IFLA_VTI_MAX + 1] = {
+@@ -981,7 +981,7 @@ static const struct nla_policy vti6_policy[IFLA_VTI_MAX + 1] = {
[IFLA_VTI_OKEY] = { .type = NLA_U32 },
};
.maxtype = IFLA_VTI_MAX,
.policy = vti6_policy,
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
-index edb58af..78de133 100644
+index 0c28998..d0a2ecd 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
-@@ -991,7 +991,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
+@@ -995,7 +995,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
if (sk->sk_type != SOCK_STREAM)
return -ENOPROTOOPT;
case IP6T_SO_GET_ENTRIES:
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
-index 0d5279f..89d9f6f 100644
+index 6f187c8..34b367f 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
-@@ -90,12 +90,11 @@ static struct ctl_table nf_ct_frag6_sysctl_table[] = {
+@@ -96,12 +96,11 @@ static struct ctl_table nf_ct_frag6_sysctl_table[] = {
static int nf_ct_frag6_sysctl_register(struct net *net)
{
GFP_KERNEL);
if (table == NULL)
goto err_alloc;
-@@ -103,9 +102,9 @@ static int nf_ct_frag6_sysctl_register(struct net *net)
- table[0].data = &net->nf_frag.frags.timeout;
- table[1].data = &net->nf_frag.frags.low_thresh;
+@@ -112,9 +111,9 @@ static int nf_ct_frag6_sysctl_register(struct net *net)
table[2].data = &net->nf_frag.frags.high_thresh;
+ table[2].extra1 = &net->nf_frag.frags.low_thresh;
+ table[2].extra2 = &init_net.nf_frag.frags.high_thresh;
- }
-
- hdr = register_net_sysctl(net, "net/netfilter", table);
if (hdr == NULL)
goto err_reg;
-@@ -113,8 +112,7 @@ static int nf_ct_frag6_sysctl_register(struct net *net)
+@@ -122,8 +121,7 @@ static int nf_ct_frag6_sysctl_register(struct net *net)
return 0;
err_reg:
inet6_unregister_protosw(&pingv6_protosw);
}
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
-index 3317440..201764e 100644
+index 2d6f860..b0165f5 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -309,7 +309,7 @@ static int __net_init ipv6_proc_init_net(struct net *net)
goto proc_dev_snmp6_fail;
return 0;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
-index b2dc60b..a6b6c10 100644
+index 39d4422..b0979547 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -388,7 +388,7 @@ static inline int rawv6_rcv_skb(struct sock *sk, struct sk_buff *skb)
kfree_skb(skb);
return NET_RX_DROP;
}
-@@ -610,7 +610,7 @@ out:
+@@ -608,7 +608,7 @@ out:
return err;
}
struct flowi6 *fl6, struct dst_entry **dstp,
unsigned int flags)
{
-@@ -916,12 +916,15 @@ do_confirm:
+@@ -914,12 +914,15 @@ do_confirm:
static int rawv6_seticmpfilter(struct sock *sk, int level, int optname,
char __user *optval, int optlen)
{
return 0;
default:
return -ENOPROTOOPT;
-@@ -934,6 +937,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
+@@ -932,6 +935,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
int len;
switch (optname) {
case ICMPV6_FILTER:
-@@ -945,7 +949,8 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
+@@ -943,7 +947,8 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
len = sizeof(struct icmp6_filter);
if (put_user(len, optlen))
return -EFAULT;
return 0;
default:
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
-index cc85a9b..526a133 100644
+index c6557d9..173e728 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
-@@ -626,12 +626,11 @@ static struct ctl_table ip6_frags_ctl_table[] = {
+@@ -627,12 +627,11 @@ static struct ctl_table ip6_frags_ctl_table[] = {
static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
{
if (table == NULL)
goto err_alloc;
-@@ -642,9 +641,10 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
+@@ -646,9 +645,10 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
/* Don't export sysctls to unprivileged users */
if (net->user_ns != &init_user_ns)
table[0].procname = NULL;
if (hdr == NULL)
goto err_reg;
-@@ -652,8 +652,7 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
+@@ -656,8 +656,7 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
return 0;
err_reg:
return -ENOMEM;
}
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
-index f23fbd2..7868241 100644
+index bafde82..af2c91f 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
-@@ -2971,7 +2971,7 @@ struct ctl_table ipv6_route_table_template[] = {
+@@ -2967,7 +2967,7 @@ struct ctl_table ipv6_route_table_template[] = {
struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net)
{
table = kmemdup(ipv6_route_table_template,
sizeof(ipv6_route_table_template),
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
-index 4f40817..54dcbef 100644
+index 6163f85..0070823 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -74,7 +74,7 @@ static void ipip6_tunnel_setup(struct net_device *dev);
static int sit_net_id __read_mostly;
struct sit_net {
-@@ -1661,7 +1661,7 @@ static void ipip6_dellink(struct net_device *dev, struct list_head *head)
+@@ -485,11 +485,11 @@ static void ipip6_tunnel_uninit(struct net_device *dev)
+ */
+ static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb)
+ {
+- const struct iphdr *iph = (const struct iphdr *) skb->data;
++ int ihl = ((const struct iphdr *)skb->data)->ihl*4;
+ struct rt6_info *rt;
+ struct sk_buff *skb2;
+
+- if (!pskb_may_pull(skb, iph->ihl * 4 + sizeof(struct ipv6hdr) + 8))
++ if (!pskb_may_pull(skb, ihl + sizeof(struct ipv6hdr) + 8))
+ return 1;
+
+ skb2 = skb_clone(skb, GFP_ATOMIC);
+@@ -498,7 +498,7 @@ static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb)
+ return 1;
+
+ skb_dst_drop(skb2);
+- skb_pull(skb2, iph->ihl * 4);
++ skb_pull(skb2, ihl);
+ skb_reset_network_header(skb2);
+
+ rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, NULL, 0, 0);
+@@ -1662,7 +1662,7 @@ static void ipip6_dellink(struct net_device *dev, struct list_head *head)
unregister_netdevice_queue(dev, head);
}
.maxtype = IFLA_IPTUN_MAX,
.policy = ipip6_policy,
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
-index 058f3ec..dec973d 100644
+index 0c56c93..ece50df 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
-@@ -61,7 +61,7 @@ static struct ctl_table ipv6_rotable[] = {
+@@ -68,7 +68,7 @@ static struct ctl_table ipv6_rotable[] = {
static int __net_init ipv6_sysctl_net_init(struct net *net)
{
struct ctl_table *ipv6_icmp_table;
int err;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
-index 229239ad..ee2802f 100644
+index 29964c3..b8caecf 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -102,6 +102,10 @@ static void inet6_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb)
static void tcp_v6_hash(struct sock *sk)
{
if (sk->sk_state != TCP_CLOSE) {
-@@ -1424,6 +1428,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
+@@ -1333,6 +1337,9 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
return 0;
reset:
tcp_v6_send_reset(sk, skb);
discard:
if (opt_skb)
-@@ -1508,12 +1515,20 @@ static int tcp_v6_rcv(struct sk_buff *skb)
+@@ -1417,12 +1424,20 @@ static int tcp_v6_rcv(struct sk_buff *skb)
TCP_SKB_CB(skb)->sacked = 0;
sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest);
if (hdr->hop_limit < inet6_sk(sk)->min_hopcount) {
NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
-@@ -1565,6 +1580,10 @@ csum_error:
+@@ -1479,6 +1494,10 @@ csum_error:
bad_packet:
TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
} else {
}
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
-index 7092ff7..3fd0eb4 100644
+index 4836af8..0e52bbd 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -76,6 +76,10 @@ static unsigned int udp6_ehashfn(struct net *net,
int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2)
{
const struct in6_addr *sk2_rcv_saddr6 = inet6_rcv_saddr(sk2);
-@@ -435,7 +439,7 @@ try_again:
+@@ -434,7 +438,7 @@ try_again:
if (unlikely(err)) {
trace_kfree_skb(skb, udpv6_recvmsg);
if (!peeked) {
if (is_udp4)
UDP_INC_STATS_USER(sock_net(sk),
UDP_MIB_INERRORS,
-@@ -698,7 +702,7 @@ csum_error:
+@@ -701,7 +705,7 @@ csum_error:
UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite);
drop:
UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
kfree_skb(skb);
return -1;
}
-@@ -754,7 +758,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
+@@ -740,7 +744,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
if (likely(skb1 == NULL))
skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
if (!skb1) {
UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
IS_UDPLITE(sk));
UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
-@@ -920,6 +924,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
+@@ -915,6 +919,9 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
goto csum_error;
UDP6_INC_STATS_BH(net, UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE);
kfree_skb(skb);
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
-index 2a0bbda..d75ca57 100644
+index 2a0bbda..442240d 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
-@@ -212,11 +212,11 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
+@@ -170,8 +170,10 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
+ case IPPROTO_DCCP:
+ if (!onlyproto && (nh + offset + 4 < skb->data ||
+ pskb_may_pull(skb, nh + offset + 4 - skb->data))) {
+- __be16 *ports = (__be16 *)exthdr;
++ __be16 *ports;
+
++ nh = skb_network_header(skb);
++ ports = (__be16 *)(nh + offset);
+ fl6->fl6_sport = ports[!!reverse];
+ fl6->fl6_dport = ports[!reverse];
+ }
+@@ -180,8 +182,10 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
+
+ case IPPROTO_ICMPV6:
+ if (!onlyproto && pskb_may_pull(skb, nh + offset + 2 - skb->data)) {
+- u8 *icmp = (u8 *)exthdr;
++ u8 *icmp;
+
++ nh = skb_network_header(skb);
++ icmp = (u8 *)(nh + offset);
+ fl6->fl6_icmp_type = icmp[0];
+ fl6->fl6_icmp_code = icmp[1];
+ }
+@@ -192,8 +196,9 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
+ case IPPROTO_MH:
+ if (!onlyproto && pskb_may_pull(skb, nh + offset + 3 - skb->data)) {
+ struct ip6_mh *mh;
+- mh = (struct ip6_mh *)exthdr;
+
++ nh = skb_network_header(skb);
++ mh = (struct ip6_mh *)(nh + offset);
+ fl6->fl6_mh_type = mh->ip6mh_type;
+ }
+ fl6->flowi6_proto = nexthdr;
+@@ -212,11 +217,11 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
}
}
return dst_entries_get_fast(ops) > ops->gc_thresh * 2;
}
-@@ -329,19 +329,19 @@ static struct ctl_table xfrm6_policy_table[] = {
+@@ -329,19 +334,19 @@ static struct ctl_table xfrm6_policy_table[] = {
static int __net_init xfrm6_net_init(struct net *net)
{
if (!hdr)
goto err_reg;
-@@ -349,8 +349,7 @@ static int __net_init xfrm6_net_init(struct net *net)
+@@ -349,8 +354,7 @@ static int __net_init xfrm6_net_init(struct net *net)
return 0;
err_reg:
if (!ipx_proc_dir)
goto out;
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
-index 2ba8b97..6d33010 100644
+index 61ceb4c..e788eb8 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
-@@ -317,11 +317,11 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
+@@ -317,10 +317,10 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
add_wait_queue(&port->open_wait, &wait);
IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n",
+ __FILE__, __LINE__, tty->driver->name, atomic_read(&port->count));
spin_lock_irqsave(&port->lock, flags);
- if (!tty_hung_up_p(filp))
-- port->count--;
-+ atomic_dec(&port->count);
+- port->count--;
++ atomic_dec(&port->count);
port->blocked_open++;
spin_unlock_irqrestore(&port->lock, flags);
-@@ -356,7 +356,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
+@@ -355,7 +355,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
}
IRDA_DEBUG(1, "%s(%d):block_til_ready blocking on %s open_count=%d\n",
schedule();
}
-@@ -366,12 +366,12 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
+@@ -365,12 +365,12 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
spin_lock_irqsave(&port->lock, flags);
if (!tty_hung_up_p(filp))
if (!retval)
port->flags |= ASYNC_NORMAL_ACTIVE;
-@@ -445,12 +445,12 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
+@@ -444,12 +444,12 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
/* ++ is not atomic, so this should be protected - Jean II */
spin_lock_irqsave(&self->port.lock, flags);
/* Not really used by us, but lets do it anyway */
self->port.low_latency = (self->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0;
-@@ -987,7 +987,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty)
+@@ -985,7 +985,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty)
tty_kref_put(port->tty);
}
port->tty = NULL;
spin_unlock_irqrestore(&port->lock, flags);
wake_up_interruptible(&port->open_wait);
-@@ -1344,7 +1344,7 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m)
+@@ -1342,7 +1342,7 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m)
seq_putc(m, '\n');
seq_printf(m, "Role: %s\n", self->client ? "client" : "server");
return;
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
-index 7a95fa4..57be196 100644
+index a089b6b..3ca3b60 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -686,10 +686,10 @@ static void __iucv_auto_name(struct iucv_sock *iucv)
};
diff --git a/net/key/af_key.c b/net/key/af_key.c
-index ba2a2f9..b658bc3 100644
+index 1847ec4..26ef732 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
-@@ -3052,10 +3052,10 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struc
+@@ -3049,10 +3049,10 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struc
static u32 get_acqseq(void)
{
u32 res;
return res;
}
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
-index 76125c5..e474828 100644
+index edb78e6..8dc654a 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -42,12 +42,12 @@ struct l2tp_eth {
kfree_skb(skb);
}
-diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
-index 13752d9..b704a93 100644
---- a/net/l2tp/l2tp_ppp.c
-+++ b/net/l2tp/l2tp_ppp.c
-@@ -755,7 +755,8 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
- /* If PMTU discovery was enabled, use the MTU that was discovered */
- dst = sk_dst_get(tunnel->sock);
- if (dst != NULL) {
-- u32 pmtu = dst_mtu(__sk_dst_get(tunnel->sock));
-+ u32 pmtu = dst_mtu(dst);
-+
- if (pmtu != 0)
- session->mtu = session->mru = pmtu -
- PPPOL2TP_HEADER_OVERHEAD;
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index 1a3c7e0..80f8b0c 100644
--- a/net/llc/llc_proc.c
goto out;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 592f4b1..efa7aa9 100644
+index 927b4ea..88a30e2 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -864,7 +864,7 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
+@@ -540,7 +540,7 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
ret = ieee80211_vif_use_channel(sdata, chandef,
IEEE80211_CHANCTX_EXCLUSIVE);
}
local->_oper_chandef = *chandef;
ieee80211_hw_config(local, 0);
}
-@@ -3574,7 +3574,7 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy,
+@@ -3286,7 +3286,7 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy,
else
local->probe_req_reg--;
break;
ieee80211_queue_work(&local->hw, &local->reconfig_filter);
-@@ -3723,8 +3723,8 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
+@@ -3420,8 +3420,8 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
if (chanctx_conf) {
*chandef = chanctx_conf->def;
ret = 0;
if (local->use_chanctx)
*chandef = local->monitor_chandef;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
-index ac9836e..32613c1 100644
+index ef7a089..fe1caf7 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -28,6 +28,7 @@
#include "key.h"
#include "sta_info.h"
#include "debug.h"
-@@ -1011,7 +1012,7 @@ struct ieee80211_local {
+@@ -1055,7 +1056,7 @@ struct ieee80211_local {
/* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
spinlock_t queue_stop_reason_lock;
/* number of interfaces with corresponding FIF_ flags */
int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
-index 388b863..6575b55 100644
+index f75e5f1..3d9ad4f 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -531,7 +531,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
drv_stop(local);
err_del_bss:
sdata->bss = NULL;
-@@ -888,7 +888,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+@@ -889,7 +889,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
}
if (going_down)
switch (sdata->vif.type) {
case NL80211_IFTYPE_AP_VLAN:
-@@ -949,7 +949,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+@@ -950,7 +950,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
}
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
ieee80211_clear_tx_pending(local);
/*
-@@ -989,7 +989,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+@@ -990,7 +990,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
ieee80211_recalc_ps(local, -1);
ieee80211_stop_device(local);
/* no reconfiguring after stop! */
-@@ -1000,7 +1000,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+@@ -1001,7 +1001,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
ieee80211_configure_filter(local);
ieee80211_hw_config(local, hw_reconf_flags);
}
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
-index d17c26d..43d6bfb 100644
+index e0ab432..36b7b94 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -174,7 +174,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
/*
* Goal:
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
-index d478b88..8c8d157 100644
+index 4c5192e..04cc0d8 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -12,7 +12,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
goto suspend;
ieee80211_scan_cancel(local);
-@@ -58,7 +58,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
+@@ -59,7 +59,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
cancel_work_sync(&local->dynamic_ps_enable_work);
del_timer_sync(&local->dynamic_ps_timer);
if (local->wowlan) {
int err = drv_suspend(local, wowlan);
if (err < 0) {
-@@ -123,7 +123,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
+@@ -125,7 +125,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
WARN_ON(!list_empty(&local->chanctx_list));
/* stop hardware - this must stop RX */
return -EBUSY;
if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
-diff --git a/net/mac80211/rc80211_pid_debugfs.c b/net/mac80211/rc80211_pid_debugfs.c
-index 6ff1346..936ca9a 100644
---- a/net/mac80211/rc80211_pid_debugfs.c
-+++ b/net/mac80211/rc80211_pid_debugfs.c
-@@ -193,7 +193,7 @@ static ssize_t rate_control_pid_events_read(struct file *file, char __user *buf,
-
- spin_unlock_irqrestore(&events->lock, status);
-
-- if (copy_to_user(buf, pb, p))
-+ if (p > sizeof(pb) || copy_to_user(buf, pb, p))
- return -EFAULT;
-
- return p;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
-index a6cda52..f3b6776 100644
+index 725af7a..a21a20a 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
-@@ -1548,7 +1548,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+@@ -1643,7 +1643,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
}
#endif
/* everything else happens only if HW was up & running */
goto wake_up;
/*
-@@ -1772,7 +1772,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+@@ -1869,7 +1869,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
local->in_reconfig = false;
barrier();
/*
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
-index e9410d1..77b6378 100644
+index 6d77cce..36e2fc3 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
-@@ -1081,6 +1081,16 @@ config NETFILTER_XT_MATCH_ESP
+@@ -1096,6 +1096,16 @@ config NETFILTER_XT_MATCH_ESP
To compile it as a module, choose M here. If unsure, say N.
tristate '"hashlimit" match support'
depends on (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n)
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
-index bffdad7..f9317d1 100644
+index fad5fdb..ba3672a 100644
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
-@@ -133,6 +133,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_DEVGROUP) += xt_devgroup.o
+@@ -136,6 +136,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_DEVGROUP) += xt_devgroup.o
obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o
obj-$(CONFIG_NETFILTER_XT_MATCH_ECN) += xt_ecn.o
obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o
if (!todrop_rate[i]) return 0;
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
-index e683675..67cb16b 100644
+index 5c34e8d..0d8eb7f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -567,7 +567,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
if (ipvs->sync_state & IP_VS_STATE_MASTER)
ip_vs_sync_conn(net, cp, pkts);
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
-index 581a658..910e112 100644
+index fd3f444..ab28fa24 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -794,7 +794,7 @@ __ip_vs_update_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest,
{
.procname = "amemthresh",
.maxlen = sizeof(int),
-@@ -2075,7 +2075,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
+@@ -1989,7 +1989,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
" %-7s %-6d %-10d %-10d\n",
&dest->addr.in6,
ntohs(dest->port),
atomic_read(&dest->weight),
atomic_read(&dest->activeconns),
atomic_read(&dest->inactconns));
-@@ -2086,7 +2086,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
+@@ -2000,7 +2000,7 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
"%-7s %-6d %-10d %-10d\n",
ntohl(dest->addr.ip),
ntohs(dest->port),
atomic_read(&dest->weight),
atomic_read(&dest->activeconns),
atomic_read(&dest->inactconns));
-@@ -2564,7 +2564,7 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get,
+@@ -2471,7 +2471,7 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get,
entry.addr = dest->addr.ip;
entry.port = dest->port;
entry.weight = atomic_read(&dest->weight);
entry.u_threshold = dest->u_threshold;
entry.l_threshold = dest->l_threshold;
-@@ -3107,7 +3107,7 @@ static int ip_vs_genl_fill_dest(struct sk_buff *skb, struct ip_vs_dest *dest)
+@@ -3010,7 +3010,7 @@ static int ip_vs_genl_fill_dest(struct sk_buff *skb, struct ip_vs_dest *dest)
if (nla_put(skb, IPVS_DEST_ATTR_ADDR, sizeof(dest->addr), &dest->addr) ||
nla_put_be16(skb, IPVS_DEST_ATTR_PORT, dest->port) ||
nla_put_u32(skb, IPVS_DEST_ATTR_FWD_METHOD,
IP_VS_CONN_F_FWD_MASK)) ||
nla_put_u32(skb, IPVS_DEST_ATTR_WEIGHT,
atomic_read(&dest->weight)) ||
-@@ -3697,7 +3697,7 @@ static int __net_init ip_vs_control_net_init_sysctl(struct net *net)
+@@ -3600,7 +3600,7 @@ static int __net_init ip_vs_control_net_init_sysctl(struct net *net)
{
int idx;
struct netns_ipvs *ipvs = net_ipvs(net);
.procname = "lblcr_expiration",
.data = NULL,
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
-index db80126..ef7110e 100644
+index eadffb2..c2feeae 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -609,7 +609,7 @@ static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp,
else
pkts = sysctl_sync_threshold(ipvs);
goto sloop;
-@@ -895,7 +895,7 @@ static void ip_vs_proc_conn(struct net *net, struct ip_vs_conn_param *param,
+@@ -894,7 +894,7 @@ static void ip_vs_proc_conn(struct net *net, struct ip_vs_conn_param *param,
if (opt)
memcpy(&cp->in_seq, opt, sizeof(*opt));
cp->old_state = cp->state;
/*
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
-index 73ba1cc..1adfc7a 100644
+index 56896a4..dfe3806 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
-@@ -1102,7 +1102,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
+@@ -1114,7 +1114,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
else
rc = NF_ACCEPT;
/* do not touch skb anymore */
goto out;
}
-@@ -1194,7 +1194,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
+@@ -1206,7 +1206,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
else
rc = NF_ACCEPT;
/* do not touch skb anymore */
table = kmemdup(acct_sysctl_table, sizeof(acct_sysctl_table),
GFP_KERNEL);
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
-index 1f4f954..e364ad7 100644
+index de88c4a..ec84234 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
-@@ -1789,6 +1789,10 @@ void nf_conntrack_init_end(void)
+@@ -1739,6 +1739,10 @@ void nf_conntrack_init_end(void)
#define DYING_NULLS_VAL ((1<<30)+1)
#define TEMPLATE_NULLS_VAL ((1<<30)+2)
int nf_conntrack_init_net(struct net *net)
{
int ret = -ENOMEM;
-@@ -1814,7 +1818,11 @@ int nf_conntrack_init_net(struct net *net)
+@@ -1764,7 +1768,11 @@ int nf_conntrack_init_net(struct net *net)
if (!net->ct.stat)
goto err_pcpu_lists;
goto err_slabname;
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c
-index 1df1761..ce8b88a 100644
+index 4e78c57..ec8fb74 100644
--- a/net/netfilter/nf_conntrack_ecache.c
+++ b/net/netfilter/nf_conntrack_ecache.c
-@@ -188,7 +188,7 @@ static struct nf_ct_ext_type event_extend __read_mostly = {
+@@ -264,7 +264,7 @@ static struct nf_ct_ext_type event_extend __read_mostly = {
#ifdef CONFIG_SYSCTL
static int nf_conntrack_event_init_sysctl(struct net *net)
{
table = kmemdup(tstamp_sysctl_table, sizeof(tstamp_sysctl_table),
GFP_KERNEL);
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
-index 85296d4..8becdec 100644
+index daad602..384be13 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
-@@ -243,7 +243,7 @@ static const struct file_operations nflog_file_ops = {
+@@ -353,7 +353,7 @@ static const struct file_operations nflog_file_ops = {
#ifdef CONFIG_SYSCTL
static char nf_log_sysctl_fnames[NFPROTO_NUMPROTO-NFPROTO_UNSPEC][3];
static int nf_log_proc_dostring(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
-@@ -274,14 +274,16 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write,
+@@ -384,14 +384,16 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write,
rcu_assign_pointer(net->nf.nf_loggers[tindex], logger);
mutex_unlock(&nf_log_mutex);
} else {
}
diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c
-index f042ae5..30ea486 100644
+index c68c1e5..8b5d670 100644
--- a/net/netfilter/nf_sockopt.c
+++ b/net/netfilter/nf_sockopt.c
-@@ -45,7 +45,7 @@ int nf_register_sockopt(struct nf_sockopt_ops *reg)
+@@ -43,7 +43,7 @@ int nf_register_sockopt(struct nf_sockopt_ops *reg)
}
}
out:
mutex_unlock(&nf_sockopt_mutex);
return ret;
-@@ -55,7 +55,7 @@ EXPORT_SYMBOL(nf_register_sockopt);
+@@ -53,7 +53,7 @@ EXPORT_SYMBOL(nf_register_sockopt);
void nf_unregister_sockopt(struct nf_sockopt_ops *reg)
{
mutex_lock(&nf_sockopt_mutex);
}
EXPORT_SYMBOL(nf_unregister_sockopt);
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
-index d292c8d..9f1e166 100644
+index a11c5ff..aa413a7 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -79,7 +79,7 @@ static int nfnl_log_net_id __read_mostly;
goto nla_put_failure;
if (data_len) {
+diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
+index 108120f..5b169db 100644
+--- a/net/netfilter/nfnetlink_queue_core.c
++++ b/net/netfilter/nfnetlink_queue_core.c
+@@ -665,7 +665,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
+ * returned by nf_queue. For instance, callers rely on -ECANCELED to
+ * mean 'ignore this hook'.
+ */
+- if (IS_ERR(segs))
++ if (IS_ERR_OR_NULL(segs))
+ goto out_err;
+ queued = 0;
+ err = 0;
diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c
index 1840989..6895744 100644
--- a/net/netfilter/nft_compat.c
set_fs(old_fs);
ret = nla_put(skb, NFTA_MATCH_INFO, XT_ALIGN(m->matchsize), out);
kfree(out);
-diff --git a/net/netfilter/xt_bpf.c b/net/netfilter/xt_bpf.c
-index bbffdbda..12d4da8 100644
---- a/net/netfilter/xt_bpf.c
-+++ b/net/netfilter/xt_bpf.c
-@@ -23,11 +23,10 @@ MODULE_ALIAS("ip6t_bpf");
- static int bpf_mt_check(const struct xt_mtchk_param *par)
- {
- struct xt_bpf_info *info = par->matchinfo;
-- struct sock_fprog_kern program;
-+ struct sock_fprog program;
-
- program.len = info->bpf_program_num_elem;
-- program.filter = info->bpf_program;
--
-+ program.filter = (struct sock_filter __user *) info->bpf_program;
- if (sk_unattached_filter_create(&info->filter, &program)) {
- pr_info("bpf: check failed: parse error\n");
- return -EINVAL;
diff --git a/net/netfilter/xt_gradm.c b/net/netfilter/xt_gradm.c
new file mode 100644
index 0000000..c566332
+MODULE_ALIAS("ipt_gradm");
+MODULE_ALIAS("ip6t_gradm");
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
-index a3910fc..2d2ba14 100644
+index 47dc683..2e0d52c 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
-@@ -870,11 +870,11 @@ static int __net_init hashlimit_proc_net_init(struct net *net)
+@@ -871,11 +871,11 @@ static int __net_init hashlimit_proc_net_init(struct net *net)
{
struct hashlimit_net *hashlimit_net = hashlimit_pernet(net);
return 0;
}
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
-index e6fac7e..cdcd25e 100644
+index c416725..bd22eea 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
-@@ -257,7 +257,7 @@ static void netlink_overrun(struct sock *sk)
+@@ -265,7 +265,7 @@ static void netlink_overrun(struct sock *sk)
sk->sk_error_report(sk);
}
}
}
static void netlink_rcv_wake(struct sock *sk)
-@@ -3058,7 +3058,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
+@@ -715,7 +715,7 @@ static int netlink_mmap_sendmsg(struct sock *sk, struct msghdr *msg,
+ * after validation, the socket and the ring may only be used by a
+ * single process, otherwise we fall back to copying.
+ */
+- if (atomic_long_read(&sk->sk_socket->file->f_count) > 2 ||
++ if (atomic_long_read(&sk->sk_socket->file->f_count) > 1 ||
+ atomic_read(&nlk->mapped) > 1)
+ excl = false;
+
+@@ -2996,7 +2996,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
sk_wmem_alloc_get(s),
nlk->cb_running,
atomic_read(&s->sk_refcnt),
sock_i_ino(s)
);
+diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
+index 64dc864..7a9e2a4 100644
+--- a/net/openvswitch/datapath.c
++++ b/net/openvswitch/datapath.c
+@@ -332,6 +332,8 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
+ segs = __skb_gso_segment(skb, NETIF_F_SG, false);
+ if (IS_ERR(segs))
+ return PTR_ERR(segs);
++ if (segs == NULL)
++ return -EINVAL;
+
+ /* Queue all of the segments. */
+ skb = segs;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
-index b85c67c..09705b7 100644
+index 93896d2..b701c88 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -275,7 +275,7 @@ static int packet_direct_xmit(struct sk_buff *skb)
kfree_skb(skb);
return NET_XMIT_DROP;
}
-@@ -636,6 +636,7 @@ static void init_prb_bdqc(struct packet_sock *po,
- p1->tov_in_jiffies = msecs_to_jiffies(p1->retire_blk_tov);
- p1->blk_sizeof_priv = req_u->req3.tp_sizeof_priv;
-
-+ p1->max_frame_len = p1->kblk_size - BLK_PLUS_PRIV(p1->blk_sizeof_priv);
- prb_init_ft_ops(p1, req_u);
- prb_setup_retire_blk_timer(po, tx_ring);
- prb_open_block(p1, pbd);
-@@ -1845,7 +1846,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
+@@ -1842,7 +1842,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
spin_lock(&sk->sk_receive_queue.lock);
po->stats.stats1.tp_packets++;
__skb_queue_tail(&sk->sk_receive_queue, skb);
spin_unlock(&sk->sk_receive_queue.lock);
sk->sk_data_ready(sk);
-@@ -1854,7 +1855,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
+@@ -1851,7 +1851,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
drop_n_acct:
spin_lock(&sk->sk_receive_queue.lock);
po->stats.stats1.tp_drops++;
spin_unlock(&sk->sk_receive_queue.lock);
drop_n_restore:
-@@ -1946,6 +1947,18 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
- if ((int)snaplen < 0)
- snaplen = 0;
- }
-+ } else if (unlikely(macoff + snaplen >
-+ GET_PBDQC_FROM_RB(&po->rx_ring)->max_frame_len)) {
-+ u32 nval;
-+
-+ nval = GET_PBDQC_FROM_RB(&po->rx_ring)->max_frame_len - macoff;
-+ pr_err_once("tpacket_rcv: packet too big, clamped from %u to %u. macoff=%u\n",
-+ snaplen, nval, macoff);
-+ snaplen = nval;
-+ if (unlikely((int)snaplen < 0)) {
-+ snaplen = 0;
-+ macoff = GET_PBDQC_FROM_RB(&po->rx_ring)->max_frame_len;
-+ }
- }
- spin_lock(&sk->sk_receive_queue.lock);
- h.raw = packet_current_rx_frame(po, skb,
-@@ -3459,7 +3472,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
+@@ -3466,7 +3466,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
case PACKET_HDRLEN:
if (len > sizeof(int))
len = sizeof(int);
return -EFAULT;
switch (val) {
case TPACKET_V1:
-@@ -3505,7 +3518,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
+@@ -3512,7 +3512,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
len = lv;
if (put_user(len, optlen))
return -EFAULT;
return -EFAULT;
return 0;
}
-@@ -3789,6 +3802,10 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
- goto out;
- if (unlikely(req->tp_block_size & (PAGE_SIZE - 1)))
- goto out;
-+ if (po->tp_version >= TPACKET_V3 &&
-+ (int)(req->tp_block_size -
-+ BLK_PLUS_PRIV(req_u->req3.tp_sizeof_priv)) <= 0)
-+ goto out;
- if (unlikely(req->tp_frame_size < po->tp_hdrlen +
- po->tp_reserve))
- goto out;
-diff --git a/net/packet/internal.h b/net/packet/internal.h
-index eb9580a..cdddf6a 100644
---- a/net/packet/internal.h
-+++ b/net/packet/internal.h
-@@ -29,6 +29,7 @@ struct tpacket_kbdq_core {
- char *pkblk_start;
- char *pkblk_end;
- int kblk_size;
-+ unsigned int max_frame_len;
- unsigned int knum_blocks;
- uint64_t knxt_seq_num;
- char *prev;
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 70a547e..23477fe 100644
--- a/net/phonet/pep.c
}
#endif
+diff --git a/net/rds/rdma.c b/net/rds/rdma.c
+index 4e37c1c..40084d8 100644
+--- a/net/rds/rdma.c
++++ b/net/rds/rdma.c
+@@ -564,12 +564,12 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
+
+ if (rs->rs_bound_addr == 0) {
+ ret = -ENOTCONN; /* XXX not a great errno */
+- goto out;
++ goto out_ret;
+ }
+
+ if (args->nr_local > UIO_MAXIOV) {
+ ret = -EMSGSIZE;
+- goto out;
++ goto out_ret;
+ }
+
+ /* Check whether to allocate the iovec area */
+@@ -578,7 +578,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
+ iovs = sock_kmalloc(rds_rs_to_sk(rs), iov_size, GFP_KERNEL);
+ if (!iovs) {
+ ret = -ENOMEM;
+- goto out;
++ goto out_ret;
+ }
+ }
+
+@@ -696,6 +696,7 @@ out:
+ if (iovs != iovstack)
+ sock_kfree_s(rds_rs_to_sk(rs), iovs, iov_size);
+ kfree(pages);
++out_ret:
+ if (ret)
+ rds_rdma_free_op(op);
+ else
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 48f8ffc..0ef3eec 100644
--- a/net/rds/rds.h
struct rds_sock {
struct sock rs_sk;
+diff --git a/net/rds/send.c b/net/rds/send.c
+index 2371816..0a64541 100644
+--- a/net/rds/send.c
++++ b/net/rds/send.c
+@@ -593,8 +593,11 @@ static void rds_send_remove_from_sock(struct list_head *messages, int status)
+ sock_put(rds_rs_to_sk(rs));
+ }
+ rs = rm->m_rs;
+- sock_hold(rds_rs_to_sk(rs));
++ if (rs)
++ sock_hold(rds_rs_to_sk(rs));
+ }
++ if (!rs)
++ goto unlock_and_drop;
+ spin_lock(&rs->rs_lock);
+
+ if (test_and_clear_bit(RDS_MSG_ON_SOCK, &rm->m_flags)) {
+@@ -638,9 +641,6 @@ unlock_and_drop:
+ * queue. This means that in the TCP case, the message may not have been
+ * assigned the m_ack_seq yet - but that's fine as long as tcp_is_acked
+ * checks the RDS_MSG_HAS_ACK_SEQ bit.
+- *
+- * XXX It's not clear to me how this is safely serialized with socket
+- * destruction. Maybe it should bail if it sees SOCK_DEAD.
+ */
+ void rds_send_drop_acked(struct rds_connection *conn, u64 ack,
+ is_acked_func is_acked)
+@@ -711,6 +711,9 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest)
+ */
+ if (!test_and_clear_bit(RDS_MSG_ON_CONN, &rm->m_flags)) {
+ spin_unlock_irqrestore(&conn->c_lock, flags);
++ spin_lock_irqsave(&rm->m_rs_lock, flags);
++ rm->m_rs = NULL;
++ spin_unlock_irqrestore(&rm->m_rs_lock, flags);
+ continue;
+ }
+ list_del_init(&rm->m_conn_item);
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index edac9ef..16bcb98 100644
--- a/net/rds/tcp.c
_proto("Tx RESPONSE %%%u", ntohl(hdr->serial));
ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 3, len);
-diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
-index 13f64df..1618696 100644
---- a/net/sched/cls_bpf.c
-+++ b/net/sched/cls_bpf.c
-@@ -160,7 +160,7 @@ static int cls_bpf_modify_existing(struct net *net, struct tcf_proto *tp,
- {
- struct sock_filter *bpf_ops, *bpf_old;
- struct tcf_exts exts;
-- struct sock_fprog_kern tmp;
-+ struct sock_fprog tmp;
- struct sk_filter *fp, *fp_old;
- u16 bpf_size, bpf_len;
- u32 classid;
-@@ -191,7 +191,7 @@ static int cls_bpf_modify_existing(struct net *net, struct tcf_proto *tp,
- memcpy(bpf_ops, nla_data(tb[TCA_BPF_OPS]), bpf_size);
-
- tmp.len = bpf_len;
-- tmp.filter = bpf_ops;
-+ tmp.filter = (struct sock_filter __user *) bpf_ops;
-
- ret = sk_unattached_filter_create(&fp, &tmp);
- if (ret)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
-index e1543b0..7ce8bd0 100644
+index fc04fe9..8167357 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -310,7 +310,7 @@ void netif_carrier_on(struct net_device *dev)
}
}
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
-index 1999592..6684af6 100644
+index 0e4198e..f94193e 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
-@@ -964,7 +964,7 @@ static const struct inet6_protocol sctpv6_protocol = {
+@@ -972,7 +972,7 @@ static const struct inet6_protocol sctpv6_protocol = {
.flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
};
.sa_family = AF_INET6,
.sctp_xmit = sctp_v6_xmit,
.setsockopt = ipv6_setsockopt,
-@@ -996,7 +996,7 @@ static struct sctp_af sctp_af_inet6 = {
+@@ -1002,7 +1002,7 @@ static struct sctp_af sctp_af_inet6 = {
#endif
};
.event_msgname = sctp_inet6_event_msgname,
.skb_msgname = sctp_inet6_skb_msgname,
.af_supported = sctp_inet6_af_supported,
-@@ -1021,7 +1021,7 @@ void sctp_v6_pf_init(void)
+@@ -1029,7 +1029,7 @@ void sctp_v6_pf_init(void)
void sctp_v6_pf_exit(void)
{
/* Initialize IPv6 support and register with socket layer. */
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
-index 6789d785..0798d76 100644
+index 6240834..cac4b52 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -836,8 +836,10 @@ int sctp_register_af(struct sctp_af *af)
.event_msgname = sctp_inet_event_msgname,
.skb_msgname = sctp_inet_skb_msgname,
.af_supported = sctp_inet_af_supported,
-@@ -1037,7 +1039,7 @@ static const struct net_protocol sctp_protocol = {
+@@ -1039,7 +1041,7 @@ static const struct net_protocol sctp_protocol = {
};
/* IPv4 address related functions. */
sctp_generate_t1_cookie_event,
sctp_generate_t1_init_event,
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
-index 4298996..fa5f636 100644
+index 634a2ab..8e93929 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
-@@ -2176,11 +2176,13 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
+@@ -2199,11 +2199,13 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
{
struct sctp_association *asoc;
struct sctp_ulpevent *event;
return -EFAULT;
+ sctp_sk(sk)->subscribe = subscribe;
- /*
- * At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT,
-@@ -4260,13 +4262,16 @@ static int sctp_getsockopt_disable_fragments(struct sock *sk, int len,
+ if (sctp_sk(sk)->subscribe.sctp_data_io_event)
+ pr_warn_ratelimited(DEPRECATED "%s (pid %d) "
+@@ -4372,13 +4374,16 @@ static int sctp_getsockopt_disable_fragments(struct sock *sk, int len,
static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval,
int __user *optlen)
{
return -EFAULT;
return 0;
}
-@@ -4284,6 +4289,8 @@ static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval,
+@@ -4396,6 +4401,8 @@ static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval,
*/
static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optval, int __user *optlen)
{
/* Applicable to UDP-style socket only */
if (sctp_style(sk, TCP))
return -EOPNOTSUPP;
-@@ -4292,7 +4299,8 @@ static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optv
+@@ -4404,7 +4411,8 @@ static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optv
len = sizeof(int);
if (put_user(len, optlen))
return -EFAULT;
return -EFAULT;
return 0;
}
-@@ -4667,12 +4675,15 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len,
+@@ -4778,12 +4786,15 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len,
*/
static int sctp_getsockopt_initmsg(struct sock *sk, int len, char __user *optval, int __user *optlen)
{
return -EFAULT;
return 0;
}
-@@ -4713,6 +4724,8 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
- addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
+@@ -4824,6 +4835,8 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
+ ->addr_to_user(sp, &temp);
if (space_left < addrlen)
return -ENOMEM;
+ if (addrlen > sizeof(temp) || addrlen < 0)
return -EFAULT;
to += addrlen;
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
-index 12c7e01..a755b3e 100644
+index 2e9ada1..40f425d 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -321,7 +321,7 @@ static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,
int ret, new_value;
memset(&tbl, 0, sizeof(struct ctl_table));
-@@ -435,7 +435,7 @@ static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
+@@ -436,7 +436,7 @@ static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
loff_t *ppos)
{
struct net *net = current->nsproxy->net_ns;
int new_value, ret;
memset(&tbl, 0, sizeof(struct ctl_table));
-@@ -462,7 +462,7 @@ static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
+@@ -463,7 +463,7 @@ static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
int sctp_sysctl_net_register(struct net *net)
{
table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL);
diff --git a/net/socket.c b/net/socket.c
-index abf56b2..4cac767 100644
+index 4cdbc10..f075204 100644
--- a/net/socket.c
+++ b/net/socket.c
-@@ -72,7 +72,6 @@
- #include <linux/if_bridge.h>
- #include <linux/if_frad.h>
- #include <linux/if_vlan.h>
--#include <linux/ptp_classify.h>
- #include <linux/init.h>
- #include <linux/poll.h>
- #include <linux/cache.h>
-@@ -89,6 +88,7 @@
+@@ -89,6 +89,7 @@
#include <linux/magic.h>
#include <linux/slab.h>
#include <linux/xattr.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
-@@ -112,6 +112,8 @@ unsigned int sysctl_net_busy_read __read_mostly;
+@@ -113,6 +114,8 @@ unsigned int sysctl_net_busy_read __read_mostly;
unsigned int sysctl_net_busy_poll __read_mostly;
#endif
static int sock_no_open(struct inode *irrelevant, struct file *dontcare);
static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos);
-@@ -163,7 +165,7 @@ static const struct file_operations socket_file_ops = {
+@@ -164,7 +167,7 @@ static const struct file_operations socket_file_ops = {
*/
static DEFINE_SPINLOCK(net_family_lock);
/*
* Statistics counters of the socket lists
-@@ -329,7 +331,7 @@ static struct dentry *sockfs_mount(struct file_system_type *fs_type,
+@@ -330,7 +333,7 @@ static struct dentry *sockfs_mount(struct file_system_type *fs_type,
&sockfs_dentry_operations, SOCKFS_MAGIC);
}
static struct file_system_type sock_fs_type = {
.name = "sockfs",
-@@ -1257,6 +1259,8 @@ int __sock_create(struct net *net, int family, int type, int protocol,
+@@ -1265,6 +1268,8 @@ int __sock_create(struct net *net, int family, int type, int protocol,
return -EAFNOSUPPORT;
if (type < 0 || type >= SOCK_MAX)
return -EINVAL;
/* Compatibility.
-@@ -1277,6 +1281,20 @@ int __sock_create(struct net *net, int family, int type, int protocol,
+@@ -1285,6 +1290,20 @@ int __sock_create(struct net *net, int family, int type, int protocol,
if (err)
return err;
/*
* Allocate the socket and allow the family to set things up. if
* the protocol is 0, the family is instructed to select an appropriate
-@@ -1528,6 +1546,14 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
+@@ -1536,6 +1555,14 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
if (sock) {
err = move_addr_to_kernel(umyaddr, addrlen, &address);
if (err >= 0) {
err = security_socket_bind(sock,
(struct sockaddr *)&address,
addrlen);
-@@ -1536,6 +1562,7 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
+@@ -1544,6 +1571,7 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
(struct sockaddr *)
&address, addrlen);
}
fput_light(sock->file, fput_needed);
}
return err;
-@@ -1559,10 +1586,20 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog)
+@@ -1567,10 +1595,20 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog)
if ((unsigned int)backlog > somaxconn)
backlog = somaxconn;
fput_light(sock->file, fput_needed);
}
return err;
-@@ -1606,6 +1643,18 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
+@@ -1614,6 +1652,18 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
newsock->type = sock->type;
newsock->ops = sock->ops;
/*
* We don't need try_module_get here, as the listening socket (sock)
* has the protocol module (sock->ops->owner) held.
-@@ -1651,6 +1700,8 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
+@@ -1659,6 +1709,8 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
fd_install(newfd, newfile);
err = newfd;
out_put:
fput_light(sock->file, fput_needed);
out:
-@@ -1683,6 +1734,7 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
+@@ -1691,6 +1743,7 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
int, addrlen)
{
struct socket *sock;
struct sockaddr_storage address;
int err, fput_needed;
-@@ -1693,6 +1745,17 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
+@@ -1701,6 +1754,17 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
if (err < 0)
goto out_put;
err =
security_socket_connect(sock, (struct sockaddr *)&address, addrlen);
if (err)
-@@ -1774,6 +1837,8 @@ SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
+@@ -1782,6 +1846,8 @@ SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
* the protocol.
*/
SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len,
unsigned int, flags, struct sockaddr __user *, addr,
int, addr_len)
-@@ -1840,7 +1905,7 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
+@@ -1848,7 +1914,7 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
struct socket *sock;
struct iovec iov;
struct msghdr msg;
int err, err2;
int fput_needed;
-@@ -2066,7 +2131,7 @@ static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
+@@ -2077,7 +2143,7 @@ static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
* checking falls down on this.
*/
if (copy_from_user(ctl_buf,
ctl_len))
goto out_freectl;
msg_sys->msg_control = ctl_buf;
-@@ -2217,7 +2282,7 @@ static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
+@@ -2228,7 +2294,7 @@ static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
int err, total_len, len;
/* kernel mode address */
/* user mode address pointers */
struct sockaddr __user *uaddr;
-@@ -2246,7 +2311,7 @@ static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
+@@ -2257,7 +2323,7 @@ static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
/* Save the user-mode address (verify_iovec will change the
* kernel msghdr to use the kernel address space)
*/
uaddr_len = COMPAT_NAMELEN(msg);
if (MSG_CMSG_COMPAT & flags)
err = verify_compat_iovec(msg_sys, iov, &addr, VERIFY_WRITE);
-@@ -2686,7 +2751,9 @@ static int __init sock_init(void)
- goto out;
- #endif
-
-- ptp_classifier_init();
-+#ifdef CONFIG_NETWORK_PHY_TIMESTAMPING
-+ skb_timestamping_init();
-+#endif
-
- out:
- return err;
-@@ -2887,7 +2954,7 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
+@@ -2898,7 +2964,7 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
ifr = compat_alloc_user_space(buf_size);
rxnfc = (void __user *)ifr + ALIGN(sizeof(struct ifreq), 8);
return -EFAULT;
if (put_user(convert_in ? rxnfc : compat_ptr(data),
-@@ -2998,7 +3065,7 @@ static int bond_ioctl(struct net *net, unsigned int cmd,
+@@ -3009,7 +3075,7 @@ static int bond_ioctl(struct net *net, unsigned int cmd,
old_fs = get_fs();
set_fs(KERNEL_DS);
err = dev_ioctl(net, cmd,
set_fs(old_fs);
return err;
-@@ -3091,7 +3158,7 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd,
+@@ -3102,7 +3168,7 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd,
old_fs = get_fs();
set_fs(KERNEL_DS);
set_fs(old_fs);
if (cmd == SIOCGIFMAP && !err) {
-@@ -3175,7 +3242,7 @@ static int routing_ioctl(struct net *net, struct socket *sock,
+@@ -3186,7 +3252,7 @@ static int routing_ioctl(struct net *net, struct socket *sock,
ret |= get_user(rtdev, &(ur4->rt_dev));
if (rtdev) {
ret |= copy_from_user(devname, compat_ptr(rtdev), 15);
devname[15] = 0;
} else
r4.rt_dev = NULL;
-@@ -3402,8 +3469,8 @@ int kernel_getsockopt(struct socket *sock, int level, int optname,
+@@ -3413,8 +3479,8 @@ int kernel_getsockopt(struct socket *sock, int level, int optname,
int __user *uoptlen;
int err;
set_fs(KERNEL_DS);
if (level == SOL_SOCKET)
-@@ -3423,7 +3490,7 @@ int kernel_setsockopt(struct socket *sock, int level, int optname,
+@@ -3434,7 +3500,7 @@ int kernel_setsockopt(struct socket *sock, int level, int optname,
char __user *uoptval;
int err;
set_fs(KERNEL_DS);
if (level == SOL_SOCKET)
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
-index 4ce5ecce..7bef300 100644
+index c548ab2..4e1b68b 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1140,7 +1140,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
goto out_nomem;
cd->u.procfs.channel_ent = NULL;
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
-index 2e6ab10..3170800 100644
+index 488ddee..1b31487 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1425,7 +1425,9 @@ call_start(struct rpc_task *task)
task->tk_action = call_reserve;
}
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
-index c0365c1..b7f02b3 100644
+index 9358c79..22d0a5b 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
-@@ -261,9 +261,9 @@ static int rpc_wait_bit_killable(void *word)
+@@ -261,9 +261,9 @@ static int rpc_wait_bit_killable(struct wait_bit_key *key)
#if defined(RPC_DEBUG) || defined(RPC_TRACEPOINTS)
static void rpc_task_set_debuginfo(struct rpc_task *task)
{
return -ENOMEM;
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
-index 5de6801..b4e330d 100644
+index 1db5007..6e66296 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1167,7 +1167,9 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
.proc_handler = read_reset_stat,
},
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
-index 8f92a61..eb13b74 100644
+index e011027..9d3c4e1 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
-@@ -219,7 +219,7 @@ static int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt,
+@@ -220,7 +220,7 @@ static int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt,
*page_no = pg_no;
*page_offset = pg_off;
ret = read;
return ret;
err:
svc_rdma_unmap_dma(ctxt);
-@@ -355,7 +355,7 @@ static int rdma_read_chunk_frmr(struct svcxprt_rdma *xprt,
+@@ -356,7 +356,7 @@ static int rdma_read_chunk_frmr(struct svcxprt_rdma *xprt,
*page_no = pg_no;
*page_offset = pg_off;
ret = read;
return ret;
err:
svc_rdma_unmap_dma(ctxt);
-@@ -512,7 +512,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
+@@ -540,7 +540,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
dto_q);
list_del_init(&ctxt->dto_q);
} else {
clear_bit(XPT_DATA, &xprt->xpt_flags);
ctxt = NULL;
}
-@@ -531,7 +531,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
+@@ -559,7 +559,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
dprintk("svcrdma: processing ctxt=%p on xprt=%p, rqstp=%p, status=%d\n",
ctxt, rdma_xprt, rqstp, ctxt->wc_status);
BUG_ON(ctxt->wc_status != IB_WC_SUCCESS);
/* Build up the XDR from the receive buffers. */
rdma_build_arg_xdr(rqstp, ctxt, ctxt->byte_len);
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
-index 49fd21a..4bc455b 100644
+index 9f1b506..2e0b321 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
-@@ -206,7 +206,7 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
+@@ -208,7 +208,7 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
write_wr.wr.rdma.remote_addr = to;
/* Post It */
+ atomic_inc_unchecked(&rdma_stat_write);
if (svc_rdma_send(xprt, &write_wr))
goto err;
- return 0;
+ return write_len - bc;
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
-index 06a5d92..c2fa21a 100644
+index 374feb4..46487d5 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -295,7 +295,7 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
}
static void sq_comp_handler(struct ib_cq *cq, void *cq_context)
-@@ -1279,7 +1279,7 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr)
+@@ -1264,7 +1264,7 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr)
spin_lock_bh(&xprt->sc_lock);
if (xprt->sc_sq_depth < atomic_read(&xprt->sc_sq_count) + wr_count) {
spin_unlock_bh(&xprt->sc_lock);
return -ENOMEM;
if (!proc_create("x25/route", S_IRUGO, init_net.proc_net,
+diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
+index c51e8f7b..e44f360 100644
+--- a/net/xfrm/xfrm_output.c
++++ b/net/xfrm/xfrm_output.c
+@@ -157,6 +157,8 @@ static int xfrm_output_gso(struct sk_buff *skb)
+ kfree_skb(skb);
+ if (IS_ERR(segs))
+ return PTR_ERR(segs);
++ if (segs == NULL)
++ return -EINVAL;
+
+ do {
+ struct sk_buff *nskb = segs->next;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
-index 0525d78..cccf7fd 100644
+index fdde51f..4839450 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
-@@ -325,7 +325,7 @@ static void xfrm_policy_kill(struct xfrm_policy *policy)
+@@ -330,7 +330,7 @@ static void xfrm_policy_kill(struct xfrm_policy *policy)
{
policy->walk.dead = 1;
if (del_timer(&policy->polq.hold_timer))
xfrm_pol_put(policy);
-@@ -659,7 +659,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
+@@ -664,7 +664,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
hlist_add_head(&policy->bydst, chain);
xfrm_pol_hold(policy);
net->xfrm.policy_count[dir]++;
/* After previous checking, family can either be AF_INET or AF_INET6 */
if (policy->family == AF_INET)
-@@ -1749,7 +1749,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
+@@ -1754,7 +1754,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
xdst->num_pols = num_pols;
memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
return xdst;
}
-@@ -2538,10 +2538,11 @@ void xfrm_garbage_collect(struct net *net)
+@@ -2570,10 +2570,11 @@ void xfrm_garbage_collect(struct net *net)
}
EXPORT_SYMBOL(xfrm_garbage_collect);
static void xfrm_init_pmtu(struct dst_entry *dst)
{
-@@ -2591,7 +2592,7 @@ static int xfrm_bundle_ok(struct xfrm_dst *first)
+@@ -2623,7 +2624,7 @@ static int xfrm_bundle_ok(struct xfrm_dst *first)
if (xdst->xfrm_genid != dst->xfrm->genid)
return 0;
if (xdst->num_pols > 0 &&
return 0;
mtu = dst_mtu(dst->child);
-@@ -2679,8 +2680,6 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
+@@ -2711,8 +2712,6 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
dst_ops->link_failure = xfrm_link_failure;
if (likely(dst_ops->neigh_lookup == NULL))
dst_ops->neigh_lookup = xfrm_neigh_lookup;
rcu_assign_pointer(xfrm_policy_afinfo[afinfo->family], afinfo);
}
spin_unlock(&xfrm_policy_afinfo_lock);
-@@ -2734,7 +2733,6 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo)
+@@ -2766,7 +2765,6 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo)
dst_ops->check = NULL;
dst_ops->negative_advice = NULL;
dst_ops->link_failure = NULL;
}
return err;
}
-@@ -3119,7 +3117,7 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol,
+@@ -3151,7 +3149,7 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol,
sizeof(pol->xfrm_vec[i].saddr));
pol->xfrm_vec[i].encap_family = mp->new_family;
/* flush bundles */
endif
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
-index 686cb0d..9d653bf 100644
+index a651cee..6b3b9a3 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -43,7 +43,8 @@ subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
- __clean-files := $(extra-y) $(always) \
- $(targets) $(clean-files) \
+ __clean-files := $(extra-y) $(extra-m) $(extra-) \
+ $(always) $(targets) $(clean-files) \
$(host-progs) \
- $(hostprogs-y) $(hostprogs-m) $(hostprogs-)
+ $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
__clean-files := $(filter-out $(no-clean-files), $(__clean-files))
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
-index 6689364..e56dc6a 100644
+index ab5980f..85fd3e1 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
-@@ -31,6 +31,8 @@
- # Note: Shared libraries consisting of C++ files are not supported
-
+@@ -20,7 +20,19 @@
+ # Will compile qconf as a C++ program, and menu as a C program.
+ # They are linked as C++ code to the executable qconf
+
++# hostprogs-y := conf
++# conf-objs := conf.o libkconfig.so
++# libkconfig-objs := expr.o type.o
++# Will create a shared library named libkconfig.so that consists of
++# expr.o and type.o (they are both compiled as C code and the object files
++# are made as position independent code).
++# conf.c is compiled as a C program, and conf.o is linked together with
++# libkconfig.so as the executable conf.
++# Note: Shared libraries consisting of C++ files are not supported
++
__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
+__hostlibs := $(sort $(hostlibs-y) $(hostlibs-m))
+__hostcxxlibs := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m))
# C code
# Executables compiled from a single .c file
-@@ -54,11 +56,15 @@ host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs)))
- # Shared libaries (only .c supported)
- # Shared libraries (.so) - all .so files referenced in "xxx-objs"
- host-cshlib := $(sort $(filter %.so, $(host-cobjs)))
+@@ -42,6 +54,19 @@ host-cxxmulti := $(foreach m,$(__hostprogs),$(if $($(m)-cxxobjs),$(m)))
+ # C++ Object (.o) files compiled from .cc files
+ host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs)))
+
++# Shared libaries (only .c supported)
++# Shared libraries (.so) - all .so files referenced in "xxx-objs"
++host-cshlib := $(sort $(filter %.so, $(host-cobjs)))
+host-cshlib += $(sort $(filter %.so, $(__hostlibs)))
+host-cxxshlib := $(sort $(filter %.so, $(__hostcxxlibs)))
- # Remove .so files from "xxx-objs"
- host-cobjs := $(filter-out %.so,$(host-cobjs))
++# Remove .so files from "xxx-objs"
++host-cobjs := $(filter-out %.so,$(host-cobjs))
+host-cxxobjs := $(filter-out %.so,$(host-cxxobjs))
-
--#Object (.o) files used by the shared libaries
++
+# Object (.o) files used by the shared libaries
- host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
++host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
+host-cxxshobjs := $(sort $(foreach m,$(host-cxxshlib),$($(m:.so=-objs))))
-
++
# output directory for programs/.o files
- # hostprogs-y := tools/build may have been specified. Retrieve directory
-@@ -82,7 +88,9 @@ host-cobjs := $(addprefix $(obj)/,$(host-cobjs))
+ # hostprogs-y := tools/build may have been specified.
+ # Retrieve also directory of .o files from prog-objs or prog-cxxobjs notation
+@@ -56,6 +81,10 @@ host-cmulti := $(addprefix $(obj)/,$(host-cmulti))
+ host-cobjs := $(addprefix $(obj)/,$(host-cobjs))
host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti))
host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs))
- host-cshlib := $(addprefix $(obj)/,$(host-cshlib))
++host-cshlib := $(addprefix $(obj)/,$(host-cshlib))
+host-cxxshlib := $(addprefix $(obj)/,$(host-cxxshlib))
- host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs))
++host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs))
+host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs))
host-objdirs := $(addprefix $(obj)/,$(host-objdirs))
obj-dirs += $(host-objdirs)
-@@ -156,6 +164,13 @@ quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
- $(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE
- $(call if_changed_dep,host-cshobjs)
+@@ -96,7 +125,7 @@ quiet_cmd_host-cmulti = HOSTLD $@
+ cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
+ $(addprefix $(obj)/,$($(@F)-objs)) \
+ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
+-$(host-cmulti): $(obj)/%: $(host-cobjs) FORCE
++$(host-cmulti): $(obj)/%: $(host-cobjs) $(host-cshlib) FORCE
+ $(call if_changed,host-cmulti)
+
+ # Create .o file from a single .c file
+@@ -113,7 +142,7 @@ quiet_cmd_host-cxxmulti = HOSTLD $@
+ $(foreach o,objs cxxobjs,\
+ $(addprefix $(obj)/,$($(@F)-$(o)))) \
+ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
+-$(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) FORCE
++$(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
+ $(call if_changed,host-cxxmulti)
+
+ # Create .o file from a single .cc (C++) file
+@@ -122,5 +151,37 @@ quiet_cmd_host-cxxobjs = HOSTCXX $@
+ $(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE
+ $(call if_changed_dep,host-cxxobjs)
++# Compile .c file, create position independent .o file
++# host-cshobjs -> .o
++quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
++ cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
++$(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE
++ $(call if_changed_dep,host-cshobjs)
++
+# Compile .c file, create position independent .o file
+# host-cxxshobjs -> .o
+quiet_cmd_host-cxxshobjs = HOSTCXX -fPIC $@
+$(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE
+ $(call if_changed_dep,host-cxxshobjs)
+
- # Link a shared library, based on position independent .o files
- # *.o -> .so shared library (host-cshlib)
- quiet_cmd_host-cshlib = HOSTLLD -shared $@
-@@ -165,5 +180,14 @@ quiet_cmd_host-cshlib = HOSTLLD -shared $@
- $(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE
- $(call if_changed,host-cshlib)
-
++# Link a shared library, based on position independent .o files
++# *.o -> .so shared library (host-cshlib)
++quiet_cmd_host-cshlib = HOSTLLD -shared $@
++ cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \
++ $(addprefix $(obj)/,$($(@F:.so=-objs))) \
++ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
++$(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE
++ $(call if_changed,host-cshlib)
++
+# Link a shared library, based on position independent .o files
+# *.o -> .so shared library (host-cxxshlib)
+quiet_cmd_host-cxxshlib = HOSTLLD -shared $@
+ $(call if_changed,host-cxxshlib)
+
targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
-- $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs)
+- $(host-cxxmulti) $(host-cxxobjs)
+ $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) $(host-cxxshlib) $(host-cxxshobjs)
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index b304068..462d24e 100644
fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
diff --git a/scripts/gcc-plugin.sh b/scripts/gcc-plugin.sh
new file mode 100644
-index 0000000..3fd3699
+index 0000000..42018ed
--- /dev/null
+++ b/scripts/gcc-plugin.sh
-@@ -0,0 +1,43 @@
-+#!/bin/bash
+@@ -0,0 +1,51 @@
++#!/bin/sh
+srctree=$(dirname "$0")
+gccplugins_dir=$($3 -print-file-name=plugin)
+plugincc=$($1 -E - -o /dev/null -I${srctree}/../tools/gcc -I${gccplugins_dir}/include 2>&1 <<EOF
+ exit 1
+fi
+
-+if [[ "$plugincc" =~ "$1 CC" ]]
-+then
-+ echo "$1"
-+ exit 0
-+fi
++case "$plugincc" in
++ *"$1 CC"*)
++ echo "$1"
++ exit 0
++ ;;
+
-+if [[ "$plugincc" =~ "$2 CXX" ]]
-+then
-+plugincc=$($1 -c -x c++ -std=gnu++98 - -o /dev/null -I${srctree}/../tools/gcc -I${gccplugins_dir}/include 2>&1 <<EOF
++ *"$2 CXX"*)
++ # the c++ compiler needs another test, see below
++ ;;
++
++ *)
++ exit 1
++ ;;
++esac
++
++# we need a c++ compiler that supports the designated initializer GNU extension
++plugincc=$($2 -c -x c++ -std=gnu++98 - -fsyntax-only -I${srctree}/../tools/gcc -I${gccplugins_dir}/include 2>&1 <<EOF
+#include "gcc-common.h"
+class test {
+public:
+};
+EOF
+)
++
+if [ $? -eq 0 ]
+then
+ echo "$2"
+ exit 0
+fi
-+fi
+exit 1
diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh
index 5de5660..d3deb89 100644
sprintf(alias, "dmi*");
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
-index 9d9c5b9..a3af177 100644
+index 091d905..77b88c7 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
-@@ -949,6 +949,7 @@ enum mismatch {
+@@ -920,6 +920,7 @@ enum mismatch {
ANY_INIT_TO_ANY_EXIT,
ANY_EXIT_TO_ANY_INIT,
EXPORT_TO_INIT_EXIT,
};
struct sectioncheck {
-@@ -1035,6 +1036,12 @@ const struct sectioncheck sectioncheck[] = {
+@@ -1006,6 +1007,12 @@ const struct sectioncheck sectioncheck[] = {
.tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
.mismatch = EXPORT_TO_INIT_EXIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
}
};
-@@ -1155,10 +1162,10 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr,
+@@ -1126,10 +1133,10 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr,
continue;
if (ELF_ST_TYPE(sym->st_info) == STT_SECTION)
continue;
if (d < 0)
d = addr - sym->st_value;
if (d < distance) {
-@@ -1436,6 +1443,14 @@ static void report_sec_mismatch(const char *modname,
+@@ -1407,6 +1414,14 @@ static void report_sec_mismatch(const char *modname,
tosym, prl_to, prl_to, tosym);
free(prl_to);
break;
}
fprintf(stderr, "\n");
}
-@@ -1687,7 +1702,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
+@@ -1658,7 +1673,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
static void check_sec_ref(struct module *mod, const char *modname,
struct elf_info *elf)
{
Elf_Shdr *sechdrs = elf->sechdrs;
/* Walk through all sections */
-@@ -1819,7 +1834,7 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf,
+@@ -1789,7 +1804,7 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf,
va_end(ap);
}
{
if (buf->size - buf->pos < len) {
buf->size += len + SZ;
-@@ -2038,7 +2053,7 @@ static void write_if_changed(struct buffer *b, const char *fname)
+@@ -2008,7 +2023,7 @@ static void write_if_changed(struct buffer *b, const char *fname)
if (fstat(fileno(file), &st) < 0)
goto close_write;
unsigned int num_sections;
unsigned int secindex_strings;
+diff --git a/scripts/tags.sh b/scripts/tags.sh
+index 293828b..9fbe696 100755
+--- a/scripts/tags.sh
++++ b/scripts/tags.sh
+@@ -26,7 +26,7 @@ else
+ fi
+
+ # ignore userspace tools
+-ignore="$ignore ( -path ${tree}tools ) -prune -o"
++ignore="$ignore ( -path \"${tree}tools/[^g]*\" ) -prune -o"
+
+ # Find all available archs
+ find_all_archs()
diff --git a/security/Kconfig b/security/Kconfig
-index beb86b5..40b1edb 100644
+index beb86b5..9becb4a 100644
--- a/security/Kconfig
+++ b/security/Kconfig
-@@ -4,6 +4,957 @@
+@@ -4,6 +4,965 @@
menu "Security options"
+ that is, enabling this option will make it harder to inject
+ and execute 'foreign' code in kernel memory itself.
+
++ Note that on amd64, CONFIG_EFI enabled with "efi=old_map" on
++ the kernel command-line will result in an RWX physical map.
++
++ Likewise, the EFI runtime services are necessarily mapped as
++ RWX. If CONFIG_EFI is enabled on an EFI-capable system, it
++ is recommended that you boot with "noefi" on the kernel
++ command-line if possible to eliminate the mapping.
++
+choice
+ prompt "Return Address Instrumentation Method"
+ default PAX_KERNEXEC_PLUGIN_METHOD_BTS
source security/keys/Kconfig
config SECURITY_DMESG_RESTRICT
-@@ -103,7 +1054,7 @@ config INTEL_TXT
+@@ -103,7 +1062,7 @@ config INTEL_TXT
config LSM_MMAP_MIN_ADDR
int "Low address space for LSM to protect from user allocation"
depends on SECURITY && SECURITY_SELINUX
.ptrace_access_check = apparmor_ptrace_access_check,
diff --git a/security/commoncap.c b/security/commoncap.c
-index b9d613e..f68305c 100644
+index bab0611..f9a0ff5 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
-@@ -424,6 +424,32 @@ int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data
+@@ -427,6 +427,32 @@ int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data
return 0;
}
/*
* Attempt to get the on-exec apply capability sets for an executable file from
* its xattrs and, if present, apply them to the proposed credentials being
-@@ -592,6 +618,9 @@ int cap_bprm_secureexec(struct linux_binprm *bprm)
+@@ -595,6 +621,9 @@ int cap_bprm_secureexec(struct linux_binprm *bprm)
const struct cred *cred = current_cred();
kuid_t root_uid = make_kuid(cred->user_ns, 0);
if (bprm->cap_effective)
return 1;
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
-index f79fa8b..6161868 100644
+index 57da4bd..db453a2 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -118,8 +118,8 @@ int ima_init_template(void);
#ifdef CONFIG_PERSISTENT_KEYRINGS
extern long keyctl_get_persistent(uid_t, key_serial_t);
diff --git a/security/keys/key.c b/security/keys/key.c
-index 2048a11..101df4c 100644
+index 6d0cad1..8f957df 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -285,7 +285,7 @@ struct key *key_alloc(struct key_type *type, const char *desc,
key->index_key.type = type;
key->user = user;
key->quotalen = quotalen;
-@@ -1036,7 +1036,9 @@ int register_key_type(struct key_type *ktype)
+@@ -1075,7 +1075,9 @@ int register_key_type(struct key_type *ktype)
struct key_type *p;
int ret;
ret = -EEXIST;
down_write(&key_types_sem);
-@@ -1048,7 +1050,7 @@ int register_key_type(struct key_type *ktype)
+@@ -1087,7 +1089,7 @@ int register_key_type(struct key_type *ktype)
}
/* store the type */
pr_notice("Key type %s registered\n", ktype->name);
ret = 0;
-@@ -1070,7 +1072,7 @@ EXPORT_SYMBOL(register_key_type);
+@@ -1109,7 +1111,7 @@ EXPORT_SYMBOL(register_key_type);
void unregister_key_type(struct key_type *ktype)
{
down_write(&key_types_sem);
downgrade_write(&key_types_sem);
key_gc_keytype(ktype);
pr_notice("Key type %s unregistered\n", ktype->name);
-@@ -1088,10 +1090,10 @@ void __init key_init(void)
+@@ -1127,10 +1129,10 @@ void __init key_init(void)
0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
/* add the special key types */
/* record the root user tracking */
rb_link_node(&root_key_user.node,
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
-index cd5bd0c..acd0d5c 100644
+index e26f860..dcbe7ea 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
-@@ -987,7 +987,7 @@ static int keyctl_change_reqkey_auth(struct key *key)
+@@ -1002,7 +1002,7 @@ static int keyctl_change_reqkey_auth(struct key *key)
/*
* Copy the iovec data from userspace
*/
unsigned ioc)
{
for (; ioc > 0; ioc--) {
-@@ -1009,7 +1009,7 @@ static long copy_from_user_iovec(void *buffer, const struct iovec *iov,
+@@ -1024,7 +1024,7 @@ static long copy_from_user_iovec(void *buffer, const struct iovec *iov,
* If successful, 0 will be returned.
*/
long keyctl_instantiate_key_common(key_serial_t id,
unsigned ioc,
size_t plen,
key_serial_t ringid)
-@@ -1104,7 +1104,7 @@ long keyctl_instantiate_key(key_serial_t id,
+@@ -1119,7 +1119,7 @@ long keyctl_instantiate_key(key_serial_t id,
[0].iov_len = plen
};
}
return keyctl_instantiate_key_common(id, NULL, 0, 0, ringid);
-@@ -1137,7 +1137,7 @@ long keyctl_instantiate_key_iov(key_serial_t id,
+@@ -1152,7 +1152,7 @@ long keyctl_instantiate_key_iov(key_serial_t id,
if (ret == 0)
goto no_payload_free;
/*
diff --git a/security/security.c b/security/security.c
-index 31614e9..8b86b12 100644
+index e41b1a8..b66a558 100644
--- a/security/security.c
+++ b/security/security.c
@@ -33,8 +33,8 @@
lock = &avc_cache.slots_lock[hvalue];
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
-index 83d06db..d4d6861 100644
+index b0e9404..b15da09 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -95,8 +95,6 @@
/* SECMARK reference count */
static atomic_t selinux_secmark_refcount = ATOMIC_INIT(0);
-@@ -5761,7 +5759,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer)
+@@ -481,6 +479,7 @@ next_inode:
+ list_entry(sbsec->isec_head.next,
+ struct inode_security_struct, list);
+ struct inode *inode = isec->inode;
++ list_del_init(&isec->list);
+ spin_unlock(&sbsec->isec_lock);
+ inode = igrab(inode);
+ if (inode) {
+@@ -489,7 +488,6 @@ next_inode:
+ iput(inode);
+ }
+ spin_lock(&sbsec->isec_lock);
+- list_del_init(&isec->list);
+ goto next_inode;
+ }
+ spin_unlock(&sbsec->isec_lock);
+@@ -5772,7 +5770,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer)
#endif
.name = "selinux",
.ptrace_access_check = selinux_ptrace_access_check,
-@@ -6114,6 +6112,9 @@ static void selinux_nf_ip_exit(void)
+@@ -6128,6 +6126,9 @@ static void selinux_nf_ip_exit(void)
#ifdef CONFIG_SECURITY_SELINUX_DISABLE
static int selinux_disabled;
int selinux_disable(void)
{
if (ss_initialized) {
-@@ -6131,7 +6132,9 @@ int selinux_disable(void)
+@@ -6145,7 +6146,9 @@ int selinux_disable(void)
selinux_disabled = 1;
selinux_enabled = 0;
}
rtnl_unlock();
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index f2c3080..813c85e 100644
+index e6ab307..2008c98 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3849,7 +3849,7 @@ static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
}
} else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) {
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
-index af49721..e85058e 100644
+index 102e8fd..7263bb8 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -31,7 +31,7 @@ static int snd_pcm_ioctl_delay_compat(struct snd_pcm_substream *substream,
if (err < 0)
return err;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
-index b653ab0..a4738e3 100644
+index 8cd2f93..8412c57 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
-@@ -2812,11 +2812,11 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
+@@ -2815,11 +2815,11 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
switch (substream->stream) {
case SNDRV_PCM_STREAM_PLAYBACK:
result = snd_pcm_playback_ioctl1(NULL, substream, cmd,
struct snd_rawmidi_substream *midi_input[PORTMAN_NUM_INPUT_PORTS];
};
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
-index f96bf4c..f3bd1e0 100644
+index 95fc2eaf..ea5d6a7 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
-@@ -512,7 +512,7 @@ static void update_pcm_pointers(struct amdtp_stream *s,
+@@ -521,7 +521,7 @@ static void update_pcm_pointers(struct amdtp_stream *s,
ptr = s->pcm_buffer_pointer + frames;
if (ptr >= pcm->runtime->buffer_size)
ptr -= pcm->runtime->buffer_size;
s->pcm_period_pointer += frames;
if (s->pcm_period_pointer >= pcm->runtime->period_size) {
-@@ -952,7 +952,7 @@ EXPORT_SYMBOL(amdtp_stream_pcm_pointer);
+@@ -961,7 +961,7 @@ EXPORT_SYMBOL(amdtp_stream_pcm_pointer);
*/
void amdtp_stream_update(struct amdtp_stream *s)
{
}
EXPORT_SYMBOL(amdtp_stream_update);
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
-index d8ee7b0..79dfa2a 100644
+index 4823c08..47a5f7c 100644
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
-@@ -211,7 +211,7 @@ static inline bool amdtp_stream_pcm_running(struct amdtp_stream *s)
+@@ -212,7 +212,7 @@ static inline bool amdtp_stream_pcm_running(struct amdtp_stream *s)
static inline void amdtp_stream_pcm_trigger(struct amdtp_stream *s,
struct snd_pcm_substream *pcm)
{
}
/**
-@@ -229,7 +229,7 @@ static inline void amdtp_stream_midi_trigger(struct amdtp_stream *s,
+@@ -230,7 +230,7 @@ static inline void amdtp_stream_midi_trigger(struct amdtp_stream *s,
struct snd_rawmidi_substream *midi)
{
if (port < s->midi_ports)
return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, &ops,
sizeof(struct snd_emu10k1_synth_arg));
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
-index 4c20277..91abdce 100644
+index ec6a7d0..4e578f7 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -966,14 +966,10 @@ find_codec_preset(struct hda_codec *codec)
mod_requested++;
goto again;
}
-@@ -2777,7 +2773,7 @@ static int get_kctl_0dB_offset(struct snd_kcontrol *kctl, int *step_to_check)
+@@ -2780,7 +2776,7 @@ static int get_kctl_0dB_offset(struct hda_codec *codec,
/* FIXME: set_fs() hack for obtaining user-space TLV data */
mm_segment_t fs = get_fs();
set_fs(get_ds());
chip->pci = pci;
chip->irq = -1;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
-index b87d7d8..0ccaac3 100644
+index d074aa9..ce3cc44 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
-@@ -2279,8 +2279,10 @@ int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,
+@@ -2286,8 +2286,10 @@ int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,
if (ret)
return ret;
+}
diff --git a/tools/gcc/latent_entropy_plugin.c b/tools/gcc/latent_entropy_plugin.c
new file mode 100644
-index 0000000..39d7cc7
+index 0000000..e48b323
--- /dev/null
+++ b/tools/gcc/latent_entropy_plugin.c
-@@ -0,0 +1,462 @@
+@@ -0,0 +1,466 @@
+/*
+ * Copyright 2012-2014 by the PaX Team <pageexec@freemail.hu>
+ * Licensed under the GPL v2
+static tree latent_entropy_decl;
+
+static struct plugin_info latent_entropy_plugin_info = {
-+ .version = "201403280150",
++ .version = "201409101820",
+ .help = NULL
+};
+
+ if (TREE_THIS_VOLATILE(current_function_decl))
+ return false;
+
++ // gcc-4.5 doesn't discover some trivial noreturn functions
++ if (EDGE_COUNT(EXIT_BLOCK_PTR_FOR_FN(cfun)->preds) == 0)
++ return false;
++
+ return lookup_attribute("latent_entropy", DECL_ATTRIBUTES(current_function_decl)) != NULL_TREE;
+}
+
+}
diff --git a/tools/gcc/size_overflow_plugin/size_overflow_hash.data b/tools/gcc/size_overflow_plugin/size_overflow_hash.data
new file mode 100644
-index 0000000..37dbdb1
+index 0000000..4dc6368
--- /dev/null
+++ b/tools/gcc/size_overflow_plugin/size_overflow_hash.data
-@@ -0,0 +1,5511 @@
+@@ -0,0 +1,5850 @@
+intel_fake_agp_alloc_by_type_1 intel_fake_agp_alloc_by_type 1 1 NULL
+storvsc_connect_to_vsp_22 storvsc_connect_to_vsp 2 22 NULL
+compat_sock_setsockopt_23 compat_sock_setsockopt 5 23 NULL
+init_q_132 init_q 4 132 NULL
+memstick_alloc_host_142 memstick_alloc_host 1 142 NULL
+hva_to_gfn_memslot_149 hva_to_gfn_memslot 0-1 149 NULL
-+tracing_trace_options_write_153 tracing_trace_options_write 3 153 NULL nohasharray
-+ext4_ext_get_actual_len_153 ext4_ext_get_actual_len 0 153 &tracing_trace_options_write_153
++ping_v6_sendmsg_152 ping_v6_sendmsg 4 152 NULL
++ext4_ext_get_actual_len_153 ext4_ext_get_actual_len 0 153 NULL nohasharray
++tracing_trace_options_write_153 tracing_trace_options_write 3 153 &ext4_ext_get_actual_len_153
+xfs_buf_item_get_format_189 xfs_buf_item_get_format 2 189 NULL
+iscsi_session_setup_196 iscsi_session_setup 4-5 196 NULL
+obd_proc_jobid_var_seq_write_199 obd_proc_jobid_var_seq_write 3 199 NULL
+syslog_print_307 syslog_print 2 307 NULL
+dn_setsockopt_314 dn_setsockopt 5 314 NULL
+mlx5_core_access_reg_361 mlx5_core_access_reg 3-5 361 NULL
-+aio_read_events_ring_410 aio_read_events_ring 3 410 NULL
++aio_read_events_ring_410 aio_read_events_ring 3-0 410 NULL
+lbs_rdmac_read_418 lbs_rdmac_read 3 418 NULL
+snd_ca0106_ptr_read_467 snd_ca0106_ptr_read 0 467 NULL
+cfs_trace_set_debug_mb_usrstr_486 cfs_trace_set_debug_mb_usrstr 2 486 NULL
+zlib_deflate_workspacesize_537 zlib_deflate_workspacesize 0-1-2 537 NULL
+iwl_dbgfs_wowlan_sram_read_540 iwl_dbgfs_wowlan_sram_read 3 540 NULL
+sco_sock_setsockopt_552 sco_sock_setsockopt 5 552 NULL
++lpfc_nlp_state_name_556 lpfc_nlp_state_name 2 556 NULL
+snd_aw2_saa7146_get_hw_ptr_playback_558 snd_aw2_saa7146_get_hw_ptr_playback 0 558 NULL
-+dev_hard_header_565 dev_hard_header 0 565 NULL nohasharray
-+start_isoc_chain_565 start_isoc_chain 2 565 &dev_hard_header_565
++start_isoc_chain_565 start_isoc_chain 2 565 NULL nohasharray
++dev_hard_header_565 dev_hard_header 0 565 &start_isoc_chain_565
+smk_write_load_self2_591 smk_write_load_self2 3 591 NULL
+btrfs_stack_file_extent_offset_607 btrfs_stack_file_extent_offset 0 607 NULL
+ni_gpct_device_construct_610 ni_gpct_device_construct 5 610 NULL
+cfs_hash_bkt_size_643 cfs_hash_bkt_size 0 643 NULL
+unlink_queued_645 unlink_queued 4 645 NULL
+dtim_interval_read_654 dtim_interval_read 3 654 NULL
++nvif_notify_new_671 nvif_notify_new 6 671 NULL
+mem_rx_free_mem_blks_read_675 mem_rx_free_mem_blks_read 3 675 NULL
+persistent_ram_vmap_709 persistent_ram_vmap 2-1 709 NULL
+sctp_setsockopt_peer_addr_params_734 sctp_setsockopt_peer_addr_params 3 734 NULL
+if_writecmd_815 if_writecmd 2 815 NULL
+aac_change_queue_depth_825 aac_change_queue_depth 2 825 NULL
+error_state_read_859 error_state_read 6 859 NULL
++lustre_init_msg_v2_864 lustre_init_msg_v2 2 864 NULL
+o2net_send_message_vec_879 o2net_send_message_vec 4 879 NULL nohasharray
+iwl_dbgfs_fh_reg_read_879 iwl_dbgfs_fh_reg_read 3 879 &o2net_send_message_vec_879
+snd_pcm_action_single_905 snd_pcm_action_single 0 905 NULL
+carl9170_cmd_buf_950 carl9170_cmd_buf 3 950 NULL
-+__nodes_weight_956 __nodes_weight 0 956 NULL
++__nodes_weight_956 __nodes_weight 2-0 956 NULL
++bnx2x_fill_fw_str_968 bnx2x_fill_fw_str 3 968 NULL
+usnic_ib_qp_grp_dump_hdr_989 usnic_ib_qp_grp_dump_hdr 2 989 NULL
++readreg_1017 readreg 0-1 1017 NULL
+smk_write_cipso2_1021 smk_write_cipso2 3 1021 NULL
+gigaset_initdriver_1060 gigaset_initdriver 2 1060 NULL
+mce_request_packet_1073 mce_request_packet 3 1073 NULL
+_scsih_adjust_queue_depth_1083 _scsih_adjust_queue_depth 2 1083 NULL
+llcp_sock_sendmsg_1092 llcp_sock_sendmsg 4 1092 NULL
+nfs4_init_nonuniform_client_string_1097 nfs4_init_nonuniform_client_string 3 1097 NULL
++__arch_hweight8_1105 __arch_hweight8 0 1105 NULL
++utf8s_to_utf16s_1115 utf8s_to_utf16s 0 1115 NULL
+cfg80211_report_obss_beacon_1133 cfg80211_report_obss_beacon 3 1133 NULL
+i2400m_rx_ctl_1157 i2400m_rx_ctl 4 1157 NULL
+ipc_alloc_1192 ipc_alloc 1 1192 NULL
+ffs_1322 ffs 0 1322 NULL
+qlcnic_pci_sriov_configure_1327 qlcnic_pci_sriov_configure 2 1327 NULL
+btrfs_submit_compressed_write_1347 btrfs_submit_compressed_write 5 1347 NULL
++bond_verify_device_path_1352 bond_verify_device_path 3 1352 NULL
+snd_pcm_lib_write1_1358 snd_pcm_lib_write1 0-3 1358 NULL
+ipx_sendmsg_1362 ipx_sendmsg 4 1362 NULL
+fw_stats_raw_read_1369 fw_stats_raw_read 3 1369 NULL
+tomoyo_round2_1518 tomoyo_round2 0 1518 NULL
+alloc_perm_bits_1532 alloc_perm_bits 2 1532 NULL
+ath6kl_init_get_fwcaps_1557 ath6kl_init_get_fwcaps 3 1557 NULL
++ffs_mutex_lock_1564 ffs_mutex_lock 0 1564 NULL
+ieee80211_if_read_dot11MeshHWMPnetDiameterTraversalTime_1589 ieee80211_if_read_dot11MeshHWMPnetDiameterTraversalTime 3 1589 NULL
++ipath_ht_handle_hwerrors_1592 ipath_ht_handle_hwerrors 3 1592 NULL
+packet_buffer_init_1607 packet_buffer_init 2 1607 NULL
+btmrvl_hscmd_read_1614 btmrvl_hscmd_read 3 1614 NULL
+v9fs_fid_xattr_get_1618 v9fs_fid_xattr_get 0 1618 NULL
+pdu_write_u_1710 pdu_write_u 3 1710 NULL
+coda_psdev_write_1711 coda_psdev_write 3 1711 NULL
+btrfs_dir_data_len_1714 btrfs_dir_data_len 0 1714 NULL
++internal_create_group_1733 internal_create_group 0 1733 NULL
+dev_irnet_read_1741 dev_irnet_read 3 1741 NULL
+usb_ep_align_maybe_1743 usb_ep_align_maybe 0-3 1743 NULL
+tx_frag_called_read_1748 tx_frag_called_read 3 1748 NULL
+cosa_write_1774 cosa_write 3 1774 NULL
+fcoe_ctlr_device_add_1793 fcoe_ctlr_device_add 3 1793 NULL
-+__nodelist_scnprintf_1815 __nodelist_scnprintf 2 1815 NULL
++__nodelist_scnprintf_1815 __nodelist_scnprintf 2-0 1815 NULL
+sb_issue_zeroout_1884 sb_issue_zeroout 3 1884 NULL
+rx_defrag_called_read_1897 rx_defrag_called_read 3 1897 NULL
+nfs_parse_server_name_1899 nfs_parse_server_name 2 1899 NULL
+SyS_add_key_1900 SyS_add_key 4 1900 NULL
+uhid_char_read_1920 uhid_char_read 3 1920 NULL
+tx_tx_retry_data_read_1926 tx_tx_retry_data_read 3 1926 NULL
++azx_get_position_1927 azx_get_position 0 1927 NULL
+bdev_erase_1933 bdev_erase 3 1933 NULL
+ext3_fiemap_1936 ext3_fiemap 4 1936 NULL
-+cyttsp_probe_1940 cyttsp_probe 4 1940 NULL
++cyttsp_probe_1940 cyttsp_probe 4 1940 NULL nohasharray
++nvif_object_sclass_1940 nvif_object_sclass 3 1940 &cyttsp_probe_1940
+ieee80211_if_fmt_dot11MeshConfirmTimeout_1945 ieee80211_if_fmt_dot11MeshConfirmTimeout 3 1945 NULL
+ivtv_v4l2_read_1964 ivtv_v4l2_read 3 1964 NULL
+sel_read_avc_hash_stats_1984 sel_read_avc_hash_stats 3 1984 NULL
+iwl_dbgfs_current_sleep_command_read_2081 iwl_dbgfs_current_sleep_command_read 3 2081 NULL
+xgmac_reg_value_read_2095 xgmac_reg_value_read 3 2095 NULL
+idetape_chrdev_read_2097 idetape_chrdev_read 3 2097 NULL
++audit_expand_2098 audit_expand 0 2098 NULL
+__set_print_fmt_2106 __set_print_fmt 0 2106 NULL
+iwl_dbgfs_log_event_read_2107 iwl_dbgfs_log_event_read 3 2107 NULL
+ecryptfs_encrypt_and_encode_filename_2109 ecryptfs_encrypt_and_encode_filename 6 2109 NULL
+__erst_read_to_erange_2341 __erst_read_to_erange 0 2341 NULL
+zr364xx_read_2354 zr364xx_read 3 2354 NULL
+viafb_iga2_odev_proc_write_2363 viafb_iga2_odev_proc_write 3 2363 NULL
-+rose_recvmsg_2368 rose_recvmsg 4 2368 NULL nohasharray
-+xfs_buf_map_from_irec_2368 xfs_buf_map_from_irec 5 2368 &rose_recvmsg_2368
++xfs_buf_map_from_irec_2368 xfs_buf_map_from_irec 5 2368 NULL nohasharray
++rose_recvmsg_2368 rose_recvmsg 4 2368 &xfs_buf_map_from_irec_2368
+il_dbgfs_sensitivity_read_2370 il_dbgfs_sensitivity_read 3 2370 NULL
+rxpipe_rx_prep_beacon_drop_read_2403 rxpipe_rx_prep_beacon_drop_read 3 2403 NULL
+isdn_v110_open_2418 isdn_v110_open 3 2418 NULL
+batadv_tvlv_container_list_size_2524 batadv_tvlv_container_list_size 0 2524 NULL
+smk_write_syslog_2529 smk_write_syslog 3 2529 NULL
+__ceph_setxattr_2532 __ceph_setxattr 4 2532 NULL
++sfw_create_rpc_2562 sfw_create_rpc 4 2562 NULL
+gspca_dev_probe_2570 gspca_dev_probe 4 2570 NULL
+pcm_sanity_check_2574 pcm_sanity_check 0 2574 NULL
+mdc_max_rpcs_in_flight_seq_write_2594 mdc_max_rpcs_in_flight_seq_write 3 2594 NULL
+fsl_edma_alloc_desc_2769 fsl_edma_alloc_desc 2 2769 NULL
+mon_bin_ioctl_2771 mon_bin_ioctl 3 2771 NULL
+set_msr_hyperv_pw_2785 set_msr_hyperv_pw 3 2785 NULL
++device_add_attrs_2789 device_add_attrs 0 2789 NULL
+iwl_dbgfs_clear_ucode_statistics_write_2804 iwl_dbgfs_clear_ucode_statistics_write 3 2804 NULL
+sel_read_enforce_2828 sel_read_enforce 3 2828 NULL
+vb2_dc_get_userptr_2829 vb2_dc_get_userptr 2-3 2829 NULL
+il3945_ucode_rx_stats_read_3048 il3945_ucode_rx_stats_read 3 3048 NULL
+qp_alloc_ppn_set_3068 qp_alloc_ppn_set 2-4 3068 NULL
+__blk_end_bidi_request_3070 __blk_end_bidi_request 3-4 3070 NULL
-+dac960_user_command_proc_write_3071 dac960_user_command_proc_write 3 3071 NULL nohasharray
-+hfsplus_asc2uni_3071 hfsplus_asc2uni 0 3071 &dac960_user_command_proc_write_3071
++hfsplus_asc2uni_3071 hfsplus_asc2uni 0 3071 NULL nohasharray
++dac960_user_command_proc_write_3071 dac960_user_command_proc_write 3 3071 &hfsplus_asc2uni_3071
+read_file_antenna_diversity_3077 read_file_antenna_diversity 3 3077 NULL
+ttusb2_msg_3100 ttusb2_msg 4 3100 NULL
+rb_alloc_3102 rb_alloc 1 3102 NULL
-+simple_write_to_buffer_3122 simple_write_to_buffer 2-5 3122 NULL
++ufshcd_get_rsp_upiu_result_3114 ufshcd_get_rsp_upiu_result 0 3114 NULL
++simple_write_to_buffer_3122 simple_write_to_buffer 5-2 3122 NULL
+print_time_3132 print_time 0 3132 NULL
+fill_write_buffer_3142 fill_write_buffer 3 3142 NULL
+CIFSSMBSetPosixACL_3154 CIFSSMBSetPosixACL 5 3154 NULL
+uv_num_possible_blades_3177 uv_num_possible_blades 0 3177 NULL
++pkcs7_sig_note_signature_3178 pkcs7_sig_note_signature 5 3178 NULL
+uinput_ioctl_handler_3181 uinput_ioctl_handler 2 3181 NULL nohasharray
+uvc_video_stats_dump_3181 uvc_video_stats_dump 3 3181 &uinput_ioctl_handler_3181
+compat_do_ip6t_set_ctl_3184 compat_do_ip6t_set_ctl 4 3184 NULL
+codec_reg_write_file_3204 codec_reg_write_file 3 3204 NULL
+SyS_sendto_3219 SyS_sendto 6 3219 NULL
+btrfs_prealloc_file_range_3227 btrfs_prealloc_file_range 3 3227 NULL
++kimage_crash_alloc_3233 kimage_crash_alloc 3 3233 NULL
++write_adapter_mem_3234 write_adapter_mem 3 3234 NULL
+do_read_log_to_user_3236 do_read_log_to_user 4 3236 NULL
+ext3_xattr_find_entry_3237 ext3_xattr_find_entry 0 3237 NULL
+key_key_read_3241 key_key_read 3 3241 NULL
+__ilog2_u64_3284 __ilog2_u64 0 3284 NULL
+ieee80211_if_write_beacon_loss_3296 ieee80211_if_write_beacon_loss 3 3296 NULL
++cgroup_name_3300 cgroup_name 3 3300 NULL
+__iovec_copy_from_user_inatomic_3314 __iovec_copy_from_user_inatomic 0-4-3 3314 NULL
+_iwl_dbgfs_d3_sram_write_3315 _iwl_dbgfs_d3_sram_write 3 3315 NULL
+dbDiscardAG_3322 dbDiscardAG 3 3322 NULL
++read_from_oldmem_3337 read_from_oldmem 2 3337 NULL
++sysfs_create_group_3339 sysfs_create_group 0 3339 NULL
+tty_port_register_device_attr_3341 tty_port_register_device_attr 3 3341 NULL
+il_dbgfs_interrupt_read_3351 il_dbgfs_interrupt_read 3 3351 NULL
+gsm_control_rls_3353 gsm_control_rls 3 3353 NULL
+comedi_buf_read_n_available_3899 comedi_buf_read_n_available 0 3899 NULL
+vcs_write_3910 vcs_write 3 3910 NULL
+SyS_move_pages_3920 SyS_move_pages 2 3920 NULL
++hdlc_irq_one_3944 hdlc_irq_one 2 3944 NULL
+brcmf_debugfs_fws_stats_read_3947 brcmf_debugfs_fws_stats_read 3 3947 NULL
+copy_from_user_atomic_iovec_3990 copy_from_user_atomic_iovec 0-4 3990 NULL
+do_add_counters_3992 do_add_counters 3 3992 NULL
+userspace_status_4004 userspace_status 4 4004 NULL
-+mei_write_4005 mei_write 3 4005 NULL nohasharray
-+xfs_check_block_4005 xfs_check_block 4 4005 &mei_write_4005
++xfs_check_block_4005 xfs_check_block 4 4005 NULL nohasharray
++mei_write_4005 mei_write 3 4005 &xfs_check_block_4005
+snd_hdsp_capture_copy_4011 snd_hdsp_capture_copy 5 4011 NULL
+blk_end_request_4024 blk_end_request 3 4024 NULL
+ext4_xattr_find_entry_4025 ext4_xattr_find_entry 0 4025 NULL
+mtip_hw_read_registers_4037 mtip_hw_read_registers 3 4037 NULL
+read_file_queues_4078 read_file_queues 3 4078 NULL
+fbcon_do_set_font_4079 fbcon_do_set_font 2-3 4079 NULL
++C_SYSC_rt_sigpending_4114 C_SYSC_rt_sigpending 2 4114 NULL
+tm6000_read_4151 tm6000_read 3 4151 NULL
+mpt_raid_phys_disk_get_num_paths_4155 mpt_raid_phys_disk_get_num_paths 0 4155 NULL
+msg_bits_4158 msg_bits 0-3-4 4158 NULL
+get_alua_req_4166 get_alua_req 3 4166 NULL
+blk_dropped_read_4168 blk_dropped_read 3 4168 NULL
+read_file_bool_4180 read_file_bool 3 4180 NULL
++lstcon_test_add_4190 lstcon_test_add 10 4190 NULL
+vring_new_virtqueue_4199 vring_new_virtqueue 2 4199 NULL
++f1x_determine_channel_4202 f1x_determine_channel 2 4202 NULL
+_osd_req_list_objects_4204 _osd_req_list_objects 6 4204 NULL
+__snd_gf1_read_addr_4210 __snd_gf1_read_addr 0 4210 NULL
+ath6kl_force_roam_write_4282 ath6kl_force_roam_write 3 4282 NULL
+nouveau_fifo_create__4327 nouveau_fifo_create_ 5-6 4327 NULL
+snd_rawmidi_kernel_read_4328 snd_rawmidi_kernel_read 3 4328 NULL
+ima_eventdigest_init_common_4338 ima_eventdigest_init_common 2 4338 NULL
-+__copy_from_user_inatomic_4365 __copy_from_user_inatomic 0-3 4365 NULL
++__copy_from_user_inatomic_4365 __copy_from_user_inatomic 0-3 4365 NULL nohasharray
++lookup_string_4365 lookup_string 0 4365 &__copy_from_user_inatomic_4365
+irda_sendmsg_4388 irda_sendmsg 4 4388 NULL
+access_process_vm_4412 access_process_vm 0 4412 NULL nohasharray
+cxacru_cm_get_array_4412 cxacru_cm_get_array 4 4412 &access_process_vm_4412
+rtw_android_get_rssi_4421 rtw_android_get_rssi 0 4421 NULL
+do_pages_stat_4437 do_pages_stat 2 4437 NULL
+at76_set_card_command_4471 at76_set_card_command 4 4471 NULL
-+snd_seq_expand_var_event_4481 snd_seq_expand_var_event 0-5 4481 NULL
++snd_seq_expand_var_event_4481 snd_seq_expand_var_event 5-0 4481 NULL
+vmbus_establish_gpadl_4495 vmbus_establish_gpadl 3 4495 NULL
+set_link_security_4502 set_link_security 4 4502 NULL
+ll_max_readahead_per_file_mb_seq_write_4531 ll_max_readahead_per_file_mb_seq_write 3 4531 NULL
+bch_alloc_4593 bch_alloc 1 4593 NULL
+ll_rw_extents_stats_seq_write_4633 ll_rw_extents_stats_seq_write 3 4633 NULL
+iwl_dbgfs_tx_queue_read_4635 iwl_dbgfs_tx_queue_read 3 4635 NULL
++nve0_gpio_intr_mask_4665 nve0_gpio_intr_mask 4-3 4665 NULL
+skb_add_data_nocache_4682 skb_add_data_nocache 4 4682 NULL
+cx18_read_pos_4683 cx18_read_pos 3 4683 NULL
+short_retry_limit_read_4687 short_retry_limit_read 3 4687 NULL
+kone_receive_4690 kone_receive 4 4690 NULL
+hash_netportnet6_expire_4702 hash_netportnet6_expire 4 4702 NULL
+cxgbi_alloc_big_mem_4707 cxgbi_alloc_big_mem 1 4707 NULL
-+show_header_4722 show_header 3 4722 NULL nohasharray
-+ati_create_gatt_pages_4722 ati_create_gatt_pages 1 4722 &show_header_4722
++ati_create_gatt_pages_4722 ati_create_gatt_pages 1 4722 NULL nohasharray
++show_header_4722 show_header 3 4722 &ati_create_gatt_pages_4722
+ll_rw_offset_stats_seq_write_4736 ll_rw_offset_stats_seq_write 3 4736 NULL nohasharray
+bitmap_startwrite_4736 bitmap_startwrite 2 4736 &ll_rw_offset_stats_seq_write_4736
+lu_buf_alloc_4753 lu_buf_alloc 2 4753 NULL
+ncp__vol2io_4804 ncp__vol2io 5 4804 NULL
+C_SYSC_setsockopt_4806 C_SYSC_setsockopt 5 4806 NULL
+repair_io_failure_4815 repair_io_failure 4-3 4815 NULL
++scsi_end_request_4839 scsi_end_request 3-4 4839 NULL
+gigaset_if_receive_4861 gigaset_if_receive 3 4861 NULL
+key_tx_spec_read_4862 key_tx_spec_read 3 4862 NULL
+ocfs2_defrag_extent_4873 ocfs2_defrag_extent 2 4873 NULL
+compat_SyS_ipc_5000 compat_SyS_ipc 3 5000 NULL
+do_mincore_5018 do_mincore 0-2-1 5018 NULL
+cfg80211_rx_mgmt_5056 cfg80211_rx_mgmt 5 5056 NULL
-+ocfs2_check_range_for_holes_5066 ocfs2_check_range_for_holes 2-3 5066 NULL
++ocfs2_check_range_for_holes_5066 ocfs2_check_range_for_holes 3-2 5066 NULL
+snd_mixart_BA1_read_5082 snd_mixart_BA1_read 5 5082 NULL
+snd_emu10k1_ptr20_read_5087 snd_emu10k1_ptr20_read 0 5087 NULL
-+kfifo_copy_from_user_5091 kfifo_copy_from_user 4-3-0 5091 NULL nohasharray
-+get_random_bytes_5091 get_random_bytes 2 5091 &kfifo_copy_from_user_5091 nohasharray
-+blk_rq_sectors_5091 blk_rq_sectors 0 5091 &get_random_bytes_5091
++get_random_bytes_5091 get_random_bytes 2 5091 NULL nohasharray
++kfifo_copy_from_user_5091 kfifo_copy_from_user 3-4-0 5091 &get_random_bytes_5091 nohasharray
++blk_rq_sectors_5091 blk_rq_sectors 0 5091 &kfifo_copy_from_user_5091
+sound_write_5102 sound_write 3 5102 NULL
+i40e_dbg_netdev_ops_write_5117 i40e_dbg_netdev_ops_write 3 5117 NULL
++qib_7220_handle_hwerrors_5142 qib_7220_handle_hwerrors 3 5142 NULL
++bucket_table_alloc_5149 bucket_table_alloc 1 5149 NULL
+__uwb_addr_print_5161 __uwb_addr_print 2 5161 NULL
+iwl_dbgfs_status_read_5171 iwl_dbgfs_status_read 3 5171 NULL
+acpi_pcc_get_sqty_5176 acpi_pcc_get_sqty 0 5176 NULL
+dwc2_hcd_urb_alloc_5217 dwc2_hcd_urb_alloc 2 5217 NULL
+ath6kl_debug_roam_tbl_event_5224 ath6kl_debug_roam_tbl_event 3 5224 NULL
+xgmac_reg_addr_read_5278 xgmac_reg_addr_read 3 5278 NULL
++usb_descriptor_fillbuf_5302 usb_descriptor_fillbuf 0 5302 NULL
+r592_write_fifo_pio_5315 r592_write_fifo_pio 3 5315 NULL
+sbc_get_write_same_sectors_5317 sbc_get_write_same_sectors 0 5317 NULL
+pwr_elp_enter_read_5324 pwr_elp_enter_read 3 5324 NULL
+xfs_efi_init_5476 xfs_efi_init 2 5476 NULL
+cifs_security_flags_proc_write_5484 cifs_security_flags_proc_write 3 5484 NULL
+tty_write_5494 tty_write 3 5494 NULL
-+ieee80211_if_fmt_last_beacon_5498 ieee80211_if_fmt_last_beacon 3 5498 NULL nohasharray
-+tomoyo_update_domain_5498 tomoyo_update_domain 2 5498 &ieee80211_if_fmt_last_beacon_5498
++tomoyo_update_domain_5498 tomoyo_update_domain 2 5498 NULL nohasharray
++ieee80211_if_fmt_last_beacon_5498 ieee80211_if_fmt_last_beacon 3 5498 &tomoyo_update_domain_5498
+__max_nr_grant_frames_5505 __max_nr_grant_frames 0 5505 NULL
+ieee80211_if_fmt_auto_open_plinks_5534 ieee80211_if_fmt_auto_open_plinks 3 5534 NULL
+get_entry_msg_len_5552 get_entry_msg_len 0 5552 NULL
+ria_page_count_5849 ria_page_count 0 5849 NULL
+rx_filter_max_arp_queue_dep_read_5851 rx_filter_max_arp_queue_dep_read 3 5851 NULL
+uinput_compat_ioctl_5861 uinput_compat_ioctl 2 5861 NULL
++config_buf_5862 config_buf 0 5862 NULL nohasharray
++ufshcd_check_query_response_5862 ufshcd_check_query_response 0 5862 &config_buf_5862
+lprocfs_fid_width_seq_write_5889 lprocfs_fid_width_seq_write 3 5889 NULL
+port_show_regs_5904 port_show_regs 3 5904 NULL
+rbd_segment_length_5907 rbd_segment_length 0-3-2 5907 NULL
+ll_statahead_one_5962 ll_statahead_one 3 5962 NULL
+__apu_get_register_5967 __apu_get_register 0 5967 NULL
+ieee80211_if_fmt_rc_rateidx_mask_5ghz_5971 ieee80211_if_fmt_rc_rateidx_mask_5ghz 3 5971 NULL
++SyS_semop_5980 SyS_semop 3 5980 NULL
+btrfs_item_offset_6019 btrfs_item_offset 0 6019 NULL
+alloc_msg_6072 alloc_msg 1 6072 NULL
+sctp_setsockopt_connectx_6073 sctp_setsockopt_connectx 3 6073 NULL
-+force_static_address_read_6110 force_static_address_read 3 6110 NULL nohasharray
-+ipmi_addr_length_6110 ipmi_addr_length 0 6110 &force_static_address_read_6110
++_random_read_6098 _random_read 3 6098 NULL
++ipmi_addr_length_6110 ipmi_addr_length 0 6110 NULL nohasharray
++force_static_address_read_6110 force_static_address_read 3 6110 &ipmi_addr_length_6110
+dfs_global_file_write_6112 dfs_global_file_write 3 6112 NULL
+nouveau_parent_create__6131 nouveau_parent_create_ 7 6131 NULL
+ieee80211_if_fmt_beacon_timeout_6153 ieee80211_if_fmt_beacon_timeout 3 6153 NULL
+serial_port_in_6291 serial_port_in 0 6291 NULL
+qlcnic_sriov_alloc_bc_msg_6309 qlcnic_sriov_alloc_bc_msg 2 6309 NULL
+hfsplus_direct_IO_6313 hfsplus_direct_IO 4 6313 NULL
-+hfa384x_inw_6329 hfa384x_inw 0 6329 NULL nohasharray
-+SyS_mincore_6329 SyS_mincore 1-2 6329 &hfa384x_inw_6329
++SyS_mincore_6329 SyS_mincore 2-1 6329 NULL nohasharray
++hfa384x_inw_6329 hfa384x_inw 0 6329 &SyS_mincore_6329
+fuse_get_req_for_background_6337 fuse_get_req_for_background 2 6337 NULL
+ucs2_strnlen_6342 ucs2_strnlen 0 6342 NULL
+regcache_sync_block_raw_6350 regcache_sync_block_raw 5-4 6350 NULL
+mei_dbgfs_read_devstate_6352 mei_dbgfs_read_devstate 3 6352 NULL
+arch_gnttab_valloc_6372 arch_gnttab_valloc 2 6372 NULL
-+osd_req_read_sg_kern_6378 osd_req_read_sg_kern 5 6378 NULL
++osd_req_read_sg_kern_6378 osd_req_read_sg_kern 5 6378 NULL nohasharray
++sync_fence_alloc_6378 sync_fence_alloc 1 6378 &osd_req_read_sg_kern_6378
+posix_acl_fix_xattr_userns_6420 posix_acl_fix_xattr_userns 4 6420 NULL
+add_transaction_credits_6422 add_transaction_credits 2-3 6422 NULL
+ipr_change_queue_depth_6431 ipr_change_queue_depth 2 6431 NULL
+__alloc_bootmem_node_nopanic_6432 __alloc_bootmem_node_nopanic 2 6432 NULL
++C_SYSC_vmsplice_6470 C_SYSC_vmsplice 3 6470 NULL
+ieee80211_if_fmt_dot11MeshMaxRetries_6476 ieee80211_if_fmt_dot11MeshMaxRetries 3 6476 NULL
+qp_memcpy_from_queue_6479 qp_memcpy_from_queue 5-4 6479 NULL
+cipso_v4_map_lvl_hton_6490 cipso_v4_map_lvl_hton 0 6490 NULL
+check_clk_sync_6717 check_clk_sync 2 6717 NULL
+video_proc_write_6724 video_proc_write 3 6724 NULL
+posix_acl_xattr_count_6725 posix_acl_xattr_count 0-1 6725 NULL
++kobject_add_varg_6781 kobject_add_varg 0 6781 NULL
+iwl_dbgfs_channels_read_6784 iwl_dbgfs_channels_read 3 6784 NULL
+ieee80211_if_read_6785 ieee80211_if_read 3 6785 NULL
+zone_spanned_pages_in_node_6787 zone_spanned_pages_in_node 0-3-4 6787 NULL
+ll_xattr_cache_find_6798 ll_xattr_cache_find 0 6798 NULL
+tx_tx_done_data_read_6799 tx_tx_done_data_read 3 6799 NULL
+lbs_rdrf_write_6826 lbs_rdrf_write 3 6826 NULL
-+calc_pages_for_6838 calc_pages_for 0-2-1 6838 NULL
++calc_pages_for_6838 calc_pages_for 0-1-2 6838 NULL
+mon_bin_read_6841 mon_bin_read 3 6841 NULL
+snd_cs4281_BA0_read_6847 snd_cs4281_BA0_read 5 6847 NULL
+perf_output_sample_ustack_6868 perf_output_sample_ustack 2 6868 NULL
+pch_uart_hal_read_6961 pch_uart_hal_read 0 6961 NULL
+i40e_dbg_dump_write_6973 i40e_dbg_dump_write 3 6973 NULL nohasharray
+rsa_extract_mpi_6973 rsa_extract_mpi 5 6973 &i40e_dbg_dump_write_6973
++lustre_pack_reply_6982 lustre_pack_reply 2 6982 NULL
+request_key_async_6990 request_key_async 4 6990 NULL
+tpl_write_6998 tpl_write 3 6998 NULL
+cipso_v4_gentag_enum_7006 cipso_v4_gentag_enum 0 7006 NULL
+tipc_send_packet_7091 tipc_send_packet 4 7091 &beacon_interval_read_7091
+pipeline_enc_rx_stat_fifo_int_read_7107 pipeline_enc_rx_stat_fifo_int_read 3 7107 NULL
+osc_resend_count_seq_write_7120 osc_resend_count_seq_write 3 7120 NULL
++qib_format_hwerrors_7133 qib_format_hwerrors 5 7133 NULL
+kvm_mmu_notifier_test_young_7139 kvm_mmu_notifier_test_young 3 7139 NULL
+__alloc_objio_seg_7203 __alloc_objio_seg 1 7203 NULL
++hdlc_loop_7255 hdlc_loop 0 7255 NULL
+rx_rate_rx_frames_per_rates_read_7282 rx_rate_rx_frames_per_rates_read 3 7282 NULL
++get_string_7302 get_string 0 7302 NULL
+pci_vpd_info_field_size_7324 pci_vpd_info_field_size 0 7324 NULL
+mgmt_control_7349 mgmt_control 3 7349 NULL
+at_est2timeout_7365 at_est2timeout 0-1 7365 NULL
+ieee80211_if_read_dot11MeshHWMPactivePathTimeout_7368 ieee80211_if_read_dot11MeshHWMPactivePathTimeout 3 7368 NULL
+ath10k_read_fw_stats_7387 ath10k_read_fw_stats 3 7387 NULL
-+hweight_long_7388 hweight_long 0 7388 NULL
++hweight_long_7388 hweight_long 0-1 7388 NULL
+sl_change_mtu_7396 sl_change_mtu 2 7396 NULL
+_ore_add_stripe_unit_7399 _ore_add_stripe_unit 6-3 7399 NULL
+audmux_read_file_7400 audmux_read_file 3 7400 NULL
+ip_options_get_alloc_7448 ip_options_get_alloc 1 7448 NULL
+SYSC_setgroups_7454 SYSC_setgroups 1 7454 NULL
+rt2x00debug_read_queue_stats_7455 rt2x00debug_read_queue_stats 3 7455 NULL
-+garp_request_join_7471 garp_request_join 4 7471 NULL
++l2tp_ip6_sendmsg_7461 l2tp_ip6_sendmsg 4 7461 NULL
++garp_request_join_7471 garp_request_join 4 7471 NULL nohasharray
++ReadHSCX_7471 ReadHSCX 0 7471 &garp_request_join_7471
+snd_pcm_lib_read1_7491 snd_pcm_lib_read1 0-3 7491 NULL
+ahash_instance_headroom_7509 ahash_instance_headroom 0 7509 NULL nohasharray
+sdhci_alloc_host_7509 sdhci_alloc_host 2 7509 &ahash_instance_headroom_7509
+smk_read_mapped_7562 smk_read_mapped 3 7562 NULL
+netvsc_get_slots_7565 netvsc_get_slots 0 7565 NULL
+cfs_cpt_num_estimate_7571 cfs_cpt_num_estimate 0 7571 NULL
-+groups_alloc_7614 groups_alloc 1 7614 NULL
++groups_alloc_7614 groups_alloc 1 7614 NULL nohasharray
++create_dir_7614 create_dir 0 7614 &groups_alloc_7614
+_rtw_zmalloc_7636 _rtw_zmalloc 1 7636 NULL
+fault_inject_write_7662 fault_inject_write 3 7662 NULL
+acpi_ex_allocate_name_string_7685 acpi_ex_allocate_name_string 2-1 7685 NULL
+acpi_ns_get_pathname_length_7699 acpi_ns_get_pathname_length 0 7699 NULL
+dev_write_7708 dev_write 3 7708 NULL
++pci_raw_set_power_state_7729 pci_raw_set_power_state 0 7729 NULL
+vxge_device_register_7752 vxge_device_register 4 7752 NULL
-+ubi_io_read_vid_hdr_7766 ubi_io_read_vid_hdr 0 7766 NULL
+iwl_dbgfs_bt_cmd_read_7770 iwl_dbgfs_bt_cmd_read 3 7770 NULL
+alloc_candev_7776 alloc_candev 1-2 7776 NULL
++__videobuf_read_start_7782 __videobuf_read_start 0 7782 NULL
+dfs_global_file_read_7787 dfs_global_file_read 3 7787 NULL
+bnx2_nvram_write_7790 bnx2_nvram_write 4-2 7790 NULL
+diva_os_copy_from_user_7792 diva_os_copy_from_user 4 7792 NULL nohasharray
+seq_buf_alloc_7828 seq_buf_alloc 1 7828 NULL
+cfs_trace_dump_debug_buffer_usrstr_7861 cfs_trace_dump_debug_buffer_usrstr 2 7861 NULL
+tipc_alloc_entry_7875 tipc_alloc_entry 2 7875 NULL
++config_desc_7878 config_desc 0 7878 NULL
+dvb_dmxdev_read_sec_7892 dvb_dmxdev_read_sec 4 7892 NULL
+xfs_trans_get_efi_7898 xfs_trans_get_efi 2 7898 NULL
+libfc_host_alloc_7917 libfc_host_alloc 2 7917 NULL
+qla4xxx_post_ping_evt_work_8074 qla4xxx_post_ping_evt_work 4 8074 NULL
+venus_lookup_8121 venus_lookup 4 8121 NULL
+ieee80211_if_fmt_num_buffered_multicast_8127 ieee80211_if_fmt_num_buffered_multicast 3 8127 NULL
++ufshcd_wait_for_dev_cmd_8168 ufshcd_wait_for_dev_cmd 0 8168 NULL
+__sk_mem_schedule_8185 __sk_mem_schedule 2 8185 NULL
+ieee80211_if_fmt_dot11MeshHoldingTimeout_8187 ieee80211_if_fmt_dot11MeshHoldingTimeout 3 8187 NULL
+recent_mt_proc_write_8206 recent_mt_proc_write 3 8206 NULL
+batadv_tt_len_8502 batadv_tt_len 0-1 8502 NULL
+dev_config_8506 dev_config 3 8506 NULL
+ACL_to_cifs_posix_8509 ACL_to_cifs_posix 3 8509 NULL
++nouveau_platform_device_create__8514 nouveau_platform_device_create_ 2 8514 NULL
+opticon_process_data_packet_8524 opticon_process_data_packet 3 8524 NULL
+user_on_off_8552 user_on_off 2 8552 NULL
+profile_remove_8556 profile_remove 3 8556 NULL
+shash_setkey_unaligned_8620 shash_setkey_unaligned 3 8620 NULL
+it821x_firmware_command_8628 it821x_firmware_command 3 8628 NULL
+scsi_dma_map_8632 scsi_dma_map 0 8632 NULL
-+fuse_send_write_pages_8636 fuse_send_write_pages 0-5 8636 NULL
++fuse_send_write_pages_8636 fuse_send_write_pages 5-0 8636 NULL
+mlx5_vzalloc_8663 mlx5_vzalloc 1 8663 NULL
+dio_bio_alloc_8677 dio_bio_alloc 5 8677 NULL
+lbs_bcnmiss_read_8678 lbs_bcnmiss_read 3 8678 NULL
+rproc_trace_read_8686 rproc_trace_read 3 8686 NULL
+skb_frag_size_8695 skb_frag_size 0 8695 NULL
+arcfb_write_8702 arcfb_write 3 8702 NULL
-+i_size_read_8703 i_size_read 0 8703 NULL
++i_size_read_8703 i_size_read 0 8703 NULL nohasharray
++init_header_8703 init_header 0 8703 &i_size_read_8703
++ufshcd_get_tr_ocs_8706 ufshcd_get_tr_ocs 0 8706 NULL
++HDLC_irq_8709 HDLC_irq 2 8709 NULL
+ctrl_out_8712 ctrl_out 3-5 8712 NULL
+tracing_max_lat_write_8728 tracing_max_lat_write 3 8728 NULL
+jffs2_acl_count_8729 jffs2_acl_count 0-1 8729 NULL
+kstrtoint_from_user_8778 kstrtoint_from_user 2 8778 NULL
+paging32_prefetch_gpte_8783 paging32_prefetch_gpte 4 8783 NULL
+ext4_try_to_write_inline_data_8785 ext4_try_to_write_inline_data 4-3 8785 NULL
-+__bitmap_weight_8796 __bitmap_weight 0 8796 NULL
++__bitmap_weight_8796 __bitmap_weight 0-2 8796 NULL
+metronomefb_write_8823 metronomefb_write 3 8823 NULL
+SyS_llistxattr_8824 SyS_llistxattr 3 8824 NULL
+ll_xattr_cache_get_8829 ll_xattr_cache_get 0 8829 NULL
+xgmac_reg_value_write_8860 xgmac_reg_value_write 3 8860 NULL
+radeon_drm_ioctl_8875 radeon_drm_ioctl 2 8875 NULL
+compressed_bio_size_8887 compressed_bio_size 0-2 8887 NULL
-+tracing_max_lat_read_8890 tracing_max_lat_read 3 8890 NULL nohasharray
-+ab3100_get_set_reg_8890 ab3100_get_set_reg 3 8890 &tracing_max_lat_read_8890
++ab3100_get_set_reg_8890 ab3100_get_set_reg 3 8890 NULL nohasharray
++tracing_max_lat_read_8890 tracing_max_lat_read 3 8890 &ab3100_get_set_reg_8890
+sdio_max_byte_size_8907 sdio_max_byte_size 0 8907 NULL
++sysfs_merge_group_8917 sysfs_merge_group 0 8917 NULL
+write_file_ani_8918 write_file_ani 3 8918 NULL
+layout_commit_8926 layout_commit 3 8926 NULL
+cp2112_hid_get_8933 cp2112_hid_get 4 8933 NULL
+jbd2_journal_blocks_per_page_9004 jbd2_journal_blocks_per_page 0 9004 NULL
+il_dbgfs_clear_ucode_stats_write_9016 il_dbgfs_clear_ucode_stats_write 3 9016 NULL
+snd_emu10k1_ptr_read_9026 snd_emu10k1_ptr_read 0-2 9026 NULL
++fd_ioctl_9028 fd_ioctl 3 9028 NULL
+nla_put_9042 nla_put 3 9042 NULL
-+sta_tx_latency_stat_header_9050 sta_tx_latency_stat_header 4-3-0 9050 NULL
++sta_tx_latency_stat_header_9050 sta_tx_latency_stat_header 0-3-4 9050 NULL
+snd_emu10k1_synth_copy_from_user_9061 snd_emu10k1_synth_copy_from_user 3-5 9061 NULL
+snd_gus_dram_peek_9062 snd_gus_dram_peek 4 9062 NULL
+fib_info_hash_alloc_9075 fib_info_hash_alloc 1 9075 NULL
+altera_swap_ir_9194 altera_swap_ir 2 9194 NULL
+snd_m3_get_pointer_9206 snd_m3_get_pointer 0 9206 NULL
+iwl_dbgfs_frame_stats_read_9211 iwl_dbgfs_frame_stats_read 3 9211 NULL
++card_send_command_9215 card_send_command 3 9215 NULL
+virtqueue_add_9217 virtqueue_add 4-5 9217 NULL
+tx_tx_prepared_descs_read_9221 tx_tx_prepared_descs_read 3 9221 NULL
++l2cap_create_connless_pdu_9222 l2cap_create_connless_pdu 3 9222 NULL
+sctp_getsockopt_delayed_ack_9232 sctp_getsockopt_delayed_ack 2 9232 NULL
+hfsplus_bnode_read_u16_9262 hfsplus_bnode_read_u16 0 9262 NULL
+hdpvr_read_9273 hdpvr_read 3 9273 NULL
+bm_realloc_pages_9431 bm_realloc_pages 2 9431 NULL
+ffs_ep0_write_9438 ffs_ep0_write 3 9438 NULL
+ieee80211_if_fmt_fwded_unicast_9454 ieee80211_if_fmt_fwded_unicast 3 9454 NULL
-+agp_generic_alloc_user_9470 agp_generic_alloc_user 1 9470 NULL nohasharray
-+get_registers_9470 get_registers 4 9470 &agp_generic_alloc_user_9470
++get_registers_9470 get_registers 4 9470 NULL nohasharray
++agp_generic_alloc_user_9470 agp_generic_alloc_user 1 9470 &get_registers_9470
+crypt_status_9492 crypt_status 5 9492 NULL
+lbs_threshold_write_9502 lbs_threshold_write 5 9502 NULL
+lp_write_9511 lp_write 3 9511 NULL
++mext_calc_swap_extents_9517 mext_calc_swap_extents 4 9517 NULL
+scsi_tgt_kspace_exec_9522 scsi_tgt_kspace_exec 8 9522 NULL
+ll_max_read_ahead_whole_mb_seq_write_9528 ll_max_read_ahead_whole_mb_seq_write 3 9528 NULL
+read_file_dma_9530 read_file_dma 3 9530 NULL
+dns_query_9676 dns_query 3 9676 NULL
+qib_7322_handle_hwerrors_9678 qib_7322_handle_hwerrors 3 9678 NULL
+__erst_read_from_storage_9690 __erst_read_from_storage 0 9690 NULL
++lowpan_control_write_9699 lowpan_control_write 3 9699 NULL
+vx_transfer_end_9701 vx_transfer_end 0 9701 NULL
+fuse_iter_npages_9705 fuse_iter_npages 0 9705 NULL nohasharray
+ieee80211_if_read_aid_9705 ieee80211_if_read_aid 3 9705 &fuse_iter_npages_9705
+__blk_queue_init_tags_9778 __blk_queue_init_tags 2 9778 NULL
+kvm_age_hva_9795 kvm_age_hva 2 9795 NULL
+bio_alloc_map_data_9798 bio_alloc_map_data 1 9798 NULL
-+udpv6_recvmsg_9813 udpv6_recvmsg 4 9813 NULL nohasharray
-+ieee80211_if_read_state_9813 ieee80211_if_read_state 3 9813 &udpv6_recvmsg_9813
++ieee80211_if_read_state_9813 ieee80211_if_read_state 3 9813 NULL nohasharray
++udpv6_recvmsg_9813 udpv6_recvmsg 4 9813 &ieee80211_if_read_state_9813
++compat_SyS_vmsplice_9828 compat_SyS_vmsplice 3 9828 NULL
+pmcraid_alloc_sglist_9864 pmcraid_alloc_sglist 1 9864 NULL
++f1x_translate_sysaddr_to_cs_9868 f1x_translate_sysaddr_to_cs 2 9868 NULL
+wil_read_file_ioblob_9878 wil_read_file_ioblob 3 9878 NULL
+bm_register_write_9893 bm_register_write 3 9893 NULL nohasharray
+snd_midi_event_new_9893 snd_midi_event_new 1 9893 &bm_register_write_9893
+snd_gf1_pcm_playback_copy_9895 snd_gf1_pcm_playback_copy 3-5 9895 NULL
+nonpaging_page_fault_9908 nonpaging_page_fault 2 9908 NULL
+iwl_dbgfs_prph_reg_read_9928 iwl_dbgfs_prph_reg_read 3 9928 NULL
++root_nfs_parse_options_9937 root_nfs_parse_options 3 9937 NULL
+pstore_ftrace_knob_read_9947 pstore_ftrace_knob_read 3 9947 NULL
+read_file_misc_9948 read_file_misc 3 9948 NULL
+csum_partial_copy_fromiovecend_9957 csum_partial_copy_fromiovecend 3-4 9957 NULL
+get_free_serial_index_9969 get_free_serial_index 0 9969 NULL
+btrfs_add_link_9973 btrfs_add_link 5 9973 NULL
+SYSC_move_pages_9986 SYSC_move_pages 2 9986 NULL
++ceph_oloc_oid_to_pg_10003 ceph_oloc_oid_to_pg 0 10003 NULL
+aat2870_dump_reg_10019 aat2870_dump_reg 0 10019 NULL
+ieee80211_set_probe_resp_10077 ieee80211_set_probe_resp 3 10077 NULL
+get_elem_size_10110 get_elem_size 0-2 10110 NULL nohasharray
+gfs2_meta_read_10112 gfs2_meta_read 0 10112 NULL
+SyS_migrate_pages_10134 SyS_migrate_pages 2 10134 NULL
+aes_decrypt_packets_read_10155 aes_decrypt_packets_read 3 10155 NULL
-+rx_out_of_mem_read_10157 rx_out_of_mem_read 3 10157 NULL
++rx_out_of_mem_read_10157 rx_out_of_mem_read 3 10157 NULL nohasharray
++tracing_nsecs_write_10157 tracing_nsecs_write 3 10157 &rx_out_of_mem_read_10157
+hidg_alloc_ep_req_10159 hidg_alloc_ep_req 2 10159 NULL
+asd_store_update_bios_10165 asd_store_update_bios 4 10165 NULL
+kstrtol_from_user_10168 kstrtol_from_user 2 10168 NULL
+proc_pid_attr_read_10173 proc_pid_attr_read 3 10173 NULL
+jffs2_user_setxattr_10182 jffs2_user_setxattr 4 10182 NULL
++hdlc_rpr_irq_10240 hdlc_rpr_irq 2 10240 NULL
++lmv_hsm_req_count_10245 lmv_hsm_req_count 0 10245 NULL
+cciss_proc_write_10259 cciss_proc_write 3 10259 NULL
+__qlcnic_pci_sriov_enable_10281 __qlcnic_pci_sriov_enable 2 10281 NULL
+snd_rme9652_capture_copy_10287 snd_rme9652_capture_copy 5 10287 NULL
-+ubi_leb_change_10289 ubi_leb_change 0 10289 NULL
++nvif_object_new_10300 nvif_object_new 5 10300 NULL
+read_emulate_10310 read_emulate 2-4 10310 NULL
+read_file_spectral_count_10320 read_file_spectral_count 3 10320 NULL
+compat_SyS_writev_10327 compat_SyS_writev 3 10327 NULL
+tun_sendmsg_10337 tun_sendmsg 4 10337 NULL
+ufx_alloc_urb_list_10349 ufx_alloc_urb_list 3 10349 NULL
++whci_add_cap_10350 whci_add_cap 0 10350 NULL
+dbAllocAny_10354 dbAllocAny 0 10354 NULL
+ath6kl_listen_int_read_10355 ath6kl_listen_int_read 3 10355 NULL
+sta_ht_capa_read_10366 sta_ht_capa_read 3 10366 NULL
+supply_map_read_file_10608 supply_map_read_file 3 10608 NULL
+ima_show_htable_violations_10619 ima_show_htable_violations 3 10619 NULL
+fq_alloc_node_10633 fq_alloc_node 1 10633 NULL
-+nfs_idmap_lookup_id_10660 nfs_idmap_lookup_id 2 10660 NULL nohasharray
-+ubi_io_write_vid_hdr_10660 ubi_io_write_vid_hdr 0 10660 &nfs_idmap_lookup_id_10660
++nfs_idmap_lookup_id_10660 nfs_idmap_lookup_id 2 10660 NULL
+efx_max_tx_len_10662 efx_max_tx_len 0-2 10662 NULL
+parport_write_10669 parport_write 0 10669 NULL
+edge_write_10692 edge_write 4 10692 NULL
-+ubi_wl_get_peb_10699 ubi_wl_get_peb 0 10699 NULL
+selinux_inode_setxattr_10708 selinux_inode_setxattr 4 10708 NULL nohasharray
+inl_10708 inl 0 10708 &selinux_inode_setxattr_10708
-+shash_async_setkey_10720 shash_async_setkey 3 10720 NULL nohasharray
-+pvr2_ioread_read_10720 pvr2_ioread_read 3 10720 &shash_async_setkey_10720
++pvr2_ioread_read_10720 pvr2_ioread_read 3 10720 NULL nohasharray
++shash_async_setkey_10720 shash_async_setkey 3 10720 &pvr2_ioread_read_10720
+spi_sync_10731 spi_sync 0 10731 NULL
+sctp_getsockopt_maxseg_10737 sctp_getsockopt_maxseg 2 10737 NULL nohasharray
+apu_get_register_10737 apu_get_register 0 10737 &sctp_getsockopt_maxseg_10737
+get_scq_10897 get_scq 2 10897 NULL
+tifm_alloc_adapter_10903 tifm_alloc_adapter 1 10903 NULL
+lprocfs_wr_atomic_10912 lprocfs_wr_atomic 3 10912 NULL
-+__copy_from_user_10918 __copy_from_user 3-0 10918 NULL
++__copy_from_user_10918 __copy_from_user 0-3 10918 NULL
++kobject_add_10919 kobject_add 0 10919 NULL
+ar9003_dump_modal_eeprom_10959 ar9003_dump_modal_eeprom 3-2-0 10959 NULL
+ci_port_test_write_10962 ci_port_test_write 3 10962 NULL
+bm_entry_read_10976 bm_entry_read 3 10976 NULL
+of_irq_count_11253 of_irq_count 0 11253 NULL
+hugetlbfs_read_11268 hugetlbfs_read 3 11268 NULL
+ath6kl_power_params_write_11274 ath6kl_power_params_write 3 11274 NULL
++SYSC_getrandom_11294 SYSC_getrandom 2 11294 NULL
++tipc_msg_build_11304 tipc_msg_build 3-4-5 11304 NULL
+__proc_daemon_file_11305 __proc_daemon_file 5 11305 NULL
+ext4_xattr_check_names_11314 ext4_xattr_check_names 0 11314 NULL
+bcache_dev_sectors_dirty_add_11315 bcache_dev_sectors_dirty_add 3-4 11315 NULL
+nl80211_send_mgmt_11353 nl80211_send_mgmt 7 11353 &sel_write_create_11353
+of_get_available_child_count_11361 of_get_available_child_count 0 11361 NULL
+qib_get_base_info_11369 qib_get_base_info 3 11369 NULL
-+nft_value_dump_11381 nft_value_dump 3 11381 NULL nohasharray
-+tcf_register_action_11381 tcf_register_action 2 11381 &nft_value_dump_11381
++tcf_register_action_11381 tcf_register_action 2 11381 NULL nohasharray
++nft_value_dump_11381 nft_value_dump 3 11381 &tcf_register_action_11381
+isku_sysfs_read_keys_capslock_11392 isku_sysfs_read_keys_capslock 6 11392 NULL
+dev_irnet_write_11398 dev_irnet_write 3 11398 NULL
+lprocfs_wr_evict_client_11402 lprocfs_wr_evict_client 3 11402 NULL
+i40e_dbg_command_write_11421 i40e_dbg_command_write 3 11421 NULL
+bttv_read_11432 bttv_read 3 11432 NULL
+create_zero_mask_11453 create_zero_mask 0-1 11453 NULL
-+sca3000_read_first_n_hw_rb_11479 sca3000_read_first_n_hw_rb 2 11479 NULL
++ufshcd_change_queue_depth_11477 ufshcd_change_queue_depth 2 11477 NULL
++sca3000_read_first_n_hw_rb_11479 sca3000_read_first_n_hw_rb 2 11479 NULL nohasharray
++pci_set_power_state_11479 pci_set_power_state 0 11479 &sca3000_read_first_n_hw_rb_11479
+sd_do_mode_sense_11507 sd_do_mode_sense 5 11507 NULL
+kmem_zalloc_11510 kmem_zalloc 1 11510 NULL
+ll_direct_IO_26_seg_11518 ll_direct_IO_26_seg 0 11518 NULL
+C_SYSC_migrate_pages_11618 C_SYSC_migrate_pages 2 11618 NULL
+sisusb_send_bridge_packet_11649 sisusb_send_bridge_packet 2 11649 NULL
+nla_total_size_11658 nla_total_size 0-1 11658 NULL
-+slab_ksize_11664 slab_ksize 0 11664 NULL
++srpc_create_client_rpc_11664 srpc_create_client_rpc 3 11664 NULL nohasharray
++slab_ksize_11664 slab_ksize 0 11664 &srpc_create_client_rpc_11664
+ide_queue_pc_tail_11673 ide_queue_pc_tail 5 11673 NULL
+compat_SyS_msgsnd_11675 compat_SyS_msgsnd 3 11675 NULL
+btrfs_alloc_delayed_item_11678 btrfs_alloc_delayed_item 1 11678 NULL
+ps_pspoll_timeouts_read_11776 ps_pspoll_timeouts_read 3 11776 NULL
+btrfs_key_blockptr_11786 btrfs_key_blockptr 0 11786 NULL
+pcpu_fc_alloc_11818 pcpu_fc_alloc 2 11818 NULL
++umc_device_register_11824 umc_device_register 0 11824 NULL
+zerocopy_sg_from_iovec_11828 zerocopy_sg_from_iovec 3 11828 NULL
+sctp_setsockopt_maxseg_11829 sctp_setsockopt_maxseg 3 11829 NULL
+rts51x_read_status_11830 rts51x_read_status 4 11830 NULL
+unix_stream_connect_11844 unix_stream_connect 3 11844 NULL
+ecryptfs_copy_filename_11868 ecryptfs_copy_filename 4 11868 NULL
++l2cap_chan_send_11878 l2cap_chan_send 3 11878 NULL
+ieee80211_rx_bss_info_11887 ieee80211_rx_bss_info 3 11887 NULL
+mdc_rename_11899 mdc_rename 4-6 11899 NULL
+xstateregs_get_11906 xstateregs_get 4 11906 NULL
+ti_write_11916 ti_write 4 11916 NULL
+fs_devrw_entry_11924 fs_devrw_entry 3 11924 NULL
++bitmap_remap_11929 bitmap_remap 5 11929 NULL
+atomic_sub_return_11939 atomic_sub_return 0-1 11939 NULL
+r1_sync_page_io_11963 r1_sync_page_io 3 11963 NULL
++f1x_swap_interleaved_region_11970 f1x_swap_interleaved_region 0-2 11970 NULL
+read_and_add_raw_conns_11987 read_and_add_raw_conns 0 11987 NULL
+ftdi_elan_total_command_size_12045 ftdi_elan_total_command_size 0 12045 NULL
+ieee80211_if_read_user_power_level_12050 ieee80211_if_read_user_power_level 3 12050 NULL
+xfs_handle_to_dentry_12135 xfs_handle_to_dentry 3 12135 NULL
+rawv6_seticmpfilter_12137 rawv6_seticmpfilter 5 12137 NULL
+rawsock_recvmsg_12144 rawsock_recvmsg 4 12144 NULL
-+get_idx_gc_leb_12148 get_idx_gc_leb 0 12148 NULL
+btmrvl_sdio_host_to_card_12152 btmrvl_sdio_host_to_card 3 12152 NULL
+vmbus_open_12154 vmbus_open 2-3 12154 NULL
+fnic_reset_stats_write_12177 fnic_reset_stats_write 3 12177 NULL
+il_dbgfs_nvm_read_12288 il_dbgfs_nvm_read 3 12288 &roundup_to_multiple_of_64_12288
+bt_sock_recvmsg_12316 bt_sock_recvmsg 4 12316 NULL
+usnic_transport_sock_to_str_12322 usnic_transport_sock_to_str 2-0 12322 NULL
++ufshcd_copy_query_response_12324 ufshcd_copy_query_response 0 12324 NULL
+pcbit_writecmd_12332 pcbit_writecmd 2 12332 NULL
+mptctl_ioctl_12355 mptctl_ioctl 2 12355 NULL
+__nf_ct_ext_add_length_12364 __nf_ct_ext_add_length 3 12364 NULL
+xfs_iext_inline_to_direct_12384 xfs_iext_inline_to_direct 2 12384 NULL
-+btrfs_file_extent_ram_bytes_12391 btrfs_file_extent_ram_bytes 0 12391 NULL nohasharray
-+write_file_dump_12391 write_file_dump 3 12391 &btrfs_file_extent_ram_bytes_12391
++write_file_dump_12391 write_file_dump 3 12391 NULL nohasharray
++btrfs_file_extent_ram_bytes_12391 btrfs_file_extent_ram_bytes 0 12391 &write_file_dump_12391 nohasharray
++populate_dir_12391 populate_dir 0 12391 &btrfs_file_extent_ram_bytes_12391
+hbucket_elem_add_12416 hbucket_elem_add 3 12416 NULL
+ieee80211_if_read_num_mcast_sta_12419 ieee80211_if_read_num_mcast_sta 3 12419 NULL
-+cfs_array_alloc_12441 cfs_array_alloc 2 12441 NULL
++cfs_array_alloc_12441 cfs_array_alloc 1-2 12441 NULL
+skb_do_copy_data_nocache_12465 skb_do_copy_data_nocache 5 12465 NULL
+x25_sendmsg_12487 x25_sendmsg 4 12487 NULL
+fnic_trace_ctrl_read_12497 fnic_trace_ctrl_read 3 12497 NULL
++__ceph_osdc_start_request_12502 __ceph_osdc_start_request 0 12502 NULL
+qib_alloc_fast_reg_mr_12526 qib_alloc_fast_reg_mr 2 12526 NULL
++nvkm_event_init_12565 nvkm_event_init 3-2 12565 NULL
+hvc_alloc_12579 hvc_alloc 4 12579 NULL
+pcpu_extend_area_map_12589 pcpu_extend_area_map 2 12589 NULL
+_iwl_dbgfs_prph_reg_write_12597 _iwl_dbgfs_prph_reg_write 3 12597 NULL
+nr_recvmsg_12649 nr_recvmsg 4 12649 NULL
+rtw_android_get_link_speed_12655 rtw_android_get_link_speed 0 12655 NULL
+ocfs2_read_block_12659 ocfs2_read_block 0 12659 NULL
-+sparse_mem_maps_populate_node_12669 sparse_mem_maps_populate_node 4 12669 NULL nohasharray
-+sel_read_class_12669 sel_read_class 3 12669 &sparse_mem_maps_populate_node_12669
++lustre_pack_request_v2_12665 lustre_pack_request_v2 2 12665 NULL
++sel_read_class_12669 sel_read_class 3 12669 NULL nohasharray
++sparse_mem_maps_populate_node_12669 sparse_mem_maps_populate_node 4 12669 &sel_read_class_12669
+ext4_writepage_trans_blocks_12674 ext4_writepage_trans_blocks 0 12674 NULL
+iwl_dbgfs_calib_disabled_write_12707 iwl_dbgfs_calib_disabled_write 3 12707 NULL
+ieee80211_if_read_num_buffered_multicast_12716 ieee80211_if_read_num_buffered_multicast 3 12716 NULL
+__mei_cl_async_send_12737 __mei_cl_async_send 3 12737 NULL
+ieee80211_if_read_dot11MeshMaxRetries_12756 ieee80211_if_read_dot11MeshMaxRetries 3 12756 NULL
+listxattr_12769 listxattr 3 12769 NULL
-+sctp_ssnmap_init_12772 sctp_ssnmap_init 3-2 12772 NULL
++sctp_ssnmap_init_12772 sctp_ssnmap_init 2-3 12772 NULL
+scsi_adjust_queue_depth_12802 scsi_adjust_queue_depth 3 12802 NULL
+xfs_inumbers_fmt_12817 xfs_inumbers_fmt 3 12817 NULL
+SyS_add_key_12834 SyS_add_key 4 12834 NULL
+ocfs2_write_begin_13045 ocfs2_write_begin 3-4 13045 NULL
+__dn_setsockopt_13060 __dn_setsockopt 5 13060 NULL nohasharray
+ptlrpc_lprocfs_threads_min_seq_write_13060 ptlrpc_lprocfs_threads_min_seq_write 3 13060 &__dn_setsockopt_13060
++ufshcd_compose_upiu_13076 ufshcd_compose_upiu 0 13076 NULL
+xattr_getsecurity_13090 xattr_getsecurity 0 13090 NULL
+ttm_dma_pool_alloc_new_pages_13105 ttm_dma_pool_alloc_new_pages 3 13105 NULL
+snd_rme96_playback_copy_13111 snd_rme96_playback_copy 5 13111 NULL
+bio_integrity_trim_13259 bio_integrity_trim 3-2 13259 NULL
+simple_attr_write_13260 simple_attr_write 3 13260 NULL
+pmcraid_notify_aen_13274 pmcraid_notify_aen 3 13274 NULL
-+il4965_stats_flag_13281 il4965_stats_flag 3-0 13281 NULL
++nvkm_ltc_create__13275 nvkm_ltc_create_ 4 13275 NULL
++il4965_stats_flag_13281 il4965_stats_flag 0-3 13281 NULL
+lpfc_idiag_mbxacc_get_setup_13282 lpfc_idiag_mbxacc_get_setup 0 13282 NULL
+nvkm_i2c_pad_create__13292 nvkm_i2c_pad_create_ 5 13292 NULL
+sd_major_13294 sd_major 0-1 13294 NULL
+read_file_phy_err_13318 read_file_phy_err 3 13318 NULL
+kvm_read_nested_guest_page_13337 kvm_read_nested_guest_page 5 13337 NULL
+round_event_name_len_13348 round_event_name_len 0 13348 NULL
++hscx_empty_fifo_13360 hscx_empty_fifo 2 13360 NULL
+iso_sched_alloc_13377 iso_sched_alloc 1 13377 NULL nohasharray
+wep_key_not_found_read_13377 wep_key_not_found_read 3 13377 &iso_sched_alloc_13377
+ext4_meta_trans_blocks_13380 ext4_meta_trans_blocks 0-3-2 13380 NULL
+packet_snd_13634 packet_snd 3 13634 NULL
+blk_msg_write_13655 blk_msg_write 3 13655 NULL
+cache_downcall_13666 cache_downcall 3 13666 NULL
++usb_get_string_13693 usb_get_string 0 13693 NULL
+fw_iso_buffer_alloc_13704 fw_iso_buffer_alloc 2 13704 NULL
+audit_unpack_string_13748 audit_unpack_string 3 13748 NULL
+udf_direct_IO_13765 udf_direct_IO 4 13765 NULL
+mutex_lock_interruptible_nested_13817 mutex_lock_interruptible_nested 0 13817 NULL
+hsi_register_board_info_13820 hsi_register_board_info 2 13820 NULL
+___mei_cl_send_13821 ___mei_cl_send 3 13821 NULL
++qce_ahash_hmac_setkey_13837 qce_ahash_hmac_setkey 3 13837 NULL
+enc_pools_insert_13849 enc_pools_insert 3 13849 NULL
+evdev_ioctl_compat_13851 evdev_ioctl_compat 2 13851 NULL
+compat_ip_setsockopt_13870 compat_ip_setsockopt 5 13870 NULL
+btrfs_token_file_extent_ram_bytes_14247 btrfs_token_file_extent_ram_bytes 0 14247 NULL
+ath6kl_connect_event_14267 ath6kl_connect_event 7-8-9 14267 NULL
+rr_status_14293 rr_status 5 14293 NULL
-+read_default_ldt_14302 read_default_ldt 2 14302 NULL
++read_default_ldt_14302 read_default_ldt 2 14302 NULL nohasharray
++lustre_pack_reply_flags_14302 lustre_pack_reply_flags 2 14302 &read_default_ldt_14302
+oo_objects_14319 oo_objects 0 14319 NULL
+p9_client_zc_rpc_14345 p9_client_zc_rpc 7 14345 NULL
+alloc_tx_struct_14349 alloc_tx_struct 1 14349 NULL
+ath6kl_regdump_read_14393 ath6kl_regdump_read 3 14393 NULL
+smk_write_onlycap_14400 smk_write_onlycap 3 14400 NULL
+mtd_concat_create_14416 mtd_concat_create 2 14416 NULL
++get_kcore_size_14425 get_kcore_size 0 14425 NULL
+_iwl_dbgfs_sram_write_14439 _iwl_dbgfs_sram_write 3 14439 NULL
+block_size_14443 block_size 0 14443 NULL
+lmv_user_md_size_14456 lmv_user_md_size 0-1 14456 NULL
+snd_emu10k1_proc_spdif_status_14457 snd_emu10k1_proc_spdif_status 4-5 14457 NULL
+ath10k_write_htt_stats_mask_14458 ath10k_write_htt_stats_mask 3 14458 NULL
-+lustre_msg_size_v2_14470 lustre_msg_size_v2 0 14470 NULL
++lustre_msg_size_v2_14470 lustre_msg_size_v2 0-1 14470 NULL
+udplite_getfrag_14479 udplite_getfrag 3-4 14479 NULL
+ieee80211_if_read_dot11MeshGateAnnouncementProtocol_14486 ieee80211_if_read_dot11MeshGateAnnouncementProtocol 3 14486 NULL
+ocfs2_debug_read_14507 ocfs2_debug_read 3 14507 NULL
+SyS_setdomainname_14569 SyS_setdomainname 2 14569 NULL
+idmap_pipe_downcall_14591 idmap_pipe_downcall 3 14591 NULL
+ceph_osdc_alloc_request_14597 ceph_osdc_alloc_request 3 14597 NULL
++ufshcd_compose_dev_cmd_14626 ufshcd_compose_dev_cmd 0 14626 NULL
+dbJoin_14644 dbJoin 0 14644 NULL
+profile_replace_14652 profile_replace 3 14652 NULL
+usnic_vnic_dump_14662 usnic_vnic_dump 3 14662 NULL
+sta_dev_read_14782 sta_dev_read 3 14782 NULL
+keys_proc_write_14792 keys_proc_write 3 14792 NULL
+ext4_kvmalloc_14796 ext4_kvmalloc 1 14796 NULL
-+__kfifo_in_14797 __kfifo_in 3-0 14797 NULL
++__kfifo_in_14797 __kfifo_in 3-0 14797 NULL nohasharray
++ttm_page_pool_free_14797 ttm_page_pool_free 2-0 14797 &__kfifo_in_14797
+hpet_readl_14801 hpet_readl 0 14801 NULL nohasharray
+snd_als300_gcr_read_14801 snd_als300_gcr_read 0 14801 &hpet_readl_14801
+mrp_attr_create_14853 mrp_attr_create 3 14853 NULL
+get_user_cpu_mask_14861 get_user_cpu_mask 2 14861 NULL
+acpi_os_allocate_14892 acpi_os_allocate 1 14892 NULL
+SYSC_readv_14901 SYSC_readv 3 14901 NULL
++netlbl_catmap_walk_14902 netlbl_catmap_walk 0-2 14902 NULL
+__arch_hweight64_14923 __arch_hweight64 0 14923 NULL nohasharray
-+qp_memcpy_to_queue_iov_14923 qp_memcpy_to_queue_iov 5-2 14923 &__arch_hweight64_14923
++qp_memcpy_to_queue_iov_14923 qp_memcpy_to_queue_iov 5-2 14923 &__arch_hweight64_14923 nohasharray
++ptlrpc_prep_req_pool_14923 ptlrpc_prep_req_pool 4 14923 &qp_memcpy_to_queue_iov_14923
+ocfs2_expand_nonsparse_inode_14936 ocfs2_expand_nonsparse_inode 3-4 14936 NULL
+queue_cnt_14951 queue_cnt 0 14951 NULL
+unix_dgram_recvmsg_14952 unix_dgram_recvmsg 4 14952 NULL
+mce_flush_rx_buffer_14976 mce_flush_rx_buffer 2 14976 NULL
+setkey_14987 setkey 3 14987 NULL nohasharray
+gpio_twl4030_write_14987 gpio_twl4030_write 1 14987 &setkey_14987
++sctp_setsockopt_default_sndinfo_15011 sctp_setsockopt_default_sndinfo 3 15011 NULL
+blk_integrity_tuple_size_15027 blk_integrity_tuple_size 0 15027 NULL
+read_file_node_aggr_15040 read_file_node_aggr 3 15040 NULL
+cld_pipe_downcall_15058 cld_pipe_downcall 3 15058 NULL
+hex_dump_to_buffer_15121 hex_dump_to_buffer 6 15121 NULL
+start_port_15124 start_port 0 15124 NULL
+ipwireless_ppp_mru_15153 ipwireless_ppp_mru 0 15153 NULL
-+self_check_not_bad_15175 self_check_not_bad 0 15175 NULL
+SYSC_setdomainname_15180 SYSC_setdomainname 2 15180 NULL
+iscsi_create_endpoint_15193 iscsi_create_endpoint 1 15193 NULL
+mtt_alloc_res_15211 mtt_alloc_res 5 15211 NULL
+bfad_debugfs_write_regrd_15218 bfad_debugfs_write_regrd 3 15218 NULL
+iwl_dbgfs_sram_write_15239 iwl_dbgfs_sram_write 3 15239 NULL
+il_dbgfs_rx_stats_read_15243 il_dbgfs_rx_stats_read 3 15243 NULL
++wacom_led_putimage_15264 wacom_led_putimage 4 15264 NULL
+simple_strtol_15273 simple_strtol 0 15273 NULL
+fw_realloc_buffer_15280 fw_realloc_buffer 2 15280 NULL
+kovaplus_sysfs_read_15337 kovaplus_sysfs_read 6 15337 NULL
+pipeline_csum_to_rx_xfer_swi_read_15403 pipeline_csum_to_rx_xfer_swi_read 3 15403 NULL
+get_modalias_15406 get_modalias 2 15406 NULL
+__videobuf_copy_to_user_15423 __videobuf_copy_to_user 4-0 15423 NULL
-+tcp_mtu_to_mss_15438 tcp_mtu_to_mss 0-2 15438 NULL
++tcp_mtu_to_mss_15438 tcp_mtu_to_mss 2-0 15438 NULL
+hpsa_change_queue_depth_15449 hpsa_change_queue_depth 2 15449 NULL
++memweight_15450 memweight 2 15450 NULL
+__clone_and_map_data_bio_15498 __clone_and_map_data_bio 3 15498 NULL
-+insert_old_idx_znode_15500 insert_old_idx_znode 0 15500 NULL
+zd_chip_is_zd1211b_15518 zd_chip_is_zd1211b 0 15518 NULL
+ifx_spi_write_15531 ifx_spi_write 3 15531 NULL
+p9_check_zc_errors_15534 p9_check_zc_errors 4 15534 NULL
+fs_path_add_15648 fs_path_add 3 15648 NULL
+xsd_read_15653 xsd_read 3 15653 NULL
+unix_bind_15668 unix_bind 3 15668 NULL
-+SyS_connect_15674 SyS_connect 3 15674 NULL nohasharray
-+dm_read_15674 dm_read 3 15674 &SyS_connect_15674
++dm_read_15674 dm_read 3 15674 NULL nohasharray
++SyS_connect_15674 SyS_connect 3 15674 &dm_read_15674
+uinput_str_to_user_15695 uinput_str_to_user 3 15695 NULL
+__sk_migrate_realloc_15709 __sk_migrate_realloc 3 15709 NULL
+tracing_snapshot_write_15719 tracing_snapshot_write 3 15719 NULL
+afs_proc_rootcell_write_15822 afs_proc_rootcell_write 3 15822 NULL
+table_size_15851 table_size 0-1-2 15851 NULL
+write_file_tx99_15856 write_file_tx99 3 15856 NULL
-+media_entity_init_15870 media_entity_init 2-4 15870 NULL nohasharray
-+ubi_io_write_15870 ubi_io_write 0 15870 &media_entity_init_15870
++media_entity_init_15870 media_entity_init 2-4 15870 NULL
+__mptctl_ioctl_15875 __mptctl_ioctl 2 15875 NULL
+parse_audio_stream_data_15937 parse_audio_stream_data 3 15937 NULL
+power_read_15939 power_read 3 15939 NULL
+isr_tx_exch_complete_read_16103 isr_tx_exch_complete_read 3 16103 NULL
+isr_hw_pm_mode_changes_read_16110 isr_hw_pm_mode_changes_read 3 16110 NULL nohasharray
+dma_tx_requested_read_16110 dma_tx_requested_read 3 16110 &isr_hw_pm_mode_changes_read_16110
++udelay_test_write_16111 udelay_test_write 3 16111 NULL
+snd_dma_pointer_16126 snd_dma_pointer 0-2 16126 NULL
+fsm_init_16134 fsm_init 2 16134 NULL
+ext4_xattr_block_get_16148 ext4_xattr_block_get 0 16148 NULL
+optimal_reclaimed_pages_16172 optimal_reclaimed_pages 0 16172 NULL
-+mapping_level_16188 mapping_level 0-2 16188 NULL
++mapping_level_16188 mapping_level 2-0 16188 NULL
+i40e_allocate_virt_mem_d_16191 i40e_allocate_virt_mem_d 3 16191 NULL
+ath10k_htt_rx_ring_size_16201 ath10k_htt_rx_ring_size 0 16201 NULL
+cipso_v4_map_cat_rng_hton_16203 cipso_v4_map_cat_rng_hton 0 16203 NULL
+SyS_fgetxattr_16254 SyS_fgetxattr 4 16254 NULL
+reiserfs_acl_count_16265 reiserfs_acl_count 0-1 16265 NULL
+ocfs2_xattr_bucket_value_truncate_16279 ocfs2_xattr_bucket_value_truncate 4 16279 NULL
-+drbd_setsockopt_16280 drbd_setsockopt 5 16280 NULL nohasharray
-+nand_bch_init_16280 nand_bch_init 3-2 16280 &drbd_setsockopt_16280
++nand_bch_init_16280 nand_bch_init 3-2 16280 NULL nohasharray
++drbd_setsockopt_16280 drbd_setsockopt 5 16280 &nand_bch_init_16280
+account_16283 account 0-4-2 16283 NULL nohasharray
+mirror_status_16283 mirror_status 5 16283 &account_16283
+jumpshot_read_data_16287 jumpshot_read_data 4 16287 NULL
+rbd_segment_offset_16293 rbd_segment_offset 0-2 16293 NULL
+rsc_mgr_init_16299 rsc_mgr_init 3 16299 NULL
+kvm_handle_hva_range_16312 kvm_handle_hva_range 3-2 16312 NULL
++sysfs_create_groups_16360 sysfs_create_groups 0 16360 NULL
+total_ps_buffered_read_16365 total_ps_buffered_read 3 16365 NULL
+iscsi_tcp_conn_setup_16376 iscsi_tcp_conn_setup 2 16376 NULL
++nv50_pioc_create_16389 nv50_pioc_create 5 16389 NULL
+ieee80211_if_read_tsf_16420 ieee80211_if_read_tsf 3 16420 NULL
+rxrpc_server_keyring_16431 rxrpc_server_keyring 3 16431 NULL
+__bio_add_page_16435 __bio_add_page 0-4 16435 NULL
+raid10_resize_16537 raid10_resize 2 16537 NULL
+lpfc_debugfs_read_16566 lpfc_debugfs_read 3 16566 NULL
+agp_allocate_memory_wrap_16576 agp_allocate_memory_wrap 1 16576 NULL
-+lustre_msg_hdr_size_v2_16589 lustre_msg_hdr_size_v2 0 16589 NULL
++lustre_msg_hdr_size_v2_16589 lustre_msg_hdr_size_v2 0-1 16589 NULL
+compat_SyS_migrate_pages_16618 compat_SyS_migrate_pages 2 16618 NULL
+rtw_set_wpa_ie_16633 rtw_set_wpa_ie 3 16633 NULL
+btrfs_get_token_32_16651 btrfs_get_token_32 0 16651 NULL
+__wa_populate_dto_urb_16699 __wa_populate_dto_urb 3-4 16699 NULL
++_iwl_dbgfs_bt_force_ant_write_16701 _iwl_dbgfs_bt_force_ant_write 3 16701 NULL
+__proc_lnet_buffers_16717 __proc_lnet_buffers 5 16717 NULL
+__copy_to_user_swizzled_16748 __copy_to_user_swizzled 3-4 16748 NULL
+arcmsr_adjust_disk_queue_depth_16756 arcmsr_adjust_disk_queue_depth 2 16756 NULL
+snd_gf1_mem_proc_dump_16926 snd_gf1_mem_proc_dump 5 16926 &psb_unlocked_ioctl_16926
+_sp2d_alloc_16944 _sp2d_alloc 1-2-3 16944 NULL
+squashfs_read_table_16945 squashfs_read_table 3 16945 NULL
++svcxdr_dupstr_16963 svcxdr_dupstr 3 16963 NULL
+keyctl_instantiate_key_iov_16969 keyctl_instantiate_key_iov 3 16969 NULL
+ceph_read_dir_17005 ceph_read_dir 3 17005 NULL
+copy_counters_to_user_17027 copy_counters_to_user 5 17027 NULL
+do_blockdev_direct_IO_17143 do_blockdev_direct_IO 0-6 17143 NULL
+nouveau_instobj_create__17144 nouveau_instobj_create_ 4 17144 NULL
+jumpshot_write_data_17151 jumpshot_write_data 4 17151 NULL
++mxt_upload_cfg_mem_17157 mxt_upload_cfg_mem 4 17157 NULL
+sep_read_17161 sep_read 3 17161 NULL
+befs_nls2utf_17163 befs_nls2utf 3 17163 NULL
+tx_tx_start_templates_read_17164 tx_tx_start_templates_read 3 17164 NULL
+hmac_sha256_17278 hmac_sha256 2 17278 NULL
+neigh_hash_grow_17283 neigh_hash_grow 2 17283 NULL
+minstrel_stats_read_17290 minstrel_stats_read 3 17290 NULL
++__ptlrpc_request_bufs_pack_17298 __ptlrpc_request_bufs_pack 4 17298 NULL
+ieee80211_if_fmt_dot11MeshForwarding_17301 ieee80211_if_fmt_dot11MeshForwarding 3 17301 NULL
+mb_cache_create_17307 mb_cache_create 2 17307 NULL
+gnttab_map_frames_v2_17314 gnttab_map_frames_v2 2 17314 NULL
+__copy_to_user_17551 __copy_to_user 0-3 17551 NULL
+copy_from_user_17559 copy_from_user 3-0 17559 NULL
+hash_netport4_expire_17573 hash_netport4_expire 4 17573 NULL
++wil_write_file_rxon_17581 wil_write_file_rxon 3 17581 NULL
+acpi_ut_create_package_object_17594 acpi_ut_create_package_object 1 17594 NULL
+neigh_hash_alloc_17595 neigh_hash_alloc 1 17595 NULL
+osst_execute_17607 osst_execute 7-6 17607 NULL
+dma_map_page_17628 dma_map_page 0 17628 NULL
+twl4030_set_gpio_direction_17645 twl4030_set_gpio_direction 1 17645 NULL
+SYSC_migrate_pages_17657 SYSC_migrate_pages 2 17657 NULL
-+packet_setsockopt_17662 packet_setsockopt 5 17662 NULL nohasharray
-+ubi_io_read_data_17662 ubi_io_read_data 0 17662 &packet_setsockopt_17662
++packet_setsockopt_17662 packet_setsockopt 5 17662 NULL
+pwr_enable_ps_read_17686 pwr_enable_ps_read 3 17686 NULL
+venus_rename_17707 venus_rename 4-5 17707 NULL
+exofs_read_lookup_dev_table_17733 exofs_read_lookup_dev_table 3 17733 NULL
+sctpprobe_read_17741 sctpprobe_read 3 17741 NULL
-+ubifs_leb_change_17789 ubifs_leb_change 0 17789 NULL
++nv92_gpio_intr_mask_17773 nv92_gpio_intr_mask 4-3 17773 NULL
+shrink_slab_node_17794 shrink_slab_node 3 17794 NULL
+lpuart_copy_rx_to_tty_17801 lpuart_copy_rx_to_tty 3 17801 NULL
+gnet_stats_copy_app_17821 gnet_stats_copy_app 3 17821 NULL
+svc_getnl_18120 svc_getnl 0 18120 NULL
+paging32_gpte_to_gfn_lvl_18131 paging32_gpte_to_gfn_lvl 0-2-1 18131 NULL
+selinux_inode_setsecurity_18148 selinux_inode_setsecurity 4 18148 NULL
-+is_idx_node_in_use_18165 is_idx_node_in_use 0 18165 NULL
++enable_ints_write_18170 enable_ints_write 3 18170 NULL
+pccard_store_cis_18176 pccard_store_cis 6 18176 NULL
+orinoco_add_extscan_result_18207 orinoco_add_extscan_result 3 18207 NULL
+gsm_control_message_18209 gsm_control_message 4 18209 NULL
+do_ipv6_setsockopt_18215 do_ipv6_setsockopt 5 18215 NULL
++fill_ext_prop_18233 fill_ext_prop 0 18233 NULL
+gnttab_alloc_grant_references_18240 gnttab_alloc_grant_references 1 18240 NULL
+alloc_trace_uprobe_18247 alloc_trace_uprobe 3 18247 NULL
+rfcomm_sock_setsockopt_18254 rfcomm_sock_setsockopt 5 18254 NULL
+qdisc_class_hash_alloc_18262 qdisc_class_hash_alloc 1 18262 NULL
+gfs2_alloc_sort_buffer_18275 gfs2_alloc_sort_buffer 1 18275 NULL
+alloc_ring_18278 alloc_ring 2-4 18278 NULL
-+find_dirty_idx_leb_18280 find_dirty_idx_leb 0 18280 NULL
+bio_phys_segments_18281 bio_phys_segments 0 18281 NULL nohasharray
+nouveau_subdev_create__18281 nouveau_subdev_create_ 7 18281 &bio_phys_segments_18281
+ext4_readpages_18283 ext4_readpages 4 18283 NULL
+mmc_send_bus_test_18285 mmc_send_bus_test 4 18285 NULL
+um_idi_write_18293 um_idi_write 3 18293 NULL
+nouveau_disp_create__18305 nouveau_disp_create_ 4-7 18305 NULL
++lustre_msg_hdr_size_18308 lustre_msg_hdr_size 2 18308 NULL
+class_add_profile_18315 class_add_profile 1-3-5 18315 NULL
+csio_mem_read_18319 csio_mem_read 3 18319 NULL
+alloc_and_copy_string_18321 alloc_and_copy_string 2 18321 NULL
+ecryptfs_send_message_18322 ecryptfs_send_message 2 18322 NULL
+bio_integrity_advance_18324 bio_integrity_advance 2 18324 NULL
-+copy_page_to_iter_18345 copy_page_to_iter 3-0 18345 NULL
++copy_page_to_iter_18345 copy_page_to_iter 0-3 18345 NULL
+lcd_proc_write_18351 lcd_proc_write 3 18351 NULL
+pwr_power_save_off_read_18355 pwr_power_save_off_read 3 18355 NULL
+SyS_process_vm_readv_18366 SyS_process_vm_readv 3-5 18366 NULL
+qib_user_sdma_num_pages_18371 qib_user_sdma_num_pages 0 18371 NULL
+__ceph_getxattr_18386 __ceph_getxattr 0 18386 NULL
+ci_role_write_18388 ci_role_write 3 18388 NULL
++hdlc_empty_fifo_18397 hdlc_empty_fifo 2 18397 NULL
+adis16136_show_serial_18402 adis16136_show_serial 3 18402 NULL
++nvif_device_init_18418 nvif_device_init 6 18418 NULL
+memblock_virt_alloc_node_nopanic_18431 memblock_virt_alloc_node_nopanic 1 18431 NULL
+iscsi_create_flashnode_sess_18433 iscsi_create_flashnode_sess 4 18433 NULL
+snd_hda_get_connections_18437 snd_hda_get_connections 0 18437 NULL
+filemap_fdatawait_range_18600 filemap_fdatawait_range 0 18600 NULL
+iowarrior_write_18604 iowarrior_write 3 18604 NULL
+from_buffer_18625 from_buffer 3 18625 NULL
++kmalloc_kernel_18641 kmalloc_kernel 1 18641 NULL
+snd_pcm_oss_write3_18657 snd_pcm_oss_write3 0-3 18657 NULL
+ieee80211_if_fmt_rssi_threshold_18664 ieee80211_if_fmt_rssi_threshold 3 18664 NULL
+xfs_iext_insert_18667 xfs_iext_insert 3 18667 NULL
+read_file_dump_nfcal_18766 read_file_dump_nfcal 3 18766 NULL
+SyS_lsetxattr_18776 SyS_lsetxattr 4 18776 NULL
+alloc_fcdev_18780 alloc_fcdev 1 18780 NULL
++fence_context_alloc_18792 fence_context_alloc 1 18792 NULL
+dm_stats_print_18815 dm_stats_print 7 18815 NULL
+sys_modify_ldt_18824 sys_modify_ldt 3 18824 NULL
+mtf_test_write_18844 mtf_test_write 3 18844 NULL
+ieee80211_if_read_element_ttl_18869 ieee80211_if_read_element_ttl 3 18869 NULL
+xlog_find_verify_log_record_18870 xlog_find_verify_log_record 2 18870 NULL
+devm_mdiobus_alloc_size_18902 devm_mdiobus_alloc_size 2 18902 NULL
++tracing_thresh_write_18909 tracing_thresh_write 3 18909 NULL
+ceph_setxattr_18913 ceph_setxattr 4 18913 NULL
+ieee80211_rx_mgmt_disassoc_18927 ieee80211_rx_mgmt_disassoc 3 18927 NULL
++snapshot_write_next_18937 snapshot_write_next 0 18937 NULL
+__nla_reserve_18974 __nla_reserve 3 18974 NULL
-+find_dirtiest_idx_leb_19001 find_dirtiest_idx_leb 0 19001 NULL
+layout_in_gaps_19006 layout_in_gaps 2 19006 NULL
+huge_page_size_19008 huge_page_size 0 19008 NULL
+hash_netport6_expire_19013 hash_netport6_expire 4 19013 NULL
++sysfs_create_dir_ns_19033 sysfs_create_dir_ns 0 19033 NULL
+revalidate_19043 revalidate 2 19043 NULL
+afs_vnode_store_data_19048 afs_vnode_store_data 2-3-4-5 19048 NULL
+osc_pinger_recov_seq_write_19056 osc_pinger_recov_seq_write 3 19056 NULL
+sta_last_seq_ctrl_read_19106 sta_last_seq_ctrl_read 3 19106 NULL
+cifs_readv_from_socket_19109 cifs_readv_from_socket 3 19109 NULL
+skb_gro_offset_19123 skb_gro_offset 0 19123 NULL
++cma_bitmap_maxno_19135 cma_bitmap_maxno 0 19135 NULL
+snd_als4k_iobase_readl_19136 snd_als4k_iobase_readl 0 19136 NULL
+alloc_irdadev_19140 alloc_irdadev 1 19140 NULL
+sleep_auth_read_19159 sleep_auth_read 3 19159 NULL
+batadv_tt_save_orig_buffer_19288 batadv_tt_save_orig_buffer 4 19288 NULL nohasharray
+cfg80211_rx_unprot_mlme_mgmt_19288 cfg80211_rx_unprot_mlme_mgmt 3 19288 &batadv_tt_save_orig_buffer_19288
+qc_capture_19298 qc_capture 3 19298 NULL
-+ocfs2_prepare_inode_for_refcount_19303 ocfs2_prepare_inode_for_refcount 3-4 19303 NULL
++ocfs2_prepare_inode_for_refcount_19303 ocfs2_prepare_inode_for_refcount 4-3 19303 NULL
+event_tx_stuck_read_19305 event_tx_stuck_read 3 19305 NULL
+debug_read_19322 debug_read 3 19322 NULL
+lbs_host_sleep_write_19332 lbs_host_sleep_write 3 19332 NULL nohasharray
+gnet_stats_copy_19458 gnet_stats_copy 4 19458 NULL
+gp2ap020a00f_get_thresh_reg_19468 gp2ap020a00f_get_thresh_reg 0 19468 NULL
+sky2_read16_19475 sky2_read16 0 19475 NULL
++__read_status_pciv2_19492 __read_status_pciv2 0 19492 NULL
+kstrtoll_from_user_19500 kstrtoll_from_user 2 19500 NULL
+ext4_add_new_descs_19509 ext4_add_new_descs 3 19509 NULL
+batadv_tvlv_container_register_19520 batadv_tvlv_container_register 5 19520 NULL
++ttm_dma_page_pool_free_19527 ttm_dma_page_pool_free 2-0 19527 NULL
+nfc_llcp_build_tlv_19536 nfc_llcp_build_tlv 3 19536 NULL
+gfn_to_index_19558 gfn_to_index 0-1-3-2 19558 NULL
+ocfs2_control_message_19564 ocfs2_control_message 3 19564 NULL
+ieee80211_key_alloc_19575 ieee80211_key_alloc 3 19575 NULL
+bm_status_read_19583 bm_status_read 3 19583 NULL
+load_xattr_datum_19594 load_xattr_datum 0 19594 NULL
++drbg_sec_strength_19604 drbg_sec_strength 0 19604 NULL
+__mei_cl_recv_19636 __mei_cl_recv 3 19636 NULL
++parser_init_19651 parser_init 2 19651 NULL
+LoadBitmap_19658 LoadBitmap 2 19658 NULL
+memblock_virt_alloc_low_nopanic_19714 memblock_virt_alloc_low_nopanic 1 19714 NULL
+read_reg_19723 read_reg 0 19723 NULL
+pnpbios_proc_write_19758 pnpbios_proc_write 3 19758 NULL
+ocfs2_readpages_19759 ocfs2_readpages 4 19759 NULL
+jffs2_acl_from_medium_19762 jffs2_acl_from_medium 2 19762 NULL
++readhscx_19769 readhscx 0 19769 NULL
++ath10k_write_htt_max_amsdu_ampdu_19820 ath10k_write_htt_max_amsdu_ampdu 3 19820 NULL
+irda_setsockopt_19824 irda_setsockopt 5 19824 NULL
+vfs_getxattr_19832 vfs_getxattr 0 19832 NULL
+crypt_alloc_buffer_19846 crypt_alloc_buffer 2 19846 NULL
+mangle_name_19923 mangle_name 0 19923 NULL
+cgroup_task_count_19930 cgroup_task_count 0 19930 NULL
+guest_read_tsc_19931 guest_read_tsc 0 19931 NULL
++azx_get_pos_lpib_19933 azx_get_pos_lpib 0 19933 NULL
++v4l2_ctrl_new_19942 v4l2_ctrl_new 8-12 19942 NULL
+iwl_dbgfs_rx_queue_read_19943 iwl_dbgfs_rx_queue_read 3 19943 NULL
+cfg80211_rx_assoc_resp_19944 cfg80211_rx_assoc_resp 4 19944 NULL
+ll_xattr_cache_list_19954 ll_xattr_cache_list 0 19954 NULL
++get_jack_mode_name_19976 get_jack_mode_name 4 19976 NULL
+attach_hdlc_protocol_19986 attach_hdlc_protocol 3 19986 NULL
+rtw_set_wps_probe_resp_19989 rtw_set_wps_probe_resp 3 19989 NULL
++lustre_pack_request_19992 lustre_pack_request 3 19992 NULL
++find_overflow_devnum_19995 find_overflow_devnum 0 19995 NULL
+diva_um_idi_read_20003 diva_um_idi_read 0 20003 NULL
-+event_trigger_write_20009 event_trigger_write 3 20009 NULL nohasharray
-+lov_stripe_md_size_20009 lov_stripe_md_size 0-1 20009 &event_trigger_write_20009
++lov_stripe_md_size_20009 lov_stripe_md_size 0-1 20009 NULL nohasharray
++event_trigger_write_20009 event_trigger_write 3 20009 &lov_stripe_md_size_20009
+tree_mod_log_eb_move_20011 tree_mod_log_eb_move 5 20011 NULL
+SYSC_fgetxattr_20027 SYSC_fgetxattr 4 20027 NULL
+split_scan_timeout_read_20029 split_scan_timeout_read 3 20029 NULL
-+iwl_mvm_power_mac_dbgfs_read_20067 iwl_mvm_power_mac_dbgfs_read 4-0 20067 NULL
++iwl_mvm_power_mac_dbgfs_read_20067 iwl_mvm_power_mac_dbgfs_read 0-4 20067 NULL
++target_message_20072 target_message 2 20072 NULL
+rawv6_sendmsg_20080 rawv6_sendmsg 4 20080 NULL
+fuse_conn_limit_read_20084 fuse_conn_limit_read 3 20084 NULL
+aat2870_reg_write_file_20086 aat2870_reg_write_file 3 20086 NULL
+team_options_register_20091 team_options_register 3 20091 NULL
+qla2x00_adjust_sdev_qdepth_up_20097 qla2x00_adjust_sdev_qdepth_up 2 20097 NULL
++root_nfs_copy_20111 root_nfs_copy 3 20111 NULL
+hptiop_adjust_disk_queue_depth_20122 hptiop_adjust_disk_queue_depth 2 20122 NULL
-+self_check_vid_hdr_20131 self_check_vid_hdr 0 20131 NULL
+ext4_ext_direct_IO_20165 ext4_ext_direct_IO 4 20165 NULL
+tomoyo_commit_ok_20167 tomoyo_commit_ok 2 20167 NULL
+read_flush_pipefs_20171 read_flush_pipefs 3 20171 NULL
+handle_arr_calc_size_20355 handle_arr_calc_size 0-1 20355 NULL
+smk_set_cipso_20379 smk_set_cipso 3 20379 NULL
+snd_nm256_readl_20394 snd_nm256_readl 0 20394 NULL
-+__kfifo_from_user_20399 __kfifo_from_user 3 20399 NULL nohasharray
-+SyS_get_mempolicy_20399 SyS_get_mempolicy 3 20399 &__kfifo_from_user_20399
++SyS_get_mempolicy_20399 SyS_get_mempolicy 3 20399 NULL nohasharray
++__kfifo_from_user_20399 __kfifo_from_user 3 20399 &SyS_get_mempolicy_20399
+compat_ipv6_setsockopt_20468 compat_ipv6_setsockopt 5 20468 NULL
+read_buf_20469 read_buf 2 20469 NULL
+bio_trim_20472 bio_trim 2 20472 NULL
+qib_qsfp_write_20614 qib_qsfp_write 0-4-2 20614 NULL
+snd_pcm_oss_prepare_20641 snd_pcm_oss_prepare 0 20641 NULL
+get_extent_skip_holes_20642 get_extent_skip_holes 2 20642 NULL
-+kfifo_copy_to_user_20646 kfifo_copy_to_user 4-3 20646 NULL
-+cpulist_scnprintf_20648 cpulist_scnprintf 2 20648 NULL
++kfifo_copy_to_user_20646 kfifo_copy_to_user 3-4 20646 NULL
++cpulist_scnprintf_20648 cpulist_scnprintf 2-0 20648 NULL
+oz_add_farewell_20652 oz_add_farewell 5 20652 NULL
+oz_cdev_read_20659 oz_cdev_read 3 20659 NULL
+snd_hdsp_playback_copy_20676 snd_hdsp_playback_copy 5 20676 NULL
+vol_cdev_direct_write_20751 vol_cdev_direct_write 3 20751 NULL
+ocfs2_align_bytes_to_clusters_20754 ocfs2_align_bytes_to_clusters 2 20754 NULL
+brcmf_p2p_escan_20763 brcmf_p2p_escan 2 20763 NULL
-+ubi_io_read_20767 ubi_io_read 0 20767 NULL
+fb_alloc_cmap_gfp_20792 fb_alloc_cmap_gfp 2 20792 NULL
+iwl_dbgfs_rxon_flags_read_20795 iwl_dbgfs_rxon_flags_read 3 20795 NULL
++edid_write_20797 edid_write 3 20797 NULL
+lowpan_write_20800 lowpan_write 3 20800 NULL
+strndup_user_20819 strndup_user 2 20819 NULL
+tipc_msg_build_20825 tipc_msg_build 3 20825 NULL
+uvc_alloc_entity_20836 uvc_alloc_entity 4-3 20836 NULL
+p9_tag_alloc_20845 p9_tag_alloc 3 20845 NULL
+nvme_trans_supported_vpd_pages_20847 nvme_trans_supported_vpd_pages 4 20847 NULL
++get_name_20855 get_name 4 20855 NULL
+iwl_dbgfs_pm_params_read_20866 iwl_dbgfs_pm_params_read 3 20866 NULL
+snd_pcm_capture_avail_20867 snd_pcm_capture_avail 0 20867 NULL
+srq_free_res_20868 srq_free_res 5 20868 NULL
+cfs_cpt_table_create_20884 cfs_cpt_table_create 1 20884 NULL
++req_capsule_filled_sizes_20888 req_capsule_filled_sizes 0 20888 NULL
+rb_simple_write_20890 rb_simple_write 3 20890 NULL
+sisusb_send_packet_20891 sisusb_send_packet 2 20891 NULL
+key_icverrors_read_20895 key_icverrors_read 3 20895 NULL
+alg_setsockopt_20985 alg_setsockopt 5 20985 NULL
+qib_verbs_send_20999 qib_verbs_send 5-3 20999 NULL
+btrfs_inode_ref_name_len_21024 btrfs_inode_ref_name_len 0 21024 NULL
++arch_gnttab_init_21030 arch_gnttab_init 1 21030 NULL
+rx_defrag_tkip_called_read_21031 rx_defrag_tkip_called_read 3 21031 NULL
+srp_change_queue_depth_21038 srp_change_queue_depth 2 21038 NULL
+fsl_edma_prep_dma_cyclic_21042 fsl_edma_prep_dma_cyclic 4-3 21042 NULL
+lbs_threshold_read_21046 lbs_threshold_read 5 21046 NULL
+proc_fault_inject_write_21058 proc_fault_inject_write 3 21058 NULL
++qdisc_get_default_21072 qdisc_get_default 2 21072 NULL
+event_calibration_read_21083 event_calibration_read 3 21083 NULL
+bl_add_page_to_bio_21094 bl_add_page_to_bio 2 21094 NULL nohasharray
+multipath_status_21094 multipath_status 5 21094 &bl_add_page_to_bio_21094
+get_zeroed_page_21322 get_zeroed_page 0 21322 NULL
+ftrace_profile_read_21327 ftrace_profile_read 3 21327 NULL
+read_file_bool_bmps_21344 read_file_bool_bmps 3 21344 NULL
++azx_get_delay_from_lpib_21348 azx_get_delay_from_lpib 3 21348 NULL
+gfs2_ea_get_copy_21353 gfs2_ea_get_copy 0 21353 NULL
+allocate_cmdlines_buffer_21355 allocate_cmdlines_buffer 1 21355 NULL
+alloc_orinocodev_21371 alloc_orinocodev 1 21371 NULL
+diva_get_driver_dbg_mask_21399 diva_get_driver_dbg_mask 0 21399 NULL
+snd_m3_inw_21406 snd_m3_inw 0 21406 NULL
+usnic_ib_dump_vf_hdr_21423 usnic_ib_dump_vf_hdr 3 21423 NULL
++snapshot_read_next_21426 snapshot_read_next 0 21426 NULL
+tcp_bound_to_half_wnd_21429 tcp_bound_to_half_wnd 0-2 21429 NULL
+aggr_size_tx_agg_vs_rate_read_21438 aggr_size_tx_agg_vs_rate_read 3 21438 NULL
++nouveau_clock_create__21449 nouveau_clock_create_ 8 21449 NULL
+__ertm_hdr_size_21450 __ertm_hdr_size 0 21450 NULL
+mei_nfc_send_21477 mei_nfc_send 3 21477 NULL
+read_file_xmit_21487 read_file_xmit 3 21487 NULL
+twl_i2c_write_u16_21953 twl_i2c_write_u16 3 21953 NULL
+__build_xattrs_21979 __build_xattrs 0 21979 NULL
+SYSC_prctl_21980 SYSC_prctl 4 21980 NULL
-+compat_rw_copy_check_uvector_22001 compat_rw_copy_check_uvector 3-0 22001 NULL nohasharray
++compat_rw_copy_check_uvector_22001 compat_rw_copy_check_uvector 0-3 22001 NULL nohasharray
+rxpipe_descr_host_int_trig_rx_data_read_22001 rxpipe_descr_host_int_trig_rx_data_read 3 22001 &compat_rw_copy_check_uvector_22001
+regcache_sync_block_raw_flush_22021 regcache_sync_block_raw_flush 3-4 22021 NULL
+btrfs_get_16_22023 btrfs_get_16 0 22023 NULL
+snd_hda_codec_read_22130 snd_hda_codec_read 0 22130 NULL
+SyS_sched_setaffinity_22148 SyS_sched_setaffinity 2 22148 NULL
+do_tcp_sendpages_22155 do_tcp_sendpages 4 22155 NULL
++nve0_aux_mask_22158 nve0_aux_mask 2 22158 NULL
+__kfifo_alloc_22173 __kfifo_alloc 3 22173 NULL
+rfcomm_sock_recvmsg_22227 rfcomm_sock_recvmsg 4 22227 NULL
+mem_write_22232 mem_write 3 22232 NULL
+pci_vpd_srdt_size_22300 pci_vpd_srdt_size 0 22300 &__tun_chr_ioctl_22300
+mesh_table_alloc_22305 mesh_table_alloc 1 22305 NULL
+lov_setstripe_22307 lov_setstripe 2 22307 NULL
++udpv6_sendmsg_22316 udpv6_sendmsg 4 22316 NULL
+atomic_read_22342 atomic_read 0 22342 NULL
+ll_lazystatfs_seq_write_22353 ll_lazystatfs_seq_write 3 22353 NULL
+snd_pcm_alsa_frames_22363 snd_pcm_alsa_frames 2 22363 NULL
+ecryptfs_write_22488 ecryptfs_write 4-3 22488 NULL
+qib_user_sdma_alloc_header_22490 qib_user_sdma_alloc_header 2 22490 NULL
+cache_write_procfs_22491 cache_write_procfs 3 22491 NULL
++mutex_lock_interruptible_22505 mutex_lock_interruptible 0 22505 NULL
+trim_no_bitmap_22524 trim_no_bitmap 4-3 22524 NULL
+ocfs2_read_extent_block_22550 ocfs2_read_extent_block 0 22550 NULL
+agp_alloc_page_array_22554 agp_alloc_page_array 1 22554 NULL
+dbFindCtl_22587 dbFindCtl 0 22587 NULL
++cfs_expr_list_values_22600 cfs_expr_list_values 0 22600 NULL
++snapshot_read_22601 snapshot_read 3 22601 NULL
+sctp_setsockopt_connectx_old_22631 sctp_setsockopt_connectx_old 3 22631 NULL
+ide_core_cp_entry_22636 ide_core_cp_entry 3 22636 NULL
+wl1271_rx_filter_get_fields_size_22638 wl1271_rx_filter_get_fields_size 0 22638 NULL
+pwr_wake_on_timer_exp_read_22640 pwr_wake_on_timer_exp_read 3 22640 NULL
+iwl_dbgfs_calib_disabled_read_22649 iwl_dbgfs_calib_disabled_read 3 22649 NULL
-+l2tp_ip_recvmsg_22681 l2tp_ip_recvmsg 4 22681 NULL nohasharray
-+fill_gap_22681 fill_gap 0 22681 &l2tp_ip_recvmsg_22681
++l2tp_ip_recvmsg_22681 l2tp_ip_recvmsg 4 22681 NULL
+bch_dump_read_22685 bch_dump_read 3 22685 NULL
+reg_umr_22686 reg_umr 5 22686 NULL
+SYSC_vmsplice_22697 SYSC_vmsplice 3 22697 NULL
+vmw_execbuf_process_22885 vmw_execbuf_process 5 22885 NULL
+usblp_new_writeurb_22894 usblp_new_writeurb 2 22894 NULL
+mdc800_device_read_22896 mdc800_device_read 3 22896 NULL
-+policy_emit_config_values_22900 policy_emit_config_values 3 22900 NULL nohasharray
-+ion_handle_test_kernel_22900 ion_handle_test_kernel 4-3 22900 &policy_emit_config_values_22900
++ion_handle_test_kernel_22900 ion_handle_test_kernel 4-3 22900 NULL nohasharray
++policy_emit_config_values_22900 policy_emit_config_values 3 22900 &ion_handle_test_kernel_22900
++nfs4_acl_bytes_22915 nfs4_acl_bytes 0-1 22915 NULL
+__set_xattr_22923 __set_xattr 0 22923 NULL
+xstateregs_set_22932 xstateregs_set 4 22932 NULL
+pcpu_mem_zalloc_22948 pcpu_mem_zalloc 1 22948 NULL
+cifs_local_to_utf16_bytes_23025 cifs_local_to_utf16_bytes 0 23025 NULL
+st_status_23032 st_status 5 23032 NULL
+nv50_disp_chan_create__23056 nv50_disp_chan_create_ 5 23056 NULL
-+unix_seqpacket_recvmsg_23062 unix_seqpacket_recvmsg 4 23062 NULL nohasharray
-+reiserfs_add_entry_23062 reiserfs_add_entry 4 23062 &unix_seqpacket_recvmsg_23062
++reiserfs_add_entry_23062 reiserfs_add_entry 4 23062 NULL nohasharray
++unix_seqpacket_recvmsg_23062 unix_seqpacket_recvmsg 4 23062 &reiserfs_add_entry_23062
+mei_cl_send_23068 mei_cl_send 3 23068 NULL
++kvm_mmu_gva_to_gpa_write_23075 kvm_mmu_gva_to_gpa_write 0 23075 NULL
+raw_sendmsg_23078 raw_sendmsg 4 23078 NULL
+get_user_hdr_len_23079 get_user_hdr_len 0 23079 NULL
+isr_tx_procs_read_23084 isr_tx_procs_read 3 23084 NULL
+usblp_write_23178 usblp_write 3 23178 NULL
+gss_pipe_downcall_23182 gss_pipe_downcall 3 23182 NULL
+mpi_alloc_limb_space_23190 mpi_alloc_limb_space 1 23190 NULL
++tipc_sendmcast_23214 tipc_sendmcast 4 23214 NULL
+nft_hash_tbl_alloc_23224 nft_hash_tbl_alloc 1 23224 NULL
+tty_buffer_request_room_23228 tty_buffer_request_room 2-0 23228 NULL
-+xlog_get_bp_23229 xlog_get_bp 2 23229 NULL
++xlog_get_bp_23229 xlog_get_bp 2 23229 NULL nohasharray
++__read_status_pci_23229 __read_status_pci 0 23229 &xlog_get_bp_23229
+ft1000_read_dpram_mag_32_23232 ft1000_read_dpram_mag_32 0 23232 NULL
+rxrpc_client_sendmsg_23236 rxrpc_client_sendmsg 5 23236 NULL
+__gfn_to_rmap_23240 __gfn_to_rmap 1-2 23240 NULL
+hash_ipmark6_expire_23518 hash_ipmark6_expire 4 23518 NULL
+ima_show_measurements_count_23536 ima_show_measurements_count 3 23536 NULL
+tcp_current_mss_23552 tcp_current_mss 0 23552 NULL
-+dbg_leb_change_23555 dbg_leb_change 0 23555 NULL
+btrfs_super_bytenr_23561 btrfs_super_bytenr 0 23561 NULL
+venus_symlink_23570 venus_symlink 6-4 23570 NULL
+iwl_dbgfs_interrupt_read_23574 iwl_dbgfs_interrupt_read 3 23574 NULL
+get_conn_info_23723 get_conn_info 4 23723 NULL
+rx_rx_dropped_frame_read_23748 rx_rx_dropped_frame_read 3 23748 NULL
+__kfifo_max_r_23768 __kfifo_max_r 0-2-1 23768 NULL
-+__build_packet_message_23778 __build_packet_message 10-4 23778 NULL
++__build_packet_message_23778 __build_packet_message 4-10 23778 NULL
+security_inode_getxattr_23781 security_inode_getxattr 0 23781 NULL
+cfg80211_inform_bss_width_frame_23782 cfg80211_inform_bss_width_frame 5 23782 NULL
+mpt_free_res_23793 mpt_free_res 5 23793 NULL
+adu_read_24177 adu_read 3 24177 NULL
+safe_prepare_write_buffer_24187 safe_prepare_write_buffer 3 24187 NULL
+ieee80211_if_read_dot11MeshHWMPpreqMinInterval_24208 ieee80211_if_read_dot11MeshHWMPpreqMinInterval 3 24208 NULL
-+tcpprobe_sprint_24222 tcpprobe_sprint 2-0 24222 NULL
++tcpprobe_sprint_24222 tcpprobe_sprint 0-2 24222 NULL
+pcpu_embed_first_chunk_24224 pcpu_embed_first_chunk 3-2-1 24224 NULL nohasharray
+mei_amthif_read_24224 mei_amthif_read 4 24224 &pcpu_embed_first_chunk_24224
+pci_num_vf_24235 pci_num_vf 0 24235 NULL
+codec_list_read_file_24910 codec_list_read_file 3 24910 NULL
+xpcs_reg_value_write_24922 xpcs_reg_value_write 3 24922 NULL
+v4l2_ctrl_new_24927 v4l2_ctrl_new 7 24927 NULL
-+ocfs2_fiemap_24949 ocfs2_fiemap 3-4 24949 NULL
++ocfs2_fiemap_24949 ocfs2_fiemap 4-3 24949 NULL
+packet_sendmsg_24954 packet_sendmsg 4 24954 NULL
+twl_i2c_write_u8_24976 twl_i2c_write_u8 3 24976 NULL
+llc_ui_sendmsg_24987 llc_ui_sendmsg 4 24987 NULL
++info_debugfs_read_helper_24988 info_debugfs_read_helper 0 24988 NULL
+key_conf_hw_key_idx_read_25003 key_conf_hw_key_idx_read 3 25003 NULL
+il_dbgfs_channels_read_25005 il_dbgfs_channels_read 3 25005 NULL
+ni_660x_num_counters_25031 ni_660x_num_counters 0 25031 NULL
+nfs_dns_resolve_name_25036 nfs_dns_resolve_name 3 25036 NULL
++load_unaligned_zeropad_25050 load_unaligned_zeropad 0 25050 NULL
+btrfs_stack_key_blockptr_25058 btrfs_stack_key_blockptr 0 25058 NULL
+gs_buf_alloc_25067 gs_buf_alloc 2 25067 NULL
+ll_track_pid_seq_write_25068 ll_track_pid_seq_write 3 25068 NULL
+l2tp_session_create_25286 l2tp_session_create 1 25286 NULL
+ath9k_debugfs_read_buf_25316 ath9k_debugfs_read_buf 3 25316 NULL
+rng_buffer_size_25348 rng_buffer_size 0 25348 NULL
++SYSC_kexec_load_25361 SYSC_kexec_load 2 25361 NULL
+unix_mkname_25368 unix_mkname 0-2 25368 NULL
+sel_read_mls_25369 sel_read_mls 3 25369 NULL
+vsp1_entity_init_25407 vsp1_entity_init 3 25407 NULL
+mcp795_rtcc_read_25415 mcp795_rtcc_read 4 25415 NULL
+dai_list_read_file_25421 dai_list_read_file 3 25421 NULL
++ipath_decode_err_25468 ipath_decode_err 3 25468 NULL
+crypto_hash_digestsize_25469 crypto_hash_digestsize 0 25469 NULL
+ivtv_buf_copy_from_user_25502 ivtv_buf_copy_from_user 4-0 25502 NULL
+snd_pcm_plugin_build_25505 snd_pcm_plugin_build 5 25505 NULL
+ext3_get_inode_loc_25542 ext3_get_inode_loc 0 25542 NULL
+ieee80211_if_read_path_refresh_time_25545 ieee80211_if_read_path_refresh_time 3 25545 NULL
+wimax_addr_scnprint_25548 wimax_addr_scnprint 2 25548 NULL
-+ht_print_chan_25556 ht_print_chan 3-4-0 25556 NULL
++ht_print_chan_25556 ht_print_chan 0-3-4 25556 NULL
+skb_tailroom_25567 skb_tailroom 0 25567 NULL
+ping_recvmsg_25597 ping_recvmsg 4 25597 NULL
+copy_user_generic_25611 copy_user_generic 0 25611 NULL
+keyctl_update_key_26061 keyctl_update_key 3 26061 NULL
+pri_wm_latency_write_26063 pri_wm_latency_write 3 26063 NULL
+rx_rx_wa_density_dropped_frame_read_26095 rx_rx_wa_density_dropped_frame_read 3 26095 NULL
++i8042_pnp_id_to_string_26108 i8042_pnp_id_to_string 3 26108 NULL
+read_sb_page_26119 read_sb_page 5 26119 NULL
+ath9k_hw_name_26146 ath9k_hw_name 3 26146 NULL
+copy_oldmem_page_26164 copy_oldmem_page 3 26164 NULL
+invalidate_inode_pages2_range_26403 invalidate_inode_pages2_range 0 26403 NULL
+ntty_write_26404 ntty_write 3 26404 NULL
+firmware_store_26408 firmware_store 4 26408 NULL
++pagemap_read_26441 pagemap_read 3 26441 NULL
+tower_read_26461 tower_read 3 26461 NULL nohasharray
+enc_pools_add_pages_26461 enc_pools_add_pages 1 26461 &tower_read_26461
+ib_alloc_device_26483 ib_alloc_device 1 26483 NULL
+ulong_write_file_26485 ulong_write_file 3 26485 NULL
+dvb_ca_en50221_io_ioctl_26490 dvb_ca_en50221_io_ioctl 2 26490 NULL
++read_vmcore_26501 read_vmcore 3 26501 NULL
+uhid_char_write_26502 uhid_char_write 3 26502 NULL
+vfio_pci_set_msi_trigger_26507 vfio_pci_set_msi_trigger 4-3 26507 NULL
+iwl_dbgfs_rf_reset_read_26512 iwl_dbgfs_rf_reset_read 3 26512 NULL
+__vhost_add_used_n_26554 __vhost_add_used_n 3 26554 NULL
+dio_new_bio_26562 dio_new_bio 0 26562 NULL
+rts51x_read_mem_26577 rts51x_read_mem 4 26577 NULL
++kernfs_name_locked_26617 kernfs_name_locked 3 26617 NULL
+pwr_fix_tsf_ps_read_26627 pwr_fix_tsf_ps_read 3 26627 NULL
+amdtp_stream_get_max_payload_26645 amdtp_stream_get_max_payload 0 26645 NULL
+irq_alloc_generic_chip_26650 irq_alloc_generic_chip 2 26650 NULL
+nouveau_volt_create__26654 nouveau_volt_create_ 4 26654 NULL
+cipso_v4_map_cat_rbm_hton_26680 cipso_v4_map_cat_rbm_hton 0 26680 NULL
+flowinfo_read_26683 flowinfo_read 3 26683 NULL
++sysfs_add_file_26716 sysfs_add_file 0 26716 NULL
+nouveau_namedb_create__26732 nouveau_namedb_create_ 7 26732 NULL
+pipeline_tcp_rx_stat_fifo_int_read_26745 pipeline_tcp_rx_stat_fifo_int_read 3 26745 NULL
++bos_desc_26752 bos_desc 0 26752 NULL
+snd_hda_get_raw_connections_26762 snd_hda_get_raw_connections 0 26762 NULL
+dma_map_single_attrs_26779 dma_map_single_attrs 0 26779 NULL
+qlcnic_alloc_sds_rings_26795 qlcnic_alloc_sds_rings 2 26795 NULL
+hhf_zalloc_26912 hhf_zalloc 1 26912 NULL
+cfg80211_process_auth_26916 cfg80211_process_auth 3 26916 NULL
+x25_asy_change_mtu_26928 x25_asy_change_mtu 2 26928 NULL
++brcmf_usb_dl_cmd_26931 brcmf_usb_dl_cmd 4 26931 NULL
+scsi_tgt_copy_sense_26933 scsi_tgt_copy_sense 3 26933 NULL
+sctp_setsockopt_adaptation_layer_26935 sctp_setsockopt_adaptation_layer 3 26935 NULL nohasharray
+pwr_ps_enter_read_26935 pwr_ps_enter_read 3 26935 &sctp_setsockopt_adaptation_layer_26935
+do_trimming_26952 do_trimming 3 26952 NULL nohasharray
+extract_entropy_user_26952 extract_entropy_user 3 26952 &do_trimming_26952
+do_direct_IO_26979 do_direct_IO 0 26979 NULL
++lustre_msg_size_26995 lustre_msg_size 2 26995 NULL
+sc16is7xx_port_read_27051 sc16is7xx_port_read 0 27051 NULL
+__videobuf_alloc_vb_27062 __videobuf_alloc_vb 1 27062 NULL
+ext4_convert_unwritten_extents_27064 ext4_convert_unwritten_extents 4-3 27064 NULL
+drbd_get_capacity_27141 drbd_get_capacity 0 27141 NULL
+pms_capture_27142 pms_capture 4 27142 NULL
+btmrvl_hscfgcmd_write_27143 btmrvl_hscfgcmd_write 3 27143 NULL
++wil_write_file_wmi_27150 wil_write_file_wmi 3 27150 NULL
+snd_compr_calc_avail_27165 snd_compr_calc_avail 0 27165 NULL
+ieee80211_if_read_rc_rateidx_mask_5ghz_27183 ieee80211_if_read_rc_rateidx_mask_5ghz 3 27183 NULL
++write_kmem_27225 write_kmem 3 27225 NULL nohasharray
++svcxdr_tmpalloc_27225 svcxdr_tmpalloc 2 27225 &write_kmem_27225
+dbAllocAG_27228 dbAllocAG 0 27228 NULL
+rxrpc_request_key_27235 rxrpc_request_key 3 27235 NULL
+ll_track_gid_seq_write_27267 ll_track_gid_seq_write 3 27267 NULL
+sco_sock_recvmsg_27572 sco_sock_recvmsg 4 27572 NULL
+libipw_alloc_txb_27579 libipw_alloc_txb 1 27579 NULL
+C_SYSC_mbind_27636 C_SYSC_mbind 5 27636 NULL
-+read_flush_procfs_27642 read_flush_procfs 3 27642 NULL nohasharray
-+nl80211_send_connect_result_27642 nl80211_send_connect_result 5-7 27642 &read_flush_procfs_27642 nohasharray
-+ocfs2_xattr_ibody_get_27642 ocfs2_xattr_ibody_get 0 27642 &nl80211_send_connect_result_27642
++ocfs2_xattr_ibody_get_27642 ocfs2_xattr_ibody_get 0 27642 NULL nohasharray
++read_flush_procfs_27642 read_flush_procfs 3 27642 &ocfs2_xattr_ibody_get_27642 nohasharray
++nl80211_send_connect_result_27642 nl80211_send_connect_result 5-7 27642 &read_flush_procfs_27642
+add_new_gdb_27643 add_new_gdb 3 27643 NULL
+btrfs_fallocate_27647 btrfs_fallocate 3-4 27647 NULL
+qnx6_readpages_27657 qnx6_readpages 4 27657 NULL
+evm_write_key_27715 evm_write_key 3 27715 NULL
+ieee80211_if_fmt_dot11MeshGateAnnouncementProtocol_27722 ieee80211_if_fmt_dot11MeshGateAnnouncementProtocol 3 27722 NULL
+xfs_dir2_block_sfsize_27727 xfs_dir2_block_sfsize 0 27727 NULL
++load_scode_27738 load_scode 2 27738 NULL
+SyS_setsockopt_27759 SyS_setsockopt 5 27759 NULL
+transport_init_session_tags_27776 transport_init_session_tags 1-2 27776 NULL
+__lov_setstripe_27782 __lov_setstripe 2 27782 NULL
+SyS_readv_27804 SyS_readv 3 27804 NULL
+mpihelp_mul_27805 mpihelp_mul 5-3 27805 NULL
+hpt374_read_freq_27828 hpt374_read_freq 0 27828 NULL
++init_header_complete_27833 init_header_complete 0 27833 NULL
+read_profile_27859 read_profile 3 27859 NULL
+sky2_pci_read16_27863 sky2_pci_read16 0 27863 NULL
+ieee80211_if_read_dot11MeshHWMProotInterval_27873 ieee80211_if_read_dot11MeshHWMProotInterval 3 27873 NULL
+unix_seqpacket_sendmsg_27893 unix_seqpacket_sendmsg 4 27893 NULL
+i915_error_object_create_sized_27919 i915_error_object_create_sized 4 27919 NULL
-+tracing_clock_write_27961 tracing_clock_write 3 27961 NULL nohasharray
-+bio_next_split_27961 bio_next_split 2 27961 &tracing_clock_write_27961
++check_mapped_name_27943 check_mapped_name 3 27943 NULL
++bio_next_split_27961 bio_next_split 2 27961 NULL nohasharray
++tracing_clock_write_27961 tracing_clock_write 3 27961 &bio_next_split_27961
+tipc_media_addr_printf_27971 tipc_media_addr_printf 2 27971 NULL
-+mic_rx_pkts_read_27972 mic_rx_pkts_read 3 27972 NULL
++mic_rx_pkts_read_27972 mic_rx_pkts_read 3 27972 NULL nohasharray
++device_register_27972 device_register 0 27972 &mic_rx_pkts_read_27972
+compat_SyS_set_mempolicy_27975 compat_SyS_set_mempolicy 3 27975 NULL
++pci_enable_device_flags_27977 pci_enable_device_flags 0 27977 NULL
+edt_ft5x06_debugfs_raw_data_read_28002 edt_ft5x06_debugfs_raw_data_read 3 28002 NULL
+seq_get_buf_28006 seq_get_buf 0 28006 NULL
+snd_rawmidi_write_28008 snd_rawmidi_write 3 28008 NULL
+init_rs_non_canonical_28059 init_rs_non_canonical 1 28059 NULL
+lpfc_idiag_mbxacc_read_28061 lpfc_idiag_mbxacc_read 3 28061 NULL
+tx_frag_bad_mblk_num_read_28064 tx_frag_bad_mblk_num_read 3 28064 NULL
++acpi_gsb_i2c_write_bytes_28082 acpi_gsb_i2c_write_bytes 4 28082 NULL
+mmc_test_alloc_mem_28102 mmc_test_alloc_mem 3-2 28102 NULL
+rx_defrag_need_defrag_read_28117 rx_defrag_need_defrag_read 3 28117 NULL
+vgacon_adjust_height_28124 vgacon_adjust_height 2 28124 NULL
+video_read_28148 video_read 3 28148 NULL
+snd_midi_channel_alloc_set_28153 snd_midi_channel_alloc_set 1 28153 NULL
+stats_dot11FCSErrorCount_read_28154 stats_dot11FCSErrorCount_read 3 28154 NULL
++vread_28173 vread 0-3 28173 NULL
+macvtap_get_user_28185 macvtap_get_user 4 28185 NULL
+counter_free_res_28187 counter_free_res 5 28187 NULL
+read_disk_sb_28188 read_disk_sb 2 28188 NULL
+xpcs_mmd_read_28331 xpcs_mmd_read 3 28331 NULL
+bm_entry_write_28338 bm_entry_write 3 28338 NULL
+tcp_copy_to_iovec_28344 tcp_copy_to_iovec 3 28344 NULL
++snapshot_write_28351 snapshot_write 3 28351 NULL
+xfs_iomap_write_unwritten_28365 xfs_iomap_write_unwritten 3-2 28365 NULL
+batadv_handle_tt_response_28370 batadv_handle_tt_response 4 28370 NULL
+dlmfs_file_read_28385 dlmfs_file_read 3 28385 NULL
+tx_frag_cache_miss_read_28394 tx_frag_cache_miss_read 3 28394 NULL
+bypass_pwup_write_28416 bypass_pwup_write 3 28416 NULL
+subdev_ioctl_28417 subdev_ioctl 2 28417 NULL
++__videobuf_mmap_setup_28421 __videobuf_mmap_setup 0 28421 NULL
+ksocknal_alloc_tx_28426 ksocknal_alloc_tx 2 28426 NULL
+mpage_readpages_28436 mpage_readpages 3 28436 NULL
+snd_emu10k1_efx_read_28452 snd_emu10k1_efx_read 2 28452 NULL
+i2400m_tx_stats_read_28527 i2400m_tx_stats_read 3 28527 &sh_irda_init_iobuf_28527
+early_init_dt_alloc_memory_arch_28528 early_init_dt_alloc_memory_arch 1 28528 NULL
+sel_read_policycap_28544 sel_read_policycap 3 28544 NULL
-+mptctl_getiocinfo_28545 mptctl_getiocinfo 2 28545 NULL nohasharray
-+run_delalloc_range_28545 run_delalloc_range 3-4 28545 &mptctl_getiocinfo_28545 nohasharray
-+aio_read_events_28545 aio_read_events 3 28545 &run_delalloc_range_28545
++run_delalloc_range_28545 run_delalloc_range 3-4 28545 NULL nohasharray
++aio_read_events_28545 aio_read_events 3 28545 &run_delalloc_range_28545 nohasharray
++mptctl_getiocinfo_28545 mptctl_getiocinfo 2 28545 &aio_read_events_28545
+b43legacy_debugfs_write_28556 b43legacy_debugfs_write 3 28556 NULL
+asymmetric_verify_28567 asymmetric_verify 3 28567 NULL
+oxygen_read32_28582 oxygen_read32 0 28582 NULL
++task_cgroup_path_28599 task_cgroup_path 3 28599 NULL
+extract_entropy_28604 extract_entropy 5-3 28604 NULL
+xgbe_common_write_28609 xgbe_common_write 2 28609 NULL
+kfifo_unused_28612 kfifo_unused 0 28612 NULL
-+snd_nm256_capture_copy_28622 snd_nm256_capture_copy 3-5 28622 NULL
++snd_nm256_capture_copy_28622 snd_nm256_capture_copy 5-3 28622 NULL
+setup_usemap_28636 setup_usemap 3-4 28636 NULL
++qib_handle_6120_hwerrors_28642 qib_handle_6120_hwerrors 3 28642 NULL
+p9_fcall_alloc_28652 p9_fcall_alloc 1 28652 NULL
+blk_queue_resize_tags_28670 blk_queue_resize_tags 2 28670 NULL
+SyS_setgroups16_28686 SyS_setgroups16 1 28686 NULL
+snd_pcm_aio_write_28738 snd_pcm_aio_write 3 28738 NULL
+read_file_btcoex_28743 read_file_btcoex 3 28743 NULL
+max_hw_blocks_28748 max_hw_blocks 0 28748 NULL
++nv50_dmac_create_28762 nv50_dmac_create 5 28762 NULL
+rpc_pipe_generic_upcall_28766 rpc_pipe_generic_upcall 4 28766 NULL
+ath6kl_get_num_reg_28780 ath6kl_get_num_reg 0 28780 NULL
+sel_write_member_28800 sel_write_member 3 28800 NULL
+iwl_dbgfs_rxon_filter_flags_read_28832 iwl_dbgfs_rxon_filter_flags_read 3 28832 NULL
+kernel_tree_alloc_28833 kernel_tree_alloc 1 28833 NULL
++parser_init_byteStream_28841 parser_init_byteStream 2 28841 NULL
+vp_request_msix_vectors_28849 vp_request_msix_vectors 2 28849 NULL
+ipv6_renew_options_28867 ipv6_renew_options 5 28867 NULL
+packet_sendmsg_spkt_28885 packet_sendmsg_spkt 4 28885 NULL
+iwl_dbgfs_temperature_read_29224 iwl_dbgfs_temperature_read 3 29224 NULL
+nvme_trans_copy_from_user_29227 nvme_trans_copy_from_user 3 29227 NULL
+irq_domain_add_linear_29236 irq_domain_add_linear 2 29236 NULL
-+recover_peb_29238 recover_peb 0 29238 NULL
+evdev_handle_get_val_29242 evdev_handle_get_val 5-6 29242 NULL
+security_context_to_sid_core_29248 security_context_to_sid_core 2 29248 NULL
+rbd_osd_req_create_29260 rbd_osd_req_create 3 29260 NULL
++mwifiex_hscfg_write_29262 mwifiex_hscfg_write 3 29262 NULL
+prism2_set_genericelement_29277 prism2_set_genericelement 3 29277 NULL
+ext4_fiemap_29296 ext4_fiemap 4 29296 NULL
+sn9c102_read_29305 sn9c102_read 3 29305 NULL
+usnic_vnic_spec_dump_29508 usnic_vnic_spec_dump 2 29508 NULL
+write_file_regidx_29517 write_file_regidx 3 29517 NULL
+atk_debugfs_ggrp_read_29522 atk_debugfs_ggrp_read 3 29522 NULL
++mic_vringh_copy_29531 mic_vringh_copy 4 29531 NULL
+ftrace_write_29551 ftrace_write 3 29551 NULL
+idetape_queue_rw_tail_29562 idetape_queue_rw_tail 3 29562 NULL
+leaf_dealloc_29566 leaf_dealloc 3 29566 NULL
+dio_set_defer_completion_29599 dio_set_defer_completion 0 29599 NULL
+slots_per_page_29601 slots_per_page 0 29601 NULL
+osc_cached_mb_seq_write_29610 osc_cached_mb_seq_write 3 29610 NULL
++lstcon_rpc_init_29623 lstcon_rpc_init 4 29623 NULL
+nla_get_u16_29624 nla_get_u16 0 29624 NULL
+tx_frag_cache_hit_read_29639 tx_frag_cache_hit_read 3 29639 NULL
+sctp_make_abort_user_29654 sctp_make_abort_user 3 29654 NULL nohasharray
+tcp_sendpage_29829 tcp_sendpage 4 29829 NULL
+__probe_kernel_write_29842 __probe_kernel_write 3 29842 NULL
+kvm_read_hva_atomic_29848 kvm_read_hva_atomic 3 29848 NULL
++count_partial_29850 count_partial 0 29850 NULL
+write_file_bool_bmps_29870 write_file_bool_bmps 3 29870 NULL
+ipv6_setsockopt_29871 ipv6_setsockopt 5 29871 NULL
+crypto_aead_alignmask_29885 crypto_aead_alignmask 0 29885 NULL
+ipv6_recv_error_29947 ipv6_recv_error 3 29947 &__btrfs_getxattr_29947
+dev_mem_write_30028 dev_mem_write 3 30028 NULL
+alloc_netdev_mqs_30030 alloc_netdev_mqs 1 30030 NULL
++sysfs_add_file_mode_ns_30038 sysfs_add_file_mode_ns 0 30038 NULL
+scsi_vpd_inquiry_30040 scsi_vpd_inquiry 0-4 30040 NULL
+drp_wmove_30043 drp_wmove 4 30043 NULL
+cxgbi_ddp_reserve_30091 cxgbi_ddp_reserve 4 30091 NULL
+spi_async_locked_30117 spi_async_locked 0 30117 NULL
+u_memcpya_30139 u_memcpya 3-2 30139 NULL
+dbg_port_buf_30145 dbg_port_buf 2 30145 NULL
++elfcorehdr_read_30159 elfcorehdr_read 2 30159 NULL
+alloc_switch_ctx_30165 alloc_switch_ctx 2 30165 NULL
+expand_inode_data_30169 expand_inode_data 3-2 30169 NULL
+mempool_create_page_pool_30189 mempool_create_page_pool 1 30189 NULL
+drm_property_create_bitmask_30195 drm_property_create_bitmask 5 30195 NULL
+__genwqe_readq_30197 __genwqe_readq 0 30197 NULL
+usblp_ioctl_30203 usblp_ioctl 2 30203 NULL
++SyS_semop_30227 SyS_semop 3 30227 NULL
+bitmap_file_set_bit_30228 bitmap_file_set_bit 2 30228 NULL
+rawv6_recvmsg_30265 rawv6_recvmsg 4 30265 NULL
+isr_pci_pm_read_30271 isr_pci_pm_read 3 30271 NULL
+batadv_send_tt_request_30493 batadv_send_tt_request 5 30493 NULL
+memblock_virt_alloc_node_30515 memblock_virt_alloc_node 1 30515 NULL
+dwc3_testmode_write_30516 dwc3_testmode_write 3 30516 NULL
-+debug_debug2_read_30526 debug_debug2_read 3 30526 NULL
++debug_debug2_read_30526 debug_debug2_read 3 30526 NULL nohasharray
++set_config_30526 set_config 0 30526 &debug_debug2_read_30526
++xfs_sb_version_hasftype_30559 xfs_sb_version_hasftype 0 30559 NULL
+disk_expand_part_tbl_30561 disk_expand_part_tbl 2 30561 NULL
+set_le_30581 set_le 4 30581 NULL
+blk_init_tags_30592 blk_init_tags 1 30592 NULL
+dccp_setsockopt_ccid_30701 dccp_setsockopt_ccid 4 30701 NULL
+lbs_wrbbp_write_30712 lbs_wrbbp_write 3 30712 NULL
+lbs_debugfs_read_30721 lbs_debugfs_read 3 30721 NULL
-+snd_nm256_playback_silence_30727 snd_nm256_playback_silence 3-4 30727 NULL
++snd_nm256_playback_silence_30727 snd_nm256_playback_silence 4-3 30727 NULL
+snapshot_status_30744 snapshot_status 5 30744 NULL
+fuse_direct_IO_30753 fuse_direct_IO 4 30753 NULL
+fuse_conn_limit_write_30777 fuse_conn_limit_write 3 30777 NULL
+proc_gid_map_write_31093 proc_gid_map_write 3 31093 NULL
+depth_read_31112 depth_read 3 31112 NULL
+hash_ipportnet6_expire_31118 hash_ipportnet6_expire 4 31118 NULL
++kimage_normal_alloc_31140 kimage_normal_alloc 3 31140 NULL
+size_inside_page_31141 size_inside_page 0 31141 NULL
+w9966_v4l_read_31148 w9966_v4l_read 3 31148 NULL
+ch_do_scsi_31171 ch_do_scsi 4 31171 NULL
+uvc_simplify_fraction_31303 uvc_simplify_fraction 3 31303 NULL
+sisusbcon_scroll_31315 sisusbcon_scroll 5-2-3 31315 NULL
+command_file_write_31318 command_file_write 3 31318 NULL
++hwerr_crcbits_31334 hwerr_crcbits 4 31334 NULL
+_regmap_raw_multi_reg_write_31336 _regmap_raw_multi_reg_write 3 31336 NULL
+em28xx_init_usb_xfer_31337 em28xx_init_usb_xfer 4-6 31337 NULL
+outlen_write_31358 outlen_write 3 31358 NULL
+vb2_vmalloc_get_userptr_31374 vb2_vmalloc_get_userptr 3-2 31374 NULL
+trace_parser_get_init_31379 trace_parser_get_init 2 31379 NULL
+inb_31388 inb 0 31388 NULL
++mp_ioapic_pin_count_31393 mp_ioapic_pin_count 0 31393 NULL
+key_ifindex_read_31411 key_ifindex_read 3 31411 NULL
+_sp2d_max_pg_31422 _sp2d_max_pg 0 31422 NULL
+TSS_checkhmac1_31429 TSS_checkhmac1 5 31429 NULL
+forced_ps_read_31685 forced_ps_read 3 31685 NULL
+fst_recover_rx_error_31687 fst_recover_rx_error 3 31687 NULL
+rs_pretty_print_rate_31727 rs_pretty_print_rate 0 31727 NULL
-+utf16s_to_utf8s_31735 utf16s_to_utf8s 0 31735 NULL nohasharray
-+lu_buf_check_and_grow_31735 lu_buf_check_and_grow 2 31735 &utf16s_to_utf8s_31735
++lu_buf_check_and_grow_31735 lu_buf_check_and_grow 2 31735 NULL nohasharray
++utf16s_to_utf8s_31735 utf16s_to_utf8s 0 31735 &lu_buf_check_and_grow_31735
+shmem_pwrite_slow_31741 shmem_pwrite_slow 3-2 31741 NULL
+input_abs_get_max_31742 input_abs_get_max 0 31742 NULL nohasharray
+NCR_700_change_queue_depth_31742 NCR_700_change_queue_depth 2 31742 &input_abs_get_max_31742
+vx_read_status_31982 vx_read_status 0 31982 &iblock_execute_rw_31982
+find_next_zero_bit_31990 find_next_zero_bit 0 31990 NULL
+lustre_acl_xattr_merge2posix_31992 lustre_acl_xattr_merge2posix 2 31992 NULL
++sysfs_create_file_31996 sysfs_create_file 0 31996 NULL
+calc_hmac_32010 calc_hmac 3 32010 NULL
+aead_len_32021 aead_len 0 32021 NULL
+sci_dma_rx_push_32029 sci_dma_rx_push 2 32029 NULL
+SYSC_llistxattr_32061 SYSC_llistxattr 3 32061 NULL
+proc_scsi_devinfo_write_32064 proc_scsi_devinfo_write 3 32064 NULL
+cow_file_range_inline_32091 cow_file_range_inline 3 32091 NULL
++kiblnd_alloc_pages_32092 kiblnd_alloc_pages 3 32092 NULL
+bio_alloc_32095 bio_alloc 2 32095 NULL
+ath6kl_fwlog_read_32101 ath6kl_fwlog_read 3 32101 NULL
+disk_status_32120 disk_status 4 32120 NULL
++kobject_add_internal_32133 kobject_add_internal 0 32133 NULL
+venus_link_32165 venus_link 5 32165 NULL
+ocfs2_direct_IO_32168 ocfs2_direct_IO 4 32168 NULL
+do_writepages_32173 do_writepages 0 32173 NULL
+t4_alloc_mem_32342 t4_alloc_mem 1 32342 NULL
+dispatch_ioctl_32357 dispatch_ioctl 2 32357 NULL nohasharray
+rx_streaming_always_write_32357 rx_streaming_always_write 3 32357 &dispatch_ioctl_32357
-+sel_read_initcon_32362 sel_read_initcon 3 32362 NULL
++sel_read_initcon_32362 sel_read_initcon 3 32362 NULL nohasharray
++ReadHDLCPCI_32362 ReadHDLCPCI 0 32362 &sel_read_initcon_32362
+ll_setxattr_common_32398 ll_setxattr_common 4 32398 NULL
+xfs_iext_add_indirect_multi_32400 xfs_iext_add_indirect_multi 3 32400 NULL
+vmci_qp_alloc_32405 vmci_qp_alloc 5-3 32405 NULL
+cifs_writedata_alloc_32880 cifs_writedata_alloc 1 32880 NULL nohasharray
+ath6kl_usb_submit_ctrl_in_32880 ath6kl_usb_submit_ctrl_in 6 32880 &cifs_writedata_alloc_32880
+vp702x_usb_inout_cmd_32884 vp702x_usb_inout_cmd 4-6 32884 NULL
++visorchannel_dump_section_32893 visorchannel_dump_section 4 32893 NULL
+tipc_link_iovec_xmit_fast_32913 tipc_link_iovec_xmit_fast 3 32913 NULL nohasharray
+il_dbgfs_tx_stats_read_32913 il_dbgfs_tx_stats_read 3 32913 &tipc_link_iovec_xmit_fast_32913
+zlib_inflate_workspacesize_32927 zlib_inflate_workspacesize 0 32927 NULL
+rmap_recycle_32938 rmap_recycle 3 32938 NULL
++ptlrpc_prep_bulk_imp_32997 ptlrpc_prep_bulk_imp 2 32997 NULL
+compat_filldir_32999 compat_filldir 3 32999 NULL
+SyS_syslog_33007 SyS_syslog 3 33007 NULL
+br_multicast_set_hash_max_33012 br_multicast_set_hash_max 2 33012 NULL
+ieee80211_if_read_dropped_frames_no_route_33383 ieee80211_if_read_dropped_frames_no_route 3 33383 NULL
+scsi_varlen_cdb_length_33385 scsi_varlen_cdb_length 0 33385 NULL
+nvc0_ram_create__33391 nvc0_ram_create_ 5 33391 NULL
-+ocfs2_allocate_unwritten_extents_33394 ocfs2_allocate_unwritten_extents 2-3 33394 NULL
++ocfs2_allocate_unwritten_extents_33394 ocfs2_allocate_unwritten_extents 3-2 33394 NULL
+cfs_trace_copyin_string_33396 cfs_trace_copyin_string 4 33396 NULL
+snd_pcm_capture_ioctl1_33408 snd_pcm_capture_ioctl1 0 33408 NULL
+hash_netiface6_expire_33421 hash_netiface6_expire 4 33421 NULL
+pvr2_stream_buffer_count_33719 pvr2_stream_buffer_count 2 33719 NULL
+write_file_spectral_count_33723 write_file_spectral_count 3 33723 NULL
+read_file_node_recv_33729 read_file_node_recv 3 33729 NULL
++__mutex_lock_interruptible_slowpath_33735 __mutex_lock_interruptible_slowpath 0 33735 NULL
+vifs_state_read_33762 vifs_state_read 3 33762 NULL
+hashtab_create_33769 hashtab_create 3 33769 NULL
+__btrfs_free_reserved_extent_33782 __btrfs_free_reserved_extent 2 33782 NULL
+scrub_setup_recheck_block_33831 scrub_setup_recheck_block 5-4 33831 NULL
+ext4_journal_extend_33835 ext4_journal_extend 2 33835 NULL
+oz_cdev_write_33852 oz_cdev_write 3 33852 NULL
++azx_get_pos_posbuf_33867 azx_get_pos_posbuf 0 33867 NULL
+get_user_pages_33908 get_user_pages 0 33908 NULL
+sg_nents_33909 sg_nents 0 33909 NULL
+ath6kl_roam_mode_write_33912 ath6kl_roam_mode_write 3 33912 NULL
+lbs_lowrssi_write_34025 lbs_lowrssi_write 3 34025 NULL
+ppp_write_34034 ppp_write 3 34034 NULL
+tty_insert_flip_string_34042 tty_insert_flip_string 3-0 34042 NULL
++bm_page_io_async_34050 bm_page_io_async 2 34050 NULL
+calc_linear_pos_34067 calc_linear_pos 0-4 34067 NULL
+memcg_update_all_caches_34068 memcg_update_all_caches 1 34068 NULL
+pipeline_pipeline_fifo_full_read_34095 pipeline_pipeline_fifo_full_read 3 34095 NULL
+rsi_debug_zone_write_34206 rsi_debug_zone_write 3 34206 NULL
+ext4_da_write_begin_34215 ext4_da_write_begin 3-4 34215 NULL
+bl_pipe_downcall_34264 bl_pipe_downcall 3 34264 NULL
++device_private_init_34279 device_private_init 0 34279 NULL
+xgmac_reg_addr_write_34284 xgmac_reg_addr_write 3 34284 NULL
+ext4_get_groups_count_34324 ext4_get_groups_count 0 34324 NULL
+pcpu_need_to_extend_34326 pcpu_need_to_extend 0 34326 NULL nohasharray
+iov_iter_single_seg_count_34326 iov_iter_single_seg_count 0 34326 &pcpu_need_to_extend_34326
++proc_thread_self_readlink_34357 proc_thread_self_readlink 3 34357 NULL
+crypto_ablkcipher_ivsize_34363 crypto_ablkcipher_ivsize 0 34363 NULL nohasharray
+sync_page_io_34363 sync_page_io 3 34363 &crypto_ablkcipher_ivsize_34363
+rngapi_reset_34366 rngapi_reset 3 34366 NULL
-+_iwl_dbgfs_low_latency_write_34378 _iwl_dbgfs_low_latency_write 3 34378 NULL nohasharray
-+ea_read_34378 ea_read 0 34378 &_iwl_dbgfs_low_latency_write_34378
-+fuse_send_read_34379 fuse_send_read 4-0 34379 NULL
++ea_read_34378 ea_read 0 34378 NULL nohasharray
++_iwl_dbgfs_low_latency_write_34378 _iwl_dbgfs_low_latency_write 3 34378 &ea_read_34378
++fuse_send_read_34379 fuse_send_read 0-4 34379 NULL
+av7110_vbi_write_34384 av7110_vbi_write 3 34384 NULL
+usbvision_v4l2_read_34386 usbvision_v4l2_read 3 34386 NULL
+read_rbu_image_type_34387 read_rbu_image_type 6 34387 NULL
+SyS_pwritev_34494 SyS_pwritev 3 34494 NULL
+qp_alloc_res_34496 qp_alloc_res 5 34496 NULL
+lu_buf_check_and_alloc_34505 lu_buf_check_and_alloc 2 34505 NULL
-+tracing_stats_read_34537 tracing_stats_read 3 34537 NULL nohasharray
-+ext4_fallocate_34537 ext4_fallocate 4-3 34537 &tracing_stats_read_34537
++ext4_fallocate_34537 ext4_fallocate 4-3 34537 NULL nohasharray
++tracing_stats_read_34537 tracing_stats_read 3 34537 &ext4_fallocate_34537
+hugetlbfs_read_actor_34547 hugetlbfs_read_actor 2-5-4-0 34547 NULL
+dbBackSplit_34561 dbBackSplit 0 34561 NULL
-+alloc_ieee80211_rsl_34564 alloc_ieee80211_rsl 1 34564 NULL nohasharray
-+self_check_peb_ec_hdr_34564 self_check_peb_ec_hdr 0 34564 &alloc_ieee80211_rsl_34564
++alloc_ieee80211_rsl_34564 alloc_ieee80211_rsl 1 34564 NULL
+ext4_ind_direct_IO_34574 ext4_ind_direct_IO 4 34574 NULL
+lov_stripecount_seq_write_34582 lov_stripecount_seq_write 3 34582 NULL
+init_send_hfcd_34586 init_send_hfcd 1 34586 NULL
+ceph_msgpool_init_34599 ceph_msgpool_init 4 34599 NULL nohasharray
+cw1200_queue_init_34599 cw1200_queue_init 4 34599 &ceph_msgpool_init_34599
+bio_integrity_bytes_34602 bio_integrity_bytes 2 34602 NULL
-+__jffs2_ref_totlen_34609 __jffs2_ref_totlen 0 34609 NULL nohasharray
-+mtd_write_34609 mtd_write 0 34609 &__jffs2_ref_totlen_34609
++__jffs2_ref_totlen_34609 __jffs2_ref_totlen 0 34609 NULL
+__cfg80211_disconnected_34622 __cfg80211_disconnected 3 34622 NULL
+cnic_alloc_dma_34641 cnic_alloc_dma 3 34641 NULL
+kvm_set_spte_hva_34671 kvm_set_spte_hva 2 34671 NULL
+reg_w_ixbuf_34736 reg_w_ixbuf 4 34736 NULL
+lsm_alloc_plain_34755 lsm_alloc_plain 1 34755 NULL
+bootmode_store_34762 bootmode_store 4 34762 NULL
++device_add_34766 device_add 0 34766 NULL
+qib_cdev_init_34778 qib_cdev_init 1 34778 NULL
+ext3_direct_IO_34798 ext3_direct_IO 4 34798 NULL
+SYSC_keyctl_34800 SYSC_keyctl 4 34800 NULL
+msg_print_text_34889 msg_print_text 0 34889 NULL
+ieee80211_if_write_34894 ieee80211_if_write 3 34894 NULL
+si476x_radio_read_rsq_primary_blob_34916 si476x_radio_read_rsq_primary_blob 3 34916 NULL
-+__inode_permission_34925 __inode_permission 0 34925 NULL nohasharray
-+btrfs_super_chunk_root_34925 btrfs_super_chunk_root 0 34925 &__inode_permission_34925
++btrfs_super_chunk_root_34925 btrfs_super_chunk_root 0 34925 NULL nohasharray
++__inode_permission_34925 __inode_permission 0 34925 &btrfs_super_chunk_root_34925
++sec_flags2str_34933 sec_flags2str 3 34933 NULL
+snd_info_entry_read_34938 snd_info_entry_read 3 34938 NULL
-+do_add_page_to_bio_34974 do_add_page_to_bio 10-2 34974 NULL
-+schedule_erase_34996 schedule_erase 0 34996 NULL
++do_add_page_to_bio_34974 do_add_page_to_bio 2-10 34974 NULL
++sdebug_change_qdepth_34994 sdebug_change_qdepth 2 34994 NULL
+rx_rx_hdr_overflow_read_35002 rx_rx_hdr_overflow_read 3 35002 NULL
+l2cap_skbuff_fromiovec_35003 l2cap_skbuff_fromiovec 4-3 35003 NULL
+sisusb_copy_memory_35016 sisusb_copy_memory 4 35016 NULL
+capi_write_35104 capi_write 3 35104 NULL nohasharray
+tx_tx_done_template_read_35104 tx_tx_done_template_read 3 35104 &capi_write_35104
+ide_settings_proc_write_35110 ide_settings_proc_write 3 35110 NULL
++ceph_osdc_start_request_35122 ceph_osdc_start_request 0 35122 NULL
+addrs_per_inode_35151 addrs_per_inode 0 35151 NULL
+message_stats_print_35158 message_stats_print 6 35158 NULL
+iscsi_conn_setup_35159 iscsi_conn_setup 2 35159 NULL
+ieee80211_if_read_bssid_35161 ieee80211_if_read_bssid 3 35161 NULL
+compat_SyS_pselect6_35203 compat_SyS_pselect6 1 35203 NULL
+unix_stream_recvmsg_35210 unix_stream_recvmsg 4 35210 NULL
-+security_key_getsecurity_35218 security_key_getsecurity 0 35218 NULL nohasharray
-+striped_read_35218 striped_read 0-2 35218 &security_key_getsecurity_35218
++striped_read_35218 striped_read 0-2 35218 NULL nohasharray
++security_key_getsecurity_35218 security_key_getsecurity 0 35218 &striped_read_35218
+rx_rx_cmplt_task_read_35226 rx_rx_cmplt_task_read 3 35226 NULL
+set_fd_set_35249 set_fd_set 1 35249 NULL
+ioapic_setup_resources_35255 ioapic_setup_resources 1 35255 NULL
+nouveau_devinit_create__35348 nouveau_devinit_create_ 4 35348 NULL
+ieee80211_rx_mgmt_deauth_35351 ieee80211_rx_mgmt_deauth 3 35351 NULL
+compat_filldir64_35354 compat_filldir64 3 35354 NULL
++read_kmem_35372 read_kmem 3 35372 NULL
+SyS_getxattr_35408 SyS_getxattr 4 35408 NULL
+rawv6_send_hdrinc_35425 rawv6_send_hdrinc 3 35425 NULL
+iwl_dbgfs_drv_rx_stats_read_35430 iwl_dbgfs_drv_rx_stats_read 3 35430 NULL
+md_super_write_35703 md_super_write 4 35703 NULL
+iwl_dbgfs_disable_ht40_read_35761 iwl_dbgfs_disable_ht40_read 3 35761 NULL
+udf_alloc_i_data_35786 udf_alloc_i_data 2 35786 NULL
++alloc_netdev_mqs_35806 alloc_netdev_mqs 1 35806 NULL
+pvr2_hdw_cpufw_get_35824 pvr2_hdw_cpufw_get 0-4-2 35824 NULL
+tx_tx_cmplt_read_35854 tx_tx_cmplt_read 3 35854 NULL
+vx_query_hbuffer_size_35859 vx_query_hbuffer_size 0 35859 NULL
+generic_ocp_read_35974 generic_ocp_read 3 35974 NULL nohasharray
+ceph_buffer_new_35974 ceph_buffer_new 1 35974 &generic_ocp_read_35974
+acl_alloc_35979 acl_alloc 1 35979 NULL
++device_add_class_symlinks_35985 device_add_class_symlinks 0 35985 NULL
+write_file_antenna_35998 write_file_antenna 3 35998 NULL nohasharray
+kuc_alloc_35998 kuc_alloc 1 35998 &write_file_antenna_35998
+lov_mds_md_max_stripe_count_36008 lov_mds_md_max_stripe_count 0-1 36008 NULL
+il3945_ucode_tx_stats_read_36016 il3945_ucode_tx_stats_read 3 36016 NULL
-+ubi_eba_write_leb_36029 ubi_eba_write_leb 0 36029 NULL
+__videobuf_alloc_36031 __videobuf_alloc 1 36031 NULL
+account_shadowed_36048 account_shadowed 2 36048 NULL
+gpio_power_read_36059 gpio_power_read 3 36059 NULL
+twl_set_36154 twl_set 2 36154 NULL
+b1_alloc_card_36155 b1_alloc_card 1 36155 NULL
+snd_korg1212_copy_from_36169 snd_korg1212_copy_from 6 36169 NULL
++SyS_kexec_load_36176 SyS_kexec_load 2 36176 NULL
+ramoops_init_przs_36199 ramoops_init_przs 4 36199 NULL
+SYSC_sched_getaffinity_36208 SYSC_sched_getaffinity 2 36208 NULL
+SYSC_process_vm_readv_36216 SYSC_process_vm_readv 3-5 36216 NULL
+lpfc_debugfs_dif_err_read_36303 lpfc_debugfs_dif_err_read 3 36303 NULL
+cfg80211_rx_mlme_mgmt_36306 cfg80211_rx_mlme_mgmt 3 36306 NULL
+ad7879_spi_xfer_36311 ad7879_spi_xfer 3 36311 NULL
-+__compat_sys_pwritev64_36328 __compat_sys_pwritev64 3 36328 NULL nohasharray
-+fat_compat_ioctl_filldir_36328 fat_compat_ioctl_filldir 3 36328 &__compat_sys_pwritev64_36328
++fat_compat_ioctl_filldir_36328 fat_compat_ioctl_filldir 3 36328 NULL nohasharray
++__compat_sys_pwritev64_36328 __compat_sys_pwritev64 3 36328 &fat_compat_ioctl_filldir_36328
+lc_create_36332 lc_create 4 36332 NULL
+jbd2_journal_init_revoke_table_36336 jbd2_journal_init_revoke_table 1 36336 NULL
+isku_sysfs_read_key_mask_36343 isku_sysfs_read_key_mask 6 36343 NULL
+afs_alloc_flat_call_36399 afs_alloc_flat_call 2-3 36399 NULL
+sierra_write_36402 sierra_write 4 36402 NULL
+SyS_sethostname_36417 SyS_sethostname 2 36417 NULL
++soc_pcm_codec_params_fixup_36434 soc_pcm_codec_params_fixup 2 36434 NULL
++ReadW6692B_36445 ReadW6692B 0 36445 NULL
+sctp_tsnmap_init_36446 sctp_tsnmap_init 2 36446 NULL
+alloc_etherdev_mqs_36450 alloc_etherdev_mqs 1 36450 NULL
+SyS_process_vm_writev_36476 SyS_process_vm_writev 3-5 36476 NULL
+b43_nphy_load_samples_36481 b43_nphy_load_samples 3 36481 NULL
-+tx_tx_checksum_result_read_36490 tx_tx_checksum_result_read 3 36490 NULL
++ds1343_nvram_write_36489 ds1343_nvram_write 5-6 36489 NULL
++tx_tx_checksum_result_read_36490 tx_tx_checksum_result_read 3 36490 NULL nohasharray
++ip6_append_data_36490 ip6_append_data 4 36490 &tx_tx_checksum_result_read_36490
++cmd_loop_36491 cmd_loop 0 36491 NULL
+__hwahc_op_set_ptk_36510 __hwahc_op_set_ptk 5 36510 NULL
+mcam_v4l_read_36513 mcam_v4l_read 3 36513 NULL
+_iwl_dbgfs_fw_nmi_write_36515 _iwl_dbgfs_fw_nmi_write 3 36515 NULL
+int_hardware_entry_36833 int_hardware_entry 3 36833 NULL
+fc_change_queue_depth_36841 fc_change_queue_depth 2 36841 NULL
+keyctl_describe_key_36853 keyctl_describe_key 3 36853 NULL
++cm_write_36858 cm_write 3 36858 NULL
+tipc_link_iovec_long_xmit_36871 tipc_link_iovec_long_xmit 3 36871 NULL nohasharray
+tx_tx_data_programmed_read_36871 tx_tx_data_programmed_read 3 36871 &tipc_link_iovec_long_xmit_36871
+svc_setsockopt_36876 svc_setsockopt 5 36876 NULL
+auok190xfb_write_37001 auok190xfb_write 3 37001 NULL
+setxattr_37006 setxattr 4 37006 NULL
+ec_i2c_xfer_37029 ec_i2c_xfer 3 37029 NULL
++ieee80211_chsw_switch_vifs_37030 ieee80211_chsw_switch_vifs 2 37030 NULL
+command_file_read_37038 command_file_read 3 37038 NULL
+figure_loop_size_37051 figure_loop_size 2-3 37051 NULL
+qp_broker_create_37053 qp_broker_create 6-5 37053 NULL nohasharray
+vcc_recvmsg_37198 vcc_recvmsg 4 37198 NULL
+forced_ps_write_37209 forced_ps_write 3 37209 NULL
+crypto_shash_descsize_37212 crypto_shash_descsize 0 37212 NULL
++bchannel_get_rxbuf_37213 bchannel_get_rxbuf 2-0 37213 NULL
+regmap_access_read_file_37223 regmap_access_read_file 3 37223 NULL
+__do_replace_37227 __do_replace 5 37227 NULL
+iwl_dbgfs_d3_sram_read_37237 iwl_dbgfs_d3_sram_read 3 37237 NULL
-+__btrfs_inc_extent_ref_37238 __btrfs_inc_extent_ref 7 37238 NULL nohasharray
-+rx_filter_dup_filter_read_37238 rx_filter_dup_filter_read 3 37238 &__btrfs_inc_extent_ref_37238
-+prot_queue_del_37258 prot_queue_del 0 37258 NULL
++rx_filter_dup_filter_read_37238 rx_filter_dup_filter_read 3 37238 NULL nohasharray
++__btrfs_inc_extent_ref_37238 __btrfs_inc_extent_ref 7 37238 &rx_filter_dup_filter_read_37238
+exofs_max_io_pages_37263 exofs_max_io_pages 0-2 37263 NULL
+_iwl_dbgfs_fw_restart_write_37270 _iwl_dbgfs_fw_restart_write 3 37270 NULL
+ieee80211_if_read_power_mode_37305 ieee80211_if_read_power_mode 3 37305 NULL
+jffs2_write_dirent_37311 jffs2_write_dirent 5 37311 NULL
+tipc_send_37315 tipc_send 3 37315 NULL
-+l2cap_create_connless_pdu_37327 l2cap_create_connless_pdu 3 37327 NULL
++l2cap_create_connless_pdu_37327 l2cap_create_connless_pdu 3 37327 NULL nohasharray
++bnx2x_vf_fill_fw_str_37327 bnx2x_vf_fill_fw_str 3 37327 &l2cap_create_connless_pdu_37327
+scsi_mode_select_37330 scsi_mode_select 6 37330 NULL
+rxrpc_server_sendmsg_37331 rxrpc_server_sendmsg 4 37331 NULL
+security_inode_getsecurity_37354 security_inode_getsecurity 0 37354 NULL
++seek_firmware_37372 seek_firmware 2 37372 NULL
+hci_sock_sendmsg_37420 hci_sock_sendmsg 4 37420 NULL
-+acpi_os_allocate_zeroed_37422 acpi_os_allocate_zeroed 1 37422 NULL nohasharray
-+find_next_bit_37422 find_next_bit 0 37422 &acpi_os_allocate_zeroed_37422
++acpi_os_allocate_zeroed_37422 acpi_os_allocate_zeroed 1 37422 NULL
+tty_insert_flip_string_fixed_flag_37428 tty_insert_flip_string_fixed_flag 4-0 37428 NULL
-+iwl_print_last_event_logs_37433 iwl_print_last_event_logs 7-9-0 37433 NULL
++iwl_print_last_event_logs_37433 iwl_print_last_event_logs 0-7-9 37433 NULL
+fru_alloc_37442 fru_alloc 1 37442 NULL
+tcp_established_options_37450 tcp_established_options 0 37450 NULL
+brcmf_sdio_dump_console_37455 brcmf_sdio_dump_console 4 37455 NULL
+SYSC_mbind_37622 SYSC_mbind 5 37622 NULL
+SyS_mbind_37638 SyS_mbind 5 37638 NULL
+bio_copy_user_iov_37660 bio_copy_user_iov 4 37660 NULL
-+rfcomm_sock_sendmsg_37661 rfcomm_sock_sendmsg 4 37661 NULL nohasharray
-+vmw_framebuffer_dmabuf_dirty_37661 vmw_framebuffer_dmabuf_dirty 6 37661 &rfcomm_sock_sendmsg_37661
++vmw_framebuffer_dmabuf_dirty_37661 vmw_framebuffer_dmabuf_dirty 6 37661 NULL nohasharray
++rfcomm_sock_sendmsg_37661 rfcomm_sock_sendmsg 4 37661 &vmw_framebuffer_dmabuf_dirty_37661
+SYSC_get_mempolicy_37664 SYSC_get_mempolicy 3 37664 NULL
+__wa_seg_calculate_isoc_frame_count_37672 __wa_seg_calculate_isoc_frame_count 0 37672 NULL
+ieee80211_if_read_rc_rateidx_mcs_mask_2ghz_37675 ieee80211_if_read_rc_rateidx_mcs_mask_2ghz 3 37675 NULL
+dccp_setsockopt_cscov_37766 dccp_setsockopt_cscov 2 37766 NULL
+il4965_rs_sta_dbgfs_rate_scale_data_read_37792 il4965_rs_sta_dbgfs_rate_scale_data_read 3 37792 NULL
+smk_read_logging_37804 smk_read_logging 3 37804 NULL
++nvkm_notify_init_37806 nvkm_notify_init 6 37806 NULL
+ocrdma_alloc_frmr_page_list_37815 ocrdma_alloc_frmr_page_list 2 37815 NULL
+rx_decrypt_key_not_found_read_37820 rx_decrypt_key_not_found_read 3 37820 NULL
+android_get_p2p_addr_37832 android_get_p2p_addr 0 37832 NULL
+xfs_dir2_block_to_sf_37868 xfs_dir2_block_to_sf 3 37868 NULL
+btrfs_leaf_data_37869 btrfs_leaf_data 0 37869 NULL
+btrfs_stack_file_extent_disk_bytenr_37888 btrfs_stack_file_extent_disk_bytenr 0 37888 NULL
-+pkt_alloc_packet_data_37928 pkt_alloc_packet_data 1 37928 NULL nohasharray
-+_rtw_malloc_37928 _rtw_malloc 1 37928 &pkt_alloc_packet_data_37928
++_rtw_malloc_37928 _rtw_malloc 1 37928 NULL nohasharray
++pkt_alloc_packet_data_37928 pkt_alloc_packet_data 1 37928 &_rtw_malloc_37928
+read_rbu_packet_size_37939 read_rbu_packet_size 6 37939 NULL
+write_file_bool_37957 write_file_bool 3 37957 NULL
+fifo_alloc_37961 fifo_alloc 1 37961 NULL
+aggr_recv_addba_req_evt_38037 aggr_recv_addba_req_evt 4 38037 NULL
+il_dbgfs_chain_noise_read_38044 il_dbgfs_chain_noise_read 3 38044 NULL nohasharray
+klsi_105_prepare_write_buffer_38044 klsi_105_prepare_write_buffer 3 38044 &il_dbgfs_chain_noise_read_38044
++parser_init_guts_38046 parser_init_guts 2 38046 NULL
+SyS_llistxattr_38048 SyS_llistxattr 3 38048 NULL
++sysfs_do_create_link_38051 sysfs_do_create_link 0 38051 NULL
+_xfs_buf_alloc_38058 _xfs_buf_alloc 3 38058 NULL
+nsm_create_handle_38060 nsm_create_handle 4 38060 NULL
+alloc_ltalkdev_38071 alloc_ltalkdev 1 38071 NULL
++cifs_send_async_read_38077 cifs_send_async_read 2 38077 NULL
+xfs_buf_readahead_map_38081 xfs_buf_readahead_map 3 38081 NULL
+uwb_mac_addr_print_38085 uwb_mac_addr_print 2 38085 NULL
+request_key_auth_new_38092 request_key_auth_new 3 38092 NULL
+osd_req_list_partition_collections_38223 osd_req_list_partition_collections 5 38223 NULL
+ceph_decode_16_38239 ceph_decode_16 0 38239 NULL
+_ipw_read_reg32_38245 _ipw_read_reg32 0 38245 NULL
++nvkm_dmaobj_create__38250 nvkm_dmaobj_create_ 6 38250 NULL
+mthca_alloc_icm_table_38268 mthca_alloc_icm_table 4-3 38268 NULL nohasharray
+ieee80211_if_read_auto_open_plinks_38268 ieee80211_if_read_auto_open_plinks 3 38268 &mthca_alloc_icm_table_38268
-+xfs_bmdr_to_bmbt_38275 xfs_bmdr_to_bmbt 5 38275 NULL nohasharray
-+xfs_bmbt_to_bmdr_38275 xfs_bmbt_to_bmdr 3 38275 &xfs_bmdr_to_bmbt_38275
++xfs_bmbt_to_bmdr_38275 xfs_bmbt_to_bmdr 3 38275 NULL nohasharray
++xfs_bmdr_to_bmbt_38275 xfs_bmdr_to_bmbt 5 38275 &xfs_bmbt_to_bmdr_38275
+ftdi_process_packet_38281 ftdi_process_packet 4 38281 NULL
+C_SYSC_pselect6_38296 C_SYSC_pselect6 1 38296 NULL
+ucma_query_path_38305 ucma_query_path 3 38305 NULL
+isr_rx_headers_read_38325 isr_rx_headers_read 3 38325 NULL
+ida_simple_get_38326 ida_simple_get 0 38326 NULL
+__snd_gf1_look8_38333 __snd_gf1_look8 0 38333 NULL
++usb_ext_prop_put_name_38352 usb_ext_prop_put_name 0-3 38352 NULL
+btrfs_file_extent_disk_num_bytes_38363 btrfs_file_extent_disk_num_bytes 0 38363 NULL
+dn_sendmsg_38390 dn_sendmsg 4 38390 NULL
+ieee80211_if_read_dtim_count_38419 ieee80211_if_read_dtim_count 3 38419 NULL
+pmcraid_copy_sglist_38431 pmcraid_copy_sglist 3 38431 NULL
+iov_iter_npages_iovec_38448 iov_iter_npages_iovec 0-2 38448 NULL
+kvm_write_guest_38454 kvm_write_guest 4-2 38454 NULL
++videobuf_waiton_38459 videobuf_waiton 0 38459 NULL
+_iwl_dbgfs_scan_ant_rxchain_write_38479 _iwl_dbgfs_scan_ant_rxchain_write 3 38479 NULL
+blk_end_bidi_request_38482 blk_end_bidi_request 3-4 38482 NULL
+dev_names_read_38509 dev_names_read 3 38509 NULL
+irda_sendmsg_dgram_38563 irda_sendmsg_dgram 4 38563 NULL
+il4965_rs_sta_dbgfs_scale_table_read_38564 il4965_rs_sta_dbgfs_scale_table_read 3 38564 NULL
+_ipw_read32_38565 _ipw_read32 0 38565 NULL
-+snd_nm256_playback_copy_38567 snd_nm256_playback_copy 3-5 38567 NULL
++snd_nm256_playback_copy_38567 snd_nm256_playback_copy 5-3 38567 NULL
+copy_ctl_value_to_user_38587 copy_ctl_value_to_user 4 38587 NULL
+rd_allocate_sgl_table_38607 rd_allocate_sgl_table 3 38607 NULL
+icn_writecmd_38629 icn_writecmd 2 38629 NULL
+qp_broker_alloc_38646 qp_broker_alloc 6-5 38646 NULL
+mmc_send_cxd_data_38655 mmc_send_cxd_data 5 38655 NULL
+nouveau_instmem_create__38664 nouveau_instmem_create_ 4 38664 NULL
++ufshcd_read_sdev_qdepth_38676 ufshcd_read_sdev_qdepth 0 38676 NULL
+iscsit_dump_data_payload_38683 iscsit_dump_data_payload 2 38683 NULL
-+validate_vid_hdr_38699 validate_vid_hdr 0 38699 NULL
++tracing_nsecs_read_38689 tracing_nsecs_read 3 38689 NULL
+rbio_add_io_page_38700 rbio_add_io_page 6 38700 NULL
++w83977af_sir_interrupt_38738 w83977af_sir_interrupt 0 38738 NULL
+udf_readpages_38761 udf_readpages 4 38761 NULL
+iwl_dbgfs_thermal_throttling_read_38779 iwl_dbgfs_thermal_throttling_read 3 38779 NULL
+bcache_device_init_38781 bcache_device_init 3 38781 NULL
+snd_gus_dram_write_38784 snd_gus_dram_write 4 38784 NULL
++do_pci_enable_device_38802 do_pci_enable_device 0 38802 NULL
+err_decode_38804 err_decode 2 38804 NULL
+ipv6_renew_option_38813 ipv6_renew_option 3 38813 NULL
+direct_entry_38836 direct_entry 3 38836 NULL
+dbgfs_state_38894 dbgfs_state 3 38894 NULL
+il_dbgfs_sram_write_38942 il_dbgfs_sram_write 3 38942 NULL
+__ath6kl_wmi_send_mgmt_cmd_38971 __ath6kl_wmi_send_mgmt_cmd 7 38971 NULL
-+C_SYSC_preadv64_38977 C_SYSC_preadv64 3 38977 NULL nohasharray
-+usb_maxpacket_38977 usb_maxpacket 0 38977 &C_SYSC_preadv64_38977
++usb_maxpacket_38977 usb_maxpacket 0 38977 NULL nohasharray
++C_SYSC_preadv64_38977 C_SYSC_preadv64 3 38977 &usb_maxpacket_38977
+OSDSetBlock_38986 OSDSetBlock 2-4 38986 NULL
+bio_clone_range_38997 bio_clone_range 2 38997 NULL
+lpfc_idiag_extacc_write_38998 lpfc_idiag_extacc_write 3 38998 NULL
+force_sc_support_read_39014 force_sc_support_read 3 39014 NULL
+__blkdev_issue_zeroout_39020 __blkdev_issue_zeroout 3 39020 NULL
+_zd_iowrite32v_async_locked_39034 _zd_iowrite32v_async_locked 3 39034 NULL
++do_write_kmem_39051 do_write_kmem 0-1-3 39051 NULL
+tomoyo_truncate_39105 tomoyo_truncate 0 39105 NULL
-+leb_write_lock_39111 leb_write_lock 0 39111 NULL
+__kfifo_to_user_r_39123 __kfifo_to_user_r 5-3 39123 NULL
+ea_foreach_39133 ea_foreach 0 39133 NULL
+generic_permission_39150 generic_permission 0 39150 NULL
+ubi_more_update_data_39189 ubi_more_update_data 4 39189 NULL
+qcam_read_bytes_39205 qcam_read_bytes 0 39205 NULL
+ivtv_v4l2_write_39226 ivtv_v4l2_write 3 39226 NULL
++SyS_getrandom_39235 SyS_getrandom 2 39235 NULL
+posix_acl_to_xattr_39237 posix_acl_to_xattr 0 39237 NULL
++snd_pcm_capture_forward_39248 snd_pcm_capture_forward 2 39248 NULL
+r128_compat_ioctl_39250 r128_compat_ioctl 2 39250 NULL nohasharray
+pwr_cont_miss_bcns_spread_read_39250 pwr_cont_miss_bcns_spread_read 3 39250 &r128_compat_ioctl_39250
+i915_error_state_read_39254 i915_error_state_read 3 39254 NULL
+alloc_agpphysmem_i8xx_39427 alloc_agpphysmem_i8xx 1 39427 NULL
+mic_desc_size_39464 mic_desc_size 0 39464 NULL
+setkey_unaligned_39474 setkey_unaligned 3 39474 NULL
++usif_ioctl_39481 usif_ioctl 3 39481 NULL
+ieee80211_if_fmt_dot11MeshHWMPmaxPREQretries_39499 ieee80211_if_fmt_dot11MeshHWMPmaxPREQretries 3 39499 NULL
+cl_req_alloc_39523 cl_req_alloc 4 39523 NULL
+int_proc_write_39542 int_proc_write 3 39542 NULL
-+ext4_alloc_file_blocks_39551 ext4_alloc_file_blocks 3 39551 NULL
+pp_write_39554 pp_write 3 39554 NULL
+datablob_format_39571 datablob_format 2 39571 NULL nohasharray
+ieee80211_if_read_fwded_mcast_39571 ieee80211_if_read_fwded_mcast 3 39571 &datablob_format_39571
+security_inode_listsecurity_39812 security_inode_listsecurity 0 39812 NULL
+snd_pcm_oss_writev3_39818 snd_pcm_oss_writev3 3 39818 NULL
+get_priv_size_39828 get_priv_size 0-1 39828 NULL
++netlbl_catmap_walkrng_39885 netlbl_catmap_walkrng 0-2 39885 NULL
+pkt_add_39897 pkt_add 3 39897 NULL
+read_file_modal_eeprom_39909 read_file_modal_eeprom 3 39909 NULL
+gen_pool_add_virt_39913 gen_pool_add_virt 4 39913 NULL
+bio_chain_clone_range_39967 bio_chain_clone_range 3 39967 NULL
+dma_push_rx_39973 dma_push_rx 2 39973 NULL
+broadsheetfb_write_39976 broadsheetfb_write 3 39976 NULL
++lustre_pack_reply_v2_39978 lustre_pack_reply_v2 2 39978 NULL
+mthca_array_init_39987 mthca_array_init 2 39987 NULL
+fw_device_op_read_39990 fw_device_op_read 3 39990 NULL
++server_name2svname_39998 server_name2svname 4 39998 NULL
+xen_hvm_config_40018 xen_hvm_config 2 40018 NULL
+ivtvfb_write_40023 ivtvfb_write 3 40023 NULL
+disc_pwup_write_40027 disc_pwup_write 3 40027 NULL
+osst_read_40237 osst_read 3 40237 NULL
+lpage_info_slot_40243 lpage_info_slot 1-3 40243 NULL
+ocfs2_zero_extend_get_range_40248 ocfs2_zero_extend_get_range 4 40248 NULL
-+of_get_child_count_40254 of_get_child_count 0 40254 NULL
++of_get_child_count_40254 of_get_child_count 0 40254 NULL nohasharray
++fsl_edma_prep_dma_cyclic_40254 fsl_edma_prep_dma_cyclic 3-4 40254 &of_get_child_count_40254
+rs_sta_dbgfs_scale_table_read_40262 rs_sta_dbgfs_scale_table_read 3 40262 NULL
+ext2_fiemap_40271 ext2_fiemap 4 40271 NULL
+usbnet_read_cmd_40275 usbnet_read_cmd 7 40275 NULL
+rx_xfr_hint_trig_read_40283 rx_xfr_hint_trig_read 3 40283 NULL
++tracing_thresh_read_40295 tracing_thresh_read 3 40295 NULL
+SyS_bind_40303 SyS_bind 3 40303 NULL
-+ubi_io_write_data_40305 ubi_io_write_data 0 40305 NULL
+ib_get_mad_data_offset_40336 ib_get_mad_data_offset 0 40336 NULL
+mmio_read_40348 mmio_read 4 40348 NULL
+event_rx_mem_empty_read_40363 event_rx_mem_empty_read 3 40363 NULL
-+ocfs2_check_range_for_refcount_40365 ocfs2_check_range_for_refcount 2-3 40365 NULL
++ocfs2_check_range_for_refcount_40365 ocfs2_check_range_for_refcount 3-2 40365 NULL
+get_chars_40373 get_chars 3 40373 NULL
+fb_prepare_extra_logos_40429 fb_prepare_extra_logos 0-2 40429 NULL
++proc_write_driver_40432 proc_write_driver 3 40432 NULL
+tomoyo_update_policy_40458 tomoyo_update_policy 2 40458 NULL
+zd_usb_scnprint_id_40459 zd_usb_scnprint_id 0-3 40459 NULL
+gp2ap020a00f_write_event_threshold_40461 gp2ap020a00f_write_event_threshold 2 40461 NULL
+idr_get_empty_slot_40674 idr_get_empty_slot 0 40674 NULL
+alloc_rbio_40676 alloc_rbio 4 40676 NULL
+videobuf_dma_init_user_locked_40678 videobuf_dma_init_user_locked 4-3 40678 NULL
++pci_enable_resources_40680 pci_enable_resources 0 40680 NULL
+nfc_hci_set_param_40697 nfc_hci_set_param 5 40697 NULL
+__seq_open_private_40715 __seq_open_private 3 40715 NULL
++lnet_new_text_buf_40717 lnet_new_text_buf 1 40717 NULL
++ip_skb_dst_mtu_40718 ip_skb_dst_mtu 0 40718 NULL
+of_pdt_build_one_prop_40735 of_pdt_build_one_prop 5 40735 NULL
+fuse_readpages_40737 fuse_readpages 4 40737 NULL
+xfs_iext_remove_direct_40744 xfs_iext_remove_direct 3 40744 NULL
+kernfs_fop_read_40770 kernfs_fop_read 3 40770 NULL
+show_list_40775 show_list 3-0 40775 NULL
+kfifo_out_copy_r_40784 kfifo_out_copy_r 0-3 40784 NULL
-+bitmap_weight_40791 bitmap_weight 0 40791 NULL
++bitmap_weight_40791 bitmap_weight 0-2 40791 NULL
+pyra_sysfs_read_40795 pyra_sysfs_read 6 40795 NULL
+rtw_add_beacon_40801 rtw_add_beacon 3-5 40801 NULL
+add_action_40811 add_action 4 40811 NULL
+vol_cdev_write_40915 vol_cdev_write 3 40915 NULL
+snd_vx_create_40948 snd_vx_create 4 40948 NULL
+rds_sendmsg_40976 rds_sendmsg 4 40976 NULL
-+insert_old_idx_40987 insert_old_idx 0 40987 NULL
+il_dbgfs_fh_reg_read_40993 il_dbgfs_fh_reg_read 3 40993 NULL
+iwl_dbgfs_scan_ant_rxchain_read_40999 iwl_dbgfs_scan_ant_rxchain_read 3 40999 NULL
+mac80211_format_buffer_41010 mac80211_format_buffer 2 41010 NULL
+get_pages_alloc_bvec_41012 get_pages_alloc_bvec 0-3 41012 NULL
-+mtd_block_isbad_41015 mtd_block_isbad 0 41015 NULL
+__proc_dobitmasks_41029 __proc_dobitmasks 5 41029 NULL
+_req_append_segment_41031 _req_append_segment 2 41031 NULL
+mISDN_sock_sendmsg_41035 mISDN_sock_sendmsg 4 41035 NULL
+erst_read_41260 erst_read 0 41260 NULL
+alloc_context_41283 alloc_context 1 41283 NULL
+of_count_phandle_with_args_41291 of_count_phandle_with_args 0 41291 NULL
++virtscsi_change_queue_depth_41327 virtscsi_change_queue_depth 2 41327 NULL
+o2hb_setup_one_bio_41341 o2hb_setup_one_bio 4 41341 NULL
+twl_change_queue_depth_41342 twl_change_queue_depth 2 41342 NULL
+rtw_android_set_block_41347 rtw_android_set_block 0 41347 NULL
+dm_get_reserved_rq_based_ios_41529 dm_get_reserved_rq_based_ios 0 41529 NULL
+tx_tx_frame_checksum_read_41553 tx_tx_frame_checksum_read 3 41553 NULL
+ath6kl_endpoint_stats_read_41554 ath6kl_endpoint_stats_read 3 41554 NULL
-+si476x_radio_fops_read_41559 si476x_radio_fops_read 3 41559 NULL nohasharray
-+nr_status_frames_41559 nr_status_frames 0-1 41559 &si476x_radio_fops_read_41559
++nr_status_frames_41559 nr_status_frames 0-1 41559 NULL nohasharray
++si476x_radio_fops_read_41559 si476x_radio_fops_read 3 41559 &nr_status_frames_41559
+rng_dev_read_41581 rng_dev_read 3 41581 NULL
+nfsd_readv_41585 nfsd_readv 4 41585 NULL
+batadv_tvlv_container_ogm_append_41588 batadv_tvlv_container_ogm_append 4 41588 NULL
+tcp_hdrlen_41610 tcp_hdrlen 0 41610 NULL
-+usb_endpoint_maxp_41613 usb_endpoint_maxp 0 41613 NULL nohasharray
-+lbs_bcnmiss_write_41613 lbs_bcnmiss_write 3 41613 &usb_endpoint_maxp_41613
++lbs_bcnmiss_write_41613 lbs_bcnmiss_write 3 41613 NULL nohasharray
++usb_endpoint_maxp_41613 usb_endpoint_maxp 0 41613 &lbs_bcnmiss_write_41613
+a2mp_send_41615 a2mp_send 4 41615 NULL
+lstcon_batch_list_41627 lstcon_batch_list 2 41627 NULL
+mempool_create_kmalloc_pool_41650 mempool_create_kmalloc_pool 1 41650 NULL
+rx_rx_pre_complt_read_41653 rx_rx_pre_complt_read 3 41653 NULL
+get_std_timing_41654 get_std_timing 0 41654 NULL
+ieee80211_if_fmt_bssid_41677 ieee80211_if_fmt_bssid 3 41677 NULL
++fill_pcm_stream_name_41685 fill_pcm_stream_name 2 41685 NULL
+lov_unpackmd_41701 lov_unpackmd 4 41701 NULL
++connector_write_41709 connector_write 3 41709 NULL
+fillonedir_41746 fillonedir 3 41746 NULL
+iwl_dbgfs_bt_notif_read_41794 iwl_dbgfs_bt_notif_read 3 41794 NULL
+hsi_alloc_controller_41802 hsi_alloc_controller 1 41802 NULL
++ptlrpc_new_bulk_41804 ptlrpc_new_bulk 1 41804 NULL
+rtw_android_get_macaddr_41812 rtw_android_get_macaddr 0 41812 NULL
+sco_send_frame_41815 sco_send_frame 3 41815 NULL
+copy_page_to_iter_bvec_41830 copy_page_to_iter_bvec 0-3 41830 NULL
+do_ip_setsockopt_41852 do_ip_setsockopt 5 41852 NULL
+keyctl_instantiate_key_41855 keyctl_instantiate_key 3 41855 NULL
+pci_map_single_41869 pci_map_single 0 41869 NULL
++usb_gadget_get_string_41871 usb_gadget_get_string 0 41871 NULL
+get_fdb_entries_41916 get_fdb_entries 3 41916 NULL
+ext4_da_write_inline_data_begin_41935 ext4_da_write_inline_data_begin 4-3 41935 NULL
+sci_rxfill_41945 sci_rxfill 0 41945 NULL
+read_gssp_41947 read_gssp 3 41947 NULL
+ocfs2_xattr_bucket_get_name_value_41949 ocfs2_xattr_bucket_get_name_value 0 41949 NULL
+portnames_read_41958 portnames_read 3 41958 NULL
-+ubi_self_check_all_ff_41959 ubi_self_check_all_ff 0 41959 NULL
+dst_mtu_41969 dst_mtu 0 41969 NULL
+cx24116_writeregN_41975 cx24116_writeregN 4 41975 NULL
-+ubi_io_is_bad_41983 ubi_io_is_bad 0 41983 NULL
+pool_allocate_42012 pool_allocate 3 42012 NULL
+spidev_sync_read_42014 spidev_sync_read 0 42014 NULL
+rs_sta_dbgfs_scale_table_write_42017 rs_sta_dbgfs_scale_table_write 3 42017 NULL
+jffs2_do_link_42048 jffs2_do_link 6 42048 NULL
+ps_poll_upsd_max_ap_turn_read_42050 ps_poll_upsd_max_ap_turn_read 3 42050 NULL
+InterfaceTransmitPacket_42058 InterfaceTransmitPacket 3 42058 NULL
++ufshcd_dev_cmd_completion_42080 ufshcd_dev_cmd_completion 0 42080 NULL
+scsi_execute_req_42088 scsi_execute_req 5 42088 NULL
+sk_chk_filter_42095 sk_chk_filter 2 42095 NULL
+submit_inquiry_42108 submit_inquiry 3 42108 NULL
+oprofilefs_str_to_user_42182 oprofilefs_str_to_user 3 42182 NULL
+write_file_beacon_42185 write_file_beacon 3 42185 NULL
+get_znodes_to_commit_42201 get_znodes_to_commit 0 42201 NULL
-+pla_ocp_read_42235 pla_ocp_read 3 42235 NULL nohasharray
-+blockdev_direct_IO_42235 blockdev_direct_IO 5 42235 &pla_ocp_read_42235
++blockdev_direct_IO_42235 blockdev_direct_IO 5 42235 NULL nohasharray
++pla_ocp_read_42235 pla_ocp_read 3 42235 &blockdev_direct_IO_42235
+rx_defrag_need_decrypt_read_42253 rx_defrag_need_decrypt_read 3 42253 NULL
+find_last_bit_42260 find_last_bit 0 42260 NULL
+__pcpu_size_to_slot_42271 __pcpu_size_to_slot 0 42271 NULL
+__tty_buffer_request_room_42276 __tty_buffer_request_room 2-0 42276 NULL
+snd_pcm_hw_param_value_max_42280 snd_pcm_hw_param_value_max 0 42280 NULL
-+__cpus_weight_42299 __cpus_weight 0 42299 NULL
++__cpus_weight_42299 __cpus_weight 2-0 42299 NULL
+sel_read_perm_42302 sel_read_perm 3 42302 NULL
+sctp_setsockopt_del_key_42304 sctp_setsockopt_del_key 3 42304 NULL nohasharray
+ulong_read_file_42304 ulong_read_file 3 42304 &sctp_setsockopt_del_key_42304
+xfs_vm_readpages_42308 xfs_vm_readpages 4 42308 NULL
+hysdn_conf_read_42324 hysdn_conf_read 3 42324 NULL
-+tcp_sync_mss_42330 tcp_sync_mss 0-2 42330 NULL
++tcp_sync_mss_42330 tcp_sync_mss 2-0 42330 NULL
+ide_raw_taskfile_42355 ide_raw_taskfile 4 42355 NULL
+drbd_md_last_sector_42378 drbd_md_last_sector 0 42378 NULL
+il_dbgfs_disable_ht40_read_42386 il_dbgfs_disable_ht40_read 3 42386 NULL
+__simple_xattr_set_42474 __simple_xattr_set 4 42474 NULL
+omfs_readpages_42490 omfs_readpages 4 42490 NULL
+bypass_write_42498 bypass_write 3 42498 NULL
-+SyS_mincore_42511 SyS_mincore 2-1 42511 NULL
++SyS_mincore_42511 SyS_mincore 1-2 42511 NULL
+kvm_write_wall_clock_42520 kvm_write_wall_clock 2 42520 NULL
+dio_bio_complete_42524 dio_bio_complete 0 42524 NULL
+smk_write_netlbladdr_42525 smk_write_netlbladdr 3 42525 NULL
-+self_check_ec_hdr_42528 self_check_ec_hdr 0 42528 NULL
+dbAllocNear_42546 dbAllocNear 0 42546 NULL
+ath6kl_wmi_proc_events_vif_42549 ath6kl_wmi_proc_events_vif 5 42549 NULL
+udp_recvmsg_42558 udp_recvmsg 4 42558 NULL
-+iwl_print_event_log_42566 iwl_print_event_log 7-5-0 42566 NULL
++iwl_print_event_log_42566 iwl_print_event_log 0-7-5 42566 NULL
+xfrm_new_hash_mask_42579 xfrm_new_hash_mask 0-1 42579 NULL
+oom_score_adj_write_42594 oom_score_adj_write 3 42594 NULL
+ieee80211_if_fmt_dot11MeshHWMPactivePathTimeout_42635 ieee80211_if_fmt_dot11MeshHWMPactivePathTimeout 3 42635 NULL
+scsi_activate_tcq_42640 scsi_activate_tcq 2 42640 NULL
+br_mdb_rehash_42643 br_mdb_rehash 2 42643 NULL
++parport_pc_compat_write_block_pio_42644 parport_pc_compat_write_block_pio 3 42644 NULL
+_regmap_raw_write_42652 _regmap_raw_write 4-2 42652 NULL
+request_key_and_link_42693 request_key_and_link 4 42693 NULL
+vb2_read_42703 vb2_read 3 42703 NULL
++read_status_42722 read_status 0 42722 NULL
++iwl_mvm_coex_dump_mbox_old_42727 iwl_mvm_coex_dump_mbox_old 4-3-0 42727 NULL
+dvb_demux_ioctl_42733 dvb_demux_ioctl 2 42733 NULL
+set_aoe_iflist_42737 set_aoe_iflist 2 42737 NULL
+ax25_setsockopt_42740 ax25_setsockopt 5 42740 NULL
++dpm_sysfs_add_42756 dpm_sysfs_add 0 42756 NULL
+x25_recvmsg_42777 x25_recvmsg 4 42777 NULL
+snd_midi_event_decode_42780 snd_midi_event_decode 0 42780 NULL
+cryptd_hash_setkey_42781 cryptd_hash_setkey 3 42781 NULL nohasharray
+isku_sysfs_read_info_42781 isku_sysfs_read_info 6 42781 &cryptd_hash_setkey_42781
++elfcorehdr_read_notes_42786 elfcorehdr_read_notes 2 42786 NULL
+koneplus_sysfs_read_42792 koneplus_sysfs_read 6 42792 NULL
+ntfs_attr_extend_allocation_42796 ntfs_attr_extend_allocation 0 42796 NULL
+fw_device_op_compat_ioctl_42804 fw_device_op_compat_ioctl 2 42804 NULL
+nouveau_gpuobj_create__43072 nouveau_gpuobj_create_ 9 43072 NULL
+nfs_map_group_to_gid_43082 nfs_map_group_to_gid 3 43082 NULL
+_xfer_secondary_pool_43089 _xfer_secondary_pool 2 43089 NULL
++sysfs_create_file_ns_43103 sysfs_create_file_ns 0 43103 NULL
+ieee80211_if_fmt_drop_unencrypted_43107 ieee80211_if_fmt_drop_unencrypted 3 43107 NULL
+calculate_node_totalpages_43118 calculate_node_totalpages 2-3 43118 NULL
+read_file_dfs_43145 read_file_dfs 3 43145 NULL
+batadv_tt_tvlv_unicast_handler_v1_43239 batadv_tt_tvlv_unicast_handler_v1 5 43239 NULL
+vmemmap_alloc_block_43245 vmemmap_alloc_block 1 43245 NULL
+ide_end_rq_43269 ide_end_rq 4 43269 NULL
-+evtchn_write_43278 evtchn_write 3 43278 NULL
++evtchn_write_43278 evtchn_write 3 43278 NULL nohasharray
++parport_pc_ecp_write_block_pio_43278 parport_pc_ecp_write_block_pio 3 43278 &evtchn_write_43278
+filemap_write_and_wait_range_43279 filemap_write_and_wait_range 0 43279 NULL
+mpage_alloc_43299 mpage_alloc 3 43299 NULL
+mmu_set_spte_43327 mmu_set_spte 7-6 43327 NULL
+__alloc_bootmem_low_43423 __alloc_bootmem_low 1 43423 NULL
+usb_alloc_urb_43436 usb_alloc_urb 1 43436 NULL
+ath6kl_wmi_roam_tbl_event_rx_43440 ath6kl_wmi_roam_tbl_event_rx 3 43440 NULL
-+usb_string_43443 usb_string 0 43443 NULL nohasharray
-+usemap_size_43443 usemap_size 0-1-2 43443 &usb_string_43443
++usemap_size_43443 usemap_size 0-2-1 43443 NULL nohasharray
++usb_string_43443 usb_string 0 43443 &usemap_size_43443
+get_vm_area_size_43444 get_vm_area_size 0 43444 NULL
+fs_path_prepare_for_add_43453 fs_path_prepare_for_add 2 43453 NULL
+nvme_trans_device_id_page_43466 nvme_trans_device_id_page 4 43466 NULL
+read_events_43534 read_events 3 43534 NULL
+cachefiles_daemon_write_43535 cachefiles_daemon_write 3 43535 NULL
+tx_frag_failed_read_43540 tx_frag_failed_read 3 43540 NULL
++request_resource_43548 request_resource 0 43548 NULL
+rpc_malloc_43573 rpc_malloc 2 43573 NULL
++handle_frequent_errors_43599 handle_frequent_errors 4 43599 NULL
+lpfc_idiag_drbacc_read_reg_43606 lpfc_idiag_drbacc_read_reg 0-3 43606 NULL
+proc_read_43614 proc_read 3 43614 NULL
+alloc_thread_groups_43625 alloc_thread_groups 2 43625 NULL
+dmam_declare_coherent_memory_43679 dmam_declare_coherent_memory 4 43679 NULL
+max77693_bulk_write_43698 max77693_bulk_write 2-3 43698 NULL
+nvkm_connector_create__43711 nvkm_connector_create_ 6 43711 NULL
++fuse_send_read_43725 fuse_send_read 4-0 43725 NULL
+drbd_md_first_sector_43729 drbd_md_first_sector 0 43729 NULL
+snd_rme32_playback_copy_43732 snd_rme32_playback_copy 5 43732 NULL
+fuse_conn_congestion_threshold_write_43736 fuse_conn_congestion_threshold_write 3 43736 NULL
+nla_reserve_43984 nla_reserve 3 43984 NULL
+__clkdev_alloc_43990 __clkdev_alloc 1 43990 NULL
+kvm_read_guest_virt_43992 kvm_read_guest_virt 4-2 43992 NULL nohasharray
-+bcm_recvmsg_43992 bcm_recvmsg 4 43992 &kvm_read_guest_virt_43992 nohasharray
-+scsi_command_size_43992 scsi_command_size 0 43992 &bcm_recvmsg_43992
++scsi_command_size_43992 scsi_command_size 0 43992 &kvm_read_guest_virt_43992 nohasharray
++bcm_recvmsg_43992 bcm_recvmsg 4 43992 &scsi_command_size_43992
+emit_flags_44006 emit_flags 4-3 44006 NULL
+write_flush_procfs_44011 write_flush_procfs 3 44011 NULL
+fru_strlen_44046 fru_strlen 0 44046 NULL
+tracing_resize_saved_cmdlines_44140 tracing_resize_saved_cmdlines 1 44140 NULL
+ttm_get_pages_44142 ttm_get_pages 2 44142 NULL
+scsi_get_resid_44147 scsi_get_resid 0 44147 NULL
-+ubifs_find_dirty_idx_leb_44169 ubifs_find_dirty_idx_leb 0 44169 NULL
+ocfs2_xattr_bucket_find_44174 ocfs2_xattr_bucket_find 0 44174 NULL
+SYSC_set_mempolicy_44176 SYSC_set_mempolicy 3 44176 NULL
++readreg_ipac_44186 readreg_ipac 0 44186 NULL
+handle_eviocgbit_44193 handle_eviocgbit 3 44193 NULL
+btrfs_item_offset_nr_44220 btrfs_item_offset_nr 0 44220 NULL
+srp_alloc_iu_44227 srp_alloc_iu 2 44227 NULL
+scsi_track_queue_full_44239 scsi_track_queue_full 2 44239 NULL
+sigma_action_write_regmap_44240 sigma_action_write_regmap 3 44240 NULL
++device_create_file_44285 device_create_file 0 44285 NULL
+ath6kl_keepalive_read_44303 ath6kl_keepalive_read 3 44303 NULL
+bitmap_scnprintf_44318 bitmap_scnprintf 0-2 44318 NULL
+dispatch_proc_write_44320 dispatch_proc_write 3 44320 NULL
+ccp_init_data_44324 ccp_init_data 5 44324 NULL
+rs_init_44327 rs_init 1 44327 NULL
-+blk_queue_init_tags_44355 blk_queue_init_tags 2 44355 NULL nohasharray
-+nfs_fscache_get_super_cookie_44355 nfs_fscache_get_super_cookie 3 44355 &blk_queue_init_tags_44355
++nfs_fscache_get_super_cookie_44355 nfs_fscache_get_super_cookie 3 44355 NULL nohasharray
++blk_queue_init_tags_44355 blk_queue_init_tags 2 44355 &nfs_fscache_get_super_cookie_44355
+rts_threshold_read_44384 rts_threshold_read 3 44384 NULL
+mtip_hw_read_flags_44396 mtip_hw_read_flags 3 44396 NULL
+aoedev_flush_44398 aoedev_flush 2 44398 NULL
++strlcpy_44400 strlcpy 3 44400 NULL
+drm_buffer_alloc_44405 drm_buffer_alloc 2 44405 NULL
+osst_do_scsi_44410 osst_do_scsi 4 44410 NULL
+ieee80211_if_read_rc_rateidx_mcs_mask_5ghz_44423 ieee80211_if_read_rc_rateidx_mcs_mask_5ghz 3 44423 NULL
++mic_virtio_copy_to_user_44472 mic_virtio_copy_to_user 3-4 44472 NULL
+write_file_debug_44476 write_file_debug 3 44476 NULL
+btrfs_chunk_item_size_44478 btrfs_chunk_item_size 0-1 44478 NULL
+sdio_align_size_44489 sdio_align_size 0-2 44489 NULL
+ieee80211_rx_mgmt_assoc_resp_44525 ieee80211_rx_mgmt_assoc_resp 3 44525 NULL
+comm_write_44537 comm_write 3 44537 NULL
+dgrp_config_proc_write_44571 dgrp_config_proc_write 3 44571 NULL
++l2cap_sock_memcpy_fromiovec_cb_44573 l2cap_sock_memcpy_fromiovec_cb 4 44573 NULL
+nouveau_perfmon_create__44602 nouveau_perfmon_create_ 4 44602 NULL
+xpcs_mmd_write_44633 xpcs_mmd_write 3 44633 NULL
+alloc_ctrl_packet_44667 alloc_ctrl_packet 1 44667 NULL
+mpi_resize_44674 mpi_resize 2 44674 NULL
++sysfs_create_link_44685 sysfs_create_link 0 44685 NULL
+ts_read_44687 ts_read 3 44687 NULL
+lov_emerg_alloc_44698 lov_emerg_alloc 1 44698 NULL
+C_SYSC_select_44701 C_SYSC_select 1 44701 NULL
+bytepos_delta_45017 bytepos_delta 0 45017 NULL
+ptrace_writedata_45021 ptrace_writedata 4 45021 NULL
+dm_kvzalloc_45025 dm_kvzalloc 1 45025 NULL
++sysfs_do_create_link_sd_45057 sysfs_do_create_link_sd 0 45057 NULL
+sel_write_user_45060 sel_write_user 3 45060 NULL
+snd_mixart_BA0_read_45069 snd_mixart_BA0_read 5 45069 NULL
++lnet_expand1tb_45102 lnet_expand1tb 6 45102 NULL
+snd_card_new_45104 snd_card_new 5 45104 NULL
+kvm_mmu_page_get_gfn_45110 kvm_mmu_page_get_gfn 0-2 45110 NULL
+pwr_missing_bcns_cnt_read_45113 pwr_missing_bcns_cnt_read 3 45113 NULL
+ocfs2_remove_inode_range_45156 ocfs2_remove_inode_range 3 45156 &device_write_45156
+tomoyo_write_self_45161 tomoyo_write_self 3 45161 NULL
+sta_agg_status_write_45164 sta_agg_status_write 3 45164 NULL
-+sctp_pack_cookie_45190 sctp_pack_cookie 6 45190 NULL nohasharray
-+snd_sb_csp_load_user_45190 snd_sb_csp_load_user 3 45190 &sctp_pack_cookie_45190
++snd_sb_csp_load_user_45190 snd_sb_csp_load_user 3 45190 NULL nohasharray
++sctp_pack_cookie_45190 sctp_pack_cookie 6 45190 &snd_sb_csp_load_user_45190
+iso_alloc_urb_45206 iso_alloc_urb 4-5 45206 NULL
+spi_alloc_master_45223 spi_alloc_master 2 45223 NULL
+ieee80211_if_read_peer_45233 ieee80211_if_read_peer 3 45233 NULL
+ll_iocontrol_register_45430 ll_iocontrol_register 2 45430 NULL
+tty_buffer_alloc_45437 tty_buffer_alloc 2 45437 NULL
+blkdev_direct_IO_45440 blkdev_direct_IO 4 45440 NULL
++__node_remap_45458 __node_remap 4 45458 NULL
+rds_ib_set_wr_signal_state_45463 rds_ib_set_wr_signal_state 0 45463 NULL
+tracing_read_dyn_info_45468 tracing_read_dyn_info 3 45468 NULL
++__calc_request_pg_45470 __calc_request_pg 0 45470 NULL
+rds_message_copy_from_user_45510 rds_message_copy_from_user 3 45510 NULL
+copy_macs_45534 copy_macs 4 45534 NULL
+nla_attr_size_45545 nla_attr_size 0-1 45545 NULL
+venus_rmdir_45564 venus_rmdir 4 45564 NULL
+ath6kl_keepalive_write_45600 ath6kl_keepalive_write 3 45600 NULL
+hidraw_get_report_45609 hidraw_get_report 3 45609 NULL
++ip_dst_mtu_maybe_forward_45627 ip_dst_mtu_maybe_forward 0 45627 NULL
+compat_mpctl_ioctl_45671 compat_mpctl_ioctl 2 45671 NULL
+dgram_sendmsg_45679 dgram_sendmsg 4 45679 NULL
+smk_write_ambient_45691 smk_write_ambient 3 45691 NULL
+bscnl_emit_45699 bscnl_emit 2-5-0 45699 NULL nohasharray
+unix_dgram_sendmsg_45699 unix_dgram_sendmsg 4 45699 &bscnl_emit_45699
+sg_proc_write_adio_45704 sg_proc_write_adio 3 45704 NULL
++wlcore_smart_config_decode_event_45714 wlcore_smart_config_decode_event 2-4 45714 NULL
+snd_cs46xx_io_read_45734 snd_cs46xx_io_read 5 45734 NULL
+rw_copy_check_uvector_45748 rw_copy_check_uvector 3-0 45748 NULL nohasharray
+v4l2_ctrl_new_std_45748 v4l2_ctrl_new_std 5 45748 &rw_copy_check_uvector_45748
+dbgfs_frame_45917 dbgfs_frame 3 45917 NULL
+btree_keys_cachelines_45928 btree_keys_cachelines 0 45928 NULL
+alloc_mr_45935 alloc_mr 1 45935 NULL
++copy_to_45969 copy_to 3 45969 NULL
+rb_simple_read_45972 rb_simple_read 3 45972 NULL
+ioat2_dca_count_dca_slots_45984 ioat2_dca_count_dca_slots 0 45984 NULL
+sierra_setup_urb_46029 sierra_setup_urb 5 46029 NULL
+mpi_read_raw_data_46248 mpi_read_raw_data 2 46248 NULL
+sg_proc_write_dressz_46316 sg_proc_write_dressz 3 46316 NULL
+C_SYSC_ppoll_46319 C_SYSC_ppoll 2 46319 NULL
-+compat_SyS_readv_46328 compat_SyS_readv 3 46328 NULL nohasharray
-+__hwahc_dev_set_key_46328 __hwahc_dev_set_key 5 46328 &compat_SyS_readv_46328
++__hwahc_dev_set_key_46328 __hwahc_dev_set_key 5 46328 NULL nohasharray
++compat_SyS_readv_46328 compat_SyS_readv 3 46328 &__hwahc_dev_set_key_46328
+iwl_dbgfs_chain_noise_read_46355 iwl_dbgfs_chain_noise_read 3 46355 NULL
+smk_write_direct_46363 smk_write_direct 3 46363 NULL
+crypto_ablkcipher_reqsize_46411 crypto_ablkcipher_reqsize 0 46411 NULL
+ttm_page_pool_get_pages_46431 ttm_page_pool_get_pages 0-5 46431 NULL
+cfs_power2_roundup_46433 cfs_power2_roundup 0-1 46433 NULL
++wdata_alloc_and_fillpages_46437 wdata_alloc_and_fillpages 1 46437 NULL
+cp210x_set_config_46447 cp210x_set_config 4 46447 NULL
++parport_pc_fifo_write_block_46455 parport_pc_fifo_write_block 3 46455 NULL
+il_dbgfs_clear_traffic_stats_write_46458 il_dbgfs_clear_traffic_stats_write 3 46458 NULL
+filldir64_46469 filldir64 3 46469 NULL
+fill_in_write_vector_46498 fill_in_write_vector 0 46498 NULL
+dn_current_mss_46574 dn_current_mss 0 46574 NULL
+serverworks_create_gatt_pages_46582 serverworks_create_gatt_pages 1 46582 NULL
+snd_compr_write_data_46592 snd_compr_write_data 3 46592 NULL
-+il3945_stats_flag_46606 il3945_stats_flag 3-0 46606 NULL
++il3945_stats_flag_46606 il3945_stats_flag 0-3 46606 NULL
+vscnprintf_46617 vscnprintf 0-2 46617 NULL
+__kfifo_out_r_46623 __kfifo_out_r 0-3 46623 NULL
+request_key_async_with_auxdata_46624 request_key_async_with_auxdata 4 46624 NULL
++pci_enable_device_46642 pci_enable_device 0 46642 NULL
+vfs_getxattr_alloc_46649 vfs_getxattr_alloc 0 46649 NULL
+e1000_tx_map_46672 e1000_tx_map 4 46672 NULL
+l2cap_create_le_flowctl_pdu_46682 l2cap_create_le_flowctl_pdu 3 46682 NULL
+wl1271_rx_filter_alloc_field_46721 wl1271_rx_filter_alloc_field 5 46721 NULL
+irq_domain_add_simple_46734 irq_domain_add_simple 2 46734 NULL
+read_file_tx99_46741 read_file_tx99 3 46741 NULL
++ext4_count_free_46754 ext4_count_free 2 46754 NULL
+hest_ghes_dev_register_46766 hest_ghes_dev_register 1 46766 NULL
+int_hw_irq_en_46776 int_hw_irq_en 3 46776 NULL
+xfs_iroot_realloc_46826 xfs_iroot_realloc 2 46826 NULL
+shmem_pwrite_fast_46842 shmem_pwrite_fast 3 46842 NULL
++readreg_46845 readreg 0 46845 NULL
+spi_async_46857 spi_async 0 46857 NULL
+vsnprintf_46863 vsnprintf 0 46863 NULL
+nvme_alloc_queue_46865 nvme_alloc_queue 3 46865 NULL
+SYSC_poll_46965 SYSC_poll 2 46965 NULL
+crypto_tfm_alg_alignmask_46971 crypto_tfm_alg_alignmask 0 46971 NULL
+mgmt_pending_add_46976 mgmt_pending_add 5 46976 NULL
++strlcat_46985 strlcat 3 46985 NULL
+bitmap_file_clear_bit_46990 bitmap_file_clear_bit 2 46990 NULL
+sel_write_bool_46996 sel_write_bool 3 46996 NULL
+blk_rq_map_kern_47004 blk_rq_map_kern 4 47004 NULL
+ablkcipher_next_slow_47274 ablkcipher_next_slow 4-3 47274 NULL
+gfs2_readpages_47285 gfs2_readpages 4 47285 NULL
+vsnprintf_47291 vsnprintf 0 47291 NULL
++SYSC_semop_47292 SYSC_semop 3 47292 NULL
+tx_internal_desc_overflow_read_47300 tx_internal_desc_overflow_read 3 47300 NULL
+nouveau_fb_create__47316 nouveau_fb_create_ 4 47316 NULL
+ieee80211_if_read_dot11MeshHoldingTimeout_47356 ieee80211_if_read_dot11MeshHoldingTimeout 3 47356 NULL
+kvm_arch_create_memslot_47364 kvm_arch_create_memslot 3 47364 NULL nohasharray
+__output_copy_user_47364 __output_copy_user 3 47364 &kvm_arch_create_memslot_47364
+__bio_map_kern_47379 __bio_map_kern 3 47379 NULL
-+trace_options_core_read_47390 trace_options_core_read 3 47390 NULL nohasharray
-+nv_rd32_47390 nv_rd32 0 47390 &trace_options_core_read_47390
++nv_rd32_47390 nv_rd32 0 47390 NULL nohasharray
++trace_options_core_read_47390 trace_options_core_read 3 47390 &nv_rd32_47390
+nametbl_list_47391 nametbl_list 2 47391 NULL
+dgrp_net_write_47392 dgrp_net_write 3 47392 NULL
+pfkey_sendmsg_47394 pfkey_sendmsg 4 47394 NULL
+process_vm_rw_47533 process_vm_rw 3-5 47533 NULL nohasharray
+vscnprintf_47533 vscnprintf 0-2 47533 &process_vm_rw_47533
+ieee80211_if_fmt_min_discovery_timeout_47539 ieee80211_if_fmt_min_discovery_timeout 3 47539 NULL
++drbg_statelen_47551 drbg_statelen 0 47551 NULL
+read_ldt_47570 read_ldt 2 47570 NULL
+isku_sysfs_read_last_set_47572 isku_sysfs_read_last_set 6 47572 NULL
+btrfs_stack_header_bytenr_47589 btrfs_stack_header_bytenr 0 47589 NULL
+twl4030_clear_set_47624 twl4030_clear_set 4 47624 NULL
+ccp_sha_setkey_47633 ccp_sha_setkey 3 47633 NULL
+get_size_47644 get_size 1-2 47644 NULL
-+packet_recvmsg_47700 packet_recvmsg 4 47700 NULL
++osc_brw_prep_request_47680 osc_brw_prep_request 5 47680 NULL
++packet_recvmsg_47700 packet_recvmsg 4 47700 NULL nohasharray
++ipath_format_hwmsg_47700 ipath_format_hwmsg 2 47700 &packet_recvmsg_47700
+save_microcode_47717 save_microcode 3 47717 NULL
+bits_to_user_47733 bits_to_user 2-3 47733 NULL
+carl9170_debugfs_read_47738 carl9170_debugfs_read 3 47738 NULL
+uwb_ie_dump_hex_47774 uwb_ie_dump_hex 4 47774 NULL
+SyS_setgroups16_47780 SyS_setgroups16 1 47780 NULL
+error_error_numll_frame_cts_start_read_47781 error_error_numll_frame_cts_start_read 3 47781 NULL
++ptlrpc_prep_req_47792 ptlrpc_prep_req 4 47792 NULL
+posix_acl_fix_xattr_from_user_47793 posix_acl_fix_xattr_from_user 2 47793 NULL
++W6692_empty_Bfifo_47804 W6692_empty_Bfifo 2 47804 NULL
+lov_packmd_47810 lov_packmd 0 47810 NULL
+tree_mod_log_insert_move_47823 tree_mod_log_insert_move 5 47823 NULL
+pinconf_dbg_config_write_47835 pinconf_dbg_config_write 3 47835 NULL
+KEY_SIZE_47855 KEY_SIZE 0 47855 NULL
+vhci_read_47878 vhci_read 3 47878 NULL
-+ubi_wl_put_peb_47886 ubi_wl_put_peb 0 47886 NULL
+keyctl_instantiate_key_common_47889 keyctl_instantiate_key_common 4 47889 NULL
+cfs_percpt_alloc_47918 cfs_percpt_alloc 2 47918 NULL
+comedi_write_47926 comedi_write 3 47926 NULL
+nvme_trans_get_blk_desc_len_47946 nvme_trans_get_blk_desc_len 0-2 47946 NULL
++gether_get_ifname_47972 gether_get_ifname 3 47972 NULL
+mempool_resize_47983 mempool_resize 2 47983 NULL nohasharray
+iwl_dbgfs_ucode_tracing_read_47983 iwl_dbgfs_ucode_tracing_read 3 47983 &mempool_resize_47983
+dbg_port_buf_47990 dbg_port_buf 2 47990 NULL
+ib_umad_write_47993 ib_umad_write 3 47993 NULL
-+lustre_cfg_len_48002 lustre_cfg_len 0 48002 NULL
++lustre_cfg_len_48002 lustre_cfg_len 0-1 48002 NULL
+gdm_tty_recv_complete_48011 gdm_tty_recv_complete 2 48011 NULL
+bio_integrity_set_tag_48035 bio_integrity_set_tag 3 48035 NULL
+pppoe_sendmsg_48039 pppoe_sendmsg 4 48039 NULL
+mmc_alloc_host_48097 mmc_alloc_host 1 48097 NULL
+skb_copy_datagram_const_iovec_48102 skb_copy_datagram_const_iovec 4-2-5 48102 NULL
+wm_latency_write_48125 wm_latency_write 3 48125 NULL
++load_firmware_48128 load_firmware 2 48128 NULL
+vmw_framebuffer_surface_dirty_48132 vmw_framebuffer_surface_dirty 6 48132 NULL
+set_discoverable_48141 set_discoverable 4 48141 NULL
+dn_fib_count_nhs_48145 dn_fib_count_nhs 0 48145 NULL
+nouveau_i2c_port_create__48240 nouveau_i2c_port_create_ 7 48240 NULL
+nfsctl_transaction_read_48250 nfsctl_transaction_read 3 48250 NULL
+batadv_socket_read_48257 batadv_socket_read 3 48257 NULL
++__videobuf_free_48260 __videobuf_free 0 48260 NULL
+cache_write_pipefs_48270 cache_write_pipefs 3 48270 NULL
+trace_options_write_48275 trace_options_write 3 48275 NULL
+send_set_info_48288 send_set_info 7 48288 NULL
+lpfc_idiag_extacc_read_48301 lpfc_idiag_extacc_read 3 48301 NULL
+timblogiw_read_48305 timblogiw_read 3 48305 NULL
+hash_setkey_48310 hash_setkey 3 48310 NULL
++kvm_mmu_pte_write_48340 kvm_mmu_pte_write 2 48340 NULL
+skb_add_data_48363 skb_add_data 3 48363 NULL
+tx_frag_init_called_read_48377 tx_frag_init_called_read 3 48377 NULL
++ath10k_read_htt_max_amsdu_ampdu_48401 ath10k_read_htt_max_amsdu_ampdu 3 48401 NULL
+lbs_debugfs_write_48413 lbs_debugfs_write 3 48413 NULL
+uhid_event_from_user_48417 uhid_event_from_user 2 48417 NULL
+div64_u64_rem_48418 div64_u64_rem 0-1-2 48418 NULL
+copy_page_from_iter_iovec_48466 copy_page_from_iter_iovec 3-0 48466 NULL
+compat_SyS_preadv64_48469 compat_SyS_preadv64 3 48469 NULL
+_iwl_dbgfs_bt_tx_prio_write_48473 _iwl_dbgfs_bt_tx_prio_write 3 48473 NULL
++ipath_format_hwerrors_48487 ipath_format_hwerrors 5 48487 NULL
+r8712_usbctrl_vendorreq_48489 r8712_usbctrl_vendorreq 6 48489 NULL
+send_control_msg_48498 send_control_msg 6 48498 NULL
+count_masked_bytes_48507 count_masked_bytes 0-1 48507 NULL
+phantom_get_free_48514 phantom_get_free 0 48514 NULL
+drbd_bm_capacity_48530 drbd_bm_capacity 0 48530 NULL
+raid10_size_48571 raid10_size 0-2-3 48571 NULL
++nvif_notify_init_48578 nvif_notify_init 7 48578 NULL
+llog_data_len_48607 llog_data_len 1 48607 NULL
+do_ip_vs_set_ctl_48641 do_ip_vs_set_ctl 4 48641 NULL
+kernel_sock_ioctl_48644 kernel_sock_ioctl 0 48644 NULL
+mtd_read_48655 mtd_read 0 48655 NULL
+aes_encrypt_packets_read_48666 aes_encrypt_packets_read 3 48666 NULL
+sm501_create_subdev_48668 sm501_create_subdev 3-4 48668 NULL
-+ubi_eba_unmap_leb_48671 ubi_eba_unmap_leb 0 48671 NULL
+hysdn_log_write_48694 hysdn_log_write 3 48694 NULL
+altera_drscan_48698 altera_drscan 2 48698 NULL
+kvm_set_irq_routing_48704 kvm_set_irq_routing 3 48704 NULL
+azx_get_position_48841 azx_get_position 0 48841 NULL
+vc_do_resize_48842 vc_do_resize 3-4 48842 NULL
+suspend_dtim_interval_write_48854 suspend_dtim_interval_write 3 48854 NULL
-+C_SYSC_pwritev64_48864 C_SYSC_pwritev64 3 48864 NULL nohasharray
-+viafb_dvp1_proc_write_48864 viafb_dvp1_proc_write 3 48864 &C_SYSC_pwritev64_48864
++viafb_dvp1_proc_write_48864 viafb_dvp1_proc_write 3 48864 NULL nohasharray
++C_SYSC_pwritev64_48864 C_SYSC_pwritev64 3 48864 &viafb_dvp1_proc_write_48864
+__ffs_ep0_read_events_48868 __ffs_ep0_read_events 3 48868 NULL
+crypto_cipher_ctxsize_48890 crypto_cipher_ctxsize 0 48890 NULL
+joydev_handle_JSIOCSAXMAP_48898 joydev_handle_JSIOCSAXMAP 3 48898 NULL
+__jfs_setxattr_49175 __jfs_setxattr 5 49175 NULL
+ath6kl_bgscan_int_write_49178 ath6kl_bgscan_int_write 3 49178 NULL
+dvb_dvr_ioctl_49182 dvb_dvr_ioctl 2 49182 NULL
-+print_queue_49191 print_queue 4-0 49191 NULL
++print_queue_49191 print_queue 0-4 49191 NULL
++root_nfs_cat_49192 root_nfs_cat 3 49192 NULL
+iwl_dbgfs_ucode_general_stats_read_49199 iwl_dbgfs_ucode_general_stats_read 3 49199 NULL
+il4965_rs_sta_dbgfs_stats_table_read_49206 il4965_rs_sta_dbgfs_stats_table_read 3 49206 NULL
+do_jffs2_getxattr_49210 do_jffs2_getxattr 0 49210 NULL
+viafb_dfph_proc_write_49288 viafb_dfph_proc_write 3 49288 NULL
+uio_read_49300 uio_read 3 49300 NULL
+isku_sysfs_read_keys_macro_49312 isku_sysfs_read_keys_macro 6 49312 NULL
-+SYSC_mincore_49319 SYSC_mincore 1-2 49319 NULL
++SYSC_mincore_49319 SYSC_mincore 2-1 49319 NULL
+fwtty_port_handler_49327 fwtty_port_handler 9 49327 NULL
+srpt_alloc_ioctx_ring_49330 srpt_alloc_ioctx_ring 2-4-3 49330 NULL
+joydev_ioctl_common_49359 joydev_ioctl_common 2 49359 NULL
+__hfsplus_getxattr_49460 __hfsplus_getxattr 0 49460 NULL
+agp_3_5_isochronous_node_enable_49465 agp_3_5_isochronous_node_enable 3 49465 NULL
+xfs_iformat_local_49472 xfs_iformat_local 4 49472 NULL
++tipc_bclink_get_mtu_49483 tipc_bclink_get_mtu 0 49483 NULL
+isr_decrypt_done_read_49490 isr_decrypt_done_read 3 49490 NULL
+iwl_dbgfs_disable_power_off_read_49517 iwl_dbgfs_disable_power_off_read 3 49517 NULL
+SyS_listxattr_49519 SyS_listxattr 3 49519 NULL
+smk_write_access_49561 smk_write_access 3 49561 NULL
+alloc_chunk_49575 alloc_chunk 1 49575 NULL
+sctp_setsockopt_default_send_param_49578 sctp_setsockopt_default_send_param 3 49578 NULL
++readfifo_49583 readfifo 1 49583 NULL
+tap_write_49595 tap_write 3 49595 NULL
+isr_wakeups_read_49607 isr_wakeups_read 3 49607 NULL
+btrfs_mksubvol_49616 btrfs_mksubvol 3 49616 NULL
+smk_write_doi_49621 smk_write_doi 3 49621 NULL
+port_fops_read_49626 port_fops_read 3 49626 NULL
+btrfsic_cmp_log_and_dev_bytenr_49628 btrfsic_cmp_log_and_dev_bytenr 2 49628 NULL
-+__swab32p_49657 __swab32p 0 49657 NULL
-+aa_simple_write_to_buffer_49683 aa_simple_write_to_buffer 4-3 49683 NULL
++aa_simple_write_to_buffer_49683 aa_simple_write_to_buffer 3-4 49683 NULL
+SyS_pwritev_49688 SyS_pwritev 3 49688 NULL
+__copy_from_user_nocheck_49699 __copy_from_user_nocheck 0-3 49699 NULL
+cx2341x_ctrl_new_menu_49700 cx2341x_ctrl_new_menu 3 49700 NULL
+write_pool_49718 write_pool 3 49718 NULL
-+kvm_mmu_notifier_invalidate_page_49723 kvm_mmu_notifier_invalidate_page 3 49723 NULL
++kvm_mmu_notifier_invalidate_page_49723 kvm_mmu_notifier_invalidate_page 3 49723 NULL nohasharray
++sfw_create_test_rpc_49723 sfw_create_test_rpc 4 49723 &kvm_mmu_notifier_invalidate_page_49723
+sep_create_dcb_dmatables_context_kernel_49728 sep_create_dcb_dmatables_context_kernel 6 49728 NULL
+zd_usb_iowrite16v_49744 zd_usb_iowrite16v 3 49744 NULL
+btrfs_chunk_num_stripes_49751 btrfs_chunk_num_stripes 0 49751 NULL
+fuse_wr_pages_49753 fuse_wr_pages 0-1-2 49753 NULL
+key_conf_keylen_read_49758 key_conf_keylen_read 3 49758 NULL
+fuse_conn_waiting_read_49762 fuse_conn_waiting_read 3 49762 NULL
++w83977af_fir_interrupt_49775 w83977af_fir_interrupt 0 49775 NULL
+ceph_osdc_readpages_49789 ceph_osdc_readpages 0 49789 NULL
+nfs4_acl_new_49806 nfs4_acl_new 1 49806 NULL
+__of_parse_phandle_with_args_49807 __of_parse_phandle_with_args 0 49807 NULL
-+ntfs_copy_from_user_iovec_49829 ntfs_copy_from_user_iovec 6-3-0 49829 NULL
++ntfs_copy_from_user_iovec_49829 ntfs_copy_from_user_iovec 3-6-0 49829 NULL
+add_uuid_49831 add_uuid 4 49831 NULL
++iraw_loop_49842 iraw_loop 0-1 49842 NULL
+twl4030_write_49846 twl4030_write 2 49846 NULL
+scsi_dispatch_cmd_entry_49848 scsi_dispatch_cmd_entry 3 49848 NULL
+timeradd_entry_49850 timeradd_entry 3 49850 NULL
+fiemap_count_to_size_49869 fiemap_count_to_size 0-1 49869 NULL
+sctp_setsockopt_bindx_49870 sctp_setsockopt_bindx 3 49870 NULL
+osc_brw_49896 osc_brw 4 49896 NULL
++fuse_send_write_49915 fuse_send_write 4-0 49915 NULL
+ieee80211_if_fmt_dtim_count_49987 ieee80211_if_fmt_dtim_count 3 49987 NULL
+drm_buffer_copy_from_user_49990 drm_buffer_copy_from_user 3 49990 NULL
+l2cap_chan_send_49995 l2cap_chan_send 3 49995 NULL
+ioread8_50049 ioread8 0 50049 NULL
+fuse_conn_max_background_write_50061 fuse_conn_max_background_write 3 50061 NULL
+__kfifo_dma_in_prepare_50081 __kfifo_dma_in_prepare 4 50081 NULL
++dev_set_alias_50084 dev_set_alias 3 50084 NULL
+libcfs_ioctl_popdata_50087 libcfs_ioctl_popdata 3 50087 NULL
+sock_setsockopt_50088 sock_setsockopt 5 50088 NULL
+altera_swap_dr_50090 altera_swap_dr 2 50090 NULL
+rx_filter_ibss_filter_read_50167 rx_filter_ibss_filter_read 3 50167 NULL
+ahd_probe_stack_size_50168 ahd_probe_stack_size 0 50168 NULL
+odev_update_50169 odev_update 2 50169 NULL
-+ieee80211_if_fmt_dot11MeshHWMPRannInterval_50172 ieee80211_if_fmt_dot11MeshHWMPRannInterval 3 50172 NULL nohasharray
-+ubi_resize_volume_50172 ubi_resize_volume 2 50172 &ieee80211_if_fmt_dot11MeshHWMPRannInterval_50172
++ubi_resize_volume_50172 ubi_resize_volume 2 50172 NULL nohasharray
++ieee80211_if_fmt_dot11MeshHWMPRannInterval_50172 ieee80211_if_fmt_dot11MeshHWMPRannInterval 3 50172 &ubi_resize_volume_50172
+cfg80211_roamed_bss_50198 cfg80211_roamed_bss 4-6 50198 NULL
+cyttsp4_probe_50201 cyttsp4_probe 4 50201 NULL
+rx_rx_timeout_wa_read_50204 rx_rx_timeout_wa_read 3 50204 NULL
+validate_acl_mac_addrs_50429 validate_acl_mac_addrs 0 50429 NULL
+btrfs_error_discard_extent_50444 btrfs_error_discard_extent 2 50444 NULL
+pgctrl_write_50453 pgctrl_write 3 50453 NULL
++device_create_sys_dev_entry_50458 device_create_sys_dev_entry 0 50458 NULL
+cfs_size_round_50472 cfs_size_round 0-1 50472 NULL
+cdrom_read_cdda_50478 cdrom_read_cdda 4 50478 NULL
+mei_io_cb_alloc_req_buf_50493 mei_io_cb_alloc_req_buf 2 50493 NULL
+pwr_rcvd_awake_beacons_read_50505 pwr_rcvd_awake_beacons_read 3 50505 NULL
+ath6kl_set_ap_probe_resp_ies_50539 ath6kl_set_ap_probe_resp_ies 3 50539 NULL
++trigger_request_store_50548 trigger_request_store 4 50548 NULL
+usbat_flash_write_data_50553 usbat_flash_write_data 4 50553 NULL
-+self_check_peb_vid_hdr_50563 self_check_peb_vid_hdr 0 50563 NULL
+fat_readpages_50582 fat_readpages 4 50582 NULL
+iwl_dbgfs_missed_beacon_read_50584 iwl_dbgfs_missed_beacon_read 3 50584 NULL
+xillybus_write_50605 xillybus_write 3 50605 NULL
+SetArea_50835 SetArea 4 50835 NULL
+nft_trans_alloc_50836 nft_trans_alloc 3 50836 NULL
+videobuf_dma_init_user_50839 videobuf_dma_init_user 4-3 50839 NULL
-+self_check_write_50856 self_check_write 0 50856 NULL
+carl9170_debugfs_write_50857 carl9170_debugfs_write 3 50857 NULL
+SyS_lgetxattr_50889 SyS_lgetxattr 4 50889 NULL
+netlbl_secattr_catmap_walk_rng_50894 netlbl_secattr_catmap_walk_rng 0-2 50894 NULL
+virtio_cread16_50951 virtio_cread16 0 50951 NULL
+sdio_uart_write_50954 sdio_uart_write 3 50954 NULL
+SyS_setxattr_50957 SyS_setxattr 4 50957 NULL
-+iwl_statistics_flag_50981 iwl_statistics_flag 3-0 50981 NULL
++of_modalias_node_50975 of_modalias_node 3 50975 NULL
++iwl_statistics_flag_50981 iwl_statistics_flag 0-3 50981 NULL
+timeout_write_50991 timeout_write 3 50991 NULL
+proc_write_51003 proc_write 3 51003 NULL
+jbd2_journal_extend_51012 jbd2_journal_extend 2 51012 NULL
+print_devstats_dot11ACKFailureCount_51443 print_devstats_dot11ACKFailureCount 3 51443 NULL
+____alloc_ei_netdev_51475 ____alloc_ei_netdev 1 51475 NULL
+xfs_buf_get_uncached_51477 xfs_buf_get_uncached 2 51477 NULL
++osc_brw_internal_51489 osc_brw_internal 5 51489 NULL
+kvm_fetch_guest_virt_51493 kvm_fetch_guest_virt 4-2 51493 NULL
+ieee80211_if_write_uapsd_queues_51526 ieee80211_if_write_uapsd_queues 3 51526 NULL
+__alloc_eip_netdev_51549 __alloc_eip_netdev 1 51549 NULL
+v9fs_alloc_rdir_buf_51716 v9fs_alloc_rdir_buf 2 51716 NULL
+drm_compat_ioctl_51717 drm_compat_ioctl 2 51717 NULL
+sg_read_oxfer_51724 sg_read_oxfer 3 51724 NULL
++str_read_51731 str_read 4 51731 NULL
+cm4040_read_51732 cm4040_read 3 51732 NULL
+get_user_pages_fast_51751 get_user_pages_fast 0 51751 NULL
+ifx_spi_insert_flip_string_51752 ifx_spi_insert_flip_string 3 51752 NULL
+__tcp_mtu_to_mss_51938 __tcp_mtu_to_mss 0-2 51938 NULL
+xfrm_alg_len_51940 xfrm_alg_len 0 51940 NULL
+scsi_get_vpd_page_51951 scsi_get_vpd_page 4 51951 NULL
++get_clock_info_51952 get_clock_info 4 51952 NULL
+snd_mask_min_51969 snd_mask_min 0 51969 NULL
+get_zone_51981 get_zone 0-1 51981 NULL
+ath6kl_sdio_alloc_prep_scat_req_51986 ath6kl_sdio_alloc_prep_scat_req 2 51986 NULL
++_c4iw_write_mem_dma_51991 _c4iw_write_mem_dma 3 51991 NULL
+dwc3_mode_write_51997 dwc3_mode_write 3 51997 NULL
+skb_copy_datagram_from_iovec_52014 skb_copy_datagram_from_iovec 4-2-5 52014 NULL
+rdmalt_52022 rdmalt 0 52022 NULL
+mxuport_process_read_urb_data_52072 mxuport_process_read_urb_data 3 52072 NULL
+nsm_get_handle_52089 nsm_get_handle 4 52089 NULL
+o2net_debug_read_52105 o2net_debug_read 3 52105 NULL
++smsdvb_stats_read_52114 smsdvb_stats_read 3 52114 NULL
+split_scan_timeout_write_52128 split_scan_timeout_write 3 52128 NULL
+retry_count_read_52129 retry_count_read 3 52129 NULL
+gdm_usb_hci_send_52138 gdm_usb_hci_send 3 52138 NULL
+hysdn_conf_write_52145 hysdn_conf_write 3 52145 NULL
+htable_size_52148 htable_size 0-1 52148 NULL
+smk_write_load2_52155 smk_write_load2 3 52155 NULL
++tipc_node_get_mtu_52157 tipc_node_get_mtu 0 52157 NULL
+ieee80211_if_read_dot11MeshRetryTimeout_52168 ieee80211_if_read_dot11MeshRetryTimeout 3 52168 NULL
+mga_compat_ioctl_52170 mga_compat_ioctl 2 52170 NULL
+print_prefix_52176 print_prefix 0 52176 NULL
+shrink_slab_52261 shrink_slab 2 52261 NULL
+ext2_direct_IO_52270 ext2_direct_IO 4 52270 NULL
+sisusbcon_do_font_op_52271 sisusbcon_do_font_op 9 52271 NULL
++handle_supp_msgs_52284 handle_supp_msgs 4 52284 NULL
++kobject_set_name_vargs_52309 kobject_set_name_vargs 0 52309 NULL
+read_file_reset_52310 read_file_reset 3 52310 NULL
+ssd1307fb_write_52315 ssd1307fb_write 3 52315 NULL
+request_asymmetric_key_52317 request_asymmetric_key 2-4 52317 NULL
+cx25840_ir_rx_read_52724 cx25840_ir_rx_read 3 52724 NULL
+blkcipher_next_slow_52733 blkcipher_next_slow 3-4 52733 NULL
+relay_alloc_page_array_52735 relay_alloc_page_array 1 52735 NULL
++hfcsusb_rx_frame_52745 hfcsusb_rx_frame 3 52745 NULL
+carl9170_debugfs_vif_dump_read_52755 carl9170_debugfs_vif_dump_read 3 52755 NULL
+ieee80211_if_read_beacon_timeout_52756 ieee80211_if_read_beacon_timeout 3 52756 NULL
+nvme_trans_ext_inq_page_52776 nvme_trans_ext_inq_page 3 52776 NULL
++xenvif_write_io_ring_52802 xenvif_write_io_ring 3 52802 NULL
+pwr_rcvd_beacons_read_52836 pwr_rcvd_beacons_read 3 52836 NULL
+lb_alloc_ep_req_52837 lb_alloc_ep_req 2 52837 NULL
+mon_bin_get_event_52863 mon_bin_get_event 4-6 52863 NULL
+twl6030_gpadc_write_52867 twl6030_gpadc_write 1 52867 NULL
++qib_decode_6120_err_52876 qib_decode_6120_err 3 52876 NULL
+twlreg_write_52880 twlreg_write 3 52880 NULL
+pvr2_ctrl_value_to_sym_internal_52881 pvr2_ctrl_value_to_sym_internal 5 52881 NULL
+cache_read_procfs_52882 cache_read_procfs 3 52882 NULL
+dio_bio_reap_52913 dio_bio_reap 0 52913 NULL
+__kfifo_out_peek_r_52919 __kfifo_out_peek_r 3 52919 NULL
+iblock_get_bio_52936 iblock_get_bio 3 52936 NULL
++__nodes_remap_52951 __nodes_remap 5 52951 NULL
+ieee80211_if_fmt_fwded_mcast_52961 ieee80211_if_fmt_fwded_mcast 3 52961 NULL
+tx_tx_exch_read_52986 tx_tx_exch_read 3 52986 NULL
+num_node_state_52989 num_node_state 0 52989 NULL
++efivarfs_file_write_53000 efivarfs_file_write 3 53000 NULL
+btrfs_free_and_pin_reserved_extent_53016 btrfs_free_and_pin_reserved_extent 2 53016 NULL
+tx_tx_exch_pending_read_53018 tx_tx_exch_pending_read 3 53018 NULL
+bio_cur_bytes_53037 bio_cur_bytes 0 53037 NULL
++nv50_chan_create_53039 nv50_chan_create 5 53039 NULL
+regcache_lzo_block_count_53056 regcache_lzo_block_count 0 53056 NULL
+cfi_read_query_53066 cfi_read_query 0 53066 NULL
+iwl_dbgfs_interrupt_write_53069 iwl_dbgfs_interrupt_write 3 53069 NULL
+btree_keys_bytes_53348 btree_keys_bytes 0 53348 NULL
+sock_setbindtodevice_53369 sock_setbindtodevice 3 53369 NULL
+get_random_bytes_arch_53370 get_random_bytes_arch 2 53370 NULL
++test_fw_misc_read_53384 test_fw_misc_read 3 53384 NULL
+isr_cmd_cmplt_read_53439 isr_cmd_cmplt_read 3 53439 NULL
+mwifiex_info_read_53447 mwifiex_info_read 3 53447 NULL
+apei_exec_run_optional_53452 apei_exec_run_optional 0 53452 NULL
+cifs_utf16_bytes_53593 cifs_utf16_bytes 0 53593 NULL
+proc_uid_map_write_53596 proc_uid_map_write 3 53596 NULL
+pfkey_recvmsg_53604 pfkey_recvmsg 4 53604 NULL
-+___alloc_bootmem_nopanic_53626 ___alloc_bootmem_nopanic 1 53626 NULL
++___alloc_bootmem_nopanic_53626 ___alloc_bootmem_nopanic 1 53626 NULL nohasharray
++wil_write_file_txmgmt_53626 wil_write_file_txmgmt 3 53626 &___alloc_bootmem_nopanic_53626
+ccid_getsockopt_builtin_ccids_53634 ccid_getsockopt_builtin_ccids 2 53634 NULL
+nr_sendmsg_53656 nr_sendmsg 4 53656 NULL
+fuse_fill_write_pages_53682 fuse_fill_write_pages 0-4 53682 NULL
+pipeline_dec_packet_out_read_54052 pipeline_dec_packet_out_read 3 54052 NULL
+nl80211_send_disconnected_54056 nl80211_send_disconnected 5 54056 NULL
+rproc_state_read_54057 rproc_state_read 3 54057 NULL
++bitmap_bitremap_54096 bitmap_bitremap 4 54096 NULL
+altera_set_ir_pre_54103 altera_set_ir_pre 2 54103 NULL nohasharray
+lustre_posix_acl_xattr_filter_54103 lustre_posix_acl_xattr_filter 2 54103 &altera_set_ir_pre_54103
+strn_len_54122 strn_len 0 54122 NULL
+__get_free_pages_54352 __get_free_pages 0 54352 NULL
+readlink_copy_54366 readlink_copy 2 54366 NULL
+read_file_credit_dist_stats_54367 read_file_credit_dist_stats 3 54367 NULL
-+do_dccp_setsockopt_54377 do_dccp_setsockopt 5 54377 NULL nohasharray
-+intel_sdvo_write_cmd_54377 intel_sdvo_write_cmd 4 54377 &do_dccp_setsockopt_54377
++intel_sdvo_write_cmd_54377 intel_sdvo_write_cmd 4 54377 NULL nohasharray
++do_dccp_setsockopt_54377 do_dccp_setsockopt 5 54377 &intel_sdvo_write_cmd_54377
+ah_alloc_tmp_54378 ah_alloc_tmp 3-2 54378 NULL
+snd_pcm_oss_read2_54387 snd_pcm_oss_read2 0-3 54387 NULL
+iwl_dbgfs_power_save_status_read_54392 iwl_dbgfs_power_save_status_read 3 54392 NULL
+copy_gadget_strings_54417 copy_gadget_strings 2-3 54417 NULL
+sparse_early_mem_maps_alloc_node_54485 sparse_early_mem_maps_alloc_node 4 54485 NULL
+simple_strtoull_54493 simple_strtoull 0 54493 NULL
++l2cap_create_basic_pdu_54508 l2cap_create_basic_pdu 3 54508 NULL
+btrfs_ordered_sum_size_54509 btrfs_ordered_sum_size 0-2 54509 NULL
+rfc4106_set_key_54519 rfc4106_set_key 3 54519 NULL
+vmci_transport_dgram_enqueue_54525 vmci_transport_dgram_enqueue 4 54525 NULL
+dns_resolver_read_54658 dns_resolver_read 3 54658 NULL
+twl6030_interrupt_mask_54659 twl6030_interrupt_mask 2 54659 NULL
+tdp_page_fault_54663 tdp_page_fault 2 54663 NULL
++bus_add_device_54665 bus_add_device 0 54665 NULL
+cw1200_queue_stats_init_54670 cw1200_queue_stats_init 2 54670 NULL
+bio_kmalloc_54672 bio_kmalloc 2 54672 NULL
+evm_read_key_54674 evm_read_key 3 54674 NULL
+flexcop_device_kmalloc_54793 flexcop_device_kmalloc 1 54793 NULL
+nfsd_write_54809 nfsd_write 6 54809 NULL
+ar9287_dump_modal_eeprom_54814 ar9287_dump_modal_eeprom 3-2 54814 NULL
-+crypto_tfm_ctx_alignment_54815 crypto_tfm_ctx_alignment 0 54815 NULL nohasharray
-+aes_decrypt_fail_read_54815 aes_decrypt_fail_read 3 54815 &crypto_tfm_ctx_alignment_54815 nohasharray
-+kvzalloc_54815 kvzalloc 1 54815 &aes_decrypt_fail_read_54815
++kvzalloc_54815 kvzalloc 1 54815 NULL nohasharray
++crypto_tfm_ctx_alignment_54815 crypto_tfm_ctx_alignment 0 54815 &kvzalloc_54815 nohasharray
++aes_decrypt_fail_read_54815 aes_decrypt_fail_read 3 54815 &crypto_tfm_ctx_alignment_54815
+generic_perform_write_54832 generic_perform_write 3 54832 NULL
+write_rio_54837 write_rio 3 54837 NULL
+ext3_acl_from_disk_54839 ext3_acl_from_disk 2 54839 NULL nohasharray
+printer_read_54851 printer_read 3 54851 NULL
+broadsheet_spiflash_rewrite_sector_54864 broadsheet_spiflash_rewrite_sector 2 54864 NULL
+prism_build_supp_rates_54865 prism_build_supp_rates 0 54865 NULL
-+iscsi_pool_init_54913 iscsi_pool_init 2-4 54913 NULL
++iscsi_pool_init_54913 iscsi_pool_init 2-4 54913 NULL nohasharray
++kobject_set_name_vargs_54913 kobject_set_name_vargs 0 54913 &iscsi_pool_init_54913
+btrfs_stack_chunk_num_stripes_54923 btrfs_stack_chunk_num_stripes 0 54923 NULL
+bio_add_page_54933 bio_add_page 0-3 54933 NULL
+mxms_structlen_54939 mxms_structlen 0 54939 NULL
+add_port_54941 add_port 2 54941 NULL
+tipc_send2name_54946 tipc_send2name 5 54946 NULL
-+ath9k_dump_btcoex_54949 ath9k_dump_btcoex 3-0 54949 NULL
++ath9k_dump_btcoex_54949 ath9k_dump_btcoex 0-3 54949 NULL
+alauda_write_data_54967 alauda_write_data 3 54967 NULL
+c4_add_card_54968 c4_add_card 3 54968 NULL
+ext3_xattr_get_54989 ext3_xattr_get 0 54989 NULL
+efw_transaction_55052 efw_transaction 5-7 55052 NULL
+apei_exec_run_55075 apei_exec_run 0 55075 NULL
+bitmap_storage_alloc_55077 bitmap_storage_alloc 2 55077 NULL
++read_dma_55086 read_dma 3 55086 NULL
+rxpipe_beacon_buffer_thres_host_int_trig_rx_data_read_55106 rxpipe_beacon_buffer_thres_host_int_trig_rx_data_read 3 55106 NULL
+crypto_ahash_setkey_55134 crypto_ahash_setkey 3 55134 NULL
+filldir_55137 filldir 3 55137 NULL
+rx_streaming_interval_read_55291 rx_streaming_interval_read 3 55291 NULL
+lov_get_stripecnt_55297 lov_get_stripecnt 0-3 55297 NULL
+gsm_control_modem_55303 gsm_control_modem 3 55303 NULL
-+compat_SyS_process_vm_readv_55305 compat_SyS_process_vm_readv 3-5 55305 NULL nohasharray
-+qp_alloc_guest_work_55305 qp_alloc_guest_work 5-3 55305 &compat_SyS_process_vm_readv_55305
++wimax_msg_len_55304 wimax_msg_len 0 55304 NULL
++qp_alloc_guest_work_55305 qp_alloc_guest_work 5-3 55305 NULL nohasharray
++compat_SyS_process_vm_readv_55305 compat_SyS_process_vm_readv 3-5 55305 &qp_alloc_guest_work_55305
+compat_SyS_mbind_55329 compat_SyS_mbind 5 55329 NULL
+vme_user_read_55338 vme_user_read 3 55338 NULL
-+sctp_datamsg_from_user_55342 sctp_datamsg_from_user 4 55342 NULL nohasharray
-+__wa_xfer_setup_sizes_55342 __wa_xfer_setup_sizes 0 55342 &sctp_datamsg_from_user_55342
++__wa_xfer_setup_sizes_55342 __wa_xfer_setup_sizes 0 55342 NULL nohasharray
++sctp_datamsg_from_user_55342 sctp_datamsg_from_user 4 55342 &__wa_xfer_setup_sizes_55342
+cw1200_sdio_align_size_55391 cw1200_sdio_align_size 2 55391 NULL
+iwl_dbgfs_plcp_delta_read_55407 iwl_dbgfs_plcp_delta_read 3 55407 NULL
+nouveau_cli_create_55425 nouveau_cli_create 3 55425 NULL
+si476x_radio_read_rds_blckcnt_blob_55427 si476x_radio_read_rds_blckcnt_blob 3 55427 NULL
+__vxge_hw_channel_allocate_55462 __vxge_hw_channel_allocate 3 55462 NULL
+cx23888_ir_rx_read_55473 cx23888_ir_rx_read 3 55473 NULL
++ufshcd_exec_dev_cmd_55479 ufshcd_exec_dev_cmd 0 55479 NULL
+snd_pcm_lib_write_55483 snd_pcm_lib_write 0-3 55483 NULL
+i2o_pool_alloc_55485 i2o_pool_alloc 4 55485 NULL
+batadv_tt_entries_55487 batadv_tt_entries 0-1 55487 NULL
+macvtap_put_user_55609 macvtap_put_user 4 55609 NULL
+selinux_setprocattr_55611 selinux_setprocattr 4 55611 NULL
+edge_tty_recv_55622 edge_tty_recv 3 55622 NULL
-+pktgen_if_write_55628 pktgen_if_write 3 55628 NULL nohasharray
-+reiserfs_xattr_get_55628 reiserfs_xattr_get 0 55628 &pktgen_if_write_55628
++reiserfs_xattr_get_55628 reiserfs_xattr_get 0 55628 NULL nohasharray
++pktgen_if_write_55628 pktgen_if_write 3 55628 &reiserfs_xattr_get_55628
+osc_obd_max_pages_per_rpc_seq_write_55636 osc_obd_max_pages_per_rpc_seq_write 3 55636 NULL
+xfs_bmbt_maxrecs_55649 xfs_bmbt_maxrecs 0-2 55649 NULL
+lpfc_idiag_queinfo_read_55662 lpfc_idiag_queinfo_read 3 55662 NULL
+__iio_allocate_kfifo_55738 __iio_allocate_kfifo 2 55738 NULL
+set_local_name_55757 set_local_name 4 55757 NULL
+ethtool_copy_validate_indir_55769 ethtool_copy_validate_indir 4 55769 NULL
-+strlen_55778 strlen 0 55778 NULL nohasharray
-+is_idx_node_in_tnc_55778 is_idx_node_in_tnc 0 55778 &strlen_55778
++strlen_55778 strlen 0 55778 NULL
+set_spte_55783 set_spte 4-5 55783 NULL
+conf_read_55786 conf_read 3 55786 NULL nohasharray
+req_bio_endio_55786 req_bio_endio 3 55786 &conf_read_55786
+kvm_write_guest_virt_system_55944 kvm_write_guest_virt_system 4-2 55944 NULL
+sel_read_policy_55947 sel_read_policy 3 55947 NULL
+ceph_get_direct_page_vector_55956 ceph_get_direct_page_vector 2 55956 NULL
-+simple_read_from_buffer_55957 simple_read_from_buffer 5-2 55957 NULL
++simple_read_from_buffer_55957 simple_read_from_buffer 5-2-0 55957 NULL
+tx_tx_imm_resp_read_55964 tx_tx_imm_resp_read 3 55964 NULL
+btrfs_clone_55977 btrfs_clone 5-3-6 55977 NULL
+wa_xfer_create_subset_sg_55992 wa_xfer_create_subset_sg 3-2 55992 NULL
+sel_read_handle_status_56139 sel_read_handle_status 3 56139 NULL
+write_file_frameerrors_56145 write_file_frameerrors 3 56145 NULL
+rawv6_setsockopt_56165 rawv6_setsockopt 5 56165 NULL
-+ath9k_dump_legacy_btcoex_56194 ath9k_dump_legacy_btcoex 3-0 56194 NULL
++ath9k_dump_legacy_btcoex_56194 ath9k_dump_legacy_btcoex 0-3 56194 NULL
+vring_add_indirect_56222 vring_add_indirect 4 56222 NULL
+ocfs2_find_xe_in_bucket_56224 ocfs2_find_xe_in_bucket 0 56224 NULL
++ufshcd_query_descriptor_56236 ufshcd_query_descriptor 0 56236 NULL
+do_ipt_set_ctl_56238 do_ipt_set_ctl 4 56238 NULL
+fd_copyin_56247 fd_copyin 3 56247 NULL
+sk_rmem_schedule_56255 sk_rmem_schedule 3 56255 NULL
+iov_iter_copy_from_user_atomic_56368 iov_iter_copy_from_user_atomic 0-4 56368 NULL
+dev_read_56369 dev_read 3 56369 NULL
+ath10k_read_simulate_fw_crash_56371 ath10k_read_simulate_fw_crash 3 56371 NULL
++lnet_ping_56378 lnet_ping 4 56378 NULL
+write_gssp_56404 write_gssp 3 56404 NULL
+ocfs2_control_read_56405 ocfs2_control_read 3 56405 NULL
+store_msg_56417 store_msg 3 56417 NULL
+gather_array_56641 gather_array 3 56641 NULL
+lookup_extent_backref_56644 lookup_extent_backref 9 56644 NULL
+uvc_debugfs_stats_read_56651 uvc_debugfs_stats_read 3 56651 NULL
++nv50_gpio_intr_mask_56665 nv50_gpio_intr_mask 4-3 56665 NULL
+tg3_nvram_write_block_56666 tg3_nvram_write_block 3 56666 NULL
+snd_gus_dram_read_56686 snd_gus_dram_read 4 56686 NULL
+dvb_ringbuffer_read_user_56702 dvb_ringbuffer_read_user 3-0 56702 NULL
++sfw_alloc_pages_56709 sfw_alloc_pages 3 56709 NULL
+sta_flags_read_56710 sta_flags_read 3 56710 NULL
+ipv6_getsockopt_sticky_56711 ipv6_getsockopt_sticky 5 56711 NULL
+__wa_xfer_setup_segs_56725 __wa_xfer_setup_segs 2 56725 NULL
+ext3_xattr_ibody_get_56880 ext3_xattr_ibody_get 0 56880 NULL
+pvr2_debugifc_print_status_56890 pvr2_debugifc_print_status 3 56890 NULL
+debug_debug3_read_56894 debug_debug3_read 3 56894 NULL
-+batadv_tt_update_changes_56895 batadv_tt_update_changes 3 56895 NULL nohasharray
-+le_auto_conn_write_56895 le_auto_conn_write 3 56895 &batadv_tt_update_changes_56895
++le_auto_conn_write_56895 le_auto_conn_write 3 56895 NULL nohasharray
++batadv_tt_update_changes_56895 batadv_tt_update_changes 3 56895 &le_auto_conn_write_56895
+hfsplus_find_cat_56899 hfsplus_find_cat 0 56899 NULL
++strcspn_56913 strcspn 0 56913 NULL
+__kfifo_out_56927 __kfifo_out 0-3 56927 NULL
+journal_init_revoke_56933 journal_init_revoke 2 56933 NULL
+nouveau_xtensa_create__56952 nouveau_xtensa_create_ 8 56952 NULL
+diva_get_driver_info_56967 diva_get_driver_info 0 56967 NULL
++sptlrpc_secflags2str_56995 sptlrpc_secflags2str 3 56995 NULL
+vlsi_alloc_ring_57003 vlsi_alloc_ring 3-4 57003 NULL
+btrfs_super_csum_size_57004 btrfs_super_csum_size 0 57004 NULL
+aircable_process_packet_57027 aircable_process_packet 4 57027 NULL
-+ieee80211_if_fmt_state_57043 ieee80211_if_fmt_state 3 57043 NULL
++ieee80211_if_fmt_state_57043 ieee80211_if_fmt_state 3 57043 NULL nohasharray
++skb_network_offset_57043 skb_network_offset 0 57043 &ieee80211_if_fmt_state_57043
+bytes_to_samples_57049 bytes_to_samples 0-2 57049 NULL
+xfs_buf_read_map_57053 xfs_buf_read_map 3 57053 NULL
+cx2341x_ctrl_new_std_57061 cx2341x_ctrl_new_std 4 57061 NULL
+sca3000_read_data_57064 sca3000_read_data 4 57064 NULL
+pcmcia_replace_cis_57066 pcmcia_replace_cis 3 57066 NULL
+tracing_set_trace_write_57096 tracing_set_trace_write 3 57096 NULL
++altera_get_note_57099 altera_get_note 6 57099 NULL
+hpfs_readpages_57106 hpfs_readpages 4 57106 NULL
+crypto_compress_ctxsize_57109 crypto_compress_ctxsize 0 57109 NULL
+cipso_v4_gentag_loc_57119 cipso_v4_gentag_loc 0 57119 NULL
+nl80211_send_deauth_57136 nl80211_send_deauth 4 57136 &rds_ib_sub_signaled_57136
+snd_sonicvibes_getdmac_57140 snd_sonicvibes_getdmac 0 57140 NULL
+_iwl_dbgfs_bf_params_write_57141 _iwl_dbgfs_bf_params_write 3 57141 NULL
++acpi_gsb_i2c_read_bytes_57145 acpi_gsb_i2c_read_bytes 4 57145 NULL
+udl_prime_create_57159 udl_prime_create 2 57159 NULL
+stk_prepare_sio_buffers_57168 stk_prepare_sio_buffers 2 57168 NULL
+rx_hw_stuck_read_57179 rx_hw_stuck_read 3 57179 NULL
+hash_netnet6_expire_57191 hash_netnet6_expire 4 57191 NULL
+tt3650_ci_msg_57219 tt3650_ci_msg 4 57219 NULL
+dma_fifo_alloc_57236 dma_fifo_alloc 2-3-5 57236 NULL
++drbg_blocklen_57239 drbg_blocklen 0 57239 NULL
+rsxx_cram_write_57244 rsxx_cram_write 3 57244 NULL
+ieee80211_if_fmt_tsf_57249 ieee80211_if_fmt_tsf 3 57249 NULL
+oprofilefs_ulong_from_user_57251 oprofilefs_ulong_from_user 3 57251 NULL
+lbs_sleepparams_write_57283 lbs_sleepparams_write 3 57283 NULL
+pstore_file_read_57288 pstore_file_read 3 57288 NULL
+snd_pcm_read_57289 snd_pcm_read 3 57289 NULL
++string_length_no_trail_57290 string_length_no_trail 0-2 57290 NULL
+ftdi_elan_write_57309 ftdi_elan_write 3 57309 NULL
+write_file_regval_57313 write_file_regval 3 57313 NULL
+__mxt_write_reg_57326 __mxt_write_reg 3 57326 NULL
+acpi_dev_get_resources_57534 acpi_dev_get_resources 0 57534 NULL
+ptlrpc_lprocfs_hp_ratio_seq_write_57537 ptlrpc_lprocfs_hp_ratio_seq_write 3 57537 NULL
+compat_SyS_process_vm_writev_57542 compat_SyS_process_vm_writev 3-5 57542 NULL
++ReadHDLCPnP_57559 ReadHDLCPnP 0 57559 NULL
+snd_pcm_playback_ioctl1_57569 snd_pcm_playback_ioctl1 0 57569 NULL
+get_bridge_ifindices_57579 get_bridge_ifindices 0 57579 NULL
+ldlm_cli_enqueue_local_57582 ldlm_cli_enqueue_local 11 57582 NULL
+r3964_write_57662 r3964_write 4 57662 NULL
+proc_ns_readlink_57664 proc_ns_readlink 3 57664 NULL
+__lgwrite_57669 __lgwrite 4 57669 NULL
++f1x_match_to_this_node_57695 f1x_match_to_this_node 3 57695 NULL
+i2400m_rx_stats_read_57706 i2400m_rx_stats_read 3 57706 NULL
+ieee80211_if_read_dot11MeshHWMPconfirmationInterval_57722 ieee80211_if_read_dot11MeshHWMPconfirmationInterval 3 57722 NULL
+pppol2tp_recvmsg_57742 pppol2tp_recvmsg 4 57742 NULL
+iio_read_first_n_kfifo_57910 iio_read_first_n_kfifo 2 57910 NULL
+ll_xattr_find_get_lock_57912 ll_xattr_find_get_lock 0 57912 NULL
+memcg_caches_array_size_57918 memcg_caches_array_size 0-1 57918 NULL
++mwifiex_hscfg_read_57920 mwifiex_hscfg_read 3 57920 NULL
+twl_i2c_write_57923 twl_i2c_write 3-4 57923 NULL
+__snd_gf1_look16_57925 __snd_gf1_look16 0 57925 NULL
+sel_read_handle_unknown_57933 sel_read_handle_unknown 3 57933 NULL
+ocfs2_find_leaf_58065 ocfs2_find_leaf 0 58065 NULL
+dt3155_alloc_coherent_58073 dt3155_alloc_coherent 2 58073 NULL
+cm4040_write_58079 cm4040_write 3 58079 NULL
++savemem_58129 savemem 3 58129 NULL
+ipv6_flowlabel_opt_58135 ipv6_flowlabel_opt 3 58135 NULL nohasharray
+slhc_init_58135 slhc_init 1-2 58135 &ipv6_flowlabel_opt_58135
+garmin_write_bulk_58191 garmin_write_bulk 3 58191 NULL
+profile_load_58267 profile_load 3 58267 NULL
+kstrtos8_from_user_58268 kstrtos8_from_user 2 58268 NULL
+acpi_ds_build_internal_package_obj_58271 acpi_ds_build_internal_package_obj 3 58271 NULL
++r100_mm_rreg_58276 r100_mm_rreg 0 58276 NULL
+iscsi_decode_text_input_58292 iscsi_decode_text_input 4 58292 NULL
+ieee80211_if_read_dot11MeshTTL_58307 ieee80211_if_read_dot11MeshTTL 3 58307 NULL
++mic_virtio_copy_from_user_58323 mic_virtio_copy_from_user 3 58323 NULL
+tx_tx_start_int_templates_read_58324 tx_tx_start_int_templates_read 3 58324 NULL
++lstcon_rpc_prep_58325 lstcon_rpc_prep 4 58325 NULL
+ext4_ext_truncate_extend_restart_58331 ext4_ext_truncate_extend_restart 3 58331 NULL
+__copy_from_user_swizzled_58337 __copy_from_user_swizzled 2-4 58337 NULL
+brcmf_debugfs_sdio_counter_read_58369 brcmf_debugfs_sdio_counter_read 3 58369 NULL
+snd_rme96_capture_copy_58484 snd_rme96_capture_copy 5 58484 NULL
+btrfs_cont_expand_58498 btrfs_cont_expand 2-3 58498 NULL
+tcf_hash_create_58507 tcf_hash_create 4 58507 NULL
++cifs_write_from_iter_58526 cifs_write_from_iter 2 58526 NULL
+rndis_add_response_58544 rndis_add_response 2 58544 NULL
+wep_decrypt_fail_read_58567 wep_decrypt_fail_read 3 58567 NULL
+scnprint_mac_oui_58578 scnprint_mac_oui 3-0 58578 NULL
+cur_wm_latency_write_58581 cur_wm_latency_write 3 58581 NULL
++get_rhf_errstring_58582 get_rhf_errstring 3 58582 NULL
+ea_read_inline_58589 ea_read_inline 0 58589 NULL
+isku_sysfs_read_keys_thumbster_58590 isku_sysfs_read_keys_thumbster 6 58590 NULL
+xip_file_read_58592 xip_file_read 3 58592 NULL
+find_zero_58685 find_zero 0-1 58685 NULL
+uwb_bce_print_IEs_58686 uwb_bce_print_IEs 4 58686 NULL
+tps6586x_writes_58689 tps6586x_writes 2-3 58689 NULL
++visor_charqueue_create_58703 visor_charqueue_create 1 58703 NULL
+vx_send_msg_58711 vx_send_msg 0 58711 NULL
+csum_exist_in_range_58730 csum_exist_in_range 2-3 58730 NULL
+frames_to_bytes_58741 frames_to_bytes 0-2 58741 NULL
+crypto_aead_reqsize_59039 crypto_aead_reqsize 0 59039 NULL
+regmap_bulk_write_59049 regmap_bulk_write 2-4 59049 NULL
+mmc_sd_num_wr_blocks_59112 mmc_sd_num_wr_blocks 0 59112 NULL
-+sta_tx_latency_stat_table_59122 sta_tx_latency_stat_table 5-4-0 59122 NULL nohasharray
++sta_tx_latency_stat_table_59122 sta_tx_latency_stat_table 0-4-5 59122 NULL nohasharray
+scsi_io_completion_59122 scsi_io_completion 2 59122 &sta_tx_latency_stat_table_59122
+nfc_llcp_send_i_frame_59130 nfc_llcp_send_i_frame 3 59130 NULL
+framebuffer_alloc_59145 framebuffer_alloc 1 59145 NULL nohasharray
+setup_window_59178 setup_window 4-2-5-7 59178 NULL
+ocfs2_move_extent_59187 ocfs2_move_extent 2-5 59187 NULL
+xfs_iext_realloc_indirect_59211 xfs_iext_realloc_indirect 2 59211 NULL
++check_mapped_selector_name_59216 check_mapped_selector_name 5 59216 NULL
+dt3155_read_59226 dt3155_read 3 59226 NULL
-+paging64_gpte_to_gfn_lvl_59229 paging64_gpte_to_gfn_lvl 0-2-1 59229 NULL
++paging64_gpte_to_gfn_lvl_59229 paging64_gpte_to_gfn_lvl 0-1-2 59229 NULL
+nla_len_59258 nla_len 0 59258 NULL
+drbd_bm_write_page_59290 drbd_bm_write_page 2 59290 NULL
+btrfs_insert_dir_item_59304 btrfs_insert_dir_item 4 59304 NULL
+fd_copyout_59323 fd_copyout 3 59323 NULL
+rx_defrag_in_process_called_read_59338 rx_defrag_in_process_called_read 3 59338 NULL
+xfs_attrmulti_attr_set_59346 xfs_attrmulti_attr_set 4 59346 NULL
++__map_request_59350 __map_request 0 59350 NULL
++SyS_getrandom_59366 SyS_getrandom 2 59366 NULL
+f2fs_fallocate_59377 f2fs_fallocate 4-3 59377 NULL
+pvr2_debugifc_print_info_59380 pvr2_debugifc_print_info 3 59380 NULL
+journal_init_dev_59384 journal_init_dev 5 59384 NULL
+tunables_write_59563 tunables_write 3 59563 NULL
+bio_split_59564 bio_split 2 59564 NULL
+__copy_from_user_ll_nozero_59571 __copy_from_user_ll_nozero 0-3 59571 NULL
++write_pbl_59583 write_pbl 4 59583 NULL
+memdup_user_59590 memdup_user 2 59590 NULL
+mem_fwlog_free_mem_blks_read_59616 mem_fwlog_free_mem_blks_read 3 59616 NULL nohasharray
+xrcdn_free_res_59616 xrcdn_free_res 5 59616 &mem_fwlog_free_mem_blks_read_59616
+ld_usb_read_60156 ld_usb_read 3 60156 NULL
+jmb38x_ms_count_slots_60164 jmb38x_ms_count_slots 0 60164 NULL
+init_state_60165 init_state 2 60165 NULL
-+sg_build_sgat_60179 sg_build_sgat 3 60179 NULL nohasharray
-+jffs2_alloc_full_dirent_60179 jffs2_alloc_full_dirent 1 60179 &sg_build_sgat_60179
++jffs2_alloc_full_dirent_60179 jffs2_alloc_full_dirent 1 60179 NULL nohasharray
++sg_build_sgat_60179 sg_build_sgat 3 60179 &jffs2_alloc_full_dirent_60179
+fuse_async_req_send_60183 fuse_async_req_send 0-3 60183 NULL
+rx_rx_tkip_replays_read_60193 rx_rx_tkip_replays_read 3 60193 NULL
+qib_reg_phys_mr_60202 qib_reg_phys_mr 3 60202 NULL
+bch_subtract_dirty_60306 bch_subtract_dirty 3-4 60306 NULL
+usb_alphatrack_write_60341 usb_alphatrack_write 3 60341 NULL
+__kfifo_from_user_r_60345 __kfifo_from_user_r 5-3 60345 NULL
++max_unfragmented_pages_60362 max_unfragmented_pages 0 60362 NULL
+dccp_setsockopt_60367 dccp_setsockopt 5 60367 NULL
-+ubi_eba_atomic_leb_change_60379 ubi_eba_atomic_leb_change 0 60379 NULL
+mthca_alloc_resize_buf_60394 mthca_alloc_resize_buf 3 60394 NULL
+ocfs2_zero_extend_60396 ocfs2_zero_extend 3 60396 NULL
+driver_names_read_60399 driver_names_read 3 60399 NULL
+opticon_write_60775 opticon_write 4 60775 NULL
+acl_alloc_num_60778 acl_alloc_num 1-2 60778 NULL
+snd_pcm_oss_readv3_60792 snd_pcm_oss_readv3 3 60792 NULL
++nvif_object_init_60848 nvif_object_init 6 60848 NULL
+pwr_tx_with_ps_read_60851 pwr_tx_with_ps_read 3 60851 NULL
+alloc_buf_60864 alloc_buf 3-2 60864 NULL
+generic_writepages_60871 generic_writepages 0 60871 NULL
-+ubifs_read_one_lp_60882 ubifs_read_one_lp 0 60882 NULL
+ext4_update_inline_data_60888 ext4_update_inline_data 3 60888 NULL
+iio_debugfs_read_reg_60908 iio_debugfs_read_reg 3 60908 NULL
+libcfs_sock_ioctl_60915 libcfs_sock_ioctl 0 60915 NULL
+lpfc_idiag_queacc_write_61043 lpfc_idiag_queacc_write 3 61043 NULL
+symtab_init_61050 symtab_init 2 61050 NULL
+fuse_send_write_61053 fuse_send_write 0-4 61053 NULL
-+bitmap_scnlistprintf_61062 bitmap_scnlistprintf 2-0 61062 NULL
++bitmap_scnlistprintf_61062 bitmap_scnlistprintf 0-2 61062 NULL
+ahash_align_buffer_size_61070 ahash_align_buffer_size 0-1-2 61070 NULL
+get_derived_key_61100 get_derived_key 4 61100 NULL
+i40e_calculate_l2fpm_size_61104 i40e_calculate_l2fpm_size 0-4-3-2-1 61104 NULL
+dio_bio_add_page_61178 dio_bio_add_page 0 61178 NULL
+SyS_prctl_61202 SyS_prctl 4 61202 NULL
+srp_create_fr_pool_61207 srp_create_fr_pool 3 61207 NULL
++arch_hibernation_header_save_61212 arch_hibernation_header_save 0 61212 NULL
+smk_read_ambient_61220 smk_read_ambient 3 61220 NULL
+v9fs_mmap_file_read_61262 v9fs_mmap_file_read 3 61262 NULL
-+btrfs_bio_alloc_61270 btrfs_bio_alloc 3 61270 NULL nohasharray
-+find_get_pages_tag_61270 find_get_pages_tag 0 61270 &btrfs_bio_alloc_61270
++find_get_pages_tag_61270 find_get_pages_tag 0 61270 NULL nohasharray
++btrfs_bio_alloc_61270 btrfs_bio_alloc 3 61270 &find_get_pages_tag_61270 nohasharray
++ifalias_store_61270 ifalias_store 4 61270 &btrfs_bio_alloc_61270
+hfsplus_getxattr_finder_info_61283 hfsplus_getxattr_finder_info 0 61283 NULL nohasharray
+vortex_adbdma_getlinearpos_61283 vortex_adbdma_getlinearpos 0 61283 &hfsplus_getxattr_finder_info_61283
+nvme_trans_copy_to_user_61288 nvme_trans_copy_to_user 3 61288 NULL
+xfrm_user_sec_ctx_size_61320 xfrm_user_sec_ctx_size 0 61320 NULL
+C_SYSC_msgsnd_61330 C_SYSC_msgsnd 3 61330 NULL
+write_file_spectral_short_repeat_61335 write_file_spectral_short_repeat 3 61335 NULL
-+st5481_setup_isocpipes_61340 st5481_setup_isocpipes 4-6 61340 NULL
++st5481_setup_isocpipes_61340 st5481_setup_isocpipes 6-4 61340 NULL
+rx_rx_wa_ba_not_expected_read_61341 rx_rx_wa_ba_not_expected_read 3 61341 NULL
+__dm_get_reserved_ios_61342 __dm_get_reserved_ios 0-3-2 61342 NULL
++f1x_map_sysaddr_to_csrow_61344 f1x_map_sysaddr_to_csrow 2 61344 NULL
+debug_debug4_read_61367 debug_debug4_read 3 61367 NULL
+system_enable_write_61396 system_enable_write 3 61396 NULL
+unix_stream_sendmsg_61455 unix_stream_sendmsg 4 61455 NULL
+snd_pcm_lib_writev_transfer_61483 snd_pcm_lib_writev_transfer 5-4-2 61483 NULL
+btrfs_item_size_61485 btrfs_item_size 0 61485 NULL
+erst_errno_61526 erst_errno 0 61526 NULL
++proc_write_device_61541 proc_write_device 3 61541 NULL
+compat_SyS_select_61542 compat_SyS_select 1 61542 NULL
+trace_options_core_write_61551 trace_options_core_write 3 61551 NULL
+dvb_net_ioctl_61559 dvb_net_ioctl 2 61559 NULL
++parport_pc_fifo_write_block_dma_61568 parport_pc_fifo_write_block_dma 3 61568 NULL
+fan_proc_write_61569 fan_proc_write 3 61569 NULL
+ieee80211_if_read_rc_rateidx_mask_2ghz_61570 ieee80211_if_read_rc_rateidx_mask_2ghz 3 61570 NULL
+ldlm_pool_rw_atomic_seq_write_61572 ldlm_pool_rw_atomic_seq_write 3 61572 NULL
+seq_open_private_61589 seq_open_private 3 61589 NULL
-+ept_gpte_to_gfn_lvl_61591 ept_gpte_to_gfn_lvl 0-2-1 61591 NULL
++ept_gpte_to_gfn_lvl_61591 ept_gpte_to_gfn_lvl 0-1-2 61591 NULL
+netlink_recvmsg_61600 netlink_recvmsg 4 61600 NULL
+nfs4_init_uniform_client_string_61601 nfs4_init_uniform_client_string 3 61601 NULL
+configfs_write_file_61621 configfs_write_file 3 61621 NULL
+resize_stripes_61650 resize_stripes 2 61650 NULL
+ttm_page_pool_free_61661 ttm_page_pool_free 2-0 61661 NULL
+insert_one_name_61668 insert_one_name 7 61668 NULL
++qib_format_hwmsg_61679 qib_format_hwmsg 2 61679 NULL
+lock_loop_61681 lock_loop 1 61681 NULL
+filter_read_61692 filter_read 3 61692 NULL
+iov_length_61716 iov_length 0 61716 NULL
+get_fw_name_61874 get_fw_name 3 61874 NULL
+btrfs_ioctl_clone_61886 btrfs_ioctl_clone 3-4-5 61886 NULL
+lprocfs_write_frac_u64_helper_61897 lprocfs_write_frac_u64_helper 2 61897 NULL
++clear_refs_write_61904 clear_refs_write 3 61904 NULL
++kernfs_name_61910 kernfs_name 3 61910 NULL
+rx_filter_arp_filter_read_61914 rx_filter_arp_filter_read 3 61914 NULL
+au0828_init_isoc_61917 au0828_init_isoc 3-2-4 61917 NULL
+sctp_sendmsg_61919 sctp_sendmsg 4 61919 NULL
++SyS_kexec_load_61946 SyS_kexec_load 2 61946 NULL
+il4965_ucode_rx_stats_read_61948 il4965_ucode_rx_stats_read 3 61948 NULL
+squashfs_read_id_index_table_61961 squashfs_read_id_index_table 4 61961 NULL
+fix_read_error_61965 fix_read_error 4 61965 NULL
++fd_locked_ioctl_61978 fd_locked_ioctl 3 61978 NULL
+cow_file_range_61979 cow_file_range 3 61979 NULL
+dequeue_event_62000 dequeue_event 3 62000 NULL
+xt_compat_match_offset_62011 xt_compat_match_offset 0 62011 NULL
+ip_recv_error_62117 ip_recv_error 3 62117 NULL
+generic_block_fiemap_62122 generic_block_fiemap 4 62122 NULL
+llc_ui_header_len_62131 llc_ui_header_len 0 62131 NULL
-+qib_diag_write_62133 qib_diag_write 3 62133 NULL
-+ql_status_62135 ql_status 5 62135 NULL
++qib_diag_write_62133 qib_diag_write 3 62133 NULL nohasharray
++kobject_add_varg_62133 kobject_add_varg 0 62133 &qib_diag_write_62133
++ql_status_62135 ql_status 5 62135 NULL nohasharray
++device_add_attrs_62135 device_add_attrs 0 62135 &ql_status_62135
+video_usercopy_62151 video_usercopy 2 62151 NULL
+SyS_getxattr_62166 SyS_getxattr 4 62166 NULL
+prism54_wpa_bss_ie_get_62173 prism54_wpa_bss_ie_get 0 62173 NULL
+write_file_dfs_62180 write_file_dfs 3 62180 NULL
+alloc_upcall_62186 alloc_upcall 2 62186 NULL
++rounded_hashtable_size_62198 rounded_hashtable_size 0 62198 NULL
+sock_kmalloc_62205 sock_kmalloc 2 62205 NULL
+smk_read_syslog_62227 smk_read_syslog 3 62227 NULL
+SYSC_setgroups16_62232 SYSC_setgroups16 1 62232 NULL
+ion_handle_test_dma_62262 ion_handle_test_dma 4-5 62262 NULL
++get_random_int_62279 get_random_int 0 62279 NULL
+il_dbgfs_sram_read_62296 il_dbgfs_sram_read 3 62296 NULL
+sparse_early_usemaps_alloc_pgdat_section_62304 sparse_early_usemaps_alloc_pgdat_section 2 62304 NULL
+subsystem_filter_read_62310 subsystem_filter_read 3 62310 NULL
+altera_irscan_62396 altera_irscan 2 62396 NULL
+set_ssp_62411 set_ssp 4 62411 NULL
+tracing_saved_cmdlines_size_read_62491 tracing_saved_cmdlines_size_read 3 62491 NULL
++srpc_alloc_bulk_62522 srpc_alloc_bulk 2 62522 NULL
+pep_sendmsg_62524 pep_sendmsg 4 62524 NULL
+test_iso_queue_62534 test_iso_queue 5 62534 NULL
+debugfs_read_62535 debugfs_read 3 62535 NULL
+sco_sock_sendmsg_62542 sco_sock_sendmsg 4 62542 NULL
+qib_refresh_qsfp_cache_62547 qib_refresh_qsfp_cache 0 62547 NULL
+xfrm_user_policy_62573 xfrm_user_policy 4 62573 NULL
++compat_SyS_rt_sigpending_62580 compat_SyS_rt_sigpending 2 62580 NULL
+get_subdir_62581 get_subdir 3 62581 NULL
+dut_mode_write_62630 dut_mode_write 3 62630 NULL
+vfs_fsync_range_62635 vfs_fsync_range 0 62635 NULL
+lpfc_sli4_queue_alloc_62646 lpfc_sli4_queue_alloc 3 62646 NULL
+printer_req_alloc_62687 printer_req_alloc 2 62687 NULL
++ieee80211_set_probe_resp_62700 ieee80211_set_probe_resp 3 62700 NULL
+bioset_integrity_create_62708 bioset_integrity_create 2 62708 NULL
+gfs2_log_write_62717 gfs2_log_write 3 62717 NULL
+rdm_62719 rdm 0 62719 NULL
+lov_verify_lmm_62747 lov_verify_lmm 2 62747 NULL
+mwifiex_rdeeprom_write_62754 mwifiex_rdeeprom_write 3 62754 NULL
+mxt_obj_instances_62764 mxt_obj_instances 0 62764 NULL
-+copy_page_to_iter_iovec_62770 copy_page_to_iter_iovec 3-0 62770 NULL nohasharray
++copy_page_to_iter_iovec_62770 copy_page_to_iter_iovec 0-3 62770 NULL nohasharray
+ax25_sendmsg_62770 ax25_sendmsg 4 62770 ©_page_to_iter_iovec_62770
+C_SYSC_ipc_62776 C_SYSC_ipc 3 62776 NULL
++ptlrpc_req_set_repsize_62784 ptlrpc_req_set_repsize 2 62784 NULL
+SyS_sched_getaffinity_62786 SyS_sched_getaffinity 2 62786 NULL
+dm_stats_account_io_62787 dm_stats_account_io 3 62787 NULL
+tracing_total_entries_read_62817 tracing_total_entries_read 3 62817 NULL
+getdqbuf_62908 getdqbuf 1 62908 NULL
+ll_statahead_agl_seq_write_62928 ll_statahead_agl_seq_write 3 62928 NULL
+agp_create_user_memory_62955 agp_create_user_memory 1 62955 NULL
++nvif_object_mthd_62960 nvif_object_mthd 4 62960 NULL
+hwdep_read_62992 hwdep_read 3 62992 NULL
+kstrtoull_from_user_63026 kstrtoull_from_user 2 63026 NULL
+__vb2_perform_fileio_63033 __vb2_perform_fileio 3 63033 NULL
+sep_prepare_input_output_dma_table_in_dcb_63087 sep_prepare_input_output_dma_table_in_dcb 4-5 63087 NULL
+iwl_dbgfs_sensitivity_read_63116 iwl_dbgfs_sensitivity_read 3 63116 NULL
+ext4_chunk_trans_blocks_63123 ext4_chunk_trans_blocks 0-2 63123 NULL
-+ubifs_change_one_lp_63157 ubifs_change_one_lp 0 63157 NULL
++iwl_mvm_coex_dump_mbox_63153 iwl_mvm_coex_dump_mbox 4-3-0 63153 NULL
+smk_write_revoke_subj_63173 smk_write_revoke_subj 3 63173 NULL
+SyS_syslog_63178 SyS_syslog 3 63178 NULL
+vme_master_read_63221 vme_master_read 0 63221 NULL
+nfsd_vfs_read_63307 nfsd_vfs_read 5 63307 NULL
+ath10k_read_fw_dbglog_63323 ath10k_read_fw_dbglog 3 63323 NULL
+proc_info_read_63344 proc_info_read 3 63344 NULL
++nvif_device_new_63358 nvif_device_new 5 63358 NULL
+ps_upsd_max_sptime_read_63362 ps_upsd_max_sptime_read 3 63362 NULL
+idmouse_read_63374 idmouse_read 3 63374 NULL
+edac_pci_alloc_ctl_info_63388 edac_pci_alloc_ctl_info 1 63388 NULL nohasharray
+si5351_bulk_write_63468 si5351_bulk_write 2-3 63468 NULL
+snd_info_entry_write_63474 snd_info_entry_write 3 63474 NULL
+reada_find_extent_63486 reada_find_extent 2 63486 NULL
++read_kcore_63488 read_kcore 3 63488 NULL
+iwl_dbgfs_bcast_filters_read_63489 iwl_dbgfs_bcast_filters_read 3 63489 NULL
+snd_pcm_plug_write_transfer_63503 snd_pcm_plug_write_transfer 0-3 63503 NULL
+efx_mcdi_rpc_async_63529 efx_mcdi_rpc_async 4-5 63529 NULL
+regmap_multi_reg_write_63826 regmap_multi_reg_write 3 63826 NULL
+sel_write_load_63830 sel_write_load 3 63830 NULL
+proc_pid_attr_write_63845 proc_pid_attr_write 3 63845 NULL
++nv10_gpio_intr_mask_63862 nv10_gpio_intr_mask 4-3 63862 NULL
+xhci_alloc_stream_info_63902 xhci_alloc_stream_info 3 63902 NULL
+uvc_alloc_urb_buffers_63922 uvc_alloc_urb_buffers 0-2-3 63922 NULL
+snd_compr_write_63923 snd_compr_write 3 63923 NULL
+init_bch_64130 init_bch 1-2 64130 NULL
+ablkcipher_copy_iv_64140 ablkcipher_copy_iv 3 64140 NULL
+dlfb_ops_write_64150 dlfb_ops_write 3 64150 NULL
++number_of_tds_64156 number_of_tds 0 64156 NULL
+bnx2x_vf_mcast_64166 bnx2x_vf_mcast 4 64166 NULL
+cpumask_scnprintf_64170 cpumask_scnprintf 0-2 64170 NULL
+kernfs_iop_setxattr_64220 kernfs_iop_setxattr 4 64220 NULL
+read_pulse_64227 read_pulse 0-3 64227 NULL
+ea_len_64229 ea_len 0 64229 NULL
+io_capture_transfer_64276 io_capture_transfer 4 64276 NULL
-+btrfs_file_extent_offset_64278 btrfs_file_extent_offset 0 64278 NULL
++btrfs_file_extent_offset_64278 btrfs_file_extent_offset 0 64278 NULL nohasharray
++bpf_check_classic_64278 bpf_check_classic 2 64278 &btrfs_file_extent_offset_64278
+sta_current_tx_rate_read_64286 sta_current_tx_rate_read 3 64286 NULL
-+event_id_read_64288 event_id_read 3 64288 NULL nohasharray
-+xfs_dir_cilookup_result_64288 xfs_dir_cilookup_result 3 64288 &event_id_read_64288
++xfs_dir_cilookup_result_64288 xfs_dir_cilookup_result 3 64288 NULL nohasharray
++event_id_read_64288 event_id_read 3 64288 &xfs_dir_cilookup_result_64288
++info_debugfs_read_64291 info_debugfs_read 3 64291 NULL
+ocfs2_block_check_validate_bhs_64302 ocfs2_block_check_validate_bhs 0 64302 NULL
+snd_hda_get_sub_nodes_64304 snd_hda_get_sub_nodes 0 64304 NULL
+error_error_bar_retry_read_64305 error_error_bar_retry_read 3 64305 NULL
+fanotify_write_64623 fanotify_write 3 64623 NULL
+_iwl_dbgfs_d0i3_refs_write_64642 _iwl_dbgfs_d0i3_refs_write 3 64642 NULL
+regmap_read_debugfs_64658 regmap_read_debugfs 5 64658 NULL
-+tlbflush_read_file_64661 tlbflush_read_file 3 64661 NULL nohasharray
-+ocfs2_read_xattr_block_64661 ocfs2_read_xattr_block 0 64661 &tlbflush_read_file_64661
++ocfs2_read_xattr_block_64661 ocfs2_read_xattr_block 0 64661 NULL nohasharray
++tlbflush_read_file_64661 tlbflush_read_file 3 64661 &ocfs2_read_xattr_block_64661
+efx_tsoh_get_buffer_64664 efx_tsoh_get_buffer 3 64664 NULL
+rx_rx_out_of_mpdu_nodes_read_64668 rx_rx_out_of_mpdu_nodes_read 3 64668 NULL
+nr_free_zone_pages_64680 nr_free_zone_pages 0 64680 NULL
+proc_projid_map_write_64810 proc_projid_map_write 3 64810 NULL
+megaraid_change_queue_depth_64815 megaraid_change_queue_depth 2 64815 NULL
+ecryptfs_send_miscdev_64816 ecryptfs_send_miscdev 2 64816 NULL
++do_kimage_alloc_64827 do_kimage_alloc 3 64827 NULL
+altera_set_dr_pre_64862 altera_set_dr_pre 2 64862 NULL
+pci_vc_do_save_buffer_64876 pci_vc_do_save_buffer 0 64876 NULL
+lprocfs_write_u64_helper_64880 lprocfs_write_u64_helper 2 64880 NULL
+suspend_dtim_interval_read_64971 suspend_dtim_interval_read 3 64971 NULL
+crypto_ahash_digestsize_65014 crypto_ahash_digestsize 0 65014 NULL
+insert_dent_65034 insert_dent 7 65034 NULL
++snd_hda_get_pin_label_65035 snd_hda_get_pin_label 5 65035 NULL
+ext4_ind_trans_blocks_65053 ext4_ind_trans_blocks 0-2 65053 NULL
-+make_idx_node_65068 make_idx_node 0 65068 NULL
++pcibios_enable_device_65059 pcibios_enable_device 0 65059 NULL
+__alloc_bootmem_node_high_65076 __alloc_bootmem_node_high 2 65076 NULL
+batadv_socket_write_65083 batadv_socket_write 3 65083 NULL
+ocfs2_truncate_cluster_pages_65086 ocfs2_truncate_cluster_pages 2 65086 NULL
-+ath9k_dump_mci_btcoex_65090 ath9k_dump_mci_btcoex 3-0 65090 NULL
++ath9k_dump_mci_btcoex_65090 ath9k_dump_mci_btcoex 0-3 65090 NULL
+rx_rx_done_read_65217 rx_rx_done_read 3 65217 NULL
+nouveau_event_create_65229 nouveau_event_create 2-1 65229 NULL
-+print_endpoint_stat_65232 print_endpoint_stat 3-4-0 65232 NULL
++print_endpoint_stat_65232 print_endpoint_stat 0-4-3 65232 NULL
+whci_n_caps_65247 whci_n_caps 0 65247 NULL
+kmalloc_parameter_65279 kmalloc_parameter 1 65279 NULL
+compat_core_sys_select_65285 compat_core_sys_select 1 65285 NULL
+SyS_writev_65372 SyS_writev 3 65372 NULL
+__alloc_bootmem_nopanic_65397 __alloc_bootmem_nopanic 1 65397 NULL
+trace_seq_to_user_65398 trace_seq_to_user 3 65398 NULL
++__read_vmcore_65402 __read_vmcore 2 65402 NULL
+ocfs2_write_begin_nolock_65410 ocfs2_write_begin_nolock 3-4 65410 NULL
++device_add_groups_65423 device_add_groups 0 65423 NULL
+xpc_kzalloc_cacheline_aligned_65433 xpc_kzalloc_cacheline_aligned 1 65433 NULL
+usb_alloc_coherent_65444 usb_alloc_coherent 2 65444 NULL
+il_dbgfs_wd_timeout_write_65464 il_dbgfs_wd_timeout_write 3 65464 NULL
0; \
})
+diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
+index 714b949..1f0dc1e 100644
+--- a/virt/kvm/iommu.c
++++ b/virt/kvm/iommu.c
+@@ -43,13 +43,13 @@ static void kvm_iommu_put_pages(struct kvm *kvm,
+ gfn_t base_gfn, unsigned long npages);
+
+ static pfn_t kvm_pin_pages(struct kvm_memory_slot *slot, gfn_t gfn,
+- unsigned long size)
++ unsigned long npages)
+ {
+ gfn_t end_gfn;
+ pfn_t pfn;
+
+ pfn = gfn_to_pfn_memslot(slot, gfn);
+- end_gfn = gfn + (size >> PAGE_SHIFT);
++ end_gfn = gfn + npages;
+ gfn += 1;
+
+ if (is_error_noslot_pfn(pfn))
+@@ -119,7 +119,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
+ * Pin all pages we are about to map in memory. This is
+ * important because we unmap and unpin in 4kb steps later.
+ */
+- pfn = kvm_pin_pages(slot, gfn, page_size);
++ pfn = kvm_pin_pages(slot, gfn, page_size >> PAGE_SHIFT);
+ if (is_error_noslot_pfn(pfn)) {
+ gfn += 1;
+ continue;
+@@ -131,7 +131,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
+ if (r) {
+ printk(KERN_ERR "kvm_iommu_map_address:"
+ "iommu failed to map pfn=%llx\n", pfn);
+- kvm_unpin_pages(kvm, pfn, page_size);
++ kvm_unpin_pages(kvm, pfn, page_size >> PAGE_SHIFT);
+ goto unmap_pages;
+ }
+
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
-index 4b6c01b..16eb755 100644
+index 95519bc..43f5d42 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -76,12 +76,17 @@ LIST_HEAD(vm_list);
struct dentry *kvm_debugfs_dir;
-@@ -761,7 +766,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
+@@ -763,7 +768,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
/* We can read the guest memory with __xxx_user() later on. */
if ((mem->slot < KVM_USER_MEM_SLOTS) &&
((mem->userspace_addr & (PAGE_SIZE - 1)) ||
(void __user *)(unsigned long)mem->userspace_addr,
mem->memory_size)))
goto out;
-@@ -1618,9 +1623,17 @@ EXPORT_SYMBOL_GPL(kvm_read_guest_cached);
+@@ -1620,9 +1625,17 @@ EXPORT_SYMBOL_GPL(kvm_read_guest_cached);
int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len)
{
}
EXPORT_SYMBOL_GPL(kvm_clear_guest_page);
-@@ -1870,7 +1883,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)
+@@ -1872,7 +1885,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)
return 0;
}
.release = kvm_vcpu_release,
.unlocked_ioctl = kvm_vcpu_ioctl,
#ifdef CONFIG_COMPAT
-@@ -2540,7 +2553,7 @@ out:
+@@ -2573,7 +2586,7 @@ out:
}
#endif
.release = kvm_vm_release,
.unlocked_ioctl = kvm_vm_ioctl,
#ifdef CONFIG_COMPAT
-@@ -2640,7 +2653,7 @@ out:
+@@ -2646,7 +2659,7 @@ out:
return r;
}
.unlocked_ioctl = kvm_dev_ioctl,
.compat_ioctl = kvm_dev_ioctl,
.llseek = noop_llseek,
-@@ -2666,7 +2679,7 @@ static void hardware_enable_nolock(void *junk)
+@@ -2672,7 +2685,7 @@ static void hardware_enable_nolock(void *junk)
if (r) {
cpumask_clear_cpu(cpu, cpus_hardware_enabled);
printk(KERN_INFO "kvm: enabling virtualization on "
"CPU%d failed\n", cpu);
}
-@@ -2722,10 +2735,10 @@ static int hardware_enable_all(void)
+@@ -2728,10 +2741,10 @@ static int hardware_enable_all(void)
kvm_usage_count++;
if (kvm_usage_count == 1) {
hardware_disable_all_nolock();
r = -EBUSY;
}
-@@ -3130,7 +3143,7 @@ static void kvm_sched_out(struct preempt_notifier *pn,
+@@ -3136,7 +3149,7 @@ static void kvm_sched_out(struct preempt_notifier *pn,
kvm_arch_vcpu_put(vcpu);
}
struct module *module)
{
int r;
-@@ -3177,7 +3190,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
+@@ -3183,7 +3196,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
if (!vcpu_align)
vcpu_align = __alignof__(struct kvm_vcpu);
kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, vcpu_align,
if (!kvm_vcpu_cache) {
r = -ENOMEM;
goto out_free_3;
-@@ -3187,9 +3200,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
+@@ -3193,9 +3206,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
if (r)
goto out_free;
r = misc_register(&kvm_dev);
if (r) {
-@@ -3199,9 +3214,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
+@@ -3205,9 +3220,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
register_syscore_ops(&kvm_syscore_ops);