android_kernel_xiaomi_sdm845/lib
Andrew Morton 5b019e9901 lib/idr.c: use kmem_cache_zalloc() for the idr_layer cache
David points out that the idr_remove_all() function returns unused slabs
to the kmem cache, but needs to zero them first or else they will be
uninitialized upon next use.  This causes crashes which have been observed
in the firewire subsystem.

He fixed this by zeroing the object before freeing it in idr_remove_all().

But we agree that simply removing the constructor and zeroing the object
at allocation time is simpler than relying upon slab constructor machinery
and might even be faster.

This problem was introduced by "idr: make idr_remove rcu-safe" (commit
cf481c20c4), which was first released in
2.6.27.

There are no known codesites which trigger this bug in 2.6.27 or 2.6.28.
The post-2.6.28 firewire changes are the only known triggerer.

There might of course be not-yet-discovered triggerers in 2.6.27 and
2.6.28, and there might be out-of-tree triggerers which are added to those
kernel versions.  I'll let the -stable guys decide whether they want to
backport this fix.

Reported-by: David Moore <dcm@acm.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Nadia Derbey <Nadia.Derbey@bull.net>
Cc: Paul E. McKenney <paulmck@us.ibm.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Kristian Hgsberg <krh@redhat.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15 16:39:40 -08:00
..
lzo
reed_solomon
zlib_deflate
zlib_inflate
.gitignore
argv_split.c
audit.c
bcd.c
bitmap.c Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb 2008-10-23 08:20:34 -07:00
bitrev.c
bug.c allow bug table entries to use relative pointers (and use it on x86-64) 2008-12-16 18:40:32 +01:00
bust_spinlocks.c oops handling: ensure that any oops is flushed to the mtdoops console 2009-01-06 15:59:11 -08:00
check_signature.c
cmdline.c
cpumask.c cpumask: zero extra bits in alloc_cpumask_var_node 2009-01-01 10:12:30 +10:30
crc7.c
crc16.c
crc32.c
crc32defs.h
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
ctype.c
debug_locks.c
debugobjects.c debugobjects: add boot parameter default value 2008-11-26 10:07:06 +01:00
dec_and_lock.c
devres.c
div64.c
dump_stack.c
dynamic_printk.c dynamic_printk: reduce one level of indentation 2009-01-06 10:44:32 -08:00
extable.c
fault-inject.c Remove remaining unwinder code 2009-01-06 15:59:11 -08:00
find_last_bit.c bitmap: find_last_bit() 2009-01-01 10:12:19 +10:30
find_next_bit.c
gen_crc32table.c
genalloc.c
halfmd4.c
hexdump.c
hweight.c
idr.c lib/idr.c: use kmem_cache_zalloc() for the idr_layer cache 2009-01-15 16:39:40 -08:00
inflate.c
int_sqrt.c
iomap_copy.c
iomap.c
iommu-helper.c
ioremap.c
irq_regs.c
is_single_threaded.c CRED: Rename is_single_threaded() to is_wq_single_threaded() 2008-11-14 10:39:21 +11:00
kasprintf.c
Kconfig Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-02 11:44:09 -08:00
Kconfig.debug Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-10 06:13:09 -08:00
Kconfig.kgdb
kernel_lock.c
klist.c driver core: Remove completion from struct klist_node 2009-01-06 10:44:30 -08:00
kobject_uevent.c kobject: return the result of uevent sending by netlink 2009-01-06 10:44:31 -08:00
kobject.c
kref.c
libcrc32c.c libcrc32c: Fix "crc32c undefined" compilation error 2008-12-25 11:01:42 +11:00
list_debug.c
lmb.c
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c
Makefile bitmap: find_last_bit() 2009-01-01 10:12:19 +10:30
parser.c
percpu_counter.c Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-06 17:10:04 -08:00
plist.c
prio_heap.c lib: fix sparse shadowed variable warning 2009-01-06 15:59:11 -08:00
prio_tree.c
proportions.c Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-06 17:10:04 -08:00
radix-tree.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-01-07 11:31:52 -08:00
random32.c
ratelimit.c
rbtree.c rbtree: add const qualifier to some functions 2009-01-10 06:04:33 -08:00
reciprocal_div.c
rwsem-spinlock.c
rwsem.c
scatterlist.c lib/scatterlist.c: fix kunmap() argument in sg_miter_stop() 2008-11-19 18:49:58 -08:00
sha1.c
show_mem.c
smp_processor_id.c
sort.c generic swap(): lib/sort.c: rename swap to swap_func 2009-01-08 08:31:14 -08:00
spinlock_debug.c
string_helpers.c [SCSI] lib: string_get_size(): don't hang on zero; no decimals on exact 2008-10-23 11:42:20 -05:00
string.c
swiotlb.c Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-06 17:10:04 -08:00
syscall.c
textsearch.c
ts_bm.c
ts_fsm.c
ts_kmp.c
vsprintf.c strict_strto* is not strict enough 2009-01-06 15:59:12 -08:00