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]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD00AD920@AcuExch.aculab.com>
Date:   Fri, 3 Nov 2017 10:28:53 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Parvi Kaustubhi' <pkaustub@...co.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>
CC:     "gvaradar@...co.com" <gvaradar@...co.com>,
        "benve@...co.com" <benve@...co.com>
Subject: RE: [PATCH net-next v2 1/3] enic: reset fetch index

From: Parvi Kaustubhi
> Sent: 01 November 2017 15:45
> Since we are allowing rx ring size modification, reset fetch index
> everytime. Otherwise it could have a stale value that can lead to a null
> pointer dereference.
> 
> Signed-off-by: Govindarajulu Varadarajan <gvaradar@...co.com>
> Signed-off-by: Parvi Kaustubhi <pkaustub@...co.com>
> ---
> v2: remove unused variable to fix build warning
> 
>  drivers/net/ethernet/cisco/enic/vnic_rq.c | 16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cisco/enic/vnic_rq.c b/drivers/net/ethernet/cisco/enic/vnic_rq.c
> index 36bc2c7..f8aa326 100644
> --- a/drivers/net/ethernet/cisco/enic/vnic_rq.c
> +++ b/drivers/net/ethernet/cisco/enic/vnic_rq.c
> @@ -139,20 +139,8 @@ void vnic_rq_init(struct vnic_rq *rq, unsigned int cq_index,
>  	unsigned int error_interrupt_enable,
>  	unsigned int error_interrupt_offset)
>  {
> -	u32 fetch_index = 0;
> -
> -	/* Use current fetch_index as the ring starting point */
> -	fetch_index = ioread32(&rq->ctrl->fetch_index);
> -
> -	if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone  */
> -		/* Hardware surprise removal: reset fetch_index */
> -		fetch_index = 0;
> -	}
> -
> -	vnic_rq_init_start(rq, cq_index,
> -		fetch_index, fetch_index,
> -		error_interrupt_enable,
> -		error_interrupt_offset);
> +	vnic_rq_init_start(rq, cq_index, 0, 0, error_interrupt_enable,
> +			   error_interrupt_offset);

ISTM that the two '0' arguments can be removed.

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ