commit 004bfaafc45ccc95366b37c9b9e7844cd5156368
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed Mar 23 09:01:35 2022 +0100

    Linux 4.14.273
    
    Link: https://lore.kernel.org/r/20220321133217.602054917@linuxfoundation.org
    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 01064d855a4eb3f55ddd315e48f46fad73c633fe
Author: Michael Petlan <mpetlan@redhat.com>
Date:   Thu Mar 17 14:55:36 2022 +0100

    perf symbols: Fix symbol size calculation condition
    
    commit 3cf6a32f3f2a45944dd5be5c6ac4deb46bcd3bee upstream.
    
    Before this patch, the symbol end address fixup to be called, needed two
    conditions being met:
    
      if (prev->end == prev->start && prev->end != curr->start)
    
    Where
      "prev->end == prev->start" means that prev is zero-long
                                 (and thus needs a fixup)
    and
      "prev->end != curr->start" means that fixup hasn't been applied yet
    
    However, this logic is incorrect in the following situation:
    
    *curr  = {rb_node = {__rb_parent_color = 278218928,
      rb_right = 0x0, rb_left = 0x0},
      start = 0xc000000000062354,
      end = 0xc000000000062354, namelen = 40, type = 2 '\002',
      binding = 0 '\000', idle = 0 '\000', ignore = 0 '\000',
      inlined = 0 '\000', arch_sym = 0 '\000', annotate2 = false,
      name = 0x1159739e "kprobe_optinsn_page\t[__builtin__kprobes]"}
    
    *prev = {rb_node = {__rb_parent_color = 278219041,
      rb_right = 0x109548b0, rb_left = 0x109547c0},
      start = 0xc000000000062354,
      end = 0xc000000000062354, namelen = 12, type = 2 '\002',
      binding = 1 '\001', idle = 0 '\000', ignore = 0 '\000',
      inlined = 0 '\000', arch_sym = 0 '\000', annotate2 = false,
      name = 0x1095486e "optinsn_slot"}
    
    In this case, prev->start == prev->end == curr->start == curr->end,
    thus the condition above thinks that "we need a fixup due to zero
    length of prev symbol, but it has been probably done, since the
    prev->end == curr->start", which is wrong.
    
    After the patch, the execution path proceeds to arch__symbols__fixup_end
    function which fixes up the size of prev symbol by adding page_size to
    its end offset.
    
    Fixes: 3b01a413c196c910 ("perf symbols: Improve kallsyms symbol end addr calculation")
    Signed-off-by: Michael Petlan <mpetlan@redhat.com>
    Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kajol Jain <kjain@linux.ibm.com>
    Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
    Link: http://lore.kernel.org/lkml/20220317135536.805-1-mpetlan@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fc8033a55e2796d21e370260a784ac9fbb8305a6
Author: Pavel Skripkin <paskripkin@gmail.com>
Date:   Sun Mar 13 22:56:32 2022 -0700

    Input: aiptek - properly check endpoint type
    
    commit 5600f6986628dde8881734090588474f54a540a8 upstream.
    
    Syzbot reported warning in usb_submit_urb() which is caused by wrong
    endpoint type. There was a check for the number of endpoints, but not
    for the type of endpoint.
    
    Fix it by replacing old desc.bNumEndpoints check with
    usb_find_common_endpoints() helper for finding endpoints
    
    Fail log:
    
    usb 5-1: BOGUS urb xfer, pipe 1 != type 3
    WARNING: CPU: 2 PID: 48 at drivers/usb/core/urb.c:502 usb_submit_urb+0xed2/0x18a0 drivers/usb/core/urb.c:502
    Modules linked in:
    CPU: 2 PID: 48 Comm: kworker/2:2 Not tainted 5.17.0-rc6-syzkaller-00226-g07ebd38a0da2 #0
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
    Workqueue: usb_hub_wq hub_event
    ...
    Call Trace:
     <TASK>
     aiptek_open+0xd5/0x130 drivers/input/tablet/aiptek.c:830
     input_open_device+0x1bb/0x320 drivers/input/input.c:629
     kbd_connect+0xfe/0x160 drivers/tty/vt/keyboard.c:1593
    
    Fixes: 8e20cf2bce12 ("Input: aiptek - fix crash on detecting device without endpoints")
    Reported-and-tested-by: syzbot+75cccf2b7da87fb6f84b@syzkaller.appspotmail.com
    Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
    Link: https://lore.kernel.org/r/20220308194328.26220-1-paskripkin@gmail.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e2d3a7009e505e120805f449c832942660f3f7f3
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Sat Mar 5 21:47:22 2022 -0500

    usb: gadget: Fix use-after-free bug by not setting udc->dev.driver
    
    commit 16b1941eac2bd499f065a6739a40ce0011a3d740 upstream.
    
    The syzbot fuzzer found a use-after-free bug:
    
    BUG: KASAN: use-after-free in dev_uevent+0x712/0x780 drivers/base/core.c:2320
    Read of size 8 at addr ffff88802b934098 by task udevd/3689
    
    CPU: 2 PID: 3689 Comm: udevd Not tainted 5.17.0-rc4-syzkaller-00229-g4f12b742eb2b #0
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
    Call Trace:
     <TASK>
     __dump_stack lib/dump_stack.c:88 [inline]
     dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
     print_address_description.constprop.0.cold+0x8d/0x303 mm/kasan/report.c:255
     __kasan_report mm/kasan/report.c:442 [inline]
     kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
     dev_uevent+0x712/0x780 drivers/base/core.c:2320
     uevent_show+0x1b8/0x380 drivers/base/core.c:2391
     dev_attr_show+0x4b/0x90 drivers/base/core.c:2094
    
    Although the bug manifested in the driver core, the real cause was a
    race with the gadget core.  dev_uevent() does:
    
            if (dev->driver)
                    add_uevent_var(env, "DRIVER=%s", dev->driver->name);
    
    and between the test and the dereference of dev->driver, the gadget
    core sets dev->driver to NULL.
    
    The race wouldn't occur if the gadget core registered its devices on
    a real bus, using the standard synchronization techniques of the
    driver core.  However, it's not necessary to make such a large change
    in order to fix this bug; all we need to do is make sure that
    udc->dev.driver is always NULL.
    
    In fact, there is no reason for udc->dev.driver ever to be set to
    anything, let alone to the value it currently gets: the address of the
    gadget's driver.  After all, a gadget driver only knows how to manage
    a gadget, not how to manage a UDC.
    
    This patch simply removes the statements in the gadget core that touch
    udc->dev.driver.
    
    Fixes: 2ccea03a8f7e ("usb: gadget: introduce UDC Class")
    CC: <stable@vger.kernel.org>
    Reported-and-tested-by: syzbot+348b571beb5eeb70a582@syzkaller.appspotmail.com
    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Link: https://lore.kernel.org/r/YiQgukfFFbBnwJ/9@rowland.harvard.edu
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c7953cf03a26876d676145ce5d2ae6d8c9630b90
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Tue Mar 1 11:04:24 2022 +0300

    usb: gadget: rndis: prevent integer overflow in rndis_set_response()
    
    commit 65f3324f4b6fed78b8761c3b74615ecf0ffa81fa upstream.
    
    If "BufOffset" is very large the "BufOffset + 8" operation can have an
    integer overflow.
    
    Cc: stable@kernel.org
    Fixes: 38ea1eac7d88 ("usb: gadget: rndis: check size of RNDIS_MSG_SET command")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Link: https://lore.kernel.org/r/20220301080424.GA17208@kili
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a5b9b649a96631f736adb9f532eb838c79975dde
Author: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date:   Tue Mar 15 10:20:08 2022 +0100

    net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit()
    
    [ Upstream commit 4ee06de7729d795773145692e246a06448b1eb7a ]
    
    This kind of interface doesn't have a mac header. This patch fixes
    bpf_redirect() to a PIM interface.
    
    Fixes: 27b29f63058d ("bpf: add bpf_redirect() helper")
    Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
    Link: https://lore.kernel.org/r/20220315092008.31423-1-nicolas.dichtel@6wind.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit c7a9b80d0ea4df98b197c6d12c63b386fa75c0ec
Author: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Date:   Mon Mar 14 09:34:48 2022 +0800

    atm: eni: Add check for dma_map_single
    
    [ Upstream commit 0f74b29a4f53627376cf5a5fb7b0b3fa748a0b2b ]
    
    As the potential failure of the dma_map_single(),
    it should be better to check it and return error
    if fails.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit b1e27cda1e3c12b705875bb7e247a97168580e33
Author: Eric Dumazet <edumazet@google.com>
Date:   Sat Mar 12 15:29:58 2022 -0800

    net/packet: fix slab-out-of-bounds access in packet_recvmsg()
    
    [ Upstream commit c700525fcc06b05adfea78039de02628af79e07a ]
    
    syzbot found that when an AF_PACKET socket is using PACKET_COPY_THRESH
    and mmap operations, tpacket_rcv() is queueing skbs with
    garbage in skb->cb[], triggering a too big copy [1]
    
    Presumably, users of af_packet using mmap() already gets correct
    metadata from the mapped buffer, we can simply make sure
    to clear 12 bytes that might be copied to user space later.
    
    BUG: KASAN: stack-out-of-bounds in memcpy include/linux/fortify-string.h:225 [inline]
    BUG: KASAN: stack-out-of-bounds in packet_recvmsg+0x56c/0x1150 net/packet/af_packet.c:3489
    Write of size 165 at addr ffffc9000385fb78 by task syz-executor233/3631
    
    CPU: 0 PID: 3631 Comm: syz-executor233 Not tainted 5.17.0-rc7-syzkaller-02396-g0b3660695e80 #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
     <TASK>
     __dump_stack lib/dump_stack.c:88 [inline]
     dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
     print_address_description.constprop.0.cold+0xf/0x336 mm/kasan/report.c:255
     __kasan_report mm/kasan/report.c:442 [inline]
     kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
     check_region_inline mm/kasan/generic.c:183 [inline]
     kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
     memcpy+0x39/0x60 mm/kasan/shadow.c:66
     memcpy include/linux/fortify-string.h:225 [inline]
     packet_recvmsg+0x56c/0x1150 net/packet/af_packet.c:3489
     sock_recvmsg_nosec net/socket.c:948 [inline]
     sock_recvmsg net/socket.c:966 [inline]
     sock_recvmsg net/socket.c:962 [inline]
     ____sys_recvmsg+0x2c4/0x600 net/socket.c:2632
     ___sys_recvmsg+0x127/0x200 net/socket.c:2674
     __sys_recvmsg+0xe2/0x1a0 net/socket.c:2704
     do_syscall_x64 arch/x86/entry/common.c:50 [inline]
     do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
     entry_SYSCALL_64_after_hwframe+0x44/0xae
    RIP: 0033:0x7fdfd5954c29
    Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
    RSP: 002b:00007ffcf8e71e48 EFLAGS: 00000246 ORIG_RAX: 000000000000002f
    RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fdfd5954c29
    RDX: 0000000000000000 RSI: 0000000020000500 RDI: 0000000000000005
    RBP: 0000000000000000 R08: 000000000000000d R09: 000000000000000d
    R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffcf8e71e60
    R13: 00000000000f4240 R14: 000000000000c1ff R15: 00007ffcf8e71e54
     </TASK>
    
    addr ffffc9000385fb78 is located in stack of task syz-executor233/3631 at offset 32 in frame:
     ____sys_recvmsg+0x0/0x600 include/linux/uio.h:246
    
    this frame has 1 object:
     [32, 160) 'addr'
    
    Memory state around the buggy address:
     ffffc9000385fa80: 00 04 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00
     ffffc9000385fb00: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00
    >ffffc9000385fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3
                                                                    ^
     ffffc9000385fc00: f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 f1
     ffffc9000385fc80: f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00
    ==================================================================
    
    Fixes: 0fb375fb9b93 ("[AF_PACKET]: Allow for > 8 byte hardware addresses.")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Link: https://lore.kernel.org/r/20220312232958.3535620-1-eric.dumazet@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 6c7f2aaf4d3cc6e5b34efdb40b3806edf2294852
Author: Randy Dunlap <rdunlap@infradead.org>
Date:   Mon Feb 28 20:18:51 2022 -0800

    efi: fix return value of __setup handlers
    
    [ Upstream commit 9feaf8b387ee0ece9c1d7add308776b502a35d0c ]
    
    When "dump_apple_properties" is used on the kernel boot command line,
    it causes an Unknown parameter message and the string is added to init's
    argument strings:
    
      Unknown kernel command line parameters "dump_apple_properties
        BOOT_IMAGE=/boot/bzImage-517rc6 efivar_ssdt=newcpu_ssdt", will be
        passed to user space.
    
     Run /sbin/init as init process
       with arguments:
         /sbin/init
         dump_apple_properties
       with environment:
         HOME=/
         TERM=linux
         BOOT_IMAGE=/boot/bzImage-517rc6
         efivar_ssdt=newcpu_ssdt
    
    Similarly when "efivar_ssdt=somestring" is used, it is added to the
    Unknown parameter message and to init's environment strings, polluting
    them (see examples above).
    
    Change the return value of the __setup functions to 1 to indicate
    that the __setup options have been handled.
    
    Fixes: 58c5475aba67 ("x86/efi: Retrieve and assign Apple device properties")
    Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables")
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
    Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
    Cc: Ard Biesheuvel <ardb@kernel.org>
    Cc: linux-efi@vger.kernel.org
    Cc: Lukas Wunner <lukas@wunner.de>
    Cc: Octavian Purdila <octavian.purdila@intel.com>
    Cc: "Rafael J. Wysocki" <rafael@kernel.org>
    Cc: Matt Fleming <matt@codeblueprint.co.uk>
    Link: https://lore.kernel.org/r/20220301041851.12459-1-rdunlap@infradead.org
    Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit d6ea756586007009dad41487c5419ff25e9b514f
Author: Lucas Wei <lucaswei@google.com>
Date:   Fri Mar 18 15:14:01 2022 +0800

    fs: sysfs_emit: Remove PAGE_SIZE alignment check
    
    For kernel releases older than 4.20, using the SLUB alloctor will cause
    this alignment check to fail as that allocator did NOT align kmalloc
    allocations on a PAGE_SIZE boundry.
    
    Remove the check for these older kernels as it is a false-positive and
    causes problems on many devices.
    
    Signed-off-by: Lucas Wei <lucaswei@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b8fe47f81d6a85f6a18d35b3a9b072f554551f79
Author: Chengming Zhou <zhouchengming@bytedance.com>
Date:   Fri Mar 4 20:29:04 2022 -0800

    kselftest/vm: fix tests build with old libc
    
    [ Upstream commit b773827e361952b3f53ac6fa4c4e39ccd632102e ]
    
    The error message when I build vm tests on debian10 (GLIBC 2.28):
    
        userfaultfd.c: In function `userfaultfd_pagemap_test':
        userfaultfd.c:1393:37: error: `MADV_PAGEOUT' undeclared (first use
        in this function); did you mean `MADV_RANDOM'?
          if (madvise(area_dst, test_pgsize, MADV_PAGEOUT))
                                             ^~~~~~~~~~~~
                                             MADV_RANDOM
    
    This patch includes these newer definitions from UAPI linux/mman.h, is
    useful to fix tests build on systems without these definitions in glibc
    sys/mman.h.
    
    Link: https://lkml.kernel.org/r/20220227055330.43087-2-zhouchengming@bytedance.com
    Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
    Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 707a248f661f57b3e27851b2901d4f03674cbd44
Author: Niels Dossche <dossche.niels@gmail.com>
Date:   Tue Mar 1 23:28:22 2022 +0100

    sfc: extend the locking on mcdi->seqno
    
    [ Upstream commit f1fb205efb0ccca55626fd4ef38570dd16b44719 ]
    
    seqno could be read as a stale value outside of the lock. The lock is
    already acquired to protect the modification of seqno against a possible
    race condition. Place the reading of this value also inside this locking
    to protect it against a possible race condition.
    
    Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
    Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit b630da9e2542973dc0f96efe6760abfd1b8006ea
Author: Eric Dumazet <edumazet@google.com>
Date:   Wed Mar 2 08:17:23 2022 -0800

    tcp: make tcp_read_sock() more robust
    
    [ Upstream commit e3d5ea2c011ecb16fb94c56a659364e6b30fac94 ]
    
    If recv_actor() returns an incorrect value, tcp_read_sock()
    might loop forever.
    
    Instead, issue a one time warning and make sure to make progress.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Acked-by: John Fastabend <john.fastabend@gmail.com>
    Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
    Acked-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/r/20220302161723.3910001-2-eric.dumazet@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit a3d04dd8355dc607fc408775b56ffd3fb6348599
Author: Sreeramya Soratkal <quic_ssramya@quicinc.com>
Date:   Tue Mar 1 11:33:20 2022 +0530

    nl80211: Update bss channel on channel switch for P2P_CLIENT
    
    [ Upstream commit e50b88c4f076242358b66ddb67482b96947438f2 ]
    
    The wdev channel information is updated post channel switch only for
    the station mode and not for the other modes. Due to this, the P2P client
    still points to the old value though it moved to the new channel
    when the channel change is induced from the P2P GO.
    
    Update the bss channel after CSA channel switch completion for P2P client
    interface as well.
    
    Signed-off-by: Sreeramya Soratkal <quic_ssramya@quicinc.com>
    Link: https://lore.kernel.org/r/1646114600-31479-1-git-send-email-quic_ssramya@quicinc.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 7cf4345b973247d354ddd11540cd7571112766f8
Author: Jia-Ju Bai <baijiaju1990@gmail.com>
Date:   Fri Feb 25 04:52:30 2022 -0800

    atm: firestream: check the return value of ioremap() in fs_init()
    
    [ Upstream commit d4e26aaea7f82ba884dcb4acfe689406bc092dc3 ]
    
    The function ioremap() in fs_init() can fail, so its return value should
    be checked.
    
    Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
    Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 53207668e443a6876c091403c7b9fc93ac48faa6
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Date:   Mon Feb 21 22:59:35 2022 +0000

    can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready
    
    [ Upstream commit c5048a7b2c23ab589f3476a783bd586b663eda5b ]
    
    Register the CAN device only when all the necessary initialization is
    completed. This patch makes sure all the data structures and locks are
    initialized before registering the CAN device.
    
    Link: https://lore.kernel.org/all/20220221225935.12300-1-prabhakar.mahadev-lad.rj@bp.renesas.com
    Reported-by: Pavel Machek <pavel@denx.de>
    Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Reviewed-by: Pavel Machek <pavel@denx.de>
    Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 724eceda12860b7d8e0abbe02d839e4e10484178
Author: Julian Braha <julianbraha@gmail.com>
Date:   Mon Jan 17 05:09:40 2022 +0100

    ARM: 9178/1: fix unmet dependency on BITREVERSE for HAVE_ARCH_BITREVERSE
    
    [ Upstream commit 11c57c3ba94da74c3446924260e34e0b1950b5d7 ]
    
    Resending this to properly add it to the patch tracker - thanks for letting
    me know, Arnd :)
    
    When ARM is enabled, and BITREVERSE is disabled,
    Kbuild gives the following warning:
    
    WARNING: unmet direct dependencies detected for HAVE_ARCH_BITREVERSE
      Depends on [n]: BITREVERSE [=n]
      Selected by [y]:
      - ARM [=y] && (CPU_32v7M [=n] || CPU_32v7 [=y]) && !CPU_32v6 [=n]
    
    This is because ARM selects HAVE_ARCH_BITREVERSE
    without selecting BITREVERSE, despite
    HAVE_ARCH_BITREVERSE depending on BITREVERSE.
    
    This unmet dependency bug was found by Kismet,
    a static analysis tool for Kconfig. Please advise if this
    is not the appropriate solution.
    
    Signed-off-by: Julian Braha <julianbraha@gmail.com>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 32813321f18d5432cec1b1a6ecc964f9ea26d565
Author: Alexander Lobakin <alobakin@pm.me>
Date:   Sat Feb 12 22:21:11 2022 +0000

    MIPS: smp: fill in sibling and core maps earlier
    
    [ Upstream commit f2703def339c793674010cc9f01bfe4980231808 ]
    
    After enabling CONFIG_SCHED_CORE (landed during 5.14 cycle),
    2-core 2-thread-per-core interAptiv (CPS-driven) started emitting
    the following:
    
    [    0.025698] CPU1 revision is: 0001a120 (MIPS interAptiv (multi))
    [    0.048183] ------------[ cut here ]------------
    [    0.048187] WARNING: CPU: 1 PID: 0 at kernel/sched/core.c:6025 sched_core_cpu_starting+0x198/0x240
    [    0.048220] Modules linked in:
    [    0.048233] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.17.0-rc3+ #35 b7b319f24073fd9a3c2aa7ad15fb7993eec0b26f
    [    0.048247] Stack : 817f0000 00000004 327804c8 810eb050 00000000 00000004 00000000 c314fdd1
    [    0.048278]         830cbd64 819c0000 81800000 817f0000 83070bf4 00000001 830cbd08 00000000
    [    0.048307]         00000000 00000000 815fcbc4 00000000 00000000 00000000 00000000 00000000
    [    0.048334]         00000000 00000000 00000000 00000000 817f0000 00000000 00000000 817f6f34
    [    0.048361]         817f0000 818a3c00 817f0000 00000004 00000000 00000000 4dc33260 0018c933
    [    0.048389]         ...
    [    0.048396] Call Trace:
    [    0.048399] [<8105a7bc>] show_stack+0x3c/0x140
    [    0.048424] [<8131c2a0>] dump_stack_lvl+0x60/0x80
    [    0.048440] [<8108b5c0>] __warn+0xc0/0xf4
    [    0.048454] [<8108b658>] warn_slowpath_fmt+0x64/0x10c
    [    0.048467] [<810bd418>] sched_core_cpu_starting+0x198/0x240
    [    0.048483] [<810c6514>] sched_cpu_starting+0x14/0x80
    [    0.048497] [<8108c0f8>] cpuhp_invoke_callback_range+0x78/0x140
    [    0.048510] [<8108d914>] notify_cpu_starting+0x94/0x140
    [    0.048523] [<8106593c>] start_secondary+0xbc/0x280
    [    0.048539]
    [    0.048543] ---[ end trace 0000000000000000 ]---
    [    0.048636] Synchronize counters for CPU 1: done.
    
    ...for each but CPU 0/boot.
    Basic debug printks right before the mentioned line say:
    
    [    0.048170] CPU: 1, smt_mask:
    
    So smt_mask, which is sibling mask obviously, is empty when entering
    the function.
    This is critical, as sched_core_cpu_starting() calculates
    core-scheduling parameters only once per CPU start, and it's crucial
    to have all the parameters filled in at that moment (at least it
    uses cpu_smt_mask() which in fact is `&cpu_sibling_map[cpu]` on
    MIPS).
    
    A bit of debugging led me to that set_cpu_sibling_map() performing
    the actual map calculation, was being invocated after
    notify_cpu_start(), and exactly the latter function starts CPU HP
    callback round (sched_core_cpu_starting() is basically a CPU HP
    callback).
    While the flow is same on ARM64 (maps after the notifier, although
    before calling set_cpu_online()), x86 started calculating sibling
    maps earlier than starting the CPU HP callbacks in Linux 4.14 (see
    [0] for the reference). Neither me nor my brief tests couldn't find
    any potential caveats in calculating the maps right after performing
    delay calibration, but the WARN splat is now gone.
    The very same debug prints now yield exactly what I expected from
    them:
    
    [    0.048433] CPU: 1, smt_mask: 0-1
    
    [0] https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=76ce7cfe35ef
    
    Signed-off-by: Alexander Lobakin <alobakin@pm.me>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit dd26db6c82affa89bea453c693da67020232fa19
Author: Corentin Labbe <clabbe@baylibre.com>
Date:   Wed Feb 9 12:03:55 2022 +0000

    ARM: dts: rockchip: fix a typo on rk3288 crypto-controller
    
    [ Upstream commit 3916c3619599a3970d3e6f98fb430b7c46266ada ]
    
    crypto-controller had a typo, fix it.
    In the same time, rename it to just crypto
    
    Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
    Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
    Link: https://lore.kernel.org/r/20220209120355.1985707-1-clabbe@baylibre.com
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 26fe3777e20d04460216a31bc5762cbb7395f0bd
Author: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
Date:   Wed Jan 19 14:49:48 2022 +0100

    arm64: dts: rockchip: fix rk3399-puma eMMC HS400 signal integrity
    
    [ Upstream commit 62966cbdda8a92f82d966a45aa671e788b2006f7 ]
    
    There are signal integrity issues running the eMMC at 200MHz on Puma
    RK3399-Q7.
    
    Similar to the work-around found for RK3399 Gru boards, lowering the
    frequency to 100MHz made the eMMC much more stable, so let's lower the
    frequency to 100MHz.
    
    It might be possible to run at 150MHz as on RK3399 Gru boards but only
    100MHz was extensively tested.
    
    Cc: Quentin Schulz <foss+kernel@0leil.net>
    Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
    Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
    Link: https://lore.kernel.org/r/20220119134948.1444965-1-quentin.schulz@theobroma-systems.com
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit d429be3baf55aeb6400fdcaf874cd28159a4c60b
Author: Yan Yan <evitayan@google.com>
Date:   Tue Jan 18 16:00:14 2022 -0800

    xfrm: Fix xfrm migrate issues when address family changes
    
    [ Upstream commit e03c3bba351f99ad932e8f06baa9da1afc418e02 ]
    
    xfrm_migrate cannot handle address family change of an xfrm_state.
    The symptons are the xfrm_state will be migrated to a wrong address,
    and sending as well as receiving packets wil be broken.
    
    This commit fixes it by breaking the original xfrm_state_clone
    method into two steps so as to update the props.family before
    running xfrm_init_state. As the result, xfrm_state's inner mode,
    outer mode, type and IP header length in xfrm_state_migrate can
    be updated with the new address family.
    
    Tested with additions to Android's kernel unit test suite:
    https://android-review.googlesource.com/c/kernel/tests/+/1885354
    
    Signed-off-by: Yan Yan <evitayan@google.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 8a7952ec41de8f855f0cddb552cf3f5340a80482
Author: Xin Long <lucien.xin@gmail.com>
Date:   Wed Oct 20 07:42:43 2021 -0400

    sctp: fix the processing for INIT_ACK chunk
    
    commit 438b95a7c98f77d51cbf4db021f41b602d750a3f upstream.
    
    Currently INIT_ACK chunk in non-cookie_echoed state is processed in
    sctp_sf_discard_chunk() to send an abort with the existent asoc's
    vtag if the chunk length is not valid. But the vtag in the chunk's
    sctphdr is not verified, which may be exploited by one to cook a
    malicious chunk to terminal a SCTP asoc.
    
    sctp_sf_discard_chunk() also is called in many other places to send
    an abort, and most of those have this problem. This patch is to fix
    it by sending abort with the existent asoc's vtag only if the vtag
    from the chunk's sctphdr is verified in sctp_sf_discard_chunk().
    
    Note on sctp_sf_do_9_1_abort() and sctp_sf_shutdown_pending_abort(),
    the chunk length has been verified before sctp_sf_discard_chunk(),
    so replace it with sctp_sf_discard(). On sctp_sf_do_asconf_ack() and
    sctp_sf_do_asconf(), move the sctp_chunk_length_valid check ahead of
    sctp_sf_discard_chunk(), then replace it with sctp_sf_discard().
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 878cc8e47413d6c35995187992039b1a664ea4f6
Author: Xin Long <lucien.xin@gmail.com>
Date:   Wed Oct 20 07:42:42 2021 -0400

    sctp: fix the processing for INIT chunk
    
    commit eae5783908042a762c24e1bd11876edb91d314b1 upstream.
    
    This patch fixes the problems below:
    
    1. In non-shutdown_ack_sent states: in sctp_sf_do_5_1B_init() and
       sctp_sf_do_5_2_2_dupinit():
    
      chunk length check should be done before any checks that may cause
      to send abort, as making packet for abort will access the init_tag
      from init_hdr in sctp_ootb_pkt_new().
    
    2. In shutdown_ack_sent state: in sctp_sf_do_9_2_reshutack():
    
      The same checks as does in sctp_sf_do_5_2_2_dupinit() is needed
      for sctp_sf_do_9_2_reshutack().
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>