From owner-p4-projects@FreeBSD.ORG Wed Oct 2 13:51:57 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B9B36F5D; Wed, 2 Oct 2013 13:51:57 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7B957F5B for ; Wed, 2 Oct 2013 13:51:57 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [8.8.178.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 677002C95 for ; Wed, 2 Oct 2013 13:51:57 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.7/8.14.7) with ESMTP id r92DpvGf020052 for ; Wed, 2 Oct 2013 13:51:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.7/8.14.6/Submit) id r92Dpu0e020049 for perforce@freebsd.org; Wed, 2 Oct 2013 13:51:56 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 2 Oct 2013 13:51:56 GMT Message-Id: <201310021351.r92Dpu0e020049@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 931244 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 13:51:57 -0000 http://p4web.freebsd.org/@@931244?ac=10 Change 931244 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/10/02 13:51:29 Shrink PCB-embedded trusted stack down to 2 entries from 10 for now; growth of the PCB shrunk the available kernel stack sufficiently to cause deeply nested VM paths to overflow. In the case I encountered, triggered by a userspace NULL-pointer dereference, found the following on a manually unwound stack: user null pointer deref -> vm -> signal delivery -> coredump -> vfs -> page fault -> vm page filling -> interrupt delivery -> timer code -> sleepq processing -> Where consisted of taking a TLB invalid fault on the guard page and then keeling over. It would be helpful if (a) DDB's stack trace code on MIPS could walk past exceptions rather than requiring manual unwinding, and (b) code detecting stack overflow didn't promptly overwrite the register state required to debug it. In the longer term we'll need to move the TSC elsewhere. We may also want to grow the default MIPS kernel stack for 64-bit somewhat as even before my change, it came very close to the limit. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/sys/mips/include/cheri.h#24 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/include/cheri.h#24 (text+ko) ==== @@ -118,7 +118,7 @@ struct chericap csf_idc; }; -#define CHERI_STACK_DEPTH 10 /* XXXRW: 10 is a nice round number. */ +#define CHERI_STACK_DEPTH 2 /* XXXRW: 2 is a nice round number. */ struct cheri_stack { u_int cs_max; /* Maximum frame depth. */ u_int cs_pointer; /* Current frame index. */