Changeset edc64c0 in mainline


Ignore:
Timestamp:
2018-07-17T22:42:57Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b1baac
Parents:
58093d9
Message:

Zero out new thread's register context

This removes the information leak in which the new thread inherited some
register values from the thread which created it. Also, now each thread
begins execution with a well-defined register state.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/thread.c

    r58093d9 redc64c0  
    352352        irq_spinlock_unlock(&tidlock, true);
    353353
    354         context_save(&thread->saved_context);
     354        memset(&thread->saved_context, 0, sizeof(thread->saved_context));
    355355        context_set(&thread->saved_context, FADDR(cushion),
    356356            (uintptr_t) thread->kstack, STACK_SIZE);
Note: See TracChangeset for help on using the changeset viewer.