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] [day] [month] [year] [list]
Date:   Mon, 31 Oct 2016 11:32:08 -0700
From:   Eric Anholt <eric@...olt.net>
To:     Michael Zoran <mzoran@...wfest.net>, gregkh@...uxfoundation.org
Cc:     swarren@...dotorg.org, lee@...nel.org, mzoran@...wfest.net,
        daniels@...labora.com, noralf@...nnes.org, popcornmix@...il.com,
        linux-rpi-kernel@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vc04_services: call sg_init_table to init scatterlist

Michael Zoran <mzoran@...wfest.net> writes:

> Call the sg_init_table function to correctly initialze
> the DMA scatterlist.  This function is required to completely
> initialize the list and is mandatory if DMA debugging is
> enabled in the build configuration.
>
> One of the purposes of sg_init_table is to set
> the magic "cookie" on each list element and ensure
> the chain end is marked.
>
> Signed-off-by: Michael Zoran <mzoran@...wfest.net>
> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> index 6fa2b5a..21b26e5 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> @@ -464,6 +464,12 @@ create_pagelist(char __user *buf, size_t count, unsigned short type,
>  	pagelist->type = type;
>  	pagelist->offset = offset;
>  
> +	/*
> +	 * Initialize the scatterlist so that the magic cookie
> +	 *  is filled if debugging is enabled
> +	 */
> +	sg_init_table(scatterlist, num_pages);
> +	/* Now set the pages for each scatterlist */

I feel like the comments don't add much, but either way:

Acked-by: Eric Anholt <eric@...olt.net>

>  	for (i = 0; i < num_pages; i++)
>  		sg_set_page(scatterlist + i, pages[i], PAGE_SIZE, 0);
>  
> -- 
> 2.10.1

Download attachment "signature.asc" of type "application/pgp-signature" (801 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ