wireguard: Clear keys after suspend despite CONFIG_ANDROID=y
authorBen Hutchings <benh@debian.org>
Thu, 7 Jul 2022 16:58:43 +0000 (18:58 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 31 Dec 2023 15:46:35 +0000 (16:46 +0100)
Forwarded: not-needed

WireGuard assumes that CONFIG_ANDROID implies Android power
management, i.e. user-space suspending the system automatically at
short intervals, and so does not clear keys after a suspend/resume
cycle.  Debian systems don't do that kind of power management but we
do set CONFIG_ANDROID on some architectures as a dependency of Binder.

In 5.20, CONFIG_PM_USERSPACE_AUTOSLEEP will be introduced to tell the
kernel that this kind of power management is in use, and
CONFIG_ANDROID will be removed.  For now, remove this one test that
does the wrong thing for us.

References: https://lwn.net/Articles/899743/

Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name wireguard-ignore-config_android.patch

drivers/net/wireguard/device.c

index 713ca20feaef4c586c7e3dae1e5d0256dd3a17a8..493da92b88a1904b2bdc30f66da66ed0bc103307 100644 (file)
@@ -71,7 +71,7 @@ static int wg_pm_notification(struct notifier_block *nb, unsigned long action,
         * its normal operation rather than as a somewhat rare event, then we
         * don't actually want to clear keys.
         */
-       if (IS_ENABLED(CONFIG_PM_AUTOSLEEP) || IS_ENABLED(CONFIG_ANDROID))
+       if (IS_ENABLED(CONFIG_PM_AUTOSLEEP))
                return 0;
 
        if (action != PM_HIBERNATION_PREPARE && action != PM_SUSPEND_PREPARE)