kernel: bump 6.1 to 6.1.54
[openwrt/staging/stintel.git] / target / linux / ath79 / patches-6.1 / 900-unaligned_access_hacks.patch
index 1971b9cd0101855805a5e610d1f9614e3dee4d6b..943aa1a132f75b8dfe23e73e6d77fd4d4196f4e1 100644 (file)
@@ -86,7 +86,7 @@ SVN-Revision: 35130
        } while (word != stop);
  
        return csum_fold(csum);
-@@ -182,73 +186,6 @@ static inline __sum16 ip_compute_csum(co
+@@ -179,73 +183,6 @@ static inline __sum16 ip_compute_csum(co
        return csum_fold(csum_partial(buff, len, 0));
  }
  
@@ -258,7 +258,7 @@ SVN-Revision: 35130
  #include <linux/uaccess.h>
  #include <linux/ipv6.h>
  #include <linux/icmpv6.h>
-@@ -944,10 +945,10 @@ static void tcp_v6_send_response(const s
+@@ -901,10 +902,10 @@ static void tcp_v6_send_response(const s
        topt = (__be32 *)(t1 + 1);
  
        if (tsecr) {
@@ -285,7 +285,7 @@ SVN-Revision: 35130
   */
 --- a/net/ipv6/datagram.c
 +++ b/net/ipv6/datagram.c
-@@ -492,7 +492,7 @@ int ipv6_recv_error(struct sock *sk, str
+@@ -497,7 +497,7 @@ int ipv6_recv_error(struct sock *sk, str
                                ipv6_iface_scope_id(&sin->sin6_addr,
                                                    IP6CB(skb)->iif);
                } else {
@@ -294,7 +294,7 @@ SVN-Revision: 35130
                                               &sin->sin6_addr);
                        sin->sin6_scope_id = 0;
                }
-@@ -846,12 +846,12 @@ int ip6_datagram_send_ctl(struct net *ne
+@@ -851,12 +851,12 @@ int ip6_datagram_send_ctl(struct net *ne
                        }
  
                        if (fl6->flowlabel&IPV6_FLOWINFO_MASK) {
@@ -311,18 +311,18 @@ SVN-Revision: 35130
                case IPV6_2292HOPOPTS:
 --- a/net/ipv6/exthdrs.c
 +++ b/net/ipv6/exthdrs.c
-@@ -1002,7 +1002,7 @@ static bool ipv6_hop_jumbo(struct sk_buf
+@@ -1003,7 +1003,7 @@ static bool ipv6_hop_jumbo(struct sk_buf
                goto drop;
        }
  
 -      pkt_len = ntohl(*(__be32 *)(nh + optoff + 2));
 +      pkt_len = ntohl(net_hdr_word(nh + optoff + 2));
        if (pkt_len <= IPV6_MAXPLEN) {
-               __IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
-               icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
+               icmpv6_param_prob_reason(skb, ICMPV6_HDR_FIELD, optoff + 2,
+                                        SKB_DROP_REASON_IP_INHDR);
 --- a/include/linux/types.h
 +++ b/include/linux/types.h
-@@ -231,5 +231,11 @@ typedef void (*swap_func_t)(void *a, voi
+@@ -232,5 +232,11 @@ typedef void (*swap_func_t)(void *a, voi
  typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv);
  typedef int (*cmp_func_t)(const void *a, const void *b);
  
@@ -336,9 +336,9 @@ SVN-Revision: 35130
  #endif /* _LINUX_TYPES_H */
 --- a/net/ipv4/af_inet.c
 +++ b/net/ipv4/af_inet.c
-@@ -1477,8 +1477,8 @@ struct sk_buff *inet_gro_receive(struct
+@@ -1488,8 +1488,8 @@ struct sk_buff *inet_gro_receive(struct
        if (unlikely(ip_fast_csum((u8 *)iph, 5)))
-               goto out_unlock;
+               goto out;
  
 -      id = ntohl(*(__be32 *)&iph->id);
 -      flush = (u16)((ntohl(*(__be32 *)iph) ^ skb_gro_len(skb)) | (id & ~IP_DF));
@@ -349,7 +349,7 @@ SVN-Revision: 35130
        list_for_each_entry(p, head, list) {
 --- a/net/ipv4/tcp_output.c
 +++ b/net/ipv4/tcp_output.c
-@@ -610,48 +610,53 @@ static void tcp_options_write(__be32 *pt
+@@ -611,48 +611,53 @@ static void tcp_options_write(struct tcp
        u16 options = opts->options;    /* mungable copy */
  
        if (unlikely(OPTION_MD5 & options)) {
@@ -426,7 +426,7 @@ SVN-Revision: 35130
        }
  
        if (unlikely(opts->num_sack_blocks)) {
-@@ -659,16 +664,17 @@ static void tcp_options_write(__be32 *pt
+@@ -660,16 +665,17 @@ static void tcp_options_write(struct tcp
                        tp->duplicate_sack : tp->selective_acks;
                int this_sack;
  
@@ -450,7 +450,7 @@ SVN-Revision: 35130
                }
  
                tp->rx_opt.dsack = 0;
-@@ -681,13 +687,14 @@ static void tcp_options_write(__be32 *pt
+@@ -682,13 +688,14 @@ static void tcp_options_write(struct tcp
  
                if (foc->exp) {
                        len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len;
@@ -482,7 +482,7 @@ SVN-Revision: 35130
 @@ -49,7 +49,7 @@ struct igmpv3_grec {
        __be16  grec_nsrcs;
        __be32  grec_mca;
-       __be32  grec_src[0];
+       __be32  grec_src[];
 -};
 +} __attribute__((packed, aligned(2)));
  
@@ -491,7 +491,7 @@ SVN-Revision: 35130
 @@ -58,7 +58,7 @@ struct igmpv3_report {
        __be16 resv2;
        __be16 ngrec;
-       struct igmpv3_grec grec[0];
+       struct igmpv3_grec grec[];
 -};
 +} __attribute__((packed, aligned(2)));
  
@@ -500,7 +500,7 @@ SVN-Revision: 35130
 @@ -79,7 +79,7 @@ struct igmpv3_query {
        __u8 qqic;
        __be16 nsrcs;
-       __be32 srcs[0];
+       __be32 srcs[];
 -};
 +} __attribute__((packed, aligned(2)));
  
@@ -508,7 +508,7 @@ SVN-Revision: 35130
  #define IGMP_HOST_MEMBERSHIP_REPORT   0x12    /* Ditto */
 --- a/net/core/flow_dissector.c
 +++ b/net/core/flow_dissector.c
-@@ -129,7 +129,7 @@ __be32 __skb_flow_get_ports(const struct
+@@ -131,7 +131,7 @@ __be32 __skb_flow_get_ports(const struct
                ports = __skb_header_pointer(skb, thoff + poff,
                                             sizeof(_ports), data, hlen, &_ports);
                if (ports)
@@ -578,7 +578,7 @@ SVN-Revision: 35130
                        goto next_ht;
 --- a/net/ipv6/ip6_offload.c
 +++ b/net/ipv6/ip6_offload.c
-@@ -241,7 +241,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
+@@ -259,7 +259,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
                        continue;
  
                iph2 = (struct ipv6hdr *)(p->data + off);
@@ -614,16 +614,16 @@ SVN-Revision: 35130
                                     (__force __wsum)to);
 --- a/include/net/ipv6.h
 +++ b/include/net/ipv6.h
-@@ -147,7 +147,7 @@ struct frag_hdr {
+@@ -149,7 +149,7 @@ struct frag_hdr {
        __u8    reserved;
        __be16  frag_off;
        __be32  identification;
 -};
 +} __attribute__((packed, aligned(2)));
  
- #define       IP6_MF          0x0001
- #define       IP6_OFFSET      0xFFF8
-@@ -561,8 +561,8 @@ static inline void __ipv6_addr_set_half(
+ /*
+  * Jumbo payload option, as described in RFC 2675 2.
+@@ -615,8 +615,8 @@ static inline void __ipv6_addr_set_half(
        }
  #endif
  #endif
@@ -634,7 +634,7 @@ SVN-Revision: 35130
  }
  
  static inline void ipv6_addr_set(struct in6_addr *addr,
-@@ -621,6 +621,8 @@ static inline bool ipv6_prefix_equal(con
+@@ -675,6 +675,8 @@ static inline bool ipv6_prefix_equal(con
        const __be32 *a1 = addr1->s6_addr32;
        const __be32 *a2 = addr2->s6_addr32;
        unsigned int pdw, pbi;
@@ -643,7 +643,7 @@ SVN-Revision: 35130
  
        /* check complete u32 in prefix */
        pdw = prefixlen >> 5;
-@@ -629,7 +631,9 @@ static inline bool ipv6_prefix_equal(con
+@@ -683,7 +685,9 @@ static inline bool ipv6_prefix_equal(con
  
        /* check incomplete u32 in prefix */
        pbi = prefixlen & 0x1f;
@@ -654,7 +654,7 @@ SVN-Revision: 35130
                return false;
  
        return true;
-@@ -746,13 +750,13 @@ static inline void ipv6_addr_set_v4mappe
+@@ -805,13 +809,13 @@ static inline void ipv6_addr_set_v4mappe
   */
  static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen)
  {
@@ -670,7 +670,7 @@ SVN-Revision: 35130
                if (xb)
                        return i * 32 + 31 - __fls(ntohl(xb));
        }
-@@ -946,17 +950,18 @@ static inline u32 ip6_multipath_hash_fie
+@@ -1005,17 +1009,18 @@ static inline u32 ip6_multipath_hash_fie
  static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
                                __be32 flowlabel)
  {
@@ -700,11 +700,11 @@ SVN-Revision: 35130
  #include <linux/types.h>
 +#include <linux/in6.h>
  
u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
- u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
struct net;
 --- a/include/uapi/linux/in.h
 +++ b/include/uapi/linux/in.h
-@@ -88,7 +88,7 @@ enum {
+@@ -91,7 +91,7 @@ enum {
  /* Internet address. */
  struct in_addr {
        __be32  s_addr;
@@ -715,7 +715,7 @@ SVN-Revision: 35130
  #define IP_TOS                1
 --- a/net/ipv6/ip6_fib.c
 +++ b/net/ipv6/ip6_fib.c
-@@ -141,7 +141,7 @@ static __be32 addr_bit_set(const void *t
+@@ -142,7 +142,7 @@ static __be32 addr_bit_set(const void *t
         * See include/asm-generic/bitops/le.h.
         */
        return (__force __be32)(1 << ((~fn_bit ^ BITOP_BE32_SWIZZLE) & 0x1f)) &
@@ -726,7 +726,7 @@ SVN-Revision: 35130
  struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh)
 --- a/net/netfilter/nf_conntrack_proto_tcp.c
 +++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -400,7 +400,7 @@ static void tcp_sack(const struct sk_buf
+@@ -406,7 +406,7 @@ static void tcp_sack(const struct sk_buf
  
        /* Fast path for timestamp-only option */
        if (length == TCPOLEN_TSTAMP_ALIGNED
@@ -737,7 +737,7 @@ SVN-Revision: 35130
                                       | TCPOLEN_TIMESTAMP))
 --- a/net/xfrm/xfrm_input.c
 +++ b/net/xfrm/xfrm_input.c
-@@ -167,8 +167,8 @@ int xfrm_parse_spi(struct sk_buff *skb,
+@@ -168,8 +168,8 @@ int xfrm_parse_spi(struct sk_buff *skb,
        if (!pskb_may_pull(skb, hlen))
                return -EINVAL;
  
@@ -750,7 +750,7 @@ SVN-Revision: 35130
  EXPORT_SYMBOL(xfrm_parse_spi);
 --- a/net/ipv4/tcp_input.c
 +++ b/net/ipv4/tcp_input.c
-@@ -4158,14 +4158,16 @@ static bool tcp_parse_aligned_timestamp(
+@@ -4165,14 +4165,16 @@ static bool tcp_parse_aligned_timestamp(
  {
        const __be32 *ptr = (const __be32 *)(th + 1);
  
@@ -784,7 +784,7 @@ SVN-Revision: 35130
  
 --- a/include/net/neighbour.h
 +++ b/include/net/neighbour.h
-@@ -270,8 +270,10 @@ static inline bool neigh_key_eq128(const
+@@ -286,8 +286,10 @@ static inline bool neigh_key_eq128(const
        const u32 *n32 = (const u32 *)n->primary_key;
        const u32 *p32 = pkey;
  
@@ -829,7 +829,7 @@ SVN-Revision: 35130
                *sum = csum_fold(csum_partial(diff, sizeof(diff),
 --- a/include/linux/etherdevice.h
 +++ b/include/linux/etherdevice.h
-@@ -525,7 +525,7 @@ static inline bool is_etherdev_addr(cons
+@@ -555,7 +555,7 @@ static inline bool is_etherdev_addr(cons
   * @b: Pointer to Ethernet header
   *
   * Compare two Ethernet headers, returns 0 if equal.
@@ -838,7 +838,7 @@ SVN-Revision: 35130
   * aligned OR the platform can handle unaligned access.  This is the
   * case for all packets coming into netif_receive_skb or similar
   * entry points.
-@@ -548,11 +548,12 @@ static inline unsigned long compare_ethe
+@@ -578,11 +578,12 @@ static inline unsigned long compare_ethe
        fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
        return fold;
  #else
@@ -857,7 +857,7 @@ SVN-Revision: 35130
  
 --- a/net/ipv4/tcp_offload.c
 +++ b/net/ipv4/tcp_offload.c
-@@ -223,7 +223,7 @@ struct sk_buff *tcp_gro_receive(struct l
+@@ -220,7 +220,7 @@ struct sk_buff *tcp_gro_receive(struct l
  
                th2 = tcp_hdr(p);
  
@@ -866,7 +866,7 @@ SVN-Revision: 35130
                        NAPI_GRO_CB(p)->same_flow = 0;
                        continue;
                }
-@@ -241,8 +241,8 @@ found:
+@@ -238,8 +238,8 @@ found:
                  ~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH));
        flush |= (__force int)(th->ack_seq ^ th2->ack_seq);
        for (i = sizeof(*th); i < thlen; i += 4)
@@ -879,16 +879,16 @@ SVN-Revision: 35130
         * continue this flow as an atomic flow with a fixed ID or if we use
 --- a/net/ipv6/netfilter/ip6table_mangle.c
 +++ b/net/ipv6/netfilter/ip6table_mangle.c
-@@ -44,7 +44,7 @@ ip6t_mangle_out(struct sk_buff *skb, con
+@@ -44,7 +44,7 @@ ip6t_mangle_out(void *priv, struct sk_bu
        hop_limit = ipv6_hdr(skb)->hop_limit;
  
        /* flowlabel and prio (includes version, which shouldn't change either */
 -      flowlabel = *((u_int32_t *)ipv6_hdr(skb));
 +      flowlabel = net_hdr_word(ipv6_hdr(skb));
  
-       ret = ip6t_do_table(skb, state, priv);
+       ret = ip6t_do_table(priv, skb, state);
  
-@@ -53,7 +53,7 @@ ip6t_mangle_out(struct sk_buff *skb, con
+@@ -53,7 +53,7 @@ ip6t_mangle_out(void *priv, struct sk_bu
             !ipv6_addr_equal(&ipv6_hdr(skb)->daddr, &daddr) ||
             skb->mark != mark ||
             ipv6_hdr(skb)->hop_limit != hop_limit ||