Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp369700rdb; Wed, 17 Jan 2024 04:44:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFU7KqMwg/ImIb33HcMEcB1C0NoMyjLlzpLbdm/vJShSChXs+pZsLWxu7QYig3QG4mEGwxS X-Received: by 2002:a17:907:6b8e:b0:a2c:dd31:c0a3 with SMTP id rg14-20020a1709076b8e00b00a2cdd31c0a3mr3986007ejc.40.1705495458592; Wed, 17 Jan 2024 04:44:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705495458; cv=pass; d=google.com; s=arc-20160816; b=AP3BFy9FmgvUd6gWc2b7ejn4Ccsz24vw/KsKX3CoZbQbt1EtycKk8PYp/mZs6X8opL SpLdxdc4asSd6pYPrCYs5HdkgjVo8nWzK16Ez3Wx3pbMvjiTJ7A+fGphMTpCvFnE4l7J 75iWmibs0HMvA8HEUt5sKCCrka95JLdFYNEmdiJK8zVrzW9PueV/D13bJ5afKASXdXhx HiezTMtgsUWt59cq9fNVolSg2cpg1GgKcGEnBiDZuv83jZxaM0AXUi9i02eAmrOVCueq Y2YkUdIQkbkMrHbU6R8qYxh99+II/fGML118UYGqbRw2NhUD5zfF+CUvqhg94hNuScqo gN3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=KMSkPku3QMlfNd41QKWSK3FKi2QEGwiQlKcW1S6kODU=; fh=rv3W1Ux5R6QEmEExicL/uNlfhqSTppcGLCtR4K3Wo0w=; b=PqHxXB6KVe5oYWZf7NqWjNULD9X2kANuswX9Fo3br2rzMy8gen8mXaUB4A5BcJoJib zDPqLTT3UeLHe5HHZhaFNi75KVWJ/T/Afo/TJ4vdHJboCcr3L8Sb/fUi0Gk/uLERKrhf TGElcaAfItRcEdqdk8ejHakN+LPbS8N/czA9hjO7BD3aizycElx9X0yLlQflTXNnT3En arAwjZz0wP1W6Mcg5tFPiwkuT41bNrglvGmAcGCRUyyVXLFAy0Q6xWQapgpP/g4qevlA 57nN6s2zAf4ms/6/y4r+9D/HY2cmQsKotivV6BxkitCdhlKWi76s0gaGJOOiI+Qp1+QB r2Fg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gnumonks.org); spf=pass (google.com: domain of linux-kernel+bounces-28976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28976-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id kg16-20020a17090776f000b00a2ed1933d8bsi601246ejc.113.2024.01.17.04.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 04:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gnumonks.org); spf=pass (google.com: domain of linux-kernel+bounces-28976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28976-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 597361F25F90 for ; Wed, 17 Jan 2024 12:44:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81F991EA78; Wed, 17 Jan 2024 12:44:06 +0000 (UTC) Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [213.95.27.120]) (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 F2D8B1DFE6; Wed, 17 Jan 2024 12:44:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.27.120 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705495446; cv=none; b=I03z3ochrIAiUzd8ocqUcRbGGsFUL0BbrH0wUDzvbQFkf9b5Qx97ibwogW1FlrQwXkU/KwDthleqiKGl4o4wFGOAmx9EVkrWhNXibqRE7KIZPBmSLQfrm9MEiAMPxusFUk1LVszK9toH4abjmyLBT/qZhNmCNWxIZJou/k8Nc3A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705495446; c=relaxed/simple; bh=giAza7e6lB0scwLEi7BWSLsTb0Ii7ZIpXI4+tJX8w1o=; h=Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To: X-Spam-Score; b=OR/MHIhr3ujF3esGy0kGO1rF5qDoPv5LaorJSrHGvjbX3FfAzl/9K4SOoZ6nKxU9hTn+xrS8IzH6Y70vJPHkBHK+eACAydxtYjlz2Oq/c0f3tMcsOPpd9Sr43v9J8zVcyH8mzacge5oJ5cGsBmbaloac5dPEjpUDDZEzloe9sTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org; spf=pass smtp.mailfrom=gnumonks.org; arc=none smtp.client-ip=213.95.27.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gnumonks.org Received: from [78.30.41.52] (port=34294 helo=gnumonks.org) by ganesha.gnumonks.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rQ5Gn-00DsBF-Fq; Wed, 17 Jan 2024 13:43:51 +0100 Date: Wed, 17 Jan 2024 13:43:48 +0100 From: Pablo Neira Ayuso To: Pavel Tikhomirov Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Westphal , David Ahern , Jozsef Kadlecsik , Kees Cook , Nikolay Aleksandrov , Roopa Prabhu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux.dev, kernel@openvz.org Subject: Re: [PATCH v3 0/4] netlink: bridge: fix nf_bridge->physindev use after free Message-ID: References: <20240111150645.85637-1-ptikhomirov@virtuozzo.com> 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-Disposition: inline In-Reply-To: <20240111150645.85637-1-ptikhomirov@virtuozzo.com> X-Spam-Score: -1.9 (-) On Thu, Jan 11, 2024 at 11:06:36PM +0800, Pavel Tikhomirov wrote: > Code processing skb from neigh->arp_queue can access its > nf_bridge->physindev, which can already be freed, leading to crash. > > So, as Florian suggests, we can put physinif on nf_bridge and peek into > the original device with dev_get_by_index_rcu(), so that we can be sure > that device is not freed under us. > > This is a second attempt to fix this issue, first attempt: > > "neighbour: purge nf_bridged skb from foreign device neigh" > https://lore.kernel.org/netdev/20240108085232.95437-1-ptikhomirov@virtuozzo.com/ I have applied this series to nf.git I have added a Fixed: tag sufficiently old to the patch fix so it can reach -stable at some point. My understanding is that this problem has been always there for br_netfilter.