<p dir="ltr">Is this a trunk only issue or Barrier Breaker and trunk issue?</p>
<div class="gmail_quote">On Dec 8, 2014 6:55 PM, "John Crispin" <<a href="mailto:blogic@openwrt.org">blogic@openwrt.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
there were a pile of random crashes that people reported on on ar71xx.<br>
<br>
the unaligned patch that we carry with us had a null pointer deref. the<br>
attached commit fixes this bug.<br>
<br>
If you have recently seen such crashes please update to r43560 and see<br>
if the crashes are gone now.<br>
<br>
        John<br>
<br>
<br>
-------- Original Message --------<br>
Subject: [OpenWrt-Commits] r43560 - trunk/target/linux/ar71xx/patches-3.14<br>
Date: Mon,  8 Dec 2014 11:48:28 +0100<br>
From: <a href="mailto:openwrt-commits@openwrt.org">openwrt-commits@openwrt.org</a><br>
Reply-To: OpenWrt SVN Commits <<a href="mailto:openwrt-commits@lists.openwrt.org">openwrt-commits@lists.openwrt.org</a>><br>
To: <a href="mailto:openwrt-commits@lists.openwrt.org">openwrt-commits@lists.openwrt.org</a><br>
<br>
Author: nbd<br>
Date: 2014-12-08 11:48:28 +0100 (Mon, 08 Dec 2014)<br>
New Revision: 43560<br>
<br>
Modified:<br>
   trunk/target/linux/ar71xx/patches-3.14/902-unaligned_access_hacks.patch<br>
Log:<br>
ar71xx: fix invalid pointer accesses caused by unaligned access hacks<br>
(#18455)<br>
<br>
Signed-off-by: Felix Fietkau <<a href="mailto:nbd@openwrt.org">nbd@openwrt.org</a>><br>
<br>
Modified:<br>
trunk/target/linux/ar71xx/patches-3.14/902-unaligned_access_hacks.patch<br>
===================================================================<br>
---<br>
trunk/target/linux/ar71xx/patches-3.14/902-unaligned_access_hacks.patch<br>
2014-12-08 10:04:50 UTC (rev 43559)<br>
+++<br>
trunk/target/linux/ar71xx/patches-3.14/902-unaligned_access_hacks.patch<br>
2014-12-08 10:48:28 UTC (rev 43560)<br>
@@ -319,32 +319,26 @@<br>
                        ptr--;<br>
                }<br>
                if (tunnel->parms.o_flags&GRE_KEY) {<br>
-@@ -841,9 +841,9 @@ static inline int ip6gre_xmit_ipv6(struc<br>
+@@ -841,7 +841,7 @@ static inline int ip6gre_xmit_ipv6(struc<br>
<br>
        dsfield = ipv6_get_dsfield(ipv6h);<br>
        if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)<br>
 -              fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK);<br>
 +              fl6.flowlabel |= net_hdr_word(ipv6h) & IPV6_TCLASS_MASK;<br>
        if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL)<br>
--              fl6.flowlabel |= ip6_flowlabel(ipv6h);<br>
-+              fl6.flowlabel |= ip6_flowlabel((const struct ipv6hdr<br>
*)net_hdr_word(ipv6h));<br>
+               fl6.flowlabel |= ip6_flowlabel(ipv6h);<br>
        if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)<br>
-               fl6.flowi6_mark = skb->mark;<br>
-<br>
 --- a/net/ipv6/ip6_tunnel.c<br>
 +++ b/net/ipv6/ip6_tunnel.c<br>
-@@ -1288,9 +1288,9 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str<br>
+@@ -1285,7 +1285,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str<br>
<br>
        dsfield = ipv6_get_dsfield(ipv6h);<br>
        if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)<br>
 -              fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK);<br>
 +              fl6.flowlabel |= net_hdr_word(ipv6h) & IPV6_TCLASS_MASK;<br>
        if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL)<br>
--              fl6.flowlabel |= ip6_flowlabel(ipv6h);<br>
-+              fl6.flowlabel |= ip6_flowlabel((const struct ipv6hdr<br>
*)net_hdr_word(ipv6h));<br>
+               fl6.flowlabel |= ip6_flowlabel(ipv6h);<br>
        if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)<br>
-               fl6.flowi6_mark = skb->mark;<br>
-<br>
 --- a/net/ipv6/exthdrs.c<br>
 +++ b/net/ipv6/exthdrs.c<br>
 @@ -573,7 +573,7 @@ static bool ipv6_hop_jumbo(struct sk_buf<br>
@@ -741,7 +735,7 @@<br>
                if (xb)<br>
                        return i * 32 + 31 - __fls(ntohl(xb));<br>
        }<br>
-@@ -668,12 +672,13 @@ int ip6_dst_hoplimit(struct dst_entry *d<br>
+@@ -670,17 +674,18 @@ int ip6_dst_hoplimit(struct dst_entry *d<br>
  static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,<br>
                                __be32 flowlabel)<br>
  {<br>
@@ -757,6 +751,12 @@<br>
  }<br>
<br>
  static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr)<br>
+ {<br>
+-      return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK;<br>
++      return net_hdr_word((__be32 *)hdr) & IPV6_FLOWLABEL_MASK;<br>
+ }<br>
+<br>
+ static inline u8 ip6_tclass(__be32 flowinfo)<br>
 --- a/include/net/secure_seq.h<br>
 +++ b/include/net/secure_seq.h<br>
 @@ -2,6 +2,7 @@<br>
@@ -873,7 +873,7 @@<br>
<br>
 --- a/net/ipv4/tcp_input.c<br>
 +++ b/net/ipv4/tcp_input.c<br>
-@@ -3631,14 +3631,16 @@ static bool tcp_parse_aligned_timestamp(<br>
+@@ -3629,14 +3629,16 @@ static bool tcp_parse_aligned_timestamp(<br>
  {<br>
        const __be32 *ptr = (const __be32 *)(th + 1);<br>
<br>
_______________________________________________<br>
openwrt-commits mailing list<br>
<a href="mailto:openwrt-commits@lists.openwrt.org">openwrt-commits@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits</a><br>
_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div>