Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lineage-18.1] Update #19

Merged
merged 111 commits into from
Feb 11, 2021

Commits on Jan 17, 2021

  1. target: add XCOPY target/segment desc sense codes

    [ Upstream commit e864212 ]
    
    As defined in http://www.t10.org/lists/asc-num.htm. To be used during
    validation of XCOPY target and segment descriptor lists.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ddiss authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    7a92e45 View commit details
    Browse the repository at this point in the history
  2. target: bounds check XCOPY segment descriptor list

    [ Upstream commit af9f62c ]
    
    Check the length of the XCOPY request segment descriptor list against
    the value advertised via the MAXIMUM SEGMENT DESCRIPTOR COUNT field in
    the RECEIVE COPY OPERATING PARAMETERS response.
    
    spc4r37 6.4.3.5 states:
      If the number of segment descriptors exceeds the allowed number, the
      copy manager shall terminate the command with CHECK CONDITION status,
      with the sense key set to ILLEGAL REQUEST, and the additional sense
      code set to TOO MANY SEGMENT DESCRIPTORS.
    
    This functionality is testable using the libiscsi
    ExtendedCopy.DescrLimits test.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ddiss authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    c85fecc View commit details
    Browse the repository at this point in the history
  3. target: simplify XCOPY wwn->se_dev lookup helper

    [ Upstream commit 94aae4c ]
    
    target_xcopy_locate_se_dev_e4() is used to locate an se_dev, based on
    the WWN provided with the XCOPY request. Remove a couple of unneeded
    arguments, and rely on the caller for the src/dst test.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ddiss authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    8e3c992 View commit details
    Browse the repository at this point in the history
  4. target: use XCOPY segment descriptor CSCD IDs

    [ Upstream commit 66640d3 ]
    
    The XCOPY specification in SPC4r37 states that the XCOPY source and
    destination device(s) should be derived from the copy source and copy
    destination (CSCD) descriptor IDs in the XCOPY segment descriptor.
    
    The CSCD IDs are generally (for block -> block copies), indexes into
    the corresponding CSCD descriptor list, e.g.
    =================================
    EXTENDED COPY Header
    =================================
    CSCD Descriptor List
    - entry 0
      + LU ID <--------------<------------------\
    - entry 1                                   |
      + LU ID <______________<_____________     |
    =================================      |    |
    Segment Descriptor List                |    |
    - segment 0                            |    |
      + src CSCD ID = 0 --------->---------+----/
      + dest CSCD ID = 1 ___________>______|
      + len
      + src lba
      + dest lba
    =================================
    
    Currently LIO completely ignores the src and dest CSCD IDs in the
    Segment Descriptor List, and instead assumes that the first entry in the
    CSCD list corresponds to the source, and the second to the destination.
    
    This commit removes this assumption, by ensuring that the Segment
    Descriptor List is parsed prior to processing the CSCD Descriptor List.
    CSCD Descriptor List processing is modified to compare the current list
    index with the previously obtained src and dest CSCD IDs.
    
    Additionally, XCOPY requests where the src and dest CSCD IDs refer to
    the CSCD Descriptor List entry can now be successfully processed.
    
    Fixes: cbf031f ("target: Add support for EXTENDED_COPY copy offload")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=191381
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ddiss authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    af1fb5d View commit details
    Browse the repository at this point in the history
  5. xcopy: loop over devices using idr helper

    [ Upstream commit 6906d00 ]
    
    This converts the xcopy code to use the idr helper. The next patch
    will drop the g_device_list and make g_device_mutex local to the
    target_core_device.c file.
    
    Signed-off-by: Mike Christie <mchristi@redhat.com>
    Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Mike Christie authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    b0b9550 View commit details
    Browse the repository at this point in the history
  6. scsi: target: Fix XCOPY NAA identifier lookup

    [ Upstream commit 2896c93 ]
    
    When attempting to match EXTENDED COPY CSCD descriptors with corresponding
    se_devices, target_xcopy_locate_se_dev_e4() currently iterates over LIO's
    global devices list which includes all configured backstores.
    
    This change ensures that only initiator-accessible backstores are
    considered during CSCD descriptor lookup, according to the session's
    se_node_acl LUN list.
    
    To avoid LUN removal race conditions, device pinning is changed from being
    configfs based to instead using the se_node_acl lun_ref.
    
    Reference: CVE-2020-28374
    Fixes: cbf031f ("target: Add support for EXTENDED_COPY copy offload emulation")
    Reviewed-by: Lee Duncan <lduncan@suse.com>
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    Signed-off-by: Mike Christie <michael.christie@oracle.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ddiss authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    87be501 View commit details
    Browse the repository at this point in the history
  7. powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at

    [ Upstream commit d85be8a ]
    
    The placeholder for instruction selection should use the second
    argument's operand, which is %1, not %0. This could generate incorrect
    assembly code if the memory addressing of operand %0 is a different
    form from that of operand %1.
    
    Also remove the %Un placeholder because having %Un placeholders
    for two operands which are based on the same local var (ptep) doesn't
    make much sense. By the way, it doesn't change the current behaviour
    because "<>" constraint is missing for the associated "=m".
    
    [chleroy: revised commit log iaw segher's comments and removed %U0]
    
    Fixes: 9bf2b5c ("powerpc: Fixes for CONFIG_PTE_64BIT for SMP support")
    Cc: <stable@vger.kernel.org> # v2.6.28+
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/96354bd77977a6a933fe9020da57629007fdb920.1603358942.git.christophe.leroy@csgroup.eu
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    compudj authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    d4b6249 View commit details
    Browse the repository at this point in the history
  8. net: ip: always refragment ip defragmented packets

    [ Upstream commit bb4cc1a ]
    
    Conntrack reassembly records the largest fragment size seen in IPCB.
    However, when this gets forwarded/transmitted, fragmentation will only
    be forced if one of the fragmented packets had the DF bit set.
    
    In that case, a flag in IPCB will force fragmentation even if the
    MTU is large enough.
    
    This should work fine, but this breaks with ip tunnels.
    Consider client that sends a UDP datagram of size X to another host.
    
    The client fragments the datagram, so two packets, of size y and z, are
    sent. DF bit is not set on any of these packets.
    
    Middlebox netfilter reassembles those packets back to single size-X
    packet, before routing decision.
    
    packet-size-vs-mtu checks in ip_forward are irrelevant, because DF bit
    isn't set.  At output time, ip refragmentation is skipped as well
    because x is still smaller than the mtu of the output device.
    
    If ttransmit device is an ip tunnel, the packet size increases to
    x+overhead.
    
    Also, tunnel might be configured to force DF bit on outer header.
    
    In this case, packet will be dropped (exceeds MTU) and an ICMP error is
    generated back to sender.
    
    But sender already respects the announced MTU, all the packets that
    it sent did fit the announced mtu.
    
    Force refragmentation as per original sizes unconditionally so ip tunnel
    will encapsulate the fragments instead.
    
    The only other solution I see is to place ip refragmentation in
    the ip_tunnel code to handle this case.
    
    Fixes: d6b915e ("ip_fragment: don't forward defragmented DF packet")
    Reported-by: Christian Perle <christian.perle@secunet.com>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Florian Westphal authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    17d1350 View commit details
    Browse the repository at this point in the history
  9. net: fix pmtu check in nopmtudisc mode

    [ Upstream commit 50c6616 ]
    
    For some reason ip_tunnel insist on setting the DF bit anyway when the
    inner header has the DF bit set, EVEN if the tunnel was configured with
    'nopmtudisc'.
    
    This means that the script added in the previous commit
    cannot be made to work by adding the 'nopmtudisc' flag to the
    ip tunnel configuration. Doing so breaks connectivity even for the
    without-conntrack/netfilter scenario.
    
    When nopmtudisc is set, the tunnel will skip the mtu check, so no
    icmp error is sent to client. Then, because inner header has DF set,
    the outer header gets added with DF bit set as well.
    
    IP stack then sends an error to itself because the packet exceeds
    the device MTU.
    
    Fixes: 23a3647 ("ip_tunnels: Use skb-len to PMTU check.")
    Cc: Stefano Brivio <sbrivio@redhat.com>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Florian Westphal authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    df9c0f1 View commit details
    Browse the repository at this point in the history
  10. vmlinux.lds.h: Add PGO and AutoFDO input sections

    commit eff8728 upstream.
    
    Basically, consider .text.{hot|unlikely|unknown}.* part of .text, too.
    
    When compiling with profiling information (collected via PGO
    instrumentations or AutoFDO sampling), Clang will separate code into
    .text.hot, .text.unlikely, or .text.unknown sections based on profiling
    information. After D79600 (clang-11), these sections will have a
    trailing `.` suffix, ie.  .text.hot., .text.unlikely., .text.unknown..
    
    When using -ffunction-sections together with profiling infomation,
    either explicitly (FGKASLR) or implicitly (LTO), code may be placed in
    sections following the convention:
    .text.hot.<foo>, .text.unlikely.<bar>, .text.unknown.<baz>
    where <foo>, <bar>, and <baz> are functions.  (This produces one section
    per function; we generally try to merge these all back via linker script
    so that we don't have 50k sections).
    
    For the above cases, we need to teach our linker scripts that such
    sections might exist and that we'd explicitly like them grouped
    together, otherwise we can wind up with code outside of the
    _stext/_etext boundaries that might not be mapped properly for some
    architectures, resulting in boot failures.
    
    If the linker script is not told about possible input sections, then
    where the section is placed as output is a heuristic-laiden mess that's
    non-portable between linkers (ie. BFD and LLD), and has resulted in many
    hard to debug bugs.  Kees Cook is working on cleaning this up by adding
    --orphan-handling=warn linker flag used in ARCH=powerpc to additional
    architectures. In the case of linker scripts, borrowing from the Zen of
    Python: explicit is better than implicit.
    
    Also, ld.bfd's internal linker script considers .text.hot AND
    .text.hot.* to be part of .text, as well as .text.unlikely and
    .text.unlikely.*. I didn't see support for .text.unknown.*, and didn't
    see Clang producing such code in our kernel builds, but I see code in
    LLVM that can produce such section names if profiling information is
    missing. That may point to a larger issue with generating or collecting
    profiles, but I would much rather be safe and explicit than have to
    debug yet another issue related to orphan section placement.
    
    Reported-by: Jian Cai <jiancai@google.com>
    Suggested-by: Fāng-ruì Sòng <maskray@google.com>
    Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Tested-by: Luis Lozano <llozano@google.com>
    Tested-by: Manoj Gupta <manojgupta@google.com>
    Acked-by: Kees Cook <keescook@chromium.org>
    Cc: linux-arch@vger.kernel.org
    Cc: stable@vger.kernel.org
    Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=add44f8d5c5c05e08b11e033127a744d61c26aee
    Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1de778ed23ce7492c523d5850c6c6dbb34152655
    Link: https://reviews.llvm.org/D79600
    Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1084760
    Link: https://lore.kernel.org/r/20200821194310.3089815-7-keescook@chromium.org
    
    Debugged-by: Luis Lozano <llozano@google.com>
    [nc: Fix conflicts around lack of TEXT_MAIN, NOINSTR_TEXT, and
         .text..refcount]
    Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nickdesaulniers authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    b60abd1 View commit details
    Browse the repository at this point in the history
  11. ubifs: wbuf: Don't leak kernel memory to flash

    commit 20f1431 upstream
    
    Write buffers use a kmalloc()'ed buffer, they can leak
    up to seven bytes of kernel memory to flash if writes are not
    aligned.
    So use ubifs_pad() to fill these gaps with padding bytes.
    This was never a problem while scanning because the scanner logic
    manually aligns node lengths and skips over these gaps.
    
    Cc: <stable@vger.kernel.org>
    Fixes: 1e51764 ("UBIFS: add new flash file system")
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    [sudip: adjust context]
    Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    richardweinberger authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    b026023 View commit details
    Browse the repository at this point in the history
  12. spi: pxa2xx: Fix use-after-free on unbind

    commit 5626308 upstream
    
    pxa2xx_spi_remove() accesses the driver's private data after calling
    spi_unregister_controller() even though that function releases the last
    reference on the spi_controller and thereby frees the private data.
    
    Fix by switching over to the new devm_spi_alloc_master/slave() helper
    which keeps the private data accessible until the driver has unbound.
    
    Fixes: 32e5b57 ("spi: pxa2xx: Fix controller unregister order")
    Signed-off-by: Lukas Wunner <lukas@wunner.de>
    Cc: <stable@vger.kernel.org> # v2.6.17+: 5e844cc: spi: Introduce device-managed SPI controller allocation
    Cc: <stable@vger.kernel.org> # v2.6.17+: 32e5b57: spi: pxa2xx: Fix controller unregister order
    Cc: <stable@vger.kernel.org> # v2.6.17+
    Link: https://lore.kernel.org/r/5764b04d4a6e43069ebb7808f64c2f774ac6f193.1607286887.git.lukas@wunner.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    [sudip: adjust context]
    Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    l1k authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    5d474e3 View commit details
    Browse the repository at this point in the history
  13. cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get()

    commit 943bdd0 upstream.
    
    Currently there is an unlikely case where cpufreq_cpu_get() returns a
    NULL policy and this will cause a NULL pointer dereference later on.
    
    Fix this by passing the policy to transition_frequency_fidvid() from
    the caller and hence eliminating the need for the cpufreq_cpu_get()
    and cpufreq_cpu_put().
    
    Thanks to Viresh Kumar for suggesting the fix.
    
    Addresses-Coverity: ("Dereference null return")
    Fixes: b43a7ff ("cpufreq: Notify all policy->cpus in cpufreq_notify_transition()")
    Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Colin Ian King authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    20acb9d View commit details
    Browse the repository at this point in the history
  14. wil6210: select CONFIG_CRC32

    commit e186620 upstream.
    
    Without crc32, the driver fails to link:
    
    arm-linux-gnueabi-ld: drivers/net/wireless/ath/wil6210/fw.o: in function `wil_fw_verify':
    fw.c:(.text+0x74c): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/wireless/ath/wil6210/fw.o:fw.c:(.text+0x758): more undefined references to `crc32_le' follow
    
    Fixes: 151a970 ("wil6210: firmware download")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    arndb authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    885a02f View commit details
    Browse the repository at this point in the history
  15. block: rsxx: select CONFIG_CRC32

    commit 36a106a upstream.
    
    Without crc32, the driver fails to link:
    
    arm-linux-gnueabi-ld: drivers/block/rsxx/config.o: in function `rsxx_load_config':
    config.c:(.text+0x124): undefined reference to `crc32_le'
    
    Fixes: 8722ff8 ("block: IBM RamSan 70/80 device driver")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    arndb authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    1a64b91 View commit details
    Browse the repository at this point in the history
  16. iommu/intel: Fix memleak in intel_irq_remapping_alloc

    commit ff2b46d upstream.
    
    When irq_domain_get_irq_data() or irqd_cfg() fails
    at i == 0, data allocated by kzalloc() has not been
    freed before returning, which leads to memleak.
    
    Fixes: b106ee6 ("irq_remapping/vt-d: Enhance Intel IR driver to support hierarchical irqdomains")
    Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
    Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
    Link: https://lore.kernel.org/r/20210105051837.32118-1-dinghao.liu@zju.edu.cn
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    dinghaoliu authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    d545305 View commit details
    Browse the repository at this point in the history
  17. block: fix use-after-free in disk_part_iter_next

    commit aebf5db upstream.
    
    Make sure that bdgrab() is done on the 'block_device' instance before
    referring to it for avoiding use-after-free.
    
    Cc: <stable@vger.kernel.org>
    Reported-by: syzbot+825f0f9657d4e528046e@syzkaller.appspotmail.com
    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Ming Lei authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    a096520 View commit details
    Browse the repository at this point in the history
  18. net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of tr…

    …immed packet
    
    commit 54970a2 upstream.
    
    syzbot reproduces BUG_ON in skb_checksum_help():
    tun creates (bogus) skb with huge partial-checksummed area and
    small ip packet inside. Then ip_rcv trims the skb based on size
    of internal ip packet, after that csum offset points beyond of
    trimmed skb. Then checksum_tg() called via netfilter hook
    triggers BUG_ON:
    
            offset = skb_checksum_start_offset(skb);
            BUG_ON(offset >= skb_headlen(skb));
    
    To work around the problem this patch forces pskb_trim_rcsum_slow()
    to return -EINVAL in described scenario. It allows its callers to
    drop such kind of packets.
    
    Link: https://syzkaller.appspot.com/bug?id=b419a5ca95062664fe1a60b764621eb4526e2cd0
    Reported-by: syzbot+7010af67ced6105e5ab6@syzkaller.appspotmail.com
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
    Acked-by: Willem de Bruijn <willemb@google.com>
    Link: https://lore.kernel.org/r/1b2494af-2c56-8ee2-7bc0-923fcad1cdf8@virtuozzo.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    vaverin authored and gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    2555bb2 View commit details
    Browse the repository at this point in the history
  19. Linux 4.4.252

    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Shuah Khan <skhan@linuxfoundation.org>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
    Tested-by: Pavel Machek (CIP) <pavel@denx.de>
    Link: https://lore.kernel.org/r/20210115121955.112329537@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    gregkh committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    4328b0f View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2021

  1. ASoC: dapm: remove widget from dirty list on free

    commit 5c6679b upstream.
    
    A widget's "dirty" list_head, much like its "list" list_head, eventually
    chains back to a list_head on the snd_soc_card itself. This means that
    the list can stick around even after the widget (or all widgets) have
    been freed. Currently, however, widgets that are in the dirty list when
    freed remain there, corrupting the entire list and leading to memory
    errors and undefined behavior when the list is next accessed or
    modified.
    
    I encountered this issue when a component failed to probe relatively
    late in snd_soc_bind_card(), causing it to bail out and call
    soc_cleanup_card_resources(), which eventually called
    snd_soc_dapm_free() with widgets that were still dirty from when they'd
    been added.
    
    Fixes: db432b4 ("ASoC: Do DAPM power checks only for widgets changed since last run")
    Cc: stable@vger.kernel.org
    Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
    Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
    Link: https://lore.kernel.org/r/f8b5f031d50122bf1a9bfc9cae046badf4a7a31a.1607822410.git.tommyhebb@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tchebb authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    9969eb1 View commit details
    Browse the repository at this point in the history
  2. mm/hugetlb: fix potential missing huge page size info

    commit 0eb98f1 upstream.
    
    The huge page size is encoded for VM_FAULT_HWPOISON errors only.  So if
    we return VM_FAULT_HWPOISON, huge page size would just be ignored.
    
    Link: https://lkml.kernel.org/r/20210107123449.38481-1-linmiaohe@huawei.com
    Fixes: aa50d3a ("Encode huge page size for VM_FAULT_HWPOISON errors")
    Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
    Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    MiaoheLin authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    bf3ca46 View commit details
    Browse the repository at this point in the history
  3. ext4: fix bug for rename with RENAME_WHITEOUT

    [ Upstream commit 6b4b8e6 ]
    
    We got a "deleted inode referenced" warning cross our fsstress test. The
    bug can be reproduced easily with following steps:
    
      cd /dev/shm
      mkdir test/
      fallocate -l 128M img
      mkfs.ext4 -b 1024 img
      mount img test/
      dd if=/dev/zero of=test/foo bs=1M count=128
      mkdir test/dir/ && cd test/dir/
      for ((i=0;i<1000;i++)); do touch file$i; done # consume all block
      cd ~ && renameat2(AT_FDCWD, /dev/shm/test/dir/file1, AT_FDCWD,
        /dev/shm/test/dir/dst_file, RENAME_WHITEOUT) # ext4_add_entry in
        ext4_rename will return ENOSPC!!
      cd /dev/shm/ && umount test/ && mount img test/ && ls -li test/dir/file1
      We will get the output:
      "ls: cannot access 'test/dir/file1': Structure needs cleaning"
      and the dmesg show:
      "EXT4-fs error (device loop0): ext4_lookup:1626: inode #2049: comm ls:
      deleted inode referenced: 139"
    
    ext4_rename will create a special inode for whiteout and use this 'ino'
    to replace the source file's dir entry 'ino'. Once error happens
    latter(the error above was the ENOSPC return from ext4_add_entry in
    ext4_rename since all space has been consumed), the cleanup do drop the
    nlink for whiteout, but forget to restore 'ino' with source file. This
    will trigger the bug describle as above.
    
    Signed-off-by: yangerkun <yangerkun@huawei.com>
    Reviewed-by: Jan Kara <jack@suse.cz>
    Cc: stable@vger.kernel.org
    Fixes: cd808de ("ext4: support RENAME_WHITEOUT")
    Link: https://lore.kernel.org/r/20210105062857.3566-1-yangerkun@huawei.com
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    yangerkun authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    5fa4f6f View commit details
    Browse the repository at this point in the history
  4. ARC: build: add boot_targets to PHONY

    [ Upstream commit 0cfccb3 ]
    
    The top-level boot_targets (uImage and uImage.*) should be phony
    targets. They just let Kbuild descend into arch/arc/boot/ and create
    files there.
    
    If a file exists in the top directory with the same name, the boot
    image will not be created.
    
    You can confirm it by the following steps:
    
      $ export CROSS_COMPILE=<your-arc-compiler-prefix>
      $ make -s ARCH=arc defconfig all   # vmlinux will be built
      $ touch uImage.gz
      $ make ARCH=arc uImage.gz
      CALL    scripts/atomic/check-atomics.sh
      CALL    scripts/checksyscalls.sh
      CHK     include/generated/compile.h
      # arch/arc/boot/uImage.gz is not created
    
    Specify the targets as PHONY to fix this.
    
    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    masahir0y authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    7028bae View commit details
    Browse the repository at this point in the history
  5. ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram

    [ Upstream commit 887078d ]
    
    Table 8-53 in the QUICC Engine Reference manual shows definitions of
    fields up to a size of 192 bytes, not just 128. But in table 8-111,
    one does find the text
    
      Base Address of the Global Transmitter Parameter RAM Page. [...]
      The user needs to allocate 128 bytes for this page. The address must
      be aligned to the page size.
    
    I've checked both rev. 7 (11/2015) and rev. 9 (05/2018) of the manual;
    they both have this inconsistency (and the table numbers are the
    same).
    
    Adding a bit of debug printing, on my board the struct
    ucc_geth_tx_global_pram is allocated at offset 0x880, while
    the (opaque) ucc_geth_thread_data_tx gets allocated immediately
    afterwards, at 0x900. So whatever the engine writes into the thread
    data overlaps with the tail of the global tx pram (and devmem says
    that something does get written during a simple ping).
    
    I haven't observed any failure that could be attributed to this, but
    it seems to be the kind of thing that would be extremely hard to
    debug. So extend the struct definition so that we do allocate 192
    bytes.
    
    Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Rasmus Villemoes authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    04d0e84 View commit details
    Browse the repository at this point in the history
  6. arch/arc: add copy_user_page() to <asm/page.h> to fix build error on ARC

    [ Upstream commit 8a48c0a ]
    
    fs/dax.c uses copy_user_page() but ARC does not provide that interface,
    resulting in a build error.
    
    Provide copy_user_page() in <asm/page.h>.
    
    ../fs/dax.c: In function 'copy_cow_page_dax':
    ../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]
    
    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Cc: Vineet Gupta <vgupta@synopsys.com>
    Cc: linux-snps-arc@lists.infradead.org
    Cc: Dan Williams <dan.j.williams@intel.com>
    #Acked-by: Vineet Gupta <vgupta@synopsys.com> # v1
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Jan Kara <jack@suse.cz>
    Cc: linux-fsdevel@vger.kernel.org
    Cc: linux-nvdimm@lists.01.org
    #Reviewed-by: Ira Weiny <ira.weiny@intel.com> # v2
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    rddunlap authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    6da7cf4 View commit details
    Browse the repository at this point in the history
  7. misdn: dsp: select CONFIG_BITREVERSE

    [ Upstream commit 51049bd ]
    
    Without this, we run into a link error
    
    arm-linux-gnueabi-ld: drivers/isdn/mISDN/dsp_audio.o: in function `dsp_audio_generate_law_tables':
    (.text+0x30c): undefined reference to `byte_rev_table'
    arm-linux-gnueabi-ld: drivers/isdn/mISDN/dsp_audio.o:(.text+0x5e4): more undefined references to `byte_rev_table' follow
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    arndb authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    c8ebb9a View commit details
    Browse the repository at this point in the history
  8. net: ethernet: fs_enet: Add missing MODULE_LICENSE

    [ Upstream commit 445c619 ]
    
    Since commit 1d6cd39 ("modpost: turn missing MODULE_LICENSE()
    into error") the ppc32_allmodconfig build fails with:
    
      ERROR: modpost: missing MODULE_LICENSE() in drivers/net/ethernet/freescale/fs_enet/mii-fec.o
      ERROR: modpost: missing MODULE_LICENSE() in drivers/net/ethernet/freescale/fs_enet/mii-bitbang.o
    
    Add the missing MODULE_LICENSEs to fix the build. Both files include a
    copyright header indicating they are GPL v2.
    
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    mpe authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    9106e1a View commit details
    Browse the repository at this point in the history
  9. ACPI: scan: add stub acpi_create_platform_device() for !CONFIG_ACPI

    [ Upstream commit ee61cfd ]
    
    It adds a stub acpi_create_platform_device() for !CONFIG_ACPI build, so
    that caller doesn't have to deal with !CONFIG_ACPI build issue.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    shawnguo2 authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    a620db0 View commit details
    Browse the repository at this point in the history
  10. ARM: picoxcell: fix missing interrupt-parent properties

    [ Upstream commit bac7171 ]
    
    dtc points out that the interrupts for some devices are not parsable:
    
    picoxcell-pc3x2.dtsi:45.19-49.5: Warning (interrupts_property): /paxi/gem@30000: Missing interrupt-parent
    picoxcell-pc3x2.dtsi:51.21-55.5: Warning (interrupts_property): /paxi/dmac@40000: Missing interrupt-parent
    picoxcell-pc3x2.dtsi:57.21-61.5: Warning (interrupts_property): /paxi/dmac@50000: Missing interrupt-parent
    picoxcell-pc3x2.dtsi:233.21-237.5: Warning (interrupts_property): /rwid-axi/axi2pico@c0000000: Missing interrupt-parent
    
    There are two VIC instances, so it's not clear which one needs to be
    used. I found the BSP sources that reference VIC0, so use that:
    
    https://github.com/r1mikey/meta-picoxcell/blob/master/recipes-kernel/linux/linux-picochip-3.0/0001-picoxcell-support-for-Picochip-picoXcell-SoC.patch
    
    Acked-by: Jamie Iles <jamie@jamieiles.com>
    Link: https://lore.kernel.org/r/20201230152010.3914962-1-arnd@kernel.org'
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    arndb authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    9a6c45e View commit details
    Browse the repository at this point in the history
  11. Input: uinput - avoid FF flush when destroying device

    commit e8b9572 upstream.
    
    Normally, when input device supporting force feedback effects is being
    destroyed, we try to "flush" currently playing effects, so that the
    physical device does not continue vibrating (or executing other effects).
    Unfortunately this does not work well for uinput as flushing of the effects
    deadlocks with the destroy action:
    
    - if device is being destroyed because the file descriptor is being closed,
      then there is noone to even service FF requests;
    
    - if device is being destroyed because userspace sent UI_DEV_DESTROY,
      while theoretically it could be possible to service FF requests,
      userspace is unlikely to do so (they'd need to make sure FF handling
      happens on a separate thread) even if kernel solves the issue with FF
      ioctls deadlocking with UI_DEV_DESTROY ioctl on udev->mutex.
    
    To avoid lockups like the one below, let's install a custom input device
    flush handler, and avoid trying to flush force feedback effects when we
    destroying the device, and instead rely on uinput to shut off the device
    properly.
    
    NMI watchdog: Watchdog detected hard LOCKUP on cpu 3
    ...
     <<EOE>>  [<ffffffff817a0307>] _raw_spin_lock_irqsave+0x37/0x40
     [<ffffffff810e633d>] complete+0x1d/0x50
     [<ffffffffa00ba08c>] uinput_request_done+0x3c/0x40 [uinput]
     [<ffffffffa00ba587>] uinput_request_submit.part.7+0x47/0xb0 [uinput]
     [<ffffffffa00bb62b>] uinput_dev_erase_effect+0x5b/0x76 [uinput]
     [<ffffffff815d91ad>] erase_effect+0xad/0xf0
     [<ffffffff815d929d>] flush_effects+0x4d/0x90
     [<ffffffff815d4cc0>] input_flush_device+0x40/0x60
     [<ffffffff815daf1c>] evdev_cleanup+0xac/0xc0
     [<ffffffff815daf5b>] evdev_disconnect+0x2b/0x60
     [<ffffffff815d74ac>] __input_unregister_device+0xac/0x150
     [<ffffffff815d75f7>] input_unregister_device+0x47/0x70
     [<ffffffffa00bac45>] uinput_destroy_device+0xb5/0xc0 [uinput]
     [<ffffffffa00bb2de>] uinput_ioctl_handler.isra.9+0x65e/0x740 [uinput]
     [<ffffffff811231ab>] ? do_futex+0x12b/0xad0
     [<ffffffffa00bb3f8>] uinput_ioctl+0x18/0x20 [uinput]
     [<ffffffff81241248>] do_vfs_ioctl+0x298/0x480
     [<ffffffff81337553>] ? security_file_ioctl+0x43/0x60
     [<ffffffff812414a9>] SyS_ioctl+0x79/0x90
     [<ffffffff817a04ee>] entry_SYSCALL_64_fastpath+0x12/0x71
    
    Reported-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
    Reported-by: Clément VUCHENER <clement.vuchener@gmail.com>
    Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=193741
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    dtor authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    0cd7ca7 View commit details
    Browse the repository at this point in the history
  12. dump_common_audit_data(): fix racy accesses to ->d_name

    commit d36a1dd upstream.
    
    We are not guaranteed the locking environment that would prevent
    dentry getting renamed right under us.  And it's possible for
    old long name to be freed after rename, leading to UAF here.
    
    Cc: stable@kernel.org # v2.6.2+
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Al Viro authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    b1de083 View commit details
    Browse the repository at this point in the history
  13. NFS: nfs_igrab_and_active must first reference the superblock

    commit 896567e upstream.
    
    Before referencing the inode, we must ensure that the superblock can be
    referenced. Otherwise, we can end up with iput() calling superblock
    operations that are no longer valid or accessible.
    
    Fixes: ea7c38f ("NFSv4: Ensure we reference the inode for return-on-close in delegreturn")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Trond Myklebust authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    bd756f3 View commit details
    Browse the repository at this point in the history
  14. ext4: fix superblock checksum failure when setting password salt

    commit dfd56c2 upstream.
    
    When setting password salt in the superblock, we forget to recompute the
    superblock checksum so it will not match until the next superblock
    modification which recomputes the checksum. Fix it.
    
    CC: Michael Halcrow <mhalcrow@google.com>
    Reported-by: Andreas Dilger <adilger@dilger.ca>
    Fixes: 9bd8212 ("ext4 crypto: add encryption policy and password salt support")
    Signed-off-by: Jan Kara <jack@suse.cz>
    Link: https://lore.kernel.org/r/20201216101844.22917-8-jack@suse.cz
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jankara authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    89a95fc View commit details
    Browse the repository at this point in the history
  15. RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp

    commit a306aba upstream.
    
    If usnic_ib_qp_grp_create() fails at the first call, dev_list
    will not be freed on error, which leads to memleak.
    
    Fixes: e3cf00d ("IB/usnic: Add Cisco VIC low-level hardware driver")
    Link: https://lore.kernel.org/r/20201226074248.2893-1-dinghao.liu@zju.edu.cn
    Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    dinghaoliu authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    c0f5aea View commit details
    Browse the repository at this point in the history
  16. mm, slub: consider rest of partial list if acquire_slab() fails

    commit 8ff60eb upstream.
    
    acquire_slab() fails if there is contention on the freelist of the page
    (probably because some other CPU is concurrently freeing an object from
    the page).  In that case, it might make sense to look for a different page
    (since there might be more remote frees to the page from other CPUs, and
    we don't want contention on struct page).
    
    However, the current code accidentally stops looking at the partial list
    completely in that case.  Especially on kernels without CONFIG_NUMA set,
    this means that get_partial() fails and new_slab_objects() falls back to
    new_slab(), allocating new pages.  This could lead to an unnecessary
    increase in memory fragmentation.
    
    Link: https://lkml.kernel.org/r/20201228130853.1871516-1-jannh@google.com
    Fixes: 7ced371 ("slub: Acquire_slab() avoid loop")
    Signed-off-by: Jann Horn <jannh@google.com>
    Acked-by: David Rientjes <rientjes@google.com>
    Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Pekka Enberg <penberg@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    thejh authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    dc85630 View commit details
    Browse the repository at this point in the history
  17. net: sunrpc: interpret the return value of kstrtou32 correctly

    commit 86b53fb upstream.
    
    A return value of 0 means success. This is documented in lib/kstrtox.c.
    
    This was found by trying to mount an NFS share from a link-local IPv6
    address with the interface specified by its index:
    
      mount("[fe80::1%1]:/srv/nfs", "/mnt", "nfs", 0, "nolock,addr=fe80::1%1")
    
    Before this commit this failed with EINVAL and also caused the following
    message in dmesg:
    
      [...] NFS: bad IP address specified: addr=fe80::1%1
    
    The syscall using the same address based on the interface name instead
    of its index succeeds.
    
    Credits for this patch go to my colleague Christian Speich, who traced
    the origin of this bug to this line of code.
    
    Signed-off-by: Johannes Nixdorf <j.nixdorf@avm.de>
    Fixes: 00cfaa9 ("replace strict_strto calls")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mixi-work authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    9fccc3c View commit details
    Browse the repository at this point in the history
  18. usb: ohci: Make distrust_firmware param default to false

    commit c4005a8 upstream.
    
    The 'distrust_firmware' module parameter dates from 2004 and the USB
    subsystem is a lot more mature and reliable now than it was then.
    Alter the default to false now.
    
    Suggested-by: Alan Stern <stern@rowland.harvard.edu>
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
    Link: https://lore.kernel.org/r/20200910212512.16670-2-hamish.martin@alliedtelesis.co.nz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Hamish Martin authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    a92ca14 View commit details
    Browse the repository at this point in the history
  19. iio: buffer: Fix demux update

    commit 19ef7b7 upstream
    
    When updating the buffer demux, we will skip a scan element from the
    device in the case `in_ind != out_ind` and we enter the while loop.
    in_ind should only be refreshed with `find_next_bit()` in the end of the
    loop.
    
    Note, to cause problems we need a situation where we are skippig over
    an element (channel not enabled) that happens to not have the same size
    as the next element.   Whilst this is a possible situation we haven't
    actually identified any cases in mainline where it happens as most drivers
    have consistent channel storage sizes with the exception of the timestamp
    which is the last element and hence never skipped over.
    
    Fixes: 5ada4ea ("staging:iio: add demux optionally to path from device to buffer")
    Signed-off-by: Nuno Sá <nuno.sa@analog.com>
    Link: https://lore.kernel.org/r/20201112144323.28887-1-nuno.sa@analog.com
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    [sudip: adjust context]
    Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nunojsa authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    42a9f03 View commit details
    Browse the repository at this point in the history
  20. nfsd4: readdirplus shouldn't return parent of export

    commit 51b2ee7 upstream.
    
    If you export a subdirectory of a filesystem, a READDIRPLUS on the root
    of that export will return the filehandle of the parent with the ".."
    entry.
    
    The filehandle is optional, so let's just not return the filehandle for
    ".." if we're at the root of an export.
    
    Note that once the client learns one filehandle outside of the export,
    they can trivially access the rest of the export using further lookups.
    
    However, it is also not very difficult to guess filehandles outside of
    the export.  So exporting a subdirectory of a filesystem should
    considered equivalent to providing access to the entire filesystem.  To
    avoid confusion, we recommend only exporting entire filesystems.
    
    Reported-by: Youjipeng <wangzhibei1999@gmail.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    J. Bruce Fields authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    c89b2b5 View commit details
    Browse the repository at this point in the history
  21. net: cdc_ncm: correct overhead in delayed_ndp_size

    commit 7a68d72 upstream.
    
    Aligning to tx_ndp_modulus is not sufficient because the next align
    call can be cdc_ncm_align_tail, which can add up to ctx->tx_modulus +
    ctx->tx_remainder - 1 bytes. This used to lead to occasional crashes
    on a Huawei 909s-120 LTE module as follows:
    
    - the condition marked /* if there is a remaining skb [...] */ is true
      so the swaps happen
    - skb_out is set from ctx->tx_curr_skb
    - skb_out->len is exactly 0x3f52
    - ctx->tx_curr_size is 0x4000 and delayed_ndp_size is 0xac
      (note that the sum of skb_out->len and delayed_ndp_size is 0x3ffe)
    - the for loop over n is executed once
    - the cdc_ncm_align_tail call marked /* align beginning of next frame */
      increases skb_out->len to 0x3f56 (the sum is now 0x4002)
    - the condition marked /* check if we had enough room left [...] */ is
      false so we break out of the loop
    - the condition marked /* If requested, put NDP at end of frame. */ is
      true so the NDP is written into skb_out
    - now skb_out->len is 0x4002, so padding_count is minus two interpreted
      as an unsigned number, which is used as the length argument to memset,
      leading to a crash with various symptoms but usually including
    
    > Call Trace:
    >  <IRQ>
    >  cdc_ncm_fill_tx_frame+0x83a/0x970 [cdc_ncm]
    >  cdc_mbim_tx_fixup+0x1d9/0x240 [cdc_mbim]
    >  usbnet_start_xmit+0x5d/0x720 [usbnet]
    
    The cdc_ncm_align_tail call first aligns on a ctx->tx_modulus
    boundary (adding at most ctx->tx_modulus-1 bytes), then adds
    ctx->tx_remainder bytes. Alternatively, the next alignment call can
    occur in cdc_ncm_ndp16 or cdc_ncm_ndp32, in which case at most
    ctx->tx_ndp_modulus-1 bytes are added.
    
    A similar problem has occurred before, and the code is nontrivial to
    reason about, so add a guard before the crashing call. By that time it
    is too late to prevent any memory corruption (we'll have written past
    the end of the buffer already) but we can at least try to get a warning
    written into an on-disk log by avoiding the hard crash caused by padding
    past the buffer with a huge number of zeros.
    
    Signed-off-by: Jouni K. Seppänen <jks@iki.fi>
    Fixes: 4a0e3e9 ("cdc_ncm: Add support for moving NDP to end of NCM frame")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=209407
    Reported-by: kernel test robot <lkp@intel.com>
    Reviewed-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    [jks@iki.fi: backport to 4.4.y, 4.9.y]
    Signed-off-by: Jouni K. Seppänen <jks@iki.fi>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jkseppan authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    9318ecb View commit details
    Browse the repository at this point in the history
  22. netxen_nic: fix MSI/MSI-x interrupts

    [ Upstream commit a2bc221 ]
    
    For all PCI functions on the netxen_nic adapter, interrupt
    mode (INTx or MSI) configuration is dependent on what has
    been configured by the PCI function zero in the shared
    interrupt register, as these adapters do not support mixed
    mode interrupts among the functions of a given adapter.
    
    Logic for setting MSI/MSI-x interrupt mode in the shared interrupt
    register based on PCI function id zero check is not appropriate for
    all family of netxen adapters, as for some of the netxen family
    adapters PCI function zero is not really meant to be probed/loaded
    in the host but rather just act as a management function on the device,
    which caused all the other PCI functions on the adapter to always use
    legacy interrupt (INTx) mode instead of choosing MSI/MSI-x interrupt mode.
    
    This patch replaces that check with port number so that for all
    type of adapters driver attempts for MSI/MSI-x interrupt modes.
    
    Fixes: b37eb21 ("netxen_nic: Avoid mixed mode interrupts")
    Signed-off-by: Manish Chopra <manishc@marvell.com>
    Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
    Link: https://lore.kernel.org/r/20210107101520.6735-1-manishc@marvell.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    manishc88 authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    e9cd805 View commit details
    Browse the repository at this point in the history
  23. rndis_host: set proper input size for OID_GEN_PHYSICAL_MEDIUM request

    [ Upstream commit e56b3d9 ]
    
    MSFT ActiveSync implementation requires that the size of the response for
    incoming query is to be provided in the request input length. Failure to
    set the input size proper results in failed request transfer, where the
    ActiveSync counterpart reports the NDIS_STATUS_INVALID_LENGTH (0xC0010014L)
    error.
    
    Set the input size for OID_GEN_PHYSICAL_MEDIUM query to the expected size
    of the response in order for the ActiveSync to properly respond to the
    request.
    
    Fixes: 039ee17 ("rndis_host: Add RNDIS physical medium checking into generic_rndis_bind()")
    Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
    Link: https://lore.kernel.org/r/20210108095839.3335-1-andrey.zhizhikin@leica-geosystems.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    zandrey authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    6d68295 View commit details
    Browse the repository at this point in the history
  24. net: dcb: Validate netlink message in DCB handler

    [ Upstream commit 826f328 ]
    
    DCB uses the same handler function for both RTM_GETDCB and RTM_SETDCB
    messages. dcb_doit() bounces RTM_SETDCB mesasges if the user does not have
    the CAP_NET_ADMIN capability.
    
    However, the operation to be performed is not decided from the DCB message
    type, but from the DCB command. Thus DCB_CMD_*_GET commands are used for
    reading DCB objects, the corresponding SET and DEL commands are used for
    manipulation.
    
    The assumption is that set-like commands will be sent via an RTM_SETDCB
    message, and get-like ones via RTM_GETDCB. However, this assumption is not
    enforced.
    
    It is therefore possible to manipulate DCB objects without CAP_NET_ADMIN
    capability by sending the corresponding command in an RTM_GETDCB message.
    That is a bug. Fix it by validating the type of the request message against
    the type used for the response.
    
    Fixes: 2f90b86 ("ixgbe: this patch adds support for DCB to the kernel and ixgbe driver")
    Signed-off-by: Petr Machata <me@pmachata.org>
    Link: https://lore.kernel.org/r/a2a9b88418f3a58ef211b718f2970128ef9e3793.1608673640.git.me@pmachata.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    pmachata authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    e8063f8 View commit details
    Browse the repository at this point in the history
  25. net: dcb: Accept RTM_GETDCB messages carrying set-like DCB commands

    [ Upstream commit df85bc1 ]
    
    In commit 826f328 ("net: dcb: Validate netlink message in DCB
    handler"), Linux started rejecting RTM_GETDCB netlink messages if they
    contained a set-like DCB_CMD_ command.
    
    The reason was that privileges were only verified for RTM_SETDCB messages,
    but the value that determined the action to be taken is the command, not
    the message type. And validation of message type against the DCB command
    was the obvious missing piece.
    
    Unfortunately it turns out that mlnx_qos, a somewhat widely deployed tool
    for configuration of DCB, accesses the DCB set-like APIs through
    RTM_GETDCB.
    
    Therefore do not bounce the discrepancy between message type and command.
    Instead, in addition to validating privileges based on the actual message
    type, validate them also based on the expected message type. This closes
    the loophole of allowing DCB configuration on non-admin accounts, while
    maintaining backward compatibility.
    
    Fixes: 2f90b86 ("ixgbe: this patch adds support for DCB to the kernel and ixgbe driver")
    Fixes: 826f328 ("net: dcb: Validate netlink message in DCB handler")
    Signed-off-by: Petr Machata <petrm@nvidia.com>
    Link: https://lore.kernel.org/r/a3edcfda0825f2aa2591801c5232f2bbf2d8a554.1610384801.git.me@pmachata.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    pmachata authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    5909e67 View commit details
    Browse the repository at this point in the history
  26. net: sit: unregister_netdevice on newlink's error path

    [ Upstream commit 47e4bb1 ]
    
    We need to unregister the netdevice if config failed.
    .ndo_uninit takes care of most of the heavy lifting.
    
    This was uncovered by recent commit c269a24 ("net: make
    free_netdev() more lenient with unregistering devices").
    Previously the partially-initialized device would be left
    in the system.
    
    Reported-and-tested-by: syzbot+2393580080a2da190f04@syzkaller.appspotmail.com
    Fixes: e2f1f07 ("sit: allow to configure 6rd tunnels via netlink")
    Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
    Link: https://lore.kernel.org/r/20210114012947.2515313-1-kuba@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    kuba-moo authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    9e188af View commit details
    Browse the repository at this point in the history
  27. rxrpc: Fix handling of an unsupported token type in rxrpc_read()

    [ Upstream commit d52e419 ]
    
    Clang static analysis reports the following:
    
    net/rxrpc/key.c:657:11: warning: Assigned value is garbage or undefined
                    toksize = toksizes[tok++];
                            ^ ~~~~~~~~~~~~~~~
    
    rxrpc_read() contains two consecutive loops.  The first loop calculates the
    token sizes and stores the results in toksizes[] and the second one uses
    the array.  When there is an error in identifying the token in the first
    loop, the token is skipped, no change is made to the toksizes[] array.
    When the same error happens in the second loop, the token is not skipped.
    This will cause the toksizes[] array to be out of step and will overrun
    past the calculated sizes.
    
    Fix this by making both loops log a message and return an error in this
    case.  This should only happen if a new token type is incompletely
    implemented, so it should normally be impossible to trigger this.
    
    Fixes: 9a059cd ("rxrpc: Downgrade the BUG() for unsupported token type in rxrpc_read()")
    Reported-by: Tom Rix <trix@redhat.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Reviewed-by: Tom Rix <trix@redhat.com>
    Link: https://lore.kernel.org/r/161046503122.2445787.16714129930607546635.stgit@warthog.procyon.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    dhowells authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    85862ea View commit details
    Browse the repository at this point in the history
  28. net: avoid 32 x truesize under-estimation for tiny skbs

    [ Upstream commit 3226b15 ]
    
    Both virtio net and napi_get_frags() allocate skbs
    with a very small skb->head
    
    While using page fragments instead of a kmalloc backed skb->head might give
    a small performance improvement in some cases, there is a huge risk of
    under estimating memory usage.
    
    For both GOOD_COPY_LEN and GRO_MAX_HEAD, we can fit at least 32 allocations
    per page (order-3 page in x86), or even 64 on PowerPC
    
    We have been tracking OOM issues on GKE hosts hitting tcp_mem limits
    but consuming far more memory for TCP buffers than instructed in tcp_mem[2]
    
    Even if we force napi_alloc_skb() to only use order-0 pages, the issue
    would still be there on arches with PAGE_SIZE >= 32768
    
    This patch makes sure that small skb head are kmalloc backed, so that
    other objects in the slab page can be reused instead of being held as long
    as skbs are sitting in socket queues.
    
    Note that we might in the future use the sk_buff napi cache,
    instead of going through a more expensive __alloc_skb()
    
    Another idea would be to use separate page sizes depending
    on the allocated length (to never have more than 4 frags per page)
    
    I would like to thank Greg Thelen for his precious help on this matter,
    analysing crash dumps is always a time consuming task.
    
    Fixes: fd11a83 ("net: Pull out core bits of __netdev_alloc_skb and add __napi_alloc_skb")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Paolo Abeni <pabeni@redhat.com>
    Cc: Greg Thelen <gthelen@google.com>
    Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Link: https://lore.kernel.org/r/20210113161819.1155526-1-eric.dumazet@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Eric Dumazet authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    4f0fca0 View commit details
    Browse the repository at this point in the history
  29. spi: cadence: cache reference clock rate during probe

    commit 4d163ad upstream.
    
    The issue is that using SPI from a callback under the CCF lock will
    deadlock, since this code uses clk_get_rate().
    
    Fixes: c474b38 ("spi: Add driver for Cadence SPI controller")
    Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
    Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
    Link: https://lore.kernel.org/r/20210114154217.51996-1-alexandru.ardelean@analog.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mhennerich authored and gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    22be6fa View commit details
    Browse the repository at this point in the history
  30. Linux 4.4.253

    Tested-by: Shuah Khan <skhan@linuxfoundation.org>
    Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Pavel Machek (CIP) <pavel@denx.de>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Link: https://lore.kernel.org/r/20210122160822.198606273@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    gregkh committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    4f907df View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2021

  1. Merge Linux 4.4.252 kernel

    Changes in 4.4.252: (19 commits)
            target: add XCOPY target/segment desc sense codes
            target: bounds check XCOPY segment descriptor list
            target: simplify XCOPY wwn->se_dev lookup helper
            target: use XCOPY segment descriptor CSCD IDs
            xcopy: loop over devices using idr helper
            scsi: target: Fix XCOPY NAA identifier lookup
            powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at
            net: ip: always refragment ip defragmented packets
            net: fix pmtu check in nopmtudisc mode
            vmlinux.lds.h: Add PGO and AutoFDO input sections
            ubifs: wbuf: Don't leak kernel memory to flash
            spi: pxa2xx: Fix use-after-free on unbind
            cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get()
            wil6210: select CONFIG_CRC32
            block: rsxx: select CONFIG_CRC32
            iommu/intel: Fix memleak in intel_irq_remapping_alloc
            block: fix use-after-free in disk_part_iter_next
            net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of trimmed packet
            Linux 4.4.252
    derfelot committed Jan 24, 2021
    Configuration menu
    Copy the full SHA
    4dc7739 View commit details
    Browse the repository at this point in the history
  2. Merge Linux 4.4.253 kernel

    Changes in 4.4.253: (30 commits)
            ASoC: dapm: remove widget from dirty list on free
            mm/hugetlb: fix potential missing huge page size info
            ext4: fix bug for rename with RENAME_WHITEOUT
            ARC: build: add boot_targets to PHONY
            ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram
            arch/arc: add copy_user_page() to <asm/page.h> to fix build error on ARC
            misdn: dsp: select CONFIG_BITREVERSE
            net: ethernet: fs_enet: Add missing MODULE_LICENSE
            ACPI: scan: add stub acpi_create_platform_device() for !CONFIG_ACPI
            ARM: picoxcell: fix missing interrupt-parent properties
            Input: uinput - avoid FF flush when destroying device
            dump_common_audit_data(): fix racy accesses to ->d_name
            NFS: nfs_igrab_and_active must first reference the superblock
            ext4: fix superblock checksum failure when setting password salt
            RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp
            mm, slub: consider rest of partial list if acquire_slab() fails
            net: sunrpc: interpret the return value of kstrtou32 correctly
            usb: ohci: Make distrust_firmware param default to false
            iio: buffer: Fix demux update
            nfsd4: readdirplus shouldn't return parent of export
            net: cdc_ncm: correct overhead in delayed_ndp_size
            netxen_nic: fix MSI/MSI-x interrupts
            rndis_host: set proper input size for OID_GEN_PHYSICAL_MEDIUM request
            net: dcb: Validate netlink message in DCB handler
            net: dcb: Accept RTM_GETDCB messages carrying set-like DCB commands
            net: sit: unregister_netdevice on newlink's error path
            rxrpc: Fix handling of an unsupported token type in rxrpc_read()
            net: avoid 32 x truesize under-estimation for tiny skbs
            spi: cadence: cache reference clock rate during probe
            Linux 4.4.253
    derfelot committed Jan 24, 2021
    Configuration menu
    Copy the full SHA
    8d3ebe5 View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2021

  1. ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info()

    commit 217bfbb upstream.
    
    snd_seq_oss_synth_make_info() didn't check the error code from
    snd_seq_oss_midi_make_info(), and this leads to the call of strlcpy()
    with the uninitialized string as the source, which may lead to the
    access over the limit.
    
    Add the proper error check for avoiding the failure.
    
    Reported-by: syzbot+e42504ff21cff05a595f@syzkaller.appspotmail.com
    Cc: <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20210115093428.15882-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tiwai authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    d97e020 View commit details
    Browse the repository at this point in the history
  2. ALSA: hda/via: Add minimum mute flag

    commit 67ea698 upstream.
    
    It turned out that VIA codecs also mute the sound in the lowest mixer
    level.  Turn on the dac_min_mute flag to indicate the mute-as-minimum
    in TLV like already done in Conexant and IDT codecs.
    
    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210559
    Cc: <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20210114072453.11379-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tiwai authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    754baca View commit details
    Browse the repository at this point in the history
  3. ACPI: scan: Make acpi_bus_get_device() clear return pointer on error

    commit 78a18fe upstream.
    
    Set the acpi_device pointer which acpi_bus_get_device() returns-by-
    reference to NULL on errors.
    
    We've recently had 2 cases where callers of acpi_bus_get_device()
    did not properly error check the return value, so set the returned-
    by-reference acpi_device pointer to NULL, because at least some
    callers of acpi_bus_get_device() expect that to be done on errors.
    
    [ rjw: This issue was exposed by commit 71da201 ("ACPI: scan:
      Defer enumeration of devices with _DEP lists") which caused it to
      be much more likely to occur on some systems, but the real defect
      had been introduced by an earlier commit. ]
    
    Fixes: 40e7fcb ("ACPI: Add _DEP support to fix battery issue on Asus T100TA")
    Fixes: bcfcd40 ("usb: split code locating ACPI companion into port and device")
    Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Diagnosed-by: Rafael J. Wysocki <rafael@kernel.org>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Cc: All applicable <stable@vger.kernel.org>
    [ rjw: Subject and changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jwrdegoede authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    104ecf5 View commit details
    Browse the repository at this point in the history
  4. dm: avoid filesystem lookup in dm_get_dev_t()

    commit 809b1e4 upstream.
    
    This reverts commit
    644bda6 ("dm table: fall back to getting device using name_to_dev_t()")
    
    dm_get_dev_t() is just used to convert an arbitrary 'path' string
    into a dev_t. It doesn't presume that the device is present; that
    check will be done later, as the only caller is dm_get_device(),
    which does a dm_get_table_device() later on, which will properly
    open the device.
    
    So if the path string already _is_ in major:minor representation
    we can convert it directly, avoiding a recursion into the filesystem
    to lookup the block device.
    
    This avoids a hang in multipath_message() when the filesystem is
    inaccessible.
    
    Fixes: 644bda6 ("dm table: fall back to getting device using name_to_dev_t()")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hannes Reinecke <hare@suse.de>
    Signed-off-by: Martin Wilck <mwilck@suse.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    hreinecke authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    dbec61a View commit details
    Browse the repository at this point in the history
  5. ASoC: Intel: haswell: Add missing pm_ops

    [ Upstream commit bb224c3 ]
    
    haswell machine board is missing pm_ops what prevents it from undergoing
    suspend-resume procedure successfully. Assign default snd_soc_pm_ops so
    this is no longer the case.
    
    Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
    Link: https://lore.kernel.org/r/20201217105401.27865-1-cezary.rojewski@intel.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    crojewsk-intel authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    d90315d View commit details
    Browse the repository at this point in the history
  6. scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback

    [ Upstream commit 35fc4cd ]
    
    Users can initiate resets to specific SCSI device/target/host through
    IOCTL. When this happens, the SCSI cmd passed to eh_device/target/host
    _reset_handler() callbacks is initialized with a request whose tag is -1.
    In this case it is not right for eh_device_reset_handler() callback to
    count on the LUN get from hba->lrb[-1]. Fix it by getting LUN from the SCSI
    device associated with the SCSI cmd.
    
    Link: https://lore.kernel.org/r/1609157080-26283-1-git-send-email-cang@codeaurora.org
    Reviewed-by: Avri Altman <avri.altman@wdc.com>
    Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
    Signed-off-by: Can Guo <cang@codeaurora.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Can Guo authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    a4cdbf4 View commit details
    Browse the repository at this point in the history
  7. drm/nouveau/bios: fix issue shadowing expansion ROMs

    [ Upstream commit 402a896 ]
    
    This issue has generally been covered up by the presence of additional
    expansion ROMs after the ones we're interested in, with header fetches
    of subsequent images loading enough of the ROM to hide the issue.
    
    Noticed on GA102, which lacks a type 0x70 image compared to TU102,.
    
    [  906.364197] nouveau 0000:09:00.0: bios: 00000000: type 00, 65024 bytes
    [  906.381205] nouveau 0000:09:00.0: bios: 0000fe00: type 03, 91648 bytes
    [  906.405213] nouveau 0000:09:00.0: bios: 00026400: type e0, 22016 bytes
    [  906.410984] nouveau 0000:09:00.0: bios: 0002ba00: type e0, 366080 bytes
    
    vs
    
    [   22.961901] nouveau 0000:09:00.0: bios: 00000000: type 00, 60416 bytes
    [   22.984174] nouveau 0000:09:00.0: bios: 0000ec00: type 03, 71168 bytes
    [   23.010446] nouveau 0000:09:00.0: bios: 00020200: type e0, 48128 bytes
    [   23.028220] nouveau 0000:09:00.0: bios: 0002be00: type e0, 140800 bytes
    [   23.080196] nouveau 0000:09:00.0: bios: 0004e400: type 70, 7168 bytes
    
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Ben Skeggs authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    c16b56e View commit details
    Browse the repository at this point in the history
  8. drm/nouveau/i2c/gm200: increase width of aux semaphore owner fields

    [ Upstream commit ba6e9ab ]
    
    Noticed while debugging GA102.
    
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Ben Skeggs authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    6a2aa69 View commit details
    Browse the repository at this point in the history
  9. can: dev: can_restart: fix use after free bug

    [ Upstream commit 03f16c5 ]
    
    After calling netif_rx_ni(skb), dereferencing skb is unsafe.
    Especially, the can_frame cf which aliases skb memory is accessed
    after the netif_rx_ni() in:
          stats->rx_bytes += cf->len;
    
    Reordering the lines solves the issue.
    
    Fixes: 39549ee ("can: CAN Network device driver and Netlink interface")
    Link: https://lore.kernel.org/r/20210120114137.200019-2-mailhol.vincent@wanadoo.fr
    Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    vincent-mailhol authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    260925a View commit details
    Browse the repository at this point in the history
  10. iio: ad5504: Fix setting power-down state

    commit efd597b upstream.
    
    The power-down mask of the ad5504 is actually a power-up mask. Meaning if
    a bit is set the corresponding channel is powered up and if it is not set
    the channel is powered down.
    
    The driver currently has this the wrong way around, resulting in the
    channel being powered up when requested to be powered down and vice versa.
    
    Fixes: 3bbbf15 ("staging:iio:dac:ad5504: Use strtobool for boolean values")
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
    Link: https://lore.kernel.org/r/20201209104649.5794-1-lars@metafoo.de
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    larsclausen authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    1148a9f View commit details
    Browse the repository at this point in the history
  11. ehci: fix EHCI host controller initialization sequence

    commit 280a904 upstream.
    
    According to EHCI spec, EHCI HC clears USBSTS.HCHalted whenever
    USBCMD.RS=1.
    
    However, it is a good practice to wait some time after setting USBCMD.RS
    (approximately 100ms) until USBSTS.HCHalted become zero.
    
    Without this waiting, VirtualBox's EHCI virtual HC accidentally hangs
    (see BugLink).
    
    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211095
    Acked-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Eugene Korenevsky <ekorenevsky@astralinux.ru>
    Cc: stable <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20210110173609.GA17313@himera.home
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Eugene Korenevsky authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    c2a8cb5 View commit details
    Browse the repository at this point in the history
  12. usb: bdc: Make bdc pci driver depend on BROKEN

    commit ef02684 upstream.
    
    The bdc pci driver is going to be removed due to it not existing in the
    wild. This patch turns off compilation of the driver so that stable
    kernels can also pick up the change. This helps the out-of-tree
    facetimehd webcam driver as the pci id conflicts with bdc.
    
    Cc: Al Cooper <alcooperx@gmail.com>
    Cc: <stable@vger.kernel.org>
    Acked-by: Felipe Balbi <balbi@kernel.org>
    Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
    Link: https://lore.kernel.org/r/20210118203615.13995-1-patrik.r.jakobsson@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    patjak authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    c8b7359 View commit details
    Browse the repository at this point in the history
  13. xhci: make sure TRB is fully written before giving it to the controller

    commit 576667b upstream.
    
    Once the command ring doorbell is rung the xHC controller will parse all
    command TRBs on the command ring that have the cycle bit set properly.
    
    If the driver just started writing the next command TRB to the ring when
    hardware finished the previous TRB, then HW might fetch an incomplete TRB
    as long as its cycle bit set correctly.
    
    A command TRB is 16 bytes (128 bits) long.
    Driver writes the command TRB in four 32 bit chunks, with the chunk
    containing the cycle bit last. This does however not guarantee that
    chunks actually get written in that order.
    
    This was detected in stress testing when canceling URBs with several
    connected USB devices.
    Two consecutive "Set TR Dequeue pointer" commands got queued right
    after each other, and the second one was only partially written when
    the controller parsed it, causing the dequeue pointer to be set
    to bogus values. This was seen as error messages:
    
    "Mismatch between completed Set TR Deq Ptr command & xHCI internal state"
    
    Solution is to add a write memory barrier before writing the cycle bit.
    
    Cc: <stable@vger.kernel.org>
    Tested-by: Ross Zwisler <zwisler@google.com>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Link: https://lore.kernel.org/r/20210115161907.2875631-2-mathias.nyman@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    matnyman authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    5eaa0aa View commit details
    Browse the repository at this point in the history
  14. compiler.h: Raise minimum version of GCC to 5.1 for arm64

    commit dca5244 upstream.
    
    GCC versions >= 4.9 and < 5.1 have been shown to emit memory references
    beyond the stack pointer, resulting in memory corruption if an interrupt
    is taken after the stack pointer has been adjusted but before the
    reference has been executed. This leads to subtle, infrequent data
    corruption such as the EXT4 problems reported by Russell King at the
    link below.
    
    Life is too short for buggy compilers, so raise the minimum GCC version
    required by arm64 to 5.1.
    
    Reported-by: Russell King <linux@armlinux.org.uk>
    Suggested-by: Arnd Bergmann <arnd@kernel.org>
    Signed-off-by: Will Deacon <will@kernel.org>
    Tested-by: Nathan Chancellor <natechancellor@gmail.com>
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
    Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: <stable@vger.kernel.org>
    Cc: Theodore Ts'o <tytso@mit.edu>
    Cc: Florian Weimer <fweimer@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Nick Desaulniers <ndesaulniers@google.com>
    Link: https://lore.kernel.org/r/20210105154726.GD1551@shell.armlinux.org.uk
    Link: https://lore.kernel.org/r/20210112224832.10980-1-will@kernel.org
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    [will: backport to 4.4.y/4.9.y/4.14.y; add __clang__ check]
    Link: https://lore.kernel.org/r/CA+G9fYuzE9WMSB7uGjV4gTzK510SHEdJb_UXQCzsQ5MqA=h9SA@mail.gmail.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    willdeacon authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    6eedcd6 View commit details
    Browse the repository at this point in the history
  15. netfilter: rpfilter: mask ecn bits before fib lookup

    commit 2e5a626 upstream.
    
    RT_TOS() only masks one of the two ECN bits. Therefore rpfilter_mt()
    treats Not-ECT or ECT(1) packets in a different way than those with
    ECT(0) or CE.
    
    Reproducer:
    
      Create two netns, connected with a veth:
      $ ip netns add ns0
      $ ip netns add ns1
      $ ip link add name veth01 netns ns0 type veth peer name veth10 netns ns1
      $ ip -netns ns0 link set dev veth01 up
      $ ip -netns ns1 link set dev veth10 up
      $ ip -netns ns0 address add 192.0.2.10/32 dev veth01
      $ ip -netns ns1 address add 192.0.2.11/32 dev veth10
    
      Add a route to ns1 in ns0:
      $ ip -netns ns0 route add 192.0.2.11/32 dev veth01
    
      In ns1, only packets with TOS 4 can be routed to ns0:
      $ ip -netns ns1 route add 192.0.2.10/32 tos 4 dev veth10
    
      Ping from ns0 to ns1 works regardless of the ECN bits, as long as TOS
      is 4:
      $ ip netns exec ns0 ping -Q 4 192.0.2.11   # TOS 4, Not-ECT
        ... 0% packet loss ...
      $ ip netns exec ns0 ping -Q 5 192.0.2.11   # TOS 4, ECT(1)
        ... 0% packet loss ...
      $ ip netns exec ns0 ping -Q 6 192.0.2.11   # TOS 4, ECT(0)
        ... 0% packet loss ...
      $ ip netns exec ns0 ping -Q 7 192.0.2.11   # TOS 4, CE
        ... 0% packet loss ...
    
      Now use iptable's rpfilter module in ns1:
      $ ip netns exec ns1 iptables-legacy -t raw -A PREROUTING -m rpfilter --invert -j DROP
    
      Not-ECT and ECT(1) packets still pass:
      $ ip netns exec ns0 ping -Q 4 192.0.2.11   # TOS 4, Not-ECT
        ... 0% packet loss ...
      $ ip netns exec ns0 ping -Q 5 192.0.2.11   # TOS 4, ECT(1)
        ... 0% packet loss ...
    
      But ECT(0) and ECN packets are dropped:
      $ ip netns exec ns0 ping -Q 6 192.0.2.11   # TOS 4, ECT(0)
        ... 100% packet loss ...
      $ ip netns exec ns0 ping -Q 7 192.0.2.11   # TOS 4, CE
        ... 100% packet loss ...
    
    After this patch, rpfilter doesn't drop ECT(0) and CE packets anymore.
    
    Fixes: 8f97339 ("netfilter: add ipv4 reverse path filter match")
    Signed-off-by: Guillaume Nault <gnault@redhat.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Guillaume Nault authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    6871b5c View commit details
    Browse the repository at this point in the history
  16. sh: dma: fix kconfig dependency for G2_DMA

    commit f477a53 upstream.
    
    When G2_DMA is enabled and SH_DMA is disabled, it results in the following
    Kbuild warning:
    
    WARNING: unmet direct dependencies detected for SH_DMA_API
      Depends on [n]: SH_DMA [=n]
      Selected by [y]:
      - G2_DMA [=y] && SH_DREAMCAST [=y]
    
    The reason is that G2_DMA selects SH_DMA_API without depending on or
    selecting SH_DMA while SH_DMA_API depends on SH_DMA.
    
    When G2_DMA was first introduced with commit 40f49e7
    ("sh: dma: Make G2 DMA configurable."), this wasn't an issue since
    SH_DMA_API didn't have such dependency, and this way was the only way to
    enable it since SH_DMA_API was non-visible. However, later SH_DMA_API was
    made visible and dependent on SH_DMA with commit d8902ad
    ("dmaengine: sh: Add Support SuperH DMA Engine driver").
    
    Let G2_DMA depend on SH_DMA_API instead to avoid Kbuild issues.
    
    Fixes: d8902ad ("dmaengine: sh: Add Support SuperH DMA Engine driver")
    Signed-off-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
    Signed-off-by: Rich Felker <dalias@libc.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    necipfazil authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    8a37f1c View commit details
    Browse the repository at this point in the history
  17. sh_eth: Fix power down vs. is_opened flag ordering

    commit f6a2e94 upstream.
    
    sh_eth_close() does a synchronous power down of the device before
    marking it closed.  Revert the order, to make sure the device is never
    marked opened while suspended.
    
    While at it, use pm_runtime_put() instead of pm_runtime_put_sync(), as
    there is no reason to do a synchronous power down.
    
    Fixes: 7fa2955 ("sh_eth: Fix sleeping function called from invalid context")
    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
    Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
    Link: https://lore.kernel.org/r/20210118150812.796791-1-geert+renesas@glider.be
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    geertu authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    17663f1 View commit details
    Browse the repository at this point in the history
  18. skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too

    commit 66c5560 upstream.
    
    Commit 3226b15 ("net: avoid 32 x truesize under-estimation for
    tiny skbs") ensured that skbs with data size lower than 1025 bytes
    will be kmalloc'ed to avoid excessive page cache fragmentation and
    memory consumption.
    However, the fix adressed only __napi_alloc_skb() (primarily for
    virtio_net and napi_get_frags()), but the issue can still be achieved
    through __netdev_alloc_skb(), which is still used by several drivers.
    Drivers often allocate a tiny skb for headers and place the rest of
    the frame to frags (so-called copybreak).
    Mirror the condition to __netdev_alloc_skb() to handle this case too.
    
    Since v1 [0]:
     - fix "Fixes:" tag;
     - refine commit message (mention copybreak usecase).
    
    [0] https://lore.kernel.org/netdev/20210114235423.232737-1-alobakin@pm.me
    
    Fixes: a1c7fff ("net: netdev_alloc_skb() use build_skb()")
    Signed-off-by: Alexander Lobakin <alobakin@pm.me>
    Link: https://lore.kernel.org/r/20210115150354.85967-1-alobakin@pm.me
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    solbjorn authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    c29efd7 View commit details
    Browse the repository at this point in the history
  19. ipv6: create multicast route with RTPROT_KERNEL

    commit a826b04 upstream.
    
    The ff00::/8 multicast route is created without specifying the fc_protocol
    field, so the default RTPROT_BOOT value is used:
    
      $ ip -6 -d route
      unicast ::1 dev lo proto kernel scope global metric 256 pref medium
      unicast fe80::/64 dev eth0 proto kernel scope global metric 256 pref medium
      unicast ff00::/8 dev eth0 proto boot scope global metric 256 pref medium
    
    As the documentation says, this value identifies routes installed during
    boot, but the route is created when interface is set up.
    Change the value to RTPROT_KERNEL which is a better value.
    
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Signed-off-by: Matteo Croce <mcroce@microsoft.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    teknoraver authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    69e4228 View commit details
    Browse the repository at this point in the history
  20. net_sched: avoid shift-out-of-bounds in tcindex_set_parms()

    commit bcd0cf1 upstream.
    
    tc_index being 16bit wide, we need to check that TCA_TCINDEX_SHIFT
    attribute is not silly.
    
    UBSAN: shift-out-of-bounds in net/sched/cls_tcindex.c:260:29
    shift exponent 255 is too large for 32-bit type 'int'
    CPU: 0 PID: 8516 Comm: syz-executor228 Not tainted 5.10.0-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
     __dump_stack lib/dump_stack.c:79 [inline]
     dump_stack+0x107/0x163 lib/dump_stack.c:120
     ubsan_epilogue+0xb/0x5a lib/ubsan.c:148
     __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:395
     valid_perfect_hash net/sched/cls_tcindex.c:260 [inline]
     tcindex_set_parms.cold+0x1b/0x215 net/sched/cls_tcindex.c:425
     tcindex_change+0x232/0x340 net/sched/cls_tcindex.c:546
     tc_new_tfilter+0x13fb/0x21b0 net/sched/cls_api.c:2127
     rtnetlink_rcv_msg+0x8b6/0xb80 net/core/rtnetlink.c:5555
     netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
     netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
     netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330
     netlink_sendmsg+0x907/0xe40 net/netlink/af_netlink.c:1919
     sock_sendmsg_nosec net/socket.c:652 [inline]
     sock_sendmsg+0xcf/0x120 net/socket.c:672
     ____sys_sendmsg+0x6e8/0x810 net/socket.c:2336
     ___sys_sendmsg+0xf3/0x170 net/socket.c:2390
     __sys_sendmsg+0xe5/0x1b0 net/socket.c:2423
     do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
     entry_SYSCALL_64_after_hwframe+0x44/0xa9
    
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Link: https://lore.kernel.org/r/20210114185229.1742255-1-eric.dumazet@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Eric Dumazet authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    b5fb0ad View commit details
    Browse the repository at this point in the history
  21. Revert "mm/slub: fix a memory leak in sysfs_slab_add()"

    commit 757fed1 upstream.
    
    This reverts commit dde3c6b.
    
    syzbot report a double-free bug. The following case can cause this bug.
    
     - mm/slab_common.c: create_cache(): if the __kmem_cache_create() fails,
       it does:
    
    	out_free_cache:
    		kmem_cache_free(kmem_cache, s);
    
     - but __kmem_cache_create() - at least for slub() - will have done
    
    	sysfs_slab_add(s)
    		-> sysfs_create_group() .. fails ..
    		-> kobject_del(&s->kobj); .. which frees s ...
    
    We can't remove the kmem_cache_free() in create_cache(), because other
    error cases of __kmem_cache_create() do not free this.
    
    So, revert the commit dde3c6b ("mm/slub: fix a memory leak in
    sysfs_slab_add()") to fix this.
    
    Reported-by: syzbot+d0bd96b4696c1ef67991@syzkaller.appspotmail.com
    Fixes: dde3c6b ("mm/slub: fix a memory leak in sysfs_slab_add()")
    Acked-by: Vlastimil Babka <vbabka@suse.cz>
    Signed-off-by: Wang Hai <wanghai38@huawei.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Wang Hai authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    ab98f2e View commit details
    Browse the repository at this point in the history
  22. tracing: Fix race in trace_open and buffer resize call

    commit bbeb974 upstream.
    
    Below race can come, if trace_open and resize of
    cpu buffer is running parallely on different cpus
    CPUX                                CPUY
    				    ring_buffer_resize
    				    atomic_read(&buffer->resize_disabled)
    tracing_open
    tracing_reset_online_cpus
    ring_buffer_reset_cpu
    rb_reset_cpu
    				    rb_update_pages
    				    remove/insert pages
    resetting pointer
    
    This race can cause data abort or some times infinte loop in
    rb_remove_pages and rb_insert_pages while checking pages
    for sanity.
    
    Take buffer lock to fix this.
    
    Link: https://lkml.kernel.org/r/1601976833-24377-1-git-send-email-gkohli@codeaurora.org
    
    Cc: stable@vger.kernel.org
    Fixes: 83f4031 ("ring-buffer: Make removal of ring buffer pages atomic")
    Reported-by: Denis Efremov <efremov@linux.com>
    Signed-off-by: Gaurav Kohli <gkohli@codeaurora.org>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Gaurav Kohli authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    a7c2dd4 View commit details
    Browse the repository at this point in the history
  23. xen-blkback: set ring->xenblkd to NULL after kthread_stop()

    commit 1c72871 upstream.
    
    When xen_blkif_disconnect() is called, the kernel thread behind the
    block interface is stopped by calling kthread_stop(ring->xenblkd).
    The ring->xenblkd thread pointer being non-NULL determines if the
    thread has been already stopped.
    Normally, the thread's function xen_blkif_schedule() sets the
    ring->xenblkd to NULL, when the thread's main loop ends.
    
    However, when the thread has not been started yet (i.e.
    wake_up_process() has not been called on it), the xen_blkif_schedule()
    function would not be called yet.
    
    In such case the kthread_stop() call returns -EINTR and the
    ring->xenblkd remains dangling.
    When this happens, any consecutive call to xen_blkif_disconnect (for
    example in frontend_changed() callback) leads to a kernel crash in
    kthread_stop() (e.g. NULL pointer dereference in exit_creds()).
    
    This is XSA-350.
    
    Cc: <stable@vger.kernel.org> # 4.12
    Fixes: a24fa22 ("xen/blkback: don't use xen_blkif_get() in xen-blkback kthread")
    Reported-by: Olivier Benjamin <oliben@amazon.com>
    Reported-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
    Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    [iwamatsu: change from ring to blkif]
    Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    wipawel authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    241862b View commit details
    Browse the repository at this point in the history
  24. x86/boot/compressed: Disable relocation relaxation

    commit 09e4396 upstream.
    
    The x86-64 psABI [0] specifies special relocation types
    (R_X86_64_[REX_]GOTPCRELX) for indirection through the Global Offset
    Table, semantically equivalent to R_X86_64_GOTPCREL, which the linker
    can take advantage of for optimization (relaxation) at link time. This
    is supported by LLD and binutils versions 2.26 onwards.
    
    The compressed kernel is position-independent code, however, when using
    LLD or binutils versions before 2.27, it must be linked without the -pie
    option. In this case, the linker may optimize certain instructions into
    a non-position-independent form, by converting foo@GOTPCREL(%rip) to $foo.
    
    This potential issue has been present with LLD and binutils-2.26 for a
    long time, but it has never manifested itself before now:
    
    - LLD and binutils-2.26 only relax
    	movq	foo@GOTPCREL(%rip), %reg
      to
    	leaq	foo(%rip), %reg
      which is still position-independent, rather than
    	mov	$foo, %reg
      which is permitted by the psABI when -pie is not enabled.
    
    - GCC happens to only generate GOTPCREL relocations on mov instructions.
    
    - CLang does generate GOTPCREL relocations on non-mov instructions, but
      when building the compressed kernel, it uses its integrated assembler
      (due to the redefinition of KBUILD_CFLAGS dropping -no-integrated-as),
      which has so far defaulted to not generating the GOTPCRELX
      relocations.
    
    Nick Desaulniers reports [1,2]:
    
      "A recent change [3] to a default value of configuration variable
       (ENABLE_X86_RELAX_RELOCATIONS OFF -> ON) in LLVM now causes Clang's
       integrated assembler to emit R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX
       relocations. LLD will relax instructions with these relocations based
       on whether the image is being linked as position independent or not.
       When not, then LLD will relax these instructions to use absolute
       addressing mode (R_RELAX_GOT_PC_NOPIC). This causes kernels built with
       Clang and linked with LLD to fail to boot."
    
    Patch series [4] is a solution to allow the compressed kernel to be
    linked with -pie unconditionally, but even if merged is unlikely to be
    backported. As a simple solution that can be applied to stable as well,
    prevent the assembler from generating the relaxed relocation types using
    the -mrelax-relocations=no option. For ease of backporting, do this
    unconditionally.
    
    [0] https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/linker-optimization.tex#L65
    [1] https://lore.kernel.org/lkml/20200807194100.3570838-1-ndesaulniers@google.com/
    [2] ClangBuiltLinux/linux#1121
    [3] https://reviews.llvm.org/rGc41a18cf61790fc898dcda1055c3efbf442c14c0
    [4] https://lore.kernel.org/lkml/20200731202738.2577854-1-nivedita@alum.mit.edu/
    
    Reported-by: Nick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Tested-by: Nick Desaulniers <ndesaulniers@google.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Acked-by: Ard Biesheuvel <ardb@kernel.org>
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200812004308.1448603-1-nivedita@alum.mit.edu
    [nc: Backport to 4.4]
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nivedita76 authored and gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    d3979f1 View commit details
    Browse the repository at this point in the history
  25. Linux 4.4.254

    Tested-by: Pavel Machek (CIP) <pavel@denx.de>
    Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
    Link: https://lore.kernel.org/r/20210129105909.630107942@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    gregkh committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    65554ca View commit details
    Browse the repository at this point in the history
  26. yoshino: Integrate kddi/sov36 support and update defconfigs

    * Introduce CONFIG_MACH_SONY_POPLAR_KDDI
    * Add kddi dt's
    * Add kddi defconfig
    * Update remaining defconfigs
    * Add Sony's carillon NFC driver
    derfelot committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    04aa111 View commit details
    Browse the repository at this point in the history
  27. configs: yoshino: Build all required drivers into kernel

    Because we can now.
    
    Also, this makes it much cleaner for the rc scripts, removing the need to dynamically load required nfc modules based on device.
    derfelot committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    c51daea View commit details
    Browse the repository at this point in the history
  28. Merge Linux 4.4.254 kernel

    Changes in 4.4.254: (25 commits)
            ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info()
            ALSA: hda/via: Add minimum mute flag
            ACPI: scan: Make acpi_bus_get_device() clear return pointer on error
            dm: avoid filesystem lookup in dm_get_dev_t()
            ASoC: Intel: haswell: Add missing pm_ops
            scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback
            drm/nouveau/bios: fix issue shadowing expansion ROMs
            drm/nouveau/i2c/gm200: increase width of aux semaphore owner fields
            can: dev: can_restart: fix use after free bug
            iio: ad5504: Fix setting power-down state
            ehci: fix EHCI host controller initialization sequence
            usb: bdc: Make bdc pci driver depend on BROKEN
            xhci: make sure TRB is fully written before giving it to the controller
            compiler.h: Raise minimum version of GCC to 5.1 for arm64
            netfilter: rpfilter: mask ecn bits before fib lookup
            sh: dma: fix kconfig dependency for G2_DMA
            sh_eth: Fix power down vs. is_opened flag ordering
            skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too
            ipv6: create multicast route with RTPROT_KERNEL
            net_sched: avoid shift-out-of-bounds in tcindex_set_parms()
            Revert "mm/slub: fix a memory leak in sysfs_slab_add()"
            tracing: Fix race in trace_open and buffer resize call
            xen-blkback: set ring->xenblkd to NULL after kthread_stop()
            x86/boot/compressed: Disable relocation relaxation
            Linux 4.4.254
    
    Conflicts:
    	drivers/scsi/ufs/ufshcd.c
    	net/core/skbuff.c
    derfelot committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    82e499f View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2021

  1. Configuration menu
    Copy the full SHA
    31d14f8 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2021

  1. ACPI: sysfs: Prefer "compatible" modalias

    commit 36af2d5 upstream.
    
    Commit 8765c5b ("ACPI / scan: Rework modalias creation when
    "compatible" is present") may create two "MODALIAS=" in one uevent
    file if specific conditions are met.
    
    This breaks systemd-udevd, which assumes each "key" in one uevent file
    to be unique. The internal implementation of systemd-udevd overwrites
    the first MODALIAS with the second one, so its kmod rule doesn't load
    the driver for the first MODALIAS.
    
    So if both the ACPI modalias and the OF modalias are present, use the
    latter to ensure that there will be only one MODALIAS.
    
    Link: systemd/systemd#18163
    Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Fixes: 8765c5b ("ACPI / scan: Rework modalias creation when "compatible" is present")
    Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
    Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: 4.1+ <stable@vger.kernel.org> # 4.1+
    [ rjw: Subject and changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    khfeng authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    4bb12fd View commit details
    Browse the repository at this point in the history
  2. wext: fix NULL-ptr-dereference with cfg80211's lack of commit()

    commit 5122565 upstream.
    
    Since cfg80211 doesn't implement commit, we never really cared about
    that code there (and it's configured out w/o CONFIG_WIRELESS_EXT).
    After all, since it has no commit, it shouldn't return -EIWCOMMIT to
    indicate commit is needed.
    
    However, EIWCOMMIT is actually an alias for EINPROGRESS, which _can_
    happen if e.g. we try to change the frequency but we're already in
    the process of connecting to some network, and drivers could return
    that value (or even cfg80211 itself might).
    
    This then causes us to crash because dev->wireless_handlers is NULL
    but we try to check dev->wireless_handlers->standard[0].
    
    Fix this by also checking dev->wireless_handlers. Also simplify the
    code a little bit.
    
    Cc: stable@vger.kernel.org
    Reported-by: syzbot+444248c79e117bc99f46@syzkaller.appspotmail.com
    Reported-by: syzbot+8b2a88a09653d4084179@syzkaller.appspotmail.com
    Link: https://lore.kernel.org/r/20210121171621.2076e4a37d5a.I5d9c72220fe7bb133fb718751da0180a57ecba4e@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jmberg-intel authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    65ffc73 View commit details
    Browse the repository at this point in the history
  3. net: usb: qmi_wwan: added support for Thales Cinterion PLSx3 modem fa…

    …mily
    
    commit 7e0e63d upstream.
    
    Bus 003 Device 009: ID 1e2d:006f
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass          239 Miscellaneous Device
      bDeviceSubClass         2 ?
      bDeviceProtocol         1 Interface Association
      bMaxPacketSize0        64
      idVendor           0x1e2d
      idProduct          0x006f
      bcdDevice            0.00
      iManufacturer           3 Cinterion Wireless Modules
      iProduct                2 PLSx3
      iSerial                 4 fa3c1419
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength          303
        bNumInterfaces          9
        bConfigurationValue     1
        iConfiguration          1 Cinterion Configuration
        bmAttributes         0xe0
          Self Powered
          Remote Wakeup
        MaxPower              500mA
        Interface Association:
          bLength                 8
          bDescriptorType        11
          bFirstInterface         0
          bInterfaceCount         2
          bFunctionClass          2 Communications
          bFunctionSubClass       2 Abstract (modem)
          bFunctionProtocol       1 AT-commands (v.25ter)
          iFunction               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         2 Communications
          bInterfaceSubClass      2 Abstract (modem)
          bInterfaceProtocol      1 AT-commands (v.25ter)
          iInterface              0
          CDC Header:
            bcdCDC               1.10
          CDC ACM:
            bmCapabilities       0x02
              line coding and serial state
          CDC Call Management:
            bmCapabilities       0x03
              call management
              use DataInterface
            bDataInterface          1
          CDC Union:
            bMasterInterface        0
            bSlaveInterface         1
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               5
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           2
          bInterfaceClass        10 CDC Data
          bInterfaceSubClass      0 Unused
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x82  EP 2 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x01  EP 1 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
        Interface Association:
          bLength                 8
          bDescriptorType        11
          bFirstInterface         2
          bInterfaceCount         2
          bFunctionClass          2 Communications
          bFunctionSubClass       2 Abstract (modem)
          bFunctionProtocol       1 AT-commands (v.25ter)
          iFunction               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         2 Communications
          bInterfaceSubClass      2 Abstract (modem)
          bInterfaceProtocol      1 AT-commands (v.25ter)
          iInterface              0
          CDC Header:
            bcdCDC               1.10
          CDC ACM:
            bmCapabilities       0x02
              line coding and serial state
          CDC Call Management:
            bmCapabilities       0x03
              call management
              use DataInterface
            bDataInterface          3
          CDC Union:
            bMasterInterface        2
            bSlaveInterface         3
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x83  EP 3 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               5
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        3
          bAlternateSetting       0
          bNumEndpoints           2
          bInterfaceClass        10 CDC Data
          bInterfaceSubClass      0 Unused
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x84  EP 4 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x02  EP 2 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
        Interface Association:
          bLength                 8
          bDescriptorType        11
          bFirstInterface         4
          bInterfaceCount         2
          bFunctionClass          2 Communications
          bFunctionSubClass       2 Abstract (modem)
          bFunctionProtocol       1 AT-commands (v.25ter)
          iFunction               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        4
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         2 Communications
          bInterfaceSubClass      2 Abstract (modem)
          bInterfaceProtocol      1 AT-commands (v.25ter)
          iInterface              0
          CDC Header:
            bcdCDC               1.10
          CDC ACM:
            bmCapabilities       0x02
              line coding and serial state
          CDC Call Management:
            bmCapabilities       0x03
              call management
              use DataInterface
            bDataInterface          5
          CDC Union:
            bMasterInterface        4
            bSlaveInterface         5
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x85  EP 5 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               5
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        5
          bAlternateSetting       0
          bNumEndpoints           2
          bInterfaceClass        10 CDC Data
          bInterfaceSubClass      0 Unused
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x86  EP 6 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x03  EP 3 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
        Interface Association:
          bLength                 8
          bDescriptorType        11
          bFirstInterface         6
          bInterfaceCount         2
          bFunctionClass          2 Communications
          bFunctionSubClass       2 Abstract (modem)
          bFunctionProtocol       1 AT-commands (v.25ter)
          iFunction               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        6
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         2 Communications
          bInterfaceSubClass      2 Abstract (modem)
          bInterfaceProtocol      1 AT-commands (v.25ter)
          iInterface              0
          CDC Header:
            bcdCDC               1.10
          CDC ACM:
            bmCapabilities       0x02
              line coding and serial state
          CDC Call Management:
            bmCapabilities       0x03
              call management
              use DataInterface
            bDataInterface          7
          CDC Union:
            bMasterInterface        6
            bSlaveInterface         7
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x87  EP 7 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               5
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        7
          bAlternateSetting       0
          bNumEndpoints           2
          bInterfaceClass        10 CDC Data
          bInterfaceSubClass      0 Unused
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x88  EP 8 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x04  EP 4 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        8
          bAlternateSetting       0
          bNumEndpoints           3
          bInterfaceClass       255 Vendor Specific Class
          bInterfaceSubClass    255 Vendor Specific Subclass
          bInterfaceProtocol    255 Vendor Specific Protocol
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x89  EP 9 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval               5
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x8a  EP 10 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x05  EP 5 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
    Device Qualifier (for other device speed):
      bLength                10
      bDescriptorType         6
      bcdUSB               2.00
      bDeviceClass          239 Miscellaneous Device
      bDeviceSubClass         2 ?
      bDeviceProtocol         1 Interface Association
      bMaxPacketSize0        64
      bNumConfigurations      1
    Device Status:     0x0000
      (Bus Powered)
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Giacinto Cifelli <gciofono@gmail.com>
    Acked-by: Bjørn Mork <bjorn@mork.no>
    Link: https://lore.kernel.org/r/20210120045650.10855-1-gciofono@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    GiacintoCifelli authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    eeaf7e8 View commit details
    Browse the repository at this point in the history
  4. KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_ar…

    …ch_events[]
    
    commit 98dd2f1 upstream.
    
    The HW_REF_CPU_CYCLES event on the fixed counter 2 is pseudo-encoded as
    0x0300 in the intel_perfmon_event_map[]. Correct its usage.
    
    Fixes: 62079d8 ("KVM: PMU: add proper support for fixed counter 2")
    Signed-off-by: Like Xu <like.xu@linux.intel.com>
    Message-Id: <20201230081916.63417-1-like.xu@linux.intel.com>
    Reviewed-by: Sean Christopherson <seanjc@google.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Like Xu authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    cb69f63 View commit details
    Browse the repository at this point in the history
  5. mt7601u: fix kernel crash unplugging the device

    commit 0acb20a upstream.
    
    The following crash log can occur unplugging the usb dongle since,
    after the urb poison in mt7601u_free_tx_queue(), usb_submit_urb() will
    always fail resulting in a skb kfree while the skb has been already
    queued.
    
    Fix the issue enqueuing the skb only if usb_submit_urb() succeed.
    
    Hardware name: Hewlett-Packard 500-539ng/2B2C, BIOS 80.06 04/01/2015
    Workqueue: usb_hub_wq hub_event
    RIP: 0010:skb_trim+0x2c/0x30
    RSP: 0000:ffffb4c88005bba8 EFLAGS: 00010206
    RAX: 000000004ad483ee RBX: ffff9a236625dee0 RCX: 000000000000662f
    RDX: 000000000000000c RSI: 0000000000000000 RDI: ffff9a2343179300
    RBP: ffff9a2343179300 R08: 0000000000000001 R09: 0000000000000000
    R10: ffff9a23748f7840 R11: 0000000000000001 R12: ffff9a236625e4d4
    R13: ffff9a236625dee0 R14: 0000000000001080 R15: 0000000000000008
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007fd410a34ef8 CR3: 00000001416ee001 CR4: 00000000001706f0
    Call Trace:
     mt7601u_tx_status+0x3e/0xa0 [mt7601u]
     mt7601u_dma_cleanup+0xca/0x110 [mt7601u]
     mt7601u_cleanup+0x22/0x30 [mt7601u]
     mt7601u_disconnect+0x22/0x60 [mt7601u]
     usb_unbind_interface+0x8a/0x270
     ? kernfs_find_ns+0x35/0xd0
     __device_release_driver+0x17a/0x230
     device_release_driver+0x24/0x30
     bus_remove_device+0xdb/0x140
     device_del+0x18b/0x430
     ? kobject_put+0x98/0x1d0
     usb_disable_device+0xc6/0x1f0
     usb_disconnect.cold+0x7e/0x20a
     hub_event+0xbf3/0x1870
     process_one_work+0x1b6/0x350
     worker_thread+0x53/0x3e0
     ? process_one_work+0x350/0x350
     kthread+0x11b/0x140
     ? __kthread_bind_mask+0x60/0x60
     ret_from_fork+0x22/0x30
    
    Fixes: 23377c2 ("mt7601u: fix possible memory leak when the device is disconnected")
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Acked-by: Jakub Kicinski <kubakici@wp.pl>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/3b85219f669a63a8ced1f43686de05915a580489.1610919247.git.lorenzo@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    LorenzoBianconi authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    6f798ba View commit details
    Browse the repository at this point in the history
  6. mt7601u: fix rx buffer refcounting

    commit d24c790 upstream.
    
    Fix the following crash due to erroneous page refcounting:
    
    [   32.445919] BUG: Bad page state in process swapper/1  pfn:11f65a
    [   32.447409] page:00000000938f0632 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x11f65a
    [   32.449605] flags: 0x8000000000000000()
    [   32.450421] raw: 8000000000000000 ffffffff825b0148 ffffea00045ae988 0000000000000000
    [   32.451795] raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000
    [   32.452999] page dumped because: nonzero mapcount
    [   32.453888] Modules linked in:
    [   32.454492] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.11.0-rc2+ #1976
    [   32.455695] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-1.fc33 04/01/2014
    [   32.457157] Call Trace:
    [   32.457636]  <IRQ>
    [   32.457993]  dump_stack+0x77/0x97
    [   32.458576]  bad_page.cold+0x65/0x96
    [   32.459198]  get_page_from_freelist+0x46a/0x11f0
    [   32.460008]  __alloc_pages_nodemask+0x10a/0x2b0
    [   32.460794]  mt7601u_rx_tasklet+0x651/0x720
    [   32.461505]  tasklet_action_common.constprop.0+0x6b/0xd0
    [   32.462343]  __do_softirq+0x152/0x46c
    [   32.462928]  asm_call_irq_on_stack+0x12/0x20
    [   32.463610]  </IRQ>
    [   32.463953]  do_softirq_own_stack+0x5b/0x70
    [   32.464582]  irq_exit_rcu+0x9f/0xe0
    [   32.465028]  common_interrupt+0xae/0x1a0
    [   32.465536]  asm_common_interrupt+0x1e/0x40
    [   32.466071] RIP: 0010:default_idle+0x18/0x20
    [   32.468981] RSP: 0018:ffffc90000077f00 EFLAGS: 00000246
    [   32.469648] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
    [   32.470550] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff81aac3dd
    [   32.471463] RBP: ffff88810022ab00 R08: 0000000000000001 R09: 0000000000000001
    [   32.472335] R10: 0000000000000046 R11: 0000000000005aa0 R12: 0000000000000000
    [   32.473235] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
    [   32.474139]  ? default_idle_call+0x4d/0x200
    [   32.474681]  default_idle_call+0x74/0x200
    [   32.475192]  do_idle+0x1d5/0x250
    [   32.475612]  cpu_startup_entry+0x19/0x20
    [   32.476114]  secondary_startup_64_no_verify+0xb0/0xbb
    [   32.476765] Disabling lock debugging due to kernel taint
    
    Fixes: c869f77 ("add mt7601u driver")
    Co-developed-by: Felix Fietkau <nbd@nbd.name>
    Signed-off-by: Felix Fietkau <nbd@nbd.name>
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Acked-by: Jakub Kicinski <kubakici@wp.pl>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/62b2380c8c2091834cfad05e1059b55f945bd114.1610643952.git.lorenzo@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    LorenzoBianconi authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    beffdc1 View commit details
    Browse the repository at this point in the history
  7. y2038: futex: Move compat implementation into futex.c

    commit 04e7712 upstream.
    
    We are going to share the compat_sys_futex() handler between 64-bit
    architectures and 32-bit architectures that need to deal with both 32-bit
    and 64-bit time_t, and this is easier if both entry points are in the
    same file.
    
    In fact, most other system call handlers do the same thing these days, so
    let's follow the trend here and merge all of futex_compat.c into futex.c.
    
    In the process, a few minor changes have to be done to make sure everything
    still makes sense: handle_futex_death() and futex_cmpxchg_enabled() become
    local symbol, and the compat version of the fetch_robust_entry() function
    gets renamed to compat_fetch_robust_entry() to avoid a symbol clash.
    
    This is intended as a purely cosmetic patch, no behavior should
    change.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [Lee: Back-ported to satisfy a build dependency]
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    arndb authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    ad940f6 View commit details
    Browse the repository at this point in the history
  8. futex: Move futex exit handling into futex code

    commit ba31c1a upstream.
    
    The futex exit handling is #ifdeffed into mm_release() which is not pretty
    to begin with. But upcoming changes to address futex exit races need to add
    more functionality to this exit code.
    
    Split it out into a function, move it into futex code and make the various
    futex exit functions static.
    
    Preparatory only and no functional change.
    
    Folded build fix from Borislav.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.049705556@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    8d2b511 View commit details
    Browse the repository at this point in the history
  9. futex: Replace PF_EXITPIDONE with a state

    commit 3d4775d upstream.
    
    The futex exit handling relies on PF_ flags. That's suboptimal as it
    requires a smp_mb() and an ugly lock/unlock of the exiting tasks pi_lock in
    the middle of do_exit() to enforce the observability of PF_EXITING in the
    futex code.
    
    Add a futex_state member to task_struct and convert the PF_EXITPIDONE logic
    over to the new state. The PF_EXITING dependency will be cleaned up in a
    later step.
    
    This prepares for handling various futex exit issues later.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.149449274@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    0838b82 View commit details
    Browse the repository at this point in the history
  10. exit/exec: Seperate mm_release()

    commit 4610ba7 upstream.
    
    mm_release() contains the futex exit handling. mm_release() is called from
    do_exit()->exit_mm() and from exec()->exec_mm().
    
    In the exit_mm() case PF_EXITING and the futex state is updated. In the
    exec_mm() case these states are not touched.
    
    As the futex exit code needs further protections against exit races, this
    needs to be split into two functions.
    
    Preparatory only, no functional change.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.240518241@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    93d2eb4 View commit details
    Browse the repository at this point in the history
  11. futex: Split futex_mm_release() for exit/exec

    commit 150d715 upstream.
    
    To allow separate handling of the futex exit state in the futex exit code
    for exit and exec, split futex_mm_release() into two functions and invoke
    them from the corresponding exit/exec_mm_release() callsites.
    
    Preparatory only, no functional change.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.332094221@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    7493738 View commit details
    Browse the repository at this point in the history
  12. futex: Set task::futex_state to DEAD right after handling futex exit

    commit f24f224 upstream.
    
    Setting task::futex_state in do_exit() is rather arbitrarily placed for no
    reason. Move it into the futex code.
    
    Note, this is only done for the exit cleanup as the exec cleanup cannot set
    the state to FUTEX_STATE_DEAD because the task struct is still in active
    use.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.439511191@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    da81e2f View commit details
    Browse the repository at this point in the history
  13. futex: Mark the begin of futex exit explicitly

    commit 18f6943 upstream.
    
    Instead of relying on PF_EXITING use an explicit state for the futex exit
    and set it in the futex exit function. This moves the smp barrier and the
    lock/unlock serialization into the futex code.
    
    As with the DEAD state this is restricted to the exit path as exec
    continues to use the same task struct.
    
    This allows to simplify that logic in a next step.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.539409004@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    40da511 View commit details
    Browse the repository at this point in the history
  14. futex: Sanitize exit state handling

    commit 4a8e991 upstream.
    
    Instead of having a smp_mb() and an empty lock/unlock of task::pi_lock move
    the state setting into to the lock section.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.645603214@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    6eaebab View commit details
    Browse the repository at this point in the history
  15. futex: Provide state handling for exec() as well

    commit af8cbda upstream.
    
    exec() attempts to handle potentially held futexes gracefully by running
    the futex exit handling code like exit() does.
    
    The current implementation has no protection against concurrent incoming
    waiters. The reason is that the futex state cannot be set to
    FUTEX_STATE_DEAD after the cleanup because the task struct is still active
    and just about to execute the new binary.
    
    While its arguably buggy when a task holds a futex over exec(), for
    consistency sake the state handling can at least cover the actual futex
    exit cleanup section. This provides state consistency protection accross
    the cleanup. As the futex state of the task becomes FUTEX_STATE_OK after the
    cleanup has been finished, this cannot prevent subsequent attempts to
    attach to the task in case that the cleanup was not successfull in mopping
    up all leftovers.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.753355618@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    39947bf View commit details
    Browse the repository at this point in the history
  16. futex: Add mutex around futex exit

    commit 3f186d9 upstream.
    
    The mutex will be used in subsequent changes to replace the busy looping of
    a waiter when the futex owner is currently executing the exit cleanup to
    prevent a potential live lock.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.845798895@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    26f05b3 View commit details
    Browse the repository at this point in the history
  17. futex: Provide distinct return value when owner is exiting

    commit ac31c7f upstream.
    
    attach_to_pi_owner() returns -EAGAIN for various cases:
    
     - Owner task is exiting
     - Futex value has changed
    
    The caller drops the held locks (hash bucket, mmap_sem) and retries the
    operation. In case of the owner task exiting this can result in a live
    lock.
    
    As a preparatory step for seperating those cases, provide a distinct return
    value (EBUSY) for the owner exiting case.
    
    No functional change.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lkml.kernel.org/r/20191106224556.935606117@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    aa2f795 View commit details
    Browse the repository at this point in the history
  18. futex: Prevent exit livelock

    commit 3ef240e upstream.
    
    Oleg provided the following test case:
    
    int main(void)
    {
    	struct sched_param sp = {};
    
    	sp.sched_priority = 2;
    	assert(sched_setscheduler(0, SCHED_FIFO, &sp) == 0);
    
    	int lock = vfork();
    	if (!lock) {
    		sp.sched_priority = 1;
    		assert(sched_setscheduler(0, SCHED_FIFO, &sp) == 0);
    		_exit(0);
    	}
    
    	syscall(__NR_futex, &lock, FUTEX_LOCK_PI, 0,0,0);
    	return 0;
    }
    
    This creates an unkillable RT process spinning in futex_lock_pi() on a UP
    machine or if the process is affine to a single CPU. The reason is:
    
     parent	    	    			child
    
      set FIFO prio 2
    
      vfork()			->	set FIFO prio 1
       implies wait_for_child()	 	sched_setscheduler(...)
     			   		exit()
    					do_exit()
     					....
    					mm_release()
    					  tsk->futex_state = FUTEX_STATE_EXITING;
    					  exit_futex(); (NOOP in this case)
    					  complete() --> wakes parent
      sys_futex()
        loop infinite because
        tsk->futex_state == FUTEX_STATE_EXITING
    
    The same problem can happen just by regular preemption as well:
    
      task holds futex
      ...
      do_exit()
        tsk->futex_state = FUTEX_STATE_EXITING;
    
      --> preemption (unrelated wakeup of some other higher prio task, e.g. timer)
    
      switch_to(other_task)
    
      return to user
      sys_futex()
    	loop infinite as above
    
    Just for the fun of it the futex exit cleanup could trigger the wakeup
    itself before the task sets its futex state to DEAD.
    
    To cure this, the handling of the exiting owner is changed so:
    
       - A refcount is held on the task
    
       - The task pointer is stored in a caller visible location
    
       - The caller drops all locks (hash bucket, mmap_sem) and blocks
         on task::futex_exit_mutex. When the mutex is acquired then
         the exiting task has completed the cleanup and the state
         is consistent and can be reevaluated.
    
    This is not a pretty solution, but there is no choice other than returning
    an error code to user space, which would break the state consistency
    guarantee and open another can of problems including regressions.
    
    For stable backports the preparatory commits ac31c7f .. ba31c1a
    are required as well, but for anything older than 5.3.y the backports are
    going to be provided when this hits mainline as the other dependencies for
    those kernels are definitely not stable material.
    
    Fixes: 778e9a9 ("pi-futex: fix exit races and locking problems")
    Reported-by: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Stable Team <stable@vger.kernel.org>
    Link: https://lkml.kernel.org/r/20191106224557.041676471@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    f2a9957 View commit details
    Browse the repository at this point in the history
  19. ARM: imx: build suspend-imx6.S with arm instruction set

    commit a88afa4 upstream.
    
    When the kernel is configured to use the Thumb-2 instruction set
    "suspend-to-memory" fails to resume. Observed on a Colibri iMX6ULL
    (i.MX 6ULL) and Apalis iMX6 (i.MX 6Q).
    
    It looks like the CPU resumes unconditionally in ARM instruction mode
    and then chokes on the presented Thumb-2 code it should execute.
    
    Fix this by using the arm instruction set for all code in
    suspend-imx6.S.
    
    Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
    Fixes: df59574 ("ARM: imx: add suspend in ocram support for i.mx6q")
    Acked-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    MaxKrummenacher authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    73acc9b View commit details
    Browse the repository at this point in the history
  20. netfilter: nft_dynset: add timeout extension to template

    commit 0c5b7a5 upstream.
    
    Otherwise, the newly create element shows no timeout when listing the
    ruleset. If the set definition does not specify a default timeout, then
    the set element only shows the expiration time, but not the timeout.
    This is a problem when restoring a stateful ruleset listing since it
    skips the timeout policy entirely.
    
    Fixes: 22fe54d ("netfilter: nf_tables: add support for dynamic set updates")
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ummakynes authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    bb3c0b3 View commit details
    Browse the repository at this point in the history
  21. xfrm: Fix oops in xfrm_replay_advance_bmp

    [ Upstream commit 56ce7c2 ]
    
    When setting xfrm replay_window to values higher than 32, a rare
    page-fault occurs in xfrm_replay_advance_bmp:
    
      BUG: unable to handle page fault for address: ffff8af350ad7920
      #PF: supervisor write access in kernel mode
      #PF: error_code(0x0002) - not-present page
      PGD ad001067 P4D ad001067 PUD 0
      Oops: 0002 [whatawurst#1] SMP PTI
      CPU: 3 PID: 30 Comm: ksoftirqd/3 Kdump: loaded Not tainted 5.4.52-050452-generic #202007160732
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014
      RIP: 0010:xfrm_replay_advance_bmp+0xbb/0x130
      RSP: 0018:ffffa1304013ba40 EFLAGS: 00010206
      RAX: 000000000000010d RBX: 0000000000000002 RCX: 00000000ffffff4b
      RDX: 0000000000000018 RSI: 00000000004c234c RDI: 00000000ffb3dbff
      RBP: ffffa1304013ba50 R08: ffff8af330ad7920 R09: 0000000007fffffa
      R10: 0000000000000800 R11: 0000000000000010 R12: ffff8af29d6258c0
      R13: ffff8af28b95c700 R14: 0000000000000000 R15: ffff8af29d6258fc
      FS:  0000000000000000(0000) GS:ffff8af339ac0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffff8af350ad7920 CR3: 0000000015ee4000 CR4: 00000000001406e0
      Call Trace:
       xfrm_input+0x4e5/0xa10
       xfrm4_rcv_encap+0xb5/0xe0
       xfrm4_udp_encap_rcv+0x140/0x1c0
    
    Analysis revealed offending code is when accessing:
    
    	replay_esn->bmp[nr] |= (1U << bitnr);
    
    with 'nr' being 0x07fffffa.
    
    This happened in an SMP system when reordering of packets was present;
    A packet arrived with a "too old" sequence number (outside the window,
    i.e 'diff > replay_window'), and therefore the following calculation:
    
    			bitnr = replay_esn->replay_window - (diff - pos);
    
    yields a negative result, but since bitnr is u32 we get a large unsigned
    quantity (in crash dump above: 0xffffff4b seen in ecx).
    
    This was supposed to be protected by xfrm_input()'s former call to:
    
    		if (x->repl->check(x, skb, seq)) {
    
    However, the state's spinlock x->lock is *released* after '->check()'
    is performed, and gets re-acquired before '->advance()' - which gives a
    chance for a different core to update the xfrm state, e.g. by advancing
    'replay_esn->seq' when it encounters more packets - leading to a
    'diff > replay_window' situation when original core continues to
    xfrm_replay_advance_bmp().
    
    An attempt to fix this issue was suggested in commit bcf66bf
    ("xfrm: Perform a replay check after return from async codepaths"),
    by calling 'x->repl->recheck()' after lock is re-acquired, but fix
    applied only to asyncronous crypto algorithms.
    
    Augment the fix, by *always* calling 'recheck()' - irrespective if we're
    using async crypto.
    
    Fixes: 0ebea8e ("[IPSEC]: Move state lock into x->type->input")
    Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Shmulik Ladkani authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    bdf1634 View commit details
    Browse the repository at this point in the history
  22. RDMA/cxgb4: Fix the reported max_recv_sge value

    [ Upstream commit a372173 ]
    
    The max_recv_sge value is wrongly reported when calling query_qp, This is
    happening due to a typo when assigning the max_recv_sge value, the value
    of sq_max_sges was assigned instead of rq_max_sges.
    
    Fixes: 3e5c02c ("iw_cxgb4: Support query_qp() verb")
    Link: https://lore.kernel.org/r/20210114191423.423529-1-kamalheib1@gmail.com
    Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
    Reviewed-by: Potnuri Bharat Teja <bharat@chelsio.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Kamalheib authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    8b97c8c View commit details
    Browse the repository at this point in the history
  23. mac80211: pause TX while changing interface type

    [ Upstream commit 054c993 ]
    
    syzbot reported a crash that happened when changing the interface
    type around a lot, and while it might have been easy to fix just
    the symptom there, a little deeper investigation found that really
    the reason is that we allowed packets to be transmitted while in
    the middle of changing the interface type.
    
    Disallow TX by stopping the queues while changing the type.
    
    Fixes: 34d4bc4 ("mac80211: support runtime interface type changes")
    Reported-by: syzbot+d7a3b15976bf7de2238a@syzkaller.appspotmail.com
    Link: https://lore.kernel.org/r/20210122171115.b321f98f4d4f.I6997841933c17b093535c31d29355be3c0c39628@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    jmberg-intel authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    9f1f71f View commit details
    Browse the repository at this point in the history
  24. can: dev: prevent potential information leak in can_fill_info()

    [ Upstream commit b552766 ]
    
    The "bec" struct isn't necessarily always initialized. For example, the
    mcp251xfd_get_berr_counter() function doesn't initialize anything if the
    interface is down.
    
    Fixes: 52c793f ("can: netlink support for bus-error reporting and counters")
    Link: https://lore.kernel.org/r/YAkaRdRJncsJO8Ve@mwanda
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Dan Carpenter authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    ee607ba View commit details
    Browse the repository at this point in the history
  25. iommu/vt-d: Gracefully handle DMAR units with no supported address wi…

    …dths
    
    commit c40aaaa upstream.
    
    Instead of bailing out completely, such a unit can still be used for
    interrupt remapping.
    
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
    Link: https://lore.kernel.org/linux-iommu/549928db2de6532117f36c9c810373c14cf76f51.camel@infradead.org/
    Signed-off-by: Joerg Roedel <jroedel@suse.de>
    [ - context change due to moving drivers/iommu/dmar.c to
        drivers/iommu/intel/dmar.c
      - remove the unused err_unmap label
      - use iommu->iommu_dev instead of iommu->iommu.ops to decide whether
        when freeing ]
    Signed-off-by: Filippo Sironi <sironi@amazon.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    dwmw2 authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    e4f10ae View commit details
    Browse the repository at this point in the history
  26. iommu/vt-d: Don't dereference iommu_device if IOMMU_API is not built

    commit 9def3b1 upstream.
    
    Since commit c40aaaa ("iommu/vt-d: Gracefully handle DMAR units
    with no supported address widths") dmar.c needs struct iommu_device to
    be selected. We can drop this dependency by not dereferencing struct
    iommu_device if IOMMU_API is not selected and by reusing the information
    stored in iommu->drhd->ignored instead.
    
    This fixes the following build error when IOMMU_API is not selected:
    
    drivers/iommu/dmar.c: In function ‘free_iommu’:
    drivers/iommu/dmar.c:1139:41: error: ‘struct iommu_device’ has no member named ‘ops’
     1139 |  if (intel_iommu_enabled && iommu->iommu.ops) {
                                                    ^
    
    Fixes: c40aaaa ("iommu/vt-d: Gracefully handle DMAR units with no supported address widths")
    Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
    Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
    Acked-by: David Woodhouse <dwmw@amazon.co.uk>
    Link: https://lore.kernel.org/r/20201013073055.11262-1-brgl@bgdev.pl
    Signed-off-by: Joerg Roedel <jroedel@suse.de>
    [ - context change due to moving drivers/iommu/dmar.c to
        drivers/iommu/intel/dmar.c
      - set the drhr in the iommu like in upstream commit b1012ca
        ("iommu/vt-d: Skip TE disabling on quirky gfx dedicated iommu") ]
    Signed-off-by: Filippo Sironi <sironi@amazon.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    brgl authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    cf682c5 View commit details
    Browse the repository at this point in the history
  27. NFC: fix resource leak when target index is invalid

    commit 3a30537 upstream.
    
    Goto to the label put_dev instead of the label error to fix potential
    resource leak on path that the target index is invalid.
    
    Fixes: c4fbb65 ("NFC: The core part should generate the target index")
    Signed-off-by: Pan Bian <bianpan2016@163.com>
    Link: https://lore.kernel.org/r/20210121152748.98409-1-bianpan2016@163.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    SinkFinder authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    074013e View commit details
    Browse the repository at this point in the history
  28. NFC: fix possible resource leak

    commit d8f923c upstream.
    
    Put the device to avoid resource leak on path that the polling flag is
    invalid.
    
    Fixes: a831b91 ("NFC: Do not return EBUSY when stopping a poll that's already stopped")
    Signed-off-by: Pan Bian <bianpan2016@163.com>
    Link: https://lore.kernel.org/r/20210121153745.122184-1-bianpan2016@163.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    SinkFinder authored and gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    b6dac2c View commit details
    Browse the repository at this point in the history
  29. Linux 4.4.255

    Tested-by: Pavel Machek (CIP) <pavel@denx.de>
    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
    Tested-by: Shuah Khan <skhan@linuxfoundation.org>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Link: https://lore.kernel.org/r/20210202132941.180062901@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    gregkh committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    2f9c581 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2021

  1. Merge Linux 4.4.255 kernel

    Changes in 4.4.255: (29 commits)
            ACPI: sysfs: Prefer "compatible" modalias
            wext: fix NULL-ptr-dereference with cfg80211's lack of commit()
            net: usb: qmi_wwan: added support for Thales Cinterion PLSx3 modem family
            KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[]
            mt7601u: fix kernel crash unplugging the device
            mt7601u: fix rx buffer refcounting
            y2038: futex: Move compat implementation into futex.c
            futex: Move futex exit handling into futex code
            futex: Replace PF_EXITPIDONE with a state
            exit/exec: Seperate mm_release()
            futex: Split futex_mm_release() for exit/exec
            futex: Set task::futex_state to DEAD right after handling futex exit
            futex: Mark the begin of futex exit explicitly
            futex: Sanitize exit state handling
            futex: Provide state handling for exec() as well
            futex: Add mutex around futex exit
            futex: Provide distinct return value when owner is exiting
            futex: Prevent exit livelock
            ARM: imx: build suspend-imx6.S with arm instruction set
            netfilter: nft_dynset: add timeout extension to template
            xfrm: Fix oops in xfrm_replay_advance_bmp
            RDMA/cxgb4: Fix the reported max_recv_sge value
            mac80211: pause TX while changing interface type
            can: dev: prevent potential information leak in can_fill_info()
            iommu/vt-d: Gracefully handle DMAR units with no supported address widths
            iommu/vt-d: Don't dereference iommu_device if IOMMU_API is not built
            NFC: fix resource leak when target index is invalid
            NFC: fix possible resource leak
            Linux 4.4.255
    
    Conflicts:
    	kernel/exit.c
    derfelot committed Feb 5, 2021
    Configuration menu
    Copy the full SHA
    881204a View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2021

  1. crypto: qce50: fix llvm compilation warnings

    Compiling kernel with upstream LLVM tool chain
    gives warning related to bool operator.
    
    Change-Id: I0291d7ca7df9141df68305746242cb7c9384d3c7
    Signed-off-by: Vijayakumar Badiger <vbadig@codeaurora.org>
    Vijayakumar Badiger authored and derfelot committed Feb 7, 2021
    Configuration menu
    Copy the full SHA
    c3e2516 View commit details
    Browse the repository at this point in the history