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: <20100110.135135.237364018.davem@davemloft.net>
Date:	Sun, 10 Jan 2010 13:51:35 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	jarkao2@...il.com
Cc:	mbreuer@...jas.com, shemminger@...tta.com,
	akpm@...ux-foundation.org, flyboy@...il.com,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-2.6 resent] af_packet: Don't use skb after
 dev_queue_xmit()

From: Jarek Poplawski <jarkao2@...il.com>
Date: Sat, 9 Jan 2010 13:38:27 +0100

> tpacket_snd() can change and kfree an skb after dev_queue_xmit(),
> which is illegal.
> 
> With debugging by: Stephen Hemminger <shemminger@...tta.com>
> 
> Reported-by: Michael Breuer <mbreuer@...jas.com>
> Tested-by: Michael Breuer <mbreuer@...jas.com>
> Signed-off-by: Jarek Poplawski <jarkao2@...il.com>
> Acked-by: Stephen Hemminger <shemminger@...tta.com>

Jarek, if this code path triggers, it will deadlock the
send ring with your changes.

We will now leave the ring packet status in the "SENDING" state.

That's not right.

Then, if the application calls send again, we will just return
immediately since we only make progress if the head ring entry is in
SEND_REQUEST state.

This is really bogus behavior.  When the qdisc or mid-layer
drops the packet, we should at least mark the packet state
properly (which is what the current code would does, sans
the "reference SKB after dev_queue_xmit()" issue).  And
advance the packet ring pointer.

This way the user:

1) can see that the packet got dropped and couldn't be sent

2) can call send again to try sending the rest of the ring

Fix the use after dev_queue_xmit() issue, but don't change other side
effects which are important for correct AF_PACKET TX ring semantics.
--
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