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]
Message-Id: <20081110.133515.130695626.davem@davemloft.net>
Date:	Mon, 10 Nov 2008 13:35:15 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	jianjun@...ux.org
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH] nets: fix problem of using lock

From: Jianjun Kong <jianjun@...ux.org>
Date: Thu, 6 Nov 2008 18:41:03 +0800

> net/core/skbuff.c: void skb_queue_purge(struct sk_buff_head *list)
> 
> This function should takes the the list lock, because the operation to
> this list shoule be atomic. And __skb_queue_purge()  (in
> include/linux/skbuff.c) real delete the buffers in the list.
> 
> Signed-off-by: Jianjun Kong <jianjun@...ux.org>

No, this function is fine.  skb_dequeue() takes the lock so
there cannot be any list corruption.

And this function is called in contexts where the caller knows
that no new packets can be added to the list (closing a socket,
shutting down a device, etc.)  And even if new packets could
appear, taking the lock over the entire function would not
help that problem.

In fact, I suspect that many if not all skb_queue_purge() callers
can be converted to use __skb_queue_purge().
--
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