From owner-cvs-src@FreeBSD.ORG Fri Oct 28 10:45:20 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7005616A420; Fri, 28 Oct 2005 10:45:20 +0000 (GMT) (envelope-from stefanf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3468A43D4C; Fri, 28 Oct 2005 10:45:20 +0000 (GMT) (envelope-from stefanf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j9SAjJlu096160; Fri, 28 Oct 2005 10:45:19 GMT (envelope-from stefanf@repoman.freebsd.org) Received: (from stefanf@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j9SAjJmR096150; Fri, 28 Oct 2005 10:45:19 GMT (envelope-from stefanf) Message-Id: <200510281045.j9SAjJmR096150@repoman.freebsd.org> From: Stefan Farfeleder Date: Fri, 28 Oct 2005 10:45:19 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/bin/sh memalloc.c memalloc.h miscbltin.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2005 10:45:20 -0000 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