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  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:   Tue, 5 May 2020 10:02:19 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To:     Pavel Tatashin <pasha.tatashin@...een.com>
Cc:     jmorris@...ei.org, sashal@...nel.org, linux-kernel@...r.kernel.org,
        pmladek@...e.com, sergey.senozhatsky@...il.com,
        rostedt@...dmis.org, keescook@...omium.org, anton@...msg.org,
        ccross@...roid.com, tony.luck@...el.com, robh+dt@...nel.org,
        devicetree@...r.kernel.org
Subject: Re: [PATCH v1 1/3] printk: honor the max_reason field in kmsg_dumper

On (20/05/02 10:35), Pavel Tatashin wrote:
[..]
> +static bool always_kmsg_dump;
> +module_param_named(always_kmsg_dump, always_kmsg_dump, bool, S_IRUGO | S_IWUSR);
>  
>  /**
>   * kmsg_dump_register - register a kernel log dumper.
> @@ -3106,6 +3108,12 @@ int kmsg_dump_register(struct kmsg_dumper *dumper)
>  	spin_lock_irqsave(&dump_list_lock, flags);
>  	/* Don't allow registering multiple times */
>  	if (!dumper->registered) {
> +		if (!dumper->max_reason) {
> +			if (always_kmsg_dump)
> +				dumper->max_reason = KMSG_DUMP_MAX;
> +			else
> +				dumper->max_reason = KMSG_DUMP_OOPS;
> +		}
>  		dumper->registered = 1;
>  		list_add_tail_rcu(&dumper->list, &dump_list);
>  		err = 0;

[..]

> @@ -3157,12 +3162,9 @@ void kmsg_dump(enum kmsg_dump_reason reason)
>  	struct kmsg_dumper *dumper;
>  	unsigned long flags;
>  
> -	if ((reason > KMSG_DUMP_OOPS) && !always_kmsg_dump)
> -		return;
> -
>  	rcu_read_lock();
>  	list_for_each_entry_rcu(dumper, &dump_list, list) {
> -		if (dumper->max_reason && reason > dumper->max_reason)
> +		if (reason > dumper->max_reason)
>  			continue;

Why always_kmsg_dump check moved from the dumper loop entry point to the
dumper registration code? What if the user change always_ksmsg_dump
dynamically via sysfs?

	-ss

Powered by blists - more mailing lists