[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#315235: marked as done (kernel: sending with MSG_MORE causes data-loss.)



Your message dated Mon, 17 Oct 2005 08:28:56 +0200
with message-id <20051017062855.GA19903@hogia.net>
and subject line Invalid report.
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 21 Jun 2005 10:20:04 +0000
>From sa@hogia.net Tue Jun 21 03:20:04 2005
Return-path: <sa@hogia.net>
Received: from fw.hogia.se (htdmailstd2.hogia.local) [62.95.76.2] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DkfrQ-00006A-00; Tue, 21 Jun 2005 03:20:04 -0700
Received: from gamegirl ([172.16.30.1]) by htdmailstd2.hogia.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 21 Jun 2005 12:20:00 +0200
Received: by hogia.net
	via sendmail from stdin
	id <m1DkfrM-003wnyC@gamegirl> (Debian Smail3.2.0.115)
	Tue, 21 Jun 2005 12:20:00 +0200 (CEST) 
Message-Id: <m1DkfrM-003wnyC@gamegirl>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Sebastian Andersson <sa@hogia.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: kernel: sending with MSG_MORE causes data-loss.
X-Mailer: reportbug 3.8
Date: Tue, 21 Jun 2005 12:20:00 +0200
X-OriginalArrivalTime: 21 Jun 2005 10:20:00.0284 (UTC) FILETIME=[C7DE9DC0:01C5764A]
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: kernel
Severity: minor


When sending data to an IPv4 tcp socket with the MSG_MORE flag
and there are data to be read from the socket, the sent data
is lost when the socket is closed.

How to test:

Compile this program and run it with a free tcp port as argument:
----------------------8<-----------------------
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <netdb.h>
#include <string.h>

int
main(int argc, char **argv)
{
    struct sockaddr_in socket_addr;
    int fd = socket(PF_INET, SOCK_STREAM, 0);
    socklen_t len = sizeof(socket_addr);
    int on = 1;

    setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof(on));
    memset(&socket_addr, 0, sizeof(socket_addr));
    socket_addr.sin_family = AF_INET;
    socket_addr.sin_port = htons(atoi(argv[1]));
    socket_addr.sin_addr.s_addr = INADDR_ANY;
    bind(fd, (struct sockaddr *) &socket_addr, sizeof(socket_addr));
    listen(fd, 1);
    fd = accept(fd, (struct sockaddr *) &socket_addr, &len);
    recv(fd, &on, 1, 0);
    send(fd, "HI ", 3, 0);
    send(fd, "THERE\r\n", 8, MSG_MORE);
    close(fd);
    sleep(5);
    return 0;
}
----------------------8<-----------------------

Connect to the port with telnet or netcat and send at least 2 bytes to it.

The client will be able to read "HI ", but the "THERE\r\n" part is lost.

I've also tested this on someone's localy compiled 2.4.26-k7-smp kernel
with the same result.


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.4.25-1-686-smp
Locale: LANG=sv_SE, LC_CTYPE=sv_SE (charmap=ISO-8859-1)

---------------------------------------
Received: (at 315235-done) by bugs.debian.org; 17 Oct 2005 06:29:30 +0000
>From sa@hogia.net Sun Oct 16 23:29:30 2005
Return-path: <sa@hogia.net>
Received: from phillip.hogia.net (smtp.hogia.net) [195.78.148.4] 
	by spohr.debian.org with smtp (Exim 3.36 1 (Debian))
	id 1EROV0-00007A-00; Sun, 16 Oct 2005 23:29:30 -0700
Received: (qmail 4560 invoked by uid 509); 17 Oct 2005 06:28:57 -0000
Date: Mon, 17 Oct 2005 08:28:56 +0200
From: Sebastian Andersson <sa@hogia.net>
To: 315235-done@bugs.debian.org
Subject: Invalid report.
Message-ID: <20051017062855.GA19903@hogia.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
Delivered-To: 315235-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02

The test program, and the error report is incorrect,
see http://bugzilla.kernel.org/show_bug.cgi?id=5437
for more info. (Short summary; a tcp stream that is closed when there
is more data to be read should not send out unsent data).



Reply to: