1. 01 Dec, 2010 2 commits
    • Oleg Nesterov's avatar
      exec: copy-and-paste the fixes into compat_do_execve() paths · 114279be
      Oleg Nesterov authored
      Note: this patch targets 2.6.37 and tries to be as simple as possible.
      That is why it adds more copy-and-paste horror into fs/compat.c and
      uglifies fs/exec.c, this will be cleanuped later.
      
      compat_copy_strings() plays with bprm->vma/mm directly and thus has
      two problems: it lacks the RLIMIT_STACK check and argv/envp memory
      is not visible to oom killer.
      
      Export acct_arg_size() and get_arg_page(), change compat_copy_strings()
      to use get_arg_page(), change compat_do_execve() to do acct_arg_size(0)
      as do_execve() does.
      
      Add the fatal_signal_pending/cond_resched checks into compat_count() and
      compat_copy_strings(), this matches the code in fs/exec.c and certainly
      makes sense.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      114279be
    • Oleg Nesterov's avatar
      exec: make argv/envp memory visible to oom-killer · 3c77f845
      Oleg Nesterov authored
      Brad Spengler published a local memory-allocation DoS that
      evades the OOM-killer (though not the virtual memory RLIMIT):
      http://www.grsecurity.net/~spender/64bit_dos.c
      
      execve()->copy_strings() can allocate a lot of memory, but
      this is not visible to oom-killer, nobody can see the nascent
      bprm->mm and take it into account.
      
      With this patch get_arg_page() increments current's MM_ANONPAGES
      counter every time we allocate the new page for argv/envp. When
      do_execve() succeds or fails, we change this counter back.
      
      Technically this is not 100% correct, we can't know if the new
      page is swapped out and turn MM_ANONPAGES into MM_SWAPENTS, but
      I don't think this really matters and everything becomes correct
      once exec changes ->mm or fails.
      Reported-by: default avatarBrad Spengler <spender@grsecurity.net>
      Reviewed-and-discussed-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3c77f845
  2. 30 Nov, 2010 3 commits
  3. 29 Nov, 2010 18 commits
  4. 28 Nov, 2010 15 commits
  5. 27 Nov, 2010 2 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 · 0f639a3c
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (30 commits)
        ALSA: hda - Use ALC_INIT_DEFAULT for really default initialization
        ASoC: Fix resource reclaim for osk5912
        ASoC: tlv320aic3x - fix variable may be used uninitialized warning
        ASoC: davinci-vcif - fix a memory leak
        ASoC: phycore-ac97: fix resource leak
        ASoC: imx-ssi: fix resource leak
        ASoC: simone: fix resource leak in simone_init error path
        ASoC: sam9g20_wm8731: fix resource leak in at91sam9g20ek_init error path
        ASoC: snd-soc-afeb9260: remove unneeded platform_device_del in error path
        ASoC: pcm030-audio-fabric: fix resource leak in pcm030_fabric_init error path
        ASoC: efika-audio-fabric: fix resource leak in efika_fabric_init error path
        ASoC: Call snd_soc_unregister_dais instead of snd_soc_unregister_dai in sh4_soc_dai_remove
        ASoC: fix SND_PXA2XX_LIB Kconfig warning
        ALSA: hda - Fix ALC660-VD/ALC861-VD capture/playback mixers
        ALSA: HDA: Add an extra DAC for Realtek ALC887-VD
        ASoC: nuc900-ac97: fix a memory leak
        ASoC: Return proper error for omap3pandora_soc_init
        ASoC: wm8961 - clear WM8961_MCLKDIV bit for freq <= 16500000
        ASoC: wm8961 - clear WM8961_DACSLOPE bit for normal mode
        ALSA: hda - Fix Acer 7730G support
        ...
      0f639a3c
    • Josef Bacik's avatar
      Btrfs: setup blank root and fs_info for mount time · 450ba0ea
      Josef Bacik authored
      There is a problem with how we use sget, it searches through the list of supers
      attached to the fs_type looking for a super with the same fs_devices as what
      we're trying to mount.  This depends on sb->s_fs_info being filled, but we don't
      fill that in until we get to btrfs_fill_super, so we could hit supers on the
      fs_type super list that have a null s_fs_info.  In order to fix that we need to
      go ahead and setup a blank root with a blank fs_info to hold fs_devices, that
      way our test will work out right and then we can set s_fs_info in
      btrfs_set_super, and then open_ctree will simply use our pre-allocated root and
      fs_info when setting everything up.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      450ba0ea