Skip to content
  1. Jan 20, 2018
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.15-8' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 4917d5df
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "More than we'd like after rc8, but nothing very alarming either, just
        tying up loose ends before the release:
      
        Since we changed powernv to use cpufreq_get() from show_cpuinfo(), we
        see warnings with PREEMPT enabled. But the preempt_disable() in
        show_cpuinfo() doesn't actually prevent CPU hotplug as it suggests, so
        remove it.
      
        Two updates to the recently merged RFI flush code. Wire up the generic
        sysfs file to report the status, and add a debugfs file to allow
        enabling/disabling it at runtime.
      
        Two updates to xmon, one to add the RFI flush related fields to the
        paca dump, and another to not use hashed pointers in the paca dump.
      
        And one minor fix to add a missing include of linux/types.h in
        asm/hvcall.h, not seen to break the build in upstream, but correct
        anyway.
      
        Thanks to: Benjamin Herrenschmidt, Michal Suchanek, Nicholas Piggin"
      
      * tag 'powerpc-4.15-8' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/pseries: include linux/types.h in asm/hvcall.h
        powerpc/64s: Allow control of RFI flush via debugfs
        powerpc/64s: Wire up cpu_show_meltdown()
        powerpc: Don't preempt_disable() in show_cpuinfo()
        powerpc/xmon: Don't print hashed pointers in paca dump
        powerpc/xmon: Add RFI flush related fields to paca dump
      4917d5df
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.15-rc9' of git://people.freedesktop.org/~airlied/linux · 9abc9378
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Nouveau, i915, vmwgfx and sun4i regression fixes.
      
        The i915 change fixes a display corruption problem introduced in 4.15,
        the nouveau changes are for regressions in 4.15, one of the vmwgfx
        fixes goes back a little further, the other is a 4.15 regression fix,
        the 3 sun4i changes fix blank HDMI output on those devices"
      
      * tag 'drm-fixes-for-v4.15-rc9' of git://people.freedesktop.org/~airlied/linux:
        drm/nouveau/mmu/mcp77: fix regressions in stolen memory handling
        drm/nouveau/bar/gk20a: Avoid bar teardown during init
        drm/nouveau/drm/nouveau: Pass the proper arguments to nvif_object_map_handle()
        drm/vmwgfx: fix memory corruption with legacy/sou connectors
        drm/vmwgfx: Fix a boot time warning
        drm/i915: Fix deadlock in i830_disable_pipe()
        drm/i915: Redo plane sanitation during readout
        drm/i915: Add .get_hw_state() method for planes
        drm/sun4i: hdmi: Add missing rate halving check in sun4i_tmds_determine_rate
        drm/sun4i: hdmi: Fix incorrect assignment in sun4i_tmds_determine_rate
        drm/sun4i: hdmi: Check for unset best_parent in sun4i_tmds_determine_rate
      9abc9378
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · d342740e
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "6 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        sparse doesn't support struct randomization
        proc: fix coredump vs read /proc/*/stat race
        scripts/gdb/linux/tasks.py: fix get_thread_info
        scripts/decodecode: fix decoding for AArch64 (arm64) instructions
        mm/page_owner.c: remove drain_all_pages from init_early_allocated_pages
        mm/memory.c: release locked page in do_swap_page()
      d342740e
    • Matthew Wilcox's avatar
      ia64: Rewrite atomic_add and atomic_sub · 4b664e73
      Matthew Wilcox authored
      
      
      Force __builtin_constant_p to evaluate whether the argument to atomic_add
      & atomic_sub is constant in the front-end before optimisations which
      can lead GCC to output a call to __bad_increment_for_ia64_fetch_and_add().
      
      See GCC bugzilla 83653.
      
      Signed-off-by: default avatarJakub Jelinek <jakub@redhat.com>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4b664e73
    • Matthew Wilcox's avatar
      sparse doesn't support struct randomization · a3d6c976
      Matthew Wilcox authored
      Without this patch, I drown in a sea of unknown attribute warnings
      
      Link: http://lkml.kernel.org/r/20180117024539.27354-1-willy@infradead.org
      
      
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a3d6c976
    • Alexey Dobriyan's avatar
      proc: fix coredump vs read /proc/*/stat race · 8bb2ee19
      Alexey Dobriyan authored
      do_task_stat() accesses IP and SP of a task without bumping reference
      count of a stack (which became an entity with independent lifetime at
      some point).
      
      Steps to reproduce:
      
          #include <stdio.h>
          #include <sys/types.h>
          #include <sys/stat.h>
          #include <fcntl.h>
          #include <sys/time.h>
          #include <sys/resource.h>
          #include <unistd.h>
          #include <sys/wait.h>
      
          int main(void)
          {
          	setrlimit(RLIMIT_CORE, &(struct rlimit){});
      
          	while (1) {
          		char buf[64];
          		char buf2[4096];
          		pid_t pid;
          		int fd;
      
          		pid = fork();
          		if (pid == 0) {
          			*(volatile int *)0 = 0;
          		}
      
          		snprintf(buf, sizeof(buf), "/proc/%u/stat", pid);
          		fd = open(buf, O_RDONLY);
          		read(fd, buf2, sizeof(buf2));
          		close(fd);
      
          		waitpid(pid, NULL, 0);
          	}
          	return 0;
          }
      
          BUG: unable to handle kernel paging request at 0000000000003fd8
          IP: do_task_stat+0x8b4/0xaf0
          PGD 800000003d73e067 P4D 800000003d73e067 PUD 3d558067 PMD 0
          Oops: 0000 [#1] PREEMPT SMP PTI
          CPU: 0 PID: 1417 Comm: a.out Not tainted 4.15.0-rc8-dirty #2
          Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1.fc27 04/01/2014
          RIP: 0010:do_task_stat+0x8b4/0xaf0
          Call Trace:
           proc_single_show+0x43/0x70
           seq_read+0xe6/0x3b0
           __vfs_read+0x1e/0x120
           vfs_read+0x84/0x110
           SyS_read+0x3d/0xa0
           entry_SYSCALL_64_fastpath+0x13/0x6c
          RIP: 0033:0x7f4d7928cba0
          RSP: 002b:00007ffddb245158 EFLAGS: 00000246
          Code: 03 b7 a0 01 00 00 4c 8b 4c 24 70 4c 8b 44 24 78 4c 89 74 24 18 e9 91 f9 ff ff f6 45 4d 02 0f 84 fd f7 ff ff 48 8b 45 40 48 89 ef <48> 8b 80 d8 3f 00 00 48 89 44 24 20 e8 9b 97 eb ff 48 89 44 24
          RIP: do_task_stat+0x8b4/0xaf0 RSP: ffffc90000607cc8
          CR2: 0000000000003fd8
      
      John Ogness said: for my tests I added an else case to verify that the
      race is hit and correctly mitigated.
      
      Link: http://lkml.kernel.org/r/20180116175054.GA11513@avx2
      
      
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Reported-by: default avatar"Kohli, Gaurav" <gkohli@codeaurora.org>
      Tested-by: default avatarJohn Ogness <john.ogness@linutronix.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8bb2ee19
    • Xi Kangjie's avatar
      scripts/gdb/linux/tasks.py: fix get_thread_info · 883d50f5
      Xi Kangjie authored
      Since kernel 4.9, the thread_info has been moved into task_struct, no
      longer locates at the bottom of kernel stack.
      
      See commits c65eacbe ("sched/core: Allow putting thread_info into
      task_struct") and 15f4eae7 ("x86: Move thread_info into
      task_struct").
      
      Before fix:
        (gdb) set $current = $lx_current()
        (gdb) p $lx_thread_info($current)
        $1 = {flags = 1470918301}
        (gdb) p $current.thread_info
        $2 = {flags = 2147483648}
      
      After fix:
        (gdb) p $lx_thread_info($current)
        $1 = {flags = 2147483648}
        (gdb) p $current.thread_info
        $2 = {flags = 2147483648}
      
      Link: http://lkml.kernel.org/r/20180118210159.17223-1-imxikangjie@gmail.com
      Fixes: 15f4eae7
      
       ("x86: Move thread_info into task_struct")
      Signed-off-by: default avatarXi Kangjie <imxikangjie@gmail.com>
      Acked-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Acked-by: default avatarKieran Bingham <kbingham@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      883d50f5
    • Will Deacon's avatar
      scripts/decodecode: fix decoding for AArch64 (arm64) instructions · be9fa663
      Will Deacon authored
      There are a couple of problems with the decodecode script and arm64:
      
      1. AArch64 objdump refuses to disassemble .4byte directives as instructions,
         insisting that they are data values and displaying them as:
      
      	a94153f3	.word	0xa94153f3		<-- trapping instruction
      
         This is resolved by using the .inst directive instead.
      
      2. Disassembly of branch instructions attempts to provide the target as
         an offset from a symbol, e.g.:
      
         0:	34000082	cbz	w2, 10 <.text+0x10>
      
        however this falls foul of the grep -v, which matches lines containing
        ".text" and ends up removing all branch instructions from the dump.
      
      This patch resolves both issues by using the .inst directive for 4-byte
      quantities on arm64 and stripping the resulting binaries (as is done on
      arm already) to remove the mapping symbols.
      
      Link: http://lkml.kernel.org/r/1506596147-23630-1-git-send-email-will.deacon@arm.com
      
      
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Reviewed-by: default avatarDave Martin <Dave.Martin@arm.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      be9fa663
    • Oscar Salvador's avatar
      mm/page_owner.c: remove drain_all_pages from init_early_allocated_pages · 6bec6ad7
      Oscar Salvador authored
      When setting page_owner = on, the following warning can be seen in the
      boot log:
      
        WARNING: CPU: 0 PID: 0 at mm/page_alloc.c:2537 drain_all_pages+0x171/0x1a0
        Modules linked in:
        CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.15.0-rc7-next-20180109-1-default+ #7
        Hardware name: Dell Inc. Latitude E7470/0T6HHJ, BIOS 1.11.3 11/09/2016
        RIP: 0010:drain_all_pages+0x171/0x1a0
        Call Trace:
          init_page_owner+0x4e/0x260
          start_kernel+0x3e6/0x4a6
          ? set_init_arg+0x55/0x55
          secondary_startup_64+0xa5/0xb0
        Code: c5 ed ff 89 df 48 c7 c6 20 3b 71 82 e8 f9 4b 52 00 3b 05 d7 0b f8 00 89 c3 72 d5 5b 5d 41 5
      
      This warning is shown because we are calling drain_all_pages() in
      init_early_allocated_pages(), but mm_percpu_wq is not up yet, it is being
      set up later on in kernel_init_freeable() -> init_mm_internals().
      
      Link: http://lkml.kernel.org/r/20180109153921.GA13070@techadventures.net
      
      
      Signed-off-by: default avatarOscar Salvador <osalvador@techadventures.net>
      Acked-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Ayush Mittal <ayush.m@samsung.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6bec6ad7
    • Minchan Kim's avatar
      mm/memory.c: release locked page in do_swap_page() · f8020772
      Minchan Kim authored
      James reported a bug in swap paging-in from his testing.  It is that
      do_swap_page doesn't release locked page so system hang-up happens due
      to a deadlock on PG_locked.
      
      It was introduced by 0bcac06f ("mm, swap: skip swapcache for swapin
      of synchronous device") because I missed swap cache hit places to update
      swapcache variable to work well with other logics against swapcache in
      do_swap_page.
      
      This patch fixes it.
      
      Debugged by James Bottomley.
      
      Link: http://lkml.kernel.org/r/<1514407817.4169.4.camel@HansenPartnership.com>
      Link: http://lkml.kernel.org/r/20180102235606.GA19438@bbox
      
      
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Reported-by: default avatarJames Bottomley <James.Bottomley@hansenpartnership.com>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f8020772
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 726ba84b
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix BPF divides by zero, from Eric Dumazet and Alexei Starovoitov.
      
       2) Reject stores into bpf context via st and xadd, from Daniel
          Borkmann.
      
       3) Fix a memory leak in TUN, from Cong Wang.
      
       4) Disable RX aggregation on a specific troublesome configuration of
          r8152 in a Dell TB16b dock.
      
       5) Fix sw_ctx leak in tls, from Sabrina Dubroca.
      
       6) Fix program replacement in cls_bpf, from Daniel Borkmann.
      
       7) Fix uninitialized station_info structures in cfg80211, from Johannes
          Berg.
      
       8) Fix miscalculation of transport header offset field in flow
          dissector, from Eric Dumazet.
      
       9) Fix LPM tree leak on failure in mlxsw driver, from Ido Schimmel.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (29 commits)
        ibmvnic: Fix IPv6 packet descriptors
        ibmvnic: Fix IP offload control buffer
        ipv6: don't let tb6_root node share routes with other node
        ip6_gre: init dev->mtu and dev->hard_header_len correctly
        mlxsw: spectrum_router: Free LPM tree upon failure
        flow_dissector: properly cap thoff field
        fm10k: mark PM functions as __maybe_unused
        cfg80211: fix station info handling bugs
        netlink: reset extack earlier in netlink_rcv_skb
        can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once
        can: af_can: can_rcv(): replace WARN_ONCE by pr_warn_once
        bpf: mark dst unknown on inconsistent {s, u}bounds adjustments
        bpf: fix cls_bpf on filter replace
        Net: ethernet: ti: netcp: Fix inbound ping crash if MTU size is greater than 1500
        tls: reset crypto_info when do_tls_setsockopt_tx fails
        tls: return -EBUSY if crypto_info is already set
        tls: fix sw_ctx leak
        net/tls: Only attach to sockets in ESTABLISHED state
        net: fs_enet: do not call phy_stop() in interrupts
        r8152: disable RX aggregation on Dell TB16 dock
        ...
      726ba84b
  2. Jan 19, 2018
  3. Jan 18, 2018
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 7155f8f3
      David S. Miller authored
      
      
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2018-01-18
      
      The following pull-request contains BPF updates for your *net* tree.
      
      The main changes are:
      
      1) Fix a divide by zero due to wrong if (src_reg == 0) check in
         64-bit mode. Properly handle this in interpreter and mask it
         also generically in verifier to guard against similar checks
         in JITs, from Eric and Alexei.
      
      2) Fix a bug in arm64 JIT when tail calls are involved and progs
         have different stack sizes, from Daniel.
      
      3) Reject stores into BPF context that are not expected BPF_STX |
         BPF_MEM variant, from Daniel.
      
      4) Mark dst reg as unknown on {s,u}bounds adjustments when the
         src reg has derived bounds from dead branches, from Daniel.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7155f8f3
    • Marc Kleine-Budde's avatar
      can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once · d4689846
      Marc Kleine-Budde authored
      
      
      If an invalid CANFD frame is received, from a driver or from a tun
      interface, a Kernel warning is generated.
      
      This patch replaces the WARN_ONCE by a simple pr_warn_once, so that a
      kernel, bootet with panic_on_warn, does not panic. A printk seems to be
      more appropriate here.
      
      Reported-by: default avatar <syzbot+e3b775f40babeff6e68b@syzkaller.appspotmail.com>
      Suggested-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      d4689846
    • Marc Kleine-Budde's avatar
      can: af_can: can_rcv(): replace WARN_ONCE by pr_warn_once · 8cb68751
      Marc Kleine-Budde authored
      
      
      If an invalid CAN frame is received, from a driver or from a tun
      interface, a Kernel warning is generated.
      
      This patch replaces the WARN_ONCE by a simple pr_warn_once, so that a
      kernel, bootet with panic_on_warn, does not panic. A printk seems to be
      more appropriate here.
      
      Reported-by: default avatar <syzbot+4386709c0c1284dca827@syzkaller.appspotmail.com>
      Suggested-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      8cb68751
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2018-01-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 75f195f4
      Dave Airlie authored
      Final 4.15 drm-misc pull:
      
      Just 3 sun4i patches to fix clock computation/checks.
      
      * tag 'drm-misc-fixes-2018-01-17' of git://anongit.freedesktop.org/drm/drm-misc:
        drm/sun4i: hdmi: Add missing rate halving check in sun4i_tmds_determine_rate
        drm/sun4i: hdmi: Fix incorrect assignment in sun4i_tmds_determine_rate
        drm/sun4i: hdmi: Check for unset best_parent in sun4i_tmds_determine_rate
      75f195f4
    • Dave Airlie's avatar
      Merge branch 'vmwgfx-fixes-4.15' of git://people.freedesktop.org/~thomash/linux into drm-fixes · 894219d7
      Dave Airlie authored
      Last minute fixes for vmwgfx.
      One fix for a drm helper warning introduced in 4.15
      One important fix for a longer standing memory corruption issue on older
      hardware versions.
      
      * 'vmwgfx-fixes-4.15' of git://people.freedesktop.org/~thomash/linux:
        drm/vmwgfx: fix memory corruption with legacy/sou connectors
        drm/vmwgfx: Fix a boot time warning
      894219d7
    • Daniel Borkmann's avatar
      bpf: mark dst unknown on inconsistent {s, u}bounds adjustments · 6f16101e
      Daniel Borkmann authored
      
      
      syzkaller generated a BPF proglet and triggered a warning with
      the following:
      
        0: (b7) r0 = 0
        1: (d5) if r0 s<= 0x0 goto pc+0
         R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0
        2: (1f) r0 -= r1
         R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0
        verifier internal error: known but bad sbounds
      
      What happens is that in the first insn, r0's min/max value
      are both 0 due to the immediate assignment, later in the jsle
      test the bounds are updated for the min value in the false
      path, meaning, they yield smin_val = 1, smax_val = 0, and when
      ctx pointer is subtracted from r0, verifier bails out with the
      internal error and throwing a WARN since smin_val != smax_val
      for the known constant.
      
      For min_val > max_val scenario it means that reg_set_min_max()
      and reg_set_min_max_inv() (which both refine existing bounds)
      demonstrated that such branch cannot be taken at runtime.
      
      In above scenario for the case where it will be taken, the
      existing [0, 0] bounds are kept intact. Meaning, the rejection
      is not due to a verifier internal error, and therefore the
      WARN() is not necessary either.
      
      We could just reject such cases in adjust_{ptr,scalar}_min_max_vals()
      when either known scalars have smin_val != smax_val or
      umin_val != umax_val or any scalar reg with bounds
      smin_val > smax_val or umin_val > umax_val. However, there
      may be a small risk of breakage of buggy programs, so handle
      this more gracefully and in adjust_{ptr,scalar}_min_max_vals()
      just taint the dst reg as unknown scalar when we see ops with
      such kind of src reg.
      
      Reported-by: default avatar <syzbot+6d362cadd45dc0a12ba4@syzkaller.appspotmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      6f16101e
    • Daniel Borkmann's avatar
      bpf: fix cls_bpf on filter replace · ad9294db
      Daniel Borkmann authored
      Running the following sequence is currently broken:
      
        # tc qdisc add dev foo clsact
        # tc filter replace dev foo ingress prio 1 handle 1 bpf da obj bar.o
        # tc filter replace dev foo ingress prio 1 handle 1 bpf da obj bar.o
        RTNETLINK answers: Invalid argument
      
      The normal expectation on kernel side is that the second command
      succeeds replacing the existing program. However, what happens is
      in cls_bpf_change(), we bail out with err in the second run in
      cls_bpf_offload(). The EINVAL comes directly in cls_bpf_offload()
      when comparing prog vs oldprog's gen_flags. In case of above
      replace the new prog's gen_flags are 0, but the old ones are 8,
      which means TCA_CLS_FLAGS_NOT_IN_HW is set (e.g. drivers not having
      cls_bpf offload).
      
      Fix 102740bd ("cls_bpf: fix offload assumptions after callback
      conversion") in the following way: gen_flags from user space passed
      down via netlink cannot include status flags like TCA_CLS_FLAGS_IN_HW
      or TCA_CLS_FLAGS_NOT_IN_HW as opposed to oldprog that we previously
      loaded. Therefore, it doesn't make any sense to include them in the
      gen_flags comparison with the new prog before we even attempt to
      offload. Thus, lets fix this before 4.15 goes out.
      
      Fixes: 102740bd
      
       ("cls_bpf: fix offload assumptions after callback conversion")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad9294db
    • Rex Chang's avatar
      Net: ethernet: ti: netcp: Fix inbound ping crash if MTU size is greater than 1500 · 5a717843
      Rex Chang authored
      
      
      In the receive queue for 4096 bytes fragments, the page address
      set in the SW data0 field of the descriptor is not the one we got
      when doing the reassembly in receive. The page structure was retrieved
      from the wrong descriptor into SW data0 which is then causing a
      page fault when UDP checksum is accessing data above 1500.
      
      Signed-off-by: default avatarRex Chang <rchang@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a717843
    • Sabrina Dubroca's avatar
      tls: reset crypto_info when do_tls_setsockopt_tx fails · 6db959c8
      Sabrina Dubroca authored
      The current code copies directly from userspace to ctx->crypto_send, but
      doesn't always reinitialize it to 0 on failure. This causes any
      subsequent attempt to use this setsockopt to fail because of the
      TLS_CRYPTO_INFO_READY check, eventhough crypto_info is not actually
      ready.
      
      This should result in a correctly set up socket after the 3rd call, but
      currently it does not:
      
          size_t s = sizeof(struct tls12_crypto_info_aes_gcm_128);
          struct tls12_crypto_info_aes_gcm_128 crypto_good = {
              .info.version = TLS_1_2_VERSION,
              .info.cipher_type = TLS_CIPHER_AES_GCM_128,
          };
      
          struct tls12_crypto_info_aes_gcm_128 crypto_bad_type = crypto_good;
          crypto_bad_type.info.cipher_type = 42;
      
          setsockopt(sock, SOL_TLS, TLS_TX, &crypto_bad_type, s);
          setsockopt(sock, SOL_TLS, TLS_TX, &crypto_good, s - 1);
          setsockopt(sock, SOL_TLS, TLS_TX, &crypto_good, s);
      
      Fixes: 3c4d7559
      
       ("tls: kernel TLS support")
      Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6db959c8