Skip to content
  1. Jul 18, 2024
    • Joy Chakraborty's avatar
      nvmem: meson-efuse: Fix return value of nvmem callbacks · 78109288
      Joy Chakraborty authored
      
      
      commit 7a0a6d0a upstream.
      
      Read/write callbacks registered with nvmem core expect 0 to be returned
      on success and a negative value to be returned on failure.
      
      meson_efuse_read() and meson_efuse_write() call into
      meson_sm_call_read() and meson_sm_call_write() respectively which return
      the number of bytes read or written on success as per their api
      description.
      
      Fix to return error if meson_sm_call_read()/meson_sm_call_write()
      returns an error else return 0.
      
      Fixes: a29a63bd ("nvmem: meson-efuse: simplify read callback")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJoy Chakraborty <joychakr@google.com>
      Reviewed-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Link: https://lore.kernel.org/r/20240628113704.13742-3-srinivas.kandagatla@linaro.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      78109288
    • He Zhe's avatar
      hpet: Support 32-bit userspace · bdb9c58e
      He Zhe authored
      
      
      commit 4e60131d upstream.
      
      hpet_compat_ioctl and read file operations failed to handle parameters from
      32-bit userspace and thus samples/timers/hpet_example.c fails as below.
      
      root@intel-x86-64:~# ./hpet_example-32.out poll /dev/hpet 1 2
      -hpet: executing poll
      hpet_poll: HPET_IRQFREQ failed
      
      This patch fixes cmd and arg handling in hpet_compat_ioctl and adds compat
      handling for 32-bit userspace in hpet_read.
      
      hpet_example now shows that it works for both 64-bit and 32-bit.
      
      root@intel-x86-64:~# ./hpet_example-32.out poll /dev/hpet 1 2
      -hpet: executing poll
      hpet_poll: info.hi_flags 0x0
      hpet_poll: expired time = 0xf4298
      hpet_poll: revents = 0x1
      hpet_poll: data 0x1
      hpet_poll: expired time = 0xf4235
      hpet_poll: revents = 0x1
      hpet_poll: data 0x1
      root@intel-x86-64:~# ./hpet_example-64.out poll /dev/hpet 1 2
      -hpet: executing poll
      hpet_poll: info.hi_flags 0x0
      hpet_poll: expired time = 0xf42a1
      hpet_poll: revents = 0x1
      hpet_poll: data 0x1
      hpet_poll: expired time = 0xf4232
      hpet_poll: revents = 0x1
      hpet_poll: data 0x1
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHe Zhe <zhe.he@windriver.com>
      Fixes: 54066a57 ("hpet: kill BKL, add compat_ioctl")
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20240606123908.738733-1-zhe.he@windriver.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bdb9c58e
    • Alan Stern's avatar
      USB: core: Fix duplicate endpoint bug by clearing reserved bits in the descriptor · d09dd21b
      Alan Stern authored
      
      
      commit a368ecde upstream.
      
      Syzbot has identified a bug in usbcore (see the Closes: tag below)
      caused by our assumption that the reserved bits in an endpoint
      descriptor's bEndpointAddress field will always be 0.  As a result of
      the bug, the endpoint_is_duplicate() routine in config.c (and possibly
      other routines as well) may believe that two descriptors are for
      distinct endpoints, even though they have the same direction and
      endpoint number.  This can lead to confusion, including the bug
      identified by syzbot (two descriptors with matching endpoint numbers
      and directions, where one was interrupt and the other was bulk).
      
      To fix the bug, we will clear the reserved bits in bEndpointAddress
      when we parse the descriptor.  (Note that both the USB-2.0 and USB-3.1
      specs say these bits are "Reserved, reset to zero".)  This requires us
      to make a copy of the descriptor earlier in usb_parse_endpoint() and
      use the copy instead of the original when checking for duplicates.
      
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: default avatar <syzbot+8693a0bb9c10b554272a@syzkaller.appspotmail.com>
      Closes: https://lore.kernel.org/linux-usb/0000000000003d868e061bc0f554@google.com/
      Fixes: 0a8fd134 ("USB: fix problems with duplicate endpoint addresses")
      CC: Oliver Neukum <oneukum@suse.com>
      CC: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/205a5edc-7fef-4159-b64a-80374b6b101a@rowland.harvard.edu
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d09dd21b
    • Lee Jones's avatar
      usb: gadget: configfs: Prevent OOB read/write in usb_string_copy() · e8474a10
      Lee Jones authored
      
      
      commit 6d3c721e upstream.
      
      Userspace provided string 's' could trivially have the length zero. Left
      unchecked this will firstly result in an OOB read in the form
      `if (str[0 - 1] == '\n') followed closely by an OOB write in the form
      `str[0 - 1] = '\0'`.
      
      There is already a validating check to catch strings that are too long.
      Let's supply an additional check for invalid strings that are too short.
      
      Signed-off-by: default avatarLee Jones <lee@kernel.org>
      Cc: stable <stable@kernel.org>
      Link: https://lore.kernel.org/r/20240705074339.633717-1-lee@kernel.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e8474a10
    • WangYuli's avatar
      USB: Add USB_QUIRK_NO_SET_INTF quirk for START BP-850k · 10ae6b36
      WangYuli authored
      
      
      commit 3859e85d upstream.
      
      START BP-850K is a dot matrix printer that crashes when
      it receives a Set-Interface request and needs USB_QUIRK_NO_SET_INTF
      to work properly.
      
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarjinxiaobo <jinxiaobo@uniontech.com>
      Signed-off-by: default avatarWangYuli <wangyuli@uniontech.com>
      Link: https://lore.kernel.org/r/202E4B2BD0F0FEA4+20240702154408.631201-1-wangyuli@uniontech.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      10ae6b36
    • Dmitry Smirnov's avatar
      USB: serial: mos7840: fix crash on resume · 932a86a7
      Dmitry Smirnov authored
      
      
      commit c15a688e upstream.
      
      Since commit c49cfa91 ("USB: serial: use generic method if no
      alternative is provided in usb serial layer"), USB serial core calls the
      generic resume implementation when the driver has not provided one.
      
      This can trigger a crash on resume with mos7840 since support for
      multiple read URBs was added back in 2011. Specifically, both port read
      URBs are now submitted on resume for open ports, but the context pointer
      of the second URB is left set to the core rather than mos7840 port
      structure.
      
      Fix this by implementing dedicated suspend and resume functions for
      mos7840.
      
      Tested with Delock 87414 USB 2.0 to 4x serial adapter.
      
      Signed-off-by: default avatarDmitry Smirnov <d.smirnov@inbox.lv>
      [ johan: analyse crash and rewrite commit message; set busy flag on
               resume; drop bulk-in check; drop unnecessary usb_kill_urb() ]
      Fixes: d83b4053 ("USB: serial: add support for multiple read urbs")
      Cc: stable@vger.kernel.org	# 3.3
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      932a86a7
    • Vanillan Wang's avatar
      USB: serial: option: add Rolling RW350-GL variants · 868bc440
      Vanillan Wang authored
      
      
      commit ae420771 upstream.
      
      Update the USB serial option driver support for the Rolling
      RW350-GL
      - VID:PID 33f8:0802, RW350-GL are laptop M.2 cards (with
      MBIM interfaces for /Linux/Chrome OS)
      
      Here are the outputs of usb-devices:
      
      usbmode=63: mbim, pipe
      
      T:  Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
      D:  Ver= 3.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs=  1
      P:  Vendor=33f8 ProdID=0802 Rev=00.01
      S:  Manufacturer=Rolling Wireless S.a.r.l.
      S:  Product=USB DATA CARD
      C:  #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=896mA
      I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
      E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      
      usbmode=64: mbim, others at (If#= 5 adb)
      
      MBIM(MI0) + GNSS(MI2) + AP log(MI3) + AP META(MI4) + ADB(MI5) +
      MD AT(MI6) + MD META(MI7) + NPT(MI8) + Debug(MI9)
      
      T:  Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  5 Spd=5000 MxCh= 0
      D:  Ver= 3.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs=  1
      P:  Vendor=33f8 ProdID=0802 Rev=00.01
      S:  Manufacturer=Rolling Wireless S.a.r.l.
      S:  Product=USB DATA CARD
      C:  #Ifs=10 Cfg#= 1 Atr=a0 MxPwr=896mA
      I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
      E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs
      E:  Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=06(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=87(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=07(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=88(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=08(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=89(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:  If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=09(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=8a(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      
      Signed-off-by: default avatarVanillan Wang <vanillanwang@163.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      868bc440
    • Mank Wang's avatar
      USB: serial: option: add Netprisma LCUK54 series modules · 2dc6aad6
      Mank Wang authored
      
      
      commit dc6dbe3e upstream.
      
      Add support for Netprisma LCUK54 series modules.
      
      LCUK54-WRD-LWW(0x3731/0x0100): NetPrisma LCUK54-WWD for Global
      LCUK54-WRD-LWW(0x3731/0x0101): NetPrisma LCUK54-WRD for Global SKU
      LCUK54-WRD-LCN(0x3731/0x0106): NetPrisma LCUK54-WRD for China SKU
      LCUK54-WRD-LWW(0x3731/0x0111): NetPrisma LCUK54-WWD for SA
      LCUK54-WRD-LWW(0x3731/0x0112): NetPrisma LCUK54-WWD for EU
      LCUK54-WRD-LWW(0x3731/0x0113): NetPrisma LCUK54-WWD for NA
      LCUK54-WWD-LCN(0x3731/0x0115): NetPrisma LCUK54-WWD for China EDU
      LCUK54-WWD-LWW(0x3731/0x0116): NetPrisma LCUK54-WWD for Golbal EDU
      
      Above products use the exact same interface layout and option
      driver:
      MBIM + GNSS + DIAG + NMEA + AT + QDSS + DPL
      
      T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  5 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=3731 ProdID=0101 Rev= 5.04
      S:  Manufacturer=NetPrisma
      S:  Product=LCUK54-WRD
      S:  SerialNumber=b6250c36
      C:* #Ifs= 8 Cfg#= 1 Atr=a0 MxPwr=500mA
      A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
      E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
      I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option
      E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
      E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none)
      E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none)
      E:  Ad=8f(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      Signed-off-by: default avatarMank Wang <mank.wang@netprisma.us>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2dc6aad6
    • Slark Xiao's avatar
      USB: serial: option: add support for Foxconn T99W651 · fb9ff513
      Slark Xiao authored
      
      
      commit 3c841d54 upstream.
      
      T99W651 is a RNDIS based modem device. There are 3 serial ports
      need to be enumerated: Diag, NMEA and AT.
      
      Test evidence as below:
      T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  6 Spd=480 MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e145 Rev=05.15
      S:  Manufacturer=QCOM
      S:  Product=SDXPINN-IDP _SN:93B562B2
      S:  SerialNumber=82e6fe26
      C:  #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:  If#=0x0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
      I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
      I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
      I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
      I:  If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
      I:  If#=0x5 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none)
      I:  If#=0x6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
      
      0&1: RNDIS, 2:AT, 3:NMEA, 4:DIAG, 5:QDSS, 6:ADB
      QDSS is not a serial port.
      
      Signed-off-by: default avatarSlark Xiao <slark_xiao@163.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fb9ff513
    • Bjørn Mork's avatar
      USB: serial: option: add Fibocom FM350-GL · c9e10301
      Bjørn Mork authored
      
      
      commit 2604e08f upstream.
      
      FM350-GL is 5G Sub-6 WWAN module which uses M.2 form factor interface.
      It is based on Mediatek's MTK T700 CPU. The module supports PCIe Gen3
      x1 and USB 2.0 and 3.0 interfaces.
      
      The manufacturer states that USB is "for debug" but it has been
      confirmed to be fully functional, except for modem-control requests on
      some of the interfaces.
      
      USB device composition is controlled by AT+GTUSBMODE=<mode> command.
      Two values are currently supported for the <mode>:
      
      40: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB
      41: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB+AP(LOG)+AP(META) (default value)
      
      [ Note that the functions above are not ordered by interface number. ]
      
      Mode 40 corresponds to:
      
      T:  Bus=03 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 22 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0e8d ProdID=7126 Rev= 0.01
      S:  Manufacturer=Fibocom Wireless Inc.
      S:  Product=FM350-GL
      C:* #Ifs= 8 Cfg#= 1 Atr=a0 MxPwr=500mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host
      E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=125us
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      Mode 41 corresponds to:
      
      T:  Bus=03 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  7 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0e8d ProdID=7127 Rev= 0.01
      S:  Manufacturer=Fibocom Wireless Inc.
      S:  Product=FM350-GL
      C:* #Ifs=10 Cfg#= 1 Atr=a0 MxPwr=500mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host
      E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=125us
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=8a(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c9e10301
    • Daniele Palmas's avatar
      USB: serial: option: add Telit FN912 rmnet compositions · 9fb73674
      Daniele Palmas authored
      
      
      commit 9a590ff2 upstream.
      
      Add the following Telit FN912 compositions:
      
      0x3000: rmnet + tty (AT/NMEA) + tty (AT) + tty (diag)
      T:  Bus=03 Lev=01 Prnt=03 Port=07 Cnt=01 Dev#=  8 Spd=480  MxCh= 0
      D:  Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=1bc7 ProdID=3000 Rev=05.15
      S:  Manufacturer=Telit Cinterion
      S:  Product=FN912
      S:  SerialNumber=92c4c4d8
      C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
      I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      0x3001: rmnet + tty (AT) + tty (diag) + DPL (data packet logging) + adb
      T:  Bus=03 Lev=01 Prnt=03 Port=07 Cnt=01 Dev#=  7 Spd=480  MxCh= 0
      D:  Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=1bc7 ProdID=3001 Rev=05.15
      S:  Manufacturer=Telit Cinterion
      S:  Product=FN912
      S:  SerialNumber=92c4c4d8
      C:  #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
      I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none)
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      Signed-off-by: default avatarDaniele Palmas <dnlplm@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9fb73674
    • Daniele Palmas's avatar
      USB: serial: option: add Telit generic core-dump composition · 8e4e917f
      Daniele Palmas authored
      
      
      commit 4298e400 upstream.
      
      Add the following core-dump composition, used in different Telit modems:
      
      0x9000: tty (sahara)
      T:  Bus=03 Lev=01 Prnt=03 Port=07 Cnt=01 Dev#= 41 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=1bc7 ProdID=9000 Rev=00.00
      S:  Manufacturer=Telit Cinterion
      S:  Product=FN990-dump
      S:  SerialNumber=e815bdde
      C:  #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=2mA
      I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=10 Driver=option
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      Signed-off-by: default avatarDaniele Palmas <dnlplm@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e4e917f
    • Ronald Wahl's avatar
      net: ks8851: Fix potential TX stall after interface reopen · 26b4d680
      Ronald Wahl authored
      
      
      commit 7a99afef upstream.
      
      The amount of TX space in the hardware buffer is tracked in the tx_space
      variable. The initial value is currently only set during driver probing.
      
      After closing the interface and reopening it the tx_space variable has
      the last value it had before close. If it is smaller than the size of
      the first send packet after reopeing the interface the queue will be
      stopped. The queue is woken up after receiving a TX interrupt but this
      will never happen since we did not send anything.
      
      This commit moves the initialization of the tx_space variable to the
      ks8851_net_open function right before starting the TX queue. Also query
      the value from the hardware instead of using a hard coded value.
      
      Only the SPI chip variant is affected by this issue because only this
      driver variant actually depends on the tx_space variable in the xmit
      function.
      
      Fixes: 3dc5d445 ("net: ks8851: Fix TX stall caused by TX buffer overrun")
      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: Simon Horman <horms@kernel.org>
      Cc: netdev@vger.kernel.org
      Cc: stable@vger.kernel.org # 5.10+
      Signed-off-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Link: https://patch.msgid.link/20240709195845.9089-1-rwahl@gmx.de
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      26b4d680
    • Eric Dumazet's avatar
      tcp: avoid too many retransmit packets · 5d7e64d7
      Eric Dumazet authored
      
      
      commit 97a90635 upstream.
      
      If a TCP socket is using TCP_USER_TIMEOUT, and the other peer
      retracted its window to zero, tcp_retransmit_timer() can
      retransmit a packet every two jiffies (2 ms for HZ=1000),
      for about 4 minutes after TCP_USER_TIMEOUT has 'expired'.
      
      The fix is to make sure tcp_rtx_probe0_timed_out() takes
      icsk->icsk_user_timeout into account.
      
      Before blamed commit, the socket would not timeout after
      icsk->icsk_user_timeout, but would use standard exponential
      backoff for the retransmits.
      
      Also worth noting that before commit e89688e3 ("net: tcp:
      fix unexcepted socket die when snd_wnd is 0"), the issue
      would last 2 minutes instead of 4.
      
      Fixes: b701a99e ("tcp: Add tcp_clamp_rto_to_user_timeout() helper to improve accuracy")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Reviewed-by: default avatarJason Xing <kerneljasonxing@gmail.com>
      Reviewed-by: default avatarJon Maxwell <jmaxwell37@gmail.com>
      Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Link: https://patch.msgid.link/20240710001402.2758273-1-edumazet@google.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5d7e64d7
    • Eric Dumazet's avatar
      tcp: use signed arithmetic in tcp_rtx_probe0_timed_out() · 24b9fafe
      Eric Dumazet authored
      
      
      commit 36534d3c upstream.
      
      Due to timer wheel implementation, a timer will usually fire
      after its schedule.
      
      For instance, for HZ=1000, a timeout between 512ms and 4s
      has a granularity of 64ms.
      For this range of values, the extra delay could be up to 63ms.
      
      For TCP, this means that tp->rcv_tstamp may be after
      inet_csk(sk)->icsk_timeout whenever the timer interrupt
      finally triggers, if one packet came during the extra delay.
      
      We need to make sure tcp_rtx_probe0_timed_out() handles this case.
      
      Fixes: e89688e3 ("net: tcp: fix unexcepted socket die when snd_wnd is 0")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Menglong Dong <imagedong@tencent.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Reviewed-by: default avatarJason Xing <kerneljasonxing@gmail.com>
      Link: https://lore.kernel.org/r/20240607125652.1472540-1-edumazet@google.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      24b9fafe
    • Michal Mazur's avatar
      octeontx2-af: fix detection of IP layer · b4e9f890
      Michal Mazur authored
      
      
      [ Upstream commit 404dc0fd ]
      
      Checksum and length checks are not enabled for IPv4 header with
      options and IPv6 with extension headers.
      To fix this a change in enum npc_kpu_lc_ltype is required which will
      allow adjustment of LTYPE_MASK to detect all types of IP headers.
      
      Fixes: 21e6699e ("octeontx2-af: Add NPC KPU profile")
      Signed-off-by: default avatarMichal Mazur <mmazur2@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b4e9f890
    • 倪琛's avatar
      ARM: davinci: Convert comma to semicolon · 7e0297c8
      倪琛 authored
      
      
      [ Upstream commit acc3815d ]
      
      Replace a comma between expression statements by a semicolon.
      
      Fixes: efc1bb8a ("davinci: add power management support")
      Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
      Acked-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      7e0297c8
    • Sven Schnelle's avatar
      s390: Mark psw in __load_psw_mask() as __unitialized · 148d5494
      Sven Schnelle authored
      
      
      [ Upstream commit 7278a8fb ]
      
      Without __unitialized, the following code is generated when
      INIT_STACK_ALL_ZERO is enabled:
      
      86: d7 0f f0 a0 f0 a0     xc      160(16,%r15), 160(%r15)
      8c: e3 40 f0 a0 00 24     stg     %r4, 160(%r15)
      92: c0 10 00 00 00 08     larl    %r1, 0xa2
      98: e3 10 f0 a8 00 24     stg     %r1, 168(%r15)
      9e: b2 b2 f0 a0           lpswe   160(%r15)
      
      The xc is not adding any security because psw is fully initialized
      with the following instructions. Add __unitialized to the psw
      definitiation to avoid the superfluous clearing of psw.
      
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      148d5494
    • Chengen Du's avatar
      net/sched: Fix UAF when resolving a clash · b81a523d
      Chengen Du authored
      
      
      [ Upstream commit 26488172 ]
      
      KASAN reports the following UAF:
      
       BUG: KASAN: slab-use-after-free in tcf_ct_flow_table_process_conn+0x12b/0x380 [act_ct]
       Read of size 1 at addr ffff888c07603600 by task handler130/6469
      
       Call Trace:
        <IRQ>
        dump_stack_lvl+0x48/0x70
        print_address_description.constprop.0+0x33/0x3d0
        print_report+0xc0/0x2b0
        kasan_report+0xd0/0x120
        __asan_load1+0x6c/0x80
        tcf_ct_flow_table_process_conn+0x12b/0x380 [act_ct]
        tcf_ct_act+0x886/0x1350 [act_ct]
        tcf_action_exec+0xf8/0x1f0
        fl_classify+0x355/0x360 [cls_flower]
        __tcf_classify+0x1fd/0x330
        tcf_classify+0x21c/0x3c0
        sch_handle_ingress.constprop.0+0x2c5/0x500
        __netif_receive_skb_core.constprop.0+0xb25/0x1510
        __netif_receive_skb_list_core+0x220/0x4c0
        netif_receive_skb_list_internal+0x446/0x620
        napi_complete_done+0x157/0x3d0
        gro_cell_poll+0xcf/0x100
        __napi_poll+0x65/0x310
        net_rx_action+0x30c/0x5c0
        __do_softirq+0x14f/0x491
        __irq_exit_rcu+0x82/0xc0
        irq_exit_rcu+0xe/0x20
        common_interrupt+0xa1/0xb0
        </IRQ>
        <TASK>
        asm_common_interrupt+0x27/0x40
      
       Allocated by task 6469:
        kasan_save_stack+0x38/0x70
        kasan_set_track+0x25/0x40
        kasan_save_alloc_info+0x1e/0x40
        __kasan_krealloc+0x133/0x190
        krealloc+0xaa/0x130
        nf_ct_ext_add+0xed/0x230 [nf_conntrack]
        tcf_ct_act+0x1095/0x1350 [act_ct]
        tcf_action_exec+0xf8/0x1f0
        fl_classify+0x355/0x360 [cls_flower]
        __tcf_classify+0x1fd/0x330
        tcf_classify+0x21c/0x3c0
        sch_handle_ingress.constprop.0+0x2c5/0x500
        __netif_receive_skb_core.constprop.0+0xb25/0x1510
        __netif_receive_skb_list_core+0x220/0x4c0
        netif_receive_skb_list_internal+0x446/0x620
        napi_complete_done+0x157/0x3d0
        gro_cell_poll+0xcf/0x100
        __napi_poll+0x65/0x310
        net_rx_action+0x30c/0x5c0
        __do_softirq+0x14f/0x491
      
       Freed by task 6469:
        kasan_save_stack+0x38/0x70
        kasan_set_track+0x25/0x40
        kasan_save_free_info+0x2b/0x60
        ____kasan_slab_free+0x180/0x1f0
        __kasan_slab_free+0x12/0x30
        slab_free_freelist_hook+0xd2/0x1a0
        __kmem_cache_free+0x1a2/0x2f0
        kfree+0x78/0x120
        nf_conntrack_free+0x74/0x130 [nf_conntrack]
        nf_ct_destroy+0xb2/0x140 [nf_conntrack]
        __nf_ct_resolve_clash+0x529/0x5d0 [nf_conntrack]
        nf_ct_resolve_clash+0xf6/0x490 [nf_conntrack]
        __nf_conntrack_confirm+0x2c6/0x770 [nf_conntrack]
        tcf_ct_act+0x12ad/0x1350 [act_ct]
        tcf_action_exec+0xf8/0x1f0
        fl_classify+0x355/0x360 [cls_flower]
        __tcf_classify+0x1fd/0x330
        tcf_classify+0x21c/0x3c0
        sch_handle_ingress.constprop.0+0x2c5/0x500
        __netif_receive_skb_core.constprop.0+0xb25/0x1510
        __netif_receive_skb_list_core+0x220/0x4c0
        netif_receive_skb_list_internal+0x446/0x620
        napi_complete_done+0x157/0x3d0
        gro_cell_poll+0xcf/0x100
        __napi_poll+0x65/0x310
        net_rx_action+0x30c/0x5c0
        __do_softirq+0x14f/0x491
      
      The ct may be dropped if a clash has been resolved but is still passed to
      the tcf_ct_flow_table_process_conn function for further usage. This issue
      can be fixed by retrieving ct from skb again after confirming conntrack.
      
      Fixes: 0cc254e5 ("net/sched: act_ct: Offload connections with commit action")
      Co-developed-by: default avatarGerald Yang <gerald.yang@canonical.com>
      Signed-off-by: default avatarGerald Yang <gerald.yang@canonical.com>
      Signed-off-by: default avatarChengen Du <chengen.du@canonical.com>
      Link: https://patch.msgid.link/20240710053747.13223-1-chengen.du@canonical.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b81a523d
    • Kuniyuki Iwashima's avatar
      udp: Set SOCK_RCU_FREE earlier in udp_lib_get_port(). · 9f965684
      Kuniyuki Iwashima authored
      
      
      [ Upstream commit 5c0b485a ]
      
      syzkaller triggered the warning [0] in udp_v4_early_demux().
      
      In udp_v[46]_early_demux() and sk_lookup(), we do not touch the refcount
      of the looked-up sk and use sock_pfree() as skb->destructor, so we check
      SOCK_RCU_FREE to ensure that the sk is safe to access during the RCU grace
      period.
      
      Currently, SOCK_RCU_FREE is flagged for a bound socket after being put
      into the hash table.  Moreover, the SOCK_RCU_FREE check is done too early
      in udp_v[46]_early_demux() and sk_lookup(), so there could be a small race
      window:
      
        CPU1                                 CPU2
        ----                                 ----
        udp_v4_early_demux()                 udp_lib_get_port()
        |                                    |- hlist_add_head_rcu()
        |- sk = __udp4_lib_demux_lookup()    |
        |- DEBUG_NET_WARN_ON_ONCE(sk_is_refcounted(sk));
                                             `- sock_set_flag(sk, SOCK_RCU_FREE)
      
      We had the same bug in TCP and fixed it in commit 871019b2 ("net:
      set SOCK_RCU_FREE before inserting socket into hashtable").
      
      Let's apply the same fix for UDP.
      
      [0]:
      WARNING: CPU: 0 PID: 11198 at net/ipv4/udp.c:2599 udp_v4_early_demux+0x481/0xb70 net/ipv4/udp.c:2599
      Modules linked in:
      CPU: 0 PID: 11198 Comm: syz-executor.1 Not tainted 6.9.0-g93bda33046e7 #13
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
      RIP: 0010:udp_v4_early_demux+0x481/0xb70 net/ipv4/udp.c:2599
      Code: c5 7a 15 fe bb 01 00 00 00 44 89 e9 31 ff d3 e3 81 e3 bf ef ff ff 89 de e8 2c 74 15 fe 85 db 0f 85 02 06 00 00 e8 9f 7a 15 fe <0f> 0b e8 98 7a 15 fe 49 8d 7e 60 e8 4f 39 2f fe 49 c7 46 60 20 52
      RSP: 0018:ffffc9000ce3fa58 EFLAGS: 00010293
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff8318c92c
      RDX: ffff888036ccde00 RSI: ffffffff8318c2f1 RDI: 0000000000000001
      RBP: ffff88805a2dd6e0 R08: 0000000000000001 R09: 0000000000000000
      R10: 0000000000000000 R11: 0001ffffffffffff R12: ffff88805a2dd680
      R13: 0000000000000007 R14: ffff88800923f900 R15: ffff88805456004e
      FS:  00007fc449127640(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007fc449126e38 CR3: 000000003de4b002 CR4: 0000000000770ef0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
      PKRU: 55555554
      Call Trace:
       <TASK>
       ip_rcv_finish_core.constprop.0+0xbdd/0xd20 net/ipv4/ip_input.c:349
       ip_rcv_finish+0xda/0x150 net/ipv4/ip_input.c:447
       NF_HOOK include/linux/netfilter.h:314 [inline]
       NF_HOOK include/linux/netfilter.h:308 [inline]
       ip_rcv+0x16c/0x180 net/ipv4/ip_input.c:569
       __netif_receive_skb_one_core+0xb3/0xe0 net/core/dev.c:5624
       __netif_receive_skb+0x21/0xd0 net/core/dev.c:5738
       netif_receive_skb_internal net/core/dev.c:5824 [inline]
       netif_receive_skb+0x271/0x300 net/core/dev.c:5884
       tun_rx_batched drivers/net/tun.c:1549 [inline]
       tun_get_user+0x24db/0x2c50 drivers/net/tun.c:2002
       tun_chr_write_iter+0x107/0x1a0 drivers/net/tun.c:2048
       new_sync_write fs/read_write.c:497 [inline]
       vfs_write+0x76f/0x8d0 fs/read_write.c:590
       ksys_write+0xbf/0x190 fs/read_write.c:643
       __do_sys_write fs/read_write.c:655 [inline]
       __se_sys_write fs/read_write.c:652 [inline]
       __x64_sys_write+0x41/0x50 fs/read_write.c:652
       x64_sys_call+0xe66/0x1990 arch/x86/include/generated/asm/syscalls_64.h:2
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0x4b/0x110 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x4b/0x53
      RIP: 0033:0x7fc44a68bc1f
      Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 e9 cf f5 ff 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 3c d0 f5 ff 48
      RSP: 002b:00007fc449126c90 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
      RAX: ffffffffffffffda RBX: 00000000004bc050 RCX: 00007fc44a68bc1f
      RDX: 0000000000000032 RSI: 00000000200000c0 RDI: 00000000000000c8
      RBP: 00000000004bc050 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000032 R11: 0000000000000293 R12: 0000000000000000
      R13: 000000000000000b R14: 00007fc44a5ec530 R15: 0000000000000000
       </TASK>
      
      Fixes: 6acc9b43 ("bpf: Add helper to retrieve socket in BPF")
      Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://patch.msgid.link/20240709191356.24010-1-kuniyu@amazon.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9f965684
    • Oleksij Rempel's avatar
      ethtool: netlink: do not return SQI value if link is down · c184be30
      Oleksij Rempel authored
      [ Upstream commit c184cf94 ]
      
      Do not attach SQI value if link is down. "SQI values are only valid if
      link-up condition is present" per OpenAlliance specification of
      100Base-T1 Interoperability Test suite [1]. The same rule would apply
      for other link types.
      
      [1] https://opensig.org/automotive-ethernet-specifications/#
      
      
      
      Fixes: 80660219 ("ethtool: provide UAPI for PHY Signal Quality Index (SQI)")
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarWoojung Huh <woojung.huh@microchip.com>
      Link: https://patch.msgid.link/20240709061943.729381-1-o.rempel@pengutronix.de
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      c184be30
    • Dmitry Antipov's avatar
      ppp: reject claimed-as-LCP but actually malformed packets · 3ba12c2a
      Dmitry Antipov authored
      
      
      [ Upstream commit f2aeb730 ]
      
      Since 'ppp_async_encode()' assumes valid LCP packets (with code
      from 1 to 7 inclusive), add 'ppp_check_packet()' to ensure that
      LCP packet has an actual body beyond PPP_LCP header bytes, and
      reject claimed-as-LCP but actually malformed data otherwise.
      
      Reported-by: default avatar <syzbot+ec0723ba9605678b14bf@syzkaller.appspotmail.com>
      Closes: https://syzkaller.appspot.com/bug?extid=ec0723ba9605678b14bf
      
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      3ba12c2a
    • Aleksander Jan Bajkowski's avatar
      net: ethernet: lantiq_etop: fix double free in detach · 22b16618
      Aleksander Jan Bajkowski authored
      
      
      [ Upstream commit e1533b63 ]
      
      The number of the currently released descriptor is never incremented
      which results in the same skb being released multiple times.
      
      Fixes: 504d4721 ("MIPS: Lantiq: Add ethernet driver")
      Reported-by: default avatarJoe Perches <joe@perches.com>
      Closes: https://lore.kernel.org/all/fc1bf93d92bb5b2f99c6c62745507cc22f3a7b2d.camel@perches.com/
      
      
      Signed-off-by: default avatarAleksander Jan Bajkowski <olek2@wp.pl>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://patch.msgid.link/20240708205826.5176-1-olek2@wp.pl
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      22b16618
    • Aleksander Jan Bajkowski's avatar
      net: lantiq_etop: add blank line after declaration · b4ac93b0
      Aleksander Jan Bajkowski authored
      
      
      [ Upstream commit 4c46625b ]
      
      This patch adds a missing line after the declaration and
      fixes the checkpatch warning:
      
      WARNING: Missing a blank line after declarations
      +		int desc;
      +		for (desc = 0; desc < LTQ_DESC_NUM; desc++)
      
      Signed-off-by: default avatarAleksander Jan Bajkowski <olek2@wp.pl>
      Link: https://lore.kernel.org/r/20211228220031.71576-1-olek2@wp.pl
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Stable-dep-of: e1533b63 ("net: ethernet: lantiq_etop: fix double free in detach")
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b4ac93b0
    • Aleksandr Mishin's avatar
      octeontx2-af: Fix incorrect value output on error path in rvu_check_rsrc_availability() · efc05a5f
      Aleksandr Mishin authored
      
      
      [ Upstream commit 442e26af ]
      
      In rvu_check_rsrc_availability() in case of invalid SSOW req, an incorrect
      data is printed to error log. 'req->sso' value is printed instead of
      'req->ssow'. Looks like "copy-paste" mistake.
      
      Fix this mistake by replacing 'req->sso' with 'req->ssow'.
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      
      Fixes: 746ea742 ("octeontx2-af: Add RVU block LF provisioning support")
      Signed-off-by: default avatarAleksandr Mishin <amishin@t-argos.ru>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://patch.msgid.link/20240705095317.12640-1-amishin@t-argos.ru
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      efc05a5f
    • Neal Cardwell's avatar
      tcp: fix incorrect undo caused by DSACK of TLP retransmit · 893e140d
      Neal Cardwell authored
      
      
      [ Upstream commit 0ec986ed ]
      
      Loss recovery undo_retrans bookkeeping had a long-standing bug where a
      DSACK from a spurious TLP retransmit packet could cause an erroneous
      undo of a fast recovery or RTO recovery that repaired a single
      really-lost packet (in a sequence range outside that of the TLP
      retransmit). Basically, because the loss recovery state machine didn't
      account for the fact that it sent a TLP retransmit, the DSACK for the
      TLP retransmit could erroneously be implicitly be interpreted as
      corresponding to the normal fast recovery or RTO recovery retransmit
      that plugged a real hole, thus resulting in an improper undo.
      
      For example, consider the following buggy scenario where there is a
      real packet loss but the congestion control response is improperly
      undone because of this bug:
      
      + send packets P1, P2, P3, P4
      + P1 is really lost
      + send TLP retransmit of P4
      + receive SACK for original P2, P3, P4
      + enter fast recovery, fast-retransmit P1, increment undo_retrans to 1
      + receive DSACK for TLP P4, decrement undo_retrans to 0, undo (bug!)
      + receive cumulative ACK for P1-P4 (fast retransmit plugged real hole)
      
      The fix: when we initialize undo machinery in tcp_init_undo(), if
      there is a TLP retransmit in flight, then increment tp->undo_retrans
      so that we make sure that we receive a DSACK corresponding to the TLP
      retransmit, as well as DSACKs for all later normal retransmits, before
      triggering a loss recovery undo. Note that we also have to move the
      line that clears tp->tlp_high_seq for RTO recovery, so that upon RTO
      we remember the tp->tlp_high_seq value until tcp_init_undo() and clear
      it only afterward.
      
      Also note that the bug dates back to the original 2013 TLP
      implementation, commit 6ba8a3b1 ("tcp: Tail loss probe (TLP)").
      
      However, this patch will only compile and work correctly with kernels
      that have tp->tlp_retrans, which was added only in v5.8 in 2020 in
      commit 76be93fc ("tcp: allow at most one TLP probe per flight").
      So we associate this fix with that later commit.
      
      Fixes: 76be93fc ("tcp: allow at most one TLP probe per flight")
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Cc: Kevin Yang <yyd@google.com>
      Link: https://patch.msgid.link/20240703171246.1739561-1-ncardwell.sw@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      893e140d
    • Brian Foster's avatar
      vfs: don't mod negative dentry count when on shrinker list · 1b95de94
      Brian Foster authored
      
      
      [ Upstream commit aabfe57e ]
      
      The nr_dentry_negative counter is intended to only account negative
      dentries that are present on the superblock LRU. Therefore, the LRU
      add, remove and isolate helpers modify the counter based on whether
      the dentry is negative, but the shrinker list related helpers do not
      modify the counter, and the paths that change a dentry between
      positive and negative only do so if DCACHE_LRU_LIST is set.
      
      The problem with this is that a dentry on a shrinker list still has
      DCACHE_LRU_LIST set to indicate ->d_lru is in use. The additional
      DCACHE_SHRINK_LIST flag denotes whether the dentry is on LRU or a
      shrink related list. Therefore if a relevant operation (i.e. unlink)
      occurs while a dentry is present on a shrinker list, and the
      associated codepath only checks for DCACHE_LRU_LIST, then it is
      technically possible to modify the negative dentry count for a
      dentry that is off the LRU. Since the shrinker list related helpers
      do not modify the negative dentry count (because non-LRU dentries
      should not be included in the count) when the dentry is ultimately
      removed from the shrinker list, this can cause the negative dentry
      count to become permanently inaccurate.
      
      This problem can be reproduced via a heavy file create/unlink vs.
      drop_caches workload. On an 80xcpu system, I start 80 tasks each
      running a 1k file create/delete loop, and one task spinning on
      drop_caches. After 10 minutes or so of runtime, the idle/clean cache
      negative dentry count increases from somewhere in the range of 5-10
      entries to several hundred (and increasingly grows beyond
      nr_dentry_unused).
      
      Tweak the logic in the paths that turn a dentry negative or positive
      to filter out the case where the dentry is present on a shrink
      related list. This allows the above workload to maintain an accurate
      negative dentry count.
      
      Fixes: af0c9af1 ("fs/dcache: Track & report number of negative dentries")
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Link: https://lore.kernel.org/r/20240703121301.247680-1-bfoster@redhat.com
      
      
      Acked-by: default avatarIan Kent <ikent@redhat.com>
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Reviewed-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1b95de94
    • linke li's avatar
      fs/dcache: Re-use value stored to dentry->d_flags instead of re-reading · 7092f1e5
      linke li authored
      
      
      [ Upstream commit 8bfb40be ]
      
      Currently, the __d_clear_type_and_inode() writes the value flags to
      dentry->d_flags, then immediately re-reads it in order to use it in a if
      statement. This re-read is useless because no other update to
      dentry->d_flags can occur at this point.
      
      This commit therefore re-use flags in the if statement instead of
      re-reading dentry->d_flags.
      
      Signed-off-by: default avatarlinke li <lilinke99@qq.com>
      Link: https://lore.kernel.org/r/tencent_5E187BD0A61BA28605E85405F15228254D0A@qq.com
      
      
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      Stable-dep-of: aabfe57e ("vfs: don't mod negative dentry count when on shrinker list")
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      7092f1e5
    • Jeff Layton's avatar
      filelock: fix potential use-after-free in posix_lock_inode · 7d4c14f4
      Jeff Layton authored
      [ Upstream commit 1b3ec4f7 ]
      
      Light Hsieh reported a KASAN UAF warning in trace_posix_lock_inode().
      The request pointer had been changed earlier to point to a lock entry
      that was added to the inode's list. However, before the tracepoint could
      fire, another task raced in and freed that lock.
      
      Fix this by moving the tracepoint inside the spinlock, which should
      ensure that this doesn't happen.
      
      Fixes: 74f6f591 ("locks: fix KASAN: use-after-free in trace_event_raw_event_filelock_lock")
      Link: https://lore.kernel.org/linux-fsdevel/724ffb0a2962e912ea62bb0515deadf39c325112.camel@kernel.org/
      
      
      Reported-by: default avatarLight Hsieh (謝明燈) <Light.Hsieh@mediatek.com>
      Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
      Link: https://lore.kernel.org/r/20240702-filelock-6-10-v1-1-96e766aadc98@kernel.org
      
      
      Reviewed-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      7d4c14f4
    • Waiman Long's avatar
      mm: prevent derefencing NULL ptr in pfn_section_valid() · 0100aeb8
      Waiman Long authored
      [ Upstream commit 82f0b6f0 ]
      
      Commit 5ec8e8ea ("mm/sparsemem: fix race in accessing
      memory_section->usage") changed pfn_section_valid() to add a READ_ONCE()
      call around "ms->usage" to fix a race with section_deactivate() where
      ms->usage can be cleared.  The READ_ONCE() call, by itself, is not enough
      to prevent NULL pointer dereference.  We need to check its value before
      dereferencing it.
      
      Link: https://lkml.kernel.org/r/20240626001639.1350646-1-longman@redhat.com
      
      
      Fixes: 5ec8e8ea ("mm/sparsemem: fix race in accessing memory_section->usage")
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Cc: Charan Teja Kalla <quic_charante@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      0100aeb8
    • Ryusuke Konishi's avatar
      nilfs2: fix incorrect inode allocation from reserved inodes · 1e99ce37
      Ryusuke Konishi authored
      commit 93aef9ed upstream.
      
      If the bitmap block that manages the inode allocation status is corrupted,
      nilfs_ifile_create_inode() may allocate a new inode from the reserved
      inode area where it should not be allocated.
      
      Previous fix commit d325dc6e ("nilfs2: fix use-after-free bug of
      struct nilfs_root"), fixed the problem that reserved inodes with inode
      numbers less than NILFS_USER_INO (=11) were incorrectly reallocated due to
      bitmap corruption, but since the start number of non-reserved inodes is
      read from the super block and may change, in which case inode allocation
      may occur from the extended reserved inode area.
      
      If that happens, access to that inode will cause an IO error, causing the
      file system to degrade to an error state.
      
      Fix this potential issue by adding a wraparound option to the common
      metadata object allocation routine and by modifying
      nilfs_ifile_create_inode() to disable the option so that it only allocates
      inodes with inode numbers greater than or equal to the inode number read
      in "nilfs->ns_first_ino", regardless of the bitmap status of reserved
      inodes.
      
      Link: https://lkml.kernel.org/r/20240623051135.4180-4-konishi.ryusuke@gmail.com
      
      
      Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
      Cc: Hillf Danton <hdanton@sina.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1e99ce37
    • Masahiro Yamada's avatar
      kbuild: fix short log for AS in link-vmlinux.sh · 3affee77
      Masahiro Yamada authored
      
      
      [ Upstream commit 3430f65d ]
      
      In convention, short logs print the output file, not the input file.
      
      Let's change the suffix for 'AS' since it assembles *.S into *.o.
      
      [Before]
      
        LD      .tmp_vmlinux.kallsyms1
        NM      .tmp_vmlinux.kallsyms1.syms
        KSYMS   .tmp_vmlinux.kallsyms1.S
        AS      .tmp_vmlinux.kallsyms1.S
        LD      .tmp_vmlinux.kallsyms2
        NM      .tmp_vmlinux.kallsyms2.syms
        KSYMS   .tmp_vmlinux.kallsyms2.S
        AS      .tmp_vmlinux.kallsyms2.S
        LD      vmlinux
      
      [After]
      
        LD      .tmp_vmlinux.kallsyms1
        NM      .tmp_vmlinux.kallsyms1.syms
        KSYMS   .tmp_vmlinux.kallsyms1.S
        AS      .tmp_vmlinux.kallsyms1.o
        LD      .tmp_vmlinux.kallsyms2
        NM      .tmp_vmlinux.kallsyms2.syms
        KSYMS   .tmp_vmlinux.kallsyms2.S
        AS      .tmp_vmlinux.kallsyms2.o
        LD      vmlinux
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      3affee77
    • Sagi Grimberg's avatar
      nvmet: fix a possible leak when destroy a ctrl during qp establishment · 2f3c22b1
      Sagi Grimberg authored
      
      
      [ Upstream commit c758b77d ]
      
      In nvmet_sq_destroy we capture sq->ctrl early and if it is non-NULL we
      know that a ctrl was allocated (in the admin connect request handler)
      and we need to release pending AERs, clear ctrl->sqs and sq->ctrl
      (for nvme-loop primarily), and drop the final reference on the ctrl.
      
      However, a small window is possible where nvmet_sq_destroy starts (as
      a result of the client giving up and disconnecting) concurrently with
      the nvme admin connect cmd (which may be in an early stage). But *before*
      kill_and_confirm of sq->ref (i.e. the admin connect managed to get an sq
      live reference). In this case, sq->ctrl was allocated however after it was
      captured in a local variable in nvmet_sq_destroy.
      This prevented the final reference drop on the ctrl.
      
      Solve this by re-capturing the sq->ctrl after all inflight request has
      completed, where for sure sq->ctrl reference is final, and move forward
      based on that.
      
      This issue was observed in an environment with many hosts connecting
      multiple ctrls simoutanuosly, creating a delay in allocating a ctrl
      leading up to this race window.
      
      Reported-by: default avatarAlex Turin <alex@vastdata.com>
      Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      2f3c22b1
    • hmtheboy154's avatar
      platform/x86: touchscreen_dmi: Add info for the EZpad 6s Pro · 1fa5c6ee
      hmtheboy154 authored
      
      
      [ Upstream commit 30500526 ]
      
      The "EZpad 6s Pro" uses the same touchscreen as the "EZpad 6 Pro B",
      unlike the "Ezpad 6 Pro" which has its own touchscreen.
      
      Signed-off-by: default avatarhmtheboy154 <buingoc67@gmail.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20240527091447.248849-3-hdegoede@redhat.com
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1fa5c6ee
    • hmtheboy154's avatar
      platform/x86: touchscreen_dmi: Add info for GlobalSpace SolT IVW 11.6" tablet · 8802d233
      hmtheboy154 authored
      [ Upstream commit 7c8639aa ]
      
      This is a tablet created by GlobalSpace Technologies Limited
      which uses an Intel Atom x5-Z8300, 4GB of RAM & 64GB of storage.
      
      Link: https://web.archive.org/web/20171102141952/http://globalspace.in/11.6-device.html
      
      
      Signed-off-by: default avatarhmtheboy154 <buingoc67@gmail.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20240527091447.248849-2-hdegoede@redhat.com
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      8802d233
    • Kundan Kumar's avatar
      nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset · 560eaa1a
      Kundan Kumar authored
      
      
      [ Upstream commit 1bd293fc ]
      
      bio_vec start offset may be relatively large particularly when large
      folio gets added to the bio. A bigger offset will result in avoiding the
      single-segment mapping optimization and end up using expensive
      mempool_alloc further.
      
      Rather than using absolute value, adjust bv_offset by
      NVME_CTRL_PAGE_SIZE while checking if segment can be fitted into one/two
      PRP entries.
      
      Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKundan Kumar <kundan.kumar@samsung.com>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      560eaa1a
    • Nilay Shroff's avatar
      nvme-multipath: find NUMA path only for online numa-node · 2d428a07
      Nilay Shroff authored
      
      
      [ Upstream commit d3a04373 ]
      
      In current native multipath design when a shared namespace is created,
      we loop through each possible numa-node, calculate the NUMA distance of
      that node from each nvme controller and then cache the optimal IO path
      for future reference while sending IO. The issue with this design is that
      we may refer to the NUMA distance table for an offline node which may not
      be populated at the time and so we may inadvertently end up finding and
      caching a non-optimal path for IO. Then latter when the corresponding
      numa-node becomes online and hence the NUMA distance table entry for that
      node is created, ideally we should re-calculate the multipath node distance
      for the newly added node however that doesn't happen unless we rescan/reset
      the controller. So essentially, we may keep using non-optimal IO path for a
      node which is made online after namespace is created.
      This patch helps fix this issue ensuring that when a shared namespace is
      created, we calculate the multipath node distance for each online numa-node
      instead of each possible numa-node. Then latter when a node becomes online
      and we receive any IO on that newly added node, we would calculate the
      multipath node distance for newly added node but this time NUMA distance
      table would have been already populated for newly added node. Hence we
      would be able to correctly calculate the multipath node distance and choose
      the optimal path for the IO.
      
      Signed-off-by: default avatarNilay Shroff <nilay@linux.ibm.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      2d428a07
    • Jian-Hong Pan's avatar
      ALSA: hda/realtek: Enable headset mic of JP-IK LEAP W502 with ALC897 · 97982c31
      Jian-Hong Pan authored
      
      
      [ Upstream commit 45e37f9c ]
      
      JP-IK LEAP W502 laptop's headset mic is not enabled until
      ALC897_FIXUP_HEADSET_MIC_PIN3 quirk is applied.
      
      Here is the original pin node values:
      
      0x11 0x40000000
      0x12 0xb7a60130
      0x14 0x90170110
      0x15 0x411111f0
      0x16 0x411111f0
      0x17 0x411111f0
      0x18 0x411111f0
      0x19 0x411111f0
      0x1a 0x411111f0
      0x1b 0x03211020
      0x1c 0x411111f0
      0x1d 0x4026892d
      0x1e 0x411111f0
      0x1f 0x411111f0
      
      Signed-off-by: default avatarJian-Hong Pan <jhp@endlessos.org>
      Link: https://lore.kernel.org/r/20240520055008.7083-2-jhp@endlessos.org
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      97982c31
    • Piotr Wojtaszczyk's avatar
      i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr · 2849a1b7
      Piotr Wojtaszczyk authored
      
      
      [ Upstream commit f63b94be ]
      
      When del_timer_sync() is called in an interrupt context it throws a warning
      because of potential deadlock. The timer is used only to exit from
      wait_for_completion() after a timeout so replacing the call with
      wait_for_completion_timeout() allows to remove the problematic timer and
      its related functions altogether.
      
      Fixes: 41561f28 ("i2c: New Philips PNX bus driver")
      Signed-off-by: default avatarPiotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
      Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      2849a1b7
    • Mauro Carvalho Chehab's avatar
      media: dw2102: fix a potential buffer overflow · 2032e5df
      Mauro Carvalho Chehab authored
      
      
      commit 1c73d0b2 upstream.
      
      As pointed by smatch:
      	 drivers/media/usb/dvb-usb/dw2102.c:802 su3000_i2c_transfer() error: __builtin_memcpy() '&state->data[4]' too small (64 vs 67)
      
      That seemss to be due to a wrong copy-and-paste.
      
      Fixes: 0e148a52 ("media: dw2102: Don't translate i2c read into write")
      
      Reported-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Reviewed-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2032e5df
Loading