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:   Mon, 13 May 2019 15:28:28 +0000
From:   Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>
To:     Akinobu Mita <akinobu.mita@...il.com>,
        "linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     Jens Axboe <axboe@...com>, Sagi Grimberg <sagi@...mberg.me>,
        Kenneth Heitke <kenneth.heitke@...el.com>,
        Keith Busch <keith.busch@...el.com>,
        Minwoo Im <minwoo.im.dev@...il.com>,
        Johannes Berg <johannes@...solutions.net>,
        Christoph Hellwig <hch@....de>
Subject: Re: [PATCH v3 1/7] devcoredump: use memory_read_from_buffer

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@....com>.

On 05/12/2019 08:55 AM, Akinobu Mita wrote:
> Use memory_read_from_buffer() to simplify devcd_readv().
>
> Cc: Johannes Berg <johannes@...solutions.net>
> Cc: Keith Busch <keith.busch@...el.com>
> Cc: Jens Axboe <axboe@...com>
> Cc: Christoph Hellwig <hch@....de>
> Cc: Sagi Grimberg <sagi@...mberg.me>
> Cc: Minwoo Im <minwoo.im.dev@...il.com>
> Cc: Kenneth Heitke <kenneth.heitke@...el.com>
> Reviewed-by: Johannes Berg <johannes@...solutions.net>
> Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
> ---
> * v3
> - No change since v2
>
>   drivers/base/devcoredump.c | 11 +----------
>   1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c
> index f1a3353..3c960a6 100644
> --- a/drivers/base/devcoredump.c
> +++ b/drivers/base/devcoredump.c
> @@ -164,16 +164,7 @@ static struct class devcd_class = {
>   static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count,
>   			   void *data, size_t datalen)
>   {
> -	if (offset > datalen)
> -		return -EINVAL;
> -
> -	if (offset + count > datalen)
> -		count = datalen - offset;
> -
> -	if (count)
> -		memcpy(buffer, ((u8 *)data) + offset, count);
> -
> -	return count;
> +	return memory_read_from_buffer(buffer, count, &offset, data, datalen);
>   }
>
>   static void devcd_freev(void *data)
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ