diff mbox

ext4: Fix check of dqget() return value in ext4_ioctl_setproject()

Message ID 1459256463-48543-1-git-send-email-seth.forshee@canonical.com
State Awaiting Upstream, archived
Headers show

Commit Message

Seth Forshee March 29, 2016, 1:01 p.m. UTC
A failed call to dqget() returns an ERR_PTR() and not null. Fix
the check in ext4_ioctl_setproject() to handle this correctly.

Fixes: 9b7365fc1c82 ("ext4: add FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support")
Cc: stable@vger.kernel.org # v4.5
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 fs/ext4/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Seth Forshee April 22, 2016, 6:36 p.m. UTC | #1
On Tue, Mar 29, 2016 at 08:01:03AM -0500, Seth Forshee wrote:
> A failed call to dqget() returns an ERR_PTR() and not null. Fix
> the check in ext4_ioctl_setproject() to handle this correctly.
> 
> Fixes: 9b7365fc1c82 ("ext4: add FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support")
> Cc: stable@vger.kernel.org # v4.5
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>

Thought I'd check and see if this patch was forgotten, I sent it nearly
a month ago but the bug is still present.

Thanks,
Seth
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Kara May 5, 2016, 12:52 p.m. UTC | #2
On Fri 22-04-16 13:36:32, Seth Forshee wrote:
> On Tue, Mar 29, 2016 at 08:01:03AM -0500, Seth Forshee wrote:
> > A failed call to dqget() returns an ERR_PTR() and not null. Fix
> > the check in ext4_ioctl_setproject() to handle this correctly.
> > 
> > Fixes: 9b7365fc1c82 ("ext4: add FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support")
> > Cc: stable@vger.kernel.org # v4.5
> > Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> 
> Thought I'd check and see if this patch was forgotten, I sent it nearly
> a month ago but the bug is still present.

Yeah, it seems Ted forgot to pull the fix. Ted? BTW, feel free to add

Reviewed-by: Jan Kara <jack@suse.cz>

									Honza
Theodore Ts'o May 5, 2016, 2:53 p.m. UTC | #3
On Thu, May 05, 2016 at 02:52:34PM +0200, Jan Kara wrote:
> On Fri 22-04-16 13:36:32, Seth Forshee wrote:
> > On Tue, Mar 29, 2016 at 08:01:03AM -0500, Seth Forshee wrote:
> > > A failed call to dqget() returns an ERR_PTR() and not null. Fix
> > > the check in ext4_ioctl_setproject() to handle this correctly.
> > > 
> > > Fixes: 9b7365fc1c82 ("ext4: add FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support")
> > > Cc: stable@vger.kernel.org # v4.5
> > > Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> > 
> > Thought I'd check and see if this patch was forgotten, I sent it nearly
> > a month ago but the bug is still present.
> 
> Yeah, it seems Ted forgot to pull the fix. Ted? BTW, feel free to add
> 
> Reviewed-by: Jan Kara <jack@suse.cz>

Applied, thanks.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 322f5bdbf76a..dd82cf1c4e39 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -365,7 +365,7 @@  static int ext4_ioctl_setproject(struct file *filp, __u32 projid)
 		struct dquot *transfer_to[MAXQUOTAS] = { };
 
 		transfer_to[PRJQUOTA] = dqget(sb, make_kqid_projid(kprojid));
-		if (transfer_to[PRJQUOTA]) {
+		if (!IS_ERR(transfer_to[PRJQUOTA])) {
 			err = __dquot_transfer(inode, transfer_to);
 			dqput(transfer_to[PRJQUOTA]);
 			if (err)