diff options
author | David Binder <david.binder@unisys.com> | 2017-02-01 17:38:55 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-02 13:10:48 +0100 |
commit | 308ee8aa1fd28102d078431a199106bc47d10128 (patch) | |
tree | 16af4b237e8fd36f7dc479de8951f0468a27abf9 | |
parent | 0c773962cfa605897c35dd20b910cdcba55f8a3c (diff) | |
download | linux-stable-308ee8aa1fd28102d078431a199106bc47d10128.tar.gz linux-stable-308ee8aa1fd28102d078431a199106bc47d10128.tar.bz2 linux-stable-308ee8aa1fd28102d078431a199106bc47d10128.zip |
staging: unisys: visorbus: Check controlvm message payload size
Checks the controlvm message's payload size before copying it into a
parser_context struct's name region.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/unisys/visorbus/visorchipset.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 4e630ea527e8..df2dfeb14027 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -399,6 +399,10 @@ parser_name_get(struct parser_context *ctx) struct spar_controlvm_parameters_header *phdr = NULL; phdr = (struct spar_controlvm_parameters_header *)(ctx->data); + + if (phdr->name_offset + phdr->name_length > ctx->param_bytes) + return NULL; + ctx->curr = ctx->data + phdr->name_offset; ctx->bytes_remaining = phdr->name_length; return parser_string_get(ctx); |