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: <20080819170317.GC7154@redhat.com>
Date:	Tue, 19 Aug 2008 13:03:17 -0400
From:	Aristeu Rozanski <aris@...hat.com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	jirislaby@...il.com
Subject: Re: [PATCH] vt: kill tty->count usage (v2)

Hi Alan,
> > > > The commit e0426e6a09954d205da2d674a3d368d2715e3afd fixes a real race but
> > > > still isn't enough to prevent these:
> > > > 
> > > > kobject_add_internal failed for vcs7 with -EEXIST, don't try to register
> > > > things with the same name in the same direc.
> > > 
> > > Patch dropped due to testing failures.
> > > 
> > > Boot to run level 3, log in and type "reboot\n". Wait
> > > 
> > > Spews vt->driver_data == NULL warnings and oopses
> > do you mind posting the logs somewhere? I wasn't able to reproduce it here so
> 
> I decided it might be better to tackle this one 'head on' and go to the
> root of the problem. I've pushed the following into the stack of patches
> for -next
> 
> tty: shutdown method
I agree with the idea, but:

>  /**
>   *	release_one_tty		-	release tty structure memory
>   *	@kref: kref of tty we are obliterating
> @@ -1489,27 +1514,11 @@ static void release_one_tty(struct kref *kref)
>  {
>  	struct tty_struct *tty = container_of(kref, struct tty_struct, kref);
>  	struct tty_driver *driver = tty->driver;
> -	int devpts = tty->driver->flags & TTY_DRIVER_DEVPTS_MEM;
> -	struct ktermios *tp;
> -	int idx = tty->index;
> -
> -	if (!devpts)
> -		tty->driver->ttys[idx] = NULL;
> -
> -	if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
> -		/* FIXME: Locking on ->termios array */
> -		tp = tty->termios;
> -		if (!devpts)
> -			tty->driver->termios[idx] = NULL;
> -		kfree(tp);
> -
> -		tp = tty->termios_locked;
> -		if (!devpts)
> -			tty->driver->termios_locked[idx] = NULL;
> -		kfree(tp);
> -	}
> -
>  
> +	if (tty->ops->shutdown)
> +		tty->ops->shutdown(tty);
> +	else
> +		tty_shutdown(tty);
>  	tty->magic = 0;
>  	/* FIXME: locking on tty->driver->refcount */
>  	tty->driver->refcount--;
isn't too late for drivers that wait for the remaining data to be transmitted
such as amiserial and cyclades? Unless there's a plan to do it at
release_dev()?

-- 
Aristeu

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