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: <YoZVvA5FP4wFLSH9@kroah.com>
Date:   Thu, 19 May 2022 16:35:40 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Chris Down <chris@...isdown.name>
Cc:     linux-kernel@...r.kernel.org, Petr Mladek <pmladek@...e.com>,
        kernel-team@...com
Subject: Re: [RFC PATCH] printk: console: Allow each console to have its own
 loglevel

On Thu, May 19, 2022 at 03:12:19PM +0100, Chris Down wrote:
> Greg Kroah-Hartman writes:
> > The two stanzas in my reply do NOT refer to the same thing.
> > 
> > The first one is for the device that is assigned to the class.  That
> > must be freed and properly reference counted and handled as that is a
> > dynamic object that can come and go as people add and remove consoles.
> 
> Ah, I see. So to be clear, this change would fix what you're concerned
> about, right? :-)
> 
> If so I'll do this in v2. Thanks!
> 
> ---
> 
> diff --git include/linux/console.h include/linux/console.h
> index ce5ba405285a..408dd86be8eb 100644
> --- include/linux/console.h
> +++ include/linux/console.h
> @@ -156,12 +156,6 @@ static inline int con_debug_leave(void)
>   */
>  #define CON_LOGLEVEL	(128) /* Level set locally for this console */
> -/*
> - * Console has active class device, so may have active readers/writers from
> - * /sys/class hierarchy.
> - */
> -#define CON_CLASSDEV_ACTIVE	(256)
> -
>  struct console {
>  	char	name[16];
>  	void	(*write)(struct console *, const char *, unsigned);
> @@ -179,9 +173,11 @@ struct console {
>  	void	*data;
>  	struct	 console *next;
>  	int	level;
> -	struct	device classdev;
> +	struct	device *classdev;

Ick, no, keep the real structure here.  It can properly handle the
reference counting for the object.  Just correctly clean up in the
release function, not anywhere else.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ