android_kernel_samsung_msm8976/lib
Stanislaw Gruszka a1da08993f lib/div64.c: off by one in shift
commit cdc94a37493135e355dfc0b0e086d84e3eadb50d upstream.

fls counts bits starting from 1 to 32 (returns 0 for zero argument).  If
we add 1 we shift right one bit more and loose precision from divisor,
what cause function incorect results with some numbers.

Corrected code was tested in user-space, see bugzilla:
   https://bugzilla.kernel.org/show_bug.cgi?id=202391

Link: http://lkml.kernel.org/r/1548686944-11891-1-git-send-email-sgruszka@redhat.com
Fixes: 658716d19f ("div64_u64(): improve precision on 32bit platforms")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reported-by: Siarhei Volkau <lis8215@gmail.com>
Tested-by: Siarhei Volkau <lis8215@gmail.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 22:11:26 +02:00
..
lz4 lz4: fix another possible overrun 2016-05-18 14:34:38 +05:30
lzo lzo: check for length overrun in variable length encoding. 2014-10-30 09:35:11 -07:00
mpi Import latest Samsung release 2017-04-18 03:43:52 +02:00
raid6
reed_solomon
xz
zlib_deflate
zlib_inflate
.gitignore X.509: Implement simple static OID registry 2012-10-08 13:50:18 +10:30
Kconfig lib: add lz4 compressor module 2015-09-16 18:20:12 +05:30
Kconfig.debug mm,vmacache: add debug data 2019-07-27 22:08:07 +02:00
Kconfig.kasan kasan: enable instrumentation of global variables 2015-05-04 14:03:57 -07:00
Kconfig.kgdb KGDB/KDB fixes and cleanups 2013-03-02 08:31:39 -08:00
Kconfig.kmemcheck kmemcheck: depend on HAVE_ARCH_KMEMCHECK 2009-07-01 22:28:44 +02:00
Makefile lib: add lz4 compressor module 2015-09-16 18:20:12 +05:30
argv_split.c
asn1_decoder.c BACKPORT: ASN.1: fix out-of-bounds read when parsing indefinite length item 2019-07-27 21:50:02 +02:00
atomic64.c
atomic64_test.c atomic64_test: simplify the #ifdef for atomic64_dec_if_positive() test 2012-07-30 17:25:16 -07:00
audit.c audit: support the "standard" <asm-generic/unistd.h> 2011-05-04 14:41:28 -04:00
average.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
bcd.c
bch.c lib: add shared BCH ECC library 2011-03-11 14:25:50 +00:00
bitmap.c Merge remote-tracking branch 'f2fs/linux-3.10.y' into HEAD 2017-04-18 17:02:28 +02:00
bitrev.c
bsearch.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
btree.c lib/btree.c: fix leak of whole btree nodes 2014-08-07 14:30:27 -07:00
bug.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
build_OID_registry X.509: Implement simple static OID registry 2012-10-08 13:50:18 +10:30
bust_spinlocks.c
check_signature.c
checksum.c lib/checksum.c: fix build for generic csum_tcpudp_nofold 2015-02-11 14:48:17 +08:00
clz_tab.c
cmdline.c lib/cmdline.c: fix get_options() overflow while parsing ranges 2019-07-27 21:44:24 +02:00
cordic.c
cpu-notifier-error-inject.c
cpu_rmap.c irq: Allow multiple clients to register for irq affinity notification 2014-11-09 15:17:27 -08:00
cpumask.c sched/fair, cpumask: Export for_each_cpu_wrap() 2019-07-27 21:44:52 +02:00
crc-ccitt.c [PATCH] kernel-doc for lib/crc*.c 2006-06-25 10:01:20 -07:00
crc-itu-t.c CRC ITU-T V.41 2007-05-10 18:24:13 +02:00
crc-t10dif.c [SCSI] lib: Add support for the T10 (SCSI) Data Integrity Field CRC 2008-07-12 08:22:32 -05:00
crc7.c
crc8.c
crc16.c
crc32.c sections: fix const sections for crc32 table 2012-10-06 03:04:46 +09:00
crc32defs.h crc32: select an algorithm via Kconfig 2012-03-23 16:58:38 -07:00
ctype.c
debug_locks.c
debugobjects.c debugobjects: use kmemleak_not_leak for obj_cache 2015-05-29 19:35:14 +05:30
dec_and_lock.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
decompress.c lib/decompress.c: fix initconst 2013-04-30 17:04:09 -07:00
decompress_bunzip2.c decompress_bunzip2: off by one in get_next_block() 2015-01-27 07:52:33 -08:00
decompress_inflate.c
decompress_unlzma.c treewide: Fix comment and string typo 'bufer' 2011-12-06 09:53:40 +01:00
decompress_unlzo.c
decompress_unxz.c Fix common misspellings 2011-03-31 11:26:23 -03:00
devres.c devres: always use dev_name() in devm_ioremap_resource() 2019-07-27 22:11:19 +02:00
digsig.c lib/digsig: fix dereference of NULL user_key_payload 2019-07-27 21:44:22 +02:00
div64.c lib/div64.c: off by one in shift 2019-07-27 22:11:26 +02:00
dma-debug.c dma-debug: switch check from _text to _stext 2016-02-25 11:57:49 -08:00
dump_stack.c
dynamic_debug.c dynamic_debug: Handle kstrdup failure in dynamic_debug_init 2015-06-20 18:25:48 -07:00
dynamic_queue_limits.c
earlycpio.c lib: Add early cpio decoder 2012-09-30 18:02:20 -07:00
extable.c module: trim exception table on init free. 2009-06-12 21:47:04 +09:30
fault-inject.c
fdt.c
fdt_ro.c
fdt_rw.c of/lib: Allow scripts/dtc/libfdt to be used from kernel code 2012-07-23 13:54:52 +01:00
fdt_strerror.c of/lib: Allow scripts/dtc/libfdt to be used from kernel code 2012-07-23 13:54:52 +01:00
fdt_sw.c of/lib: Allow scripts/dtc/libfdt to be used from kernel code 2012-07-23 13:54:52 +01:00
fdt_wip.c of/lib: Allow scripts/dtc/libfdt to be used from kernel code 2012-07-23 13:54:52 +01:00
find_last_bit.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
find_next_bit.c
flex_array.c
flex_proportions.c lib/flex_proportions.c: fix corruption of denominator in flexible proportions 2012-09-25 08:59:21 -07:00
gcd.c
gen_crc32table.c
genalloc.c Merge upstream linux-stable v3.10.28 into msm-3.10 2014-03-24 14:28:34 -07:00
halfmd4.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
hexdump.c
hweight.c
idr.c idr: fix overflow bug during maximum ID calculation at maximum height 2014-06-30 20:09:42 -07:00
inflate.c MN10300: Don't try and #include <linux/slab.h> in lib/inflate.c from bootloader 2010-08-12 09:51:35 -07:00
int_sqrt.c lib/int_sqrt: optimize small argument 2019-07-27 21:46:05 +02:00
interval_tree.c mm: interval tree updates 2012-10-09 16:22:40 +09:00
interval_tree_test_main.c
iomap.c lib: iomap: Add MSM RTB support 2014-09-04 19:40:43 -07:00
iomap_copy.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
iommu-helper.c
ioremap.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
iovec.c Hoist memcpy_fromiovec/memcpy_toiovec into lib/ 2013-05-20 10:24:22 +09:30
irq_regs.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
is_single_threaded.c lib/is_single_threaded.c: change current_is_single_threaded() to use for_each_thread() 2019-07-27 22:09:23 +02:00
jedec_ddr_data.c ddr: add LPDDR2 data from JESD209-2 2012-05-02 00:04:06 -07:00
kasprintf.c
kfifo.c
klist.c klist: fix starting point removed bug in klist iterators 2016-02-25 11:57:47 -08:00
kobject.c
kobject_uevent.c
kstrtox.c
kstrtox.h lib/kstrtox: common code between kstrto*() and simple_strto*() functions 2011-10-31 17:30:56 -07:00
lcm.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
libcrc32c.c
list_debug.c
list_sort.c
llist.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h [PATCH] lockdep: locking API self tests 2006-07-03 15:27:03 -07:00
locking-selftest-rsem.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h [PATCH] lockdep: locking API self tests 2006-07-03 15:27:03 -07:00
locking-selftest-spin-softirq.h [PATCH] lockdep: locking API self tests 2006-07-03 15:27:03 -07:00
locking-selftest-spin.h [PATCH] lockdep: locking API self tests 2006-07-03 15:27:03 -07:00
locking-selftest-wlock-hardirq.h [PATCH] lockdep: locking API self tests 2006-07-03 15:27:03 -07:00
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h [PATCH] lockdep: locking API self tests 2006-07-03 15:27:03 -07:00
locking-selftest-wsem.h [PATCH] lockdep: locking API self tests 2006-07-03 15:27:03 -07:00
locking-selftest.c lockdep: Selftest: convert spinlock to raw spinlock 2013-02-19 08:43:35 +01:00
lru_cache.c lru_cache: introduce lc_get_cumulative() 2013-03-22 22:17:36 -06:00
md5.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
memory-notifier-error-inject.c memory: memory notifier error injection module 2012-07-30 17:25:22 -07:00
memweight.c string: introduce memweight() 2012-07-30 17:25:16 -07:00
nlattr.c netlink: rate-limit leftover bytes warning and print process name 2014-06-26 15:12:37 -04:00
notifier-error-inject.c mode_t, whack-a-mole at 11... 2013-04-09 14:13:05 -04:00
notifier-error-inject.h fault-injection: notifier error injection 2012-07-30 17:25:22 -07:00
of-reconfig-notifier-error-inject.c powerpc+of: Rename and fix OF reconfig notifier error inject module 2012-12-14 10:32:52 +11:00
oid_registry.c
parser.c lib/parser.c: fix up comments for valid return values from match_number 2013-02-21 17:22:25 -08:00
pci_iomap.c
percpu_counter.c
plist.c
pm-notifier-error-inject.c PM: PM notifier error injection module 2012-07-30 17:25:22 -07:00
prio_heap.c lib: fix sparse shadowed variable warning 2009-01-06 15:59:11 -08:00
proportions.c locking, lib/proportions: Annotate prop_local_percpu::lock as raw 2011-09-13 11:11:50 +02:00
qmi_encdec.c This is the 3.10.84 stable release 2015-09-30 13:25:40 +05:30
qmi_encdec_priv.h lib: qmi: Introduce QMI Encode/Decode library 2013-09-04 15:34:45 -07:00
radix-tree.c radix-tree: fix race in gang lookup 2016-02-25 11:57:49 -08:00
random32.c random32: include missing header file 2017-09-08 18:50:21 +00:00
ratelimit.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
rational.c
rbtree.c rbtree: add postorder iteration functions 2015-09-16 18:20:19 +05:30
rbtree_test.c
reciprocal_div.c sch_red: Adaptative RED AQM 2011-12-08 19:52:43 -05:00
scatterlist.c Merge upstream linux-stable v3.10.28 into msm-3.10 2014-03-24 14:28:34 -07:00
sha1.c
show_mem.c mm, show_mem: suppress page counts in non-blockable contexts 2013-04-29 15:54:28 -07:00
smp_processor_id.c lib: reduce the use of module.h wherever possible 2012-03-07 15:04:04 -05:00
sort.c
stmp_device.c
string.c lib/string.c: remove duplicated function 2019-07-27 22:09:02 +02:00
string_helpers.c lib/string_helpers: introduce generic string_unescape 2013-04-30 17:04:03 -07:00
strncpy_from_user.c
strnlen_user.c lib: Fix strnlen_user() to not touch memory after specified maximum 2015-06-05 23:19:54 -07:00
swiotlb.c swiotlb: Setting default IO TBL value to 1MB 2014-06-02 08:46:43 -07:00
syscall.c
test-kstrtox.c lib/test-kstrtox.c: mark const init data with __initconst instead of __initdata 2012-05-29 16:22:32 -07:00
test-string_helpers.c
textsearch.c textsearch: doc - fix spelling in lib/textsearch.c. 2011-01-24 23:33:30 -08:00
timerqueue.c
ts_bm.c textsearch: ts_bm: support case insensitive searching in Boyer-Moore algorithm 2008-07-08 02:37:54 -07:00
ts_fsm.c textsearch: ts_fsm: return error on request for case insensitive search 2008-07-08 02:38:27 -07:00
ts_kmp.c textsearch: ts_kmp: support case insensitive searching in Knuth-Morris-Pratt algorithm 2008-07-08 02:38:09 -07:00
ucs2_string.c lib/ucs2_string: Correct ucs2 -> utf8 conversion 2016-03-16 08:41:37 -07:00
usercopy.c Kconfig: consolidate CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2013-04-30 17:04:09 -07:00
uuid.c uuid: use prandom_bytes() 2013-04-29 18:28:42 -07:00
vsprintf.c vsprintf: ignore %n again 2014-05-30 10:23:23 -07:00