1. 12 May, 2023 3 commits
  2. 11 May, 2023 19 commits
  3. 10 May, 2023 18 commits
    • Linus Torvalds's avatar
      Merge tag 'fsnotify_for_v6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · d295b66a
      Linus Torvalds authored
      Pull inotify fix from Jan Kara:
       "A fix for possibly reporting invalid watch descriptor with inotify
        event"
      
      * tag 'fsnotify_for_v6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        inotify: Avoid reporting event with invalid wd
      d295b66a
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v6.3-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 2a78769d
      Linus Torvalds authored
      Pull gfs2 fix from Andreas Gruenbacher:
      
       - Fix a NULL pointer dereference when mounting corrupted filesystems
      
      * tag 'gfs2-v6.3-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Don't deref jdesc in evict
      2a78769d
    • Bob Peterson's avatar
      gfs2: Don't deref jdesc in evict · 504a10d9
      Bob Peterson authored
      On corrupt gfs2 file systems the evict code can try to reference the
      journal descriptor structure, jdesc, after it has been freed and set to
      NULL. The sequence of events is:
      
      init_journal()
      ...
      fail_jindex:
         gfs2_jindex_free(sdp); <------frees journals, sets jdesc = NULL
            if (gfs2_holder_initialized(&ji_gh))
               gfs2_glock_dq_uninit(&ji_gh);
      fail:
         iput(sdp->sd_jindex); <--references jdesc in evict_linked_inode
            evict()
               gfs2_evict_inode()
                  evict_linked_inode()
                     ret = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks);
      <------references the now freed/zeroed sd_jdesc pointer.
      
      The call to gfs2_trans_begin is done because the truncate_inode_pages
      call can cause gfs2 events that require a transaction, such as removing
      journaled data (jdata) blocks from the journal.
      
      This patch fixes the problem by adding a check for sdp->sd_jdesc to
      function gfs2_evict_inode. In theory, this should only happen to corrupt
      gfs2 file systems, when gfs2 detects the problem, reports it, then tries
      to evict all the system inodes it has read in up to that point.
      Reported-by: default avatarYang Lan <lanyang0908@gmail.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      504a10d9
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.4-2' of... · ad2fd53a
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
       "Nothing special to report just various small fixes:
      
         - thinkpad_acpi: Fix profile (performance/bal/low-power) regression
           on T490
      
         - misc other small fixes / hw-id additions"
      
      * tag 'platform-drivers-x86-v6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/mellanox: fix potential race in mlxbf-tmfifo driver
        platform/x86: touchscreen_dmi: Add info for the Dexp Ursus KX210i
        platform/x86: touchscreen_dmi: Add upside-down quirk for GDIX1002 ts on the Juno Tablet
        platform/x86: thinkpad_acpi: Add profile force ability
        platform/x86: thinkpad_acpi: Fix platform profiles on T490
        platform/x86: hp-wmi: add micmute to hp_wmi_keymap struct
        platform/x86/intel-uncore-freq: Return error on write frequency
        platform/x86: intel_scu_pcidrv: Add back PCI ID for Medfield
      ad2fd53a
    • Colin Foster's avatar
      net: mscc: ocelot: fix stat counter register values · cdc2e28e
      Colin Foster authored
      Commit d4c36765 ("net: mscc: ocelot: keep ocelot_stat_layout by reg
      address, not offset") organized the stats counters for Ocelot chips, namely
      the VSC7512 and VSC7514. A few of the counter offsets were incorrect, and
      were caught by this warning:
      
      WARNING: CPU: 0 PID: 24 at drivers/net/ethernet/mscc/ocelot_stats.c:909
      ocelot_stats_init+0x1fc/0x2d8
      reg 0x5000078 had address 0x220 but reg 0x5000079 has address 0x214,
      bulking broken!
      
      Fix these register offsets.
      
      Fixes: d4c36765 ("net: mscc: ocelot: keep ocelot_stat_layout by reg address, not offset")
      Signed-off-by: default avatarColin Foster <colin.foster@in-advantage.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cdc2e28e
    • Ilia.Gavrilov's avatar
      sctp: fix a potential OOB access in sctp_sched_set_sched() · 059fa492
      Ilia.Gavrilov authored
      The 'sched' index value must be checked before accessing an element
      of the 'sctp_sched_ops' array. Otherwise, it can lead to OOB access.
      
      Note that it's harmless since the 'sched' parameter is checked before
      calling 'sctp_sched_set_sched'.
      
      Found by InfoTeCS on behalf of Linux Verification Center
      (linuxtesting.org) with SVACE.
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarIlia.Gavrilov <Ilia.Gavrilov@infotecs.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      059fa492
    • wuych's avatar
      net: liquidio: lio_vf_main: Remove unnecessary (void*) conversions · 6096bc05
      wuych authored
      Pointer variables of void * type do not require type cast.
      Signed-off-by: default avatarwuych <yunchuan@nfschina.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6096bc05
    • Subbaraya Sundeep's avatar
      macsec: Use helper macsec_netdev_priv for offload drivers · bd9424ef
      Subbaraya Sundeep authored
      Now macsec on top of vlan can be offloaded to macsec offloading
      devices so that VLAN tag is sent in clear text on wire i.e,
      packet structure is DMAC|SMAC|VLAN|SECTAG. Offloading devices can
      simply enable NETIF_F_HW_MACSEC feature in netdev->vlan_features for
      this to work. But the logic in offloading drivers to retrieve the
      private structure from netdev needs to be changed to check whether
      the netdev received is real device or a vlan device and get private
      structure accordingly. This patch changes the offloading drivers to
      use helper macsec_netdev_priv instead of netdev_priv.
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd9424ef
    • t.feng's avatar
      ipvlan:Fix out-of-bounds caused by unclear skb->cb · 90cbed52
      t.feng authored
      If skb enqueue the qdisc, fq_skb_cb(skb)->time_to_send is changed which
      is actually skb->cb, and IPCB(skb_in)->opt will be used in
      __ip_options_echo. It is possible that memcpy is out of bounds and lead
      to stack overflow.
      We should clear skb->cb before ip_local_out or ip6_local_out.
      
      v2:
      1. clean the stack info
      2. use IPCB/IP6CB instead of skb->cb
      
      crash on stable-5.10(reproduce in kasan kernel).
      Stack info:
      [ 2203.651571] BUG: KASAN: stack-out-of-bounds in
      __ip_options_echo+0x589/0x800
      [ 2203.653327] Write of size 4 at addr ffff88811a388f27 by task
      swapper/3/0
      [ 2203.655460] CPU: 3 PID: 0 Comm: swapper/3 Kdump: loaded Not tainted
      5.10.0-60.18.0.50.h856.kasan.eulerosv2r11.x86_64 #1
      [ 2203.655466] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
      BIOS rel-1.10.2-0-g5f4c7b1-20181220_000000-szxrtosci10000 04/01/2014
      [ 2203.655475] Call Trace:
      [ 2203.655481]  <IRQ>
      [ 2203.655501]  dump_stack+0x9c/0xd3
      [ 2203.655514]  print_address_description.constprop.0+0x19/0x170
      [ 2203.655530]  __kasan_report.cold+0x6c/0x84
      [ 2203.655586]  kasan_report+0x3a/0x50
      [ 2203.655594]  check_memory_region+0xfd/0x1f0
      [ 2203.655601]  memcpy+0x39/0x60
      [ 2203.655608]  __ip_options_echo+0x589/0x800
      [ 2203.655654]  __icmp_send+0x59a/0x960
      [ 2203.655755]  nf_send_unreach+0x129/0x3d0 [nf_reject_ipv4]
      [ 2203.655763]  reject_tg+0x77/0x1bf [ipt_REJECT]
      [ 2203.655772]  ipt_do_table+0x691/0xa40 [ip_tables]
      [ 2203.655821]  nf_hook_slow+0x69/0x100
      [ 2203.655828]  __ip_local_out+0x21e/0x2b0
      [ 2203.655857]  ip_local_out+0x28/0x90
      [ 2203.655868]  ipvlan_process_v4_outbound+0x21e/0x260 [ipvlan]
      [ 2203.655931]  ipvlan_xmit_mode_l3+0x3bd/0x400 [ipvlan]
      [ 2203.655967]  ipvlan_queue_xmit+0xb3/0x190 [ipvlan]
      [ 2203.655977]  ipvlan_start_xmit+0x2e/0xb0 [ipvlan]
      [ 2203.655984]  xmit_one.constprop.0+0xe1/0x280
      [ 2203.655992]  dev_hard_start_xmit+0x62/0x100
      [ 2203.656000]  sch_direct_xmit+0x215/0x640
      [ 2203.656028]  __qdisc_run+0x153/0x1f0
      [ 2203.656069]  __dev_queue_xmit+0x77f/0x1030
      [ 2203.656173]  ip_finish_output2+0x59b/0xc20
      [ 2203.656244]  __ip_finish_output.part.0+0x318/0x3d0
      [ 2203.656312]  ip_finish_output+0x168/0x190
      [ 2203.656320]  ip_output+0x12d/0x220
      [ 2203.656357]  __ip_queue_xmit+0x392/0x880
      [ 2203.656380]  __tcp_transmit_skb+0x1088/0x11c0
      [ 2203.656436]  __tcp_retransmit_skb+0x475/0xa30
      [ 2203.656505]  tcp_retransmit_skb+0x2d/0x190
      [ 2203.656512]  tcp_retransmit_timer+0x3af/0x9a0
      [ 2203.656519]  tcp_write_timer_handler+0x3ba/0x510
      [ 2203.656529]  tcp_write_timer+0x55/0x180
      [ 2203.656542]  call_timer_fn+0x3f/0x1d0
      [ 2203.656555]  expire_timers+0x160/0x200
      [ 2203.656562]  run_timer_softirq+0x1f4/0x480
      [ 2203.656606]  __do_softirq+0xfd/0x402
      [ 2203.656613]  asm_call_irq_on_stack+0x12/0x20
      [ 2203.656617]  </IRQ>
      [ 2203.656623]  do_softirq_own_stack+0x37/0x50
      [ 2203.656631]  irq_exit_rcu+0x134/0x1a0
      [ 2203.656639]  sysvec_apic_timer_interrupt+0x36/0x80
      [ 2203.656646]  asm_sysvec_apic_timer_interrupt+0x12/0x20
      [ 2203.656654] RIP: 0010:default_idle+0x13/0x20
      [ 2203.656663] Code: 89 f0 5d 41 5c 41 5d 41 5e c3 cc cc cc cc cc cc cc
      cc cc cc cc cc cc 0f 1f 44 00 00 0f 1f 44 00 00 0f 00 2d 9f 32 57 00 fb
      f4 <c3> cc cc cc cc 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 54 be 08
      [ 2203.656668] RSP: 0018:ffff88810036fe78 EFLAGS: 00000256
      [ 2203.656676] RAX: ffffffffaf2a87f0 RBX: ffff888100360000 RCX:
      ffffffffaf290191
      [ 2203.656681] RDX: 0000000000098b5e RSI: 0000000000000004 RDI:
      ffff88811a3c4f60
      [ 2203.656686] RBP: 0000000000000000 R08: 0000000000000001 R09:
      ffff88811a3c4f63
      [ 2203.656690] R10: ffffed10234789ec R11: 0000000000000001 R12:
      0000000000000003
      [ 2203.656695] R13: ffff888100360000 R14: 0000000000000000 R15:
      0000000000000000
      [ 2203.656729]  default_idle_call+0x5a/0x150
      [ 2203.656735]  cpuidle_idle_call+0x1c6/0x220
      [ 2203.656780]  do_idle+0xab/0x100
      [ 2203.656786]  cpu_startup_entry+0x19/0x20
      [ 2203.656793]  secondary_startup_64_no_verify+0xc2/0xcb
      
      [ 2203.657409] The buggy address belongs to the page:
      [ 2203.658648] page:0000000027a9842f refcount:1 mapcount:0
      mapping:0000000000000000 index:0x0 pfn:0x11a388
      [ 2203.658665] flags:
      0x17ffffc0001000(reserved|node=0|zone=2|lastcpupid=0x1fffff)
      [ 2203.658675] raw: 0017ffffc0001000 ffffea000468e208 ffffea000468e208
      0000000000000000
      [ 2203.658682] raw: 0000000000000000 0000000000000000 00000001ffffffff
      0000000000000000
      [ 2203.658686] page dumped because: kasan: bad access detected
      
      To reproduce(ipvlan with IPVLAN_MODE_L3):
      Env setting:
      =======================================================
      modprobe ipvlan ipvlan_default_mode=1
      sysctl net.ipv4.conf.eth0.forwarding=1
      iptables -t nat -A POSTROUTING -s 20.0.0.0/255.255.255.0 -o eth0 -j
      MASQUERADE
      ip link add gw link eth0 type ipvlan
      ip -4 addr add 20.0.0.254/24 dev gw
      ip netns add net1
      ip link add ipv1 link eth0 type ipvlan
      ip link set ipv1 netns net1
      ip netns exec net1 ip link set ipv1 up
      ip netns exec net1 ip -4 addr add 20.0.0.4/24 dev ipv1
      ip netns exec net1 route add default gw 20.0.0.254
      ip netns exec net1 tc qdisc add dev ipv1 root netem loss 10%
      ifconfig gw up
      iptables -t filter -A OUTPUT -p tcp --dport 8888 -j REJECT --reject-with
      icmp-port-unreachable
      =======================================================
      And then excute the shell(curl any address of eth0 can reach):
      
      for((i=1;i<=100000;i++))
      do
              ip netns exec net1 curl x.x.x.x:8888
      done
      =======================================================
      
      Fixes: 2ad7bf36 ("ipvlan: Initial check-in of the IPVLAN driver.")
      Signed-off-by: default avatar"t.feng" <fengtao40@huawei.com>
      Suggested-by: default avatarFlorian Westphal <fw@strlen.de>
      Reviewed-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      90cbed52
    • Randy Dunlap's avatar
      docs: networking: fix x25-iface.rst heading & index order · 77c964da
      Randy Dunlap authored
      Fix the chapter heading for "X.25 Device Driver Interface" so that it
      does not contain a trailing '-' character, which makes Sphinx
      omit this heading from the contents.
      
      Reverse the order of the x25.rst and x25-iface.rst files in the index
      so that the project introduction (x25.rst) comes first.
      
      Fixes: 883780af ("docs: networking: convert x25-iface.txt to ReST")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: linux-doc@vger.kernel.org
      Cc: Martin Schiller <ms@dev.tdt.de>
      Cc: linux-x25@vger.kernel.org
      Reviewed-by: default avatarBagas Sanjaya <bagasdotme@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77c964da
    • Ziwei Xiao's avatar
      gve: Remove the code of clearing PBA bit · f4c2e67c
      Ziwei Xiao authored
      Clearing the PBA bit from the driver is race prone and it may lead to
      dropped interrupt events. This could potentially lead to the traffic
      being completely halted.
      
      Fixes: 5e8c5adf ("gve: DQO: Add core netdev features")
      Signed-off-by: default avatarZiwei Xiao <ziweixiao@google.com>
      Signed-off-by: default avatarBailey Forrest <bcf@google.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4c2e67c
    • Eric Dumazet's avatar
      tcp: add annotations around sk->sk_shutdown accesses · e14cadfd
      Eric Dumazet authored
      Now sk->sk_shutdown is no longer a bitfield, we can add
      standard READ_ONCE()/WRITE_ONCE() annotations to silence
      KCSAN reports like the following:
      
      BUG: KCSAN: data-race in tcp_disconnect / tcp_poll
      
      write to 0xffff88814588582c of 1 bytes by task 3404 on cpu 1:
      tcp_disconnect+0x4d6/0xdb0 net/ipv4/tcp.c:3121
      __inet_stream_connect+0x5dd/0x6e0 net/ipv4/af_inet.c:715
      inet_stream_connect+0x48/0x70 net/ipv4/af_inet.c:727
      __sys_connect_file net/socket.c:2001 [inline]
      __sys_connect+0x19b/0x1b0 net/socket.c:2018
      __do_sys_connect net/socket.c:2028 [inline]
      __se_sys_connect net/socket.c:2025 [inline]
      __x64_sys_connect+0x41/0x50 net/socket.c:2025
      do_syscall_x64 arch/x86/entry/common.c:50 [inline]
      do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
      entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      read to 0xffff88814588582c of 1 bytes by task 3374 on cpu 0:
      tcp_poll+0x2e6/0x7d0 net/ipv4/tcp.c:562
      sock_poll+0x253/0x270 net/socket.c:1383
      vfs_poll include/linux/poll.h:88 [inline]
      io_poll_check_events io_uring/poll.c:281 [inline]
      io_poll_task_func+0x15a/0x820 io_uring/poll.c:333
      handle_tw_list io_uring/io_uring.c:1184 [inline]
      tctx_task_work+0x1fe/0x4d0 io_uring/io_uring.c:1246
      task_work_run+0x123/0x160 kernel/task_work.c:179
      get_signal+0xe64/0xff0 kernel/signal.c:2635
      arch_do_signal_or_restart+0x89/0x2a0 arch/x86/kernel/signal.c:306
      exit_to_user_mode_loop+0x6f/0xe0 kernel/entry/common.c:168
      exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204
      __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
      syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:297
      do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
      entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      value changed: 0x03 -> 0x00
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e14cadfd
    • Eric Dumazet's avatar
      net: add vlan_get_protocol_and_depth() helper · 4063384e
      Eric Dumazet authored
      Before blamed commit, pskb_may_pull() was used instead
      of skb_header_pointer() in __vlan_get_protocol() and friends.
      
      Few callers depended on skb->head being populated with MAC header,
      syzbot caught one of them (skb_mac_gso_segment())
      
      Add vlan_get_protocol_and_depth() to make the intent clearer
      and use it where sensible.
      
      This is a more generic fix than commit e9d3f809
      ("net/af_packet: make sure to pull mac header") which was
      dealing with a similar issue.
      
      kernel BUG at include/linux/skbuff.h:2655 !
      invalid opcode: 0000 [#1] SMP KASAN
      CPU: 0 PID: 1441 Comm: syz-executor199 Not tainted 6.1.24-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
      RIP: 0010:__skb_pull include/linux/skbuff.h:2655 [inline]
      RIP: 0010:skb_mac_gso_segment+0x68f/0x6a0 net/core/gro.c:136
      Code: fd 48 8b 5c 24 10 44 89 6b 70 48 c7 c7 c0 ae 0d 86 44 89 e6 e8 a1 91 d0 00 48 c7 c7 00 af 0d 86 48 89 de 31 d2 e8 d1 4a e9 ff <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41
      RSP: 0018:ffffc90001bd7520 EFLAGS: 00010286
      RAX: ffffffff8469736a RBX: ffff88810f31dac0 RCX: ffff888115a18b00
      RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
      RBP: ffffc90001bd75e8 R08: ffffffff84697183 R09: fffff5200037adf9
      R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000012
      R13: 000000000000fee5 R14: 0000000000005865 R15: 000000000000fed7
      FS: 000055555633f300(0000) GS:ffff8881f6a00000(0000) knlGS:0000000000000000
      CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000020000000 CR3: 0000000116fea000 CR4: 00000000003506f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
      <TASK>
      [<ffffffff847018dd>] __skb_gso_segment+0x32d/0x4c0 net/core/dev.c:3419
      [<ffffffff8470398a>] skb_gso_segment include/linux/netdevice.h:4819 [inline]
      [<ffffffff8470398a>] validate_xmit_skb+0x3aa/0xee0 net/core/dev.c:3725
      [<ffffffff84707042>] __dev_queue_xmit+0x1332/0x3300 net/core/dev.c:4313
      [<ffffffff851a9ec7>] dev_queue_xmit+0x17/0x20 include/linux/netdevice.h:3029
      [<ffffffff851b4a82>] packet_snd net/packet/af_packet.c:3111 [inline]
      [<ffffffff851b4a82>] packet_sendmsg+0x49d2/0x6470 net/packet/af_packet.c:3142
      [<ffffffff84669a12>] sock_sendmsg_nosec net/socket.c:716 [inline]
      [<ffffffff84669a12>] sock_sendmsg net/socket.c:736 [inline]
      [<ffffffff84669a12>] __sys_sendto+0x472/0x5f0 net/socket.c:2139
      [<ffffffff84669c75>] __do_sys_sendto net/socket.c:2151 [inline]
      [<ffffffff84669c75>] __se_sys_sendto net/socket.c:2147 [inline]
      [<ffffffff84669c75>] __x64_sys_sendto+0xe5/0x100 net/socket.c:2147
      [<ffffffff8551d40f>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
      [<ffffffff8551d40f>] do_syscall_64+0x2f/0x50 arch/x86/entry/common.c:80
      [<ffffffff85600087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      Fixes: 469acedd ("vlan: consolidate VLAN parsing code and limit max parsing depth")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Toke Høiland-Jørgensen <toke@redhat.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4063384e
    • Russell King (Oracle)'s avatar
      net: pcs: xpcs: fix incorrect number of interfaces · 43fb622d
      Russell King (Oracle) authored
      In synopsys_xpcs_compat[], the DW_XPCS_2500BASEX entry was setting
      the number of interfaces using the xpcs_2500basex_features array
      rather than xpcs_2500basex_interfaces. This causes us to overflow
      the array of interfaces. Fix this.
      
      Fixes: f27abde3 ("net: pcs: add 2500BASEX support for Intel mGbE controller")
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43fb622d
    • Liang Li's avatar
      selftests: bonding: delete unnecessary line · 2f0f5567
      Liang Li authored
      "ip link set dev "$devbond1" nomaster"
      This line code in bond-eth-type-change.sh is unnecessary.
      Because $devbond1 was not added to any master device.
      Signed-off-by: default avatarLiang Li <liali@redhat.com>
      Acked-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Reviewed-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2f0f5567
    • Eric Dumazet's avatar
      net: deal with most data-races in sk_wait_event() · d0ac89f6
      Eric Dumazet authored
      __condition is evaluated twice in sk_wait_event() macro.
      
      First invocation is lockless, and reads can race with writes,
      as spotted by syzbot.
      
      BUG: KCSAN: data-race in sk_stream_wait_connect / tcp_disconnect
      
      write to 0xffff88812d83d6a0 of 4 bytes by task 9065 on cpu 1:
      tcp_disconnect+0x2cd/0xdb0
      inet_shutdown+0x19e/0x1f0 net/ipv4/af_inet.c:911
      __sys_shutdown_sock net/socket.c:2343 [inline]
      __sys_shutdown net/socket.c:2355 [inline]
      __do_sys_shutdown net/socket.c:2363 [inline]
      __se_sys_shutdown+0xf8/0x140 net/socket.c:2361
      __x64_sys_shutdown+0x31/0x40 net/socket.c:2361
      do_syscall_x64 arch/x86/entry/common.c:50 [inline]
      do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
      entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      read to 0xffff88812d83d6a0 of 4 bytes by task 9040 on cpu 0:
      sk_stream_wait_connect+0x1de/0x3a0 net/core/stream.c:75
      tcp_sendmsg_locked+0x2e4/0x2120 net/ipv4/tcp.c:1266
      tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1484
      inet6_sendmsg+0x63/0x80 net/ipv6/af_inet6.c:651
      sock_sendmsg_nosec net/socket.c:724 [inline]
      sock_sendmsg net/socket.c:747 [inline]
      __sys_sendto+0x246/0x300 net/socket.c:2142
      __do_sys_sendto net/socket.c:2154 [inline]
      __se_sys_sendto net/socket.c:2150 [inline]
      __x64_sys_sendto+0x78/0x90 net/socket.c:2150
      do_syscall_x64 arch/x86/entry/common.c:50 [inline]
      do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
      entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      value changed: 0x00000000 -> 0x00000068
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0ac89f6
    • Eric Dumazet's avatar
      net: annotate sk->sk_err write from do_recvmmsg() · e05a5f51
      Eric Dumazet authored
      do_recvmmsg() can write to sk->sk_err from multiple threads.
      
      As said before, many other points reading or writing sk_err
      need annotations.
      
      Fixes: 34b88a68 ("net: Fix use after free in the recvmmsg exit path")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e05a5f51
    • Lorenzo Bianconi's avatar
      net: veth: make PAGE_POOL_STATS optional · 5e316a81
      Lorenzo Bianconi authored
      Since veth is very likely to be enabled and there are some drivers
      (e.g. mlx5) where CONFIG_PAGE_POOL_STATS is optional, make
      CONFIG_PAGE_POOL_STATS optional for veth too in order to keep it
      optional instead of required.
      Suggested-by: default avatarJiri Benc <jbenc@redhat.com>
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5e316a81