diff options
author | Herbert Xu | 2022-12-27 15:27:39 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-03-10 09:32:52 +0100 |
commit | 553d8b25cc5ef1742459904bca468363c9b401ec (patch) | |
tree | 82b8331b329b8f0849df2cab2957df05d8c22e88 /net/ax25/ax25_uid.c | |
parent | 62030a49158d15e4bf6ef93cdcb1202b31f58900 (diff) |
lib/mpi: Fix buffer overrun when SG is too long
[ Upstream commit 7361d1bc307b926cbca214ab67b641123c2d6357 ]
The helper mpi_read_raw_from_sgl sets the number of entries in
the SG list according to nbytes. However, if the last entry
in the SG list contains more data than nbytes, then it may overrun
the buffer because it only allocates enough memory for nbytes.
Fixes: 2d4d1eea540b ("lib/mpi: Add mpi sgl helpers")
Reported-by: Roberto Sassu <roberto.sassu@huaweicloud.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ax25/ax25_uid.c')
0 files changed, 0 insertions, 0 deletions