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

Đang mở Phù hợp với người mới
#3,953 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, shell
Lĩnh vực
build-system, security

Hướng nghiên cứu

Bắt đầu với tensorflow/lite/micro/tools/make/ext_libs/person_detection_int8_vela_convert.sh, đặc biệt là phần thiết lập venv và cài đặt pip quanh các dòng 61–64. Đọc hướng dẫn Python được liên kết, sau đó kiểm tra cách script có thể cài đặt và xác minh pip 26.2.2 trở lên mà không phụ thuộc vào kho chứng chỉ tin cậy có sẵn của pip. Công việc hoàn tất khi venv mới nâng cấp pip trước khi cài NumPy và Vela, đồng thời bật xác minh TLS; kiểm tra hồi quy được đề xuất có thể xác minh hành vi với pip có sẵn phiên bản cũ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
3.1k
Fork
1.1k
Merge trung bình
1 ngày 48 phút
Pull request đã merge (30 ngày)
83

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của tensorflow/tflite-micro

Tất cả issue của tensorflow/tflite-micro

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.