Skip to content
  1. Mar 01, 2015
    • Ryusuke Konishi's avatar
      nilfs2: fix potential memory overrun on inode · 957ed60b
      Ryusuke Konishi authored
      
      
      Each inode of nilfs2 stores a root node of a b-tree, and it turned out to
      have a memory overrun issue:
      
      Each b-tree node of nilfs2 stores a set of key-value pairs and the number
      of them (in "bn_nchildren" member of nilfs_btree_node struct), as well as
      a few other "bn_*" members.
      
      Since the value of "bn_nchildren" is used for operations on the key-values
      within the b-tree node, it can cause memory access overrun if a large
      number is incorrectly set to "bn_nchildren".
      
      For instance, nilfs_btree_node_lookup() function determines the range of
      binary search with it, and too large "bn_nchildren" leads
      nilfs_btree_node_get_key() in that function to overrun.
      
      As for intermediate b-tree nodes, this is prevented by a sanity check
      performed when each node is read from a drive, however, no sanity check
      has been done for root nodes stored in inodes.
      
      This patch fixes the issue by adding missing sanity check against b-tree
      root nodes so that it's called when on-memory inodes are read from ifile,
      inode metadata file.
      
      Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      957ed60b
    • Jan Kiszka's avatar
      scripts/gdb: add empty package initialization script · 586a1a12
      Jan Kiszka authored
      
      
      This got lost during the initial merge process: Python requires an
      __init__.py script, even if empty, in order to accept a directory as
      package.  Add it, this time as a non-empty file.
      
      Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      586a1a12
    • Geert Uytterhoeven's avatar
      rtc: ds1685: remove superfluous checks for out-of-range u8 values · 39ea34cc
      Geert Uytterhoeven authored
      
      
      drivers/rtc/rtc-ds1685.c: In function `ds1685_rtc_read_alarm':
      drivers/rtc/rtc-ds1685.c:402: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c:409: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c:416: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c: In function `ds1685_rtc_set_alarm':
      drivers/rtc/rtc-ds1685.c:475: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c:478: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c:481: warning: comparison is always true due to limited range of data type
      
      u8 cannot contain a value larger than 0xff, hence drop the checks.
      Wrapping the checks in unlikely() indicated some sense of humor, though ;-)
      
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarJoshua Kinard <kumba@gentoo.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      39ea34cc
    • Arnd Bergmann's avatar
      rtc: ds1685: fix ds1685_rtc_alarm_irq_enable build error · 682354d4
      Arnd Bergmann authored
      The newly added ds1685 driver causes a build error when enabled without
      CONFIG_RTC_INTF_DEV:
      
        drivers/rtc/rtc-ds1685.c:919:22: error: 'ds1685_rtc_alarm_irq_enable' undeclared here (not in a function)
          .alarm_irq_enable = ds1685_rtc_alarm_irq_enable,
      
      Apparently the driver was incorrectly changed to reflect the interface
      change from 16380c15 ("RTC: Convert rtc drivers to use the
      alarm_irq_enable method"), which removed the respective #ifdef from all
      other rtc drivers.
      
      This does the same change that was merged for the other drivers before and
      removes the #ifdef, allowing the interrupts to be enabled through the
      in-kernel rtc interface independent of the existence of /dev/rtc.
      
      Fixes: aaaf5fbf
      
       ("rtc: add driver for DS1685 family of real time clocks")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarJoshua Kinard <kumba@gentoo.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      682354d4
    • Michal Hocko's avatar
      memcg: fix low limit calculation · 4e54dede
      Michal Hocko authored
      A memcg is considered low limited even when the current usage is equal to
      the low limit.  This leads to interesting side effects e.g.
      groups/hierarchies with no memory accounted are considered protected and
      so the reclaim will emit MEMCG_LOW event when encountering them.
      
      Another and much bigger issue was reported by Joonsoo Kim.  He has hit a
      NULL ptr dereference with the legacy cgroup API which even doesn't have
      low limit exposed.  The limit is 0 by default but the initial check fails
      for memcg with 0 consumption and parent_mem_cgroup() would return NULL if
      use_hierarchy is 0 and so page_counter_read would try to dereference NULL.
      
      I suppose that the current implementation is just an overlook because the
      documentation in Documentation/cgroups/unified-hierarchy.txt says:
      
        "The memory.low boundary on the other hand is a top-down allocated
        reserve.  A cgroup enjoys reclaim protection when it and all its
        ancestors are below their low boundaries"
      
      Fix the usage and the low limit comparision in mem_cgroup_low accordingly.
      
      Fixes: 241994ed
      
       (mm: memcontrol: default hierarchy interface for memory)
      Reported-by: default avatarJoonsoo Kim <js1304@gmail.com>
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4e54dede
    • Joonsoo Kim's avatar
      mm/nommu: fix memory leak · da616534
      Joonsoo Kim authored
      Maxime reported the following memory leak regression due to commit
      dbc8358c ("mm/nommu: use alloc_pages_exact() rather than its own
      implementation").
      
      On v3.19, I am facing a memory leak.  Each time I run a command one page
      is lost.  Here an example with busybox's free command:
      
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1972       5956          0          0        492
        -/+ buffers/cache:       1480       6448
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1976       5952          0          0        492
        -/+ buffers/cache:       1484       6444
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1980       5948          0          0        492
        -/+ buffers/cache:       1488       6440
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1984       5944          0          0        492
        -/+ buffers/cache:       1492       6436
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1988       5940          0          0        492
        -/+ buffers/cache:       1496       6432
      
      At some point, the system fails to sastisfy 256KB allocations:
      
        free: page allocation failure: order:6, mode:0xd0
        CPU: 0 PID: 67 Comm: free Not tainted 3.19.0-05389-gacf2cf1-dirty #64
        Hardware name: STM32 (Device Tree Support)
          show_stack+0xb/0xc
          warn_alloc_failed+0x97/0xbc
          __alloc_pages_nodemask+0x295/0x35c
          __get_free_pages+0xb/0x24
          alloc_pages_exact+0x19/0x24
          do_mmap_pgoff+0x423/0x658
          vm_mmap_pgoff+0x3f/0x4e
          load_flat_file+0x20d/0x4f8
          load_flat_binary+0x3f/0x26c
          search_binary_handler+0x51/0xe4
          do_execveat_common+0x271/0x35c
          do_execve+0x19/0x1c
          ret_fast_syscall+0x1/0x4a
        Mem-info:
        Normal per-cpu:
        CPU    0: hi:    0, btch:   1 usd:   0
        active_anon:0 inactive_anon:0 isolated_anon:0
         active_file:0 inactive_file:0 isolated_file:0
         unevictable:123 dirty:0 writeback:0 unstable:0
         free:1515 slab_reclaimable:17 slab_unreclaimable:139
         mapped:0 shmem:0 pagetables:0 bounce:0
         free_cma:0
        Normal free:6060kB min:352kB low:440kB high:528kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:492kB isolated(anon):0ks
        lowmem_reserve[]: 0 0
        Normal: 23*4kB (U) 22*8kB (U) 24*16kB (U) 23*32kB (U) 23*64kB (U) 23*128kB (U) 1*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 6060kB
        123 total pagecache pages
        2048 pages of RAM
        1538 free pages
        66 reserved pages
        109 slab pages
        -46 pages shared
        0 pages swap cached
        nommu: Allocation of length 221184 from process 67 (free) failed
        Normal per-cpu:
        CPU    0: hi:    0, btch:   1 usd:   0
        active_anon:0 inactive_anon:0 isolated_anon:0
         active_file:0 inactive_file:0 isolated_file:0
         unevictable:123 dirty:0 writeback:0 unstable:0
         free:1515 slab_reclaimable:17 slab_unreclaimable:139
         mapped:0 shmem:0 pagetables:0 bounce:0
         free_cma:0
        Normal free:6060kB min:352kB low:440kB high:528kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:492kB isolated(anon):0ks
        lowmem_reserve[]: 0 0
        Normal: 23*4kB (U) 22*8kB (U) 24*16kB (U) 23*32kB (U) 23*64kB (U) 23*128kB (U) 1*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 6060kB
        123 total pagecache pages
        Unable to allocate RAM for process text/data, errno 12 SEGV
      
      This problem happens because we allocate ordered page through
      __get_free_pages() in do_mmap_private() in some cases and we try to free
      individual pages rather than ordered page in free_page_series().  In
      this case, freeing pages whose refcount is not 0 won't be freed to the
      page allocator so memory leak happens.
      
      To fix the problem, this patch changes __get_free_pages() to
      alloc_pages_exact() since alloc_pages_exact() returns
      physically-contiguous pages but each pages are refcounted.
      
      Fixes: dbc8358c
      
       ("mm/nommu: use alloc_pages_exact() rather than its own implementation").
      Reported-by: default avatarMaxime Coquelin <mcoquelin.stm32@gmail.com>
      Tested-by: default avatarMaxime Coquelin <mcoquelin.stm32@gmail.com>
      Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: <stable@vger.kernel.org>	[3.19]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      da616534
    • Mark Fasheh's avatar
      ocfs2: update web page + git tree in documentation · 01945fa2
      Mark Fasheh authored
      
      
      We (the Ocfs2 project) recently moved the location of our ocfs2-tools
      git tree and project web page.  The pertinent discussion can be seen
      here:
      
        https://oss.oracle.com/pipermail/ocfs2-devel/2015-February/010579.html
      
      The following patch updates the Ocfs2 documentation in MAINTAINERS,
      ocfs2.txt, and dlmfs.txt.  I added our new official web page, changed
      the location of our tools git tree and removed the link to Joel's
      ancient kernel git tree - Andrew has handled our patches for a while
      now.
      
      Signed-off-by: default avatarMark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      01945fa2
  2. Feb 27, 2015
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus-v4.0-rc2' of... · 4f671fe2
      Linus Torvalds authored
      Merge tag 'hwmon-for-linus-v4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fix from Guenter Roeck:
       "Add missing return value check to ads7828 driver"
      
      * tag 'hwmon-for-linus-v4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (ads7828) Check return value of devm_regmap_init_i2c
      4f671fe2
    • Linus Torvalds's avatar
      Merge tag 'sound-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · ed42e71a
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Most of changes in this pull request are about the fixes of crash of
        FireWire drivers at hot-unplugging.  In addition, there are a few
        HD-audio fixes (removal of wrong static, a pin quirk for an ASUS mobo,
        a regression fix for runtime PM on Panther Point) and a long-standing
        (but fairly minor) bug of PCM core"
      
      * tag 'sound-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Disable runtime PM for Panther Point again
        ALSA: hda: controller code - do not export static functions
        ALSA: pcm: Don't leave PREPARED state after draining
        ALSA: fireworks/bebob/dice/oxfw: make it possible to shutdown safely
        ALSA: fireworks/bebob/dice/oxfw: allow stream destructor after releasing runtime
        ALSA: firewire-lib: remove reference counting
        ALSA: fireworks/bebob/dice/oxfw: add reference-counting for FireWire unit
        ALSA: hda - Add pin configs for ASUS mobo with IDT 92HD73XX codec
        ALSA: firewire-lib: fix an unexpected byte sequence for micro sign
      ed42e71a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 7dac5cb1
      Linus Torvalds authored
      Pull btrfs fix from Chris Mason:
       "I'm still testing more fixes, but I wanted to get out the fix for the
        btrfs raid5/6 memory corruption I mentioned in my merge window pull"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix allocation size calculations in alloc_btrfs_bio
      7dac5cb1
  3. Feb 25, 2015
    • Takashi Iwai's avatar
      ALSA: hda - Disable runtime PM for Panther Point again · de5d0ad5
      Takashi Iwai authored
      This is essentially a partial revert of the commit [b1920c21
      
      :
      'ALSA: hda - Enable runtime PM on Panther Point'].  There was a bug
      report showing the HD-audio bus hang during runtime PM on HP Spectre
      XT.
      
      Reported-by: default avatarDang Sananikone <dang.sananikone@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      de5d0ad5
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-4.0-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · b24e2bdd
      Linus Torvalds authored
      Pull xen bugfixes from David Vrabel:
       "Xen regression and bug fixes for 4.0-rc1
      
         - Fix two regressions introduced in 4.0-rc1 affecting PV/PVH guests
           in certain configurations.
      
         - Prevent pvscsi frontends bypassing backend checks.
      
         - Allow privcmd hypercalls to be preempted even on kernel with
           voluntary preemption.  This fixes soft-lockups with long running
           toolstack hypercalls (e.g., when creating/destroying large
           domains)"
      
      * tag 'stable/for-linus-4.0-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        x86/xen: Initialize cr4 shadow for 64-bit PV(H) guests
        xen-scsiback: mark pvscsi frontend request consumed only after last read
        x86/xen: allow privcmd hypercalls to be preempted
        x86/xen: Make sure X2APIC_ENABLE bit of MSR_IA32_APICBASE is not set
      b24e2bdd
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · 84257ce6
      Linus Torvalds authored
      Pull lguest fixes from Rusty Russell:
       "Lguest weird config build fix, and update to the documentation"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
        lguest: update help text.
        lguest: now depends on PCI
      84257ce6
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching · 9ec0de0e
      Linus Torvalds authored
      Pull livepatching fixes from Jiri Kosina:
       "Two tiny fixes for livepatching infrastructure:
      
         - extending RCU critical section to cover all accessess to
           RCU-protected variable, by Petr Mladek
      
         - proper format string passing to kobject_init_and_add(), by Jiri
           Kosina"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching:
        livepatch: RCU protect struct klp_func all the time when used in klp_ftrace_handler()
        livepatch: fix format string in kobject_init_and_add()
      9ec0de0e
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · c4bbb398
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - a few fixes to Sony driver (rmmod breakage, spinlock initialization),
         by Antonio Ospite, Frank Praznik and Jiri Kosina
      
       - fix for wMaxInputLength handling regression in i2c-hid, by Seth
         Forshee
      
       - IRQ safety spinlock fix in sensor hub driver, by Srinivas Pandruvada
      
       - IRQ level sensitivity fix to i2c-hid to be compliant with the spec,
         by Mika Westerberg
      
       - a couple device ID additions piggy-backing on top of that
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        HID: microsoft: Add ID for NE7K wireless keyboard
        HID: i2c-hid: Limit reads to wMaxInputLength bytes for input events
        HID: sony: fix uninitialized per-controller spinlock
        HID: sony: initialize sony_dev_list_lock properly
        HID: sony: Fix a WARNING shown when rmmod-ing the driver
        HID: sensor-hub: correct dyn_callback_lock IRQ-safe change
        HID: hid-sensor-hub: Correct documentation
        HID: saitek: add USB ID for older R.A.T. 7
        HID: i2c-hid: The interrupt should be level sensitive
        HID: wacom: Add missing ABS_MISC event and feature declaration for 27QHD
      c4bbb398
  4. Feb 24, 2015
  5. Feb 23, 2015