1. 01 Jun, 2024 9 commits
  2. 30 May, 2024 14 commits
  3. 29 May, 2024 7 commits
  4. 28 May, 2024 10 commits
    • Eric Garver's avatar
      netfilter: nft_fib: allow from forward/input without iif selector · e8ded22e
      Eric Garver authored
      This removes the restriction of needing iif selector in the
      forward/input hooks for fib lookups when requested result is
      oif/oifname.
      
      Removing this restriction allows "loose" lookups from the forward hooks.
      
      Fixes: be8be04e ("netfilter: nft_fib: reverse path filter for policy-based routing on iif")
      Signed-off-by: default avatarEric Garver <eric@garver.life>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      e8ded22e
    • Florian Westphal's avatar
      netfilter: tproxy: bail out if IP has been disabled on the device · 21a673bd
      Florian Westphal authored
      syzbot reports:
      general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN PTI
      KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
      [..]
      RIP: 0010:nf_tproxy_laddr4+0xb7/0x340 net/ipv4/netfilter/nf_tproxy_ipv4.c:62
      Call Trace:
       nft_tproxy_eval_v4 net/netfilter/nft_tproxy.c:56 [inline]
       nft_tproxy_eval+0xa9a/0x1a00 net/netfilter/nft_tproxy.c:168
      
      __in_dev_get_rcu() can return NULL, so check for this.
      
      Reported-and-tested-by: syzbot+b94a6818504ea90d7661@syzkaller.appspotmail.com
      Fixes: cc6eb433 ("tproxy: use the interface primary IP address as a default value for --on-ip")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      21a673bd
    • Pablo Neira Ayuso's avatar
      netfilter: nft_payload: skbuff vlan metadata mangle support · 33c563eb
      Pablo Neira Ayuso authored
      Userspace assumes vlan header is present at a given offset, but vlan
      offload allows to store this in metadata fields of the skbuff. Hence
      mangling vlan results in a garbled packet. Handle this transparently by
      adding a parser to the kernel.
      
      If vlan metadata is present and payload offset is over 12 bytes (source
      and destination mac address fields), then subtract vlan header present
      in vlan metadata, otherwise mangle vlan metadata based on offset and
      length, extracting data from the source register.
      
      This is similar to:
      
        8cfd23e6 ("netfilter: nft_payload: work around vlan header stripping")
      
      to deal with vlan payload mangling.
      
      Fixes: 7ec3f7b4 ("netfilter: nft_payload: add packet mangling support")
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      33c563eb
    • Linus Torvalds's avatar
      Merge tag 'tpmdd-next-6.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd · e0cce98f
      Linus Torvalds authored
      Pull tpm fixes from Jarkko Sakkinen:
       "This fixes two unaddressed review comments for the HMAC encryption
        patch set. They are cosmetic but we are better off, if such
        unnecessary glitches do not exist in the release.
      
        The important part is enabling the HMAC encryption by default only on
        x86-64 because that is the only sufficiently tested arch.
      
        Finally, there is a bug fix for SPI transfer buffer allocation, which
        did not take into account the SPI header size"
      
      * tag 'tpmdd-next-6.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
        tpm: Enable TCG_TPM2_HMAC by default only for X86_64
        tpm: Rename TPM2_OA_TMPL to TPM2_OA_NULL_KEY and make it local
        tpm: Open code tpm_buf_parameters()
        tpm_tis_spi: Account for SPI header when allocating TPM SPI xfer buffer
      e0cce98f
    • Linus Torvalds's avatar
      Merge tag 'probes-fixes-v6.10-rc1' of... · 8d6bc6a2
      Linus Torvalds authored
      Merge tag 'probes-fixes-v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
      
      Pull probes fixes from Masami Hiramatsu:
      
       - uprobes: prevent mutex_lock() under rcu_read_lock().
      
         Recent changes moved uprobe_cpu_buffer preparation which involves
         mutex_lock(), under __uprobe_trace_func() which is called inside
         rcu_read_lock().
      
         Fix it by moving uprobe_cpu_buffer preparation outside of
         __uprobe_trace_func()
      
       - kprobe-events: handle the error case of btf_find_struct_member()
      
      * tag 'probes-fixes-v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing/probes: fix error check in parse_btf_field()
        uprobes: prevent mutex_lock() under rcu_read_lock()
      8d6bc6a2
    • MD Danish Anwar's avatar
      net: ti: icssg-prueth: Fix start counter for ft1 filter · 56a5cf53
      MD Danish Anwar authored
      The start counter for FT1 filter is wrongly set to 0 in the driver.
      FT1 is used for source address violation (SAV) check and source address
      starts at Byte 6 not Byte 0. Fix this by changing start counter to
      ETH_ALEN in icssg_ft1_set_mac_addr().
      
      Fixes: e9b4ece7 ("net: ti: icssg-prueth: Add Firmware config and classification APIs.")
      Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
      Link: https://lore.kernel.org/r/20240527063015.263748-1-danishanwar@ti.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      56a5cf53
    • Jarkko Sakkinen's avatar
      tpm: Enable TCG_TPM2_HMAC by default only for X86_64 · d3e43a8f
      Jarkko Sakkinen authored
      Given the not fully root caused performance issues on non-x86 platforms,
      enable the feature by default only for x86-64. That is the platform it
      brings the most value and has gone most of the QA. Can be reconsidered
      later and can be obviously opt-in enabled too on any arch.
      
      Link: https://lore.kernel.org/linux-integrity/bf67346ef623ff3c452c4f968b7d900911e250c3.camel@gmail.com/#tSigned-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      d3e43a8f
    • Jarkko Sakkinen's avatar
      tpm: Rename TPM2_OA_TMPL to TPM2_OA_NULL_KEY and make it local · f09fc6ce
      Jarkko Sakkinen authored
      Rename and document TPM2_OA_TMPL, as originally requested in the patch
      set review, but left unaddressed without any appropriate reasoning. The
      new name is TPM2_OA_NULL_KEY, has a documentation and is local only to
      tpm2-sessions.c.
      
      Link: https://lore.kernel.org/linux-integrity/ddbeb8111f48a8ddb0b8fca248dff6cc9d7079b2.camel@HansenPartnership.com/
      Link: https://lore.kernel.org/linux-integrity/CZCKTWU6ZCC9.2UTEQPEVICYHL@suppilovahvero/Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      f09fc6ce
    • Thadeu Lima de Souza Cascardo's avatar
      sock_map: avoid race between sock_map_close and sk_psock_put · 4b4647ad
      Thadeu Lima de Souza Cascardo authored
      sk_psock_get will return NULL if the refcount of psock has gone to 0, which
      will happen when the last call of sk_psock_put is done. However,
      sk_psock_drop may not have finished yet, so the close callback will still
      point to sock_map_close despite psock being NULL.
      
      This can be reproduced with a thread deleting an element from the sock map,
      while the second one creates a socket, adds it to the map and closes it.
      
      That will trigger the WARN_ON_ONCE:
      
      ------------[ cut here ]------------
      WARNING: CPU: 1 PID: 7220 at net/core/sock_map.c:1701 sock_map_close+0x2a2/0x2d0 net/core/sock_map.c:1701
      Modules linked in:
      CPU: 1 PID: 7220 Comm: syz-executor380 Not tainted 6.9.0-syzkaller-07726-g3c999d1a #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
      RIP: 0010:sock_map_close+0x2a2/0x2d0 net/core/sock_map.c:1701
      Code: df e8 92 29 88 f8 48 8b 1b 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 79 29 88 f8 4c 8b 23 eb 89 e8 4f 15 23 f8 90 <0f> 0b 90 48 83 c4 08 5b 41 5c 41 5d 41 5e 41 5f 5d e9 13 26 3d 02
      RSP: 0018:ffffc9000441fda8 EFLAGS: 00010293
      RAX: ffffffff89731ae1 RBX: ffffffff94b87540 RCX: ffff888029470000
      RDX: 0000000000000000 RSI: ffffffff8bcab5c0 RDI: ffffffff8c1faba0
      RBP: 0000000000000000 R08: ffffffff92f9b61f R09: 1ffffffff25f36c3
      R10: dffffc0000000000 R11: fffffbfff25f36c4 R12: ffffffff89731840
      R13: ffff88804b587000 R14: ffff88804b587000 R15: ffffffff89731870
      FS:  000055555e080380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000000 CR3: 00000000207d4000 CR4: 0000000000350ef0
      Call Trace:
       <TASK>
       unix_release+0x87/0xc0 net/unix/af_unix.c:1048
       __sock_release net/socket.c:659 [inline]
       sock_close+0xbe/0x240 net/socket.c:1421
       __fput+0x42b/0x8a0 fs/file_table.c:422
       __do_sys_close fs/open.c:1556 [inline]
       __se_sys_close fs/open.c:1541 [inline]
       __x64_sys_close+0x7f/0x110 fs/open.c:1541
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f
      RIP: 0033:0x7fb37d618070
      Code: 00 00 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d4 e8 10 2c 00 00 80 3d 31 f0 07 00 00 74 17 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c
      RSP: 002b:00007ffcd4a525d8 EFLAGS: 00000202 ORIG_RAX: 0000000000000003
      RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007fb37d618070
      RDX: 0000000000000010 RSI: 00000000200001c0 RDI: 0000000000000004
      RBP: 0000000000000000 R08: 0000000100000000 R09: 0000000100000000
      R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
      R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
       </TASK>
      
      Use sk_psock, which will only check that the pointer is not been set to
      NULL yet, which should only happen after the callbacks are restored. If,
      then, a reference can still be gotten, we may call sk_psock_stop and cancel
      psock->work.
      
      As suggested by Paolo Abeni, reorder the condition so the control flow is
      less convoluted.
      
      After that change, the reproducer does not trigger the WARN_ON_ONCE
      anymore.
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reported-by: syzbot+07a2e4a1a57118ef7355@syzkaller.appspotmail.com
      Closes: https://syzkaller.appspot.com/bug?extid=07a2e4a1a57118ef7355
      Fixes: aadb2bb8 ("sock_map: Fix a potential use-after-free in sock_map_close()")
      Fixes: 5b4a79ba ("bpf, sockmap: Don't let sock_map_{close,destroy,unhash} call itself")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@igalia.com>
      Acked-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Link: https://lore.kernel.org/r/20240524144702.1178377-1-cascardo@igalia.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4b4647ad
    • Jarkko Sakkinen's avatar
      tpm: Open code tpm_buf_parameters() · f3d7ba9e
      Jarkko Sakkinen authored
      With only single call site, this makes no sense (slipped out of the
      radar during the review). Open code and document the action directly
      to the site, to make it more readable.
      
      Fixes: 1b6d7f9e ("tpm: add session encryption protection to tpm2_get_random()")
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      f3d7ba9e