cvs commit: src/bin/sh memalloc.c memalloc.h miscbltin.c

Stefan Farfeleder stefanf at FreeBSD.org
Fri Oct 28 03:45:20 PDT 2005


stefanf     2005-10-28 10:45:19 UTC

  FreeBSD src repository

  Modified files:
    bin/sh               memalloc.c memalloc.h miscbltin.c 
  Log:
  Protect malloc, realloc and free calls with INT{ON,OFF} directly in chkalloc,
  ckrealloc and ckfree (added), respectively.  sh jumps out of the signal handler
  using longjmp which is obviously a bad idea during malloc calls.
  
  Note: I think there is still a small race here because volatile sig_atomic_t
  only guarantees atomic reads and writes while we're doing increments and
  decrements.
  
  Protect a setmode call with INT{ON,OFF} as it calls malloc internally.
  
  PR:             45478
  Patch from:     Nate Eldredge
  
  Revision  Changes    Path
  1.27      +16 -2     src/bin/sh/memalloc.c
  1.10      +1 -2      src/bin/sh/memalloc.h
  1.34      +2 -0      src/bin/sh/miscbltin.c


More information about the cvs-src mailing list