Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1951587yba; Thu, 4 Apr 2019 23:57:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3O3/csDIshU+alW704thwFV6l1Z+FTbgQ+w+uiJb/31Ff3onS6DAWukoCe8eA+uGeevBn X-Received: by 2002:a62:4610:: with SMTP id t16mr10557454pfa.217.1554447458539; Thu, 04 Apr 2019 23:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554447458; cv=none; d=google.com; s=arc-20160816; b=FDZQg9IwjO4ezSlq5lOzcLKATVb4VB5B+1wYFOj9BQtFclpTEIau1DUKDJ3eQ9ILjr psJpodwqQJLM8YmqbjVHARq1fgXzrR6lQ8XF8Ct7NZhAXaqQ0W870IN9KUTg+EgCHx/u WJZPTEX2CcVSM4p5+RCPk9TdSJFgixixvlg6PBGzNVqOVbPheIiybuL9+N2SmREXq+FO tgKj67ajbstpFVJy6w/yVtVGdVEETkhn1Ke4Yz4ACyBEHHXzkjFb0DO4+XMoqcphTlJe m/tdz87HTyxacNckW7yR+IgXjH2EiX2FK1Tsvhn1sPBHGev+5inU+M3VUSAyNuQ65m0S D6Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:organization:subject:cc:to:from:date :content-transfer-encoding:mime-version; bh=7quTV6pGFiB89KlKugdvfIe3bSUqjYIaA+THcFYOZs8=; b=FYvquIeLLxrmCYPo5/jO2GEaaEBhKnEal8CN2OGUjxh/ZxCYRDnZelWpZ2e+WGYfOG nJonFV+ixUtN+epar9fpta//9d1xhewNrYuXhtrNT+M3bPc75qwOX+/Ormv/uUVpRKYd bNybeKHX7mQH47GfzLYM2x/U21hOn31tdI0RfmJ3G4z4nflyT2oKFyJBUFgUxdDT7UmB CgiZS37D/1CETOMTSP6pPDZrh3byELEStqyFWPN858n9JOxKB4oP+04EGrsg76FWotfR AgD8ced8vhKCvKFnRL/1scbp7LC6+f/4QHuEQCwB4fy96xZIZyA+up4PsrHHT/8psm9/ ZXGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si18531744pld.11.2019.04.04.23.57.23; Thu, 04 Apr 2019 23:57:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729826AbfDEG4s (ORCPT + 99 others); Fri, 5 Apr 2019 02:56:48 -0400 Received: from host-88-217-225-28.customer.m-online.net ([88.217.225.28]:9089 "EHLO mail.dev.tdt.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725955AbfDEG4r (ORCPT ); Fri, 5 Apr 2019 02:56:47 -0400 Received: from mail.dev.tdt.de (localhost [IPv6:::1]) by mail.dev.tdt.de (Postfix) with ESMTP id B3FE32081D; Fri, 5 Apr 2019 06:56:44 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 05 Apr 2019 08:56:44 +0200 From: Martin Schiller To: David Miller Cc: andrew.hendry@gmail.com, khc@pm.waw.pl, isdn@linux-pingi.de, edumazet@google.com, linux-x25@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] wan/hdlc_x25: fix skb handling Organization: TDT GmbH In-Reply-To: <20190404.173240.1338878948110207179.davem@davemloft.net> References: <20190403050118.12785-1-ms@dev.tdt.de> <20190403050118.12785-2-ms@dev.tdt.de> <20190404.173240.1338878948110207179.davem@davemloft.net> Message-ID: X-Sender: ms@dev.tdt.de User-Agent: Roundcube Webmail/1.1.5 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dev.tdt.de Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-04-05 02:32, David Miller wrote: > From: Martin Schiller > Date: Wed, 3 Apr 2019 07:01:16 +0200 > >> /* X.25 to LAPB */ >> switch (skb->data[0]) { >> case X25_IFACE_DATA: /* Data to be transmitted */ >> - skb_pull(skb, 1); >> - if ((result = lapb_data_request(dev, skb)) != LAPB_OK) >> - dev_kfree_skb(skb); >> - return NETDEV_TX_OK; >> + skbn = skb_copy(skb, GFP_ATOMIC); >> + skb_pull(skbn, 1); >> + skb_reset_network_header(skbn); >> + if ((result = lapb_data_request(dev, skbn)) != LAPB_OK) >> + dev_kfree_skb(skbn); > > This leaks 'skb'. What exactly do you mean? 'skb' will get freed at the end of x25_xmit() function: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wan/hdlc_x25.c#n129 > > No way I'm applying this stuff.