From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 69C4F37417D for ; Fri, 27 Mar 2026 12:54:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774616057; cv=none; b=ElR7YUYajHr4kcXMZ6ANMvbU+h6RLRiVFO3Q1nqIjPmtwwh+2YjqURa2Cp66o3j51m6rASJyGpyHlt81eE3dK0FFnGerY1hO2aUoUGLzP40xaU3xTv/V7BB5o+lUXjbMgEUrLTzsCH0MYtIVTrR1YhEEz0b731cejAAHJlpPr4o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774616057; c=relaxed/simple; bh=6ZmWzoiPWI4sfjxJDpoZaYpggHRWOG4HcGBuMBQRlQ8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hS0SzWxSgTHh+AbcyZYKxWHT+E95s3AF9EnHlIm4eMxLJlP4IR/K+/QtdNjc4+I4eRQXv9E+c8rXD175jbSNQE5yM4tNm+wtBVj8Yb2ZXqo9KsGRpkklVmqqd2SMKNGdhcBgyXV21hkFK29R26RmzDQFT8NXNnGBR1uzqSz39mc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=p4CjPFMg; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="p4CjPFMg" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-439b2965d4bso1575311f8f.2 for ; Fri, 27 Mar 2026 05:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774616055; x=1775220855; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=qmx1qsG7j5cuwdW89z4WvnegLEikYMgYgB9M2OzDn90=; b=p4CjPFMgcl2OfO9skINvUE63BB4aFCjh+xBNvFdp0/nEy0DTlXxsTRTKj98G5oraJo TpIQpeV/7G8JbXO1cby0Knf4Rdl7O1kQNo0svlrHlTnO4GqkkPL7S4b8ZOPWInoGqADj sNKy13ZH33f+gePq5yte1L53p5e14e3IBD4HbqgcqkXZdETU0CcUhPob8q197zyaQzTb cGjTxWXJny5bjZF4awBBuLv9eTo+5+ZYejhqGDkLXsPVe1/zOpBHcrLqo0CE7P+NMeDI 3xsUPPtc1jchKTbf4inUPqr+6XSQCQf1WU2ABBrMRyJGfPZJg/knbvp2VEV2JRGW1d4h S1iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774616055; x=1775220855; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qmx1qsG7j5cuwdW89z4WvnegLEikYMgYgB9M2OzDn90=; b=nZvJT1zqje03Nki/AMOzPtFU5TTpdMKAk6A3nQV5vR451ki7l0U1G3prLVNZ/yPEJE 2V09eVdaiss74MP9LBn2CDIO/UYm3yjeYHOmPxJSh5bMDF46nQ3A2i+WPu6omabziJrM kMbG6hRI50PnfFZmy+r2s4ypSn7BHWdWDgTiuYfEl9HuYpxa+NYPNTIFYrMiStvv+xnq T+VEwehAPNCFsqnD4wKR3HLiaOfdVNDpQZF5AUw0yaoB1C35sMFbgZVdUmWT8LyWP6MY VsK6FlxiEvIrB3fiznQ5V/g3PkjxV2wE3it0a2ND4INIfcZRqC2u5UBuBHfHCErUSjSl K0jA== X-Forwarded-Encrypted: i=1; AJvYcCXOJjq0c0Dk7e0Om8p5UYAU0SXa6A+Pb38wzIxjRDfbDT34dY1zENRYyPUh8coHuA+P6VwU7/zLOKLicWY=@vger.kernel.org X-Gm-Message-State: AOJu0YwaK2+4CVUKf8Pe4demGVlzB0mpwUvQ1+uvg8jJeeBim1t2czN1 XAdjx9b4sOy4P3Ym1v4XbIxRakmDBdnsJWnh6rz0Gmd8IhnjhzU+BTeb X-Gm-Gg: ATEYQzx6WE498gY/XB1F2nxxYD3rhFLj4eybz8cx/aG01ZO2Dszcd5d++E2CcNTpLst TKKGfMQrZrw9b4kFDOYg/MbVfyPe5NZyNCPUumSk+EP8XVWxhSsmtiJfgsmBD9joarecqzg7XEw FtZ0SAfS6deNnZniXbi+Mh1bne++vteqnqfPw2SwKB8Eid0OMp7iRnlE0FCEmzmjrOgu6H45J0T oSWv9bcvfKdiRRD9K2YdtJeI0hyiNUHa/Kc2Nhg3YTd/L+Yw9HVfeYfld/6PF5NS5GzXP+ICgW/ lV3JhBgqqbAC4QR2lYrgl/HZGOwk7eSFod+sit7DTDel9A1LrPx9wGIBCrVDU2Qn5oufoy/+BUU 6uB4ypWzcNfeKnLg3ep2Wq5378uOSVbb2b1yXxEWvKq1+7ubQiBRacRmoQy8mO9RbL2Gh5lzNvb 5cokAa2qd5Q3NNDaxUF/wPur3Zw79nrK/BW5TH8X9k+rLwtTCVQGsN9FwT+ilumDdF X-Received: by 2002:a05:6000:268a:b0:43b:8fa4:1958 with SMTP id ffacd0b85a97d-43b9e9d6039mr3783134f8f.4.1774616054426; Fri, 27 Mar 2026 05:54:14 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b919cf5aesm16281717f8f.24.2026.03.27.05.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 05:54:14 -0700 (PDT) Date: Fri, 27 Mar 2026 12:54:12 +0000 From: David Laight To: Andy Shevchenko Cc: Theodore Ts'o , Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Masami Hiramatsu , Petr Mladek , Rasmus Villemoes , Steven Rostedt , Sergey Senozhatsky , Andrew Morton Subject: Re: [PATCH next] ext4: Fix diagnostic printf formats Message-ID: <20260327125412.47944386@pumpkin> In-Reply-To: References: <20260326201804.3881-1-david.laight.linux@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 27 Mar 2026 12:48:56 +0200 Andy Shevchenko wrote: > On Thu, Mar 26, 2026 at 08:18:04PM +0000, david.laight.linux@gmail.com wrote: > > > The formats for non-terminated names should be "%.*s" not "%*.s". > > The kernel currently treats "%*.s" as equivalent to "%*s" whereas > > userspace requires it be equivalent to "%*.0s". > > Neither is correct here. > > This entire code seems was never tested properly and it's a dead code > until one defines manually DX_DEBUG. It also has tons of plain printk() > calls that may behave differently if the first character is not printable > but maps to the level of printk(). > > I'm not sure how your patch helps with all that, but apparently the > printed data has to be NUL-terminated, otherwise I have no idea how > it was ever working without crashes. > I noticed that as well. I suspect it way have worked for the person that wrote it because the name strings all happened to be NUL terminated. There is certainly likely to be a '\0' before you 'fall off' mapped memory and crash - so maybe they just ignored the extra characters. Clearly the other option is to delete it all. But regardless the format string is wrong. David