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:   Tue, 17 Dec 2019 14:09:30 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     rahul.lakkireddy@...lsio.com
Cc:     netdev@...r.kernel.org, nirranjan@...lsio.com, vishal@...lsio.com,
        dt@...lsio.com
Subject: Re: [PATCH net] cxgb4: fix refcount init for TC-MQPRIO offload

From: Rahul Lakkireddy <rahul.lakkireddy@...lsio.com>
Date: Mon, 16 Dec 2019 19:54:02 +0530

> @@ -205,7 +205,11 @@ static int cxgb4_mqprio_alloc_hw_resources(struct net_device *dev)
>  			cxgb4_enable_rx(adap, &eorxq->rspq);
>  	}
>  
> -	refcount_inc(&adap->tc_mqprio->refcnt);
> +	if (!refcount_read(&adap->tc_mqprio->refcnt))
> +		refcount_set(&adap->tc_mqprio->refcnt, 1);
> +	else
> +		refcount_inc(&adap->tc_mqprio->refcnt);
> +

This is not correct.

You're bypassing the whole point of the refcount_t type which is to make sure
that code that initializes a new object explicitly calls refcount_set() and
that once the refcount goes to zero the object is freed or the refcount is
initialized again using refcount_set() or similar.

I'm not applying this, it's just papering around the real problem.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ