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:	Thu, 19 Feb 2015 13:24:01 +0100
From:	Ingo Molnar <mingo@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Rusty Russell <rusty@...tcorp.com.au>,
	Andrey Tsyvarev <tsyvarev@...ras.ru>,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] kernel/module.c: Free lock-classes if parse_args failed


* Peter Zijlstra <peterz@...radead.org> wrote:

> > indeed ...
> 
> How about something like so? It would fix this particular 
> issue and lays the groundwork for maybe reusing some of 
> the resources we now leak.

> @@ -3916,6 +3926,20 @@ void lockdep_free_key_range(void *start, unsigned long size)
>  	if (locked)
>  		graph_unlock();
>  	raw_local_irq_restore(flags);
> +
> +	/*
> +	 * Wait for any possible iterators from look_up_lock_class() to pass
> +	 * before continuing to free the memory they refer to.
> +	 *
> +	 * sync_sched() is sufficient because the read-side is IRQ disable.
> +	 */
> +	synchronize_sched();

> +	/* Free lock-classes; relies on the preceding sync_rcu(). */
>  	lockdep_free_key_range(mod->module_core, mod->core_size);

>   free_module:
> +	/* Free lock-classes; relies on the preceding sync_rcu() */
> +	lockdep_free_key_range(mod->module_core, mod->core_size);

Yeah. Looks good to me in principle, without having tested 
it that is as I don't use modules on devel boxes:

Reviewed-by: Ingo Molnar <mingo@...nel.org>

Thanks,

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