[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.
- [PATCH 01/29] i386: move prototypes to fix implicit declaration of function, Marin Ramesa, 2013/12/09
- [PATCH 03/29] i386/i386/db_interface.c: use vm_offset_t instead of an unsigned int, Marin Ramesa, 2013/12/09
- [PATCH 06/29] device/chario.c (char_write): check if io_count is larger or equal to zero and cast it to vm_size_t, Marin Ramesa, 2013/12/09
- [PATCH 07/29] device/chario.c (char_read): check if io_count is larger or equal to zero, Marin Ramesa, 2013/12/09
- [PATCH 08/29] device/chario.c: trivial stylistic fix for consistency, Marin Ramesa, 2013/12/09
- [PATCH 09/29] device/cirbuf.c (getc): use char instead of an unsigned char, Marin Ramesa, 2013/12/09
- [PATCH 10/29] device/cirbuf.c (cb_alloc): use vm_size_t instead of an int, Marin Ramesa, 2013/12/09
- [PATCH 11/29] device/cirbuf.c (cb_free): use vm_size_t instead of an int, Marin Ramesa, 2013/12/09