From: Jon Hunter <jonathanh@nvidia.com>
To: Marco Elver <elver@google.com>, <peterz@infradead.org>,
<mingo@redhat.com>, <tglx@linutronix.de>
Cc: <m.szyprowski@samsung.com>, <dvyukov@google.com>,
<glider@google.com>, <arnd@arndb.de>, <christian@brauner.io>,
<axboe@kernel.dk>, <pcc@google.com>, <oleg@redhat.com>,
<kasan-dev@googlegroups.com>, <linux-arch@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH tip 1/2] signal, perf: Fix siginfo_t by avoiding u64 on 32-bit architectures
Date: Thu, 22 Apr 2021 09:15:30 +0100 [thread overview]
Message-ID: <0734b0e8-b4c0-05bb-b90c-de89edb61b5d@nvidia.com> (raw)
In-Reply-To: <20210422064437.3577327-1-elver@google.com>
On 22/04/2021 07:44, Marco Elver wrote:
> On some architectures, like Arm, the alignment of a structure is that of
> its largest member.
>
> This means that there is no portable way to add 64-bit integers to
> siginfo_t on 32-bit architectures, because siginfo_t does not contain
> any 64-bit integers on 32-bit architectures.
>
> In the case of the si_perf field, word size is sufficient since there is
> no exact requirement on size, given the data it contains is user-defined
> via perf_event_attr::sig_data. On 32-bit architectures, any excess bits
> of perf_event_attr::sig_data will therefore be truncated when copying
> into si_perf.
>
> Since this field is intended to disambiguate events (e.g. encoding
> relevant information if there are more events of the same type), 32 bits
> should provide enough entropy to do so on 32-bit architectures.
>
> For 64-bit architectures, no change is intended.
>
> Fixes: fb6cc127e0b6 ("signal: Introduce TRAP_PERF si_code and si_perf to siginfo")
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reported-by: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Marco Elver <elver@google.com>
Thanks for fixing!
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Cheers
Jon
--
nvpublic
next prev parent reply other threads:[~2021-04-22 8:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-22 6:44 Marco Elver
2021-04-22 6:44 ` [PATCH tip 2/2] signal, perf: Add missing TRAP_PERF case in siginfo_layout() Marco Elver
2021-04-22 8:15 ` Jon Hunter [this message]
2021-04-22 9:48 ` [PATCH tip 1/2] signal, perf: Fix siginfo_t by avoiding u64 on 32-bit architectures David Laight
2021-04-22 10:17 ` Marco Elver
2021-04-22 19:22 ` Marco Elver
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=0734b0e8-b4c0-05bb-b90c-de89edb61b5d@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=christian@brauner.io \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=pcc@google.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®