epoll_create(0) becomes not to fail (Re: issue with epoll system call)
Hi Verma,
I think your point is right. but descriptions looks not straight forward. And title of the message is very confusable.
I think descriptions like following would be easy to understand, and you should attach a your signed-off patch to fix the bug.
Thanks,
Hiro
----
The following patch changed behavior of epoll_create(0);
Before applying the patch,sys_epoll_create2(int size, int flags)
returned -EINVAL, with size=0;
But, if-condtion which is introduced in sys_epoll_create() by this patch, looks to fail to consider case of size==0 as follows;
asmlinkage long sys_epoll_create(int size)
{
- return sys_epoll_create2(size, 0);
+ if (size < 0)
+ return -EINVAL;
+
+ return sys_epoll_create1(0);
}
---
Hiroyuki Machida
Quoted 38 lines · rohit verma
hi all,
The man pages of
epoll_createsays - "Since Linux 2.6.8, the size argument is unused. (The kernel dynamically sizes the required data structures without needing this initial hint.)" .Also, it says that the syscall returns EINVAL , when size is not positive. (i.e For, any value greater than 0, the kernel dynamically sizes the required data stuctures). When size is zero or less than zero, it has to return with error as EINVAL.
shows the latest patch of the epoll syscall. here , the syscall says:
asmlinkage long
sys_epoll_create(int size)
{
- returnsys_epoll_create2(size,0);
+ if (size < 0)
+ return-EINVAL;(quoted diff) +2
-0+ +return sys_epoll_create1(0);}
So if size = 0, it returns success which might not be the expected result. So i feel that the condition check should be
" if (size <= 0) ". could u please check on this and reply me..Thank you,
Regards,
rohit
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 6 lines · Hiroyuki Machida
Hi Verma,
I think your point is right. but descriptions looks not straight forward. And title of the message is very confusable.
I think descriptions like following would be easy to understand, and you should attach a your signed-off patch to fix the bug.
Thanks, will take care of it. Unless you want to do me a favour and post a properly formatted patch that I can ACK. Both the ones I've seen do not fit the bill.
- Davide
hi,
I have created a patch for epoll_create syscall as shown below. Plz have a check and
get back to me.
diff a/fs/eventpoll.c b/fs/eventpoll.c
eventpoll.c 2009-05-12 12:10:14.000000000 +0530 renamed from eventpoll_orig.c 2009-05-12 12:07:27.000000000 +0530 +0 -0
@@ -1136,7 +1136,7 @@
SYSCALL_DEFINE1(epoll_create, int, size)
{
- if (size < 0)
+ if (size <= 0)
return -EINVAL;
return sys_epoll_create1(0);
Since there might be some formatting problems, i'm also attaching the patch in this
mail.
Regards,
Rohit
Quoted 72 lines · Hiroyuki Machida
Hi Verma,
I think your point is right. but descriptions looks not straight forward. And title of the message is very confusable.
I think descriptions like following would be easy to understand, and you should attach a your signed-off patch to fix the bug.Thanks,
Hiro----
The following patch changed behavior of
epoll_create(0);Before applying the patch,
sys_epoll_create2(int size, int flags)
returned-EINVAL, with size=0;But, if-condtion which is introduced in
sys_epoll_create()by this patch, looks to fail to consider case of size==0 as follows;asmlinkage long
sys_epoll_create(int size)
{
- returnsys_epoll_create2(size, 0);
+ if (size < 0)
+ return-EINVAL;
+
+ returnsys_epoll_create1(0);
}---
Hiroyuki MachidaQuoted 30 lines · rohit verma
hi all,
The man pages of
epoll_createsays - "Since Linux 2.6.8, the size argument is unused. (The kernel dynamically sizes the required data structures without needing this initial hint.)" .Also, it says that the syscall returns EINVAL , when size is not positive. (i.e For, any value greater than 0, the kernel dynamically sizes the required data stuctures). When size is zero or less than zero, it has to return with error as EINVAL.
shows the latest patch of the epoll syscall. here , the syscall says:
asmlinkage long
sys_epoll_create(int size)
{
- returnsys_epoll_create2(size,0);
+ if (size < 0)
+ return-EINVAL;(quoted diff) +2
-0+ +return sys_epoll_create1(0);}
So if size = 0, it returns success which might not be the expected result. So i feel that the condition check should be
" if (size <= 0) ". could u please check on this and reply me..Thank you,
Quoted 8 lines
Quoted 8 lines
Regards,
rohit
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
eventpoll.c renamed from eventpoll_orig.c +1 -1
@@ -1136,7 +1136,7 @@ SYSCALL_DEFINE1(epoll_create, int, size) { -if (size <0 ) +if (size <=0 )return -EINVAL ;return sys_epoll_create1 (0 );
Quoted 5 lines · rohit verma
hi,
I have created a patch for
epoll_createsyscall as shown below. Plz have a check and
get back to me.
Never mind. I'll submit myself ..
Quoted 100 lines
diff a/fs/eventpoll.c
b/fs/eventpoll.ceventpoll.c 2009-05-12 12:10:14.000000000 +0530 renamed from eventpoll_orig.c 2009-05-12 12:07:27.000000000 +0530 +1
-1@@ -1136,7 +1136,7 @@ SYSCALL_DEFINE1(epoll_create, int, size) { - if (size < 0) + if (size <= 0) return -EINVAL; return sys_epoll_create1(0);Since there might be some formatting problems, i'm also attaching the patch in this
mail.Regards,
RohitQuoted 72 lines · Hiroyuki Machida
Hi Verma,
I think your point is right. but descriptions looks not straight forward. And title of the message is very confusable.
I think descriptions like following would be easy to understand, and you should attach a your signed-off patch to fix the bug.Thanks,
Hiro----
The following patch changed behavior of
epoll_create(0);Before applying the patch,
sys_epoll_create2(int size, int flags)
returned-EINVAL, with size=0;But, if-condtion which is introduced in
sys_epoll_create()by this patch, looks to fail to consider case of size==0 as follows;asmlinkage long
sys_epoll_create(int size)
{
- returnsys_epoll_create2(size, 0);
+ if (size < 0)
+ return-EINVAL;
+
+ returnsys_epoll_create1(0);
}---
Hiroyuki MachidaQuoted 30 lines · rohit verma
hi all,
The man pages of
epoll_createsays - "Since Linux 2.6.8, the size argument is unused. (The kernel dynamically sizes the required data structures without needing this initial hint.)" .Also, it says that the syscall returns EINVAL , when size is not positive. (i.e For, any value greater than 0, the kernel dynamically sizes the required data stuctures). When size is zero or less than zero, it has to return with error as EINVAL.
shows the latest patch of the epoll syscall. here , the syscall says:
asmlinkage long
sys_epoll_create(int size)
{
- returnsys_epoll_create2(size,0);
+ if (size < 0)
+ return-EINVAL;(quoted diff) +2
-0+ +return sys_epoll_create1(0);}
So if size = 0, it returns success which might not be the expected result. So i feel that the condition check should be
" if (size <= 0) ". could u please check on this and reply me..Thank you,
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Regards,
rohit
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Davide
Hi
I think it's better to read, before submitting report/patch
http://kernelnewbies.org/FoundBug
http://kernelnewbies.org/UpstreamMerge/SubmittingPatches
----
Hiroyuki Machida
Quoted 114 lines · rohit verma
hi,
I have created a patch for
epoll_createsyscall as shown below. Plz have a check and
get back to me.diff a/fs/eventpoll.c
b/fs/eventpoll.ceventpoll.c 2009-05-12 12:10:14.000000000 +0530 renamed from eventpoll_orig.c 2009-05-12 12:07:27.000000000 +0530 +1
-1@@ -1136,7 +1136,7 @@ SYSCALL_DEFINE1(epoll_create, int, size) { - if (size < 0) + if (size <= 0) return -EINVAL; return sys_epoll_create1(0);Since there might be some formatting problems, i'm also attaching the patch in this
mail.Regards,
RohitQuoted 80 lines · Hiroyuki Machida
Hi Verma,
I think your point is right. but descriptions looks not straight forward. And title of the message is very confusable.
I think descriptions like following would be easy to understand, and you should attach a your signed-off patch to fix the bug.Thanks,
Hiro----
The following patch changed behavior of
epoll_create(0);Before applying the patch,
sys_epoll_create2(int size, int flags)
returned-EINVAL, with size=0;But, if-condtion which is introduced in
sys_epoll_create()by this patch, looks to fail to consider case of size==0 as follows;asmlinkage long
sys_epoll_create(int size)
{
- returnsys_epoll_create2(size, 0);
+ if (size < 0)
+ return-EINVAL;
+
+ returnsys_epoll_create1(0);
}---
Hiroyuki MachidaQuoted 38 lines · rohit verma
hi all,
The man pages of
epoll_createsays - "Since Linux 2.6.8, the size argument is unused. (The kernel dynamically sizes the required data structures without needing this initial hint.)" .Also, it says that the syscall returns EINVAL , when size is not positive. (i.e For, any value greater than 0, the kernel dynamically sizes the required data stuctures). When size is zero or less than zero, it has to return with error as EINVAL.
shows the latest patch of the epoll syscall. here , the syscall says:
asmlinkage long
sys_epoll_create(int size)
{
- returnsys_epoll_create2(size,0);
+ if (size < 0)
+ return-EINVAL;(quoted diff) +2
-0+ +return sys_epoll_create1(0);}
So if size = 0, it returns success which might not be the expected result. So i feel that the condition check should be
" if (size <= 0) ". could u please check on this and reply me..Thank you,
Regards,
rohit
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/