firefly-linux-kernel-4.4.55.git
10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Sat, 5 Apr 2014 00:05:13 +0000 (17:05 -0700)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agoRevert "staging: android: binder: Fix build warnings"
John Stultz [Fri, 4 Apr 2014 23:59:46 +0000 (16:59 -0700)]
Revert "staging: android: binder: Fix build warnings"

This reverts commit aecff9d0c1a87b5cd9af1c91b79a3d8fba82ffba.

Changes to the binder code makes this obsolete, and this now causes
the following warnings:

drivers/staging/android/./binder_trace.h:162:21: error: assignment makes integer from pointer without a cast [-Werror]
   __entry->node_ptr = (void __user *)node->ptr;

drivers/staging/android/./binder_trace.h: In function ‘ftrace_raw_event_binder_transaction_ref_to_node’:
drivers/staging/android/./binder_trace.h:188:21: error: assignment makes integer from pointer without a cast [-Werror]
   __entry->node_ptr = (void __user *)ref->node->ptr;

Reported-by: Sherman Yin <syin@broadcom.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Fri, 4 Apr 2014 23:24:58 +0000 (16:24 -0700)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agoMerge remote-tracking branch 'android/android-3.10' into linaro-fixes/android-3.10
John Stultz [Fri, 4 Apr 2014 23:24:26 +0000 (16:24 -0700)]
Merge remote-tracking branch 'android/android-3.10' into linaro-fixes/android-3.10

10 years agonet: ipv6: Add missing const to ipv6_chk_addr
Mark Brown [Fri, 4 Apr 2014 12:23:54 +0000 (13:23 +0100)]
net: ipv6: Add missing const to ipv6_chk_addr

The net_device used by ipv6_chk_addr is const in some users so add a
const here, fixing a warning following mainline commit 6bc19fb82d4c05
(Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net) from
David S. Miller.

Change-Id: Iebfae34fc9f10f958c41aad6ac4008d61668a870
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Sherman Yin <syin@broadcom.com>
[Folded in additional const fix to the dummy function from Sherman Yin]
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoARM64: copy CONFIG_CMDLINE_EXTEND from ARM
Colin Cross [Thu, 3 Apr 2014 01:02:15 +0000 (18:02 -0700)]
ARM64: copy CONFIG_CMDLINE_EXTEND from ARM

Copy the config choice for CONFIG_CMDLINE_EXTEND from
arch/arm/Kconfig, including CONFIG_CMDLINE_FROM_BOOTLOADER
as the default.  These will be used by drivers/of/fdt.c.

Change-Id: I8416038498ddf8fc1e99ab06109825eb1492aa7f
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoof: Support CONFIG_CMDLINE_EXTEND config option
Doug Anderson [Fri, 3 Feb 2012 06:58:28 +0000 (22:58 -0800)]
of: Support CONFIG_CMDLINE_EXTEND config option

The old logic assumes CMDLINE_FROM_BOOTLOADER vs. CMDLINE_FORCE and
ignores CMDLINE_EXTEND.  Here's the old logic:

- CONFIG_CMDLINE_FORCE=true
    CONFIG_CMDLINE
- dt bootargs=non-empty:
    dt bootargs
- dt bootargs=empty, @data is non-empty string
    @data is left unchanged
- dt bootargs=empty, @data is empty string
    CONFIG_CMDLINE (or "" if that's not defined)

The new logic is now documented in of_fdt.h and is copied here for
reference:

- CONFIG_CMDLINE_FORCE=true
    CONFIG_CMDLINE
- CONFIG_CMDLINE_EXTEND=true, @data is non-empty string
    @data + dt bootargs (even if dt bootargs are empty)
- CONFIG_CMDLINE_EXTEND=true, @data is empty string
    CONFIG_CMDLINE + dt bootargs (even if dt bootargs are empty)
- CMDLINE_FROM_BOOTLOADER=true, dt bootargs=non-empty:
    dt bootargs
- CMDLINE_FROM_BOOTLOADER=true, dt bootargs=empty, @data is non-empty string
    @data is left unchanged
- CMDLINE_FROM_BOOTLOADER=true, dt bootargs=empty, @data is empty string
    CONFIG_CMDLINE (or "" if that's not defined)

Signed-off-by: Doug Anderson <dianders@chromium.org>
CC: devicetree-discuss@lists.ozlabs.org
CC: Grant Likely <grant.likely@secretlab.ca>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Rob Herring <rob.herring@calxeda.com>
Change-Id: I40ace250847f813358125dfcaa8998fd32cf7ea3
Signed-off-by: Colin Cross <ccross@android.com>
10 years agovideo: adf: ensure consistent alignment on userspace facing structs
Greg Hackmann [Wed, 26 Mar 2014 23:43:23 +0000 (16:43 -0700)]
video: adf: ensure consistent alignment on userspace facing structs

64-bit types in structs create alignment problems when a 32-bit x86
userspace talks to an x86_64 kernel.  In most cases the 64-bit types can
be replaced with 32-bit ones, since they're being used for fds and
should have been __s32 in the first place.  For adf_vsync_event,
alignment can be enforced by making the timestamp an __aligned_u64.

Change-Id: I87cf73d8f57730bd7bb43ffce6b7b411eb0ff198
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Wed, 26 Mar 2014 17:45:14 +0000 (10:45 -0700)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agotcp: Fix build error if IPV6 is not selected
Tushar Behera [Wed, 26 Mar 2014 09:57:05 +0000 (15:27 +0530)]
tcp: Fix build error if IPV6 is not selected

If CONFIG_IPV6=m is selected, we are getting following build errors.

net/built-in.o: In function `tcp_is_local6':
net/ipv4/tcp.c:3261: undefined reference to `rt6_lookup'

Making the code conditional upon only CONFIG_IPV6=y fixes this issue.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
CC: John Stultz <john.stultz@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agovideo: adf: replace fbdev helper's open flag with refcount
Greg Hackmann [Mon, 24 Mar 2014 23:45:43 +0000 (16:45 -0700)]
video: adf: replace fbdev helper's open flag with refcount

A device's fb_info is shared between clients.  fb_release() is called
when each client is released, not just the last one.  Since the fbdev
helper needs to release its dma-buf when the last client goes away, it
must keep its own reference count.

fbmem and fbcon hold different locks while calling fb_release(), so
explicit locking is needed.

Change-Id: I42cd659f7633adba7c11f407d4b594bd43305d6a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agoARM64: add option to build Image.gz/dtb combo
Alex Ray [Mon, 17 Mar 2014 20:44:01 +0000 (13:44 -0700)]
ARM64: add option to build Image.gz/dtb combo

Allows a defconfig to set a list of dtbs to concatenate with an
Image.gz to create a Image.gz-dtb.

Change-Id: I0dc3935e57f01b517aa64eda0c27b0101e9ea3b2
Signed-off-by: Alex Ray <aray@google.com>
10 years agostaging: android: Fix typo in staging/android
Masanari Iida [Sun, 23 Jun 2013 14:47:15 +0000 (23:47 +0900)]
staging: android: Fix typo in staging/android

Fix "with with" in debug message.

Issue: ABIT-21
Change-Id: Icd0b195524f4c77272276991a1e8a00aecef65c9
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Qiming Shi <qiming.shi@intel.com>
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
10 years agovideo: adf: export the adf_attachment_allow symbol to modules.
Alistair Strachan [Tue, 11 Mar 2014 00:00:25 +0000 (17:00 -0700)]
video: adf: export the adf_attachment_allow symbol to modules.

There are no in-tree users of adf_attachment_allow, but out-of-tree
modules want to use it. It looks like this function should be
EXPORT_SYMBOL.

Change-Id: Iad522dc5d32ac09fec6483bbc317db8ecae12e97
Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
10 years agopower: wakeup_reason: rename irq_count to irqcount
Greg Hackmann [Mon, 10 Mar 2014 21:21:30 +0000 (14:21 -0700)]
power: wakeup_reason: rename irq_count to irqcount

On x86, irq_count conflicts with a declaration in
arch/x86/include/asm/processor.h

Change-Id: I3e4fde0ff64ef59ff5ed2adc0ea3a644641ee0b7
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Mon, 10 Mar 2014 18:35:09 +0000 (11:35 -0700)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agoPower: Add guard condition for maximum wakeup reasons
Ruchi Kandoi [Fri, 7 Mar 2014 20:54:30 +0000 (12:54 -0800)]
Power: Add guard condition for maximum wakeup reasons

Ensure the array for the wakeup reason IRQs does not overflow.

Change-Id: Iddc57a3aeb1888f39d4e7b004164611803a4d37c
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
(cherry picked from commit b5ea40cdfcf38296535f931a7e5e7bf47b6fad7f)

10 years agostaging: Fix build issues with new binder API
John Stultz [Mon, 3 Mar 2014 09:35:23 +0000 (01:35 -0800)]
staging: Fix build issues with new binder API

The new 64bit binder API causes build issues on 32bit ARM
due to the lack of 64bit __get_user_asm_* implementation.

Until that implementation is done, remove the choice for
32bit ARM, automatically enabling the old 32bit binder
protocol.

This can be reverted once a 64bit __get_user_asm_*
implementation is merged.

Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Colin Cross <ccross@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Serban Constantinescu <serban.constantinescu@arm.com>
Cc: Android Kernel Team <kernel-team@android.com>
Reported-by: Arnd Bergmann <arnd.bergmann@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoMerge branch 'upstream/android-3.10' into linaro-fixes/android-3.10
John Stultz [Mon, 3 Mar 2014 09:00:52 +0000 (01:00 -0800)]
Merge branch 'upstream/android-3.10' into linaro-fixes/android-3.10

This reverts Serban's out-of-tree binder changes and moves to
the new binder protocol approach merged into AOSP.

Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoandroid: base-cfg: enable DM_VERITY (used for secureboot)
JP Abgrall [Fri, 28 Feb 2014 03:38:14 +0000 (19:38 -0800)]
android: base-cfg: enable DM_VERITY (used for secureboot)

Change-Id: I68d769f97ffa76bb45e65d34a96dd7f558c02d08
Signed-off-by: JP Abgrall <jpa@google.com>
10 years agoarm64: cmpxchg: update macros to prevent warnings
Mark Hambleton [Tue, 3 Dec 2013 19:19:12 +0000 (19:19 +0000)]
arm64: cmpxchg: update macros to prevent warnings

Make sure the value we are going to return is referenced in order to
avoid warnings from newer GCCs such as:

arch/arm64/include/asm/cmpxchg.h:162:3: warning: value computed is not used [-Wunused-value]
  ((__typeof__(*(ptr)))__cmpxchg_mb((ptr),   \
   ^
net/netfilter/nf_conntrack_core.c:674:2: note: in expansion of macro ‘cmpxchg’
  cmpxchg(&nf_conntrack_hash_rnd, 0, rand);

[Modified to use the current underlying implementation as current
mainline for both cmpxchg() and cmpxchg_local() does -- broonie]

Signed-off-by: Mark Hambleton <mahamble@broadcom.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agodrivers: usb: gadget: 64-bit related type fixes
Greg Hackmann [Mon, 24 Feb 2014 18:19:13 +0000 (10:19 -0800)]
drivers: usb: gadget: 64-bit related type fixes

Change-Id: I2f9b12e1e0cdfe64ffe20db78d319a6221821184
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agonetfilter: xt_qtaguid: 64-bit warning fixes
Greg Hackmann [Mon, 24 Feb 2014 17:39:46 +0000 (09:39 -0800)]
netfilter: xt_qtaguid: 64-bit warning fixes

Change-Id: I2adc517c0c51050ed601992fa0ea4de8f1449414
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agoStaging: android: binder: More offset validation.
Arve Hjønnevåg [Fri, 14 Feb 2014 04:25:06 +0000 (20:25 -0800)]
Staging: android: binder: More offset validation.

Make sure offsets don't point to overlapping flat_binder_object
structs.

Change-Id: I425ab0c46fbe2b00ed679c5becf9e8140395eb40
Signed-off-by: Arve Hjønnevåg <arve@android.com>
10 years agoPOWER: fix compile warnings in log_wakeup_reason
Ruchi Kandoi [Fri, 21 Feb 2014 03:47:38 +0000 (19:47 -0800)]
POWER: fix compile warnings in log_wakeup_reason

Change I81addaf420f1338255c5d0638b0d244a99d777d1 introduced compile
warnings, fix these.

Change-Id: I05482a5335599ab96c0a088a7d175c8d4cf1cf69
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
10 years agoPower: add an API to log wakeup reasons
Ruchi Kandoi [Wed, 19 Feb 2014 23:30:47 +0000 (15:30 -0800)]
Power: add an API to log wakeup reasons

Add API log_wakeup_reason() and expose it to userspace via sysfs path
/sys/kernel/wakeup_reasons/last_resume_reason

Change-Id: I81addaf420f1338255c5d0638b0d244a99d777d1
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
10 years agoandroid: configs: add systrace support to recommended configs
Rom Lemarchand [Thu, 20 Feb 2014 02:01:37 +0000 (18:01 -0800)]
android: configs: add systrace support to recommended configs

Change-Id: I4a6e88f47803e88b0ce2d913be4aeb299ca858b4
Signed-off-by: Rom Lemarchand <romlem@android.com>
10 years agovideo: adf: use %zu when printing size_t
Greg Hackmann [Fri, 14 Feb 2014 23:35:38 +0000 (15:35 -0800)]
video: adf: use %zu when printing size_t

Change-Id: I9cf7ebc368bad0a83db9e5aa370feadf117b21c0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: fix compat ioctls calling ioctl with wrong cmd
Greg Hackmann [Fri, 14 Feb 2014 23:38:49 +0000 (15:38 -0800)]
video: adf: fix compat ioctls calling ioctl with wrong cmd

Change-Id: Icdbac3edd123b3114103dc138a60e6955006cda4
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: use ADF_IOCTL_TYPE in compat ioctl definitions
Greg Hackmann [Fri, 14 Feb 2014 23:39:52 +0000 (15:39 -0800)]
video: adf: use ADF_IOCTL_TYPE in compat ioctl definitions

Change-Id: I7451a282d9d972c9957568b366c164b67b4b47e8
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agoStaging: android: binder: Fix death notifications
Arve Hjønnevåg [Sat, 8 Feb 2014 01:46:21 +0000 (17:46 -0800)]
Staging: android: binder: Fix death notifications

The change (008fa749e0fe5b2fffd20b7fe4891bb80d072c6a) that moved the
node release code to a separate function broke death notifications in
some cases. When it encountered a reference without a death
notification request, it would skip looking at the remaining
references, and therefore fail to send death notifications for them.

Change-Id: I12083a50709ccc30ba11a5f4d9eeb5f0ff4471c6
Signed-off-by: Arve Hjønnevåg <arve@android.com>
10 years agofix false disconnect due to a signal sent to the reading process
keunyoung [Wed, 29 Jan 2014 20:41:50 +0000 (12:41 -0800)]
fix false disconnect due to a signal sent to the reading process

- In the current implementation, when a signal is sent to the reading process,
  read is cancelled by calling usb_ep_dequeue, which lead into calling
  acc_complete_out with ECONNRESET, but the current logic treats it as
  disconnection, which makes the device inaccessible until cable is actually
  disconnected.
- The fix calls disconnect only when ESHUTDOWN error is passed.
- If data has already arrived while trying cancelling, the data is marked
  as available, and it will be read out on the next read. This is necessary
  as USB bulk is assumed to guarantee no data loss.

Signed-off-by: keunyoung <keunyoung@google.com>
10 years agocpufreq: don't leave stale policy pointer in cdbs->cur_policy
Jacob Shin [Thu, 27 Jun 2013 20:02:12 +0000 (22:02 +0200)]
cpufreq: don't leave stale policy pointer in cdbs->cur_policy

Clear ->cur_policy when stopping a governor, or the ->cur_policy
pointer may be stale on systems with have_governor_per_policy when a
new policy is allocated due to CPU hotplug offline/online.

[rjw: Changelog]
Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agocpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c
Viresh Kumar [Thu, 16 May 2013 05:09:57 +0000 (05:09 +0000)]
cpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c

get_governor_parent_kobj() can be used by any governor, generic
cpufreq governors or platform specific ones and so must be present in
cpufreq.c instead of cpufreq_governor.c.

This patch moves it to cpufreq.c. This also adds
EXPORT_SYMBOL_GPL(get_governor_parent_kobj) so that modules can use
this function too.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agocpufreq: Add EXPORT_SYMBOL_GPL for have_governor_per_policy
Viresh Kumar [Thu, 16 May 2013 05:09:56 +0000 (05:09 +0000)]
cpufreq: Add EXPORT_SYMBOL_GPL for have_governor_per_policy

This patch adds: EXPORT_SYMBOL_GPL(have_governor_per_policy), so that
this routine can be used by modules too.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agotcp: add a sysctl to config the tcp_default_init_rwnd
JP Abgrall [Sat, 8 Feb 2014 02:40:10 +0000 (18:40 -0800)]
tcp: add a sysctl to config the tcp_default_init_rwnd

The default initial rwnd is hardcoded to 10.

Now we allow it to be controlled via
  /proc/sys/net/ipv4/tcp_default_init_rwnd
which limits the values from 3 to 100

This is somewhat needed because ipv6 routes are
autoconfigured by the kernel.

See "An Argument for Increasing TCP's Initial Congestion Window"
in https://developers.google.com/speed/articles/tcp_initcwnd_paper.pdf

Change-Id: I386b2a9d62de0ebe05c1ebe1b4bd91b314af5c54
Signed-off-by: JP Abgrall <jpa@google.com>
Conflicts:
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_input.c

10 years agoSELinux: Fix kernel BUG on empty security contexts.
Stephen Smalley [Thu, 30 Jan 2014 16:26:59 +0000 (11:26 -0500)]
SELinux: Fix kernel BUG on empty security contexts.

Setting an empty security context (length=0) on a file will
lead to incorrectly dereferencing the type and other fields
of the security context structure, yielding a kernel BUG.
As a zero-length security context is never valid, just reject
all such security contexts whether coming from userspace
via setxattr or coming from the filesystem upon a getxattr
request by SELinux.

Setting a security context value (empty or otherwise) unknown to
SELinux in the first place is only possible for a root process
(CAP_MAC_ADMIN), and, if running SELinux in enforcing mode, only
if the corresponding SELinux mac_admin permission is also granted
to the domain by policy.  In Fedora policies, this is only allowed for
specific domains such as livecd for setting down security contexts
that are not defined in the build host policy.

[On Android, this can only be set by root/CAP_MAC_ADMIN processes,
and if running SELinux in enforcing mode, only if mac_admin permission
is granted in policy.  In Android 4.4, this would only be allowed for
root/CAP_MAC_ADMIN processes that are also in unconfined domains. In current
AOSP master, mac_admin is not allowed for any domains except the recovery
console which has a legitimate need for it.  The other potential vector
is mounting a maliciously crafted filesystem for which SELinux fetches
xattrs (e.g. an ext4 filesystem on a SDcard).  However, the end result is
only a local denial-of-service (DOS) due to kernel BUG.  This fix is
queued for 3.14.]

Reproducer:
su
setenforce 0
touch foo
setfattr -n security.selinux foo

Caveat:
Relabeling or removing foo after doing the above may not be possible
without booting with SELinux disabled.  Any subsequent access to foo
after doing the above will also trigger the BUG.

BUG output from Matthew Thode:
[  473.893141] ------------[ cut here ]------------
[  473.962110] kernel BUG at security/selinux/ss/services.c:654!
[  473.995314] invalid opcode: 0000 [#6] SMP
[  474.027196] Modules linked in:
[  474.058118] CPU: 0 PID: 8138 Comm: ls Tainted: G      D   I
3.13.0-grsec #1
[  474.116637] Hardware name: Supermicro X8ST3/X8ST3, BIOS 2.0
07/29/10
[  474.149768] task: ffff8805f50cd010 ti: ffff8805f50cd488 task.ti:
ffff8805f50cd488
[  474.183707] RIP: 0010:[<ffffffff814681c7>]  [<ffffffff814681c7>]
context_struct_compute_av+0xce/0x308
[  474.219954] RSP: 0018:ffff8805c0ac3c38  EFLAGS: 00010246
[  474.252253] RAX: 0000000000000000 RBX: ffff8805c0ac3d94 RCX:
0000000000000100
[  474.287018] RDX: ffff8805e8aac000 RSI: 00000000ffffffff RDI:
ffff8805e8aaa000
[  474.321199] RBP: ffff8805c0ac3cb8 R08: 0000000000000010 R09:
0000000000000006
[  474.357446] R10: 0000000000000000 R11: ffff8805c567a000 R12:
0000000000000006
[  474.419191] R13: ffff8805c2b74e88 R14: 00000000000001da R15:
0000000000000000
[  474.453816] FS:  00007f2e75220800(0000) GS:ffff88061fc00000(0000)
knlGS:0000000000000000
[  474.489254] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  474.522215] CR2: 00007f2e74716090 CR3: 00000005c085e000 CR4:
00000000000207f0
[  474.556058] Stack:
[  474.584325]  ffff8805c0ac3c98 ffffffff811b549b ffff8805c0ac3c98
ffff8805f1190a40
[  474.618913]  ffff8805a6202f08 ffff8805c2b74e88 00068800d0464990
ffff8805e8aac860
[  474.653955]  ffff8805c0ac3cb8 000700068113833a ffff880606c75060
ffff8805c0ac3d94
[  474.690461] Call Trace:
[  474.723779]  [<ffffffff811b549b>] ? lookup_fast+0x1cd/0x22a
[  474.778049]  [<ffffffff81468824>] security_compute_av+0xf4/0x20b
[  474.811398]  [<ffffffff8196f419>] avc_compute_av+0x2a/0x179
[  474.843813]  [<ffffffff8145727b>] avc_has_perm+0x45/0xf4
[  474.875694]  [<ffffffff81457d0e>] inode_has_perm+0x2a/0x31
[  474.907370]  [<ffffffff81457e76>] selinux_inode_getattr+0x3c/0x3e
[  474.938726]  [<ffffffff81455cf6>] security_inode_getattr+0x1b/0x22
[  474.970036]  [<ffffffff811b057d>] vfs_getattr+0x19/0x2d
[  475.000618]  [<ffffffff811b05e5>] vfs_fstatat+0x54/0x91
[  475.030402]  [<ffffffff811b063b>] vfs_lstat+0x19/0x1b
[  475.061097]  [<ffffffff811b077e>] SyS_newlstat+0x15/0x30
[  475.094595]  [<ffffffff8113c5c1>] ? __audit_syscall_entry+0xa1/0xc3
[  475.148405]  [<ffffffff8197791e>] system_call_fastpath+0x16/0x1b
[  475.179201] Code: 00 48 85 c0 48 89 45 b8 75 02 0f 0b 48 8b 45 a0 48
8b 3d 45 d0 b6 00 8b 40 08 89 c6 ff ce e8 d1 b0 06 00 48 85 c0 49 89 c7
75 02 <0f> 0b 48 8b 45 b8 4c 8b 28 eb 1e 49 8d 7d 08 be 80 01 00 00 e8
[  475.255884] RIP  [<ffffffff814681c7>]
context_struct_compute_av+0xce/0x308
[  475.296120]  RSP <ffff8805c0ac3c38>
[  475.328734] ---[ end trace f076482e9d754adc ]---

[sds:  commit message edited to note Android implications and
to generate a unique Change-Id for gerrit]

Change-Id: I4d5389f0cfa72b5f59dada45081fa47e03805413
Reported-by: Matthew Thode <mthode@mthode.org>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Cc: stable@vger.kernel.org
Signed-off-by: Paul Moore <pmoore@redhat.com>
10 years agoARM: tegra: flounder: stick to 32bit binder for now.
JP Abgrall [Wed, 5 Feb 2014 20:29:34 +0000 (12:29 -0800)]
ARM: tegra: flounder: stick to 32bit binder for now.

Signed-off-by: JP Abgrall <jpa@google.com>
10 years agonetfilter: xt_IDLETIMER: Revert to retain the kernel API format.
Ashish Sharma [Wed, 5 Feb 2014 01:50:50 +0000 (01:50 +0000)]
netfilter: xt_IDLETIMER: Revert to retain the kernel API format.

Reverted Change-Id: Iaeca5dd2d7878c0733923ae03309a2a7b86979ca

Change-Id: I0e0a4f60ec14330d8d8d1c5a508fa058d9919e07
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
(cherry picked from commit e0a4e5b0e808d718dd9af500c5754118fc3935db)

10 years agoSELinux: Fix possible NULL pointer dereference in selinux_inode_permission()
Steven Rostedt [Fri, 10 Jan 2014 02:46:34 +0000 (21:46 -0500)]
SELinux: Fix possible NULL pointer dereference in selinux_inode_permission()

commit 3dc91d4338d698ce77832985f9cb183d8eeaf6be upstream.

While running stress tests on adding and deleting ftrace instances I hit
this bug:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
  IP: selinux_inode_permission+0x85/0x160
  PGD 63681067 PUD 7ddbe067 PMD 0
  Oops: 0000 [#1] PREEMPT
  CPU: 0 PID: 5634 Comm: ftrace-test-mki Not tainted 3.13.0-rc4-test-00033-gd2a6dde-dirty #20
  Hardware name:                  /DG965MQ, BIOS MQ96510J.86A.0372.2006.0605.1717 06/05/2006
  task: ffff880078375800 ti: ffff88007ddb0000 task.ti: ffff88007ddb0000
  RIP: 0010:[<ffffffff812d8bc5>]  [<ffffffff812d8bc5>] selinux_inode_permission+0x85/0x160
  RSP: 0018:ffff88007ddb1c48  EFLAGS: 00010246
  RAX: 0000000000000000 RBX: 0000000000800000 RCX: ffff88006dd43840
  RDX: 0000000000000001 RSI: 0000000000000081 RDI: ffff88006ee46000
  RBP: ffff88007ddb1c88 R08: 0000000000000000 R09: ffff88007ddb1c54
  R10: 6e6576652f6f6f66 R11: 0000000000000003 R12: 0000000000000000
  R13: 0000000000000081 R14: ffff88006ee46000 R15: 0000000000000000
  FS:  00007f217b5b6700(0000) GS:ffffffff81e21000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033^M
  CR2: 0000000000000020 CR3: 000000006a0fe000 CR4: 00000000000007f0
  Call Trace:
    security_inode_permission+0x1c/0x30
    __inode_permission+0x41/0xa0
    inode_permission+0x18/0x50
    link_path_walk+0x66/0x920
    path_openat+0xa6/0x6c0
    do_filp_open+0x43/0xa0
    do_sys_open+0x146/0x240
    SyS_open+0x1e/0x20
    system_call_fastpath+0x16/0x1b
  Code: 84 a1 00 00 00 81 e3 00 20 00 00 89 d8 83 c8 02 40 f6 c6 04 0f 45 d8 40 f6 c6 08 74 71 80 cf 02 49 8b 46 38 4c 8d 4d cc 45 31 c0 <0f> b7 50 20 8b 70 1c 48 8b 41 70 89 d9 8b 78 04 e8 36 cf ff ff
  RIP  selinux_inode_permission+0x85/0x160
  CR2: 0000000000000020

Investigating, I found that the inode->i_security was NULL, and the
dereference of it caused the oops.

in selinux_inode_permission():

isec = inode->i_security;

rc = avc_has_perm_noaudit(sid, isec->sid, isec->sclass, perms, 0, &avd);

Note, the crash came from stressing the deletion and reading of debugfs
files.  I was not able to recreate this via normal files.  But I'm not
sure they are safe.  It may just be that the race window is much harder
to hit.

What seems to have happened (and what I have traced), is the file is
being opened at the same time the file or directory is being deleted.
As the dentry and inode locks are not held during the path walk, nor is
the inodes ref counts being incremented, there is nothing saving these
structures from being discarded except for an rcu_read_lock().

The rcu_read_lock() protects against freeing of the inode, but it does
not protect freeing of the inode_security_struct.  Now if the freeing of
the i_security happens with a call_rcu(), and the i_security field of
the inode is not changed (it gets freed as the inode gets freed) then
there will be no issue here.  (Linus Torvalds suggested not setting the
field to NULL such that we do not need to check if it is NULL in the
permission check).

Note, this is a hack, but it fixes the problem at hand.  A real fix is
to restructure the destroy_inode() to call all the destructor handlers
from the RCU callback.  But that is a major job to do, and requires a
lot of work.  For now, we just band-aid this bug with this fix (it
works), and work on a more maintainable solution in the future.

Link: http://lkml.kernel.org/r/20140109101932.0508dec7@gandalf.local.home
Link: http://lkml.kernel.org/r/20140109182756.17abaaa8@gandalf.local.home
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: android: binder: Support concurrent 32 bit and 64 bit processes.
Arve Hjønnevåg [Tue, 28 Jan 2014 03:18:47 +0000 (19:18 -0800)]
Staging: android: binder: Support concurrent 32 bit and 64 bit processes.

Add binder_size_t and binder_uintptr_t that is used instead of size_t and
void __user * in the user-space interface.

Use 64 bit pointers on all systems unless CONFIG_ANDROID_BINDER_IPC_32BIT
is set (which enables the old protocol on 32 bit systems).

Change BINDER_CURRENT_PROTOCOL_VERSION to 8 if
CONFIG_ANDROID_BINDER_IPC_32BIT is not set.

Add compat ioctl.

Change-Id: Ifbbde0209da0050011bcab34c547a4c30d6e8c49
Signed-off-by: Arve Hjønnevåg <arve@android.com>
10 years agostaging: android: binder: fix ABI for 64bit Android
Serban Constantinescu [Wed, 15 Jan 2014 11:28:36 +0000 (11:28 +0000)]
staging: android: binder: fix ABI for 64bit Android

This patch fixes the ABI for 64bit Android userspace.
BC_REQUEST_DEATH_NOTIFICATION and BC_CLEAR_DEATH_NOTIFICATION claim
to be using struct binder_ptr_cookie, but they are using a 32bit handle
and a pointer.

On 32bit systems the payload size is the same as the size of struct
binder_ptr_cookie, however for 64bit systems this will differ. This
patch adds struct binder_handle_cookie that fixes this issue for 64bit
Android.

Since there are no 64bit users of this interface that we know of this
change should not affect any existing systems.

Change-Id: I8909cbc50aad48ccf371270bad6f69ff242a8c22
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
10 years agostaging: android: binder: fix binder interface for 64bit compat layer
Serban Constantinescu [Thu, 4 Jul 2013 09:54:48 +0000 (10:54 +0100)]
staging: android: binder: fix binder interface for 64bit compat layer

The changes in this patch will fix the binder interface for use on 64bit
machines and stand as the base of the 64bit compat support. The changes
apply to the structures that are passed between the kernel and
userspace.

Most of the  changes applied mirror the change to struct binder_version
where there is no need for a 64bit wide protocol_version(on 64bit
machines). The change inlines with the existing 32bit userspace(the
structure has the same size) and simplifies the compat layer such that
the same handler can service the BINDER_VERSION ioctl.

Other changes make use of kernel types as well as user-exportable ones
and fix format specifier issues.

The changes do not affect existing 32bit ABI.

Change-Id: Icccc8d47c302930cc61cddc5749b4cc74dc84117
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: replace types with portable ones
Serban Constantinescu [Thu, 4 Jul 2013 09:54:47 +0000 (10:54 +0100)]
staging: android: binder: replace types with portable ones

Since this driver is meant to be used on different types of processors
and a portable driver should specify the size a variable expects to be
this patch changes the types used throughout the binder interface.

We use "userspace" types since this header will be exported and used by
the Android filesystem.

The patch does not change in any way the functionality of the binder driver.

Change-Id: Ib26daab8bc44b92d4a09badc8ecb64d37ee8773b
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: fix alignment issues
Serban Constantinescu [Thu, 4 Jul 2013 09:54:46 +0000 (10:54 +0100)]
staging: android: binder: fix alignment issues

The Android userspace aligns the data written to the binder buffers to
4bytes. Thus for 32bit platforms or 64bit platforms running an 32bit
Android userspace we can have a buffer looking like this:

platform    buffer(binder_cmd   pointer)      size
32/32                 32b         32b          8B
64/32                 32b         64b          12B
64/64                 32b         64b          12B

Thus the kernel needs to check that the buffer size is aligned to 4bytes
not to (void *) that will be 8bytes on 64bit machines.

The change does not affect existing 32bit ABI.

Change-Id: I7535f07301519623ea6334f525d312d687407ed4
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: fix BC_FREE_BUFFER ioctl declaration
Serban Constantinescu [Thu, 4 Jul 2013 09:54:45 +0000 (10:54 +0100)]
staging: android: binder: fix BC_FREE_BUFFER ioctl declaration

BinderDriverCommands mirror the ioctl usage. Thus the size of the
structure passed through the interface should be used to generate the
ioctl No.

The change reflects the type being passed from the user space-a pointer
to a binder_buffer. This change should not affect the existing 32bit
user space since BC_FREE_BUFFER is computed as:

   #define _IOW(type,nr,size)         \
      ((type) << _IOC_TYPESHIFT) |    \
      ((nr)   << _IOC_NRSHIFT) |      \
      ((size) << _IOC_SIZESHIFT))

and for a 32bit compiler BC_FREE_BUFFER will have the same computed
value. This change will also ease our work in differentiating
BC_FREE_BUFFER from COMPAT_BC_FREE_BUFFER.

The change does not affect existing 32bit ABI.

Change-Id: I2e0ae87bc4e913225a8eb2912913f7e3617cb575
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: fix BINDER_SET_MAX_THREADS declaration
Serban Constantinescu [Thu, 4 Jul 2013 09:54:44 +0000 (10:54 +0100)]
staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

This change will fix the BINDER_SET_MAX_THREADS ioctl to use __u32
instead of size_t for setting the max threads. Thus using the same
handler for 32 and 64bit kernels.

This value is stored internally in struct binder_proc and set to 15
on open_binder() in the libbinder API(thus no need for a 64bit size_t
on 64bit platforms).

The change does not affect existing 32bit ABI.

Change-Id: Ibdfe10a70d475a91c247dc36e9cfd74a259d50e4
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: modify struct binder_write_read to use size_t
Serban Constantinescu [Thu, 4 Jul 2013 09:54:43 +0000 (10:54 +0100)]
staging: android: binder: modify struct binder_write_read to use size_t

This change mirrors the userspace operation where struct binder_write_read
members that specify the buffer size and consumed size are size_t elements.

The patch also fixes the binder_thread_write() and binder_thread_read()
functions prototypes to conform with the definition of binder_write_read.

The changes do not affect existing 32bit ABI.

Change-Id: I987246d507b9c5e4627c62a1da971d11869ac5a0
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoFix aarch64 build issue with ION
John Stultz [Fri, 31 Jan 2014 19:22:18 +0000 (11:22 -0800)]
Fix aarch64 build issue with ION

In trying to build ION for aarch64, I came across the following build error:

In file included from /home/jstultz/projects/linux/linaro.android/arch/arm64/include/asm/page.h:39:0,
                 from drivers/staging/android/ion/ion_system_heap.c:17:
/home/jstultz/projects/linux/linaro.android/arch/arm64/include/asm/pgtable-3level-types.h:19:1: error: unknown type name u64
 typedef u64 pteval_t;
 ^
/home/jstultz/projects/linux/linaro.android/arch/arm64/include/asm/pgtable-3level-types.h:20:1: error: unknown type name u64
 typedef u64 pmdval_t;
 ^
...

The problem is asm/page.h doesn't include anything that defines u64, so
add an asm/types.h include to the pgtable-3level-types.h to match upstream
and avoid the issue.

Change-Id: I3f098bf666761ac6b316389a46d37cc449c342d6
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Fri, 31 Jan 2014 19:54:26 +0000 (11:54 -0800)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agoFix aarch64 build issue with ION
John Stultz [Fri, 31 Jan 2014 19:22:18 +0000 (11:22 -0800)]
Fix aarch64 build issue with ION

In trying to build ION for aarch64, I came across the following build error:

In file included from /home/jstultz/projects/linux/linaro.android/arch/arm64/include/asm/page.h:39:0,
                 from drivers/staging/android/ion/ion_system_heap.c:17:
/home/jstultz/projects/linux/linaro.android/arch/arm64/include/asm/pgtable-3level-types.h:19:1: error: unknown type name u64
 typedef u64 pteval_t;
 ^
/home/jstultz/projects/linux/linaro.android/arch/arm64/include/asm/pgtable-3level-types.h:20:1: error: unknown type name u64
 typedef u64 pmdval_t;
 ^
...

The problem is asm/page.h doesn't include anything that defines u64, so
add an asm/types.h include to the pgtable-3level-types.h to match upstream
and avoid the issue.

Change-Id: I23f6d2e909cb4de1f9b4f21eb20f9200367faddd
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoping: prevent NULL pointer dereference on write to msg_name
Hannes Frederic Sowa [Mon, 18 Nov 2013 06:07:45 +0000 (07:07 +0100)]
ping: prevent NULL pointer dereference on write to msg_name

A plain read() on a socket does set msg->msg_name to NULL. So check for
NULL pointer first.

[Backport of net-next cf970c002d270c36202bd5b9c2804d3097a52da0]

Bug: 12780426
Change-Id: I3df76aca2fa56478b9a33c404f7b1f0940475ef7
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
10 years agonet: ipv6: add missing lock in ping_v6_sendmsg
Lorenzo Colitti [Wed, 3 Jul 2013 15:52:49 +0000 (00:52 +0900)]
net: ipv6: add missing lock in ping_v6_sendmsg

[net-next commit a1bdc45580fc19e968b32ad27cd7e476a4aa58f6]

Bug: 12800827
Change-Id: I93d897e5043dc89bc99f111c89ef4f8b1fa1885d
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: ipv6: fix wrong ping_v6_sendmsg return value
Lorenzo Colitti [Wed, 3 Jul 2013 15:12:40 +0000 (00:12 +0900)]
net: ipv6: fix wrong ping_v6_sendmsg return value

[net-next commit fbfe80c890a1dc521d0b629b870e32fcffff0da5]

ping_v6_sendmsg currently returns 0 on success. It should return
the number of bytes written instead.

Bug: 12800827
Change-Id: I7ed17dc61afbb68a84908e67e44db976ec812bad
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoping: always initialize ->sin6_scope_id and ->sin6_flowinfo
Cong Wang [Sun, 2 Jun 2013 22:43:52 +0000 (22:43 +0000)]
ping: always initialize ->sin6_scope_id and ->sin6_flowinfo

[net-next commit c26d6b46da3ee86fa8a864347331e5513ca84c2b]

If we don't need scope id, we should initialize it to zero.
Same for ->sin6_flowinfo.

Bug: 12800827
Change-Id: Ic19792cee3f5dc30237562cf48e6bdf49817c96e
Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: ipv6: Add IPv6 support to the ping socket.
Lorenzo Colitti [Wed, 22 May 2013 20:17:31 +0000 (20:17 +0000)]
net: ipv6: Add IPv6 support to the ping socket.

[net-next commit 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67]

This adds the ability to send ICMPv6 echo requests without a
raw socket. The equivalent ability for ICMPv4 was added in
2011.

Instead of having separate code paths for IPv4 and IPv6, make
most of the code in net/ipv4/ping.c dual-stack and only add a
few IPv6-specific bits (like the protocol definition) to a new
net/ipv6/ping.c. Hopefully this will reduce divergence and/or
duplication of bugs in the future.

Caveats:

- Setting options via ancillary data (e.g., using IPV6_PKTINFO
  to specify the outgoing interface) is not yet supported.
- There are no separate security settings for IPv4 and IPv6;
  everything is controlled by /proc/net/ipv4/ping_group_range.
- The proc interface does not yet display IPv6 ping sockets
  properly.

Tested with a patched copy of ping6 and using raw socket calls.
Compiles and works with all of CONFIG_IPV6={n,m,y}.

Bug: 12800827
Change-Id: I718cd9931823873ab44df22e8a66e12d6a0a6eb1
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Thu, 30 Jan 2014 19:11:28 +0000 (11:11 -0800)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agoMerge branch 'upstream/android-3.10' into linaro-fixes/android-3.10
John Stultz [Thu, 30 Jan 2014 19:09:50 +0000 (11:09 -0800)]
Merge branch 'upstream/android-3.10' into linaro-fixes/android-3.10

10 years agostaging: ion: Build fix for compat_ion.c
John Stultz [Wed, 29 Jan 2014 21:00:51 +0000 (13:00 -0800)]
staging: ion: Build fix for compat_ion.c

compat_get_ion_handle_data is missing a declaration for
the return value.

This patch simply adds it, so things build.

Change-Id: I1a72a3c56975dc614322a63852f2a6554f2be107
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoion: Fix ION_IOC_FREE compat ioctl
Laura Abbott [Tue, 28 Jan 2014 23:39:48 +0000 (15:39 -0800)]
ion: Fix ION_IOC_FREE compat ioctl

The compat ioctl for ION_IOC_FREE currently passes allocation data
instead of the free data. Correct this.

Change-Id: I5108a1937104b8368426f7695b4a2df416036a87
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
10 years agoandroid: configs: update 3.10 options
Rom Lemarchand [Tue, 28 Jan 2014 18:23:19 +0000 (10:23 -0800)]
android: configs: update 3.10 options

Change-Id: Ifbda55e570a22ace98d7d74b057ba21a597e0826

10 years agoandroid: configs: Add CONFIG_NETFILTER_XT_TARGET_IDLETIMER
Ashish Sharma [Thu, 16 Jan 2014 00:47:16 +0000 (16:47 -0800)]
android: configs: Add CONFIG_NETFILTER_XT_TARGET_IDLETIMER

Signed-off-by: Ashish Sharma <ashishsharma@google.com>
(cherry picked from commit 5621df1091c7e103bca6cdd1dbecf4333efad4e7)

Change-Id: I3104266fa648fc024fee45f1ce9800142898baf7

10 years agostaging: android: binder: Add binder compat layer
Serban Constantinescu [Wed, 4 Dec 2013 18:09:41 +0000 (18:09 +0000)]
staging: android: binder: Add binder compat layer

This patch adds support for 32bit userspace running on 64bit kernels.
All the changes done in this patch have been tested on 32bit and 64bit
systems.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agocpufreq: interactive: fix NULL pointer dereference at sysfs ops
Minsung Kim [Sun, 19 Jan 2014 05:32:42 +0000 (14:32 +0900)]
cpufreq: interactive: fix NULL pointer dereference at sysfs ops

sysfs ops for target_loads and above_hispeed_delay can be called before
initializing tunables at CPUFREQ_GOV_POLICY_INIT. Create sysfs entries after
initialization.

Change-Id: I50356198d7629731c0d32a3066d61fe8354e0001
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
10 years agovideo: adf: define constants for device-custom ioctls
Greg Hackmann [Mon, 13 Jan 2014 23:24:24 +0000 (15:24 -0800)]
video: adf: define constants for device-custom ioctls

Device-custom ADF ioctls can use type ADF_IOCTL_TYPE and
nr >= ADF_IOCTL_NR_CUSTOM

Change-Id: Ia8270973df5100e996ca0e021ede60e54b9af72a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agoarm64: documentation: tighten up tagged pointer documentation
Will Deacon [Tue, 17 Sep 2013 10:46:23 +0000 (11:46 +0100)]
arm64: documentation: tighten up tagged pointer documentation

Commit d50240a5f6ce ("arm64: mm: permit use of tagged pointers at EL0")
added support for tagged pointers in userspace, but the corresponding
update to Documentation/ contained some imprecise statements.

This patch fixes up some minor ambiguities in the text, hopefully making
it more clear about exactly what the kernel expects from user virtual
addresses.

Change-Id: I7df342e01d5253ccacb3847449940892768d7e07
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agoarm64: mm: permit use of tagged pointers at EL0
Will Deacon [Wed, 12 Jun 2013 15:28:04 +0000 (16:28 +0100)]
arm64: mm: permit use of tagged pointers at EL0

TCR.TBI0 can be used to cause hardware address translation to ignore the
top byte of userspace virtual addresses. Whilst not especially useful in
standard C programs, this can be used by JITs to `tag' pointers with
various pieces of metadata.

This patch enables this bit for AArch64 Linux, and adds a new file to
Documentation/arm64/ which describes some potential caveats when using
tagged virtual addresses.

Change-Id: I4c025d026144c69a2259b6562e46176f95b4e110
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agostaging: android: binder: Add binder compat handling to binder.h
Serban Constantinescu [Wed, 4 Dec 2013 18:09:40 +0000 (18:09 +0000)]
staging: android: binder: Add binder compat handling to binder.h

This patch adds all the needed compat structures to binder.h. All the
structures defined in this patch mirror the structure and size of 32bit
ones.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Add copy_flat_binder_object()
Serban Constantinescu [Wed, 4 Dec 2013 18:09:39 +0000 (18:09 +0000)]
staging: android: binder: Add copy_flat_binder_object()

This patch adds copy_flat_binder_object macro() that will help
dereference struct flat_binder_object on 64bit systems where the
structure differs between 32bit and 64bit userspace.

This patch is a temporary patch that will be extended with 32bit compat
handling.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Add size_helper() macro
Serban Constantinescu [Wed, 4 Dec 2013 18:09:38 +0000 (18:09 +0000)]
staging: android: binder: Add size_helper() macro

This patch adds size_helper() macro that will be used for indexing into
different buffers on 64bit systems where the size of particular
structures will differ depending on the userspace used (32bit /64bit).

This patch is a temporary patch that will be extended with 32bit compat
handling.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Add deref_helper() macro
Serban Constantinescu [Wed, 4 Dec 2013 18:09:37 +0000 (18:09 +0000)]
staging: android: binder: Add deref_helper() macro

This patch adds a deref_helper() macro that will be used to dereference
the binder offsets on 64bit systems where the offset is either a 32bit
or a 64bit value, depending on the userpace used (32bit /64bit)

This patch is a temporary patch that will be extended with 32bit compat
handling.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Add align_helper() macro
Serban Constantinescu [Wed, 4 Dec 2013 18:09:36 +0000 (18:09 +0000)]
staging: android: binder: Add align_helper() macro

This patch adds align_helper() macro that will be used for enforcing
the desired alignment on 64bit systems where the alignment will differ
depending on the userspace used (32bit /64bit).

This patch is a temporary patch that will be extended with 32bit compat
handling.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Add cmd == CMD_NAME handling
Serban Constantinescu [Wed, 4 Dec 2013 18:09:35 +0000 (18:09 +0000)]
staging: android: binder: Add cmd == CMD_NAME handling

This patch modifies the functions that need to be passed the explicit
command to use a boolean flag. This way we can reuse the code for 64bit
compat commands.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Add binder_copy_to_user()
Serban Constantinescu [Wed, 4 Dec 2013 18:09:34 +0000 (18:09 +0000)]
staging: android: binder: Add binder_copy_to_user()

This patch adds binder_copy_to_user() to be used for copying binder
commands to user address space. This way we can abstract away the
copy_to_user() calls and add separate handling for the compat layer.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Move some of the logic into subfunction
Serban Constantinescu [Wed, 4 Dec 2013 18:09:33 +0000 (18:09 +0000)]
staging: android: binder: Move some of the logic into subfunction

This patch moves some of the logic for binder_thread_write() into
subfunctions. This way we can share more code with the binder compat
layer.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoMerge commit 'refs/changes/28/79228/1' of https://android.googlesource.com/kernel...
John Stultz [Thu, 16 Jan 2014 20:30:20 +0000 (12:30 -0800)]
Merge commit 'refs/changes/28/79228/1' of https://android.googlesource.com/kernel/common into linaro-fixes/android-3.10-binder-compat

Pull in Serban's syncing android-3.10 w/ upstream binder cleanups

Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: fix ABI for 64bit Android
Serban Constantinescu [Wed, 15 Jan 2014 11:28:36 +0000 (11:28 +0000)]
staging: android: binder: fix ABI for 64bit Android

This patch fixes the ABI for 64bit Android userspace.
BC_REQUEST_DEATH_NOTIFICATION and BC_CLEAR_DEATH_NOTIFICATION claim
to be using struct binder_ptr_cookie, but they are using a 32bit handle
and a pointer.

On 32bit systems the payload size is the same as the size of struct
binder_ptr_cookie, however for 64bit systems this will differ. This
patch adds struct binder_handle_cookie that fixes this issue for 64bit
Android.

Since there are no 64bit users of this interface that we know of this
change should not affect any existing systems.

Change-Id: I8909cbc50aad48ccf371270bad6f69ff242a8c22
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
10 years agostaging: android: binder: fix binder interface for 64bit compat layer
Serban Constantinescu [Thu, 4 Jul 2013 09:54:48 +0000 (10:54 +0100)]
staging: android: binder: fix binder interface for 64bit compat layer

The changes in this patch will fix the binder interface for use on 64bit
machines and stand as the base of the 64bit compat support. The changes
apply to the structures that are passed between the kernel and
userspace.

Most of the  changes applied mirror the change to struct binder_version
where there is no need for a 64bit wide protocol_version(on 64bit
machines). The change inlines with the existing 32bit userspace(the
structure has the same size) and simplifies the compat layer such that
the same handler can service the BINDER_VERSION ioctl.

Other changes make use of kernel types as well as user-exportable ones
and fix format specifier issues.

The changes do not affect existing 32bit ABI.

Change-Id: Icccc8d47c302930cc61cddc5749b4cc74dc84117
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: replace types with portable ones
Serban Constantinescu [Thu, 4 Jul 2013 09:54:47 +0000 (10:54 +0100)]
staging: android: binder: replace types with portable ones

Since this driver is meant to be used on different types of processors
and a portable driver should specify the size a variable expects to be
this patch changes the types used throughout the binder interface.

We use "userspace" types since this header will be exported and used by
the Android filesystem.

The patch does not change in any way the functionality of the binder driver.

Change-Id: Ib26daab8bc44b92d4a09badc8ecb64d37ee8773b
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: fix alignment issues
Serban Constantinescu [Thu, 4 Jul 2013 09:54:46 +0000 (10:54 +0100)]
staging: android: binder: fix alignment issues

The Android userspace aligns the data written to the binder buffers to
4bytes. Thus for 32bit platforms or 64bit platforms running an 32bit
Android userspace we can have a buffer looking like this:

platform    buffer(binder_cmd   pointer)      size
32/32                 32b         32b          8B
64/32                 32b         64b          12B
64/64                 32b         64b          12B

Thus the kernel needs to check that the buffer size is aligned to 4bytes
not to (void *) that will be 8bytes on 64bit machines.

The change does not affect existing 32bit ABI.

Change-Id: I7535f07301519623ea6334f525d312d687407ed4
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: fix BC_FREE_BUFFER ioctl declaration
Serban Constantinescu [Thu, 4 Jul 2013 09:54:45 +0000 (10:54 +0100)]
staging: android: binder: fix BC_FREE_BUFFER ioctl declaration

BinderDriverCommands mirror the ioctl usage. Thus the size of the
structure passed through the interface should be used to generate the
ioctl No.

The change reflects the type being passed from the user space-a pointer
to a binder_buffer. This change should not affect the existing 32bit
user space since BC_FREE_BUFFER is computed as:

   #define _IOW(type,nr,size)         \
      ((type) << _IOC_TYPESHIFT) |    \
      ((nr)   << _IOC_NRSHIFT) |      \
      ((size) << _IOC_SIZESHIFT))

and for a 32bit compiler BC_FREE_BUFFER will have the same computed
value. This change will also ease our work in differentiating
BC_FREE_BUFFER from COMPAT_BC_FREE_BUFFER.

The change does not affect existing 32bit ABI.

Change-Id: I2e0ae87bc4e913225a8eb2912913f7e3617cb575
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: fix BINDER_SET_MAX_THREADS declaration
Serban Constantinescu [Thu, 4 Jul 2013 09:54:44 +0000 (10:54 +0100)]
staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

This change will fix the BINDER_SET_MAX_THREADS ioctl to use __u32
instead of size_t for setting the max threads. Thus using the same
handler for 32 and 64bit kernels.

This value is stored internally in struct binder_proc and set to 15
on open_binder() in the libbinder API(thus no need for a 64bit size_t
on 64bit platforms).

The change does not affect existing 32bit ABI.

Change-Id: Ibdfe10a70d475a91c247dc36e9cfd74a259d50e4
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: binder: modify struct binder_write_read to use size_t
Serban Constantinescu [Thu, 4 Jul 2013 09:54:43 +0000 (10:54 +0100)]
staging: android: binder: modify struct binder_write_read to use size_t

This change mirrors the userspace operation where struct binder_write_read
members that specify the buffer size and consumed size are size_t elements.

The patch also fixes the binder_thread_write() and binder_thread_read()
functions prototypes to conform with the definition of binder_write_read.

The changes do not affect existing 32bit ABI.

Change-Id: I987246d507b9c5e4627c62a1da971d11869ac5a0
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Tue, 14 Jan 2014 20:48:50 +0000 (12:48 -0800)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agoion: Add carveout and chunk heaps to dummy driver
John Stultz [Sat, 23 Nov 2013 03:45:31 +0000 (19:45 -0800)]
ion: Add carveout and chunk heaps to dummy driver

Add support to the dummy driver for basic carveout and chunk heaps.

Since we're generating these heaps at module_init, and we want
this driver to be generic enough to be tested on any arch, we
don't have the ability to alloc bootmem, so both of these heaps
are conventionally allocated using alloc_pages(), which limits us
to 4M in size.

Should look into using CMA for heap allocation eventually, but
this provides enough to test the basic functionality of the
heaps.

Cc: Colin Cross <ccross@android.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Jesse Barker <jesse.barker@arm.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoion: Add dummy driver for testing
John Stultz [Fri, 8 Nov 2013 00:08:52 +0000 (16:08 -0800)]
ion: Add dummy driver for testing

Provide a basic dummy driver to register the ion device
and to install basic SYSTEM and SYSTEM_CONTIG heaps.

This allows for basic testing with ION without having
access to drivers or systems that have been enabled to use
ION.

Cc: Colin Cross <ccross@android.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Jesse Barker <jesse.barker@arm.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Tue, 14 Jan 2014 00:37:35 +0000 (16:37 -0800)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agoRevert "PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock"
Ajay Nandakumar [Thu, 25 Apr 2013 08:42:29 +0000 (14:12 +0530)]
Revert "PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock"

This reverts commit 11388c87d2abca1f01975ced28ce9eacea239104.

The issue is that no wake lock is held at the user space i.e by Power
Manager service.This is because the PowerManagerService fails to
acquire the Wakelock.In 3.8 the wakelock module in the kernel expects
the user process to have the capability of CAP_BLOCK_SUSPEND.Which the
powermangersevice does not have.

Bug 1274297
Bug 1384311

Change-Id: I3b696108d47278cf40abce8d5a9bd012f98f2925
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
(cherry picked from commit e8464e785027a15279a13e6e32cd1aecd22d5a00)
Reviewed-on: http://git-master/r/282698
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
10 years agoandroid: configs: add IPV6 ROUTE INFO
JP Abgrall [Tue, 7 Jan 2014 22:25:28 +0000 (14:25 -0800)]
android: configs: add IPV6 ROUTE INFO

Change-Id: I54cba86bce703647c4be8eee5592d55374ad02ef
Signed-off-by: JP Abgrall <jpa@google.com>
(cherry picked from commit 5e35d662616142d308ce24c9d552e469f60d8695)

10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk
John Stultz [Fri, 3 Jan 2014 21:22:53 +0000 (13:22 -0800)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android-3.10-lsk

10 years agoMerge branch 'upstream/android-3.10' into linaro-fixes/android-3.10
John Stultz [Fri, 3 Jan 2014 04:11:06 +0000 (20:11 -0800)]
Merge branch 'upstream/android-3.10' into linaro-fixes/android-3.10

10 years agocpufreq: interactive: fix compiling warnings
Chih-Wei Huang [Tue, 24 Dec 2013 09:51:55 +0000 (17:51 +0800)]
cpufreq: interactive: fix compiling warnings

The gcc warns like:

  cpufreq_interactive.c:745:6: warning: operation on 'ret' may be undefined [-Wsequence-point]

It was introduced by commit cf0fad49d17cb8273ce555dd5b7afab67d7923bf.

Since sprintf(...) just return 1 (one character) in this case, ret should not changed.
Just discarding the result of sprintf(...) leads to the result that
the committer of cf0fad49d17cb8273ce555dd5b7afab67d7923bf wants.

Change-Id: Ifed1cef6d6a31c3ed23dad03a567b3b9eddf3a57
Signed-off-by: Chih-Wei Huang <cwhuang@android-x86.org>
10 years agoandroid: configs: add TIMER_STATS back, helps with sysrq t.
JP Abgrall [Fri, 27 Dec 2013 23:20:32 +0000 (15:20 -0800)]
android: configs: add TIMER_STATS back, helps with sysrq t.

Change-Id: I8fe033090e38523152225dcfb7a1828f530a0757
Signed-off-by: JP Abgrall <jpa@google.com>
(cherry picked from commit 7aee29d6482954ac9fecae3ce8a90b6759158107)

10 years agoion: fix overflow and list bugs in system heap
Colin Cross [Fri, 20 Dec 2013 02:37:49 +0000 (18:37 -0800)]
ion: fix overflow and list bugs in system heap

Fix a few bugs in ion_system_heap:

Initialize the list node in the info block.

Don't store size_remaining in a signed long, allocating >2GB
could overflow, resulting in a call to sg_alloc_table with
nents=0 which panics.  alloc_largest_available will never
return a block larger than size_remanining, so it can never
go negative.

Limit a single allocation to half of all memory.  Prevents a
large allocation from taking down the whole system.

Change-Id: I7fcbd7e1d5b4d482d7612d80b6c9e8e24466f1d8
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: Add private buffer flag to skip page pooling on free
Mitchel Humpherys [Tue, 6 Aug 2013 22:08:23 +0000 (15:08 -0700)]
ion: Add private buffer flag to skip page pooling on free

Currently, when we free a buffer it might actually just go back into a
heap-specific page pool rather than going back to the system. This poses
a problem because sometimes (like when we're running a shrinker in low
memory conditions) we need to force the memory associated with the
buffer to truly be relinquished to the system rather than just going
back into a page pool.

There isn't a use case for this flag by Ion clients, so make it a
private flag. The main use case right now is to provide a mechanism for
the deferred free code to force stale buffers to bypass page pooling.

Change-Id: I724f89cc037083fe8576784363caa18a34e8705a
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
10 years agogpu: ion: make sure all clients are exposed in debugfs
Mitchel Humpherys [Mon, 7 Oct 2013 16:24:29 +0000 (09:24 -0700)]
gpu: ion: make sure all clients are exposed in debugfs

Currently, if multiple Ion clients are created with the same name, only
the first one shows up in debugfs. Rectify this by adding a
monotonically-increasing serial number to the debug names of Ion
clients.

Change-Id: I000e45055d5029c7bccd88c36b238736929da3a5
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
10 years agoion: store a copy of the client name on client creation
Mitchel Humpherys [Thu, 19 Dec 2013 06:10:07 +0000 (22:10 -0800)]
ion: store a copy of the client name on client creation

Currently, we copy the pointer passed in to ion_client_create without
making a copy of the string itself. This approach is problematic since
it relies on the client keeping the name string in working order.

Change-Id: I62d79c7539b2c857a5a625339d49c9c892e8622d
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
10 years agogpu: ion: Fix debugfs handling of multiple kernel clients
Laura Abbott [Mon, 5 Dec 2011 23:32:36 +0000 (15:32 -0800)]
gpu: ion: Fix debugfs handling of multiple kernel clients

Currently, Ion registers all debugfs entries for clients
via pid. If there are multiple kernel clients, this means
the debugfs entry only gets created for the first one. Fix
this by creating debugfs entries by name always. When
creating user clients, specify the name via the pid.

Change-Id: I00cbb284d1c53b3362bb7be9c0275620a9fac167
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
10 years agogpu: ion: create separate heap and client debugfs directories
Mitchel Humpherys [Thu, 29 Aug 2013 22:28:58 +0000 (15:28 -0700)]
gpu: ion: create separate heap and client debugfs directories

It can be slightly annoying to figure out which files under the ion
debugfs directory are heap debug files and which ones are client debug
files. Create separate subdirectories under ion to hold the different
types of debug files.

Change-Id: Ic773ab619ef94b9b4d0f3794def9d37645c7c212
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
10 years agoion: move shrinker out of heaps
Colin Cross [Fri, 13 Dec 2013 01:50:35 +0000 (17:50 -0800)]
ion: move shrinker out of heaps

Every heap that uses deferred frees is going to need a shrinker
to shrink the freelist under memory pressure.  Rather than
requiring each heap to implement a shrinker, automatically
register a shrinker if the deferred free flag is set.
The system heap also needs to shrink its page pools, so add
a shrink function to the heap ops that will be called after
shrinking the freelists.

Change-Id: Icda722d683426fadb8ddd1c8e9499264ab682c57
Signed-off-by: Colin Cross <ccross@android.com>