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
| ||
|
Date: Thu, 05 Dec 2013 07:05:52 -0800 From: Eric Dumazet <eric.dumazet@...il.com> To: Hannes Frederic Sowa <hannes@...essinduktion.org> Cc: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org> Subject: Re: [PATCH net-next] net: introduce dev_consume_skb_any() On Thu, 2013-12-05 at 06:45 -0800, Eric Dumazet wrote: > On Thu, 2013-12-05 at 15:13 +0100, Hannes Frederic Sowa wrote: > > On Thu, Dec 05, 2013 at 04:45:08AM -0800, Eric Dumazet wrote: > > > - local_irq_save(flags); > > > - sd = &__get_cpu_var(softnet_data); > > > - skb->next = sd->completion_queue; > > > - sd->completion_queue = skb; > > > - raise_softirq_irqoff(NET_TX_SOFTIRQ); > > > - local_irq_restore(flags); > > > + if (likely(atomic_read(&skb->users) == 1)) { > > > + smp_rmb(); > > > > Could you give me a hint why this barrier is needed? IMHO the volatile > > access in atomic_read should get rid of the control dependency so I > > don't see a need for this barrier. Without the volatile access a > > compiler-barrier would still suffice, I guess? > > Please take a look at kfree_skb() implementation. > > If you think a comment is needed there, please feel free to add it. > My understanding of this (old) barrier here is an implicit wmb in skb_get() This probably needs something like : static inline struct sk_buff *skb_get(struct sk_buff *skb) { smp_mb__before_atomic_inc(); /* check {consume|kfree}_skb() */ atomic_inc(&skb->users); } -- 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