From nobody Sat Nov 30 10:49:06 2024 Received: from sonic305-27.consmr.mail.ne1.yahoo.com (sonic305-27.consmr.mail.ne1.yahoo.com [66.163.185.153]) (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 437B21755C for ; Tue, 10 Sep 2024 18:53:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.163.185.153 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725994403; cv=none; b=K87AF5Lca5MQJDjMrZdry11alLqJMt49HVLp+II4utFlD+sPe2THcSfS2bJA02jGuCd8f40DQBDuMiTLRXvVwSzGeXGurS+0LNEkAoWkETOaC1uZJdya8gYe4MHRP8uMTKoSfXFedxJ2/CmKML5QRHx7CvRckYUMDE0b60onhLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725994403; c=relaxed/simple; bh=O1e6CxiQWsxzIs5u1fUQ5DgKXDjgs0NeAacNWiPIWIc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nK08/KlFHBmd4uifzYz4QxUdZq7kMpLI3yQdgVcTwXa7ezSydpwwcc9dUjPRMlUBIByvGKY/iGvalkp9N4z0myghc6S0RGUq4uEWdJZMLl+SEP5s808ZDMwM55gxYKIcWBrVB2IMNwq5lCYXM2gfWFq0og72LdKhuG1EZxC4YSg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.com; spf=none smtp.mailfrom=schaufler-ca.com; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b=Lgc4XTgF; arc=none smtp.client-ip=66.163.185.153 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=schaufler-ca.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="Lgc4XTgF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1725994401; bh=QKTsziIRFsRzMH5ovaK8Q7qXH6nN4F+gv9JsbGYKPkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=Lgc4XTgFfcA0ichUpfcAP8Etvc4Zrk0OGquhuCkzNYCGWYegK6x9ZvpMf4FzgV6FE8zmTlnhin/3axX3FqKCrwh3Yr9afQQ/WoyP7+cC987lVPdAoaE9kJDDZyfS7ggexoUAs3tqQb6qu0Ys22HhsVxcgG/WVHMA9FbP8Jh1fdFK0PTH4yotcqPrMAkNjziss4B7IdE/P4NR55PUFbWbzoXhd2Wd4nca+uT4HfLx4MdmIM49NMtYyGJiaJhdfry/FnkWqEdfAowF6gaYFYg1BVccIVqy7q6JL05KHPE+iPYzinWKk4d9Usghvf7C1gYDzbmSbocpOVO+Tp1W10JlKQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1725994401; bh=l++SA9X0cOh5Ys5awvLVOq4dto7odlcKD4tLMFRYL4F=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=FTsnUvuDAFQ77OM13yV6beFu7girtutzj1WT6b4yM8JMDcxHcTrPEPILHjFltU6Vsy6BRCorDwgyO5NSZoLUFin4M4E7m9fmQ4tpyELHqvLyvTCsVnml8C6UZ+A+oeyP2Mn2zs/CfLeB7EzdGSnXJ414p/eXJbGMUN0cPXngcpjTGCCwuzsQ3EQiTDukwoDYsNGDNx/IH88h4qJmIpxftm8+V2BP2U2muuzfG6r8RlCprpZzynSb7LrIXSzUhdwdt1ld0TmyDBnxDEZVcYJKoEmbzQzOg86P2bswS8SHQgB7os+Ver3glnzJHclvoifpmS/z7ty2mwt5BI7MoakcmQ== X-YMail-OSG: tRIHen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JmQlPUuQQurCIPfeQoWue8V aT432DafhV4NGW3PGnut_HedWFkMmMMfNZ_fbhZkfwFke4CVMk_6pNIJzYUC084ZcKj2PbUhmUaY RvJjwp3EjBv7tVwAeFy8YbY9N250pHC4HpzLr7suj1mKP1Vo.rvDbVQvE3837721dq3n2gultZMN CHM.7Bc.9StRELCnOzSr6FxD44BWCnNFcaBRb X-Sonic-MF: X-Sonic-ID: c78cf519-8b4c-4ce3-a490-f15f738434dd Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Tue, 10 Sep 2024 18:53:21 +0000 Received: by hermes--production-gq1-5d95dc458-4tw7n (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID bfec55394db9c3ecf7e1196118de0a4c; Tue, 10 Sep 2024 18:43:12 +0000 (UTC) From: Casey Schaufler To: casey@schaufler-ca.com, paul@paul-moore.com, linux-security-module@vger.kernel.org Cc: jmorris@namei.org, serge@hallyn.com, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org, selinux@vger.kernel.org, mic@digikod.net Subject: [PATCH v3 06/13] Audit: Update shutdown LSM data Date: Tue, 10 Sep 2024 11:41:18 -0700 Message-ID: <20240910184125.224651-7-casey@schaufler-ca.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910184125.224651-1-casey@schaufler-ca.com> References: <20240910184125.224651-1-casey@schaufler-ca.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The audit process LSM information is changed from a secid audit_sig_sid to an lsm_prop in audit_sig_lsm. Update the users of this data appropriately. Calls to security_secid_to_secctx() are changed to use security_lsmprop_to_secctx() instead. security_current_getsecid_subj() is scaffolded. It will be updated in a subsequent patch. Signed-off-by: Casey Schaufler --- kernel/audit.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/audit.c b/kernel/audit.c index e7a62ebbf4d1..70f76fed254b 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -123,7 +123,7 @@ static u32 audit_backlog_wait_time =3D AUDIT_BACKLOG_WA= IT_TIME; /* The identity of the user shutting down the audit system. */ static kuid_t audit_sig_uid =3D INVALID_UID; static pid_t audit_sig_pid =3D -1; -static u32 audit_sig_sid; +static struct lsm_prop audit_sig_lsm; =20 /* Records can be lost in several ways: 0) [suppressed in audit_alloc] @@ -1473,20 +1473,21 @@ static int audit_receive_msg(struct sk_buff *skb, s= truct nlmsghdr *nlh, } case AUDIT_SIGNAL_INFO: len =3D 0; - if (audit_sig_sid) { - err =3D security_secid_to_secctx(audit_sig_sid, &ctx, &len); + if (lsmprop_is_set(&audit_sig_lsm)) { + err =3D security_lsmprop_to_secctx(&audit_sig_lsm, &ctx, + &len); if (err) return err; } sig_data =3D kmalloc(struct_size(sig_data, ctx, len), GFP_KERNEL); if (!sig_data) { - if (audit_sig_sid) + if (lsmprop_is_set(&audit_sig_lsm)) security_release_secctx(ctx, len); return -ENOMEM; } sig_data->uid =3D from_kuid(&init_user_ns, audit_sig_uid); sig_data->pid =3D audit_sig_pid; - if (audit_sig_sid) { + if (lsmprop_is_set(&audit_sig_lsm)) { memcpy(sig_data->ctx, ctx, len); security_release_secctx(ctx, len); } @@ -2404,7 +2405,8 @@ int audit_signal_info(int sig, struct task_struct *t) audit_sig_uid =3D auid; else audit_sig_uid =3D uid; - security_current_getsecid_subj(&audit_sig_sid); + /* scaffolding */ + security_current_getsecid_subj(&audit_sig_lsm.scaffold.secid); } =20 return audit_signal_info_syscall(t); --=20 2.46.0