linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Fix check of dqget() return value in ext4_ioctl_setproject()
@ 2016-03-29 13:01 Seth Forshee
  2016-04-22 18:36 ` Seth Forshee
  0 siblings, 1 reply; 4+ messages in thread
From: Seth Forshee @ 2016-03-29 13:01 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: Seth Forshee, linux-ext4, linux-kernel

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(-)

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)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ext4: Fix check of dqget() return value in ext4_ioctl_setproject()
  2016-03-29 13:01 [PATCH] ext4: Fix check of dqget() return value in ext4_ioctl_setproject() Seth Forshee
@ 2016-04-22 18:36 ` Seth Forshee
  2016-05-05 12:52   ` Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Seth Forshee @ 2016-04-22 18:36 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ext4: Fix check of dqget() return value in ext4_ioctl_setproject()
  2016-04-22 18:36 ` Seth Forshee
@ 2016-05-05 12:52   ` Jan Kara
  2016-05-05 14:53     ` tytso
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kara @ 2016-05-05 12:52 UTC (permalink / raw)
  To: Seth Forshee; +Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel

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
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ext4: Fix check of dqget() return value in ext4_ioctl_setproject()
  2016-05-05 12:52   ` Jan Kara
@ 2016-05-05 14:53     ` tytso
  0 siblings, 0 replies; 4+ messages in thread
From: tytso @ 2016-05-05 14:53 UTC (permalink / raw)
  To: Jan Kara; +Cc: Seth Forshee, Andreas Dilger, linux-ext4, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-05 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-29 13:01 [PATCH] ext4: Fix check of dqget() return value in ext4_ioctl_setproject() Seth Forshee
2016-04-22 18:36 ` Seth Forshee
2016-05-05 12:52   ` Jan Kara
2016-05-05 14:53     ` tytso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).