From: Andrew Morton <akpm@linux-foundation.org>
To: Andrei Vagin <avagin@virtuozzo.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
linux-kernel@vger.kernel.org, xemul@virtuozzo.com
Subject: Re: proc: fix /proc/*/map_files lookup
Date: Wed, 29 Nov 2017 14:56:03 -0800 [thread overview]
Message-ID: <20171129145603.3adf4f0ba2bc9d4a4698d552@linux-foundation.org> (raw)
In-Reply-To: <20171128052924.GA7047@outlook.office365.com>
On Mon, 27 Nov 2017 21:29:25 -0800 Andrei Vagin <avagin@virtuozzo.com> wrote:
> On Tue, Nov 21, 2017 at 12:27:06AM +0300, Alexey Dobriyan wrote:
> > Current code does:
> >
> > if (sscanf(dentry->d_name.name, "%lx-%lx", start, end) != 2)
> >
> > However sscanf() is broken garbage.
> >
> > It silently accepts whitespace between format specifiers
> > (did you know that?).
> >
> > It silently accepts valid strings which result in integer overflow.
> >
> > Do not use sscanf() for any even remotely reliable parsing code.
>
> This patch breaks criu, criu has one places where a file name is generated
> as map_files/%p-%p
>
> openat(1048572, "map_files/0x7f9912dd5000-0x7f9912de4000", O_RDWR) = -1 ENOENT (No such file or directory) <0.000015>
>
> And this code worked before this patch and it doesn't work with this
> patch. And you have to know that we never break user-space programs ;)
>
> But seriously, the patch looks good to me, but I would prefer to not queue
> it into stable kernels.
The patch breaks CRIU but you're OK with merging it? How does that work ;)
Now I'm worried that it will break other things.
next prev parent reply other threads:[~2017-11-29 22:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 21:27 [PATCH] proc: fix /proc/*/map_files lookup Alexey Dobriyan
2017-11-20 22:16 ` Andrew Morton
2017-11-21 5:48 ` Alexey Dobriyan
2017-11-28 5:29 ` Andrei Vagin
2017-11-28 10:12 ` Alexey Dobriyan
2017-11-29 22:56 ` Andrew Morton [this message]
2017-11-29 23:23 ` Andrei Vagin
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=20171129145603.3adf4f0ba2bc9d4a4698d552@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=avagin@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xemul@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox