Yehuda Sadeh Weinraub
2008-Dec-12 22:36 UTC
[PATCH] fix wrong value returned from btrfs_listxattr when buffer is too small
Fix bug, btrfs_listxattr doesn''t return an error when the buffer size is too small (ret was overridden). Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> --- fs/btrfs/xattr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index adb4b32..4146f07 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -226,7 +226,7 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size) if (!buffer || (name_len + 1) > size_left) { ret = -ERANGE; - break; + goto err; } name_ptr = (unsigned long)(di + 1); -- 1.5.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Chris Mason
2008-Dec-17 15:22 UTC
Re: [PATCH] fix wrong value returned from btrfs_listxattr when buffer is too small
On Fri, 2008-12-12 at 14:36 -0800, Yehuda Sadeh Weinraub wrote:> Fix bug, btrfs_listxattr doesn''t return an error when the buffer size > is too small (ret was overridden). >Thank you, I''ve applied this one locally and will push it out. -chris -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Sage Weil
2008-Dec-19 00:25 UTC
Re: [PATCH] fix wrong value returned from btrfs_listxattr when buffer is too small
BTW it looks like the commit log made it into git, but not the patch itself... :) sage On Fri, 12 Dec 2008, Yehuda Sadeh Weinraub wrote:> Fix bug, btrfs_listxattr doesn''t return an error when the buffer size > is too small (ret was overridden). > > Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> > --- > fs/btrfs/xattr.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c > index adb4b32..4146f07 100644 > --- a/fs/btrfs/xattr.c > +++ b/fs/btrfs/xattr.c > @@ -226,7 +226,7 @@ ssize_t btrfs_listxattr(struct dentry *dentry, > char *buffer, size_t size) > > if (!buffer || (name_len + 1) > size_left) { > ret = -ERANGE; > - break; > + goto err; > } > > name_ptr = (unsigned long)(di + 1); > -- > 1.5.6.5 > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > >-- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Chris Mason
2008-Dec-19 01:42 UTC
Re: [PATCH] fix wrong value returned from btrfs_listxattr when buffer is too small
On Thu, 2008-12-18 at 16:25 -0800, Sage Weil wrote:> BTW it looks like the commit log made it into git, but not the patch > itself... :) >Ugh. The patch was malformed and I thought I fixed it. I think guilt is making it easy for me to mess this up ;) Thanks, will fix. -chris -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html