lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiDSCtZ8RbsR0_jwWbRiMayum2Q4+1wj=PQgC8Vu2boJeihng@mail.gmail.com>
Date:   Fri, 3 Sep 2021 12:33:44 +0200
From:   Ricardo Ribalda <ribalda@...omium.org>
To:     Mauro Carvalho Chehab <mchehab@...nel.org>
Cc:     Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        tfiga@...omium.org, Hans Verkuil <hverkuil@...all.nl>
Subject: Re: [PATCH v10 13/21] media: uvcvideo: Use control names from framework

Hi Mauro

On Fri, 3 Sept 2021 at 12:11, Mauro Carvalho Chehab <mchehab@...nel.org> wrote:
>
> Em Fri, 18 Jun 2021 14:29:15 +0200
> Ricardo Ribalda <ribalda@...omium.org> escreveu:
>
> > diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
> > index 9cdd30eff495..28ccaa8b9e42 100644
> > --- a/drivers/media/usb/uvc/uvc_v4l2.c
> > +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> > @@ -40,7 +40,13 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
> >               return -ENOMEM;
> >
> >       map->id = xmap->id;
> > -     memcpy(map->name, xmap->name, sizeof(map->name));
> > +     /* Non standard control id. */
> > +     if (v4l2_ctrl_get_name(map->id) == NULL) {
> > +             map->name = kmemdup(xmap->name, sizeof(xmap->name),
> > +                                 GFP_KERNEL);
>
> Where are you de-allocating it at driver removal/unbind?

It is also in this patch:

@@ -2462,6 +2448,7 @@ static void uvc_ctrl_cleanup_mappings(struct
uvc_device *dev,
        list_for_each_entry_safe(mapping, nm, &ctrl->info.mappings, list) {
                list_del(&mapping->list);
                kfree(mapping->menu_info);
+               kfree(mapping->name);
                kfree(mapping);
        }
 }

If there is a standard name mapping->name will be NULL, but kfree
checks for that.

Thanks


>
>
> Thanks,
> Mauro



-- 
Ricardo Ribalda

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ