1. 06 Mar, 2019 1 commit
  2. 28 Feb, 2019 1 commit
  3. 13 Feb, 2019 1 commit
    • Borislav Petkov's avatar
      x86/boot: Correct RSDP parsing with 32-bit EFI · f9d230e8
      Borislav Petkov authored
      Guenter Roeck reported triple faults of a 64-bit VM using a 32-bit OVMF
      EFI image. After some singlestepping of the image in gdb, it turned out
      that some of the EFI config tables were at bogus addresses. Which, as
      Ard pointed out, results from using the wrong efi_config_table typedef.
      
      So switch all EFI table pointers to unsigned longs and convert them to
      the proper typedef only when accessing them. This way, the proper table
      type is being used.
      
      Shorten variable names, while at it.
      
      Fixes: 33f0df8d ("x86/boot: Search for RSDP in the EFI tables")
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Tested-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: bhe@redhat.com
      Cc: caoj.fnst@cn.fujitsu.com
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: indou.takao@jp.fujitsu.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: kasong@redhat.com
      Cc: Kees Cook <keescook@chromium.org>
      Cc: msys.mizuma@gmail.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190208190248.GA10854@roeck-us.net
      f9d230e8
  4. 06 Feb, 2019 3 commits
    • Kairui Song's avatar
      x86/kexec: Fill in acpi_rsdp_addr from the first kernel · ccec81e4
      Kairui Song authored
      When efi=noruntime or efi=oldmap is used on the kernel command line, EFI
      services won't be available in the second kernel, therefore the second
      kernel will not be able to get the ACPI RSDP address from firmware by
      calling EFI services and so it won't boot.
      
      Commit
      
        e6e094e0 ("x86/acpi, x86/boot: Take RSDP address from boot params if available")
      
      added an acpi_rsdp_addr field to boot_params which stores the RSDP
      address for other kernel users.
      
      Recently, after
      
        3a63f70b ("x86/boot: Early parse RSDP and save it in boot_params")
      
      the acpi_rsdp_addr will always be filled with a valid RSDP address.
      
      So fill in that value into the second kernel's boot_params thus ensuring
      that the second kernel receives the RSDP value from the first kernel.
      
       [ bp: massage commit message. ]
      Signed-off-by: default avatarKairui Song <kasong@redhat.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Chao Fan <fanc.fnst@cn.fujitsu.com>
      Cc: Dave Young <dyoung@redhat.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: kexec@lists.infradead.org
      Cc: Philipp Rudo <prudo@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Cc: Yannik Sembritzki <yannik@sembritzki.me>
      Link: https://lkml.kernel.org/r/20190204173852.4863-1-kasong@redhat.com
      ccec81e4
    • Borislav Petkov's avatar
      x86/boot: Fix randconfig build error due to MEMORY_HOTREMOVE · 82df8261
      Borislav Petkov authored
      When building randconfigs, one of the failures is:
      
        ld: arch/x86/boot/compressed/kaslr.o: in function `choose_random_location':
        kaslr.c:(.text+0xbf7): undefined reference to `count_immovable_mem_regions'
        ld: kaslr.c:(.text+0xcbe): undefined reference to `immovable_mem'
        make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 1
      
      because CONFIG_ACPI is not enabled in this particular .config but
      CONFIG_MEMORY_HOTREMOVE is and count_immovable_mem_regions() is
      unresolvable because it is defined in compressed/acpi.c which is the
      compilation unit that depends on CONFIG_ACPI.
      
      Add CONFIG_ACPI to the explicit dependencies for MEMORY_HOTREMOVE.
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Chao Fan <fanc.fnst@cn.fujitsu.com>
      Cc: x86@kernel.org
      Link: https://lkml.kernel.org/r/20190205131033.9564-1-bp@alien8.de
      82df8261
    • Borislav Petkov's avatar
      x86/boot: Fix cmdline_find_option() prototype visibility · 82f9ed3a
      Borislav Petkov authored
        ac09c5f4 ("x86/boot: Build the command line parsing code unconditionally")
      
      enabled building the command line parsing code unconditionally but it
      forgot to remove the respective ifdeffery around the prototypes in the
      misc.h header, leading to
      
        arch/x86/boot/compressed/acpi.c: In function ‘get_acpi_rsdp’:
        arch/x86/boot/compressed/acpi.c:37:8: warning: implicit declaration of function \
      	  ‘cmdline_find_option’ [-Wimplicit-function-declaration]
          ret = cmdline_find_option("acpi_rsdp", val, MAX_ADDR_LEN);
                ^~~~~~~~~~~~~~~~~~~
      
      for configs where neither CONFIG_EARLY_PRINTK nor CONFIG_RANDOMIZE_BASE
      was defined.
      
      Drop the ifdeffery in the header too.
      
      Fixes: ac09c5f4 ("x86/boot: Build the command line parsing code unconditionally")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Chao Fan <fanc.fnst@cn.fujitsu.com>
      Cc: x86@kernel.org
      Link: https://lkml.kernel.org/r/5c51daf0.83pQEkvDZILqoSYW%lkp@intel.com
      Link: https://lkml.kernel.org/r/20190205131352.GA27396@zn.tnic
      82f9ed3a
  5. 01 Feb, 2019 8 commits
    • Chao Fan's avatar
      x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only · 690eaa53
      Chao Fan authored
      KASLR may randomly choose a range which is located in movable memory
      regions. As a result, this will break memory hotplug and make the
      movable memory chosen by KASLR immovable.
      
      Therefore, limit KASLR to choose memory regions in the immovable range
      after consulting the SRAT table.
      
       [ bp:
          - Rewrite commit message.
          - Trim comments.
       ]
      Signed-off-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: caoj.fnst@cn.fujitsu.com
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: indou.takao@jp.fujitsu.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: kasong@redhat.com
      Cc: Kees Cook <keescook@chromium.org>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: msys.mizuma@gmail.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190123110850.12433-8-fanc.fnst@cn.fujitsu.com
      690eaa53
    • Chao Fan's avatar
      x86/boot: Parse SRAT table and count immovable memory regions · 02a3e3cd
      Chao Fan authored
      Parse SRAT for the immovable memory regions and use that information to
      control which offset KASLR selects so that it doesn't overlap with any
      movable region.
      
       [ bp:
         - Move struct mem_vector where it is visible so that it builds.
         - Correct comments.
         - Rewrite commit message.
         ]
      Signed-off-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: <caoj.fnst@cn.fujitsu.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: <indou.takao@jp.fujitsu.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: <kasong@redhat.com>
      Cc: <keescook@chromium.org>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: <msys.mizuma@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190123110850.12433-7-fanc.fnst@cn.fujitsu.com
      02a3e3cd
    • Chao Fan's avatar
      x86/boot: Early parse RSDP and save it in boot_params · 3a63f70b
      Chao Fan authored
      The RSDP is needed by KASLR so parse it early and save it in
      boot_params.acpi_rsdp_addr, before KASLR setup runs.
      
      RSDP is needed by other kernel facilities so have the parsing code
      built-in instead of a long "depends on" line in Kconfig.
      
       [ bp:
          - Trim commit message and comments
          - Add CONFIG_ACPI dependency in the Makefile
          - Move ->acpi_rsdp_addr assignment with the rest of boot_params massaging in extract_kernel().
       ]
      Signed-off-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: bhe@redhat.com
      Cc: Cao jin <caoj.fnst@cn.fujitsu.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: indou.takao@jp.fujitsu.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: kasong@redhat.com
      Cc: Kees Cook <keescook@chromium.org>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: msys.mizuma@gmail.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190123110850.12433-6-fanc.fnst@cn.fujitsu.com
      3a63f70b
    • Chao Fan's avatar
      x86/boot: Search for RSDP in memory · 93a209aa
      Chao Fan authored
      Scan memory (EBDA) for the RSDP and verify RSDP by signature and
      checksum.
      
       [ bp:
         - Trim commit message.
         - Simplify bios_get_rsdp_addr() and cleanup mad casting.
       ]
      Signed-off-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: bhe@redhat.com
      Cc: caoj.fnst@cn.fujitsu.com
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: indou.takao@jp.fujitsu.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: kasong@redhat.com
      Cc: Kees Cook <keescook@chromium.org>
      Cc: msys.mizuma@gmail.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190123110850.12433-5-fanc.fnst@cn.fujitsu.com
      93a209aa
    • Chao Fan's avatar
      x86/boot: Search for RSDP in the EFI tables · 33f0df8d
      Chao Fan authored
      The immovable memory ranges information in the SRAT table is necessary
      to fix the issue of KASLR not paying attention to movable memory regions
      when selecting the offset. Therefore, SRAT needs to be parsed.
      
      Depending on the boot: KEXEC/EFI/BIOS, the methods to compute RSDP are
      different. When booting from EFI, the EFI table points to the RSDP. So
      iterate over the EFI system tables in order to find the RSDP.
      
       [ bp:
         - Heavily massage commit message
         - Trim comments
         - Move the CONFIG_ACPI ifdeffery into the Makefile.
       ]
      Signed-off-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: bhe@redhat.com
      Cc: caoj.fnst@cn.fujitsu.com
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: indou.takao@jp.fujitsu.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: kasong@redhat.com
      Cc: Kees Cook <keescook@chromium.org>
      Cc: msys.mizuma@gmail.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190123110850.12433-4-fanc.fnst@cn.fujitsu.com
      33f0df8d
    • Chao Fan's avatar
      x86/boot: Add "acpi_rsdp=" early parsing · 3c98e71b
      Chao Fan authored
      KASLR may randomly choose offsets which are located in movable memory
      regions resulting in the movable memory becoming immovable.
      
      The ACPI SRAT (System/Static Resource Affinity Table) describes memory
      ranges including ranges of memory provided by hot-added memory devices.
      In order to access SRAT, one needs the Root System Description Pointer
      (RSDP) with which to find the Root/Extended System Description Table
      (R/XSDT) which then contains the system description tables of which SRAT
      is one of.
      
      In case the RSDP address has been passed on the command line (kexec-ing
      a second kernel) parse it from there.
      
       [ bp: Rewrite the commit message and cleanup the code. ]
      Signed-off-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: bhe@redhat.com
      Cc: caoj.fnst@cn.fujitsu.com
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: indou.takao@jp.fujitsu.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: kasong@redhat.com
      Cc: Kees Cook <keescook@chromium.org>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: msys.mizuma@gmail.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190123110850.12433-3-fanc.fnst@cn.fujitsu.com
      3c98e71b
    • Chao Fan's avatar
      x86/boot: Copy kstrtoull() to boot/string.c · de50ce20
      Chao Fan authored
      Copy kstrtoull() and the other necessary functions from lib/kstrtox.c
      to boot/string.c so that code in boot/ can use kstrtoull() and the old
      simple_strtoull() can gradually be phased out.
      
      Using div_u64() from math64.h directly will cause the dividend to be
      handled as a 64-bit value and cause the infamous __divdi3 linker error
      due to gcc trying to use its library function for the 64-bit division.
      
      Therefore, separate the dividend into an upper and lower part.
      
       [ bp: Rewrite commit message. ]
      Signed-off-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: bhe@redhat.com
      Cc: caoj.fnst@cn.fujitsu.com
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: indou.takao@jp.fujitsu.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: kasong@redhat.com
      Cc: Kees Cook <keescook@chromium.org>
      Cc: msys.mizuma@gmail.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190123110850.12433-2-fanc.fnst@cn.fujitsu.com
      de50ce20
    • Borislav Petkov's avatar
      x86/boot: Build the command line parsing code unconditionally · ac09c5f4
      Borislav Petkov authored
      Just drop the three-item ifdeffery and build it in unconditionally.
      Early cmdline parsing is needed more often than not.
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: bhe@redhat.com
      Cc: hpa@zytor.com
      Cc: indou.takao@jp.fujitsu.com
      Cc: kasong@redhat.com
      Cc: keescook@chromium.org
      Cc: mingo@redhat.com
      Cc: msys.mizuma@gmail.com
      Cc: tglx@linutronix.de
      Cc: x86@kernel.org
      Link: https://lkml.kernel.org/r/20190130112238.GB18383@zn.tnic
      ac09c5f4
  6. 30 Jan, 2019 6 commits
    • Waiman Long's avatar
      fs/dcache: Track & report number of negative dentries · af0c9af1
      Waiman Long authored
      The current dentry number tracking code doesn't distinguish between
      positive & negative dentries.  It just reports the total number of
      dentries in the LRU lists.
      
      As excessive number of negative dentries can have an impact on system
      performance, it will be wise to track the number of positive and
      negative dentries separately.
      
      This patch adds tracking for the total number of negative dentries in
      the system LRU lists and reports it in the 5th field in the
      /proc/sys/fs/dentry-state file.  The number, however, does not include
      negative dentries that are in flight but not in the LRU yet as well as
      those in the shrinker lists which are on the way out anyway.
      
      The number of positive dentries in the LRU lists can be roughly found by
      subtracting the number of negative dentries from the unused count.
      
      Matthew Wilcox had confirmed that since the introduction of the
      dentry_stat structure in 2.1.60, the dummy array was there, probably for
      future extension.  They were not replacements of pre-existing fields.
      So no sane applications that read the value of /proc/sys/fs/dentry-state
      will do dummy thing if the last 2 fields of the sysctl parameter are not
      zero.  IOW, it will be safe to use one of the dummy array entry for
      negative dentry count.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      af0c9af1
    • Waiman Long's avatar
      fs: Don't need to put list_lru into its own cacheline · 7d10f70f
      Waiman Long authored
      The list_lru structure is essentially just a pointer to a table of
      per-node LRU lists.  Even if CONFIG_MEMCG_KMEM is defined, the list
      field is just used for LRU list registration and shrinker_id is set at
      initialization.  Those fields won't need to be touched that often.
      
      So there is no point to make the list_lru structures to sit in their own
      cachelines.
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7d10f70f
    • Waiman Long's avatar
      fs/dcache: Fix incorrect nr_dentry_unused accounting in shrink_dcache_sb() · 1dbd449c
      Waiman Long authored
      The nr_dentry_unused per-cpu counter tracks dentries in both the LRU
      lists and the shrink lists where the DCACHE_LRU_LIST bit is set.
      
      The shrink_dcache_sb() function moves dentries from the LRU list to a
      shrink list and subtracts the dentry count from nr_dentry_unused.  This
      is incorrect as the nr_dentry_unused count will also be decremented in
      shrink_dentry_list() via d_shrink_del().
      
      To fix this double decrement, the decrement in the shrink_dcache_sb()
      function is taken out.
      
      Fixes: 4e717f5c ("list_lru: remove special case function list_lru_dispose_all."
      Cc: stable@kernel.org
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1dbd449c
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 1c0490ce
      Linus Torvalds authored
      Pull IOMMU fixes from Joerg Roedel:
       "A few more fixes this time:
      
         - Two patches to fix the error path of the map_sg implementation of
           the AMD IOMMU driver.
      
         - Also a missing IOTLB flush is fixed in the AMD IOMMU driver.
      
         - Memory leak fix for the Intel IOMMU driver.
      
         - Fix a regression in the Mediatek IOMMU driver which caused device
           initialization to fail (seen as broken HDMI output)"
      
      * tag 'iommu-fixes-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/amd: Fix IOMMU page flush when detach device from a domain
        iommu/mediatek: Use correct fwspec in mtk_iommu_add_device()
        iommu/vt-d: Fix memory leak in intel_iommu_put_resv_regions()
        iommu/amd: Unmap all mapped pages in error path of map_sg
        iommu/amd: Call free_iova_fast with pfn in map_sg
      1c0490ce
    • Linus Torvalds's avatar
      Merge tag 'gpio-v5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio · 877ef51d
      Linus Torvalds authored
      Pull GPIO fixes from Linus Walleij:
       "Here is a bunch of GPIO fixes for the v5.0 series. I was helped out by
        Bartosz in collecting these fixes, for which I am very grateful, the
        biggest achievement in GPIO right now is work distribution.
      
        There is one serious core fix (timestamping) and a bunch of driver
        fixes:
      
         - Fix timestamps on nested IRQs
      
         - Handle IRQs properly in multiple instances of PCF857x
      
         - Use the right data register and IRQ type setting in the Spreadtrum
           GPIO driver
      
         - Let the value argument work properly when setting direction in the
           Altera GPIO driver
      
         - Mask interrupts properly in the vf610 driver"
      
      * tag 'gpio-v5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
        gpio: vf610: Mask all GPIO interrupts
        gpio: altera-a10sr: Set proper output level for direction_output
        gpio: sprd: Fix incorrect irq type setting for the async EIC
        gpio: sprd: Fix the incorrect data register
        gpiolib: fix line event timestamps for nested irqs
        gpio: pcf857x: Fix interrupts on multiple instances
      877ef51d
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 62967898
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Need to save away the IV across tls async operations, from Dave
          Watson.
      
       2) Upon successful packet processing, we should liberate the SKB with
          dev_consume_skb{_irq}(). From Yang Wei.
      
       3) Only apply RX hang workaround on effected macb chips, from Harini
          Katakam.
      
       4) Dummy netdev need a proper namespace assigned to them, from Josh
          Elsasser.
      
       5) Some paths of nft_compat run lockless now, and thus we need to use a
          proper refcnt_t. From Florian Westphal.
      
       6) Avoid deadlock in mlx5 by doing IRQ locking, from Moni Shoua.
      
       7) netrom does not refcount sockets properly wrt. timers, fix that by
          using the sock timer API. From Cong Wang.
      
       8) Fix locking of inexact inserts of xfrm policies, from Florian
          Westphal.
      
       9) Missing xfrm hash generation bump, also from Florian.
      
      10) Missing of_node_put() in hns driver, from Yonglong Liu.
      
      11) Fix DN_IFREQ_SIZE, from Johannes Berg.
      
      12) ip6mr notifier is invoked during traversal of wrong table, from Nir
          Dotan.
      
      13) TX promisc settings not performed correctly in qed, from Manish
          Chopra.
      
      14) Fix OOB access in vhost, from Jason Wang.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits)
        MAINTAINERS: Add entry for XDP (eXpress Data Path)
        net: set default network namespace in init_dummy_netdev()
        net: b44: replace dev_kfree_skb_xxx by dev_consume_skb_xxx for drop profiles
        net: caif: call dev_consume_skb_any when skb xmit done
        net: 8139cp: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: macb: Apply RXUBR workaround only to versions with errata
        net: ti: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: apple: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        net: amd8111e: replace dev_kfree_skb_irq by dev_consume_skb_irq
        net: alteon: replace dev_kfree_skb_irq by dev_consume_skb_irq
        net: tls: Fix deadlock in free_resources tx
        net: tls: Save iv in tls_rec for async crypto requests
        vhost: fix OOB in get_rx_bufs()
        qed: Fix stack out of bounds bug
        qed: Fix system crash in ll2 xmit
        qed: Fix VF probe failure while FLR
        qed: Fix LACP pdu drops for VFs
        qed: Fix bug in tx promiscuous mode settings
        net: i825xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles
        netfilter: ipt_CLUSTERIP: fix warning unused variable cn
        ...
      62967898
  7. 29 Jan, 2019 13 commits
  8. 28 Jan, 2019 7 commits
    • David S. Miller's avatar
      Merge branch 'qed-Bug-fixes' · bfe2599d
      David S. Miller authored
      Manish Chopra says:
      
      ====================
      qed: Bug fixes
      
      This series have SR-IOV and some general fixes.
      Please consider applying it to "net"
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bfe2599d
    • Manish Chopra's avatar
      qed: Fix stack out of bounds bug · ffb057f9
      Manish Chopra authored
      KASAN reported following bug in qed_init_qm_get_idx_from_flags
      due to inappropriate casting of "pq_flags". Fix the type of "pq_flags".
      
      [  196.624707] BUG: KASAN: stack-out-of-bounds in qed_init_qm_get_idx_from_flags+0x1a4/0x1b8 [qed]
      [  196.624712] Read of size 8 at addr ffff809b00bc7360 by task kworker/0:9/1712
      [  196.624714]
      [  196.624720] CPU: 0 PID: 1712 Comm: kworker/0:9 Not tainted 4.18.0-60.el8.aarch64+debug #1
      [  196.624723] Hardware name: To be filled by O.E.M. Saber/Saber, BIOS 0ACKL024 09/26/2018
      [  196.624733] Workqueue: events work_for_cpu_fn
      [  196.624738] Call trace:
      [  196.624742]  dump_backtrace+0x0/0x2f8
      [  196.624745]  show_stack+0x24/0x30
      [  196.624749]  dump_stack+0xe0/0x11c
      [  196.624755]  print_address_description+0x68/0x260
      [  196.624759]  kasan_report+0x178/0x340
      [  196.624762]  __asan_report_load_n_noabort+0x38/0x48
      [  196.624786]  qed_init_qm_get_idx_from_flags+0x1a4/0x1b8 [qed]
      [  196.624808]  qed_init_qm_info+0xec0/0x2200 [qed]
      [  196.624830]  qed_resc_alloc+0x284/0x7e8 [qed]
      [  196.624853]  qed_slowpath_start+0x6cc/0x1ae8 [qed]
      [  196.624864]  __qede_probe.isra.10+0x1cc/0x12c0 [qede]
      [  196.624874]  qede_probe+0x78/0xf0 [qede]
      [  196.624879]  local_pci_probe+0xc4/0x180
      [  196.624882]  work_for_cpu_fn+0x54/0x98
      [  196.624885]  process_one_work+0x758/0x1900
      [  196.624888]  worker_thread+0x4e0/0xd18
      [  196.624892]  kthread+0x2c8/0x350
      [  196.624897]  ret_from_fork+0x10/0x18
      [  196.624899]
      [  196.624902] Allocated by task 2:
      [  196.624906]  kasan_kmalloc.part.1+0x40/0x108
      [  196.624909]  kasan_kmalloc+0xb4/0xc8
      [  196.624913]  kasan_slab_alloc+0x14/0x20
      [  196.624916]  kmem_cache_alloc_node+0x1dc/0x480
      [  196.624921]  copy_process.isra.1.part.2+0x1d8/0x4a98
      [  196.624924]  _do_fork+0x150/0xfa0
      [  196.624926]  kernel_thread+0x48/0x58
      [  196.624930]  kthreadd+0x3a4/0x5a0
      [  196.624932]  ret_from_fork+0x10/0x18
      [  196.624934]
      [  196.624937] Freed by task 0:
      [  196.624938] (stack is not available)
      [  196.624940]
      [  196.624943] The buggy address belongs to the object at ffff809b00bc0000
      [  196.624943]  which belongs to the cache thread_stack of size 32768
      [  196.624946] The buggy address is located 29536 bytes inside of
      [  196.624946]  32768-byte region [ffff809b00bc0000, ffff809b00bc8000)
      [  196.624948] The buggy address belongs to the page:
      [  196.624952] page:ffff7fe026c02e00 count:1 mapcount:0 mapping:ffff809b4001c000 index:0x0 compound_mapcount: 0
      [  196.624960] flags: 0xfffff8000008100(slab|head)
      [  196.624967] raw: 0fffff8000008100 dead000000000100 dead000000000200 ffff809b4001c000
      [  196.624970] raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
      [  196.624973] page dumped because: kasan: bad access detected
      [  196.624974]
      [  196.624976] Memory state around the buggy address:
      [  196.624980]  ffff809b00bc7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  196.624983]  ffff809b00bc7280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  196.624985] >ffff809b00bc7300: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f2 f2 f2
      [  196.624988]                                                        ^
      [  196.624990]  ffff809b00bc7380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  196.624993]  ffff809b00bc7400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [  196.624995] ==================================================================
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ffb057f9
    • Manish Chopra's avatar
      qed: Fix system crash in ll2 xmit · 7c81626a
      Manish Chopra authored
      Cache number of fragments in the skb locally as in case
      of linear skb (with zero fragments), tx completion
      (or freeing of skb) may happen before driver tries
      to get number of frgaments from the skb which could
      lead to stale access to an already freed skb.
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c81626a
    • Manish Chopra's avatar
      qed: Fix VF probe failure while FLR · 327852ec
      Manish Chopra authored
      VFs may hit VF-PF channel timeout while probing, as in some
      cases it was observed that VF FLR and VF "acquire" message
      transaction (i.e first message from VF to PF in VF's probe flow)
      could occur simultaneously which could lead VF to fail sending
      "acquire" message to PF as VF is marked disabled from HW perspective
      due to FLR, which will result into channel timeout and VF probe failure.
      
      In such cases, try retrying VF "acquire" message so that in later
      attempts it could be successful to pass message to PF after the VF
      FLR is completed and can be probed successfully.
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      327852ec
    • Manish Chopra's avatar
      qed: Fix LACP pdu drops for VFs · ff929696
      Manish Chopra authored
      VF is always configured to drop control frames
      (with reserved mac addresses) but to work LACP
      on the VFs, it would require LACP control frames
      to be forwarded or transmitted successfully.
      
      This patch fixes this in such a way that trusted VFs
      (marked through ndo_set_vf_trust) would be allowed to
      pass the control frames such as LACP pdus.
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ff929696
    • Manish Chopra's avatar
      qed: Fix bug in tx promiscuous mode settings · 9e71a15d
      Manish Chopra authored
      When running tx switched traffic between VNICs
      created via a bridge(to which VFs are added),
      adapter drops the unicast packets in tx flow due to
      VNIC's ucast mac being unknown to it. But VF interfaces
      being in promiscuous mode should have caused adapter
      to accept all the unknown ucast packets. Later, it
      was found that driver doesn't really configure tx
      promiscuous mode settings to accept all unknown unicast macs.
      
      This patch fixes tx promiscuous mode settings to accept all
      unknown/unmatched unicast macs and works out the scenario.
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e71a15d
    • Yang Wei's avatar
      net: i825xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles · ca899324
      Yang Wei authored
      dev_consume_skb_irq() should be called in i596_interrupt() when skb
      xmit done. It makes drop profiles(dropwatch, perf) more friendly.
      Signed-off-by: default avatarYang Wei <albin_yang@163.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca899324