Commit 937d96d2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull EFI updates from Ard Biesheuvel:
 "Although some more stuff is brewing, the EFI changes that are ready
  for mainline are few this cycle:

   - improve the PCI DMA paranoia logic in the EFI stub

   - some constification changes

   - add statfs support to efivarfs

   - allow user space to enumerate updatable firmware resources without
     CAP_SYS_ADMIN"

* tag 'efi-next-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi/libstub: Disable PCI DMA before grabbing the EFI memory map
  efi/esrt: Allow ESRT access without CAP_SYS_ADMIN
  efivarfs: expose used and total size
  efi: make kobj_type structure constant
  efi: x86: make kobj_type structure constant
parents 5d95ff84 2e28a798
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -114,6 +114,14 @@ void efi_delete_dummy_variable(void)
				     EFI_VARIABLE_RUNTIME_ACCESS, 0, NULL);
}

u64 efivar_reserved_space(void)
{
	if (efi_no_storage_paranoia)
		return 0;
	return EFI_MIN_RESERVE;
}
EXPORT_SYMBOL_GPL(efivar_reserved_space);

/*
 * In the nonblocking case we do not attempt to perform garbage
 * collection if we do not have enough free space. Rather, we do the
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ static void map_release(struct kobject *kobj)
	kfree(entry);
}

static struct kobj_type __refdata map_ktype = {
static const struct kobj_type __refconst map_ktype = {
	.sysfs_ops	= &map_attr_ops,
	.default_groups	= def_groups,
	.release	= map_release,
+1 −0
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@ static int generic_ops_register(void)
	generic_ops.get_variable = efi.get_variable;
	generic_ops.get_next_variable = efi.get_next_variable;
	generic_ops.query_variable_store = efi_query_variable_store;
	generic_ops.query_variable_info = efi.query_variable_info;

	if (efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE)) {
		generic_ops.set_variable = efi.set_variable;
+1 −5
Original line number Diff line number Diff line
@@ -95,10 +95,6 @@ static ssize_t esre_attr_show(struct kobject *kobj,
	struct esre_entry *entry = to_entry(kobj);
	struct esre_attribute *attr = to_attr(_attr);

	/* Don't tell normal users what firmware versions we've got... */
	if (!capable(CAP_SYS_ADMIN))
		return -EACCES;

	return attr->show(entry, buf);
}

@@ -156,7 +152,7 @@ static void esre_release(struct kobject *kobj)
	kfree(entry);
}

static struct kobj_type esre1_ktype = {
static const struct kobj_type esre1_ktype = {
	.release = esre_release,
	.sysfs_ops = &esre_attr_ops,
	.default_groups = esre1_groups,
+3 −3
Original line number Diff line number Diff line
@@ -378,6 +378,9 @@ efi_status_t efi_exit_boot_services(void *handle, void *priv,
	struct efi_boot_memmap *map;
	efi_status_t status;

	if (efi_disable_pci_dma)
		efi_pci_disable_bridge_busmaster();

	status = efi_get_memory_map(&map, true);
	if (status != EFI_SUCCESS)
		return status;
@@ -388,9 +391,6 @@ efi_status_t efi_exit_boot_services(void *handle, void *priv,
		return status;
	}

	if (efi_disable_pci_dma)
		efi_pci_disable_bridge_busmaster();

	status = efi_bs_call(exit_boot_services, handle, map->map_key);

	if (status == EFI_INVALID_PARAMETER) {
Loading