From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp134-32.sina.com.cn (smtp134-32.sina.com.cn [180.149.134.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06A041FD782 for ; Wed, 18 Dec 2024 23:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=180.149.134.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734563724; cv=none; b=tS6G4aBzSxs1LPiRrPeWvW+6rZFGz/SuNWfvVlLvY+SRxwobmllo/sXuK7Zy7h30jPZKAyO2B2gZTbIkDN/ntB6+Senu41CAcf8asiTj/Ng8tHddvug2RekETikBdf+HESW4iPAaKo99+Hn/+oqfdZ0K1AYRlCUPwMMZCVwfInU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734563724; c=relaxed/simple; bh=PSs7pUfB+0ReI017mCbXpg9w8VO9t8f9/FQuTd47Bv0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z+d/mcjXe0tYKjCFngW8J3qOtJUkWOnzV1o6WC3qE2jURZOlDVW7KDkpOH85qbtTulxVGapjrXMTMFpxS4wdJovN/qrESwvemv43PcEUwpRVX26lW5UqV9+/FF314pvtb66uDD31+6JnbwCcdWE3o12cMNpkLE+Z3kbtgkGBkT0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=180.149.134.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([116.24.8.58]) by sina.com (10.185.250.21) with ESMTP id 6763577700001BB3; Wed, 19 Dec 2024 07:15:06 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 310973408289 X-SMAIL-UIID: 21E4FF0D1C30468AB6628499149ABD23-20241219-071506-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [net?] general protection fault in put_page (4) Date: Thu, 19 Dec 2024 07:14:56 +0800 Message-ID: <20241218231457.288-1-hdanton@sina.com> In-Reply-To: <6761aed9.050a0220.29fcd0.006b.GAE@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Tue, Dec 17, 2024 at 6:03 PM > syzbot found the following issue on: > > HEAD commit: 78d4f34e2115 Linux 6.13-rc3 > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13f502df980000 #syz test --- x/net/core/skbuff.c +++ y/net/core/skbuff.c @@ -1099,13 +1099,22 @@ static void skb_free_head(struct sk_buff } } +static DEFINE_SPINLOCK(skb_release_data_lock); static void skb_release_data(struct sk_buff *skb, enum skb_drop_reason reason) { struct skb_shared_info *shinfo = skb_shinfo(skb); int i; + unsigned long flg; if (!skb_data_unref(skb, shinfo)) - goto exit; + return; + spin_lock_irqsave(&skb_release_data_lock, flg); + if ((1 << 6) & shinfo->flags) { + spin_unlock_irqrestore(&skb_release_data_lock, flg); + return; + } + shinfo->flags |= (1 << 6); + spin_unlock_irqrestore(&skb_release_data_lock, flg); if (skb_zcopy(skb)) { bool skip_unref = shinfo->flags & SKBFL_MANAGED_FRAG_REFS; --