From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCD1AC3DA7A for ; Mon, 2 Jan 2023 11:10:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230062AbjABLKy (ORCPT ); Mon, 2 Jan 2023 06:10:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232526AbjABKvR (ORCPT ); Mon, 2 Jan 2023 05:51:17 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A7D325FD for ; Mon, 2 Jan 2023 02:51:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 06A7C60DEF for ; Mon, 2 Jan 2023 10:51:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1928BC433D2; Mon, 2 Jan 2023 10:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672656664; bh=ee2puze15g528fV1JJtXCrTkmhQ7jL8/E9CSthi+sRw=; h=Subject:To:Cc:From:Date:From; b=ZrfI0gMW6UqW1V9apOo0ZVjjz6xUO1F7I7tUGZH1c/PVaUbqkUnueB+jlczIMshJz oYD6UViVPXDQL5c1vtFynYLJAmxK9Z3Mk4BC66oT1FUcLZBtu1lv3japDA29zuUbpg JOUGHKINLkqtY9R7cWabCZWSR1UUgHhp4YL9zvQI= Subject: FAILED: patch "[PATCH] binfmt: Fix error return code in load_elf_fdpic_binary()" failed to apply to 4.19-stable tree To: wangyufen@huawei.com, keescook@chromium.org Cc: From: Date: Mon, 02 Jan 2023 11:50:51 +0100 Message-ID: <1672656651254222@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Possible dependencies: e7f703ff2507 ("binfmt: Fix error return code in load_elf_fdpic_binary()") e7f7785449a1 ("binfmt: Move install_exec_creds after setup_new_exec to match binfmt_elf") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From e7f703ff2507f4e9f496da96cd4b78fd3026120c Mon Sep 17 00:00:00 2001 From: Wang Yufen Date: Fri, 2 Dec 2022 09:41:01 +0800 Subject: [PATCH] binfmt: Fix error return code in load_elf_fdpic_binary() Fix to return a negative error code from create_elf_fdpic_tables() instead of 0. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Wang Yufen Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/1669945261-30271-1-git-send-email-wangyufen@huawei.com diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index e90c1192dec6..096e3520a0b1 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -434,8 +434,9 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm) current->mm->start_stack = current->mm->start_brk + stack_size; #endif - if (create_elf_fdpic_tables(bprm, current->mm, - &exec_params, &interp_params) < 0) + retval = create_elf_fdpic_tables(bprm, current->mm, &exec_params, + &interp_params); + if (retval < 0) goto error; kdebug("- start_code %lx", current->mm->start_code);