[stable,4/5] vfio: do not set FMODE_LSEEK flag

Message ID 20221017192006.36398-5-saeed.mirzamohammadi@oracle.com
State New
Headers
Series Fix missing patches in stable |

Commit Message

Saeed Mirzamohammadi Oct. 17, 2022, 7:20 p.m. UTC
  From: "Jason A. Donenfeld" <Jason@zx2c4.com>

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

Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit 54ef7a47f67de9e87022a5310d1e8332af3e2696)
Cc: stable@vger.kernel.org
Signed-off-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
---
 drivers/vfio/vfio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

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);