aboutsummaryrefslogtreecommitdiff
path: root/arch
Commit message (Collapse)AuthorAgeFilesLines
* defconfig: remove useless usb storage stuffMoyster2019-08-011-11/+11
|
* defconfig: remove unused comp algosMoyster2019-08-011-4/+2
|
* crypto: arm - replace memset by memzero_explicitJulia Lawall2019-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier x; type T; @@ { ... when any T x[...]; ... when any when exists - memset + memzero_explicit (x, -0, ...) ... when != x when strict } // </smpl> This change was suggested by Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Change-Id: I89b5957f922b7e5568a405c212eb186449f1deab (cherry picked from commit 025f4cbff16e284192b04bfa1f7b19551c1f5af3)
* crypto: arm/sha256 - Use memzero_explicit to fill memory with 0elektroschmock2019-07-081-1/+1
| | | | | | | | memzero_explicit should be used instead in order to prevent the compiler from optimising away zeroing. Change-Id: I248925e4c3e934a98f1341b6649ca7cb200a7781 (cherry picked from commit af92d4cf4b0a9ffc39fbd242c2659267ea62fb97)
* partial merge fix - BACKPORT: random: introduce getrandom(2) system callTheodore Ts'o2019-07-072-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost clean cherry pick of c6e9d6f38894798696f23c8084ca7edbf16ee895, includes change made by merge 0891ad829d2a0501053703df66029e843e3b8365. The getrandom(2) system call was requested by the LibreSSL Portable developers. It is analoguous to the getentropy(2) system call in OpenBSD. The rationale of this system call is to provide resiliance against file descriptor exhaustion attacks, where the attacker consumes all available file descriptors, forcing the use of the fallback code where /dev/[u]random is not available. Since the fallback code is often not well-tested, it is better to eliminate this potential failure mode entirely. The other feature provided by this new system call is the ability to request randomness from the /dev/urandom entropy pool, but to block until at least 128 bits of entropy has been accumulated in the /dev/urandom entropy pool. Historically, the emphasis in the /dev/urandom development has been to ensure that urandom pool is initialized as quickly as possible after system boot, and preferably before the init scripts start execution. This is because changing /dev/urandom reads to block represents an interface change that could potentially break userspace which is not acceptable. In practice, on most x86 desktop and server systems, in general the entropy pool can be initialized before it is needed (and in modern kernels, we will printk a warning message if not). However, on an embedded system, this may not be the case. And so with this new interface, we can provide the functionality of blocking until the urandom pool has been initialized. Any userspace program which uses this new functionality must take care to assure that if it is used during the boot process, that it will not cause the init scripts or other portions of the system startup to hang indefinitely. SYNOPSIS #include <linux/random.h> int getrandom(void *buf, size_t buflen, unsigned int flags); DESCRIPTION The system call getrandom() fills the buffer pointed to by buf with up to buflen random bytes which can be used to seed user space random number generators (i.e., DRBG's) or for other cryptographic uses. It should not be used for Monte Carlo simulations or other programs/algorithms which are doing probabilistic sampling. If the GRND_RANDOM flags bit is set, then draw from the /dev/random pool instead of the /dev/urandom pool. The /dev/random pool is limited based on the entropy that can be obtained from environmental noise, so if there is insufficient entropy, the requested number of bytes may not be returned. If there is no entropy available at all, getrandom(2) will either block, or return an error with errno set to EAGAIN if the GRND_NONBLOCK bit is set in flags. If the GRND_RANDOM bit is not set, then the /dev/urandom pool will be used. Unlike using read(2) to fetch data from /dev/urandom, if the urandom pool has not been sufficiently initialized, getrandom(2) will block (or return -1 with the errno set to EAGAIN if the GRND_NONBLOCK bit is set in flags). The getentropy(2) system call in OpenBSD can be emulated using the following function: int getentropy(void *buf, size_t buflen) { int ret; if (buflen > 256) goto failure; ret = getrandom(buf, buflen, 0); if (ret < 0) return ret; if (ret == buflen) return 0; failure: errno = EIO; return -1; } RETURN VALUE On success, the number of bytes that was filled in the buf is returned. This may not be all the bytes requested by the caller via buflen if insufficient entropy was present in the /dev/random pool, or if the system call was interrupted by a signal. On error, -1 is returned, and errno is set appropriately. ERRORS EINVAL An invalid flag was passed to getrandom(2) EFAULT buf is outside the accessible address space. EAGAIN The requested entropy was not available, and getentropy(2) would have blocked if the GRND_NONBLOCK flag was not set. EINTR While blocked waiting for entropy, the call was interrupted by a signal handler; see the description of how interrupted read(2) calls on "slow" devices are handled with and without the SA_RESTART flag in the signal(7) man page. NOTES For small requests (buflen <= 256) getrandom(2) will not return EINTR when reading from the urandom pool once the entropy pool has been initialized, and it will return all of the bytes that have been requested. This is the recommended way to use getrandom(2), and is designed for compatibility with OpenBSD's getentropy() system call. However, if you are using GRND_RANDOM, then getrandom(2) may block until the entropy accounting determines that sufficient environmental noise has been gathered such that getrandom(2) will be operating as a NRBG instead of a DRBG for those people who are working in the NIST SP 800-90 regime. Since it may block for a long time, these guarantees do *not* apply. The user may want to interrupt a hanging process using a signal, so blocking until all of the requested bytes are returned would be unfriendly. For this reason, the user of getrandom(2) MUST always check the return value, in case it returns some error, or if fewer bytes than requested was returned. In the case of !GRND_RANDOM and small request, the latter should never happen, but the careful userspace code (and all crypto code should be careful) should check for this anyway! Finally, unless you are doing long-term key generation (and perhaps not even then), you probably shouldn't be using GRND_RANDOM. The cryptographic algorithms used for /dev/urandom are quite conservative, and so should be sufficient for all purposes. The disadvantage of GRND_RANDOM is that it can block, and the increased complexity required to deal with partially fulfilled getrandom(2) requests. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Zach Brown <zab@zabbo.net> Bug: http://b/29621447 Change-Id: I189ba74070dd6d918b0fdf83ff30bb74ec0f7556 (cherry picked from commit 4af712e8df998475736f3e2727701bd31e3751a9)
* Fix "BACKPORT: ARM: wire up getrandom syscall"Michael Bestas2019-07-071-1/+1
| | | | | | | * Syscalls need to be greater than __NR_last_syscall+1 in order to account for the padding in the syscall table Change-Id: Ide15e25e8a2287fff29c75d898c935318b660ea2
* BACKPORT: ARM: wire up getrandom syscall Clean cherry pick of ↵Russell King2019-07-073-6/+13
| | | | | | | | | | | | eb6452537b280652eee66801ec97cc369e27e5d8. Add the new getrandom syscall for ARM. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Bug: http://b/29621447 Change-Id: I6d50b57f3a61fbf9102c69103b9a5b7ebf239860 (cherry picked from commit eb6452537b280652eee66801ec97cc369e27e5d8)
* Enlarge ram console size from 12KB to 15KB.Piazza Lo2019-05-032-2/+2
| | | | | | | | BUG:67857304 Change-Id: I7bb176458bd6b8d62218dea3e5e9a9d815afc5ee Signed-off-by: Piazza Lo <piazza.lo@mediatek.com> Signed-off-by: Moyster <oysterized@gmail.com>
* ARM: 7933/1: rename ioremap_cached to ioremap_cacheRob Herring2019-05-034-4/+4
| | | | | | | | | | | | | | | | | | | | | ioremap_cache is more aligned with other architectures. There are only 2 users of this in the kernel: pxa2xx-flash and Xen. This fixes Xen build failures on arm64: drivers/tty/hvc/hvc_xen.c:233:2: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration] drivers/xen/grant-table.c:1174:3: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration] drivers/xen/xenbus/xenbus_probe.c:778:4: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration] Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Git-commit: 0a5ccc86507f45b80831dac1049197c4d45be955 [joonwoop@codeaurora.org: fixed trivial merge conflict.] Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org> Change-Id: I867b893aa63bc8647ed0d7cbf66b7fbb464ef8f0
* arm64/xen: implement ioremap_cached on arm64Stefano Stabellini2019-05-031-0/+2
| | | | | | | | Change-Id: I567349ba54959b45e817e8ebacbb8babca1ca453 Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Git-Repo: git://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ Git-commit: 22d4102f778df9cab47e871b8de3400f6e685378 Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
* ARM: spectre-v1: fix syscall entryRussell King2019-05-032-11/+32
| | | | | | | | | | | | Prevent speculation at the syscall table decoding by clamping the index used to zero on invalid system call numbers, and using the csdb speculative barrier. Change-Id: I59151ce75a3887d88eed852187f05013e665a7cb Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Mark Rutland <mark.rutland@arm.com> Boot-tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Tony Lindgren <tony@atomide.com>
* ARM: spectre-v1: add array_index_mask_nospec() implementationRussell King2019-05-031-0/+19
| | | | | | | | | | | Add an implementation of the array_index_mask_nospec() function for mitigating Spectre variant 1 throughout the kernel. Change-Id: I66d16e24b4725df0bf70f53c91a34be9f26fba98 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Mark Rutland <mark.rutland@arm.com> Boot-tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Tony Lindgren <tony@atomide.com>
* ARM: spectre-v1: add speculation barrier (csdb) macrosRussell King2019-05-032-0/+21
| | | | | | | | | | Add assembly and C macros for the new CSDB instruction. Change-Id: Iff3490a0ebc290edf22128eba9e367dc5134fb3e Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Mark Rutland <mark.rutland@arm.com> Boot-tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Tony Lindgren <tony@atomide.com>
* ARM: spectre-v2: harden branch predictor on context switchesRussell King2019-05-032-0/+46
| | | | | | | | | | | | | | | | | | | Harden the branch predictor against Spectre v2 attacks on context switches for ARMv7 and later CPUs. We do this by: Cortex A9, A12, A17, A73, A75: invalidating the BTB. Cortex A15, Brahma B15: invalidating the instruction cache. Cortex A57 and Cortex A72 are not addressed in this patch. Cortex R7 and Cortex R8 are also not addressed as we do not enforce memory protection on these cores. Change-Id: Ic2fb57dd40b6f7fc22a62f267ab24441ab09cc4b Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Boot-tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Tony Lindgren <tony@atomide.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
* ARM: spectre: add Kconfig symbol for CPUs vulnerable to SpectreRussell King2019-05-031-0/+4
| | | | | | | | | | | | Add a Kconfig symbol for CPUs which are vulnerable to the Spectre attacks. Change-Id: I63aeb80cb82f9de4ddbb3bf83fefd5b0ce4237ba Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Boot-tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Tony Lindgren <tony@atomide.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
* mm: Update is_vmalloc_addr to account for vmalloc savingsLaura Abbott2019-05-021-1/+1
| | | | | | | | | | is_vmalloc_addr current assumes that all vmalloc addresses exist between VMALLOC_START and VMALLOC_END. This may not be the case when interleaving vmalloc and lowmem. Update the is_vmalloc_addr to properly check for this. Change-Id: I5def3d6ae1a4de59ea36f095b8c73649a37b1f36 Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
* Safer ABI for O_TMPFILEAl Viro2019-05-023-3/+3
| | | | | | | | | [suggested by Rasmus Villemoes] make O_DIRECTORY | O_RDWR part of O_TMPFILE; that will fail on old kernels in a lot more cases than what I came up with. And make sure O_CREAT doesn't get there... Change-Id: Iaa3c8b487d44515b539150bdb5d0b749b87d3ea2 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* it's still short a few helpers, but infrastructure should be OK now...Al Viro2019-05-023-0/+3
| | | | | Change-Id: I0adb8fe9c5029bad3ac52629003c3b78e9442936 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* defconfig: fixMoyster2019-05-021-4/+8
|
* defconfig: regenMoyster2019-01-131-6/+2
|
* defconfig: cleanup quota configMoyster2019-01-131-4/+4
|
* defconfig: enable AES-GCMMoyster2019-01-131-1/+1
|
* arm, pm, vmpressure: add missing slab.h includesTejun Heo2018-12-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | arch/arm/mach-tegra/pm.c, kernel/power/console.c and mm/vmpressure.c were somehow getting slab.h indirectly through cgroup.h which in turn was getting it indirectly through xattr.h. A scheduled cgroup change drops xattr.h inclusion from cgroup.h and breaks compilation of these three files. Add explicit slab.h includes to the three files. A pending cgroup patch depends on this change and it'd be great if this can be routed through cgroup/for-3.14-fixes branch. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: linux-tegra@vger.kernel.org Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: linux-pm@vger.kernel.org Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Cc: Balbir Singh <bsingharora@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: cgroups@vger.kernel.org Signed-off-by: Joe Maples <joe@frap129.org>
* defconfig: regen for sdfat and new ram_consoleMoyster2018-12-021-19/+23
|
* defconfig: build with CONFIG_MAGIC_SYSRQMoyster2018-12-021-1/+1
| | | | fixes : [ 206.299213]<1> (1)[1:init]android_reboot: Failed to open sysrq-trigger.
* ARM: 8584/1: floppy: avoid gcc-6 warningArnd Bergmann2018-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | commit dd665be0e243873343a28e18f9f345927b658daf upstream. gcc-6.0 warns about comparisons between two identical expressions, which is what we get in the floppy driver when writing to the FD_DOR register: drivers/block/floppy.c: In function 'set_dor': drivers/block/floppy.c:810:44: error: self-comparison always evaluates to true [-Werror=tautological-compare] fd_outb(newdor, FD_DOR); It would be nice to use a static inline function instead of the macro, to avoid the warning, but we cannot do that because the FD_DOR definition is incomplete at this point. Adding a cast to (u32) is a harmless way to shut up the warning, just not very nice. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* arm64: build vdso without libgcovArnd Bergmann2018-11-301-0/+3
| | | | | | | | | | | | | | | | | | commit 543097843ca7c9ac3758d0b5879ea2a6f44089de upstream. On a cross-toolchain without glibc support, libgcov may not be available, and attempting to build an arm64 kernel with GCOV enabled then results in a build error: /home/arnd/cross-gcc/lib/gcc/aarch64-linux/5.2.1/../../../../aarch64-linux/bin/ld: cannot find -lgcov We don't really want to link libgcov into the vdso anyway, so this patch just disables GCOV in the vdso directory, just as we do for most other architectures. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Revert "GCC: Fix up for gcc 5+"Moyster2018-11-302-2/+0
| | | | This reverts commit ff505baaf412985af758d5820cd620ed9f1a7e05.
* arm64: support __int128 on gcc 5+Jason A. Donenfeld2018-11-303-1/+82
| | | | | | | | | | | | | | | | | | | | | | | [Upstream: fb8722735f50cd51204bfbeefa2e5e7e9ff5b2be] [Upstream: 9bfe7553fadb269e45a6e10f68b727957dff5676] Versions of gcc prior to gcc 5 emitted a __multi3 function call when dealing with TI types, resulting in failures when trying to link to libgcc, and more generally, bad performance. However, since gcc 5, the compiler supports actually emitting fast instructions, which means we can at long last enable this option and receive the speedups. The gcc commit that added proper Aarch64 support is: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=d1ae7bb994f49316f6f63e6173f2931e837a351d This commit appears to be part of the gcc 5 release. There are still a few instructions, __lshrti3, __ashlti3, and __ashrti3, which require libgcc, which is fine. Rather than linking to libgcc, we simply provide them ourselves, since they're not that complicated. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
* Replace <asm/uaccess.h> with <linux/uaccess.h> globallyLinus Torvalds2018-11-29462-462/+462
| | | | | | | | | | | | | | This was entirely automated, using the script by Al: PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>' sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \ $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h) to do the replacement at the end of the merge window. Requested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Moyster <oysterized@gmail.com>
* defconfig: regen m2note_defconfigMoyster2018-11-291-0/+3
|
* Fix for build error no support ARM mode 'smc #1'demicro2018-11-291-1/+3
|
* ARM: 8328/1: remove empty preprocessor #else branchUwe Kleine-König2018-11-291-3/+1
| | | | | | | | | | When the patch for e16343c47e42 (ARM: 8160/1: drop warning about return_address not using unwind tables) was created there was still more code in said branch. Probably this simplification was just missed during conflict resolution when the patch was applied. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* ARM: 8171/1: Use current_stack_pointer for return_addressBehan Webster2018-11-291-2/+1
| | | | | | | | | | | | Use the global current_stack_pointer to get the value of the stack pointer. This change supports being able to compile the kernel with both gcc and Clang. Signed-off-by: Behan Webster <behanw@converseincode.com> Reviewed-by: Mark Charlebois <charlebm@gmail.com> Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de> Acked-by: Will Deacon <will.deacon@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* ARM: 8160/1: drop warning about return_address not using unwind tablesUwe Kleine-König2018-11-291-4/+0
| | | | | | | | | | | | The warning was introduced in 2009 (commit 4bf1fa5a34aa ([ARM] 5613/1: implement CALLER_ADDRESSx)). The only "problem" here is that CALLER_ADDRESSx for x > 1 returns NULL which doesn't do much harm. The drawback of implementing a fix (i.e. use unwind tables to implement CALLER_ADDRESSx) is that much of the unwinder code would need to be marked as not traceable. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.hBehan Webster2018-11-292-6/+1
| | | | | | | | | | | | | With compilers which follow the C99 standard (like modern versions of gcc and clang), "extern inline" does the wrong thing (emits code for an externally linkable version of the inline function). In this case using static inline and removing the NULL version of return_address in return_address.c does the right thing. Signed-off-by: Behan Webster <behanw@converseincode.com> Reviewed-by: Mark Charlebois <charlebm@gmail.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* arm64: kuser32-bit helpers: dont include unistd32.hAmit Pundir2018-11-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While building lsk-3.10-android branch, we run into a series of build warnings for arm64 arch: ---------- In file included from arch/arm64/kernel/kuser32.S:32:0: arch/arm64/include/asm/unistd32.h:24:0: warning: "__NR_restart_syscall" redefined #define __NR_restart_syscall 0 ^ In file included from include/asm-generic/unistd.h:1:0, from arch/arm64/include/uapi/asm/unistd.h:16, from arch/arm64/include/asm/unistd.h:50, from arch/arm64/kernel/kuser32.S:31: include/uapi/asm-generic/unistd.h:390:0: note: this is the location of the previous definition #define __NR_restart_syscall 128 ^ In file included from arch/arm64/kernel/kuser32.S:32:0: arch/arm64/include/asm/unistd32.h:26:0: warning: "__NR_exit" redefined #define __NR_exit 1 ^ In file included from include/asm-generic/unistd.h:1:0, from arch/arm64/include/uapi/asm/unistd.h:16, from arch/arm64/include/asm/unistd.h:50, from arch/arm64/kernel/kuser32.S:31: include/uapi/asm-generic/unistd.h:292:0: note: this is the location of the previous definition #define __NR_exit 93 ^ ---------- This fix removes asm/unitstd32.h include to avoid duplication of "__NR_" syscall definitions. It is based on mainline commit: f3e5c847ec3d "arm64: Add __NR_* definitions for compat syscalls". The corresponding change in AOSP (commit: cfc7e99e9e39, "arm64: Add..") seem to be the early version or backport of the above mainline commit to aosp/android-3.10. The only difference between mainline and aosp commit is that the latter didn't have to deal with that problematic include because it is not present in aosp/android-3.10 unlike mainline or lsk-v3.10-android tree. Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: Kevin Hilman <khilman@linaro.org>
* GCC: Fix up for gcc 5+mydongistiny2018-11-292-0/+2
| | | | | Signed-off-by: mydongistiny <jaysonedson@gmail.com> Signed-off-by: Mister Oyster <oysterized@gmail.com>
* ARM: fix put_user() for gcc-8Arnd Bergmann2018-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Building kernels before linux-4.7 with gcc-8 results in many build failures when gcc triggers a check that was meant to catch broken compilers: /tmp/ccCGMQmS.s:648: Error: .err encountered According to the discussion in the gcc bugzilla, a local "register asm()" variable is still supposed to be the correct way to force an inline assembly to use a particular register, but marking it 'const' lets the compiler do optimizations that break that, i.e the compiler is free to treat the variable as either 'const' or 'register' in that case. Upstream commit 9f73bd8bb445 ("ARM: uaccess: remove put_user() code duplication") fixed this problem in linux-4.8 as part of a larger change, but seems a little too big to be backported to 4.4. Let's take the simplest fix and change only the one broken line in the same way as newer kernels. Suggested-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85745 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673 Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* arm64: move ET_DYN base lower in the address spaceDaniel Micay2018-05-161-2/+2
| | | | Signed-off-by: Daniel Micay <danielmicay@gmail.com>
* arm64: determine stack entropy based on mmap entropyDaniel Micay2018-05-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Stack mapping entropy is currently hard-wired to 11 bits of entropy on 32-bit and 18 bits of entropy on 64-bit. The stack itself gains an extra 8 bits of entropy from lower bit randomization within 16 byte alignment constraints. The argument block could have all lower bits randomized but it currently only gets the mapping randomization. Rather than hard-wiring values this switches to using the mmap entropy configuration like the mmap base and executable base, resulting in a range of 8 to 16 bits on 32-bit and 18 to 24 bits on 64-bit (with 4k pages) depending on kernel configuration and overridable via the sysctl entries. It's worth noting that since these kernel configuration options default to the minimum supported entropy value, the entropy on 32-bit will drop from 11 to 8 bits for builds using the defaults. However, following the configuration seems like the right thing to do regardless. At the very least, changing the defaults for COMPAT (32-bit processes on 64-bit) should be considered due to the larger address space compared to real 32-bit. Signed-off-by: Daniel Micay <danielmicay@gmail.com>
* arm64: properly account for stack rnd in mmap baseDaniel Micay2018-05-161-1/+4
| | | | | | | | | | The stack ASLR base was not included in the gap size for rlimit values larger than MIN_GAP, resulting in insufficient space being reserved. PaX uses an alternate approach where the mmap base is instead offset from the actual random stack base, but this works for the time being. Signed-off-by: Daniel Micay <danielmicay@gmail.com>
* arm64: issue isb when trapping CNTVCT_EL0 accessGreg Hackmann2018-01-151-0/+2
| | | | | Bug: 68266545 Change-Id: I6005a6e944494257bfc2243fde2f7a09c3fd76c6
* BACKPORT: arm64: Add CNTFRQ_EL0 trap handlerMarc Zyngier2018-01-152-0/+15
| | | | | | | | | | | | | | | | | | | | | We now trap accesses to CNTVCT_EL0 when the counter is broken enough to require the kernel to mediate the access. But it turns out that some existing userspace (such as OpenMPI) do probe for the counter frequency, leading to an UNDEF exception as CNTVCT_EL0 and CNTFRQ_EL0 share the same control bit. The fix is to handle the exception the same way we do for CNTVCT_EL0. Bug: 68266545 Fixes: a86bd139f2ae ("arm64: arch_timer: Enable CNTVCT_EL0 trap if workaround is enabled") Reported-by: Hanjun Guo <guohanjun@huawei.com> Tested-by: Hanjun Guo <guohanjun@huawei.com> Reviewed-by: Hanjun Guo <guohanjun@huawei.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> (cherry picked from commit 9842119a238bfb92cbab63258dabb54f0e7b111b) Change-Id: Ie5a9a93fcca238d6097ecacd6df0e540be90220b
* BACKPORT: arm64: Add CNTVCT_EL0 trap handlerMarc Zyngier2018-01-153-1/+68
| | | | | | | | | | | | | | Since people seem to make a point in breaking the userspace visible counter, we have no choice but to trap the access. Add the required handler. Bug: 68266545 Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> (cherry picked from commit 6126ce0588eb5a0752d5c8b5796a7fca324fd887) Change-Id: I0705f47c85a78040df38df18f51a4a22500b904d
* mtk: turn unneeded MTK_WFD_SUPPORTMister Oyster2018-01-132-2/+0
|
* defconfig: renable ext4_fs_encryptionMister Oyster2018-01-051-2/+2
|
* defconfig: don't build ecryptfs & turn off ext4 FBE based encryptionMister Oyster2018-01-011-3/+2
|
* crypto: remove duplicate impl.Mister Oyster2017-12-279-4232/+0
| | | | | | | | | | Revert "crypto: arm64/sha2 - add generated .S files to .gitignore" This reverts commit 9345ccbf273209e3946c3981122d068221a135d2. Revert "crypto: arm64/sha2 - integrate OpenSSL implementations of SHA256/SHA512" This reverts commit 02ea19edc643061fab3b6ea8bd54b96110a9f43b.
* defconfig: enable CRC32_ARM64 algoMister Oyster2017-12-271-1/+1
|