All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Disallow 32bit project quota id.
@ 2010-08-26  7:02 Arkadiusz Miśkiewicz
  2010-08-26  8:12 ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: Arkadiusz Miśkiewicz @ 2010-08-26  7:02 UTC (permalink / raw)
  To: xfs

Currently on-disk structure is able to keep only 16bit project quota id,
so disallow 32bit ones. This fixes a problem where part of kernel
structures holding project quota id uses 32bit variable while part
(on-disk) uses 16bit variable which causes project quota member files
to be inaccessible for some operations (like mv/rm).

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
---

Please queue for upcoming 2.6.36 fixes.


 fs/xfs/linux-2.6/xfs_ioctl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 237f5ff..0166226 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -906,6 +906,10 @@ xfs_ioctl_setattr(
 	if (XFS_FORCED_SHUTDOWN(mp))
 		return XFS_ERROR(EIO);
 
+	/* Disallow 32bit project ids that because on-disk structure is 16bit only */
+	if (fa->fsx_projid > (__uint16_t)-1)
+		return XFS_ERROR(EINVAL);
+
 	/*
 	 * If disk quotas is on, we make sure that the dquots do exist on disk,
 	 * before we start any other transactions. Trying to do this later
-- 
1.7.1.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] Disallow 32bit project quota id.
  2010-08-26  7:02 [PATCH] Disallow 32bit project quota id Arkadiusz Miśkiewicz
@ 2010-08-26  8:12 ` Dave Chinner
  2010-08-26 10:19   ` Arkadiusz Miśkiewicz
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2010-08-26  8:12 UTC (permalink / raw)
  To: Arkadiusz Miśkiewicz; +Cc: xfs

On Thu, Aug 26, 2010 at 09:02:11AM +0200, Arkadiusz Miśkiewicz wrote:
> Currently on-disk structure is able to keep only 16bit project quota id,
> so disallow 32bit ones. This fixes a problem where part of kernel
> structures holding project quota id uses 32bit variable while part
> (on-disk) uses 16bit variable which causes project quota member files
> to be inaccessible for some operations (like mv/rm).
> 
> Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
> ---
> 
> Please queue for upcoming 2.6.36 fixes.
> 
> 
>  fs/xfs/linux-2.6/xfs_ioctl.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
> index 237f5ff..0166226 100644
> --- a/fs/xfs/linux-2.6/xfs_ioctl.c
> +++ b/fs/xfs/linux-2.6/xfs_ioctl.c
> @@ -906,6 +906,10 @@ xfs_ioctl_setattr(
>  	if (XFS_FORCED_SHUTDOWN(mp))
>  		return XFS_ERROR(EIO);
>  
> +	/* Disallow 32bit project ids that because on-disk structure is 16bit only */
> +	if (fa->fsx_projid > (__uint16_t)-1)
> +		return XFS_ERROR(EINVAL);
> +

If think that needs to include a (mask & FSX_PROJID) check first.
i.e. only validate the projid if it was set by userspace.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* [PATCH] Disallow 32bit project quota id.
  2010-08-26  8:12 ` Dave Chinner
@ 2010-08-26 10:19   ` Arkadiusz Miśkiewicz
  2010-09-01 10:20     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Arkadiusz Miśkiewicz @ 2010-08-26 10:19 UTC (permalink / raw)
  To: xfs

Currently on-disk structure is able to keep only 16bit project quota id,
so disallow 32bit ones. This fixes a problem where parts of kernel
structures holding project quota id are 32bit while parts (on-disk)
are 16bit variables which causes project quota member files to be
inaccessible for some operations (like mv/rm).

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
---

Issues solved:
- FSX_PROJID in mask is checked
- 80 column issue fixed
- checkpath.pl checked


 fs/xfs/linux-2.6/xfs_ioctl.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 237f5ff..4fec427 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -907,6 +907,13 @@ xfs_ioctl_setattr(
 		return XFS_ERROR(EIO);
 
 	/*
+	 * Disallow 32bit project ids because on-disk structure
+	 * is 16bit only.
+	 */
+	if ((mask & FSX_PROJID) && (fa->fsx_projid > (__uint16_t)-1))
+		return XFS_ERROR(EINVAL);
+
+	/*
 	 * If disk quotas is on, we make sure that the dquots do exist on disk,
 	 * before we start any other transactions. Trying to do this later
 	 * is messy. We don't care to take a readlock to look at the ids
-- 
1.7.2.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] Disallow 32bit project quota id.
  2010-08-26 10:19   ` Arkadiusz Miśkiewicz
@ 2010-09-01 10:20     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2010-09-01 10:20 UTC (permalink / raw)
  To: Arkadiusz Mi??kiewicz; +Cc: xfs

On Thu, Aug 26, 2010 at 12:19:43PM +0200, Arkadiusz Mi??kiewicz wrote:
> Currently on-disk structure is able to keep only 16bit project quota id,
> so disallow 32bit ones. This fixes a problem where parts of kernel
> structures holding project quota id are 32bit while parts (on-disk)
> are 16bit variables which causes project quota member files to be
> inaccessible for some operations (like mv/rm).
> 
> Signed-off-by: Arkadiusz Mi??kiewicz <arekm@maven.pl>

Looks good,


Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2010-09-01 10:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-26  7:02 [PATCH] Disallow 32bit project quota id Arkadiusz Miśkiewicz
2010-08-26  8:12 ` Dave Chinner
2010-08-26 10:19   ` Arkadiusz Miśkiewicz
2010-09-01 10:20     ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.