python / python/cpython

Add overflow checks before calling memory allocators

オープン
#127,681 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

extension-modules interpreter-core stale type-bug
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:

From https://github.com/capi-workgroup/decisions/issues/50#issuecomment-2522706899 and https://github.com/capi-workgroup/decisions/issues/50#issuecomment-2514640058.

Some calls to the PyMem_* API uses an arithmetic operation on the size, which could make the requested length overflow. The checks in the corresponding functions would not be relevant since the inputs already overflowed.

See https://github.com/python/cpython/pull/127686#issuecomment-2523699454 for the future of this issue.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs
  • gh-153489

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、CPython の main ブランチにある PyMem_* アロケータ呼び出しと、gh-153489 にリンクされた議論を確認します。割り当て前の各サイズ算術演算を追跡し、その後、アロケータが呼び出される前にオーバーフローのケースが処理されていることを確認します。

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

評価

技術スタック
c
領域
backend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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