net: core: Support UID-based routing.

This contains the following commits:

1. 0149763 net: core: Add a UID range to fib rules.
2. 1650474 net: core: Use the socket UID in routing lookups.
3. 0b16771 net: ipv4: Add the UID to the route cache.
4. ee058f1 net: core: Add a RTA_UID attribute to routes.
    This is so that userspace can do per-UID route lookups.

Bug: 15413527
Change-Id: I1285474c6734614d3bda6f61d88dfe89a4af7892
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Git-commit: 0b428749ce5969bc06c73855e360141b4e7126e8
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Handle 'sk' being NULL in UID-based routing.

Bug: 15413527
Change-Id: If33bebb7b52c0ebfa8dac2452607bce0c2b0faa0
Signed-off-by: Sreeram Ramachandran <sreeram@google.com>
Git-commit: 0836a0c191f580ed69254e0b287cdce58481e978
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Ian Maund <imaund@codeaurora.org>
defconfig: enable selinux develop for all brethren

* allows us to set selinux permissive for development

Change-Id: Iefecd56caabdd3daf7dd08316054f070eb42ae4d
nl80211: nl80211hdr_put() doesn't return an ERR_PTR

There are a few places which check nl80211hdr_put() for an ERR_PTR
but actually it returns NULL on error and never error values.  In
nl80211_testmode_dump() the return wasn't checked at all so I have
added one.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[some whitespace changes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: cb35fba360dfc3496e5d8a47e23ec5ccdfd90925
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Change-Id: I5da1aafea35110a1ce606d402b1b96859d34b869
[akholaif@codeaurora.org: resolved conflicts manually]
Signed-off-by: Ahmad Kholaif <akholaif@codeaurora.org>
nl80211: fix error path in nl80211_get_key()

Coverity pointed out that in the (practically impossible)
error case we leak the message - fix this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 9fe271af7d4de96471c5aaee2f4d0d1576050497
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Change-Id: I78c3631eabd04e86872faf65fa1e401dadb35a75
Signed-off-by: Ahmad Kholaif <akholaif@codeaurora.org>
Enable NEED_NETDEV for vendor command support.

The Vendor command needs to have the NEED_NETDEV internal flag set
for the corresponding vendor_cmd function to initialize correctly
and call the vendor subcommand specific doit function.

Change-Id: Icc46438dc9467fe0344cb832633c49466e2d20d0
CRs-fixed: 633799
Signed-off-by: Subhani Shaik <subhanis@codeaurora.org>
HID: input: generic hidinput_input_event handler

The hidinput_input_event() callback converts input events written from
userspace into HID reports and sends them to the device. We currently
implement this in every HID transport driver, even though most of them do
the same.

This provides a generic hidinput_input_event() implementation which is
mostly copied from usbhid. It uses a delayed worker to allow multiple LED
events to be collected into a single output event.
We use the custom ->request() transport driver callback to allow drivers
to adjust the outgoing report and handle the request asynchronously. If no
custom ->request() callback is available, we fall back to the generic raw
output report handler (which is synchronous).

Drivers can still provide custom hidinput_input_event() handlers (see
logitech-dj) if the generic implementation doesn't fit their needs.

Conflicts:
	drivers/hid/hid-input.c

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Michael Wright <michaelwr@google.com>
Change-Id: I89ccc3f675b3e8a7bbd812a6ebe12588d737cfd6
crypto: msm: check potential integer overflow

According to the specification of AEAD, AEAD request crypt length is
not a fixed maximum and associated length is also same. This could
lead to potential integer overflow, thus allocating less memory. So
we need to check potential integer overflow on AEAD request length.

CRs-Fixed: 726872
Change-Id: Ie7708000bfd8c57e2fba8e02230a7ce9cdc9634c
Signed-off-by: William Clark <wclark@codeaurora.org>
cpufreq: Avoid using global variable total_cpus

The change is to compile on kernels where cpufreq stats are compiled as
a module (CONFIG_CPU_FREQ_STAT=m), because total_cpus is not exported for
module use.

Reported-By: Emilio López <elopez93@gmail.com>
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Change-Id: I4f3c74f0fac5e8d9449655b26bf3b407b0fe4290
net: ipv6: Add a sysctl to make optimistic addresses useful candidates

Add a sysctl that causes an interface's optimistic addresses
to be considered equivalent to other non-deprecated addresses
for source address selection purposes.  Preferred addresses
will still take precedence over optimistic addresses, subject
to other ranking in the source address selection algorithm.

This is useful where different interfaces are connected to
different networks from different ISPs (e.g., a cell network
and a home wifi network).

The current behaviour complies with RFC 3484/6724, and it
makes sense if the host has only one interface, or has
multiple interfaces on the same network (same or cooperating
administrative domain(s), but not in the multiple distinct
networks case.

For example, if a mobile device has an IPv6 address on an LTE
network and then connects to IPv6-enabled wifi, while the wifi
IPv6 address is undergoing DAD, IPv6 connections will try use
the wifi default route with the LTE IPv6 address, and will get
stuck until they time out.

Also, because optimistic nodes can receive frames, issue
an RTM_NEWADDR as soon as DAD starts (with the IFA_F_OPTIMSTIC
flag appropriately set).  A second RTM_NEWADDR is sent if DAD
completes (the address flags have changed), otherwise an
RTM_DELADDR is sent.

Also: add an entry in ip-sysctl.txt for optimistic_dad.

[backport of net-next 7fd2561e4ebdd070ebba6d3326c4c5b13942323f]

Signed-off-by: Erik Kline <ek@google.com>
Acked-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Bug: 17769720
Change-Id: I440a9b8c788db6767d191bbebfd2dff481aa9e0d
net: kernel start time optimization

Disabling specific netfilter functionality through config
parameters to reduce the kernel start time.

Change-Id: I547cb3f45937fcaf9cb4a7500063c8d271d789ab
Signed-off-by: Narendra Babu Atmakuri <natmak@codeaurora.org>
USB: android: kernel start time optimization

USB accessory related functionality is removed, it is saving some time
during module initialization, binding and controlling of the accessory
related functionality.

Change-Id: I21c3f42821e06d28869dc2fd5b4e1047dad931f6
Signed-off-by: Narendra Babu Atmakuri <natmak@codeaurora.org>
libata: fix uninitialized usage of a variable

Fix following warning -

"kernel/drivers/ata/libata-core.c:1394:3: warning: 'native_sectors'
may be used uninitialized in this function [-Wmaybe-uninitialized]
error, forbidden warning: libata-core.c:1394"

Change-Id: Ide8b3c671f81344533f95e73d93c64ecb4578122
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
mmc: msm_sdcc: don't return error if regulator info is not available

On some platforms, few SDCC slots may be powered by always-on regulators
on board and in this case, regulator info for such SDCC slot is not
defined as part of their platform data. So let's not return error from
driver if regulator info is not present for a SDCC slot.

Change-Id: I902a322538d7400b5ce7fc33b1cf90a9cc4d6bfd
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
ata: ahci_platform: Register as hot-pluggable module

Even though AHCI controller is part of SoC in most chipsets
it is not safe to assume that AHCI device is registered before
AHCI module init is called. Register AHCI platform driver as
hot-pluggable module so that the device, driver match
can happen in any order.

Change-Id: Ifcafba0d49f01c7b31853e136e414866eca9ce99
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
ata: ahci_platform: Enable runtime power management

Provide runtime power management callbacks for AHCI device.
The runtime power management will be disabled by default
due to regressions in hot plug functionality, but userspace
can enable it by echo'ing into following sysfs entry:

echo auto > /sys/devices/platform/ahci.X/power/control

Change-Id: I8421fc1369b45eb76dd0773a512984fd4fee99b4
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
msm_fb: display: allow display bootup when splash memory remap fails

Boot to android animation by allowing the failure of remapping the
address of splash content from bootloader. This remapping and copy of
content was intended not to display corrupt splash content, so failure
to do so should not block the system boot up.

Change-Id: Ied510d483a30ce2a21895af852a7efdaf8f534ea
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
input: atmel_mxt_ts: support touch screen on ADP platform

Touchscreen may have new interface to MSM along with regulator
support and reset pin requirement. The delta requires driver
change to enable touch screen.

Change-Id: I5fe13eb05ac5a46e37cbf8b30029e1d394e80d55
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
input: atmel_mxt_ts: Move fpdlink config into kernel

Move fpdlink and IO expander config logic from bootloader
to kernel to optimize bootloader boot time.

Change-Id: Ieda085d721c031d1a212769045121a04f35da9ad
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
bitops: introduce generic {clear,set}_bit_le()

Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is
being used for this missing function.

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>