Skip to content
  1. Jun 03, 2022
  2. Jun 02, 2022
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.19-rc1' of https://github.com/ceph/ceph-client · 17d8e3d9
      Linus Torvalds authored
      Pull ceph updates from Ilya Dryomov:
       "A big pile of assorted fixes and improvements for the filesystem with
        nothing in particular standing out, except perhaps that the fact that
        the MDS never really maintained atime was made official and thus it's
        no longer updated on the client either.
      
        We also have a MAINTAINERS update: Jeff is transitioning his
        filesystem maintainership duties to Xiubo"
      
      * tag 'ceph-for-5.19-rc1' of https://github.com/ceph/ceph-client: (23 commits)
        MAINTAINERS: move myself from ceph "Maintainer" to "Reviewer"
        ceph: fix decoding of client session messages flags
        ceph: switch TASK_INTERRUPTIBLE to TASK_KILLABLE
        ceph: remove redundant variable ino
        ceph: try to queue a writeback if revoking fails
        ceph: fix statfs for subdir mounts
        ceph: fix possible deadlock when holding Fwb to get inline_data
        ceph: redirty the page for writepage on failure
        ceph: try to choose the auth MDS if possible for getattr
        ceph: disable updating the atime since cephfs won't maintain it
        ceph: flush the mdlog for filesystem sync
        ceph: rename unsafe_request_wait()
        libceph: use swap() macro instead of taking tmp variable
        ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check
        ceph: no need to invalidate the fscache twice
        ceph: replace usage of found with dedicated list iterator variable
        ceph: use dedicated list iterator variable
        ceph: update the dlease for the hashed dentry when removing
        ceph: stop retrying the request when exceeding 256 times
        ceph: stop forwarding the request when exceeding 256 times
        ...
      17d8e3d9
    • Linus Torvalds's avatar
      Merge tag 'livepatching-for-5.19' of... · 7c9e960c
      Linus Torvalds authored
      Merge tag 'livepatching-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
      
      Pull livepatching cleanup from Petr Mladek:
      
       - Remove duplicated livepatch code [Christophe]
      
      * tag 'livepatching-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching:
        livepatch: Remove klp_arch_set_pc() and asm/livepatch.h
      7c9e960c
    • Linus Torvalds's avatar
      Merge tag 'printk-for-5.19-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux · 12831f64
      Linus Torvalds authored
      Pull printk fixup from Petr Mladek:
      
       - Revert inappropriate use of wake_up_interruptible_all() in printk()
      
      * tag 'printk-for-5.19-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
        Revert "printk: wake up all waiters"
      12831f64
    • Linus Torvalds's avatar
      Merge tag 'memblock-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock · ca1dcc6d
      Linus Torvalds authored
      Pull memblock test suite updates from Mike Rapoport:
       "Comment updates for memblock test suite
      
        Update comments in the memblock tests so that they will have
        consistent style"
      
      * tag 'memblock-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
        memblock tests: remove completed TODO item
        memblock tests: update style of comments for memblock_free_*() functions
        memblock tests: update style of comments for memblock_remove_*() functions
        memblock tests: update style of comments for memblock_reserve_*() functions
        memblock tests: update style of comments for memblock_add_*() functions
      ca1dcc6d
    • Dan Carpenter's avatar
      i2c: ismt: prevent memory corruption in ismt_access() · 690b2549
      Dan Carpenter authored
      The "data->block[0]" variable comes from the user and is a number
      between 0-255.  It needs to be capped to prevent writing beyond the end
      of dma_buffer[].
      
      Fixes: 5e9a97b1
      
       ("i2c: ismt: Adding support for I2C_SMBUS_BLOCK_PROC_CALL")
      Reported-and-tested-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      690b2549
    • Alexander Lobakin's avatar
      ice: fix access-beyond-end in the switch code · 6e1ff618
      Alexander Lobakin authored
      Global `-Warray-bounds` enablement revealed some problems, one of
      which is the way we define and use AQC rules messages.
      In fact, they have a shared header, followed by the actual message,
      which can be of one of several different formats. So it is
      straightforward enough to define that header as a separate struct
      and then embed it into message structures as needed, but currently
      all the formats reside in one union coupled with the header. Then,
      the code allocates only the memory needed for a particular message
      format, leaving the union potentially incomplete.
      There are no actual reads or writes beyond the end of an allocated
      chunk, but at the same time, the whole implementation is fragile and
      backed by an equilibrium rather than strong type and memory checks.
      
      Define the structures the other way around: one for the common
      header and the rest for the actual formats with the header embedded.
      There are no places where several union members would be used at the
      same time anyway. This allows to use proper struct_size() and let
      the compiler know what is going to be done.
      Finally, unsilence `-Warray-bounds` back for ice_switch.c.
      
      Other little things worth mentioning:
      * &ice_sw_rule_vsi_list_query is not used anywhere, remove it. It's
        weird anyway to talk to hardware with purely kernel types
        (bitmaps);
      * expand the ICE_SW_RULE_*_SIZE() macros to pass a structure
        variable name to struct_size() to let it do strict typechecking;
      * rename ice_sw_rule_lkup_rx_tx::hdr to ::hdr_data to keep ::hdr
        for the header structure to have the same name for it constistenly
        everywhere;
      * drop the duplicate of %ICE_SW_RULE_RX_TX_NO_HDR_SIZE residing in
        ice_switch.h.
      
      Fixes: 9daf8208 ("ice: Add support for switch filter programming")
      Fixes: 66486d89
      
       ("ice: replace single-element array used for C struct hack")
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Reviewed-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Acked-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Link: https://lore.kernel.org/r/20220601105924.2841410-1-alexandr.lobakin@intel.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      6e1ff618
    • Fei Qin's avatar
      nfp: remove padding in nfp_nfdk_tx_desc · c6fbbf1e
      Fei Qin authored
      NFDK firmware supports 48-bit dma addressing and
      parses 16 high bits of dma addresses.
      
      In nfp_nfdk_tx_desc, dma related structure and tso
      related structure are union. When "mss" be filled
      with nonzero value due to enable tso, the memory used
      by "padding" may be also filled. Then, firmware may
      parse wrong dma addresses which causes TX watchdog
      timeout problem.
      
      This patch removes padding and unifies the dma_addr_hi
      bits with the one in firmware. nfp_nfdk_tx_desc_set_dma_addr
      is also added to match this change.
      
      Fixes: c10d12e3
      
       ("nfp: add support for NFDK data path")
      Signed-off-by: default avatarFei Qin <fei.qin@corigine.com>
      Signed-off-by: default avatarYinjun Zhang <yinjun.zhang@corigine.com>
      Signed-off-by: default avatarLouis Peens <louis.peens@corigine.com>
      Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
      Link: https://lore.kernel.org/r/20220601083449.50556-1-simon.horman@corigine.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      c6fbbf1e
    • Duoming Zhou's avatar
      ax25: Fix ax25 session cleanup problems · 7d8a3a47
      Duoming Zhou authored
      There are session cleanup problems in ax25_release() and
      ax25_disconnect(). If we setup a session and then disconnect,
      the disconnected session is still in "LISTENING" state that
      is shown below.
      
      Active AX.25 sockets
      Dest       Source     Device  State        Vr/Vs    Send-Q  Recv-Q
      DL9SAU-4   DL9SAU-3   ???     LISTENING    000/000  0       0
      DL9SAU-3   DL9SAU-4   ???     LISTENING    000/000  0       0
      
      The first reason is caused by del_timer_sync() in ax25_release().
      The timers of ax25 are used for correct session cleanup. If we use
      ax25_release() to close ax25 sessions and ax25_dev is not null,
      the del_timer_sync() functions in ax25_release() will execute.
      As a result, the sessions could not be cleaned up correctly,
      because the timers have stopped.
      
      In order to solve this problem, this patch adds a device_up flag
      in ax25_dev in order to judge whether the device is up. If there
      are sessions to be cleaned up, the del_timer_sync() in
      ax25_release() will not execute. What's more, we add ax25_cb_del()
      in ax25_kill_by_device(), because the timers have been stopped
      and there are no functions that could delete ax25_cb if we do not
      call ax25_release(). Finally, we reorder the position of
      ax25_list_lock in ax25_cb_del() in order to synchronize among
      different functions that call ax25_cb_del().
      
      The second reason is caused by improper check in ax25_disconnect().
      The incoming ax25 sessions which ax25->sk is null will close
      heartbeat timer, because the check "if(!ax25->sk || ..)" is
      satisfied. As a result, the session could not be cleaned up properly.
      
      In order to solve this problem, this patch changes the improper
      check to "if(ax25->sk && ..)" in ax25_disconnect().
      
      What`s more, the ax25_disconnect() may be called twice, which is
      not necessary. For example, ax25_kill_by_device() calls
      ax25_disconnect() and sets ax25->state to AX25_STATE_0, but
      ax25_release() calls ax25_disconnect() again.
      
      In order to solve this problem, this patch add a check in
      ax25_release(). If the flag of ax25->sk equals to SOCK_DEAD,
      the ax25_disconnect() in ax25_release() should not be executed.
      
      Fixes: 82e31755 ("ax25: Fix UAF bugs in ax25 timers")
      Fixes: 8a367e74
      
       ("ax25: Fix segfault after sock connection timeout")
      Reported-and-tested-by: default avatarThomas Osterried <thomas@osterried.de>
      Signed-off-by: default avatarDuoming Zhou <duoming@zju.edu.cn>
      Link: https://lore.kernel.org/r/20220530152158.108619-1-duoming@zju.edu.cn
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      7d8a3a47
    • Stephen Brennan's avatar
      assoc_array: Fix BUG_ON during garbage collect · d1dc8776
      Stephen Brennan authored
      A rare BUG_ON triggered in assoc_array_gc:
      
          [3430308.818153] kernel BUG at lib/assoc_array.c:1609!
      
      Which corresponded to the statement currently at line 1593 upstream:
      
          BUG_ON(assoc_array_ptr_is_meta(p));
      
      Using the data from the core dump, I was able to generate a userspace
      reproducer[1] and determine the cause of the bug.
      
      [1]: https://github.com/brenns10/kernel_stuff/tree/master/assoc_array_gc
      
      After running the iterator on the entire branch, an internal tree node
      looked like the following:
      
          NODE (nr_leaves_on_branch: 3)
            SLOT [0] NODE (2 leaves)
            SLOT [1] NODE (1 leaf)
            SLOT [2..f] NODE (empty)
      
      In the userspace reproducer, the pr_devel output when compressing this
      node was:
      
          -- compress node 0x5607cc089380 --
          free=0, leaves=0
          [0] retain node 2/1 [nx 0]
          [1] fold node 1/1 [nx 0]
          [2] fold node 0/1 [nx 2]
          [3] fold node 0/2 [nx 2]
          [4] fold node 0/3 [nx 2]
          [5] fold node 0/4 [nx 2]
          [6] fold node 0/5 [nx 2]
          [7] fold node 0/6 [nx 2]
          [8] fold node 0/7 [nx 2]
          [9] fold node 0/8 [nx 2]
          [10] fold node 0/9 [nx 2]
          [11] fold node 0/10 [nx 2]
          [12] fold node 0/11 [nx 2]
          [13] fold node 0/12 [nx 2]
          [14] fold node 0/13 [nx 2]
          [15] fold node 0/14 [nx 2]
          after: 3
      
      At slot 0, an internal node with 2 leaves could not be folded into the
      node, because there was only one available slot (slot 0). Thus, the
      internal node was retained. At slot 1, the node had one leaf, and was
      able to be folded in successfully. The remaining nodes had no leaves,
      and so were removed. By the end of the compression stage, there were 14
      free slots, and only 3 leaf nodes. The tree was ascended and then its
      parent node was compressed. When this node was seen, it could not be
      folded, due to the internal node it contained.
      
      The invariant for compression in this function is: whenever
      nr_leaves_on_branch < ASSOC_ARRAY_FAN_OUT, the node should contain all
      leaf nodes. The compression step currently cannot guarantee this, given
      the corner case shown above.
      
      To fix this issue, retry compression whenever we have retained a node,
      and yet nr_leaves_on_branch < ASSOC_ARRAY_FAN_OUT. This second
      compression will then allow the node in slot 1 to be folded in,
      satisfying the invariant. Below is the output of the reproducer once the
      fix is applied:
      
          -- compress node 0x560e9c562380 --
          free=0, leaves=0
          [0] retain node 2/1 [nx 0]
          [1] fold node 1/1 [nx 0]
          [2] fold node 0/1 [nx 2]
          [3] fold node 0/2 [nx 2]
          [4] fold node 0/3 [nx 2]
          [5] fold node 0/4 [nx 2]
          [6] fold node 0/5 [nx 2]
          [7] fold node 0/6 [nx 2]
          [8] fold node 0/7 [nx 2]
          [9] fold node 0/8 [nx 2]
          [10] fold node 0/9 [nx 2]
          [11] fold node 0/10 [nx 2]
          [12] fold node 0/11 [nx 2]
          [13] fold node 0/12 [nx 2]
          [14] fold node 0/13 [nx 2]
          [15] fold node 0/14 [nx 2]
          internal nodes remain despite enough space, retrying
          -- compress node 0x560e9c562380 --
          free=14, leaves=1
          [0] fold node 2/15 [nx 0]
          after: 3
      
      Changes
      =======
      DH:
       - Use false instead of 0.
       - Reorder the inserted lines in a couple of places to put retained before
         next_slot.
      
      ver #2)
       - Fix typo in pr_devel, correct comparison to "<="
      
      Fixes: 3cb98950
      
       ("Add a generic associative array implementation.")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarStephen Brennan <stephen.s.brennan@oracle.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Andrew Morton <akpm@linux-foundation.org>
      cc: keyrings@vger.kernel.org
      Link: https://lore.kernel.org/r/20220511225517.407935-1-stephen.s.brennan@oracle.com/ # v1
      Link: https://lore.kernel.org/r/20220512215045.489140-1-stephen.s.brennan@oracle.com/
      
       # v2
      Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d1dc8776
    • Slark Xiao's avatar
      net: usb: qmi_wwan: Add support for Cinterion MV31 with new baseline · 9f4fc18b
      Slark Xiao authored
      
      
      Adding support for Cinterion device MV31 with Qualcomm
      new baseline. Use different PIDs to separate it from
      previous base line products.
      All interfaces settings keep same as previous.
      
      T:  Bus=03 Lev=01 Prnt=01 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=1e2d ProdID=00b9 Rev=04.14
      S:  Manufacturer=Cinterion
      S:  Product=Cinterion PID 0x00B9 USB Mobile Broadband
      S:  SerialNumber=90418e79
      C:  #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:  If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
      I:  If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
      I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
      I:  If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
      
      Signed-off-by: default avatarSlark Xiao <slark_xiao@163.com>
      Acked-by: default avatarBjørn Mork <bjorn@mork.no>
      Link: https://lore.kernel.org/r/20220601040531.6016-1-slark_xiao@163.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9f4fc18b