Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance IS_LOADABLE_DYN and LOAD_DYN to also check that the garbage collector matches #5869

Open
fingolfin opened this issue Dec 12, 2024 · 0 comments
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: kernel

Comments

@fingolfin
Copy link
Member

Thanks to a clever idea by @ChrisJefferson kernel extensions these days are checked for using an ABI version compatible with the active GAP kernel. This is done by a little hack using the type field of StructInitInfo to encode the version:

    // info->type should not be larger than kernel version
    if (info->type / 10 > GAP_KERNEL_API_VERSION)
        return False;

    // info->type should not have an older major version
    if (info->type / 10000 < GAP_KERNEL_MAJOR_VERSION)
        return False;

    // info->type % 10 should be 0, 1 or 2, for the 3 types of module
    if (info->type % 10 > 2)
        return False;

    return True;

Perhaps we can use a few more bits of that to also store which GC was used to compile the kext (say 0=GASMAN, 1=Julia, 2=Boehm). Then we would be able to avoid loading kexts into a kernel which has the right version but different GC implementation.

@fingolfin fingolfin added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: kernel labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: kernel
Projects
None yet
Development

No branches or pull requests

1 participant