05 Aug, 2020

22 commits

  • commit 87004abfbc27261edd15716515d89ab42198b405 upstream.

    This regressed some working configurations so revert it. Will
    fix this properly for 5.9 and backport then.

    This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b.

    Signed-off-by: Alex Deucher
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Alex Deucher
     
  • commit 168c358af2f8c5a37f8b5f877ba2cc93995606ee upstream.

    free cmd id is read using virtio endian, spec says all fields
    in balloon are LE. Fix it up.

    Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Cc: stable@vger.kernel.org
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang
    Reviewed-by: Wei Wang
    Acked-by: David Hildenbrand
    Signed-off-by: Greg Kroah-Hartman

    Michael S. Tsirkin
     
  • commit 4a601da92c2a782e5c022680d476104586b74994 upstream.

    The current pin muxing scheme muxes GPIO_1 pad for USB_OTG_ID
    because of which when card is inserted, usb otg is enumerated
    and the card is never detected.

    [ 64.492645] cfg80211: failed to load regulatory.db
    [ 64.492657] imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware
    [ 76.343711] ci_hdrc ci_hdrc.0: EHCI Host Controller
    [ 76.349742] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 2
    [ 76.388862] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
    [ 76.396650] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.08
    [ 76.405412] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [ 76.412763] usb usb2: Product: EHCI Host Controller
    [ 76.417666] usb usb2: Manufacturer: Linux 5.8.0-rc1-next-20200618 ehci_hcd
    [ 76.424623] usb usb2: SerialNumber: ci_hdrc.0
    [ 76.431755] hub 2-0:1.0: USB hub found
    [ 76.435862] hub 2-0:1.0: 1 port detected

    The TRM mentions GPIO_1 pad should be muxed/assigned for card detect
    and ENET_RX_ER pad for USB_OTG_ID for proper operation.

    This patch fixes pin muxing as per TRM and is tested on a
    i.Core 1.5 MX6 DL SOM.

    [ 22.449165] mmc0: host does not support reading read-only switch, assuming write-enable
    [ 22.459992] mmc0: new high speed SDHC card at address 0001
    [ 22.469725] mmcblk0: mmc0:0001 EB1QT 29.8 GiB
    [ 22.478856] mmcblk0: p1 p2

    Fixes: 6df11287f7c9 ("ARM: dts: imx6q: Add Engicam i.CoreM6 Quad/Dual initial support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Michael Trimarchi
    Signed-off-by: Suniel Mahesh
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Michael Trimarchi
     
  • commit c696afd331be1acb39206aba53048f2386b781fc upstream.

    Commit 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode") fixed the
    phy-mode for fec1, but missed to fix it for the fec2 node.

    Fix fec2 to also use "rgmii-id" as the phy-mode.

    Cc:
    Fixes: 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode")
    Signed-off-by: Fabio Estevam
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Fabio Estevam
     
  • commit d36f260718d83928e6012247a7e1b9791cdb12ff upstream.

    Commit 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode") fixed the
    phy-mode for fec1, but missed to fix it for the fec2 node.

    Fix fec2 to also use "rgmii-id" as the phy-mode.

    Cc:
    Fixes: 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode")
    Signed-off-by: Fabio Estevam
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Fabio Estevam
     
  • commit eec13b42d41b0f3339dcf0c4da43734427c68620 upstream.

    Unprivileged memory accesses generated by the so-called "translated"
    instructions (e.g. LDRT) in kernel mode can cause user watchpoints to fire
    unexpectedly. In such cases, the hw_breakpoint logic will invoke the user
    overflow handler which will typically raise a SIGTRAP back to the current
    task. This is futile when returning back to the kernel because (a) the
    signal won't have been delivered and (b) userspace can't handle the thing
    anyway.

    Avoid invoking the user overflow handler for watchpoints triggered by
    kernel uaccess routines, and instead single-step over the faulting
    instruction as we would if no overflow handler had been installed.

    Cc:
    Fixes: f81ef4a920c8 ("ARM: 6356/1: hw-breakpoint: add ARM backend for the hw-breakpoint framework")
    Reported-by: Luis Machado
    Tested-by: Luis Machado
    Signed-off-by: Will Deacon
    Signed-off-by: Russell King
    Signed-off-by: Greg Kroah-Hartman

    Will Deacon
     
  • commit 6989310f5d4327e8595664954edd40a7f99ddd0d upstream.

    Use offsetof to calculate offset of a field to take advantage of
    compiler built-in version when possible, and avoid UBSAN warning when
    compiling with Clang:

    ==================================================================
    UBSAN: Undefined behaviour in net/wireless/wext-core.c:525:14
    member access within null pointer of type 'struct iw_point'
    CPU: 3 PID: 165 Comm: kworker/u16:3 Tainted: G S W 4.19.23 #43
    Workqueue: cfg80211 __cfg80211_scan_done [cfg80211]
    Call trace:
    dump_backtrace+0x0/0x194
    show_stack+0x20/0x2c
    __dump_stack+0x20/0x28
    dump_stack+0x70/0x94
    ubsan_epilogue+0x14/0x44
    ubsan_type_mismatch_common+0xf4/0xfc
    __ubsan_handle_type_mismatch_v1+0x34/0x54
    wireless_send_event+0x3cc/0x470
    ___cfg80211_scan_done+0x13c/0x220 [cfg80211]
    __cfg80211_scan_done+0x28/0x34 [cfg80211]
    process_one_work+0x170/0x35c
    worker_thread+0x254/0x380
    kthread+0x13c/0x158
    ret_from_fork+0x10/0x18
    ===================================================================

    Signed-off-by: Pi-Hsun Shih
    Reviewed-by: Nick Desaulniers
    Link: https://lore.kernel.org/r/20191204081307.138765-1-pihsun@chromium.org
    Signed-off-by: Johannes Berg
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Greg Kroah-Hartman

    Pi-Hsun Shih
     
  • commit 74d6a5d5662975aed7f25952f62efbb6f6dadd29 upstream.

    p9_read_work and p9_fd_cancelled may be called concurrently.
    In some cases, req->req_list may be deleted by both p9_read_work
    and p9_fd_cancelled.

    We can fix it by ignoring replies associated with a cancelled
    request and ignoring cancelled request if message has been received
    before lock.

    Link: http://lkml.kernel.org/r/20200612090833.36149-1-wanghai38@huawei.com
    Fixes: 60ff779c4abb ("9p: client: remove unused code and any reference to "cancelled" function")
    Cc: # v3.12+
    Reported-by: syzbot+77a25acfa0382e06ab23@syzkaller.appspotmail.com
    Signed-off-by: Wang Hai
    Signed-off-by: Dominique Martinet
    Signed-off-by: Greg Kroah-Hartman

    Wang Hai
     
  • commit 295c1b9852d000580786375304a9800bd9634d15 upstream.

    vhost/scsi doesn't handle type conversion correctly
    for request type when using virtio 1.0 and up for BE,
    or cross-endian platforms.

    Fix it up using vhost_32_to_cpu.

    Cc: stable@vger.kernel.org
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang
    Reviewed-by: Stefan Hajnoczi
    Signed-off-by: Greg Kroah-Hartman

    Michael S. Tsirkin
     
  • commit 54a485e9ec084da1a4b32dcf7749c7d760ed8aa5 upstream.

    The lookaside count is improperly initialized to the size of the
    Receive Queue with the additional +1. In the traces below, the
    RQ size is 384, so the count was set to 385.

    The lookaside count is then rarely refreshed. Note the high and
    incorrect count in the trace below:

    rvt_get_rwqe: [hfi1_0] wqe ffffc900078e9008 wr_id 55c7206d75a0 qpn c
    qpt 2 pid 3018 num_sge 1 head 1 tail 0, count 385
    rvt_get_rwqe: (hfi1_rc_rcv+0x4eb/0x1480 [hfi1]
    Cc: # 5.4.x
    Reviewed-by: Kaike Wan
    Signed-off-by: Mike Marciniszyn
    Tested-by: Honggang Li
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Greg Kroah-Hartman

    Mike Marciniszyn
     
  • commit c2c3657f0aedb8736a0fb7b2b1985adfb86e7802 upstream.

    It's been reported that, when neither nouveau nor Nvidia graphics
    driver is used, the screen starts flickering. And, after comparing
    between the working case (stable 4.4.x) and the broken case, it turned
    out that the problem comes from the audio component binding. The
    Nvidia and AMD audio binding code clears the bus->keep_power flag
    whenever snd_hdac_acomp_init() succeeds. But this doesn't mean that
    the component is actually bound, but it merely indicates that it's
    ready for binding. So, when both nouveau and Nvidia are blacklisted
    or not ready, the driver keeps running without the audio component but
    also with bus->keep_power = false. This made the driver runtime PM
    kicked in and powering down when unused, which results in flickering
    in the graphics side, as it seems.

    For fixing the bug, this patch moves the bus->keep_power flag change
    into generic_acomp_notifier_set() that is the function called from the
    master_bind callback of component ops; i.e. it's guaranteed that the
    binding succeeded.

    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208609
    Fixes: 5a858e79c911 ("ALSA: hda - Disable audio component for legacy Nvidia HDMI codecs")
    Cc:
    Link: https://lore.kernel.org/r/20200728082033.23933-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 5649625344fe1f4695eace7c37d011e317bf66d5 upstream.

    HP NB right speaker had no sound output.
    This platform was connected to I2S Amp for speaker out.(None Realtek I2S Amp IC)
    EC need to check codec GPIO1 pin to initial I2S Amp.

    Signed-off-by: Kailang Yang
    Cc:
    Link: https://lore.kernel.org/r/01285f623ac7447187482fb4a8ecaa7c@realtek.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Kailang Yang
     
  • commit 6fa38ef1534e7e9320aa15e329eb1404ab2f70ac upstream.

    Intel requires to enable power saving mode for intel reference board (alc256)

    Signed-off-by: PeiSen Hou
    Cc:
    Link: https://lore.kernel.org/r/20200727115647.10967-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    PeiSen Hou
     
  • commit 293a92c1d9913248b9987b68f3a5d6d2f0aae62b upstream.

    This patch fixes a small typo I accidently submitted with the initial patch. The board should be named GA401 not G401.

    Fixes: ff53664daff2 ("ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G14(G401) series with ALC289")
    Signed-off-by: Armas Spann
    Cc:
    Link: https://lore.kernel.org/r/20200724140837.302763-1-zappel@retarded.farm
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Armas Spann
     
  • commit 4b43d05a1978a93a19374c6e6b817c9c1ff4ba4b upstream.

    This patch adds support for headset mic to the ASUS ROG Zephyrus
    G15(GA502) notebook series by adding the corresponding
    vendor/pci_device id, as well as adding a new fixup for the used
    realtek ALC289. The fixup stets the correct pin to get the headset mic
    correctly recognized on audio-jack.

    Signed-off-by: Armas Spann
    Cc:
    Link: https://lore.kernel.org/r/20200724140616.298892-1-zappel@retarded.farm
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Armas Spann
     
  • commit 3da87ec67a491b9633a82045896c076b794bf938 upstream.

    As expected, this requires the same quirk as the SSL2+ in order for the
    clock to sync. This was suggested by, and tested on an SSL2, by Dmitry.

    Suggested-by: Dmitry
    Signed-off-by: Laurence Tratt
    Cc:
    Link: https://lore.kernel.org/r/20200621075005.52mjjfc6dtdjnr3h@overdrive.tratt.net
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Laurence Tratt
     
  • commit 5c72feee3e45b40a3c96c7145ec422899d0e8964 upstream.

    When handling a page fault, we drop mmap_sem to start async readahead so
    that we don't block on IO submission with mmap_sem held. However there's
    no point to drop mmap_sem in case readahead is disabled. Handle that case
    to avoid pointless dropping of mmap_sem and retrying the fault. This was
    actually reported to block mlockall(MCL_CURRENT) indefinitely.

    Fixes: 6b4c9f446981 ("filemap: drop the mmap_sem for all blocking operations")
    Reported-by: Minchan Kim
    Reported-by: Robert Stupp
    Signed-off-by: Jan Kara
    Signed-off-by: Andrew Morton
    Reviewed-by: Josef Bacik
    Reviewed-by: Minchan Kim
    Link: http://lkml.kernel.org/r/20200212101356.30759-1-jack@suse.cz
    Signed-off-by: Linus Torvalds
    Cc: SeongJae Park
    Signed-off-by: Greg Kroah-Hartman

    Jan Kara
     
  • commit b361663c5a40c8bc758b7f7f2239f7a192180e7c upstream.

    Recently ASPM handling was changed to allow ASPM on PCIe-to-PCI/PCI-X
    bridges. Unfortunately the ASMedia ASM1083/1085 PCIe to PCI bridge device
    doesn't seem to function properly with ASPM enabled. On an Asus PRIME
    H270-PRO motherboard, it causes errors like these:

    pcieport 0000:00:1c.0: AER: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Transmitter ID)
    pcieport 0000:00:1c.0: AER: device [8086:a292] error status/mask=00003000/00002000
    pcieport 0000:00:1c.0: AER: [12] Timeout
    pcieport 0000:00:1c.0: AER: Corrected error received: 0000:00:1c.0
    pcieport 0000:00:1c.0: AER: can't find device of ID00e0

    In addition to flooding the kernel log, this also causes the machine to
    wake up immediately after suspend is initiated.

    The device advertises ASPM L0s and L1 support in the Link Capabilities
    register, but the ASMedia web page for ASM1083 [1] claims "No PCIe ASPM
    support".

    Windows 10 (build 2004) enables L0s, but it also logs correctable PCIe
    errors.

    Add a quirk to disable ASPM for this device.

    [1] https://www.asmedia.com.tw/eng/e_show_products.php?cate_index=169&item=114

    [bhelgaas: commit log]
    Fixes: 66ff14e59e8a ("PCI/ASPM: Allow ASPM on links to PCIe-to-PCI/PCI-X Bridges")
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=208667
    Link: https://lore.kernel.org/r/20200722021803.17958-1-hancockrwd@gmail.com
    Signed-off-by: Robert Hancock
    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Greg Kroah-Hartman

    Robert Hancock
     
  • commit cc78dc3b790619aa05f22a86a9152986bd73698c upstream.

    For all data packets transmitted, host gets htt tx completion event. Some QCA9984
    firmware releases support WMI_SERVICE_TX_DATA_ACK_RSSI, which gives data
    ack rssi values to host through htt event of data tx completion. Data ack rssi
    values are valid if A0 bit is set in HTT rx message. So enable the feature also
    for QCA9884.

    Tested HW: QCA9984
    Tested FW: 10.4-3.9.0.2-00044

    Signed-off-by: Abhishek Ambure
    Signed-off-by: Balaji Pothunoori
    [kvalo@codeaurora.org: improve commit log]
    Signed-off-by: Kalle Valo
    Signed-off-by: Sathishkumar Muruganandam
    Signed-off-by: Greg Kroah-Hartman

    Abhishek Ambure
     
  • [ Upstream commit f45db2b909c7e76f35850e78f017221f30282b8e ]

    The domain table should be empty at module unload. If it isn't there is
    a bug somewhere. So check and report.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=206651
    Signed-off-by: NeilBrown
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Sasha Levin

    Sasha Levin
     
  • [ Upstream commit a7b2df76b42bdd026e3106cf2ba97db41345a177 ]

    In cx23888_ir_probe if kfifo_alloc fails the allocated memory for state
    should be released.

    Signed-off-by: Navid Emamdoost
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin

    Navid Emamdoost
     
  • [ Upstream commit 128c66429247add5128c03dc1e144ca56f05a4e2 ]

    Release all allocated memory if sha type is invalid:
    In ccp_run_sha_cmd, if the type of sha is invalid, the allocated
    hmac_buf should be released.

    v2: fix the goto.

    Signed-off-by: Navid Emamdoost
    Acked-by: Gary R Hook
    Signed-off-by: Herbert Xu
    Signed-off-by: Sasha Levin

    Navid Emamdoost
     

01 Aug, 2020

18 commits

  • Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This reverts commit 40a904b1c2e57b22dd002dfce73688871cb0bac8.

    The patch is not wrong, but the Fixes: tag is. It should have been:

    Fixes: 060ad66f9795 ("dpaa_eth: change DMA device")

    which means that it's fixing a commit which was introduced in:

    git tag --contains 060ad66f97954
    v5.5

    which then means it should have not been backported to linux-5.4.y,
    where things _were_ working and now they're not.

    Reported-by: Joakim Tjernlund
    Signed-off-by: Vladimir Oltean
    Signed-off-by: Greg Kroah-Hartman

    Vladimir Oltean
     
  • commit e976eb4b91e906f20ec25b20c152d53c472fc3fd upstream.

    After commit 00ee22c28915 (PM / wakeup: Use seq_open() to show wakeup
    stats), print_wakeup_source_stats(m, &deleted_ws) is not called from
    wakeup_sources_stats_seq_show() any more.

    Because deleted_ws is one of the wakeup sources, it should be shown
    too, so add it to the end of all other wakeup sources.

    Signed-off-by: zhuguangqing
    [ rjw: Subject & changelog ]
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Florian Fainelli
    Signed-off-by: Greg Kroah-Hartman

    zhuguangqing
     
  • commit 74edd08a4fbf51d65fd8f4c7d8289cd0f392bd91 upstream.

    When executing the following command, we met kernel dump.
    dmesg -c > /dev/null; cd /sys;
    for i in `ls /sys/kernel/debug/regmap/* -d`; do
    echo "Checking regmap in $i";
    cat $i/registers;
    done && grep -ri "0x02d0" *;

    It is because the count value is too big, and kmalloc fails. So add an
    upper bound check to allow max size `PAGE_SIZE << (MAX_ORDER - 1)`.

    Signed-off-by: Peng Fan
    Link: https://lore.kernel.org/r/1584064687-12964-1-git-send-email-peng.fan@nxp.com
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Peng Fan
     
  • [ Upstream commit efc6b6f6c3113e8b203b9debfb72d81e0f3dcace ]

    Currently, SO_REUSEPORT does not work well if connected sockets are in a
    UDP reuseport group.

    Then reuseport_has_conns() returns true and the result of
    reuseport_select_sock() is discarded. Also, unconnected sockets have the
    same score, hence only does the first unconnected socket in udp_hslot
    always receive all packets sent to unconnected sockets.

    So, the result of reuseport_select_sock() should be used for load
    balancing.

    The noteworthy point is that the unconnected sockets placed after
    connected sockets in sock_reuseport.socks will receive more packets than
    others because of the algorithm in reuseport_select_sock().

    index | connected | reciprocal_scale | result
    ---------------------------------------------
    0 | no | 20% | 40%
    1 | no | 20% | 20%
    2 | yes | 20% | 0%
    3 | no | 20% | 40%
    4 | yes | 20% | 0%

    If most of the sockets are connected, this can be a problem, but it still
    works better than now.

    Fixes: acdcecc61285 ("udp: correct reuseport selection with connected sockets")
    CC: Willem de Bruijn
    Reviewed-by: Benjamin Herrenschmidt
    Signed-off-by: Kuniyuki Iwashima
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Kuniyuki Iwashima
     
  • [ Upstream commit f2b2c55e512879a05456eaf5de4d1ed2f7757509 ]

    If an unconnected socket in a UDP reuseport group connect()s, has_conns is
    set to 1. Then, when a packet is received, udp[46]_lib_lookup2() scans all
    sockets in udp_hslot looking for the connected socket with the highest
    score.

    However, when the number of sockets bound to the port exceeds max_socks,
    reuseport_grow() resets has_conns to 0. It can cause udp[46]_lib_lookup2()
    to return without scanning all sockets, resulting in that packets sent to
    connected sockets may be distributed to unconnected sockets.

    Therefore, reuseport_grow() should copy has_conns.

    Fixes: acdcecc61285 ("udp: correct reuseport selection with connected sockets")
    CC: Willem de Bruijn
    Reviewed-by: Benjamin Herrenschmidt
    Signed-off-by: Kuniyuki Iwashima
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Kuniyuki Iwashima
     
  • [ Upstream commit 3ecdda3e9ad837cf9cb41b6faa11b1af3a5abc0c ]

    When adding a stream with stream reconf, the new stream firstly is in
    CLOSED state but new out chunks can still be enqueued. Then once gets
    the confirmation from the peer, the state will change to OPEN.

    However, if the peer denies, it needs to roll back the stream. But when
    doing that, it only sets the stream outcnt back, and the chunks already
    in the new stream don't get purged. It caused these chunks can still be
    dequeued in sctp_outq_dequeue_data().

    As its stream is still in CLOSE, the chunk will be enqueued to the head
    again by sctp_outq_head_data(). This chunk will never be sent out, and
    the chunks after it can never be dequeued. The assoc will be 'hung' in
    a dead loop of sending this chunk.

    To fix it, this patch is to purge these chunks already in the new
    stream by calling sctp_stream_shrink_out() when failing to do the
    addstream reconf.

    Fixes: 11ae76e67a17 ("sctp: implement receiver-side procedures for the Reconf Response Parameter")
    Reported-by: Ying Xu
    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Xin Long
     
  • [ Upstream commit 8f13399db22f909a35735bf8ae2f932e0c8f0e30 ]

    It's not necessary to go list_for_each for outq->out_chunk_list
    when new outcnt >= old outcnt, as no chunk with higher sid than
    new (outcnt - 1) exists in the outqueue.

    While at it, also move the list_for_each code in a new function
    sctp_stream_shrink_out(), which will be used in the next patch.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Xin Long
     
  • [ Upstream commit 17ad73e941b71f3bec7523ea4e9cbc3752461c2d ]

    We recently added some bounds checking in ax25_connect() and
    ax25_sendmsg() and we so we removed the AX25_MAX_DIGIS checks because
    they were no longer required.

    Unfortunately, I believe they are required to prevent integer overflows
    so I have added them back.

    Fixes: 8885bb0621f0 ("AX.25: Prevent out-of-bounds read in ax25_sendmsg()")
    Fixes: 2f2a7ffad5c6 ("AX.25: Fix out-of-bounds read in ax25_connect()")
    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • [ Upstream commit 76be93fc0702322179bb0ea87295d820ee46ad14 ]

    Previously TLP may send multiple probes of new data in one
    flight. This happens when the sender is cwnd limited. After the
    initial TLP containing new data is sent, the sender receives another
    ACK that acks partial inflight. It may re-arm another TLP timer
    to send more, if no further ACK returns before the next TLP timeout
    (PTO) expires. The sender may send in theory a large amount of TLP
    until send queue is depleted. This only happens if the sender sees
    such irregular uncommon ACK pattern. But it is generally undesirable
    behavior during congestion especially.

    The original TLP design restrict only one TLP probe per inflight as
    published in "Reducing Web Latency: the Virtue of Gentle Aggression",
    SIGCOMM 2013. This patch changes TLP to send at most one probe
    per inflight.

    Note that if the sender is app-limited, TLP retransmits old data
    and did not have this issue.

    Signed-off-by: Yuchung Cheng
    Signed-off-by: Neal Cardwell
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Yuchung Cheng
     
  • [ Upstream commit 639f181f0ee20d3249dbc55f740f0167267180f0 ]

    rxrpc_sendmsg() returns EPIPE if there's an outstanding error, such as if
    rxrpc_recvmsg() indicating ENODATA if there's nothing for it to read.

    Change rxrpc_recvmsg() to return EAGAIN instead if there's nothing to read
    as this particular error doesn't get stored in ->sk_err by the networking
    core.

    Also change rxrpc_sendmsg() so that it doesn't fail with delayed receive
    errors (there's no way for it to report which call, if any, the error was
    caused by).

    Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
    Signed-off-by: David Howells
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    David Howells
     
  • [ Upstream commit cebb69754f37d68e1355a5e726fdac317bcda302 ]

    When vlan_newlink call register_vlan_dev fails, it might return error
    with dev->reg_state = NETREG_UNREGISTERED. The rtnl_newlink should
    free the memory. But currently rtnl_newlink only free the memory which
    state is NETREG_UNINITIALIZED.

    BUG: memory leak
    unreferenced object 0xffff8881051de000 (size 4096):
    comm "syz-executor139", pid 560, jiffies 4294745346 (age 32.445s)
    hex dump (first 32 bytes):
    76 6c 61 6e 32 00 00 00 00 00 00 00 00 00 00 00 vlan2...........
    00 45 28 03 81 88 ff ff 00 00 00 00 00 00 00 00 .E(.............
    backtrace:
    [] kmalloc_node include/linux/slab.h:578 [inline]
    [] kvmalloc_node+0x33/0xd0 mm/util.c:574
    [] kvmalloc include/linux/mm.h:753 [inline]
    [] kvzalloc include/linux/mm.h:761 [inline]
    [] alloc_netdev_mqs+0x83/0xd90 net/core/dev.c:9929
    [] rtnl_create_link+0x2c0/0xa20 net/core/rtnetlink.c:3067
    [] __rtnl_newlink+0xc9c/0x1330 net/core/rtnetlink.c:3329
    [] rtnl_newlink+0x66/0x90 net/core/rtnetlink.c:3397
    [] rtnetlink_rcv_msg+0x540/0x990 net/core/rtnetlink.c:5460
    [] netlink_rcv_skb+0x12b/0x3a0 net/netlink/af_netlink.c:2469
    [] netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
    [] netlink_unicast+0x4c6/0x690 net/netlink/af_netlink.c:1329
    [] netlink_sendmsg+0x735/0xcc0 net/netlink/af_netlink.c:1918
    [] sock_sendmsg_nosec net/socket.c:652 [inline]
    [] sock_sendmsg+0x109/0x140 net/socket.c:672
    [] ____sys_sendmsg+0x5f5/0x780 net/socket.c:2352
    [] ___sys_sendmsg+0x11d/0x1a0 net/socket.c:2406
    [] __sys_sendmsg+0xeb/0x1b0 net/socket.c:2439
    [] do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359
    [] entry_SYSCALL_64_after_hwframe+0x44/0xa9

    Fixes: cb626bf566eb ("net-sysfs: Fix reference count leak")
    Reported-by: Hulk Robot
    Signed-off-by: Weilong Chen
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Weilong Chen
     
  • [ Upstream commit af9f691f0f5bdd1ade65a7b84927639882d7c3e5 ]

    We have to detach sock from socket in qrtr_release(),
    otherwise skb->sk may still reference to this socket
    when the skb is released in tun->queue, particularly
    sk->sk_wq still points to &sock->wq, which leads to
    a UAF.

    Reported-and-tested-by: syzbot+6720d64f31c081c2f708@syzkaller.appspotmail.com
    Fixes: 28fb4e59a47d ("net: qrtr: Expose tunneling endpoint to user space")
    Cc: Bjorn Andersson
    Cc: Eric Dumazet
    Signed-off-by: Cong Wang
    Reviewed-by: Eric Dumazet
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Cong Wang
     
  • [ Upstream commit b0a422772fec29811e293c7c0e6f991c0fd9241d ]

    We can't use IS_UDPLITE to replace udp_sk->pcflag when UDPLITE_RECV_CC is
    checked.

    Fixes: b2bf1e2659b1 ("[UDP]: Clean up for IS_UDPLITE macro")
    Signed-off-by: Miaohe Lin
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Miaohe Lin
     
  • [ Upstream commit 9bb5fbea59f36a589ef886292549ca4052fe676c ]

    When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to
    add a newline for easy reading.

    root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
    0root@syzkaller:~#

    Signed-off-by: Xiongfeng Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Xiongfeng Wang
     
  • [ Upstream commit 46ef5b89ec0ecf290d74c4aee844f063933c4da4 ]

    KASAN report null-ptr-deref error when register_netdev() failed:

    KASAN: null-ptr-deref in range [0x00000000000003c0-0x00000000000003c7]
    CPU: 2 PID: 422 Comm: ip Not tainted 5.8.0-rc4+ #12
    Call Trace:
    ip6gre_init_net+0x4ab/0x580
    ? ip6gre_tunnel_uninit+0x3f0/0x3f0
    ops_init+0xa8/0x3c0
    setup_net+0x2de/0x7e0
    ? rcu_read_lock_bh_held+0xb0/0xb0
    ? ops_init+0x3c0/0x3c0
    ? kasan_unpoison_shadow+0x33/0x40
    ? __kasan_kmalloc.constprop.0+0xc2/0xd0
    copy_net_ns+0x27d/0x530
    create_new_namespaces+0x382/0xa30
    unshare_nsproxy_namespaces+0xa1/0x1d0
    ksys_unshare+0x39c/0x780
    ? walk_process_tree+0x2a0/0x2a0
    ? trace_hardirqs_on+0x4a/0x1b0
    ? _raw_spin_unlock_irq+0x1f/0x30
    ? syscall_trace_enter+0x1a7/0x330
    ? do_syscall_64+0x1c/0xa0
    __x64_sys_unshare+0x2d/0x40
    do_syscall_64+0x56/0xa0
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    ip6gre_tunnel_uninit() has set 'ign->fb_tunnel_dev' to NULL, later
    access to ign->fb_tunnel_dev cause null-ptr-deref. Fix it by saving
    'ign->fb_tunnel_dev' to local variable ndev.

    Fixes: dafabb6590cb ("ip6_gre: fix use-after-free in ip6gre_tunnel_lookup()")
    Reported-by: Hulk Robot
    Signed-off-by: Wei Yongjun
    Reviewed-by: Eric Dumazet
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     
  • [ Upstream commit 8fdcabeac39824fe67480fd9508d80161c541854 ]

    This driver is not working because of problems of its receiving code.
    This patch fixes it to make it work.

    When the driver receives an LAPB frame, it should first pass the frame
    to the LAPB module to process. After processing, the LAPB module passes
    the data (the packet) back to the driver, the driver should then add a
    one-byte pseudo header and pass the data to upper layers.

    The changes to the "x25_asy_bump" function and the
    "x25_asy_data_indication" function are to correctly implement this
    procedure.

    Also, the "x25_asy_unesc" function ignores any frame that is shorter
    than 3 bytes. However the shortest frames are 2-byte long. So we need
    to change it to allow 2-byte frames to pass.

    Cc: Eric Dumazet
    Cc: Martin Schiller
    Signed-off-by: Xie He
    Reviewed-by: Martin Schiller
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Xie He
     
  • [ Upstream commit 7df5cb75cfb8acf96c7f2342530eb41e0c11f4c3 ]

    IRQs are disabled when freeing skbs in input queue.
    Use the IRQ safe variant to free skbs here.

    Fixes: 145dd5f9c88f ("net: flush the softnet backlog in process context")
    Signed-off-by: Subash Abhinov Kasiviswanathan
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Subash Abhinov Kasiviswanathan