óÐÉÓÏË ÉÚÍÅÎÅÎÉÊ × Linux 5.18.7

 
bpf: Fix calling global functions from BPF_PROG_TYPE_EXT programs [+ + +]
Author: Toke Høiland-Jørgensen <toke@redhat.com>
Date:   Mon Jun 6 09:52:51 2022 +0200

    bpf: Fix calling global functions from BPF_PROG_TYPE_EXT programs
    
    commit f858c2b2ca04fc7ead291821a793638ae120c11d upstream.
    
    The verifier allows programs to call global functions as long as their
    argument types match, using BTF to check the function arguments. One of the
    allowed argument types to such global functions is PTR_TO_CTX; however the
    check for this fails on BPF_PROG_TYPE_EXT functions because the verifier
    uses the wrong type to fetch the vmlinux BTF ID for the program context
    type. This failure is seen when an XDP program is loaded using
    libxdp (which loads it as BPF_PROG_TYPE_EXT and attaches it to a global XDP
    type program).
    
    Fix the issue by passing in the target program type instead of the
    BPF_PROG_TYPE_EXT type to bpf_prog_get_ctx() when checking function
    argument compatibility.
    
    The first Fixes tag refers to the latest commit that touched the code in
    question, while the second one points to the code that first introduced
    the global function call verification.
    
    v2:
    - Use resolve_prog_type()
    
    Fixes: 3363bd0cfbb8 ("bpf: Extend kfunc with PTR_TO_CTX, PTR_TO_MEM argument support")
    Fixes: 51c39bb1d5d1 ("bpf: Introduce function-by-function verification")
    Reported-by: Simon Sundberg <simon.sundberg@kau.se>
    Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
    Link: https://lore.kernel.org/r/20220606075253.28422-1-toke@redhat.com
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    [ backport: resolve conflict due to kptr series missing ]
    Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
dt-bindings: nvmem: sfp: Add clock properties [+ + +]
Author: Sean Anderson <sean.anderson@seco.com>
Date:   Fri Apr 29 17:26:57 2022 +0100

    dt-bindings: nvmem: sfp: Add clock properties
    
    commit 8cb0cd68bef75af5ac8ef93f3314d4f8dc8767a3 upstream.
    
    To program fuses, it is necessary to set the fuse programming time. This
    is determined based on the value of the platform clock. Add a clock
    property.
    
    Because this property is necessary for programming, it is made
    mandatory. Since these bindings have not yet been present in a stable
    release (though they are on track for 5.18), it is not an ABI break to
    change them in this manner.
    
    Signed-off-by: Sean Anderson <sean.anderson@seco.com>
    Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
    Link: https://lore.kernel.org/r/20220429162701.2222-13-srinivas.kandagatla@linaro.org
    Cc: Michael Walle <michael@walle.cc>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
eth: sun: cassini: remove dead code [+ + +]
Author: Martin Liška <mliska@suse.cz>
Date:   Wed May 18 09:18:53 2022 +0200

    eth: sun: cassini: remove dead code
    
    commit 32329216ca1d6ee29c41215f18b3053bb6158541 upstream.
    
    Fixes the following GCC warning:
    
    drivers/net/ethernet/sun/cassini.c:1316:29: error: comparison between two arrays [-Werror=array-compare]
    drivers/net/ethernet/sun/cassini.c:3783:34: error: comparison between two arrays [-Werror=array-compare]
    
    Note that 2 arrays should be compared by comparing of their addresses:
    note: use ‘&cas_prog_workaroundtab[0] == &cas_prog_null[0]’ to compare the addresses
    
    Signed-off-by: Martin Liska <mliska@suse.cz>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
fsnotify: consistent behavior for parent not watching children [+ + +]
Author: Amir Goldstein <amir73il@gmail.com>
Date:   Wed May 11 22:02:13 2022 +0300

    fsnotify: consistent behavior for parent not watching children
    
    commit e730558adffb88a52e562db089e969ee9510184a upstream.
    
    The logic for handling events on child in groups that have a mark on
    the parent inode, but without FS_EVENT_ON_CHILD flag in the mask is
    duplicated in several places and inconsistent.
    
    Move the logic into the preparation of mark type iterator, so that the
    parent mark type will be excluded from all mark type iterations in that
    case.
    
    This results in several subtle changes of behavior, hopefully all
    desired changes of behavior, for example:
    
    - Group A has a mount mark with FS_MODIFY in mask
    - Group A has a mark with ignore mask that does not survive FS_MODIFY
      and does not watch children on directory D.
    - Group B has a mark with FS_MODIFY in mask that does watch children
      on directory D.
    - FS_MODIFY event on file D/foo should not clear the ignore mask of
      group A, but before this change it does
    
    And if group A ignore mask was set to survive FS_MODIFY:
    - FS_MODIFY event on file D/foo should be reported to group A on account
      of the mount mark, but before this change it is wrongly ignored
    
    Fixes: 2f02fd3fa13e ("fanotify: fix ignore mask logic for events on child and on dir")
    Reported-by: Jan Kara <jack@suse.com>
    Link: https://lore.kernel.org/linux-fsdevel/20220314113337.j7slrb5srxukztje@quack3.lan/
    Signed-off-by: Amir Goldstein <amir73il@gmail.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Link: https://lore.kernel.org/r/20220511190213.831646-3-amir73il@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

fsnotify: introduce mark type iterator [+ + +]
Author: Amir Goldstein <amir73il@gmail.com>
Date:   Wed May 11 22:02:12 2022 +0300

    fsnotify: introduce mark type iterator
    
    commit 14362a2541797cf9df0e86fb12dcd7950baf566e upstream.
    
    fsnotify_foreach_iter_mark_type() is used to reduce boilerplate code
    of iterating all marks of a specific group interested in an event
    by consulting the iterator report_mask.
    
    Use an open coded version of that iterator in fsnotify_iter_next()
    that collects all marks of the current iteration group without
    consulting the iterator report_mask.
    
    At the moment, the two iterator variants are the same, but this
    decoupling will allow us to exclude some of the group's marks from
    reporting the event, for example for event on child and inode marks
    on parent did not request to watch events on children.
    
    Fixes: 2f02fd3fa13e ("fanotify: fix ignore mask logic for events on child and on dir")
    Reported-by: Jan Kara <jack@suse.com>
    Signed-off-by: Amir Goldstein <amir73il@gmail.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Link: https://lore.kernel.org/r/20220511190213.831646-2-amir73il@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
io_uring: use original request task for inflight tracking [+ + +]
Author: Jens Axboe <axboe@kernel.dk>
Date:   Thu Jun 23 11:06:43 2022 -0600

    io_uring: use original request task for inflight tracking
    
    commit 386e4fb6962b9f248a80f8870aea0870ca603e89 upstream.
    
    In prior kernels, we did file assignment always at prep time. This meant
    that req->task == current. But after deferring that assignment and then
    pushing the inflight tracking back in, we've got the inflight tracking
    using current when it should in fact now be using req->task.
    
    Fixup that error introduced by adding the inflight tracking back after
    file assignments got modifed.
    
    Fixes: 9cae36a094e7 ("io_uring: reinstate the inflight tracking")
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Linux: Linux 5.18.7 [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Sat Jun 25 15:29:48 2022 +0200

    Linux 5.18.7
    
    Link: https://lore.kernel.org/r/20220623164322.315085512@linuxfoundation.org
    Tested-by: Ronald Warsow <rwarsow@gmx.de
    Tested-by: Florian Fainelli <f.fainelli@gmail.com>
    Tested-by: Zan Aziz <zanaziz313@gmail.com>
    Tested-by: Shuah Khan <skhan@linuxfoundation.org>
    Tested-by: Ron Economos <re@w6rz.net>
    Tested-by: Fenil Jain <fkjainco@gmail.com>
    Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
    Tested-by: Rudi Heitbaum <rudi@heitbaum.com>
    Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
net: wwan: iosm: remove pointless null check [+ + +]
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Wed May 18 17:43:42 2022 -0700

    net: wwan: iosm: remove pointless null check
    
    commit dbbc7d04c549a43ad343c69e17b27a57e2102041 upstream.
    
    GCC 12 warns:
    
    drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c: In function ‘ipc_protocol_dl_td_process’:
    drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c:406:13: warning: the comparison will always evaluate as ‘true’ for the address of ‘cb’ will never be NULL [-Waddress]
      406 |         if (!IPC_CB(skb)) {
          |             ^
    
    Indeed the check seems entirely pointless. Hopefully the other
    validation checks will catch if the cb is bad, but it can't be
    NULL.
    
    Reviewed-by: M Chetan Kumar <m.chetan.kumar@intel.com>
    Link: https://lore.kernel.org/r/20220519004342.2109832-1-kuba@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
s390/mm: use non-quiescing sske for KVM switch to keyed guest [+ + +]
Author: Christian Borntraeger <borntraeger@linux.ibm.com>
Date:   Mon May 30 11:27:06 2022 +0200

    s390/mm: use non-quiescing sske for KVM switch to keyed guest
    
    commit 3ae11dbcfac906a8c3a480e98660a823130dc16a upstream.
    
    The switch to a keyed guest does not require a classic sske as the other
    guest CPUs are not accessing the key before the switch is complete.
    By using the NQ SSKE things are faster especially with multiple guests.
    
    Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
    Suggested-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
    Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
    Link: https://lore.kernel.org/r/20220530092706.11637-3-borntraeger@linux.ibm.com
    Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
    Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
selftests/bpf: Add selftest for calling global functions from freplace [+ + +]
Author: Toke Høiland-Jørgensen <toke@redhat.com>
Date:   Mon Jun 6 09:52:52 2022 +0200

    selftests/bpf: Add selftest for calling global functions from freplace
    
    commit 2cf7b7ffdae519b284f1406012b52e2282fa36bf upstream.
    
    Add a selftest that calls a global function with a context object parameter
    from an freplace function to check that the program context type is
    correctly converted to the freplace target when fetching the context type
    from the kernel BTF.
    
    v2:
    - Trim includes
    - Get rid of global function
    - Use __noinline
    
    Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
    Link: https://lore.kernel.org/r/20220606075253.28422-2-toke@redhat.com
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
wifi: rtlwifi: remove always-true condition pointed out by GCC 12 [+ + +]
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Fri May 20 12:43:15 2022 -0700

    wifi: rtlwifi: remove always-true condition pointed out by GCC 12
    
    commit ee3db469dd317e82f57b13aa3bc61be5cb60c2b4 upstream.
    
    The .value is a two-dim array, not a pointer.
    
    struct iqk_matrix_regs {
            bool iqk_done;
            long value[1][IQK_MATRIX_REG_NUM];
    };
    
    Acked-by: Kalle Valo <kvalo@kernel.org>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
x86/boot: Wrap literal addresses in absolute_pointer() [+ + +]
Author: Kees Cook <keescook@chromium.org>
Date:   Sun Feb 27 11:59:18 2022 -0800

    x86/boot: Wrap literal addresses in absolute_pointer()
    
    commit aeb84412037b89e06f45e382f044da6f200e12f8 upstream.
    
    GCC 11 (incorrectly[1]) assumes that literal values cast to (void *)
    should be treated like a NULL pointer with an offset, and raises
    diagnostics when doing bounds checking under -Warray-bounds. GCC 12
    got "smarter" about finding these:
    
      In function 'rdfs8',
          inlined from 'vga_recalc_vertical' at /srv/code/arch/x86/boot/video-mode.c:124:29,
          inlined from 'set_mode' at /srv/code/arch/x86/boot/video-mode.c:163:3:
      /srv/code/arch/x86/boot/boot.h:114:9: warning: array subscript 0 is outside array bounds of 'u8[0]' {aka 'unsigned char[]'} [-Warray-bounds]
        114 |         asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
            |         ^~~
    
    This has been solved in other places[2] already by using the recently
    added absolute_pointer() macro. Do the same here.
    
      [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578
      [2] https://lore.kernel.org/all/20210912160149.2227137-1-linux@roeck-us.net/
    
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Reviewed-by: Guenter Roeck <linux@roeck-us.net>
    Link: https://lore.kernel.org/r/20220227195918.705219-1-keescook@chromium.org
    Cc: Jiri Slaby <jirislaby@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
zonefs: fix zonefs_iomap_begin() for reads [+ + +]
Author: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Date:   Mon May 23 16:29:10 2022 +0900

    zonefs: fix zonefs_iomap_begin() for reads
    
    commit c1c1204c0d0c1dccc1310b9277fb2bd8b663d8fe upstream.
    
    If a readahead is issued to a sequential zone file with an offset
    exactly equal to the current file size, the iomap type is set to
    IOMAP_UNWRITTEN, which will prevent an IO, but the iomap length is
    calculated as 0. This causes a WARN_ON() in iomap_iter():
    
    [17309.548939] WARNING: CPU: 3 PID: 2137 at fs/iomap/iter.c:34 iomap_iter+0x9cf/0xe80
    [...]
    [17309.650907] RIP: 0010:iomap_iter+0x9cf/0xe80
    [...]
    [17309.754560] Call Trace:
    [17309.757078]  <TASK>
    [17309.759240]  ? lock_is_held_type+0xd8/0x130
    [17309.763531]  iomap_readahead+0x1a8/0x870
    [17309.767550]  ? iomap_read_folio+0x4c0/0x4c0
    [17309.771817]  ? lockdep_hardirqs_on_prepare+0x400/0x400
    [17309.778848]  ? lock_release+0x370/0x750
    [17309.784462]  ? folio_add_lru+0x217/0x3f0
    [17309.790220]  ? reacquire_held_locks+0x4e0/0x4e0
    [17309.796543]  read_pages+0x17d/0xb60
    [17309.801854]  ? folio_add_lru+0x238/0x3f0
    [17309.807573]  ? readahead_expand+0x5f0/0x5f0
    [17309.813554]  ? policy_node+0xb5/0x140
    [17309.819018]  page_cache_ra_unbounded+0x27d/0x450
    [17309.825439]  filemap_get_pages+0x500/0x1450
    [17309.831444]  ? filemap_add_folio+0x140/0x140
    [17309.837519]  ? lock_is_held_type+0xd8/0x130
    [17309.843509]  filemap_read+0x28c/0x9f0
    [17309.848953]  ? zonefs_file_read_iter+0x1ea/0x4d0 [zonefs]
    [17309.856162]  ? trace_contention_end+0xd6/0x130
    [17309.862416]  ? __mutex_lock+0x221/0x1480
    [17309.868151]  ? zonefs_file_read_iter+0x166/0x4d0 [zonefs]
    [17309.875364]  ? filemap_get_pages+0x1450/0x1450
    [17309.881647]  ? __mutex_unlock_slowpath+0x15e/0x620
    [17309.888248]  ? wait_for_completion_io_timeout+0x20/0x20
    [17309.895231]  ? lock_is_held_type+0xd8/0x130
    [17309.901115]  ? lock_is_held_type+0xd8/0x130
    [17309.906934]  zonefs_file_read_iter+0x356/0x4d0 [zonefs]
    [17309.913750]  new_sync_read+0x2d8/0x520
    [17309.919035]  ? __x64_sys_lseek+0x1d0/0x1d0
    
    Furthermore, this causes iomap_readahead() to loop forever as
    iomap_readahead_iter() always returns 0, making no progress.
    
    Fix this by treating reads after the file size as access to holes,
    setting the iomap type to IOMAP_HOLE, the iomap addr to IOMAP_NULL_ADDR
    and using the length argument as is for the iomap length. To simplify
    the code with this change, zonefs_iomap_begin() is split into the read
    variant, zonefs_read_iomap_begin() and zonefs_read_iomap_ops, and the
    write variant, zonefs_write_iomap_begin() and zonefs_write_iomap_ops.
    
    Reported-by: Jorgen Hansen <Jorgen.Hansen@wdc.com>
    Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system")
    Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
    Reviewed-by: Jorgen Hansen <Jorgen.Hansen@wdc.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>