2.6.26 코어에서 "no symbol version for xxx"문제

5486 단어
주로 2.6.26 핵의module입니다.c중 checkversion () 이 변경되었습니다. 기호 버전을 검사하지 못할 때 0 또는 - ENOEXEC을 되돌려줍니다. 이전 버전은 1을 되돌려줍니다. 이로 인해 발생한 문제입니다.
2.6.26: 코드는 다음과 같습니다.
#ifdef CONFIG_MODVERSIONS
static int check_version(Elf_Shdr *sechdrs,
                         unsigned int versindex,
                         const char *symname,
                         struct module *mod, 
                         const unsigned long *crc)
{
        unsigned int i, num_versions;
        struct modversion_info *versions;

        /* Exporting module didn't supply crcs?  OK, we're already tainted. */
        if (!crc)
                return 1;

        /* No versions at all?  modprobe --force does this. */
        if (versindex == 0)
                return try_to_force_load(mod, symname) == 0;

        versions = (void *) sechdrs[versindex].sh_addr;
        num_versions = sechdrs[versindex].sh_size
                / sizeof(struct modversion_info);

        for (i = 0; i < num_versions; i++) {
                if (strcmp(versions[i].name, symname) != 0)
                        continue;

                if (versions[i].crc == *crc)
                        return 1;
                DEBUGP("Found checksum %lX vs module %lX
", *crc, versions[i].crc); goto bad_version; } printk(KERN_WARNING "%s: no symbol version for %s
", mod->name, symname); return 0; bad_version: printk("%s: disagrees about version of symbol %s
", mod->name, symname); return 0; } static int try_to_force_load(struct module *mod, const char *symname) { #ifdef CONFIG_MODULE_FORCE_LOAD if (!(tainted & TAINT_FORCED_MODULE)) printk("%s: no version for \"%s\" found: kernel tainted.
", mod->name, symname); add_taint_module(mod, TAINT_FORCED_MODULE); return 0; #else return -ENOEXEC; #endif } 2.6.25: #ifdef CONFIG_MODVERSIONS static int check_version(Elf_Shdr *sechdrs, unsigned int versindex, const char *symname, struct module *mod, const unsigned long *crc) { unsigned int i, num_versions; struct modversion_info *versions; /* Exporting module didn't supply crcs? OK, we're already tainted. */ if (!crc) return 1; versions = (void *) sechdrs[versindex].sh_addr; num_versions = sechdrs[versindex].sh_size / sizeof(struct modversion_info); for (i = 0; i < num_versions; i++) { if (strcmp(versions[i].name, symname) != 0) continue; if (versions[i].crc == *crc) return 1; printk("%s: disagrees about version of symbol %s
", mod->name, symname); DEBUGP("Found checksum %lX vs module %lX
", *crc, versions[i].crc); return 0; } /* Not in module's version table. OK, but that taints the kernel. */ if (!(tainted & TAINT_FORCED_MODULE)) printk("%s: no version for \"%s\" found: kernel tainted.
", mod->name, symname); add_taint_module(mod, TAINT_FORCED_MODULE); return 1; }

해결 방법: 1. 커널을 다시 컴파일하고 CONFIG 를 닫습니다.MODVERSIONS 옵션 2, 커널을 다시 컴파일하여 MODULE 열기FORCE_LOAD 옵션, 강제 로드 3, 복사 Module.symversion에서 내장 원본 디렉터리로 이동한 다음 내장 원본 디렉터리에서make prepare를 실행한 다음 모듈을 컴파일할 때 KERN 을 추가합니다DIR=/usr/src/linux 4, Module 코드를 수정하고/proc/kallsyms를 통해 주소를 얻으며 함수 포인터를 부여하여 참고 자료를 사용합니다.http://www.4front-tech.com/forum/viewtopic.php?p=10907&sid=43dc39cc92cbe35d27a4f89ec1208eb0 http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/1c724e019da71903 http://ubuntuforums.org/showthread.php?p=6119045

좋은 웹페이지 즐겨찾기