user data to user data device driver

user data to user data device driver

Post by Aaron Ca » Fri, 07 Feb 2003 08:38:43

Hello OpenBSD Kernel gurus,

I'm trying to find out if there is a way to copy data directly from a
buffer in one user process to the buffer in another user process via
the kernel without using intermediate kernel buffers.

I've written a device driver using the kernel intermediate copy
methology and it works but removing the extra copying would greatly
improve matters.

I've spent a fair amount of time reading the docs and the code for
copyin/copyout, uiomove, & uvm_io as well as searching the net for
information on how to perform this but I've not had any luck so far.

Any suggestions?



1. Filesystem semantics protecting meta data ... and users data

 > > <lots of flames about asynchronous write semantics of UNIX file systems
 > >  deleted>
 > Get a clue. Whoever writes sensitive data through the normal file
 > system with normal semantics deserves to get corrupted data. If you
 > want to commit data into a UNIX file system, you can do that perfectly
 > well by either using fsync(2) or by opening the file with O_SYNC
 > in the first place.

You missed the point.

If metadata is written ahead of the actual data, a crash at the wrong
time can conceivably cause file X to contain the data from file Y.

If file Y is payroll records and file X is Joe User's email, this is
not very good; you can solve the problem by writing file X
synchronously, but most of the time Joe User isn't going to do that -
especially not if he's Joe Hacker trying to exploit the problem.

This is how it happens, as the original poster presented it:

                file Y is deleted --->
                                        <--- file X is written, using
                                             blocks formerly from file Y
        file Y's inode is written --->
                                        <--- file X's inode is written
                                        <--- file X's data was never written

Now, after recovery and reboot, file X contains some blocks that used
to be in file Y... which still contain the data from file Y.

Security breach.

I don't know if this is actually possible with current filesystems;
I'd hope not, but...

   - David A. Holland          | "The right to be heard does not automatically


3. Writing data from Kernel to a data file in user space

4. Boot from CDROM fails

5. Tool to add fstab entries?

6. Traceroute doesn't work

7. How to DMA data from a pci device to a user buffer directly

8. data data data

9. user space device driver can't write to isa device

10. Data acquisition device drivers

11. How to write a device driver for data acquisition via ISA card