From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 C50B2C4320A for ; Tue, 10 Aug 2021 10:49:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A02A560EE7 for ; Tue, 10 Aug 2021 10:49:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239924AbhHJKuB (ORCPT ); Tue, 10 Aug 2021 06:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239920AbhHJKuA (ORCPT ); Tue, 10 Aug 2021 06:50:00 -0400 Received: from proxima.lasnet.de (proxima.lasnet.de [IPv6:2a01:4f8:121:31eb:3::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC78C0613D3; Tue, 10 Aug 2021 03:49:37 -0700 (PDT) Received: from [192.168.178.156] (unknown [80.156.89.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: stefan@datenfreihafen.org) by proxima.lasnet.de (Postfix) with ESMTPSA id BEE9CC0353; Tue, 10 Aug 2021 12:49:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datenfreihafen.org; s=2021; t=1628592568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M0qF+o2AoVk5F58x/KmSY20curOZrhbNqe7IPSM3OJA=; b=n+fHjMvtfN0LwKThosvhFKpTysHYNz3y05ebgbmXczVeSF2/Hpk8w0xIviQW0d4t9/2R8H 4CbkvT3toZe0uFnRDjHD8eFsNfj15HjXpPFettkL3f1U/Yk4mV3jtNuv1VGhK6xKeqFBzy sU+dO+33KeSZ/trhYO8ULtLjvyVs6RyfInzyAy995ZoZW3AsXOjwt7z67FRZXLqBy7rHpf 0DLDZOzeQWPmbinKCCT3+vA4wrZaEBhleqOOk9aEZ/SGzDzCAyzJpeluaHFY2Pg8+Kpnjz glKyjnOTwSo58vfq8m/C9ctC0VqL6lDpnAkTrW3Hfd+kX2F7Rgyvv2RG/PmLxw== Subject: Re: [PATCH net] net: Fix memory leak in ieee802154_raw_deliver To: Alexander Aring , Jakub Kicinski Cc: Takeshi Misawa , David Howells , "open list:NETWORKING [GENERAL]" , linux-wpan - ML References: <20210805075414.GA15796@DESKTOP> <20210805065022.574e0691@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: Stefan Schmidt Message-ID: <47581b9b-4def-40be-88cb-6357516f9eb3@datenfreihafen.org> Date: Tue, 10 Aug 2021 12:49:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello. On 09.08.21 15:06, Alexander Aring wrote: > Hi, > > On Thu, 5 Aug 2021 at 09:50, Jakub Kicinski wrote: >> >> On Thu, 5 Aug 2021 16:54:14 +0900 Takeshi Misawa wrote: >>> If IEEE-802.15.4-RAW is closed before receive skb, skb is leaked. >>> Fix this, by freeing sk_receive_queue in sk->sk_destruct(). >>> >>> syzbot report: >>> BUG: memory leak >>> unreferenced object 0xffff88810f644600 (size 232): >>> comm "softirq", pid 0, jiffies 4294967032 (age 81.270s) >>> hex dump (first 32 bytes): >>> 10 7d 4b 12 81 88 ff ff 10 7d 4b 12 81 88 ff ff .}K......}K..... >>> 00 00 00 00 00 00 00 00 40 7c 4b 12 81 88 ff ff ........@|K..... >>> backtrace: >>> [] skb_clone+0xaa/0x2b0 net/core/skbuff.c:1496 >>> [] ieee802154_raw_deliver net/ieee802154/socket.c:369 [inline] >>> [] ieee802154_rcv+0x100/0x340 net/ieee802154/socket.c:1070 >>> [] __netif_receive_skb_one_core+0x6a/0xa0 net/core/dev.c:5384 >>> [] __netif_receive_skb+0x27/0xa0 net/core/dev.c:5498 >>> [] netif_receive_skb_internal net/core/dev.c:5603 [inline] >>> [] netif_receive_skb+0x59/0x260 net/core/dev.c:5662 >>> [] ieee802154_deliver_skb net/mac802154/rx.c:29 [inline] >>> [] ieee802154_subif_frame net/mac802154/rx.c:102 [inline] >>> [] __ieee802154_rx_handle_packet net/mac802154/rx.c:212 [inline] >>> [] ieee802154_rx+0x612/0x620 net/mac802154/rx.c:284 >>> [] ieee802154_tasklet_handler+0x86/0xa0 net/mac802154/main.c:35 >>> [] tasklet_action_common.constprop.0+0x5b/0x100 kernel/softirq.c:557 >>> [] __do_softirq+0xbf/0x2ab kernel/softirq.c:345 >>> [] do_softirq kernel/softirq.c:248 [inline] >>> [] do_softirq+0x5c/0x80 kernel/softirq.c:235 >>> [] __local_bh_enable_ip+0x51/0x60 kernel/softirq.c:198 >>> [] local_bh_enable include/linux/bottom_half.h:32 [inline] >>> [] rcu_read_unlock_bh include/linux/rcupdate.h:745 [inline] >>> [] __dev_queue_xmit+0x7f4/0xf60 net/core/dev.c:4221 >>> [] raw_sendmsg+0x1f4/0x2b0 net/ieee802154/socket.c:295 >>> [] sock_sendmsg_nosec net/socket.c:654 [inline] >>> [] sock_sendmsg+0x56/0x80 net/socket.c:674 >>> [] __sys_sendto+0x15c/0x200 net/socket.c:1977 >>> [] __do_sys_sendto net/socket.c:1989 [inline] >>> [] __se_sys_sendto net/socket.c:1985 [inline] >>> [] __x64_sys_sendto+0x26/0x30 net/socket.c:1985 >>> >>> Fixes: 9ec767160357 ("net: add IEEE 802.15.4 socket family implementation") >>> Reported-and-tested-by: syzbot+1f68113fa907bf0695a8@syzkaller.appspotmail.com >>> Signed-off-by: Takeshi Misawa > > Acked-by: Alexander Aring This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks! regards Stefan Schmidt