From: Michael Ellerman <mpe@ellerman•id.au>
To: Segher Boessenkool <segher@kernel•crashing.org>
Cc: linuxppc-dev@ozlabs•org, chandan@linux•ibm.com,
npiggin@gmail•com, daniel@linux•ibm.com
Subject: Re: [PATCH v2] powerpc/64: Fix memcmp reading past the end of src/dest
Date: Fri, 08 Feb 2019 17:12:21 +1100 [thread overview]
Message-ID: <87bm3mkdve.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20190207125256.GW14180@gate.crashing.org>
Segher Boessenkool <segher@kernel•crashing.org> writes:
> On Thu, Feb 07, 2019 at 10:53:13PM +1100, Michael Ellerman wrote:
>> Chandan reported that fstests' generic/026 test hit a crash:
>
>> The instruction dump decodes as:
>> subfic r6,r5,8
>> rlwinm r6,r6,3,0,28
>> ldbrx r9,0,r3
>> ldbrx r10,0,r4 <-
>>
>> Which shows us doing an 8 byte load from c00000062ac3fff9, which
>> crosses the page boundary at c00000062ac40000 and faults.
>>
>> It's not OK for memcmp to read past the end of the source or
>> destination buffers.
>
> It's not okay to access memory pages unsolicited. Reading past the end
> is fine per se.
Yeah I guess that's true.
Things like KASAN/valgrind probably disagree, but KASAN at least
overrides memcmp AIUI.
I guess I feel better about it not reading past the end of the buffers,
but maybe I'm being paranoid.
The other complication is we support multiple page sizes, so detecting a
page boundary is more complicated than it could be.
So I guess I'm inclined to stick with this approach, but I can update
the change log.
cheers
next prev parent reply other threads:[~2019-02-08 6:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 11:53 [PATCH v2] powerpc/64: Fix memcmp reading past the end of src/dest Michael Ellerman
2019-02-07 12:52 ` Segher Boessenkool
2019-02-08 6:12 ` Michael Ellerman [this message]
2019-02-08 15:50 ` Segher Boessenkool
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=87bm3mkdve.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=chandan@linux$(echo .)ibm.com \
--cc=daniel@linux$(echo .)ibm.com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=npiggin@gmail$(echo .)com \
--cc=segher@kernel$(echo .)crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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