Re: [PATCH] ntp: remove accidental integer wrap-around

2024-05-06 Thread John Stultz
On Mon, May 6, 2024 at 9:34 PM Justin Stitt wrote: > Let's introduce a new macro and use that against NTP_PHASE_LIMIT to > properly limit the max size of time_maxerror without overflowing during > the check itself. > > Link: https://github.com/llvm/llvm-project/pull/82432 [1] > Closes: https://git

[PATCH] cdrom: rearrange last_media_change check to avoid unintentional overflow

2024-05-06 Thread Justin Stitt
When running syzkaller with the newly reintroduced signed integer wrap sanitizer we encounter this splat: [ 366.015950] UBSAN: signed-integer-overflow in ../drivers/cdrom/cdrom.c:2361:33 [ 366.021089] -9223372036854775808 - 346321 cannot be represented in type '__s64' (aka 'long long') [ 366.

[PATCH] ntp: remove accidental integer wrap-around

2024-05-06 Thread Justin Stitt
Using syzkaller alongside the newly reintroduced signed integer overflow sanitizer spits out this report: [ 138.454979] [ cut here ] [ 138.458089] UBSAN: signed-integer-overflow in ../kernel/time/ntp.c:461:16 [ 138.462134] 9223372036854775807 + 500 cannot be represented

Re: [PATCH v2] objtool: Report section name in elf_init_reloc_text_sym() warning

2024-05-06 Thread Josh Poimboeuf
On Mon, May 06, 2024 at 08:55:54AM -0700, Kees Cook wrote: > While tracking down issues with LKDTM's .rodata "function", I found > the warning from elf_init_reloc_text_sym() to be unhelpful because it > wasn't clear which calling path it was coming from. Report the sec->name > and rephrase the warn

Re: [RFC PATCH v3 3/5] KVM: x86: Add notifications for Heki policy configuration and violation

2024-05-06 Thread Sean Christopherson
On Mon, May 06, 2024, Mickaël Salaün wrote: > On Fri, May 03, 2024 at 07:03:21AM GMT, Sean Christopherson wrote: > > > --- > > > > > > Changes since v1: > > > * New patch. Making user space aware of Heki properties was requested by > > > Sean Christopherson. > > > > No, I suggested having users

Re: [PATCH v2] perf/ring_buffer: Prefer struct_size over open coded arithmetic

2024-05-06 Thread Christophe JAILLET
Le 06/05/2024 à 18:23, Kees Cook a écrit : On Sun, May 05, 2024 at 07:31:24PM +0200, Erick Archer wrote: On Sun, May 05, 2024 at 05:24:55PM +0200, Christophe JAILLET wrote: Le 05/05/2024 à 16:15, Erick Archer a écrit : diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c inde

Re: [RFC PATCH v3 3/5] KVM: x86: Add notifications for Heki policy configuration and violation

2024-05-06 Thread Mickaël Salaün
On Fri, May 03, 2024 at 07:03:21AM GMT, Sean Christopherson wrote: > On Fri, May 03, 2024, Mickaël Salaün wrote: > > Add an interface for user space to be notified about guests' Heki policy > > and related violations. > > > > Extend the KVM_ENABLE_CAP IOCTL with KVM_CAP_HEKI_CONFIGURE and > > KVM_

Re: [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}

2024-05-06 Thread Miguel Ojeda
On Mon, May 6, 2024 at 7:42 PM Erick Archer wrote: > > Provide UAPI macros for UAPI structs that will gain annotations for > __counted_by_{le, be} attributes. > > Signed-off-by: Erick Archer I guess this is a mirror of the kernel one at https://lore.kernel.org/lkml/20240327142241.1745989-1-aleks

[PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}

2024-05-06 Thread Erick Archer
Provide UAPI macros for UAPI structs that will gain annotations for __counted_by_{le, be} attributes. Signed-off-by: Erick Archer --- include/uapi/linux/stddef.h | 8 1 file changed, 8 insertions(+) diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h index 2ec6f35cda

Re: [PATCH v2] perf/ring_buffer: Prefer struct_size over open coded arithmetic

2024-05-06 Thread Kees Cook
On Sun, May 05, 2024 at 07:31:24PM +0200, Erick Archer wrote: > On Sun, May 05, 2024 at 05:24:55PM +0200, Christophe JAILLET wrote: > > Le 05/05/2024 à 16:15, Erick Archer a écrit : > > > diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c > > > index 4013408ce012..080537eff69f 1

[PATCH v2] objtool: Report section name in elf_init_reloc_text_sym() warning

2024-05-06 Thread Kees Cook
While tracking down issues with LKDTM's .rodata "function", I found the warning from elf_init_reloc_text_sym() to be unhelpful because it wasn't clear which calling path it was coming from. Report the sec->name and rephrase the warning a bit. Additionally check for NULL sym->name, which may happen.

Re: [PATCH] objtool: Provide origin hint for elf_init_reloc_text_sym() errors

2024-05-06 Thread Kees Cook
On Sat, May 04, 2024 at 03:24:02PM -0700, Josh Poimboeuf wrote: > On Tue, Apr 30, 2024 at 04:51:07PM -0700, Kees Cook wrote: > > @@ -891,8 +892,8 @@ struct reloc *elf_init_reloc_text_sym(struct elf *elf, > > struct section *sec, > > int addend = insn_off; > > > > if (!(insn_sec->sh.sh_fl

Re: [PATCH] fs: WARN when f_count resurrection is attempted

2024-05-06 Thread Peter Zijlstra
On Fri, May 03, 2024 at 01:16:25PM -0700, Kees Cook wrote: > It should never happen that get_file() is called on a file with > f_count equal to zero. If this happens, a use-after-free condition > has happened[1], and we need to attempt a best-effort reporting of > the situation to help find the roo

Re: [POC][RFC][PATCH 1/2] mm/x86: Add wildcard * option as memmap=nn*align:name

2024-05-06 Thread Ard Biesheuvel
On Wed, 1 May 2024 at 16:59, Mike Rapoport wrote: > > On Mon, Apr 15, 2024 at 10:22:53AM -0700, Kees Cook wrote: > > On Fri, Apr 12, 2024 at 06:19:40PM -0400, Steven Rostedt wrote: > > > On Fri, 12 Apr 2024 23:59:07 +0300 > > > Mike Rapoport wrote: > > > > > > > On Tue, Apr 09, 2024 at 04:41:24PM