From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796250028; b=tcNasgpiqEBAiFcYqvk99y+cd2K9JOyMqezAvnlGDGtRUkSEzgCl8OjWghfP6crWl5jE pI8aQ3e53WbXvQ4SnLU68zDspjmt97NRIFuO9nplhsbxOifAZnDEGL+lJrCkXNAdubFjm DU6PGuHU5IeAw2bMmPcXV+fO8KnzN83N+veAqwUN85hYLwBRoOYx3pc62viPbm6zTXviv RGf84PTnVgv8g4ltTel+7v5OwQ/0/Du6gRQwZ1COz6+7FxztfcC1fI8O5HdWWGePjozJn GovXSaxhWEoo6OiJKFMkNOsgIbVNNULpFDLcSEqPPpi3mk5tXQszju3uWLZHKkvUtSw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796250028; h=Received:DKIM-Signature:From:To:Cc:In-Reply-To:References:Subject: Message-Id:Date:MIME-Version:Content-Type:Content-Transfer-Encoding: X-Mailer; bh=iXcjTtDQTiRQLfr5aSPT2IO6I7rQzOinFtcUFzkm9bU=; b=Bx0uniDeGFZEfatYQ1qYI67LftD+m558Y178U1Gcs1OvU8Mhu8oTn64tmzTIThHwyuxk WeKrJkkd8AWp8BB/HADkFEjfA5hZLFjqy+mDxA98JZ4g+tUCIpZhK1E9avxlMu6xzoiQy hKpxf2g843Swv+8c8sAB3/aewYlJQLxvZi9IgZbtWGhcfdfi1mRt0p1svYXFAdWhHAxTv +iYN3C4t0ExpPi1UzOTXn/ig8qIYhVhqW6GLeKJKN4qOJs2Rw0OhJTycmvM4DAmitgIVw CH1MxyogTthfFTykjgcRRFjWKnfnWzJZYOf8Ra5dUuCfvVrEvG9FQR75YMdbMPT6+Vw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=c2Q+WfAS; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFFB8606A322; Wed, 2 Dec 2026 22:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=c2Q+WfAS Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21C9C1F00896; Wed, 2 Dec 2026 22:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796250028; bh=iXcjTtDQTiRQLfr5aSPT2IO6I7rQzOinFtcUFzkm9bU=; h=From:To:Cc:In-Reply-To:References:Subject:Date; b=c2Q+WfASokWpkS826cDVdUezti3wtGFUd3yv7yP4BaSib6KEm+JUYn8R0qaro4AdB pUZscnwmwcb555eXbeWqX1M5PhqDWa/R3XmBnvV6NCr2pEoIjL1bLYwlA8jiB16/C2 YetjIKhaIDm7a0mvkPzOfTY+1SLBfNBnbnZhAYSKvfiqGjOA6ZxsGe1qL9DnnnthuR AT0QxkW90b78AjJUviXxKonGKaShtZoaGQIutN72n8Uu3COURJvj2cov8CngQsLbqU YaLJYj3Us15IVoeLD5DEQ4bOVg3pPoLPOit16iEq7cpfxd5WmJzzM8S0JMhjkC4XOa nKYQMfyddLshg== From: Christian Brauner To: Alexander Viro , Jan Kara , Kees Cook , Paul Burton , Shuah Khan , Konstantin Khorenko Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20261106-b4-prep-vstor-149847-binfmt_elf-enomem-load-elf-phdrs-v2-0-1c8b7b1dae5c@virtuozzo.com> References: <20261106-b4-prep-vstor-149847-binfmt_elf-enomem-load-elf-phdrs-v2-0-1c8b7b1dae5c@virtuozzo.com> Subject: Re: [PATCH v2 0/2] binfmt_elf: return the real error when program headers cannot be loaded Message-Id: <20261202-getreide-trollen-ledig-e3eed802b03f@brauner> Date: Wed, 02 Dec 2026 23:20:23 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.17-dev-79e7b On Fri, 06 Nov 2026 21:57:36 +0100, Konstantin Khorenko wrote: > load_elf_phdrs() returns NULL on any failure, and load_elf_binary() > turns that into -ENOEXEC for the executable and -ELIBBAD for its > interpreter. A failed allocation or read of the program header table > then looks like a bad file, and glibc's execvp() runs the ELF with > /bin/sh. > > v2 changes the errno of those two failures and nothing else. Patch 2 > adds a selftest for both what stays and what changes. > > [...] Applied to the kernel-7.5.misc branch of the vfs/vfs.git tree. Patches in the kernel-7.5.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: kernel-7.5.misc [1/2] binfmt_elf: return the real error when program headers cannot be loaded https://git.kernel.org/vfs/vfs/c/296e9bafaab7 [2/2] selftests/exec: check the errors of an unloadable program header table https://git.kernel.org/vfs/vfs/c/00e3f3e675a4