PATCH: hwmon-abituguru-check-dmi-vendor.patch
Subsystems (2)
Hi all,
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
Regards,
Hans
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
drivers/hwmon/abituguru.c renamed from drivers/hwmon/abituguru.c~ +9 -0
@@ -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;
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Hans:
Quoted 7 lines · Hans de Goede
Hi all,
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml
CONFIG_BREAK_MY_MACHINEthread.Signed-off-by Hans de Goede <[email protected]>
Quoted 8 lines
Regards,
Hans
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml
CONFIG_BREAK_MY_MACHINEthread.Signed-off-by Hans de Goede <[email protected]>
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,
Signature · 8 lines
Mark M. Hoffman [email protected] _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 12 lines · Mark M. Hoffman
Hi Hans:
Quoted 9 lines · Hans de Goede
Hi all,
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml
CONFIG_BREAK_MY_MACHINEthread.Signed-off-by Hans de Goede <[email protected]>Regards,
Quoted 8 lines
Quoted 6 lines
Hans
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml
CONFIG_BREAK_MY_MACHINEthread.Signed-off-by Hans de Goede <[email protected]>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
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
p.s.
Quoted 2 lines · Mark M. Hoffman
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
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Jean Delvare
Acked-byQuoted 4 lines · Hans de Goede
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml
CONFIG_BREAK_MY_MACHINEthread.Signed-off-by Hans de Goede <[email protected]>
Thanks for doing this.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Hans, Mark,
Quoted 2 lines · Hans de Goede
No 2.6.23 is fine. No worries, they should have named the thread
CONFIG_SHOOT_MYSELF_IN_THE_FOOT.
Agreed.
Quoted 6 lines
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,
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Jean Delvare
Quoted 4 lines · Hans de Goede
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml
CONFIG_BREAK_MY_MACHINEthread.Signed-off-by Hans de Goede <[email protected]>Thanks for doing this.
Acked-by Jean Delvare <[email protected]>
I guess I should say "thanks", too...
Pavel
Signature · 7 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hans,
Quoted 9 lines · Jean Delvare
Quoted 4 lines · Hans de Goede
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml
CONFIG_BREAK_MY_MACHINEthread.Signed-off-by Hans de Goede <[email protected]>Thanks for doing this.
Acked-by Jean Delvare <[email protected]>
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.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 7 lines · Jean Delvare
Hans,
Quoted 4 lines · Jean Delvare
Quoted 3 lines · Hans de Goede
With this patch the abituguru refuses to load on non Abit motherboards, as discussed in lkml
CONFIG_BREAK_MY_MACHINEthread.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Hans de Goede <[email protected]>Thanks for doing this.
Acked-by Jean Delvare <[email protected]>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
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.
drivers/hwmon/abituguru.c renamed from drivers/hwmon/abituguru.c~ +10 -0
@@ -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;
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Jean Delvare
Acked-byQuoted 6 lines · Hans de Goede
Quoted 3 lines · Jean Delvare
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.
Mark, please apply.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors