Patch "lirc: rc_dev_get_from_fd(): fix file leak" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    lirc: rc_dev_get_from_fd(): fix file leak

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     lirc-rc_dev_get_from_fd-fix-file-leak.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 98d7547ee9d03b1be33b7281ec982e6f281cf998
Author: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Date:   Thu May 30 23:58:26 2024 -0400

    lirc: rc_dev_get_from_fd(): fix file leak
    
    [ Upstream commit bba1f6758a9ec90c1adac5dcf78f8a15f1bad65b ]
    
    missing fdput() on a failure exit
    
    Fixes: 6a9d552483d50 "media: rc: bpf attach/detach requires write permission" # v6.9
    Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index adb8c794a2d7b..d9a9017b96eaa 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -828,8 +828,10 @@ struct rc_dev *rc_dev_get_from_fd(int fd, bool write)
 		return ERR_PTR(-EINVAL);
 	}
 
-	if (write && !(f.file->f_mode & FMODE_WRITE))
+	if (write && !(f.file->f_mode & FMODE_WRITE)) {
+		fdput(f);
 		return ERR_PTR(-EPERM);
+	}
 
 	fh = f.file->private_data;
 	dev = fh->rc;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux