[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v1 3/3] blktap2: Silence warnings under GCC 5.1.1



>>> On 05.10.15 at 16:57, <konrad.wilk@xxxxxxxxxx> wrote:
> On Mon, Oct 05, 2015 at 08:46:03AM -0600, Jan Beulich wrote:
>> >>> On 05.10.15 at 16:26, <konrad.wilk@xxxxxxxxxx> wrote:
>> > On Mon, Oct 05, 2015 at 04:46:55AM -0600, Jan Beulich wrote:
>> >> >>> On 05.10.15 at 10:49, <andrew.cooper3@xxxxxxxxxx> wrote:
>> >> > On 03/10/15 19:39, Konrad Rzeszutek Wilk wrote:
>> >> >> I get compile warnings telling me that
>> >> >>    s->connections[i].fd == fd
>> >> >>
>> >> >> 'i' may be past the array. Adding in an extra condition
>> >> >> on the loop fixes that.
>> >> >>
>> >> >> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
>> >> > 
>> >> > Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> >> > 
>> >> > Furthermore, I can't see any logic which prevents s->connected getting
>> >> > larger than MAX_CONNECTIONS
>> >> 
>> >> Iirc Olaf had already suggested such a patch quite some time ago,
>> >> and not having seen the point back then I also don't see the point
>> >> now: ctl_accept() prevents ->connected from growing beyond 1,
>> >> and there's no other place where the value could get incremented.
>> > 
>> > Thoughts on what to do about the compiler warnings which make this
>> > compiler errors (since we compile with -Werror) and one can't
>> > compile Xen? A different fix (make s->connected not be an array?)
>> 
>> To be honest I think this needs to be taken care of at the compiler
>> side, as I can't see any reason for the warning. The workaround
>> therefore would be to suppress the warning via -Wno-* until the
>> compiler side would get fixed. (Of course I'm open to be convinced
>> otherwise, i.e. this not being a compiler issue.)
> 
> There is an code issue here as well.
> 
> Andrew said  - there is no logic that "prevents s->connected getting larger
> than MAX_CONNECTIONS." which would resulted in accessing s->connections
> outside its array size.

And I replied to that, which I continue to think is not true.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.