Oren Laadan [[email protected]] wrote:
| 
| > +   /*
| > +    * TODO: If size of clone_args is not what the kernel expects, it
| > +    *       could be that kernel is newer and has an extended structure.
| > +    *       When that happens, this check needs to be smarter (and we
| > +    *       need an additional copy_from_user()). For now, assume exact
| > +    *       match.
| > +    */
| > +   if (kcs.clone_args_size != sizeof(kcs))
| > +           return -EINVAL;
| 
| I wonder if this is a reason to move the clone_args_size outside the
| structure and pass it as a regular argument ?  This will rid the
| (futuristic) additional copy-from-user (in case it causes a concern
| for clone performance ?)

Your idea makes sense to me. 

Roland, Peter Arnd: do you have any concerns with removing clone_args_size
from the structure and making it a parameter ?

        struct clone_args {
                u64 clone_flags_high;
                u64 child_stack_base;
                u64 child_stack_size;
                u64 parent_tid_ptr;
                u64 child_tid_ptr;
                u32 nr_pids;
                u32 reserved0;
                u64 reserved1;
        };

        sys_clone_with_pids(u32 flags_low, struct clone_args *cargs,
                        u32 nr_pids, u32 clone_args_size)

Sukadev
_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to