android_kernel_samsung_a7y1.../lib
Linus Torvalds cdceeb74f2 Partially revert "kfifo: fix kfifo_alloc() and kfifo_init()"
[ Upstream commit ab9bb6318b0967671e0c9b6537c1537d51ca4f45 ]

Commit dfe2a77fd243 ("kfifo: fix kfifo_alloc() and kfifo_init()") made
the kfifo code round the number of elements up.  That was good for
__kfifo_alloc(), but it's actually wrong for __kfifo_init().

The difference? __kfifo_alloc() will allocate the rounded-up number of
elements, but __kfifo_init() uses an allocation done by the caller.  We
can't just say "use more elements than the caller allocated", and have
to round down.

The good news? All the normal cases will be using power-of-two arrays
anyway, and most users of kfifo's don't use kfifo_init() at all, but one
of the helper macros to declare a KFIFO that enforce the proper
power-of-two behavior.  But it looks like at least ibmvscsis might be
affected.

The bad news? Will Deacon refers to an old thread and points points out
that the memory ordering in kfifo's is questionable.  See

  https://lore.kernel.org/lkml/20181211034032.32338-1-yuleixzhang@tencent.com/

for more.

Fixes: dfe2a77fd243 ("kfifo: fix kfifo_alloc() and kfifo_init()")
Reported-by: laokz <laokz@foxmail.com>
Cc: Stefani Seibold <stefani@seibold.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Greg KH <greg@kroah.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 13:43:03 +02:00
..
842 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fonts A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lz4 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lzo A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mpi lib/mpi: Fix karactx leak in mpi_powm 2020-04-06 19:21:06 +02:00
raid6 lib: raid6: fix awk build warnings 2020-04-07 13:07:01 +02:00
reed_solomon rslib: Fix handling of of caller provided syndrome 2020-04-06 19:55:29 +02:00
xz A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
zlib_deflate A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
zlib_inflate A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
zstd A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
argv_split.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
asn1_decoder.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
assoc_array.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
atomic64_test.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
atomic64.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
audit.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bch.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bitmap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bitrev.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bsearch.c kprobes: Prohibit probing on bsearch() 2020-04-06 14:51:19 +02:00
btree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
build_OID_registry A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bust_spinlocks.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
check_signature.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
checksum.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
clz_ctz.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
clz_tab.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cmdline.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compat_audit.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cordic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpu_rmap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpu-notifier-error-inject.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpumask.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crc-ccitt.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crc-itu-t.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crc-t10dif.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crc7.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crc8.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crc16.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crc32.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crc32defs.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ctype.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debug_info.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debug_locks.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debugobjects.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dec_and_lock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
decompress_bunzip2.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
decompress_inflate.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
decompress_unlz4.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
decompress_unlzma.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
decompress_unlzo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
decompress_unxz.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
decompress.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
devres.c devres: allow const resource arguments 2020-04-07 13:42:28 +02:00
digsig.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
div64.c lib/div64.c: off by one in shift 2020-04-06 15:20:42 +02:00
dma-debug.c dma-debug: add a schedule point in debug_dma_dump_mappings() 2020-04-07 13:22:54 +02:00
dump_stack.c dump_stack: avoid the livelock of the dump_lock 2020-04-07 11:48:34 +02:00
dynamic_debug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dynamic_queue_limits.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
earlycpio.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extable.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fault-inject.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fdt_empty_tree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fdt_ro.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fdt_rw.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fdt_strerror.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fdt_sw.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fdt_wip.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fdt.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
find_bit.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
flex_array.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
flex_proportions.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gcd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gen_crc32table.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
genalloc.c lib/genalloc.c: include vmalloc.h 2020-04-07 12:42:44 +02:00
glob.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
halfmd4.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hexdump.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hweight.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
idr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inflate.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
int_sqrt.c lib/int_sqrt: optimize initial value compute 2020-04-06 13:43:46 +02:00
interval_tree_test.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
interval_tree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iomap_copy.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iomap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iommu-common.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iommu-helper.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ioremap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iov_iter.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
irq_regs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
is_single_threaded.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
jedec_ddr_data.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kasprintf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.debug kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K 2020-04-07 07:55:16 +02:00
Kconfig.kasan A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.kgdb A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.kmemcheck A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kfifo.c Partially revert "kfifo: fix kfifo_alloc() and kfifo_init()" 2020-04-07 13:43:03 +02:00
klist.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kobject_uevent.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kobject.c kobject: Export kobject_get_unless_zero() 2020-04-07 13:29:27 +02:00
kstrtox.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kstrtox.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lcm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
libcrc32c.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
list_debug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
list_sort.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
llist.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-hardirq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-mutex.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-rlock-hardirq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-rlock-softirq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-rlock.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-rsem.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-softirq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-spin-hardirq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-spin-softirq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-spin.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-wlock-hardirq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-wlock-softirq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-wlock.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest-wsem.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking-selftest.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lockref.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lru_cache.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile siphash: add cryptographically secure PRF 2020-04-06 21:32:41 +02:00
md5.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
memory-notifier-error-inject.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
memweight.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net_utils.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nlattr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nmi_backtrace.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
notifier-error-inject.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
notifier-error-inject.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
of-reconfig-notifier-error-inject.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
oid_registry.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
once.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
parser.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci_iomap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
percpu_counter.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
percpu_ida.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
percpu_test.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
percpu-refcount.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
plist.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pm-notifier-error-inject.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proportions.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
radix-tree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
random32.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ratelimit.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rational.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rbtree_test.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rbtree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
reciprocal_div.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rhashtable.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scatterlist.c lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE 2020-04-06 20:04:15 +02:00
seq_buf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sg_split.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sha1.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
show_mem.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
siphash.c siphash: implement HalfSipHash1-3 for hash tables 2020-04-06 21:32:43 +02:00
smp_processor_id.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sort.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stackdepot.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stmp_device.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
string_helpers.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
string.c lib/string.c: implement a basic bcmp 2020-04-06 15:07:18 +02:00
strncpy_from_user.c mm/uaccess: Use 'unsigned long' to placate UBSAN warnings on older GCC versions 2020-04-06 18:18:29 +02:00
strnlen_user.c mm/uaccess: Use 'unsigned long' to placate UBSAN warnings on older GCC versions 2020-04-06 18:18:29 +02:00
swiotlb.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
syscall.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_bpf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_firmware.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_kasan.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_module.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_printf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_rhashtable.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_siphash.c siphash: implement HalfSipHash1-3 for hash tables 2020-04-06 21:32:43 +02:00
test_static_key_base.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_static_keys.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test_user_copy.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test-hexdump.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test-kstrtox.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
test-string_helpers.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
textsearch.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
timerqueue.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ts_bm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ts_fsm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ts_kmp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ucs2_string.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usercopy.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
uuid.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vsprintf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xxhash.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30