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: <3256728.DYdlef6xAF@wuerfel>
Date:	Fri, 19 Feb 2016 21:55:14 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Murali Karicheri <m-karicheri2@...com>
Cc:	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	davem@...emloft.net
Subject: Re: [PATCH v2 3/3] net: netcp: rework the code for get/set sw_data in dma desc

On Friday 19 February 2016 12:58:44 Murali Karicheri wrote:
> SW data field in descriptor can be used by software to hold private
> data for the driver. As there are 4 words available for this purpose,
> use separate macros to place it or retrieve the same to/from
> descriptors. Also do type cast of data types accordingly.
> 
> Cc: Wingman Kwok <w-kwok2@...com>
> Cc: Mugunthan V N <mugunthanvnm@...com>
> CC: Arnd Bergmann <arnd@...db.de>
> CC: Grygorii Strashko <grygorii.strashko@...com>
> CC: David Laight <David.Laight@...LAB.COM>
> Signed-off-by: Murali Karicheri <m-karicheri2@...com>

Looks ok in principle.

Acked-by: Arnd Bergmann <arnd@...db.de>

>  		get_pkt_info(&dma_buf, &tmp, &dma_desc, ndesc);
> -		get_sw_data((u32 *)&buf_ptr, &buf_len, ndesc);
> +		/* warning!!!! We are retrieving the virtual ptr in the sw_data
> +		 * field as a 32bit value. Will not work on 64bit machines
> +		 */
> +		buf_ptr = (void *)GET_SW_DATA0(ndesc);
> +		buf_len = (int)GET_SW_DATA1(desc);

I would have abstracted the retrieval of a pointer again,
and added the comment in the helper function once, it doesn't
really need to be duplicated everywhere.

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ