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-next>] [day] [month] [year] [list]
Date:   Mon, 4 Jun 2018 21:53:53 -0700
From:   shankarapailoor <shankarapailoor@...il.com>
To:     davem@...emloft.net
Cc:     linux-kernel@...r.kernel.org, syzkaller@...glegroups.com,
        netdev@...r.kernel.org
Subject: general protection fault in sockfs_setattr

Hi,

I have been fuzzing Linux 4.17-rc7 with Syzkaller and found the
following crash: https://pastebin.com/ixX3RB9j

Syzkaller isolated the cause of the bug to the following program:

socketpair$unix(0x1, 0x1, 0x0,
&(0x7f0000000000)={<r0=>0xffffffffffffffff, <r1=>0xffffffffffffffff})
getresuid(&(0x7f0000000080)=<r2=>0x0, &(0x7f00000000c0),
&(0x7f0000000700))r3 = getegid()
fchownat(r0, &(0x7f0000000040)='\x00', r2, r3, 0x1000)
dup3(r1, r0, 0x80000)


The problematic area appears to be here:

static int sockfs_setattr(struct dentry *dentry, struct iattr *iattr)
{
    int err = simple_setattr(dentry, iattr);

    if (!err && (iattr->ia_valid & ATTR_UID)) {
         struct socket *sock = SOCKET_I(d_inode(dentry));

         sock->sk->sk_uid = iattr->ia_uid; //KASAN GPF
    }
    return err;
}

If dup3 is called concurrently with fchownat then can sock->sk be NULL?

-- 
Regards,
Shankara Pailoor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ