person_detection_int8_vela_convert.sh installs Vela with the venv's seeded pip before upgrading it

オープン 初心者向け
#3,953 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, shell

調査の方向性

まず tensorflow/lite/micro/tools/make/ext_libs/person_detection_int8_vela_convert.sh を確認してください。特に、61~64行目付近のvenvのセットアップとpipのインストールを見てください。リンク先のPythonに関する説明を読み、シード済みpipの信頼ストアに依存せずに、スクリプトでpip 26.2.2以降をインストールして検証する方法を確認してください。新しいvenvがNumPyとVelaをインストールする前にpipをアップグレードし、TLS検証を有効にしていれば完了です。提案されている回帰チェックでは、古いシード済みpipでの動作を検証できます。

索引モデルが issue の本文から書いたものです。

説明

Summary

tensorflow/lite/micro/tools/make/ext_libs/person_detection_int8_vela_convert.sh creates a fresh venv and installs NumPy and Vela with the pip that python3 -m venv seeds from the interpreter's ensurepip (:61-64):

    python3 -m venv $TEMPFILE
    source $TEMPFILE/bin/activate
    pip install numpy==1.26.4 >&2
    pip install --prefer-binary ethos-u-vela >&2

pip loads its vendored certifi bundle in addition to the system trust store, so the downloads trust whatever roots the seeded pip shipped with. After the eMudhra/emSign incident, the Python maintainers' guidance is that pip must be at least 26.2.2, and that until the CPython ensurepip fix ships, pip should be upgraded in every new venv before it is used: https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576/1. Upgrading the parent environment or the OS trust store does not change the pip inside the new venv.

The script runs when ethos_u.inc:82 converts the person-detection model and ethos-u-vela is not already installed, for example in Corstone-300 builds with CO_PROCESSOR=ethos_u (test_cortex_m_corstone_300.sh:39).

Observed

We found this in heliaRT (Ambiq's TFLM fork), which carries this script unchanged. In our CI image, the ensurepip wheel holds pip 23.0.1 with certifi 2022.12.07, which still includes the distrusted emSign ECC Root CA - G3. We measured this in our image only, not in upstream's CI images or runners. The script is unchanged at tensorflow/tflite-micro@0f3f6012.

Suggested fix

After creating the venv, install a fixed pip (>= 26.2.2) in a way that does not depend on the old pip's trust store (for example a hash-pinned wheel, as the guidance above does), check its version, then install NumPy and Vela. TLS verification stays enabled throughout. I can send a PR with a regression check that seeds the venv with an old pip.

主要言語
C++
スター
3.1k
フォーク
1.1k
平均マージ
1日 48分
マージ済み PR(30日)
83

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tensorflow/tflite-micro のほかの issue

tensorflow/tflite-micro の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。