Before
dfcccc6631 "efi: use directmap to access runtime services table"
all usages of efi_rs pointer were guarded by efi_rs_enter(), which
implicitly refused to operate with efi=no-rs (by checking if
efi_l4_pgtable is NULL - which is the case for efi=no-rs). The said
commit (re)moved that call as unneeded for just reading content of
efi_rs structure - to avoid unnecessary page tables switch. But it
neglected to check if efi_rs access is legal.
Fix this by adding explicit check for runtime service being enabled in
the cases that do not use efi_rs_enter().
Reported-by: Roman Shaposhnik <roman@zededa.com>
Fixes: dfcccc6631 "efi: use directmap to access runtime services table"
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
break;
case XEN_FW_EFI_RT_VERSION:
{
+ if ( !efi_enabled(EFI_RS) )
+ return -EOPNOTSUPP;
info->version = efi_rs->Hdr.Revision;
break;
}
break;
}
- if ( (efi_rs->Hdr.Revision >> 16) < 2 )
+ if ( !efi_enabled(EFI_RS) || (efi_rs->Hdr.Revision >> 16) < 2 )
return -EOPNOTSUPP;
state = efi_rs_enter();
if ( !state.cr3 )
if ( op->misc )
return -EINVAL;
- if ( (efi_rs->Hdr.Revision >> 16) < 2 )
+ if ( !efi_enabled(EFI_RS) || (efi_rs->Hdr.Revision >> 16) < 2 )
return -EOPNOTSUPP;
/* XXX fall through for now */
default: