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:	Thu, 21 Aug 2008 12:18:27 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	"Ken Chen" <kenchen@...gle.com>
Cc:	linux-kernel@...r.kernel.org, morgan@...nel.org
Subject: Re: [patch] fix NPTL thread iterator construct in cap_set_pg()

On Fri, 15 Aug 2008 09:24:15 -0700
"Ken Chen" <kenchen@...gle.com> wrote:

> The usage of while_each_pid_task() construct in cap_set_pg() looks incorrect.
> The macro is meant to form 'do ... while' loop instead of a simple while loop.
> I think currently it will skip thread leader of a NPTL process.
> 
> Fix by convert to 'do ... while' style.
> 
> Signed-off-by: Ken Chen <kenchen@...gle.com>
> 
> diff --git a/kernel/capability.c b/kernel/capability.c
> index 0101e84..26d8eda 100644
> --- a/kernel/capability.c
> +++ b/kernel/capability.c
> @@ -167,7 +167,7 @@ static inline int cap_set_pg
>  	pgrp = find_vpid(pgrp_nr);
>  	do_each_pid_task(pgrp, PIDTYPE_PGID, g) {
>  		target = g;
> -		while_each_thread(g, target) {
> +		do {
>  			if (!security_capset_check(target, effective,
>  						   inheritable, permitted)) {
>  				security_capset_set(target, effective,
> @@ -175,7 +175,7 @@ static inline int cap_set_pg
>  				ret = 0;
>  			}
>  			found = 1;
> -		}
> +		} while_each_thread(g, target);
>  	} while_each_pid_task(pgrp, PIDTYPE_PGID, g);
> 
>  	read_unlock(&tasklist_lock);

cap_set_pg() gets deleted by the credentials patches in linux-next and
afaict nothing replaced it.

Does this patch actually fix anything?  If not, ignoring it would be a
nice labour-saving device...

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