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

sched/sem_holder.c: When accessing SEM_WAITLIST, use holder's addrenv #11191

Merged
merged 1 commit into from Nov 15, 2023

Commits on Nov 15, 2023

  1. sched/sem_holder.c: When accessing SEM_WAITLIST, use holder's addrenv

    If the semaphore is shared, the holder has put its own mmapped address
    to pholder->sem. This means we must switch to the holder's address
    environment when going through the held semaphores list.
    
    A better option would be to get the kernel mapped address for the
    semaphore's physical page, but that mechanism is not functional yet.
    
    This fixes a full system crash when CONFIG_PRIORITY_INHERITANCE=y and
    CONFIG_BUILD_KERNEL=y and user makes shared semaphore via:
    
    int semfd  = shm_open("sem", O_CREAT | O_RDWR, 0666);
    sem_t *sem = mmap(0, sizeof(sem_t), PROT_READ | PROT_WRITE, MAP_SHARED, semfd, 0);
    pussuw committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    9993892 View commit details
    Browse the repository at this point in the history