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: <20180518225817.GA134184@joelaf.mtv.corp.google.com>
Date:   Fri, 18 May 2018 15:58:17 -0700
From:   Joel Fernandes <joel@...lfernandes.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Joel Fernandes <joelaf@...gle.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Peter Zilstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Tom Zanussi <tom.zanussi@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Glexiner <tglx@...utronix.de>,
        Boqun Feng <boqun.feng@...il.com>,
        Paul McKenney <paulmck@...ux.vnet.ibm.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Todd Kjos <tkjos@...gle.com>,
        Erick Reyes <erickreyes@...gle.com>,
        Julia Cartwright <julia@...com>, kernel-team@...roid.com
Subject: Re: [PATCH 1/2] lib: Add module to simulate atomic sections for
 testing {preempt,irqs}off tracers

On Sat, May 19, 2018 at 12:09:46AM +0300, Andy Shevchenko wrote:
> On Fri, May 18, 2018 at 4:59 AM, Joel Fernandes <joelaf@...gle.com> wrote:
> > From: "Joel Fernandes (Google)" <joel@...lfernandes.org>
> >
> > In this patch we introduce a test module for simulating a long atomic
> > section in the kernel which the preemptoff or irqsoff tracers can
> > detect. This module is to be used only for test purposes and is default
> > disabled.
> >
> > Following is the expected output (only briefly shown) that can be parsed
> > to verify that the tracers are working correctly. We will use this from
> > the kselftests in future patches.
> 
> > +config TEST_ATOMIC_SECTIONS
> > +       tristate "Simulate atomic sections for tracers to detect"
> 
> > +       default n
> 
> n _is_ default default.

I would rather be explicit, several other TEST configs also mention it. Is it
a strong desire to drop off default n?

> > +/*
> 
> SPDX?

Ok, will add.

> 
> > + */
> 
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/ktime.h>
> > +#include <linux/irq.h>
> > +#include <linux/printk.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/delay.h>
> > +#include <linux/string.h>
> > +#include <linux/kthread.h>
> 
> Perhaps keep in order?

Sure.

> > +
> > +static int atomic_time = 100;
> > +static char atomic_mode[10] = "irq";
> > +
> > +module_param_named(atomic_time, atomic_time, int, S_IRUGO);
> > +module_param_string(atomic_mode, atomic_mode, 10, S_IRUGO);
> > +MODULE_PARM_DESC(atomic_time, "Period in microseconds (100 uS default)");
> > +MODULE_PARM_DESC(atomic_mode, "Mode of the test such as preempt or irq (default irq)");
> 
> > +
> > +
> 
> Extra blank line.

Fixed

> > +static int __init atomic_sect_init(void)
> > +{
> > +       char task_name[50];
> > +       struct task_struct *test_task;
> > +
> 
> > +       sprintf(task_name, "%s dis test", atomic_mode);
> 
> Just to be protective from dumb user.
> 
> snprintf();
> 

Done.

> > +
> > +       test_task = kthread_run((void*)atomic_sect_run, NULL, task_name);
> > +       if (IS_ERR(test_task)) {
> 
> > +               return -1;
> 
> return PTR_ERR() ?

Sure, will do. Thanks for the review!

 - Joel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ