[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180907210903.919017600@linuxfoundation.org>
Date: Fri, 7 Sep 2018 23:07:49 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, David Palma <david.palma@...u.no>,
Rabi Narayan Sahoo <rabinarayans0828@...il.com>,
Alexander Aring <aring@...atatu.com>,
Stefan Schmidt <stefan@...enfreihafen.org>
Subject: [PATCH 4.18 003/145] net: mac802154: tx: expand tailroom if necessary
4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Aring <aring@...atatu.com>
commit f9c52831133050c6b82aa8b6831c92da2bbf2a0b upstream.
This patch is necessary if case of AF_PACKET or other socket interface
which I am aware of it and didn't allocated the necessary room.
Reported-by: David Palma <david.palma@...u.no>
Reported-by: Rabi Narayan Sahoo <rabinarayans0828@...il.com>
Cc: stable@...r.kernel.org
Signed-off-by: Alexander Aring <aring@...atatu.com>
Signed-off-by: Stefan Schmidt <stefan@...enfreihafen.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
net/mac802154/tx.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -63,8 +63,21 @@ ieee802154_tx(struct ieee802154_local *l
int ret;
if (!(local->hw.flags & IEEE802154_HW_TX_OMIT_CKSUM)) {
- u16 crc = crc_ccitt(0, skb->data, skb->len);
+ struct sk_buff *nskb;
+ u16 crc;
+ if (unlikely(skb_tailroom(skb) < IEEE802154_FCS_LEN)) {
+ nskb = skb_copy_expand(skb, 0, IEEE802154_FCS_LEN,
+ GFP_ATOMIC);
+ if (likely(nskb)) {
+ consume_skb(skb);
+ skb = nskb;
+ } else {
+ goto err_tx;
+ }
+ }
+
+ crc = crc_ccitt(0, skb->data, skb->len);
put_unaligned_le16(crc, skb_put(skb, 2));
}
Powered by blists - more mailing lists