mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-20 02:34:23 +08:00
fb43f69401
Scatter gather lists can be created with more available entries than are
actually used (e.g. using sg_init_table() to reserve a specific number
of sg entries, but in actuality using something less than that based on
the data length). The caller sometimes fails to mark the last entry
with sg_mark_end(). In these cases, sg_nents() will return the original
size of the sg list as opposed to the actual number of sg entries that
contain valid data.
On arm64, if the sg_nents() value is used in a call to dma_map_sg() in
this situation, then it causes a BUG_ON in lib/swiotlb.c because an
"empty" sg list entry results in dma_capable() returning false and
swiotlb trying to create a bounce buffer of size 0. This occurred in
the userspace crypto interface before being fixed by
|
||
---|---|---|
.. | ||
ccp-crypto-aes-cmac.c | ||
ccp-crypto-aes-xts.c | ||
ccp-crypto-aes.c | ||
ccp-crypto-main.c | ||
ccp-crypto-sha.c | ||
ccp-crypto.h | ||
ccp-dev.c | ||
ccp-dev.h | ||
ccp-ops.c | ||
ccp-pci.c | ||
ccp-platform.c | ||
Kconfig | ||
Makefile |