Re: Userspace process may be able to DoS kernel

From: Joerg Platte
Date: Sat Nov 11 2006 - 08:16:39 EST


Am Samstag, 11. November 2006 13:39 schrieb Arjan van de Ven:

> this isn't per se acpi related: This is reading the PM timer from your
> chipset. The PMTimer is a clock on your chipset that the kernel can use
> to read a stable incrementing clock to find out what time it is right
> now, usually as part of userspace asking the kernel what time it is via
> the gettimeofday() system call. ACPI is just the component that does the
> actual (slow) hardware access... eg the messenger.

OK.

> Normally systems have better/faster clocks than the pmtimer, but there
> are circumstances where those can't be used.
>
> 1) HPET. The HPET is a lot faster than pmtimer, and very reliable. Most
> of the systems sold in the last 3 years have an hpet, but unfortunately,
> many bioses turn this off by default. If your BOOS has a "Multimedia
> timer" setting, make sure it's set to "On".

My computer is 3,5 years old (one of the first centrino notebooks). Maybe it
does not have a HPET timer. I can't find HPET somewhere in the kernel.log
file and no option in the BIOS. But it is enabled in my kernel config.

> 2) TSC. This is a super fast method of finding how much time has passed,
> since it's inside the CPU. However there are many reasons why this
> method may be unreliable, for example certain powermanagement features
> on laptops cause this clock to stop when idle (not useful), or to vary
> in frequency (also not useful if you want to find out what time it is).
> Also on AMD Opteron SMP systems or extreme Intel big honking NUMA
> systems, this timer is not synchronized between the various processors
> and that breaks the current time keeping in Linux, and so Linux doesn't
> use it in that case.

I'm using frequency scaling. Maybe that's a reason for not using TSC in each
case.

> So my advice is
> 1) Check the bios to see if you have the HPET enabled. If not, enable
> it.
> 2) Check the kernel config to see if you have HPET enabled there, if not
> enable it.
> 3) Check dmesg to see if there's a reason the kernel doesn't use TSC;
> there is probably nothing you can do but at least you know why :)

The kernel semm to use TSC. I can't find another message stating that TSC has
been disabled.

localhost kernel: Time: tsc clocksource has been installed.

There seem to be some clock drift. Each time when starting skype everything
works perfect for a couple of hours. Then, skype behaves strange by causing
this high system load.

regards,
Jörg
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/