• lio's avatar
    lib:fix possible returning EINVAL when evl_attach* called by SCHED_RR threads · f20f616f
    lio authored and Philippe Gerum's avatar Philippe Gerum committed
    
    
    When evl_attach_thread() was called,  a local stack variable *attrs* will copy-
    from-user to linux-evl. The problem is that *attrs* initializes only two of its
    members:attrs.sched_policy and attrs.sched_priority, but none of the other
    members are initialized.
    
    These uninitialized may be "zero" or any other random values, for example:
    attrs->sched_rr_quantum may be some none-zero value when the threads under
    discussion is a SCHED_RR task.
    In this case, *attrs* copyed to linux-evl in *thread_common_ioctl()*, and
    attrs->sched_rr_quantum is none-zero value; then fllowed call *set_time_slice*
    will lead to a -EINVAL return for meet *quantum <= evl_get_clock_gravity()*.
    
    This patch will initialize all members of *attrs* to zero.
    Signed-off-by: default avatarlio <liu.hailong6@zte.com.cn>
    f20f616f
thread.c 4.84 KB