From: Linus Torvalds <torvalds@linux-foundation.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "Jiri Kosina" <jikos@kernel.org>, "Jürgen Groß" <jgross@suse.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Michal Hocko" <mhocko@suse.com>,
"Naoya Horiguchi" <n-horiguchi@ah.jp.nec.com>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Will Deacon" <will.deacon@arm.com>
Subject: Re: Access to non-RAM pages
Date: Sun, 2 Sep 2018 19:47:33 -0700 [thread overview]
Message-ID: <CA+55aFx0b8ATmeO8KRaHrgsZnhT_0TqotsPUkxN4gbCsvrZuyA@mail.gmail.com> (raw)
In-Reply-To: <ca2ffedd94f7ca2a53c4417c801efbdd7c40eaef.camel@kernel.crashing.org>
On Sun, Sep 2, 2018 at 7:25 PM Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> Ah, my bad reading, I was looking at read_word_at_a_time() instead of
> load_unaligned_zeropad(). I'm not familiar enough with the dentry qstr
> stuff, I assume this is safe ?
The dentry qstr should always be 8-byte aligned because it's a kernel
name allocation.
So it's the path component in the actual pathname string that can be
unaligned (ct/tcount in dentry_string_cmp).
The comment actually does talk about it, although the comment also
claims that the cs read would use load_unaligned_zeropad(), which it
no longer does (now it only does the read_word_at_a_time).
And read_word_at_a_time() is purely a KASAN thing. The thing can't
fault, but it *can* read uninitialized data past the end of the
string, making KASAN unhappy.
So that's actually a different issue, where KASAN does byte-level
validity testing, and doing word-at-a-time accesses obviously violates
that for strings.
Linus
next prev parent reply other threads:[~2018-09-03 2:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 12:10 Access to non-RAM pages Juergen Gross
2018-08-31 21:18 ` Jiri Kosina
2018-09-01 10:47 ` Juergen Gross
2018-09-01 17:13 ` Al Viro
2018-09-01 21:48 ` Jiri Kosina
2018-09-01 17:27 ` Linus Torvalds
2018-09-01 18:06 ` Linus Torvalds
2018-09-03 0:48 ` Benjamin Herrenschmidt
2018-09-03 0:55 ` Benjamin Herrenschmidt
2018-09-03 1:38 ` Linus Torvalds
2018-09-03 1:42 ` Linus Torvalds
2018-09-03 2:00 ` Benjamin Herrenschmidt
2018-09-03 2:10 ` Linus Torvalds
2018-09-03 2:25 ` Benjamin Herrenschmidt
2018-09-03 2:47 ` Linus Torvalds [this message]
2018-09-03 2:52 ` Linus Torvalds
2018-09-03 3:44 ` Benjamin Herrenschmidt
2018-09-03 5:08 ` Juergen Gross
2018-09-03 6:05 ` Jiri Kosina
2018-09-03 10:36 ` Will Deacon
2018-09-03 1:44 ` Benjamin Herrenschmidt
2018-09-03 1:46 ` Benjamin Herrenschmidt
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=CA+55aFx0b8ATmeO8KRaHrgsZnhT_0TqotsPUkxN4gbCsvrZuyA@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=jgross@suse.com \
--cc=jikos@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=mpe@ellerman.id.au \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=will.deacon@arm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.