Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1419285lqt; Wed, 20 Mar 2024 03:34:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvkGdpOk/m5Ge4IKGHERTJdgH2jy9gWOJOlNHKA0RCwERNHh3D5Ac80iKL3Bh7Is8fRMr8Uflh8qQcYfApyr97EIWyVkPCUyU50hG/ZQ== X-Google-Smtp-Source: AGHT+IHSH1aySh2qkH7mwGq/nrYshDgn5dw4dd3AHVZHgMWnR7RwL9eI0l4AhC5MiZft3Q98go1Z X-Received: by 2002:a05:6871:b0d:b0:220:8cc7:c03d with SMTP id fq13-20020a0568710b0d00b002208cc7c03dmr17680810oab.31.1710930896438; Wed, 20 Mar 2024 03:34:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710930896; cv=pass; d=google.com; s=arc-20160816; b=qmI0Lcl8AyCiAC5IF/k2EYyQ477KCbuQ5cevxZz11aGj1hMiS6FCMx0bUup7pyt2x3 rqbzAndti30lKmCQMamZsNwHzGSezdrtKDa1B1dbmBm4EjwzW8VFXet9eLoMf2g/XOvD hyVoCOfJ51O3oKB2KOcp0oRzaRj3yT7/yNxVKctu4n1gIPtP+lJ7uicP1uSU5Gud0QXI ijgGNXaRlU4JDJbXMsISWWdDR0VaYxlBzvyIdwL8DJ8mUV3vLpC+pKcTa2mQjsTWJP5c hprR/47LWs83aSpvCX/+8WDZaINO2qAFmUVoXWbhcIqd7ncGAeSI3EQbhvpbbcM1WXke 9IPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=0GpTkMkR3ElttYLoFeZib2Ec1iwSUwTQIoql0zn+Pg4=; fh=EZvjOCjLm5lE+wzAjYLtlJQ4Ml5KoGCEEb1KEwOy4OQ=; b=DsN+q4cEUUyyJV70OZqFPdld2hwgTlyEIKEJyV7fsApRmumL0eDnsAFzSNNcweX5s0 C2KdeGw6ovTE8uN/P51SY8fKAmDX62NtNYchgHSOR01YMRNI9WsnLxkxaedPtocABusg tMT+w5AzM3ezgRhPMFscDjeNL3/ybgw4Vd8jkOsT76G+icoEFKpXmiJAP5JIXflq2b8P uu/jgsE9nKKXacX02nOTTr1gWdZSGi5VWu+qcnHhR8euSf7vOwq2xxDVd1zDk/vGPUtj RAK8VFpesvcpC3C2HYGpDM6G+drgxVCPbWuFPY3Z6dHw4tMZTC29zW6nkRxV1gnVEwGh NQfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-108789-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108789-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g21-20020a05620a109500b0078a0daa66e0si4306433qkk.580.2024.03.20.03.34.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 03:34:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108789-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-108789-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108789-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 28A7A1C231A8 for ; Wed, 20 Mar 2024 10:34:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7995A3DBA1; Wed, 20 Mar 2024 10:32:45 +0000 (UTC) Received: from mail114-240.sinamail.sina.com.cn (mail114-240.sinamail.sina.com.cn [218.30.114.240]) (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 8DD383E47E for ; Wed, 20 Mar 2024 10:32:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.114.240 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710930765; cv=none; b=FXefB9I0cgsHsWGfRbCDusO/J+eN0ioTiYzt8/arwrg4VEVLggqHMf7owBt8YaBADIePi+RXu59BhAHZwZbavXx0j8L2KbYw4tPmHQAttE6kaPEKczwRmZq0gRkjm3aIXSwNaNmCNg+oytfTNocKhHdr2KzuMlw0zXZpBCuUkOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710930765; c=relaxed/simple; bh=T35/JrbAIRlVdb8W3DXMbAHoQbCejoJW0kA8EGF3G7U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BOuq2YkGLoB3Nlz+WXPyIDoRNLeT31moRBPhlKPU1A3LfmqAKNoV8xM31hPOlcNm+ySiPVAIDC4hpwOPgZfBabZA7U6QHYgvTKvraPV5drsnxs0ed2Q15NawHKz6lxZt49+hUIvopdxHkEbYQ53RI6EFxJYJE8qVwG6kBKlv+is= 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=218.30.114.240 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.11.154]) by sina.com (172.16.235.24) with ESMTP id 65FABB3F00004AF8; Wed, 20 Mar 2024 18:32:33 +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: 65244545089261 X-SMAIL-UIID: 17DCF4DB114A47DDAA77499C7F92291D-20240320-183233-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [bpf?] possible deadlock in trie_delete_elem Date: Wed, 20 Mar 2024 18:32:24 +0800 Message-Id: <20240320103224.2123-1-hdanton@sina.com> In-Reply-To: <000000000000adb08b061413919e@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 20 Mar 2024 01:42:21 -0700 > syzbot found the following issue on: > > HEAD commit: 32fa4366cc4d net: phy: fix phy_read_poll_timeout argument .. > git tree: net > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1676fc6e180000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git 32fa4366cc4d --- x/kernel/bpf/lpm_trie.c +++ y/kernel/bpf/lpm_trie.c @@ -321,7 +321,7 @@ static long trie_update_elem(struct bpf_ if (key->prefixlen > trie->max_prefixlen) return -EINVAL; - spin_lock_irqsave(&trie->lock, irq_flags); + spin_lock_irqsave_nested(&trie->lock, irq_flags, 1); /* Allocate and fill a new node */ @@ -448,7 +448,7 @@ static long trie_delete_elem(struct bpf_ if (key->prefixlen > trie->max_prefixlen) return -EINVAL; - spin_lock_irqsave(&trie->lock, irq_flags); + spin_lock_irqsave_nested(&trie->lock, irq_flags, 2); /* Walk the tree looking for an exact key/length match and keeping * track of the path we traverse. We will need to know the node --