Author Topic: Intrepreting CPU info  (Read 1553 times)

0 Members and 1 Guest are viewing this topic.

Offline Keith

  • Hero Member
  • *****
  • Posts: 918
  • Karma: 11
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Intrepreting CPU info
« on: March 06, 2019, 12:47:14 pm »
Before renovating an old PC for a friend (and asking advice on that), I would be grateful for explanations about CPU speed info.  For example, here are the data for my laptop:

keith@T500:~$ sudo lshw -c cpu
[sudo] password for keith:
  *-cpu                   
       description: CPU
       product: Intel(R) Core(TM)2 Duo CPU     P8400  @ 2.26GHz
       vendor: Intel Corp.
       physical id: 6
       bus info: cpu@0
       version: Intel(R) Core(TM)2 Duo CPU     P8400  @ 2.26GHz
       slot: None
       size: 1600MHz
       capacity: 2267MHz

       width: 64 bits
       clock: 266MHz
       capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx x86-64 constant_tsc arch_perfmon pebs bts nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm kaiser tpr_shadow vnmi flexpriority dtherm ida cpufreq

keith@T500:~$

What is the significance of "CPU" speed, "size" speed, "capacity" speed (I'm guessing max = cpu speed) and "clock speed"? 

Thank you
« Last Edit: March 06, 2019, 04:35:25 pm by Keith »

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18119
  • Karma: 469
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Intrepreting CPU info
« Reply #1 on: March 06, 2019, 11:38:29 pm »
No idea .. if I had to guess

size = what clock frequency the CPU is CURRENTLY running at (remembering modern CPU's don't run flat out all the time, they automagically throttle themselves when noyt under load

capacity = the maximum clock frequency the CPU can handle

clock = ABSOLUTELY no idea here, I was going to guess the bus speed before multiplying, but my i7 says 100Mhz and I'd find it difficult to believe it was on a slower bus (though not impossible) :-\

In any case, for info about your CPU you'd be better served by
Code: [Select]
cat /proc/cpuinfo
than
Code: [Select]
lshw
« Last Edit: March 06, 2019, 11:42:36 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Rich J

  • Sr. Member
  • ****
  • Posts: 468
  • Karma: 4
  • Gender: Male
  • A Linux Luvvie!
    • View Profile
    • Awards
Re: Intrepreting CPU info
« Reply #2 on: March 07, 2019, 09:30:33 am »
Hi Mark - I ran the above command on my pc (as I often do out of interest) and came across this in the list -

retpoline kaiser
bugs      : cpu_meltdown spectre_v1 spectre_v2
bogomips   : 6383.83
clflush size   : 64
cache_alignment   : 128
address sizes   : 36 bits physical, 48 bits virtual
p

Should I be concerned?  I'm currently running kernel 4.4.0-116 which I believe was the patched kernel for this problem?

Rich
« Last Edit: March 08, 2019, 09:36:05 am by Rich J »

Offline Keith

  • Hero Member
  • *****
  • Posts: 918
  • Karma: 11
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Intrepreting CPU info
« Reply #3 on: March 07, 2019, 11:40:44 am »
@Rich:  Remember the first instruction of The Hitchiker's Guide to the Galaxy - "Don't Panic".  The command gives the same on my PC (and probably everyone else's), so I guess it tells the PC what to do in an emergency. 

@Mark:
Thank you, Mark.  It makes me feel good to know that I am up there with the experts who don't know either!  ;)  But your guesses seem very reasonable. 
The cpuinfo command does indeed provide much more info, although I'm not sure I can make use of it all. 
I guess "capacity" is the thing that matters. 



Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18119
  • Karma: 469
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Intrepreting CPU info
« Reply #4 on: March 07, 2019, 08:24:21 pm »
The line:-
Code: [Select]
bugs      : cpu_meltdown spectre_v1 spectre_v2
just tells you that your CPU is one of those affected by these vulnerabilities .. it does not tell you if your current kernel is patched against them.

The best way to discover that would be to download this script:
Code: [Select]
wget https://raw.githubusercontent.com/speed47/spectre-meltdown-checker/master/spectre-meltdown-checker.sh
then mark it as executable:
Code: [Select]
chmod +x spectre-meltdown-checker.sh
then run it with elevated privileges:
Code: [Select]
sudo ./spectre-meltdown-checker.sh
that should tell you if you're vulnerable or not.

Although it should be mentioned that as this is a HARDWARE issue (and there's no way software can change hardware) there is NO complete software fix for Spectre and never will be .. it will ALWAYS just be ongoing mitigations against newly discovered Spectre variants, so keep on top of updates.
« Last Edit: March 07, 2019, 08:28:46 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Keith

  • Hero Member
  • *****
  • Posts: 918
  • Karma: 11
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Intrepreting CPU info
« Reply #5 on: March 07, 2019, 08:52:19 pm »
I've changed my mind about not panicking.   :-[
This link is very helpful: https://blog.ubuntu.com/2018/01/24/meltdown-spectre-and-ubuntu-what-you-need-to-know

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18119
  • Karma: 469
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Intrepreting CPU info
« Reply #6 on: March 07, 2019, 09:23:32 pm »
There's little point in panicking because there's nothing you can do .. it affects pretty much all CPU's and all OS's that run on those CPU's.

Until the chip manufacturers redesign their CPU's you can't even replace the hardware (because their current lines are also vulnerable).

Okay you could switch to some ARM CPU's that aren't vulnerable, or very early CPU's that don't utilise speculative execution, but then you'd be computing on a snail.
« Last Edit: March 07, 2019, 09:27:42 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Keith

  • Hero Member
  • *****
  • Posts: 918
  • Karma: 11
  • Gender: Male
  • Linux Novice
    • View Profile
    • Awards
Re: Intrepreting CPU info
« Reply #7 on: March 07, 2019, 09:27:48 pm »
You are right - and my comment was tongue-in-cheek (there's no emoticon for that). 
I ran your code and, to my untutored eye, my laptop doesn't appear to be very vulnerable. 
Many thanks for referencing the code. 


Offline Rich J

  • Sr. Member
  • ****
  • Posts: 468
  • Karma: 4
  • Gender: Male
  • A Linux Luvvie!
    • View Profile
    • Awards
Re: Intrepreting CPU info
« Reply #8 on: March 08, 2019, 09:03:28 am »
Hi Mark, thanks for the heads-up.  I ran the code and got this summary -

> SUMMARY: CVE-2017-5753:OK CVE-2017-5715:OK CVE-2017-5754:OKCVE-2018-3640:KO CVE-2018-3639:KO CVE-2018-3615:OK CVE-2018-3620:KO CVE-2018-3646:OK

I'm assuming from these results that the 1st round of vulnerabilities was patched but others have been discovered later that aren't? 

I vaguely remember a test that I could perform to check if a kernel was patched so I'll try and root it out and re-post as and when.  Also, I need to perform a sweep of redundant kernels (Mint keeps all of the updates) so maybe now is a good time to install the latest (working) kernel too?

Thanks again from a (so far) non-panicking Rich.........  ;)

EDIT:  If I have this right - is a vulnerability exploited by a rogue script on a webpage?  If so, would using an up-to-date browser (Firefox, in my case) and enabling UFW (I have) prevent any such script from deploying?  Or am I way off beam here?
« Last Edit: March 08, 2019, 09:40:44 am by Rich J »

Offline Rich J

  • Sr. Member
  • ****
  • Posts: 468
  • Karma: 4
  • Gender: Male
  • A Linux Luvvie!
    • View Profile
    • Awards
Re: Intrepreting CPU info
« Reply #9 on: March 08, 2019, 09:05:23 am »
I've changed my mind about not panicking.   :-[
This link is very helpful: https://blog.ubuntu.com/2018/01/24/meltdown-spectre-and-ubuntu-what-you-need-to-know

Thanks Keith - very useful link but need to read it through a few times I think!  (See my reply to Mark)

Rich

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18119
  • Karma: 469
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Intrepreting CPU info
« Reply #10 on: March 09, 2019, 03:25:55 pm »
If I have this right - is a vulnerability exploited by a rogue script on a webpage?  If so, would using an up-to-date browser (Firefox, in my case) and enabling UFW (I have) prevent any such script from deploying?  Or am I way off beam here?

You're right and wrong at the same time .. most exploits would require local access, and YES some could theoretically be leveraged via a rogue website.
(and NO, UFW or an up-to-date web browser on their own would not stop a remote exploit via a website, because you'd likely give permission for it to run)

An up-to-date browser is certainly ONE of the mitigations (or put better 'an integral PART of a mitigation strategy') but it is NOT a fix (or protection) in it's own right.

Current mitigations seem to revolve around making the clock too course grained to allow for the very precise timings required by an exploit .. but new ways to work around these mitigations continue to be discovered, so new road-blocks (mitigations) put in their way .. as I said, there is NO fix for this in software, only hardware. Until the hardware is fixed it'll be a continuously running battle.

All you can do is stay on top of updates .. but you should be doing that anyway right ;)
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Rich J

  • Sr. Member
  • ****
  • Posts: 468
  • Karma: 4
  • Gender: Male
  • A Linux Luvvie!
    • View Profile
    • Awards
Re: Intrepreting CPU info
« Reply #11 on: March 10, 2019, 10:10:08 am »
Thanks Mark for that clear explanation.

I do apply regular updates but only up to level 3 lately.  I stopped the automatic installation of kernels due to a spate of 'kernel panics' I was getting.  For some reason, updating the kernel was upsetting my bootloader and I couldn't boot into any of them for a while resulting in a re-install back to Mint 18.1.  I did install the present kernel - 4.4.0-116-generic - as it was patched at the time but do accept that other patches are needed as time goes by. 

I'll try to update to the latest workable kernel but may be back regarding the 'panics'!!

Cheers

Rich

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal