All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Allen Hung <allen_hung@dell.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-kernel@vger.kernel.org,
	Mario Limonciello <mario_limonciello@dell.com>
Subject: Re: [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting oem strings to sysfs
Date: Tue, 19 Jul 2016 11:03:14 +0200	[thread overview]
Message-ID: <20160719110314.05d74b84@endymion> (raw)
In-Reply-To: <1468483283-84766-3-git-send-email-allen_hung@dell.com>

Hello Allen,

On Thu, 14 Jul 2016 16:01:23 +0800, Allen Hung wrote:
> The oem strings in DMI system identification information of the BIOS have
> been parsed and stored as dmi devices in dmi_scan.c but they are not
> exported to userspace via sysfs.

They are intended for internal consumption by the kernel drivers.

> The patch intends to export oem strings to sysfs device /sys/class/dmi/id.
> As the number of oem strings are dynamic, a group "oem" is added to the
> device and the strings will be added to the group as string1, string2, ...,
> and stringN.

What is the use case? You can already get these strings easily using
dmidecode:

# dmidecode -qt 11
OEM Strings
	String 1: Dell System
	String 2: 1[05A4]
	String 3: 3[1.0]
	String 4: 12[www.dell.com]
	String 5: 14[1]
	String 6: 15[3]
	String 7:  

If needed, a dedicated option could be added to dmidecode to extract
specific OEM strings. Or existing option -s could be extended for that
purpose.

Also your code doesn't even build. I won't review this patch until I
know why it is needed, and it builds (without warning.)

One comment below though:

> 
> Signed-off-by: Allen Hung <allen_hung@dell.com>
> ---
>  drivers/firmware/dmi-id.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 108 insertions(+)
> 
> diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
> index 44c0139..f284a07 100644
> --- a/drivers/firmware/dmi-id.c
> +++ b/drivers/firmware/dmi-id.c
> (...)
> +static int __init dmi_id_init_oem_attr_group(void)
> +{
> +	int i, ret;
> +	const struct dmi_device *dev;
> +	struct dmi_oem_attribute *oa, *tmp;
> +	struct device_attribute dev_attr_tmpl =
> +		__ATTR(, 0444, sys_dmi_oem_show, NULL);

I'd be very careful about permissions. OEM strings could contain pretty
much everything, including serial numbers or passwords. Making these
files world-readable doesn't strike me as the best of the ideas.

-- 
Jean Delvare
SUSE L3 Support

  parent reply	other threads:[~2016-07-19  9:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14  8:01 [PATCH 0/2] dmi-id: export oem strings to sysfs Allen Hung
2016-07-14  8:01 ` [PATCH 1/2] dmi-id: don't free dev structure after calling device_register Allen Hung
2016-07-18 17:09   ` Jean Delvare
2016-07-14  8:01 ` [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting oem strings to sysfs Allen Hung
2016-07-14  9:16   ` kbuild test robot
2016-07-19  9:03   ` Jean Delvare [this message]
2016-07-19 14:47     ` Mario_Limonciello
2016-08-02 13:43       ` Jean Delvare
2016-08-02 18:56         ` Mario_Limonciello
2016-08-15  9:55           ` Allen Hung
2016-08-24  8:05             ` Allen Hung
2016-07-26 21:03     ` Mario_Limonciello
2016-07-29  9:59       ` Allen Hung
  -- strict thread matches above, loose matches on Subject: below --
2016-07-15  9:42 [PATCH 0/2] dmi-id: export " Allen Hung
2016-07-15  9:42 ` [PATCH 2/2] dmi-id: add dmi/id/oem group for exporting " Allen Hung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160719110314.05d74b84@endymion \
    --to=jdelvare@suse.de \
    --cc=allen_hung@dell.com \
    --cc=jdelvare@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario_limonciello@dell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.