[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871t8ivyv3.fsf@doppelsaurus.mobileactivedefense.com>
Date: Fri, 12 Feb 2016 13:31:44 +0000
From: Rainer Weikusat <rweikusat@...ileactivedefense.com>
To: Joseph Salisbury <joseph.salisbury@...onical.com>
Cc: Rainer Weikusat <rweikusat@...ileactivedefense.com>,
"davem\@davemloft.net" <davem@...emloft.net>,
hannes@...essinduktion.org, edumazet@...gle.com,
dhowells@...hat.com, ying.xue@...driver.com,
"netdev\@vger.kernel.org" <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
"stable\@vger.kernel.org" <stable@...r.kernel.org>,
Tim Gardner <tim.gardner@...onical.com>
Subject: Re: [PATCH] af_unix: Don't set err in unix_stream_read_generic unless there was an error
Joseph Salisbury <joseph.salisbury@...onical.com> writes:
> On 02/05/2016 05:30 PM, Rainer Weikusat wrote:
>> The present unix_stream_read_generic contains various code sequences of
>> the form
>>
>> err = -EDISASTER;
>> if (<test>)
>> goto out;
[...]
>> Change it such that err is only set if an error condition was detected.
[...]
> I tested your patch, Rainer. I can confirm that it fixes the reported
> bug[0].
This is only a partial fix: The launchpad test case will no longer fail
with EOPNOTSUPP and it will actually receive the credentials because the
message they're attached to was available by the time of the
recvmsg. But if this isn't the case, ie, if the receiver has to wait for
a message, the continue in the do { } while (size) loop will cause the
loop to be terminated without copying the credential information as the
continue will cause the size (of the remaining 'receive area' which is
zero for this case) to be checked before any of the other loop code is
executed again.
I posted a test case for this and a patch addressing that elsewhere in
this thread.
Powered by blists - more mailing lists