HomeFreeBSD

EFI RT: resurrect EFIIOC_GET_TABLE

Description

EFI RT: resurrect EFIIOC_GET_TABLE

Make it work, but change the interface to be safe for non-root users. In
particular, right now interface only works for the tables which can be
minimally parsed by kernel to determine the table size. Then, userspace can
query the table size, after that it provides a buffer of needed size
and kernel copies out just table to userspace.

Main advantage is that user no longer need to be able to read /dev/mem,
the disadvantage is the need to have minimal parsers aware of the table
types. Right now the parsers are implemented for ESRT and PROP tables.

Future extension of the present interface might be a return of only
the table physical address, in case kernel does not have suitable
parser yet. Then, a privileged user could read the table from /dev/mem.
This extension, which logically equivalent to the old (non-worked)
EFIIOC_GET_TABLE variant, is not implemented until needed.

Submitted by: Pavel Balaev <pavel.balaev@3mdeb.com>
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D30104

Details

Provenance
pavel.balaev_3mdeb.comAuthored on Jul 1 2021, 4:27 PM
kibCommitted on Jul 3 2021, 5:06 PM
Differential Revision
D30104: efirt: add ESRT table support
Parents
rG2f514e6f13de: linux(4): implement PR_SET_NO_NEW_PRIVS
Branches
Unknown
Tags
Unknown