xfs
[Top] [All Lists]

Re: [PATCH v2 2/4] xfsprogs: fix integer overflow in xlog_find_verify_cy

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH v2 2/4] xfsprogs: fix integer overflow in xlog_find_verify_cycle
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 21 Dec 2015 10:45:20 +1100
Cc: Vivek Trivedi <t.vivek@xxxxxxxxxxx>, a.sahrawat@xxxxxxxxxxx, pankaj.m@xxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20151220153513.GD20135@xxxxxxxxxxxxx>
References: <1449832143-26356-1-git-send-email-t.vivek@xxxxxxxxxxx> <1449832143-26356-3-git-send-email-t.vivek@xxxxxxxxxxx> <20151220153513.GD20135@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Sun, Dec 20, 2015 at 07:35:13AM -0800, Christoph Hellwig wrote:
> On Fri, Dec 11, 2015 at 04:39:01PM +0530, Vivek Trivedi wrote:
> > Fix unintentional integer overflow in xlog_find_verify_cycle.
> > Reported by coverity.
> 
> xfs_daddr_t is a 64-bit integer.  How does replacing it with an int fix
> overlows?

xfs_daddr_t is being abused here as a count rather than a disk
address, whereas all the other counts in the function are ints and
so the value can't be more than 32 bits anyway....

> xlog_find_verify_cycle originates in the kernel code, so any fix
> should probably be done there first.

I'll pull all the libxfs changes made first in userspace back into
the kernel - no point making people jump throw hoops just to get a
fix into the libxfs code...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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