Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 377e7a27 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Make static usermode helper binaries constant



There are a number of usermode helper binaries that are "hard coded" in
the kernel today, so mark them as "const" to make it harder for someone
to change where the variables point to.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Sailer <t.sailer@alumni.ethz.ch>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alex Elder <elder@kernel.org>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d2c5d6c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -74,8 +74,8 @@ static inline void wf_notify(int event, void *param)

static int wf_critical_overtemp(void)
{
	static char * critical_overtemp_path = "/sbin/critical_overtemp";
	char *argv[] = { critical_overtemp_path, NULL };
	static char const critical_overtemp_path[] = "/sbin/critical_overtemp";
	char *argv[] = { (char *)critical_overtemp_path, NULL };
	static char *envp[] = { "HOME=/",
				"TERM=linux",
				"PATH=/sbin:/usr/sbin:/bin:/usr/bin",
+7 −3
Original line number Diff line number Diff line
@@ -299,7 +299,7 @@ static inline void baycom_int_freq(struct baycom_state *bc)
 *    eppconfig_path should be setable  via /proc/sys.
 */

static char eppconfig_path[256] = "/usr/sbin/eppfpga";
static char const eppconfig_path[] = "/usr/sbin/eppfpga";

static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/usr/bin:/bin", NULL };

@@ -308,7 +308,11 @@ static int eppconfig(struct baycom_state *bc)
{
	char modearg[256];
	char portarg[16];
        char *argv[] = { eppconfig_path, "-s", "-p", portarg, "-m", modearg,
        char *argv[] = {
		(char *)eppconfig_path,
		"-s",
		"-p", portarg,
		"-m", modearg,
		NULL };

	/* set up arguments */
+3 −2
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ static struct completion unload_sem;
 */
static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
{
	static char const sbin_pnpbios[] = "/sbin/pnpbios";
	char *argv[3], **envp, *buf, *scratch;
	int i = 0, value;

@@ -112,7 +113,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
	 * integrated into the driver core and use the usual infrastructure
	 * like sysfs and uevents
	 */
	argv[0] = "/sbin/pnpbios";
	argv[0] = (char *)sbin_pnpbios;
	argv[1] = "dock";
	argv[2] = NULL;

@@ -139,7 +140,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
			   info->location_id, info->serial, info->capabilities);
	envp[i] = NULL;

	value = call_usermodehelper(argv [0], argv, envp, UMH_WAIT_EXEC);
	value = call_usermodehelper(sbin_pnpbios, argv, envp, UMH_WAIT_EXEC);
	kfree(buf);
	kfree(envp);
	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -44,14 +44,14 @@ static int svc_watchdog_pm_notifier(struct notifier_block *notifier,

static void greybus_reset(struct work_struct *work)
{
	static char start_path[256] = "/system/bin/start";
	static char const start_path[] = "/system/bin/start";
	static char *envp[] = {
		"HOME=/",
		"PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin",
		NULL,
	};
	static char *argv[] = {
		start_path,
		(char *)start_path,
		"unipro_reset",
		NULL,
	};
+4 −4
Original line number Diff line number Diff line
@@ -268,8 +268,8 @@ void rtl92e_dm_watchdog(struct net_device *dev)
static void _rtl92e_dm_check_ac_dc_power(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	static char *ac_dc_script = "/etc/acpi/wireless-rtl-ac-dc-power.sh";
	char *argv[] = {ac_dc_script, DRV_NAME, NULL};
	static char const ac_dc_script[] = "/etc/acpi/wireless-rtl-ac-dc-power.sh";
	char *argv[] = {(char *)ac_dc_script, DRV_NAME, NULL};
	static char *envp[] = {"HOME=/",
			"TERM=linux",
			"PATH=/usr/bin:/bin",
@@ -1823,7 +1823,7 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
	enum rt_rf_power_state eRfPowerStateToSet;
	bool bActuallySet = false;
	char *argv[3];
	static char *RadioPowerPath = "/etc/acpi/events/RadioPower.sh";
	static char const RadioPowerPath[] = "/etc/acpi/events/RadioPower.sh";
	static char *envp[] = {"HOME=/", "TERM=linux", "PATH=/usr/bin:/bin",
			       NULL};

@@ -1862,7 +1862,7 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
		else
			argv[1] = "RFON";

		argv[0] = RadioPowerPath;
		argv[0] = (char *)RadioPowerPath;
		argv[2] = NULL;
		call_usermodehelper(RadioPowerPath, argv, envp, UMH_WAIT_PROC);
	}
Loading