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] [day] [month] [year] [list]
Message-ID: <yt9dblh2sp1t.fsf@linux.ibm.com>
Date:   Fri, 16 Oct 2020 07:44:14 +0200
From:   Sven Schnelle <svens@...ux.ibm.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     Krzysztof Kozlowski <krzk@...nel.org>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Christoph Hellwig <hch@...radead.org>,
        linux-kernel@...r.kernel.org,
        Linux-Next Mailing List <linux-next@...r.kernel.org>,
        "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>
Subject: Re: autofs crash with latest linux-next

Kees Cook <keescook@...omium.org> writes:

> On Wed, Oct 14, 2020 at 09:15:47AM +0200, Krzysztof Kozlowski wrote:
>> I hit this since few days as well. Although the bisect points to the
>> merge, the issue looks like a result of mentioned commit 4d03e3cc5982
>> ("fs: don't allow kernel reads and writes without iter ops").
>> 
>> The __kernel_read() last argument 'pos' can be NULL and it is
>> dereferenced here (added by the commit):
>> 
>>  525 ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
>> ...
>>  547         kiocb.ki_pos = *pos;
>>  548         iov_iter_kvec(&iter, WRITE, &iov, 1, iov.iov_len);
>> 
>> 
>> The __kernel_read() is called with NULL in fs/autofs/waitq.c:
>> 
>>  45 static int autofs_write(struct autofs_sb_info *sbi,
>>  46                         struct file *file, const void *addr, int bytes)
>> 
>> ...
>>  54         mutex_lock(&sbi->pipe_mutex);
>>  55         while (bytes) {
>>  56                 wr = __kernel_write(file, data, bytes, NULL);
>
> I think the thread here is the same thing, but you've found it in
> autofs...
> https://lore.kernel.org/lkml/CAHk-=wgj=mKeN-EfV5tKwJNeHPLG0dybq+R5ZyGuc4WeUnqcmA@mail.gmail.com/

Indeed. Thanks, missed that.

Sven

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ