mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 06:22:01 +03:00
[PXEXT] Add PXENV_FILE_EXEC call to PXE extensions API.
This allows pxelinux to execute arbitrary gPXE commands. This is remarkably unsafe (not least because some of the commands will assume full ownership of memory and do nasty things like edit the e820 map underneath the calling pxelinux), but it does allow access to the "sanboot" command.
This commit is contained in:
@@ -96,6 +96,7 @@ union pxenv_call {
|
||||
PXENV_EXIT_t ( * file_select ) ( struct s_PXENV_FILE_SELECT * );
|
||||
PXENV_EXIT_t ( * file_read ) ( struct s_PXENV_FILE_READ * );
|
||||
PXENV_EXIT_t ( * get_file_size ) ( struct s_PXENV_GET_FILE_SIZE * );
|
||||
PXENV_EXIT_t ( * file_exec ) ( struct s_PXENV_FILE_EXEC * );
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -294,6 +295,10 @@ __cdecl void pxe_api_call ( struct i386_all_regs *ix86 ) {
|
||||
pxenv_call.get_file_size = pxenv_get_file_size;
|
||||
param_len = sizeof ( pxenv_any.get_file_size );
|
||||
break;
|
||||
case PXENV_FILE_EXEC:
|
||||
pxenv_call.file_exec = pxenv_file_exec;
|
||||
param_len = sizeof ( pxenv_any.file_exec );
|
||||
break;
|
||||
default:
|
||||
DBG ( "PXENV_UNKNOWN_%hx", opcode );
|
||||
pxenv_call.unknown = pxenv_unknown;
|
||||
|
||||
Reference in New Issue
Block a user