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, 22 May 2013 16:28:40 -0700
From:	Ben Greear <greearb@...delatech.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	netdev <netdev@...r.kernel.org>
Subject: Re: question on pktgen shutdown logic.

On 05/22/2013 04:22 PM, Eric Dumazet wrote:
> On Wed, 2013-05-22 at 16:15 -0700, Ben Greear wrote:
>> While looking at pktgen.c in 3.9.3, I cannot explain how
>> it does not race on shutdown.
>>
>> The thread worker checks for pktgen_exiting, and will bail out
>> of it's main loop and initiate cleanup if this is true.
>>
>> The pg_net_exit sets the pktgen_exiting to true, and then
>> proceedes to call
>>
>> 		kthread_stop(t->tsk);
>> 		kfree(t);
>>
>> What I don't understand is what keeps the kfree(t) from happening
>> before the thread has noticed pktgen_exiting is set and properly
>> bailed out of it's loop and finished cleanup?
>
> kthread_stop() is synchronous.

Ahh, so it waits for the pktgen_thread_worker method to return?

Why do we bother with the pktgen_exiting flag at all...it
would seem that just checking kthread_should_stop() would
do the trick?

Thanks,
Ben

-- 
Ben Greear <greearb@...delatech.com>
Candela Technologies Inc  http://www.candelatech.com

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