Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp578523pxj; Thu, 17 Jun 2021 09:05:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoMO1KbTCM462qo8RTqVI2JlEvwKWZ1QGzW2cyRFtKV6JV2Vnm+cTBuhG0lGHZs31VTqZe X-Received: by 2002:aa7:d648:: with SMTP id v8mr7393614edr.203.1623945915702; Thu, 17 Jun 2021 09:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623945915; cv=none; d=google.com; s=arc-20160816; b=pdZ44CmO7nBAyUMJHC5Q71NDD2267VwzLujgFdreHZpicKPdJ4FGRPWz5m2Id+8Udq guJ+EBwmNkV0tjkBpIao7WHZVLLArrw4x7pBfLiXBWhYTvaqgbD3JHW/UBI41jfZ7759 21RHDVsLmnPeczkE/MHmKO/f1mlbly6p02GWxoGmj+Mq6dHwKuMkOYH/yNvXlUn9Xt6V XvhKUhKecLnVqgDfDS4oHqAYSQalId5p9gBCWv2gBwTuUH2Y0nKI9xUbMactViDSjsJ2 Afb6f6Zgacah3ylRV0wLlaVS9W0bXgqNUQvaZo+rRMDzvDbTFgwMom6enXNCOP54n8/c e3yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k6vdGmrcq4x2AuAinZJKkqauzLMWb0916Pdva0/CgU8=; b=b4IxhDeNooTiXFMF4JjRYD1owWuSp5JkJH0vsAYIZrQX10LHGYIkWe4Rr/CBLT8i11 yX7LhnvrnuQJ4l9qJ0Fpcyspt4bUpQbn3rBTJMJwrNuT7VH+kjRaQNUGMcmEXLo3Ih4D i0gwplUYIZnAZobogN23GjakE224hKndK2DYKfJ1pFaiaeYrd36E9+5cnHqZhCDoK7NB Bysmar/DrcBfCWmVYBXgZRheF7uNDOSlKMZ6J/KZrTdtaFagt4t7mGvnILbhY8psVt4B oJTNV9mrleV1Jmq48mvDfddb2L/mWum5qSF96db3cL3hpvPWEte91AEd5KDg3RoZJ6Qb GbUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N3s56ziw; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 21si6124126ejc.63.2021.06.17.09.04.48; Thu, 17 Jun 2021 09:05:15 -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=@kernel.org header.s=k20201202 header.b=N3s56ziw; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231359AbhFQMjL (ORCPT + 99 others); Thu, 17 Jun 2021 08:39:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:40660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231345AbhFQMjK (ORCPT ); Thu, 17 Jun 2021 08:39:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D3723610CA; Thu, 17 Jun 2021 12:36:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623933423; bh=vtIoA3RUe9cfBWUdhTz7R1sk/khl1Kit7uv87wGgMwE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N3s56ziwwBuYAAcAAaOb5NasxsTephHi7oyHCorEYVIRQufV3DpM+2sYXh/hqTEo0 0xZU8wn8q+6PmzRxv3He6H+rW1zIuk5XDBdfnMOV8DahEKn8nW/ZAD09IGyiH8DVeu pfePkV2t/q4AZHSV7cR0iXMqNsU5geItSPo3ys2Vt7UEx53v2Kq8JiYMI86mYEW0wV nqJNFxofVKcLvxWJM8mlB6i38wThfWdODjuR5vPy/U46LDlJurv8mJQQVW3no6rlXL W9CC21egH4K6TdC7T9WFDEGUv5XXwPrrJ7qc9/3z/mbB3NF6vfYFvluImOdz9rGP1L 7DpeLTuYBaarQ== Date: Thu, 17 Jun 2021 14:36:56 +0200 From: Jessica Yu To: Petr Mladek Cc: Chris Down , linux-kernel@vger.kernel.org, Sergey Senozhatsky , John Ogness , Steven Rostedt , Greg Kroah-Hartman , Johannes Weiner , Kees Cook , Andy Shevchenko , Rasmus Villemoes , kernel-team@fb.com Subject: Re: [PATCH v7 0/5] printk: Userspace format indexing support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-OS: Linux linux.fritz.box 5.12.9-1-default x86_64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Petr Mladek [17/06/21 12:10 +0200]: >On Tue 2021-06-15 17:52:20, Chris Down wrote: >> We have a number of systems industry-wide that have a subset of their >> functionality that works as follows: >> >> 1. Receive a message from local kmsg, serial console, or netconsole; >> 2. Apply a set of rules to classify the message; >> 3. Do something based on this classification (like scheduling a >> remediation for the machine), rinse, and repeat. >> >> This provides a solution to the issue of silently changed or deleted >> printks: we record pointers to all printk format strings known at >> compile time into a new .printk_index section, both in vmlinux and >> modules. At runtime, this can then be iterated by looking at >> /printk/index/, which emits the following format, both >> readable by humans and able to be parsed by machines: >> >> $ head -1 vmlinux; shuf -n 5 vmlinux >> # filename:line function "format" >> <5> block/blk-settings.c:661 disk_stack_limits "%s: Warning: Device %s is misaligned\n" >> <4> kernel/trace/trace.c:8296 trace_create_file "Could not create tracefs '%s' entry\n" >> <6> arch/x86/kernel/hpet.c:144 _hpet_print_config "hpet: %s(%d):\n" >> <6> init/do_mounts.c:605 prepare_namespace "Waiting for root device %s...\n" >> <6> drivers/acpi/osl.c:1410 acpi_no_auto_serialize_setup "ACPI: auto-serialization disabled\n" >> >> This mitigates the majority of cases where we have a highly-specific >> printk which we want to match on, as we can now enumerate and check >> whether the format changed or the printk callsite disappeared entirely >> in userspace. This allows us to catch changes to printks we monitor >> earlier and decide what to do about it before it becomes problematic. >> >> There is no additional runtime cost for printk callers or printk itself, >> and the assembly generated is exactly the same. >> >> Chris Down (5): >> string_helpers: Escape double quotes in escape_special >> printk: Straighten out log_flags into printk_info_flags >> printk: Rework parse_prefix into printk_parse_prefix >> printk: Userspace format indexing support >> printk: index: Add indexing support to dev_printk > >The patchset looks ready for linux-next from my POV. I could fixup the >messages as suggested by Andy when pushing. > >Well, I would still like to get acks from: > > + Andy for the 1st patch > + Jessica for the changes in the module loader code in 4th patch. Hi Petr, the module.{c,h} changes are fine by me: Acked-by: Jessica Yu Thank you, Jessica