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


Groups > linux.kernel > #1332736

Re: [PATCH] af_unix: Don't set err in unix_stream_read_generic unless there was an error

From Rainer Weikusat <rweikusat@mobileactivedefense.com>
Newsgroups linux.kernel
Subject Re: [PATCH] af_unix: Don't set err in unix_stream_read_generic unless there was an error
Date 2016-02-12 14:40 +0100
Message-ID <r1m70-7DG-7@gated-at.bofh.it> (permalink)
References <qYTLQ-3XC-11@gated-at.bofh.it> <qYXcJ-6kF-15@gated-at.bofh.it> <r177Y-63k-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Joseph Salisbury <joseph.salisbury@canonical.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.

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


Thread

Re: [PATCH] af_unix: Don't set err in unix_stream_read_generic unless  there was an error Joseph Salisbury <joseph.salisbury@canonical.com> - 2016-02-11 22:40 +0100
  Re: [PATCH] af_unix: Don't set err in unix_stream_read_generic unless there was an error Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2016-02-12 14:40 +0100

csiph-web