diff --git a/pkgs/by-name/iw/iwd/package.nix b/pkgs/by-name/iw/iwd/package.nix index fe76cc26e247..ff333d35e370 100644 --- a/pkgs/by-name/iw/iwd/package.nix +++ b/pkgs/by-name/iw/iwd/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchgit, + fetchpatch, autoreconfHook, pkg-config, ell, @@ -27,6 +28,29 @@ stdenv.mkDerivation (finalAttrs: { # Remove dbus config referencing the netdev group, which we don't have. # Users are advised to use the wheel group instead. ./no_netdev_group.diff + + # Fixes for exploitable memory-safety bugs reported in + # https://abhinavagarwal07.github.io/posts/iwd-rrm-stack-overflow/ + (fetchpatch { + name = "rrm-fix-stack-buffer-overflow-in-rrm_report_beacon_results.patch"; + url = "https://raw.githubusercontent.com/abhinavagarwal07/iwd-security-poc/1d646278412ef446f30cb58025590e6ff5945cb0/patches/0001-rrm-fix-stack-buffer-overflow-in-rrm_report_beacon_r.patch"; + hash = "sha256-t7f4vrS8Ns0BUt8UxS+62T+xWDZaA/t5A0cnXWm00ZU="; + }) + (fetchpatch { + name = "ie-fix-off-by-one-in-he-capabilities-channel-width-set.patch"; + url = "https://raw.githubusercontent.com/abhinavagarwal07/iwd-security-poc/1d646278412ef446f30cb58025590e6ff5945cb0/patches/0002-ie-fix-off-by-one-in-HE-Capabilities-Channel-Width-S.patch"; + hash = "sha256-142lowS9YtOGwfRqryxxGnzcNZrz72tIOhVZhlo3fMY="; + }) + (fetchpatch { + name = "ft-fix-mde_equal-self-comparison-and-type-mismatch.patch"; + url = "https://raw.githubusercontent.com/abhinavagarwal07/iwd-security-poc/1d646278412ef446f30cb58025590e6ff5945cb0/patches/0003-ft-fix-mde_equal-self-comparison-and-type-mismatch.patch"; + hash = "sha256-Qdm8eAw3tbH/wDWvmWIkKxMQ2m16o+VvEPYaKXBgAAw="; + }) + (fetchpatch { + name = "ie-fix-uint8_t-underflow-in-fte-sub-element-parser.patch"; + url = "https://raw.githubusercontent.com/abhinavagarwal07/iwd-security-poc/1d646278412ef446f30cb58025590e6ff5945cb0/patches/0004-ie-fix-uint8_t-underflow-in-FTE-sub-element-parser.patch"; + hash = "sha256-6At7PUXoORM++9ndIzxTTRu7V09+D31DrdMNLt1EtOc="; + }) ]; outputs = [