Re: [PATCH] remove AND operation in choose_random_kstack_offset()

2024-06-17 Thread Arnd Bergmann
On Tue, Jun 18, 2024, at 01:31, Kees Cook wrote: > On Mon, Jun 17, 2024 at 10:33:08PM +0200, Arnd Bergmann wrote: >> On Mon, Jun 17, 2024, at 20:22, Kees Cook wrote: > > I'm all for more entropy, but arch maintainers had wanted specific > control over this value, and given the years of bikeshedding

Re: [PATCH v2] x86/traps: Enable UBSAN traps on x86

2024-06-17 Thread Thomas Gleixner
On Mon, Jun 17 2024 at 16:06, Kees Cook wrote: > On Tue, Jun 18, 2024 at 12:13:27AM +0200, Thomas Gleixner wrote: >> In fact is_valid_bugaddr() should be globally fixed up to return bool to >> match what the function name suggests. >> >> The UD type information is x86 specific and has zero busines

Re: [PATCH] remove AND operation in choose_random_kstack_offset()

2024-06-17 Thread Kees Cook
On Mon, Jun 17, 2024 at 10:33:08PM +0200, Arnd Bergmann wrote: > On Mon, Jun 17, 2024, at 20:22, Kees Cook wrote: > > On Mon, Jun 17, 2024 at 04:52:15PM +0100, Mark Rutland wrote: > >> On Mon, Jun 17, 2024 at 01:37:21PM +, Yuntao Liu wrote: > >> > Since the offset would be bitwise ANDed with 0x

Re: [PATCH v2] x86/traps: Enable UBSAN traps on x86

2024-06-17 Thread Kees Cook
On Tue, Jun 18, 2024 at 12:13:27AM +0200, Thomas Gleixner wrote: > On Wed, Jun 12 2024 at 11:42, Kees Cook wrote: > > On Tue, Jun 11, 2024 at 01:26:09PM -0700, Gatlin Newhouse wrote: > >> It seems that is_valid_bugaddr() needs to be implemented on all > >> architectures > >> and the function get_u

Re: [PATCH v2] x86/traps: Enable UBSAN traps on x86

2024-06-17 Thread Thomas Gleixner
On Wed, Jun 12 2024 at 11:42, Kees Cook wrote: > On Tue, Jun 11, 2024 at 01:26:09PM -0700, Gatlin Newhouse wrote: >> It seems that is_valid_bugaddr() needs to be implemented on all architectures >> and the function get_ud_type() replaces it here. So how should the patch >> handle >> is_valid_bugad

Re: [PATCH] init/Kconfig: extend -Wno-array-bounds to gcc 13

2024-06-17 Thread Kees Cook
*thread necromancy* On Mon, Mar 06, 2023 at 05:09:47PM -0500, Tom Rix wrote: > With gcc 13.0.1 on x86, there are several false positives like > > drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c:167:31: > error: array subscript 4 is above array bounds of ‘const struct > sparx5_psfp_gce[4]’

Re: [PATCH] remove AND operation in choose_random_kstack_offset()

2024-06-17 Thread Arnd Bergmann
On Mon, Jun 17, 2024, at 20:22, Kees Cook wrote: > On Mon, Jun 17, 2024 at 04:52:15PM +0100, Mark Rutland wrote: >> On Mon, Jun 17, 2024 at 01:37:21PM +, Yuntao Liu wrote: >> > Since the offset would be bitwise ANDed with 0x3FF in >> > add_random_kstack_offset(), so just remove AND operation he

[PATCH] MAINTAINERS: Update entries for Kees Cook

2024-06-17 Thread Kees Cook
Update current email address for Kees Cook in the MAINTAINER file to match the change from commit 4e173c825b19 ("mailmap: update entry for Kees Cook"). Signed-off-by: Kees Cook --- MAINTAINERS | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/MAIN

Re: [PATCH] remove AND operation in choose_random_kstack_offset()

2024-06-17 Thread Kees Cook
On Mon, Jun 17, 2024 at 04:52:15PM +0100, Mark Rutland wrote: > On Mon, Jun 17, 2024 at 01:37:21PM +, Yuntao Liu wrote: > > Since the offset would be bitwise ANDed with 0x3FF in > > add_random_kstack_offset(), so just remove AND operation here. > > > > Signed-off-by: Yuntao Liu > > The comme

Re: [PATCH] powerpc/pseries: Whitelist dtl slub object for copying to userspace

2024-06-17 Thread Kees Cook
On Fri, Jun 14, 2024 at 11:08:44PM +0530, Anjali K wrote: > Reading the dispatch trace log from /sys/kernel/debug/powerpc/dtl/cpu-* > results in a BUG() when the config CONFIG_HARDENED_USERCOPY is enabled as > shown below. > > kernel BUG at mm/usercopy.c:102! > Oops: Exception in kernel mo

Re: [PATCH v4 0/3] Hardening perf subsystem

2024-06-17 Thread Kees Cook
On Sat, Jun 15, 2024 at 06:09:07PM +0200, Martin Uecker wrote: > Am Freitag, dem 14.06.2024 um 12:17 +0200 schrieb Peter Zijlstra: > > On Wed, Jun 12, 2024 at 04:23:31PM -0700, Kees Cook wrote: > > > On Thu, Jun 13, 2024 at 12:08:21AM +0200, Peter Zijlstra wrote: > > > > On Wed, Jun 12, 2024 at 12:

Re: [PATCH v4 0/3] Hardening perf subsystem

2024-06-17 Thread Kees Cook
On Fri, Jun 14, 2024 at 12:17:08PM +0200, Peter Zijlstra wrote: > On Wed, Jun 12, 2024 at 04:23:31PM -0700, Kees Cook wrote: > > On Thu, Jun 13, 2024 at 12:08:21AM +0200, Peter Zijlstra wrote: > > > On Wed, Jun 12, 2024 at 12:01:19PM -0700, Kees Cook wrote: > > > > I'm happy to take patches. And fo

Re: [PATCH] remove AND operation in choose_random_kstack_offset()

2024-06-17 Thread Mark Rutland
On Mon, Jun 17, 2024 at 01:37:21PM +, Yuntao Liu wrote: > Since the offset would be bitwise ANDed with 0x3FF in > add_random_kstack_offset(), so just remove AND operation here. > > Signed-off-by: Yuntao Liu The comments in arm64 and x86 say that they're deliberately capping the offset at few

[PATCH] remove AND operation in choose_random_kstack_offset()

2024-06-17 Thread Yuntao Liu
Since the offset would be bitwise ANDed with 0x3FF in add_random_kstack_offset(), so just remove AND operation here. Signed-off-by: Yuntao Liu --- arch/arm64/kernel/syscall.c | 2 +- arch/s390/include/asm/entry-common.h | 2 +- arch/x86/include/asm/entry-common.h | 2 +- 3 files change

Re: [PATCH] powerpc/pseries: Whitelist dtl slub object for copying to userspace

2024-06-17 Thread Srikar Dronamraju
> Commit 6d07d1cd300f ("usercopy: Restrict non-usercopy caches to size 0") > requires that only whitelisted areas in slab/slub objects can be copied to > userspace when usercopy hardening is enabled using CONFIG_HARDENED_USERCOPY. > Dtl contains hypervisor dispatch events which are expected to be r