Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1274224

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:)

From Rainer Weikusat <rweikusat@mobileactivedefense.com>
Newsgroups linux.kernel
Subject Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:)
Date 2015-11-20 17:30 +0100
Message-ID <qwWJs-1a6-13@gated-at.bofh.it> (permalink)
References (9 earlier) <qurJM-1FS-9@gated-at.bofh.it> <qvAhX-4Jx-7@gated-at.bofh.it> <qvArE-4ME-13@gated-at.bofh.it> <qwHho-7Oe-13@gated-at.bofh.it> <qwWq6-11X-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Jason Baron <jbaron@akamai.com> writes:
> On 11/19/2015 06:52 PM, Rainer Weikusat wrote:
>
> [...]
>
>> @@ -1590,21 +1718,35 @@ restart:
>>  			goto out_unlock;
>>  	}
>>  
>> -	if (unix_peer(other) != sk && unix_recvq_full(other)) {
>> -		if (!timeo) {
>> +	if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) {
>> +		if (timeo) {
>> +			timeo = unix_wait_for_peer(other, timeo);
>> +
>> +			err = sock_intr_errno(timeo);
>> +			if (signal_pending(current))
>> +				goto out_free;
>> +
>> +			goto restart;
>> +		}
>> +
>> +		if (unix_peer(sk) != other ||
>> +		    unix_dgram_peer_wake_me(sk, other)) {
>>  			err = -EAGAIN;
>>  			goto out_unlock;
>>  		}
>
> Hi,
>
> So here we are calling unix_dgram_peer_wake_me() without the sk lock the first time
> through - right?

Yes. And this is obviously wrong. I spend most of the 'evening time'
(some people would call that 'night time') with testing this and didn't
get to read through it again yet. Thank you for pointing this out. I'll
send an updated patch shortly.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-16 23:20 +0100
  Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-16 23:30 +0100
    Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/  Fixes:) Jason Baron <jbaron@akamai.com> - 2015-11-17 17:20 +0100
    Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/  Fixes:) David Miller <davem@davemloft.net> - 2015-11-17 21:20 +0100
      Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-17 22:40 +0100
        Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-17 23:20 +0100
          Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-20 00:50 +0100
        Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-17 23:50 +0100
      Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-18 19:20 +0100
        more statistics (was: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:)) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-19 00:50 +0100
    Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-20 01:00 +0100
      Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/  Fixes:) Jason Baron <jbaron@akamai.com> - 2015-11-20 17:10 +0100
        Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue (w/ Fixes:) Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-20 17:30 +0100
      Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-20 23:10 +0100
        Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue Jason Baron <jbaron@akamai.com> - 2015-11-23 17:30 +0100
        Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue David Miller <davem@davemloft.net> - 2015-11-23 18:40 +0100
          Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-23 22:40 +0100
            Re: [PATCH] unix: avoid use-after-free in ep_remove_wait_queue Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2015-11-24 00:10 +0100

csiph-web