FreeBSD-SA-05:02.sendfile "sendfile kernel memory disclosure"

The FreeBSD Project よりセキュリティ勧告が出ました。要点を以下にまとめます。

  • sendfile(2) は、転送中のファイル長を切り詰めた場合、切り詰めた部分の変わりにランダムなカーネルメモリの一部を送り出してしまう脆弱性がある。
  • この脆弱性により権限のないユーザがカーネルメモリを入手できてしまう。
  • 入手したカーネルメモリにはファイルキャッシュやターミナルバッファの一部などを含む可能性があり、これらには他人の機密情報、たとえば他のユーザが入力したパスワードなどを含む可能性がある。

セキュリティ勧告は ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:02.sendfile.asc にあります。
以下は上記のセキュリティ勧告の一部とその訳文です。ただし品質は保証致しません。

I. 背景 - Background

The sendfile(2) system call allows a server application (such as an HTTP or FTP server) to transmit the contents of a file over a network connection without first copying it to application memory. High performance servers such as Apache and ftpd use sendfile.
sendfile(2)システムコールは、ファイル内容を、最初にアプリケーションメモリにコピーせずにネットワーク接続を経由して送信する(HTTPまたはFTPサーバのような)サーバアプリケーションを可能にします。Apacheやftpdのような高機能サーバはsendfileを使用します。

II. 問題の詳細 - Problem Description

If the file being transmitted is truncated after the transfer has started but before it completes, sendfile(2) will transfer the contents of more or less random portions of kernel memory in lieu of the missing part of the file.
転送を開始した後、それが完了する前に送信されているファイルが切り詰められた場合、sendfile(2)はファイルの欠けている部分の代わりに幾分かカーネルメモリのランダムな部分の内容を転送するでしょう。

III. 影響範囲 - Impact

A local user could create a large file and truncate it while transferring it to himself, thus obtaining a copy of portions of system memory to which he would normally not have access. Such memory might contain sensitive information, such as portions of the file cache or terminal buffers. This information might be directly useful, or it might be leveraged to obtain elevated privileges in some way. For example, a terminal buffer might include a user-entered password.
ローカルユーザは大きなファイルを作成し、自分へ転送する間にそれを切り詰めることができ、それにより、通常アクセス出来ないシステムメモリの一部のコピーを手に入れる事ができます。そのようなメモリはファイルキャッシュやターミナルバッファの一部などの機密情報を含むかもしれません。この情報は直接有用かもしれません。あるいは、何らかの方法で高い権限を得る手段にされるかもしれません。例えば、ターミナルバッファはユーザによって入力されたパスワードを含むかもしれません。

IV. 回避方法 - Workaround

No known workaround.
既知の回避方法はありません。

><