Changing vma's vm_file

From: Robert Obryk
Date: Tue Apr 15 2008 - 16:13:24 EST


Hello everyone,

Can a file_ops mmap routine change the vm_file in the vma? I assume
the file_ops of the substituted file won't break -- question is
whether anything else can.

The only thing during mmap syscall I can notice to depend on the value
of vm_file prior to call to f_op->mmap is the whole VM_DENYWRITE
stuff. It confuses me somewhat, while it appears to do something,
while manual for mmap states that MAP_DENYWRITE is ignored. What does
it do now?

The problem I am trying to solve is creating a file which will, upon
being mmaped, duplicate a mapping belonging to a different process. I
plan to do this by substituting vm_file and calling proper f_op->mmap
in my file's f_op->mmap.

Thanks in advance for any advice,
Robert Obryk
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/