bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH 05/29] device/blkio.c (block_io): check if io_count is larger


From: Marin Ramesa
Subject: Re: [PATCH 05/29] device/blkio.c (block_io): check if io_count is larger or equal to zero
Date: Tue, 10 Dec 2013 01:25:58 +0100

On 10.12.2013 00:48:26, Samuel Thibault wrote:
> Marin Ramesa, le Mon 09 Dec 2013 23:57:20 +0100, a écrit :
> > Check if member io_count is non-negative.
> 
> Can it really be negative?  I don't see existing functions test for
> that, so maybe it should be an unsigned long actually, and it's
> creators of ior structures which should make sure they don't stuff 
> negative values there.

Yes, maybe it should be an unsigned long. It's used as an argument in 
functions take take vm_size_t and size_t argument types (at least in 
the device directory). It seems wrong to rely on outside source to be 
correct. Who knows what will be passed as an argument. That's why I 
wrote those KERN_INVALID_ARGUMENT returns. But, on the other hand I 
don't know if this is really a problem in gnumach as there aren't so 
many writers - maybe it's assumed you know the insides of the function 
you call. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]