From: Al Viro <viro@ZenIV.linux.org.uk>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: linux-kernel@vger.kernel.org, Pekka Enberg <penberg@kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] pipe: Fail cleanly when root tries F_SETPIPE_SZ with big size
Date: Fri, 18 Nov 2011 20:25:52 +0000 [thread overview]
Message-ID: <20111118202552.GB2203@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1321646674-26890-1-git-send-email-levinsasha928@gmail.com>
On Fri, Nov 18, 2011 at 10:04:34PM +0200, Sasha Levin wrote:
> + if (nr_pages * sizeof(struct pipe_buffer) > KMALLOC_MAX_SIZE)
> + return -ENOMEM;
nr_pages is unsigned long, sizeof is greater than 1, KMALLOC_MAX_SIZE is
unsigned long... So write that check as KMALLOC_MAX_SIZE / sizeof > nr_pages
next prev parent reply other threads:[~2011-11-18 20:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 20:04 [PATCH] pipe: Fail cleanly when root tries F_SETPIPE_SZ with big size Sasha Levin
2011-11-18 20:25 ` Al Viro [this message]
2011-11-18 21:04 ` Pekka Enberg
2011-11-18 21:20 ` Davidlohr Bueso
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=20111118202552.GB2203@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=levinsasha928@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@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