Hi, Paul,

I've just started playing with the new patchset and found a few issues.

[EMAIL PROTECTED] wrote:
> +ssize_t res_group_file_write(struct container *cont,
> +                                struct cftype *cft,
> +                                struct file *file,
> +                                const char __user *userbuf,
> +                                size_t nbytes, loff_t *ppos)
> +{
> +     struct res_group_cft *rgcft = container_of(cft, struct res_group_cft, 
> cft);
> +     struct res_controller *ctlr = rgcft->ctlr;
> +
> +     if (nbytes >= PAGE_SIZE)
> +             return -E2BIG;
> +
> +     char *buf;
> +     ssize_t retval;
> +     int filetype = cft->private;
> +
> +     buf = kmalloc(nbytes + 1, GFP_USER);

This should be kmalloc(nbytes), an echo ".." has a "\n" associated
with it.

> +     if (!buf) return -ENOMEM;
> +     if (copy_from_user(buf, userbuf, nbytes)) {
> +             retval = -EFAULT;
> +             goto out1;
> +     }
> +     buf[nbytes] = 0;        /* nul-terminate */
> +

this should be buf[nbytes - 1]



-- 

        Balbir Singh,
        Linux Technology Center,
        IBM Software Labs

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to