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: <20110217215608.GA2451@kroah.com>
Date:	Thu, 17 Feb 2011 13:56:08 -0800
From:	Greg KH <greg@...ah.com>
To:	Mike Waychison <mikew@...gle.com>
Cc:	Olof Johansson <olofj@...omium.org>,
	Andi Kleen <andi@...stfloor.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Robert Lippert <rlippert@...gle.com>,
	Jon Mayer <jonmayer@...gle.com>,
	Duncan Laurie <dlaurie@...gle.com>,
	Aaron Durbin <adurbin@...gle.com>,
	linux-kernel@...r.kernel.org, Tim Hockin <thockin@...gle.com>,
	David Hendrix <dhendrix@...omium.org>,
	linux-api@...r.kernel.org
Subject: Re: [PATCH v1 2/5] firmware: Basic dmi-sysfs support

Overall, this looks great, just a few minor comments below:

On Thu, Feb 17, 2011 at 01:28:05PM -0800, Mike Waychison wrote:
> +config DMI_SYSFS
> +	tristate "DMI table support in sysfs"
> +	depends on SYSFS && DMI
> +	default X86

Huh?  Default should be 'N' for any new feature, unless it keeps your
machine from booting.

I think you want this option to depend on X86 though, right?

> +	help
> +	  Say Y or M here to enable the exporting of the raw DMI table
> +	  data via sysfs.  This is useful for consuming the data without
> +	  requiring any access to /dev/mem at all.  Tables are found
> +	  under /sys/firmware/dmi when this option is enabled and
> +	  loaded.

I just realized (due to other work I'm doing on a laptop) that we have a
bunch of entries today in /sys/class/dmi/id which is a pointer to the
dmi "device".

Now I think this really is different (these are the raw DMI tables), but
this doesn't have anything to do with that code, right?

> + *
> + * Copyright 2010 Google, Inc.

It's 2011 :)

> +static int __init dmi_sysfs_init(void)
> +{
> +	int error = -ENOMEM;
> +	int val;
> +
> +	/* Set up our directory */
> +	dmi_kobj = kobject_create_and_add("dmi", firmware_kobj);
> +	if (!dmi_kobj)
> +		goto err;
> +
> +	dmi_kset = kset_create_and_add("entries", NULL, dmi_kobj);
> +	if (!dmi_kset)
> +		goto err;
> +
> +	val = 0;
> +	error = dmi_walk(dmi_sysfs_register_handle, &val);
> +	if (error)
> +		goto err;
> +	if (val) {
> +		error = val;
> +		goto err;
> +	}
> +
> +	pr_info("dmi-sysfs: loaded.\n");

Is this really needed?  pr_dbg() instead please?

> +
> +	return 0;
> +err:
> +	cleanup_entry_list();
> +	kset_unregister(dmi_kset);
> +	kobject_put(dmi_kobj);
> +	return error;
> +}
> +
> +/* clean up everything. */
> +static void __exit dmi_sysfs_exit(void)
> +{
> +	pr_info("dmi-sysfs: unloading.\n");
> +	cleanup_entry_list();
> +	kset_unregister(dmi_kset);
> +	kobject_put(dmi_kobj);
> +}
> +
> +module_init(dmi_sysfs_init);
> +module_exit(dmi_sysfs_exit);
> +
> +MODULE_AUTHOR("Google, Inc.");

You don't want your name here?

thanks,

greg k-h
--
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