From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48C15C433E6 for ; Tue, 26 Jan 2021 19:41:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12C632100A for ; Tue, 26 Jan 2021 19:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387497AbhAZFiy (ORCPT ); Tue, 26 Jan 2021 00:38:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:52142 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727677AbhAYK5B (ORCPT ); Mon, 25 Jan 2021 05:57:01 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1611572144; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9Xvv1RALPsUeOY2I3xlsjgZ9c/e/BEQxiygLkfo3w44=; b=KdS7iELmC4HWCM4gzLhVJfue5TncCkeJzgHsO2pgQFyxHLsggJ2GwIs4o/hzDWmUurPmDW tXGsRZr1mH0XklOl2E3MLk4MivwvGNLdok7v/ltPE8DqvI6kNuE2X3+lDiLUKz+EhfcaP+ xJ4X5XkKh2daWskEZ316A0eVmkPOp+I= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4C407AC9B; Mon, 25 Jan 2021 10:55:44 +0000 (UTC) Date: Mon, 25 Jan 2021 11:55:43 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Sven Schnelle , linux-kernel@vger.kernel.org Subject: Re: [PATCH] printk: fix string termination for record_print_text() Message-ID: References: <20210124202728.4718-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210124202728.4718-1-john.ogness@linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 2021-01-24 21:33:28, John Ogness wrote: > Commit f0e386ee0c0b ("printk: fix buffer overflow potential for > print_text()") added string termination in record_print_text(). > However it used the wrong base pointer for adding the terminator. > This led to a 0-byte being written somewhere beyond the buffer. > > Use the correct base pointer when adding the terminator. > > Fixes: f0e386ee0c0b ("printk: fix buffer overflow potential for print_text()") > Reported-by: Sven Schnelle > Signed-off-by: John Ogness The patch is pushed in kernel/printk.git, branch printk-rework. I am going to send pull request for-5.11 later today. Thanks a lot for the debugging and quick fix. I feel shame that I did not caught this during the review. Best Regards, Petr