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:	Tue, 3 Apr 2007 17:08:27 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Alexey Dobriyan <adobriyan@...ru>
Cc:	rusty@...tcorp.com.au, pmarques@...popie.com,
	linux-kernel@...r.kernel.org, devel@...nvz.org
Subject: Re: [PATCH 5/5] Fix race between cat /proc/slab_allocators and
 rmmod

On Mon, 2 Apr 2007 19:03:16 +0400
Alexey Dobriyan <adobriyan@...ru> wrote:

> +int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size,
> +			unsigned long *offset, char *modname, char *name)
> +{
> +	struct module *mod;
> +
> +	mutex_lock(&module_mutex);
> +	list_for_each_entry(mod, &modules, list) {
> +		if (within(addr, mod->module_init, mod->init_size) ||
> +		    within(addr, mod->module_core, mod->core_size)) {
> +			const char *sym;
> +
> +			sym = get_ksymbol(mod, addr, size, offset);
> +			if (!sym)
> +				goto out;
> +			if (modname)
> +				strlcpy(modname, mod->name, MODULE_NAME_LEN + 1);
> +			if (name)
> +				strlcpy(name, sym, KSYM_NAME_LEN + 1);
> +			mutex_unlock(&module_mutex);
> +			return 0;
> +		}
> +	}
> +out:
> +	mutex_unlock(&module_mutex);
> +	return -ERANGE;
> +}
> +

The functions lookup_symbol_name() and lookup_symbol_attrs() are quite
general and are likely to be used for other applications in the future.

Could we please pick better names for them?  The names you've chosen are
far too general-sounding - we have a lot of different types of "symbol" in
the kernel!  Perhaps module_lookup_symbol_attrs() and
kallsyms_lookup_symbol() and kallsyms_lookup_attrs() or something.  But
something prefixed with kallsyms_ and module_.

Also, as these general-use functions are exported to all of vmlinux, a little
bit of documentation for them would be good.

-
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