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]
Date:	Wed, 26 Sep 2007 10:17:19 -0700
From:	Rick Jones <rick.jones2@...com>
To:	Herbert Xu <herbert@...dor.apana.org.au>
Cc:	Stephen Hemminger <shemminger@...ux-foundation.org>,
	netdev@...r.kernel.org
Subject: Re: [RFC] Zero-length write() does not generate a datagram on	connected
 socket

Herbert Xu wrote:
> Stephen Hemminger <shemminger@...ux-foundation.org> wrote:
> 
>>The bug http://bugzilla.kernel.org/show_bug.cgi?id=5731
>>describes an issue where write() can't be used to generate a zero-length
>>datagram (but send, and sendto do work).
>>
>>I think the following is needed:
>>
>>--- a/net/socket.c      2007-08-20 09:54:28.000000000 -0700
>>+++ b/net/socket.c      2007-09-24 15:31:25.000000000 -0700
>>@@ -777,8 +777,11 @@ static ssize_t sock_aio_write(struct kio
>>       if (pos != 0)
>>               return -ESPIPE;
>>
>>-       if (iocb->ki_left == 0) /* Match SYS5 behaviour */
>>-               return 0;
>>+       if (unlikely(iocb->ki_left == 0)) {
>>+               struct socket *sock = iocb->ki_filp->private_data;
>>+               if (sock->type == SOCK_STREAM)
>>+                       return 0;
>>+       }
> 
> 
> I'm not sure whether all STREAM protocols treat zero-length
> sends as no-ops.  What about SCTP?

I asked Vlad that very question, since SCTP can preserve message 
boundaries. He tells me that a zero-length message is not part of SCTP.

rick jones
-
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