Add missing owner check to bpf loader close ix (#19460)

This commit is contained in:
Justin Starry 2021-08-27 08:44:38 -07:00 committed by GitHub
parent 5cf8730b87
commit 4305d4b7b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -692,6 +692,10 @@ fn process_loader_upgradeable_instruction(
ic_logger_msg!(logger, "Program account is not writable");
return Err(InstructionError::InvalidArgument);
}
if &program_account.owner()? != program_id {
ic_logger_msg!(logger, "Program account not owned by loader");
return Err(InstructionError::IncorrectProgramId);
}
match program_account.state()? {
UpgradeableLoaderState::Program {