archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <>
Subject: [PATCH] exec: move ->recursion_depth out of critical sections
Date: Thu, 18 Apr 2019 00:31:50 +0300	[thread overview]
Message-ID: <20190417213150.GA26474@avx2> (raw)

->recursion_depth is changed only by current, therefore decrementing can be
done without taking any locks.

Signed-off-by: Alexey Dobriyan <>

 fs/exec.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1652,11 +1652,13 @@ int search_binary_handler(struct linux_binprm *bprm)
 		if (!try_module_get(fmt->module))
 		retval = fmt->load_binary(bprm);
+		bprm->recursion_depth--;
-		bprm->recursion_depth--;
 		if (retval < 0 && !bprm->mm) {
 			/* we got to flush_old_exec() and failed after it */

                 reply	other threads:[~2019-04-17 21:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190417213150.GA26474@avx2 \ \ \ \
    --subject='Re: [PATCH] exec: move ->recursion_depth out of critical sections' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox