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: <20200901040753.GF1236603@ZenIV.linux.org.uk>
Date:   Tue, 1 Sep 2020 05:07:53 +0100
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Qian Cai <cai@....pw>
Cc:     Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
        syzkaller-bugs@...glegroups.com,
        syzbot <syzbot+61acc40a49a3e46e25ea@...kaller.appspotmail.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        tom.leiming@...il.com, paulmck@...nel.org
Subject: Re: splice: infinite busy loop lockup bug

On Mon, Aug 31, 2020 at 11:32:28PM -0400, Qian Cai wrote:

> I used a new debug patch but not sure how to capture without
> printk_ratelimited() because the call sites are large,

	if (!strcmp(current->comm, "bugger"))
		printk(KERN_ERR....
and call the binary you are running ./bugger...  And I'd slap such
printk into the beginning of iterate_iovec() as well, if not into
the entry of iov_iter_copy_from_user_atomic().  That BS value of
n must've come from somewhere; it should expand to 'bytes'.
What we have in the beginning is

	const struct iovec *iov;
	struct iovec v;
        size_t skip = i->iov_offset;
        size_t left;
        size_t wanted = bytes;

        iov = i->iov;

        __v.iov_len = min(bytes, iov->iov_len - skip);
        if (likely(__v.iov_len)) {
                __v.iov_base = iov->iov_base + skip;
                left = copyin((p += v.iov_len) - v.iov_len, v.iov_base, v.iov_len);
                __v.iov_len -= left;
                skip += __v.iov_len;
                bytes -= __v.iov_len;
        } else {
                left = 0;
	}

and something leaves you with bytes bumped to 22476968.  What was in that first
iovec?  Incidentally, what's in 'wanted'?  And...  Timestamps don't look like
that crap has come from generic_perform_write() - it's about 4 seconds later.

While we are at it, there are other users of iterate_all_kinds(), and some of them
can very well get large sizes; they are not copying anything (iov_iter_advance(),
for starters).  There that kind of values would be just fine; are you sure those
printks came from iov_iter_copy_from_user_atomic()?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ