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: <f134c4ff-aac0-eb79-871e-73cff18a57c8@embeddedor.com>
Date:   Wed, 19 Oct 2022 00:58:50 -0500
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     Kees Cook <keescook@...omium.org>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc:     Kalle Valo <kvalo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
        linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-hardening@...r.kernel.org
Subject: Re: [PATCH 6/6][next] airo: Avoid clashing function prototypes



On 10/17/22 21:53, Kees Cook wrote:
> On Mon, Oct 17, 2022 at 03:36:20PM -0500, Gustavo A. R. Silva wrote:
>> [...]
>> @@ -6312,16 +6326,16 @@ static int airo_get_mode(struct net_device *dev,
>>   	/* If not managed, assume it's ad-hoc */
>>   	switch (local->config.opmode & MODE_CFG_MASK) {
>>   		case MODE_STA_ESS:
>> -			*uwrq = IW_MODE_INFRA;
>> +			uwrq->mode = IW_MODE_INFRA;
>>   			break;
>>   		case MODE_AP:
>> -			*uwrq = IW_MODE_MASTER;
>> +			uwrq->mode = IW_MODE_MASTER;
>>   			break;
>>   		case MODE_AP_RPTR:
>> -			*uwrq = IW_MODE_REPEAT;
>> +			uwrq->mode = IW_MODE_REPEAT;
>>   			break;
>>   		default:
>> -			*uwrq = IW_MODE_ADHOC;
>> +			uwrq->mode = IW_MODE_ADHOC;
>>   	}
>>   
>>   	return 0;
> 
> Sometimes you use the union directly, sometimes not. What was your
> heuristic for that?

Oh it is just that I had previously used a new variable in function airo_set_mode(),
and then I immediately ran into this similar scenario (function airo_get_mode) and
I said "wait a second, why don't I directly use the union, instead? :thinking_face:"
and I did, and moved on. :P

> 
> Regardless, looks good!
> 
> Reviewed-by: Kees Cook <keescook@...omium.org>
> 

Thanks for this!

BTW, I already have a new series (this time a 4-patch series, instead of 6), with
the latest fixes, here:

https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=6.1-rc1-Wcast-function-type-strict

I think we could quickly review it tomorrow before I send it out. :)

--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ