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: <C8NH7QWZG2CR.3RT2AKK0ESMYE@oguc>
Date:   Wed, 20 Jan 2021 11:09:18 +1300
From:   "Oliver Giles" <ohw.giles@...il.com>
To:     "Robert Karszniewicz" <r.karszniewicz@...tec.de>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        "Linus Torvalds" <torvalds@...ux-foundation.org>
Cc:     "Christoph Hellwig" <hch@....de>,
        "Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
        "Al Viro" <viro@...iv.linux.org.uk>,
        "Jiri Slaby" <jirislaby@...nel.org>
Subject: Re: Splicing to/from a tty

On Wed Jan 20, 2021 at 5:56 AM NZDT, Robert Karszniewicz wrote:
>
> I have bisected this issue down to this commit:
> 4d03e3cc5982 ("fs: don't allow kernel reads and writes without iter
> ops")
>
> Another case I've also noticed is writing to a serial connection:
> kernel write not supported for file /ttymxc0 (pid: 252 comm: cat)
>

Tangentially, I hit the same thing when hacking on this. Here's a diff
making the implementation match the comment:

--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -541,7 +541,7 @@ ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t
         * Also fail if ->write_iter and ->write are both wired up as that
         * implies very convoluted semantics.
         */
-       if (unlikely(!file->f_op->write_iter || file->f_op->write))
+       if (unlikely(file->f_op->write_iter && file->f_op->write))
                return warn_unsupported(file, "write");
 
        init_sync_kiocb(&kiocb, file);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ