Skip to contentSkip to conversation

Patch "ax25: add link layer header validation function" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Apr 16, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ax25: add link layer header validation function

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ax25-add-link-layer-header-validation-function.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Sat Apr 16 10:02:53 PDT 2016

From: Willem de Bruijn <[email protected]>
Date: Wed, 9 Mar 2016 21:58:33 -0500
Subject: ax25: add link layer header validation function

From: Willem de Bruijn <[email protected]>

[ Upstream commit ea47781c26510e5d97f80f9aceafe9065bd5e3aa ]

As variable length protocol, AX25 fails link layer header validation tests based on a minimum length. header_ops.validate allows protocols to validate headers that are shorter than hard_header_len. Implement this callback for AX25.

See also http://comments.gmane.org/gmane.linux.network/401064

---
 net/ax25/ax25_ip.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
net/ax25/ax25_ip.c +15 -0
@@ -228,8 +228,23 @@ netdev_tx_t ax25_ip_xmit(struct sk_buff
 }
 #endif
 
+static bool ax25_validate_header(const char *header, unsigned int len)
+{
+	ax25_digi digi;
+
+	if (!len)
+		return false;
+
+	if (header[0])
+		return true;
+
+	return ax25_addr_parse(header + 1, len - 1, NULL, NULL, &digi, NULL,
+			       NULL);
+}
+
 const struct header_ops ax25_header_ops = {
 	.create = ax25_hard_header,
+	.validate = ax25_validate_header,
 };
 
 EXPORT_SYMBOL(ax25_header_ops);

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/ax25-add-link-layer-header-validation-function.patch queue-4.4/net-validate-variable-length-ll-headers.patch queue-4.4/packet-validate-variable-length-ll-headers.patch queue-4.4/macvtap-always-pass-ethernet-header-in-linear.patch queue-4.4/ipv6-udp-fix-udp_mib_ignoredmulti-updates.patch