From: John Hubbard <jhubbard@nvidia.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
Souptick Joarder <jrdr.linux@gmail.com>
Cc: <linux-security-module@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Jan Kara <jack@suse.cz>,
Matthew Wilcox <willy@infradead.org>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>
Subject: Re: [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*()
Date: Sat, 7 Nov 2020 21:00:26 -0800 [thread overview]
Message-ID: <1174ed3e-d33c-6de9-3873-b122013b295a@nvidia.com> (raw)
In-Reply-To: <40bd424d-6c4d-8b03-5d97-c572ca777b77@i-love.sakura.ne.jp>
On 11/7/20 8:12 PM, Tetsuo Handa wrote:
> On 2020/11/08 11:17, John Hubbard wrote:
>>> Excuse me, but Documentation/core-api/pin_user_pages.rst says
>>> "CASE 5: Pinning in order to _write_ to the data within the page"
>>> while tomoyo_dump_page() is for "_read_ the data within the page".
>>> Do we want to convert to pin_user_pages_remote() or lock_page() ?
>>>
>>
>> Sorry, I missed the direction here, was too focused on the Case 5
>> aspect. Yes. Case 5 (which, again, I think we're about to re-document)
>> is only about *writing* to data within the page.
>>
>> So in this case, where it is just reading from the page, I think it's
>> already from a gup vs pup point of view.
>>
>> btw, it's not clear to me whether the current code is susceptible to any
>> sort of problem involving something writing to the page while it
>> is being dumped (I am curious). But changing from gup to pup wouldn't
>> fix that, if it were a problem. It a separate question from this patch.
>
> The "struct page" tomoyo_dump_page() accesses is argv/envp arguments passed
> to execve() syscall. Therefore, these pages are not visible from threads
> except current thread, and thus there is no possibility that these pages
> are modified by other threads while current thread is reading.
>
Perfect. So since I accidentally left out the word "correct" above (I meant
to write, "it's already correct"), let me be extra clear: Souptick, we
should just drop this patch.
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2020-11-08 5:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-07 8:24 Souptick Joarder
2020-11-07 8:24 ` [PATCH 2/2] tomoyo: Fixed typo in documentation Souptick Joarder
2020-11-07 8:57 ` John Hubbard
2020-11-09 3:41 ` Souptick Joarder
2020-11-09 4:17 ` John Hubbard
2020-11-07 9:04 ` [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() John Hubbard
2020-11-07 19:17 ` John Hubbard
2020-11-08 1:13 ` Tetsuo Handa
2020-11-08 2:17 ` John Hubbard
2020-11-08 4:12 ` Tetsuo Handa
2020-11-08 5:00 ` John Hubbard [this message]
2020-11-09 3:38 ` Souptick Joarder
2020-11-09 3:36 ` Souptick Joarder
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=1174ed3e-d33c-6de9-3873-b122013b295a@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=jack@suse.cz \
--cc=jmorris@namei.org \
--cc=jrdr.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=serge@hallyn.com \
--cc=willy@infradead.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
all inboxes | Powered by JetHome®