Exemplo n.º 1
0
void uninit_plugin(void *self) {
    /*
     * XXX: Here, we unload our pass from the PassRegistry.  This seems to work
     * fine, until we reload this plugin again into QEMU and we get an LLVM
     * assertion saying the pass is already registered.  This seems like a bug
     * with LLVM.  Switching between TCG and LLVM works fine when passes aren't
     * added to LLVM.
     */
    llvm::PassRegistry *pr = llvm::PassRegistry::getPassRegistry();
    const llvm::PassInfo *pi =
        //pr->getPassInfo(&llvm::PandaInstrFunctionPass::ID);
        pr->getPassInfo(llvm::StringRef("PandaInstr"));
    if (!pi){
        printf("Unable to find 'PandaInstr' pass in pass registry\n");
    }
    else {
        pr->unregisterPass(*pi);
    }

    if (taintfpm) delete taintfpm; // Delete function pass manager and pass

    if (shadow) tp_free(shadow);

    panda_disable_llvm();
    panda_disable_memcb();
    panda_enable_tb_chaining();
}
Exemplo n.º 2
0
void uninit_plugin(void *self) {

    printf ("uninit taint plugin\n");

    if (shadow) tp_free(shadow);

    panda_disable_llvm();
    panda_disable_memcb();
    panda_enable_tb_chaining();

}
Exemplo n.º 3
0
void uninit_plugin(void *self) {

    printf ("uninit taint plugin\n");
    
    if (tainted_instructions) {
        for ( auto &kvp : shadow->tpc ) {
            uint64_t asid = kvp.first;
            printf ("asid = %lx\n", asid);
            for ( auto &pc : kvp.second ) {
                printf ("instr is tainted :  asid=0x%lx : pc=0x%lx \n", asid, pc);
            }
        }
    }
    
    
    /*
     * XXX: Here, we unload our pass from the PassRegistry.  This seems to work
     * fine, until we reload this plugin again into QEMU and we get an LLVM
     * assertion saying the pass is already registered.  This seems like a bug
     * with LLVM.  Switching between TCG and LLVM works fine when passes aren't
     * added to LLVM.
     */
    llvm::PassRegistry *pr = llvm::PassRegistry::getPassRegistry();
    const llvm::PassInfo *pi =
        //pr->getPassInfo(&llvm::PandaInstrFunctionPass::ID);
        pr->getPassInfo(llvm::StringRef("PandaInstr"));
    if (!pi){
        printf("Unable to find 'PandaInstr' pass in pass registry\n");
    }
    else {
        pr->unregisterPass(*pi);
    }



    if (taintfpm) delete taintfpm; // Delete function pass manager and pass
    if (shadow) tp_free(shadow);
    if (tob_io_thread) tob_delete(tob_io_thread);

    panda_disable_llvm();
    panda_disable_memcb();
    panda_enable_tb_chaining();


}