1. 12 Nov, 2019 25 commits
    • Johan Hovold's avatar
      can: peak_usb: fix slab info leak · da281558
      Johan Hovold authored
      commit f7a1337f upstream.
      
      Fix a small slab info leak due to a failure to clear the command buffer
      at allocation.
      
      The first 16 bytes of the command buffer are always sent to the device
      in pcan_usb_send_cmd() even though only the first two may have been
      initialised in case no argument payload is provided (e.g. when waiting
      for a response).
      
      Fixes: bb478555 ("can: usb: PEAK-System Technik USB adapters driver core")
      Cc: stable <stable@vger.kernel.org>     # 3.4
      Reported-by: syzbot+863724e7128e14b26732@syzkaller.appspotmail.com
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      da281558
    • Navid Emamdoost's avatar
      can: gs_usb: gs_can_open(): prevent memory leak · b46a2067
      Navid Emamdoost authored
      commit fb5be6a7 upstream.
      
      In gs_can_open() if usb_submit_urb() fails the allocated urb should be
      released.
      
      Fixes: d08e973a ("can: gs_usb: Added support for the GS_USB CAN devices")
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b46a2067
    • Stephane Grosjean's avatar
      can: peak_usb: fix a potential out-of-sync while decoding packets · d9510ea1
      Stephane Grosjean authored
      commit de280f40 upstream.
      
      When decoding a buffer received from PCAN-USB, the first timestamp read in
      a packet is a 16-bit coded time base, and the next ones are an 8-bit
      offset to this base, regardless of the type of packet read.
      
      This patch corrects a potential loss of synchronization by using a
      timestamp index read from the buffer, rather than an index of received
      data packets, to determine on the sizeof the timestamp to be read from the
      packet being decoded.
      Signed-off-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
      Fixes: 46be265d ("can: usb: PEAK-System Technik PCAN-USB specific part")
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d9510ea1
    • Kurt Van Dijck's avatar
      can: c_can: c_can_poll(): only read status register after status IRQ · 7a5f2a35
      Kurt Van Dijck authored
      commit 3cb3eaac upstream.
      
      When the status register is read without the status IRQ pending, the
      chip may not raise the interrupt line for an upcoming status interrupt
      and the driver may miss a status interrupt.
      
      It is critical that the BUSOFF status interrupt is forwarded to the
      higher layers, since no more interrupts will follow without
      intervention.
      
      Thanks to Wolfgang and Joe for bringing up the first idea.
      Signed-off-by: default avatarKurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Joe Burmeister <joe.burmeister@devtank.co.uk>
      Fixes: fa39b54c ("can: c_can: Get rid of pointless interrupts")
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7a5f2a35
    • Johan Hovold's avatar
      can: usb_8dev: fix use-after-free on disconnect · 0589de2d
      Johan Hovold authored
      commit 37597394 upstream.
      
      The driver was accessing its driver data after having freed it.
      
      Fixes: 0024d8ad ("can: usb_8dev: Add support for USB2CAN interface from 8 devices")
      Cc: stable <stable@vger.kernel.org>     # 3.9
      Cc: Bernd Krumboeck <b.krumboeck@gmail.com>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0589de2d
    • Dan Carpenter's avatar
      netfilter: ipset: Fix an error code in ip_set_sockfn_get() · 0e0965a2
      Dan Carpenter authored
      commit 30b7244d upstream.
      
      The copy_to_user() function returns the number of bytes remaining to be
      copied.  In this code, that positive return is checked at the end of the
      function and we return zero/success.  What we should do instead is
      return -EFAULT.
      
      Fixes: a7b4f989 ("netfilter: ipset: IP set core support")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarJozsef Kadlecsik <kadlec@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0e0965a2
    • Lukas Wunner's avatar
      netfilter: nf_tables: Align nft_expr private data to 64-bit · f823bf0f
      Lukas Wunner authored
      commit 250367c5 upstream.
      
      Invoking the following commands on a 32-bit architecture with strict
      alignment requirements (such as an ARMv7-based Raspberry Pi) results
      in an alignment exception:
      
       # nft add table ip test-ip4
       # nft add chain ip test-ip4 output { type filter hook output priority 0; }
       # nft add rule  ip test-ip4 output quota 1025 bytes
      
      Alignment trap: not handling instruction e1b26f9f at [<7f4473f8>]
      Unhandled fault: alignment exception (0x001) at 0xb832e824
      Internal error: : 1 [#1] PREEMPT SMP ARM
      Hardware name: BCM2835
      [<7f4473fc>] (nft_quota_do_init [nft_quota])
      [<7f447448>] (nft_quota_init [nft_quota])
      [<7f4260d0>] (nf_tables_newrule [nf_tables])
      [<7f4168dc>] (nfnetlink_rcv_batch [nfnetlink])
      [<7f416bd0>] (nfnetlink_rcv [nfnetlink])
      [<8078b334>] (netlink_unicast)
      [<8078b664>] (netlink_sendmsg)
      [<8071b47c>] (sock_sendmsg)
      [<8071bd18>] (___sys_sendmsg)
      [<8071ce3c>] (__sys_sendmsg)
      [<8071ce94>] (sys_sendmsg)
      
      The reason is that nft_quota_do_init() calls atomic64_set() on an
      atomic64_t which is only aligned to 32-bit, not 64-bit, because it
      succeeds struct nft_expr in memory which only contains a 32-bit pointer.
      Fix by aligning the nft_expr private data to 64-bit.
      
      Fixes: 96518518 ("netfilter: add nftables")
      Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Cc: stable@vger.kernel.org # v3.13+
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f823bf0f
    • Alexandru Ardelean's avatar
      iio: imu: adis16480: make sure provided frequency is positive · 454face0
      Alexandru Ardelean authored
      commit 24e1eb5c upstream.
      
      It could happen that either `val` or `val2` [provided from userspace] is
      negative. In that case the computed frequency could get a weird value.
      
      Fix this by checking that neither of the 2 variables is negative, and check
      that the computed result is not-zero.
      
      Fixes: e4f95939 ("iio: imu: adis16480 switch sampling frequency attr to core support")
      Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      454face0
    • Luis Henriques's avatar
      ceph: fix use-after-free in __ceph_remove_cap() · a4d31004
      Luis Henriques authored
      commit ea60ed6f upstream.
      
      KASAN reports a use-after-free when running xfstest generic/531, with the
      following trace:
      
      [  293.903362]  kasan_report+0xe/0x20
      [  293.903365]  rb_erase+0x1f/0x790
      [  293.903370]  __ceph_remove_cap+0x201/0x370
      [  293.903375]  __ceph_remove_caps+0x4b/0x70
      [  293.903380]  ceph_evict_inode+0x4e/0x360
      [  293.903386]  evict+0x169/0x290
      [  293.903390]  __dentry_kill+0x16f/0x250
      [  293.903394]  dput+0x1c6/0x440
      [  293.903398]  __fput+0x184/0x330
      [  293.903404]  task_work_run+0xb9/0xe0
      [  293.903410]  exit_to_usermode_loop+0xd3/0xe0
      [  293.903413]  do_syscall_64+0x1a0/0x1c0
      [  293.903417]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      This happens because __ceph_remove_cap() may queue a cap release
      (__ceph_queue_cap_release) which can be scheduled before that cap is
      removed from the inode list with
      
      	rb_erase(&cap->ci_node, &ci->i_caps);
      
      And, when this finally happens, the use-after-free will occur.
      
      This can be fixed by removing the cap from the inode list before being
      removed from the session list, and thus eliminating the risk of an UAF.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLuis Henriques <lhenriques@suse.com>
      Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a4d31004
    • Alex Deucher's avatar
      drm/radeon: fix si_enable_smc_cac() failed issue · 4acc4571
      Alex Deucher authored
      commit 2c409ba8 upstream.
      
      Need to set the dte flag on this asic.
      
      Port the fix from amdgpu:
      5cb818b8 ("drm/amd/amdgpu: fix si_enable_smc_cac() failed issue")
      Reviewed-by: default avatarYong Zhao <yong.zhao@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4acc4571
    • Jiri Olsa's avatar
      perf tools: Fix time sorting · 9666d529
      Jiri Olsa authored
      commit 722ddfde upstream.
      
      The final sort might get confused when the comparison is done over
      bigger numbers than int like for -s time.
      
      Check the following report for longer workloads:
      
        $ perf report -s time -F time,overhead --stdio
      
      Fix hist_entry__sort() to properly return int64_t and not possible cut
      int.
      
      Fixes: 043ca389 ("perf tools: Use hpp formats to sort final output")
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Reviewed-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: stable@vger.kernel.org # v3.16+
      Link: http://lore.kernel.org/lkml/20191104232711.16055-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9666d529
    • Kevin Hao's avatar
      dump_stack: avoid the livelock of the dump_lock · 1bb77722
      Kevin Hao authored
      commit 5cbf2fff upstream.
      
      In the current code, we use the atomic_cmpxchg() to serialize the output
      of the dump_stack(), but this implementation suffers the thundering herd
      problem.  We have observed such kind of livelock on a Marvell cn96xx
      board(24 cpus) when heavily using the dump_stack() in a kprobe handler.
      Actually we can let the competitors to wait for the releasing of the
      lock before jumping to atomic_cmpxchg().  This will definitely mitigate
      the thundering herd problem.  Thanks Linus for the suggestion.
      
      [akpm@linux-foundation.org: fix comment]
      Link: http://lkml.kernel.org/r/20191030031637.6025-1-haokexin@gmail.com
      Fixes: b58d9774 ("dump_stack: serialize the output from dump_stack()")
      Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1bb77722
    • Michal Hocko's avatar
      mm, vmstat: hide /proc/pagetypeinfo from normal users · ba052046
      Michal Hocko authored
      commit abaed011 upstream.
      
      /proc/pagetypeinfo is a debugging tool to examine internal page
      allocator state wrt to fragmentation.  It is not very useful for any
      other use so normal users really do not need to read this file.
      
      Waiman Long has noticed that reading this file can have negative side
      effects because zone->lock is necessary for gathering data and that a)
      interferes with the page allocator and its users and b) can lead to hard
      lockups on large machines which have very long free_list.
      
      Reduce both issues by simply not exporting the file to regular users.
      
      Link: http://lkml.kernel.org/r/20191025072610.18526-2-mhocko@kernel.org
      Fixes: 467c996c ("Print out statistics in relation to fragmentation avoidance to /proc/pagetypeinfo")
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
      Reported-by: default avatarWaiman Long <longman@redhat.com>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarWaiman Long <longman@redhat.com>
      Acked-by: default avatarRafael Aquini <aquini@redhat.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Roman Gushchin <guro@fb.com>
      Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Cc: Jann Horn <jannh@google.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ba052046
    • Yang Shi's avatar
      mm: thp: handle page cache THP correctly in PageTransCompoundMap · 967fcde6
      Yang Shi authored
      commit 169226f7 upstream.
      
      We have a usecase to use tmpfs as QEMU memory backend and we would like
      to take the advantage of THP as well.  But, our test shows the EPT is
      not PMD mapped even though the underlying THP are PMD mapped on host.
      The number showed by /sys/kernel/debug/kvm/largepage is much less than
      the number of PMD mapped shmem pages as the below:
      
        7f2778200000-7f2878200000 rw-s 00000000 00:14 262232 /dev/shm/qemu_back_mem.mem.Hz2hSf (deleted)
        Size:            4194304 kB
        [snip]
        AnonHugePages:         0 kB
        ShmemPmdMapped:   579584 kB
        [snip]
        Locked:                0 kB
      
        cat /sys/kernel/debug/kvm/largepages
        12
      
      And some benchmarks do worse than with anonymous THPs.
      
      By digging into the code we figured out that commit 127393fb ("mm:
      thp: kvm: fix memory corruption in KVM with THP enabled") checks if
      there is a single PTE mapping on the page for anonymous THP when setting
      up EPT map.  But the _mapcount < 0 check doesn't work for page cache THP
      since every subpage of page cache THP would get _mapcount inc'ed once it
      is PMD mapped, so PageTransCompoundMap() always returns false for page
      cache THP.  This would prevent KVM from setting up PMD mapped EPT entry.
      
      So we need handle page cache THP correctly.  However, when page cache
      THP's PMD gets split, kernel just remove the map instead of setting up
      PTE map like what anonymous THP does.  Before KVM calls get_user_pages()
      the subpages may get PTE mapped even though it is still a THP since the
      page cache THP may be mapped by other processes at the mean time.
      
      Checking its _mapcount and whether the THP has PTE mapped or not.
      Although this may report some false negative cases (PTE mapped by other
      processes), it looks not trivial to make this accurate.
      
      With this fix /sys/kernel/debug/kvm/largepage would show reasonable
      pages are PMD mapped by EPT as the below:
      
        7fbeaee00000-7fbfaee00000 rw-s 00000000 00:14 275464 /dev/shm/qemu_back_mem.mem.SKUvat (deleted)
        Size:            4194304 kB
        [snip]
        AnonHugePages:         0 kB
        ShmemPmdMapped:   557056 kB
        [snip]
        Locked:                0 kB
      
        cat /sys/kernel/debug/kvm/largepages
        271
      
      And the benchmarks are as same as anonymous THPs.
      
      [yang.shi@linux.alibaba.com: v4]
        Link: http://lkml.kernel.org/r/1571865575-42913-1-git-send-email-yang.shi@linux.alibaba.com
      Link: http://lkml.kernel.org/r/1571769577-89735-1-git-send-email-yang.shi@linux.alibaba.com
      Fixes: dd78fedd ("rmap: support file thp")
      Signed-off-by: default avatarYang Shi <yang.shi@linux.alibaba.com>
      Reported-by: default avatarGang Deng <gavin.dg@linux.alibaba.com>
      Tested-by: default avatarGang Deng <gavin.dg@linux.alibaba.com>
      Suggested-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: <stable@vger.kernel.org>	[4.8+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      967fcde6
    • Takashi Iwai's avatar
      ALSA: hda/ca0132 - Fix possible workqueue stall · 1125e871
      Takashi Iwai authored
      commit 15c2b3cc upstream.
      
      The unsolicited event handler for the headphone jack on CA0132 codec
      driver tries to reschedule the another delayed work with
      cancel_delayed_work_sync().  It's no good idea, unfortunately,
      especially after we changed the work queue to the standard global
      one; this may lead to a stall because both works are using the same
      global queue.
      
      Fix it by dropping the _sync but does call cancel_delayed_work()
      instead.
      
      Fixes: 993884f6 ("ALSA: hda/ca0132 - Delay HP amp turnon.")
      BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1155836
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20191105134316.19294-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1125e871
    • Takashi Sakamoto's avatar
      ALSA: bebob: fix to detect configured source of sampling clock for Focusrite Saffire Pro i/o series · ce8b4a95
      Takashi Sakamoto authored
      commit 706ad674 upstream.
      
      For Focusrite Saffire Pro i/o, the lowest 8 bits of register represents
      configured source of sampling clock. The next lowest 8 bits represents
      whether the configured source is actually detected or not just after
      the register is changed for the source.
      
      Current implementation evaluates whole the register to detect configured
      source. This results in failure due to the next lowest 8 bits when the
      source is connected in advance.
      
      This commit fixes the bug.
      
      Fixes: 25784ec2 ("ALSA: bebob: Add support for Focusrite Saffire/SaffirePro series")
      Cc: <stable@vger.kernel.org> # v3.16+
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20191102150920.20367-1-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ce8b4a95
    • Takashi Iwai's avatar
      ALSA: timer: Fix incorrectly assigned timer instance · 8bdaac0c
      Takashi Iwai authored
      commit e7af6307 upstream.
      
      The clean up commit 41672c0c ("ALSA: timer: Simplify error path in
      snd_timer_open()") unified the error handling code paths with the
      standard goto, but it introduced a subtle bug: the timer instance is
      stored in snd_timer_open() incorrectly even if it returns an error.
      This may eventually lead to UAF, as spotted by fuzzer.
      
      The culprit is the snd_timer_open() code checks the
      SNDRV_TIMER_IFLG_EXCLUSIVE flag with the common variable timeri.
      This variable is supposed to be the newly created instance, but we
      (ab-)used it for a temporary check before the actual creation of a
      timer instance.  After that point, there is another check for the max
      number of instances, and it bails out if over the threshold.  Before
      the refactoring above, it worked fine because the code returned
      directly from that point.  After the refactoring, however, it jumps to
      the unified error path that stores the timeri variable in return --
      even if it returns an error.  Unfortunately this stored value is kept
      in the caller side (snd_timer_user_tselect()) in tu->timeri.  This
      causes inconsistency later, as if the timer was successfully
      assigned.
      
      In this patch, we fix it by not re-using timeri variable but a
      temporary variable for testing the exclusive connection, so timeri
      remains NULL at that point.
      
      Fixes: 41672c0c ("ALSA: timer: Simplify error path in snd_timer_open()")
      Reported-and-tested-by: default avatarTristan Madani <tristmd@gmail.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20191106165547.23518-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8bdaac0c
    • Manish Chopra's avatar
      qede: fix NULL pointer deref in __qede_remove() · 3e68866f
      Manish Chopra authored
      [ Upstream commit deabc871 ]
      
      While rebooting the system with SR-IOV vfs enabled leads
      to below crash due to recurrence of __qede_remove() on the VF
      devices (first from .shutdown() flow of the VF itself and
      another from PF's .shutdown() flow executing pci_disable_sriov())
      
      This patch adds a safeguard in __qede_remove() flow to fix this,
      so that driver doesn't attempt to remove "already removed" devices.
      
      [  194.360134] BUG: unable to handle kernel NULL pointer dereference at 00000000000008dc
      [  194.360227] IP: [<ffffffffc03553c4>] __qede_remove+0x24/0x130 [qede]
      [  194.360304] PGD 0
      [  194.360325] Oops: 0000 [#1] SMP
      [  194.360360] Modules linked in: tcp_lp fuse tun bridge stp llc devlink bonding ip_set nfnetlink ib_isert iscsi_target_mod ib_srpt target_core_mod ib_srp scsi_transport_srp scsi_tgt ib_ipoib ib_umad rpcrdma sunrpc rdma_ucm ib_uverbs ib_iser rdma_cm iw_cm ib_cm libiscsi scsi_transport_iscsi dell_smbios iTCO_wdt iTCO_vendor_support dell_wmi_descriptor dcdbas vfat fat pcc_cpufreq skx_edac intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd qedr ib_core pcspkr ses enclosure joydev ipmi_ssif sg i2c_i801 lpc_ich mei_me mei wmi ipmi_si ipmi_devintf ipmi_msghandler tpm_crb acpi_pad acpi_power_meter xfs libcrc32c sd_mod crc_t10dif crct10dif_generic crct10dif_pclmul crct10dif_common crc32c_intel mgag200
      [  194.361044]  qede i2c_algo_bit drm_kms_helper qed syscopyarea sysfillrect nvme sysimgblt fb_sys_fops ttm nvme_core mpt3sas crc8 ptp drm pps_core ahci raid_class scsi_transport_sas libahci libata drm_panel_orientation_quirks nfit libnvdimm dm_mirror dm_region_hash dm_log dm_mod [last unloaded: ip_tables]
      [  194.361297] CPU: 51 PID: 7996 Comm: reboot Kdump: loaded Not tainted 3.10.0-1062.el7.x86_64 #1
      [  194.361359] Hardware name: Dell Inc. PowerEdge MX840c/0740HW, BIOS 2.4.6 10/15/2019
      [  194.361412] task: ffff9cea9b360000 ti: ffff9ceabebdc000 task.ti: ffff9ceabebdc000
      [  194.361463] RIP: 0010:[<ffffffffc03553c4>]  [<ffffffffc03553c4>] __qede_remove+0x24/0x130 [qede]
      [  194.361534] RSP: 0018:ffff9ceabebdfac0  EFLAGS: 00010282
      [  194.361570] RAX: 0000000000000000 RBX: ffff9cd013846098 RCX: 0000000000000000
      [  194.361621] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9cd013846098
      [  194.361668] RBP: ffff9ceabebdfae8 R08: 0000000000000000 R09: 0000000000000000
      [  194.361715] R10: 00000000bfe14201 R11: ffff9ceabfe141e0 R12: 0000000000000000
      [  194.361762] R13: ffff9cd013846098 R14: 0000000000000000 R15: ffff9ceab5e48000
      [  194.361810] FS:  00007f799c02d880(0000) GS:ffff9ceacb0c0000(0000) knlGS:0000000000000000
      [  194.361865] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  194.361903] CR2: 00000000000008dc CR3: 0000001bdac76000 CR4: 00000000007607e0
      [  194.361953] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  194.362002] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  194.362051] PKRU: 55555554
      [  194.362073] Call Trace:
      [  194.362109]  [<ffffffffc0355500>] qede_remove+0x10/0x20 [qede]
      [  194.362180]  [<ffffffffb97d0f3e>] pci_device_remove+0x3e/0xc0
      [  194.362240]  [<ffffffffb98b3c52>] __device_release_driver+0x82/0xf0
      [  194.362285]  [<ffffffffb98b3ce3>] device_release_driver+0x23/0x30
      [  194.362343]  [<ffffffffb97c86d4>] pci_stop_bus_device+0x84/0xa0
      [  194.362388]  [<ffffffffb97c87e2>] pci_stop_and_remove_bus_device+0x12/0x20
      [  194.362450]  [<ffffffffb97f153f>] pci_iov_remove_virtfn+0xaf/0x160
      [  194.362496]  [<ffffffffb97f1aec>] sriov_disable+0x3c/0xf0
      [  194.362534]  [<ffffffffb97f1bc3>] pci_disable_sriov+0x23/0x30
      [  194.362599]  [<ffffffffc02f83c3>] qed_sriov_disable+0x5e3/0x650 [qed]
      [  194.362658]  [<ffffffffb9622df6>] ? kfree+0x106/0x140
      [  194.362709]  [<ffffffffc02cc0c0>] ? qed_free_stream_mem+0x70/0x90 [qed]
      [  194.362754]  [<ffffffffb9622df6>] ? kfree+0x106/0x140
      [  194.362803]  [<ffffffffc02cd659>] qed_slowpath_stop+0x1a9/0x1d0 [qed]
      [  194.362854]  [<ffffffffc035544e>] __qede_remove+0xae/0x130 [qede]
      [  194.362904]  [<ffffffffc03554e0>] qede_shutdown+0x10/0x20 [qede]
      [  194.362956]  [<ffffffffb97cf90a>] pci_device_shutdown+0x3a/0x60
      [  194.363010]  [<ffffffffb98b180b>] device_shutdown+0xfb/0x1f0
      [  194.363066]  [<ffffffffb94b66c6>] kernel_restart_prepare+0x36/0x40
      [  194.363107]  [<ffffffffb94b66e2>] kernel_restart+0x12/0x60
      [  194.363146]  [<ffffffffb94b6959>] SYSC_reboot+0x229/0x260
      [  194.363196]  [<ffffffffb95f200d>] ? handle_mm_fault+0x39d/0x9b0
      [  194.363253]  [<ffffffffb942b621>] ? __switch_to+0x151/0x580
      [  194.363304]  [<ffffffffb9b7ec28>] ? __schedule+0x448/0x9c0
      [  194.363343]  [<ffffffffb94b69fe>] SyS_reboot+0xe/0x10
      [  194.363387]  [<ffffffffb9b8bede>] system_call_fastpath+0x25/0x2a
      [  194.363430] Code: f9 e9 37 ff ff ff 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 41 55 4c 8d af 98 00 00 00 41 54 4c 89 ef 41 89 f4 53 e8 4c e4 55 f9 <80> b8 dc 08 00 00 01 48 89 c3 4c 8d b8 c0 08 00 00 4c 8b b0 c0
      [  194.363712] RIP  [<ffffffffc03553c4>] __qede_remove+0x24/0x130 [qede]
      [  194.363764]  RSP <ffff9ceabebdfac0>
      [  194.363791] CR2: 00000000000008dc
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarSudarsana Kalluru <skalluru@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3e68866f
    • Pan Bian's avatar
      NFC: st21nfca: fix double free · 79049c11
      Pan Bian authored
      [ Upstream commit 99a8efbb ]
      
      The variable nfcid_skb is not changed in the callee nfc_hci_get_param()
      if error occurs. Consequently, the freed variable nfcid_skb will be
      freed again, resulting in a double free bug. Set nfcid_skb to NULL after
      releasing it to fix the bug.
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      79049c11
    • Pan Bian's avatar
      nfc: netlink: fix double device reference drop · 8a0a5431
      Pan Bian authored
      [ Upstream commit 025ec40b ]
      
      The function nfc_put_device(dev) is called twice to drop the reference
      to dev when there is no associated local llcp. Remove one of them to fix
      the bug.
      
      Fixes: 52feb444 ("NFC: Extend netlink interface for LTO, RW, and MIUX parameters support")
      Fixes: d9b8d8e1 ("NFC: llcp: Service Name Lookup netlink interface")
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Reviewed-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8a0a5431
    • Pan Bian's avatar
      NFC: fdp: fix incorrect free object · 6134e4fc
      Pan Bian authored
      [ Upstream commit 517ce4e9 ]
      
      The address of fw_vsc_cfg is on stack. Releasing it with devm_kfree() is
      incorrect, which may result in a system crash or other security impacts.
      The expected object to free is *fw_vsc_cfg.
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6134e4fc
    • Aleksander Morgado's avatar
      net: usb: qmi_wwan: add support for DW5821e with eSIM support · 17ac2bde
      Aleksander Morgado authored
      [ Upstream commit e497df68 ]
      
      Exactly same layout as the default DW5821e module, just a different
      vid/pid.
      
      The QMI interface is exposed in USB configuration #1:
      
      P:  Vendor=413c ProdID=81e0 Rev=03.18
      S:  Manufacturer=Dell Inc.
      S:  Product=DW5821e-eSIM Snapdragon X20 LTE
      S:  SerialNumber=0123456789ABCDEF
      C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:  If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
      I:  If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
      I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      Signed-off-by: default avatarAleksander Morgado <aleksander@aleksander.es>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17ac2bde
    • Eric Dumazet's avatar
      net: fix data-race in neigh_event_send() · a723c971
      Eric Dumazet authored
      [ Upstream commit 1b53d644 ]
      
      KCSAN reported the following data-race [1]
      
      The fix will also prevent the compiler from optimizing out
      the condition.
      
      [1]
      
      BUG: KCSAN: data-race in neigh_resolve_output / neigh_resolve_output
      
      write to 0xffff8880a41dba78 of 8 bytes by interrupt on cpu 1:
       neigh_event_send include/net/neighbour.h:443 [inline]
       neigh_resolve_output+0x78/0x480 net/core/neighbour.c:1474
       neigh_output include/net/neighbour.h:511 [inline]
       ip_finish_output2+0x4af/0xe40 net/ipv4/ip_output.c:228
       __ip_finish_output net/ipv4/ip_output.c:308 [inline]
       __ip_finish_output+0x23a/0x490 net/ipv4/ip_output.c:290
       ip_finish_output+0x41/0x160 net/ipv4/ip_output.c:318
       NF_HOOK_COND include/linux/netfilter.h:294 [inline]
       ip_output+0xdf/0x210 net/ipv4/ip_output.c:432
       dst_output include/net/dst.h:436 [inline]
       ip_local_out+0x74/0x90 net/ipv4/ip_output.c:125
       __ip_queue_xmit+0x3a8/0xa40 net/ipv4/ip_output.c:532
       ip_queue_xmit+0x45/0x60 include/net/ip.h:237
       __tcp_transmit_skb+0xe81/0x1d60 net/ipv4/tcp_output.c:1169
       tcp_transmit_skb net/ipv4/tcp_output.c:1185 [inline]
       __tcp_retransmit_skb+0x4bd/0x15f0 net/ipv4/tcp_output.c:2976
       tcp_retransmit_skb+0x36/0x1a0 net/ipv4/tcp_output.c:2999
       tcp_retransmit_timer+0x719/0x16d0 net/ipv4/tcp_timer.c:515
       tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:598
       tcp_write_timer+0xd1/0xf0 net/ipv4/tcp_timer.c:618
      
      read to 0xffff8880a41dba78 of 8 bytes by interrupt on cpu 0:
       neigh_event_send include/net/neighbour.h:442 [inline]
       neigh_resolve_output+0x57/0x480 net/core/neighbour.c:1474
       neigh_output include/net/neighbour.h:511 [inline]
       ip_finish_output2+0x4af/0xe40 net/ipv4/ip_output.c:228
       __ip_finish_output net/ipv4/ip_output.c:308 [inline]
       __ip_finish_output+0x23a/0x490 net/ipv4/ip_output.c:290
       ip_finish_output+0x41/0x160 net/ipv4/ip_output.c:318
       NF_HOOK_COND include/linux/netfilter.h:294 [inline]
       ip_output+0xdf/0x210 net/ipv4/ip_output.c:432
       dst_output include/net/dst.h:436 [inline]
       ip_local_out+0x74/0x90 net/ipv4/ip_output.c:125
       __ip_queue_xmit+0x3a8/0xa40 net/ipv4/ip_output.c:532
       ip_queue_xmit+0x45/0x60 include/net/ip.h:237
       __tcp_transmit_skb+0xe81/0x1d60 net/ipv4/tcp_output.c:1169
       tcp_transmit_skb net/ipv4/tcp_output.c:1185 [inline]
       __tcp_retransmit_skb+0x4bd/0x15f0 net/ipv4/tcp_output.c:2976
       tcp_retransmit_skb+0x36/0x1a0 net/ipv4/tcp_output.c:2999
       tcp_retransmit_timer+0x719/0x16d0 net/ipv4/tcp_timer.c:515
       tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:598
      
      Reported by Kernel Concurrency Sanitizer on:
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.0-rc3+ #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a723c971
    • David Ahern's avatar
      ipv4: Fix table id reference in fib_sync_down_addr · ed9acfe2
      David Ahern authored
      [ Upstream commit e0a31262 ]
      
      Hendrik reported routes in the main table using source address are not
      removed when the address is removed. The problem is that fib_sync_down_addr
      does not account for devices in the default VRF which are associated
      with the main table. Fix by updating the table id reference.
      
      Fixes: 5a56a0b3 ("net: Don't delete routes in different VRFs")
      Reported-by: default avatarHendrik Donner <hd@os-cillation.de>
      Signed-off-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ed9acfe2
    • Oliver Neukum's avatar
      CDC-NCM: handle incomplete transfer of MTU · a3622b6d
      Oliver Neukum authored
      [ Upstream commit 332f989a ]
      
      A malicious device may give half an answer when asked
      for its MTU. The driver will proceed after this with
      a garbage MTU. Anything but a complete answer must be treated
      as an error.
      
      V2: used sizeof as request by Alexander
      
      Reported-and-tested-by: syzbot+0631d878823ce2411636@syzkaller.appspotmail.com
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a3622b6d
  2. 10 Nov, 2019 15 commits