xfs: prevent swapext from operating on write-only files
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: NDan Rosenberg <dan.j.rosenberg@gmail.com> Reviewed-by: NChristoph Hellwig <hch@lst.de>
Showing
想要评论请 注册 或 登录