Skip to content
Commit 3a22ac9b authored by Laura Abbott's avatar Laura Abbott Committed by Bruce Ashfield
Browse files

vdpa: clean up get_config_size ret value handling

commit 0e1c61723d60074b12c61e69ffacd9137a60dd1d from
https://github.com/altera-opensource/linux-socfpga.git



[upstream commit 870aaff9]

The return type of get_config_size is size_t so it makes
sense to change the type of the variable holding its result.

That said, this already got taken care of (differently, and arguably
not as well) by commit 3ed21c14 ("vdpa: check that offsets are
within bounds").

The added 'c->off > size' test in that commit will be done as an
unsigned comparison on 32-bit (safe due to not being signed).

On a 64-bit platform, it will be done as a signed comparison, but in
that case the comparison will be done in 64-bit, and 'c->off' being an
u32 it will be valid thanks to the extended range (ie both values will
be positive in 64 bits).

So this was a real bug, but it was already addressed and marked for stable.

Signed-off-by: default avatarLaura Abbott <labbott@kernel.org>
Reported-by: default avatarLuo Likang <luolikang@nsfocus.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarWenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: default avatarBruce Ashfield <bruce.ashfield@gmail.com>
parent bb2773d5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment