Re: [PATCH 4.9 45/47] Smack: Dont ignore other bprm->unsafe flags if LSM_UNSAFE_PTRACE is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2019-10-06 at 19:21 +0200, Greg Kroah-Hartman wrote:
> From: Jann Horn <jannh@xxxxxxxxxx>
> 
> commit 3675f052b43ba51b99b85b073c7070e083f3e6fb upstream.
[...]
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -949,7 +949,8 @@ static int smack_bprm_set_creds(struct l
>  
>  		if (rc != 0)
>  			return rc;
> -	} else if (bprm->unsafe)
> +	}
> +	if (bprm->unsafe & ~LSM_UNSAFE_PTRACE)

I think this needs to be ~(LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP)
for 4.9 and older branches.

Ben.

>  		return -EPERM;
>  
>  	bsp->smk_task = isp->smk_task;
> 
> 
-- 
Ben Hutchings
Every program is either trivial or else contains at least one bug

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux