netfilter: xt_qtaguid: remove AID_* dependency for access control

qtaguid limits what can be done with /ctrl and /stats based on group
membership.
This changes removes AID_NET_BW_STATS and AID_NET_BW_ACCT, and picks
up the groups from the gid of the matching proc entry files.

Signed-off-by: JP Abgrall <jpa@google.com>
Change-Id: I42e477adde78a12ed5eb58fbc0b277cdaadb6f94
cpufreq: interactive: fix race on governor start/stop

There is race condition when both two cpu do CPUFREQ_GOV_STOP and one cpu
do CPUFREQ_GOV_START soon. The sysfs_remove_group is not done yet on one
cpu, but sysfs_create_group is called on another cpu, which cause governor
start failed and then kernel panic in timer callback because the policy and
cpu mask are all kfree in cpufreq driver.

Replace atomic with mutex to lock the whole START/STOP sequence.

Change-Id: I3762b3d44315ae021b8275aca84f5ea9147cc540
Signed-off-by: Lianwei Wang <a22439@motorola.com>
sync: Fix race condition between merge and signal

The copied sync_pt was activated immediately. If the sync_pt was
signaled before the entire merge was completed, the new fence's pt_list
could be iterated over while it is still in the process of being
created.

Moving the the sync_pt_activate call for all new sync_pts to after both
the sync_fence_copy_pts and the sync_fence_merge_pts calls ensure that
the pt_list is complete and immutable before it can be reached from the
timeline's active list.

Signed-off-by: Erik Gilling <konkers@android.com>
gpu: ion: Refactor the code to zero buffers

Refactor the code in the system heap used to map and zero the buffers
into a seperate utility so it can be called from other heaps.  Use it from
the chunk heap.

Change-Id: I706341ae42b80bc4aae8a8614b4f73435bbf05d9
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
gpu: ion: Only flush buffers in the chunk heap if they were used cached

Change-Id: I4ffcf81a6be09e968310bbd882fb017415d61b48
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
net: wireless: bcmdhd: Fix PEAP with dynamic WEP

Change-Id: I62dffdb3b759ea5ccdf9f7ea0f0e67f928ace92b
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Update to Version 1.28-24

- P2P: Improve provision discovery probing
- Add optional dhd_dpcpoll to improve performance
- Return proper err in wl_cfg80211_attach

Change-Id: I877fc2ff4de2e43b33fdd688cd7309924f7c3722
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
netfilter: xt_qtaguid: extend iface stat to report protocols

In the past the iface_stat_fmt would only show global bytes/packets
for the skb-based numbers.
For stall detection in userspace, distinguishing tcp vs other protocols
makes it easier.
Now we report
  ifname total_skb_rx_bytes total_skb_rx_packets total_skb_tx_bytes
  total_skb_tx_packets {rx,tx}_{tcp,udp,ohter}_{bytes,packets}

Bug: 6818637
Signed-off-by: JP Abgrall <jpa@google.com>
sync: don't log wait timeouts when timeout = 0

Signed-off-by: Erik Gilling <konkers@android.com>
net: wireless: bcmdhd: Update to Version 1.28-27

- Disable SDIO in-band interrupt explicitly to avoid problems
  with SDIO Host when generating SDIO Interrupt on DAT1 created
  unwanted CRC error
- Fix handling when bcmsdh_probe() called twice
- Fix handling the packet list properly in the corner cases
- Remove unnecessary delay during P2P connection process
- Fix issue finding peer with VSDB
- Get AP beacon and DTIM to set proper DTIM skipping

Change-Id: I7ee923727d0c3ad34c83b5ec1dda8e2aa5ea5834
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
netfilter: xt_qtaguid: Allow tracking loopback

In the past it would always ignore interfaces with loopback addresses.
Now we just treat them like any other.
This also helps with writing tests that check for the presence
of the qtaguid module.

Signed-off-by: JP Abgrall <jpa@google.com>
base: sync: Include seq_file.h in sync.h

sync.h uses struct seq_file in some function table prototypes. This
causes compile failures when including the header in files that do not
otherwise include seq_file.h

Signed-off-by: Jonathan Hamilton <jonathan.hamilton@imgtec.com>
net: wireless: bcmdhd: Fix SUPPORT_PM2_ONLY option for p2p

Change-Id: I1db584aa5284adc8ab156e4690891bba3a1c3b91
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
power: android-battery: remove ac and usb supplies

Should no longer need to fix up AC/USB online state via these.

Change-Id: I48d2ef0fbefee58cb47eafc11d9a44759920df7a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
power: android-battery: push uevent whenever charge source changes

Ensure userspace reads an up-to-date value for charging status whenever the
charge source is updated.  Avoid races where stale charging state may be
reflected in userspace until the next battery state poll.

Change-Id: Ia744db48584e9e9abf442710c279af9e3a25c079
Signed-off-by: Todd Poynor <toddpoynor@google.com>
sync: fix timeout = 0 wait behavior

Change-Id: I8b9254e92c26d9f44abbc0c77fb44624de947013
Signed-off-by: Jamie Gennis <jgennis@google.com>
net: bluetooth: Remove the AID_NET_BT* gid numbers

Removed bluetooth checks for AID_NET_BT and AID_NET_BT_ADMIN
which are not useful anymore.
This is in preparation for getting rid of all the AID_* gids.

Signed-off-by: JP Abgrall <jpa@google.com>
gpu: ion: Add support for sharing buffers with dma buf kernel handles

Currently ion can only share buffers with dma buf fd's. Fd's can not be
used inside the kernel as they are process specific so support for
sharing buffers with dma buf kernel handles is needed to support kernel
only use cases. An example use case could be a GPU driver using ion
that wants to share its output buffers with a 3d party display
controller driver supporting dma buf.

Change-Id: If1b3753ddbd5b44c5a3e622055d5473e16fc1c48
Signed-off-by: Johan Mossberg <johan.mossberg@stericsson.com>
sock_diag: Fix out-of-bounds access to sock_diag_handlers[]

Userland can send a netlink message requesting SOCK_DIAG_BY_FAMILY
with a family greater or equal then AF_MAX -- the array size of
sock_diag_handlers[]. The current code does not test for this
condition therefore is vulnerable to an out-of-bound access opening
doors for a privilege escalation.

Signed-off-by: Mathias Krause <minipli <at> googlemail.com>
serial: samsung: fix leaked requested irq

The s3c64xx_serial_startup() requests an IRQ, but the common
s3c24xx_serial_shutdown() would not free it.

s3c64xx_serial_startup() is used when
s3c24xx_serial_has_interrupt_mask(port) is true, at which point
  ourport->rx_claimed = ourport->tx_claimed = 1
so we only need to free in one of the claimed cases.

Change-Id: I8e17ce52cf48dbf3faa26ac24c8a71f016771f32
Signed-off-by: JP Abgrall <jpa@google.com>