1. 27 5月, 2012 1 次提交
    • L
      x86: use generic strncpy_from_user routine · 4ae73f2d
      Linus Torvalds 提交于
      The generic strncpy_from_user() is not really optimal, since it is
      designed to work on both little-endian and big-endian.  And on
      little-endian you can simplify much of the logic to find the first zero
      byte, since little-endian arithmetic doesn't have to worry about the
      carry bit propagating into earlier bytes (only later bytes, which we
      don't care about).
      
      But I have patches to make the generic routines use the architecture-
      specific <asm/word-at-a-time.h> infrastructure, so that we can regain
      the little-endian optimizations.  But before we do that, switch over to
      the generic routines to make the patches each do just one well-defined
      thing.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4ae73f2d
  2. 25 5月, 2012 8 次提交
  3. 24 5月, 2012 3 次提交
    • H
      x86, relocs: Add jiffies and jiffies_64 to the relative whitelist · ea17e741
      H. Peter Anvin 提交于
      The symbol jiffies is created in the linker script as an alias to
      jiffies_64.  Unfortunately this is done outside any section, and
      apparently GNU ld 2.21 doesn't carry the section with it, so we end up
      with an absolute symbol and therefore a broken kernel.
      
      Add jiffies and jiffies_64 to the whitelist.
      
      The most disturbing bit with this discovery is that it shows that we
      have had multiple linker bugs in this area crossing multiple
      generations, and have been silently building bad kernels for some time.
      
      Link: http://lkml.kernel.org/r/20120524171604.0d98284f3affc643e9714470@canb.auug.org.auReported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: <stable@vger.kernel.org> v3.4
      ea17e741
    • D
      sparc: Optimize strncpy_from_user() zero byte search. · 4efcac3a
      David S. Miller 提交于
      Compute a mask that will only have 0x80 in the bytes which
      had a zero in them.  The formula is:
      
      	~(((x & 0x7f7f7f7f) + 0x7f7f7f7f) | x | 0x7f7f7f7f)
      
      In the inner word iteration, we have to compute the "x | 0x7f7f7f7f"
      part, so we can reuse that in the above calculation.
      
      Once we have this mask, we perform divide and conquer to find the
      highest 0x80 location.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4efcac3a
    • H
      x86-32, relocs: Whitelist more symbols for ld bug workaround · fd952815
      H. Peter Anvin 提交于
      As noted in checkin:
      
      a3e854d9 x86, relocs: Workaround for binutils 2.22.52.0.1 section bug
      
      ld version 2.22.52.0.[12] can incorrectly promote relative symbols to
      absolute, if the output section they appear in is otherwise empty.
      
      Since checkin:
      
      6520fe55 x86, realmode: 16-bit real-mode code support for relocs tool
      
      we actually check for this and error out rather than silently creating
      a kernel which will malfunction if relocated.
      
      Ingo found a configuration in which __start_builtin_fw triggered the
      warning.
      
      Go through the linker script sources and look for more symbols that
      could plausibly get bogusly promoted to absolute, and add them to the
      whitelist.
      
      In general, if the following error triggers:
      
      	Invalid absolute R_386_32 relocation: <symbol>
      
      ... then we should verify that <symbol> is really meant to be
      relocated, and add it and any related symbols manually to the S_REL
      regexp.
      
      Please note that 6520fe55 does not introduce the error, only the check
      for the error -- without 6520fe55 this version of ld will simply
      produce a corrupt kernel if CONFIG_RELOCATABLE is set on x86-32.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: <stable@vger.kernel.org> v3.4
      fd952815
  4. 23 5月, 2012 7 次提交
  5. 22 5月, 2012 21 次提交