From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796338169; b=bTfDrq0Bi87jFEv+s4//twes0U+S+JogDQUHm9JCwKZTdQSuiCfNP/WQf1QyLrp9sLhM NuEb2P7wRsIqiyIWitckKQyftG0RVDmNzor/u27msRmz5ZiI+Cq2WHKpbdu/F4maDNXR0 egt8i53jBr2GQyGphaZtIOXQgIjck/BTn6cTxu8ET9DWuyW1Y5T8DFJy2PCfpn/A4Pf/z 71gAX0K+WZqvIlEq8BvUMKOxl5wyfo/8p52/u/4d/N6k9FawuOA3Y6O5lHKXrTiSYRlry 753lkZnPRTJUxXBHSs6yAREgHVooMZbfg5F5oQ5JOCEVtcyKuSW5gKemaLC2l44dy6A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796338169; h=DMARC-Filter:From:DKIM-Signature:DKIM-Signature:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=2TzMPXj5VKye5zHbOrGTnyUJzXfbZbNHX/7DijtST2s=; b=tVcuGO7dA4NZUn25Q6UBQFXaw2WqvrEe6/AoXvCCIWqpDiNApGFRFgKDrvXoIV1SS9kx xBCEWwWcDBCwD1uyeChx9UrTkZZ7RNbXe06/31QrNPaG6eJQ4qa13fn4ee1swCwoHeuRJ blNymIkL+P5XD+KW6m4rfygVVlRo6wi4ebpe0qyZyEUqqF9wa7o8D4Pi6k7+2z6YdgqTe ceO1bXmKUbxyzMsN1lI/Eqmdo3UxBmtjRVGwvct7MucXTZ08q5F0KKyTjzuYCO0g6HsTu 2ErhkMcoZKzEcSV+MrxjnEcdqWxycS5VhL6uuZTmEs5xEHHHgnVVFckfDKMBBbHC4nA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=wMdp53hR; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=ePOkpEdL; arc=none smtp.remote-ip=193.142.43.55 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EDF5606A32F; Thu, 3 Dec 2026 22:49:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4EDF5606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=wMdp53hR; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=ePOkpEdL From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1796338167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2TzMPXj5VKye5zHbOrGTnyUJzXfbZbNHX/7DijtST2s=; b=wMdp53hRREwrURnHbpItEAjd0eui4MhJbMcocJ9o6munddNS4PWBJVNcGdSPuLwePQajUc FwIGGb2X2+fo0qazN3DtAOhO6oGvJBTCdweq4g2SUR+jVwHgjb+AN79hq4fukllc9KX5D9 6v7619oBX28tBjd9J9LIbgcrtE8XdPkHXZ8KMsx4p7Wecok+tLiCpzULNbBRoMr3rObQeq OE3azd0HZwPt/yVExwY0w3SktU3QIMV63O0Xtgo1sHil1cxVAgaFHTknvsCPfPqVtOrjtu S4mw7ycNX2VYw+Ox9MeiqN4S4rYFuHP0nBaPaSNq8Tt5m9GnodOLe6alUMrdGg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1796338167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2TzMPXj5VKye5zHbOrGTnyUJzXfbZbNHX/7DijtST2s=; b=ePOkpEdLa7FV/jegXiydBUxbdfCIs4wdmLucvMOUAjSsYG2RtqUZk+P88JjXn1AUJDq/eR liUBhqeMosjOdGCQ== To: Nathan Chancellor , Nicolas Schier , Julian Braha , Emanuele Rocca , Clark Williams , Steven Rostedt , Ingo Molnar Cc: Sebastian Andrzej Siewior , Frederic Weisbecker , John Ogness , Derek Barbosa , =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= , Daan De Meyer , Luca Boccassi , linux-rt-devel@lists.linux.dev, debian-kernel@lists.debian.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Ahmed S. Darwish" Subject: [PATCH v2 01/11] kconfig-audit: Add schema for policy files Date: Thu, 3 Dec 2026 23:49:02 +0100 Message-ID: <20261203224916.118064-2-darwi@linutronix.de> In-Reply-To: <20261203224916.118064-1-darwi@linutronix.de> References: <20261203224916.118064-1-darwi@linutronix.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit kconfig-audit validates the passed kernel's .config against a selected configuration policy. Define the YAML schema for kconfig-audit policy files, and document the purpose of each field. Signed-off-by: Ahmed S. Darwish --- tools/kconfig-audit/schema/policy-v1.yml | 139 +++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 tools/kconfig-audit/schema/policy-v1.yml diff --git a/tools/kconfig-audit/schema/policy-v1.yml b/tools/kconfig-audit/schema/policy-v1.yml new file mode 100644 index 000000000000..10672226415b --- /dev/null +++ b/tools/kconfig-audit/schema/policy-v1.yml @@ -0,0 +1,139 @@ +# SPDX-License-Identifier: GPL-2.0-only + +"$schema": "https://json-schema.org/draft-07/schema#" + +title: kconfig-audit policy schema +type: object +required: [api_version, kind, rules] +additionalProperties: false + +properties: + api_version: + type: string + const: kconfig-audit.kernel.org/v1 + + kind: + type: string + const: Policy + + # + # Optional base URL for the documentation page used by rationale + # links. See `docs_hint`. + # + docs_url: + type: string + format: uri + + rules: + type: array + minItems: 1 + items: + type: object + oneOf: + - required: [name] + - required: [name_pattern] + allOf: + - if: + required: [name] + then: + not: + required: [pattern_prio] + required: [expected, severity] + additionalProperties: false + + properties: + # + # Exact kernel configuration symbol to check. + # + # Example: CONFIG_PREEMPT_RT + # + name: + type: string + pattern: '^CONFIG_[A-Z0-9_]+$' + + # + # Regex matching one or more kernel configuration symbols. + # + # Example: CONFIG_DEBUG_.* + # + name_pattern: + type: string + format: regex + + # + # Optional priority for a pattern rule. + # + # Higher numbers imply a higher priority. All pattern rules have a + # default priority of zero, so specifying a zero here is of no use. + # + pattern_prio: + type: integer + minimum: 1 + maximum: 100 + + # + # Expected value for the matching kernel configuration option. + # + # Values: + # + # enabled option is expected to be enabled (built-in or module). + # disabled option is expected to be either absent or unset. + # neutral option can be enabled or disabled. This is used to exempt + # one or more symbols from a `name_pattern` rule. + # + expected: + type: string + enum: [enabled, disabled, neutral] + + # + # Issue severity to report when the configuration rule is not met. + # + # Higher severities should be reserved for rules affecting correctness. + # + severity: + type: string + enum: [fatal, high, medium, low, info] + + # + # Optional documentation anchor for this rule. + # + # The rationale URL is built from `docs_url` plus an HTML fragment + # identifier. + # + # If `docs_hint` is set to `config`, then the HTML fragment id is + # derived from the kernel configuration symbol name: + # + # CONFIG_DRM -> #config-drm + # + # For example, with below docs_url: + # + # https://docs.kernel.org/core-api/real-time/kernel-configuration.html + # + # and the symbol entry: + # + # - name: CONFIG_DRM + # expected: disabled + # severity: info + # docs_hint: config + # + # the rationale URL becomes: + # + # https://docs.kernel.org/core-api/real-time/kernel-configuration.html#config-drm + # + # If `docs_hint` is any other string, that string is used directly as + # the HTML fragment identifier. + # + docs_hint: + type: string + anyOf: + - const: config + - pattern: '^\S+$' # URI fragments cannot have spaces + + # + # Optional human-readable explanation for the rule. + # + # This text should explain why the option is expected to have the given + # value, and may span multiple lines. + # + rationale: + type: string -- 2.56.0