Thread (35 messages) 35 messages, 7 authors, 2011-09-28

Re: [PATCH net-next v3] af_unix: Fix use-after-free crashes

flat view

From: Tim Chen <hidden>
Date: 2011-09-08 15:37:47

On Thu, 2011-09-08 at 15:21 +0200, Eric Dumazet wrote:
Le jeudi 08 septembre 2011 à 11:59 +0200, Sedat Dilek a écrit :
quoted
I have tested this fixup patch on i386.
Can we have a separate patch with corrected descriptive text?

Thanks to all involved people.
Here it is :

[PATCH net-next v3] af_unix: Fix use-after-free crashes

Commit 0856a30409 (Scm: Remove unnecessary pid & credential references
in Unix socket's send and receive path) introduced an use-after-free
bug.

We are allowed to steal the references to pid/cred only in the last skb
sent from unix_stream_sendmsg(), because first skbs might be consumed by
the receiver before we finish our sendmsg() call.

Remove scm_release() helper, since its cleaner to clear pid/cred fields
in unix_scm_to_skb() when we steal them.

Based on prior patches from Yan Zheng and Tim Chen

Signed-off-by: Eric Dumazet <redacted>
Reported-by: Jiri Slaby <redacted>
Tested-by: Sedat Dilek <redacted>
Tested-by: Valdis Kletnieks <redacted>
---
Thanks.

Acked-by: Tim Chen <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help