mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	execve updates for v6.9-rc1
- Drop needless error path code in remove_arg_zero() (Li kunyu, Kees Cook) - binfmt_elf_efpic: Don't use missing interpreter's properties (Max Filippov) - Use /bin/bash for execveat selftests -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEEpcP2jyKd1g9yPm4TiXL039xtwCYFAmXvlWUWHGtlZXNjb29r QGNocm9taXVtLm9yZwAKCRCJcvTf3G3AJueMEACVrxXuXlpozupTtixMzWkvoUjo bDmsyuX55PEmKwZXppD7cyxzHM0cdOzQmwMTBB8RWlMzZDMB/U6A8vxwKdoqGNT6 8nQ7/+GkeZLL32BSf8rtMsCrnFx58elOzEuiogkUwz73G/fBe+tbbZAFsR7q5cvr 6sHT9gP2Topycr01fHUwL41yDLZReCasxWdR+kYfn2akmpBGHpw12auHmZcVmWCc /uJTF4FUBt6Fa2h2OmQ3IByNZ50UoORfFkpP93ZaL1MUlILWMXo3DHOAM9vhowut PMa/9Blw86hZBIjKEkeeCIU83LSnI5PQCd7V+zCJmaslxkNPvoeH09rqHfGL37Pv DAOPpTEEm0l6ifunIAruSRmislBzQgO6n5ALPmMp4PcdBi5bbsk9PCLDEFwaTCeV 9H4kZnPl00Q7yyEXwHSJi1FFF3/DM0ntXVND2KQJVzqrszB51lALkI8fypWvTb9h POmU7PrYEXdjiTcMsWarajHYeV/VjmY7vwzjl8lXiw5nWnLJYQua8TAx4dEhpM3z qwa5K2L724ncsgKkwDZPDA3DsUAN9jYK+eqRRi6kD5zWdTkBHVvdLQrBjkUhndw/ DL2FkcLDewbHInEdbbIFOJUUmBxbRLcXEqb2nzQtiYIBQm4VqZFKTQqZVDWHF1UP +VeLTdDf6piwoP0cvQ== =MLV7 -----END PGP SIGNATURE----- Merge tag 'execve-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull execve updates from Kees Cook: - Drop needless error path code in remove_arg_zero() (Li kunyu, Kees Cook) - binfmt_elf_efpic: Don't use missing interpreter's properties (Max Filippov) - Use /bin/bash for execveat selftests * tag 'execve-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: exec: Simplify remove_arg_zero() error path selftests/exec: Perform script checks with /bin/bash exec: Delete unnecessary statements in remove_arg_zero() fs: binfmt_elf_efpic: don't use missing interpreter's properties
This commit is contained in:
		
						commit
						b32273ee89
					
				
					 3 changed files with 5 additions and 10 deletions
				
			
		| 
						 | 
					@ -320,7 +320,7 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		executable_stack = EXSTACK_DEFAULT;
 | 
							executable_stack = EXSTACK_DEFAULT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (stack_size == 0) {
 | 
						if (stack_size == 0 && interp_params.flags & ELF_FDPIC_FLAG_PRESENT) {
 | 
				
			||||||
		stack_size = interp_params.stack_size;
 | 
							stack_size = interp_params.stack_size;
 | 
				
			||||||
		if (interp_params.flags & ELF_FDPIC_FLAG_EXEC_STACK)
 | 
							if (interp_params.flags & ELF_FDPIC_FLAG_EXEC_STACK)
 | 
				
			||||||
			executable_stack = EXSTACK_ENABLE_X;
 | 
								executable_stack = EXSTACK_ENABLE_X;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										11
									
								
								fs/exec.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								fs/exec.c
									
									
									
									
									
								
							| 
						 | 
					@ -1719,7 +1719,6 @@ static int prepare_binprm(struct linux_binprm *bprm)
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
int remove_arg_zero(struct linux_binprm *bprm)
 | 
					int remove_arg_zero(struct linux_binprm *bprm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int ret = 0;
 | 
					 | 
				
			||||||
	unsigned long offset;
 | 
						unsigned long offset;
 | 
				
			||||||
	char *kaddr;
 | 
						char *kaddr;
 | 
				
			||||||
	struct page *page;
 | 
						struct page *page;
 | 
				
			||||||
| 
						 | 
					@ -1730,10 +1729,8 @@ int remove_arg_zero(struct linux_binprm *bprm)
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
		offset = bprm->p & ~PAGE_MASK;
 | 
							offset = bprm->p & ~PAGE_MASK;
 | 
				
			||||||
		page = get_arg_page(bprm, bprm->p, 0);
 | 
							page = get_arg_page(bprm, bprm->p, 0);
 | 
				
			||||||
		if (!page) {
 | 
							if (!page)
 | 
				
			||||||
			ret = -EFAULT;
 | 
								return -EFAULT;
 | 
				
			||||||
			goto out;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		kaddr = kmap_local_page(page);
 | 
							kaddr = kmap_local_page(page);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (; offset < PAGE_SIZE && kaddr[offset];
 | 
							for (; offset < PAGE_SIZE && kaddr[offset];
 | 
				
			||||||
| 
						 | 
					@ -1746,10 +1743,8 @@ int remove_arg_zero(struct linux_binprm *bprm)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bprm->p++;
 | 
						bprm->p++;
 | 
				
			||||||
	bprm->argc--;
 | 
						bprm->argc--;
 | 
				
			||||||
	ret = 0;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
out:
 | 
						return 0;
 | 
				
			||||||
	return ret;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL(remove_arg_zero);
 | 
					EXPORT_SYMBOL(remove_arg_zero);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -393,7 +393,7 @@ static int run_tests(void)
 | 
				
			||||||
static void prerequisites(void)
 | 
					static void prerequisites(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int fd;
 | 
						int fd;
 | 
				
			||||||
	const char *script = "#!/bin/sh\nexit $*\n";
 | 
						const char *script = "#!/bin/bash\nexit $*\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Create ephemeral copies of files */
 | 
						/* Create ephemeral copies of files */
 | 
				
			||||||
	exe_cp("execveat", "execveat.ephemeral");
 | 
						exe_cp("execveat", "execveat.ephemeral");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue