xfs
[Top] [All Lists]

Re: [PATCH] Disallow 32bit project quota id.

To: Arkadiusz Miśkiewicz <arekm@xxxxxxxx>
Subject: Re: [PATCH] Disallow 32bit project quota id.
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 26 Aug 2010 18:12:47 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1282806131-20163-1-git-send-email-arekm@xxxxxxxx>
References: <1282806131-20163-1-git-send-email-arekm@xxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
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@xxxxxxxx>
> ---
> 
> 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@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>