Date: Fri, 28 Oct 2005 10:45:19 +0000 (UTC) From: Stefan Farfeleder <stefanf@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/bin/sh memalloc.c memalloc.h miscbltin.c Message-ID: <200510281045.j9SAjJmR096150@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510281045.j9SAjJmR096150>
