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]
Date:   Fri, 25 Sep 2020 09:32:14 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Sherry Sun <sherry.sun@....com>
Cc:     Sudeep Dutt <sudeep.dutt@...el.com>,
        Ashutosh Dixit <ashutosh.dixit@...el.com>,
        gregkh <gregkh@...uxfoundation.org>,
        Rikard Falkeborn <rikard.falkeborn@...il.com>,
        Lee Jones <lee.jones@...aro.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        NXP Linux Team <linux-imx@....com>
Subject: Re: [PATCH 4/4] mic: vop: copy data to kernel space then write to io memory

On Fri, Sep 25, 2020 at 9:22 AM Sherry Sun <sherry.sun@....com> wrote:
>

> @@ -655,12 +656,15 @@ static int vop_virtio_copy_from_user(struct vop_vdev *vdev, void __user *ubuf,
>          * We are copying to IO below and should ideally use something
>          * like copy_from_user_toio(..) if it existed.
>          */
> -       if (copy_from_user((void __force *)dbuf, ubuf, len)) {
> +       temp = kmalloc(len, GFP_KERNEL);
> +       if (copy_from_user(temp, ubuf, len))

This needs to have error handling for a kmalloc() failure. As the length
appears to be user-provided, you might also want to limit the size of
the allocation and instead do a loop with multiple copies if there is
more data than fits into the allocation.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ