From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Jarod Wilson <jarod@redhat.com>,
Jan Stancek <jstancek@redhat.com>
Subject: Re: [PATCH 2/2] proc: fix PAGE_SIZE limit of /proc/$PID/cmdline
Date: Thu, 28 May 2015 14:35:07 +0300 [thread overview]
Message-ID: <20150528113507.GK17625@uranus.sw.swsoft.com> (raw)
In-Reply-To: <CACVxJT9c38NcjqPhKXL4Tp8qra3bnGf8BOUENEph3Qg0YyXfsQ@mail.gmail.com>
On Thu, May 28, 2015 at 02:14:41PM +0300, Alexey Dobriyan wrote:
> >>
> >> It is snapshot w.r.t getting both pairs not snapshot w.r.t atomicity or
> >> something (unsigned long access is atomic after all). Once down_write()
> >> is used in the other place, it even becomes obviously correct code!
> >
> > Not at all. It is correct if and only if you're operating under lock
> > taken, once you fetch the pair and left the lock it simply local copies
> > of values the descriptor had when lock was taken.
>
> Yes, and?
>
> You do not complain that signal statistics is collected
> under sighand lock but printed for /proc/*/status without, do you?
They are different, in signal statistics we fetch the _complete_
entries, ie full copies of data. In turn you fetch only pointers
to data. Don't you see the difference? IOW, prctl modifies members
under the lock testing both the pointers and the data they points
to are valid _under_ the lock, but you instead fetch the addresses
under the lock, leave lock and continue operating with addresses,
which is wrong imho.
(I don't see some serious problem here because in worst scenario
(if someone set up bad pointers here) we simply get page fault
or some related error for application, not the kernel itself,
so I won't insist).
next prev parent reply other threads:[~2015-05-28 11:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 21:47 [PATCH 1/2] prctl: more prctl(PR_SET_MM_*) checks Alexey Dobriyan
2015-05-27 21:49 ` [PATCH 2/2] proc: fix PAGE_SIZE limit of /proc/$PID/cmdline Alexey Dobriyan
2015-05-27 22:14 ` Cyrill Gorcunov
2015-05-27 22:29 ` Alexey Dobriyan
2015-05-27 22:48 ` Cyrill Gorcunov
2015-05-27 23:12 ` Alexey Dobriyan
2015-05-28 6:59 ` Cyrill Gorcunov
2015-05-28 11:14 ` Alexey Dobriyan
2015-05-28 11:35 ` Cyrill Gorcunov [this message]
2015-05-28 12:00 ` Cyrill Gorcunov
2015-05-28 11:57 ` Jan Stancek
2015-05-27 22:02 ` [PATCH 1/2] prctl: more prctl(PR_SET_MM_*) checks Cyrill Gorcunov
2015-05-27 22:12 ` Alexey Dobriyan
2015-05-27 22:20 ` Cyrill Gorcunov
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=20150528113507.GK17625@uranus.sw.swsoft.com \
--to=gorcunov@gmail.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jarod@redhat.com \
--cc=jstancek@redhat.com \
--cc=linux-kernel@vger.kernel.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
Powered by JetHome