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]
Date:	Mon, 16 Jul 2007 21:45:23 +0100
From:	Al Viro <viro@....linux.org.uk>
To:	Satyam Sharma <ssatyam@....iitk.ac.in>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Ulrich Drepper <drepper@...hat.com>
Subject: Re: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL

On Tue, Jul 17, 2007 at 01:00:42AM +0530, Satyam Sharma wrote:
> > 	if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
> > 
> > test is a rather common test, and in fact, arguably, every time you see 
> > one part of it, you should probably see the other. Would it make sense to 
> > make a helper inline function to do this, and replace all users? Doing a
> > 
> > 	git grep 'fsuid.*\<i_uid\>'
> > 
> > seems to show quite a few cases of this pattern..
> 
> Yes, I thought of writing a helper function for this myself. The semantics
> of CAP_FOWNER sort of justify that, but probably better to get Al's views
> on this first.

Helper makes sense (and most of these places will become its call), but...
E.g. IIRC the change of UID requires CAP_CHOWN; CAP_FOWNER is not enough.
Ditto for change of GID.  setlease() is using CAP_LEASE and that appears
to be intentional (no idea what relevant standards say here)...

I'd suggest converting the obvious cases with new helper and taking the
rest one-by-one after that.  Some of those might want CAP_FOWNER added,
some not...
-
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