• Geert Uytterhoeven's avatar
    m68k/atari: ARAnyM - Fix NatFeat module support · 52bd8a08
    Geert Uytterhoeven authored
    commit e8184e10 upstream.
    
    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: default avatarThorsten Glaser <tg@debian.org>
    Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    52bd8a08
natfeat.c 1.78 KB