net: fix harmonize_features() vs NETIF_F_HIGHDMA
authorEric Dumazet <edumazet@google.com>
Wed, 18 Jan 2017 20:12:17 +0000 (12:12 -0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Jun 2017 22:46:57 +0000 (00:46 +0200)
commit 7be2c82cfd5d28d7adb66821a992604eb6dd112e upstream.

Ashizuka reported a highmem oddity and sent a patch for freescale
fec driver.

But the problem root cause is that core networking stack
must ensure no skb with highmem fragment is ever sent through
a device that does not assert NETIF_F_HIGHDMA in its features.

We need to call illegal_highdma() from harmonize_features()
regardless of CSUM checks.

Fixes: ec5f06156423 ("net: Kill link between CSUM and SG features.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Pravin Shelar <pshelar@ovn.org>
Reported-by: "Ashizuka, Yuusuke" <ashiduka@jp.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/core/dev.c

index 6900ff08008e2ee5a650d199749d3eb34835b339..4dbc7af96735d23eb72fb8961850d3bc2158e8fc 100644 (file)
@@ -2461,9 +2461,9 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
        if (skb->ip_summed != CHECKSUM_NONE &&
            !can_checksum_protocol(features, protocol)) {
                features &= ~NETIF_F_ALL_CSUM;
-       } else if (illegal_highdma(dev, skb)) {
-               features &= ~NETIF_F_SG;
        }
+       if (illegal_highdma(dev, skb))
+               features &= ~NETIF_F_SG;
 
        return features;
 }