Patch "hte: tegra-194: Fix off by one in tegra_hte_map_to_line_id()" 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

    hte: tegra-194: Fix off by one in tegra_hte_map_to_line_id()

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:
     hte-tegra-194-fix-off-by-one-in-tegra_hte_map_to_lin.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 2edbdd6cff58c988c4fe00e42418a844b5afc9b2
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Wed Apr 19 17:30:00 2023 +0300

    hte: tegra-194: Fix off by one in tegra_hte_map_to_line_id()
    
    [ Upstream commit e078180d66848a6a890daf0a3ce28dc43cc66790 ]
    
    The "map_sz" is the number of elements in the "m" array so the >
    comparison needs to be changed to >= to prevent an out of bounds
    read.
    
    Fixes: 09574cca6ad6 ("hte: Add Tegra194 HTE kernel provider")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Acked-by: Dipen Patel <dipenp@xxxxxxxxxx>
    Signed-off-by: Dipen Patel <dipenp@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c
index 49a27af22742b..d1b579c822797 100644
--- a/drivers/hte/hte-tegra194.c
+++ b/drivers/hte/hte-tegra194.c
@@ -251,7 +251,7 @@ static int tegra_hte_map_to_line_id(u32 eid,
 {
 
 	if (m) {
-		if (eid > map_sz)
+		if (eid >= map_sz)
 			return -EINVAL;
 		if (m[eid].slice == NV_AON_SLICE_INVALID)
 			return -EINVAL;



[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