問題タブ [trust-zone]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
gcc - `cmse_check_address_range` changes behaviour with compiler upgrade
I'm using a Cortex-M33 with arm trust-zone. I have a secure api inside my secure firmware that I can call from my non-secure firmware. All works as expected - at least until I upgraded my compiler from gcc-arm-none-eabi-7-2018-q2-update
to gcc-arm-none-eabi-10-2020-q4-major
.
The function in question looks like this:
I make sure the supplied pointer really is in non-secure space by using cmse_check_address_range
. That works for the version 7, but if I compile the code with version 10, NULL
is returned. I did not change anything in the source or any other part, just the compiler.
I checked for any changes in that function, but even https://github.com/gcc-mirror/gcc/commits/master/libgcc/config/arm/cmse.c
does not show any changes whatsoever.
Did anything change? Maybe I'm using the function not as intended (do I need different flags for functions? But then again, it works with version 7.
Update:
- I also posted this in arm embedded toolchain forum: https://answers.launchpad.net/gcc-arm-embedded/+question/695596
- @HsuHau https://stackoverflow.com/a/66273629/1358283 posted a bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157
linux - ioremap、アドレス、および TrustZone との関係
TrustZone アドレスを完全に理解しているかどうかわからない問題があります。私が知っているように、すべてのカーネルには、ハードウェアに記述されたデバイス ツリー構成が付属しています。TrustZone システムでは、ns (非セキュア) カーネルに dt (デバイス ツリー) が付属しており、「DMA ヒープ」への構成が含まれています。DMA ヒープは、カーネルが TrustZone カーネルと通信するための「共有バッファ」として使用されます。これは、SMC ハンドラの実装に依存します。一般に、TrustZone カーネルは「セキュア メモリ」(セキュア ワールド) で実行され、他の「ワールド」ns カーネルは ns メモリ (非セキュア ワールド) で実行されます。これは、物理バス トランザクションで特別な NS ビットを実装することにより、アーキテクチャに適用されます。
ノードタイプ「メモリ範囲」を指すdtファイルで定義されたほとんどのヒープ。メモリ範囲ノード アドレスを変更すると、セキュア アドレスにマッピングされますか?
よくわかりませんが、kmallocを実行してTrustZoneセキュアメモリにマッピングすることは可能ですか?
ioremap 機能によると:
ioremap() 関数は、I/O デバイスの物理アドレスをカーネル仮想アドレスにマップするために使用されます。カーネルはページ テーブルを作成します。つまり、要求された物理アドレスへの仮想アドレスのマッピングです。ioremap() を実行すると、このマッピングは破棄されます。
セキュア メモリを ns カーネルにマッピングすることは可能ですか?
- 私が知っているように、SMMU は、VA -> IPA -> PA または VA -> PA (変換テーブル上) の間のマッピングを担当します。これは、ページ テーブルの 2 つのフェーズによって行われます。フェーズ 1 は ns カーネルによって実行され、フェーズ 2 はハイパーバイザーによって実行されます。安全なアドレスへのマッピングのプロセスはどのように機能しますか? ioremap() を実行した後、ページ テーブル フェーズ 2 でマッピングを実行するようにハイパーバイザーに指示するのは誰ですか?
ありがとう、
android - trustzone サービスを使用するアプリケーション
trustzone サービスを使用するアプリケーションについて知っている人はいますか? アプリケーションの名前は何ですか? サービス アプリケーションは何を使用しますか?
例: 「Signal」アプリケーションはキーストア サービスを使用して、メッセージ暗号化用のキーを安全に保存します。
ありがとう