NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/40342: compat_linux sigaction broken



>Number:         40342
>Category:       kern
>Synopsis:       compat_linux sigaction broken on non-modular kernel
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 08 09:50:00 +0000 2009
>Originator:     Arto Huusko
>Release:        NetBSD 5.99.5
>Organization:
>Environment:
>Description:
    compat_linux sigaction syscalls are broken because of recent changes to
    sigaction1(), if kernel is compiled without MODULAR and appropriate
    NetBSD COMPAT_? options. All linux sigaction syscalls that specify an
    action fail with EINVAL.

    The problem is caused as follows:

    - compat_linux calls sigaction1() with vers == 0
    - sigaction1 tries to load compat module in order to initialize
      sendsig_sigcontext_vec
    - because kernel is not MODULAR (and NetBSD COMPAT_ options not defined?)
      sendsig_sigcontext_vec is not initialized
    - version validation fails at:

        case 0:
            /* sigcontext, kernel supplied trampoline. */
            if (tramp != NULL || !v0v1valid) {
                return EINVAL;
            }
            break;

>How-To-Repeat:
    Run linux binary that calls sigaction, and observe it failing one way
    or the other.
>Fix:
    One fix is to change version validation to check v0v1valid only if
    native sendsig is used:

        case 0:
            /* sigcontext, kernel supplied trampoline. */
            if (tramp != NULL)
                return EINVAL;
            if (p->p_emul->e_sendsig == sendsig && !v0v1valid)
                return EINVAL;
            break;



Home | Main Index | Thread Index | Old Index