Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on May 6, 2015
  1. Merge tag 'for-linus-4.1-1' of git://git.code.sf.net/p/openipmi/linux…

    authored
    …-ipmi
    
    Pull IPMI fixes from Corey Minyard:
     "Lots of minor IPMI fixes, especially ones that have have come up since
      the SSIF driver has been in the main kernel for a while"
    
    * tag 'for-linus-4.1-1' of git://git.code.sf.net/p/openipmi/linux-ipmi:
      ipmi: Fix multi-part message handling
      ipmi: Add alert handling to SSIF
      ipmi: Fix a problem that messages are not issued in run_to_completion mode
      ipmi: Report an error if ACPI _IFT doesn't exist
      ipmi: Remove unused including <linux/version.h>
      ipmi: Don't report err in the SI driver for SSIF devices
      ipmi: Remove incorrect use of seq_has_overflowed
      ipmi:ssif: Ignore spaces when comparing I2C adapter names
      ipmi_ssif: Fix the logic on user-supplied addresses
  2. Merge branch 'akpm' (patches from Andrew)

    authored
    Merge misc fixes from Andrew Morton:
     "16 patches
    
      This includes a new rtc driver for the Abracon AB x80x and isn't very
      appropriate for -rc2.  It was still being fiddled with a bit during
      the merge window and I fell asleep during -rc1"
    
    [ So I took the new driver, it seems small and won't regress anything.
      I'm a softy.   - Linus ]
    
    * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
      rtc: armada38x: fix concurrency access in armada38x_rtc_set_time
      ocfs2: dlm: fix race between purge and get lock resource
      nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()
      util_macros.h: have array pointer point to array of constants
      configfs: init configfs module earlier at boot time
      mm/hwpoison-inject: check PageLRU of hpage
      mm/hwpoison-inject: fix refcounting in no-injection case
      mm: soft-offline: fix num_poisoned_pages counting on concurrent events
      rtc: add rtc-abx80x, a driver for the Abracon AB x80x i2c rtc
      Documentation: bindings: add abracon,abx80x
      kasan: show gcc version requirements in Kconfig and Documentation
      mm/memory-failure: call shake_page() when error hits thp tail page
      lib: delete lib/find_last_bit.c
      MAINTAINERS: add co-maintainer for LED subsystem
      zram: add Designated Reviewer for zram in MAINTAINERS
      revert "zram: move compact_store() to sysfs functions area"
  3. Merge tag 'platform-drivers-x86-v4.1-2' of git://git.infradead.org/us…

    authored
    …ers/dvhart/linux-platform-drivers-x86
    
    Pull x86 platform driver fixes from Darren Hart:
     "This includes a trivial warning and adding a Lenovo laptop to an
      existing quirk.
    
      I've held off on things like the latter in the past, but I didn't feel
      it was risky enough to push out to 4.2.
    
       - thinkpad_acpi:
            Fix warning for static not at beginning
    
       - ideapad_laptop:
            Add Lenovo G40-30 to devices without radio switch"
    
    * tag 'platform-drivers-x86-v4.1-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
      thinkpad_acpi: Fix warning for static not at beginning
      ideapad_laptop: Add Lenovo G40-30 to devices without radio switch
  4. ipmi: Fix multi-part message handling

    Corey Minyard authored
    Lots of little fixes for multi-part messages:
    
    The values was not being re-initialized, if something went wrong
    handling a multi-part message and it got left in a bad state, it
    might be an issue.
    
    The commands were not correct when issuing multi-part reads, the
    code was not passing in the proper value for commands.  Also clean
    up some minor formatting issues.
    
    Get the block number from the right location, limit the maximum send
    message size to 63 bytes and explain why, and fix some minor sylistic
    issues.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  5. ipmi: Add alert handling to SSIF

    Corey Minyard authored
    The SSIF interface can optionally have an SMBus alert come in when
    data is ready.  Unfortunately, the IPMI spec gives wiggle room to
    the implementer to allow them to always have the alert enabled,
    even if the driver doesn't enable it.  So implement alerts.
    If you don't in this situation, the SMBus alert handling will
    constantly complain.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  6. ipmi: Fix a problem that messages are not issued in run_to_completion…

    Hidehiro Kawai authored Corey Minyard committed
    … mode
    
    start_next_msg() issues a message placed in smi_info->waiting_msg
    if it is non-NULL.  However, sender() sets a message to
    smi_info->curr_msg and NULL to smi_info->waiting_msg in the context
    of run_to_completion mode.  As the result, it leads an infinite
    loop by waiting the completion of unissued message when leaving
    dying message after kernel panic.
    
    sender() should set the message to smi_info->waiting_msg not
    curr_msg.
    
    Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  7. ipmi: Report an error if ACPI _IFT doesn't exist

    Corey Minyard authored
    When probing an ACPI table, report a specific error, instead of just
    returning an error, if _IFT doesn't exist.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  8. ipmi: Remove unused including <linux/version.h>

    Wei Yongjun authored Corey Minyard committed
    Remove including <linux/version.h> that don't need it.
    
    Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  9. @gclement

    rtc: armada38x: fix concurrency access in armada38x_rtc_set_time

    gclement authored committed
    While setting the time, the RTC TIME register should not be accessed.
    However due to hardware constraints, setting the RTC time involves
    sleeping during 100ms.  This sleep was done outside the critical section
    protected by the spinlock, so it was possible to read the RTC TIME
    register and get an incorrect value.  This patch introduces a mutex for
    protecting the RTC TIME access, unlike the spinlock it is allowed to
    sleep in a critical section protected by a mutex.
    
    The RTC STATUS register can still be used from the interrupt handler but
    it has no effect on setting the time.
    
    Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
    Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
    Acked-by: Andrew Lunn <andrew@lunn.ch>
    Cc: Alessandro Zummo <a.zummo@towertech.it>
    Cc: <stable@vger.kernel.org>	[4.0]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  10. ocfs2: dlm: fix race between purge and get lock resource

    Junxiao Bi authored committed
    There is a race window in dlm_get_lock_resource(), which may return a
    lock resource which has been purged.  This will cause the process to
    hang forever in dlmlock() as the ast msg can't be handled due to its
    lock resource not existing.
    
        dlm_get_lock_resource {
            ...
            spin_lock(&dlm->spinlock);
            tmpres = __dlm_lookup_lockres_full(dlm, lockid, namelen, hash);
            if (tmpres) {
                 spin_unlock(&dlm->spinlock);
                 >>>>>>>> race window, dlm_run_purge_list() may run and purge
                                  the lock resource
                 spin_lock(&tmpres->spinlock);
                 ...
                 spin_unlock(&tmpres->spinlock);
            }
        }
    
    Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
    Cc: Joseph Qi <joseph.qi@huawei.com>
    Cc: Mark Fasheh <mfasheh@suse.com>
    Cc: Joel Becker <jlbec@evilplan.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  11. @konis

    nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()

    konis authored committed
    The range check for b-tree level parameter in nilfs_btree_root_broken()
    is wrong; it accepts the case of "level == NILFS_BTREE_LEVEL_MAX" even
    though the level is limited to values in the range of 0 to
    (NILFS_BTREE_LEVEL_MAX - 1).
    
    Since the level parameter is read from storage device and used to index
    nilfs_btree_path array whose element count is NILFS_BTREE_LEVEL_MAX, it
    can cause memory overrun during btree operations if the boundary value
    is set to the level parameter on device.
    
    This fixes the broken sanity check and adds a comment to clarify that
    the upper bound NILFS_BTREE_LEVEL_MAX is exclusive.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  12. @groeck

    util_macros.h: have array pointer point to array of constants

    groeck authored committed
    Using the new find_closest() macro can result in the following sparse
    warnings.
    
      drivers/hwmon/lm85.c:194:16: warning:
      		incorrect type in initializer (different modifiers)
      drivers/hwmon/lm85.c:194:16:    expected int *__fc_a
      drivers/hwmon/lm85.c:194:16:    got int static const [toplevel] *<noident>
      drivers/hwmon/lm85.c:210:16: warning:
      		incorrect type in initializer (different modifiers)
      drivers/hwmon/lm85.c:210:16:    expected int *__fc_a
      drivers/hwmon/lm85.c:210:16:    got int const *map
    
    This is because the array passed to find_closest() will typically be
    declared as array of constants, but the macro declares a non-constant
    pointer to it.
    
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
    
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  13. configfs: init configfs module earlier at boot time

    Daniel Baluta authored committed
    We need this earlier in the boot process to allow various subsystems to
    use configfs (e.g Industrial IIO).
    
    Also, debugfs is at core_initcall level and configfs should be on the same
    level from infrastructure point of view.
    
    Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
    Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Joel Becker <jlbec@evilplan.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  14. @Naoya-Horiguchi

    mm/hwpoison-inject: check PageLRU of hpage

    Naoya-Horiguchi authored committed
    Hwpoison injector checks PageLRU of the raw target page to find out
    whether the page is an appropriate target, but current code now filters
    out thp tail pages, which prevents us from testing for such cases via this
    interface.  So let's check hpage instead of p.
    
    Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Acked-by: Dean Nelson <dnelson@redhat.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  15. @Naoya-Horiguchi

    mm/hwpoison-inject: fix refcounting in no-injection case

    Naoya-Horiguchi authored committed
    Hwpoison injection via debugfs:hwpoison/corrupt-pfn takes a refcount of
    the target page.  But current code doesn't release it if the target page
    is not supposed to be injected, which results in memory leak.  This patch
    simply adds the refcount releasing code.
    
    Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Acked-by: Dean Nelson <dnelson@redhat.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  16. @Naoya-Horiguchi

    mm: soft-offline: fix num_poisoned_pages counting on concurrent events

    Naoya-Horiguchi authored committed
    If multiple soft offline events hit one free page/hugepage concurrently,
    soft_offline_page() can handle the free page/hugepage multiple times,
    which makes num_poisoned_pages counter increased more than once.  This
    patch fixes this wrong counting by checking TestSetPageHWPoison for normal
    papes and by checking the return value of dequeue_hwpoisoned_huge_page()
    for hugepages.
    
    Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Acked-by: Dean Nelson <dnelson@redhat.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: <stable@vger.kernel.org>	[3.14+]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  17. @phdm

    rtc: add rtc-abx80x, a driver for the Abracon AB x80x i2c rtc

    phdm authored committed
    This is a basic driver for the ultra-low-power Abracon AB x80x series of RTC
    chips. It supports in particular, the supersets AB0805 and AB1805.
    It allows reading and writing the time, and enables the supercapacitor/
    battery charger.
    
    [arnd@arndb.de: abx805 depends on i2c]
    [alexandre.belloni@free-electrons.com: renam buffer from date to buf in abx80x_rtc_read_time()]
    Signed-off-by: Philippe De Muyter <phdm@macqel.be>
    Cc: Alessandro Zummo <a.zummo@towertech.it>
    Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Cc: Paul Bolle <pebolle@tiscali.nl>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  18. @alexandrebelloni

    Documentation: bindings: add abracon,abx80x

    alexandrebelloni authored committed
    Document the bindings for abracon,abx80x and related compatibles.
    
    Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
    Cc: Philippe De Muyter <phdm@macqel.be>
    Cc: Alessandro Zummo <a.zummo@towertech.it>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Paul Bolle <pebolle@tiscali.nl>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  19. kasan: show gcc version requirements in Kconfig and Documentation

    Joe Perches authored committed
    The documentation shows a need for gcc > 4.9.2, but it's really >=.  The
    Kconfig entries don't show require versions so add them.  Correct a
    latter/later typo too.  Also mention that gcc 5 required to catch out of
    bounds accesses to global and stack variables.
    
    Signed-off-by: Joe Perches <joe@perches.com>
    Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  20. @Naoya-Horiguchi

    mm/memory-failure: call shake_page() when error hits thp tail page

    Naoya-Horiguchi authored committed
    Currently memory_failure() calls shake_page() to sweep pages out from
    pcplists only when the victim page is 4kB LRU page or thp head page.
    But we should do this for a thp tail page too.
    
    Consider that a memory error hits a thp tail page whose head page is on
    a pcplist when memory_failure() runs.  Then, the current kernel skips
    shake_pages() part, so hwpoison_user_mappings() returns without calling
    split_huge_page() nor try_to_unmap() because PageLRU of the thp head is
    still cleared due to the skip of shake_page().
    
    As a result, me_huge_page() runs for the thp, which is broken behavior.
    
    One effect is a leak of the thp.  And another is to fail to isolate the
    memory error, so later access to the error address causes another MCE,
    which kills the processes which used the thp.
    
    This patch fixes this problem by calling shake_page() for thp tail case.
    
    Fixes: 385de35 ("thp: allow a hwpoisoned head page to be put back to LRU")
    Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Reviewed-by: Andi Kleen <ak@linux.intel.com>
    Acked-by: Dean Nelson <dnelson@redhat.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
    Cc: Jin Dongming <jin.dongming@np.css.fujitsu.com>
    Cc: <stable@vger.kernel.org>	[3.4+]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  21. lib: delete lib/find_last_bit.c

    Yury Norov authored committed
    The file lib/find_last_bit.c was no longer used and supposed to be
    deleted by commit 8f6f19d ("lib: move find_last_bit to
    lib/find_next_bit.c") but that delete didn't happen.  This gets rid of
    it.
    
    Signed-off-by: Yury Norov <yury.norov@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  22. MAINTAINERS: add co-maintainer for LED subsystem

    Andrew Morton authored committed
    Add myself (Jacek Anaszewski) as a co-maintainer for the LED subsystem.
    
    Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
    Acked-by: Bryan Wu <cooloney@gmail.com>
    Cc: Richard Purdie <rpurdie@rpsys.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  23. @minchank

    zram: add Designated Reviewer for zram in MAINTAINERS

    minchank authored committed
    Sergey Senozhatsky has contributed/reviewed to zram for a long time.  He
    is really helpful for maintaining zram so I want for him to continue
    helping me as Designated Reviewer unless he hates it.
    
    Signed-off-by: Minchan Kim <minchan@kernel.org>
    Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  24. revert "zram: move compact_store() to sysfs functions area"

    Andrew Morton authored committed
    Revert commit c72c616
    
    It was intended to be a cosmetic change that w/o any functional change
    and was part of a bigger change:
    
      http://lkml.iu.edu/hypermail/linux/kernel/1503.1/01818.html
    
    Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Minchan Kim <minchan@kernel.org>
    Cc: Nitin Gupta <ngupta@vflare.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Commits on May 5, 2015
  1. @jdelvare @dvhart

    thinkpad_acpi: Fix warning for static not at beginning

    jdelvare authored dvhart committed
    Fix the following warning:
    
    warning: "static" is not at beginning of declaration
     void static hotkey_mask_warn_incomplete_mask(void)
     ^
    
    Signed-off-by: Jean Delvare <jdelvare@suse.de>
    Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
    Cc: Darren Hart <dvhart@infradead.org>
    Signed-off-by: Darren Hart <dvhart@linux.intel.com>
  2. ipmi: Don't report err in the SI driver for SSIF devices

    Corey Minyard authored
    Really ignore them by returning -ENODEV from the probe, but not
    doing anything.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  3. ipmi: Remove incorrect use of seq_has_overflowed

    Joe Perches authored Corey Minyard committed
    commit d6c5dc1 ("ipmi: Remove uses of return value of seq_printf")
    incorrectly changed the return value of various proc_show functions
    to use seq_has_overflowed().
    
    These functions should return 0 on completion rather than 1/true
    on overflow.  1 is the same as #define SEQ_SKIP which would cause
    the output to not be emitted (skipped) instead.
    
    This is a logical defect only as the length of these outputs are
    all smaller than the initial allocation done by the seq filesystem.
    
    Signed-off-by: Joe Perches <joe@perches.com>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  4. ipmi:ssif: Ignore spaces when comparing I2C adapter names

    Corey Minyard authored
    Some of the adapters have spaces in their names, but that's really
    hard to pass in as a module or kernel parameters.  So ignore the
    spaces.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  5. ipmi_ssif: Fix the logic on user-supplied addresses

    Corey Minyard authored
    Returning zero is success.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
  6. Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

    authored
    Pull crypto fixes from Herbert Xu:
     "This fixes a build problem with bcm63xx and yet another fix to the
      memzero_explicit function to ensure that the memset is not elided"
    
    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
      hwrng: bcm63xx - Fix driver compilation
      lib: make memzero_explicit more robust against dead store elimination
  7. Merge tag 'media/v4.1-3' of git://git.kernel.org/pub/scm/linux/kernel…

    authored
    …/git/mchehab/linux-media
    
    Pull media fixes from Mauro Carvalho Chehab:
     "Three driver fixes:
    
       - fix for omap4, fixing a regression due to a subsystem API that got
         removed for 4.1 (commit efde234);
    
       - fix for one of the formats supported by Marvel ccic driver;
    
       - fix rcar_vin driver that, when stopping abnormally, the driver
         can't return from wait_for_completion"
    
    * tag 'media/v4.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
      [media] v4l: omap4iss: Replace outdated OMAP4 control pad API with syscon
      [media] media: soc_camera: rcar_vin: Fix wait_for_completion
      [media] marvell-ccic: fix Y'CbCr ordering
Commits on May 4, 2015
  1. @Noltari @herbertx

    hwrng: bcm63xx - Fix driver compilation

    Noltari authored herbertx committed
    - s/clk_didsable_unprepare/clk_disable_unprepare
    - s/prov/priv
    - s/error/ret (bcm63xx_rng_probe)
    
    Fixes: 6229c16 ("hwrng: bcm63xx - make use of devm_hwrng_register")
    Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
    Acked-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  2. @borkmann @herbertx

    lib: make memzero_explicit more robust against dead store elimination

    borkmann authored herbertx committed
    In commit 0b053c9 ("lib: memzero_explicit: use barrier instead
    of OPTIMIZER_HIDE_VAR"), we made memzero_explicit() more robust in
    case LTO would decide to inline memzero_explicit() and eventually
    find out it could be elimiated as dead store.
    
    While using barrier() works well for the case of gcc, recent efforts
    from LLVMLinux people suggest to use llvm as an alternative to gcc,
    and there, Stephan found in a simple stand-alone user space example
    that llvm could nevertheless optimize and thus elimitate the memset().
    A similar issue has been observed in the referenced llvm bug report,
    which is regarded as not-a-bug.
    
    Based on some experiments, icc is a bit special on its own, while it
    doesn't seem to eliminate the memset(), it could do so with an own
    implementation, and then result in similar findings as with llvm.
    
    The fix in this patch now works for all three compilers (also tested
    with more aggressive optimization levels). Arguably, in the current
    kernel tree it's more of a theoretical issue, but imho, it's better
    to be pedantic about it.
    
    It's clearly visible with gcc/llvm though, with the below code: if we
    would have used barrier() only here, llvm would have omitted clearing,
    not so with barrier_data() variant:
    
      static inline void memzero_explicit(void *s, size_t count)
      {
        memset(s, 0, count);
        barrier_data(s);
      }
    
      int main(void)
      {
        char buff[20];
        memzero_explicit(buff, sizeof(buff));
        return 0;
      }
    
      $ gcc -O2 test.c
      $ gdb a.out
      (gdb) disassemble main
      Dump of assembler code for function main:
       0x0000000000400400  <+0>: lea   -0x28(%rsp),%rax
       0x0000000000400405  <+5>: movq  $0x0,-0x28(%rsp)
       0x000000000040040e <+14>: movq  $0x0,-0x20(%rsp)
       0x0000000000400417 <+23>: movl  $0x0,-0x18(%rsp)
       0x000000000040041f <+31>: xor   %eax,%eax
       0x0000000000400421 <+33>: retq
      End of assembler dump.
    
      $ clang -O2 test.c
      $ gdb a.out
      (gdb) disassemble main
      Dump of assembler code for function main:
       0x00000000004004f0  <+0>: xorps  %xmm0,%xmm0
       0x00000000004004f3  <+3>: movaps %xmm0,-0x18(%rsp)
       0x00000000004004f8  <+8>: movl   $0x0,-0x8(%rsp)
       0x0000000000400500 <+16>: lea    -0x18(%rsp),%rax
       0x0000000000400505 <+21>: xor    %eax,%eax
       0x0000000000400507 <+23>: retq
      End of assembler dump.
    
    As gcc, clang, but also icc defines __GNUC__, it's sufficient to define
    this in compiler-gcc.h only to be picked up. For a fallback or otherwise
    unsupported compiler, we define it as a barrier. Similarly, for ecc which
    does not support gcc inline asm.
    
    Reference: https://llvm.org/bugs/show_bug.cgi?id=15495
    Reported-by: Stephan Mueller <smueller@chronox.de>
    Tested-by: Stephan Mueller <smueller@chronox.de>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Theodore Ts'o <tytso@mit.edu>
    Cc: Stephan Mueller <smueller@chronox.de>
    Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
    Cc: mancha security <mancha1@zoho.com>
    Cc: Mark Charlebois <charlebm@gmail.com>
    Cc: Behan Webster <behanw@converseincode.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  3. Linux 4.1-rc2

    authored
  4. Merge tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/ke…

    authored
    …rnel/git/tytso/ext4
    
    Pull ext4 fixes from Ted Ts'o:
     "Some miscellaneous bug fixes and some final on-disk and ABI changes
      for ext4 encryption which provide better security and performance"
    
    * tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
      ext4: fix growing of tiny filesystems
      ext4: move check under lock scope to close a race.
      ext4: fix data corruption caused by unwritten and delayed extents
      ext4 crypto: remove duplicated encryption mode definitions
      ext4 crypto: do not select from EXT4_FS_ENCRYPTION
      ext4 crypto: add padding to filenames before encrypting
      ext4 crypto: simplify and speed up filename encryption
Something went wrong with that request. Please try again.