All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
@ 2007-07-08 12:14 Hans de Goede
  2007-07-08 17:52 ` Mark M. Hoffman
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Hans de Goede @ 2007-07-08 12:14 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Hi all,

With this patch the abituguru refuses to load on non Abit motherboards, as
discussed in lkml CONFIG_BREAK_MY_MACHINE thread.

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

Regards,

Hans

[-- Attachment #2: hwmon-abituguru-check-dmi-vendor.patch --]
[-- Type: text/x-patch, Size: 1066 bytes --]

With this patch the abituguru refuses to load on non Abit motherboards, as 
discussed in lkml CONFIG_BREAK_MY_MACHINE thread.

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
diff -up linux-2.6.22-rc4/drivers/hwmon/abituguru.c~ linux-2.6.22-rc4/drivers/hwmon/abituguru.c
--- linux-2.6.22-rc4/drivers/hwmon/abituguru.c~	2007-07-08 14:06:28.000000000 +0200
+++ linux-2.6.22-rc4/drivers/hwmon/abituguru.c	2007-07-08 14:08:36.000000000 +0200
@@ -31,6 +31,7 @@
 #include <linux/platform_device.h>
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
+#include <linux/dmi.h>
 #include <asm/io.h>
 
 /* Banks */
@@ -1446,6 +1447,14 @@ static int __init abituguru_init(void)
 	int address, err;
 	struct resource res = { .flags = IORESOURCE_IO };
 
+#ifdef CONFIG_DMI
+	char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
+
+	/* safety check, refuse to load on non Abit motherboards */
+	if (!board_vendor || strcmp(board_vendor, "http://www.abit.com.tw/"))
+		return -ENODEV;
+#endif
+
 	address = abituguru_detect();
 	if (address < 0)
 		return address;

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
@ 2007-07-08 17:52 ` Mark M. Hoffman
  2007-07-08 18:06 ` Hans de Goede
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Mark M. Hoffman @ 2007-07-08 17:52 UTC (permalink / raw)
  To: lm-sensors

Hi Hans:

* Hans de Goede <j.w.r.degoede@hhs.nl> [2007-07-08 14:14:34 +0200]:
> Hi all,
> 
> With this patch the abituguru refuses to load on non Abit motherboards, as
> discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
> 
> Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
> 
> Regards,
> 
> Hans

> With this patch the abituguru refuses to load on non Abit motherboards, as 
> discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
> 
> Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

That thread worries me a bit.  Should this get in before 2.6.22?  I would
rather *not* try to get it in at this late hour, as it could potentially
cause regression for a lot of ABIT owners.  But if you think the alternative
is worse, then let me know ASAP and I'll send it.

For now, it's applied to testing (queued for the 2.6.23 merge window).

Regards,

-- 
Mark M. Hoffman
mhoffman@lightlink.com


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
  2007-07-08 17:52 ` Mark M. Hoffman
@ 2007-07-08 18:06 ` Hans de Goede
  2007-07-08 18:07 ` Hans de Goede
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hans de Goede @ 2007-07-08 18:06 UTC (permalink / raw)
  To: lm-sensors

Mark M. Hoffman wrote:
> Hi Hans:
> 
> * Hans de Goede <j.w.r.degoede@hhs.nl> [2007-07-08 14:14:34 +0200]:
>> Hi all,
>>
>> With this patch the abituguru refuses to load on non Abit motherboards, as
>> discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
>>
>> Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
>>
>> Regards,
>>
>> Hans
> 
>> With this patch the abituguru refuses to load on non Abit motherboards, as 
>> discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
>>
>> Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
> 
> That thread worries me a bit.  Should this get in before 2.6.22?

No 2.6.23 is fine. No worries, they should have named the thread 
CONFIG_SHOOT_MYSELF_IN_THE_FOOT. This patch is just a layer of security to 
prevent people doing stupid things. I only wrote the patch because some people 
thought it would be a good idea to prevent people from doing stupid things with 
regards to medling with the kernel, however when you enter into that realm 
there is really no end of stupid things one can do, so I wonder how wise it is 
to try and protect people against themselves.

Regards,

Hans

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
  2007-07-08 17:52 ` Mark M. Hoffman
  2007-07-08 18:06 ` Hans de Goede
@ 2007-07-08 18:07 ` Hans de Goede
  2007-07-09 18:27 ` Jean Delvare
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hans de Goede @ 2007-07-08 18:07 UTC (permalink / raw)
  To: lm-sensors

p.s.

Mark M. Hoffman wrote:
> as it could potentially
> cause regression for a lot of ABIT owners.

The chances of that should be small, I've asked and received many dmidecode 
outputs and Abit seems to be 100% consistent with the base board vendor dmi string.

Regards,

Hans

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
                   ` (2 preceding siblings ...)
  2007-07-08 18:07 ` Hans de Goede
@ 2007-07-09 18:27 ` Jean Delvare
  2007-07-09 18:37 ` Jean Delvare
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2007-07-09 18:27 UTC (permalink / raw)
  To: lm-sensors

On Sun, 08 Jul 2007 14:14:34 +0200, Hans de Goede wrote:
> With this patch the abituguru refuses to load on non Abit motherboards, as
> discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
> 
> Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

Thanks for doing this.

Acked-by: Jean Delvare <khali@linux-fr.org>

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
                   ` (3 preceding siblings ...)
  2007-07-09 18:27 ` Jean Delvare
@ 2007-07-09 18:37 ` Jean Delvare
  2007-07-09 20:37 ` Pavel Machek
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2007-07-09 18:37 UTC (permalink / raw)
  To: lm-sensors

Hi Hans, Mark,

On Sun, 08 Jul 2007 20:06:10 +0200, Hans de Goede wrote:
> No 2.6.23 is fine. No worries, they should have named the thread 
> CONFIG_SHOOT_MYSELF_IN_THE_FOOT.

Agreed.

>                                   This patch is just a layer of security to 
> prevent people doing stupid things. I only wrote the patch because some people 
> thought it would be a good idea to prevent people from doing stupid things with 
> regards to medling with the kernel, however when you enter into that realm 
> there is really no end of stupid things one can do, so I wonder how wise it is 
> to try and protect people against themselves.

I don't consider loading a kernel driver to be a "stupid thing". And
even if you think it is, well, people sometimes do that. I can remember
several posts to the lm-sensors list in the past few years, starting
with "I tried to load all the drivers, but without success." Given that
the abituguru accesses I/O ports without requesting them, and has a
relatively weak detection, I believe it is fair to make sure it won't
load on boards where it has no chance to be useful.

Thanks,
-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
                   ` (4 preceding siblings ...)
  2007-07-09 18:37 ` Jean Delvare
@ 2007-07-09 20:37 ` Pavel Machek
  2007-07-10  9:43 ` Jean Delvare
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2007-07-09 20:37 UTC (permalink / raw)
  To: lm-sensors

On Mon 2007-07-09 20:27:46, Jean Delvare wrote:
> On Sun, 08 Jul 2007 14:14:34 +0200, Hans de Goede wrote:
> > With this patch the abituguru refuses to load on non Abit motherboards, as
> > discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
> > 
> > Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
> 
> Thanks for doing this.
> 
> Acked-by: Jean Delvare <khali@linux-fr.org>

I guess I should say "thanks", too...
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
                   ` (5 preceding siblings ...)
  2007-07-09 20:37 ` Pavel Machek
@ 2007-07-10  9:43 ` Jean Delvare
  2007-07-10 15:09 ` Hans de Goede
  2007-07-13 17:34 ` Jean Delvare
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2007-07-10  9:43 UTC (permalink / raw)
  To: lm-sensors

Hans,

On Mon, 9 Jul 2007 20:27:46 +0200, Jean Delvare wrote:
> On Sun, 08 Jul 2007 14:14:34 +0200, Hans de Goede wrote:
> > With this patch the abituguru refuses to load on non Abit motherboards, as
> > discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
> > 
> > Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
> 
> Thanks for doing this.
> 
> Acked-by: Jean Delvare <khali@linux-fr.org>

Thinking about it some more... You may want to skip the DMI test if the
force module parameter is used, in case Abit stops being consistent for
the DMI board vendor name field.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
                   ` (6 preceding siblings ...)
  2007-07-10  9:43 ` Jean Delvare
@ 2007-07-10 15:09 ` Hans de Goede
  2007-07-13 17:34 ` Jean Delvare
  8 siblings, 0 replies; 10+ messages in thread
From: Hans de Goede @ 2007-07-10 15:09 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

Jean Delvare wrote:
> Hans,
> 
> On Mon, 9 Jul 2007 20:27:46 +0200, Jean Delvare wrote:
>> On Sun, 08 Jul 2007 14:14:34 +0200, Hans de Goede wrote:
>>> With this patch the abituguru refuses to load on non Abit motherboards, as
>>> discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
>>>
>>> Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
>> Thanks for doing this.
>>
>> Acked-by: Jean Delvare <khali@linux-fr.org>
> 
> Thinking about it some more... You may want to skip the DMI test if the
> force module parameter is used, in case Abit stops being consistent for
> the DMI board vendor name field.
> 

Good point, attached is an updated version which does that.

Regards,

Hans


[-- Attachment #2: hwmon-abituguru-check-dmi-vendor.patch --]
[-- Type: text/x-patch, Size: 1171 bytes --]

With this patch the abituguru refuses to load on non Abit motherboards, as 
discussed in lkml CONFIG_BREAK_MY_MACHINE thread.

This is an updates version, which will skip this test when the force parameter
is used.

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
diff -up linux-2.6.22-rc4/drivers/hwmon/abituguru.c~ linux-2.6.22-rc4/drivers/hwmon/abituguru.c
--- linux-2.6.22-rc4/drivers/hwmon/abituguru.c~	2007-07-08 14:06:28.000000000 +0200
+++ linux-2.6.22-rc4/drivers/hwmon/abituguru.c	2007-07-10 13:19:55.000000000 +0200
@@ -31,6 +31,7 @@
 #include <linux/platform_device.h>
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
+#include <linux/dmi.h>
 #include <asm/io.h>
 
 /* Banks */
@@ -1446,6 +1447,15 @@ static int __init abituguru_init(void)
 	int address, err;
 	struct resource res = { .flags = IORESOURCE_IO };
 
+#ifdef CONFIG_DMI
+	char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
+
+	/* safety check, refuse to load on non Abit motherboards */
+	if (!force && (!board_vendor ||
+			strcmp(board_vendor, "http://www.abit.com.tw/")))
+		return -ENODEV;
+#endif
+
 	address = abituguru_detect();
 	if (address < 0)
 		return address;

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
  2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
                   ` (7 preceding siblings ...)
  2007-07-10 15:09 ` Hans de Goede
@ 2007-07-13 17:34 ` Jean Delvare
  8 siblings, 0 replies; 10+ messages in thread
From: Jean Delvare @ 2007-07-13 17:34 UTC (permalink / raw)
  To: lm-sensors

On Tue, 10 Jul 2007 17:09:57 +0200, Hans de Goede wrote:
> Jean Delvare wrote:
> > Thinking about it some more... You may want to skip the DMI test if the
> > force module parameter is used, in case Abit stops being consistent for
> > the DMI board vendor name field.
> 
> Good point, attached is an updated version which does that.

Acked-by: Jean Delvare <khali@linux-fr.org>

Mark, please apply.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-07-13 17:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
2007-07-08 17:52 ` Mark M. Hoffman
2007-07-08 18:06 ` Hans de Goede
2007-07-08 18:07 ` Hans de Goede
2007-07-09 18:27 ` Jean Delvare
2007-07-09 18:37 ` Jean Delvare
2007-07-09 20:37 ` Pavel Machek
2007-07-10  9:43 ` Jean Delvare
2007-07-10 15:09 ` Hans de Goede
2007-07-13 17:34 ` Jean Delvare

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.