mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "kalash nainwal" <kalash.nainwal@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] (re)register_binfmt returns with -EBUSY
Date: Mon, 2 Apr 2007 18:24:15 +0530	[thread overview]
Message-ID: <416aa1ad0704020554u54ec3720oe99eba180ffa11eb@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 556 bytes --]

When a binary format is unregistered and re-registered,
register_binfmt fails with -EBUSY. The reason is that
unregister_binfmt does not set fmt->next to NULL, and seeing
(fmt->next != NULL), register_binfmt fails with -EBUSY.

One can find his way around by explicitly setting fmt->next to NULL
after unregistering, but that is kind of unclean (one should better be
using only the interfaces, and not the interal members, isn't it?)

Attached one-liner can fix it (for 2.6.20).

Regards,
-Kalash


Signed-off-by: Kalash Nainwal <kalash.nainwal@gmail.com>

[-- Attachment #2: lnx_binfmt.patch --]
[-- Type: application/octet-stream, Size: 330 bytes --]

--- linux-2.6.20/fs/exec.c	2007-02-05 00:14:54.000000000 +0530
+++ linux-2.6.20_modified/fs/exec.c	2007-04-02 17:56:56.369105272 +0530
@@ -100,6 +100,7 @@ int unregister_binfmt(struct linux_binfm
 	while (*tmp) {
 		if (fmt == *tmp) {
 			*tmp = fmt->next;
+			fmt->next = NULL;
 			write_unlock(&binfmt_lock);
 			return 0;
 		}

             reply	other threads:[~2007-04-02 12:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-02 12:54 kalash nainwal [this message]
2007-04-03  0:40 ` Andrew Morton

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=416aa1ad0704020554u54ec3720oe99eba180ffa11eb@mail.gmail.com \
    --to=kalash.nainwal@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome