Skip to content

usermodehelper: use UMH_WAIT_PROC consistently

Oleg Nesterov drbd-dev lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1usermodehelper: use UMH_WAIT_PROC consistentlydrivers/block/drbd/drbd_nl.c drivers/staging/rtl8187se/r8180_core.c drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +2 more+6 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Drbd-dev] [PATCH 0/1] usermodehelper: use UMH_WAIT_PROC consistently
Quoted 7 lines · Tetsuo Handa
Quoted 4 lines · Oleg Nesterov

Subject: [PATCH 1/5] usermodehelper: kill umh_wait, renumber UMH_* constants

No functional changes, preparation.

Quoted 7 lines
Quoted 4 lines

umh_wait doesn't can't be used as a bitmask, and we do not want to add another argument call_usermodehelper_* helpers.

Kill this enum and redefine the UMH_* constants.

There are several users that call call_usermodehelper() without using this enum. security/tomoyo/load_policy.c is one of such users

... and there are more.

Thanks a lot Tetsuo.

Quoted 2 lines

and there will be some
in out-of-tree code.

Well, they should be fixed imho.

Quoted 3 lines

Since I think distro kernels want
to backport this killable request_module() patchset, this patch should not change the constants in a way that makes impossible to detect kABI changes.

Good point, but I think the backporter should take care to not break the KABI. I do not think we should defer the possible cleanups for the sake of backporting.

It is possible to skip the first patch and add UMH_KILLABLE, just call_usermodehelper_exec() needs the additional wait != UMH_NO_WAIT check before testind/clearing UMH_KILLABLE. UMH_NO_WAIT | KILLABLE is not possible.

Quoted 7 lines

#define UMH_WAIT_EXEC 0 /* wait for the exec, but not the process */
#define UMH_WAIT_PROC 1 /* wait for the process to complete */
#define UMH_KILLABLE 2 /* wait for EXEC/PROC killable */
#define UMH_NO_WAIT 4 /* don't wait at all */

might be acceptable because we can remap -1 -> UMH_NO_WAIT on call_usermodehelper_exec() side.

Yes... but I think it is better to fix the users.

Perhaps we can do something like

	#define UMH_NO_WAIT	0x8000
	#define UMH_WAIT_EXEC	0x8001
	#define UMH_WAIT_	0x8002

and then call_usermodehelper_exec() does

	/* catch the old buggy users */
	BUG_ON(!(wait & 0x8000) || (wait < 0))

In any case. Whatever we do, I think we should fix the current ab-users.

Andrew, could you take this patch? Or should I split this trivial change by file/maintainer?

Oleg.