Skip to content
Snippets Groups Projects
  1. Jul 25, 2024
  2. Jul 24, 2024
    • Joel Granados's avatar
      sysctl: treewide: constify the ctl_table argument of proc_handlers · 78eb4ea2
      Joel Granados authored
      
      const qualify the struct ctl_table argument in the proc_handler function
      signatures. This is a prerequisite to moving the static ctl_table
      structs into .rodata data which will ensure that proc_handler function
      pointers cannot be modified.
      
      This patch has been generated by the following coccinelle script:
      
      ```
        virtual patch
      
        @r1@
        identifier ctl, write, buffer, lenp, ppos;
        identifier func !~ "appldata_(timer|interval)_handler|sched_(rt|rr)_handler|rds_tcp_skbuf_handler|proc_sctp_do_(hmac_alg|rto_min|rto_max|udp_port|alpha_beta|auth|probe_interval)";
        @@
      
        int func(
        - struct ctl_table *ctl
        + const struct ctl_table *ctl
          ,int write, void *buffer, size_t *lenp, loff_t *ppos);
      
        @r2@
        identifier func, ctl, write, buffer, lenp, ppos;
        @@
      
        int func(
        - struct ctl_table *ctl
        + const struct ctl_table *ctl
          ,int write, void *buffer, size_t *lenp, loff_t *ppos)
        { ... }
      
        @r3@
        identifier func;
        @@
      
        int func(
        - struct ctl_table *
        + const struct ctl_table *
          ,int , void *, size_t *, loff_t *);
      
        @r4@
        identifier func, ctl;
        @@
      
        int func(
        - struct ctl_table *ctl
        + const struct ctl_table *ctl
          ,int , void *, size_t *, loff_t *);
      
        @r5@
        identifier func, write, buffer, lenp, ppos;
        @@
      
        int func(
        - struct ctl_table *
        + const struct ctl_table *
          ,int write, void *buffer, size_t *lenp, loff_t *ppos);
      
      ```
      
      * Code formatting was adjusted in xfs_sysctl.c to comply with code
        conventions. The xfs_stats_clear_proc_handler,
        xfs_panic_mask_proc_handler and xfs_deprecated_dointvec_minmax where
        adjusted.
      
      * The ctl_table argument in proc_watchdog_common was const qualified.
        This is called from a proc_handler itself and is calling back into
        another proc_handler, making it necessary to change it as part of the
        proc_handler migration.
      
      Co-developed-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Co-developed-by: default avatarJoel Granados <j.granados@samsung.com>
      Signed-off-by: default avatarJoel Granados <j.granados@samsung.com>
      78eb4ea2
    • Petr Machata's avatar
      net: nexthop: Initialize all fields in dumped nexthops · 6d745cd0
      Petr Machata authored
      
      struct nexthop_grp contains two reserved fields that are not initialized by
      nla_put_nh_group(), and carry garbage. This can be observed e.g. with
      strace (edited for clarity):
      
          # ip nexthop add id 1 dev lo
          # ip nexthop add id 101 group 1
          # strace -e recvmsg ip nexthop get id 101
          ...
          recvmsg(... [{nla_len=12, nla_type=NHA_GROUP},
                       [{id=1, weight=0, resvd1=0x69, resvd2=0x67}]] ...) = 52
      
      The fields are reserved and therefore not currently used. But as they are, they
      leak kernel memory, and the fact they are not just zero complicates repurposing
      of the fields for new ends. Initialize the full structure.
      
      Fixes: 430a0491 ("nexthop: Add support for nexthop groups")
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d745cd0
    • Shigeru Yoshida's avatar
      tipc: Return non-zero value from tipc_udp_addr2str() on error · fa96c6ba
      Shigeru Yoshida authored
      
      tipc_udp_addr2str() should return non-zero value if the UDP media
      address is invalid. Otherwise, a buffer overflow access can occur in
      tipc_media_addr_printf(). Fix this by returning 1 on an invalid UDP
      media address.
      
      Fixes: d0f91938 ("tipc: add ip/udp media type")
      Signed-off-by: default avatarShigeru Yoshida <syoshida@redhat.com>
      Reviewed-by: default avatarTung Nguyen <tung.q.nguyen@endava.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa96c6ba
    • Florian Westphal's avatar
      netfilter: nft_set_pipapo_avx2: disable softinterrupts · a16909ae
      Florian Westphal authored
      
      We need to disable softinterrupts, else we get following problem:
      
      1. pipapo_avx2 called from process context; fpu usable
      2. preempt_disable() called, pcpu scratchmap in use
      3. softirq handles rx or tx, we re-enter pipapo_avx2
      4. fpu busy, fallback to generic non-avx version
      5. fallback reuses scratch map and index, which are in use
         by the preempted process
      
      Handle this same way as generic version by first disabling
      softinterrupts while the scratchmap is in use.
      
      Fixes: f0b3d338 ("netfilter: nft_set_pipapo_avx2: Add irq_fpu_usable() check, fallback to non-AVX2 version")
      Cc: Stefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      a16909ae
  3. Jul 23, 2024
    • James Chapman's avatar
      l2tp: make session IDR and tunnel session list coherent · d587d825
      James Chapman authored
      
      Modify l2tp_session_register and l2tp_session_unhash so that the
      session IDR and tunnel session lists remain coherent. To do so, hold
      the session IDR lock and the tunnel's session list lock when making
      any changes to either list.
      
      Without this change, a rare race condition could hit the WARN_ON_ONCE
      in l2tp_session_unhash if a thread replaced the IDR entry while
      another thread was registering the same ID.
      
       [ 7126.151795][T17511] WARNING: CPU: 3 PID: 17511 at net/l2tp/l2tp_core.c:1282 l2tp_session_delete.part.0+0x87e/0xbc0
       [ 7126.163754][T17511]  ? show_regs+0x93/0xa0
       [ 7126.164157][T17511]  ? __warn+0xe5/0x3c0
       [ 7126.164536][T17511]  ? l2tp_session_delete.part.0+0x87e/0xbc0
       [ 7126.165070][T17511]  ? report_bug+0x2e1/0x500
       [ 7126.165486][T17511]  ? l2tp_session_delete.part.0+0x87e/0xbc0
       [ 7126.166013][T17511]  ? handle_bug+0x99/0x130
       [ 7126.166428][T17511]  ? exc_invalid_op+0x35/0x80
       [ 7126.166890][T17511]  ? asm_exc_invalid_op+0x1a/0x20
       [ 7126.167372][T17511]  ? l2tp_session_delete.part.0+0x87d/0xbc0
       [ 7126.167900][T17511]  ? l2tp_session_delete.part.0+0x87e/0xbc0
       [ 7126.168429][T17511]  ? __local_bh_enable_ip+0xa4/0x120
       [ 7126.168917][T17511]  l2tp_session_delete+0x40/0x50
       [ 7126.169369][T17511]  pppol2tp_release+0x1a1/0x3f0
       [ 7126.169817][T17511]  __sock_release+0xb3/0x270
       [ 7126.170247][T17511]  ? __pfx_sock_close+0x10/0x10
       [ 7126.170697][T17511]  sock_close+0x1c/0x30
       [ 7126.171087][T17511]  __fput+0x40b/0xb90
       [ 7126.171470][T17511]  task_work_run+0x16c/0x260
       [ 7126.171897][T17511]  ? __pfx_task_work_run+0x10/0x10
       [ 7126.172362][T17511]  ? srso_alias_return_thunk+0x5/0xfbef5
       [ 7126.172863][T17511]  ? do_raw_spin_unlock+0x174/0x230
       [ 7126.173348][T17511]  do_exit+0xaae/0x2b40
       [ 7126.173730][T17511]  ? srso_alias_return_thunk+0x5/0xfbef5
       [ 7126.174235][T17511]  ? __pfx_lock_release+0x10/0x10
       [ 7126.174690][T17511]  ? srso_alias_return_thunk+0x5/0xfbef5
       [ 7126.175190][T17511]  ? do_raw_spin_lock+0x12c/0x2b0
       [ 7126.175650][T17511]  ? __pfx_do_exit+0x10/0x10
       [ 7126.176072][T17511]  ? _raw_spin_unlock_irq+0x23/0x50
       [ 7126.176543][T17511]  do_group_exit+0xd3/0x2a0
       [ 7126.176990][T17511]  __x64_sys_exit_group+0x3e/0x50
       [ 7126.177456][T17511]  x64_sys_call+0x1821/0x1830
       [ 7126.177895][T17511]  do_syscall_64+0xcb/0x250
       [ 7126.178317][T17511]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
      
      Fixes: aa5e17e1 ("l2tp: store l2tpv3 sessions in per-net IDR")
      Signed-off-by: default avatarJames Chapman <jchapman@katalix.com>
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://patch.msgid.link/20240718134348.289865-1-jchapman@katalix.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      d587d825
    • Ido Schimmel's avatar
      ipv4: Fix incorrect source address in Record Route option · cc73bbab
      Ido Schimmel authored
      
      The Record Route IP option records the addresses of the routers that
      routed the packet. In the case of forwarded packets, the kernel performs
      a route lookup via fib_lookup() and fills in the preferred source
      address of the matched route.
      
      The lookup is performed with the DS field of the forwarded packet, but
      using the RT_TOS() macro which only masks one of the two ECN bits. If
      the packet is ECT(0) or CE, the matched route might be different than
      the route via which the packet was forwarded as the input path masks
      both of the ECN bits, resulting in the wrong address being filled in the
      Record Route option.
      
      Fix by masking both of the ECN bits.
      
      Fixes: 8e36360a ("ipv4: Remove route key identity dependencies in ip_rt_get_source().")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
      Link: https://patch.msgid.link/20240718123407.434778-1-idosch@nvidia.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      cc73bbab
  4. Jul 18, 2024
    • Benjamin Coddington's avatar
      SUNRPC: Fix a race to wake a sync task · ed0172af
      Benjamin Coddington authored
      
      We've observed NFS clients with sync tasks sleeping in __rpc_execute
      waiting on RPC_TASK_QUEUED that have not responded to a wake-up from
      rpc_make_runnable().  I suspect this problem usually goes unnoticed,
      because on a busy client the task will eventually be re-awoken by another
      task completion or xprt event.  However, if the state manager is draining
      the slot table, a sync task missing a wake-up can result in a hung client.
      
      We've been able to prove that the waker in rpc_make_runnable() successfully
      calls wake_up_bit() (ie- there's no race to tk_runstate), but the
      wake_up_bit() call fails to wake the waiter.  I suspect the waker is
      missing the load of the bit's wait_queue_head, so waitqueue_active() is
      false.  There are some very helpful comments about this problem above
      wake_up_bit(), prepare_to_wait(), and waitqueue_active().
      
      Fix this by inserting smp_mb__after_atomic() before the wake_up_bit(),
      which pairs with prepare_to_wait() calling set_current_state().
      
      Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      ed0172af
    • Ido Schimmel's avatar
      ipv4: Fix incorrect TOS in fibmatch route get reply · f036e682
      Ido Schimmel authored
      
      The TOS value that is returned to user space in the route get reply is
      the one with which the lookup was performed ('fl4->flowi4_tos'). This is
      fine when the matched route is configured with a TOS as it would not
      match if its TOS value did not match the one with which the lookup was
      performed.
      
      However, matching on TOS is only performed when the route's TOS is not
      zero. It is therefore possible to have the kernel incorrectly return a
      non-zero TOS:
      
       # ip link add name dummy1 up type dummy
       # ip address add 192.0.2.1/24 dev dummy1
       # ip route get fibmatch 192.0.2.2 tos 0xfc
       192.0.2.0/24 tos 0x1c dev dummy1 proto kernel scope link src 192.0.2.1
      
      Fix by instead returning the DSCP field from the FIB result structure
      which was populated during the route lookup.
      
      Output after the patch:
      
       # ip link add name dummy1 up type dummy
       # ip address add 192.0.2.1/24 dev dummy1
       # ip route get fibmatch 192.0.2.2 tos 0xfc
       192.0.2.0/24 dev dummy1 proto kernel scope link src 192.0.2.1
      
      Extend the existing selftests to not only verify that the correct route
      is returned, but that it is also returned with correct "tos" value (or
      without it).
      
      Fixes: b6179813 ("net: ipv4: RTM_GETROUTE: return matched fib result when requested")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f036e682
    • Ido Schimmel's avatar
      ipv4: Fix incorrect TOS in route get reply · 338bb57e
      Ido Schimmel authored
      
      The TOS value that is returned to user space in the route get reply is
      the one with which the lookup was performed ('fl4->flowi4_tos'). This is
      fine when the matched route is configured with a TOS as it would not
      match if its TOS value did not match the one with which the lookup was
      performed.
      
      However, matching on TOS is only performed when the route's TOS is not
      zero. It is therefore possible to have the kernel incorrectly return a
      non-zero TOS:
      
       # ip link add name dummy1 up type dummy
       # ip address add 192.0.2.1/24 dev dummy1
       # ip route get 192.0.2.2 tos 0xfc
       192.0.2.2 tos 0x1c dev dummy1 src 192.0.2.1 uid 0
           cache
      
      Fix by adding a DSCP field to the FIB result structure (inside an
      existing 4 bytes hole), populating it in the route lookup and using it
      when filling the route get reply.
      
      Output after the patch:
      
       # ip link add name dummy1 up type dummy
       # ip address add 192.0.2.1/24 dev dummy1
       # ip route get 192.0.2.2 tos 0xfc
       192.0.2.2 dev dummy1 src 192.0.2.1 uid 0
           cache
      
      Fixes: 1a00fee4 ("ipv4: Remove rt_key_{src,dst,tos} from struct rtable.")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      338bb57e
    • Pablo Neira Ayuso's avatar
      net: flow_dissector: use DEBUG_NET_WARN_ON_ONCE · 120f1c85
      Pablo Neira Ayuso authored
      
      The following splat is easy to reproduce upstream as well as in -stable
      kernels. Florian Westphal provided the following commit:
      
        d1dab4f7 ("net: add and use __skb_get_hash_symmetric_net")
      
      but this complementary fix has been also suggested by Willem de Bruijn
      and it can be easily backported to -stable kernel which consists in
      using DEBUG_NET_WARN_ON_ONCE instead to silence the following splat
      given __skb_get_hash() is used by the nftables tracing infrastructure to
      to identify packets in traces.
      
      [69133.561393] ------------[ cut here ]------------
      [69133.561404] WARNING: CPU: 0 PID: 43576 at net/core/flow_dissector.c:1104 __skb_flow_dissect+0x134f/
      [...]
      [69133.561944] CPU: 0 PID: 43576 Comm: socat Not tainted 6.10.0-rc7+ #379
      [69133.561959] RIP: 0010:__skb_flow_dissect+0x134f/0x2ad0
      [69133.561970] Code: 83 f9 04 0f 84 b3 00 00 00 45 85 c9 0f 84 aa 00 00 00 41 83 f9 02 0f 84 81 fc ff
      ff 44 0f b7 b4 24 80 00 00 00 e9 8b f9 ff ff <0f> 0b e9 20 f3 ff ff 41 f6 c6 20 0f 84 e4 ef ff ff 48 8d 7b 12 e8
      [69133.561979] RSP: 0018:ffffc90000006fc0 EFLAGS: 00010246
      [69133.561988] RAX: 0000000000000000 RBX: ffffffff82f33e20 RCX: ffffffff81ab7e19
      [69133.561994] RDX: dffffc0000000000 RSI: ffffc90000007388 RDI: ffff888103a1b418
      [69133.562001] RBP: ffffc90000007310 R08: 0000000000000000 R09: 0000000000000000
      [69133.562007] R10: ffffc90000007388 R11: ffffffff810cface R12: ffff888103a1b400
      [69133.562013] R13: 0000000000000000 R14: ffffffff82f33e2a R15: ffffffff82f33e28
      [69133.562020] FS:  00007f40f7131740(0000) GS:ffff888390800000(0000) knlGS:0000000000000000
      [69133.562027] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [69133.562033] CR2: 00007f40f7346ee0 CR3: 000000015d200001 CR4: 00000000001706f0
      [69133.562040] Call Trace:
      [69133.562044]  <IRQ>
      [69133.562049]  ? __warn+0x9f/0x1a0
      [ 1211.841384]  ? __skb_flow_dissect+0x107e/0x2860
      [...]
      [ 1211.841496]  ? bpf_flow_dissect+0x160/0x160
      [ 1211.841753]  __skb_get_hash+0x97/0x280
      [ 1211.841765]  ? __skb_get_hash_symmetric+0x230/0x230
      [ 1211.841776]  ? mod_find+0xbf/0xe0
      [ 1211.841786]  ? get_stack_info_noinstr+0x12/0xe0
      [ 1211.841798]  ? bpf_ksym_find+0x56/0xe0
      [ 1211.841807]  ? __rcu_read_unlock+0x2a/0x70
      [ 1211.841819]  nft_trace_init+0x1b9/0x1c0 [nf_tables]
      [ 1211.841895]  ? nft_trace_notify+0x830/0x830 [nf_tables]
      [ 1211.841964]  ? get_stack_info+0x2b/0x80
      [ 1211.841975]  ? nft_do_chain_arp+0x80/0x80 [nf_tables]
      [ 1211.842044]  nft_do_chain+0x79c/0x850 [nf_tables]
      
      Fixes: 9b52e3f2 ("flow_dissector: handle no-skb use case")
      Suggested-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://patch.msgid.link/20240715141442.43775-1-pablo@netfilter.org
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      120f1c85
  5. Jul 17, 2024
  6. Jul 16, 2024
    • Kees Cook's avatar
      tcp: Replace strncpy() with strscpy() · a3bfc095
      Kees Cook authored
      Replace the deprecated[1] uses of strncpy() in tcp_ca_get_name_by_key()
      and tcp_get_default_congestion_control(). The callers use the results as
      standard C strings (via nla_put_string() and proc handlers respectively),
      so trailing padding is not needed.
      
      Since passing the destination buffer arguments decays it to a pointer,
      the size can't be trivially determined by the compiler. ca->name is
      the same length in both cases, so strscpy() won't fail (when ca->name
      is NUL-terminated). Include the length explicitly instead of using the
      2-argument strscpy().
      
      Link: https://github.com/KSPP/linux/issues/90
      
       [1]
      Signed-off-by: default avatarKees Cook <kees@kernel.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://patch.msgid.link/20240714041111.it.918-kees@kernel.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a3bfc095
    • Kuniyuki Iwashima's avatar
      tcp: Don't access uninit tcp_rsk(req)->ao_keyid in tcp_create_openreq_child(). · 3f451813
      Kuniyuki Iwashima authored
      
      syzkaller reported KMSAN splat in tcp_create_openreq_child(). [0]
      
      The uninit variable is tcp_rsk(req)->ao_keyid.
      
      tcp_rsk(req)->ao_keyid is initialised only when tcp_conn_request() finds
      a valid TCP AO option in SYN.  Then, tcp_rsk(req)->used_tcp_ao is set
      accordingly.
      
      Let's not read tcp_rsk(req)->ao_keyid when tcp_rsk(req)->used_tcp_ao is
      false.
      
      [0]:
      BUG: KMSAN: uninit-value in tcp_create_openreq_child+0x198b/0x1ff0 net/ipv4/tcp_minisocks.c:610
       tcp_create_openreq_child+0x198b/0x1ff0 net/ipv4/tcp_minisocks.c:610
       tcp_v4_syn_recv_sock+0x18e/0x2170 net/ipv4/tcp_ipv4.c:1754
       tcp_check_req+0x1a3e/0x20c0 net/ipv4/tcp_minisocks.c:852
       tcp_v4_rcv+0x26a4/0x53a0 net/ipv4/tcp_ipv4.c:2265
       ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205
       ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233
       NF_HOOK include/linux/netfilter.h:314 [inline]
       ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254
       dst_input include/net/dst.h:460 [inline]
       ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline]
       ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline]
       ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639
       ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674
       __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline]
       __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751
       __netif_receive_skb_list net/core/dev.c:5803 [inline]
       netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895
       gro_normal_list include/net/gro.h:515 [inline]
       napi_complete_done+0x3f2/0x990 net/core/dev.c:6246
       e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808
       __napi_poll+0xd9/0x990 net/core/dev.c:6771
       napi_poll net/core/dev.c:6840 [inline]
       net_rx_action+0x90f/0x17e0 net/core/dev.c:6962
       handle_softirqs+0x152/0x6b0 kernel/softirq.c:554
       __do_softirq kernel/softirq.c:588 [inline]
       invoke_softirq kernel/softirq.c:428 [inline]
       __irq_exit_rcu kernel/softirq.c:637 [inline]
       irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649
       common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278
       asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
       __msan_instrument_asm_store+0xd6/0xe0
       arch_atomic_inc arch/x86/include/asm/atomic.h:53 [inline]
       raw_atomic_inc include/linux/atomic/atomic-arch-fallback.h:992 [inline]
       atomic_inc include/linux/atomic/atomic-instrumented.h:436 [inline]
       page_ref_inc include/linux/page_ref.h:153 [inline]
       folio_ref_inc include/linux/page_ref.h:160 [inline]
       filemap_map_order0_folio mm/filemap.c:3596 [inline]
       filemap_map_pages+0x11c7/0x2270 mm/filemap.c:3644
       do_fault_around mm/memory.c:4879 [inline]
       do_read_fault mm/memory.c:4912 [inline]
       do_fault mm/memory.c:5051 [inline]
       do_pte_missing mm/memory.c:3897 [inline]
       handle_pte_fault mm/memory.c:5381 [inline]
       __handle_mm_fault mm/memory.c:5524 [inline]
       handle_mm_fault+0x3677/0x6f00 mm/memory.c:5689
       do_user_addr_fault+0x1373/0x2b20 arch/x86/mm/fault.c:1338
       handle_page_fault arch/x86/mm/fault.c:1481 [inline]
       exc_page_fault+0x54/0xc0 arch/x86/mm/fault.c:1539
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
      
      Uninit was stored to memory at:
       tcp_create_openreq_child+0x1984/0x1ff0 net/ipv4/tcp_minisocks.c:611
       tcp_v4_syn_recv_sock+0x18e/0x2170 net/ipv4/tcp_ipv4.c:1754
       tcp_check_req+0x1a3e/0x20c0 net/ipv4/tcp_minisocks.c:852
       tcp_v4_rcv+0x26a4/0x53a0 net/ipv4/tcp_ipv4.c:2265
       ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205
       ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233
       NF_HOOK include/linux/netfilter.h:314 [inline]
       ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254
       dst_input include/net/dst.h:460 [inline]
       ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline]
       ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline]
       ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639
       ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674
       __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline]
       __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751
       __netif_receive_skb_list net/core/dev.c:5803 [inline]
       netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895
       gro_normal_list include/net/gro.h:515 [inline]
       napi_complete_done+0x3f2/0x990 net/core/dev.c:6246
       e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808
       __napi_poll+0xd9/0x990 net/core/dev.c:6771
       napi_poll net/core/dev.c:6840 [inline]
       net_rx_action+0x90f/0x17e0 net/core/dev.c:6962
       handle_softirqs+0x152/0x6b0 kernel/softirq.c:554
       __do_softirq kernel/softirq.c:588 [inline]
       invoke_softirq kernel/softirq.c:428 [inline]
       __irq_exit_rcu kernel/softirq.c:637 [inline]
       irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649
       common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278
       asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
      
      Uninit was created at:
       __alloc_pages_noprof+0x82d/0xcb0 mm/page_alloc.c:4706
       __alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
       alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
       alloc_slab_page mm/slub.c:2265 [inline]
       allocate_slab mm/slub.c:2428 [inline]
       new_slab+0x2af/0x14e0 mm/slub.c:2481
       ___slab_alloc+0xf73/0x3150 mm/slub.c:3667
       __slab_alloc mm/slub.c:3757 [inline]
       __slab_alloc_node mm/slub.c:3810 [inline]
       slab_alloc_node mm/slub.c:3990 [inline]
       kmem_cache_alloc_noprof+0x53a/0x9f0 mm/slub.c:4009
       reqsk_alloc_noprof net/ipv4/inet_connection_sock.c:920 [inline]
       inet_reqsk_alloc+0x63/0x700 net/ipv4/inet_connection_sock.c:951
       tcp_conn_request+0x339/0x4860 net/ipv4/tcp_input.c:7177
       tcp_v4_conn_request+0x13b/0x190 net/ipv4/tcp_ipv4.c:1719
       tcp_rcv_state_process+0x2dd/0x4a10 net/ipv4/tcp_input.c:6711
       tcp_v4_do_rcv+0xbee/0x10d0 net/ipv4/tcp_ipv4.c:1932
       tcp_v4_rcv+0x3fad/0x53a0 net/ipv4/tcp_ipv4.c:2334
       ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205
       ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233
       NF_HOOK include/linux/netfilter.h:314 [inline]
       ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254
       dst_input include/net/dst.h:460 [inline]
       ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline]
       ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline]
       ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639
       ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674
       __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline]
       __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751
       __netif_receive_skb_list net/core/dev.c:5803 [inline]
       netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895
       gro_normal_list include/net/gro.h:515 [inline]
       napi_complete_done+0x3f2/0x990 net/core/dev.c:6246
       e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808
       __napi_poll+0xd9/0x990 net/core/dev.c:6771
       napi_poll net/core/dev.c:6840 [inline]
       net_rx_action+0x90f/0x17e0 net/core/dev.c:6962
       handle_softirqs+0x152/0x6b0 kernel/softirq.c:554
       __do_softirq kernel/softirq.c:588 [inline]
       invoke_softirq kernel/softirq.c:428 [inline]
       __irq_exit_rcu kernel/softirq.c:637 [inline]
       irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649
       common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278
       asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
      
      CPU: 0 PID: 239 Comm: modprobe Tainted: G    B              6.10.0-rc7-01816-g852e42cc2dd4 #3 1107521f0c7b55c9309062382d0bda9f604dbb6d
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
      
      Fixes: 06b22ef2 ("net/tcp: Wire TCP-AO to request sockets")
      Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarDmitry Safonov <0x7f454c46@gmail.com>
      Link: https://patch.msgid.link/20240714161719.6528-1-kuniyu@amazon.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      3f451813
  7. Jul 15, 2024
Loading