Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4499813pxk; Wed, 30 Sep 2020 04:46:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjdwbVs8PzenwL6qa8ibG+/lZkhMCS2Ys8jPAYqUeLXNFagbTPdEhJ/Ouy7uDsoEGBirc5 X-Received: by 2002:a17:906:b4e:: with SMTP id v14mr2272386ejg.179.1601466381828; Wed, 30 Sep 2020 04:46:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601466381; cv=none; d=google.com; s=arc-20160816; b=WGl0LocmDdJph5hvc/x5SR4f37kRK2x5PUdEZd2oPiX/vqgzb6vxZUERc3zS+nCw2F fZ1gIvB6mEuALM9qQWp2miRKi6pOlJU9y0GsMwofEGkJeZrTw+eDOslK4tXIz+9Il1GC ZGb/e/YMeW4vXxrvfD4RPKz9Xhw/IJanEt0pSLbevI0w4hc4wd3I5gLZQXBLA8wquh8B F6+fJu0NuzwfZ25FFtY+bIVoygnfeyD2sBgobPQ8+2U7cj2rYk+NLHJuIn6NSiFZ+ykz RNFIYTq9QsNdjbkJTEkMpFubWmkAouwsoZlsxtls0uN0WLknrp92E3UdslwRVwu/x4fU VHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=0+zNSI+mqx5CfiOQNU/5MvTkNgID9wWHb6xZFpnPBg8=; b=FqdviFrJLqBXb8mhSOj5QkOElC9E7gt5lqLc8c7sNh2UwkSpqmro/L8Zpbx0C5ygmL 6tzt5WHftBV16q8Z+O/yw4ZJO7WgNaCyIsuI3tBkigCqw8yYRNHv30dAnAyUjlS+2Tis t31MKSx3gpndfjPxp+65tndo2yNq2+vAPMyTk/7ae7NKDczTRzUK8NOvsIdygVtzf7QF 7W5cDXfg+UYF0kEdOoS7JmsFcvBDSYYkQQTqlfQYSjRNkLrP2iWOlEYOpbuE2LfiM21D VHs3PZ0DqGLGzDY3A10KaysxgYezDaFx7j1VWb8zn4uqC2jcKpnFyBAs/KebprRzCYEy yN1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JVuhSsX3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q6si979679eji.17.2020.09.30.04.45.59; Wed, 30 Sep 2020 04:46:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JVuhSsX3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729021AbgI3Lm6 (ORCPT + 99 others); Wed, 30 Sep 2020 07:42:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727997AbgI3Lm6 (ORCPT ); Wed, 30 Sep 2020 07:42:58 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A76DC061755 for ; Wed, 30 Sep 2020 04:42:58 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1601466176; h=from:from:reply-to:subject:subject: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=0+zNSI+mqx5CfiOQNU/5MvTkNgID9wWHb6xZFpnPBg8=; b=JVuhSsX3abSwQuTzm8uJA10+YocXED/oycGiqZYIgEkbN3W11pIgFmWW2CcEwu60jcq1R/ j/ShUWVNYje5PxAEIZcY6xNOPxB+F2v/gPMC0wf1Cp/MQ33oAOtIt+anRixdk6PZCPwixb A2fptVc2DXANmXsKnWgqZkQIRI9C9GoiDBpLjo8RcUzEhj6P6sbjk6FRfH2+krHeewFo0R A+pK7ze3GuQki2MWUuke4i1OWPk74UORfNEjPkEM/fMf/Z9iFd5UCAeAuOHythk70a1VO8 yEqk13X7fXMMaJvb5FOkpFcRvNxFh0HM15DtQFQ0cIZKusX7rdQsyk1z4E4JsA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1601466176; h=from:from:reply-to:subject:subject: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=0+zNSI+mqx5CfiOQNU/5MvTkNgID9wWHb6xZFpnPBg8=; b=/AFGh+TIceYNDP5OAzZR05lbvlv5oUTl6tdChUtLopRisGV+2F/Bw8d0K8TkNo6+1hxd5w qVEQ1FtmGEieapBg== To: Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Thomas Gleixner , Marek Szyprowski , linux-kernel@vger.kernel.org Subject: Re: [PATCH next v2 1/2] printk: avoid and/or handle record truncation In-Reply-To: <20200930112836.GC29288@alley> References: <20200930090134.8723-1-john.ogness@linutronix.de> <20200930090134.8723-2-john.ogness@linutronix.de> <20200930094316.GB987@jagdpanzerIV.localdomain> <87imbv1s0d.fsf@jogness.linutronix.de> <20200930112836.GC29288@alley> Date: Wed, 30 Sep 2020 13:48:56 +0206 Message-ID: <87ft6z1oe7.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-09-30, Petr Mladek wrote: > Anyway, I see hardcoded limit more like a hack. It limits something > somewhere so that some other code somewhere else is safe to use. > > And printk.c is really bad from this point. It sometimes does not > check for overflow because it "knows" that the buffers are big > enough. But it is error prone code, especially when there are more > limits defined (pure text, prefix, extended prefix). And it > will be worse if we allow to add more optional information > into the prefix. So should I post a v3 where the checks are added? Or should I add comments where checks would be, explaining why the checks are not needed? John Ogness