From: Andrew Morton <akpm@linux-foundation.org>
To: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-nilfs@vger.kernel.org
Subject: Re: [PATCH 1/1] nilfs2: fix potential memory overrun on inode
Date: Fri, 20 Feb 2015 13:58:42 -0800 [thread overview]
Message-ID: <20150220135842.0cd5c9338316a8a20b6a604a@linux-foundation.org> (raw)
In-Reply-To: <1424439995-613-2-git-send-email-konishi.ryusuke@lab.ntt.co.jp>
On Fri, 20 Feb 2015 22:46:35 +0900 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> wrote:
> Each inode of nilfs2 stores a root node of a b-tree, and it turned out
> to have a memory overrun issue:
>
> Each b-tree node of nilfs2 stores a set of key-value pairs and the
> number of them (in "bn_nchildren" member of nilfs_btree_node struct),
> as well as a few other "bn_*" members.
>
> Since the value of "bn_nchildren" is used for operations on the
> key-values within the b-tree node, it can cause memory access overrun
> if a large number is incorrectly set to "bn_nchildren".
>
> For instance, nilfs_btree_node_lookup() function determines the range
> of binary search with it, and too large "bn_nchildren" leads
> nilfs_btree_node_get_key() in that function to overrun.
>
> As for intermediate b-tree nodes, this is prevented by a sanity check
> performed when each node is read from a drive, however, no sanity
> check has been done for root nodes stored in inodes.
>
> This patch fixes the issue by adding missing sanity check against
> b-tree root nodes so that it's called when on-memory inodes are read
> from ifile, inode metadata file.
How would one trigger this overrun? Mount an fs with a deliberately
corrupted/inconsistent fs image?
Memory overrun sounds nasty so I'm thinking we add cc:stable to this
one. OK?
next prev parent reply other threads:[~2015-02-20 21:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-20 13:46 [PATCH 0/1] " Ryusuke Konishi
2015-02-20 13:46 ` [PATCH 1/1] " Ryusuke Konishi
2015-02-20 21:58 ` Andrew Morton [this message]
2015-02-21 0:22 ` Ryusuke Konishi
2015-02-21 1:13 ` Ryusuke Konishi
2015-02-21 2:00 ` Andrew Morton
2015-02-21 2:37 ` 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=20150220135842.0cd5c9338316a8a20b6a604a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=konishi.ryusuke@lab.ntt.co.jp \
--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®