Re: [PATCH RFC v3 4/7] epoll: Add implementation for epoll_ctl_batch

2015-02-14 Thread Fam Zheng
On Fri, 02/13 19:06, Dan Rosenberg wrote: > > > + if (ncmds <= 0 || !cmds) > > + return -EINVAL; > > + cmd_size = sizeof(struct epoll_ctl_cmd) * ncmds; > > + kcmds = kmalloc(cmd_size, GFP_KERNEL); > You should probably fix the integer overflow in the calculation of the > cmd_size v

Re: [PATCH RFC v3 4/7] epoll: Add implementation for epoll_ctl_batch

2015-02-13 Thread Dan Rosenberg
> + if (ncmds <= 0 || !cmds) > + return -EINVAL; > + cmd_size = sizeof(struct epoll_ctl_cmd) * ncmds; > + kcmds = kmalloc(cmd_size, GFP_KERNEL); You should probably fix the integer overflow in the calculation of the cmd_size variable, unless you like root vulnerabilities.

[PATCH RFC v3 4/7] epoll: Add implementation for epoll_ctl_batch

2015-02-13 Thread Fam Zheng
This new syscall is a batched version of epoll_ctl. It will execute each command as specified in cmds in given order, and stop at first failure or upon completion of all commands. Signed-off-by: Fam Zheng --- fs/eventpoll.c | 48 ++ include