1. 02 Oct, 2018 6 commits
    • Aurelien Aptel's avatar
      smb2: fix missing files in root share directory listing · 0595751f
      Aurelien Aptel authored
      When mounting a Windows share that is the root of a drive (eg. C$)
      the server does not return . and .. directory entries. This results in
      the smb2 code path erroneously skipping the 2 first entries.
      
      Pseudo-code of the readdir() code path:
      
      cifs_readdir(struct file, struct dir_context)
          initiate_cifs_search            <-- if no reponse cached yet
              server->ops->query_dir_first
      
          dir_emit_dots
              dir_emit                    <-- adds "." and ".." if we're at pos=0
      
          find_cifs_entry
              initiate_cifs_search        <-- if pos < start of current response
                                               (restart search)
              server->ops->query_dir_next <-- if pos > end of current response
                                               (fetch next search res)
      
          for(...)                        <-- loops over cur response entries
                                                starting at pos
              cifs_filldir                <-- skip . and .., emit entry
                  cifs_fill_dirent
                  dir_emit
      	pos++
      
      A) dir_emit_dots() always adds . & ..
         and sets the current dir pos to 2 (0 and 1 are done).
      
      Therefore we always want the index_to_find to be 2 regardless of if
      the response has . and ..
      
      B) smb1 code initializes index_of_last_entry with a +2 offset
      
        in cifssmb.c CIFSFindFirst():
      		psrch_inf->index_of_last_entry = 2 /* skip . and .. */ +
      			psrch_inf->entries_in_buffer;
      
      Later in find_cifs_entry() we want to find the next dir entry at pos=2
      as a result of (A)
      
      	first_entry_in_buffer = cfile->srch_inf.index_of_last_entry -
      					cfile->srch_inf.entries_in_buffer;
      
      This var is the dir pos that the first entry in the buffer will
      have therefore it must be 2 in the first call.
      
      If we don't offset index_of_last_entry by 2 (like in (B)),
      first_entry_in_buffer=0 but we were instructed to get pos=2 so this
      code in find_cifs_entry() skips the 2 first which is ok for non-root
      shares, as it skips . and .. from the response but is not ok for root
      shares where the 2 first are actual files
      
      		pos_in_buf = index_to_find - first_entry_in_buffer;
                      // pos_in_buf=2
      		// we skip 2 first response entries :(
      		for (i = 0; (i < (pos_in_buf)) && (cur_ent != NULL); i++) {
      			/* go entry by entry figuring out which is first */
      			cur_ent = nxt_dir_entry(cur_ent, end_of_smb,
      						cfile->srch_inf.info_level);
      		}
      
      C) cifs_filldir() skips . and .. so we can safely ignore them for now.
      
      Sample program:
      
      int main(int argc, char **argv)
      {
      	const char *path = argc >= 2 ? argv[1] : ".";
      	DIR *dh;
      	struct dirent *de;
      
      	printf("listing path <%s>\n", path);
      	dh = opendir(path);
      	if (!dh) {
      		printf("opendir error %d\n", errno);
      		return 1;
      	}
      
      	while (1) {
      		de = readdir(dh);
      		if (!de) {
      			if (errno) {
      				printf("readdir error %d\n", errno);
      				return 1;
      			}
      			printf("end of listing\n");
      			break;
      		}
      		printf("off=%lu <%s>\n", de->d_off, de->d_name);
      	}
      
      	return 0;
      }
      
      Before the fix with SMB1 on root shares:
      
      <.>            off=1
      <..>           off=2
      <$Recycle.Bin> off=3
      <bootmgr>      off=4
      
      and on non-root shares:
      
      <.>    off=1
      <..>   off=4  <-- after adding .., the offsets jumps to +2 because
      <2536> off=5       we skipped . and .. from response buffer (C)
      <411>  off=6       but still incremented pos
      <file> off=7
      <fsx>  off=8
      
      Therefore the fix for smb2 is to mimic smb1 behaviour and offset the
      index_of_last_entry by 2.
      
      Test results comparing smb1 and smb2 before/after the fix on root
      share, non-root shares and on large directories (ie. multi-response
      dir listing):
      
      PRE FIX
      =======
      pre-1-root VS pre-2-root:
              ERR pre-2-root is missing [bootmgr, $Recycle.Bin]
      pre-1-nonroot VS pre-2-nonroot:
              OK~ same files, same order, different offsets
      pre-1-nonroot-large VS pre-2-nonroot-large:
              OK~ same files, same order, different offsets
      
      POST FIX
      ========
      post-1-root VS post-2-root:
              OK same files, same order, same offsets
      post-1-nonroot VS post-2-nonroot:
              OK same files, same order, same offsets
      post-1-nonroot-large VS post-2-nonroot-large:
              OK same files, same order, same offsets
      
      REGRESSION?
      ===========
      pre-1-root VS post-1-root:
              OK same files, same order, same offsets
      pre-1-nonroot VS post-1-nonroot:
              OK same files, same order, same offsets
      
      BugLink: https://bugzilla.samba.org/show_bug.cgi?id=13107Signed-off-by: default avatarAurelien Aptel <aaptel@suse.com>
      Signed-off-by: default avatarPaulo Alcantara <palcantara@suse.deR>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      CC: Stable <stable@vger.kernel.org>
      0595751f
    • Greg Kroah-Hartman's avatar
      Merge tag 'fbdev-v4.19-rc7' of https://github.com/bzolnier/linux · 1d2ba7fe
      Greg Kroah-Hartman authored
      Bartlomiej writes:
        "fbdev fixes for v4.19-rc7:
      
         - fix OMAPFB_MEMORY_READ ioctl to not leak kernel memory in omapfb driver
           (Tomi Valkeinen)
      
         - add missing prepare/unprepare clock operations in pxa168fb driver
           (Lubomir Rintel)
      
         - add nobgrt option in efifb driver to disable ACPI BGRT logo restore
           (Hans de Goede)
      
         - fix spelling mistake in fall-through annotation in stifb driver
           (Gustavo A. R. Silva)
      
         - fix URL for uvesafb repository in the documentation (Adam Jackson)"
      
      * tag 'fbdev-v4.19-rc7' of https://github.com/bzolnier/linux:
        video/fbdev/stifb: Fix spelling mistake in fall-through annotation
        uvesafb: Fix URLs in the documentation
        efifb: BGRT: Add nobgrt option
        fbdev/omapfb: fix omapfb_memory_read infoleak
        pxa168fb: prepare the clock
      1d2ba7fe
    • Greg Kroah-Hartman's avatar
      Merge tag 'mmc-v4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 5e0b19ac
      Greg Kroah-Hartman authored
      Ulf writes:
        "MMC core:
          - Fixup conversion of debounce time to/from ms/us
      
         MMC host:
          - sdhi: Fixup whitelisting for Gen3 types"
      
      * tag 'mmc-v4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: slot-gpio: Fix debounce time to use miliseconds again
        mmc: core: Fix debounce time to use microseconds
        mmc: sdhi: sys_dmac: check for all Gen3 types when whitelisting
      5e0b19ac
    • Greg Kroah-Hartman's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 385afbf8
      Greg Kroah-Hartman authored
      Will writes:
        "Late arm64 fixes
      
         - Fix handling of young contiguous ptes for hugetlb mappings
      
         - Fix livelock when taking access faults on contiguous hugetlb mappings
      
         - Tighten up register accesses via KVM SET_ONE_REG ioctl()s"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: KVM: Sanitize PSTATE.M when being set from userspace
        arm64: KVM: Tighten guest core register access from userspace
        arm64: hugetlb: Avoid unnecessary clearing in huge_ptep_set_access_flags
        arm64: hugetlb: Fix handling of young ptes
      385afbf8
    • Greg Kroah-Hartman's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · b62e4255
      Greg Kroah-Hartman authored
      Olof writes:
        "ARM: SoC fixes
      
         A handful of fixes that have been coming in the last couple of weeks:
      
         - Freescale fixes for on-chip accellerators
         - A DT fix for stm32 to avoid fallback to non-DMA SPI mode
         - Fixes for badly specified interrupts on BCM63xx SoCs
         - Allwinner A64 HDMI was incorrectly specified as fully compatble with R40
         - Drive strength fix for SAMA5D2 NAND pins on one board"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: dts: stm32: update SPI6 dmas property on stm32mp157c
        soc: fsl: qe: Fix copy/paste bug in ucc_get_tdm_sync_shift()
        soc: fsl: qbman: qman: avoid allocating from non existing gen_pool
        ARM: dts: BCM63xx: Fix incorrect interrupt specifiers
        MAINTAINERS: update the Annapurna Labs maintainer email
        ARM: dts: sun8i: drop A64 HDMI PHY fallback compatible from R40 DT
        ARM: dts: at91: sama5d2_ptc_ek: fix nand pinctrl
      b62e4255
    • Greg Kroah-Hartman's avatar
      Merge tag 'pstore-v4.19-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · ef0f2584
      Greg Kroah-Hartman authored
      Kees writes:
        "Pstore fixes for v4.19-rc7
      
         - Fix failure-path memory leak in ramoops_init (nixiaoming)"
      
      * tag 'pstore-v4.19-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        pstore/ram: Fix failure-path memory leak in ramoops_init
      ef0f2584
  2. 01 Oct, 2018 2 commits
  3. 30 Sep, 2018 5 commits
  4. 29 Sep, 2018 12 commits
    • Greg Kroah-Hartman's avatar
      Merge tag 'for-linus-20180929' of git://git.kernel.dk/linux-block · 291d0e5d
      Greg Kroah-Hartman authored
      Jens writes:
        "Block fixes for 4.19-rc6
      
         A set of fixes that should go into this release. This pull request
         contains:
      
         - A fix (hopefully) for the persistent grants for xen-blkfront. A
           previous fix from this series wasn't complete, hence reverted, and
           this one should hopefully be it. (Boris Ostrovsky)
      
         - Fix for an elevator drain warning with SMR devices, which is
           triggered when you switch schedulers (Damien)
      
         - bcache deadlock fix (Guoju Fang)
      
         - Fix for the block unplug tracepoint, which has had the
           timer/explicit flag reverted since 4.11 (Ilya)
      
         - Fix a regression in this series where the blk-mq timeout hook is
           invoked with the RCU read lock held, hence preventing it from
           blocking (Keith)
      
         - NVMe pull from Christoph, with a single multipath fix (Susobhan Dey)"
      
      * tag 'for-linus-20180929' of git://git.kernel.dk/linux-block:
        xen/blkfront: correct purging of persistent grants
        Revert "xen/blkfront: When purging persistent grants, keep them in the buffer"
        blk-mq: I/O and timer unplugs are inverted in blktrace
        bcache: add separate workqueue for journal_write to avoid deadlock
        xen/blkfront: When purging persistent grants, keep them in the buffer
        block: fix deadline elevator drain for zoned block devices
        blk-mq: Allow blocking queue tag iter callbacks
        nvme: properly propagate errors in nvme_mpath_init
      291d0e5d
    • Greg Kroah-Hartman's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e7541773
      Greg Kroah-Hartman authored
      Thomas writes:
        "A single fix for the AMD memory encryption boot code so it does not
         read random garbage instead of the cached encryption bit when a kexec
         kernel is allocated above the 32bit address limit."
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot: Fix kexec booting failure in the SEV bit detection code
      e7541773
    • Greg Kroah-Hartman's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e1ce697d
      Greg Kroah-Hartman authored
      Thomas writes:
        "Three small fixes for clocksource drivers:
         - Proper error handling in the Atmel PIT driver
         - Add CLOCK_SOURCE_SUSPEND_NONSTOP for TI SoCs so suspend works again
         - Fix the next event function for Facebook Backpack-CMM BMC chips so
           usleep(100) doesnt sleep several milliseconds"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource/drivers/timer-atmel-pit: Properly handle error cases
        clocksource/drivers/fttmr010: Fix set_next_event handler
        clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs
      e1ce697d
    • Greg Kroah-Hartman's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · af17b3aa
      Greg Kroah-Hartman authored
      Thomas writes:
        "A single fix for a missing sanity check when a pinned event is tried
        to be read on the wrong CPU due to a legit event scheduling failure."
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Add sanity check to deal with pinned event failure
      af17b3aa
    • Greg Kroah-Hartman's avatar
      Merge tag 'pm-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 82ec752c
      Greg Kroah-Hartman authored
      Rafael writes:
        "Power management fix for 4.19-rc6
      
         Fix incorrect __init and __exit annotations in the Qualcomm
         Kryo cpufreq driver (Nathan Chancellor)."
      
      * tag 'pm-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: qcom-kryo: Fix section annotations
      82ec752c
    • Nathan Chancellor's avatar
      cpufreq: qcom-kryo: Fix section annotations · d51aea13
      Nathan Chancellor authored
      There is currently a warning when building the Kryo cpufreq driver into
      the kernel image:
      
      WARNING: vmlinux.o(.text+0x8aa424): Section mismatch in reference from
      the function qcom_cpufreq_kryo_probe() to the function
      .init.text:qcom_cpufreq_kryo_get_msm_id()
      The function qcom_cpufreq_kryo_probe() references
      the function __init qcom_cpufreq_kryo_get_msm_id().
      This is often because qcom_cpufreq_kryo_probe lacks a __init
      annotation or the annotation of qcom_cpufreq_kryo_get_msm_id is wrong.
      
      Remove the '__init' annotation from qcom_cpufreq_kryo_get_msm_id
      so that there is no more mismatch warning.
      
      Additionally, Nick noticed that the remove function was marked as
      '__init' when it should really be marked as '__exit'.
      
      Fixes: 46e2856b (cpufreq: Add Kryo CPU scaling driver)
      Fixes: 5ad7346b (cpufreq: kryo: Add module remove and exit)
      Reported-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Cc: 4.18+ <stable@vger.kernel.org> # 4.18+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d51aea13
    • Greg Kroah-Hartman's avatar
      Merge tag 'dma-mapping-4.19-3' of git://git.infradead.org/users/hch/dma-mapping · 7a6878bb
      Greg Kroah-Hartman authored
      Christoph writes:
        "dma mapping fix for 4.19-rc6
      
         fix a missing Kconfig symbol for commits introduced in 4.19-rc"
      
      * tag 'dma-mapping-4.19-3' of git://git.infradead.org/users/hch/dma-mapping:
        dma-mapping: add the missing ARCH_HAS_SYNC_DMA_FOR_CPU_ALL declaration
      7a6878bb
    • Greg Kroah-Hartman's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · e704966c
      Greg Kroah-Hartman authored
      Dmitry writes:
        "Input updates for v4.19-rc5
      
         Just a few driver fixes"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: uinput - allow for max == min during input_absinfo validation
        Input: elantech - enable middle button of touchpad on ThinkPad P72
        Input: atakbd - fix Atari CapsLock behaviour
        Input: atakbd - fix Atari keymap
        Input: egalax_ts - add system wakeup support
        Input: gpio-keys - fix a documentation index issue
      e704966c
    • Greg Kroah-Hartman's avatar
      Merge tag 'spi-fix-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 2f19e7a7
      Greg Kroah-Hartman authored
      Mark writes:
        "spi: Fixes for v4.19
      
         Quite a few fixes for the Renesas drivers in here, plus a fix for the
         Tegra driver and some documentation fixes for the recently added
         spi-mem code.  The Tegra fix is relatively large but fairly
         straightforward and mechanical, it runs on probe so it's been
         reasonably well covered in -next testing."
      
      * tag 'spi-fix-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: spi-mem: Move the DMA-able constraint doc to the kerneldoc header
        spi: spi-mem: Add missing description for data.nbytes field
        spi: rspi: Fix interrupted DMA transfers
        spi: rspi: Fix invalid SPI use during system suspend
        spi: sh-msiof: Fix handling of write value for SISTR register
        spi: sh-msiof: Fix invalid SPI use during system suspend
        spi: gpio: Fix copy-and-paste error
        spi: tegra20-slink: explicitly enable/disable clock
      2f19e7a7
    • Greg Kroah-Hartman's avatar
      Merge tag 'regulator-v4.19-rc5' of... · 8f056611
      Greg Kroah-Hartman authored
      Merge tag 'regulator-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      
      Mark writes:
        "regulator: Fixes for 4.19
      
         A collection of fairly minor bug fixes here, a couple of driver
         specific ones plus two core fixes.  There's one fix for the new
         suspend state code which fixes some confusion with constant values
         that are supposed to indicate noop operation and another fixing a
         race condition with the creation of sysfs files on new regulators."
      
      * tag 'regulator-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: fix crash caused by null driver data
        regulator: Fix 'do-nothing' value for regulators without suspend state
        regulator: da9063: fix DT probing with constraints
        regulator: bd71837: Disable voltage monitoring for LDO3/4
      8f056611
    • Greg Kroah-Hartman's avatar
      Merge tag 'powerpc-4.19-3' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · f005de01
      Greg Kroah-Hartman authored
      Michael writes:
        "powerpc fixes for 4.19 #3
      
         A reasonably big batch of fixes due to me being away for a few weeks.
      
         A fix for the TM emulation support on Power9, which could result in
         corrupting the guest r11 when running under KVM.
      
         Two fixes to the TM code which could lead to userspace GPR corruption
         if we take an SLB miss at exactly the wrong time.
      
         Our dynamic patching code had a bug that meant we could patch freed
         __init text, which could lead to corrupting userspace memory.
      
         csum_ipv6_magic() didn't work on little endian platforms since we
         optimised it recently.
      
         A fix for an endian bug when reading a device tree property telling
         us how many storage keys the machine has available.
      
         Fix a crash seen on some configurations of PowerVM when migrating the
         partition from one machine to another.
      
         A fix for a regression in the setup of our CPU to NUMA node mapping
         in KVM guests.
      
         A fix to our selftest Makefiles to make them work since a recent
         change to the shared Makefile logic."
      
      * tag 'powerpc-4.19-3' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        selftests/powerpc: Fix Makefiles for headers_install change
        powerpc/numa: Use associativity if VPHN hcall is successful
        powerpc/tm: Avoid possible userspace r1 corruption on reclaim
        powerpc/tm: Fix userspace r13 corruption
        powerpc/pseries: Fix unitialized timer reset on migration
        powerpc/pkeys: Fix reading of ibm, processor-storage-keys property
        powerpc: fix csum_ipv6_magic() on little endian platforms
        powerpc/powernv/ioda2: Reduce upper limit for DMA window size (again)
        powerpc: Avoid code patching freed init sections
        KVM: PPC: Book3S HV: Fix guest r11 corruption with POWER9 TM workarounds
      f005de01
    • Greg Kroah-Hartman's avatar
      Merge tag 'pinctrl-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 900915f9
      Greg Kroah-Hartman authored
      Linus writes:
        "Pin control fixes for v4.19:
         - Fixes to x86 hardware:
         - AMD interrupt debounce issues
         - Faulty Intel cannonlake register offset
         - Revert pin translation IRQ locking"
      
      * tag 'pinctrl-v4.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        Revert "pinctrl: intel: Do pin translation when lock IRQ"
        pinctrl: cannonlake: Fix HOSTSW_OWN register offset of H variant
        pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type
      900915f9
  5. 28 Sep, 2018 9 commits
  6. 27 Sep, 2018 6 commits