From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f48.google.com (mail-dl1-f48.google.com [74.125.82.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5B70388E56 for ; Wed, 15 Apr 2026 20:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776285645; cv=none; b=aKBeMXJNNZs+wRJIg/JCH9mx1AbX2nenyx1eKozXkJaznPjJmuCQOjIq2dRk0wADR6hDhl4HNjPE5IRuxTzJ2PdAq8VVKTYdQV3w8M2DCIgJkrQ6ph/ju8Q8GXJP683fpEac4RvMTa1ny9ZxIujEmioEPiJhlIDzXCil8qbPQYU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776285645; c=relaxed/simple; bh=PL+CgPqPyNnjf7gBFemSf1QF6zWNuC2OalLgIdp7xuw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=JOwvieFW8riqhec1t5uSSvLpGVd4mEPFEIrJLVcFAZAaCeyawnoc0TY3pycf23T08Vemula9kuISXED3YjciFKC8y0NU0wIWY8alJhbUj6o6FlCta8RQuVmebLueO1XBlTFhUyBG8Vj26dInuPZN2X3vlFvqo3jlfIz5KlzEJMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=code406.com; spf=pass smtp.mailfrom=code406.com; dkim=pass (1024-bit key) header.d=code406.com header.i=@code406.com header.b=gp3T3WMo; arc=none smtp.client-ip=74.125.82.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=code406.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=code406.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=code406.com header.i=@code406.com header.b="gp3T3WMo" Received: by mail-dl1-f48.google.com with SMTP id a92af1059eb24-126ea4b77adso17108355c88.1 for ; Wed, 15 Apr 2026 13:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=code406.com; s=google; t=1776285643; x=1776890443; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=cbsjcA0Wtc42+WgruHSL9U8A4+1Yi6KUpTr2Kkr/Yn0=; b=gp3T3WMoIW0+sDChfN/YAbShLGV6tvdPH9qjxI5br4JR1wonXFpSVGipiNIBcgIHRF oPOsYl9690KZ5lLy9Oa+lan+tsKaGFoBoZzhXQfgkgaYbsA0au0gyskdkKEJSbTobSAg z9z3EHxbzMCer/Vfxc2NLoap+8wyVmee+wlrc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776285643; x=1776890443; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cbsjcA0Wtc42+WgruHSL9U8A4+1Yi6KUpTr2Kkr/Yn0=; b=LF6NjiA1ZQrb2z8acaX+oovGvhBrA5OBrxWQSfVlLyK2OlQzlPCKETCnY3bBqvKwuF e/kxxyYNxQjFS9q47pEqQ06dd043iA+IRmcKKeGa9ZR0Z4ZC8AMWb9elMB6TqRD/j1wn 2IeJq3zRKNTMk9VyiCXF3OXIjqfClxaDCqtZ32Vpcn+sATjX0N0nvWfYwelLWnD5EJOU 8IcQbX6slaQOXMW516yGqZrY0LWTegHG78S1zYQlJTAoOI+DdvdPdBluciSjb08a7Tiz iZxcWcOrUvZle/gk/Xz4aHTKC0LOi0TuBHMtaT5Yiap3cscVySUY2cQuDLdMu8r9BL2b yJQg== X-Forwarded-Encrypted: i=1; AFNElJ8LFhAG351pKdZCQmdB5aNe3Y6L19I1FjTNAkM4J2f6qbPrtXyQFipVJqAoj+zyukDkYVHdF295EkAJzwE=@vger.kernel.org X-Gm-Message-State: AOJu0YwxiR0JI6vXwddTteUuksFHeg0Q6zy4cVuUC7csLRTQAAZ0uptL wHbWTvU/DMn+G+0Nc6+tF9Btm+65U4r2ThkC4EdMnPFdSwc1Wv1BLJTrDd8DZYT8lw== X-Gm-Gg: AeBDieuA3biQNuJbvd3Q8OF11Mu8sXuNDN+m6jfBumkgepHXOyJfYGbSvVfvdpcT9T7 5+5lK5dacm/qJD0RgUSrQ7f9NOhjAleBSAKOaWpoUIBJBTjasXP1Hlea63Jf179PjPKOIvnBFaq cOID3lmF0Ny2sIg+Tk6mnTAdwnJtGx5Imv2WLHu4UK4OILZHvQXQ9ZmLSlHvaXK/Gsg+JAP1Pr5 Q71o6LoKR0E4oyTsbXe7i2VPaQ9CKOBggETtsunkFARlLrfDkhUUYZmCtNXLO08FeEMT2j4y6zM w3+jzNMyQ7vEfHfRrjTEFJf8S9CUDd10SwV/VTKgNfpdLgML+7CkLgZVShV6K0nzllOZmfDtlmp kQwtGAIyJoTD01CFAd72m4UicCzoTk0taj52ZWmebdPMs1KvMUT0QIamwORPlrFetEou/ire2zS LbwX1Tw4HCO1vipmkKkhjLwOyoF0BR0EwAVEmDk90+6REjeY8IUlgP25yTxR3QNDdWrWA2oQLhl uGtr9Xz2WlWFBudAMgtF3Zzp3g/UQCKUheDntc/RoZj X-Received: by 2002:a05:7022:fa04:b0:12b:ebb9:1c0b with SMTP id a92af1059eb24-12c34ef8f1cmr13538669c88.31.1776285642621; Wed, 15 Apr 2026 13:40:42 -0700 (PDT) Received: from localhost ([2601:645:8a00:6e44:a6e4:945f:db92:a0c3]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2de8c606222sm5403860eec.8.2026.04.15.13.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2026 13:40:42 -0700 (PDT) From: Josh Snyder Date: Wed, 15 Apr 2026 13:40:40 -0700 Subject: [PATCH v2] trusted-keys: move pr_fmt out of trusted-type.h Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260415-trusted-key-header-v2-1-5244f9ef0d09@code406.com> X-B4-Tracking: v=1; b=H4sIAMf332kC/32NQQ6CMBBFr0Jm7Zi2GTS48h6GRekMUo3UtIVIC HcXcO/yJe+/P0OS6CXBpZghyuiTD/0K5lCA62x/F/S8MhhlToq0xhyHlIXxKRN2Ylki2pLIUqu pYgPr8B2l9Z89eqt/nIbmIS5vpc3ofMohTvvrqDfv78GoUSOpszOOq5K4ubrAQup0dOEF9bIsX 2Pd7C7IAAAA X-Change-ID: 20260411-trusted-key-header-a544a4f149d2 To: James Bottomley , Jarkko Sakkinen , Mimi Zohar , David Howells , Ahmad Fatoum , Pengutronix Kernel Team , Paul Moore , James Morris , "Serge E. Hallyn" , David Gstir , sigma star Kernel Team , Srish Srinivasan , Nayna Jain , Sumit Garg Cc: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Josh Snyder X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776285641; l=4657; i=josh@code406.com; s=20260402; h=from:subject:message-id; bh=PL+CgPqPyNnjf7gBFemSf1QF6zWNuC2OalLgIdp7xuw=; b=6UB4xFpTx/1kQsSZ4hXcjkipxPZWe750cz4gLWaMxo1QghaHejOqrj6z1FeMcxvqCjoV8jdM1 DVFq/0lBw+HC+C78H9vJXgAR49Hdf27J9eWM2z2/kiJVEQBgrTcJXKV X-Developer-Key: i=josh@code406.com; a=ed25519; pk=J60jemVD5rPt9HnGvw/AAQ6RPciMTW8aAgWykCCnCXg= Defining pr_fmt in a widely-included header leaks the "trusted_key: " prefix into every translation unit that transitively includes . dm-crypt, for example, ends up printing trusted_key: device-mapper: crypt: dm-10: INTEGRITY AEAD ERROR ... dm-crypt began including in commit 363880c4eb36 ("dm crypt: support using trusted keys"), which predates the pr_fmt addition, so the regression has been live from the moment the header gained its own pr_fmt definition. Move the pr_fmt definition into the trusted-keys source files that actually want the prefix, with specific prefixes for each key type. Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework") Assisted-by: Claude:claude-opus-4-6 Signed-off-by: Josh Snyder --- Changes in v2: - specific pr_fmt based on trusted key type --- include/keys/trusted-type.h | 6 ------ security/keys/trusted-keys/trusted_caam.c | 2 ++ security/keys/trusted-keys/trusted_core.c | 2 ++ security/keys/trusted-keys/trusted_dcp.c | 2 ++ security/keys/trusted-keys/trusted_pkwm.c | 2 ++ security/keys/trusted-keys/trusted_tpm1.c | 2 ++ security/keys/trusted-keys/trusted_tpm2.c | 2 ++ 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/keys/trusted-type.h b/include/keys/trusted-type.h index 03527162613f7..54da1f174aeab 100644 --- a/include/keys/trusted-type.h +++ b/include/keys/trusted-type.h @@ -11,12 +11,6 @@ #include #include -#ifdef pr_fmt -#undef pr_fmt -#endif - -#define pr_fmt(fmt) "trusted_key: " fmt - #define MIN_KEY_SIZE 32 #define MAX_KEY_SIZE 128 #if IS_ENABLED(CONFIG_TRUSTED_KEYS_PKWM) diff --git a/security/keys/trusted-keys/trusted_caam.c b/security/keys/trusted-keys/trusted_caam.c index 601943ce0d60f..71c173bb2f727 100644 --- a/security/keys/trusted-keys/trusted_caam.c +++ b/security/keys/trusted-keys/trusted_caam.c @@ -4,6 +4,8 @@ * Copyright 2025 NXP */ +#define pr_fmt(fmt) "trusted_key: caam: " fmt + #include #include #include diff --git a/security/keys/trusted-keys/trusted_core.c b/security/keys/trusted-keys/trusted_core.c index 0b142d941cd2e..159af9dcfc774 100644 --- a/security/keys/trusted-keys/trusted_core.c +++ b/security/keys/trusted-keys/trusted_core.c @@ -6,6 +6,8 @@ * See Documentation/security/keys/trusted-encrypted.rst */ +#define pr_fmt(fmt) "trusted_key: " fmt + #include #include #include diff --git a/security/keys/trusted-keys/trusted_dcp.c b/security/keys/trusted-keys/trusted_dcp.c index 7b6eb655df0cb..41a23e2f30891 100644 --- a/security/keys/trusted-keys/trusted_dcp.c +++ b/security/keys/trusted-keys/trusted_dcp.c @@ -3,6 +3,8 @@ * Copyright (C) 2021 sigma star gmbh */ +#define pr_fmt(fmt) "trusted_key: dcp: " fmt + #include #include #include diff --git a/security/keys/trusted-keys/trusted_pkwm.c b/security/keys/trusted-keys/trusted_pkwm.c index bf42c6679245a..108db105b639f 100644 --- a/security/keys/trusted-keys/trusted_pkwm.c +++ b/security/keys/trusted-keys/trusted_pkwm.c @@ -3,6 +3,8 @@ * Copyright (C) 2025 IBM Corporation, Srish Srinivasan */ +#define pr_fmt(fmt) "trusted_key: pwkm: " fmt + #include #include #include diff --git a/security/keys/trusted-keys/trusted_tpm1.c b/security/keys/trusted-keys/trusted_tpm1.c index 6ea728f1eae6f..207be849796ed 100644 --- a/security/keys/trusted-keys/trusted_tpm1.c +++ b/security/keys/trusted-keys/trusted_tpm1.c @@ -6,6 +6,8 @@ * See Documentation/security/keys/trusted-encrypted.rst */ +#define pr_fmt(fmt) "trusted_key: tpm1: " fmt + #include #include #include diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/security/keys/trusted-keys/trusted_tpm2.c index 6340823f8b53c..2a540b1af0b33 100644 --- a/security/keys/trusted-keys/trusted_tpm2.c +++ b/security/keys/trusted-keys/trusted_tpm2.c @@ -4,6 +4,8 @@ * Copyright (C) 2014 Intel Corporation */ +#define pr_fmt(fmt) "trusted_key: tpm2: " fmt + #include #include #include --- base-commit: 66672af7a095d89f082c5327f3b15bc2f93d558e change-id: 20260411-trusted-key-header-a544a4f149d2 Best regards, -- Josh