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: <20151009144650.GR3910@linux.vnet.ibm.com>
Date:	Fri, 9 Oct 2015 07:46:50 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Christian Borntraeger <borntraeger@...ibm.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] locktorture: fix wrong parameter handling

On Fri, Oct 09, 2015 at 02:14:45PM +0200, Christian Borntraeger wrote:
> Calling locktorture with a wrong parameter makes it
> unusable:
> 
> $ modprobe locktorture torture_type=help
> modprobe: ERROR: could not insert 'locktorture': Invalid argument
> 
> $ modprobe locktorture torture_type=spin_lock
> modprobe: ERROR: could not insert 'locktorture': Device or resource busy
> 
> $ dmesg
> [...]
> torture_init_begin: refusing spin_lock init: help running
> 
> We can easily do the checking before call into the torture framework.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@...ibm.com>

Good catch, thank you!

Could you please port this to rcu/next in the -rcu tree?  Also, please
capitalize the word following the ":" in the subject line, as in "[PATCH]
locktorture: Fix wrong parameter handling".

Also, would you be interested in sending a separate patch to fix what
looks like a similar issue in kernel/locking/locktorture.c?

							Thanx, Paul

> ---
>  kernel/locking/locktorture.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
> index 3224418..f5f66a6 100644
> --- a/kernel/locking/locktorture.c
> +++ b/kernel/locking/locktorture.c
> @@ -645,9 +645,6 @@ static int __init lock_torture_init(void)
>  		&rwsem_lock_ops,
>  	};
> 
> -	if (!torture_init_begin(torture_type, verbose, &torture_runnable))
> -		return -EBUSY;
> -
>  	/* Process args and tell the world that the torturer is on the job. */
>  	for (i = 0; i < ARRAY_SIZE(torture_ops); i++) {
>  		cxt.cur_ops = torture_ops[i];
> @@ -661,9 +658,12 @@ static int __init lock_torture_init(void)
>  		for (i = 0; i < ARRAY_SIZE(torture_ops); i++)
>  			pr_alert(" %s", torture_ops[i]->name);
>  		pr_alert("\n");
> -		torture_init_end();
>  		return -EINVAL;
>  	}
> +
> +	if (!torture_init_begin(torture_type, verbose, &torture_runnable))
> +		return -EBUSY;
> +
>  	if (cxt.cur_ops->init)
>  		cxt.cur_ops->init(); /* no "goto unwind" prior to this point!!! */
> 
> -- 
> 2.4.3
> 

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