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, 22 Apr 2016 08:53:34 +0200
From:	Clemens Ladisch <clemens@...isch.de>
To:	Vaishali Thakkar <vaishali.thakkar@...cle.com>
Cc:	gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: core: Do not use sizeof on pointer type

Vaishali Thakkar wrote:
> When sizeof is applied to a pointer typed expression, it gives
> the size of the pointer.

And why would that be wrong in this case?

> +++ b/drivers/usb/core/hcd.c
> @@ -1386,7 +1386,7 @@ static int hcd_alloc_coherent(struct usb_bus *bus,
>  		return -EFAULT;
>  	}
>
> -	vaddr = hcd_buffer_alloc(bus, size + sizeof(vaddr),
> +	vaddr = hcd_buffer_alloc(bus, size + sizeof(*vaddr),
>  				 mem_flags, dma_handle);
>  	if (!vaddr)
>  		return -ENOMEM;
>

Please note the following comment:

	/*
	 * Store the virtual address of the buffer at the end
	 * of the allocated dma buffer. [...]


Regards,
Clemens

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ