1. 10 12月, 2019 1 次提交
    • P
      netfilter: nf_flow_table_offload: Correct memcpy size for flow_overload_mangle() · 7acd9378
      Pablo Neira Ayuso 提交于
      In function 'memcpy',
           inlined from 'flow_offload_mangle' at net/netfilter/nf_flow_table_offload.c:112:2,
           inlined from 'flow_offload_port_dnat' at net/netfilter/nf_flow_table_offload.c:373:2,
           inlined from 'nf_flow_rule_route_ipv4' at net/netfilter/nf_flow_table_offload.c:424:3:
      ./include/linux/string.h:376:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
         376 |    __read_overflow2();
             |    ^~~~~~~~~~~~~~~~~~
      
      The original u8* was done in the hope to make this more adaptable but
      consensus is to keep this like it is in tc pedit.
      
      Fixes: c29f74e0 ("netfilter: nf_flow_table: hardware offload support")
      Reported-by: NLaura Abbott <labbott@redhat.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      7acd9378
  2. 09 12月, 2019 7 次提交
    • E
      netfilter: bridge: make sure to pull arp header in br_nf_forward_arp() · 56042858
      Eric Dumazet 提交于
      syzbot is kind enough to remind us we need to call skb_may_pull()
      
      BUG: KMSAN: uninit-value in br_nf_forward_arp+0xe61/0x1230 net/bridge/br_netfilter_hooks.c:665
      CPU: 1 PID: 11631 Comm: syz-executor.1 Not tainted 5.4.0-rc8-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       <IRQ>
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x1c9/0x220 lib/dump_stack.c:118
       kmsan_report+0x128/0x220 mm/kmsan/kmsan_report.c:108
       __msan_warning+0x64/0xc0 mm/kmsan/kmsan_instr.c:245
       br_nf_forward_arp+0xe61/0x1230 net/bridge/br_netfilter_hooks.c:665
       nf_hook_entry_hookfn include/linux/netfilter.h:135 [inline]
       nf_hook_slow+0x18b/0x3f0 net/netfilter/core.c:512
       nf_hook include/linux/netfilter.h:260 [inline]
       NF_HOOK include/linux/netfilter.h:303 [inline]
       __br_forward+0x78f/0xe30 net/bridge/br_forward.c:109
       br_flood+0xef0/0xfe0 net/bridge/br_forward.c:234
       br_handle_frame_finish+0x1a77/0x1c20 net/bridge/br_input.c:162
       nf_hook_bridge_pre net/bridge/br_input.c:245 [inline]
       br_handle_frame+0xfb6/0x1eb0 net/bridge/br_input.c:348
       __netif_receive_skb_core+0x20b9/0x51a0 net/core/dev.c:4830
       __netif_receive_skb_one_core net/core/dev.c:4927 [inline]
       __netif_receive_skb net/core/dev.c:5043 [inline]
       process_backlog+0x610/0x13c0 net/core/dev.c:5874
       napi_poll net/core/dev.c:6311 [inline]
       net_rx_action+0x7a6/0x1aa0 net/core/dev.c:6379
       __do_softirq+0x4a1/0x83a kernel/softirq.c:293
       do_softirq_own_stack+0x49/0x80 arch/x86/entry/entry_64.S:1091
       </IRQ>
       do_softirq kernel/softirq.c:338 [inline]
       __local_bh_enable_ip+0x184/0x1d0 kernel/softirq.c:190
       local_bh_enable+0x36/0x40 include/linux/bottom_half.h:32
       rcu_read_unlock_bh include/linux/rcupdate.h:688 [inline]
       __dev_queue_xmit+0x38e8/0x4200 net/core/dev.c:3819
       dev_queue_xmit+0x4b/0x60 net/core/dev.c:3825
       packet_snd net/packet/af_packet.c:2959 [inline]
       packet_sendmsg+0x8234/0x9100 net/packet/af_packet.c:2984
       sock_sendmsg_nosec net/socket.c:637 [inline]
       sock_sendmsg net/socket.c:657 [inline]
       __sys_sendto+0xc44/0xc70 net/socket.c:1952
       __do_sys_sendto net/socket.c:1964 [inline]
       __se_sys_sendto+0x107/0x130 net/socket.c:1960
       __x64_sys_sendto+0x6e/0x90 net/socket.c:1960
       do_syscall_64+0xb6/0x160 arch/x86/entry/common.c:291
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      RIP: 0033:0x45a679
      Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
      RSP: 002b:00007f0a3c9e5c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
      RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 000000000045a679
      RDX: 000000000000000e RSI: 0000000020000200 RDI: 0000000000000003
      RBP: 000000000075bf20 R08: 00000000200000c0 R09: 0000000000000014
      R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0a3c9e66d4
      R13: 00000000004c8ec1 R14: 00000000004dfe28 R15: 00000000ffffffff
      
      Uninit was created at:
       kmsan_save_stack_with_flags mm/kmsan/kmsan.c:149 [inline]
       kmsan_internal_poison_shadow+0x5c/0x110 mm/kmsan/kmsan.c:132
       kmsan_slab_alloc+0x97/0x100 mm/kmsan/kmsan_hooks.c:86
       slab_alloc_node mm/slub.c:2773 [inline]
       __kmalloc_node_track_caller+0xe27/0x11a0 mm/slub.c:4381
       __kmalloc_reserve net/core/skbuff.c:141 [inline]
       __alloc_skb+0x306/0xa10 net/core/skbuff.c:209
       alloc_skb include/linux/skbuff.h:1049 [inline]
       alloc_skb_with_frags+0x18c/0xa80 net/core/skbuff.c:5662
       sock_alloc_send_pskb+0xafd/0x10a0 net/core/sock.c:2244
       packet_alloc_skb net/packet/af_packet.c:2807 [inline]
       packet_snd net/packet/af_packet.c:2902 [inline]
       packet_sendmsg+0x63a6/0x9100 net/packet/af_packet.c:2984
       sock_sendmsg_nosec net/socket.c:637 [inline]
       sock_sendmsg net/socket.c:657 [inline]
       __sys_sendto+0xc44/0xc70 net/socket.c:1952
       __do_sys_sendto net/socket.c:1964 [inline]
       __se_sys_sendto+0x107/0x130 net/socket.c:1960
       __x64_sys_sendto+0x6e/0x90 net/socket.c:1960
       do_syscall_64+0xb6/0x160 arch/x86/entry/common.c:291
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: c4e70a87 ("netfilter: bridge: rename br_netfilter.c to br_netfilter_hooks.c")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Reviewed-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      56042858
    • P
      netfilter: nf_tables_offload: return EOPNOTSUPP if rule specifies no actions · 81ec6107
      Pablo Neira Ayuso 提交于
      If the rule only specifies the matching side, return EOPNOTSUPP.
      Otherwise, the front-end relies on the drivers to reject this rule.
      
      Fixes: c9626a2c ("netfilter: nf_tables: add hardware offload support")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      81ec6107
    • P
      netfilter: nf_tables: skip module reference count bump on object updates · fd57d0cb
      Pablo Neira Ayuso 提交于
      Use __nft_obj_type_get() instead, otherwise there is a module reference
      counter leak.
      
      Fixes: d62d0ba9 ("netfilter: nf_tables: Introduce stateful object update operation")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      fd57d0cb
    • P
      netfilter: nf_tables: validate NFT_DATA_VALUE after nft_data_init() · 0d2c96af
      Pablo Neira Ayuso 提交于
      Userspace might bogusly sent NFT_DATA_VERDICT in several netlink
      attributes that assume NFT_DATA_VALUE. Moreover, make sure that error
      path invokes nft_data_release() to decrement the reference count on the
      chain object.
      
      Fixes: 96518518 ("netfilter: add nftables")
      Fixes: 0f3cd9b3 ("netfilter: nf_tables: add range expression")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      0d2c96af
    • P
      netfilter: nf_tables: validate NFT_SET_ELEM_INTERVAL_END · bffc124b
      Pablo Neira Ayuso 提交于
      Only NFTA_SET_ELEM_KEY and NFTA_SET_ELEM_FLAGS make sense for elements
      whose NFT_SET_ELEM_INTERVAL_END flag is set on.
      
      Fixes: 96518518 ("netfilter: add nftables")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      bffc124b
    • P
      netfilter: nft_set_rbtree: bogus lookup/get on consecutive elements in named sets · db3b665d
      Pablo Neira Ayuso 提交于
      The existing rbtree implementation might store consecutive elements
      where the closing element and the opening element might overlap, eg.
      
      	[ a, a+1) [ a+1, a+2)
      
      This patch removes the optimization for non-anonymous sets in the exact
      matching case, where it is assumed to stop searching in case that the
      closing element is found. Instead, invalidate candidate interval and
      keep looking further in the tree.
      
      The lookup/get operation might return false, while there is an element
      in the rbtree. Moreover, the get operation returns true as if a+2 would
      be in the tree. This happens with named sets after several set updates.
      
      The existing lookup optimization (that only works for the anonymous
      sets) might not reach the opening [ a+1,... element if the closing
      ...,a+1) is found in first place when walking over the rbtree. Hence,
      walking the full tree in that case is needed.
      
      This patch fixes the lookup and get operations.
      
      Fixes: e701001e ("netfilter: nft_rbtree: allow adjacent intervals with dynamic updates")
      Fixes: ba0e4d99 ("netfilter: nf_tables: get set elements via netlink")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      db3b665d
    • P
      netfilter: uapi: Avoid undefined left-shift in xt_sctp.h · 16416655
      Phil Sutter 提交于
      With 'bytes(__u32)' being 32, a left-shift of 31 may happen which is
      undefined for the signed 32-bit value 1. Avoid this by declaring 1 as
      unsigned.
      Signed-off-by: NPhil Sutter <phil@nwl.cc>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      16416655
  3. 08 12月, 2019 2 次提交
  4. 02 12月, 2019 1 次提交
  5. 01 12月, 2019 5 次提交
  6. 29 11月, 2019 14 次提交
    • F
      netfilter: ctnetlink: netns exit must wait for callbacks · 18a110b0
      Florian Westphal 提交于
      Curtis Taylor and Jon Maxwell reported and debugged a crash on 3.10
      based kernel.
      
      Crash occurs in ctnetlink_conntrack_events because net->nfnl socket is
      NULL.  The nfnl socket was set to NULL by netns destruction running on
      another cpu.
      
      The exiting network namespace calls the relevant destructors in the
      following order:
      
      1. ctnetlink_net_exit_batch
      
      This nulls out the event callback pointer in struct netns.
      
      2. nfnetlink_net_exit_batch
      
      This nulls net->nfnl socket and frees it.
      
      3. nf_conntrack_cleanup_net_list
      
      This removes all remaining conntrack entries.
      
      This is order is correct. The only explanation for the crash so ar is:
      
      cpu1: conntrack is dying, eviction occurs:
       -> nf_ct_delete()
         -> nf_conntrack_event_report \
           -> nf_conntrack_eventmask_report
             -> notify->fcn() (== ctnetlink_conntrack_events).
      
      cpu1: a. fetches rcu protected pointer to obtain ctnetlink event callback.
            b. gets interrupted.
       cpu2: runs netns exit handlers:
           a runs ctnetlink destructor, event cb pointer set to NULL.
           b runs nfnetlink destructor, nfnl socket is closed and set to NULL.
      cpu1: c. resumes and trips over NULL net->nfnl.
      
      Problem appears to be that ctnetlink_net_exit_batch only prevents future
      callers of nf_conntrack_eventmask_report() from obtaining the callback.
      It doesn't wait of other cpus that might have already obtained the
      callbacks address.
      
      I don't see anything in upstream kernels that would prevent similar
      crash: We need to wait for all cpus to have exited the event callback.
      
      Fixes: 9592a5c0 ("netfilter: ctnetlink: netns support")
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      18a110b0
    • C
      net: macb: add missed tasklet_kill · 61183b05
      Chuhong Yuan 提交于
      This driver forgets to kill tasklet in remove.
      Add the call to fix it.
      
      Fixes: 032dc41b ("net: macb: Handle HRESP error")
      Signed-off-by: NChuhong Yuan <hslester96@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61183b05
    • D
      Merge branch 'net-tls-fix-scatter-gather-list-issues' · 2eaa8575
      David S. Miller 提交于
      Jakub Kicinski says:
      
      ====================
      net: tls: fix scatter-gather list issues
      
      This series kicked of by a syzbot report fixes three issues around
      scatter gather handling in the TLS code. First patch fixes a use-
      -after-free situation which may occur if record was freed on error.
      This could have already happened in BPF paths, and patch 2 now makes
      the same condition occur in non-BPF code.
      
      Patch 2 fixes the problem spotted by syzbot. If encryption failed
      we have to clean the end markings from scatter gather list. As
      suggested by John the patch frees the record entirely and caller
      may retry copying data from user space buffer again.
      
      Third patch fixes a bug in the TLS 1.3 code spotted while working
      on patch 2. TLS 1.3 may effectively overflow the SG list which
      leads to the BUG() in sg_page() being triggered.
      
      Patch 4 adds a test case which triggers this bug reliably.
      
      Next two patches are small cleanups of dead code and code which
      makes dangerous assumptions.
      
      Last but not least two minor improvements to the sockmap tests.
      
      Tested:
       - bpf/test_sockmap
       - net/tls
       - syzbot repro (which used error injection, hence no direct
         selftest is added to preserve it).
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2eaa8575
    • J
      selftests: bpf: correct perror strings · e5dc9dd3
      Jakub Kicinski 提交于
      perror(str) is basically equivalent to
      print("%s: %s\n", str, strerror(errno)).
      New line or colon at the end of str is
      a mistake/breaks formatting.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5dc9dd3
    • J
      selftests: bpf: test_sockmap: handle file creation failures gracefully · 4b67c515
      Jakub Kicinski 提交于
      test_sockmap creates a temporary file to use for sendpage.
      this may fail for various reasons. Handle the error rather
      than segfault.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b67c515
    • J
      net/tls: use sg_next() to walk sg entries · c5daa6cc
      Jakub Kicinski 提交于
      Partially sent record cleanup path increments an SG entry
      directly instead of using sg_next(). This should not be a
      problem today, as encrypted messages should be always
      allocated as arrays. But given this is a cleanup path it's
      easy to miss was this ever to change. Use sg_next(), and
      simplify the code.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5daa6cc
    • J
      net/tls: remove the dead inplace_crypto code · 9e5ffed3
      Jakub Kicinski 提交于
      Looks like when BPF support was added by commit d3b18ad3
      ("tls: add bpf support to sk_msg handling") and
      commit d829e9c4 ("tls: convert to generic sk_msg interface")
      it broke/removed the support for in-place crypto as added by
      commit 4e6d4720 ("tls: Add support for inplace records
      encryption").
      
      The inplace_crypto member of struct tls_rec is dead, inited
      to zero, and sometimes set to zero again. It used to be
      set to 1 when record was allocated, but the skmsg code doesn't
      seem to have been written with the idea of in-place crypto
      in mind.
      
      Since non trivial effort is required to bring the feature back
      and we don't really have the HW to measure the benefit just
      remove the left over support for now to avoid confusing readers.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9e5ffed3
    • J
      selftests/tls: add a test for fragmented messages · 65190f77
      Jakub Kicinski 提交于
      Add a sendmsg test with very fragmented messages. This should
      fill up sk_msg and test the boundary conditions.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      65190f77
    • J
      net: skmsg: fix TLS 1.3 crash with full sk_msg · 031097d9
      Jakub Kicinski 提交于
      TLS 1.3 started using the entry at the end of the SG array
      for chaining-in the single byte content type entry. This mostly
      works:
      
      [ E E E E E E . . ]
        ^           ^
         start       end
      
                       E < content type
                     /
      [ E E E E E E C . ]
        ^           ^
         start       end
      
      (Where E denotes a populated SG entry; C denotes a chaining entry.)
      
      If the array is full, however, the end will point to the start:
      
      [ E E E E E E E E ]
        ^
         start
         end
      
      And we end up overwriting the start:
      
          E < content type
         /
      [ C E E E E E E E ]
        ^
         start
         end
      
      The sg array is supposed to be a circular buffer with start and
      end markers pointing anywhere. In case where start > end
      (i.e. the circular buffer has "wrapped") there is an extra entry
      reserved at the end to chain the two halves together.
      
      [ E E E E E E . . l ]
      
      (Where l is the reserved entry for "looping" back to front.
      
      As suggested by John, let's reserve another entry for chaining
      SG entries after the main circular buffer. Note that this entry
      has to be pointed to by the end entry so its position is not fixed.
      
      Examples of full messages:
      
      [ E E E E E E E E . l ]
        ^               ^
         start           end
      
         <---------------.
      [ E E . E E E E E E l ]
            ^ ^
         end   start
      
      Now the end will always point to an unused entry, so TLS 1.3
      can always use it.
      
      Fixes: 130b392c ("net: tls: Add tls 1.3 support")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      031097d9
    • J
      net/tls: free the record on encryption error · d10523d0
      Jakub Kicinski 提交于
      When tls_do_encryption() fails the SG lists are left with the
      SG_END and SG_CHAIN marks in place. One could hope that once
      encryption fails we will never see the record again, but that
      is in fact not true. Commit d3b18ad3 ("tls: add bpf support
      to sk_msg handling") added special handling to ENOMEM and ENOSPC
      errors which mean we may see the same record re-submitted.
      
      As suggested by John free the record, the BPF code is already
      doing just that.
      
      Reported-by: syzbot+df0d4ec12332661dd1f9@syzkaller.appspotmail.com
      Fixes: d3b18ad3 ("tls: add bpf support to sk_msg handling")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d10523d0
    • J
      net/tls: take into account that bpf_exec_tx_verdict() may free the record · c329ef96
      Jakub Kicinski 提交于
      bpf_exec_tx_verdict() may free the record if tls_push_record()
      fails, or if the entire record got consumed by BPF. Re-check
      ctx->open_rec before touching the data.
      
      Fixes: d3b18ad3 ("tls: add bpf support to sk_msg handling")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: NSimon Horman <simon.horman@netronome.com>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c329ef96
    • L
      Merge branch 'master' of... · 81b6b964
      Linus Torvalds 提交于
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux; tag 'dma-mapping-5.5' of git://git.infradead.org/users/hch/dma-mapping
      
      Pull dma-mapping updates from Christoph Hellwig:
      
       - improve dma-debug scalability (Eric Dumazet)
      
       - tiny dma-debug cleanup (Dan Carpenter)
      
       - check for vmap memory in dma_map_single (Kees Cook)
      
       - check for dma_addr_t overflows in dma-direct when using DMA offsets
         (Nicolas Saenz Julienne)
      
       - switch the x86 sta2x11 SOC to use more generic DMA code (Nicolas
         Saenz Julienne)
      
       - fix arm-nommu dma-ranges handling (Vladimir Murzin)
      
       - use __initdata in CMA (Shyam Saini)
      
       - replace the bus dma mask with a limit (Nicolas Saenz Julienne)
      
       - merge the remapping helpers into the main dma-direct flow (me)
      
       - switch xtensa to the generic dma remap handling (me)
      
       - various cleanups around dma_capable (me)
      
       - remove unused dev arguments to various dma-noncoherent helpers (me)
      
      * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux:
      
      * tag 'dma-mapping-5.5' of git://git.infradead.org/users/hch/dma-mapping: (22 commits)
        dma-mapping: treat dev->bus_dma_mask as a DMA limit
        dma-direct: exclude dma_direct_map_resource from the min_low_pfn check
        dma-direct: don't check swiotlb=force in dma_direct_map_resource
        dma-debug: clean up put_hash_bucket()
        powerpc: remove support for NULL dev in __phys_to_dma / __dma_to_phys
        dma-direct: avoid a forward declaration for phys_to_dma
        dma-direct: unify the dma_capable definitions
        dma-mapping: drop the dev argument to arch_sync_dma_for_*
        x86/PCI: sta2x11: use default DMA address translation
        dma-direct: check for overflows on 32 bit DMA addresses
        dma-debug: increase HASH_SIZE
        dma-debug: reorder struct dma_debug_entry fields
        xtensa: use the generic uncached segment support
        dma-mapping: merge the generic remapping helpers into dma-direct
        dma-direct: provide mmap and get_sgtable method overrides
        dma-direct: remove the dma_handle argument to __dma_direct_alloc_pages
        dma-direct: remove __dma_direct_free_pages
        usb: core: Remove redundant vmap checks
        kernel: dma-contiguous: mark CMA parameters __initdata/__initconst
        dma-debug: add a schedule point in debug_dma_dump_mappings()
        ...
      81b6b964
    • L
      Merge tag 'ioremap-5.5' of git://git.infradead.org/users/hch/ioremap · a308a710
      Linus Torvalds 提交于
      Pull generic ioremap support from Christoph Hellwig:
       "This adds the remaining bits for an entirely generic ioremap and
        iounmap to lib/ioremap.c. To facilitate that, it cleans up the giant
        mess of weird ioremap variants we had with no users outside the arch
        code.
      
        For now just the three newest ports use the code, but there is more
        than a handful others that can be converted without too much work.
      
        Summary:
      
         - clean up various obsolete ioremap and iounmap variants
      
         - add a new generic ioremap implementation and switch csky, nds32 and
           riscv over to it"
      
      * tag 'ioremap-5.5' of git://git.infradead.org/users/hch/ioremap: (21 commits)
        nds32: use generic ioremap
        csky: use generic ioremap
        csky: remove ioremap_cache
        riscv: use the generic ioremap code
        lib: provide a simple generic ioremap implementation
        sh: remove __iounmap
        nios2: remove __iounmap
        hexagon: remove __iounmap
        m68k: rename __iounmap and mark it static
        arch: rely on asm-generic/io.h for default ioremap_* definitions
        asm-generic: don't provide ioremap for CONFIG_MMU
        asm-generic: ioremap_uc should behave the same with and without MMU
        xtensa: clean up ioremap
        x86: Clean up ioremap()
        parisc: remove __ioremap
        nios2: remove __ioremap
        alpha: remove the unused __ioremap wrapper
        hexagon: clean up ioremap
        ia64: rename ioremap_nocache to ioremap_uc
        unicore32: remove ioremap_cached
        ...
      a308a710
    • L
      Merge tag 'for-5.5/io_uring-post-20191128' of git://git.kernel.dk/linux-block · 05bd375b
      Linus Torvalds 提交于
      Pull more io_uring updates from Jens Axboe:
       "As mentioned in the first pull request, there was a later batch as
        well. This contains fixes to the stuff that already went in, cleanups,
        and a few later additions. In particular, this contains:
      
         - Cleanups/fixes/unification of the submission and completion path
           (Pavel,me)
      
         - Linked timeouts improvements (Pavel,me)
      
         - Error path fixes (me)
      
         - Fix lookup window where cancellations wouldn't work (me)
      
         - Improve DRAIN support (Pavel)
      
         - Fix backlog flushing -EBUSY on submit (me)
      
         - Add support for connect(2) (me)
      
         - Fix for non-iter based fixed IO (Pavel)
      
         - creds inheritance for async workers (me)
      
         - Disable cmsg/ancillary data for sendmsg/recvmsg (me)
      
         - Shrink io_kiocb to 3 cachelines (me)
      
         - NUMA fix for io-wq (Jann)"
      
      * tag 'for-5.5/io_uring-post-20191128' of git://git.kernel.dk/linux-block: (42 commits)
        io_uring: make poll->wait dynamically allocated
        io-wq: shrink io_wq_work a bit
        io-wq: fix handling of NUMA node IDs
        io_uring: use kzalloc instead of kcalloc for single-element allocations
        io_uring: cleanup io_import_fixed()
        io_uring: inline struct sqe_submit
        io_uring: store timeout's sqe->off in proper place
        net: disallow ancillary data for __sys_{send,recv}msg_file()
        net: separate out the msghdr copy from ___sys_{send,recv}msg()
        io_uring: remove superfluous check for sqe->off in io_accept()
        io_uring: async workers should inherit the user creds
        io-wq: have io_wq_create() take a 'data' argument
        io_uring: fix dead-hung for non-iter fixed rw
        io_uring: add support for IORING_OP_CONNECT
        net: add __sys_connect_file() helper
        io_uring: only return -EBUSY for submit on non-flushed backlog
        io_uring: only !null ptr to io_issue_sqe()
        io_uring: simplify io_req_link_next()
        io_uring: pass only !null to io_req_find_next()
        io_uring: remove io_free_req_find_next()
        ...
      05bd375b
  7. 28 11月, 2019 10 次提交
    • L
      Merge tag 'drm-next-2019-11-27' of git://anongit.freedesktop.org/drm/drm · a6ed68d6
      Linus Torvalds 提交于
      Pull drm updates from Dave Airlie:
       "Lots of stuff in here, though it hasn't been too insane this merge
        apart from dealing with the security fun.
      
        uapi:
         - export different colorspace properties on DP vs HDMI
         - new fourcc for ARM 16x16 block format
         - syncobj: allow querying last submitted timeline value
         - DRM_FORMAT_BIG_ENDIAN defined as unsigned
      
        core:
         - allow using gem vma manager in ttm
         - connector/encoder/bridge doc fixes
         - allow more than 3 encoders for a connector
         - displayport mst suspend/resume reprobing support
         - vram lazy unmapping, uniform vram mm and gem vram
         - edid cleanups + AVI informframe bar info
         - displayport helpers - dpcd parser added
      
        dp_cec:
         - Allow a connector to be associated with a cec device
      
        ttm:
         - pipelining with no_gpu_wait fix
         - always keep BOs on the LRU
      
        sched:
         - allow free_job routine to sleep
      
        i915:
         - Block userptr from mappable GTT
         - i915 perf uapi versioning
         - OA stream dynamic reconfiguration
         - make context persistence optional
         - introduce DRM_I915_UNSTABLE Kconfig
         - add fake lmem testing under unstable
         - BT.2020 support for DP MSA
         - struct mutex elimination
         - Tigerlake display/PLL/power management improvements
         - Jasper Lake PCH support
         - refactor PMU for multiple GPUs
         - Icelake firmware update
         - Split out vga + switcheroo code
      
        amdgpu:
         - implement dma-buf import/export without helpers
         - vega20 RAS enablement
         - DC i2c over aux fixes
         - renoir GPU reset
         - DC HDCP support
         - BACO support for CI/VI asics
         - MSI-X support
         - Arcturus EEPROM support
         - Arcturus VCN encode support
         - VCN dynamic powergating on RV/RV2
      
        amdkfd:
         - add navi12/14/renoir support to kfd
      
        radeon:
         - SI dpm fix ported from amdgpu
         - fix bad DMA on ppc platforms
      
        gma500:
         - memory leak fixes
      
        qxl:
         - convert to new gem mmap
      
        exynos:
         - build warning fix
      
        komeda:
         - add aclk sysfs attribute
      
        v3d:
         - userspace cleanup uapi change
      
        i810:
         - fix for underflow in dispatch ioctls
      
        ast:
         - refactor show_cursor
      
        mgag200:
         - refactor show_cursor
      
        arcgpu:
         - encoder finding improvements
      
        mediatek:
         - mipi_tx, dsi and partial crtc support for MT8183 SoC
         - rotation support
      
        meson:
         - add suspend/resume support
      
        omap:
         - misc refactors
      
        tegra:
         - DisplayPort support for Tegra 210, 186 and 194.
         - IOMMU-backed DMA API fixes
      
        panfrost:
         - fix lockdep issue
         - simplify devfreq integration
      
        rcar-du:
         - R8A774B1 SoC support
         - fixes for H2 ES2.0
      
        sun4i:
         - vcc-dsi regulator support
      
        virtio-gpu:
         - vmexit vs spinlock fix
         - move to gem shmem helpers
         - handle large command buffers with cma"
      
      * tag 'drm-next-2019-11-27' of git://anongit.freedesktop.org/drm/drm: (1855 commits)
        drm/amdgpu: invalidate mmhub semaphore workaround in gmc9/gmc10
        drm/amdgpu: initialize vm_inv_eng0_sem for gfxhub and mmhub
        drm/amd/amdgpu/sriov skip RLCG s/r list for arcturus VF.
        drm/amd/amdgpu/sriov temporarily skip ras,dtm,hdcp for arcturus VF
        drm/amdgpu/gfx10: re-init clear state buffer after gpu reset
        merge fix for "ftrace: Rework event_create_dir()"
        drm/amdgpu: Update Arcturus golden registers
        drm/amdgpu/gfx10: fix out-of-bound mqd_backup array access
        drm/amdgpu/gfx10: explicitly wait for cp idle after halt/unhalt
        Revert "drm/amd/display: enable S/G for RAVEN chip"
        drm/amdgpu: disable gfxoff on original raven
        drm/amdgpu: remove experimental flag for Navi14
        drm/amdgpu: disable gfxoff when using register read interface
        drm/amdgpu/powerplay: properly set PP_GFXOFF_MASK (v2)
        drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
        drm/radeon: fix bad DMA from INTERRUPT_CNTL2
        drm/amd/display: Fix debugfs on MST connectors
        drm/amdgpu/nv: add asic func for fetching vbios from rom directly
        drm/amdgpu: put flush_delayed_work at first
        drm/amdgpu/vcn2.5: fix the enc loop with hw fini
        ...
      a6ed68d6
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 8c39f71e
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
       "This is mostly to fix the iwlwifi regression:
      
        1) Flush GRO state properly in iwlwifi driver, from Alexander Lobakin.
      
        2) Validate TIPC link name with properly length macro, from John
           Rutherford.
      
        3) Fix completion init and device query timeouts in ibmvnic, from
           Thomas Falcon.
      
        4) Fix SKB size calculation for netlink messages in psample, from
           Nikolay Aleksandrov.
      
        5) Similar kind of fix for OVS flow dumps, from Paolo Abeni.
      
        6) Handle queue allocation failure unwind properly in gve driver, we
           could try to release pages we didn't allocate. From Jeroen de
           Borst.
      
        7) Serialize TX queue SKB list accesses properly in mscc ocelot
           driver. From Yangbo Lu"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net:
        net: usb: aqc111: Use the correct style for SPDX License Identifier
        net: phy: Use the correct style for SPDX License Identifier
        net: wireless: intel: iwlwifi: fix GRO_NORMAL packet stalling
        net: mscc: ocelot: use skb queue instead of skbs list
        net: mscc: ocelot: avoid incorrect consuming in skbs list
        gve: Fix the queue page list allocated pages count
        net: inet_is_local_reserved_port() port arg should be unsigned short
        openvswitch: fix flow command message size
        net: phy: dp83869: Fix return paths to return proper values
        net: psample: fix skb_over_panic
        net: usbnet: Fix -Wcast-function-type
        net: hso: Fix -Wcast-function-type
        net: port < inet_prot_sock(net) --> inet_port_requires_bind_service(net, port)
        ibmvnic: Serialize device queries
        ibmvnic: Bound waits for device queries
        ibmvnic: Terminate waiting device threads after loss of service
        ibmvnic: Fix completion structure initialization
        net-sctp: replace some sock_net(sk) with just 'net'
        net: Fix a documentation bug wrt. ip_unprivileged_port_start
        tipc: fix link name length check
      8c39f71e
    • L
      Merge tag 'trace-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 95f1fa9e
      Linus Torvalds 提交于
      Pull tracing updates from Steven Rostedt:
       "New tracing features:
      
         - New PERMANENT flag to ftrace_ops when attaching a callback to a
           function.
      
           As /proc/sys/kernel/ftrace_enabled when set to zero will disable
           all attached callbacks in ftrace, this has a detrimental impact on
           live kernel tracing, as it disables all that it patched. If a
           ftrace_ops is registered to ftrace with the PERMANENT flag set, it
           will prevent ftrace_enabled from being disabled, and if
           ftrace_enabled is already disabled, it will prevent a ftrace_ops
           with PREMANENT flag set from being registered.
      
         - New register_ftrace_direct().
      
           As eBPF would like to register its own trampolines to be called by
           the ftrace nop locations directly, without going through the ftrace
           trampoline, this function has been added. This allows for eBPF
           trampolines to live along side of ftrace, perf, kprobe and live
           patching. It also utilizes the ftrace enabled_functions file that
           keeps track of functions that have been modified in the kernel, to
           allow for security auditing.
      
         - Allow for kernel internal use of ftrace instances.
      
           Subsystems in the kernel can now create and destroy their own
           tracing instances which allows them to have their own tracing
           buffer, and be able to record events without worrying about other
           users from writing over their data.
      
         - New seq_buf_hex_dump() that lets users use the hex_dump() in their
           seq_buf usage.
      
         - Notifications now added to tracing_max_latency to allow user space
           to know when a new max latency is hit by one of the latency
           tracers.
      
         - Wider spread use of generic compare operations for use of bsearch
           and friends.
      
         - More synthetic event fields may be defined (32 up from 16)
      
         - Use of xarray for architectures with sparse system calls, for the
           system call trace events.
      
        This along with small clean ups and fixes"
      
      * tag 'trace-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (51 commits)
        tracing: Enable syscall optimization for MIPS
        tracing: Use xarray for syscall trace events
        tracing: Sample module to demonstrate kernel access to Ftrace instances.
        tracing: Adding new functions for kernel access to Ftrace instances
        tracing: Fix Kconfig indentation
        ring-buffer: Fix typos in function ring_buffer_producer
        ftrace: Use BIT() macro
        ftrace: Return ENOTSUPP when DYNAMIC_FTRACE_WITH_DIRECT_CALLS is not configured
        ftrace: Rename ftrace_graph_stub to ftrace_stub_graph
        ftrace: Add a helper function to modify_ftrace_direct() to allow arch optimization
        ftrace: Add helper find_direct_entry() to consolidate code
        ftrace: Add another check for match in register_ftrace_direct()
        ftrace: Fix accounting bug with direct->count in register_ftrace_direct()
        ftrace/selftests: Fix spelling mistake "wakeing" -> "waking"
        tracing: Increase SYNTH_FIELDS_MAX for synthetic_events
        ftrace/samples: Add a sample module that implements modify_ftrace_direct()
        ftrace: Add modify_ftrace_direct()
        tracing: Add missing "inline" in stub function of latency_fsnotify()
        tracing: Remove stray tab in TRACE_EVAL_MAP_FILE's help text
        tracing: Use seq_buf_hex_dump() to dump buffers
        ...
      95f1fa9e
    • L
      Merge tag 'microblaze-v5.5-rc1' of git://git.monstr.eu/linux-2.6-microblaze · 477093b3
      Linus Torvalds 提交于
      Pull Microblaze updates from Michal Simek:
      
       - extend DTB space
      
       - defconfig update
      
       - clean up rescheduling logic
      
       - enable SPARSE_IRQ
      
      * tag 'microblaze-v5.5-rc1' of git://git.monstr.eu/linux-2.6-microblaze:
        microblaze: Increase max dtb size to 64K from 32K
        microblaze: Enable SPARSE_IRQ
        microblaze: defconfig: Enable devtmps and tmpfs
        microblaze: entry: Remove unneeded need_resched() loop
      477093b3
    • L
      Merge tag 'riscv/for-v5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 6a0e20cd
      Linus Torvalds 提交于
      Pull RISC-V updates from Paul Walmsley:
       "New features:
         - SECCOMP support
         - nommu support
         - SBI-less system support
         - M-Mode support
         - TLB flush optimizations
      
        Other improvements:
         - Pass the complete RISC-V ISA string supported by the CPU cores to
           userspace, rather than redacting parts of it in the kernel
         - Add platform DMA IP block data to the HiFive Unleashed board DT
           file
         - Add Makefile support for BZ2, LZ4, LZMA, LZO kernel image
           compression formats, in line with other architectures
      
        Cleanups:
         - Remove unnecessary PTE_PARENT_SIZE macro
         - Standardize include guard naming across arch/riscv"
      
      * tag 'riscv/for-v5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (22 commits)
        riscv: provide a flat image loader
        riscv: add nommu support
        riscv: clear the instruction cache and all registers when booting
        riscv: read the hart ID from mhartid on boot
        riscv: provide native clint access for M-mode
        riscv: dts: add support for PDMA device of HiFive Unleashed Rev A00
        riscv: add support for MMIO access to the timer registers
        riscv: implement remote sfence.i using IPIs
        riscv: cleanup the default power off implementation
        riscv: poison SBI calls for M-mode
        riscv: don't allow selecting SBI based drivers for M-mode
        RISC-V: Add multiple compression image format.
        riscv: clean up the macro format in each header file
        riscv: Use PMD_SIZE to replace PTE_PARENT_SIZE
        riscv: abstract out CSR names for supervisor vs machine mode
        riscv: separate MMIO functions into their own header file
        riscv: enter WFI in default_power_off() if SBI does not shutdown
        RISC-V: Issue a tlb page flush if possible
        RISC-V: Issue a local tlbflush if possible.
        RISC-V: Do not invoke SBI call if cpumask is empty
        ...
      6a0e20cd
    • N
      net: usb: aqc111: Use the correct style for SPDX License Identifier · bac139a8
      Nishad Kamdar 提交于
      This patch corrects the SPDX License Identifier style in
      header files related to drivers for USB Network devices.
      This patch gives an explicit block comment to the
      SPDX License Identifier.
      
      Changes made by using a script provided by Joe Perches here:
      https://lkml.org/lkml/2019/2/7/46.
      Suggested-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NNishad Kamdar <nishadkamdar@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bac139a8
    • N
      net: phy: Use the correct style for SPDX License Identifier · 9aab906a
      Nishad Kamdar 提交于
      This patch corrects the SPDX License Identifier style in
      header files related to PHY Layer for Ethernet drivers.
      For C header files Documentation/process/license-rules.rst
      mandates C-like comments (opposed to C source files where
      C++ style should be used). This patch also gives an explicit
      block comment to the SPDX License Identifier.
      
      Changes made by using a script provided by Joe Perches here:
      https://lkml.org/lkml/2019/2/7/46.
      Suggested-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NNishad Kamdar <nishadkamdar@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9aab906a
    • L
      Merge tag 'powerpc-spectre-rsb' of powerpc-CVE-2019-18660.bundle · 80eb5fea
      Linus Torvalds 提交于
      Pull powerpc Spectre-RSB fixes from Michael Ellerman:
       "We failed to activate the mitigation for Spectre-RSB (Return Stack
        Buffer, aka. ret2spec) on context switch, on CPUs prior to Power9
        DD2.3.
      
        That allows a process to poison the RSB (called Link Stack on Power
        CPUs) and possibly misdirect speculative execution of another process.
        If the victim process can be induced to execute a leak gadget then it
        may be possible to extract information from the victim via a side
        channel.
      
        The fix is to correctly activate the link stack flush mitigation on
        all CPUs that have any mitigation of Spectre v2 in userspace enabled.
      
        There's a second commit which adds a link stack flush in the KVM guest
        exit path. A leak via that path has not been demonstrated, but we
        believe it's at least theoretically possible.
      
        This is the fix for CVE-2019-18660"
      
      * tag 'powerpc-spectre-rsb' of /home/torvalds/Downloads/powerpc-CVE-2019-18660.bundle:
        KVM: PPC: Book3S HV: Flush link stack on guest exit to host kernel
        powerpc/book3s64: Fix link stack flush on context switch
      80eb5fea
    • A
      net: wireless: intel: iwlwifi: fix GRO_NORMAL packet stalling · b167191e
      Alexander Lobakin 提交于
      Commit 6570bc79 ("net: core: use listified Rx for GRO_NORMAL in
      napi_gro_receive()") has applied batched GRO_NORMAL packets processing
      to all napi_gro_receive() users, including mac80211-based drivers.
      
      However, this change has led to a regression in iwlwifi driver [1][2] as
      it is required for NAPI users to call napi_complete_done() or
      napi_complete() and the end of every polling iteration, whilst iwlwifi
      doesn't use NAPI scheduling at all and just calls napi_gro_flush().
      In that particular case, packets which have not been already flushed
      from napi->rx_list stall in it until at least next Rx cycle.
      
      Fix this by adding a manual flushing of the list to iwlwifi driver right
      before napi_gro_flush() call to mimic napi_complete() logics.
      
      I prefer to open-code gro_normal_list() rather than exporting it for 2
      reasons:
      * to prevent from using it and napi_gro_flush() in any new drivers,
        as it is the *really* bad way to use NAPI that should be avoided;
      * to keep gro_normal_list() static and don't lose any CC optimizations.
      
      I also don't add the "Fixes:" tag as the mentioned commit was only a
      trigger that only exposed an improper usage of NAPI in this particular
      driver.
      
      [1] https://lore.kernel.org/netdev/PSXP216MB04388962C411CD0B17A86F47804A0@PSXP216MB0438.KORP216.PROD.OUTLOOK.COM
      [2] https://bugzilla.kernel.org/show_bug.cgi?id=205647Signed-off-by: NAlexander Lobakin <alobakin@dlink.ru>
      Acked-by: NLuca Coelho <luciano.coelho@intel.com>
      Reported-by: NNicholas Johnson <nicholas.johnson-opensource@outlook.com.au>
      Tested-by: NNicholas Johnson <nicholas.johnson-opensource@outlook.com.au>
      Reviewed-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b167191e
    • L
      Merge tag 'driver-core-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 9a3d7fd2
      Linus Torvalds 提交于
      Pull driver core updates from Greg KH:
       "Here is the "big" set of driver core patches for 5.5-rc1
      
        There's a few minor cleanups and fixes in here, but the majority of
        the patches in here fall into two buckets:
      
         - debugfs api cleanups and fixes
      
         - driver core device link support for boot dependancy issues
      
        The debugfs api cleanups are working to slowly refactor the debugfs
        apis so that it is even harder to use incorrectly. That work has been
        happening for the past few kernel releases and will continue over
        time, it's a long-term project/goal
      
        The driver core device link support missed 5.4 by just a bit, so it's
        been sitting and baking for many months now. It's from Saravana Kannan
        to help resolve the problems that DT-based systems have at boot time
        with dependancy graphs and kernel modules. Turns out that no one has
        actually tried to build a generic arm64 kernel with loads of modules
        and have it "just work" for a variety of platforms (like a distro
        kernel). The big problem turned out to be a lack of dependency
        information between different areas of DT entries, and the work here
        resolves that problem and now allows devices to boot properly, and
        quicker than a monolith kernel.
      
        All of these patches have been in linux-next for a long time with no
        reported issues"
      
      * tag 'driver-core-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (68 commits)
        tracing: Remove unnecessary DEBUG_FS dependency
        of: property: Add device link support for interrupt-parent, dmas and -gpio(s)
        debugfs: Fix !DEBUG_FS debugfs_create_automount
        of: property: Add device link support for "iommu-map"
        of: property: Fix the semantics of of_is_ancestor_of()
        i2c: of: Populate fwnode in of_i2c_get_board_info()
        drivers: base: Fix Kconfig indentation
        firmware_loader: Fix labels with comma for builtin firmware
        driver core: Allow device link operations inside sync_state()
        driver core: platform: Declare ret variable only once
        cpu-topology: declare parse_acpi_topology in <linux/arch_topology.h>
        crypto: hisilicon: no need to check return value of debugfs_create functions
        driver core: platform: use the correct callback type for bus_find_device
        firmware_class: make firmware caching configurable
        driver core: Clarify documentation for fwnode_operations.add_links()
        mailbox: tegra: Fix superfluous IRQ error message
        net: caif: Fix debugfs on 64-bit platforms
        mac80211: Use debugfs_create_xul() helper
        media: c8sectpfe: no need to check return value of debugfs_create functions
        of: property: Add device link support for iommus, mboxes and io-channels
        ...
      9a3d7fd2