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: <1327431098.4131.6.camel@localhost>
Date:	Tue, 24 Jan 2012 13:51:38 -0500
From:	Eric Paris <eparis@...hat.com>
To:	Mimi Zohar <zohar@...ux.vnet.ibm.com>
Cc:	linux-security-module@...r.kernel.org,
	Al Viro <viro@...iv.linux.org.uk>,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Mimi Zohar <zohar@...ibm.com>
Subject: Re: [PATCH v1] vfs: fix IMA lockdep circular locking dependency

On Tue, 2012-01-24 at 13:40 -0500, Mimi Zohar wrote:
> On Tue, 2012-01-24 at 12:45 -0500, Eric Paris wrote:
> > On Tue, 2012-01-24 at 12:34 -0500, Mimi Zohar wrote:
> > > The circular lockdep is caused by allocating the 'iint' for mmapped
> > > files.  Originally when an 'iint' was allocated for every inode
> > > in inode_alloc_security(), before the inode was accessible, no
> > > locking was necessary.  Commits bc7d2a3e and 196f518 changed this
> > > behavior and allocated the 'iint' on a per need basis, resulting in
> > > the mmap_sem being taken before the i_mutex for mmapped files.
> > > 
> > > Possible unsafe locking scenario:
> > >        CPU0                    CPU1
> > >        ----                    ----
> > > lock(&mm->mmap_sem);
> > >                               lock(&sb->s_type->i_mutex_key);
> > >                               lock(&mm->mmap_sem);
> > > lock(&sb->s_type->i_mutex_key);
> > > 
> > > The existing security_file_mmap() hook is after the mmap_sem is taken.
> > > This patch moves the ima_file_mmap() call from security_file_mmap() to
> > > prior to the mmap_sem being taken.
> > > 
> > > Changelog v1:
> > > - Instead of just pre-allocating the iint in a new hook, do ALL of the
> > > work in the new/moved ima_file_mmap() hook. (Based on Eric Paris' suggestion.)
> > > - Removed do_mmap_with_sem() helper function.
> > > - export ima_file_mmap()
> > 
> > Why does it need to be exported?  What module might call this?
> 
> Without it, I'm getting:
> 
> Kernel: arch/x86/boot/bzImage is ready  (#246)
> ERROR: "ima_file_mmap" [arch/x86/ia32/ia32_aout.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2

Ok, that's what I was wondering (and guessing).  Sorry!

Acked-by: Eric Paris <eparis@...hat.com>

--
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