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]
Message-ID: <20150627232705.GC6433@kroah.com>
Date:	Sat, 27 Jun 2015 16:27:05 -0700
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Patrick Donnelly <batrick@...bytes.com>
Cc:	Jiri Slaby <jslaby@...e.cz>,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] Check tcsetpgrp p is a process group.

On Sat, Jun 27, 2015 at 05:17:03PM -0400, Patrick Donnelly wrote:
> This fixes a bug where a process can set the foreground process group to its
> pid even if its pid is not a valid pgrp.
> 
> Signed-off-by: Patrick Donnelly <batrick@...bytes.com>
> ---
>  drivers/tty/tty_io.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> index 401d05e..c20a2fb 100644
> --- a/drivers/tty/tty_io.c
> +++ b/drivers/tty/tty_io.c
> @@ -2560,9 +2560,11 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t
>  {
>  	struct pid *pgrp;
>  	pid_t pgrp_nr;
> -	int retval = tty_check_change(real_tty);
> +	int retval;
>  	unsigned long flags;
>  
> +	retval = tty_check_change(real_tty);
> +
>  	if (retval == -EIO)
>  		return -ENOTTY;
>  	if (retval)
> @@ -2580,6 +2582,10 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t
>  	retval = -ESRCH;
>  	if (!pgrp)
>  		goto out_unlock;
> +	retval = -EINVAL;
> +	if (!pid_task(pgrp, PIDTYPE_PGID)) {
> +		goto out_unlock;
> +	}
>  	retval = -EPERM;
>  	if (session_of_pgrp(pgrp) != task_session(current))
>  		goto out_unlock;

Always run your patches though checkpatch.pl so you don't get emails
telling you to fix the things that checkpatch.pl tells you to...
--
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