From: Bryan Donlan <bdonlan@gmail.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
Timo Sirainen <tss@iki.fi>,
linux-kernel@vger.kernel.org, Ulrich Drepper <drepper@redhat.com>
Subject: Re: [PATCH] Added PR_SET_PROCTITLE_AREA option for prctl()
Date: Sun, 4 Oct 2009 23:39:12 -0400 [thread overview]
Message-ID: <3e8340490910042039x54e175e7g48ec4fec2dfec6e1@mail.gmail.com> (raw)
In-Reply-To: <20091005122551.5F8F.A69D9226@jp.fujitsu.com>
On Sun, Oct 4, 2009 at 11:29 PM, KOSAKI Motohiro
<kosaki.motohiro@jp.fujitsu.com> wrote:
>> On Sun, Oct 4, 2009 at 10:48 PM, KOSAKI Motohiro
>> <kosaki.motohiro@jp.fujitsu.com> wrote:
>>
>> > + } else {
>> > + len = mm->env_end - mm->env_start;
>> > + if (len > PAGE_SIZE - res)
>> > + len = PAGE_SIZE - res;
>> > + res += access_process_vm(task, mm->env_start,
>> > + buffer+res, len, 0);
>> > + res = strnlen(buffer, res);
>> > + }
>>
>>
>> This bug was in the original code, but since you're touching it
>> anyway, it should be fixed now; if this access_process_vm fails
>> (perhaps due to the target unmapping the page in question in between
>> the two calls), bad things might happen if (error code) + res < 0, as
>> then strnlen will get a huge value in its length (possibly leading to
>> OOPS etc). It should be changed to check for an error return here and
>> fail out properly if there is an error in this second check.
>
> AFAIK, access_process_vm() never return negative value.
Ahh, okay, I had read the if (res > 0 && ...) bit in the original code
as an error test. Nevermind then.
next prev parent reply other threads:[~2009-10-05 3:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-02 21:23 Timo Sirainen
2009-10-03 2:01 ` Bryan Donlan
2009-10-03 2:47 ` Timo Sirainen
2009-10-03 2:59 ` Bryan Donlan
2009-10-03 3:21 ` Timo Sirainen
2009-10-04 14:44 ` KOSAKI Motohiro
2009-10-04 18:05 ` Bryan Donlan
2009-10-05 0:55 ` KOSAKI Motohiro
2009-10-05 1:38 ` KOSAKI Motohiro
2009-10-05 1:44 ` Bryan Donlan
2009-10-05 1:59 ` KOSAKI Motohiro
2009-10-05 2:21 ` Bryan Donlan
2009-10-05 2:24 ` KOSAKI Motohiro
2009-10-05 2:48 ` KOSAKI Motohiro
2009-10-05 3:22 ` Bryan Donlan
2009-10-05 3:29 ` KOSAKI Motohiro
2009-10-05 3:39 ` Bryan Donlan [this message]
2009-10-05 7:18 ` KOSAKI Motohiro
2009-10-05 22:56 ` Timo Sirainen
2009-10-03 11:18 ` matthieu castet
2009-10-04 15:10 ` KOSAKI Motohiro
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=3e8340490910042039x54e175e7g48ec4fec2dfec6e1@mail.gmail.com \
--to=bdonlan@gmail.com \
--cc=drepper@redhat.com \
--cc=kosaki.motohiro@gmail.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tss@iki.fi \
/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®