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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 22 Apr 2009 23:15:07 +0100 (BST)
From:	Mark Hills <mark@...o.org.uk>
To:	linux-kernel@...r.kernel.org
Subject: splice() on unix sockets

I found that splice() can operate from a pipe to a unix socket, but from a 
unix socket to a pipe fails with EINVAL.

On investigation, splicing from a pipe to a unix socket (af_unix.c) gets 
routed through a regular unix_stream_sendmsg (via sock_no_sendpage). If my 
understanding is correct this means it will copy memory and not 
references, so it's not actually a splice.

If so, splice() behaves inconsistently; sometimes it fails on unsupported 
file descriptors, sometimes it falls back to a copy. The man page favours 
the former, but the latter could also be useful -- to call splice() with 
any pair of fds and have the kernel do the best it can.

Splicing between unix sockets and pipes would give a useful performance 
benefit. Is there any work in progress on this? Are there any caveats to 
implementing it?

Thanks,

-- 
Mark
--
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