2023-01-04 19:56:45

by Mathieu Desnoyers

[permalink] [raw]
Subject: [RFC PATCH tip] rseq: Fix: Increase AT_VECTOR_SIZE_BASE to match rseq auxvec entries

Two new auxiliary vector entries are introduced for rseq without
matching increment of the AT_VECTOR_SIZE_BASE, which causes failures
with CONFIG_HARDENED_USERCOPY=y.

Reported-by: Nathan Chancellor <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Fixes: 317c8194e6ae ("rseq: Introduce feature size and alignment ELF auxiliary vector entries")
Signed-off-by: Mathieu Desnoyers <[email protected]>
---
include/linux/auxvec.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
index f68d0ec2d740..407f7005e6d6 100644
--- a/include/linux/auxvec.h
+++ b/include/linux/auxvec.h
@@ -4,6 +4,6 @@

#include <uapi/linux/auxvec.h>

-#define AT_VECTOR_SIZE_BASE 20 /* NEW_AUX_ENT entries in auxiliary table */
+#define AT_VECTOR_SIZE_BASE 22 /* NEW_AUX_ENT entries in auxiliary table */
/* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
#endif /* _LINUX_AUXVEC_H */
--
2.25.1


2023-01-04 20:05:44

by Nathan Chancellor

[permalink] [raw]
Subject: Re: [RFC PATCH tip] rseq: Fix: Increase AT_VECTOR_SIZE_BASE to match rseq auxvec entries

On Wed, Jan 04, 2023 at 02:20:54PM -0500, Mathieu Desnoyers wrote:
> Two new auxiliary vector entries are introduced for rseq without
> matching increment of the AT_VECTOR_SIZE_BASE, which causes failures
> with CONFIG_HARDENED_USERCOPY=y.
>
> Reported-by: Nathan Chancellor <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]
> Fixes: 317c8194e6ae ("rseq: Introduce feature size and alignment ELF auxiliary vector entries")
> Signed-off-by: Mathieu Desnoyers <[email protected]>

This resolves the boot failure with the configuration I tested:

Tested-by: Nathan Chancellor <[email protected]>

> ---
> include/linux/auxvec.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
> index f68d0ec2d740..407f7005e6d6 100644
> --- a/include/linux/auxvec.h
> +++ b/include/linux/auxvec.h
> @@ -4,6 +4,6 @@
>
> #include <uapi/linux/auxvec.h>
>
> -#define AT_VECTOR_SIZE_BASE 20 /* NEW_AUX_ENT entries in auxiliary table */
> +#define AT_VECTOR_SIZE_BASE 22 /* NEW_AUX_ENT entries in auxiliary table */
> /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
> #endif /* _LINUX_AUXVEC_H */
> --
> 2.25.1
>

2023-01-11 14:57:45

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [RFC PATCH tip] rseq: Fix: Increase AT_VECTOR_SIZE_BASE to match rseq auxvec entries

On Wed, Jan 04, 2023 at 12:24:09PM -0700, Nathan Chancellor wrote:
> On Wed, Jan 04, 2023 at 02:20:54PM -0500, Mathieu Desnoyers wrote:
> > Two new auxiliary vector entries are introduced for rseq without
> > matching increment of the AT_VECTOR_SIZE_BASE, which causes failures
> > with CONFIG_HARDENED_USERCOPY=y.
> >
> > Reported-by: Nathan Chancellor <[email protected]>
> > Link: https://lore.kernel.org/r/[email protected]
> > Fixes: 317c8194e6ae ("rseq: Introduce feature size and alignment ELF auxiliary vector entries")
> > Signed-off-by: Mathieu Desnoyers <[email protected]>
>
> This resolves the boot failure with the configuration I tested:
>
> Tested-by: Nathan Chancellor <[email protected]>

Thanks!

Subject: [tip: sched/core] rseq: Increase AT_VECTOR_SIZE_BASE to match rseq auxvec entries

The following commit has been merged into the sched/core branch of tip:

Commit-ID: 28c8e088427ad30b4260953f3b6f908972b77c2d
Gitweb: https://git.kernel.org/tip/28c8e088427ad30b4260953f3b6f908972b77c2d
Author: Mathieu Desnoyers <[email protected]>
AuthorDate: Wed, 04 Jan 2023 14:20:54 -05:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Thu, 12 Jan 2023 11:22:22 +01:00

rseq: Increase AT_VECTOR_SIZE_BASE to match rseq auxvec entries

Two new auxiliary vector entries are introduced for rseq without
matching increment of the AT_VECTOR_SIZE_BASE, which causes failures
with CONFIG_HARDENED_USERCOPY=y.

Fixes: 317c8194e6ae ("rseq: Introduce feature size and alignment ELF auxiliary vector entries")
Reported-by: Nathan Chancellor <[email protected]>
Signed-off-by: Mathieu Desnoyers <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
include/linux/auxvec.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
index f68d0ec..407f700 100644
--- a/include/linux/auxvec.h
+++ b/include/linux/auxvec.h
@@ -4,6 +4,6 @@

#include <uapi/linux/auxvec.h>

-#define AT_VECTOR_SIZE_BASE 20 /* NEW_AUX_ENT entries in auxiliary table */
+#define AT_VECTOR_SIZE_BASE 22 /* NEW_AUX_ENT entries in auxiliary table */
/* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
#endif /* _LINUX_AUXVEC_H */