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:	Tue, 31 Mar 2015 22:30:09 +0200
From:	Oliver Hartkopp <socketcan@...tkopp.net>
To:	Marc Kleine-Budde <mkl@...gutronix.de>, linux-can@...r.kernel.org
CC:	netdev@...r.kernel.org
Subject: Re: [PATCH RFC v2 2/2] can: introduce new raw socket option to join
 the given CAN filters

On 31.03.2015 14:36, Marc Kleine-Budde wrote:
> On 03/29/2015 08:09 PM, Oliver Hartkopp wrote:


>> @@ -128,10 +130,20 @@ static void raw_rcv(struct sk_buff *oskb, void *data)
>>   	/* eliminate multiple filter matches for the same skb */
>>   	if (*this_cpu_ptr(ro->uniq_skb) == oskb &&
>>   	    ktime_equal(*this_cpu_ptr(ro->uniq_tstamp), oskb->tstamp)) {
>> +		if (ro->join_filters) {
>> +			this_cpu_inc(*ro->join_rx_count);
>> +			/* drop frame until all enabled filters matched */
>> +			if (*this_cpu_ptr(ro->join_rx_count) < ro->count)
>
> Can we be sure, that all skbs are processed on the same CPU? So that
> it's sufficient to just compare the "ro->join_rx_count" of this CPU with
> "ro->count" (or do we have to use join_rx_count of all CPUs?)
>

No, that's exactly the point that the single CAN frame skb is processed inside 
the softirq by one CPU. And we count only for this specific skb here.

The next frame which is processed in raw_rcv() might use another CPU while 
executing the NET_RX softirq.

>> +				return;
>> +		} else
>>   			return;
>
> nitpick: please use { } on both sides of the else.
>

fixed in v3

Regards,
Oliver


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ