From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
To: haogangchen@gmail.com
Cc: linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] FS: nilfs2: clamps ns_r_segments_percentage to [1, 99]
Date: Thu, 23 Feb 2012 00:46:50 +0900 (JST) [thread overview]
Message-ID: <20120223.004650.160012804.ryusuke@osrg.net> (raw)
In-Reply-To: <1329774930-17162-1-git-send-email-haogangchen@gmail.com>
Hi, Chen
On Mon, 20 Feb 2012 16:55:30 -0500, Haogang Chen wrote:
> ns_r_segments_percentage is read from the disk. Bogus or malicious
> value could cause integer overflow and potential security holes.
> This patch reports error when mounting such bogus volumes.
>
> Signed-off-by: Haogang Chen <haogangchen@gmail.com>
Ok, I will pick this up as a fix.
But this seems not to cause security issues; it just makes some disk
usage calculations meaningless and causes malfunction for such
out-of-range values. Right?
May I amend the change log in terms of the impact ?
Thanks,
Ryusuke Konishi
> ---
> fs/nilfs2/the_nilfs.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
> index d327140..e12b47b 100644
> --- a/fs/nilfs2/the_nilfs.c
> +++ b/fs/nilfs2/the_nilfs.c
> @@ -409,6 +409,12 @@ static int nilfs_store_disk_layout(struct the_nilfs *nilfs,
> nilfs->ns_first_data_block = le64_to_cpu(sbp->s_first_data_block);
> nilfs->ns_r_segments_percentage =
> le32_to_cpu(sbp->s_r_segments_percentage);
> + if (nilfs->ns_r_segments_percentage < 1 ||
> + nilfs->ns_r_segments_percentage > 99) {
> + printk(KERN_ERR "NILFS: invalid reserved segments percentage.\n");
> + return -EINVAL;
> + }
> +
> nilfs_set_nsegments(nilfs, le64_to_cpu(sbp->s_nsegments));
> nilfs->ns_crc_seed = le32_to_cpu(sbp->s_crc_seed);
> return 0;
> --
> 1.7.5.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-02-22 15:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 21:55 Haogang Chen
2012-02-22 15:46 ` Ryusuke Konishi [this message]
2012-02-22 15:59 ` Xi Wang
2012-02-23 2:31 ` Ryusuke Konishi
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=20120223.004650.160012804.ryusuke@osrg.net \
--to=konishi.ryusuke@lab.ntt.co.jp \
--cc=haogangchen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nilfs@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
all inboxes | Powered by JetHome®