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:	Mon, 26 Mar 2012 15:56:14 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Erik Hugne <erik.hugne@...csson.com>
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [Question] Kernel preemption of BH handler

On Mon, 2012-03-26 at 11:20 +0200, Erik Hugne wrote:
> I have a BH handler that processes packets received from a netdevice.
> 
> my_bh_handler() {
>    spin_lock_bh(my_lock);
>    /*do stuff*/
>    spin_unlock_bh(my_lock);
>    /*do more stuff*/
> }

spin_lock_bh() means 'spin lock with contending soft-interrupts' and not
'spin lock from a soft-interrupt'.  You probably need to use it in
process context but not here.

> First packet is received, and my_bh_handler() is currently processing it.
> Now a new packet is received by the NIC and my_bh_handler() is preempted 
> after my_lock have been released.

You don't explain how this handler is invoked, but normally it would be
scheduled to run a second time and would not preempt the first call.

Ben.

> Is it possible that the second invocation of the BH routine is allowed 
> to finish before the first?

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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