From fb8585fc3f9b39153e0bdaf03f00a02dde9c03c6 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Tue, 24 Mar 2009 03:27:48 +0000 Subject: ctcm: avoid wraparound in length of incoming data Since the receive code should tolerate any incoming garbage, it should be protected against a potential wraparound when manipulating length values within incoming data. block_len is unsigned, so a too large subtraction will cause a wraparound. Signed-off-by: Roel Kluin Signed-off-by: Ursula Braun Signed-off-by: David S. Miller --- drivers/s390/net/ctcm_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/s390/net/ctcm_main.c') diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 59ce7fb7308..a7a25383db7 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c @@ -105,7 +105,8 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb) return; } pskb->protocol = ntohs(header->type); - if (header->length <= LL_HEADER_LENGTH) { + if ((header->length <= LL_HEADER_LENGTH) || + (len <= LL_HEADER_LENGTH)) { if (!(ch->logflags & LOG_FLAG_ILLEGALSIZE)) { CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, "%s(%s): Illegal packet size %d(%d,%d)" -- cgit v1.2.3-70-g09d2