Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4504608pxk; Wed, 30 Sep 2020 04:54:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3Z+LCsNBA3IdMB463n96y/5f0Y8FC7T73mCoy6Zdw/Z2CsmPiUGL1nzBatKsjb1FDo5la X-Received: by 2002:a17:906:edd6:: with SMTP id sb22mr2244184ejb.499.1601466896325; Wed, 30 Sep 2020 04:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601466896; cv=none; d=google.com; s=arc-20160816; b=BuIHxVJ8WzchCezfysTLY/9orFpjmmqBodNhVWMUFZgUfgrU0xu1OaggfccWJYbdlW VnTEF4ulK/lttbnMlrA6DRqRinUncbLQchAgMlwn0C7v9eAzawBrmVnwvF8yh6k7yglq 4aUntRMWQa1u0G7Au/0v9bzdysxMr1dlJSDKQY+OoWmlvL0wsYDqmHtwuxq+euTg2AQq Chmf44gaSMZzaEVOTvd1jZro2E3YT87dp3jG4Fj02e8WbTQYHZFzc9gJ+bSi8o9vrNoK LYhuumeeVAu6rG8LdSMoRyEcfSBRCfr6e0X2UMKLGbMizIjKA74G2WCThMjy2oCkOAXV tNwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=TVH10QBD4QWRUGMBlREqgeRjVHRrmm+FuSJ/Eew8yco=; b=EgEio22CCtsyOgBOQVi8pATMAT0V+MsKz5wde9HfvLoiPH2bC6cGviCK7MaF8CDcms K9T0QWQmbo+tBtF7TSxzP3TR1M7rJegn5l4HB3a4nfFg4DyQayPGLqnKiMwQqU+SPo6L ffPo+gnL/h/+iHwMXxVWYovtexN7fNzOhbQckgElfXN6z8LFHMjd4XxWVFRgt/u4CQXc QwNiZ0+GL7+m2GTT8S2V2HLaLxbNc75ry1olhvWbyoadIOMGuHk66mHL+5cVeCEOL4gH JHGZrcHNDfVnN4FFsBTH6pIIMVDe7vAlJMzAxVQ9olLZ9V1zO3lQ4JwIAXBKv2ZGY5zt 8q8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=VowLJc1I; 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=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh27si871008ejb.643.2020.09.30.04.54.32; Wed, 30 Sep 2020 04:54:56 -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=@suse.com header.s=susede1 header.b=VowLJc1I; 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=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729409AbgI3LxK (ORCPT + 99 others); Wed, 30 Sep 2020 07:53:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:35572 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728430AbgI3LxK (ORCPT ); Wed, 30 Sep 2020 07:53:10 -0400 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=1601466788; 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=TVH10QBD4QWRUGMBlREqgeRjVHRrmm+FuSJ/Eew8yco=; b=VowLJc1ITAfAlVhj2ZDwVam39q5V44kLMbF8ZxcIv9Wacz9Euky9v8jXiZbv5NFmBgT9Bj fm/k50gxoJ9oesUhf9oLSnAyks8N6X99uWIqL9d4Kv1zgQn2EmNj70yki0vLMs889zwj0n 1+ga3KEVHYQN3ihKFl5qZnfFr6SUwaY= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B29DAAD39; Wed, 30 Sep 2020 11:53:08 +0000 (UTC) Date: Wed, 30 Sep 2020 13:53:07 +0200 From: Petr Mladek To: John Ogness 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 Message-ID: <20200930115307.GD29288@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> <87ft6z1oe7.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ft6z1oe7.fsf@jogness.linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2020-09-30 13:48:56, John Ogness wrote: > 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? If you have these locations still in head then it would be nice to add the checks. But it is not urgent. We should be on the safe side. Both ways to store new messages are limited again now. Anyway, please do so in a followup patch. I would like to push this patchset into linux-next ASAP so that the robots could continue finding new bugs. Best Regards, Petr