From nobody Thu Aug 24 18:03:04 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RWrXm2KSLz4rQYq; Thu, 24 Aug 2023 18:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RWrXm1mlgz4Z87; Thu, 24 Aug 2023 18:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692900184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXcHbQvvsjop5aVm0zOHxW165G0I3HV1jptjgotV+Zg=; b=LAEb2WtQxUXW8J0VMSOEVCMlFosxeiSAG3KilP5zimlapSBjHY6tncIzwHAUBSXBtB4vPn h9DMl2lrBbzmgSSHHefvnxhcIDU1OV0Rsk1ckFYLPVgjFiB0GG9QjHFvguQp4nuaziATWv 7SqLjza+rap/wjzWuajv9bUmPam9R+OkX5jLs0BR2r99ieAyMaCsDJm8TMJHXKEd8ftIy8 8rHrOVRYo/eMgrRgtUZ7/shLWvnAdFMfApN7h6R/HHNfXGq12NHpCduHFhj4klGghG1q9O GN69xTfCadGCC7+AApuP/l2xkAyhW0PXcpzauBo6tAPreGnhQuk1Uzvm46vs6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692900184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXcHbQvvsjop5aVm0zOHxW165G0I3HV1jptjgotV+Zg=; b=qD23eRTx9cXx8iCsmnDzg7DXbYHmVvcncm9BlcntYPeiTAZE1H6rQ8O/Z7OBgeiWDFj0yp iFNvkvFSzLbSDClTBAnWOwCfFmNF0aar4TlYpCYfCAIT7URGxtQwt5dHJgNYcMzpp4XzW7 KzkpUgwD4gMHOWKCGDfiU17O38ffW9FNVsaCMo4Q1sI7Rwowruh7dZIAdzq3qGQE3gtip6 01ylPmAaGxrcikOH94ZmmhZ9tYz3seloEDWeARk2h56YW/pZW8t4batBxPemmnensVs8Rt H36sxuIIbwzoXxnPpzCFM6Zlu++lfrPfNDmaNauVWOLZmrY1UVuig/LVwwQRAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692900184; a=rsa-sha256; cv=none; b=Zdeyx/iJDR4z/jnGn8THm+CIAJgKlfdGopGgvLoaTQsr5lFZixtU8Jo4cgIz1/21jSrHHh XZ4Zls4Wo+KADMb2PX1UMDtw6Na3EfV3T+o7rENcLHXcqiXjCarTnZ6szIBnKDVvz1kxUp hK1Cgzih7qUqOO/zKniQFBAFsynv7ywBHzyodBs8dYRY62zCkLFJMy0+FwmbGh6EXKoCb8 zXdUHYsYes9UhTtkVVYO2zuhn8dNnYwcSnAfV1clYWv6Z3pGX2enRchPve3alL3mh9v0ey UEzZoLPIUO0GqANe1+o1kYlRIRGNwtVOSEtUNyvKHgJXbOeZCRPO27k/WxLjLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RWrXm0qK1zcrZ; Thu, 24 Aug 2023 18:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37OI34bk059342; Thu, 24 Aug 2023 18:03:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37OI34l4059339; Thu, 24 Aug 2023 18:03:04 GMT (envelope-from git) Date: Thu, 24 Aug 2023 18:03:04 GMT Message-Id: <202308241803.37OI34l4059339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: f8bc606aad35 - main - tests: Handle SIGSEGV in the vm stack mprotect exec test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8bc606aad35daf9853e3198f14d4a7baba36fcb Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f8bc606aad35daf9853e3198f14d4a7baba36fcb commit f8bc606aad35daf9853e3198f14d4a7baba36fcb Author: Dmitry Chagin AuthorDate: 2023-08-24 18:02:52 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-24 18:02:52 +0000 tests: Handle SIGSEGV in the vm stack mprotect exec test To exit gracefully handle SIGSEGV and mark the test as failed. MFC after: 3 days --- tests/sys/vm/stack/stack_mprotect_exec_test.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/sys/vm/stack/stack_mprotect_exec_test.c b/tests/sys/vm/stack/stack_mprotect_exec_test.c index d12d99ea39ee..ba5a1d5cb859 100644 --- a/tests/sys/vm/stack/stack_mprotect_exec_test.c +++ b/tests/sys/vm/stack/stack_mprotect_exec_test.c @@ -12,8 +12,15 @@ #include #include +#include #include +static void +sigsegv_handler(int sig __unused) +{ + + atf_tc_fail("Invalid stack protection mode after grows"); +} ATF_TC_WITHOUT_HEAD(mprotect_exec_test); ATF_TC_BODY(mprotect_exec_test, tc) @@ -22,6 +29,8 @@ ATF_TC_BODY(mprotect_exec_test, tc) char *addr, *guard; size_t alloc_size; + signal(SIGSEGV, sigsegv_handler); + pagesize = sysconf(_SC_PAGESIZE); ATF_REQUIRE(pagesize > 0);