From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0495151812E for ; Fri, 18 Sep 2026 18:15:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789755357; cv=none; b=fhfu4fm9CKCaDJA4lDjSywI3Rj4a7CcVtnEBqUK2IUexmNdaYo+27pVq4jloKPLgakbGmXCjtExhRAXojkkstaFLONxBWDdmiM4J08Jz6E314/sz5g8vr8xqzB7XFr/X+9bGPotrqYj7biaVmoGVRFW/NxtFnwxbJjihuebMyHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789755357; c=relaxed/simple; bh=OW/egmM7mt/va5mQ7VY7PztEIbg4lcAaL2bbHrTbTPE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=cH2rVpXZwRBqQMgVCZUscjxvTlk5awU1TNb6TEAZqAXlSyr7gilWNFcvQlab/r8t0gISrWPER04kC8/qAFCbTZ0FNhqdl9P9I9VONH+YaNK2tzNrk53rmATxeh2CXWNwi4VJLyIYSx3AparxC5M2Wj8mNbLVLxNNJjbmotuUL78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--rathodpriyank.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YdcTGLxk; arc=none smtp.client-ip=209.85.216.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--rathodpriyank.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YdcTGLxk" Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38e1118e4abso1848956a91.0 for ; Fri, 18 Sep 2026 11:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1789755355; x=1790360155; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=OW/egmM7mt/va5mQ7VY7PztEIbg4lcAaL2bbHrTbTPE=; b=YdcTGLxkxlZi8gNpmY5tjK9DZdC5iSaM9lHUXPIzh3mQg0ZQFZ7eJp1IWrhzV5jkav Ib7uGMOdg6zA6aNkLemrtHSCu+IKfPQCkrXa/LAk8a0MBtr7EwvHcQKWKUp0mG30c+NJ TahKQ/tIx0iphsg/JJxqjWzn1G6DQRRmJmHh7RePSOQDFK9Mr8LpRBq8K5qLJaAUIXt2 ateDWYELUv7xbccRIac8RR7bcviBC37xneeFr6xIbswqx+9lMUer6nqbOMFVAaWDaiEJ bmPIpbKJh/t2CjH59eVYKRjeC3bzpZ6X4ZR6RVWiT0tdO1Zzs3ONUOk1uHnHy3jH5Gzq oJJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789755355; x=1790360155; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OW/egmM7mt/va5mQ7VY7PztEIbg4lcAaL2bbHrTbTPE=; b=0xKlFuPhijgw3f0M1hwjboH/PINcDDZCe7JcnB5BuUlQyY7oEgblktc07KvwfRmmmu v0glfK+ulF2uYIFCpIfLHaS0Ia76M1PSoUgyLvv5zftEIrvvp0YG0k9aHyzYq+nM+p3P UMcKoc8QE3GSItNq+8SJDMmt6j7O0Nf+duHjbTBQrqBunkcs0+nY9mhunE25fBO/Inmc 2raLoijCL05ej5/W9wiD7ymE61mObNLvUIDKcW2Zr3AQZnMUu0wLEQHgp24yKmrl8tCk TofC5TkCxFMectf8JaV8cps9mzGBkifyOJqfClUq0OsImSHt6fOPgGtsDvK21Br3sTrU JkAQ== X-Forwarded-Encrypted: i=1; AKwUvBwa3HiA6fpe0zCqaiL9AYKmnS2v711xq+ZNC3wZ5rO1Y4fUp8M5ooYj0FCMrr5xpp811uJyrErWGzX+v0o=@vger.kernel.org X-Gm-Message-State: AFuF++k2tg2ngfeoyF0xTsXrcoh4ztJiJuZ20E5XYDjR+B+qKJ0qZEif M2jgYVbOrI70WNFCdcyFSar/lDuetJyXH711JBdO0B7scCmE4X2XEAD8yYgSNip5LuvvBAS+bMl 6fjCwPpeOKFjs+bNmVBot98aJfQODga53sA== X-Received: from pjbiw4.prod.google.com ([2002:a17:90b:4204:b0:39d:a2e8:6890]) (user=rathodpriyank job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:d40e:b0:39e:6c6a:656f with SMTP id 98e67ed59e1d1-39e6c6a6787mr605040a91.50.1789755355148; Fri, 18 Sep 2026 11:15:55 -0700 (PDT) Date: Fri, 18 Sep 2026 18:15:54 +0000 In-Reply-To: <20260918-b4-fix-aer-memleaks-v4-0-f0a2c21ed1d1@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260918-b4-fix-aer-memleaks-v4-0-f0a2c21ed1d1@google.com> X-Mailer: git-send-email 2.55.0.1082.g2b9226bbc0-goog Message-ID: <20260918181554.132414-1-rathodpriyank@google.com> Subject: Re: [PATCH v4 0/2] PCI/AER: Fix ghes_estatus_pool memory leaks in error handling From: Priyank Rathod To: Mahesh J Salgaonkar , "Oliver O'Halloran" , Bjorn Helgaas Cc: Lukas Wunner , Kuppuswamy Sathyanarayanan , Jonathan Cameron , "=?UTF-8?q?Ilpo=20J=C3=A4rvinen?=" , Dave Jiang , linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Priyank Rathod Content-Type: text/plain; charset="UTF-8" [+cc Kuppuswamy, Jonathan, Ilpo, Dave - you have reviewed most of the recent aer.c changes, so adding you here] Hi all, Adding the reviewers who have been active in drivers/pci/pcie/aer.c, as this series has not had review feedback since v1 (3 Aug). Short summary: ghes_handle_aer() hands a ghes_estatus_pool allocation to aer_recover_queue(), which returns void, so ownership sits with the AER code. Two paths drop it without freeing - kfifo overflow in aer_recover_queue(), and a dequeued record with no matching pci_dev in aer_recover_work_func(). Under a sustained error storm this drains the pool, which then breaks GHES hardware error reporting system-wide. v4 adds the Fixes: e2abc47a5a1a tag and Cc: stable that earlier revisions were missing, and is rebased onto v7.3-rc3+ (applies cleanly to pci/next as well). Review feedback very welcome - happy to respin in whatever shape you prefer. One open design question I would specifically like an opinion on: patch 1 frees the buffer inside aer_recover_queue(), which bakes the ghes_estatus_pool ownership assumption into an exported symbol. The alternative is to make aer_recover_queue() return int and let ghes_handle_aer() free its own allocation. I went with the former because aer_recover_work_func() already frees unconditionally to the pool, but I am happy to switch if you consider the exported-API contract cleaner. Thanks, Priyank