From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 799A63DB31A; Sat, 12 Sep 2026 12:22:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789215743; cv=none; b=aqaSeXHeasT5fHVjNUIxewCR0m8p0ar+u6dZ4tUv5FLM0IhDvLzHN5LX0Y9S1KiMVlqycW0Lu/lJZW603LFfAJ4UHJuYWISF6zrqi2n3Og7adrdzR+ryXAfDWUIcm3LunlI8gkCW+2h4uLcwx2sXob/sGBJQy1Eu8QaRHP65ikY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789215743; c=relaxed/simple; bh=4cO/ADGuzcVYHchypTDazFWXiidkK0DICWU4jcsYyTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GKmzO13zXaB6n30RX4bwD5014Um/tRABmt/gXRatafdWfKEU7jfHbMTaNAdoodvHo8Fx3rixQHH/CfV6+Ew6Vq95+vEC5CrnDz2+wjqeHJ7bsPiyqPskfcRHccSr9vnQH2AGM54ziyStrqbEPNiVq0c3vvJ0NUKk4RSqSEtvbv8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lpKJVq1A; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lpKJVq1A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33D131F000FF; Sat, 12 Sep 2026 12:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789215742; bh=uOBiPNg+hbi+Ds3sBspJpDJ/cis/sIsZhAHs8HQMn0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lpKJVq1AI+5rpxHeEArO488/AjCo6loWel7Ullz239rpywoTiapur3fzCzIvQ57y5 Y+iyb4EGFu0f6Zq1Kj7ex5la0jWTClS8sXrCnYjdhh/r+dejkZWZnEDAImHmt+FW/T +JqDn5yihP5KMgycofhzyxR0Xxd+w30JHq2qDT8c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, sashiko-bot , Ian Rogers , Namhyung Kim , Sasha Levin Subject: [PATCH 6.12 0593/1376] perf ui hists: Fix uninitialized stack memory free on pstack allocation failure Date: Sat, 12 Sep 2026 08:50:19 +0200 Message-ID: <20260912065620.750767748@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ian Rogers [ Upstream commit d5fdde1c426922efabe86a515f0782b3eba40577 ] Fixes heap corruption by initializing the options and actions arrays before the pstack allocation check, preventing an uninitialized stack pointer from being passed to free_popup_options() if the allocation fails. Reported-by: sashiko-bot Closes: https://lore.kernel.org/linux-perf-users/20260709035230.6DBEE1F000E9@smtp.kernel.org/ Fixes: f2b487db45f2 ("perf hists browser: Fix possible memory leak") Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Ian Rogers Link: https://lore.kernel.org/linux-perf-users/20260709035230.6DBEE1F000E9@smtp.kernel.org/ Signed-off-by: Namhyung Kim Signed-off-by: Sasha Levin --- tools/perf/ui/browsers/hists.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 3283b6313bab8..00d1ca3295b4f 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -3033,15 +3033,15 @@ static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *h browser->min_pcnt = min_pcnt; hist_browser__update_nr_entries(browser); + memset(options, 0, sizeof(options)); + memset(actions, 0, sizeof(actions)); + browser->pstack = pstack__new(3); if (browser->pstack == NULL) goto out; ui_helpline__push(helpline); - memset(options, 0, sizeof(options)); - memset(actions, 0, sizeof(actions)); - if (symbol_conf.col_width_list_str) perf_hpp__set_user_width(symbol_conf.col_width_list_str); -- 2.53.0