From patchwork Mon Feb 22 15:12:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 12098863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25CD1C433DB for ; Mon, 22 Feb 2021 15:15:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D57E96148E for ; Mon, 22 Feb 2021 15:15:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231409AbhBVPPY (ORCPT ); Mon, 22 Feb 2021 10:15:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231322AbhBVPO1 (ORCPT ); Mon, 22 Feb 2021 10:14:27 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 381FFC061223 for ; Mon, 22 Feb 2021 07:12:58 -0800 (PST) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lECtF-0007dr-14; Mon, 22 Feb 2021 16:12:49 +0100 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lECtE-0006zu-6X; Mon, 22 Feb 2021 16:12:48 +0100 From: Oleksij Rempel To: mkl@pengutronix.de, "David S. Miller" , Jakub Kicinski , Oliver Hartkopp , Robin van der Gracht , Johannes Berg Cc: Oleksij Rempel , kernel@pengutronix.de, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Dumazet , linux-wireless@vger.kernel.org Subject: [PATCH net v1 0/3] add support for skb with sk ref cloning Date: Mon, 22 Feb 2021 16:12:44 +0100 Message-Id: <20210222151247.24534-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Hello, this series tries to fix a long standing problem in the CAN echo SKB handling. The problem shows up if an echo SKB for a SKB that references an already closed socket is created. It looks like the mac80211/tx.c has the same problem, see RFC patch 3 for details. regards, Oleksij Oleksij Rempel (3): skbuff: skb_clone_sk_optional(): add function to always clone a skb and increase refcount on sk if valid can: fix ref count warning if socket was closed before skb was cloned [RFC] mac80211: ieee80211_store_ack_skb(): make use of skb_clone_sk_optional() include/linux/can/skb.h | 3 +-- include/linux/skbuff.h | 1 + net/can/af_can.c | 6 +++--- net/can/j1939/main.c | 3 +-- net/can/j1939/socket.c | 3 +-- net/can/j1939/transport.c | 4 +--- net/core/skbuff.c | 27 +++++++++++++++++++++++++++ net/mac80211/tx.c | 6 +----- 8 files changed, 36 insertions(+), 17 deletions(-)