Red Hat Product Security was made aware of a vulnerability affecting the Linux kernel's implementation of the Bluetooth L2CAP protocol. The vulnerability was named BlueBorne and was assigned an ID - CVE-2017-1000251.
A vulnerable system would need to have Bluetooth (hardware + service) enabled and an attacking device would need to be within
its operating range.
Bluetooth is a short-range wireless communication technology meant to connect devices over radio channels without need for a physical connection. The radio channel forms a physical layer in the Bluetooth stack, analogous to cables in other networks. Above this physical channel, the Bluetooth stack hosts different logical channels and their associated protocols, such as Link Manager Protocol (LMP), Logical Link Control and Adaptation Protocol (L2CAP) and others. These protocols help with controlling the operation of devices in the Bluetooth network and provide services such as segmentation/reassembly of application data, error detection, retransmission and multiplexing of channels over a shared link.
A typical Bluetooth operation includes device discovery, connection establishment and configuration followed by data transmission. A radio channel provides a physical link between two devices. The L2CAP (Logical link control and adaptation protocol) channel provides a logical connection between two devices which could serve a single application. Multiple such logical connections share a physical link between two devices.
Kernel buffer overflow
Once a physical connection is established, L2CAP configures a logical link between two end-points to be used by an application. It is during this configuration of a channel that the stack buffer overflow issue can occur. L2CAP implementation in the Linux kernel stores these configuration parameters in a stack buffer object:
case L2CAP_CONF_PENDING: .... if (test_bit(CONF_LOC_CONF_PEND, &chan->conf_state)) { char buf[64]; <= Kernel stack buffer stores L2CAP parameters len = l2cap_parse_conf_rsp(chan, rsp->data, len, buf, &result);
A Bluetooth client sends configuration parameters to a host, these are temporarily stored in the “buf” array above.
A malicious client can send L2CAP configuration packets with configuration parameters set to exceed 64 byte length of the “buf” array passed to the l2cap_parse_conf_rsp() routine. When these parameters are copied to the "buf" array, adjacent kernel stack memory is overwritten with their content. This exchange occurs prior to any authentication, while establishing a Bluetooth connection. As a result, an unauthenticated user who is able to connect to a system via Bluetooth, can use this flaw to overwrite kernel stack memory with malicious data.
System guards
Kernel stack memory corruption can be easily leveraged to execute arbitrary code with kernel ring 0 (above root) privileges on a system. Red Hat Enterprise Linux kernels are hardened with gcc(1) compile time options which protect against such memory corruption. On supported architectures the gcc(1) -fstack-protector option adds a canary value at the beginning of a function and before the function return address. The -fstack-protector-strong extends this canary protection around local stack variables including arrays of any type and length. As can be seen below,
After copying data to these stack variables, kernel validates the stack canary value stored in the stack frame to detect any memory corruption and aborts the impending attack by resorting to a kernel panic.
void __stack_chk_fail(void) { panic("stack-protector: Kernel stack is corrupted in: %p\n", __builtin_return_address(0)); }
The stack protection thus helps to prevent the arbitrary code execution with the kernel/root privileges. Ie. on cpu architectures with support for this feature, this vulnerability is reduced to a denial of service, rather than a remote code execution one.
Response
Red Hat Enterprise Linux kernels have received updates to address this buffer overflow. The kernel functions 'L2cap_parse_conf_rsp' and 'l2cap_add_conf_opt' have been augmented to accept a new parameter specifying the length of the "buf" array. These functions then use the length parameter to contain the data copied from an incoming packet within "buf" limits, so as to prevent the stack buffer overflow.
Acknowledgements:
Red Hat would like to thank Armis Labs (https://armis.com) for reporting this issue.
[*] https://access.redhat.com/security/vulnerabilities/blueborne
執筆者紹介
チャンネル別に見る
自動化
テクノロジー、チームおよび環境に関する IT 自動化の最新情報
AI (人工知能)
お客様が AI ワークロードをどこでも自由に実行することを可能にするプラットフォームについてのアップデート
オープン・ハイブリッドクラウド
ハイブリッドクラウドで柔軟に未来を築く方法をご確認ください。
セキュリティ
環境やテクノロジー全体に及ぶリスクを軽減する方法に関する最新情報
エッジコンピューティング
エッジでの運用を単純化するプラットフォームのアップデート
インフラストラクチャ
世界有数のエンタープライズ向け Linux プラットフォームの最新情報
アプリケーション
アプリケーションの最も困難な課題に対する Red Hat ソリューションの詳細
オリジナル番組
エンタープライズ向けテクノロジーのメーカーやリーダーによるストーリー
製品
ツール
試用、購入、販売
コミュニケーション
Red Hat について
エンタープライズ・オープンソース・ソリューションのプロバイダーとして世界をリードする Red Hat は、Linux、クラウド、コンテナ、Kubernetes などのテクノロジーを提供しています。Red Hat は強化されたソリューションを提供し、コアデータセンターからネットワークエッジまで、企業が複数のプラットフォームおよび環境間で容易に運用できるようにしています。
言語を選択してください
Red Hat legal and privacy links
- Red Hat について
- 採用情報
- イベント
- 各国のオフィス
- Red Hat へのお問い合わせ
- Red Hat ブログ
- ダイバーシティ、エクイティ、およびインクルージョン
- Cool Stuff Store
- Red Hat Summit