Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp405258pxj; Thu, 17 Jun 2021 05:34:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmd1eDVVrmsQooJmtJ6javBIdmXR64HI9ab9zC0pkU52KxL6lSkYM57+4N7PCTn5GdAju2 X-Received: by 2002:a17:906:7842:: with SMTP id p2mr4777352ejm.487.1623933263989; Thu, 17 Jun 2021 05:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623933263; cv=none; d=google.com; s=arc-20160816; b=W5Fi7krKIRx00w/h8BRQ3b2LWSKxp1imsiPYf6JdWKFa074+3bCcE1Nwca7l1KAOPn cBEAkq5qEyM1UtlwujupC7cn/GoMMbXgSG3E1pkJbeQSFTdBuU8pFbydw6FNHVmLHG/W 8U5fT7pjsWr+2+aDEPrwJhmW9SdbSbrVeZ14hhU6RKYxUK8TMY/QbB3cPRV6sM2CWRIx 4DNMPC6QatDMctiCHWdZKzFuCymA9CehiStoLrurOJuTZb5LBb3EvYKMyJ8dfgZwT6Jz X+Hb/PoNIcQZ1/D00xHJFgvTbW0rdjpBbea74c/Rw28PYYPnbOO7gqvj2OTkc89QNwf1 R2Yw== 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=z/Tg1xYBUHCdisRFNoOsIDUWocH7Vjwkw65wtMWykNs=; b=ChC4n5ZXZ4vq8gp9vPgOJIpYJjzEZ52tsF0xH88iiXZPd6fyEfMDfhFOG41FXmDBau 9eu7zlEGuPYMv6M5RnDg9BpYp0IAziWmc3vGibcVrIq2jdT4MzvuabfmnuXyzmnnz798 Ny93Klewwwxb6Us387lDW81pPnl1zGSZ6scEmzuFalU7Wvjq4nWL+qNAo6aEJJONcThy 9S3uZtve4Hr+E8rKPMwQLj/wJmrif/mJ02xc2bAbZNSc7wEbw/rNeq6S59IAzK1/9atm A9DV1r5L5kPE62/1JhGHyLOJ6i9uWr+KDiuKXxdBWkAVnOeE8Kus09OHljsWCB0d4O7/ XDTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=MdAgQmG2; 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=QUARANTINE 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 aq2si1532361ejc.214.2021.06.17.05.34.01; Thu, 17 Jun 2021 05:34:23 -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=MdAgQmG2; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231598AbhFQKMw (ORCPT + 99 others); Thu, 17 Jun 2021 06:12:52 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:36102 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231260AbhFQKMv (ORCPT ); Thu, 17 Jun 2021 06:12:51 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9A94F21AF4; Thu, 17 Jun 2021 10:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1623924643; 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=z/Tg1xYBUHCdisRFNoOsIDUWocH7Vjwkw65wtMWykNs=; b=MdAgQmG2FQlzMntzs+JY+z9cSccKoS833Mmtp16XSq4G1WDQIqnIom+rDuld9wyF0FhOvD AUdG2yIAmb2eDyHFNxw7asy/Yxq8Dky/D1t7oX6+A5YBix78WUsi0DI3wutUgdOgnS7o+q StFkhhD6e7zqO+BqGV9L+GLrJR08aho= Received: from suse.cz (unknown [10.100.224.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 7772DA3BB8; Thu, 17 Jun 2021 10:10:43 +0000 (UTC) Date: Thu, 17 Jun 2021 12:10:43 +0200 From: Petr Mladek To: Chris Down Cc: linux-kernel@vger.kernel.org, Jessica Yu , 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 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Best Regards, Petr