1. 21 9月, 2019 40 次提交
    • Z
      ARM: 8901/1: add a criteria for pfn_valid of arm · 080ca754
      zhaoyang 提交于
      [ Upstream commit 5b3efa4f1479c91cb8361acef55f9c6662feba57 ]
      
      pfn_valid can be wrong when parsing a invalid pfn whose phys address
      exceeds BITS_PER_LONG as the MSB will be trimed when shifted.
      
      The issue originally arise from bellowing call stack, which corresponding to
      an access of the /proc/kpageflags from userspace with a invalid pfn parameter
      and leads to kernel panic.
      
      [46886.723249] c7 [<c031ff98>] (stable_page_flags) from [<c03203f8>]
      [46886.723264] c7 [<c0320368>] (kpageflags_read) from [<c0312030>]
      [46886.723280] c7 [<c0311fb0>] (proc_reg_read) from [<c02a6e6c>]
      [46886.723290] c7 [<c02a6e24>] (__vfs_read) from [<c02a7018>]
      [46886.723301] c7 [<c02a6f74>] (vfs_read) from [<c02a778c>]
      [46886.723315] c7 [<c02a770c>] (SyS_pread64) from [<c0108620>]
      (ret_fast_syscall+0x0/0x28)
      Signed-off-by: NZhaoyang Huang <zhaoyang.huang@unisoc.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      080ca754
    • N
      usb: host: xhci-tegra: Set DMA mask correctly · c6d779fd
      Nagarjuna Kristam 提交于
      [ Upstream commit 993cc8753453fccfe060a535bbe21fcf1001b626 ]
      
      The Falcon microcontroller that runs the XUSB firmware and which is
      responsible for exposing the XHCI interface can address only 40 bits of
      memory. Typically that's not a problem because Tegra devices don't have
      enough system memory to exceed those 40 bits.
      
      However, if the ARM SMMU is enable on Tegra186 and later, the addresses
      passed to the XUSB controller can be anywhere in the 48-bit IOV address
      space of the ARM SMMU. Since the DMA/IOMMU API starts allocating from
      the top of the IOVA space, the Falcon microcontroller is not able to
      load the firmware successfully.
      
      Fix this by setting the DMA mask to 40 bits, which will force the DMA
      API to map the buffer for the firmware to an IOVA that is addressable by
      the Falcon.
      Signed-off-by: NNagarjuna Kristam <nkristam@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Link: https://lore.kernel.org/r/1566989697-13049-1-git-send-email-nkristam@nvidia.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c6d779fd
    • D
      cifs: Use kzfree() to zero out the password · b6294685
      Dan Carpenter 提交于
      [ Upstream commit 478228e57f81f6cb60798d54fc02a74ea7dd267e ]
      
      It's safer to zero out the password so that it can never be disclosed.
      
      Fixes: 0c219f5799c7 ("cifs: set domainName when a domain-key is used in multiuser")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      b6294685
    • R
      cifs: set domainName when a domain-key is used in multiuser · 325fa2a6
      Ronnie Sahlberg 提交于
      [ Upstream commit f2aee329a68f5a907bcff11a109dfe17c0b41aeb ]
      
      RHBZ: 1710429
      
      When we use a domain-key to authenticate using multiuser we must also set
      the domainnmame for the new volume as it will be used and passed to the server
      in the NTLMSSP Domain-name.
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      325fa2a6
    • M
      kallsyms: Don't let kallsyms_lookup_size_offset() fail on retrieving the first symbol · 9a74f799
      Marc Zyngier 提交于
      [ Upstream commit 2a1a3fa0f29270583f0e6e3100d609e09697add1 ]
      
      An arm64 kernel configured with
      
        CONFIG_KPROBES=y
        CONFIG_KALLSYMS=y
        # CONFIG_KALLSYMS_ALL is not set
        CONFIG_KALLSYMS_BASE_RELATIVE=y
      
      reports the following kprobe failure:
      
        [    0.032677] kprobes: failed to populate blacklist: -22
        [    0.033376] Please take care of using kprobes.
      
      It appears that kprobe fails to retrieve the symbol at address
      0xffff000010081000, despite this symbol being in System.map:
      
        ffff000010081000 T __exception_text_start
      
      This symbol is part of the first group of aliases in the
      kallsyms_offsets array (symbol names generated using ugly hacks in
      scripts/kallsyms.c):
      
        kallsyms_offsets:
                .long   0x1000 // do_undefinstr
                .long   0x1000 // efi_header_end
                .long   0x1000 // _stext
                .long   0x1000 // __exception_text_start
                .long   0x12b0 // do_cp15instr
      
      Looking at the implementation of get_symbol_pos(), it returns the
      lowest index for aliasing symbols. In this case, it return 0.
      
      But kallsyms_lookup_size_offset() considers 0 as a failure, which
      is obviously wrong (there is definitely a valid symbol living there).
      In turn, the kprobe blacklisting stops abruptly, hence the original
      error.
      
      A CONFIG_KALLSYMS_ALL kernel wouldn't fail as there is always
      some random symbols at the beginning of this array, which are never
      looked up via kallsyms_lookup_size_offset.
      
      Fix it by considering that get_symbol_pos() is always successful
      (which is consistent with the other uses of this function).
      
      Fixes: ffc50891 ("[PATCH] Create kallsyms_lookup_size_offset()")
      Reviewed-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Signed-off-by: NWill Deacon <will@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      9a74f799
    • T
      NFSv2: Fix write regression · 0f713017
      Trond Myklebust 提交于
      [ Upstream commit d33d4beb522987d1c305c12500796f9be3687dee ]
      
      Ensure we update the write result count on success, since the
      RPC call itself does not do so.
      Reported-by: NJan Stancek <jstancek@redhat.com>
      Reported-by: NNaresh Kamboju <naresh.kamboju@linaro.org>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Tested-by: NJan Stancek <jstancek@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      0f713017
    • T
      NFSv2: Fix eof handling · 60f0d449
      Trond Myklebust 提交于
      [ Upstream commit 71affe9be45a5c60b9772e1b2701710712637274 ]
      
      If we received a reply from the server with a zero length read and
      no error, then that implies we are at eof.
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      60f0d449
    • T
      netfilter: nf_conntrack_ftp: Fix debug output · 6075729f
      Thomas Jarosch 提交于
      [ Upstream commit 3a069024d371125227de3ac8fa74223fcf473520 ]
      
      The find_pattern() debug output was printing the 'skip' character.
      This can be a NULL-byte and messes up further pr_debug() output.
      
      Output without the fix:
      kernel: nf_conntrack_ftp: Pattern matches!
      kernel: nf_conntrack_ftp: Skipped up to `<7>nf_conntrack_ftp: find_pattern `PORT': dlen = 8
      kernel: nf_conntrack_ftp: find_pattern `EPRT': dlen = 8
      
      Output with the fix:
      kernel: nf_conntrack_ftp: Pattern matches!
      kernel: nf_conntrack_ftp: Skipped up to 0x0 delimiter!
      kernel: nf_conntrack_ftp: Match succeeded!
      kernel: nf_conntrack_ftp: conntrack_ftp: match `172,17,0,100,200,207' (20 bytes at 4150681645)
      kernel: nf_conntrack_ftp: find_pattern `PORT': dlen = 8
      Signed-off-by: NThomas Jarosch <thomas.jarosch@intra2net.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      6075729f
    • T
      netfilter: xt_physdev: Fix spurious error message in physdev_mt_check · 7ac5947f
      Todd Seidelmann 提交于
      [ Upstream commit 3cf2f450fff304be9cf4868bf0df17f253bc5b1c ]
      
      Simplify the check in physdev_mt_check() to emit an error message
      only when passed an invalid chain (ie, NF_INET_LOCAL_OUT).
      This avoids cluttering up the log with errors against valid rules.
      
      For large/heavily modified rulesets, current behavior can quickly
      overwhelm the ring buffer, because this function gets called on
      every change, regardless of the rule that was changed.
      Signed-off-by: NTodd Seidelmann <tseidelmann@linode.com>
      Acked-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      7ac5947f
    • T
      x86/apic: Fix arch_dynirq_lower_bound() bug for DT enabled machines · e997c073
      Thomas Gleixner 提交于
      [ Upstream commit 3e5bedc2c258341702ddffbd7688c5e6eb01eafa ]
      
      Rahul Tanwar reported the following bug on DT systems:
      
      > 'ioapic_dynirq_base' contains the virtual IRQ base number. Presently, it is
      > updated to the end of hardware IRQ numbers but this is done only when IOAPIC
      > configuration type is IOAPIC_DOMAIN_LEGACY or IOAPIC_DOMAIN_STRICT. There is
      > a third type IOAPIC_DOMAIN_DYNAMIC which applies when IOAPIC configuration
      > comes from devicetree.
      >
      > See dtb_add_ioapic() in arch/x86/kernel/devicetree.c
      >
      > In case of IOAPIC_DOMAIN_DYNAMIC (DT/OF based system), 'ioapic_dynirq_base'
      > remains to zero initialized value. This means that for OF based systems,
      > virtual IRQ base will get set to zero.
      
      Such systems will very likely not even boot.
      
      For DT enabled machines ioapic_dynirq_base is irrelevant and not
      updated, so simply map the IRQ base 1:1 instead.
      Reported-by: NRahul Tanwar <rahul.tanwar@linux.intel.com>
      Tested-by: NRahul Tanwar <rahul.tanwar@linux.intel.com>
      Tested-by: NAndy Shevchenko <andriy.shevchenko@intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: alan@linux.intel.com
      Cc: bp@alien8.de
      Cc: cheol.yong.kim@intel.com
      Cc: qi-ming.wu@intel.com
      Cc: rahul.tanwar@intel.com
      Cc: rppt@linux.ibm.com
      Cc: tony.luck@intel.com
      Link: http://lkml.kernel.org/r/20190821081330.1187-1-rahul.tanwar@linux.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e997c073
    • P
      r8152: Set memory to all 0xFFs on failed reg reads · 688fdaa5
      Prashant Malani 提交于
      [ Upstream commit f53a7ad189594a112167efaf17ea8d0242b5ac00 ]
      
      get_registers() blindly copies the memory written to by the
      usb_control_msg() call even if the underlying urb failed.
      
      This could lead to junk register values being read by the driver, since
      some indirect callers of get_registers() ignore the return values. One
      example is:
        ocp_read_dword() ignores the return value of generic_ocp_read(), which
        calls get_registers().
      
      So, emulate PCI "Master Abort" behavior by setting the buffer to all
      0xFFs when usb_control_msg() fails.
      
      This patch is copied from the r8152 driver (v2.12.0) published by
      Realtek (www.realtek.com).
      Signed-off-by: NPrashant Malani <pmalani@chromium.org>
      Acked-by: NHayes Wang <hayeswang@realtek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      688fdaa5
    • I
      bpf: allow narrow loads of some sk_reuseport_md fields with offset > 0 · d9f79f0a
      Ilya Leoshkevich 提交于
      [ Upstream commit 2c238177bd7f4b14bdf7447cc1cd9bb791f147e6 ]
      
      test_select_reuseport fails on s390 due to verifier rejecting
      test_select_reuseport_kern.o with the following message:
      
      	; data_check.eth_protocol = reuse_md->eth_protocol;
      	18: (69) r1 = *(u16 *)(r6 +22)
      	invalid bpf_context access off=22 size=2
      
      This is because on big-endian machines casts from __u32 to __u16 are
      generated by referencing the respective variable as __u16 with an offset
      of 2 (as opposed to 0 on little-endian machines).
      
      The verifier already has all the infrastructure in place to allow such
      accesses, it's just that they are not explicitly enabled for
      eth_protocol field. Enable them for eth_protocol field by using
      bpf_ctx_range instead of offsetof.
      
      Ditto for ip_protocol, bind_inany and len, since they already allow
      narrowing, and the same problem can arise when working with them.
      
      Fixes: 2dbb9b9e ("bpf: Introduce BPF_PROG_TYPE_SK_REUSEPORT")
      Signed-off-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d9f79f0a
    • S
      batman-adv: Only read OGM2 tvlv_len after buffer len check · 7d4201ff
      Sven Eckelmann 提交于
      [ Upstream commit 0ff0f15a32c093381ad1abc06abe85afb561ab28 ]
      
      Multiple batadv_ogm2_packet can be stored in an skbuff. The functions
      batadv_v_ogm_send_to_if() uses batadv_v_ogm_aggr_packet() to check if there
      is another additional batadv_ogm2_packet in the skb or not before they
      continue processing the packet.
      
      The length for such an OGM2 is BATADV_OGM2_HLEN +
      batadv_ogm2_packet->tvlv_len. The check must first check that at least
      BATADV_OGM2_HLEN bytes are available before it accesses tvlv_len (which is
      part of the header. Otherwise it might try read outside of the currently
      available skbuff to get the content of tvlv_len.
      
      Fixes: 9323158e ("batman-adv: OGMv2 - implement originators logic")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      7d4201ff
    • D
      ARM: 8874/1: mm: only adjust sections of valid mm structures · 5b8b6627
      Doug Berger 提交于
      [ Upstream commit c51bc12d06b3a5494fbfcbd788a8e307932a06e9 ]
      
      A timing hazard exists when an early fork/exec thread begins
      exiting and sets its mm pointer to NULL while a separate core
      tries to update the section information.
      
      This commit ensures that the mm pointer is not NULL before
      setting its section parameters. The arguments provided by
      commit 11ce4b33 ("ARM: 8672/1: mm: remove tasklist locking
      from update_sections_early()") are equally valid for not
      requiring grabbing the task_lock around this check.
      
      Fixes: 08925c2f ("ARM: 8464/1: Update all mm structures with section adjustments")
      Signed-off-by: NDoug Berger <opendmb@gmail.com>
      Acked-by: NLaura Abbott <labbott@redhat.com>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
      Cc: Peng Fan <peng.fan@nxp.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      5b8b6627
    • W
      qed: Add cleanup in qed_slowpath_start() · b870f8af
      Wenwen Wang 提交于
      [ Upstream commit de0e4fd2f07ce3bbdb69dfb8d9426b7227451b69 ]
      
      If qed_mcp_send_drv_version() fails, no cleanup is executed, leading to
      memory leaks. To fix this issue, introduce the label 'err4' to perform the
      cleanup work before returning the error.
      Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu>
      Acked-by: NSudarsana Reddy Kalluru <skalluru@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      b870f8af
    • I
      xdp: unpin xdp umem pages in error path · 30881d79
      Ivan Khoronzhuk 提交于
      [ Upstream commit fb89c39455e4b49881c5a42761bd71f03d3ef888 ]
      
      Fix mem leak caused by missed unpin routine for umem pages.
      
      Fixes: 8aef7340 ("xsk: introduce xdp_umem_page")
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Acked-by: NJonathan Lemon <jonathan.lemon@gmail.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      30881d79
    • C
      Kconfig: Fix the reference to the IDT77105 Phy driver in the description of... · 55ed0ad5
      Christophe JAILLET 提交于
      Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105
      
      [ Upstream commit cd9d4ff9b78fcd0fc4708900ba3e52e71e1a7690 ]
      
      This should be IDT77105, not IDT77015.
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      55ed0ad5
    • T
      NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup · 767877de
      Trond Myklebust 提交于
      [ Upstream commit 17d8c5d145000070c581f2a8aa01edc7998582ab ]
      
      Initialise the result count to 0 rather than initialising it to the
      argument count. The reason is that we want to ensure we record the
      I/O stats correctly in the case where an error is returned (for
      instance in the layoutstats).
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      767877de
    • T
      NFSv4: Fix return value in nfs_finish_open() · 4ac4f471
      Trond Myklebust 提交于
      [ Upstream commit 9821421a291b548ef4369c6998745baa36ddecd5 ]
      
      If the file turns out to be of the wrong type after opening, we want
      to revalidate the path and retry, so return EOPENSTALE rather than
      ESTALE.
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4ac4f471
    • T
      NFSv4: Fix return values for nfs4_file_open() · d7565d51
      Trond Myklebust 提交于
      [ Upstream commit 90cf500e338ab3f3c0f126ba37e36fb6a9058441 ]
      
      Currently, we are translating RPC level errors such as timeouts,
      as well as interrupts etc into EOPENSTALE, which forces a single
      replay of the open attempt. What we actually want to do is
      force the replay only in the cases where the returned error
      indicates that the file may have changed on the server.
      
      So the fix is to spell out the exact set of errors where we want
      to return EOPENSTALE.
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d7565d51
    • J
      netfilter: xt_nfacct: Fix alignment mismatch in xt_nfacct_match_info · 4e5fbcb9
      Juliana Rodrigueiro 提交于
      [ Upstream commit 89a26cd4b501e9511d3cd3d22327fc76a75a38b3 ]
      
      When running a 64-bit kernel with a 32-bit iptables binary, the size of
      the xt_nfacct_match_info struct diverges.
      
          kernel: sizeof(struct xt_nfacct_match_info) : 40
          iptables: sizeof(struct xt_nfacct_match_info)) : 36
      
      Trying to append nfacct related rules results in an unhelpful message.
      Although it is suggested to look for more information in dmesg, nothing
      can be found there.
      
          # iptables -A <chain> -m nfacct --nfacct-name <acct-object>
          iptables: Invalid argument. Run `dmesg' for more information.
      
      This patch fixes the memory misalignment by enforcing 8-byte alignment
      within the struct's first revision. This solution is often used in many
      other uapi netfilter headers.
      Signed-off-by: NJuliana Rodrigueiro <juliana.rodrigueiro@intra2net.com>
      Acked-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4e5fbcb9
    • P
      netfilter: nft_flow_offload: missing netlink attribute policy · a02c676c
      Pablo Neira Ayuso 提交于
      [ Upstream commit 14c415862c0630e01712a4eeaf6159a2b1b6d2a4 ]
      
      The netlink attribute policy for NFTA_FLOW_TABLE_NAME is missing.
      
      Fixes: a3c90f7a ("netfilter: nf_tables: flow offload expression")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      a02c676c
    • T
      netfilter: ebtables: Fix argument order to ADD_COUNTER · a4fa6c68
      Todd Seidelmann 提交于
      [ Upstream commit f20faa06d83de440bec8e200870784c3458793c4 ]
      
      The ordering of arguments to the x_tables ADD_COUNTER macro
      appears to be wrong in ebtables (cf. ip_tables.c, ip6_tables.c,
      and arp_tables.c).
      
      This causes data corruption in the ebtables userspace tools
      because they get incorrect packet & byte counts from the kernel.
      
      Fixes: d72133e6 ("netfilter: ebtables: use ADD_COUNTER macro")
      Signed-off-by: NTodd Seidelmann <tseidelmann@linode.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      a4fa6c68
    • P
      fpga: altera-ps-spi: Fix getting of optional confd gpio · 634dd5a4
      Phil Reid 提交于
      [ Upstream commit dec43da46f63eb71f519d963ba6832838e4262a3 ]
      
      Currently the driver does not handle EPROBE_DEFER for the confd gpio.
      Use devm_gpiod_get_optional() instead of devm_gpiod_get() and return
      error codes from altera_ps_probe().
      
      Fixes: 5692fae0 ("fpga manager: Add altera-ps-spi driver for Altera FPGAs")
      Signed-off-by: NPhil Reid <preid@electromag.com.au>
      Signed-off-by: NMoritz Fischer <mdf@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      634dd5a4
    • Q
      tools: bpftool: close prog FD before exit on showing a single program · 0d393f23
      Quentin Monnet 提交于
      [ Upstream commit d34b044038bfb0e19caa8b019910efc465f41d5f ]
      
      When showing metadata about a single program by invoking
      "bpftool prog show PROG", the file descriptor referring to the program
      is not closed before returning from the function. Let's close it.
      
      Fixes: 71bb428f ("tools: bpf: add bpftool")
      Signed-off-by: NQuentin Monnet <quentin.monnet@netronome.com>
      Reviewed-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Acked-by: NAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      0d393f23
    • I
      selftests/bpf: fix "bind{4, 6} deny specific IP & port" on s390 · c5bb0335
      Ilya Leoshkevich 提交于
      [ Upstream commit 27df5c7068bf23cab282dc64b1c9894429b3b8a0 ]
      
      "bind4 allow specific IP & port" and "bind6 deny specific IP & port"
      fail on s390 because of endianness issue: the 4 IP address bytes are
      loaded as a word and compared with a constant, but the value of this
      constant should be different on big- and little- endian machines, which
      is not the case right now.
      
      Use __bpf_constant_ntohl to generate proper value based on machine
      endianness.
      
      Fixes: 1d436885 ("selftests/bpf: Selftest for sys_bind post-hooks.")
      Signed-off-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c5bb0335
    • I
      s390/bpf: use 32-bit index for tail calls · 48d77ca1
      Ilya Leoshkevich 提交于
      [ Upstream commit 91b4db5313a2c793aabc2143efb8ed0cf0fdd097 ]
      
      "p runtime/jit: pass > 32bit index to tail_call" fails when
      bpf_jit_enable=1, because the tail call is not executed.
      
      This in turn is because the generated code assumes index is 64-bit,
      while it must be 32-bit, and as a result prog array bounds check fails,
      while it should pass. Even if bounds check would have passed, the code
      that follows uses 64-bit index to compute prog array offset.
      
      Fix by using clrj instead of clgrj for comparing index with array size,
      and also by using llgfr for truncating index to 32 bits before using it
      to compute prog array offset.
      
      Fixes: 6651ee07 ("s390/bpf: implement bpf_tail_call() helper")
      Reported-by: NYauheni Kaliuta <yauheni.kaliuta@redhat.com>
      Acked-by: NVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      48d77ca1
    • S
      bus: ti-sysc: Simplify cleanup upon failures in sysc_probe() · 999f33c2
      Suman Anna 提交于
      [ Upstream commit a304f483b6b00d42bde41c45ca52c670945348e2 ]
      
      The clocks are not yet parsed and prepared until after a successful
      sysc_get_clocks(), so there is no need to unprepare the clocks upon
      any failure of any of the prior functions in sysc_probe(). The current
      code path would have been a no-op because of the clock validity checks
      within sysc_unprepare(), but let's just simplify the cleanup path by
      returning the error directly.
      
      While at this, also fix the cleanup path for a sysc_init_resets()
      failure which is executed after the clocks are prepared.
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      999f33c2
    • J
      ARM: OMAP1: ams-delta-fiq: Fix missing irq_ack · 1a85d581
      Janusz Krzysztofik 提交于
      [ Upstream commit fa8397e45c64e60c80373bc19ee56e42a6bed9b6 ]
      
      Non-serio path of Amstrad Delta FIQ deferred handler depended on
      irq_ack() method provided by OMAP GPIO driver.  That method has been
      removed by commit 693de831c6e5 ("gpio: omap: remove irq_ack method").
      Remove useless code from the deferred handler and reimplement the
      missing operation inside the base FIQ handler.
      
      Should another dependency - irq_unmask() - be ever removed from the OMAP
      GPIO driver, WARN once if missing.
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      1a85d581
    • F
      ARM: dts: dra74x: Fix iodelay configuration for mmc3 · a8919f8d
      Faiz Abbas 提交于
      [ Upstream commit 07f9a8be66a9bd86f9eaedf8f8aeb416195adab8 ]
      
      According to the latest am572x[1] and dra74x[2] data manuals, mmc3
      default, hs, sdr12 and sdr25 modes use iodelay values given in
      MMC3_MANUAL1. Set the MODE_SELECT bit for these so that manual mode is
      selected and correct iodelay values can be configured.
      
      [1] http://www.ti.com/lit/ds/symlink/am5728.pdf
      [2] http://www.ti.com/lit/ds/symlink/dra746.pdfSigned-off-by: NFaiz Abbas <faiz_abbas@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      a8919f8d
    • T
      ARM: OMAP2+: Fix omap4 errata warning on other SoCs · 2ff2bd2c
      Tony Lindgren 提交于
      [ Upstream commit 45da5e09dd32fa98c32eaafe2513db6bd75e2f4f ]
      
      We have errata i688 workaround produce warnings on SoCs other than
      omap4 and omap5:
      
      omap4_sram_init:Unable to allocate sram needed to handle errata I688
      omap4_sram_init:Unable to get sram pool needed to handle errata I688
      
      This is happening because there is no ti,omap4-mpu node, or no SRAM
      to configure for the other SoCs, so let's remove the warning based
      on the SoC revision checks.
      
      As nobody has complained it seems that the other SoC variants do not
      need this workaround.
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      2ff2bd2c
    • I
      s390/bpf: fix lcgr instruction encoding · 73d00327
      Ilya Leoshkevich 提交于
      [ Upstream commit bb2d267c448f4bc3a3389d97c56391cb779178ae ]
      
      "masking, test in bounds 3" fails on s390, because
      BPF_ALU64_IMM(BPF_NEG, BPF_REG_2, 0) ignores the top 32 bits of
      BPF_REG_2. The reason is that JIT emits lcgfr instead of lcgr.
      The associated comment indicates that the code was intended to
      emit lcgr in the first place, it's just that the wrong opcode
      was used.
      
      Fix by using the correct opcode.
      
      Fixes: 05462310 ("s390/bpf: Add s390x eBPF JIT compiler backend")
      Signed-off-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Acked-by: NVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      73d00327
    • T
      bus: ti-sysc: Fix using configured sysc mask value · c1e0937e
      Tony Lindgren 提交于
      [ Upstream commit e212abd452a4af3174fcd469d46656f83e135a19 ]
      
      We have cases where there are no softreset bits like with am335x lcdc.
      In that case ti,sysc-mask = <0> needs to be handled properly.
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c1e0937e
    • T
      ARM: OMAP2+: Fix missing SYSC_HAS_RESET_STATUS for dra7 epwmss · 0aee9e11
      Tony Lindgren 提交于
      [ Upstream commit afd58b162e48076e3fe66d08a69eefbd6fe71643 ]
      
      TRM says PWMSS_SYSCONFIG bit for SOFTRESET changes to zero when
      reset is completed. Let's configure it as otherwise we get warnings
      on boot when we check the data against dts provided data. Eventually
      the legacy platform data will be just dropped, but let's fix the
      warning first.
      Reviewed-by: NSuman Anna <s-anna@ti.com>
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      0aee9e11
    • F
      ARM: dts: am57xx: Disable voltage switching for SD card · f696ba6b
      Faiz Abbas 提交于
      [ Upstream commit fb59ee37cfe20d10d19568899d1458a58361246c ]
      
      If UHS speed modes are enabled, a compatible SD card switches down to
      1.8V during enumeration. If after this a software reboot/crash takes
      place and on-chip ROM tries to enumerate the SD card, the difference in
      IO voltages (host @ 3.3V and card @ 1.8V) may end up damaging the card.
      
      The fix for this is to have support for power cycling the card in
      hardware (with a PORz/soft-reset line causing a power cycle of the
      card). Because the beaglebone X15 (rev A,B and C), am57xx-idks and
      am57xx-evms don't have this capability, disable voltage switching for
      these boards.
      
      The major effect of this is that the maximum supported speed
      mode is now high speed(50 MHz) down from SDR104(200 MHz).
      
      commit 88a748419b84 ("ARM: dts: am57xx-idk: Remove support for voltage
      switching for SD card") did this only for idk boards. Do it for all
      affected boards.
      Signed-off-by: NFaiz Abbas <faiz_abbas@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      f696ba6b
    • Y
      ieee802154: hwsim: unregister hw while hwsim_subscribe_all_others fails · ac8f26f6
      YueHaibing 提交于
      [ Upstream commit de166bbe861738c8bc3e5dad5b03f45d7d6ef914 ]
      
      KASAN report this:
      
      kernel BUG at net/mac802154/main.c:130!
      invalid opcode: 0000 [#1] PREEMPT SMP
      CPU: 0 PID: 19932 Comm: modprobe Not tainted 5.1.0-rc6+ #22
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
      RIP: 0010:ieee802154_free_hw+0x2a/0x30 [mac802154]
      Code: 55 48 8d 57 38 48 89 e5 53 48 89 fb 48 8b 47 38 48 39 c2 75 15 48 8d 7f 48 e8 82 85 16 e1 48 8b 7b 28 e8 f9 ef 83 e2 5b 5d c3 <0f> 0b 0f 1f 40 00 55 48 89 e5 53 48 89 fb 0f b6 86 80 00 00 00 88
      RSP: 0018:ffffc90001c7b9f0 EFLAGS: 00010206
      RAX: ffff88822df3aa80 RBX: ffff88823143d5c0 RCX: 0000000000000002
      RDX: ffff88823143d5f8 RSI: ffff88822b1fabc0 RDI: ffff88823143d5c0
      RBP: ffffc90001c7b9f8 R08: 0000000000000000 R09: 0000000000000001
      R10: 0000000000000000 R11: 0000000000000000 R12: 00000000fffffff4
      R13: ffff88822dea4f50 R14: ffff88823143d7c0 R15: 00000000fffffff4
      FS: 00007ff52e999540(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
      CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007fdc06dba768 CR3: 000000023160a000 CR4: 00000000000006f0
      Call Trace:
       hwsim_add_one+0x2dd/0x540 [mac802154_hwsim]
       hwsim_probe+0x2f/0xb0 [mac802154_hwsim]
       platform_drv_probe+0x3a/0x90
       ? driver_sysfs_add+0x79/0xb0
       really_probe+0x1d4/0x2d0
       driver_probe_device+0x50/0xf0
       device_driver_attach+0x54/0x60
       __driver_attach+0x7e/0xd0
       ? device_driver_attach+0x60/0x60
       bus_for_each_dev+0x68/0xc0
       driver_attach+0x19/0x20
       bus_add_driver+0x15e/0x200
       driver_register+0x5b/0xf0
       __platform_driver_register+0x31/0x40
       hwsim_init_module+0x74/0x1000 [mac802154_hwsim]
       ? 0xffffffffa00e9000
       do_one_initcall+0x6c/0x3cc
       ? kmem_cache_alloc_trace+0x248/0x3b0
       do_init_module+0x5b/0x1f1
       load_module+0x1db1/0x2690
       ? m_show+0x1d0/0x1d0
       __do_sys_finit_module+0xc5/0xd0
       __x64_sys_finit_module+0x15/0x20
       do_syscall_64+0x6b/0x1d0
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x7ff52e4a2839
      Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48
      RSP: 002b:00007ffffa7b3c08 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      RAX: ffffffffffffffda RBX: 00005647560a2a00 RCX: 00007ff52e4a2839
      RDX: 0000000000000000 RSI: 00005647547f3c2e RDI: 0000000000000003
      RBP: 00005647547f3c2e R08: 0000000000000000 R09: 00005647560a2a00
      R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
      R13: 00005647560a2c10 R14: 0000000000040000 R15: 00005647560a2a00
      Modules linked in: mac802154_hwsim(+) mac802154 [last unloaded: mac802154_hwsim]
      
      In hwsim_add_one, if hwsim_subscribe_all_others fails, we
      should call ieee802154_unregister_hw to free resources.
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Fixes: f25da51f ("ieee802154: hwsim: add replacement for fakelb")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Acked-by: NAlexander Aring <aring@mojatatu.com>
      Signed-off-by: NStefan Schmidt <stefan@datenfreihafen.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ac8f26f6
    • Y
      ieee802154: hwsim: Fix error handle path in hwsim_init_module · c237a050
      YueHaibing 提交于
      [ Upstream commit 1cbbbf39efab05fae67f59e6ed01bb85061c69e2 ]
      
      KASAN report this:
      
      BUG: unable to handle kernel paging request at fffffbfff834f001
      PGD 237fe8067 P4D 237fe8067 PUD 237e64067 PMD 1c968d067 PTE 0
      Oops: 0000 [#1] SMP KASAN PTI
      CPU: 1 PID: 8871 Comm: syz-executor.0 Tainted: G         C        5.0.0+ #5
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
      RIP: 0010:strcmp+0x31/0xa0 lib/string.c:328
      Code: 00 00 00 00 fc ff df 55 53 48 83 ec 08 eb 0a 84 db 48 89 ef 74 5a 4c 89 e6 48 89 f8 48 89 fa 48 8d 6f 01 48 c1 e8 03 83 e2 07 <42> 0f b6 04 28 38 d0 7f 04 84 c0 75 50 48 89 f0 48 89 f2 0f b6 5d
      RSP: 0018:ffff8881e0c57800 EFLAGS: 00010246
      RAX: 1ffffffff834f001 RBX: ffffffffc1a78000 RCX: ffffffff827b9503
      RDX: 0000000000000000 RSI: ffffffffc1a40008 RDI: ffffffffc1a78008
      RBP: ffffffffc1a78009 R08: fffffbfff6a92195 R09: fffffbfff6a92195
      R10: ffff8881e0c578b8 R11: fffffbfff6a92194 R12: ffffffffc1a40008
      R13: dffffc0000000000 R14: ffffffffc1a3e470 R15: ffffffffc1a40000
      FS:  00007fdcc02ff700(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: fffffbfff834f001 CR3: 00000001b3134003 CR4: 00000000007606e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      PKRU: 55555554
      Call Trace:
       genl_family_find_byname+0x7f/0xf0 net/netlink/genetlink.c:104
       genl_register_family+0x1e1/0x1070 net/netlink/genetlink.c:333
       ? 0xffffffffc1978000
       hwsim_init_module+0x6a/0x1000 [mac802154_hwsim]
       ? 0xffffffffc1978000
       ? 0xffffffffc1978000
       ? 0xffffffffc1978000
       do_one_initcall+0xbc/0x47d init/main.c:887
       do_init_module+0x1b5/0x547 kernel/module.c:3456
       load_module+0x6405/0x8c10 kernel/module.c:3804
       __do_sys_finit_module+0x162/0x190 kernel/module.c:3898
       do_syscall_64+0x9f/0x450 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x462e99
      Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
      RSP: 002b:00007fdcc02fec58 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      RAX: ffffffffffffffda RBX: 000000000073bf00 RCX: 0000000000462e99
      RDX: 0000000000000000 RSI: 0000000020000200 RDI: 0000000000000003
      RBP: 00007fdcc02fec70 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdcc02ff6bc
      R13: 00000000004bcefa R14: 00000000006f6fb0 R15: 0000000000000004
      Modules linked in: mac802154_hwsim(+) mac802154 ieee802154 speakup(C) rc_proteus_2309 rtc_rk808 streebog_generic rds vboxguest madera_spi madera da9052_wdt mISDN_core ueagle_atm usbatm atm ir_imon_decoder scsi_transport_sas rc_dntv_live_dvb_t panel_samsung_s6d16d0 drm drm_panel_orientation_quirks lib80211 fb_agm1264k_fl(C) gspca_pac7302 gspca_main videobuf2_v4l2 soundwire_intel_init i2c_dln2 dln2 usbcore hid_gaff 88pm8607 nfnetlink axp20x_i2c axp20x uio pata_marvell pmbus_core snd_sonicvibes gameport snd_pcm snd_opl3_lib snd_timer snd_hwdep snd_mpu401_uart snd_rawmidi snd_seq_device snd soundcore rtc_ds1511 rtc_ds1742 vsock dwc_xlgmac rtc_rx8010 libphy twofish_x86_64_3way twofish_x86_64 twofish_common ad5696_i2c ad5686 lp8788_charger cxd2880_spi dvb_core videobuf2_common videodev media videobuf2_vmalloc videobuf2_memops fbtft(C) sysimgblt sysfillrect syscopyarea fb_sys_fops janz_ican3 firewire_net firewire_core crc_itu_t spi_slave_system_control i2c_matroxfb i2c_algo_bit
       matroxfb_base fb fbdev matroxfb_DAC1064 matroxfb_accel cfbcopyarea cfbimgblt cfbfillrect matroxfb_Ti3026 matroxfb_g450 g450_pll matroxfb_misc leds_blinkm ti_dac7311 intel_spi_pci intel_spi spi_nor hid_elan hid async_tx rc_cinergy_1400 rc_core intel_ishtp kxcjk_1013 industrialio_triggered_buffer kfifo_buf can_dev intel_th spi_pxa2xx_platform pata_artop vme_ca91cx42 gb_gbphy(C) greybus(C) industrialio mptbase st_drv cmac ttpci_eeprom via_wdt gpio_xra1403 mtd iptable_security iptable_raw iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter bpfilter ip6_vti ip_vti ip_gre ipip sit tunnel4 ip_tunnel hsr veth netdevsim vxcan batman_adv cfg80211 rfkill chnl_net caif nlmon dummy team bonding vcan bridge stp llc ip6_gre gre ip6_tunnel tunnel6 tun joydev mousedev ppdev kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64 input_leds crypto_simd cryptd glue_helper ide_pci_generic piix psmouse
       ide_core serio_raw ata_generic i2c_piix4 pata_acpi parport_pc parport floppy rtc_cmos intel_agp intel_gtt agpgart sch_fq_codel ip_tables x_tables sha1_ssse3 sha1_generic ipv6 [last unloaded: speakup]
      Dumping ftrace buffer:
         (ftrace buffer empty)
      CR2: fffffbfff834f001
      ---[ end trace 5aa772c793e0e971 ]---
      RIP: 0010:strcmp+0x31/0xa0 lib/string.c:328
      Code: 00 00 00 00 fc ff df 55 53 48 83 ec 08 eb 0a 84 db 48 89 ef 74 5a 4c 89 e6 48 89 f8 48 89 fa 48 8d 6f 01 48 c1 e8 03 83 e2 07 <42> 0f b6 04 28 38 d0 7f 04 84 c0 75 50 48 89 f0 48 89 f2 0f b6 5d
      RSP: 0018:ffff8881e0c57800 EFLAGS: 00010246
      RAX: 1ffffffff834f001 RBX: ffffffffc1a78000 RCX: ffffffff827b9503
      RDX: 0000000000000000 RSI: ffffffffc1a40008 RDI: ffffffffc1a78008
      RBP: ffffffffc1a78009 R08: fffffbfff6a92195 R09: fffffbfff6a92195
      R10: ffff8881e0c578b8 R11: fffffbfff6a92194 R12: ffffffffc1a40008
      R13: dffffc0000000000 R14: ffffffffc1a3e470 R15: ffffffffc1a40000
      FS:  00007fdcc02ff700(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: fffffbfff834f001 CR3: 00000001b3134003 CR4: 00000000007606e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      PKRU: 55555554
      
      The error handing path misplace the cleanup in hwsim_init_module,
      switch the two cleanup functions to fix above issues.
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Fixes: f25da51f ("ieee802154: hwsim: add replacement for fakelb")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Acked-by: NAlexander Aring <aring@mojatatu.com>
      Signed-off-by: NStefan Schmidt <stefan@datenfreihafen.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c237a050
    • M
      nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds · 6a10e87f
      Masashi Honma 提交于
      commit 4b2c5a14cd8005a900075f7dfec87473c6ee66fb upstream.
      
      commit 1222a160 ("nl80211: Fix possible Spectre-v1 for CQM
      RSSI thresholds") was incomplete and requires one more fix to
      prevent accessing to rssi_thresholds[n] because user can control
      rssi_thresholds[i] values to make i reach to n. For example,
      rssi_thresholds = {-400, -300, -200, -100} when last is -34.
      
      Cc: stable@vger.kernel.org
      Fixes: 1222a160 ("nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMasashi Honma <masashi.honma@gmail.com>
      Link: https://lore.kernel.org/r/20190908005653.17433-1-masashi.honma@gmail.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6a10e87f
    • W
      mwifiex: Fix three heap overflow at parsing element in cfg80211_ap_settings · 941431c4
      Wen Huang 提交于
      commit 7caac62ed598a196d6ddf8d9c121e12e082cac3a upstream.
      
      mwifiex_update_vs_ie(),mwifiex_set_uap_rates() and
      mwifiex_set_wmm_params() call memcpy() without checking
      the destination size.Since the source is given from
      user-space, this may trigger a heap buffer overflow.
      
      Fix them by putting the length check before performing memcpy().
      
      This fix addresses CVE-2019-14814,CVE-2019-14815,CVE-2019-14816.
      Signed-off-by: NWen Huang <huangwenabc@gmail.com>
      Acked-by: NGanapathi Bhat <gbhat@marvell.comg>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      941431c4
    • R
      tty/serial: atmel: reschedule TX after RX was started · 770cee24
      Razvan Stefanescu 提交于
      commit d2ace81bf902a9f11d52e59e5d232d2255a0e353 upstream.
      
      When half-duplex RS485 communication is used, after RX is started, TX
      tasklet still needs to be  scheduled tasklet. This avoids console freezing
      when more data is to be transmitted, if the serial communication is not
      closed.
      
      Fixes: 69646d7a3689 ("tty/serial: atmel: RS485 HD w/DMA: enable RX after TX is stopped")
      Signed-off-by: NRazvan Stefanescu <razvan.stefanescu@microchip.com>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20190813074025.16218-1-razvan.stefanescu@microchip.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      770cee24