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:	Wed, 08 Jan 2014 01:01:40 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	yuvalmin@...adcom.com
Cc:	netdev@...r.kernel.org, dmitry@...adcom.com, ariele@...adcom.com
Subject: Re: [PATCH net] bnx2x: prevent WARN during driver unload

From: Yuval Mintz <yuvalmin@...adcom.com>
Date: Wed, 8 Jan 2014 05:41:48 +0000

>> 
>> > +	fp->state &= BNX2X_FP_STATE_DISABLED;
>>  ...
>> > +	fp->state &= BNX2X_FP_STATE_DISABLED;
>> 
>> Surely you mean "&= ~BNX2X_FP_STATE_DISABLED" here?
> 
> Thought the comment above the code was sufficient to show 
> this is intentional.
> 
> The BNX2X_FP_STATE_DISABLED will cause BNX@...P_LOCKED to
> Be true. The bnx2x_fp_ll_disable() works by setting this bit even
> when BNX2X_FP_OWNED is set; while other flows release the lock
> the will clear the bit indications except for the disabled indication,
> so that no other flow could take the lock after it was disabled,
> and the loop of bnx2x_fp_ll_disable() calls will eventually return true.

This bit handling is completely unintuitive.

The way a boolean state works is you manage it by setting it when
a condition arises, and clear it when a condition goes away.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists