Re: [PATCH] net/unix: pass pidfd flags via SCM_PIDFD cmsg

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

 



From: Stas Sergeev <stsp2@xxxxxxxxx>
Date: Thu, 14 Nov 2024 00:02:05 +0300
> @@ -154,7 +157,12 @@ static __inline__ void scm_pidfd_recv(struct msghdr *msg, struct scm_cookie *scm
>  	if (!scm->pid)
>  		return;
>  
> -	pidfd = pidfd_prepare(scm->pid, 0, &pidfd_file);
> +	err = pidfd_validate_flags(scm->pidfd_flags);

No neede to double check here, it's already checked in __scm_send().


> +	if (err) {
> +		msg->msg_flags |= MSG_CTRUNC;
> +		return;
> +	}
> +	pidfd = pidfd_prepare(scm->pid, scm->pidfd_flags, &pidfd_file);
>  
>  	if (put_cmsg(msg, SOL_SOCKET, SCM_PIDFD, sizeof(int), &pidfd)) {
>  		if (pidfd_file) {




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux