mirror of
https://github.com/torvalds/linux.git
synced 2026-09-11 02:48:03 +02:00
integrity-v7.3-rc2
-----BEGIN PGP SIGNATURE----- iIoEABYKADIWIQQdXVVFGN5XqKr1Hj7LwZzRsCrn5QUCapsP/BQcem9oYXJAbGlu dXguaWJtLmNvbQAKCRDLwZzRsCrn5b2gAQC3ms2HRoZolscMWqnUNoi5SmPpwcV2 v/ojwDc1TnS9HAEA/604QYihEvRQzKQwEyF6W6b83w22tyWKhDW1a0d7KQ4= =/Hd6 -----END PGP SIGNATURE----- Merge tag 'integrity-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull IMA fixes from Mimi Zohar: - Instantiating the ima_file_truncate and ima_path_truncate LSM hooks resulted in configfs locking issues. configfs files should not be measured, appraised, or audited in the first place, so the builtin policies are updated to exclude them. - IMA audit messages include the filename, which could result in a page fault when the filename doesn't exist - Un-hide the IMA_MEASURE_PCR_IDX Kconfig prompt * tag 'integrity-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: allow users to specify the pcr index with IMA_MEASURE_PCR_IDX ima: Check for ERR_PTR from dentry_path() in validate_hash_algo() ima: don't measure/appraise files on configfs configfs: move CONFIGFS_MAGIC definition to magic.h
This commit is contained in:
commit
4d7d9486c0
|
|
@ -108,6 +108,9 @@ Description:
|
|||
# NSFS_MAGIC
|
||||
dont_measure fsmagic=0x6e736673
|
||||
dont_appraise fsmagic=0x6e736673
|
||||
# CONFIGFS_MAGIC
|
||||
dont_measure fsmagic=0x62656570
|
||||
dont_appraise fsmagic=0x62656570
|
||||
|
||||
measure func=BPRM_CHECK
|
||||
measure func=FILE_MMAP mask=MAY_EXEC
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/magic.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/fs_context.h>
|
||||
|
|
@ -19,9 +20,6 @@
|
|||
#include <linux/configfs.h>
|
||||
#include "configfs_internal.h"
|
||||
|
||||
/* Random magic number */
|
||||
#define CONFIGFS_MAGIC 0x62656570
|
||||
|
||||
static struct vfsmount *configfs_mount = NULL;
|
||||
struct kmem_cache *configfs_dir_cachep;
|
||||
static int configfs_mnt_count = 0;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#define AUTOFS_SUPER_MAGIC 0x0187
|
||||
#define CEPH_SUPER_MAGIC 0x00c36400
|
||||
#define CODA_SUPER_MAGIC 0x73757245
|
||||
#define CONFIGFS_MAGIC 0x62656570 /* some random number */
|
||||
#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
|
||||
#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
|
||||
#define DEBUGFS_MAGIC 0x64626720
|
||||
|
|
|
|||
|
|
@ -46,12 +46,16 @@ config IMA_KEXEC
|
|||
|
||||
config IMA_MEASURE_PCR_IDX
|
||||
int
|
||||
prompt "PCR Index for Aggregate" if EXPERT
|
||||
range 8 14
|
||||
default 10
|
||||
help
|
||||
IMA_MEASURE_PCR_IDX determines the TPM PCR register index
|
||||
that IMA uses to maintain the integrity aggregate of the
|
||||
measurement list. If unsure, use the default 10.
|
||||
measurement list. Most attestation tooling expects PCR 10.
|
||||
|
||||
The default is almost always what you want. Only change this
|
||||
if you know what you are doing.
|
||||
|
||||
config IMA_LSM_RULES
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -748,6 +748,8 @@ static int validate_hash_algo(struct dentry *dentry,
|
|||
return -EACCES;
|
||||
|
||||
path = dentry_path(dentry, pathbuf, PATH_MAX);
|
||||
if (IS_ERR(path))
|
||||
path = NULL;
|
||||
|
||||
integrity_audit_msg(AUDIT_INTEGRITY_DATA, d_inode(dentry), path,
|
||||
"set_data", errmsg, -EACCES, 0);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,10 @@ static struct ima_rule_entry dont_measure_rules[] __ro_after_init = {
|
|||
{.action = DONT_MEASURE, .fsmagic = CGROUP2_SUPER_MAGIC,
|
||||
.flags = IMA_FSMAGIC},
|
||||
{.action = DONT_MEASURE, .fsmagic = NSFS_MAGIC, .flags = IMA_FSMAGIC},
|
||||
{.action = DONT_MEASURE, .fsmagic = EFIVARFS_MAGIC, .flags = IMA_FSMAGIC}
|
||||
{.action = DONT_MEASURE, .fsmagic = EFIVARFS_MAGIC,
|
||||
.flags = IMA_FSMAGIC},
|
||||
{.action = DONT_MEASURE, .fsmagic = CONFIGFS_MAGIC,
|
||||
.flags = IMA_FSMAGIC}
|
||||
};
|
||||
|
||||
static struct ima_rule_entry original_measurement_rules[] __ro_after_init = {
|
||||
|
|
@ -211,6 +214,8 @@ static struct ima_rule_entry default_appraise_rules[] __ro_after_init = {
|
|||
{.action = DONT_APPRAISE, .fsmagic = EFIVARFS_MAGIC, .flags = IMA_FSMAGIC},
|
||||
{.action = DONT_APPRAISE, .fsmagic = CGROUP_SUPER_MAGIC, .flags = IMA_FSMAGIC},
|
||||
{.action = DONT_APPRAISE, .fsmagic = CGROUP2_SUPER_MAGIC, .flags = IMA_FSMAGIC},
|
||||
{.action = DONT_APPRAISE, .fsmagic = CONFIGFS_MAGIC,
|
||||
.flags = IMA_FSMAGIC},
|
||||
#ifdef CONFIG_IMA_WRITE_POLICY
|
||||
{.action = APPRAISE, .func = POLICY_CHECK,
|
||||
.flags = IMA_FUNC | IMA_DIGSIG_REQUIRED},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user