From dc927fe9f8ce04c352ac2a802c878b9da67b1e8a Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 21 May 2009 13:51:43 +0000 Subject: 2009-05-21 Joel Sherrill PR 1414/cpukit * score/src/objectget.c, score/src/objectgetisr.c, score/src/objectgetnoprotection.c: Tighten math on extraction of index so it is harder to trick by passing in a valid id of an incorrect object class. --- cpukit/ChangeLog | 8 ++++++++ cpukit/score/src/objectget.c | 7 ------- cpukit/score/src/objectgetisr.c | 7 ------- cpukit/score/src/objectgetnoprotection.c | 7 ------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 6e3d7a1cd6..e846fafd3d 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,11 @@ +2009-05-21 Joel Sherrill + + PR 1414/cpukit + * score/src/objectget.c, score/src/objectgetisr.c, + score/src/objectgetnoprotection.c: Tighten math on extraction of + index so it is harder to trick by passing in a valid id of an + incorrect object class. + 2009-04-02 Ralf Corsépius * aclocal/check-rtems-debug.m4: Add missing ','. diff --git a/cpukit/score/src/objectget.c b/cpukit/score/src/objectget.c index 1f51c20a4a..5216422759 100644 --- a/cpukit/score/src/objectget.c +++ b/cpukit/score/src/objectget.c @@ -57,14 +57,7 @@ Objects_Control *_Objects_Get( Objects_Control *the_object; uint32_t index; -#if defined(RTEMS_MULTIPROCESSING) index = id - information->minimum_id + 1; -#else - /* index = _Objects_Get_index( id ); */ - index = id & 0x0000ffff; - /* This should work but doesn't always :( */ - /* index = (uint16_t) id; */ -#endif if ( information->maximum >= index ) { _Thread_Disable_dispatch(); diff --git a/cpukit/score/src/objectgetisr.c b/cpukit/score/src/objectgetisr.c index 8a53c7b8b5..aca5f0d059 100644 --- a/cpukit/score/src/objectgetisr.c +++ b/cpukit/score/src/objectgetisr.c @@ -61,14 +61,7 @@ Objects_Control *_Objects_Get_isr_disable( uint32_t index; ISR_Level level; -#if defined(RTEMS_MULTIPROCESSING) index = id - information->minimum_id + 1; -#else - /* index = _Objects_Get_index( id ); */ - index = id & 0x0000ffff; - /* This should work but doesn't always :( */ - /* index = (uint16_t ) id; */ -#endif _ISR_Disable( level ); if ( information->maximum >= index ) { diff --git a/cpukit/score/src/objectgetnoprotection.c b/cpukit/score/src/objectgetnoprotection.c index d8df70cd46..deed67fd26 100644 --- a/cpukit/score/src/objectgetnoprotection.c +++ b/cpukit/score/src/objectgetnoprotection.c @@ -57,14 +57,7 @@ Objects_Control *_Objects_Get_no_protection( Objects_Control *the_object; uint32_t index; -#if defined(RTEMS_MULTIPROCESSING) index = id - information->minimum_id + 1; -#else - /* index = _Objects_Get_index( id ); */ - index = id & 0x0000ffff; - /* This should work but doesn't always :( */ - /* index = (uint16_t ) id; */ -#endif if ( information->maximum >= index ) { if ( (the_object = information->local_table[ index ]) != NULL ) { -- cgit v1.2.3