[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200424100719.GA456@infradead.org>
Date: Fri, 24 Apr 2020 03:07:19 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Ritesh Harjani <riteshh@...ux.ibm.com>
Cc: linux-fsdevel@...r.kernel.org, linux-xfs@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>,
"Darrick J . Wong" <darrick.wong@...cle.com>,
Christoph Hellwig <hch@...radead.org>,
Jan Kara <jack@...e.com>, tytso@....edu,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.ibm.com>,
linux-ext4@...r.kernel.org
Subject: Re: [PATCH 1/2] fibmap: Warn and return an error in case of block >
INT_MAX
On Fri, Apr 24, 2020 at 12:52:17PM +0530, Ritesh Harjani wrote:
> We better warn the fibmap user and not return a truncated and therefore
> an incorrect block map address if the bmap() returned block address
> is greater than INT_MAX (since user supplied integer pointer).
>
> It's better to WARN all user of ioctl_fibmap() and return a proper error
> code rather than silently letting a FS corruption happen if the user tries
> to fiddle around with the returned block map address.
>
> We fix this by returning an error code of -ERANGE and returning 0 as the
> block mapping address in case if it is > INT_MAX.
>
> Signed-off-by: Ritesh Harjani <riteshh@...ux.ibm.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists