[PATCH v5 0/1] ipe: add errno field to IPE policy load auditing

Jasjiv Singh
2025-03-13T21:51:09Z

Hello,

When deployment of a new IPE policy fails, there is no audit trail.
The failure is written to stderr, but not to the system log. So,
users of IPE require a way to identify when and why an operation fails,
allowing them to both respond to violations of policy and be notified
of potentially malicious actions on their systems with respect to IPE.

Previous Postings
-----------------
v4: https://lore.kernel.org/linux-security-module/1741385035-22090-2-git-send-email-jasjivsingh@linux.microsoft.com/
v3: https://lore.kernel.org/linux-security-module/1740784265-19829-1-git-send-email-jasjivsingh@linux.microsoft.com/
v2: https://lore.kernel.org/linux-security-module/1740696377-3986-1-git-send-email-jasjivsingh@linux.microsoft.com/
v1: https://lore.kernel.org/linux-security-module/1739569319-22015-1-git-send-email-jasjivsingh@linux.microsoft.com/

Changelog
---------

v5:
* changed audit log format from AUDIT_POLICY_LOAD_FAIL_FMT to
AUDIT_POLICY_LOAD_NULL_FMT.
* added success case in IPE policy errno documentation.
* removed unnecessary errno documentation in new_policy(),
update_policy(), ipe_new_policy() and ipe_update_policy().
* merged success and failed case together in new_policy() for easy
maintenance.

v4:
* added a seperate errno table to IPE AUDIT_IPE_POLICY_LOAD documentation.
* fixed error code handling that happens when memdup_user_nul is called
in new_policy() and update_policy().
* added additional errno documentation to new_policy(), update_policy(),
ipe_new_policy() and ipe_update_policy().
* added ENOKEY and EKEYREJECTED to IPE errno table documentation.

v3:
* used ERR_PTR(rc) directly rather than assigning to struct ipe_policy.
* removed unnecessary var from update_policy().
* removed unnecessary error handling from update_policy().

v2:
* added additional IPE audit log information to commit to show the errno case.
* changed log format from AUDIT_POLICY_LOAD_NULL_FMT to
AUDIT_POLICY_LOAD_FAIL_FMT.
* removed unnecessary res var from ipe_audit_policy_load().
* handled security fs failure case in new_policy() and update_policy().
* handled insufficent failure case in new_policy() and update_policy().

Jasjiv Singh (1):
ipe: add errno field to IPE policy load auditing

Documentation/admin-guide/LSM/ipe.rst | 69 +++++++++++++++++++--------
security/ipe/audit.c | 19 ++++++--
security/ipe/fs.c | 25 ++++++----
security/ipe/policy.c | 17 ++++---
security/ipe/policy_fs.c | 28 ++++++++---
5 files changed, 113 insertions(+), 45 deletions(-)

--
2.34.1