]> git.baikalelectronics.ru Git - kernel.git/commit
m68k/atari: ARAnyM - Fix NatFeat module support
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 25 Jul 2013 22:08:25 +0000 (00:08 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 14 Aug 2013 09:46:30 +0000 (11:46 +0200)
commitd7f8757c1abc08c5ed93da5b2846b7231ead6c20
treeebad6db137be91c88259ca21de265fd520126256
parente5b409e9bb5c0a59f3e007a87aa07957c673447f
m68k/atari: ARAnyM - Fix NatFeat module support

As pointed out by Andreas Schwab, pointers passed to ARAnyM NatFeat calls
should be physical addresses, not virtual addresses.

Fortunately on Atari, physical and virtual kernel addresses are the same,
as long as normal kernel memory is concerned, so this usually worked fine
without conversion.

But for modules, pointers to literal strings are located in vmalloc()ed
memory. Depending on the version of ARAnyM, this causes the nf_get_id()
call to just fail, or worse, crash ARAnyM itself with e.g.

    Gotcha! Illegal memory access. Atari PC = $968c

This is a big issue for distro kernels, who want to have all drivers as
loadable modules in an initrd.

Add a wrapper for nf_get_id() that copies the literal to the stack to
work around this issue.

Reported-by: Thorsten Glaser <tg@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@vger.kernel.org
arch/m68k/emu/natfeat.c