Changeset 66fedb46 in rtems


Ignore:
Timestamp:
11/28/00 21:47:39 (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
e23afc3
Parents:
11edb53
Message:

2000-11-28 Chris Johns <ccj@…>

  • src/heapallocate.c: Do not allow the size to overflow when adjusting it. A test allocated a stack of -1 (~0). This actually resulted in a stack being allocated but with a size of 0xb. The allocator did not test the size to see if it rolled through 0 and so allowed the allocation to happen, the thread to get created. The task crashed as you would expect.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/ChangeLog

    r11edb53 r66fedb46  
     1       
     22000-11-28      Chris Johns <ccj@acm.org>
     3
     4        * src/heapallocate.c: Do not allow the size to overflow when
     5        adjusting it.  A test allocated a stack of -1 (~0). This
     6        actually resulted in a stack being allocated but with a
     7        size of 0xb. The allocator did not test the size to see if
     8        it rolled through 0 and so allowed the allocation to happen, the
     9        thread to get created. The task crashed as you would expect.
    110
    2112000-11-02      Joel Sherrill <joel@OARcorp.com>
  • c/src/exec/score/src/heapallocate.c

    r11edb53 r66fedb46  
    4444  void       *ptr;
    4545  unsigned32  offset;
    46  
     46
     47  /*
     48   * Catch the case of a user allocating close to the limit of the
     49   * unsigned32.
     50   */
     51
     52  if ( size >= (-1 - HEAP_BLOCK_USED_OVERHEAD) )
     53    return( NULL );
     54
    4755  excess   = size % the_heap->page_size;
    4856  the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD;
  • cpukit/score/ChangeLog

    r11edb53 r66fedb46  
     1       
     22000-11-28      Chris Johns <ccj@acm.org>
     3
     4        * src/heapallocate.c: Do not allow the size to overflow when
     5        adjusting it.  A test allocated a stack of -1 (~0). This
     6        actually resulted in a stack being allocated but with a
     7        size of 0xb. The allocator did not test the size to see if
     8        it rolled through 0 and so allowed the allocation to happen, the
     9        thread to get created. The task crashed as you would expect.
    110
    2112000-11-02      Joel Sherrill <joel@OARcorp.com>
  • cpukit/score/src/heapallocate.c

    r11edb53 r66fedb46  
    4444  void       *ptr;
    4545  unsigned32  offset;
    46  
     46
     47  /*
     48   * Catch the case of a user allocating close to the limit of the
     49   * unsigned32.
     50   */
     51
     52  if ( size >= (-1 - HEAP_BLOCK_USED_OVERHEAD) )
     53    return( NULL );
     54
    4755  excess   = size % the_heap->page_size;
    4856  the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD;
Note: See TracChangeset for help on using the changeset viewer.