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]
Message-ID: <CA+55aFzJjk8vvY7au-aUOJqJaRaFT3zqP0_H9JXS2Y93wkXwEg@mail.gmail.com>
Date:	Sun, 29 Apr 2012 11:29:16 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Michael Tokarev <mjt@....msk.ru>
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Thomas Meyer <thomas@...3r.de>,
	David Miller <davem@...emloft.net>,
	linux-kernel@...r.kernel.org, autofs@...r.kernel.org,
	raven@...maw.net, stable@...nel.org
Subject: Re: [PATCH v2] Introduce a version6 of autofs interface, to fix
 design error.

On Sun, Apr 29, 2012 at 12:45 AM, Michael Tokarev <mjt@....msk.ru> wrote:
> On 29.04.2012 11:19, Linus Torvalds wrote:
>>
>> Gaah, it should, but it won't.
>>
>> I bet my original patch worked fine, because the pipe has only one
>> inode and pipe structure. But it has *two* 'struct file's associated
>> with it, and autofs only ever sees the writing side, and never gets to
>> mark the reading side O_DIRECT. So yeah, the reading side won't do the
>> proper packetized read.
>
> Can't we go - in kernel - from one struct file to pipe structure to
> another file structure and set O_DIRECT there?  Autofs kernel code
> checks if the file descriptor is a pipe, so it should be possible...

Nope. We don't have any back-pointers to the other "struct file". They
have the inode - and the "struct pipe_inode_info" in common, but
there's no way to find the other "struct file" from that.

And sure, a pipe in Linux could work with a single read-write "struct
file" that is used both for the reading and writing, but that's not
how the "pipe()" system call is defined - it gets two separate file
descriptors, one read-only, one write-only. So that's what autofs and
systemd hands the kernel - the write side of the pipe. And we can't
find the read-side one.

But I think I have another approach. We can make the *writer* be the
only one that cares about the packetized nature, and if it's a packet
write, it will set a PIPE_BUF_PACKET flag in the pipe buffer. The
reader can react to that. I think that actually has the potential to
make the code a bit prettier too..

I'll cook it up.

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