[PATCH] timerfd: support CLOCK_BOOTTIME clock

2014-01-08 Thread Greg Hackmann
Add CLOCK_BOOTTIME support to timerfd Signed-off-by: Greg Hackmann ghackm...@google.com --- fs/timerfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/timerfd.c b/fs/timerfd.c index 9293121..0013142 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -317,6 +317,7 @@ SYSCALL_DEFINE2

Re: [RFC PATCH 0/1] arm64: Fix /proc/cpuinfo

2014-10-27 Thread Greg Hackmann
On Fri, Oct 24, 2014 at 6:56 AM, Mark Rutland mark.rutl...@arm.com wrote: [c] Print different hwcaps for compat tasks This would allow for 32-bit and 64-bit applications to function correctly. Having the format differ depending on the instruction set of the application reading

[PATCH] pstore-ram: add Device Tree bindings

2015-11-12 Thread Greg Hackmann
; property, since ramoops sets dump_oops=1 by default. (2) mem_type=1 becomes the more self-explanatory "unbuffered" property. Signed-off-by: Greg Hackmann <ghackm...@google.com> --- Documentation/devicetree/bindings/misc/ramoops.txt | 30 ++ Documentation/ramoops.txt

[PATCH v2] pstore-ram: add Device Tree bindings

2015-11-16 Thread Greg Hackmann
; property, since ramoops sets dump_oops=1 by default. (2) mem_type=1 becomes the more self-explanatory "unbuffered" property. Signed-off-by: Greg Hackmann <ghackm...@google.com> --- Changes in V2: - make DT binding documentation more generic Documentation/devicetree/bindi

Re: [PATCH v2 1/1] platform: goldfish: pipe: add devicetree bindings

2015-11-27 Thread Greg Hackmann
On 11/26/15 12:34 AM, Christoffer Dall wrote: On Wed, Nov 25, 2015 at 02:24:16PM -0600, Rob Herring wrote: The binding may be trivial, but there's a bigger question of whether this is the right long term direction. For example is upstream QEMU going to take all the Android pipe stuff? Couldn't

Re: [PATCH] staging/android: add TODO to de-stage android sync framework

2015-11-24 Thread Greg Hackmann
On 11/24/2015 12:53 AM, Daniel Vetter wrote: With all the effort going on around kselftest it'd be good to integrate the existing testsuite google has into upstream too. Should probably be listed here too. -Daniel The test code's available in AOSP:

Re: [PATCH] staging/android: add TODO to de-stage android sync framework

2015-11-24 Thread Greg Hackmann
On 11/23/15 11:41 AM, Gustavo Padovan wrote: + - remove sw_sync, it is used only for testing/debugging and should not be +upstreamed. + - port sw_sync testcases to use debugfs somehow A quick but important nitpick: sw_sync itself is just an in-kernel helper for creating fences, when you

Re: [PATCH v2] pstore-ram: add Device Tree bindings

2015-11-20 Thread Greg Hackmann
On 11/17/2015 01:17 PM, Rob Herring wrote: +- record-size: maximum size in bytes of each dump done on oops/panic + (defaults to 0) Perhaps the default should be something useful. It's kind of a weird default, but I don't have any ideas for a better one. First, the size you want is really

Re: [PATCH v2 01/11] dma-buf/sync_file: de-stage sync_file

2016-01-29 Thread Greg Hackmann
On 01/28/16 01:23, Daniel Vetter wrote: And I think driver_data really shouldn't be there, it makes things complicated with the array of variable-sized objects, and generic userspace can't really use it - for debug output we already have obj/driver_name per fence point, which I think is good

Re: [PATCH v2 01/11] dma-buf/sync_file: de-stage sync_file

2016-01-27 Thread Greg Hackmann
On 01/27/2016 12:25 PM, Gustavo Padovan wrote: Is there a value in keeping the abi unchanged? If not, then Documentation/ioctl/botching-up-ioctls.txt is worth a read. None from me. I'll look where we can improve the ABI. Android has existing clients of the current ABI. Thankfully they're

[PATCH] selftests: breakpoint: add step_after_suspend_test

2016-02-22 Thread Greg Hackmann
Commit e56d82a11617 ("arm64: cpu hotplug: ensure we mask out CPU_TASKS_FROZEN in notifiers") fixed a long-standing ARM64 bug that broke single-stepping after a suspend/resume cycle. Add a kernel selftest to make sure this doesn't regress or affect other platforms. Signed-off-by: Gre

Re: [PATCH] staging/android: change IOCTLs opcode after ABI change

2016-03-08 Thread Greg Hackmann
; Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.co.uk> Acked-by: Greg Hackmann <ghackm...@google.com>

Re: [PATCH v7 1/5] staging/android: add num_fences field to struct sync_file_info

2016-03-08 Thread Greg Hackmann
at's needed to get sync moved out of staging. Pragmatically speaking, this won't break ordinary Android apps, because they don't get direct access to sync fence fds to begin with. Some privileged system processes do, but they go through libsync, which can be changed to deal with the ABI differences.

Re: [RFC v2 5/8] drm/fence: add in-fences support

2016-04-26 Thread Greg Hackmann
On 04/26/2016 01:05 PM, Daniel Vetter wrote: On Tue, Apr 26, 2016 at 09:55:06PM +0300, Ville Syrjälä wrote: On Tue, Apr 26, 2016 at 08:23:46PM +0200, Daniel Vetter wrote: On Tue, Apr 26, 2016 at 08:40:45PM +0300, Ville Syrjälä wrote: But really the reason for per-plane is hw composer from

Re: [RFC v2 5/8] drm/fence: add in-fences support

2016-04-29 Thread Greg Hackmann
On 04/26/2016 11:39 PM, Daniel Vetter wrote: A (per-CRTC?) array of fences would be more flexible. And even in the cases where you could make a 1-to-1 mapping between planes and fences, it's not that much more work for userspace to assemble those fences into an array anyway. I'm ok with an

[PATCH] config: android-base: CONFIG_SYNC -> CONFIG_SYNC_FILE

2017-03-14 Thread Greg Hackmann
Explicit sync was renamed to CONFIG_SYNC_FILE when it was destaged, but the Android config fragment still tries to use the old name. Signed-off-by: Greg Hackmann <ghackm...@google.com> --- kernel/configs/android-base.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.

2017-04-06 Thread Greg Hackmann
iaomi.com> Tested-by: Greg Hackmann <ghackm...@google.com> --- drivers/staging/android/ashmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 3f11332..e4530ac 100644 --- a/drivers/staging/android/ashmem.c +++

Re: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.

2017-04-06 Thread Greg Hackmann
On 04/06/2017 10:08 AM, Greg KH wrote: On Thu, Apr 06, 2017 at 08:30:40AM -0700, Greg Hackmann wrote: On 04/06/2017 07:30 AM, zhangshuxia...@gmail.com wrote: From: zhangshuxiao <zhangshux...@xiaomi.com> vfs_llseek will check whether the file mode has FMODE_LSEEK, no return failure. But

Re: [PATCH 1/4] kasan: support alloca() poisoning

2017-07-13 Thread Greg Hackmann
Hi, Thanks for taking a look at this patchstack. I apologize for the delay in responding. On 07/10/2017 01:44 AM, Dmitry Vyukov wrote: + + const void *left_redzone = (const void *)(addr - + KASAN_ALLOCA_REDZONE_SIZE); + const void *right_redzone = (const

Re: [PATCH 1/4] kasan: support alloca() poisoning

2017-07-13 Thread Greg Hackmann
On 07/10/2017 03:30 AM, Andrey Ryabinin wrote: gcc now supports this too. So I think this patch should enable it. It's off by default so you'll have to add --param asan-instrument-allocas=1 into cflags to make it work Thanks, will fix. For now, it looks like I'll need to build gcc from git

[PATCH 2/4] kasan: added functions for unpoisoning stack variables

2017-07-06 Thread Greg Hackmann
kernel when using KASAN. Signed-off-by: Alexander Potapenko <gli...@google.com> [ghackm...@google.com: fix memset() parameters, and tweak commit message to describe new callbacks] Signed-off-by: Greg Hackmann <ghackm...@google.com> --- mm/kasan/kasan.c | 15 +++ 1 file chan

[PATCH 1/4] kasan: support alloca() poisoning

2017-07-06 Thread Greg Hackmann
of the dynamic stack area, so unpoisoning is simpler. Signed-off-by: Greg Hackmann <ghackm...@google.com> --- lib/test_kasan.c | 22 ++ mm/kasan/kasan.c | 26 ++ mm/kasan/kasan.h | 8 mm/kasan/report.c | 3 +++ 4 files changed, 59 insertions(+)

[PATCH 4/4] kasan: add compiler support for clang

2017-07-06 Thread Greg Hackmann
For now we can hard-code ASAN ABI level 5, since historical clang builds can't build the kernel anyway. We also need to emulate gcc's __SANITIZE_ADDRESS__ flag, or memset() calls won't be instrumented. Signed-off-by: Greg Hackmann <ghackm...@google.com> --- include/linux/compiler-clang.

[PATCH 0/4] kasan: add clang support

2017-07-06 Thread Greg Hackmann
*** Alexander Potapenko (1): kasan: added functions for unpoisoning stack variables Greg Hackmann (3): kasan: support alloca() poisoning kasan: support LLVM-style asan parameters kasan: add compiler support for clang include/linux/compiler-clang.h | 10 ++ lib/test_kasan.c

[PATCH 3/4] kasan: support LLVM-style asan parameters

2017-07-06 Thread Greg Hackmann
Use cc-option to figure out whether the compiler's sanitizer uses LLVM-style parameters ("-mllvm -asan-foo=bar") or GCC-style parameters ("--param asan-foo=bar"). Signed-off-by: Greg Hackmann <ghackm...@google.com> --- scripts/Makefile.kasan | 10 +- 1 file c

[PATCH] alarmtimer: don't rate limit one-shot timers

2017-07-25 Thread Greg Hackmann
.y. Older -stable trees have a slightly different patch, and 4.13-rc2 isn't impacted due to a later refactoring. Fixes: ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") Reported-by: Ben Fennema <fenn...@google.com> Signed-off-by: Greg Hackmann <ghackm...@google.co

[PATCH 2/2] kselftests: set-timer-lat: add one-shot timer test cases

2017-07-25 Thread Greg Hackmann
seconds and verify that the alarm fired exactly once. Signed-off-by: Greg Hackmann <ghackm...@google.com> --- tools/testing/selftests/timers/set-timer-lat.c | 86 ++ 1 file changed, 73 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/timers/set-timer-la

[PATCH 0/2] kselftests: set-timer-lat: test one-shot timers

2017-07-25 Thread Greg Hackmann
the console with failure messages. The second patch actually adds the one-shot testcases. Greg Hackmann (2): kselftests: set-timer-lat: tweak reporting when timer fires early kselftests: set-timer-lat: add one-shot timer test cases tools/testing/selftests/timers/set-timer-lat.c | 103

[PATCH 1/2] kselftests: set-timer-lat: tweak reporting when timer fires early

2017-07-25 Thread Greg Hackmann
Rather than printing an error inside the alarm signal handler, set a flag that we check later. This keeps the test from spamming the console every time the alarm fires early. It also fixes the test exiting with error code 0 if this was the only test failure. Signed-off-by: Greg Hackmann <gha

Re: [PATCH] alarmtimer: don't rate limit one-shot timers

2017-07-24 Thread Greg Hackmann
On 07/24/2017 11:21 AM, Greg KH wrote: On Mon, Jul 24, 2017 at 10:19:24AM -0700, Greg Hackmann wrote: Commit ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") sets a minimum bound on the alarm timer interval. This minimum bound shouldn't be applied if the interval is 0.

[PATCH] alarmtimer: don't rate limit one-shot timers

2017-07-24 Thread Greg Hackmann
nly needed in -stable trees. 4.13-rc2 isn't impacted due to a later refactoring. Fixes: ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") Reported-by: Ben Fennema <fenn...@google.com> Signed-off-by: Greg Hackmann <ghackm...@google.com> Cc: sta...@vger.kernel.org --- ker

Re: [PATCH 1/4] kasan: support alloca() poisoning

2017-07-06 Thread Greg Hackmann
On 07/06/2017 03:01 PM, Greg Hackmann wrote: @@ -101,6 +101,9 @@ static const char *get_shadow_bug_type(struct kasan_access_info *info) break; case KASAN_USE_AFTER_SCOPE: bug_type = "use-after-scope"; + case KASAN_ALLOCA_LEFT: +

Re: [PATCH v2] x86/mm/kaslr: Use _ASM_MUL macro for multiplication

2017-04-26 Thread Greg Hackmann
On 04/26/2017 02:24 PM, h...@zytor.com wrote: This really feels like a "fix your compiler" issue. We already use the other forms, what's so bad about adding mul too? And if this lets us build under clang, all the better. -Kees It's not bad per se, but if this doesn't eventually gets fixed

Re: [PATCH] efi/libstub: Indicate clang the relocation mode for arm64

2017-05-09 Thread Greg Hackmann
On 05/09/2017 12:36 PM, Matthias Kaehlcke wrote: From: Greg Hackmann <ghackm...@google.com> Without any extra guidance, clang will generate libstub with either absolute or relative ELF relocations. Use the right combination of -fpic and -fno-pic on different files to avoid this. Sign

Re: [PATCH] efi/libstub: Indicate clang the relocation mode for arm64

2017-05-17 Thread Greg Hackmann
On 05/11/2017 06:51 AM, Ard Biesheuvel wrote: [snip] In my opinion, the correct fix would be to make -fpie (as opposed to -fpic) imply hidden visibility, given that PIE executables don't export symbols in the first place, and so the preemption rules do not apply. It is worth a try whether -fpie

Re: [PATCH] selftests: timers: set-timer-lat: fix hang when std out/err are redirected

2017-09-22 Thread Greg Hackmann
imer_delete(tm1); I assume you are good with this fix. I plan to apply it to linux-kselftest fixes today. Please let me know if you have any objections. thanks, -- Shuah Thanks for looking into this. Acked-by: Greg Hackmann <ghackm...@google.com>

Re: [PATCH] selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms

2017-09-22 Thread Greg Hackmann
On 09/22/2017 07:41 AM, Shuah Khan wrote: I assume you are good with this fix. I plan to apply it to linux-kselftest fixes today. Please let me know if you have any objections. thanks, -- Shuah AIUI this check was added so set-timer-lat would treat a missing CAP_WAKE_ALARM as a skipped test

Re: [tip:timers/core] kselftests: timers: set-timer-lat: Tweak reporting when timer fires early

2017-09-21 Thread Greg Hackmann
On 09/20/2017 04:38 PM, Shuah Khan wrote: On 09/20/2017 06:31 AM, Prarit Bhargava wrote: On 09/19/2017 11:36 PM, John Stultz wrote: On Tue, Sep 19, 2017 at 6:02 PM, Shuah Khan <sh...@kernel.org> wrote: Hi Greg, On 08/20/2017 03:56 AM, tip-bot for Greg Hackmann wrote: Com

[PATCH v2] selftests: vdso_test: support ARM64 targets

2017-11-01 Thread Greg Hackmann
ARM64's vDSO exports its gettimeofday() implementation with a different name (__kernel_gettimeofday) and version (LINUX_2.6.39) from other architectures. Add a corresponding special-case to vdso_test. Signed-off-by: Greg Hackmann <ghackm...@google.com> --- Changes since v1: * Moved defin

[PATCH] selftests: vdso_test: support ARM64 targets

2017-10-31 Thread Greg Hackmann
ARM64's vDSO exports its gettimeofday() implementation with a different name (__kernel_gettimeofday) and version (LINUX_2.6.39) from other architectures. Add a corresponding special-case to vdso_test. Signed-off-by: Greg Hackmann <ghackm...@google.com> --- tools/testing/selftest

[PATCH] arm64: remove no-op -p linker flag

2018-06-27 Thread Greg Hackmann
wards compatibility". Since this flag is a no-op on ARM64, we can safely drop it. Signed-off-by: Greg Hackmann --- arch/arm64/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 45272266dafb..79bd701071de 100644 --- a/

[PATCH] staging: android: ashmem: fix a race condition in ASHMEM_SET_SIZE ioctl

2018-01-08 Thread Greg Hackmann
From: Viktor Slavkovic A lock-unlock is missing in ASHMEM_SET_SIZE ioctl which can result in a race condition when mmap is called. After the !asma->file check, before setting asma->size, asma->file can be set in mmap. That would result in having different asma->size than the

[PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-13 Thread Greg Hackmann
t; KPF_NOPAGE). kpageflags_read() treats the offset as valid, and stable_page_flags() will try to access an address between the user and kernel address ranges. Signed-off-by: Greg Hackmann --- arch/arm64/mm/init.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64

[PATCH v2 2/2] arm: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-15 Thread Greg Hackmann
kernel.org Signed-off-by: Greg Hackmann --- arch/arm/mm/init.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0cc8e04295a4..bee1f2e4ecf3 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -196,7 +196,11 @@ static v

[PATCH v2 1/2] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-15 Thread Greg Hackmann
t; KPF_NOPAGE). kpageflags_read() treats the offset as valid, and stable_page_flags() will try to access an address between the user and kernel address ranges. Fixes: c1cc1552616d ("arm64: MMU initialisation") Cc: sta...@vger.kernel.org Signed-off-by: Greg Hackmann --- arch/arm64/mm/

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-15 Thread Greg Hackmann
On 08/14/2018 08:29 AM, Will Deacon wrote: > On Tue, Aug 14, 2018 at 08:17:48AM -0700, Greg Hackmann wrote: >> On 08/14/2018 03:40 AM, Will Deacon wrote: >>> Hi Greg, >>> >>> On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: >>>> ARM6

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-14 Thread Greg Hackmann
On 08/14/2018 03:40 AM, Will Deacon wrote: > Hi Greg, > > On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: >> ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input >> before seeing if the PFN is valid. This leads to false positives when >

[PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-08-31 Thread Greg Hackmann
of 4.9.y. Kernels 4.12 and later are unaffected, since all the underlying ion_handle infrastructure has been ripped out. Cc: sta...@vger.kernel.org # v4.11- Signed-off-by: Greg Hackmann --- drivers/staging/android/ion/ion-ioctl.c | 12 --- drivers/staging/android/ion/ion.c

Re: [PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-08-31 Thread Greg Hackmann
On 08/31/2018 01:27 PM, Greg Hackmann wrote: > Change-Id: Ia0542dd8134e81cd5e1412e126545303c766f738 Sorry, please disregard the Change-Id line. This is what I get for forgetting to re-run checkpatch after amending my commit message. :/

Re: [PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-08-31 Thread Greg Hackmann
On 08/31/2018 01:12 PM, Greg Kroah-Hartman wrote: > On Fri, Aug 31, 2018 at 01:06:27PM -0700, Greg Hackmann wrote: >> The ION_IOC_{MAP,SHARE} ioctls drop and reacquire client->lock several >> times while operating on one of the client's ion_handles. This creates >> win

[PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-08-31 Thread Greg Hackmann
of 4.4.y, and applies to older kernels too. 4.9.y was fixed separately. Kernels 4.12 and later are unaffected, since all the underlying ion_handle infrastructure has been ripped out. Change-Id: Ia0542dd8134e81cd5e1412e126545303c766f738 Cc: sta...@vger.kernel.org # v4.4- Signed-off-by: Greg Ha

[PATCH v2] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-09-04 Thread Greg Hackmann
of 4.4.y, and applies to older kernels too. 4.9.y was fixed separately. Kernels 4.12 and later are unaffected, since all the underlying ion_handle infrastructure has been ripped out. Cc: sta...@vger.kernel.org # v4.4- Signed-off-by: Greg Hackmann --- v2: remove Change-Id line from commit m

Re: [PATCH] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-07 Thread Greg Hackmann
On 03/07/2018 12:21 PM, Eric Dumazet wrote: > On Wed, 2018-03-07 at 11:24 -0800, Greg Hackmann wrote: >> f7c83bcbfaf5 ("net: xfrm: use __this_cpu_read per-cpu helper") added >> a >> __this_cpu_read() call inside ipcomp_alloc_tfms().  Since this call >> was &g

[PATCH] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-07 Thread Greg Hackmann
org Signed-off-by: Greg Hackmann <ghackm...@google.com> --- net/xfrm/xfrm_ipcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index ccfdc7115a83..a00ec715aa46 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ip

[PATCH v2 net] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-07 Thread Greg Hackmann
fc15c0 R10: R11: 0207 R12: 00400440 R13: 7ffe14fc16b0 R14: R15: Signed-off-by: Greg Hackmann <ghackm...@google.com> --- v2: expand commit log to clarify that kernel 3.15 and later are impacted net/xfrm/xfrm_ipcomp.

Re: [PATCH v2] staging: android: ashmem: Fix lockdep issue during llseek

2018-02-27 Thread Greg Hackmann
gt;i_rwsem >>> causing a lockdep splat [2] during a syzcaller test, this patch fixes >>> the issue by unlocking the mutex earlier. Functionally that's Ok since >>> we don't need to protect vfs_llseek. >>> >>> [1] https://patchwork.kernel.org/patch/10185031

Re: Linux 4.9.93

2018-04-09 Thread Greg Hackmann
eir side to upstream (Greg?), but >> definitely >> useful to isolate actual issues. > > Ah, yeah, if you are taking anything from the Android tree, all bets are > off :) > > Greg Hackmann can probably answer the questions about CFI and these > patches, as he's working on

[PATCH] Revert "xhci: plat: Register shutdown for xhci_plat"

2018-04-12 Thread Greg Hackmann
the change made the issue go away. This reverts commit b07c12517f2aed0add8ce18146bb426b14099392. Cc: sta...@vger.kernel.org Signed-off-by: Greg Hackmann <ghackm...@google.com> --- drivers/usb/host/xhci-plat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/host/xhci-pl

Re: [PATCH] arm/arm64: smccc: Use xN for arm64 register constraints with clang

2018-03-22 Thread Greg Hackmann
t;> https://gist.github.com/xairy/ee11682ea86044a45c0291c528cd936f >> >> and another by: >> >> Greg Hackmann <ghackm...@google.com>: >> https://android-review.googlesource.com/c/kernel/common/+/645181 >> >> If you used either as a reference, you may want to credit them wi

[PATCH] fs: fix possible Spectre V1 indexing in __close_fd()

2018-09-24 Thread Greg Hackmann
__close_fd() is reachable via the close() syscall with a userspace-controlled fd. Ensure that it can't be used to speculatively access past the end of current->fdt. Reported-by: Omer Tripp Cc: sta...@vger.kernel.org Signed-off-by: Greg Hackmann --- fs/file.c | 2 ++ 1 file changed

[PATCH] timerfd: support CLOCK_BOOTTIME clock

2014-01-08 Thread Greg Hackmann
Add CLOCK_BOOTTIME support to timerfd Signed-off-by: Greg Hackmann --- fs/timerfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/timerfd.c b/fs/timerfd.c index 9293121..0013142 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -317,6 +317,7 @@ SYSCALL_DEFINE2(timerfd_create, int

Re: [PATCH] arm/arm64: smccc: Use xN for arm64 register constraints with clang

2018-03-22 Thread Greg Hackmann
91c528cd936f >> >> and another by: >> >> Greg Hackmann : >> https://android-review.googlesource.com/c/kernel/common/+/645181 >> >> If you used either as a reference, you may want to credit them with a >> `Suggested-by:` in the commit message.

[PATCH] alarmtimer: don't rate limit one-shot timers

2017-07-24 Thread Greg Hackmann
nly needed in -stable trees. 4.13-rc2 isn't impacted due to a later refactoring. Fixes: ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") Reported-by: Ben Fennema Signed-off-by: Greg Hackmann Cc: sta...@vger.kernel.org --- kernel/time/alarmtimer.c | 3 ++- 1 file changed, 2 inser

Re: [PATCH] alarmtimer: don't rate limit one-shot timers

2017-07-24 Thread Greg Hackmann
On 07/24/2017 11:21 AM, Greg KH wrote: On Mon, Jul 24, 2017 at 10:19:24AM -0700, Greg Hackmann wrote: Commit ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") sets a minimum bound on the alarm timer interval. This minimum bound shouldn't be applied if the interval is 0.

[PATCH] alarmtimer: don't rate limit one-shot timers

2017-07-25 Thread Greg Hackmann
.y. Older -stable trees have a slightly different patch, and 4.13-rc2 isn't impacted due to a later refactoring. Fixes: ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") Reported-by: Ben Fennema Signed-off-by: Greg Hackmann Cc: sta...@vger.kernel.org --- kernel/time/alarmti

[PATCH 2/2] kselftests: set-timer-lat: add one-shot timer test cases

2017-07-25 Thread Greg Hackmann
seconds and verify that the alarm fired exactly once. Signed-off-by: Greg Hackmann --- tools/testing/selftests/timers/set-timer-lat.c | 86 ++ 1 file changed, 73 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing

[PATCH 1/2] kselftests: set-timer-lat: tweak reporting when timer fires early

2017-07-25 Thread Greg Hackmann
Rather than printing an error inside the alarm signal handler, set a flag that we check later. This keeps the test from spamming the console every time the alarm fires early. It also fixes the test exiting with error code 0 if this was the only test failure. Signed-off-by: Greg Hackmann

[PATCH 0/2] kselftests: set-timer-lat: test one-shot timers

2017-07-25 Thread Greg Hackmann
the console with failure messages. The second patch actually adds the one-shot testcases. Greg Hackmann (2): kselftests: set-timer-lat: tweak reporting when timer fires early kselftests: set-timer-lat: add one-shot timer test cases tools/testing/selftests/timers/set-timer-lat.c | 103

[PATCH] staging: android: ashmem: fix a race condition in ASHMEM_SET_SIZE ioctl

2018-01-08 Thread Greg Hackmann
From: Viktor Slavkovic A lock-unlock is missing in ASHMEM_SET_SIZE ioctl which can result in a race condition when mmap is called. After the !asma->file check, before setting asma->size, asma->file can be set in mmap. That would result in having different asma->size than the mapped memory size.

[PATCH] selftests: vdso_test: support ARM64 targets

2017-10-31 Thread Greg Hackmann
ARM64's vDSO exports its gettimeofday() implementation with a different name (__kernel_gettimeofday) and version (LINUX_2.6.39) from other architectures. Add a corresponding special-case to vdso_test. Signed-off-by: Greg Hackmann --- tools/testing/selftests/vDSO/vdso_test.c | 17

[PATCH v2] selftests: vdso_test: support ARM64 targets

2017-11-01 Thread Greg Hackmann
ARM64's vDSO exports its gettimeofday() implementation with a different name (__kernel_gettimeofday) and version (LINUX_2.6.39) from other architectures. Add a corresponding special-case to vdso_test. Signed-off-by: Greg Hackmann --- Changes since v1: * Moved definitions outside main

Re: [tip:timers/core] kselftests: timers: set-timer-lat: Tweak reporting when timer fires early

2017-09-21 Thread Greg Hackmann
On 09/20/2017 04:38 PM, Shuah Khan wrote: On 09/20/2017 06:31 AM, Prarit Bhargava wrote: On 09/19/2017 11:36 PM, John Stultz wrote: On Tue, Sep 19, 2017 at 6:02 PM, Shuah Khan wrote: Hi Greg, On 08/20/2017 03:56 AM, tip-bot for Greg Hackmann wrote: Commit-ID

Re: [PATCH] selftests: timers: set-timer-lat: fix hang when std out/err are redirected

2017-09-22 Thread Greg Hackmann
ou are good with this fix. I plan to apply it to linux-kselftest fixes today. Please let me know if you have any objections. thanks, -- Shuah Thanks for looking into this. Acked-by: Greg Hackmann

Re: [PATCH] selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms

2017-09-22 Thread Greg Hackmann
On 09/22/2017 07:41 AM, Shuah Khan wrote: I assume you are good with this fix. I plan to apply it to linux-kselftest fixes today. Please let me know if you have any objections. thanks, -- Shuah AIUI this check was added so set-timer-lat would treat a missing CAP_WAKE_ALARM as a skipped test

[PATCH] Revert "xhci: plat: Register shutdown for xhci_plat"

2018-04-12 Thread Greg Hackmann
the change made the issue go away. This reverts commit b07c12517f2aed0add8ce18146bb426b14099392. Cc: sta...@vger.kernel.org Signed-off-by: Greg Hackmann --- drivers/usb/host/xhci-plat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci

Re: Linux 4.9.93

2018-04-09 Thread Greg Hackmann
a kernel with CFI' for arm64? >> >> From Google work on Android-4.9 >> >> https://android.googlesource.com/kernel/common/+/00a195e7c0752ff5d65c9caadfbcc226270ca232 >> >> I am not sure what is the plan on their side to upstream (Greg?), but >> definitely >> usef

[PATCH] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-07 Thread Greg Hackmann
org Signed-off-by: Greg Hackmann --- net/xfrm/xfrm_ipcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index ccfdc7115a83..a00ec715aa46 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -283,7 +283,7 @@ sta

Re: [PATCH] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-07 Thread Greg Hackmann
On 03/07/2018 12:21 PM, Eric Dumazet wrote: > On Wed, 2018-03-07 at 11:24 -0800, Greg Hackmann wrote: >> f7c83bcbfaf5 ("net: xfrm: use __this_cpu_read per-cpu helper") added >> a >> __this_cpu_read() call inside ipcomp_alloc_tfms().  Since this call >> was &g

[PATCH v2 net] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-07 Thread Greg Hackmann
fc15c0 R10: R11: 0207 R12: 00400440 R13: 7ffe14fc16b0 R14: R15: Signed-off-by: Greg Hackmann --- v2: expand commit log to clarify that kernel 3.15 and later are impacted net/xfrm/xfrm_ipcomp.c | 2 +- 1 file changed, 1

Re: [PATCH v2] staging: android: ashmem: Fix lockdep issue during llseek

2018-02-27 Thread Greg Hackmann
ckdep splat [2] during a syzcaller test, this patch fixes >>> the issue by unlocking the mutex earlier. Functionally that's Ok since >>> we don't need to protect vfs_llseek. >>> >>> [1] https://patchwork.kernel.org/patch/10185031/ >>> [2] https://lkml.or

Re: [PATCH 1/4] kasan: support alloca() poisoning

2017-07-13 Thread Greg Hackmann
Hi, Thanks for taking a look at this patchstack. I apologize for the delay in responding. On 07/10/2017 01:44 AM, Dmitry Vyukov wrote: + + const void *left_redzone = (const void *)(addr - + KASAN_ALLOCA_REDZONE_SIZE); + const void *right_redzone = (const

Re: [PATCH 1/4] kasan: support alloca() poisoning

2017-07-13 Thread Greg Hackmann
On 07/10/2017 03:30 AM, Andrey Ryabinin wrote: gcc now supports this too. So I think this patch should enable it. It's off by default so you'll have to add --param asan-instrument-allocas=1 into cflags to make it work Thanks, will fix. For now, it looks like I'll need to build gcc from git

[PATCH 0/4] kasan: add clang support

2017-07-06 Thread Greg Hackmann
*** Alexander Potapenko (1): kasan: added functions for unpoisoning stack variables Greg Hackmann (3): kasan: support alloca() poisoning kasan: support LLVM-style asan parameters kasan: add compiler support for clang include/linux/compiler-clang.h | 10 ++ lib/test_kasan.c

[PATCH 3/4] kasan: support LLVM-style asan parameters

2017-07-06 Thread Greg Hackmann
Use cc-option to figure out whether the compiler's sanitizer uses LLVM-style parameters ("-mllvm -asan-foo=bar") or GCC-style parameters ("--param asan-foo=bar"). Signed-off-by: Greg Hackmann --- scripts/Makefile.kasan | 10 +- 1 file changed, 9 insertions(+), 1 del

[PATCH 1/4] kasan: support alloca() poisoning

2017-07-06 Thread Greg Hackmann
of the dynamic stack area, so unpoisoning is simpler. Signed-off-by: Greg Hackmann --- lib/test_kasan.c | 22 ++ mm/kasan/kasan.c | 26 ++ mm/kasan/kasan.h | 8 mm/kasan/report.c | 3 +++ 4 files changed, 59 insertions(+) diff --git a/lib

[PATCH 2/4] kasan: added functions for unpoisoning stack variables

2017-07-06 Thread Greg Hackmann
. Signed-off-by: Alexander Potapenko [ghackm...@google.com: fix memset() parameters, and tweak commit message to describe new callbacks] Signed-off-by: Greg Hackmann --- mm/kasan/kasan.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index

[PATCH 4/4] kasan: add compiler support for clang

2017-07-06 Thread Greg Hackmann
For now we can hard-code ASAN ABI level 5, since historical clang builds can't build the kernel anyway. We also need to emulate gcc's __SANITIZE_ADDRESS__ flag, or memset() calls won't be instrumented. Signed-off-by: Greg Hackmann --- include/linux/compiler-clang.h | 10 ++ 1 file

Re: [PATCH 1/4] kasan: support alloca() poisoning

2017-07-06 Thread Greg Hackmann
On 07/06/2017 03:01 PM, Greg Hackmann wrote: @@ -101,6 +101,9 @@ static const char *get_shadow_bug_type(struct kasan_access_info *info) break; case KASAN_USE_AFTER_SCOPE: bug_type = "use-after-scope"; + case KASAN_ALLOCA_LEFT: +

[PATCH] arm64: remove no-op -p linker flag

2018-06-27 Thread Greg Hackmann
wards compatibility". Since this flag is a no-op on ARM64, we can safely drop it. Signed-off-by: Greg Hackmann --- arch/arm64/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 45272266dafb..79bd701071de 100644 --- a/

[PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-13 Thread Greg Hackmann
t; KPF_NOPAGE). kpageflags_read() treats the offset as valid, and stable_page_flags() will try to access an address between the user and kernel address ranges. Signed-off-by: Greg Hackmann --- arch/arm64/mm/init.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-14 Thread Greg Hackmann
On 08/14/2018 03:40 AM, Will Deacon wrote: > Hi Greg, > > On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: >> ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input >> before seeing if the PFN is valid. This leads to false positives when >

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-15 Thread Greg Hackmann
On 08/14/2018 08:29 AM, Will Deacon wrote: > On Tue, Aug 14, 2018 at 08:17:48AM -0700, Greg Hackmann wrote: >> On 08/14/2018 03:40 AM, Will Deacon wrote: >>> Hi Greg, >>> >>> On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: >>>> ARM6

[PATCH v2 2/2] arm: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-15 Thread Greg Hackmann
kernel.org Signed-off-by: Greg Hackmann --- arch/arm/mm/init.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0cc8e04295a4..bee1f2e4ecf3 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -196,7 +196,11 @@ static v

[PATCH v2 1/2] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-15 Thread Greg Hackmann
t; KPF_NOPAGE). kpageflags_read() treats the offset as valid, and stable_page_flags() will try to access an address between the user and kernel address ranges. Fixes: c1cc1552616d ("arm64: MMU initialisation") Cc: sta...@vger.kernel.org Signed-off-by: Greg Hackmann --- arch/arm64/mm/

[PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-08-31 Thread Greg Hackmann
of 4.9.y. Kernels 4.12 and later are unaffected, since all the underlying ion_handle infrastructure has been ripped out. Cc: sta...@vger.kernel.org # v4.11- Signed-off-by: Greg Hackmann --- drivers/staging/android/ion/ion-ioctl.c | 12 --- drivers/staging/android/ion/ion.c

Re: [PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-08-31 Thread Greg Hackmann
On 08/31/2018 01:12 PM, Greg Kroah-Hartman wrote: > On Fri, Aug 31, 2018 at 01:06:27PM -0700, Greg Hackmann wrote: >> The ION_IOC_{MAP,SHARE} ioctls drop and reacquire client->lock several >> times while operating on one of the client's ion_handles. This creates >> win

[PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-08-31 Thread Greg Hackmann
of 4.4.y, and applies to older kernels too. 4.9.y was fixed separately. Kernels 4.12 and later are unaffected, since all the underlying ion_handle infrastructure has been ripped out. Change-Id: Ia0542dd8134e81cd5e1412e126545303c766f738 Cc: sta...@vger.kernel.org # v4.4- Signed-off-by: Greg Ha

Re: [PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

2018-08-31 Thread Greg Hackmann
On 08/31/2018 01:27 PM, Greg Hackmann wrote: > Change-Id: Ia0542dd8134e81cd5e1412e126545303c766f738 Sorry, please disregard the Change-Id line. This is what I get for forgetting to re-run checkpatch after amending my commit message. :/

[PATCH] fs: fix possible Spectre V1 indexing in __close_fd()

2018-09-24 Thread Greg Hackmann
__close_fd() is reachable via the close() syscall with a userspace-controlled fd. Ensure that it can't be used to speculatively access past the end of current->fdt. Reported-by: Omer Tripp Cc: sta...@vger.kernel.org Signed-off-by: Greg Hackmann --- fs/file.c | 2 ++ 1 file changed

[PATCH v2] fs: fix possible Spectre V1 indexing in __close_fd()

2018-12-24 Thread Greg Hackmann
_index_nospec() to prevent speculation past the end of current->fdt. Reported-by: Omer Tripp Cc: sta...@vger.kernel.org Signed-off-by: Greg Hackmann --- v2: include Omer Tripp's analysis in commit message, and update my email address fs/file.c | 2 ++ 1 file changed, 2 insertions(+)

  1   2   >