1. 23 3月, 2007 33 次提交
  2. 22 3月, 2007 4 次提交
  3. 21 3月, 2007 3 次提交
    • S
      [CRYPTO] tcrypt: Fix error checking for comp allocation · 7bc301e9
      Sebastian Siewior 提交于
      This patch fixes loading the tcrypt module while deflate isn't available
      at all (isn't build).
      Signed-off-by: NSebastian Siewior <linux-crypto@ml.breakpoint.cc>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      7bc301e9
    • J
      [CRYPTO] doc: Fix typo in hash example · 58e40308
      Johannes Schlumberger 提交于
      there is a tiny bug in Documentation/crypto/api-intro.txt.
      The file has the following example code:
      
      struct scatterlist sg[2];
      [...]
      if (crypto_hash_digest(&desc, &sg, 2, result))
      
      which does not match the declaration of crypto_hash_digest() in
      include/linux/crypto.h.
      
      (static inline int crypto_hash_digest(struct hash_desc *desc,
      	struct scatterlist *sg, unsigned int nbytes, u8 *out)
      
      The code in the example passes the address of a pointer (an array actually) as
      the second argument, while the function expects the pointer itself.
      
      I have attached a patch to fix this.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      58e40308
    • J
      [CRYPTO] api: scatterwalk_copychunks() fails to advance through scatterlist · f70ee5ec
      J. Bruce Fields 提交于
      In the loop in scatterwalk_copychunks(), if walk->offset is zero,
      then scatterwalk_pagedone rounds that up to the nearest page boundary:
      
      		walk->offset += PAGE_SIZE - 1;
      		walk->offset &= PAGE_MASK;
      
      which is a no-op in this case, so we don't advance to the next element
      of the scatterlist array:
      
      		if (walk->offset >= walk->sg->offset + walk->sg->length)
      			scatterwalk_start(walk, sg_next(walk->sg));
      
      and we end up copying the same data twice.
      
      It appears that other callers of scatterwalk_{page}done first advance
      walk->offset, so I believe that's the correct thing to do here.
      
      This caused a bug in NFS when run with krb5p security, which would
      cause some writes to fail with permissions errors--for example, writes
      of less than 8 bytes (the des blocksize) at the start of a file.
      
      A git-bisect shows the bug was originally introduced by
      5c64097a, first in 2.6.19-rc1.
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f70ee5ec