Skip to content

Commit

Permalink
core: rpmb: __weak access implementation selectable at build time
Browse files Browse the repository at this point in the history
Avoid having to patch the source code to prevent accessing RPMB by
mistake.

Signed-off-by: Jorge Ramirez-Ortiz <[email protected]>
  • Loading branch information
ldts committed May 9, 2022
1 parent 2e1b85f commit 54943dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/tee/tee_rpmb_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3081,5 +3081,8 @@ TEE_Result tee_rpmb_fs_raw_open(const char *fname, bool create,

bool __weak plat_rpmb_key_is_ready(void)
{
return true;
if (IS_ENABLED(CFG_RPMP_IS_READY_WEAK))
return true;

return false;
}
5 changes: 5 additions & 0 deletions mk/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ CFG_REE_FS ?= y
# RPMB file system support
CFG_RPMB_FS ?= n

# RPMB ready weak implementation allows RPMB access by default
ifeq ($(CFG_RPMB_FS),y)
CFG_RPMB_IS_READY_WEAK ?= y
endif

# Device identifier used when CFG_RPMB_FS = y.
# The exact meaning of this value is platform-dependent. On Linux, the
# tee-supplicant process will open /dev/mmcblk<id>rpmb
Expand Down

0 comments on commit 54943dd

Please sign in to comment.