android_kernel_xiaomi_sm8350/crypto
J. Bruce Fields f70ee5ec8f [CRYPTO] api: scatterwalk_copychunks() fails to advance through scatterlist
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
5c64097aa0, first in 2.6.19-rc1.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2007-03-21 08:50:12 +11:00
..
aes.c
algapi.c [CRYPTO] api: Allow multiple frontends per backend 2007-02-07 09:21:01 +11:00
anubis.c
api.c [CRYPTO] api: Allow multiple frontends per backend 2007-02-07 09:21:01 +11:00
arc4.c
blkcipher.c [CRYPTO] api: Allow multiple frontends per backend 2007-02-07 09:21:01 +11:00
blowfish.c
camellia.c [CRYPTO] camellia: added the code of Camellia cipher algorithm. 2007-02-07 09:21:03 +11:00
cast5.c
cast6.c
cbc.c [CRYPTO] api: Add type-safe spawns 2007-02-07 09:21:01 +11:00
cipher.c [CRYPTO] api: Remove deprecated interface 2007-02-07 09:21:00 +11:00
compress.c [CRYPTO] api: Remove deprecated interface 2007-02-07 09:21:00 +11:00
crc32c.c
crypto_null.c
cryptomgr.c
deflate.c
des.c
digest.c [CRYPTO] api: Remove deprecated interface 2007-02-07 09:21:00 +11:00
ecb.c [CRYPTO] api: Add type-safe spawns 2007-02-07 09:21:01 +11:00
fcrypt.c [CRYPTO] fcrypt: Add FCrypt from RxRPC 2007-02-07 09:20:59 +11:00
gf128mul.c
hash.c [CRYPTO] api: Allow multiple frontends per backend 2007-02-07 09:21:01 +11:00
hmac.c [CRYPTO] api: Add type-safe spawns 2007-02-07 09:21:01 +11:00
internal.h [CRYPTO] api: Allow multiple frontends per backend 2007-02-07 09:21:01 +11:00
Kconfig Merge branch 'HEAD' of master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6 2007-02-08 15:25:18 -08:00
khazad.c
lrw.c [CRYPTO] api: Add type-safe spawns 2007-02-07 09:21:01 +11:00
Makefile [CRYPTO] camellia: added the code of Camellia cipher algorithm. 2007-02-07 09:21:03 +11:00
md4.c
md5.c
michael_mic.c
pcbc.c [CRYPTO] api: Add type-safe spawns 2007-02-07 09:21:01 +11:00
proc.c [PATCH] mark struct file_operations const 3 2007-02-12 09:48:45 -08:00
scatterwalk.c [CRYPTO] api: scatterwalk_copychunks() fails to advance through scatterlist 2007-03-21 08:50:12 +11:00
scatterwalk.h
serpent.c
sha1.c
sha256.c
sha512.c
tcrypt.c [CRYPTO] camellia: added the testing code of Camellia cipher 2007-02-07 09:21:04 +11:00
tcrypt.h [CRYPTO] camellia: added the testing code of Camellia cipher 2007-02-07 09:21:04 +11:00
tea.c
tgr192.c
twofish_common.c
twofish.c
wp512.c
xcbc.c [CRYPTO] xcbc: Use new cipher interface 2007-02-07 09:21:01 +11:00