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: <m1pr6dwgsh.fsf@fess.ebiederm.org>
Date:	Thu, 17 Dec 2009 11:18:22 -0800
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Michael Stone <michael@...top.org>
Cc:	Ulrich Drepper <drepper@...il.com>, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, linux-security-module@...r.kernel.org,
	"Andi Kleen" <andi@...stfloor.org>, "David Lang" <david@...g.hm>,
	"Oliver Hartkopp" <socketcan@...tkopp.net>,
	"Alan Cox" <alan@...rguk.ukuu.org.uk>,
	"Herbert Xu" <herbert@...dor.apana.org.au>,
	"Valdis Kletnieks" <Valdis.Kletnieks@...edu>,
	"Bryan Donlan" <bdonlan@...il.com>,
	"Evgeniy Polyakov" <zbr@...emap.net>,
	"C. Scott Ananian" <cscott@...ott.net>,
	"James Morris" <jmorris@...ei.org>,
	"Bernie Innocenti" <bernie@...ewiz.org>,
	"Mark Seaborn" <mrs@...hic-beasts.com>
Subject: Re: [PATCH] Security: Implement prctl(PR_SET_NETWORK, PR_NETWORK_OFF) semantics.

Michael Stone <michael@...top.org> writes:

> diff --git a/kernel/ptrace.c b/kernel/ptrace.c
> index 23bd09c..5b38db0 100644
> --- a/kernel/ptrace.c
> +++ b/kernel/ptrace.c
> @@ -151,6 +151,8 @@ int __ptrace_may_access(struct task_struct *task, unsigned int mode)
>  		dumpable = get_dumpable(task->mm);
>  	if (!dumpable && !capable(CAP_SYS_PTRACE))
>  		return -EPERM;
> +	if (current->network)
> +		return -EPERM;

The principle should be: you gain no privileges by ptracing.
Therefore this check should be:

	if (current->network && !task->network)
		return -EPERM;

Which keeps the ptrace logic from being a larger hammer than it needs
to be.

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