Commit 198e5da1 authored by Martin Schiller's avatar Martin Schiller Committed by Kleber Sacilotto de Souza

net/x25: fix called/calling length calculation in x25_parse_address_block

BugLink: https://bugs.launchpad.net/bugs/1858489

[ Upstream commit d449ba3d ]

The length of the called and calling address was not calculated
correctly (BCD encoding).
Signed-off-by: default avatarMartin Schiller <ms@dev.tdt.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 37ad32b9
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment