1. 11 May, 2009 2 commits
    • Jeff Mahoney's avatar
      dup2: Fix return value with oldfd == newfd and invalid fd · 2b79bc4f
      Jeff Mahoney authored
      The return value of dup2 when oldfd == newfd and the fd isn't valid is
      not getting properly sign extended.  We end up with 4294967287 instead
      of -EBADF.
      
      I've reproduced this on SLE11 (2.6.27.21), openSUSE Factory
      (2.6.29-rc5), and Ubuntu 9.04 (2.6.28).
      
      This patch uses a signed int for the error value so it is properly
      extended.
      
      Commit 6c5d0512 introduced this
      regression.
      Reported-by: default avatarJiri Dluhos <jdluhos@novell.com>
      Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2b79bc4f
    • David Woodhouse's avatar
      intel-iommu: PAE memory corruption fix · fd18de50
      David Woodhouse authored
      PAGE_MASK is 0xFFFFF000 on i386 -- even with PAE.
      
      So it's not sufficient to ensure that you use phys_addr_t or uint64_t
      everywhere you handle physical addresses -- you also have to avoid using
      the construct 'addr & PAGE_MASK', because that will strip the high 32
      bits of the address.
      
      This patch avoids that problem by using PHYSICAL_PAGE_MASK instead of
      PAGE_MASK where appropriate. It leaves '& PAGE_MASK' in a few instances
      that don't matter -- where it's being used on the virtual bus addresses
      we're dishing out, which are 32-bit anyway.
      
      Since PHYSICAL_PAGE_MASK is not present on other architectures, we have
      to define it (to PAGE_MASK) if it's not already defined.
      
      Maybe it would be better just to fix PAGE_MASK for i386/PAE?
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fd18de50
  2. 10 May, 2009 12 commits
  3. 09 May, 2009 26 commits