Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1155455lql; Tue, 12 Mar 2024 08:45:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/euUD4/XaxL2eCHF2XuqZWZ5QHqSGbd73eN6uA11JpQppoLa3XbfzJe3LjCK7fBzAwwN5cjtN3SEO0UPyKeBGOefZ9/vjFG83dqCQVA== X-Google-Smtp-Source: AGHT+IEdeEr4eQ7RSoy9oLQOkRdchdVKbdqieooctFVh1/Zk+zqjtXVO+DofZO+VQfxLVb4V3NvJ X-Received: by 2002:a05:622a:1454:b0:42e:8beb:325 with SMTP id v20-20020a05622a145400b0042e8beb0325mr11037719qtx.31.1710258343763; Tue, 12 Mar 2024 08:45:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710258343; cv=pass; d=google.com; s=arc-20160816; b=EXPBr0iYCJvpPZwkuRVQVgyEMCrSwXolND4pC+Le+sMgM9Z7c7bBVIJ9p9sjp0rXHa i2PyY9loEx84w2XTqessPlsOV0c3mQpJvXtL5CY8J2RInDOq8cD7eegIYlEmiMTOkde5 fZE3pvvcZqTHy1b/pH0MkhB8zFq4E/mkCiFMSPzdhIppyBm6NlPOFD50+Vqu/t+Rdu8L bX3YVp5N2CKd56VUQ9sYjoTP0f3FGLM/2jF9S9rivVIW1wpJKnktaMv5TkcdxmGvWA3B ybZ3Wt6YEDBY4NXUtKgZdi8TufI3E32VVuvGSjGZZ4EM7p4UyiILjOHIj5gsOXOV1t/M XyDA== 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=plViXgocX+43FaFVTkiMAQknhg2JZxGAilsVKhvdKAk=; fh=NAcsc8eGM9ERxvAaD6Gcau0yDzSEFPMPAkTnTEeIWq4=; b=AlHoJjJF08bFSwu12MoGUP4SoYc2M6rTQNNm1pNV85/KuFKqvMtp3dlDtxCJt8fFk/ NB5gCjJUJh2UNSRu8U97WFkP0tybyHziC4g096Q2oc+KqVOQK8m3Wrbc4K3RafL/em03 GLOqG6fmXzavJYRl4xyVgYyPpV6Xq1CCHjeXX4JKJz+Wenza/reWu68rf5mAd0MPBTvR gJPY0CwoYAZbJshnmW4kbAqyx5FtiVjKDsGFsZfm+eYFOE0pRXuRBFHOneS0UPvbcizK eZ4BYngumJKCvzwaUIcGUjKhZqgGLQgUICTIGw/pO791DG3o13IqmHphTKcf8gt+pbUK Bx3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ln2Ui+Nm; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-100467-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t4-20020ac85884000000b0042e4c0f1f9fsi7815950qta.466.2024.03.12.08.45.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 08:45:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100467-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ln2Ui+Nm; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-100467-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 487D91C21870 for ; Tue, 12 Mar 2024 15:45:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B68257CF0C; Tue, 12 Mar 2024 15:45:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Ln2Ui+Nm" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 504007C6D6; Tue, 12 Mar 2024 15:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710258335; cv=none; b=PC7NEogFKcdFnjOpBPXcj+3BDnX9PaZWhL6hekbKvPVHoUT3+BUJvGYhvL6dteDWOBjcoup6Br7GTJbcpJQGDTsvQnEvFDD6Pzofv72sRnBOBP29XAATrMLqEn5UIZm79UZ9RrA6o1/QRn1258J5EwfPQ4cVKqUpOEAed3CWfyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710258335; c=relaxed/simple; bh=plViXgocX+43FaFVTkiMAQknhg2JZxGAilsVKhvdKAk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G2MYBNOIWfwYZg4timqI6782OwP/c2VJ0d//d0byDgxn09mdZgai5zL7MLrt6nIyUlicJp4dyq96IsW0xz7PfLJBru5GVAO8OeG85pruJk/RgiMquke+GGoYpW+X0+pXIo3pvJUG0XmCrFP26mYYFHxifltjoVyWApi2ctf4Zeo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Ln2Ui+Nm; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 42CE6240004; Tue, 12 Mar 2024 15:45:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1710258328; 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=plViXgocX+43FaFVTkiMAQknhg2JZxGAilsVKhvdKAk=; b=Ln2Ui+NmcUK/CDH0MoZtYntEKO5E7fhSSA5YIBgdEajx0GBy6VQvfTz4y2ZgbDybP/ruPd +LL/SNBbO1lALCSNU6lMI1MxdqdT4HBr3lEIE9vujPy609D4g3kP8x2xXUYIoIfpnx4MX7 U95J13boUNeOCw8NDAnFj9hcv+bu+EGXYObP1wdbVwniZH4j0LZk268E61rzhdJATID5/J w+dMNTtdn1yBVkmkrHwxjyLzImO2iM75OEss1rBJyEriwXA9bc0o/0lBoczmYDTLC57fXA NLdQlYOUgs49UYWYqO/sQXZxFRqAkzpWhSqFZ95koU1qw118qyPSAKq9SJ6vhg== Date: Tue, 12 Mar 2024 16:45:26 +0100 From: Kory Maincent To: Elad Nachman Cc: , , , , , , , , , Subject: Re: [PATCH 2/3] net: marvell: prestera: fix memory use after free Message-ID: <20240312164526.4a0e242a@kmaincent-XPS-13-7390> In-Reply-To: <20240311135112.2642491-3-enachman@marvell.com> References: <20240311135112.2642491-1-enachman@marvell.com> <20240311135112.2642491-3-enachman@marvell.com> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) 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: quoted-printable X-GND-Sasl: kory.maincent@bootlin.com On Mon, 11 Mar 2024 15:51:11 +0200 Elad Nachman wrote: > From: Elad Nachman >=20 > Prestera driver routing module cleanup process would > release memory and then reference it again, and eventually > free it again. > Remove the redundant first memory free call. > All such double free calls were detected using KASAN. =20 Not directly related to this patch but I am wondering if the call to prestera_port_sfp_unbind(port) is not missing in prestera_destroy_ports() function? Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com