diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-04-01 11:13:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-03 11:07:33 +0200 |
commit | 005b23d6b6e7e798b6799bedffc60f33494058ea (patch) | |
tree | e69f0a21a62d74a1d0b155592b7255b3cdc31fa4 /drivers/staging/lustre | |
parent | faec8ab42b4a0f119a1cfbceef0c14b7b61059cb (diff) | |
download | op-kernel-dev-005b23d6b6e7e798b6799bedffc60f33494058ea.zip op-kernel-dev-005b23d6b6e7e798b6799bedffc60f33494058ea.tar.gz |
staging: lustre: prevent underflows in lnet_parse_reply()
I don't know if "hdr->payload_length;" can really be negative, but if so
then we shouldn't allow it. Do the comparison as an unsigned.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/lib-move.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 0f53c76..c2fb70e 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -1530,7 +1530,7 @@ lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg) LASSERT(md->md_offset == 0); rlength = hdr->payload_length; - mlength = min_t(int, rlength, md->md_length); + mlength = min_t(uint, rlength, md->md_length); if (mlength < rlength && (md->md_options & LNET_MD_TRUNCATE) == 0) { |