linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] net/x25: fix called/calling length calculation in x25_parse_address_block
@ 2018-11-27  8:50 Martin Schiller
  2018-11-27  8:50 ` [PATCH 2/3] net/x25: fix null_x25_address handling Martin Schiller
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Martin Schiller @ 2018-11-27  8:50 UTC (permalink / raw)
  To: andrew.hendry, davem
  Cc: stephen, joe, anto.cardace, linux-x25, netdev, linux-kernel,
	Martin Schiller

The length of the called and calling address was not calculated
correctly (BCD encoding).

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
---
 net/x25/af_x25.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index d49aa79b7997..5226a7f43050 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -100,7 +100,7 @@ int x25_parse_address_block(struct sk_buff *skb,
 	}
 
 	len = *skb->data;
-	needed = 1 + (len >> 4) + (len & 0x0f);
+	needed = 1 + ((len >> 4) + (len & 0x0f) + 1) / 2;
 
 	if (!pskb_may_pull(skb, needed)) {
 		/* packet is too short to hold the addresses it claims
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-29 22:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27  8:50 [PATCH 1/3] net/x25: fix called/calling length calculation in x25_parse_address_block Martin Schiller
2018-11-27  8:50 ` [PATCH 2/3] net/x25: fix null_x25_address handling Martin Schiller
2018-11-29 22:26   ` David Miller
2018-11-27  8:50 ` [PATCH 3/3] net/x25: handle call collisions Martin Schiller
2018-11-29 22:26   ` David Miller
2018-11-29 22:26 ` [PATCH 1/3] net/x25: fix called/calling length calculation in x25_parse_address_block David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).