From owner-svn-src-user@freebsd.org Mon May 11 01:20:41 2020 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F16F82D1EAE for ; Mon, 11 May 2020 01:20:41 +0000 (UTC) (envelope-from gordon@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49L36169J1z3P3G; Mon, 11 May 2020 01:20:41 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4DBFE854; Mon, 11 May 2020 01:20:41 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B1KfeT084886; Mon, 11 May 2020 01:20:41 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B1KeUw084882; Mon, 11 May 2020 01:20:40 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005110120.04B1KeUw084882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Mon, 11 May 2020 01:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r360886 - in user/cperciva/freebsd-update-build/scripts: 11.3-RELEASE/amd64 11.3-RELEASE/i386 12.1-RELEASE/amd64 12.1-RELEASE/i386 X-SVN-Group: user X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in user/cperciva/freebsd-update-build/scripts: 11.3-RELEASE/amd64 11.3-RELEASE/i386 12.1-RELEASE/amd64 12.1-RELEASE/i386 X-SVN-Commit-Revision: 360886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 01:20:42 -0000 Author: gordon Date: Mon May 11 01:20:40 2020 New Revision: 360886 URL: https://svnweb.freebsd.org/changeset/base/360886 Log: Update expiry dates based on currently published release schedules. Modified: user/cperciva/freebsd-update-build/scripts/11.3-RELEASE/amd64/build.conf user/cperciva/freebsd-update-build/scripts/11.3-RELEASE/i386/build.conf user/cperciva/freebsd-update-build/scripts/12.1-RELEASE/amd64/build.conf user/cperciva/freebsd-update-build/scripts/12.1-RELEASE/i386/build.conf Modified: user/cperciva/freebsd-update-build/scripts/11.3-RELEASE/amd64/build.conf ============================================================================== --- user/cperciva/freebsd-update-build/scripts/11.3-RELEASE/amd64/build.conf Sun May 10 22:54:30 2020 (r360885) +++ user/cperciva/freebsd-update-build/scripts/11.3-RELEASE/amd64/build.conf Mon May 11 01:20:40 2020 (r360886) @@ -7,4 +7,4 @@ export SOURCEPARTS="src" export KERNELPARTS="kernel kernel-dbg" # EOL date -export EOL=1594684800 +export EOL=1601424000 Modified: user/cperciva/freebsd-update-build/scripts/11.3-RELEASE/i386/build.conf ============================================================================== --- user/cperciva/freebsd-update-build/scripts/11.3-RELEASE/i386/build.conf Sun May 10 22:54:30 2020 (r360885) +++ user/cperciva/freebsd-update-build/scripts/11.3-RELEASE/i386/build.conf Mon May 11 01:20:40 2020 (r360886) @@ -7,4 +7,4 @@ export SOURCEPARTS="src" export KERNELPARTS="kernel kernel-dbg" # EOL date -export EOL=1594684800 +export EOL=1601424000 Modified: user/cperciva/freebsd-update-build/scripts/12.1-RELEASE/amd64/build.conf ============================================================================== --- user/cperciva/freebsd-update-build/scripts/12.1-RELEASE/amd64/build.conf Sun May 10 22:54:30 2020 (r360885) +++ user/cperciva/freebsd-update-build/scripts/12.1-RELEASE/amd64/build.conf Mon May 11 01:20:40 2020 (r360886) @@ -7,4 +7,4 @@ export SOURCEPARTS="src" export KERNELPARTS="kernel kernel-dbg" # EOL date -export EOL=1604793600 +export EOL=1612051200 Modified: user/cperciva/freebsd-update-build/scripts/12.1-RELEASE/i386/build.conf ============================================================================== --- user/cperciva/freebsd-update-build/scripts/12.1-RELEASE/i386/build.conf Sun May 10 22:54:30 2020 (r360885) +++ user/cperciva/freebsd-update-build/scripts/12.1-RELEASE/i386/build.conf Mon May 11 01:20:40 2020 (r360886) @@ -7,4 +7,4 @@ export SOURCEPARTS="src" export KERNELPARTS="kernel kernel-dbg" # EOL date -export EOL=1604793600 +export EOL=1612051200 From owner-svn-src-user@freebsd.org Wed May 13 06:41:42 2020 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF4BD2EB870 for ; Wed, 13 May 2020 06:41:42 +0000 (UTC) (envelope-from pho@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MQ7V4mB2z4c1X; Wed, 13 May 2020 06:41:42 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9ECC61D53C; Wed, 13 May 2020 06:41:42 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D6fgma077934; Wed, 13 May 2020 06:41:42 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D6fg8Y077933; Wed, 13 May 2020 06:41:42 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202005130641.04D6fg8Y077933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 13 May 2020 06:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r361003 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 361003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 06:41:42 -0000 Author: pho Date: Wed May 13 06:41:42 2020 New Revision: 361003 URL: https://svnweb.freebsd.org/changeset/base/361003 Log: Added a regression test. PR: 246385 Added: user/pho/stress2/misc/sigfastblock2.sh (contents, props changed) Added: user/pho/stress2/misc/sigfastblock2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/sigfastblock2.sh Wed May 13 06:41:42 2020 (r361003) @@ -0,0 +1,134 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 corydoras@ridiculousfish.com +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# The test scenario is from: +# Bug 246385 - SIGCHLD dropped if generated while blocked in sigfastblock +# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246385 +# Fixed by r360940 + +. ../default.cfg + +cat > /tmp/sigfastblock2.c < +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static int pipes[2]; + +static void assert_noerr(int res) +{ + if (res < 0) + { + fprintf(stderr, "error: %s", strerror(res)); + exit(EXIT_FAILURE); + } +} + +static void sigchld_handler(int sig) +{ + // Write a byte to the write end of pipes. + (void)sig; + char c = 0; + ssize_t amt = write(pipes[1], &c, 1); + if (amt < 0) + { + perror("write"); + exit(EXIT_FAILURE); + } +} + +static pid_t spawn_child() +{ + pid_t pid = fork(); + assert_noerr(pid); + if (pid == 0) + { + _exit(0); + } + return pid; +} + +int main(void) +{ + // Install SIGCHLD handler with SA_RESTART. + struct sigaction chld_act = {}; + sigemptyset(&chld_act.sa_mask); + chld_act.sa_handler = &sigchld_handler; + chld_act.sa_flags = SA_RESTART; + assert_noerr(sigaction(SIGCHLD, &chld_act, NULL)); + + // Make our self-pipes. + assert_noerr(pipe(pipes)); + + // Spawn and reap children in a loop. + for (;;) + { + // Spawn a child. + pid_t child = spawn_child(); + assert(child >= 0 && "Invalid pid"); + + // Wait for the SIGCHLD handler to write to us. + for (;;) + { + char buf[PIPE_BUF]; + alarm(5); + ssize_t amt = read(pipes[0], buf, sizeof buf); + if (amt >= 0) + break; + alarm(0); + } + + // Reap it. + int status = 0; + int pid_res = waitpid(child, &status, WUNTRACED | WCONTINUED); + assert(pid_res == child && "Unexpected pid"); + } + + return 0; +} +EOF +mycc -o /tmp/sigfastblock2 -Wall -Wextra /tmp/sigfastblock2.c -lpthread || + exit 1 + +timeout 5m /tmp/sigfastblock2; s=$? +[ $s -eq 124 ] && s=0 + +rm -f /tmp/sigfastblock2 /tmp/sigfastblock2.c +exit $s From owner-svn-src-user@freebsd.org Wed May 13 06:45:34 2020 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 110BE2EB943 for ; Wed, 13 May 2020 06:45:34 +0000 (UTC) (envelope-from pho@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MQCx6k9yz4cKb; Wed, 13 May 2020 06:45:33 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E22A91D599; Wed, 13 May 2020 06:45:33 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D6jXsM081901; Wed, 13 May 2020 06:45:33 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D6jX4g081900; Wed, 13 May 2020 06:45:33 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202005130645.04D6jX4g081900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 13 May 2020 06:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r361004 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 361004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 06:45:34 -0000 Author: pho Date: Wed May 13 06:45:33 2020 New Revision: 361004 URL: https://svnweb.freebsd.org/changeset/base/361004 Log: Added a syzkaller reproducer. Added: user/pho/stress2/misc/syzkaller12.sh (contents, props changed) Added: user/pho/stress2/misc/syzkaller12.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/syzkaller12.sh Wed May 13 06:45:33 2020 (r361004) @@ -0,0 +1,177 @@ +#!/bin/sh + +# Fatal trap 12: page fault while in kernel mode +# cpuid = 21; apic id = 29 +# fault virtual address = 0x5eb9977d +# fault code = supervisor read data, page not present +# instruction pointer = 0x20:0xffffffff80d8f181 +# stack pointer = 0x28:0xfffffe0126709300 +# frame pointer = 0x28:0xfffffe0126709750 +# code segment = base 0x0, limit 0xfffff, type 0x1b +# = DPL 0, pres 1, long 1, def32 0, gran 1 +# processor eflags = interrupt enabled, resume, IOPL = 0 +# current process = 12 (swi1: netisr 0) +# trap number = 12 +# panic: page fault +# cpuid = 21 +# time = 1589220309 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0126708fb0 +# vpanic() at vpanic+0x182/frame 0xfffffe0126709000 +# panic() at panic+0x43/frame 0xfffffe0126709060 +# trap_fatal() at trap_fatal+0x387/frame 0xfffffe01267090c0 +# trap_pfault() at trap_pfault+0x99/frame 0xfffffe0126709120 +# trap() at trap+0x2a5/frame 0xfffffe0126709230 +# calltrap() at calltrap+0x8/frame 0xfffffe0126709230 +# --- trap 0xc, rip = 0xffffffff80d8f181, rsp = 0xfffffe0126709300, rbp = 0xfffffe0126709750 --- +# sctp_process_control() at sctp_process_control+0x1351/frame 0xfffffe0126709750 +# sctp_common_input_processing() at sctp_common_input_processing+0x4f1/frame 0xfffffe01267098c0 +# sctp6_input_with_port() at sctp6_input_with_port+0x22c/frame 0xfffffe01267099b0 +# sctp6_input() at sctp6_input+0xb/frame 0xfffffe01267099c0 +# ip6_input() at ip6_input+0xe89/frame 0xfffffe0126709aa0 +# swi_net() at swi_net+0x1a1/frame 0xfffffe0126709b20 +# ithread_loop() at ithread_loop+0x279/frame 0xfffffe0126709bb0 +# fork_exit() at fork_exit+0x80/frame 0xfffffe0126709bf0 +# fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0126709bf0 +# --- trap 0, rip = 0, rsp = 0, rbp = 0 --- +# KDB: enter: panic +# [ thread pid 12 tid 100083 ] +# Stopped at kdb_enter+0x37: movq $0,0x10ca9a6(%rip) +# db> + +# $FreeBSD$ + +# Reproduced on r360902 +# Fixed by r360942 + +[ `uname -p` = "i386" ] && exit 0 + +. ../default.cfg +cat > /tmp/syzkaller12.c < + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void kill_and_wait(int pid, int* status) +{ + kill(pid, SIGKILL); + while (waitpid(-1, status, 0) != pid) { + } +} + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void execute_one(void); + +#define WAIT_FLAGS 0 + +static void loop(void) +{ + int iter; + for (iter = 0;; iter++) { + int pid = fork(); + if (pid < 0) + exit(1); + if (pid == 0) { + execute_one(); + exit(0); + } + int status = 0; + uint64_t start = current_time_ms(); + for (;;) { + if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) + break; + sleep_ms(1); + if (current_time_ms() - start < 5 * 1000) + continue; + kill_and_wait(pid, &status); + break; + } + } +} + +uint64_t r[1] = {0xffffffffffffffff}; + +void execute_one(void) +{ + intptr_t res = 0; + res = syscall(SYS_socket, 0x1cul, 1ul, 0x84); + if (res != -1) + r[0] = res; + *(uint8_t*)0x20000000 = 0x1c; + *(uint8_t*)0x20000001 = 0x1c; + *(uint16_t*)0x20000002 = htobe16(0x4e22); + *(uint32_t*)0x20000004 = 0; + *(uint8_t*)0x20000008 = 0; + *(uint8_t*)0x20000009 = 0; + *(uint8_t*)0x2000000a = 0; + *(uint8_t*)0x2000000b = 0; + *(uint8_t*)0x2000000c = 0; + *(uint8_t*)0x2000000d = 0; + *(uint8_t*)0x2000000e = 0; + *(uint8_t*)0x2000000f = 0; + *(uint8_t*)0x20000010 = 0; + *(uint8_t*)0x20000011 = 0; + *(uint8_t*)0x20000012 = 0; + *(uint8_t*)0x20000013 = 0; + *(uint8_t*)0x20000014 = 0; + *(uint8_t*)0x20000015 = 0; + *(uint8_t*)0x20000016 = 0; + *(uint8_t*)0x20000017 = 0; + *(uint32_t*)0x20000018 = 0; + syscall(SYS_bind, r[0], 0x20000000ul, 0x1cul); + *(uint8_t*)0x20000180 = 0x5f; + *(uint8_t*)0x20000181 = 0x1c; + *(uint16_t*)0x20000182 = htobe16(0x4e22); + *(uint32_t*)0x20000184 = 0; + *(uint64_t*)0x20000188 = htobe64(0); + *(uint64_t*)0x20000190 = htobe64(1); + *(uint32_t*)0x20000198 = 0; + syscall(SYS_connect, r[0], 0x20000180ul, 0x1cul); +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + loop(); + return 0; +} +// https://syzkaller.a +EOF +mycc -o /tmp/syzkaller12 -Wall -Wextra -O2 /tmp/syzkaller12.c -lpthread || + exit 1 + +(cd /tmp; ./syzkaller12) & +sleep 60 +pkill -9 syzkaller12 +wait + +rm -f /tmp/syzkaller12 /tmp/syzkaller12.c /tmp/syzkaller12.core +exit 0 From owner-svn-src-user@freebsd.org Wed May 13 06:47:54 2020 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9DA12EBA1D for ; Wed, 13 May 2020 06:47:54 +0000 (UTC) (envelope-from pho@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MQGf5QZ3z4cTl; Wed, 13 May 2020 06:47:54 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B55BA1D5AA; Wed, 13 May 2020 06:47:54 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D6lsjo082049; Wed, 13 May 2020 06:47:54 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D6lsFu082048; Wed, 13 May 2020 06:47:54 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202005130647.04D6lsFu082048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 13 May 2020 06:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r361005 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 361005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 06:47:54 -0000 Author: pho Date: Wed May 13 06:47:54 2020 New Revision: 361005 URL: https://svnweb.freebsd.org/changeset/base/361005 Log: Added two syzkaller reproducers. Added: user/pho/stress2/misc/syzkaller8.sh (contents, props changed) user/pho/stress2/misc/syzkaller9.sh (contents, props changed) Added: user/pho/stress2/misc/syzkaller8.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/syzkaller8.sh Wed May 13 06:47:54 2020 (r361005) @@ -0,0 +1,113 @@ +#!/bin/sh + +# panic: prot 0x3 is not subset of max_prot 0x5 +# cpuid = 0 +# time = 1586745417 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x47/frame 0xfffffe0015fe8650 +# vpanic() at vpanic+0x1c7/frame 0xfffffe0015fe86b0 +# panic() at panic+0x43/frame 0xfffffe0015fe8710 +# vm_map_insert() at vm_map_insert+0xa11/frame 0xfffffe0015fe87d0 +# vm_map_fixed() at vm_map_fixed+0x19c/frame 0xfffffe0015fe8850 +# vm_mmap_object() at vm_mmap_object+0x3be/frame 0xfffffe0015fe88e0 +# shm_mmap() at shm_mmap+0x2e3/frame 0xfffffe0015fe8980 +# kern_mmap_req() at kern_mmap_req+0xa72/frame 0xfffffe0015fe8a70 +# sys_mmap() at sys_mmap+0x53/frame 0xfffffe0015fe8ac0 +# amd64_syscall() at amd64_syscall+0x236/frame 0xfffffe0015fe8bf0 + +# $FreeBSD$ + +# Reproduced on r359818 +# Fixed by r359892 + +[ `uname -p` = "i386" ] && exit 0 + +. ../default.cfg +cat > /tmp/syzkaller8.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static __thread int skip_segv; +static __thread jmp_buf segv_env; + +static void segv_handler(int sig, siginfo_t* info, void* ctx __unused) +{ + uintptr_t addr = (uintptr_t)info->si_addr; + const uintptr_t prog_start = 1 << 20; + const uintptr_t prog_end = 100 << 20; + if (__atomic_load_n(&skip_segv, __ATOMIC_RELAXED) && + (addr < prog_start || addr > prog_end)) { + _longjmp(segv_env, 1); + } + exit(sig); +} + +static void install_segv_handler(void) +{ + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sa.sa_sigaction = segv_handler; + sa.sa_flags = SA_NODEFER | SA_SIGINFO; + sigaction(SIGSEGV, &sa, NULL); + sigaction(SIGBUS, &sa, NULL); +} + +#define NONFAILING(...) \ + { \ + __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ + if (_setjmp(segv_env) == 0) { \ + __VA_ARGS__; \ + } \ + __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ + } + +uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul); + install_segv_handler(); + intptr_t res = 0; + syscall(SYS___getcwd, 0x20000000ul, 0xc7ul); + res = syscall(SYS_socket, 0x1cul, 3ul, 0x3a); + if (res != -1) + r[0] = res; + res = syscall(SYS_fcntl, r[0], 1ul, -1); + if (res != -1) + r[1] = res; + syscall(SYS_close, r[1]); + syscall(SYS_mprotect, 0x20000000ul, 0x4000ul, 1ul); + NONFAILING(memcpy((void*)0x20000000, "./file1\000", 8)); + syscall(SYS_freebsd12_shm_open, 0x20000000ul, 0x200ul, 0ul); + res = syscall(SYS_freebsd10_pipe, 0x20000080ul); + if (res != -1) + NONFAILING(r[2] = *(uint32_t*)0x20000084); + syscall(SYS_mmap, 0x20d43000ul, 0x200000ul, 3ul, 0x12ul, r[2], 0ul); + return 0; +} +EOF +mycc -o /tmp/syzkaller8 -Wall -Wextra -O2 /tmp/syzkaller8.c -lpthread || + exit 1 + +(cd /tmp; ./syzkaller8) & +sleep 60 +pkill -9 syzkaller8 +wait + +rm -f /tmp/syzkaller8 /tmp/syzkaller8.c /tmp/syzkaller8.core /tmp/file0 +exit 0 Added: user/pho/stress2/misc/syzkaller9.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/syzkaller9.sh Wed May 13 06:47:54 2020 (r361005) @@ -0,0 +1,104 @@ +#!/bin/sh + +# Fatal trap 12: page fault while in kernel mode +# cpuid = 0; apic id = 00 +# fault virtual address = 0x18 +# fault code = supervisor read data, page not present +# instruction pointer = 0x20:0xffffffff80ffe995 +# stack pointer = 0x28:0xfffffe0015e1d6f0 +# frame pointer = 0x28:0xfffffe0015e1d720 +# code segment = base 0x0, limit 0xfffff, type 0x1b +# = DPL 0, pres 1, long 1, def32 0, gran 1 +# processor eflags = interrupt enabled, resume, IOPL = 0 +# current process = 744 (syz-executor7538254) +# trap number = 12 +# panic: page fault +# cpuid = 0 +# time = 1575776142 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x47/frame 0xfffffe0015e1d2f0 +# vpanic() at vpanic+0x1c7/frame 0xfffffe0015e1d360 +# panic() at panic+0x43/frame 0xfffffe0015e1d3c0 +# trap_fatal() at trap_fatal+0x4cc/frame 0xfffffe0015e1d440 +# trap_pfault() at trap_pfault+0xdc/frame 0xfffffe0015e1d4e0 +# trap() at trap+0x441/frame 0xfffffe0015e1d620 +# calltrap() at calltrap+0x8/frame 0xfffffe0015e1d620 +# --- trap 0xc, rip = 0xffffffff80ffe995, rsp = 0xfffffe0015e1d6f0, rbp = 0xfffffe0015e1d720 --- +# __mtx_assert() at __mtx_assert+0x85/frame 0xfffffe0015e1d720 +# uipc_send() at uipc_send+0xeec/frame 0xfffffe0015e1d810 +# sosend_generic() at sosend_generic+0x707/frame 0xfffffe0015e1d8d0 +# sosend() at sosend+0xc6/frame 0xfffffe0015e1d940 +# kern_sendit() at kern_sendit+0x32d/frame 0xfffffe0015e1d9f0 +# sendit() at sendit+0x226/frame 0xfffffe0015e1da50 +# sys_sendmsg() at sys_sendmsg+0x8b/frame 0xfffffe0015e1dab0 +# amd64_syscall() at amd64_syscall+0x46d/frame 0xfffffe0015e1dbf0 +# fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0015e1dbf0 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x41c3ea, rsp = 0x7fffffffeb98, rbp = 0x7fffffffebf0 --- + +# $FreeBSD$ + +# Reproduced on r359818 +# Fixed by r359893 + +[ `uname -p` = "i386" ] && exit 0 + +. ../default.cfg +cat > /tmp/syzkaller9.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x1012ul, -1, 0ul); + intptr_t res = 0; + res = syscall(SYS_socket, 1ul, 5ul, 0ul); + if (res != -1) + r[0] = res; + memcpy((void*)0x20000000, "\x1d\x01\x2e\x2f\x66\x69\x6c\x65\x30\x00", 10); + syscall(SYS_bind, r[0], 0x20000000ul, 0xaul); + syscall(SYS_listen, r[0], 0); + res = syscall(SYS_socket, 1ul, 5ul, 0ul); + if (res != -1) + r[1] = res; + *(uint64_t*)0x20002640 = 0x20000000; + *(uint8_t*)0x20000000 = 0xa; + *(uint8_t*)0x20000001 = 1; + memcpy((void*)0x20000002, "./file0\000", 8); + *(uint32_t*)0x20002648 = 0xa; + *(uint64_t*)0x20002650 = 0; + *(uint64_t*)0x20002658 = 0; + *(uint64_t*)0x20002660 = 0x20002580; + memcpy((void*)0x20002580, + "\x10\x00\x00\x00\xff\xff\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", + 16); + *(uint64_t*)0x20002668 = 0x10; + *(uint32_t*)0x20002670 = 0; + syscall(SYS_sendmsg, r[1], 0x20002640ul, 0ul); + return 0; +} +EOF +mycc -o /tmp/syzkaller9 -Wall -Wextra -O2 /tmp/syzkaller9.c -lpthread || + exit 1 + +(cd /tmp; ./syzkaller9) & +sleep 60 +pkill -9 syzkaller9 +wait + +rm -f /tmp/syzkaller9 /tmp/syzkaller9.c /tmp/syzkaller9.core /tmp/file0 +exit 0 From owner-svn-src-user@freebsd.org Fri May 15 16:14:50 2020 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCF122F9892 for ; Fri, 15 May 2020 16:14:50 +0000 (UTC) (envelope-from gordon@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ntlt5bRyz445r; Fri, 15 May 2020 16:14:50 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A146F27063; Fri, 15 May 2020 16:14:50 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FGEoKo010227; Fri, 15 May 2020 16:14:50 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FGEouK010226; Fri, 15 May 2020 16:14:50 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005151614.04FGEouK010226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Fri, 15 May 2020 16:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r361083 - in user/cperciva/freebsd-update-build/scripts/11.4-BETA2: . amd64 i386 X-SVN-Group: user X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in user/cperciva/freebsd-update-build/scripts/11.4-BETA2: . amd64 i386 X-SVN-Commit-Revision: 361083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 16:14:50 -0000 Author: gordon Date: Fri May 15 16:14:50 2020 New Revision: 361083 URL: https://svnweb.freebsd.org/changeset/base/361083 Log: Add 11.4-BETA2. Added: user/cperciva/freebsd-update-build/scripts/11.4-BETA2/ user/cperciva/freebsd-update-build/scripts/11.4-BETA2/amd64/ user/cperciva/freebsd-update-build/scripts/11.4-BETA2/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/11.4-BETA2/i386/ user/cperciva/freebsd-update-build/scripts/11.4-BETA2/i386/build.conf (contents, props changed) Added: user/cperciva/freebsd-update-build/scripts/11.4-BETA2/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/11.4-BETA2/amd64/build.conf Fri May 15 16:14:50 2020 (r361083) @@ -0,0 +1,10 @@ +export RELH=88d2b664bef4096037dd7bf561b71cee05551fd39b33c0f5f01b4ba9b631940b2a3187d8f3e8b83765e3f7fa83c843fecd0f850613a0144be0aa4ae0f9e9099a +export FTP=https://people.freebsd.org/~gjb/11.4-BETA2 + +# Components of the world, source, and kernels +export WORLDPARTS="base base-dbg doc lib32 lib32-dbg" +export SOURCEPARTS="src" +export KERNELPARTS="kernel kernel-dbg" + +# EOL date +export EOL=1590883200 Added: user/cperciva/freebsd-update-build/scripts/11.4-BETA2/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/11.4-BETA2/i386/build.conf Fri May 15 16:14:50 2020 (r361083) @@ -0,0 +1,10 @@ +export RELH=3880a9dbf4429f2b5081c88f7eaaaad4e08c90867cefc7f8090b544aafa86b2964b46063325e76bbb433e250512dfa401eecf3eeff0f93deb6b46936d3c8399a +export FTP=https://people.freebsd.org/~gjb/11.4-BETA2 + +# Components of the world, source, and kernels +export WORLDPARTS="base base-dbg doc" +export SOURCEPARTS="src" +export KERNELPARTS="kernel kernel-dbg" + +# EOL date +export EOL=1590883200