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: <20140930195733.GA26492@redhat.com>
Date:	Tue, 30 Sep 2014 21:57:33 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Prarit Bhargava <prarit@...hat.com>
Cc:	linux-kernel@...r.kernel.org,
	Rusty Russell <rusty@...tcorp.com.au>,
	Jason Wessel <jason.wessel@...driver.com>,
	Roland McGrath <roland@...k.frob.com>,
	kgdb-bugreport@...ts.sourceforge.net
Subject: Re: [PATCH] modules, split MODULE_STATE_UNFORMED into separate
	states

On 09/30, Prarit Bhargava wrote:
>
> MODULE_STATE_UNFORMED needs to be separated into two states; one for the
> module load (MODULE_STATE_LOAD), and one for the module delete
> (MODULE_STATE_DELETE).

And personally I think this makes sense in any case, but I can't really
comment the changes in this area.

> @@ -3647,18 +3646,29 @@ static int m_show(struct seq_file *m, void *p)
>  	struct module *mod = list_entry(p, struct module, list);
>  	char buf[8];
>  
> -	/* We always ignore unformed modules. */
> -	if (mod->state == MODULE_STATE_UNFORMED)
> +	/*
> +	 * If the state is MODULE_STATE_LOAD then the module is in
> +	 * the early stages of loading.  No information should be printed
> +	 * for this module as the data could be in an uninitialized state.
> +	 */
> +	if (mod->state == MODULE_STATE_LOAD)
>  		return 0;

So this assumes that _UNFORMED state is fine...

Not sure, but I can be easily wrong. For example, print_unload_info() ->
module_refcount() plays with mod->refptr, while free_module() does
module_unload_free() -> free_percpu(mod->refptr). No?

Perhaps it makes sense to start with the simple patch for stable,

	+	// sync with m_show()
	+	mutex_lock(module_mutex);
		mod->state = MODULE_STATE_UNFORMED;
	+	mutex_unlock(module_mutex);

then do a more sophisticated fix?

Oleg.

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