public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Tough Issue: kernel instruction corruption
@ 2008-07-05 14:20 Gavin Shan
  2008-07-05 15:17 ` Arjan van de Ven
  2008-07-07 15:48 ` Stefan Richter
  0 siblings, 2 replies; 4+ messages in thread
From: Gavin Shan @ 2008-07-05 14:20 UTC (permalink / raw)
  To: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 592 bytes --]

Hello, I'm faced a tough issue recently: instructions of kernel
were corrupted. There has 2 PCI buses on my board and lots
of PCI devices with DMA capabality involved. I'm suspecting
the kernel instructions were corrupted by DMA operations driving
by those PCI devices with DMA capabality. 

Anybody have tried to protect kernel instructions from this case
or have any ideas to protect kernel text section?

Thanks in advance,
Gavinÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: Tough Issue: kernel instruction corruption
  2008-07-05 14:20 Tough Issue: kernel instruction corruption Gavin Shan
@ 2008-07-05 15:17 ` Arjan van de Ven
  2008-07-05 15:26   ` Gavin Shan
  2008-07-07 15:48 ` Stefan Richter
  1 sibling, 1 reply; 4+ messages in thread
From: Arjan van de Ven @ 2008-07-05 15:17 UTC (permalink / raw)
  To: Gavin Shan; +Cc: linux-kernel

On Sat, 5 Jul 2008 22:20:46 +0800
"Gavin Shan" <gshan@alcatel-lucent.com> wrote:

> Hello, I'm faced a tough issue recently: instructions of kernel
> were corrupted. There has 2 PCI buses on my board and lots
> of PCI devices with DMA capabality involved. I'm suspecting
> the kernel instructions were corrupted by DMA operations driving
> by those PCI devices with DMA capabality. 
> 
> Anybody have tried to protect kernel instructions from this case
> or have any ideas to protect kernel text section?

if you have a modern Intel board, you can enable the IOMMU on it that
will protect the kernel text (well, all of memory) from rogue DMA.
PPC generally has similar capabilities, as do some IBM x86 chipsets.

Without an IOMMU it's basically impossible to protect against such DMA.

-- 
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

* Re: Tough Issue: kernel instruction corruption
  2008-07-05 15:17 ` Arjan van de Ven
@ 2008-07-05 15:26   ` Gavin Shan
  0 siblings, 0 replies; 4+ messages in thread
From: Gavin Shan @ 2008-07-05 15:26 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: linux-kernel

>> Hello, I'm faced a tough issue recently: instructions of kernel
>> were corrupted. There has 2 PCI buses on my board and lots
>> of PCI devices with DMA capabality involved. I'm suspecting
>> the kernel instructions were corrupted by DMA operations driving
>> by those PCI devices with DMA capabality. 
>> 
>> Anybody have tried to protect kernel instructions from this case
>> or have any ideas to protect kernel text section?
> 
> if you have a modern Intel board, you can enable the IOMMU on it that
> will protect the kernel text (well, all of memory) from rogue DMA.
> PPC generally has similar capabilities, as do some IBM x86 chipsets.

PPC is used now and PPC doesn't have 2 kinds of MMUs. I don't know much
about IOMMU. Is it part of CPU?

> 
> Without an IOMMU it's basically impossible to protect against such DMA.

I did a google with "instruction"+"corruption"+"DMA" and found one matched
patent. And I go through the datasheet of PCI chips on my board, unfortunately,
the PCI chip didn't supply address protection from vager DMA.

http://www.freepatentsonline.com/y2005/0182862.html

> 
> -- 
> If you want to reach me at my work email, use arjan@linux.intel.com
> For development, discussion and tips for power savings, 
> visit http://www.lesswatts.org
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: Tough Issue: kernel instruction corruption
  2008-07-05 14:20 Tough Issue: kernel instruction corruption Gavin Shan
  2008-07-05 15:17 ` Arjan van de Ven
@ 2008-07-07 15:48 ` Stefan Richter
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Richter @ 2008-07-07 15:48 UTC (permalink / raw)
  To: Gavin Shan; +Cc: linux-kernel

Gavin Shan wrote:
> I'm suspecting
> the kernel instructions were corrupted by DMA operations driving
> by those PCI devices with DMA capabality. 
> 
> Anybody have tried to protect kernel instructions from this case
> or have any ideas to protect kernel text section?

IOMMU hardware can give some protection.  Correctly working PCI devices
and _correct drivers_ would be good to have too.
-- 
Stefan Richter
-=====-==--- -=== --===
http://arcgraph.de/sr/

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

end of thread, other threads:[~2008-07-07 15:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-05 14:20 Tough Issue: kernel instruction corruption Gavin Shan
2008-07-05 15:17 ` Arjan van de Ven
2008-07-05 15:26   ` Gavin Shan
2008-07-07 15:48 ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox