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

Re: [Patches] lio_listio() doesn't validate the aio_lio_opcode?



On 2012å02æ17æ 22:43, Khem Raj wrote:
On Fri, Feb 17, 2012 at 1:46 AM, Kang Kai<Kai.Kang@xxxxxxxxxxxxx>  wrote:
Hi All,

If pass a invalid aio_lio_opcode to lio_listio() with mode LIO_NOWAIT, it
return 0 which means success. Is this the proper action for invalid
aio_lio_opcode?

I check the source code ./sysdeps/pthread/lio_listio.c Line 81:

if (list[cnt] != NULL&&  list[cnt]->aio_lio_opcode != LIO_NOP)

it just checks aio_lio_opcode is not LIO_NOP then enqueue the request? I
wonder this is buggy.

Hi Raj,

Thanks for your reply.
for aio_lio_opcode posix says "The supported operations are LIO_READ,
LIO_WRITE, and LIO_NOP"

but it does not say what should happen if the value it not one of the above
so IMO its not a bug but falls into undefined behavior.
In this case lio_listio() return 0 but set aiocb.__errno_code to EINPROGRESS

Regards,
Kai

Anyone can help about this? Thanks.

Regards,
Kai
_______________________________________________
Patches mailing list
Patches@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/patches

_______________________________________________
Patches mailing list
Patches@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/patches