linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* security issue: hard disk lock
@ 2005-04-04 17:42 Jonas Diemer
  2005-04-04 18:32 ` Horst von Brand
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jonas Diemer @ 2005-04-04 17:42 UTC (permalink / raw)
  To: linux-kernel

Hello!

I don't know if you guys already know, there is a possible security risk with 
all modern desktop-pcs and ata hard drives. In short:

Modern ata drives can be locked by password. This lock could be set by a 
malicous software. This security feature can be frozen, so no programs can 
set a lock until the next reboot. Ususally, the BIOS should take care of 
locking the security feature, but most desktop BIOSes (unlike laptop BIOSes) 
fail to do so. Once a lock is set and the password is unknown, the drive is 
trash.

See http://www.heise.de/ct/english/05/08/172/ for more details.

In the above article, a patched hdparm is used to freeze the drive's security 
features. This can be used during boot to prevent programs from setting a 
password. However, a malicous program could infect the computer and install 
itself in the boot sequence prior to the execution of hdparm...

I figured there could be a kernel compiled-in option that will make the kernel 
lock all drives found during bootup. then, a malicous program would need to 
install a different kernel in order to harm the drive, which would be much 
more secure.

What do you think of this? 

Regards,
Jonas

PS: Please CC me in replies, I am not subscribed to the list.

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

* Re: security issue: hard disk lock
  2005-04-04 17:42 security issue: hard disk lock Jonas Diemer
@ 2005-04-04 18:32 ` Horst von Brand
  2005-04-04 23:00   ` Chris Friesen
  2005-04-05 15:41   ` Vernon Mauery
  2005-04-04 19:26 ` Florian Weimer
  2005-04-11 15:36 ` Alan Cox
  2 siblings, 2 replies; 10+ messages in thread
From: Horst von Brand @ 2005-04-04 18:32 UTC (permalink / raw)
  To: Jonas Diemer; +Cc: linux-kernel

Jonas Diemer <diemer@gmx.de> said:

[...]

> I figured there could be a kernel compiled-in option that will make the
> kernel lock all drives found during bootup. then, a malicous program
> would need to install a different kernel in order to harm the drive,
> which would be much more secure.

Doing it in initrd should be plenty of time, no need to involve the kernel.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

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

* Re: security issue: hard disk lock
  2005-04-04 17:42 security issue: hard disk lock Jonas Diemer
  2005-04-04 18:32 ` Horst von Brand
@ 2005-04-04 19:26 ` Florian Weimer
  2005-04-11 15:36 ` Alan Cox
  2 siblings, 0 replies; 10+ messages in thread
From: Florian Weimer @ 2005-04-04 19:26 UTC (permalink / raw)
  To: Jonas Diemer; +Cc: linux-kernel

* Jonas Diemer:

> What do you think of this? 

I think that these days, the underlying assumption (software cannot
destroy hardware, and if it can, we have a problem) is simply no
longer valid.

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

* Re: security issue: hard disk lock
  2005-04-04 18:32 ` Horst von Brand
@ 2005-04-04 23:00   ` Chris Friesen
  2005-04-05 15:41   ` Vernon Mauery
  1 sibling, 0 replies; 10+ messages in thread
From: Chris Friesen @ 2005-04-04 23:00 UTC (permalink / raw)
  To: Horst von Brand; +Cc: Jonas Diemer, linux-kernel

Horst von Brand wrote:

> Doing it in initrd should be plenty of time, no need to involve the kernel.

Not everyone uses an initrd.

Chris

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

* Re: security issue: hard disk lock
  2005-04-04 18:32 ` Horst von Brand
  2005-04-04 23:00   ` Chris Friesen
@ 2005-04-05 15:41   ` Vernon Mauery
  2005-04-05 17:10     ` Jonas Diemer
  1 sibling, 1 reply; 10+ messages in thread
From: Vernon Mauery @ 2005-04-05 15:41 UTC (permalink / raw)
  To: Horst von Brand; +Cc: Jonas Diemer, linux-kernel

Horst von Brand wrote:
> Jonas Diemer <diemer@gmx.de> said:
> 
> [...]
> 
> 
>>I figured there could be a kernel compiled-in option that will make the
>>kernel lock all drives found during bootup. then, a malicous program
>>would need to install a different kernel in order to harm the drive,
>>which would be much more secure.
> 
> 
> Doing it in initrd should be plenty of time, no need to involve the kernel.

Technically, according to the article, the only safe time to do it is in the BIOS or in one of their special safe CDs that freezes the drive before the boot loader loads.  This makes sense because a particularly malicious place to put something like this is a worm that attaches to your boot loader.  Then, even doing it in the kernel at boot time is too late.

--Vernon


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

* Re: security issue: hard disk lock
  2005-04-05 15:41   ` Vernon Mauery
@ 2005-04-05 17:10     ` Jonas Diemer
  0 siblings, 0 replies; 10+ messages in thread
From: Jonas Diemer @ 2005-04-05 17:10 UTC (permalink / raw)
  To: Vernon Mauery; +Cc: Horst von Brand, linux-kernel

Am Dienstag 05. April 2005 17:41 schrieb Vernon Mauery:
>  This makes sense because a particularly malicious
> place to put something like this is a worm that attaches to your boot
> loader.  Then, even doing it in the kernel at boot time is too late.

I understand... Didn't know that worms could attach to the bootloader :-) 
Well, then even fixing this in the bootloader would be too late, if the worm 
could simply replace the bootloader. I guess it's not a kernel-issue then and 
should really be addressed in the boot-up sequence (as long as BIOS vendors 
fail to fix it), be it with or without initrd.

regards,
Jonas

PS: Still not in list, so please CC me on eventual replies.

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

* Re: security issue: hard disk lock
  2005-04-04 17:42 security issue: hard disk lock Jonas Diemer
  2005-04-04 18:32 ` Horst von Brand
  2005-04-04 19:26 ` Florian Weimer
@ 2005-04-11 15:36 ` Alan Cox
  2005-04-11 16:01   ` Jonas Diemer
  2 siblings, 1 reply; 10+ messages in thread
From: Alan Cox @ 2005-04-11 15:36 UTC (permalink / raw)
  To: Jonas Diemer; +Cc: Linux Kernel Mailing List

On Llu, 2005-04-04 at 18:42, Jonas Diemer wrote:
> I figured there could be a kernel compiled-in option that will make the kernel 
> lock all drives found during bootup. then, a malicous program would need to 
> install a different kernel in order to harm the drive, which would be much 
> more secure.

It makes little difference as the attacker can replace the kernel and
reboot.
Anyway they can flash erase your video card bios, your IDE firmware,
your BIOS
and far more just as easily.

I wrote an analysis for the UK government a few years back about this
threat and concluded that a sufficiently malicious attacker and a
suitable hole would allow someone to wipe out large numbers of PCs on a
fairly permanent basis. We can just be glad that the folks writing stuff
like slammer mostly want either fame or are operating "commercially" (ie
DoS protection rackets, spam etc) so don't wish to kill their hosts.

>From an OS perspective it is very hard to protect against. Locking the
boot media can help providing the BIOS settings cannot be used to boot
another disk. Dropping CAP_SYS_RAWIO early in boot will protect against
most of the potential root user directly accesses the hardware type
attacks. hdparm can help but really it needs to be in the BIOS options
to make much difference so kick your pet BIOS vendor/PC maker.

Alan


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

* Re: security issue: hard disk lock
  2005-04-11 15:36 ` Alan Cox
@ 2005-04-11 16:01   ` Jonas Diemer
  2005-04-14  3:20     ` Mark Lord
  2005-04-15 15:09     ` Alan Cox
  0 siblings, 2 replies; 10+ messages in thread
From: Jonas Diemer @ 2005-04-11 16:01 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi Alan!

Thanks for the info

Am Montag 11. April 2005 17:36 schrieb Alan Cox:
> It makes little difference as the attacker can replace the kernel and
> reboot.
> Anyway they can flash erase your video card bios, your IDE firmware,
> your BIOS
> and far more just as easily.

Yes, but a new video-card or Motherboard can be easily bought (although it 
costs), but the data on a locked disk is lost forever, unless you pay for 
professional recovery (which is also a time-issue, if time critical data is 
stored on the disk). Of course, this can be solved with a good backup 
strategy...

I agree with you though, that this really isn't a kernel issue, but a BIOS 
thing. Distributors should/could provide additional security by freezing the 
security-features early during boot, until BIOS vendors do their homework.

regards,
Jonas

PS: Still not on the list, so please CC me in an eventual reply.

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

* Re: security issue: hard disk lock
  2005-04-11 16:01   ` Jonas Diemer
@ 2005-04-14  3:20     ` Mark Lord
  2005-04-15 15:09     ` Alan Cox
  1 sibling, 0 replies; 10+ messages in thread
From: Mark Lord @ 2005-04-14  3:20 UTC (permalink / raw)
  To: Jonas Diemer; +Cc: Linux Kernel Mailing List

hdparm-6.0 is currently winding through release channels,
and includes support for freezing/managing the security status.

Cheers

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

* Re: security issue: hard disk lock
  2005-04-11 16:01   ` Jonas Diemer
  2005-04-14  3:20     ` Mark Lord
@ 2005-04-15 15:09     ` Alan Cox
  1 sibling, 0 replies; 10+ messages in thread
From: Alan Cox @ 2005-04-15 15:09 UTC (permalink / raw)
  To: Jonas Diemer; +Cc: Linux Kernel Mailing List

On Llu, 2005-04-11 at 17:01, Jonas Diemer wrote:
> Yes, but a new video-card or Motherboard can be easily bought (although it 
> costs), but the data on a locked disk is lost forever, unless you pay for 
> professional recovery (which is also a time-issue, if time critical data is 
> stored on the disk). Of course, this can be solved with a good backup 
> strategy...

It still causes great inconvenience I agree. 

> I agree with you though, that this really isn't a kernel issue, but a BIOS 
> thing. Distributors should/could provide additional security by freezing the 
> security-features early during boot, until BIOS vendors do their homework.

Its really for Jeff and Bartlomiej to call but I'd certainly not be
opposed to freezing the security state in the kernel at boot by default.

Alan


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

end of thread, other threads:[~2005-04-15 15:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-04 17:42 security issue: hard disk lock Jonas Diemer
2005-04-04 18:32 ` Horst von Brand
2005-04-04 23:00   ` Chris Friesen
2005-04-05 15:41   ` Vernon Mauery
2005-04-05 17:10     ` Jonas Diemer
2005-04-04 19:26 ` Florian Weimer
2005-04-11 15:36 ` Alan Cox
2005-04-11 16:01   ` Jonas Diemer
2005-04-14  3:20     ` Mark Lord
2005-04-15 15:09     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).