This *almost* fixes it for me.

OL> +   ret = do_shmat_pgoff(shmid, (char __user *) start, shmflg,
OL> +                        &addr, h->vm_end - h->vm_start, h->vm_pgoff);

As discussed on IRC, h->vm_pgoff needs to be <<PAGE_SHIFT'ed here.

Also, since do_shmat_pgoff() checks the inode size and compares it to
the vma size, (h->vm_end - h->vm_start) may not always be correct.  We
should pass the smaller of the inode and vma sizes here.

Other than that, it looks good and works well for me :)

Thanks!

-- 
Dan Smith
IBM Linux Technology Center
email: da...@us.ibm.com
_______________________________________________
Containers mailing list
contain...@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
Devel@openvz.org
https://openvz.org/mailman/listinfo/devel

Reply via email to