mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
hte: Fix off by one in hte_push_ts_ns()
The &chip->gdev->ei[] array has chip->nlines elements so this >
comparison needs to be >= to prevent an out of bounds access. The
gdev->ei[] array is allocated in hte_register_chip().
Fixes: 31ab09b421
("drivers: Add hardware timestamp engine (HTE) subsystem")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dipen Patel <dipenp@nvidia.com>
Acked-by: Dipen Patel <dipenp@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
0668e8ccd3
commit
e30b64a3ab
@ -811,7 +811,7 @@ int hte_push_ts_ns(const struct hte_chip *chip, u32 xlated_id,
|
||||
if (!chip || !data || !chip->gdev)
|
||||
return -EINVAL;
|
||||
|
||||
if (xlated_id > chip->nlines)
|
||||
if (xlated_id >= chip->nlines)
|
||||
return -EINVAL;
|
||||
|
||||
ei = &chip->gdev->ei[xlated_id];
|
||||
|
Loading…
Reference in New Issue
Block a user