From: Peter Collingbourne <pcc@google.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Mark Brown <broonie@kernel.org>, Will Deacon <will@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Andrey Konovalov <andreyknvl@google.com>,
Evgenii Stepanov <eugenis@google.com>,
Ard Biesheuvel <ardb@kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Andrey Konovalov <andreyknvl@gmail.com>
Subject: Re: [PATCH v4 2/3] arm64: stacktrace: Relax frame record alignment requirement to 8 bytes
Date: Thu, 13 May 2021 09:56:02 -0700 [thread overview]
Message-ID: <CAMn1gO6HVHnYwWwWL2OgWDsnOgrqJR-pYJUYa7rZZoBgVnogtg@mail.gmail.com> (raw)
In-Reply-To: <20210513091633.GA10886@C02TD0UTHF1T.local>
On Thu, May 13, 2021 at 2:16 AM Mark Rutland <mark.rutland@arm.com> wrote:
>
> Hi Peter,
>
> On Wed, May 12, 2021 at 07:27:08PM -0700, Peter Collingbourne wrote:
> > The AAPCS places no requirements on the alignment of the frame
> > record. In theory it could be placed anywhere, although it seems
> > sensible to require it to be aligned to 8 bytes. With an upcoming
> > enhancement to tag-based KASAN Clang will begin creating frame records
> > located at an address that is only aligned to 8 bytes. Accommodate
> > such frame records in the stack unwinding code.
> >
> > As pointed out by Mark Rutland, the userspace stack unwinding code
> > has the same problem, so fix it there as well.
> >
> > Signed-off-by: Peter Collingbourne <pcc@google.com>
> > Link: https://linux-review.googlesource.com/id/Ia22c375230e67ca055e9e4bb639383567f7ad268
> > Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
> > Reviewed-by: Mark Rutland <mark.rutland@arm.com>
> > Tested-by: Mark Rutland <mark.rutland@arm.com>
> > ---
> > v4:
> > - rebase to 5.13rc1
>
> I think the rebase went slightly wrong; note below.
>
> > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
> > index 2fecbf152e80..020e575e5cd3 100644
> > --- a/arch/arm64/kernel/stacktrace.c
> > +++ b/arch/arm64/kernel/stacktrace.c
> > @@ -68,7 +68,11 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame)
> > unsigned long fp = frame->fp;
> > struct stack_info info;
> >
> > - if (fp & 0xf)
> > + /* Terminal record; nothing to unwind */
> > + if (!fp)
> > + return -ENOENT;
> > +
> > + if (fp & 0x7)
> > return -EINVAL;
>
> The terminal record check got moved later in the function by commit:
>
> 8533d5bfad41e74b ("arm64: stacktrace: restore terminal records")
>
> ... so this patch shouldn't re-add it. With that gone (and this just
> changing the alignemnt check), this looks good to me.
Thanks, fixed in v5.
Peter
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-13 16:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 2:27 [PATCH v4 1/3] arm64: Change the on_*stack functions to take a size argument Peter Collingbourne
2021-05-13 2:27 ` [PATCH v4 2/3] arm64: stacktrace: Relax frame record alignment requirement to 8 bytes Peter Collingbourne
2021-05-13 9:16 ` Mark Rutland
2021-05-13 16:56 ` Peter Collingbourne [this message]
2021-05-13 2:27 ` [PATCH v4 3/3] kasan: arm64: support specialized outlined tag mismatch checks Peter Collingbourne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMn1gO6HVHnYwWwWL2OgWDsnOgrqJR-pYJUYa7rZZoBgVnogtg@mail.gmail.com \
--to=pcc@google.com \
--cc=andreyknvl@gmail.com \
--cc=andreyknvl@google.com \
--cc=ardb@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=eugenis@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).