From 95164dc11b6dff87868e4d9bbfb565a90c783772 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 4 Feb 2021 00:20:07 +0100 Subject: [PATCH] wpa_supplicant: fix for security advisory 2020-2 A vulnerability was discovered in how wpa_supplicant processing P2P (Wi-Fi Direct) group information from active group owners. The actual parsing of that information validates field lengths appropriately, but processing of the parsed information misses a length check when storing a copy of the secondary device types. This can result in writing attacker controlled data into the peer entry after the area assigned for the secondary device type. The overflow can result in corrupting pointers for heap allocations. This can result in an attacker within radio range of the device running P2P discovery being able to cause unexpected behavior, including termination of the wpa_supplicant process and potentially arbitrary code execution. https://w1.fi/security/2020-2/wpa_supplicant-p2p-group-info-processing-vulnerability.txt Fixes: CVE-2021-0326 --- pkgs/os-specific/linux/wpa_supplicant/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix index c90407ec6e6f..ee8b26c384d9 100644 --- a/pkgs/os-specific/linux/wpa_supplicant/default.nix +++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix @@ -25,6 +25,12 @@ stdenv.mkDerivation rec { url = "https://w1.fi/cgit/hostap/patch/?id=7800725afb27397f7d6033d4969e2aeb61af4737"; sha256 = "0c1la7inf4m5y9gzdjjdnhpkx32pm8vi6m5knih8p77q4mbrdgg8"; }) + # P2P: Fix copying of secondary device types for P2P group client (https://w1.fi/security/2020-2/) + (fetchurl { + name = "CVE-2021-0326.patch"; + url = "https://w1.fi/security/2020-2/0001-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch"; + sha256 = "19f4hx0p547mdx8y8arb3vclwyy4w9c8a6a40ryj7q33730mrmn4"; + }) ]; # TODO: Patch epoll so that the dbus actually responds