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: <201010051544.52269.rusty@rustcorp.com.au>
Date:	Tue, 5 Oct 2010 15:44:51 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	Arnd Bergmann <arnd@...db.de>, LKML <linux-kernel@...r.kernel.org>,
	Kay Sievers <kay.sievers@...y.org>,
	Brandon Philips <brandon@...p.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [BUG 2.6.36-rc6] list corruption in module_bug_finalize

On Tue, 5 Oct 2010 09:13:38 am Thomas Gleixner wrote:
> The patch below cures it.

Using module_mutex here is just lazy...  Here's 5c, go buy your own lock :)

>  	/*
> -	 * Strictly speaking this should have a spinlock to protect against
> -	 * traversals, but since we only traverse on BUG()s, a spinlock
> -	 * could potentially lead to deadlock and thus be counter-productive.
> +	 * We need to take module_mutex here to protect the list add, though
> +	 * it won't protect against a concurrent BUG().
>  	 */
> +	mutex_lock(&module_mutex);
>  	list_add(&mod->bug_list, &module_bug_list);
> +	mutex_unlock(&module_mutex);
>  
>  	return 0;
>  }
>  
>  void module_bug_cleanup(struct module *mod)
>  {
> +	mutex_lock(&module_mutex);
>  	list_del(&mod->bug_list);
> +	mutex_unlock(&module_mutex);
>  }
>  
>  #else
> 
--
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