Re: [PATCH 2/4] timerfd: convert to ->read_iter()

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

 



On 4/9/24 9:22 AM, Jens Axboe wrote:
> @@ -312,8 +313,8 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
>  		ctx->ticks = 0;
>  	}
>  	spin_unlock_irq(&ctx->wqh.lock);
> -	if (ticks)
> -		res = put_user(ticks, (u64 __user *) buf) ? -EFAULT: sizeof(ticks);
> +	if (ticks && !copy_to_iter_full(&ticks, sizeof(ticks), to))
> +		res = -EFAULT;
>  	return res;
>  }

Dumb thinko here, as that should be:

if (ticks) {                                                            
	res = copy_to_iter(&ticks, sizeof(ticks), to);                  
	if (!res)                                                       
		res = -EFAULT;                                          
}            

I've updated my branch, just a heads-up. Odd how it passing testing,
guess I got stack lucky...

-- 
Jens Axboe





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux