From 3cf5c7059d95e95433212172b4eedbf90ce11e08 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 14 Jun 2022 08:27:52 +0000 Subject: [PATCH] Revert "ANDROID: umh: Enable usermode helper for required use cases" This reverts commit c555553a40d6795e0c5d18b8ee94ac516a0aef09. Reason for revert: The binaries, and /sbin/ is not even present on Android systems. This patch was never tested :( Bug: 202192667 Signed-off-by: Greg Kroah-Hartman Change-Id: Ia1c35eba4a89a62ba678d8004742563372d3d920 --- kernel/umh.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/kernel/umh.c b/kernel/umh.c index a9dd6fa0825c..36c123360ab8 100644 --- a/kernel/umh.c +++ b/kernel/umh.c @@ -332,33 +332,6 @@ static void helper_unlock(void) wake_up(&running_helpers_waitq); } -/** - * Android supported usermode helper executables. - * - */ -static const char * const usermode_executable_path[] = { - "/sbin/reboot", - "/sbin/poweroff" -}; - -static bool check_usermodehelper_supported_commands(const char *path) -{ - int i; - - if (!strlen(path)) - return false; - - /* - * Check path is part of ANDROID supported usermode helper executables or not. - * Googlge and OEMs can add supported executables to usermode_executable_path. - */ - for (i = 0; i < ARRAY_SIZE(usermode_executable_path); i++) - if (!strcmp(path, usermode_executable_path[i])) - return true; - - return false; -} - /** * call_usermodehelper_setup - prepare to call a usermode helper * @path: path to usermode executable @@ -400,9 +373,6 @@ struct subprocess_info *call_usermodehelper_setup(const char *path, char **argv, #else sub_info->path = path; #endif - if (check_usermodehelper_supported_commands(path)) - sub_info->path = path; - sub_info->argv = argv; sub_info->envp = envp;