1. 03 Feb, 2012 6 commits
    • Tyler Hicks's avatar
      eCryptfs: Check inode changes in setattr · 963f5080
      Tyler Hicks authored
      commit a261a039 upstream.
      
      Most filesystems call inode_change_ok() very early in ->setattr(), but
      eCryptfs didn't call it at all. It allowed the lower filesystem to make
      the call in its ->setattr() function. Then, eCryptfs would copy the
      appropriate inode attributes from the lower inode to the eCryptfs inode.
      
      This patch changes that and actually calls inode_change_ok() on the
      eCryptfs inode, fairly early in ecryptfs_setattr(). Ideally, the call
      would happen earlier in ecryptfs_setattr(), but there are some possible
      inode initialization steps that must happen first.
      
      Since the call was already being made on the lower inode, the change in
      functionality should be minimal, except for the case of a file extending
      truncate call. In that case, inode_newsize_ok() was never being
      called on the eCryptfs inode. Rather than inode_newsize_ok() catching
      maximum file size errors early on, eCryptfs would encrypt zeroed pages
      and write them to the lower filesystem until the lower filesystem's
      write path caught the error in generic_write_checks(). This patch
      introduces a new function, called ecryptfs_inode_newsize_ok(), which
      checks if the new lower file size is within the appropriate limits when
      the truncate operation will be growing the lower file.
      
      In summary this change prevents eCryptfs truncate operations (and the
      resulting page encryptions), which would exceed the lower filesystem
      limits or FSIZE rlimits, from ever starting.
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      Reviewed-by: default avatarLi Wang <liwang@nudt.edu.cn>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      963f5080
    • Tyler Hicks's avatar
      eCryptfs: Make truncate path killable · ccc10d45
      Tyler Hicks authored
      commit 5e6f0d76 upstream.
      
      ecryptfs_write() handles the truncation of eCryptfs inodes. It grabs a
      page, zeroes out the appropriate portions, and then encrypts the page
      before writing it to the lower filesystem. It was unkillable and due to
      the lack of sparse file support could result in tying up a large portion
      of system resources, while encrypting pages of zeros, with no way for
      the truncate operation to be stopped from userspace.
      
      This patch adds the ability for ecryptfs_write() to detect a pending
      fatal signal and return as gracefully as possible. The intent is to
      leave the lower file in a useable state, while still allowing a user to
      break out of the encryption loop. If a pending fatal signal is detected,
      the eCryptfs inode size is updated to reflect the modified inode size
      and then -EINTR is returned.
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ccc10d45
    • Tim Gardner's avatar
      ecryptfs: Improve metadata read failure logging · 75d26d30
      Tim Gardner authored
      commit 30373dc0 upstream.
      
      Print inode on metadata read failure. The only real
      way of dealing with metadata read failures is to delete
      the underlying file system file. Having the inode
      allows one to 'find . -inum INODE`.
      
      [tyhicks@canonical.com: Removed some minor not-for-stable parts]
      Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      75d26d30
    • Tyler Hicks's avatar
      eCryptfs: Sanitize write counts of /dev/ecryptfs · 2f46e90c
      Tyler Hicks authored
      commit db10e556 upstream.
      
      A malicious count value specified when writing to /dev/ecryptfs may
      result in a a very large kernel memory allocation.
      
      This patch peeks at the specified packet payload size, adds that to the
      size of the packet headers and compares the result with the write count
      value. The resulting maximum memory allocation size is approximately 532
      bytes.
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      Reported-by: default avatarSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2f46e90c
    • Takashi Iwai's avatar
      ALSA: hda - Fix silent outputs from docking-station jacks of Dell laptops · d8643c8e
      Takashi Iwai authored
      commit b4ead019 upstream.
      
      The recent change of the power-widget handling for IDT codecs caused
      the silent output from the docking-station line-out jack.  This was
      partially fixed by the commit f2cbba76
      "ALSA: hda - Fix the lost power-setup of seconary pins after PM resume".
      But the line-out on the docking-station is still silent when booted
      with the jack plugged even by this fix.
      
      The remainig bug is that the power-widget is set off in stac92xx_init()
      because the pins in cfg->line_out_pins[] aren't checked there properly
      but only hp_pins[] are checked in is_nid_hp_pin().
      
      This patch fixes the problem by checking both HP and line-out pins
      and leaving the power-map correctly.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42637Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d8643c8e
    • Takashi Iwai's avatar
      ALSA: hda - Fix buffer-alignment regression with Nvidia HDMI · f0e6e77b
      Takashi Iwai authored
      commit 52409aa6 upstream.
      
      The commit 2ae66c26
          ALSA: hda: option to enable arbitrary buffer/period sizes
      introduced a regression on machines with Intel controller and Nvidia
      HDMI.  The reason is that the driver modifies the global variable
      align_buffer_size when an Intel controller is found, and the Nvidia
      HDMI controller is probed after Intel although Nvidia chips require
      the aligned buffers.
      
      This patch fixes the problem by moving the flag into the local struct
      so that it's not affected by other controllers.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42567Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f0e6e77b
  2. 26 Jan, 2012 34 commits