Re: netfilter hooks context?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 2012-10-19 18:38, Iain Fraser wrote:

>After reading [A Map of the Networking Code in Linux Kernel 2.4.20]
>and thinking about it. It seems to me that packets coming from the
>host will often be in process context e.g. UDP packets will be
>generated for each sendto syscall. So packets in the localout and
>postrouing could potentially be in run in process context.

Indeed.

>Therefore spin locks in those hooks should disable bottom halves to be
>safe from deadlock. Can anyone confirm or invalidate this please?

According to Rusty's Unrealiable Guide To Locking, spin_lock_bh type 
locking is appropriate in your case.

http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/c214.html#AEN235
[note this is old, and for example does not contain the "mutex" type 
lock]
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux