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: <20201114205000.GP3576660@ZenIV.linux.org.uk>
Date:   Sat, 14 Nov 2020 20:50:00 +0000
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Nathan Chancellor <natechancellor@...il.com>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Christoph Hellwig <hch@....de>,
        Greg KH <gregkh@...uxfoundation.org>,
        Alexey Dobriyan <adobriyan@...il.com>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
        wei.liu@...nel.org, linux-hyperv@...r.kernel.org
Subject: Re: [PATCH 1/6] seq_file: add seq_read_iter

On Sat, Nov 14, 2020 at 07:00:25AM +0000, Al Viro wrote:
> On Fri, Nov 13, 2020 at 11:19:34PM -0700, Nathan Chancellor wrote:
> 
> > Assuming so, I have attached the output both with and without the
> > WARN_ON. Looks like mountinfo is what is causing the error?
> 
> Cute...  FWIW, on #origin + that commit with fix folded in I don't
> see anything unusual in reads from mountinfo ;-/  OTOH, they'd
> obviously been... creative with readv(2) arguments, so it would
> be very interesting to see what it is they are passing to it.
> 
> I'm half-asleep right now; will try to cook something to gather
> that information tomorrow morning.  'Later...

OK, so let's do this: fix in seq_read_iter() + in do_loop_readv_writev()
(on entry) the following (racy as hell, but will do for debugging):

	bool weird = false;

	if (unlikely(memcmp(file->f_path.dentry->d_name.name, "mountinfo", 10))) {
		int i;

		for (i = 0; i < iter->nr_segs; i++)
			if (!iter->iov[i].iov_len)
				weird = true;
		if (weird) {
			printk(KERN_ERR "[%s]: weird readv on %p4D (%ld) ",
				current->comm, filp, (long)filp->f_pos);
			for (i = 0; i < iter->nr_segs; i++)
				printk(KERN_CONT "%c%zd", i ? ':' : '<',
					iter->iov[i].iov_len);
			printk(KERN_CONT "> ");
		}
	}
and in the end (just before return)
	if (weird)
		printk(KERN_CONT "-> %zd\n", ret);

Preferably along with the results of cat /proc/<whatever it is>/mountinfo both
on that and on the working kernel...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ