From: Andrew Morton <akpm@linux-foundation.org>
To: "Duane Griffin" <duaneg@dghda.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Boaz Harrosh <bharrosh@panasas.com>,
Stephen@kumera.dghda.com, Tweedie@kumera.dghda.com,
sct@redhat.com, Andrew@kumera.dghda.com, Morton@kumera.dghda.com,
adilger@sun.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH, v2] ext3: ensure link targets are NULL-terminated
Date: Thu, 11 Dec 2008 19:32:28 -0800 [thread overview]
Message-ID: <20081211193228.51c34114.akpm@linux-foundation.org> (raw)
In-Reply-To: <20081211222605.GB18665@dastardly.home.dghda.com>
On Thu, 11 Dec 2008 22:26:05 +0000 "Duane Griffin" <duaneg@dghda.com> wrote:
> Ensure link targets are NUL-terminated, even if corrupted on-disk.
>
> Signed-off-by: Duane Griffin <duaneg@dghda.com>
> ---
>
> V2: terminate when the link is read instead of every time it is
> followed, as suggested by Dave Kleikamp.
>
> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
> index f8424ad..c168781 100644
> --- a/fs/ext3/inode.c
> +++ b/fs/ext3/inode.c
> @@ -2817,9 +2817,10 @@ struct inode *ext3_iget(struct super_block *sb, unsigned long ino)
> inode->i_op = &ext3_dir_inode_operations;
> inode->i_fop = &ext3_dir_operations;
> } else if (S_ISLNK(inode->i_mode)) {
> - if (ext3_inode_is_fast_symlink(inode))
> + if (ext3_inode_is_fast_symlink(inode)) {
> inode->i_op = &ext3_fast_symlink_inode_operations;
> - else {
> + ((char *) ei->i_data)[inode->i_size] = '\0';
> + } else {
> inode->i_op = &ext3_symlink_inode_operations;
> ext3_set_aops(inode);
> }
Really? The ext2 on-disk format requires that the fast symlink be
null-terminated on disk? Even though the length is already in i_size?
It seems that's true. How un-ext2-like.
ext2 and ext4 need the same fix, yes?
next prev parent reply other threads:[~2008-12-12 3:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 19:16 [PATCH 0/11] make link target handling more robust Duane Griffin
[not found] ` <1229022995-9898-2-git-send-email-duaneg@dghda.com>
[not found] ` <1229022995-9898-3-git-send-email-duaneg@dghda.com>
[not found] ` <1229022995-9898-4-git-send-email-duaneg@dghda.com>
2008-12-11 19:16 ` [PATCH] ext2: ensure link targets are NULL-terminated Duane Griffin
2008-12-11 19:21 ` Matthew Wilcox
2008-12-11 20:25 ` Duane Griffin
2008-12-11 22:23 ` [PATCH, v2] ext2: ensure link targets are NUL-terminated Duane Griffin
[not found] ` <1229022995-9898-6-git-send-email-duaneg@dghda.com>
2008-12-11 22:26 ` [PATCH, v2] ext3: ensure link targets are NULL-terminated Duane Griffin
2008-12-12 3:32 ` Andrew Morton [this message]
2008-12-12 9:40 ` Duane Griffin
2008-12-12 10:19 ` Duane Griffin
2008-12-16 0:09 ` Andrew Morton
[not found] ` <1229022995-9898-7-git-send-email-duaneg@dghda.com>
2008-12-11 22:27 ` [PATCH, v2] ext4: ensure link targets are NUL-terminated Duane Griffin
[not found] ` <1229022995-9898-8-git-send-email-duaneg@dghda.com>
[not found] ` <1229022995-9898-9-git-send-email-duaneg@dghda.com>
2008-12-11 20:06 ` [PATCH] JFS: ensure link targets are NULL-terminated Dave Kleikamp
2008-12-11 20:34 ` Duane Griffin
[not found] ` <1229022995-9898-10-git-send-email-duaneg@dghda.com>
[not found] ` <1229022995-9898-11-git-send-email-duaneg@dghda.com>
2008-12-11 22:35 ` [PATCH, v2] sysv: ensure link targets are NUL-terminated Duane Griffin
2008-12-15 10:12 ` Al Viro
[not found] ` <1229022995-9898-12-git-send-email-duaneg@dghda.com>
2008-12-11 22:36 ` [PATCH, v2] ufs: " Duane Griffin
2008-12-14 21:12 ` Evgeniy Dushistov
2008-12-11 22:37 ` [PATCH, v2] freevxfs: " Duane Griffin
2008-12-11 19:32 ` [PATCH] eCryptfs: check readlink result was not an error before using it Michael Halcrow
2008-12-12 1:48 ` Tim Gardner
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=20081211193228.51c34114.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Andrew@kumera.dghda.com \
--cc=Morton@kumera.dghda.com \
--cc=Stephen@kumera.dghda.com \
--cc=Tweedie@kumera.dghda.com \
--cc=adilger@sun.com \
--cc=bharrosh@panasas.com \
--cc=duaneg@dghda.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.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