Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-09-03 Thread Dmitry Safonov
Big thanks on review, Al! 2016-09-03 3:20 GMT+03:00 Al Viro : > On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: >> + unsigned long n_addr = mmap_region(vdso_file_64, text_start, >> + image->size, VM_READ|VM_EXEC| >>

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-09-03 Thread Dmitry Safonov
Big thanks on review, Al! 2016-09-03 3:20 GMT+03:00 Al Viro : > On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: >> + unsigned long n_addr = mmap_region(vdso_file_64, text_start, >> + image->size, VM_READ|VM_EXEC| >> +

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-09-02 Thread Al Viro
On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: > + unsigned long n_addr = mmap_region(vdso_file_64, text_start, > + image->size, VM_READ|VM_EXEC| > + VM_DONTEXPAND|VM_SOFTDIRTY| > +

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-09-02 Thread Al Viro
On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: > + unsigned long n_addr = mmap_region(vdso_file_64, text_start, > + image->size, VM_READ|VM_EXEC| > + VM_DONTEXPAND|VM_SOFTDIRTY| > +

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-09-02 Thread Al Viro
On Tue, Aug 30, 2016 at 04:33:12PM +0200, Oleg Nesterov wrote: > > + inode = ramfs_get_inode(sb, NULL, S_IFREG | S_IRUGO | S_IXUGO, 0); > Not sure... I think alloc_anon_inode() makes more sense. Compared to this, you mean? It's going to give you the wrong permissions/i_op/a_ops, and

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-09-02 Thread Al Viro
On Tue, Aug 30, 2016 at 04:33:12PM +0200, Oleg Nesterov wrote: > > + inode = ramfs_get_inode(sb, NULL, S_IFREG | S_IRUGO | S_IXUGO, 0); > Not sure... I think alloc_anon_inode() makes more sense. Compared to this, you mean? It's going to give you the wrong permissions/i_op/a_ops, and

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-09-02 Thread Al Viro
On Mon, Aug 29, 2016 at 02:28:08AM -0700, Andy Lutomirski wrote: > On Thu, Aug 25, 2016 at 8:21 AM, Dmitry Safonov > wrote: > > I added here a new in-kernel fs with ramfs-like options. > > Created vdso file in this fs (yet for testing, only 64-bit vdso). > > Mapped this

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-09-02 Thread Al Viro
On Mon, Aug 29, 2016 at 02:28:08AM -0700, Andy Lutomirski wrote: > On Thu, Aug 25, 2016 at 8:21 AM, Dmitry Safonov > wrote: > > I added here a new in-kernel fs with ramfs-like options. > > Created vdso file in this fs (yet for testing, only 64-bit vdso). > > Mapped this file to process's mm on

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-30 Thread Andy Lutomirski
On Mon, Aug 29, 2016 at 2:50 AM, Dmitry Safonov wrote: > On 08/29/2016 12:28 PM, Andy Lutomirski wrote: >> >> On Thu, Aug 25, 2016 at 8:21 AM, Dmitry Safonov >> wrote: >>> >>> I added here a new in-kernel fs with ramfs-like options. >>> Created

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-30 Thread Andy Lutomirski
On Mon, Aug 29, 2016 at 2:50 AM, Dmitry Safonov wrote: > On 08/29/2016 12:28 PM, Andy Lutomirski wrote: >> >> On Thu, Aug 25, 2016 at 8:21 AM, Dmitry Safonov >> wrote: >>> >>> I added here a new in-kernel fs with ramfs-like options. >>> Created vdso file in this fs (yet for testing, only 64-bit

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-30 Thread Dmitry Safonov
2016-08-30 17:33 GMT+03:00 Oleg Nesterov : > On 08/25, Dmitry Safonov wrote: >> >> +static __init struct file *init_vdso_file(const struct vdso_image >> *vdso_image, >> + const char *name) >> +{ >> + struct super_block *sb; >> + struct

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-30 Thread Dmitry Safonov
2016-08-30 17:33 GMT+03:00 Oleg Nesterov : > On 08/25, Dmitry Safonov wrote: >> >> +static __init struct file *init_vdso_file(const struct vdso_image >> *vdso_image, >> + const char *name) >> +{ >> + struct super_block *sb; >> + struct qstr name_str; >>

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-30 Thread Oleg Nesterov
On 08/25, Dmitry Safonov wrote: > > +static __init struct file *init_vdso_file(const struct vdso_image > *vdso_image, > + const char *name) > +{ > + struct super_block *sb; > + struct qstr name_str; > + struct inode *inode; > + struct path path;

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-30 Thread Oleg Nesterov
On 08/25, Dmitry Safonov wrote: > > +static __init struct file *init_vdso_file(const struct vdso_image > *vdso_image, > + const char *name) > +{ > + struct super_block *sb; > + struct qstr name_str; > + struct inode *inode; > + struct path path;

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-29 Thread Dmitry Safonov
On 08/29/2016 12:28 PM, Andy Lutomirski wrote: On Thu, Aug 25, 2016 at 8:21 AM, Dmitry Safonov wrote: I added here a new in-kernel fs with ramfs-like options. Created vdso file in this fs (yet for testing, only 64-bit vdso). Mapped this file to process's mm on

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-29 Thread Dmitry Safonov
On 08/29/2016 12:28 PM, Andy Lutomirski wrote: On Thu, Aug 25, 2016 at 8:21 AM, Dmitry Safonov wrote: I added here a new in-kernel fs with ramfs-like options. Created vdso file in this fs (yet for testing, only 64-bit vdso). Mapped this file to process's mm on setup_additional_pages. Just for

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-29 Thread Dmitry Safonov
On 08/28/2016 11:14 PM, Cyrill Gorcunov wrote: On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: I added here a new in-kernel fs with ramfs-like options. Created vdso file in this fs (yet for testing, only 64-bit vdso). Mapped this file to process's mm on setup_additional_pages.

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-29 Thread Dmitry Safonov
On 08/28/2016 11:14 PM, Cyrill Gorcunov wrote: On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: I added here a new in-kernel fs with ramfs-like options. Created vdso file in this fs (yet for testing, only 64-bit vdso). Mapped this file to process's mm on setup_additional_pages.

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-29 Thread Andy Lutomirski
On Thu, Aug 25, 2016 at 8:21 AM, Dmitry Safonov wrote: > I added here a new in-kernel fs with ramfs-like options. > Created vdso file in this fs (yet for testing, only 64-bit vdso). > Mapped this file to process's mm on setup_additional_pages. > Just for testing purpose

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-29 Thread Andy Lutomirski
On Thu, Aug 25, 2016 at 8:21 AM, Dmitry Safonov wrote: > I added here a new in-kernel fs with ramfs-like options. > Created vdso file in this fs (yet for testing, only 64-bit vdso). > Mapped this file to process's mm on setup_additional_pages. > Just for testing purpose it's done only for

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-28 Thread Cyrill Gorcunov
On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: > I added here a new in-kernel fs with ramfs-like options. > Created vdso file in this fs (yet for testing, only 64-bit vdso). > Mapped this file to process's mm on setup_additional_pages. > Just for testing purpose it's done only for

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-28 Thread Cyrill Gorcunov
On Thu, Aug 25, 2016 at 06:21:08PM +0300, Dmitry Safonov wrote: > I added here a new in-kernel fs with ramfs-like options. > Created vdso file in this fs (yet for testing, only 64-bit vdso). > Mapped this file to process's mm on setup_additional_pages. > Just for testing purpose it's done only for

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-25 Thread Dmitry Safonov
On 08/25/2016 10:49 PM, Dmitry Safonov wrote: 2016-08-25 18:21 GMT+03:00 Dmitry Safonov : +static char *vdso_vma_name(struct dentry *dentry, char *buffer, int buflen) +{ + return "[vdso]"; It should be: + return dynamic_dname(dentry, buffer, buflen,

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-25 Thread Dmitry Safonov
On 08/25/2016 10:49 PM, Dmitry Safonov wrote: 2016-08-25 18:21 GMT+03:00 Dmitry Safonov : +static char *vdso_vma_name(struct dentry *dentry, char *buffer, int buflen) +{ + return "[vdso]"; It should be: + return dynamic_dname(dentry, buffer, buflen, "[vdso]"); returned pointer

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-25 Thread Dmitry Safonov
2016-08-25 18:21 GMT+03:00 Dmitry Safonov : > +static char *vdso_vma_name(struct dentry *dentry, char *buffer, int buflen) > +{ > + return "[vdso]"; It should be: + return dynamic_dname(dentry, buffer, buflen, "[vdso]"); returned pointer should be inside

Re: [RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-25 Thread Dmitry Safonov
2016-08-25 18:21 GMT+03:00 Dmitry Safonov : > +static char *vdso_vma_name(struct dentry *dentry, char *buffer, int buflen) > +{ > + return "[vdso]"; It should be: + return dynamic_dname(dentry, buffer, buflen, "[vdso]"); returned pointer should be inside buffer. --

[RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-25 Thread Dmitry Safonov
I added here a new in-kernel fs with ramfs-like options. Created vdso file in this fs (yet for testing, only 64-bit vdso). Mapped this file to process's mm on setup_additional_pages. Just for testing purpose it's done only for specific UID. Signed-off-by: Dmitry Safonov

[RFC 1/3] x86/vdso: create vdso file, use it for mapping

2016-08-25 Thread Dmitry Safonov
I added here a new in-kernel fs with ramfs-like options. Created vdso file in this fs (yet for testing, only 64-bit vdso). Mapped this file to process's mm on setup_additional_pages. Just for testing purpose it's done only for specific UID. Signed-off-by: Dmitry Safonov ---