From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] sctp: increase sk_wmem_alloc when head->truesize is increased Date: Tue, 27 Nov 2018 15:42:48 -0800 (PST) Message-ID: <20181127.154248.292898274922488309.davem@davemloft.net> References: <4989c666f6077526983b02615cad001748d2e658.1543215164.git.lucien.xin@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org, marcelo.leitner@gmail.com, nhorman@tuxdriver.com To: lucien.xin@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:45906 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726286AbeK1KmV (ORCPT ); Wed, 28 Nov 2018 05:42:21 -0500 In-Reply-To: <4989c666f6077526983b02615cad001748d2e658.1543215164.git.lucien.xin@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Xin Long Date: Mon, 26 Nov 2018 14:52:44 +0800 > I changed to count sk_wmem_alloc by skb truesize instead of 1 to > fix the sk_wmem_alloc leak caused by later truesize's change in > xfrm in Commit 02968ccf0125 ("sctp: count sk_wmem_alloc by skb > truesize in sctp_packet_transmit"). > > But I should have also increased sk_wmem_alloc when head->truesize > is increased in sctp_packet_gso_append() as xfrm does. Otherwise, > sctp gso packet will cause sk_wmem_alloc underflow. > > Fixes: 02968ccf0125 ("sctp: count sk_wmem_alloc by skb truesize in sctp_packet_transmit") > Signed-off-by: Xin Long Applied.