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: <20130415191304.GC30583@redhat.com>
Date:	Mon, 15 Apr 2013 15:13:05 -0400
From:	Vivek Goyal <vgoyal@...hat.com>
To:	Michel Lespinasse <walken@...gle.com>
Cc:	linux kernel mailing list <linux-kernel@...r.kernel.org>,
	Hugh Dickins <hughd@...gle.com>,
	Rik van Riel <riel@...hat.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: 3.9-rc5: Encountedred INFO: rcu_sched self-detected stall on CPU
 due to 09a9f1d27

On Mon, Apr 15, 2013 at 01:59:29PM -0400, Vivek Goyal wrote:
> CCing akpm.
> 
> Vivek
> 
> On Mon, Apr 15, 2013 at 01:34:24PM -0400, Vivek Goyal wrote:
> > On Mon, Apr 15, 2013 at 12:35:52PM -0400, Vivek Goyal wrote:
> > 
> > [..]
> > > > My first guess would be that mmap_sem is held during exec, so you
> > > > can't have __mm_populate() try holding it recursively.
> > > 
> > > I think it is not mmap_sem as even with VM_LOCKED, we take mmap_sem
> > > and things are fine. 
> > > 
> > > So things work till 3.8 and break in 3.8-rc1 (with both VM_LOCKED and
> > > VM_POPULATE specifed). I will do git bisect and try to figure out which
> > > is first commit which has the issue.
> > 
> > Ok, following seems to be first bad commit.
> > 
> > commit bebeb3d68b24bb4132d452c5707fe321208bcbcd
> > Author: Michel Lespinasse <walken@...gle.com>
> > Date:   Fri Feb 22 16:32:37 2013 -0800
> > 
> >     mm: introduce mm_populate() for populating new vmas
> > 

Michel,

An interesting observation. After this commit looks like simple
mmap(MAP_LOCKED) of a file was broken and it would hang and give RCU stall
warning similar to my patch of locking /sbin/kexec.

But in latest kernel mmap(MAP_LOCKED) does not hang. So looks like
this problem got fixed in a patch after this first bad commit. But
locking /sbin/kexec issue still remains.

I used following test program to map a arbitray file.

Thanks
Vivek


#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <keyutils.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <attr/xattr.h>
#include <unistd.h>
#include <sys/syscall.h>

main(int argc, char *argv[])
{
	char *filename = argv[1];
	int fd, ret;
	void *file_addr, *data_addr;
	struct stat stats;
	ssize_t sig_sz;
	void *sig;

	if (argc != 2) {
		fprintf(stderr, "Enter file name\n");	
		exit(1);
	}

	fd = open(filename, O_RDONLY);
	if (fd == -1) {
		fprintf(stderr, "Open of file %s failed:%s\n", filename,
					strerror(errno));
		exit(1);
	}

	ret = fstat(fd, &stats);
	if (ret == -1) {
		fprintf(stderr, "fstat of file %s failed:%s\n", filename,
				strerror(errno));
		exit(1);
	}

	file_addr = mmap(NULL, stats.st_size, PROT_READ, MAP_PRIVATE | MAP_LOCKED, fd, 0);

	if (file_addr == MAP_FAILED) {
		fprintf(stderr, "mmap() failed:%s\n", strerror(errno));
		exit(1);
	}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ