1. 12 Jan, 2023 3 commits
  2. 11 Jan, 2023 5 commits
  3. 10 Jan, 2023 26 commits
  4. 09 Jan, 2023 6 commits
    • Jiasheng Jiang's avatar
      ice: Add check for kzalloc · 40543b3d
      Jiasheng Jiang authored
      Add the check for the return value of kzalloc in order to avoid
      NULL pointer dereference.
      Moreover, use the goto-label to share the clean code.
      
      Fixes: d6b98c8d ("ice: add write functionality for GNSS TTY")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      40543b3d
    • Yuan Can's avatar
      ice: Fix potential memory leak in ice_gnss_tty_write() · f5898562
      Yuan Can authored
      The ice_gnss_tty_write() return directly if the write_buf alloc failed,
      leaking the cmd_buf.
      
      Fix by free cmd_buf if write_buf alloc failed.
      
      Fixes: d6b98c8d ("ice: add write functionality for GNSS TTY")
      Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      f5898562
    • Mirsad Goran Todorovac's avatar
      af_unix: selftest: Fix the size of the parameter to connect() · 7d6ceeb1
      Mirsad Goran Todorovac authored
      Adjust size parameter in connect() to match the type of the parameter, to
      fix "No such file or directory" error in selftests/net/af_unix/
      test_oob_unix.c:127.
      
      The existing code happens to work provided that the autogenerated pathname
      is shorter than sizeof (struct sockaddr), which is why it hasn't been
      noticed earlier.
      
      Visible from the trace excerpt:
      
      bind(3, {sa_family=AF_UNIX, sun_path="unix_oob_453059"}, 110) = 0
      clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fa6a6577a10) = 453060
      [pid <child>] connect(6, {sa_family=AF_UNIX, sun_path="unix_oob_45305"}, 16) = -1 ENOENT (No such file or directory)
      
      BUG: The filename is trimmed to sizeof (struct sockaddr).
      
      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: Shuah Khan <shuah@kernel.org>
      Cc: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
      Cc: Florian Westphal <fw@strlen.de>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Fixes: 314001f0 ("af_unix: Add OOB support")
      Signed-off-by: default avatarMirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
      Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d6ceeb1
    • Horatiu Vultur's avatar
      net: lan966x: Allow to add rules in TCAM even if not enabled · 76761bab
      Horatiu Vultur authored
      The blamed commit implemented the vcap_operations to allow to add an
      entry in the TCAM. One of the callbacks is to validate the supported
      keysets. If the TCAM lookup was not enabled, then this will return
      failure so no entries could be added.
      This doesn't make much sense, as you can enable at a later point the
      TCAM. Therefore change it such to allow entries in TCAM even it is not
      enabled.
      
      Fixes: 4426b78c ("net: lan966x: Add port keyset config and callback interface")
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      76761bab
    • Eric Dumazet's avatar
      gro: take care of DODGY packets · 7871f54e
      Eric Dumazet authored
      Jaroslav reported a recent throughput regression with virtio_net
      caused by blamed commit.
      
      It is unclear if DODGY GSO packets coming from user space
      can be accepted by GRO engine in the future with minimal
      changes, and if there is any expected gain from it.
      
      In the meantime, make sure to detect and flush DODGY packets.
      
      Fixes: 5eddb249 ("gro: add support of (hw)gro packets to gro stack")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-and-bisected-by: default avatarJaroslav Pulchart <jaroslav.pulchart@gooddata.com>
      Cc: Coco Li <lixiaoyan@google.com>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7871f54e
    • Minsuk Kang's avatar
      nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame() · 9dab880d
      Minsuk Kang authored
      Fix a use-after-free that occurs in hcd when in_urb sent from
      pn533_usb_send_frame() is completed earlier than out_urb. Its callback
      frees the skb data in pn533_send_async_complete() that is used as a
      transfer buffer of out_urb. Wait before sending in_urb until the
      callback of out_urb is called. To modify the callback of out_urb alone,
      separate the complete function of out_urb and ack_urb.
      
      Found by a modified version of syzkaller.
      
      BUG: KASAN: use-after-free in dummy_timer
      Call Trace:
       memcpy (mm/kasan/shadow.c:65)
       dummy_perform_transfer (drivers/usb/gadget/udc/dummy_hcd.c:1352)
       transfer (drivers/usb/gadget/udc/dummy_hcd.c:1453)
       dummy_timer (drivers/usb/gadget/udc/dummy_hcd.c:1972)
       arch_static_branch (arch/x86/include/asm/jump_label.h:27)
       static_key_false (include/linux/jump_label.h:207)
       timer_expire_exit (include/trace/events/timer.h:127)
       call_timer_fn (kernel/time/timer.c:1475)
       expire_timers (kernel/time/timer.c:1519)
       __run_timers (kernel/time/timer.c:1790)
       run_timer_softirq (kernel/time/timer.c:1803)
      
      Fixes: c46ee386 ("NFC: pn533: add NXP pn533 nfc device driver")
      Signed-off-by: default avatarMinsuk Kang <linuxlovemin@yonsei.ac.kr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9dab880d