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]
Date:   Fri, 15 May 2020 08:24:49 +0900
From:   Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Michal Hocko <mhocko@...nel.org>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        linux-kernel@...r.kernel.org, Dmitry Safonov <dima@...sta.com>,
        Yafang Shao <laoar.shao@...il.com>
Subject: Re: [PATCH] printk: Add loglevel for "do not print to consoles".

On 2020/05/15 1:26, Petr Mladek wrote:
> This does not make much sense to me. KERN_NO_CONSOLES would be another
> global flag. If you enable/disable its functionality, it would affect
> all strings with this flag (not only the ones used by OOM killer).

Are you assuming that the switch is applied on KERN_$LEVEL setting (e.g.

  /proc/sys/kernel/print_emerg_messages_on_consoles
  /proc/sys/kernel/print_alert_messages_on_consoles
  /proc/sys/kernel/print_crit_messages_on_consoles
  /proc/sys/kernel/print_err_messages_on_consoles
  /proc/sys/kernel/print_warning_messages_on_consoles
  /proc/sys/kernel/print_notice_messages_on_consoles
  /proc/sys/kernel/print_info_messages_on_consoles
  /proc/sys/kernel/print_debug_messages_on_consoles

) ? Then, that is not what I'm proposing.

The switch I will propose is applied on individual printk() call (e.g.

  printk("%s[%7d] %5d %5d %8lu %8lu %8ld %8lu         %5hd %s\n",
         sysctl_oom_dump_tasks == 2 ? KERN_INFO KERN_NO_CONSOLES : KERN_INFO,
         task->pid, from_kuid(&init_user_ns, task_uid(task)),
         task->tgid, task->mm->total_vm, get_mm_rss(task->mm),
         mm_pgtables_bytes(task->mm),
         get_mm_counter(task->mm, MM_SWAPENTS),
         task->signal->oom_score_adj, task->comm);

) which is NOT another global flag.

Since Dmitry Safonov is working on adding loglevel argument to show_stack(),
we will also be able to implement dump_stack_loglvl(const char *loglvl). Thus,
we will be able to apply KERN_NO_CONSOLES flags to e.g. only dump_stack() /
show_mem() / dump_tasks() etc. WITHOUT MAKING THE SWITCHES GLOBAL.
The direction is heading for "+ loglevel assigned to each message".

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ