2022-10-17 19:53:53

by Saeed Mirzamohammadi

[permalink] [raw]
Subject: [PATCH stable 4/5] vfio: do not set FMODE_LSEEK flag

From: "Jason A. Donenfeld" <[email protected]>

This file does not support llseek, so don't set the flag advertising it.

Acked-by: Alex Williamson <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>
Signed-off-by: Al Viro <[email protected]>
(cherry picked from commit 54ef7a47f67de9e87022a5310d1e8332af3e2696)
Cc: [email protected]
Signed-off-by: Saeed Mirzamohammadi <[email protected]>
---
drivers/vfio/vfio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 818e47fc0896..93346a76aa7b 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -1490,7 +1490,7 @@ static int vfio_group_get_device_fd(struct vfio_group *group, char *buf)
* Appears to be missing by lack of need rather than
* explicitly prevented. Now there's need.
*/
- filep->f_mode |= (FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE);
+ filep->f_mode |= (FMODE_PREAD | FMODE_PWRITE);

atomic_inc(&group->container_users);

--
2.31.1