[From nobody Thu Jun 25 05:54:42 2020
Received: from mail-ve1eur01on0085.outbound.protection.outlook.com
 ([104.47.1.85] helo=EUR01-VE1-obe.outbound.protection.outlook.com)
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1fU5IM-0001b2-BX
 for openwrt-devel@lists.openwrt.org; Sat, 16 Jun 2018 07:06:48 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=darbyshire-bryant.me.uk; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Qm2ZzGgH26/q1Azv9u/NtHcHXsnjF0bNecE4b8gN0Xc=;
 b=rByHESct3EcNuL/AXx2aB83pWpkrwu9+YQr0twysJWBx8VIBMzKPNwz4EWLbvxTAHoJmnWaXajrFrmAy6CJqb+Lwys7X6bl43pqBhkUj53OvrIiq8XP0r4q4HOcYBe2y0aLk7+jS+w6EkOjCcy3uAgPzcRT+XCgaTopa9RH0M7o=
Received: from localhost.localdomain (167.98.58.244) by
 AM0PR07MB4242.eurprd07.prod.outlook.com (2603:10a6:208:b8::26) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.863.6; Sat, 16 Jun 2018 07:06:29 +0000
From: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
To: openwrt-devel@lists.openwrt.org
Cc: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
Subject: [PATCH 2/2] kernel: atm: pppoatm fix vc-mux connection failures
Date: Sat, 16 Jun 2018 08:06:19 +0100
Message-Id: &lt;20180616070619.21459-2-ldir@darbyshire-bryant.me.uk&gt;
X-Mailer: git-send-email 2.15.1 (Apple Git-101)
In-Reply-To: &lt;20180616070619.21459-1-ldir@darbyshire-bryant.me.uk&gt;
References: &lt;20180616070619.21459-1-ldir@darbyshire-bryant.me.uk&gt;
MIME-Version: 1.0
Content-Type: text/plain
X-Originating-IP: [167.98.58.244]
X-ClientProxiedBy: CWLP265CA0061.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:401:12::25) To AM0PR07MB4242.eurprd07.prod.outlook.com
 (2603:10a6:208:b8::26)
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 262bd324-ed7f-4d59-0167-08d5d357aef7
X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0;
 RULEID:(7020095)(4652020)(7021125)(5600026)(711020)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020);
 SRVR:AM0PR07MB4242; 
X-Microsoft-Exchange-Diagnostics: 1; AM0PR07MB4242;
 3:tKTrTTZLlV+Z5dDBU4fFiW98vHMaouucBoSt5YJj6sAv6kaXDxCPuefjcSasWKHjNnynzSldSqiIVzF8QznfeG1LxN3mGP7Ng91t04l9AM4Jq7gK78KssJU0iDtfyPXLZWQSR5O3KaM/lglR6WxQ+8GptOKaaucyjIELzLqJaWjXT8rDX0TBEcq+UKhGc0scZTRCfKt8+MJVFaUHGBe95CLc0YmWaXZsU58oUBIMgoljEgQK4+nOSHOZ8jrr1jeT;
 25:IbbpwNrDjT+PDxP1jA7S+52dhY/owhxdLeDbp7D7OhUejl1+0Zqpg7t5U8ZvrdVuqFaQRR6626Ip5gy0Ss1YpvFPl8i5wtufTewnCEuDLARfpBTB0/8sIZ0m5b2tUHnoWorTev1g4HtR7nKr+nJ8IiaK6H5KuT5B4/46jb1ATkRoEKLDsrQmwcqf5onhXcZ9TlAnEEVyh6Iy3Z9xN+NWq7n6DxVtDIBw5jgfUKdf3R7xF0vcuvcetxXovZz49LVFuwfXZPg3bbj+k98mrMicA+zyfcIqGk9p1vEoXpxc+P3kwhUvXEXG+3dkgua13KFkuoC/OI4jim6Kn0iQagKfOw==;
 31:YBBpIJ9xYt/yjPIxZJyaD5A5HBejiN36JQEOBl5EgO11E3LqvFBIgXUmpDhOMuNyUdCYRRbU9Pl2zdVPKxBM/dh1VWNqQTmgO9SAXfsxRaTnTUpgH/lCzOEchi8KkhHsWC9HYqhUsYgBVbwZVivG4YtxkkAG2tmwZ0oznAlh0g8JDXsFWtw2dD9zoqrL9hyG3zwuDdmHK9V3zDX0TsdP8stuXzJuv/7aATdqaB9Zhi0=
X-MS-TrafficTypeDiagnostic: AM0PR07MB4242:
Authentication-Results: spf=none (sender IP is )
 smtp.mailfrom=kevin@darbyshire-bryant.me.uk; 
X-Microsoft-Antispam-PRVS: &lt;AM0PR07MB4242E4FC8E954F45E1235595A5730@AM0PR07MB4242.eurprd07.prod.outlook.com&gt;
X-Exchange-Antispam-Report-Test: UriScan:(228905959029699);
X-MS-Exchange-SenderADCheck: 1
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
 RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(2016111802025)(6043046)(6072148)(201708071742011)(7699016);
 SRVR:AM0PR07MB4242; BCL:0; PCL:0; RULEID:; SRVR:AM0PR07MB4242; 
X-Microsoft-Exchange-Diagnostics: 1; AM0PR07MB4242;
 4:rd3mmTDaPEDfmSs9HsiuQmhDtRnehC7iyKeUrzjs5E/HUBWob9tYTdbqTiH0/D7SC1Ai55N+iZALmQsTpQyp7CjqT1N+mUvREZMs4tpv8yPcvA7EYNf9YGadZfZaHQO0uFyAp6HpFI+OTg/DiclMQ3D9fca4WFUysIz6bfj/SWCu3gGXxIF2qAQez22/h6gPbqQTRjqlxbx1JLGN0IsuvUnKg86kC3n/pxXepWmyumtI+JrTkoA7vLgawOUrSBSHGTTPOc0K0Xr58Fglf/Uw+f/yyRKhFnedxp/wLtOBngP5vgtlxOrS4COLyrkKXM5b
X-Forefront-PRVS: 0705EB1700
X-Forefront-Antispam-Report: SFV:NSPM;
 SFS:(10009020)(6069001)(346002)(39380400002)(39830400003)(396003)(366004)(376002)(199004)(189003)(51444003)(7736002)(8936002)(8676002)(47776003)(59450400001)(2361001)(50226002)(81166006)(81156014)(478600001)(52116002)(1076002)(3846002)(66066001)(2351001)(6116002)(106356001)(74482002)(97736004)(105586002)(76176011)(50466002)(51416003)(48376002)(25786009)(305945005)(6512007)(68736007)(316002)(6666003)(476003)(6486002)(486006)(2616005)(446003)(16586007)(6916009)(186003)(386003)(26005)(575784001)(107886003)(5660300001)(11346002)(4326008)(53936002)(6506007)(16526019)(2906002)(956004)(36756003)(169013001);
 DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR07MB4242; H:localhost.localdomain; FPR:;
 SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; 
Received-SPF: None (protection.outlook.com: darbyshire-bryant.me.uk does not
 designate permitted sender hosts)
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR07MB4242;
 23:to2P0Og/QS0lxsi+SKgODm97Sfc7c1METvnNA7j80?=
 =?us-ascii?Q?S/jVP83K0eghHj1gDSQy2rdLH9v8A03ZY05oKKvWGtAEJ3AqpqvQWcaWIYPi?=
 =?us-ascii?Q?wJBFBhchNDJdUHfgiTzJCuXsnUFCsRRe9OIY4rfkPERrxHGyxoadhyJAut2M?=
 =?us-ascii?Q?2jgjcq2u1N38FNkrh/0/zfns3XIkYiYEQwjUs8jxMFNi/Pv5JFvwN5B7PVTg?=
 =?us-ascii?Q?ivOEsTlM94Z1hez6LhJRS1Ux00gMJs84Pc4EuageAdzR9hY2Cyu/iUoMZLMA?=
 =?us-ascii?Q?9ewau0GRc0ARpEeiJPvbGdZ8m5CPezTUOApIfCxHdBHkW1vWU00YKVY/Bxhq?=
 =?us-ascii?Q?GWcAEjCfCsu61gE8aIrsFFIiplJMaiLIMWMOVGkmcPuyT5NeiVbVNwNQt7bl?=
 =?us-ascii?Q?3mukc5u4c8lAeyf4BGQGN7duVdwBfcgpBiVmGByxFir17K74gzfwGemo36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8bh0kOMwdrGXJYeprN9RuYFPkfA/tLq2CQAmjf9hVjGoTJozTRNZAsLT0x0=
SpamDiagnosticOutput: 1:99
SpamDiagnosticMetadata: NSPM
X-Microsoft-Exchange-Diagnostics: 1; AM0PR07MB4242;
 7:A2NP+7aSVMIChTdbVCs48+ekAleLXoTah/OiSyrbxECMEGhcH6nMYYTmUsWFPxVmgtFm5OSFTzQhKwwX5okFBjFq3selT6oYZnPC0VGLMG5viC6rsy9TeflhiecKQ1G5ClIZzYhkAlZEr3KtrSZX29LkdUQbnrK7jzB7K3WEiCSKBJZjZNVNpOFC0xP1joKMB8H0toF/Bn+ozqB/mVya/765AEKBFa43FUxnEilssJ9qJAl6UthNOAfp0YRmQahI
X-OriginatorOrg: darbyshire-bryant.me.uk
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2018 07:06:29.2731 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 262bd324-ed7f-4d59-0167-08d5d357aef7
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 9151708b-c553-406f-8e56-694f435154a4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB4242
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20180616_000646_551458_DEBA2622 
X-CRM114-Status: GOOD (  18.20  )
X-Spam-Score: -0.1 (/)
X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary:
 Content analysis details:   (-0.1 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [104.47.1.85 listed in list.dnswl.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid

Backport a hot off the press upstream kernel ATM fix:

Preserve value of skb-&gt;truesize when accounting to vcc

&quot;There's a hack in pskb_expand_head() to avoid adjusting skb-&gt;truesize
for certain skbs. Ideally it would cover ATM too. It doesn't. Just
stashing the accounted value and using it in atm_raw_pop() is probably
the easiest way to cope.&quot;

The issue was introduced in upstream by:

commit 14afee4b6092fde451ee17604e5f5c89da33e71e
Author: Reshetova, Elena &lt;elena.reshetova@intel.com&gt;
Date:   Fri Jun 30 13:08:00 2017 +0300

    net: convert sock.sk_wmem_alloc from atomic_t to refcount_t

Sincerest thanks to Mathias Kresin &lt;dev@kresin.me&gt; for debugging
assistance and to David Woodhouse &lt;dwmw2@infradead.org&gt; for further
guidance, cajoling &amp; patience in interpreting the debug I was giving him
and producing a fix!

Fixes FS#1567

Signed-off-by: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
---
 ...-sock.sk_wmem_alloc-from-atomic_t-to-refc.patch | 186 +++++++++++++++++++++
 1 file changed, 186 insertions(+)
 create mode 100644 target/linux/generic/backport-4.14/080-net-convert-sock.sk_wmem_alloc-from-atomic_t-to-refc.patch

diff --git a/target/linux/generic/backport-4.14/080-net-convert-sock.sk_wmem_alloc-from-atomic_t-to-refc.patch b/target/linux/generic/backport-4.14/080-net-convert-sock.sk_wmem_alloc-from-atomic_t-to-refc.patch
new file mode 100644
index 0000000000..8108d99348
--- /dev/null
+++ b/target/linux/generic/backport-4.14/080-net-convert-sock.sk_wmem_alloc-from-atomic_t-to-refc.patch
@@ -0,0 +1,186 @@
+From 99967eb67d14b2ed17b194a8dac357d641a06e43 Mon Sep 17 00:00:00 2001
+From: David Woodhouse &lt;dwmw2@infradead.org&gt;
+Date: Fri, 15 Jun 2018 21:00:27 +0100
+Subject: [PATCH] net: convert sock.sk_wmem_alloc from atomic_t to refcount_t
+
+On Fri, 2018-06-15 at 14:44 +0100, David Woodhouse wrote:
+&gt;
+&gt; &gt; Or simply use a new field in ATM_SKB(skb) to remember a stable
+&gt; &gt; truesize used in both sides (add/sub)
+&gt;
+&gt; Right, that was my second suggestion (&quot;copy the accounted value...&quot;).
+&gt;
+&gt; It's a bit of a hack, and I think that actually *using* sock_wfree()
+&gt; instead of what's currently in atm_pop_raw() would be the better
+&gt; solution. Does anyone remember why we didn't do that in the first
+&gt; place?
+
+That does end up being quite hairy. I don't think it's worth doing.
+
+This should probably suffice to fix it...
+
+Kevin this is going to conflict with the ifx_atm_alloc_skb() hack in
+the tree you're working on, but that needs to be killed with fire
+anyway. It's utterly pointless as discussed.
+
+From 3368eaeb0a2f09138894dde0f26f879e5228005a Mon Sep 17 00:00:00 2001
+From: David Woodhouse &lt;dwmw2@infradead.org&gt;
+Date: Fri, 15 Jun 2018 20:49:20 +0100
+Subject: [PATCH] atm: Preserve value of skb-&gt;truesize when accounting to vcc
+
+There's a hack in pskb_expand_head() to avoid adjusting skb-&gt;truesize
+for certain skbs. Ideally it would cover ATM too. It doesn't. Just
+stashing the accounted value and using it in atm_raw_pop() is probably
+the easiest way to cope.
+
+Signed-off-by: David Woodhouse &lt;dwmw2@infradead.org&gt;
+Signed-off-by: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
+---
+ include/linux/atmdev.h | 15 +++++++++++++++
+ net/atm/br2684.c       |  3 +--
+ net/atm/clip.c         |  3 +--
+ net/atm/common.c       |  3 +--
+ net/atm/lec.c          |  3 +--
+ net/atm/mpc.c          |  3 +--
+ net/atm/pppoatm.c      |  3 +--
+ net/atm/raw.c          |  4 ++--
+ 8 files changed, 23 insertions(+), 14 deletions(-)
+
+diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
+index 0c27515d..8124815e 100644
+--- a/include/linux/atmdev.h
++++ b/include/linux/atmdev.h
+@@ -214,6 +214,7 @@ struct atmphy_ops {
+ struct atm_skb_data {
+ 	struct atm_vcc	*vcc;		/* ATM VCC */
+ 	unsigned long	atm_options;	/* ATM layer options */
++	unsigned int	acct_truesize;  /* truesize accounted to vcc */
+ };
+ 
+ #define VCC_HTABLE_SIZE 32
+@@ -241,6 +242,20 @@ void vcc_insert_socket(struct sock *sk);
+ 
+ void atm_dev_release_vccs(struct atm_dev *dev);
+ 
++static inline void atm_account_tx(struct atm_vcc *vcc, struct sk_buff *skb)
++{
++	/*
++	 * Because ATM skbs may not belong to a sock (and we don't
++	 * necessarily want to), skb-&gt;truesize may be adjusted,
++	 * escaping the hack in pskb_expand_head() which avoids
++	 * doing so for some cases. So stash the value of truesize
++	 * at the time we accounted it, and atm_pop_raw() can use
++	 * that value later, in case it changes.
++	 */
++	refcount_add(skb-&gt;truesize, &amp;sk_atm(vcc)-&gt;sk_wmem_alloc);
++	ATM_SKB(skb)-&gt;acct_truesize = skb-&gt;truesize;
++	ATM_SKB(skb)-&gt;atm_options = vcc-&gt;atm_options;
++}
+ 
+ static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
+ {
+diff --git a/net/atm/br2684.c b/net/atm/br2684.c
+index 4e111196..bc21f8e8 100644
+--- a/net/atm/br2684.c
++++ b/net/atm/br2684.c
+@@ -252,8 +252,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct net_device *dev,
+ 
+ 	ATM_SKB(skb)-&gt;vcc = atmvcc = brvcc-&gt;atmvcc;
+ 	pr_debug(&quot;atm_skb(%p)-&gt;vcc(%p)-&gt;dev(%p)\n&quot;, skb, atmvcc, atmvcc-&gt;dev);
+-	refcount_add(skb-&gt;truesize, &amp;sk_atm(atmvcc)-&gt;sk_wmem_alloc);
+-	ATM_SKB(skb)-&gt;atm_options = atmvcc-&gt;atm_options;
++	atm_account_tx(atmvcc, skb);
+ 	dev-&gt;stats.tx_packets++;
+ 	dev-&gt;stats.tx_bytes += skb-&gt;len;
+ 
+diff --git a/net/atm/clip.c b/net/atm/clip.c
+index 65f706e4..60920a42 100644
+--- a/net/atm/clip.c
++++ b/net/atm/clip.c
+@@ -381,8 +381,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
+ 		memcpy(here, llc_oui, sizeof(llc_oui));
+ 		((__be16 *) here)[3] = skb-&gt;protocol;
+ 	}
+-	refcount_add(skb-&gt;truesize, &amp;sk_atm(vcc)-&gt;sk_wmem_alloc);
+-	ATM_SKB(skb)-&gt;atm_options = vcc-&gt;atm_options;
++	atm_account_tx(vcc, skb);
+ 	entry-&gt;vccs-&gt;last_use = jiffies;
+ 	pr_debug(&quot;atm_skb(%p)-&gt;vcc(%p)-&gt;dev(%p)\n&quot;, skb, vcc, vcc-&gt;dev);
+ 	old = xchg(&amp;entry-&gt;vccs-&gt;xoff, 1);	/* assume XOFF ... */
+diff --git a/net/atm/common.c b/net/atm/common.c
+index 83d6f40e..9935cc1f 100644
+--- a/net/atm/common.c
++++ b/net/atm/common.c
+@@ -633,10 +633,9 @@ int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size)
+ 		goto out;
+ 	}
+ 	pr_debug(&quot;%d += %d\n&quot;, sk_wmem_alloc_get(sk), skb-&gt;truesize);
+-	refcount_add(skb-&gt;truesize, &amp;sk-&gt;sk_wmem_alloc);
++	atm_account_tx(vcc, skb);
+ 
+ 	skb-&gt;dev = NULL; /* for paths shared with net_device interfaces */
+-	ATM_SKB(skb)-&gt;atm_options = vcc-&gt;atm_options;
+ 	if (!copy_from_iter_full(skb_put(skb, size), size, &amp;m-&gt;msg_iter)) {
+ 		kfree_skb(skb);
+ 		error = -EFAULT;
+diff --git a/net/atm/lec.c b/net/atm/lec.c
+index 5741b647..9f236569 100644
+--- a/net/atm/lec.c
++++ b/net/atm/lec.c
+@@ -182,9 +182,8 @@ lec_send(struct atm_vcc *vcc, struct sk_buff *skb)
+ 	struct net_device *dev = skb-&gt;dev;
+ 
+ 	ATM_SKB(skb)-&gt;vcc = vcc;
+-	ATM_SKB(skb)-&gt;atm_options = vcc-&gt;atm_options;
++	atm_account_tx(vcc, skb);
+ 
+-	refcount_add(skb-&gt;truesize, &amp;sk_atm(vcc)-&gt;sk_wmem_alloc);
+ 	if (vcc-&gt;send(vcc, skb) &lt; 0) {
+ 		dev-&gt;stats.tx_dropped++;
+ 		return;
+diff --git a/net/atm/mpc.c b/net/atm/mpc.c
+index 56771472..db9a1838 100644
+--- a/net/atm/mpc.c
++++ b/net/atm/mpc.c
+@@ -555,8 +555,7 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
+ 					sizeof(struct llc_snap_hdr));
+ 	}
+ 
+-	refcount_add(skb-&gt;truesize, &amp;sk_atm(entry-&gt;shortcut)-&gt;sk_wmem_alloc);
+-	ATM_SKB(skb)-&gt;atm_options = entry-&gt;shortcut-&gt;atm_options;
++	atm_account_tx(entry-&gt;shortcut, skb);
+ 	entry-&gt;shortcut-&gt;send(entry-&gt;shortcut, skb);
+ 	entry-&gt;packets_fwded++;
+ 	mpc-&gt;in_ops-&gt;put(entry);
+diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
+index 21d9d341..af8c4b38 100644
+--- a/net/atm/pppoatm.c
++++ b/net/atm/pppoatm.c
+@@ -350,8 +350,7 @@ static int pppoatm_send(struct ppp_channel *chan, struct sk_buff *skb)
+ 		return 1;
+ 	}
+ 
+-	refcount_add(skb-&gt;truesize, &amp;sk_atm(ATM_SKB(skb)-&gt;vcc)-&gt;sk_wmem_alloc);
+-	ATM_SKB(skb)-&gt;atm_options = ATM_SKB(skb)-&gt;vcc-&gt;atm_options;
++	atm_account_tx(vcc, skb);
+ 	pr_debug(&quot;atm_skb(%p)-&gt;vcc(%p)-&gt;dev(%p)\n&quot;,
+ 		 skb, ATM_SKB(skb)-&gt;vcc, ATM_SKB(skb)-&gt;vcc-&gt;dev);
+ 	ret = ATM_SKB(skb)-&gt;vcc-&gt;send(ATM_SKB(skb)-&gt;vcc, skb)
+diff --git a/net/atm/raw.c b/net/atm/raw.c
+index ee10e8d4..b3ba44aa 100644
+--- a/net/atm/raw.c
++++ b/net/atm/raw.c
+@@ -35,8 +35,8 @@ static void atm_pop_raw(struct atm_vcc *vcc, struct sk_buff *skb)
+ 	struct sock *sk = sk_atm(vcc);
+ 
+ 	pr_debug(&quot;(%d) %d -= %d\n&quot;,
+-		 vcc-&gt;vci, sk_wmem_alloc_get(sk), skb-&gt;truesize);
+-	WARN_ON(refcount_sub_and_test(skb-&gt;truesize, &amp;sk-&gt;sk_wmem_alloc));
++		 vcc-&gt;vci, sk_wmem_alloc_get(sk), ATM_SKB(skb)-&gt;acct_truesize);
++	WARN_ON(refcount_sub_and_test(ATM_SKB(skb)-&gt;acct_truesize, &amp;sk-&gt;sk_wmem_alloc));
+ 	dev_kfree_skb_any(skb);
+ 	sk-&gt;sk_write_space(sk);
+ }
+-- 
+2.15.1 (Apple Git-101)
+
-- 
2.15.1 (Apple Git-101)


]