lkml.org 
[lkml]   [2020]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [Linux-kernel-mentees] [PATCH v3] media/v4l2-core: Fix kernel-infoleak in video_put_user()
On Tue, Jul 28, 2020 at 12:05 AM Peilin Ye <yepeilin.cs@gmail.com> wrote:
>
> On Mon, Jul 27, 2020 at 04:16:08PM +0300, Dan Carpenter wrote:
> > drivers/char/hpet.c:675 hpet_ioctl() warn: check that 'info' doesn't leak information (struct has a hole after 'hi_timer')
>
> This one seems like a false positive.
>
> drivers/char/hpet.c:670:
>
> mutex_lock(&hpet_mutex);
> err = hpet_ioctl_common(file->private_data, cmd, arg, &info);
> mutex_unlock(&hpet_mutex);
>
> if ((cmd == HPET_INFO) && !err &&
> (copy_to_user((void __user *)arg, &info, sizeof(info))))
> err = -EFAULT;
>
> `info` is only being copied to userspace when `cmd` is `HPET_INFO`.
> However, hpet_ioctl_common() is already doing memset() on `info` in
> `case HPET_INFO`:
>
> drivers/char/hpet.c:612:
>
> case HPET_INFO:
> {
> memset(info, 0, sizeof(*info));
> ^^^^^^

Yes, makes sense.

Arnd

\
 
 \ /
  Last update: 2020-07-28 11:01    [W:0.154 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site