2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
MTE 부트로더 지원
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android 13에서는 요청된 MTE 모드를 부트로더에 전달할 수 있도록 사용자 공간용 ABI를 도입했습니다. 이는 하드웨어를 지원하지만 기본적으로 MTE가 사용 설정된 상태로 제공되지 않는 기기에서 MTE를 사용 설정하거나 기본적으로 MTE가 사용 설정된 상태로 제공되는 기기에서 MTE를 사용 중지하는 데 사용할 수 있습니다.
부트로더 지원
이 ABI를 지원하려면 부트로더가 misc
파티션에서 misc_memtag_message
(bootloader_message.h에 정의됨)를 읽어야 합니다.
유효한 misc_memtag_message
가 있으면(MISC_VIRTUAL_AB_MAGIC_HEADER
가 일치하고 버전 번호가 지원됨) 부트로더가 계산합니다.
memtag = (default_memtag && !(misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG_OFF)) ||
misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG ||
misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG_ONCE
memtag_kernel = misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG_KERNEL ||
misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG_KERNEL_ONCE
default_memtag
는 SKU의 기본 memtag 사용/사용 중지 설정입니다. memtag
가 true인 경우 부트로더는 MTE 태그 예약을 설정하고 하위 예외 수준에서 태그 확인을 사용 설정하며 태그 예약 영역을 DT를 통해 커널에 전달합니다. memtag
가 false인 경우 부트로더는 커널 명령줄에 arm64.nomte를 추가합니다.
memtag_kernel
이 true인 경우 부트로더는 커널 명령줄에 kasan=on
을 추가합니다. 그렇지 않으면 kasan=off
을 추가합니다.
부트로더는 부팅할 때마다 MISC_MEMTAG_MODE_MEMTAG_ONCE
및 MISC_MEMTAG_MODE_MEMTAG_KERNEL_ONCE
를 삭제해야 합니다.
부트로더가 fastboot oem mte
를 지원하면 다른 플래그를 보존하면서 MISC_MEMTAG_MODE_{MEMTAG, MEMTAG_ONLY, MEMTAG_OFF}
를 (1, 0, 0)
으로 설정하여 사용하고 (0, 0, 1)
로 설정하여 사용 중지합니다.
사용자 공간 지원을 위한 mtectrl
바이너리를 빌드하도록 제품을 구성해야 합니다. 그런 다음 부트로더가 memtag 메시지를 지원한다고 시스템에 나타내도록 ro.arm64.memtag.bootctl_supported
시스템 속성을 설정합니다.
사용자 인터페이스
ro.arm64.memtag.bootctl_supported
속성이 설정되면 개발자 옵션 메뉴의 버튼을 사용하여, MTE가 사용 설정된 상태에서 사용자가 한 번 재부팅할 수 있습니다. 타겟층은 MTE로 앱을 테스트하려는 앱 개발자입니다.
시스템 속성
고급 사용을 위해 시스템 속성 arm64.memtag.bootctl
은 다음 값의 쉼표로 구분된 목록을 사용할 수 있습니다.
-
memtag: 사용자 공간 MTE를 지속적으로 사용 설정합니다(
MISC_MEMTAG_MODE_MEMTAG
설정).
-
memtag-once: 사용자 공간 MTE를 한 번 사용 설정합니다(
MISC_MEMTAG_MODE_MEMTAG_ONCE
설정).
-
memtag-kernel: 커널 공간 MTE를 사용 설정합니다(
MISC_MEMTAG_MODE_MEMTAG_KERNEL
설정).
-
memtag-kernel-once: 커널 공간 MTE를 한 번 사용 설정합니다(
MISC_MEMTAG_MODE_MEMTAG_KERNEL_ONCE
).
-
memtag-off: MTE를 사용 중지합니다(
MISC_MEMTAG_MODE_MEMTAG_OFF
설정)
새로운 설정을 적용하려면 시스템을 재부팅해야 합니다(부트로더에서 적용함).
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-23(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-23(UTC)"],[],[],null,["# MTE bootloader support\n\nAndroid 13 introduces an ABI for user-space to communicate the requested\nMTE mode to the bootloader. This can be used to enable MTE on devices that\nhave hardware support but do not ship with MTE enabled by default, or to\ndisable MTE on devices that do ship with it.\n\nBootloader support\n------------------\n\n\nTo support this ABI, your bootloader needs to read the\n`misc_memtag_message` (defined in\n[bootloader_message.h](https://android.googlesource.com/platform/bootable/recovery/+/android16-release/bootloader_message/include/bootloader_message/bootloader_message.h)) from the `misc` partition.\nIf a valid `misc_memtag_message` is found\n(`MISC_VIRTUAL_AB_MAGIC_HEADER` matches, and the version number is supported),\nthe bootloader computes \n\n```\nmemtag = (default_memtag && !(misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG_OFF)) ||\n misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG ||\n misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG_ONCE\n\nmemtag_kernel = misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG_KERNEL ||\n misc.memtag_mode & MISC_MEMTAG_MODE_MEMTAG_KERNEL_ONCE\n```\n\n\n`default_memtag` is the default memtag on/off setting for the\nSKU. If `memtag` is true, the bootloader sets up MTE tag\nreservation, enables tag checks in the lower exception levels, and\ncommunicates the tag reserved region to the kernel via DT. If\n`memtag` is false, the bootloader appends arm64.nomte to the\nkernel command line.\n\n\nIf `memtag_kernel` is true, the bootloader appends\n`kasan=on` to the kernel command line. Otherwise, it\nappends `kasan=off`.\n\n\nBootloader **MUST** clear `MISC_MEMTAG_MODE_MEMTAG_ONCE` and\n`MISC_MEMTAG_MODE_MEMTAG_KERNEL_ONCE` on every boot.\n\n\nIf the bootloader supports `fastboot oem mte`, then on sets\n`MISC_MEMTAG_MODE_{MEMTAG, MEMTAG_ONLY, MEMTAG_OFF}` to\n`(1, 0, 0)`, and off to `(0, 0, 1)`, while\npreserving the other flags.\n\n\nYou should configure your product to build the `mtectrl` binary\nfor userspace support. Then, set the\n`ro.arm64.memtag.bootctl_supported` system property to indicate\nto the system that your bootloader supports the memtag message.\n\nUser interface\n--------------\n\nWhen the `ro.arm64.memtag.bootctl_supported` property is set, a button in the Developer Options menu allows the user to reboot once with MTE enabled. The target audience for this is app developers that want to test their apps with MTE.\n\nSystem property\n---------------\n\n\nFor advanced use, the system property\n`arm64.memtag.bootctl` can take a comma-separated list of the\nfollowing values:\n\n- **memtag:** persistenly enable user-space MTE (set `MISC_MEMTAG_MODE_MEMTAG`)\n- **memtag-once:** enable user-space MTE once (set `MISC_MEMTAG_MODE_MEMTAG_ONCE`)\n- **memtag-kernel:** enable kernel-space MTE (set `MISC_MEMTAG_MODE_MEMTAG_KERNEL`)\n- **memtag-kernel-once:** enable kernel-space MTE once (`MISC_MEMTAG_MODE_MEMTAG_KERNEL_ONCE`)\n- **memtag-off:** disable MTE (set `MISC_MEMTAG_MODE_MEMTAG_OFF`)\n\n\nThe system has to be rebooted for the new setting to take effect (as it is\napplied by the bootloader)."]]