Linux-Fsdevel Archive on
 help / color / Atom feed
From: Nikitas Angelinas <>
To: Alexander Viro <>,
	Alexey Dobriyan <>,
	Andrew Morton <>,
	Linus Torvalds <>,,,
Subject: [PATCH] fs/binfmt_elf.c: fix GPF when dereferencing invalid interpreter
Date: Sat, 30 Mar 2019 07:00:32 -0700
Message-ID: <20190330140032.GA1527@vostro> (raw)

Syzkaller found an issue where an invalid interpreter pointer is
dereferenced in load_elf_binary()->allow_write_access(). Fix this by
jumping to a different label in the cleanup path.

This patch applies against the latest linux-next tree. I have not tested
that the patch addresses the issue, but it should, imho.

Signed-off-by: Nikitas Angelinas <>
Fixes: 44e63c4a0263 ("fs/binfmt_elf.c: free PT_INTERP filename ASAP")
 fs/binfmt_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 51bc894..09e76b2 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -777,7 +777,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
 			retval = PTR_ERR(interpreter);
 			if (IS_ERR(interpreter))
-				goto out_free_dentry;
+				goto out_free_ph;
 			 * If the binary is not readable then enforce

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30 14:00 Nikitas Angelinas [this message]
2019-03-30 16:16 ` Mukesh Ojha

Reply instructions:

You may reply publically 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=20190330140032.GA1527@vostro \ \ \ \ \ \ \ \ \

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

Linux-Fsdevel Archive on

Archives are clonable:
	git clone --mirror linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ \
	public-inbox-index linux-fsdevel

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox