[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <94263c5c-817f-4dcf-8418-6c7e3c058557@sirena.org.uk>
Date: Thu, 18 Jan 2024 21:10:43 +0000
From: Mark Brown <broonie@...nel.org>
To: Thiago Jung Bauermann <thiago.bauermann@...aro.org>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>,
James Morse <james.morse@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Arnd Bergmann <arnd@...db.de>, Oleg Nesterov <oleg@...hat.com>,
Eric Biederman <ebiederm@...ssion.com>,
Kees Cook <keescook@...omium.org>, Shuah Khan <shuah@...nel.org>,
"Rick P. Edgecombe" <rick.p.edgecombe@...el.com>,
Deepak Gupta <debug@...osinc.com>, Ard Biesheuvel <ardb@...nel.org>,
Szabolcs Nagy <Szabolcs.Nagy@....com>,
"H.J. Lu" <hjl.tools@...il.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Florian Weimer <fweimer@...hat.com>,
Christian Brauner <brauner@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org,
kvmarm@...ts.linux.dev, linux-fsdevel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH v7 36/39] selftests/arm64: Add GCS signal tests
On Sat, Dec 16, 2023 at 11:12:37PM -0300, Thiago Jung Bauermann wrote:
> Mark Brown <broonie@...nel.org> writes:
> > +/* This should be includable from some standard header, but which? */
> > +#ifndef SEGV_CPERR
> > +#define SEGV_CPERR 10
> > +#endif
> One suggestion is include/uapi/asm-generic/siginfo.h. It already has
> SEGV_MTEAERR and SEGV_MTESERR, as well as si_codes specific to other
> arches.
Sadly the testsuite is being very clever with redefining siginfo_t which
means it conflicts with that header. I'll update the comment.
> > + if (!get_current_context(td, &context.uc, sizeof(context))) {
> > + fprintf(stderr, "Failed getting context\n");
> > + return 1;
> > + }
> At this point, before any function call is made, can the test check that
> *(gcspr + 8) == 0? This would detect the issue I mentioned in
> patch 24 of gcs_restore_signal() not zeroing the location of the cap.
Sure.
> > + if (gcs->gcspr != gcspr) {
> > + fprintf(stderr, "Got GCSPR %llx but expected %lx\n",
> > + gcs->gcspr, gcspr);
> > + return 1;
> > + }
> I suggest adding a new check here to ensure that gcs->reserved == 0.
This would mean that you couldn't use an old kselftest build to verify
a new kernel that starts using the reserved bits. It's niche but it
does seem like something that should work.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists