• Eric Sandeen's avatar
    find dynamic stack allocations in checkstack.pl · 585e93ae
    Eric Sandeen authored
    Currently, checkstack.pl only looks for fixed subtractions from the stack
    pointer.  However, things like this:
    
    void function(int size)
    {
            char stackbuster[size << 2];
    ...
    
    are certainly worth pointing out, I think.
    
    This could perhaps be done more cleanly, and the following patch only
    adds "dynamic" REs for x86 and x86_64, but it works:
    
    0x00b0 crypto_cbc_decrypt_inplace [cbc]:                Dynamic (%rax)
    0x00ad crypto_pcbc_decrypt_inplace [pcbc]:              Dynamic (%rax)
    0x02f6 crypto_pcbc_encrypt_inplace [pcbc]:              Dynamic (%rax)
    0x036c _crypto_xcbc_digest_setkey [xcbc]:               Dynamic (%rax)
    ...
    
    (Inspired by Keith Owens' old stack-check script)
    Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    585e93ae
checkstack.pl 4.86 KB