[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 11 Dec 2008 17:48:49 -0800
From: Tim Gardner <tim.gardner@...onical.com>
To: Michael Halcrow <mhalcrow@...ibm.com>
CC: Duane Griffin <duaneg@...da.com>, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Boaz Harrosh <bharrosh@...asas.com>,
Mike.Halcrow.mhalcrow@...ibm.com,
Phillip.Hellewell.phillip@...lewell.homeip.net,
ecryptfs-devel@...ts.sourceforge.net, stable@...nel.org
Subject: Re: [PATCH] eCryptfs: check readlink result was not an error before
using it
Michael Halcrow wrote:
> On Thu, Dec 11, 2008 at 07:16:26PM +0000, Duane Griffin wrote:
>> The result from readlink is being used to index into the link name
>> buffer without checking whether it is a valid length. If readlink
>> returns an error this will fault or cause memory corruption.
>>
>> Signed-off-by: Duane Griffin <duaneg@...da.com>
>
> Acked-by: Michael Halcrow <mhalcrow@...ibm.com>
>
>> ---
>> fs/ecryptfs/inode.c | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
>> index 89209f0..5e78fc1 100644
>> --- a/fs/ecryptfs/inode.c
>> +++ b/fs/ecryptfs/inode.c
>> @@ -673,10 +673,11 @@ static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd)
>> ecryptfs_printk(KERN_DEBUG, "Calling readlink w/ "
>> "dentry->d_name.name = [%s]\n", dentry->d_name.name);
>> rc = dentry->d_inode->i_op->readlink(dentry, (char __user *)buf, len);
>> - buf[rc] = '\0';
>> set_fs(old_fs);
>> if (rc < 0)
>> goto out_free;
>> + else
>> + buf[rc] = '\0';
>> rc = 0;
>> nd_set_link(nd, buf);
>> goto out;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
Please add 'Cc: stable@...nel.org' in the commit message. This looks
like a good candidate.
rtg
--
Tim Gardner tim.gardner@...onical.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists