summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-03-01arm64: Add pdev_archdata for dmamaskLaura Abbott
The dma_mask for a device structure is a pointer. This pointer needs to be set up before the dma mask can actually be set. Most frameworks in the kernel take care of setting this up properly but platform devices that don't follow a regular bus structure may not ever have this set. As a result, checks such as dma_capable will always return false on a raw platform device and dma_set_mask will always return -EIO. Fix this by adding a dma_mask in the platform_device archdata and setting it to be the dma_mask. Devices used in other frameworks can change this as needed. Change-Id: I5bfd2aa75798dfdf49d3af70fdd95dfaf2126e8c Signed-off-by: Laura Abbott <lauraa@codeaurora.org> [abhimany: resolve trivial merge conflicts] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-01ARM64: smp: fix incorrect per-cpu definition of regs_before_stopRohit Vaswani
The commit f3b4a40bc637a25c01c5ec66c825b4ddfc30328a introduced changes to store CPU registers for all CPUs that handle IPI_CPU_STOP. The structure to save the registers was intended to be a per-cpu variable. However, the patch did not allocate a per-cpu structure and instead only ended up providing a compiler per-cpu directive. Fix this bug by actually defining a static per-cpu variable. Change-Id: Iea7e52e91819f6f2c7f8d2c638545c0a68d2ef76 Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2016-03-01ARM64: smp: BUG() if smp_send_reschedule() is called for an offline cpuTrilok Soni
Based on the commit 8b775be35e41b9ffa764411a632b52015d1e3d69 Sending an IPI_RESCHEDULE to an offline CPU is incorrect and potentially bad for both power and stability. On some sub-architectures such as MSM, if a power-collapsed CPU is unexpectedly woken up by an IPI, it will be begin executing without the preparations that would normally happen as part of CPU_UP_PREPARE. If clocks, voltage regulators, or other hardware configuration are not performed, the booting CPU may cause general instability or (at best) poor power performance since the CPU would be powered up but not utilized. One common cause for such issues is misuse of add_timer_on() or APIs such as queue_work_on() which call it. If proper precautions are not taken to block hotplug while these APIs are called then a race may result in IPIs being sent to CPUs that are already offline. This same argument could be applied to other IPIs (with the exception of IPI_WAKEUP), but the others are already restricted to only online CPUs by existing mechanisms, so an explicit assertion is not useful. Change-Id: I2607082719b4cb216e53fb354649ea4c5c875b1e Signed-off-by: Matt Wagantall <mattw@codeaurora.org> Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-03-01ARM64: smp: Save CPU registers before IPI_CPU_STOP processingRohit Vaswani
When a kernel panic occurs on one CPU, other CPUs are instructed to stop execution via the IPI_CPU_STOP message. These other CPUs dump their stack, which may not be good enough to reconstruct their context to perform post-mortem analysis. Dump each CPU's context (before it started procesing the IPI) into a globally accessible structure and print them on the dmesg/console to allow for easier post-mortem debugging. Change-Id: Ifd7589af4327992540196c87f8b640045d7eaf19 Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org> [abhimany: resolve trivial merge conflic] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-01arm64: alternative: Support memory protectionPatrick Daly
Modify the kernel code section with fixmap to handle the case where the kernel text section is readonly. Change-Id: I3f81fcbfe917ef42783e55b107289ad97e1c02c3 Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2016-02-25net: diag: support v4mapped sockets in inet_diag_find_one_icsk()Eric Dumazet
Lorenzo reported that we could not properly find v4mapped sockets in inet_diag_find_one_icsk(). This patch fixes the issue. [cherry-pick of fc439d9489479411fbf9bbbec2c768df89e85503] Change-Id: I13515e83fb76d4729f00047f9eb142c929390fb2 Reported-by: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com>
2016-02-25net: tcp: deal with listen sockets properly in tcp_abort.Lorenzo Colitti
When closing a listen socket, tcp_abort currently calls tcp_done without clearing the request queue. If the socket has a child socket that is established but not yet accepted, the child socket is then left without a parent, causing a leak. Fix this by setting the socket state to TCP_CLOSE and calling inet_csk_listen_stop with the socket lock held, like tcp_close does. Tested using net_test. With this patch, calling SOCK_DESTROY on a listen socket that has an established but not yet accepted child socket results in the parent and the child being closed, such that they no longer appear in sock_diag dumps. [cherry-pick of net-next 2010b93e9317cc12acd20c4aed385af7f9d1681e] Change-Id: I0555a142f11d8b36362ffd7c8ef4a5ecae8987c9 Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-25tcp: diag: add support for request sockets to tcp_abort()Eric Dumazet
Adding support for SYN_RECV request sockets to tcp_abort() is quite easy after our tcp listener rewrite. Note that we also need to better handle listeners, or we might leak not yet accepted children, because of a missing inet_csk_listen_stop() call. [cherry-pick of net-next 07f6f4a31e5a8dee67960fc07bb0b37c5f879d4d] Change-Id: I8ec6b2e6ec24f330a69595abf1d5469ace79b3fd Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Lorenzo Colitti <lorenzo@google.com> Tested-by: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-25net: diag: Support destroying TCP sockets.Lorenzo Colitti
This implements SOCK_DESTROY for TCP sockets. It causes all blocking calls on the socket to fail fast with ECONNABORTED and causes a protocol close of the socket. It informs the other end of the connection by sending a RST, i.e., initiating a TCP ABORT as per RFC 793. ECONNABORTED was chosen for consistency with FreeBSD. [cherry-pick of net-next c1e64e298b8cad309091b95d8436a0255c84f54a] Change-Id: I728a01ef03f2ccfb9016a3f3051ef00975980e49 Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-25net: diag: Support SOCK_DESTROY for inet sockets.Lorenzo Colitti
This passes the SOCK_DESTROY operation to the underlying protocol diag handler, or returns -EOPNOTSUPP if that handler does not define a destroy operation. Most of this patch is just renaming functions. This is not strictly necessary, but it would be fairly counterintuitive to have the code to destroy inet sockets be in a function whose name starts with inet_diag_get. [backport of net-next 6eb5d2e08f071c05ecbe135369c9ad418826cab2] Change-Id: Idc13a7def20f492a5323ad2f8de105426293bd37 Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-25net: diag: Add the ability to destroy a socket.Lorenzo Colitti
This patch adds a SOCK_DESTROY operation, a destroy function pointer to sock_diag_handler, and a diag_destroy function pointer. It does not include any implementation code. [backport of net-next 64be0aed59ad519d6f2160868734f7e278290ac1] Change-Id: Ic5327ff14b39dd268083ee4c1dc2c934b2820df5 Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-25net: diag: split inet_diag_dump_one_icsk into twoLorenzo Colitti
Currently, inet_diag_dump_one_icsk finds a socket and then dumps its information to userspace. Split it into a part that finds the socket and a part that dumps the information. [cherry-pick of net-next b613f56ec9baf30edf5d9d607b822532a273dad7] Change-Id: I144765afb6ff1cd66eb4757c9418112fb0b08a6f Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-24Revert "mmc: Extend wakelock if bus is dead"Dmitry Shmidt
This reverts commit dde72f9e313fc52d467ef0aad41cecd2c9f9f212.
2016-02-24Revert "mmc: core: Hold a wake lock accross delayed work + mmc rescan"Dmitry Shmidt
Patch mmc: core: Signal wakeup event at card insert/removal provides wake lock for mmc_detect_change() This reverts commit bec7bcbb707d10b80d450f6f02384efeff294799.
2016-02-22ANDROID: mmc: move to a SCHED_FIFO threadTim Murray
(cherry picked from commit 011e507b413393eab8279dac8b778ad9b6e9971b) Running mmcqd as a prio 120 thread forces it to compete with standard user processes for IO performance, especially when the system is under severe CPU load. Move it to a SCHED_FIFO thread to reduce the impact of load on IO performance. Signed-off-by: Tim Murray <timmurray@google.com> Bug: 25392275 Change-Id: I1edfe73baa25e181367c30c1f40fee886e92b60d
2016-02-16android: base-cfg: Add CONFIG_IP_MULTICASTMark Salyzyn
(cherry pick from commit 1d0f72986958c2bf3528cadf7d7acf0771465fd1) Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 19173869 Change-Id: I4ccd6161e87df7a87f3bd990cfe1de1f7567bf4c
2016-02-16android: recommended.cfg: enable taskstatsMark Salyzyn
CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y CONFIG_TASK_IO_ACCOUNTING=y Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 21334988 Bug: 26966375 Change-Id: Id54be2aad6acdb51040ba613d5d987dd693cd591
2016-02-16ANDROID: android: base-cfg: disable CONFIG_SYSVIPCGreg Hackmann
Android SELinux policies block SysV IPC. New kernels should not be built with it. Bug: 22300191 Change-Id: Ia4bcb179ff71825cab19eed603d4064a8d061a93 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-02-16android: configs: base: enable configfs gadget functionsAmit Pundir
Now that Android is moving towards ConfigFS based USB gadgets, lets enable USB_CONFIGFS and relevant Android gadget functions instead of obsolete USB_G_ANDROID composite driver which doesn't exist now. Enabled following ConfigFS gadget functions: F_FS for ADB F_MTP/PTP for MTP/PTP F_ACC for Android USB Accessory F_AUDIO_SRC for USB Audio Source F_MIDI for MIDI, and CONFIGFS_UEVENT for communicating USB state change notifications to userspace. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-02-16android: add CONFIG_DEBUG_RODATA to recommended configSami Tolvanen
Change-Id: I520c50f919ac569f537bb445b5e4cb758d55ba8e Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2016-02-16android: configs: remove CONFIG_BATTERY_ANDROID=yDmitry Shmidt
Change-Id: If6bf443fcfb47b79fc9e70f5f6c08cfb3fe0b14e Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2016-02-16android: configs: base: enable IPV6Kevin Hilman
android-base.cfg already enables several IPV6 sub-options, but not the main IPV6 option. Without this, build errors such has this: net/netfilter/xt_qtaguid.c:1591: undefined reference to `xt_socket_get6_sk' occur if the starting defconfig hasn't already enabled IVP6, Change-Id: I265089a2eec1ef8938e0a6fb95e1aacd16d99281 Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Kevin Hilman <khilman@linaro.org>
2016-02-16android: configs: Enable SELinux and its dependencies.Stephen Smalley
Change-Id: I979813b95c0a9a79913df0913e6888f566da5ff1 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-02-16android: base-cfg: disable ALARM_DEVMark Salyzyn
Signed-off-by: Mark Salyzyn <salyzyn@google.com> Change-Id: If8d324ffdb4ebd56e5d68876f8e229547e20eaf8
2016-02-16android: base-cfg: turn off /dev/mem and /dev/kmemMark Salyzyn
Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 19549480 Change-Id: I102804c55b8d5a55036ac05ca366412fd2eaa2c4
2016-02-16android: base-cfg: enable ARMV8_DEPRECATED and subfeaturesGreg Hackmann
ARMV8_DEPRECATED replaces the now-reverted ARMV7_COMPAT in the upstream kernel Change-Id: I5d5cee4e11c01d717692198fa070826930847703 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-02-16android: base-cfg: enforce the needed XFRM_MODE_TUNNEL (for VPN)JP Abgrall
Change-Id: I587023d56877d32806079676790751155c768982 Signed-off-by: JP Abgrall <jpa@google.com>
2016-02-16android: base-cfg: disable LOGGERMark Salyzyn
Bug: 15384806 Change-Id: If8d324ffdb4ebd56e5d68876f8e229547e20eaf4 Signed-off-by: Mark Salyzyn <salyzyn@google.com>
2016-02-16android: base-cfg: enable DM_VERITY (used for secureboot)JP Abgrall
Change-Id: I68d769f97ffa76bb45e65d34a96dd7f558c02d08 Signed-off-by: JP Abgrall <jpa@google.com>
2016-02-16android: configs: add systrace support to recommended configsRom Lemarchand
Change-Id: I4a6e88f47803e88b0ce2d913be4aeb299ca858b4 Signed-off-by: Rom Lemarchand <romlem@android.com>
2016-02-16android: configs: update 3.10 optionsRom Lemarchand
Change-Id: Ifbda55e570a22ace98d7d74b057ba21a597e0826
2016-02-16android: configs: Add CONFIG_NETFILTER_XT_TARGET_IDLETIMERAshish Sharma
Signed-off-by: Ashish Sharma <ashishsharma@google.com> (cherry picked from commit 5621df1091c7e103bca6cdd1dbecf4333efad4e7) Change-Id: I3104266fa648fc024fee45f1ce9800142898baf7
2016-02-16android: configs: add IPV6 ROUTE INFOJP Abgrall
Change-Id: I54cba86bce703647c4be8eee5592d55374ad02ef Signed-off-by: JP Abgrall <jpa@google.com> (cherry picked from commit 5e35d662616142d308ce24c9d552e469f60d8695)
2016-02-16android: configs: add TIMER_STATS back, helps with sysrq t.JP Abgrall
Change-Id: I8fe033090e38523152225dcfb7a1828f530a0757 Signed-off-by: JP Abgrall <jpa@google.com> (cherry picked from commit 7aee29d6482954ac9fecae3ce8a90b6759158107)
2016-02-16android: configs: Add HIDRAW to recommended setMichael Wright
The Logitech unifying driver depends on hidraw being available. Recommending one without the other will cause the Logitech driver to silently fail when connecting Logitech devices. Change-Id: I92ed2b6803537d9da6eed7fcada8f329cb4469a2 Signed-off-by: Michael Wright <michaelwr@google.com>
2016-02-16android: configs: require TCPMSS, remove SCHED_TRACER and TIMER_STATSJP Abgrall
TCPMSS is required for the Android Vpn service to correctly handle the MTU on tun/ppp devices. Bug: 11579326 We don't really need SCHED_TRACER and the TIMER_STATS. Change-Id: I10c5767a6324a496713752d4fe9eff361dc8e06a (cherry picked from commit 23f01e8e81f3c53985958fa291b39c84293ad047)
2016-02-16android: configs: Reorder config fragments, update READMEJP Abgrall
Change-Id: I5ee4b794dcc00f74f26562e49a406ea292af63ee (cherry picked from commit 9ebedefd06142c9bc812bfa23401031525002a76)
2016-02-16android: configs: no MODULES for base, no SIP for recommendedJP Abgrall
We don't like CONFIG_MODULES anymore. Connection tracker handling of large SIP fails. Change-Id: Ie3c65aefcc6181752d6656c97e63035e5b5653ff Signed-off-by: JP Abgrall <jpa@google.com>
2016-02-16android: configs: Reorder config fragmentsJP Abgrall
Because there is not tool to consistently generate these config fragments, lets keep the alphabetical instead of random. Change-Id: I0f098f6be6bdd272544295a3d5a48d04411e4514 Signed-off-by: JP Abgrall <jpa@google.com>
2016-02-16android: configs: Enable KSM support by defaultRom Lemarchand
This will be a noop unless the KSM thread is enabled by userspace Change-Id: Ia5fde14504cc0da50522e2f875d8d021f9e054ba Signed-off-by: Rom Lemarchand <romlem@google.com>
2016-02-16android: configs: Add Logitech unifying receivers to recommendedMichael Wright
Change-Id: I7647cd7037731df69dfdd513a0808b396d9d5bdd Signed-off-by: Michael Wright <michaelwr@android.com>
2016-02-16android: configs: Initial commit of Android config fragmentsRom Lemarchand
- Add 2 files that contain the minimal and recommended kernel config options respectively. - Add a README to explain their purpose and how to use them to generate a device config compatible with Android. Change-Id: I3a4883f3b04d2820e90ceb3c4d02390d6458d6ce Signed-off-by: Rom Lemarchand <romlem@google.com>
2016-02-16android: skip building drivers as modulesAmit Pundir
Few Android drivers e.g. uid_cputime and PPPoLAC/oPNS, keyreset/combo, cpufreq_interactive etc.. fail to build as kernel modules. Instead of fixing the build lets make these drivers non-modular (switch config to "bool" from "tristate" in Kconfig) since Android doesn't support building kernel modules anyway. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-02-16wakeup: Add the guard condition for len in pm_get_active_wakeup_sourcesRuchi Kandoi
Check if the len is not greater than maximum to prevent buffer overflow. Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com> Change-Id: I575b0a72bb5448b68353408d71fa8b83420c9088
2016-02-16android: drivers: workaround debugfs race in binderRiley Andrews
If a /d/binder/proc/[pid] entry is kept open after linux has torn down the associated process, binder_proc_show can deference an invalid binder_proc that has been stashed in the debugfs inode. Validate that the binder_proc ptr passed into binder_proc_show has not been freed by looking for it within the global process list whilst the global lock is held. If the ptr is not valid, print nothing. Bug: 19587483 Change-Id: Idd5ad79f5648b7eed49d1ec75ae93f9e12a74ee9 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2016-02-16android: binder: More offset validationArve Hjønnevåg
Make sure offsets don't point to overlapping flat_binder_object structs. Change-Id: I12c3757872e0f16dbd6e3b92fd214004cf87047e Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2016-02-16UPSTREAM: KEYS: Fix keyring ref leak in join_session_keyring()Yevgeny Pats
(cherry pick from commit 23567fd052a9abb6d67fe8e7a9ccdd9800a540f2) This fixes CVE-2016-0728. If a thread is asked to join as a session keyring the keyring that's already set as its session, we leak a keyring reference. This can be tested with the following program: #include <stddef.h> #include <stdio.h> #include <sys/types.h> #include <keyutils.h> int main(int argc, const char *argv[]) { int i = 0; key_serial_t serial; serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, "leaked-keyring"); if (serial < 0) { perror("keyctl"); return -1; } if (keyctl(KEYCTL_SETPERM, serial, KEY_POS_ALL | KEY_USR_ALL) < 0) { perror("keyctl"); return -1; } for (i = 0; i < 100; i++) { serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, "leaked-keyring"); if (serial < 0) { perror("keyctl"); return -1; } } return 0; } If, after the program has run, there something like the following line in /proc/keys: 3f3d898f I--Q--- 100 perm 3f3f0000 0 0 keyring leaked-keyring: empty with a usage count of 100 * the number of times the program has been run, then the kernel is malfunctioning. If leaked-keyring has zero usages or has been garbage collected, then the problem is fixed. Reported-by: Yevgeny Pats <yevgeny@perception-point.io> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Don Zickus <dzickus@redhat.com> Acked-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: James Morris <james.l.morris@oracle.com> Change-Id: I6052fa14ab54e32878ac9895356f1049bb96a138
2016-02-16goldfish_bus: switch GOLDFISH_BUS config back to boolAmit Pundir
AOSP commit a61e4d271cba "Enable adb with android-pipe in IA image" made GOLDFISH_BUS modular (i.e switched it to "tristate" in Kconfig from "bool"), which is not buildable. Instead of fixing the build and supporting it in modular form, which AOSP doesn't agree with anyway, lets restore it to the original state ("bool") in the Kconfig. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-02-16goldfish: pipe: fix platform_no_drv_owner.cocci warningsFengguang Wu
No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Lizhe Liu <lizhe.liu@intel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-02-16Enable adb with android-pipe in IA imageLizhe Liu
To enable adb for x86/x86_64 Brillo emulator, we bring drivers/platform/goldfish/ in kernel/common (branch android-3.18) up to date with that in kernel/goldfish (branch android-goldfish-3.10), by porting the following patches: 044d26f goldfish: Enable ACPI-based enumeration for android pipe acf92a5 goldfish_pipe: Pass physical addresses to the device if supported 77559b0 [MIPS] Enable platform support for Goldfish virtual devices 1bebc76 platform: goldfish: pipe: don't log when dropping PIPE_ERROR_AGAIN 3c56d07 platform: goldfish: pipe: add devicetree bindings ca8dafc android_pipe: Pin pages to memory while copying and other cleanups b765d47 android_pipe: don't be clever with #define offsets 7119108 goldfish: refactor goldfish platform configs dc02035 goldfish: fix kernel panic when using multiple adb connection Change-Id: Ic4f2f5e43ba2a70831d6a12a370417984f784dbc Signed-off-by: Lizhe Liu <lizhe.liu@intel.com> Signed-off-by: Tina Zhang <tina.zhang@intel.com> Signed-off-by: Jason Hu <jia-cheng.hu@intel.com> Signed-off-by: Yu Ning <yu.ning@intel.com>