20 Jan, 2021

2 commits

  • commit 29b665cc51e8b602bf2a275734349494776e3dbc upstream.

    Some extent io trees are initialized with NULL private member (e.g.
    btrfs_device::alloc_state and btrfs_fs_info::excluded_extents).
    Dereference of a NULL tree->private as inode pointer will cause panic.

    Pass tree->fs_info as it's known to be valid in all cases.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=208929
    Fixes: 05912a3c04eb ("btrfs: drop extent_io_ops::tree_fs_info callback")
    CC: stable@vger.kernel.org # 4.19+
    Reviewed-by: Anand Jain
    Signed-off-by: Su Yue
    Reviewed-by: David Sterba
    Signed-off-by: David Sterba
    Signed-off-by: Greg Kroah-Hartman

    Su Yue
     
  • commit 50e31ef486afe60f128d42fb9620e2a63172c15c upstream.

    [BUG]
    There are several bug reports about recent kernel unable to relocate
    certain data block groups.

    Sometimes the error just goes away, but there is one reporter who can
    reproduce it reliably.

    The dmesg would look like:

    [438.260483] BTRFS info (device dm-10): balance: start -dvrange=34625344765952..34625344765953
    [438.269018] BTRFS info (device dm-10): relocating block group 34625344765952 flags data|raid1
    [450.439609] BTRFS info (device dm-10): found 167 extents, stage: move data extents
    [463.501781] BTRFS info (device dm-10): balance: ended with status: -2

    [CAUSE]
    The ENOENT error is returned from the following call chain:

    add_data_references()
    |- delete_v1_space_cache();
    |- if (!found)
    return -ENOENT;

    The variable @found is set to true if we find a data extent whose
    disk bytenr matches parameter @data_bytes.

    With extra debugging, the offending tree block looks like this:

    leaf bytenr = 42676709441536, data_bytenr = 34626327621632

    ctime 1567904822.739884119 (2019-09-08 03:07:02)
    mtime 0.0 (1970-01-01 01:00:00)
    otime 0.0 (1970-01-01 01:00:00)
    item 27 key (51933 EXTENT_DATA 0) itemoff 9854 itemsize 53
    generation 1517381 type 2 (prealloc)
    prealloc data disk byte 34626327621632 nr 262144 <<<
    prealloc data offset 0 nr 262144
    item 28 key (52262 ROOT_ITEM 0) itemoff 9415 itemsize 439
    generation 2618893 root_dirid 256 bytenr 42677048360960 level 3 refs 1
    lastsnap 2618893 byte_limit 0 bytes_used 5557338112 flags 0x0(none)
    uuid d0d4361f-d231-6d40-8901-fe506e4b2b53

    Although item 27 has disk bytenr 34626327621632, which matches the
    data_bytenr, its type is prealloc, not reg.
    This makes the existing code skip that item, and return ENOENT.

    [FIX]
    The code is modified in commit 19b546d7a1b2 ("btrfs: relocation: Use
    btrfs_find_all_leafs to locate data extent parent tree leaves"), before
    that commit, we use something like

    "if (type == BTRFS_FILE_EXTENT_INLINE) continue;"

    But in that offending commit, we use (type == BTRFS_FILE_EXTENT_REG),
    ignoring BTRFS_FILE_EXTENT_PREALLOC.

    Fix it by also checking BTRFS_FILE_EXTENT_PREALLOC.

    Reported-by: Stéphane Lesimple
    Link: https://lore.kernel.org/linux-btrfs/505cabfa88575ed6dbe7cb922d8914fb@lesimple.fr
    Fixes: 19b546d7a1b2 ("btrfs: relocation: Use btrfs_find_all_leafs to locate data extent parent tree leaves")
    CC: stable@vger.kernel.org # 5.6+
    Tested-By: Stéphane Lesimple
    Reviewed-by: Su Yue
    Signed-off-by: Qu Wenruo
    Reviewed-by: David Sterba
    Signed-off-by: David Sterba
    Signed-off-by: Greg Kroah-Hartman

    Qu Wenruo
     

17 Jan, 2021

38 commits

  • Tested-by: Jon Hunter
    Tested-by: Shuah Khan
    Tested-by: Guenter Roeck
    Tested-by: Linux Kernel Functional Testing
    Tested-by: Pavel Machek (CIP)
    Link: https://lore.kernel.org/r/20210115122006.047132306@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • commit 4a443a51776ca9847942523cf987a330894d3a31 upstream.

    To pick the changes from:

    3ceb6543e9cf6ed8 ("fscrypt: remove kernel-internal constants from UAPI header")

    That don't result in any changes in tooling, just addressing this perf
    build warning:

    Warning: Kernel ABI header at 'tools/include/uapi/linux/fscrypt.h' differs from latest version at 'include/uapi/linux/fscrypt.h'
    diff -u tools/include/uapi/linux/fscrypt.h include/uapi/linux/fscrypt.h

    Cc: Adrian Hunter
    Cc: Eric Biggers
    Cc: Ian Rogers
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Greg Kroah-Hartman

    Arnaldo Carvalho de Melo
     
  • commit 7d6763ab77b3c047cf7d31ca7c4b799808a684a6 upstream.

    Commit a17d609e3e21 ("drm/panfrost: Don't corrupt the queue mutex on
    open/close") left unused variables behind, thus generating a warning
    at compilation time. Remove those variables.

    Fixes: a17d609e3e21 ("drm/panfrost: Don't corrupt the queue mutex on open/close")
    Signed-off-by: Boris Brezillon
    Reviewed-by: Steven Price
    Link: https://patchwork.freedesktop.org/patch/msgid/20201101173817.831769-1-boris.brezillon@collabora.com
    Signed-off-by: Greg Kroah-Hartman

    Boris Brezillon
     
  • commit f6bcb4c7f366905b66ce8ffca7190118244bb642 upstream.

    This code will leak "map->debugfs_name" because the if statement is
    reversed so it only frees NULL pointers instead of non-NULL. In
    fact the if statement is not required and should just be removed
    because kfree() accepts NULL pointers.

    Fixes: cffa4b2122f5 ("regmap: debugfs: Fix a memory leak when calling regmap_attach_dev")
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/X/RQpfAwRdLg0GqQ@mwanda
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 54970a2fbb673f090b7f02d7f57b10b2e0707155 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
    Acked-by: Willem de Bruijn
    Link: https://lore.kernel.org/r/1b2494af-2c56-8ee2-7bc0-923fcad1cdf8@virtuozzo.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Vasily Averin
     
  • commit aebf5db917055b38f4945ed6d621d9f07a44ff30 upstream.

    Make sure that bdgrab() is done on the 'block_device' instance before
    referring to it for avoiding use-after-free.

    Cc:
    Reported-by: syzbot+825f0f9657d4e528046e@syzkaller.appspotmail.com
    Signed-off-by: Ming Lei
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • commit b42b3a2744b3e8f427de79896720c72823af91ad upstream.

    Initialize the sockaddr_can structure to prevent a data leak to user space.

    Suggested-by: Cong Wang
    Reported-by: syzbot+057884e2f453e8afebc8@syzkaller.appspotmail.com
    Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol")
    Signed-off-by: Oliver Hartkopp
    Link: https://lore.kernel.org/r/20210112091643.11789-1-socketcan@hartkopp.net
    Signed-off-by: Marc Kleine-Budde
    Signed-off-by: Greg Kroah-Hartman

    Oliver Hartkopp
     
  • commit 3a21777c6ee99749bac10727b3c17e5bcfebe5c1 upstream.

    We had kernel panic, it is caused by unload module and last
    close confirmation.

    call trace:
    [1196029.743127] free_sess+0x15/0x50 [rtrs_client]
    [1196029.743128] rtrs_clt_close+0x4c/0x70 [rtrs_client]
    [1196029.743129] ? rnbd_clt_unmap_device+0x1b0/0x1b0 [rnbd_client]
    [1196029.743130] close_rtrs+0x25/0x50 [rnbd_client]
    [1196029.743131] rnbd_client_exit+0x93/0xb99 [rnbd_client]
    [1196029.743132] __x64_sys_delete_module+0x190/0x260

    And in the crashdump confirmation kworker is also running.
    PID: 6943 TASK: ffff9e2ac8098000 CPU: 4 COMMAND: "kworker/4:2"
    #0 [ffffb206cf337c30] __schedule at ffffffff9f93f891
    #1 [ffffb206cf337cc8] schedule at ffffffff9f93fe98
    #2 [ffffb206cf337cd0] schedule_timeout at ffffffff9f943938
    #3 [ffffb206cf337d50] wait_for_completion at ffffffff9f9410a7
    #4 [ffffb206cf337da0] __flush_work at ffffffff9f08ce0e
    #5 [ffffb206cf337e20] rtrs_clt_close_conns at ffffffffc0d5f668 [rtrs_client]
    #6 [ffffb206cf337e48] rtrs_clt_close at ffffffffc0d5f801 [rtrs_client]
    #7 [ffffb206cf337e68] close_rtrs at ffffffffc0d26255 [rnbd_client]
    #8 [ffffb206cf337e78] free_sess at ffffffffc0d262ad [rnbd_client]
    #9 [ffffb206cf337e88] rnbd_clt_put_dev at ffffffffc0d266a7 [rnbd_client]

    The problem is both code path try to close same session, which lead to
    panic.

    To fix it, just skip the sess if the refcount already drop to 0.

    Fixes: f7a7a5c228d4 ("block/rnbd: client: main functionality")
    Signed-off-by: Jack Wang
    Reviewed-by: Gioh Kim
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Jack Wang
     
  • commit b1b95cb5c0a9694d47d5f845ba97e226cfda957d upstream.

    Rollback the reservation in the completion ring when we get a
    NETDEV_TX_BUSY. When this error is received from the driver, we are
    supposed to let the user application retry the transmit again. And in
    order to do this, we need to roll back the failed send so it can be
    retried. Unfortunately, we did not cancel the reservation we had made
    in the completion ring. By not doing this, we actually make the
    completion ring one entry smaller per NETDEV_TX_BUSY error we get, and
    after enough of these errors the completion ring will be of size zero
    and transmit will stop working.

    Fix this by cancelling the reservation when we get a NETDEV_TX_BUSY
    error.

    Fixes: 642e450b6b59 ("xsk: Do not discard packet when NETDEV_TX_BUSY")
    Reported-by: Xuan Zhuo
    Signed-off-by: Magnus Karlsson
    Signed-off-by: Daniel Borkmann
    Acked-by: Björn Töpel
    Link: https://lore.kernel.org/bpf/20201218134525.13119-3-magnus.karlsson@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Magnus Karlsson
     
  • commit f09ced4053bc0a2094a12b60b646114c966ef4c6 upstream.

    Fix a race when multiple sockets are simultaneously calling sendto()
    when the completion ring is shared in the SKB case. This is the case
    when you share the same netdev and queue id through the
    XDP_SHARED_UMEM bind flag. The problem is that multiple processes can
    be in xsk_generic_xmit() and call the backpressure mechanism in
    xskq_prod_reserve(xs->pool->cq). As this is a shared resource in this
    specific scenario, a race might occur since the rings are
    single-producer single-consumer.

    Fix this by moving the tx_completion_lock from the socket to the pool
    as the pool is shared between the sockets that share the completion
    ring. (The pool is not shared when this is not the case.) And then
    protect the accesses to xskq_prod_reserve() with this lock. The
    tx_completion_lock is renamed cq_lock to better reflect that it
    protects accesses to the potentially shared completion ring.

    Fixes: 35fcde7f8deb ("xsk: support for Tx")
    Reported-by: Xuan Zhuo
    Signed-off-by: Magnus Karlsson
    Signed-off-by: Daniel Borkmann
    Acked-by: Björn Töpel
    Link: https://lore.kernel.org/bpf/20201218134525.13119-2-magnus.karlsson@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Magnus Karlsson
     
  • commit 2a5f1b67ec577fb1544b563086e0377f095f88e2 upstream.

    We reset the guest's view of PMCR_EL0 unconditionally, based on
    the host's view of this register. It is however legal for an
    implementation not to provide any PMU, resulting in an UNDEF.

    The obvious fix is to skip the reset of this shadow register
    when no PMU is available, sidestepping the issue entirely.
    If no PMU is available, the guest is not able to request
    a virtual PMU anyway, so not doing nothing is the right thing
    to do!

    It is unlikely that this bug can hit any HW implementation
    though, as they all provide a PMU. It has been found using nested
    virt with the host KVM not implementing the PMU itself.

    Fixes: ab9468340d2bc ("arm64: KVM: Add access handler for PMCR register")
    Reviewed-by: Alexandru Elisei
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20201210083059.1277162-1-maz@kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Marc Zyngier
     
  • commit a5c9ca76a1c61fb5e4c35de8eb25aa925b03c9e4 upstream.

    For IPv6 traffic, mausezahn needs to be invoked with '-6'. Otherwise an
    error is returned:

    # ip netns exec me mausezahn veth1 -B 2001:db8:101::2 -A 2001:db8:91::1 -c 0 -t tcp "dp=1-1023, flags=syn"
    Failed to set source IPv4 address. Please check if source is set to a valid IPv4 address.
    Invalid command line parameters!

    Fixes: 7c741868ceab ("selftests: Add torture tests to nexthop tests")
    Signed-off-by: Ido Schimmel
    Reviewed-by: Petr Machata
    Reviewed-by: David Ahern
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Ido Schimmel
     
  • commit 0d136f5cd9a7ba6ded7f8ff17e8b1ba680f37625 upstream.

    The error message says that "Jumbo frames are not supported on XDP", but
    the code checks for mtu > MVNETA_MAX_RX_BUF_SIZE, not mtu > 1500.

    Fix this error message.

    Signed-off-by: Marek Behún
    Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support")
    Cc: Lorenzo Bianconi
    Cc: Thomas Petazzoni
    Link: https://lore.kernel.org/r/20210105172333.21613-1-kabel@kernel.org
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Marek Behún
     
  • commit 9397d66212cdf7a21c66523f1583e5d63a609e84 upstream.

    Since multiple connectors may run intel_dp_aux_xfer conncurrently, a
    single global pm_qos does not suffice. (One connector may disable the
    dma-latency boost prematurely while the second is still depending on
    it.) Instead of a single global pm_qos, track the pm_qos request for
    each intel_dp.

    v2: Move the pm_qos setup/teardown to intel_dp_aux_init/fini

    Fixes: 9ee32fea5fe8 ("drm/i915: irq-drive the dp aux communication")
    Signed-off-by: Chris Wilson
    Cc: Ville Syrjälä
    Cc: Imre Deak
    Reviewed-by: Imre Deak
    Link: https://patchwork.freedesktop.org/patch/msgid/20201230202309.23982-1-chris@chris-wilson.co.uk
    (cherry picked from commit b3304591f14b437b6bccd8dbff06006c11837031)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Chris Wilson
     
  • commit 87508224485323ce2d4e7fb929ec80f51adcc238 upstream.

    Force link UP can be enabled by bootloader during tftpboot
    and breaks NFS support.
    Force link UP disabled during port init procedure.

    Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
    Signed-off-by: Stefan Chulski
    Acked-by: Marcin Wojtas
    Link: https://lore.kernel.org/r/1608216735-14501-1-git-send-email-stefanc@marvell.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Stefan Chulski
     
  • commit df6b92fa40050e59ea89784294bf6d04c0c47705 upstream.

    According to the datasheet pm8009's HFS515 regulators have 16mV
    resolution rather than declared 1.6 mV. Correct the resolution.

    Signed-off-by: Dmitry Baryshkov
    Fixes: 06369bcc15a1 ("regulator: qcom-rpmh: Add support for SM8150")
    Reviewed-by: Vinod Koul
    Link: https://lore.kernel.org/r/20201231122348.637917-3-dmitry.baryshkov@linaro.org
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Baryshkov
     
  • commit 45ba7b195a369f35cb39094fdb32efe5908b34ad upstream.

    Commit d82755b2e781 ("KVM: arm64: Kill off CONFIG_KVM_ARM_HOST") deletes
    CONFIG_KVM_ARM_HOST option, it should use CONFIG_KVM instead.

    Just remove CONFIG_KVM_ARM_HOST here.

    Fixes: d82755b2e781 ("KVM: arm64: Kill off CONFIG_KVM_ARM_HOST")
    Signed-off-by: Shannon Zhao
    Acked-by: Catalin Marinas
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/1609760324-92271-1-git-send-email-shannon.zhao@linux.alibaba.com
    Signed-off-by: Greg Kroah-Hartman

    Shannon Zhao
     
  • commit 69931e11288520c250152180ecf9b6ac5e6e40ed upstream.

    Without this, the driver runs into a link failure

    arm-linux-gnueabi-ld: drivers/net/wan/slic_ds26522.o: in function `slic_ds26522_probe':
    slic_ds26522.c:(.text+0x100c): undefined reference to `byte_rev_table'
    arm-linux-gnueabi-ld: slic_ds26522.c:(.text+0x1cdc): undefined reference to `byte_rev_table'
    arm-linux-gnueabi-ld: drivers/net/wan/slic_ds26522.o: in function `slic_write':
    slic_ds26522.c:(.text+0x1e4c): undefined reference to `byte_rev_table'

    Fixes: c37d4a0085c5 ("Maxim/driver: Add driver for maxim ds26522")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit cffa4b2122f5f3e53cf3d529bbc74651f95856d5 upstream.

    After initializing the regmap through
    syscon_regmap_lookup_by_compatible, then regmap_attach_dev to the
    device, because the debugfs_name has been allocated, there is no
    need to redistribute it again

    unreferenced object 0xd8399b80 (size 64):
    comm "swapper/0", pid 1, jiffies 4294937641 (age 278.590s)
    hex dump (first 32 bytes):
    64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72
    dummy-iomuxc-gpr
    40 32 30 65 34 30 30 30 00 7f 52 5b d8 7e 42 69
    @20e4000..R[.~Bi
    backtrace:
    [] kasprintf+0x2c/0x54
    [] regmap_debugfs_init+0xdc/0x2fc
    [] __regmap_init+0xc38/0xd88
    [] of_syscon_register+0x168/0x294
    [] device_node_get_regmap+0x6c/0x98
    [] imx6ul_init_machine+0x20/0x88
    [] customize_machine+0x1c/0x30
    [] do_one_initcall+0x80/0x3ac
    [] kernel_init_freeable+0x170/0x1f0
    [] kernel_init+0x8/0x120
    [] ret_from_fork+0x14/0x20
    [] 0x0

    Fixes: 9b947a13e7f6 ("regmap: use debugfs even when no device")
    Signed-off-by: Xiaolei Wang
    Link: https://lore.kernel.org/r/20201229105046.41984-1-xiaolei.wang@windriver.com
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Xiaolei Wang
     
  • commit 7a6eb072a9548492ead086f3e820e9aac71c7138 upstream.

    mlx5e_create_ttc_table_groups() frees ft->g on failure of
    kvzalloc(), but such failure will be caught by its caller
    in mlx5e_create_ttc_table() and ft->g will be freed again
    in mlx5e_destroy_flow_table(). The same issue also occurs
    in mlx5e_create_ttc_table_groups(). Set ft->g to NULL after
    kfree() to avoid double free.

    Fixes: 7b3722fa9ef6 ("net/mlx5e: Support RSS for GRE tunneled packets")
    Fixes: 33cfaaa8f36f ("net/mlx5e: Split the main flow steering table")
    Signed-off-by: Dinghao Liu
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Greg Kroah-Hartman

    Dinghao Liu
     
  • commit 5b0bb12c58ac7d22e05b5bfdaa30a116c8c32e32 upstream.

    When mlx5_create_flow_group() fails, ft->g should be
    freed just like when kvzalloc() fails. The caller of
    mlx5e_create_l2_table_groups() does not catch this
    issue on failure, which leads to memleak.

    Fixes: 33cfaaa8f36f ("net/mlx5e: Split the main flow steering table")
    Signed-off-by: Dinghao Liu
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Greg Kroah-Hartman

    Dinghao Liu
     
  • commit 5c11f7d9f843bdd24cd29b95401938bc3f168070 upstream.

    We may send a request (with or without its data) from two paths:

    1. From our I/O context nvme_tcp_io_work which is triggered from:
    - queue_rq
    - r2t reception
    - socket data_ready and write_space callbacks
    2. Directly from queue_rq if the send_list is empty (because we want to
    save the context switch associated with scheduling our io_work).

    However, given that now we have the send_mutex, we may run into a race
    condition where none of these contexts will send the pending payload to
    the controller. Both io_work send path and queue_rq send path
    opportunistically attempt to acquire the send_mutex however queue_rq only
    attempts to send a single request, and if io_work context fails to
    acquire the send_mutex it will complete without rescheduling itself.

    The race can trigger with the following sequence:

    1. queue_rq sends request (no incapsule data) and blocks
    2. RX path receives r2t - prepares data PDU to send, adds h2cdata PDU
    to the send_list and schedules io_work
    3. io_work triggers and cannot acquire the send_mutex - because of (1),
    ends without self rescheduling
    4. queue_rq completes the send, and completes

    ==> no context will send the h2cdata - timeout.

    Fix this by having queue_rq sending as much as it can from the send_list
    such that if it still has any left, its because the socket buffer is
    full and the socket write_space callback will trigger, thus guaranteeing
    that a context will be scheduled to send the h2cdata PDU.

    Fixes: db5ad6b7f8cd ("nvme-tcp: try to send request in queue_rq context")
    Reported-by: Potnuri Bharat Teja
    Reported-by: Samuel Jones
    Signed-off-by: Sagi Grimberg
    Tested-by: Potnuri Bharat Teja
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Greg Kroah-Hartman

    Sagi Grimberg
     
  • commit 6f02b540d7597f357bc6ee711346761045d4e108 upstream.

    For older glibc ~2.17, #include'ing both linux/if.h and net/if.h
    fails due to complaints about redefinition of interface flags:

    CC net.o
    In file included from net.c:13:0:
    /usr/include/linux/if.h:71:2: error: redeclaration of enumerator ‘IFF_UP’
    IFF_UP = 1< resolves the issue and it is
    not needed for compilation anyhow.

    [1] https://lore.kernel.org/netdev/1461512707-23058-1-git-send-email-mikko.rapeli__34748.27880641$1462831734$gmane$org@iki.fi/

    Fixes: f6f3bac08ff9 ("tools/bpf: bpftool: add net support")
    Signed-off-by: Alan Maguire
    Signed-off-by: Andrii Nakryiko
    Acked-by: Martin KaFai Lau
    Link: https://lore.kernel.org/bpf/1609948746-15369-1-git-send-email-alan.maguire@oracle.com
    Signed-off-by: Greg Kroah-Hartman

    Alan Maguire
     
  • commit ff2b46d7cff80d27d82f7f3252711f4ca1666129 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: b106ee63abcc ("irq_remapping/vt-d: Enhance Intel IR driver to support hierarchical irqdomains")
    Signed-off-by: Dinghao Liu
    Acked-by: Lu Baolu
    Link: https://lore.kernel.org/r/20210105051837.32118-1-dinghao.liu@zju.edu.cn
    Signed-off-by: Will Deacon
    Signed-off-by: Greg Kroah-Hartman

    Dinghao Liu
     
  • commit 1efd17e7acb6692bffc6c58718f41f27fdfd62f5 upstream.

    Use IS_ALIGNED() instead. Otherwise, an unaligned address will be ignored.

    Fixes: 33cd6e642d6a ("iommu/vt-d: Flush PASID-based iotlb for iova over first level")
    Signed-off-by: Lu Baolu
    Link: https://lore.kernel.org/r/20201231005323.2178523-1-baolu.lu@linux.intel.com
    Signed-off-by: Will Deacon
    Signed-off-by: Greg Kroah-Hartman

    Lu Baolu
     
  • commit 4f8b848788f77c7f5c3bd98febce66b7aa14785f upstream.

    When CRC32 is disabled, zonefs cannot be linked:

    ld: fs/zonefs/super.o: in function `zonefs_fill_super':

    Add a Kconfig 'select' statement for it.

    Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Damien Le Moal
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 19cd3403cb0d522dd5e10188eef85817de29e26e upstream.

    Without CRC32 support, this fails to link:

    arm-linux-gnueabi-ld: drivers/lightnvm/pblk-init.o: in function `pblk_init':
    pblk-init.c:(.text+0x2654): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/lightnvm/pblk-init.o: in function `pblk_exit':
    pblk-init.c:(.text+0x2a7c): undefined reference to `crc32_le'

    Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 36a106a4c1c100d55ba3d32a21ef748cfcd4fa99 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: 8722ff8cdbfa ("block: IBM RamSan 70/80 device driver")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit e186620d7bf11b274b985b839c38266d7918cc05 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: 151a9706503f ("wil6210: firmware download")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit f9d6f94132f01d2a552dcbab54fa56496638186d upstream.

    Without crc32, this driver fails to link:

    arm-linux-gnueabi-ld: drivers/net/phy/dp83640.o: in function `match':
    dp83640.c:(.text+0x476c): undefined reference to `crc32_le'

    Fixes: 539e44d26855 ("dp83640: Include hash in timestamp/packet matching")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Andrew Lunn
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 2860d45a589818dd8ffd90cdc4bcf77f36a5a6be upstream.

    Without this, the driver fails to link:

    lpc_eth.c:(.text+0x1934): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/qlogic/qed/qed_debug.o: in function `qed_grc_dump':
    qed_debug.c:(.text+0x4068): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/qlogic/qed/qed_debug.o: in function `qed_idle_chk_dump':
    qed_debug.c:(.text+0x51fc): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/qlogic/qed/qed_debug.o: in function `qed_mcp_trace_dump':
    qed_debug.c:(.text+0x6000): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/qlogic/qed/qed_debug.o: in function `qed_dbg_reg_fifo_dump':
    qed_debug.c:(.text+0x66cc): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/qlogic/qed/qed_debug.o:qed_debug.c:(.text+0x6aa4): more undefined references to `crc32_le' follow

    Fixes: 7a4b21b7d1f0 ("qed: Add nvram selftest")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 095507dc1350b3a2b8b39fdc05edba0c10859eca upstream.

    Systems configured with CONFIG_ZONE_DMA32, CONFIG_ZONE_NORMAL and
    !CONFIG_ZONE_DMA will fail to properly setup ARCH_LOW_ADDRESS_LIMIT. The
    limit will default to ~0ULL, effectively spanning the whole memory,
    which is too high for a configuration that expects low memory to be
    capped at 4GB.

    Fix ARCH_LOW_ADDRESS_LIMIT by falling back to arm64_dma32_phys_limit
    when arm64_dma_phys_limit isn't set. arm64_dma32_phys_limit will honour
    CONFIG_ZONE_DMA32, or span the entire memory when not enabled.

    Fixes: 1a8e1cef7603 ("arm64: use both ZONE_DMA and ZONE_DMA32")
    Signed-off-by: Nicolas Saenz Julienne
    Link: https://lore.kernel.org/r/20201218163307.10150-1-nsaenzjulienne@suse.de
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Nicolas Saenz Julienne
     
  • commit 2d5efea64472469117dc1a9a39530069e95b21e9 upstream.

    Typecast the fls(width -1) with (enum dmaengine_alignment) in
    xilinx_dma_chan_probe function to fix the coverity warning.

    Addresses-Coverity: Event mixed_enum_type.
    Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support")
    Signed-off-by: Shravya Kumbham
    Signed-off-by: Radhey Shyam Pandey
    Link: https://lore.kernel.org/r/1608722462-29519-4-git-send-email-radhey.shyam.pandey@xilinx.com
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Shravya Kumbham
     
  • commit faeb0731be0a31e2246b21a85fa7dabbd750101d upstream.

    In xilinx_dma_child_probe function, the nr_channels variable is
    passed to of_property_read_u32() which expects an u32 return value
    pointer. Modify the nr_channels variable type from int to u32 to
    fix the incompatible parameter coverity warning.

    Addresses-Coverity: Event incompatible_param.
    Fixes: 1a9e7a03c761 ("dmaengine: vdma: Add support for mulit-channel dma mode")
    Signed-off-by: Shravya Kumbham
    Signed-off-by: Radhey Shyam Pandey
    Link: https://lore.kernel.org/r/1608722462-29519-3-git-send-email-radhey.shyam.pandey@xilinx.com
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Shravya Kumbham
     
  • commit 99974aedbd73523969afb09f33c6e3047cd0ddae upstream.

    dma_async_device_register() can return non-zero error code. Add
    condition to check the return value of dma_async_device_register
    function and handle the error path.

    Addresses-Coverity: Event check_return.
    Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support")
    Signed-off-by: Shravya Kumbham
    Signed-off-by: Radhey Shyam Pandey
    Link: https://lore.kernel.org/r/1608722462-29519-2-git-send-email-radhey.shyam.pandey@xilinx.com
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Shravya Kumbham
     
  • commit d645148cc82ca7fbacaa601414a552184e9c6dd3 upstream.

    'disable_xdmac()' should be called in the error handling path of the
    probe function to undo a previous 'enable_xdmac()' call, as already
    done in the remove function.

    Fixes: a6e9be055d47 ("dmaengine: milbeaut-xdmac: Add XDMAC driver for Milbeaut platforms")
    Signed-off-by: Christophe JAILLET
    Link: https://lore.kernel.org/r/20201219132800.183254-1-christophe.jaillet@wanadoo.fr
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Christophe JAILLET
     
  • commit 33cbd54dc515cc04b5a603603414222b4bb1448d upstream.

    'mtk_hsdma_hw_deinit()' should be called in the error handling path of the
    probe function to undo a previous 'mtk_hsdma_hw_init()' call, as already
    done in the remove function.

    Fixes: 548c4597e984 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")
    Signed-off-by: Christophe JAILLET
    Link: https://lore.kernel.org/r/20201219124718.182664-1-christophe.jaillet@wanadoo.fr
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Christophe JAILLET
     
  • commit 512d4a26abdbd11c6ffa03032740e5ab3c62c55b upstream.

    When CONFIG_COMPILE_TEST is set, it is possible to build some
    of the interconnect drivers into the kernel while their dependencies
    are loadable modules, which is bad:

    arm-linux-gnueabi-ld: drivers/interconnect/qcom/bcm-voter.o: in function `qcom_icc_bcm_voter_commit':
    (.text+0x1f8): undefined reference to `rpmh_invalidate'
    arm-linux-gnueabi-ld: (.text+0x20c): undefined reference to `rpmh_write_batch'
    arm-linux-gnueabi-ld: (.text+0x2b0): undefined reference to `rpmh_write_batch'
    arm-linux-gnueabi-ld: (.text+0x2e8): undefined reference to `rpmh_write_batch'
    arm-linux-gnueabi-ld: drivers/interconnect/qcom/icc-rpmh.o: in function `qcom_icc_bcm_init':
    (.text+0x2ac): undefined reference to `cmd_db_read_addr'
    arm-linux-gnueabi-ld: (.text+0x2c8): undefined reference to `cmd_db_read_aux_data'

    The exact dependencies are a bit complicated, so split them out into a
    hidden Kconfig symbol that all drivers can in turn depend on to get it
    right.

    Fixes: 976daac4a1c5 ("interconnect: qcom: Consolidate interconnect RPMh support")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20201204165030.3747484-1-arnd@kernel.org
    Signed-off-by: Georgi Djakov
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann