xfs: prevent swapext from operating on write-only files
authorDan Rosenberg <dan.j.rosenberg@gmail.com>
Thu, 24 Jun 2010 02:07:47 +0000 (12:07 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 24 Jun 2010 02:07:47 +0000 (12:07 +1000)
This patch prevents user "foo" from using the SWAPEXT ioctl to swap
a write-only file owned by user "bar" into a file owned by "foo" and
subsequently reading it.  It does so by checking that the file
descriptors passed to the ioctl are also opened for reading.

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>

No differences found