From owner-svn-src-stable-11@freebsd.org Sun May 10 02:14:23 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 ABD722D55C3; Sun, 10 May 2020 02:14:23 +0000 (UTC) (envelope-from mav@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 49KSLR47Nnz4Zqf; Sun, 10 May 2020 02:14:23 +0000 (UTC) (envelope-from mav@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 8867E25AAD; Sun, 10 May 2020 02:14:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A2ENjV032783; Sun, 10 May 2020 02:14:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A2ENKF032782; Sun, 10 May 2020 02:14:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005100214.04A2ENKF032782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 10 May 2020 02:14:23 +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: r360864 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ctl X-SVN-Commit-Revision: 360864 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.32 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, 10 May 2020 02:14:23 -0000 Author: mav Date: Sun May 10 02:14:23 2020 New Revision: 360864 URL: https://svnweb.freebsd.org/changeset/base/360864 Log: MFC r360610: Add session locking in cfiscsi_ioctl_handoff(). While there, remove ifdef around cs_target check in cfiscsi_ioctl_list(). I am not sure why this ifdef was added, but without this check code will crash below on NULL dereference. Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Sun May 10 02:13:38 2020 (r360863) +++ stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Sun May 10 02:14:23 2020 (r360864) @@ -1571,8 +1571,10 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) mtx_lock(&softc->lock); if (ct->ct_online == 0) { mtx_unlock(&softc->lock); + CFISCSI_SESSION_LOCK(cs); cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); cfiscsi_target_release(ct); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), @@ -1618,8 +1620,10 @@ restart: #endif error = icl_conn_handoff(cs->cs_conn, cihp->socket); if (error != 0) { + CFISCSI_SESSION_LOCK(cs); cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), "%s: icl_conn_handoff failed with error %d", @@ -1681,10 +1685,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) sbuf_printf(sb, "\n"); mtx_lock(&softc->lock); TAILQ_FOREACH(cs, &softc->sessions, cs_next) { -#ifdef ICL_KERNEL_PROXY if (cs->cs_target == NULL) continue; -#endif error = sbuf_printf(sb, "" "%s" "%s" From owner-svn-src-stable-11@freebsd.org Sun May 10 09:50:43 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 E5A832E0294; Sun, 10 May 2020 09:50:43 +0000 (UTC) (envelope-from kp@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 49KfSz5hkjz40QP; Sun, 10 May 2020 09:50:43 +0000 (UTC) (envelope-from kp@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 BEC6D3174; Sun, 10 May 2020 09:50:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A9ohc8013629; Sun, 10 May 2020 09:50:43 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A9ohX8013628; Sun, 10 May 2020 09:50:43 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202005100950.04A9ohX8013628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 10 May 2020 09:50:43 +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: r360867 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 360867 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, 10 May 2020 09:50:44 -0000 Author: kp Date: Sun May 10 09:50:43 2020 New Revision: 360867 URL: https://svnweb.freebsd.org/changeset/base/360867 Log: MFC r360609: pf: Improve DIOCADDRULE validation We expect the addrwrap.p.dyn value to be set to NULL (and assert such), but do not verify it on input. Reported-by: syzbot+936a89182e7d8f927de1@syzkaller.appspotmail.com Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Sun May 10 09:34:48 2020 (r360866) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Sun May 10 09:50:43 2020 (r360867) @@ -1152,6 +1152,11 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in error = EINVAL; break; } + if (pr->rule.src.addr.p.dyn != NULL || + pr->rule.dst.addr.p.dyn != NULL) { + error = EINVAL; + break; + } #ifndef INET if (pr->rule.af == AF_INET) { error = EAFNOSUPPORT; From owner-svn-src-stable-11@freebsd.org Sun May 10 14:59:02 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 0CF492E9C31; Sun, 10 May 2020 14:59:02 +0000 (UTC) (envelope-from emaste@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 49KnJj6Y2tz4HlB; Sun, 10 May 2020 14:59:01 +0000 (UTC) (envelope-from emaste@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 D76AC6F28; Sun, 10 May 2020 14:59:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AEx1pr004717; Sun, 10 May 2020 14:59:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AEx1Pb004716; Sun, 10 May 2020 14:59:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005101459.04AEx1Pb004716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 10 May 2020 14:59:01 +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: r360876 - stable/11/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Commit-Revision: 360876 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, 10 May 2020 14:59:02 -0000 Author: emaste Date: Sun May 10 14:59:01 2020 New Revision: 360876 URL: https://svnweb.freebsd.org/changeset/base/360876 Log: MFC r360801: Merge commit 21e5e1724b75 from llvm git: getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD Once we hit AT_NULL, we need to bail out of the loop; not just the enclosing switch. This fixes basic usage (e.g. `cc --version`) when AT_EXECPATH isn't present on older branches (e.g. under emu-user-static, at the moment), where we would previously run off the end of ::environ. Patch By: kevans Reviewed By: arichardson Modified: stable/11/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/llvm/ (props changed) Modified: stable/11/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc ============================================================================== --- stable/11/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Sun May 10 14:56:25 2020 (r360875) +++ stable/11/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Sun May 10 14:59:01 2020 (r360876) @@ -208,14 +208,9 @@ std::string getMainExecutable(const char *argv0, void while (*p++ != 0) ; // Iterate through auxiliary vectors for AT_EXECPATH. - for (;;) { - switch (*(uintptr_t *)p++) { - case AT_EXECPATH: + for (; *(uintptr_t *)p != AT_NULL; p++) { + if (*(uintptr_t *)p++ == AT_EXECPATH) return *p; - case AT_NULL: - break; - } - p++; } #endif // Fall back to argv[0] if auxiliary vectors are not available. From owner-svn-src-stable-11@freebsd.org Mon May 11 07:01:10 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 92ED32D965C; Mon, 11 May 2020 07:01:10 +0000 (UTC) (envelope-from tsoome@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 49LBft3RRSz49TZ; Mon, 11 May 2020 07:01:10 +0000 (UTC) (envelope-from tsoome@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 713701A8E2; Mon, 11 May 2020 07:01:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B71A8X096240; Mon, 11 May 2020 07:01:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B71ATl096239; Mon, 11 May 2020 07:01:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202005110701.04B71ATl096239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 11 May 2020 07:01:10 +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: r360891 - stable/11/stand/libsa/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/11/stand/libsa/zfs X-SVN-Commit-Revision: 360891 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, 11 May 2020 07:01:10 -0000 Author: tsoome Date: Mon May 11 07:01:10 2020 New Revision: 360891 URL: https://svnweb.freebsd.org/changeset/base/360891 Log: MFC r360836: loader: vdev_read() can corrupt memory When reading less than sector size but from sector boundary, the vdev_read() will read full sector into the provided buffer and therefore corrupting memory past buffer end. Modified: stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/zfs/zfs.c ============================================================================== --- stable/11/stand/libsa/zfs/zfs.c Mon May 11 06:59:01 2020 (r360890) +++ stable/11/stand/libsa/zfs/zfs.c Mon May 11 07:01:10 2020 (r360891) @@ -417,7 +417,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void full_sec_size -= secsz; /* Return of partial sector data requires a bounce buffer. */ - if ((head > 0) || do_tail_read) { + if ((head > 0) || do_tail_read || bytes < secsz) { bouncebuf = zfs_alloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); @@ -441,14 +441,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void outbuf += min(secsz - head, bytes); } - /* Full data return from read sectors */ + /* + * Full data return from read sectors. + * Note, there is still corner case where we read + * from sector boundary, but less than sector size, e.g. reading 512B + * from 4k sector. + */ if (full_sec_size > 0) { - res = read(fd, outbuf, full_sec_size); - if (res != full_sec_size) { - ret = EIO; - goto error; + if (bytes < full_sec_size) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, bytes); + } else { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; } - outbuf += full_sec_size; } /* Partial data return from last sector */ From owner-svn-src-stable-11@freebsd.org Mon May 11 07:21:59 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 B4AB62D9AB7; Mon, 11 May 2020 07:21:59 +0000 (UTC) (envelope-from delphij@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 49LC6v4N3Gz4BpG; Mon, 11 May 2020 07:21:59 +0000 (UTC) (envelope-from delphij@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 915C21ACD5; Mon, 11 May 2020 07:21:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B7LxTa012955; Mon, 11 May 2020 07:21:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B7LxMZ012954; Mon, 11 May 2020 07:21:59 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005110721.04B7LxMZ012954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 11 May 2020 07:21:59 +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: r360893 - stable/11/sbin/swapon X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/swapon X-SVN-Commit-Revision: 360893 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, 11 May 2020 07:21:59 -0000 Author: delphij Date: Mon May 11 07:21:59 2020 New Revision: 360893 URL: https://svnweb.freebsd.org/changeset/base/360893 Log: MFC r360619: - Fix logic error in swapoff case: follow same handling of p and linelen in the swapon case. - Use strlcpy instead of strncpy. Modified: stable/11/sbin/swapon/swapon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/swapon/swapon.c ============================================================================== --- stable/11/sbin/swapon/swapon.c Mon May 11 07:20:37 2020 (r360892) +++ stable/11/sbin/swapon/swapon.c Mon May 11 07:21:59 2020 (r360893) @@ -527,8 +527,7 @@ swap_on_off_md(const char *name, char *mntops, int doi ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); errno = 0; ul = strtoul(linebuf, &p, 10); if (errno == 0) { @@ -583,14 +582,13 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, &linelen); - if (p == NULL && - (linelen < 2 || linelen > sizeof(linebuf) - 1)) { + if (p == NULL || + (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (list) unexpected output"); ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); p = strchr(linebuf, ' '); if (p != NULL) *p = '\0'; From owner-svn-src-stable-11@freebsd.org Mon May 11 22:17:25 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 7284E2EEA56; Mon, 11 May 2020 22:17:25 +0000 (UTC) (envelope-from lwhsu@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 49Lb052SSHz4HdX; Mon, 11 May 2020 22:17:25 +0000 (UTC) (envelope-from lwhsu@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 4F8A825828; Mon, 11 May 2020 22:17:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMHPu8071953; Mon, 11 May 2020 22:17:25 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMHP4e071952; Mon, 11 May 2020 22:17:25 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005112217.04BMHP4e071952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 11 May 2020 22:17:25 +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: r360938 - stable/11/lib/msun/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/lib/msun/tests X-SVN-Commit-Revision: 360938 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, 11 May 2020 22:17:25 -0000 Author: lwhsu Date: Mon May 11 22:17:24 2020 New Revision: 360938 URL: https://svnweb.freebsd.org/changeset/base/360938 Log: MFC r358887 (partially): Temporarily skip 2 failing tests after llvm10 import The DDifference of the original revision to -head is only lib.msun.ctrig_test.test_inf_inputs skipped. PR: 244732 Sponsored by: The FreeBSD Foundation Modified: stable/11/lib/msun/tests/ctrig_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/msun/tests/ctrig_test.c ============================================================================== --- stable/11/lib/msun/tests/ctrig_test.c Mon May 11 22:15:46 2020 (r360937) +++ stable/11/lib/msun/tests/ctrig_test.c Mon May 11 22:17:24 2020 (r360938) @@ -248,6 +248,9 @@ ATF_TC_BODY(test_inf_inputs, tc) long double complex z, c, s; unsigned i; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/244732"); + /* * IN CSINH CCOSH CTANH * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0 From owner-svn-src-stable-11@freebsd.org Tue May 12 14:47:38 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 CF6AE2F1868; Tue, 12 May 2020 14:47:38 +0000 (UTC) (envelope-from gjb@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 49M0yf55v6z4KvQ; Tue, 12 May 2020 14:47:38 +0000 (UTC) (envelope-from gjb@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 A5D6899D4; Tue, 12 May 2020 14:47:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CElcIM082977; Tue, 12 May 2020 14:47:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CElcMa082976; Tue, 12 May 2020 14:47:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005121447.04CElcMa082976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 12 May 2020 14:47:38 +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: r360963 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 360963 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: Tue, 12 May 2020 14:47:38 -0000 Author: gjb Date: Tue May 12 14:47:38 2020 New Revision: 360963 URL: https://svnweb.freebsd.org/changeset/base/360963 Log: Bump version numbers in the stable/11 release notes. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/release.ent Modified: stable/11/release/doc/share/xml/release.ent ============================================================================== --- stable/11/release/doc/share/xml/release.ent Tue May 12 14:01:14 2020 (r360962) +++ stable/11/release/doc/share/xml/release.ent Tue May 12 14:47:38 2020 (r360963) @@ -6,7 +6,7 @@ - + - + - + - + From owner-svn-src-stable-11@freebsd.org Tue May 12 16:05:21 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 ECE6D2F3229; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@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 49M2hK62DRz4Q3M; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@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 CA3CCA8DC; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CG5L9Y033122; Tue, 12 May 2020 16:05:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CG5Ll6033121; Tue, 12 May 2020 16:05:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005121605.04CG5Ll6033121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 12 May 2020 16:05:21 +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: r360965 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 360965 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: Tue, 12 May 2020 16:05:22 -0000 Author: jhb Date: Tue May 12 16:05:21 2020 New Revision: 360965 URL: https://svnweb.freebsd.org/changeset/base/360965 Log: MFC 358394: Use stream_read() to read all 12 bytes of the RFB client version. read() can return a short read, whereas stream_read() waits until the full version string is read. Modified: stable/11/usr.sbin/bhyve/rfb.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/bhyve/rfb.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/11/usr.sbin/bhyve/rfb.c Tue May 12 15:22:40 2020 (r360964) +++ stable/11/usr.sbin/bhyve/rfb.c Tue May 12 16:05:21 2020 (r360965) @@ -72,6 +72,7 @@ static int rfb_debug = 0; #define DPRINTF(params) if (rfb_debug) printf params #define WPRINTF(params) printf params +#define VERSION_LENGTH 12 #define AUTH_LENGTH 16 #define PASSWD_LENGTH 8 @@ -765,7 +766,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) stream_write(cfd, vbuf, strlen(vbuf)); /* 1b. Read client version */ - len = read(cfd, buf, sizeof(buf)); + len = stream_read(cfd, buf, VERSION_LENGTH); /* 2a. Send security type */ buf[0] = 1; From owner-svn-src-stable-11@freebsd.org Tue May 12 16:49:05 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 7EC072F44D8; Tue, 12 May 2020 16:49:05 +0000 (UTC) (envelope-from emaste@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 49M3fn2q5Wz4Syy; Tue, 12 May 2020 16:49:05 +0000 (UTC) (envelope-from emaste@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 5C060B0F1; Tue, 12 May 2020 16:49:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGn5FH057907; Tue, 12 May 2020 16:49:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGn5Pp057906; Tue, 12 May 2020 16:49:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121649.04CGn5Pp057906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:49:05 +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: r360971 - in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Commit-Revision: 360971 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: Tue, 12 May 2020 16:49:05 -0000 Author: emaste Date: Tue May 12 16:49:04 2020 New Revision: 360971 URL: https://svnweb.freebsd.org/changeset/base/360971 Log: MFC r360967: libalias: validate packet lengths before accessing headers admbugs: 956 Submitted by: ae Reported by: Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative Reported by: Vishnu working with Trend Micro Zero Day Initiative Approved by: so Security: FreeBSD-SA-20:12.libalias Security: CVE-2020-7454 Security: ZDI-CAN-10624, ZDI-CAN-10850 Modified: stable/11/sys/netinet/libalias/alias.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/netinet/libalias/alias.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/netinet/libalias/alias.c ============================================================================== --- stable/11/sys/netinet/libalias/alias.c Tue May 12 16:46:14 2020 (r360970) +++ stable/11/sys/netinet/libalias/alias.c Tue May 12 16:49:04 2020 (r360971) @@ -439,10 +439,15 @@ fragment contained in ICMP data section */ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { - int iresult; struct icmp *ic; + int dlen, iresult; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < ICMP_MINLEN) + return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); @@ -461,6 +466,9 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: + if (dlen < ICMP_ADVLENMIN || + dlen < ICMP_ADVLEN(ic)) + return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: @@ -729,10 +737,17 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, @@ -821,12 +836,19 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int m u_short dest_port; u_short proxy_server_port; int proxy_type; - int error; + int dlen, error; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled and not proxyrule found.*/ + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); + proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); @@ -919,8 +941,13 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -1039,7 +1066,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int proxy_type, error; + int dlen, proxy_type, error; u_short dest_port; u_short proxy_server_port; struct in_addr dest_address; @@ -1048,6 +1075,10 @@ TcpAliasOut(struct libalias *la, struct ip *pip, int m struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); if (create) From owner-svn-src-stable-11@freebsd.org Tue May 12 16:52:09 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 0D3F92F4785; Tue, 12 May 2020 16:52:09 +0000 (UTC) (envelope-from emaste@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 49M3kJ6fZdz4TbD; Tue, 12 May 2020 16:52:08 +0000 (UTC) (envelope-from emaste@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 DF8E9B294; Tue, 12 May 2020 16:52:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGq8mr060538; Tue, 12 May 2020 16:52:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGq8SC060537; Tue, 12 May 2020 16:52:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121652.04CGq8SC060537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:52:08 +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: r360973 - in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Commit-Revision: 360973 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: Tue, 12 May 2020 16:52:09 -0000 Author: emaste Date: Tue May 12 16:52:08 2020 New Revision: 360973 URL: https://svnweb.freebsd.org/changeset/base/360973 Log: MFC r360968: libalias: fix potential memory disclosure from ftp module admbugs: 956 Submitted by: markj Reported by: Vishnu Dev TJ working with Trend Micro Zero Day Initiative Approved by: so Security: FreeBSD-SA-20:13.libalias Security: CVE-2020-7455 Security: ZDI-CAN-10849 Modified: stable/11/sys/netinet/libalias/alias_ftp.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/netinet/libalias/alias_ftp.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/netinet/libalias/alias_ftp.c ============================================================================== --- stable/11/sys/netinet/libalias/alias_ftp.c Tue May 12 16:51:11 2020 (r360972) +++ stable/11/sys/netinet/libalias/alias_ftp.c Tue May 12 16:52:08 2020 (r360973) @@ -752,7 +752,8 @@ NewFtpMessage(struct libalias *la, struct ip *pip, { u_short new_len; - new_len = htons(hlen + slen); + new_len = htons(hlen + + MIN(slen, maxpacketsize - hlen)); DifferentialChecksum(&pip->ip_sum, &new_len, &pip->ip_len, From owner-svn-src-stable-11@freebsd.org Tue May 12 20:02:02 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 4C0672FEDC2; Tue, 12 May 2020 20:02:02 +0000 (UTC) (envelope-from gjb@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 49M7xQ1MrHz3Njj; Tue, 12 May 2020 20:02:02 +0000 (UTC) (envelope-from gjb@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 2A232D91C; Tue, 12 May 2020 20:02:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CK21nF079952; Tue, 12 May 2020 20:02:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CK21a1079950; Tue, 12 May 2020 20:02:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005122002.04CK21a1079950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 12 May 2020 20:02:01 +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: r360986 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 360986 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: Tue, 12 May 2020 20:02:02 -0000 Author: gjb Date: Tue May 12 20:02:01 2020 New Revision: 360986 URL: https://svnweb.freebsd.org/changeset/base/360986 Log: Document EN-20:08 through EN-20:09, and SA-20:12 through SA-20:16. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Tue May 12 18:44:41 2020 (r360985) +++ stable/11/release/doc/share/xml/errata.xml Tue May 12 20:02:01 2020 (r360986) @@ -91,6 +91,21 @@ Regression with certain NFS servers + + + FreeBSD-EN-20:08.tzdata + 12 May 2020 + Timezone database update + + + + FreeBSD-EN-20:10.build + 12 May 2020 + Incorrect build host clang version + detection + Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue May 12 18:44:41 2020 (r360985) +++ stable/11/release/doc/share/xml/security.xml Tue May 12 20:02:01 2020 (r360986) @@ -185,6 +185,36 @@ 21 April 2020 Invalid &man.mbuf.9; handling + + + FreeBSD-SA-20:12.libalias + 12 May 2020 + Insufficient packet length + validation + + + + FreeBSD-SA-20:13.libalias + 12 May 2020 + Memory disclosure vulnerability + + + + FreeBSD-SA-20:14.sctp + 12 May 2020 + Improper checking in shared key + update + + + + FreeBSD-SA-20:14.cryptodev + 12 May 2020 + Use-after-free condition + From owner-svn-src-stable-11@freebsd.org Wed May 13 18:09:05 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 0B6902FC07F; Wed, 13 May 2020 18:09:05 +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) 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 49MjNc6cdbz4MN2; Wed, 13 May 2020 18:09: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 DE4BB255FD; Wed, 13 May 2020 18:09: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 04DI94QR000583; Wed, 13 May 2020 18:09:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DI94V4000579; Wed, 13 May 2020 18:09:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005131809.04DI94V4000579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 13 May 2020 18:09: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: r361012 - in stable/11/sys: conf modules/drm2/i915kms modules/ipfilter X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11/sys: conf modules/drm2/i915kms modules/ipfilter X-SVN-Commit-Revision: 361012 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: Wed, 13 May 2020 18:09:05 -0000 Author: dim Date: Wed May 13 18:09:03 2020 New Revision: 361012 URL: https://svnweb.freebsd.org/changeset/base/361012 Log: MFC r305392: For kernel builds, instead of suppressing certain clang warnings, make them non-fatal, so there is some incentive to fix them eventually. MFC r333819 (by mmacy): Silence non-actionable warnings in vendor code We can't modify vendor code so there's no signal in warnings from it. Similarly -Waddress-of-packed-member is not useful on networking code as access to packed structures is fundamental to its operation. Modified: stable/11/sys/conf/files stable/11/sys/conf/kern.mk stable/11/sys/modules/drm2/i915kms/Makefile stable/11/sys/modules/ipfilter/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed May 13 18:07:37 2020 (r361011) +++ stable/11/sys/conf/files Wed May 13 18:09:03 2020 (r361012) @@ -564,7 +564,7 @@ contrib/ipfilter/netinet/ip_lookup.c optional ipfilter contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \ compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" + compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}" contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet \ compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ Modified: stable/11/sys/conf/kern.mk ============================================================================== --- stable/11/sys/conf/kern.mk Wed May 13 18:07:37 2020 (r361011) +++ stable/11/sys/conf/kern.mk Wed May 13 18:09:03 2020 (r361012) @@ -17,13 +17,14 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs # kernel where fixing them is more trouble than it is worth, or where there is # a false positive. .if ${COMPILER_TYPE} == "clang" -NO_WCONSTANT_CONVERSION= -Wno-constant-conversion +NO_WCONSTANT_CONVERSION= -Wno-error-constant-conversion NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow NO_WSELF_ASSIGN= -Wno-self-assign -NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration +NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-internal-declaration NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized -NO_WCAST_QUAL= -Wno-cast-qual +NO_WCAST_QUAL= -Wno-error-cast-qual +NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. @@ -34,7 +35,7 @@ CWARNEXTRA?= -Wno-error-tautological-compare -Wno-erro CWARNEXTRA+= -Wno-error-shift-negative-value .endif .if ${COMPILER_VERSION} >= 40000 -CWARNEXTRA+= -Wno-error-address-of-packed-member +CWARNEXTRA+= -Wno-address-of-packed-member .endif .if ${COMPILER_VERSION} >= 100000 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation Modified: stable/11/sys/modules/drm2/i915kms/Makefile ============================================================================== --- stable/11/sys/modules/drm2/i915kms/Makefile Wed May 13 18:07:37 2020 (r361011) +++ stable/11/sys/modules/drm2/i915kms/Makefile Wed May 13 18:09:03 2020 (r361012) @@ -64,3 +64,8 @@ SRCS += \ CWARNFLAGS.i915_debug.c= -Wno-unused-function CWARNFLAGS.intel_lvds.c= -Wno-unused CWARNFLAGS.intel_tv.c= -Wno-unused +CWARNFLAGS.i915_gem.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.i915_gem_tiling.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.i915_gem_execbuffer.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.intel_display.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.intel_overlay.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} Modified: stable/11/sys/modules/ipfilter/Makefile ============================================================================== --- stable/11/sys/modules/ipfilter/Makefile Wed May 13 18:07:37 2020 (r361011) +++ stable/11/sys/modules/ipfilter/Makefile Wed May 13 18:09:03 2020 (r361012) @@ -21,7 +21,7 @@ CWARNFLAGS.fil.c= ${NO_WSELF_ASSIGN} -Wno-unused CWARNFLAGS.ip_auth.c= -Wno-unused CWARNFLAGS.ip_fil_freebsd.c= -Wno-unused CWARNFLAGS.ip_frag.c= -Wno-unused -CWARNFLAGS.ip_htable.c= -Wno-unused +CWARNFLAGS.ip_htable.c= -Wno-unused ${NO_WTAUTOLOGICAL_POINTER_COMPARE} CWARNFLAGS.ip_dstlist.c= -Wno-unused CWARNFLAGS.ip_lookup.c= ${NO_WSELF_ASSIGN} -Wno-unused CWARNFLAGS.ip_nat.c= -Wno-unused From owner-svn-src-stable-11@freebsd.org Wed May 13 21:16: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 CA0A32D8B76; Wed, 13 May 2020 21:16:04 +0000 (UTC) (envelope-from jhb@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 49MnXN53hnz4dtx; Wed, 13 May 2020 21:16:04 +0000 (UTC) (envelope-from jhb@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 A899A27A7E; Wed, 13 May 2020 21:16:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DLG4aL023377; Wed, 13 May 2020 21:16:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DLG3Ro023372; Wed, 13 May 2020 21:16:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005132116.04DLG3Ro023372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 13 May 2020 21:16:03 +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: r361020 - in stable: 11/lib/libsysdecode 11/sys/fs/procfs 11/sys/sys 11/usr.sbin/procctl 12/lib/libsysdecode 12/sys/fs/procfs 12/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libsysdecode 11/sys/fs/procfs 11/sys/sys 11/usr.sbin/procctl 12/lib/libsysdecode 12/sys/fs/procfs 12/sys/sys X-SVN-Commit-Revision: 361020 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: Wed, 13 May 2020 21:16:04 -0000 Author: jhb Date: Wed May 13 21:16:02 2020 New Revision: 361020 URL: https://svnweb.freebsd.org/changeset/base/361020 Log: MFC 359047,359054: Deprecate procfs-based process debugging. 359047: Mark procfs-based process debugging as deprecated for FreeBSD 13. Attempting to use ioctls on /proc//mem to control a process will trigger warnings on the console. The include file will also now emit a compile-time warning when used from userland. 359054: Fix the workaround to ignore the #warning for GCC. clang and gcc use different warning flags for #warning preprocessor directives. For both 12 and 11, adjust the GCC warning flags to only be added in 4.7 and later since 4.2.1 does not support -Wno-cpp. For 11, add the needed warning suppression to procctl's build. procctl was removed in 12.0. Modified: stable/11/lib/libsysdecode/Makefile stable/11/sys/fs/procfs/procfs_ioctl.c stable/11/sys/sys/pioctl.h stable/11/usr.sbin/procctl/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libsysdecode/Makefile stable/12/sys/fs/procfs/procfs_ioctl.c stable/12/sys/sys/pioctl.h Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Wed May 13 20:37:46 2020 (r361019) +++ stable/11/lib/libsysdecode/Makefile Wed May 13 21:16:02 2020 (r361020) @@ -123,6 +123,13 @@ CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls # Workaround warning for unused ssi_cables[] in CFLAGS.gcc.ioctl.c+= -Wno-unused +# Ignore deprecation warning in +CFLAGS.clang.ioctl.c+= -Wno-\#warnings +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40700 +CFLAGS.gcc.ioctl.c+= -Wno-cpp +.endif + +CFLAGS.clang+= ${CFLAGS.clang.${.IMPSRC}} CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} DEPENDOBJS+= tables.h Modified: stable/11/sys/fs/procfs/procfs_ioctl.c ============================================================================== --- stable/11/sys/fs/procfs/procfs_ioctl.c Wed May 13 20:37:46 2020 (r361019) +++ stable/11/sys/fs/procfs/procfs_ioctl.c Wed May 13 21:16:02 2020 (r361020) @@ -69,10 +69,53 @@ procfs_ioctl(PFS_IOCTL_ARGS) #ifdef COMPAT_FREEBSD6 int ival; #endif + static struct timeval lasttime; + static struct timeval interval = { .tv_sec = 1, .tv_usec = 0 }; KASSERT(p != NULL, ("%s() called without a process", __func__)); PROC_LOCK_ASSERT(p, MA_OWNED); + + switch (cmd) { +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 1, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 1): +#endif + case PIOCBIS: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 2, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 2): +#endif + case PIOCBIC: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 3, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 3): +#endif + case PIOCSFL: + case PIOCGFL: + case PIOCWAIT: + case PIOCSTATUS: +#ifdef COMPAT_FREEBSD32 + case PIOCWAIT32: + case PIOCSTATUS32: +#endif +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 5, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 5): +#endif + case PIOCCONT: + if (ratecheck(&lasttime, &interval) != 0) + gone_in(13, "procfs-based process debugging"); + break; + } error = 0; switch (cmd) { Modified: stable/11/sys/sys/pioctl.h ============================================================================== --- stable/11/sys/sys/pioctl.h Wed May 13 20:37:46 2020 (r361019) +++ stable/11/sys/sys/pioctl.h Wed May 13 21:16:02 2020 (r361020) @@ -39,6 +39,10 @@ #ifndef _SYS_PIOCTL_H # define _SYS_PIOCTL_H +#ifndef _KERNEL +#warning " is deprecated, ptrace() should be used instead" +#endif + # include struct procfs_status { Modified: stable/11/usr.sbin/procctl/Makefile ============================================================================== --- stable/11/usr.sbin/procctl/Makefile Wed May 13 20:37:46 2020 (r361019) +++ stable/11/usr.sbin/procctl/Makefile Wed May 13 21:16:02 2020 (r361020) @@ -1,6 +1,14 @@ # $FreeBSD$ +.include + PROG= procctl MAN= procctl.8 + +# Ignore deprecation warning in +CFLAGS.clang+= -Wno-\#warnings +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40700 +CFLAGS.gcc+= -Wno-cpp +.endif .include From owner-svn-src-stable-11@freebsd.org Thu May 14 06:05:24 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 D45BF2E6293; Thu, 14 May 2020 06:05:24 +0000 (UTC) (envelope-from pstef@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 49N1H85Hxdz3PxN; Thu, 14 May 2020 06:05:24 +0000 (UTC) (envelope-from pstef@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 B0DBD6404; Thu, 14 May 2020 06:05:24 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E65OxP047893; Thu, 14 May 2020 06:05:24 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E65One047892; Thu, 14 May 2020 06:05:24 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202005140605.04E65One047892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Thu, 14 May 2020 06:05:24 +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: r361026 - stable/11/bin/ps X-SVN-Group: stable-11 X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: stable/11/bin/ps X-SVN-Commit-Revision: 361026 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, 14 May 2020 06:05:24 -0000 Author: pstef Date: Thu May 14 06:05:24 2020 New Revision: 361026 URL: https://svnweb.freebsd.org/changeset/base/361026 Log: MFC r360786: ps: extend the non-standard option -d (tree view) to work with -p Modified: stable/11/bin/ps/ps.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ps/ps.c ============================================================================== --- stable/11/bin/ps/ps.c Thu May 14 05:01:18 2020 (r361025) +++ stable/11/bin/ps/ps.c Thu May 14 06:05:24 2020 (r361026) @@ -490,7 +490,7 @@ main(int argc, char *argv[]) what = KERN_PROC_PGRP | showthreads; flag = *pgrplist.l.pids; nselectors = 0; - } else if (pidlist.count == 1) { + } else if (pidlist.count == 1 && !descendancy) { what = KERN_PROC_PID | showthreads; flag = *pidlist.l.pids; nselectors = 0; @@ -528,6 +528,14 @@ main(int argc, char *argv[]) if ((kp == NULL && errno != ESRCH) || (kp != NULL && nentries < 0)) xo_errx(1, "%s", kvm_geterr(kd)); nkept = 0; + if (descendancy) + for (elem = 0; elem < pidlist.count; elem++) + for (i = 0; i < nentries; i++) + if (kp[i].ki_ppid == pidlist.l.pids[elem]) { + if (pidlist.count >= pidlist.maxcount) + expand_list(&pidlist); + pidlist.l.pids[pidlist.count++] = kp[i].ki_pid; + } if (nentries > 0) { if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL) xo_errx(1, "malloc failed"); From owner-svn-src-stable-11@freebsd.org Thu May 14 17:56:46 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 195092D9205; Thu, 14 May 2020 17:56:46 +0000 (UTC) (envelope-from jhb@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 49NK3x6tFlz4d99; Thu, 14 May 2020 17:56:45 +0000 (UTC) (envelope-from jhb@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 E7593EF91; Thu, 14 May 2020 17:56:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EHujEo085366; Thu, 14 May 2020 17:56:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHujD4085362; Thu, 14 May 2020 17:56:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141756.04EHujD4085362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 17:56:45 +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: r361038 - in stable: 11/sys/cam/scsi 11/sys/dev/iscsi_initiator 11/sys/net80211 12/sys/cam/scsi 12/sys/dev/iscsi_initiator 12/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 11/sys/dev/iscsi_initiator 11/sys/net80211 12/sys/cam/scsi 12/sys/dev/iscsi_initiator 12/sys/net80211 X-SVN-Commit-Revision: 361038 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, 14 May 2020 17:56:46 -0000 Author: jhb Date: Thu May 14 17:56:43 2020 New Revision: 361038 URL: https://svnweb.freebsd.org/changeset/base/361038 Log: MFC 360171,360179,360285,360388: Don't dereference various user pointers. 360171: Don't access a user buffer directly from the kernel. The handle_string callback for the ENCIOC_SETSTRING ioctl was passing a user pointer to memcpy(). Fix by using copyin() instead. For ENCIOC_GETSTRING ioctls, the handler was storing the user pointer in a CCB's data_ptr field where it was indirected by other code. Fix this by allocating a temporary buffer (which ENCIOC_SETSTRING already did) and copying the result out to the user buffer after the CCB has been processed. 360179: Don't pass a user buffer pointer as the data pointer in a CCB. Allocate a temporary buffer in the kernel to serve as the CCB data pointer for a pass-through transaction and use copyin/copyout to shuffle the data to/from the user buffer. 360285: Don't indirect user pointers directly in two 802.11s ioctls. IEEE80211_MESH_RTCMD_ADD was invoking memcmp() to validate the supplied address directly on the user pointer rather than first doing a copyin() and validating the copied value. IEEE80211_MESH_RTCMD_DELETE was passing the user pointer directly to ieee80211_mesh_rt_del() rather than copying the user buffer into a temporary kernel buffer. 360388: Don't run strcmp() against strings stored in user memory. Instead, copy the strings into a temporary buffer on the stack and run strcmp on the copies. Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c stable/11/sys/cam/scsi/scsi_sg.c stable/11/sys/dev/iscsi_initiator/isc_subr.c stable/11/sys/net80211/ieee80211_mesh.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c stable/12/sys/cam/scsi/scsi_sg.c stable/12/sys/dev/iscsi_initiator/isc_subr.c stable/12/sys/net80211/ieee80211_mesh.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:54:08 2020 (r361037) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:56:43 2020 (r361038) @@ -2902,13 +2902,19 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s buf[1] = 0; buf[2] = sstr->bufsiz >> 8; buf[3] = sstr->bufsiz & 0xff; - memcpy(&buf[4], sstr->buf, sstr->bufsiz); + ret = copyin(sstr->buf, &buf[4], sstr->bufsiz); + if (ret != 0) { + ENC_FREE(buf); + return (ret); + } break; case ENCIOC_GETSTRING: payload = sstr->bufsiz; amt = payload; + buf = ENC_MALLOC(payload); + if (buf == NULL) + return (ENOMEM); ses_page_cdb(cdb, payload, SesStringIn, CAM_DIR_IN); - buf = sstr->buf; break; case ENCIOC_GETENCNAME: if (ses_cache->ses_nsubencs < 1) @@ -2948,6 +2954,8 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s return (EINVAL); } ret = enc_runcmd(enc, cdb, 6, buf, &amt); + if (ret == 0 && ioc == ENCIOC_GETSTRING) + ret = copyout(buf, sstr->buf, sstr->bufsiz); if (ioc == ENCIOC_SETSTRING) ENC_FREE(buf); return (ret); Modified: stable/11/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sg.c Thu May 14 17:54:08 2020 (r361037) +++ stable/11/sys/cam/scsi/scsi_sg.c Thu May 14 17:56:43 2020 (r361038) @@ -506,6 +506,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int struct cam_periph *periph; struct sg_softc *softc; struct sg_io_hdr *req; + void *data_ptr; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -550,12 +551,20 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } + if (req->dxfer_len > MAXPHYS) { + error = EINVAL; + break; + } + + data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, req->cmd_len); if (error) { + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -568,7 +577,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int dir = CAM_DIR_IN; break; case SG_DXFER_TO_FROM_DEV: - dir = CAM_DIR_IN | CAM_DIR_OUT; + dir = CAM_DIR_BOTH; break; case SG_DXFER_NONE: default: @@ -576,12 +585,21 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } + if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) { + error = copyin(req->dxferp, data_ptr, req->dxfer_len); + if (error) { + free(data_ptr, M_DEVBUF); + xpt_release_ccb(ccb); + break; + } + } + cam_fill_csio(csio, /*retries*/1, sgdone, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - req->dxferp, + data_ptr, req->dxfer_len, req->mx_sb_len, req->cmd_len, @@ -591,6 +609,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int if (error) { req->host_status = DID_ERROR; req->driver_status = DRIVER_INVALID; + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -609,6 +628,10 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int req->sb_len_wr); } + if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0) + error = copyout(data_ptr, req->dxferp, req->dxfer_len); + + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; Modified: stable/11/sys/dev/iscsi_initiator/isc_subr.c ============================================================================== --- stable/11/sys/dev/iscsi_initiator/isc_subr.c Thu May 14 17:54:08 2020 (r361037) +++ stable/11/sys/dev/iscsi_initiator/isc_subr.c Thu May 14 17:56:43 2020 (r361038) @@ -192,6 +192,9 @@ i_crc32c(const void *buf, size_t size, uint32_t crc) int i_setopt(isc_session_t *sp, isc_opt_t *opt) { + char buf[16]; + int error; + if(opt->maxRecvDataSegmentLength > 0) { sp->opt.maxRecvDataSegmentLength = opt->maxRecvDataSegmentLength; sdebug(2, "maxRecvDataSegmentLength=%d", sp->opt.maxRecvDataSegmentLength); @@ -233,15 +236,21 @@ i_setopt(isc_session_t *sp, isc_opt_t *opt) } if(opt->headerDigest != NULL) { - sdebug(2, "opt.headerDigest='%s'", opt->headerDigest); - if(strcmp(opt->headerDigest, "CRC32C") == 0) { + error = copyinstr(opt->headerDigest, buf, sizeof(buf), NULL); + if (error != 0) + return (error); + sdebug(2, "opt.headerDigest='%s'", buf); + if(strcmp(buf, "CRC32C") == 0) { sp->hdrDigest = (digest_t *)i_crc32c; sdebug(2, "opt.headerDigest set"); } } if(opt->dataDigest != NULL) { - sdebug(2, "opt.dataDigest='%s'", opt->headerDigest); - if(strcmp(opt->dataDigest, "CRC32C") == 0) { + error = copyinstr(opt->dataDigest, buf, sizeof(buf), NULL); + if (error != 0) + return (error); + sdebug(2, "opt.dataDigest='%s'", opt->dataDigest); + if(strcmp(buf, "CRC32C") == 0) { sp->dataDigest = (digest_t *)i_crc32c; sdebug(2, "opt.dataDigest set"); } Modified: stable/11/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/11/sys/net80211/ieee80211_mesh.c Thu May 14 17:54:08 2020 (r361037) +++ stable/11/sys/net80211/ieee80211_mesh.c Thu May 14 17:56:43 2020 (r361038) @@ -3567,16 +3567,21 @@ mesh_ioctl_set80211(struct ieee80211vap *vap, struct i ieee80211_mesh_rt_flush(vap); break; case IEEE80211_MESH_RTCMD_ADD: - if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ireq->i_data) || - IEEE80211_ADDR_EQ(broadcastaddr, ireq->i_data)) - return EINVAL; - error = copyin(ireq->i_data, &tmpaddr, + error = copyin(ireq->i_data, tmpaddr, IEEE80211_ADDR_LEN); - if (error == 0) - ieee80211_mesh_discover(vap, tmpaddr, NULL); + if (error != 0) + break; + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, tmpaddr) || + IEEE80211_ADDR_EQ(broadcastaddr, tmpaddr)) + return EINVAL; + ieee80211_mesh_discover(vap, tmpaddr, NULL); break; case IEEE80211_MESH_RTCMD_DELETE: - ieee80211_mesh_rt_del(vap, ireq->i_data); + error = copyin(ireq->i_data, tmpaddr, + IEEE80211_ADDR_LEN); + if (error != 0) + break; + ieee80211_mesh_rt_del(vap, tmpaddr); break; default: return ENOSYS; From owner-svn-src-stable-11@freebsd.org Thu May 14 18:19:29 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 EE6202D9C62; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@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 49NKZ965jwz4fSh; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@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 CAC9FF38C; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EIJT1Q097612; Thu, 14 May 2020 18:19:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EIJTPc097611; Thu, 14 May 2020 18:19:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141819.04EIJTPc097611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:19:29 +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: r361040 - in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 361040 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, 14 May 2020 18:19:30 -0000 Author: jhb Date: Thu May 14 18:19:28 2020 New Revision: 361040 URL: https://svnweb.freebsd.org/changeset/base/361040 Log: MFC 360818: Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171. Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:56:44 2020 (r361039) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Thu May 14 18:19:28 2020 (r361040) @@ -2956,7 +2956,7 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s ret = enc_runcmd(enc, cdb, 6, buf, &amt); if (ret == 0 && ioc == ENCIOC_GETSTRING) ret = copyout(buf, sstr->buf, sstr->bufsiz); - if (ioc == ENCIOC_SETSTRING) + if (ioc == ENCIOC_SETSTRING || ioc == ENCIOC_GETSTRING) ENC_FREE(buf); return (ret); } From owner-svn-src-stable-11@freebsd.org Thu May 14 18:49:44 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 1E6702DA8CA; Thu, 14 May 2020 18:49:44 +0000 (UTC) (envelope-from jhb@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 49NLF400wsz3Cm6; Thu, 14 May 2020 18:49:44 +0000 (UTC) (envelope-from jhb@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 EF9FDF936; Thu, 14 May 2020 18:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EInhS4016209; Thu, 14 May 2020 18:49:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EInhca016208; Thu, 14 May 2020 18:49:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141849.04EInhca016208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:49:43 +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: r361041 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 361041 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, 14 May 2020 18:49:44 -0000 Author: jhb Date: Thu May 14 18:49:43 2020 New Revision: 361041 URL: https://svnweb.freebsd.org/changeset/base/361041 Log: MFC 360399: Update the cached MSI state when any MSI capability register is written. bhyve uses cached copies of the MSI capability registers to generate MSI interrupts for device models. Previously, these cached fields were only set when the MSI capability control register was updated. The Linux kernel recently adopted a change to deal with races in MSI interrupt delivery that writes to the MSI capability address and data registers to alter the destination of MSI interrupts without writing to the MSI capability control register. bhyve was not updating its cached registers for these writes and continued to send interrupts with the old data value to the old address. Fix this by recomputing the cached values for every write to any MSI capability register. Modified: stable/11/usr.sbin/bhyve/pci_emul.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/bhyve/pci_emul.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_emul.c Thu May 14 18:19:28 2020 (r361040) +++ stable/11/usr.sbin/bhyve/pci_emul.c Thu May 14 18:49:43 2020 (r361041) @@ -898,26 +898,26 @@ msicap_cfgwrite(struct pci_devinst *pi, int capoff, in msgctrl &= ~rwmask; msgctrl |= val & rwmask; val = msgctrl; + } + CFGWRITE(pi, offset, val, bytes); - addrlo = pci_get_cfgdata32(pi, capoff + 4); - if (msgctrl & PCIM_MSICTRL_64BIT) - msgdata = pci_get_cfgdata16(pi, capoff + 12); - else - msgdata = pci_get_cfgdata16(pi, capoff + 8); + msgctrl = pci_get_cfgdata16(pi, capoff + 2); + addrlo = pci_get_cfgdata32(pi, capoff + 4); + if (msgctrl & PCIM_MSICTRL_64BIT) + msgdata = pci_get_cfgdata16(pi, capoff + 12); + else + msgdata = pci_get_cfgdata16(pi, capoff + 8); - mme = msgctrl & PCIM_MSICTRL_MME_MASK; - pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; - if (pi->pi_msi.enabled) { - pi->pi_msi.addr = addrlo; - pi->pi_msi.msg_data = msgdata; - pi->pi_msi.maxmsgnum = 1 << (mme >> 4); - } else { - pi->pi_msi.maxmsgnum = 0; - } - pci_lintr_update(pi); + mme = msgctrl & PCIM_MSICTRL_MME_MASK; + pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; + if (pi->pi_msi.enabled) { + pi->pi_msi.addr = addrlo; + pi->pi_msi.msg_data = msgdata; + pi->pi_msi.maxmsgnum = 1 << (mme >> 4); + } else { + pi->pi_msi.maxmsgnum = 0; } - - CFGWRITE(pi, offset, val, bytes); + pci_lintr_update(pi); } void From owner-svn-src-stable-11@freebsd.org Thu May 14 18:55:46 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 79A9A2DAC5C; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@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 49NLN22cTYz3DZ9; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@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 54F0BFB0C; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EItk3P021993; Thu, 14 May 2020 18:55:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EItkpo021992; Thu, 14 May 2020 18:55:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141855.04EItkpo021992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:55:46 +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: r361043 - in stable: 11/sbin/setkey 12/sbin/setkey X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sbin/setkey 12/sbin/setkey X-SVN-Commit-Revision: 361043 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, 14 May 2020 18:55:46 -0000 Author: jhb Date: Thu May 14 18:55:45 2020 New Revision: 361043 URL: https://svnweb.freebsd.org/changeset/base/361043 Log: MFC 360634: Add RFC reference for AES-CTR with IPsec. Modified: stable/11/sbin/setkey/setkey.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sbin/setkey/setkey.8 Directory Properties: stable/12/ (props changed) Modified: stable/11/sbin/setkey/setkey.8 ============================================================================== --- stable/11/sbin/setkey/setkey.8 Thu May 14 18:50:43 2020 (r361042) +++ stable/11/sbin/setkey/setkey.8 Thu May 14 18:55:45 2020 (r361043) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2017 +.Dd May 04, 2020 .Dt SETKEY 8 .Os .\" @@ -626,7 +626,7 @@ blowfish-cbc 40 to 448 rfc2451 cast128-cbc 40 to 128 rfc2451 des-deriv 64 ipsec-ciph-des-derived-01 rijndael-cbc 128/192/256 rfc3602 -aes-ctr 160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03 +aes-ctr 160/224/288 rfc3686 aes-gcm-16 160/224/288 rfc4106 camellia-cbc 128/192/256 rfc4312 .Ed From owner-svn-src-stable-11@freebsd.org Thu May 14 18:59: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 B71FA2DAE01; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@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 49NLSR4S2fz3Dwy; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@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 93E68FB11; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EIxZQI022220; Thu, 14 May 2020 18:59:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EIxZtx022218; Thu, 14 May 2020 18:59:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141859.04EIxZtx022218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:59: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: r361044 - in stable: 11/share/man/man4 11/sys/dev/ubsec 12/share/man/man4 12/sys/dev/ubsec X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/man/man4 11/sys/dev/ubsec 12/share/man/man4 12/sys/dev/ubsec X-SVN-Commit-Revision: 361044 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, 14 May 2020 18:59:35 -0000 Author: jhb Date: Thu May 14 18:59:34 2020 New Revision: 361044 URL: https://svnweb.freebsd.org/changeset/base/361044 Log: MFC 360710: Deprecate ubsec(4) for FreeBSD 13.0. With the removal of in-tree consumers of DES, Triple DES, and MD5-HMAC, the only algorithm this driver still supports is SHA1-HMAC. This is not very useful as a standalone algorithm (IPsec AH-only with SHA1 would be the only user). This driver has also not been kept up to date with the original driver in OpenBSD which supports a few more cards and AES-CBC on newer cards. The newest card currently supported by this driver was released in 2005. Relnotes: yes Modified: stable/11/share/man/man4/ubsec.4 stable/11/sys/dev/ubsec/ubsec.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/share/man/man4/ubsec.4 stable/12/sys/dev/ubsec/ubsec.c Directory Properties: stable/12/ (props changed) Modified: stable/11/share/man/man4/ubsec.4 ============================================================================== --- stable/11/share/man/man4/ubsec.4 Thu May 14 18:55:45 2020 (r361043) +++ stable/11/share/man/man4/ubsec.4 Thu May 14 18:59:34 2020 (r361044) @@ -48,6 +48,15 @@ module at boot time, place the following line in .Bd -literal -offset indent ubsec_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +The majority of crypto algorithms supported by this driver are no longer +used by the kernel in +.Fx 13.0 . .Sh DESCRIPTION The .Nm Modified: stable/11/sys/dev/ubsec/ubsec.c ============================================================================== --- stable/11/sys/dev/ubsec/ubsec.c Thu May 14 18:55:45 2020 (r361043) +++ stable/11/sys/dev/ubsec/ubsec.c Thu May 14 18:59:34 2020 (r361044) @@ -474,6 +474,7 @@ skip_rng: crypto_kregister(sc->sc_cid, CRK_MOD_EXP_CRT, 0); #endif } + gone_in_dev(dev, 13, "Does not support modern crypto algorithms"); return (0); bad4: crypto_unregister_all(sc->sc_cid); From owner-svn-src-stable-11@freebsd.org Thu May 14 19:09:26 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 D2C882DB30D; Thu, 14 May 2020 19:09:26 +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) 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 49NLgp5K0nz3GCD; Thu, 14 May 2020 19:09:26 +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 B1A9BFCFD; Thu, 14 May 2020 19:09:26 +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 04EJ9Q71028984; Thu, 14 May 2020 19:09:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJ9QLj028983; Thu, 14 May 2020 19:09:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005141909.04EJ9QLj028983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 14 May 2020 19:09:26 +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: r361047 - stable/11/lib/csu X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/lib/csu X-SVN-Commit-Revision: 361047 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, 14 May 2020 19:09:26 -0000 Author: dim Date: Thu May 14 19:09:26 2020 New Revision: 361047 URL: https://svnweb.freebsd.org/changeset/base/361047 Log: MFC r360915: Use -fno-asynchronous-unwind-tables to compile lib/csu Summary: In r209294 kib added -fno-asynchronous-unwind-tables to the compile flags for the GNU C startup components. This was done to work around a BFD ld assertion, "no .eh_frame_hdr table will be created", which is produced because of the layout of the startup objects. Add the same flag to lib/csu too, for the same reason. And similarly to r209294, also add -fno-omit-frame-pointer. This is primarily meant to quickly MFC to stable/11, so it can end up in the 11.4 release, as a fix for https://bugs.freebsd.org/246322. PR: 246322 Differential Revision: https://reviews.freebsd.org/D24797 Modified: stable/11/lib/csu/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/csu/Makefile.inc ============================================================================== --- stable/11/lib/csu/Makefile.inc Thu May 14 19:09:13 2020 (r361046) +++ stable/11/lib/csu/Makefile.inc Thu May 14 19:09:26 2020 (r361047) @@ -6,4 +6,7 @@ SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/ NO_WMISSING_VARIABLE_DECLARATIONS= +CFLAGS+= -fno-asynchronous-unwind-tables +CFLAGS+= -fno-omit-frame-pointer + .include "../Makefile.inc" From owner-svn-src-stable-11@freebsd.org Thu May 14 19:15:22 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 3F70D2DB73B; Thu, 14 May 2020 19:15:22 +0000 (UTC) (envelope-from jhb@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 49NLpf0zS3z3Gpf; Thu, 14 May 2020 19:15:22 +0000 (UTC) (envelope-from jhb@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 1CD86FEF8; Thu, 14 May 2020 19:15:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EJFMs2034986; Thu, 14 May 2020 19:15:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJFLnV034985; Thu, 14 May 2020 19:15:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141915.04EJFLnV034985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 19:15:21 +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: r361048 - in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Commit-Revision: 361048 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, 14 May 2020 19:15:22 -0000 Author: jhb Date: Thu May 14 19:15:21 2020 New Revision: 361048 URL: https://svnweb.freebsd.org/changeset/base/361048 Log: Bump Dd for r361044. This is a direct commit to stable/{11,12} as I missed the bump in the commit to head, but the file has already been removed from head. Modified: stable/11/share/man/man4/ubsec.4 Changes in other areas also in this revision: Modified: stable/12/share/man/man4/ubsec.4 Modified: stable/11/share/man/man4/ubsec.4 ============================================================================== --- stable/11/share/man/man4/ubsec.4 Thu May 14 19:09:26 2020 (r361047) +++ stable/11/share/man/man4/ubsec.4 Thu May 14 19:15:21 2020 (r361048) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2009 +.Dd May 14, 2020 .Dt UBSEC 4 .Os .Sh NAME From owner-svn-src-stable-11@freebsd.org Thu May 14 19:41:46 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 18F302DC38C; Thu, 14 May 2020 19:41:46 +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) 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 49NMP56zQ4z3JQy; Thu, 14 May 2020 19:41:45 +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 EABD018470; Thu, 14 May 2020 19:41:45 +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 04EJfjs5048879; Thu, 14 May 2020 19:41:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJfjAw048878; Thu, 14 May 2020 19:41:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005141941.04EJfjAw048878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 14 May 2020 19:41:45 +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: r361051 - stable/11/etc/mtree X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/etc/mtree X-SVN-Commit-Revision: 361051 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, 14 May 2020 19:41:46 -0000 Author: dim Date: Thu May 14 19:41:45 2020 New Revision: 361051 URL: https://svnweb.freebsd.org/changeset/base/361051 Log: MFC r357929: Remove /usr/include/ssp from BSD.include.dist after r356356 This avoids having to delete it every time with "make delete-old". PR: 242950 Modified: stable/11/etc/mtree/BSD.include.dist Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.include.dist ============================================================================== --- stable/11/etc/mtree/BSD.include.dist Thu May 14 19:32:41 2020 (r361050) +++ stable/11/etc/mtree/BSD.include.dist Thu May 14 19:41:45 2020 (r361051) @@ -339,8 +339,6 @@ mac_partition .. .. - ssp - .. sys .. teken From owner-svn-src-stable-11@freebsd.org Thu May 14 20:07:03 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 4BF6C2DD6E3; Thu, 14 May 2020 20:07:03 +0000 (UTC) (envelope-from erj@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 49NMyH1JJfz3Lth; Thu, 14 May 2020 20:07:03 +0000 (UTC) (envelope-from erj@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 27CBF18933; Thu, 14 May 2020 20:07:03 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EK732F065846; Thu, 14 May 2020 20:07:03 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EK72Ow065844; Thu, 14 May 2020 20:07:02 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142007.04EK72Ow065844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 20:07:02 +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: r361055 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361055 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, 14 May 2020 20:07:03 -0000 Author: erj Date: Thu May 14 20:07:02 2020 New Revision: 361055 URL: https://svnweb.freebsd.org/changeset/base/361055 Log: MFC r360398: iflib: Stop interface before (un)registering VLAN This is now misleadingly named for stable/11; this was meant to fix an issue in an out-of-tree iavf(4) driver that uses iflib. This commit actually introduces a new driver-dependent function that iflib-using drivers can implement in order to tell iflib whether an interface restart is needed for certain events. For this commit, this function is only used for VLAN register/unregister events. Sponsored by: Intel Corporation Modified: stable/11/sys/net/ifdi_if.m stable/11/sys/net/iflib.c stable/11/sys/net/iflib.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ifdi_if.m ============================================================================== --- stable/11/sys/net/ifdi_if.m Thu May 14 19:57:52 2020 (r361054) +++ stable/11/sys/net/ifdi_if.m Thu May 14 20:07:02 2020 (r361055) @@ -111,6 +111,12 @@ CODE { { return (ENOTSUP); } + + static bool + null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused) + { + return (true); + } }; # @@ -341,3 +347,8 @@ METHOD int sysctl_int_delay { METHOD void debug { if_ctx_t _ctx; } DEFAULT null_void_op; + +METHOD bool needs_restart { + if_ctx_t _ctx; + enum iflib_restart_event _event; +} DEFAULT null_needs_restart; Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 19:57:52 2020 (r361054) +++ stable/11/sys/net/iflib.c Thu May 14 20:07:02 2020 (r361055) @@ -4159,10 +4159,13 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag return; CTX_LOCK(ctx); + /* Driver may need all untagged packets to be flushed */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_stop(ctx); IFDI_VLAN_REGISTER(ctx, vtag); - /* Re-init to load the changes */ - if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - iflib_if_init_locked(ctx); + /* Re-init to load the changes, if required */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_init_locked(ctx); CTX_UNLOCK(ctx); } @@ -4178,10 +4181,13 @@ iflib_vlan_unregister(void *arg, if_t ifp, uint16_t vt return; CTX_LOCK(ctx); + /* Driver may need all tagged packets to be flushed */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_stop(ctx); IFDI_VLAN_UNREGISTER(ctx, vtag); - /* Re-init to load the changes */ - if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - iflib_if_init_locked(ctx); + /* Re-init to load the changes, if required */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_init_locked(ctx); CTX_UNLOCK(ctx); } Modified: stable/11/sys/net/iflib.h ============================================================================== --- stable/11/sys/net/iflib.h Thu May 14 19:57:52 2020 (r361054) +++ stable/11/sys/net/iflib.h Thu May 14 20:07:02 2020 (r361055) @@ -328,6 +328,15 @@ typedef enum { /* + * These enum values are used in iflib_needs_restart to indicate to iflib + * functions whether or not the interface needs restarting when certain events + * happen. + */ +enum iflib_restart_event { + IFLIB_RESTART_VLAN_CONFIG, +}; + +/* * field accessors */ void *iflib_get_softc(if_ctx_t ctx); From owner-svn-src-stable-11@freebsd.org Thu May 14 20:23:26 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 5E30F2DE4BE; Thu, 14 May 2020 20:23:26 +0000 (UTC) (envelope-from erj@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 49NNKB1wfTz3NjS; Thu, 14 May 2020 20:23:26 +0000 (UTC) (envelope-from erj@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 3C92518D17; Thu, 14 May 2020 20:23:26 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EKNQww078242; Thu, 14 May 2020 20:23:26 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EKNQpL078241; Thu, 14 May 2020 20:23:26 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142023.04EKNQpL078241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 20:23:26 +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: r361057 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361057 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, 14 May 2020 20:23:26 -0000 Author: erj Date: Thu May 14 20:23:25 2020 New Revision: 361057 URL: https://svnweb.freebsd.org/changeset/base/361057 Log: Partially MFC r353967: iflib: call ether_ifdetach and netmap_detach before stop This MFCs most of the patch except for the parts where the new iflib_unregister_vlan_handlers() function is called in the pseudo device register/deregister functions since those functions don't exist in FreeBSD 11. This re-ordering can fix a potential panic. Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 20:17:09 2020 (r361056) +++ stable/11/sys/net/iflib.c Thu May 14 20:23:25 2020 (r361057) @@ -731,6 +731,8 @@ static int iflib_legacy_setup(if_ctx_t ctx, driver_fil static void iflib_txq_check_drain(iflib_txq_t txq, int budget); static uint32_t iflib_txq_can_drain(struct ifmp_ring *); static int iflib_register(if_ctx_t); +static void iflib_deregister(if_ctx_t); +static void iflib_unregister_vlan_handlers(if_ctx_t ctx); static void iflib_init_locked(if_ctx_t ctx); static void iflib_add_device_sysctl_pre(if_ctx_t ctx); static void iflib_add_device_sysctl_post(if_ctx_t ctx); @@ -4546,18 +4548,16 @@ iflib_device_deregister(if_ctx_t ctx) ctx->ifc_flags |= IFC_IN_DETACH; STATE_UNLOCK(ctx); + /* Unregister VLAN handlers before calling iflib_stop() */ + iflib_unregister_vlan_handlers(ctx); + + iflib_netmap_detach(ifp); + ether_ifdetach(ifp); + CTX_LOCK(ctx); iflib_stop(ctx); CTX_UNLOCK(ctx); - /* Unregister VLAN events */ - if (ctx->ifc_vlan_attach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); - if (ctx->ifc_vlan_detach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); - - iflib_netmap_detach(ifp); - ether_ifdetach(ifp); if (ctx->ifc_led_dev != NULL) led_destroy(ctx->ifc_led_dev); /* XXX drain any dependent tasks */ @@ -4825,6 +4825,43 @@ iflib_register(if_ctx_t ctx) return (0); } +static void +iflib_unregister_vlan_handlers(if_ctx_t ctx) +{ + /* Unregister VLAN events */ + if (ctx->ifc_vlan_attach_event != NULL) { + EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); + ctx->ifc_vlan_attach_event = NULL; + } + if (ctx->ifc_vlan_detach_event != NULL) { + EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); + ctx->ifc_vlan_detach_event = NULL; + } + +} + +static void +iflib_deregister(if_ctx_t ctx) +{ + if_t ifp = ctx->ifc_ifp; + + /* Remove all media */ + ifmedia_removeall(&ctx->ifc_media); + + /* Ensure that VLAN event handlers are unregistered */ + iflib_unregister_vlan_handlers(ctx); + + /* Release kobject reference */ + kobj_delete((kobj_t) ctx, NULL); + + /* Free the ifnet structure */ + if_free(ifp); + + STATE_LOCK_DESTROY(ctx); + + /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ + CTX_LOCK_DESTROY(ctx); +} static int iflib_queues_alloc(if_ctx_t ctx) From owner-svn-src-stable-11@freebsd.org Thu May 14 20:43:44 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 E6C2A2DF161; Thu, 14 May 2020 20:43:44 +0000 (UTC) (envelope-from erj@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 49NNmc5jl1z3Q5r; Thu, 14 May 2020 20:43:44 +0000 (UTC) (envelope-from erj@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 BF7D5190C7; Thu, 14 May 2020 20:43:44 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EKhipp090013; Thu, 14 May 2020 20:43:44 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EKhivo090012; Thu, 14 May 2020 20:43:44 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142043.04EKhivo090012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 20:43:44 +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: r361058 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361058 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, 14 May 2020 20:43:45 -0000 Author: erj Date: Thu May 14 20:43:44 2020 New Revision: 361058 URL: https://svnweb.freebsd.org/changeset/base/361058 Log: MFC r354207: iflib: cleanup memory leaks on driver detach Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 20:23:25 2020 (r361057) +++ stable/11/sys/net/iflib.c Thu May 14 20:43:44 2020 (r361058) @@ -1613,6 +1613,14 @@ iflib_txq_destroy(iflib_txq_t txq) for (int i = 0; i < txq->ift_size; i++) iflib_txsd_destroy(ctx, txq, i); + + if (txq->ift_br != NULL) { + ifmp_ring_free(txq->ift_br); + txq->ift_br = NULL; + } + + mtx_destroy(&txq->ift_mtx); + if (txq->ift_sds.ifsd_map != NULL) { free(txq->ift_sds.ifsd_map, M_IFLIB); txq->ift_sds.ifsd_map = NULL; @@ -1633,6 +1641,9 @@ iflib_txq_destroy(iflib_txq_t txq) bus_dma_tag_destroy(txq->ift_tso_desc_tag); txq->ift_tso_desc_tag = NULL; } + if (txq->ift_ifdi != NULL) { + free(txq->ift_ifdi, M_IFLIB); + } } static void @@ -2104,6 +2115,8 @@ iflib_rx_sds_free(iflib_rxq_t rxq) free(rxq->ifr_fl, M_IFLIB); rxq->ifr_fl = NULL; rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + free(rxq->ifr_ifdi, M_IFLIB); + rxq->ifr_ifdi = NULL; } } @@ -5095,9 +5108,9 @@ iflib_tx_structures_free(if_ctx_t ctx) int i, j; for (i = 0; i < NTXQSETS(ctx); i++, txq++) { - iflib_txq_destroy(txq); for (j = 0; j < ctx->ifc_nhwtxqs; j++) iflib_dma_free(&txq->ift_ifdi[j]); + iflib_txq_destroy(txq); } free(ctx->ifc_txqs, M_IFLIB); ctx->ifc_txqs = NULL; From owner-svn-src-stable-11@freebsd.org Thu May 14 21:36:59 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 A4AC62E0953; Thu, 14 May 2020 21:36:59 +0000 (UTC) (envelope-from erj@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 49NPy33yG1z3yNF; Thu, 14 May 2020 21:36:59 +0000 (UTC) (envelope-from erj@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 8276E19A53; Thu, 14 May 2020 21:36:59 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ELaxv4021147; Thu, 14 May 2020 21:36:59 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ELax9a021145; Thu, 14 May 2020 21:36:59 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142136.04ELax9a021145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 21:36:59 +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: r361061 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361061 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, 14 May 2020 21:36:59 -0000 Author: erj Date: Thu May 14 21:36:59 2020 New Revision: 361061 URL: https://svnweb.freebsd.org/changeset/base/361061 Log: MFC r356310: iflib: Prevent watchdog from resetting idle queues Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 21:12:08 2020 (r361060) +++ stable/11/sys/net/iflib.c Thu May 14 21:36:59 2020 (r361061) @@ -2144,8 +2144,11 @@ iflib_timer(void *arg) (sctx->isc_pause_frames == 0))) goto hung; - if (ifmp_ring_is_stalled(txq->ift_br)) + if (txq->ift_qstatus != IFLIB_QUEUE_IDLE && + ifmp_ring_is_stalled(txq->ift_br)) { + KASSERT(ctx->ifc_link_state == LINK_STATE_UP, ("queue can't be marked as hung if interface is down")); txq->ift_qstatus = IFLIB_QUEUE_HUNG; + } txq->ift_cleaned_prev = txq->ift_cleaned; /* handle any laggards */ if (txq->ift_db_pending) From owner-svn-src-stable-11@freebsd.org Thu May 14 21:59:24 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 259D32E18BE; Thu, 14 May 2020 21:59:24 +0000 (UTC) (envelope-from erj@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 49NQRw09L6z40rT; Thu, 14 May 2020 21:59:24 +0000 (UTC) (envelope-from erj@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 F082019E31; Thu, 14 May 2020 21:59:23 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ELxNQ4033157; Thu, 14 May 2020 21:59:23 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ELxNnA033156; Thu, 14 May 2020 21:59:23 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142159.04ELxNnA033156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 21:59:23 +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: r361063 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361063 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, 14 May 2020 21:59:24 -0000 Author: erj Date: Thu May 14 21:59:23 2020 New Revision: 361063 URL: https://svnweb.freebsd.org/changeset/base/361063 Log: Partially MFC r354344: iflib: properly release memory allocated for DMA This also removes the unused function iflib_deregister(); accidentally introduced in a previous MFC. Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 21:46:12 2020 (r361062) +++ stable/11/sys/net/iflib.c Thu May 14 21:59:23 2020 (r361063) @@ -731,7 +731,6 @@ static int iflib_legacy_setup(if_ctx_t ctx, driver_fil static void iflib_txq_check_drain(iflib_txq_t txq, int budget); static uint32_t iflib_txq_can_drain(struct ifmp_ring *); static int iflib_register(if_ctx_t); -static void iflib_deregister(if_ctx_t); static void iflib_unregister_vlan_handlers(if_ctx_t ctx); static void iflib_init_locked(if_ctx_t ctx); static void iflib_add_device_sysctl_pre(if_ctx_t ctx); @@ -1596,10 +1595,8 @@ iflib_txsd_destroy(if_ctx_t ctx, iflib_txq_t txq, int { bus_dmamap_t map; - map = NULL; - if (txq->ift_sds.ifsd_map != NULL) + if (txq->ift_sds.ifsd_map != NULL) { map = txq->ift_sds.ifsd_map[i]; - if (map != NULL) { bus_dmamap_unload(txq->ift_desc_tag, map); bus_dmamap_destroy(txq->ift_desc_tag, map); txq->ift_sds.ifsd_map[i] = NULL; @@ -2008,9 +2005,6 @@ iflib_fl_bufs_free(iflib_fl_t fl) if (fl->ifl_sds.ifsd_map != NULL) { bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; bus_dmamap_unload(fl->ifl_desc_tag, sd_map); - // XXX: Should this get moved out? - if (iflib_in_detach(fl->ifl_rxq->ifr_ctx)) - bus_dmamap_destroy(fl->ifl_desc_tag, sd_map); } if (*sd_m != NULL) { m_init(*sd_m, M_NOWAIT, MT_DATA, 0); @@ -4856,29 +4850,6 @@ iflib_unregister_vlan_handlers(if_ctx_t ctx) } -static void -iflib_deregister(if_ctx_t ctx) -{ - if_t ifp = ctx->ifc_ifp; - - /* Remove all media */ - ifmedia_removeall(&ctx->ifc_media); - - /* Ensure that VLAN event handlers are unregistered */ - iflib_unregister_vlan_handlers(ctx); - - /* Release kobject reference */ - kobj_delete((kobj_t) ctx, NULL); - - /* Free the ifnet structure */ - if_free(ifp); - - STATE_LOCK_DESTROY(ctx); - - /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ - CTX_LOCK_DESTROY(ctx); -} - static int iflib_queues_alloc(if_ctx_t ctx) { @@ -5173,8 +5144,12 @@ static void iflib_rx_structures_free(if_ctx_t ctx) { iflib_rxq_t rxq = ctx->ifc_rxqs; + if_shared_ctx_t sctx = ctx->ifc_sctx; + int i, j; - for (int i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { + for (i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { + for (j = 0; j < sctx->isc_nrxqs; j++) + iflib_dma_free(&rxq->ifr_ifdi[j]); iflib_rx_sds_free(rxq); } free(ctx->ifc_rxqs, M_IFLIB); From owner-svn-src-stable-11@freebsd.org Fri May 15 00:51:31 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 356A82E59F0; Fri, 15 May 2020 00:51:31 +0000 (UTC) (envelope-from delphij@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 49NVGV6StLz48xC; Fri, 15 May 2020 00:51:30 +0000 (UTC) (envelope-from delphij@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 D7AB21BECD; Fri, 15 May 2020 00:51:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F0pU9o038642; Fri, 15 May 2020 00:51:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F0pU3r038641; Fri, 15 May 2020 00:51:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005150051.04F0pU3r038641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 15 May 2020 00:51:30 +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: r361069 - stable/11/lib/libz X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/lib/libz X-SVN-Commit-Revision: 361069 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, 15 May 2020 00:51:31 -0000 Author: delphij Date: Fri May 15 00:51:30 2020 New Revision: 361069 URL: https://svnweb.freebsd.org/changeset/base/361069 Log: MFC r360952: Generate zlib.pc from source. Deleted: stable/11/lib/libz/zlib.pc Modified: stable/11/lib/libz/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libz/Makefile ============================================================================== --- stable/11/lib/libz/Makefile Fri May 15 00:50:52 2020 (r361068) +++ stable/11/lib/libz/Makefile Fri May 15 00:51:30 2020 (r361069) @@ -52,6 +52,17 @@ INCS= zconf.h zlib.h .PATH: ${ZLIBSRC}/test +ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h + +zlib.pc: zlib.pc.in + sed -e 's,@prefix@,/usr,g ; \ + s,@exec_prefix@,$${prefix},g ; \ + s,@libdir@,$${exec_prefix}/lib,g ; \ + s,@sharedlibdir@,$${libdir},g ; \ + s,@includedir@,$${prefix}/include,g ; \ + s,@VERSION@,${ZLIB_VERSION},g ;' \ + ${.ALLSRC} > ${.TARGET} + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz From owner-svn-src-stable-11@freebsd.org Fri May 15 01:01:05 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 0F5CE2E5CD0; Fri, 15 May 2020 01:01:05 +0000 (UTC) (envelope-from freqlabs@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 49NVTX6l7Nz49Mc; Fri, 15 May 2020 01:01:04 +0000 (UTC) (envelope-from freqlabs@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 E29D11C08B; Fri, 15 May 2020 01:01:04 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F114tT044244; Fri, 15 May 2020 01:01:04 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F113IY044235; Fri, 15 May 2020 01:01:03 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005150101.04F113IY044235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 15 May 2020 01:01:03 +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: r361070 - in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Commit-Revision: 361070 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, 15 May 2020 01:01:05 -0000 Author: freqlabs Date: Fri May 15 01:01:02 2020 New Revision: 361070 URL: https://svnweb.freebsd.org/changeset/base/361070 Log: MFC r360813: Remove APPLEKEXT ifndefs They are no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24752 Modified: stable/11/sys/fs/nfs/nfs_commonacl.c stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfsclient/nfs_clcomsubs.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c stable/11/sys/fs/nfsclient/nfs_clstate.c stable/11/sys/fs/nfsserver/nfs_nfsdcache.c stable/11/sys/fs/nfsserver/nfs_nfsdserv.c stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c stable/11/sys/fs/nfsserver/nfs_nfsdstate.c stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/fs/nfs/nfs_commonacl.c stable/12/sys/fs/nfs/nfs_commonsubs.c stable/12/sys/fs/nfsclient/nfs_clcomsubs.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/nfsclient/nfs_clstate.c stable/12/sys/fs/nfsserver/nfs_nfsdcache.c stable/12/sys/fs/nfsserver/nfs_nfsdserv.c stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c stable/12/sys/fs/nfsserver/nfs_nfsdstate.c stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonacl.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfs/nfs_commonacl.c Fri May 15 01:01:02 2020 (r361070) @@ -28,11 +28,9 @@ #include __FBSDID("$FreeBSD$"); -#ifndef APPLEKEXT #include extern int nfsrv_useacl; -#endif static int nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, enum vtype type, acl_perm_t *permp); Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ -#ifndef APPLEKEXT #include "opt_inet.h" #include "opt_inet6.h" @@ -160,7 +159,6 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy ClientID */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Reclaim Complete */ }; -#endif /* !APPLEKEXT */ static int ncl_mbuf_mhlen = MHLEN; static int nfsrv_usercnt = 0; Modified: stable/11/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -49,7 +48,6 @@ extern enum vtype newnv2tov_type[8]; extern enum vtype nv34tov_type[8]; extern int nfs_bigreply[NFSV41_NPROCS]; NFSCLSTATEMUTEX; -#endif /* !APPLEKEXT */ static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; static struct { Modified: stable/11/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clrpcops.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsclient/nfs_clrpcops.c Fri May 15 01:01:02 2020 (r361070) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); * arguments are all at the end, after the NFSPROC_T *p one. */ -#ifndef APPLEKEXT #include "opt_inet6.h" #include @@ -70,7 +69,6 @@ int nfscl_assumeposixlocks = 1; int nfscl_enablecallb = 0; short nfsv4_cbport = NFSV4_CBPORT; int nfstest_openallsetattr = 0; -#endif /* !APPLEKEXT */ #define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1)) Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clstate.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsclient/nfs_clstate.c Fri May 15 01:01:02 2020 (r361070) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); * (Since we are done with them, they do not need to be recovered.) */ -#ifndef APPLEKEXT #include /* @@ -96,7 +95,6 @@ int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER; -#endif /* !APPLEKEXT */ static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; Modified: stable/11/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdcache.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdcache.c Fri May 15 01:01:02 2020 (r361070) @@ -156,7 +156,6 @@ __FBSDID("$FreeBSD$"); * that case. This level should be set high enough that this almost * never happens. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -164,7 +163,6 @@ extern struct mtx nfsrc_udpmtx; extern struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE]; extern struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE]; int nfsrc_floodlevel = NFSRVCACHE_FLOODLEVEL, nfsrc_tcpsavedreplies = 0; -#endif /* !APPLEKEXT */ SYSCTL_DECL(_vfs_nfsd); Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 15 01:01:02 2020 (r361070) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); * For nfsv4, these functions are called for each Op within the Compound RPC. */ -#ifndef APPLEKEXT #include /* Global vars */ @@ -56,7 +55,6 @@ extern struct timeval nfsboottime; extern int nfs_rootfhset; extern int nfsrv_enable_crossmntpt; extern int nfsrv_statehashsize; -#endif /* !APPLEKEXT */ static int nfs_async = 0; SYSCTL_DECL(_vfs_nfsd); Modified: stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Fri May 15 01:01:02 2020 (r361070) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by the nfs server. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -323,7 +322,6 @@ int (*nfsrv4_ops2[NFSV41_NOPS])(struct nfsrv_descript (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t , NFSPROC_T *, struct nfsexstuff *, struct nfsexstuff *))0, (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t , NFSPROC_T *, struct nfsexstuff *, struct nfsexstuff *))0, }; -#endif /* !APPLEKEXT */ /* * Static array that defines which nfs rpc's are nonidempotent Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 15 01:01:02 2020 (r361070) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#ifndef APPLEKEXT #include struct nfsrv_stablefirst nfsrv_stablefirst; @@ -89,7 +88,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, allowreadforwriteopen, struct nfsclienthashhead *nfsclienthash; struct nfslockhashhead *nfslockhash; struct nfssessionhash *nfssessionhash; -#endif /* !APPLEKEXT */ static u_int32_t nfsrv_openpluslock = 0, nfsrv_delegatecnt = 0; static time_t nfsrvboottime; Modified: stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef APPLEKEXT /* * These functions support the macros and help fiddle mbuf chains for * the nfs op functions. They do things like create the rpc header and @@ -58,7 +57,6 @@ char nfs_v2pubfh[NFSX_V2FH]; static nfstype newnfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON, NFCHR, NFNON }; extern nfstype nfsv34_type[9]; -#endif /* !APPLEKEXT */ static u_int32_t nfsrv_isannfserr(u_int32_t); From owner-svn-src-stable-11@freebsd.org Fri May 15 20:04:02 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 193F62FF634; Fri, 15 May 2020 20:04:02 +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) 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 49NzrJ4WNNz4P9k; Fri, 15 May 2020 20:04:00 +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 B55261ECB; Fri, 15 May 2020 20:03:59 +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 04FK3xDG059987; Fri, 15 May 2020 20:03:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FK3wXa059980; Fri, 15 May 2020 20:03:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005152003.04FK3wXa059980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 15 May 2020 20:03:58 +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: r361088 - in stable/11: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/dev/dtrace X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/dev/dtrace X-SVN-Commit-Revision: 361088 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, 15 May 2020 20:04:02 -0000 Author: dim Date: Fri May 15 20:03:57 2020 New Revision: 361088 URL: https://svnweb.freebsd.org/changeset/base/361088 Log: Merge changes that enable DTrace-using ports to link correctly with lld 10, avoiding "unknown relocation 8" and other errors. MFC r312658 (by markj): Remove the DTRACEHIOC_ADD ioctl. This ioctl has been considered legacy by upstream since the DTrace code was first imported, and is unused. The removal also allows some simplification of dtrace_helper_slurp(). Also remove a bogus copyout in the DTRACEHIOC_ADDDOF handler. Due to a bug, it would overwrite an in-memory copy of the DOF header rather than the passed-in DOF helper. Moreover, DTRACEHIOC_ADDDOF already copies the helper back out automatically since its argument has the IOC_OUT attribute. MFC r313262 (by markj): Use PC-relative relocations for USDT probe sites on i386 and amd64. When recording probe site addresses in the output DOF file, dtrace -G needs to emit relocations for the .SUNW_dof section in order to obtain the addresses of functions containing probe sites. DTrace expects the addresses to be relative to the base address of the final ELF file, and the amd64 USDT implementation was relying on some unspecified and incorrect behaviour in the base system GNU ld to achieve this. This change reimplements the probe site relocation handling to allow USDT to be used with lld and newer GNU binutils. Specifically, it makes use of R_X86_64_PC64/R_386_PC32 relocations to obtain the probe site address relative to the DOF file address, and adds and uses a new DOF relocation type which computes the final probe site address using these relative offsets. Reported by and discussed with: Rafael Esp?ndola Differential Revision: https://reviews.freebsd.org/D9374 Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Fri May 15 20:03:57 2020 (r361088) @@ -462,18 +462,8 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident_t *idp, void dt_buf_write(dtp, &ddo->ddo_enoffs, pip->pi_enoffs, pip->pi_nenoffs * sizeof (uint32_t), sizeof (uint32_t)); - /* - * If pi_rname isn't set, the relocation will be against the - * function name. If it is, the relocation will be against - * pi_rname. This will be used if the function is scoped - * locally so an alternate symbol is added for the purpose - * of this relocation. - */ - if (pip->pi_rname == NULL) - dofr.dofr_name = dofpr.dofpr_func; - else - dofr.dofr_name = dof_add_string(ddo, pip->pi_rname); - dofr.dofr_type = DOF_RELO_SETX; + dofr.dofr_name = dof_add_string(ddo, pip->pi_rname); + dofr.dofr_type = DOF_RELO_DOFREL; dofr.dofr_offset = dt_buf_len(&ddo->ddo_probes); dofr.dofr_data = 0; Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Fri May 15 20:03:57 2020 (r361088) @@ -239,7 +239,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; rel->r_info = ELF32_R_INFO(count + dep->de_global, - R_386_32); + R_386_PC32); #elif defined(__mips__) /* XXX */ printf("%s:%s(%d): MIPS not implemented\n", @@ -257,15 +257,6 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, /* XXX */ printf("%s:%s(%d): RISC-V not implemented\n", __FUNCTION__, __FILE__, __LINE__); -#elif defined(__sparc) - /* - * Add 4 bytes to hit the low half of this 64-bit - * big-endian address. - */ - rel->r_offset = s->dofs_offset + - dofr[j].dofr_offset + 4; - rel->r_info = ELF32_R_INFO(count + dep->de_global, - R_SPARC_32); #else #error unknown ISA #endif @@ -274,7 +265,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = 0; sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_FUNC); - sym->st_other = 0; + sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN); sym->st_shndx = SHN_UNDEF; rel++; @@ -291,11 +282,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = dof->dofh_filesz; sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_OBJECT); -#ifdef illumos - sym->st_other = 0; -#else sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN); -#endif sym->st_shndx = ESHDR_DOF; sym++; @@ -452,19 +439,9 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, #elif defined(__i386) || defined(__amd64) rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; -#ifdef illumos rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_AMD64_64); + R_X86_64_PC64); #else - rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_X86_64_RELATIVE); -#endif -#elif defined(__sparc) - rel->r_offset = s->dofs_offset + - dofr[j].dofr_offset; - rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_SPARC_64); -#else #error unknown ISA #endif @@ -472,7 +449,7 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = 0; sym->st_info = GELF_ST_INFO(STB_GLOBAL, STT_FUNC); - sym->st_other = 0; + sym->st_other = ELF64_ST_VISIBILITY(STV_HIDDEN); sym->st_shndx = SHN_UNDEF; rel++; @@ -489,11 +466,7 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = dof->dofh_filesz; sym->st_info = GELF_ST_INFO(STB_GLOBAL, STT_OBJECT); -#ifdef illumos - sym->st_other = 0; -#else sym->st_other = ELF64_ST_VISIBILITY(STV_HIDDEN); -#endif sym->st_shndx = ESHDR_DOF; sym++; @@ -801,16 +774,15 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in } static int -dt_symtab_lookup(Elf_Data *data_sym, int nsym, uintptr_t addr, uint_t shn, - GElf_Sym *sym, int uses_funcdesc, Elf *elf) +dt_symtab_lookup(Elf_Data *data_sym, int start, int end, uintptr_t addr, + uint_t shn, GElf_Sym *sym, int uses_funcdesc, Elf *elf) { - int i, ret = -1; Elf64_Addr symval; Elf_Scn *opd_scn; Elf_Data *opd_desc; - GElf_Sym s; + int i; - for (i = 0; i < nsym && gelf_getsym(data_sym, i, sym) != NULL; i++) { + for (i = start; i < end && gelf_getsym(data_sym, i, sym) != NULL; i++) { if (GELF_ST_TYPE(sym->st_info) == STT_FUNC) { symval = sym->st_value; if (uses_funcdesc) { @@ -820,20 +792,12 @@ dt_symtab_lookup(Elf_Data *data_sym, int nsym, uintptr *(uint64_t*)((char *)opd_desc->d_buf + symval); } if ((uses_funcdesc || shn == sym->st_shndx) && - symval <= addr && - addr < symval + sym->st_size) { - if (GELF_ST_BIND(sym->st_info) == STB_GLOBAL) - return (0); - - ret = 0; - s = *sym; - } + symval <= addr && addr < symval + sym->st_size) + return (0); } } - if (ret == 0) - *sym = s; - return (ret); + return (-1); } #if defined(__aarch64__) @@ -1245,7 +1209,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e dt_provider_t *pvp; dt_probe_t *prp; uint32_t off, eclass, emachine1, emachine2; - size_t symsize, nsym, isym, istr, len; + size_t symsize, osym, nsym, isym, istr, len; key_t objkey; dt_link_pair_t *pair, *bufs = NULL; dt_strtab_t *strtab; @@ -1382,12 +1346,13 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * target (text) section to replace the call instruction with * one or more nops. * - * If the function containing the probe is locally scoped - * (static), we create an alias used by the relocation in the - * generated object. The alias, a new symbol, will be global - * (so that the relocation from the generated object can be - * resolved), and hidden (so that it is converted to a local - * symbol at link time). Such aliases have this form: + * To avoid runtime overhead, the relocations added to the + * generated object should be resolved at static link time. We + * therefore create aliases for the functions that contain + * probes. An alias is global (so that the relocation from the + * generated object can be resolved), and hidden (so that its + * address is known at static link time). Such aliases have this + * form: * * $dtrace. * @@ -1425,16 +1390,13 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e if (strncmp(s, dt_prefix, sizeof (dt_prefix) - 1) != 0) continue; - if (dt_symtab_lookup(data_sym, isym, rela.r_offset, - shdr_rel.sh_info, &fsym, - (emachine1 == EM_PPC64), elf) != 0) { + if (dt_symtab_lookup(data_sym, 0, isym, rela.r_offset, + shdr_rel.sh_info, &fsym, (emachine1 == EM_PPC64), + elf) != 0) { dt_strtab_destroy(strtab); goto err; } - if (GELF_ST_BIND(fsym.st_info) != STB_LOCAL) - continue; - if (fsym.st_name > data_str->d_size) { dt_strtab_destroy(strtab); goto err; @@ -1470,12 +1432,12 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e } /* - * If needed, allocate the additional space for the symbol - * table and string table copying the old data into the new - * buffers, and marking the buffers as dirty. We inject those - * newly allocated buffers into the libelf data structures, but - * are still responsible for freeing them once we're done with - * the elf handle. + * If any probes were found, allocate the additional space for + * the symbol table and string table, copying the old data into + * the new buffers, and marking the buffers as dirty. We inject + * those newly allocated buffers into the libelf data + * structures, but are still responsible for freeing them once + * we're done with the elf handle. */ if (nsym > 0) { /* @@ -1524,9 +1486,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e shdr_sym.sh_size += nsym * symsize; (void) gelf_update_shdr(scn_sym, &shdr_sym); + osym = isym; nsym += isym; } else { dt_strtab_destroy(strtab); + continue; } /* @@ -1585,8 +1549,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e bcopy(s, pname, p - s); pname[p - s] = '\0'; - if (dt_symtab_lookup(data_sym, isym, rela.r_offset, - shdr_rel.sh_info, &fsym, + if (dt_symtab_lookup(data_sym, osym, isym, + rela.r_offset, shdr_rel.sh_info, &fsym, + (emachine1 == EM_PPC64), elf) != 0 && + dt_symtab_lookup(data_sym, 0, osym, + rela.r_offset, shdr_rel.sh_info, &fsym, (emachine1 == EM_PPC64), elf) != 0) goto err; @@ -1596,37 +1563,30 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e assert(GELF_ST_TYPE(fsym.st_info) == STT_FUNC); /* - * If a NULL relocation name is passed to - * dt_probe_define(), the function name is used for the - * relocation. The relocation needs to use a mangled - * name if the symbol is locally scoped; the function - * name may need to change if we've found the global - * alias for the locally scoped symbol (we prefer - * global symbols to locals in dt_symtab_lookup()). + * If this is our first time encountering this symbol, + * emit an alias. */ s = (char *)data_str->d_buf + fsym.st_name; - r = NULL; - if (GELF_ST_BIND(fsym.st_info) == STB_LOCAL) { + if (strncmp(s, dt_symprefix, + sizeof (dt_symprefix) - 1) != 0) { + u_int bind = GELF_ST_BIND(fsym.st_info); + dsym = fsym; dsym.st_name = istr; - dsym.st_info = GELF_ST_INFO(STB_GLOBAL, - STT_FUNC); - dsym.st_other = - ELF64_ST_VISIBILITY(STV_ELIMINATE); + dsym.st_info = GELF_ST_INFO(bind == STB_LOCAL ? + STB_GLOBAL : bind, STT_FUNC); + dsym.st_other = GELF_ST_VISIBILITY(STV_HIDDEN); (void) gelf_update_sym(data_sym, isym, &dsym); - - r = (char *)data_str->d_buf + istr; - istr += 1 + sprintf(r, dt_symfmt, - dt_symprefix, objkey, s); + r = (char *) data_str->d_buf + istr; + istr += 1 + sprintf(r, dt_symfmt, dt_symprefix, objkey, + s); isym++; assert(isym <= nsym); - - } else if (strncmp(s, dt_symprefix, - strlen(dt_symprefix)) == 0) { + } else { r = s; - if ((s = strchr(s, '.')) == NULL) - goto err; + s = strchr(s, '.'); + assert(s != NULL); s++; } Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c Fri May 15 20:03:57 2020 (r361088) @@ -545,9 +545,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, for (pip = prp->pr_inst; pip != NULL; pip = pip->pi_next) { if (strcmp(pip->pi_fname, fname) == 0 && - ((rname == NULL && pip->pi_rname == NULL) || - (rname != NULL && pip->pi_rname != NULL && - strcmp(pip->pi_rname, rname) == 0))) + strcmp(pip->pi_rname, rname) == 0) break; } @@ -565,7 +563,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, if ((pip->pi_fname = strdup(fname)) == NULL) goto nomem; - if (rname != NULL && (pip->pi_rname = strdup(rname)) == NULL) + if ((pip->pi_rname = strdup(rname)) == NULL) goto nomem; pip->pi_noffs = 0; @@ -605,7 +603,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, dt_dprintf("defined probe %s %s:%s %s() +0x%x (%s)\n", isenabled ? "(is-enabled)" : "", pvp->pv_desc.dtvd_name, prp->pr_ident->di_name, fname, offset, - rname != NULL ? rname : fname); + rname); assert(*noffs < *maxoffs); (*offs)[(*noffs)++] = offset; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri May 15 20:03:57 2020 (r361088) @@ -13886,12 +13886,13 @@ err: /* * Apply the relocations from the specified 'sec' (a DOF_SECT_URELHDR) to the - * specified DOF. At present, this amounts to simply adding 'ubase' to the - * site of any user SETX relocations to account for load object base address. - * In the future, if we need other relocations, this function can be extended. + * specified DOF. SETX relocations are computed using 'ubase', the base load + * address of the object containing the DOF, and DOFREL relocations are relative + * to the relocation offset within the DOF. */ static int -dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, uint64_t ubase) +dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, uint64_t ubase, + uint64_t udaddr) { uintptr_t daddr = (uintptr_t)dof; uintptr_t ts_end; @@ -13931,6 +13932,7 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui case DOF_RELO_NONE: break; case DOF_RELO_SETX: + case DOF_RELO_DOFREL: if (r->dofr_offset >= ts->dofs_size || r->dofr_offset + sizeof (uint64_t) > ts->dofs_size) { dtrace_dof_error(dof, "bad relocation offset"); @@ -13947,7 +13949,11 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui return (-1); } - *(uint64_t *)taddr += ubase; + if (r->dofr_type == DOF_RELO_SETX) + *(uint64_t *)taddr += ubase; + else + *(uint64_t *)taddr += + udaddr + ts->dofs_offset + r->dofr_offset; break; default: dtrace_dof_error(dof, "invalid relocation type"); @@ -13968,7 +13974,7 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui */ static int dtrace_dof_slurp(dof_hdr_t *dof, dtrace_vstate_t *vstate, cred_t *cr, - dtrace_enabling_t **enabp, uint64_t ubase, int noprobes) + dtrace_enabling_t **enabp, uint64_t ubase, uint64_t udaddr, int noprobes) { uint64_t len = dof->dofh_loadsz, seclen; uintptr_t daddr = (uintptr_t)dof; @@ -14130,7 +14136,7 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_vstate_t *vsta switch (sec->dofs_type) { case DOF_SECT_URELHDR: - if (dtrace_dof_relocate(dof, sec, ubase) != 0) + if (dtrace_dof_relocate(dof, sec, ubase, udaddr) != 0) return (-1); break; } @@ -15495,7 +15501,7 @@ dtrace_anon_property(void) } rv = dtrace_dof_slurp(dof, &state->dts_vstate, CRED(), - &dtrace_anon.dta_enabling, 0, B_TRUE); + &dtrace_anon.dta_enabling, 0, 0, B_TRUE); if (rv == 0) rv = dtrace_dof_options(dof, state); @@ -16250,18 +16256,11 @@ dtrace_helper_provider_validate(dof_hdr_t *dof, dof_se } static int -#ifdef __FreeBSD__ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp, struct proc *p) -#else -dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) -#endif { dtrace_helpers_t *help; dtrace_vstate_t *vstate; dtrace_enabling_t *enab = NULL; -#ifndef __FreeBSD__ - proc_t *p = curproc; -#endif int i, gen, rv, nhelpers = 0, nprovs = 0, destroy = 1; uintptr_t daddr = (uintptr_t)dof; @@ -16272,8 +16271,8 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) vstate = &help->dthps_vstate; - if ((rv = dtrace_dof_slurp(dof, vstate, NULL, &enab, - dhp != NULL ? dhp->dofhp_addr : 0, B_FALSE)) != 0) { + if ((rv = dtrace_dof_slurp(dof, vstate, NULL, &enab, dhp->dofhp_addr, + dhp->dofhp_dof, B_FALSE)) != 0) { dtrace_dof_destroy(dof); return (rv); } @@ -16281,22 +16280,20 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) /* * Look for helper providers and validate their descriptions. */ - if (dhp != NULL) { - for (i = 0; i < dof->dofh_secnum; i++) { - dof_sec_t *sec = (dof_sec_t *)(uintptr_t)(daddr + - dof->dofh_secoff + i * dof->dofh_secsize); + for (i = 0; i < dof->dofh_secnum; i++) { + dof_sec_t *sec = (dof_sec_t *)(uintptr_t)(daddr + + dof->dofh_secoff + i * dof->dofh_secsize); - if (sec->dofs_type != DOF_SECT_PROVIDER) - continue; + if (sec->dofs_type != DOF_SECT_PROVIDER) + continue; - if (dtrace_helper_provider_validate(dof, sec) != 0) { - dtrace_enabling_destroy(enab); - dtrace_dof_destroy(dof); - return (-1); - } - - nprovs++; + if (dtrace_helper_provider_validate(dof, sec) != 0) { + dtrace_enabling_destroy(enab); + dtrace_dof_destroy(dof); + return (-1); } + + nprovs++; } /* @@ -16337,7 +16334,7 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) gen = help->dthps_generation++; dtrace_enabling_destroy(enab); - if (dhp != NULL && nprovs > 0) { + if (nprovs > 0) { /* * Now that this is in-kernel, we change the sense of the * members: dofhp_dof denotes the in-kernel copy of the DOF Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Fri May 15 20:03:53 2020 (r361087) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Fri May 15 20:03:57 2020 (r361088) @@ -788,6 +788,7 @@ typedef struct dof_relodesc { #define DOF_RELO_NONE 0 /* empty relocation entry */ #define DOF_RELO_SETX 1 /* relocate setx value */ +#define DOF_RELO_DOFREL 2 /* relocate DOF-relative value */ typedef struct dof_optdesc { uint32_t dofo_option; /* option identifier */ @@ -1414,7 +1415,6 @@ typedef struct { #define DTRACEHIOC_REMOVE (DTRACEHIOC | 2) /* remove helper */ #define DTRACEHIOC_ADDDOF (DTRACEHIOC | 3) /* add helper DOF */ #else -#define DTRACEHIOC_ADD _IOWR('z', 1, dof_hdr_t)/* add helper */ #define DTRACEHIOC_REMOVE _IOW('z', 2, int) /* remove helper */ #define DTRACEHIOC_ADDDOF _IOWR('z', 3, dof_helper_t)/* add helper DOF */ #endif Modified: stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri May 15 20:03:57 2020 (r361088) @@ -44,10 +44,8 @@ dtrace_ioctl_helper(struct cdev *dev, u_long cmd, cadd case DTRACEHIOC_ADDDOF: dhp = (dof_helper_t *)addr; addr = (caddr_t)(uintptr_t)dhp->dofhp_dof; - /* FALLTHROUGH */ - case DTRACEHIOC_ADD: - p = curproc; - if (dhp == NULL || p->p_pid == dhp->dofhp_pid) { + if (p->p_pid == dhp->dofhp_pid) { + p = curproc; dof = dtrace_dof_copyin((uintptr_t)addr, &rval); } else { p = pfind(dhp->dofhp_pid); @@ -72,10 +70,7 @@ dtrace_ioctl_helper(struct cdev *dev, u_long cmd, cadd mutex_enter(&dtrace_lock); if ((rval = dtrace_helper_slurp(dof, dhp, p)) != -1) { - if (dhp != NULL) { - dhp->dofhp_gen = rval; - copyout(dhp, addr, sizeof(*dhp)); - } + dhp->dofhp_gen = rval; rval = 0; } else { rval = EINVAL; @@ -432,7 +427,8 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t add return (EBUSY); } - if (dtrace_dof_slurp(dof, vstate, td->td_ucred, &enab, 0, B_TRUE) != 0) { + if (dtrace_dof_slurp(dof, vstate, td->td_ucred, &enab, 0, 0, + B_TRUE) != 0) { mutex_exit(&dtrace_lock); mutex_exit(&cpu_lock); dtrace_dof_destroy(dof); From owner-svn-src-stable-11@freebsd.org Sat May 16 09:40:18 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 83BF22EB8AB; Sat, 16 May 2020 09:40:18 +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) 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 49PKyB2vzBz4BMH; Sat, 16 May 2020 09:40:18 +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 5F323BD48; Sat, 16 May 2020 09:40:18 +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 04G9eIj3063427; Sat, 16 May 2020 09:40:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G9eIkf063426; Sat, 16 May 2020 09:40:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005160940.04G9eIkf063426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 May 2020 09:40:18 +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: r361109 - 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: 361109 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, 16 May 2020 09:40:18 -0000 Author: kib Date: Sat May 16 09:40:17 2020 New Revision: 361109 URL: https://svnweb.freebsd.org/changeset/base/361109 Log: MFC r360845: Avoid spurious ENOMEMs from sysctl hw.pagesizes. PR: 246215 Modified: stable/11/sys/kern/kern_mib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mib.c ============================================================================== --- stable/11/sys/kern/kern_mib.c Sat May 16 09:03:18 2020 (r361108) +++ stable/11/sys/kern/kern_mib.c Sat May 16 09:40:17 2020 (r361109) @@ -228,6 +228,7 @@ static int sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) { int error; + size_t len; #ifdef SCTL_MASK32 int i; uint32_t pagesizes32[MAXPAGESIZES]; @@ -240,10 +241,18 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; - error = SYSCTL_OUT(req, pagesizes32, sizeof(pagesizes32)); + len = sizeof(pagesizes32); + if (len > req->oldlen) + len = req->oldlen; + error = SYSCTL_OUT(req, pagesizes32, len); } else #endif - error = SYSCTL_OUT(req, pagesizes, sizeof(pagesizes)); + { + len = sizeof(pagesizes); + if (len > req->oldlen) + len = req->oldlen; + error = SYSCTL_OUT(req, pagesizes, len); + } return (error); } SYSCTL_PROC(_hw, OID_AUTO, pagesizes, CTLTYPE_ULONG | CTLFLAG_RD,