Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 43C5126D4F9; Mon, 23 Mar 2026 14:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277440; cv=none; b=glDMOg3om2scf9+tGlMHjIf6WyQz7f9EfMahN0Px8wYA3izeBYwImnB8RlO7Q9W9tzdwd+CsxcoAnQ8/NbTaHYcvxmJa+MoCQcwPiuesVADphZMO0SYr0WInXYM9pVEeI9jttIprsQ2x8qVOZxQez8wP3oN+LP6RUCwFaEfuB/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277440; c=relaxed/simple; bh=YSXHN4KJZXDVKCZw5Yu2HTPb+3K29CvMPpQ18eF8HiQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b8Hdf4os+OmGcQ2tOXZQBizqpM6anb8uoaT+UH8Brw/VIs/pcVoITOceoy59W2QbpDLVXwF1f9HGra8Zxz17WiW9oWuiP4O9xf3XI/jhE0JqeHjHF9Qd9xFqNkrBgHfTKj0oHirYyxZIvGUlYTZmJcVrXhiweq6Aj+HXEJEKHeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dbYgfWci; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="dbYgfWci" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2FFDC4CEF7; Mon, 23 Mar 2026 14:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774277440; bh=YSXHN4KJZXDVKCZw5Yu2HTPb+3K29CvMPpQ18eF8HiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dbYgfWci9+6h5jXDBc1CxQPXudthG0UKr2U2DaItmBNEtDtFkgLTaBoSdoyx8J9Je frEEr6UqxdKv9PVjWh8Jm6gMslJ9OsPxV7o0yqYxS5z0b0mPJvQE0j89hjd3PSkZix 3xGL/vmgZf+4C/RZ/vi+fIhJUVtL/JVq2RrDBtvM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mathieu Desnoyers , Ian Rogers , "Masami Hiramatsu (Google)" , "Steven Rostedt (Google)" Subject: [PATCH 6.12 441/460] ring-buffer: Fix to update per-subbuf entries of persistent ring buffer Date: Mon, 23 Mar 2026 14:47:17 +0100 Message-ID: <20260323134537.415940704@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134526.647552166@linuxfoundation.org> References: <20260323134526.647552166@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: Masami Hiramatsu (Google) commit f35dbac6942171dc4ce9398d1d216a59224590a9 upstream. Since the validation loop in rb_meta_validate_events() updates the same cpu_buffer->head_page->entries, the other subbuf entries are not updated. Fix to use head_page to update the entries field, since it is the cursor in this loop. Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers Cc: Ian Rogers Fixes: 5f3b6e839f3c ("ring-buffer: Validate boot range memory events") Link: https://patch.msgid.link/177391153882.193994.17158784065013676533.stgit@mhiramat.tok.corp.google.com Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -1863,7 +1863,7 @@ static void rb_meta_validate_events(stru entries += ret; entry_bytes += local_read(&head_page->page->commit); - local_set(&cpu_buffer->head_page->entries, ret); + local_set(&head_page->entries, ret); if (head_page == cpu_buffer->commit_page) break;