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]
Date:	Thu, 5 Jun 2014 21:56:10 -0400
From:	Dave Jones <davej@...hat.com>
To:	Mimi Zohar <zohar@...ux.vnet.ibm.com>
Cc:	"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	linux-mm@...ck.org, Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: ima_mmap_file returning 0 to userspace as mmap result.

On Thu, Jun 05, 2014 at 09:49:29PM -0400, Mimi Zohar wrote:
 
 > >  >  > > There's no mention of this return value in the man page, so I dug
 > >  >  > > into the kernel code, and it appears that we do..
 > >  >  > > 
 > >  >  > > sys_mmap
 > >  >  > > vm_mmap_pgoff
 > >  >  > > security_mmap_file
 > >  >  > > ima_file_mmap <- returns 0 if not PROT_EXEC
 > >  >  > > 
 > >  >  > > and then the 0 gets propagated up as a retval all the way to userspace.
 > >  > 
 > >  > I just realised that this affects even kernels with CONFIG_IMA unset,
 > >  > because there we just do 'return 0' unconditionally.
 > >  > 
 > >  > Also, it appears that kernels with CONFIG_SECURITY unset will also
 > >  > return a zero for the same reason.
 > > 
 > > Hang on, I was misreading that whole security_mmap_file ret handling code.
 > > There's something else at work here.  I'll dig and get a reproducer.
 > 
 > According to security.h, it should return 0 if permission is granted.
 > If IMA is not enabled, it should also return 0.  What exactly is the
 > problem?

Still digging. I managed to get this to reproduce constantly last night,
but no luck today.  From re-reading the code though, I think IMA/lsm isn't
the problem.

	Dave

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