13 Jan, 2021

36 commits

  • [ Upstream commit 085c7c4e1c0e50d90b7d90f61a12e12b317a91e2 ]

    Both version 0 and version 1 use ETH_P_ERSPAN, but version 0 does not
    have an erspan header. So the check in gre_parse_header() is wrong,
    we have to distinguish version 1 from version 0.

    We can just check the gre header length like is_erspan_type1().

    Fixes: cb73ee40b1b3 ("net: ip_gre: use erspan key field for tunnel lookup")
    Reported-by: syzbot+f583ce3d4ddf9836b27a@syzkaller.appspotmail.com
    Cc: William Tu
    Cc: Lorenzo Bianconi
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Cong Wang
     
  • [ Upstream commit 5ede3ada3da7f050519112b81badc058190b9f9f ]

    The function skb_copy() could return NULL, the return value
    need to be checked.

    Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet support")
    Signed-off-by: Yunjian Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Yunjian Wang
     
  • [ Upstream commit bd1248f1ddbc48b0c30565fce897a3b6423313b8 ]

    Check Scell_log shift size in red_check_params() and modify all callers
    of red_check_params() to pass Scell_log.

    This prevents a shift out-of-bounds as detected by UBSAN:
    UBSAN: shift-out-of-bounds in ./include/net/red.h:252:22
    shift exponent 72 is too large for 32-bit type 'int'

    Fixes: 8afa10cbe281 ("net_sched: red: Avoid illegal values")
    Signed-off-by: Randy Dunlap
    Reported-by: syzbot+97c5bd9cc81eca63d36e@syzkaller.appspotmail.com
    Cc: Nogah Frankel
    Cc: Jamal Hadi Salim
    Cc: Cong Wang
    Cc: Jiri Pirko
    Cc: netdev@vger.kernel.org
    Cc: "David S. Miller"
    Cc: Jakub Kicinski
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • [ Upstream commit 21fdca22eb7df2a1e194b8adb812ce370748b733 ]

    RT_TOS() only clears one of the ECN bits. Therefore, when
    fib_compute_spec_dst() resorts to a fib lookup, it can return
    different results depending on the value of the second ECN bit.

    For example, ECT(0) and ECT(1) packets could be treated differently.

    $ 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 lo up
    $ ip -netns ns1 link set dev lo up
    $ 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/24 dev veth01
    $ ip -netns ns1 address add 192.0.2.11/24 dev veth10

    $ ip -netns ns1 address add 192.0.2.21/32 dev lo
    $ ip -netns ns1 route add 192.0.2.10/32 tos 4 dev veth10 src 192.0.2.21
    $ ip netns exec ns1 sysctl -wq net.ipv4.icmp_echo_ignore_broadcasts=0

    With TOS 4 and ECT(1), ns1 replies using source address 192.0.2.21
    (ping uses -Q to set all TOS and ECN bits):

    $ ip netns exec ns0 ping -c 1 -b -Q 5 192.0.2.255
    [...]
    64 bytes from 192.0.2.21: icmp_seq=1 ttl=64 time=0.544 ms

    But with TOS 4 and ECT(0), ns1 replies using source address 192.0.2.11
    because the "tos 4" route isn't matched:

    $ ip netns exec ns0 ping -c 1 -b -Q 6 192.0.2.255
    [...]
    64 bytes from 192.0.2.11: icmp_seq=1 ttl=64 time=0.597 ms

    After this patch the ECN bits don't affect the result anymore:

    $ ip netns exec ns0 ping -c 1 -b -Q 6 192.0.2.255
    [...]
    64 bytes from 192.0.2.21: icmp_seq=1 ttl=64 time=0.591 ms

    Fixes: 35ebf65e851c ("ipv4: Create and use fib_compute_spec_dst() helper.")
    Signed-off-by: Guillaume Nault
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Guillaume Nault
     
  • [ Upstream commit fb1e6e562b37b39adfe251919c9abfdb3e01f921 ]

    A recent change skips sending firmware messages to the firmware when
    pci_channel_offline() is true during fatal AER error. To make this
    complete, we need to move the re-initialization sequence to
    bnxt_io_resume(), otherwise the firmware messages to re-initialize
    will all be skipped. In any case, it is more correct to re-initialize
    in bnxt_io_resume().

    Also, fix the reverse x-mas tree format when defining variables
    in bnxt_io_slot_reset().

    Fixes: b340dc680ed4 ("bnxt_en: Avoid sending firmware messages when AER error is detected.")
    Reviewed-by: Edwin Peer
    Signed-off-by: Vasundhara Volam
    Signed-off-by: Michael Chan
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Vasundhara Volam
     
  • [ Upstream commit 4f374d2c43a9e5e773f1dee56db63bd6b8a36276 ]

    The packet coalescing interrupt threshold has separated registers
    for different aggregated/cpu (sw-thread). The required value should
    be loaded for every thread but not only for 1 current cpu.

    Fixes: 213f428f5056 ("net: mvpp2: add support for TX interrupts and RX queue distribution modes")
    Signed-off-by: Stefan Chulski
    Link: https://lore.kernel.org/r/1608748521-11033-1-git-send-email-stefanc@marvell.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Stefan Chulski
     
  • [ Upstream commit a029a2fef5d11bb85587433c3783615442abac96 ]

    TQM rings are hardware resources that require host context memory
    managed by the driver. The driver supports up to 9 TQM rings and
    the number of rings to use is requested by firmware during run-time.
    Cap this number to the maximum supported to prevent accessing beyond
    the array. Future firmware may request more than 9 TQM rings. Define
    macros to remove the magic number 9 from the C code.

    Fixes: ac3158cb0108 ("bnxt_en: Allocate TQM ring context memory according to fw specification.")
    Reviewed-by: Pavan Chebbi
    Reviewed-by: Vasundhara Volam
    Signed-off-by: Michael Chan
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Michael Chan
     
  • [ Upstream commit 3c98cbf22a96c1b12f48c1b2a4680dfe5cb280f9 ]

    This flag can be used by an end user to disable S0ix flows on a
    buggy system or by an OEM for development purposes.

    If you need this flag to be persisted across reboots, it's suggested
    to use a udev rule to call adjust it until the kernel could have your
    configuration in a disallow list.

    Signed-off-by: Mario Limonciello
    Reviewed-by: Hans de Goede
    Tested-by: Yijun Shen
    Signed-off-by: Tony Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Mario Limonciello
     
  • [ Upstream commit 6cecf02e77ab9bf97e9252f9fcb8f0738a6de12c ]

    commit e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME
    systems") disabled s0ix flows for systems that have various incarnations of
    the i219-LM ethernet controller. This changed caused power consumption
    regressions on the following shipping Dell Comet Lake based laptops:
    * Latitude 5310
    * Latitude 5410
    * Latitude 5410
    * Latitude 5510
    * Precision 3550
    * Latitude 5411
    * Latitude 5511
    * Precision 3551
    * Precision 7550
    * Precision 7750

    This commit was introduced because of some regressions on certain Thinkpad
    laptops. This comment was potentially caused by an earlier
    commit 632fbd5eb5b0e ("e1000e: fix S0ix flows for cable connected case").
    or it was possibly caused by a system not meeting platform architectural
    requirements for low power consumption. Other changes made in the driver
    with extended timeouts are expected to make the driver more impervious to
    platform firmware behavior.

    Fixes: e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME systems")
    Reviewed-by: Alexander Duyck
    Signed-off-by: Mario Limonciello
    Reviewed-by: Hans de Goede
    Tested-by: Yijun Shen
    Signed-off-by: Tony Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Mario Limonciello
     
  • [ Upstream commit 3cf31b1a9effd859bb3d6ff9f8b5b0d5e6cac952 ]

    Per guidance from Intel ethernet architecture team, it may take
    up to 1 second for unconfiguring ULP mode.

    However in practice this seems to be taking up to 2 seconds on
    some Lenovo machines. Detect scenarios that take more than 1 second
    but less than 2.5 seconds and emit a warning on resume for those
    scenarios.

    Suggested-by: Aaron Ma
    Suggested-by: Sasha Netfin
    Suggested-by: Hans de Goede
    CC: Mark Pearson
    Fixes: f15bb6dde738cc8fa0 ("e1000e: Add support for S0ix")
    BugLink: https://bugs.launchpad.net/bugs/1865570
    Link: https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200323191639.48826-1-aaron.ma@canonical.com/
    Link: https://lkml.org/lkml/2020/12/13/15
    Link: https://lkml.org/lkml/2020/12/14/708
    Signed-off-by: Mario Limonciello
    Reviewed-by: Hans de Goede
    Tested-by: Yijun Shen
    Signed-off-by: Tony Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Mario Limonciello
     
  • [ Upstream commit 808e0d8832cc81738f3e8df12dff0688352baf50 ]

    If the shutdown failed, the part will be thawed and running
    S0ix flows will put it into an undefined state.

    Reported-by: Alexander Duyck
    Reviewed-by: Alexander Duyck
    Signed-off-by: Mario Limonciello
    Tested-by: Yijun Shen
    Signed-off-by: Tony Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Mario Limonciello
     
  • [ Upstream commit 950271d7cc0b4546af3549d8143c4132d6e1f138 ]

    Currently the tun_napi_alloc_frags() function returns -ENOMEM when the
    number of iovs exceeds MAX_SKB_FRAGS + 1. However this is inappropriate,
    we should use -EMSGSIZE instead of -ENOMEM.

    The following distinctions are matters:
    1. the caller need to drop the bad packet when -EMSGSIZE is returned,
    which means meeting a persistent failure.
    2. the caller can try again when -ENOMEM is returned, which means
    meeting a transient failure.

    Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver")
    Signed-off-by: Yunjian Wang
    Acked-by: Willem de Bruijn
    Acked-by: Jason Wang
    Acked-by: Michael S. Tsirkin
    Link: https://lore.kernel.org/r/1608864736-24332-1-git-send-email-wangyunjian@huawei.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Yunjian Wang
     
  • [ Upstream commit 4614792eebcbf81c60ad3604c1aeeb2b0899cea4 ]

    The CPTS driver registers PTP PHC clock when first netif is going up and
    unregister it when all netif are down. Now ethtool will show:
    - PTP PHC clock index 0 after boot until first netif is up;
    - the last assigned PTP PHC clock index even if PTP PHC clock is not
    registered any more after all netifs are down.

    This patch ensures that -1 is returned by ethtool when PTP PHC clock is not
    registered any more.

    Fixes: 8a2c9a5ab4b9 ("net: ethernet: ti: cpts: rework initialization/deinitialization")
    Signed-off-by: Grygorii Strashko
    Acked-by: Richard Cochran
    Link: https://lore.kernel.org/r/20201224162405.28032-1-grygorii.strashko@ti.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Grygorii Strashko
     
  • [ Upstream commit 4ae2bb81649dc03dfc95875f02126b14b773f7ab ]

    Accesses to dev->xps_rxqs_map (when using dev->num_tc) should be
    protected by the rtnl lock, like we do for netif_set_xps_queue. I didn't
    see an actual bug being triggered, but let's be safe here and take the
    rtnl lock while accessing the map in sysfs.

    Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue")
    Signed-off-by: Antoine Tenart
    Reviewed-by: Alexander Duyck
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Antoine Tenart
     
  • [ Upstream commit 2d57b4f142e0b03e854612b8e28978935414bced ]

    Two race conditions can be triggered when storing xps rxqs, resulting in
    various oops and invalid memory accesses:

    1. Calling netdev_set_num_tc while netif_set_xps_queue:

    - netif_set_xps_queue uses dev->tc_num as one of the parameters to
    compute the size of new_dev_maps when allocating it. dev->tc_num is
    also used to access the map, and the compiler may generate code to
    retrieve this field multiple times in the function.

    - netdev_set_num_tc sets dev->tc_num.

    If new_dev_maps is allocated using dev->tc_num and then dev->tc_num
    is set to a higher value through netdev_set_num_tc, later accesses to
    new_dev_maps in netif_set_xps_queue could lead to accessing memory
    outside of new_dev_maps; triggering an oops.

    2. Calling netif_set_xps_queue while netdev_set_num_tc is running:

    2.1. netdev_set_num_tc starts by resetting the xps queues,
    dev->tc_num isn't updated yet.

    2.2. netif_set_xps_queue is called, setting up the map with the
    *old* dev->num_tc.

    2.3. netdev_set_num_tc updates dev->tc_num.

    2.4. Later accesses to the map lead to out of bound accesses and
    oops.

    A similar issue can be found with netdev_reset_tc.

    One way of triggering this is to set an iface up (for which the driver
    uses netdev_set_num_tc in the open path, such as bnx2x) and writing to
    xps_rxqs in a concurrent thread. With the right timing an oops is
    triggered.

    Both issues have the same fix: netif_set_xps_queue, netdev_set_num_tc
    and netdev_reset_tc should be mutually exclusive. We do that by taking
    the rtnl lock in xps_rxqs_store.

    Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue")
    Signed-off-by: Antoine Tenart
    Reviewed-by: Alexander Duyck
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Antoine Tenart
     
  • [ Upstream commit fb25038586d0064123e393cadf1fadd70a9df97a ]

    Accesses to dev->xps_cpus_map (when using dev->num_tc) should be
    protected by the rtnl lock, like we do for netif_set_xps_queue. I didn't
    see an actual bug being triggered, but let's be safe here and take the
    rtnl lock while accessing the map in sysfs.

    Fixes: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes")
    Signed-off-by: Antoine Tenart
    Reviewed-by: Alexander Duyck
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Antoine Tenart
     
  • [ Upstream commit 1ad58225dba3f2f598d2c6daed4323f24547168f ]

    Two race conditions can be triggered when storing xps cpus, resulting in
    various oops and invalid memory accesses:

    1. Calling netdev_set_num_tc while netif_set_xps_queue:

    - netif_set_xps_queue uses dev->tc_num as one of the parameters to
    compute the size of new_dev_maps when allocating it. dev->tc_num is
    also used to access the map, and the compiler may generate code to
    retrieve this field multiple times in the function.

    - netdev_set_num_tc sets dev->tc_num.

    If new_dev_maps is allocated using dev->tc_num and then dev->tc_num
    is set to a higher value through netdev_set_num_tc, later accesses to
    new_dev_maps in netif_set_xps_queue could lead to accessing memory
    outside of new_dev_maps; triggering an oops.

    2. Calling netif_set_xps_queue while netdev_set_num_tc is running:

    2.1. netdev_set_num_tc starts by resetting the xps queues,
    dev->tc_num isn't updated yet.

    2.2. netif_set_xps_queue is called, setting up the map with the
    *old* dev->num_tc.

    2.3. netdev_set_num_tc updates dev->tc_num.

    2.4. Later accesses to the map lead to out of bound accesses and
    oops.

    A similar issue can be found with netdev_reset_tc.

    One way of triggering this is to set an iface up (for which the driver
    uses netdev_set_num_tc in the open path, such as bnx2x) and writing to
    xps_cpus in a concurrent thread. With the right timing an oops is
    triggered.

    Both issues have the same fix: netif_set_xps_queue, netdev_set_num_tc
    and netdev_reset_tc should be mutually exclusive. We do that by taking
    the rtnl lock in xps_cpus_store.

    Fixes: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes")
    Signed-off-by: Antoine Tenart
    Reviewed-by: Alexander Duyck
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Antoine Tenart
     
  • [ Upstream commit 5d41f9b7ee7a5a5138894f58846a4ffed601498a ]

    When mdiobus_register() fails, priv->mdio allocated
    by mdiobus_alloc() has not been freed, which leads
    to memleak.

    Fixes: e7f4dc3536a4 ("mdio: Move allocation of interrupts into core")
    Signed-off-by: Dinghao Liu
    Reviewed-by: Andrew Lunn
    Link: https://lore.kernel.org/r/20201223110615.31389-1-dinghao.liu@zju.edu.cn
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Dinghao Liu
     
  • [ Upstream commit 427c940558560bff2583d07fc119a21094675982 ]

    When aggregating ncsi interfaces and dedicated interfaces to bond
    interfaces, the ncsi response handler will use the wrong net device to
    find ncsi_dev, so that the ncsi interface will not work properly.
    Here, we use the original net device to fix it.

    Fixes: 138635cc27c9 ("net/ncsi: NCSI response packet handler")
    Signed-off-by: John Wang
    Link: https://lore.kernel.org/r/20201223055523.2069-1-wangzhiqiang.bj@bytedance.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    John Wang
     
  • [ Upstream commit de33212f768c5d9e2fe791b008cb26f92f0aa31c ]

    virtnet_set_channels can recursively call cpus_read_lock if CONFIG_XPS
    and CONFIG_HOTPLUG are enabled.

    The path is:
    virtnet_set_channels - calls get_online_cpus(), which is a trivial
    wrapper around cpus_read_lock()
    netif_set_real_num_tx_queues
    netif_reset_xps_queues_gt
    netif_reset_xps_queues - calls cpus_read_lock()

    This call chain and potential deadlock happens when the number of TX
    queues is reduced.

    This commit the removes netif_set_real_num_[tr]x_queues calls from
    inside the get/put_online_cpus section, as they don't require that it
    be held.

    Fixes: 47be24796c13 ("virtio-net: fix the set affinity bug when CPU IDs are not consecutive")
    Signed-off-by: Jeff Dike
    Acked-by: Jason Wang
    Acked-by: Michael S. Tsirkin
    Link: https://lore.kernel.org/r/20201223025421.671-1-jdike@akamai.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Jeff Dike
     
  • [ Upstream commit 5d5647dad259bb416fd5d3d87012760386d97530 ]

    IPIP tunnels packets are unknown to device,
    hence these packets are incorrectly parsed and
    caused the packet corruption, so disable offlods
    for such packets at run time.

    Signed-off-by: Manish Chopra
    Signed-off-by: Sudarsana Kalluru
    Signed-off-by: Igor Russkikh
    Link: https://lore.kernel.org/r/20201221145530.7771-1-manishc@marvell.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Manish Chopra
     
  • [ Upstream commit 58f60329a6be35a5653edb3fd2023ccef9eb9943 ]

    When mvneta_port_power_up() fails, we should execute
    cleanup functions after label err_netdev to avoid memleak.

    Fixes: 41c2b6b4f0f80 ("net: ethernet: mvneta: Add back interface mode validation")
    Signed-off-by: Dinghao Liu
    Link: https://lore.kernel.org/r/20201220082930.21623-1-dinghao.liu@zju.edu.cn
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Dinghao Liu
     
  • [ Upstream commit 1f45dc22066797479072978feeada0852502e180 ]

    Commit f9c6cea0b385 ("ibmvnic: Skip fatal error reset after passive init")
    says "If the passive
    CRQ initialization occurs before the FATAL reset task is processed,
    the FATAL error reset task would try to access a CRQ message queue
    that was freed, causing an oops. The problem may be most likely to
    occur during DLPAR add vNIC with a non-default MTU, because the DLPAR
    process will automatically issue a change MTU request.
    Fix this by not processing fatal error reset if CRQ is passively
    initialized after client-driven CRQ initialization fails."

    Even with this commit, we still see similar kernel crashes. In order
    to completely solve this problem, we'd better continue the fatal error
    reset, capture the kernel crash, and try to fix it from that end.

    Fixes: f9c6cea0b385 ("ibmvnic: Skip fatal error reset after passive init")
    Signed-off-by: Lijun Pan
    Link: https://lore.kernel.org/r/20201219214034.21123-1-ljp@linux.ibm.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Lijun Pan
     
  • [ Upstream commit a0c8be56affa7d5ffbdec24c992223be54db3b6e ]

    Commit 34f0f4e3f488 ("ibmvnic: Fix login buffer memory leaks") frees
    login_rsp_buffer in release_resources() and send_login()
    because handle_login_rsp() does not free it.
    Commit f3ae59c0c015 ("ibmvnic: store RX and TX subCRQ handle array in
    ibmvnic_adapter struct") frees login_rsp_buffer in handle_login_rsp().
    It seems unnecessary to free it in release_resources() and send_login().
    There are chances that handle_login_rsp returns earlier without freeing
    buffers. Double-checking the buffer is harmless since
    release_login_buffer and release_login_rsp_buffer will
    do nothing if buffer is already freed.

    Fixes: f3ae59c0c015 ("ibmvnic: store RX and TX subCRQ handle array in ibmvnic_adapter struct")
    Fixes: 34f0f4e3f488 ("ibmvnic: Fix login buffer memory leaks")
    Signed-off-by: Lijun Pan
    Link: https://lore.kernel.org/r/20201219213919.21045-1-ljp@linux.ibm.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Lijun Pan
     
  • [ Upstream commit f87777a3c30cf50c66a20e1d153f0e003bb30774 ]

    The dwmac glue registers on Amlogic Meson8b and newer SoCs has two clock
    inputs:
    - Meson8b and Meson8m2: MPLL2 and MPLL2 (the same parent is wired to
    both inputs)
    - GXBB, GXL, GXM, AXG, G12A, G12B, SM1: FCLK_DIV2 and MPLL2

    All known vendor kernels and u-boots are using the first input only. We
    let the common clock framework automatically choose the "right" parent.
    For some boards this causes a problem though, specificially with G12A and
    newer SoCs. The clock input is used for generating the 125MHz RGMII TX
    clock. For the two input clocks this means on G12A:
    - FCLK_DIV2: 999999985Hz / 8 = 124999998.125Hz
    - MPLL2: 499999993Hz / 4 = 124999998.25Hz

    In theory MPLL2 is the "better" clock input because it's gets us 0.125Hz
    closer to the requested frequency than FCLK_DIV2. In reality however
    there is a resource conflict because MPLL2 is needed to generate some of
    the audio clocks. dwmac-meson8b probes first and sets up the clock tree
    with MPLL2. This works fine until the audio driver comes and "steals"
    the MPLL2 clocks and configures it with it's own rate (294909637Hz). The
    common clock framework happily changes the MPLL2 rate but does not
    reconfigure our RGMII TX clock tree, which then ends up at 73727409Hz,
    which is more than 40% off the requested 125MHz.

    Don't use the second clock input for now to force the common clock
    framework to always select the first parent. This mimics the behavior
    from the vendor driver and fixes the clock resource conflict with the
    audio driver on G12A boards. Once the common clock framework can handle
    this situation this change can be reverted again.

    Fixes: 566e8251625304 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")
    Reported-by: Thomas Graichen
    Signed-off-by: Martin Blumenstingl
    Tested-by: thomas graichen
    Link: https://lore.kernel.org/r/20201219135036.3216017-1-martin.blumenstingl@googlemail.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Martin Blumenstingl
     
  • [ Upstream commit 2575bc1aa9d52a62342b57a0b7d0a12146cf6aed ]

    During GoP port 2 Networking Complex Control mode of operation configurations,
    also GoP port 3 mode of operation was wrongly set.
    Patch removes these configurations.

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

    Stefan Chulski
     
  • [ Upstream commit 8df66af5c1e5f80562fe728db5ec069b21810144 ]

    This error path needs to disable the pci device before returning.

    Fixes: ede58ef28e10 ("atm: remove deprecated use of pci api")
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/X93dmC4NX0vbTpGp@mwanda
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • [ Upstream commit 83469893204281ecf65d572bddf02de29a19787c ]

    Let the FW know we have enough receive buffer space for the
    vlan tag if it isn't stripped.

    Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling")
    Signed-off-by: Shannon Nelson
    Link: https://lore.kernel.org/r/20201218215001.64696-1-snelson@pensando.io
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Shannon Nelson
     
  • [ Upstream commit 1385ae5c30f238f81bc6528d897c6d7a0816783f ]

    All the buffers and registers are already set up appropriately for an
    MTU slightly above 1500, so we just need to expose this to the
    networking stack. AFAICT, there's no need to implement .ndo_change_mtu
    when the receive buffers are always set up to support the max_mtu.

    This fixes several warnings during boot on our mpc8309-board with an
    embedded mv88e6250 switch:

    mv88e6085 mdio@e0102120:10: nonfatal error -34 setting MTU 1500 on port 0
    ...
    mv88e6085 mdio@e0102120:10: nonfatal error -34 setting MTU 1500 on port 4
    ucc_geth e0102000.ethernet eth1: error -22 setting MTU to 1504 to include DSA overhead

    The last line explains what the DSA stack tries to do: achieving an MTU
    of 1500 on-the-wire requires that the master netdevice connected to
    the CPU port supports an MTU of 1500+the tagging overhead.

    Fixes: bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
    Reviewed-by: Andrew Lunn
    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Vladimir Oltean
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Rasmus Villemoes
     
  • [ Upstream commit e925e0cd2a705aaacb0b907bb3691fcac3a973a4 ]

    ugeth is the netdiv_priv() part of the netdevice. Accessing the memory
    pointed to by ugeth (such as done by ucc_geth_memclean() and the two
    of_node_puts) after free_netdev() is thus use-after-free.

    Fixes: 80a9fad8e89a ("ucc_geth: fix module removal")
    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Rasmus Villemoes
     
  • [ Upstream commit 54ddbdb024882e226055cc4c3c246592ddde2ee5 ]

    The driver is already allocating receive buffers of 2KiB and the
    Ethernet MAC is configured to accept frames up to UMAC_MAX_MTU_SIZE.

    Fixes: bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
    Signed-off-by: Florian Fainelli
    Reviewed-by: Vladimir Oltean
    Link: https://lore.kernel.org/r/20201218173843.141046-1-f.fainelli@gmail.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Florian Fainelli
     
  • [ Upstream commit fec6079b2eeab319d9e3d074f54d3b6f623e9701 ]

    Current PPPoE+IPv6 entry is jumping to 'next-hdr'
    field and not to 'DIP' field as done for IPv4.

    Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
    Reported-by: Liron Himi
    Signed-off-by: Stefan Chulski
    Link: https://lore.kernel.org/r/1608230266-22111-1-git-send-email-stefanc@marvell.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Stefan Chulski
     
  • [ Upstream commit 3f48fab62bb81a7f9d01e9d43c40395fad011dd5 ]

    Issue:
    Flow control frame used to pause GoP(MAC) was delivered to the CPU
    and created a load on the CPU. Since XOFF/XON frames are used only
    by MAC, these frames should be dropped inside MAC.

    Fix:
    According to 802.3-2012 - IEEE Standard for Ethernet pause frame
    has unique destination MAC address 01-80-C2-00-00-01.
    Add TCAM parser entry to track and drop pause frames by destination MAC.

    Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
    Signed-off-by: Stefan Chulski
    Link: https://lore.kernel.org/r/1608229817-21951-1-git-send-email-stefanc@marvell.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Stefan Chulski
     
  • [ Upstream commit 698285da79f5b0b099db15a37ac661ac408c80eb ]

    taprio_graft() can insert a NULL element in the array of child qdiscs. As
    a consquence, taprio_reset() might not reset child qdiscs completely, and
    taprio_destroy() might leak resources. Fix it by ensuring that loops that
    iterate over q->qdiscs[] don't end when they find the first NULL item.

    Fixes: 44d4775ca518 ("net/sched: sch_taprio: reset child qdiscs before freeing them")
    Fixes: 5a781ccbd19e ("tc: Add support for configuring the taprio scheduler")
    Suggested-by: Jakub Kicinski
    Signed-off-by: Davide Caratti
    Link: https://lore.kernel.org/r/13edef6778fef03adc751582562fba4a13e06d6a.1608240532.git.dcaratti@redhat.com
    Signed-off-by: Jakub Kicinski
    Signed-off-by: Greg Kroah-Hartman

    Davide Caratti
     
  • [ Upstream commit f1340265726e0edf8a8cef28e665b28ad6302ce9 ]

    This code does not jump to exit on an error in iavf_lan_add_device(),
    so the rtnl_unlock() from the normal path will follow.

    Fixes: b66c7bc1cd4d ("iavf: Refactor init state machine")
    Signed-off-by: Jakub Kicinski
    Reviewed-by: Tony Nguyen
    Tested-by: Konrad Jankowski
    Signed-off-by: Tony Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Jakub Kicinski
     
  • [ Upstream commit 3ac874fa84d1baaf0c0175f2a1499f5d88d528b2 ]

    When removing VFs for PF added to bridge there was
    an error I40E_AQ_RC_EINVAL. It was caused by not properly
    resetting and reinitializing PF when adding/removing VFs.
    Changed how reset is performed when adding/removing VFs
    to properly reinitialize PFs VSI.

    Fixes: fc60861e9b00 ("i40e: start up in VEPA mode by default")
    Signed-off-by: Sylwester Dziedziuch
    Tested-by: Konrad Jankowski
    Signed-off-by: Tony Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Sylwester Dziedziuch
     

09 Jan, 2021

4 commits

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

    Greg Kroah-Hartman
     
  • [ Upstream commit 5c455c5ab332773464d02ba17015acdca198f03d ]

    mwifiex_cmd_802_11_ad_hoc_start() calls memcpy() without checking
    the destination size may trigger a buffer overflower,
    which a local user could use to cause denial of service
    or the execution of arbitrary code.
    Fix it by putting the length check before calling memcpy().

    Signed-off-by: Zhang Xiaohui
    Signed-off-by: Kalle Valo
    Link: https://lore.kernel.org/r/20201206084801.26479-1-ruc_zhangxiaohui@163.com
    Signed-off-by: Sasha Levin

    Zhang Xiaohui
     
  • [ Upstream commit f7cfd871ae0c5008d94b6f66834e7845caa93c15 ]

    Recently syzbot reported[0] that there is a deadlock amongst the users
    of exec_update_mutex. The problematic lock ordering found by lockdep
    was:

    perf_event_open (exec_update_mutex -> ovl_i_mutex)
    chown (ovl_i_mutex -> sb_writes)
    sendfile (sb_writes -> p->lock)
    by reading from a proc file and writing to overlayfs
    proc_pid_syscall (p->lock -> exec_update_mutex)

    While looking at possible solutions it occured to me that all of the
    users and possible users involved only wanted to state of the given
    process to remain the same. They are all readers. The only writer is
    exec.

    There is no reason for readers to block on each other. So fix
    this deadlock by transforming exec_update_mutex into a rw_semaphore
    named exec_update_lock that only exec takes for writing.

    Cc: Jann Horn
    Cc: Vasiliy Kulikov
    Cc: Al Viro
    Cc: Bernd Edlinger
    Cc: Oleg Nesterov
    Cc: Christopher Yeoh
    Cc: Cyrill Gorcunov
    Cc: Sargun Dhillon
    Cc: Christian Brauner
    Cc: Arnd Bergmann
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Fixes: eea9673250db ("exec: Add exec_update_mutex to replace cred_guard_mutex")
    [0] https://lkml.kernel.org/r/00000000000063640c05ade8e3de@google.com
    Reported-by: syzbot+db9cdf3dd1f64252c6ef@syzkaller.appspotmail.com
    Link: https://lkml.kernel.org/r/87ft4mbqen.fsf@x220.int.ebiederm.org
    Signed-off-by: Eric W. Biederman
    Signed-off-by: Sasha Levin

    Eric W. Biederman
     
  • [ Upstream commit 31784cff7ee073b34d6eddabb95e3be2880a425c ]

    In preparation for converting exec_update_mutex to a rwsem so that
    multiple readers can execute in parallel and not deadlock, add
    down_read_interruptible. This is needed for perf_event_open to be
    converted (with no semantic changes) from working on a mutex to
    wroking on a rwsem.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/87k0tybqfy.fsf@x220.int.ebiederm.org
    Signed-off-by: Sasha Levin

    Eric W. Biederman