[PATCH v7 3/5] virt: Add efi_secret module to expose confidential computing secrets

Dov Murik dovmurik at linux.ibm.com
Wed Feb 2 10:55:10 UTC 2022



On 02/02/2022 10:45, Gerd Hoffmann wrote:
>   Hi,
> 
>> +	s->coco_dir = NULL;
>> +	s->fs_dir = NULL;
>> +	memset(s->fs_files, 0, sizeof(s->fs_files));
>> +
>> +	dent = securityfs_create_dir("coco", NULL);
>> +	if (IS_ERR(dent)) {
>> +		pr_err("Error creating coco securityfs directory entry err=%ld\n", PTR_ERR(dent));
>> +		return PTR_ERR(dent);
>> +	}
>> +	s->coco_dir = dent;
>> +
>> +	dent = securityfs_create_dir("efi_secret", s->coco_dir);
>> +	if (IS_ERR(dent)) {
>> +		pr_err("Error creating efi_secret securityfs directory entry err=%ld\n",
>> +		       PTR_ERR(dent));
>> +		return PTR_ERR(dent);
>> +	}
>> +	d_inode(dent)->i_op = &efi_secret_dir_inode_operations;
>> +	s->fs_dir = dent;
> 
> Why have two levels of subdirectories here?  Do we expect more users for
> the coco/ directory?
> 

In the RFCv2 of this series Borislav Petkov suggested [1] adding a
"coco/" directory (originally it was "<securityfs>/sev_secret"); he
envisioned that other coco platforms (SNP, TDX) might want to expose
something to userspace via filesystem.

[1] https://lore.kernel.org/linux-coco/YNoiydeow+ftvfYX@zn.tnic/



> See also the naming discussion in the cover letter sub-thread.

Yep, following.



Thanks,
Dov



More information about the Linux-security-module-archive mailing list