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>] [day] [month] [year] [list]
Date:	Fri, 20 Jun 2008 15:04:35 -0400
From:	Ezra Kissel <kissel@....udel.edu>
To:	linux-kernel@...r.kernel.org
Subject: network socket receive splice size

I am using the splice syscall in kernel 2.6.25.4 with network socket 
receive to splice incoming and outgoing TCP sockets. I perform something 
like the following:

#define SPLICE_SIZE (12*1024)

int fd[2];
ret = pipe(fd);

ret = splice(src, NULL, fd[1], NULL, SPLICE_SIZE, SPLICE_F_MORE | 
SPLICE_F_MOVE);

bytes_left = ret;

while (bytes_left > 0) {
   ret = splice(fd[0], NULL, sink, NULL, bytes_left, SPLICE_F_NONBLOCK);
   bytes_left -= ret;
}

This works well when SPLICE_SIZE is around 12K or lower, but anything 
much more than that will cause the src splice call to block either right 
away or after a few iterations. It almost seems as though the pipe 
buffer is becoming full although I have used poll to check for both 
sockets and pipe fds before calling splice, and the sink splice call 
always sends the current number of bytes. I have also tried virtually 
all combinations of the SPLICE_F_ options without success. Has anyone 
run into a similar issue with socket-to-socket splicing and larger 
splice sizes? I would really like to use the full 64K splice size to and 
from the pipe.

I should mention that the splice test applications do work correctly 
with 64K splice sizes when splicing to/from a network socket(s) to 
STDOUT or STDIN. Any thoughts?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ