[haiku-commits] Re: r42566 - haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon_hd

  • From: Philippe Houdoin <philippe.houdoin@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 8 Aug 2011 11:12:04 +0200

Axel said:
> @Alex: if you do like you say, there is no reason to make the area r/w for
> userland applications at all.
> Just use B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA in that case.

In this case, the userland "applications" are radeon_hd.accelerant
instances, and the concerned area is hosting a copy of the AtomBIOS
found in card rom.

While at first it make sense to protect from unwanted changes to a
copy of a ROM image, just keep in mind that, possibly, while porting
code from xf86-video-radeonhd or linux's drm radeon code, that foreign
code could use some dark magic (to be both polite and geeky) like
patching AtomBIOS byte-code or, a little less unlikely IMHO, AtomBIOS
tables content.

For info, in Linux code, the image is copied via _kmemdup(), which
AFAICT let the copied data [over]writable.

Bye,
Philippe.

Other related posts: