linux/kernel/power
Aaron Lu 67b51f87ef PM / hibernate: Avoid overflow in hibernate_preallocate_memory()
commit fd432b9f8c upstream.

When system has a lot of highmem (e.g. 16GiB using a 32 bits kernel),
the code to calculate how much memory we need to preallocate in
normal zone may cause overflow. As Leon has analysed:

 It looks that during computing 'alloc' variable there is overflow:
 alloc = (3943404 - 1970542) - 1978280 = -5418 (signed)
 And this function goes to err_out.

Fix this by avoiding that overflow.

References: https://bugzilla.kernel.org/show_bug.cgi?id=60817
Reported-and-tested-by: Leon Drugi <eyak@wp.pl>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-04 10:56:58 -08:00
..
autosleep.c PM / Sleep: avoid 'autosleep' in shutdown progress 2013-07-28 16:30:21 -07:00
block_io.c
console.c
hibernate.c
Kconfig
main.c
Makefile
power.h
poweroff.c power/sysrq: fix inconstistent help message of sysrq key 2013-04-30 17:04:10 -07:00
process.c
qos.c PM / QoS: Fix workqueue deadlock when using pm_qos_update_request_timeout() 2013-08-20 08:43:05 -07:00
snapshot.c PM / hibernate: Avoid overflow in hibernate_preallocate_memory() 2013-12-04 10:56:58 -08:00
suspend_test.c
suspend.c PM / sleep: invalidate TEST_CPUS and TEST_CORE support for freeze state 2013-04-05 14:18:25 +02:00
swap.c
user.c
wakelock.c