From owner-svn-src-stable-11@freebsd.org Sun Oct 25 23:26:07 2020 Return-Path: Delivered-To: svn-src-stable-11@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 D22AF45BB1D; Sun, 25 Oct 2020 23:26:07 +0000 (UTC) (envelope-from rpokala@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CKDcH5Hmbz4g9C; Sun, 25 Oct 2020 23:26:07 +0000 (UTC) (envelope-from rpokala@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 97F801181D; Sun, 25 Oct 2020 23:26:07 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09PNQ7Gw047378; Sun, 25 Oct 2020 23:26:07 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09PNQ7AU047377; Sun, 25 Oct 2020 23:26:07 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <202010252326.09PNQ7AU047377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Sun, 25 Oct 2020 23:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367047 - stable/11/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: stable-11 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 367047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2020 23:26:07 -0000 Author: rpokala Date: Sun Oct 25 23:26:07 2020 New Revision: 367047 URL: https://svnweb.freebsd.org/changeset/base/367047 Log: MFC r366686: Allow IP over IB to work with multiple FIBs. Call M_SETFIB() to make sure the IPoIB packet is directed to the correct interface-specific FIB. This was sufficient to allow general-purpose routing using the default FIB, and a separate FIB for routing between IPoIB on ib0 and IPoEthernet on mce0. Reviewed by: hselasky Obtained from: Anmol Kumar Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D26733 Modified: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sun Oct 25 23:25:53 2020 (r367046) +++ stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sun Oct 25 23:26:07 2020 (r367047) @@ -1601,6 +1601,8 @@ ipoib_demux(struct ifnet *ifp, struct mbuf *m, u_short m_freem(m); return; } + /* Direct packet to correct FIB based on interface config */ + M_SETFIB(m, ifp->if_fib); /* * Dispatch frame to upper layer. */ From owner-svn-src-stable-11@freebsd.org Mon Oct 26 01:23:15 2020 Return-Path: Delivered-To: svn-src-stable-11@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 32CA545E19F; Mon, 26 Oct 2020 01:23:15 +0000 (UTC) (envelope-from cy@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CKHCR0bHPz4n8s; Mon, 26 Oct 2020 01:23:15 +0000 (UTC) (envelope-from cy@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 EBA5D12B77; Mon, 26 Oct 2020 01:23:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09Q1NE7u022178; Mon, 26 Oct 2020 01:23:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09Q1NEtV022177; Mon, 26 Oct 2020 01:23:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202010260123.09Q1NEtV022177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 26 Oct 2020 01:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367050 - stable/11/etc/rc.d X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/etc/rc.d X-SVN-Commit-Revision: 367050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2020 01:23:15 -0000 Author: cy Date: Mon Oct 26 01:23:14 2020 New Revision: 367050 URL: https://svnweb.freebsd.org/changeset/base/367050 Log: This is a direct commit to stable/11 however it performs MFC r366857 applied to stable/12 with r367049. This is due to src/etc/rc.d/netif having been previously moved to src/libexec/rc.d/netif. Destroy cloned interfaces at netif stop, netif restart and shutdown. This is especially important during shutdown because a child interface of lagg with WOL enabled will not enable WOL at interface shutdown and thus no WOL to wake up the device (and machine). PR: 158734, 109980 Reported by: Antonio Huete Jimenez Marat N.Afanasyev reviewed by: kp Modified: stable/11/etc/rc.d/netif Modified: stable/11/etc/rc.d/netif ============================================================================== --- stable/11/etc/rc.d/netif Mon Oct 26 01:18:15 2020 (r367049) +++ stable/11/etc/rc.d/netif Mon Oct 26 01:23:14 2020 (r367050) @@ -28,7 +28,7 @@ # PROVIDE: netif # REQUIRE: FILESYSTEMS iovctl serial sppp sysctl # REQUIRE: hostid ipfilter ipfs -# KEYWORD: nojailvnet +# KEYWORD: nojailvnet shutdown . /etc/rc.subr . /etc/network.subr From owner-svn-src-stable-11@freebsd.org Mon Oct 26 17:50:35 2020 Return-Path: Delivered-To: svn-src-stable-11@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 6C79944A66C; Mon, 26 Oct 2020 17:50:35 +0000 (UTC) (envelope-from brooks@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CKj6g2GZBz4Wp1; Mon, 26 Oct 2020 17:50:35 +0000 (UTC) (envelope-from brooks@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 30EAA1E123; Mon, 26 Oct 2020 17:50:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09QHoZp0025551; Mon, 26 Oct 2020 17:50:35 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09QHoZOb025550; Mon, 26 Oct 2020 17:50:35 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010261750.09QHoZOb025550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 26 Oct 2020 17:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367062 - stable/11/lib/libc/tests/ssp X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/lib/libc/tests/ssp X-SVN-Commit-Revision: 367062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2020 17:50:35 -0000 Author: brooks Date: Mon Oct 26 17:50:34 2020 New Revision: 367062 URL: https://svnweb.freebsd.org/changeset/base/367062 Log: MFC r366981: Only use ASAN when using the in-tree compiler When building FreeBSD 11 on a FreeBSD 12 system with CROSS_TOOLCHAIN=llvm10 we end up trying to link against the packaged version of the sanitizer library. This resulted in a requirement for getentropy(3) which is not present in FreeBSD 11. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D26903 Modified: stable/11/lib/libc/tests/ssp/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/ssp/Makefile ============================================================================== --- stable/11/lib/libc/tests/ssp/Makefile Mon Oct 26 17:47:42 2020 (r367061) +++ stable/11/lib/libc/tests/ssp/Makefile Mon Oct 26 17:50:34 2020 (r367062) @@ -6,7 +6,9 @@ NO_WERROR= WARNS?= 2 CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector -.if ${COMPILER_TYPE} == "clang" +.if ${COMPILER_TYPE} == "clang" && ${CC} == "cc" +# Only use -fsanitize=bounds when using the in-tree compiler. Otherwise +# we may link to a sanitizer library targeted at a newer kernel/libc. CFLAGS.h_raw+= -fsanitize=bounds .elif ${COMPILER_TYPE} == "gcc" CFLAGS.h_raw+= --param ssp-buffer-size=1 From owner-svn-src-stable-11@freebsd.org Thu Oct 29 11:19:48 2020 Return-Path: Delivered-To: svn-src-stable-11@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 A544A44BF5D; Thu, 29 Oct 2020 11:19:48 +0000 (UTC) (envelope-from kib@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CMNJN3yGmz4Z8k; Thu, 29 Oct 2020 11:19:48 +0000 (UTC) (envelope-from kib@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 6C7872CC0D; Thu, 29 Oct 2020 11:19:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09TBJmTq061292; Thu, 29 Oct 2020 11:19:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09TBJm99061291; Thu, 29 Oct 2020 11:19:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010291119.09TBJm99061291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 29 Oct 2020 11:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367129 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 367129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2020 11:19:48 -0000 Author: kib Date: Thu Oct 29 11:19:47 2020 New Revision: 367129 URL: https://svnweb.freebsd.org/changeset/base/367129 Log: MFC r366932: sysv_sem: semusz depends on semume. PR: 250361 Modified: stable/11/sys/kern/sysv_sem.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sysv_sem.c ============================================================================== --- stable/11/sys/kern/sysv_sem.c Thu Oct 29 11:09:48 2020 (r367128) +++ stable/11/sys/kern/sysv_sem.c Thu Oct 29 11:19:47 2020 (r367129) @@ -179,13 +179,13 @@ struct sem_undo { #define SEM_ALIGN(bytes) roundup2(bytes, sizeof(long)) /* actual size of an undo structure */ -#define SEMUSZ SEM_ALIGN(offsetof(struct sem_undo, un_ent[SEMUME])) +#define SEMUSZ(x) SEM_ALIGN(offsetof(struct sem_undo, un_ent[(x)])) /* * Macro to find a particular sem_undo vector */ #define SEMU(ix) \ - ((struct sem_undo *)(((intptr_t)semu)+ix * seminfo.semusz)) + ((struct sem_undo *)(((intptr_t)semu) + (ix) * seminfo.semusz)) /* * semaphore info struct @@ -197,7 +197,7 @@ struct seminfo seminfo = { .semmsl = SEMMSL, /* max # of semaphores per id */ .semopm = SEMOPM, /* max # of operations per semop call */ .semume = SEMUME, /* max # of undo entries per process */ - .semusz = SEMUSZ, /* size in bytes of undo structure */ + .semusz = SEMUSZ(SEMUME), /* size in bytes of undo structure */ .semvmx = SEMVMX, /* semaphore maximum value */ .semaem = SEMAEM, /* adjust on exit max value */ }; @@ -214,7 +214,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semopm, CTLFLAG_RDTUN, "Max operations per semop call"); SYSCTL_INT(_kern_ipc, OID_AUTO, semume, CTLFLAG_RDTUN, &seminfo.semume, 0, "Max undo entries per process"); -SYSCTL_INT(_kern_ipc, OID_AUTO, semusz, CTLFLAG_RDTUN, &seminfo.semusz, 0, +SYSCTL_INT(_kern_ipc, OID_AUTO, semusz, CTLFLAG_RD, &seminfo.semusz, 0, "Size in bytes of undo structure"); SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, CTLFLAG_RWTUN, &seminfo.semvmx, 0, "Semaphore maximum value"); @@ -276,6 +276,7 @@ seminit(void) M_WAITOK | M_ZERO); sema_mtx = malloc(sizeof(struct mtx) * seminfo.semmni, M_SEM, M_WAITOK | M_ZERO); + seminfo.semusz = SEMUSZ(seminfo.semume); semu = malloc(seminfo.semmnu * seminfo.semusz, M_SEM, M_WAITOK); for (i = 0; i < seminfo.semmni; i++) { From owner-svn-src-stable-11@freebsd.org Thu Oct 29 22:00:16 2020 Return-Path: Delivered-To: svn-src-stable-11@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 E0F0045F0F5; Thu, 29 Oct 2020 22:00:16 +0000 (UTC) (envelope-from brooks@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CMfWN5hn2z4PLk; Thu, 29 Oct 2020 22:00:16 +0000 (UTC) (envelope-from brooks@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 A6D18C54D; Thu, 29 Oct 2020 22:00:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09TM0GBN064577; Thu, 29 Oct 2020 22:00:16 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09TM0FLl064572; Thu, 29 Oct 2020 22:00:15 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010292200.09TM0FLl064572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 29 Oct 2020 22:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367145 - in stable/11/sys: cam dev/nvme kern sys ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/sys: cam dev/nvme kern sys ufs/ffs X-SVN-Commit-Revision: 367145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2020 22:00:16 -0000 Author: brooks Date: Thu Oct 29 22:00:15 2020 New Revision: 367145 URL: https://svnweb.freebsd.org/changeset/base/367145 Log: MFC r366911: vmapbuf: don't smuggle address or length in buf Instead, add arguments to vmapbuf. Since this argument is always a pointer use a type of void * and cast to vm_offset_t in vmapbuf. (In CheriBSD we've altered vm_fault_quick_hold_pages to take a pointer and check its bounds.) In no other situtation does b_data contain a user pointer and vmapbuf replaces b_data with the actual mapping. Suggested by: jhb Reviewed by: imp, jhb Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26784 Modified: stable/11/sys/cam/cam_periph.c stable/11/sys/dev/nvme/nvme_ctrlr.c stable/11/sys/kern/vfs_bio.c stable/11/sys/sys/buf.h stable/11/sys/ufs/ffs/ffs_rawread.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/cam_periph.c ============================================================================== --- stable/11/sys/cam/cam_periph.c Thu Oct 29 18:43:37 2020 (r367144) +++ stable/11/sys/cam/cam_periph.c Thu Oct 29 22:00:15 2020 (r367145) @@ -930,12 +930,6 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma */ mapinfo->bp[i] = getpbuf(NULL); - /* put our pointer in the data slot */ - mapinfo->bp[i]->b_data = *data_ptrs[i]; - - /* set the transfer length, we know it's < MAXPHYS */ - mapinfo->bp[i]->b_bufsize = lengths[i]; - /* set the direction */ mapinfo->bp[i]->b_iocmd = (dirs[i] == CAM_DIR_OUT) ? BIO_WRITE : BIO_READ; @@ -948,7 +942,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma * into a larger area of VM, or if userland races against * vmapbuf() after the useracc() check. */ - if (vmapbuf(mapinfo->bp[i], 1) < 0) { + if (vmapbuf(mapinfo->bp[i], *data_ptrs[i], lengths[i], 1) < 0) { relpbuf(mapinfo->bp[i], NULL); goto fail; } Modified: stable/11/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/11/sys/dev/nvme/nvme_ctrlr.c Thu Oct 29 18:43:37 2020 (r367144) +++ stable/11/sys/dev/nvme/nvme_ctrlr.c Thu Oct 29 22:00:15 2020 (r367145) @@ -988,10 +988,8 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr */ PHOLD(curproc); buf = getpbuf(NULL); - buf->b_data = pt->buf; - buf->b_bufsize = pt->len; buf->b_iocmd = pt->is_read ? BIO_READ : BIO_WRITE; - if (vmapbuf(buf, 1) < 0) { + if (vmapbuf(buf, pt->buf, pt->len, 1) < 0) { ret = EFAULT; goto err; } Modified: stable/11/sys/kern/vfs_bio.c ============================================================================== --- stable/11/sys/kern/vfs_bio.c Thu Oct 29 18:43:37 2020 (r367144) +++ stable/11/sys/kern/vfs_bio.c Thu Oct 29 22:00:15 2020 (r367145) @@ -4577,22 +4577,21 @@ vm_hold_free_pages(struct buf *bp, int newbsize) * This function only works with pager buffers. */ int -vmapbuf(struct buf *bp, int mapbuf) +vmapbuf(struct buf *bp, void *uaddr, size_t len, int mapbuf) { vm_prot_t prot; int pidx; - if (bp->b_bufsize < 0) - return (-1); prot = VM_PROT_READ; if (bp->b_iocmd == BIO_READ) prot |= VM_PROT_WRITE; /* Less backwards than it looks */ if ((pidx = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map, - (vm_offset_t)bp->b_data, bp->b_bufsize, prot, bp->b_pages, + (vm_offset_t)uaddr, len, prot, bp->b_pages, btoc(MAXPHYS))) < 0) return (-1); + bp->b_bufsize = len; bp->b_npages = pidx; - bp->b_offset = ((vm_offset_t)bp->b_data) & PAGE_MASK; + bp->b_offset = ((vm_offset_t)uaddr) & PAGE_MASK; if (mapbuf || !unmapped_buf_allowed) { pmap_qenter((vm_offset_t)bp->b_kvabase, bp->b_pages, pidx); bp->b_data = bp->b_kvabase + bp->b_offset; Modified: stable/11/sys/sys/buf.h ============================================================================== --- stable/11/sys/sys/buf.h Thu Oct 29 18:43:37 2020 (r367144) +++ stable/11/sys/sys/buf.h Thu Oct 29 22:00:15 2020 (r367145) @@ -533,7 +533,7 @@ void vfs_bio_set_flags(struct buf *bp, int ioflags); void vfs_bio_set_valid(struct buf *, int base, int size); void vfs_busy_pages(struct buf *, int clear_modify); void vfs_unbusy_pages(struct buf *); -int vmapbuf(struct buf *, int); +int vmapbuf(struct buf *, void *, size_t, int); void vunmapbuf(struct buf *); void relpbuf(struct buf *, int *); void brelvp(struct buf *); Modified: stable/11/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_rawread.c Thu Oct 29 18:43:37 2020 (r367144) +++ stable/11/sys/ufs/ffs/ffs_rawread.c Thu Oct 29 22:00:15 2020 (r367145) @@ -216,7 +216,6 @@ ffs_rawread_readahead(struct vnode *vp, bp->b_flags = 0; /* XXX necessary ? */ bp->b_iocmd = BIO_READ; bp->b_iodone = bdone; - bp->b_data = udata; blockno = offset / bsize; blockoff = (offset % bsize) / DEV_BSIZE; if ((daddr_t) blockno != blockno) { @@ -234,9 +233,8 @@ ffs_rawread_readahead(struct vnode *vp, if (bp->b_bcount + blockoff * DEV_BSIZE > bsize) bp->b_bcount = bsize - blockoff * DEV_BSIZE; - bp->b_bufsize = bp->b_bcount; - if (vmapbuf(bp, 1) < 0) + if (vmapbuf(bp, udata, bp->b_bcount, 1) < 0) return EFAULT; maybe_yield(); @@ -253,9 +251,8 @@ ffs_rawread_readahead(struct vnode *vp, if (bp->b_bcount + blockoff * DEV_BSIZE > bsize * (1 + bforwards)) bp->b_bcount = bsize * (1 + bforwards) - blockoff * DEV_BSIZE; - bp->b_bufsize = bp->b_bcount; - if (vmapbuf(bp, 1) < 0) + if (vmapbuf(bp, udata, bp->b_bcount, 1) < 0) return EFAULT; BO_STRATEGY(&dp->v_bufobj, bp); From owner-svn-src-stable-11@freebsd.org Fri Oct 30 00:32:15 2020 Return-Path: Delivered-To: svn-src-stable-11@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 2BCA0442C6C; Fri, 30 Oct 2020 00:32:15 +0000 (UTC) (envelope-from cy@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CMjtl0HvDz4YRW; Fri, 30 Oct 2020 00:32:15 +0000 (UTC) (envelope-from cy@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 E2699E594; Fri, 30 Oct 2020 00:32:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09U0WECm063426; Fri, 30 Oct 2020 00:32:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09U0WEtn063425; Fri, 30 Oct 2020 00:32:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202010300032.09U0WEtn063425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 30 Oct 2020 00:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367154 - in stable: 11/contrib/ipfilter/lib 12/contrib/ipfilter/lib X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/lib 12/contrib/ipfilter/lib X-SVN-Commit-Revision: 367154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2020 00:32:15 -0000 Author: cy Date: Fri Oct 30 00:32:14 2020 New Revision: 367154 URL: https://svnweb.freebsd.org/changeset/base/367154 Log: MFC r367069: Continued ipfilter #ifdef cleanup. The r343701 log entry contains a complete description. Modified: stable/11/contrib/ipfilter/lib/kmem.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/ipfilter/lib/kmem.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/lib/kmem.h ============================================================================== --- stable/11/contrib/ipfilter/lib/kmem.h Fri Oct 30 00:06:36 2020 (r367153) +++ stable/11/contrib/ipfilter/lib/kmem.h Fri Oct 30 00:32:14 2020 (r367154) @@ -21,7 +21,7 @@ extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); extern int kstrncpy __P((char *, long, int)); -#if defined(__NetBSD__) || defined(__OpenBSD) +#if defined(__NetBSD__) # include #endif From owner-svn-src-stable-11@freebsd.org Fri Oct 30 00:34:40 2020 Return-Path: Delivered-To: svn-src-stable-11@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 DFA7A443028; Fri, 30 Oct 2020 00:34:40 +0000 (UTC) (envelope-from cy@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CMjxX5ctsz4YbJ; Fri, 30 Oct 2020 00:34:40 +0000 (UTC) (envelope-from cy@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 A42FBE598; Fri, 30 Oct 2020 00:34:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09U0YeFA063630; Fri, 30 Oct 2020 00:34:40 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09U0YeM1063629; Fri, 30 Oct 2020 00:34:40 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202010300034.09U0YeM1063629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 30 Oct 2020 00:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367155 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 367155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2020 00:34:40 -0000 Author: cy Date: Fri Oct 30 00:34:40 2020 New Revision: 367155 URL: https://svnweb.freebsd.org/changeset/base/367155 Log: MFC r367070: Remove a random equal sign from the example. It should not be there. It's a syntax error. PR: 210303 Reported by: leventelist at gmail.com Modified: stable/11/contrib/ipfilter/man/ipf.5 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/man/ipf.5 stable/12/contrib/ipfilter/man/ipf.5 Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/man/ipf.5 ============================================================================== --- stable/11/contrib/ipfilter/man/ipf.5 Fri Oct 30 00:32:14 2020 (r367154) +++ stable/11/contrib/ipfilter/man/ipf.5 Fri Oct 30 00:34:40 2020 (r367155) @@ -355,7 +355,7 @@ block in proto tcp from any port >= 1024 to any port < pass in proto tcp from 10.1.0.0/24 to any port = 22 block out proto udp from any to 10.1.1.1 port = 135 pass in proto udp from 1.1.1.1 port = 123 to 10.1.1.1 port = 123 -pass in proto tcp from 127.0.0.0/8 to any port = 6000:6009 +pass in proto tcp from 127.0.0.0/8 to any port 6000:6009 .fi .PP If there is no desire to mention any specific source or destintion From owner-svn-src-stable-11@freebsd.org Fri Oct 30 08:06:57 2020 Return-Path: Delivered-To: svn-src-stable-11@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 1F71344B17E; Fri, 30 Oct 2020 08:06:57 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CMvzN74QKz4tnc; Fri, 30 Oct 2020 08:06:56 +0000 (UTC) (envelope-from hselasky@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 D5DDC138A0; Fri, 30 Oct 2020 08:06:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09U86uFO038996; Fri, 30 Oct 2020 08:06:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09U86uN1038995; Fri, 30 Oct 2020 08:06:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010300806.09U86uN1038995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 30 Oct 2020 08:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367158 - stable/11/sys/fs/cuse X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/fs/cuse X-SVN-Commit-Revision: 367158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2020 08:06:57 -0000 Author: hselasky Date: Fri Oct 30 08:06:56 2020 New Revision: 367158 URL: https://svnweb.freebsd.org/changeset/base/367158 Log: MFC r366961: Fix for loading cuse.ko via rc.d . Make sure we declare the cuse(3) module by name and not only by the version information, so that "kldstat -q -m cuse" works. Found by: Goran Mekic Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/fs/cuse/cuse.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/cuse/cuse.c ============================================================================== --- stable/11/sys/fs/cuse/cuse.c Fri Oct 30 08:05:47 2020 (r367157) +++ stable/11/sys/fs/cuse/cuse.c Fri Oct 30 08:06:56 2020 (r367158) @@ -66,6 +66,24 @@ #include #include +static int +cuse_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + case MOD_UNLOAD: + return (0); + default: + return (EOPNOTSUPP); + } +} + +static moduledata_t cuse_mod = { + .name = "cuse", + .evhand = &cuse_modevent, +}; + +DECLARE_MODULE(cuse, cuse_mod, SI_SUB_DEVFS, SI_ORDER_FIRST); MODULE_VERSION(cuse, 1); /* From owner-svn-src-stable-11@freebsd.org Sat Oct 31 18:42:04 2020 Return-Path: Delivered-To: svn-src-stable-11@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 E121B453172; Sat, 31 Oct 2020 18:42:04 +0000 (UTC) (envelope-from dim@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CNp1m5hw9z3Y93; Sat, 31 Oct 2020 18:42:04 +0000 (UTC) (envelope-from dim@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 A6D60BE9B; Sat, 31 Oct 2020 18:42:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09VIg4YJ023143; Sat, 31 Oct 2020 18:42:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09VIg4pw023142; Sat, 31 Oct 2020 18:42:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202010311842.09VIg4pw023142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 31 Oct 2020 18:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367228 - in stable: 11/contrib/llvm-project/lldb/source/Target 12/contrib/llvm-project/lldb/source/Target X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/lldb/source/Target 12/contrib/llvm-project/lldb/source/Target X-SVN-Commit-Revision: 367228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2020 18:42:04 -0000 Author: dim Date: Sat Oct 31 18:42:03 2020 New Revision: 367228 URL: https://svnweb.freebsd.org/changeset/base/367228 Log: MFC r364480: Merge commit 1ce07cd614be from llvm git (by me): Instantiate Error in Target::GetEntryPointAddress() only when necessary When Target::GetEntryPointAddress() calls exe_module->GetObjectFile()->GetEntryPointAddress(), and the returned entry_addr is valid, it can immediately be returned. However, just before that, an llvm::Error value has been setup, but in this case it is not consumed before returning, like is done further below in the function. In https://bugs.freebsd.org/248745 we got a bug report for this, where a very simple test case aborts and dumps core: * thread #1, name = 'testcase', stop reason = breakpoint 1.1 frame #0: 0x00000000002018d4 testcase`main(argc=1, argv=0x00007fffffffea18) at testcase.c:3:5 1 int main(int argc, char *argv[]) 2 { -> 3 return 0; 4 } (lldb) p argc Program aborted due to an unhandled Error: Error value was Success. (Note: Success values must still be checked prior to being destroyed). Thread 1 received signal SIGABRT, Aborted. thr_kill () at thr_kill.S:3 3 thr_kill.S: No such file or directory. (gdb) bt #0 thr_kill () at thr_kill.S:3 #1 0x00000008049a0004 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52 #2 0x0000000804916229 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 #3 0x000000000451b5f5 in fatalUncheckedError () at /usr/src/contrib/llvm-project/llvm/lib/Support/Error.cpp:112 #4 0x00000000019cf008 in GetEntryPointAddress () at /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Error.h:267 #5 0x0000000001bccbd8 in ConstructorSetup () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:67 #6 0x0000000001bcd2c0 in ThreadPlanCallFunction () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:114 #7 0x00000000020076d4 in InferiorCallMmap () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp:97 #8 0x0000000001f4be33 in DoAllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:604 #9 0x0000000001fe51b9 in AllocatePage () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:347 #10 0x0000000001fe5385 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:383 #11 0x0000000001974da2 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2301 #12 CanJIT () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2331 #13 0x0000000001a1bf3d in Evaluate () at /usr/src/contrib/llvm-project/lldb/source/Expression/UserExpression.cpp:190 #14 0x00000000019ce7a2 in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Target/Target.cpp:2372 #15 0x0000000001ad784c in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:414 #16 0x0000000001ad86ae in DoExecute () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:646 #17 0x0000000001a5e3ed in Execute () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp:1003 #18 0x0000000001a6c4a3 in HandleCommand () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1762 #19 0x0000000001a6f98c in IOHandlerInputComplete () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760 #20 0x0000000001a90b08 in Run () at /usr/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:548 #21 0x00000000019a6c6a in ExecuteIOHandlers () at /usr/src/contrib/llvm-project/lldb/source/Core/Debugger.cpp:903 #22 0x0000000001a70337 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2946 #23 0x0000000001d9d812 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/API/SBDebugger.cpp:1169 #24 0x0000000001918be8 in MainLoop () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:675 #25 0x000000000191a114 in main () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:890 Fix the incorrect error catch by only instantiating an Error object if it is necessary. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D86355 This should fix lldb aborting as described in the scenario above. Reported by: dmgk PR: 248745 Modified: stable/11/contrib/llvm-project/lldb/source/Target/Target.cpp Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/lldb/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/lldb/source/Target/Target.cpp Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/lldb/source/Target/Target.cpp ============================================================================== --- stable/11/contrib/llvm-project/lldb/source/Target/Target.cpp Sat Oct 31 17:26:56 2020 (r367227) +++ stable/11/contrib/llvm-project/lldb/source/Target/Target.cpp Sat Oct 31 18:42:03 2020 (r367228) @@ -2412,21 +2412,13 @@ lldb::addr_t Target::GetPersistentSymbol(ConstString n llvm::Expected Target::GetEntryPointAddress() { Module *exe_module = GetExecutableModulePointer(); - llvm::Error error = llvm::Error::success(); - assert(!error); // Check the success value when assertions are enabled. - if (!exe_module || !exe_module->GetObjectFile()) { - error = llvm::make_error("No primary executable found", - llvm::inconvertibleErrorCode()); - } else { + // Try to find the entry point address in the primary executable. + const bool has_primary_executable = exe_module && exe_module->GetObjectFile(); + if (has_primary_executable) { Address entry_addr = exe_module->GetObjectFile()->GetEntryPointAddress(); if (entry_addr.IsValid()) return entry_addr; - - error = llvm::make_error( - "Could not find entry point address for executable module \"" + - exe_module->GetFileSpec().GetFilename().GetStringRef() + "\"", - llvm::inconvertibleErrorCode()); } const ModuleList &modules = GetImages(); @@ -2437,14 +2429,21 @@ llvm::Expected Target::GetEntry continue; Address entry_addr = module_sp->GetObjectFile()->GetEntryPointAddress(); - if (entry_addr.IsValid()) { - // Discard the error. - llvm::consumeError(std::move(error)); + if (entry_addr.IsValid()) return entry_addr; - } } - return std::move(error); + // We haven't found the entry point address. Return an appropriate error. + if (!has_primary_executable) + return llvm::make_error( + "No primary executable found and could not find entry point address in " + "any executable module", + llvm::inconvertibleErrorCode()); + + return llvm::make_error( + "Could not find entry point address for primary executable module \"" + + exe_module->GetFileSpec().GetFilename().GetStringRef() + "\"", + llvm::inconvertibleErrorCode()); } lldb::addr_t Target::GetCallableLoadAddress(lldb::addr_t load_addr,